jekyll-ham 1.0.4 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (366) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -2
  3. data/_layouts/default.html +6 -0
  4. data/_layouts/page.html +1 -1
  5. data/assets/mermaid/Diagram.d.ts +33 -0
  6. data/assets/mermaid/Tableau10-31042135.js +10 -0
  7. data/assets/mermaid/Tableau10-558cc280.js +9 -0
  8. data/assets/mermaid/__mocks__/mermaidAPI.d.ts +13 -0
  9. data/assets/mermaid/accessibility.d.ts +27 -0
  10. data/assets/mermaid/accessibility.spec.d.ts +1 -0
  11. data/assets/mermaid/arc-c0f908ab.js +148 -0
  12. data/assets/mermaid/arc-d1f6357e.js +86 -0
  13. data/assets/mermaid/array-2ff2c7a6.js +6 -0
  14. data/assets/mermaid/array-b7dcf730.js +6 -0
  15. data/assets/mermaid/assignWithDepth.d.ts +30 -0
  16. data/assets/mermaid/blockDiagram-5dc23a45.js +1230 -0
  17. data/assets/mermaid/blockDiagram-9f4a6865.js +1822 -0
  18. data/assets/mermaid/blockDiagram-efe38566.js +1818 -0
  19. data/assets/mermaid/c4Diagram-1e775db3.js +1579 -0
  20. data/assets/mermaid/c4Diagram-ae766693.js +2473 -0
  21. data/assets/mermaid/c4Diagram-af207393.js +2463 -0
  22. data/assets/mermaid/channel-ebbc4130.js +5 -0
  23. data/assets/mermaid/channel-f9001828.js +8 -0
  24. data/assets/mermaid/classDiagram-72b9c71d.js +356 -0
  25. data/assets/mermaid/classDiagram-f52caa06.js +220 -0
  26. data/assets/mermaid/classDiagram-fb54d2a0.js +363 -0
  27. data/assets/mermaid/classDiagram-v2-640c694e.js +206 -0
  28. data/assets/mermaid/classDiagram-v2-a2b738ad.js +298 -0
  29. data/assets/mermaid/classDiagram-v2-fedb80f6.js +290 -0
  30. data/assets/mermaid/clone-9ea6bfeb.js +8 -0
  31. data/assets/mermaid/clone-afc2f047.js +8 -0
  32. data/assets/mermaid/config.d.ts +98 -0
  33. data/assets/mermaid/config.spec.d.ts +1 -0
  34. data/assets/mermaid/config.type.d.ts +1534 -0
  35. data/assets/mermaid/createText-03b82060.js +2966 -0
  36. data/assets/mermaid/createText-b70fe78a.js +4929 -0
  37. data/assets/mermaid/createText-ca0c5216.js +251 -0
  38. data/assets/mermaid/dagre-wrapper/blockArrowHelper.d.ts +8 -0
  39. data/assets/mermaid/dagre-wrapper/clusters.d.ts +4 -0
  40. data/assets/mermaid/dagre-wrapper/createLabel.d.ts +9 -0
  41. data/assets/mermaid/dagre-wrapper/edgeMarker.d.ts +12 -0
  42. data/assets/mermaid/dagre-wrapper/edgeMarker.spec.d.ts +1 -0
  43. data/assets/mermaid/dagre-wrapper/edges.d.ts +14 -0
  44. data/assets/mermaid/dagre-wrapper/index.d.ts +1 -0
  45. data/assets/mermaid/dagre-wrapper/intersect/index.d.ts +13 -0
  46. data/assets/mermaid/dagre-wrapper/intersect/intersect-circle.d.ts +10 -0
  47. data/assets/mermaid/dagre-wrapper/intersect/intersect-ellipse.d.ts +11 -0
  48. data/assets/mermaid/dagre-wrapper/intersect/intersect-line.d.ts +13 -0
  49. data/assets/mermaid/dagre-wrapper/intersect/intersect-node.d.ts +6 -0
  50. data/assets/mermaid/dagre-wrapper/intersect/intersect-polygon.d.ts +10 -0
  51. data/assets/mermaid/dagre-wrapper/intersect/intersect-rect.d.ts +5 -0
  52. data/assets/mermaid/dagre-wrapper/markers.d.ts +2 -0
  53. data/assets/mermaid/dagre-wrapper/mermaid-graphlib.d.ts +8 -0
  54. data/assets/mermaid/dagre-wrapper/nodes.d.ts +4 -0
  55. data/assets/mermaid/dagre-wrapper/shapes/note.d.ts +2 -0
  56. data/assets/mermaid/dagre-wrapper/shapes/util.d.ts +14 -0
  57. data/assets/mermaid/defaultConfig.d.ts +12 -0
  58. data/assets/mermaid/diagram-api/comments.d.ts +6 -0
  59. data/assets/mermaid/diagram-api/comments.spec.d.ts +1 -0
  60. data/assets/mermaid/diagram-api/detectType.d.ts +42 -0
  61. data/assets/mermaid/diagram-api/diagram-orchestration.d.ts +1 -0
  62. data/assets/mermaid/diagram-api/diagram-orchestration.spec.d.ts +1 -0
  63. data/assets/mermaid/diagram-api/diagramAPI.d.ts +31 -0
  64. data/assets/mermaid/diagram-api/diagramAPI.spec.d.ts +1 -0
  65. data/assets/mermaid/diagram-api/frontmatter.d.ts +18 -0
  66. data/assets/mermaid/diagram-api/frontmatter.spec.d.ts +1 -0
  67. data/assets/mermaid/diagram-api/loadDiagram.d.ts +1 -0
  68. data/assets/mermaid/diagram-api/regexes.d.ts +3 -0
  69. data/assets/mermaid/diagram-api/types.d.ts +84 -0
  70. data/assets/mermaid/diagram.spec.d.ts +1 -0
  71. data/assets/mermaid/diagrams/block/blockDB.d.ts +54 -0
  72. data/assets/mermaid/diagrams/block/blockDetector.d.ts +3 -0
  73. data/assets/mermaid/diagrams/block/blockDiagram.d.ts +2 -0
  74. data/assets/mermaid/diagrams/block/blockRenderer.d.ts +15 -0
  75. data/assets/mermaid/diagrams/block/blockTypes.d.ts +36 -0
  76. data/assets/mermaid/diagrams/block/blockUtils.d.ts +1 -0
  77. data/assets/mermaid/diagrams/block/layout.d.ts +13 -0
  78. data/assets/mermaid/diagrams/block/layout.spec.d.ts +1 -0
  79. data/assets/mermaid/diagrams/block/parser/block.spec.d.ts +1 -0
  80. data/assets/mermaid/diagrams/block/renderHelpers.d.ts +10 -0
  81. data/assets/mermaid/diagrams/block/styles.d.ts +18 -0
  82. data/assets/mermaid/diagrams/c4/c4Db.d.ts +127 -0
  83. data/assets/mermaid/diagrams/c4/c4Detector.d.ts +3 -0
  84. data/assets/mermaid/diagrams/c4/c4Diagram.d.ts +2 -0
  85. data/assets/mermaid/diagrams/c4/c4Renderer.d.ts +12 -0
  86. data/assets/mermaid/diagrams/c4/styles.d.ts +2 -0
  87. data/assets/mermaid/diagrams/c4/svgDraw.d.ts +36 -0
  88. data/assets/mermaid/diagrams/class/classDb.d.ts +144 -0
  89. data/assets/mermaid/diagrams/class/classDetector-V2.d.ts +3 -0
  90. data/assets/mermaid/diagrams/class/classDetector.d.ts +3 -0
  91. data/assets/mermaid/diagrams/class/classDiagram-v2.d.ts +2 -0
  92. data/assets/mermaid/diagrams/class/classDiagram.d.ts +2 -0
  93. data/assets/mermaid/diagrams/class/classDiagram.spec.d.ts +1 -0
  94. data/assets/mermaid/diagrams/class/classRenderer-v2.d.ts +57 -0
  95. data/assets/mermaid/diagrams/class/classRenderer.d.ts +5 -0
  96. data/assets/mermaid/diagrams/class/classTypes.d.ts +78 -0
  97. data/assets/mermaid/diagrams/class/classTypes.spec.d.ts +1 -0
  98. data/assets/mermaid/diagrams/class/styles.d.ts +2 -0
  99. data/assets/mermaid/diagrams/class/svgDraw.d.ts +25 -0
  100. data/assets/mermaid/diagrams/common/common.d.ts +110 -0
  101. data/assets/mermaid/diagrams/common/common.spec.d.ts +1 -0
  102. data/assets/mermaid/diagrams/common/commonDb.d.ts +7 -0
  103. data/assets/mermaid/diagrams/common/commonTypes.d.ts +51 -0
  104. data/assets/mermaid/diagrams/common/svgDrawCommon.d.ts +15 -0
  105. data/assets/mermaid/diagrams/er/erDb.d.ts +49 -0
  106. data/assets/mermaid/diagrams/er/erDetector.d.ts +3 -0
  107. data/assets/mermaid/diagrams/er/erDiagram.d.ts +34 -0
  108. data/assets/mermaid/diagrams/er/erMarkers.d.ts +24 -0
  109. data/assets/mermaid/diagrams/er/erRenderer.d.ts +19 -0
  110. data/assets/mermaid/diagrams/er/erRenderer.spec.d.ts +1 -0
  111. data/assets/mermaid/diagrams/er/styles.d.ts +2 -0
  112. data/assets/mermaid/diagrams/error/errorDiagram.d.ts +3 -0
  113. data/assets/mermaid/diagrams/error/errorRenderer.d.ts +12 -0
  114. data/assets/mermaid/diagrams/flowchart/elk/detector.d.ts +3 -0
  115. data/assets/mermaid/diagrams/flowchart/elk/detector.spec.d.ts +1 -0
  116. data/assets/mermaid/diagrams/flowchart/elk/flowRenderer-elk.d.ts +10 -0
  117. data/assets/mermaid/diagrams/flowchart/elk/flowchart-elk-definition.d.ts +10 -0
  118. data/assets/mermaid/diagrams/flowchart/elk/render-utils.d.ts +5 -0
  119. data/assets/mermaid/diagrams/flowchart/elk/render-utils.spec.d.ts +1 -0
  120. data/assets/mermaid/diagrams/flowchart/elk/styles.d.ts +19 -0
  121. data/assets/mermaid/diagrams/flowchart/flowChartShapes.d.ts +9 -0
  122. data/assets/mermaid/diagrams/flowchart/flowDb.d.ts +87 -0
  123. data/assets/mermaid/diagrams/flowchart/flowDetector-v2.d.ts +3 -0
  124. data/assets/mermaid/diagrams/flowchart/flowDetector.d.ts +3 -0
  125. data/assets/mermaid/diagrams/flowchart/flowDiagram-v2.d.ts +57 -0
  126. data/assets/mermaid/diagrams/flowchart/flowDiagram.d.ts +57 -0
  127. data/assets/mermaid/diagrams/flowchart/flowRenderer-v2.d.ts +13 -0
  128. data/assets/mermaid/diagrams/flowchart/flowRenderer.d.ts +13 -0
  129. data/assets/mermaid/diagrams/flowchart/styles.d.ts +18 -0
  130. data/assets/mermaid/diagrams/gantt/ganttDb.d.ts +106 -0
  131. data/assets/mermaid/diagrams/gantt/ganttDb.spec.d.ts +1 -0
  132. data/assets/mermaid/diagrams/gantt/ganttDetector.d.ts +3 -0
  133. data/assets/mermaid/diagrams/gantt/ganttDiagram.d.ts +2 -0
  134. data/assets/mermaid/diagrams/gantt/ganttRenderer.d.ts +7 -0
  135. data/assets/mermaid/diagrams/gantt/styles.d.ts +2 -0
  136. data/assets/mermaid/diagrams/git/gitGraphAst.d.ts +61 -0
  137. data/assets/mermaid/diagrams/git/gitGraphDetector.d.ts +3 -0
  138. data/assets/mermaid/diagrams/git/gitGraphDiagram.d.ts +2 -0
  139. data/assets/mermaid/diagrams/git/gitGraphRenderer.d.ts +5 -0
  140. data/assets/mermaid/diagrams/git/styles.d.ts +2 -0
  141. data/assets/mermaid/diagrams/info/info.spec.d.ts +1 -0
  142. data/assets/mermaid/diagrams/info/infoDb.d.ts +5 -0
  143. data/assets/mermaid/diagrams/info/infoDetector.d.ts +2 -0
  144. data/assets/mermaid/diagrams/info/infoDiagram.d.ts +2 -0
  145. data/assets/mermaid/diagrams/info/infoRenderer.d.ts +4 -0
  146. data/assets/mermaid/diagrams/info/infoTypes.d.ts +9 -0
  147. data/assets/mermaid/diagrams/mindmap/detector.d.ts +3 -0
  148. data/assets/mermaid/diagrams/mindmap/mindmap-definition.d.ts +2 -0
  149. data/assets/mermaid/diagrams/mindmap/mindmap.spec.d.ts +1 -0
  150. data/assets/mermaid/diagrams/mindmap/mindmapDb.d.ts +30 -0
  151. data/assets/mermaid/diagrams/mindmap/mindmapRenderer.d.ts +21 -0
  152. data/assets/mermaid/diagrams/mindmap/mindmapTypes.d.ts +20 -0
  153. data/assets/mermaid/diagrams/mindmap/styles.d.ts +3 -0
  154. data/assets/mermaid/diagrams/mindmap/svgDraw.d.ts +13 -0
  155. data/assets/mermaid/diagrams/pie/pie.spec.d.ts +1 -0
  156. data/assets/mermaid/diagrams/pie/pieDb.d.ts +6 -0
  157. data/assets/mermaid/diagrams/pie/pieDetector.d.ts +2 -0
  158. data/assets/mermaid/diagrams/pie/pieDiagram.d.ts +2 -0
  159. data/assets/mermaid/diagrams/pie/pieRenderer.d.ts +13 -0
  160. data/assets/mermaid/diagrams/pie/pieStyles.d.ts +3 -0
  161. data/assets/mermaid/diagrams/pie/pieTypes.d.ts +53 -0
  162. data/assets/mermaid/diagrams/quadrant-chart/parser/quadrant.jison.spec.d.ts +1 -0
  163. data/assets/mermaid/diagrams/quadrant-chart/quadrantBuilder.d.ts +118 -0
  164. data/assets/mermaid/diagrams/quadrant-chart/quadrantDb.d.ts +38 -0
  165. data/assets/mermaid/diagrams/quadrant-chart/quadrantDetector.d.ts +3 -0
  166. data/assets/mermaid/diagrams/quadrant-chart/quadrantDiagram.d.ts +2 -0
  167. data/assets/mermaid/diagrams/quadrant-chart/quadrantRenderer.d.ts +6 -0
  168. data/assets/mermaid/diagrams/requirement/requirementDb.d.ts +70 -0
  169. data/assets/mermaid/diagrams/requirement/requirementDetector.d.ts +3 -0
  170. data/assets/mermaid/diagrams/requirement/requirementDiagram.d.ts +2 -0
  171. data/assets/mermaid/diagrams/requirement/requirementMarkers.d.ts +10 -0
  172. data/assets/mermaid/diagrams/requirement/requirementRenderer.d.ts +7 -0
  173. data/assets/mermaid/diagrams/requirement/styles.d.ts +2 -0
  174. data/assets/mermaid/diagrams/sankey/parser/sankey.spec.d.ts +1 -0
  175. data/assets/mermaid/diagrams/sankey/sankeyDB.d.ts +36 -0
  176. data/assets/mermaid/diagrams/sankey/sankeyDetector.d.ts +3 -0
  177. data/assets/mermaid/diagrams/sankey/sankeyDiagram.d.ts +2 -0
  178. data/assets/mermaid/diagrams/sankey/sankeyRenderer.d.ts +14 -0
  179. data/assets/mermaid/diagrams/sankey/sankeyUtils.d.ts +1 -0
  180. data/assets/mermaid/diagrams/sequence/sequenceDb.d.ts +153 -0
  181. data/assets/mermaid/diagrams/sequence/sequenceDetector.d.ts +3 -0
  182. data/assets/mermaid/diagrams/sequence/sequenceDiagram.d.ts +2 -0
  183. data/assets/mermaid/diagrams/sequence/sequenceRenderer.d.ts +202 -0
  184. data/assets/mermaid/diagrams/sequence/styles.d.ts +2 -0
  185. data/assets/mermaid/diagrams/sequence/svgDraw.d.ts +73 -0
  186. data/assets/mermaid/diagrams/state/id-cache.d.ts +11 -0
  187. data/assets/mermaid/diagrams/state/shapes.d.ts +14 -0
  188. data/assets/mermaid/diagrams/state/stateCommon.d.ts +22 -0
  189. data/assets/mermaid/diagrams/state/stateDb.d.ts +91 -0
  190. data/assets/mermaid/diagrams/state/stateDetector-V2.d.ts +3 -0
  191. data/assets/mermaid/diagrams/state/stateDetector.d.ts +3 -0
  192. data/assets/mermaid/diagrams/state/stateDiagram-v2.d.ts +2 -0
  193. data/assets/mermaid/diagrams/state/stateDiagram.d.ts +2 -0
  194. data/assets/mermaid/diagrams/state/stateRenderer-v2.d.ts +20 -0
  195. data/assets/mermaid/diagrams/state/stateRenderer.d.ts +7 -0
  196. data/assets/mermaid/diagrams/state/styles.d.ts +2 -0
  197. data/assets/mermaid/diagrams/timeline/detector.d.ts +3 -0
  198. data/assets/mermaid/diagrams/timeline/styles.d.ts +2 -0
  199. data/assets/mermaid/diagrams/timeline/svgDraw.d.ts +46 -0
  200. data/assets/mermaid/diagrams/timeline/timeline-definition.d.ts +10 -0
  201. data/assets/mermaid/diagrams/timeline/timelineDb.d.ts +20 -0
  202. data/assets/mermaid/diagrams/timeline/timelineRenderer.d.ts +19 -0
  203. data/assets/mermaid/diagrams/user-journey/journeyDb.d.ts +30 -0
  204. data/assets/mermaid/diagrams/user-journey/journeyDetector.d.ts +3 -0
  205. data/assets/mermaid/diagrams/user-journey/journeyDiagram.d.ts +2 -0
  206. data/assets/mermaid/diagrams/user-journey/journeyRenderer.d.ts +30 -0
  207. data/assets/mermaid/diagrams/user-journey/styles.d.ts +2 -0
  208. data/assets/mermaid/diagrams/user-journey/svgDraw.d.ts +20 -0
  209. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/bandAxis.d.ts +12 -0
  210. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/baseAxis.d.ts +38 -0
  211. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/index.d.ts +12 -0
  212. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/linearAxis.d.ts +11 -0
  213. data/assets/mermaid/diagrams/xychart/chartBuilder/components/chartTitle.d.ts +16 -0
  214. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/barPlot.d.ts +12 -0
  215. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/index.d.ts +20 -0
  216. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/linePlot.d.ts +11 -0
  217. data/assets/mermaid/diagrams/xychart/chartBuilder/index.d.ts +5 -0
  218. data/assets/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts +132 -0
  219. data/assets/mermaid/diagrams/xychart/chartBuilder/orchestrator.d.ts +12 -0
  220. data/assets/mermaid/diagrams/xychart/chartBuilder/textDimensionCalculator.d.ts +10 -0
  221. data/assets/mermaid/diagrams/xychart/parser/xychart.jison.spec.d.ts +1 -0
  222. data/assets/mermaid/diagrams/xychart/xychartDb.d.ts +40 -0
  223. data/assets/mermaid/diagrams/xychart/xychartDetector.d.ts +3 -0
  224. data/assets/mermaid/diagrams/xychart/xychartDiagram.d.ts +2 -0
  225. data/assets/mermaid/diagrams/xychart/xychartRenderer.d.ts +6 -0
  226. data/assets/mermaid/docs/vite.config.d.ts +2 -0
  227. data/assets/mermaid/edges-066a5561.js +1840 -0
  228. data/assets/mermaid/edges-16357fde.js +1083 -0
  229. data/assets/mermaid/edges-ce5cfb7c.js +1840 -0
  230. data/assets/mermaid/erDiagram-09d1c15f.js +1176 -0
  231. data/assets/mermaid/erDiagram-543717f2.js +1321 -0
  232. data/assets/mermaid/erDiagram-c7ff1bec.js +931 -0
  233. data/assets/mermaid/errors.d.ts +3 -0
  234. data/assets/mermaid/flowDb-9a89ea33.js +1126 -0
  235. data/assets/mermaid/flowDb-ba9bd7fa.js +1713 -0
  236. data/assets/mermaid/flowDb-c1833063.js +1714 -0
  237. data/assets/mermaid/flowDiagram-aadb13b0.js +797 -0
  238. data/assets/mermaid/flowDiagram-b222e15a.js +614 -0
  239. data/assets/mermaid/flowDiagram-b5e7ba30.js +1278 -0
  240. data/assets/mermaid/flowDiagram-v2-13329dc7.js +40 -0
  241. data/assets/mermaid/flowDiagram-v2-54711e03.js +32 -0
  242. data/assets/mermaid/flowDiagram-v2-f2119625.js +25 -0
  243. data/assets/mermaid/flowchart-elk-definition-2d49707c.js +93397 -0
  244. data/assets/mermaid/flowchart-elk-definition-ae0efee6.js +814 -0
  245. data/assets/mermaid/flowchart-elk-definition-cf813a97.js +48407 -0
  246. data/assets/mermaid/ganttDiagram-12cf43db.js +3445 -0
  247. data/assets/mermaid/ganttDiagram-3c2fde2b.js +2501 -0
  248. data/assets/mermaid/ganttDiagram-b62c793e.js +2061 -0
  249. data/assets/mermaid/gitGraphDiagram-942e62fe.js +1800 -0
  250. data/assets/mermaid/gitGraphDiagram-b9392a12.js +1790 -0
  251. data/assets/mermaid/gitGraphDiagram-c3a0619c.js +1264 -0
  252. data/assets/mermaid/graph-0ee63739.js +881 -0
  253. data/assets/mermaid/graph-fe24fab6.js +1285 -0
  254. data/assets/mermaid/index-01f381cb.js +622 -0
  255. data/assets/mermaid/index-bb6d8841.js +373 -0
  256. data/assets/mermaid/index-fc479858.js +663 -0
  257. data/assets/mermaid/infoDiagram-2f5c50c0.js +319 -0
  258. data/assets/mermaid/infoDiagram-94cd232f.js +520 -0
  259. data/assets/mermaid/infoDiagram-d0d5c9bd.js +510 -0
  260. data/assets/mermaid/init-cc95ec8e.js +16 -0
  261. data/assets/mermaid/init-f9637058.js +16 -0
  262. data/assets/mermaid/interactionDb.d.ts +2 -0
  263. data/assets/mermaid/journeyDiagram-14fe341a.js +804 -0
  264. data/assets/mermaid/journeyDiagram-6625b456.js +1191 -0
  265. data/assets/mermaid/journeyDiagram-b56e6921.js +1183 -0
  266. data/assets/mermaid/katex-d90b6d29.js +11624 -0
  267. data/assets/mermaid/katex-ffb0e8f1.js +14432 -0
  268. data/assets/mermaid/layout-163b9689.js +2314 -0
  269. data/assets/mermaid/layout-fd473db2.js +1536 -0
  270. data/assets/mermaid/line-24d93f1b.js +34 -0
  271. data/assets/mermaid/line-87f517ef.js +50 -0
  272. data/assets/mermaid/linear-0ad15847.js +595 -0
  273. data/assets/mermaid/linear-9bcf74c4.js +447 -0
  274. data/assets/mermaid/logger.d.ts +9 -0
  275. data/assets/mermaid/mermaid-6dc72991.js +6461 -0
  276. data/assets/mermaid/mermaid-9f2aa176.js +8112 -0
  277. data/assets/mermaid/mermaid-dcacb631.js +12793 -0
  278. data/assets/mermaid/mermaid.core.mjs +14 -0
  279. data/assets/mermaid/mermaid.d.ts +146 -0
  280. data/assets/mermaid/mermaid.esm.min.mjs +4 -0
  281. data/assets/mermaid/mermaid.esm.mjs +4 -0
  282. data/assets/mermaid/mermaid.js +195755 -0
  283. data/assets/mermaid/mermaid.min.js +2029 -0
  284. data/assets/mermaid/mermaid.spec.d.ts +1 -0
  285. data/assets/mermaid/mermaidAPI.d.ts +170 -0
  286. data/assets/mermaid/mermaidAPI.spec.d.ts +1 -0
  287. data/assets/mermaid/mindmap-definition-307c710a.js +1177 -0
  288. data/assets/mermaid/mindmap-definition-696ddea4.js +32342 -0
  289. data/assets/mermaid/mindmap-definition-9399c7e6.js +18760 -0
  290. data/assets/mermaid/ordinal-475e0c0c.js +82 -0
  291. data/assets/mermaid/ordinal-5695958c.js +65 -0
  292. data/assets/mermaid/path-39bad7e2.js +118 -0
  293. data/assets/mermaid/path-428ebac9.js +91 -0
  294. data/assets/mermaid/pieDiagram-828dae43.js +502 -0
  295. data/assets/mermaid/pieDiagram-bb1d19e5.js +722 -0
  296. data/assets/mermaid/pieDiagram-e854eaf0.js +772 -0
  297. data/assets/mermaid/preprocess.d.ts +10 -0
  298. data/assets/mermaid/quadrantDiagram-25a9848b.js +1199 -0
  299. data/assets/mermaid/quadrantDiagram-5fa00455.js +904 -0
  300. data/assets/mermaid/quadrantDiagram-c759a472.js +1207 -0
  301. data/assets/mermaid/rendering-util/createText.d.ts +11 -0
  302. data/assets/mermaid/rendering-util/handle-markdown-text.d.ts +6 -0
  303. data/assets/mermaid/rendering-util/handle-markdown-text.spec.d.ts +1 -0
  304. data/assets/mermaid/rendering-util/selectSvgElement.d.ts +8 -0
  305. data/assets/mermaid/rendering-util/splitText.d.ts +24 -0
  306. data/assets/mermaid/rendering-util/splitText.spec.d.ts +1 -0
  307. data/assets/mermaid/rendering-util/uid.d.ts +8 -0
  308. data/assets/mermaid/requirementDiagram-03163dc4.js +769 -0
  309. data/assets/mermaid/requirementDiagram-87253d64.js +1098 -0
  310. data/assets/mermaid/requirementDiagram-a721e157.js +1091 -0
  311. data/assets/mermaid/sankeyDiagram-33525efb.js +1198 -0
  312. data/assets/mermaid/sankeyDiagram-52ec8976.js +818 -0
  313. data/assets/mermaid/sankeyDiagram-707fac0f.js +660 -0
  314. data/assets/mermaid/sequenceDiagram-6894f283.js +3346 -0
  315. data/assets/mermaid/sequenceDiagram-9813c129.js +3336 -0
  316. data/assets/mermaid/sequenceDiagram-b517d154.js +2234 -0
  317. data/assets/mermaid/setupGraphViewbox.d.ts +3 -0
  318. data/assets/mermaid/stateDiagram-5dee940d.js +474 -0
  319. data/assets/mermaid/stateDiagram-5ec31577.js +467 -0
  320. data/assets/mermaid/stateDiagram-fca82b5b.js +275 -0
  321. data/assets/mermaid/stateDiagram-v2-1992cada.js +333 -0
  322. data/assets/mermaid/stateDiagram-v2-992e82a1.js +325 -0
  323. data/assets/mermaid/stateDiagram-v2-ed04200a.js +190 -0
  324. data/assets/mermaid/styles-0784dbeb.js +1363 -0
  325. data/assets/mermaid/styles-11e81fdd.js +1089 -0
  326. data/assets/mermaid/styles-36a1a2e8.js +1483 -0
  327. data/assets/mermaid/styles-483fbfea.js +509 -0
  328. data/assets/mermaid/styles-727cdd61.js +571 -0
  329. data/assets/mermaid/styles-b83b31c9.js +1484 -0
  330. data/assets/mermaid/styles-cacbff60.js +960 -0
  331. data/assets/mermaid/styles-e75131e4.js +433 -0
  332. data/assets/mermaid/styles-f80da881.js +1363 -0
  333. data/assets/mermaid/styles.d.ts +12 -0
  334. data/assets/mermaid/styles.spec.d.ts +1 -0
  335. data/assets/mermaid/svgDrawCommon-5e1cfd1d.js +101 -0
  336. data/assets/mermaid/svgDrawCommon-d6ab583c.js +100 -0
  337. data/assets/mermaid/svgDrawCommon-ecc5f780.js +64 -0
  338. data/assets/mermaid/tests/MockedD3.d.ts +45 -0
  339. data/assets/mermaid/tests/setup.d.ts +1 -0
  340. data/assets/mermaid/tests/util.d.ts +3 -0
  341. data/assets/mermaid/themes/erDiagram-oldHardcodedValues.d.ts +7 -0
  342. data/assets/mermaid/themes/index.d.ts +24 -0
  343. data/assets/mermaid/themes/theme-base.d.ts +189 -0
  344. data/assets/mermaid/themes/theme-dark.d.ts +177 -0
  345. data/assets/mermaid/themes/theme-default.d.ts +188 -0
  346. data/assets/mermaid/themes/theme-forest.d.ts +185 -0
  347. data/assets/mermaid/themes/theme-helpers.d.ts +1 -0
  348. data/assets/mermaid/themes/theme-neutral.d.ts +182 -0
  349. data/assets/mermaid/timeline-definition-23ce0e2e.js +1211 -0
  350. data/assets/mermaid/timeline-definition-4ee9bff4.js +795 -0
  351. data/assets/mermaid/timeline-definition-bf702344.js +1219 -0
  352. data/assets/mermaid/types.d.ts +31 -0
  353. data/assets/mermaid/utils/imperativeState.d.ts +32 -0
  354. data/assets/mermaid/utils/imperativeState.spec.d.ts +1 -0
  355. data/assets/mermaid/utils/lineWithOffset.d.ts +5 -0
  356. data/assets/mermaid/utils/sanitizeDirective.d.ts +7 -0
  357. data/assets/mermaid/utils/subGraphTitleMargins.d.ts +8 -0
  358. data/assets/mermaid/utils/subGraphTitleMargins.spec.d.ts +1 -0
  359. data/assets/mermaid/utils.d.ts +286 -0
  360. data/assets/mermaid/utils.spec.d.ts +1 -0
  361. data/assets/mermaid/xychartDiagram-de2e5521.js +1800 -0
  362. data/assets/mermaid/xychartDiagram-e5e6b652.js +1284 -0
  363. data/assets/mermaid/xychartDiagram-f11f50a6.js +1745 -0
  364. data/assets/tables.css +23 -0
  365. data/assets/toURI.js +142 -0
  366. metadata +363 -2
@@ -0,0 +1,814 @@
1
+ import { d as db, p as parser } from "./flowDb-c1833063.js";
2
+ import { select, curveLinear, line } from "d3";
3
+ import { a as insertMarkers, e as insertNode, l as labelHelper, f as insertEdgeLabel, k as getLineFunctionsWithOffset, m as addEdgeMarkers } from "./edges-066a5561.js";
4
+ import { l as log, F as getConfig, o as setupGraphViewbox, k as getStylesFromArray, n as interpolateToCurve, e as common } from "./mermaid-6dc72991.js";
5
+ import ELK from "elkjs/lib/elk.bundled.js";
6
+ import "./createText-ca0c5216.js";
7
+ import "mdast-util-from-markdown";
8
+ import "ts-dedent";
9
+ import "dayjs";
10
+ import "@braintree/sanitize-url";
11
+ import "dompurify";
12
+ import "khroma";
13
+ import "lodash-es/memoize.js";
14
+ import "lodash-es/merge.js";
15
+ import "stylis";
16
+ import "lodash-es/isEmpty.js";
17
+ const findCommonAncestor = (id1, id2, treeData) => {
18
+ const { parentById } = treeData;
19
+ const visited = /* @__PURE__ */ new Set();
20
+ let currentId = id1;
21
+ while (currentId) {
22
+ visited.add(currentId);
23
+ if (currentId === id2) {
24
+ return currentId;
25
+ }
26
+ currentId = parentById[currentId];
27
+ }
28
+ currentId = id2;
29
+ while (currentId) {
30
+ if (visited.has(currentId)) {
31
+ return currentId;
32
+ }
33
+ currentId = parentById[currentId];
34
+ }
35
+ return "root";
36
+ };
37
+ const elk = new ELK();
38
+ let portPos = {};
39
+ const conf = {};
40
+ let nodeDb = {};
41
+ const addVertices = async function(vert, svgId, root, doc, diagObj, parentLookupDb, graph) {
42
+ const svg = root.select(`[id="${svgId}"]`);
43
+ const nodes = svg.insert("g").attr("class", "nodes");
44
+ const keys = Object.keys(vert);
45
+ await Promise.all(
46
+ keys.map(async function(id) {
47
+ const vertex = vert[id];
48
+ let classStr = "default";
49
+ if (vertex.classes.length > 0) {
50
+ classStr = vertex.classes.join(" ");
51
+ }
52
+ classStr = classStr + " flowchart-label";
53
+ const styles2 = getStylesFromArray(vertex.styles);
54
+ let vertexText = vertex.text !== void 0 ? vertex.text : vertex.id;
55
+ const labelData = { width: 0, height: 0 };
56
+ const ports = [
57
+ {
58
+ id: vertex.id + "-west",
59
+ layoutOptions: {
60
+ "port.side": "WEST"
61
+ }
62
+ },
63
+ {
64
+ id: vertex.id + "-east",
65
+ layoutOptions: {
66
+ "port.side": "EAST"
67
+ }
68
+ },
69
+ {
70
+ id: vertex.id + "-south",
71
+ layoutOptions: {
72
+ "port.side": "SOUTH"
73
+ }
74
+ },
75
+ {
76
+ id: vertex.id + "-north",
77
+ layoutOptions: {
78
+ "port.side": "NORTH"
79
+ }
80
+ }
81
+ ];
82
+ let radius = 0;
83
+ let _shape = "";
84
+ let layoutOptions = {};
85
+ switch (vertex.type) {
86
+ case "round":
87
+ radius = 5;
88
+ _shape = "rect";
89
+ break;
90
+ case "square":
91
+ _shape = "rect";
92
+ break;
93
+ case "diamond":
94
+ _shape = "question";
95
+ layoutOptions = {
96
+ portConstraints: "FIXED_SIDE"
97
+ };
98
+ break;
99
+ case "hexagon":
100
+ _shape = "hexagon";
101
+ break;
102
+ case "odd":
103
+ _shape = "rect_left_inv_arrow";
104
+ break;
105
+ case "lean_right":
106
+ _shape = "lean_right";
107
+ break;
108
+ case "lean_left":
109
+ _shape = "lean_left";
110
+ break;
111
+ case "trapezoid":
112
+ _shape = "trapezoid";
113
+ break;
114
+ case "inv_trapezoid":
115
+ _shape = "inv_trapezoid";
116
+ break;
117
+ case "odd_right":
118
+ _shape = "rect_left_inv_arrow";
119
+ break;
120
+ case "circle":
121
+ _shape = "circle";
122
+ break;
123
+ case "ellipse":
124
+ _shape = "ellipse";
125
+ break;
126
+ case "stadium":
127
+ _shape = "stadium";
128
+ break;
129
+ case "subroutine":
130
+ _shape = "subroutine";
131
+ break;
132
+ case "cylinder":
133
+ _shape = "cylinder";
134
+ break;
135
+ case "group":
136
+ _shape = "rect";
137
+ break;
138
+ case "doublecircle":
139
+ _shape = "doublecircle";
140
+ break;
141
+ default:
142
+ _shape = "rect";
143
+ }
144
+ const node = {
145
+ labelStyle: styles2.labelStyle,
146
+ shape: _shape,
147
+ labelText: vertexText,
148
+ labelType: vertex.labelType,
149
+ rx: radius,
150
+ ry: radius,
151
+ class: classStr,
152
+ style: styles2.style,
153
+ id: vertex.id,
154
+ link: vertex.link,
155
+ linkTarget: vertex.linkTarget,
156
+ tooltip: diagObj.db.getTooltip(vertex.id) || "",
157
+ domId: diagObj.db.lookUpDomId(vertex.id),
158
+ haveCallback: vertex.haveCallback,
159
+ width: vertex.type === "group" ? 500 : void 0,
160
+ dir: vertex.dir,
161
+ type: vertex.type,
162
+ props: vertex.props,
163
+ padding: getConfig().flowchart.padding
164
+ };
165
+ let boundingBox;
166
+ let nodeEl;
167
+ if (node.type !== "group") {
168
+ nodeEl = await insertNode(nodes, node, vertex.dir);
169
+ boundingBox = nodeEl.node().getBBox();
170
+ } else {
171
+ doc.createElementNS("http://www.w3.org/2000/svg", "text");
172
+ const { shapeSvg, bbox } = await labelHelper(nodes, node, void 0, true);
173
+ labelData.width = bbox.width;
174
+ labelData.wrappingWidth = getConfig().flowchart.wrappingWidth;
175
+ labelData.height = bbox.height;
176
+ labelData.labelNode = shapeSvg.node();
177
+ node.labelData = labelData;
178
+ }
179
+ const data = {
180
+ id: vertex.id,
181
+ ports: vertex.type === "diamond" ? ports : [],
182
+ // labelStyle: styles.labelStyle,
183
+ // shape: _shape,
184
+ layoutOptions,
185
+ labelText: vertexText,
186
+ labelData,
187
+ // labels: [{ text: vertexText }],
188
+ // rx: radius,
189
+ // ry: radius,
190
+ // class: classStr,
191
+ // style: styles.style,
192
+ // link: vertex.link,
193
+ // linkTarget: vertex.linkTarget,
194
+ // tooltip: diagObj.db.getTooltip(vertex.id) || '',
195
+ domId: diagObj.db.lookUpDomId(vertex.id),
196
+ // haveCallback: vertex.haveCallback,
197
+ width: boundingBox == null ? void 0 : boundingBox.width,
198
+ height: boundingBox == null ? void 0 : boundingBox.height,
199
+ // dir: vertex.dir,
200
+ type: vertex.type,
201
+ // props: vertex.props,
202
+ // padding: getConfig().flowchart.padding,
203
+ // boundingBox,
204
+ el: nodeEl,
205
+ parent: parentLookupDb.parentById[vertex.id]
206
+ };
207
+ nodeDb[node.id] = data;
208
+ })
209
+ );
210
+ return graph;
211
+ };
212
+ const getNextPosition = (position, edgeDirection, graphDirection) => {
213
+ const portPos2 = {
214
+ TB: {
215
+ in: {
216
+ north: "north"
217
+ },
218
+ out: {
219
+ south: "west",
220
+ west: "east",
221
+ east: "south"
222
+ }
223
+ },
224
+ LR: {
225
+ in: {
226
+ west: "west"
227
+ },
228
+ out: {
229
+ east: "south",
230
+ south: "north",
231
+ north: "east"
232
+ }
233
+ },
234
+ RL: {
235
+ in: {
236
+ east: "east"
237
+ },
238
+ out: {
239
+ west: "north",
240
+ north: "south",
241
+ south: "west"
242
+ }
243
+ },
244
+ BT: {
245
+ in: {
246
+ south: "south"
247
+ },
248
+ out: {
249
+ north: "east",
250
+ east: "west",
251
+ west: "north"
252
+ }
253
+ }
254
+ };
255
+ portPos2.TD = portPos2.TB;
256
+ return portPos2[graphDirection][edgeDirection][position];
257
+ };
258
+ const getNextPort = (node, edgeDirection, graphDirection) => {
259
+ log.info("getNextPort", { node, edgeDirection, graphDirection });
260
+ if (!portPos[node]) {
261
+ switch (graphDirection) {
262
+ case "TB":
263
+ case "TD":
264
+ portPos[node] = {
265
+ inPosition: "north",
266
+ outPosition: "south"
267
+ };
268
+ break;
269
+ case "BT":
270
+ portPos[node] = {
271
+ inPosition: "south",
272
+ outPosition: "north"
273
+ };
274
+ break;
275
+ case "RL":
276
+ portPos[node] = {
277
+ inPosition: "east",
278
+ outPosition: "west"
279
+ };
280
+ break;
281
+ case "LR":
282
+ portPos[node] = {
283
+ inPosition: "west",
284
+ outPosition: "east"
285
+ };
286
+ break;
287
+ }
288
+ }
289
+ const result = edgeDirection === "in" ? portPos[node].inPosition : portPos[node].outPosition;
290
+ if (edgeDirection === "in") {
291
+ portPos[node].inPosition = getNextPosition(
292
+ portPos[node].inPosition,
293
+ edgeDirection,
294
+ graphDirection
295
+ );
296
+ } else {
297
+ portPos[node].outPosition = getNextPosition(
298
+ portPos[node].outPosition,
299
+ edgeDirection,
300
+ graphDirection
301
+ );
302
+ }
303
+ return result;
304
+ };
305
+ const getEdgeStartEndPoint = (edge, dir) => {
306
+ let source = edge.start;
307
+ let target = edge.end;
308
+ const sourceId = source;
309
+ const targetId = target;
310
+ const startNode = nodeDb[source];
311
+ const endNode = nodeDb[target];
312
+ if (!startNode || !endNode) {
313
+ return { source, target };
314
+ }
315
+ if (startNode.type === "diamond") {
316
+ source = `${source}-${getNextPort(source, "out", dir)}`;
317
+ }
318
+ if (endNode.type === "diamond") {
319
+ target = `${target}-${getNextPort(target, "in", dir)}`;
320
+ }
321
+ return { source, target, sourceId, targetId };
322
+ };
323
+ const addEdges = function(edges, diagObj, graph, svg) {
324
+ log.info("abc78 edges = ", edges);
325
+ const labelsEl = svg.insert("g").attr("class", "edgeLabels");
326
+ let linkIdCnt = {};
327
+ let dir = diagObj.db.getDirection();
328
+ let defaultStyle;
329
+ let defaultLabelStyle;
330
+ if (edges.defaultStyle !== void 0) {
331
+ const defaultStyles = getStylesFromArray(edges.defaultStyle);
332
+ defaultStyle = defaultStyles.style;
333
+ defaultLabelStyle = defaultStyles.labelStyle;
334
+ }
335
+ edges.forEach(function(edge) {
336
+ const linkIdBase = "L-" + edge.start + "-" + edge.end;
337
+ if (linkIdCnt[linkIdBase] === void 0) {
338
+ linkIdCnt[linkIdBase] = 0;
339
+ log.info("abc78 new entry", linkIdBase, linkIdCnt[linkIdBase]);
340
+ } else {
341
+ linkIdCnt[linkIdBase]++;
342
+ log.info("abc78 new entry", linkIdBase, linkIdCnt[linkIdBase]);
343
+ }
344
+ let linkId = linkIdBase + "-" + linkIdCnt[linkIdBase];
345
+ log.info("abc78 new link id to be used is", linkIdBase, linkId, linkIdCnt[linkIdBase]);
346
+ const linkNameStart = "LS-" + edge.start;
347
+ const linkNameEnd = "LE-" + edge.end;
348
+ const edgeData = { style: "", labelStyle: "" };
349
+ edgeData.minlen = edge.length || 1;
350
+ if (edge.type === "arrow_open") {
351
+ edgeData.arrowhead = "none";
352
+ } else {
353
+ edgeData.arrowhead = "normal";
354
+ }
355
+ edgeData.arrowTypeStart = "arrow_open";
356
+ edgeData.arrowTypeEnd = "arrow_open";
357
+ switch (edge.type) {
358
+ case "double_arrow_cross":
359
+ edgeData.arrowTypeStart = "arrow_cross";
360
+ case "arrow_cross":
361
+ edgeData.arrowTypeEnd = "arrow_cross";
362
+ break;
363
+ case "double_arrow_point":
364
+ edgeData.arrowTypeStart = "arrow_point";
365
+ case "arrow_point":
366
+ edgeData.arrowTypeEnd = "arrow_point";
367
+ break;
368
+ case "double_arrow_circle":
369
+ edgeData.arrowTypeStart = "arrow_circle";
370
+ case "arrow_circle":
371
+ edgeData.arrowTypeEnd = "arrow_circle";
372
+ break;
373
+ }
374
+ let style = "";
375
+ let labelStyle = "";
376
+ switch (edge.stroke) {
377
+ case "normal":
378
+ style = "fill:none;";
379
+ if (defaultStyle !== void 0) {
380
+ style = defaultStyle;
381
+ }
382
+ if (defaultLabelStyle !== void 0) {
383
+ labelStyle = defaultLabelStyle;
384
+ }
385
+ edgeData.thickness = "normal";
386
+ edgeData.pattern = "solid";
387
+ break;
388
+ case "dotted":
389
+ edgeData.thickness = "normal";
390
+ edgeData.pattern = "dotted";
391
+ edgeData.style = "fill:none;stroke-width:2px;stroke-dasharray:3;";
392
+ break;
393
+ case "thick":
394
+ edgeData.thickness = "thick";
395
+ edgeData.pattern = "solid";
396
+ edgeData.style = "stroke-width: 3.5px;fill:none;";
397
+ break;
398
+ }
399
+ if (edge.style !== void 0) {
400
+ const styles2 = getStylesFromArray(edge.style);
401
+ style = styles2.style;
402
+ labelStyle = styles2.labelStyle;
403
+ }
404
+ edgeData.style = edgeData.style += style;
405
+ edgeData.labelStyle = edgeData.labelStyle += labelStyle;
406
+ if (edge.interpolate !== void 0) {
407
+ edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear);
408
+ } else if (edges.defaultInterpolate !== void 0) {
409
+ edgeData.curve = interpolateToCurve(edges.defaultInterpolate, curveLinear);
410
+ } else {
411
+ edgeData.curve = interpolateToCurve(conf.curve, curveLinear);
412
+ }
413
+ if (edge.text === void 0) {
414
+ if (edge.style !== void 0) {
415
+ edgeData.arrowheadStyle = "fill: #333";
416
+ }
417
+ } else {
418
+ edgeData.arrowheadStyle = "fill: #333";
419
+ edgeData.labelpos = "c";
420
+ }
421
+ edgeData.labelType = edge.labelType;
422
+ edgeData.label = edge.text.replace(common.lineBreakRegex, "\n");
423
+ if (edge.style === void 0) {
424
+ edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none;";
425
+ }
426
+ edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:");
427
+ edgeData.id = linkId;
428
+ edgeData.classes = "flowchart-link " + linkNameStart + " " + linkNameEnd;
429
+ const labelEl = insertEdgeLabel(labelsEl, edgeData);
430
+ const { source, target, sourceId, targetId } = getEdgeStartEndPoint(edge, dir);
431
+ log.debug("abc78 source and target", source, target);
432
+ graph.edges.push({
433
+ id: "e" + edge.start + edge.end,
434
+ sources: [source],
435
+ targets: [target],
436
+ sourceId,
437
+ targetId,
438
+ labelEl,
439
+ labels: [
440
+ {
441
+ width: edgeData.width,
442
+ height: edgeData.height,
443
+ orgWidth: edgeData.width,
444
+ orgHeight: edgeData.height,
445
+ text: edgeData.label,
446
+ layoutOptions: {
447
+ "edgeLabels.inline": "true",
448
+ "edgeLabels.placement": "CENTER"
449
+ }
450
+ }
451
+ ],
452
+ edgeData
453
+ });
454
+ });
455
+ return graph;
456
+ };
457
+ const addMarkersToEdge = function(svgPath, edgeData, diagramType, arrowMarkerAbsolute, id) {
458
+ let url = "";
459
+ if (arrowMarkerAbsolute) {
460
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
461
+ url = url.replace(/\(/g, "\\(");
462
+ url = url.replace(/\)/g, "\\)");
463
+ }
464
+ addEdgeMarkers(svgPath, edgeData, url, id, diagramType);
465
+ };
466
+ const getClasses = function(text, diagObj) {
467
+ log.info("Extracting classes");
468
+ return diagObj.db.getClasses();
469
+ };
470
+ const addSubGraphs = function(db2) {
471
+ const parentLookupDb = { parentById: {}, childrenById: {} };
472
+ const subgraphs = db2.getSubGraphs();
473
+ log.info("Subgraphs - ", subgraphs);
474
+ subgraphs.forEach(function(subgraph) {
475
+ subgraph.nodes.forEach(function(node) {
476
+ parentLookupDb.parentById[node] = subgraph.id;
477
+ if (parentLookupDb.childrenById[subgraph.id] === void 0) {
478
+ parentLookupDb.childrenById[subgraph.id] = [];
479
+ }
480
+ parentLookupDb.childrenById[subgraph.id].push(node);
481
+ });
482
+ });
483
+ subgraphs.forEach(function(subgraph) {
484
+ ({ id: subgraph.id });
485
+ if (parentLookupDb.parentById[subgraph.id] !== void 0) {
486
+ parentLookupDb.parentById[subgraph.id];
487
+ }
488
+ });
489
+ return parentLookupDb;
490
+ };
491
+ const calcOffset = function(src, dest, parentLookupDb) {
492
+ const ancestor = findCommonAncestor(src, dest, parentLookupDb);
493
+ if (ancestor === void 0 || ancestor === "root") {
494
+ return { x: 0, y: 0 };
495
+ }
496
+ const ancestorOffset = nodeDb[ancestor].offset;
497
+ return { x: ancestorOffset.posX, y: ancestorOffset.posY };
498
+ };
499
+ const insertEdge = function(edgesEl, edge, edgeData, diagObj, parentLookupDb, id) {
500
+ const offset = calcOffset(edge.sourceId, edge.targetId, parentLookupDb);
501
+ const src = edge.sections[0].startPoint;
502
+ const dest = edge.sections[0].endPoint;
503
+ const segments = edge.sections[0].bendPoints ? edge.sections[0].bendPoints : [];
504
+ const segPoints = segments.map((segment) => [segment.x + offset.x, segment.y + offset.y]);
505
+ const points = [
506
+ [src.x + offset.x, src.y + offset.y],
507
+ ...segPoints,
508
+ [dest.x + offset.x, dest.y + offset.y]
509
+ ];
510
+ const { x, y } = getLineFunctionsWithOffset(edge.edgeData);
511
+ const curve = line().x(x).y(y).curve(curveLinear);
512
+ const edgePath = edgesEl.insert("path").attr("d", curve(points)).attr("class", "path " + edgeData.classes).attr("fill", "none");
513
+ const edgeG = edgesEl.insert("g").attr("class", "edgeLabel");
514
+ const edgeWithLabel = select(edgeG.node().appendChild(edge.labelEl));
515
+ const box = edgeWithLabel.node().firstChild.getBoundingClientRect();
516
+ edgeWithLabel.attr("width", box.width);
517
+ edgeWithLabel.attr("height", box.height);
518
+ edgeG.attr(
519
+ "transform",
520
+ `translate(${edge.labels[0].x + offset.x}, ${edge.labels[0].y + offset.y})`
521
+ );
522
+ addMarkersToEdge(edgePath, edgeData, diagObj.type, diagObj.arrowMarkerAbsolute, id);
523
+ };
524
+ const insertChildren = (nodeArray, parentLookupDb) => {
525
+ nodeArray.forEach((node) => {
526
+ if (!node.children) {
527
+ node.children = [];
528
+ }
529
+ const childIds = parentLookupDb.childrenById[node.id];
530
+ if (childIds) {
531
+ childIds.forEach((childId) => {
532
+ node.children.push(nodeDb[childId]);
533
+ });
534
+ }
535
+ insertChildren(node.children, parentLookupDb);
536
+ });
537
+ };
538
+ const draw = async function(text, id, _version, diagObj) {
539
+ var _a;
540
+ diagObj.db.clear();
541
+ nodeDb = {};
542
+ portPos = {};
543
+ diagObj.db.setGen("gen-2");
544
+ diagObj.parser.parse(text);
545
+ const renderEl = select("body").append("div").attr("style", "height:400px").attr("id", "cy");
546
+ let graph = {
547
+ id: "root",
548
+ layoutOptions: {
549
+ "elk.hierarchyHandling": "INCLUDE_CHILDREN",
550
+ "org.eclipse.elk.padding": "[top=100, left=100, bottom=110, right=110]",
551
+ "elk.layered.spacing.edgeNodeBetweenLayers": "30",
552
+ // 'elk.layered.mergeEdges': 'true',
553
+ "elk.direction": "DOWN"
554
+ // 'elk.ports.sameLayerEdges': true,
555
+ // 'nodePlacement.strategy': 'SIMPLE',
556
+ },
557
+ children: [],
558
+ edges: []
559
+ };
560
+ log.info("Drawing flowchart using v3 renderer", elk);
561
+ let dir = diagObj.db.getDirection();
562
+ switch (dir) {
563
+ case "BT":
564
+ graph.layoutOptions["elk.direction"] = "UP";
565
+ break;
566
+ case "TB":
567
+ graph.layoutOptions["elk.direction"] = "DOWN";
568
+ break;
569
+ case "LR":
570
+ graph.layoutOptions["elk.direction"] = "RIGHT";
571
+ break;
572
+ case "RL":
573
+ graph.layoutOptions["elk.direction"] = "LEFT";
574
+ break;
575
+ }
576
+ const { securityLevel, flowchart: conf2 } = getConfig();
577
+ let sandboxElement;
578
+ if (securityLevel === "sandbox") {
579
+ sandboxElement = select("#i" + id);
580
+ }
581
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
582
+ const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
583
+ const svg = root.select(`[id="${id}"]`);
584
+ const markers = ["point", "circle", "cross"];
585
+ insertMarkers(svg, markers, diagObj.type, id);
586
+ const vert = diagObj.db.getVertices();
587
+ let subG;
588
+ const subGraphs = diagObj.db.getSubGraphs();
589
+ log.info("Subgraphs - ", subGraphs);
590
+ for (let i = subGraphs.length - 1; i >= 0; i--) {
591
+ subG = subGraphs[i];
592
+ diagObj.db.addVertex(
593
+ subG.id,
594
+ { text: subG.title, type: subG.labelType },
595
+ "group",
596
+ void 0,
597
+ subG.classes,
598
+ subG.dir
599
+ );
600
+ }
601
+ const subGraphsEl = svg.insert("g").attr("class", "subgraphs");
602
+ const parentLookupDb = addSubGraphs(diagObj.db);
603
+ graph = await addVertices(vert, id, root, doc, diagObj, parentLookupDb, graph);
604
+ const edgesEl = svg.insert("g").attr("class", "edges edgePath");
605
+ const edges = diagObj.db.getEdges();
606
+ graph = addEdges(edges, diagObj, graph, svg);
607
+ const nodes = Object.keys(nodeDb);
608
+ nodes.forEach((nodeId) => {
609
+ const node = nodeDb[nodeId];
610
+ if (!node.parent) {
611
+ graph.children.push(node);
612
+ }
613
+ if (parentLookupDb.childrenById[nodeId] !== void 0) {
614
+ node.labels = [
615
+ {
616
+ text: node.labelText,
617
+ layoutOptions: {
618
+ "nodeLabels.placement": "[H_CENTER, V_TOP, INSIDE]"
619
+ },
620
+ width: node.labelData.width,
621
+ height: node.labelData.height
622
+ // width: 100,
623
+ // height: 100,
624
+ }
625
+ ];
626
+ delete node.x;
627
+ delete node.y;
628
+ delete node.width;
629
+ delete node.height;
630
+ }
631
+ });
632
+ insertChildren(graph.children, parentLookupDb);
633
+ log.info("after layout", JSON.stringify(graph, null, 2));
634
+ const g = await elk.layout(graph);
635
+ drawNodes(0, 0, g.children, svg, subGraphsEl, diagObj, 0);
636
+ log.info("after layout", g);
637
+ (_a = g.edges) == null ? void 0 : _a.map((edge) => {
638
+ insertEdge(edgesEl, edge, edge.edgeData, diagObj, parentLookupDb, id);
639
+ });
640
+ setupGraphViewbox({}, svg, conf2.diagramPadding, conf2.useMaxWidth);
641
+ renderEl.remove();
642
+ };
643
+ const drawNodes = (relX, relY, nodeArray, svg, subgraphsEl, diagObj, depth) => {
644
+ nodeArray.forEach(function(node) {
645
+ if (node) {
646
+ nodeDb[node.id].offset = {
647
+ posX: node.x + relX,
648
+ posY: node.y + relY,
649
+ x: relX,
650
+ y: relY,
651
+ depth,
652
+ width: node.width,
653
+ height: node.height
654
+ };
655
+ if (node.type === "group") {
656
+ const subgraphEl = subgraphsEl.insert("g").attr("class", "subgraph");
657
+ subgraphEl.insert("rect").attr("class", "subgraph subgraph-lvl-" + depth % 5 + " node").attr("x", node.x + relX).attr("y", node.y + relY).attr("width", node.width).attr("height", node.height);
658
+ const label = subgraphEl.insert("g").attr("class", "label");
659
+ const labelCentering = getConfig().flowchart.htmlLabels ? node.labelData.width / 2 : 0;
660
+ label.attr(
661
+ "transform",
662
+ `translate(${node.labels[0].x + relX + node.x + labelCentering}, ${node.labels[0].y + relY + node.y + 3})`
663
+ );
664
+ label.node().appendChild(node.labelData.labelNode);
665
+ log.info("Id (UGH)= ", node.type, node.labels);
666
+ } else {
667
+ log.info("Id (UGH)= ", node.id);
668
+ node.el.attr(
669
+ "transform",
670
+ `translate(${node.x + relX + node.width / 2}, ${node.y + relY + node.height / 2})`
671
+ );
672
+ }
673
+ }
674
+ });
675
+ nodeArray.forEach(function(node) {
676
+ if (node && node.type === "group") {
677
+ drawNodes(relX + node.x, relY + node.y, node.children, svg, subgraphsEl, diagObj, depth + 1);
678
+ }
679
+ });
680
+ };
681
+ const renderer = {
682
+ getClasses,
683
+ draw
684
+ };
685
+ const genSections = (options) => {
686
+ let sections = "";
687
+ for (let i = 0; i < 5; i++) {
688
+ sections += `
689
+ .subgraph-lvl-${i} {
690
+ fill: ${options[`surface${i}`]};
691
+ stroke: ${options[`surfacePeer${i}`]};
692
+ }
693
+ `;
694
+ }
695
+ return sections;
696
+ };
697
+ const getStyles = (options) => `.label {
698
+ font-family: ${options.fontFamily};
699
+ color: ${options.nodeTextColor || options.textColor};
700
+ }
701
+ .cluster-label text {
702
+ fill: ${options.titleColor};
703
+ }
704
+ .cluster-label span {
705
+ color: ${options.titleColor};
706
+ }
707
+
708
+ .label text,span {
709
+ fill: ${options.nodeTextColor || options.textColor};
710
+ color: ${options.nodeTextColor || options.textColor};
711
+ }
712
+
713
+ .node rect,
714
+ .node circle,
715
+ .node ellipse,
716
+ .node polygon,
717
+ .node path {
718
+ fill: ${options.mainBkg};
719
+ stroke: ${options.nodeBorder};
720
+ stroke-width: 1px;
721
+ }
722
+
723
+ .node .label {
724
+ text-align: center;
725
+ }
726
+ .node.clickable {
727
+ cursor: pointer;
728
+ }
729
+
730
+ .arrowheadPath {
731
+ fill: ${options.arrowheadColor};
732
+ }
733
+
734
+ .edgePath .path {
735
+ stroke: ${options.lineColor};
736
+ stroke-width: 2.0px;
737
+ }
738
+
739
+ .flowchart-link {
740
+ stroke: ${options.lineColor};
741
+ fill: none;
742
+ }
743
+
744
+ .edgeLabel {
745
+ background-color: ${options.edgeLabelBackground};
746
+ rect {
747
+ opacity: 0.85;
748
+ background-color: ${options.edgeLabelBackground};
749
+ fill: ${options.edgeLabelBackground};
750
+ }
751
+ text-align: center;
752
+ }
753
+
754
+ .cluster rect {
755
+ fill: ${options.clusterBkg};
756
+ stroke: ${options.clusterBorder};
757
+ stroke-width: 1px;
758
+ }
759
+
760
+ .cluster text {
761
+ fill: ${options.titleColor};
762
+ }
763
+
764
+ .cluster span {
765
+ color: ${options.titleColor};
766
+ }
767
+ /* .cluster div {
768
+ color: ${options.titleColor};
769
+ } */
770
+
771
+ div.mermaidTooltip {
772
+ position: absolute;
773
+ text-align: center;
774
+ max-width: 200px;
775
+ padding: 2px;
776
+ font-family: ${options.fontFamily};
777
+ font-size: 12px;
778
+ background: ${options.tertiaryColor};
779
+ border: 1px solid ${options.border2};
780
+ border-radius: 2px;
781
+ pointer-events: none;
782
+ z-index: 100;
783
+ }
784
+
785
+ .flowchartTitleText {
786
+ text-anchor: middle;
787
+ font-size: 18px;
788
+ fill: ${options.textColor};
789
+ }
790
+ .subgraph {
791
+ stroke-width:2;
792
+ rx:3;
793
+ }
794
+ // .subgraph-lvl-1 {
795
+ // fill:#ccc;
796
+ // // stroke:black;
797
+ // }
798
+
799
+ .flowchart-label text {
800
+ text-anchor: middle;
801
+ }
802
+
803
+ ${genSections(options)}
804
+ `;
805
+ const styles = getStyles;
806
+ const diagram = {
807
+ db,
808
+ renderer,
809
+ parser,
810
+ styles
811
+ };
812
+ export {
813
+ diagram
814
+ };