import{_ as pt,K as ze,ac as Be,l as De,b as Ve,a as $e,q as je,t as qe,g as Ke,s as Ze,z as Je,F as Qe,G as ti,H as ei,c as pe,an as me,aI as de,i as ii,d as ni,y as ri,aJ as oi,aK as ai}from"./mermaid.core-BxtrgwOm.chunk.mjs";import{p as si}from"./chunk-4BX2VUAB-De5HNejl.chunk.mjs";import{p as hi}from"./treemap-KMMF4GRG-DJhEU9NB.chunk.mjs";import{c as be}from"./cytoscape.esm-D2wQNSMa.chunk.mjs";import{g as li}from"./emoji-picker-B23JpFV7.chunk.mjs";import"./index-CYtgifWR.chunk.mjs";import"./NcLoadingIcon-zQCGdPwE.chunk.mjs";import"./vue.runtime.esm-fahCO3eG.chunk.mjs";import"./index-DxwFe63_.chunk.mjs";import"./_baseUniq-08qBA_if.chunk.mjs";import"./_basePickBy-D4Ve5JSk.chunk.mjs";import"./clone-Cq87TdKW.chunk.mjs";var ce={exports:{}},ge={exports:{}},ue={exports:{}},di=ue.exports,Ie;function ci(){return Ie||(Ie=1,(function(w,H){(function(L,P){w.exports=P()})(di,function(){return(function(L){var P={};function T(u){if(P[u])return P[u].exports;var h=P[u]={i:u,l:!1,exports:{}};return L[u].call(h.exports,h,h.exports,T),h.l=!0,h.exports}return T.m=L,T.c=P,T.i=function(u){return u},T.d=function(u,h,r){T.o(u,h)||Object.defineProperty(u,h,{configurable:!1,enumerable:!0,get:r})},T.n=function(u){var h=u&&u.__esModule?function(){return u.default}:function(){return u};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(L,P,T){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,L.exports=u},function(L,P,T){var u=T(2),h=T(8),r=T(9);function i(a,o,f){u.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=a,this.target=o}i.prototype=Object.create(u.prototype);for(var e in u)i[e]=u[e];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(a,o){for(var f=this.getOtherEnd(a),t=o.getGraphManager().getRoot();;){if(f.getOwner()==o)return f;if(f.getOwner()==t)break;f=f.getOwner().getParent()}return null},i.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=r.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=r.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=r.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=r.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},L.exports=i},function(L,P,T){function u(h){this.vGraphObject=h}L.exports=u},function(L,P,T){var u=T(2),h=T(10),r=T(13),i=T(0),e=T(16),a=T(5);function o(t,s,l,g){l==null&&g==null&&(g=s),u.call(this,g),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=t,l!=null&&s!=null?this.rect=new r(s.x,s.y,l.width,l.height):this.rect=new r}o.prototype=Object.create(u.prototype);for(var f in u)o[f]=u[f];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(t){this.rect.width=t},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(t){this.rect.height=t},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},o.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},o.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},o.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},o.prototype.getEdgeListToNode=function(t){var s=[],l=this;return l.edges.forEach(function(g){if(g.target==t){if(g.source!=l)throw"Incorrect edge source!";s.push(g)}}),s},o.prototype.getEdgesBetween=function(t){var s=[],l=this;return l.edges.forEach(function(g){if(!(g.source==l||g.target==l))throw"Incorrect edge source and/or target";(g.target==t||g.source==t)&&s.push(g)}),s},o.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(l){if(l.source==s)t.add(l.target);else{if(l.target!=s)throw"Incorrect incidency!";t.add(l.source)}}),t},o.prototype.withChildren=function(){var t=new Set,s,l;if(t.add(this),this.child!=null)for(var g=this.child.getNodes(),d=0;ds?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+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))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(t){var s=this.rect.x;s>i.WORLD_BOUNDARY?s=i.WORLD_BOUNDARY:s<-i.WORLD_BOUNDARY&&(s=-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 a(s,l),d=t.inverseTransformPoint(g);this.setLocation(d.x,d.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},L.exports=o},function(L,P,T){var u=T(0);function h(){}for(var r in u)h[r]=u[r];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,L.exports=h},function(L,P,T){function u(h,r){h==null&&r==null?(this.x=0,this.y=0):(this.x=h,this.y=r)}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},L.exports=u},function(L,P,T){var u=T(2),h=T(10),r=T(0),i=T(7),e=T(3),a=T(1),o=T(13),f=T(12),t=T(11);function s(g,d,N){u.call(this,N),this.estimatedSize=h.MIN_VALUE,this.margin=r.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,d!=null&&d instanceof i?this.graphManager=d:d!=null&&d instanceof Layout&&(this.graphManager=d.graphManager)}s.prototype=Object.create(u.prototype);for(var l in u)s[l]=u[l];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(g,d,N){if(d==null&&N==null){var c=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(c)>-1)throw"Node already in graph!";return c.owner=this,this.getNodes().push(c),c}else{var y=g;if(!(this.getNodes().indexOf(d)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(d.owner==N.owner&&d.owner==this))throw"Both owners must be this graph!";return d.owner!=N.owner?null:(y.source=d,y.target=N,y.isInterGraph=!1,this.getEdges().push(y),d.edges.push(y),N!=d&&N.edges.push(y),y)}},s.prototype.remove=function(g){var d=g;if(g instanceof e){if(d==null)throw"Node is null!";if(!(d.owner!=null&&d.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=d.edges.slice(),c,y=N.length,A=0;A-1&&U>-1))throw"Source and/or target doesn't know this edge!";c.source.edges.splice(F,1),c.target!=c.source&&c.target.edges.splice(U,1);var I=c.source.owner.getEdges().indexOf(c);if(I==-1)throw"Not in owner's edge list!";c.source.owner.getEdges().splice(I,1)}},s.prototype.updateLeftTop=function(){for(var g=h.MAX_VALUE,d=h.MAX_VALUE,N,c,y,A=this.getNodes(),I=A.length,F=0;FN&&(g=N),d>c&&(d=c)}return g==h.MAX_VALUE?null:(A[0].getParent().paddingLeft!=null?y=A[0].getParent().paddingLeft:y=this.margin,this.left=d-y,this.top=g-y,new f(this.left,this.top))},s.prototype.updateBounds=function(g){for(var d=h.MAX_VALUE,N=-h.MAX_VALUE,c=h.MAX_VALUE,y=-h.MAX_VALUE,A,I,F,U,X,Y=this.nodes,Z=Y.length,C=0;CA&&(d=A),NF&&(c=F),yA&&(d=A),NF&&(c=F),y=this.nodes.length){var Z=0;N.forEach(function(C){C.owner==g&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},L.exports=s},function(L,P,T){var u,h=T(1);function r(i){u=T(6),this.layout=i,this.graphs=[],this.edges=[]}r.prototype.addRoot=function(){var i=this.layout.newGraph(),e=this.layout.newNode(null),a=this.add(i,e);return this.setRootGraph(a),this.rootGraph},r.prototype.add=function(i,e,a,o,f){if(a==null&&o==null&&f==null){if(i==null)throw"Graph is null!";if(e==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(e.child!=null)throw"Already has a child!";return i.parent=e,e.child=i,i}else{f=a,o=e,a=i;var t=o.getOwner(),s=f.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return a.isInterGraph=!1,t.add(a,o,f);if(a.isInterGraph=!0,a.source=o,a.target=f,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},r.prototype.remove=function(i){if(i instanceof u){var e=i;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(e.getEdges());for(var o,f=a.length,t=0;t=i.getRight()?e[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight()):i.getX()<=r.getX()&&i.getRight()>=r.getRight()&&(e[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight())),r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()?e[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()):i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()&&(e[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()));var f=Math.abs((i.getCenterY()-r.getCenterY())/(i.getCenterX()-r.getCenterX()));i.getCenterY()===r.getCenterY()&&i.getCenterX()===r.getCenterX()&&(f=1);var t=f*e[0],s=e[1]/f;e[0]t)return e[0]=a,e[1]=l,e[2]=f,e[3]=Y,!1;if(of)return e[0]=s,e[1]=o,e[2]=U,e[3]=t,!1;if(af?(e[0]=d,e[1]=N,n=!0):(e[0]=g,e[1]=l,n=!0):p===v&&(a>f?(e[0]=s,e[1]=l,n=!0):(e[0]=c,e[1]=N,n=!0)),-m===v?f>a?(e[2]=X,e[3]=Y,E=!0):(e[2]=U,e[3]=F,E=!0):m===v&&(f>a?(e[2]=I,e[3]=F,E=!0):(e[2]=Z,e[3]=Y,E=!0)),n&&E)return!1;if(a>f?o>t?(b=this.getCardinalDirection(p,v,4),M=this.getCardinalDirection(m,v,2)):(b=this.getCardinalDirection(-p,v,3),M=this.getCardinalDirection(-m,v,1)):o>t?(b=this.getCardinalDirection(-p,v,1),M=this.getCardinalDirection(-m,v,3)):(b=this.getCardinalDirection(p,v,2),M=this.getCardinalDirection(m,v,4)),!n)switch(b){case 1:S=l,x=a+-A/v,e[0]=x,e[1]=S;break;case 2:x=c,S=o+y*v,e[0]=x,e[1]=S;break;case 3:S=N,x=a+A/v,e[0]=x,e[1]=S;break;case 4:x=d,S=o+-y*v,e[0]=x,e[1]=S;break}if(!E)switch(M){case 1:B=F,k=f+-rt/v,e[2]=k,e[3]=B;break;case 2:k=Z,B=t+C*v,e[2]=k,e[3]=B;break;case 3:B=Y,k=f+rt/v,e[2]=k,e[3]=B;break;case 4:k=X,B=t+-C*v,e[2]=k,e[3]=B;break}}return!1},h.getCardinalDirection=function(r,i,e){return r>i?e:1+e%4},h.getIntersection=function(r,i,e,a){if(a==null)return this.getIntersection2(r,i,e);var o=r.x,f=r.y,t=i.x,s=i.y,l=e.x,g=e.y,d=a.x,N=a.y,c=void 0,y=void 0,A=void 0,I=void 0,F=void 0,U=void 0,X=void 0,Y=void 0,Z=void 0;return A=s-f,F=o-t,X=t*f-o*s,I=N-g,U=l-d,Y=d*g-l*N,Z=A*U-I*F,Z===0?null:(c=(F*Y-U*X)/Z,y=(I*X-A*Y)/Z,new u(c,y))},h.angleOfVector=function(r,i,e,a){var o=void 0;return r!==e?(o=Math.atan((a-i)/(e-r)),e=0){var N=(-l+Math.sqrt(l*l-4*s*g))/(2*s),c=(-l-Math.sqrt(l*l-4*s*g))/(2*s),y=null;return N>=0&&N<=1?[N]:c>=0&&c<=1?[c]:y}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,L.exports=h},function(L,P,T){function u(){}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)},L.exports=u},function(L,P,T){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,L.exports=u},function(L,P,T){var u=(function(){function o(f,t){for(var s=0;s"u"?"undefined":u(r);return r==null||i!="object"&&i!="function"},L.exports=h},function(L,P,T){function u(l){if(Array.isArray(l)){for(var g=0,d=Array(l.length);g0&&g;){for(A.push(F[0]);A.length>0&&g;){var U=A[0];A.splice(0,1),y.add(U);for(var X=U.getEdges(),c=0;c-1&&F.splice(rt,1)}y=new Set,I=new Map}}return l},s.prototype.createDummyNodesForBendpoints=function(l){for(var g=[],d=l.source,N=this.graphManager.calcLowestCommonAncestor(l.source,l.target),c=0;c0){for(var N=this.edgeToDummyNodes.get(d),c=0;c=0&&g.splice(Y,1);var Z=I.getNeighborsList();Z.forEach(function(n){if(d.indexOf(n)<0){var E=N.get(n),p=E-1;p==1&&U.push(n),N.set(n,p)}})}d=d.concat(U),(g.length==1||g.length==2)&&(c=!0,y=g[0])}return y},s.prototype.setGraphManager=function(l){this.graphManager=l},L.exports=s},function(L,P,T){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)},L.exports=u},function(L,P,T){var u=T(5);function h(r,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}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(r){this.lworldOrgX=r},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(r){this.lworldOrgY=r},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(r){this.lworldExtX=r},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(r){this.lworldExtY=r},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(r){this.ldeviceOrgX=r},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(r){this.ldeviceOrgY=r},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(r){this.ldeviceExtX=r},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(r){this.ldeviceExtY=r},h.prototype.transformX=function(r){var i=0,e=this.lworldExtX;return e!=0&&(i=this.ldeviceOrgX+(r-this.lworldOrgX)*this.ldeviceExtX/e),i},h.prototype.transformY=function(r){var i=0,e=this.lworldExtY;return e!=0&&(i=this.ldeviceOrgY+(r-this.lworldOrgY)*this.ldeviceExtY/e),i},h.prototype.inverseTransformX=function(r){var i=0,e=this.ldeviceExtX;return e!=0&&(i=this.lworldOrgX+(r-this.ldeviceOrgX)*this.lworldExtX/e),i},h.prototype.inverseTransformY=function(r){var i=0,e=this.ldeviceExtY;return e!=0&&(i=this.lworldOrgY+(r-this.ldeviceOrgY)*this.lworldExtY/e),i},h.prototype.inverseTransformPoint=function(r){var i=new u(this.inverseTransformX(r.x),this.inverseTransformY(r.y));return i},L.exports=h},function(L,P,T){function u(t){if(Array.isArray(t)){for(var s=0,l=Array(t.length);sr.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*r.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-r.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>r.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(r.COOLING_ADAPTATION_FACTOR,1-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*(1-r.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,l=0;l0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,g,d,N,c=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),y=new Set,l=0;lA||y>A)&&(t.gravitationForceX=-this.gravityConstant*d,t.gravitationForceY=-this.gravityConstant*N)):(A=s.getEstimatedSize()*this.compoundGravityRangeFactor,(c>A||y>A)&&(t.gravitationForceX=-this.gravityConstant*d*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},o.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=c.length||A>=c[0].length)){for(var I=0;Ia}}]),e})();L.exports=i},function(L,P,T){function u(){}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 r=Math.min(this.m,this.n);this.s=(function(It){for(var Tt=[];It-- >0;)Tt.push(0);return Tt})(Math.min(this.m+1,this.n)),this.U=(function(It){var Tt=function Xt(Ut){if(Ut.length==0)return 0;for(var bt=[],Pt=0;Pt0;)Tt.push(0);return Tt})(this.n),e=(function(It){for(var Tt=[];It-- >0;)Tt.push(0);return Tt})(this.m),a=!0,o=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var v=m+1;v=0;z--){if((function(It,Tt){return It&&Tt})(z0;){var $=void 0,xt=void 0;for($=n-2;$>=-1&&$!==-1;$--)if(Math.abs(i[$])<=mt+et*(Math.abs(this.s[$])+Math.abs(this.s[$+1]))){i[$]=0;break}if($===n-2)xt=4;else{var Q=void 0;for(Q=n-1;Q>=$&&Q!==$;Q--){var nt=(Q!==n?Math.abs(i[Q]):0)+(Q!==$+1?Math.abs(i[Q-1]):0);if(Math.abs(this.s[Q])<=mt+et*nt){this.s[Q]=0;break}}Q===$?xt=3:Q===n-1?xt=1:(xt=2,$=Q)}switch($++,xt){case 1:{var vt=i[n-2];i[n-2]=0;for(var st=n-2;st>=$;st--){var Lt=u.hypot(this.s[st],vt),_t=this.s[st]/Lt,Nt=vt/Lt;this.s[st]=Lt,st!==$&&(vt=-Nt*i[st-1],i[st-1]=_t*i[st-1]);for(var At=0;At=this.s[$+1]);){var wt=this.s[$];if(this.s[$]=this.s[$+1],this.s[$+1]=wt,$Math.abs(r)?(i=r/h,i=Math.abs(h)*Math.sqrt(1+i*i)):r!=0?(i=h/r,i=Math.abs(r)*Math.sqrt(1+i*i)):i=0,i},L.exports=u},function(L,P,T){var u=(function(){function i(e,a){for(var o=0;o2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,i),this.sequence1=e,this.sequence2=a,this.match_score=o,this.mismatch_penalty=f,this.gap_penalty=t,this.iMax=e.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;e--){var a=this.listeners[e];a.event===r&&a.callback===i&&this.listeners.splice(e,1)}},h.emit=function(r,i){for(var e=0;e{var P={45:(r,i,e)=>{var a={};a.layoutBase=e(551),a.CoSEConstants=e(806),a.CoSEEdge=e(767),a.CoSEGraph=e(880),a.CoSEGraphManager=e(578),a.CoSELayout=e(765),a.CoSENode=e(991),a.ConstraintHandler=e(902),r.exports=a},806:(r,i,e)=>{var a=e(551).FDLayoutConstants;function o(){}for(var f in a)o[f]=a[f];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=a.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!0,o.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,o.TREE_REDUCTION_ON_INCREMENTAL=!0,o.PURE_INCREMENTAL=o.DEFAULT_INCREMENTAL,r.exports=o},767:(r,i,e)=>{var a=e(551).FDLayoutEdge;function o(t,s,l){a.call(this,t,s,l)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];r.exports=o},880:(r,i,e)=>{var a=e(551).LGraph;function o(t,s,l){a.call(this,t,s,l)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];r.exports=o},578:(r,i,e)=>{var a=e(551).LGraphManager;function o(t){a.call(this,t)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];r.exports=o},765:(r,i,e)=>{var a=e(551).FDLayout,o=e(578),f=e(880),t=e(991),s=e(767),l=e(806),g=e(902),d=e(551).FDLayoutConstants,N=e(551).LayoutConstants,c=e(551).Point,y=e(551).PointD,A=e(551).DimensionD,I=e(551).Layout,F=e(551).Integer,U=e(551).IGeometry,X=e(551).LGraph,Y=e(551).Transform,Z=e(551).LinkedList;function C(){a.call(this),this.toBeTiled={},this.constraints={}}C.prototype=Object.create(a.prototype);for(var rt in a)C[rt]=a[rt];C.prototype.newGraphManager=function(){var n=new o(this);return this.graphManager=n,n},C.prototype.newGraph=function(n){return new f(null,this.graphManager,n)},C.prototype.newNode=function(n){return new t(this.graphManager,n)},C.prototype.newEdge=function(n){return new s(null,null,n)},C.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},C.prototype.initSpringEmbedder=function(){a.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},C.prototype.layout=function(){var n=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},C.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 n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(m){return n.has(m)});this.graphManager.setAllNodesToApplyGravitation(E)}}else{var p=this.getFlatForest();if(p.length>0)this.positionNodesRadially(p);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(b){return n.has(b)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(v){return n.has(v)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=b)}}if(this.constraints.relativePlacementConstraint){var M=new Map,x=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var S=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;et--)R=Math.floor(Math.random()*(et+1)),j=D[et],D[et]=D[R],D[R]=j;return D},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(D){if(D.left){var R=M.has(D.left)?M.get(D.left):D.left,j=M.has(D.right)?M.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(R)||(n.nodesInRelativeHorizontal.push(R),n.nodeToRelativeConstraintMapHorizontal.set(R,[]),n.dummyToNodeForVerticalAlignment.has(R)?n.nodeToTempPositionMapHorizontal.set(R,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(R)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(R,n.idToNodeMap.get(R).getCenterX())),n.nodesInRelativeHorizontal.includes(j)||(n.nodesInRelativeHorizontal.push(j),n.nodeToRelativeConstraintMapHorizontal.set(j,[]),n.dummyToNodeForVerticalAlignment.has(j)?n.nodeToTempPositionMapHorizontal.set(j,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(j)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(j,n.idToNodeMap.get(j).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(R).push({right:j,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(j).push({left:R,gap:D.gap})}else{var et=x.has(D.top)?x.get(D.top):D.top,mt=x.has(D.bottom)?x.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(et)||(n.nodesInRelativeVertical.push(et),n.nodeToRelativeConstraintMapVertical.set(et,[]),n.dummyToNodeForHorizontalAlignment.has(et)?n.nodeToTempPositionMapVertical.set(et,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(et)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(et,n.idToNodeMap.get(et).getCenterY())),n.nodesInRelativeVertical.includes(mt)||(n.nodesInRelativeVertical.push(mt),n.nodeToRelativeConstraintMapVertical.set(mt,[]),n.dummyToNodeForHorizontalAlignment.has(mt)?n.nodeToTempPositionMapVertical.set(mt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(mt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(mt,n.idToNodeMap.get(mt).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(et).push({bottom:mt,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(mt).push({top:et,gap:D.gap})}});else{var B=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var R=M.has(D.left)?M.get(D.left):D.left,j=M.has(D.right)?M.get(D.right):D.right;B.has(R)?B.get(R).push(j):B.set(R,[j]),B.has(j)?B.get(j).push(R):B.set(j,[R])}else{var et=x.has(D.top)?x.get(D.top):D.top,mt=x.has(D.bottom)?x.get(D.bottom):D.bottom;z.has(et)?z.get(et).push(mt):z.set(et,[mt]),z.has(mt)?z.get(mt).push(et):z.set(mt,[et])}});var W=function(D,R){var j=[],et=[],mt=new Z,$=new Set,xt=0;return D.forEach(function(Q,nt){if(!$.has(nt)){j[xt]=[],et[xt]=!1;var vt=nt;for(mt.push(vt),$.add(vt),j[xt].push(vt);mt.length!=0;){vt=mt.shift(),R.has(vt)&&(et[xt]=!0);var st=D.get(vt);st.forEach(function(Lt){$.has(Lt)||(mt.push(Lt),$.add(Lt),j[xt].push(Lt))})}xt++}}),{components:j,isFixed:et}},q=W(B,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=q.components,this.fixedComponentsOnHorizontal=q.isFixed;var G=W(z,n.fixedNodesOnVertical);this.componentsOnVertical=G.components,this.fixedComponentsOnVertical=G.isFixed}}},C.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(G){var D=n.idToNodeMap.get(G.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var x;for(x=0;xm&&(m=Math.floor(M.y)),b=Math.floor(M.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(N.WORLD_CENTER_X-M.x/2,N.WORLD_CENTER_Y-M.y/2))},C.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),l.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,m);var v=X.calculateBounds(n),b=new Y;b.setDeviceOrgX(v.getMinX()),b.setDeviceOrgY(v.getMinY()),b.setWorldOrgX(p.x),b.setWorldOrgY(p.y);for(var M=0;M1;){var j=R[0];R.splice(0,1);var et=z.indexOf(j);et>=0&&z.splice(et,1),G--,W--}E!=null?D=(z.indexOf(R[0])+1)%G:D=0;for(var mt=Math.abs(m-p)/W,$=D;q!=W;$=++$%G){var xt=z[$].getOtherEnd(n);if(xt!=E){var Q=(p+q*mt)%360,nt=(Q+mt)%360;C.branchRadialLayout(xt,n,Q,nt,v+b,b),q++}}},C.maxDiagonalInTree=function(n){for(var E=F.MIN_VALUE,p=0;pE&&(E=v)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),v=0;v"u"&&(E[x]=[]),E[x]=E[x].concat(b)}Object.keys(E).forEach(function(S){if(E[S].length>1){var k="DummyCompound_"+S;n.memberGroups[k]=E[S];var B=E[S][0].getParent(),z=new t(n.graphManager);z.id=k,z.paddingLeft=B.paddingLeft||0,z.paddingRight=B.paddingRight||0,z.paddingBottom=B.paddingBottom||0,z.paddingTop=B.paddingTop||0,n.idToDummyNode[k]=z;var W=n.getGraphManager().add(n.newGraph(),z),q=B.getChild();q.add(z);for(var G=0;Gv?(m.rect.x-=(m.labelWidth-v)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-v)/2):m.labelPosHorizontal=="right"&&m.setWidth(v+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(b+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>b?(m.rect.y-=(m.labelHeight-b)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-b)/2):m.labelPosVertical=="bottom"&&m.setHeight(b+m.labelHeight))}})},C.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,v=E.paddingTop,b=E.labelMarginLeft,M=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,v,b,M)}},C.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],v=m.paddingLeft,b=m.paddingTop,M=m.labelMarginLeft,x=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,v,b,M,x)})},C.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),v=0;v0)return this.toBeTiled[E]=!1,!1;if(b.getChild()==null){this.toBeTiled[b.id]=!1;continue}if(!this.getToBeTiled(b))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mB&&(B=W.rect.height)}p+=B+n.verticalPadding}},C.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var v=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],v.paddingLeft+v.paddingRight),v.rect.width=p.tiledMemberPack[m].width,v.rect.height=p.tiledMemberPack[m].height,v.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),v.labelMarginLeft=0,v.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var b=v.rect.width,M=v.rect.height;v.labelWidth&&(v.labelPosHorizontal=="left"?(v.rect.x-=v.labelWidth,v.setWidth(b+v.labelWidth),v.labelMarginLeft=v.labelWidth):v.labelPosHorizontal=="center"&&v.labelWidth>b?(v.rect.x-=(v.labelWidth-b)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-b)/2):v.labelPosHorizontal=="right"&&v.setWidth(b+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(M+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>M?(v.rect.y-=(v.labelHeight-M)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-M)/2):v.labelPosVertical=="bottom"&&v.setHeight(M+v.labelHeight))}})},C.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),v=this.getOrgRatio(p),b=this.getOrgRatio(m),M;return bx&&(x=G.getWidth())});var S=b/v,k=M/v,B=Math.pow(p-m,2)+4*(S+m)*(k+p)*v,z=(m-p+Math.sqrt(B))/(2*(S+m)),W;E?(W=Math.ceil(z),W==z&&W++):W=Math.floor(z);var q=W*(S+m)-m;return x>q&&(q=x),q+=m*2,q},C.prototype.tileNodesByFavoringDim=function(n,E,p){var m=l.TILING_PADDING_VERTICAL,v=l.TILING_PADDING_HORIZONTAL,b=l.TILING_COMPARE_BY,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:v,centerX:0,centerY:0};b&&(M.idealRowWidth=this.calcIdealRowWidth(n,p));var x=function(G){return G.rect.width*G.rect.height},S=function(G,D){return x(D)-x(G)};n.sort(function(G,D){var R=S;return M.idealRowWidth?(R=b,R(G.id,D.id)):R(G,D)});for(var k=0,B=0,z=0;z0&&(M+=n.horizontalPadding),n.rowWidth[p]=M,n.width0&&(x+=n.verticalPadding);var S=0;x>n.rowHeight[p]&&(S=n.rowHeight[p],n.rowHeight[p]=x,S=n.rowHeight[p]-S),n.height+=S,n.rows[p].push(E)},C.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},C.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,v=n.rowWidth[m];return v+E+n.horizontalPadding<=n.idealRowWidth}var b=this.getShortestRowIndex(n);if(b<0)return!0;var M=n.rowWidth[b];if(M+n.horizontalPadding+E<=n.width)return!0;var x=0;n.rowHeight[b]0&&(x=p+n.verticalPadding-n.rowHeight[b]);var S;n.width-M>=E+n.horizontalPadding?S=(n.height+x)/(M+E+n.horizontalPadding):S=(n.height+x)/n.width,x=p+n.verticalPadding;var k;return n.widthb&&E!=p){m.splice(-1,1),n.rows[p].push(v),n.rowWidth[E]=n.rowWidth[E]-b,n.rowWidth[p]=n.rowWidth[p]+b,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,x=0;xM&&(M=m[x].height);E>0&&(M+=n.verticalPadding);var S=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=M,n.rowHeight[p]0)for(var q=v;q<=b;q++)W[0]+=this.grid[q][M-1].length+this.grid[q][M].length-1;if(b0)for(var q=M;q<=x;q++)W[3]+=this.grid[v-1][q].length+this.grid[v][q].length-1;for(var G=F.MAX_VALUE,D,R,j=0;j{var a=e(551).FDLayoutNode,o=e(551).IMath;function f(s,l,g,d){a.call(this,s,l,g,d)}f.prototype=Object.create(a.prototype);for(var t in a)f[t]=a[t];f.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*o.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(s,l){for(var g=this.getChild().getNodes(),d,N=0;N{function a(g){if(Array.isArray(g)){for(var d=0,N=Array(g.length);d0){var at=0;ot.forEach(function(gt){O=="horizontal"?(tt.set(gt,c.has(gt)?y[c.get(gt)]:J.get(gt)),at+=tt.get(gt)):(tt.set(gt,c.has(gt)?A[c.get(gt)]:J.get(gt)),at+=tt.get(gt))}),at=at/ot.length,lt.forEach(function(gt){V.has(gt)||tt.set(gt,at)})}else{var wt=0;lt.forEach(function(gt){O=="horizontal"?wt+=c.has(gt)?y[c.get(gt)]:J.get(gt):wt+=c.has(gt)?A[c.get(gt)]:J.get(gt)}),wt=wt/lt.length,lt.forEach(function(gt){tt.set(gt,wt)})}});for(var Et=function(){var lt=it.shift(),ot=_.get(lt);ot.forEach(function(at){if(tt.get(at.id)gt&&(gt=Pt),qtDt&&(Dt=qt)}}catch(jt){It=!0,Tt=jt}finally{try{!St&&Xt.return&&Xt.return()}finally{if(It)throw Tt}}var oe=(at+gt)/2-(wt+Dt)/2,ee=!0,Kt=!1,Zt=void 0;try{for(var $t=lt[Symbol.iterator](),Jt;!(ee=(Jt=$t.next()).done);ee=!0){var ne=Jt.value;tt.set(ne,tt.get(ne)+oe)}}catch(jt){Kt=!0,Zt=jt}finally{try{!ee&&$t.return&&$t.return()}finally{if(Kt)throw Zt}}})}return tt},rt=function(_){var O=0,V=0,J=0,K=0;if(_.forEach(function(ct){ct.left?y[c.get(ct.left)]-y[c.get(ct.right)]>=0?O++:V++:A[c.get(ct.top)]-A[c.get(ct.bottom)]>=0?J++:K++}),O>V&&J>K)for(var ft=0;ftV)for(var ht=0;htK)for(var tt=0;tt1)d.fixedNodeConstraint.forEach(function(_,O){m[O]=[_.position.x,_.position.y],v[O]=[y[c.get(_.nodeId)],A[c.get(_.nodeId)]]}),b=!0;else if(d.alignmentConstraint)(function(){var _=0;if(d.alignmentConstraint.vertical){for(var O=d.alignmentConstraint.vertical,V=function(tt){var ct=new Set;O[tt].forEach(function(yt){ct.add(yt)});var it=new Set([].concat(a(ct)).filter(function(yt){return x.has(yt)})),Et=void 0;it.size>0?Et=y[c.get(it.values().next().value)]:Et=Z(ct).x,O[tt].forEach(function(yt){m[_]=[Et,A[c.get(yt)]],v[_]=[y[c.get(yt)],A[c.get(yt)]],_++})},J=0;J0?Et=y[c.get(it.values().next().value)]:Et=Z(ct).y,K[tt].forEach(function(yt){m[_]=[y[c.get(yt)],Et],v[_]=[y[c.get(yt)],A[c.get(yt)]],_++})},ht=0;htz&&(z=B[q].length,W=q);if(z0){var At={x:0,y:0};d.fixedNodeConstraint.forEach(function(_,O){var V={x:y[c.get(_.nodeId)],y:A[c.get(_.nodeId)]},J=_.position,K=Y(J,V);At.x+=K.x,At.y+=K.y}),At.x/=d.fixedNodeConstraint.length,At.y/=d.fixedNodeConstraint.length,y.forEach(function(_,O){y[O]+=At.x}),A.forEach(function(_,O){A[O]+=At.y}),d.fixedNodeConstraint.forEach(function(_){y[c.get(_.nodeId)]=_.position.x,A[c.get(_.nodeId)]=_.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Ht=d.alignmentConstraint.vertical,Ot=function(_){var O=new Set;Ht[_].forEach(function(K){O.add(K)});var V=new Set([].concat(a(O)).filter(function(K){return x.has(K)})),J=void 0;V.size>0?J=y[c.get(V.values().next().value)]:J=Z(O).x,O.forEach(function(K){x.has(K)||(y[c.get(K)]=J)})},Rt=0;Rt0?J=A[c.get(V.values().next().value)]:J=Z(O).y,O.forEach(function(K){x.has(K)||(A[c.get(K)]=J)})},Gt=0;Gt{r.exports=L}},T={};function u(r){var i=T[r];if(i!==void 0)return i.exports;var e=T[r]={exports:{}};return P[r](e,e.exports,u),e.exports}var h=u(45);return h})()})})(ge)),ge.exports}var fi=ce.exports,_e;function pi(){return _e||(_e=1,(function(w,H){(function(L,P){w.exports=P(ui())})(fi,function(L){return(()=>{var P={658:r=>{r.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var e=arguments.length,a=Array(e>1?e-1:0),o=1;o{var a=(function(){function t(s,l){var g=[],d=!0,N=!1,c=void 0;try{for(var y=s[Symbol.iterator](),A;!(d=(A=y.next()).done)&&(g.push(A.value),!(l&&g.length===l));d=!0);}catch(I){N=!0,c=I}finally{try{!d&&y.return&&y.return()}finally{if(N)throw c}}return g}return function(s,l){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=e(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(t){for(var s={},l=0;l0&&m.merge(x)});for(var v=0;v1){A=c[0],I=A.connectedEdges().length,c.forEach(function(m){m.connectedEdges().length0&&g.set("dummy"+(g.size+1),X),Y},f.relocateComponent=function(t,s,l){if(!l.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(l.quality=="draft"){var y=!0,A=!1,I=void 0;try{for(var F=s.nodeIndexes[Symbol.iterator](),U;!(y=(U=F.next()).done);y=!0){var X=U.value,Y=a(X,2),Z=Y[0],C=Y[1],rt=l.cy.getElementById(Z);if(rt){var n=rt.boundingBox(),E=s.xCoords[C]-n.w/2,p=s.xCoords[C]+n.w/2,m=s.yCoords[C]-n.h/2,v=s.yCoords[C]+n.h/2;Ed&&(d=p),mc&&(c=v)}}}catch(k){A=!0,I=k}finally{try{!y&&F.return&&F.return()}finally{if(A)throw I}}var b=t.x-(d+g)/2,M=t.y-(c+N)/2;s.xCoords=s.xCoords.map(function(k){return k+b}),s.yCoords=s.yCoords.map(function(k){return k+M})}else{Object.keys(s).forEach(function(k){var B=s[k],z=B.getRect().x,W=B.getRect().x+B.getRect().width,q=B.getRect().y,G=B.getRect().y+B.getRect().height;zd&&(d=W),qc&&(c=G)});var x=t.x-(d+g)/2,S=t.y-(c+N)/2;Object.keys(s).forEach(function(k){var B=s[k];B.setCenter(B.getCenterX()+x,B.getCenterY()+S)})}}},f.calcBoundingBox=function(t,s,l,g){for(var d=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,A=void 0,I=void 0,F=void 0,U=void 0,X=t.descendants().not(":parent"),Y=X.length,Z=0;ZA&&(d=A),NF&&(c=F),y{var a=e(548),o=e(140).CoSELayout,f=e(140).CoSENode,t=e(140).layoutBase.PointD,s=e(140).layoutBase.DimensionD,l=e(140).layoutBase.LayoutConstants,g=e(140).layoutBase.FDLayoutConstants,d=e(140).CoSEConstants,N=function(c,y){var A=c.cy,I=c.eles,F=I.nodes(),U=I.edges(),X=void 0,Y=void 0,Z=void 0,C={};c.randomize&&(X=y.nodeIndexes,Y=y.xCoords,Z=y.yCoords);var rt=function(x){return typeof x=="function"},n=function(x,S){return rt(x)?x(S):x},E=a.calcParentsWithoutChildren(A,I),p=function x(S,k,B,z){for(var W=k.length,q=0;q0){var mt=void 0;mt=B.getGraphManager().add(B.newGraph(),R),x(mt,D,B,z)}}},m=function(x,S,k){for(var B=0,z=0,W=0;W0?d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=B/z:rt(c.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=c.idealEdgeLength,d.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH)},v=function(x,S){S.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=S.fixedNodeConstraint),S.alignmentConstraint&&(x.constraints.alignmentConstraint=S.alignmentConstraint),S.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=S.relativePlacementConstraint)};c.nestingFactor!=null&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.nestingFactor),c.gravity!=null&&(d.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=c.gravity),c.numIter!=null&&(d.MAX_ITERATIONS=g.MAX_ITERATIONS=c.numIter),c.gravityRange!=null&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=c.gravityRange),c.gravityCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.gravityCompound),c.gravityRangeCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.gravityRangeCompound),c.initialEnergyOnIncremental!=null&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.initialEnergyOnIncremental),c.tilingCompareBy!=null&&(d.TILING_COMPARE_BY=c.tilingCompareBy),c.quality=="proof"?l.QUALITY=2:l.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=c.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!c.randomize,d.ANIMATE=g.ANIMATE=l.ANIMATE=c.animate,d.TILE=c.tile,d.TILING_PADDING_VERTICAL=typeof c.tilingPaddingVertical=="function"?c.tilingPaddingVertical.call():c.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL=typeof c.tilingPaddingHorizontal=="function"?c.tilingPaddingHorizontal.call():c.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!c.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=c.uniformNodeDimensions,c.step=="transformed"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),c.step=="enforced"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),c.step=="cose"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),c.step=="all"&&(c.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),c.fixedNodeConstraint||c.alignmentConstraint||c.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;var b=new o,M=b.newGraphManager();return p(M.addRoot(),a.getTopMostNodes(F),b,c),m(b,M,U),v(b,c),b.runLayout(),C};r.exports={coseLayout:N}},212:(r,i,e)=>{var a=(function(){function y(A,I){for(var F=0;F0)if(E){var p=t.getTopMostNodes(I.eles.nodes());if(Z=t.connectComponents(F,I.eles,p),Z.forEach(function(Q){var nt=Q.boundingBox();C.push({x:nt.x1+nt.w/2,y:nt.y1+nt.h/2})}),I.randomize&&Z.forEach(function(Q){I.eles=Q,X.push(l(I))}),I.quality=="default"||I.quality=="proof"){var m=F.collection();if(I.tile){var v=new Map,b=[],M=[],x=0,S={nodeIndexes:v,xCoords:b,yCoords:M},k=[];if(Z.forEach(function(Q,nt){Q.edges().length==0&&(Q.nodes().forEach(function(vt,st){m.merge(Q.nodes()[st]),vt.isParent()||(S.nodeIndexes.set(Q.nodes()[st].id(),x++),S.xCoords.push(Q.nodes()[0].position().x),S.yCoords.push(Q.nodes()[0].position().y))}),k.push(nt))}),m.length>1){var B=m.boundingBox();C.push({x:B.x1+B.w/2,y:B.y1+B.h/2}),Z.push(m),X.push(S);for(var z=k.length-1;z>=0;z--)Z.splice(k[z],1),X.splice(k[z],1),C.splice(k[z],1)}}Z.forEach(function(Q,nt){I.eles=Q,Y.push(d(I,X[nt])),t.relocateComponent(C[nt],Y[nt],I)})}else Z.forEach(function(Q,nt){t.relocateComponent(C[nt],X[nt],I)});var W=new Set;if(Z.length>1){var q=[],G=U.filter(function(Q){return Q.css("display")=="none"});Z.forEach(function(Q,nt){var vt=void 0;if(I.quality=="draft"&&(vt=X[nt].nodeIndexes),Q.nodes().not(G).length>0){var st={};st.edges=[],st.nodes=[];var Lt=void 0;Q.nodes().not(G).forEach(function(_t){if(I.quality=="draft")if(!_t.isParent())Lt=vt.get(_t.id()),st.nodes.push({x:X[nt].xCoords[Lt]-_t.boundingbox().w/2,y:X[nt].yCoords[Lt]-_t.boundingbox().h/2,width:_t.boundingbox().w,height:_t.boundingbox().h});else{var Nt=t.calcBoundingBox(_t,X[nt].xCoords,X[nt].yCoords,vt);st.nodes.push({x:Nt.topLeftX,y:Nt.topLeftY,width:Nt.width,height:Nt.height})}else Y[nt][_t.id()]&&st.nodes.push({x:Y[nt][_t.id()].getLeft(),y:Y[nt][_t.id()].getTop(),width:Y[nt][_t.id()].getWidth(),height:Y[nt][_t.id()].getHeight()})}),Q.edges().forEach(function(_t){var Nt=_t.source(),At=_t.target();if(Nt.css("display")!="none"&&At.css("display")!="none")if(I.quality=="draft"){var Ht=vt.get(Nt.id()),Ot=vt.get(At.id()),Rt=[],Ft=[];if(Nt.isParent()){var Wt=t.calcBoundingBox(Nt,X[nt].xCoords,X[nt].yCoords,vt);Rt.push(Wt.topLeftX+Wt.width/2),Rt.push(Wt.topLeftY+Wt.height/2)}else Rt.push(X[nt].xCoords[Ht]),Rt.push(X[nt].yCoords[Ht]);if(At.isParent()){var Gt=t.calcBoundingBox(At,X[nt].xCoords,X[nt].yCoords,vt);Ft.push(Gt.topLeftX+Gt.width/2),Ft.push(Gt.topLeftY+Gt.height/2)}else Ft.push(X[nt].xCoords[Ot]),Ft.push(X[nt].yCoords[Ot]);st.edges.push({startX:Rt[0],startY:Rt[1],endX:Ft[0],endY:Ft[1]})}else Y[nt][Nt.id()]&&Y[nt][At.id()]&&st.edges.push({startX:Y[nt][Nt.id()].getCenterX(),startY:Y[nt][Nt.id()].getCenterY(),endX:Y[nt][At.id()].getCenterX(),endY:Y[nt][At.id()].getCenterY()})}),st.nodes.length>0&&(q.push(st),W.add(nt))}});var D=n.packComponents(q,I.randomize).shifts;if(I.quality=="draft")X.forEach(function(Q,nt){var vt=Q.xCoords.map(function(Lt){return Lt+D[nt].dx}),st=Q.yCoords.map(function(Lt){return Lt+D[nt].dy});Q.xCoords=vt,Q.yCoords=st});else{var R=0;W.forEach(function(Q){Object.keys(Y[Q]).forEach(function(nt){var vt=Y[Q][nt];vt.setCenter(vt.getCenterX()+D[R].dx,vt.getCenterY()+D[R].dy)}),R++})}}}else{var j=I.eles.boundingBox();if(C.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),I.randomize){var et=l(I);X.push(et)}I.quality=="default"||I.quality=="proof"?(Y.push(d(I,X[0])),t.relocateComponent(C[0],Y[0],I)):t.relocateComponent(C[0],X[0],I)}var mt=function(Q,nt){if(I.quality=="default"||I.quality=="proof"){typeof Q=="number"&&(Q=nt);var vt=void 0,st=void 0,Lt=Q.data("id");return Y.forEach(function(Nt){Lt in Nt&&(vt={x:Nt[Lt].getRect().getCenterX(),y:Nt[Lt].getRect().getCenterY()},st=Nt[Lt])}),I.nodeDimensionsIncludeLabels&&(st.labelWidth&&(st.labelPosHorizontal=="left"?vt.x+=st.labelWidth/2:st.labelPosHorizontal=="right"&&(vt.x-=st.labelWidth/2)),st.labelHeight&&(st.labelPosVertical=="top"?vt.y+=st.labelHeight/2:st.labelPosVertical=="bottom"&&(vt.y-=st.labelHeight/2))),vt==null&&(vt={x:Q.position("x"),y:Q.position("y")}),{x:vt.x,y:vt.y}}else{var _t=void 0;return X.forEach(function(Nt){var At=Nt.nodeIndexes.get(Q.id());At!=null&&(_t={x:Nt.xCoords[At],y:Nt.yCoords[At]})}),_t==null&&(_t={x:Q.position("x"),y:Q.position("y")}),{x:_t.x,y:_t.y}}};if(I.quality=="default"||I.quality=="proof"||I.randomize){var $=t.calcParentsWithoutChildren(F,U),xt=U.filter(function(Q){return Q.css("display")=="none"});I.eles=U.not(xt),U.nodes().not(":parent").not(xt).layoutPositions(A,I,mt),$.length>0&&$.forEach(function(Q){Q.position(mt(Q))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),y})();r.exports=c},657:(r,i,e)=>{var a=e(548),o=e(140).layoutBase.Matrix,f=e(140).layoutBase.SVD,t=function(s){var l=s.cy,g=s.eles,d=g.nodes(),N=g.nodes(":parent"),c=new Map,y=new Map,A=new Map,I=[],F=[],U=[],X=[],Y=[],Z=[],C=[],rt=[],n=void 0,E=1e8,p=1e-9,m=s.piTol,v=s.samplingType,b=s.nodeSeparation,M=void 0,x=function(){for(var dt=0,_=0,O=!1;_=J;){ft=V[J++];for(var yt=I[ft],Ct=0;Ctct&&(ct=Y[ot],it=ot)}return it},k=function(dt){var _=void 0;if(dt){_=Math.floor(Math.random()*n);for(var O=0;O=1)break;tt=ht}for(var Et=0;Et=1)break;tt=ht}for(var Ct=0;Ct0&&(O.isParent()?I[_].push(A.get(O.id())):I[_].push(O.id()))})});var xt=function(dt){var _=y.get(dt),O=void 0;c.get(dt).forEach(function(V){l.getElementById(V).isParent()?O=A.get(V):O=V,I[_].push(O),I[y.get(O)].push(dt)})},Q=!0,nt=!1,vt=void 0;try{for(var st=c.keys()[Symbol.iterator](),Lt;!(Q=(Lt=st.next()).done);Q=!0){var _t=Lt.value;xt(_t)}}catch(dt){nt=!0,vt=dt}finally{try{!Q&&st.return&&st.return()}finally{if(nt)throw vt}}n=y.size;var Nt=void 0;if(n>2){M=n{var a=e(212),o=function(f){f&&f("layout","fcose",a)};typeof cytoscape<"u"&&o(cytoscape),r.exports=o},140:r=>{r.exports=L}},T={};function u(r){var i=T[r];if(i!==void 0)return i.exports;var e=T[r]={exports:{}};return P[r](e,e.exports,u),e.exports}var h=u(579);return h})()})})(ce)),ce.exports}var mi=pi();const vi=li(mi);var Me={L:"left",R:"right",T:"top",B:"bottom"},Ce={L:pt(w=>`${w},${w/2} 0,${w} 0,0`,"L"),R:pt(w=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:pt(w=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:pt(w=>`${w/2},0 ${w},${w} 0,${w}`,"B")},re={L:pt((w,H)=>w-H+2,"L"),R:pt((w,H)=>w-2,"R"),T:pt((w,H)=>w-H+2,"T"),B:pt((w,H)=>w-2,"B")},yi=pt(function(w){return kt(w)?w==="L"?"R":"L":w==="T"?"B":"T"},"getOppositeArchitectureDirection"),xe=pt(function(w){const H=w;return H==="L"||H==="R"||H==="T"||H==="B"},"isArchitectureDirection"),kt=pt(function(w){const H=w;return H==="L"||H==="R"},"isArchitectureDirectionX"),Vt=pt(function(w){const H=w;return H==="T"||H==="B"},"isArchitectureDirectionY"),ve=pt(function(w,H){const L=kt(w)&&Vt(H),P=Vt(w)&&kt(H);return L||P},"isArchitectureDirectionXY"),Ei=pt(function(w){const H=w[0],L=w[1],P=kt(H)&&Vt(L),T=Vt(H)&&kt(L);return P||T},"isArchitecturePairXY"),Ni=pt(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),fe=pt(function(w,H){const L=`${w}${H}`;return Ni(L)?L:void 0},"getArchitectureDirectionPair"),Ti=pt(function([w,H],L){const P=L[0],T=L[1];return kt(P)?Vt(T)?[w+(P==="L"?-1:1),H+(T==="T"?1:-1)]:[w+(P==="L"?-1:1),H]:kt(T)?[w+(T==="L"?1:-1),H+(P==="T"?1:-1)]:[w,H+(P==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ai=pt(function(w){return w==="LT"||w==="TL"?[1,1]:w==="BL"||w==="LB"?[1,-1]:w==="BR"||w==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),wi=pt(function(w,H){return ve(w,H)?"bend":kt(w)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Ii=pt(function(w){return w.type==="service"},"isArchitectureService"),Li=pt(function(w){return w.type==="junction"},"isArchitectureJunction"),Oe=pt(w=>w.data(),"edgeData"),te=pt(w=>w.data(),"nodeData"),_i=ei.architecture,Re=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=Ve,this.getAccTitle=$e,this.setDiagramTitle=je,this.getDiagramTitle=qe,this.getAccDescription=Ke,this.setAccDescription=Ze,this.clear()}static{pt(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Je()}addService({id:w,icon:H,in:L,title:P,iconText:T}){if(this.registeredIds[w]!==void 0)throw new Error(`The service id [${w}] is already in use by another ${this.registeredIds[w]}`);if(L!==void 0){if(w===L)throw new Error(`The service [${w}] cannot be placed within itself`);if(this.registeredIds[L]===void 0)throw new Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[L]==="node")throw new Error(`The service [${w}]'s parent is not a group`)}this.registeredIds[w]="node",this.nodes[w]={id:w,type:"service",icon:H,iconText:T,title:P,edges:[],in:L}}getServices(){return Object.values(this.nodes).filter(Ii)}addJunction({id:w,in:H}){this.registeredIds[w]="node",this.nodes[w]={id:w,type:"junction",edges:[],in:H}}getJunctions(){return Object.values(this.nodes).filter(Li)}getNodes(){return Object.values(this.nodes)}getNode(w){return this.nodes[w]??null}addGroup({id:w,icon:H,in:L,title:P}){if(this.registeredIds?.[w]!==void 0)throw new Error(`The group id [${w}] is already in use by another ${this.registeredIds[w]}`);if(L!==void 0){if(w===L)throw new Error(`The group [${w}] cannot be placed within itself`);if(this.registeredIds?.[L]===void 0)throw new Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[L]==="node")throw new Error(`The group [${w}]'s parent is not a group`)}this.registeredIds[w]="group",this.groups[w]={id:w,icon:H,title:P,in:L}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:w,rhsId:H,lhsDir:L,rhsDir:P,lhsInto:T,rhsInto:u,lhsGroup:h,rhsGroup:r,title:i}){if(!xe(L))throw new Error(`Invalid direction given for left hand side of edge ${w}--${H}. Expected (L,R,T,B) got ${String(L)}`);if(!xe(P))throw new Error(`Invalid direction given for right hand side of edge ${w}--${H}. Expected (L,R,T,B) got ${String(P)}`);if(this.nodes[w]===void 0&&this.groups[w]===void 0)throw new Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[H]===void 0&&this.groups[H]===void 0)throw new Error(`The right-hand id [${H}] does not yet exist. Please create the service/group before declaring an edge to it.`);const e=this.nodes[w].in,a=this.nodes[H].in;if(h&&e&&a&&e==a)throw new Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&e&&a&&e==a)throw new Error(`The right-hand id [${H}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const o={lhsId:w,lhsDir:L,lhsInto:T,lhsGroup:h,rhsId:H,rhsDir:P,rhsInto:u,rhsGroup:r,title:i};this.edges.push(o),this.nodes[w]&&this.nodes[H]&&(this.nodes[w].edges.push(this.edges[this.edges.length-1]),this.nodes[H].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const w={},H=Object.entries(this.nodes).reduce((r,[i,e])=>(r[i]=e.edges.reduce((a,o)=>{const f=this.getNode(o.lhsId)?.in,t=this.getNode(o.rhsId)?.in;if(f&&t&&f!==t){const s=wi(o.lhsDir,o.rhsDir);s!=="bend"&&(w[f]??={},w[f][t]=s,w[t]??={},w[t][f]=s)}if(o.lhsId===i){const s=fe(o.lhsDir,o.rhsDir);s&&(a[s]=o.rhsId)}else{const s=fe(o.rhsDir,o.lhsDir);s&&(a[s]=o.lhsId)}return a},{}),r),{}),L=Object.keys(H)[0],P={[L]:1},T=Object.keys(H).reduce((r,i)=>i===L?r:{...r,[i]:1},{}),u=pt(r=>{const i={[r]:[0,0]},e=[r];for(;e.length>0;){const a=e.shift();if(a){P[a]=1,delete T[a];const o=H[a],[f,t]=i[a];Object.entries(o).forEach(([s,l])=>{P[l]||(i[l]=Ti([f,t],s),e.push(l))})}}return i},"BFS"),h=[u(L)];for(;Object.keys(T).length>0;)h.push(u(Object.keys(T)[0]));this.dataStructures={adjList:H,spatialMaps:h,groupAlignments:w}}return this.dataStructures}setElementForId(w,H){this.elements[w]=H}getElementById(w){return this.elements[w]}getConfig(){return Qe({..._i,...ti().architecture})}getConfigField(w){return this.getConfig()[w]}},Mi=pt((w,H)=>{si(w,H),w.groups.map(L=>H.addGroup(L)),w.services.map(L=>H.addService({...L,type:"service"})),w.junctions.map(L=>H.addJunction({...L,type:"junction"})),w.edges.map(L=>H.addEdge(L))},"populateDb"),Ge={parser:{yy:void 0},parse:pt(async w=>{const H=await hi("architecture",w);De.debug(H);const L=Ge.parser?.yy;if(!(L 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.");Mi(H,L)},"parse")},Ci=pt(w=>` .edge { stroke-width: ${w.archEdgeWidth}; stroke: ${w.archEdgeColor}; fill: none; } .arrow { fill: ${w.archEdgeArrowColor}; } .node-bkg { fill: none; stroke: ${w.archGroupBorderColor}; stroke-width: ${w.archGroupBorderWidth}; stroke-dasharray: 8; } .node-icon-text { display: flex; align-items: center; } .node-icon-text > div { color: #fff; margin: 1px; height: fit-content; text-align: center; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; } `,"getStyles"),xi=Ci,Qt=pt(w=>`${w}`,"wrapIcon"),ie={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Qt('')},server:{body:Qt('')},disk:{body:Qt('')},internet:{body:Qt('')},cloud:{body:Qt('')},unknown:ai,blank:{body:Qt("")}}},Di=pt(async function(w,H,L){const P=L.getConfigField("padding"),T=L.getConfigField("iconSize"),u=T/2,h=T/6,r=h/2;await Promise.all(H.edges().map(async i=>{const{source:e,sourceDir:a,sourceArrow:o,sourceGroup:f,target:t,targetDir:s,targetArrow:l,targetGroup:g,label:d}=Oe(i);let{x:N,y:c}=i[0].sourceEndpoint();const{x:y,y:A}=i[0].midpoint();let{x:I,y:F}=i[0].targetEndpoint();const U=P+4;if(f&&(kt(a)?N+=a==="L"?-U:U:c+=a==="T"?-U:U+18),g&&(kt(s)?I+=s==="L"?-U:U:F+=s==="T"?-U:U+18),!f&&L.getNode(e)?.type==="junction"&&(kt(a)?N+=a==="L"?u:-u:c+=a==="T"?u:-u),!g&&L.getNode(t)?.type==="junction"&&(kt(s)?I+=s==="L"?u:-u:F+=s==="T"?u:-u),i[0]._private.rscratch){const X=w.insert("g");if(X.insert("path").attr("d",`M ${N},${c} L ${y},${A} L${I},${F} `).attr("class","edge").attr("id",ri(e,t,{prefix:"L"})),o){const Y=kt(a)?re[a](N,h):N-r,Z=Vt(a)?re[a](c,h):c-r;X.insert("polygon").attr("points",Ce[a](h)).attr("transform",`translate(${Y},${Z})`).attr("class","arrow")}if(l){const Y=kt(s)?re[s](I,h):I-r,Z=Vt(s)?re[s](F,h):F-r;X.insert("polygon").attr("points",Ce[s](h)).attr("transform",`translate(${Y},${Z})`).attr("class","arrow")}if(d){const Y=ve(a,s)?"XY":kt(a)?"X":"Y";let Z=0;Y==="X"?Z=Math.abs(N-I):Y==="Y"?Z=Math.abs(c-F)/1.5:Z=Math.abs(N-I)/2;const C=X.append("g");if(await me(C,d,{useHtmlLabels:!1,width:Z,classes:"architecture-service-label"},pe()),C.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Y==="X")C.attr("transform","translate("+y+", "+A+")");else if(Y==="Y")C.attr("transform","translate("+y+", "+A+") rotate(-90)");else if(Y==="XY"){const rt=fe(a,s);if(rt&&Ei(rt)){const n=C.node().getBoundingClientRect(),[E,p]=Ai(rt);C.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*E*p*45})`);const m=C.node().getBoundingClientRect();C.attr("transform",` translate(${y}, ${A-n.height/2}) translate(${E*m.width/2}, ${p*m.height/2}) rotate(${-1*E*p*45}, 0, ${n.height/2}) `)}}}}}))},"drawEdges"),bi=pt(async function(w,H,L){const P=L.getConfigField("padding")*.75,T=L.getConfigField("fontSize"),u=L.getConfigField("iconSize")/2;await Promise.all(H.nodes().map(async h=>{const r=te(h);if(r.type==="group"){const{h:i,w:e,x1:a,y1:o}=h.boundingBox(),f=w.append("rect");f.attr("id",`group-${r.id}`).attr("x",a+u).attr("y",o+u).attr("width",e).attr("height",i).attr("class","node-bkg");const t=w.append("g");let s=a,l=o;if(r.icon){const g=t.append("g");g.html(`${await de(r.icon,{height:P,width:P,fallbackPrefix:ie.prefix})}`),g.attr("transform","translate("+(s+u+1)+", "+(l+u+1)+")"),s+=P,l+=T/2-1-2}if(r.label){const g=t.append("g");await me(g,r.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},pe()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(s+u+4)+", "+(l+u+2)+")")}L.setElementForId(r.id,f)}}))},"drawGroups"),Oi=pt(async function(w,H,L){const P=pe();for(const T of L){const u=H.append("g"),h=w.getConfigField("iconSize");if(T.title){const a=u.append("g");await me(a,T.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},P),a.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),a.attr("transform","translate("+h/2+", "+h+")")}const r=u.append("g");if(T.icon)r.html(`${await de(T.icon,{height:h,width:h,fallbackPrefix:ie.prefix})}`);else if(T.iconText){r.html(`${await de("blank",{height:h,width:h,fallbackPrefix:ie.prefix})}`);const a=r.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(ii(T.iconText,P)),o=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;a.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/o)};`)}else r.append("path").attr("class","node-bkg").attr("id","node-"+T.id).attr("d",`M0 ${h} v${-h} q0,-5 5,-5 h${h} q5,0 5,5 v${h} H0 Z`);u.attr("id",`service-${T.id}`).attr("class","architecture-service");const{width:i,height:e}=u.node().getBBox();T.width=i,T.height=e,w.setElementForId(T.id,u)}return 0},"drawServices"),Ri=pt(function(w,H,L){L.forEach(P=>{const T=H.append("g"),u=w.getConfigField("iconSize");T.append("g").append("rect").attr("id","node-"+P.id).attr("fill-opacity","0").attr("width",u).attr("height",u),T.attr("class","architecture-junction");const{width:h,height:r}=T._groups[0][0].getBBox();T.width=h,T.height=r,w.setElementForId(P.id,T)})},"drawJunctions");oi([{name:ie.prefix,icons:ie}]),be.use(vi);function Fe(w,H,L){w.forEach(P=>{H.add({group:"nodes",data:{type:"service",id:P.id,icon:P.icon,label:P.title,parent:P.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-service"})})}pt(Fe,"addServices");function Se(w,H,L){w.forEach(P=>{H.add({group:"nodes",data:{type:"junction",id:P.id,parent:P.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-junction"})})}pt(Se,"addJunctions");function Pe(w,H){H.nodes().map(L=>{const P=te(L);P.type!=="group"&&(P.x=L.position().x,P.y=L.position().y,w.getElementById(P.id).attr("transform","translate("+(P.x||0)+","+(P.y||0)+")"))})}pt(Pe,"positionNodes");function Ue(w,H){w.forEach(L=>{H.add({group:"nodes",data:{type:"group",id:L.id,icon:L.icon,label:L.title,parent:L.in},classes:"node-group"})})}pt(Ue,"addGroups");function ke(w,H){w.forEach(L=>{const{lhsId:P,rhsId:T,lhsInto:u,lhsGroup:h,rhsInto:r,lhsDir:i,rhsDir:e,rhsGroup:a,title:o}=L,f=ve(L.lhsDir,L.rhsDir)?"segments":"straight",t={id:`${P}-${T}`,label:o,source:P,sourceDir:i,sourceArrow:u,sourceGroup:h,sourceEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%",target:T,targetDir:e,targetArrow:r,targetGroup:a,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};H.add({group:"edges",data:t,classes:f})})}pt(ke,"addEdges");function Xe(w,H,L){const P=pt((r,i)=>Object.entries(r).reduce((e,[a,o])=>{let f=0;const t=Object.entries(o);if(t.length===1)return e[a]=t[0][1],e;for(let s=0;s{const i={},e={};return Object.entries(r).forEach(([a,[o,f]])=>{const t=w.getNode(a)?.in??"default";i[f]??={},i[f][t]??=[],i[f][t].push(a),e[o]??={},e[o][t]??=[],e[o][t].push(a)}),{horiz:Object.values(P(i,"horizontal")).filter(a=>a.length>1),vert:Object.values(P(e,"vertical")).filter(a=>a.length>1)}}),[u,h]=T.reduce(([r,i],{horiz:e,vert:a})=>[[...r,...e],[...i,...a]],[[],[]]);return{horizontal:u,vertical:h}}pt(Xe,"getAlignments");function Ye(w,H){const L=[],P=pt(u=>`${u[0]},${u[1]}`,"posToStr"),T=pt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return w.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([a,o])=>[P(o),a])),r=[P([0,0])],i={},e={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;r.length>0;){const a=r.shift();if(a){i[a]=1;const o=h[a];if(o){const f=T(a);Object.entries(e).forEach(([t,s])=>{const l=P([f[0]+s[0],f[1]+s[1]]),g=h[l];g&&!i[l]&&(r.push(l),L.push({[Me[t]]:g,[Me[yi(t)]]:o,gap:1.5*H.getConfigField("iconSize")}))})}}}}),L}pt(Ye,"getRelativeConstraints");function He(w,H,L,P,T,{spatialMaps:u,groupAlignments:h}){return new Promise(r=>{const i=ni("body").append("div").attr("id","cy").attr("style","display:none"),e=be({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${T.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${T.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});i.remove(),Ue(L,e),Fe(w,e,T),Se(H,e,T),ke(P,e);const a=Xe(T,u,h),o=Ye(u,T),f=e.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[s,l]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(l);return g===d?1.5*T.getConfigField("iconSize"):.5*T.getConfigField("iconSize")},edgeElasticity(t){const[s,l]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(l);return g===d?.45:.001},alignmentConstraint:a,relativePlacementConstraint:o});f.one("layoutstop",()=>{function t(s,l,g,d){let N,c;const{x:y,y:A}=s,{x:I,y:F}=l;c=(d-A+(y-g)*(A-F)/(y-I))/Math.sqrt(1+Math.pow((A-F)/(y-I),2)),N=Math.sqrt(Math.pow(d-A,2)+Math.pow(g-y,2)-Math.pow(c,2));const U=Math.sqrt(Math.pow(I-y,2)+Math.pow(F-A,2));N=N/U;let X=(I-y)*(d-A)-(F-A)*(g-y);switch(!0){case X>=0:X=1;break;case X<0:X=-1;break}let Y=(I-y)*(g-y)+(F-A)*(d-A);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}return c=Math.abs(c)*X,N=N*Y,{distances:c,weights:N}}pt(t,"getSegmentWeights"),e.startBatch();for(const s of Object.values(e.edges()))if(s.data?.()){const{x:l,y:g}=s.source().position(),{x:d,y:N}=s.target().position();if(l!==d&&g!==N){const c=s.sourceEndpoint(),y=s.targetEndpoint(),{sourceDir:A}=Oe(s),[I,F]=Vt(A)?[c.x,y.y]:[y.x,c.y],{weights:U,distances:X}=t(c,y,I,F);s.style("segment-distances",X),s.style("segment-weights",U)}}e.endBatch(),f.run()}),f.run(),e.ready(t=>{De.info("Ready",t),r(e)})})}pt(He,"layoutArchitecture");var Gi=pt(async(w,H,L,P)=>{const T=P.db,u=T.getServices(),h=T.getJunctions(),r=T.getGroups(),i=T.getEdges(),e=T.getDataStructures(),a=ze(H),o=a.append("g");o.attr("class","architecture-edges");const f=a.append("g");f.attr("class","architecture-services");const t=a.append("g");t.attr("class","architecture-groups"),await Oi(T,f,u),Ri(T,f,h);const s=await He(u,h,r,i,T,e);await Di(o,s,T),await bi(t,s,T),Pe(T,s),Be(void 0,a,T.getConfigField("padding"),T.getConfigField("useMaxWidth"))},"draw"),Fi={draw:Gi},ji={parser:Ge,get db(){return new Re},renderer:Fi,styles:xi};export{ji as diagram}; //# sourceMappingURL=architectureDiagram-VXUJARFQ-D4dy_-Nw.chunk.mjs.map