import{c as He}from"./chunk-4KE642ED-BWKyYx7V.js";import{p as ze}from"./treemap-KMMF4GRG-7ORZ52ND-hp-dLOEF.js";import{m as A,aN as Ve,b7 as Be,p as we,H as We,U as je,j as $e,e as qe,$ as Je,G as Ze,N as Ke,L as Qe,O as ti,r as ei,a as ue,bj as fe,bo as ge,o as ii,i as ri,J as ni,q as oi,aM as pe,bp as ai,bq as si}from"./mermaid.esm.min-C3PPQ_C2.js";import{r as xe}from"./chunk-7SRKK4IT-Rwt-CZEY.js";import"./chunk-OMTJKCYW-icim_91v.js";import"./app-COnnofor.js";var _e=pe((w,O)=>{A((function(L,b){typeof w=="object"&&typeof O=="object"?O.exports=b():typeof define=="function"&&define.amd?define([],b):typeof w=="object"?w.layoutBase=b():L.layoutBase=b()}),"webpackUniversalModuleDefinition")(w,function(){return(function(L){var b={};function T(c){if(b[c])return b[c].exports;var h=b[c]={i:c,l:!1,exports:{}};return L[c].call(h.exports,h,h.exports,T),h.l=!0,h.exports}return A(T,"__webpack_require__"),T.m=L,T.c=b,T.i=function(c){return c},T.d=function(c,h,o){T.o(c,h)||Object.defineProperty(c,h,{configurable:!1,enumerable:!0,get:o})},T.n=function(c){var h=c&&c.__esModule?A(function(){return c.default},"getDefault"):A(function(){return c},"getModuleExports");return T.d(h,"a",h),h},T.o=function(c,h){return Object.prototype.hasOwnProperty.call(c,h)},T.p="",T(T.s=28)})([(function(L,b,T){function c(){}A(c,"LayoutConstants"),c.QUALITY=1,c.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,c.DEFAULT_INCREMENTAL=!1,c.DEFAULT_ANIMATION_ON_LAYOUT=!0,c.DEFAULT_ANIMATION_DURING_LAYOUT=!1,c.DEFAULT_ANIMATION_PERIOD=50,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,c.DEFAULT_GRAPH_MARGIN=15,c.NODE_DIMENSIONS_INCLUDE_LABELS=!1,c.SIMPLE_NODE_SIZE=40,c.SIMPLE_NODE_HALF_SIZE=c.SIMPLE_NODE_SIZE/2,c.EMPTY_COMPOUND_NODE_SIZE=40,c.MIN_EDGE_LENGTH=1,c.WORLD_BOUNDARY=1e6,c.INITIAL_WORLD_BOUNDARY=c.WORLD_BOUNDARY/1e3,c.WORLD_CENTER_X=1200,c.WORLD_CENTER_Y=900,L.exports=c}),(function(L,b,T){var c=T(2),h=T(8),o=T(9);function i(a,r,f){c.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=a,this.target=r}A(i,"LEdge"),i.prototype=Object.create(c.prototype);for(var e in c)i[e]=c[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,r){for(var f=this.getOtherEnd(a),n=r.getGraphManager().getRoot();;){if(f.getOwner()==r)return f;if(f.getOwner()==n)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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},L.exports=i}),(function(L,b,T){function c(h){this.vGraphObject=h}A(c,"LGraphObject"),L.exports=c}),(function(L,b,T){var c=T(2),h=T(10),o=T(13),i=T(0),e=T(16),a=T(5);function r(n,t,l,u){l==null&&u==null&&(u=t),c.call(this,u),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=u,this.edges=[],this.graphManager=n,l!=null&&t!=null?this.rect=new o(t.x,t.y,l.width,l.height):this.rect=new o}A(r,"LNode"),r.prototype=Object.create(c.prototype);for(var f in c)r[f]=c[f];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(n){this.rect.width=n},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(n){this.rect.height=n},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(n,t){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=t.width,this.rect.height=t.height},r.prototype.setCenter=function(n,t){this.rect.x=n-this.rect.width/2,this.rect.y=t-this.rect.height/2},r.prototype.setLocation=function(n,t){this.rect.x=n,this.rect.y=t},r.prototype.moveBy=function(n,t){this.rect.x+=n,this.rect.y+=t},r.prototype.getEdgeListToNode=function(n){var t=[],l=this;return l.edges.forEach(function(u){if(u.target==n){if(u.source!=l)throw"Incorrect edge source!";t.push(u)}}),t},r.prototype.getEdgesBetween=function(n){var t=[],l=this;return l.edges.forEach(function(u){if(!(u.source==l||u.target==l))throw"Incorrect edge source and/or target";(u.target==n||u.source==n)&&t.push(u)}),t},r.prototype.getNeighborsList=function(){var n=new Set,t=this;return t.edges.forEach(function(l){if(l.source==t)n.add(l.target);else{if(l.target!=t)throw"Incorrect incidency!";n.add(l.source)}}),n},r.prototype.withChildren=function(){var n=new Set,t,l;if(n.add(this),this.child!=null)for(var u=this.child.getNodes(),d=0;dt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(t+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))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(n){var t=this.rect.x;t>i.WORLD_BOUNDARY?t=i.WORLD_BOUNDARY:t<-i.WORLD_BOUNDARY&&(t=-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 u=new a(t,l),d=n.inverseTransformPoint(u);this.setLocation(d.x,d.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},L.exports=r}),(function(L,b,T){var c=T(0);function h(){}A(h,"FDLayoutConstants");for(var o in c)h[o]=c[o];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,b,T){function c(h,o){h==null&&o==null?(this.x=0,this.y=0):(this.x=h,this.y=o)}A(c,"PointD"),c.prototype.getX=function(){return this.x},c.prototype.getY=function(){return this.y},c.prototype.setX=function(h){this.x=h},c.prototype.setY=function(h){this.y=h},c.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},c.prototype.getCopy=function(){return new c(this.x,this.y)},c.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},L.exports=c}),(function(L,b,T){var c=T(2),h=T(10),o=T(0),i=T(7),e=T(3),a=T(1),r=T(13),f=T(12),n=T(11);function t(u,d,N){c.call(this,N),this.estimatedSize=h.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=u,d!=null&&d instanceof i?this.graphManager=d:d!=null&&d instanceof Layout&&(this.graphManager=d.graphManager)}A(t,"LGraph"),t.prototype=Object.create(c.prototype);for(var l in c)t[l]=c[l];t.prototype.getNodes=function(){return this.nodes},t.prototype.getEdges=function(){return this.edges},t.prototype.getGraphManager=function(){return this.graphManager},t.prototype.getParent=function(){return this.parent},t.prototype.getLeft=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getTop=function(){return this.top},t.prototype.getBottom=function(){return this.bottom},t.prototype.isConnected=function(){return this.isConnected},t.prototype.add=function(u,d,N){if(d==null&&N==null){var g=u;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var E=u;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:(E.source=d,E.target=N,E.isInterGraph=!1,this.getEdges().push(E),d.edges.push(E),N!=d&&N.edges.push(E),E)}},t.prototype.remove=function(u){var d=u;if(u 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(),g,E=N.length,_=0;_-1&&H>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(U,1),g.target!=g.source&&g.target.edges.splice(H,1);var C=g.source.owner.getEdges().indexOf(g);if(C==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(C,1)}},t.prototype.updateLeftTop=function(){for(var u=h.MAX_VALUE,d=h.MAX_VALUE,N,g,E,_=this.getNodes(),C=_.length,U=0;UN&&(u=N),d>g&&(d=g)}return u==h.MAX_VALUE?null:(_[0].getParent().paddingLeft!=null?E=_[0].getParent().paddingLeft:E=this.margin,this.left=d-E,this.top=u-E,new f(this.left,this.top))},t.prototype.updateBounds=function(u){for(var d=h.MAX_VALUE,N=-h.MAX_VALUE,g=h.MAX_VALUE,E=-h.MAX_VALUE,_,C,U,H,V,B=this.nodes,q=B.length,x=0;x_&&(d=_),NU&&(g=U),E_&&(d=_),NU&&(g=U),E=this.nodes.length){var q=0;N.forEach(function(x){x.owner==u&&q++}),q==this.nodes.length&&(this.isConnected=!0)}},L.exports=t}),(function(L,b,T){var c,h=T(1);function o(i){c=T(6),this.layout=i,this.graphs=[],this.edges=[]}A(o,"LGraphManager"),o.prototype.addRoot=function(){var i=this.layout.newGraph(),e=this.layout.newNode(null),a=this.add(i,e);return this.setRootGraph(a),this.rootGraph},o.prototype.add=function(i,e,a,r,f){if(a==null&&r==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,r=e,a=i;var n=r.getOwner(),t=f.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(t!=null&&t.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==t)return a.isInterGraph=!1,n.add(a,r,f);if(a.isInterGraph=!0,a.source=r,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}},o.prototype.remove=function(i){if(i instanceof c){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 r,f=a.length,n=0;n=i.getRight()?e[0]+=Math.min(i.getX()-o.getX(),o.getRight()-i.getRight()):i.getX()<=o.getX()&&i.getRight()>=o.getRight()&&(e[0]+=Math.min(o.getX()-i.getX(),i.getRight()-o.getRight())),o.getY()<=i.getY()&&o.getBottom()>=i.getBottom()?e[1]+=Math.min(i.getY()-o.getY(),o.getBottom()-i.getBottom()):i.getY()<=o.getY()&&i.getBottom()>=o.getBottom()&&(e[1]+=Math.min(o.getY()-i.getY(),i.getBottom()-o.getBottom()));var f=Math.abs((i.getCenterY()-o.getCenterY())/(i.getCenterX()-o.getCenterX()));i.getCenterY()===o.getCenterY()&&i.getCenterX()===o.getCenterX()&&(f=1);var n=f*e[0],t=e[1]/f;e[0]n)return e[0]=a,e[1]=l,e[2]=f,e[3]=B,!1;if(rf)return e[0]=t,e[1]=r,e[2]=H,e[3]=n,!1;if(af?(e[0]=d,e[1]=N,s=!0):(e[0]=u,e[1]=l,s=!0):m===p&&(a>f?(e[0]=t,e[1]=l,s=!0):(e[0]=g,e[1]=N,s=!0)),-v===p?f>a?(e[2]=V,e[3]=B,y=!0):(e[2]=H,e[3]=U,y=!0):v===p&&(f>a?(e[2]=C,e[3]=U,y=!0):(e[2]=q,e[3]=B,y=!0)),s&&y)return!1;if(a>f?r>n?(D=this.getCardinalDirection(m,p,4),I=this.getCardinalDirection(v,p,2)):(D=this.getCardinalDirection(-m,p,3),I=this.getCardinalDirection(-v,p,1)):r>n?(D=this.getCardinalDirection(-m,p,1),I=this.getCardinalDirection(-v,p,3)):(D=this.getCardinalDirection(m,p,2),I=this.getCardinalDirection(v,p,4)),!s)switch(D){case 1:X=l,R=a+-_/p,e[0]=R,e[1]=X;break;case 2:R=g,X=r+E*p,e[0]=R,e[1]=X;break;case 3:X=N,R=a+_/p,e[0]=R,e[1]=X;break;case 4:R=d,X=r+-E*p,e[0]=R,e[1]=X;break}if(!y)switch(I){case 1:W=U,Y=f+-st/p,e[2]=Y,e[3]=W;break;case 2:Y=q,W=n+x*p,e[2]=Y,e[3]=W;break;case 3:W=B,Y=f+st/p,e[2]=Y,e[3]=W;break;case 4:Y=V,W=n+-x*p,e[2]=Y,e[3]=W;break}}return!1},h.getCardinalDirection=function(o,i,e){return o>i?e:1+e%4},h.getIntersection=function(o,i,e,a){if(a==null)return this.getIntersection2(o,i,e);var r=o.x,f=o.y,n=i.x,t=i.y,l=e.x,u=e.y,d=a.x,N=a.y,g=void 0,E=void 0,_=void 0,C=void 0,U=void 0,H=void 0,V=void 0,B=void 0,q=void 0;return _=t-f,U=r-n,V=n*f-r*t,C=N-u,H=l-d,B=d*u-l*N,q=_*H-C*U,q===0?null:(g=(U*B-H*V)/q,E=(C*V-_*B)/q,new c(g,E))},h.angleOfVector=function(o,i,e,a){var r=void 0;return o!==e?(r=Math.atan((a-i)/(e-o)),e=0){var N=(-l+Math.sqrt(l*l-4*t*u))/(2*t),g=(-l-Math.sqrt(l*l-4*t*u))/(2*t),E=null;return N>=0&&N<=1?[N]:g>=0&&g<=1?[g]:E}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,b,T){function c(){}A(c,"IMath"),c.sign=function(h){return h>0?1:h<0?-1:0},c.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},c.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},L.exports=c}),(function(L,b,T){function c(){}A(c,"Integer"),c.MAX_VALUE=2147483647,c.MIN_VALUE=-2147483648,L.exports=c}),(function(L,b,T){var c=(function(){function r(f,n){for(var t=0;t"u"?"undefined":c(o);return o==null||i!="object"&&i!="function"},L.exports=h}),(function(L,b,T){function c(l){if(Array.isArray(l)){for(var u=0,d=Array(l.length);u0&&u;){for(_.push(U[0]);_.length>0&&u;){var H=_[0];_.splice(0,1),E.add(H);for(var V=H.getEdges(),g=0;g-1&&U.splice(st,1)}E=new Set,C=new Map}}return l},t.prototype.createDummyNodesForBendpoints=function(l){for(var u=[],d=l.source,N=this.graphManager.calcLowestCommonAncestor(l.source,l.target),g=0;g0){for(var N=this.edgeToDummyNodes.get(d),g=0;g=0&&u.splice(B,1);var q=C.getNeighborsList();q.forEach(function(s){if(d.indexOf(s)<0){var y=N.get(s),m=y-1;m==1&&H.push(s),N.set(s,m)}})}d=d.concat(H),(u.length==1||u.length==2)&&(g=!0,E=u[0])}return E},t.prototype.setGraphManager=function(l){this.graphManager=l},L.exports=t}),(function(L,b,T){function c(){}A(c,"RandomSeed"),c.seed=1,c.x=0,c.nextDouble=function(){return c.x=Math.sin(c.seed++)*1e4,c.x-Math.floor(c.x)},L.exports=c}),(function(L,b,T){var c=T(5);function h(o,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}A(h,"Transform"),h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(o){this.lworldExtX=o},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(o){this.lworldExtY=o},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},h.prototype.transformX=function(o){var i=0,e=this.lworldExtX;return e!=0&&(i=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/e),i},h.prototype.transformY=function(o){var i=0,e=this.lworldExtY;return e!=0&&(i=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/e),i},h.prototype.inverseTransformX=function(o){var i=0,e=this.ldeviceExtX;return e!=0&&(i=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/e),i},h.prototype.inverseTransformY=function(o){var i=0,e=this.ldeviceExtY;return e!=0&&(i=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/e),i},h.prototype.inverseTransformPoint=function(o){var i=new c(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return i},L.exports=h}),(function(L,b,T){function c(n){if(Array.isArray(n)){for(var t=0,l=Array(n.length);to.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(n>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(n-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),t,l=0;l0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,u,d,N,g=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),E=new Set,l=0;l_||E>_)&&(n.gravitationForceX=-this.gravityConstant*d,n.gravitationForceY=-this.gravityConstant*N)):(_=t.getEstimatedSize()*this.compoundGravityRangeFactor,(g>_||E>_)&&(n.gravitationForceX=-this.gravityConstant*d*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},r.prototype.isConverged=function(){var n,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement=g.length||_>=g[0].length)){for(var C=0;Ca},"_defaultCompareFunction")}]),e})();L.exports=i}),(function(L,b,T){function c(){}A(c,"SVD"),c.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 o=Math.min(this.m,this.n);this.s=(function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var At=A(function Ft(St){if(St.length==0)return 0;for(var zt=[],jt=0;jt0;)At.push(0);return At})(this.n),e=(function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At})(this.m),a=!0,r=!0,f=Math.min(this.m-1,this.n),n=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;p--)if(this.s[p]!==0){for(var D=p+1;D=0;z--){if((function(Tt,At){return Tt&&At})(z0;){var P=void 0,rt=void 0;for(P=y-2;P>=-1&&P!==-1;P--)if(Math.abs(i[P])<=Ot+Lt*(Math.abs(this.s[P])+Math.abs(this.s[P+1]))){i[P]=0;break}if(P===y-2)rt=4;else{var ht=void 0;for(ht=y-1;ht>=P&&ht!==P;ht--){var mt=(ht!==y?Math.abs(i[ht]):0)+(ht!==P+1?Math.abs(i[ht-1]):0);if(Math.abs(this.s[ht])<=Ot+Lt*mt){this.s[ht]=0;break}}ht===P?rt=3:ht===y-1?rt=1:(rt=2,P=ht)}switch(P++,rt){case 1:{var Mt=i[y-2];i[y-2]=0;for(var vt=y-2;vt>=P;vt--){var yt=c.hypot(this.s[vt],Mt),wt=this.s[vt]/yt,Ht=Mt/yt;if(this.s[vt]=yt,vt!==P&&(Mt=-Ht*i[vt-1],i[vt-1]=wt*i[vt-1]),r)for(var Pt=0;Pt=this.s[P+1]);){var bt=this.s[P];if(this.s[P]=this.s[P+1],this.s[P+1]=bt,r&&PMath.abs(o)?(i=o/h,i=Math.abs(h)*Math.sqrt(1+i*i)):o!=0?(i=h/o,i=Math.abs(o)*Math.sqrt(1+i*i)):i=0,i},L.exports=c}),(function(L,b,T){var c=(function(){function i(e,a){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,i),this.sequence1=e,this.sequence2=a,this.match_score=r,this.mismatch_penalty=f,this.gap_penalty=n,this.iMax=e.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var t=0;t=0;e--){var a=this.listeners[e];a.event===o&&a.callback===i&&this.listeners.splice(e,1)}},h.emit=function(o,i){for(var e=0;e{A((function(L,b){typeof w=="object"&&typeof O=="object"?O.exports=b(_e()):typeof define=="function"&&define.amd?define(["layout-base"],b):typeof w=="object"?w.coseBase=b(_e()):L.coseBase=b(L.layoutBase)}),"webpackUniversalModuleDefinition")(w,function(L){return(()=>{var b={45:((o,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),o.exports=a}),806:((o,i,e)=>{var a=e(551).FDLayoutConstants;function r(){}A(r,"CoSEConstants");for(var f in a)r[f]=a[f];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=a.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r}),767:((o,i,e)=>{var a=e(551).FDLayoutEdge;function r(n,t,l){a.call(this,n,t,l)}A(r,"CoSEEdge"),r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r}),880:((o,i,e)=>{var a=e(551).LGraph;function r(n,t,l){a.call(this,n,t,l)}A(r,"CoSEGraph"),r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r}),578:((o,i,e)=>{var a=e(551).LGraphManager;function r(n){a.call(this,n)}A(r,"CoSEGraphManager"),r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r}),765:((o,i,e)=>{var a=e(551).FDLayout,r=e(578),f=e(880),n=e(991),t=e(767),l=e(806),u=e(902),d=e(551).FDLayoutConstants,N=e(551).LayoutConstants,g=e(551).Point,E=e(551).PointD,_=e(551).DimensionD,C=e(551).Layout,U=e(551).Integer,H=e(551).IGeometry,V=e(551).LGraph,B=e(551).Transform,q=e(551).LinkedList;function x(){a.call(this),this.toBeTiled={},this.constraints={}}A(x,"CoSELayout"),x.prototype=Object.create(a.prototype);for(var st in a)x[st]=a[st];x.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},x.prototype.newGraph=function(s){return new f(null,this.graphManager,s)},x.prototype.newNode=function(s){return new n(this.graphManager,s)},x.prototype.newEdge=function(s){return new t(null,null,s)},x.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)},x.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},x.prototype.layout=function(){var s=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(v){return s.has(v)});this.graphManager.setAllNodesToApplyGravitation(y)}}else{var m=this.getFlatForest();if(m.length>0)this.positionNodesRadially(m);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(D){return s.has(D)});this.graphManager.setAllNodesToApplyGravitation(y),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%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 s=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(p){return s.has(p)});this.graphManager.setAllNodesToApplyGravitation(y),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 m=!this.isTreeGrowing&&!this.isGrowthFinished,v=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(m,v),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),y={},m=0;m0&&this.updateDisplacements();for(var m=0;m0&&(v.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var I=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(F){s.fixedNodesOnHorizontal.add(F),s.fixedNodesOnVertical.add(F)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var X=this.constraints.alignmentConstraint.vertical,m=0;m=2*F.length/3;it--)G=Math.floor(Math.random()*(it+1)),J=F[it],F[it]=F[G],F[G]=J;return F},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(F){if(F.left){var G=I.has(F.left)?I.get(F.left):F.left,J=I.has(F.right)?I.get(F.right):F.right;s.nodesInRelativeHorizontal.includes(G)||(s.nodesInRelativeHorizontal.push(G),s.nodeToRelativeConstraintMapHorizontal.set(G,[]),s.dummyToNodeForVerticalAlignment.has(G)?s.nodeToTempPositionMapHorizontal.set(G,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(G)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(G,s.idToNodeMap.get(G).getCenterX())),s.nodesInRelativeHorizontal.includes(J)||(s.nodesInRelativeHorizontal.push(J),s.nodeToRelativeConstraintMapHorizontal.set(J,[]),s.dummyToNodeForVerticalAlignment.has(J)?s.nodeToTempPositionMapHorizontal.set(J,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(J)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(J,s.idToNodeMap.get(J).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(G).push({right:J,gap:F.gap}),s.nodeToRelativeConstraintMapHorizontal.get(J).push({left:G,gap:F.gap})}else{var it=R.has(F.top)?R.get(F.top):F.top,ut=R.has(F.bottom)?R.get(F.bottom):F.bottom;s.nodesInRelativeVertical.includes(it)||(s.nodesInRelativeVertical.push(it),s.nodeToRelativeConstraintMapVertical.set(it,[]),s.dummyToNodeForHorizontalAlignment.has(it)?s.nodeToTempPositionMapVertical.set(it,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(it)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(it,s.idToNodeMap.get(it).getCenterY())),s.nodesInRelativeVertical.includes(ut)||(s.nodesInRelativeVertical.push(ut),s.nodeToRelativeConstraintMapVertical.set(ut,[]),s.dummyToNodeForHorizontalAlignment.has(ut)?s.nodeToTempPositionMapVertical.set(ut,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ut)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(ut,s.idToNodeMap.get(ut).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(it).push({bottom:ut,gap:F.gap}),s.nodeToRelativeConstraintMapVertical.get(ut).push({top:it,gap:F.gap})}});else{var W=new Map,j=new Map;this.constraints.relativePlacementConstraint.forEach(function(F){if(F.left){var G=I.has(F.left)?I.get(F.left):F.left,J=I.has(F.right)?I.get(F.right):F.right;W.has(G)?W.get(G).push(J):W.set(G,[J]),W.has(J)?W.get(J).push(G):W.set(J,[G])}else{var it=R.has(F.top)?R.get(F.top):F.top,ut=R.has(F.bottom)?R.get(F.bottom):F.bottom;j.has(it)?j.get(it).push(ut):j.set(it,[ut]),j.has(ut)?j.get(ut).push(it):j.set(ut,[it])}});var z=A(function(F,G){var J=[],it=[],ut=new q,Lt=new Set,Ot=0;return F.forEach(function(P,rt){if(!Lt.has(rt)){J[Ot]=[],it[Ot]=!1;var ht=rt;for(ut.push(ht),Lt.add(ht),J[Ot].push(ht);ut.length!=0;){ht=ut.shift(),G.has(ht)&&(it[Ot]=!0);var mt=F.get(ht);mt.forEach(function(Mt){Lt.has(Mt)||(ut.push(Mt),Lt.add(Mt),J[Ot].push(Mt))})}Ot++}}),{components:J,isFixed:it}},"constructComponents"),K=z(W,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=K.components,this.fixedComponentsOnHorizontal=K.isFixed;var k=z(j,s.fixedNodesOnVertical);this.componentsOnVertical=k.components,this.fixedComponentsOnVertical=k.isFixed}}},x.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(k){var F=s.idToNodeMap.get(k.nodeId);F.displacementX=0,F.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var y=this.constraints.alignmentConstraint.vertical,m=0;m1){var R;for(R=0;Rv&&(v=Math.floor(I.y)),D=Math.floor(I.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new E(N.WORLD_CENTER_X-I.x/2,N.WORLD_CENTER_Y-I.y/2))},x.radialLayout=function(s,y,m){var v=Math.max(this.maxDiagonalInTree(s),l.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(y,null,0,359,0,v);var p=V.calculateBounds(s),D=new B;D.setDeviceOrgX(p.getMinX()),D.setDeviceOrgY(p.getMinY()),D.setWorldOrgX(m.x),D.setWorldOrgY(m.y);for(var I=0;I1;){var J=G[0];G.splice(0,1);var it=j.indexOf(J);it>=0&&j.splice(it,1),k--,z--}y!=null?F=(j.indexOf(G[0])+1)%k:F=0;for(var ut=Math.abs(v-m)/z,Lt=F;K!=z;Lt=++Lt%k){var Ot=j[Lt].getOtherEnd(s);if(Ot!=y){var P=(m+K*ut)%360,rt=(P+ut)%360;x.branchRadialLayout(Ot,s,P,rt,p+D,D),K++}}},x.maxDiagonalInTree=function(s){for(var y=U.MIN_VALUE,m=0;my&&(y=p)}return y},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var s=this,y={};this.memberGroups={},this.idToDummyNode={};for(var m=[],v=this.graphManager.getAllNodes(),p=0;p"u"&&(y[R]=[]),y[R]=y[R].concat(D)}Object.keys(y).forEach(function(X){if(y[X].length>1){var Y="DummyCompound_"+X;s.memberGroups[Y]=y[X];var W=y[X][0].getParent(),j=new n(s.graphManager);j.id=Y,j.paddingLeft=W.paddingLeft||0,j.paddingRight=W.paddingRight||0,j.paddingBottom=W.paddingBottom||0,j.paddingTop=W.paddingTop||0,s.idToDummyNode[Y]=j;var z=s.getGraphManager().add(s.newGraph(),j),K=W.getChild();K.add(j);for(var k=0;kp?(v.rect.x-=(v.labelWidth-p)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-p)/2):v.labelPosHorizontal=="right"&&v.setWidth(p+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(D+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>D?(v.rect.y-=(v.labelHeight-D)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-D)/2):v.labelPosVertical=="bottom"&&v.setHeight(D+v.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var y=this.compoundOrder[s],m=y.id,v=y.paddingLeft,p=y.paddingTop,D=y.labelMarginLeft,I=y.labelMarginTop;this.adjustLocations(this.tiledMemberPack[m],y.rect.x,y.rect.y,v,p,D,I)}},x.prototype.repopulateZeroDegreeMembers=function(){var s=this,y=this.tiledZeroDegreePack;Object.keys(y).forEach(function(m){var v=s.idToDummyNode[m],p=v.paddingLeft,D=v.paddingTop,I=v.labelMarginLeft,R=v.labelMarginTop;s.adjustLocations(y[m],v.rect.x,v.rect.y,p,D,I,R)})},x.prototype.getToBeTiled=function(s){var y=s.id;if(this.toBeTiled[y]!=null)return this.toBeTiled[y];var m=s.getChild();if(m==null)return this.toBeTiled[y]=!1,!1;for(var v=m.getNodes(),p=0;p0)return this.toBeTiled[y]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[y]=!1,!1}return this.toBeTiled[y]=!0,!0},x.prototype.getNodeDegree=function(s){for(var y=s.id,m=s.getEdges(),v=0,p=0;pW&&(W=z.rect.height)}m+=W+s.verticalPadding}},x.prototype.tileCompoundMembers=function(s,y){var m=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(v){var p=y[v];if(m.tiledMemberPack[v]=m.tileNodes(s[v],p.paddingLeft+p.paddingRight),p.rect.width=m.tiledMemberPack[v].width,p.rect.height=m.tiledMemberPack[v].height,p.setCenter(m.tiledMemberPack[v].centerX,m.tiledMemberPack[v].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var D=p.rect.width,I=p.rect.height;p.labelWidth&&(p.labelPosHorizontal=="left"?(p.rect.x-=p.labelWidth,p.setWidth(D+p.labelWidth),p.labelMarginLeft=p.labelWidth):p.labelPosHorizontal=="center"&&p.labelWidth>D?(p.rect.x-=(p.labelWidth-D)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-D)/2):p.labelPosHorizontal=="right"&&p.setWidth(D+p.labelWidth)),p.labelHeight&&(p.labelPosVertical=="top"?(p.rect.y-=p.labelHeight,p.setHeight(I+p.labelHeight),p.labelMarginTop=p.labelHeight):p.labelPosVertical=="center"&&p.labelHeight>I?(p.rect.y-=(p.labelHeight-I)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-I)/2):p.labelPosVertical=="bottom"&&p.setHeight(I+p.labelHeight))}})},x.prototype.tileNodes=function(s,y){var m=this.tileNodesByFavoringDim(s,y,!0),v=this.tileNodesByFavoringDim(s,y,!1),p=this.getOrgRatio(m),D=this.getOrgRatio(v),I;return DR&&(R=k.getWidth())});var X=D/p,Y=I/p,W=Math.pow(m-v,2)+4*(X+v)*(Y+m)*p,j=(v-m+Math.sqrt(W))/(2*(X+v)),z;y?(z=Math.ceil(j),z==j&&z++):z=Math.floor(j);var K=z*(X+v)-v;return R>K&&(K=R),K+=v*2,K},x.prototype.tileNodesByFavoringDim=function(s,y,m){var v=l.TILING_PADDING_VERTICAL,p=l.TILING_PADDING_HORIZONTAL,D=l.TILING_COMPARE_BY,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:y,verticalPadding:v,horizontalPadding:p,centerX:0,centerY:0};D&&(I.idealRowWidth=this.calcIdealRowWidth(s,m));var R=A(function(k){return k.rect.width*k.rect.height},"getNodeArea"),X=A(function(k,F){return R(F)-R(k)},"areaCompareFcn");s.sort(function(k,F){var G=X;return I.idealRowWidth?(G=D,G(k.id,F.id)):G(k,F)});for(var Y=0,W=0,j=0;j0&&(I+=s.horizontalPadding),s.rowWidth[m]=I,s.width0&&(R+=s.verticalPadding);var X=0;R>s.rowHeight[m]&&(X=s.rowHeight[m],s.rowHeight[m]=R,X=s.rowHeight[m]-X),s.height+=X,s.rows[m].push(y)},x.prototype.getShortestRowIndex=function(s){for(var y=-1,m=Number.MAX_VALUE,v=0;vm&&(y=v,m=s.rowWidth[v]);return y},x.prototype.canAddHorizontal=function(s,y,m){if(s.idealRowWidth){var v=s.rows.length-1,p=s.rowWidth[v];return p+y+s.horizontalPadding<=s.idealRowWidth}var D=this.getShortestRowIndex(s);if(D<0)return!0;var I=s.rowWidth[D];if(I+s.horizontalPadding+y<=s.width)return!0;var R=0;s.rowHeight[D]0&&(R=m+s.verticalPadding-s.rowHeight[D]);var X;s.width-I>=y+s.horizontalPadding?X=(s.height+R)/(I+y+s.horizontalPadding):X=(s.height+R)/s.width,R=m+s.verticalPadding;var Y;return s.widthD&&y!=m){v.splice(-1,1),s.rows[m].push(p),s.rowWidth[y]=s.rowWidth[y]-D,s.rowWidth[m]=s.rowWidth[m]+D,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var I=Number.MIN_VALUE,R=0;RI&&(I=v[R].height);y>0&&(I+=s.verticalPadding);var X=s.rowHeight[y]+s.rowHeight[m];s.rowHeight[y]=I,s.rowHeight[m]0)for(var K=p;K<=D;K++)z[0]+=this.grid[K][I-1].length+this.grid[K][I].length-1;if(D0)for(var K=I;K<=R;K++)z[3]+=this.grid[p-1][K].length+this.grid[p][K].length-1;for(var k=U.MAX_VALUE,F,G,J=0;J{var a=e(551).FDLayoutNode,r=e(551).IMath;function f(t,l,u,d){a.call(this,t,l,u,d)}A(f,"CoSENode"),f.prototype=Object.create(a.prototype);for(var n in a)f[n]=a[n];f.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(t,l){for(var u=this.getChild().getNodes(),d,N=0;N{function a(u){if(Array.isArray(u)){for(var d=0,N=Array(u.length);d0){var ot=0;at.forEach(function(ft){S=="horizontal"?(tt.set(ft,g.has(ft)?E[g.get(ft)]:Z.get(ft)),ot+=tt.get(ft)):(tt.set(ft,g.has(ft)?_[g.get(ft)]:Z.get(ft)),ot+=tt.get(ft))}),ot=ot/at.length,nt.forEach(function(ft){$.has(ft)||tt.set(ft,ot)})}else{var Nt=0;nt.forEach(function(ft){S=="horizontal"?Nt+=g.has(ft)?E[g.get(ft)]:Z.get(ft):Nt+=g.has(ft)?_[g.get(ft)]:Z.get(ft)}),Nt=Nt/nt.length,nt.forEach(function(ft){tt.set(ft,Nt)})}});for(var _t=A(function(){var nt=Et.shift(),at=M.get(nt);at.forEach(function(ot){if(tt.get(ot.id)ft&&(ft=St),ztbt&&(bt=zt)}}catch(Jt){Dt=!0,Bt=Jt}finally{try{!Rt&&Tt.return&&Tt.return()}finally{if(Dt)throw Bt}}var jt=(ot+ft)/2-(Nt+bt)/2,re=!0,Zt=!1,Kt=void 0;try{for(var qt=nt[Symbol.iterator](),Qt;!(re=(Qt=qt.next()).done);re=!0){var oe=Qt.value;tt.set(oe,tt.get(oe)+jt)}}catch(Jt){Zt=!0,Kt=Jt}finally{try{!re&&qt.return&&qt.return()}finally{if(Zt)throw Kt}}})}return tt},"findAppropriatePositionForRelativePlacement"),st=A(function(M){var S=0,$=0,Z=0,Q=0;if(M.forEach(function(ct){ct.left?E[g.get(ct.left)]-E[g.get(ct.right)]>=0?S++:$++:_[g.get(ct.top)]-_[g.get(ct.bottom)]>=0?Z++:Q++}),S>$&&Z>Q)for(var pt=0;pt$)for(var dt=0;dtQ)for(var tt=0;tt1)d.fixedNodeConstraint.forEach(function(M,S){v[S]=[M.position.x,M.position.y],p[S]=[E[g.get(M.nodeId)],_[g.get(M.nodeId)]]}),D=!0;else if(d.alignmentConstraint)(function(){var M=0;if(d.alignmentConstraint.vertical){for(var S=d.alignmentConstraint.vertical,$=A(function(tt){var ct=new Set;S[tt].forEach(function(et){ct.add(et)});var Et=new Set([].concat(a(ct)).filter(function(et){return R.has(et)})),_t=void 0;Et.size>0?_t=E[g.get(Et.values().next().value)]:_t=q(ct).x,S[tt].forEach(function(et){v[M]=[_t,_[g.get(et)]],p[M]=[E[g.get(et)],_[g.get(et)]],M++})},"_loop2"),Z=0;Z0?_t=E[g.get(Et.values().next().value)]:_t=q(ct).y,Q[tt].forEach(function(et){v[M]=[E[g.get(et)],_t],p[M]=[E[g.get(et)],_[g.get(et)]],M++})},"_loop3"),dt=0;dtj&&(j=W[K].length,z=K);if(j0){var wt={x:0,y:0};d.fixedNodeConstraint.forEach(function(M,S){var $={x:E[g.get(M.nodeId)],y:_[g.get(M.nodeId)]},Z=M.position,Q=B(Z,$);wt.x+=Q.x,wt.y+=Q.y}),wt.x/=d.fixedNodeConstraint.length,wt.y/=d.fixedNodeConstraint.length,E.forEach(function(M,S){E[S]+=wt.x}),_.forEach(function(M,S){_[S]+=wt.y}),d.fixedNodeConstraint.forEach(function(M){E[g.get(M.nodeId)]=M.position.x,_[g.get(M.nodeId)]=M.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Ht=d.alignmentConstraint.vertical,Pt=A(function(M){var S=new Set;Ht[M].forEach(function(Q){S.add(Q)});var $=new Set([].concat(a(S)).filter(function(Q){return R.has(Q)})),Z=void 0;$.size>0?Z=E[g.get($.values().next().value)]:Z=q(S).x,S.forEach(function(Q){R.has(Q)||(E[g.get(Q)]=Z)})},"_loop4"),Gt=0;Gt0?Z=_[g.get($.values().next().value)]:Z=q(S).y,S.forEach(function(Q){R.has(Q)||(_[g.get(Q)]=Z)})},"_loop5"),Xt=0;Xt{o.exports=L})},T={};function c(o){var i=T[o];if(i!==void 0)return i.exports;var e=T[o]={exports:{}};return b[o](e,e.exports,c),e.exports}A(c,"__webpack_require__");var h=c(45);return h})()})}),hi=pe((w,O)=>{A((function(L,b){typeof w=="object"&&typeof O=="object"?O.exports=b(Ce()):typeof define=="function"&&define.amd?define(["cose-base"],b):typeof w=="object"?w.cytoscapeFcose=b(Ce()):L.cytoscapeFcose=b(L.coseBase)}),"webpackUniversalModuleDefinition")(w,function(L){return(()=>{var b={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var e=arguments.length,a=Array(e>1?e-1:0),r=1;r{var a=(function(){function n(t,l){var u=[],d=!0,N=!1,g=void 0;try{for(var E=t[Symbol.iterator](),_;!(d=(_=E.next()).done)&&(u.push(_.value),!(l&&u.length===l));d=!0);}catch(C){N=!0,g=C}finally{try{!d&&E.return&&E.return()}finally{if(N)throw g}}return u}return A(n,"sliceIterator"),function(t,l){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=e(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(n){for(var t={},l=0;l0&&v.merge(R)});for(var p=0;p1){_=g[0],C=_.connectedEdges().length,g.forEach(function(v){v.connectedEdges().length0&&u.set("dummy"+(u.size+1),V),B},f.relocateComponent=function(n,t,l){if(!l.fixedNodeConstraint){var u=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(l.quality=="draft"){var E=!0,_=!1,C=void 0;try{for(var U=t.nodeIndexes[Symbol.iterator](),H;!(E=(H=U.next()).done);E=!0){var V=H.value,B=a(V,2),q=B[0],x=B[1],st=l.cy.getElementById(q);if(st){var s=st.boundingBox(),y=t.xCoords[x]-s.w/2,m=t.xCoords[x]+s.w/2,v=t.yCoords[x]-s.h/2,p=t.yCoords[x]+s.h/2;yd&&(d=m),vg&&(g=p)}}}catch(Y){_=!0,C=Y}finally{try{!E&&U.return&&U.return()}finally{if(_)throw C}}var D=n.x-(d+u)/2,I=n.y-(g+N)/2;t.xCoords=t.xCoords.map(function(Y){return Y+D}),t.yCoords=t.yCoords.map(function(Y){return Y+I})}else{Object.keys(t).forEach(function(Y){var W=t[Y],j=W.getRect().x,z=W.getRect().x+W.getRect().width,K=W.getRect().y,k=W.getRect().y+W.getRect().height;jd&&(d=z),Kg&&(g=k)});var R=n.x-(d+u)/2,X=n.y-(g+N)/2;Object.keys(t).forEach(function(Y){var W=t[Y];W.setCenter(W.getCenterX()+R,W.getCenterY()+X)})}}},f.calcBoundingBox=function(n,t,l,u){for(var d=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER,_=void 0,C=void 0,U=void 0,H=void 0,V=n.descendants().not(":parent"),B=V.length,q=0;q_&&(d=_),NU&&(g=U),E{var a=e(548),r=e(140).CoSELayout,f=e(140).CoSENode,n=e(140).layoutBase.PointD,t=e(140).layoutBase.DimensionD,l=e(140).layoutBase.LayoutConstants,u=e(140).layoutBase.FDLayoutConstants,d=e(140).CoSEConstants,N=A(function(g,E){var _=g.cy,C=g.eles,U=C.nodes(),H=C.edges(),V=void 0,B=void 0,q=void 0,x={};g.randomize&&(V=E.nodeIndexes,B=E.xCoords,q=E.yCoords);var st=A(function(R){return typeof R=="function"},"isFn"),s=A(function(R,X){return st(R)?R(X):R},"optFn"),y=a.calcParentsWithoutChildren(_,C),m=A(function R(X,Y,W,j){for(var z=Y.length,K=0;K0){var ut=void 0;ut=W.getGraphManager().add(W.newGraph(),G),R(ut,F,W,j)}}},"processChildrenList"),v=A(function(R,X,Y){for(var W=0,j=0,z=0;z0?d.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=W/j:st(g.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=g.idealEdgeLength,d.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)},"processEdges"),p=A(function(R,X){X.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=X.fixedNodeConstraint),X.alignmentConstraint&&(R.constraints.alignmentConstraint=X.alignmentConstraint),X.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=X.relativePlacementConstraint)},"processConstraints");g.nestingFactor!=null&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.nestingFactor),g.gravity!=null&&(d.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=g.gravity),g.numIter!=null&&(d.MAX_ITERATIONS=u.MAX_ITERATIONS=g.numIter),g.gravityRange!=null&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=g.gravityRange),g.gravityCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.gravityCompound),g.gravityRangeCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.gravityRangeCompound),g.initialEnergyOnIncremental!=null&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.initialEnergyOnIncremental),g.tilingCompareBy!=null&&(d.TILING_COMPARE_BY=g.tilingCompareBy),g.quality=="proof"?l.QUALITY=2:l.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=g.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!g.randomize,d.ANIMATE=u.ANIMATE=l.ANIMATE=g.animate,d.TILE=g.tile,d.TILING_PADDING_VERTICAL=typeof g.tilingPaddingVertical=="function"?g.tilingPaddingVertical.call():g.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL=typeof g.tilingPaddingHorizontal=="function"?g.tilingPaddingHorizontal.call():g.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!g.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=g.uniformNodeDimensions,g.step=="transformed"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),g.step=="enforced"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),g.step=="cose"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),g.step=="all"&&(g.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),g.fixedNodeConstraint||g.alignmentConstraint||g.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new r,I=D.newGraphManager();return m(I.addRoot(),a.getTopMostNodes(U),D,g),v(D,I,H),p(D,g),D.runLayout(),x},"coseLayout");o.exports={coseLayout:N}}),212:((o,i,e)=>{var a=(function(){function E(_,C){for(var U=0;U0)if(y){var m=n.getTopMostNodes(C.eles.nodes());if(q=n.connectComponents(U,C.eles,m),q.forEach(function(P){var rt=P.boundingBox();x.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2})}),C.randomize&&q.forEach(function(P){C.eles=P,V.push(l(C))}),C.quality=="default"||C.quality=="proof"){var v=U.collection();if(C.tile){var p=new Map,D=[],I=[],R=0,X={nodeIndexes:p,xCoords:D,yCoords:I},Y=[];if(q.forEach(function(P,rt){P.edges().length==0&&(P.nodes().forEach(function(ht,mt){v.merge(P.nodes()[mt]),ht.isParent()||(X.nodeIndexes.set(P.nodes()[mt].id(),R++),X.xCoords.push(P.nodes()[0].position().x),X.yCoords.push(P.nodes()[0].position().y))}),Y.push(rt))}),v.length>1){var W=v.boundingBox();x.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),q.push(v),V.push(X);for(var j=Y.length-1;j>=0;j--)q.splice(Y[j],1),V.splice(Y[j],1),x.splice(Y[j],1)}}q.forEach(function(P,rt){C.eles=P,B.push(d(C,V[rt])),n.relocateComponent(x[rt],B[rt],C)})}else q.forEach(function(P,rt){n.relocateComponent(x[rt],V[rt],C)});var z=new Set;if(q.length>1){var K=[],k=H.filter(function(P){return P.css("display")=="none"});q.forEach(function(P,rt){var ht=void 0;if(C.quality=="draft"&&(ht=V[rt].nodeIndexes),P.nodes().not(k).length>0){var mt={};mt.edges=[],mt.nodes=[];var Mt=void 0;P.nodes().not(k).forEach(function(vt){if(C.quality=="draft")if(!vt.isParent())Mt=ht.get(vt.id()),mt.nodes.push({x:V[rt].xCoords[Mt]-vt.boundingbox().w/2,y:V[rt].yCoords[Mt]-vt.boundingbox().h/2,width:vt.boundingbox().w,height:vt.boundingbox().h});else{var yt=n.calcBoundingBox(vt,V[rt].xCoords,V[rt].yCoords,ht);mt.nodes.push({x:yt.topLeftX,y:yt.topLeftY,width:yt.width,height:yt.height})}else B[rt][vt.id()]&&mt.nodes.push({x:B[rt][vt.id()].getLeft(),y:B[rt][vt.id()].getTop(),width:B[rt][vt.id()].getWidth(),height:B[rt][vt.id()].getHeight()})}),P.edges().forEach(function(vt){var yt=vt.source(),wt=vt.target();if(yt.css("display")!="none"&&wt.css("display")!="none")if(C.quality=="draft"){var Ht=ht.get(yt.id()),Pt=ht.get(wt.id()),Gt=[],xt=[];if(yt.isParent()){var Ut=n.calcBoundingBox(yt,V[rt].xCoords,V[rt].yCoords,ht);Gt.push(Ut.topLeftX+Ut.width/2),Gt.push(Ut.topLeftY+Ut.height/2)}else Gt.push(V[rt].xCoords[Ht]),Gt.push(V[rt].yCoords[Ht]);if(wt.isParent()){var Xt=n.calcBoundingBox(wt,V[rt].xCoords,V[rt].yCoords,ht);xt.push(Xt.topLeftX+Xt.width/2),xt.push(Xt.topLeftY+Xt.height/2)}else xt.push(V[rt].xCoords[Pt]),xt.push(V[rt].yCoords[Pt]);mt.edges.push({startX:Gt[0],startY:Gt[1],endX:xt[0],endY:xt[1]})}else B[rt][yt.id()]&&B[rt][wt.id()]&&mt.edges.push({startX:B[rt][yt.id()].getCenterX(),startY:B[rt][yt.id()].getCenterY(),endX:B[rt][wt.id()].getCenterX(),endY:B[rt][wt.id()].getCenterY()})}),mt.nodes.length>0&&(K.push(mt),z.add(rt))}});var F=s.packComponents(K,C.randomize).shifts;if(C.quality=="draft")V.forEach(function(P,rt){var ht=P.xCoords.map(function(Mt){return Mt+F[rt].dx}),mt=P.yCoords.map(function(Mt){return Mt+F[rt].dy});P.xCoords=ht,P.yCoords=mt});else{var G=0;z.forEach(function(P){Object.keys(B[P]).forEach(function(rt){var ht=B[P][rt];ht.setCenter(ht.getCenterX()+F[G].dx,ht.getCenterY()+F[G].dy)}),G++})}}}else{var J=C.eles.boundingBox();if(x.push({x:J.x1+J.w/2,y:J.y1+J.h/2}),C.randomize){var it=l(C);V.push(it)}C.quality=="default"||C.quality=="proof"?(B.push(d(C,V[0])),n.relocateComponent(x[0],B[0],C)):n.relocateComponent(x[0],V[0],C)}var ut=A(function(P,rt){if(C.quality=="default"||C.quality=="proof"){typeof P=="number"&&(P=rt);var ht=void 0,mt=void 0,Mt=P.data("id");return B.forEach(function(yt){Mt in yt&&(ht={x:yt[Mt].getRect().getCenterX(),y:yt[Mt].getRect().getCenterY()},mt=yt[Mt])}),C.nodeDimensionsIncludeLabels&&(mt.labelWidth&&(mt.labelPosHorizontal=="left"?ht.x+=mt.labelWidth/2:mt.labelPosHorizontal=="right"&&(ht.x-=mt.labelWidth/2)),mt.labelHeight&&(mt.labelPosVertical=="top"?ht.y+=mt.labelHeight/2:mt.labelPosVertical=="bottom"&&(ht.y-=mt.labelHeight/2))),ht==null&&(ht={x:P.position("x"),y:P.position("y")}),{x:ht.x,y:ht.y}}else{var vt=void 0;return V.forEach(function(yt){var wt=yt.nodeIndexes.get(P.id());wt!=null&&(vt={x:yt.xCoords[wt],y:yt.yCoords[wt]})}),vt==null&&(vt={x:P.position("x"),y:P.position("y")}),{x:vt.x,y:vt.y}}},"getPositions");if(C.quality=="default"||C.quality=="proof"||C.randomize){var Lt=n.calcParentsWithoutChildren(U,H),Ot=H.filter(function(P){return P.css("display")=="none"});C.eles=H.not(Ot),H.nodes().not(":parent").not(Ot).layoutPositions(_,C,ut),Lt.length>0&&Lt.forEach(function(P){P.position(ut(P))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")},"run")}]),E})();o.exports=g}),657:((o,i,e)=>{var a=e(548),r=e(140).layoutBase.Matrix,f=e(140).layoutBase.SVD,n=A(function(t){var l=t.cy,u=t.eles,d=u.nodes(),N=u.nodes(":parent"),g=new Map,E=new Map,_=new Map,C=[],U=[],H=[],V=[],B=[],q=[],x=[],st=[],s=void 0,y=1e8,m=1e-9,v=t.piTol,p=t.samplingType,D=t.nodeSeparation,I=void 0,R=A(function(){for(var lt=0,M=0,S=!1;M=Z;){pt=$[Z++];for(var et=C[pt],It=0;Itct&&(ct=B[at],Et=at)}return Et},"BFS"),Y=A(function(lt){var M=void 0;if(lt){M=Math.floor(Math.random()*s);for(var S=0;S=1)break;ct=tt}for(var et=0;et=1)break;ct=tt}for(var nt=0;nt0&&(S.isParent()?C[M].push(_.get(S.id())):C[M].push(S.id()))})});var Ot=A(function(lt){var M=E.get(lt),S=void 0;g.get(lt).forEach(function($){l.getElementById($).isParent()?S=_.get($):S=$,C[M].push(S),C[E.get(S)].push(lt)})},"_loop"),P=!0,rt=!1,ht=void 0;try{for(var mt=g.keys()[Symbol.iterator](),Mt;!(P=(Mt=mt.next()).done);P=!0){var vt=Mt.value;Ot(vt)}}catch(lt){rt=!0,ht=lt}finally{try{!P&&mt.return&&mt.return()}finally{if(rt)throw ht}}s=E.size;var yt=void 0;if(s>2){I=s{var a=e(212),r=A(function(f){f&&f("layout","fcose",a)},"register");typeof cytoscape<"u"&&r(cytoscape),o.exports=r}),140:(o=>{o.exports=L})},T={};function c(o){var i=T[o];if(i!==void 0)return i.exports;var e=T[o]={exports:{}};return b[o](e,e.exports,c),e.exports}A(c,"__webpack_require__");var h=c(579);return h})()})}),Le={L:"left",R:"right",T:"top",B:"bottom"},Me={L:A(w=>`${w},${w/2} 0,${w} 0,0`,"L"),R:A(w=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:A(w=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:A(w=>`${w/2},0 ${w},${w} 0,${w}`,"B")},ae={L:A((w,O)=>w-O+2,"L"),R:A((w,O)=>w-2,"R"),T:A((w,O)=>w-O+2,"T"),B:A((w,O)=>w-2,"B")},li=A(function(w){return kt(w)?w==="L"?"R":"L":w==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=A(function(w){let O=w;return O==="L"||O==="R"||O==="T"||O==="B"},"isArchitectureDirection"),kt=A(function(w){let O=w;return O==="L"||O==="R"},"isArchitectureDirectionX"),$t=A(function(w){let O=w;return O==="T"||O==="B"},"isArchitectureDirectionY"),me=A(function(w,O){let L=kt(w)&&$t(O),b=$t(w)&&kt(O);return L||b},"isArchitectureDirectionXY"),di=A(function(w){let O=w[0],L=w[1],b=kt(O)&&$t(L),T=$t(O)&&kt(L);return b||T},"isArchitecturePairXY"),gi=A(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),ce=A(function(w,O){let L=`${w}${O}`;return gi(L)?L:void 0},"getArchitectureDirectionPair"),ci=A(function([w,O],L){let b=L[0],T=L[1];return kt(b)?$t(T)?[w+(b==="L"?-1:1),O+(T==="T"?1:-1)]:[w+(b==="L"?-1:1),O]:kt(T)?[w+(T==="L"?1:-1),O+(b==="T"?1:-1)]:[w,O+(b==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ui=A(function(w){return w==="LT"||w==="TL"?[1,1]:w==="BL"||w==="LB"?[1,-1]:w==="BR"||w==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),fi=A(function(w,O){return me(w,O)?"bend":kt(w)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),pi=A(function(w){return w.type==="service"},"isArchitectureService"),mi=A(function(w){return w.type==="junction"},"isArchitectureJunction"),Oe=A(w=>w.data(),"edgeData"),ee=A(w=>w.data(),"nodeData"),vi=ei.architecture,ie,be=(ie=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=We,this.getAccTitle=je,this.setDiagramTitle=$e,this.getDiagramTitle=qe,this.getAccDescription=Je,this.setAccDescription=Ze,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Ke()}addService({id:O,icon:L,in:b,title:T,iconText:c}){if(this.registeredIds[O]!==void 0)throw new Error(`The service id [${O}] is already in use by another ${this.registeredIds[O]}`);if(b!==void 0){if(O===b)throw new Error(`The service [${O}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The service [${O}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[b]==="node")throw new Error(`The service [${O}]'s parent is not a group`)}this.registeredIds[O]="node",this.nodes[O]={id:O,type:"service",icon:L,iconText:c,title:T,edges:[],in:b}}getServices(){return Object.values(this.nodes).filter(pi)}addJunction({id:O,in:L}){this.registeredIds[O]="node",this.nodes[O]={id:O,type:"junction",edges:[],in:L}}getJunctions(){return Object.values(this.nodes).filter(mi)}getNodes(){return Object.values(this.nodes)}getNode(O){return this.nodes[O]??null}addGroup({id:O,icon:L,in:b,title:T}){if(this.registeredIds?.[O]!==void 0)throw new Error(`The group id [${O}] is already in use by another ${this.registeredIds[O]}`);if(b!==void 0){if(O===b)throw new Error(`The group [${O}] cannot be placed within itself`);if(this.registeredIds?.[b]===void 0)throw new Error(`The group [${O}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[b]==="node")throw new Error(`The group [${O}]'s parent is not a group`)}this.registeredIds[O]="group",this.groups[O]={id:O,icon:L,title:T,in:b}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:O,rhsId:L,lhsDir:b,rhsDir:T,lhsInto:c,rhsInto:h,lhsGroup:o,rhsGroup:i,title:e}){if(!Ie(b))throw new Error(`Invalid direction given for left hand side of edge ${O}--${L}. Expected (L,R,T,B) got ${String(b)}`);if(!Ie(T))throw new Error(`Invalid direction given for right hand side of edge ${O}--${L}. Expected (L,R,T,B) got ${String(T)}`);if(this.nodes[O]===void 0&&this.groups[O]===void 0)throw new Error(`The left-hand id [${O}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The right-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);let a=this.nodes[O].in,r=this.nodes[L].in;if(o&&a&&r&&a==r)throw new Error(`The left-hand id [${O}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&r&&a==r)throw new Error(`The right-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let f={lhsId:O,lhsDir:b,lhsInto:c,lhsGroup:o,rhsId:L,rhsDir:T,rhsInto:h,rhsGroup:i,title:e};this.edges.push(f),this.nodes[O]&&this.nodes[L]&&(this.nodes[O].edges.push(this.edges[this.edges.length-1]),this.nodes[L].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let O={},L=Object.entries(this.nodes).reduce((i,[e,a])=>(i[e]=a.edges.reduce((r,f)=>{let n=this.getNode(f.lhsId)?.in,t=this.getNode(f.rhsId)?.in;if(n&&t&&n!==t){let l=fi(f.lhsDir,f.rhsDir);l!=="bend"&&(O[n]??={},O[n][t]=l,O[t]??={},O[t][n]=l)}if(f.lhsId===e){let l=ce(f.lhsDir,f.rhsDir);l&&(r[l]=f.rhsId)}else{let l=ce(f.rhsDir,f.lhsDir);l&&(r[l]=f.lhsId)}return r},{}),i),{}),b=Object.keys(L)[0],T={[b]:1},c=Object.keys(L).reduce((i,e)=>e===b?i:{...i,[e]:1},{}),h=A(i=>{let e={[i]:[0,0]},a=[i];for(;a.length>0;){let r=a.shift();if(r){T[r]=1,delete c[r];let f=L[r],[n,t]=e[r];Object.entries(f).forEach(([l,u])=>{T[u]||(e[u]=ci([n,t],l),a.push(u))})}}return e},"BFS"),o=[h(b)];for(;Object.keys(c).length>0;)o.push(h(Object.keys(c)[0]));this.dataStructures={adjList:L,spatialMaps:o,groupAlignments:O}}return this.dataStructures}setElementForId(O,L){this.elements[O]=L}getElementById(O){return this.elements[O]}getConfig(){return Qe({...vi,...ti().architecture})}getConfigField(O){return this.getConfig()[O]}},A(ie,"ArchitectureDB"),ie),yi=A((w,O)=>{He(w,O),w.groups.map(L=>O.addGroup(L)),w.services.map(L=>O.addService({...L,type:"service"})),w.junctions.map(L=>O.addJunction({...L,type:"junction"})),w.edges.map(L=>O.addEdge(L))},"populateDb"),Re={parser:{yy:void 0},parse:A(async w=>{let O=await ze("architecture",w);we.debug(O);let L=Re.parser?.yy;if(!(L instanceof be))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.");yi(O,L)},"parse")},Ei=A(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"),Ni=Ei,Ti=oi(hi()),te=A(w=>`${w}`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:te('')},server:{body:te('')},disk:{body:te('')},internet:{body:te('')},cloud:{body:te('')},unknown:si,blank:{body:te("")}}},Ai=A(async function(w,O,L){let b=L.getConfigField("padding"),T=L.getConfigField("iconSize"),c=T/2,h=T/6,o=h/2;await Promise.all(O.edges().map(async i=>{let{source:e,sourceDir:a,sourceArrow:r,sourceGroup:f,target:n,targetDir:t,targetArrow:l,targetGroup:u,label:d}=Oe(i),{x:N,y:g}=i[0].sourceEndpoint(),{x:E,y:_}=i[0].midpoint(),{x:C,y:U}=i[0].targetEndpoint(),H=b+4;if(f&&(kt(a)?N+=a==="L"?-H:H:g+=a==="T"?-H:H+18),u&&(kt(t)?C+=t==="L"?-H:H:U+=t==="T"?-H:H+18),!f&&L.getNode(e)?.type==="junction"&&(kt(a)?N+=a==="L"?c:-c:g+=a==="T"?c:-c),!u&&L.getNode(n)?.type==="junction"&&(kt(t)?C+=t==="L"?c:-c:U+=t==="T"?c:-c),i[0]._private.rscratch){let V=w.insert("g");if(V.insert("path").attr("d",`M ${N},${g} L ${E},${_} L${C},${U} `).attr("class","edge").attr("id",ni(e,n,{prefix:"L"})),r){let B=kt(a)?ae[a](N,h):N-o,q=$t(a)?ae[a](g,h):g-o;V.insert("polygon").attr("points",Me[a](h)).attr("transform",`translate(${B},${q})`).attr("class","arrow")}if(l){let B=kt(t)?ae[t](C,h):C-o,q=$t(t)?ae[t](U,h):U-o;V.insert("polygon").attr("points",Me[t](h)).attr("transform",`translate(${B},${q})`).attr("class","arrow")}if(d){let B=me(a,t)?"XY":kt(a)?"X":"Y",q=0;B==="X"?q=Math.abs(N-C):B==="Y"?q=Math.abs(g-U)/1.5:q=Math.abs(N-C)/2;let x=V.append("g");if(await fe(x,d,{useHtmlLabels:!1,width:q,classes:"architecture-service-label"},ue()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),B==="X")x.attr("transform","translate("+E+", "+_+")");else if(B==="Y")x.attr("transform","translate("+E+", "+_+") rotate(-90)");else if(B==="XY"){let st=ce(a,t);if(st&&di(st)){let s=x.node().getBoundingClientRect(),[y,m]=ui(st);x.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*y*m*45})`);let v=x.node().getBoundingClientRect();x.attr("transform",` translate(${E}, ${_-s.height/2}) translate(${y*v.width/2}, ${m*v.height/2}) rotate(${-1*y*m*45}, 0, ${s.height/2}) `)}}}}}))},"drawEdges"),_i=A(async function(w,O,L){let b=L.getConfigField("padding")*.75,T=L.getConfigField("fontSize"),c=L.getConfigField("iconSize")/2;await Promise.all(O.nodes().map(async h=>{let o=ee(h);if(o.type==="group"){let{h:i,w:e,x1:a,y1:r}=h.boundingBox(),f=w.append("rect");f.attr("id",`group-${o.id}`).attr("x",a+c).attr("y",r+c).attr("width",e).attr("height",i).attr("class","node-bkg");let n=w.append("g"),t=a,l=r;if(o.icon){let u=n.append("g");u.html(`${await ge(o.icon,{height:b,width:b,fallbackPrefix:ne.prefix})}`),u.attr("transform","translate("+(t+c+1)+", "+(l+c+1)+")"),t+=b,l+=T/2-1-2}if(o.label){let u=n.append("g");await fe(u,o.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},ue()),u.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),u.attr("transform","translate("+(t+c+4)+", "+(l+c+2)+")")}L.setElementForId(o.id,f)}}))},"drawGroups"),Ci=A(async function(w,O,L){let b=ue();for(let T of L){let c=O.append("g"),h=w.getConfigField("iconSize");if(T.title){let a=c.append("g");await fe(a,T.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},b),a.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),a.attr("transform","translate("+h/2+", "+h+")")}let o=c.append("g");if(T.icon)o.html(`${await ge(T.icon,{height:h,width:h,fallbackPrefix:ne.prefix})}`);else if(T.iconText){o.html(`${await ge("blank",{height:h,width:h,fallbackPrefix:ne.prefix})}`);let a=o.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,b)),r=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;a.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/r)};`)}else o.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`);c.attr("id",`service-${T.id}`).attr("class","architecture-service");let{width:i,height:e}=c.node().getBBox();T.width=i,T.height=e,w.setElementForId(T.id,c)}return 0},"drawServices"),Li=A(function(w,O,L){L.forEach(b=>{let T=O.append("g"),c=w.getConfigField("iconSize");T.append("g").append("rect").attr("id","node-"+b.id).attr("fill-opacity","0").attr("width",c).attr("height",c),T.attr("class","architecture-junction");let{width:h,height:o}=T._groups[0][0].getBBox();T.width=h,T.height=o,w.setElementForId(b.id,T)})},"drawJunctions");ai([{name:ne.prefix,icons:ne}]);xe.use(Ti.default);function De(w,O,L){w.forEach(b=>{O.add({group:"nodes",data:{type:"service",id:b.id,icon:b.icon,label:b.title,parent:b.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-service"})})}A(De,"addServices");function Fe(w,O,L){w.forEach(b=>{O.add({group:"nodes",data:{type:"junction",id:b.id,parent:b.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-junction"})})}A(Fe,"addJunctions");function Se(w,O){O.nodes().map(L=>{let b=ee(L);b.type!=="group"&&(b.x=L.position().x,b.y=L.position().y,w.getElementById(b.id).attr("transform","translate("+(b.x||0)+","+(b.y||0)+")"))})}A(Se,"positionNodes");function Ge(w,O){w.forEach(L=>{O.add({group:"nodes",data:{type:"group",id:L.id,icon:L.icon,label:L.title,parent:L.in},classes:"node-group"})})}A(Ge,"addGroups");function Pe(w,O){w.forEach(L=>{let{lhsId:b,rhsId:T,lhsInto:c,lhsGroup:h,rhsInto:o,lhsDir:i,rhsDir:e,rhsGroup:a,title:r}=L,f=me(L.lhsDir,L.rhsDir)?"segments":"straight",n={id:`${b}-${T}`,label:r,source:b,sourceDir:i,sourceArrow:c,sourceGroup:h,sourceEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%",target:T,targetDir:e,targetArrow:o,targetGroup:a,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};O.add({group:"edges",data:n,classes:f})})}A(Pe,"addEdges");function ke(w,O,L){let b=A((o,i)=>Object.entries(o).reduce((e,[a,r])=>{let f=0,n=Object.entries(r);if(n.length===1)return e[a]=n[0][1],e;for(let t=0;t{let i={},e={};return Object.entries(o).forEach(([a,[r,f]])=>{let n=w.getNode(a)?.in??"default";i[f]??={},i[f][n]??=[],i[f][n].push(a),e[r]??={},e[r][n]??=[],e[r][n].push(a)}),{horiz:Object.values(b(i,"horizontal")).filter(a=>a.length>1),vert:Object.values(b(e,"vertical")).filter(a=>a.length>1)}}),[c,h]=T.reduce(([o,i],{horiz:e,vert:a})=>[[...o,...e],[...i,...a]],[[],[]]);return{horizontal:c,vertical:h}}A(ke,"getAlignments");function Ue(w,O){let L=[],b=A(c=>`${c[0]},${c[1]}`,"posToStr"),T=A(c=>c.split(",").map(h=>parseInt(h)),"strToPos");return w.forEach(c=>{let h=Object.fromEntries(Object.entries(c).map(([a,r])=>[b(r),a])),o=[b([0,0])],i={},e={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){let a=o.shift();if(a){i[a]=1;let r=h[a];if(r){let f=T(a);Object.entries(e).forEach(([n,t])=>{let l=b([f[0]+t[0],f[1]+t[1]]),u=h[l];u&&!i[l]&&(o.push(l),L.push({[Le[n]]:u,[Le[li(n)]]:r,gap:1.5*O.getConfigField("iconSize")}))})}}}}),L}A(Ue,"getRelativeConstraints");function Xe(w,O,L,b,T,{spatialMaps:c,groupAlignments:h}){return new Promise(o=>{let i=ri("body").append("div").attr("id","cy").attr("style","display:none"),e=xe({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(),Ge(L,e),De(w,e,T),Fe(O,e,T),Pe(b,e);let a=ke(T,c,h),r=Ue(c,T),f=e.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(n){let[t,l]=n.connectedNodes(),{parent:u}=ee(t),{parent:d}=ee(l);return u===d?1.5*T.getConfigField("iconSize"):.5*T.getConfigField("iconSize")},edgeElasticity(n){let[t,l]=n.connectedNodes(),{parent:u}=ee(t),{parent:d}=ee(l);return u===d?.45:.001},alignmentConstraint:a,relativePlacementConstraint:r});f.one("layoutstop",()=>{function n(t,l,u,d){let N,g,{x:E,y:_}=t,{x:C,y:U}=l;g=(d-_+(E-u)*(_-U)/(E-C))/Math.sqrt(1+Math.pow((_-U)/(E-C),2)),N=Math.sqrt(Math.pow(d-_,2)+Math.pow(u-E,2)-Math.pow(g,2));let H=Math.sqrt(Math.pow(C-E,2)+Math.pow(U-_,2));N=N/H;let V=(C-E)*(d-_)-(U-_)*(u-E);switch(!0){case V>=0:V=1;break;case V<0:V=-1;break}let B=(C-E)*(u-E)+(U-_)*(d-_);switch(!0){case B>=0:B=1;break;case B<0:B=-1;break}return g=Math.abs(g)*V,N=N*B,{distances:g,weights:N}}A(n,"getSegmentWeights"),e.startBatch();for(let t of Object.values(e.edges()))if(t.data?.()){let{x:l,y:u}=t.source().position(),{x:d,y:N}=t.target().position();if(l!==d&&u!==N){let g=t.sourceEndpoint(),E=t.targetEndpoint(),{sourceDir:_}=Oe(t),[C,U]=$t(_)?[g.x,E.y]:[E.x,g.y],{weights:H,distances:V}=n(g,E,C,U);t.style("segment-distances",V),t.style("segment-weights",H)}}e.endBatch(),f.run()}),f.run(),e.ready(n=>{we.info("Ready",n),o(e)})})}A(Xe,"layoutArchitecture");var Mi=A(async(w,O,L,b)=>{let T=b.db,c=T.getServices(),h=T.getJunctions(),o=T.getGroups(),i=T.getEdges(),e=T.getDataStructures(),a=Ve(O),r=a.append("g");r.attr("class","architecture-edges");let f=a.append("g");f.attr("class","architecture-services");let n=a.append("g");n.attr("class","architecture-groups"),await Ci(T,f,c),Li(T,f,h);let t=await Xe(c,h,o,i,T,e);await Ai(r,t,T),await _i(n,t,T),Se(T,t),Be(void 0,a,T.getConfigField("padding"),T.getConfigField("useMaxWidth"))},"draw"),Ii={draw:Mi},Fi={parser:Re,get db(){return new be},renderer:Ii,styles:Ni};export{Fi as diagram};