docmedown 0.1.0 → 0.1.2

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 (233) hide show
  1. package/README.md +69 -20
  2. package/dist/abnfDiagram-VCTEODGH-CtQBp0Qv.mjs +89 -0
  3. package/dist/abnfDiagram-VCTEODGH-mccrzlD_.js +1 -0
  4. package/dist/arc-DgPKXEdT.mjs +82 -0
  5. package/dist/arc-n7TW7Bis.js +1 -0
  6. package/dist/architecture-7GRP2DOG-B7myQ46f.js +1 -0
  7. package/dist/architecture-7GRP2DOG-Cxj1ussQ.mjs +3 -0
  8. package/dist/architectureDiagram-5GKGNRK7-BdTCu5T3.js +36 -0
  9. package/dist/architectureDiagram-5GKGNRK7-CkgZa-G1.mjs +4154 -0
  10. package/dist/array-CApNbSU9.mjs +6 -0
  11. package/dist/array-DZSRzHA_.js +1 -0
  12. package/dist/blockDiagram-I7D4REHJ-CSYvpxQw.js +129 -0
  13. package/dist/blockDiagram-I7D4REHJ-CYngfPD9.mjs +1922 -0
  14. package/dist/c4Diagram-7LVT6UL2-B-sz5MUK.js +38 -0
  15. package/dist/c4Diagram-7LVT6UL2-DEzxFf2b.mjs +3010 -0
  16. package/dist/channel-LgHproiI.mjs +5 -0
  17. package/dist/channel-yqu0m4cl.js +1 -0
  18. package/dist/chunk-2E4U76K2-BOyeRQsI.js +1 -0
  19. package/dist/chunk-2E4U76K2-CoTrgtfg.mjs +348 -0
  20. package/dist/chunk-2Q5K7J3B-D4EgYPOq.mjs +15 -0
  21. package/dist/chunk-2Q5K7J3B-DhjCNjaM.js +1 -0
  22. package/dist/chunk-4HAMMTFA-GFyfmcSO.js +62 -0
  23. package/dist/chunk-4HAMMTFA-VgWPe1ng.mjs +4188 -0
  24. package/dist/chunk-5VM5RSS4-GINalzIv.js +15 -0
  25. package/dist/chunk-5VM5RSS4-TqxtqrwE.mjs +5 -0
  26. package/dist/chunk-75Z2AOVW-DYouz5MZ.js +2 -0
  27. package/dist/chunk-75Z2AOVW-Dz0Sko9Y.mjs +1330 -0
  28. package/dist/chunk-CLGD4ZFX-C5J-e2io.js +1 -0
  29. package/dist/chunk-CLGD4ZFX-DBkwyMMv.mjs +14 -0
  30. package/dist/chunk-DU6HZSFF-BEQZSmUu.mjs +3836 -0
  31. package/dist/chunk-DU6HZSFF-CWc5ewtb.js +127 -0
  32. package/dist/chunk-F27PBJKO-8jvY_jJK.js +1 -0
  33. package/dist/chunk-F27PBJKO-DFH3sRZG.mjs +61 -0
  34. package/dist/chunk-FOHPRMQF-LRqOLsSw.mjs +21456 -0
  35. package/dist/chunk-FOHPRMQF-tmTlwTeH.js +161 -0
  36. package/dist/chunk-GMAD6QVW-BZeZ4fdb.mjs +1863 -0
  37. package/dist/chunk-GMAD6QVW-DEQiTa0c.js +72 -0
  38. package/dist/chunk-GVQU2GXP-B1D3J05J.mjs +37 -0
  39. package/dist/chunk-GVQU2GXP-CdJIWN41.js +1 -0
  40. package/dist/chunk-IMKFNOWR-BmZb9U1f.mjs +2042 -0
  41. package/dist/chunk-IMKFNOWR-CPJsszGN.js +231 -0
  42. package/dist/chunk-JWPE2WC7-DIKiF5cm.mjs +8 -0
  43. package/dist/chunk-JWPE2WC7-p1fYVdYc.js +1 -0
  44. package/dist/chunk-L3NEJ4N5-TzDiVs78.js +1 -0
  45. package/dist/chunk-L3NEJ4N5-lal8wUID.mjs +245 -0
  46. package/dist/chunk-LNGE3PJU-BQX75wkM.js +34 -0
  47. package/dist/chunk-LNGE3PJU-DJ9JuXV6.mjs +1521 -0
  48. package/dist/chunk-OSK3NFVY-9AWK88m1.mjs +672 -0
  49. package/dist/chunk-OSK3NFVY-CHzvVe8m.js +10 -0
  50. package/dist/chunk-P2QGCYS3-6q3AXPt5.mjs +67 -0
  51. package/dist/chunk-P2QGCYS3-DKZzpRQW.js +1 -0
  52. package/dist/chunk-POPQ4Y6H-Dd7J9tx3.mjs +26 -0
  53. package/dist/chunk-POPQ4Y6H-T5C7wpjf.js +1 -0
  54. package/dist/chunk-PWAF6VOD-BYG76tEe.mjs +275 -0
  55. package/dist/chunk-PWAF6VOD-DxZLuCEw.js +1 -0
  56. package/dist/chunk-SHT3W25Y-B2Wes8jn.mjs +4183 -0
  57. package/dist/chunk-SHT3W25Y-BQjHSn5K.js +168 -0
  58. package/dist/chunk-SVP7TREG-BFMd615E.js +88 -0
  59. package/dist/chunk-SVP7TREG-CynckzeF.mjs +490 -0
  60. package/dist/chunk-TICWLB2K-BfCuoR1V.mjs +3357 -0
  61. package/dist/chunk-TICWLB2K-agcyBfUp.js +206 -0
  62. package/dist/chunk-TLUHSLCS-CUrWaKDG.mjs +59 -0
  63. package/dist/chunk-TLUHSLCS-Drx_a7am.js +1 -0
  64. package/dist/chunk-XXDRQBXY-AAk1-Cyg.js +1 -0
  65. package/dist/chunk-XXDRQBXY-DpR8eYzz.mjs +9 -0
  66. package/dist/chunk-Y2CYZVJY-CnmLqFtv.js +1 -0
  67. package/dist/chunk-Y2CYZVJY-i11wjrBe.mjs +12 -0
  68. package/dist/classDiagram-ZZMXUADV-B7IN9zcX.js +1 -0
  69. package/dist/classDiagram-ZZMXUADV-tcy6gxSB.mjs +30 -0
  70. package/dist/classDiagram-v2-VYDZK3BY-B7IN9zcX.js +1 -0
  71. package/dist/classDiagram-v2-VYDZK3BY-D5wM6Acp.mjs +30 -0
  72. package/dist/cli.js +719 -532
  73. package/dist/cose-bilkent-JH36ORCC-DBUPO3qJ.js +1 -0
  74. package/dist/cose-bilkent-JH36ORCC-Slpx4WIt.mjs +2253 -0
  75. package/dist/cynefin-OW5HDTMX--QVnfGi1.mjs +3 -0
  76. package/dist/cynefin-OW5HDTMX-lNKysi7S.js +1 -0
  77. package/dist/cynefinDiagram-5FMLGOSQ-CsFONYqx.js +62 -0
  78. package/dist/cynefinDiagram-5FMLGOSQ-DsrxYBcg.mjs +355 -0
  79. package/dist/cytoscape.esm-C5TvPYYm.mjs +18148 -0
  80. package/dist/cytoscape.esm-CBmWJr5M.js +321 -0
  81. package/dist/dagre-CZ6P9L_h.js +1 -0
  82. package/dist/dagre-GXQ25YYZ-CQszk-7P.js +4 -0
  83. package/dist/dagre-GXQ25YYZ-ecYByRSn.mjs +425 -0
  84. package/dist/dagre-J_1oH0eY.mjs +1934 -0
  85. package/dist/defaultLocale-N-0uLSyg.mjs +198 -0
  86. package/dist/defaultLocale-ybN1Vtvg.js +1 -0
  87. package/dist/diagram-S7CK7UJ4-CTMvxX__.js +30 -0
  88. package/dist/diagram-S7CK7UJ4-DxCghfa-.mjs +301 -0
  89. package/dist/diagram-UQ7AKVKN-1viEkqlG.js +41 -0
  90. package/dist/diagram-UQ7AKVKN-BA7Z_oB7.mjs +214 -0
  91. package/dist/diagram-VSXAHHWV-DgVT19mq.js +3 -0
  92. package/dist/diagram-VSXAHHWV-Dtqo03M5.mjs +432 -0
  93. package/dist/diagram-VX7I27RA-CNw0pOX_.js +24 -0
  94. package/dist/diagram-VX7I27RA-GMPRt8Zh.mjs +527 -0
  95. package/dist/diagram-Z3DM3KII-C6XdQK_Q.mjs +134 -0
  96. package/dist/diagram-Z3DM3KII-CPkBr3FT.js +24 -0
  97. package/dist/dist-CXWJafG_.js +1 -0
  98. package/dist/dist-DNdLIC8h.mjs +59 -0
  99. package/dist/docmedown.cjs +125 -44
  100. package/dist/docmedown.iife.js +3477 -72
  101. package/dist/docmedown.mjs +10003 -4807
  102. package/dist/ebnfDiagram-PWID7BFC-CseVsyL3.js +1 -0
  103. package/dist/ebnfDiagram-PWID7BFC-D_dBDXWC.mjs +100 -0
  104. package/dist/erDiagram-RLTQ6QDP-DFwfQTRS.js +99 -0
  105. package/dist/erDiagram-RLTQ6QDP-DP7ddGMH.mjs +1966 -0
  106. package/dist/eventmodeling-NTZA5JFV-CzxVg0l5.js +1 -0
  107. package/dist/eventmodeling-NTZA5JFV-Djsy__5n.mjs +3 -0
  108. package/dist/flowDiagram-HODETNUW-7hSJfI3W.js +1 -0
  109. package/dist/flowDiagram-HODETNUW-Dqu5Lr19.mjs +17 -0
  110. package/dist/ganttDiagram-EL5Y4UJY-KNL3tzTD.mjs +3072 -0
  111. package/dist/ganttDiagram-EL5Y4UJY-aiLqNWgi.js +292 -0
  112. package/dist/gitGraph-4MIJSDKK-DnElfqX7.js +1 -0
  113. package/dist/gitGraph-4MIJSDKK-xuKJBT2e.mjs +3 -0
  114. package/dist/gitGraphDiagram-WWUBYQGX-D4gSo_-e.js +106 -0
  115. package/dist/gitGraphDiagram-WWUBYQGX-Dooss5fG.mjs +733 -0
  116. package/dist/graphlib-BaETKKSa.js +1 -0
  117. package/dist/graphlib-XW-Jr8pF.mjs +1267 -0
  118. package/dist/info-A6RAGUB7-ClYskpn6.mjs +3 -0
  119. package/dist/info-A6RAGUB7-DDvvt-fW.js +1 -0
  120. package/dist/infoDiagram-27XIBGKW-B2-y2mdQ.mjs +20 -0
  121. package/dist/infoDiagram-27XIBGKW-DYQ9NzfL.js +2 -0
  122. package/dist/init-BJdqMO10.js +1 -0
  123. package/dist/init-CsQUQz36.mjs +13 -0
  124. package/dist/ishikawaDiagram-5VMMS53U-ULIhoYO5.js +70 -0
  125. package/dist/ishikawaDiagram-5VMMS53U-xAArNh-1.mjs +719 -0
  126. package/dist/journeyDiagram-3NMN7TZE-BBMYNZRL.js +139 -0
  127. package/dist/journeyDiagram-3NMN7TZE-BH-uKqP7.mjs +884 -0
  128. package/dist/kanban-definition-UXKFOSKX-Be49llXr.mjs +976 -0
  129. package/dist/kanban-definition-UXKFOSKX-CDL5yJkq.js +89 -0
  130. package/dist/line-BEwhHSLl.js +1 -0
  131. package/dist/line-CiXRog8O.mjs +34 -0
  132. package/dist/linear-75tfjrny.js +1 -0
  133. package/dist/linear-Ncx_RuON.mjs +288 -0
  134. package/dist/mermaid-parser.core-BBApyu_y.js +6 -0
  135. package/dist/mermaid-parser.core-BRHibdUE.mjs +638 -0
  136. package/dist/mindmap-definition-YA3MSWOX-Chy7XP_5.mjs +1006 -0
  137. package/dist/mindmap-definition-YA3MSWOX-DOda-fkL.js +96 -0
  138. package/dist/ordinal-B1BNQwUR.mjs +65 -0
  139. package/dist/ordinal-B9aFWmF9.js +1 -0
  140. package/dist/packet-AYTQ26CC-CorIy9Ul.js +1 -0
  141. package/dist/packet-AYTQ26CC-DWH8gXJK.mjs +3 -0
  142. package/dist/path-CnWkkRiY.mjs +84 -0
  143. package/dist/path-DIS6ck99.js +1 -0
  144. package/dist/pegDiagram-XKGWAZYB-Cdw6MeON.js +1 -0
  145. package/dist/pegDiagram-XKGWAZYB-uNfxRaq1.mjs +94 -0
  146. package/dist/pie-WAS4IAKB-Cn5eK-5P.mjs +3 -0
  147. package/dist/pie-WAS4IAKB-D84xrSoY.js +1 -0
  148. package/dist/pieDiagram-E7YTZNPT-Bd6mvpJw.js +39 -0
  149. package/dist/pieDiagram-E7YTZNPT-Cczo96a2.mjs +203 -0
  150. package/dist/quadrantDiagram-AXDQQJYC-BPfgvMsS.js +7 -0
  151. package/dist/quadrantDiagram-AXDQQJYC-eqRNtVRl.mjs +2001 -0
  152. package/dist/radar-RG4KPBEZ-DvkxGdO6.mjs +3 -0
  153. package/dist/radar-RG4KPBEZ-R2sQOLL9.js +1 -0
  154. package/dist/railroad-74A4TZTK-BOZIf6ts.js +1 -0
  155. package/dist/railroad-74A4TZTK-CrQzn8Nm.mjs +3 -0
  156. package/dist/railroad-abnf-HS5TGJTU-BZYetxLz.mjs +3 -0
  157. package/dist/railroad-abnf-HS5TGJTU-CXU1aC4B.js +1 -0
  158. package/dist/railroad-ebnf-LZEXJU2U-D29kI3YW.js +1 -0
  159. package/dist/railroad-ebnf-LZEXJU2U-qgzTOmN6.mjs +3 -0
  160. package/dist/railroad-peg-WCYAUIDC-Bjs9Ws3P.mjs +3 -0
  161. package/dist/railroad-peg-WCYAUIDC-CXviP0hz.js +1 -0
  162. package/dist/railroadDiagram-O6MQD6OU-58kvwt7H.mjs +76 -0
  163. package/dist/railroadDiagram-O6MQD6OU-CKY3uzTc.js +1 -0
  164. package/dist/requirementDiagram-BXWQKSXE-0hZ04Q6h.js +84 -0
  165. package/dist/requirementDiagram-BXWQKSXE-CS673B5n.mjs +2224 -0
  166. package/dist/rough.esm-ChRLLRha.js +1 -0
  167. package/dist/rough.esm-DXYGHN3m.mjs +1361 -0
  168. package/dist/sankeyDiagram-P5KCCOFB-D1D6HfAM.mjs +972 -0
  169. package/dist/sankeyDiagram-P5KCCOFB-ciJb9Zr8.js +40 -0
  170. package/dist/sequenceDiagram-WJ2MYXX4-BXEznuI6.js +162 -0
  171. package/dist/sequenceDiagram-WJ2MYXX4-CI1VT8AG.mjs +4156 -0
  172. package/dist/sizeCapture-INFHLROL-BihkCH-7.js +1 -0
  173. package/dist/sizeCapture-INFHLROL-BmxqyOLj.mjs +46 -0
  174. package/dist/src-B4mN2BMl.js +1 -0
  175. package/dist/src-D_hsMyeP.mjs +2154 -0
  176. package/dist/stateDiagram-D77RDMKH-BQrSs72W.mjs +220 -0
  177. package/dist/stateDiagram-D77RDMKH-D2PtkW2U.js +1 -0
  178. package/dist/stateDiagram-v2-MP3YSRHH-CCbvNfk-.mjs +30 -0
  179. package/dist/stateDiagram-v2-MP3YSRHH-Dq1QuPeN.js +1 -0
  180. package/dist/swimlanes-42K2YHIH-CA316NPm.mjs +4979 -0
  181. package/dist/swimlanes-42K2YHIH-DlggBCTy.js +1 -0
  182. package/dist/swimlanesDiagram-VR7AAH4N-BV9PEIoG.js +8 -0
  183. package/dist/swimlanesDiagram-VR7AAH4N-BfrOCfdf.mjs +31 -0
  184. package/dist/timeline-definition-24CTP7MA-Bkd8rWNJ.js +120 -0
  185. package/dist/timeline-definition-24CTP7MA-BvkqNYt1.mjs +1069 -0
  186. package/dist/treeView-Q6P3EWNA-Aof3Cp1M.mjs +3 -0
  187. package/dist/treeView-Q6P3EWNA-BTzvdwbb.js +1 -0
  188. package/dist/treemap-WGGIJYW6-BNXGg99p.mjs +3 -0
  189. package/dist/treemap-WGGIJYW6-DfR4P2Hh.js +1 -0
  190. package/dist/types/runtime/app.d.ts +3 -3
  191. package/dist/types/runtime/components/AppearanceMenu.d.ts +2 -0
  192. package/dist/types/runtime/components/Builtins.d.ts +3 -3
  193. package/dist/types/runtime/components/Content.d.ts +1 -1
  194. package/dist/types/runtime/components/DmdRegistry.d.ts +4 -2
  195. package/dist/types/runtime/components/Layout.d.ts +1 -1
  196. package/dist/types/runtime/components/MermaidDiagram.d.ts +16 -0
  197. package/dist/types/runtime/components/Navbar.d.ts +1 -1
  198. package/dist/types/runtime/components/OfflineDownloadButton.d.ts +2 -0
  199. package/dist/types/runtime/components/Sidebar.d.ts +1 -1
  200. package/dist/types/runtime/components/TableOfContents.d.ts +2 -2
  201. package/dist/types/runtime/config-schema.d.ts +386 -0
  202. package/dist/types/runtime/config.d.ts +10 -3
  203. package/dist/types/runtime/index.d.ts +7 -5
  204. package/dist/types/runtime/loader/auto-indexer.d.ts +1 -1
  205. package/dist/types/runtime/loader/local-loader.d.ts +1 -1
  206. package/dist/types/runtime/loader/remote-github.d.ts +2 -2
  207. package/dist/types/runtime/loader/remote-gitlab.d.ts +2 -2
  208. package/dist/types/runtime/markdown/callouts.d.ts +1 -1
  209. package/dist/types/runtime/markdown/highlighter.d.ts +16 -16
  210. package/dist/types/runtime/markdown/mermaid.d.ts +82 -1
  211. package/dist/types/runtime/markdown/parser.d.ts +1 -1
  212. package/dist/types/runtime/markdown/renderer.d.ts +1 -1
  213. package/dist/types/runtime/offline-export.d.ts +26 -0
  214. package/dist/types/runtime/provider/DocProvider.d.ts +5 -5
  215. package/dist/types/runtime/provider/ThemeProvider.d.ts +13 -6
  216. package/dist/types/runtime/search/SearchModal.d.ts +2 -2
  217. package/dist/types/runtime/search/search-index.d.ts +1 -1
  218. package/dist/types/runtime/types.d.ts +28 -99
  219. package/dist/vennDiagram-4TSXK5OY-BOUFXjso.js +34 -0
  220. package/dist/vennDiagram-4TSXK5OY-CeOg3-hU.mjs +1880 -0
  221. package/dist/wardley-WFR3VGLG-BOYcSLd1.mjs +3 -0
  222. package/dist/wardley-WFR3VGLG-DWDqJSgm.js +1 -0
  223. package/dist/wardleyDiagram-VM6X3IG4-BhWgMjFr.js +78 -0
  224. package/dist/wardleyDiagram-VM6X3IG4-C31KoRmF.mjs +645 -0
  225. package/dist/xychartDiagram-S5SC5T6Z-1yU8zz6I.js +7 -0
  226. package/dist/xychartDiagram-S5SC5T6Z-BK7upFom.mjs +2210 -0
  227. package/package.json +15 -4
  228. package/schemas/docs.schema.json +166 -0
  229. package/templates/README.md +4 -4
  230. package/templates/docs.json +5 -2
  231. package/templates/getting-started.md +1 -1
  232. package/templates/guides/custom-components.md +2 -0
  233. package/templates/index.html +2 -4
@@ -0,0 +1,214 @@
1
+ import { m as e } from "./src-D_hsMyeP.mjs";
2
+ import { n as t } from "./chunk-Y2CYZVJY-i11wjrBe.mjs";
3
+ import { D as n, H as r, K as i, U as a, a as o, b as s, c, f as l, v as u, w as d, y as f } from "./chunk-DU6HZSFF-BEQZSmUu.mjs";
4
+ import { i as p } from "./chunk-75Z2AOVW-Dz0Sko9Y.mjs";
5
+ import { t as m } from "./chunk-CLGD4ZFX-DBkwyMMv.mjs";
6
+ import { n as h } from "./mermaid-parser.core-BRHibdUE.mjs";
7
+ import { t as g } from "./chunk-JWPE2WC7-DIKiF5cm.mjs";
8
+ //#region node_modules/mermaid/dist/chunks/mermaid.core/diagram-UQ7AKVKN.mjs
9
+ var _ = {
10
+ showLegend: !0,
11
+ ticks: 5,
12
+ max: null,
13
+ min: 0,
14
+ graticule: "circle"
15
+ }, v = 32, y = {
16
+ axes: [],
17
+ curves: [],
18
+ options: _
19
+ }, b = structuredClone(y), x = l.radar, S = /* @__PURE__ */ t(() => p({
20
+ ...x,
21
+ ...s().radar
22
+ }), "getConfig"), C = /* @__PURE__ */ t(() => b.axes, "getAxes"), w = /* @__PURE__ */ t(() => b.curves, "getCurves"), T = /* @__PURE__ */ t(() => b.options, "getOptions"), E = /* @__PURE__ */ t((e) => {
23
+ b.axes = e.map((e) => ({
24
+ name: e.name,
25
+ label: e.label ?? e.name
26
+ }));
27
+ }, "setAxes"), D = /* @__PURE__ */ t((e) => {
28
+ b.curves = e.map((e) => ({
29
+ name: e.name,
30
+ label: e.label ?? e.name,
31
+ entries: O(e.entries)
32
+ }));
33
+ }, "setCurves"), O = /* @__PURE__ */ t((e) => {
34
+ if (e[0].axis == null) return e.map((e) => e.value);
35
+ let t = C();
36
+ if (t.length === 0) throw Error("Axes must be populated before curves for reference entries");
37
+ return t.map((t) => {
38
+ let n = e.find((e) => e.axis?.$refText === t.name);
39
+ if (n === void 0) throw Error("Missing entry for axis " + t.label);
40
+ return n.value;
41
+ });
42
+ }, "computeCurveEntries"), k = {
43
+ getAxes: C,
44
+ getCurves: w,
45
+ getOptions: T,
46
+ setAxes: E,
47
+ setCurves: D,
48
+ setOptions: /* @__PURE__ */ t((t) => {
49
+ let n = t.reduce((e, t) => (e[t.name] = t, e), {});
50
+ b.options = {
51
+ showLegend: n.showLegend?.value ?? _.showLegend,
52
+ ticks: n.ticks?.value ?? _.ticks,
53
+ max: n.max?.value ?? _.max,
54
+ min: n.min?.value ?? _.min,
55
+ graticule: n.graticule?.value ?? _.graticule
56
+ }, b.options.ticks > v && (e.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`), b.options.ticks = v);
57
+ }, "setOptions"),
58
+ getConfig: S,
59
+ clear: /* @__PURE__ */ t(() => {
60
+ o(), b = structuredClone(y);
61
+ }, "clear"),
62
+ setAccTitle: a,
63
+ getAccTitle: f,
64
+ setDiagramTitle: i,
65
+ getDiagramTitle: d,
66
+ getAccDescription: u,
67
+ setAccDescription: r
68
+ }, A = /* @__PURE__ */ t((e) => {
69
+ g(e, k);
70
+ let { axes: t, curves: n, options: r } = e;
71
+ k.setAxes(t), k.setCurves(n), k.setOptions(r);
72
+ }, "populate"), j = { parse: /* @__PURE__ */ t(async (t) => {
73
+ let n = await h("radar", t);
74
+ e.debug(n), A(n);
75
+ }, "parse") }, M = /* @__PURE__ */ t((e, t, n, r) => {
76
+ let i = r.db, a = i.getAxes(), o = i.getCurves(), s = i.getOptions(), c = i.getConfig(), l = i.getDiagramTitle(), u = N(m(t), c), d = s.max ?? Math.max(...o.map((e) => Math.max(...e.entries))), f = s.min, p = Math.min(c.width, c.height) / 2;
77
+ P(u, a, p, s.ticks, s.graticule), F(u, a, p, c), I(u, a, o, f, d, s.graticule, c), z(u, o, s.showLegend, c), u.append("text").attr("class", "radarTitle").text(l).attr("x", 0).attr("y", -c.height / 2 - c.marginTop);
78
+ }, "draw"), N = /* @__PURE__ */ t((e, t) => {
79
+ let n = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, i = {
80
+ x: t.marginLeft + t.width / 2,
81
+ y: t.marginTop + t.height / 2
82
+ };
83
+ return c(e, r, n, t.useMaxWidth ?? !0), e.attr("viewBox", `0 0 ${n} ${r}`).attr("overflow", "visible"), e.append("g").attr("transform", `translate(${i.x}, ${i.y})`);
84
+ }, "drawFrame"), P = /* @__PURE__ */ t((e, t, n, r, i) => {
85
+ if (i === "circle") for (let t = 0; t < r; t++) {
86
+ let i = n * (t + 1) / r;
87
+ e.append("circle").attr("r", i).attr("class", "radarGraticule");
88
+ }
89
+ else if (i === "polygon") {
90
+ let i = t.length;
91
+ for (let a = 0; a < r; a++) {
92
+ let o = n * (a + 1) / r, s = t.map((e, t) => {
93
+ let n = 2 * t * Math.PI / i - Math.PI / 2;
94
+ return `${o * Math.cos(n)},${o * Math.sin(n)}`;
95
+ }).join(" ");
96
+ e.append("polygon").attr("points", s).attr("class", "radarGraticule");
97
+ }
98
+ }
99
+ }, "drawGraticule"), F = /* @__PURE__ */ t((e, t, n, r) => {
100
+ let i = t.length;
101
+ for (let a = 0; a < i; a++) {
102
+ let o = t[a].label, s = 2 * a * Math.PI / i - Math.PI / 2, c = Math.cos(s), l = Math.sin(s);
103
+ e.append("line").attr("x1", 0).attr("y1", 0).attr("x2", n * r.axisScaleFactor * c).attr("y2", n * r.axisScaleFactor * l).attr("class", "radarAxisLine");
104
+ let u = c > .01 ? "start" : c < -.01 ? "end" : "middle", d = l > .01 ? "hanging" : l < -.01 ? "auto" : "central";
105
+ e.append("text").text(o).attr("x", n * r.axisLabelFactor * c + 4 * c).attr("y", n * r.axisLabelFactor * l + 4 * l).attr("text-anchor", u).attr("dominant-baseline", d).attr("class", "radarAxisLabel");
106
+ }
107
+ }, "drawAxes");
108
+ function I(e, t, n, r, i, a, o) {
109
+ let s = t.length, c = Math.min(o.width, o.height) / 2;
110
+ n.forEach((t, n) => {
111
+ if (t.entries.length !== s) return;
112
+ let l = t.entries.map((e, t) => {
113
+ let n = 2 * Math.PI * t / s - Math.PI / 2, a = L(e, r, i, c);
114
+ return {
115
+ x: a * Math.cos(n),
116
+ y: a * Math.sin(n)
117
+ };
118
+ });
119
+ a === "circle" ? e.append("path").attr("d", R(l, o.curveTension)).attr("class", `radarCurve-${n}`) : a === "polygon" && e.append("polygon").attr("points", l.map((e) => `${e.x},${e.y}`).join(" ")).attr("class", `radarCurve-${n}`);
120
+ });
121
+ }
122
+ t(I, "drawCurves");
123
+ function L(e, t, n, r) {
124
+ return r * (Math.min(Math.max(e, t), n) - t) / (n - t);
125
+ }
126
+ t(L, "relativeRadius");
127
+ function R(e, t) {
128
+ let n = e.length, r = `M${e[0].x},${e[0].y}`;
129
+ for (let i = 0; i < n; i++) {
130
+ let a = e[(i - 1 + n) % n], o = e[i], s = e[(i + 1) % n], c = e[(i + 2) % n], l = {
131
+ x: o.x + (s.x - a.x) * t,
132
+ y: o.y + (s.y - a.y) * t
133
+ }, u = {
134
+ x: s.x - (c.x - o.x) * t,
135
+ y: s.y - (c.y - o.y) * t
136
+ };
137
+ r += ` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`;
138
+ }
139
+ return `${r} Z`;
140
+ }
141
+ t(R, "closedRoundCurve");
142
+ function z(e, t, n, r) {
143
+ if (!n) return;
144
+ let i = (r.width / 2 + r.marginRight) * 3 / 4, a = -(r.height / 2 + r.marginTop) * 3 / 4;
145
+ t.forEach((t, n) => {
146
+ let r = e.append("g").attr("transform", `translate(${i}, ${a + n * 20})`);
147
+ r.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${n}`), r.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(t.label);
148
+ });
149
+ }
150
+ t(z, "drawLegend");
151
+ var B = { draw: M }, V = /* @__PURE__ */ t((e, t) => {
152
+ let n = "";
153
+ for (let r = 0; r < e.THEME_COLOR_LIMIT; r++) {
154
+ let i = e[`cScale${r}`];
155
+ n += `
156
+ .radarCurve-${r} {
157
+ color: ${i};
158
+ fill: ${i};
159
+ fill-opacity: ${t.curveOpacity};
160
+ stroke: ${i};
161
+ stroke-width: ${t.curveStrokeWidth};
162
+ }
163
+ .radarLegendBox-${r} {
164
+ fill: ${i};
165
+ fill-opacity: ${t.curveOpacity};
166
+ stroke: ${i};
167
+ }
168
+ `;
169
+ }
170
+ return n;
171
+ }, "genIndexStyles"), H = /* @__PURE__ */ t((e) => {
172
+ let t = n(), r = s(), i = p(t, r.themeVariables);
173
+ return {
174
+ themeVariables: i,
175
+ radarOptions: p(i.radar, e)
176
+ };
177
+ }, "buildRadarStyleOptions"), U = {
178
+ parser: j,
179
+ db: k,
180
+ renderer: B,
181
+ styles: /* @__PURE__ */ t(({ radar: e } = {}) => {
182
+ let { themeVariables: t, radarOptions: n } = H(e);
183
+ return `
184
+ .radarTitle {
185
+ font-size: ${t.fontSize};
186
+ color: ${t.titleColor};
187
+ dominant-baseline: hanging;
188
+ text-anchor: middle;
189
+ }
190
+ .radarAxisLine {
191
+ stroke: ${n.axisColor};
192
+ stroke-width: ${n.axisStrokeWidth};
193
+ }
194
+ .radarAxisLabel {
195
+ font-size: ${n.axisLabelFontSize}px;
196
+ color: ${n.axisColor};
197
+ }
198
+ .radarGraticule {
199
+ fill: ${n.graticuleColor};
200
+ fill-opacity: ${n.graticuleOpacity};
201
+ stroke: ${n.graticuleColor};
202
+ stroke-width: ${n.graticuleStrokeWidth};
203
+ }
204
+ .radarLegendText {
205
+ text-anchor: start;
206
+ font-size: ${n.legendFontSize}px;
207
+ dominant-baseline: hanging;
208
+ }
209
+ ${V(t, n)}
210
+ `;
211
+ }, "styles")
212
+ };
213
+ //#endregion
214
+ export { U as diagram };
@@ -0,0 +1,3 @@
1
+ const e=require("./src-B4mN2BMl.js"),t=require("./chunk-Y2CYZVJY-CnmLqFtv.js"),n=require("./chunk-DU6HZSFF-CWc5ewtb.js"),r=require("./chunk-75Z2AOVW-DYouz5MZ.js"),i=require("./chunk-FOHPRMQF-tmTlwTeH.js"),a=require("./mermaid-parser.core-BBApyu_y.js"),o=require("./chunk-JWPE2WC7-p1fYVdYc.js");var s=`position frame`,c=`frame positioned`,l=`position relation`,u=`relation positioned`,d=t.n(function(t){e.m.debug(`options str`,t)},`setOptions`),f=t.n(function(){return{}},`getOptions`),p=t.n(function(){m(),n.a()},`clear`);function m(){_={}}t.n(m,`reset`);var h=n.f.eventmodeling,g=t.n(()=>r.i({...h,...n.b().eventmodeling}),`getConfig`),_={};function v(){let t=S,{ast:n}=_,r=x();if(!n)throw Error(`No data for EventModel`);return n.frames.forEach((i,a)=>{let o=k(i,n.dataEntities,r);t=G(t,{$kind:s,index:a,frame:i,textProps:o});let c;I(i)?(e.m.debug(`source frame`,i.sourceFrames),c=n.frames.filter(e=>i.sourceFrames.some(t=>t.$refText===e.name)),c.forEach(e=>{t=G(t,{$kind:l,index:a,frame:i,sourceFrame:e})})):t=G(t,{$kind:l,index:a,frame:i})}),t={...t,sortedSwimlanesArray:N(t.swimlanes)},t}t.n(v,`getState`);function y(e){_.ast=e}t.n(y,`setAst`);var b={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function x(){return b}t.n(x,`getDiagramProps`);var S={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function C(e){let t=e.split(`.`);if(t.length===2)return t[0]}t.n(C,`extractNamespace`);function w(e){let t=e.split(`.`);return t.length===2?t[1]:e}t.n(w,`extractName`);function T(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}t.n(T,`findSwimlaneByNamespace`);function E(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&r<n}).map(e=>Number.parseInt(e)))+1}t.n(E,`findNextAvailableIndex`);function D(e,t){let n=C(e.entityIdentifier),r=T(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||b.labelUiAutomation}:n?{index:E(t,0,100),label:b.labelUiAutomationPrefix+n}:{index:0,label:b.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||b.labelCommandReadModel}:n?{index:E(t,100,200),label:b.labelCommandReadModelPrefix+n}:{index:100,label:b.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||b.labelEvents}:n?{index:E(t,200,300),label:b.labelEventsPrefix+n}:{index:200,label:b.labelEvents}}}t.n(D,`calculateSwimlaneProps`);function O(e){let{themeVariables:t}=n.b();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}t.n(O,`calculateEntityVisualProps`);function k(t,i,a){let o=n.b(),s=n.z(w(t.entityIdentifier)??``,o),c,l={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},u=`<b>${r._(s,a.textMaxWidth,l)}</b>`;if(t.dataInlineValue&&(c=t.dataInlineValue,c=c.substring(c.indexOf(`{`)+1),c=c.substring(0,c.lastIndexOf(`}`)-1),c=n.z(c,o),c=r._(c,a.textMaxWidth,l),c=c.replaceAll(` `,`&nbsp;`)),t.dataReference){let e=i.find(e=>e.name===t.dataReference?.$refText);e&&(c=e.dataBlockValue,c=c.substring(c.indexOf(`{
2
+ `)+2),c=c.substring(0,c.lastIndexOf(`}`)-1),c=n.z(c,o),c=r._(c,a.textMaxWidth,l),c=c.replaceAll(` `,`&nbsp;`),c+=`<br/>`)}let d=c!==void 0;d&&(u+=`<br/><br/><code style="text-align: left; display: block;max-width:${a.textMaxWidth}px">${c}</code>`);let f={fontSize:l.fontSize,fontWeight:l.fontWeight,fontFamily:l.fontFamily},p=r.t(u,f),m=d?p.width/3:p.width,h={content:u,width:m,height:p.height};return e.m.debug(`[${t.name}] ${t.entityIdentifier} text`,h),h}t.n(k,`calculateTextProps`);function A(e,t){let n=t,r=O(n.frame),i={width:n.textProps.width+2*b.boxTextPadding,height:n.textProps.height+2*b.boxTextPadding};return[{$kind:c,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}t.n(A,`decidePositionFrame`);function j(e,t,n){return t===void 0?b.contentStartX:t.index===e.index&&e.r?e.r+b.boxPadding:n===void 0?b.contentStartX:n.r-b.boxOverlap+b.boxPadding}t.n(j,`calculateX`);function M(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}t.n(M,`calculateMaxRight`);function N(e){return Object.values(e).sort((e,t)=>e.index-t.index)}t.n(N,`sortedSwimlanesArray`);function P(e,t){let n=t,r=D(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*b.swimlaneMinHeight+b.swimlaneGap,height:b.swimlaneMinHeight,maxHeight:b.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(b.boxMinWidth,Math.min(b.boxMaxWidth,n.dimension.width))+2*b.boxPadding,height:Math.max(b.boxMinHeight,Math.min(b.boxMaxHeight,n.dimension.height))+2*b.boxPadding},c=j(i,o,a),l=c+s.width+b.boxPadding,u=M(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(b.swimlaneMinHeight,i.maxHeight)+2*b.swimlanePadding;let d={x:c,y:b.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=N(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e<p.length;e++){let t=p[e],n=p[e-1];t.y=n.y+n.height+b.swimlaneGap}return f}t.n(P,`evolveFramePositioned`);function F(e,t){return e===0&&t.sourceFrames.length===0}t.n(F,`isFirstFrame`);function I(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}t.n(I,`hasSourceFrame`);function L(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}t.n(L,`findBoxByFrame`);function R(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}t.n(R,`findBoxByLineIndex`);function z(e,t){let n=t;if(i.T(n.frame)||F(n.index,n.frame))return[];let r=L(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let a;return a=n.sourceFrame?L(e.boxes,n.sourceFrame):R(e.boxes,r.swimlane.index,n.index-1),a===void 0?[]:[{$kind:u,frame:n.frame,index:n.index,sourceBox:a,targetBox:r}]}t.n(z,`decidePositionRelation`);function B(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}t.n(B,`evolveRelationPositioned`);var V={[s]:A,[l]:z},H={[c]:P,[u]:B};function U(t,n){let r=V[n.$kind];if(r==null)return[];let i=r(t,n);return e.m.debug(`decided events`,i),i}t.n(U,`decide`);function W(t,n){let r=n.reduce((e,t)=>{let n=H[t.$kind];return n==null?e:n(e,t)},t);return e.m.debug(`evolve events`,{state:t,newState:r,events:n}),r}t.n(W,`evolve`);function G(e,t){return W(e,U(e,t))}t.n(G,`dispatch`);var K={getConfig:g,setOptions:d,getOptions:f,clear:p,setAccTitle:n.U,getAccTitle:n.y,getAccDescription:n.v,setAccDescription:n.H,setDiagramTitle:n.K,getDiagramTitle:n.w,setAst:y,getDiagramProps:x,getState:v},q={parse:t.n(async t=>{let n=await a.n(`eventmodeling`,t);e.m.debug(n),K.setAst(n),o.t(n,K)},`parse`)},J=n.x()?.eventmodeling;function Y(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}t.n(Y,`renderD3Box`);function X(e,t){return e>t}t.n(X,`dirUpwards`);function Z(t,n,r,i){return a=>{let o=a.sourceBox.swimlane.y+n.swimlanePadding,s=a.targetBox.swimlane.y+n.swimlanePadding,c=X(o,s),l=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,d,f;e.m.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c?(d=o,f=s+a.targetBox.dimension.height):(d=o+a.sourceBox.dimension.height,f=s);let p=i.emRelationStroke??a.visual.stroke;t.append(`path`).attr(`class`,`em-relation`).attr(`fill`,a.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${r})`).attr(`d`,`M${l} ${d} L${u} ${f}`)}}t.n(Z,`renderD3Relation`);function Q(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}t.n(Q,`renderD3Swimlane`);var $={parser:q,db:K,renderer:{draw:t.n(function(t,r,i,a){if(e.m.debug(`in eventmodeling renderer`,t+`
3
+ `,`id:`,r,i),!J)throw Error(`EventModeling config not found`);let o=a.db,{themeVariables:s,eventmodeling:c}=n.x(),l=e.p(`[id="${r}"]`),u=o.getDiagramProps(),d=o.getState(),f=`em-arrowhead-${r}`,p=s.emArrowhead??`#000000`;d.sortedSwimlanesArray.forEach(Q(l,d.maxR,u,s)),d.boxes.forEach(Y(l,u)),d.relations.forEach(Z(l,u,f,s)),l.append(`defs`).append(`marker`).attr(`id`,f).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,p),n.Y(void 0,l,c?.padding??30,c?.useMaxWidth)},`draw`)},styles:t.n(e=>``,`getStyles`)};exports.diagram=$;
@@ -0,0 +1,432 @@
1
+ import { m as e, p as t } from "./src-D_hsMyeP.mjs";
2
+ import { n } from "./chunk-Y2CYZVJY-i11wjrBe.mjs";
3
+ import { H as r, K as i, U as a, Y as o, a as s, b as c, f as l, v as u, w as d, x as f, y as p, z as m } from "./chunk-DU6HZSFF-BEQZSmUu.mjs";
4
+ import { _ as h, i as g, t as ee } from "./chunk-75Z2AOVW-Dz0Sko9Y.mjs";
5
+ import { T as te } from "./chunk-FOHPRMQF-LRqOLsSw.mjs";
6
+ import { n as ne } from "./mermaid-parser.core-BRHibdUE.mjs";
7
+ import { t as re } from "./chunk-JWPE2WC7-DIKiF5cm.mjs";
8
+ //#region node_modules/mermaid/dist/chunks/mermaid.core/diagram-VSXAHHWV.mjs
9
+ var _ = "position frame", v = "frame positioned", y = "position relation", b = "relation positioned", ie = /* @__PURE__ */ n(function(t) {
10
+ e.debug("options str", t);
11
+ }, "setOptions"), ae = /* @__PURE__ */ n(function() {
12
+ return {};
13
+ }, "getOptions"), oe = /* @__PURE__ */ n(function() {
14
+ x(), s();
15
+ }, "clear");
16
+ function x() {
17
+ S = {};
18
+ }
19
+ n(x, "reset");
20
+ var se = l.eventmodeling, ce = /* @__PURE__ */ n(() => g({
21
+ ...se,
22
+ ...c().eventmodeling
23
+ }), "getConfig"), S = {};
24
+ function C() {
25
+ let t = le, { ast: n } = S, r = E();
26
+ if (!n) throw Error("No data for EventModel");
27
+ return n.frames.forEach((i, a) => {
28
+ let o = N(i, n.dataEntities, r);
29
+ t = q(t, {
30
+ $kind: _,
31
+ index: a,
32
+ frame: i,
33
+ textProps: o
34
+ });
35
+ let s;
36
+ B(i) ? (e.debug("source frame", i.sourceFrames), s = n.frames.filter((e) => i.sourceFrames.some((t) => t.$refText === e.name)), s.forEach((e) => {
37
+ t = q(t, {
38
+ $kind: y,
39
+ index: a,
40
+ frame: i,
41
+ sourceFrame: e
42
+ });
43
+ })) : t = q(t, {
44
+ $kind: y,
45
+ index: a,
46
+ frame: i
47
+ });
48
+ }), t = {
49
+ ...t,
50
+ sortedSwimlanesArray: L(t.swimlanes)
51
+ }, t;
52
+ }
53
+ n(C, "getState");
54
+ function w(e) {
55
+ S.ast = e;
56
+ }
57
+ n(w, "setAst");
58
+ var T = {
59
+ swimlaneMinHeight: 70,
60
+ swimlanePadding: 15,
61
+ swimlaneGap: 10,
62
+ boxPadding: 10,
63
+ boxOverlap: 90,
64
+ boxDefaultY: 0,
65
+ boxMinWidth: 80,
66
+ boxMaxWidth: 450,
67
+ boxMinHeight: 80,
68
+ boxMaxHeight: 750,
69
+ contentStartX: 250,
70
+ textMaxWidth: 430,
71
+ boxTextFontWeight: "bold",
72
+ boxTextPadding: 10,
73
+ swimlaneTextFontWeight: "bold",
74
+ labelUiAutomation: "UI/Automation",
75
+ labelUiAutomationPrefix: "UI/A: ",
76
+ labelCommandReadModel: "Command/Read Model",
77
+ labelCommandReadModelPrefix: "C/RM: ",
78
+ labelEvents: "Events",
79
+ labelEventsPrefix: "Stream: "
80
+ };
81
+ function E() {
82
+ return T;
83
+ }
84
+ n(E, "getDiagramProps");
85
+ var le = {
86
+ boxes: [],
87
+ swimlanes: {},
88
+ relations: [],
89
+ maxR: 0,
90
+ sortedSwimlanesArray: []
91
+ };
92
+ function D(e) {
93
+ let t = e.split(".");
94
+ if (t.length === 2) return t[0];
95
+ }
96
+ n(D, "extractNamespace");
97
+ function O(e) {
98
+ let t = e.split(".");
99
+ return t.length === 2 ? t[1] : e;
100
+ }
101
+ n(O, "extractName");
102
+ function k(e, t) {
103
+ if (!(!t || t.length === 0)) return Object.values(e).find((e) => e.namespace === t);
104
+ }
105
+ n(k, "findSwimlaneByNamespace");
106
+ function A(e, t, n) {
107
+ return Math.max(t, ...Object.keys(e).filter((e) => {
108
+ let r = Number.parseInt(e);
109
+ return r > t && r < n;
110
+ }).map((e) => Number.parseInt(e))) + 1;
111
+ }
112
+ n(A, "findNextAvailableIndex");
113
+ function j(e, t) {
114
+ let n = D(e.entityIdentifier), r = k(t, n);
115
+ switch (e.modelEntityType) {
116
+ case "ui":
117
+ case "pcr":
118
+ case "processor": return r ? {
119
+ index: r.index,
120
+ label: r.namespace || T.labelUiAutomation
121
+ } : n ? {
122
+ index: A(t, 0, 100),
123
+ label: T.labelUiAutomationPrefix + n
124
+ } : {
125
+ index: 0,
126
+ label: T.labelUiAutomation
127
+ };
128
+ case "rmo":
129
+ case "readmodel":
130
+ case "cmd":
131
+ case "command": return r ? {
132
+ index: r.index,
133
+ label: r.namespace || T.labelCommandReadModel
134
+ } : n ? {
135
+ index: A(t, 100, 200),
136
+ label: T.labelCommandReadModelPrefix + n
137
+ } : {
138
+ index: 100,
139
+ label: T.labelCommandReadModel
140
+ };
141
+ default: return r ? {
142
+ index: r.index,
143
+ label: r.namespace || T.labelEvents
144
+ } : n ? {
145
+ index: A(t, 200, 300),
146
+ label: T.labelEventsPrefix + n
147
+ } : {
148
+ index: 200,
149
+ label: T.labelEvents
150
+ };
151
+ }
152
+ }
153
+ n(j, "calculateSwimlaneProps");
154
+ function M(e) {
155
+ let { themeVariables: t } = c();
156
+ switch (e.modelEntityType) {
157
+ case "ui": return {
158
+ fill: t.emUiFill ?? "white",
159
+ stroke: t.emUiStroke ?? "#dbdada"
160
+ };
161
+ case "pcr":
162
+ case "processor": return {
163
+ fill: t.emProcessorFill ?? "#edb3f6",
164
+ stroke: t.emProcessorStroke ?? "#b88cbf"
165
+ };
166
+ case "rmo":
167
+ case "readmodel": return {
168
+ fill: t.emReadModelFill ?? "#d3f1a2",
169
+ stroke: t.emReadModelStroke ?? "#a3b732"
170
+ };
171
+ case "cmd":
172
+ case "command": return {
173
+ fill: t.emCommandFill ?? "#bcd6fe",
174
+ stroke: t.emCommandStroke ?? "#679ac3"
175
+ };
176
+ case "evt":
177
+ case "event": return {
178
+ fill: t.emEventFill ?? "#ffb778",
179
+ stroke: t.emEventStroke ?? "#c19a0f"
180
+ };
181
+ default: return {
182
+ fill: "red",
183
+ stroke: "black"
184
+ };
185
+ }
186
+ }
187
+ n(M, "calculateEntityVisualProps");
188
+ function N(t, n, r) {
189
+ let i = c(), a = m(O(t.entityIdentifier) ?? "", i), o, s = {
190
+ fontSize: 16,
191
+ fontWeight: 700,
192
+ fontFamily: "\"trebuchet ms\", verdana, arial, sans-serif",
193
+ joinWith: "<br/>"
194
+ }, l = `<b>${h(a, r.textMaxWidth, s)}</b>`;
195
+ if (t.dataInlineValue && (o = t.dataInlineValue, o = o.substring(o.indexOf("{") + 1), o = o.substring(0, o.lastIndexOf("}") - 1), o = m(o, i), o = h(o, r.textMaxWidth, s), o = o.replaceAll(" ", "&nbsp;")), t.dataReference) {
196
+ let e = n.find((e) => e.name === t.dataReference?.$refText);
197
+ e && (o = e.dataBlockValue, o = o.substring(o.indexOf("{\n") + 2), o = o.substring(0, o.lastIndexOf("}") - 1), o = m(o, i), o = h(o, r.textMaxWidth, s), o = o.replaceAll(" ", "&nbsp;"), o += "<br/>");
198
+ }
199
+ let u = o !== void 0;
200
+ u && (l += `<br/><br/><code style="text-align: left; display: block;max-width:${r.textMaxWidth}px">${o}</code>`);
201
+ let d = {
202
+ fontSize: s.fontSize,
203
+ fontWeight: s.fontWeight,
204
+ fontFamily: s.fontFamily
205
+ }, f = ee(l, d), p = u ? f.width / 3 : f.width, g = {
206
+ content: l,
207
+ width: p,
208
+ height: f.height
209
+ };
210
+ return e.debug(`[${t.name}] ${t.entityIdentifier} text`, g), g;
211
+ }
212
+ n(N, "calculateTextProps");
213
+ function P(e, t) {
214
+ let n = t, r = M(n.frame), i = {
215
+ width: n.textProps.width + 2 * T.boxTextPadding,
216
+ height: n.textProps.height + 2 * T.boxTextPadding
217
+ };
218
+ return [{
219
+ $kind: v,
220
+ frame: n.frame,
221
+ index: n.index,
222
+ visual: r,
223
+ dimension: i,
224
+ textProps: n.textProps
225
+ }];
226
+ }
227
+ n(P, "decidePositionFrame");
228
+ function F(e, t, n) {
229
+ return t === void 0 ? T.contentStartX : t.index === e.index && e.r ? e.r + T.boxPadding : n === void 0 ? T.contentStartX : n.r - T.boxOverlap + T.boxPadding;
230
+ }
231
+ n(F, "calculateX");
232
+ function I(e, t) {
233
+ let n = [...e.map((e) => e.r), t];
234
+ return Math.max(...n);
235
+ }
236
+ n(I, "calculateMaxRight");
237
+ function L(e) {
238
+ return Object.values(e).sort((e, t) => e.index - t.index);
239
+ }
240
+ n(L, "sortedSwimlanesArray");
241
+ function R(e, t) {
242
+ let n = t, r = j(n.frame, e.swimlanes), i;
243
+ i = r.index in e.swimlanes ? e.swimlanes[r.index] : {
244
+ index: r.index,
245
+ label: r.label,
246
+ r: 0,
247
+ y: r.index * T.swimlaneMinHeight + T.swimlaneGap,
248
+ height: T.swimlaneMinHeight,
249
+ maxHeight: T.swimlaneMinHeight
250
+ };
251
+ let a = e.boxes.length > 0 ? e.boxes[e.boxes.length - 1] : void 0, o = e.previousSwimlaneNumber === void 0 ? void 0 : e.swimlanes[e.previousSwimlaneNumber], s = {
252
+ width: Math.max(T.boxMinWidth, Math.min(T.boxMaxWidth, n.dimension.width)) + 2 * T.boxPadding,
253
+ height: Math.max(T.boxMinHeight, Math.min(T.boxMaxHeight, n.dimension.height)) + 2 * T.boxPadding
254
+ }, c = F(i, o, a), l = c + s.width + T.boxPadding, u = I(Object.values(e.swimlanes), l);
255
+ i.r = c + s.width, i.maxHeight = Math.max(i.maxHeight, s.height), i.height = Math.max(T.swimlaneMinHeight, i.maxHeight) + 2 * T.swimlanePadding;
256
+ let d = {
257
+ x: c,
258
+ y: T.swimlanePadding + i.y,
259
+ r: l,
260
+ dimension: s,
261
+ leftSibling: !1,
262
+ swimlane: i,
263
+ visual: n.visual,
264
+ text: n.textProps.content,
265
+ frame: n.frame,
266
+ index: n.index
267
+ }, f = {
268
+ ...e,
269
+ boxes: [...e.boxes, d],
270
+ swimlanes: {
271
+ ...e.swimlanes,
272
+ [`${i.index}`]: i
273
+ },
274
+ previousSwimlaneNumber: r.index,
275
+ previousFrame: n.frame,
276
+ maxR: u
277
+ }, p = L(f.swimlanes);
278
+ p.length > 0 && (p[0].y = 0);
279
+ for (let e = 1; e < p.length; e++) {
280
+ let t = p[e], n = p[e - 1];
281
+ t.y = n.y + n.height + T.swimlaneGap;
282
+ }
283
+ return f;
284
+ }
285
+ n(R, "evolveFramePositioned");
286
+ function z(e, t) {
287
+ return e === 0 && t.sourceFrames.length === 0;
288
+ }
289
+ n(z, "isFirstFrame");
290
+ function B(e) {
291
+ return e.sourceFrames !== void 0 && e.sourceFrames !== null && e.sourceFrames.length > 0;
292
+ }
293
+ n(B, "hasSourceFrame");
294
+ function V(e, t) {
295
+ if (t != null) return e.find((e) => e.frame.name === t.name);
296
+ }
297
+ n(V, "findBoxByFrame");
298
+ function H(e, t, n) {
299
+ if (!(n < 0)) for (let r = n; r >= 0; r--) {
300
+ let n = e[r];
301
+ if (n.swimlane.index !== t) return n;
302
+ }
303
+ }
304
+ n(H, "findBoxByLineIndex");
305
+ function U(e, t) {
306
+ let n = t;
307
+ if (te(n.frame) || z(n.index, n.frame)) return [];
308
+ let r = V(e.boxes, n.frame);
309
+ if (r === void 0) throw Error(`Target box not found for frame ${n.frame.name}`);
310
+ let i;
311
+ return i = n.sourceFrame ? V(e.boxes, n.sourceFrame) : H(e.boxes, r.swimlane.index, n.index - 1), i === void 0 ? [] : [{
312
+ $kind: b,
313
+ frame: n.frame,
314
+ index: n.index,
315
+ sourceBox: i,
316
+ targetBox: r
317
+ }];
318
+ }
319
+ n(U, "decidePositionRelation");
320
+ function W(e, t) {
321
+ let n = t, r = {
322
+ visual: {
323
+ fill: "none",
324
+ stroke: "#000"
325
+ },
326
+ source: {
327
+ x: n.sourceBox.x,
328
+ y: n.sourceBox.y
329
+ },
330
+ target: {
331
+ x: n.targetBox.x,
332
+ y: n.targetBox.y
333
+ },
334
+ sourceBox: n.sourceBox,
335
+ targetBox: n.targetBox
336
+ };
337
+ return {
338
+ ...e,
339
+ relations: [...e.relations, r]
340
+ };
341
+ }
342
+ n(W, "evolveRelationPositioned");
343
+ var ue = {
344
+ [_]: P,
345
+ [y]: U
346
+ }, de = {
347
+ [v]: R,
348
+ [b]: W
349
+ };
350
+ function G(t, n) {
351
+ let r = ue[n.$kind];
352
+ if (r == null) return [];
353
+ let i = r(t, n);
354
+ return e.debug("decided events", i), i;
355
+ }
356
+ n(G, "decide");
357
+ function K(t, n) {
358
+ let r = n.reduce((e, t) => {
359
+ let n = de[t.$kind];
360
+ return n == null ? e : n(e, t);
361
+ }, t);
362
+ return e.debug("evolve events", {
363
+ state: t,
364
+ newState: r,
365
+ events: n
366
+ }), r;
367
+ }
368
+ n(K, "evolve");
369
+ function q(e, t) {
370
+ return K(e, G(e, t));
371
+ }
372
+ n(q, "dispatch");
373
+ var J = {
374
+ getConfig: ce,
375
+ setOptions: ie,
376
+ getOptions: ae,
377
+ clear: oe,
378
+ setAccTitle: a,
379
+ getAccTitle: p,
380
+ getAccDescription: u,
381
+ setAccDescription: r,
382
+ setDiagramTitle: i,
383
+ getDiagramTitle: d,
384
+ setAst: w,
385
+ getDiagramProps: E,
386
+ getState: C
387
+ }, fe = { parse: /* @__PURE__ */ n(async (t) => {
388
+ let n = await ne("eventmodeling", t);
389
+ e.debug(n), J.setAst(n), re(n, J);
390
+ }, "parse") }, Y = f()?.eventmodeling;
391
+ function X(e, t) {
392
+ return (n) => {
393
+ let r = n.swimlane.y + t.swimlanePadding, i = e.append("g").attr("class", "em-box");
394
+ i.append("rect").attr("x", n.x).attr("y", r).attr("rx", "3").attr("width", n.dimension.width).attr("height", n.dimension.height).attr("stroke", n.visual.stroke).attr("fill", n.visual.fill), i.append("foreignObject").attr("x", n.x + t.boxPadding).attr("y", r + 10).attr("width", n.dimension.width - 2 * t.boxPadding).attr("height", n.dimension.height - 2 * t.boxPadding).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%").append("span").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").html(n.text);
395
+ };
396
+ }
397
+ n(X, "renderD3Box");
398
+ function Z(e, t) {
399
+ return e > t;
400
+ }
401
+ n(Z, "dirUpwards");
402
+ function Q(t, n, r, i) {
403
+ return (a) => {
404
+ let o = a.sourceBox.swimlane.y + n.swimlanePadding, s = a.targetBox.swimlane.y + n.swimlanePadding, c = Z(o, s), l = a.sourceBox.x + a.sourceBox.dimension.width * 2 / 3, u = a.targetBox.x + a.targetBox.dimension.width / 3, d, f;
405
+ e.debug(`rendering relation up=${c} for `, {
406
+ sourceBox: a.sourceBox,
407
+ targetBox: a.targetBox
408
+ }), c ? (d = o, f = s + a.targetBox.dimension.height) : (d = o + a.sourceBox.dimension.height, f = s);
409
+ let p = i.emRelationStroke ?? a.visual.stroke;
410
+ t.append("path").attr("class", "em-relation").attr("fill", a.visual.fill).attr("stroke", p).attr("stroke-width", "1").attr("marker-end", `url(#${r})`).attr("d", `M${l} ${d} L${u} ${f}`);
411
+ };
412
+ }
413
+ n(Q, "renderD3Relation");
414
+ function $(e, t, n, r) {
415
+ return (i) => {
416
+ let a = e.append("g").attr("class", "em-swimlane"), o = r.emSwimlaneBackgroundOdd ?? "rgb(250,250,250)", s = r.emSwimlaneBackgroundStroke ?? "rgb(240,240,240)";
417
+ a.append("rect").attr("x", 0).attr("y", i.y).attr("rx", "3").attr("width", t + n.swimlanePadding).attr("height", i.height).attr("fill", o).attr("stroke", s), a.append("text").attr("font-weight", n.swimlaneTextFontWeight).attr("x", 30).attr("y", i.y + 30).text(i.label);
418
+ };
419
+ }
420
+ n($, "renderD3Swimlane");
421
+ var pe = {
422
+ parser: fe,
423
+ db: J,
424
+ renderer: { draw: /* @__PURE__ */ n(function(n, r, i, a) {
425
+ if (e.debug("in eventmodeling renderer", n + "\n", "id:", r, i), !Y) throw Error("EventModeling config not found");
426
+ let s = a.db, { themeVariables: c, eventmodeling: l } = f(), u = t(`[id="${r}"]`), d = s.getDiagramProps(), p = s.getState(), m = `em-arrowhead-${r}`, h = c.emArrowhead ?? "#000000";
427
+ p.sortedSwimlanesArray.forEach($(u, p.maxR, d, c)), p.boxes.forEach(X(u, d)), p.relations.forEach(Q(u, d, m, c)), u.append("defs").append("marker").attr("id", m).attr("markerWidth", "10").attr("markerHeight", "7").attr("refX", "10").attr("refY", "3.5").attr("orient", "auto").append("polygon").attr("points", "0 0, 10 3.5, 0 7").attr("fill", h), o(void 0, u, l?.padding ?? 30, l?.useMaxWidth);
428
+ }, "draw") },
429
+ styles: /* @__PURE__ */ n((e) => "", "getStyles")
430
+ };
431
+ //#endregion
432
+ export { pe as diagram };