import{a as qe}from"./chunk-V3WVIUUL.min.js";import{a as Qe}from"./chunk-I6VG5SPK.min.js";import"./chunk-LK7NMYKK.min.js";import{a as ze}from"./chunk-7EBV5LUJ.min.js";import"./chunk-6RTTMAJH.min.js";import"./chunk-LGVO22YL.min.js";import"./chunk-HVSI2YYT.min.js";import"./chunk-6B6J5Z6Z.min.js";import"./chunk-EU44H33B.min.js";import"./chunk-CQUFH26W.min.js";import"./chunk-LBFZT66H.min.js";import{b as Ze,c as ke,d as he,g as le}from"./chunk-XCAVDAZC.min.js";import"./chunk-R5JLOOQ4.min.js";import"./chunk-PTL4EUOE.min.js";import{a as Ee}from"./chunk-XXYYAETH.min.js";import{l as Be,p as $e}from"./chunk-QZZKR5JD.min.js";import"./chunk-CM5D5KZN.min.js";import{D as Fe,M as be,P as Pe,Q as Ge,R as Ue,S as Ye,T as Xe,U as He,V as We,W as se,q as Re,y as Se}from"./chunk-3EE2TK35.min.js";import"./chunk-E5F23VE2.min.js";import{b as ct,d as ye,j as Ve}from"./chunk-6TVUEPFY.min.js";import{a as pe,d as ur}from"./chunk-OSRY5VT3.min.js";var Te=pe((re,me)=>{(function(w,N){typeof re=="object"&&typeof me=="object"?me.exports=N():typeof define=="function"&&define.amd?define([],N):typeof re=="object"?re.layoutBase=N():w.layoutBase=N()})(re,function(){return(function(m){var w={};function N(u){if(w[u])return w[u].exports;var o=w[u]={i:u,l:!1,exports:{}};return m[u].call(o.exports,o,o.exports,N),o.l=!0,o.exports}return N.m=m,N.c=w,N.i=function(u){return u},N.d=function(u,o,n){N.o(u,o)||Object.defineProperty(u,o,{configurable:!1,enumerable:!0,get:n})},N.n=function(u){var o=u&&u.__esModule?function(){return u.default}:function(){return u};return N.d(o,"a",o),o},N.o=function(u,o){return Object.prototype.hasOwnProperty.call(u,o)},N.p="",N(N.s=28)})([(function(m,w,N){"use strict";function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,m.exports=u}),(function(m,w,N){"use strict";var u=N(2),o=N(8),n=N(9);function e(c,t,g){u.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=c,this.target=t}e.prototype=Object.create(u.prototype);for(var a in u)e[a]=u[a];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;if(this.target===c)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(c,t){for(var g=this.getOtherEnd(c),i=t.getGraphManager().getRoot();;){if(g.getOwner()==t)return g;if(g.getOwner()==i)break;g=g.getOwner().getParent()}return null},e.prototype.updateLength=function(){var c=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),c),this.isOverlapingSourceAndTarget||(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=e}),(function(m,w,N){"use strict";function u(o){this.vGraphObject=o}m.exports=u}),(function(m,w,N){"use strict";var u=N(2),o=N(10),n=N(13),e=N(0),a=N(16),c=N(5);function t(i,r,h,f){h==null&&f==null&&(f=r),u.call(this,f),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=i,h!=null&&r!=null?this.rect=new n(r.x,r.y,h.width,h.height):this.rect=new n}t.prototype=Object.create(u.prototype);for(var g in u)t[g]=u[g];t.prototype.getEdges=function(){return this.edges},t.prototype.getChild=function(){return this.child},t.prototype.getOwner=function(){return this.owner},t.prototype.getWidth=function(){return this.rect.width},t.prototype.setWidth=function(i){this.rect.width=i},t.prototype.getHeight=function(){return this.rect.height},t.prototype.setHeight=function(i){this.rect.height=i},t.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},t.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},t.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},t.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},t.prototype.getRect=function(){return this.rect},t.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},t.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},t.prototype.setRect=function(i,r){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=r.width,this.rect.height=r.height},t.prototype.setCenter=function(i,r){this.rect.x=i-this.rect.width/2,this.rect.y=r-this.rect.height/2},t.prototype.setLocation=function(i,r){this.rect.x=i,this.rect.y=r},t.prototype.moveBy=function(i,r){this.rect.x+=i,this.rect.y+=r},t.prototype.getEdgeListToNode=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(l.target==i){if(l.source!=f)throw"Incorrect edge source!";r.push(l)}}),r},t.prototype.getEdgesBetween=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(!(l.source==f||l.target==f))throw"Incorrect edge source and/or target";(l.target==i||l.source==i)&&r.push(l)}),r},t.prototype.getNeighborsList=function(){var i=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)i.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";i.add(h.source)}}),i},t.prototype.withChildren=function(){var i=new Set,r,h;if(i.add(this),this.child!=null)for(var f=this.child.getNodes(),l=0;lr?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},t.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},t.prototype.transform=function(i){var r=this.rect.x;r>e.WORLD_BOUNDARY?r=e.WORLD_BOUNDARY:r<-e.WORLD_BOUNDARY&&(r=-e.WORLD_BOUNDARY);var h=this.rect.y;h>e.WORLD_BOUNDARY?h=e.WORLD_BOUNDARY:h<-e.WORLD_BOUNDARY&&(h=-e.WORLD_BOUNDARY);var f=new c(r,h),l=i.inverseTransformPoint(f);this.setLocation(l.x,l.y)},t.prototype.getLeft=function(){return this.rect.x},t.prototype.getRight=function(){return this.rect.x+this.rect.width},t.prototype.getTop=function(){return this.rect.y},t.prototype.getBottom=function(){return this.rect.y+this.rect.height},t.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=t}),(function(m,w,N){"use strict";var u=N(0);function o(){}for(var n in u)o[n]=u[n];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=o}),(function(m,w,N){"use strict";function u(o,n){o==null&&n==null?(this.x=0,this.y=0):(this.x=o,this.y=n)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(o){this.x=o},u.prototype.setY=function(o){this.y=o},u.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},m.exports=u}),(function(m,w,N){"use strict";var u=N(2),o=N(10),n=N(0),e=N(7),a=N(3),c=N(1),t=N(13),g=N(12),i=N(11);function r(f,l,L){u.call(this,L),this.estimatedSize=o.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}r.prototype=Object.create(u.prototype);for(var h in u)r[h]=u[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(f,l,L){if(l==null&&L==null){var y=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(y)>-1)throw"Node already in graph!";return y.owner=this,this.getNodes().push(y),y}else{var p=f;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(L)>-1))throw"Source or target not in graph!";if(!(l.owner==L.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=L.owner?null:(p.source=l,p.target=L,p.isInterGraph=!1,this.getEdges().push(p),l.edges.push(p),L!=l&&L.edges.push(p),p)}},r.prototype.remove=function(f){var l=f;if(f instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var L=l.edges.slice(),y,p=L.length,C=0;C-1&&S>-1))throw"Source and/or target doesn't know this edge!";y.source.edges.splice(A,1),y.target!=y.source&&y.target.edges.splice(S,1);var R=y.source.owner.getEdges().indexOf(y);if(R==-1)throw"Not in owner's edge list!";y.source.owner.getEdges().splice(R,1)}},r.prototype.updateLeftTop=function(){for(var f=o.MAX_VALUE,l=o.MAX_VALUE,L,y,p,C=this.getNodes(),R=C.length,A=0;AL&&(f=L),l>y&&(l=y)}return f==o.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?p=C[0].getParent().paddingLeft:p=this.margin,this.left=l-p,this.top=f-p,new g(this.left,this.top))},r.prototype.updateBounds=function(f){for(var l=o.MAX_VALUE,L=-o.MAX_VALUE,y=o.MAX_VALUE,p=-o.MAX_VALUE,C,R,A,S,B,Y=this.nodes,tt=Y.length,x=0;xC&&(l=C),LA&&(y=A),pC&&(l=C),LA&&(y=A),p=this.nodes.length){var tt=0;L.forEach(function(x){x.owner==f&&tt++}),tt==this.nodes.length&&(this.isConnected=!0)}},m.exports=r}),(function(m,w,N){"use strict";var u,o=N(1);function n(e){u=N(6),this.layout=e,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var e=this.layout.newGraph(),a=this.layout.newNode(null),c=this.add(e,a);return this.setRootGraph(c),this.rootGraph},n.prototype.add=function(e,a,c,t,g){if(c==null&&t==null&&g==null){if(e==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return e.parent=a,a.child=e,e}else{g=c,t=a,c=e;var i=t.getOwner(),r=g.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==r)return c.isInterGraph=!1,i.add(c,t,g);if(c.isInterGraph=!0,c.source=t,c.target=g,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}},n.prototype.remove=function(e){if(e instanceof u){var a=e;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(a.getEdges());for(var t,g=c.length,i=0;i=e.getRight()?a[0]+=Math.min(e.getX()-n.getX(),n.getRight()-e.getRight()):e.getX()<=n.getX()&&e.getRight()>=n.getRight()&&(a[0]+=Math.min(n.getX()-e.getX(),e.getRight()-n.getRight())),n.getY()<=e.getY()&&n.getBottom()>=e.getBottom()?a[1]+=Math.min(e.getY()-n.getY(),n.getBottom()-e.getBottom()):e.getY()<=n.getY()&&e.getBottom()>=n.getBottom()&&(a[1]+=Math.min(n.getY()-e.getY(),e.getBottom()-n.getBottom()));var g=Math.abs((e.getCenterY()-n.getCenterY())/(e.getCenterX()-n.getCenterX()));e.getCenterY()===n.getCenterY()&&e.getCenterX()===n.getCenterX()&&(g=1);var i=g*a[0],r=a[1]/g;a[0]i)return a[0]=c,a[1]=h,a[2]=g,a[3]=Y,!1;if(tg)return a[0]=r,a[1]=t,a[2]=S,a[3]=i,!1;if(cg?(a[0]=l,a[1]=L,s=!0):(a[0]=f,a[1]=h,s=!0):v===d&&(c>g?(a[0]=r,a[1]=h,s=!0):(a[0]=y,a[1]=L,s=!0)),-T===d?g>c?(a[2]=B,a[3]=Y,E=!0):(a[2]=S,a[3]=A,E=!0):T===d&&(g>c?(a[2]=R,a[3]=A,E=!0):(a[2]=tt,a[3]=Y,E=!0)),s&&E)return!1;if(c>g?t>i?(D=this.getCardinalDirection(v,d,4),O=this.getCardinalDirection(T,d,2)):(D=this.getCardinalDirection(-v,d,3),O=this.getCardinalDirection(-T,d,1)):t>i?(D=this.getCardinalDirection(-v,d,1),O=this.getCardinalDirection(-T,d,3)):(D=this.getCardinalDirection(v,d,2),O=this.getCardinalDirection(T,d,4)),!s)switch(D){case 1:F=h,P=c+-C/d,a[0]=P,a[1]=F;break;case 2:P=y,F=t+p*d,a[0]=P,a[1]=F;break;case 3:F=L,P=c+C/d,a[0]=P,a[1]=F;break;case 4:P=l,F=t+-p*d,a[0]=P,a[1]=F;break}if(!E)switch(O){case 1:Z=A,I=g+-k/d,a[2]=I,a[3]=Z;break;case 2:I=tt,Z=i+x*d,a[2]=I,a[3]=Z;break;case 3:Z=Y,I=g+k/d,a[2]=I,a[3]=Z;break;case 4:I=B,Z=i+-x*d,a[2]=I,a[3]=Z;break}}return!1},o.getCardinalDirection=function(n,e,a){return n>e?a:1+a%4},o.getIntersection=function(n,e,a,c){if(c==null)return this.getIntersection2(n,e,a);var t=n.x,g=n.y,i=e.x,r=e.y,h=a.x,f=a.y,l=c.x,L=c.y,y=void 0,p=void 0,C=void 0,R=void 0,A=void 0,S=void 0,B=void 0,Y=void 0,tt=void 0;return C=r-g,A=t-i,B=i*g-t*r,R=L-f,S=h-l,Y=l*f-h*L,tt=C*S-R*A,tt===0?null:(y=(A*Y-S*B)/tt,p=(R*B-C*Y)/tt,new u(y,p))},o.angleOfVector=function(n,e,a,c){var t=void 0;return n!==a?(t=Math.atan((c-e)/(a-n)),a=0){var L=(-h+Math.sqrt(h*h-4*r*f))/(2*r),y=(-h-Math.sqrt(h*h-4*r*f))/(2*r),p=null;return L>=0&&L<=1?[L]:y>=0&&y<=1?[y]:p}else return null},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,m.exports=o}),(function(m,w,N){"use strict";function u(){}u.sign=function(o){return o>0?1:o<0?-1:0},u.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},u.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},m.exports=u}),(function(m,w,N){"use strict";function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,m.exports=u}),(function(m,w,N){"use strict";var u=(function(){function t(g,i){for(var r=0;r"u"?"undefined":u(n);return n==null||e!="object"&&e!="function"},m.exports=o}),(function(m,w,N){"use strict";function u(h){if(Array.isArray(h)){for(var f=0,l=Array(h.length);f0&&f;){for(C.push(A[0]);C.length>0&&f;){var S=C[0];C.splice(0,1),p.add(S);for(var B=S.getEdges(),y=0;y-1&&A.splice(k,1)}p=new Set,R=new Map}}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var f=[],l=h.source,L=this.graphManager.calcLowestCommonAncestor(h.source,h.target),y=0;y0){for(var L=this.edgeToDummyNodes.get(l),y=0;y=0&&f.splice(Y,1);var tt=R.getNeighborsList();tt.forEach(function(s){if(l.indexOf(s)<0){var E=L.get(s),v=E-1;v==1&&S.push(s),L.set(s,v)}})}l=l.concat(S),(f.length==1||f.length==2)&&(y=!0,p=f[0])}return p},r.prototype.setGraphManager=function(h){this.graphManager=h},m.exports=r}),(function(m,w,N){"use strict";function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},m.exports=u}),(function(m,w,N){"use strict";var u=N(5);function o(n,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(n){this.lworldExtX=n},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(n){this.lworldExtY=n},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},o.prototype.transformX=function(n){var e=0,a=this.lworldExtX;return a!=0&&(e=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/a),e},o.prototype.transformY=function(n){var e=0,a=this.lworldExtY;return a!=0&&(e=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/a),e},o.prototype.inverseTransformX=function(n){var e=0,a=this.ldeviceExtX;return a!=0&&(e=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/a),e},o.prototype.inverseTransformY=function(n){var e=0,a=this.ldeviceExtY;return a!=0&&(e=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/a),e},o.prototype.inverseTransformPoint=function(n){var e=new u(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return e},m.exports=o}),(function(m,w,N){"use strict";function u(i){if(Array.isArray(i)){for(var r=0,h=Array(i.length);rn.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(i>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(i-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},t.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),r,h=0;h0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,f,l,L,y=this.getAllNodes(),p;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),p=new Set,h=0;hC||p>C)&&(i.gravitationForceX=-this.gravityConstant*l,i.gravitationForceY=-this.gravityConstant*L)):(C=r.getEstimatedSize()*this.compoundGravityRangeFactor,(y>C||p>C)&&(i.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*L*this.compoundGravityConstant))},t.prototype.isConverged=function(){var i,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement=y.length||C>=y[0].length)){for(var R=0;Rt}}]),a})();m.exports=e}),(function(m,w,N){"use strict";function u(){}u.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var n=Math.min(this.m,this.n);this.s=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(Math.min(this.m+1,this.n)),this.U=(function(Dt){var Nt=function $t(Rt){if(Rt.length==0)return 0;for(var Xt=[],zt=0;zt0;)Nt.push(0);return Nt})(this.n),a=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(this.m),c=!0,t=!0,g=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m)),r=0;r=0;d--)if(this.s[d]!==0){for(var D=d+1;D=0;b--){if((function(Dt,Nt){return Dt&&Nt})(b0;){var Q=void 0,Ut=void 0;for(Q=E-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(e[Q])<=St+Lt*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){e[Q]=0;break}if(Q===E-2)Ut=4;else{var wt=void 0;for(wt=E-1;wt>=Q&&wt!==Q;wt--){var nt=(wt!==E?Math.abs(e[wt]):0)+(wt!==Q+1?Math.abs(e[wt-1]):0);if(Math.abs(this.s[wt])<=St+Lt*nt){this.s[wt]=0;break}}wt===Q?Ut=3:wt===E-1?Ut=1:(Ut=2,Q=wt)}switch(Q++,Ut){case 1:{var et=e[E-2];e[E-2]=0;for(var pt=E-2;pt>=Q;pt--){var Et=u.hypot(this.s[pt],et),Ct=this.s[pt]/Et,mt=et/Et;if(this.s[pt]=Et,pt!==Q&&(et=-mt*e[pt-1],e[pt-1]=Ct*e[pt-1]),t)for(var Tt=0;Tt=this.s[Q+1]);){var lt=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=lt,t&&QMath.abs(n)?(e=n/o,e=Math.abs(o)*Math.sqrt(1+e*e)):n!=0?(e=o/n,e=Math.abs(n)*Math.sqrt(1+e*e)):e=0,e},m.exports=u}),(function(m,w,N){"use strict";var u=(function(){function e(a,c){for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,e),this.sequence1=a,this.sequence2=c,this.match_score=t,this.mismatch_penalty=g,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=c.length+1,this.grid=new Array(this.iMax);for(var r=0;r=0;a--){var c=this.listeners[a];c.event===n&&c.callback===e&&this.listeners.splice(a,1)}},o.emit=function(n,e){for(var a=0;a{(function(w,N){typeof ie=="object"&&typeof Ne=="object"?Ne.exports=N(Te()):typeof define=="function"&&define.amd?define(["layout-base"],N):typeof ie=="object"?ie.coseBase=N(Te()):w.coseBase=N(w.layoutBase)})(ie,function(m){return(()=>{"use strict";var w={45:((n,e,a)=>{var c={};c.layoutBase=a(551),c.CoSEConstants=a(806),c.CoSEEdge=a(767),c.CoSEGraph=a(880),c.CoSEGraphManager=a(578),c.CoSELayout=a(765),c.CoSENode=a(991),c.ConstraintHandler=a(902),n.exports=c}),806:((n,e,a)=>{var c=a(551).FDLayoutConstants;function t(){}for(var g in c)t[g]=c[g];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,t.ENFORCE_CONSTRAINTS=!0,t.APPLY_LAYOUT=!0,t.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,t.TREE_REDUCTION_ON_INCREMENTAL=!0,t.PURE_INCREMENTAL=t.DEFAULT_INCREMENTAL,n.exports=t}),767:((n,e,a)=>{var c=a(551).FDLayoutEdge;function t(i,r,h){c.call(this,i,r,h)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];n.exports=t}),880:((n,e,a)=>{var c=a(551).LGraph;function t(i,r,h){c.call(this,i,r,h)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];n.exports=t}),578:((n,e,a)=>{var c=a(551).LGraphManager;function t(i){c.call(this,i)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];n.exports=t}),765:((n,e,a)=>{var c=a(551).FDLayout,t=a(578),g=a(880),i=a(991),r=a(767),h=a(806),f=a(902),l=a(551).FDLayoutConstants,L=a(551).LayoutConstants,y=a(551).Point,p=a(551).PointD,C=a(551).DimensionD,R=a(551).Layout,A=a(551).Integer,S=a(551).IGeometry,B=a(551).LGraph,Y=a(551).Transform,tt=a(551).LinkedList;function x(){c.call(this),this.toBeTiled={},this.constraints={}}x.prototype=Object.create(c.prototype);for(var k in c)x[k]=c[k];x.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},x.prototype.newGraph=function(s){return new g(null,this.graphManager,s)},x.prototype.newNode=function(s){return new i(this.graphManager,s)},x.prototype.newEdge=function(s){return new r(null,null,s)},x.prototype.initParameters=function(){c.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){c.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){var s=L.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(D){return E.has(D)});this.graphManager.setAllNodesToApplyGravitation(v)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(T){return E.has(T)});this.graphManager.setAllNodesToApplyGravitation(v),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(d){return s.has(d)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var v=!this.isTreeGrowing&&!this.isGrowthFinished,T=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(v,T),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),E={},v=0;v0&&this.updateDisplacements();for(var v=0;v0&&(T.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var O=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(M){s.fixedNodesOnHorizontal.add(M),s.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var F=this.constraints.alignmentConstraint.vertical,v=0;v=2*M.length/3;J--)U=Math.floor(Math.random()*(J+1)),X=M[J],M[J]=M[U],M[U]=X;return M},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var U=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;s.nodesInRelativeHorizontal.includes(U)||(s.nodesInRelativeHorizontal.push(U),s.nodeToRelativeConstraintMapHorizontal.set(U,[]),s.dummyToNodeForVerticalAlignment.has(U)?s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(U)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(U).getCenterX())),s.nodesInRelativeHorizontal.includes(X)||(s.nodesInRelativeHorizontal.push(X),s.nodeToRelativeConstraintMapHorizontal.set(X,[]),s.dummyToNodeForVerticalAlignment.has(X)?s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(X).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(U).push({right:X,gap:M.gap}),s.nodeToRelativeConstraintMapHorizontal.get(X).push({left:U,gap:M.gap})}else{var J=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;s.nodesInRelativeVertical.includes(J)||(s.nodesInRelativeVertical.push(J),s.nodeToRelativeConstraintMapVertical.set(J,[]),s.dummyToNodeForHorizontalAlignment.has(J)?s.nodeToTempPositionMapVertical.set(J,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(J,s.idToNodeMap.get(J).getCenterY())),s.nodesInRelativeVertical.includes(st)||(s.nodesInRelativeVertical.push(st),s.nodeToRelativeConstraintMapVertical.set(st,[]),s.dummyToNodeForHorizontalAlignment.has(st)?s.nodeToTempPositionMapVertical.set(st,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(st)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(st,s.idToNodeMap.get(st).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(J).push({bottom:st,gap:M.gap}),s.nodeToRelativeConstraintMapVertical.get(st).push({top:J,gap:M.gap})}});else{var Z=new Map,_=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var U=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;Z.has(U)?Z.get(U).push(X):Z.set(U,[X]),Z.has(X)?Z.get(X).push(U):Z.set(X,[U])}else{var J=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;_.has(J)?_.get(J).push(st):_.set(J,[st]),_.has(st)?_.get(st).push(J):_.set(st,[J])}});var b=function(U,X){var J=[],st=[],Lt=new tt,St=new Set,Q=0;return U.forEach(function(Ut,wt){if(!St.has(wt)){J[Q]=[],st[Q]=!1;var nt=wt;for(Lt.push(nt),St.add(nt),J[Q].push(nt);Lt.length!=0;){nt=Lt.shift(),X.has(nt)&&(st[Q]=!0);var et=U.get(nt);et.forEach(function(pt){St.has(pt)||(Lt.push(pt),St.add(pt),J[Q].push(pt))})}Q++}}),{components:J,isFixed:st}},j=b(Z,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var V=b(_,s.fixedNodesOnVertical);this.componentsOnVertical=V.components,this.fixedComponentsOnVertical=V.isFixed}}},x.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(V){var M=s.idToNodeMap.get(V.nodeId);M.displacementX=0,M.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,v=0;v1){var P;for(P=0;PT&&(T=Math.floor(O.y)),D=Math.floor(O.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(L.WORLD_CENTER_X-O.x/2,L.WORLD_CENTER_Y-O.y/2))},x.radialLayout=function(s,E,v){var T=Math.max(this.maxDiagonalInTree(s),h.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(E,null,0,359,0,T);var d=B.calculateBounds(s),D=new Y;D.setDeviceOrgX(d.getMinX()),D.setDeviceOrgY(d.getMinY()),D.setWorldOrgX(v.x),D.setWorldOrgY(v.y);for(var O=0;O1;){var J=X[0];X.splice(0,1);var st=b.indexOf(J);st>=0&&b.splice(st,1),M--,j--}E!=null?U=(b.indexOf(X[0])+1)%M:U=0;for(var Lt=Math.abs(T-v)/j,St=U;V!=j;St=++St%M){var Q=b[St].getOtherEnd(s);if(Q!=E){var Ut=(v+V*Lt)%360,wt=(Ut+Lt)%360;x.branchRadialLayout(Q,s,Ut,wt,d+D,D),V++}}},x.maxDiagonalInTree=function(s){for(var E=A.MIN_VALUE,v=0;vE&&(E=d)}return E},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var s=this,E={};this.memberGroups={},this.idToDummyNode={};for(var v=[],T=this.graphManager.getAllNodes(),d=0;d"u"&&(E[P]=[]),E[P]=E[P].concat(D)}Object.keys(E).forEach(function(F){if(E[F].length>1){var I="DummyCompound_"+F;s.memberGroups[I]=E[F];var Z=E[F][0].getParent(),_=new i(s.graphManager);_.id=I,_.paddingLeft=Z.paddingLeft||0,_.paddingRight=Z.paddingRight||0,_.paddingBottom=Z.paddingBottom||0,_.paddingTop=Z.paddingTop||0,s.idToDummyNode[I]=_;var b=s.getGraphManager().add(s.newGraph(),_),j=Z.getChild();j.add(_);for(var V=0;Vd?(T.rect.x-=(T.labelWidth-d)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-d)/2):T.labelPosHorizontal=="right"&&T.setWidth(d+T.labelWidth)),T.labelHeight&&(T.labelPosVertical=="top"?(T.rect.y-=T.labelHeight,T.setHeight(D+T.labelHeight),T.labelMarginTop=T.labelHeight):T.labelPosVertical=="center"&&T.labelHeight>D?(T.rect.y-=(T.labelHeight-D)/2,T.setHeight(T.labelHeight),T.labelMarginTop=(T.labelHeight-D)/2):T.labelPosVertical=="bottom"&&T.setHeight(D+T.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var E=this.compoundOrder[s],v=E.id,T=E.paddingLeft,d=E.paddingTop,D=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[v],E.rect.x,E.rect.y,T,d,D,O)}},x.prototype.repopulateZeroDegreeMembers=function(){var s=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(v){var T=s.idToDummyNode[v],d=T.paddingLeft,D=T.paddingTop,O=T.labelMarginLeft,P=T.labelMarginTop;s.adjustLocations(E[v],T.rect.x,T.rect.y,d,D,O,P)})},x.prototype.getToBeTiled=function(s){var E=s.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var v=s.getChild();if(v==null)return this.toBeTiled[E]=!1,!1;for(var T=v.getNodes(),d=0;d0)return this.toBeTiled[E]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},x.prototype.getNodeDegree=function(s){for(var E=s.id,v=s.getEdges(),T=0,d=0;dZ&&(Z=b.rect.height)}v+=Z+s.verticalPadding}},x.prototype.tileCompoundMembers=function(s,E){var v=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(T){var d=E[T];if(v.tiledMemberPack[T]=v.tileNodes(s[T],d.paddingLeft+d.paddingRight),d.rect.width=v.tiledMemberPack[T].width,d.rect.height=v.tiledMemberPack[T].height,d.setCenter(v.tiledMemberPack[T].centerX,v.tiledMemberPack[T].centerY),d.labelMarginLeft=0,d.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var D=d.rect.width,O=d.rect.height;d.labelWidth&&(d.labelPosHorizontal=="left"?(d.rect.x-=d.labelWidth,d.setWidth(D+d.labelWidth),d.labelMarginLeft=d.labelWidth):d.labelPosHorizontal=="center"&&d.labelWidth>D?(d.rect.x-=(d.labelWidth-D)/2,d.setWidth(d.labelWidth),d.labelMarginLeft=(d.labelWidth-D)/2):d.labelPosHorizontal=="right"&&d.setWidth(D+d.labelWidth)),d.labelHeight&&(d.labelPosVertical=="top"?(d.rect.y-=d.labelHeight,d.setHeight(O+d.labelHeight),d.labelMarginTop=d.labelHeight):d.labelPosVertical=="center"&&d.labelHeight>O?(d.rect.y-=(d.labelHeight-O)/2,d.setHeight(d.labelHeight),d.labelMarginTop=(d.labelHeight-O)/2):d.labelPosVertical=="bottom"&&d.setHeight(O+d.labelHeight))}})},x.prototype.tileNodes=function(s,E){var v=this.tileNodesByFavoringDim(s,E,!0),T=this.tileNodesByFavoringDim(s,E,!1),d=this.getOrgRatio(v),D=this.getOrgRatio(T),O;return DP&&(P=V.getWidth())});var F=D/d,I=O/d,Z=Math.pow(v-T,2)+4*(F+T)*(I+v)*d,_=(T-v+Math.sqrt(Z))/(2*(F+T)),b;E?(b=Math.ceil(_),b==_&&b++):b=Math.floor(_);var j=b*(F+T)-T;return P>j&&(j=P),j+=T*2,j},x.prototype.tileNodesByFavoringDim=function(s,E,v){var T=h.TILING_PADDING_VERTICAL,d=h.TILING_PADDING_HORIZONTAL,D=h.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:T,horizontalPadding:d,centerX:0,centerY:0};D&&(O.idealRowWidth=this.calcIdealRowWidth(s,v));var P=function(M){return M.rect.width*M.rect.height},F=function(M,U){return P(U)-P(M)};s.sort(function(V,M){var U=F;return O.idealRowWidth?(U=D,U(V.id,M.id)):U(V,M)});for(var I=0,Z=0,_=0;_0&&(O+=s.horizontalPadding),s.rowWidth[v]=O,s.width0&&(P+=s.verticalPadding);var F=0;P>s.rowHeight[v]&&(F=s.rowHeight[v],s.rowHeight[v]=P,F=s.rowHeight[v]-F),s.height+=F,s.rows[v].push(E)},x.prototype.getShortestRowIndex=function(s){for(var E=-1,v=Number.MAX_VALUE,T=0;Tv&&(E=T,v=s.rowWidth[T]);return E},x.prototype.canAddHorizontal=function(s,E,v){if(s.idealRowWidth){var T=s.rows.length-1,d=s.rowWidth[T];return d+E+s.horizontalPadding<=s.idealRowWidth}var D=this.getShortestRowIndex(s);if(D<0)return!0;var O=s.rowWidth[D];if(O+s.horizontalPadding+E<=s.width)return!0;var P=0;s.rowHeight[D]0&&(P=v+s.verticalPadding-s.rowHeight[D]);var F;s.width-O>=E+s.horizontalPadding?F=(s.height+P)/(O+E+s.horizontalPadding):F=(s.height+P)/s.width,P=v+s.verticalPadding;var I;return s.widthD&&E!=v){T.splice(-1,1),s.rows[v].push(d),s.rowWidth[E]=s.rowWidth[E]-D,s.rowWidth[v]=s.rowWidth[v]+D,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var O=Number.MIN_VALUE,P=0;PO&&(O=T[P].height);E>0&&(O+=s.verticalPadding);var F=s.rowHeight[E]+s.rowHeight[v];s.rowHeight[E]=O,s.rowHeight[v]0)for(var j=d;j<=D;j++)b[0]+=this.grid[j][O-1].length+this.grid[j][O].length-1;if(D0)for(var j=O;j<=P;j++)b[3]+=this.grid[d-1][j].length+this.grid[d][j].length-1;for(var V=A.MAX_VALUE,M,U,X=0;X{var c=a(551).FDLayoutNode,t=a(551).IMath;function g(r,h,f,l){c.call(this,r,h,f,l)}g.prototype=Object.create(c.prototype);for(var i in c)g[i]=c[i];g.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(r,h){for(var f=this.getChild().getNodes(),l,L=0;L{function c(f){if(Array.isArray(f)){for(var l=0,L=Array(f.length);l0){var dt=0;it.forEach(function(lt){W=="horizontal"?(q.set(lt,y.has(lt)?p[y.get(lt)]:$.get(lt)),dt+=q.get(lt)):(q.set(lt,y.has(lt)?C[y.get(lt)]:$.get(lt)),dt+=q.get(lt))}),dt=dt/it.length,ot.forEach(function(lt){z.has(lt)||q.set(lt,dt)})}else{var at=0;ot.forEach(function(lt){W=="horizontal"?at+=y.has(lt)?p[y.get(lt)]:$.get(lt):at+=y.has(lt)?C[y.get(lt)]:$.get(lt)}),at=at/ot.length,ot.forEach(function(lt){q.set(lt,at)})}});for(var rt=function(){var it=gt.shift(),dt=H.get(it);dt.forEach(function(at){if(q.get(at.id)lt&&(lt=Xt),ztFt&&(Ft=zt)}}catch(_t){Vt=!0,Dt=_t}finally{try{!xt&&Nt.return&&Nt.return()}finally{if(Vt)throw Dt}}var ce=(dt+lt)/2-(at+Ft)/2,qt=!0,Jt=!1,Kt=void 0;try{for(var Qt=ot[Symbol.iterator](),oe;!(qt=(oe=Qt.next()).done);qt=!0){var jt=oe.value;q.set(jt,q.get(jt)+ce)}}catch(_t){Jt=!0,Kt=_t}finally{try{!qt&&Qt.return&&Qt.return()}finally{if(Jt)throw Kt}}})}return q},k=function(H){var W=0,z=0,$=0,K=0;if(H.forEach(function(ht){ht.left?p[y.get(ht.left)]-p[y.get(ht.right)]>=0?W++:z++:C[y.get(ht.top)]-C[y.get(ht.bottom)]>=0?$++:K++}),W>z&&$>K)for(var ut=0;utz)for(var ft=0;ftK)for(var q=0;q1)l.fixedNodeConstraint.forEach(function(G,H){T[H]=[G.position.x,G.position.y],d[H]=[p[y.get(G.nodeId)],C[y.get(G.nodeId)]]}),D=!0;else if(l.alignmentConstraint)(function(){var G=0;if(l.alignmentConstraint.vertical){for(var H=l.alignmentConstraint.vertical,W=function(q){var ht=new Set;H[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(c(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=tt(ht).x,H[q].forEach(function(vt){T[G]=[rt,C[y.get(vt)]],d[G]=[p[y.get(vt)],C[y.get(vt)]],G++})},z=0;z0?rt=p[y.get(gt.values().next().value)]:rt=tt(ht).y,$[q].forEach(function(vt){T[G]=[p[y.get(vt)],rt],d[G]=[p[y.get(vt)],C[y.get(vt)]],G++})},ut=0;ut<$.length;ut++)K(ut);D=!0}l.relativePlacementConstraint&&(O=!0)})();else if(l.relativePlacementConstraint){for(var _=0,b=0,j=0;j_&&(_=Z[j].length,b=j);if(_0){var Ct={x:0,y:0};l.fixedNodeConstraint.forEach(function(G,H){var W={x:p[y.get(G.nodeId)],y:C[y.get(G.nodeId)]},z=G.position,$=Y(z,W);Ct.x+=$.x,Ct.y+=$.y}),Ct.x/=l.fixedNodeConstraint.length,Ct.y/=l.fixedNodeConstraint.length,p.forEach(function(G,H){p[H]+=Ct.x}),C.forEach(function(G,H){C[H]+=Ct.y}),l.fixedNodeConstraint.forEach(function(G){p[y.get(G.nodeId)]=G.position.x,C[y.get(G.nodeId)]=G.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var mt=l.alignmentConstraint.vertical,Tt=function(H){var W=new Set;mt[H].forEach(function(K){W.add(K)});var z=new Set([].concat(c(W)).filter(function(K){return P.has(K)})),$=void 0;z.size>0?$=p[y.get(z.values().next().value)]:$=tt(W).x,W.forEach(function(K){P.has(K)||(p[y.get(K)]=$)})},Ot=0;Ot0?$=C[y.get(z.values().next().value)]:$=tt(W).y,W.forEach(function(K){P.has(K)||(C[y.get(K)]=$)})},Pt=0;Pt{n.exports=m})},N={};function u(n){var e=N[n];if(e!==void 0)return e.exports;var a=N[n]={exports:{}};return w[n](a,a.exports,u),a.exports}var o=u(45);return o})()})});var Je=pe((ae,Ce)=>{(function(w,N){typeof ae=="object"&&typeof Ce=="object"?Ce.exports=N(Le()):typeof define=="function"&&define.amd?define(["cose-base"],N):typeof ae=="object"?ae.cytoscapeFcose=N(Le()):w.cytoscapeFcose=N(w.coseBase)})(ae,function(m){return(()=>{"use strict";var w={658:(n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var a=arguments.length,c=Array(a>1?a-1:0),t=1;t{var c=(function(){function i(r,h){var f=[],l=!0,L=!1,y=void 0;try{for(var p=r[Symbol.iterator](),C;!(l=(C=p.next()).done)&&(f.push(C.value),!(h&&f.length===h));l=!0);}catch(R){L=!0,y=R}finally{try{!l&&p.return&&p.return()}finally{if(L)throw y}}return f}return function(r,h){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return i(r,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),t=a(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(i){for(var r={},h=0;h0&&D.merge(I)});for(var O=0;O1){C=y[0],R=C.connectedEdges().length,y.forEach(function(d){d.connectedEdges().length0&&f.set("dummy"+(f.size+1),B),Y},g.relocateComponent=function(i,r,h){if(!h.fixedNodeConstraint){var f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var p=!0,C=!1,R=void 0;try{for(var A=r.nodeIndexes[Symbol.iterator](),S;!(p=(S=A.next()).done);p=!0){var B=S.value,Y=c(B,2),tt=Y[0],x=Y[1],k=h.cy.getElementById(tt);if(k){var s=k.boundingBox(),E=r.xCoords[x]-s.w/2,v=r.xCoords[x]+s.w/2,T=r.yCoords[x]-s.h/2,d=r.yCoords[x]+s.h/2;El&&(l=v),Ty&&(y=d)}}}catch(I){C=!0,R=I}finally{try{!p&&A.return&&A.return()}finally{if(C)throw R}}var D=i.x-(l+f)/2,O=i.y-(y+L)/2;r.xCoords=r.xCoords.map(function(I){return I+D}),r.yCoords=r.yCoords.map(function(I){return I+O})}else{Object.keys(r).forEach(function(I){var Z=r[I],_=Z.getRect().x,b=Z.getRect().x+Z.getRect().width,j=Z.getRect().y,V=Z.getRect().y+Z.getRect().height;_l&&(l=b),jy&&(y=V)});var P=i.x-(l+f)/2,F=i.y-(y+L)/2;Object.keys(r).forEach(function(I){var Z=r[I];Z.setCenter(Z.getCenterX()+P,Z.getCenterY()+F)})}}},g.calcBoundingBox=function(i,r,h,f){for(var l=Number.MAX_SAFE_INTEGER,L=Number.MIN_SAFE_INTEGER,y=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,C=void 0,R=void 0,A=void 0,S=void 0,B=i.descendants().not(":parent"),Y=B.length,tt=0;ttC&&(l=C),LA&&(y=A),p{var c=a(548),t=a(140).CoSELayout,g=a(140).CoSENode,i=a(140).layoutBase.PointD,r=a(140).layoutBase.DimensionD,h=a(140).layoutBase.LayoutConstants,f=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,L=function(p,C){var R=p.cy,A=p.eles,S=A.nodes(),B=A.edges(),Y=void 0,tt=void 0,x=void 0,k={};p.randomize&&(Y=C.nodeIndexes,tt=C.xCoords,x=C.yCoords);var s=function(I){return typeof I=="function"},E=function(I,Z){return s(I)?I(Z):I},v=c.calcParentsWithoutChildren(R,A),T=function F(I,Z,_,b){for(var j=Z.length,V=0;V0){var Lt=void 0;Lt=_.getGraphManager().add(_.newGraph(),X),F(Lt,U,_,b)}}},d=function(I,Z,_){for(var b=0,j=0,V=0;V<_.length;V++){var M=_[V],U=k[M.data("source")],X=k[M.data("target")];if(U&&X&&U!==X&&U.getEdgesBetween(X).length==0){var J=Z.add(I.newEdge(),U,X);J.id=M.id(),J.idealLength=E(p.idealEdgeLength,M),J.edgeElasticity=E(p.edgeElasticity,M),b+=J.idealLength,j++}}p.idealEdgeLength!=null&&(j>0?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=b/j:s(p.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=p.idealEdgeLength,l.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)},D=function(I,Z){Z.fixedNodeConstraint&&(I.constraints.fixedNodeConstraint=Z.fixedNodeConstraint),Z.alignmentConstraint&&(I.constraints.alignmentConstraint=Z.alignmentConstraint),Z.relativePlacementConstraint&&(I.constraints.relativePlacementConstraint=Z.relativePlacementConstraint)};p.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=p.nestingFactor),p.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=p.gravity),p.numIter!=null&&(l.MAX_ITERATIONS=f.MAX_ITERATIONS=p.numIter),p.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=p.gravityRange),p.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=p.gravityCompound),p.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=p.gravityRangeCompound),p.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=p.initialEnergyOnIncremental),p.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=p.tilingCompareBy),p.quality=="proof"?h.QUALITY=2:h.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=p.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!p.randomize,l.ANIMATE=f.ANIMATE=h.ANIMATE=p.animate,l.TILE=p.tile,l.TILING_PADDING_VERTICAL=typeof p.tilingPaddingVertical=="function"?p.tilingPaddingVertical.call():p.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof p.tilingPaddingHorizontal=="function"?p.tilingPaddingHorizontal.call():p.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!p.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=p.uniformNodeDimensions,p.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),p.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),p.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),p.step=="all"&&(p.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),p.fixedNodeConstraint||p.alignmentConstraint||p.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new t,P=O.newGraphManager();return T(P.addRoot(),c.getTopMostNodes(S),O,p),d(O,P,B),D(O,p),O.runLayout(),k};n.exports={coseLayout:L}}),212:((n,e,a)=>{var c=(function(){function p(C,R){for(var A=0;A0)if(d){var P=i.getTopMostNodes(A.eles.nodes());if(s=i.connectComponents(S,A.eles,P),s.forEach(function(nt){var et=nt.boundingBox();E.push({x:et.x1+et.w/2,y:et.y1+et.h/2})}),A.randomize&&s.forEach(function(nt){A.eles=nt,Y.push(h(A))}),A.quality=="default"||A.quality=="proof"){var F=S.collection();if(A.tile){var I=new Map,Z=[],_=[],b=0,j={nodeIndexes:I,xCoords:Z,yCoords:_},V=[];if(s.forEach(function(nt,et){nt.edges().length==0&&(nt.nodes().forEach(function(pt,Et){F.merge(nt.nodes()[Et]),pt.isParent()||(j.nodeIndexes.set(nt.nodes()[Et].id(),b++),j.xCoords.push(nt.nodes()[0].position().x),j.yCoords.push(nt.nodes()[0].position().y))}),V.push(et))}),F.length>1){var M=F.boundingBox();E.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),s.push(F),Y.push(j);for(var U=V.length-1;U>=0;U--)s.splice(V[U],1),Y.splice(V[U],1),E.splice(V[U],1)}}s.forEach(function(nt,et){A.eles=nt,k.push(l(A,Y[et])),i.relocateComponent(E[et],k[et],A)})}else s.forEach(function(nt,et){i.relocateComponent(E[et],Y[et],A)});var X=new Set;if(s.length>1){var J=[],st=B.filter(function(nt){return nt.css("display")=="none"});s.forEach(function(nt,et){var pt=void 0;if(A.quality=="draft"&&(pt=Y[et].nodeIndexes),nt.nodes().not(st).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;nt.nodes().not(st).forEach(function(mt){if(A.quality=="draft")if(!mt.isParent())Ct=pt.get(mt.id()),Et.nodes.push({x:Y[et].xCoords[Ct]-mt.boundingbox().w/2,y:Y[et].yCoords[Ct]-mt.boundingbox().h/2,width:mt.boundingbox().w,height:mt.boundingbox().h});else{var Tt=i.calcBoundingBox(mt,Y[et].xCoords,Y[et].yCoords,pt);Et.nodes.push({x:Tt.topLeftX,y:Tt.topLeftY,width:Tt.width,height:Tt.height})}else k[et][mt.id()]&&Et.nodes.push({x:k[et][mt.id()].getLeft(),y:k[et][mt.id()].getTop(),width:k[et][mt.id()].getWidth(),height:k[et][mt.id()].getHeight()})}),nt.edges().forEach(function(mt){var Tt=mt.source(),Ot=mt.target();if(Tt.css("display")!="none"&&Ot.css("display")!="none")if(A.quality=="draft"){var It=pt.get(Tt.id()),Wt=pt.get(Ot.id()),Pt=[],Yt=[];if(Tt.isParent()){var bt=i.calcBoundingBox(Tt,Y[et].xCoords,Y[et].yCoords,pt);Pt.push(bt.topLeftX+bt.width/2),Pt.push(bt.topLeftY+bt.height/2)}else Pt.push(Y[et].xCoords[It]),Pt.push(Y[et].yCoords[It]);if(Ot.isParent()){var G=i.calcBoundingBox(Ot,Y[et].xCoords,Y[et].yCoords,pt);Yt.push(G.topLeftX+G.width/2),Yt.push(G.topLeftY+G.height/2)}else Yt.push(Y[et].xCoords[Wt]),Yt.push(Y[et].yCoords[Wt]);Et.edges.push({startX:Pt[0],startY:Pt[1],endX:Yt[0],endY:Yt[1]})}else k[et][Tt.id()]&&k[et][Ot.id()]&&Et.edges.push({startX:k[et][Tt.id()].getCenterX(),startY:k[et][Tt.id()].getCenterY(),endX:k[et][Ot.id()].getCenterX(),endY:k[et][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(J.push(Et),X.add(et))}});var Lt=T.packComponents(J,A.randomize).shifts;if(A.quality=="draft")Y.forEach(function(nt,et){var pt=nt.xCoords.map(function(Ct){return Ct+Lt[et].dx}),Et=nt.yCoords.map(function(Ct){return Ct+Lt[et].dy});nt.xCoords=pt,nt.yCoords=Et});else{var St=0;X.forEach(function(nt){Object.keys(k[nt]).forEach(function(et){var pt=k[nt][et];pt.setCenter(pt.getCenterX()+Lt[St].dx,pt.getCenterY()+Lt[St].dy)}),St++})}}}else{var D=A.eles.boundingBox();if(E.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),A.randomize){var O=h(A);Y.push(O)}A.quality=="default"||A.quality=="proof"?(k.push(l(A,Y[0])),i.relocateComponent(E[0],k[0],A)):i.relocateComponent(E[0],Y[0],A)}var Q=function(et,pt){if(A.quality=="default"||A.quality=="proof"){typeof et=="number"&&(et=pt);var Et=void 0,Ct=void 0,mt=et.data("id");return k.forEach(function(Ot){mt in Ot&&(Et={x:Ot[mt].getRect().getCenterX(),y:Ot[mt].getRect().getCenterY()},Ct=Ot[mt])}),A.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:et.position("x"),y:et.position("y")}),{x:Et.x,y:Et.y}}else{var Tt=void 0;return Y.forEach(function(Ot){var It=Ot.nodeIndexes.get(et.id());It!=null&&(Tt={x:Ot.xCoords[It],y:Ot.yCoords[It]})}),Tt==null&&(Tt={x:et.position("x"),y:et.position("y")}),{x:Tt.x,y:Tt.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var Ut=i.calcParentsWithoutChildren(S,B),wt=B.filter(function(nt){return nt.css("display")=="none"});A.eles=B.not(wt),B.nodes().not(":parent").not(wt).layoutPositions(R,A,Q),Ut.length>0&&Ut.forEach(function(nt){nt.position(Q(nt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),p})();n.exports=y}),657:((n,e,a)=>{var c=a(548),t=a(140).layoutBase.Matrix,g=a(140).layoutBase.SVD,i=function(h){var f=h.cy,l=h.eles,L=l.nodes(),y=l.nodes(":parent"),p=new Map,C=new Map,R=new Map,A=[],S=[],B=[],Y=[],tt=[],x=[],k=[],s=[],E=void 0,v=void 0,T=1e8,d=1e-9,D=h.piTol,O=h.samplingType,P=h.nodeSeparation,F=void 0,I=function(){for(var W=0,z=0,$=!1;z=ut;){q=K[ut++];for(var ot=A[q],it=0;itrt&&(rt=tt[at],vt=at)}return vt},_=function(W){var z=void 0;if(W){z=Math.floor(Math.random()*v),E=z;for(var K=0;K=1)break;rt=gt}for(var ot=0;ot=1)break;rt=gt}for(var dt=0;dt0&&(z.isParent()?A[W].push(R.get(z.id())):A[W].push(z.id()))})});var Ut=function(W){var z=C.get(W),$=void 0;p.get(W).forEach(function(K){f.getElementById(K).isParent()?$=R.get(K):$=K,A[z].push($),A[C.get($)].push(W)})},wt=!0,nt=!1,et=void 0;try{for(var pt=p.keys()[Symbol.iterator](),Et;!(wt=(Et=pt.next()).done);wt=!0){var Ct=Et.value;Ut(Ct)}}catch(H){nt=!0,et=H}finally{try{!wt&&pt.return&&pt.return()}finally{if(nt)throw et}}v=C.size;var mt=void 0;if(v>2){F=v{var c=a(212),t=function(i){i&&i("layout","fcose",c)};typeof cytoscape<"u"&&t(cytoscape),n.exports=t}),140:(n=>{n.exports=m})},N={};function u(n){var e=N[n];if(e!==void 0)return e.exports;var a=N[n]={exports:{}};return w[n](a,a.exports,u),a.exports}var o=u(579);return o})()})});var ir=ur(Je(),1);var Ke={L:"left",R:"right",T:"top",B:"bottom"},je={L:ct(m=>`${m},${m/2} 0,${m} 0,0`,"L"),R:ct(m=>`0,${m/2} ${m},0 ${m},${m}`,"R"),T:ct(m=>`0,0 ${m},0 ${m/2},${m}`,"T"),B:ct(m=>`${m/2},0 ${m},${m} 0,${m}`,"B")},fe={L:ct((m,w)=>m-w+2,"L"),R:ct((m,w)=>m-2,"R"),T:ct((m,w)=>m-w+2,"T"),B:ct((m,w)=>m-2,"B")},dr=ct(function(m){return Ht(m)?m==="L"?"R":"L":m==="T"?"B":"T"},"getOppositeArchitectureDirection"),_e=ct(function(m){let w=m;return w==="L"||w==="R"||w==="T"||w==="B"},"isArchitectureDirection"),Ht=ct(function(m){let w=m;return w==="L"||w==="R"},"isArchitectureDirectionX"),kt=ct(function(m){let w=m;return w==="T"||w==="B"},"isArchitectureDirectionY"),Me=ct(function(m,w){let N=Ht(m)&&kt(w),u=kt(m)&&Ht(w);return N||u},"isArchitectureDirectionXY"),vr=ct(function(m){let w=m[0],N=m[1],u=Ht(w)&&kt(N),o=kt(w)&&Ht(N);return u||o},"isArchitecturePairXY"),pr=ct(function(m){return m!=="LL"&&m!=="RR"&&m!=="TT"&&m!=="BB"},"isValidArchitectureDirectionPair"),Ae=ct(function(m,w){let N=`${m}${w}`;return pr(N)?N:void 0},"getArchitectureDirectionPair"),yr=ct(function([m,w],N){let u=N[0],o=N[1];return Ht(u)?kt(o)?[m+(u==="L"?-1:1),w+(o==="T"?1:-1)]:[m+(u==="L"?-1:1),w]:Ht(o)?[m+(o==="L"?1:-1),w+(u==="T"?1:-1)]:[m,w+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Er=ct(function(m){return m==="LT"||m==="TL"?[1,1]:m==="BL"||m==="LB"?[1,-1]:m==="BR"||m==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),mr=ct(function(m,w){return Me(m,w)?"bend":Ht(m)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Tr=ct(function(m){return m.type==="service"},"isArchitectureService"),Nr=ct(function(m){return m.type==="junction"},"isArchitectureJunction"),tr=ct(m=>m.data(),"edgeData"),ee=ct(m=>m.data(),"nodeData"),Lr=Re.architecture,er=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=Ge,this.getAccTitle=Ue,this.setDiagramTitle=He,this.getDiagramTitle=We,this.getAccDescription=Xe,this.setAccDescription=Ye,this.clear()}static{ct(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Pe()}addService({id:m,icon:w,in:N,title:u,iconText:o}){if(this.registeredIds[m]!==void 0)throw new Error(`The service id [${m}] is already in use by another ${this.registeredIds[m]}`);if(N!==void 0){if(m===N)throw new Error(`The service [${m}] cannot be placed within itself`);if(this.registeredIds[N]===void 0)throw new Error(`The service [${m}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[N]==="node")throw new Error(`The service [${m}]'s parent is not a group`)}this.registeredIds[m]="node",this.nodes[m]={id:m,type:"service",icon:w,iconText:o,title:u,edges:[],in:N}}getServices(){return Object.values(this.nodes).filter(Tr)}addJunction({id:m,in:w}){this.registeredIds[m]="node",this.nodes[m]={id:m,type:"junction",edges:[],in:w}}getJunctions(){return Object.values(this.nodes).filter(Nr)}getNodes(){return Object.values(this.nodes)}getNode(m){return this.nodes[m]??null}addGroup({id:m,icon:w,in:N,title:u}){if(this.registeredIds?.[m]!==void 0)throw new Error(`The group id [${m}] is already in use by another ${this.registeredIds[m]}`);if(N!==void 0){if(m===N)throw new Error(`The group [${m}] cannot be placed within itself`);if(this.registeredIds?.[N]===void 0)throw new Error(`The group [${m}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[N]==="node")throw new Error(`The group [${m}]'s parent is not a group`)}this.registeredIds[m]="group",this.groups[m]={id:m,icon:w,title:u,in:N}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:m,rhsId:w,lhsDir:N,rhsDir:u,lhsInto:o,rhsInto:n,lhsGroup:e,rhsGroup:a,title:c}){if(!_e(N))throw new Error(`Invalid direction given for left hand side of edge ${m}--${w}. Expected (L,R,T,B) got ${String(N)}`);if(!_e(u))throw new Error(`Invalid direction given for right hand side of edge ${m}--${w}. Expected (L,R,T,B) got ${String(u)}`);if(this.nodes[m]===void 0&&this.groups[m]===void 0)throw new Error(`The left-hand id [${m}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[w]===void 0&&this.groups[w]===void 0)throw new Error(`The right-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);let t=this.nodes[m].in,g=this.nodes[w].in;if(e&&t&&g&&t==g)throw new Error(`The left-hand id [${m}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&t&&g&&t==g)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:m,lhsDir:N,lhsInto:o,lhsGroup:e,rhsId:w,rhsDir:u,rhsInto:n,rhsGroup:a,title:c};this.edges.push(i),this.nodes[m]&&this.nodes[w]&&(this.nodes[m].edges.push(this.edges[this.edges.length-1]),this.nodes[w].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let m={},w=Object.entries(this.nodes).reduce((a,[c,t])=>(a[c]=t.edges.reduce((g,i)=>{let r=this.getNode(i.lhsId)?.in,h=this.getNode(i.rhsId)?.in;if(r&&h&&r!==h){let f=mr(i.lhsDir,i.rhsDir);f!=="bend"&&(m[r]??={},m[r][h]=f,m[h]??={},m[h][r]=f)}if(i.lhsId===c){let f=Ae(i.lhsDir,i.rhsDir);f&&(g[f]=i.rhsId)}else{let f=Ae(i.rhsDir,i.lhsDir);f&&(g[f]=i.lhsId)}return g},{}),a),{}),N=Object.keys(w)[0],u={[N]:1},o=Object.keys(w).reduce((a,c)=>c===N?a:{...a,[c]:1},{}),n=ct(a=>{let c={[a]:[0,0]},t=[a];for(;t.length>0;){let g=t.shift();if(g){u[g]=1,delete o[g];let i=w[g],[r,h]=c[g];Object.entries(i).forEach(([f,l])=>{u[l]||(c[l]=yr([r,h],f),t.push(l))})}}return c},"BFS"),e=[n(N)];for(;Object.keys(o).length>0;)e.push(n(Object.keys(o)[0]));this.dataStructures={adjList:w,spatialMaps:e,groupAlignments:m}}return this.dataStructures}setElementForId(m,w){this.elements[m]=w}getElementById(m){return this.elements[m]}getConfig(){return Be({...Lr,...Se().architecture})}getConfigField(m){return this.getConfig()[m]}},Cr=ct((m,w)=>{qe(m,w),m.groups.map(N=>w.addGroup(N)),m.services.map(N=>w.addService({...N,type:"service"})),m.junctions.map(N=>w.addJunction({...N,type:"junction"})),m.edges.map(N=>w.addEdge(N))},"populateDb"),rr={parser:{yy:void 0},parse:ct(async m=>{let w=await Qe("architecture",m);ye.debug(w);let N=rr.parser?.yy;if(!(N instanceof er))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Cr(w,N)},"parse")},Ar=ct(m=>` .edge { stroke-width: ${m.archEdgeWidth}; stroke: ${m.archEdgeColor}; fill: none; } .arrow { fill: ${m.archEdgeArrowColor}; } .node-bkg { fill: none; stroke: ${m.archGroupBorderColor}; stroke-width: ${m.archGroupBorderWidth}; stroke-dasharray: 8; } .node-icon-text { display: flex; align-items: center; } .node-icon-text > div { color: #fff; margin: 1px; height: fit-content; text-align: center; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; } `,"getStyles"),Mr=Ar,te=ct(m=>`${m}`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:te('')},server:{body:te('')},disk:{body:te('')},internet:{body:te('')},cloud:{body:te('')},unknown:Ze,blank:{body:te("")}}},wr=ct(async function(m,w,N){let u=N.getConfigField("padding"),o=N.getConfigField("iconSize"),n=o/2,e=o/6,a=e/2;await Promise.all(w.edges().map(async c=>{let{source:t,sourceDir:g,sourceArrow:i,sourceGroup:r,target:h,targetDir:f,targetArrow:l,targetGroup:L,label:y}=tr(c),{x:p,y:C}=c[0].sourceEndpoint(),{x:R,y:A}=c[0].midpoint(),{x:S,y:B}=c[0].targetEndpoint(),Y=u+4;if(r&&(Ht(g)?p+=g==="L"?-Y:Y:C+=g==="T"?-Y:Y+18),L&&(Ht(f)?S+=f==="L"?-Y:Y:B+=f==="T"?-Y:Y+18),!r&&N.getNode(t)?.type==="junction"&&(Ht(g)?p+=g==="L"?n:-n:C+=g==="T"?n:-n),!L&&N.getNode(h)?.type==="junction"&&(Ht(f)?S+=f==="L"?n:-n:B+=f==="T"?n:-n),c[0]._private.rscratch){let tt=m.insert("g");if(tt.insert("path").attr("d",`M ${p},${C} L ${R},${A} L${S},${B} `).attr("class","edge").attr("id",$e(t,h,{prefix:"L"})),i){let x=Ht(g)?fe[g](p,e):p-a,k=kt(g)?fe[g](C,e):C-a;tt.insert("polygon").attr("points",je[g](e)).attr("transform",`translate(${x},${k})`).attr("class","arrow")}if(l){let x=Ht(f)?fe[f](S,e):S-a,k=kt(f)?fe[f](B,e):B-a;tt.insert("polygon").attr("points",je[f](e)).attr("transform",`translate(${x},${k})`).attr("class","arrow")}if(y){let x=Me(g,f)?"XY":Ht(g)?"X":"Y",k=0;x==="X"?k=Math.abs(p-S):x==="Y"?k=Math.abs(C-B)/1.5:k=Math.abs(p-S)/2;let s=tt.append("g");if(await le(s,y,{useHtmlLabels:!1,width:k,classes:"architecture-service-label"},se()),s.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),x==="X")s.attr("transform","translate("+R+", "+A+")");else if(x==="Y")s.attr("transform","translate("+R+", "+A+") rotate(-90)");else if(x==="XY"){let E=Ae(g,f);if(E&&vr(E)){let v=s.node().getBoundingClientRect(),[T,d]=Er(E);s.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*T*d*45})`);let D=s.node().getBoundingClientRect();s.attr("transform",` translate(${R}, ${A-v.height/2}) translate(${T*D.width/2}, ${d*D.height/2}) rotate(${-1*T*d*45}, 0, ${v.height/2}) `)}}}}}))},"drawEdges"),Or=ct(async function(m,w,N){let o=N.getConfigField("padding")*.75,n=N.getConfigField("fontSize"),a=N.getConfigField("iconSize")/2;await Promise.all(w.nodes().map(async c=>{let t=ee(c);if(t.type==="group"){let{h:g,w:i,x1:r,y1:h}=c.boundingBox(),f=m.append("rect");f.attr("id",`group-${t.id}`).attr("x",r+a).attr("y",h+a).attr("width",i).attr("height",g).attr("class","node-bkg");let l=m.append("g"),L=r,y=h;if(t.icon){let p=l.append("g");p.html(`${await he(t.icon,{height:o,width:o,fallbackPrefix:ne.prefix})}`),p.attr("transform","translate("+(L+a+1)+", "+(y+a+1)+")"),L+=o,y+=n/2-1-2}if(t.label){let p=l.append("g");await le(p,t.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},se()),p.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),p.attr("transform","translate("+(L+a+4)+", "+(y+a+2)+")")}N.setElementForId(t.id,f)}}))},"drawGroups"),Dr=ct(async function(m,w,N){let u=se();for(let o of N){let n=w.append("g"),e=m.getConfigField("iconSize");if(o.title){let g=n.append("g");await le(g,o.title,{useHtmlLabels:!1,width:e*1.5,classes:"architecture-service-label"},u),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),g.attr("transform","translate("+e/2+", "+e+")")}let a=n.append("g");if(o.icon)a.html(`${await he(o.icon,{height:e,width:e,fallbackPrefix:ne.prefix})}`);else if(o.iconText){a.html(`${await he("blank",{height:e,width:e,fallbackPrefix:ne.prefix})}`);let r=a.append("g").append("foreignObject").attr("width",e).attr("height",e).append("div").attr("class","node-icon-text").attr("style",`height: ${e}px;`).append("div").html(Fe(o.iconText,u)),h=parseInt(window.getComputedStyle(r.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;r.attr("style",`-webkit-line-clamp: ${Math.floor((e-2)/h)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+o.id).attr("d",`M0 ${e} v${-e} q0,-5 5,-5 h${e} q5,0 5,5 v${e} H0 Z`);n.attr("id",`service-${o.id}`).attr("class","architecture-service");let{width:c,height:t}=n.node().getBBox();o.width=c,o.height=t,m.setElementForId(o.id,n)}return 0},"drawServices"),xr=ct(function(m,w,N){N.forEach(u=>{let o=w.append("g"),n=m.getConfigField("iconSize");o.append("g").append("rect").attr("id","node-"+u.id).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:a,height:c}=o._groups[0][0].getBBox();o.width=a,o.height=c,m.setElementForId(u.id,o)})},"drawJunctions");ke([{name:ne.prefix,icons:ne}]);Ee.use(ir.default);function ar(m,w,N){m.forEach(u=>{w.add({group:"nodes",data:{type:"service",id:u.id,icon:u.icon,label:u.title,parent:u.in,width:N.getConfigField("iconSize"),height:N.getConfigField("iconSize")},classes:"node-service"})})}ct(ar,"addServices");function nr(m,w,N){m.forEach(u=>{w.add({group:"nodes",data:{type:"junction",id:u.id,parent:u.in,width:N.getConfigField("iconSize"),height:N.getConfigField("iconSize")},classes:"node-junction"})})}ct(nr,"addJunctions");function or(m,w){w.nodes().map(N=>{let u=ee(N);if(u.type==="group")return;u.x=N.position().x,u.y=N.position().y,m.getElementById(u.id).attr("transform","translate("+(u.x||0)+","+(u.y||0)+")")})}ct(or,"positionNodes");function sr(m,w){m.forEach(N=>{w.add({group:"nodes",data:{type:"group",id:N.id,icon:N.icon,label:N.title,parent:N.in},classes:"node-group"})})}ct(sr,"addGroups");function hr(m,w){m.forEach(N=>{let{lhsId:u,rhsId:o,lhsInto:n,lhsGroup:e,rhsInto:a,lhsDir:c,rhsDir:t,rhsGroup:g,title:i}=N,r=Me(N.lhsDir,N.rhsDir)?"segments":"straight",h={id:`${u}-${o}`,label:i,source:u,sourceDir:c,sourceArrow:n,sourceGroup:e,sourceEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%",target:o,targetDir:t,targetArrow:a,targetGroup:g,targetEndpoint:t==="L"?"0 50%":t==="R"?"100% 50%":t==="T"?"50% 0":"50% 100%"};w.add({group:"edges",data:h,classes:r})})}ct(hr,"addEdges");function lr(m,w,N){let u=ct((a,c)=>Object.entries(a).reduce((t,[g,i])=>{let r=0,h=Object.entries(i);if(h.length===1)return t[g]=h[0][1],t;for(let f=0;f{let c={},t={};return Object.entries(a).forEach(([g,[i,r]])=>{let h=m.getNode(g)?.in??"default";c[r]??={},c[r][h]??=[],c[r][h].push(g),t[i]??={},t[i][h]??=[],t[i][h].push(g)}),{horiz:Object.values(u(c,"horizontal")).filter(g=>g.length>1),vert:Object.values(u(t,"vertical")).filter(g=>g.length>1)}}),[n,e]=o.reduce(([a,c],{horiz:t,vert:g})=>[[...a,...t],[...c,...g]],[[],[]]);return{horizontal:n,vertical:e}}ct(lr,"getAlignments");function fr(m,w){let N=[],u=ct(n=>`${n[0]},${n[1]}`,"posToStr"),o=ct(n=>n.split(",").map(e=>parseInt(e)),"strToPos");return m.forEach(n=>{let e=Object.fromEntries(Object.entries(n).map(([g,i])=>[u(i),g])),a=[u([0,0])],c={},t={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){let g=a.shift();if(g){c[g]=1;let i=e[g];if(i){let r=o(g);Object.entries(t).forEach(([h,f])=>{let l=u([r[0]+f[0],r[1]+f[1]]),L=e[l];L&&!c[l]&&(a.push(l),N.push({[Ke[h]]:L,[Ke[dr(h)]]:i,gap:1.5*w.getConfigField("iconSize")}))})}}}}),N}ct(fr,"getRelativeConstraints");function cr(m,w,N,u,o,{spatialMaps:n,groupAlignments:e}){return new Promise(a=>{let c=Ve("body").append("div").attr("id","cy").attr("style","display:none"),t=Ee({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${o.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${o.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});c.remove(),sr(N,t),ar(m,t,o),nr(w,t,o),hr(u,t);let g=lr(o,n,e),i=fr(n,o),r=t.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(h){let[f,l]=h.connectedNodes(),{parent:L}=ee(f),{parent:y}=ee(l);return L===y?1.5*o.getConfigField("iconSize"):.5*o.getConfigField("iconSize")},edgeElasticity(h){let[f,l]=h.connectedNodes(),{parent:L}=ee(f),{parent:y}=ee(l);return L===y?.45:.001},alignmentConstraint:g,relativePlacementConstraint:i});r.one("layoutstop",()=>{function h(f,l,L,y){let p,C,{x:R,y:A}=f,{x:S,y:B}=l;C=(y-A+(R-L)*(A-B)/(R-S))/Math.sqrt(1+Math.pow((A-B)/(R-S),2)),p=Math.sqrt(Math.pow(y-A,2)+Math.pow(L-R,2)-Math.pow(C,2));let Y=Math.sqrt(Math.pow(S-R,2)+Math.pow(B-A,2));p=p/Y;let tt=(S-R)*(y-A)-(B-A)*(L-R);switch(!0){case tt>=0:tt=1;break;case tt<0:tt=-1;break}let x=(S-R)*(L-R)+(B-A)*(y-A);switch(!0){case x>=0:x=1;break;case x<0:x=-1;break}return C=Math.abs(C)*tt,p=p*x,{distances:C,weights:p}}ct(h,"getSegmentWeights"),t.startBatch();for(let f of Object.values(t.edges()))if(f.data?.()){let{x:l,y:L}=f.source().position(),{x:y,y:p}=f.target().position();if(l!==y&&L!==p){let C=f.sourceEndpoint(),R=f.targetEndpoint(),{sourceDir:A}=tr(f),[S,B]=kt(A)?[C.x,R.y]:[R.x,C.y],{weights:Y,distances:tt}=h(C,R,S,B);f.style("segment-distances",tt),f.style("segment-weights",Y)}}t.endBatch(),r.run()}),r.run(),t.ready(h=>{ye.info("Ready",h),a(t)})})}ct(cr,"layoutArchitecture");var Ir=ct(async(m,w,N,u)=>{let o=u.db,n=o.getServices(),e=o.getJunctions(),a=o.getGroups(),c=o.getEdges(),t=o.getDataStructures(),g=ze(w),i=g.append("g");i.attr("class","architecture-edges");let r=g.append("g");r.attr("class","architecture-services");let h=g.append("g");h.attr("class","architecture-groups"),await Dr(o,r,n),xr(o,r,e);let f=await cr(n,e,a,c,o,t);await wr(i,f,o),await Or(h,f,o),or(o,f),be(void 0,g,o.getConfigField("padding"),o.getConfigField("useMaxWidth"))},"draw"),Rr={draw:Ir},Wr={parser:rr,get db(){return new er},renderer:Rr,styles:Mr};export{Wr as diagram}; //# sourceMappingURL=architectureDiagram-VXUJARFQ-H4V63UKK.min.js.map