@draftably/editor 0.0.0-stage → 0.1.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 (185) hide show
  1. package/README.md +26 -2
  2. package/dist/LICENSE +21 -0
  3. package/dist/assets/engine.worker-DmHew5f6.js +6813 -0
  4. package/dist/assets/import-d2.worker-CnXfFXoa.js +5395 -0
  5. package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +87 -0
  6. package/dist/chunks/arc-rJj0TtXf.js +83 -0
  7. package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +4781 -0
  8. package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +1440 -0
  9. package/dist/chunks/browser-iNhbPsGc.js +40 -0
  10. package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +1524 -0
  11. package/dist/chunks/channel-qMvPU6eH.js +5 -0
  12. package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +670 -0
  13. package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +18 -0
  14. package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +262 -0
  15. package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +68 -0
  16. package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +19 -0
  17. package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +8 -0
  18. package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +19 -0
  19. package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +8 -0
  20. package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +451 -0
  21. package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +1570 -0
  22. package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +2608 -0
  23. package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +22361 -0
  24. package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +299 -0
  25. package/dist/chunks/cytoscape.esm-CRsF_JA3.js +18791 -0
  26. package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +2157 -0
  27. package/dist/chunks/defaultLocale-BgPVtth8.js +171 -0
  28. package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +531 -0
  29. package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +153 -0
  30. package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +346 -0
  31. package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +480 -0
  32. package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +219 -0
  33. package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +2586 -0
  34. package/dist/chunks/dot-importer-B23jwEkx.js +1547 -0
  35. package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +109 -0
  36. package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +49229 -0
  37. package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +1064 -0
  38. package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +1771 -0
  39. package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +2729 -0
  40. package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +815 -0
  41. package/dist/chunks/graph-CKJmgLki.js +1541 -0
  42. package/dist/chunks/import-core-C-I1wGfw.js +145 -0
  43. package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +24 -0
  44. package/dist/chunks/init-DjUOC4st.js +16 -0
  45. package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +624 -0
  46. package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +834 -0
  47. package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +724 -0
  48. package/dist/chunks/katex-BsrBVQKd.js +11314 -0
  49. package/dist/chunks/linear-4t7D_ros.js +259 -0
  50. package/dist/chunks/mermaid-facade-BoLWBerE.js +289 -0
  51. package/dist/chunks/mermaid-importer-Cgx1IhmR.js +478 -0
  52. package/dist/chunks/mermaid.core-DXv6D2Sm.js +19244 -0
  53. package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +837 -0
  54. package/dist/chunks/mount-C1Xk_GQz.js +22131 -0
  55. package/dist/chunks/ordinal-DfAQgscy.js +61 -0
  56. package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +95 -0
  57. package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +208 -0
  58. package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +1029 -0
  59. package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +77 -0
  60. package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +889 -0
  61. package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +859 -0
  62. package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +2972 -0
  63. package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +46 -0
  64. package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +1520 -0
  65. package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +4991 -0
  66. package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +13 -0
  67. package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +1058 -0
  68. package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +7945 -0
  69. package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +1578 -0
  70. package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +678 -0
  71. package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +1536 -0
  72. package/dist/element.js +36 -0
  73. package/dist/index.js +4 -0
  74. package/dist/types/src/cli/links.d.ts +4 -0
  75. package/dist/types/src/cli/pdf.d.ts +29 -0
  76. package/dist/types/src/cli/png.d.ts +23 -0
  77. package/dist/types/src/cli/svg.d.ts +4 -0
  78. package/dist/types/src/components/Icon.d.ts +14 -0
  79. package/dist/types/src/components/LayoutPreviewBar.d.ts +2 -0
  80. package/dist/types/src/components/canvas/Canvas.d.ts +15 -0
  81. package/dist/types/src/components/canvas/Frame.d.ts +22 -0
  82. package/dist/types/src/components/canvas/InlineEditor.d.ts +2 -0
  83. package/dist/types/src/components/canvas/Notes.d.ts +5 -0
  84. package/dist/types/src/components/canvas/Overlay.d.ts +2 -0
  85. package/dist/types/src/components/canvas/StateBar.d.ts +5 -0
  86. package/dist/types/src/components/canvas/TextHits.d.ts +6 -0
  87. package/dist/types/src/components/canvas/ZoomControls.d.ts +1 -0
  88. package/dist/types/src/components/canvas/text-boxes.d.ts +24 -0
  89. package/dist/types/src/components/controls.d.ts +88 -0
  90. package/dist/types/src/components/scene/EdgeView.d.ts +22 -0
  91. package/dist/types/src/components/scene/GroupView.d.ts +22 -0
  92. package/dist/types/src/components/scene/Lifelines.d.ts +15 -0
  93. package/dist/types/src/components/scene/LinkMark.d.ts +11 -0
  94. package/dist/types/src/components/scene/NodeView.d.ts +18 -0
  95. package/dist/types/src/components/scene/parts.d.ts +50 -0
  96. package/dist/types/src/components/sculpt/BrushDock.d.ts +2 -0
  97. package/dist/types/src/components/sculpt/TimelineDeck.d.ts +2 -0
  98. package/dist/types/src/components/session-context.d.ts +486 -0
  99. package/dist/types/src/dsl/cells.d.ts +91 -0
  100. package/dist/types/src/dsl/channels.d.ts +53 -0
  101. package/dist/types/src/dsl/compile.d.ts +162 -0
  102. package/dist/types/src/dsl/frame.d.ts +38 -0
  103. package/dist/types/src/dsl/lanes.d.ts +23 -0
  104. package/dist/types/src/dsl/layout-edits.d.ts +58 -0
  105. package/dist/types/src/dsl/legend-notes.d.ts +3 -0
  106. package/dist/types/src/dsl/project.d.ts +39 -0
  107. package/dist/types/src/dsl/source-edits.d.ts +37 -0
  108. package/dist/types/src/dsl/syntax.d.ts +317 -0
  109. package/dist/types/src/dsl/translate.d.ts +69 -0
  110. package/dist/types/src/editor/Editor.d.ts +6 -0
  111. package/dist/types/src/editor/element.d.ts +15 -0
  112. package/dist/types/src/editor/mount.d.ts +23 -0
  113. package/dist/types/src/import/browser.d.ts +3 -0
  114. package/dist/types/src/import/detect.d.ts +31 -0
  115. package/dist/types/src/import/dot-importer.d.ts +3 -0
  116. package/dist/types/src/import/import-core.d.ts +105 -0
  117. package/dist/types/src/import/mermaid-facade.d.ts +120 -0
  118. package/dist/types/src/import/mermaid-importer.d.ts +4 -0
  119. package/dist/types/src/import/mermaid-sequence.d.ts +8 -0
  120. package/dist/types/src/import/scratch.d.ts +3 -0
  121. package/dist/types/src/lib/engine-tasks.d.ts +88 -0
  122. package/dist/types/src/lib/font-data.d.ts +9 -0
  123. package/dist/types/src/lib/saved-diagram.d.ts +4 -0
  124. package/dist/types/src/lib/scene-cache.d.ts +4 -0
  125. package/dist/types/src/lib/source-hash.d.ts +7 -0
  126. package/dist/types/src/lib/svg-export.d.ts +15 -0
  127. package/dist/types/src/model/appearance.d.ts +209 -0
  128. package/dist/types/src/model/bounds.d.ts +19 -0
  129. package/dist/types/src/model/camera.d.ts +21 -0
  130. package/dist/types/src/model/candidates.d.ts +53 -0
  131. package/dist/types/src/model/colors.d.ts +22 -0
  132. package/dist/types/src/model/document.d.ts +24 -0
  133. package/dist/types/src/model/edits.d.ts +133 -0
  134. package/dist/types/src/model/embed.d.ts +17 -0
  135. package/dist/types/src/model/examples.d.ts +15 -0
  136. package/dist/types/src/model/font-faces.d.ts +24 -0
  137. package/dist/types/src/model/fonts.d.ts +47 -0
  138. package/dist/types/src/model/footnote.d.ts +34 -0
  139. package/dist/types/src/model/frame.d.ts +71 -0
  140. package/dist/types/src/model/geometry.d.ts +29 -0
  141. package/dist/types/src/model/graph.d.ts +53 -0
  142. package/dist/types/src/model/heading.d.ts +38 -0
  143. package/dist/types/src/model/icons.d.ts +2 -0
  144. package/dist/types/src/model/label-hits.d.ts +27 -0
  145. package/dist/types/src/model/labels.d.ts +88 -0
  146. package/dist/types/src/model/legend.d.ts +25 -0
  147. package/dist/types/src/model/link.d.ts +63 -0
  148. package/dist/types/src/model/markers.d.ts +47 -0
  149. package/dist/types/src/model/note.d.ts +75 -0
  150. package/dist/types/src/model/panels.d.ts +11 -0
  151. package/dist/types/src/model/rich-text.d.ts +24 -0
  152. package/dist/types/src/model/routes.d.ts +170 -0
  153. package/dist/types/src/model/samples.d.ts +11 -0
  154. package/dist/types/src/model/stack.d.ts +8 -0
  155. package/dist/types/src/model/static-scene.d.ts +15 -0
  156. package/dist/types/src/model/status.d.ts +84 -0
  157. package/dist/types/src/model/styles.d.ts +13 -0
  158. package/dist/types/src/model/surface.d.ts +31 -0
  159. package/dist/types/src/model/types.d.ts +277 -0
  160. package/dist/types/src/runtime/svg-renderer.d.ts +38 -0
  161. package/dist/types/src/server/file-session.d.ts +19 -0
  162. package/dist/types/src/server/workspace.d.ts +21 -0
  163. package/dist/types/src/state/active-session.d.ts +479 -0
  164. package/dist/types/src/state/commands.d.ts +529 -0
  165. package/dist/types/src/state/comparison.d.ts +151 -0
  166. package/dist/types/src/state/files.d.ts +61 -0
  167. package/dist/types/src/state/keyboard.d.ts +6 -0
  168. package/dist/types/src/state/keys.d.ts +5 -0
  169. package/dist/types/src/state/launch.d.ts +61 -0
  170. package/dist/types/src/state/links.d.ts +11 -0
  171. package/dist/types/src/state/session/actions.d.ts +77 -0
  172. package/dist/types/src/state/session/canvas-text.d.ts +24 -0
  173. package/dist/types/src/state/session/document.d.ts +84 -0
  174. package/dist/types/src/state/session/editor.d.ts +81 -0
  175. package/dist/types/src/state/session/emphasis.d.ts +11 -0
  176. package/dist/types/src/state/session/file-session.d.ts +98 -0
  177. package/dist/types/src/state/session/index.d.ts +496 -0
  178. package/dist/types/src/state/session/layout.d.ts +79 -0
  179. package/dist/types/src/state/session/pointer.d.ts +19 -0
  180. package/dist/types/src/state/session/routing.d.ts +20 -0
  181. package/dist/types/src/state/session/scene.d.ts +144 -0
  182. package/dist/types/src/state/session/sculpt.d.ts +70 -0
  183. package/dist/types/src/state/toast.d.ts +14 -0
  184. package/dist/types/src/state/ui.d.ts +39 -0
  185. package/package.json +41 -3
@@ -0,0 +1,1524 @@
1
+ import { d as Ae } from "./chunk-55XCU76K-DkZUAaqC.js";
2
+ import { s as Le, g as Ie, a as Me, b as Be, _ as d, c as Rt, l as ue, d as Ve, e as Ye, i as Fe, f as Pt, h as Ue, j as _e, k as Gt, w as je, m as Zt, n as he } from "./mermaid.core-DXv6D2Sm.js";
3
+ var Ft = (function() {
4
+ var t = /* @__PURE__ */ d(function(_t, m, x, E) {
5
+ for (x = x || {}, E = _t.length; E--; x[_t[E]] = m) ;
6
+ return x;
7
+ }, "o"), e = [1, 24], a = [1, 25], r = [1, 26], u = [1, 27], i = [1, 28], n = [1, 63], l = [1, 64], s = [1, 65], h = [1, 66], y = [1, 67], p = [1, 68], g = [1, 69], v = [1, 29], w = [1, 30], N = [1, 31], O = [1, 32], P = [1, 33], I = [1, 34], X = [1, 35], q = [1, 36], H = [1, 37], Q = [1, 38], K = [1, 39], G = [1, 40], J = [1, 41], Z = [1, 42], $ = [1, 43], tt = [1, 44], et = [1, 45], nt = [1, 46], st = [1, 47], at = [1, 48], rt = [1, 50], it = [1, 51], ot = [1, 52], lt = [1, 53], ct = [1, 54], ut = [1, 55], ht = [1, 56], dt = [1, 57], pt = [1, 58], ft = [1, 59], yt = [1, 60], kt = [14, 42], zt = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], wt = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], S = [1, 82], T = [1, 83], k = [1, 84], C = [1, 85], R = [12, 14, 42], re = [12, 14, 33, 42], It = [12, 14, 33, 42, 76, 77, 79, 80], xt = [12, 33], Wt = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], Xt = {
8
+ trace: /* @__PURE__ */ d(function() {
9
+ }, "trace"),
10
+ yy: {},
11
+ symbols_: { error: 2, start: 3, mermaidDoc: 4, direction: 5, direction_tb: 6, direction_bt: 7, direction_rl: 8, direction_lr: 9, graphConfig: 10, C4_CONTEXT: 11, NEWLINE: 12, statements: 13, EOF: 14, C4_CONTAINER: 15, C4_COMPONENT: 16, C4_DYNAMIC: 17, C4_DEPLOYMENT: 18, otherStatements: 19, diagramStatements: 20, otherStatement: 21, title: 22, accDescription: 23, acc_title: 24, acc_title_value: 25, acc_descr: 26, acc_descr_value: 27, acc_descr_multiline_value: 28, boundaryStatement: 29, boundaryStartStatement: 30, boundaryStopStatement: 31, boundaryStart: 32, LBRACE: 33, ENTERPRISE_BOUNDARY: 34, attributes: 35, SYSTEM_BOUNDARY: 36, BOUNDARY: 37, CONTAINER_BOUNDARY: 38, NODE: 39, NODE_L: 40, NODE_R: 41, RBRACE: 42, diagramStatement: 43, PERSON: 44, PERSON_EXT: 45, SYSTEM: 46, SYSTEM_DB: 47, SYSTEM_QUEUE: 48, SYSTEM_EXT: 49, SYSTEM_EXT_DB: 50, SYSTEM_EXT_QUEUE: 51, CONTAINER: 52, CONTAINER_DB: 53, CONTAINER_QUEUE: 54, CONTAINER_EXT: 55, CONTAINER_EXT_DB: 56, CONTAINER_EXT_QUEUE: 57, COMPONENT: 58, COMPONENT_DB: 59, COMPONENT_QUEUE: 60, COMPONENT_EXT: 61, COMPONENT_EXT_DB: 62, COMPONENT_EXT_QUEUE: 63, REL: 64, BIREL: 65, REL_U: 66, REL_D: 67, REL_L: 68, REL_R: 69, REL_B: 70, REL_INDEX: 71, UPDATE_EL_STYLE: 72, UPDATE_REL_STYLE: 73, UPDATE_LAYOUT_CONFIG: 74, attribute: 75, STR: 76, STR_KEY: 77, STR_VALUE: 78, ATTRIBUTE: 79, ATTRIBUTE_EMPTY: 80, $accept: 0, $end: 1 },
12
+ terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" },
13
+ productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]],
14
+ performAction: /* @__PURE__ */ d(function(m, x, E, _, D, o, Ot) {
15
+ var f = o.length - 1;
16
+ switch (D) {
17
+ case 3:
18
+ _.setDirection("TB");
19
+ break;
20
+ case 4:
21
+ _.setDirection("BT");
22
+ break;
23
+ case 5:
24
+ _.setDirection("RL");
25
+ break;
26
+ case 6:
27
+ _.setDirection("LR");
28
+ break;
29
+ case 8:
30
+ case 9:
31
+ case 10:
32
+ case 11:
33
+ case 12:
34
+ _.setC4Type(o[f - 3]);
35
+ break;
36
+ case 19:
37
+ _.setTitle(o[f].substring(6)), this.$ = o[f].substring(6);
38
+ break;
39
+ case 20:
40
+ _.setAccDescription(o[f].substring(15)), this.$ = o[f].substring(15);
41
+ break;
42
+ case 21:
43
+ this.$ = o[f].trim(), _.setTitle(this.$);
44
+ break;
45
+ case 22:
46
+ case 23:
47
+ this.$ = o[f].trim(), _.setAccDescription(this.$);
48
+ break;
49
+ case 28:
50
+ o[f].splice(2, 0, "ENTERPRISE"), _.addPersonOrSystemBoundary(...o[f]), this.$ = o[f];
51
+ break;
52
+ case 29:
53
+ o[f].splice(2, 0, "SYSTEM"), _.addPersonOrSystemBoundary(...o[f]), this.$ = o[f];
54
+ break;
55
+ case 30:
56
+ _.addPersonOrSystemBoundary(...o[f]), this.$ = o[f];
57
+ break;
58
+ case 31:
59
+ o[f].splice(2, 0, "CONTAINER"), _.addContainerBoundary(...o[f]), this.$ = o[f];
60
+ break;
61
+ case 32:
62
+ _.addDeploymentNode("node", ...o[f]), this.$ = o[f];
63
+ break;
64
+ case 33:
65
+ _.addDeploymentNode("nodeL", ...o[f]), this.$ = o[f];
66
+ break;
67
+ case 34:
68
+ _.addDeploymentNode("nodeR", ...o[f]), this.$ = o[f];
69
+ break;
70
+ case 35:
71
+ _.popBoundaryParseStack();
72
+ break;
73
+ case 39:
74
+ _.addPersonOrSystem("person", ...o[f]), this.$ = o[f];
75
+ break;
76
+ case 40:
77
+ _.addPersonOrSystem("external_person", ...o[f]), this.$ = o[f];
78
+ break;
79
+ case 41:
80
+ _.addPersonOrSystem("system", ...o[f]), this.$ = o[f];
81
+ break;
82
+ case 42:
83
+ _.addPersonOrSystem("system_db", ...o[f]), this.$ = o[f];
84
+ break;
85
+ case 43:
86
+ _.addPersonOrSystem("system_queue", ...o[f]), this.$ = o[f];
87
+ break;
88
+ case 44:
89
+ _.addPersonOrSystem("external_system", ...o[f]), this.$ = o[f];
90
+ break;
91
+ case 45:
92
+ _.addPersonOrSystem("external_system_db", ...o[f]), this.$ = o[f];
93
+ break;
94
+ case 46:
95
+ _.addPersonOrSystem("external_system_queue", ...o[f]), this.$ = o[f];
96
+ break;
97
+ case 47:
98
+ _.addContainer("container", ...o[f]), this.$ = o[f];
99
+ break;
100
+ case 48:
101
+ _.addContainer("container_db", ...o[f]), this.$ = o[f];
102
+ break;
103
+ case 49:
104
+ _.addContainer("container_queue", ...o[f]), this.$ = o[f];
105
+ break;
106
+ case 50:
107
+ _.addContainer("external_container", ...o[f]), this.$ = o[f];
108
+ break;
109
+ case 51:
110
+ _.addContainer("external_container_db", ...o[f]), this.$ = o[f];
111
+ break;
112
+ case 52:
113
+ _.addContainer("external_container_queue", ...o[f]), this.$ = o[f];
114
+ break;
115
+ case 53:
116
+ _.addComponent("component", ...o[f]), this.$ = o[f];
117
+ break;
118
+ case 54:
119
+ _.addComponent("component_db", ...o[f]), this.$ = o[f];
120
+ break;
121
+ case 55:
122
+ _.addComponent("component_queue", ...o[f]), this.$ = o[f];
123
+ break;
124
+ case 56:
125
+ _.addComponent("external_component", ...o[f]), this.$ = o[f];
126
+ break;
127
+ case 57:
128
+ _.addComponent("external_component_db", ...o[f]), this.$ = o[f];
129
+ break;
130
+ case 58:
131
+ _.addComponent("external_component_queue", ...o[f]), this.$ = o[f];
132
+ break;
133
+ case 60:
134
+ _.addRel("rel", ...o[f]), this.$ = o[f];
135
+ break;
136
+ case 61:
137
+ _.addRel("birel", ...o[f]), this.$ = o[f];
138
+ break;
139
+ case 62:
140
+ _.addRel("rel_u", ...o[f]), this.$ = o[f];
141
+ break;
142
+ case 63:
143
+ _.addRel("rel_d", ...o[f]), this.$ = o[f];
144
+ break;
145
+ case 64:
146
+ _.addRel("rel_l", ...o[f]), this.$ = o[f];
147
+ break;
148
+ case 65:
149
+ _.addRel("rel_r", ...o[f]), this.$ = o[f];
150
+ break;
151
+ case 66:
152
+ _.addRel("rel_b", ...o[f]), this.$ = o[f];
153
+ break;
154
+ case 67:
155
+ o[f].splice(0, 1), _.addRel("rel", ...o[f]), this.$ = o[f];
156
+ break;
157
+ case 68:
158
+ _.updateElStyle("update_el_style", ...o[f]), this.$ = o[f];
159
+ break;
160
+ case 69:
161
+ _.updateRelStyle("update_rel_style", ...o[f]), this.$ = o[f];
162
+ break;
163
+ case 70:
164
+ _.updateLayoutConfig("update_layout_config", ...o[f]), this.$ = o[f];
165
+ break;
166
+ case 71:
167
+ this.$ = [o[f]];
168
+ break;
169
+ case 72:
170
+ o[f].unshift(o[f - 1]), this.$ = o[f];
171
+ break;
172
+ case 73:
173
+ case 75:
174
+ this.$ = o[f].trim();
175
+ break;
176
+ case 74:
177
+ let vt = {};
178
+ vt[o[f - 1].trim()] = o[f].trim(), this.$ = vt;
179
+ break;
180
+ case 76:
181
+ this.$ = "";
182
+ break;
183
+ }
184
+ }, "anonymous"),
185
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: r, 26: u, 28: i, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: r, 26: u, 28: i, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: r, 26: u, 28: i, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: r, 26: u, 28: i, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: r, 26: u, 28: i, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 14: [1, 74] }, t(kt, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }), t(kt, [2, 14]), t(zt, [2, 16], { 12: [1, 76] }), t(kt, [2, 36], { 12: [1, 77] }), t(wt, [2, 19]), t(wt, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, t(wt, [2, 23]), { 35: 80, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 86, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 87, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 88, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 89, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 90, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 91, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 92, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 93, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 94, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 95, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 96, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 97, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 98, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 99, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 100, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 101, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 102, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 103, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 104, 75: 81, 76: S, 77: T, 79: k, 80: C }, t(R, [2, 59]), { 35: 105, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 106, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 107, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 108, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 109, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 110, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 111, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 112, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 113, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 114, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 115, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 120, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 121, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 122, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 123, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 124, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 125, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, t(kt, [2, 15]), t(zt, [2, 17], { 21: 22, 19: 130, 22: e, 23: a, 24: r, 26: u, 28: i }), t(kt, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: e, 23: a, 24: r, 26: u, 28: i, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }), t(wt, [2, 21]), t(wt, [2, 22]), t(R, [2, 39]), t(re, [2, 71], { 75: 81, 35: 132, 76: S, 77: T, 79: k, 80: C }), t(It, [2, 73]), { 78: [1, 133] }, t(It, [2, 75]), t(It, [2, 76]), t(R, [2, 40]), t(R, [2, 41]), t(R, [2, 42]), t(R, [2, 43]), t(R, [2, 44]), t(R, [2, 45]), t(R, [2, 46]), t(R, [2, 47]), t(R, [2, 48]), t(R, [2, 49]), t(R, [2, 50]), t(R, [2, 51]), t(R, [2, 52]), t(R, [2, 53]), t(R, [2, 54]), t(R, [2, 55]), t(R, [2, 56]), t(R, [2, 57]), t(R, [2, 58]), t(R, [2, 60]), t(R, [2, 61]), t(R, [2, 62]), t(R, [2, 63]), t(R, [2, 64]), t(R, [2, 65]), t(R, [2, 66]), t(R, [2, 67]), t(R, [2, 68]), t(R, [2, 69]), t(R, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, t(xt, [2, 28]), t(xt, [2, 29]), t(xt, [2, 30]), t(xt, [2, 31]), t(xt, [2, 32]), t(xt, [2, 33]), t(xt, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, t(zt, [2, 18]), t(kt, [2, 38]), t(re, [2, 72]), t(It, [2, 74]), t(R, [2, 24]), t(R, [2, 35]), t(Wt, [2, 25]), t(Wt, [2, 26], { 12: [1, 138] }), t(Wt, [2, 27])],
186
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
187
+ parseError: /* @__PURE__ */ d(function(m, x) {
188
+ if (x.recoverable)
189
+ this.trace(m);
190
+ else {
191
+ var E = new Error(m);
192
+ throw E.hash = x, E;
193
+ }
194
+ }, "parseError"),
195
+ parse: /* @__PURE__ */ d(function(m) {
196
+ var x = this, E = [0], _ = [], D = [null], o = [], Ot = this.table, f = "", vt = 0, ie = 0, Oe = 2, oe = 1, Pe = o.slice.call(arguments, 1), A = Object.create(this.lexer), Et = { yy: {} };
197
+ for (var qt in this.yy)
198
+ Object.prototype.hasOwnProperty.call(this.yy, qt) && (Et.yy[qt] = this.yy[qt]);
199
+ A.setInput(m, Et.yy), Et.yy.lexer = A, Et.yy.parser = this, typeof A.yylloc > "u" && (A.yylloc = {});
200
+ var Ht = A.yylloc;
201
+ o.push(Ht);
202
+ var De = A.options && A.options.ranges;
203
+ typeof Et.yy.parseError == "function" ? this.parseError = Et.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
204
+ function Ne(B) {
205
+ E.length = E.length - 2 * B, D.length = D.length - B, o.length = o.length - B;
206
+ }
207
+ d(Ne, "popStack");
208
+ function le() {
209
+ var B;
210
+ return B = _.pop() || A.lex() || oe, typeof B != "number" && (B instanceof Array && (_ = B, B = _.pop()), B = x.symbols_[B] || B), B;
211
+ }
212
+ d(le, "lex");
213
+ for (var M, St, V, Qt, Ct = {}, Bt, z, ce, Vt; ; ) {
214
+ if (St = E[E.length - 1], this.defaultActions[St] ? V = this.defaultActions[St] : ((M === null || typeof M > "u") && (M = le()), V = Ot[St] && Ot[St][M]), typeof V > "u" || !V.length || !V[0]) {
215
+ var Kt = "";
216
+ Vt = [];
217
+ for (Bt in Ot[St])
218
+ this.terminals_[Bt] && Bt > Oe && Vt.push("'" + this.terminals_[Bt] + "'");
219
+ A.showPosition ? Kt = "Parse error on line " + (vt + 1) + `:
220
+ ` + A.showPosition() + `
221
+ Expecting ` + Vt.join(", ") + ", got '" + (this.terminals_[M] || M) + "'" : Kt = "Parse error on line " + (vt + 1) + ": Unexpected " + (M == oe ? "end of input" : "'" + (this.terminals_[M] || M) + "'"), this.parseError(Kt, {
222
+ text: A.match,
223
+ token: this.terminals_[M] || M,
224
+ line: A.yylineno,
225
+ loc: Ht,
226
+ expected: Vt
227
+ });
228
+ }
229
+ if (V[0] instanceof Array && V.length > 1)
230
+ throw new Error("Parse Error: multiple actions possible at state: " + St + ", token: " + M);
231
+ switch (V[0]) {
232
+ case 1:
233
+ E.push(M), D.push(A.yytext), o.push(A.yylloc), E.push(V[1]), M = null, ie = A.yyleng, f = A.yytext, vt = A.yylineno, Ht = A.yylloc;
234
+ break;
235
+ case 2:
236
+ if (z = this.productions_[V[1]][1], Ct.$ = D[D.length - z], Ct._$ = {
237
+ first_line: o[o.length - (z || 1)].first_line,
238
+ last_line: o[o.length - 1].last_line,
239
+ first_column: o[o.length - (z || 1)].first_column,
240
+ last_column: o[o.length - 1].last_column
241
+ }, De && (Ct._$.range = [
242
+ o[o.length - (z || 1)].range[0],
243
+ o[o.length - 1].range[1]
244
+ ]), Qt = this.performAction.apply(Ct, [
245
+ f,
246
+ ie,
247
+ vt,
248
+ Et.yy,
249
+ V[1],
250
+ D,
251
+ o
252
+ ].concat(Pe)), typeof Qt < "u")
253
+ return Qt;
254
+ z && (E = E.slice(0, -1 * z * 2), D = D.slice(0, -1 * z), o = o.slice(0, -1 * z)), E.push(this.productions_[V[1]][0]), D.push(Ct.$), o.push(Ct._$), ce = Ot[E[E.length - 2]][E[E.length - 1]], E.push(ce);
255
+ break;
256
+ case 3:
257
+ return !0;
258
+ }
259
+ }
260
+ return !0;
261
+ }, "parse")
262
+ }, we = /* @__PURE__ */ (function() {
263
+ var _t = {
264
+ EOF: 1,
265
+ parseError: /* @__PURE__ */ d(function(x, E) {
266
+ if (this.yy.parser)
267
+ this.yy.parser.parseError(x, E);
268
+ else
269
+ throw new Error(x);
270
+ }, "parseError"),
271
+ // resets the lexer, sets new input
272
+ setInput: /* @__PURE__ */ d(function(m, x) {
273
+ return this.yy = x || this.yy || {}, this._input = m, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
274
+ first_line: 1,
275
+ first_column: 0,
276
+ last_line: 1,
277
+ last_column: 0
278
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
279
+ }, "setInput"),
280
+ // consumes and returns one char from the input
281
+ input: /* @__PURE__ */ d(function() {
282
+ var m = this._input[0];
283
+ this.yytext += m, this.yyleng++, this.offset++, this.match += m, this.matched += m;
284
+ var x = m.match(/(?:\r\n?|\n).*/g);
285
+ return x ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), m;
286
+ }, "input"),
287
+ // unshifts one char (or a string) into the input
288
+ unput: /* @__PURE__ */ d(function(m) {
289
+ var x = m.length, E = m.split(/(?:\r\n?|\n)/g);
290
+ this._input = m + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - x), this.offset -= x;
291
+ var _ = this.match.split(/(?:\r\n?|\n)/g);
292
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), E.length - 1 && (this.yylineno -= E.length - 1);
293
+ var D = this.yylloc.range;
294
+ return this.yylloc = {
295
+ first_line: this.yylloc.first_line,
296
+ last_line: this.yylineno + 1,
297
+ first_column: this.yylloc.first_column,
298
+ last_column: E ? (E.length === _.length ? this.yylloc.first_column : 0) + _[_.length - E.length].length - E[0].length : this.yylloc.first_column - x
299
+ }, this.options.ranges && (this.yylloc.range = [D[0], D[0] + this.yyleng - x]), this.yyleng = this.yytext.length, this;
300
+ }, "unput"),
301
+ // When called from action, caches matched text and appends it on next action
302
+ more: /* @__PURE__ */ d(function() {
303
+ return this._more = !0, this;
304
+ }, "more"),
305
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
306
+ reject: /* @__PURE__ */ d(function() {
307
+ if (this.options.backtrack_lexer)
308
+ this._backtrack = !0;
309
+ else
310
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
311
+ ` + this.showPosition(), {
312
+ text: "",
313
+ token: null,
314
+ line: this.yylineno
315
+ });
316
+ return this;
317
+ }, "reject"),
318
+ // retain first n characters of the match
319
+ less: /* @__PURE__ */ d(function(m) {
320
+ this.unput(this.match.slice(m));
321
+ }, "less"),
322
+ // displays already matched input, i.e. for error messages
323
+ pastInput: /* @__PURE__ */ d(function() {
324
+ var m = this.matched.substr(0, this.matched.length - this.match.length);
325
+ return (m.length > 20 ? "..." : "") + m.substr(-20).replace(/\n/g, "");
326
+ }, "pastInput"),
327
+ // displays upcoming input, i.e. for error messages
328
+ upcomingInput: /* @__PURE__ */ d(function() {
329
+ var m = this.match;
330
+ return m.length < 20 && (m += this._input.substr(0, 20 - m.length)), (m.substr(0, 20) + (m.length > 20 ? "..." : "")).replace(/\n/g, "");
331
+ }, "upcomingInput"),
332
+ // displays the character position where the lexing error occurred, i.e. for error messages
333
+ showPosition: /* @__PURE__ */ d(function() {
334
+ var m = this.pastInput(), x = new Array(m.length + 1).join("-");
335
+ return m + this.upcomingInput() + `
336
+ ` + x + "^";
337
+ }, "showPosition"),
338
+ // test the lexed token: return FALSE when not a match, otherwise return token
339
+ test_match: /* @__PURE__ */ d(function(m, x) {
340
+ var E, _, D;
341
+ if (this.options.backtrack_lexer && (D = {
342
+ yylineno: this.yylineno,
343
+ yylloc: {
344
+ first_line: this.yylloc.first_line,
345
+ last_line: this.last_line,
346
+ first_column: this.yylloc.first_column,
347
+ last_column: this.yylloc.last_column
348
+ },
349
+ yytext: this.yytext,
350
+ match: this.match,
351
+ matches: this.matches,
352
+ matched: this.matched,
353
+ yyleng: this.yyleng,
354
+ offset: this.offset,
355
+ _more: this._more,
356
+ _input: this._input,
357
+ yy: this.yy,
358
+ conditionStack: this.conditionStack.slice(0),
359
+ done: this.done
360
+ }, this.options.ranges && (D.yylloc.range = this.yylloc.range.slice(0))), _ = m[0].match(/(?:\r\n?|\n).*/g), _ && (this.yylineno += _.length), this.yylloc = {
361
+ first_line: this.yylloc.last_line,
362
+ last_line: this.yylineno + 1,
363
+ first_column: this.yylloc.last_column,
364
+ last_column: _ ? _[_.length - 1].length - _[_.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + m[0].length
365
+ }, this.yytext += m[0], this.match += m[0], this.matches = m, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(m[0].length), this.matched += m[0], E = this.performAction.call(this, this.yy, this, x, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), E)
366
+ return E;
367
+ if (this._backtrack) {
368
+ for (var o in D)
369
+ this[o] = D[o];
370
+ return !1;
371
+ }
372
+ return !1;
373
+ }, "test_match"),
374
+ // return next match in input
375
+ next: /* @__PURE__ */ d(function() {
376
+ if (this.done)
377
+ return this.EOF;
378
+ this._input || (this.done = !0);
379
+ var m, x, E, _;
380
+ this._more || (this.yytext = "", this.match = "");
381
+ for (var D = this._currentRules(), o = 0; o < D.length; o++)
382
+ if (E = this._input.match(this.rules[D[o]]), E && (!x || E[0].length > x[0].length)) {
383
+ if (x = E, _ = o, this.options.backtrack_lexer) {
384
+ if (m = this.test_match(E, D[o]), m !== !1)
385
+ return m;
386
+ if (this._backtrack) {
387
+ x = !1;
388
+ continue;
389
+ } else
390
+ return !1;
391
+ } else if (!this.options.flex)
392
+ break;
393
+ }
394
+ return x ? (m = this.test_match(x, D[_]), m !== !1 ? m : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
395
+ ` + this.showPosition(), {
396
+ text: "",
397
+ token: null,
398
+ line: this.yylineno
399
+ });
400
+ }, "next"),
401
+ // return next match that has a token
402
+ lex: /* @__PURE__ */ d(function() {
403
+ var x = this.next();
404
+ return x || this.lex();
405
+ }, "lex"),
406
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
407
+ begin: /* @__PURE__ */ d(function(x) {
408
+ this.conditionStack.push(x);
409
+ }, "begin"),
410
+ // pop the previously active lexer condition state off the condition stack
411
+ popState: /* @__PURE__ */ d(function() {
412
+ var x = this.conditionStack.length - 1;
413
+ return x > 0 ? this.conditionStack.pop() : this.conditionStack[0];
414
+ }, "popState"),
415
+ // produce the lexer rule set which is active for the currently active lexer condition state
416
+ _currentRules: /* @__PURE__ */ d(function() {
417
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
418
+ }, "_currentRules"),
419
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
420
+ topState: /* @__PURE__ */ d(function(x) {
421
+ return x = this.conditionStack.length - 1 - Math.abs(x || 0), x >= 0 ? this.conditionStack[x] : "INITIAL";
422
+ }, "topState"),
423
+ // alias for begin(condition)
424
+ pushState: /* @__PURE__ */ d(function(x) {
425
+ this.begin(x);
426
+ }, "pushState"),
427
+ // return the number of states currently on the stack
428
+ stateStackSize: /* @__PURE__ */ d(function() {
429
+ return this.conditionStack.length;
430
+ }, "stateStackSize"),
431
+ options: {},
432
+ performAction: /* @__PURE__ */ d(function(x, E, _, D) {
433
+ switch (_) {
434
+ case 0:
435
+ return 6;
436
+ case 1:
437
+ return 7;
438
+ case 2:
439
+ return 8;
440
+ case 3:
441
+ return 9;
442
+ case 4:
443
+ return 22;
444
+ case 5:
445
+ return 23;
446
+ case 6:
447
+ return this.begin("acc_title"), 24;
448
+ case 7:
449
+ return this.popState(), "acc_title_value";
450
+ case 8:
451
+ return this.begin("acc_descr"), 26;
452
+ case 9:
453
+ return this.popState(), "acc_descr_value";
454
+ case 10:
455
+ this.begin("acc_descr_multiline");
456
+ break;
457
+ case 11:
458
+ this.popState();
459
+ break;
460
+ case 12:
461
+ return "acc_descr_multiline_value";
462
+ case 13:
463
+ break;
464
+ case 14:
465
+ c;
466
+ break;
467
+ case 15:
468
+ return 12;
469
+ case 16:
470
+ break;
471
+ case 17:
472
+ return 11;
473
+ case 18:
474
+ return 15;
475
+ case 19:
476
+ return 16;
477
+ case 20:
478
+ return 17;
479
+ case 21:
480
+ return 18;
481
+ case 22:
482
+ return this.begin("person_ext"), 45;
483
+ case 23:
484
+ return this.begin("person"), 44;
485
+ case 24:
486
+ return this.begin("system_ext_queue"), 51;
487
+ case 25:
488
+ return this.begin("system_ext_db"), 50;
489
+ case 26:
490
+ return this.begin("system_ext"), 49;
491
+ case 27:
492
+ return this.begin("system_queue"), 48;
493
+ case 28:
494
+ return this.begin("system_db"), 47;
495
+ case 29:
496
+ return this.begin("system"), 46;
497
+ case 30:
498
+ return this.begin("boundary"), 37;
499
+ case 31:
500
+ return this.begin("enterprise_boundary"), 34;
501
+ case 32:
502
+ return this.begin("system_boundary"), 36;
503
+ case 33:
504
+ return this.begin("container_ext_queue"), 57;
505
+ case 34:
506
+ return this.begin("container_ext_db"), 56;
507
+ case 35:
508
+ return this.begin("container_ext"), 55;
509
+ case 36:
510
+ return this.begin("container_queue"), 54;
511
+ case 37:
512
+ return this.begin("container_db"), 53;
513
+ case 38:
514
+ return this.begin("container"), 52;
515
+ case 39:
516
+ return this.begin("container_boundary"), 38;
517
+ case 40:
518
+ return this.begin("component_ext_queue"), 63;
519
+ case 41:
520
+ return this.begin("component_ext_db"), 62;
521
+ case 42:
522
+ return this.begin("component_ext"), 61;
523
+ case 43:
524
+ return this.begin("component_queue"), 60;
525
+ case 44:
526
+ return this.begin("component_db"), 59;
527
+ case 45:
528
+ return this.begin("component"), 58;
529
+ case 46:
530
+ return this.begin("node"), 39;
531
+ case 47:
532
+ return this.begin("node"), 39;
533
+ case 48:
534
+ return this.begin("node_l"), 40;
535
+ case 49:
536
+ return this.begin("node_r"), 41;
537
+ case 50:
538
+ return this.begin("rel"), 64;
539
+ case 51:
540
+ return this.begin("birel"), 65;
541
+ case 52:
542
+ return this.begin("rel_u"), 66;
543
+ case 53:
544
+ return this.begin("rel_u"), 66;
545
+ case 54:
546
+ return this.begin("rel_d"), 67;
547
+ case 55:
548
+ return this.begin("rel_d"), 67;
549
+ case 56:
550
+ return this.begin("rel_l"), 68;
551
+ case 57:
552
+ return this.begin("rel_l"), 68;
553
+ case 58:
554
+ return this.begin("rel_r"), 69;
555
+ case 59:
556
+ return this.begin("rel_r"), 69;
557
+ case 60:
558
+ return this.begin("rel_b"), 70;
559
+ case 61:
560
+ return this.begin("rel_index"), 71;
561
+ case 62:
562
+ return this.begin("update_el_style"), 72;
563
+ case 63:
564
+ return this.begin("update_rel_style"), 73;
565
+ case 64:
566
+ return this.begin("update_layout_config"), 74;
567
+ case 65:
568
+ return "EOF_IN_STRUCT";
569
+ case 66:
570
+ return this.begin("attribute"), "ATTRIBUTE_EMPTY";
571
+ case 67:
572
+ this.begin("attribute");
573
+ break;
574
+ case 68:
575
+ this.popState(), this.popState();
576
+ break;
577
+ case 69:
578
+ return 80;
579
+ case 70:
580
+ break;
581
+ case 71:
582
+ return 80;
583
+ case 72:
584
+ this.begin("string");
585
+ break;
586
+ case 73:
587
+ this.popState();
588
+ break;
589
+ case 74:
590
+ return "STR";
591
+ case 75:
592
+ this.begin("string_kv");
593
+ break;
594
+ case 76:
595
+ return this.begin("string_kv_key"), "STR_KEY";
596
+ case 77:
597
+ this.popState(), this.begin("string_kv_value");
598
+ break;
599
+ case 78:
600
+ return "STR_VALUE";
601
+ case 79:
602
+ this.popState(), this.popState();
603
+ break;
604
+ case 80:
605
+ return "STR";
606
+ case 81:
607
+ return "LBRACE";
608
+ case 82:
609
+ return "RBRACE";
610
+ case 83:
611
+ return "SPACE";
612
+ case 84:
613
+ return "EOL";
614
+ case 85:
615
+ return 14;
616
+ }
617
+ }, "anonymous"),
618
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/],
619
+ conditions: { acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, acc_descr: { rules: [9], inclusive: !1 }, acc_title: { rules: [7], inclusive: !1 }, string_kv_value: { rules: [78, 79], inclusive: !1 }, string_kv_key: { rules: [77], inclusive: !1 }, string_kv: { rules: [76], inclusive: !1 }, string: { rules: [73, 74], inclusive: !1 }, attribute: { rules: [68, 69, 70, 71, 72, 75, 80], inclusive: !1 }, update_layout_config: { rules: [65, 66, 67, 68], inclusive: !1 }, update_rel_style: { rules: [65, 66, 67, 68], inclusive: !1 }, update_el_style: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_b: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_r: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_l: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_d: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_u: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_bi: { rules: [], inclusive: !1 }, rel: { rules: [65, 66, 67, 68], inclusive: !1 }, node_r: { rules: [65, 66, 67, 68], inclusive: !1 }, node_l: { rules: [65, 66, 67, 68], inclusive: !1 }, node: { rules: [65, 66, 67, 68], inclusive: !1 }, index: { rules: [], inclusive: !1 }, rel_index: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, component_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, component_db: { rules: [65, 66, 67, 68], inclusive: !1 }, component: { rules: [65, 66, 67, 68], inclusive: !1 }, container_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, container_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, container_db: { rules: [65, 66, 67, 68], inclusive: !1 }, container: { rules: [65, 66, 67, 68], inclusive: !1 }, birel: { rules: [65, 66, 67, 68], inclusive: !1 }, system_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, enterprise_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, system_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, system_db: { rules: [65, 66, 67, 68], inclusive: !1 }, system: { rules: [65, 66, 67, 68], inclusive: !1 }, person_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, person: { rules: [65, 66, 67, 68], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], inclusive: !0 } }
620
+ };
621
+ return _t;
622
+ })();
623
+ Xt.lexer = we;
624
+ function Mt() {
625
+ this.yy = {};
626
+ }
627
+ return d(Mt, "Parser"), Mt.prototype = Xt, Xt.Parser = Mt, new Mt();
628
+ })();
629
+ Ft.parser = Ft;
630
+ var ze = Ft, ge = /* @__PURE__ */ d((t) => Rt()[t], "getRequiredConfig"), Y = /* @__PURE__ */ new Set(["label", "descr", "techn", "type"]), Tt = /* @__PURE__ */ d((t, e) => {
631
+ for (const [a, r] of Object.entries(e))
632
+ if (r !== void 0)
633
+ if (typeof r == "object") {
634
+ const [u, i] = Object.entries(r)[0];
635
+ t[u] = Y.has(u) ? { text: i } : i;
636
+ } else
637
+ t[a] = r;
638
+ }, "assignAttributes"), me = /* @__PURE__ */ d(() => ({
639
+ alias: "global",
640
+ label: { text: "global" },
641
+ type: { text: "global" },
642
+ tags: null,
643
+ link: null,
644
+ parentBoundary: ""
645
+ // The layout fields are populated later by the renderer.
646
+ }), "createGlobalBoundary"), U = [], gt = [""], L = "global", F = "", j = [me()], Lt = [], ne = "", se = !1, Ut = 4, jt = 2, be, We = /* @__PURE__ */ d(function() {
647
+ return be;
648
+ }, "getC4Type"), Xe = /* @__PURE__ */ d(function(t) {
649
+ be = _e(t, Rt());
650
+ }, "setC4Type"), qe = /* @__PURE__ */ d(function(t, e, a, r, u, i, n, l, s) {
651
+ if (t == null || e === void 0 || e === null || a === void 0 || a === null || r === void 0 || r === null)
652
+ return;
653
+ let h = {};
654
+ const y = Lt.find((p) => p.from === e && p.to === a);
655
+ if (y ? h = y : Lt.push(h), h.type = t, h.from = e, h.to = a, h.label = { text: r }, u == null)
656
+ h.techn ??= { text: "" };
657
+ else if (typeof u == "object") {
658
+ const [p, g] = Object.entries(u)[0];
659
+ h[p] = Y.has(p) ? { text: g } : g;
660
+ } else
661
+ h.techn = { text: u };
662
+ if (i == null)
663
+ h.descr ??= { text: "" };
664
+ else if (typeof i == "object") {
665
+ const [p, g] = Object.entries(i)[0];
666
+ h[p] = Y.has(p) ? { text: g } : g;
667
+ } else
668
+ h.descr = { text: i };
669
+ Tt(h, { sprite: n, tags: l, link: s }), h.wrap = bt();
670
+ }, "addRel"), He = /* @__PURE__ */ d(function(t, e, a, r, u, i, n) {
671
+ if (e === null || a === null)
672
+ return;
673
+ let l = {};
674
+ const s = U.find((h) => h.alias === e);
675
+ if (s && e === s.alias ? l = s : (l.alias = e, U.push(l)), a == null ? l.label = { text: "" } : l.label = { text: a }, r == null)
676
+ l.descr ??= { text: "" };
677
+ else if (typeof r == "object") {
678
+ const [h, y] = Object.entries(r)[0];
679
+ l[h] = Y.has(h) ? { text: y } : y;
680
+ } else
681
+ l.descr = { text: r };
682
+ Tt(l, { sprite: u, tags: i, link: n }), l.typeC4Shape = { text: t }, l.parentBoundary = L, l.wrap = bt();
683
+ }, "addPersonOrSystem"), Qe = /* @__PURE__ */ d(function(t, e, a, r, u, i, n, l) {
684
+ if (e === null || a === null)
685
+ return;
686
+ let s = {};
687
+ const h = U.find((y) => y.alias === e);
688
+ if (h && e === h.alias ? s = h : (s.alias = e, U.push(s)), a == null ? s.label = { text: "" } : s.label = { text: a }, r == null)
689
+ s.techn ??= { text: "" };
690
+ else if (typeof r == "object") {
691
+ const [y, p] = Object.entries(r)[0];
692
+ s[y] = Y.has(y) ? { text: p } : p;
693
+ } else
694
+ s.techn = { text: r };
695
+ if (u == null)
696
+ s.descr ??= { text: "" };
697
+ else if (typeof u == "object") {
698
+ const [y, p] = Object.entries(u)[0];
699
+ s[y] = Y.has(y) ? { text: p } : p;
700
+ } else
701
+ s.descr = { text: u };
702
+ Tt(s, { sprite: i, tags: n, link: l }), s.wrap = bt(), s.typeC4Shape = { text: t }, s.parentBoundary = L;
703
+ }, "addContainer"), Ke = /* @__PURE__ */ d(function(t, e, a, r, u, i, n, l) {
704
+ if (e === null || a === null)
705
+ return;
706
+ let s = {};
707
+ const h = U.find((y) => y.alias === e);
708
+ if (h && e === h.alias ? s = h : (s.alias = e, U.push(s)), a == null ? s.label = { text: "" } : s.label = { text: a }, r == null)
709
+ s.techn ??= { text: "" };
710
+ else if (typeof r == "object") {
711
+ const [y, p] = Object.entries(r)[0];
712
+ s[y] = Y.has(y) ? { text: p } : p;
713
+ } else
714
+ s.techn = { text: r };
715
+ if (u == null)
716
+ s.descr ??= { text: "" };
717
+ else if (typeof u == "object") {
718
+ const [y, p] = Object.entries(u)[0];
719
+ s[y] = Y.has(y) ? { text: p } : p;
720
+ } else
721
+ s.descr = { text: u };
722
+ Tt(s, { sprite: i, tags: n, link: l }), s.wrap = bt(), s.typeC4Shape = { text: t }, s.parentBoundary = L;
723
+ }, "addComponent"), Ge = /* @__PURE__ */ d(function(t, e, a, r, u) {
724
+ if (t === null || e === null)
725
+ return;
726
+ let i = {};
727
+ const n = j.find((l) => l.alias === t);
728
+ if (n && t === n.alias ? i = n : (i.alias = t, j.push(i)), e == null ? i.label = { text: "" } : i.label = { text: e }, a == null)
729
+ i.type = { text: "system" };
730
+ else if (typeof a == "object") {
731
+ const [l, s] = Object.entries(a)[0];
732
+ i[l] = Y.has(l) ? { text: s } : s;
733
+ } else
734
+ i.type = { text: a };
735
+ Tt(i, { tags: r, link: u }), i.parentBoundary = L, i.wrap = bt(), F = L, L = t, gt.push(F);
736
+ }, "addPersonOrSystemBoundary"), Je = /* @__PURE__ */ d(function(t, e, a, r, u) {
737
+ if (t === null || e === null)
738
+ return;
739
+ let i = {};
740
+ const n = j.find((l) => l.alias === t);
741
+ if (n && t === n.alias ? i = n : (i.alias = t, j.push(i)), e == null ? i.label = { text: "" } : i.label = { text: e }, a == null)
742
+ i.type = { text: "container" };
743
+ else if (typeof a == "object") {
744
+ const [l, s] = Object.entries(a)[0];
745
+ i[l] = Y.has(l) ? { text: s } : s;
746
+ } else
747
+ i.type = { text: a };
748
+ Tt(i, { tags: r, link: u }), i.parentBoundary = L, i.wrap = bt(), F = L, L = t, gt.push(F);
749
+ }, "addContainerBoundary"), Ze = /* @__PURE__ */ d(function(t, e, a, r, u, i, n, l) {
750
+ if (e === null || a === null)
751
+ return;
752
+ let s = {};
753
+ const h = j.find((y) => y.alias === e);
754
+ if (h && e === h.alias ? s = h : (s.alias = e, j.push(s)), a == null ? s.label = { text: "" } : s.label = { text: a }, r == null)
755
+ s.type = { text: "node" };
756
+ else if (typeof r == "object") {
757
+ const [y, p] = Object.entries(r)[0];
758
+ s[y] = Y.has(y) ? { text: p } : p;
759
+ } else
760
+ s.type = { text: r };
761
+ if (u == null)
762
+ s.descr ??= { text: "" };
763
+ else if (typeof u == "object") {
764
+ const [y, p] = Object.entries(u)[0];
765
+ s[y] = Y.has(y) ? { text: p } : p;
766
+ } else
767
+ s.descr = { text: u };
768
+ Tt(s, { tags: n, link: l }), s.nodeType = t, s.parentBoundary = L, s.wrap = bt(), F = L, L = e, gt.push(F);
769
+ }, "addDeploymentNode"), $e = /* @__PURE__ */ d(function() {
770
+ L = F, gt.pop(), F = gt.pop(), gt.push(F);
771
+ }, "popBoundaryParseStack"), t0 = /* @__PURE__ */ d(function(t, e, a, r, u, i, n, l, s, h, y) {
772
+ let p = U.find(
773
+ (g) => g.alias === e
774
+ );
775
+ if (!(p === void 0 && (p = j.find((g) => g.alias === e), p === void 0))) {
776
+ if (a != null)
777
+ if (typeof a == "object") {
778
+ const [g, v] = Object.entries(a)[0];
779
+ p[g] = v;
780
+ } else
781
+ p.bgColor = a;
782
+ if (r != null)
783
+ if (typeof r == "object") {
784
+ const [g, v] = Object.entries(r)[0];
785
+ p[g] = v;
786
+ } else
787
+ p.fontColor = r;
788
+ if (u != null)
789
+ if (typeof u == "object") {
790
+ const [g, v] = Object.entries(u)[0];
791
+ p[g] = v;
792
+ } else
793
+ p.borderColor = u;
794
+ if (i != null)
795
+ if (typeof i == "object") {
796
+ const [g, v] = Object.entries(i)[0];
797
+ p[g] = v;
798
+ } else
799
+ p.shadowing = i;
800
+ if (n != null)
801
+ if (typeof n == "object") {
802
+ const [g, v] = Object.entries(n)[0];
803
+ p[g] = v;
804
+ } else
805
+ p.shape = n;
806
+ if (l != null)
807
+ if (typeof l == "object") {
808
+ const [g, v] = Object.entries(l)[0];
809
+ p[g] = v;
810
+ } else
811
+ p.sprite = l;
812
+ if (s != null)
813
+ if (typeof s == "object") {
814
+ const [g, v] = Object.entries(s)[0];
815
+ p[g] = v;
816
+ } else
817
+ p.techn = s;
818
+ if (h != null)
819
+ if (typeof h == "object") {
820
+ const [g, v] = Object.entries(h)[0];
821
+ p[g] = v;
822
+ } else
823
+ p.legendText = h;
824
+ if (y != null)
825
+ if (typeof y == "object") {
826
+ const [g, v] = Object.entries(y)[0];
827
+ p[g] = v;
828
+ } else
829
+ p.legendSprite = y;
830
+ }
831
+ }, "updateElStyle"), e0 = /* @__PURE__ */ d(function(t, e, a, r, u, i, n) {
832
+ const l = Lt.find((s) => s.from === e && s.to === a);
833
+ if (l !== void 0) {
834
+ if (r != null)
835
+ if (typeof r == "object") {
836
+ const [s, h] = Object.entries(r)[0];
837
+ l[s] = h;
838
+ } else
839
+ l.textColor = r;
840
+ if (u != null)
841
+ if (typeof u == "object") {
842
+ const [s, h] = Object.entries(u)[0];
843
+ l[s] = h;
844
+ } else
845
+ l.lineColor = u;
846
+ if (i != null)
847
+ if (typeof i == "object") {
848
+ const [s, h] = Object.entries(i)[0];
849
+ l[s] = parseInt(h);
850
+ } else
851
+ l.offsetX = parseInt(i);
852
+ if (n != null)
853
+ if (typeof n == "object") {
854
+ const [s, h] = Object.entries(n)[0];
855
+ l[s] = parseInt(h);
856
+ } else
857
+ l.offsetY = parseInt(n);
858
+ }
859
+ }, "updateRelStyle"), n0 = /* @__PURE__ */ d(function(t, e, a) {
860
+ let r = Ut, u = jt;
861
+ if (typeof e == "object") {
862
+ const i = Object.values(e)[0];
863
+ r = parseInt(i);
864
+ } else
865
+ r = parseInt(e);
866
+ if (typeof a == "object") {
867
+ const i = Object.values(a)[0];
868
+ u = parseInt(i);
869
+ } else
870
+ u = parseInt(a);
871
+ r >= 1 && (Ut = r), u >= 1 && (jt = u);
872
+ }, "updateLayoutConfig"), s0 = /* @__PURE__ */ d(function() {
873
+ return Ut;
874
+ }, "getC4ShapeInRow"), a0 = /* @__PURE__ */ d(function() {
875
+ return jt;
876
+ }, "getC4BoundaryInRow"), r0 = /* @__PURE__ */ d(function() {
877
+ return L;
878
+ }, "getCurrentBoundaryParse"), i0 = /* @__PURE__ */ d(function() {
879
+ return F;
880
+ }, "getParentBoundaryParse"), xe = /* @__PURE__ */ d(function(t) {
881
+ return t == null ? U : U.filter((e) => e.parentBoundary === t);
882
+ }, "getC4ShapeArray"), o0 = /* @__PURE__ */ d(function(t) {
883
+ return U.find((e) => e.alias === t) ?? j.find((e) => e.alias === t);
884
+ }, "getC4Shape"), l0 = /* @__PURE__ */ d(function(t) {
885
+ return Object.keys(xe(t));
886
+ }, "getC4ShapeKeys"), ve = /* @__PURE__ */ d(function(t) {
887
+ return t == null ? j : j.filter((e) => e.parentBoundary === t);
888
+ }, "getBoundaries"), c0 = ve, u0 = /* @__PURE__ */ d(function() {
889
+ return Lt;
890
+ }, "getRels"), h0 = /* @__PURE__ */ d(function() {
891
+ return ne;
892
+ }, "getTitle"), d0 = /* @__PURE__ */ d(function(t) {
893
+ se = t;
894
+ }, "setWrap"), bt = /* @__PURE__ */ d(function() {
895
+ return se;
896
+ }, "autoWrap"), p0 = /* @__PURE__ */ d(function() {
897
+ U = [], j = [me()], F = "", L = "global", gt = [""], Lt = [], gt = [""], ne = "", se = !1, Ut = 4, jt = 2;
898
+ }, "clear"), f0 = {
899
+ SOLID: 0,
900
+ DOTTED: 1,
901
+ NOTE: 2,
902
+ SOLID_CROSS: 3,
903
+ DOTTED_CROSS: 4,
904
+ SOLID_OPEN: 5,
905
+ DOTTED_OPEN: 6,
906
+ LOOP_START: 10,
907
+ LOOP_END: 11,
908
+ ALT_START: 12,
909
+ ALT_ELSE: 13,
910
+ ALT_END: 14,
911
+ OPT_START: 15,
912
+ OPT_END: 16,
913
+ ACTIVE_START: 17,
914
+ ACTIVE_END: 18,
915
+ PAR_START: 19,
916
+ PAR_AND: 20,
917
+ PAR_END: 21,
918
+ RECT_START: 22,
919
+ RECT_END: 23,
920
+ SOLID_POINT: 24,
921
+ DOTTED_POINT: 25
922
+ }, y0 = {
923
+ FILLED: 0,
924
+ OPEN: 1
925
+ }, _0 = {
926
+ LEFTOF: 0,
927
+ RIGHTOF: 1,
928
+ OVER: 2
929
+ }, g0 = /* @__PURE__ */ d(function(t) {
930
+ ne = _e(t, Rt());
931
+ }, "setTitle"), $t = {
932
+ addPersonOrSystem: He,
933
+ addPersonOrSystemBoundary: Ge,
934
+ addContainer: Qe,
935
+ addContainerBoundary: Je,
936
+ addComponent: Ke,
937
+ addDeploymentNode: Ze,
938
+ popBoundaryParseStack: $e,
939
+ addRel: qe,
940
+ updateElStyle: t0,
941
+ updateRelStyle: e0,
942
+ updateLayoutConfig: n0,
943
+ autoWrap: bt,
944
+ setWrap: d0,
945
+ getC4ShapeArray: xe,
946
+ getC4Shape: o0,
947
+ getC4ShapeKeys: l0,
948
+ getBoundaries: ve,
949
+ getBoundarys: c0,
950
+ getCurrentBoundaryParse: r0,
951
+ getParentBoundaryParse: i0,
952
+ getRels: u0,
953
+ getTitle: h0,
954
+ getC4Type: We,
955
+ getC4ShapeInRow: s0,
956
+ getC4BoundaryInRow: a0,
957
+ setAccTitle: Be,
958
+ getAccTitle: Me,
959
+ getAccDescription: Ie,
960
+ setAccDescription: Le,
961
+ getConfig: /* @__PURE__ */ d(() => ge("c4"), "getConfig"),
962
+ clear: p0,
963
+ LINETYPE: f0,
964
+ ARROWTYPE: y0,
965
+ PLACEMENT: _0,
966
+ setTitle: g0,
967
+ setC4Type: Xe
968
+ // apply,
969
+ }, Ee = /* @__PURE__ */ d(function(t, e) {
970
+ return Ae(t, e);
971
+ }, "drawRect"), m0 = /* @__PURE__ */ d((t, e, a, r) => {
972
+ const u = t.append("g");
973
+ let i = 0;
974
+ for (const n of e) {
975
+ const l = n.textColor ? n.textColor : "#444444", s = n.lineColor ? n.lineColor : "#444444", h = n.offsetX ? parseInt(String(n.offsetX)) : 0, y = n.offsetY ? parseInt(String(n.offsetY)) : 0, p = "";
976
+ if (i === 0) {
977
+ const w = u.append("line");
978
+ w.attr("x1", n.startPoint.x), w.attr("y1", n.startPoint.y), w.attr("x2", n.endPoint.x), w.attr("y2", n.endPoint.y), w.attr("stroke-width", "1"), w.attr("stroke", s), w.style("fill", "none"), n.type !== "rel_b" && w.attr("marker-end", "url(" + p + "#" + r + "-arrowhead)"), (n.type === "birel" || n.type === "rel_b") && w.attr("marker-start", "url(" + p + "#" + r + "-arrowend)"), i = -1;
979
+ } else {
980
+ const w = u.append("path");
981
+ w.attr("fill", "none").attr("stroke-width", "1").attr("stroke", s).attr(
982
+ "d",
983
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", n.startPoint.x).replaceAll("starty", n.startPoint.y).replaceAll(
984
+ "controlx",
985
+ n.startPoint.x + (n.endPoint.x - n.startPoint.x) / 2 - (n.endPoint.x - n.startPoint.x) / 4
986
+ ).replaceAll(
987
+ "controly",
988
+ n.startPoint.y + (n.endPoint.y - n.startPoint.y) / 2
989
+ ).replaceAll("stopx", n.endPoint.x).replaceAll("stopy", n.endPoint.y)
990
+ ), n.type !== "rel_b" && w.attr("marker-end", "url(" + p + "#" + r + "-arrowhead)"), (n.type === "birel" || n.type === "rel_b") && w.attr("marker-start", "url(" + p + "#" + r + "-arrowend)");
991
+ }
992
+ const g = n.label.width;
993
+ let v = a.messageFont();
994
+ Dt(a)(
995
+ n.label.text,
996
+ u,
997
+ Math.min(n.startPoint.x, n.endPoint.x) + Math.abs(n.endPoint.x - n.startPoint.x) / 2 + h,
998
+ Math.min(n.startPoint.y, n.endPoint.y) + Math.abs(n.endPoint.y - n.startPoint.y) / 2 + y,
999
+ g,
1000
+ n.label.height,
1001
+ { fill: l },
1002
+ v
1003
+ ), n.techn && n.techn.text !== "" && (v = a.messageFont(), Dt(a)(
1004
+ "[" + n.techn.text + "]",
1005
+ u,
1006
+ Math.min(n.startPoint.x, n.endPoint.x) + Math.abs(n.endPoint.x - n.startPoint.x) / 2 + h,
1007
+ Math.min(n.startPoint.y, n.endPoint.y) + Math.abs(n.endPoint.y - n.startPoint.y) / 2 + a.messageFontSize + 5 + y,
1008
+ Math.max(g, n.techn.width),
1009
+ n.techn.height,
1010
+ { fill: l, "font-style": "italic" },
1011
+ v
1012
+ ));
1013
+ }
1014
+ }, "drawRels"), b0 = /* @__PURE__ */ d(function(t, e, a) {
1015
+ const r = t.append("g"), u = e.bgColor ? e.bgColor : "none", i = e.borderColor ? e.borderColor : "#444444", n = e.fontColor ? e.fontColor : "black";
1016
+ let l = {
1017
+ "stroke-width": 1,
1018
+ "stroke-dasharray": "7.0,7.0"
1019
+ };
1020
+ e.nodeType && (l = { "stroke-width": 1 });
1021
+ const s = {
1022
+ x: e.x,
1023
+ y: e.y,
1024
+ fill: u,
1025
+ stroke: i,
1026
+ width: e.width,
1027
+ height: e.height,
1028
+ rx: 2.5,
1029
+ ry: 2.5,
1030
+ attrs: l
1031
+ };
1032
+ Ee(r, s);
1033
+ let h = a.boundaryFont();
1034
+ h.fontWeight = "bold", h.fontSize = h.fontSize + 2, h.fontColor = n, Dt(a)(
1035
+ e.label.text,
1036
+ r,
1037
+ e.x,
1038
+ e.y + e.label.Y,
1039
+ e.width,
1040
+ e.height,
1041
+ { fill: "#444444" },
1042
+ h
1043
+ ), e.type && e.type.text !== "" && (h = a.boundaryFont(), h.fontColor = n, Dt(a)(
1044
+ e.type.text,
1045
+ r,
1046
+ e.x,
1047
+ e.y + e.type.Y,
1048
+ e.width,
1049
+ e.height,
1050
+ { fill: "#444444" },
1051
+ h
1052
+ )), e.descr && e.descr.text !== "" && (h = a.boundaryFont(), h.fontSize = h.fontSize - 2, h.fontColor = n, Dt(a)(
1053
+ e.descr.text,
1054
+ r,
1055
+ e.x,
1056
+ e.y + e.descr.Y,
1057
+ e.width,
1058
+ e.height,
1059
+ { fill: "#444444" },
1060
+ h
1061
+ ));
1062
+ }, "drawBoundary"), x0 = /* @__PURE__ */ d(function(t, e) {
1063
+ t.append("defs").append("symbol").attr("id", e + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1064
+ "d",
1065
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1066
+ );
1067
+ }, "insertDatabaseIcon"), v0 = /* @__PURE__ */ d(function(t, e) {
1068
+ t.append("defs").append("symbol").attr("id", e + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1069
+ "d",
1070
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1071
+ );
1072
+ }, "insertComputerIcon"), E0 = /* @__PURE__ */ d(function(t, e) {
1073
+ t.append("defs").append("symbol").attr("id", e + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1074
+ "d",
1075
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1076
+ );
1077
+ }, "insertClockIcon"), S0 = /* @__PURE__ */ d(function(t, e) {
1078
+ t.append("defs").append("marker").attr("id", e + "-arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
1079
+ }, "insertArrowHead"), T0 = /* @__PURE__ */ d(function(t, e) {
1080
+ t.append("defs").append("marker").attr("id", e + "-arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");
1081
+ }, "insertArrowEnd"), k0 = /* @__PURE__ */ d(function(t, e) {
1082
+ t.append("defs").append("marker").attr("id", e + "-filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1083
+ }, "insertArrowFilledHead"), C0 = /* @__PURE__ */ d(function(t, e) {
1084
+ const r = t.append("defs").append("marker").attr("id", e + "-crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
1085
+ r.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z"), r.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");
1086
+ }, "insertArrowCrossHead"), Dt = /* @__PURE__ */ (function() {
1087
+ function t(u, i, n, l, s, h, y) {
1088
+ const p = i.append("text").attr("x", n + s / 2).attr("y", l + h / 2 + 5).style("text-anchor", "middle").text(u);
1089
+ r(p, y);
1090
+ }
1091
+ d(t, "byText");
1092
+ function e(u, i, n, l, s, h, y, p) {
1093
+ const { fontSize: g, fontFamily: v, fontWeight: w } = p, N = u.split(Zt.lineBreakRegex);
1094
+ for (let O = 0; O < N.length; O++) {
1095
+ const P = O * g - g * (N.length - 1) / 2, I = i.append("text").attr("x", n + s / 2).attr("y", l).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", g).style("font-weight", w).style("font-family", v);
1096
+ I.append("tspan").attr("dy", P).text(N[O]).attr("alignment-baseline", "mathematical"), r(I, y);
1097
+ }
1098
+ }
1099
+ d(e, "byTspan");
1100
+ function a(u, i, n, l, s, h, y, p) {
1101
+ const g = i.append("switch"), w = g.append("foreignObject").attr("x", n).attr("y", l).attr("width", s).attr("height", h).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1102
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(u), e(u, g, n, l, s, h, y, p), r(w, y);
1103
+ }
1104
+ d(a, "byFo");
1105
+ function r(u, i) {
1106
+ for (const n in i)
1107
+ i.hasOwnProperty(n) && u.attr(n, i[n]);
1108
+ }
1109
+ return d(r, "_setTextAttrs"), function(u) {
1110
+ return u.textPlacement === "fo" ? a : u.textPlacement === "old" ? t : e;
1111
+ };
1112
+ })(), W = {
1113
+ drawRect: Ee,
1114
+ drawBoundary: b0,
1115
+ drawRels: m0,
1116
+ insertArrowHead: S0,
1117
+ insertArrowEnd: T0,
1118
+ insertArrowFilledHead: k0,
1119
+ insertArrowCrossHead: C0,
1120
+ insertDatabaseIcon: x0,
1121
+ insertComputerIcon: v0,
1122
+ insertClockIcon: E0
1123
+ }, R0 = /* @__PURE__ */ d((t, e) => {
1124
+ if (e === "sandbox") {
1125
+ const r = Gt("#i" + t).node()?.contentDocument;
1126
+ if (!r)
1127
+ throw new Error(`Sandbox iframe #i${t} is missing its content document`);
1128
+ return { root: Gt(r.body), doc: r };
1129
+ }
1130
+ return { root: Gt("body"), doc: document };
1131
+ }, "getDiagramRoot"), w0 = /* @__PURE__ */ new Set([
1132
+ "system_queue",
1133
+ "external_system_queue",
1134
+ "container_queue",
1135
+ "external_container_queue",
1136
+ "component_queue",
1137
+ "external_component_queue"
1138
+ ]), O0 = /* @__PURE__ */ new Set([
1139
+ "system_db",
1140
+ "external_system_db",
1141
+ "container_db",
1142
+ "external_container_db",
1143
+ "component_db",
1144
+ "external_component_db"
1145
+ ]), P0 = {
1146
+ person: "person",
1147
+ box: "rounded",
1148
+ rounded: "rounded",
1149
+ cylinder: "cylinder",
1150
+ database: "cylinder",
1151
+ db: "cylinder",
1152
+ queue: "h-cyl",
1153
+ pipe: "h-cyl",
1154
+ component: "fr-rect"
1155
+ }, Jt = /* @__PURE__ */ d((t) => t ? P0[t.toLowerCase()] : void 0, "keywordShape"), D0 = /* @__PURE__ */ d((t) => {
1156
+ const e = Jt(t.shape) ?? Jt(t.sprite);
1157
+ if (e)
1158
+ return e;
1159
+ if (t.tags)
1160
+ for (const r of t.tags.split(",")) {
1161
+ const u = Jt(r.trim());
1162
+ if (u)
1163
+ return u;
1164
+ }
1165
+ const a = t.typeC4Shape.text;
1166
+ return a === "person" || a === "external_person" ? "person" : O0.has(a) ? "cylinder" : w0.has(a) ? "h-cyl" : "rounded";
1167
+ }, "resolveNodeShape"), N0 = {
1168
+ person: "Person",
1169
+ system: "Software System",
1170
+ container: "Container",
1171
+ component: "Component"
1172
+ }, A0 = /* @__PURE__ */ d((t) => {
1173
+ const e = t.replace(/^external_/, "").replace(/_(db|queue)$/, "");
1174
+ return N0[e] ?? e.replace(/_/g, " ");
1175
+ }, "stereotypeLabel"), L0 = /* @__PURE__ */ d((t) => t.startsWith("external_"), "isExternal"), I0 = /* @__PURE__ */ d((t) => {
1176
+ const e = A0(t.typeC4Shape.text);
1177
+ return t.techn?.text ? `[${e}: ${t.techn.text}]` : `[${e}]`;
1178
+ }, "stereotypeText"), Se = [
1179
+ "person",
1180
+ "system",
1181
+ "system_db",
1182
+ "system_queue",
1183
+ "container",
1184
+ "container_db",
1185
+ "container_queue",
1186
+ "component",
1187
+ "component_db",
1188
+ "component_queue"
1189
+ ].flatMap((t) => [t, `external_${t}`]), M0 = new Set(Se), de = /* @__PURE__ */ d((t) => M0.has(t), "isC4ElementType"), B0 = /* @__PURE__ */ d((t, e) => {
1190
+ const a = t.typeC4Shape.text, r = t.bgColor ?? (de(a) && e[`${a}_bg_color`]), u = t.borderColor ?? (de(a) && e[`${a}_border_color`]), i = [];
1191
+ return r && i.push(`fill:${r}`), u && i.push(`stroke:${u}`), i.push(`color:${t.fontColor ?? "#FFFFFF"}`), i;
1192
+ }, "elementCssStyles"), pe = /* @__PURE__ */ d((t, e, a, r, u) => {
1193
+ const i = t.typeC4Shape.text, n = ["c4-shape", `c4-${i}`];
1194
+ L0(i) && n.push("c4-external");
1195
+ const l = D0(t), s = B0(t, e);
1196
+ return (l === "rounded" || l === "fr-rect") && s.push("rx:12px", "ry:12px"), {
1197
+ id: t.alias,
1198
+ label: t.label.text,
1199
+ stereotype: I0(t),
1200
+ description: t.descr?.text ? [t.descr.text] : void 0,
1201
+ labelType: "string",
1202
+ isGroup: !1,
1203
+ shape: l,
1204
+ cssClasses: n.join(" "),
1205
+ cssStyles: s,
1206
+ padding: a,
1207
+ look: r,
1208
+ useHtmlLabels: !1,
1209
+ width: u
1210
+ };
1211
+ }, "buildC4Node"), Nt = 0, At = 0, Te = 4, te = 2;
1212
+ Ft.yy = $t;
1213
+ var b = {}, ke = class {
1214
+ static {
1215
+ d(this, "Bounds");
1216
+ }
1217
+ constructor(t) {
1218
+ this.name = "", this.data = {}, this.data.startx = void 0, this.data.stopx = void 0, this.data.starty = void 0, this.data.stopy = void 0, this.data.widthLimit = void 0, this.nextData = {}, this.nextData.startx = void 0, this.nextData.stopx = void 0, this.nextData.starty = void 0, this.nextData.stopy = void 0, this.nextData.cnt = 0, ee(t.db.getConfig());
1219
+ }
1220
+ setData(t, e, a, r) {
1221
+ this.nextData.startx = this.data.startx = t, this.nextData.stopx = this.data.stopx = e, this.nextData.starty = this.data.starty = a, this.nextData.stopy = this.data.stopy = r;
1222
+ }
1223
+ updateVal(t, e, a, r) {
1224
+ t[e] === void 0 ? t[e] = a : t[e] = r(a, t[e]);
1225
+ }
1226
+ insert(t) {
1227
+ this.nextData.cnt = this.nextData.cnt + 1;
1228
+ const e = this.nextData.stopx, a = this.data.widthLimit;
1229
+ let r = this.nextData.startx === this.nextData.stopx ? e + t.margin : e + t.margin * 2, u = r + t.width, i = this.nextData.starty + t.margin * 2, n = i + t.height;
1230
+ (r >= a || u >= a || this.nextData.cnt > Te) && (r = this.nextData.startx + t.margin + b.nextLinePaddingX, i = this.nextData.stopy + t.margin * 2, this.nextData.stopx = u = r + t.width, this.nextData.starty = this.nextData.stopy, this.nextData.stopy = n = i + t.height, this.nextData.cnt = 1), t.x = r, t.y = i, this.updateVal(this.data, "startx", r, Math.min), this.updateVal(this.data, "starty", i, Math.min), this.updateVal(this.data, "stopx", u, Math.max), this.updateVal(this.data, "stopy", n, Math.max), this.updateVal(this.nextData, "startx", r, Math.min), this.updateVal(this.nextData, "starty", i, Math.min), this.updateVal(this.nextData, "stopx", u, Math.max), this.updateVal(this.nextData, "stopy", n, Math.max);
1231
+ }
1232
+ init(t) {
1233
+ this.name = "", this.data = {
1234
+ startx: void 0,
1235
+ stopx: void 0,
1236
+ starty: void 0,
1237
+ stopy: void 0,
1238
+ widthLimit: void 0
1239
+ }, this.nextData = {
1240
+ startx: void 0,
1241
+ stopx: void 0,
1242
+ starty: void 0,
1243
+ stopy: void 0,
1244
+ cnt: 0
1245
+ }, ee(t.db.getConfig());
1246
+ }
1247
+ bumpLastMargin(t) {
1248
+ this.data.stopx += t, this.data.stopy += t;
1249
+ }
1250
+ }, ee = /* @__PURE__ */ d(function(t) {
1251
+ Ye(b, t), t?.fontFamily && (b.personFontFamily = b.systemFontFamily = b.messageFontFamily = t.fontFamily), t?.fontSize && (b.personFontSize = b.systemFontSize = b.messageFontSize = t.fontSize), t?.fontWeight && (b.personFontWeight = b.systemFontWeight = b.messageFontWeight = t.fontWeight);
1252
+ }, "setConf"), Yt = /* @__PURE__ */ d((t) => ({
1253
+ fontFamily: t.boundaryFontFamily,
1254
+ fontSize: t.boundaryFontSize,
1255
+ fontWeight: t.boundaryFontWeight
1256
+ }), "boundaryFont"), V0 = /* @__PURE__ */ d((t) => ({
1257
+ fontFamily: t.messageFontFamily,
1258
+ fontSize: t.messageFontSize,
1259
+ fontWeight: t.messageFontWeight
1260
+ }), "messageFont");
1261
+ function mt(t, e, a, r, u) {
1262
+ const i = e[t];
1263
+ if (!i.width)
1264
+ if (a)
1265
+ i.text = je(
1266
+ i.text,
1267
+ u,
1268
+ r
1269
+ ), i.textLines = i.text.split(Zt.lineBreakRegex).length, i.width = u, i.height = he(i.text, r);
1270
+ else {
1271
+ const n = i.text.split(Zt.lineBreakRegex);
1272
+ i.textLines = n.length;
1273
+ let l = 0;
1274
+ i.height = 0, i.width = 0;
1275
+ for (const s of n)
1276
+ i.width = Math.max(
1277
+ Pt(s, r),
1278
+ i.width
1279
+ ), l = he(s, r), i.height = i.height + l;
1280
+ }
1281
+ return i;
1282
+ }
1283
+ d(mt, "calcC4ShapeTextWH");
1284
+ var Ce = /* @__PURE__ */ d(function(t, e, a) {
1285
+ const r = a.data.startx, u = a.data.starty;
1286
+ e.x = r, e.y = u, e.width = a.data.stopx - r, e.height = a.data.stopy - u, e.intersect = (s) => Fe.rect(
1287
+ {
1288
+ x: e.x + e.width / 2,
1289
+ y: e.y + e.height / 2,
1290
+ width: e.width,
1291
+ height: e.height
1292
+ },
1293
+ s
1294
+ ), e.label.y = b.c4ShapeMargin - 35;
1295
+ const i = e.wrap && b.wrap, n = Yt(b);
1296
+ n.fontSize = n.fontSize + 2, n.fontWeight = "bold";
1297
+ const l = Pt(
1298
+ e.label.text,
1299
+ n
1300
+ );
1301
+ mt("label", e, i, n, l), W.drawBoundary(t, e, b);
1302
+ }, "drawBoundary"), Re = /* @__PURE__ */ d(async function(t, e, a, r) {
1303
+ const u = Rt(), i = u.look ?? "classic", n = { config: u }, l = e.attr("id") ?? "", s = r.map((y) => a[Number(y)]), h = /* @__PURE__ */ d((y) => {
1304
+ const p = y.shape ? Ue[y.shape] : void 0;
1305
+ if (!p)
1306
+ throw new Error(`C4: no shape handler for "${y.shape}"`);
1307
+ return p;
1308
+ }, "shapeHandlerFor");
1309
+ await Promise.all(
1310
+ s.map(async (y) => {
1311
+ const p = pe(y, b, b.c4ShapePadding, i, b.width);
1312
+ p.domId = `${l}-${p.id}`;
1313
+ const g = await h(p)(e, p, n);
1314
+ y.width = p.width ?? b.width, y.height = p.height ?? b.height, y.margin = b.c4ShapeMargin, g.remove();
1315
+ })
1316
+ );
1317
+ for (const y of s)
1318
+ t.insert(y);
1319
+ await Promise.all(
1320
+ s.map(async (y) => {
1321
+ const p = pe(y, b, b.c4ShapePadding, i, b.width);
1322
+ p.domId = `${l}-${p.id}`, p.x = y.x + y.width / 2, p.y = y.y + y.height / 2;
1323
+ const g = e.append("g").attr(
1324
+ "transform",
1325
+ `translate(${y.x + y.width / 2}, ${y.y + y.height / 2})`
1326
+ );
1327
+ await h(p)(g, p, n), y.intersect = p.intersect;
1328
+ })
1329
+ ), t.bumpLastMargin(b.c4ShapeMargin);
1330
+ }, "drawC4ShapeArray"), Y0 = class {
1331
+ static {
1332
+ d(this, "Point");
1333
+ }
1334
+ constructor(t, e) {
1335
+ this.x = t, this.y = e;
1336
+ }
1337
+ }, fe = /* @__PURE__ */ d(function(t, e) {
1338
+ if (!t.intersect)
1339
+ throw new Error(
1340
+ `C4 element "${t.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`
1341
+ );
1342
+ const { x: a, y: r } = t.intersect(e);
1343
+ return new Y0(a, r);
1344
+ }, "getIntersectPoint"), F0 = /* @__PURE__ */ d(function(t, e) {
1345
+ const a = { x: 0, y: 0 };
1346
+ a.x = e.x + e.width / 2, a.y = e.y + e.height / 2;
1347
+ const r = fe(t, a);
1348
+ a.x = t.x + t.width / 2, a.y = t.y + t.height / 2;
1349
+ const u = fe(e, a);
1350
+ return { startPoint: r, endPoint: u };
1351
+ }, "getIntersectPoints"), U0 = /* @__PURE__ */ d(function(t, e, a, r, u) {
1352
+ const i = r.db.getC4Type();
1353
+ let n = 0;
1354
+ for (const l of e) {
1355
+ n = n + 1;
1356
+ const s = l.wrap && b.wrap, h = V0(b);
1357
+ i === "C4Dynamic" && (l.label.text = n + ": " + l.label.text);
1358
+ let y = Pt(l.label.text, h);
1359
+ mt("label", l, s, h, y), l.techn && l.techn.text !== "" && (y = Pt(l.techn.text, h), mt("techn", l, s, h, y)), l.descr && l.descr.text !== "" && (y = Pt(l.descr.text, h), mt("descr", l, s, h, y));
1360
+ const p = a(l.from), g = a(l.to);
1361
+ if (!p || !g)
1362
+ throw new Error(
1363
+ `C4 rel "${l.from}" -> "${l.to}" references an unknown shape or boundary`
1364
+ );
1365
+ const v = F0(p, g);
1366
+ if (!v.startPoint || !v.endPoint)
1367
+ throw new Error(
1368
+ `Could not calculate intersection points for rel "${l.from}" -> "${l.to}"`
1369
+ );
1370
+ l.startPoint = v.startPoint, l.endPoint = v.endPoint;
1371
+ }
1372
+ W.drawRels(t, e, b, u);
1373
+ }, "drawRels");
1374
+ async function ae(t, e, a, r, u) {
1375
+ const i = u.db, n = new ke(u);
1376
+ n.data.widthLimit = a.data.widthLimit / Math.min(te, r.length);
1377
+ for (const [l, s] of r.entries()) {
1378
+ let h = 0;
1379
+ s.image = { width: 0, height: 0, Y: 0 }, s.sprite && (s.image.width = 48, s.image.height = 48, s.image.Y = h, h = s.image.Y + s.image.height);
1380
+ const y = s.wrap && b.wrap, p = Yt(b);
1381
+ p.fontSize = p.fontSize + 2, p.fontWeight = "bold";
1382
+ const g = mt(
1383
+ "label",
1384
+ s,
1385
+ y,
1386
+ p,
1387
+ n.data.widthLimit
1388
+ );
1389
+ if (g.Y = h + 8, h = g.Y + g.height, s.type && s.type.text !== "") {
1390
+ s.type.text = "[" + s.type.text + "]";
1391
+ const O = Yt(b), P = mt(
1392
+ "type",
1393
+ s,
1394
+ y,
1395
+ O,
1396
+ n.data.widthLimit
1397
+ );
1398
+ P.Y = h + 5, h = P.Y + P.height;
1399
+ }
1400
+ if (s.descr && s.descr.text !== "") {
1401
+ const O = Yt(b);
1402
+ O.fontSize = O.fontSize - 2;
1403
+ const P = mt(
1404
+ "descr",
1405
+ s,
1406
+ y,
1407
+ O,
1408
+ n.data.widthLimit
1409
+ );
1410
+ P.Y = h + 20, h = P.Y + P.height;
1411
+ }
1412
+ if (l == 0 || l % te === 0) {
1413
+ const O = a.data.startx + b.diagramMarginX, P = a.data.stopy + b.diagramMarginY + h;
1414
+ n.setData(O, O, P, P);
1415
+ } else {
1416
+ const O = n.data.stopx !== n.data.startx ? n.data.stopx + b.diagramMarginX : n.data.startx, P = n.data.starty;
1417
+ n.setData(O, O, P, P);
1418
+ }
1419
+ n.name = s.alias;
1420
+ const v = i.getC4ShapeArray(s.alias), w = i.getC4ShapeKeys(s.alias);
1421
+ w.length > 0 && await Re(
1422
+ n,
1423
+ t,
1424
+ v,
1425
+ w
1426
+ ), e = s.alias;
1427
+ const N = i.getBoundaries(e);
1428
+ N.length > 0 && await ae(
1429
+ t,
1430
+ e,
1431
+ n,
1432
+ N,
1433
+ u
1434
+ ), s.alias !== "global" && Ce(t, s, n), a.data.stopy = Math.max(
1435
+ n.data.stopy + b.c4ShapeMargin,
1436
+ a.data.stopy
1437
+ ), a.data.stopx = Math.max(
1438
+ n.data.stopx + b.c4ShapeMargin,
1439
+ a.data.stopx
1440
+ ), Nt = Math.max(Nt, a.data.stopx), At = Math.max(At, a.data.stopy);
1441
+ }
1442
+ }
1443
+ d(ae, "drawInsideBoundary");
1444
+ var j0 = /* @__PURE__ */ d(async function(t, e, a, r) {
1445
+ b = ge("c4");
1446
+ const u = Rt().securityLevel, { root: i } = R0(e, u), n = r.db;
1447
+ n.setWrap(b.wrap), Te = n.getC4ShapeInRow(), te = n.getC4BoundaryInRow(), ue.debug(`C:${JSON.stringify(b, null, 2)}`);
1448
+ const l = i.select(`[id="${e}"]`);
1449
+ W.insertComputerIcon(l, e), W.insertDatabaseIcon(l, e), W.insertClockIcon(l, e);
1450
+ const s = new ke(r);
1451
+ s.setData(
1452
+ b.diagramMarginX,
1453
+ b.diagramMarginX,
1454
+ b.diagramMarginY,
1455
+ b.diagramMarginY
1456
+ ), s.data.widthLimit = screen.availWidth, Nt = b.diagramMarginX, At = b.diagramMarginY;
1457
+ const h = n.getTitle(), y = n.getBoundaries("");
1458
+ await ae(l, "", s, y, r), W.insertArrowHead(l, e), W.insertArrowEnd(l, e), W.insertArrowCrossHead(l, e), W.insertArrowFilledHead(l, e), U0(l, n.getRels(), n.getC4Shape, r, e), s.data.stopx = Nt, s.data.stopy = At;
1459
+ const p = s.data, g = p.startx, v = p.starty, N = At - v + 2 * b.diagramMarginY, O = Nt - g, P = O + 2 * b.diagramMarginX;
1460
+ h && l.append("text").text(h).attr("x", O / 2 - 4 * b.diagramMarginX).attr("y", v + b.diagramMarginY), Ve(l, N, P, b.useMaxWidth);
1461
+ const I = h ? 60 : 0;
1462
+ l.attr(
1463
+ "viewBox",
1464
+ g - b.diagramMarginX + " -" + (b.diagramMarginY + I) + " " + P + " " + (N + I)
1465
+ ), ue.debug("models:", p);
1466
+ }, "draw"), ye = {
1467
+ drawPersonOrSystemArray: Re,
1468
+ drawBoundary: Ce,
1469
+ setConf: ee,
1470
+ draw: j0
1471
+ }, z0 = /* @__PURE__ */ d(() => {
1472
+ const t = Rt().c4 ?? {}, e = new CSSStyleSheet();
1473
+ for (const a of Se) {
1474
+ const r = e.cssRules[e.insertRule(`.c4-shape.c4-${a} .label {}`, e.cssRules.length)], u = t[`${a}FontFamily`], i = t[`${a}FontSize`], n = t[`${a}FontWeight`];
1475
+ u && r.style.setProperty("font-family", u), i && r.style.setProperty(
1476
+ "font-size",
1477
+ typeof i == "number" ? `${i}px` : i
1478
+ ), n && r.style.setProperty("font-weight", String(n));
1479
+ }
1480
+ return [...e.cssRules].filter((a) => a.style.length > 0).map((a) => ` ${a.cssText}`).join(`
1481
+ `);
1482
+ }, "elementFontStyles"), W0 = /* @__PURE__ */ d((t) => `.person {
1483
+ stroke: ${t.personBorder};
1484
+ fill: ${t.personBkg};
1485
+ }
1486
+ ${z0()}
1487
+
1488
+ /* The element font colour is set inline per element (default white); the
1489
+ label text takes it via currentColor. */
1490
+ .c4-shape .label,
1491
+ .c4-shape .label text {
1492
+ color: inherit;
1493
+ fill: currentColor;
1494
+ }
1495
+ /* Structurizr typography: bold name, smaller stereotype/type and description lines. */
1496
+ .c4-shape .label .c4-name {
1497
+ font-weight: bold;
1498
+ }
1499
+ .c4-shape .label .c4-type {
1500
+ font-size: 0.75em;
1501
+ }
1502
+ .c4-shape .label .c4-descr {
1503
+ font-size: 0.82em;
1504
+ }
1505
+ .c4-shape .basic,
1506
+ .c4-shape rect,
1507
+ .c4-shape path,
1508
+ .c4-shape circle,
1509
+ .c4-shape ellipse,
1510
+ .c4-shape line {
1511
+ stroke-width: 2px;
1512
+ }
1513
+ `, "getStyles"), X0 = W0, Q0 = {
1514
+ parser: ze,
1515
+ db: $t,
1516
+ renderer: ye,
1517
+ styles: X0,
1518
+ init: /* @__PURE__ */ d(({ c4: t, wrap: e }) => {
1519
+ ye.setConf(t), $t.setWrap(e);
1520
+ }, "init")
1521
+ };
1522
+ export {
1523
+ Q0 as diagram
1524
+ };