@softistx/pulsarix-widget 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/dist/chunks/{abnfDiagram-XWFEHMT6.rxx9wyp3.js → abnfDiagram-XWFEHMT6.9n16jbeh.js} +1 -1
- package/dist/chunks/architecture-WOLXFQ4H.04w48nbq.js +1 -0
- package/dist/chunks/{architectureDiagram-CSQXQB3N.mrm0pgc0.js → architectureDiagram-CSQXQB3N.3c7xm6kb.js} +6 -6
- package/dist/chunks/{blockDiagram-BEDRHYPZ.f4dfpk7e.js → blockDiagram-BEDRHYPZ.b7d9kkgr.js} +2 -2
- package/dist/chunks/{c4Diagram-M2UUVUY5.rz43j1my.js → c4Diagram-M2UUVUY5.f883rrpb.js} +1 -1
- package/dist/chunks/{chat-markdown-BSu4FB_l.xgn4yj83.js → chat-markdown-BSu4FB_l.ngsfz1hc.js} +15 -15
- package/dist/chunks/{classDiagram-v2-KXABOMEV.m96cfcad.js → classDiagram-v2-KXABOMEV.6gcf0jbx.js} +1 -1
- package/dist/chunks/{cose-bilkent-JH36ORCC.zz2rwyw6.js → cose-bilkent-JH36ORCC.900yznpf.js} +1 -1
- package/dist/chunks/cynefin-EF2NZ3EQ.jp3enwcw.js +1 -0
- package/dist/chunks/{cynefinDiagram-NJNITYFG.az2k68wq.js → cynefinDiagram-NJNITYFG.7y6esx64.js} +1 -1
- package/dist/chunks/{dagre-KIHZ2IZ3.mgwg8bc4.js → dagre-KIHZ2IZ3.2xtjsjjb.js} +2 -2
- package/dist/chunks/{diagram-7YQZDPLS.x8fg6705.js → diagram-7YQZDPLS.5a4btxfh.js} +2 -2
- package/dist/chunks/{diagram-QBROCOUO.db60dsss.js → diagram-QBROCOUO.je55sz0f.js} +1 -1
- package/dist/chunks/{diagram-RJJCUUZO.a7e9w297.js → diagram-RJJCUUZO.19nj7yqv.js} +4 -4
- package/dist/chunks/{diagram-WERXNKYE.a04f53kd.js → diagram-WERXNKYE.h15fxc8e.js} +2 -2
- package/dist/chunks/{diagram-YHHI257C.v19jhmrh.js → diagram-YHHI257C.rjb588jf.js} +1 -1
- package/dist/chunks/{diagram-YR4HJLHV.c5e87gmw.js → diagram-YR4HJLHV.5cj602t4.js} +1 -1
- package/dist/chunks/{ebnfDiagram-N527522P.bjrxfgze.js → ebnfDiagram-N527522P.edah3bz7.js} +1 -1
- package/dist/chunks/{editor-shortcuts-dialog-Cz3T8435.5ve4nsaw.js → editor-shortcuts-dialog-Cz3T8435.kb0b5cra.js} +1 -1
- package/dist/chunks/{editor.yak1qktd.js → editor.ywaw7sz9.js} +3 -3
- package/dist/chunks/{elk-O5DQBFGD.1ydp0b7a.js → elk-O5DQBFGD.qnxmxe5n.js} +8 -8
- package/dist/chunks/{emoji-picker-00Bw2c2b.gzznrrz5.js → emoji-picker-00Bw2c2b.2985hrzf.js} +2 -2
- package/dist/chunks/{erDiagram-K3K3BIDK.g171ckq1.js → erDiagram-K3K3BIDK.9wh4fsa9.js} +1 -1
- package/dist/chunks/eventmodeling-K75KTNOO.xt3yb4h8.js +1 -0
- package/dist/chunks/{flow-diagram-DGZOc1z1.3gbgbm5m.js → flow-diagram-DGZOc1z1.1276ykn3.js} +4 -4
- package/dist/chunks/flowDiagram-Z6JWZHQI.3t1zqq9x.js +1 -0
- package/dist/chunks/{ganttDiagram-3PRQTZWP.3b9dh4nr.js → ganttDiagram-3PRQTZWP.4t4r8jy0.js} +2 -2
- package/dist/chunks/gitGraph-VSP46ZUC.v9e8d46n.js +1 -0
- package/dist/chunks/{gitGraphDiagram-VXDFKS5L.thyp7vsd.js → gitGraphDiagram-VXDFKS5L.x4pypqh9.js} +5 -5
- package/dist/chunks/{grid-E2QIVN74.entqjpa3.js → grid-E2QIVN74.8njsnft0.js} +1 -1
- package/dist/chunks/illustration-BcaGDjvB.ahkxq9mz.js +1 -0
- package/dist/chunks/{index.9n1y396a.js → index.0tz15aew.js} +1 -1
- package/dist/chunks/{index.35d4zbh8.js → index.0yskyw4t.js} +1 -1
- package/dist/chunks/{index.g2ba0pke.js → index.10k18jx6.js} +1 -1
- package/dist/chunks/{index.qr6a02kx.js → index.28jrnjz5.js} +2 -2
- package/dist/chunks/{index.w1516g8q.js → index.2j6fty9j.js} +3 -3
- package/dist/chunks/{index.5fcbba6e.js → index.3c95g5mh.js} +1 -1
- package/dist/chunks/{index.6pzexww5.js → index.3y8baz7q.js} +2 -2
- package/dist/chunks/{index.v02zf4zg.js → index.5n55ccv6.js} +1 -1
- package/dist/chunks/{index.zkx4ryzt.js → index.5sj251kq.js} +39 -39
- package/dist/chunks/{index.0g1t1pjx.js → index.a7m06kba.js} +1 -1
- package/dist/chunks/{index.8vaktk8x.js → index.f1bfv6bh.js} +1 -1
- package/dist/chunks/{index.8zg579vd.js → index.gzgeb5ax.js} +1 -1
- package/dist/chunks/{index.zkngte5k.js → index.mjp06b03.js} +1 -1
- package/dist/chunks/{index.cw97ff3b.js → index.mtrj86e8.js} +2 -2
- package/dist/chunks/{index.sw8gvntb.js → index.n53k66q8.js} +1 -1
- package/dist/chunks/{index.rkgfxpm3.js → index.pg4f51t3.js} +4 -4
- package/dist/chunks/{index.h1xzvasx.js → index.q39061xn.js} +1 -1
- package/dist/chunks/{index.w4emtsqw.js → index.tnx5y2zc.js} +1 -1
- package/dist/chunks/{index.a3njhfdd.js → index.znt11tbm.js} +1 -1
- package/dist/chunks/info-OHQRW6UA.atpz16bq.js +1 -0
- package/dist/chunks/{infoDiagram-EZ3ZOAHP.833fvq8n.js → infoDiagram-EZ3ZOAHP.mq5603w2.js} +1 -1
- package/dist/chunks/{ishikawaDiagram-S3EKX5GW.q3evaw24.js → ishikawaDiagram-S3EKX5GW.sx08qj3j.js} +1 -1
- package/dist/chunks/{journeyDiagram-POQNLL5X.9werrmpy.js → journeyDiagram-POQNLL5X.c3e37ws5.js} +1 -1
- package/dist/chunks/{kanban-definition-BH5XI6FM.f3ssda0m.js → kanban-definition-BH5XI6FM.6b85jkvt.js} +1 -1
- package/dist/chunks/{markup-color-chrome-ykGNUl8y.pcgw4znz.js → markup-color-chrome-ykGNUl8y.76asgnkk.js} +1 -1
- package/dist/chunks/{markup-custom-color-MM-HnrqY.sygnt3gs.js → markup-custom-color-MM-HnrqY.de5f5c2g.js} +1 -1
- package/dist/chunks/{mention-list-6cR5VSPa.x0x55xzp.js → mention-list-6cR5VSPa.r7r4w0q8.js} +1 -1
- package/dist/chunks/{mermaid.core.5cqab0cw.js → mermaid.core.kh4z9f22.js} +3 -3
- package/dist/chunks/{mindmap-definition-WVAN44T4.pjjxgse0.js → mindmap-definition-WVAN44T4.07nv313g.js} +1 -1
- package/dist/chunks/packet-JDAUHWVQ.dmnq0wwq.js +1 -0
- package/dist/chunks/{panel.2vwd6k3h.js → panel.zcphrx3e.js} +1 -1
- package/dist/chunks/{pegDiagram-D4NLKWP3.mdacgbzb.js → pegDiagram-D4NLKWP3.2mqrk2xy.js} +1 -1
- package/dist/chunks/pie-XZMESJXO.0rpk8mwa.js +1 -0
- package/dist/chunks/{pieDiagram-36ENHN4W.fb0d6a9w.js → pieDiagram-36ENHN4W.kx9bhkyj.js} +2 -2
- package/dist/chunks/{plated-illustration-pTqcYOQg.6b9fm4a7.js → plated-illustration-pTqcYOQg.a24pxzgf.js} +1 -1
- package/dist/chunks/{quadrantDiagram-ZQUDMS73.m5cgqatg.js → quadrantDiagram-ZQUDMS73.68vxq0vb.js} +1 -1
- package/dist/chunks/radar-ABXABTNO.xt7snfyy.js +1 -0
- package/dist/chunks/railroad-I3PHUGI6.bjssfxkf.js +1 -0
- package/dist/chunks/railroad-abnf-LNEFI6M7.mchc5mex.js +1 -0
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.wz1e7a1n.js +1 -0
- package/dist/chunks/railroad-peg-JR7BVNR7.xg4e4nsz.js +1 -0
- package/dist/chunks/{railroadDiagram-JIZHGYPL.w2e1k61e.js → railroadDiagram-JIZHGYPL.dnj3h1n0.js} +1 -1
- package/dist/chunks/{render-VIF2ZAQL.exs2rt60.js → render-VIF2ZAQL.cawqkxpf.js} +1 -1
- package/dist/chunks/{requirementDiagram-AXW2TVFA.mrxb120d.js → requirementDiagram-AXW2TVFA.5z51j1hn.js} +1 -1
- package/dist/chunks/{sankeyDiagram-FBCJTAIF.csj5n1sg.js → sankeyDiagram-FBCJTAIF.0dqdm7yd.js} +1 -1
- package/dist/chunks/{sequenceDiagram-3LA2ROMG.73qx1ab4.js → sequenceDiagram-3LA2ROMG.0fpdfwg0.js} +1 -1
- package/dist/chunks/{sizeCapture-2Q2CQKSF.vfe8maj3.js → sizeCapture-2Q2CQKSF.gverqc02.js} +1 -1
- package/dist/chunks/{stateDiagram-v2-ATKHQDJO.h4grfmy4.js → stateDiagram-v2-ATKHQDJO.56dj904f.js} +1 -1
- package/dist/chunks/{swimlanes-YQL5WMAO.e2y8jam1.js → swimlanes-YQL5WMAO.frj4npw4.js} +1 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.834hahmm.js +8 -0
- package/dist/chunks/{timeline-definition-7Z437IG3.2zxa6hz5.js → timeline-definition-7Z437IG3.v99ghwdb.js} +1 -1
- package/dist/chunks/treeView-D4JQ5SDB.tbqcaq5q.js +1 -0
- package/dist/chunks/treemap-SAJKECNS.jgfv37a0.js +1 -0
- package/dist/chunks/{usecaseDiagram-RDK6N6HP.61cdyktj.js → usecaseDiagram-RDK6N6HP.b6317ne8.js} +1 -1
- package/dist/chunks/{vennDiagram-SHRQU5PJ.4tspw3rs.js → vennDiagram-SHRQU5PJ.adr331gc.js} +5 -5
- package/dist/chunks/wardley-7MLQ67FV.4653yv6a.js +1 -0
- package/dist/chunks/{wardleyDiagram-F3OXNVQS.q2p8tshx.js → wardleyDiagram-F3OXNVQS.5tt3knhg.js} +4 -4
- package/dist/chunks/{xychartDiagram-GDYJKCDI.69desp9j.js → xychartDiagram-GDYJKCDI.dqs1thzc.js} +4 -4
- package/dist/index.js +12 -12
- package/docs/integration.md +1 -1
- package/package.json +1 -1
- package/dist/chunks/architecture-WOLXFQ4H.hwrxbct0.js +0 -1
- package/dist/chunks/cynefin-EF2NZ3EQ.y29bn1cz.js +0 -1
- package/dist/chunks/eventmodeling-K75KTNOO.46qfxqj7.js +0 -1
- package/dist/chunks/flowDiagram-Z6JWZHQI.f0eaj70g.js +0 -1
- package/dist/chunks/gitGraph-VSP46ZUC.swware7n.js +0 -1
- package/dist/chunks/illustration-BcaGDjvB.1q9xtmyq.js +0 -1
- package/dist/chunks/info-OHQRW6UA.1er9b42t.js +0 -1
- package/dist/chunks/packet-JDAUHWVQ.t5jwb2rb.js +0 -1
- package/dist/chunks/pie-XZMESJXO.pe88zesw.js +0 -1
- package/dist/chunks/radar-ABXABTNO.jtbddwfq.js +0 -1
- package/dist/chunks/railroad-I3PHUGI6.kvyt0f9s.js +0 -1
- package/dist/chunks/railroad-abnf-LNEFI6M7.ybx0vspg.js +0 -1
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.yx4c4enn.js +0 -1
- package/dist/chunks/railroad-peg-JR7BVNR7.mb71eyqe.js +0 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.dtthssd5.js +0 -8
- package/dist/chunks/treeView-D4JQ5SDB.3kgztv30.js +0 -1
- package/dist/chunks/treemap-SAJKECNS.xj47e2ae.js +0 -1
- package/dist/chunks/wardley-7MLQ67FV.pckbr6zr.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ee}from"./index.0g1t1pjx.js";import{e,n,B,k,q,kt,A,L,R,I,M,P,O,u,p,X,bs,pr,tt,Y,Ve,De}from"./index.zkx4ryzt.js";import{oe}from"./index.6pzexww5.js";import{xt}from"./index.d57x7pg9.js";import{Pe,We}from"./index.rkgfxpm3.js";var Ue=We(function(we,Ge){(function(G,x){if(typeof we==="object"&&typeof Ge==="object")Ge.exports=x();else if(typeof define==="function"&&define.amd)define([],x);else if(typeof we==="object")we.layoutBase=x();else G.layoutBase=x()})(we,function(){return function(C){var G={};function x(v){if(G[v])return G[v].exports;var l=G[v]={i:v,l:!1,exports:{}};return C[v].call(l.exports,l,l.exports,x),l.l=!0,l.exports}return x.m=C,x.c=G,x.i=function(v){return v},x.d=function(v,l,s){if(!x.o(v,l))Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:s})},x.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return x.d(l,"a",l),l},x.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},x.p="",x(x.s=28)}([function(C,G,x){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v},function(C,G,x){var v=x(2),l=x(8),s=x(9);function a(g,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=g,this.target=r}a.prototype=Object.create(v.prototype);for(var o in v)a[o]=v[o];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;else if(this.target===g)return this.source;else throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(g,r){var y=this.getOtherEnd(g),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},a.prototype.updateLength=function(){var g=[,,,,];if(this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),g),!this.isOverlapingSourceAndTarget){if(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1)this.lengthX=s.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=s.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},a.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=s.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=s.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=a},function(C,G,x){function v(l){this.vGraphObject=l}C.exports=v},function(C,G,x){var v=x(2),l=x(10),s=x(13),a=x(0),o=x(16),g=x(5);function r(i,t,c,d){if(c==null&&d==null)d=t;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,c!=null&&t!=null)this.rect=new s(t.x,t.y,c.width,c.height);else this.rect=new s}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];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(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},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 g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new g(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(i,t){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=t.width,this.rect.height=t.height},r.prototype.setCenter=function(i,t){this.rect.x=i-this.rect.width/2,this.rect.y=t-this.rect.height/2},r.prototype.setLocation=function(i,t){this.rect.x=i,this.rect.y=t},r.prototype.moveBy=function(i,t){this.rect.x+=i,this.rect.y+=t},r.prototype.getEdgeListToNode=function(i){var t=[],c,d=this;return d.edges.forEach(function(f){if(f.target==i){if(f.source!=d)throw"Incorrect edge source!";t.push(f)}}),t},r.prototype.getEdgesBetween=function(i){var t=[],c,d=this;return d.edges.forEach(function(f){if(!(f.source==d||f.target==d))throw"Incorrect edge source and/or target";if(f.target==i||f.source==i)t.push(f)}),t},r.prototype.getNeighborsList=function(){var i=new Set,t=this;return t.edges.forEach(function(c){if(c.source==t)i.add(c.target);else{if(c.target!=t)throw"Incorrect incidency!";i.add(c.source)}}),i},r.prototype.withChildren=function(){var i=new Set,t,c;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var f=0;f<d.length;f++)t=d[f],c=t.withChildren(),c.forEach(function(F){i.add(F)})}return i},r.prototype.getNoOfChildren=function(){var i=0,t;if(this.child==null)i=1;else{var c=this.child.getNodes();for(var d=0;d<c.length;d++)t=c[d],i+=t.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},r.prototype.scatter=function(){var i,t,c=-a.INITIAL_WORLD_BOUNDARY,d=a.INITIAL_WORLD_BOUNDARY;i=a.WORLD_CENTER_X+o.nextDouble()*(d-c)+c;var f=-a.INITIAL_WORLD_BOUNDARY,F=a.INITIAL_WORLD_BOUNDARY;t=a.WORLD_CENTER_Y+o.nextDouble()*(F-f)+f,this.rect.x=i,this.rect.y=t},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),a.NODE_DIMENSIONS_INCLUDE_LABELS){var t=i.getRight()-i.getLeft(),c=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(t+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>t)this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(t+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(c+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>c)this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(c+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var t=this.rect.x;if(t>a.WORLD_BOUNDARY)t=a.WORLD_BOUNDARY;else if(t<-a.WORLD_BOUNDARY)t=-a.WORLD_BOUNDARY;var c=this.rect.y;if(c>a.WORLD_BOUNDARY)c=a.WORLD_BOUNDARY;else if(c<-a.WORLD_BOUNDARY)c=-a.WORLD_BOUNDARY;var d=new g(t,c),f=i.inverseTransformPoint(d);this.setLocation(f.x,f.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(){if(this.owner==null)return null;return this.owner.getParent()},C.exports=r},function(C,G,x){var v=x(0);function l(){}for(var s in v)l[s]=v[s];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=0.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=0.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,l.COOLING_ADAPTATION_FACTOR=0.33,l.ADAPTATION_LOWER_NODE_LIMIT=1000,l.ADAPTATION_UPPER_NODE_LIMIT=5000,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l},function(C,G,x){function v(l,s){if(l==null&&s==null)this.x=0,this.y=0;else this.x=l,this.y=s}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=v},function(C,G,x){var v=x(2),l=x(10),s=x(0),a=x(7),o=x(3),g=x(1),r=x(13),y=x(12),i=x(11);function t(d,f,F){if(v.call(this,F),this.estimatedSize=l.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,f!=null&&f instanceof a)this.graphManager=f;else if(f!=null&&f instanceof Layout)this.graphManager=f.graphManager}t.prototype=Object.create(v.prototype);for(var c in v)t[c]=v[c];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(d,f,F){if(f==null&&F==null){var T=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(T)>-1)throw"Node already in graph!";return T.owner=this,this.getNodes().push(T),T}else{var N=d;if(!(this.getNodes().indexOf(f)>-1&&this.getNodes().indexOf(F)>-1))throw"Source or target not in graph!";if(!(f.owner==F.owner&&f.owner==this))throw"Both owners must be this graph!";if(f.owner!=F.owner)return null;if(N.source=f,N.target=F,N.isInterGraph=!1,this.getEdges().push(N),f.edges.push(N),F!=f)F.edges.push(N);return N}},t.prototype.remove=function(d){var f=d;if(d instanceof o){if(f==null)throw"Node is null!";if(!(f.owner!=null&&f.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var F=f.edges.slice(),T,N=F.length;for(var S=0;S<N;S++)if(T=F[S],T.isInterGraph)this.graphManager.remove(T);else T.source.owner.remove(T);var z=this.nodes.indexOf(f);if(z==-1)throw"Node not in owner node list!";this.nodes.splice(z,1)}else if(d instanceof g){var T=d;if(T==null)throw"Edge is null!";if(!(T.source!=null&&T.target!=null))throw"Source and/or target is null!";if(!(T.source.owner!=null&&T.target.owner!=null&&T.source.owner==this&&T.target.owner==this))throw"Source and/or target owner is invalid!";var b=T.source.edges.indexOf(T),Q=T.target.edges.indexOf(T);if(!(b>-1&&Q>-1))throw"Source and/or target doesn't know this edge!";if(T.source.edges.splice(b,1),T.target!=T.source)T.target.edges.splice(Q,1);var z=T.source.owner.getEdges().indexOf(T);if(z==-1)throw"Not in owner's edge list!";T.source.owner.getEdges().splice(z,1)}},t.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:f}=l,F,T,N,S=this.getNodes(),z=S.length;for(var b=0;b<z;b++){var Q=S[b];if(F=Q.getTop(),T=Q.getLeft(),d>F)d=F;if(f>T)f=T}if(d==l.MAX_VALUE)return null;if(S[0].getParent().paddingLeft!=null)N=S[0].getParent().paddingLeft;else N=this.margin;return this.left=f-N,this.top=d-N,new y(this.left,this.top)},t.prototype.updateBounds=function(d){var f=l.MAX_VALUE,F=-l.MAX_VALUE,T=l.MAX_VALUE,N=-l.MAX_VALUE,S,z,b,Q,it,_=this.nodes,ut=_.length;for(var W=0;W<ut;W++){var nt=_[W];if(d&&nt.child!=null)nt.updateBounds();if(S=nt.getLeft(),z=nt.getRight(),b=nt.getTop(),Q=nt.getBottom(),f>S)f=S;if(F<z)F=z;if(T>b)T=b;if(N<Q)N=Q}var h=new r(f,T,F-f,N-T);if(f==l.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(_[0].getParent().paddingLeft!=null)it=_[0].getParent().paddingLeft;else it=this.margin;this.left=h.x-it,this.right=h.x+h.width+it,this.top=h.y-it,this.bottom=h.y+h.height+it},t.calculateBounds=function(d){var f=l.MAX_VALUE,F=-l.MAX_VALUE,T=l.MAX_VALUE,N=-l.MAX_VALUE,S,z,b,Q,it=d.length;for(var _=0;_<it;_++){var ut=d[_];if(S=ut.getLeft(),z=ut.getRight(),b=ut.getTop(),Q=ut.getBottom(),f>S)f=S;if(F<z)F=z;if(T>b)T=b;if(N<Q)N=Q}var W=new r(f,T,F-f,N-T);return W},t.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},t.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},t.prototype.calcEstimatedSize=function(){var d=0,f=this.nodes,F=f.length;for(var T=0;T<F;T++){var N=f[T];d+=N.calcEstimatedSize()}if(d==0)this.estimatedSize=s.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},t.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var f=new i,F=new Set,T=this.nodes[0],N,S,z=T.withChildren();z.forEach(function(W){f.push(W),F.add(W)});while(f.length!==0){T=f.shift(),N=T.getEdges();var b=N.length;for(var Q=0;Q<b;Q++){var it=N[Q];if(S=it.getOtherEndInGraph(T,this),S!=null&&!F.has(S)){var _=S.withChildren();_.forEach(function(W){f.push(W),F.add(W)})}}}if(this.isConnected=!1,F.size>=this.nodes.length){var ut=0;if(F.forEach(function(W){if(W.owner==d)ut++}),ut==this.nodes.length)this.isConnected=!0}},C.exports=t},function(C,G,x){var v,l=x(1);function s(a){v=x(6),this.layout=a,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var a=this.layout.newGraph(),o=this.layout.newNode(null),g=this.add(a,o);return this.setRootGraph(g),this.rootGraph},s.prototype.add=function(a,o,g,r,y){if(g==null&&r==null&&y==null){if(a==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(a)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(a),a.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return a.parent=o,o.child=a,a}else{y=g,r=o,g=a;var i=r.getOwner(),t=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(t!=null&&t.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==t)return g.isInterGraph=!1,i.add(g,r,y);else{if(g.isInterGraph=!0,g.source=r,g.target=y,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}}},s.prototype.remove=function(a){if(a instanceof v){var o=a;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(o.getEdges());var r,y=g.length;for(var i=0;i<y;i++)r=g[i],o.remove(r);var t=[];t=t.concat(o.getNodes());var c;y=t.length;for(var i=0;i<y;i++)c=t[i],o.remove(c);if(o==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(o);this.graphs.splice(d,1),o.parent=null}else if(a instanceof l){if(r=a,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},s.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},s.prototype.getGraphs=function(){return this.graphs},s.prototype.getAllNodes=function(){if(this.allNodes==null){var a=[],o=this.getGraphs(),g=o.length;for(var r=0;r<g;r++)a=a.concat(o[r].getNodes());this.allNodes=a}return this.allNodes},s.prototype.resetAllNodes=function(){this.allNodes=null},s.prototype.resetAllEdges=function(){this.allEdges=null},s.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},s.prototype.getAllEdges=function(){if(this.allEdges==null){var a=[],o=this.getGraphs(),g=o.length;for(var r=0;r<o.length;r++)a=a.concat(o[r].getEdges());a=a.concat(this.edges),this.allEdges=a}return this.allEdges},s.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},s.prototype.setAllNodesToApplyGravitation=function(a){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=a},s.prototype.getRoot=function(){return this.rootGraph},s.prototype.setRootGraph=function(a){if(a.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=a,a.parent==null)a.parent=this.layout.newNode("Root node")},s.prototype.getLayout=function(){return this.layout},s.prototype.isOneAncestorOfOther=function(a,o){if(!(a!=null&&o!=null))throw"assert failed";if(a==o)return!0;var g=a.getOwner(),r;do{if(r=g.getParent(),r==null)break;if(r==o)return!0;if(g=r.getOwner(),g==null)break}while(!0);g=o.getOwner();do{if(r=g.getParent(),r==null)break;if(r==a)return!0;if(g=r.getOwner(),g==null)break}while(!0);return!1},s.prototype.calcLowestCommonAncestors=function(){var a,o,g,r,y,i=this.getAllEdges(),t=i.length;for(var c=0;c<t;c++){if(a=i[c],o=a.source,g=a.target,a.lca=null,a.sourceInLca=o,a.targetInLca=g,o==g){a.lca=o.getOwner();continue}r=o.getOwner();while(a.lca==null){a.targetInLca=g,y=g.getOwner();while(a.lca==null){if(y==r){a.lca=y;break}if(y==this.rootGraph)break;if(a.lca!=null)throw"assert failed";a.targetInLca=y.getParent(),y=a.targetInLca.getOwner()}if(r==this.rootGraph)break;if(a.lca==null)a.sourceInLca=r.getParent(),r=a.sourceInLca.getOwner()}if(a.lca==null)throw"assert failed"}},s.prototype.calcLowestCommonAncestor=function(a,o){if(a==o)return a.getOwner();var g=a.getOwner();do{if(g==null)break;var r=o.getOwner();do{if(r==null)break;if(r==g)return r;r=r.getParent().getOwner()}while(!0);g=g.getParent().getOwner()}while(!0);return g},s.prototype.calcInclusionTreeDepths=function(a,o){if(a==null&&o==null)a=this.rootGraph,o=1;var g,r=a.getNodes(),y=r.length;for(var i=0;i<y;i++)if(g=r[i],g.inclusionTreeDepth=o,g.child!=null)this.calcInclusionTreeDepths(g.child,o+1)},s.prototype.includesInvalidEdge=function(){var a,o=[],g=this.edges.length;for(var r=0;r<g;r++)if(a=this.edges[r],this.isOneAncestorOfOther(a.source,a.target))o.push(a);for(var r=0;r<o.length;r++)this.remove(o[r]);return!1},C.exports=s},function(C,G,x){var v=x(12);function l(){}l.calcSeparationAmount=function(s,a,o,g){if(!s.intersects(a))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(s,a,r),o[0]=Math.min(s.getRight(),a.getRight())-Math.max(s.x,a.x),o[1]=Math.min(s.getBottom(),a.getBottom())-Math.max(s.y,a.y),s.getX()<=a.getX()&&s.getRight()>=a.getRight())o[0]+=Math.min(a.getX()-s.getX(),s.getRight()-a.getRight());else if(a.getX()<=s.getX()&&a.getRight()>=s.getRight())o[0]+=Math.min(s.getX()-a.getX(),a.getRight()-s.getRight());if(s.getY()<=a.getY()&&s.getBottom()>=a.getBottom())o[1]+=Math.min(a.getY()-s.getY(),s.getBottom()-a.getBottom());else if(a.getY()<=s.getY()&&a.getBottom()>=s.getBottom())o[1]+=Math.min(s.getY()-a.getY(),a.getBottom()-s.getBottom());var y=Math.abs((a.getCenterY()-s.getCenterY())/(a.getCenterX()-s.getCenterX()));if(a.getCenterY()===s.getCenterY()&&a.getCenterX()===s.getCenterX())y=1;var i=y*o[0],t=o[1]/y;if(o[0]<t)t=o[0];else i=o[1];o[0]=-1*r[0]*(t/2+g),o[1]=-1*r[1]*(i/2+g)},l.decideDirectionsForOverlappingNodes=function(s,a,o){if(s.getCenterX()<a.getCenterX())o[0]=-1;else o[0]=1;if(s.getCenterY()<a.getCenterY())o[1]=-1;else o[1]=1},l.getIntersection2=function(s,a,o){var g=s.getCenterX(),r=s.getCenterY(),y=a.getCenterX(),i=a.getCenterY();if(s.intersects(a))return o[0]=g,o[1]=r,o[2]=y,o[3]=i,!0;var t=s.getX(),c=s.getY(),d=s.getRight(),f=s.getX(),F=s.getBottom(),T=s.getRight(),N=s.getWidthHalf(),S=s.getHeightHalf(),z=a.getX(),b=a.getY(),Q=a.getRight(),it=a.getX(),_=a.getBottom(),ut=a.getRight(),W=a.getWidthHalf(),nt=a.getHeightHalf(),h=!1,w=!1;if(g===y){if(r>i)return o[0]=g,o[1]=c,o[2]=y,o[3]=_,!1;else if(r<i)return o[0]=g,o[1]=F,o[2]=y,o[3]=b,!1}else if(r===i){if(g>y)return o[0]=t,o[1]=r,o[2]=Q,o[3]=i,!1;else if(g<y)return o[0]=d,o[1]=r,o[2]=z,o[3]=i,!1}else{var E=s.height/s.width,D=a.height/a.width,m=(i-r)/(y-g),V=void 0,H=void 0,j=void 0,J=void 0,Z=void 0,ct=void 0;if(-E===m)if(g>y)o[0]=f,o[1]=F,h=!0;else o[0]=d,o[1]=c,h=!0;else if(E===m)if(g>y)o[0]=t,o[1]=c,h=!0;else o[0]=T,o[1]=F,h=!0;if(-D===m)if(y>g)o[2]=it,o[3]=_,w=!0;else o[2]=Q,o[3]=b,w=!0;else if(D===m)if(y>g)o[2]=z,o[3]=b,w=!0;else o[2]=ut,o[3]=_,w=!0;if(h&&w)return!1;if(g>y)if(r>i)V=this.getCardinalDirection(E,m,4),H=this.getCardinalDirection(D,m,2);else V=this.getCardinalDirection(-E,m,3),H=this.getCardinalDirection(-D,m,1);else if(r>i)V=this.getCardinalDirection(-E,m,1),H=this.getCardinalDirection(-D,m,3);else V=this.getCardinalDirection(E,m,2),H=this.getCardinalDirection(D,m,4);if(!h)switch(V){case 1:J=c,j=g+-S/m,o[0]=j,o[1]=J;break;case 2:j=T,J=r+N*m,o[0]=j,o[1]=J;break;case 3:J=F,j=g+S/m,o[0]=j,o[1]=J;break;case 4:j=f,J=r+-N*m,o[0]=j,o[1]=J;break}if(!w)switch(H){case 1:ct=b,Z=y+-nt/m,o[2]=Z,o[3]=ct;break;case 2:Z=ut,ct=i+W*m,o[2]=Z,o[3]=ct;break;case 3:ct=_,Z=y+nt/m,o[2]=Z,o[3]=ct;break;case 4:Z=it,ct=i+-W*m,o[2]=Z,o[3]=ct;break}}return!1},l.getCardinalDirection=function(s,a,o){if(s>a)return o;else return 1+o%4},l.getIntersection=function(s,a,o,g){if(g==null)return this.getIntersection2(s,a,o);var{x:r,y}=s,{x:i,y:t}=a,{x:c,y:d}=o,{x:f,y:F}=g,T=void 0,N=void 0,S=void 0,z=void 0,b=void 0,Q=void 0,it=void 0,_=void 0,ut=void 0;if(S=t-y,b=r-i,it=i*y-r*t,z=F-d,Q=c-f,_=f*d-c*F,ut=S*Q-z*b,ut===0)return null;return T=(b*_-Q*it)/ut,N=(z*it-S*_)/ut,new v(T,N)},l.angleOfVector=function(s,a,o,g){var r=void 0;if(s!==o){if(r=Math.atan((g-a)/(o-s)),o<s)r+=Math.PI;else if(g<a)r+=this.TWO_PI}else if(g<a)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},l.doIntersect=function(s,a,o,g){var{x:r,y}=s,{x:i,y:t}=a,{x:c,y:d}=o,{x:f,y:F}=g,T=(i-r)*(F-d)-(f-c)*(t-y);if(T===0)return!1;else{var N=((F-d)*(f-r)+(c-f)*(F-y))/T,S=((y-t)*(f-r)+(i-r)*(F-y))/T;return 0<N&&N<1&&0<S&&S<1}},l.findCircleLineIntersections=function(s,a,o,g,r,y,i){var t=(o-s)*(o-s)+(g-a)*(g-a),c=2*((s-r)*(o-s)+(a-y)*(g-a)),d=(s-r)*(s-r)+(a-y)*(a-y)-i*i,f=c*c-4*t*d;if(f>=0){var F=(-c+Math.sqrt(c*c-4*t*d))/(2*t),T=(-c-Math.sqrt(c*c-4*t*d))/(2*t),N=null;if(F>=0&&F<=1)return[F];if(T>=0&&T<=1)return[T];return N}else return null},l.HALF_PI=0.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l},function(C,G,x){function v(){}v.sign=function(l){if(l>0)return 1;else if(l<0)return-1;else return 0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=v},function(C,G,x){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v},function(C,G,x){var v=function(){function r(y,i){for(var t=0;t<i.length;t++){var c=i[t];if(c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c)c.writable=!0;Object.defineProperty(y,c.key,c)}}return function(y,i,t){if(i)r(y.prototype,i);if(t)r(y,t);return y}}();function l(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var s=function(y){return{value:y,next:null,prev:null}},a=function(y,i,t,c){if(y!==null)y.next=i;else c.head=i;if(t!==null)t.prev=i;else c.tail=i;return i.prev=y,i.next=t,c.length++,i},o=function(y,i){var{prev:t,next:c}=y;if(t!==null)t.next=c;else i.head=c;if(c!==null)c.prev=t;else i.tail=t;return y.prev=y.next=null,i.length--,y},g=function(){function r(y){var i=this;if(l(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(t){return i.push(t)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,t){return a(t.prev,s(i),t,this)}},{key:"insertAfter",value:function(i,t){return a(t,s(i),t.next,this)}},{key:"insertNodeBefore",value:function(i,t){return a(t.prev,i,t,this)}},{key:"insertNodeAfter",value:function(i,t){return a(t,i,t.next,this)}},{key:"push",value:function(i){return a(this.tail,s(i),null,this)}},{key:"unshift",value:function(i){return a(null,s(i),this.head,this)}},{key:"remove",value:function(i){return o(i,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){var t=1,c=this.head;while(t<i)c=c.next,t++;return c.value}}},{key:"set_object_at",value:function(i,t){if(i<=this.length()){var c=1,d=this.head;while(c<i)d=d.next,c++;d.value=t}}}]),r}();C.exports=g},function(C,G,x){function v(l,s,a){if(this.x=null,this.y=null,l==null&&s==null&&a==null)this.x=0,this.y=0;else if(typeof l=="number"&&typeof s=="number"&&a==null)this.x=l,this.y=s;else if(l.constructor.name=="Point"&&s==null&&a==null)a=l,this.x=a.x,this.y=a.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(l,s,a){if(l.constructor.name=="Point"&&s==null&&a==null)a=l,this.setLocation(a.x,a.y);else if(typeof l=="number"&&typeof s=="number"&&a==null)if(parseInt(l)==l&&parseInt(s)==s)this.move(l,s);else this.x=Math.floor(l+0.5),this.y=Math.floor(s+0.5)},v.prototype.move=function(l,s){this.x=l,this.y=s},v.prototype.translate=function(l,s){this.x+=l,this.y+=s},v.prototype.equals=function(l){if(l.constructor.name=="Point"){var s=l;return this.x==s.x&&this.y==s.y}return this==l},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},C.exports=v},function(C,G,x){function v(l,s,a,o){if(this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&s!=null&&a!=null&&o!=null)this.x=l,this.y=s,this.width=a,this.height=o}v.prototype.getX=function(){return this.x},v.prototype.setX=function(l){this.x=l},v.prototype.getY=function(){return this.y},v.prototype.setY=function(l){this.y=l},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(l){if(this.getRight()<l.x)return!1;if(this.getBottom()<l.y)return!1;if(l.getRight()<this.x)return!1;if(l.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},C.exports=v},function(C,G,x){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol==="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function l(){}l.lastID=0,l.createID=function(s){if(l.isPrimitive(s))return s;if(s.uniqueID!=null)return s.uniqueID;return s.uniqueID=l.getString(),l.lastID++,s.uniqueID},l.getString=function(s){if(s==null)s=l.lastID;return"Object#"+s},l.isPrimitive=function(s){var a=typeof s>"u"?"undefined":v(s);return s==null||a!="object"&&a!="function"},C.exports=l},function(C,G,x){function v(c){if(Array.isArray(c)){for(var d=0,f=Array(c.length);d<c.length;d++)f[d]=c[d];return f}else return Array.from(c)}var l=x(0),s=x(7),a=x(3),o=x(1),g=x(6),r=x(5),y=x(17),i=x(29);function t(c){if(i.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new s(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null)this.isRemoteUse=c}t.RANDOM_SEED=1,t.prototype=Object.create(i.prototype),t.prototype.getGraphManager=function(){return this.graphManager},t.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},t.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},t.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},t.prototype.newGraphManager=function(){var c=new s(this);return this.graphManager=c,c},t.prototype.newGraph=function(c){return new g(null,this.graphManager,c)},t.prototype.newNode=function(c){return new a(this.graphManager,c)},t.prototype.newEdge=function(c){return new o(null,null,c)},t.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},t.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var c;if(this.checkLayoutSuccess())c=!1;else c=this.layout();if(l.ANIMATE==="during")return!1;if(c){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,c},t.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},t.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var c,d=this.graphManager.getAllEdges();for(var f=0;f<d.length;f++)c=d[f];var F,T=this.graphManager.getRoot().getNodes();for(var f=0;f<T.length;f++)F=T[f];this.update(this.graphManager.getRoot())}},t.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof a){var d=c;if(d.getChild()!=null){var f=d.getChild().getNodes();for(var F=0;F<f.length;F++)update(f[F])}if(d.vGraphObject!=null){var T=d.vGraphObject;T.update(d)}}else if(c instanceof o){var N=c;if(N.vGraphObject!=null){var S=N.vGraphObject;S.update(N)}}else if(c instanceof g){var z=c;if(z.vGraphObject!=null){var b=z.vGraphObject;b.update(z)}}},t.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},t.prototype.transform=function(c){if(c==null)this.transform(new r(0,0));else{var d=new y,f=this.graphManager.getRoot().updateLeftTop();if(f!=null){d.setWorldOrgX(c.x),d.setWorldOrgY(c.y),d.setDeviceOrgX(f.x),d.setDeviceOrgY(f.y);var F=this.getAllNodes(),T;for(var N=0;N<F.length;N++)T=F[N],T.transform(d)}}},t.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,f,F=c.getNodes();for(var T=0;T<F.length;T++)if(d=F[T],f=d.getChild(),f==null)d.scatter();else if(f.getNodes().length==0)d.scatter();else this.positionNodesRandomly(f),d.updateBounds()}},t.prototype.getFlatForest=function(){var c=[],d=!0,f=this.graphManager.getRoot().getNodes(),F=!0;for(var T=0;T<f.length;T++)if(f[T].getChild()!=null)F=!1;if(!F)return c;var N=new Set,S=[],z=new Map,b=[];b=b.concat(f);while(b.length>0&&d){S.push(b[0]);while(S.length>0&&d){var Q=S[0];S.splice(0,1),N.add(Q);var it=Q.getEdges();for(var T=0;T<it.length;T++){var _=it[T].getOtherEnd(Q);if(z.get(Q)!=_)if(!N.has(_))S.push(_),z.set(_,Q);else{d=!1;break}}}if(!d)c=[];else{var ut=[].concat(v(N));c.push(ut);for(var T=0;T<ut.length;T++){var W=ut[T],nt=b.indexOf(W);if(nt>-1)b.splice(nt,1)}N=new Set,z=new Map}}return c},t.prototype.createDummyNodesForBendpoints=function(c){var d=[],f=c.source,F=this.graphManager.calcLowestCommonAncestor(c.source,c.target);for(var T=0;T<c.bendpoints.length;T++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),F.add(N);var S=this.newEdge(null);this.graphManager.add(S,f,N),d.add(N),f=N}var S=this.newEdge(null);if(this.graphManager.add(S,f,c.target),this.edgeToDummyNodes.set(c,d),c.isInterGraph())this.graphManager.remove(c);else F.remove(c);return d},t.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(v(this.edgeToDummyNodes.keys())).concat(c);for(var d=0;d<c.length;d++){var f=c[d];if(f.bendpoints.length>0){var F=this.edgeToDummyNodes.get(f);for(var T=0;T<F.length;T++){var N=F[T],S=new r(N.getCenterX(),N.getCenterY()),z=f.bendpoints.get(T);z.x=S.x,z.y=S.y,N.getOwner().remove(N)}this.graphManager.add(f,f.source,f.target)}}},t.transform=function(c,d,f,F){if(f!=null&&F!=null){var T=d;if(c<=50){var N=d/f;T-=(d-N)/50*(50-c)}else{var S=d*F;T+=(S-d)/50*(c-50)}return T}else{var z,b;if(c<=50)z=9*d/500,b=d/10;else z=9*d/50,b=-8*d;return z*c+b}},t.findCenterOfTree=function(c){var d=[];d=d.concat(c);var f=[],F=new Map,T=!1,N=null;if(d.length==1||d.length==2)T=!0,N=d[0];for(var S=0;S<d.length;S++){var z=d[S],b=z.getNeighborsList().size;if(F.set(z,z.getNeighborsList().size),b==1)f.push(z)}var Q=[];Q=Q.concat(f);while(!T){var it=[];it=it.concat(Q),Q=[];for(var S=0;S<d.length;S++){var z=d[S],_=d.indexOf(z);if(_>=0)d.splice(_,1);var ut=z.getNeighborsList();ut.forEach(function(h){if(f.indexOf(h)<0){var w=F.get(h),E=w-1;if(E==1)Q.push(h);F.set(h,E)}})}if(f=f.concat(Q),d.length==1||d.length==2)T=!0,N=d[0]}return N},t.prototype.setGraphManager=function(c){this.graphManager=c},C.exports=t},function(C,G,x){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v},function(C,G,x){var v=x(5);function l(s,a){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.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(s){this.lworldExtX=s},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(s){this.lworldExtY=s},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},l.prototype.transformX=function(s){var a=0,o=this.lworldExtX;if(o!=0)a=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/o;return a},l.prototype.transformY=function(s){var a=0,o=this.lworldExtY;if(o!=0)a=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/o;return a},l.prototype.inverseTransformX=function(s){var a=0,o=this.ldeviceExtX;if(o!=0)a=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/o;return a},l.prototype.inverseTransformY=function(s){var a=0,o=this.ldeviceExtY;if(o!=0)a=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/o;return a},l.prototype.inverseTransformPoint=function(s){var a=new v(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return a},C.exports=l},function(C,G,x){function v(i){if(Array.isArray(i)){for(var t=0,c=Array(i.length);t<i.length;t++)c[t]=i[t];return c}else return Array.from(i)}var l=x(15),s=x(4),a=x(0),o=x(8),g=x(9);function r(){l.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}r.prototype=Object.create(l.prototype);for(var y in l)r[y]=l[y];r.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,t,c,d,f,F,T,N=this.getGraphManager().getAllEdges();for(var S=0;S<N.length;S++)if(i=N[S],t=i.idealLength,i.isInterGraph){if(d=i.getSource(),f=i.getTarget(),F=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=F+T-2*a.SIMPLE_NODE_SIZE;c=i.getLca().getInclusionTreeDepth(),i.idealLength+=t*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*c)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>s.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>s.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(i-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),t;for(var c=0;c<i.length;c++)t=i[c],this.calcSpringForce(t,t.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c,d,f,F,T=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();N=new Set;for(c=0;c<T.length;c++)f=T[c],this.calculateRepulsionForceOfANode(f,N,i,t),N.add(f)}else for(c=0;c<T.length;c++){f=T[c];for(d=c+1;d<T.length;d++){if(F=T[d],f.getOwner()!=F.getOwner())continue;this.calcRepulsionForce(f,F)}}},r.prototype.calcGravitationalForces=function(){var i,t=this.getAllNodesToApplyGravitation();for(var c=0;c<t.length;c++)i=t[c],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),t;for(var c=0;c<i.length;c++)t=i[c],t.move()},r.prototype.calcSpringForce=function(i,t){var c=i.getSource(),d=i.getTarget(),f,F,T,N;if(this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(f=i.getLength(),f==0)return;F=i.edgeElasticity*(f-t),T=F*(i.lengthX/f),N=F*(i.lengthY/f),c.springForceX+=T,c.springForceY+=N,d.springForceX-=T,d.springForceY-=N},r.prototype.calcRepulsionForce=function(i,t){var c=i.getRect(),d=t.getRect(),f=[,,],F=[,,,,],T,N,S,z,b,Q,it;if(c.intersects(d)){o.calcSeparationAmount(c,d,f,s.DEFAULT_EDGE_LENGTH/2),Q=2*f[0],it=2*f[1];var _=i.noOfChildren*t.noOfChildren/(i.noOfChildren+t.noOfChildren);i.repulsionForceX-=_*Q,i.repulsionForceY-=_*it,t.repulsionForceX+=_*Q,t.repulsionForceY+=_*it}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&t.getChild()==null)T=d.getCenterX()-c.getCenterX(),N=d.getCenterY()-c.getCenterY();else o.getIntersection(c,d,F),T=F[2]-F[0],N=F[3]-F[1];if(Math.abs(T)<s.MIN_REPULSION_DIST)T=g.sign(T)*s.MIN_REPULSION_DIST;if(Math.abs(N)<s.MIN_REPULSION_DIST)N=g.sign(N)*s.MIN_REPULSION_DIST;S=T*T+N*N,z=Math.sqrt(S),b=(i.nodeRepulsion/2+t.nodeRepulsion/2)*i.noOfChildren*t.noOfChildren/S,Q=b*T/z,it=b*N/z,i.repulsionForceX-=Q,i.repulsionForceY-=it,t.repulsionForceX+=Q,t.repulsionForceY+=it}},r.prototype.calcGravitationalForce=function(i){var t,c,d,f,F,T,N,S;if(t=i.getOwner(),c=(t.getRight()+t.getLeft())/2,d=(t.getTop()+t.getBottom())/2,f=i.getCenterX()-c,F=i.getCenterY()-d,T=Math.abs(f)+i.getWidth()/2,N=Math.abs(F)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(S=t.getEstimatedSize()*this.gravityRangeFactor,T>S||N>S)i.gravitationForceX=-this.gravityConstant*f,i.gravitationForceY=-this.gravityConstant*F}else if(S=t.getEstimatedSize()*this.compoundGravityRangeFactor,T>S||N>S)i.gravitationForceX=-this.gravityConstant*f*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*F*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,t=!1;if(this.totalIterations>this.maxIterations/3)t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||t},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,t=this.graphManager.getAllNodes();for(var c=0;c<t.length;c++)i=t[c],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var t=0,c=0;t=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(t);for(var f=0;f<t;f++)d[f]=Array(c);for(var f=0;f<t;f++)for(var F=0;F<c;F++)d[f][F]=[];return d},r.prototype.addNodeToGrid=function(i,t,c){var d=0,f=0,F=0,T=0;d=parseInt(Math.floor((i.getRect().x-t)/this.repulsionRange)),f=parseInt(Math.floor((i.getRect().width+i.getRect().x-t)/this.repulsionRange)),F=parseInt(Math.floor((i.getRect().y-c)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().height+i.getRect().y-c)/this.repulsionRange));for(var N=d;N<=f;N++)for(var S=F;S<=T;S++)this.grid[N][S].push(i),i.setGridCoordinates(d,f,F,T)},r.prototype.updateGrid=function(){var i,t,c=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<c.length;i++)t=c[i],this.addNodeToGrid(t,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,t,c,d){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var f=new Set;i.surrounding=[];var F,T=this.grid;for(var N=i.startX-1;N<i.finishX+2;N++)for(var S=i.startY-1;S<i.finishY+2;S++)if(!(N<0||S<0||N>=T.length||S>=T[0].length))for(var z=0;z<T[N][S].length;z++){if(F=T[N][S][z],i.getOwner()!=F.getOwner()||i==F)continue;if(!t.has(F)&&!f.has(F)){var b=Math.abs(i.getCenterX()-F.getCenterX())-(i.getWidth()/2+F.getWidth()/2),Q=Math.abs(i.getCenterY()-F.getCenterY())-(i.getHeight()/2+F.getHeight()/2);if(b<=this.repulsionRange&&Q<=this.repulsionRange)f.add(F)}}i.surrounding=[].concat(v(f))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},r.prototype.calcRepulsionRange=function(){return 0},C.exports=r},function(C,G,x){var v=x(1),l=x(4);function s(o,g,r){v.call(this,o,g,r),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}s.prototype=Object.create(v.prototype);for(var a in v)s[a]=v[a];C.exports=s},function(C,G,x){var v=x(3),l=x(4);function s(o,g,r,y){v.call(this,o,g,r,y),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}s.prototype=Object.create(v.prototype);for(var a in v)s[a]=v[a];s.prototype.setGridCoordinates=function(o,g,r,y){this.startX=o,this.finishX=g,this.startY=r,this.finishY=y},C.exports=s},function(C,G,x){function v(l,s){if(this.width=0,this.height=0,l!==null&&s!==null)this.height=s,this.width=l}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},C.exports=v},function(C,G,x){var v=x(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(s,a){var o=v.createID(s);if(!this.contains(o))this.map[o]=a,this.keys.push(s)},l.prototype.contains=function(s){var a=v.createID(s);return this.map[s]!=null},l.prototype.get=function(s){var a=v.createID(s);return this.map[a]},l.prototype.keySet=function(){return this.keys},C.exports=l},function(C,G,x){var v=x(14);function l(){this.set={}}l.prototype.add=function(s){var a=v.createID(s);if(!this.contains(a))this.set[a]=s},l.prototype.remove=function(s){delete this.set[v.createID(s)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(s){return this.set[v.createID(s)]==s},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(s){var a=Object.keys(this.set),o=a.length;for(var g=0;g<o;g++)s.push(this.set[a[g]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(s){var a=s.length;for(var o=0;o<a;o++){var g=s[o];this.add(g)}},C.exports=l},function(C,G,x){function v(){}v.multMat=function(l,s){var a=[];for(var o=0;o<l.length;o++){a[o]=[];for(var g=0;g<s[0].length;g++){a[o][g]=0;for(var r=0;r<l[0].length;r++)a[o][g]+=l[o][r]*s[r][g]}}return a},v.transpose=function(l){var s=[];for(var a=0;a<l[0].length;a++){s[a]=[];for(var o=0;o<l.length;o++)s[a][o]=l[o][a]}return s},v.multCons=function(l,s){var a=[];for(var o=0;o<l.length;o++)a[o]=l[o]*s;return a},v.minusOp=function(l,s){var a=[];for(var o=0;o<l.length;o++)a[o]=l[o]-s[o];return a},v.dotProduct=function(l,s){var a=0;for(var o=0;o<l.length;o++)a+=l[o]*s[o];return a},v.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},v.normalize=function(l){var s=[],a=this.mag(l);for(var o=0;o<l.length;o++)s[o]=l[o]/a;return s},v.multGamma=function(l){var s=[],a=0;for(var o=0;o<l.length;o++)a+=l[o];a*=-1/l.length;for(var g=0;g<l.length;g++)s[g]=a+l[g];return s},v.multL=function(l,s,a){var o=[],g=[],r=[];for(var y=0;y<s[0].length;y++){var i=0;for(var t=0;t<s.length;t++)i+=-0.5*s[t][y]*l[t];g[y]=i}for(var c=0;c<a.length;c++){var d=0;for(var f=0;f<a.length;f++)d+=a[c][f]*g[f];r[c]=d}for(var F=0;F<s.length;F++){var T=0;for(var N=0;N<s[0].length;N++)T+=s[F][N]*r[N];o[F]=T}return o},C.exports=v},function(C,G,x){var v=function(){function o(g,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(g,i.key,i)}}return function(g,r,y){if(r)o(g.prototype,r);if(y)o(g,y);return g}}();function l(o,g){if(!(o instanceof g))throw TypeError("Cannot call a class as a function")}var s=x(11),a=function(){function o(g,r){if(l(this,o),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(g instanceof s)y=g.size();else y=g.length;this._quicksort(g,0,y-1)}return v(o,[{key:"_quicksort",value:function(r,y,i){if(y<i){var t=this._partition(r,y,i);this._quicksort(r,y,t),this._quicksort(r,t+1,i)}}},{key:"_partition",value:function(r,y,i){var t=this._get(r,y),c=y,d=i;while(!0){while(this.compareFunction(t,this._get(r,d)))d--;while(this.compareFunction(this._get(r,c),t))c++;if(c<d)this._swap(r,c,d),c++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof s)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof s)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var t=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,t)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),o}();C.exports=a},function(C,G,x){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var s=Math.min(this.m,this.n);this.s=function(Zt){var Xt=[];while(Zt-- >0)Xt.push(0);return Xt}(Math.min(this.m+1,this.n)),this.U=function(Zt){var Xt=function ge(Jt){if(Jt.length==0)return 0;else{var ae=[];for(var fe=0;fe<Jt[0];fe++)ae.push(ge(Jt.slice(1)));return ae}};return Xt(Zt)}([this.m,s]),this.V=function(Zt){var Xt=function ge(Jt){if(Jt.length==0)return 0;else{var ae=[];for(var fe=0;fe<Jt[0];fe++)ae.push(ge(Jt.slice(1)));return ae}};return Xt(Zt)}([this.n,this.n]);var a=function(Zt){var Xt=[];while(Zt-- >0)Xt.push(0);return Xt}(this.n),o=function(Zt){var Xt=[];while(Zt-- >0)Xt.push(0);return Xt}(this.m),g=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var t=0;t<Math.max(y,i);t++){if(t<y){this.s[t]=0;for(var c=t;c<this.m;c++)this.s[t]=v.hypot(this.s[t],l[c][t]);if(this.s[t]!==0){if(l[t][t]<0)this.s[t]=-this.s[t];for(var d=t;d<this.m;d++)l[d][t]/=this.s[t];l[t][t]+=1}this.s[t]=-this.s[t]}for(var f=t+1;f<this.n;f++){if(function(Zt,Xt){return Zt&&Xt}(t<y,this.s[t]!==0)){var F=0;for(var T=t;T<this.m;T++)F+=l[T][t]*l[T][f];F=-F/l[t][t];for(var N=t;N<this.m;N++)l[N][f]+=F*l[N][t]}a[f]=l[t][f]}if(function(Zt,Xt){return Zt&&Xt}(g,t<y))for(var S=t;S<this.m;S++)this.U[S][t]=l[S][t];if(t<i){a[t]=0;for(var z=t+1;z<this.n;z++)a[t]=v.hypot(a[t],a[z]);if(a[t]!==0){if(a[t+1]<0)a[t]=-a[t];for(var b=t+1;b<this.n;b++)a[b]/=a[t];a[t+1]+=1}if(a[t]=-a[t],function(Zt,Xt){return Zt&&Xt}(t+1<this.m,a[t]!==0)){for(var Q=t+1;Q<this.m;Q++)o[Q]=0;for(var it=t+1;it<this.n;it++)for(var _=t+1;_<this.m;_++)o[_]+=a[it]*l[_][it];for(var ut=t+1;ut<this.n;ut++){var W=-a[ut]/a[t+1];for(var nt=t+1;nt<this.m;nt++)l[nt][ut]+=W*o[nt]}}if(r)for(var h=t+1;h<this.n;h++)this.V[h][t]=a[h]}}var w=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=l[y][y];if(this.m<w)this.s[w-1]=0;if(i+1<w)a[i]=l[i][w-1];if(a[w-1]=0,g){for(var E=y;E<s;E++){for(var D=0;D<this.m;D++)this.U[D][E]=0;this.U[E][E]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var V=m+1;V<s;V++){var H=0;for(var j=m;j<this.m;j++)H+=this.U[j][m]*this.U[j][V];H=-H/this.U[m][m];for(var J=m;J<this.m;J++)this.U[J][V]+=H*this.U[J][m]}for(var Z=m;Z<this.m;Z++)this.U[Z][m]=-this.U[Z][m];this.U[m][m]=1+this.U[m][m];for(var ct=0;ct<m-1;ct++)this.U[ct][m]=0}else{for(var mt=0;mt<this.m;mt++)this.U[mt][m]=0;this.U[m][m]=1}}if(r)for(var K=this.n-1;K>=0;K--){if(function(Zt,Xt){return Zt&&Xt}(K<i,a[K]!==0))for(var yt=K+1;yt<s;yt++){var ht=0;for(var U=K+1;U<this.n;U++)ht+=this.V[U][K]*this.V[U][yt];ht=-ht/this.V[K+1][K];for(var rt=K+1;rt<this.n;rt++)this.V[rt][yt]+=ht*this.V[rt][K]}for(var at=0;at<this.n;at++)this.V[at][K]=0;this.V[K][K]=1}var vt=w-1,Ct=0,Ht=Math.pow(2,-52),Kt=Math.pow(2,-966);while(w>0){var dt=void 0,ie=void 0;for(dt=w-2;dt>=-1;dt--){if(dt===-1)break;if(Math.abs(a[dt])<=Kt+Ht*(Math.abs(this.s[dt])+Math.abs(this.s[dt+1]))){a[dt]=0;break}}if(dt===w-2)ie=4;else{var $t=void 0;for($t=w-1;$t>=dt;$t--){if($t===dt)break;var wt=($t!==w?Math.abs(a[$t]):0)+($t!==dt+1?Math.abs(a[$t-1]):0);if(Math.abs(this.s[$t])<=Kt+Ht*wt){this.s[$t]=0;break}}if($t===dt)ie=3;else if($t===w-1)ie=1;else ie=2,dt=$t}switch(dt++,ie){case 1:{var Et=a[w-2];a[w-2]=0;for(var bt=w-2;bt>=dt;bt--){var Gt=v.hypot(this.s[bt],Et),Wt=this.s[bt]/Gt,Ut=Et/Gt;if(this.s[bt]=Gt,bt!==dt)Et=-Ut*a[bt-1],a[bt-1]=Wt*a[bt-1];if(r)for(var Yt=0;Yt<this.n;Yt++)Gt=Wt*this.V[Yt][bt]+Ut*this.V[Yt][w-1],this.V[Yt][w-1]=-Ut*this.V[Yt][bt]+Wt*this.V[Yt][w-1],this.V[Yt][bt]=Gt}}break;case 2:{var Bt=a[dt-1];a[dt-1]=0;for(var Qt=dt;Qt<w;Qt++){var he=v.hypot(this.s[Qt],Bt),te=this.s[Qt]/he,ne=Bt/he;if(this.s[Qt]=he,Bt=-ne*a[Qt],a[Qt]=te*a[Qt],g)for(var _t=0;_t<this.m;_t++)he=te*this.U[_t][Qt]+ne*this.U[_t][dt-1],this.U[_t][dt-1]=-ne*this.U[_t][Qt]+te*this.U[_t][dt-1],this.U[_t][Qt]=he}}break;case 3:{var et=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[w-1]),Math.abs(this.s[w-2])),Math.abs(a[w-2])),Math.abs(this.s[dt])),Math.abs(a[dt])),ot=this.s[w-1]/et,st=this.s[w-2]/et,lt=a[w-2]/et,ft=this.s[dt]/et,pt=a[dt]/et,Rt=((st+ot)*(st-ot)+lt*lt)/2,Ot=ot*lt*(ot*lt),gt=0;if(function(Zt,Xt){return Zt||Xt}(Rt!==0,Ot!==0)){if(gt=Math.sqrt(Rt*Rt+Ot),Rt<0)gt=-gt;gt=Ot/(Rt+gt)}var At=(ft+ot)*(ft-ot)+gt,It=ft*pt;for(var Tt=dt;Tt<w-1;Tt++){var Ft=v.hypot(At,It),Vt=At/Ft,Mt=It/Ft;if(Tt!==dt)a[Tt-1]=Ft;if(At=Vt*this.s[Tt]+Mt*a[Tt],a[Tt]=Vt*a[Tt]-Mt*this.s[Tt],It=Mt*this.s[Tt+1],this.s[Tt+1]=Vt*this.s[Tt+1],r)for(var Nt=0;Nt<this.n;Nt++)Ft=Vt*this.V[Nt][Tt]+Mt*this.V[Nt][Tt+1],this.V[Nt][Tt+1]=-Mt*this.V[Nt][Tt]+Vt*this.V[Nt][Tt+1],this.V[Nt][Tt]=Ft;if(Ft=v.hypot(At,It),Vt=At/Ft,Mt=It/Ft,this.s[Tt]=Ft,At=Vt*a[Tt]+Mt*this.s[Tt+1],this.s[Tt+1]=-Mt*a[Tt]+Vt*this.s[Tt+1],It=Mt*a[Tt+1],a[Tt+1]=Vt*a[Tt+1],g&&Tt<this.m-1)for(var St=0;St<this.m;St++)Ft=Vt*this.U[St][Tt]+Mt*this.U[St][Tt+1],this.U[St][Tt+1]=-Mt*this.U[St][Tt]+Vt*this.U[St][Tt+1],this.U[St][Tt]=Ft}a[w-2]=At,Ct=Ct+1}break;case 4:{if(this.s[dt]<=0){if(this.s[dt]=this.s[dt]<0?-this.s[dt]:0,r)for(var Lt=0;Lt<=vt;Lt++)this.V[Lt][dt]=-this.V[Lt][dt]}while(dt<vt){if(this.s[dt]>=this.s[dt+1])break;var Dt=this.s[dt];if(this.s[dt]=this.s[dt+1],this.s[dt+1]=Dt,r&&dt<this.n-1)for(var jt=0;jt<this.n;jt++)Dt=this.V[jt][dt+1],this.V[jt][dt+1]=this.V[jt][dt],this.V[jt][dt]=Dt;if(g&&dt<this.m-1)for(var qt=0;qt<this.m;qt++)Dt=this.U[qt][dt+1],this.U[qt][dt+1]=this.U[qt][dt],this.U[qt][dt]=Dt;dt++}Ct=0,w--}break}}var le={U:this.U,V:this.V,S:this.s};return le},v.hypot=function(l,s){var a=void 0;if(Math.abs(l)>Math.abs(s))a=s/l,a=Math.abs(l)*Math.sqrt(1+a*a);else if(s!=0)a=l/s,a=Math.abs(s)*Math.sqrt(1+a*a);else a=0;return a},C.exports=v},function(C,G,x){var v=function(){function a(o,g){for(var r=0;r<g.length;r++){var y=g[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(o,y.key,y)}}return function(o,g,r){if(g)a(o.prototype,g);if(r)a(o,r);return o}}();function l(a,o){if(!(a instanceof o))throw TypeError("Cannot call a class as a function")}var s=function(){function a(o,g){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,a),this.sequence1=o,this.sequence2=g,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=o.length+1,this.jMax=g.length+1,this.grid=Array(this.iMax);for(var t=0;t<this.iMax;t++){this.grid[t]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[t][c]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var f=0;f<this.jMax;f++)this.tracebackGrid[d][f]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(a,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var g=1;g<this.jMax;g++)this.grid[0][g]=this.grid[0][g-1]+this.gap_penalty,this.tracebackGrid[0][g]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var t=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])t=this.grid[y-1][i-1]+this.match_score;else t=this.grid[y-1][i-1]+this.mismatch_penalty;var c=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,f=[t,c,d],F=this.arrayAllMaxIndexes(f);this.grid[y][i]=f[F[0]],this.tracebackGrid[y][i]=[F.includes(0),F.includes(1),F.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var g=[];g.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(g[0]){var r=g[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])g.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])g.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])g.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});g.shift()}return this.alignments}},{key:"getAllIndexes",value:function(g,r){var y=[],i=-1;while((i=g.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(g){return this.getAllIndexes(g,Math.max.apply(null,g))}}]),a}();C.exports=s},function(C,G,x){var v=function(){return};v.FDLayout=x(18),v.FDLayoutConstants=x(4),v.FDLayoutEdge=x(19),v.FDLayoutNode=x(20),v.DimensionD=x(21),v.HashMap=x(22),v.HashSet=x(23),v.IGeometry=x(8),v.IMath=x(9),v.Integer=x(10),v.Point=x(12),v.PointD=x(5),v.RandomSeed=x(16),v.RectangleD=x(13),v.Transform=x(17),v.UniqueIDGeneretor=x(14),v.Quicksort=x(25),v.LinkedList=x(11),v.LGraphObject=x(2),v.LGraph=x(6),v.LEdge=x(1),v.LGraphManager=x(7),v.LNode=x(3),v.Layout=x(15),v.LayoutConstants=x(0),v.NeedlemanWunsch=x(27),v.Matrix=x(24),v.SVD=x(26),C.exports=v},function(C,G,x){function v(){this.listeners=[]}var l=v.prototype;l.addListener=function(s,a){this.listeners.push({event:s,callback:a})},l.removeListener=function(s,a){for(var o=this.listeners.length;o>=0;o--){var g=this.listeners[o];if(g.event===s&&g.callback===a)this.listeners.splice(o,1)}},l.emit=function(s,a){for(var o=0;o<this.listeners.length;o++){var g=this.listeners[o];if(s===g.event)g.callback(a)}},C.exports=v}])})});var Xe=We(function(Me,Ye){(function(G,x){if(typeof Me==="object"&&typeof Ye==="object")Ye.exports=x(Ue());else if(typeof define==="function"&&define.amd)define(["layout-base"],x);else if(typeof Me==="object")Me.coseBase=x(Ue());else G.coseBase=x(G.layoutBase)})(Me,function(C){return(()=>{var G={45:(s,a,o)=>{var g={};g.layoutBase=o(551),g.CoSEConstants=o(806),g.CoSEEdge=o(767),g.CoSEGraph=o(880),g.CoSEGraphManager=o(578),g.CoSELayout=o(765),g.CoSENode=o(991),g.ConstraintHandler=o(902),s.exports=g},806:(s,a,o)=>{var g=o(551).FDLayoutConstants;function r(){}for(var y in g)r[y]=g[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=g.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,s.exports=r},767:(s,a,o)=>{var g=o(551).FDLayoutEdge;function r(i,t,c){g.call(this,i,t,c)}r.prototype=Object.create(g.prototype);for(var y in g)r[y]=g[y];s.exports=r},880:(s,a,o)=>{var g=o(551).LGraph;function r(i,t,c){g.call(this,i,t,c)}r.prototype=Object.create(g.prototype);for(var y in g)r[y]=g[y];s.exports=r},578:(s,a,o)=>{var g=o(551).LGraphManager;function r(i){g.call(this,i)}r.prototype=Object.create(g.prototype);for(var y in g)r[y]=g[y];s.exports=r},765:(s,a,o)=>{var g=o(551).FDLayout,r=o(578),y=o(880),i=o(991),t=o(767),c=o(806),d=o(902),f=o(551).FDLayoutConstants,F=o(551).LayoutConstants,T=o(551).Point,N=o(551).PointD,S=o(551).DimensionD,z=o(551).Layout,b=o(551).Integer,Q=o(551).IGeometry,it=o(551).LGraph,_=o(551).Transform,ut=o(551).LinkedList;function W(){g.call(this),this.toBeTiled={},this.constraints={}}W.prototype=Object.create(g.prototype);for(var nt in g)W[nt]=g[nt];W.prototype.newGraphManager=function(){var h=new r(this);return this.graphManager=h,h},W.prototype.newGraph=function(h){return new y(null,this.graphManager,h)},W.prototype.newNode=function(h){return new i(this.graphManager,h)},W.prototype.newEdge=function(h){return new t(null,null,h)},W.prototype.initParameters=function(){if(g.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(c.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},W.prototype.initSpringEmbedder=function(){g.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},W.prototype.layout=function(){var h=F.DEFAULT_CREATE_BENDS_AS_NEEDED;if(h)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},W.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){var h=this.getFlatForest();if(h.length>0)this.positionNodesRadially(h);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(D){return w.has(D)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(V){return w.has(V)});this.graphManager.setAllNodesToApplyGravitation(E)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),c.APPLY_LAYOUT)this.runSpringEmbedder();return!0},W.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%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(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 h=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(m){return h.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(w),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL)this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(c.PURE_INCREMENTAL)this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var E=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},W.prototype.getPositionsData=function(){var h=this.graphManager.getAllNodes(),w={};for(var E=0;E<h.length;E++){var D=h[E].rect,m=h[E].id;w[m]={id:m,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return w},W.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var h=!1;if(f.ANIMATE==="during")this.emit("layoutstarted");else{while(!h)h=this.tick();this.graphManager.updateBounds()}},W.prototype.moveNodes=function(){var h=this.getAllNodes(),w;for(var E=0;E<h.length;E++)w=h[E],w.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var E=0;E<h.length;E++)w=h[E],w.move()},W.prototype.initConstraintVariables=function(){var h=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var w=this.graphManager.getAllNodes();for(var E=0;E<w.length;E++){var D=w[E];this.idToNodeMap.set(D.id,D)}var m=function U(rt){var at=rt.getChild().getNodes(),vt,Ct=0;for(var Ht=0;Ht<at.length;Ht++)if(vt=at[Ht],vt.getChild()==null){if(h.fixedNodeSet.has(vt.id))Ct+=100}else Ct+=U(vt);return Ct};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(at){h.fixedNodeSet.add(at.nodeId)});var w=this.graphManager.getAllNodes(),D;for(var E=0;E<w.length;E++)if(D=w[E],D.getChild()!=null){var V=m(D);if(V>0)D.fixedNodeWeight=V}}if(this.constraints.relativePlacementConstraint){var H=new Map,j=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(U){h.fixedNodesOnHorizontal.add(U),h.fixedNodesOnVertical.add(U)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var J=this.constraints.alignmentConstraint.vertical;for(var E=0;E<J.length;E++)this.dummyToNodeForVerticalAlignment.set("dummy"+E,[]),J[E].forEach(function(rt){if(H.set(rt,"dummy"+E),h.dummyToNodeForVerticalAlignment.get("dummy"+E).push(rt),h.fixedNodeSet.has(rt))h.fixedNodesOnHorizontal.add("dummy"+E)})}if(this.constraints.alignmentConstraint.horizontal){var Z=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<Z.length;E++)this.dummyToNodeForHorizontalAlignment.set("dummy"+E,[]),Z[E].forEach(function(rt){if(j.set(rt,"dummy"+E),h.dummyToNodeForHorizontalAlignment.get("dummy"+E).push(rt),h.fixedNodeSet.has(rt))h.fixedNodesOnVertical.add("dummy"+E)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(U){var rt,at,vt;for(vt=U.length-1;vt>=2*U.length/3;vt--)rt=Math.floor(Math.random()*(vt+1)),at=U[vt],U[vt]=U[rt],U[rt]=at;return U},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(U){if(U.left){var rt=H.has(U.left)?H.get(U.left):U.left,at=H.has(U.right)?H.get(U.right):U.right;if(!h.nodesInRelativeHorizontal.includes(rt))if(h.nodesInRelativeHorizontal.push(rt),h.nodeToRelativeConstraintMapHorizontal.set(rt,[]),h.dummyToNodeForVerticalAlignment.has(rt))h.nodeToTempPositionMapHorizontal.set(rt,h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(rt)[0]).getCenterX());else h.nodeToTempPositionMapHorizontal.set(rt,h.idToNodeMap.get(rt).getCenterX());if(!h.nodesInRelativeHorizontal.includes(at))if(h.nodesInRelativeHorizontal.push(at),h.nodeToRelativeConstraintMapHorizontal.set(at,[]),h.dummyToNodeForVerticalAlignment.has(at))h.nodeToTempPositionMapHorizontal.set(at,h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(at)[0]).getCenterX());else h.nodeToTempPositionMapHorizontal.set(at,h.idToNodeMap.get(at).getCenterX());h.nodeToRelativeConstraintMapHorizontal.get(rt).push({right:at,gap:U.gap}),h.nodeToRelativeConstraintMapHorizontal.get(at).push({left:rt,gap:U.gap})}else{var vt=j.has(U.top)?j.get(U.top):U.top,Ct=j.has(U.bottom)?j.get(U.bottom):U.bottom;if(!h.nodesInRelativeVertical.includes(vt))if(h.nodesInRelativeVertical.push(vt),h.nodeToRelativeConstraintMapVertical.set(vt,[]),h.dummyToNodeForHorizontalAlignment.has(vt))h.nodeToTempPositionMapVertical.set(vt,h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(vt)[0]).getCenterY());else h.nodeToTempPositionMapVertical.set(vt,h.idToNodeMap.get(vt).getCenterY());if(!h.nodesInRelativeVertical.includes(Ct))if(h.nodesInRelativeVertical.push(Ct),h.nodeToRelativeConstraintMapVertical.set(Ct,[]),h.dummyToNodeForHorizontalAlignment.has(Ct))h.nodeToTempPositionMapVertical.set(Ct,h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(Ct)[0]).getCenterY());else h.nodeToTempPositionMapVertical.set(Ct,h.idToNodeMap.get(Ct).getCenterY());h.nodeToRelativeConstraintMapVertical.get(vt).push({bottom:Ct,gap:U.gap}),h.nodeToRelativeConstraintMapVertical.get(Ct).push({top:vt,gap:U.gap})}});else{var ct=new Map,mt=new Map;this.constraints.relativePlacementConstraint.forEach(function(U){if(U.left){var rt=H.has(U.left)?H.get(U.left):U.left,at=H.has(U.right)?H.get(U.right):U.right;if(ct.has(rt))ct.get(rt).push(at);else ct.set(rt,[at]);if(ct.has(at))ct.get(at).push(rt);else ct.set(at,[rt])}else{var vt=j.has(U.top)?j.get(U.top):U.top,Ct=j.has(U.bottom)?j.get(U.bottom):U.bottom;if(mt.has(vt))mt.get(vt).push(Ct);else mt.set(vt,[Ct]);if(mt.has(Ct))mt.get(Ct).push(vt);else mt.set(Ct,[vt])}});var K=function(rt,at){var vt=[],Ct=[],Ht=new ut,Kt=new Set,dt=0;return rt.forEach(function(ie,$t){if(!Kt.has($t)){vt[dt]=[],Ct[dt]=!1;var wt=$t;Ht.push(wt),Kt.add(wt),vt[dt].push(wt);while(Ht.length!=0){if(wt=Ht.shift(),at.has(wt))Ct[dt]=!0;var Et=rt.get(wt);Et.forEach(function(bt){if(!Kt.has(bt))Ht.push(bt),Kt.add(bt),vt[dt].push(bt)})}dt++}}),{components:vt,isFixed:Ct}},yt=K(ct,h.fixedNodesOnHorizontal);this.componentsOnHorizontal=yt.components,this.fixedComponentsOnHorizontal=yt.isFixed;var ht=K(mt,h.fixedNodesOnVertical);this.componentsOnVertical=ht.components,this.fixedComponentsOnVertical=ht.isFixed}}},W.prototype.updateDisplacements=function(){var h=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(ht){var U=h.idToNodeMap.get(ht.nodeId);U.displacementX=0,U.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var w=this.constraints.alignmentConstraint.vertical;for(var E=0;E<w.length;E++){var D=0;for(var m=0;m<w[E].length;m++){if(this.fixedNodeSet.has(w[E][m])){D=0;break}D+=this.idToNodeMap.get(w[E][m]).displacementX}var V=D/w[E].length;for(var m=0;m<w[E].length;m++)this.idToNodeMap.get(w[E][m]).displacementX=V}}if(this.constraints.alignmentConstraint.horizontal){var H=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<H.length;E++){var j=0;for(var m=0;m<H[E].length;m++){if(this.fixedNodeSet.has(H[E][m])){j=0;break}j+=this.idToNodeMap.get(H[E][m]).displacementY}var J=j/H[E].length;for(var m=0;m<H[E].length;m++)this.idToNodeMap.get(H[E][m]).displacementY=J}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(ht){if(!h.fixedNodesOnHorizontal.has(ht)){var U=0;if(h.dummyToNodeForVerticalAlignment.has(ht))U=h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(ht)[0]).displacementX;else U=h.idToNodeMap.get(ht).displacementX;if(h.nodeToRelativeConstraintMapHorizontal.get(ht).forEach(function(rt){if(rt.right){var at=h.nodeToTempPositionMapHorizontal.get(rt.right)-h.nodeToTempPositionMapHorizontal.get(ht)-U;if(at<rt.gap)U-=rt.gap-at}else{var at=h.nodeToTempPositionMapHorizontal.get(ht)-h.nodeToTempPositionMapHorizontal.get(rt.left)+U;if(at<rt.gap)U+=rt.gap-at}}),h.nodeToTempPositionMapHorizontal.set(ht,h.nodeToTempPositionMapHorizontal.get(ht)+U),h.dummyToNodeForVerticalAlignment.has(ht))h.dummyToNodeForVerticalAlignment.get(ht).forEach(function(rt){h.idToNodeMap.get(rt).displacementX=U});else h.idToNodeMap.get(ht).displacementX=U}}),this.nodesInRelativeVertical.forEach(function(ht){if(!h.fixedNodesOnHorizontal.has(ht)){var U=0;if(h.dummyToNodeForHorizontalAlignment.has(ht))U=h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(ht)[0]).displacementY;else U=h.idToNodeMap.get(ht).displacementY;if(h.nodeToRelativeConstraintMapVertical.get(ht).forEach(function(rt){if(rt.bottom){var at=h.nodeToTempPositionMapVertical.get(rt.bottom)-h.nodeToTempPositionMapVertical.get(ht)-U;if(at<rt.gap)U-=rt.gap-at}else{var at=h.nodeToTempPositionMapVertical.get(ht)-h.nodeToTempPositionMapVertical.get(rt.top)+U;if(at<rt.gap)U+=rt.gap-at}}),h.nodeToTempPositionMapVertical.set(ht,h.nodeToTempPositionMapVertical.get(ht)+U),h.dummyToNodeForHorizontalAlignment.has(ht))h.dummyToNodeForHorizontalAlignment.get(ht).forEach(function(rt){h.idToNodeMap.get(rt).displacementY=U});else h.idToNodeMap.get(ht).displacementY=U}})}else{for(var E=0;E<this.componentsOnHorizontal.length;E++){var Z=this.componentsOnHorizontal[E];if(this.fixedComponentsOnHorizontal[E])for(var m=0;m<Z.length;m++)if(this.dummyToNodeForVerticalAlignment.has(Z[m]))this.dummyToNodeForVerticalAlignment.get(Z[m]).forEach(function(rt){h.idToNodeMap.get(rt).displacementX=0});else this.idToNodeMap.get(Z[m]).displacementX=0;else{var ct=0,mt=0;for(var m=0;m<Z.length;m++)if(this.dummyToNodeForVerticalAlignment.has(Z[m])){var K=this.dummyToNodeForVerticalAlignment.get(Z[m]);ct+=K.length*this.idToNodeMap.get(K[0]).displacementX,mt+=K.length}else ct+=this.idToNodeMap.get(Z[m]).displacementX,mt++;var yt=ct/mt;for(var m=0;m<Z.length;m++)if(this.dummyToNodeForVerticalAlignment.has(Z[m]))this.dummyToNodeForVerticalAlignment.get(Z[m]).forEach(function(rt){h.idToNodeMap.get(rt).displacementX=yt});else this.idToNodeMap.get(Z[m]).displacementX=yt}}for(var E=0;E<this.componentsOnVertical.length;E++){var Z=this.componentsOnVertical[E];if(this.fixedComponentsOnVertical[E])for(var m=0;m<Z.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(Z[m]))this.dummyToNodeForHorizontalAlignment.get(Z[m]).forEach(function(at){h.idToNodeMap.get(at).displacementY=0});else this.idToNodeMap.get(Z[m]).displacementY=0;else{var ct=0,mt=0;for(var m=0;m<Z.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(Z[m])){var K=this.dummyToNodeForHorizontalAlignment.get(Z[m]);ct+=K.length*this.idToNodeMap.get(K[0]).displacementY,mt+=K.length}else ct+=this.idToNodeMap.get(Z[m]).displacementY,mt++;var yt=ct/mt;for(var m=0;m<Z.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(Z[m]))this.dummyToNodeForHorizontalAlignment.get(Z[m]).forEach(function(Ht){h.idToNodeMap.get(Ht).displacementY=yt});else this.idToNodeMap.get(Z[m]).displacementY=yt}}}},W.prototype.calculateNodesToApplyGravitationTo=function(){var h=[],w,E=this.graphManager.getGraphs(),D=E.length,m;for(m=0;m<D;m++)if(w=E[m],w.updateConnected(),!w.isConnected)h=h.concat(w.getNodes());return h},W.prototype.createBendpoints=function(){var h=[];h=h.concat(this.graphManager.getAllEdges());var w=new Set,E;for(E=0;E<h.length;E++){var D=h[E];if(!w.has(D)){var m=D.getSource(),V=D.getTarget();if(m==V)D.getBendpoints().push(new N),D.getBendpoints().push(new N),this.createDummyNodesForBendpoints(D),w.add(D);else{var H=[];if(H=H.concat(m.getEdgeListToNode(V)),H=H.concat(V.getEdgeListToNode(m)),!w.has(H[0])){if(H.length>1){var j;for(j=0;j<H.length;j++){var J=H[j];J.getBendpoints().push(new N),this.createDummyNodesForBendpoints(J)}}H.forEach(function(Z){w.add(Z)})}}}if(w.size==h.length)break}},W.prototype.positionNodesRadially=function(h){var w=new T(0,0),E=Math.ceil(Math.sqrt(h.length)),D=0,m=0,V=0,H=new N(0,0);for(var j=0;j<h.length;j++){if(j%E==0){if(V=0,m=D,j!=0)m+=c.DEFAULT_COMPONENT_SEPERATION;D=0}var J=h[j],Z=z.findCenterOfTree(J);if(w.x=V,w.y=m,H=W.radialLayout(J,Z,w),H.y>D)D=Math.floor(H.y);V=Math.floor(H.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(F.WORLD_CENTER_X-H.x/2,F.WORLD_CENTER_Y-H.y/2))},W.radialLayout=function(h,w,E){var D=Math.max(this.maxDiagonalInTree(h),c.DEFAULT_RADIAL_SEPARATION);W.branchRadialLayout(w,null,0,359,0,D);var m=it.calculateBounds(h),V=new _;V.setDeviceOrgX(m.getMinX()),V.setDeviceOrgY(m.getMinY()),V.setWorldOrgX(E.x),V.setWorldOrgY(E.y);for(var H=0;H<h.length;H++){var j=h[H];j.transform(V)}var J=new N(m.getMaxX(),m.getMaxY());return V.inverseTransformPoint(J)},W.branchRadialLayout=function(h,w,E,D,m,V){var H=(D-E+1)/2;if(H<0)H+=180;var j=(H+E)%360,J=j*Q.TWO_PI/360,Z=Math.cos(J),ct=m*Math.cos(J),mt=m*Math.sin(J);h.setCenter(ct,mt);var K=[];K=K.concat(h.getEdges());var yt=K.length;if(w!=null)yt--;var ht=0,U=K.length,rt,at=h.getEdgesBetween(w);while(at.length>1){var vt=at[0];at.splice(0,1);var Ct=K.indexOf(vt);if(Ct>=0)K.splice(Ct,1);U--,yt--}if(w!=null)rt=(K.indexOf(at[0])+1)%U;else rt=0;var Ht=Math.abs(D-E)/yt;for(var Kt=rt;ht!=yt;Kt=++Kt%U){var dt=K[Kt].getOtherEnd(h);if(dt==w)continue;var ie=(E+ht*Ht)%360,$t=(ie+Ht)%360;W.branchRadialLayout(dt,h,ie,$t,m+V,V),ht++}},W.maxDiagonalInTree=function(h){var w=b.MIN_VALUE;for(var E=0;E<h.length;E++){var D=h[E],m=D.getDiagonal();if(m>w)w=m}return w},W.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},W.prototype.groupZeroDegreeMembers=function(){var h=this,w={};this.memberGroups={},this.idToDummyNode={};var E=[],D=this.graphManager.getAllNodes();for(var m=0;m<D.length;m++){var V=D[m],H=V.getParent();if(this.getNodeDegreeWithChildren(V)===0&&(H.id==null||!this.getToBeTiled(H)))E.push(V)}for(var m=0;m<E.length;m++){var V=E[m],j=V.getParent().id;if(typeof w[j]>"u")w[j]=[];w[j]=w[j].concat(V)}Object.keys(w).forEach(function(J){if(w[J].length>1){var Z="DummyCompound_"+J;h.memberGroups[Z]=w[J];var ct=w[J][0].getParent(),mt=new i(h.graphManager);mt.id=Z,mt.paddingLeft=ct.paddingLeft||0,mt.paddingRight=ct.paddingRight||0,mt.paddingBottom=ct.paddingBottom||0,mt.paddingTop=ct.paddingTop||0,h.idToDummyNode[Z]=mt;var K=h.getGraphManager().add(h.newGraph(),mt),yt=ct.getChild();yt.add(mt);for(var ht=0;ht<w[J].length;ht++){var U=w[J][ht];yt.remove(U),K.add(U)}}})},W.prototype.clearCompounds=function(){var h={},w={};this.performDFSOnCompounds();for(var E=0;E<this.compoundOrder.length;E++)w[this.compoundOrder[E].id]=this.compoundOrder[E],h[this.compoundOrder[E].id]=[].concat(this.compoundOrder[E].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[E].getChild()),this.compoundOrder[E].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(h,w)},W.prototype.clearZeroDegreeMembers=function(){var h=this,w=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(E){var D=h.idToDummyNode[E];if(w[E]=h.tileNodes(h.memberGroups[E],D.paddingLeft+D.paddingRight),D.rect.width=w[E].width,D.rect.height=w[E].height,D.setCenter(w[E].centerX,w[E].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var m=D.rect.width,V=D.rect.height;if(D.labelWidth){if(D.labelPosHorizontal=="left")D.rect.x-=D.labelWidth,D.setWidth(m+D.labelWidth),D.labelMarginLeft=D.labelWidth;else if(D.labelPosHorizontal=="center"&&D.labelWidth>m)D.rect.x-=(D.labelWidth-m)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-m)/2;else if(D.labelPosHorizontal=="right")D.setWidth(m+D.labelWidth)}if(D.labelHeight){if(D.labelPosVertical=="top")D.rect.y-=D.labelHeight,D.setHeight(V+D.labelHeight),D.labelMarginTop=D.labelHeight;else if(D.labelPosVertical=="center"&&D.labelHeight>V)D.rect.y-=(D.labelHeight-V)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-V)/2;else if(D.labelPosVertical=="bottom")D.setHeight(V+D.labelHeight)}}})},W.prototype.repopulateCompounds=function(){for(var h=this.compoundOrder.length-1;h>=0;h--){var w=this.compoundOrder[h],{id:E,paddingLeft:D,paddingTop:m,labelMarginLeft:V,labelMarginTop:H}=w;this.adjustLocations(this.tiledMemberPack[E],w.rect.x,w.rect.y,D,m,V,H)}},W.prototype.repopulateZeroDegreeMembers=function(){var h=this,w=this.tiledZeroDegreePack;Object.keys(w).forEach(function(E){var D=h.idToDummyNode[E],{paddingLeft:m,paddingTop:V,labelMarginLeft:H,labelMarginTop:j}=D;h.adjustLocations(w[E],D.rect.x,D.rect.y,m,V,H,j)})},W.prototype.getToBeTiled=function(h){var w=h.id;if(this.toBeTiled[w]!=null)return this.toBeTiled[w];var E=h.getChild();if(E==null)return this.toBeTiled[w]=!1,!1;var D=E.getNodes();for(var m=0;m<D.length;m++){var V=D[m];if(this.getNodeDegree(V)>0)return this.toBeTiled[w]=!1,!1;if(V.getChild()==null){this.toBeTiled[V.id]=!1;continue}if(!this.getToBeTiled(V))return this.toBeTiled[w]=!1,!1}return this.toBeTiled[w]=!0,!0},W.prototype.getNodeDegree=function(h){var w=h.id,E=h.getEdges(),D=0;for(var m=0;m<E.length;m++){var V=E[m];if(V.getSource().id!==V.getTarget().id)D=D+1}return D},W.prototype.getNodeDegreeWithChildren=function(h){var w=this.getNodeDegree(h);if(h.getChild()==null)return w;var E=h.getChild().getNodes();for(var D=0;D<E.length;D++){var m=E[D];w+=this.getNodeDegreeWithChildren(m)}return w},W.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},W.prototype.fillCompexOrderByDFS=function(h){for(var w=0;w<h.length;w++){var E=h[w];if(E.getChild()!=null)this.fillCompexOrderByDFS(E.getChild().getNodes());if(this.getToBeTiled(E))this.compoundOrder.push(E)}},W.prototype.adjustLocations=function(h,w,E,D,m,V,H){w+=D+V,E+=m+H;var j=w;for(var J=0;J<h.rows.length;J++){var Z=h.rows[J];w=j;var ct=0;for(var mt=0;mt<Z.length;mt++){var K=Z[mt];if(K.rect.x=w,K.rect.y=E,w+=K.rect.width+h.horizontalPadding,K.rect.height>ct)ct=K.rect.height}E+=ct+h.verticalPadding}},W.prototype.tileCompoundMembers=function(h,w){var E=this;this.tiledMemberPack=[],Object.keys(h).forEach(function(D){var m=w[D];if(E.tiledMemberPack[D]=E.tileNodes(h[D],m.paddingLeft+m.paddingRight),m.rect.width=E.tiledMemberPack[D].width,m.rect.height=E.tiledMemberPack[D].height,m.setCenter(E.tiledMemberPack[D].centerX,E.tiledMemberPack[D].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var V=m.rect.width,H=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(V+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>V)m.rect.x-=(m.labelWidth-V)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-V)/2;else if(m.labelPosHorizontal=="right")m.setWidth(V+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(H+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>H)m.rect.y-=(m.labelHeight-H)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-H)/2;else if(m.labelPosVertical=="bottom")m.setHeight(H+m.labelHeight)}}})},W.prototype.tileNodes=function(h,w){var E=this.tileNodesByFavoringDim(h,w,!0),D=this.tileNodesByFavoringDim(h,w,!1),m=this.getOrgRatio(E),V=this.getOrgRatio(D),H;if(V<m)H=D;else H=E;return H},W.prototype.getOrgRatio=function(h){var{width:w,height:E}=h,D=w/E;if(D<1)D=1/D;return D},W.prototype.calcIdealRowWidth=function(h,w){var{TILING_PADDING_VERTICAL:E,TILING_PADDING_HORIZONTAL:D}=c,m=h.length,V=0,H=0,j=0;h.forEach(function(ht){if(V+=ht.getWidth(),H+=ht.getHeight(),ht.getWidth()>j)j=ht.getWidth()});var J=V/m,Z=H/m,ct=Math.pow(E-D,2)+4*(J+D)*(Z+E)*m,mt=(D-E+Math.sqrt(ct))/(2*(J+D)),K;if(w){if(K=Math.ceil(mt),K==mt)K++}else K=Math.floor(mt);var yt=K*(J+D)-D;if(j>yt)yt=j;return yt+=D*2,yt},W.prototype.tileNodesByFavoringDim=function(h,w,E){var{TILING_PADDING_VERTICAL:D,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:V}=c,H={rows:[],rowWidth:[],rowHeight:[],width:0,height:w,verticalPadding:D,horizontalPadding:m,centerX:0,centerY:0};if(V)H.idealRowWidth=this.calcIdealRowWidth(h,E);var j=function(U){return U.rect.width*U.rect.height},J=function(U,rt){return j(rt)-j(U)};h.sort(function(ht,U){var rt=J;if(H.idealRowWidth)return rt=V,rt(ht.id,U.id);return rt(ht,U)});var Z=0,ct=0;for(var mt=0;mt<h.length;mt++){var K=h[mt];Z+=K.getCenterX(),ct+=K.getCenterY()}H.centerX=Z/h.length,H.centerY=ct/h.length;for(var mt=0;mt<h.length;mt++){var K=h[mt];if(H.rows.length==0)this.insertNodeToRow(H,K,0,w);else if(this.canAddHorizontal(H,K.rect.width,K.rect.height)){var yt=H.rows.length-1;if(!H.idealRowWidth)yt=this.getShortestRowIndex(H);this.insertNodeToRow(H,K,yt,w)}else this.insertNodeToRow(H,K,H.rows.length,w);this.shiftToLastRow(H)}return H},W.prototype.insertNodeToRow=function(h,w,E,D){var m=D;if(E==h.rows.length){var V=[];h.rows.push(V),h.rowWidth.push(m),h.rowHeight.push(0)}var H=h.rowWidth[E]+w.rect.width;if(h.rows[E].length>0)H+=h.horizontalPadding;if(h.rowWidth[E]=H,h.width<H)h.width=H;var j=w.rect.height;if(E>0)j+=h.verticalPadding;var J=0;if(j>h.rowHeight[E])J=h.rowHeight[E],h.rowHeight[E]=j,J=h.rowHeight[E]-J;h.height+=J,h.rows[E].push(w)},W.prototype.getShortestRowIndex=function(h){var w=-1,E=Number.MAX_VALUE;for(var D=0;D<h.rows.length;D++)if(h.rowWidth[D]<E)w=D,E=h.rowWidth[D];return w},W.prototype.getLongestRowIndex=function(h){var w=-1,E=Number.MIN_VALUE;for(var D=0;D<h.rows.length;D++)if(h.rowWidth[D]>E)w=D,E=h.rowWidth[D];return w},W.prototype.canAddHorizontal=function(h,w,E){if(h.idealRowWidth){var D=h.rows.length-1,m=h.rowWidth[D];return m+w+h.horizontalPadding<=h.idealRowWidth}var V=this.getShortestRowIndex(h);if(V<0)return!0;var H=h.rowWidth[V];if(H+h.horizontalPadding+w<=h.width)return!0;var j=0;if(h.rowHeight[V]<E){if(V>0)j=E+h.verticalPadding-h.rowHeight[V]}var J;if(h.width-H>=w+h.horizontalPadding)J=(h.height+j)/(H+w+h.horizontalPadding);else J=(h.height+j)/h.width;j=E+h.verticalPadding;var Z;if(h.width<w)Z=(h.height+j)/w;else Z=(h.height+j)/h.width;if(Z<1)Z=1/Z;if(J<1)J=1/J;return J<Z},W.prototype.shiftToLastRow=function(h){var w=this.getLongestRowIndex(h),E=h.rowWidth.length-1,D=h.rows[w],m=D[D.length-1],V=m.width+h.horizontalPadding;if(h.width-h.rowWidth[E]>V&&w!=E){D.splice(-1,1),h.rows[E].push(m),h.rowWidth[w]=h.rowWidth[w]-V,h.rowWidth[E]=h.rowWidth[E]+V,h.width=h.rowWidth[instance.getLongestRowIndex(h)];var H=Number.MIN_VALUE;for(var j=0;j<D.length;j++)if(D[j].height>H)H=D[j].height;if(w>0)H+=h.verticalPadding;var J=h.rowHeight[w]+h.rowHeight[E];if(h.rowHeight[w]=H,h.rowHeight[E]<m.height+h.verticalPadding)h.rowHeight[E]=m.height+h.verticalPadding;var Z=h.rowHeight[w]+h.rowHeight[E];h.height+=Z-J,this.shiftToLastRow(h)}},W.prototype.tilingPreLayout=function(){if(c.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},W.prototype.tilingPostLayout=function(){if(c.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},W.prototype.reduceTrees=function(){var h=[],w=!0,E;while(w){var D=this.graphManager.getAllNodes(),m=[];w=!1;for(var V=0;V<D.length;V++)if(E=D[V],E.getEdges().length==1&&!E.getEdges()[0].isInterGraph&&E.getChild()==null){if(c.PURE_INCREMENTAL){var H=E.getEdges()[0].getOtherEnd(E),j=new S(E.getCenterX()-H.getCenterX(),E.getCenterY()-H.getCenterY());m.push([E,E.getEdges()[0],E.getOwner(),j])}else m.push([E,E.getEdges()[0],E.getOwner()]);w=!0}if(w==!0){var J=[];for(var Z=0;Z<m.length;Z++)if(m[Z][0].getEdges().length==1)J.push(m[Z]),m[Z][0].getOwner().remove(m[Z][0]);h.push(J),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=h},W.prototype.growTree=function(h){var w=h.length,E=h[w-1],D;for(var m=0;m<E.length;m++)D=E[m],this.findPlaceforPrunedNode(D),D[2].add(D[0]),D[2].add(D[1],D[1].source,D[1].target);h.splice(h.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},W.prototype.findPlaceforPrunedNode=function(h){var w,E,D=h[0];if(D==h[1].source)E=h[1].target;else E=h[1].source;if(c.PURE_INCREMENTAL)D.setCenter(E.getCenterX()+h[3].getWidth(),E.getCenterY()+h[3].getHeight());else{var m=E.startX,V=E.finishX,H=E.startY,j=E.finishY,J=0,Z=0,ct=0,mt=0,K=[J,ct,Z,mt];if(H>0)for(var yt=m;yt<=V;yt++)K[0]+=this.grid[yt][H-1].length+this.grid[yt][H].length-1;if(V<this.grid.length-1)for(var yt=H;yt<=j;yt++)K[1]+=this.grid[V+1][yt].length+this.grid[V][yt].length-1;if(j<this.grid[0].length-1)for(var yt=m;yt<=V;yt++)K[2]+=this.grid[yt][j+1].length+this.grid[yt][j].length-1;if(m>0)for(var yt=H;yt<=j;yt++)K[3]+=this.grid[m-1][yt].length+this.grid[m][yt].length-1;var ht=b.MAX_VALUE,U,rt;for(var at=0;at<K.length;at++)if(K[at]<ht)ht=K[at],U=1,rt=at;else if(K[at]==ht)U++;if(U==3&&ht==0){if(K[0]==0&&K[1]==0&&K[2]==0)w=1;else if(K[0]==0&&K[1]==0&&K[3]==0)w=0;else if(K[0]==0&&K[2]==0&&K[3]==0)w=3;else if(K[1]==0&&K[2]==0&&K[3]==0)w=2}else if(U==2&&ht==0){var vt=Math.floor(Math.random()*2);if(K[0]==0&&K[1]==0)if(vt==0)w=0;else w=1;else if(K[0]==0&&K[2]==0)if(vt==0)w=0;else w=2;else if(K[0]==0&&K[3]==0)if(vt==0)w=0;else w=3;else if(K[1]==0&&K[2]==0)if(vt==0)w=1;else w=2;else if(K[1]==0&&K[3]==0)if(vt==0)w=1;else w=3;else if(vt==0)w=2;else w=3}else if(U==4&&ht==0){var vt=Math.floor(Math.random()*4);w=vt}else w=rt;if(w==0)D.setCenter(E.getCenterX(),E.getCenterY()-E.getHeight()/2-f.DEFAULT_EDGE_LENGTH-D.getHeight()/2);else if(w==1)D.setCenter(E.getCenterX()+E.getWidth()/2+f.DEFAULT_EDGE_LENGTH+D.getWidth()/2,E.getCenterY());else if(w==2)D.setCenter(E.getCenterX(),E.getCenterY()+E.getHeight()/2+f.DEFAULT_EDGE_LENGTH+D.getHeight()/2);else D.setCenter(E.getCenterX()-E.getWidth()/2-f.DEFAULT_EDGE_LENGTH-D.getWidth()/2,E.getCenterY())}},s.exports=W},991:(s,a,o)=>{var g=o(551).FDLayoutNode,r=o(551).IMath;function y(t,c,d,f){g.call(this,t,c,d,f)}y.prototype=Object.create(g.prototype);for(var i in g)y[i]=g[i];y.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();if(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;else this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement)this.displacementX=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement)this.displacementY=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(t,c){var d=this.getChild().getNodes(),f;for(var F=0;F<d.length;F++)if(f=d[F],f.getChild()==null)f.displacementX+=t,f.displacementY+=c;else f.propogateDisplacementToChildren(t,c)},y.prototype.move=function(){var t=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},y.prototype.setPred1=function(t){this.pred1=t},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(t){this.next=t},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(t){this.processed=t},y.prototype.isProcessed=function(){return processed},s.exports=y},902:(s,a,o)=>{function g(d){if(Array.isArray(d)){for(var f=0,F=Array(d.length);f<d.length;f++)F[f]=d[f];return F}else return Array.from(d)}var r=o(806),y=o(551).LinkedList,i=o(551).Matrix,t=o(551).SVD;function c(){}c.handleConstraints=function(d){var f={};f.fixedNodeConstraint=d.constraints.fixedNodeConstraint,f.alignmentConstraint=d.constraints.alignmentConstraint,f.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var F=new Map,T=new Map,N=[],S=[],z=d.getAllNodes(),b=0;for(var Q=0;Q<z.length;Q++){var it=z[Q];if(it.getChild()==null)T.set(it.id,b++),N.push(it.getCenterX()),S.push(it.getCenterY()),F.set(it.id,it)}if(f.relativePlacementConstraint)f.relativePlacementConstraint.forEach(function(et){if(!et.gap&&et.gap!=0)if(et.left)et.gap=r.DEFAULT_EDGE_LENGTH+F.get(et.left).getWidth()/2+F.get(et.right).getWidth()/2;else et.gap=r.DEFAULT_EDGE_LENGTH+F.get(et.top).getHeight()/2+F.get(et.bottom).getHeight()/2});var _=function(ot,st){return{x:ot.x-st.x,y:ot.y-st.y}},ut=function(ot){var st=0,lt=0;return ot.forEach(function(ft){st+=N[T.get(ft)],lt+=S[T.get(ft)]}),{x:st/ot.size,y:lt/ot.size}},W=function(ot,st,lt,ft,pt){function Rt(Mt,Nt){var St=new Set(Mt),Lt=!0,Dt=!1,jt=void 0;try{for(var qt=Nt[Symbol.iterator](),le;!(Lt=(le=qt.next()).done);Lt=!0){var Zt=le.value;St.add(Zt)}}catch(Xt){Dt=!0,jt=Xt}finally{try{if(!Lt&&qt.return)qt.return()}finally{if(Dt)throw jt}}return St}var Ot=new Map;ot.forEach(function(Mt,Nt){Ot.set(Nt,0)}),ot.forEach(function(Mt,Nt){Mt.forEach(function(St){Ot.set(St.id,Ot.get(St.id)+1)})});var gt=new Map,At=new Map,It=new y;if(Ot.forEach(function(Mt,Nt){if(Mt==0){if(It.push(Nt),!lt)if(st=="horizontal")gt.set(Nt,T.has(Nt)?N[T.get(Nt)]:ft.get(Nt));else gt.set(Nt,T.has(Nt)?S[T.get(Nt)]:ft.get(Nt))}else gt.set(Nt,Number.NEGATIVE_INFINITY);if(lt)At.set(Nt,new Set([Nt]))}),lt)pt.forEach(function(Mt){var Nt=[];if(Mt.forEach(function(Dt){if(lt.has(Dt))Nt.push(Dt)}),Nt.length>0){var St=0;Nt.forEach(function(Dt){if(st=="horizontal")gt.set(Dt,T.has(Dt)?N[T.get(Dt)]:ft.get(Dt)),St+=gt.get(Dt);else gt.set(Dt,T.has(Dt)?S[T.get(Dt)]:ft.get(Dt)),St+=gt.get(Dt)}),St=St/Nt.length,Mt.forEach(function(Dt){if(!lt.has(Dt))gt.set(Dt,St)})}else{var Lt=0;Mt.forEach(function(Dt){if(st=="horizontal")Lt+=T.has(Dt)?N[T.get(Dt)]:ft.get(Dt);else Lt+=T.has(Dt)?S[T.get(Dt)]:ft.get(Dt)}),Lt=Lt/Mt.length,Mt.forEach(function(Dt){gt.set(Dt,Lt)})}});var Tt=function(){var Nt=It.shift(),St=ot.get(Nt);St.forEach(function(Lt){if(gt.get(Lt.id)<gt.get(Nt)+Lt.gap)if(lt&<.has(Lt.id)){var Dt=void 0;if(st=="horizontal")Dt=T.has(Lt.id)?N[T.get(Lt.id)]:ft.get(Lt.id);else Dt=T.has(Lt.id)?S[T.get(Lt.id)]:ft.get(Lt.id);if(gt.set(Lt.id,Dt),Dt<gt.get(Nt)+Lt.gap){var jt=gt.get(Nt)+Lt.gap-Dt;At.get(Nt).forEach(function(qt){gt.set(qt,gt.get(qt)-jt)})}}else gt.set(Lt.id,gt.get(Nt)+Lt.gap);if(Ot.set(Lt.id,Ot.get(Lt.id)-1),Ot.get(Lt.id)==0)It.push(Lt.id);if(lt)At.set(Lt.id,Rt(At.get(Nt),At.get(Lt.id)))})};while(It.length!=0)Tt();if(lt){var Ft=new Set;ot.forEach(function(Mt,Nt){if(Mt.length==0)Ft.add(Nt)});var Vt=[];At.forEach(function(Mt,Nt){if(Ft.has(Nt)){var St=!1,Lt=!0,Dt=!1,jt=void 0;try{for(var qt=Mt[Symbol.iterator](),le;!(Lt=(le=qt.next()).done);Lt=!0){var Zt=le.value;if(lt.has(Zt))St=!0}}catch(Jt){Dt=!0,jt=Jt}finally{try{if(!Lt&&qt.return)qt.return()}finally{if(Dt)throw jt}}if(!St){var Xt=!1,ge=void 0;if(Vt.forEach(function(Jt,ae){if(Jt.has([].concat(g(Mt))[0]))Xt=!0,ge=ae}),!Xt)Vt.push(new Set(Mt));else Mt.forEach(function(Jt){Vt[ge].add(Jt)})}}}),Vt.forEach(function(Mt,Nt){var{POSITIVE_INFINITY:St,POSITIVE_INFINITY:Lt,NEGATIVE_INFINITY:Dt,NEGATIVE_INFINITY:jt}=Number,qt=!0,le=!1,Zt=void 0;try{for(var Xt=Mt[Symbol.iterator](),ge;!(qt=(ge=Xt.next()).done);qt=!0){var Jt=ge.value,ae=void 0;if(st=="horizontal")ae=T.has(Jt)?N[T.get(Jt)]:ft.get(Jt);else ae=T.has(Jt)?S[T.get(Jt)]:ft.get(Jt);var fe=gt.get(Jt);if(ae<St)St=ae;if(ae>Dt)Dt=ae;if(fe<Lt)Lt=fe;if(fe>jt)jt=fe}}catch(Te){le=!0,Zt=Te}finally{try{if(!qt&&Xt.return)Xt.return()}finally{if(le)throw Zt}}var Ie=(St+Dt)/2-(Lt+jt)/2,ve=!0,ye=!1,me=void 0;try{for(var pe=Mt[Symbol.iterator](),Oe;!(ve=(Oe=pe.next()).done);ve=!0){var Ee=Oe.value;gt.set(Ee,gt.get(Ee)+Ie)}}catch(Te){ye=!0,me=Te}finally{try{if(!ve&&pe.return)pe.return()}finally{if(ye)throw me}}})}return gt},nt=function(ot){var st=0,lt=0,ft=0,pt=0;if(ot.forEach(function(At){if(At.left)N[T.get(At.left)]-N[T.get(At.right)]>=0?st++:lt++;else S[T.get(At.top)]-S[T.get(At.bottom)]>=0?ft++:pt++}),st>lt&&ft>pt)for(var Rt=0;Rt<T.size;Rt++)N[Rt]=-1*N[Rt],S[Rt]=-1*S[Rt];else if(st>lt)for(var Ot=0;Ot<T.size;Ot++)N[Ot]=-1*N[Ot];else if(ft>pt)for(var gt=0;gt<T.size;gt++)S[gt]=-1*S[gt]},h=function(ot){var st=[],lt=new y,ft=new Set,pt=0;return ot.forEach(function(Rt,Ot){if(!ft.has(Ot)){st[pt]=[];var gt=Ot;lt.push(gt),ft.add(gt),st[pt].push(gt);while(lt.length!=0){gt=lt.shift();var At=ot.get(gt);At.forEach(function(It){if(!ft.has(It.id))lt.push(It.id),ft.add(It.id),st[pt].push(It.id)})}pt++}}),st},w=function(ot){var st=new Map;return ot.forEach(function(lt,ft){st.set(ft,[])}),ot.forEach(function(lt,ft){lt.forEach(function(pt){st.get(ft).push(pt),st.get(pt.id).push({id:ft,gap:pt.gap,direction:pt.direction})})}),st},E=function(ot){var st=new Map;return ot.forEach(function(lt,ft){st.set(ft,[])}),ot.forEach(function(lt,ft){lt.forEach(function(pt){st.get(pt.id).push({id:ft,gap:pt.gap,direction:pt.direction})})}),st},D=[],m=[],V=!1,H=!1,j=new Set,J=new Map,Z=new Map,ct=[];if(f.fixedNodeConstraint)f.fixedNodeConstraint.forEach(function(et){j.add(et.nodeId)});if(f.relativePlacementConstraint)f.relativePlacementConstraint.forEach(function(et){if(et.left){if(J.has(et.left))J.get(et.left).push({id:et.right,gap:et.gap,direction:"horizontal"});else J.set(et.left,[{id:et.right,gap:et.gap,direction:"horizontal"}]);if(!J.has(et.right))J.set(et.right,[])}else{if(J.has(et.top))J.get(et.top).push({id:et.bottom,gap:et.gap,direction:"vertical"});else J.set(et.top,[{id:et.bottom,gap:et.gap,direction:"vertical"}]);if(!J.has(et.bottom))J.set(et.bottom,[])}}),Z=w(J),ct=h(Z);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>1)f.fixedNodeConstraint.forEach(function(et,ot){D[ot]=[et.position.x,et.position.y],m[ot]=[N[T.get(et.nodeId)],S[T.get(et.nodeId)]]}),V=!0;else if(f.alignmentConstraint)(function(){var et=0;if(f.alignmentConstraint.vertical){var ot=f.alignmentConstraint.vertical,st=function(gt){var At=new Set;ot[gt].forEach(function(Ft){At.add(Ft)});var It=new Set([].concat(g(At)).filter(function(Ft){return j.has(Ft)})),Tt=void 0;if(It.size>0)Tt=N[T.get(It.values().next().value)];else Tt=ut(At).x;ot[gt].forEach(function(Ft){D[et]=[Tt,S[T.get(Ft)]],m[et]=[N[T.get(Ft)],S[T.get(Ft)]],et++})};for(var lt=0;lt<ot.length;lt++)st(lt);V=!0}if(f.alignmentConstraint.horizontal){var ft=f.alignmentConstraint.horizontal,pt=function(gt){var At=new Set;ft[gt].forEach(function(Ft){At.add(Ft)});var It=new Set([].concat(g(At)).filter(function(Ft){return j.has(Ft)})),Tt=void 0;if(It.size>0)Tt=N[T.get(It.values().next().value)];else Tt=ut(At).y;ft[gt].forEach(function(Ft){D[et]=[N[T.get(Ft)],Tt],m[et]=[N[T.get(Ft)],S[T.get(Ft)]],et++})};for(var Rt=0;Rt<ft.length;Rt++)pt(Rt);V=!0}if(f.relativePlacementConstraint)H=!0})();else if(f.relativePlacementConstraint){var mt=0,K=0;for(var yt=0;yt<ct.length;yt++)if(ct[yt].length>mt)mt=ct[yt].length,K=yt;if(mt<Z.size/2)nt(f.relativePlacementConstraint),V=!1,H=!1;else{var ht=new Map,U=new Map,rt=[];ct[K].forEach(function(et){J.get(et).forEach(function(ot){if(ot.direction=="horizontal"){if(ht.has(et))ht.get(et).push(ot);else ht.set(et,[ot]);if(!ht.has(ot.id))ht.set(ot.id,[]);rt.push({left:et,right:ot.id})}else{if(U.has(et))U.get(et).push(ot);else U.set(et,[ot]);if(!U.has(ot.id))U.set(ot.id,[]);rt.push({top:et,bottom:ot.id})}})}),nt(rt),H=!1;var at=W(ht,"horizontal"),vt=W(U,"vertical");ct[K].forEach(function(et,ot){if(m[ot]=[N[T.get(et)],S[T.get(et)]],D[ot]=[],at.has(et))D[ot][0]=at.get(et);else D[ot][0]=N[T.get(et)];if(vt.has(et))D[ot][1]=vt.get(et);else D[ot][1]=S[T.get(et)]}),V=!0}}if(V){var Ct=void 0,Ht=i.transpose(D),Kt=i.transpose(m);for(var dt=0;dt<Ht.length;dt++)Ht[dt]=i.multGamma(Ht[dt]),Kt[dt]=i.multGamma(Kt[dt]);var ie=i.multMat(Ht,i.transpose(Kt)),$t=t.svd(ie);Ct=i.multMat($t.V,i.transpose($t.U));for(var wt=0;wt<T.size;wt++){var Et=[N[wt],S[wt]],bt=[Ct[0][0],Ct[1][0]],Gt=[Ct[0][1],Ct[1][1]];N[wt]=i.dotProduct(Et,bt),S[wt]=i.dotProduct(Et,Gt)}if(H)nt(f.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>0){var Wt={x:0,y:0};f.fixedNodeConstraint.forEach(function(et,ot){var st={x:N[T.get(et.nodeId)],y:S[T.get(et.nodeId)]},lt=et.position,ft=_(lt,st);Wt.x+=ft.x,Wt.y+=ft.y}),Wt.x/=f.fixedNodeConstraint.length,Wt.y/=f.fixedNodeConstraint.length,N.forEach(function(et,ot){N[ot]+=Wt.x}),S.forEach(function(et,ot){S[ot]+=Wt.y}),f.fixedNodeConstraint.forEach(function(et){N[T.get(et.nodeId)]=et.position.x,S[T.get(et.nodeId)]=et.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical){var Ut=f.alignmentConstraint.vertical,Yt=function(ot){var st=new Set;Ut[ot].forEach(function(pt){st.add(pt)});var lt=new Set([].concat(g(st)).filter(function(pt){return j.has(pt)})),ft=void 0;if(lt.size>0)ft=N[T.get(lt.values().next().value)];else ft=ut(st).x;st.forEach(function(pt){if(!j.has(pt))N[T.get(pt)]=ft})};for(var Bt=0;Bt<Ut.length;Bt++)Yt(Bt)}if(f.alignmentConstraint.horizontal){var Qt=f.alignmentConstraint.horizontal,he=function(ot){var st=new Set;Qt[ot].forEach(function(pt){st.add(pt)});var lt=new Set([].concat(g(st)).filter(function(pt){return j.has(pt)})),ft=void 0;if(lt.size>0)ft=S[T.get(lt.values().next().value)];else ft=ut(st).y;st.forEach(function(pt){if(!j.has(pt))S[T.get(pt)]=ft})};for(var te=0;te<Qt.length;te++)he(te)}}if(f.relativePlacementConstraint)(function(){var et=new Map,ot=new Map,st=new Map,lt=new Map,ft=new Map,pt=new Map,Rt=new Set,Ot=new Set;if(j.forEach(function(re){Rt.add(re),Ot.add(re)}),f.alignmentConstraint){if(f.alignmentConstraint.vertical){var gt=f.alignmentConstraint.vertical,At=function(Pt){st.set("dummy"+Pt,[]),gt[Pt].forEach(function(zt){if(et.set(zt,"dummy"+Pt),st.get("dummy"+Pt).push(zt),j.has(zt))Rt.add("dummy"+Pt)}),ft.set("dummy"+Pt,N[T.get(gt[Pt][0])])};for(var It=0;It<gt.length;It++)At(It)}if(f.alignmentConstraint.horizontal){var Tt=f.alignmentConstraint.horizontal,Ft=function(Pt){lt.set("dummy"+Pt,[]),Tt[Pt].forEach(function(zt){if(ot.set(zt,"dummy"+Pt),lt.get("dummy"+Pt).push(zt),j.has(zt))Ot.add("dummy"+Pt)}),pt.set("dummy"+Pt,S[T.get(Tt[Pt][0])])};for(var Vt=0;Vt<Tt.length;Vt++)Ft(Vt)}}var Mt=new Map,Nt=new Map,St=function(Pt){J.get(Pt).forEach(function(zt){var ue=void 0,ce=void 0;if(zt.direction=="horizontal"){if(ue=et.get(Pt)?et.get(Pt):Pt,et.get(zt.id))ce={id:et.get(zt.id),gap:zt.gap,direction:zt.direction};else ce=zt;if(Mt.has(ue))Mt.get(ue).push(ce);else Mt.set(ue,[ce]);if(!Mt.has(ce.id))Mt.set(ce.id,[])}else{if(ue=ot.get(Pt)?ot.get(Pt):Pt,ot.get(zt.id))ce={id:ot.get(zt.id),gap:zt.gap,direction:zt.direction};else ce=zt;if(Nt.has(ue))Nt.get(ue).push(ce);else Nt.set(ue,[ce]);if(!Nt.has(ce.id))Nt.set(ce.id,[])}})},Lt=!0,Dt=!1,jt=void 0;try{for(var qt=J.keys()[Symbol.iterator](),le;!(Lt=(le=qt.next()).done);Lt=!0){var Zt=le.value;St(Zt)}}catch(re){Dt=!0,jt=re}finally{try{if(!Lt&&qt.return)qt.return()}finally{if(Dt)throw jt}}var Xt=w(Mt),ge=w(Nt),Jt=h(Xt),ae=h(ge),fe=E(Mt),Ie=E(Nt),ve=[],ye=[];Jt.forEach(function(re,Pt){ve[Pt]=[],re.forEach(function(zt){if(fe.get(zt).length==0)ve[Pt].push(zt)})}),ae.forEach(function(re,Pt){ye[Pt]=[],re.forEach(function(zt){if(Ie.get(zt).length==0)ye[Pt].push(zt)})});var me=W(Mt,"horizontal",Rt,ft,ve),pe=W(Nt,"vertical",Ot,pt,ye),Oe=function(Pt){if(st.get(Pt))st.get(Pt).forEach(function(zt){N[T.get(zt)]=me.get(Pt)});else N[T.get(Pt)]=me.get(Pt)},Ee=!0,Te=!1,Ze=void 0;try{for(var Re=me.keys()[Symbol.iterator](),ke;!(Ee=(ke=Re.next()).done);Ee=!0){var Se=ke.value;Oe(Se)}}catch(re){Te=!0,Ze=re}finally{try{if(!Ee&&Re.return)Re.return()}finally{if(Te)throw Ze}}var dr=function(Pt){if(lt.get(Pt))lt.get(Pt).forEach(function(zt){S[T.get(zt)]=pe.get(Pt)});else S[T.get(Pt)]=pe.get(Pt)},Fe=!0,qe=!1,Qe=void 0;try{for(var be=pe.keys()[Symbol.iterator](),Je;!(Fe=(Je=be.next()).done);Fe=!0){var Se=Je.value;dr(Se)}}catch(re){qe=!0,Qe=re}finally{try{if(!Fe&&be.return)be.return()}finally{if(qe)throw Qe}}})()}for(var ne=0;ne<z.length;ne++){var _t=z[ne];if(_t.getChild()==null)_t.setCenter(N[T.get(_t.id)],S[T.get(_t.id)])}},s.exports=c},551:(s)=>{s.exports=C}},x={};function v(s){var a=x[s];if(a!==void 0)return a.exports;var o=x[s]={exports:{}};return G[s](o,o.exports,v),o.exports}var l=v(45);return l})()})});var Ke=We(function(Ce,He){(function(G,x){if(typeof Ce==="object"&&typeof He==="object")He.exports=x(Xe());else if(typeof define==="function"&&define.amd)define(["cose-base"],x);else if(typeof Ce==="object")Ce.cytoscapeFcose=x(Xe());else G.cytoscapeFcose=x(G.coseBase)})(Ce,function(C){return(()=>{var G={658:(s)=>{s.exports=Object.assign!=null?Object.assign.bind(Object):function(a){for(var o=arguments.length,g=Array(o>1?o-1:0),r=1;r<o;r++)g[r-1]=arguments[r];return g.forEach(function(y){Object.keys(y).forEach(function(i){return a[i]=y[i]})}),a}},548:(s,a,o)=>{var g=function(){function i(t,c){var d=[],f=!0,F=!1,T=void 0;try{for(var N=t[Symbol.iterator](),S;!(f=(S=N.next()).done);f=!0)if(d.push(S.value),c&&d.length===c)break}catch(z){F=!0,T=z}finally{try{if(!f&&N.return)N.return()}finally{if(F)throw T}}return d}return function(t,c){if(Array.isArray(t))return t;else if(Symbol.iterator in Object(t))return i(t,c);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=o(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var t={};for(var c=0;c<i.length;c++)t[i[c].id()]=!0;var d=i.filter(function(f,F){if(typeof f==="number")f=F;var T=f.parent()[0];while(T!=null){if(t[T.id()])return!1;T=T.parent()[0]}return!0});return d},y.connectComponents=function(i,t,c,d){var f=new r,F=new Set,T=[],N=void 0,S=void 0,z=void 0,b=!1,Q=1,it=[],_=[],ut=function(){var nt=i.collection();_.push(nt);var h=c[0],w=i.collection();w.merge(h).merge(h.descendants().intersection(t)),T.push(h),w.forEach(function(m){f.push(m),F.add(m),nt.merge(m)});var E=function(){h=f.shift();var V=i.collection();h.neighborhood().nodes().forEach(function(Z){if(t.intersection(h.edgesWith(Z)).length>0)V.merge(Z)});for(var H=0;H<V.length;H++){var j=V[H];if(N=c.intersection(j.union(j.ancestors())),N!=null&&!F.has(N[0])){var J=N.union(N.descendants());J.forEach(function(Z){if(f.push(Z),F.add(Z),nt.merge(Z),c.has(Z))T.push(Z)})}}};while(f.length!=0)E();if(nt.forEach(function(m){t.intersection(m.connectedEdges()).forEach(function(V){if(nt.has(V.source())&&nt.has(V.target()))nt.merge(V)})}),T.length==c.length)b=!0;if(!b||b&&Q>1){S=T[0],z=S.connectedEdges().length,T.forEach(function(m){if(m.connectedEdges().length<z)z=m.connectedEdges().length,S=m}),it.push(S.id());var D=i.collection();D.merge(T[0]),T.forEach(function(m){D.merge(m)}),T=[],c=c.difference(D),Q++}};do ut();while(!b);if(d){if(it.length>0)d.set("dummy"+(d.size+1),it)}return _},y.relocateComponent=function(i,t,c){if(!c.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:f,POSITIVE_INFINITY:F,NEGATIVE_INFINITY:T}=Number;if(c.quality=="draft"){var N=!0,S=!1,z=void 0;try{for(var b=t.nodeIndexes[Symbol.iterator](),Q;!(N=(Q=b.next()).done);N=!0){var it=Q.value,_=g(it,2),ut=_[0],W=_[1],nt=c.cy.getElementById(ut);if(nt){var h=nt.boundingBox(),w=t.xCoords[W]-h.w/2,E=t.xCoords[W]+h.w/2,D=t.yCoords[W]-h.h/2,m=t.yCoords[W]+h.h/2;if(w<d)d=w;if(E>f)f=E;if(D<F)F=D;if(m>T)T=m}}}catch(Z){S=!0,z=Z}finally{try{if(!N&&b.return)b.return()}finally{if(S)throw z}}var V=i.x-(f+d)/2,H=i.y-(T+F)/2;t.xCoords=t.xCoords.map(function(Z){return Z+V}),t.yCoords=t.yCoords.map(function(Z){return Z+H})}else{Object.keys(t).forEach(function(Z){var ct=t[Z],mt=ct.getRect().x,K=ct.getRect().x+ct.getRect().width,yt=ct.getRect().y,ht=ct.getRect().y+ct.getRect().height;if(mt<d)d=mt;if(K>f)f=K;if(yt<F)F=yt;if(ht>T)T=ht});var j=i.x-(f+d)/2,J=i.y-(T+F)/2;Object.keys(t).forEach(function(Z){var ct=t[Z];ct.setCenter(ct.getCenterX()+j,ct.getCenterY()+J)})}}},y.calcBoundingBox=function(i,t,c,d){var{MAX_SAFE_INTEGER:f,MIN_SAFE_INTEGER:F,MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:N}=Number,S=void 0,z=void 0,b=void 0,Q=void 0,it=i.descendants().not(":parent"),_=it.length;for(var ut=0;ut<_;ut++){var W=it[ut];if(S=t[d.get(W.id())]-W.width()/2,z=t[d.get(W.id())]+W.width()/2,b=c[d.get(W.id())]-W.height()/2,Q=c[d.get(W.id())]+W.height()/2,f>S)f=S;if(F<z)F=z;if(T>b)T=b;if(N<Q)N=Q}var nt={};return nt.topLeftX=f,nt.topLeftY=T,nt.width=F-f,nt.height=N-T,nt},y.calcParentsWithoutChildren=function(i,t){var c=i.collection();return t.nodes(":parent").forEach(function(d){var f=!1;if(d.children().forEach(function(F){if(F.css("display")!="none")f=!0}),!f)c.merge(d)}),c},s.exports=y},816:(s,a,o)=>{var g=o(548),r=o(140).CoSELayout,y=o(140).CoSENode,i=o(140).layoutBase.PointD,t=o(140).layoutBase.DimensionD,c=o(140).layoutBase.LayoutConstants,d=o(140).layoutBase.FDLayoutConstants,f=o(140).CoSEConstants,F=function(N,S){var{cy:z,eles:b}=N,Q=b.nodes(),it=b.edges(),_=void 0,ut=void 0,W=void 0,nt={};if(N.randomize)_=S.nodeIndexes,ut=S.xCoords,W=S.yCoords;var h=function(Z){return typeof Z==="function"},w=function(Z,ct){if(h(Z))return Z(ct);else return Z},E=g.calcParentsWithoutChildren(z,b),D=function J(Z,ct,mt,K){var yt=ct.length;for(var ht=0;ht<yt;ht++){var U=ct[ht],rt=null;if(U.intersection(E).length==0)rt=U.children();var at=void 0,vt=U.layoutDimensions({nodeDimensionsIncludeLabels:K.nodeDimensionsIncludeLabels});if(U.outerWidth()!=null&&U.outerHeight()!=null)if(K.randomize)if(!U.isParent())at=Z.add(new y(mt.graphManager,new i(ut[_.get(U.id())]-vt.w/2,W[_.get(U.id())]-vt.h/2),new t(parseFloat(vt.w),parseFloat(vt.h))));else{var Ct=g.calcBoundingBox(U,ut,W,_);if(U.intersection(E).length==0)at=Z.add(new y(mt.graphManager,new i(Ct.topLeftX,Ct.topLeftY),new t(Ct.width,Ct.height)));else at=Z.add(new y(mt.graphManager,new i(Ct.topLeftX,Ct.topLeftY),new t(parseFloat(vt.w),parseFloat(vt.h))))}else at=Z.add(new y(mt.graphManager,new i(U.position("x")-vt.w/2,U.position("y")-vt.h/2),new t(parseFloat(vt.w),parseFloat(vt.h))));else at=Z.add(new y(this.graphManager));if(at.id=U.data("id"),at.nodeRepulsion=w(K.nodeRepulsion,U),at.paddingLeft=parseInt(U.css("padding")),at.paddingTop=parseInt(U.css("padding")),at.paddingRight=parseInt(U.css("padding")),at.paddingBottom=parseInt(U.css("padding")),K.nodeDimensionsIncludeLabels)at.labelWidth=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,at.labelHeight=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,at.labelPosVertical=U.css("text-valign"),at.labelPosHorizontal=U.css("text-halign");if(nt[U.data("id")]=at,isNaN(at.rect.x))at.rect.x=0;if(isNaN(at.rect.y))at.rect.y=0;if(rt!=null&&rt.length>0){var Ht=void 0;Ht=mt.getGraphManager().add(mt.newGraph(),at),J(Ht,rt,mt,K)}}},m=function(Z,ct,mt){var K=0,yt=0;for(var ht=0;ht<mt.length;ht++){var U=mt[ht],rt=nt[U.data("source")],at=nt[U.data("target")];if(rt&&at&&rt!==at&&rt.getEdgesBetween(at).length==0){var vt=ct.add(Z.newEdge(),rt,at);vt.id=U.id(),vt.idealLength=w(N.idealEdgeLength,U),vt.edgeElasticity=w(N.edgeElasticity,U),K+=vt.idealLength,yt++}}if(N.idealEdgeLength!=null){if(yt>0)f.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=K/yt;else if(!h(N.idealEdgeLength))f.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else f.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;f.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},V=function(Z,ct){if(ct.fixedNodeConstraint)Z.constraints.fixedNodeConstraint=ct.fixedNodeConstraint;if(ct.alignmentConstraint)Z.constraints.alignmentConstraint=ct.alignmentConstraint;if(ct.relativePlacementConstraint)Z.constraints.relativePlacementConstraint=ct.relativePlacementConstraint};if(N.nestingFactor!=null)f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)f.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)f.MAX_ITERATIONS=d.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)f.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)f.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)f.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")c.QUALITY=2;else c.QUALITY=0;if(f.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!N.randomize,f.ANIMATE=d.ANIMATE=c.ANIMATE=N.animate,f.TILE=N.tile,f.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!N.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1;if(N.step=="enforced")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1;if(N.step=="cose")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)f.TREE_REDUCTION_ON_INCREMENTAL=!1;else f.TREE_REDUCTION_ON_INCREMENTAL=!0;var H=new r,j=H.newGraphManager();return D(j.addRoot(),g.getTopMostNodes(Q),H,N),m(H,j,it),V(H,N),H.runLayout(),nt};s.exports={coseLayout:F}},212:(s,a,o)=>{var g=function(){function N(S,z){for(var b=0;b<z.length;b++){var Q=z[b];if(Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q)Q.writable=!0;Object.defineProperty(S,Q.key,Q)}}return function(S,z,b){if(z)N(S.prototype,z);if(b)N(S,b);return S}}();function r(N,S){if(!(N instanceof S))throw TypeError("Cannot call a class as a function")}var y=o(658),i=o(548),t=o(657),c=t.spectralLayout,d=o(816),f=d.coseLayout,F=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(S){return 4500},idealEdgeLength:function(S){return 50},edgeElasticity:function(S){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),T=function(){function N(S){r(this,N),this.options=y({},F,S)}return g(N,[{key:"run",value:function(){var z=this,b=this.options,{cy:Q,eles:it}=b,_=[],ut=void 0,W=void 0,nt=[],h=void 0,w=[];if(b.fixedNodeConstraint&&(!Array.isArray(b.fixedNodeConstraint)||b.fixedNodeConstraint.length==0))b.fixedNodeConstraint=void 0;if(b.alignmentConstraint){if(b.alignmentConstraint.vertical&&(!Array.isArray(b.alignmentConstraint.vertical)||b.alignmentConstraint.vertical.length==0))b.alignmentConstraint.vertical=void 0;if(b.alignmentConstraint.horizontal&&(!Array.isArray(b.alignmentConstraint.horizontal)||b.alignmentConstraint.horizontal.length==0))b.alignmentConstraint.horizontal=void 0}if(b.relativePlacementConstraint&&(!Array.isArray(b.relativePlacementConstraint)||b.relativePlacementConstraint.length==0))b.relativePlacementConstraint=void 0;var E=b.fixedNodeConstraint||b.alignmentConstraint||b.relativePlacementConstraint;if(E)b.tile=!1,b.packComponents=!1;var D=void 0,m=!1;if(Q.layoutUtilities&&b.packComponents){if(D=Q.layoutUtilities("get"),!D)D=Q.layoutUtilities();m=!0}if(it.nodes().length>0)if(!m){var V=b.eles.boundingBox();if(w.push({x:V.x1+V.w/2,y:V.y1+V.h/2}),b.randomize){var H=c(b);_.push(H)}if(b.quality=="default"||b.quality=="proof")nt.push(f(b,_[0])),i.relocateComponent(w[0],nt[0],b);else i.relocateComponent(w[0],_[0],b)}else{var j=i.getTopMostNodes(b.eles.nodes());if(h=i.connectComponents(Q,b.eles,j),h.forEach(function(wt){var Et=wt.boundingBox();w.push({x:Et.x1+Et.w/2,y:Et.y1+Et.h/2})}),b.randomize)h.forEach(function(wt){b.eles=wt,_.push(c(b))});if(b.quality=="default"||b.quality=="proof"){var J=Q.collection();if(b.tile){var Z=new Map,ct=[],mt=[],K=0,yt={nodeIndexes:Z,xCoords:ct,yCoords:mt},ht=[];if(h.forEach(function(wt,Et){if(wt.edges().length==0)wt.nodes().forEach(function(bt,Gt){if(J.merge(wt.nodes()[Gt]),!bt.isParent())yt.nodeIndexes.set(wt.nodes()[Gt].id(),K++),yt.xCoords.push(wt.nodes()[0].position().x),yt.yCoords.push(wt.nodes()[0].position().y)}),ht.push(Et)}),J.length>1){var U=J.boundingBox();w.push({x:U.x1+U.w/2,y:U.y1+U.h/2}),h.push(J),_.push(yt);for(var rt=ht.length-1;rt>=0;rt--)h.splice(ht[rt],1),_.splice(ht[rt],1),w.splice(ht[rt],1)}}h.forEach(function(wt,Et){b.eles=wt,nt.push(f(b,_[Et])),i.relocateComponent(w[Et],nt[Et],b)})}else h.forEach(function(wt,Et){i.relocateComponent(w[Et],_[Et],b)});var at=new Set;if(h.length>1){var vt=[],Ct=it.filter(function(wt){return wt.css("display")=="none"});h.forEach(function(wt,Et){var bt=void 0;if(b.quality=="draft")bt=_[Et].nodeIndexes;if(wt.nodes().not(Ct).length>0){var Gt={};Gt.edges=[],Gt.nodes=[];var Wt=void 0;if(wt.nodes().not(Ct).forEach(function(Ut){if(b.quality=="draft")if(!Ut.isParent())Wt=bt.get(Ut.id()),Gt.nodes.push({x:_[Et].xCoords[Wt]-Ut.boundingbox().w/2,y:_[Et].yCoords[Wt]-Ut.boundingbox().h/2,width:Ut.boundingbox().w,height:Ut.boundingbox().h});else{var Yt=i.calcBoundingBox(Ut,_[Et].xCoords,_[Et].yCoords,bt);Gt.nodes.push({x:Yt.topLeftX,y:Yt.topLeftY,width:Yt.width,height:Yt.height})}else if(nt[Et][Ut.id()])Gt.nodes.push({x:nt[Et][Ut.id()].getLeft(),y:nt[Et][Ut.id()].getTop(),width:nt[Et][Ut.id()].getWidth(),height:nt[Et][Ut.id()].getHeight()})}),wt.edges().forEach(function(Ut){var Yt=Ut.source(),Bt=Ut.target();if(Yt.css("display")!="none"&&Bt.css("display")!="none"){if(b.quality=="draft"){var Qt=bt.get(Yt.id()),he=bt.get(Bt.id()),te=[],ne=[];if(Yt.isParent()){var _t=i.calcBoundingBox(Yt,_[Et].xCoords,_[Et].yCoords,bt);te.push(_t.topLeftX+_t.width/2),te.push(_t.topLeftY+_t.height/2)}else te.push(_[Et].xCoords[Qt]),te.push(_[Et].yCoords[Qt]);if(Bt.isParent()){var et=i.calcBoundingBox(Bt,_[Et].xCoords,_[Et].yCoords,bt);ne.push(et.topLeftX+et.width/2),ne.push(et.topLeftY+et.height/2)}else ne.push(_[Et].xCoords[he]),ne.push(_[Et].yCoords[he]);Gt.edges.push({startX:te[0],startY:te[1],endX:ne[0],endY:ne[1]})}else if(nt[Et][Yt.id()]&&nt[Et][Bt.id()])Gt.edges.push({startX:nt[Et][Yt.id()].getCenterX(),startY:nt[Et][Yt.id()].getCenterY(),endX:nt[Et][Bt.id()].getCenterX(),endY:nt[Et][Bt.id()].getCenterY()})}}),Gt.nodes.length>0)vt.push(Gt),at.add(Et)}});var Ht=D.packComponents(vt,b.randomize).shifts;if(b.quality=="draft")_.forEach(function(wt,Et){var bt=wt.xCoords.map(function(Wt){return Wt+Ht[Et].dx}),Gt=wt.yCoords.map(function(Wt){return Wt+Ht[Et].dy});wt.xCoords=bt,wt.yCoords=Gt});else{var Kt=0;at.forEach(function(wt){Object.keys(nt[wt]).forEach(function(Et){var bt=nt[wt][Et];bt.setCenter(bt.getCenterX()+Ht[Kt].dx,bt.getCenterY()+Ht[Kt].dy)}),Kt++})}}}var dt=function(Et,bt){if(b.quality=="default"||b.quality=="proof"){if(typeof Et==="number")Et=bt;var Gt=void 0,Wt=void 0,Ut=Et.data("id");if(nt.forEach(function(Bt){if(Ut in Bt)Gt={x:Bt[Ut].getRect().getCenterX(),y:Bt[Ut].getRect().getCenterY()},Wt=Bt[Ut]}),b.nodeDimensionsIncludeLabels){if(Wt.labelWidth){if(Wt.labelPosHorizontal=="left")Gt.x+=Wt.labelWidth/2;else if(Wt.labelPosHorizontal=="right")Gt.x-=Wt.labelWidth/2}if(Wt.labelHeight){if(Wt.labelPosVertical=="top")Gt.y+=Wt.labelHeight/2;else if(Wt.labelPosVertical=="bottom")Gt.y-=Wt.labelHeight/2}}if(Gt==null)Gt={x:Et.position("x"),y:Et.position("y")};return{x:Gt.x,y:Gt.y}}else{var Yt=void 0;if(_.forEach(function(Bt){var Qt=Bt.nodeIndexes.get(Et.id());if(Qt!=null)Yt={x:Bt.xCoords[Qt],y:Bt.yCoords[Qt]}}),Yt==null)Yt={x:Et.position("x"),y:Et.position("y")};return{x:Yt.x,y:Yt.y}}};if(b.quality=="default"||b.quality=="proof"||b.randomize){var ie=i.calcParentsWithoutChildren(Q,it),$t=it.filter(function(wt){return wt.css("display")=="none"});if(b.eles=it.not($t),it.nodes().not(":parent").not($t).layoutPositions(z,b,dt),ie.length>0)ie.forEach(function(wt){wt.position(dt(wt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();s.exports=T},657:(s,a,o)=>{var g=o(548),r=o(140).layoutBase.Matrix,y=o(140).layoutBase.SVD,i=function(c){var{cy:d,eles:f}=c,F=f.nodes(),T=f.nodes(":parent"),N=new Map,S=new Map,z=new Map,b=[],Q=[],it=[],_=[],ut=[],W=[],nt=[],h=[],w=void 0,E=void 0,D=1e8,m=0.000000001,{piTol:V,samplingType:H,nodeSeparation:j}=c,J=void 0,Z=function(){var st=0,lt=0,ft=!1;while(lt<J){st=Math.floor(Math.random()*E),ft=!1;for(var pt=0;pt<lt;pt++)if(_[pt]==st){ft=!0;break}if(!ft)_[lt]=st,lt++;else continue}},ct=function(st,lt,ft){var pt=[],Rt=0,Ot=0,gt=0,At=void 0,It=[],Tt=0,Ft=1;for(var Vt=0;Vt<E;Vt++)It[Vt]=D;pt[Ot]=st,It[st]=0;while(Ot>=Rt){gt=pt[Rt++];var Mt=b[gt];for(var Nt=0;Nt<Mt.length;Nt++)if(At=S.get(Mt[Nt]),It[At]==D)It[At]=It[gt]+1,pt[++Ot]=At;W[gt][lt]=It[gt]*j}if(ft){for(var St=0;St<E;St++)if(W[St][lt]<ut[St])ut[St]=W[St][lt];for(var Lt=0;Lt<E;Lt++)if(ut[Lt]>Tt)Tt=ut[Lt],Ft=Lt}return Ft},mt=function(st){var lt=void 0;if(!st){Z();for(var ft=0;ft<J;ft++)ct(_[ft],ft,st,!1)}else{lt=Math.floor(Math.random()*E),w=lt;for(var pt=0;pt<E;pt++)ut[pt]=D;for(var Rt=0;Rt<J;Rt++)_[Rt]=lt,lt=ct(lt,Rt,st)}for(var Ot=0;Ot<E;Ot++)for(var gt=0;gt<J;gt++)W[Ot][gt]*=W[Ot][gt];for(var At=0;At<J;At++)nt[At]=[];for(var It=0;It<J;It++)for(var Tt=0;Tt<J;Tt++)nt[It][Tt]=W[_[Tt]][It]},K=function(){var st=y.svd(nt),{S:lt,U:ft,V:pt}=st,Rt=lt[0]*lt[0]*lt[0],Ot=[];for(var gt=0;gt<J;gt++){Ot[gt]=[];for(var At=0;At<J;At++)if(Ot[gt][At]=0,gt==At)Ot[gt][At]=lt[gt]/(lt[gt]*lt[gt]+Rt/(lt[gt]*lt[gt]))}h=r.multMat(r.multMat(pt,Ot),r.transpose(ft))},yt=function(){var st=void 0,lt=void 0,ft=[],pt=[],Rt=[],Ot=[];for(var gt=0;gt<E;gt++)ft[gt]=Math.random(),pt[gt]=Math.random();ft=r.normalize(ft),pt=r.normalize(pt);var At=0,It=m,Tt=m,Ft=void 0;while(!0){At++;for(var Vt=0;Vt<E;Vt++)Rt[Vt]=ft[Vt];if(ft=r.multGamma(r.multL(r.multGamma(Rt),W,h)),st=r.dotProduct(Rt,ft),ft=r.normalize(ft),It=r.dotProduct(Rt,ft),Ft=Math.abs(It/Tt),Ft<=1+V&&Ft>=1)break;Tt=It}for(var Mt=0;Mt<E;Mt++)Rt[Mt]=ft[Mt];At=0,Tt=m;while(!0){At++;for(var Nt=0;Nt<E;Nt++)Ot[Nt]=pt[Nt];if(Ot=r.minusOp(Ot,r.multCons(Rt,r.dotProduct(Rt,Ot))),pt=r.multGamma(r.multL(r.multGamma(Ot),W,h)),lt=r.dotProduct(Ot,pt),pt=r.normalize(pt),It=r.dotProduct(Ot,pt),Ft=Math.abs(It/Tt),Ft<=1+V&&Ft>=1)break;Tt=It}for(var St=0;St<E;St++)Ot[St]=pt[St];Q=r.multCons(Rt,Math.sqrt(Math.abs(st))),it=r.multCons(Ot,Math.sqrt(Math.abs(lt)))};g.connectComponents(d,f,g.getTopMostNodes(F),N),T.forEach(function(ot){g.connectComponents(d,f,g.getTopMostNodes(ot.descendants().intersection(f)),N)});var ht=0;for(var U=0;U<F.length;U++)if(!F[U].isParent())S.set(F[U].id(),ht++);var rt=!0,at=!1,vt=void 0;try{for(var Ct=N.keys()[Symbol.iterator](),Ht;!(rt=(Ht=Ct.next()).done);rt=!0){var Kt=Ht.value;S.set(Kt,ht++)}}catch(ot){at=!0,vt=ot}finally{try{if(!rt&&Ct.return)Ct.return()}finally{if(at)throw vt}}for(var dt=0;dt<S.size;dt++)b[dt]=[];T.forEach(function(ot){var st=ot.children().intersection(f);while(st.nodes(":childless").length==0)st=st.nodes()[0].children().intersection(f);var lt=0,ft=st.nodes(":childless")[0].connectedEdges().length;st.nodes(":childless").forEach(function(pt,Rt){if(pt.connectedEdges().length<ft)ft=pt.connectedEdges().length,lt=Rt}),z.set(ot.id(),st.nodes(":childless")[lt].id())}),F.forEach(function(ot){var st=void 0;if(ot.isParent())st=S.get(z.get(ot.id()));else st=S.get(ot.id());ot.neighborhood().nodes().forEach(function(lt){if(f.intersection(ot.edgesWith(lt)).length>0)if(lt.isParent())b[st].push(z.get(lt.id()));else b[st].push(lt.id())})});var ie=function(st){var lt=S.get(st),ft=void 0;N.get(st).forEach(function(pt){if(d.getElementById(pt).isParent())ft=z.get(pt);else ft=pt;b[lt].push(ft),b[S.get(ft)].push(st)})},$t=!0,wt=!1,Et=void 0;try{for(var bt=N.keys()[Symbol.iterator](),Gt;!($t=(Gt=bt.next()).done);$t=!0){var Wt=Gt.value;ie(Wt)}}catch(ot){wt=!0,Et=ot}finally{try{if(!$t&&bt.return)bt.return()}finally{if(wt)throw Et}}E=S.size;var Ut=void 0;if(E>2){J=E<c.sampleSize?E:c.sampleSize;for(var Yt=0;Yt<E;Yt++)W[Yt]=[];for(var Bt=0;Bt<J;Bt++)h[Bt]=[];if(c.quality=="draft"||c.step=="all")mt(H),K(),yt(),Ut={nodeIndexes:S,xCoords:Q,yCoords:it};else S.forEach(function(ot,st){Q.push(d.getElementById(st).position("x")),it.push(d.getElementById(st).position("y"))}),Ut={nodeIndexes:S,xCoords:Q,yCoords:it};return Ut}else{var Qt=S.keys(),he=d.getElementById(Qt.next().value),te=he.position(),ne=he.outerWidth();if(Q.push(te.x),it.push(te.y),E==2){var _t=d.getElementById(Qt.next().value),et=_t.outerWidth();Q.push(te.x+ne/2+et/2+c.idealEdgeLength),it.push(te.y)}return Ut={nodeIndexes:S,xCoords:Q,yCoords:it},Ut}};s.exports={spectralLayout:i}},579:(s,a,o)=>{var g=o(212),r=function(i){if(!i)return;i("layout","fcose",g)};if(typeof cytoscape<"u")r(cytoscape);s.exports=r},140:(s)=>{s.exports=C}},x={};function v(s){var a=x[s];if(a!==void 0)return a.exports;var o=x[s]={exports:{}};return G[s](o,o.exports,v),o.exports}var l=v(579);return l})()})});var ar=Pe(Ke(),1);var je={L:"left",R:"right",T:"top",B:"bottom"},_e={L:e((C)=>`${C},${C/2} 0,${C} 0,0`,"L"),R:e((C)=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:e((C)=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:e((C)=>`${C/2},0 ${C},${C} 0,${C}`,"B")},xe={L:e((C,G)=>C-G+2,"L"),R:e((C,G)=>C-2,"R"),T:e((C,G)=>C-G+2,"T"),B:e((C,G)=>C-2,"B")},vr=e(function(C){if(se(C))return C==="L"?"R":"L";else return C==="T"?"B":"T"},"getOppositeArchitectureDirection"),tr=e(function(C){let G=C;return G==="L"||G==="R"||G==="T"||G==="B"},"isArchitectureDirection"),se=e(function(C){let G=C;return G==="L"||G==="R"},"isArchitectureDirectionX"),de=e(function(C){let G=C;return G==="T"||G==="B"},"isArchitectureDirectionY"),Be=e(function(C,G){let x=se(C)&&de(G),v=de(C)&&se(G);return x||v},"isArchitectureDirectionXY"),yr=e(function(C){let G=C[0],x=C[1],v=se(G)&&de(x),l=de(G)&&se(x);return v||l},"isArchitecturePairXY"),mr=e(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),ze=e(function(C,G){let x=`${C}${G}`;return mr(x)?x:void 0},"getArchitectureDirectionPair"),Er=e(function([C,G],x){let v=x[0],l=x[1];if(se(v))if(de(l))return[C+(v==="L"?-1:1),G+(l==="T"?1:-1)];else return[C+(v==="L"?-1:1),G];else if(se(l))return[C+(l==="L"?1:-1),G+(v==="T"?1:-1)];else return[C,G+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Tr=e(function(C){if(C==="LT"||C==="TL")return[1,1];else if(C==="BL"||C==="LB")return[1,-1];else if(C==="BR"||C==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),Nr=e(function(C,G){if(Be(C,G))return"bend";else if(se(C))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),Lr=e(function(C){return C.type==="service"},"isArchitectureService"),wr=e(function(C){return C.type==="junction"},"isArchitectureJunction"),er=e((C,G)=>{let[x,v]=[C,G].sort();return`${JSON.stringify(x)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),rr=e((C)=>C.data(),"edgeData"),Le=e((C)=>C.data(),"nodeData"),Mr=B.architecture,ir=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=L,this.getAccTitle=R,this.setDiagramTitle=P,this.getDiagramTitle=O,this.getAccDescription=M,this.setAccDescription=I,this.clear()}static{e(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",A()}addService({id:C,icon:G,in:x,title:v,iconText:l}){if(this.registeredIds.has(C))throw Error(`The service id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(x!==void 0){if(C===x)throw Error(`The service [${C}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(x)==="node")throw Error(`The service [${C}]'s parent is not a group`)}this.registeredIds.set(C,"node"),this.nodes.set(C,{id:C,type:"service",icon:G,iconText:l,title:v,edges:[],in:x})}getServices(){return[...this.nodes.values()].filter(Lr)}addJunction({id:C,in:G}){if(this.registeredIds.has(C))throw Error(`The junction id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(G!==void 0){if(C===G)throw Error(`The junction [${C}] cannot be placed within itself`);if(!this.registeredIds.has(G))throw Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(G)==="node")throw Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds.set(C,"node"),this.nodes.set(C,{id:C,type:"junction",edges:[],in:G})}getJunctions(){return[...this.nodes.values()].filter(wr)}getNodes(){return[...this.nodes.values()]}getNode(C){return this.nodes.get(C)??null}addGroup({id:C,icon:G,in:x,title:v}){if(this.registeredIds.has(C))throw Error(`The group id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(x!==void 0){if(C===x)throw Error(`The group [${C}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(x)==="node")throw Error(`The group [${C}]'s parent is not a group`)}this.registeredIds.set(C,"group"),this.groups.set(C,{id:C,icon:G,title:v,in:x})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:C,rhsId:G,lhsDir:x,rhsDir:v,lhsInto:l,rhsInto:s,lhsGroup:a,rhsGroup:o,title:g}){if(!tr(x))throw Error(`Invalid direction given for left hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(x)}`);if(!tr(v))throw Error(`Invalid direction given for right hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(C)&&!this.groups.has(C))throw Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(G)&&!this.groups.has(G))throw Error(`The right-hand id [${G}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(C).in,y=this.nodes.get(G).in;if(a&&r&&y&&r==y)throw Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(o&&r&&y&&r==y)throw Error(`The right-hand id [${G}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:C,lhsDir:x,lhsInto:l,lhsGroup:a,rhsId:G,rhsDir:v,rhsInto:s,rhsGroup:o,title:g};this.edges.push(i);let t=this.nodes.get(C),c=this.nodes.get(G);if(t&&c)t.edges.push(this.edges[this.edges.length-1]),c.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(C){if(C.members.length<2)throw Error(`An align directive requires at least two members; got ${C.members.length}`);let G=new Set;C.members.forEach((x)=>{if(this.registeredIds.get(x)!=="node")throw Error(`align ${C.direction} references [${x}], which is not a service or junction`);if(G.has(x))throw Error(`align ${C.direction} lists [${x}] more than once`);G.add(x)}),this.layoutHints.push(C)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let C=new Map,G=new Map;for(let[a,o]of this.nodes.entries()){let g=new Map;for(let r of o.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let t=Nr(r.lhsDir,r.rhsDir);if(t!=="bend")C.set(er(y,i),t)}if(r.lhsId===a){let t=ze(r.lhsDir,r.rhsDir);if(t)g.set(t,r.rhsId)}else{let t=ze(r.rhsDir,r.lhsDir);if(t)g.set(t,r.lhsId)}}G.set(a,g)}let x=new Set,v=new Set(G.keys()),l=e((a)=>{let o=new Map([[a,[0,0]]]),g=[a];while(g.length>0){let r=g.shift();if(r){x.add(r),v.delete(r);let y=G.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=o.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[t,c]=i;y.forEach((d,f)=>{if(!x.has(d))o.set(d,Er([t,c],f)),g.push(d)})}}return o},"BFS"),s=[];while(v.size>0){let a=v.values().next().value;s.push(l(a))}this.dataStructures={adjList:G,spatialMaps:s,groupAlignments:C}}return this.dataStructures}setElementForId(C,G){this.elements.set(C,G)}getElementById(C){return this.elements.get(C)}getConfig(){return Y({...Mr,...k().architecture})}getConfigField(C){return this.getConfig()[C]}},Cr=e((C,G)=>{ee(C,G),C.groups.map((x)=>G.addGroup(x)),C.services.map((x)=>G.addService({...x,type:"service"})),C.junctions.map((x)=>G.addJunction({...x,type:"junction"})),C.edges.map((x)=>G.addEdge(x)),C.alignments?.map((x)=>G.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),nr={parser:{yy:void 0},parse:e(async(C)=>{let G=await oe("architecture",C);n.debug(G);let x=nr.parser?.yy;if(!(x instanceof ir))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Cr(G,x)},"parse")},Ar=e((C)=>`
|
|
1
|
+
import{ee}from"./index.a7m06kba.js";import{e,n,B,k,q,kt,A,L,R,I,M,P,O,u,p,X,bs,pr,tt,K,Ve,De}from"./index.5sj251kq.js";import{oe}from"./index.3y8baz7q.js";import{xt}from"./index.d57x7pg9.js";import{Pe,We}from"./index.pg4f51t3.js";var Ue=We(function(we,Ge){(function(G,x){if(typeof we==="object"&&typeof Ge==="object")Ge.exports=x();else if(typeof define==="function"&&define.amd)define([],x);else if(typeof we==="object")we.layoutBase=x();else G.layoutBase=x()})(we,function(){return function(C){var G={};function x(v){if(G[v])return G[v].exports;var l=G[v]={i:v,l:!1,exports:{}};return C[v].call(l.exports,l,l.exports,x),l.l=!0,l.exports}return x.m=C,x.c=G,x.i=function(v){return v},x.d=function(v,l,s){if(!x.o(v,l))Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:s})},x.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return x.d(l,"a",l),l},x.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},x.p="",x(x.s=28)}([function(C,G,x){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v},function(C,G,x){var v=x(2),l=x(8),s=x(9);function a(g,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=g,this.target=r}a.prototype=Object.create(v.prototype);for(var o in v)a[o]=v[o];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;else if(this.target===g)return this.source;else throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(g,r){var y=this.getOtherEnd(g),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},a.prototype.updateLength=function(){var g=[,,,,];if(this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),g),!this.isOverlapingSourceAndTarget){if(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1)this.lengthX=s.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=s.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},a.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=s.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=s.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=a},function(C,G,x){function v(l){this.vGraphObject=l}C.exports=v},function(C,G,x){var v=x(2),l=x(10),s=x(13),a=x(0),o=x(16),g=x(5);function r(i,t,c,d){if(c==null&&d==null)d=t;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,c!=null&&t!=null)this.rect=new s(t.x,t.y,c.width,c.height);else this.rect=new s}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];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(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},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 g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new g(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(i,t){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=t.width,this.rect.height=t.height},r.prototype.setCenter=function(i,t){this.rect.x=i-this.rect.width/2,this.rect.y=t-this.rect.height/2},r.prototype.setLocation=function(i,t){this.rect.x=i,this.rect.y=t},r.prototype.moveBy=function(i,t){this.rect.x+=i,this.rect.y+=t},r.prototype.getEdgeListToNode=function(i){var t=[],c,d=this;return d.edges.forEach(function(f){if(f.target==i){if(f.source!=d)throw"Incorrect edge source!";t.push(f)}}),t},r.prototype.getEdgesBetween=function(i){var t=[],c,d=this;return d.edges.forEach(function(f){if(!(f.source==d||f.target==d))throw"Incorrect edge source and/or target";if(f.target==i||f.source==i)t.push(f)}),t},r.prototype.getNeighborsList=function(){var i=new Set,t=this;return t.edges.forEach(function(c){if(c.source==t)i.add(c.target);else{if(c.target!=t)throw"Incorrect incidency!";i.add(c.source)}}),i},r.prototype.withChildren=function(){var i=new Set,t,c;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var f=0;f<d.length;f++)t=d[f],c=t.withChildren(),c.forEach(function(F){i.add(F)})}return i},r.prototype.getNoOfChildren=function(){var i=0,t;if(this.child==null)i=1;else{var c=this.child.getNodes();for(var d=0;d<c.length;d++)t=c[d],i+=t.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},r.prototype.scatter=function(){var i,t,c=-a.INITIAL_WORLD_BOUNDARY,d=a.INITIAL_WORLD_BOUNDARY;i=a.WORLD_CENTER_X+o.nextDouble()*(d-c)+c;var f=-a.INITIAL_WORLD_BOUNDARY,F=a.INITIAL_WORLD_BOUNDARY;t=a.WORLD_CENTER_Y+o.nextDouble()*(F-f)+f,this.rect.x=i,this.rect.y=t},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),a.NODE_DIMENSIONS_INCLUDE_LABELS){var t=i.getRight()-i.getLeft(),c=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(t+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>t)this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(t+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(c+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>c)this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(c+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var t=this.rect.x;if(t>a.WORLD_BOUNDARY)t=a.WORLD_BOUNDARY;else if(t<-a.WORLD_BOUNDARY)t=-a.WORLD_BOUNDARY;var c=this.rect.y;if(c>a.WORLD_BOUNDARY)c=a.WORLD_BOUNDARY;else if(c<-a.WORLD_BOUNDARY)c=-a.WORLD_BOUNDARY;var d=new g(t,c),f=i.inverseTransformPoint(d);this.setLocation(f.x,f.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(){if(this.owner==null)return null;return this.owner.getParent()},C.exports=r},function(C,G,x){var v=x(0);function l(){}for(var s in v)l[s]=v[s];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=0.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=0.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,l.COOLING_ADAPTATION_FACTOR=0.33,l.ADAPTATION_LOWER_NODE_LIMIT=1000,l.ADAPTATION_UPPER_NODE_LIMIT=5000,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l},function(C,G,x){function v(l,s){if(l==null&&s==null)this.x=0,this.y=0;else this.x=l,this.y=s}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=v},function(C,G,x){var v=x(2),l=x(10),s=x(0),a=x(7),o=x(3),g=x(1),r=x(13),y=x(12),i=x(11);function t(d,f,F){if(v.call(this,F),this.estimatedSize=l.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,f!=null&&f instanceof a)this.graphManager=f;else if(f!=null&&f instanceof Layout)this.graphManager=f.graphManager}t.prototype=Object.create(v.prototype);for(var c in v)t[c]=v[c];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(d,f,F){if(f==null&&F==null){var T=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(T)>-1)throw"Node already in graph!";return T.owner=this,this.getNodes().push(T),T}else{var N=d;if(!(this.getNodes().indexOf(f)>-1&&this.getNodes().indexOf(F)>-1))throw"Source or target not in graph!";if(!(f.owner==F.owner&&f.owner==this))throw"Both owners must be this graph!";if(f.owner!=F.owner)return null;if(N.source=f,N.target=F,N.isInterGraph=!1,this.getEdges().push(N),f.edges.push(N),F!=f)F.edges.push(N);return N}},t.prototype.remove=function(d){var f=d;if(d instanceof o){if(f==null)throw"Node is null!";if(!(f.owner!=null&&f.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var F=f.edges.slice(),T,N=F.length;for(var S=0;S<N;S++)if(T=F[S],T.isInterGraph)this.graphManager.remove(T);else T.source.owner.remove(T);var V=this.nodes.indexOf(f);if(V==-1)throw"Node not in owner node list!";this.nodes.splice(V,1)}else if(d instanceof g){var T=d;if(T==null)throw"Edge is null!";if(!(T.source!=null&&T.target!=null))throw"Source and/or target is null!";if(!(T.source.owner!=null&&T.target.owner!=null&&T.source.owner==this&&T.target.owner==this))throw"Source and/or target owner is invalid!";var b=T.source.edges.indexOf(T),Z=T.target.edges.indexOf(T);if(!(b>-1&&Z>-1))throw"Source and/or target doesn't know this edge!";if(T.source.edges.splice(b,1),T.target!=T.source)T.target.edges.splice(Z,1);var V=T.source.owner.getEdges().indexOf(T);if(V==-1)throw"Not in owner's edge list!";T.source.owner.getEdges().splice(V,1)}},t.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:f}=l,F,T,N,S=this.getNodes(),V=S.length;for(var b=0;b<V;b++){var Z=S[b];if(F=Z.getTop(),T=Z.getLeft(),d>F)d=F;if(f>T)f=T}if(d==l.MAX_VALUE)return null;if(S[0].getParent().paddingLeft!=null)N=S[0].getParent().paddingLeft;else N=this.margin;return this.left=f-N,this.top=d-N,new y(this.left,this.top)},t.prototype.updateBounds=function(d){var f=l.MAX_VALUE,F=-l.MAX_VALUE,T=l.MAX_VALUE,N=-l.MAX_VALUE,S,V,b,Z,it,_=this.nodes,ut=_.length;for(var H=0;H<ut;H++){var nt=_[H];if(d&&nt.child!=null)nt.updateBounds();if(S=nt.getLeft(),V=nt.getRight(),b=nt.getTop(),Z=nt.getBottom(),f>S)f=S;if(F<V)F=V;if(T>b)T=b;if(N<Z)N=Z}var h=new r(f,T,F-f,N-T);if(f==l.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(_[0].getParent().paddingLeft!=null)it=_[0].getParent().paddingLeft;else it=this.margin;this.left=h.x-it,this.right=h.x+h.width+it,this.top=h.y-it,this.bottom=h.y+h.height+it},t.calculateBounds=function(d){var f=l.MAX_VALUE,F=-l.MAX_VALUE,T=l.MAX_VALUE,N=-l.MAX_VALUE,S,V,b,Z,it=d.length;for(var _=0;_<it;_++){var ut=d[_];if(S=ut.getLeft(),V=ut.getRight(),b=ut.getTop(),Z=ut.getBottom(),f>S)f=S;if(F<V)F=V;if(T>b)T=b;if(N<Z)N=Z}var H=new r(f,T,F-f,N-T);return H},t.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},t.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},t.prototype.calcEstimatedSize=function(){var d=0,f=this.nodes,F=f.length;for(var T=0;T<F;T++){var N=f[T];d+=N.calcEstimatedSize()}if(d==0)this.estimatedSize=s.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},t.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var f=new i,F=new Set,T=this.nodes[0],N,S,V=T.withChildren();V.forEach(function(H){f.push(H),F.add(H)});while(f.length!==0){T=f.shift(),N=T.getEdges();var b=N.length;for(var Z=0;Z<b;Z++){var it=N[Z];if(S=it.getOtherEndInGraph(T,this),S!=null&&!F.has(S)){var _=S.withChildren();_.forEach(function(H){f.push(H),F.add(H)})}}}if(this.isConnected=!1,F.size>=this.nodes.length){var ut=0;if(F.forEach(function(H){if(H.owner==d)ut++}),ut==this.nodes.length)this.isConnected=!0}},C.exports=t},function(C,G,x){var v,l=x(1);function s(a){v=x(6),this.layout=a,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var a=this.layout.newGraph(),o=this.layout.newNode(null),g=this.add(a,o);return this.setRootGraph(g),this.rootGraph},s.prototype.add=function(a,o,g,r,y){if(g==null&&r==null&&y==null){if(a==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(a)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(a),a.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return a.parent=o,o.child=a,a}else{y=g,r=o,g=a;var i=r.getOwner(),t=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(t!=null&&t.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==t)return g.isInterGraph=!1,i.add(g,r,y);else{if(g.isInterGraph=!0,g.source=r,g.target=y,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}}},s.prototype.remove=function(a){if(a instanceof v){var o=a;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(o.getEdges());var r,y=g.length;for(var i=0;i<y;i++)r=g[i],o.remove(r);var t=[];t=t.concat(o.getNodes());var c;y=t.length;for(var i=0;i<y;i++)c=t[i],o.remove(c);if(o==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(o);this.graphs.splice(d,1),o.parent=null}else if(a instanceof l){if(r=a,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},s.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},s.prototype.getGraphs=function(){return this.graphs},s.prototype.getAllNodes=function(){if(this.allNodes==null){var a=[],o=this.getGraphs(),g=o.length;for(var r=0;r<g;r++)a=a.concat(o[r].getNodes());this.allNodes=a}return this.allNodes},s.prototype.resetAllNodes=function(){this.allNodes=null},s.prototype.resetAllEdges=function(){this.allEdges=null},s.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},s.prototype.getAllEdges=function(){if(this.allEdges==null){var a=[],o=this.getGraphs(),g=o.length;for(var r=0;r<o.length;r++)a=a.concat(o[r].getEdges());a=a.concat(this.edges),this.allEdges=a}return this.allEdges},s.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},s.prototype.setAllNodesToApplyGravitation=function(a){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=a},s.prototype.getRoot=function(){return this.rootGraph},s.prototype.setRootGraph=function(a){if(a.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=a,a.parent==null)a.parent=this.layout.newNode("Root node")},s.prototype.getLayout=function(){return this.layout},s.prototype.isOneAncestorOfOther=function(a,o){if(!(a!=null&&o!=null))throw"assert failed";if(a==o)return!0;var g=a.getOwner(),r;do{if(r=g.getParent(),r==null)break;if(r==o)return!0;if(g=r.getOwner(),g==null)break}while(!0);g=o.getOwner();do{if(r=g.getParent(),r==null)break;if(r==a)return!0;if(g=r.getOwner(),g==null)break}while(!0);return!1},s.prototype.calcLowestCommonAncestors=function(){var a,o,g,r,y,i=this.getAllEdges(),t=i.length;for(var c=0;c<t;c++){if(a=i[c],o=a.source,g=a.target,a.lca=null,a.sourceInLca=o,a.targetInLca=g,o==g){a.lca=o.getOwner();continue}r=o.getOwner();while(a.lca==null){a.targetInLca=g,y=g.getOwner();while(a.lca==null){if(y==r){a.lca=y;break}if(y==this.rootGraph)break;if(a.lca!=null)throw"assert failed";a.targetInLca=y.getParent(),y=a.targetInLca.getOwner()}if(r==this.rootGraph)break;if(a.lca==null)a.sourceInLca=r.getParent(),r=a.sourceInLca.getOwner()}if(a.lca==null)throw"assert failed"}},s.prototype.calcLowestCommonAncestor=function(a,o){if(a==o)return a.getOwner();var g=a.getOwner();do{if(g==null)break;var r=o.getOwner();do{if(r==null)break;if(r==g)return r;r=r.getParent().getOwner()}while(!0);g=g.getParent().getOwner()}while(!0);return g},s.prototype.calcInclusionTreeDepths=function(a,o){if(a==null&&o==null)a=this.rootGraph,o=1;var g,r=a.getNodes(),y=r.length;for(var i=0;i<y;i++)if(g=r[i],g.inclusionTreeDepth=o,g.child!=null)this.calcInclusionTreeDepths(g.child,o+1)},s.prototype.includesInvalidEdge=function(){var a,o=[],g=this.edges.length;for(var r=0;r<g;r++)if(a=this.edges[r],this.isOneAncestorOfOther(a.source,a.target))o.push(a);for(var r=0;r<o.length;r++)this.remove(o[r]);return!1},C.exports=s},function(C,G,x){var v=x(12);function l(){}l.calcSeparationAmount=function(s,a,o,g){if(!s.intersects(a))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(s,a,r),o[0]=Math.min(s.getRight(),a.getRight())-Math.max(s.x,a.x),o[1]=Math.min(s.getBottom(),a.getBottom())-Math.max(s.y,a.y),s.getX()<=a.getX()&&s.getRight()>=a.getRight())o[0]+=Math.min(a.getX()-s.getX(),s.getRight()-a.getRight());else if(a.getX()<=s.getX()&&a.getRight()>=s.getRight())o[0]+=Math.min(s.getX()-a.getX(),a.getRight()-s.getRight());if(s.getY()<=a.getY()&&s.getBottom()>=a.getBottom())o[1]+=Math.min(a.getY()-s.getY(),s.getBottom()-a.getBottom());else if(a.getY()<=s.getY()&&a.getBottom()>=s.getBottom())o[1]+=Math.min(s.getY()-a.getY(),a.getBottom()-s.getBottom());var y=Math.abs((a.getCenterY()-s.getCenterY())/(a.getCenterX()-s.getCenterX()));if(a.getCenterY()===s.getCenterY()&&a.getCenterX()===s.getCenterX())y=1;var i=y*o[0],t=o[1]/y;if(o[0]<t)t=o[0];else i=o[1];o[0]=-1*r[0]*(t/2+g),o[1]=-1*r[1]*(i/2+g)},l.decideDirectionsForOverlappingNodes=function(s,a,o){if(s.getCenterX()<a.getCenterX())o[0]=-1;else o[0]=1;if(s.getCenterY()<a.getCenterY())o[1]=-1;else o[1]=1},l.getIntersection2=function(s,a,o){var g=s.getCenterX(),r=s.getCenterY(),y=a.getCenterX(),i=a.getCenterY();if(s.intersects(a))return o[0]=g,o[1]=r,o[2]=y,o[3]=i,!0;var t=s.getX(),c=s.getY(),d=s.getRight(),f=s.getX(),F=s.getBottom(),T=s.getRight(),N=s.getWidthHalf(),S=s.getHeightHalf(),V=a.getX(),b=a.getY(),Z=a.getRight(),it=a.getX(),_=a.getBottom(),ut=a.getRight(),H=a.getWidthHalf(),nt=a.getHeightHalf(),h=!1,w=!1;if(g===y){if(r>i)return o[0]=g,o[1]=c,o[2]=y,o[3]=_,!1;else if(r<i)return o[0]=g,o[1]=F,o[2]=y,o[3]=b,!1}else if(r===i){if(g>y)return o[0]=t,o[1]=r,o[2]=Z,o[3]=i,!1;else if(g<y)return o[0]=d,o[1]=r,o[2]=V,o[3]=i,!1}else{var E=s.height/s.width,D=a.height/a.width,m=(i-r)/(y-g),W=void 0,Y=void 0,j=void 0,Q=void 0,z=void 0,ct=void 0;if(-E===m)if(g>y)o[0]=f,o[1]=F,h=!0;else o[0]=d,o[1]=c,h=!0;else if(E===m)if(g>y)o[0]=t,o[1]=c,h=!0;else o[0]=T,o[1]=F,h=!0;if(-D===m)if(y>g)o[2]=it,o[3]=_,w=!0;else o[2]=Z,o[3]=b,w=!0;else if(D===m)if(y>g)o[2]=V,o[3]=b,w=!0;else o[2]=ut,o[3]=_,w=!0;if(h&&w)return!1;if(g>y)if(r>i)W=this.getCardinalDirection(E,m,4),Y=this.getCardinalDirection(D,m,2);else W=this.getCardinalDirection(-E,m,3),Y=this.getCardinalDirection(-D,m,1);else if(r>i)W=this.getCardinalDirection(-E,m,1),Y=this.getCardinalDirection(-D,m,3);else W=this.getCardinalDirection(E,m,2),Y=this.getCardinalDirection(D,m,4);if(!h)switch(W){case 1:Q=c,j=g+-S/m,o[0]=j,o[1]=Q;break;case 2:j=T,Q=r+N*m,o[0]=j,o[1]=Q;break;case 3:Q=F,j=g+S/m,o[0]=j,o[1]=Q;break;case 4:j=f,Q=r+-N*m,o[0]=j,o[1]=Q;break}if(!w)switch(Y){case 1:ct=b,z=y+-nt/m,o[2]=z,o[3]=ct;break;case 2:z=ut,ct=i+H*m,o[2]=z,o[3]=ct;break;case 3:ct=_,z=y+nt/m,o[2]=z,o[3]=ct;break;case 4:z=it,ct=i+-H*m,o[2]=z,o[3]=ct;break}}return!1},l.getCardinalDirection=function(s,a,o){if(s>a)return o;else return 1+o%4},l.getIntersection=function(s,a,o,g){if(g==null)return this.getIntersection2(s,a,o);var{x:r,y}=s,{x:i,y:t}=a,{x:c,y:d}=o,{x:f,y:F}=g,T=void 0,N=void 0,S=void 0,V=void 0,b=void 0,Z=void 0,it=void 0,_=void 0,ut=void 0;if(S=t-y,b=r-i,it=i*y-r*t,V=F-d,Z=c-f,_=f*d-c*F,ut=S*Z-V*b,ut===0)return null;return T=(b*_-Z*it)/ut,N=(V*it-S*_)/ut,new v(T,N)},l.angleOfVector=function(s,a,o,g){var r=void 0;if(s!==o){if(r=Math.atan((g-a)/(o-s)),o<s)r+=Math.PI;else if(g<a)r+=this.TWO_PI}else if(g<a)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},l.doIntersect=function(s,a,o,g){var{x:r,y}=s,{x:i,y:t}=a,{x:c,y:d}=o,{x:f,y:F}=g,T=(i-r)*(F-d)-(f-c)*(t-y);if(T===0)return!1;else{var N=((F-d)*(f-r)+(c-f)*(F-y))/T,S=((y-t)*(f-r)+(i-r)*(F-y))/T;return 0<N&&N<1&&0<S&&S<1}},l.findCircleLineIntersections=function(s,a,o,g,r,y,i){var t=(o-s)*(o-s)+(g-a)*(g-a),c=2*((s-r)*(o-s)+(a-y)*(g-a)),d=(s-r)*(s-r)+(a-y)*(a-y)-i*i,f=c*c-4*t*d;if(f>=0){var F=(-c+Math.sqrt(c*c-4*t*d))/(2*t),T=(-c-Math.sqrt(c*c-4*t*d))/(2*t),N=null;if(F>=0&&F<=1)return[F];if(T>=0&&T<=1)return[T];return N}else return null},l.HALF_PI=0.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l},function(C,G,x){function v(){}v.sign=function(l){if(l>0)return 1;else if(l<0)return-1;else return 0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=v},function(C,G,x){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v},function(C,G,x){var v=function(){function r(y,i){for(var t=0;t<i.length;t++){var c=i[t];if(c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c)c.writable=!0;Object.defineProperty(y,c.key,c)}}return function(y,i,t){if(i)r(y.prototype,i);if(t)r(y,t);return y}}();function l(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var s=function(y){return{value:y,next:null,prev:null}},a=function(y,i,t,c){if(y!==null)y.next=i;else c.head=i;if(t!==null)t.prev=i;else c.tail=i;return i.prev=y,i.next=t,c.length++,i},o=function(y,i){var{prev:t,next:c}=y;if(t!==null)t.next=c;else i.head=c;if(c!==null)c.prev=t;else i.tail=t;return y.prev=y.next=null,i.length--,y},g=function(){function r(y){var i=this;if(l(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(t){return i.push(t)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,t){return a(t.prev,s(i),t,this)}},{key:"insertAfter",value:function(i,t){return a(t,s(i),t.next,this)}},{key:"insertNodeBefore",value:function(i,t){return a(t.prev,i,t,this)}},{key:"insertNodeAfter",value:function(i,t){return a(t,i,t.next,this)}},{key:"push",value:function(i){return a(this.tail,s(i),null,this)}},{key:"unshift",value:function(i){return a(null,s(i),this.head,this)}},{key:"remove",value:function(i){return o(i,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){var t=1,c=this.head;while(t<i)c=c.next,t++;return c.value}}},{key:"set_object_at",value:function(i,t){if(i<=this.length()){var c=1,d=this.head;while(c<i)d=d.next,c++;d.value=t}}}]),r}();C.exports=g},function(C,G,x){function v(l,s,a){if(this.x=null,this.y=null,l==null&&s==null&&a==null)this.x=0,this.y=0;else if(typeof l=="number"&&typeof s=="number"&&a==null)this.x=l,this.y=s;else if(l.constructor.name=="Point"&&s==null&&a==null)a=l,this.x=a.x,this.y=a.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(l,s,a){if(l.constructor.name=="Point"&&s==null&&a==null)a=l,this.setLocation(a.x,a.y);else if(typeof l=="number"&&typeof s=="number"&&a==null)if(parseInt(l)==l&&parseInt(s)==s)this.move(l,s);else this.x=Math.floor(l+0.5),this.y=Math.floor(s+0.5)},v.prototype.move=function(l,s){this.x=l,this.y=s},v.prototype.translate=function(l,s){this.x+=l,this.y+=s},v.prototype.equals=function(l){if(l.constructor.name=="Point"){var s=l;return this.x==s.x&&this.y==s.y}return this==l},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},C.exports=v},function(C,G,x){function v(l,s,a,o){if(this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&s!=null&&a!=null&&o!=null)this.x=l,this.y=s,this.width=a,this.height=o}v.prototype.getX=function(){return this.x},v.prototype.setX=function(l){this.x=l},v.prototype.getY=function(){return this.y},v.prototype.setY=function(l){this.y=l},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(l){if(this.getRight()<l.x)return!1;if(this.getBottom()<l.y)return!1;if(l.getRight()<this.x)return!1;if(l.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},C.exports=v},function(C,G,x){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol==="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function l(){}l.lastID=0,l.createID=function(s){if(l.isPrimitive(s))return s;if(s.uniqueID!=null)return s.uniqueID;return s.uniqueID=l.getString(),l.lastID++,s.uniqueID},l.getString=function(s){if(s==null)s=l.lastID;return"Object#"+s},l.isPrimitive=function(s){var a=typeof s>"u"?"undefined":v(s);return s==null||a!="object"&&a!="function"},C.exports=l},function(C,G,x){function v(c){if(Array.isArray(c)){for(var d=0,f=Array(c.length);d<c.length;d++)f[d]=c[d];return f}else return Array.from(c)}var l=x(0),s=x(7),a=x(3),o=x(1),g=x(6),r=x(5),y=x(17),i=x(29);function t(c){if(i.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new s(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null)this.isRemoteUse=c}t.RANDOM_SEED=1,t.prototype=Object.create(i.prototype),t.prototype.getGraphManager=function(){return this.graphManager},t.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},t.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},t.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},t.prototype.newGraphManager=function(){var c=new s(this);return this.graphManager=c,c},t.prototype.newGraph=function(c){return new g(null,this.graphManager,c)},t.prototype.newNode=function(c){return new a(this.graphManager,c)},t.prototype.newEdge=function(c){return new o(null,null,c)},t.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},t.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var c;if(this.checkLayoutSuccess())c=!1;else c=this.layout();if(l.ANIMATE==="during")return!1;if(c){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,c},t.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},t.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var c,d=this.graphManager.getAllEdges();for(var f=0;f<d.length;f++)c=d[f];var F,T=this.graphManager.getRoot().getNodes();for(var f=0;f<T.length;f++)F=T[f];this.update(this.graphManager.getRoot())}},t.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof a){var d=c;if(d.getChild()!=null){var f=d.getChild().getNodes();for(var F=0;F<f.length;F++)update(f[F])}if(d.vGraphObject!=null){var T=d.vGraphObject;T.update(d)}}else if(c instanceof o){var N=c;if(N.vGraphObject!=null){var S=N.vGraphObject;S.update(N)}}else if(c instanceof g){var V=c;if(V.vGraphObject!=null){var b=V.vGraphObject;b.update(V)}}},t.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},t.prototype.transform=function(c){if(c==null)this.transform(new r(0,0));else{var d=new y,f=this.graphManager.getRoot().updateLeftTop();if(f!=null){d.setWorldOrgX(c.x),d.setWorldOrgY(c.y),d.setDeviceOrgX(f.x),d.setDeviceOrgY(f.y);var F=this.getAllNodes(),T;for(var N=0;N<F.length;N++)T=F[N],T.transform(d)}}},t.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,f,F=c.getNodes();for(var T=0;T<F.length;T++)if(d=F[T],f=d.getChild(),f==null)d.scatter();else if(f.getNodes().length==0)d.scatter();else this.positionNodesRandomly(f),d.updateBounds()}},t.prototype.getFlatForest=function(){var c=[],d=!0,f=this.graphManager.getRoot().getNodes(),F=!0;for(var T=0;T<f.length;T++)if(f[T].getChild()!=null)F=!1;if(!F)return c;var N=new Set,S=[],V=new Map,b=[];b=b.concat(f);while(b.length>0&&d){S.push(b[0]);while(S.length>0&&d){var Z=S[0];S.splice(0,1),N.add(Z);var it=Z.getEdges();for(var T=0;T<it.length;T++){var _=it[T].getOtherEnd(Z);if(V.get(Z)!=_)if(!N.has(_))S.push(_),V.set(_,Z);else{d=!1;break}}}if(!d)c=[];else{var ut=[].concat(v(N));c.push(ut);for(var T=0;T<ut.length;T++){var H=ut[T],nt=b.indexOf(H);if(nt>-1)b.splice(nt,1)}N=new Set,V=new Map}}return c},t.prototype.createDummyNodesForBendpoints=function(c){var d=[],f=c.source,F=this.graphManager.calcLowestCommonAncestor(c.source,c.target);for(var T=0;T<c.bendpoints.length;T++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),F.add(N);var S=this.newEdge(null);this.graphManager.add(S,f,N),d.add(N),f=N}var S=this.newEdge(null);if(this.graphManager.add(S,f,c.target),this.edgeToDummyNodes.set(c,d),c.isInterGraph())this.graphManager.remove(c);else F.remove(c);return d},t.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(v(this.edgeToDummyNodes.keys())).concat(c);for(var d=0;d<c.length;d++){var f=c[d];if(f.bendpoints.length>0){var F=this.edgeToDummyNodes.get(f);for(var T=0;T<F.length;T++){var N=F[T],S=new r(N.getCenterX(),N.getCenterY()),V=f.bendpoints.get(T);V.x=S.x,V.y=S.y,N.getOwner().remove(N)}this.graphManager.add(f,f.source,f.target)}}},t.transform=function(c,d,f,F){if(f!=null&&F!=null){var T=d;if(c<=50){var N=d/f;T-=(d-N)/50*(50-c)}else{var S=d*F;T+=(S-d)/50*(c-50)}return T}else{var V,b;if(c<=50)V=9*d/500,b=d/10;else V=9*d/50,b=-8*d;return V*c+b}},t.findCenterOfTree=function(c){var d=[];d=d.concat(c);var f=[],F=new Map,T=!1,N=null;if(d.length==1||d.length==2)T=!0,N=d[0];for(var S=0;S<d.length;S++){var V=d[S],b=V.getNeighborsList().size;if(F.set(V,V.getNeighborsList().size),b==1)f.push(V)}var Z=[];Z=Z.concat(f);while(!T){var it=[];it=it.concat(Z),Z=[];for(var S=0;S<d.length;S++){var V=d[S],_=d.indexOf(V);if(_>=0)d.splice(_,1);var ut=V.getNeighborsList();ut.forEach(function(h){if(f.indexOf(h)<0){var w=F.get(h),E=w-1;if(E==1)Z.push(h);F.set(h,E)}})}if(f=f.concat(Z),d.length==1||d.length==2)T=!0,N=d[0]}return N},t.prototype.setGraphManager=function(c){this.graphManager=c},C.exports=t},function(C,G,x){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v},function(C,G,x){var v=x(5);function l(s,a){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.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(s){this.lworldExtX=s},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(s){this.lworldExtY=s},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},l.prototype.transformX=function(s){var a=0,o=this.lworldExtX;if(o!=0)a=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/o;return a},l.prototype.transformY=function(s){var a=0,o=this.lworldExtY;if(o!=0)a=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/o;return a},l.prototype.inverseTransformX=function(s){var a=0,o=this.ldeviceExtX;if(o!=0)a=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/o;return a},l.prototype.inverseTransformY=function(s){var a=0,o=this.ldeviceExtY;if(o!=0)a=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/o;return a},l.prototype.inverseTransformPoint=function(s){var a=new v(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return a},C.exports=l},function(C,G,x){function v(i){if(Array.isArray(i)){for(var t=0,c=Array(i.length);t<i.length;t++)c[t]=i[t];return c}else return Array.from(i)}var l=x(15),s=x(4),a=x(0),o=x(8),g=x(9);function r(){l.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}r.prototype=Object.create(l.prototype);for(var y in l)r[y]=l[y];r.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,t,c,d,f,F,T,N=this.getGraphManager().getAllEdges();for(var S=0;S<N.length;S++)if(i=N[S],t=i.idealLength,i.isInterGraph){if(d=i.getSource(),f=i.getTarget(),F=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=F+T-2*a.SIMPLE_NODE_SIZE;c=i.getLca().getInclusionTreeDepth(),i.idealLength+=t*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*c)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>s.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>s.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(i-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),t;for(var c=0;c<i.length;c++)t=i[c],this.calcSpringForce(t,t.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c,d,f,F,T=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();N=new Set;for(c=0;c<T.length;c++)f=T[c],this.calculateRepulsionForceOfANode(f,N,i,t),N.add(f)}else for(c=0;c<T.length;c++){f=T[c];for(d=c+1;d<T.length;d++){if(F=T[d],f.getOwner()!=F.getOwner())continue;this.calcRepulsionForce(f,F)}}},r.prototype.calcGravitationalForces=function(){var i,t=this.getAllNodesToApplyGravitation();for(var c=0;c<t.length;c++)i=t[c],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),t;for(var c=0;c<i.length;c++)t=i[c],t.move()},r.prototype.calcSpringForce=function(i,t){var c=i.getSource(),d=i.getTarget(),f,F,T,N;if(this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(f=i.getLength(),f==0)return;F=i.edgeElasticity*(f-t),T=F*(i.lengthX/f),N=F*(i.lengthY/f),c.springForceX+=T,c.springForceY+=N,d.springForceX-=T,d.springForceY-=N},r.prototype.calcRepulsionForce=function(i,t){var c=i.getRect(),d=t.getRect(),f=[,,],F=[,,,,],T,N,S,V,b,Z,it;if(c.intersects(d)){o.calcSeparationAmount(c,d,f,s.DEFAULT_EDGE_LENGTH/2),Z=2*f[0],it=2*f[1];var _=i.noOfChildren*t.noOfChildren/(i.noOfChildren+t.noOfChildren);i.repulsionForceX-=_*Z,i.repulsionForceY-=_*it,t.repulsionForceX+=_*Z,t.repulsionForceY+=_*it}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&t.getChild()==null)T=d.getCenterX()-c.getCenterX(),N=d.getCenterY()-c.getCenterY();else o.getIntersection(c,d,F),T=F[2]-F[0],N=F[3]-F[1];if(Math.abs(T)<s.MIN_REPULSION_DIST)T=g.sign(T)*s.MIN_REPULSION_DIST;if(Math.abs(N)<s.MIN_REPULSION_DIST)N=g.sign(N)*s.MIN_REPULSION_DIST;S=T*T+N*N,V=Math.sqrt(S),b=(i.nodeRepulsion/2+t.nodeRepulsion/2)*i.noOfChildren*t.noOfChildren/S,Z=b*T/V,it=b*N/V,i.repulsionForceX-=Z,i.repulsionForceY-=it,t.repulsionForceX+=Z,t.repulsionForceY+=it}},r.prototype.calcGravitationalForce=function(i){var t,c,d,f,F,T,N,S;if(t=i.getOwner(),c=(t.getRight()+t.getLeft())/2,d=(t.getTop()+t.getBottom())/2,f=i.getCenterX()-c,F=i.getCenterY()-d,T=Math.abs(f)+i.getWidth()/2,N=Math.abs(F)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(S=t.getEstimatedSize()*this.gravityRangeFactor,T>S||N>S)i.gravitationForceX=-this.gravityConstant*f,i.gravitationForceY=-this.gravityConstant*F}else if(S=t.getEstimatedSize()*this.compoundGravityRangeFactor,T>S||N>S)i.gravitationForceX=-this.gravityConstant*f*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*F*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,t=!1;if(this.totalIterations>this.maxIterations/3)t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||t},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,t=this.graphManager.getAllNodes();for(var c=0;c<t.length;c++)i=t[c],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var t=0,c=0;t=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(t);for(var f=0;f<t;f++)d[f]=Array(c);for(var f=0;f<t;f++)for(var F=0;F<c;F++)d[f][F]=[];return d},r.prototype.addNodeToGrid=function(i,t,c){var d=0,f=0,F=0,T=0;d=parseInt(Math.floor((i.getRect().x-t)/this.repulsionRange)),f=parseInt(Math.floor((i.getRect().width+i.getRect().x-t)/this.repulsionRange)),F=parseInt(Math.floor((i.getRect().y-c)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().height+i.getRect().y-c)/this.repulsionRange));for(var N=d;N<=f;N++)for(var S=F;S<=T;S++)this.grid[N][S].push(i),i.setGridCoordinates(d,f,F,T)},r.prototype.updateGrid=function(){var i,t,c=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<c.length;i++)t=c[i],this.addNodeToGrid(t,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,t,c,d){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var f=new Set;i.surrounding=[];var F,T=this.grid;for(var N=i.startX-1;N<i.finishX+2;N++)for(var S=i.startY-1;S<i.finishY+2;S++)if(!(N<0||S<0||N>=T.length||S>=T[0].length))for(var V=0;V<T[N][S].length;V++){if(F=T[N][S][V],i.getOwner()!=F.getOwner()||i==F)continue;if(!t.has(F)&&!f.has(F)){var b=Math.abs(i.getCenterX()-F.getCenterX())-(i.getWidth()/2+F.getWidth()/2),Z=Math.abs(i.getCenterY()-F.getCenterY())-(i.getHeight()/2+F.getHeight()/2);if(b<=this.repulsionRange&&Z<=this.repulsionRange)f.add(F)}}i.surrounding=[].concat(v(f))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},r.prototype.calcRepulsionRange=function(){return 0},C.exports=r},function(C,G,x){var v=x(1),l=x(4);function s(o,g,r){v.call(this,o,g,r),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}s.prototype=Object.create(v.prototype);for(var a in v)s[a]=v[a];C.exports=s},function(C,G,x){var v=x(3),l=x(4);function s(o,g,r,y){v.call(this,o,g,r,y),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}s.prototype=Object.create(v.prototype);for(var a in v)s[a]=v[a];s.prototype.setGridCoordinates=function(o,g,r,y){this.startX=o,this.finishX=g,this.startY=r,this.finishY=y},C.exports=s},function(C,G,x){function v(l,s){if(this.width=0,this.height=0,l!==null&&s!==null)this.height=s,this.width=l}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},C.exports=v},function(C,G,x){var v=x(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(s,a){var o=v.createID(s);if(!this.contains(o))this.map[o]=a,this.keys.push(s)},l.prototype.contains=function(s){var a=v.createID(s);return this.map[s]!=null},l.prototype.get=function(s){var a=v.createID(s);return this.map[a]},l.prototype.keySet=function(){return this.keys},C.exports=l},function(C,G,x){var v=x(14);function l(){this.set={}}l.prototype.add=function(s){var a=v.createID(s);if(!this.contains(a))this.set[a]=s},l.prototype.remove=function(s){delete this.set[v.createID(s)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(s){return this.set[v.createID(s)]==s},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(s){var a=Object.keys(this.set),o=a.length;for(var g=0;g<o;g++)s.push(this.set[a[g]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(s){var a=s.length;for(var o=0;o<a;o++){var g=s[o];this.add(g)}},C.exports=l},function(C,G,x){function v(){}v.multMat=function(l,s){var a=[];for(var o=0;o<l.length;o++){a[o]=[];for(var g=0;g<s[0].length;g++){a[o][g]=0;for(var r=0;r<l[0].length;r++)a[o][g]+=l[o][r]*s[r][g]}}return a},v.transpose=function(l){var s=[];for(var a=0;a<l[0].length;a++){s[a]=[];for(var o=0;o<l.length;o++)s[a][o]=l[o][a]}return s},v.multCons=function(l,s){var a=[];for(var o=0;o<l.length;o++)a[o]=l[o]*s;return a},v.minusOp=function(l,s){var a=[];for(var o=0;o<l.length;o++)a[o]=l[o]-s[o];return a},v.dotProduct=function(l,s){var a=0;for(var o=0;o<l.length;o++)a+=l[o]*s[o];return a},v.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},v.normalize=function(l){var s=[],a=this.mag(l);for(var o=0;o<l.length;o++)s[o]=l[o]/a;return s},v.multGamma=function(l){var s=[],a=0;for(var o=0;o<l.length;o++)a+=l[o];a*=-1/l.length;for(var g=0;g<l.length;g++)s[g]=a+l[g];return s},v.multL=function(l,s,a){var o=[],g=[],r=[];for(var y=0;y<s[0].length;y++){var i=0;for(var t=0;t<s.length;t++)i+=-0.5*s[t][y]*l[t];g[y]=i}for(var c=0;c<a.length;c++){var d=0;for(var f=0;f<a.length;f++)d+=a[c][f]*g[f];r[c]=d}for(var F=0;F<s.length;F++){var T=0;for(var N=0;N<s[0].length;N++)T+=s[F][N]*r[N];o[F]=T}return o},C.exports=v},function(C,G,x){var v=function(){function o(g,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(g,i.key,i)}}return function(g,r,y){if(r)o(g.prototype,r);if(y)o(g,y);return g}}();function l(o,g){if(!(o instanceof g))throw TypeError("Cannot call a class as a function")}var s=x(11),a=function(){function o(g,r){if(l(this,o),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(g instanceof s)y=g.size();else y=g.length;this._quicksort(g,0,y-1)}return v(o,[{key:"_quicksort",value:function(r,y,i){if(y<i){var t=this._partition(r,y,i);this._quicksort(r,y,t),this._quicksort(r,t+1,i)}}},{key:"_partition",value:function(r,y,i){var t=this._get(r,y),c=y,d=i;while(!0){while(this.compareFunction(t,this._get(r,d)))d--;while(this.compareFunction(this._get(r,c),t))c++;if(c<d)this._swap(r,c,d),c++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof s)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof s)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var t=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,t)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),o}();C.exports=a},function(C,G,x){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var s=Math.min(this.m,this.n);this.s=function(Zt){var Xt=[];while(Zt-- >0)Xt.push(0);return Xt}(Math.min(this.m+1,this.n)),this.U=function(Zt){var Xt=function ge(Jt){if(Jt.length==0)return 0;else{var ae=[];for(var fe=0;fe<Jt[0];fe++)ae.push(ge(Jt.slice(1)));return ae}};return Xt(Zt)}([this.m,s]),this.V=function(Zt){var Xt=function ge(Jt){if(Jt.length==0)return 0;else{var ae=[];for(var fe=0;fe<Jt[0];fe++)ae.push(ge(Jt.slice(1)));return ae}};return Xt(Zt)}([this.n,this.n]);var a=function(Zt){var Xt=[];while(Zt-- >0)Xt.push(0);return Xt}(this.n),o=function(Zt){var Xt=[];while(Zt-- >0)Xt.push(0);return Xt}(this.m),g=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var t=0;t<Math.max(y,i);t++){if(t<y){this.s[t]=0;for(var c=t;c<this.m;c++)this.s[t]=v.hypot(this.s[t],l[c][t]);if(this.s[t]!==0){if(l[t][t]<0)this.s[t]=-this.s[t];for(var d=t;d<this.m;d++)l[d][t]/=this.s[t];l[t][t]+=1}this.s[t]=-this.s[t]}for(var f=t+1;f<this.n;f++){if(function(Zt,Xt){return Zt&&Xt}(t<y,this.s[t]!==0)){var F=0;for(var T=t;T<this.m;T++)F+=l[T][t]*l[T][f];F=-F/l[t][t];for(var N=t;N<this.m;N++)l[N][f]+=F*l[N][t]}a[f]=l[t][f]}if(function(Zt,Xt){return Zt&&Xt}(g,t<y))for(var S=t;S<this.m;S++)this.U[S][t]=l[S][t];if(t<i){a[t]=0;for(var V=t+1;V<this.n;V++)a[t]=v.hypot(a[t],a[V]);if(a[t]!==0){if(a[t+1]<0)a[t]=-a[t];for(var b=t+1;b<this.n;b++)a[b]/=a[t];a[t+1]+=1}if(a[t]=-a[t],function(Zt,Xt){return Zt&&Xt}(t+1<this.m,a[t]!==0)){for(var Z=t+1;Z<this.m;Z++)o[Z]=0;for(var it=t+1;it<this.n;it++)for(var _=t+1;_<this.m;_++)o[_]+=a[it]*l[_][it];for(var ut=t+1;ut<this.n;ut++){var H=-a[ut]/a[t+1];for(var nt=t+1;nt<this.m;nt++)l[nt][ut]+=H*o[nt]}}if(r)for(var h=t+1;h<this.n;h++)this.V[h][t]=a[h]}}var w=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=l[y][y];if(this.m<w)this.s[w-1]=0;if(i+1<w)a[i]=l[i][w-1];if(a[w-1]=0,g){for(var E=y;E<s;E++){for(var D=0;D<this.m;D++)this.U[D][E]=0;this.U[E][E]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var W=m+1;W<s;W++){var Y=0;for(var j=m;j<this.m;j++)Y+=this.U[j][m]*this.U[j][W];Y=-Y/this.U[m][m];for(var Q=m;Q<this.m;Q++)this.U[Q][W]+=Y*this.U[Q][m]}for(var z=m;z<this.m;z++)this.U[z][m]=-this.U[z][m];this.U[m][m]=1+this.U[m][m];for(var ct=0;ct<m-1;ct++)this.U[ct][m]=0}else{for(var mt=0;mt<this.m;mt++)this.U[mt][m]=0;this.U[m][m]=1}}if(r)for(var J=this.n-1;J>=0;J--){if(function(Zt,Xt){return Zt&&Xt}(J<i,a[J]!==0))for(var yt=J+1;yt<s;yt++){var ht=0;for(var U=J+1;U<this.n;U++)ht+=this.V[U][J]*this.V[U][yt];ht=-ht/this.V[J+1][J];for(var rt=J+1;rt<this.n;rt++)this.V[rt][yt]+=ht*this.V[rt][J]}for(var at=0;at<this.n;at++)this.V[at][J]=0;this.V[J][J]=1}var vt=w-1,Ct=0,Ht=Math.pow(2,-52),Kt=Math.pow(2,-966);while(w>0){var dt=void 0,ie=void 0;for(dt=w-2;dt>=-1;dt--){if(dt===-1)break;if(Math.abs(a[dt])<=Kt+Ht*(Math.abs(this.s[dt])+Math.abs(this.s[dt+1]))){a[dt]=0;break}}if(dt===w-2)ie=4;else{var $t=void 0;for($t=w-1;$t>=dt;$t--){if($t===dt)break;var wt=($t!==w?Math.abs(a[$t]):0)+($t!==dt+1?Math.abs(a[$t-1]):0);if(Math.abs(this.s[$t])<=Kt+Ht*wt){this.s[$t]=0;break}}if($t===dt)ie=3;else if($t===w-1)ie=1;else ie=2,dt=$t}switch(dt++,ie){case 1:{var Et=a[w-2];a[w-2]=0;for(var bt=w-2;bt>=dt;bt--){var Gt=v.hypot(this.s[bt],Et),Wt=this.s[bt]/Gt,Ut=Et/Gt;if(this.s[bt]=Gt,bt!==dt)Et=-Ut*a[bt-1],a[bt-1]=Wt*a[bt-1];if(r)for(var Yt=0;Yt<this.n;Yt++)Gt=Wt*this.V[Yt][bt]+Ut*this.V[Yt][w-1],this.V[Yt][w-1]=-Ut*this.V[Yt][bt]+Wt*this.V[Yt][w-1],this.V[Yt][bt]=Gt}}break;case 2:{var Bt=a[dt-1];a[dt-1]=0;for(var Qt=dt;Qt<w;Qt++){var he=v.hypot(this.s[Qt],Bt),te=this.s[Qt]/he,ne=Bt/he;if(this.s[Qt]=he,Bt=-ne*a[Qt],a[Qt]=te*a[Qt],g)for(var _t=0;_t<this.m;_t++)he=te*this.U[_t][Qt]+ne*this.U[_t][dt-1],this.U[_t][dt-1]=-ne*this.U[_t][Qt]+te*this.U[_t][dt-1],this.U[_t][Qt]=he}}break;case 3:{var et=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[w-1]),Math.abs(this.s[w-2])),Math.abs(a[w-2])),Math.abs(this.s[dt])),Math.abs(a[dt])),ot=this.s[w-1]/et,st=this.s[w-2]/et,lt=a[w-2]/et,ft=this.s[dt]/et,pt=a[dt]/et,Rt=((st+ot)*(st-ot)+lt*lt)/2,Ot=ot*lt*(ot*lt),gt=0;if(function(Zt,Xt){return Zt||Xt}(Rt!==0,Ot!==0)){if(gt=Math.sqrt(Rt*Rt+Ot),Rt<0)gt=-gt;gt=Ot/(Rt+gt)}var At=(ft+ot)*(ft-ot)+gt,It=ft*pt;for(var Tt=dt;Tt<w-1;Tt++){var Ft=v.hypot(At,It),Vt=At/Ft,Mt=It/Ft;if(Tt!==dt)a[Tt-1]=Ft;if(At=Vt*this.s[Tt]+Mt*a[Tt],a[Tt]=Vt*a[Tt]-Mt*this.s[Tt],It=Mt*this.s[Tt+1],this.s[Tt+1]=Vt*this.s[Tt+1],r)for(var Nt=0;Nt<this.n;Nt++)Ft=Vt*this.V[Nt][Tt]+Mt*this.V[Nt][Tt+1],this.V[Nt][Tt+1]=-Mt*this.V[Nt][Tt]+Vt*this.V[Nt][Tt+1],this.V[Nt][Tt]=Ft;if(Ft=v.hypot(At,It),Vt=At/Ft,Mt=It/Ft,this.s[Tt]=Ft,At=Vt*a[Tt]+Mt*this.s[Tt+1],this.s[Tt+1]=-Mt*a[Tt]+Vt*this.s[Tt+1],It=Mt*a[Tt+1],a[Tt+1]=Vt*a[Tt+1],g&&Tt<this.m-1)for(var St=0;St<this.m;St++)Ft=Vt*this.U[St][Tt]+Mt*this.U[St][Tt+1],this.U[St][Tt+1]=-Mt*this.U[St][Tt]+Vt*this.U[St][Tt+1],this.U[St][Tt]=Ft}a[w-2]=At,Ct=Ct+1}break;case 4:{if(this.s[dt]<=0){if(this.s[dt]=this.s[dt]<0?-this.s[dt]:0,r)for(var Lt=0;Lt<=vt;Lt++)this.V[Lt][dt]=-this.V[Lt][dt]}while(dt<vt){if(this.s[dt]>=this.s[dt+1])break;var Dt=this.s[dt];if(this.s[dt]=this.s[dt+1],this.s[dt+1]=Dt,r&&dt<this.n-1)for(var jt=0;jt<this.n;jt++)Dt=this.V[jt][dt+1],this.V[jt][dt+1]=this.V[jt][dt],this.V[jt][dt]=Dt;if(g&&dt<this.m-1)for(var qt=0;qt<this.m;qt++)Dt=this.U[qt][dt+1],this.U[qt][dt+1]=this.U[qt][dt],this.U[qt][dt]=Dt;dt++}Ct=0,w--}break}}var le={U:this.U,V:this.V,S:this.s};return le},v.hypot=function(l,s){var a=void 0;if(Math.abs(l)>Math.abs(s))a=s/l,a=Math.abs(l)*Math.sqrt(1+a*a);else if(s!=0)a=l/s,a=Math.abs(s)*Math.sqrt(1+a*a);else a=0;return a},C.exports=v},function(C,G,x){var v=function(){function a(o,g){for(var r=0;r<g.length;r++){var y=g[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(o,y.key,y)}}return function(o,g,r){if(g)a(o.prototype,g);if(r)a(o,r);return o}}();function l(a,o){if(!(a instanceof o))throw TypeError("Cannot call a class as a function")}var s=function(){function a(o,g){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,a),this.sequence1=o,this.sequence2=g,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=o.length+1,this.jMax=g.length+1,this.grid=Array(this.iMax);for(var t=0;t<this.iMax;t++){this.grid[t]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[t][c]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var f=0;f<this.jMax;f++)this.tracebackGrid[d][f]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(a,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var g=1;g<this.jMax;g++)this.grid[0][g]=this.grid[0][g-1]+this.gap_penalty,this.tracebackGrid[0][g]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var t=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])t=this.grid[y-1][i-1]+this.match_score;else t=this.grid[y-1][i-1]+this.mismatch_penalty;var c=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,f=[t,c,d],F=this.arrayAllMaxIndexes(f);this.grid[y][i]=f[F[0]],this.tracebackGrid[y][i]=[F.includes(0),F.includes(1),F.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var g=[];g.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(g[0]){var r=g[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])g.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])g.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])g.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});g.shift()}return this.alignments}},{key:"getAllIndexes",value:function(g,r){var y=[],i=-1;while((i=g.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(g){return this.getAllIndexes(g,Math.max.apply(null,g))}}]),a}();C.exports=s},function(C,G,x){var v=function(){return};v.FDLayout=x(18),v.FDLayoutConstants=x(4),v.FDLayoutEdge=x(19),v.FDLayoutNode=x(20),v.DimensionD=x(21),v.HashMap=x(22),v.HashSet=x(23),v.IGeometry=x(8),v.IMath=x(9),v.Integer=x(10),v.Point=x(12),v.PointD=x(5),v.RandomSeed=x(16),v.RectangleD=x(13),v.Transform=x(17),v.UniqueIDGeneretor=x(14),v.Quicksort=x(25),v.LinkedList=x(11),v.LGraphObject=x(2),v.LGraph=x(6),v.LEdge=x(1),v.LGraphManager=x(7),v.LNode=x(3),v.Layout=x(15),v.LayoutConstants=x(0),v.NeedlemanWunsch=x(27),v.Matrix=x(24),v.SVD=x(26),C.exports=v},function(C,G,x){function v(){this.listeners=[]}var l=v.prototype;l.addListener=function(s,a){this.listeners.push({event:s,callback:a})},l.removeListener=function(s,a){for(var o=this.listeners.length;o>=0;o--){var g=this.listeners[o];if(g.event===s&&g.callback===a)this.listeners.splice(o,1)}},l.emit=function(s,a){for(var o=0;o<this.listeners.length;o++){var g=this.listeners[o];if(s===g.event)g.callback(a)}},C.exports=v}])})});var Xe=We(function(Me,Ye){(function(G,x){if(typeof Me==="object"&&typeof Ye==="object")Ye.exports=x(Ue());else if(typeof define==="function"&&define.amd)define(["layout-base"],x);else if(typeof Me==="object")Me.coseBase=x(Ue());else G.coseBase=x(G.layoutBase)})(Me,function(C){return(()=>{var G={45:(s,a,o)=>{var g={};g.layoutBase=o(551),g.CoSEConstants=o(806),g.CoSEEdge=o(767),g.CoSEGraph=o(880),g.CoSEGraphManager=o(578),g.CoSELayout=o(765),g.CoSENode=o(991),g.ConstraintHandler=o(902),s.exports=g},806:(s,a,o)=>{var g=o(551).FDLayoutConstants;function r(){}for(var y in g)r[y]=g[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=g.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,s.exports=r},767:(s,a,o)=>{var g=o(551).FDLayoutEdge;function r(i,t,c){g.call(this,i,t,c)}r.prototype=Object.create(g.prototype);for(var y in g)r[y]=g[y];s.exports=r},880:(s,a,o)=>{var g=o(551).LGraph;function r(i,t,c){g.call(this,i,t,c)}r.prototype=Object.create(g.prototype);for(var y in g)r[y]=g[y];s.exports=r},578:(s,a,o)=>{var g=o(551).LGraphManager;function r(i){g.call(this,i)}r.prototype=Object.create(g.prototype);for(var y in g)r[y]=g[y];s.exports=r},765:(s,a,o)=>{var g=o(551).FDLayout,r=o(578),y=o(880),i=o(991),t=o(767),c=o(806),d=o(902),f=o(551).FDLayoutConstants,F=o(551).LayoutConstants,T=o(551).Point,N=o(551).PointD,S=o(551).DimensionD,V=o(551).Layout,b=o(551).Integer,Z=o(551).IGeometry,it=o(551).LGraph,_=o(551).Transform,ut=o(551).LinkedList;function H(){g.call(this),this.toBeTiled={},this.constraints={}}H.prototype=Object.create(g.prototype);for(var nt in g)H[nt]=g[nt];H.prototype.newGraphManager=function(){var h=new r(this);return this.graphManager=h,h},H.prototype.newGraph=function(h){return new y(null,this.graphManager,h)},H.prototype.newNode=function(h){return new i(this.graphManager,h)},H.prototype.newEdge=function(h){return new t(null,null,h)},H.prototype.initParameters=function(){if(g.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(c.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},H.prototype.initSpringEmbedder=function(){g.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},H.prototype.layout=function(){var h=F.DEFAULT_CREATE_BENDS_AS_NEEDED;if(h)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},H.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){var h=this.getFlatForest();if(h.length>0)this.positionNodesRadially(h);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(D){return w.has(D)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(W){return w.has(W)});this.graphManager.setAllNodesToApplyGravitation(E)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),c.APPLY_LAYOUT)this.runSpringEmbedder();return!0},H.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%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(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 h=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(m){return h.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(w),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL)this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(c.PURE_INCREMENTAL)this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var E=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},H.prototype.getPositionsData=function(){var h=this.graphManager.getAllNodes(),w={};for(var E=0;E<h.length;E++){var D=h[E].rect,m=h[E].id;w[m]={id:m,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return w},H.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var h=!1;if(f.ANIMATE==="during")this.emit("layoutstarted");else{while(!h)h=this.tick();this.graphManager.updateBounds()}},H.prototype.moveNodes=function(){var h=this.getAllNodes(),w;for(var E=0;E<h.length;E++)w=h[E],w.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var E=0;E<h.length;E++)w=h[E],w.move()},H.prototype.initConstraintVariables=function(){var h=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var w=this.graphManager.getAllNodes();for(var E=0;E<w.length;E++){var D=w[E];this.idToNodeMap.set(D.id,D)}var m=function U(rt){var at=rt.getChild().getNodes(),vt,Ct=0;for(var Ht=0;Ht<at.length;Ht++)if(vt=at[Ht],vt.getChild()==null){if(h.fixedNodeSet.has(vt.id))Ct+=100}else Ct+=U(vt);return Ct};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(at){h.fixedNodeSet.add(at.nodeId)});var w=this.graphManager.getAllNodes(),D;for(var E=0;E<w.length;E++)if(D=w[E],D.getChild()!=null){var W=m(D);if(W>0)D.fixedNodeWeight=W}}if(this.constraints.relativePlacementConstraint){var Y=new Map,j=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(U){h.fixedNodesOnHorizontal.add(U),h.fixedNodesOnVertical.add(U)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var Q=this.constraints.alignmentConstraint.vertical;for(var E=0;E<Q.length;E++)this.dummyToNodeForVerticalAlignment.set("dummy"+E,[]),Q[E].forEach(function(rt){if(Y.set(rt,"dummy"+E),h.dummyToNodeForVerticalAlignment.get("dummy"+E).push(rt),h.fixedNodeSet.has(rt))h.fixedNodesOnHorizontal.add("dummy"+E)})}if(this.constraints.alignmentConstraint.horizontal){var z=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<z.length;E++)this.dummyToNodeForHorizontalAlignment.set("dummy"+E,[]),z[E].forEach(function(rt){if(j.set(rt,"dummy"+E),h.dummyToNodeForHorizontalAlignment.get("dummy"+E).push(rt),h.fixedNodeSet.has(rt))h.fixedNodesOnVertical.add("dummy"+E)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(U){var rt,at,vt;for(vt=U.length-1;vt>=2*U.length/3;vt--)rt=Math.floor(Math.random()*(vt+1)),at=U[vt],U[vt]=U[rt],U[rt]=at;return U},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(U){if(U.left){var rt=Y.has(U.left)?Y.get(U.left):U.left,at=Y.has(U.right)?Y.get(U.right):U.right;if(!h.nodesInRelativeHorizontal.includes(rt))if(h.nodesInRelativeHorizontal.push(rt),h.nodeToRelativeConstraintMapHorizontal.set(rt,[]),h.dummyToNodeForVerticalAlignment.has(rt))h.nodeToTempPositionMapHorizontal.set(rt,h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(rt)[0]).getCenterX());else h.nodeToTempPositionMapHorizontal.set(rt,h.idToNodeMap.get(rt).getCenterX());if(!h.nodesInRelativeHorizontal.includes(at))if(h.nodesInRelativeHorizontal.push(at),h.nodeToRelativeConstraintMapHorizontal.set(at,[]),h.dummyToNodeForVerticalAlignment.has(at))h.nodeToTempPositionMapHorizontal.set(at,h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(at)[0]).getCenterX());else h.nodeToTempPositionMapHorizontal.set(at,h.idToNodeMap.get(at).getCenterX());h.nodeToRelativeConstraintMapHorizontal.get(rt).push({right:at,gap:U.gap}),h.nodeToRelativeConstraintMapHorizontal.get(at).push({left:rt,gap:U.gap})}else{var vt=j.has(U.top)?j.get(U.top):U.top,Ct=j.has(U.bottom)?j.get(U.bottom):U.bottom;if(!h.nodesInRelativeVertical.includes(vt))if(h.nodesInRelativeVertical.push(vt),h.nodeToRelativeConstraintMapVertical.set(vt,[]),h.dummyToNodeForHorizontalAlignment.has(vt))h.nodeToTempPositionMapVertical.set(vt,h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(vt)[0]).getCenterY());else h.nodeToTempPositionMapVertical.set(vt,h.idToNodeMap.get(vt).getCenterY());if(!h.nodesInRelativeVertical.includes(Ct))if(h.nodesInRelativeVertical.push(Ct),h.nodeToRelativeConstraintMapVertical.set(Ct,[]),h.dummyToNodeForHorizontalAlignment.has(Ct))h.nodeToTempPositionMapVertical.set(Ct,h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(Ct)[0]).getCenterY());else h.nodeToTempPositionMapVertical.set(Ct,h.idToNodeMap.get(Ct).getCenterY());h.nodeToRelativeConstraintMapVertical.get(vt).push({bottom:Ct,gap:U.gap}),h.nodeToRelativeConstraintMapVertical.get(Ct).push({top:vt,gap:U.gap})}});else{var ct=new Map,mt=new Map;this.constraints.relativePlacementConstraint.forEach(function(U){if(U.left){var rt=Y.has(U.left)?Y.get(U.left):U.left,at=Y.has(U.right)?Y.get(U.right):U.right;if(ct.has(rt))ct.get(rt).push(at);else ct.set(rt,[at]);if(ct.has(at))ct.get(at).push(rt);else ct.set(at,[rt])}else{var vt=j.has(U.top)?j.get(U.top):U.top,Ct=j.has(U.bottom)?j.get(U.bottom):U.bottom;if(mt.has(vt))mt.get(vt).push(Ct);else mt.set(vt,[Ct]);if(mt.has(Ct))mt.get(Ct).push(vt);else mt.set(Ct,[vt])}});var J=function(rt,at){var vt=[],Ct=[],Ht=new ut,Kt=new Set,dt=0;return rt.forEach(function(ie,$t){if(!Kt.has($t)){vt[dt]=[],Ct[dt]=!1;var wt=$t;Ht.push(wt),Kt.add(wt),vt[dt].push(wt);while(Ht.length!=0){if(wt=Ht.shift(),at.has(wt))Ct[dt]=!0;var Et=rt.get(wt);Et.forEach(function(bt){if(!Kt.has(bt))Ht.push(bt),Kt.add(bt),vt[dt].push(bt)})}dt++}}),{components:vt,isFixed:Ct}},yt=J(ct,h.fixedNodesOnHorizontal);this.componentsOnHorizontal=yt.components,this.fixedComponentsOnHorizontal=yt.isFixed;var ht=J(mt,h.fixedNodesOnVertical);this.componentsOnVertical=ht.components,this.fixedComponentsOnVertical=ht.isFixed}}},H.prototype.updateDisplacements=function(){var h=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(ht){var U=h.idToNodeMap.get(ht.nodeId);U.displacementX=0,U.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var w=this.constraints.alignmentConstraint.vertical;for(var E=0;E<w.length;E++){var D=0;for(var m=0;m<w[E].length;m++){if(this.fixedNodeSet.has(w[E][m])){D=0;break}D+=this.idToNodeMap.get(w[E][m]).displacementX}var W=D/w[E].length;for(var m=0;m<w[E].length;m++)this.idToNodeMap.get(w[E][m]).displacementX=W}}if(this.constraints.alignmentConstraint.horizontal){var Y=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<Y.length;E++){var j=0;for(var m=0;m<Y[E].length;m++){if(this.fixedNodeSet.has(Y[E][m])){j=0;break}j+=this.idToNodeMap.get(Y[E][m]).displacementY}var Q=j/Y[E].length;for(var m=0;m<Y[E].length;m++)this.idToNodeMap.get(Y[E][m]).displacementY=Q}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(ht){if(!h.fixedNodesOnHorizontal.has(ht)){var U=0;if(h.dummyToNodeForVerticalAlignment.has(ht))U=h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(ht)[0]).displacementX;else U=h.idToNodeMap.get(ht).displacementX;if(h.nodeToRelativeConstraintMapHorizontal.get(ht).forEach(function(rt){if(rt.right){var at=h.nodeToTempPositionMapHorizontal.get(rt.right)-h.nodeToTempPositionMapHorizontal.get(ht)-U;if(at<rt.gap)U-=rt.gap-at}else{var at=h.nodeToTempPositionMapHorizontal.get(ht)-h.nodeToTempPositionMapHorizontal.get(rt.left)+U;if(at<rt.gap)U+=rt.gap-at}}),h.nodeToTempPositionMapHorizontal.set(ht,h.nodeToTempPositionMapHorizontal.get(ht)+U),h.dummyToNodeForVerticalAlignment.has(ht))h.dummyToNodeForVerticalAlignment.get(ht).forEach(function(rt){h.idToNodeMap.get(rt).displacementX=U});else h.idToNodeMap.get(ht).displacementX=U}}),this.nodesInRelativeVertical.forEach(function(ht){if(!h.fixedNodesOnHorizontal.has(ht)){var U=0;if(h.dummyToNodeForHorizontalAlignment.has(ht))U=h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(ht)[0]).displacementY;else U=h.idToNodeMap.get(ht).displacementY;if(h.nodeToRelativeConstraintMapVertical.get(ht).forEach(function(rt){if(rt.bottom){var at=h.nodeToTempPositionMapVertical.get(rt.bottom)-h.nodeToTempPositionMapVertical.get(ht)-U;if(at<rt.gap)U-=rt.gap-at}else{var at=h.nodeToTempPositionMapVertical.get(ht)-h.nodeToTempPositionMapVertical.get(rt.top)+U;if(at<rt.gap)U+=rt.gap-at}}),h.nodeToTempPositionMapVertical.set(ht,h.nodeToTempPositionMapVertical.get(ht)+U),h.dummyToNodeForHorizontalAlignment.has(ht))h.dummyToNodeForHorizontalAlignment.get(ht).forEach(function(rt){h.idToNodeMap.get(rt).displacementY=U});else h.idToNodeMap.get(ht).displacementY=U}})}else{for(var E=0;E<this.componentsOnHorizontal.length;E++){var z=this.componentsOnHorizontal[E];if(this.fixedComponentsOnHorizontal[E])for(var m=0;m<z.length;m++)if(this.dummyToNodeForVerticalAlignment.has(z[m]))this.dummyToNodeForVerticalAlignment.get(z[m]).forEach(function(rt){h.idToNodeMap.get(rt).displacementX=0});else this.idToNodeMap.get(z[m]).displacementX=0;else{var ct=0,mt=0;for(var m=0;m<z.length;m++)if(this.dummyToNodeForVerticalAlignment.has(z[m])){var J=this.dummyToNodeForVerticalAlignment.get(z[m]);ct+=J.length*this.idToNodeMap.get(J[0]).displacementX,mt+=J.length}else ct+=this.idToNodeMap.get(z[m]).displacementX,mt++;var yt=ct/mt;for(var m=0;m<z.length;m++)if(this.dummyToNodeForVerticalAlignment.has(z[m]))this.dummyToNodeForVerticalAlignment.get(z[m]).forEach(function(rt){h.idToNodeMap.get(rt).displacementX=yt});else this.idToNodeMap.get(z[m]).displacementX=yt}}for(var E=0;E<this.componentsOnVertical.length;E++){var z=this.componentsOnVertical[E];if(this.fixedComponentsOnVertical[E])for(var m=0;m<z.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(z[m]))this.dummyToNodeForHorizontalAlignment.get(z[m]).forEach(function(at){h.idToNodeMap.get(at).displacementY=0});else this.idToNodeMap.get(z[m]).displacementY=0;else{var ct=0,mt=0;for(var m=0;m<z.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(z[m])){var J=this.dummyToNodeForHorizontalAlignment.get(z[m]);ct+=J.length*this.idToNodeMap.get(J[0]).displacementY,mt+=J.length}else ct+=this.idToNodeMap.get(z[m]).displacementY,mt++;var yt=ct/mt;for(var m=0;m<z.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(z[m]))this.dummyToNodeForHorizontalAlignment.get(z[m]).forEach(function(Ht){h.idToNodeMap.get(Ht).displacementY=yt});else this.idToNodeMap.get(z[m]).displacementY=yt}}}},H.prototype.calculateNodesToApplyGravitationTo=function(){var h=[],w,E=this.graphManager.getGraphs(),D=E.length,m;for(m=0;m<D;m++)if(w=E[m],w.updateConnected(),!w.isConnected)h=h.concat(w.getNodes());return h},H.prototype.createBendpoints=function(){var h=[];h=h.concat(this.graphManager.getAllEdges());var w=new Set,E;for(E=0;E<h.length;E++){var D=h[E];if(!w.has(D)){var m=D.getSource(),W=D.getTarget();if(m==W)D.getBendpoints().push(new N),D.getBendpoints().push(new N),this.createDummyNodesForBendpoints(D),w.add(D);else{var Y=[];if(Y=Y.concat(m.getEdgeListToNode(W)),Y=Y.concat(W.getEdgeListToNode(m)),!w.has(Y[0])){if(Y.length>1){var j;for(j=0;j<Y.length;j++){var Q=Y[j];Q.getBendpoints().push(new N),this.createDummyNodesForBendpoints(Q)}}Y.forEach(function(z){w.add(z)})}}}if(w.size==h.length)break}},H.prototype.positionNodesRadially=function(h){var w=new T(0,0),E=Math.ceil(Math.sqrt(h.length)),D=0,m=0,W=0,Y=new N(0,0);for(var j=0;j<h.length;j++){if(j%E==0){if(W=0,m=D,j!=0)m+=c.DEFAULT_COMPONENT_SEPERATION;D=0}var Q=h[j],z=V.findCenterOfTree(Q);if(w.x=W,w.y=m,Y=H.radialLayout(Q,z,w),Y.y>D)D=Math.floor(Y.y);W=Math.floor(Y.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(F.WORLD_CENTER_X-Y.x/2,F.WORLD_CENTER_Y-Y.y/2))},H.radialLayout=function(h,w,E){var D=Math.max(this.maxDiagonalInTree(h),c.DEFAULT_RADIAL_SEPARATION);H.branchRadialLayout(w,null,0,359,0,D);var m=it.calculateBounds(h),W=new _;W.setDeviceOrgX(m.getMinX()),W.setDeviceOrgY(m.getMinY()),W.setWorldOrgX(E.x),W.setWorldOrgY(E.y);for(var Y=0;Y<h.length;Y++){var j=h[Y];j.transform(W)}var Q=new N(m.getMaxX(),m.getMaxY());return W.inverseTransformPoint(Q)},H.branchRadialLayout=function(h,w,E,D,m,W){var Y=(D-E+1)/2;if(Y<0)Y+=180;var j=(Y+E)%360,Q=j*Z.TWO_PI/360,z=Math.cos(Q),ct=m*Math.cos(Q),mt=m*Math.sin(Q);h.setCenter(ct,mt);var J=[];J=J.concat(h.getEdges());var yt=J.length;if(w!=null)yt--;var ht=0,U=J.length,rt,at=h.getEdgesBetween(w);while(at.length>1){var vt=at[0];at.splice(0,1);var Ct=J.indexOf(vt);if(Ct>=0)J.splice(Ct,1);U--,yt--}if(w!=null)rt=(J.indexOf(at[0])+1)%U;else rt=0;var Ht=Math.abs(D-E)/yt;for(var Kt=rt;ht!=yt;Kt=++Kt%U){var dt=J[Kt].getOtherEnd(h);if(dt==w)continue;var ie=(E+ht*Ht)%360,$t=(ie+Ht)%360;H.branchRadialLayout(dt,h,ie,$t,m+W,W),ht++}},H.maxDiagonalInTree=function(h){var w=b.MIN_VALUE;for(var E=0;E<h.length;E++){var D=h[E],m=D.getDiagonal();if(m>w)w=m}return w},H.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},H.prototype.groupZeroDegreeMembers=function(){var h=this,w={};this.memberGroups={},this.idToDummyNode={};var E=[],D=this.graphManager.getAllNodes();for(var m=0;m<D.length;m++){var W=D[m],Y=W.getParent();if(this.getNodeDegreeWithChildren(W)===0&&(Y.id==null||!this.getToBeTiled(Y)))E.push(W)}for(var m=0;m<E.length;m++){var W=E[m],j=W.getParent().id;if(typeof w[j]>"u")w[j]=[];w[j]=w[j].concat(W)}Object.keys(w).forEach(function(Q){if(w[Q].length>1){var z="DummyCompound_"+Q;h.memberGroups[z]=w[Q];var ct=w[Q][0].getParent(),mt=new i(h.graphManager);mt.id=z,mt.paddingLeft=ct.paddingLeft||0,mt.paddingRight=ct.paddingRight||0,mt.paddingBottom=ct.paddingBottom||0,mt.paddingTop=ct.paddingTop||0,h.idToDummyNode[z]=mt;var J=h.getGraphManager().add(h.newGraph(),mt),yt=ct.getChild();yt.add(mt);for(var ht=0;ht<w[Q].length;ht++){var U=w[Q][ht];yt.remove(U),J.add(U)}}})},H.prototype.clearCompounds=function(){var h={},w={};this.performDFSOnCompounds();for(var E=0;E<this.compoundOrder.length;E++)w[this.compoundOrder[E].id]=this.compoundOrder[E],h[this.compoundOrder[E].id]=[].concat(this.compoundOrder[E].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[E].getChild()),this.compoundOrder[E].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(h,w)},H.prototype.clearZeroDegreeMembers=function(){var h=this,w=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(E){var D=h.idToDummyNode[E];if(w[E]=h.tileNodes(h.memberGroups[E],D.paddingLeft+D.paddingRight),D.rect.width=w[E].width,D.rect.height=w[E].height,D.setCenter(w[E].centerX,w[E].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var m=D.rect.width,W=D.rect.height;if(D.labelWidth){if(D.labelPosHorizontal=="left")D.rect.x-=D.labelWidth,D.setWidth(m+D.labelWidth),D.labelMarginLeft=D.labelWidth;else if(D.labelPosHorizontal=="center"&&D.labelWidth>m)D.rect.x-=(D.labelWidth-m)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-m)/2;else if(D.labelPosHorizontal=="right")D.setWidth(m+D.labelWidth)}if(D.labelHeight){if(D.labelPosVertical=="top")D.rect.y-=D.labelHeight,D.setHeight(W+D.labelHeight),D.labelMarginTop=D.labelHeight;else if(D.labelPosVertical=="center"&&D.labelHeight>W)D.rect.y-=(D.labelHeight-W)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-W)/2;else if(D.labelPosVertical=="bottom")D.setHeight(W+D.labelHeight)}}})},H.prototype.repopulateCompounds=function(){for(var h=this.compoundOrder.length-1;h>=0;h--){var w=this.compoundOrder[h],{id:E,paddingLeft:D,paddingTop:m,labelMarginLeft:W,labelMarginTop:Y}=w;this.adjustLocations(this.tiledMemberPack[E],w.rect.x,w.rect.y,D,m,W,Y)}},H.prototype.repopulateZeroDegreeMembers=function(){var h=this,w=this.tiledZeroDegreePack;Object.keys(w).forEach(function(E){var D=h.idToDummyNode[E],{paddingLeft:m,paddingTop:W,labelMarginLeft:Y,labelMarginTop:j}=D;h.adjustLocations(w[E],D.rect.x,D.rect.y,m,W,Y,j)})},H.prototype.getToBeTiled=function(h){var w=h.id;if(this.toBeTiled[w]!=null)return this.toBeTiled[w];var E=h.getChild();if(E==null)return this.toBeTiled[w]=!1,!1;var D=E.getNodes();for(var m=0;m<D.length;m++){var W=D[m];if(this.getNodeDegree(W)>0)return this.toBeTiled[w]=!1,!1;if(W.getChild()==null){this.toBeTiled[W.id]=!1;continue}if(!this.getToBeTiled(W))return this.toBeTiled[w]=!1,!1}return this.toBeTiled[w]=!0,!0},H.prototype.getNodeDegree=function(h){var w=h.id,E=h.getEdges(),D=0;for(var m=0;m<E.length;m++){var W=E[m];if(W.getSource().id!==W.getTarget().id)D=D+1}return D},H.prototype.getNodeDegreeWithChildren=function(h){var w=this.getNodeDegree(h);if(h.getChild()==null)return w;var E=h.getChild().getNodes();for(var D=0;D<E.length;D++){var m=E[D];w+=this.getNodeDegreeWithChildren(m)}return w},H.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},H.prototype.fillCompexOrderByDFS=function(h){for(var w=0;w<h.length;w++){var E=h[w];if(E.getChild()!=null)this.fillCompexOrderByDFS(E.getChild().getNodes());if(this.getToBeTiled(E))this.compoundOrder.push(E)}},H.prototype.adjustLocations=function(h,w,E,D,m,W,Y){w+=D+W,E+=m+Y;var j=w;for(var Q=0;Q<h.rows.length;Q++){var z=h.rows[Q];w=j;var ct=0;for(var mt=0;mt<z.length;mt++){var J=z[mt];if(J.rect.x=w,J.rect.y=E,w+=J.rect.width+h.horizontalPadding,J.rect.height>ct)ct=J.rect.height}E+=ct+h.verticalPadding}},H.prototype.tileCompoundMembers=function(h,w){var E=this;this.tiledMemberPack=[],Object.keys(h).forEach(function(D){var m=w[D];if(E.tiledMemberPack[D]=E.tileNodes(h[D],m.paddingLeft+m.paddingRight),m.rect.width=E.tiledMemberPack[D].width,m.rect.height=E.tiledMemberPack[D].height,m.setCenter(E.tiledMemberPack[D].centerX,E.tiledMemberPack[D].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var W=m.rect.width,Y=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(W+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>W)m.rect.x-=(m.labelWidth-W)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-W)/2;else if(m.labelPosHorizontal=="right")m.setWidth(W+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(Y+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>Y)m.rect.y-=(m.labelHeight-Y)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-Y)/2;else if(m.labelPosVertical=="bottom")m.setHeight(Y+m.labelHeight)}}})},H.prototype.tileNodes=function(h,w){var E=this.tileNodesByFavoringDim(h,w,!0),D=this.tileNodesByFavoringDim(h,w,!1),m=this.getOrgRatio(E),W=this.getOrgRatio(D),Y;if(W<m)Y=D;else Y=E;return Y},H.prototype.getOrgRatio=function(h){var{width:w,height:E}=h,D=w/E;if(D<1)D=1/D;return D},H.prototype.calcIdealRowWidth=function(h,w){var{TILING_PADDING_VERTICAL:E,TILING_PADDING_HORIZONTAL:D}=c,m=h.length,W=0,Y=0,j=0;h.forEach(function(ht){if(W+=ht.getWidth(),Y+=ht.getHeight(),ht.getWidth()>j)j=ht.getWidth()});var Q=W/m,z=Y/m,ct=Math.pow(E-D,2)+4*(Q+D)*(z+E)*m,mt=(D-E+Math.sqrt(ct))/(2*(Q+D)),J;if(w){if(J=Math.ceil(mt),J==mt)J++}else J=Math.floor(mt);var yt=J*(Q+D)-D;if(j>yt)yt=j;return yt+=D*2,yt},H.prototype.tileNodesByFavoringDim=function(h,w,E){var{TILING_PADDING_VERTICAL:D,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:W}=c,Y={rows:[],rowWidth:[],rowHeight:[],width:0,height:w,verticalPadding:D,horizontalPadding:m,centerX:0,centerY:0};if(W)Y.idealRowWidth=this.calcIdealRowWidth(h,E);var j=function(U){return U.rect.width*U.rect.height},Q=function(U,rt){return j(rt)-j(U)};h.sort(function(ht,U){var rt=Q;if(Y.idealRowWidth)return rt=W,rt(ht.id,U.id);return rt(ht,U)});var z=0,ct=0;for(var mt=0;mt<h.length;mt++){var J=h[mt];z+=J.getCenterX(),ct+=J.getCenterY()}Y.centerX=z/h.length,Y.centerY=ct/h.length;for(var mt=0;mt<h.length;mt++){var J=h[mt];if(Y.rows.length==0)this.insertNodeToRow(Y,J,0,w);else if(this.canAddHorizontal(Y,J.rect.width,J.rect.height)){var yt=Y.rows.length-1;if(!Y.idealRowWidth)yt=this.getShortestRowIndex(Y);this.insertNodeToRow(Y,J,yt,w)}else this.insertNodeToRow(Y,J,Y.rows.length,w);this.shiftToLastRow(Y)}return Y},H.prototype.insertNodeToRow=function(h,w,E,D){var m=D;if(E==h.rows.length){var W=[];h.rows.push(W),h.rowWidth.push(m),h.rowHeight.push(0)}var Y=h.rowWidth[E]+w.rect.width;if(h.rows[E].length>0)Y+=h.horizontalPadding;if(h.rowWidth[E]=Y,h.width<Y)h.width=Y;var j=w.rect.height;if(E>0)j+=h.verticalPadding;var Q=0;if(j>h.rowHeight[E])Q=h.rowHeight[E],h.rowHeight[E]=j,Q=h.rowHeight[E]-Q;h.height+=Q,h.rows[E].push(w)},H.prototype.getShortestRowIndex=function(h){var w=-1,E=Number.MAX_VALUE;for(var D=0;D<h.rows.length;D++)if(h.rowWidth[D]<E)w=D,E=h.rowWidth[D];return w},H.prototype.getLongestRowIndex=function(h){var w=-1,E=Number.MIN_VALUE;for(var D=0;D<h.rows.length;D++)if(h.rowWidth[D]>E)w=D,E=h.rowWidth[D];return w},H.prototype.canAddHorizontal=function(h,w,E){if(h.idealRowWidth){var D=h.rows.length-1,m=h.rowWidth[D];return m+w+h.horizontalPadding<=h.idealRowWidth}var W=this.getShortestRowIndex(h);if(W<0)return!0;var Y=h.rowWidth[W];if(Y+h.horizontalPadding+w<=h.width)return!0;var j=0;if(h.rowHeight[W]<E){if(W>0)j=E+h.verticalPadding-h.rowHeight[W]}var Q;if(h.width-Y>=w+h.horizontalPadding)Q=(h.height+j)/(Y+w+h.horizontalPadding);else Q=(h.height+j)/h.width;j=E+h.verticalPadding;var z;if(h.width<w)z=(h.height+j)/w;else z=(h.height+j)/h.width;if(z<1)z=1/z;if(Q<1)Q=1/Q;return Q<z},H.prototype.shiftToLastRow=function(h){var w=this.getLongestRowIndex(h),E=h.rowWidth.length-1,D=h.rows[w],m=D[D.length-1],W=m.width+h.horizontalPadding;if(h.width-h.rowWidth[E]>W&&w!=E){D.splice(-1,1),h.rows[E].push(m),h.rowWidth[w]=h.rowWidth[w]-W,h.rowWidth[E]=h.rowWidth[E]+W,h.width=h.rowWidth[instance.getLongestRowIndex(h)];var Y=Number.MIN_VALUE;for(var j=0;j<D.length;j++)if(D[j].height>Y)Y=D[j].height;if(w>0)Y+=h.verticalPadding;var Q=h.rowHeight[w]+h.rowHeight[E];if(h.rowHeight[w]=Y,h.rowHeight[E]<m.height+h.verticalPadding)h.rowHeight[E]=m.height+h.verticalPadding;var z=h.rowHeight[w]+h.rowHeight[E];h.height+=z-Q,this.shiftToLastRow(h)}},H.prototype.tilingPreLayout=function(){if(c.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},H.prototype.tilingPostLayout=function(){if(c.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},H.prototype.reduceTrees=function(){var h=[],w=!0,E;while(w){var D=this.graphManager.getAllNodes(),m=[];w=!1;for(var W=0;W<D.length;W++)if(E=D[W],E.getEdges().length==1&&!E.getEdges()[0].isInterGraph&&E.getChild()==null){if(c.PURE_INCREMENTAL){var Y=E.getEdges()[0].getOtherEnd(E),j=new S(E.getCenterX()-Y.getCenterX(),E.getCenterY()-Y.getCenterY());m.push([E,E.getEdges()[0],E.getOwner(),j])}else m.push([E,E.getEdges()[0],E.getOwner()]);w=!0}if(w==!0){var Q=[];for(var z=0;z<m.length;z++)if(m[z][0].getEdges().length==1)Q.push(m[z]),m[z][0].getOwner().remove(m[z][0]);h.push(Q),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=h},H.prototype.growTree=function(h){var w=h.length,E=h[w-1],D;for(var m=0;m<E.length;m++)D=E[m],this.findPlaceforPrunedNode(D),D[2].add(D[0]),D[2].add(D[1],D[1].source,D[1].target);h.splice(h.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},H.prototype.findPlaceforPrunedNode=function(h){var w,E,D=h[0];if(D==h[1].source)E=h[1].target;else E=h[1].source;if(c.PURE_INCREMENTAL)D.setCenter(E.getCenterX()+h[3].getWidth(),E.getCenterY()+h[3].getHeight());else{var m=E.startX,W=E.finishX,Y=E.startY,j=E.finishY,Q=0,z=0,ct=0,mt=0,J=[Q,ct,z,mt];if(Y>0)for(var yt=m;yt<=W;yt++)J[0]+=this.grid[yt][Y-1].length+this.grid[yt][Y].length-1;if(W<this.grid.length-1)for(var yt=Y;yt<=j;yt++)J[1]+=this.grid[W+1][yt].length+this.grid[W][yt].length-1;if(j<this.grid[0].length-1)for(var yt=m;yt<=W;yt++)J[2]+=this.grid[yt][j+1].length+this.grid[yt][j].length-1;if(m>0)for(var yt=Y;yt<=j;yt++)J[3]+=this.grid[m-1][yt].length+this.grid[m][yt].length-1;var ht=b.MAX_VALUE,U,rt;for(var at=0;at<J.length;at++)if(J[at]<ht)ht=J[at],U=1,rt=at;else if(J[at]==ht)U++;if(U==3&&ht==0){if(J[0]==0&&J[1]==0&&J[2]==0)w=1;else if(J[0]==0&&J[1]==0&&J[3]==0)w=0;else if(J[0]==0&&J[2]==0&&J[3]==0)w=3;else if(J[1]==0&&J[2]==0&&J[3]==0)w=2}else if(U==2&&ht==0){var vt=Math.floor(Math.random()*2);if(J[0]==0&&J[1]==0)if(vt==0)w=0;else w=1;else if(J[0]==0&&J[2]==0)if(vt==0)w=0;else w=2;else if(J[0]==0&&J[3]==0)if(vt==0)w=0;else w=3;else if(J[1]==0&&J[2]==0)if(vt==0)w=1;else w=2;else if(J[1]==0&&J[3]==0)if(vt==0)w=1;else w=3;else if(vt==0)w=2;else w=3}else if(U==4&&ht==0){var vt=Math.floor(Math.random()*4);w=vt}else w=rt;if(w==0)D.setCenter(E.getCenterX(),E.getCenterY()-E.getHeight()/2-f.DEFAULT_EDGE_LENGTH-D.getHeight()/2);else if(w==1)D.setCenter(E.getCenterX()+E.getWidth()/2+f.DEFAULT_EDGE_LENGTH+D.getWidth()/2,E.getCenterY());else if(w==2)D.setCenter(E.getCenterX(),E.getCenterY()+E.getHeight()/2+f.DEFAULT_EDGE_LENGTH+D.getHeight()/2);else D.setCenter(E.getCenterX()-E.getWidth()/2-f.DEFAULT_EDGE_LENGTH-D.getWidth()/2,E.getCenterY())}},s.exports=H},991:(s,a,o)=>{var g=o(551).FDLayoutNode,r=o(551).IMath;function y(t,c,d,f){g.call(this,t,c,d,f)}y.prototype=Object.create(g.prototype);for(var i in g)y[i]=g[i];y.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();if(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;else this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement)this.displacementX=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement)this.displacementY=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(t,c){var d=this.getChild().getNodes(),f;for(var F=0;F<d.length;F++)if(f=d[F],f.getChild()==null)f.displacementX+=t,f.displacementY+=c;else f.propogateDisplacementToChildren(t,c)},y.prototype.move=function(){var t=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},y.prototype.setPred1=function(t){this.pred1=t},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(t){this.next=t},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(t){this.processed=t},y.prototype.isProcessed=function(){return processed},s.exports=y},902:(s,a,o)=>{function g(d){if(Array.isArray(d)){for(var f=0,F=Array(d.length);f<d.length;f++)F[f]=d[f];return F}else return Array.from(d)}var r=o(806),y=o(551).LinkedList,i=o(551).Matrix,t=o(551).SVD;function c(){}c.handleConstraints=function(d){var f={};f.fixedNodeConstraint=d.constraints.fixedNodeConstraint,f.alignmentConstraint=d.constraints.alignmentConstraint,f.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var F=new Map,T=new Map,N=[],S=[],V=d.getAllNodes(),b=0;for(var Z=0;Z<V.length;Z++){var it=V[Z];if(it.getChild()==null)T.set(it.id,b++),N.push(it.getCenterX()),S.push(it.getCenterY()),F.set(it.id,it)}if(f.relativePlacementConstraint)f.relativePlacementConstraint.forEach(function(et){if(!et.gap&&et.gap!=0)if(et.left)et.gap=r.DEFAULT_EDGE_LENGTH+F.get(et.left).getWidth()/2+F.get(et.right).getWidth()/2;else et.gap=r.DEFAULT_EDGE_LENGTH+F.get(et.top).getHeight()/2+F.get(et.bottom).getHeight()/2});var _=function(ot,st){return{x:ot.x-st.x,y:ot.y-st.y}},ut=function(ot){var st=0,lt=0;return ot.forEach(function(ft){st+=N[T.get(ft)],lt+=S[T.get(ft)]}),{x:st/ot.size,y:lt/ot.size}},H=function(ot,st,lt,ft,pt){function Rt(Mt,Nt){var St=new Set(Mt),Lt=!0,Dt=!1,jt=void 0;try{for(var qt=Nt[Symbol.iterator](),le;!(Lt=(le=qt.next()).done);Lt=!0){var Zt=le.value;St.add(Zt)}}catch(Xt){Dt=!0,jt=Xt}finally{try{if(!Lt&&qt.return)qt.return()}finally{if(Dt)throw jt}}return St}var Ot=new Map;ot.forEach(function(Mt,Nt){Ot.set(Nt,0)}),ot.forEach(function(Mt,Nt){Mt.forEach(function(St){Ot.set(St.id,Ot.get(St.id)+1)})});var gt=new Map,At=new Map,It=new y;if(Ot.forEach(function(Mt,Nt){if(Mt==0){if(It.push(Nt),!lt)if(st=="horizontal")gt.set(Nt,T.has(Nt)?N[T.get(Nt)]:ft.get(Nt));else gt.set(Nt,T.has(Nt)?S[T.get(Nt)]:ft.get(Nt))}else gt.set(Nt,Number.NEGATIVE_INFINITY);if(lt)At.set(Nt,new Set([Nt]))}),lt)pt.forEach(function(Mt){var Nt=[];if(Mt.forEach(function(Dt){if(lt.has(Dt))Nt.push(Dt)}),Nt.length>0){var St=0;Nt.forEach(function(Dt){if(st=="horizontal")gt.set(Dt,T.has(Dt)?N[T.get(Dt)]:ft.get(Dt)),St+=gt.get(Dt);else gt.set(Dt,T.has(Dt)?S[T.get(Dt)]:ft.get(Dt)),St+=gt.get(Dt)}),St=St/Nt.length,Mt.forEach(function(Dt){if(!lt.has(Dt))gt.set(Dt,St)})}else{var Lt=0;Mt.forEach(function(Dt){if(st=="horizontal")Lt+=T.has(Dt)?N[T.get(Dt)]:ft.get(Dt);else Lt+=T.has(Dt)?S[T.get(Dt)]:ft.get(Dt)}),Lt=Lt/Mt.length,Mt.forEach(function(Dt){gt.set(Dt,Lt)})}});var Tt=function(){var Nt=It.shift(),St=ot.get(Nt);St.forEach(function(Lt){if(gt.get(Lt.id)<gt.get(Nt)+Lt.gap)if(lt&<.has(Lt.id)){var Dt=void 0;if(st=="horizontal")Dt=T.has(Lt.id)?N[T.get(Lt.id)]:ft.get(Lt.id);else Dt=T.has(Lt.id)?S[T.get(Lt.id)]:ft.get(Lt.id);if(gt.set(Lt.id,Dt),Dt<gt.get(Nt)+Lt.gap){var jt=gt.get(Nt)+Lt.gap-Dt;At.get(Nt).forEach(function(qt){gt.set(qt,gt.get(qt)-jt)})}}else gt.set(Lt.id,gt.get(Nt)+Lt.gap);if(Ot.set(Lt.id,Ot.get(Lt.id)-1),Ot.get(Lt.id)==0)It.push(Lt.id);if(lt)At.set(Lt.id,Rt(At.get(Nt),At.get(Lt.id)))})};while(It.length!=0)Tt();if(lt){var Ft=new Set;ot.forEach(function(Mt,Nt){if(Mt.length==0)Ft.add(Nt)});var Vt=[];At.forEach(function(Mt,Nt){if(Ft.has(Nt)){var St=!1,Lt=!0,Dt=!1,jt=void 0;try{for(var qt=Mt[Symbol.iterator](),le;!(Lt=(le=qt.next()).done);Lt=!0){var Zt=le.value;if(lt.has(Zt))St=!0}}catch(Jt){Dt=!0,jt=Jt}finally{try{if(!Lt&&qt.return)qt.return()}finally{if(Dt)throw jt}}if(!St){var Xt=!1,ge=void 0;if(Vt.forEach(function(Jt,ae){if(Jt.has([].concat(g(Mt))[0]))Xt=!0,ge=ae}),!Xt)Vt.push(new Set(Mt));else Mt.forEach(function(Jt){Vt[ge].add(Jt)})}}}),Vt.forEach(function(Mt,Nt){var{POSITIVE_INFINITY:St,POSITIVE_INFINITY:Lt,NEGATIVE_INFINITY:Dt,NEGATIVE_INFINITY:jt}=Number,qt=!0,le=!1,Zt=void 0;try{for(var Xt=Mt[Symbol.iterator](),ge;!(qt=(ge=Xt.next()).done);qt=!0){var Jt=ge.value,ae=void 0;if(st=="horizontal")ae=T.has(Jt)?N[T.get(Jt)]:ft.get(Jt);else ae=T.has(Jt)?S[T.get(Jt)]:ft.get(Jt);var fe=gt.get(Jt);if(ae<St)St=ae;if(ae>Dt)Dt=ae;if(fe<Lt)Lt=fe;if(fe>jt)jt=fe}}catch(Te){le=!0,Zt=Te}finally{try{if(!qt&&Xt.return)Xt.return()}finally{if(le)throw Zt}}var Ie=(St+Dt)/2-(Lt+jt)/2,ve=!0,ye=!1,me=void 0;try{for(var pe=Mt[Symbol.iterator](),Oe;!(ve=(Oe=pe.next()).done);ve=!0){var Ee=Oe.value;gt.set(Ee,gt.get(Ee)+Ie)}}catch(Te){ye=!0,me=Te}finally{try{if(!ve&&pe.return)pe.return()}finally{if(ye)throw me}}})}return gt},nt=function(ot){var st=0,lt=0,ft=0,pt=0;if(ot.forEach(function(At){if(At.left)N[T.get(At.left)]-N[T.get(At.right)]>=0?st++:lt++;else S[T.get(At.top)]-S[T.get(At.bottom)]>=0?ft++:pt++}),st>lt&&ft>pt)for(var Rt=0;Rt<T.size;Rt++)N[Rt]=-1*N[Rt],S[Rt]=-1*S[Rt];else if(st>lt)for(var Ot=0;Ot<T.size;Ot++)N[Ot]=-1*N[Ot];else if(ft>pt)for(var gt=0;gt<T.size;gt++)S[gt]=-1*S[gt]},h=function(ot){var st=[],lt=new y,ft=new Set,pt=0;return ot.forEach(function(Rt,Ot){if(!ft.has(Ot)){st[pt]=[];var gt=Ot;lt.push(gt),ft.add(gt),st[pt].push(gt);while(lt.length!=0){gt=lt.shift();var At=ot.get(gt);At.forEach(function(It){if(!ft.has(It.id))lt.push(It.id),ft.add(It.id),st[pt].push(It.id)})}pt++}}),st},w=function(ot){var st=new Map;return ot.forEach(function(lt,ft){st.set(ft,[])}),ot.forEach(function(lt,ft){lt.forEach(function(pt){st.get(ft).push(pt),st.get(pt.id).push({id:ft,gap:pt.gap,direction:pt.direction})})}),st},E=function(ot){var st=new Map;return ot.forEach(function(lt,ft){st.set(ft,[])}),ot.forEach(function(lt,ft){lt.forEach(function(pt){st.get(pt.id).push({id:ft,gap:pt.gap,direction:pt.direction})})}),st},D=[],m=[],W=!1,Y=!1,j=new Set,Q=new Map,z=new Map,ct=[];if(f.fixedNodeConstraint)f.fixedNodeConstraint.forEach(function(et){j.add(et.nodeId)});if(f.relativePlacementConstraint)f.relativePlacementConstraint.forEach(function(et){if(et.left){if(Q.has(et.left))Q.get(et.left).push({id:et.right,gap:et.gap,direction:"horizontal"});else Q.set(et.left,[{id:et.right,gap:et.gap,direction:"horizontal"}]);if(!Q.has(et.right))Q.set(et.right,[])}else{if(Q.has(et.top))Q.get(et.top).push({id:et.bottom,gap:et.gap,direction:"vertical"});else Q.set(et.top,[{id:et.bottom,gap:et.gap,direction:"vertical"}]);if(!Q.has(et.bottom))Q.set(et.bottom,[])}}),z=w(Q),ct=h(z);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>1)f.fixedNodeConstraint.forEach(function(et,ot){D[ot]=[et.position.x,et.position.y],m[ot]=[N[T.get(et.nodeId)],S[T.get(et.nodeId)]]}),W=!0;else if(f.alignmentConstraint)(function(){var et=0;if(f.alignmentConstraint.vertical){var ot=f.alignmentConstraint.vertical,st=function(gt){var At=new Set;ot[gt].forEach(function(Ft){At.add(Ft)});var It=new Set([].concat(g(At)).filter(function(Ft){return j.has(Ft)})),Tt=void 0;if(It.size>0)Tt=N[T.get(It.values().next().value)];else Tt=ut(At).x;ot[gt].forEach(function(Ft){D[et]=[Tt,S[T.get(Ft)]],m[et]=[N[T.get(Ft)],S[T.get(Ft)]],et++})};for(var lt=0;lt<ot.length;lt++)st(lt);W=!0}if(f.alignmentConstraint.horizontal){var ft=f.alignmentConstraint.horizontal,pt=function(gt){var At=new Set;ft[gt].forEach(function(Ft){At.add(Ft)});var It=new Set([].concat(g(At)).filter(function(Ft){return j.has(Ft)})),Tt=void 0;if(It.size>0)Tt=N[T.get(It.values().next().value)];else Tt=ut(At).y;ft[gt].forEach(function(Ft){D[et]=[N[T.get(Ft)],Tt],m[et]=[N[T.get(Ft)],S[T.get(Ft)]],et++})};for(var Rt=0;Rt<ft.length;Rt++)pt(Rt);W=!0}if(f.relativePlacementConstraint)Y=!0})();else if(f.relativePlacementConstraint){var mt=0,J=0;for(var yt=0;yt<ct.length;yt++)if(ct[yt].length>mt)mt=ct[yt].length,J=yt;if(mt<z.size/2)nt(f.relativePlacementConstraint),W=!1,Y=!1;else{var ht=new Map,U=new Map,rt=[];ct[J].forEach(function(et){Q.get(et).forEach(function(ot){if(ot.direction=="horizontal"){if(ht.has(et))ht.get(et).push(ot);else ht.set(et,[ot]);if(!ht.has(ot.id))ht.set(ot.id,[]);rt.push({left:et,right:ot.id})}else{if(U.has(et))U.get(et).push(ot);else U.set(et,[ot]);if(!U.has(ot.id))U.set(ot.id,[]);rt.push({top:et,bottom:ot.id})}})}),nt(rt),Y=!1;var at=H(ht,"horizontal"),vt=H(U,"vertical");ct[J].forEach(function(et,ot){if(m[ot]=[N[T.get(et)],S[T.get(et)]],D[ot]=[],at.has(et))D[ot][0]=at.get(et);else D[ot][0]=N[T.get(et)];if(vt.has(et))D[ot][1]=vt.get(et);else D[ot][1]=S[T.get(et)]}),W=!0}}if(W){var Ct=void 0,Ht=i.transpose(D),Kt=i.transpose(m);for(var dt=0;dt<Ht.length;dt++)Ht[dt]=i.multGamma(Ht[dt]),Kt[dt]=i.multGamma(Kt[dt]);var ie=i.multMat(Ht,i.transpose(Kt)),$t=t.svd(ie);Ct=i.multMat($t.V,i.transpose($t.U));for(var wt=0;wt<T.size;wt++){var Et=[N[wt],S[wt]],bt=[Ct[0][0],Ct[1][0]],Gt=[Ct[0][1],Ct[1][1]];N[wt]=i.dotProduct(Et,bt),S[wt]=i.dotProduct(Et,Gt)}if(Y)nt(f.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>0){var Wt={x:0,y:0};f.fixedNodeConstraint.forEach(function(et,ot){var st={x:N[T.get(et.nodeId)],y:S[T.get(et.nodeId)]},lt=et.position,ft=_(lt,st);Wt.x+=ft.x,Wt.y+=ft.y}),Wt.x/=f.fixedNodeConstraint.length,Wt.y/=f.fixedNodeConstraint.length,N.forEach(function(et,ot){N[ot]+=Wt.x}),S.forEach(function(et,ot){S[ot]+=Wt.y}),f.fixedNodeConstraint.forEach(function(et){N[T.get(et.nodeId)]=et.position.x,S[T.get(et.nodeId)]=et.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical){var Ut=f.alignmentConstraint.vertical,Yt=function(ot){var st=new Set;Ut[ot].forEach(function(pt){st.add(pt)});var lt=new Set([].concat(g(st)).filter(function(pt){return j.has(pt)})),ft=void 0;if(lt.size>0)ft=N[T.get(lt.values().next().value)];else ft=ut(st).x;st.forEach(function(pt){if(!j.has(pt))N[T.get(pt)]=ft})};for(var Bt=0;Bt<Ut.length;Bt++)Yt(Bt)}if(f.alignmentConstraint.horizontal){var Qt=f.alignmentConstraint.horizontal,he=function(ot){var st=new Set;Qt[ot].forEach(function(pt){st.add(pt)});var lt=new Set([].concat(g(st)).filter(function(pt){return j.has(pt)})),ft=void 0;if(lt.size>0)ft=S[T.get(lt.values().next().value)];else ft=ut(st).y;st.forEach(function(pt){if(!j.has(pt))S[T.get(pt)]=ft})};for(var te=0;te<Qt.length;te++)he(te)}}if(f.relativePlacementConstraint)(function(){var et=new Map,ot=new Map,st=new Map,lt=new Map,ft=new Map,pt=new Map,Rt=new Set,Ot=new Set;if(j.forEach(function(re){Rt.add(re),Ot.add(re)}),f.alignmentConstraint){if(f.alignmentConstraint.vertical){var gt=f.alignmentConstraint.vertical,At=function(Pt){st.set("dummy"+Pt,[]),gt[Pt].forEach(function(zt){if(et.set(zt,"dummy"+Pt),st.get("dummy"+Pt).push(zt),j.has(zt))Rt.add("dummy"+Pt)}),ft.set("dummy"+Pt,N[T.get(gt[Pt][0])])};for(var It=0;It<gt.length;It++)At(It)}if(f.alignmentConstraint.horizontal){var Tt=f.alignmentConstraint.horizontal,Ft=function(Pt){lt.set("dummy"+Pt,[]),Tt[Pt].forEach(function(zt){if(ot.set(zt,"dummy"+Pt),lt.get("dummy"+Pt).push(zt),j.has(zt))Ot.add("dummy"+Pt)}),pt.set("dummy"+Pt,S[T.get(Tt[Pt][0])])};for(var Vt=0;Vt<Tt.length;Vt++)Ft(Vt)}}var Mt=new Map,Nt=new Map,St=function(Pt){Q.get(Pt).forEach(function(zt){var ue=void 0,ce=void 0;if(zt.direction=="horizontal"){if(ue=et.get(Pt)?et.get(Pt):Pt,et.get(zt.id))ce={id:et.get(zt.id),gap:zt.gap,direction:zt.direction};else ce=zt;if(Mt.has(ue))Mt.get(ue).push(ce);else Mt.set(ue,[ce]);if(!Mt.has(ce.id))Mt.set(ce.id,[])}else{if(ue=ot.get(Pt)?ot.get(Pt):Pt,ot.get(zt.id))ce={id:ot.get(zt.id),gap:zt.gap,direction:zt.direction};else ce=zt;if(Nt.has(ue))Nt.get(ue).push(ce);else Nt.set(ue,[ce]);if(!Nt.has(ce.id))Nt.set(ce.id,[])}})},Lt=!0,Dt=!1,jt=void 0;try{for(var qt=Q.keys()[Symbol.iterator](),le;!(Lt=(le=qt.next()).done);Lt=!0){var Zt=le.value;St(Zt)}}catch(re){Dt=!0,jt=re}finally{try{if(!Lt&&qt.return)qt.return()}finally{if(Dt)throw jt}}var Xt=w(Mt),ge=w(Nt),Jt=h(Xt),ae=h(ge),fe=E(Mt),Ie=E(Nt),ve=[],ye=[];Jt.forEach(function(re,Pt){ve[Pt]=[],re.forEach(function(zt){if(fe.get(zt).length==0)ve[Pt].push(zt)})}),ae.forEach(function(re,Pt){ye[Pt]=[],re.forEach(function(zt){if(Ie.get(zt).length==0)ye[Pt].push(zt)})});var me=H(Mt,"horizontal",Rt,ft,ve),pe=H(Nt,"vertical",Ot,pt,ye),Oe=function(Pt){if(st.get(Pt))st.get(Pt).forEach(function(zt){N[T.get(zt)]=me.get(Pt)});else N[T.get(Pt)]=me.get(Pt)},Ee=!0,Te=!1,Ze=void 0;try{for(var Re=me.keys()[Symbol.iterator](),ke;!(Ee=(ke=Re.next()).done);Ee=!0){var Se=ke.value;Oe(Se)}}catch(re){Te=!0,Ze=re}finally{try{if(!Ee&&Re.return)Re.return()}finally{if(Te)throw Ze}}var dr=function(Pt){if(lt.get(Pt))lt.get(Pt).forEach(function(zt){S[T.get(zt)]=pe.get(Pt)});else S[T.get(Pt)]=pe.get(Pt)},Fe=!0,qe=!1,Qe=void 0;try{for(var be=pe.keys()[Symbol.iterator](),Je;!(Fe=(Je=be.next()).done);Fe=!0){var Se=Je.value;dr(Se)}}catch(re){qe=!0,Qe=re}finally{try{if(!Fe&&be.return)be.return()}finally{if(qe)throw Qe}}})()}for(var ne=0;ne<V.length;ne++){var _t=V[ne];if(_t.getChild()==null)_t.setCenter(N[T.get(_t.id)],S[T.get(_t.id)])}},s.exports=c},551:(s)=>{s.exports=C}},x={};function v(s){var a=x[s];if(a!==void 0)return a.exports;var o=x[s]={exports:{}};return G[s](o,o.exports,v),o.exports}var l=v(45);return l})()})});var Ke=We(function(Ce,He){(function(G,x){if(typeof Ce==="object"&&typeof He==="object")He.exports=x(Xe());else if(typeof define==="function"&&define.amd)define(["cose-base"],x);else if(typeof Ce==="object")Ce.cytoscapeFcose=x(Xe());else G.cytoscapeFcose=x(G.coseBase)})(Ce,function(C){return(()=>{var G={658:(s)=>{s.exports=Object.assign!=null?Object.assign.bind(Object):function(a){for(var o=arguments.length,g=Array(o>1?o-1:0),r=1;r<o;r++)g[r-1]=arguments[r];return g.forEach(function(y){Object.keys(y).forEach(function(i){return a[i]=y[i]})}),a}},548:(s,a,o)=>{var g=function(){function i(t,c){var d=[],f=!0,F=!1,T=void 0;try{for(var N=t[Symbol.iterator](),S;!(f=(S=N.next()).done);f=!0)if(d.push(S.value),c&&d.length===c)break}catch(V){F=!0,T=V}finally{try{if(!f&&N.return)N.return()}finally{if(F)throw T}}return d}return function(t,c){if(Array.isArray(t))return t;else if(Symbol.iterator in Object(t))return i(t,c);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=o(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var t={};for(var c=0;c<i.length;c++)t[i[c].id()]=!0;var d=i.filter(function(f,F){if(typeof f==="number")f=F;var T=f.parent()[0];while(T!=null){if(t[T.id()])return!1;T=T.parent()[0]}return!0});return d},y.connectComponents=function(i,t,c,d){var f=new r,F=new Set,T=[],N=void 0,S=void 0,V=void 0,b=!1,Z=1,it=[],_=[],ut=function(){var nt=i.collection();_.push(nt);var h=c[0],w=i.collection();w.merge(h).merge(h.descendants().intersection(t)),T.push(h),w.forEach(function(m){f.push(m),F.add(m),nt.merge(m)});var E=function(){h=f.shift();var W=i.collection();h.neighborhood().nodes().forEach(function(z){if(t.intersection(h.edgesWith(z)).length>0)W.merge(z)});for(var Y=0;Y<W.length;Y++){var j=W[Y];if(N=c.intersection(j.union(j.ancestors())),N!=null&&!F.has(N[0])){var Q=N.union(N.descendants());Q.forEach(function(z){if(f.push(z),F.add(z),nt.merge(z),c.has(z))T.push(z)})}}};while(f.length!=0)E();if(nt.forEach(function(m){t.intersection(m.connectedEdges()).forEach(function(W){if(nt.has(W.source())&&nt.has(W.target()))nt.merge(W)})}),T.length==c.length)b=!0;if(!b||b&&Z>1){S=T[0],V=S.connectedEdges().length,T.forEach(function(m){if(m.connectedEdges().length<V)V=m.connectedEdges().length,S=m}),it.push(S.id());var D=i.collection();D.merge(T[0]),T.forEach(function(m){D.merge(m)}),T=[],c=c.difference(D),Z++}};do ut();while(!b);if(d){if(it.length>0)d.set("dummy"+(d.size+1),it)}return _},y.relocateComponent=function(i,t,c){if(!c.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:f,POSITIVE_INFINITY:F,NEGATIVE_INFINITY:T}=Number;if(c.quality=="draft"){var N=!0,S=!1,V=void 0;try{for(var b=t.nodeIndexes[Symbol.iterator](),Z;!(N=(Z=b.next()).done);N=!0){var it=Z.value,_=g(it,2),ut=_[0],H=_[1],nt=c.cy.getElementById(ut);if(nt){var h=nt.boundingBox(),w=t.xCoords[H]-h.w/2,E=t.xCoords[H]+h.w/2,D=t.yCoords[H]-h.h/2,m=t.yCoords[H]+h.h/2;if(w<d)d=w;if(E>f)f=E;if(D<F)F=D;if(m>T)T=m}}}catch(z){S=!0,V=z}finally{try{if(!N&&b.return)b.return()}finally{if(S)throw V}}var W=i.x-(f+d)/2,Y=i.y-(T+F)/2;t.xCoords=t.xCoords.map(function(z){return z+W}),t.yCoords=t.yCoords.map(function(z){return z+Y})}else{Object.keys(t).forEach(function(z){var ct=t[z],mt=ct.getRect().x,J=ct.getRect().x+ct.getRect().width,yt=ct.getRect().y,ht=ct.getRect().y+ct.getRect().height;if(mt<d)d=mt;if(J>f)f=J;if(yt<F)F=yt;if(ht>T)T=ht});var j=i.x-(f+d)/2,Q=i.y-(T+F)/2;Object.keys(t).forEach(function(z){var ct=t[z];ct.setCenter(ct.getCenterX()+j,ct.getCenterY()+Q)})}}},y.calcBoundingBox=function(i,t,c,d){var{MAX_SAFE_INTEGER:f,MIN_SAFE_INTEGER:F,MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:N}=Number,S=void 0,V=void 0,b=void 0,Z=void 0,it=i.descendants().not(":parent"),_=it.length;for(var ut=0;ut<_;ut++){var H=it[ut];if(S=t[d.get(H.id())]-H.width()/2,V=t[d.get(H.id())]+H.width()/2,b=c[d.get(H.id())]-H.height()/2,Z=c[d.get(H.id())]+H.height()/2,f>S)f=S;if(F<V)F=V;if(T>b)T=b;if(N<Z)N=Z}var nt={};return nt.topLeftX=f,nt.topLeftY=T,nt.width=F-f,nt.height=N-T,nt},y.calcParentsWithoutChildren=function(i,t){var c=i.collection();return t.nodes(":parent").forEach(function(d){var f=!1;if(d.children().forEach(function(F){if(F.css("display")!="none")f=!0}),!f)c.merge(d)}),c},s.exports=y},816:(s,a,o)=>{var g=o(548),r=o(140).CoSELayout,y=o(140).CoSENode,i=o(140).layoutBase.PointD,t=o(140).layoutBase.DimensionD,c=o(140).layoutBase.LayoutConstants,d=o(140).layoutBase.FDLayoutConstants,f=o(140).CoSEConstants,F=function(N,S){var{cy:V,eles:b}=N,Z=b.nodes(),it=b.edges(),_=void 0,ut=void 0,H=void 0,nt={};if(N.randomize)_=S.nodeIndexes,ut=S.xCoords,H=S.yCoords;var h=function(z){return typeof z==="function"},w=function(z,ct){if(h(z))return z(ct);else return z},E=g.calcParentsWithoutChildren(V,b),D=function Q(z,ct,mt,J){var yt=ct.length;for(var ht=0;ht<yt;ht++){var U=ct[ht],rt=null;if(U.intersection(E).length==0)rt=U.children();var at=void 0,vt=U.layoutDimensions({nodeDimensionsIncludeLabels:J.nodeDimensionsIncludeLabels});if(U.outerWidth()!=null&&U.outerHeight()!=null)if(J.randomize)if(!U.isParent())at=z.add(new y(mt.graphManager,new i(ut[_.get(U.id())]-vt.w/2,H[_.get(U.id())]-vt.h/2),new t(parseFloat(vt.w),parseFloat(vt.h))));else{var Ct=g.calcBoundingBox(U,ut,H,_);if(U.intersection(E).length==0)at=z.add(new y(mt.graphManager,new i(Ct.topLeftX,Ct.topLeftY),new t(Ct.width,Ct.height)));else at=z.add(new y(mt.graphManager,new i(Ct.topLeftX,Ct.topLeftY),new t(parseFloat(vt.w),parseFloat(vt.h))))}else at=z.add(new y(mt.graphManager,new i(U.position("x")-vt.w/2,U.position("y")-vt.h/2),new t(parseFloat(vt.w),parseFloat(vt.h))));else at=z.add(new y(this.graphManager));if(at.id=U.data("id"),at.nodeRepulsion=w(J.nodeRepulsion,U),at.paddingLeft=parseInt(U.css("padding")),at.paddingTop=parseInt(U.css("padding")),at.paddingRight=parseInt(U.css("padding")),at.paddingBottom=parseInt(U.css("padding")),J.nodeDimensionsIncludeLabels)at.labelWidth=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,at.labelHeight=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,at.labelPosVertical=U.css("text-valign"),at.labelPosHorizontal=U.css("text-halign");if(nt[U.data("id")]=at,isNaN(at.rect.x))at.rect.x=0;if(isNaN(at.rect.y))at.rect.y=0;if(rt!=null&&rt.length>0){var Ht=void 0;Ht=mt.getGraphManager().add(mt.newGraph(),at),Q(Ht,rt,mt,J)}}},m=function(z,ct,mt){var J=0,yt=0;for(var ht=0;ht<mt.length;ht++){var U=mt[ht],rt=nt[U.data("source")],at=nt[U.data("target")];if(rt&&at&&rt!==at&&rt.getEdgesBetween(at).length==0){var vt=ct.add(z.newEdge(),rt,at);vt.id=U.id(),vt.idealLength=w(N.idealEdgeLength,U),vt.edgeElasticity=w(N.edgeElasticity,U),J+=vt.idealLength,yt++}}if(N.idealEdgeLength!=null){if(yt>0)f.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=J/yt;else if(!h(N.idealEdgeLength))f.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else f.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;f.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},W=function(z,ct){if(ct.fixedNodeConstraint)z.constraints.fixedNodeConstraint=ct.fixedNodeConstraint;if(ct.alignmentConstraint)z.constraints.alignmentConstraint=ct.alignmentConstraint;if(ct.relativePlacementConstraint)z.constraints.relativePlacementConstraint=ct.relativePlacementConstraint};if(N.nestingFactor!=null)f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)f.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)f.MAX_ITERATIONS=d.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)f.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)f.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)f.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")c.QUALITY=2;else c.QUALITY=0;if(f.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!N.randomize,f.ANIMATE=d.ANIMATE=c.ANIMATE=N.animate,f.TILE=N.tile,f.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!N.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1;if(N.step=="enforced")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1;if(N.step=="cose")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)f.TREE_REDUCTION_ON_INCREMENTAL=!1;else f.TREE_REDUCTION_ON_INCREMENTAL=!0;var Y=new r,j=Y.newGraphManager();return D(j.addRoot(),g.getTopMostNodes(Z),Y,N),m(Y,j,it),W(Y,N),Y.runLayout(),nt};s.exports={coseLayout:F}},212:(s,a,o)=>{var g=function(){function N(S,V){for(var b=0;b<V.length;b++){var Z=V[b];if(Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z)Z.writable=!0;Object.defineProperty(S,Z.key,Z)}}return function(S,V,b){if(V)N(S.prototype,V);if(b)N(S,b);return S}}();function r(N,S){if(!(N instanceof S))throw TypeError("Cannot call a class as a function")}var y=o(658),i=o(548),t=o(657),c=t.spectralLayout,d=o(816),f=d.coseLayout,F=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(S){return 4500},idealEdgeLength:function(S){return 50},edgeElasticity:function(S){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),T=function(){function N(S){r(this,N),this.options=y({},F,S)}return g(N,[{key:"run",value:function(){var V=this,b=this.options,{cy:Z,eles:it}=b,_=[],ut=void 0,H=void 0,nt=[],h=void 0,w=[];if(b.fixedNodeConstraint&&(!Array.isArray(b.fixedNodeConstraint)||b.fixedNodeConstraint.length==0))b.fixedNodeConstraint=void 0;if(b.alignmentConstraint){if(b.alignmentConstraint.vertical&&(!Array.isArray(b.alignmentConstraint.vertical)||b.alignmentConstraint.vertical.length==0))b.alignmentConstraint.vertical=void 0;if(b.alignmentConstraint.horizontal&&(!Array.isArray(b.alignmentConstraint.horizontal)||b.alignmentConstraint.horizontal.length==0))b.alignmentConstraint.horizontal=void 0}if(b.relativePlacementConstraint&&(!Array.isArray(b.relativePlacementConstraint)||b.relativePlacementConstraint.length==0))b.relativePlacementConstraint=void 0;var E=b.fixedNodeConstraint||b.alignmentConstraint||b.relativePlacementConstraint;if(E)b.tile=!1,b.packComponents=!1;var D=void 0,m=!1;if(Z.layoutUtilities&&b.packComponents){if(D=Z.layoutUtilities("get"),!D)D=Z.layoutUtilities();m=!0}if(it.nodes().length>0)if(!m){var W=b.eles.boundingBox();if(w.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),b.randomize){var Y=c(b);_.push(Y)}if(b.quality=="default"||b.quality=="proof")nt.push(f(b,_[0])),i.relocateComponent(w[0],nt[0],b);else i.relocateComponent(w[0],_[0],b)}else{var j=i.getTopMostNodes(b.eles.nodes());if(h=i.connectComponents(Z,b.eles,j),h.forEach(function(wt){var Et=wt.boundingBox();w.push({x:Et.x1+Et.w/2,y:Et.y1+Et.h/2})}),b.randomize)h.forEach(function(wt){b.eles=wt,_.push(c(b))});if(b.quality=="default"||b.quality=="proof"){var Q=Z.collection();if(b.tile){var z=new Map,ct=[],mt=[],J=0,yt={nodeIndexes:z,xCoords:ct,yCoords:mt},ht=[];if(h.forEach(function(wt,Et){if(wt.edges().length==0)wt.nodes().forEach(function(bt,Gt){if(Q.merge(wt.nodes()[Gt]),!bt.isParent())yt.nodeIndexes.set(wt.nodes()[Gt].id(),J++),yt.xCoords.push(wt.nodes()[0].position().x),yt.yCoords.push(wt.nodes()[0].position().y)}),ht.push(Et)}),Q.length>1){var U=Q.boundingBox();w.push({x:U.x1+U.w/2,y:U.y1+U.h/2}),h.push(Q),_.push(yt);for(var rt=ht.length-1;rt>=0;rt--)h.splice(ht[rt],1),_.splice(ht[rt],1),w.splice(ht[rt],1)}}h.forEach(function(wt,Et){b.eles=wt,nt.push(f(b,_[Et])),i.relocateComponent(w[Et],nt[Et],b)})}else h.forEach(function(wt,Et){i.relocateComponent(w[Et],_[Et],b)});var at=new Set;if(h.length>1){var vt=[],Ct=it.filter(function(wt){return wt.css("display")=="none"});h.forEach(function(wt,Et){var bt=void 0;if(b.quality=="draft")bt=_[Et].nodeIndexes;if(wt.nodes().not(Ct).length>0){var Gt={};Gt.edges=[],Gt.nodes=[];var Wt=void 0;if(wt.nodes().not(Ct).forEach(function(Ut){if(b.quality=="draft")if(!Ut.isParent())Wt=bt.get(Ut.id()),Gt.nodes.push({x:_[Et].xCoords[Wt]-Ut.boundingbox().w/2,y:_[Et].yCoords[Wt]-Ut.boundingbox().h/2,width:Ut.boundingbox().w,height:Ut.boundingbox().h});else{var Yt=i.calcBoundingBox(Ut,_[Et].xCoords,_[Et].yCoords,bt);Gt.nodes.push({x:Yt.topLeftX,y:Yt.topLeftY,width:Yt.width,height:Yt.height})}else if(nt[Et][Ut.id()])Gt.nodes.push({x:nt[Et][Ut.id()].getLeft(),y:nt[Et][Ut.id()].getTop(),width:nt[Et][Ut.id()].getWidth(),height:nt[Et][Ut.id()].getHeight()})}),wt.edges().forEach(function(Ut){var Yt=Ut.source(),Bt=Ut.target();if(Yt.css("display")!="none"&&Bt.css("display")!="none"){if(b.quality=="draft"){var Qt=bt.get(Yt.id()),he=bt.get(Bt.id()),te=[],ne=[];if(Yt.isParent()){var _t=i.calcBoundingBox(Yt,_[Et].xCoords,_[Et].yCoords,bt);te.push(_t.topLeftX+_t.width/2),te.push(_t.topLeftY+_t.height/2)}else te.push(_[Et].xCoords[Qt]),te.push(_[Et].yCoords[Qt]);if(Bt.isParent()){var et=i.calcBoundingBox(Bt,_[Et].xCoords,_[Et].yCoords,bt);ne.push(et.topLeftX+et.width/2),ne.push(et.topLeftY+et.height/2)}else ne.push(_[Et].xCoords[he]),ne.push(_[Et].yCoords[he]);Gt.edges.push({startX:te[0],startY:te[1],endX:ne[0],endY:ne[1]})}else if(nt[Et][Yt.id()]&&nt[Et][Bt.id()])Gt.edges.push({startX:nt[Et][Yt.id()].getCenterX(),startY:nt[Et][Yt.id()].getCenterY(),endX:nt[Et][Bt.id()].getCenterX(),endY:nt[Et][Bt.id()].getCenterY()})}}),Gt.nodes.length>0)vt.push(Gt),at.add(Et)}});var Ht=D.packComponents(vt,b.randomize).shifts;if(b.quality=="draft")_.forEach(function(wt,Et){var bt=wt.xCoords.map(function(Wt){return Wt+Ht[Et].dx}),Gt=wt.yCoords.map(function(Wt){return Wt+Ht[Et].dy});wt.xCoords=bt,wt.yCoords=Gt});else{var Kt=0;at.forEach(function(wt){Object.keys(nt[wt]).forEach(function(Et){var bt=nt[wt][Et];bt.setCenter(bt.getCenterX()+Ht[Kt].dx,bt.getCenterY()+Ht[Kt].dy)}),Kt++})}}}var dt=function(Et,bt){if(b.quality=="default"||b.quality=="proof"){if(typeof Et==="number")Et=bt;var Gt=void 0,Wt=void 0,Ut=Et.data("id");if(nt.forEach(function(Bt){if(Ut in Bt)Gt={x:Bt[Ut].getRect().getCenterX(),y:Bt[Ut].getRect().getCenterY()},Wt=Bt[Ut]}),b.nodeDimensionsIncludeLabels){if(Wt.labelWidth){if(Wt.labelPosHorizontal=="left")Gt.x+=Wt.labelWidth/2;else if(Wt.labelPosHorizontal=="right")Gt.x-=Wt.labelWidth/2}if(Wt.labelHeight){if(Wt.labelPosVertical=="top")Gt.y+=Wt.labelHeight/2;else if(Wt.labelPosVertical=="bottom")Gt.y-=Wt.labelHeight/2}}if(Gt==null)Gt={x:Et.position("x"),y:Et.position("y")};return{x:Gt.x,y:Gt.y}}else{var Yt=void 0;if(_.forEach(function(Bt){var Qt=Bt.nodeIndexes.get(Et.id());if(Qt!=null)Yt={x:Bt.xCoords[Qt],y:Bt.yCoords[Qt]}}),Yt==null)Yt={x:Et.position("x"),y:Et.position("y")};return{x:Yt.x,y:Yt.y}}};if(b.quality=="default"||b.quality=="proof"||b.randomize){var ie=i.calcParentsWithoutChildren(Z,it),$t=it.filter(function(wt){return wt.css("display")=="none"});if(b.eles=it.not($t),it.nodes().not(":parent").not($t).layoutPositions(V,b,dt),ie.length>0)ie.forEach(function(wt){wt.position(dt(wt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();s.exports=T},657:(s,a,o)=>{var g=o(548),r=o(140).layoutBase.Matrix,y=o(140).layoutBase.SVD,i=function(c){var{cy:d,eles:f}=c,F=f.nodes(),T=f.nodes(":parent"),N=new Map,S=new Map,V=new Map,b=[],Z=[],it=[],_=[],ut=[],H=[],nt=[],h=[],w=void 0,E=void 0,D=1e8,m=0.000000001,{piTol:W,samplingType:Y,nodeSeparation:j}=c,Q=void 0,z=function(){var st=0,lt=0,ft=!1;while(lt<Q){st=Math.floor(Math.random()*E),ft=!1;for(var pt=0;pt<lt;pt++)if(_[pt]==st){ft=!0;break}if(!ft)_[lt]=st,lt++;else continue}},ct=function(st,lt,ft){var pt=[],Rt=0,Ot=0,gt=0,At=void 0,It=[],Tt=0,Ft=1;for(var Vt=0;Vt<E;Vt++)It[Vt]=D;pt[Ot]=st,It[st]=0;while(Ot>=Rt){gt=pt[Rt++];var Mt=b[gt];for(var Nt=0;Nt<Mt.length;Nt++)if(At=S.get(Mt[Nt]),It[At]==D)It[At]=It[gt]+1,pt[++Ot]=At;H[gt][lt]=It[gt]*j}if(ft){for(var St=0;St<E;St++)if(H[St][lt]<ut[St])ut[St]=H[St][lt];for(var Lt=0;Lt<E;Lt++)if(ut[Lt]>Tt)Tt=ut[Lt],Ft=Lt}return Ft},mt=function(st){var lt=void 0;if(!st){z();for(var ft=0;ft<Q;ft++)ct(_[ft],ft,st,!1)}else{lt=Math.floor(Math.random()*E),w=lt;for(var pt=0;pt<E;pt++)ut[pt]=D;for(var Rt=0;Rt<Q;Rt++)_[Rt]=lt,lt=ct(lt,Rt,st)}for(var Ot=0;Ot<E;Ot++)for(var gt=0;gt<Q;gt++)H[Ot][gt]*=H[Ot][gt];for(var At=0;At<Q;At++)nt[At]=[];for(var It=0;It<Q;It++)for(var Tt=0;Tt<Q;Tt++)nt[It][Tt]=H[_[Tt]][It]},J=function(){var st=y.svd(nt),{S:lt,U:ft,V:pt}=st,Rt=lt[0]*lt[0]*lt[0],Ot=[];for(var gt=0;gt<Q;gt++){Ot[gt]=[];for(var At=0;At<Q;At++)if(Ot[gt][At]=0,gt==At)Ot[gt][At]=lt[gt]/(lt[gt]*lt[gt]+Rt/(lt[gt]*lt[gt]))}h=r.multMat(r.multMat(pt,Ot),r.transpose(ft))},yt=function(){var st=void 0,lt=void 0,ft=[],pt=[],Rt=[],Ot=[];for(var gt=0;gt<E;gt++)ft[gt]=Math.random(),pt[gt]=Math.random();ft=r.normalize(ft),pt=r.normalize(pt);var At=0,It=m,Tt=m,Ft=void 0;while(!0){At++;for(var Vt=0;Vt<E;Vt++)Rt[Vt]=ft[Vt];if(ft=r.multGamma(r.multL(r.multGamma(Rt),H,h)),st=r.dotProduct(Rt,ft),ft=r.normalize(ft),It=r.dotProduct(Rt,ft),Ft=Math.abs(It/Tt),Ft<=1+W&&Ft>=1)break;Tt=It}for(var Mt=0;Mt<E;Mt++)Rt[Mt]=ft[Mt];At=0,Tt=m;while(!0){At++;for(var Nt=0;Nt<E;Nt++)Ot[Nt]=pt[Nt];if(Ot=r.minusOp(Ot,r.multCons(Rt,r.dotProduct(Rt,Ot))),pt=r.multGamma(r.multL(r.multGamma(Ot),H,h)),lt=r.dotProduct(Ot,pt),pt=r.normalize(pt),It=r.dotProduct(Ot,pt),Ft=Math.abs(It/Tt),Ft<=1+W&&Ft>=1)break;Tt=It}for(var St=0;St<E;St++)Ot[St]=pt[St];Z=r.multCons(Rt,Math.sqrt(Math.abs(st))),it=r.multCons(Ot,Math.sqrt(Math.abs(lt)))};g.connectComponents(d,f,g.getTopMostNodes(F),N),T.forEach(function(ot){g.connectComponents(d,f,g.getTopMostNodes(ot.descendants().intersection(f)),N)});var ht=0;for(var U=0;U<F.length;U++)if(!F[U].isParent())S.set(F[U].id(),ht++);var rt=!0,at=!1,vt=void 0;try{for(var Ct=N.keys()[Symbol.iterator](),Ht;!(rt=(Ht=Ct.next()).done);rt=!0){var Kt=Ht.value;S.set(Kt,ht++)}}catch(ot){at=!0,vt=ot}finally{try{if(!rt&&Ct.return)Ct.return()}finally{if(at)throw vt}}for(var dt=0;dt<S.size;dt++)b[dt]=[];T.forEach(function(ot){var st=ot.children().intersection(f);while(st.nodes(":childless").length==0)st=st.nodes()[0].children().intersection(f);var lt=0,ft=st.nodes(":childless")[0].connectedEdges().length;st.nodes(":childless").forEach(function(pt,Rt){if(pt.connectedEdges().length<ft)ft=pt.connectedEdges().length,lt=Rt}),V.set(ot.id(),st.nodes(":childless")[lt].id())}),F.forEach(function(ot){var st=void 0;if(ot.isParent())st=S.get(V.get(ot.id()));else st=S.get(ot.id());ot.neighborhood().nodes().forEach(function(lt){if(f.intersection(ot.edgesWith(lt)).length>0)if(lt.isParent())b[st].push(V.get(lt.id()));else b[st].push(lt.id())})});var ie=function(st){var lt=S.get(st),ft=void 0;N.get(st).forEach(function(pt){if(d.getElementById(pt).isParent())ft=V.get(pt);else ft=pt;b[lt].push(ft),b[S.get(ft)].push(st)})},$t=!0,wt=!1,Et=void 0;try{for(var bt=N.keys()[Symbol.iterator](),Gt;!($t=(Gt=bt.next()).done);$t=!0){var Wt=Gt.value;ie(Wt)}}catch(ot){wt=!0,Et=ot}finally{try{if(!$t&&bt.return)bt.return()}finally{if(wt)throw Et}}E=S.size;var Ut=void 0;if(E>2){Q=E<c.sampleSize?E:c.sampleSize;for(var Yt=0;Yt<E;Yt++)H[Yt]=[];for(var Bt=0;Bt<Q;Bt++)h[Bt]=[];if(c.quality=="draft"||c.step=="all")mt(Y),J(),yt(),Ut={nodeIndexes:S,xCoords:Z,yCoords:it};else S.forEach(function(ot,st){Z.push(d.getElementById(st).position("x")),it.push(d.getElementById(st).position("y"))}),Ut={nodeIndexes:S,xCoords:Z,yCoords:it};return Ut}else{var Qt=S.keys(),he=d.getElementById(Qt.next().value),te=he.position(),ne=he.outerWidth();if(Z.push(te.x),it.push(te.y),E==2){var _t=d.getElementById(Qt.next().value),et=_t.outerWidth();Z.push(te.x+ne/2+et/2+c.idealEdgeLength),it.push(te.y)}return Ut={nodeIndexes:S,xCoords:Z,yCoords:it},Ut}};s.exports={spectralLayout:i}},579:(s,a,o)=>{var g=o(212),r=function(i){if(!i)return;i("layout","fcose",g)};if(typeof cytoscape<"u")r(cytoscape);s.exports=r},140:(s)=>{s.exports=C}},x={};function v(s){var a=x[s];if(a!==void 0)return a.exports;var o=x[s]={exports:{}};return G[s](o,o.exports,v),o.exports}var l=v(579);return l})()})});var ar=Pe(Ke(),1);var je={L:"left",R:"right",T:"top",B:"bottom"},_e={L:e((C)=>`${C},${C/2} 0,${C} 0,0`,"L"),R:e((C)=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:e((C)=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:e((C)=>`${C/2},0 ${C},${C} 0,${C}`,"B")},xe={L:e((C,G)=>C-G+2,"L"),R:e((C,G)=>C-2,"R"),T:e((C,G)=>C-G+2,"T"),B:e((C,G)=>C-2,"B")},vr=e(function(C){if(se(C))return C==="L"?"R":"L";else return C==="T"?"B":"T"},"getOppositeArchitectureDirection"),tr=e(function(C){let G=C;return G==="L"||G==="R"||G==="T"||G==="B"},"isArchitectureDirection"),se=e(function(C){let G=C;return G==="L"||G==="R"},"isArchitectureDirectionX"),de=e(function(C){let G=C;return G==="T"||G==="B"},"isArchitectureDirectionY"),Be=e(function(C,G){let x=se(C)&&de(G),v=de(C)&&se(G);return x||v},"isArchitectureDirectionXY"),yr=e(function(C){let G=C[0],x=C[1],v=se(G)&&de(x),l=de(G)&&se(x);return v||l},"isArchitecturePairXY"),mr=e(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),ze=e(function(C,G){let x=`${C}${G}`;return mr(x)?x:void 0},"getArchitectureDirectionPair"),Er=e(function([C,G],x){let v=x[0],l=x[1];if(se(v))if(de(l))return[C+(v==="L"?-1:1),G+(l==="T"?1:-1)];else return[C+(v==="L"?-1:1),G];else if(se(l))return[C+(l==="L"?1:-1),G+(v==="T"?1:-1)];else return[C,G+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Tr=e(function(C){if(C==="LT"||C==="TL")return[1,1];else if(C==="BL"||C==="LB")return[1,-1];else if(C==="BR"||C==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),Nr=e(function(C,G){if(Be(C,G))return"bend";else if(se(C))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),Lr=e(function(C){return C.type==="service"},"isArchitectureService"),wr=e(function(C){return C.type==="junction"},"isArchitectureJunction"),er=e((C,G)=>{let[x,v]=[C,G].sort();return`${JSON.stringify(x)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),rr=e((C)=>C.data(),"edgeData"),Le=e((C)=>C.data(),"nodeData"),Mr=B.architecture,ir=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=L,this.getAccTitle=R,this.setDiagramTitle=P,this.getDiagramTitle=O,this.getAccDescription=M,this.setAccDescription=I,this.clear()}static{e(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",A()}addService({id:C,icon:G,in:x,title:v,iconText:l}){if(this.registeredIds.has(C))throw Error(`The service id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(x!==void 0){if(C===x)throw Error(`The service [${C}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(x)==="node")throw Error(`The service [${C}]'s parent is not a group`)}this.registeredIds.set(C,"node"),this.nodes.set(C,{id:C,type:"service",icon:G,iconText:l,title:v,edges:[],in:x})}getServices(){return[...this.nodes.values()].filter(Lr)}addJunction({id:C,in:G}){if(this.registeredIds.has(C))throw Error(`The junction id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(G!==void 0){if(C===G)throw Error(`The junction [${C}] cannot be placed within itself`);if(!this.registeredIds.has(G))throw Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(G)==="node")throw Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds.set(C,"node"),this.nodes.set(C,{id:C,type:"junction",edges:[],in:G})}getJunctions(){return[...this.nodes.values()].filter(wr)}getNodes(){return[...this.nodes.values()]}getNode(C){return this.nodes.get(C)??null}addGroup({id:C,icon:G,in:x,title:v}){if(this.registeredIds.has(C))throw Error(`The group id [${C}] is already in use by another ${this.registeredIds.get(C)}`);if(x!==void 0){if(C===x)throw Error(`The group [${C}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(x)==="node")throw Error(`The group [${C}]'s parent is not a group`)}this.registeredIds.set(C,"group"),this.groups.set(C,{id:C,icon:G,title:v,in:x})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:C,rhsId:G,lhsDir:x,rhsDir:v,lhsInto:l,rhsInto:s,lhsGroup:a,rhsGroup:o,title:g}){if(!tr(x))throw Error(`Invalid direction given for left hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(x)}`);if(!tr(v))throw Error(`Invalid direction given for right hand side of edge ${C}--${G}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(C)&&!this.groups.has(C))throw Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(G)&&!this.groups.has(G))throw Error(`The right-hand id [${G}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(C).in,y=this.nodes.get(G).in;if(a&&r&&y&&r==y)throw Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(o&&r&&y&&r==y)throw Error(`The right-hand id [${G}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:C,lhsDir:x,lhsInto:l,lhsGroup:a,rhsId:G,rhsDir:v,rhsInto:s,rhsGroup:o,title:g};this.edges.push(i);let t=this.nodes.get(C),c=this.nodes.get(G);if(t&&c)t.edges.push(this.edges[this.edges.length-1]),c.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(C){if(C.members.length<2)throw Error(`An align directive requires at least two members; got ${C.members.length}`);let G=new Set;C.members.forEach((x)=>{if(this.registeredIds.get(x)!=="node")throw Error(`align ${C.direction} references [${x}], which is not a service or junction`);if(G.has(x))throw Error(`align ${C.direction} lists [${x}] more than once`);G.add(x)}),this.layoutHints.push(C)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let C=new Map,G=new Map;for(let[a,o]of this.nodes.entries()){let g=new Map;for(let r of o.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let t=Nr(r.lhsDir,r.rhsDir);if(t!=="bend")C.set(er(y,i),t)}if(r.lhsId===a){let t=ze(r.lhsDir,r.rhsDir);if(t)g.set(t,r.rhsId)}else{let t=ze(r.rhsDir,r.lhsDir);if(t)g.set(t,r.lhsId)}}G.set(a,g)}let x=new Set,v=new Set(G.keys()),l=e((a)=>{let o=new Map([[a,[0,0]]]),g=[a];while(g.length>0){let r=g.shift();if(r){x.add(r),v.delete(r);let y=G.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=o.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[t,c]=i;y.forEach((d,f)=>{if(!x.has(d))o.set(d,Er([t,c],f)),g.push(d)})}}return o},"BFS"),s=[];while(v.size>0){let a=v.values().next().value;s.push(l(a))}this.dataStructures={adjList:G,spatialMaps:s,groupAlignments:C}}return this.dataStructures}setElementForId(C,G){this.elements.set(C,G)}getElementById(C){return this.elements.get(C)}getConfig(){return K({...Mr,...k().architecture})}getConfigField(C){return this.getConfig()[C]}},Cr=e((C,G)=>{ee(C,G),C.groups.map((x)=>G.addGroup(x)),C.services.map((x)=>G.addService({...x,type:"service"})),C.junctions.map((x)=>G.addJunction({...x,type:"junction"})),C.edges.map((x)=>G.addEdge(x)),C.alignments?.map((x)=>G.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),nr={parser:{yy:void 0},parse:e(async(C)=>{let G=await oe("architecture",C);n.debug(G);let x=nr.parser?.yy;if(!(x instanceof ir))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Cr(G,x)},"parse")},Ar=e((C)=>`
|
|
2
2
|
.edge {
|
|
3
3
|
stroke-width: ${C.archEdgeWidth};
|
|
4
4
|
stroke: ${C.archEdgeColor};
|
|
@@ -29,8 +29,8 @@ import{ee}from"./index.0g1t1pjx.js";import{e,n,B,k,q,kt,A,L,R,I,M,P,O,u,p,X,bs,p
|
|
|
29
29
|
display: -webkit-box;
|
|
30
30
|
-webkit-box-orient: vertical;
|
|
31
31
|
}
|
|
32
|
-
`,"getStyles"),Dr=Ar;function $e(C,G){if(C===0)return G();let x=Math.random,v=C>>>0;Math.random=function(){v=v+1831565813>>>0;let l=v;return l=Math.imul(l^l>>>15,l|1),l^=l+Math.imul(l^l>>>7,l|61),((l^l>>>14)>>>0)/4294967296};try{return G()}finally{Math.random=x}}e($e,"withSeededRandom");var Ne=e((C)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`,"wrapIcon"),Ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Ne('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Ne('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Ne('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Ne('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Ne('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:bs,blank:{body:Ne("")}}},Or=e(async function(C,G,x,v){let l=x.getConfigField("padding"),s=x.getConfigField("iconSize"),a=s/2,o=s/6,g=o/2;await Promise.all(G.edges().map(async(r)=>{let{source:y,sourceDir:i,sourceArrow:t,sourceGroup:c,target:d,targetDir:f,targetArrow:F,targetGroup:T,label:N}=rr(r),{x:S,y:
|
|
33
|
-
translate(${b}, ${
|
|
34
|
-
translate(${m*
|
|
35
|
-
rotate(${-1*m*
|
|
36
|
-
`)}}}}}))},"drawEdges"),xr=e(async function(C,G,x,v){let s=x.getConfigField("padding")*0.75,a=x.getConfigField("fontSize"),g=x.getConfigField("iconSize")/2;await Promise.all(G.nodes().map(async(r)=>{let y=Le(r);if(y.type==="group"){let{h:i,w:t,x1:c,y1:d}=r.boundingBox(),f=C.append("rect");f.attr("id",`${v}-group-${y.id}`).attr("x",c+g).attr("y",d+g).attr("width",t).attr("height",i).attr("class","node-bkg");let F=C.append("g"),T=c,N=d;if(y.icon){let S=F.append("g");S.html(`<g>${await tt(y.icon,{height:s,width:s,fallbackPrefix:Ae.prefix})}</g>`),S.attr("transform","translate("+(T+g+1)+", "+(N+g+1)+")"),T+=s,N+=a/2-1-2}if(y.label){let S=F.append("g");await De(S,y.label,{useHtmlLabels:!1,width:t,classes:"architecture-service-label"},u()),S.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),S.attr("transform","translate("+(T+g+4)+", "+(N+g+2)+")")}x.setElementForId(y.id,f)}}))},"drawGroups"),Ir=e(async function(C,G,x,v){let l=u();for(let s of x){let a=G.append("g"),o=C.getConfigField("iconSize");if(s.title){let i=a.append("g");await De(i,s.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},l),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+o/2+", "+o+")")}let g=a.append("g");if(s.icon)g.html(`<g>${await tt(s.icon,{height:o,width:o,fallbackPrefix:Ae.prefix})}</g>`);else if(s.iconText){g.html(`<g>${await tt("blank",{height:o,width:o,fallbackPrefix:Ae.prefix})}</g>`);let c=g.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(q(s.iconText,l)),d=parseInt(window.getComputedStyle(c.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;c.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/d)};`)}else g.append("path").attr("class","node-bkg").attr("id",`${v}-node-${s.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);a.attr("id",`${v}-service-${s.id}`).attr("class","architecture-service");let{width:r,height:y}=a.node().getBBox();s.width=r,s.height=y,C.setElementForId(s.id,a)}return 0},"drawServices"),Rr=e(function(C,G,x,v){x.forEach((l)=>{let s=G.append("g"),a=C.getConfigField("iconSize");s.append("g").append("rect").attr("id",`${v}-node-${l.id}`).attr("fill-opacity","0").attr("width",a).attr("height",a),s.attr("class","architecture-junction");let{width:g,height:r}=s._groups[0][0].getBBox();s.width=g,s.height=r,C.setElementForId(l.id,s)})},"drawJunctions");pr([{name:Ae.prefix,icons:Ae}]);xt.use(ar.default);function or(C,G,x){C.forEach((v)=>{G.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:x.getConfigField("iconSize"),height:x.getConfigField("iconSize")},classes:"node-service"})})}e(or,"addServices");function sr(C,G,x){C.forEach((v)=>{G.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:x.getConfigField("iconSize"),height:x.getConfigField("iconSize")},classes:"node-junction"})})}e(sr,"addJunctions");function hr(C,G){G.nodes().map((x)=>{let v=Le(x);if(v.type==="group")return;v.x=x.position().x,v.y=x.position().y,C.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}e(hr,"positionNodes");function lr(C,G){C.forEach((x)=>{G.add({group:"nodes",data:{type:"group",id:x.id,icon:x.icon,label:x.title,parent:x.in},classes:"node-group"})})}e(lr,"addGroups");function fr(C,G){C.forEach((x)=>{let{lhsId:v,rhsId:l,lhsInto:s,lhsGroup:a,rhsInto:o,lhsDir:g,rhsDir:r,rhsGroup:y,title:i}=x,t=Be(x.lhsDir,x.rhsDir)?"segments":"straight",c={id:`${v}-${l}`,label:i,source:v,sourceDir:g,sourceArrow:s,sourceGroup:a,sourceEndpoint:g==="L"?"0 50%":g==="R"?"100% 50%":g==="T"?"50% 0":"50% 100%",target:l,targetDir:r,targetArrow:o,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};G.add({group:"edges",data:c,classes:t})})}e(fr,"addEdges");function cr(C,G,x,v=[]){let l=e((t,c)=>{let d=new Map;for(let[f,F]of t.entries()){let T=`${f}`,N=0,S=[...F.entries()];if(S.length===1){d.set(T,S[0][1]);continue}for(let z=0;z<S.length-1;z++)for(let b=z+1;b<S.length;b++){let[Q,it]=S[z],[_,ut]=S[b];if(x.get(er(Q,_))===c)d.set(T,[...d.get(T)??[],...it,...ut]);else if(Q==="default"||_==="default")d.set(T,[...d.get(T)??[],...it,...ut]);else{let nt=`${T}-${N++}`;d.set(nt,it);let h=`${T}-${N++}`;d.set(h,ut)}}}return d},"flattenAlignments"),s=G.map((t)=>{let c=new Map,d=new Map;return t.forEach(([f,F],T)=>{let N=C.getNode(T)?.in??"default",S=c.get(F)??new Map;if(!c.has(F))c.set(F,S);let z=d.get(f)??new Map;if(!d.has(f))d.set(f,z);for(let b of[S,z]){let Q=b.get(N)??[];if(!b.has(N))b.set(N,Q);Q.push(T)}}),{horiz:[...l(c,"horizontal").values()].filter((f)=>f.length>1),vert:[...l(d,"vertical").values()].filter((f)=>f.length>1)}}),[a,o]=s.reduce(([t,c],{horiz:d,vert:f})=>[[...t,...d],[...c,...f]],[[],[]]),g=new Set;v.forEach((t)=>t.members.forEach((c)=>g.add(c)));let r=e((t)=>t.filter((c)=>!c.some((d)=>g.has(d))),"dropOverlapping"),y=r(a),i=r(o);return v.forEach((t)=>{if(t.members.length<2)return;if(t.direction==="row")y.push([...t.members]);else i.push([...t.members])}),{horizontal:y,vertical:i}}e(cr,"getAlignments");function gr(C,G,x=[]){let v=[],l=G.getConfigField("iconSize"),s=G.getConfigField("idealEdgeLengthMultiplier"),a=s*l,o=new Set;x.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let t=y.members[i],c=y.members[i+1];if(o.add(`${t}|${c}`),o.add(`${c}|${t}`),y.direction==="row")v.push({left:t,right:c,gap:a});else v.push({top:t,bottom:c,gap:a})}});let g=e((y)=>`${y[0]},${y[1]}`,"posToStr"),r=e((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return C.forEach((y)=>{let i=new Map([...y.entries()].map(([f,F])=>[g(F),f])),t=[g([0,0])],c={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(t.length>0){let f=t.shift();if(f){c[f]=1;let F=i.get(f);if(F){let T=r(f);Object.entries(d).forEach(([N,S])=>{let z=g([T[0]+S[0],T[1]+S[1]]),b=i.get(z);if(b&&!c[z]){if(t.push(z),o.has(`${F}|${b}`))return;v.push({[je[N]]:b,[je[vr(N)]]:F,gap:s*l})}})}}}}),v}e(gr,"getRelativeConstraints");function ur(C,G,x,v,l,{spatialMaps:s,groupAlignments:a}){return new Promise((o)=>{let g=p("body").append("div").attr("id","cy").attr("style","display:none"),r=xt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.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":`${l.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:`${l.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});g.remove(),lr(x,r),or(C,r,l),sr(G,r,l),fr(v,r);let y=l.getLayoutHints(),i=cr(l,s,a,y),t=gr(s,l,y),c=l.getConfigField("iconSize"),d=l.getConfigField("idealEdgeLengthMultiplier")*c,f=0.5*c,F=l.getConfigField("edgeElasticity"),T=l.getConfigField("seed"),N=r.layout({name:"fcose",quality:"proof",randomize:l.getConfigField("randomize"),nodeSeparation:l.getConfigField("nodeSeparation"),numIter:l.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(S){let[z,b]=S.connectedNodes(),{parent:Q}=Le(z),{parent:it}=Le(b);return Q===it?d:f},edgeElasticity(S){let[z,b]=S.connectedNodes(),{parent:Q}=Le(z),{parent:it}=Le(b);return Q===it?F:0.001},alignmentConstraint:i,relativePlacementConstraint:t});N.one("layoutstop",()=>{function S(z,b,Q,it){let _,ut,{x:W,y:nt}=z,{x:h,y:w}=b;ut=(it-nt+(W-Q)*(nt-w)/(W-h))/Math.sqrt(1+Math.pow((nt-w)/(W-h),2)),_=Math.sqrt(Math.pow(it-nt,2)+Math.pow(Q-W,2)-Math.pow(ut,2));let E=Math.sqrt(Math.pow(h-W,2)+Math.pow(w-nt,2));_=_/E;let D=(h-W)*(it-nt)-(w-nt)*(Q-W);switch(!0){case D>=0:D=1;break;case D<0:D=-1;break}let m=(h-W)*(Q-W)+(w-nt)*(it-nt);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return ut=Math.abs(ut)*D,_=_*m,{distances:ut,weights:_}}e(S,"getSegmentWeights"),r.startBatch();for(let z of Object.values(r.edges()))if(z.data?.()){let{x:b,y:Q}=z.source().position(),{x:it,y:_}=z.target().position();if(b!==it&&Q!==_){let ut=z.sourceEndpoint(),W=z.targetEndpoint(),{sourceDir:nt}=rr(z),[h,w]=de(nt)?[ut.x,W.y]:[W.x,ut.y],{weights:E,distances:D}=S(ut,W,h,w);z.style("segment-distances",D),z.style("segment-weights",E)}}r.endBatch(),$e(T,()=>N.run())});try{$e(T,()=>N.run())}catch(S){if(S instanceof RangeError&&S.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw S}r.ready((S)=>{n.info("Ready",S),o(r)})})}e(ur,"layoutArchitecture");var Sr=e(async(C,G,x,v)=>{let l=v.db;l.setDiagramId(G);let s=l.getServices(),a=l.getJunctions(),o=l.getGroups(),g=l.getEdges(),r=l.getDataStructures(),y=X(G),i=y.append("g");i.attr("class","architecture-edges");let t=y.append("g");t.attr("class","architecture-services");let c=y.append("g");c.attr("class","architecture-groups"),await Ir(l,t,s,G),Rr(l,t,a,G);let d=await ur(s,a,o,g,l,r);await Or(i,d,l,G),await xr(c,d,l,G),hr(l,d),kt(void 0,y,l.getConfigField("padding"),l.getConfigField("useMaxWidth"))},"draw"),Fr={draw:Sr},Br={parser:nr,get db(){return new ir},renderer:Fr,styles:Dr};export{Br as diagram};
|
|
32
|
+
`,"getStyles"),Dr=Ar;function $e(C,G){if(C===0)return G();let x=Math.random,v=C>>>0;Math.random=function(){v=v+1831565813>>>0;let l=v;return l=Math.imul(l^l>>>15,l|1),l^=l+Math.imul(l^l>>>7,l|61),((l^l>>>14)>>>0)/4294967296};try{return G()}finally{Math.random=x}}e($e,"withSeededRandom");var Ne=e((C)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`,"wrapIcon"),Ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Ne('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Ne('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Ne('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Ne('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Ne('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:bs,blank:{body:Ne("")}}},Or=e(async function(C,G,x,v){let l=x.getConfigField("padding"),s=x.getConfigField("iconSize"),a=s/2,o=s/6,g=o/2;await Promise.all(G.edges().map(async(r)=>{let{source:y,sourceDir:i,sourceArrow:t,sourceGroup:c,target:d,targetDir:f,targetArrow:F,targetGroup:T,label:N}=rr(r),{x:S,y:V}=r[0].sourceEndpoint(),{x:b,y:Z}=r[0].midpoint(),{x:it,y:_}=r[0].targetEndpoint(),ut=l+4;if(c)if(se(i))S+=i==="L"?-ut:ut;else V+=i==="T"?-ut:ut+18;if(T)if(se(f))it+=f==="L"?-ut:ut;else _+=f==="T"?-ut:ut+18;if(!c&&x.getNode(y)?.type==="junction")if(se(i))S+=i==="L"?a:-a;else V+=i==="T"?a:-a;if(!T&&x.getNode(d)?.type==="junction")if(se(f))it+=f==="L"?a:-a;else _+=f==="T"?a:-a;if(r[0]._private.rscratch){let H=C.insert("g");if(H.insert("path").attr("d",`M ${S},${V} L ${b},${Z} L${it},${_} `).attr("class","edge").attr("id",`${v}-${Ve(y,d,{prefix:"L"})}`),t){let nt=se(i)?xe[i](S,o):S-g,h=de(i)?xe[i](V,o):V-g;H.insert("polygon").attr("points",_e[i](o)).attr("transform",`translate(${nt},${h})`).attr("class","arrow")}if(F){let nt=se(f)?xe[f](it,o):it-g,h=de(f)?xe[f](_,o):_-g;H.insert("polygon").attr("points",_e[f](o)).attr("transform",`translate(${nt},${h})`).attr("class","arrow")}if(N){let nt=!Be(i,f)?se(i)?"X":"Y":"XY",h=0;if(nt==="X")h=Math.abs(S-it);else if(nt==="Y")h=Math.abs(V-_)/1.5;else h=Math.abs(S-it)/2;let w=H.append("g");if(await De(w,N,{useHtmlLabels:!1,width:h,classes:"architecture-service-label"},u()),w.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),nt==="X")w.attr("transform","translate("+b+", "+Z+")");else if(nt==="Y")w.attr("transform","translate("+b+", "+Z+") rotate(-90)");else if(nt==="XY"){let E=ze(i,f);if(E&&yr(E)){let D=w.node().getBoundingClientRect(),[m,W]=Tr(E);w.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*W*45})`);let Y=w.node().getBoundingClientRect();w.attr("transform",`
|
|
33
|
+
translate(${b}, ${Z-D.height/2})
|
|
34
|
+
translate(${m*Y.width/2}, ${W*Y.height/2})
|
|
35
|
+
rotate(${-1*m*W*45}, 0, ${D.height/2})
|
|
36
|
+
`)}}}}}))},"drawEdges"),xr=e(async function(C,G,x,v){let s=x.getConfigField("padding")*0.75,a=x.getConfigField("fontSize"),g=x.getConfigField("iconSize")/2;await Promise.all(G.nodes().map(async(r)=>{let y=Le(r);if(y.type==="group"){let{h:i,w:t,x1:c,y1:d}=r.boundingBox(),f=C.append("rect");f.attr("id",`${v}-group-${y.id}`).attr("x",c+g).attr("y",d+g).attr("width",t).attr("height",i).attr("class","node-bkg");let F=C.append("g"),T=c,N=d;if(y.icon){let S=F.append("g");S.html(`<g>${await tt(y.icon,{height:s,width:s,fallbackPrefix:Ae.prefix})}</g>`),S.attr("transform","translate("+(T+g+1)+", "+(N+g+1)+")"),T+=s,N+=a/2-1-2}if(y.label){let S=F.append("g");await De(S,y.label,{useHtmlLabels:!1,width:t,classes:"architecture-service-label"},u()),S.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),S.attr("transform","translate("+(T+g+4)+", "+(N+g+2)+")")}x.setElementForId(y.id,f)}}))},"drawGroups"),Ir=e(async function(C,G,x,v){let l=u();for(let s of x){let a=G.append("g"),o=C.getConfigField("iconSize");if(s.title){let i=a.append("g");await De(i,s.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},l),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+o/2+", "+o+")")}let g=a.append("g");if(s.icon)g.html(`<g>${await tt(s.icon,{height:o,width:o,fallbackPrefix:Ae.prefix})}</g>`);else if(s.iconText){g.html(`<g>${await tt("blank",{height:o,width:o,fallbackPrefix:Ae.prefix})}</g>`);let c=g.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(q(s.iconText,l)),d=parseInt(window.getComputedStyle(c.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;c.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/d)};`)}else g.append("path").attr("class","node-bkg").attr("id",`${v}-node-${s.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);a.attr("id",`${v}-service-${s.id}`).attr("class","architecture-service");let{width:r,height:y}=a.node().getBBox();s.width=r,s.height=y,C.setElementForId(s.id,a)}return 0},"drawServices"),Rr=e(function(C,G,x,v){x.forEach((l)=>{let s=G.append("g"),a=C.getConfigField("iconSize");s.append("g").append("rect").attr("id",`${v}-node-${l.id}`).attr("fill-opacity","0").attr("width",a).attr("height",a),s.attr("class","architecture-junction");let{width:g,height:r}=s._groups[0][0].getBBox();s.width=g,s.height=r,C.setElementForId(l.id,s)})},"drawJunctions");pr([{name:Ae.prefix,icons:Ae}]);xt.use(ar.default);function or(C,G,x){C.forEach((v)=>{G.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:x.getConfigField("iconSize"),height:x.getConfigField("iconSize")},classes:"node-service"})})}e(or,"addServices");function sr(C,G,x){C.forEach((v)=>{G.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:x.getConfigField("iconSize"),height:x.getConfigField("iconSize")},classes:"node-junction"})})}e(sr,"addJunctions");function hr(C,G){G.nodes().map((x)=>{let v=Le(x);if(v.type==="group")return;v.x=x.position().x,v.y=x.position().y,C.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}e(hr,"positionNodes");function lr(C,G){C.forEach((x)=>{G.add({group:"nodes",data:{type:"group",id:x.id,icon:x.icon,label:x.title,parent:x.in},classes:"node-group"})})}e(lr,"addGroups");function fr(C,G){C.forEach((x)=>{let{lhsId:v,rhsId:l,lhsInto:s,lhsGroup:a,rhsInto:o,lhsDir:g,rhsDir:r,rhsGroup:y,title:i}=x,t=Be(x.lhsDir,x.rhsDir)?"segments":"straight",c={id:`${v}-${l}`,label:i,source:v,sourceDir:g,sourceArrow:s,sourceGroup:a,sourceEndpoint:g==="L"?"0 50%":g==="R"?"100% 50%":g==="T"?"50% 0":"50% 100%",target:l,targetDir:r,targetArrow:o,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};G.add({group:"edges",data:c,classes:t})})}e(fr,"addEdges");function cr(C,G,x,v=[]){let l=e((t,c)=>{let d=new Map;for(let[f,F]of t.entries()){let T=`${f}`,N=0,S=[...F.entries()];if(S.length===1){d.set(T,S[0][1]);continue}for(let V=0;V<S.length-1;V++)for(let b=V+1;b<S.length;b++){let[Z,it]=S[V],[_,ut]=S[b];if(x.get(er(Z,_))===c)d.set(T,[...d.get(T)??[],...it,...ut]);else if(Z==="default"||_==="default")d.set(T,[...d.get(T)??[],...it,...ut]);else{let nt=`${T}-${N++}`;d.set(nt,it);let h=`${T}-${N++}`;d.set(h,ut)}}}return d},"flattenAlignments"),s=G.map((t)=>{let c=new Map,d=new Map;return t.forEach(([f,F],T)=>{let N=C.getNode(T)?.in??"default",S=c.get(F)??new Map;if(!c.has(F))c.set(F,S);let V=d.get(f)??new Map;if(!d.has(f))d.set(f,V);for(let b of[S,V]){let Z=b.get(N)??[];if(!b.has(N))b.set(N,Z);Z.push(T)}}),{horiz:[...l(c,"horizontal").values()].filter((f)=>f.length>1),vert:[...l(d,"vertical").values()].filter((f)=>f.length>1)}}),[a,o]=s.reduce(([t,c],{horiz:d,vert:f})=>[[...t,...d],[...c,...f]],[[],[]]),g=new Set;v.forEach((t)=>t.members.forEach((c)=>g.add(c)));let r=e((t)=>t.filter((c)=>!c.some((d)=>g.has(d))),"dropOverlapping"),y=r(a),i=r(o);return v.forEach((t)=>{if(t.members.length<2)return;if(t.direction==="row")y.push([...t.members]);else i.push([...t.members])}),{horizontal:y,vertical:i}}e(cr,"getAlignments");function gr(C,G,x=[]){let v=[],l=G.getConfigField("iconSize"),s=G.getConfigField("idealEdgeLengthMultiplier"),a=s*l,o=new Set;x.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let t=y.members[i],c=y.members[i+1];if(o.add(`${t}|${c}`),o.add(`${c}|${t}`),y.direction==="row")v.push({left:t,right:c,gap:a});else v.push({top:t,bottom:c,gap:a})}});let g=e((y)=>`${y[0]},${y[1]}`,"posToStr"),r=e((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return C.forEach((y)=>{let i=new Map([...y.entries()].map(([f,F])=>[g(F),f])),t=[g([0,0])],c={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(t.length>0){let f=t.shift();if(f){c[f]=1;let F=i.get(f);if(F){let T=r(f);Object.entries(d).forEach(([N,S])=>{let V=g([T[0]+S[0],T[1]+S[1]]),b=i.get(V);if(b&&!c[V]){if(t.push(V),o.has(`${F}|${b}`))return;v.push({[je[N]]:b,[je[vr(N)]]:F,gap:s*l})}})}}}}),v}e(gr,"getRelativeConstraints");function ur(C,G,x,v,l,{spatialMaps:s,groupAlignments:a}){return new Promise((o)=>{let g=p("body").append("div").attr("id","cy").attr("style","display:none"),r=xt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.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":`${l.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:`${l.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});g.remove(),lr(x,r),or(C,r,l),sr(G,r,l),fr(v,r);let y=l.getLayoutHints(),i=cr(l,s,a,y),t=gr(s,l,y),c=l.getConfigField("iconSize"),d=l.getConfigField("idealEdgeLengthMultiplier")*c,f=0.5*c,F=l.getConfigField("edgeElasticity"),T=l.getConfigField("seed"),N=r.layout({name:"fcose",quality:"proof",randomize:l.getConfigField("randomize"),nodeSeparation:l.getConfigField("nodeSeparation"),numIter:l.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(S){let[V,b]=S.connectedNodes(),{parent:Z}=Le(V),{parent:it}=Le(b);return Z===it?d:f},edgeElasticity(S){let[V,b]=S.connectedNodes(),{parent:Z}=Le(V),{parent:it}=Le(b);return Z===it?F:0.001},alignmentConstraint:i,relativePlacementConstraint:t});N.one("layoutstop",()=>{function S(V,b,Z,it){let _,ut,{x:H,y:nt}=V,{x:h,y:w}=b;ut=(it-nt+(H-Z)*(nt-w)/(H-h))/Math.sqrt(1+Math.pow((nt-w)/(H-h),2)),_=Math.sqrt(Math.pow(it-nt,2)+Math.pow(Z-H,2)-Math.pow(ut,2));let E=Math.sqrt(Math.pow(h-H,2)+Math.pow(w-nt,2));_=_/E;let D=(h-H)*(it-nt)-(w-nt)*(Z-H);switch(!0){case D>=0:D=1;break;case D<0:D=-1;break}let m=(h-H)*(Z-H)+(w-nt)*(it-nt);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return ut=Math.abs(ut)*D,_=_*m,{distances:ut,weights:_}}e(S,"getSegmentWeights"),r.startBatch();for(let V of Object.values(r.edges()))if(V.data?.()){let{x:b,y:Z}=V.source().position(),{x:it,y:_}=V.target().position();if(b!==it&&Z!==_){let ut=V.sourceEndpoint(),H=V.targetEndpoint(),{sourceDir:nt}=rr(V),[h,w]=de(nt)?[ut.x,H.y]:[H.x,ut.y],{weights:E,distances:D}=S(ut,H,h,w);V.style("segment-distances",D),V.style("segment-weights",E)}}r.endBatch(),$e(T,()=>N.run())});try{$e(T,()=>N.run())}catch(S){if(S instanceof RangeError&&S.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw S}r.ready((S)=>{n.info("Ready",S),o(r)})})}e(ur,"layoutArchitecture");var Sr=e(async(C,G,x,v)=>{let l=v.db;l.setDiagramId(G);let s=l.getServices(),a=l.getJunctions(),o=l.getGroups(),g=l.getEdges(),r=l.getDataStructures(),y=X(G),i=y.append("g");i.attr("class","architecture-edges");let t=y.append("g");t.attr("class","architecture-services");let c=y.append("g");c.attr("class","architecture-groups"),await Ir(l,t,s,G),Rr(l,t,a,G);let d=await ur(s,a,o,g,l,r);await Or(i,d,l,G),await xr(c,d,l,G),hr(l,d),kt(void 0,y,l.getConfigField("padding"),l.getConfigField("useMaxWidth"))},"draw"),Fr={draw:Sr},Br={parser:nr,get db(){return new ir},renderer:Fr,styles:Dr};export{Br as diagram};
|