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