@codragraph/cli 2.1.4 → 2.1.6

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.
Files changed (109) hide show
  1. package/README.md +36 -7
  2. package/dist/cli/ai-context.js +297 -0
  3. package/dist/cli/analyze.d.ts +9 -4
  4. package/dist/cli/analyze.js +37 -13
  5. package/dist/cli/index.js +40 -14
  6. package/dist/cli/status.d.ts +1 -1
  7. package/dist/cli/status.js +8 -0
  8. package/dist/cli/tool.d.ts +10 -2
  9. package/dist/cli/tool.js +100 -39
  10. package/dist/config/ignore-service.js +1 -0
  11. package/dist/core/adaptive-profile.d.ts +52 -0
  12. package/dist/core/adaptive-profile.js +180 -0
  13. package/dist/core/cgdb/cgdb-adapter.d.ts +34 -5
  14. package/dist/core/cgdb/cgdb-adapter.js +418 -5
  15. package/dist/core/cgdb/pool-adapter.js +130 -20
  16. package/dist/core/ingestion/parsing-processor.js +7 -1
  17. package/dist/core/ingestion/pipeline-phases/parse-impl.js +7 -1
  18. package/dist/core/ingestion/pipeline-phases/structure.js +19 -3
  19. package/dist/core/ingestion/pipeline.d.ts +10 -0
  20. package/dist/core/ingestion/workers/parse-worker.js +1 -1
  21. package/dist/core/ingestion/workers/worker-pool.d.ts +14 -1
  22. package/dist/core/ingestion/workers/worker-pool.js +33 -17
  23. package/dist/core/run-analyze.d.ts +27 -2
  24. package/dist/core/run-analyze.js +626 -32
  25. package/dist/core/search/bm25-index.d.ts +16 -8
  26. package/dist/core/search/bm25-index.js +72 -110
  27. package/dist/mcp/local/local-backend.d.ts +2 -0
  28. package/dist/mcp/local/local-backend.js +241 -21
  29. package/dist/storage/repo-manager.d.ts +29 -0
  30. package/dist/web/assets/__vite-browser-external-BIHI7g3E.js +1 -0
  31. package/dist/web/assets/agent-DcdaQnmu.js +1104 -0
  32. package/dist/web/assets/architectureDiagram-UL44E2DR-DFSpa3Hb.js +36 -0
  33. package/dist/web/assets/blockDiagram-7IZFK4PR-DlFaxH1b.js +132 -0
  34. package/dist/web/assets/{c4Diagram-DFAF54RM-C4Hl3J2U.js → c4Diagram-Y2BXMSZH-BjJ_Yrim.js} +1 -1
  35. package/dist/web/assets/{chunk-7RZVMHOQ-BitYcNVR.js → chunk-3SSMPTDK-KGZSzG3Y.js} +1 -1
  36. package/dist/web/assets/{chunk-TBF5ZNIQ-DL5stGM1.js → chunk-6764PJDD-p1sGJgVm.js} +1 -1
  37. package/dist/web/assets/{chunk-KSICW3F5-BYzvDLNI.js → chunk-AZZRMDJM-DIDkQA4V.js} +1 -1
  38. package/dist/web/assets/{chunk-AEOMTBSW-BgTIXPsY.js → chunk-JQRUD6KW-DAwg-yCU.js} +1 -1
  39. package/dist/web/assets/chunk-KRXBNO2N-ChVO_XdS.js +1 -0
  40. package/dist/web/assets/chunk-LCXTWHL2-DGYdb_Eh.js +231 -0
  41. package/dist/web/assets/{chunk-O5ABG6QK-dHwHzA6n.js → chunk-LII3EMHJ-Bzh9SNgD.js} +1 -1
  42. package/dist/web/assets/chunk-RG4AUYOV-Bcl7U_IV.js +206 -0
  43. package/dist/web/assets/{chunk-TU3PZOEN-RLyvLcv-.js → chunk-T5OCTHI4-CZYMg5sc.js} +1 -1
  44. package/dist/web/assets/chunk-W44A43WB-REOI67PN.js +13 -0
  45. package/dist/web/assets/{chunk-RWUO3TPN-BgRTY0_k.js → chunk-ZXARS5L4-BfFdV1tf.js} +1 -1
  46. package/dist/web/assets/classDiagram-KGZ6W3CR-B-qkKMYi.js +1 -0
  47. package/dist/web/assets/classDiagram-v2-72OJOZXJ-B-qkKMYi.js +1 -0
  48. package/dist/web/assets/{cose-bilkent-PNC4W37J-DVhePRYg.js → cose-bilkent-UX7MHV2Q-D6vANJGG.js} +1 -1
  49. package/dist/web/assets/dagre-ND4H6XIP-BiHe5Lal.js +4 -0
  50. package/dist/web/assets/diagram-3NCE3AQN-CEutBCOW.js +43 -0
  51. package/dist/web/assets/diagram-GF46GFSD-CZns6HPQ.js +24 -0
  52. package/dist/web/assets/diagram-HNR7UZ2L-Vz8fE5of.js +3 -0
  53. package/dist/web/assets/diagram-QXG6HAR7-D60HKZ_y.js +24 -0
  54. package/dist/web/assets/diagram-WEQXMOUZ-vGAf1p3E.js +10 -0
  55. package/dist/web/assets/{erDiagram-GCSMX5X6-C3dhDFA8.js → erDiagram-L5TCEMPS-DZaplJA6.js} +5 -5
  56. package/dist/web/assets/{flowDiagram-OTCZ4VVT-CWSFWmhr.js → flowDiagram-H6V6AXG4-BqUqeAsI.js} +9 -9
  57. package/dist/web/assets/ganttDiagram-JCBTUEKG-XEB6H-0G.js +292 -0
  58. package/dist/web/assets/gitGraphDiagram-S2ZK5IYY-7G50u1Cd.js +106 -0
  59. package/dist/web/assets/index-B5WxtMpv.js +1415 -0
  60. package/dist/web/assets/infoDiagram-3YFTVSEB-Cut_rzaf.js +2 -0
  61. package/dist/web/assets/{ishikawaDiagram-YMYX4NHK-DUoJvNP2.js → ishikawaDiagram-BNXS4ZKH-B4DGfGi3.js} +3 -3
  62. package/dist/web/assets/{journeyDiagram-SO5T7YLQ-RMFPNNqz.js → journeyDiagram-M6C3CM3L-BBFhsL3E.js} +1 -1
  63. package/dist/web/assets/{kanban-definition-LJHFXRCJ-BzpDs1K9.js → kanban-definition-75IXJCU3-DarGRyn3.js} +4 -4
  64. package/dist/web/assets/{katex-GD7MH7QM-DBQvrix-.js → katex-K3KEBU37-W5XTYMhr.js} +1 -1
  65. package/dist/web/assets/mindmap-definition-2TDM6QVE-BgeczIJM.js +96 -0
  66. package/dist/web/assets/pieDiagram-CU6KROY3-Kkoo-Noq.js +30 -0
  67. package/dist/web/assets/quadrantDiagram-VICAPDV7-CDQFeRWN.js +7 -0
  68. package/dist/web/assets/{requirementDiagram-M5DCFWZL-DLHOVTSv.js → requirementDiagram-JXO7QTGE-Cz9-XnkA.js} +2 -2
  69. package/dist/web/assets/sankeyDiagram-URQDO5SZ-CU26z0n7.js +40 -0
  70. package/dist/web/assets/sequenceDiagram-VS2MUI6T-OGK1FLOt.js +162 -0
  71. package/dist/web/assets/stateDiagram-7D4R322I-DJ9brq0U.js +1 -0
  72. package/dist/web/assets/stateDiagram-v2-36443NZ5-DhJ4Ky-7.js +1 -0
  73. package/dist/web/assets/{timeline-definition-5SPVSISX-TRSDRgPw.js → timeline-definition-O6YCAMPW-XZvnjqTT.js} +4 -4
  74. package/dist/web/assets/{vennDiagram-IE5QUKF5-DNy7HRBM.js → vennDiagram-MWXL3ELB-CJUssEjA.js} +6 -6
  75. package/dist/web/assets/wardley-L42UT6IY-5TKZOOLJ-DZr11zBG.js +173 -0
  76. package/dist/web/assets/wardleyDiagram-CUQ6CDDI-C276iqrN.js +78 -0
  77. package/dist/web/assets/{xychartDiagram-ZHJ5623Y-Dr9r7a35.js → xychartDiagram-N2JHSOCM-B9-uCZyP.js} +4 -4
  78. package/dist/web/index.html +1 -1
  79. package/hooks/claude/codragraph-hook.cjs +15 -122
  80. package/package.json +1 -1
  81. package/vendor/node_modules/node-addon-api/node_addon_api_except.stamp +0 -0
  82. package/dist/web/assets/agent-D5lb0zXz.js +0 -1089
  83. package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +0 -36
  84. package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +0 -132
  85. package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +0 -231
  86. package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +0 -1
  87. package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +0 -13
  88. package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +0 -1
  89. package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +0 -206
  90. package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +0 -1
  91. package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +0 -1
  92. package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +0 -4
  93. package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +0 -43
  94. package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +0 -24
  95. package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +0 -10
  96. package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +0 -24
  97. package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +0 -292
  98. package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +0 -106
  99. package/dist/web/assets/index-BgeqpYgd.js +0 -1415
  100. package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +0 -2
  101. package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +0 -96
  102. package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +0 -30
  103. package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +0 -7
  104. package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +0 -10
  105. package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +0 -157
  106. package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +0 -1
  107. package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +0 -1
  108. package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +0 -161
  109. package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +0 -20
@@ -1 +1 @@
1
- import{r as $}from"./chunk-7RZVMHOQ-BitYcNVR.js";import{m as O,p as j,i as st,r as at,a6 as V}from"./index-BgeqpYgd.js";var Z=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L():typeof define=="function"&&define.amd?define([],L):typeof C=="object"?C.layoutBase=L():m.layoutBase=L()},"webpackUniversalModuleDefinition")(C,function(){return function(m){var L={};function N(i){if(L[i])return L[i].exports;var e=L[i]={i,l:!1,exports:{}};return m[i].call(e.exports,e,e.exports,N),e.l=!0,e.exports}return O(N,"__webpack_require__"),N.m=m,N.c=L,N.i=function(i){return i},N.d=function(i,e,t){N.o(i,e)||Object.defineProperty(i,e,{configurable:!1,enumerable:!0,get:t})},N.n=function(i){var e=i&&i.__esModule?O(function(){return i.default},"getDefault"):O(function(){return i},"getModuleExports");return N.d(e,"a",e),e},N.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},N.p="",N(N.s=26)}([function(m,L,N){function i(){}O(i,"LayoutConstants"),i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,m.exports=i},function(m,L,N){var i=N(2),e=N(8),t=N(9);function r(a,o,p){i.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=a,this.target=o}O(r,"LEdge"),r.prototype=Object.create(i.prototype);for(var h in i)r[h]=i[h];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(a,o){for(var p=this.getOtherEnd(a),n=o.getGraphManager().getRoot();;){if(p.getOwner()==o)return p;if(p.getOwner()==n)break;p=p.getOwner().getParent()}return null},r.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=r},function(m,L,N){function i(e){this.vGraphObject=e}O(i,"LGraphObject"),m.exports=i},function(m,L,N){var i=N(2),e=N(10),t=N(13),r=N(0),h=N(16),a=N(4);function o(n,g,l,f){l==null&&f==null&&(f=g),i.call(this,f),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=n,l!=null&&g!=null?this.rect=new t(g.x,g.y,l.width,l.height):this.rect=new t}O(o,"LNode"),o.prototype=Object.create(i.prototype);for(var p in i)o[p]=i[p];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(n){this.rect.width=n},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(n){this.rect.height=n},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(n,g){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(n,g){this.rect.x=n-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(n,g){this.rect.x=n,this.rect.y=g},o.prototype.moveBy=function(n,g){this.rect.x+=n,this.rect.y+=g},o.prototype.getEdgeListToNode=function(n){var g=[],l=this;return l.edges.forEach(function(f){if(f.target==n){if(f.source!=l)throw"Incorrect edge source!";g.push(f)}}),g},o.prototype.getEdgesBetween=function(n){var g=[],l=this;return l.edges.forEach(function(f){if(!(f.source==l||f.target==l))throw"Incorrect edge source and/or target";(f.target==n||f.source==n)&&g.push(f)}),g},o.prototype.getNeighborsList=function(){var n=new Set,g=this;return g.edges.forEach(function(l){if(l.source==g)n.add(l.target);else{if(l.target!=g)throw"Incorrect incidency!";n.add(l.source)}}),n},o.prototype.withChildren=function(){var n=new Set,g,l;if(n.add(this),this.child!=null)for(var f=this.child.getNodes(),E=0;E<f.length;E++)g=f[E],l=g.withChildren(),l.forEach(function(y){n.add(y)});return n},o.prototype.getNoOfChildren=function(){var n=0,g;if(this.child==null)n=1;else for(var l=this.child.getNodes(),f=0;f<l.length;f++)g=l[f],n+=g.getNoOfChildren();return n==0&&(n=1),n},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},o.prototype.scatter=function(){var n,g,l=-r.INITIAL_WORLD_BOUNDARY,f=r.INITIAL_WORLD_BOUNDARY;n=r.WORLD_CENTER_X+h.nextDouble()*(f-l)+l;var E=-r.INITIAL_WORLD_BOUNDARY,y=r.INITIAL_WORLD_BOUNDARY;g=r.WORLD_CENTER_Y+h.nextDouble()*(y-E)+E,this.rect.x=n,this.rect.y=g},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var n=this.getChild();if(n.updateBounds(!0),this.rect.x=n.getLeft(),this.rect.y=n.getTop(),this.setWidth(n.getRight()-n.getLeft()),this.setHeight(n.getBottom()-n.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var g=n.getRight()-n.getLeft(),l=n.getBottom()-n.getTop();this.labelWidth>g&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(n){var g=this.rect.x;g>r.WORLD_BOUNDARY?g=r.WORLD_BOUNDARY:g<-r.WORLD_BOUNDARY&&(g=-r.WORLD_BOUNDARY);var l=this.rect.y;l>r.WORLD_BOUNDARY?l=r.WORLD_BOUNDARY:l<-r.WORLD_BOUNDARY&&(l=-r.WORLD_BOUNDARY);var f=new a(g,l),E=n.inverseTransformPoint(f);this.setLocation(E.x,E.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=o},function(m,L,N){function i(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}O(i,"PointD"),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(e){this.x=e},i.prototype.setY=function(e){this.y=e},i.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},m.exports=i},function(m,L,N){var i=N(2),e=N(10),t=N(0),r=N(6),h=N(3),a=N(1),o=N(13),p=N(12),n=N(11);function g(f,E,y){i.call(this,y),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,E!=null&&E instanceof r?this.graphManager=E:E!=null&&E instanceof Layout&&(this.graphManager=E.graphManager)}O(g,"LGraph"),g.prototype=Object.create(i.prototype);for(var l in i)g[l]=i[l];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(f,E,y){if(E==null&&y==null){var d=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var A=f;if(!(this.getNodes().indexOf(E)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(E.owner==y.owner&&E.owner==this))throw"Both owners must be this graph!";return E.owner!=y.owner?null:(A.source=E,A.target=y,A.isInterGraph=!1,this.getEdges().push(A),E.edges.push(A),y!=E&&y.edges.push(A),A)}},g.prototype.remove=function(f){var E=f;if(f instanceof h){if(E==null)throw"Node is null!";if(!(E.owner!=null&&E.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=E.edges.slice(),d,A=y.length,v=0;v<A;v++)d=y[v],d.isInterGraph?this.graphManager.remove(d):d.source.owner.remove(d);var I=this.nodes.indexOf(E);if(I==-1)throw"Node not in owner node list!";this.nodes.splice(I,1)}else if(f instanceof a){var d=f;if(d==null)throw"Edge is null!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.owner!=null&&d.target.owner!=null&&d.source.owner==this&&d.target.owner==this))throw"Source and/or target owner is invalid!";var s=d.source.edges.indexOf(d),u=d.target.edges.indexOf(d);if(!(s>-1&&u>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(s,1),d.target!=d.source&&d.target.edges.splice(u,1);var I=d.source.owner.getEdges().indexOf(d);if(I==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(I,1)}},g.prototype.updateLeftTop=function(){for(var f=e.MAX_VALUE,E=e.MAX_VALUE,y,d,A,v=this.getNodes(),I=v.length,s=0;s<I;s++){var u=v[s];y=u.getTop(),d=u.getLeft(),f>y&&(f=y),E>d&&(E=d)}return f==e.MAX_VALUE?null:(v[0].getParent().paddingLeft!=null?A=v[0].getParent().paddingLeft:A=this.margin,this.left=E-A,this.top=f-A,new p(this.left,this.top))},g.prototype.updateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,A=-e.MAX_VALUE,v,I,s,u,c,_=this.nodes,T=_.length,w=0;w<T;w++){var D=_[w];f&&D.child!=null&&D.updateBounds(),v=D.getLeft(),I=D.getRight(),s=D.getTop(),u=D.getBottom(),E>v&&(E=v),y<I&&(y=I),d>s&&(d=s),A<u&&(A=u)}var M=new o(E,d,y-E,A-d);E==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),_[0].getParent().paddingLeft!=null?c=_[0].getParent().paddingLeft:c=this.margin,this.left=M.x-c,this.right=M.x+M.width+c,this.top=M.y-c,this.bottom=M.y+M.height+c},g.calculateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,A=-e.MAX_VALUE,v,I,s,u,c=f.length,_=0;_<c;_++){var T=f[_];v=T.getLeft(),I=T.getRight(),s=T.getTop(),u=T.getBottom(),E>v&&(E=v),y<I&&(y=I),d>s&&(d=s),A<u&&(A=u)}var w=new o(E,d,y-E,A-d);return w},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var f=0,E=this.nodes,y=E.length,d=0;d<y;d++){var A=E[d];f+=A.calcEstimatedSize()}return f==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var E=new n,y=new Set,d=this.nodes[0],A,v,I=d.withChildren();for(I.forEach(function(w){E.push(w),y.add(w)});E.length!==0;){d=E.shift(),A=d.getEdges();for(var s=A.length,u=0;u<s;u++){var c=A[u];if(v=c.getOtherEndInGraph(d,this),v!=null&&!y.has(v)){var _=v.withChildren();_.forEach(function(w){E.push(w),y.add(w)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var T=0;y.forEach(function(w){w.owner==f&&T++}),T==this.nodes.length&&(this.isConnected=!0)}},m.exports=g},function(m,L,N){var i,e=N(1);function t(r){i=N(5),this.layout=r,this.graphs=[],this.edges=[]}O(t,"LGraphManager"),t.prototype.addRoot=function(){var r=this.layout.newGraph(),h=this.layout.newNode(null),a=this.add(r,h);return this.setRootGraph(a),this.rootGraph},t.prototype.add=function(r,h,a,o,p){if(a==null&&o==null&&p==null){if(r==null)throw"Graph is null!";if(h==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(h.child!=null)throw"Already has a child!";return r.parent=h,h.child=r,r}else{p=a,o=h,a=r;var n=o.getOwner(),g=p.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==g)return a.isInterGraph=!1,n.add(a,o,p);if(a.isInterGraph=!0,a.source=o,a.target=p,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},t.prototype.remove=function(r){if(r instanceof i){var h=r;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(h.getEdges());for(var o,p=a.length,n=0;n<p;n++)o=a[n],h.remove(o);var g=[];g=g.concat(h.getNodes());var l;p=g.length;for(var n=0;n<p;n++)l=g[n],h.remove(l);h==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(h);this.graphs.splice(f,1),h.parent=null}else if(r instanceof e){if(o=r,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var f=o.source.edges.indexOf(o);if(o.source.edges.splice(f,1),f=o.target.edges.indexOf(o),o.target.edges.splice(f,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var f=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(f,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],h=this.getGraphs(),a=h.length,o=0;o<a;o++)r=r.concat(h[o].getNodes());this.allNodes=r}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){for(var r=[],h=this.getGraphs(),a=h.length,o=0;o<h.length;o++)r=r.concat(h[o].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(r,h){if(!(r!=null&&h!=null))throw"assert failed";if(r==h)return!0;var a=r.getOwner(),o;do{if(o=a.getParent(),o==null)break;if(o==h)return!0;if(a=o.getOwner(),a==null)break}while(!0);a=h.getOwner();do{if(o=a.getParent(),o==null)break;if(o==r)return!0;if(a=o.getOwner(),a==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,h,a,o,p,n=this.getAllEdges(),g=n.length,l=0;l<g;l++){if(r=n[l],h=r.source,a=r.target,r.lca=null,r.sourceInLca=h,r.targetInLca=a,h==a){r.lca=h.getOwner();continue}for(o=h.getOwner();r.lca==null;){for(r.targetInLca=a,p=a.getOwner();r.lca==null;){if(p==o){r.lca=p;break}if(p==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=p.getParent(),p=r.targetInLca.getOwner()}if(o==this.rootGraph)break;r.lca==null&&(r.sourceInLca=o.getParent(),o=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,h){if(r==h)return r.getOwner();var a=r.getOwner();do{if(a==null)break;var o=h.getOwner();do{if(o==null)break;if(o==a)return o;o=o.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},t.prototype.calcInclusionTreeDepths=function(r,h){r==null&&h==null&&(r=this.rootGraph,h=1);for(var a,o=r.getNodes(),p=o.length,n=0;n<p;n++)a=o[n],a.inclusionTreeDepth=h,a.child!=null&&this.calcInclusionTreeDepths(a.child,h+1)},t.prototype.includesInvalidEdge=function(){for(var r,h=this.edges.length,a=0;a<h;a++)if(r=this.edges[a],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},m.exports=t},function(m,L,N){var i=N(0);function e(){}O(e,"FDLayoutConstants");for(var t in i)e[t]=i[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=e},function(m,L,N){var i=N(12);function e(){}O(e,"IGeometry"),e.calcSeparationAmount=function(t,r,h,a){if(!t.intersects(r))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,o),h[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),h[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?h[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(h[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?h[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(h[1]+=Math.min(t.getY()-r.getY(),r.getBottom()-t.getBottom()));var p=Math.abs((r.getCenterY()-t.getCenterY())/(r.getCenterX()-t.getCenterX()));r.getCenterY()===t.getCenterY()&&r.getCenterX()===t.getCenterX()&&(p=1);var n=p*h[0],g=h[1]/p;h[0]<g?g=h[0]:n=h[1],h[0]=-1*o[0]*(g/2+a),h[1]=-1*o[1]*(n/2+a)},e.decideDirectionsForOverlappingNodes=function(t,r,h){t.getCenterX()<r.getCenterX()?h[0]=-1:h[0]=1,t.getCenterY()<r.getCenterY()?h[1]=-1:h[1]=1},e.getIntersection2=function(t,r,h){var a=t.getCenterX(),o=t.getCenterY(),p=r.getCenterX(),n=r.getCenterY();if(t.intersects(r))return h[0]=a,h[1]=o,h[2]=p,h[3]=n,!0;var g=t.getX(),l=t.getY(),f=t.getRight(),E=t.getX(),y=t.getBottom(),d=t.getRight(),A=t.getWidthHalf(),v=t.getHeightHalf(),I=r.getX(),s=r.getY(),u=r.getRight(),c=r.getX(),_=r.getBottom(),T=r.getRight(),w=r.getWidthHalf(),D=r.getHeightHalf(),M=!1,R=!1;if(a===p){if(o>n)return h[0]=a,h[1]=l,h[2]=p,h[3]=_,!1;if(o<n)return h[0]=a,h[1]=y,h[2]=p,h[3]=s,!1}else if(o===n){if(a>p)return h[0]=g,h[1]=o,h[2]=u,h[3]=n,!1;if(a<p)return h[0]=f,h[1]=o,h[2]=I,h[3]=n,!1}else{var F=t.height/t.width,S=r.height/r.width,x=(n-o)/(p-a),G=void 0,b=void 0,P=void 0,U=void 0,Y=void 0,B=void 0;if(-F===x?a>p?(h[0]=E,h[1]=y,M=!0):(h[0]=f,h[1]=l,M=!0):F===x&&(a>p?(h[0]=g,h[1]=l,M=!0):(h[0]=d,h[1]=y,M=!0)),-S===x?p>a?(h[2]=c,h[3]=_,R=!0):(h[2]=u,h[3]=s,R=!0):S===x&&(p>a?(h[2]=I,h[3]=s,R=!0):(h[2]=T,h[3]=_,R=!0)),M&&R)return!1;if(a>p?o>n?(G=this.getCardinalDirection(F,x,4),b=this.getCardinalDirection(S,x,2)):(G=this.getCardinalDirection(-F,x,3),b=this.getCardinalDirection(-S,x,1)):o>n?(G=this.getCardinalDirection(-F,x,1),b=this.getCardinalDirection(-S,x,3)):(G=this.getCardinalDirection(F,x,2),b=this.getCardinalDirection(S,x,4)),!M)switch(G){case 1:U=l,P=a+-v/x,h[0]=P,h[1]=U;break;case 2:P=d,U=o+A*x,h[0]=P,h[1]=U;break;case 3:U=y,P=a+v/x,h[0]=P,h[1]=U;break;case 4:P=E,U=o+-A*x,h[0]=P,h[1]=U;break}if(!R)switch(b){case 1:B=s,Y=p+-D/x,h[2]=Y,h[3]=B;break;case 2:Y=T,B=n+w*x,h[2]=Y,h[3]=B;break;case 3:B=_,Y=p+D/x,h[2]=Y,h[3]=B;break;case 4:Y=c,B=n+-w*x,h[2]=Y,h[3]=B;break}}return!1},e.getCardinalDirection=function(t,r,h){return t>r?h:1+h%4},e.getIntersection=function(t,r,h,a){if(a==null)return this.getIntersection2(t,r,h);var o=t.x,p=t.y,n=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=void 0,A=void 0,v=void 0,I=void 0,s=void 0,u=void 0,c=void 0,_=void 0,T=void 0;return v=g-p,s=o-n,c=n*p-o*g,I=y-f,u=l-E,_=E*f-l*y,T=v*u-I*s,T===0?null:(d=(s*_-u*c)/T,A=(I*c-v*_)/T,new i(d,A))},e.angleOfVector=function(t,r,h,a){var o=void 0;return t!==h?(o=Math.atan((a-r)/(h-t)),h<t?o+=Math.PI:a<r&&(o+=this.TWO_PI)):a<r?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},e.doIntersect=function(t,r,h,a){var o=t.x,p=t.y,n=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=(n-o)*(y-f)-(E-l)*(g-p);if(d===0)return!1;var A=((y-f)*(E-o)+(l-E)*(y-p))/d,v=((p-g)*(E-o)+(n-o)*(y-p))/d;return 0<A&&A<1&&0<v&&v<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,m.exports=e},function(m,L,N){function i(){}O(i,"IMath"),i.sign=function(e){return e>0?1:e<0?-1:0},i.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},i.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},m.exports=i},function(m,L,N){function i(){}O(i,"Integer"),i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,m.exports=i},function(m,L,N){var i=function(){function o(p,n){for(var g=0;g<n.length;g++){var l=n[g];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}return O(o,"defineProperties"),function(p,n,g){return n&&o(p.prototype,n),g&&o(p,g),p}}();function e(o,p){if(!(o instanceof p))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=O(function(o){return{value:o,next:null,prev:null}},"nodeFrom"),r=O(function(o,p,n,g){return o!==null?o.next=p:g.head=p,n!==null?n.prev=p:g.tail=p,p.prev=o,p.next=n,g.length++,p},"add"),h=O(function(o,p){var n=o.prev,g=o.next;return n!==null?n.next=g:p.head=g,g!==null?g.prev=n:p.tail=n,o.prev=o.next=null,p.length--,o},"_remove"),a=function(){function o(p){var n=this;e(this,o),this.length=0,this.head=null,this.tail=null,p==null||p.forEach(function(g){return n.push(g)})}return O(o,"LinkedList"),i(o,[{key:"size",value:O(function(){return this.length},"size")},{key:"insertBefore",value:O(function(p,n){return r(n.prev,t(p),n,this)},"insertBefore")},{key:"insertAfter",value:O(function(p,n){return r(n,t(p),n.next,this)},"insertAfter")},{key:"insertNodeBefore",value:O(function(p,n){return r(n.prev,p,n,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:O(function(p,n){return r(n,p,n.next,this)},"insertNodeAfter")},{key:"push",value:O(function(p){return r(this.tail,t(p),null,this)},"push")},{key:"unshift",value:O(function(p){return r(null,t(p),this.head,this)},"unshift")},{key:"remove",value:O(function(p){return h(p,this)},"remove")},{key:"pop",value:O(function(){return h(this.tail,this).value},"pop")},{key:"popNode",value:O(function(){return h(this.tail,this)},"popNode")},{key:"shift",value:O(function(){return h(this.head,this).value},"shift")},{key:"shiftNode",value:O(function(){return h(this.head,this)},"shiftNode")},{key:"get_object_at",value:O(function(p){if(p<=this.length()){for(var n=1,g=this.head;n<p;)g=g.next,n++;return g.value}},"get_object_at")},{key:"set_object_at",value:O(function(p,n){if(p<=this.length()){for(var g=1,l=this.head;g<p;)l=l.next,g++;l.value=n}},"set_object_at")}]),o}();m.exports=a},function(m,L,N){function i(e,t,r){this.x=null,this.y=null,e==null&&t==null&&r==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&r==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&r==null&&(r=e,this.x=r.x,this.y=r.y)}O(i,"Point"),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(e,t,r){e.constructor.name=="Point"&&t==null&&r==null?(r=e,this.setLocation(r.x,r.y)):typeof e=="number"&&typeof t=="number"&&r==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},i.prototype.move=function(e,t){this.x=e,this.y=t},i.prototype.translate=function(e,t){this.x+=e,this.y+=t},i.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=i},function(m,L,N){function i(e,t,r,h){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&h!=null&&(this.x=e,this.y=t,this.width=r,this.height=h)}O(i,"RectangleD"),i.prototype.getX=function(){return this.x},i.prototype.setX=function(e){this.x=e},i.prototype.getY=function(){return this.y},i.prototype.setY=function(e){this.y=e},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},m.exports=i},function(m,L,N){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}O(e,"UniqueIDGeneretor"),e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var r=typeof t>"u"?"undefined":i(t);return t==null||r!="object"&&r!="function"},m.exports=e},function(m,L,N){function i(l){if(Array.isArray(l)){for(var f=0,E=Array(l.length);f<l.length;f++)E[f]=l[f];return E}else return Array.from(l)}O(i,"_toConsumableArray");var e=N(0),t=N(6),r=N(3),h=N(1),a=N(5),o=N(4),p=N(17),n=N(27);function g(l){n.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}O(g,"Layout"),g.RANDOM_SEED=1,g.prototype=Object.create(n.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var l=new t(this);return this.graphManager=l,l},g.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},g.prototype.newNode=function(l){return new r(this.graphManager,l)},g.prototype.newEdge=function(l){return new h(null,null,l)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),e.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l,f=this.graphManager.getAllEdges(),E=0;E<f.length;E++)l=f[E];for(var y,d=this.graphManager.getRoot().getNodes(),E=0;E<d.length;E++)y=d[E];this.update(this.graphManager.getRoot())}},g.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof r){var f=l;if(f.getChild()!=null)for(var E=f.getChild().getNodes(),y=0;y<E.length;y++)update(E[y]);if(f.vGraphObject!=null){var d=f.vGraphObject;d.update(f)}}else if(l instanceof h){var A=l;if(A.vGraphObject!=null){var v=A.vGraphObject;v.update(A)}}else if(l instanceof a){var I=l;if(I.vGraphObject!=null){var s=I.vGraphObject;s.update(I)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var f=new p,E=this.graphManager.getRoot().updateLeftTop();if(E!=null){f.setWorldOrgX(l.x),f.setWorldOrgY(l.y),f.setDeviceOrgX(E.x),f.setDeviceOrgY(E.y);for(var y=this.getAllNodes(),d,A=0;A<y.length;A++)d=y[A],d.transform(f)}}},g.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,E,y=l.getNodes(),d=0;d<y.length;d++)f=y[d],E=f.getChild(),E==null||E.getNodes().length==0?f.scatter():(this.positionNodesRandomly(E),f.updateBounds())},g.prototype.getFlatForest=function(){for(var l=[],f=!0,E=this.graphManager.getRoot().getNodes(),y=!0,d=0;d<E.length;d++)E[d].getChild()!=null&&(y=!1);if(!y)return l;var A=new Set,v=[],I=new Map,s=[];for(s=s.concat(E);s.length>0&&f;){for(v.push(s[0]);v.length>0&&f;){var u=v[0];v.splice(0,1),A.add(u);for(var c=u.getEdges(),d=0;d<c.length;d++){var _=c[d].getOtherEnd(u);if(I.get(u)!=_)if(!A.has(_))v.push(_),I.set(_,u);else{f=!1;break}}}if(!f)l=[];else{var T=[].concat(i(A));l.push(T);for(var d=0;d<T.length;d++){var w=T[d],D=s.indexOf(w);D>-1&&s.splice(D,1)}A=new Set,I=new Map}}return l},g.prototype.createDummyNodesForBendpoints=function(l){for(var f=[],E=l.source,y=this.graphManager.calcLowestCommonAncestor(l.source,l.target),d=0;d<l.bendpoints.length;d++){var A=this.newNode(null);A.setRect(new Point(0,0),new Dimension(1,1)),y.add(A);var v=this.newEdge(null);this.graphManager.add(v,E,A),f.add(A),E=A}var v=this.newEdge(null);return this.graphManager.add(v,E,l.target),this.edgeToDummyNodes.set(l,f),l.isInterGraph()?this.graphManager.remove(l):y.remove(l),f},g.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(i(this.edgeToDummyNodes.keys())).concat(l);for(var f=0;f<l.length;f++){var E=l[f];if(E.bendpoints.length>0){for(var y=this.edgeToDummyNodes.get(E),d=0;d<y.length;d++){var A=y[d],v=new o(A.getCenterX(),A.getCenterY()),I=E.bendpoints.get(d);I.x=v.x,I.y=v.y,A.getOwner().remove(A)}this.graphManager.add(E,E.source,E.target)}}},g.transform=function(l,f,E,y){if(E!=null&&y!=null){var d=f;if(l<=50){var A=f/E;d-=(f-A)/50*(50-l)}else{var v=f*y;d+=(v-f)/50*(l-50)}return d}else{var I,s;return l<=50?(I=9*f/500,s=f/10):(I=9*f/50,s=-8*f),I*l+s}},g.findCenterOfTree=function(l){var f=[];f=f.concat(l);var E=[],y=new Map,d=!1,A=null;(f.length==1||f.length==2)&&(d=!0,A=f[0]);for(var v=0;v<f.length;v++){var I=f[v],s=I.getNeighborsList().size;y.set(I,I.getNeighborsList().size),s==1&&E.push(I)}var u=[];for(u=u.concat(E);!d;){var c=[];c=c.concat(u),u=[];for(var v=0;v<f.length;v++){var I=f[v],_=f.indexOf(I);_>=0&&f.splice(_,1);var T=I.getNeighborsList();T.forEach(function(M){if(E.indexOf(M)<0){var R=y.get(M),F=R-1;F==1&&u.push(M),y.set(M,F)}})}E=E.concat(u),(f.length==1||f.length==2)&&(d=!0,A=f[0])}return A},g.prototype.setGraphManager=function(l){this.graphManager=l},m.exports=g},function(m,L,N){function i(){}O(i,"RandomSeed"),i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},m.exports=i},function(m,L,N){var i=N(4);function e(t,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}O(e,"Transform"),e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var r=0,h=this.lworldExtX;return h!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/h),r},e.prototype.transformY=function(t){var r=0,h=this.lworldExtY;return h!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/h),r},e.prototype.inverseTransformX=function(t){var r=0,h=this.ldeviceExtX;return h!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/h),r},e.prototype.inverseTransformY=function(t){var r=0,h=this.ldeviceExtY;return h!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/h),r},e.prototype.inverseTransformPoint=function(t){var r=new i(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return r},m.exports=e},function(m,L,N){function i(n){if(Array.isArray(n)){for(var g=0,l=Array(n.length);g<n.length;g++)l[g]=n[g];return l}else return Array.from(n)}O(i,"_toConsumableArray");var e=N(15),t=N(7),r=N(0),h=N(8),a=N(9);function o(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}O(o,"FDLayout"),o.prototype=Object.create(e.prototype);for(var p in e)o[p]=e[p];o.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){for(var n,g,l,f,E,y,d=this.getGraphManager().getAllEdges(),A=0;A<d.length;A++)n=d[A],n.idealLength=this.idealEdgeLength,n.isInterGraph&&(l=n.getSource(),f=n.getTarget(),E=n.getSourceInLca().getEstimatedSize(),y=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(n.idealLength+=E+y-2*r.SIMPLE_NODE_SIZE),g=n.getLca().getInclusionTreeDepth(),n.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*g))},o.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;this.incremental?(n>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(n>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(n-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),g,l=0;l<n.length;l++)g=n[l],this.calcSpringForce(g,g.idealLength)},o.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,f,E,y,d=this.getAllNodes(),A;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),A=new Set,l=0;l<d.length;l++)E=d[l],this.calculateRepulsionForceOfANode(E,A,n,g),A.add(E);else for(l=0;l<d.length;l++)for(E=d[l],f=l+1;f<d.length;f++)y=d[f],E.getOwner()==y.getOwner()&&this.calcRepulsionForce(E,y)},o.prototype.calcGravitationalForces=function(){for(var n,g=this.getAllNodesToApplyGravitation(),l=0;l<g.length;l++)n=g[l],this.calcGravitationalForce(n)},o.prototype.moveNodes=function(){for(var n=this.getAllNodes(),g,l=0;l<n.length;l++)g=n[l],g.move()},o.prototype.calcSpringForce=function(n,g){var l=n.getSource(),f=n.getTarget(),E,y,d,A;if(this.uniformLeafNodeSizes&&l.getChild()==null&&f.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;E=n.getLength(),E!=0&&(y=this.springConstant*(E-g),d=y*(n.lengthX/E),A=y*(n.lengthY/E),l.springForceX+=d,l.springForceY+=A,f.springForceX-=d,f.springForceY-=A)},o.prototype.calcRepulsionForce=function(n,g){var l=n.getRect(),f=g.getRect(),E=new Array(2),y=new Array(4),d,A,v,I,s,u,c;if(l.intersects(f)){h.calcSeparationAmount(l,f,E,t.DEFAULT_EDGE_LENGTH/2),u=2*E[0],c=2*E[1];var _=n.noOfChildren*g.noOfChildren/(n.noOfChildren+g.noOfChildren);n.repulsionForceX-=_*u,n.repulsionForceY-=_*c,g.repulsionForceX+=_*u,g.repulsionForceY+=_*c}else this.uniformLeafNodeSizes&&n.getChild()==null&&g.getChild()==null?(d=f.getCenterX()-l.getCenterX(),A=f.getCenterY()-l.getCenterY()):(h.getIntersection(l,f,y),d=y[2]-y[0],A=y[3]-y[1]),Math.abs(d)<t.MIN_REPULSION_DIST&&(d=a.sign(d)*t.MIN_REPULSION_DIST),Math.abs(A)<t.MIN_REPULSION_DIST&&(A=a.sign(A)*t.MIN_REPULSION_DIST),v=d*d+A*A,I=Math.sqrt(v),s=this.repulsionConstant*n.noOfChildren*g.noOfChildren/v,u=s*d/I,c=s*A/I,n.repulsionForceX-=u,n.repulsionForceY-=c,g.repulsionForceX+=u,g.repulsionForceY+=c},o.prototype.calcGravitationalForce=function(n){var g,l,f,E,y,d,A,v;g=n.getOwner(),l=(g.getRight()+g.getLeft())/2,f=(g.getTop()+g.getBottom())/2,E=n.getCenterX()-l,y=n.getCenterY()-f,d=Math.abs(E)+n.getWidth()/2,A=Math.abs(y)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()?(v=g.getEstimatedSize()*this.gravityRangeFactor,(d>v||A>v)&&(n.gravitationForceX=-this.gravityConstant*E,n.gravitationForceY=-this.gravityConstant*y)):(v=g.getEstimatedSize()*this.compoundGravityRangeFactor,(d>v||A>v)&&(n.gravitationForceX=-this.gravityConstant*E*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},o.prototype.isConverged=function(){var n,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||g},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var n,g=this.graphManager.getAllNodes(),l=0;l<g.length;l++)n=g[l],n.noOfChildren=n.getNoOfChildren()},o.prototype.calcGrid=function(n){var g=0,l=0;g=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));for(var f=new Array(g),E=0;E<g;E++)f[E]=new Array(l);for(var E=0;E<g;E++)for(var y=0;y<l;y++)f[E][y]=new Array;return f},o.prototype.addNodeToGrid=function(n,g,l){var f=0,E=0,y=0,d=0;f=parseInt(Math.floor((n.getRect().x-g)/this.repulsionRange)),E=parseInt(Math.floor((n.getRect().width+n.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((n.getRect().y-l)/this.repulsionRange)),d=parseInt(Math.floor((n.getRect().height+n.getRect().y-l)/this.repulsionRange));for(var A=f;A<=E;A++)for(var v=y;v<=d;v++)this.grid[A][v].push(n),n.setGridCoordinates(f,E,y,d)},o.prototype.updateGrid=function(){var n,g,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),n=0;n<l.length;n++)g=l[n],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(n,g,l,f){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&l||f){var E=new Set;n.surrounding=new Array;for(var y,d=this.grid,A=n.startX-1;A<n.finishX+2;A++)for(var v=n.startY-1;v<n.finishY+2;v++)if(!(A<0||v<0||A>=d.length||v>=d[0].length)){for(var I=0;I<d[A][v].length;I++)if(y=d[A][v][I],!(n.getOwner()!=y.getOwner()||n==y)&&!g.has(y)&&!E.has(y)){var s=Math.abs(n.getCenterX()-y.getCenterX())-(n.getWidth()/2+y.getWidth()/2),u=Math.abs(n.getCenterY()-y.getCenterY())-(n.getHeight()/2+y.getHeight()/2);s<=this.repulsionRange&&u<=this.repulsionRange&&E.add(y)}}n.surrounding=[].concat(i(E))}for(A=0;A<n.surrounding.length;A++)this.calcRepulsionForce(n,n.surrounding[A])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o},function(m,L,N){var i=N(1),e=N(7);function t(h,a,o){i.call(this,h,a,o),this.idealLength=e.DEFAULT_EDGE_LENGTH}O(t,"FDLayoutEdge"),t.prototype=Object.create(i.prototype);for(var r in i)t[r]=i[r];m.exports=t},function(m,L,N){var i=N(3);function e(r,h,a,o){i.call(this,r,h,a,o),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=[]}O(e,"FDLayoutNode"),e.prototype=Object.create(i.prototype);for(var t in i)e[t]=i[t];e.prototype.setGridCoordinates=function(r,h,a,o){this.startX=r,this.finishX=h,this.startY=a,this.finishY=o},m.exports=e},function(m,L,N){function i(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}O(i,"DimensionD"),i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},m.exports=i},function(m,L,N){var i=N(14);function e(){this.map={},this.keys=[]}O(e,"HashMap"),e.prototype.put=function(t,r){var h=i.createID(t);this.contains(h)||(this.map[h]=r,this.keys.push(t))},e.prototype.contains=function(t){return i.createID(t),this.map[t]!=null},e.prototype.get=function(t){var r=i.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},m.exports=e},function(m,L,N){var i=N(14);function e(){this.set={}}O(e,"HashSet"),e.prototype.add=function(t){var r=i.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[i.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[i.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var r=Object.keys(this.set),h=r.length,a=0;a<h;a++)t.push(this.set[r[a]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,h=0;h<r;h++){var a=t[h];this.add(a)}},m.exports=e},function(m,L,N){var i=function(){function h(a,o){for(var p=0;p<o.length;p++){var n=o[p];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}return O(h,"defineProperties"),function(a,o,p){return o&&h(a.prototype,o),p&&h(a,p),a}}();function e(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=N(11),r=function(){function h(a,o){e(this,h),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;a instanceof t?p=a.size():p=a.length,this._quicksort(a,0,p-1)}return O(h,"Quicksort"),i(h,[{key:"_quicksort",value:O(function(a,o,p){if(o<p){var n=this._partition(a,o,p);this._quicksort(a,o,n),this._quicksort(a,n+1,p)}},"_quicksort")},{key:"_partition",value:O(function(a,o,p){for(var n=this._get(a,o),g=o,l=p;;){for(;this.compareFunction(n,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,g),n);)g++;if(g<l)this._swap(a,g,l),g++,l--;else return l}},"_partition")},{key:"_get",value:O(function(a,o){return a instanceof t?a.get_object_at(o):a[o]},"_get")},{key:"_set",value:O(function(a,o,p){a instanceof t?a.set_object_at(o,p):a[o]=p},"_set")},{key:"_swap",value:O(function(a,o,p){var n=this._get(a,o);this._set(a,o,this._get(a,p)),this._set(a,p,n)},"_swap")},{key:"_defaultCompareFunction",value:O(function(a,o){return o>a},"_defaultCompareFunction")}]),h}();m.exports=r},function(m,L,N){var i=function(){function r(h,a){for(var o=0;o<a.length;o++){var p=a[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return O(r,"defineProperties"),function(h,a,o){return a&&r(h.prototype,a),o&&r(h,o),h}}();function e(r,h){if(!(r instanceof h))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=function(){function r(h,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,r),this.sequence1=h,this.sequence2=a,this.match_score=o,this.mismatch_penalty=p,this.gap_penalty=n,this.iMax=h.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[g][l]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var E=0;E<this.jMax;E++)this.tracebackGrid[f][E]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return O(r,"NeedlemanWunsch"),i(r,[{key:"getScore",value:O(function(){return this.score},"getScore")},{key:"getAlignments",value:O(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:O(function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var o=1;o<this.iMax;o++)for(var p=1;p<this.jMax;p++){var n=void 0;this.sequence1[o-1]===this.sequence2[p-1]?n=this.grid[o-1][p-1]+this.match_score:n=this.grid[o-1][p-1]+this.mismatch_penalty;var g=this.grid[o-1][p]+this.gap_penalty,l=this.grid[o][p-1]+this.gap_penalty,f=[n,g,l],E=this.arrayAllMaxIndexes(f);this.grid[o][p]=f[E[0]],this.tracebackGrid[o][p]=[E.includes(0),E.includes(1),E.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:O(function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var a=h[0],o=this.tracebackGrid[a.pos[0]][a.pos[1]];o[0]&&h.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),o[1]&&h.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),o[2]&&h.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),h.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:O(function(h,a){for(var o=[],p=-1;(p=h.indexOf(a,p+1))!==-1;)o.push(p);return o},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:O(function(h){return this.getAllIndexes(h,Math.max.apply(null,h))},"arrayAllMaxIndexes")}]),r}();m.exports=t},function(m,L,N){var i=O(function(){},"layoutBase");i.FDLayout=N(18),i.FDLayoutConstants=N(7),i.FDLayoutEdge=N(19),i.FDLayoutNode=N(20),i.DimensionD=N(21),i.HashMap=N(22),i.HashSet=N(23),i.IGeometry=N(8),i.IMath=N(9),i.Integer=N(10),i.Point=N(12),i.PointD=N(4),i.RandomSeed=N(16),i.RectangleD=N(13),i.Transform=N(17),i.UniqueIDGeneretor=N(14),i.Quicksort=N(24),i.LinkedList=N(11),i.LGraphObject=N(2),i.LGraph=N(5),i.LEdge=N(1),i.LGraphManager=N(6),i.LNode=N(3),i.Layout=N(15),i.LayoutConstants=N(0),i.NeedlemanWunsch=N(25),m.exports=i},function(m,L,N){function i(){this.listeners=[]}O(i,"Emitter");var e=i.prototype;e.addListener=function(t,r){this.listeners.push({event:t,callback:r})},e.removeListener=function(t,r){for(var h=this.listeners.length;h>=0;h--){var a=this.listeners[h];a.event===t&&a.callback===r&&this.listeners.splice(h,1)}},e.emit=function(t,r){for(var h=0;h<this.listeners.length;h++){var a=this.listeners[h];t===a.event&&a.callback(r)}},m.exports=i}])})}),Q=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L(Z()):typeof define=="function"&&define.amd?define(["layout-base"],L):typeof C=="object"?C.coseBase=L(Z()):m.coseBase=L(m.layoutBase)},"webpackUniversalModuleDefinition")(C,function(m){return function(L){var N={};function i(e){if(N[e])return N[e].exports;var t=N[e]={i:e,l:!1,exports:{}};return L[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return O(i,"__webpack_require__"),i.m=L,i.c=N,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?O(function(){return e.default},"getDefault"):O(function(){return e},"getModuleExports");return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=7)}([function(L,N){L.exports=m},function(L,N,i){var e=i(0).FDLayoutConstants;function t(){}O(t,"CoSEConstants");for(var r in e)t[r]=e[r];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,L.exports=t},function(L,N,i){var e=i(0).FDLayoutEdge;function t(h,a,o){e.call(this,h,a,o)}O(t,"CoSEEdge"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).LGraph;function t(h,a,o){e.call(this,h,a,o)}O(t,"CoSEGraph"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).LGraphManager;function t(h){e.call(this,h)}O(t,"CoSEGraphManager"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).FDLayoutNode,t=i(0).IMath;function r(a,o,p,n){e.call(this,a,o,p,n)}O(r,"CoSENode"),r.prototype=Object.create(e.prototype);for(var h in e)r[h]=e[h];r.prototype.move=function(){var a=this.graphManager.getLayout();this.displacementX=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),a.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},r.prototype.propogateDisplacementToChildren=function(a,o){for(var p=this.getChild().getNodes(),n,g=0;g<p.length;g++)n=p[g],n.getChild()==null?(n.moveBy(a,o),n.displacementX+=a,n.displacementY+=o):n.propogateDisplacementToChildren(a,o)},r.prototype.setPred1=function(a){this.pred1=a},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(a){this.next=a},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(a){this.processed=a},r.prototype.isProcessed=function(){return processed},L.exports=r},function(L,N,i){var e=i(0).FDLayout,t=i(4),r=i(3),h=i(5),a=i(2),o=i(1),p=i(0).FDLayoutConstants,n=i(0).LayoutConstants,g=i(0).Point,l=i(0).PointD,f=i(0).Layout,E=i(0).Integer,y=i(0).IGeometry,d=i(0).LGraph,A=i(0).Transform;function v(){e.call(this),this.toBeTiled={}}O(v,"CoSELayout"),v.prototype=Object.create(e.prototype);for(var I in e)v[I]=e[I];v.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},v.prototype.newGraph=function(s){return new r(null,this.graphManager,s)},v.prototype.newNode=function(s){return new h(this.graphManager,s)},v.prototype.newEdge=function(s){return new a(null,null,s)},v.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=p.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=p.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=p.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=p.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/p.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=p.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},v.prototype.layout=function(){var s=n.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(_){return s.has(_)});this.graphManager.setAllNodesToApplyGravitation(u)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(w){return s.has(w)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.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%p.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(T){return s.has(T)});this.graphManager.setAllNodesToApplyGravitation(u),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,_=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,_),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),u={},c=0;c<s.length;c++){var _=s[c].rect,T=s[c].id;u[T]={id:T,x:_.getCenterX(),y:_.getCenterY(),w:_.width,h:_.height}}return u},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},v.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],u,c=this.graphManager.getGraphs(),_=c.length,T;for(T=0;T<_;T++)u=c[T],u.updateConnected(),u.isConnected||(s=s.concat(u.getNodes()));return s},v.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var u=new Set,c;for(c=0;c<s.length;c++){var _=s[c];if(!u.has(_)){var T=_.getSource(),w=_.getTarget();if(T==w)_.getBendpoints().push(new l),_.getBendpoints().push(new l),this.createDummyNodesForBendpoints(_),u.add(_);else{var D=[];if(D=D.concat(T.getEdgeListToNode(w)),D=D.concat(w.getEdgeListToNode(T)),!u.has(D[0])){if(D.length>1){var M;for(M=0;M<D.length;M++){var R=D[M];R.getBendpoints().push(new l),this.createDummyNodesForBendpoints(R)}}D.forEach(function(F){u.add(F)})}}}if(u.size==s.length)break}},v.prototype.positionNodesRadially=function(s){for(var u=new g(0,0),c=Math.ceil(Math.sqrt(s.length)),_=0,T=0,w=0,D=new l(0,0),M=0;M<s.length;M++){M%c==0&&(w=0,T=_,M!=0&&(T+=o.DEFAULT_COMPONENT_SEPERATION),_=0);var R=s[M],F=f.findCenterOfTree(R);u.x=w,u.y=T,D=v.radialLayout(R,F,u),D.y>_&&(_=Math.floor(D.y)),w=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(n.WORLD_CENTER_X-D.x/2,n.WORLD_CENTER_Y-D.y/2))},v.radialLayout=function(s,u,c){var _=Math.max(this.maxDiagonalInTree(s),o.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(u,null,0,359,0,_);var T=d.calculateBounds(s),w=new A;w.setDeviceOrgX(T.getMinX()),w.setDeviceOrgY(T.getMinY()),w.setWorldOrgX(c.x),w.setWorldOrgY(c.y);for(var D=0;D<s.length;D++){var M=s[D];M.transform(w)}var R=new l(T.getMaxX(),T.getMaxY());return w.inverseTransformPoint(R)},v.branchRadialLayout=function(s,u,c,_,T,w){var D=(_-c+1)/2;D<0&&(D+=180);var M=(D+c)%360,R=M*y.TWO_PI/360,F=T*Math.cos(R),S=T*Math.sin(R);s.setCenter(F,S);var x=[];x=x.concat(s.getEdges());var G=x.length;u!=null&&G--;for(var b=0,P=x.length,U,Y=s.getEdgesBetween(u);Y.length>1;){var B=Y[0];Y.splice(0,1);var k=x.indexOf(B);k>=0&&x.splice(k,1),P--,G--}u!=null?U=(x.indexOf(Y[0])+1)%P:U=0;for(var H=Math.abs(_-c)/G,W=U;b!=G;W=++W%P){var q=x[W].getOtherEnd(s);if(q!=u){var z=(c+b*H)%360,ot=(z+H)%360;v.branchRadialLayout(q,s,z,ot,T+w,w),b++}}},v.maxDiagonalInTree=function(s){for(var u=E.MIN_VALUE,c=0;c<s.length;c++){var _=s[c],T=_.getDiagonal();T>u&&(u=T)}return u},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var s=this,u={};this.memberGroups={},this.idToDummyNode={};for(var c=[],_=this.graphManager.getAllNodes(),T=0;T<_.length;T++){var w=_[T],D=w.getParent();this.getNodeDegreeWithChildren(w)===0&&(D.id==null||!this.getToBeTiled(D))&&c.push(w)}for(var T=0;T<c.length;T++){var w=c[T],M=w.getParent().id;typeof u[M]>"u"&&(u[M]=[]),u[M]=u[M].concat(w)}Object.keys(u).forEach(function(R){if(u[R].length>1){var F="DummyCompound_"+R;s.memberGroups[F]=u[R];var S=u[R][0].getParent(),x=new h(s.graphManager);x.id=F,x.paddingLeft=S.paddingLeft||0,x.paddingRight=S.paddingRight||0,x.paddingBottom=S.paddingBottom||0,x.paddingTop=S.paddingTop||0,s.idToDummyNode[F]=x;var G=s.getGraphManager().add(s.newGraph(),x),b=S.getChild();b.add(x);for(var P=0;P<u[R].length;P++){var U=u[R][P];b.remove(U),G.add(U)}}})},v.prototype.clearCompounds=function(){var s={},u={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)u[this.compoundOrder[c].id]=this.compoundOrder[c],s[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,u)},v.prototype.clearZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var _=s.idToDummyNode[c];u[c]=s.tileNodes(s.memberGroups[c],_.paddingLeft+_.paddingRight),_.rect.width=u[c].width,_.rect.height=u[c].height})},v.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var u=this.compoundOrder[s],c=u.id,_=u.paddingLeft,T=u.paddingTop;this.adjustLocations(this.tiledMemberPack[c],u.rect.x,u.rect.y,_,T)}},v.prototype.repopulateZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack;Object.keys(u).forEach(function(c){var _=s.idToDummyNode[c],T=_.paddingLeft,w=_.paddingTop;s.adjustLocations(u[c],_.rect.x,_.rect.y,T,w)})},v.prototype.getToBeTiled=function(s){var u=s.id;if(this.toBeTiled[u]!=null)return this.toBeTiled[u];var c=s.getChild();if(c==null)return this.toBeTiled[u]=!1,!1;for(var _=c.getNodes(),T=0;T<_.length;T++){var w=_[T];if(this.getNodeDegree(w)>0)return this.toBeTiled[u]=!1,!1;if(w.getChild()==null){this.toBeTiled[w.id]=!1;continue}if(!this.getToBeTiled(w))return this.toBeTiled[u]=!1,!1}return this.toBeTiled[u]=!0,!0},v.prototype.getNodeDegree=function(s){for(var u=s.id,c=s.getEdges(),_=0,T=0;T<c.length;T++){var w=c[T];w.getSource().id!==w.getTarget().id&&(_=_+1)}return _},v.prototype.getNodeDegreeWithChildren=function(s){var u=this.getNodeDegree(s);if(s.getChild()==null)return u;for(var c=s.getChild().getNodes(),_=0;_<c.length;_++){var T=c[_];u+=this.getNodeDegreeWithChildren(T)}return u},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(s){for(var u=0;u<s.length;u++){var c=s[u];c.getChild()!=null&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},v.prototype.adjustLocations=function(s,u,c,_,T){u+=_,c+=T;for(var w=u,D=0;D<s.rows.length;D++){var M=s.rows[D];u=w;for(var R=0,F=0;F<M.length;F++){var S=M[F];S.rect.x=u,S.rect.y=c,u+=S.rect.width+s.horizontalPadding,S.rect.height>R&&(R=S.rect.height)}c+=R+s.verticalPadding}},v.prototype.tileCompoundMembers=function(s,u){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(_){var T=u[_];c.tiledMemberPack[_]=c.tileNodes(s[_],T.paddingLeft+T.paddingRight),T.rect.width=c.tiledMemberPack[_].width,T.rect.height=c.tiledMemberPack[_].height})},v.prototype.tileNodes=function(s,u){var c=o.TILING_PADDING_VERTICAL,_=o.TILING_PADDING_HORIZONTAL,T={rows:[],rowWidth:[],rowHeight:[],width:0,height:u,verticalPadding:c,horizontalPadding:_};s.sort(function(M,R){return M.rect.width*M.rect.height>R.rect.width*R.rect.height?-1:M.rect.width*M.rect.height<R.rect.width*R.rect.height?1:0});for(var w=0;w<s.length;w++){var D=s[w];T.rows.length==0?this.insertNodeToRow(T,D,0,u):this.canAddHorizontal(T,D.rect.width,D.rect.height)?this.insertNodeToRow(T,D,this.getShortestRowIndex(T),u):this.insertNodeToRow(T,D,T.rows.length,u),this.shiftToLastRow(T)}return T},v.prototype.insertNodeToRow=function(s,u,c,_){var T=_;if(c==s.rows.length){var w=[];s.rows.push(w),s.rowWidth.push(T),s.rowHeight.push(0)}var D=s.rowWidth[c]+u.rect.width;s.rows[c].length>0&&(D+=s.horizontalPadding),s.rowWidth[c]=D,s.width<D&&(s.width=D);var M=u.rect.height;c>0&&(M+=s.verticalPadding);var R=0;M>s.rowHeight[c]&&(R=s.rowHeight[c],s.rowHeight[c]=M,R=s.rowHeight[c]-R),s.height+=R,s.rows[c].push(u)},v.prototype.getShortestRowIndex=function(s){for(var u=-1,c=Number.MAX_VALUE,_=0;_<s.rows.length;_++)s.rowWidth[_]<c&&(u=_,c=s.rowWidth[_]);return u},v.prototype.getLongestRowIndex=function(s){for(var u=-1,c=Number.MIN_VALUE,_=0;_<s.rows.length;_++)s.rowWidth[_]>c&&(u=_,c=s.rowWidth[_]);return u},v.prototype.canAddHorizontal=function(s,u,c){var _=this.getShortestRowIndex(s);if(_<0)return!0;var T=s.rowWidth[_];if(T+s.horizontalPadding+u<=s.width)return!0;var w=0;s.rowHeight[_]<c&&_>0&&(w=c+s.verticalPadding-s.rowHeight[_]);var D;s.width-T>=u+s.horizontalPadding?D=(s.height+w)/(T+u+s.horizontalPadding):D=(s.height+w)/s.width,w=c+s.verticalPadding;var M;return s.width<u?M=(s.height+w)/u:M=(s.height+w)/s.width,M<1&&(M=1/M),D<1&&(D=1/D),D<M},v.prototype.shiftToLastRow=function(s){var u=this.getLongestRowIndex(s),c=s.rowWidth.length-1,_=s.rows[u],T=_[_.length-1],w=T.width+s.horizontalPadding;if(s.width-s.rowWidth[c]>w&&u!=c){_.splice(-1,1),s.rows[c].push(T),s.rowWidth[u]=s.rowWidth[u]-w,s.rowWidth[c]=s.rowWidth[c]+w,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var D=Number.MIN_VALUE,M=0;M<_.length;M++)_[M].height>D&&(D=_[M].height);u>0&&(D+=s.verticalPadding);var R=s.rowHeight[u]+s.rowHeight[c];s.rowHeight[u]=D,s.rowHeight[c]<T.height+s.verticalPadding&&(s.rowHeight[c]=T.height+s.verticalPadding);var F=s.rowHeight[u]+s.rowHeight[c];s.height+=F-R,this.shiftToLastRow(s)}},v.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var s=[],u=!0,c;u;){var _=this.graphManager.getAllNodes(),T=[];u=!1;for(var w=0;w<_.length;w++)c=_[w],c.getEdges().length==1&&!c.getEdges()[0].isInterGraph&&c.getChild()==null&&(T.push([c,c.getEdges()[0],c.getOwner()]),u=!0);if(u==!0){for(var D=[],M=0;M<T.length;M++)T[M][0].getEdges().length==1&&(D.push(T[M]),T[M][0].getOwner().remove(T[M][0]));s.push(D),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},v.prototype.growTree=function(s){for(var u=s.length,c=s[u-1],_,T=0;T<c.length;T++)_=c[T],this.findPlaceforPrunedNode(_),_[2].add(_[0]),_[2].add(_[1],_[1].source,_[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(s){var u,c,_=s[0];_==s[1].source?c=s[1].target:c=s[1].source;var T=c.startX,w=c.finishX,D=c.startY,M=c.finishY,R=0,F=0,S=0,x=0,G=[R,S,F,x];if(D>0)for(var b=T;b<=w;b++)G[0]+=this.grid[b][D-1].length+this.grid[b][D].length-1;if(w<this.grid.length-1)for(var b=D;b<=M;b++)G[1]+=this.grid[w+1][b].length+this.grid[w][b].length-1;if(M<this.grid[0].length-1)for(var b=T;b<=w;b++)G[2]+=this.grid[b][M+1].length+this.grid[b][M].length-1;if(T>0)for(var b=D;b<=M;b++)G[3]+=this.grid[T-1][b].length+this.grid[T][b].length-1;for(var P=E.MAX_VALUE,U,Y,B=0;B<G.length;B++)G[B]<P?(P=G[B],U=1,Y=B):G[B]==P&&U++;if(U==3&&P==0)G[0]==0&&G[1]==0&&G[2]==0?u=1:G[0]==0&&G[1]==0&&G[3]==0?u=0:G[0]==0&&G[2]==0&&G[3]==0?u=3:G[1]==0&&G[2]==0&&G[3]==0&&(u=2);else if(U==2&&P==0){var k=Math.floor(Math.random()*2);G[0]==0&&G[1]==0?k==0?u=0:u=1:G[0]==0&&G[2]==0?k==0?u=0:u=2:G[0]==0&&G[3]==0?k==0?u=0:u=3:G[1]==0&&G[2]==0?k==0?u=1:u=2:G[1]==0&&G[3]==0?k==0?u=1:u=3:k==0?u=2:u=3}else if(U==4&&P==0){var k=Math.floor(Math.random()*4);u=k}else u=Y;u==0?_.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-p.DEFAULT_EDGE_LENGTH-_.getHeight()/2):u==1?_.setCenter(c.getCenterX()+c.getWidth()/2+p.DEFAULT_EDGE_LENGTH+_.getWidth()/2,c.getCenterY()):u==2?_.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+p.DEFAULT_EDGE_LENGTH+_.getHeight()/2):_.setCenter(c.getCenterX()-c.getWidth()/2-p.DEFAULT_EDGE_LENGTH-_.getWidth()/2,c.getCenterY())},L.exports=v},function(L,N,i){var e={};e.layoutBase=i(0),e.CoSEConstants=i(1),e.CoSEEdge=i(2),e.CoSEGraph=i(3),e.CoSEGraphManager=i(4),e.CoSELayout=i(6),e.CoSENode=i(5),L.exports=e}])})}),ht=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L(Q()):typeof define=="function"&&define.amd?define(["cose-base"],L):typeof C=="object"?C.cytoscapeCoseBilkent=L(Q()):m.cytoscapeCoseBilkent=L(m.coseBase)},"webpackUniversalModuleDefinition")(C,function(m){return function(L){var N={};function i(e){if(N[e])return N[e].exports;var t=N[e]={i:e,l:!1,exports:{}};return L[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return O(i,"__webpack_require__"),i.m=L,i.c=N,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?O(function(){return e.default},"getDefault"):O(function(){return e},"getModuleExports");return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(L,N){L.exports=m},function(L,N,i){var e=i(0).layoutBase.LayoutConstants,t=i(0).layoutBase.FDLayoutConstants,r=i(0).CoSEConstants,h=i(0).CoSELayout,a=i(0).CoSENode,o=i(0).layoutBase.PointD,p=i(0).layoutBase.DimensionD,n={ready:O(function(){},"ready"),stop:O(function(){},"stop"),quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function g(y,d){var A={};for(var v in y)A[v]=y[v];for(var v in d)A[v]=d[v];return A}O(g,"extend");function l(y){this.options=g(n,y),f(this.options)}O(l,"_CoSELayout");var f=O(function(y){y.nodeRepulsion!=null&&(r.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=y.nodeRepulsion),y.idealEdgeLength!=null&&(r.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=y.idealEdgeLength),y.edgeElasticity!=null&&(r.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=y.edgeElasticity),y.nestingFactor!=null&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(r.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(r.MAX_ITERATIONS=t.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.quality=="draft"?e.QUALITY=0:y.quality=="proof"?e.QUALITY=2:e.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!y.randomize,r.ANIMATE=t.ANIMATE=e.ANIMATE=y.animate,r.TILE=y.tile,r.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal},"getUserOptions");l.prototype.run=function(){var y,d,A=this.options;this.idToLNode={};var v=this.layout=new h,I=this;I.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=v.newGraphManager();this.gm=s;var u=this.options.eles.nodes(),c=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(u),v);for(var _=0;_<c.length;_++){var T=c[_],w=this.idToLNode[T.data("source")],D=this.idToLNode[T.data("target")];if(w!==D&&w.getEdgesBetween(D).length==0){var M=s.add(v.newEdge(),w,D);M.id=T.id()}}var R=O(function(S,x){typeof S=="number"&&(S=x);var G=S.data("id"),b=I.idToLNode[G];return{x:b.getRect().getCenterX(),y:b.getRect().getCenterY()}},"getPositions"),F=O(function S(){for(var x=O(function(){A.fit&&A.cy.fit(A.eles,A.padding),y||(y=!0,I.cy.one("layoutready",A.ready),I.cy.trigger({type:"layoutready",layout:I}))},"afterReposition"),G=I.options.refresh,b,P=0;P<G&&!b;P++)b=I.stopped||I.layout.tick();if(b){v.checkLayoutSuccess()&&!v.isSubLayout&&v.doPostLayout(),v.tilingPostLayout&&v.tilingPostLayout(),v.isLayoutFinished=!0,I.options.eles.nodes().positions(R),x(),I.cy.one("layoutstop",I.options.stop),I.cy.trigger({type:"layoutstop",layout:I}),d&&cancelAnimationFrame(d),y=!1;return}var U=I.layout.getPositionsData();A.eles.nodes().positions(function(Y,B){if(typeof Y=="number"&&(Y=B),!Y.isParent()){for(var k=Y.id(),H=U[k],W=Y;H==null&&(H=U[W.data("parent")]||U["DummyCompound_"+W.data("parent")],U[k]=H,W=W.parent()[0],W!=null););return H!=null?{x:H.x,y:H.y}:{x:Y.position("x"),y:Y.position("y")}}}),x(),d=requestAnimationFrame(S)},"iterateAnimated");return v.addListener("layoutstarted",function(){I.options.animate==="during"&&(d=requestAnimationFrame(F))}),v.runLayout(),this.options.animate!=="during"&&(I.options.eles.nodes().not(":parent").layoutPositions(I,I.options,R),y=!1),this},l.prototype.getTopMostNodes=function(y){for(var d={},A=0;A<y.length;A++)d[y[A].id()]=!0;var v=y.filter(function(I,s){typeof I=="number"&&(I=s);for(var u=I.parent()[0];u!=null;){if(d[u.id()])return!1;u=u.parent()[0]}return!0});return v},l.prototype.processChildrenList=function(y,d,A){for(var v=d.length,I=0;I<v;I++){var s=d[I],u=s.children(),c,_=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?c=y.add(new a(A.graphManager,new o(s.position("x")-_.w/2,s.position("y")-_.h/2),new p(parseFloat(_.w),parseFloat(_.h)))):c=y.add(new a(this.graphManager)),c.id=s.data("id"),c.paddingLeft=parseInt(s.css("padding")),c.paddingTop=parseInt(s.css("padding")),c.paddingRight=parseInt(s.css("padding")),c.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var T=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,w=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,D=s.css("text-halign");c.labelWidth=T,c.labelHeight=w,c.labelPos=D}if(this.idToLNode[s.data("id")]=c,isNaN(c.rect.x)&&(c.rect.x=0),isNaN(c.rect.y)&&(c.rect.y=0),u!=null&&u.length>0){var M;M=A.getGraphManager().add(A.newGraph(),c),this.processChildrenList(M,u,A)}}},l.prototype.stop=function(){return this.stopped=!0,this};var E=O(function(y){y("layout","cose-bilkent",l)},"register");typeof cytoscape<"u"&&E(cytoscape),L.exports=E}])})}),lt=at(ht());$.use(lt.default);function K(C,X){C.forEach(m=>{let L={id:m.id,labelText:m.label,height:m.height,width:m.width,padding:m.padding??0};Object.keys(m).forEach(N=>{["id","label","height","width","padding","x","y"].includes(N)||(L[N]=m[N])}),X.add({group:"nodes",data:L,position:{x:m.x??0,y:m.y??0}})})}O(K,"addNodes");function J(C,X){C.forEach(m=>{let L={id:m.id,source:m.start,target:m.end};Object.keys(m).forEach(N=>{["id","start","end"].includes(N)||(L[N]=m[N])}),X.add({group:"edges",data:L})})}O(J,"addEdges");function tt(C){return new Promise(X=>{let m=st("body").append("div").attr("id","cy").attr("style","display:none"),L=$({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});m.remove(),K(C.nodes,L),J(C.edges,L),L.nodes().forEach(function(i){i.layoutDimensions=()=>{let e=i.data();return{w:e.width,h:e.height}}});let N={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};L.layout(N).run(),L.ready(i=>{j.info("Cytoscape ready",i),X(L)})})}O(tt,"createCytoscapeInstance");function et(C){return C.nodes().map(X=>{let m=X.data(),L=X.position(),N={id:m.id,x:L.x,y:L.y};return Object.keys(m).forEach(i=>{i!=="id"&&(N[i]=m[i])}),N})}O(et,"extractPositionedNodes");function rt(C){return C.edges().map(X=>{let m=X.data(),L=X._private.rscratch,N={id:m.id,source:m.source,target:m.target,startX:L.startX,startY:L.startY,midX:L.midX,midY:L.midY,endX:L.endX,endY:L.endY};return Object.keys(m).forEach(i=>{["id","source","target"].includes(i)||(N[i]=m[i])}),N})}O(rt,"extractPositionedEdges");async function it(C,X){j.debug("Starting cose-bilkent layout algorithm");try{nt(C);let m=await tt(C),L=et(m),N=rt(m);return j.debug(`Layout completed: ${L.length} nodes, ${N.length} edges`),{nodes:L,edges:N}}catch(m){throw j.error("Error in cose-bilkent layout algorithm:",m),m}}O(it,"executeCoseBilkentLayout");function nt(C){if(!C)throw new Error("Layout data is required");if(!C.config)throw new Error("Configuration is required in layout data");if(!C.rootNode)throw new Error("Root node is required");if(!C.nodes||!Array.isArray(C.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(C.edges))throw new Error("Edges array is required in layout data");return!0}O(nt,"validateLayoutData");var gt=O(async(C,X,{insertCluster:m,insertEdge:L,insertEdgeLabel:N,insertMarkers:i,insertNode:e,log:t,positionEdgeLabel:r},{algorithm:h})=>{let a={},o={},p=X.select("g");i(p,C.markers,C.type,C.diagramId);let n=p.insert("g").attr("class","subgraphs"),g=p.insert("g").attr("class","edgePaths"),l=p.insert("g").attr("class","edgeLabels"),f=p.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(C.nodes.map(async d=>{if(d.isGroup){let A={...d};o[d.id]=A,a[d.id]=A,await m(n,d)}else{let A={...d};a[d.id]=A;let v=await e(f,d,{config:C.config,dir:C.direction||"TB"}),I=v.node().getBBox();A.width=I.width,A.height=I.height,A.domId=v,t.debug(`Node ${d.id} dimensions: ${I.width}x${I.height}`)}})),t.debug("Running cose-bilkent layout algorithm");let E={...C,nodes:C.nodes.map(d=>{let A=a[d.id];return{...d,width:A.width,height:A.height}})},y=await it(E,C.config);t.debug("Positioning nodes based on layout results"),y.nodes.forEach(d=>{let A=a[d.id];A!=null&&A.domId&&(A.domId.attr("transform",`translate(${d.x}, ${d.y})`),A.x=d.x,A.y=d.y,t.debug(`Positioned node ${A.id} at center (${d.x}, ${d.y})`))}),y.edges.forEach(d=>{let A=C.edges.find(v=>v.id===d.id);A&&(A.points=[{x:d.startX,y:d.startY},{x:d.midX,y:d.midY},{x:d.endX,y:d.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(C.edges.map(async d=>{await N(l,d);let A=a[d.start??""],v=a[d.end??""];if(A&&v){let I=y.edges.find(s=>s.id===d.id);if(I){t.debug("APA01 positionedEdge",I);let s={...d},u=L(g,s,o,C.type,A,v,C.diagramId);r(s,u)}else{let s={...d,points:[{x:A.x||0,y:A.y||0},{x:v.x||0,y:v.y||0}]},u=L(g,s,o,C.type,A,v,C.diagramId);r(s,u)}}})),t.debug("Cose-bilkent rendering completed")},"render"),dt=gt;export{dt as render};
1
+ import{r as $}from"./chunk-3SSMPTDK-KGZSzG3Y.js";import{m as O,p as j,i as st,f as at,a6 as V}from"./index-B5WxtMpv.js";var Z=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L():typeof define=="function"&&define.amd?define([],L):typeof C=="object"?C.layoutBase=L():m.layoutBase=L()},"webpackUniversalModuleDefinition")(C,function(){return function(m){var L={};function N(i){if(L[i])return L[i].exports;var e=L[i]={i,l:!1,exports:{}};return m[i].call(e.exports,e,e.exports,N),e.l=!0,e.exports}return O(N,"__webpack_require__"),N.m=m,N.c=L,N.i=function(i){return i},N.d=function(i,e,t){N.o(i,e)||Object.defineProperty(i,e,{configurable:!1,enumerable:!0,get:t})},N.n=function(i){var e=i&&i.__esModule?O(function(){return i.default},"getDefault"):O(function(){return i},"getModuleExports");return N.d(e,"a",e),e},N.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},N.p="",N(N.s=26)}([function(m,L,N){function i(){}O(i,"LayoutConstants"),i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,m.exports=i},function(m,L,N){var i=N(2),e=N(8),t=N(9);function r(a,o,p){i.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=a,this.target=o}O(r,"LEdge"),r.prototype=Object.create(i.prototype);for(var h in i)r[h]=i[h];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(a,o){for(var p=this.getOtherEnd(a),n=o.getGraphManager().getRoot();;){if(p.getOwner()==o)return p;if(p.getOwner()==n)break;p=p.getOwner().getParent()}return null},r.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=r},function(m,L,N){function i(e){this.vGraphObject=e}O(i,"LGraphObject"),m.exports=i},function(m,L,N){var i=N(2),e=N(10),t=N(13),r=N(0),h=N(16),a=N(4);function o(n,g,l,f){l==null&&f==null&&(f=g),i.call(this,f),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=n,l!=null&&g!=null?this.rect=new t(g.x,g.y,l.width,l.height):this.rect=new t}O(o,"LNode"),o.prototype=Object.create(i.prototype);for(var p in i)o[p]=i[p];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(n){this.rect.width=n},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(n){this.rect.height=n},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(n,g){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(n,g){this.rect.x=n-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(n,g){this.rect.x=n,this.rect.y=g},o.prototype.moveBy=function(n,g){this.rect.x+=n,this.rect.y+=g},o.prototype.getEdgeListToNode=function(n){var g=[],l=this;return l.edges.forEach(function(f){if(f.target==n){if(f.source!=l)throw"Incorrect edge source!";g.push(f)}}),g},o.prototype.getEdgesBetween=function(n){var g=[],l=this;return l.edges.forEach(function(f){if(!(f.source==l||f.target==l))throw"Incorrect edge source and/or target";(f.target==n||f.source==n)&&g.push(f)}),g},o.prototype.getNeighborsList=function(){var n=new Set,g=this;return g.edges.forEach(function(l){if(l.source==g)n.add(l.target);else{if(l.target!=g)throw"Incorrect incidency!";n.add(l.source)}}),n},o.prototype.withChildren=function(){var n=new Set,g,l;if(n.add(this),this.child!=null)for(var f=this.child.getNodes(),E=0;E<f.length;E++)g=f[E],l=g.withChildren(),l.forEach(function(y){n.add(y)});return n},o.prototype.getNoOfChildren=function(){var n=0,g;if(this.child==null)n=1;else for(var l=this.child.getNodes(),f=0;f<l.length;f++)g=l[f],n+=g.getNoOfChildren();return n==0&&(n=1),n},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},o.prototype.scatter=function(){var n,g,l=-r.INITIAL_WORLD_BOUNDARY,f=r.INITIAL_WORLD_BOUNDARY;n=r.WORLD_CENTER_X+h.nextDouble()*(f-l)+l;var E=-r.INITIAL_WORLD_BOUNDARY,y=r.INITIAL_WORLD_BOUNDARY;g=r.WORLD_CENTER_Y+h.nextDouble()*(y-E)+E,this.rect.x=n,this.rect.y=g},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var n=this.getChild();if(n.updateBounds(!0),this.rect.x=n.getLeft(),this.rect.y=n.getTop(),this.setWidth(n.getRight()-n.getLeft()),this.setHeight(n.getBottom()-n.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var g=n.getRight()-n.getLeft(),l=n.getBottom()-n.getTop();this.labelWidth>g&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(n){var g=this.rect.x;g>r.WORLD_BOUNDARY?g=r.WORLD_BOUNDARY:g<-r.WORLD_BOUNDARY&&(g=-r.WORLD_BOUNDARY);var l=this.rect.y;l>r.WORLD_BOUNDARY?l=r.WORLD_BOUNDARY:l<-r.WORLD_BOUNDARY&&(l=-r.WORLD_BOUNDARY);var f=new a(g,l),E=n.inverseTransformPoint(f);this.setLocation(E.x,E.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=o},function(m,L,N){function i(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}O(i,"PointD"),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(e){this.x=e},i.prototype.setY=function(e){this.y=e},i.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},m.exports=i},function(m,L,N){var i=N(2),e=N(10),t=N(0),r=N(6),h=N(3),a=N(1),o=N(13),p=N(12),n=N(11);function g(f,E,y){i.call(this,y),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,E!=null&&E instanceof r?this.graphManager=E:E!=null&&E instanceof Layout&&(this.graphManager=E.graphManager)}O(g,"LGraph"),g.prototype=Object.create(i.prototype);for(var l in i)g[l]=i[l];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(f,E,y){if(E==null&&y==null){var d=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var A=f;if(!(this.getNodes().indexOf(E)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(E.owner==y.owner&&E.owner==this))throw"Both owners must be this graph!";return E.owner!=y.owner?null:(A.source=E,A.target=y,A.isInterGraph=!1,this.getEdges().push(A),E.edges.push(A),y!=E&&y.edges.push(A),A)}},g.prototype.remove=function(f){var E=f;if(f instanceof h){if(E==null)throw"Node is null!";if(!(E.owner!=null&&E.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=E.edges.slice(),d,A=y.length,v=0;v<A;v++)d=y[v],d.isInterGraph?this.graphManager.remove(d):d.source.owner.remove(d);var I=this.nodes.indexOf(E);if(I==-1)throw"Node not in owner node list!";this.nodes.splice(I,1)}else if(f instanceof a){var d=f;if(d==null)throw"Edge is null!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.owner!=null&&d.target.owner!=null&&d.source.owner==this&&d.target.owner==this))throw"Source and/or target owner is invalid!";var s=d.source.edges.indexOf(d),u=d.target.edges.indexOf(d);if(!(s>-1&&u>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(s,1),d.target!=d.source&&d.target.edges.splice(u,1);var I=d.source.owner.getEdges().indexOf(d);if(I==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(I,1)}},g.prototype.updateLeftTop=function(){for(var f=e.MAX_VALUE,E=e.MAX_VALUE,y,d,A,v=this.getNodes(),I=v.length,s=0;s<I;s++){var u=v[s];y=u.getTop(),d=u.getLeft(),f>y&&(f=y),E>d&&(E=d)}return f==e.MAX_VALUE?null:(v[0].getParent().paddingLeft!=null?A=v[0].getParent().paddingLeft:A=this.margin,this.left=E-A,this.top=f-A,new p(this.left,this.top))},g.prototype.updateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,A=-e.MAX_VALUE,v,I,s,u,c,_=this.nodes,T=_.length,w=0;w<T;w++){var D=_[w];f&&D.child!=null&&D.updateBounds(),v=D.getLeft(),I=D.getRight(),s=D.getTop(),u=D.getBottom(),E>v&&(E=v),y<I&&(y=I),d>s&&(d=s),A<u&&(A=u)}var M=new o(E,d,y-E,A-d);E==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),_[0].getParent().paddingLeft!=null?c=_[0].getParent().paddingLeft:c=this.margin,this.left=M.x-c,this.right=M.x+M.width+c,this.top=M.y-c,this.bottom=M.y+M.height+c},g.calculateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,A=-e.MAX_VALUE,v,I,s,u,c=f.length,_=0;_<c;_++){var T=f[_];v=T.getLeft(),I=T.getRight(),s=T.getTop(),u=T.getBottom(),E>v&&(E=v),y<I&&(y=I),d>s&&(d=s),A<u&&(A=u)}var w=new o(E,d,y-E,A-d);return w},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var f=0,E=this.nodes,y=E.length,d=0;d<y;d++){var A=E[d];f+=A.calcEstimatedSize()}return f==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var E=new n,y=new Set,d=this.nodes[0],A,v,I=d.withChildren();for(I.forEach(function(w){E.push(w),y.add(w)});E.length!==0;){d=E.shift(),A=d.getEdges();for(var s=A.length,u=0;u<s;u++){var c=A[u];if(v=c.getOtherEndInGraph(d,this),v!=null&&!y.has(v)){var _=v.withChildren();_.forEach(function(w){E.push(w),y.add(w)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var T=0;y.forEach(function(w){w.owner==f&&T++}),T==this.nodes.length&&(this.isConnected=!0)}},m.exports=g},function(m,L,N){var i,e=N(1);function t(r){i=N(5),this.layout=r,this.graphs=[],this.edges=[]}O(t,"LGraphManager"),t.prototype.addRoot=function(){var r=this.layout.newGraph(),h=this.layout.newNode(null),a=this.add(r,h);return this.setRootGraph(a),this.rootGraph},t.prototype.add=function(r,h,a,o,p){if(a==null&&o==null&&p==null){if(r==null)throw"Graph is null!";if(h==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(h.child!=null)throw"Already has a child!";return r.parent=h,h.child=r,r}else{p=a,o=h,a=r;var n=o.getOwner(),g=p.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==g)return a.isInterGraph=!1,n.add(a,o,p);if(a.isInterGraph=!0,a.source=o,a.target=p,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},t.prototype.remove=function(r){if(r instanceof i){var h=r;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(h.getEdges());for(var o,p=a.length,n=0;n<p;n++)o=a[n],h.remove(o);var g=[];g=g.concat(h.getNodes());var l;p=g.length;for(var n=0;n<p;n++)l=g[n],h.remove(l);h==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(h);this.graphs.splice(f,1),h.parent=null}else if(r instanceof e){if(o=r,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var f=o.source.edges.indexOf(o);if(o.source.edges.splice(f,1),f=o.target.edges.indexOf(o),o.target.edges.splice(f,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var f=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(f,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],h=this.getGraphs(),a=h.length,o=0;o<a;o++)r=r.concat(h[o].getNodes());this.allNodes=r}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){for(var r=[],h=this.getGraphs(),a=h.length,o=0;o<h.length;o++)r=r.concat(h[o].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(r,h){if(!(r!=null&&h!=null))throw"assert failed";if(r==h)return!0;var a=r.getOwner(),o;do{if(o=a.getParent(),o==null)break;if(o==h)return!0;if(a=o.getOwner(),a==null)break}while(!0);a=h.getOwner();do{if(o=a.getParent(),o==null)break;if(o==r)return!0;if(a=o.getOwner(),a==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,h,a,o,p,n=this.getAllEdges(),g=n.length,l=0;l<g;l++){if(r=n[l],h=r.source,a=r.target,r.lca=null,r.sourceInLca=h,r.targetInLca=a,h==a){r.lca=h.getOwner();continue}for(o=h.getOwner();r.lca==null;){for(r.targetInLca=a,p=a.getOwner();r.lca==null;){if(p==o){r.lca=p;break}if(p==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=p.getParent(),p=r.targetInLca.getOwner()}if(o==this.rootGraph)break;r.lca==null&&(r.sourceInLca=o.getParent(),o=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,h){if(r==h)return r.getOwner();var a=r.getOwner();do{if(a==null)break;var o=h.getOwner();do{if(o==null)break;if(o==a)return o;o=o.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},t.prototype.calcInclusionTreeDepths=function(r,h){r==null&&h==null&&(r=this.rootGraph,h=1);for(var a,o=r.getNodes(),p=o.length,n=0;n<p;n++)a=o[n],a.inclusionTreeDepth=h,a.child!=null&&this.calcInclusionTreeDepths(a.child,h+1)},t.prototype.includesInvalidEdge=function(){for(var r,h=this.edges.length,a=0;a<h;a++)if(r=this.edges[a],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},m.exports=t},function(m,L,N){var i=N(0);function e(){}O(e,"FDLayoutConstants");for(var t in i)e[t]=i[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=e},function(m,L,N){var i=N(12);function e(){}O(e,"IGeometry"),e.calcSeparationAmount=function(t,r,h,a){if(!t.intersects(r))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,o),h[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),h[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?h[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(h[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?h[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(h[1]+=Math.min(t.getY()-r.getY(),r.getBottom()-t.getBottom()));var p=Math.abs((r.getCenterY()-t.getCenterY())/(r.getCenterX()-t.getCenterX()));r.getCenterY()===t.getCenterY()&&r.getCenterX()===t.getCenterX()&&(p=1);var n=p*h[0],g=h[1]/p;h[0]<g?g=h[0]:n=h[1],h[0]=-1*o[0]*(g/2+a),h[1]=-1*o[1]*(n/2+a)},e.decideDirectionsForOverlappingNodes=function(t,r,h){t.getCenterX()<r.getCenterX()?h[0]=-1:h[0]=1,t.getCenterY()<r.getCenterY()?h[1]=-1:h[1]=1},e.getIntersection2=function(t,r,h){var a=t.getCenterX(),o=t.getCenterY(),p=r.getCenterX(),n=r.getCenterY();if(t.intersects(r))return h[0]=a,h[1]=o,h[2]=p,h[3]=n,!0;var g=t.getX(),l=t.getY(),f=t.getRight(),E=t.getX(),y=t.getBottom(),d=t.getRight(),A=t.getWidthHalf(),v=t.getHeightHalf(),I=r.getX(),s=r.getY(),u=r.getRight(),c=r.getX(),_=r.getBottom(),T=r.getRight(),w=r.getWidthHalf(),D=r.getHeightHalf(),M=!1,R=!1;if(a===p){if(o>n)return h[0]=a,h[1]=l,h[2]=p,h[3]=_,!1;if(o<n)return h[0]=a,h[1]=y,h[2]=p,h[3]=s,!1}else if(o===n){if(a>p)return h[0]=g,h[1]=o,h[2]=u,h[3]=n,!1;if(a<p)return h[0]=f,h[1]=o,h[2]=I,h[3]=n,!1}else{var F=t.height/t.width,S=r.height/r.width,x=(n-o)/(p-a),G=void 0,b=void 0,P=void 0,U=void 0,Y=void 0,B=void 0;if(-F===x?a>p?(h[0]=E,h[1]=y,M=!0):(h[0]=f,h[1]=l,M=!0):F===x&&(a>p?(h[0]=g,h[1]=l,M=!0):(h[0]=d,h[1]=y,M=!0)),-S===x?p>a?(h[2]=c,h[3]=_,R=!0):(h[2]=u,h[3]=s,R=!0):S===x&&(p>a?(h[2]=I,h[3]=s,R=!0):(h[2]=T,h[3]=_,R=!0)),M&&R)return!1;if(a>p?o>n?(G=this.getCardinalDirection(F,x,4),b=this.getCardinalDirection(S,x,2)):(G=this.getCardinalDirection(-F,x,3),b=this.getCardinalDirection(-S,x,1)):o>n?(G=this.getCardinalDirection(-F,x,1),b=this.getCardinalDirection(-S,x,3)):(G=this.getCardinalDirection(F,x,2),b=this.getCardinalDirection(S,x,4)),!M)switch(G){case 1:U=l,P=a+-v/x,h[0]=P,h[1]=U;break;case 2:P=d,U=o+A*x,h[0]=P,h[1]=U;break;case 3:U=y,P=a+v/x,h[0]=P,h[1]=U;break;case 4:P=E,U=o+-A*x,h[0]=P,h[1]=U;break}if(!R)switch(b){case 1:B=s,Y=p+-D/x,h[2]=Y,h[3]=B;break;case 2:Y=T,B=n+w*x,h[2]=Y,h[3]=B;break;case 3:B=_,Y=p+D/x,h[2]=Y,h[3]=B;break;case 4:Y=c,B=n+-w*x,h[2]=Y,h[3]=B;break}}return!1},e.getCardinalDirection=function(t,r,h){return t>r?h:1+h%4},e.getIntersection=function(t,r,h,a){if(a==null)return this.getIntersection2(t,r,h);var o=t.x,p=t.y,n=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=void 0,A=void 0,v=void 0,I=void 0,s=void 0,u=void 0,c=void 0,_=void 0,T=void 0;return v=g-p,s=o-n,c=n*p-o*g,I=y-f,u=l-E,_=E*f-l*y,T=v*u-I*s,T===0?null:(d=(s*_-u*c)/T,A=(I*c-v*_)/T,new i(d,A))},e.angleOfVector=function(t,r,h,a){var o=void 0;return t!==h?(o=Math.atan((a-r)/(h-t)),h<t?o+=Math.PI:a<r&&(o+=this.TWO_PI)):a<r?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},e.doIntersect=function(t,r,h,a){var o=t.x,p=t.y,n=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=(n-o)*(y-f)-(E-l)*(g-p);if(d===0)return!1;var A=((y-f)*(E-o)+(l-E)*(y-p))/d,v=((p-g)*(E-o)+(n-o)*(y-p))/d;return 0<A&&A<1&&0<v&&v<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,m.exports=e},function(m,L,N){function i(){}O(i,"IMath"),i.sign=function(e){return e>0?1:e<0?-1:0},i.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},i.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},m.exports=i},function(m,L,N){function i(){}O(i,"Integer"),i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,m.exports=i},function(m,L,N){var i=function(){function o(p,n){for(var g=0;g<n.length;g++){var l=n[g];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}return O(o,"defineProperties"),function(p,n,g){return n&&o(p.prototype,n),g&&o(p,g),p}}();function e(o,p){if(!(o instanceof p))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=O(function(o){return{value:o,next:null,prev:null}},"nodeFrom"),r=O(function(o,p,n,g){return o!==null?o.next=p:g.head=p,n!==null?n.prev=p:g.tail=p,p.prev=o,p.next=n,g.length++,p},"add"),h=O(function(o,p){var n=o.prev,g=o.next;return n!==null?n.next=g:p.head=g,g!==null?g.prev=n:p.tail=n,o.prev=o.next=null,p.length--,o},"_remove"),a=function(){function o(p){var n=this;e(this,o),this.length=0,this.head=null,this.tail=null,p==null||p.forEach(function(g){return n.push(g)})}return O(o,"LinkedList"),i(o,[{key:"size",value:O(function(){return this.length},"size")},{key:"insertBefore",value:O(function(p,n){return r(n.prev,t(p),n,this)},"insertBefore")},{key:"insertAfter",value:O(function(p,n){return r(n,t(p),n.next,this)},"insertAfter")},{key:"insertNodeBefore",value:O(function(p,n){return r(n.prev,p,n,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:O(function(p,n){return r(n,p,n.next,this)},"insertNodeAfter")},{key:"push",value:O(function(p){return r(this.tail,t(p),null,this)},"push")},{key:"unshift",value:O(function(p){return r(null,t(p),this.head,this)},"unshift")},{key:"remove",value:O(function(p){return h(p,this)},"remove")},{key:"pop",value:O(function(){return h(this.tail,this).value},"pop")},{key:"popNode",value:O(function(){return h(this.tail,this)},"popNode")},{key:"shift",value:O(function(){return h(this.head,this).value},"shift")},{key:"shiftNode",value:O(function(){return h(this.head,this)},"shiftNode")},{key:"get_object_at",value:O(function(p){if(p<=this.length()){for(var n=1,g=this.head;n<p;)g=g.next,n++;return g.value}},"get_object_at")},{key:"set_object_at",value:O(function(p,n){if(p<=this.length()){for(var g=1,l=this.head;g<p;)l=l.next,g++;l.value=n}},"set_object_at")}]),o}();m.exports=a},function(m,L,N){function i(e,t,r){this.x=null,this.y=null,e==null&&t==null&&r==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&r==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&r==null&&(r=e,this.x=r.x,this.y=r.y)}O(i,"Point"),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(e,t,r){e.constructor.name=="Point"&&t==null&&r==null?(r=e,this.setLocation(r.x,r.y)):typeof e=="number"&&typeof t=="number"&&r==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},i.prototype.move=function(e,t){this.x=e,this.y=t},i.prototype.translate=function(e,t){this.x+=e,this.y+=t},i.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=i},function(m,L,N){function i(e,t,r,h){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&h!=null&&(this.x=e,this.y=t,this.width=r,this.height=h)}O(i,"RectangleD"),i.prototype.getX=function(){return this.x},i.prototype.setX=function(e){this.x=e},i.prototype.getY=function(){return this.y},i.prototype.setY=function(e){this.y=e},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},m.exports=i},function(m,L,N){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}O(e,"UniqueIDGeneretor"),e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var r=typeof t>"u"?"undefined":i(t);return t==null||r!="object"&&r!="function"},m.exports=e},function(m,L,N){function i(l){if(Array.isArray(l)){for(var f=0,E=Array(l.length);f<l.length;f++)E[f]=l[f];return E}else return Array.from(l)}O(i,"_toConsumableArray");var e=N(0),t=N(6),r=N(3),h=N(1),a=N(5),o=N(4),p=N(17),n=N(27);function g(l){n.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}O(g,"Layout"),g.RANDOM_SEED=1,g.prototype=Object.create(n.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var l=new t(this);return this.graphManager=l,l},g.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},g.prototype.newNode=function(l){return new r(this.graphManager,l)},g.prototype.newEdge=function(l){return new h(null,null,l)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),e.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l,f=this.graphManager.getAllEdges(),E=0;E<f.length;E++)l=f[E];for(var y,d=this.graphManager.getRoot().getNodes(),E=0;E<d.length;E++)y=d[E];this.update(this.graphManager.getRoot())}},g.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof r){var f=l;if(f.getChild()!=null)for(var E=f.getChild().getNodes(),y=0;y<E.length;y++)update(E[y]);if(f.vGraphObject!=null){var d=f.vGraphObject;d.update(f)}}else if(l instanceof h){var A=l;if(A.vGraphObject!=null){var v=A.vGraphObject;v.update(A)}}else if(l instanceof a){var I=l;if(I.vGraphObject!=null){var s=I.vGraphObject;s.update(I)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var f=new p,E=this.graphManager.getRoot().updateLeftTop();if(E!=null){f.setWorldOrgX(l.x),f.setWorldOrgY(l.y),f.setDeviceOrgX(E.x),f.setDeviceOrgY(E.y);for(var y=this.getAllNodes(),d,A=0;A<y.length;A++)d=y[A],d.transform(f)}}},g.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,E,y=l.getNodes(),d=0;d<y.length;d++)f=y[d],E=f.getChild(),E==null||E.getNodes().length==0?f.scatter():(this.positionNodesRandomly(E),f.updateBounds())},g.prototype.getFlatForest=function(){for(var l=[],f=!0,E=this.graphManager.getRoot().getNodes(),y=!0,d=0;d<E.length;d++)E[d].getChild()!=null&&(y=!1);if(!y)return l;var A=new Set,v=[],I=new Map,s=[];for(s=s.concat(E);s.length>0&&f;){for(v.push(s[0]);v.length>0&&f;){var u=v[0];v.splice(0,1),A.add(u);for(var c=u.getEdges(),d=0;d<c.length;d++){var _=c[d].getOtherEnd(u);if(I.get(u)!=_)if(!A.has(_))v.push(_),I.set(_,u);else{f=!1;break}}}if(!f)l=[];else{var T=[].concat(i(A));l.push(T);for(var d=0;d<T.length;d++){var w=T[d],D=s.indexOf(w);D>-1&&s.splice(D,1)}A=new Set,I=new Map}}return l},g.prototype.createDummyNodesForBendpoints=function(l){for(var f=[],E=l.source,y=this.graphManager.calcLowestCommonAncestor(l.source,l.target),d=0;d<l.bendpoints.length;d++){var A=this.newNode(null);A.setRect(new Point(0,0),new Dimension(1,1)),y.add(A);var v=this.newEdge(null);this.graphManager.add(v,E,A),f.add(A),E=A}var v=this.newEdge(null);return this.graphManager.add(v,E,l.target),this.edgeToDummyNodes.set(l,f),l.isInterGraph()?this.graphManager.remove(l):y.remove(l),f},g.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(i(this.edgeToDummyNodes.keys())).concat(l);for(var f=0;f<l.length;f++){var E=l[f];if(E.bendpoints.length>0){for(var y=this.edgeToDummyNodes.get(E),d=0;d<y.length;d++){var A=y[d],v=new o(A.getCenterX(),A.getCenterY()),I=E.bendpoints.get(d);I.x=v.x,I.y=v.y,A.getOwner().remove(A)}this.graphManager.add(E,E.source,E.target)}}},g.transform=function(l,f,E,y){if(E!=null&&y!=null){var d=f;if(l<=50){var A=f/E;d-=(f-A)/50*(50-l)}else{var v=f*y;d+=(v-f)/50*(l-50)}return d}else{var I,s;return l<=50?(I=9*f/500,s=f/10):(I=9*f/50,s=-8*f),I*l+s}},g.findCenterOfTree=function(l){var f=[];f=f.concat(l);var E=[],y=new Map,d=!1,A=null;(f.length==1||f.length==2)&&(d=!0,A=f[0]);for(var v=0;v<f.length;v++){var I=f[v],s=I.getNeighborsList().size;y.set(I,I.getNeighborsList().size),s==1&&E.push(I)}var u=[];for(u=u.concat(E);!d;){var c=[];c=c.concat(u),u=[];for(var v=0;v<f.length;v++){var I=f[v],_=f.indexOf(I);_>=0&&f.splice(_,1);var T=I.getNeighborsList();T.forEach(function(M){if(E.indexOf(M)<0){var R=y.get(M),F=R-1;F==1&&u.push(M),y.set(M,F)}})}E=E.concat(u),(f.length==1||f.length==2)&&(d=!0,A=f[0])}return A},g.prototype.setGraphManager=function(l){this.graphManager=l},m.exports=g},function(m,L,N){function i(){}O(i,"RandomSeed"),i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},m.exports=i},function(m,L,N){var i=N(4);function e(t,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}O(e,"Transform"),e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var r=0,h=this.lworldExtX;return h!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/h),r},e.prototype.transformY=function(t){var r=0,h=this.lworldExtY;return h!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/h),r},e.prototype.inverseTransformX=function(t){var r=0,h=this.ldeviceExtX;return h!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/h),r},e.prototype.inverseTransformY=function(t){var r=0,h=this.ldeviceExtY;return h!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/h),r},e.prototype.inverseTransformPoint=function(t){var r=new i(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return r},m.exports=e},function(m,L,N){function i(n){if(Array.isArray(n)){for(var g=0,l=Array(n.length);g<n.length;g++)l[g]=n[g];return l}else return Array.from(n)}O(i,"_toConsumableArray");var e=N(15),t=N(7),r=N(0),h=N(8),a=N(9);function o(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}O(o,"FDLayout"),o.prototype=Object.create(e.prototype);for(var p in e)o[p]=e[p];o.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){for(var n,g,l,f,E,y,d=this.getGraphManager().getAllEdges(),A=0;A<d.length;A++)n=d[A],n.idealLength=this.idealEdgeLength,n.isInterGraph&&(l=n.getSource(),f=n.getTarget(),E=n.getSourceInLca().getEstimatedSize(),y=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(n.idealLength+=E+y-2*r.SIMPLE_NODE_SIZE),g=n.getLca().getInclusionTreeDepth(),n.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*g))},o.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;this.incremental?(n>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(n>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(n-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),g,l=0;l<n.length;l++)g=n[l],this.calcSpringForce(g,g.idealLength)},o.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,f,E,y,d=this.getAllNodes(),A;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),A=new Set,l=0;l<d.length;l++)E=d[l],this.calculateRepulsionForceOfANode(E,A,n,g),A.add(E);else for(l=0;l<d.length;l++)for(E=d[l],f=l+1;f<d.length;f++)y=d[f],E.getOwner()==y.getOwner()&&this.calcRepulsionForce(E,y)},o.prototype.calcGravitationalForces=function(){for(var n,g=this.getAllNodesToApplyGravitation(),l=0;l<g.length;l++)n=g[l],this.calcGravitationalForce(n)},o.prototype.moveNodes=function(){for(var n=this.getAllNodes(),g,l=0;l<n.length;l++)g=n[l],g.move()},o.prototype.calcSpringForce=function(n,g){var l=n.getSource(),f=n.getTarget(),E,y,d,A;if(this.uniformLeafNodeSizes&&l.getChild()==null&&f.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;E=n.getLength(),E!=0&&(y=this.springConstant*(E-g),d=y*(n.lengthX/E),A=y*(n.lengthY/E),l.springForceX+=d,l.springForceY+=A,f.springForceX-=d,f.springForceY-=A)},o.prototype.calcRepulsionForce=function(n,g){var l=n.getRect(),f=g.getRect(),E=new Array(2),y=new Array(4),d,A,v,I,s,u,c;if(l.intersects(f)){h.calcSeparationAmount(l,f,E,t.DEFAULT_EDGE_LENGTH/2),u=2*E[0],c=2*E[1];var _=n.noOfChildren*g.noOfChildren/(n.noOfChildren+g.noOfChildren);n.repulsionForceX-=_*u,n.repulsionForceY-=_*c,g.repulsionForceX+=_*u,g.repulsionForceY+=_*c}else this.uniformLeafNodeSizes&&n.getChild()==null&&g.getChild()==null?(d=f.getCenterX()-l.getCenterX(),A=f.getCenterY()-l.getCenterY()):(h.getIntersection(l,f,y),d=y[2]-y[0],A=y[3]-y[1]),Math.abs(d)<t.MIN_REPULSION_DIST&&(d=a.sign(d)*t.MIN_REPULSION_DIST),Math.abs(A)<t.MIN_REPULSION_DIST&&(A=a.sign(A)*t.MIN_REPULSION_DIST),v=d*d+A*A,I=Math.sqrt(v),s=this.repulsionConstant*n.noOfChildren*g.noOfChildren/v,u=s*d/I,c=s*A/I,n.repulsionForceX-=u,n.repulsionForceY-=c,g.repulsionForceX+=u,g.repulsionForceY+=c},o.prototype.calcGravitationalForce=function(n){var g,l,f,E,y,d,A,v;g=n.getOwner(),l=(g.getRight()+g.getLeft())/2,f=(g.getTop()+g.getBottom())/2,E=n.getCenterX()-l,y=n.getCenterY()-f,d=Math.abs(E)+n.getWidth()/2,A=Math.abs(y)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()?(v=g.getEstimatedSize()*this.gravityRangeFactor,(d>v||A>v)&&(n.gravitationForceX=-this.gravityConstant*E,n.gravitationForceY=-this.gravityConstant*y)):(v=g.getEstimatedSize()*this.compoundGravityRangeFactor,(d>v||A>v)&&(n.gravitationForceX=-this.gravityConstant*E*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},o.prototype.isConverged=function(){var n,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||g},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var n,g=this.graphManager.getAllNodes(),l=0;l<g.length;l++)n=g[l],n.noOfChildren=n.getNoOfChildren()},o.prototype.calcGrid=function(n){var g=0,l=0;g=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));for(var f=new Array(g),E=0;E<g;E++)f[E]=new Array(l);for(var E=0;E<g;E++)for(var y=0;y<l;y++)f[E][y]=new Array;return f},o.prototype.addNodeToGrid=function(n,g,l){var f=0,E=0,y=0,d=0;f=parseInt(Math.floor((n.getRect().x-g)/this.repulsionRange)),E=parseInt(Math.floor((n.getRect().width+n.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((n.getRect().y-l)/this.repulsionRange)),d=parseInt(Math.floor((n.getRect().height+n.getRect().y-l)/this.repulsionRange));for(var A=f;A<=E;A++)for(var v=y;v<=d;v++)this.grid[A][v].push(n),n.setGridCoordinates(f,E,y,d)},o.prototype.updateGrid=function(){var n,g,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),n=0;n<l.length;n++)g=l[n],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(n,g,l,f){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&l||f){var E=new Set;n.surrounding=new Array;for(var y,d=this.grid,A=n.startX-1;A<n.finishX+2;A++)for(var v=n.startY-1;v<n.finishY+2;v++)if(!(A<0||v<0||A>=d.length||v>=d[0].length)){for(var I=0;I<d[A][v].length;I++)if(y=d[A][v][I],!(n.getOwner()!=y.getOwner()||n==y)&&!g.has(y)&&!E.has(y)){var s=Math.abs(n.getCenterX()-y.getCenterX())-(n.getWidth()/2+y.getWidth()/2),u=Math.abs(n.getCenterY()-y.getCenterY())-(n.getHeight()/2+y.getHeight()/2);s<=this.repulsionRange&&u<=this.repulsionRange&&E.add(y)}}n.surrounding=[].concat(i(E))}for(A=0;A<n.surrounding.length;A++)this.calcRepulsionForce(n,n.surrounding[A])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o},function(m,L,N){var i=N(1),e=N(7);function t(h,a,o){i.call(this,h,a,o),this.idealLength=e.DEFAULT_EDGE_LENGTH}O(t,"FDLayoutEdge"),t.prototype=Object.create(i.prototype);for(var r in i)t[r]=i[r];m.exports=t},function(m,L,N){var i=N(3);function e(r,h,a,o){i.call(this,r,h,a,o),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=[]}O(e,"FDLayoutNode"),e.prototype=Object.create(i.prototype);for(var t in i)e[t]=i[t];e.prototype.setGridCoordinates=function(r,h,a,o){this.startX=r,this.finishX=h,this.startY=a,this.finishY=o},m.exports=e},function(m,L,N){function i(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}O(i,"DimensionD"),i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},m.exports=i},function(m,L,N){var i=N(14);function e(){this.map={},this.keys=[]}O(e,"HashMap"),e.prototype.put=function(t,r){var h=i.createID(t);this.contains(h)||(this.map[h]=r,this.keys.push(t))},e.prototype.contains=function(t){return i.createID(t),this.map[t]!=null},e.prototype.get=function(t){var r=i.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},m.exports=e},function(m,L,N){var i=N(14);function e(){this.set={}}O(e,"HashSet"),e.prototype.add=function(t){var r=i.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[i.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[i.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var r=Object.keys(this.set),h=r.length,a=0;a<h;a++)t.push(this.set[r[a]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,h=0;h<r;h++){var a=t[h];this.add(a)}},m.exports=e},function(m,L,N){var i=function(){function h(a,o){for(var p=0;p<o.length;p++){var n=o[p];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}return O(h,"defineProperties"),function(a,o,p){return o&&h(a.prototype,o),p&&h(a,p),a}}();function e(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=N(11),r=function(){function h(a,o){e(this,h),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;a instanceof t?p=a.size():p=a.length,this._quicksort(a,0,p-1)}return O(h,"Quicksort"),i(h,[{key:"_quicksort",value:O(function(a,o,p){if(o<p){var n=this._partition(a,o,p);this._quicksort(a,o,n),this._quicksort(a,n+1,p)}},"_quicksort")},{key:"_partition",value:O(function(a,o,p){for(var n=this._get(a,o),g=o,l=p;;){for(;this.compareFunction(n,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,g),n);)g++;if(g<l)this._swap(a,g,l),g++,l--;else return l}},"_partition")},{key:"_get",value:O(function(a,o){return a instanceof t?a.get_object_at(o):a[o]},"_get")},{key:"_set",value:O(function(a,o,p){a instanceof t?a.set_object_at(o,p):a[o]=p},"_set")},{key:"_swap",value:O(function(a,o,p){var n=this._get(a,o);this._set(a,o,this._get(a,p)),this._set(a,p,n)},"_swap")},{key:"_defaultCompareFunction",value:O(function(a,o){return o>a},"_defaultCompareFunction")}]),h}();m.exports=r},function(m,L,N){var i=function(){function r(h,a){for(var o=0;o<a.length;o++){var p=a[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return O(r,"defineProperties"),function(h,a,o){return a&&r(h.prototype,a),o&&r(h,o),h}}();function e(r,h){if(!(r instanceof h))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=function(){function r(h,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,r),this.sequence1=h,this.sequence2=a,this.match_score=o,this.mismatch_penalty=p,this.gap_penalty=n,this.iMax=h.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[g][l]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var E=0;E<this.jMax;E++)this.tracebackGrid[f][E]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return O(r,"NeedlemanWunsch"),i(r,[{key:"getScore",value:O(function(){return this.score},"getScore")},{key:"getAlignments",value:O(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:O(function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var o=1;o<this.iMax;o++)for(var p=1;p<this.jMax;p++){var n=void 0;this.sequence1[o-1]===this.sequence2[p-1]?n=this.grid[o-1][p-1]+this.match_score:n=this.grid[o-1][p-1]+this.mismatch_penalty;var g=this.grid[o-1][p]+this.gap_penalty,l=this.grid[o][p-1]+this.gap_penalty,f=[n,g,l],E=this.arrayAllMaxIndexes(f);this.grid[o][p]=f[E[0]],this.tracebackGrid[o][p]=[E.includes(0),E.includes(1),E.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:O(function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var a=h[0],o=this.tracebackGrid[a.pos[0]][a.pos[1]];o[0]&&h.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),o[1]&&h.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),o[2]&&h.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),h.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:O(function(h,a){for(var o=[],p=-1;(p=h.indexOf(a,p+1))!==-1;)o.push(p);return o},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:O(function(h){return this.getAllIndexes(h,Math.max.apply(null,h))},"arrayAllMaxIndexes")}]),r}();m.exports=t},function(m,L,N){var i=O(function(){},"layoutBase");i.FDLayout=N(18),i.FDLayoutConstants=N(7),i.FDLayoutEdge=N(19),i.FDLayoutNode=N(20),i.DimensionD=N(21),i.HashMap=N(22),i.HashSet=N(23),i.IGeometry=N(8),i.IMath=N(9),i.Integer=N(10),i.Point=N(12),i.PointD=N(4),i.RandomSeed=N(16),i.RectangleD=N(13),i.Transform=N(17),i.UniqueIDGeneretor=N(14),i.Quicksort=N(24),i.LinkedList=N(11),i.LGraphObject=N(2),i.LGraph=N(5),i.LEdge=N(1),i.LGraphManager=N(6),i.LNode=N(3),i.Layout=N(15),i.LayoutConstants=N(0),i.NeedlemanWunsch=N(25),m.exports=i},function(m,L,N){function i(){this.listeners=[]}O(i,"Emitter");var e=i.prototype;e.addListener=function(t,r){this.listeners.push({event:t,callback:r})},e.removeListener=function(t,r){for(var h=this.listeners.length;h>=0;h--){var a=this.listeners[h];a.event===t&&a.callback===r&&this.listeners.splice(h,1)}},e.emit=function(t,r){for(var h=0;h<this.listeners.length;h++){var a=this.listeners[h];t===a.event&&a.callback(r)}},m.exports=i}])})}),Q=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L(Z()):typeof define=="function"&&define.amd?define(["layout-base"],L):typeof C=="object"?C.coseBase=L(Z()):m.coseBase=L(m.layoutBase)},"webpackUniversalModuleDefinition")(C,function(m){return function(L){var N={};function i(e){if(N[e])return N[e].exports;var t=N[e]={i:e,l:!1,exports:{}};return L[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return O(i,"__webpack_require__"),i.m=L,i.c=N,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?O(function(){return e.default},"getDefault"):O(function(){return e},"getModuleExports");return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=7)}([function(L,N){L.exports=m},function(L,N,i){var e=i(0).FDLayoutConstants;function t(){}O(t,"CoSEConstants");for(var r in e)t[r]=e[r];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,L.exports=t},function(L,N,i){var e=i(0).FDLayoutEdge;function t(h,a,o){e.call(this,h,a,o)}O(t,"CoSEEdge"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).LGraph;function t(h,a,o){e.call(this,h,a,o)}O(t,"CoSEGraph"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).LGraphManager;function t(h){e.call(this,h)}O(t,"CoSEGraphManager"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).FDLayoutNode,t=i(0).IMath;function r(a,o,p,n){e.call(this,a,o,p,n)}O(r,"CoSENode"),r.prototype=Object.create(e.prototype);for(var h in e)r[h]=e[h];r.prototype.move=function(){var a=this.graphManager.getLayout();this.displacementX=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),a.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},r.prototype.propogateDisplacementToChildren=function(a,o){for(var p=this.getChild().getNodes(),n,g=0;g<p.length;g++)n=p[g],n.getChild()==null?(n.moveBy(a,o),n.displacementX+=a,n.displacementY+=o):n.propogateDisplacementToChildren(a,o)},r.prototype.setPred1=function(a){this.pred1=a},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(a){this.next=a},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(a){this.processed=a},r.prototype.isProcessed=function(){return processed},L.exports=r},function(L,N,i){var e=i(0).FDLayout,t=i(4),r=i(3),h=i(5),a=i(2),o=i(1),p=i(0).FDLayoutConstants,n=i(0).LayoutConstants,g=i(0).Point,l=i(0).PointD,f=i(0).Layout,E=i(0).Integer,y=i(0).IGeometry,d=i(0).LGraph,A=i(0).Transform;function v(){e.call(this),this.toBeTiled={}}O(v,"CoSELayout"),v.prototype=Object.create(e.prototype);for(var I in e)v[I]=e[I];v.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},v.prototype.newGraph=function(s){return new r(null,this.graphManager,s)},v.prototype.newNode=function(s){return new h(this.graphManager,s)},v.prototype.newEdge=function(s){return new a(null,null,s)},v.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=p.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=p.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=p.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=p.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/p.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=p.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},v.prototype.layout=function(){var s=n.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(_){return s.has(_)});this.graphManager.setAllNodesToApplyGravitation(u)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(w){return s.has(w)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.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%p.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(T){return s.has(T)});this.graphManager.setAllNodesToApplyGravitation(u),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,_=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,_),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),u={},c=0;c<s.length;c++){var _=s[c].rect,T=s[c].id;u[T]={id:T,x:_.getCenterX(),y:_.getCenterY(),w:_.width,h:_.height}}return u},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},v.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],u,c=this.graphManager.getGraphs(),_=c.length,T;for(T=0;T<_;T++)u=c[T],u.updateConnected(),u.isConnected||(s=s.concat(u.getNodes()));return s},v.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var u=new Set,c;for(c=0;c<s.length;c++){var _=s[c];if(!u.has(_)){var T=_.getSource(),w=_.getTarget();if(T==w)_.getBendpoints().push(new l),_.getBendpoints().push(new l),this.createDummyNodesForBendpoints(_),u.add(_);else{var D=[];if(D=D.concat(T.getEdgeListToNode(w)),D=D.concat(w.getEdgeListToNode(T)),!u.has(D[0])){if(D.length>1){var M;for(M=0;M<D.length;M++){var R=D[M];R.getBendpoints().push(new l),this.createDummyNodesForBendpoints(R)}}D.forEach(function(F){u.add(F)})}}}if(u.size==s.length)break}},v.prototype.positionNodesRadially=function(s){for(var u=new g(0,0),c=Math.ceil(Math.sqrt(s.length)),_=0,T=0,w=0,D=new l(0,0),M=0;M<s.length;M++){M%c==0&&(w=0,T=_,M!=0&&(T+=o.DEFAULT_COMPONENT_SEPERATION),_=0);var R=s[M],F=f.findCenterOfTree(R);u.x=w,u.y=T,D=v.radialLayout(R,F,u),D.y>_&&(_=Math.floor(D.y)),w=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(n.WORLD_CENTER_X-D.x/2,n.WORLD_CENTER_Y-D.y/2))},v.radialLayout=function(s,u,c){var _=Math.max(this.maxDiagonalInTree(s),o.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(u,null,0,359,0,_);var T=d.calculateBounds(s),w=new A;w.setDeviceOrgX(T.getMinX()),w.setDeviceOrgY(T.getMinY()),w.setWorldOrgX(c.x),w.setWorldOrgY(c.y);for(var D=0;D<s.length;D++){var M=s[D];M.transform(w)}var R=new l(T.getMaxX(),T.getMaxY());return w.inverseTransformPoint(R)},v.branchRadialLayout=function(s,u,c,_,T,w){var D=(_-c+1)/2;D<0&&(D+=180);var M=(D+c)%360,R=M*y.TWO_PI/360,F=T*Math.cos(R),S=T*Math.sin(R);s.setCenter(F,S);var x=[];x=x.concat(s.getEdges());var G=x.length;u!=null&&G--;for(var b=0,P=x.length,U,Y=s.getEdgesBetween(u);Y.length>1;){var B=Y[0];Y.splice(0,1);var k=x.indexOf(B);k>=0&&x.splice(k,1),P--,G--}u!=null?U=(x.indexOf(Y[0])+1)%P:U=0;for(var H=Math.abs(_-c)/G,W=U;b!=G;W=++W%P){var q=x[W].getOtherEnd(s);if(q!=u){var z=(c+b*H)%360,ot=(z+H)%360;v.branchRadialLayout(q,s,z,ot,T+w,w),b++}}},v.maxDiagonalInTree=function(s){for(var u=E.MIN_VALUE,c=0;c<s.length;c++){var _=s[c],T=_.getDiagonal();T>u&&(u=T)}return u},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var s=this,u={};this.memberGroups={},this.idToDummyNode={};for(var c=[],_=this.graphManager.getAllNodes(),T=0;T<_.length;T++){var w=_[T],D=w.getParent();this.getNodeDegreeWithChildren(w)===0&&(D.id==null||!this.getToBeTiled(D))&&c.push(w)}for(var T=0;T<c.length;T++){var w=c[T],M=w.getParent().id;typeof u[M]>"u"&&(u[M]=[]),u[M]=u[M].concat(w)}Object.keys(u).forEach(function(R){if(u[R].length>1){var F="DummyCompound_"+R;s.memberGroups[F]=u[R];var S=u[R][0].getParent(),x=new h(s.graphManager);x.id=F,x.paddingLeft=S.paddingLeft||0,x.paddingRight=S.paddingRight||0,x.paddingBottom=S.paddingBottom||0,x.paddingTop=S.paddingTop||0,s.idToDummyNode[F]=x;var G=s.getGraphManager().add(s.newGraph(),x),b=S.getChild();b.add(x);for(var P=0;P<u[R].length;P++){var U=u[R][P];b.remove(U),G.add(U)}}})},v.prototype.clearCompounds=function(){var s={},u={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)u[this.compoundOrder[c].id]=this.compoundOrder[c],s[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,u)},v.prototype.clearZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var _=s.idToDummyNode[c];u[c]=s.tileNodes(s.memberGroups[c],_.paddingLeft+_.paddingRight),_.rect.width=u[c].width,_.rect.height=u[c].height})},v.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var u=this.compoundOrder[s],c=u.id,_=u.paddingLeft,T=u.paddingTop;this.adjustLocations(this.tiledMemberPack[c],u.rect.x,u.rect.y,_,T)}},v.prototype.repopulateZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack;Object.keys(u).forEach(function(c){var _=s.idToDummyNode[c],T=_.paddingLeft,w=_.paddingTop;s.adjustLocations(u[c],_.rect.x,_.rect.y,T,w)})},v.prototype.getToBeTiled=function(s){var u=s.id;if(this.toBeTiled[u]!=null)return this.toBeTiled[u];var c=s.getChild();if(c==null)return this.toBeTiled[u]=!1,!1;for(var _=c.getNodes(),T=0;T<_.length;T++){var w=_[T];if(this.getNodeDegree(w)>0)return this.toBeTiled[u]=!1,!1;if(w.getChild()==null){this.toBeTiled[w.id]=!1;continue}if(!this.getToBeTiled(w))return this.toBeTiled[u]=!1,!1}return this.toBeTiled[u]=!0,!0},v.prototype.getNodeDegree=function(s){for(var u=s.id,c=s.getEdges(),_=0,T=0;T<c.length;T++){var w=c[T];w.getSource().id!==w.getTarget().id&&(_=_+1)}return _},v.prototype.getNodeDegreeWithChildren=function(s){var u=this.getNodeDegree(s);if(s.getChild()==null)return u;for(var c=s.getChild().getNodes(),_=0;_<c.length;_++){var T=c[_];u+=this.getNodeDegreeWithChildren(T)}return u},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(s){for(var u=0;u<s.length;u++){var c=s[u];c.getChild()!=null&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},v.prototype.adjustLocations=function(s,u,c,_,T){u+=_,c+=T;for(var w=u,D=0;D<s.rows.length;D++){var M=s.rows[D];u=w;for(var R=0,F=0;F<M.length;F++){var S=M[F];S.rect.x=u,S.rect.y=c,u+=S.rect.width+s.horizontalPadding,S.rect.height>R&&(R=S.rect.height)}c+=R+s.verticalPadding}},v.prototype.tileCompoundMembers=function(s,u){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(_){var T=u[_];c.tiledMemberPack[_]=c.tileNodes(s[_],T.paddingLeft+T.paddingRight),T.rect.width=c.tiledMemberPack[_].width,T.rect.height=c.tiledMemberPack[_].height})},v.prototype.tileNodes=function(s,u){var c=o.TILING_PADDING_VERTICAL,_=o.TILING_PADDING_HORIZONTAL,T={rows:[],rowWidth:[],rowHeight:[],width:0,height:u,verticalPadding:c,horizontalPadding:_};s.sort(function(M,R){return M.rect.width*M.rect.height>R.rect.width*R.rect.height?-1:M.rect.width*M.rect.height<R.rect.width*R.rect.height?1:0});for(var w=0;w<s.length;w++){var D=s[w];T.rows.length==0?this.insertNodeToRow(T,D,0,u):this.canAddHorizontal(T,D.rect.width,D.rect.height)?this.insertNodeToRow(T,D,this.getShortestRowIndex(T),u):this.insertNodeToRow(T,D,T.rows.length,u),this.shiftToLastRow(T)}return T},v.prototype.insertNodeToRow=function(s,u,c,_){var T=_;if(c==s.rows.length){var w=[];s.rows.push(w),s.rowWidth.push(T),s.rowHeight.push(0)}var D=s.rowWidth[c]+u.rect.width;s.rows[c].length>0&&(D+=s.horizontalPadding),s.rowWidth[c]=D,s.width<D&&(s.width=D);var M=u.rect.height;c>0&&(M+=s.verticalPadding);var R=0;M>s.rowHeight[c]&&(R=s.rowHeight[c],s.rowHeight[c]=M,R=s.rowHeight[c]-R),s.height+=R,s.rows[c].push(u)},v.prototype.getShortestRowIndex=function(s){for(var u=-1,c=Number.MAX_VALUE,_=0;_<s.rows.length;_++)s.rowWidth[_]<c&&(u=_,c=s.rowWidth[_]);return u},v.prototype.getLongestRowIndex=function(s){for(var u=-1,c=Number.MIN_VALUE,_=0;_<s.rows.length;_++)s.rowWidth[_]>c&&(u=_,c=s.rowWidth[_]);return u},v.prototype.canAddHorizontal=function(s,u,c){var _=this.getShortestRowIndex(s);if(_<0)return!0;var T=s.rowWidth[_];if(T+s.horizontalPadding+u<=s.width)return!0;var w=0;s.rowHeight[_]<c&&_>0&&(w=c+s.verticalPadding-s.rowHeight[_]);var D;s.width-T>=u+s.horizontalPadding?D=(s.height+w)/(T+u+s.horizontalPadding):D=(s.height+w)/s.width,w=c+s.verticalPadding;var M;return s.width<u?M=(s.height+w)/u:M=(s.height+w)/s.width,M<1&&(M=1/M),D<1&&(D=1/D),D<M},v.prototype.shiftToLastRow=function(s){var u=this.getLongestRowIndex(s),c=s.rowWidth.length-1,_=s.rows[u],T=_[_.length-1],w=T.width+s.horizontalPadding;if(s.width-s.rowWidth[c]>w&&u!=c){_.splice(-1,1),s.rows[c].push(T),s.rowWidth[u]=s.rowWidth[u]-w,s.rowWidth[c]=s.rowWidth[c]+w,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var D=Number.MIN_VALUE,M=0;M<_.length;M++)_[M].height>D&&(D=_[M].height);u>0&&(D+=s.verticalPadding);var R=s.rowHeight[u]+s.rowHeight[c];s.rowHeight[u]=D,s.rowHeight[c]<T.height+s.verticalPadding&&(s.rowHeight[c]=T.height+s.verticalPadding);var F=s.rowHeight[u]+s.rowHeight[c];s.height+=F-R,this.shiftToLastRow(s)}},v.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var s=[],u=!0,c;u;){var _=this.graphManager.getAllNodes(),T=[];u=!1;for(var w=0;w<_.length;w++)c=_[w],c.getEdges().length==1&&!c.getEdges()[0].isInterGraph&&c.getChild()==null&&(T.push([c,c.getEdges()[0],c.getOwner()]),u=!0);if(u==!0){for(var D=[],M=0;M<T.length;M++)T[M][0].getEdges().length==1&&(D.push(T[M]),T[M][0].getOwner().remove(T[M][0]));s.push(D),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},v.prototype.growTree=function(s){for(var u=s.length,c=s[u-1],_,T=0;T<c.length;T++)_=c[T],this.findPlaceforPrunedNode(_),_[2].add(_[0]),_[2].add(_[1],_[1].source,_[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(s){var u,c,_=s[0];_==s[1].source?c=s[1].target:c=s[1].source;var T=c.startX,w=c.finishX,D=c.startY,M=c.finishY,R=0,F=0,S=0,x=0,G=[R,S,F,x];if(D>0)for(var b=T;b<=w;b++)G[0]+=this.grid[b][D-1].length+this.grid[b][D].length-1;if(w<this.grid.length-1)for(var b=D;b<=M;b++)G[1]+=this.grid[w+1][b].length+this.grid[w][b].length-1;if(M<this.grid[0].length-1)for(var b=T;b<=w;b++)G[2]+=this.grid[b][M+1].length+this.grid[b][M].length-1;if(T>0)for(var b=D;b<=M;b++)G[3]+=this.grid[T-1][b].length+this.grid[T][b].length-1;for(var P=E.MAX_VALUE,U,Y,B=0;B<G.length;B++)G[B]<P?(P=G[B],U=1,Y=B):G[B]==P&&U++;if(U==3&&P==0)G[0]==0&&G[1]==0&&G[2]==0?u=1:G[0]==0&&G[1]==0&&G[3]==0?u=0:G[0]==0&&G[2]==0&&G[3]==0?u=3:G[1]==0&&G[2]==0&&G[3]==0&&(u=2);else if(U==2&&P==0){var k=Math.floor(Math.random()*2);G[0]==0&&G[1]==0?k==0?u=0:u=1:G[0]==0&&G[2]==0?k==0?u=0:u=2:G[0]==0&&G[3]==0?k==0?u=0:u=3:G[1]==0&&G[2]==0?k==0?u=1:u=2:G[1]==0&&G[3]==0?k==0?u=1:u=3:k==0?u=2:u=3}else if(U==4&&P==0){var k=Math.floor(Math.random()*4);u=k}else u=Y;u==0?_.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-p.DEFAULT_EDGE_LENGTH-_.getHeight()/2):u==1?_.setCenter(c.getCenterX()+c.getWidth()/2+p.DEFAULT_EDGE_LENGTH+_.getWidth()/2,c.getCenterY()):u==2?_.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+p.DEFAULT_EDGE_LENGTH+_.getHeight()/2):_.setCenter(c.getCenterX()-c.getWidth()/2-p.DEFAULT_EDGE_LENGTH-_.getWidth()/2,c.getCenterY())},L.exports=v},function(L,N,i){var e={};e.layoutBase=i(0),e.CoSEConstants=i(1),e.CoSEEdge=i(2),e.CoSEGraph=i(3),e.CoSEGraphManager=i(4),e.CoSELayout=i(6),e.CoSENode=i(5),L.exports=e}])})}),ht=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L(Q()):typeof define=="function"&&define.amd?define(["cose-base"],L):typeof C=="object"?C.cytoscapeCoseBilkent=L(Q()):m.cytoscapeCoseBilkent=L(m.coseBase)},"webpackUniversalModuleDefinition")(C,function(m){return function(L){var N={};function i(e){if(N[e])return N[e].exports;var t=N[e]={i:e,l:!1,exports:{}};return L[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return O(i,"__webpack_require__"),i.m=L,i.c=N,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?O(function(){return e.default},"getDefault"):O(function(){return e},"getModuleExports");return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(L,N){L.exports=m},function(L,N,i){var e=i(0).layoutBase.LayoutConstants,t=i(0).layoutBase.FDLayoutConstants,r=i(0).CoSEConstants,h=i(0).CoSELayout,a=i(0).CoSENode,o=i(0).layoutBase.PointD,p=i(0).layoutBase.DimensionD,n={ready:O(function(){},"ready"),stop:O(function(){},"stop"),quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function g(y,d){var A={};for(var v in y)A[v]=y[v];for(var v in d)A[v]=d[v];return A}O(g,"extend");function l(y){this.options=g(n,y),f(this.options)}O(l,"_CoSELayout");var f=O(function(y){y.nodeRepulsion!=null&&(r.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=y.nodeRepulsion),y.idealEdgeLength!=null&&(r.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=y.idealEdgeLength),y.edgeElasticity!=null&&(r.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=y.edgeElasticity),y.nestingFactor!=null&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(r.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(r.MAX_ITERATIONS=t.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.quality=="draft"?e.QUALITY=0:y.quality=="proof"?e.QUALITY=2:e.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!y.randomize,r.ANIMATE=t.ANIMATE=e.ANIMATE=y.animate,r.TILE=y.tile,r.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal},"getUserOptions");l.prototype.run=function(){var y,d,A=this.options;this.idToLNode={};var v=this.layout=new h,I=this;I.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=v.newGraphManager();this.gm=s;var u=this.options.eles.nodes(),c=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(u),v);for(var _=0;_<c.length;_++){var T=c[_],w=this.idToLNode[T.data("source")],D=this.idToLNode[T.data("target")];if(w!==D&&w.getEdgesBetween(D).length==0){var M=s.add(v.newEdge(),w,D);M.id=T.id()}}var R=O(function(S,x){typeof S=="number"&&(S=x);var G=S.data("id"),b=I.idToLNode[G];return{x:b.getRect().getCenterX(),y:b.getRect().getCenterY()}},"getPositions"),F=O(function S(){for(var x=O(function(){A.fit&&A.cy.fit(A.eles,A.padding),y||(y=!0,I.cy.one("layoutready",A.ready),I.cy.trigger({type:"layoutready",layout:I}))},"afterReposition"),G=I.options.refresh,b,P=0;P<G&&!b;P++)b=I.stopped||I.layout.tick();if(b){v.checkLayoutSuccess()&&!v.isSubLayout&&v.doPostLayout(),v.tilingPostLayout&&v.tilingPostLayout(),v.isLayoutFinished=!0,I.options.eles.nodes().positions(R),x(),I.cy.one("layoutstop",I.options.stop),I.cy.trigger({type:"layoutstop",layout:I}),d&&cancelAnimationFrame(d),y=!1;return}var U=I.layout.getPositionsData();A.eles.nodes().positions(function(Y,B){if(typeof Y=="number"&&(Y=B),!Y.isParent()){for(var k=Y.id(),H=U[k],W=Y;H==null&&(H=U[W.data("parent")]||U["DummyCompound_"+W.data("parent")],U[k]=H,W=W.parent()[0],W!=null););return H!=null?{x:H.x,y:H.y}:{x:Y.position("x"),y:Y.position("y")}}}),x(),d=requestAnimationFrame(S)},"iterateAnimated");return v.addListener("layoutstarted",function(){I.options.animate==="during"&&(d=requestAnimationFrame(F))}),v.runLayout(),this.options.animate!=="during"&&(I.options.eles.nodes().not(":parent").layoutPositions(I,I.options,R),y=!1),this},l.prototype.getTopMostNodes=function(y){for(var d={},A=0;A<y.length;A++)d[y[A].id()]=!0;var v=y.filter(function(I,s){typeof I=="number"&&(I=s);for(var u=I.parent()[0];u!=null;){if(d[u.id()])return!1;u=u.parent()[0]}return!0});return v},l.prototype.processChildrenList=function(y,d,A){for(var v=d.length,I=0;I<v;I++){var s=d[I],u=s.children(),c,_=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?c=y.add(new a(A.graphManager,new o(s.position("x")-_.w/2,s.position("y")-_.h/2),new p(parseFloat(_.w),parseFloat(_.h)))):c=y.add(new a(this.graphManager)),c.id=s.data("id"),c.paddingLeft=parseInt(s.css("padding")),c.paddingTop=parseInt(s.css("padding")),c.paddingRight=parseInt(s.css("padding")),c.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var T=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,w=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,D=s.css("text-halign");c.labelWidth=T,c.labelHeight=w,c.labelPos=D}if(this.idToLNode[s.data("id")]=c,isNaN(c.rect.x)&&(c.rect.x=0),isNaN(c.rect.y)&&(c.rect.y=0),u!=null&&u.length>0){var M;M=A.getGraphManager().add(A.newGraph(),c),this.processChildrenList(M,u,A)}}},l.prototype.stop=function(){return this.stopped=!0,this};var E=O(function(y){y("layout","cose-bilkent",l)},"register");typeof cytoscape<"u"&&E(cytoscape),L.exports=E}])})}),lt=at(ht());$.use(lt.default);function K(C,X){C.forEach(m=>{let L={id:m.id,labelText:m.label,height:m.height,width:m.width,padding:m.padding??0};Object.keys(m).forEach(N=>{["id","label","height","width","padding","x","y"].includes(N)||(L[N]=m[N])}),X.add({group:"nodes",data:L,position:{x:m.x??0,y:m.y??0}})})}O(K,"addNodes");function J(C,X){C.forEach(m=>{let L={id:m.id,source:m.start,target:m.end};Object.keys(m).forEach(N=>{["id","start","end"].includes(N)||(L[N]=m[N])}),X.add({group:"edges",data:L})})}O(J,"addEdges");function tt(C){return new Promise(X=>{let m=st("body").append("div").attr("id","cy").attr("style","display:none"),L=$({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});m.remove(),K(C.nodes,L),J(C.edges,L),L.nodes().forEach(function(i){i.layoutDimensions=()=>{let e=i.data();return{w:e.width,h:e.height}}});let N={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};L.layout(N).run(),L.ready(i=>{j.info("Cytoscape ready",i),X(L)})})}O(tt,"createCytoscapeInstance");function et(C){return C.nodes().map(X=>{let m=X.data(),L=X.position(),N={id:m.id,x:L.x,y:L.y};return Object.keys(m).forEach(i=>{i!=="id"&&(N[i]=m[i])}),N})}O(et,"extractPositionedNodes");function rt(C){return C.edges().map(X=>{let m=X.data(),L=X._private.rscratch,N={id:m.id,source:m.source,target:m.target,startX:L.startX,startY:L.startY,midX:L.midX,midY:L.midY,endX:L.endX,endY:L.endY};return Object.keys(m).forEach(i=>{["id","source","target"].includes(i)||(N[i]=m[i])}),N})}O(rt,"extractPositionedEdges");async function it(C,X){j.debug("Starting cose-bilkent layout algorithm");try{nt(C);let m=await tt(C),L=et(m),N=rt(m);return j.debug(`Layout completed: ${L.length} nodes, ${N.length} edges`),{nodes:L,edges:N}}catch(m){throw j.error("Error in cose-bilkent layout algorithm:",m),m}}O(it,"executeCoseBilkentLayout");function nt(C){if(!C)throw new Error("Layout data is required");if(!C.config)throw new Error("Configuration is required in layout data");if(!C.rootNode)throw new Error("Root node is required");if(!C.nodes||!Array.isArray(C.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(C.edges))throw new Error("Edges array is required in layout data");return!0}O(nt,"validateLayoutData");var gt=O(async(C,X,{insertCluster:m,insertEdge:L,insertEdgeLabel:N,insertMarkers:i,insertNode:e,log:t,positionEdgeLabel:r},{algorithm:h})=>{let a={},o={},p=X.select("g");i(p,C.markers,C.type,C.diagramId);let n=p.insert("g").attr("class","subgraphs"),g=p.insert("g").attr("class","edgePaths"),l=p.insert("g").attr("class","edgeLabels"),f=p.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(C.nodes.map(async d=>{if(d.isGroup){let A={...d};o[d.id]=A,a[d.id]=A,await m(n,d)}else{let A={...d};a[d.id]=A;let v=await e(f,d,{config:C.config,dir:C.direction||"TB"}),I=v.node().getBBox();A.width=I.width,A.height=I.height,A.domId=v,t.debug(`Node ${d.id} dimensions: ${I.width}x${I.height}`)}})),t.debug("Running cose-bilkent layout algorithm");let E={...C,nodes:C.nodes.map(d=>{let A=a[d.id];return{...d,width:A.width,height:A.height}})},y=await it(E,C.config);t.debug("Positioning nodes based on layout results"),y.nodes.forEach(d=>{let A=a[d.id];A!=null&&A.domId&&(A.domId.attr("transform",`translate(${d.x}, ${d.y})`),A.x=d.x,A.y=d.y,t.debug(`Positioned node ${A.id} at center (${d.x}, ${d.y})`))}),y.edges.forEach(d=>{let A=C.edges.find(v=>v.id===d.id);A&&(A.points=[{x:d.startX,y:d.startY},{x:d.midX,y:d.midY},{x:d.endX,y:d.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(C.edges.map(async d=>{await N(l,d);let A=a[d.start??""],v=a[d.end??""];if(A&&v){let I=y.edges.find(s=>s.id===d.id);if(I){t.debug("APA01 positionedEdge",I);let s={...d},u=L(g,s,o,C.type,A,v,C.diagramId);r(s,u)}else{let s={...d,points:[{x:A.x||0,y:A.y||0},{x:v.x||0,y:v.y||0}]},u=L(g,s,o,C.type,A,v,C.diagramId);r(s,u)}}})),t.debug("Cose-bilkent rendering completed")},"render"),dt=gt;export{dt as render};
@@ -0,0 +1,4 @@
1
+ import{f as F}from"./chunk-KRXBNO2N-ChVO_XdS.js";import{H as O,u as C,k as M,t as k}from"./chunk-W44A43WB-REOI67PN.js";import{m as v,aT as $,aU as H,aV as j,aW as Z,p as a,q,aX as K,aY as U,aw as W,aZ as _,aE as Q,ax as D,av as V,a_ as z,a$ as ee}from"./index-B5WxtMpv.js";function X(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:G(e),edges:P(e)};return C(e.graph())||(t.value=M(e.graph())),t}v(X,"write");function G(e){return k(e.nodes(),function(t){var r=e.node(t),d=e.parent(t),o={v:t};return C(r)||(o.value=r),C(d)||(o.parent=d),o})}v(G,"writeNodes");function P(e){return k(e.edges(),function(t){var r=e.edge(t),d={v:t.v,w:t.w};return C(t.name)||(d.name=t.name),C(r)||(d.value=r),d})}v(P,"writeEdges");var c=new Map,E=new Map,R=new Map,re=v(()=>{E.clear(),R.clear(),c.clear()},"clear"),I=v((e,t)=>{let r=E.get(t)||[];return a.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),te=v((e,t)=>{let r=E.get(t)||[];return a.info("Descendants of ",t," is ",r),a.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||I(e.v,t)||I(e.w,t)||r.includes(e.w):(a.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),J=v((e,t,r,d)=>{a.warn("Copying children of ",e,"root",d,"data",t.node(e),d);let o=t.children(e)||[];e!==d&&o.push(e),a.warn("Copying (nodes) clusterId",e,"nodes",o),o.forEach(l=>{if(t.children(l).length>0)J(l,t,r,d);else{let i=t.node(l);a.info("cp ",l," to ",d," with parent ",e),r.setNode(l,i),d!==t.parent(l)&&(a.warn("Setting parent",l,t.parent(l)),r.setParent(l,t.parent(l))),e!==d&&l!==e?(a.debug("Setting parent",l,e),r.setParent(l,e)):(a.info("In copy ",e,"root",d,"data",t.node(e),d),a.debug("Not Setting parent for node=",l,"cluster!==rootId",e!==d,"node!==clusterId",l!==e));let s=t.edges(l);a.debug("Copying Edges",s),s.forEach(u=>{a.info("Edge",u);let b=t.edge(u.v,u.w,u.name);a.info("Edge data",b,d);try{te(u,d)?(a.info("Copying as ",u.v,u.w,b,u.name),r.setEdge(u.v,u.w,b,u.name),a.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):a.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",d," clusterId:",e)}catch(N){a.error(N)}})}a.debug("Removing node",l),t.removeNode(l)})},"copy"),T=v((e,t)=>{let r=t.children(e),d=[...r];for(let o of r)R.set(o,e),d=[...d,...T(o,t)];return d},"extractDescendants"),ne=v((e,t,r)=>{let d=e.edges().filter(s=>s.v===t||s.w===t),o=e.edges().filter(s=>s.v===r||s.w===r),l=d.map(s=>({v:s.v===t?r:s.v,w:s.w===t?t:s.w})),i=o.map(s=>({v:s.v,w:s.w}));return l.filter(s=>i.some(u=>s.v===u.v&&s.w===u.w))},"findCommonEdges"),x=v((e,t,r)=>{let d=t.children(e);if(a.trace("Searching children of id ",e,d),d.length<1)return e;let o;for(let l of d){let i=x(l,t,r),s=ne(t,r,i);if(i)if(s.length>0)o=i;else return i}return o},"findNonClusterChild"),L=v(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),ae=v((e,t)=>{if(!e||t>10){a.debug("Opting out, no graph ");return}else a.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(a.warn("Cluster identified",r," Replacement id in edges: ",x(r,e,r)),E.set(r,T(r,e)),c.set(r,{id:x(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){let d=e.children(r),o=e.edges();d.length>0?(a.debug("Cluster identified",r,E),o.forEach(l=>{let i=I(l.v,r),s=I(l.w,r);i^s&&(a.warn("Edge: ",l," leaves cluster ",r),a.warn("Descendants of XXX ",r,": ",E.get(r)),c.get(r).externalConnections=!0)})):a.debug("Not a cluster ",r,E)});for(let r of c.keys()){let d=c.get(r).id,o=e.parent(d);o!==r&&c.has(o)&&!c.get(o).externalConnections&&(c.get(r).id=o)}e.edges().forEach(function(r){let d=e.edge(r);a.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),a.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let o=r.v,l=r.w;if(a.warn("Fix XXX",c,"ids:",r.v,r.w,"Translating: ",c.get(r.v)," --- ",c.get(r.w)),c.get(r.v)||c.get(r.w)){if(a.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),o=L(r.v),l=L(r.w),e.removeEdge(r.v,r.w,r.name),o!==r.v){let i=e.parent(o);c.get(i).externalConnections=!0,d.fromCluster=r.v}if(l!==r.w){let i=e.parent(l);c.get(i).externalConnections=!0,d.toCluster=r.w}a.warn("Fix Replacing with XXX",o,l,r.name),e.setEdge(o,l,d,r.name)}}),a.warn("Adjusted Graph",X(e)),B(e,0),a.trace(c)},"adjustClustersAndEdges"),B=v((e,t)=>{var o,l;if(a.warn("extractor - ",t,X(e),e.children("D")),t>10){a.error("Bailing out");return}let r=e.nodes(),d=!1;for(let i of r){let s=e.children(i);d=d||s.length>0}if(!d){a.debug("Done, no node has children",e.nodes());return}a.debug("Nodes = ",r,t);for(let i of r)if(a.debug("Extracting node",i,c,c.has(i)&&!c.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!c.has(i))a.debug("Not a cluster",i,t);else if(!c.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){a.warn("Cluster without external connections, without a parent and with children",i,t);let s=e.graph().rankdir==="TB"?"LR":"TB";(l=(o=c.get(i))==null?void 0:o.clusterData)!=null&&l.dir&&(s=c.get(i).clusterData.dir,a.warn("Fixing dir",c.get(i).clusterData.dir,s));let u=new O({multigraph:!0,compound:!0}).setGraph({rankdir:s,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});a.warn("Old graph before copy",X(e)),J(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:c.get(i).clusterData,label:c.get(i).label,graph:u}),a.warn("New graph after copy node: (",i,")",X(u)),a.debug("Old graph after copy",X(e))}else a.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!c.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),a.debug(c);r=e.nodes(),a.warn("New list of nodes",r);for(let i of r){let s=e.node(i);a.warn(" Now next level",i,s),s!=null&&s.clusterNode&&B(s.graph,t+1)}},"extractor"),A=v((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(d=>{let o=e.children(d),l=A(e,o);r=[...r,...l]}),r},"sorter"),ie=v(e=>A(e,e.children()),"sortNodesByHierarchy"),Y=v(async(e,t,r,d,o,l)=>{a.warn("Graph in recursive render:XAX",X(t),o);let i=t.graph().rankdir;a.trace("Dir in recursive render - dir:",i);let s=e.insert("g").attr("class","root");t.nodes()?a.info("Recursive render XXX",t.nodes()):a.info("No nodes found for",t),t.edges().length>0&&a.info("Recursive edges",t.edge(t.edges()[0]));let u=s.insert("g").attr("class","clusters"),b=s.insert("g").attr("class","edgePaths"),N=s.insert("g").attr("class","edgeLabels"),p=s.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(g){let n=t.node(g);if(o!==void 0){let h=JSON.parse(JSON.stringify(o.clusterData));a.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,g,`
3
+ data=`,h.height,`
4
+ Parent cluster`,o.height),t.setNode(o.id,h),t.parent(g)||(a.trace("Setting parent",g,o.id),t.setParent(g,o.id,h))}if(a.info("(Insert) Node XXX"+g+": "+JSON.stringify(t.node(g))),n==null?void 0:n.clusterNode){a.info("Cluster identified XBX",g,n.width,t.node(g));let{ranksep:h,nodesep:f}=t.graph();n.graph.setGraph({...n.graph.graph(),ranksep:h+25,nodesep:f});let m=await Y(p,n.graph,r,d,t.node(g),l),S=m.elem;K(n,S),n.diff=m.diff||0,a.info("New compound node after recursive render XAX",g,"width",n.width,"height",n.height),U(S,n)}else t.children(g).length>0?(a.trace("Cluster - the non recursive path XBX",g,n.id,n,n.width,"Graph:",t),a.trace(x(n.id,t)),c.set(n.id,{id:x(n.id,t),node:n})):(a.trace("Node - the non recursive path XAX",g,p,t.node(g),i),await W(p,t.node(g),{config:l,dir:i}))})),await v(async()=>{let g=t.edges().map(async function(n){let h=t.edge(n.v,n.w,n.name);a.info("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),a.info("Edge "+n.v+" -> "+n.w+": ",n," ",JSON.stringify(t.edge(n))),a.info("Fix",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v),c.get(n.w)),await _(N,h)});await Promise.all(g)},"processEdges")(),a.info("Graph before layout:",JSON.stringify(X(t))),a.info("############################################# XXX"),a.info("### Layout ### XXX"),a.info("############################################# XXX"),F(t),a.info("Graph after layout:",JSON.stringify(X(t)));let w=0,{subGraphTitleTotalMargin:y}=Q(l);return await Promise.all(ie(t).map(async function(g){var h;let n=t.node(g);if(a.info("Position XBX => "+g+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n==null?void 0:n.clusterNode)n.y+=y,a.info("A tainted cluster node XBX1",g,n.id,n.width,n.height,n.x,n.y,t.parent(g)),c.get(n.id).node=n,D(n);else if(t.children(g).length>0){a.info("A pure cluster node XBX1",g,n.id,n.x,n.y,n.width,n.height,t.parent(g)),n.height+=y,t.node(n.parentId);let f=(n==null?void 0:n.padding)/2||0,m=((h=n==null?void 0:n.labelBBox)==null?void 0:h.height)||0,S=m-f||0;a.debug("OffsetY",S,"labelHeight",m,"halfPadding",f),await V(u,n),c.get(n.id).node=n}else{let f=t.node(n.parentId);n.y+=y/2,a.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",f,f==null?void 0:f.offsetY,n),D(n)}})),t.edges().forEach(function(g){let n=t.edge(g);a.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(n),n),n.points.forEach(S=>S.y+=y/2);let h=t.node(g.v);var f=t.node(g.w);let m=z(b,n,c,r,h,f,d);ee(n,m)}),t.nodes().forEach(function(g){let n=t.node(g);a.info(g,n.type,n.diff),n.isGroup&&(w=n.diff)}),a.warn("Returning from recursive render XAX",s,w),{elem:s,diff:w}},"recursiveRender"),oe=v(async(e,t)=>{var l,i,s,u,b,N;let r=new O({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((l=e.config)==null?void 0:l.nodeSpacing)||((s=(i=e.config)==null?void 0:i.flowchart)==null?void 0:s.nodeSpacing)||e.nodeSpacing,ranksep:((u=e.config)==null?void 0:u.rankSpacing)||((N=(b=e.config)==null?void 0:b.flowchart)==null?void 0:N.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),d=t.select("g");$(d,e.markers,e.type,e.diagramId),H(),j(),Z(),re(),e.nodes.forEach(p=>{r.setNode(p.id,{...p}),p.parentId&&r.setParent(p.id,p.parentId)}),a.debug("Edges:",e.edges),e.edges.forEach(p=>{if(p.start===p.end){let w=p.start,y=w+"---"+w+"---1",g=w+"---"+w+"---2",n=r.node(w);r.setNode(y,{domId:y,id:y,parentId:n.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(y,n.parentId),r.setNode(g,{domId:g,id:g,parentId:n.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,n.parentId);let h=structuredClone(p),f=structuredClone(p),m=structuredClone(p);h.label="",h.arrowTypeEnd="none",h.endLabelLeft="",h.endLabelRight="",h.startLabelLeft="",h.id=w+"-cyclic-special-1",f.startLabelRight="",f.startLabelLeft="",f.endLabelLeft="",f.endLabelRight="",f.arrowTypeStart="none",f.arrowTypeEnd="none",f.id=w+"-cyclic-special-mid",m.label="",m.startLabelRight="",m.startLabelLeft="",m.arrowTypeStart="none",n.isGroup&&(h.fromCluster=w,m.toCluster=w),m.id=w+"-cyclic-special-2",m.arrowTypeStart="none",r.setEdge(w,y,h,w+"-cyclic-special-0"),r.setEdge(y,g,f,w+"-cyclic-special-1"),r.setEdge(g,w,m,w+"-cyc<lic-special-2")}else r.setEdge(p.start,p.end,{...p},p.id)}),a.warn("Graph at first:",JSON.stringify(X(r))),ae(r),a.warn("Graph after XAX:",JSON.stringify(X(r)));let o=q();await Y(d,r,e.type,e.diagramId,void 0,o)},"render");export{oe as render};
@@ -0,0 +1,43 @@
1
+ import{c as I}from"./chunk-JQRUD6KW-DAwg-yCU.js";import{d as S}from"./wardley-L42UT6IY-5TKZOOLJ-DZr11zBG.js";import{l as E,a as F,o as z,n as P,s as R,e as B,m as o,a7 as D,u as W,L as v,E as G,I as w,p as V,ac as j,b as _}from"./index-B5WxtMpv.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},b={axes:[],curves:[],options:h},x=structuredClone(b),H=G.radar,Z=o(()=>v({...H,...w().radar}),"getConfig"),M=o(()=>x.axes,"getAxes"),q=o(()=>x.curves,"getCurves"),J=o(()=>x.options,"getOptions"),K=o(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),N=o(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Q(t.entries)}))},"setCurves"),Q=o(a=>{if(a[0].axis==null)return a.map(e=>e.value);let t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{let r=a.find(i=>{var n;return((n=i.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),U=o(a=>{var e,r,i,n,l;let t=a.reduce((s,c)=>(s[c.name]=c,s),{});x.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??h.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??h.ticks,max:((i=t.max)==null?void 0:i.value)??h.max,min:((n=t.min)==null?void 0:n.value)??h.min,graticule:((l=t.graticule)==null?void 0:l.value)??h.graticule}},"setOptions"),X=o(()=>{W(),x=structuredClone(b)},"clear"),f={getAxes:M,getCurves:q,getOptions:J,setAxes:K,setCurves:N,setOptions:U,getConfig:Z,clear:X,setAccTitle:B,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:z,getAccDescription:F,setAccDescription:E},Y=o(a=>{I(a,f);let{axes:t,curves:e,options:r}=a;f.setAxes(t),f.setCurves(e),f.setOptions(r)},"populate"),tt={parse:o(async a=>{let t=await S("radar",a);V.debug(t),Y(t)},"parse")},et=o((a,t,e,r)=>{let i=r.db,n=i.getAxes(),l=i.getCurves(),s=i.getOptions(),c=i.getConfig(),d=i.getDiagramTitle(),p=D(t),g=at(p,c),u=s.max??Math.max(...l.map(y=>Math.max(...y.entries))),m=s.min,$=Math.min(c.width,c.height)/2;rt(g,n,$,s.ticks,s.graticule),it(g,n,$,c),C(g,n,l,m,u,s.graticule,c),k(g,l,s.showLegend,c),g.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),at=o((a,t)=>{let e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return _(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`),a.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),rt=o((a,t,e,r,i)=>{if(i==="circle")for(let n=0;n<r;n++){let l=e*(n+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(i==="polygon"){let n=t.length;for(let l=0;l<r;l++){let s=e*(l+1)/r,c=t.map((d,p)=>{let g=2*p*Math.PI/n-Math.PI/2,u=s*Math.cos(g),m=s*Math.sin(g);return`${u},${m}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),it=o((a,t,e,r)=>{let i=t.length;for(let n=0;n<i;n++){let l=t[n].label,s=2*n*Math.PI/i-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*Math.cos(s)).attr("y2",e*r.axisScaleFactor*Math.sin(s)).attr("class","radarAxisLine"),a.append("text").text(l).attr("x",e*r.axisLabelFactor*Math.cos(s)).attr("y",e*r.axisLabelFactor*Math.sin(s)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,t,e,r,i,n,l){let s=t.length,c=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==s)return;let g=d.entries.map((u,m)=>{let $=2*Math.PI*m/s-Math.PI/2,y=L(u,r,i,c),A=y*Math.cos($),O=y*Math.sin($);return{x:A,y:O}});n==="circle"?a.append("path").attr("d",T(g,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",g.map(u=>`${u.x},${u.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}o(C,"drawCurves");function L(a,t,e,r){let i=Math.min(Math.max(a,t),e);return r*(i-t)/(e-t)}o(L,"relativeRadius");function T(a,t){let e=a.length,r=`M${a[0].x},${a[0].y}`;for(let i=0;i<e;i++){let n=a[(i-1+e)%e],l=a[i],s=a[(i+1)%e],c=a[(i+2)%e],d={x:l.x+(s.x-n.x)*t,y:l.y+(s.y-n.y)*t},p={x:s.x-(c.x-l.x)*t,y:s.y-(c.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${s.x},${s.y}`}return`${r} Z`}o(T,"closedRoundCurve");function k(a,t,e,r){if(!e)return;let i=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((s,c)=>{let d=a.append("g").attr("transform",`translate(${i}, ${n+c*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(s.label)})}o(k,"drawLegend");var st={draw:et},nt=o((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){let i=a[`cScale${r}`];e+=`
2
+ .radarCurve-${r} {
3
+ color: ${i};
4
+ fill: ${i};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${i};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${i};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${i};
13
+ }
14
+ `}return e},"genIndexStyles"),lt=o(a=>{let t=j(),e=w(),r=v(t,e.themeVariables),i=v(r.radar,a);return{themeVariables:r,radarOptions:i}},"buildRadarStyleOptions"),ot=o(({radar:a}={})=>{let{themeVariables:t,radarOptions:e}=lt(a);return`
15
+ .radarTitle {
16
+ font-size: ${t.fontSize};
17
+ color: ${t.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${e.axisColor};
23
+ stroke-width: ${e.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ dominant-baseline: middle;
27
+ text-anchor: middle;
28
+ font-size: ${e.axisLabelFontSize}px;
29
+ color: ${e.axisColor};
30
+ }
31
+ .radarGraticule {
32
+ fill: ${e.graticuleColor};
33
+ fill-opacity: ${e.graticuleOpacity};
34
+ stroke: ${e.graticuleColor};
35
+ stroke-width: ${e.graticuleStrokeWidth};
36
+ }
37
+ .radarLegendText {
38
+ text-anchor: start;
39
+ font-size: ${e.legendFontSize}px;
40
+ dominant-baseline: hanging;
41
+ }
42
+ ${nt(t,e)}
43
+ `},"styles"),pt={parser:tt,db:f,renderer:st,styles:ot};export{pt as diagram};
@@ -0,0 +1,24 @@
1
+ import{c as se}from"./chunk-JQRUD6KW-DAwg-yCU.js";import{d as re}from"./wardley-L42UT6IY-5TKZOOLJ-DZr11zBG.js";import{m,ac as ie,I as G,L as B,a7 as ne,b as oe,aO as F,p as j,aa as I,aP as ce,aQ as de,aR as $,i as E,e as pe,s as he,n as me,o as ye,a as fe,l as ue,E as Se,aS as ge,u as xe}from"./index-B5WxtMpv.js";import{y as be}from"./chunk-ZXARS5L4-BfFdV1tf.js";var w,Y=(w=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=pe,this.getAccTitle=he,this.setDiagramTitle=me,this.getDiagramTitle=ye,this.getAccDescription=fe,this.setAccDescription=ue}getNodes(){return this.nodes}getConfig(){let r=Se,i=G();return B({...r.treemap,...i.treemap??{}})}addNode(r,i){this.nodes.push(r),this.levels.set(r,i),i===0&&(this.outerNodes.push(r),this.root??(this.root=r))}getRoot(){return{name:"",children:this.outerNodes}}addClass(r,i){let l=this.classes.get(r)??{id:r,styles:[],textStyles:[]},n=i.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");n&&n.forEach(s=>{ge(s)&&(l!=null&&l.textStyles?l.textStyles.push(s):l.textStyles=[s]),l!=null&&l.styles?l.styles.push(s):l.styles=[s]}),this.classes.set(r,l)}getClasses(){return this.classes}getStylesForClass(r){var i;return((i=this.classes.get(r))==null?void 0:i.styles)??[]}clear(){xe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},m(w,"TreeMapDB"),w);function _(d){if(!d.length)return[];let r=[],i=[];return d.forEach(l=>{let n={name:l.name,children:l.type==="Leaf"?void 0:[]};for(n.classSelector=l==null?void 0:l.classSelector,l!=null&&l.cssCompiledStyles&&(n.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(n.value=l.value);i.length>0&&i[i.length-1].level>=l.level;)i.pop();if(i.length===0)r.push(n);else{let s=i[i.length-1].node;s.children?s.children.push(n):s.children=[n]}l.type!=="Leaf"&&i.push({node:n,level:l.level})}),r}m(_,"buildHierarchy");var Ce=m((d,r)=>{se(d,r);let i=[];for(let s of d.TreemapRows??[])s.$type==="ClassDefStatement"&&r.addClass(s.className??"",s.styleText??"");for(let s of d.TreemapRows??[]){let p=s.item;if(!p)continue;let h=s.indent?parseInt(s.indent):0,N=$e(p),a=p.classSelector?r.getStylesForClass(p.classSelector):[],L=a.length>0?a:void 0,b={level:h,name:N,type:p.$type,value:p.value,classSelector:p.classSelector,cssCompiledStyles:L};i.push(b)}let l=_(i),n=m((s,p)=>{for(let h of s)r.addNode(h,p),h.children&&h.children.length>0&&n(h.children,p+1)},"addNodesRecursively");n(l,0)},"populate"),$e=m(d=>d.name?String(d.name):"","getItemName"),K={parser:{yy:void 0},parse:m(async d=>{var r;try{let i=await re("treemap",d);j.debug("Treemap AST:",i);let l=(r=K.parser)==null?void 0:r.yy;if(!(l instanceof Y))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ce(i,l)}catch(i){throw j.error("Error parsing treemap:",i),i}},"parse")},ve=10,v=10,P=25,we=m((d,r,i,l)=>{let n=l.db,s=n.getConfig(),p=s.padding??ve,h=n.getDiagramTitle(),N=n.getRoot(),{themeVariables:a}=G();if(!N)return;let L=h?30:0,b=ne(r),O=s.nodeWidth?s.nodeWidth*v:960,U=s.nodeHeight?s.nodeHeight*v:500,H=O,q=U+L;b.attr("viewBox",`0 0 ${H} ${q}`),oe(b,q,H,s.useMaxWidth);let C;try{let e=s.valueFormat||",";if(e==="$0,0")C=m(t=>"$"+F(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),c=t?t[0]:"";C=m(y=>"$"+F(","+c)(y),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);C=m(c=>"$"+F(t||"")(c),"valueFormat")}else C=F(e)}catch(e){j.error("Error creating format function:",e),C=F(",")}let T=I().range(["transparent",a.cScale0,a.cScale1,a.cScale2,a.cScale3,a.cScale4,a.cScale5,a.cScale6,a.cScale7,a.cScale8,a.cScale9,a.cScale10,a.cScale11]),Z=I().range(["transparent",a.cScalePeer0,a.cScalePeer1,a.cScalePeer2,a.cScalePeer3,a.cScalePeer4,a.cScalePeer5,a.cScalePeer6,a.cScalePeer7,a.cScalePeer8,a.cScalePeer9,a.cScalePeer10,a.cScalePeer11]),A=I().range([a.cScaleLabel0,a.cScaleLabel1,a.cScaleLabel2,a.cScaleLabel3,a.cScaleLabel4,a.cScaleLabel5,a.cScaleLabel6,a.cScaleLabel7,a.cScaleLabel8,a.cScaleLabel9,a.cScaleLabel10,a.cScaleLabel11]);h&&b.append("text").attr("x",H/2).attr("y",L/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);let J=b.append("g").attr("transform",`translate(0, ${L})`).attr("class","treemapContainer"),ee=ce(N).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),Q=de().size([O,U]).paddingTop(e=>e.children&&e.children.length>0?P+v:0).paddingInner(p).paddingLeft(e=>e.children&&e.children.length>0?v:0).paddingRight(e=>e.children&&e.children.length>0?v:0).paddingBottom(e=>e.children&&e.children.length>0?v:0).round(!0)(ee),te=Q.descendants().filter(e=>e.children&&e.children.length>0),M=J.selectAll(".treemapSection").data(te).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);M.append("rect").attr("width",e=>e.x1-e.x0).attr("height",P).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),M.append("clipPath").attr("id",(e,t)=>`clip-section-${r}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",P),M.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>T(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>Z(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";let t=$({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),M.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",P/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";let t="dominant-baseline: middle; font-size: 12px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",c=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+c.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=E(this),c=e.data.name;t.text(c);let y=e.x1-e.x0,S=6,g;s.showValues!==!1&&e.value?g=y-10-30-10-S:g=y-S-6;let u=Math.max(15,g),f=t.node();if(f.getComputedTextLength()>u){let o=c;for(;o.length>0;){if(o=c.substring(0,o.length-1),o.length===0){t.text("..."),f.getComputedTextLength()>u&&t.text("");break}if(t.text(o+"..."),f.getComputedTextLength()<=u)break}}}),s.showValues!==!1&&M.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",P/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?C(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";let t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",c=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+c.labelStyles.replace("color:","fill:")});let ae=Q.leaves(),D=J.selectAll(".treemapLeafGroup").data(ae).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?T(e.parent.data.name):T(e.data.name)).attr("style",e=>$({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?T(e.parent.data.name):T(e.data.name)).attr("stroke-width",3),D.append("clipPath").attr("id",(e,t)=>`clip-${r}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),D.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{let t="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+A(e.data.name)+";",c=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+c.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.data.name).each(function(e){let t=E(this),c=e.x1-e.x0,y=e.y1-e.y0,S=t.node(),g=4,u=c-2*g,f=y-2*g;if(u<10||f<10){t.style("display","none");return}let o=parseInt(t.style("font-size"),10),x=8,k=28,W=.6,z=6,R=2;for(;S.getComputedTextLength()>u&&o>x;)o--,t.style("font-size",`${o}px`);let V=Math.max(z,Math.min(k,Math.round(o*W))),X=o+R+V;for(;X>f&&o>x&&(o--,V=Math.max(z,Math.min(k,Math.round(o*W))),!(V<z&&o===x));)t.style("font-size",`${o}px`),X=o+R+V;t.style("font-size",`${o}px`),(S.getComputedTextLength()>u||o<x||f<o)&&t.style("display","none")}),s.showValues!==!1&&D.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>{let t="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+A(e.data.name)+";",c=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+c.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.value?C(e.value):"").each(function(e){let t=E(this),c=this.parentNode;if(!c){t.style("display","none");return}let y=E(c).select(".treemapLabel");if(y.empty()||y.style("display")==="none"){t.style("display","none");return}let S=parseFloat(y.style("font-size")),g=28,u=.6,f=6,o=2,x=Math.max(f,Math.min(g,Math.round(S*u)));t.style("font-size",`${x}px`);let k=(e.y1-e.y0)/2+S/2+o;t.attr("y",k);let W=e.x1-e.x0,z=e.y1-e.y0-4,R=W-8;t.node().getComputedTextLength()>R||k+x>z||x<f?t.style("display","none"):t.style("display",null)});let le=s.diagramPadding??8;be(b,le,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),Le=m(function(d,r){return r.db.getClasses()},"getClasses"),Te={draw:we,getClasses:Le},Me={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ke=m(({treemap:d}={})=>{let r=ie(),i=G(),l=B(r,i.themeVariables),n=B(Me,d),s=n.titleColor??l.titleColor,p=n.labelColor??l.textColor,h=n.valueColor??l.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${n.sectionStrokeColor};
4
+ stroke-width: ${n.sectionStrokeWidth};
5
+ fill: ${n.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${n.leafStrokeColor};
9
+ stroke-width: ${n.leafStrokeWidth};
10
+ fill: ${n.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${p};
14
+ font-size: ${n.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${h};
18
+ font-size: ${n.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${s};
22
+ font-size: ${n.titleFontSize};
23
+ }
24
+ `},"getStyles"),ze=ke,De={parser:K,get db(){return new Y},renderer:Te,styles:ze};export{De as diagram};
@@ -0,0 +1,3 @@
1
+ import{c as oe}from"./chunk-JQRUD6KW-DAwg-yCU.js";import{d as le,z as se}from"./wardley-L42UT6IY-5TKZOOLJ-DZr11zBG.js";import{o as de,n as me,l as xe,a as ce,s as ue,e as fe,m as o,p as g,q as W,i as ge,z as he,u as be,L as pe,E as we,I as F,d as y,P,aL as ve}from"./index-B5WxtMpv.js";var T="position frame",O="frame positioned",k="position relation",I="relation positioned",ye=o(function(e){g.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Me=o(function(){C(),be()},"clear");function C(){$={}}o(C,"reset");var ke=we.eventmodeling,Se=o(()=>pe({...ke,...F().eventmodeling}),"getConfig"),$={};function H(){let e=Be,{ast:a}=$,t=E();if(!a)throw new Error("No data for EventModel");return a.frames.forEach((i,n)=>{let r=L(i,a.dataEntities,t);e=v(e,{$kind:T,index:n,frame:i,textProps:r});let s;Q(i)?(g.debug("source frame",i.sourceFrames),s=a.frames.filter(d=>i.sourceFrames.some(m=>m.$refText===d.name)),s.forEach(d=>{e=v(e,{$kind:k,index:n,frame:i,sourceFrame:d})})):e=v(e,{$kind:k,index:n,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(H,"getState");function D(e){$.ast=e}o(D,"setAst");var l={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return l}o(E,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function N(e){let a=e.split(".");if(a.length===2)return a[0]}o(N,"extractNamespace");function U(e){let a=e.split(".");return a.length===2?a[1]:e}o(U,"extractName");function z(e,a){if(!(!a||a.length===0))return Object.values(e).find(t=>t.namespace===a)}o(z,"findSwimlaneByNamespace");function w(e,a,t){return Math.max(a,...Object.keys(e).filter(i=>{let n=Number.parseInt(i);return n>a&&n<t}).map(i=>Number.parseInt(i)))+1}o(w,"findNextAvailableIndex");function j(e,a){let t=N(e.entityIdentifier),i=z(a,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||l.labelUiAutomation}:t?{index:w(a,0,100),label:l.labelUiAutomationPrefix+t}:{index:0,label:l.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||l.labelCommandReadModel}:t?{index:w(a,100,200),label:l.labelCommandReadModelPrefix+t}:{index:100,label:l.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||l.labelEvents}:t?{index:w(a,200,300),label:l.labelEventsPrefix+t}:{index:200,label:l.labelEvents}}}o(j,"calculateSwimlaneProps");function V(e){let{themeVariables:a}=F();switch(e.modelEntityType){case"ui":return{fill:a.emUiFill??"white",stroke:a.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:a.emProcessorFill??"#edb3f6",stroke:a.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:a.emReadModelFill??"#d3f1a2",stroke:a.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:a.emCommandFill??"#bcd6fe",stroke:a.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:a.emEventFill??"#ffb778",stroke:a.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function L(e,a,t){let i=F(),n=y(U(e.entityIdentifier)??"",i),r,s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},d=`<b>${P(n,t.textMaxWidth,s)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,s),r=r.replaceAll(" ","&nbsp;")),e.dataReference){let f=a.find(b=>{var p;return b.name===((p=e.dataReference)==null?void 0:p.$refText)});f&&(r=f.dataBlockValue,r=r.substring(r.indexOf(`{
2
+ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,s),r=r.replaceAll(" ","&nbsp;"),r+="<br/>")}let m=r!==void 0;m&&(d+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);let c={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},x=ve(d,c),u=m?x.width/3:x.width,h={content:d,width:u,height:x.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,h),h}o(L,"calculateTextProps");function X(e,a){let t=a,i=V(t.frame),n={width:t.textProps.width+2*l.boxTextPadding,height:t.textProps.height+2*l.boxTextPadding};return[{$kind:O,frame:t.frame,index:t.index,visual:i,dimension:n,textProps:t.textProps}]}o(X,"decidePositionFrame");function q(e,a,t){return a===void 0?l.contentStartX:a.index===e.index&&e.r?e.r+l.boxPadding:t===void 0?l.contentStartX:t.r-l.boxOverlap+l.boxPadding}o(q,"calculateX");function G(e,a){let t=[...e.map(i=>i.r),a];return Math.max(...t)}o(G,"calculateMaxRight");function A(e){return Object.values(e).sort((a,t)=>a.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,a){let t=a,i=j(t.frame,e.swimlanes),n;i.index in e.swimlanes?n=e.swimlanes[i.index]:n={index:i.index,label:i.label,r:0,y:i.index*l.swimlaneMinHeight+l.swimlaneGap,height:l.swimlaneMinHeight,maxHeight:l.swimlaneMinHeight};let r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,s=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,d={width:Math.max(l.boxMinWidth,Math.min(l.boxMaxWidth,t.dimension.width))+2*l.boxPadding,height:Math.max(l.boxMinHeight,Math.min(l.boxMaxHeight,t.dimension.height))+2*l.boxPadding},m=q(n,s,r),c=m+d.width+l.boxPadding,x=G(Object.values(e.swimlanes),c);n.r=m+d.width,n.maxHeight=Math.max(n.maxHeight,d.height),n.height=Math.max(l.swimlaneMinHeight,n.maxHeight)+2*l.swimlanePadding;let u={x:m,y:l.swimlanePadding+n.y,r:c,dimension:d,leftSibling:!1,swimlane:n,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${n.index}`]:n},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let b=1;b<f.length;b++){let p=f[b],R=f[b-1];p.y=R.y+R.height+l.swimlaneGap}return h}o(Y,"evolveFramePositioned");function J(e,a){return e===0&&a.sourceFrames.length===0}o(J,"isFirstFrame");function Q(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(Q,"hasSourceFrame");function S(e,a){if(a!=null)return e.find(t=>t.frame.name===a.name)}o(S,"findBoxByFrame");function Z(e,a,t){if(!(t<0))for(let i=t;i>=0;i--){let n=e[i];if(n.swimlane.index!==a)return n}}o(Z,"findBoxByLineIndex");function _(e,a){let t=a;if(se(t.frame)||J(t.index,t.frame))return[];let i=S(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let n;return t.sourceFrame?n=S(e.boxes,t.sourceFrame):n=Z(e.boxes,i.swimlane.index,t.index-1),n===void 0?[]:[{$kind:I,frame:t.frame,index:t.index,sourceBox:n,targetBox:i}]}o(_,"decidePositionRelation");function K(e,a){let t=a,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(K,"evolveRelationPositioned");var Fe={[T]:X,[k]:_},$e={[O]:Y,[I]:K};function ee(e,a){let t=Fe[a.$kind];if(t==null)return[];let i=t(e,a);return g.debug("decided events",i),i}o(ee,"decide");function te(e,a){let t=a.reduce((i,n)=>{let r=$e[n.$kind];return r==null?i:r(i,n)},e);return g.debug("evolve events",{state:e,newState:t,events:a}),t}o(te,"evolve");function v(e,a){let t=ee(e,a);return te(e,t)}o(v,"dispatch");var B={getConfig:Se,setOptions:ye,getOptions:Pe,clear:Me,setAccTitle:fe,getAccTitle:ue,getAccDescription:ce,setAccDescription:xe,setDiagramTitle:me,getDiagramTitle:de,setAst:D,getDiagramProps:E,getState:H},Ee={parse:o(async e=>{let a=await le("eventmodeling",e);g.debug(a),B.setAst(a),oe(a,B)},"parse")},M=W(),Ae=M==null?void 0:M.eventmodeling;function ae(e,a){return t=>{let i=t.swimlane.y+a.swimlanePadding,n=e.append("g").attr("class","em-box");n.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),n.append("foreignObject").attr("x",t.x+a.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*a.boxPadding).attr("height",t.dimension.height-2*a.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(ae,"renderD3Box");function ie(e,a){return e>a}o(ie,"dirUpwards");function ne(e,a,t,i){return n=>{let r=n.sourceBox.swimlane.y+a.swimlanePadding,s=n.targetBox.swimlane.y+a.swimlanePadding,d=ie(r,s),m=n.sourceBox.x+n.sourceBox.dimension.width*2/3,c=n.targetBox.x+n.targetBox.dimension.width/3,x,u;g.debug(`rendering relation up=${d} for `,{sourceBox:n.sourceBox,targetBox:n.targetBox}),d?(x=r,u=s+n.targetBox.dimension.height):(x=r+n.sourceBox.dimension.height,u=s);let h=i.emRelationStroke??n.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",n.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${m} ${x} L${c} ${u}`)}}o(ne,"renderD3Relation");function re(e,a,t,i){return n=>{let r=e.append("g").attr("class","em-swimlane"),s=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",d=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",n.y).attr("rx","3").attr("width",a+t.swimlanePadding).attr("height",n.height).attr("fill",s).attr("stroke",d),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",n.y+30).text(n.label)}}o(re,"renderD3Swimlane");var Re=o(function(e,a,t,i){if(g.debug("in eventmodeling renderer",e+`
3
+ `,"id:",a,t),!Ae)throw new Error("EventModeling config not found");let n=i.db,{themeVariables:r,eventmodeling:s}=W(),d=ge(`[id="${a}"]`),m=n.getDiagramProps(),c=n.getState(),x=`em-arrowhead-${a}`,u=r.emArrowhead??"#000000";c.sortedSwimlanesArray.forEach(re(d,c.maxR,m,r)),c.boxes.forEach(ae(d,m)),c.relations.forEach(ne(d,m,x,r)),d.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),he(void 0,d,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),We={draw:Re},Te=o(e=>"","getStyles"),Oe=Te,De={parser:Ee,db:B,renderer:We,styles:Oe};export{De as diagram};