hexagon-editor 0.1.0-alpha.0

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 (308) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/THIRD_PARTY_NOTICES.md +29 -0
  4. package/dist/MarkdownEditor.vue.d.ts +926 -0
  5. package/dist/MarkdownEditor.vue.d.ts.map +1 -0
  6. package/dist/MarkdownEditorLinkForm-mq-BVYM_.js +338 -0
  7. package/dist/MarkdownEditorLinkForm.css +1 -0
  8. package/dist/abnfDiagram-N423BO3Z-DCf6sPky.js +87 -0
  9. package/dist/arc-y6UeoJpJ.js +83 -0
  10. package/dist/architectureDiagram-T3A2C74G-Cc3_3-cI.js +4778 -0
  11. package/dist/base-Bnv2-Te4.js +13338 -0
  12. package/dist/base.css +1 -0
  13. package/dist/blockDiagram-VBNYF7ZC-DWVLZwXY.js +2419 -0
  14. package/dist/c4Diagram-5PPSVZJV-CaIN7qay.js +1577 -0
  15. package/dist/channel-BwXGcavV.js +5 -0
  16. package/dist/chunk-2GRJ4B5K-O75udjPr.js +68 -0
  17. package/dist/chunk-2Q5K7J3B-CySL0lOA.js +15 -0
  18. package/dist/chunk-5RXB4S5H-BKPnLCOJ.js +1408 -0
  19. package/dist/chunk-5VM5RSS4--it1VJIv.js +19 -0
  20. package/dist/chunk-6Q2QTUOP-DNiML-50.js +664 -0
  21. package/dist/chunk-GF5L2VYU-z7A-k0-V.js +1533 -0
  22. package/dist/chunk-JWPE2WC7-DAjx3Kjr.js +8 -0
  23. package/dist/chunk-KBJHAD2P-D4R1VW0r.js +19 -0
  24. package/dist/chunk-RYQCIY6F-DmJAYxq8.js +313 -0
  25. package/dist/chunk-XXDRQBXY-CK913N-t.js +8 -0
  26. package/dist/classDiagram-JCYQIIEL-Djipq_HJ.js +16 -0
  27. package/dist/classDiagram-v2-OCEON4UE-Djipq_HJ.js +16 -0
  28. package/dist/classname.d.ts +13 -0
  29. package/dist/classname.d.ts.map +1 -0
  30. package/dist/classname.js +17 -0
  31. package/dist/components/MarkdownEditorFloatingMenus.vue.d.ts +48 -0
  32. package/dist/components/MarkdownEditorFloatingMenus.vue.d.ts.map +1 -0
  33. package/dist/components/MarkdownEditorImageActions.vue.d.ts +20 -0
  34. package/dist/components/MarkdownEditorImageActions.vue.d.ts.map +1 -0
  35. package/dist/components/MarkdownEditorToolbar.vue.d.ts +62 -0
  36. package/dist/components/MarkdownEditorToolbar.vue.d.ts.map +1 -0
  37. package/dist/components/MarkdownEditorToolbarIcon.vue.d.ts +26 -0
  38. package/dist/components/MarkdownEditorToolbarIcon.vue.d.ts.map +1 -0
  39. package/dist/composables/useFloatingPanel.d.ts +13 -0
  40. package/dist/composables/useFloatingPanel.d.ts.map +1 -0
  41. package/dist/composables/useMarkdownEditorValue.d.ts +19 -0
  42. package/dist/composables/useMarkdownEditorValue.d.ts.map +1 -0
  43. package/dist/configure.d.ts +15 -0
  44. package/dist/configure.d.ts.map +1 -0
  45. package/dist/configure.js +19 -0
  46. package/dist/core/actions.d.ts +16 -0
  47. package/dist/core/actions.d.ts.map +1 -0
  48. package/dist/core/basic-editor-atomic-source.d.ts +9 -0
  49. package/dist/core/basic-editor-atomic-source.d.ts.map +1 -0
  50. package/dist/core/basic-editor-command-helpers.d.ts +11 -0
  51. package/dist/core/basic-editor-command-helpers.d.ts.map +1 -0
  52. package/dist/core/basic-editor-markdown.d.ts +7 -0
  53. package/dist/core/basic-editor-markdown.d.ts.map +1 -0
  54. package/dist/core/basic-editor-renderers.d.ts +6 -0
  55. package/dist/core/basic-editor-renderers.d.ts.map +1 -0
  56. package/dist/core/basic-editor-runtime-plugins.d.ts +7 -0
  57. package/dist/core/basic-editor-runtime-plugins.d.ts.map +1 -0
  58. package/dist/core/basic-editor-selection.d.ts +6 -0
  59. package/dist/core/basic-editor-selection.d.ts.map +1 -0
  60. package/dist/core/basic-editor-table-controls.d.ts +3 -0
  61. package/dist/core/basic-editor-table-controls.d.ts.map +1 -0
  62. package/dist/core/basic-editor-table-popover.d.ts +5 -0
  63. package/dist/core/basic-editor-table-popover.d.ts.map +1 -0
  64. package/dist/core/basic-editor-types.d.ts +96 -0
  65. package/dist/core/basic-editor-types.d.ts.map +1 -0
  66. package/dist/core/basic-editor.d.ts +14 -0
  67. package/dist/core/basic-editor.d.ts.map +1 -0
  68. package/dist/core/content-handler.d.ts +21 -0
  69. package/dist/core/content-handler.d.ts.map +1 -0
  70. package/dist/core/editor-instance.d.ts +38 -0
  71. package/dist/core/editor-instance.d.ts.map +1 -0
  72. package/dist/core/events.d.ts +22 -0
  73. package/dist/core/events.d.ts.map +1 -0
  74. package/dist/core/extension-builder.d.ts +86 -0
  75. package/dist/core/extension-builder.d.ts.map +1 -0
  76. package/dist/core/extensions-manager.d.ts +36 -0
  77. package/dist/core/extensions-manager.d.ts.map +1 -0
  78. package/dist/core/index.d.ts +30 -0
  79. package/dist/core/index.d.ts.map +1 -0
  80. package/dist/core/lists.d.ts +18 -0
  81. package/dist/core/lists.d.ts.map +1 -0
  82. package/dist/core/logger.d.ts +46 -0
  83. package/dist/core/logger.d.ts.map +1 -0
  84. package/dist/core/markdown-parser.d.ts +60 -0
  85. package/dist/core/markdown-parser.d.ts.map +1 -0
  86. package/dist/core/markdown.d.ts +23 -0
  87. package/dist/core/markdown.d.ts.map +1 -0
  88. package/dist/core/markup-editor.d.ts +22 -0
  89. package/dist/core/markup-editor.d.ts.map +1 -0
  90. package/dist/core/optional-renderers.d.ts +9 -0
  91. package/dist/core/optional-renderers.d.ts.map +1 -0
  92. package/dist/core/registries.d.ts +50 -0
  93. package/dist/core/registries.d.ts.map +1 -0
  94. package/dist/core/schema-dynamic-modifier.d.ts +13 -0
  95. package/dist/core/schema-dynamic-modifier.d.ts.map +1 -0
  96. package/dist/core/vue-renderer.d.ts +40 -0
  97. package/dist/core/vue-renderer.d.ts.map +1 -0
  98. package/dist/core.js +46 -0
  99. package/dist/cose-bilkent-JH36ORCC-CXuKFbXy.js +2608 -0
  100. package/dist/cynefin-VYW2F7L2-Bkk-F_Js.js +23766 -0
  101. package/dist/cynefinDiagram-MW4NZA55-DwOK40hm.js +299 -0
  102. package/dist/cytoscape.esm-3W4EOjxC.js +18756 -0
  103. package/dist/dagre-VZM6K2ZE-0VsGm8Ag.js +340 -0
  104. package/dist/defaultLocale-BgPVtth8.js +171 -0
  105. package/dist/diagram-7IWD3JNH-BrApu1hz.js +350 -0
  106. package/dist/diagram-B4RE2ZJO-CVXoBg2r.js +461 -0
  107. package/dist/diagram-LBJQPF4R-Dp0eSz2L.js +142 -0
  108. package/dist/diagram-Q27KOJAE-DWIltqIH.js +528 -0
  109. package/dist/diagram-UB23O5K3-B7z2Lj3K.js +219 -0
  110. package/dist/directives.d.ts +10 -0
  111. package/dist/directives.d.ts.map +1 -0
  112. package/dist/ebnfDiagram-BXEA7PRR-CYgE6z_2.js +109 -0
  113. package/dist/erDiagram-JOGREHBK-D3QWrPo-.js +910 -0
  114. package/dist/extensions/additional/folding-heading.d.ts +11 -0
  115. package/dist/extensions/additional/folding-heading.d.ts.map +1 -0
  116. package/dist/extensions/additional/math.d.ts +36 -0
  117. package/dist/extensions/additional/math.d.ts.map +1 -0
  118. package/dist/extensions/additional/mermaid.d.ts +21 -0
  119. package/dist/extensions/additional/mermaid.d.ts.map +1 -0
  120. package/dist/extensions/additional/quote-link.d.ts +19 -0
  121. package/dist/extensions/additional/quote-link.d.ts.map +1 -0
  122. package/dist/extensions/additional/yfm-html-block.d.ts +21 -0
  123. package/dist/extensions/additional/yfm-html-block.d.ts.map +1 -0
  124. package/dist/extensions/base.d.ts +9 -0
  125. package/dist/extensions/base.d.ts.map +1 -0
  126. package/dist/extensions/behavior/clicks-on-edges.d.ts +12 -0
  127. package/dist/extensions/behavior/clicks-on-edges.d.ts.map +1 -0
  128. package/dist/extensions/behavior/clipboard.d.ts +6 -0
  129. package/dist/extensions/behavior/clipboard.d.ts.map +1 -0
  130. package/dist/extensions/behavior/cursor.d.ts +29 -0
  131. package/dist/extensions/behavior/cursor.d.ts.map +1 -0
  132. package/dist/extensions/behavior/editor-mode-keymap.d.ts +8 -0
  133. package/dist/extensions/behavior/editor-mode-keymap.d.ts.map +1 -0
  134. package/dist/extensions/behavior/history.d.ts +21 -0
  135. package/dist/extensions/behavior/history.d.ts.map +1 -0
  136. package/dist/extensions/behavior/placeholder.d.ts +11 -0
  137. package/dist/extensions/behavior/placeholder.d.ts.map +1 -0
  138. package/dist/extensions/behavior/resizable.d.ts +4 -0
  139. package/dist/extensions/behavior/resizable.d.ts.map +1 -0
  140. package/dist/extensions/behavior/selection-commands.d.ts +24 -0
  141. package/dist/extensions/behavior/selection-commands.d.ts.map +1 -0
  142. package/dist/extensions/behavior/selection-context.d.ts +9 -0
  143. package/dist/extensions/behavior/selection-context.d.ts.map +1 -0
  144. package/dist/extensions/behavior/selection.d.ts +12 -0
  145. package/dist/extensions/behavior/selection.d.ts.map +1 -0
  146. package/dist/extensions/index.d.ts +34 -0
  147. package/dist/extensions/index.d.ts.map +1 -0
  148. package/dist/extensions/markdown/blockquote-specs.d.ts +15 -0
  149. package/dist/extensions/markdown/blockquote-specs.d.ts.map +1 -0
  150. package/dist/extensions/markdown/blockquote.d.ts +14 -0
  151. package/dist/extensions/markdown/blockquote.d.ts.map +1 -0
  152. package/dist/extensions/markdown/bold-specs.d.ts +12 -0
  153. package/dist/extensions/markdown/bold-specs.d.ts.map +1 -0
  154. package/dist/extensions/markdown/bold.d.ts +17 -0
  155. package/dist/extensions/markdown/bold.d.ts.map +1 -0
  156. package/dist/extensions/markdown/breaks-specs.d.ts +22 -0
  157. package/dist/extensions/markdown/breaks-specs.d.ts.map +1 -0
  158. package/dist/extensions/markdown/breaks.d.ts +11 -0
  159. package/dist/extensions/markdown/breaks.d.ts.map +1 -0
  160. package/dist/extensions/markdown/code-block-specs.d.ts +14 -0
  161. package/dist/extensions/markdown/code-block-specs.d.ts.map +1 -0
  162. package/dist/extensions/markdown/code-block.d.ts +14 -0
  163. package/dist/extensions/markdown/code-block.d.ts.map +1 -0
  164. package/dist/extensions/markdown/code-specs.d.ts +9 -0
  165. package/dist/extensions/markdown/code-specs.d.ts.map +1 -0
  166. package/dist/extensions/markdown/code.d.ts +11 -0
  167. package/dist/extensions/markdown/code.d.ts.map +1 -0
  168. package/dist/extensions/markdown/deflist-specs.d.ts +16 -0
  169. package/dist/extensions/markdown/deflist-specs.d.ts.map +1 -0
  170. package/dist/extensions/markdown/deflist.d.ts +14 -0
  171. package/dist/extensions/markdown/deflist.d.ts.map +1 -0
  172. package/dist/extensions/markdown/heading-specs.d.ts +11 -0
  173. package/dist/extensions/markdown/heading-specs.d.ts.map +1 -0
  174. package/dist/extensions/markdown/heading.d.ts +17 -0
  175. package/dist/extensions/markdown/heading.d.ts.map +1 -0
  176. package/dist/extensions/markdown/horizontal-rule-specs.d.ts +10 -0
  177. package/dist/extensions/markdown/horizontal-rule-specs.d.ts.map +1 -0
  178. package/dist/extensions/markdown/horizontal-rule.d.ts +8 -0
  179. package/dist/extensions/markdown/horizontal-rule.d.ts.map +1 -0
  180. package/dist/extensions/markdown/html.d.ts +15 -0
  181. package/dist/extensions/markdown/html.d.ts.map +1 -0
  182. package/dist/extensions/markdown/image.d.ts +39 -0
  183. package/dist/extensions/markdown/image.d.ts.map +1 -0
  184. package/dist/extensions/markdown/italic-specs.d.ts +12 -0
  185. package/dist/extensions/markdown/italic-specs.d.ts.map +1 -0
  186. package/dist/extensions/markdown/italic.d.ts +11 -0
  187. package/dist/extensions/markdown/italic.d.ts.map +1 -0
  188. package/dist/extensions/markdown/link-specs.d.ts +19 -0
  189. package/dist/extensions/markdown/link-specs.d.ts.map +1 -0
  190. package/dist/extensions/markdown/link.d.ts +21 -0
  191. package/dist/extensions/markdown/link.d.ts.map +1 -0
  192. package/dist/extensions/markdown/list-specs.d.ts +6 -0
  193. package/dist/extensions/markdown/list-specs.d.ts.map +1 -0
  194. package/dist/extensions/markdown/lists.d.ts +18 -0
  195. package/dist/extensions/markdown/lists.d.ts.map +1 -0
  196. package/dist/extensions/markdown/mark.d.ts +12 -0
  197. package/dist/extensions/markdown/mark.d.ts.map +1 -0
  198. package/dist/extensions/markdown/strike.d.ts +12 -0
  199. package/dist/extensions/markdown/strike.d.ts.map +1 -0
  200. package/dist/extensions/markdown/subscript.d.ts +12 -0
  201. package/dist/extensions/markdown/subscript.d.ts.map +1 -0
  202. package/dist/extensions/markdown/table-actions.d.ts +14 -0
  203. package/dist/extensions/markdown/table-actions.d.ts.map +1 -0
  204. package/dist/extensions/markdown/table-specs.d.ts +25 -0
  205. package/dist/extensions/markdown/table-specs.d.ts.map +1 -0
  206. package/dist/extensions/markdown/table.d.ts +6 -0
  207. package/dist/extensions/markdown/table.d.ts.map +1 -0
  208. package/dist/extensions/markdown/underline.d.ts +12 -0
  209. package/dist/extensions/markdown/underline.d.ts.map +1 -0
  210. package/dist/extensions/specs.d.ts +13 -0
  211. package/dist/extensions/specs.d.ts.map +1 -0
  212. package/dist/extensions.js +247 -0
  213. package/dist/flowDiagram-UKHOOZJN-CfjPcHNW.js +1638 -0
  214. package/dist/forms/MarkdownEditorForm.vue.d.ts +37 -0
  215. package/dist/forms/MarkdownEditorForm.vue.d.ts.map +1 -0
  216. package/dist/forms/MarkdownEditorImageForm.vue.d.ts +131 -0
  217. package/dist/forms/MarkdownEditorImageForm.vue.d.ts.map +1 -0
  218. package/dist/forms/MarkdownEditorLinkForm.vue.d.ts +119 -0
  219. package/dist/forms/MarkdownEditorLinkForm.vue.d.ts.map +1 -0
  220. package/dist/forms/MarkdownEditorTextInput.vue.d.ts +39 -0
  221. package/dist/forms/MarkdownEditorTextInput.vue.d.ts.map +1 -0
  222. package/dist/forms/index.d.ts +7 -0
  223. package/dist/forms/index.d.ts.map +1 -0
  224. package/dist/forms.js +7 -0
  225. package/dist/full-C-o2lPBX.js +16 -0
  226. package/dist/full-specs-Cl-ODShc.js +10 -0
  227. package/dist/ganttDiagram-PKOTCBZU-ECmaWI-9.js +2711 -0
  228. package/dist/gitGraphDiagram-DS77QQ5N-DgG1RGJ8.js +815 -0
  229. package/dist/graph-DAHC4kPm.js +1545 -0
  230. package/dist/heading-specs-D7Bj4aIM.js +489 -0
  231. package/dist/i18n/index.d.ts +70 -0
  232. package/dist/i18n/index.d.ts.map +1 -0
  233. package/dist/i18n.js +132 -0
  234. package/dist/index-CqpK5VVw.js +149 -0
  235. package/dist/index-uerphigI.js +82 -0
  236. package/dist/index.css +1 -0
  237. package/dist/index.d.ts +87 -0
  238. package/dist/index.d.ts.map +1 -0
  239. package/dist/index.js +1293 -0
  240. package/dist/infoDiagram-6WML65LV-B1Yl3nZV.js +24 -0
  241. package/dist/init-DjUOC4st.js +16 -0
  242. package/dist/ishikawaDiagram-WSZJBQD7-4sngaB5o.js +621 -0
  243. package/dist/journeyDiagram-NVQOT4AX-B_6AmR_j.js +834 -0
  244. package/dist/kanban-definition-27J2QSJJ-B8BO9o8J.js +724 -0
  245. package/dist/katex-ByXcxnHy.js +14436 -0
  246. package/dist/katex-DoRnZ_sp.js +11682 -0
  247. package/dist/layout-DBbo_M5I.js +1519 -0
  248. package/dist/linear-BEdRfKba.js +259 -0
  249. package/dist/map-DRdzG8Ho.js +224 -0
  250. package/dist/mermaid.core-CR0bA2Wa.js +16496 -0
  251. package/dist/mindmap-definition-FAOFIHXS-DnPz807N.js +827 -0
  252. package/dist/optional-renderers-BalvqqvY.js +11 -0
  253. package/dist/ordinal-B6-f3MAq.js +61 -0
  254. package/dist/pegDiagram-VL7TDLO6-csGWlzs8.js +95 -0
  255. package/dist/pieDiagram-7S7Q4E2Y-Bqs8j5FX.js +207 -0
  256. package/dist/presets/commonmark-specs.d.ts +9 -0
  257. package/dist/presets/commonmark-specs.d.ts.map +1 -0
  258. package/dist/presets/commonmark.d.ts +26 -0
  259. package/dist/presets/commonmark.d.ts.map +1 -0
  260. package/dist/presets/default.d.ts +6 -0
  261. package/dist/presets/default.d.ts.map +1 -0
  262. package/dist/presets/full-specs.d.ts +6 -0
  263. package/dist/presets/full-specs.d.ts.map +1 -0
  264. package/dist/presets/full.d.ts +17 -0
  265. package/dist/presets/full.d.ts.map +1 -0
  266. package/dist/presets/index.d.ts +13 -0
  267. package/dist/presets/index.d.ts.map +1 -0
  268. package/dist/presets/zero.d.ts +8 -0
  269. package/dist/presets/zero.d.ts.map +1 -0
  270. package/dist/presets.js +10 -0
  271. package/dist/public-types.d.ts +96 -0
  272. package/dist/public-types.d.ts.map +1 -0
  273. package/dist/quadrantDiagram-CIZ2JOQS-jzP4lRrY.js +1023 -0
  274. package/dist/railroadDiagram-AXF67PYL-BSCyR24u.js +77 -0
  275. package/dist/renderer/MarkdownRenderer.vue.d.ts +10 -0
  276. package/dist/renderer/MarkdownRenderer.vue.d.ts.map +1 -0
  277. package/dist/renderer/index.d.ts +3 -0
  278. package/dist/renderer/index.d.ts.map +1 -0
  279. package/dist/renderer/markdown.d.ts +2 -0
  280. package/dist/renderer/markdown.d.ts.map +1 -0
  281. package/dist/renderer/mermaid-runtime.d.ts +4 -0
  282. package/dist/renderer/mermaid-runtime.d.ts.map +1 -0
  283. package/dist/renderer.js +258 -0
  284. package/dist/requirementDiagram-LRYGKXZP-DmEkLYqX.js +882 -0
  285. package/dist/sankeyDiagram-W5VNT64P-CYvRYMTh.js +847 -0
  286. package/dist/schema-dynamic-modifier-Dhf0m6tE.js +21514 -0
  287. package/dist/schema-dynamic-modifier.css +1 -0
  288. package/dist/sequenceDiagram-SI44F4Z6-CyWbDtPA.js +2888 -0
  289. package/dist/sizeCapture-X5ZJPWSS-xKhYCY84.js +46 -0
  290. package/dist/specs.js +127 -0
  291. package/dist/stateDiagram-OKZ733FA-DP44R2Dd.js +263 -0
  292. package/dist/stateDiagram-v2-UEYNNEHI-BvlOisND.js +16 -0
  293. package/dist/swimlanes-SLNWSIFB-BKFp8twH.js +5332 -0
  294. package/dist/swimlanesDiagram-ULZ7WXOC-CTvIFuHq.js +13 -0
  295. package/dist/timeline-definition-Z64GVDOM-B4137uIl.js +1055 -0
  296. package/dist/toolbar/config.d.ts +45 -0
  297. package/dist/toolbar/config.d.ts.map +1 -0
  298. package/dist/toolbar/index.d.ts +3 -0
  299. package/dist/toolbar/index.d.ts.map +1 -0
  300. package/dist/toolbar.js +100 -0
  301. package/dist/use-markdown-editor.d.ts +14 -0
  302. package/dist/use-markdown-editor.d.ts.map +1 -0
  303. package/dist/vennDiagram-T6HMQDX7-CPs8gXjx.js +1578 -0
  304. package/dist/version.d.ts +3 -0
  305. package/dist/version.d.ts.map +1 -0
  306. package/dist/wardleyDiagram-T6FBY63Y-BYp13hbI.js +675 -0
  307. package/dist/xychartDiagram-ELKLHX3M-DTT37K2u.js +1388 -0
  308. package/package.json +110 -0
@@ -0,0 +1,675 @@
1
+ import { p as Mt } from "./chunk-JWPE2WC7-DAjx3Kjr.js";
2
+ import { s as Nt, g as zt, o as Lt, n as Tt, a as At, b as Xt, _ as u, E as Et, y as Yt, A as J, l as Q, D as It, e as Bt, p as Ft, c as V } from "./mermaid.core-CR0bA2Wa.js";
3
+ import { p as Rt } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
4
+ var G = /* @__PURE__ */ u((o, r) => {
5
+ const e = o <= 1 ? o * 100 : o;
6
+ if (e < 0 || e > 100)
7
+ throw new Error(
8
+ `${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`
9
+ );
10
+ return e;
11
+ }, "toPercent"), A = /* @__PURE__ */ u((o, r, e) => ({
12
+ x: G(r, `${e} evolution`),
13
+ y: G(o, `${e} visibility`)
14
+ }), "toCoordinates"), K = /* @__PURE__ */ u((o) => {
15
+ if (o) {
16
+ if (o === "+<>")
17
+ return "bidirectional";
18
+ if (o === "+<")
19
+ return "backward";
20
+ if (o === "+>")
21
+ return "forward";
22
+ }
23
+ }, "getFlowFromPort"), Ot = /* @__PURE__ */ u((o) => {
24
+ if (!o?.startsWith("+"))
25
+ return {};
26
+ const e = /^\+'([^']*)'/.exec(o)?.[1];
27
+ return o.includes("<>") ? { flow: "bidirectional", label: e } : o.includes("<") ? { flow: "backward", label: e } : o.includes(">") ? { flow: "forward", label: e } : { label: e };
28
+ }, "extractFlowFromArrow"), Wt = /* @__PURE__ */ u((o, r) => {
29
+ if (Mt(o, r), o.size && r.setSize(o.size.width, o.size.height), o.evolution) {
30
+ const e = o.evolution.stages.map((a) => a.secondName ? `${a.name.trim()} / ${a.secondName.trim()}` : a.name.trim()), h = o.evolution.stages.filter((a) => a.boundary !== void 0).map((a) => a.boundary);
31
+ r.updateAxes({ stages: e, stageBoundaries: h });
32
+ }
33
+ if (o.anchors.forEach((e) => {
34
+ const h = A(e.visibility, e.evolution, `Anchor "${e.name}"`);
35
+ r.addNode(e.name, e.name, h.x, h.y, "anchor");
36
+ }), o.components.forEach((e) => {
37
+ const h = A(
38
+ e.visibility,
39
+ e.evolution,
40
+ `Component "${e.name}"`
41
+ ), a = e.label ? (e.label.negX ? -1 : 1) * e.label.offsetX : void 0, d = e.label ? (e.label.negY ? -1 : 1) * e.label.offsetY : void 0, w = e.decorator?.strategy;
42
+ r.addNode(
43
+ e.name,
44
+ e.name,
45
+ h.x,
46
+ h.y,
47
+ "component",
48
+ a,
49
+ d,
50
+ e.inertia,
51
+ w
52
+ );
53
+ }), o.notes.forEach((e) => {
54
+ const h = A(e.visibility, e.evolution, `Note "${e.text}"`);
55
+ r.addNote(e.text, h.x, h.y);
56
+ }), o.pipelines.forEach((e) => {
57
+ const h = r.getNode(e.parent);
58
+ if (!h || typeof h.y != "number")
59
+ throw new Error(
60
+ `Pipeline "${e.parent}" must reference an existing component with coordinates.`
61
+ );
62
+ const a = h.y;
63
+ r.startPipeline(e.parent), e.components.forEach((d) => {
64
+ const w = `${e.parent}_${d.name}`, C = d.label ? (d.label.negX ? -1 : 1) * d.label.offsetX : void 0, g = d.label ? (d.label.negY ? -1 : 1) * d.label.offsetY : void 0, R = G(d.evolution, `Pipeline component "${d.name}" evolution`);
65
+ r.addNode(
66
+ w,
67
+ d.name,
68
+ R,
69
+ a,
70
+ "pipeline-component",
71
+ C,
72
+ g
73
+ ), r.addPipelineComponent(e.parent, w);
74
+ });
75
+ }), o.links.forEach((e) => {
76
+ const h = !!e.arrow && (e.arrow.includes("-.->") || e.arrow.includes(".-."));
77
+ let a = K(e.fromPort) ?? K(e.toPort);
78
+ const { flow: d, label: w } = Ot(e.arrow);
79
+ !a && d && (a = d);
80
+ const C = e.linkLabel, g = w ?? C;
81
+ r.addLink(r.resolveNodeId(e.from), r.resolveNodeId(e.to), h, g, a);
82
+ }), o.evolves.forEach((e) => {
83
+ const h = r.getNode(e.component);
84
+ if (h?.y !== void 0) {
85
+ const a = G(e.target, `Evolve target for "${e.component}"`);
86
+ r.addTrend(e.component, a, h.y);
87
+ }
88
+ }), o.annotations.length > 0) {
89
+ const e = o.annotations[0], h = A(e.x, e.y, "Annotations box");
90
+ r.setAnnotationsBox(h.x, h.y);
91
+ }
92
+ o.annotation.forEach((e) => {
93
+ const h = A(e.x, e.y, `Annotation ${e.number}`);
94
+ r.addAnnotation(e.number, [{ x: h.x, y: h.y }], e.text);
95
+ }), o.accelerators.forEach((e) => {
96
+ const h = A(e.x, e.y, `Accelerator "${e.name}"`);
97
+ r.addAccelerator(e.name, h.x, h.y);
98
+ }), o.deaccelerators.forEach((e) => {
99
+ const h = A(
100
+ e.x,
101
+ e.y,
102
+ `Deaccelerator "${e.name}"`
103
+ );
104
+ r.addDeaccelerator(e.name, h.x, h.y);
105
+ });
106
+ }, "populateDb"), tt = {
107
+ parser: {
108
+ // @ts-expect-error - WardleyDB is not assignable to DiagramDB
109
+ yy: void 0
110
+ },
111
+ parse: /* @__PURE__ */ u(async (o) => {
112
+ const r = await Rt("wardley", o);
113
+ Q.debug(r);
114
+ const e = tt.parser?.yy;
115
+ if (!e || typeof e.addNode != "function")
116
+ throw new Error(
117
+ "parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
118
+ );
119
+ Wt(r, e);
120
+ }, "parse")
121
+ }, E, Dt = (E = class {
122
+ constructor() {
123
+ this.nodes = /* @__PURE__ */ new Map(), this.links = [], this.trends = /* @__PURE__ */ new Map(), this.pipelines = /* @__PURE__ */ new Map(), this.annotations = [], this.notes = [], this.accelerators = [], this.deaccelerators = [], this.axes = {};
124
+ }
125
+ addNode(r) {
126
+ const e = this.nodes.get(r.id) ?? { id: r.id, label: r.label }, h = {
127
+ ...e,
128
+ ...r,
129
+ className: r.className ?? e.className,
130
+ labelOffsetX: r.labelOffsetX ?? e.labelOffsetX,
131
+ labelOffsetY: r.labelOffsetY ?? e.labelOffsetY
132
+ };
133
+ this.nodes.set(r.id, h);
134
+ }
135
+ addLink(r) {
136
+ this.links.push(r);
137
+ }
138
+ addTrend(r) {
139
+ this.trends.set(r.nodeId, r);
140
+ }
141
+ startPipeline(r) {
142
+ this.pipelines.set(r, { nodeId: r, componentIds: [] });
143
+ const e = this.nodes.get(r);
144
+ e && (e.isPipelineParent = !0);
145
+ }
146
+ addPipelineComponent(r, e) {
147
+ const h = this.pipelines.get(r);
148
+ h && h.componentIds.push(e);
149
+ const a = this.nodes.get(e);
150
+ a && (a.inPipeline = !0);
151
+ }
152
+ addAnnotation(r) {
153
+ this.annotations.push(r);
154
+ }
155
+ addNote(r) {
156
+ this.notes.push(r);
157
+ }
158
+ addAccelerator(r) {
159
+ this.accelerators.push(r);
160
+ }
161
+ addDeaccelerator(r) {
162
+ this.deaccelerators.push(r);
163
+ }
164
+ setAnnotationsBox(r, e) {
165
+ this.annotationsBox = { x: r, y: e };
166
+ }
167
+ setAxes(r) {
168
+ this.axes = {
169
+ ...this.axes,
170
+ ...r
171
+ };
172
+ }
173
+ setSize(r, e) {
174
+ this.size = { width: r, height: e };
175
+ }
176
+ getNode(r) {
177
+ return this.nodes.get(r);
178
+ }
179
+ /**
180
+ * Resolve a name to a node ID. Tries exact ID match first,
181
+ * then falls back to finding a node whose label matches the name
182
+ * (handles pipeline components which have synthetic IDs like "Parent_Child").
183
+ */
184
+ resolveNodeId(r) {
185
+ if (this.nodes.has(r))
186
+ return r;
187
+ for (const [e, h] of this.nodes)
188
+ if (h.label === r)
189
+ return e;
190
+ return r;
191
+ }
192
+ build() {
193
+ const r = [];
194
+ for (const e of this.nodes.values()) {
195
+ if (typeof e.x != "number" || typeof e.y != "number")
196
+ throw new Error(`Node "${e.label}" is missing coordinates`);
197
+ r.push(e);
198
+ }
199
+ return {
200
+ nodes: r,
201
+ links: [...this.links],
202
+ trends: [...this.trends.values()],
203
+ pipelines: [...this.pipelines.values()],
204
+ annotations: [...this.annotations],
205
+ notes: [...this.notes],
206
+ accelerators: [...this.accelerators],
207
+ deaccelerators: [...this.deaccelerators],
208
+ annotationsBox: this.annotationsBox,
209
+ axes: { ...this.axes },
210
+ size: this.size
211
+ };
212
+ }
213
+ clear() {
214
+ this.nodes.clear(), this.links = [], this.trends.clear(), this.pipelines.clear(), this.annotations = [], this.notes = [], this.accelerators = [], this.deaccelerators = [], this.annotationsBox = void 0, this.axes = {}, this.size = void 0;
215
+ }
216
+ }, u(E, "WardleyBuilder"), E), k = new Dt();
217
+ function et() {
218
+ return V()["wardley-beta"];
219
+ }
220
+ u(et, "getConfig");
221
+ function at(o, r, e, h, a, d, w, C, g) {
222
+ k.addNode({
223
+ id: o,
224
+ label: r,
225
+ x: e,
226
+ y: h,
227
+ className: a,
228
+ labelOffsetX: d,
229
+ labelOffsetY: w,
230
+ inertia: C,
231
+ sourceStrategy: g
232
+ });
233
+ }
234
+ u(at, "addNode");
235
+ function rt(o, r, e = !1, h, a) {
236
+ k.addLink({
237
+ source: o,
238
+ target: r,
239
+ dashed: e,
240
+ label: h,
241
+ flow: a
242
+ });
243
+ }
244
+ u(rt, "addLink");
245
+ function ot(o, r, e) {
246
+ k.addTrend({ nodeId: o, targetX: r, targetY: e });
247
+ }
248
+ u(ot, "addTrend");
249
+ function nt(o, r, e) {
250
+ k.addAnnotation({
251
+ number: o,
252
+ coordinates: r,
253
+ text: e
254
+ });
255
+ }
256
+ u(nt, "addAnnotation");
257
+ function st(o, r, e) {
258
+ k.addNote({
259
+ text: o,
260
+ x: r,
261
+ y: e
262
+ });
263
+ }
264
+ u(st, "addNote");
265
+ function it(o, r, e) {
266
+ k.addAccelerator({
267
+ name: o,
268
+ x: r,
269
+ y: e
270
+ });
271
+ }
272
+ u(it, "addAccelerator");
273
+ function dt(o, r, e) {
274
+ k.addDeaccelerator({
275
+ name: o,
276
+ x: r,
277
+ y: e
278
+ });
279
+ }
280
+ u(dt, "addDeaccelerator");
281
+ function lt(o, r) {
282
+ k.setAnnotationsBox(o, r);
283
+ }
284
+ u(lt, "setAnnotationsBox");
285
+ function ct(o, r) {
286
+ k.setSize(o, r);
287
+ }
288
+ u(ct, "setSize");
289
+ function pt(o) {
290
+ k.startPipeline(o);
291
+ }
292
+ u(pt, "startPipeline");
293
+ function ft(o, r) {
294
+ k.addPipelineComponent(o, r);
295
+ }
296
+ u(ft, "addPipelineComponent");
297
+ function ht(o) {
298
+ k.setAxes(o);
299
+ }
300
+ u(ht, "updateAxes");
301
+ function xt(o) {
302
+ return k.getNode(o);
303
+ }
304
+ u(xt, "getNode");
305
+ function gt(o) {
306
+ return k.resolveNodeId(o);
307
+ }
308
+ u(gt, "resolveNodeId");
309
+ function yt() {
310
+ return k.build();
311
+ }
312
+ u(yt, "getWardleyData");
313
+ function ut() {
314
+ k.clear(), Ft();
315
+ }
316
+ u(ut, "clear");
317
+ var Gt = {
318
+ getConfig: et,
319
+ addNode: at,
320
+ addLink: rt,
321
+ addTrend: ot,
322
+ addAnnotation: nt,
323
+ addNote: st,
324
+ addAccelerator: it,
325
+ addDeaccelerator: dt,
326
+ setAnnotationsBox: lt,
327
+ setSize: ct,
328
+ startPipeline: pt,
329
+ addPipelineComponent: ft,
330
+ updateAxes: ht,
331
+ getNode: xt,
332
+ resolveNodeId: gt,
333
+ getWardleyData: yt,
334
+ clear: ut,
335
+ setAccTitle: Xt,
336
+ getAccTitle: At,
337
+ setDiagramTitle: Tt,
338
+ getDiagramTitle: Lt,
339
+ getAccDescription: zt,
340
+ setAccDescription: Nt
341
+ }, qt = ["Genesis", "Custom Built", "Product", "Commodity"], Ht = /* @__PURE__ */ u(() => {
342
+ const { themeVariables: o } = V();
343
+ return {
344
+ backgroundColor: o.wardley?.backgroundColor ?? o.background ?? "#fff",
345
+ axisColor: o.wardley?.axisColor ?? "#000",
346
+ axisTextColor: o.wardley?.axisTextColor ?? o.primaryTextColor ?? "#222",
347
+ gridColor: o.wardley?.gridColor ?? "rgba(100, 100, 100, 0.2)",
348
+ componentFill: o.wardley?.componentFill ?? "#fff",
349
+ componentStroke: o.wardley?.componentStroke ?? "#000",
350
+ componentLabelColor: o.wardley?.componentLabelColor ?? o.primaryTextColor ?? "#222",
351
+ linkStroke: o.wardley?.linkStroke ?? "#000",
352
+ evolutionStroke: o.wardley?.evolutionStroke ?? "#dc3545",
353
+ annotationStroke: o.wardley?.annotationStroke ?? "#000",
354
+ annotationTextColor: o.wardley?.annotationTextColor ?? o.primaryTextColor ?? "#222",
355
+ annotationFill: o.wardley?.annotationFill ?? o.background ?? "#fff"
356
+ };
357
+ }, "getTheme"), jt = /* @__PURE__ */ u(() => {
358
+ const o = V()["wardley-beta"];
359
+ return {
360
+ width: o?.width ?? 900,
361
+ height: o?.height ?? 600,
362
+ padding: o?.padding ?? 48,
363
+ nodeRadius: o?.nodeRadius ?? 6,
364
+ nodeLabelOffset: o?.nodeLabelOffset ?? 8,
365
+ axisFontSize: o?.axisFontSize ?? 12,
366
+ labelFontSize: o?.labelFontSize ?? 10,
367
+ showGrid: o?.showGrid ?? !1,
368
+ useMaxWidth: o?.useMaxWidth ?? !0
369
+ };
370
+ }, "getConfigValues"), Vt = /* @__PURE__ */ u((o, r, e, h) => {
371
+ Q.debug(`Rendering Wardley map
372
+ ` + o);
373
+ const a = jt(), d = Ht(), w = a.nodeRadius * 1.6, C = h.db, g = C.getWardleyData(), R = C.getDiagramTitle(), S = g.size?.width ?? a.width, b = g.size?.height ?? a.height, Y = It(r);
374
+ Y.selectAll("*").remove(), Bt(Y, b, S, a.useMaxWidth), Y.attr("viewBox", `0 0 ${S} ${b}`);
375
+ const v = Y.append("g").attr("class", "wardley-map"), q = Y.append("defs");
376
+ q.append("marker").attr("id", `arrow-${r}`).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("fill", d.evolutionStroke).attr("stroke", "none"), q.append("marker").attr("id", `link-arrow-end-${r}`).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("fill", d.linkStroke).attr("stroke", "none"), q.append("marker").attr("id", `link-arrow-start-${r}`).attr("viewBox", "0 0 10 10").attr("refX", 1).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z").attr("fill", d.linkStroke).attr("stroke", "none"), v.append("rect").attr("class", "wardley-background").attr("width", S).attr("height", b).attr("fill", d.backgroundColor);
377
+ const I = S - a.padding * 2, B = b - a.padding * 2;
378
+ R && v.append("text").attr("class", "wardley-title").attr("x", S / 2).attr("y", a.padding / 2).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize * 1.05).attr("font-weight", "bold").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(R);
379
+ const z = /* @__PURE__ */ u((t) => a.padding + t / 100 * I, "projectX"), L = /* @__PURE__ */ u((t) => b - a.padding - t / 100 * B, "projectY"), O = v.append("g").attr("class", "wardley-axes");
380
+ O.append("line").attr("x1", a.padding).attr("x2", S - a.padding).attr("y1", b - a.padding).attr("y2", b - a.padding).attr("stroke", d.axisColor).attr("stroke-width", 1), O.append("line").attr("x1", a.padding).attr("x2", a.padding).attr("y1", a.padding).attr("y2", b - a.padding).attr("stroke", d.axisColor).attr("stroke-width", 1);
381
+ const wt = g.axes.xLabel ?? "Evolution", mt = g.axes.yLabel ?? "Visibility";
382
+ O.append("text").attr("class", "wardley-axis-label wardley-axis-label-x").attr("x", a.padding + I / 2).attr("y", b - a.padding / 4).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").text(wt), O.append("text").attr("class", "wardley-axis-label wardley-axis-label-y").attr("x", a.padding / 3).attr("y", a.padding + B / 2).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").attr(
383
+ "transform",
384
+ `rotate(-90 ${a.padding / 3} ${a.padding + B / 2})`
385
+ ).text(mt);
386
+ const F = g.axes.stages && g.axes.stages.length > 0 ? g.axes.stages : qt;
387
+ if (F.length > 0) {
388
+ const t = v.append("g").attr("class", "wardley-stages"), s = g.axes.stageBoundaries, n = [];
389
+ if (s && s.length === F.length) {
390
+ let i = 0;
391
+ s.forEach((p) => {
392
+ n.push({ start: i, end: p }), i = p;
393
+ });
394
+ } else {
395
+ const i = 1 / F.length;
396
+ F.forEach((p, l) => {
397
+ n.push({
398
+ start: l * i,
399
+ end: (l + 1) * i
400
+ });
401
+ });
402
+ }
403
+ F.forEach((i, p) => {
404
+ const l = n[p], f = a.padding + l.start * I, x = a.padding + l.end * I, y = (f + x) / 2;
405
+ p > 0 && t.append("line").attr("x1", f).attr("x2", f).attr("y1", a.padding).attr("y2", b - a.padding).attr("stroke", "#000").attr("stroke-width", 1).attr("stroke-dasharray", "5 5").attr("opacity", 0.8), t.append("text").attr("class", "wardley-stage-label").attr("x", y).attr("y", b - a.padding / 1.5).attr("fill", d.axisTextColor).attr("font-size", a.axisFontSize - 2).attr("text-anchor", "middle").text(i);
406
+ });
407
+ }
408
+ if (a.showGrid) {
409
+ const t = v.append("g").attr("class", "wardley-grid");
410
+ for (let s = 1; s < 4; s++) {
411
+ const n = s / 4, i = a.padding + I * n;
412
+ t.append("line").attr("x1", i).attr("x2", i).attr("y1", a.padding).attr("y2", b - a.padding).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6"), t.append("line").attr("x1", a.padding).attr("x2", S - a.padding).attr("y1", b - a.padding - B * n).attr("y2", b - a.padding - B * n).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6");
413
+ }
414
+ }
415
+ const c = /* @__PURE__ */ new Map();
416
+ if (g.nodes.forEach((t) => {
417
+ c.set(t.id, {
418
+ x: z(t.x),
419
+ y: L(t.y),
420
+ node: t
421
+ });
422
+ }), g.pipelines.length > 0) {
423
+ const t = v.append("g").attr("class", "wardley-pipelines"), s = v.append("g").attr("class", "wardley-pipeline-links");
424
+ g.pipelines.forEach((n) => {
425
+ if (n.componentIds.length === 0)
426
+ return;
427
+ const i = n.componentIds.map((x) => ({ id: x, pos: c.get(x), node: g.nodes.find((y) => y.id === x) })).filter((x) => x.pos && x.node).sort((x, y) => x.node.x - y.node.x);
428
+ for (let x = 0; x < i.length - 1; x++) {
429
+ const y = i[x], m = i[x + 1];
430
+ s.append("line").attr("class", "wardley-pipeline-evolution-link").attr("x1", y.pos.x).attr("y1", y.pos.y).attr("x2", m.pos.x).attr("y2", m.pos.y).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4");
431
+ }
432
+ let p = 1 / 0, l = -1 / 0, f = 0;
433
+ if (n.componentIds.forEach((x) => {
434
+ const y = c.get(x);
435
+ y && (p = Math.min(p, y.x), l = Math.max(l, y.x), f = y.y);
436
+ }), p !== 1 / 0 && l !== -1 / 0) {
437
+ const y = a.nodeRadius * 4, m = f - y / 2, P = c.get(n.nodeId);
438
+ if (P) {
439
+ const N = (p + l) / 2;
440
+ P.x = N, P.y = m - w / 6;
441
+ }
442
+ t.append("rect").attr("class", "wardley-pipeline-box").attr("x", p - 15).attr("y", m).attr("width", l - p + 30).attr("height", y).attr("fill", "none").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
443
+ }
444
+ });
445
+ }
446
+ const _ = v.append("g").attr("class", "wardley-links"), Z = /* @__PURE__ */ new Map();
447
+ g.pipelines.forEach((t) => {
448
+ Z.set(t.nodeId, new Set(t.componentIds));
449
+ });
450
+ const U = g.links.filter((t) => !(!c.has(t.source) || !c.has(t.target) || Z.get(t.target)?.has(t.source)));
451
+ _.selectAll("line").data(U).enter().append("line").attr("class", (t) => `wardley-link${t.dashed ? " wardley-link--dashed" : ""}`).attr("x1", (t) => {
452
+ const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.source).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = n.x - s.x, f = n.y - s.y, x = Math.sqrt(l * l + f * f);
453
+ return s.x + l / x * p;
454
+ }).attr("y1", (t) => {
455
+ const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.source).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = n.x - s.x, f = n.y - s.y, x = Math.sqrt(l * l + f * f);
456
+ return s.y + f / x * p;
457
+ }).attr("x2", (t) => {
458
+ const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.target).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = s.x - n.x, f = s.y - n.y, x = Math.sqrt(l * l + f * f);
459
+ return n.x + l / x * p;
460
+ }).attr("y2", (t) => {
461
+ const s = c.get(t.source), n = c.get(t.target), p = g.nodes.find((y) => y.id === t.target).isPipelineParent ? w / Math.sqrt(2) : a.nodeRadius, l = s.x - n.x, f = s.y - n.y, x = Math.sqrt(l * l + f * f);
462
+ return n.y + f / x * p;
463
+ }).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", (t) => t.dashed ? "6 6" : null).attr("marker-end", (t) => t.flow === "forward" || t.flow === "bidirectional" ? `url(#link-arrow-end-${r})` : null).attr("marker-start", (t) => t.flow === "backward" || t.flow === "bidirectional" ? `url(#link-arrow-start-${r})` : null), _.selectAll("text").data(U.filter((t) => t.label)).enter().append("text").attr("class", "wardley-link-label").attr("x", (t) => {
464
+ const s = c.get(t.source), n = c.get(t.target), i = (s.x + n.x) / 2, p = n.y - s.y, l = n.x - s.x, f = Math.sqrt(l * l + p * p), x = 8, y = p / f;
465
+ return i + y * x;
466
+ }).attr("y", (t) => {
467
+ const s = c.get(t.source), n = c.get(t.target), i = (s.y + n.y) / 2, p = n.x - s.x, l = n.y - s.y, f = Math.sqrt(p * p + l * l), x = 8, y = -p / f;
468
+ return i + y * x;
469
+ }).attr("fill", d.axisTextColor).attr("font-size", a.labelFontSize).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("transform", (t) => {
470
+ const s = c.get(t.source), n = c.get(t.target), i = (s.x + n.x) / 2, p = (s.y + n.y) / 2, l = n.x - s.x, f = n.y - s.y, x = Math.sqrt(l * l + f * f), y = 8, m = f / x, P = -l / x, N = i + m * y, W = p + P * y;
471
+ let X = Math.atan2(f, l) * 180 / Math.PI;
472
+ return (X > 90 || X < -90) && (X += 180), `rotate(${X} ${N} ${W})`;
473
+ }).text((t) => t.label);
474
+ const kt = v.append("g").attr("class", "wardley-trends"), bt = g.trends.map((t) => {
475
+ const s = c.get(t.nodeId);
476
+ if (!s)
477
+ return null;
478
+ const n = z(t.targetX), i = L(t.targetY), p = n - s.x, l = i - s.y, f = Math.sqrt(p * p + l * l), x = a.nodeRadius + 2, y = f > x ? n - p / f * x : n, m = f > x ? i - l / f * x : i;
479
+ return {
480
+ origin: s,
481
+ targetX: n,
482
+ targetY: i,
483
+ adjustedX2: y,
484
+ adjustedY2: m
485
+ };
486
+ }).filter((t) => t !== null);
487
+ kt.selectAll("line").data(bt).enter().append("line").attr("class", "wardley-trend").attr("x1", (t) => t.origin.x).attr("y1", (t) => t.origin.y).attr("x2", (t) => t.adjustedX2).attr("y2", (t) => t.adjustedY2).attr("stroke", d.evolutionStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4").attr("marker-end", `url(#arrow-${r})`);
488
+ const M = v.append("g").attr("class", "wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr(
489
+ "class",
490
+ (t) => ["wardley-node", t.className ? `wardley-node--${t.className}` : ""].filter(Boolean).join(" ")
491
+ );
492
+ M.filter((t) => t.sourceStrategy === "outsource").append("circle").attr("class", "wardley-outsource-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius * 2).attr("fill", "#666").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter((t) => t.sourceStrategy === "buy").append("circle").attr("class", "wardley-buy-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius * 2).attr("fill", "#ccc").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter((t) => t.sourceStrategy === "build").append("circle").attr("class", "wardley-build-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius * 2).attr("fill", "#eee").attr("stroke", "#000").attr("stroke-width", 1);
493
+ const T = M.filter((t) => t.sourceStrategy === "market");
494
+ T.append("circle").attr("class", "wardley-market-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius * 2).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter(
495
+ (t) => !t.isPipelineParent && t.sourceStrategy !== "market" && t.className !== "anchor"
496
+ ).append("circle").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", a.nodeRadius).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1);
497
+ const H = a.nodeRadius * 0.7, $ = a.nodeRadius * 1.2;
498
+ if (T.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x).attr("y1", (t) => c.get(t.id).y - $).attr("x2", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("y2", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("stroke", d.componentStroke).attr("stroke-width", 1), T.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("y1", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("x2", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("y2", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("stroke", d.componentStroke).attr("stroke-width", 1), T.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("y1", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("x2", (t) => c.get(t.id).x).attr("y2", (t) => c.get(t.id).y - $).attr("stroke", d.componentStroke).attr("stroke-width", 1), T.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y - $).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), T.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("cy", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), T.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("cy", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), M.filter((t) => t.isPipelineParent === !0).append("rect").attr("x", (t) => c.get(t.id).x - w / 2).attr("y", (t) => c.get(t.id).y - w / 2).attr("width", w).attr("height", w).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1), M.filter((t) => t.inertia === !0).append("line").attr("class", "wardley-inertia").attr("x1", (t) => {
499
+ const s = c.get(t.id);
500
+ let n = t.isPipelineParent ? w / 2 + 15 : a.nodeRadius + 15;
501
+ return t.sourceStrategy && (n += a.nodeRadius + 10), s.x + n;
502
+ }).attr("y1", (t) => {
503
+ const s = c.get(t.id), n = t.isPipelineParent ? w : a.nodeRadius * 2;
504
+ return s.y - n / 2;
505
+ }).attr("x2", (t) => {
506
+ const s = c.get(t.id);
507
+ let n = t.isPipelineParent ? w / 2 + 15 : a.nodeRadius + 15;
508
+ return t.sourceStrategy && (n += a.nodeRadius + 10), s.x + n;
509
+ }).attr("y2", (t) => {
510
+ const s = c.get(t.id), n = t.isPipelineParent ? w : a.nodeRadius * 2;
511
+ return s.y + n / 2;
512
+ }).attr("stroke", d.componentStroke).attr("stroke-width", 6), M.append("text").attr("x", (t) => {
513
+ const s = c.get(t.id);
514
+ if (t.className === "anchor")
515
+ return t.labelOffsetX !== void 0 ? s.x + t.labelOffsetX : s.x;
516
+ let n = a.nodeLabelOffset;
517
+ t.sourceStrategy && t.labelOffsetX === void 0 && (n += 10);
518
+ const i = t.labelOffsetX ?? n;
519
+ return s.x + i;
520
+ }).attr("y", (t) => {
521
+ const s = c.get(t.id);
522
+ if (t.className === "anchor")
523
+ return t.labelOffsetY !== void 0 ? s.y + t.labelOffsetY : s.y - 3;
524
+ let n = -a.nodeLabelOffset;
525
+ t.sourceStrategy && t.labelOffsetY === void 0 && (n -= 10);
526
+ const i = t.labelOffsetY ?? n;
527
+ return s.y + i;
528
+ }).attr("class", "wardley-node-label").attr("fill", (t) => t.className === "evolved" ? d.evolutionStroke : t.className === "anchor" ? "#000" : d.componentLabelColor).attr("font-size", a.labelFontSize).attr("font-weight", (t) => t.className === "anchor" ? "bold" : "normal").attr("text-anchor", (t) => t.className === "anchor" ? "middle" : "start").attr("dominant-baseline", (t) => t.className === "anchor" ? "middle" : "auto").text((t) => t.label), g.annotations.length > 0) {
529
+ const t = v.append("g").attr("class", "wardley-annotations");
530
+ if (g.annotations.forEach((s) => {
531
+ const n = s.coordinates.map((i) => ({
532
+ x: z(i.x),
533
+ y: L(i.y)
534
+ }));
535
+ if (n.length > 1)
536
+ for (let i = 0; i < n.length - 1; i++)
537
+ t.append("line").attr("class", "wardley-annotation-line").attr("x1", n[i].x).attr("y1", n[i].y).attr("x2", n[i + 1].x).attr("y2", n[i + 1].y).attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("stroke-dasharray", "4 4");
538
+ n.forEach((i) => {
539
+ const p = t.append("g").attr("class", "wardley-annotation");
540
+ p.append("circle").attr("cx", i.x).attr("cy", i.y).attr("r", 10).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5), p.append("text").attr("x", i.x).attr("y", i.y).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.number);
541
+ });
542
+ }), g.annotationsBox) {
543
+ let s = z(g.annotationsBox.x), n = L(g.annotationsBox.y);
544
+ const i = 10, p = 16, l = 11, f = t.append("g").attr("class", "wardley-annotations-box"), x = [...g.annotations].filter((m) => m.text).sort((m, P) => m.number - P.number), y = [];
545
+ if (x.forEach((m, P) => {
546
+ const N = f.append("text").attr("x", s + i).attr("y", n + i + (P + 1) * p).attr("font-size", l).attr("fill", d.axisTextColor).attr("text-anchor", "start").attr("dominant-baseline", "middle").text(`${m.number}. ${m.text}`);
547
+ y.push(N);
548
+ }), y.length > 0) {
549
+ let m = 0, P = 0;
550
+ y.forEach((j) => {
551
+ const D = j.node(), Ct = D.getComputedTextLength();
552
+ m = Math.max(m, Ct);
553
+ const St = D.getBBox();
554
+ P = Math.max(P, St.height);
555
+ });
556
+ const N = m + i * 2 + 105, W = x.length * p + i * 2 + P / 2, X = a.padding, $t = S - a.padding - N, vt = a.padding, Pt = b - a.padding - W;
557
+ s = Math.max(X, Math.min(s, $t)), n = Math.max(vt, Math.min(n, Pt)), y.forEach((j, D) => {
558
+ j.attr("x", s + i).attr("y", n + i + (D + 1) * p);
559
+ }), f.insert("rect", "text").attr("x", s).attr("y", n).attr("width", N).attr("height", W).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
560
+ }
561
+ }
562
+ }
563
+ if (g.notes.length > 0) {
564
+ const t = v.append("g").attr("class", "wardley-notes");
565
+ g.notes.forEach((s) => {
566
+ const n = z(s.x), i = L(s.y);
567
+ t.append("text").attr("x", n).attr("y", i).attr("text-anchor", "start").attr("font-size", 11).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.text);
568
+ });
569
+ }
570
+ if (g.accelerators.length > 0) {
571
+ const t = v.append("g").attr("class", "wardley-accelerators");
572
+ g.accelerators.forEach((s) => {
573
+ const n = z(s.x), i = L(s.y), p = 60, l = 30, f = 20, x = `
574
+ M ${n} ${i - l / 2}
575
+ L ${n + p - f} ${i - l / 2}
576
+ L ${n + p - f} ${i - l / 2 - 8}
577
+ L ${n + p} ${i}
578
+ L ${n + p - f} ${i + l / 2 + 8}
579
+ L ${n + p - f} ${i + l / 2}
580
+ L ${n} ${i + l / 2}
581
+ Z
582
+ `;
583
+ t.append("path").attr("d", x).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", n + p / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.name);
584
+ });
585
+ }
586
+ if (g.deaccelerators.length > 0) {
587
+ const t = v.append("g").attr("class", "wardley-deaccelerators");
588
+ g.deaccelerators.forEach((s) => {
589
+ const n = z(s.x), i = L(s.y), p = 60, l = 30, f = 20, x = `
590
+ M ${n + p} ${i - l / 2}
591
+ L ${n + f} ${i - l / 2}
592
+ L ${n + f} ${i - l / 2 - 8}
593
+ L ${n} ${i}
594
+ L ${n + f} ${i + l / 2 + 8}
595
+ L ${n + f} ${i + l / 2}
596
+ L ${n + p} ${i + l / 2}
597
+ Z
598
+ `;
599
+ t.append("path").attr("d", x).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", n + p / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(s.name);
600
+ });
601
+ }
602
+ }, "draw"), _t = {
603
+ draw: Vt
604
+ }, Zt = /* @__PURE__ */ u(({
605
+ wardley: o
606
+ } = {}) => {
607
+ const r = Et(), e = Yt(), h = J(r, e.themeVariables), a = J(h.wardley, o);
608
+ return `
609
+ .wardley-background {
610
+ fill: ${a.backgroundColor};
611
+ }
612
+ .wardley-axes line, .wardley-axes path {
613
+ stroke: ${a.axisColor};
614
+ }
615
+ .wardley-axis-label {
616
+ fill: ${a.axisTextColor};
617
+ }
618
+ .wardley-stage-label {
619
+ fill: ${a.axisTextColor};
620
+ }
621
+ .wardley-grid line {
622
+ stroke: ${a.gridColor};
623
+ }
624
+ .wardley-node circle {
625
+ fill: ${a.componentFill};
626
+ stroke: ${a.componentStroke};
627
+ }
628
+ .wardley-node-label {
629
+ fill: ${a.componentLabelColor};
630
+ }
631
+ .wardley-link {
632
+ stroke: ${a.linkStroke};
633
+ }
634
+ .wardley-link--dashed {
635
+ stroke-dasharray: 4 4;
636
+ }
637
+ .wardley-link-label {
638
+ fill: ${a.axisTextColor};
639
+ }
640
+ .wardley-trend line {
641
+ stroke: ${a.evolutionStroke};
642
+ }
643
+ .wardley-annotation-line {
644
+ stroke: ${a.annotationStroke};
645
+ }
646
+ .wardley-annotation circle {
647
+ fill: ${a.annotationFill};
648
+ stroke: ${a.annotationStroke};
649
+ }
650
+ .wardley-annotation text {
651
+ fill: ${a.annotationTextColor};
652
+ }
653
+ .wardley-annotations-box rect {
654
+ fill: ${a.annotationFill};
655
+ stroke: ${a.annotationStroke};
656
+ }
657
+ .wardley-annotations-box text {
658
+ fill: ${a.annotationTextColor};
659
+ }
660
+ .wardley-pipeline-box {
661
+ stroke: ${a.componentStroke};
662
+ }
663
+ .wardley-notes text {
664
+ fill: ${a.axisTextColor};
665
+ }
666
+ `;
667
+ }, "styles"), te = {
668
+ parser: tt,
669
+ db: Gt,
670
+ renderer: _t,
671
+ styles: Zt
672
+ };
673
+ export {
674
+ te as diagram
675
+ };