cmcts-c-agent-embedding 1.0.65-vib → 1.0.66-vib

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 (122) hide show
  1. package/README.md +349 -349
  2. package/dist/_basePickBy-1057a1b4.js +1 -0
  3. package/dist/_basePickBy-cbf78fb3.js +1 -0
  4. package/dist/_baseUniq-38ea2195.js +1 -0
  5. package/dist/_baseUniq-52a47b7b.js +1 -0
  6. package/dist/arc-6b847bc0.js +1 -0
  7. package/dist/arc-8928af28.js +1 -0
  8. package/dist/architecture-O4VJ6CD3-42323263.js +1 -0
  9. package/dist/architecture-O4VJ6CD3-b506967f.js +1 -0
  10. package/dist/architectureDiagram-VXUJARFQ-1bd867b6.js +1 -0
  11. package/dist/architectureDiagram-VXUJARFQ-2b851c59.js +1 -0
  12. package/dist/blockDiagram-VD42YOAC-5cea96b0.js +1 -0
  13. package/dist/blockDiagram-VD42YOAC-a909b757.js +1 -0
  14. package/dist/c4Diagram-YG6GDRKO-24d24519.js +1 -0
  15. package/dist/c4Diagram-YG6GDRKO-54783ab3.js +1 -0
  16. package/dist/channel-2af69aa2.js +1 -0
  17. package/dist/channel-f240e622.js +1 -0
  18. package/dist/chunk-4BX2VUAB-7747ae72.js +1 -0
  19. package/dist/chunk-4BX2VUAB-d05d937e.js +1 -0
  20. package/dist/chunk-55IACEB6-5a7b1be3.js +1 -0
  21. package/dist/chunk-55IACEB6-78729976.js +1 -0
  22. package/dist/chunk-B4BG7PRW-a97e69ff.js +1 -0
  23. package/dist/chunk-B4BG7PRW-cbf800c4.js +1 -0
  24. package/dist/chunk-DI55MBZ5-5dc4f926.js +1 -0
  25. package/dist/chunk-DI55MBZ5-95d71f6f.js +1 -0
  26. package/dist/chunk-FMBD7UC4-2c653fda.js +1 -0
  27. package/dist/chunk-FMBD7UC4-d75ed695.js +1 -0
  28. package/dist/chunk-QN33PNHL-0bf10733.js +1 -0
  29. package/dist/chunk-QN33PNHL-b00655c9.js +1 -0
  30. package/dist/chunk-QZHKN3VN-a979a9fe.js +1 -0
  31. package/dist/chunk-QZHKN3VN-d57979be.js +1 -0
  32. package/dist/chunk-TZMSLE5B-6755c559.js +1 -0
  33. package/dist/chunk-TZMSLE5B-ed6d6d7e.js +1 -0
  34. package/dist/classDiagram-2ON5EDUG-8b5a2a93.js +1 -0
  35. package/dist/classDiagram-2ON5EDUG-fa9ecfbb.js +1 -0
  36. package/dist/classDiagram-v2-WZHVMYZB-8b5a2a93.js +1 -0
  37. package/dist/classDiagram-v2-WZHVMYZB-fa9ecfbb.js +1 -0
  38. package/dist/clone-6cd174cf.js +1 -0
  39. package/dist/clone-8494eb3f.js +1 -0
  40. package/dist/components/buttons/ConsultationButton.d.ts +1 -0
  41. package/dist/components/buttons/ConsultationButton.d.ts.map +1 -1
  42. package/dist/components/buttons/PopupToast.d.ts +1 -1
  43. package/dist/components/buttons/PopupToast.d.ts.map +1 -1
  44. package/dist/components/modals/ZaloQRModal.d.ts.map +1 -1
  45. package/dist/cose-bilkent-S5V4N54A-2f5eb275.js +1 -0
  46. package/dist/cose-bilkent-S5V4N54A-3cda82b5.js +1 -0
  47. package/dist/cytoscape.esm-9acb9bfe.js +1 -0
  48. package/dist/dagre-6UL2VRFP-9b648c54.js +1 -0
  49. package/dist/dagre-6UL2VRFP-e997588d.js +1 -0
  50. package/dist/defaultLocale-1fe70b7d.js +1 -0
  51. package/dist/diagram-PSM6KHXK-1234d08d.js +1 -0
  52. package/dist/diagram-PSM6KHXK-15013de5.js +1 -0
  53. package/dist/diagram-QEK2KX5R-489b9505.js +1 -0
  54. package/dist/diagram-QEK2KX5R-9e94df2a.js +1 -0
  55. package/dist/diagram-S2PKOQOG-6fef3823.js +1 -0
  56. package/dist/diagram-S2PKOQOG-c943ed25.js +1 -0
  57. package/dist/erDiagram-Q2GNP2WA-2b1823f2.js +1 -0
  58. package/dist/erDiagram-Q2GNP2WA-7e6c6a04.js +1 -0
  59. package/dist/features/bubble/components/BubbleButton.d.ts.map +1 -1
  60. package/dist/flowDiagram-NV44I4VS-709c6479.js +1 -0
  61. package/dist/flowDiagram-NV44I4VS-98a84da9.js +1 -0
  62. package/dist/ganttDiagram-LVOFAZNH-1d379d6a.js +1 -0
  63. package/dist/ganttDiagram-LVOFAZNH-d8342586.js +1 -0
  64. package/dist/gitGraph-ZV4HHKMB-788776f3.js +1 -0
  65. package/dist/gitGraph-ZV4HHKMB-ba420dcc.js +1 -0
  66. package/dist/gitGraphDiagram-NY62KEGX-804d1363.js +1 -0
  67. package/dist/gitGraphDiagram-NY62KEGX-919097ea.js +1 -0
  68. package/dist/graph-834f6046.js +1 -0
  69. package/dist/graph-db4953aa.js +1 -0
  70. package/dist/info-63CPKGFF-2dccc483.js +1 -0
  71. package/dist/info-63CPKGFF-ef40f1c4.js +1 -0
  72. package/dist/infoDiagram-F6ZHWCRC-579d50b4.js +1 -0
  73. package/dist/infoDiagram-F6ZHWCRC-c9877bad.js +1 -0
  74. package/dist/init-cf76ae07.js +1 -0
  75. package/dist/journeyDiagram-XKPGCS4Q-25d3c922.js +1 -0
  76. package/dist/journeyDiagram-XKPGCS4Q-2d2cda1c.js +1 -0
  77. package/dist/kanban-definition-3W4ZIXB7-c556bee0.js +1 -0
  78. package/dist/kanban-definition-3W4ZIXB7-cdb93ec0.js +1 -0
  79. package/dist/katex-0a18b0df.js +1 -0
  80. package/dist/layout-40652dba.js +1 -0
  81. package/dist/layout-54ffc604.js +1 -0
  82. package/dist/linear-2f639b72.js +1 -0
  83. package/dist/linear-ed2367ff.js +1 -0
  84. package/dist/mermaid-parser.core-0cfa7d2a.js +1 -0
  85. package/dist/mermaid-parser.core-10bed742.js +1 -0
  86. package/dist/mindmap-definition-VGOIOE7T-169f5fe5.js +1 -0
  87. package/dist/mindmap-definition-VGOIOE7T-dea1c792.js +1 -0
  88. package/dist/ordinal-221e41d7.js +1 -0
  89. package/dist/packet-HUATNLJX-6f2471ea.js +1 -0
  90. package/dist/packet-HUATNLJX-c69e28eb.js +1 -0
  91. package/dist/pie-WTHONI2E-4143e44b.js +1 -0
  92. package/dist/pie-WTHONI2E-82b1fe3f.js +1 -0
  93. package/dist/pieDiagram-ADFJNKIX-499eec78.js +1 -0
  94. package/dist/pieDiagram-ADFJNKIX-657effd5.js +1 -0
  95. package/dist/quadrantDiagram-AYHSOK5B-138a0c93.js +1 -0
  96. package/dist/quadrantDiagram-AYHSOK5B-91137c4d.js +1 -0
  97. package/dist/radar-NJJJXTRR-5e934a95.js +1 -0
  98. package/dist/radar-NJJJXTRR-94d77527.js +1 -0
  99. package/dist/requirementDiagram-UZGBJVZJ-a5d9fb39.js +1 -0
  100. package/dist/requirementDiagram-UZGBJVZJ-d7aeec99.js +1 -0
  101. package/dist/sankeyDiagram-TZEHDZUN-15053ae0.js +1 -0
  102. package/dist/sankeyDiagram-TZEHDZUN-aadd2125.js +1 -0
  103. package/dist/sequenceDiagram-WL72ISMW-12e778ef.js +1 -0
  104. package/dist/sequenceDiagram-WL72ISMW-9330a98a.js +1 -0
  105. package/dist/stateDiagram-FKZM4ZOC-01225f0f.js +1 -0
  106. package/dist/stateDiagram-FKZM4ZOC-af4836d7.js +1 -0
  107. package/dist/stateDiagram-v2-4FDKWEC3-4774cc10.js +1 -0
  108. package/dist/stateDiagram-v2-4FDKWEC3-5ef8e019.js +1 -0
  109. package/dist/timeline-definition-IT6M3QCI-9921f937.js +1 -0
  110. package/dist/timeline-definition-IT6M3QCI-a7a9bbec.js +1 -0
  111. package/dist/treemap-75Q7IDZK-100ddeb7.js +1 -0
  112. package/dist/treemap-75Q7IDZK-851117b4.js +1 -0
  113. package/dist/utils/redisAndQueue.d.ts +32 -0
  114. package/dist/utils/redisAndQueue.d.ts.map +1 -0
  115. package/dist/utils/transcriptApi.d.ts.map +1 -1
  116. package/dist/web-0016ac81.js +1 -0
  117. package/dist/web-4e6d8ea9.js +1 -0
  118. package/dist/web.js +1 -1
  119. package/dist/xychartDiagram-PRI3JC2R-003630a4.js +1 -0
  120. package/dist/xychartDiagram-PRI3JC2R-df869780.js +1 -0
  121. package/package.json +2 -2
  122. package/server.js +401 -401
@@ -0,0 +1 @@
1
+ import{aI as t,aJ as e,C as i,s as n,g as r,n as o,o as s,b as a,c as h,_ as l,t as d,D as g,E as c,aK as u,aL as p,l as f,j as y,H as m,W as v,r as E,ak as N,d as T,aM as A,i as w}from"./web-4e6d8ea9.js";import{p as L}from"./chunk-4BX2VUAB-d05d937e.js";import{p as C}from"./mermaid-parser.core-10bed742.js";import{c as I}from"./cytoscape.esm-9acb9bfe.js";import"./_baseUniq-52a47b7b.js";import"./_basePickBy-1057a1b4.js";import"./clone-6cd174cf.js";var _,M,x,O={exports:{}},D={exports:{}},R={exports:{}};function b(){var t;return M||(M=1,t=function(t){return e={45:(t,e,i)=>{var n={};n.layoutBase=i(551),n.CoSEConstants=i(806),n.CoSEEdge=i(767),n.CoSEGraph=i(880),n.CoSEGraphManager=i(578),n.CoSELayout=i(765),n.CoSENode=i(991),n.ConstraintHandler=i(902),t.exports=n},806:(t,e,i)=>{var n,r=i(551).FDLayoutConstants;function o(){}for(n in r)o[n]=r[n];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!0,o.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,o.TREE_REDUCTION_ON_INCREMENTAL=!0,o.PURE_INCREMENTAL=o.DEFAULT_INCREMENTAL,t.exports=o},767:(t,e,i)=>{var n,r=i(551).FDLayoutEdge;function o(t,e,i){r.call(this,t,e,i)}for(n in o.prototype=Object.create(r.prototype),r)o[n]=r[n];t.exports=o},880:(t,e,i)=>{var n,r=i(551).LGraph;function o(t,e,i){r.call(this,t,e,i)}for(n in o.prototype=Object.create(r.prototype),r)o[n]=r[n];t.exports=o},578:(t,e,i)=>{var n,r=i(551).LGraphManager;function o(t){r.call(this,t)}for(n in o.prototype=Object.create(r.prototype),r)o[n]=r[n];t.exports=o},765:(t,e,i)=>{var n,r=i(551).FDLayout,o=i(578),s=i(880),a=i(991),h=i(767),l=i(806),d=i(902),g=i(551).FDLayoutConstants,c=i(551).LayoutConstants,u=i(551).Point,p=i(551).PointD,f=i(551).DimensionD,y=i(551).Layout,m=i(551).Integer,v=i(551).IGeometry,E=i(551).LGraph,N=i(551).Transform,T=i(551).LinkedList;function A(){r.call(this),this.toBeTiled={},this.constraints={}}for(n in A.prototype=Object.create(r.prototype),r)A[n]=r[n];A.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t},A.prototype.newGraph=function(t){return new s(null,this.graphManager,t)},A.prototype.newNode=function(t){return new a(this.graphManager,t)},A.prototype.newEdge=function(t){return new h(null,null,t)},A.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){var t,e,i;return 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?l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(i)):0<(t=this.getFlatForest()).length?this.positionNodesRadially(t):(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(i),this.positionNodesRandomly()),0<Object.keys(this.constraints).length&&(d.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(0<this.prunedNodesAll.length))return!0;this.isTreeGrowing=!0}if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(0<this.prunedNodesAll.length))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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))}var t;if(this.isTreeGrowing&&(this.growTreeIterations%10==0&&(0<this.prunedNodesAll.length?(this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL):(this.isTreeGrowing=!1,this.isGrowthFinished=!0)),this.growTreeIterations++),this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var e=!this.isTreeGrowing&&!this.isGrowthFinished,i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(e,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},i=0;i<t.length;i++){var n=t[i].rect,r=t[i].id;e[r]={id:r,x:n.getCenterX(),y:n.getCenterY(),w:n.width,h:n.height}}return e},A.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===g.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},A.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].calculateDisplacement();for(0<Object.keys(this.constraints).length&&this.updateDisplacements(),e=0;e<t.length;e++)t[e].move()},A.prototype.initConstraintVariables=function(){for(var t=this,e=(this.idToNodeMap=new Map,this.fixedNodeSet=new Set,this.graphManager.getAllNodes()),i=0;i<e.length;i++){var n=e[i];this.idToNodeMap.set(n.id,n)}function r(e){for(var i,n=e.getChild().getNodes(),o=0,s=0;s<n.length;s++)null==(i=n[s]).getChild()?t.fixedNodeSet.has(i.id)&&(o+=100):o+=r(i);return o}if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach((function(e){t.fixedNodeSet.add(e.nodeId)}));var o;for(e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)null!=(n=e[i]).getChild()&&0<(o=r(n))&&(n.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var s,a,h,d,g=new Map,c=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(i=0;i<u.length;i++)this.dummyToNodeForVerticalAlignment.set("dummy"+i,[]),u[i].forEach((function(e){g.set(e,"dummy"+i),t.dummyToNodeForVerticalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnHorizontal.add("dummy"+i)}))}if(this.constraints.alignmentConstraint.horizontal){var p=this.constraints.alignmentConstraint.horizontal;for(i=0;i<p.length;i++)this.dummyToNodeForHorizontalAlignment.set("dummy"+i,[]),p[i].forEach((function(e){c.set(e,"dummy"+i),t.dummyToNodeForHorizontalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnVertical.add("dummy"+i)}))}}l.RELAX_MOVEMENT_ON_CONSTRAINTS?(this.shuffle=function(t){for(var e,i,n=t.length-1;n>=2*t.length/3;n--)e=Math.floor(Math.random()*(n+1)),i=t[n],t[n]=t[e],t[e]=i;return t},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(e){var i,n;e.left?(n=g.has(e.left)?g.get(e.left):e.left,i=g.has(e.right)?g.get(e.right):e.right,t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodesInRelativeHorizontal.includes(i)||(t.nodesInRelativeHorizontal.push(i),t.nodeToRelativeConstraintMapHorizontal.set(i,[]),t.dummyToNodeForVerticalAlignment.has(i)?t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(i).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(n).push({right:i,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(i).push({left:n,gap:e.gap})):(i=c.has(e.top)?c.get(e.top):e.top,n=c.has(e.bottom)?c.get(e.bottom):e.bottom,t.nodesInRelativeVertical.includes(i)||(t.nodesInRelativeVertical.push(i),t.nodeToRelativeConstraintMapVertical.set(i,[]),t.dummyToNodeForHorizontalAlignment.has(i)?t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(i,t.idToNodeMap.get(i).getCenterY())),t.nodesInRelativeVertical.includes(n)||(t.nodesInRelativeVertical.push(n),t.nodeToRelativeConstraintMapVertical.set(n,[]),t.dummyToNodeForHorizontalAlignment.has(n)?t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(n)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(n).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(i).push({bottom:n,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(n).push({top:i,gap:e.gap}))}))):(s=new Map,a=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){var e,i;t.left?(i=g.has(t.left)?g.get(t.left):t.left,e=g.has(t.right)?g.get(t.right):t.right,s.has(i)?s.get(i).push(e):s.set(i,[e]),s.has(e)?s.get(e).push(i):s.set(e,[i])):(e=c.has(t.top)?c.get(t.top):t.top,i=c.has(t.bottom)?c.get(t.bottom):t.bottom,a.has(e)?a.get(e).push(i):a.set(e,[i]),a.has(i)?a.get(i).push(e):a.set(i,[e]))})),d=(h=function(t,e){var i=[],n=[],r=new T,o=new Set,s=0;return t.forEach((function(a,h){if(!o.has(h)){for(i[s]=[],n[s]=!1,r.push(l=h),o.add(l),i[s].push(l);0!=r.length;){var l=r.shift();e.has(l)&&(n[s]=!0),t.get(l).forEach((function(t){o.has(t)||(r.push(t),o.add(t),i[s].push(t))}))}s++}})),{components:i,isFixed:n}})(s,t.fixedNodesOnHorizontal),this.componentsOnHorizontal=d.components,this.fixedComponentsOnHorizontal=d.isFixed,d=h(a,t.fixedNodesOnVertical),this.componentsOnVertical=d.components,this.fixedComponentsOnVertical=d.isFixed)}},A.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){(e=t.idToNodeMap.get(e.nodeId)).displacementX=0,e.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,i=0;i<e.length;i++){for(var n=0,r=0;r<e[i].length;r++){if(this.fixedNodeSet.has(e[i][r])){n=0;break}n+=this.idToNodeMap.get(e[i][r]).displacementX}var o=n/e[i].length;for(r=0;r<e[i].length;r++)this.idToNodeMap.get(e[i][r]).displacementX=o}if(this.constraints.alignmentConstraint.horizontal){var s=this.constraints.alignmentConstraint.horizontal;for(i=0;i<s.length;i++){var a=0;for(r=0;r<s[i].length;r++){if(this.fixedNodeSet.has(s[i][r])){a=0;break}a+=this.idToNodeMap.get(s[i][r]).displacementY}var h=a/s[i].length;for(r=0;r<s[i].length;r++)this.idToNodeMap.get(s[i][r]).displacementY=h}}}if(this.constraints.relativePlacementConstraint)if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach((function(e){var i;t.fixedNodesOnHorizontal.has(e)||(i=0,i=(t.dummyToNodeForVerticalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(e)[0]):t.idToNodeMap.get(e)).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(e).forEach((function(n){var r;n.right?(r=t.nodeToTempPositionMapHorizontal.get(n.right)-t.nodeToTempPositionMapHorizontal.get(e)-i)<n.gap&&(i-=n.gap-r):(r=t.nodeToTempPositionMapHorizontal.get(e)-t.nodeToTempPositionMapHorizontal.get(n.left)+i)<n.gap&&(i+=n.gap-r)})),t.nodeToTempPositionMapHorizontal.set(e,t.nodeToTempPositionMapHorizontal.get(e)+i),t.dummyToNodeForVerticalAlignment.has(e)?t.dummyToNodeForVerticalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementX=i})):t.idToNodeMap.get(e).displacementX=i)})),this.nodesInRelativeVertical.forEach((function(e){var i;t.fixedNodesOnHorizontal.has(e)||(i=0,i=(t.dummyToNodeForHorizontalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]):t.idToNodeMap.get(e)).displacementY,t.nodeToRelativeConstraintMapVertical.get(e).forEach((function(n){var r;n.bottom?(r=t.nodeToTempPositionMapVertical.get(n.bottom)-t.nodeToTempPositionMapVertical.get(e)-i)<n.gap&&(i-=n.gap-r):(r=t.nodeToTempPositionMapVertical.get(e)-t.nodeToTempPositionMapVertical.get(n.top)+i)<n.gap&&(i+=n.gap-r)})),t.nodeToTempPositionMapVertical.set(e,t.nodeToTempPositionMapVertical.get(e)+i),t.dummyToNodeForHorizontalAlignment.has(e)?t.dummyToNodeForHorizontalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementY=i})):t.idToNodeMap.get(e).displacementY=i)}));else{for(i=0;i<this.componentsOnHorizontal.length;i++){var d=this.componentsOnHorizontal[i];if(this.fixedComponentsOnHorizontal[i])for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?this.dummyToNodeForVerticalAlignment.get(d[r]).forEach((function(e){t.idToNodeMap.get(e).displacementX=0})):this.idToNodeMap.get(d[r]).displacementX=0;else{var g=0,c=0;for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?(g+=(p=this.dummyToNodeForVerticalAlignment.get(d[r])).length*this.idToNodeMap.get(p[0]).displacementX,c+=p.length):(g+=this.idToNodeMap.get(d[r]).displacementX,c++);var u=g/c;for(r=0;r<d.length;r++)this.dummyToNodeForVerticalAlignment.has(d[r])?this.dummyToNodeForVerticalAlignment.get(d[r]).forEach((function(e){t.idToNodeMap.get(e).displacementX=u})):this.idToNodeMap.get(d[r]).displacementX=u}}for(i=0;i<this.componentsOnVertical.length;i++)if(d=this.componentsOnVertical[i],this.fixedComponentsOnVertical[i])for(r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?this.dummyToNodeForHorizontalAlignment.get(d[r]).forEach((function(e){t.idToNodeMap.get(e).displacementY=0})):this.idToNodeMap.get(d[r]).displacementY=0;else{var p;for(g=0,c=0,r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?(g+=(p=this.dummyToNodeForHorizontalAlignment.get(d[r])).length*this.idToNodeMap.get(p[0]).displacementY,c+=p.length):(g+=this.idToNodeMap.get(d[r]).displacementY,c++);for(u=g/c,r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.has(d[r])?this.dummyToNodeForHorizontalAlignment.get(d[r]).forEach((function(e){t.idToNodeMap.get(e).displacementY=u})):this.idToNodeMap.get(d[r]).displacementY=u}}},A.prototype.calculateNodesToApplyGravitationTo=function(){for(var t,e=[],i=this.graphManager.getGraphs(),n=i.length,r=0;r<n;r++)(t=i[r]).updateConnected(),t.isConnected||(e=e.concat(t.getNodes()));return e},A.prototype.createBendpoints=function(){for(var t=(t=[]).concat(this.graphManager.getAllEdges()),e=new Set,i=0;i<t.length;i++){var n=t[i];if(!e.has(n)){var r=n.getSource(),o=n.getTarget();if(r==o)n.getBendpoints().push(new p),n.getBendpoints().push(new p),this.createDummyNodesForBendpoints(n),e.add(n);else{var s=[];if(s=(s=s.concat(r.getEdgeListToNode(o))).concat(o.getEdgeListToNode(r)),!e.has(s[0])){if(1<s.length)for(var a=0;a<s.length;a++){var h=s[a];h.getBendpoints().push(new p),this.createDummyNodesForBendpoints(h)}s.forEach((function(t){e.add(t)}))}}}if(e.size==t.length)break}},A.prototype.positionNodesRadially=function(t){for(var e=new u(0,0),i=Math.ceil(Math.sqrt(t.length)),n=0,r=0,o=0,s=new p(0,0),a=0;a<t.length;a++){a%i==0&&(r=n,(o=0)!=a&&(r+=l.DEFAULT_COMPONENT_SEPERATION),n=0);var h=t[a],d=y.findCenterOfTree(h);e.x=o,e.y=r,(s=A.radialLayout(h,d,e)).y>n&&(n=Math.floor(s.y)),o=Math.floor(s.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(c.WORLD_CENTER_X-s.x/2,c.WORLD_CENTER_Y-s.y/2))},A.radialLayout=function(t,e,i){var n=Math.max(this.maxDiagonalInTree(t),l.DEFAULT_RADIAL_SEPARATION),r=(e=(A.branchRadialLayout(e,null,0,359,0,n),E.calculateBounds(t)),new N);r.setDeviceOrgX(e.getMinX()),r.setDeviceOrgY(e.getMinY()),r.setWorldOrgX(i.x),r.setWorldOrgY(i.y);for(var o=0;o<t.length;o++)t[o].transform(r);return n=new p(e.getMaxX(),e.getMaxY()),r.inverseTransformPoint(n)},A.branchRadialLayout=function(t,e,i,n,r,o){(s=(n-i+1)/2)<0&&(s+=180);for(var s=(s+i)%360*v.TWO_PI/360,a=r*Math.cos(s),h=(s=r*Math.sin(s),t.setCenter(a,s),[]),l=(h=h.concat(t.getEdges())).length,d=(null!=e&&l--,0),g=h.length,c=t.getEdgesBetween(e);1<c.length;){var u=c[0];0<=(u=(c.splice(0,1),h.indexOf(u)))&&h.splice(u,1),g--,l--}a=null!=e?(h.indexOf(c[0])+1)%g:0;for(var p=Math.abs(n-i)/l,f=a;d!=l;f=++f%g){var y=h[f].getOtherEnd(t);y!=e&&(A.branchRadialLayout(y,t,y=(i+d*p)%360,(y+p)%360,r+o,o),d++)}},A.maxDiagonalInTree=function(t){for(var e=m.MIN_VALUE,i=0;i<t.length;i++){var n=t[i].getDiagonal();e<n&&(e=n)}return e},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){for(var t=this,e={},i=(this.memberGroups={},this.idToDummyNode={},[]),n=this.graphManager.getAllNodes(),r=0;r<n.length;r++){var o=(s=n[r]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=o.id&&this.getToBeTiled(o)||i.push(s)}for(r=0;r<i.length;r++){var s,h=(s=i[r]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(s)}Object.keys(e).forEach((function(i){if(1<e[i].length){var n="DummyCompound_"+i,r=(t.memberGroups[n]=e[i],e[i][0].getParent()),o=new a(t.graphManager),s=(o.id=n,o.paddingLeft=r.paddingLeft||0,o.paddingRight=r.paddingRight||0,o.paddingBottom=r.paddingBottom||0,o.paddingTop=r.paddingTop||0,t.idToDummyNode[n]=o,t.getGraphManager().add(t.newGraph(),o)),h=r.getChild();h.add(o);for(var l=0;l<e[i].length;l++){var d=e[i][l];h.remove(d),s.add(d)}}}))},A.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)e[this.compoundOrder[i].id]=this.compoundOrder[i],t[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},A.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(i){var n,r=t.idToDummyNode[i];e[i]=t.tileNodes(t.memberGroups[i],r.paddingLeft+r.paddingRight),r.rect.width=e[i].width,r.rect.height=e[i].height,r.setCenter(e[i].centerX,e[i].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS&&(i=r.rect.width,n=r.rect.height,r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(i+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>i?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight)&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(n+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>n?(r.rect.y-=(r.labelHeight-n)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-n)/2):"bottom"==r.labelPosVertical&&r.setHeight(n+r.labelHeight))}))},A.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;0<=t;t--){var e=this.compoundOrder[t],i=e.id,n=e.paddingLeft,r=e.paddingTop,o=e.labelMarginLeft,s=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,n,r,o,s)}},A.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(i){var n=t.idToDummyNode[i],r=n.paddingLeft,o=n.paddingTop,s=n.labelMarginLeft,a=n.labelMarginTop;t.adjustLocations(e[i],n.rect.x,n.rect.y,r,o,s,a)}))},A.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];if(null==(t=t.getChild()))return this.toBeTiled[e]=!1;for(var i=t.getNodes(),n=0;n<i.length;n++){var r=i[n];if(0<this.getNodeDegree(r))return this.toBeTiled[e]=!1;if(null==r.getChild())this.toBeTiled[r.id]=!1;else if(!this.getToBeTiled(r))return this.toBeTiled[e]=!1}return this.toBeTiled[e]=!0},A.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),i=0,n=0;n<e.length;n++){var r=e[n];r.getSource().id!==r.getTarget().id&&(i+=1)}return i},A.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null!=t.getChild())for(var i=t.getChild().getNodes(),n=0;n<i.length;n++){var r=i[n];e+=this.getNodeDegreeWithChildren(r)}return e},A.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},A.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var i=t[e];null!=i.getChild()&&this.fillCompexOrderByDFS(i.getChild().getNodes()),this.getToBeTiled(i)&&this.compoundOrder.push(i)}},A.prototype.adjustLocations=function(t,e,i,n,r,o,s){i+=r+s;for(var a=e+=n+o,h=0;h<t.rows.length;h++){for(var l=t.rows[h],d=(e=a,0),g=0;g<l.length;g++){var c=l[g];c.rect.x=e,c.rect.y=i,e+=c.rect.width+t.horizontalPadding,c.rect.height>d&&(d=c.rect.height)}i+=d+t.verticalPadding}},A.prototype.tileCompoundMembers=function(t,e){var i=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(n){var r,o=e[n];i.tiledMemberPack[n]=i.tileNodes(t[n],o.paddingLeft+o.paddingRight),o.rect.width=i.tiledMemberPack[n].width,o.rect.height=i.tiledMemberPack[n].height,o.setCenter(i.tiledMemberPack[n].centerX,i.tiledMemberPack[n].centerY),o.labelMarginLeft=0,o.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS&&(n=o.rect.width,r=o.rect.height,o.labelWidth&&("left"==o.labelPosHorizontal?(o.rect.x-=o.labelWidth,o.setWidth(n+o.labelWidth),o.labelMarginLeft=o.labelWidth):"center"==o.labelPosHorizontal&&o.labelWidth>n?(o.rect.x-=(o.labelWidth-n)/2,o.setWidth(o.labelWidth),o.labelMarginLeft=(o.labelWidth-n)/2):"right"==o.labelPosHorizontal&&o.setWidth(n+o.labelWidth)),o.labelHeight)&&("top"==o.labelPosVertical?(o.rect.y-=o.labelHeight,o.setHeight(r+o.labelHeight),o.labelMarginTop=o.labelHeight):"center"==o.labelPosVertical&&o.labelHeight>r?(o.rect.y-=(o.labelHeight-r)/2,o.setHeight(o.labelHeight),o.labelMarginTop=(o.labelHeight-r)/2):"bottom"==o.labelPosVertical&&o.setHeight(r+o.labelHeight))}))},A.prototype.tileNodes=function(t,e){var i=this.tileNodesByFavoringDim(t,e,!0);t=this.tileNodesByFavoringDim(t,e,!1),e=this.getOrgRatio(i);return e=this.getOrgRatio(t)<e?t:i},A.prototype.getOrgRatio=function(t){return(t=t.width/t.height)<1?1/t:t},A.prototype.calcIdealRowWidth=function(t,e){var i,n=l.TILING_PADDING_VERTICAL,r=l.TILING_PADDING_HORIZONTAL,o=t.length,s=0,a=0,h=0,d=(t=(t.forEach((function(t){s+=t.getWidth(),a+=t.getHeight(),t.getWidth()>h&&(h=t.getWidth())})),s/o),a/o);d=Math.pow(n-r,2)+4*(t+r)*(d+n)*o,o=(r-n+Math.sqrt(d))/(2*(t+r));return(n=(e?(i=Math.ceil(o))==o&&i++:i=Math.floor(o),i*(t+r)-r))<h&&(n=h),n+2*r},A.prototype.tileNodesByFavoringDim=function(t,e,i){function n(t,e){return h(e)-h(t)}for(var r=l.TILING_PADDING_VERTICAL,o=l.TILING_PADDING_HORIZONTAL,s=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:r,horizontalPadding:o,centerX:0,centerY:0},h=(s&&(a.idealRowWidth=this.calcIdealRowWidth(t,i)),function(t){return t.rect.width*t.rect.height}),d=(t.sort((function(t,e){var i=n;return a.idealRowWidth?(i=s)(t.id,e.id):i(t,e)})),0),g=0,c=0;c<t.length;c++)d+=(p=t[c]).getCenterX(),g+=p.getCenterY();for(a.centerX=d/t.length,a.centerY=g/t.length,c=0;c<t.length;c++){var u,p=t[c];0==a.rows.length?this.insertNodeToRow(a,p,0,e):this.canAddHorizontal(a,p.rect.width,p.rect.height)?(u=a.rows.length-1,a.idealRowWidth||(u=this.getShortestRowIndex(a)),this.insertNodeToRow(a,p,u,e)):this.insertNodeToRow(a,p,a.rows.length,e),this.shiftToLastRow(a)}return a},A.prototype.insertNodeToRow=function(t,e,i,n){i==t.rows.length&&(t.rows.push([]),t.rowWidth.push(n),t.rowHeight.push(0));n=t.rowWidth[i]+e.rect.width,0<t.rows[i].length&&(n+=t.horizontalPadding),t.rowWidth[i]=n,t.width<n&&(t.width=n),n=e.rect.height;var r=(0<i&&(n+=t.verticalPadding),0);n>t.rowHeight[i]&&(r=t.rowHeight[i],t.rowHeight[i]=n,r=t.rowHeight[i]-r),t.height+=r,t.rows[i].push(e)},A.prototype.getShortestRowIndex=function(t){for(var e=-1,i=Number.MAX_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]<i&&(e=n,i=t.rowWidth[n]);return e},A.prototype.getLongestRowIndex=function(t){for(var e=-1,i=Number.MIN_VALUE,n=0;n<t.rows.length;n++)t.rowWidth[n]>i&&(e=n,i=t.rowWidth[n]);return e},A.prototype.canAddHorizontal=function(t,e,i){var n,r,o;return t.idealRowWidth?(r=t.rows.length-1,t.rowWidth[r]+e+t.horizontalPadding<=t.idealRowWidth):(r=this.getShortestRowIndex(t))<0||(o=t.rowWidth[r])+t.horizontalPadding+e<=t.width||(n=0,t.rowHeight[r]<i&&0<r&&(n=i+t.verticalPadding-t.rowHeight[r]),r=t.width-o>=e+t.horizontalPadding?(t.height+n)/(o+e+t.horizontalPadding):(t.height+n)/t.width,n=i+t.verticalPadding,(r=r<1?1/r:r)<(o=(o=t.width<e?(t.height+n)/e:(t.height+n)/t.width)<1?1/o:o))},A.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),i=t.rowWidth.length-1,n=t.rows[e],r=n[n.length-1],o=r.width+t.horizontalPadding;if(t.width-t.rowWidth[i]>o&&e!=i){n.splice(-1,1),t.rows[i].push(r),t.rowWidth[e]=t.rowWidth[e]-o,t.rowWidth[i]=t.rowWidth[i]+o,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var s=Number.MIN_VALUE,a=0;a<n.length;a++)n[a].height>s&&(s=n[a].height);0<e&&(s+=t.verticalPadding),o=t.rowHeight[e]+t.rowHeight[i],t.rowHeight[e]=s,t.rowHeight[i]<r.height+t.verticalPadding&&(t.rowHeight[i]=r.height+t.verticalPadding),r=t.rowHeight[e]+t.rowHeight[i],t.height+=r-o,this.shiftToLastRow(t)}},A.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var t=[],e=!0;e;){for(var i,n,r=this.graphManager.getAllNodes(),o=[],s=(e=!1,0);s<r.length;s++)1!=(n=r[s]).getEdges().length||n.getEdges()[0].isInterGraph||null!=n.getChild()||(l.PURE_INCREMENTAL?(i=n.getEdges()[0].getOtherEnd(n),i=new f(n.getCenterX()-i.getCenterX(),n.getCenterY()-i.getCenterY()),o.push([n,n.getEdges()[0],n.getOwner(),i])):o.push([n,n.getEdges()[0],n.getOwner()]),e=!0);if(1==e){for(var a=[],h=0;h<o.length;h++)1==o[h][0].getEdges().length&&(a.push(o[h]),o[h][0].getOwner().remove(o[h][0]));t.push(a),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=t},A.prototype.growTree=function(t){for(var e,i=t[t.length-1],n=0;n<i.length;n++)e=i[n],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},A.prototype.findPlaceforPrunedNode=function(t){var e=t[0],i=e==t[1].source?t[1].target:t[1].source;if(l.PURE_INCREMENTAL)e.setCenter(i.getCenterX()+t[3].getWidth(),i.getCenterY()+t[3].getHeight());else{var n=i.startX,r=i.finishX,o=i.startY,s=i.finishY,a=[0,0,0,0];if(0<o)for(var h=n;h<=r;h++)a[0]+=this.grid[h][o-1].length+this.grid[h][o].length-1;if(r<this.grid.length-1)for(h=o;h<=s;h++)a[1]+=this.grid[r+1][h].length+this.grid[r][h].length-1;if(s<this.grid[0].length-1)for(h=n;h<=r;h++)a[2]+=this.grid[h][s+1].length+this.grid[h][s].length-1;if(0<n)for(h=o;h<=s;h++)a[3]+=this.grid[n-1][h].length+this.grid[n][h].length-1;for(var d,c,u,p,f=m.MAX_VALUE,y=0;y<a.length;y++)a[y]<f?(f=a[y],d=1,c=y):a[y]==f&&d++;3==d&&0==f?0==a[0]&&0==a[1]&&0==a[2]?u=1:0==a[0]&&0==a[1]&&0==a[3]?u=0:0==a[0]&&0==a[2]&&0==a[3]?u=3:0==a[1]&&0==a[2]&&0==a[3]&&(u=2):u=2==d&&0==f?(p=Math.floor(2*Math.random()),0==a[0]&&0==a[1]?0==p?0:1:0==a[0]&&0==a[2]?0==p?0:2:0==a[0]&&0==a[3]?0==p?0:3:0==a[1]&&0==a[2]?0==p?1:2:0==a[1]&&0==a[3]?0==p?1:3:0==p?2:3):4==d&&0==f?p=Math.floor(4*Math.random()):c,0==u?e.setCenter(i.getCenterX(),i.getCenterY()-i.getHeight()/2-g.DEFAULT_EDGE_LENGTH-e.getHeight()/2):1==u?e.setCenter(i.getCenterX()+i.getWidth()/2+g.DEFAULT_EDGE_LENGTH+e.getWidth()/2,i.getCenterY()):2==u?e.setCenter(i.getCenterX(),i.getCenterY()+i.getHeight()/2+g.DEFAULT_EDGE_LENGTH+e.getHeight()/2):e.setCenter(i.getCenterX()-i.getWidth()/2-g.DEFAULT_EDGE_LENGTH-e.getWidth()/2,i.getCenterY())}},t.exports=A},991:(t,e,i)=>{var n,r=i(551).FDLayoutNode,o=i(551).IMath;function s(t,e,i,n){r.call(this,t,e,i,n)}for(n in s.prototype=Object.create(r.prototype),r)s[n]=r[n];s.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*o.sign(this.displacementY)),this.child&&0<this.child.getNodes().length&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},s.prototype.propogateDisplacementToChildren=function(t,e){for(var i,n=this.getChild().getNodes(),r=0;r<n.length;r++)null==(i=n[r]).getChild()?(i.displacementX+=t,i.displacementY+=e):i.propogateDisplacementToChildren(t,e)},s.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},s.prototype.setPred1=function(t){this.pred1=t},s.prototype.getPred1=function(){return pred1},s.prototype.getPred2=function(){return pred2},s.prototype.setNext=function(t){this.next=t},s.prototype.getNext=function(){return next},s.prototype.setProcessed=function(t){this.processed=t},s.prototype.isProcessed=function(){return processed},t.exports=s},902:(t,e,i)=>{function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var r=i(806),o=i(551).LinkedList,s=i(551).Matrix,a=i(551).SVD;function h(){}h.handleConstraints=function(t){for(var e={},i=(e.fixedNodeConstraint=t.constraints.fixedNodeConstraint,e.alignmentConstraint=t.constraints.alignmentConstraint,e.relativePlacementConstraint=t.constraints.relativePlacementConstraint,new Map),h=new Map,l=[],d=[],g=t.getAllNodes(),c=0,u=0;u<g.length;u++){var p=g[u];null==p.getChild()&&(h.set(p.id,c++),l.push(p.getCenterX()),d.push(p.getCenterY()),i.set(p.id,p))}function f(t,e,i,r,s){function a(){var n=y.shift();t.get(n).forEach((function(t){var o,s;p.get(t.id)<p.get(n)+t.gap&&(i&&i.has(t.id)?(void 0,s="horizontal"==e?h.has(t.id)?l[h.get(t.id)]:r.get(t.id):h.has(t.id)?d[h.get(t.id)]:r.get(t.id),p.set(t.id,s),s<p.get(n)+t.gap&&(o=p.get(n)+t.gap-s,f.get(n).forEach((function(t){p.set(t,p.get(t)-o)})))):p.set(t.id,p.get(n)+t.gap)),u.set(t.id,u.get(t.id)-1),0==u.get(t.id)&&y.push(t.id),i&&f.set(t.id,function(t,e){var i=new Set(t),n=!0,r=(t=!1,void 0);try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var a=o.value;i.add(a)}}catch(e){t=!0,r=e}finally{try{!n&&s.return&&s.return()}finally{if(t)throw r}}return i}(f.get(n),f.get(t.id)))}))}var g,c,u=new Map,p=(t.forEach((function(t,e){u.set(e,0)})),t.forEach((function(t,e){t.forEach((function(t){u.set(t.id,u.get(t.id)+1)}))})),new Map),f=new Map,y=new o;for(u.forEach((function(t,n){0==t?(y.push(n),i||("horizontal"==e?p.set(n,h.has(n)?l[h.get(n)]:r.get(n)):p.set(n,h.has(n)?d[h.get(n)]:r.get(n)))):p.set(n,Number.NEGATIVE_INFINITY),i&&f.set(n,new Set([n]))})),i&&s.forEach((function(t){var n,o,s=[];t.forEach((function(t){i.has(t)&&s.push(t)})),0<s.length?(n=0,s.forEach((function(t){"horizontal"==e?p.set(t,h.has(t)?l[h.get(t)]:r.get(t)):p.set(t,h.has(t)?d[h.get(t)]:r.get(t)),n+=p.get(t)})),n/=s.length,t.forEach((function(t){i.has(t)||p.set(t,n)}))):(o=0,t.forEach((function(t){o+="horizontal"==e?h.has(t)?l[h.get(t)]:r.get(t):h.has(t)?d[h.get(t)]:r.get(t)})),o/=t.length,t.forEach((function(t){p.set(t,o)})))}));0!=y.length;)a();return i&&(g=new Set,t.forEach((function(t,e){0==t.length&&g.add(e)})),c=[],f.forEach((function(t,e){if(g.has(e)){var r,o,s=!1,a=!0,h=(e=!1,void 0);try{for(var l,d=t[Symbol.iterator]();!(a=(l=d.next()).done);a=!0){var u=l.value;i.has(u)&&(s=!0)}}catch(s){e=!0,h=s}finally{try{!a&&d.return&&d.return()}finally{if(e)throw h}}s||(r=!1,o=void 0,c.forEach((function(e,i){e.has([].concat(n(t))[0])&&(r=!0,o=i)})),r?t.forEach((function(t){c[o].add(t)})):c.push(new Set(t)))}})),c.forEach((function(t,i){var n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,g=!0,c=!1,u=void 0;try{for(var f,y=t[Symbol.iterator]();!(g=(f=y.next()).done);g=!0){var m=f.value,v="horizontal"==e?h.has(m)?l[h.get(m)]:r.get(m):h.has(m)?d[h.get(m)]:r.get(m),E=p.get(m);v<n&&(n=v),s<v&&(s=v),E<o&&(o=E),a<E&&(a=E)}}catch(t){c=!0,u=t}finally{try{!g&&y.return&&y.return()}finally{if(c)throw u}}var N=(n+s)/2-(o+a)/2,T=!0;c=!1,u=void 0;try{for(var A,w=t[Symbol.iterator]();!(T=(A=w.next()).done);T=!0){var L=A.value;p.set(L,p.get(L)+N)}}catch(t){c=!0,u=t}finally{try{!T&&w.return&&w.return()}finally{if(c)throw u}}}))),p}function y(t){var e=0,i=0,n=0,r=0;if(t.forEach((function(t){t.left?0<=l[h.get(t.left)]-l[h.get(t.right)]?e++:i++:0<=d[h.get(t.top)]-d[h.get(t.bottom)]?n++:r++})),i<e&&r<n)for(var o=0;o<h.size;o++)l[o]=-1*l[o],d[o]=-1*d[o];else if(i<e)for(var s=0;s<h.size;s++)l[s]=-1*l[s];else if(r<n)for(var a=0;a<h.size;a++)d[a]=-1*d[a]}function m(t){var e=[],i=new o,n=new Set,r=0;return t.forEach((function(o,s){if(!n.has(s)){for(e[r]=[],i.push(a=s),n.add(a),e[r].push(a);0!=i.length;){var a=i.shift();t.get(a).forEach((function(t){n.has(t.id)||(i.push(t.id),n.add(t.id),e[r].push(t.id))}))}r++}})),e}function v(t){var e=new Map;return t.forEach((function(t,i){e.set(i,[])})),t.forEach((function(t,i){t.forEach((function(t){e.get(i).push(t),e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})}))})),e}function E(t){var e=new Map;return t.forEach((function(t,i){e.set(i,[])})),t.forEach((function(t,i){t.forEach((function(t){e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})}))})),e}e.relativePlacementConstraint&&e.relativePlacementConstraint.forEach((function(t){t.gap||0==t.gap||(t.left?t.gap=r.DEFAULT_EDGE_LENGTH+i.get(t.left).getWidth()/2+i.get(t.right).getWidth()/2:t.gap=r.DEFAULT_EDGE_LENGTH+i.get(t.top).getHeight()/2+i.get(t.bottom).getHeight()/2)}));var N,T=function(t){var e=0,i=0;return t.forEach((function(t){e+=l[h.get(t)],i+=d[h.get(t)]})),{x:e/t.size,y:i/t.size}},A=[],w=[],L=(t=!1,!1),C=new Set,I=new Map,_=new Map,M=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach((function(t){C.add(t.nodeId)})),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach((function(t){t.left?(I.has(t.left)?I.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):I.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),I.has(t.right)||I.set(t.right,[])):(I.has(t.top)?I.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):I.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),I.has(t.bottom)||I.set(t.bottom,[]))})),M=m(_=v(I))),r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(e.fixedNodeConstraint&&1<e.fixedNodeConstraint.length)e.fixedNodeConstraint.forEach((function(t,e){A[e]=[t.position.x,t.position.y],w[e]=[l[h.get(t.nodeId)],d[h.get(t.nodeId)]]})),t=!0;else if(e.alignmentConstraint){var x=0;if(e.alignmentConstraint.vertical){for(var O=e.alignmentConstraint.vertical,D=0;D<O.length;D++)!function(t){var e=new Set,i=(O[t].forEach((function(t){e.add(t)})),new Set([].concat(n(e)).filter((function(t){return C.has(t)})))),r=0<i.size?l[h.get(i.values().next().value)]:T(e).x;O[t].forEach((function(t){A[x]=[r,d[h.get(t)]],w[x]=[l[h.get(t)],d[h.get(t)]],x++}))}(D);t=!0}if(e.alignmentConstraint.horizontal){for(var R=e.alignmentConstraint.horizontal,b=0;b<R.length;b++)!function(t){var e=new Set,i=(R[t].forEach((function(t){e.add(t)})),new Set([].concat(n(e)).filter((function(t){return C.has(t)})))),r=0<i.size?l[h.get(i.values().next().value)]:T(e).y;R[t].forEach((function(t){A[x]=[l[h.get(t)],r],w[x]=[l[h.get(t)],d[h.get(t)]],x++}))}(b);t=!0}e.relativePlacementConstraint&&(L=!0)}else if(e.relativePlacementConstraint){for(var F,G,S,P,U,Y=0,k=0,H=0;H<M.length;H++)M[H].length>Y&&(Y=M[H].length,k=H);Y<_.size/2?(y(e.relativePlacementConstraint),L=t=!1):(F=new Map,G=new Map,S=[],M[k].forEach((function(t){I.get(t).forEach((function(e){"horizontal"==e.direction?(F.has(t)?F.get(t).push(e):F.set(t,[e]),F.has(e.id)||F.set(e.id,[]),S.push({left:t,right:e.id})):(G.has(t)?G.get(t).push(e):G.set(t,[e]),G.has(e.id)||G.set(e.id,[]),S.push({top:t,bottom:e.id}))}))})),y(S),L=!1,P=f(F,"horizontal"),U=f(G,"vertical"),M[k].forEach((function(t,e){w[e]=[l[h.get(t)],d[h.get(t)]],A[e]=[],P.has(t)?A[e][0]=P.get(t):A[e][0]=l[h.get(t)],U.has(t)?A[e][1]=U.get(t):A[e][1]=d[h.get(t)]})),t=!0)}if(t){for(var X=s.transpose(A),z=s.transpose(w),B=0;B<X.length;B++)X[B]=s.multGamma(X[B]),z[B]=s.multGamma(z[B]);_=s.multMat(X,s.transpose(z)),t=a.svd(_);for(var V=s.multMat(t.V,s.transpose(t.U)),W=0;W<h.size;W++){var j=[l[W],d[W]],q=[V[0][0],V[1][0]],$=[V[0][1],V[1][1]];l[W]=s.dotProduct(j,q),d[W]=s.dotProduct(j,$)}L&&y(e.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(e.fixedNodeConstraint&&0<e.fixedNodeConstraint.length&&(N={x:0,y:0},e.fixedNodeConstraint.forEach((function(t,e){var i=l[h.get(t.nodeId)],n=d[h.get(t.nodeId)];t={x:(t=t.position).x-i,y:t.y-n};N.x+=t.x,N.y+=t.y})),N.x/=e.fixedNodeConstraint.length,N.y/=e.fixedNodeConstraint.length,l.forEach((function(t,e){l[e]+=N.x})),d.forEach((function(t,e){d[e]+=N.y})),e.fixedNodeConstraint.forEach((function(t){l[h.get(t.nodeId)]=t.position.x,d[h.get(t.nodeId)]=t.position.y}))),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var Z=e.alignmentConstraint.vertical,Q=0;Q<Z.length;Q++)!function(t){var e=new Set,i=(t=(Z[t].forEach((function(t){e.add(t)})),new Set([].concat(n(e)).filter((function(t){return C.has(t)})))),0<t.size?l[h.get(t.values().next().value)]:T(e).x);e.forEach((function(t){C.has(t)||(l[h.get(t)]=i)}))}(Q);if(e.alignmentConstraint.horizontal)for(var J=e.alignmentConstraint.horizontal,K=0;K<J.length;K++)!function(t){var e=new Set,i=(t=(J[t].forEach((function(t){e.add(t)})),new Set([].concat(n(e)).filter((function(t){return C.has(t)})))),0<t.size?d[h.get(t.values().next().value)]:T(e).y);e.forEach((function(t){C.has(t)||(d[h.get(t)]=i)}))}(K)}if(e.relativePlacementConstraint){var tt=new Map,et=new Map,it=new Map,nt=new Map,rt=new Map,ot=new Map,st=new Set,at=new Set;if(C.forEach((function(t){st.add(t),at.add(t)})),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var ht=e.alignmentConstraint.vertical,lt=0;lt<ht.length;lt++)!function(t){it.set("dummy"+t,[]),ht[t].forEach((function(e){tt.set(e,"dummy"+t),it.get("dummy"+t).push(e),C.has(e)&&st.add("dummy"+t)})),rt.set("dummy"+t,l[h.get(ht[t][0])])}(lt);if(e.alignmentConstraint.horizontal)for(var dt=e.alignmentConstraint.horizontal,gt=0;gt<dt.length;gt++)!function(t){nt.set("dummy"+t,[]),dt[t].forEach((function(e){et.set(e,"dummy"+t),nt.get("dummy"+t).push(e),C.has(e)&&at.add("dummy"+t)})),ot.set("dummy"+t,d[h.get(dt[t][0])])}(gt)}var ct=new Map,ut=new Map,pt=!0;_=!1,t=void 0;try{for(var ft,yt=I.keys()[Symbol.iterator]();!(pt=(ft=yt.next()).done);pt=!0)!function(t){I.get(t).forEach((function(e){var i=void 0,n=void 0;"horizontal"==e.direction?(i=tt.get(t)?tt.get(t):t,n=tt.get(e.id)?{id:tt.get(e.id),gap:e.gap,direction:e.direction}:e,ct.has(i)?ct.get(i).push(n):ct.set(i,[n]),ct.has(n.id)||ct.set(n.id,[])):(i=et.get(t)?et.get(t):t,n=et.get(e.id)?{id:et.get(e.id),gap:e.gap,direction:e.direction}:e,ut.has(i)?ut.get(i).push(n):ut.set(i,[n]),ut.has(n.id)||ut.set(n.id,[]))}))}(ft.value)}catch(e){_=!0,t=e}finally{try{!pt&&yt.return&&yt.return()}finally{if(_)throw t}}_=v(ct),t=v(ut),_=m(_),t=m(t);var mt=E(ct),vt=E(ut),Et=[],Nt=[],Tt=(_.forEach((function(t,e){Et[e]=[],t.forEach((function(t){0==mt.get(t).length&&Et[e].push(t)}))})),t.forEach((function(t,e){Nt[e]=[],t.forEach((function(t){0==vt.get(t).length&&Nt[e].push(t)}))})),f(ct,"horizontal",st,rt,Et)),At=f(ut,"vertical",at,ot,Nt),wt=!0;_=!1,t=void 0;try{for(var Lt,Ct=Tt.keys()[Symbol.iterator]();!(wt=(Lt=Ct.next()).done);wt=!0)!function(t){it.get(t)?it.get(t).forEach((function(e){l[h.get(e)]=Tt.get(t)})):l[h.get(t)]=Tt.get(t)}(Lt.value)}catch(e){_=!0,t=e}finally{try{!wt&&Ct.return&&Ct.return()}finally{if(_)throw t}}var It=!0;_=!1,t=void 0;try{for(var _t,Mt=At.keys()[Symbol.iterator]();!(It=(_t=Mt.next()).done);It=!0)!function(t){nt.get(t)?nt.get(t).forEach((function(e){d[h.get(e)]=At.get(t)})):d[h.get(t)]=At.get(t)}(_t.value)}catch(e){_=!0,t=e}finally{try{!It&&Mt.return&&Mt.return()}finally{if(_)throw t}}}}for(var xt=0;xt<g.length;xt++){var Ot=g[xt];null==Ot.getChild()&&Ot.setCenter(l[h.get(Ot.id)],d[h.get(Ot.id)])}},t.exports=h},551:e=>{e.exports=t}},i={},function t(n){var r=i[n];return void 0===r&&(r=i[n]={exports:{}},e[n](r,r.exports,t)),r.exports}(45);var e,i},D.exports=t(function(){var t;return _||(_=1,t=function(){return e=[function(t,e,i){function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_HALF_SIZE=(n.SIMPLE_NODE_SIZE=40)/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.INITIAL_WORLD_BOUNDARY=(n.WORLD_BOUNDARY=1e6)/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,i){var n,r=i(2),o=i(8),s=i(9);function a(t,e,i){r.call(this,i),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=i,this.bendpoints=[],this.source=t,this.target=e}for(n in a.prototype=Object.create(r.prototype),r)a[n]=r[n];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(t,e){for(var i=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(i.getOwner()==e)return i;if(i.getOwner()==n)break;i=i.getOwner().getParent()}return null},a.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=a},function(t,e,i){t.exports=function(t){this.vGraphObject=t}},function(t,e,i){var n,r=i(2),o=i(10),s=i(13),a=i(0),h=i(16),l=i(5);function d(t,e,i,n){r.call(this,n=null==i&&null==n?e:n),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=n,this.edges=[],this.graphManager=t,this.rect=null!=i&&null!=e?new s(e.x,e.y,i.width,i.height):new s}for(n in d.prototype=Object.create(r.prototype),r)d[n]=r[n];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(t){this.rect.width=t},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(t){this.rect.height=t},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},d.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},d.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},d.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},d.prototype.getEdgeListToNode=function(t){var e=[],i=this;return i.edges.forEach((function(n){if(n.target==t){if(n.source!=i)throw"Incorrect edge source!";e.push(n)}})),e},d.prototype.getEdgesBetween=function(t){var e=[],i=this;return i.edges.forEach((function(n){if(n.source!=i&&n.target!=i)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)})),e},d.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(i){if(i.source==e)t.add(i.target);else{if(i.target!=e)throw"Incorrect incidency!";t.add(i.source)}})),t},d.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),i=0;i<e.length;i++)e[i].withChildren().forEach((function(e){t.add(e)}));return t},d.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),i=0;i<e.length;i++)t+=e[i].getNoOfChildren();return 0==t?1:t},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return null==this.child?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)},d.prototype.scatter=function(){var t=-a.INITIAL_WORLD_BOUNDARY,e=a.INITIAL_WORLD_BOUNDARY,i=(e=a.WORLD_CENTER_X+h.nextDouble()*(e-t)+t,t=-a.INITIAL_WORLD_BOUNDARY,a.INITIAL_WORLD_BOUNDARY);i=a.WORLD_CENTER_Y+h.nextDouble()*(i-t)+t,this.rect.x=e,this.rect.y=i},d.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";var t,e;0!=this.getChild().getNodes().length&&((e=this.getChild()).updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),a.NODE_DIMENSIONS_INCLUDE_LABELS)&&(t=e.getRight()-e.getLeft(),e=e.getBottom()-e.getTop(),this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(t+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>t?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight)&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(e+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>e?(this.rect.y-=(this.labelHeight-e)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(e+this.labelHeight))},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(t){var e=((e=this.rect.x)>a.WORLD_BOUNDARY?e=a.WORLD_BOUNDARY:e<-a.WORLD_BOUNDARY&&(e=-a.WORLD_BOUNDARY),(i=this.rect.y)>a.WORLD_BOUNDARY?i=a.WORLD_BOUNDARY:i<-a.WORLD_BOUNDARY&&(i=-a.WORLD_BOUNDARY),new l(e,i)),i=t.inverseTransformPoint(e);this.setLocation(i.x,i.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=d},function(t,e,i){var n,r=i(0);function o(){}for(n in r)o[n]=r[n];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT=3*(o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100),o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=o},function(t,e,i){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,i){var n,r=i(2),o=i(10),s=i(0),a=i(7),h=i(3),l=i(1),d=i(13),g=i(12),c=i(11);function u(t,e,i){r.call(this,i),this.estimatedSize=o.MIN_VALUE,this.margin=s.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof a?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(n in u.prototype=Object.create(r.prototype),r)u[n]=r[n];u.prototype.getNodes=function(){return this.nodes},u.prototype.getEdges=function(){return this.edges},u.prototype.getGraphManager=function(){return this.graphManager},u.prototype.getParent=function(){return this.parent},u.prototype.getLeft=function(){return this.left},u.prototype.getRight=function(){return this.right},u.prototype.getTop=function(){return this.top},u.prototype.getBottom=function(){return this.bottom},u.prototype.isConnected=function(){return this.isConnected},u.prototype.add=function(t,e,i){if(null==e&&null==i){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(-1<this.getNodes().indexOf(n))throw"Node already in graph!";return(n.owner=this).getNodes().push(n),n}if(n=t,!(-1<this.getNodes().indexOf(e)&&-1<this.getNodes().indexOf(i)))throw"Source or target not in graph!";if(e.owner!=i.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=i.owner?null:(n.source=e,n.target=i,n.isInterGraph=!1,this.getEdges().push(n),e.edges.push(n),i!=e&&i.edges.push(n),n)},u.prototype.remove=function(t){var e=t;if(t instanceof h){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var i,n=e.edges.slice(),r=n.length,o=0;o<r;o++)((i=n[o]).isInterGraph?this.graphManager:i.source.owner).remove(i);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof l){if(null==(i=t))throw"Edge is null!";if(null==i.source||null==i.target)throw"Source and/or target is null!";if(null==i.source.owner||null==i.target.owner||i.source.owner!=this||i.target.owner!=this)throw"Source and/or target owner is invalid!";var s;if(e=i.source.edges.indexOf(i),t=i.target.edges.indexOf(i),!(-1<e&&-1<t))throw"Source and/or target doesn't know this edge!";if(i.source.edges.splice(e,1),i.target!=i.source&&i.target.edges.splice(t,1),-1==(s=i.source.owner.getEdges().indexOf(i)))throw"Not in owner's edge list!";i.source.owner.getEdges().splice(s,1)}},u.prototype.updateLeftTop=function(){for(var t,e=o.MAX_VALUE,i=o.MAX_VALUE,n=this.getNodes(),r=n.length,s=0;s<r;s++){var a,h=n[s];(a=h.getTop())<e&&(e=a),(a=h.getLeft())<i&&(i=a)}return e==o.MAX_VALUE?null:(t=null!=n[0].getParent().paddingLeft?n[0].getParent().paddingLeft:this.margin,this.left=i-t,this.top=e-t,new g(this.left,this.top))},u.prototype.updateBounds=function(t){for(var e,i,n=o.MAX_VALUE,r=-o.MAX_VALUE,s=o.MAX_VALUE,a=-o.MAX_VALUE,h=this.nodes,l=h.length,g=0;g<l;g++){var c=h[g];t&&null!=c.child&&c.updateBounds(),(e=c.getLeft())<n&&(n=e),r<(e=c.getRight())&&(r=e),(e=c.getTop())<s&&(s=e),a<(e=c.getBottom())&&(a=e)}var u=new d(n,s,r-n,a-s);n==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),i=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=u.x-i,this.right=u.x+u.width+i,this.top=u.y-i,this.bottom=u.y+u.height+i},u.calculateBounds=function(t){for(var e=o.MAX_VALUE,i=-o.MAX_VALUE,n=o.MAX_VALUE,r=-o.MAX_VALUE,s=t.length,a=0;a<s;a++){var h,l=t[a];(h=l.getLeft())<e&&(e=h),i<(h=l.getRight())&&(i=h),(h=l.getTop())<n&&(n=h),r<(h=l.getBottom())&&(r=h)}return new d(e,n,i-e,r-n)},u.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,i=e.length,n=0;n<i;n++)t+=e[n].calcEstimatedSize();return this.estimatedSize=0==t?s.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},u.prototype.updateConnected=function(){var t=this;if(0==this.nodes.length)this.isConnected=!0;else{var e,i=new c,n=new Set,r=this.nodes[0];for(r.withChildren().forEach((function(t){i.push(t),n.add(t)}));0!==i.length;)for(var o,s,a=(o=(r=i.shift()).getEdges()).length,h=0;h<a;h++)null==(s=o[h].getOtherEndInGraph(r,this))||n.has(s)||s.withChildren().forEach((function(t){i.push(t),n.add(t)}));this.isConnected=!1,n.size>=this.nodes.length&&(e=0,n.forEach((function(i){i.owner==t&&e++})),e==this.nodes.length)&&(this.isConnected=!0)}},t.exports=u},function(t,e,i){var n,r=i(1);function o(t){n=i(6),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null);return t=this.add(t,e),this.setRootGraph(t),this.rootGraph},o.prototype.add=function(t,e,i,n,r){if(null==i&&null==n&&null==r){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(-1<this.graphs.indexOf(t))throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return(t.parent=e).child=t}if(r=i,i=t,t=(n=e).getOwner(),e=r.getOwner(),null==t||t.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==e||e.getGraphManager()!=this)throw"Target not in this graph mgr!";if(t==e)return i.isInterGraph=!1,t.add(i,n,r);if(i.isInterGraph=!0,i.source=n,i.target=r,-1<this.edges.indexOf(i))throw"Edge already in inter-graph edge list!";if(this.edges.push(i),null==i.source||null==i.target)throw"Edge source and/or target is null!";if(-1!=i.source.edges.indexOf(i)||-1!=i.target.edges.indexOf(i))throw"Edge already in source and/or target incidency list!";return i.source.edges.push(i),i.target.edges.push(i),i},o.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var i,o=[],s=(o=o.concat(e.getEdges())).length,a=0;a<s;a++)i=o[a],e.remove(i);var h,l=[];for(s=(l=l.concat(e.getNodes())).length,a=0;a<s;a++)h=l[a],e.remove(h);e==this.rootGraph&&this.setRootGraph(null);var d=this.graphs.indexOf(e);this.graphs.splice(d,1),e.parent=null}else if(t instanceof r){if(null==(i=t))throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(null==i.source||null==i.target)throw"Source and/or target is null!";if(-1==i.source.edges.indexOf(i)||-1==i.target.edges.indexOf(i))throw"Source and/or target doesn't know this edge!";if(d=i.source.edges.indexOf(i),i.source.edges.splice(d,1),d=i.target.edges.indexOf(i),i.target.edges.splice(d,1),null==i.source.owner||null==i.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==i.source.owner.getGraphManager().edges.indexOf(i))throw"Not in owner graph manager's edge list!";d=i.source.owner.getGraphManager().edges.indexOf(i),i.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),i=e.length,n=0;n<i;n++)t=t.concat(e[n].getNodes());this.allNodes=t}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var i=0;i<e.length;i++)t=t.concat(e[i].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";null==(this.rootGraph=t).parent&&(t.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var i,n=t.getOwner();null!=(i=n.getParent());){if(i==e)return!0;if(null==(n=i.getOwner()))break}for(n=e.getOwner();null!=(i=n.getParent());){if(i==t)return!0;if(null==(n=i.getOwner()))break}return!1},o.prototype.calcLowestCommonAncestors=function(){for(var t,e,i,n,r,o=this.getAllEdges(),s=o.length,a=0;a<s;a++)if(e=(t=o[a]).source,i=t.target,t.lca=null,(t.sourceInLca=e)==(t.targetInLca=i))t.lca=e.getOwner();else{for(n=e.getOwner();null==t.lca;){for(r=(t.targetInLca=i).getOwner();null==t.lca;){if(r==n){t.lca=r;break}if(r==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=r.getParent(),r=t.targetInLca.getOwner()}if(n==this.rootGraph)break;null==t.lca&&(t.sourceInLca=n.getParent(),n=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var i=t.getOwner();null!=i;){for(var n=e.getOwner();null!=n;){if(n==i)return n;n=n.getParent().getOwner()}i=i.getParent().getOwner()}return i},o.prototype.calcInclusionTreeDepths=function(t,e){null==t&&null==e&&(t=this.rootGraph,e=1);for(var i,n=t.getNodes(),r=n.length,o=0;o<r;o++)(i=n[o]).inclusionTreeDepth=e,null!=i.child&&this.calcInclusionTreeDepths(i.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var t,e=[],i=this.edges.length,n=0;n<i;n++)t=this.edges[n],this.isOneAncestorOfOther(t.source,t.target)&&e.push(t);for(n=0;n<e.length;n++)this.remove(e[n]);return!1},t.exports=o},function(t,e,i){var n=i(12);function r(){}r.calcSeparationAmount=function(t,e,i,n){if(!t.intersects(e))throw"assert failed";var r=new Array(2),o=(this.decideDirectionsForOverlappingNodes(t,e,r),i[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),i[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?i[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(i[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?i[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(i[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom())),Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX())));e=(o=e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()?1:o)*i[0],t=i[1]/o,i[0]<t?t=i[0]:e=i[1],i[0]=-1*r[0]*(t/2+n),i[1]=-1*r[1]*(e/2+n)},r.decideDirectionsForOverlappingNodes=function(t,e,i){t.getCenterX()<e.getCenterX()?i[0]=-1:i[0]=1,t.getCenterY()<e.getCenterY()?i[1]=-1:i[1]=1},r.getIntersection2=function(t,e,i){var n=t.getCenterX(),r=t.getCenterY(),o=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return i[0]=n,i[1]=r,i[2]=o,i[3]=s,!0;var a=t.getX(),h=t.getY(),l=t.getRight(),d=t.getX(),g=t.getBottom(),c=t.getRight(),u=t.getWidthHalf(),p=t.getHeightHalf(),f=e.getX(),y=e.getY(),m=e.getRight(),v=e.getX(),E=e.getBottom(),N=e.getRight(),T=e.getWidthHalf(),A=e.getHeightHalf(),w=!1,L=!1;if(n===o){if(s<r)return i[0]=n,i[1]=h,i[2]=o,i[3]=E,!1;r<s&&(i[0]=n,i[1]=g,i[2]=o,i[3]=y)}else if(r===s){if(o<n)return i[0]=a,i[1]=r,i[2]=m,i[3]=s,!1;n<o&&(i[0]=l,i[1]=r,i[2]=f,i[3]=s)}else{t=t.height/t.width,e=e.height/e.width;var C,I=(s-r)/(o-n),_=void 0,M=void 0,x=void 0;if(-t==I?(o<n?(i[0]=d,i[1]=g):(i[0]=l,i[1]=h),w=!0):t==I&&(o<n?(i[0]=a,i[1]=h):(i[0]=c,i[1]=g),w=!0),-e==I?(n<o?(i[2]=v,i[3]=E):(i[2]=m,i[3]=y),L=!0):e==I&&(n<o?(i[2]=f,i[3]=y):(i[2]=N,i[3]=E),L=!0),w&&L)return!1;if(C=o<n?s<r?(_=this.getCardinalDirection(t,I,4),this.getCardinalDirection(e,I,2)):(_=this.getCardinalDirection(-t,I,3),this.getCardinalDirection(-e,I,1)):s<r?(_=this.getCardinalDirection(-t,I,1),this.getCardinalDirection(-e,I,3)):(_=this.getCardinalDirection(t,I,2),this.getCardinalDirection(e,I,4)),!w)switch(_){case 1:M=h,i[0]=n+-p/I,i[1]=M;break;case 2:M=r+u*I,i[0]=c,i[1]=M;break;case 3:M=g,i[0]=n+p/I,i[1]=M;break;case 4:M=r+-u*I,i[0]=d,i[1]=M}if(!L)switch(C){case 1:x=y,i[2]=o+-A/I,i[3]=x;break;case 2:x=s+T*I,i[2]=N,i[3]=x;break;case 3:x=E,i[2]=o+A/I,i[3]=x;break;case 4:x=s+-T*I,i[2]=v,i[3]=x}}return!1},r.getCardinalDirection=function(t,e,i){return e<t?i:1+i%4},r.getIntersection=function(t,e,i,r){var o,s,a,h,l,d,g,c,u,p,f;return null==r?this.getIntersection2(t,e,i):(o=t.x,t=t.y,s=e.x,e=e.y,a=i.x,i=i.y,p=g=void 0,0==(f=(l=e-t)*(u=a-(h=r.x))-(c=(r=r.y)-i)*(d=o-s))?null:new n((d*(p=h*i-a*r)-u*(g=s*t-o*e))/f,(c*g-l*p)/f))},r.angleOfVector=function(t,e,i,n){var r=void 0;return t!==i?(r=Math.atan((n-e)/(i-t)),i<t?r+=Math.PI:n<e&&(r+=this.TWO_PI)):r=n<e?this.ONE_AND_HALF_PI:this.HALF_PI,r},r.doIntersect=function(t,e,i,n){var r=t.x,o=(t=t.y,e.x),s=(e=e.y,i.x),a=(i=i.y,n.x),h=(o-r)*((n=n.y)-i)-(a-s)*(e-t);return 0!=h&&(e=((t-e)*(a-r)+(o-r)*(n-t))/h,0<(o=((n-i)*(a-r)+(s-a)*(n-t))/h))&&o<1&&0<e&&e<1},r.findCircleLineIntersections=function(t,e,i,n,r,o,s){var a=(i-t)*(i-t)+(n-e)*(n-e);return 0<=(i=2*((t-r)*(i-t)+(e-o)*(n-e)))*i-4*a*(n=(t-r)*(t-r)+(e-o)*(e-o)-s*s)?(t=(-i+Math.sqrt(i*i-4*a*n))/(2*a),r=(-i-Math.sqrt(i*i-4*a*n))/(2*a),0<=t&&t<=1?[t]:0<=r&&r<=1?[r]:null):null},r.HALF_PI=.5*Math.PI,r.ONE_AND_HALF_PI=1.5*Math.PI,r.TWO_PI=2*Math.PI,r.THREE_PI=3*Math.PI,t.exports=r},function(t,e,i){function n(){}n.sign=function(t){return 0<t?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,i){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,i){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t){return{value:t,next:null,prev:null}}function o(t,e,i,n){return null!==t?t.next=e:n.head=e,null!==i?i.prev=e:n.tail=e,e.prev=t,e.next=i,n.length++,e}function s(t,e){var i=t.prev,n=t.next;return null!==i?i.next=n:e.head=n,null!==n?n.prev=i:e.tail=i,t.prev=t.next=null,e.length--,t}function a(t){var e=this;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");this.length=0,this.head=null,(this.tail=null)!=t&&t.forEach((function(t){return e.push(t)}))}(function(t,e,i){e&&n(t.prototype,e)})(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,e){return o(e.prev,r(t),e,this)}},{key:"insertAfter",value:function(t,e){return o(e,r(t),e.next,this)}},{key:"insertNodeBefore",value:function(t,e){return o(e.prev,t,e,this)}},{key:"insertNodeAfter",value:function(t,e){return o(e,t,e.next,this)}},{key:"push",value:function(t){return o(this.tail,r(t),null,this)}},{key:"unshift",value:function(t){return o(null,r(t),this.head,this)}},{key:"remove",value:function(t){return s(t,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var e=1,i=this.head;e<t;)i=i.next,e++;return i.value}}},{key:"set_object_at",value:function(t,e){if(t<=this.length()){for(var i=1,n=this.head;i<t;)n=n.next,i++;n.value=e}}}]),t.exports=a},function(t,e,i){function n(t,e,i){this.x=null,(this.y=null)==t&&null==e&&null==i?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==i?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==i&&(this.x=(i=t).x,this.y=i.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(t,e,i){"Point"==t.constructor.name&&null==e&&null==i?this.setLocation((i=t).x,i.y):"number"==typeof t&&"number"==typeof e&&null==i&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},n.prototype.move=function(t,e){this.x=t,this.y=e},n.prototype.translate=function(t,e){this.x+=t,this.y+=e},n.prototype.equals=function(t){return"Point"==t.constructor.name?this.x==t.x&&this.y==t.y:this==t},n.prototype.toString=function(){return(new n).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n},function(t,e,i){function n(t,e,i,n){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=i&&null!=n&&(this.x=t,this.y=e,this.width=i,this.height=n)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(t){this.x=t},n.prototype.getY=function(){return this.y},n.prototype.setY=function(t){this.y=t},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},t.exports=n},function(t,e,i){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function r(){}r.lastID=0,r.createID=function(t){return r.isPrimitive(t)?t:(null==t.uniqueID&&(t.uniqueID=r.getString(),r.lastID++),t.uniqueID)},r.getString=function(t){return"Object#"+(null==t?r.lastID:t)},r.isPrimitive=function(t){var e=void 0===t?"undefined":n(t);return null==t||"object"!=e&&"function"!=e},t.exports=r},function(t,e,i){function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var r=i(0),o=i(7),s=i(3),a=i(1),h=i(6),l=i(5),d=i(17),g=i(29);function c(t){g.call(this),this.layoutQuality=r.QUALITY,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=r.DEFAULT_INCREMENTAL,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}c.RANDOM_SEED=1,(c.prototype=Object.create(g.prototype)).getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t},c.prototype.newGraph=function(t){return new h(null,this.graphManager,t)},c.prototype.newNode=function(t){return new s(this.graphManager,t)},c.prototype.newEdge=function(t){return new a(null,null,t)},c.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==r.ANIMATE&&(t&&!this.isSubLayout&&this.doPostLayout(),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var i=this.graphManager.getRoot().getNodes();for(e=0;e<i.length;e++)i[e];this.update(this.graphManager.getRoot())}},c.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){var e=t;if(null!=e.getChild())for(var i=e.getChild().getNodes(),n=0;n<i.length;n++)update(i[n]);null!=e.vGraphObject&&e.vGraphObject.update(e)}else t instanceof a?null!=t.vGraphObject&&t.vGraphObject.update(t):t instanceof h&&null!=t.vGraphObject&&t.vGraphObject.update(t)},c.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=r.QUALITY,this.animationDuringLayout=r.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=r.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=r.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=r.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=r.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=r.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},c.prototype.transform=function(t){if(null==t)this.transform(new l(0,0));else{var e=new d,i=this.graphManager.getRoot().updateLeftTop();if(null!=i){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(i.x),e.setDeviceOrgY(i.y);for(var n=this.getAllNodes(),r=0;r<n.length;r++)n[r].transform(e)}}},c.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,i,n=t.getNodes(),r=0;r<n.length;r++)null==(i=(e=n[r]).getChild())||0==i.getNodes().length?e.scatter():(this.positionNodesRandomly(i),e.updateBounds())},c.prototype.getFlatForest=function(){for(var t=[],e=!0,i=this.graphManager.getRoot().getNodes(),r=!0,o=0;o<i.length;o++)null!=i[o].getChild()&&(r=!1);if(r)for(var s=new Set,a=[],h=new Map,l=(l=[]).concat(i);0<l.length&&e;){for(a.push(l[0]);0<a.length&&e;){var d=a[0],g=(a.splice(0,1),s.add(d),d.getEdges());for(o=0;o<g.length;o++){var c=g[o].getOtherEnd(d);if(h.get(d)!=c){if(s.has(c)){e=!1;break}a.push(c),h.set(c,d)}}}if(e){var u=[].concat(n(s));for(t.push(u),o=0;o<u.length;o++){var p=u[o];-1<(p=l.indexOf(p))&&l.splice(p,1)}s=new Set,h=new Map}else t=[]}return t},c.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],i=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),r=0;r<t.bendpoints.length;r++){var o=this.newNode(null),s=(o.setRect(new Point(0,0),new Dimension(1,1)),n.add(o),this.newEdge(null));this.graphManager.add(s,i,o),e.add(o),i=o}return s=this.newEdge(null),this.graphManager.add(s,i,t.target),this.edgeToDummyNodes.set(t,e),(t.isInterGraph()?this.graphManager:n).remove(t),e},c.prototype.createBendpointsFromDummyNodes=function(){var t=(t=[]).concat(this.graphManager.getAllEdges());t=[].concat(n(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var i=t[e];if(0<i.bendpoints.length){for(var r=this.edgeToDummyNodes.get(i),o=0;o<r.length;o++){var s=r[o],a=new l(s.getCenterX(),s.getCenterY()),h=i.bendpoints.get(o);h.x=a.x,h.y=a.y,s.getOwner().remove(s)}this.graphManager.add(i,i.source,i.target)}}},c.transform=function(t,e,i,n){var r,o;return null!=i&&null!=n?(r=e,t<=50?r-=(e-e/i)/50*(50-t):r+=(e*n-e)/50*(t-50),r):(i=t<=50?(o=9*e/500,e/10):(o=9*e/50,-8*e),o*t+i)},c.findCenterOfTree=function(t){var e=(e=[]).concat(t),i=[],n=new Map,r=!1,o=null;1!=e.length&&2!=e.length||(r=!0,o=e[0]);for(var s=0;s<e.length;s++){var a=(l=e[s]).getNeighborsList().size;n.set(l,l.getNeighborsList().size),1==a&&i.push(l)}for(h=(h=[]).concat(i);!r;){[].concat(h);var h=[];for(s=0;s<e.length;s++){var l=e[s],d=e.indexOf(l);0<=d&&e.splice(d,1),l.getNeighborsList().forEach((function(t){var e;i.indexOf(t)<0&&(1==(e=n.get(t)-1)&&h.push(t),n.set(t,e))}))}i=i.concat(h),1!=e.length&&2!=e.length||(r=!0,o=e[0])}return o},c.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=c},function(t,e,i){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return(n.x=1e4*Math.sin(n.seed++))-Math.floor(n.x)},t.exports=n},function(t,e,i){var n=i(5);function r(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}r.prototype.getWorldOrgX=function(){return this.lworldOrgX},r.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},r.prototype.getWorldOrgY=function(){return this.lworldOrgY},r.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},r.prototype.getWorldExtX=function(){return this.lworldExtX},r.prototype.setWorldExtX=function(t){this.lworldExtX=t},r.prototype.getWorldExtY=function(){return this.lworldExtY},r.prototype.setWorldExtY=function(t){this.lworldExtY=t},r.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},r.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},r.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},r.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},r.prototype.getDeviceExtX=function(){return this.ldeviceExtX},r.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},r.prototype.getDeviceExtY=function(){return this.ldeviceExtY},r.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},r.prototype.transformX=function(t){var e=0,i=this.lworldExtX;return 0!=i?this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/i:e},r.prototype.transformY=function(t){var e=0,i=this.lworldExtY;return 0!=i?this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/i:e},r.prototype.inverseTransformX=function(t){var e=0,i=this.ldeviceExtX;return 0!=i?this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/i:e},r.prototype.inverseTransformY=function(t){var e=0,i=this.ldeviceExtY;return 0!=i?this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/i:e},r.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=r},function(t,e,i){var n,r=i(15),o=i(4),s=i(0),a=i(8),h=i(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}for(n in l.prototype=Object.create(r.prototype),r)l[n]=r[n];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var t,e,i,n,r,a,h=this.getGraphManager().getAllEdges(),l=0;l<h.length;l++)e=(t=h[l]).idealLength,t.isInterGraph&&(i=t.getSource(),n=t.getTarget(),r=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=r+a-2*s.SIMPLE_NODE_SIZE),r=t.getLca().getInclusionTreeDepth(),t.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(i.getInclusionTreeDepth()+n.getInclusionTreeDepth()-2*r))},l.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),i=0;i<e.length;i++)t=e[i],this.calcSpringForce(t,t.idealLength)},l.prototype.calcRepulsionForces=function(){var t,e,i,n,r,s=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],a=1<arguments.length&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),r=new Set,t=0;t<h.length;t++)i=h[t],this.calculateRepulsionForceOfANode(i,r,s,a),r.add(i);else for(t=0;t<h.length;t++)for(i=h[t],e=t+1;e<h.length;e++)n=h[e],i.getOwner()==n.getOwner()&&this.calcRepulsionForce(i,n)},l.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),i=0;i<e.length;i++)t=e[i],this.calcGravitationalForce(t)},l.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},l.prototype.calcSpringForce=function(t,e){var i,n,r=t.getSource(),o=t.getTarget();if(this.uniformLeafNodeSizes&&null==r.getChild()&&null==o.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(i=t.getLength())&&(n=(e=t.edgeElasticity*(i-e))*(t.lengthX/i),e*=t.lengthY/i,r.springForceX+=n,r.springForceY+=e,o.springForceX-=n,o.springForceY-=e)},l.prototype.calcRepulsionForce=function(t,e){var i,n,r,s=t.getRect(),l=e.getRect(),d=new Array(2),g=new Array(4);s.intersects(l)?(a.calcSeparationAmount(s,l,d,o.DEFAULT_EDGE_LENGTH/2),n=2*d[0],r=2*d[1],d=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren),t.repulsionForceX-=d*n,t.repulsionForceY-=d*r,e.repulsionForceX+=d*n,e.repulsionForceY+=d*r):(d=this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(i=l.getCenterX()-s.getCenterX(),l.getCenterY()-s.getCenterY()):(a.getIntersection(s,l,g),i=g[2]-g[0],g[3]-g[1]),s=(i=Math.abs(i)<o.MIN_REPULSION_DIST?h.sign(i)*o.MIN_REPULSION_DIST:i)*i+(d=Math.abs(d)<o.MIN_REPULSION_DIST?h.sign(d)*o.MIN_REPULSION_DIST:d)*d,l=Math.sqrt(s),r=(g=(t.nodeRepulsion/2+e.nodeRepulsion/2)*t.noOfChildren*e.noOfChildren/s)*d/l,t.repulsionForceX-=n=g*i/l,t.repulsionForceY-=r,e.repulsionForceX+=n,e.repulsionForceY+=r)},l.prototype.calcGravitationalForce=function(t){var e,i=t.getOwner(),n=(i.getRight()+i.getLeft())/2,r=(i.getTop()+i.getBottom())/2,o=(n=t.getCenterX()-n,r=t.getCenterY()-r,Math.abs(n)+t.getWidth()/2),s=Math.abs(r)+t.getHeight()/2;t.getOwner()==this.graphManager.getRoot()?((e=i.getEstimatedSize()*this.gravityRangeFactor)<o||e<s)&&(t.gravitationForceX=-this.gravityConstant*n,t.gravitationForceY=-this.gravityConstant*r):((e=i.getEstimatedSize()*this.compoundGravityRangeFactor)<o||e<s)&&(t.gravitationForceX=-this.gravityConstant*n*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*r*this.compoundGravityConstant)},l.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},l.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},l.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)(t=e[i]).noOfChildren=t.getNoOfChildren()},l.prototype.calcGrid=function(t){for(var e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),i=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange)),n=new Array(e),r=0;r<e;r++)n[r]=new Array(i);for(r=0;r<e;r++)for(var o=0;o<i;o++)n[r][o]=new Array;return n},l.prototype.addNodeToGrid=function(t,e,i){for(var n=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),r=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().y-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-i)/this.repulsionRange)),a=n;a<=r;a++)for(var h=o;h<=s;h++)this.grid[a][h].push(t),t.setGridCoordinates(n,r,o,s)},l.prototype.updateGrid=function(){var t,e,i=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<i.length;t++)e=i[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},l.prototype.calculateRepulsionForceOfANode=function(t,e,i,n){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i||n){for(var r=new Set,s=(t.surrounding=new Array,this.grid),a=t.startX-1;a<t.finishX+2;a++)for(var h=t.startY-1;h<t.finishY+2;h++)if(!(a<0||h<0||a>=s.length||h>=s[0].length))for(var l=0;l<s[a][h].length;l++){var d,g,c=s[a][h][l];t.getOwner()!=c.getOwner()||t==c||e.has(c)||r.has(c)||(d=Math.abs(t.getCenterX()-c.getCenterX())-(t.getWidth()/2+c.getWidth()/2),g=Math.abs(t.getCenterY()-c.getCenterY())-(t.getHeight()/2+c.getHeight()/2),d<=this.repulsionRange&&g<=this.repulsionRange&&r.add(c))}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}(r))}for(a=0;a<t.surrounding.length;a++)this.calcRepulsionForce(t,t.surrounding[a])},l.prototype.calcRepulsionRange=function(){return 0},t.exports=l},function(t,e,i){var n,r=i(1),o=i(4);function s(t,e,i){r.call(this,t,e,i),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}for(n in s.prototype=Object.create(r.prototype),r)s[n]=r[n];t.exports=s},function(t,e,i){var n,r=i(3),o=i(4);function s(t,e,i,n){r.call(this,t,e,i,n),this.nodeRepulsion=o.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(n in s.prototype=Object.create(r.prototype),r)s[n]=r[n];s.prototype.setGridCoordinates=function(t,e,i,n){this.startX=t,this.finishX=e,this.startY=i,this.finishY=n},t.exports=s},function(t,e,i){function n(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},t.exports=n},function(t,e,i){var n=i(14);function r(){this.map={},this.keys=[]}r.prototype.put=function(t,e){var i=n.createID(t);this.contains(i)||(this.map[i]=e,this.keys.push(t))},r.prototype.contains=function(t){return n.createID(t),null!=this.map[t]},r.prototype.get=function(t){return t=n.createID(t),this.map[t]},r.prototype.keySet=function(){return this.keys},t.exports=r},function(t,e,i){var n=i(14);function r(){this.set={}}r.prototype.add=function(t){var e=n.createID(t);this.contains(e)||(this.set[e]=t)},r.prototype.remove=function(t){delete this.set[n.createID(t)]},r.prototype.clear=function(){this.set={}},r.prototype.contains=function(t){return this.set[n.createID(t)]==t},r.prototype.isEmpty=function(){return 0===this.size()},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),i=e.length,n=0;n<i;n++)t.push(this.set[e[n]])},r.prototype.size=function(){return Object.keys(this.set).length},r.prototype.addAll=function(t){for(var e=t.length,i=0;i<e;i++){var n=t[i];this.add(n)}},t.exports=r},function(t,e,i){function n(){}n.multMat=function(t,e){for(var i=[],n=0;n<t.length;n++){i[n]=[];for(var r=0;r<e[0].length;r++)for(var o=i[n][r]=0;o<t[0].length;o++)i[n][r]+=t[n][o]*e[o][r]}return i},n.transpose=function(t){for(var e=[],i=0;i<t[0].length;i++){e[i]=[];for(var n=0;n<t.length;n++)e[i][n]=t[n][i]}return e},n.multCons=function(t,e){for(var i=[],n=0;n<t.length;n++)i[n]=t[n]*e;return i},n.minusOp=function(t,e){for(var i=[],n=0;n<t.length;n++)i[n]=t[n]-e[n];return i},n.dotProduct=function(t,e){for(var i=0,n=0;n<t.length;n++)i+=t[n]*e[n];return i},n.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},n.normalize=function(t){for(var e=[],i=this.mag(t),n=0;n<t.length;n++)e[n]=t[n]/i;return e},n.multGamma=function(t){for(var e=[],i=0,n=0;n<t.length;n++)i+=t[n];i*=-1/t.length;for(var r=0;r<t.length;r++)e[r]=i+t[r];return e},n.multL=function(t,e,i){for(var n=[],r=[],o=[],s=0;s<e[0].length;s++){for(var a=0,h=0;h<e.length;h++)a+=-.5*e[h][s]*t[h];r[s]=a}for(var l=0;l<i.length;l++){for(var d=0,g=0;g<i.length;g++)d+=i[l][g]*r[g];o[l]=d}for(var c=0;c<e.length;c++){for(var u=0,p=0;p<e[0].length;p++)u+=e[c][p]*o[p];n[c]=u}return n},t.exports=n},function(t,e,i){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var r=i(11);function o(t,e){if(!(this instanceof o))throw new TypeError("Cannot call a class as a function");null===e&&void 0===e||(this.compareFunction=this._defaultCompareFunction),e=void 0,e=t instanceof r?t.size():t.length,this._quicksort(t,0,e-1)}(function(t,e,i){e&&n(t.prototype,e),i&&n(t,i)})(o,[{key:"_quicksort",value:function(t,e,i){var n;e<i&&(n=this._partition(t,e,i),this._quicksort(t,e,n),this._quicksort(t,n+1,i))}},{key:"_partition",value:function(t,e,i){for(var n=this._get(t,e),r=e,o=i;;){for(;this.compareFunction(n,this._get(t,o));)o--;for(;this.compareFunction(this._get(t,r),n);)r++;if(!(r<o))return o;this._swap(t,r,o),r++,o--}}},{key:"_get",value:function(t,e){return t instanceof r?t.get_object_at(e):t[e]}},{key:"_set",value:function(t,e,i){t instanceof r?t.set_object_at(e,i):t[e]=i}},{key:"_swap",value:function(t,e,i){var n=this._get(t,e);this._set(t,e,this._get(t,i)),this._set(t,i,n)}},{key:"_defaultCompareFunction",value:function(t,e){return t<e}}]),i=o,t.exports=i},function(t,e,i){function n(){}n.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;for(var e,i,r,o=Math.min(this.m,this.n),s=(this.s=function(t){for(var e=[];0<t--;)e.push(0);return e}(Math.min(this.m+1,this.n)),this.U=function t(e){if(0==e.length)return 0;for(var i=[],n=0;n<e[0];n++)i.push(t(e.slice(1)));return i}([this.m,o]),this.V=function t(e){if(0==e.length)return 0;for(var i=[],n=0;n<e[0];n++)i.push(t(e.slice(1)));return i}([this.n,this.n]),function(t){for(var e=[];0<t--;)e.push(0);return e}(this.n)),a=function(t){for(var e=[];0<t--;)e.push(0);return e}(this.m),h=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),d=0;d<Math.max(h,l);d++){if(d<h){this.s[d]=0;for(var g=d;g<this.m;g++)this.s[d]=n.hypot(this.s[d],t[g][d]);if(0!==this.s[d]){t[d][d]<0&&(this.s[d]=-this.s[d]);for(var c=d;c<this.m;c++)t[c][d]/=this.s[d];t[d][d]+=1}this.s[d]=-this.s[d]}for(var u=d+1;u<this.n;u++){if(r=0!==this.s[d],d<h&&r){for(var p=0,f=d;f<this.m;f++)p+=t[f][d]*t[f][u];p=-p/t[d][d];for(var y=d;y<this.m;y++)t[y][u]+=p*t[y][d]}s[u]=t[d][u]}if(d<h)for(var m=d;m<this.m;m++)this.U[m][d]=t[m][d];if(d<l){s[d]=0;for(var v=d+1;v<this.n;v++)s[d]=n.hypot(s[d],s[v]);if(0!==s[d]){s[d+1]<0&&(s[d]=-s[d]);for(var E=d+1;E<this.n;E++)s[E]/=s[d];s[d+1]+=1}if(s[d]=-s[d],e=d+1<this.m,i=0!==s[d],e&&i){for(var N=d+1;N<this.m;N++)a[N]=0;for(var T=d+1;T<this.n;T++)for(var A=d+1;A<this.m;A++)a[A]+=s[T]*t[A][T];for(var w=d+1;w<this.n;w++)for(var L=-s[w]/s[d+1],C=d+1;C<this.m;C++)t[C][w]+=L*a[C]}for(var I=d+1;I<this.n;I++)this.V[I][d]=s[I]}}var _=Math.min(this.n,this.m+1);h<this.n&&(this.s[h]=t[h][h]),this.m<_&&(this.s[_-1]=0),l+1<_&&(s[l]=t[l][_-1]),s[_-1]=0;for(var M=h;M<o;M++){for(var x=0;x<this.m;x++)this.U[x][M]=0;this.U[M][M]=1}for(var O=h-1;0<=O;O--)if(0!==this.s[O]){for(var D=O+1;D<o;D++){for(var R=0,b=O;b<this.m;b++)R+=this.U[b][O]*this.U[b][D];R=-R/this.U[O][O];for(var F=O;F<this.m;F++)this.U[F][D]+=R*this.U[F][O]}for(var G=O;G<this.m;G++)this.U[G][O]=-this.U[G][O];this.U[O][O]=1+this.U[O][O];for(var S=0;S<O-1;S++)this.U[S][O]=0}else{for(var P=0;P<this.m;P++)this.U[P][O]=0;this.U[O][O]=1}for(var U,Y=this.n-1;0<=Y;Y--){if(U=0!==s[Y],Y<l&&U)for(var k=Y+1;k<o;k++){for(var H=0,X=Y+1;X<this.n;X++)H+=this.V[X][Y]*this.V[X][k];H=-H/this.V[Y+1][Y];for(var z=Y+1;z<this.n;z++)this.V[z][k]+=H*this.V[z][Y]}for(var B=0;B<this.n;B++)this.V[B][Y]=0;this.V[Y][Y]=1}for(var V=_-1,W=Math.pow(2,-52),j=Math.pow(2,-966);0<_;){var q=void 0,$=void 0;for(q=_-2;-1<=q&&-1!==q;q--)if(Math.abs(s[q])<=j+W*(Math.abs(this.s[q])+Math.abs(this.s[q+1]))){s[q]=0;break}if(q===_-2)$=4;else{var Z=void 0;for(Z=_-1;q<=Z&&Z!==q;Z--){var Q=(Z!==_?Math.abs(s[Z]):0)+(Z!==q+1?Math.abs(s[Z-1]):0);if(Math.abs(this.s[Z])<=j+W*Q){this.s[Z]=0;break}}Z===q?$=3:Z===_-1?$=1:($=2,q=Z)}switch(q++,$){case 1:var J=s[_-2];s[_-2]=0;for(var K=_-2;q<=K;K--){var tt=n.hypot(this.s[K],J),et=this.s[K]/tt,it=J/tt;this.s[K]=tt,K!==q&&(J=-it*s[K-1],s[K-1]=et*s[K-1]);for(var nt=0;nt<this.n;nt++)tt=et*this.V[nt][K]+it*this.V[nt][_-1],this.V[nt][_-1]=-it*this.V[nt][K]+et*this.V[nt][_-1],this.V[nt][K]=tt}break;case 2:var rt=s[q-1];s[q-1]=0;for(var ot=q;ot<_;ot++){var st=n.hypot(this.s[ot],rt),at=this.s[ot]/st,ht=rt/st;this.s[ot]=st,rt=-ht*s[ot],s[ot]=at*s[ot];for(var lt=0;lt<this.m;lt++)st=at*this.U[lt][ot]+ht*this.U[lt][q-1],this.U[lt][q-1]=-ht*this.U[lt][ot]+at*this.U[lt][q-1],this.U[lt][ot]=st}break;case 3:for(var dt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[_-1]),Math.abs(this.s[_-2])),Math.abs(s[_-2])),Math.abs(this.s[q])),Math.abs(s[q])),gt=this.s[_-1]/dt,ct=this.s[_-2]/dt,ut=s[_-2]/dt,pt=this.s[q]/dt,ft=(dt=s[q]/dt,ct=((ct+gt)*(ct-gt)+ut*ut)/2,ut=gt*ut*(gt*ut),0),yt=(0==ct&&0==ut||(ft=Math.sqrt(ct*ct+ut),ft=ut/(ct+(ft=ct<0?-ft:ft))),(pt+gt)*(pt-gt)+ft),mt=pt*dt,vt=q;vt<_-1;vt++){var Et=n.hypot(yt,mt),Nt=yt/Et,Tt=mt/Et;vt!==q&&(s[vt-1]=Et),yt=Nt*this.s[vt]+Tt*s[vt],s[vt]=Nt*s[vt]-Tt*this.s[vt],mt=Tt*this.s[vt+1],this.s[vt+1]=Nt*this.s[vt+1];for(var At=0;At<this.n;At++)Et=Nt*this.V[At][vt]+Tt*this.V[At][vt+1],this.V[At][vt+1]=-Tt*this.V[At][vt]+Nt*this.V[At][vt+1],this.V[At][vt]=Et;if(Nt=yt/(Et=n.hypot(yt,mt)),Tt=mt/Et,this.s[vt]=Et,yt=Nt*s[vt]+Tt*this.s[vt+1],this.s[vt+1]=-Tt*s[vt]+Nt*this.s[vt+1],mt=Tt*s[vt+1],s[vt+1]=Nt*s[vt+1],vt<this.m-1)for(var wt=0;wt<this.m;wt++)Et=Nt*this.U[wt][vt]+Tt*this.U[wt][vt+1],this.U[wt][vt+1]=-Tt*this.U[wt][vt]+Nt*this.U[wt][vt+1],this.U[wt][vt]=Et}s[_-2]=yt;break;case 4:if(this.s[q]<=0){this.s[q]=this.s[q]<0?-this.s[q]:0;for(var Lt=0;Lt<=V;Lt++)this.V[Lt][q]=-this.V[Lt][q]}for(;q<V&&!(this.s[q]>=this.s[q+1]);){var Ct=this.s[q];if(this.s[q]=this.s[q+1],this.s[q+1]=Ct,q<this.n-1)for(var It=0;It<this.n;It++)Ct=this.V[It][q+1],this.V[It][q+1]=this.V[It][q],this.V[It][q]=Ct;if(q<this.m-1)for(var _t=0;_t<this.m;_t++)Ct=this.U[_t][q+1],this.U[_t][q+1]=this.U[_t][q],this.U[_t][q]=Ct;q++}_--}}return{U:this.U,V:this.V,S:this.s}},n.hypot=function(t,e){var i=void 0;return Math.abs(t)>Math.abs(e)?(i=e/t,Math.abs(t)*Math.sqrt(1+i*i)):0!=e?(i=t/e,Math.abs(e)*Math.sqrt(1+i*i)):0},t.exports=n},function(t,e,i){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}!function(t,e,i){e&&n(t.prototype,e)}(o,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var n=1;n<this.jMax;n++){var r=[this.sequence1[i-1]===this.sequence2[n-1]?this.grid[i-1][n-1]+this.match_score:this.grid[i-1][n-1]+this.mismatch_penalty,this.grid[i-1][n]+this.gap_penalty,this.grid[i][n-1]+this.gap_penalty],o=this.arrayAllMaxIndexes(r);this.grid[i][n]=r[o[0]],this.tracebackGrid[i][n]=[o.includes(0),o.includes(1),o.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],i=this.tracebackGrid[e.pos[0]][e.pos[1]];i[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),i[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),i[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,e){for(var i=[],n=-1;-1!==(n=t.indexOf(e,n+1));)i.push(n);return i}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]);var r=o;function o(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:-1,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:-1;if(!(this instanceof o))throw new TypeError("Cannot call a class as a function");this.sequence1=t,this.sequence2=e,this.match_score=i,this.mismatch_penalty=n,this.gap_penalty=r,this.iMax=t.length+1,this.jMax=e.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[s][a]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[h][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}t.exports=r},function(t,e,i){function n(){}n.FDLayout=i(18),n.FDLayoutConstants=i(4),n.FDLayoutEdge=i(19),n.FDLayoutNode=i(20),n.DimensionD=i(21),n.HashMap=i(22),n.HashSet=i(23),n.IGeometry=i(8),n.IMath=i(9),n.Integer=i(10),n.Point=i(12),n.PointD=i(5),n.RandomSeed=i(16),n.RectangleD=i(13),n.Transform=i(17),n.UniqueIDGeneretor=i(14),n.Quicksort=i(25),n.LinkedList=i(11),n.LGraphObject=i(2),n.LGraph=i(6),n.LEdge=i(1),n.LGraphManager=i(7),n.LNode=i(3),n.Layout=i(15),n.LayoutConstants=i(0),n.NeedlemanWunsch=i(27),n.Matrix=i(24),n.SVD=i(26),t.exports=n},function(t,e,i){function n(){this.listeners=[]}var r=n.prototype;r.addListener=function(t,e){this.listeners.push({event:t,callback:e})},r.removeListener=function(t,e){for(var i=this.listeners.length;0<=i;i--){var n=this.listeners[i];n.event===t&&n.callback===e&&this.listeners.splice(i,1)}},r.emit=function(t,e){for(var i=0;i<this.listeners.length;i++){var n=this.listeners[i];t===n.event&&n.callback(e)}},t.exports=n}],i={},t.m=e,t.c=i,t.i=function(t){return t},t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=28);function t(n){var r;return(i[n]||(r=i[n]={i:n,l:!1,exports:{}},e[n].call(r.exports,r,r.exports,t),r.l=!0,r)).exports}var e,i},R.exports=t()),R.exports}())),D.exports}x=function(t){return e={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments.length,i=Array(1<e?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return i.forEach((function(e){Object.keys(e).forEach((function(i){return t[i]=e[i]}))})),t}},548:(t,e,i)=>{var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var i=e,n=[],r=!0,o=void(e=!1);try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!i||n.length!==i);r=!0);}catch(t){e=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(e)throw o}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=i(140).layoutBase.LinkedList;i={getTopMostNodes:function(t){for(var e={},i=0;i<t.length;i++)e[t[i].id()]=!0;return t.filter((function(t,i){for(var n=(t="number"==typeof t?i:t).parent()[0];null!=n;){if(e[n.id()])return!1;n=n.parent()[0]}return!0}))},connectComponents:function(t,e,i,n){function o(){var n,r=t.collection(),o=(f.push(r),i[0]),y=t.collection();for(y.merge(o).merge(o.descendants().intersection(e)),h.push(o),y.forEach((function(t){s.push(t),a.add(t),r.merge(t)}));0!=s.length;)!function(){o=s.shift();var n=t.collection();o.neighborhood().nodes().forEach((function(t){0<e.intersection(o.edgesWith(t)).length&&n.merge(t)}));for(var d=0;d<n.length;d++){var g=n[d];null==(l=i.intersection(g.union(g.ancestors())))||a.has(l[0])||l.union(l.descendants()).forEach((function(t){s.push(t),a.add(t),r.merge(t),i.has(t)&&h.push(t)}))}}();r.forEach((function(t){e.intersection(t.connectedEdges()).forEach((function(t){r.has(t.source())&&r.has(t.target())&&r.merge(t)}))})),(!(c=h.length==i.length||c)||1<u)&&(d=h[0],g=d.connectedEdges().length,h.forEach((function(t){t.connectedEdges().length<g&&(g=t.connectedEdges().length,d=t)})),p.push(d.id()),(n=t.collection()).merge(h[0]),h.forEach((function(t){n.merge(t)})),h=[],i=i.difference(n),u++)}for(var s=new r,a=new Set,h=[],l=void 0,d=void 0,g=void 0,c=!1,u=1,p=[],f=[];o(),!c;);return n&&0<p.length&&n.set("dummy"+(n.size+1),p),f},relocateComponent:function(t,e,i){if(!i.fixedNodeConstraint){var r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if("draft"==i.quality){var h=!0,l=!1,d=void 0;try{for(var g,c=e.nodeIndexes[Symbol.iterator]();!(h=(g=c.next()).done);h=!0){var u,p,f,y,m,v=g.value,E=n(v,2),N=E[0],T=E[1],A=i.cy.getElementById(N);A&&(u=A.boundingBox(),p=e.xCoords[T]-u.w/2,f=e.xCoords[T]+u.w/2,y=e.yCoords[T]-u.h/2,m=e.yCoords[T]+u.h/2,p<r&&(r=p),o<f&&(o=f),y<s&&(s=y),a<m)&&(a=m)}}catch(t){l=!0,d=t}finally{try{!h&&c.return&&c.return()}finally{if(l)throw d}}var w=t.x-(o+r)/2,L=t.y-(a+s)/2;e.xCoords=e.xCoords.map((function(t){return t+w})),e.yCoords=e.yCoords.map((function(t){return t+L}))}else{Object.keys(e).forEach((function(t){var i=(t=e[t]).getRect().x,n=t.getRect().x+t.getRect().width,h=t.getRect().y;t=t.getRect().y+t.getRect().height,i<r&&(r=i),o<n&&(o=n),h<s&&(s=h),a<t&&(a=t)}));var C=t.x-(o+r)/2,I=t.y-(a+s)/2;Object.keys(e).forEach((function(t){(t=e[t]).setCenter(t.getCenterX()+C,t.getCenterY()+I)}))}}},calcBoundingBox:function(t,e,i,n){for(var r=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,h=t.descendants().not(":parent"),l=h.length,d=0;d<l;d++){var g,c=h[d];(g=e[n.get(c.id())]-c.width()/2)<r&&(r=g),o<(g=e[n.get(c.id())]+c.width()/2)&&(o=g),(g=i[n.get(c.id())]-c.height()/2)<s&&(s=g),a<(g=i[n.get(c.id())]+c.height()/2)&&(a=g)}return(t={}).topLeftX=r,t.topLeftY=s,t.width=o-r,t.height=a-s,t},calcParentsWithoutChildren:function(t,e){var i=t.collection();return e.nodes(":parent").forEach((function(t){var e=!1;t.children().forEach((function(t){"none"!=t.css("display")&&(e=!0)})),e||i.merge(t)})),i}},t.exports=i},816:(t,e,i)=>{var n=i(548),r=i(140).CoSELayout,o=i(140).CoSENode,s=i(140).layoutBase.PointD,a=i(140).layoutBase.DimensionD,h=i(140).layoutBase.LayoutConstants,l=i(140).layoutBase.FDLayoutConstants,d=i(140).CoSEConstants;t.exports={coseLayout:function(t,e){function i(t,e){return E(t)?t(e):t}var g=t.cy,c=t.eles,u=c.nodes(),p=c.edges(),f=void 0,y=void 0,m=void 0,v={},E=(t.randomize&&(f=e.nodeIndexes,y=e.xCoords,m=e.yCoords),function(t){return"function"==typeof t}),N=n.calcParentsWithoutChildren(g,c);null!=t.nestingFactor&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(d.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(d.MAX_ITERATIONS=l.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(d.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?h.QUALITY=2:h.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!t.randomize,d.ANIMATE=l.ANIMATE=h.ANIMATE=t.animate,d.TILE=t.tile,d.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!t.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),"enforced"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),"cose"==t.step&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;for(var T=(function t(e,r,h,l){for(var d=r.length,g=0;g<d;g++){var c,u=r[g],p=null,E=void(0==u.intersection(N).length&&(p=u.children())),T=u.layoutDimensions({nodeDimensionsIncludeLabels:l.nodeDimensionsIncludeLabels});(E=null!=u.outerWidth()&&null!=u.outerHeight()?l.randomize?u.isParent()?(c=n.calcBoundingBox(u,y,m,f),0==u.intersection(N).length?e.add(new o(h.graphManager,new s(c.topLeftX,c.topLeftY),new a(c.width,c.height))):e.add(new o(h.graphManager,new s(c.topLeftX,c.topLeftY),new a(parseFloat(T.w),parseFloat(T.h))))):e.add(new o(h.graphManager,new s(y[f.get(u.id())]-T.w/2,m[f.get(u.id())]-T.h/2),new a(parseFloat(T.w),parseFloat(T.h)))):e.add(new o(h.graphManager,new s(u.position("x")-T.w/2,u.position("y")-T.h/2),new a(parseFloat(T.w),parseFloat(T.h)))):e.add(new o(this.graphManager))).id=u.data("id"),E.nodeRepulsion=i(l.nodeRepulsion,u),E.paddingLeft=parseInt(u.css("padding")),E.paddingTop=parseInt(u.css("padding")),E.paddingRight=parseInt(u.css("padding")),E.paddingBottom=parseInt(u.css("padding")),l.nodeDimensionsIncludeLabels&&(E.labelWidth=u.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,E.labelHeight=u.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,E.labelPosVertical=u.css("text-valign"),E.labelPosHorizontal=u.css("text-halign")),v[u.data("id")]=E,isNaN(E.rect.x)&&(E.rect.x=0),isNaN(E.rect.y)&&(E.rect.y=0),null!=p&&0<p.length&&t(h.getGraphManager().add(h.newGraph(),E),p,h,l)}}((g=(e=new r).newGraphManager()).addRoot(),n.getTopMostNodes(u),e,t),e),A=g,w=p,L=0,C=0,I=0;I<w.length;I++){var _=w[I],M=v[_.data("source")],x=v[_.data("target")];M&&x&&M!==x&&0==M.getEdgesBetween(x).length&&((M=A.add(T.newEdge(),M,x)).id=_.id(),M.idealLength=i(t.idealEdgeLength,_),M.edgeElasticity=i(t.edgeElasticity,_),L+=M.idealLength,C++)}return null!=t.idealEdgeLength&&(0<C?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=L/C:E(t.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,d.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH),c=e,(u=t).fixedNodeConstraint&&(c.constraints.fixedNodeConstraint=u.fixedNodeConstraint),u.alignmentConstraint&&(c.constraints.alignmentConstraint=u.alignmentConstraint),u.relativePlacementConstraint&&(c.constraints.relativePlacementConstraint=u.relativePlacementConstraint),e.runLayout(),v}}},212:(t,e,i)=>{function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var r=i(658),o=i(548),s=i(657).spectralLayout,a=i(816).coseLayout,h=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(t){return 4500},idealEdgeLength:function(t){return 50},edgeElasticity:function(t){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}});function l(t){if(!(this instanceof l))throw new TypeError("Cannot call a class as a function");this.options=r({},h,t)}(function(t,e,i){e&&n(t.prototype,e),i&&n(t,i)})(l,[{key:"run",value:function(){var t=this.options,e=t.cy,i=t.eles,n=[],r=[],h=void 0,l=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var d=void 0,g=!1;if(e.layoutUtilities&&t.packComponents&&(d=(d=e.layoutUtilities("get"))||e.layoutUtilities(),g=!0),0<i.nodes().length)if(g){if(g=o.getTopMostNodes(t.eles.nodes()),(h=o.connectComponents(e,t.eles,g)).forEach((function(t){t=t.boundingBox(),l.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),t.randomize&&h.forEach((function(e){t.eles=e,n.push(s(t))})),"default"==t.quality||"proof"==t.quality){var c=e.collection();if(t.tile){g=new Map;var u=0,p={nodeIndexes:g,xCoords:[],yCoords:[]},f=[];if(h.forEach((function(t,e){0==t.edges().length&&(t.nodes().forEach((function(e,i){c.merge(t.nodes()[i]),e.isParent()||(p.nodeIndexes.set(t.nodes()[i].id(),u++),p.xCoords.push(t.nodes()[0].position().x),p.yCoords.push(t.nodes()[0].position().y))})),f.push(e))})),1<c.length){g=c.boundingBox(),l.push({x:g.x1+g.w/2,y:g.y1+g.h/2}),h.push(c),n.push(p);for(var y=f.length-1;0<=y;y--)h.splice(f[y],1),n.splice(f[y],1),l.splice(f[y],1)}}h.forEach((function(e,i){t.eles=e,r.push(a(t,n[i])),o.relocateComponent(l[i],r[i],t)}))}else h.forEach((function(e,i){o.relocateComponent(l[i],n[i],t)}));var m,v,E,N,T=new Set;1<h.length&&(m=[],v=i.filter((function(t){return"none"==t.css("display")})),h.forEach((function(e,i){var s,a,h=void 0;"draft"==t.quality&&(h=n[i].nodeIndexes),0<e.nodes().not(v).length&&(s={edges:[],nodes:[]},a=void 0,e.nodes().not(v).forEach((function(e){var l;"draft"==t.quality?e.isParent()?(l=o.calcBoundingBox(e,n[i].xCoords,n[i].yCoords,h),s.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})):(a=h.get(e.id()),s.nodes.push({x:n[i].xCoords[a]-e.boundingbox().w/2,y:n[i].yCoords[a]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h})):r[i][e.id()]&&s.nodes.push({x:r[i][e.id()].getLeft(),y:r[i][e.id()].getTop(),width:r[i][e.id()].getWidth(),height:r[i][e.id()].getHeight()})})),e.edges().forEach((function(e){var a,l,d,g,c,u=e.source();e=e.target(),"none"!=u.css("display")&&"none"!=e.css("display")&&("draft"==t.quality?(a=h.get(u.id()),l=h.get(e.id()),d=[],g=[],u.isParent()?(c=o.calcBoundingBox(u,n[i].xCoords,n[i].yCoords,h),d.push(c.topLeftX+c.width/2),d.push(c.topLeftY+c.height/2)):(d.push(n[i].xCoords[a]),d.push(n[i].yCoords[a])),e.isParent()?(c=o.calcBoundingBox(e,n[i].xCoords,n[i].yCoords,h),g.push(c.topLeftX+c.width/2),g.push(c.topLeftY+c.height/2)):(g.push(n[i].xCoords[l]),g.push(n[i].yCoords[l])),s.edges.push({startX:d[0],startY:d[1],endX:g[0],endY:g[1]})):r[i][u.id()]&&r[i][e.id()]&&s.edges.push({startX:r[i][u.id()].getCenterX(),startY:r[i][u.id()].getCenterY(),endX:r[i][e.id()].getCenterX(),endY:r[i][e.id()].getCenterY()}))})),0<s.nodes.length)&&(m.push(s),T.add(i))})),E=d.packComponents(m,t.randomize).shifts,"draft"==t.quality?n.forEach((function(t,e){var i=t.xCoords.map((function(t){return t+E[e].dx})),n=t.yCoords.map((function(t){return t+E[e].dy}));t.xCoords=i,t.yCoords=n})):(N=0,T.forEach((function(t){Object.keys(r[t]).forEach((function(e){(e=r[t][e]).setCenter(e.getCenterX()+E[N].dx,e.getCenterY()+E[N].dy)})),N++}))))}else g=t.eles.boundingBox(),l.push({x:g.x1+g.w/2,y:g.y1+g.h/2}),t.randomize&&(d=s(t),n.push(d)),"default"==t.quality||"proof"==t.quality?(r.push(a(t,n[0])),o.relocateComponent(l[0],r[0],t)):o.relocateComponent(l[0],n[0],t);function A(e,i){var o,s,a,h;return"default"==t.quality||"proof"==t.quality?(s=o=void 0,a=(e="number"==typeof e?i:e).data("id"),r.forEach((function(t){a in t&&(o={x:t[a].getRect().getCenterX(),y:t[a].getRect().getCenterY()},s=t[a])})),t.nodeDimensionsIncludeLabels&&(s.labelWidth&&("left"==s.labelPosHorizontal?o.x+=s.labelWidth/2:"right"==s.labelPosHorizontal&&(o.x-=s.labelWidth/2)),s.labelHeight)&&("top"==s.labelPosVertical?o.y+=s.labelHeight/2:"bottom"==s.labelPosVertical&&(o.y-=s.labelHeight/2)),{x:(o=null==o?{x:e.position("x"),y:e.position("y")}:o).x,y:o.y}):(h=void 0,n.forEach((function(t){var i=t.nodeIndexes.get(e.id());null!=i&&(h={x:t.xCoords[i],y:t.yCoords[i]})})),{x:(h=null==h?{x:e.position("x"),y:e.position("y")}:h).x,y:h.y})}"default"==t.quality||"proof"==t.quality||t.randomize?(g=o.calcParentsWithoutChildren(e,i),d=i.filter((function(t){return"none"==t.css("display")})),t.eles=i.not(d),i.nodes().not(":parent").not(d).layoutPositions(this,t,A),0<g.length&&g.forEach((function(t){t.position(A(t))}))):console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),i=l,t.exports=i},657:(t,e,i)=>{var n=i(548),r=i(140).layoutBase.Matrix,o=i(140).layoutBase.SVD;t.exports={spectralLayout:function(t){function e(t,e,i){for(var n,r=[],o=0,s=0,a=[],h=0,l=1,g=0;g<N;g++)a[g]=T;for(a[r[s]=t]=0;o<=s;){for(var u=r[o++],p=c[u],f=0;f<p.length;f++)a[n=d.get(p[f])]==T&&(a[n]=a[u]+1,r[++s]=n);m[u][e]=a[u]*L}if(i){for(var v=0;v<N;v++)m[v][e]<y[v]&&(y[v]=m[v][e]);for(var E=0;E<N;E++)y[E]>h&&(h=y[E],l=E)}return l}for(var i=t.cy,s=t.eles,a=s.nodes(),h=s.nodes(":parent"),l=new Map,d=new Map,g=new Map,c=[],u=[],p=[],f=[],y=[],m=[],v=[],E=[],N=void 0,T=1e8,A=t.piTol,w=t.samplingType,L=t.nodeSeparation,C=void 0,I=(n.connectComponents(i,s,n.getTopMostNodes(a),l),h.forEach((function(t){n.connectComponents(i,s,n.getTopMostNodes(t.descendants().intersection(s)),l)})),0),_=0;_<a.length;_++)a[_].isParent()||d.set(a[_].id(),I++);var M=!0,x=!1,O=void 0;try{for(var D,R=l.keys()[Symbol.iterator]();!(M=(D=R.next()).done);M=!0){var b=D.value;d.set(b,I++)}}catch(t){x=!0,O=t}finally{try{!M&&R.return&&R.return()}finally{if(x)throw O}}for(var F=0;F<d.size;F++)c[F]=[];h.forEach((function(t){for(var e=t.children().intersection(s);0==e.nodes(":childless").length;)e=e.nodes()[0].children().intersection(s);var i=0,n=e.nodes(":childless")[0].connectedEdges().length;e.nodes(":childless").forEach((function(t,e){t.connectedEdges().length<n&&(n=t.connectedEdges().length,i=e)})),g.set(t.id(),e.nodes(":childless")[i].id())})),a.forEach((function(t){var e=t.isParent()?d.get(g.get(t.id())):d.get(t.id());t.neighborhood().nodes().forEach((function(i){0<s.intersection(t.edgesWith(i)).length&&(i.isParent()?c[e].push(g.get(i.id())):c[e].push(i.id()))}))}));var G=!0;x=!1,O=void 0;try{for(var S,P=l.keys()[Symbol.iterator]();!(G=(S=P.next()).done);G=!0)!function(t){var e=d.get(t),n=void 0;l.get(t).forEach((function(r){n=i.getElementById(r).isParent()?g.get(r):r,c[e].push(n),c[d.get(n)].push(t)}))}(S.value)}catch(t){x=!0,O=t}finally{try{!G&&P.return&&P.return()}finally{if(x)throw O}}if(2<(N=d.size)){C=N<t.sampleSize?N:t.sampleSize;for(var U=0;U<N;U++)m[U]=[];for(var Y=0;Y<C;Y++)E[Y]=[];if("draft"==t.quality||"all"==t.step){!function(t){var i=void 0;if(t){i=Math.floor(Math.random()*N);for(var n=0;n<N;n++)y[n]=T;for(var r=0;r<C;r++)f[r]=i,i=e(i,r,t)}else{for(var o=0,s=!1;o<C;){for(var a=Math.floor(Math.random()*N),h=(s=!1,0);h<o;h++)if(f[h]==a){s=!0;break}s||(f[o]=a,o++)}for(var l=0;l<C;l++)e(f[l],l,t)}for(var d=0;d<N;d++)for(var g=0;g<C;g++)m[d][g]*=m[d][g];for(var c=0;c<C;c++)v[c]=[];for(var u=0;u<C;u++)for(var p=0;p<C;p++)v[u][p]=m[f[p]][u]}(w);for(var k=(h=o.svd(v)).S,H=(x=h.U,h=h.V,k[0]*k[0]*k[0]),X=[],z=0;z<C;z++){X[z]=[];for(var B=0;B<C;B++)X[z][B]=0,z==B&&(X[z][B]=k[z]/(k[z]*k[z]+H/(k[z]*k[z])))}E=r.multMat(r.multMat(h,X),r.transpose(x));for(var V=void 0,W=void 0,j=[],q=[],$=[],Z=[],Q=0;Q<N;Q++)j[Q]=Math.random(),q[Q]=Math.random();j=r.normalize(j),q=r.normalize(q);for(var J=1e-9,K=1e-9,tt=void 0;;){for(var et=0;et<N;et++)$[et]=j[et];if(j=r.multGamma(r.multL(r.multGamma($),m,E)),V=r.dotProduct($,j),j=r.normalize(j),J=r.dotProduct($,j),(tt=Math.abs(J/K))<=1+A&&1<=tt)break;K=J}for(var it=0;it<N;it++)$[it]=j[it];for(K=1e-9;;){for(var nt=0;nt<N;nt++)Z[nt]=q[nt];if(Z=r.minusOp(Z,r.multCons($,r.dotProduct($,Z))),q=r.multGamma(r.multL(r.multGamma(Z),m,E)),W=r.dotProduct(Z,q),q=r.normalize(q),J=r.dotProduct(Z,q),(tt=Math.abs(J/K))<=1+A&&1<=tt)break;K=J}for(var rt=0;rt<N;rt++)Z[rt]=q[rt];u=r.multCons($,Math.sqrt(Math.abs(V))),p=r.multCons(Z,Math.sqrt(Math.abs(W)))}else d.forEach((function(t,e){u.push(i.getElementById(e).position("x")),p.push(i.getElementById(e).position("y"))}));return{nodeIndexes:d,xCoords:u,yCoords:p}}return O=d.keys(),h=(w=i.getElementById(O.next().value)).position(),x=w.outerWidth(),u.push(h.x),p.push(h.y),2==N&&(w=i.getElementById(O.next().value).outerWidth(),u.push(h.x+x/2+w/2+t.idealEdgeLength),p.push(h.y)),{nodeIndexes:d,xCoords:u,yCoords:p}}}},579:(t,e,i)=>{function n(t){t&&t("layout","fcose",r)}var r=i(212);"undefined"!=typeof cytoscape&&n(cytoscape),t.exports=n},140:e=>{e.exports=t}},i={},function t(n){var r=i[n];return void 0===r&&(r=i[n]={exports:{}},e[n](r,r.exports,t)),r.exports}(579);var e,i},O.exports=x(b());var F=e(O.exports),G={L:"left",R:"right",T:"top",B:"bottom"},S={L:l((t=>t+`,${t/2} 0,${t} 0,0`),"L"),R:l((t=>`0,${t/2} ${t},0 ${t},`+t),"R"),T:l((t=>`0,0 ${t},0 ${t/2},`+t),"T"),B:l((t=>t/2+`,0 ${t},${t} 0,`+t),"B")},P={L:l(((t,e)=>t-e+2),"L"),R:l(((t,e)=>t-2),"R"),T:l(((t,e)=>t-e+2),"T"),B:l(((t,e)=>t-2),"B")},U=l((function(t){return k(t)?"L"===t?"R":"L":"T"===t?"B":"T"}),"getOppositeArchitectureDirection"),Y=l((function(t){return"L"===t||"R"===t||"T"===t||"B"===t}),"isArchitectureDirection"),k=l((function(t){return"L"===t||"R"===t}),"isArchitectureDirectionX"),H=l((function(t){return"T"===t||"B"===t}),"isArchitectureDirectionY"),X=l((function(t,e){var i=k(t)&&H(e);t=H(t)&&k(e);return i||t}),"isArchitectureDirectionXY"),z=l((function(t){var e=t[0],i=(t=t[1],k(e)&&H(t));e=H(e)&&k(t);return i||e}),"isArchitecturePairXY"),B=l((function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t}),"isValidArchitectureDirectionPair"),V=l((function(t,e){return B(t=""+t+e)?t:void 0}),"getArchitectureDirectionPair"),W=l((function([t,e],i){var n=i[0];i=i[1];return k(n)?H(i)?[t+("L"===n?-1:1),e+("T"===i?1:-1)]:[t+("L"===n?-1:1),e]:k(i)?[t+("L"===i?1:-1),e+("T"===n?1:-1)]:[t,e+("T"===n?1:-1)]}),"shiftPositionByArchitectureDirectionPair"),j=l((function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]}),"getArchitectureDirectionXYFactors"),q=l((function(t,e){return X(t,e)?"bend":k(t)?"horizontal":"vertical"}),"getArchitectureDirectionAlignment"),$=l((function(t){return"service"===t.type}),"isArchitectureService"),Z=l((function(t){return"junction"===t.type}),"isArchitectureJunction"),Q=l((t=>t.data()),"edgeData"),J=l((t=>t.data()),"nodeData"),K=i.architecture,tt=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=n,this.getAccTitle=r,this.setDiagramTitle=o,this.getDiagramTitle=s,this.getAccDescription=a,this.setAccDescription=h,this.clear()}static{l(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},d()}addService({id:t,icon:e,in:i,title:n,iconText:r}){if(void 0!==this.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another `+this.registeredIds[t]);if(void 0!==i){if(t===i)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[i])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[i])throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:e,iconText:r,title:n,edges:[],in:i}}getServices(){return Object.values(this.nodes).filter($)}addJunction({id:t,in:e}){this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:e}}getJunctions(){return Object.values(this.nodes).filter(Z)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:e,in:i,title:n}){if(void 0!==this.registeredIds?.[t])throw new Error(`The group id [${t}] is already in use by another `+this.registeredIds[t]);if(void 0!==i){if(t===i)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===this.registeredIds?.[i])throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===this.registeredIds?.[i])throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:e,title:n,in:i}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:e,lhsDir:i,rhsDir:n,lhsInto:r,rhsInto:o,lhsGroup:s,rhsGroup:a,title:h}){if(!Y(i))throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got `+String(i));if(!Y(n))throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got `+String(n));if(void 0===this.nodes[t]&&void 0===this.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[e]&&void 0===this.groups[e])throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);var l=this.nodes[t].in,d=this.nodes[e].in;if(s&&l&&d&&l==d)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&l&&d&&l==d)throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);this.edges.push({lhsId:t,lhsDir:i,lhsInto:r,lhsGroup:s,rhsId:e,rhsDir:n,rhsInto:o,rhsGroup:a,title:h}),this.nodes[t]&&this.nodes[e]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[e].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){const i={},n=Object.entries(this.nodes).reduce(((t,[e,n])=>(t[e]=n.edges.reduce(((t,n)=>{var r,o=this.getNode(n.lhsId)?.in,s=this.getNode(n.rhsId)?.in;return o&&s&&o!==s&&"bend"!==(r=q(n.lhsDir,n.rhsDir))&&(i[o]??={},i[o][s]=r,i[s]??={},i[s][o]=r),n.lhsId===e?(s=V(n.lhsDir,n.rhsDir))&&(t[s]=n.rhsId):(o=V(n.rhsDir,n.lhsDir))&&(t[o]=n.lhsId),t}),{}),t)),{}),r=Object.keys(n)[0],o={[r]:1},s=Object.keys(n).reduce(((t,e)=>e===r?t:{...t,[e]:1}),{});for(var t=l((t=>{const e={[t]:[0,0]},i=[t];for(;0<i.length;){var r=i.shift();if(r){o[r]=1,delete s[r];var a=n[r];const[t,h]=e[r];Object.entries(a).forEach((([n,r])=>{o[r]||(e[r]=W([t,h],n),i.push(r))}))}}return e}),"BFS"),e=[t(r)];0<Object.keys(s).length;)e.push(t(Object.keys(s)[0]));this.dataStructures={adjList:n,spatialMaps:e,groupAlignments:i}}return this.dataStructures}setElementForId(t,e){this.elements[t]=e}getElementById(t){return this.elements[t]}getConfig(){return g({...K,...c().architecture})}getConfigField(t){return this.getConfig()[t]}},et=l(((t,e)=>{L(t,e),t.groups.map((t=>e.addGroup(t))),t.services.map((t=>e.addService({...t,type:"service"}))),t.junctions.map((t=>e.addJunction({...t,type:"junction"}))),t.edges.map((t=>e.addEdge(t)))}),"populateDb"),it={parser:{yy:void 0},parse:l((async t=>{t=await C("architecture",t);var e=(f.debug(t),it.parser?.yy);if(!(e instanceof tt))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");et(t,e)}),"parse")},nt=l((t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`),"getStyles"),rt=nt,ot=l((t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`),"wrapIcon"),st={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:ot('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:ot('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:ot('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:ot('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:ot('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:u,blank:{body:ot("")}}},at=l((async function(t,e,i){const n=i.getConfigField("padding");var r=i.getConfigField("iconSize");const o=r/2,s=r/6,a=s/2;await Promise.all(e.edges().map((async e=>{var{source:r,sourceDir:h,sourceArrow:l,sourceGroup:d,target:g,targetDir:c,targetArrow:u,targetGroup:p,label:f}=Q(e);let{x:y,y:m}=e[0].sourceEndpoint();var{x:v,y:A}=e[0].midpoint();let{x:w,y:L}=e[0].targetEndpoint();var C=n+4;if(d&&(k(h)?y+="L"===h?-C:C:m+="T"===h?-C:C+18),p&&(k(c)?w+="L"===c?-C:C:L+="T"===c?-C:C+18),d||"junction"!==i.getNode(r)?.type||(k(h)?y+="L"===h?o:-o:m+="T"===h?o:-o),p||"junction"!==i.getNode(g)?.type||(k(c)?w+="L"===c?o:-o:L+="T"===c?o:-o),e[0]._private.rscratch&&((C=t.insert("g")).insert("path").attr("d",`M ${y},${m} L ${v},${A} L${w},${L} `).attr("class","edge").attr("id",E(r,g,{prefix:"L"})),l&&(d=k(h)?P[h](y,s):y-a,p=H(h)?P[h](m,s):m-a,C.insert("polygon").attr("points",S[h](s)).attr("transform",`translate(${d},${p})`).attr("class","arrow")),u&&(e=k(c)?P[c](w,s):w-a,r=H(c)?P[c](L,s):L-a,C.insert("polygon").attr("points",S[c](s)).attr("transform",`translate(${e},${r})`).attr("class","arrow")),f)){let t=0;t="X"==(g=X(h,c)?"XY":k(h)?"X":"Y")?Math.abs(y-w):"Y"==g?Math.abs(m-L)/1.5:Math.abs(y-w)/2,l=C.append("g"),await N(l,f,{useHtmlLabels:!1,width:t,classes:"architecture-service-label"},T()),l.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"==g?l.attr("transform","translate("+v+", "+A+")"):"Y"==g?l.attr("transform","translate("+v+", "+A+") rotate(-90)"):"XY"==g&&(d=V(h,c))&&z(d)&&(p=l.node().getBoundingClientRect(),[u,e]=j(d),l.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*u*e*45})`),r=l.node().getBoundingClientRect(),l.attr("transform",`\n translate(${v}, ${A-p.height/2})\n translate(${u*r.width/2}, ${e*r.height/2})\n rotate(${-1*u*e*45}, 0, ${p.height/2})\n `))}})))}),"drawEdges"),ht=l((async function(t,e,i){const n=.75*i.getConfigField("padding"),r=i.getConfigField("fontSize"),o=i.getConfigField("iconSize")/2;await Promise.all(e.nodes().map((async e=>{var s=J(e);if("group"===s.type){var{h:e,w:a,x1:h,y1:l}=e.boundingBox(),d=t.append("rect");e=(d.attr("id","group-"+s.id).attr("x",h+o).attr("y",l+o).attr("width",a).attr("height",e).attr("class","node-bkg"),t.append("g"));let g=h,c=l;s.icon&&((h=e.append("g")).html(`<g>${await A(s.icon,{height:n,width:n,fallbackPrefix:st.prefix})}</g>`),h.attr("transform","translate("+(g+o+1)+", "+(c+o+1)+")"),g+=n,c+=r/2-1-2),s.label&&(l=e.append("g"),await N(l,s.label,{useHtmlLabels:!1,width:a,classes:"architecture-service-label"},T()),l.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),l.attr("transform","translate("+(g+o+4)+", "+(c+o+2)+")")),i.setElementForId(s.id,d)}})))}),"drawGroups"),lt=l((async function(t,e,i){var n=T();for(const l of i){var r=e.append("g"),o=t.getConfigField("iconSize"),s=(l.title&&(s=r.append("g"),await N(s,l.title,{useHtmlLabels:!1,width:1.5*o,classes:"architecture-service-label"},n),s.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),s.attr("transform","translate("+o/2+", "+o+")")),r.append("g")),{width:a,height:h}=(l.icon?s.html(`<g>${await A(l.icon,{height:o,width:o,fallbackPrefix:st.prefix})}</g>`):l.iconText?(s.html(`<g>${await A("blank",{height:o,width:o,fallbackPrefix:st.prefix})}</g>`),a=s.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(w(l.iconText,n)),h=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16,a.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/h)};`)):s.append("path").attr("class","node-bkg").attr("id","node-"+l.id).attr("d",`M0 ${o} v${-o} q0,-5 5,-5 h${o} q5,0 5,5 v${o} H0 Z`),r.attr("id","service-"+l.id).attr("class","architecture-service"),r.node().getBBox());l.width=a,l.height=h,t.setElementForId(l.id,r)}return 0}),"drawServices"),dt=l((function(t,e,i){i.forEach((i=>{var n=e.append("g"),r=t.getConfigField("iconSize"),{width:r,height:o}=(n.append("g").append("rect").attr("id","node-"+i.id).attr("fill-opacity","0").attr("width",r).attr("height",r),n.attr("class","architecture-junction"),n._groups[0][0].getBBox());n.width=r,n.height=o,t.setElementForId(i.id,n)}))}),"drawJunctions");function gt(t,e,i){t.forEach((t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:i.getConfigField("iconSize"),height:i.getConfigField("iconSize")},classes:"node-service"})}))}function ct(t,e,i){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:i.getConfigField("iconSize"),height:i.getConfigField("iconSize")},classes:"node-junction"})}))}function ut(t,e){e.nodes().map((e=>{var i=J(e);"group"!==i.type&&(i.x=e.position().x,i.y=e.position().y,t.getElementById(i.id).attr("transform","translate("+(i.x||0)+","+(i.y||0)+")"))}))}function pt(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})}))}function ft(t,e){t.forEach((t=>{var{lhsId:i,rhsId:n,lhsInto:r,lhsGroup:o,rhsInto:s,lhsDir:a,rhsDir:h,rhsGroup:l,title:d}=t;t=X(t.lhsDir,t.rhsDir)?"segments":"straight";e.add({group:"edges",data:{id:i+"-"+n,label:d,source:i,sourceDir:a,sourceArrow:r,sourceGroup:o,sourceEndpoint:"L"===a?"0 50%":"R"===a?"100% 50%":"T"===a?"50% 0":"50% 100%",target:n,targetDir:h,targetArrow:s,targetGroup:l,targetEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%"},classes:t})}))}function yt(t,e,i){const n=l(((t,e)=>Object.entries(t).reduce(((t,[n,r])=>{let o=0;var s=Object.entries(r);if(1===s.length)t[n]=s[0][1];else for(let r=0;r<s.length-1;r++)for(let g=r+1;g<s.length;g++){var[a,h]=s[r],[l,d]=s[g];i[a]?.[l]===e||"default"===a||"default"===l?(t[n]??=[],t[n]=[...t[n],...h,...d]):(t[n+"-"+o++]=h,t[n+"-"+o++]=d)}return t}),{})),"flattenAlignments");var[e,r]=e.map((e=>{const i={},r={};return Object.entries(e).forEach((([e,[n,o]])=>{var s=t.getNode(e)?.in??"default";i[o]??={},i[o][s]??=[],i[o][s].push(e),r[n]??={},r[n][s]??=[],r[n][s].push(e)})),{horiz:Object.values(n(i,"horizontal")).filter((t=>1<t.length)),vert:Object.values(n(r,"vertical")).filter((t=>1<t.length))}})).reduce((([t,e],{horiz:i,vert:n})=>[[...t,...i],[...e,...n]]),[[],[]]);return{horizontal:e,vertical:r}}function mt(t,e){const i=[],n=l((t=>t[0]+","+t[1]),"posToStr"),r=l((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");return t.forEach((t=>{const o=Object.fromEntries(Object.entries(t).map((([t,e])=>[n(e),t]))),s=[n([0,0])],a={};for(var h={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};0<s.length;){var l=s.shift();if(l){a[l]=1;const t=o[l];if(t){const d=r(l);Object.entries(h).forEach((([r,h])=>{h=n([d[0]+h[0],d[1]+h[1]]);var l=o[h];l&&!a[h]&&(s.push(h),i.push({[G[r]]:l,[G[U(r)]]:t,gap:1.5*e.getConfigField("iconSize")}))}))}}}})),i}function vt(t,e,i,n,r,{spatialMaps:o,groupAlignments:s}){return new Promise((a=>{var h=y("body").append("div").attr("id","cy").attr("style","display:none");const d=I({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":r.getConfigField("fontSize")+"px"}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:r.getConfigField("padding")+"px"}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});h.remove(),pt(i,d),gt(t,d,r),ct(e,d,r),ft(n,d);h=yt(r,o,s);var g=mt(o,r);const c=d.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){var e,[t,e]=t.connectedNodes();return(t=J(t).parent)===(e=J(e).parent)?1.5*r.getConfigField("iconSize"):.5*r.getConfigField("iconSize")},edgeElasticity(t){var e,[t,e]=t.connectedNodes();return(t=J(t).parent)===(e=J(e).parent)?.45:.001},alignmentConstraint:h,relativePlacementConstraint:g});c.one("layoutstop",(()=>{function t(t,e,i,n){var{x:t,y:r}=t,{x:e,y:o}=e,s=(n-r+(t-i)*(r-o)/(t-e))/Math.sqrt(1+Math.pow((r-o)/(t-e),2)),a=Math.sqrt(Math.pow(n-r,2)+Math.pow(i-t,2)-Math.pow(s,2));a/=Math.sqrt(Math.pow(e-t,2)+Math.pow(o-r,2));let h=(e-t)*(n-r)-(o-r)*(i-t);switch(!0){case 0<=h:h=1;break;case h<0:h=-1}let l=(e-t)*(i-t)+(o-r)*(n-r);switch(!0){case 0<=l:l=1;break;case l<0:l=-1}return{distances:Math.abs(s)*h,weights:a*=l}}l(t,"getSegmentWeights"),d.startBatch();for(const o of Object.values(d.edges())){var e,i,n,r;o.data?.()&&(({x:n,y:i}=o.source().position()),({x:r,y:e}=o.target().position()),n!==r)&&i!==e&&(n=o.sourceEndpoint(),r=o.targetEndpoint(),i=Q(o).sourceDir,[e,i]=H(i)?[n.x,r.y]:[r.x,n.y],({weights:n,distances:r}=t(n,r,e,i)),o.style("segment-distances",r),o.style("segment-weights",n))}d.endBatch(),c.run()})),c.run(),d.ready((t=>{f.info("Ready",t),a(d)}))}))}p([{name:st.prefix,icons:st}]),I.use(F),l(gt,"addServices"),l(ct,"addJunctions"),l(ut,"positionNodes"),l(pt,"addGroups"),l(ft,"addEdges"),l(yt,"getAlignments"),l(mt,"getRelativeConstraints"),l(vt,"layoutArchitecture");var Et=l((async(t,e,i,n)=>{var r=(n=n.db).getServices(),o=n.getJunctions(),s=n.getGroups(),a=n.getEdges(),h=n.getDataStructures(),l=(e=m(e)).append("g"),d=((g=(l.attr("class","architecture-edges"),e.append("g"))).attr("class","architecture-services"),e.append("g")),g=(d.attr("class","architecture-groups"),await lt(n,g,r),dt(n,g,o),await vt(r,o,s,a,n,h));await at(l,g,n),await ht(d,g,n),ut(n,g),v(void 0,e,n.getConfigField("padding"),n.getConfigField("useMaxWidth"))}),"draw"),Nt={parser:it,get db(){return new tt},renderer:{draw:Et},styles:rt};export{Nt as diagram};
@@ -0,0 +1 @@
1
+ import{g as t}from"./chunk-FMBD7UC4-2c653fda.js";import{_ as e,d as r,l as a,j as i,i as s,ai as n,E as l,aj as o,ak as c,al as d,u as h,am as g,R as y,N as p,k as u,t as x,A as b,S as f,an as m,ao as w,e as k}from"./web-0016ac81.js";import{c as L}from"./clone-8494eb3f.js";import{G as S}from"./graph-db4953aa.js";import{c as _}from"./channel-2af69aa2.js";import"./_baseUniq-38ea2195.js";var v=function(){var t=e((function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r}),"o"),r=[1,15],a=[1,7],i=[1,13],s=[1,14],n=[1,19],l=[1,16],o=[1,17],c=[1,18],d=[8,30],h=[8,10,21,28,29,30,31,39,43,46],g=[1,23],y=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],u=[8,10,15,16,21,27,28,29,30,31,39,43,46],x=[1,49];d={trace:e((function(){}),"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e((function(t,e,r,a,i,s,n){var l=s.length-1;switch(i){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",s[l-1]),a.setHierarchy(s[l-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",s[l]),"number"==typeof s[l].length?this.$=s[l]:this.$=[s[l]];break;case 13:a.getLogger().debug("Rule: statement #2: ",s[l-1]),this.$=[s[l-1]].concat(s[l]);break;case 14:a.getLogger().debug("Rule: link: ",s[l],t),this.$={edgeTypeStr:s[l],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",s[l-3],s[l-1],s[l]),this.$={edgeTypeStr:s[l],label:s[l-1]};break;case 18:var o=parseInt(s[l]),c=a.generateId();this.$={id:c,type:"space",label:"",width:o,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",s[l-2],s[l-1],s[l]," typestr: ",s[l-1].edgeTypeStr),c=a.edgeStrToEdgeData(s[l-1].edgeTypeStr),this.$=[{id:s[l-2].id,label:s[l-2].label,type:s[l-2].type,directions:s[l-2].directions},{id:s[l-2].id+"-"+s[l].id,start:s[l-2].id,end:s[l].id,label:s[l-1].label,type:"edge",directions:s[l].directions,arrowTypeEnd:c,arrowTypeStart:"arrow_open"},{id:s[l].id,label:s[l].label,type:a.typeStr2Type(s[l].typeStr),directions:s[l].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",s[l-1],s[l]),this.$={id:s[l-1].id,label:s[l-1].label,type:a.typeStr2Type(s[l-1].typeStr),directions:s[l-1].directions,widthInColumns:parseInt(s[l],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",s[l]),this.$={id:s[l].id,label:s[l].label,type:a.typeStr2Type(s[l].typeStr),directions:s[l].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this||"na"),a.getLogger().debug("COLUMNS: ",s[l]),this.$={type:"column-setting",columns:"auto"===s[l]?-1:parseInt(s[l])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",s[l-2],s[l-1]),a.generateId(),this.$={...s[l-2],type:"composite",children:s[l-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",s[l-2],s[l-1],s[l]),o=a.generateId(),this.$={id:o,type:"composite",label:"",children:s[l-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",s[l]),this.$={id:s[l]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",s[l-1],s[l]),this.$={id:s[l-1],label:s[l].label,typeStr:s[l].typeStr,directions:s[l].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",s[l]),this.$=[s[l]];break;case 32:a.getLogger().debug("Rule: dirList: ",s[l-1],s[l]),this.$=[s[l-1]].concat(s[l]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",s[l-2],s[l-1],s[l]),this.$={typeStr:s[l-2]+s[l],label:s[l-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",s[l-3],s[l-2]," #3:",s[l-1],s[l]),this.$={typeStr:s[l-3]+s[l],label:s[l-2],directions:s[l-1]};break;case 35:case 36:this.$={type:"classDef",id:s[l-1].trim(),css:s[l].trim()};break;case 37:this.$={type:"applyClass",id:s[l-1].trim(),styleClass:s[l].trim()};break;case 38:this.$={type:"applyStyles",id:s[l-1].trim(),stylesStr:s[l].trim()}}}),"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:r,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:s,31:n,39:l,43:o,46:c},{8:[1,20]},t(d,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:r,21:a,28:i,29:s,31:n,39:l,43:o,46:c}),t(h,[2,16],{14:22,15:g,16:y}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:n},{10:r,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:s,31:n,39:l,43:o,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(u,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(d,[2,13]),{26:35,31:n},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:r,11:37,13:4,14:22,15:g,16:y,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:s,31:n,39:l,43:o,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(u,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:x},{15:[1,50]},t(h,[2,27]),t(u,[2,33]),{38:[1,51]},{33:52,34:x,38:[2,31]},{31:[2,15]},t(u,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e((function(t,e){var r;if(!e.recoverable)throw(r=new Error(t)).hash=e,r;this.trace(t)}),"parseError"),parse:e((function(t){var r,a=this,i=[0],s=[],n=[null],l=[],o=this.table,c="",d=0,h=0,g=l.slice.call(arguments,1),y=Object.create(this.lexer),p={yy:{}};for(r in this.yy)Object.prototype.hasOwnProperty.call(this.yy,r)&&(p.yy[r]=this.yy[r]);y.setInput(t,p.yy),p.yy.lexer=y,p.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var u=y.yylloc,x=(l.push(u),y.options&&y.options.ranges);function b(){var t=s.pop()||y.lex()||1;return"number"!=typeof t&&(t instanceof Array&&(t=(s=t).pop()),t=a.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,e((function(t){i.length=i.length-2*t,n.length=n.length-t,l.length=l.length-t}),"popStack"),e(b,"lex");for(var f,m,w,k,L,S,_={};;){if(m=i[i.length-1],void 0===(w=this.defaultActions[m]||(null==f&&(f=b()),o[m]&&o[m][f]))||!w.length||!w[0]){var v,E=[];for(k in o[m])this.terminals_[k]&&2<k&&E.push("'"+this.terminals_[k]+"'");v=y.showPosition?"Parse error on line "+(d+1)+":\n"+y.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(d+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(v,{text:y.match,token:this.terminals_[f]||f,line:y.yylineno,loc:u,expected:E})}if(w[0]instanceof Array&&1<w.length)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(w[0]){case 1:i.push(f),n.push(y.yytext),l.push(y.yylloc),i.push(w[1]),f=null,h=y.yyleng,c=y.yytext,d=y.yylineno,u=y.yylloc;break;case 2:if(L=this.productions_[w[1]][1],_.$=n[n.length-L],_._$={first_line:l[l.length-(L||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(L||1)].first_column,last_column:l[l.length-1].last_column},x&&(_._$.range=[l[l.length-(L||1)].range[0],l[l.length-1].range[1]]),void 0!==(S=this.performAction.apply(_,[c,h,d,p.yy,w[1],n,l].concat(g))))return S;L&&(i=i.slice(0,-1*L*2),n=n.slice(0,-1*L),l=l.slice(0,-1*L)),i.push(this.productions_[w[1]][0]),n.push(_.$),l.push(_._$),S=o[i[i.length-2]][i[i.length-1]],i.push(S);break;case 3:return!0}}return!0}),"parse")},r={EOF:1,parseError:e((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:e((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:e((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:e((function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g),a=(this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e,t=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1),this.yylloc.range);return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===t.length?this.yylloc.first_column:0)+t[t.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:e((function(){return this._more=!0,this}),"more"),reject:e((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:e((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:e((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(20<t.length?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:e((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(20<t.length?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:e((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:e((function(t,e){var r,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)&&(a.yylloc.range=this.yylloc.range.slice(0)),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack)for(var i in a)this[i]=a[i];return!1}),"test_match"),next:e((function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,r,a,i=this._currentRules(),s=0;s<i.length;s++)if((r=this._input.match(this.rules[i[s]]))&&(!e||r[0].length>e[0].length))if(e=r,a=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[s])))return t;if(!this._backtrack)return!1;e=!1}else if(!this.options.flex)break;return e?!1!==(t=this.test_match(e,i[a]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:e((function(){return this.next()||this.lex()}),"lex"),begin:e((function(t){this.conditionStack.push(t)}),"begin"),popState:e((function(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:e((function(){return(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]]:this.conditions.INITIAL).rules}),"_currentRules"),topState:e((function(t){return 0<=(t=this.conditionStack.length-1-Math.abs(t||0))?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:e((function(t){this.begin(t)}),"pushState"),stateStackSize:e((function(){return this.conditionStack.length}),"stateStackSize"),options:{},performAction:e((function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}}),"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};function b(){this.yy={}}return d.lexer=r,e(b,"Parser"),new((b.prototype=d).Parser=b)}(),E=v.parser=v,D=new Map,T=[],C=new Map,N="color",$="fill",I=r(),B=new Map,z=e((t=>k.sanitizeText(t,I)),"sanitizeText"),R=e((function(t,e=""){let r=B.get(t);r||(r={id:t,styles:[],textStyles:[]},B.set(t,r)),null!=e&&e.split(",").forEach((t=>{var e=t.replace(/([^;]*);/,"$1").trim();RegExp(N).exec(t)&&(t=e.replace($,"bgFill").replace(N,$),r.textStyles.push(t)),r.styles.push(e)}))}),"addStyleClass"),O=e((function(t,e=""){t=D.get(t),null!=e&&(t.styles=e.split(","))}),"addStyle2Node"),A=e((function(t,e){t.split(",").forEach((function(t){let r=D.get(t);void 0===r&&(r={id:t=t.trim(),type:"na",children:[]},D.set(t,r)),r.classes||(r.classes=[]),r.classes.push(e)}))}),"setCssClass"),M=e(((t,e)=>{t=t.flat();var r=[],i=t.find((t=>"column-setting"===t?.type))?.columns??-1;for(const o of t)if("number"==typeof i&&0<i&&"column-setting"!==o.type&&"number"==typeof o.widthInColumns&&o.widthInColumns>i&&a.warn(`Block ${o.id} width ${o.widthInColumns} exceeds configured column width `+i),o.label&&(o.label=z(o.label)),"classDef"===o.type)R(o.id,o.css);else if("applyClass"===o.type)A(o.id,o?.styleClass??"");else if("applyStyles"===o.type)o?.stylesStr&&O(o.id,o?.stylesStr);else if("column-setting"===o.type)e.columns=o.columns??-1;else if("edge"===o.type){var s=(C.get(o.id)??0)+1;C.set(o.id,s),o.id=s+"-"+o.id,T.push(o)}else if(o.label||("composite"===o.type?o.label="":o.label=o.id),void 0===(s=D.get(o.id))?D.set(o.id,o):("na"!==o.type&&(s.type=o.type),o.label!==o.id&&(s.label=o.label)),o.children&&M(o.children,o),"space"===o.type){var n=o.width??1;for(let t=0;t<n;t++){var l=L(o);l.id=l.id+"-"+t,D.set(l.id,l),r.push(l)}}else void 0===s&&r.push(o);e.children=r}),"populateBlockDatabase"),P=[],Y={id:"root",type:"composite",children:[],columns:-1},W=e((()=>{a.debug("Clear called"),x(),Y={id:"root",type:"composite",children:[],columns:-1},D=new Map([["root",Y]]),P=[],B=new Map,T=[],C=new Map}),"clear");function X(t){switch(a.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return a.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function F(t){return a.debug("typeStr2Type",t),"=="!==t?"normal":"thick"}function j(t){switch(t.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}e(X,"typeStr2Type"),e(F,"edgeTypeStr2Type"),e(j,"edgeStrToEdgeData");var H=0,U=e((()=>(H++,"id-"+Math.random().toString(36).substr(2,12)+"-"+H)),"generateId"),K=e((t=>{Y.children=t,M(t,Y),P=Y.children}),"setHierarchy"),q=e((t=>(t=D.get(t))?t.columns||(t.children?t.children.length:-1):-1),"getColumns"),Z=e((()=>[...D.values()]),"getBlocksFlat"),G=e((()=>P||[]),"getBlocks"),J=e((()=>T),"getEdges"),V=e((t=>D.get(t)),"getBlock"),Q=e((t=>{D.set(t.id,t)}),"setBlock"),tt=e((()=>a),"getLogger"),et=e((function(){return B}),"getClasses"),rt={getConfig:e((()=>l().block),"getConfig"),typeStr2Type:X,edgeTypeStr2Type:F,edgeStrToEdgeData:j,getLogger:tt,getBlocksFlat:Z,getBlocks:G,getEdges:J,setHierarchy:K,getBlock:V,setBlock:Q,getColumns:q,getClasses:et,clear:W,generateId:U},at=e(((t,e)=>{var r=(i=_)(t,"r"),a=i(t,"g"),i=i(t,"b");return b(r,a,i,e)}),"fade"),it=e((e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span,p {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${at(e.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${at(e.mainBkg,.5)};\n fill: ${at(e.clusterBkg,.5)};\n stroke: ${at(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n ${t()}\n`),"getStyles"),st=e(((t,e,r,a)=>{e.forEach((e=>{nt[e](t,r,a)}))}),"insertMarkers"),nt={extension:e(((t,e,r)=>{a.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")}),"extension"),composition:e(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"composition"),aggregation:e(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")}),"aggregation"),dependency:e(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"dependency"),lollipop:e(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)}),"lollipop"),point:e(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"point"),circle:e(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")}),"circle"),cross:e(((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")}),"cross"),barb:e(((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"barb")},lt=st,ot=r()?.block?.padding??8;function ct(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);return t<0?{px:e,py:0}:1===t?{px:0,py:e}:{px:e%t,py:Math.floor(e/t)}}e(ct,"calculateBlockPosition");var dt=e((t=>{let e=0,r=0;for(const o of t.children){var{width:i,height:s,x:n,y:l}=o.size??{width:0,height:0,x:0,y:0};a.debug("getMaxChildSize abc95 child:",o.id,"width:",i,"height:",s,"x:",n,"y:",l,o.type),"space"!==o.type&&(i>e&&(e=i/(t.widthInColumns??1)),s>r)&&(r=s)}return{width:e,height:r}}),"getMaxChildSize");function ht(t,e,r=0,i=0){if(a.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"siblingWidth",r),t?.size?.width||(t.size={width:r,height:i,x:0,y:0}),0<t.children?.length){for(const r of t.children)ht(r,e);var s=dt(t),n=s.width,l=s.height;a.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",n,l);for(const e of t.children)e.size&&(a.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${n} ${l} `+JSON.stringify(e.size)),e.size.width=n*(e.widthInColumns??1)+ot*((e.widthInColumns??1)-1),e.size.height=l,e.size.x=0,e.size.y=0,a.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${n} maxHeight:`+l));for(const r of t.children)ht(r,e,n,l);s=t.columns??-1;let g=0;for(const e of t.children)g+=e.widthInColumns??1;let y=t.children.length;0<s&&s<g&&(y=s);var o=Math.ceil(g/y);let p=y*(n+ot)+ot,u=o*(l+ot)+ot;if(p<r){a.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${i} width `+p),p=r,u=i;var c=(r-y*ot-ot)/y,d=(i-o*ot-ot)/o;a.debug("Size indata abc88",t.id,"childWidth",c,"maxWidth",n),a.debug("Size indata abc88",t.id,"childHeight",d,"maxHeight",l),a.debug("Size indata abc88 xSize",y,"padding",ot);for(const e of t.children)e.size&&(e.size.width=c,e.size.height=d,e.size.x=0,e.size.y=0)}if(a.debug(`abc95 (finale calc) ${t.id} xSize ${y} ySize ${o} columns ${s}${t.children.length} width=`+Math.max(p,t.size?.width||0)),p<(t?.size?.width||0)&&(p=t?.size?.width||0,0<(r=0<s?Math.min(t.children.length,s):t.children.length))){var h=(p-r*ot-ot)/r;a.debug("abc95 (growing to fit) width",t.id,p,t.size?.width,h);for(const e of t.children)e.size&&(e.size.width=h)}t.size={width:p,height:u,x:0,y:0}}a.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function gt(t,e){a.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: `+t?.size?.width);var r=t.columns??-1;if(a.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&0<t.children.length){var i=t?.children[0]?.size?.width??0;i=t.children.length*i+(t.children.length-1)*ot;a.debug("widthOfChildren 88",i,"posX");let e=0,d=(a.debug("abc91 block?.size?.x",t.id,t?.size?.x),t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-ot),h=0;for(const i of t.children){var s=t;if(i.size){var{width:n,height:l}=i.size,{px:o,py:c}=ct(r,e);c!=h&&(h=c,d=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-ot,a.debug("New row in layout for block",t.id," and child ",i.id,h)),a.debug(`abc89 layout blocks (child) id: ${i.id} Pos: ${e} (px, py) ${o},${c} (${s?.size?.x},${s?.size?.y}) parent: ${s.id} width: `+n+ot),s.size&&(o=n/2,i.size.x=d+ot+o,a.debug(`abc91 layout blocks (calc) px, pyid:${i.id} startingPos=X${d} new startingPosX${i.size.x} ${o} padding=${ot} width=${n} halfWidth=${o} => x:${i.size.x} y:${i.size.y} ${i.widthInColumns} (width * (child?.w || 1)) / 2 `+n*(i?.widthInColumns??1)/2),d=i.size.x+o,i.size.y=s.size.y-s.size.height/2+c*(l+ot)+l/2+ot,a.debug(`abc88 layout blocks (calc) px, pyid:${i.id}startingPosX${d}${ot}${o}=>x:${i.size.x}y:${i.size.y}${i.widthInColumns}(width * (child?.w || 1)) / 2`+n*(i?.widthInColumns??1)/2)),i.children&&gt(i);let g=i?.widthInColumns??1;0<r&&(g=Math.min(g,r-e%r)),e+=g,a.debug("abc88 columnsPos",i,e)}}}a.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: `+t?.size?.width)}function yt(t,{minX:e,minY:r,maxX:a,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){var s,n,l,o;if(t.size&&"root"!==t.id&&(({x:s,y:n,width:l,height:o}=t.size),s-l/2<e&&(e=s-l/2),n-o/2<r&&(r=n-o/2),a<s+l/2&&(a=s+l/2),i<n+o/2)&&(i=n+o/2),t.children)for(const s of t.children)({minX:e,minY:r,maxX:a,maxY:i}=yt(s,{minX:e,minY:r,maxX:a,maxY:i}));return{minX:e,minY:r,maxX:a,maxY:i}}function pt(t){var e,r,i=t.getBlock("root");if(i)return ht(i,t,0,0),gt(i),a.debug("getBlocks",JSON.stringify(i,null,2)),({minX:t,minY:i,maxX:e,maxY:r}=yt(i)),{x:t,y:i,width:e-t,height:r-i}}function ut(t,e){e&&t.attr("style",e)}function xt(t,e){var r=i(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=r.append("xhtml:div"),n=t.label,l=t.isNode?"nodeLabel":"edgeLabel",o=a.append("span");return o.html(s(n,e)),ut(o,t.labelStyle),o.attr("class",l),ut(a,t.labelStyle),a.style("display","inline-block"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),r.node()}e(ht,"setBlockSizes"),e(gt,"layoutBlocks"),e(yt,"findBounds"),e(pt,"layout"),e(ut,"applyStyle"),e(xt,"addHtmlLabel");var bt=e((async(t,e,i,s)=>{let n=t||"";if("object"==typeof n&&(n=n[0]),t=r(),o(t.flowchart.htmlLabels))return n=n.replace(/\\n|\n/g,"<br />"),a.debug("vertexText"+n),xt({isNode:s,label:await m(w(n)),labelStyle:e.replace("fill:","color:")},t);{var l=document.createElementNS("http://www.w3.org/2000/svg","text");l.setAttribute("style",e.replace("color:","fill:"));let t=[];for(const e of t="string"==typeof n?n.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(n)?n:[]){var c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),i?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=e.trim(),l.appendChild(c)}return l}}),"createLabel"),ft=e(((t,e,r,a,i)=>{e.arrowTypeStart&&wt(t,"start",e.arrowTypeStart,r,a,i),e.arrowTypeEnd&&wt(t,"end",e.arrowTypeEnd,r,a,i)}),"addEdgeMarkers"),mt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},wt=e(((t,e,r,i,s,n)=>{var l=mt[r];l?t.attr("marker-"+e,`url(${i}#${s}_${n}-${l}${"start"===e?"Start":"End"})`):a.warn("Unknown arrow type: "+r)}),"addEdgeMarker"),kt={},Lt={},St=e((async(t,e)=>{var a,s=r(),n=o(s.flowchart.htmlLabels),l=(s="markdown"===e.labelType?c(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:!0},s):await bt(e.label,e.labelStyle),t.insert("g").attr("class","edgeLabel")),d=l.insert("g").attr("class","label");d.node().appendChild(s);let h,g=s.getBBox();return n&&(n=s.children[0],a=i(s),g=n.getBoundingClientRect(),a.attr("width",g.width),a.attr("height",g.height)),d.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"),kt[e.id]=l,e.width=g.width,e.height=g.height,e.startLabelLeft&&(n=await bt(e.startLabelLeft,e.labelStyle),h=(d=(a=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner")).node().appendChild(n),l=n.getBBox(),d.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),Lt[e.id]||(Lt[e.id]={}),Lt[e.id].startLeft=a,_t(h,e.startLabelLeft)),e.startLabelRight&&(n=await bt(e.startLabelRight,e.labelStyle),l=(d=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner"),h=d.node().appendChild(n),l.node().appendChild(n),a=n.getBBox(),l.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),Lt[e.id]||(Lt[e.id]={}),Lt[e.id].startRight=d,_t(h,e.startLabelRight)),e.endLabelLeft&&(n=await bt(e.endLabelLeft,e.labelStyle),h=(a=(l=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner")).node().appendChild(n),d=n.getBBox(),a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.node().appendChild(n),Lt[e.id]||(Lt[e.id]={}),Lt[e.id].endLeft=l,_t(h,e.endLabelLeft)),e.endLabelRight&&(a=await bt(e.endLabelRight,e.labelStyle),h=(n=(d=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner")).node().appendChild(a),l=a.getBBox(),n.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),d.node().appendChild(a),Lt[e.id]||(Lt[e.id]={}),Lt[e.id].endRight=d,_t(h,e.endLabelRight)),s}),"insertEdgeLabel");function _t(t,e){r().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}e(_t,"setTerminalWidth");var vt=e(((t,e)=>{a.debug("Moving label abc88 ",t.id,t.label,kt[t.id],e);var i=e.updatedPath||e.originalPath,s=r();s=d(s).subGraphTitleTotalMargin;if(t.label){var n=kt[t.id];let r=t.x,o=t.y;i&&(l=h.calcLabelPosition(i),a.debug("Moving label "+t.label+" from (",r,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath)&&(r=l.x,o=l.y),n.attr("transform",`translate(${r}, ${o+s/2})`)}if(t.startLabelLeft){e=Lt[t.id].startLeft;let r=t.x,a=t.y;i&&(r=(l=h.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",i)).x,a=l.y),e.attr("transform",`translate(${r}, ${a})`)}if(t.startLabelRight){n=Lt[t.id].startRight;let e=t.x,r=t.y;i&&(e=(s=h.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",i)).x,r=s.y),n.attr("transform",`translate(${e}, ${r})`)}if(t.endLabelLeft){var l=Lt[t.id].endLeft;let r=t.x,a=t.y;i&&(r=(e=h.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",i)).x,a=e.y),l.attr("transform",`translate(${r}, ${a})`)}if(t.endLabelRight){s=Lt[t.id].endRight;let e=t.x,r=t.y;i&&(e=(n=h.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",i)).x,r=n.y),s.attr("transform",`translate(${e}, ${r})`)}}),"positionEdgeLabel"),Et=e(((t,e)=>{var r=t.x,a=t.y;r=Math.abs(e.x-r),e=Math.abs(e.y-a),a=t.width/2,t=t.height/2;return a<=r||t<=e}),"outsideNode"),Dt=e(((t,e,r)=>{a.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:`+t.height);var i=t.x,s=t.y,n=Math.abs(i-r.x),l=t.width/2;let o=r.x<e.x?l-n:l+n;n=t.height/2,t=Math.abs(e.y-r.y);var c=Math.abs(e.x-r.x);if(Math.abs(s-e.y)*l>Math.abs(i-e.x)*n)return o=c*(s=r.y<e.y?e.y-n-s:s-n-e.y)/t,n={x:r.x<e.x?r.x+o:r.x-c+o,y:r.y<e.y?r.y+t-s:r.y-t+s},0===o&&(n.x=e.x,n.y=e.y),0===c&&(n.x=e.x),0===t&&(n.y=e.y),a.debug(`abc89 topp/bott calc, Q ${t}, q ${s}, R ${c}, r `+o,n),n;{s=t*(o=r.x<e.x?e.x-l-i:i-l-e.x)/c;let n=r.x<e.x?r.x+c-o:r.x-c+o,d=r.y<e.y?r.y+s:r.y-s;return a.debug(`sides calc abc89, Q ${t}, q ${s}, R ${c}, r `+o,{_x:n,_y:d}),0===o&&(n=e.x,d=e.y),0===c&&(n=e.x),0===t&&(d=e.y),{x:n,y:d}}}),"intersection"),Tt=e(((t,e)=>{a.debug("abc88 cutPathAtIntersect",t,e);let r=[],i=t[0],s=!1;return t.forEach((t=>{if(Et(e,t)||s)i=t,s||r.push(t);else{const a=Dt(e,i,t);let n=!1;r.forEach((t=>{n=n||t.x===a.x&&t.y===a.y})),r.some((t=>t.x===a.x&&t.y===a.y))||r.push(a),s=!0}})),r}),"cutPathAtIntersect"),Ct=e((function(t,e,i,s,n,l,o){let c=i.points,d=(a.debug("abc88 InsertEdge: edge=",i,"e=",e),!1);var h=l.node(e.v);l=l.node(e.w),l?.intersect&&h?.intersect&&((c=c.slice(1,i.points.length-1)).unshift(h.intersect(c[0])),c.push(l.intersect(c[c.length-1]))),i.toCluster&&(a.debug("to cluster abc88",s[i.toCluster]),c=Tt(i.points,s[i.toCluster].node),d=!0),i.fromCluster&&(a.debug("from cluster abc88",s[i.fromCluster]),c=Tt(c.reverse(),s[i.fromCluster].node).reverse(),d=!0),e=c.filter((t=>!Number.isNaN(t.y)));let u=f;!i.curve||"graph"!==n&&"flowchart"!==n||(u=i.curve);var{x:h,y:l}=g(i);s=y().x(h).y(l).curve(u);let x;switch(i.thickness){case"normal":x="edge-thickness-normal";break;case"thick":case"invisible":x="edge-thickness-thick";break;default:x=""}switch(i.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}h=t.append("path").attr("d",s(e)).attr("id",i.id).attr("class"," "+x+(i.classes?" "+i.classes:"")).attr("style",i.style);let b="";return(r().flowchart.arrowMarkerAbsolute||r().state.arrowMarkerAbsolute)&&(b=p(!0)),ft(h,i,b,o,n),l={},d&&(l.updatedPath=c),l.originalPath=i.points,l}),"insertEdge"),Nt=e((t=>{var e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e}),"expandAndDeduplicateDirections"),$t=e(((t,e,r)=>{t=Nt(t);var a=e.height+2*r.padding,i=a/2;e=e.width+2*i+r.padding,r=r.padding/2;return t.has("right")&&t.has("left")&&t.has("up")&&t.has("down")?[{x:0,y:0},{x:i,y:0},{x:e/2,y:2*r},{x:e-i,y:0},{x:e,y:0},{x:e,y:-a/3},{x:e+2*r,y:-a/2},{x:e,y:-2*a/3},{x:e,y:-a},{x:e-i,y:-a},{x:e/2,y:-a-2*r},{x:i,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*r,y:-a/2},{x:0,y:-a/3}]:t.has("right")&&t.has("left")&&t.has("up")?[{x:i,y:0},{x:e-i,y:0},{x:e,y:-a/2},{x:e-i,y:-a},{x:i,y:-a},{x:0,y:-a/2}]:t.has("right")&&t.has("left")&&t.has("down")?[{x:0,y:0},{x:i,y:-a},{x:e-i,y:-a},{x:e,y:0}]:t.has("right")&&t.has("up")&&t.has("down")?[{x:0,y:0},{x:e,y:-i},{x:e,y:i-a},{x:0,y:-a}]:t.has("left")&&t.has("up")&&t.has("down")?[{x:e,y:0},{x:0,y:-i},{x:0,y:i-a},{x:e,y:-a}]:t.has("right")&&t.has("left")?[{x:i,y:0},{x:i,y:-r},{x:e-i,y:-r},{x:e-i,y:0},{x:e,y:-a/2},{x:e-i,y:-a},{x:e-i,y:r-a},{x:i,y:r-a},{x:i,y:-a},{x:0,y:-a/2}]:t.has("up")&&t.has("down")?[{x:e/2,y:0},{x:0,y:-r},{x:i,y:-r},{x:i,y:r-a},{x:0,y:r-a},{x:e/2,y:-a},{x:e,y:r-a},{x:e-i,y:r-a},{x:e-i,y:-r},{x:e,y:-r}]:t.has("right")&&t.has("up")?[{x:0,y:0},{x:e,y:-i},{x:0,y:-a}]:t.has("right")&&t.has("down")?[{x:0,y:0},{x:e,y:0},{x:0,y:-a}]:t.has("left")&&t.has("up")?[{x:e,y:0},{x:0,y:-i},{x:e,y:-a}]:t.has("left")&&t.has("down")?[{x:e,y:0},{x:0,y:0},{x:e,y:-a}]:t.has("right")?[{x:i,y:-r},{x:i,y:-r},{x:e-i,y:-r},{x:e-i,y:0},{x:e,y:-a/2},{x:e-i,y:-a},{x:e-i,y:r-a},{x:i,y:r-a},{x:i,y:r-a}]:t.has("left")?[{x:i,y:0},{x:i,y:-r},{x:e-i,y:-r},{x:e-i,y:r-a},{x:i,y:r-a},{x:i,y:-a},{x:0,y:-a/2}]:t.has("up")?[{x:i,y:-r},{x:i,y:r-a},{x:0,y:r-a},{x:e/2,y:-a},{x:e,y:r-a},{x:e-i,y:r-a},{x:e-i,y:-r}]:t.has("down")?[{x:e/2,y:0},{x:0,y:-r},{x:i,y:-r},{x:i,y:r-a},{x:e-i,y:r-a},{x:e-i,y:-r},{x:e,y:-r}]:[{x:0,y:0}]}),"getArrowPoints");function It(t,e){return t.intersect(e)}e(It,"intersectNode");var Bt=It;function zt(t,e,r,a){var i=t.x,s=(t=t.y,i-a.x),n=t-a.y,l=Math.sqrt(e*e*n*n+r*r*s*s);s=Math.abs(e*r*s/l),a.x<i&&(s=-s),e=Math.abs(e*r*n/l);return{x:i+s,y:t+(e=a.y<t?-e:e)}}e(zt,"intersectEllipse");var Rt=zt;function Ot(t,e,r){return Rt(t,e,e,r)}e(Ot,"intersectCircle");var At=Ot;function Mt(t,e,r,a){var i,s=e.y-t.y,n=t.x-e.x,l=e.x*t.y-t.x*e.y,o=s*r.x+n*r.y+l,c=s*a.x+n*a.y+l;if(!(0!=o&&0!=c&&Pt(o,c)||(o=a.y-r.y,c=r.x-a.x,r=a.x*r.y-r.x*a.y,a=o*t.x+c*t.y+r,t=o*e.x+c*e.y+r,0!=a&&0!=t&&Pt(a,t))||0==(i=s*c-o*n)))return e=Math.abs(i/2),{x:(a=n*r-c*l)<0?(a-e)/i:(a+e)/i,y:(a=o*l-s*r)<0?(a-e)/i:(a+e)/i}}function Pt(t,e){return 0<t*e}e(Mt,"intersectLine"),e(Pt,"sameSign");var Yt=Mt,Wt=Xt;function Xt(t,e,r){for(var a=t.x,i=t.y,s=[],n=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,o=("function"==typeof e.forEach?e.forEach((function(t){n=Math.min(n,t.x),l=Math.min(l,t.y)})):(n=Math.min(n,e.x),l=Math.min(l,e.y)),a-t.width/2-n),c=i-t.height/2-l,d=0;d<e.length;d++){var h=e[d],g=e[d<e.length-1?d+1:0];(h=Yt(t,r,{x:o+h.x,y:c+h.y},{x:o+g.x,y:c+g.y}))&&s.push(h)}return s.length?(1<s.length&&s.sort((function(t,e){var a=t.x-r.x;t=t.y-r.y,a=Math.sqrt(a*a+t*t),t=e.x-r.x,e=e.y-r.y;return a<(t=Math.sqrt(t*t+e*e))?-1:a===t?0:1})),s[0]):t}e(Xt,"intersectPolygon");var Ft=e(((t,e)=>{var r,a=t.x,i=t.y,s=e.x-a,n=(e=e.y-i,t.width/2);t=t.height/2,t=Math.abs(e)*n>Math.abs(s)*t?(e<0&&(t=-t),r=0==e?0:t*s/e,t):(r=n=s<0?-n:n,0==s?0:n*e/s);return{x:a+r,y:i+t}}),"intersectRect"),jt={node:Bt,circle:At,ellipse:Rt,polygon:Wt,rect:Ft},Ht=e((async(t,a,n,l)=>{const d=r();let h;var g=a.useHtmlLabels||o(d.flowchart.htmlLabels);t=(n=(h=n||"node default",t.insert("g").attr("class",h).attr("id",a.domId||a.id))).insert("g").attr("class","label").attr("style",a.labelStyle);let y;y=void 0===a.labelText?"":"string"==typeof a.labelText?a.labelText:a.labelText[0];var p=t.node();let u,x=(u="markdown"===a.labelType?c(t,s(w(y),d),{useHtmlLabels:g,width:a.width||d.flowchart.wrappingWidth,classes:"markdown-node-label"},d):p.appendChild(await bt(s(w(y),d),a.labelStyle,!1,l))).getBBox();if(p=a.padding/2,o(d.flowchart.htmlLabels)){l=u.children[0];var b=i(u),f=l.getElementsByTagName("img");if(f){const t=""===y.replace(/<img[^>]*>/g,"").trim();await Promise.all([...f].map((r=>new Promise((a=>{function i(){var e;r.style.display="flex",r.style.flexDirection="column",t?(e=d.fontSize||window.getComputedStyle(document.body).fontSize,e=5*parseInt(e,10)+"px",r.style.minWidth=e,r.style.maxWidth=e):r.style.width="100%",a(r)}e(i,"setupImage"),setTimeout((()=>{r.complete&&i()})),r.addEventListener("error",i),r.addEventListener("load",i)})))))}x=l.getBoundingClientRect(),b.attr("width",x.width),b.attr("height",x.height)}return g?t.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"):t.attr("transform","translate(0, "+-x.height/2+")"),a.centerLabel&&t.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),t.insert("rect",":first-child"),{shapeSvg:n,bbox:x,halfPadding:p,label:t}}),"labelHelper"),Ut=e(((t,e)=>{e=e.node().getBBox(),t.width=e.width,t.height=e.height}),"updateNodeBounds");function Kt(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map((function(t){return t.x+","+t.y})).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}e(Kt,"insertPolygonShape");var qt=e((async(t,e)=>{e.useHtmlLabels||r().flowchart.htmlLabels||(e.centerLabel=!0);var{shapeSvg:t,bbox:i,halfPadding:s}=await Ht(t,e,"node "+e.classes,!0),n=(a.info("Classes = ",e.classes),t.insert("rect",":first-child"));return n.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-s).attr("y",-i.height/2-s).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Ut(e,n),e.intersect=function(t){return jt.rect(e,t)},t}),"note"),Zt=e((t=>t?" "+t:""),"formatClass"),Gt=e(((t,e)=>`${e||"node default"}${Zt(t.classes)} `+Zt(t.class)),"getClassesFromNode"),Jt=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0);const i=[{x:(r=r.width+e.padding+(r.height+e.padding))/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];return a.info("Question main (Circle)"),(r=Kt(t,r,r,i)).attr("style",e.style),Ut(e,r),e.intersect=function(t){return a.warn("Intersect called"),jt.polygon(e,i,t)},t}),"question"),Vt=e(((t,e)=>((t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("polygon",":first-child").attr("points",[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}].map((function(t){return t.x+","+t.y})).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return jt.circle(e,14,t)},t)),"choice"),Qt=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.height+e.padding,i=a/4;const s=[{x:i,y:0},{x:(r=r.width+2*i+e.padding)-i,y:0},{x:r,y:-a/2},{x:r-i,y:-a},{x:i,y:-a},{x:0,y:-a/2}];return(i=Kt(t,r,a,s)).attr("style",e.style),Ut(e,i),e.intersect=function(t){return jt.polygon(e,s,t)},t}),"hexagon"),te=e((async(t,e)=>{var{shapeSvg:t,bbox:r}=await Ht(t,e,void 0,!0),a=r.height+2*e.padding,i=r.width+a/2*2+e.padding;const s=$t(e.directions,r,e);return(r=Kt(t,i,a,s)).attr("style",e.style),Ut(e,r),e.intersect=function(t){return jt.polygon(e,s,t)},t}),"block_arrow"),ee=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.width+e.padding;const i=[{x:-(r=r.height+e.padding)/2,y:0},{x:a,y:0},{x:a,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return Kt(t,a,r,i).attr("style",e.style),e.width=a+r,e.height=r,e.intersect=function(t){return jt.polygon(e,i,t)},t}),"rect_left_inv_arrow"),re=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e),!0),a=r.width+e.padding;const i=[{x:-2*(r=r.height+e.padding)/6,y:0},{x:a-r/6,y:0},{x:a+2*r/6,y:-r},{x:r/6,y:-r}];return(a=Kt(t,a,r,i)).attr("style",e.style),Ut(e,a),e.intersect=function(t){return jt.polygon(e,i,t)},t}),"lean_right"),ae=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.width+e.padding;const i=[{x:2*(r=r.height+e.padding)/6,y:0},{x:a+r/6,y:0},{x:a-2*r/6,y:-r},{x:-r/6,y:-r}];return(a=Kt(t,a,r,i)).attr("style",e.style),Ut(e,a),e.intersect=function(t){return jt.polygon(e,i,t)},t}),"lean_left"),ie=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.width+e.padding;const i=[{x:-2*(r=r.height+e.padding)/6,y:0},{x:a+2*r/6,y:0},{x:a-r/6,y:-r},{x:r/6,y:-r}];return(a=Kt(t,a,r,i)).attr("style",e.style),Ut(e,a),e.intersect=function(t){return jt.polygon(e,i,t)},t}),"trapezoid"),se=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.width+e.padding;const i=[{x:(r=r.height+e.padding)/6,y:0},{x:a-r/6,y:0},{x:a+2*r/6,y:-r},{x:-2*r/6,y:-r}];return(a=Kt(t,a,r,i)).attr("style",e.style),Ut(e,a),e.intersect=function(t){return jt.polygon(e,i,t)},t}),"inv_trapezoid"),ne=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.width+e.padding;const i=[{x:0,y:0},{x:a+(r=r.height+e.padding)/2,y:0},{x:a,y:-r/2},{x:a+r/2,y:-r},{x:0,y:-r}];return(a=Kt(t,a,r,i)).attr("style",e.style),Ut(e,a),e.intersect=function(t){return jt.polygon(e,i,t)},t}),"rect_right_inv_arrow"),le=e((async(t,e)=>{var{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.width+e.padding;const i=a/2,s=i/(2.5+a/50);var r=r.height+s+e.padding,n="M 0,"+s+" a "+i+","+s+" 0,0,0 "+a+" 0 a "+i+","+s+" 0,0,0 "+-a+" 0 l 0,"+r+" a "+i+","+s+" 0,0,0 "+a+" 0 l 0,"+-r;n=t.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",n).attr("transform","translate("+-a/2+","+-(r/2+s)+")");return Ut(e,n),e.intersect=function(t){var r=jt.rect(e,t),a=r.x-e.x;if(0!=i&&(Math.abs(a)<e.width/2||Math.abs(a)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-s)){let n=s*s*(1-a*a/(i*i));0!=n&&(n=Math.sqrt(n)),n=s-n,0<t.y-e.y&&(n=-n),r.y+=n}return r},t}),"cylinder"),oe=e((async(t,e)=>{var{shapeSvg:t,bbox:r,halfPadding:i}=await Ht(t,e,"node "+e.classes+" "+e.class,!0),s=t.insert("rect",":first-child"),n=e.positioned?e.width:r.width+e.padding,l=e.positioned?e.height:r.height+e.padding,o=e.positioned?-n/2:-r.width/2-i,r=e.positioned?-l/2:-r.height/2-i;return s.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",o).attr("y",r).attr("width",n).attr("height",l),e.props&&(i=new Set(Object.keys(e.props)),e.props.borders&&(he(s,e.props.borders,n,l),i.delete("borders")),i.forEach((t=>{a.warn("Unknown node property "+t)}))),Ut(e,s),e.intersect=function(t){return jt.rect(e,t)},t}),"rect"),ce=e((async(t,e)=>{var{shapeSvg:t,bbox:r,halfPadding:i}=await Ht(t,e,"node "+e.classes,!0),s=t.insert("rect",":first-child"),n=e.positioned?e.width:r.width+e.padding,l=e.positioned?e.height:r.height+e.padding,o=e.positioned?-n/2:-r.width/2-i,r=e.positioned?-l/2:-r.height/2-i;return s.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",o).attr("y",r).attr("width",n).attr("height",l),e.props&&(i=new Set(Object.keys(e.props)),e.props.borders&&(he(s,e.props.borders,n,l),i.delete("borders")),i.forEach((t=>{a.warn("Unknown node property "+t)}))),Ut(e,s),e.intersect=function(t){return jt.rect(e,t)},t}),"composite"),de=e((async(t,e)=>{t=(await Ht(t,e,"label",!0)).shapeSvg;var r,i=(a.trace("Classes = ",e.class),t.insert("rect",":first-child"));return i.attr("width",0).attr("height",0),t.attr("class","label edgeLabel"),e.props&&(r=new Set(Object.keys(e.props)),e.props.borders&&(he(i,e.props.borders,0,0),r.delete("borders")),r.forEach((t=>{a.warn("Unknown node property "+t)}))),Ut(e,i),e.intersect=function(t){return jt.rect(e,t)},t}),"labelRect");function he(t,r,i,s){const n=[];var l=e((t=>{n.push(t,0)}),"addBorder"),o=e((t=>{n.push(0,t)}),"skipBorder");(r.includes("t")?(a.debug("add top border"),l):o)(i),(r.includes("r")?(a.debug("add right border"),l):o)(s),(r.includes("b")?(a.debug("add bottom border"),l):o)(i),(r.includes("l")?(a.debug("add left border"),l):o)(s),t.attr("stroke-dasharray",n.join(" "))}e(he,"applyNodePropertyBorders");var ge=e((async(t,e)=>{let s;s=e.classes?"node "+e.classes:"node default";var n=(t=t.insert("g").attr("class",s).attr("id",e.domId||e.id)).insert("rect",":first-child"),l=t.insert("line"),c=t.insert("g").attr("class","label");let d="";d="object"==typeof(x=e.labelText.flat?e.labelText.flat():e.labelText)?x[0]:x,a.info("Label text abc79",d,x,"object"==typeof x);var h=c.node().appendChild(await bt(d,e.labelStyle,!0,!0));let g={width:0,height:0};o(r().flowchart.htmlLabels)&&(p=h.children[0],u=i(h),g=p.getBoundingClientRect(),u.attr("width",g.width),u.attr("height",g.height)),a.info("Text 2",x);var y,p=x.slice(1,x.length),u=h.getBBox(),x=c.node().appendChild(await bt(p.join?p.join("<br/>"):p,e.labelStyle,!0,!0));o(r().flowchart.htmlLabels)&&(p=x.children[0],y=i(x),g=p.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)),p=e.padding/2;return i(x).attr("transform","translate( "+(g.width>u.width?0:(u.width-g.width)/2)+", "+(u.height+p+5)+")"),i(h).attr("transform","translate( "+(g.width<u.width?0:-(u.width-g.width)/2)+", 0)"),g=c.node().getBBox(),c.attr("transform","translate("+-g.width/2+", "+(-g.height/2-p+3)+")"),n.attr("class","outer title-state").attr("x",-g.width/2-p).attr("y",-g.height/2-p).attr("width",g.width+e.padding).attr("height",g.height+e.padding),l.attr("class","divider").attr("x1",-g.width/2-p).attr("x2",g.width/2+p).attr("y1",-g.height/2-p+u.height+p).attr("y2",-g.height/2-p+u.height+p),Ut(e,n),e.intersect=function(t){return jt.rect(e,t)},t}),"rectWithTitle"),ye=e((async(t,e)=>{var{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.height+e.padding,r=(r=r.width+a/4+e.padding,t.insert("rect",":first-child").attr("style",e.style).attr("rx",a/2).attr("ry",a/2).attr("x",-r/2).attr("y",-a/2).attr("width",r).attr("height",a));return Ut(e,r),e.intersect=function(t){return jt.rect(e,t)},t}),"stadium"),pe=e((async(t,e)=>{const{shapeSvg:r,bbox:i,halfPadding:s}=await Ht(t,e,Gt(e,void 0),!0);return(t=r.insert("circle",":first-child")).attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+s).attr("width",i.width+e.padding).attr("height",i.height+e.padding),a.info("Circle main"),Ut(e,t),e.intersect=function(t){return a.info("Circle intersect",e,i.width/2+s,t),jt.circle(e,i.width/2+s,t)},r}),"circle"),ue=e((async(t,e)=>{const{shapeSvg:r,bbox:i,halfPadding:s}=await Ht(t,e,Gt(e,void 0),!0);var n=(t=r.insert("g",":first-child")).insert("circle"),l=t.insert("circle");return t.attr("class",e.class),n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+s+5).attr("width",i.width+e.padding+10).attr("height",i.height+e.padding+10),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",i.width/2+s).attr("width",i.width+e.padding).attr("height",i.height+e.padding),a.info("DoubleCircle main"),Ut(e,n),e.intersect=function(t){return a.info("DoubleCircle intersect",e,i.width/2+s+5,t),jt.circle(e,i.width/2+s+5,t)},r}),"doublecircle"),xe=e((async(t,e)=>{var r,{shapeSvg:t,bbox:r}=await Ht(t,e,Gt(e,void 0),!0),a=r.width+e.padding;const i=[{x:0,y:0},{x:a,y:0},{x:a,y:-(r=r.height+e.padding)},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-r},{x:-8,y:-r},{x:-8,y:0}];return(a=Kt(t,a,r,i)).attr("style",e.style),Ut(e,a),e.intersect=function(t){return jt.polygon(e,i,t)},t}),"subroutine"),be=e(((t,e)=>{var r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Ut(e,r),e.intersect=function(t){return jt.circle(e,7,t)},t}),"start"),fe=e(((t,e,r)=>{let a=70,i=10;return"LR"===r&&(a=10,i=70),r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).append("rect").attr("x",-1*a/2).attr("y",-1*i/2).attr("width",a).attr("height",i).attr("class","fork-join"),Ut(e,r),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return jt.rect(e,t)},t}),"forkJoin"),me={rhombus:Jt,composite:ce,question:Jt,rect:oe,labelRect:de,rectWithTitle:ge,choice:Vt,circle:pe,doublecircle:ue,stadium:ye,hexagon:Qt,block_arrow:te,rect_left_inv_arrow:ee,lean_right:re,lean_left:ae,trapezoid:ie,inv_trapezoid:se,rect_right_inv_arrow:ne,cylinder:le,start:be,end:e(((t,e)=>{var r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("circle",":first-child"),a=t.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Ut(e,a),e.intersect=function(t){return jt.circle(e,7,t)},t}),"end"),note:qt,subroutine:xe,fork:fe,join:fe,class_box:e((async(t,e)=>{var a=e.padding/2;let s;s=e.classes?"node "+e.classes:"node default";var n=(t=t.insert("g").attr("class",s).attr("id",e.domId||e.id)).insert("rect",":first-child"),l=t.insert("line"),c=t.insert("line");let d=0,h=4;const g=t.insert("g").attr("class","label");let y=0;var p=e.classData.annotations?.[0],u=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"";let x=(u=g.node().appendChild(await bt(u,e.labelStyle,!0,!0))).getBBox(),b=(o(r().flowchart.htmlLabels)&&(m=u.children[0],f=i(u),x=m.getBoundingClientRect(),f.attr("width",x.width),f.attr("height",x.height)),e.classData.annotations[0]&&(h+=x.height+4,d+=x.width),e.classData.label);void 0!==e.classData.type&&""!==e.classData.type&&(r().flowchart.htmlLabels?b+="&lt;"+e.classData.type+"&gt;":b+="<"+e.classData.type+">");var f,m=g.node().appendChild(await bt(b,e.labelStyle,!0,!0));i(m).attr("class","classTitle");let w=m.getBBox();o(r().flowchart.htmlLabels)&&(f=m.children[0],S=i(m),w=f.getBoundingClientRect(),S.attr("width",w.width),S.attr("height",w.height)),h+=w.height+4,w.width>d&&(d=w.width);const k=[],L=(e.classData.members.forEach((async t=>{let a=(t=t.getDisplayDetails()).displayText;var s,n;r().flowchart.htmlLabels&&(a=a.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let l=(t=g.node().appendChild(await bt(a,t.cssStyle||e.labelStyle,!0,!0))).getBBox();o(r().flowchart.htmlLabels)&&(s=t.children[0],n=i(t),l=s.getBoundingClientRect(),n.attr("width",l.width),n.attr("height",l.height)),l.width>d&&(d=l.width),h+=l.height+4,k.push(t)})),h+=8,[]);e.classData.methods.forEach((async t=>{let a=(t=t.getDisplayDetails()).displayText;var s,n;r().flowchart.htmlLabels&&(a=a.replace(/</g,"&lt;").replace(/>/g,"&gt;"));let l=(t=g.node().appendChild(await bt(a,t.cssStyle||e.labelStyle,!0,!0))).getBBox();o(r().flowchart.htmlLabels)&&(s=t.children[0],n=i(t),l=s.getBoundingClientRect(),n.attr("width",l.width),n.attr("height",l.height)),l.width>d&&(d=l.width),h+=l.height+4,L.push(t)})),h+=8,p&&(f=(d-x.width)/2,i(u).attr("transform","translate( "+(-1*d/2+f)+", "+-1*h/2+")"),y=x.height+4);var S=(d-w.width)/2;return i(m).attr("transform","translate( "+(-1*d/2+S)+", "+(-1*h/2+y)+")"),y+=w.height+4,l.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-h/2-a+8+y).attr("y2",-h/2-a+8+y),y+=8,k.forEach((t=>{i(t).attr("transform","translate( "+-d/2+", "+(-1*h/2+y+4)+")"),t=t?.getBBox(),y+=(t?.height??0)+4})),y+=8,c.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-h/2-a+8+y).attr("y2",-h/2-a+8+y),y+=8,L.forEach((t=>{i(t).attr("transform","translate( "+-d/2+", "+(-1*h/2+y)+")"),t=t?.getBBox(),y+=(t?.height??0)+4})),n.attr("style",e.style).attr("class","outer title-state").attr("x",-d/2-a).attr("y",-h/2-a).attr("width",d+e.padding).attr("height",h+e.padding),Ut(e,n),e.intersect=function(t){return jt.rect(e,t)},t}),"class_box")},we={},ke=e((async(t,e,a)=>{let i,s;if(e.link){let n;"sandbox"===r().securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),i=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n),s=await me[e.shape](i,e,a)}else s=await me[e.shape](t,e,a),i=s;return e.tooltip&&s.attr("title",e.tooltip),e.class&&s.attr("class","node default "+e.class),we[e.id]=i,e.haveCallback&&we[e.id].attr("class",we[e.id].attr("class")+" clickable"),i}),"insertNode"),Le=e((t=>{var e=we[t.id],r=(a.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")"),t.diff||0);return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r}),"positionNode");function Se(t,e,r=!1){let a,i="default",s=(0<(t?.classes?.length||0)&&(i=(t?.classes??[]).join(" ")),i+=" flowchart-label",0),o="";switch(t.type){case"round":s=5,o="rect";break;case"composite":s=0,o="composite",a=0;break;case"square":case"group":default:o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":case"rect_left_inv_arrow":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"doublecircle":o="doublecircle"}var c=n(t?.styles??[]),d=t.label,h=t.size??{width:0,height:0,x:0,y:0};return{labelStyle:c.labelStyle,shape:o,labelText:d,rx:s,ry:s,class:i,style:c.style,id:t.id,directions:t.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:t.type,padding:a??l()?.block?.padding??0}}async function _e(t,e,r){var a;"group"!==(e=Se(e,0,!1)).type&&(a=l(),a=(t=await ke(t,e,{config:a})).node().getBBox(),(e=r.getBlock(e.id)).size={width:a.width,height:a.height,x:0,y:0,node:t},r.setBlock(e),t.remove())}async function ve(t,e,r){var a=Se(e,0,!0);"space"!==r.getBlock(a.id).type&&(r=l(),await ke(t,a,{config:r}),e.intersect=a?.intersect,Le(a))}async function Ee(t,e,r,a){for(const i of e)await a(t,i,r),i.children&&await Ee(t,i.children,r,a)}async function De(t,e,r){await Ee(t,e,r,_e)}async function Te(t,e,r){await Ee(t,e,r,ve)}async function Ce(t,e,r,a,i){var s,n,l=new S({multigraph:!0,compound:!0});l.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const t of r)t.size&&l.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(const r of e)r.start&&r.end&&(n=a.getBlock(r.start),s=a.getBlock(r.end),n?.size)&&s?.size&&(n=n.size,s=s.size,n=[{x:n.x,y:n.y},{x:n.x+(s.x-n.x)/2,y:n.y+(s.y-n.y)/2},{x:s.x,y:s.y}],Ct(t,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:n,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",l,i),r.label)&&(await St(t,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:n,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),vt({...r,x:n[1].x,y:n[1].y},{originalPath:n}))}e(Se,"getNodeFromBlock"),e(_e,"calculateBlockSize"),e(ve,"insertBlockPositioned"),e(Ee,"performOperations"),e(De,"calculateBlockSizes"),e(Te,"insertBlocks"),e(Ce,"insertEdges");var Ne=e((function(t,e){return e.db.getClasses()}),"getClasses"),$e={parser:E,db:rt,renderer:{draw:e((async function(t,e,r,s){var{securityLevel:n,block:o}=l(),c=s.db;let d;"sandbox"===n&&(d=i("#i"+e));var h=i("sandbox"===n?d.nodes()[0].contentDocument.body:"body"),n="sandbox"===n?h.select(`[id="${e}"]`):i(`[id="${e}"]`),g=(h=(lt(n,["point","circle","cross"],s.type,e),c.getBlocks()),s=c.getBlocksFlat(),c.getEdges()),y=n.insert("g").attr("class","block"),p=(await De(y,h,c),pt(c));await Te(y,h,c),await Ce(y,g,s,c,e),p&&(h=p,y=Math.max(1,Math.round(h.width/h.height*.125)),g=h.height+y+10,s=h.width+10,c=o.useMaxWidth,u(n,g,s,!!c),a.debug("Here Bounds",p,h),n.attr("viewBox",`${h.x-5} ${h.y-5} ${h.width+10} `+(h.height+10)))}),"draw"),getClasses:Ne},styles:it};export{$e as diagram};