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