@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,2972 @@
1
+ import { I as Tr } from "./chunk-2Q5K7J3B-gqtzQ8ux.js";
2
+ import { _ as f, o as pr, c as j, k as Kt, l as nt, S as ze, d as Er, e as ur, m as N, b as Ke, s as fr, q as _r, a as gr, g as xr, t as yr, v as Ir, J as Rr, A as Or, j as Ht, u as Q, T as tt, U as Dt, V as Ue, Z as Lr, L as qt, W as br, X as Ge } from "./mermaid.core-DXv6D2Sm.js";
3
+ import { a as mr, g as ce, b as pt, d as Sr, e as le, f as he } from "./chunk-55XCU76K-DkZUAaqC.js";
4
+ var ie = (function() {
5
+ var e = /* @__PURE__ */ f(function(_t, w, C, D) {
6
+ for (C = C || {}, D = _t.length; D--; C[_t[D]] = w) ;
7
+ return C;
8
+ }, "o"), t = [1, 2], a = [1, 3], r = [1, 4], i = [2, 4], c = [1, 9], s = [1, 11], n = [1, 12], p = [1, 14], d = [1, 15], E = [1, 17], u = [1, 18], _ = [1, 19], L = [1, 25], g = [1, 26], R = [1, 27], h = [1, 28], O = [1, 29], x = [1, 30], m = [1, 31], S = [1, 32], b = [1, 33], P = [1, 34], k = [1, 35], B = [1, 36], V = [1, 37], K = [1, 38], z = [1, 39], X = [1, 40], et = [1, 42], rt = [1, 43], U = [1, 44], ot = [1, 45], at = [1, 46], W = [1, 47], M = [1, 4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 48, 49, 50, 51, 53, 54, 56, 61, 62, 63, 64, 73], Z = [1, 56], Ct = [1, 75], A = [1, 81], v = [1, 82], dt = [1, 83], st = [1, 84], H = [1, 85], mt = [1, 86], Te = [1, 87], pe = [1, 88], Ee = [1, 89], ue = [1, 90], fe = [1, 91], _e = [1, 92], ge = [1, 93], xe = [1, 94], ye = [1, 95], Ie = [1, 96], Re = [1, 97], Oe = [1, 98], Le = [1, 99], be = [1, 100], me = [1, 101], Se = [1, 102], Ae = [1, 103], we = [1, 104], Ne = [1, 105], Pe = [1, 106], ke = [2, 79], De = [2, 78], Nt = [4, 5, 17, 51, 53, 54], Mt = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 51, 53, 54, 56, 61, 62, 63, 64, 73], ve = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 50, 51, 53, 54, 56, 61, 62, 63, 64, 73], Qt = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 49, 51, 53, 54, 56, 61, 62, 63, 64, 73], Ce = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 48, 51, 53, 54, 56, 61, 62, 63, 64, 73], $t = [5, 52], F = [62, 70, 71, 72, 73], Me = [62, 73], lt = [1, 152], jt = {
9
+ trace: /* @__PURE__ */ f(function() {
10
+ }, "trace"),
11
+ yy: {},
12
+ symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, INVALID: 10, box_section: 11, box_line: 12, participant_statement: 13, create: 14, box: 15, restOfLine: 16, end: 17, signal: 18, autonumber: 19, NUM: 20, off: 21, activate: 22, actor: 23, deactivate: 24, note_statement: 25, links_statement: 26, link_statement: 27, properties_statement: 28, details_statement: 29, title: 30, legacy_title: 31, acc_title: 32, acc_title_value: 33, acc_descr: 34, acc_descr_value: 35, acc_descr_multiline_value: 36, loop: 37, rect: 38, opt: 39, alt: 40, else_sections: 41, par: 42, par_sections: 43, par_over: 44, critical: 45, option_sections: 46, break: 47, option: 48, and: 49, else: 50, participant: 51, AS: 52, participant_actor: 53, destroy: 54, actor_with_config: 55, note: 56, placement: 57, text2: 58, over: 59, actor_pair: 60, links: 61, link: 62, properties: 63, details: 64, spaceList: 65, ",": 66, left_of: 67, right_of: 68, signaltype: 69, "+": 70, "-": 71, "()": 72, ACTOR: 73, config_object: 74, CONFIG_START: 75, CONFIG_CONTENT: 76, CONFIG_END: 77, SOLID_OPEN_ARROW: 78, DOTTED_OPEN_ARROW: 79, SOLID_ARROW: 80, SOLID_ARROW_TOP: 81, SOLID_ARROW_BOTTOM: 82, STICK_ARROW_TOP: 83, STICK_ARROW_BOTTOM: 84, SOLID_ARROW_TOP_DOTTED: 85, SOLID_ARROW_BOTTOM_DOTTED: 86, STICK_ARROW_TOP_DOTTED: 87, STICK_ARROW_BOTTOM_DOTTED: 88, SOLID_ARROW_TOP_REVERSE: 89, SOLID_ARROW_BOTTOM_REVERSE: 90, STICK_ARROW_TOP_REVERSE: 91, STICK_ARROW_BOTTOM_REVERSE: 92, SOLID_ARROW_TOP_REVERSE_DOTTED: 93, SOLID_ARROW_BOTTOM_REVERSE_DOTTED: 94, STICK_ARROW_TOP_REVERSE_DOTTED: 95, STICK_ARROW_BOTTOM_REVERSE_DOTTED: 96, BIDIRECTIONAL_SOLID_ARROW: 97, DOTTED_ARROW: 98, BIDIRECTIONAL_DOTTED_ARROW: 99, SOLID_CROSS: 100, DOTTED_CROSS: 101, SOLID_POINT: 102, DOTTED_POINT: 103, TXT: 104, $accept: 0, $end: 1 },
13
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 10: "INVALID", 14: "create", 15: "box", 16: "restOfLine", 17: "end", 19: "autonumber", 20: "NUM", 21: "off", 22: "activate", 24: "deactivate", 30: "title", 31: "legacy_title", 32: "acc_title", 33: "acc_title_value", 34: "acc_descr", 35: "acc_descr_value", 36: "acc_descr_multiline_value", 37: "loop", 38: "rect", 39: "opt", 40: "alt", 42: "par", 44: "par_over", 45: "critical", 47: "break", 48: "option", 49: "and", 50: "else", 51: "participant", 52: "AS", 53: "participant_actor", 54: "destroy", 56: "note", 59: "over", 61: "links", 62: "link", 63: "properties", 64: "details", 66: ",", 67: "left_of", 68: "right_of", 70: "+", 71: "-", 72: "()", 73: "ACTOR", 75: "CONFIG_START", 76: "CONFIG_CONTENT", 77: "CONFIG_END", 78: "SOLID_OPEN_ARROW", 79: "DOTTED_OPEN_ARROW", 80: "SOLID_ARROW", 81: "SOLID_ARROW_TOP", 82: "SOLID_ARROW_BOTTOM", 83: "STICK_ARROW_TOP", 84: "STICK_ARROW_BOTTOM", 85: "SOLID_ARROW_TOP_DOTTED", 86: "SOLID_ARROW_BOTTOM_DOTTED", 87: "STICK_ARROW_TOP_DOTTED", 88: "STICK_ARROW_BOTTOM_DOTTED", 89: "SOLID_ARROW_TOP_REVERSE", 90: "SOLID_ARROW_BOTTOM_REVERSE", 91: "STICK_ARROW_TOP_REVERSE", 92: "STICK_ARROW_BOTTOM_REVERSE", 93: "SOLID_ARROW_TOP_REVERSE_DOTTED", 94: "SOLID_ARROW_BOTTOM_REVERSE_DOTTED", 95: "STICK_ARROW_TOP_REVERSE_DOTTED", 96: "STICK_ARROW_BOTTOM_REVERSE_DOTTED", 97: "BIDIRECTIONAL_SOLID_ARROW", 98: "DOTTED_ARROW", 99: "BIDIRECTIONAL_DOTTED_ARROW", 100: "SOLID_CROSS", 101: "DOTTED_CROSS", 102: "SOLID_POINT", 103: "DOTTED_POINT", 104: "TXT" },
14
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [8, 1], [11, 0], [11, 2], [12, 2], [12, 1], [12, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [46, 1], [46, 4], [43, 1], [43, 4], [41, 1], [41, 4], [13, 5], [13, 3], [13, 5], [13, 3], [13, 3], [13, 5], [13, 3], [13, 5], [13, 3], [25, 4], [25, 4], [26, 3], [27, 3], [28, 3], [29, 3], [65, 2], [65, 1], [60, 3], [60, 1], [57, 1], [57, 1], [18, 5], [18, 5], [18, 5], [18, 5], [18, 6], [18, 4], [55, 2], [74, 3], [23, 1], [23, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [58, 1]],
15
+ performAction: /* @__PURE__ */ f(function(w, C, D, y, G, o, Pt) {
16
+ var T = o.length - 1;
17
+ switch (G) {
18
+ case 3:
19
+ return y.apply(o[T]), o[T];
20
+ case 4:
21
+ case 10:
22
+ this.$ = [];
23
+ break;
24
+ case 5:
25
+ case 11:
26
+ o[T - 1].push(o[T]), this.$ = o[T - 1];
27
+ break;
28
+ case 6:
29
+ case 7:
30
+ case 12:
31
+ case 13:
32
+ this.$ = o[T];
33
+ break;
34
+ case 8:
35
+ case 9:
36
+ case 14:
37
+ this.$ = [];
38
+ break;
39
+ case 16:
40
+ o[T].type = "createParticipant", this.$ = o[T];
41
+ break;
42
+ case 17:
43
+ o[T - 1].unshift({ type: "boxStart", boxData: y.parseBoxData(o[T - 2]) }), o[T - 1].push({ type: "boxEnd", boxText: o[T - 2] }), this.$ = o[T - 1];
44
+ break;
45
+ case 19:
46
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(o[T - 2]), sequenceIndexStep: Number(o[T - 1]), sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
47
+ break;
48
+ case 20:
49
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(o[T - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
50
+ break;
51
+ case 21:
52
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: y.LINETYPE.AUTONUMBER };
53
+ break;
54
+ case 22:
55
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
56
+ break;
57
+ case 23:
58
+ this.$ = { type: "activeStart", signalType: y.LINETYPE.ACTIVE_START, actor: o[T - 1].actor };
59
+ break;
60
+ case 24:
61
+ this.$ = { type: "activeEnd", signalType: y.LINETYPE.ACTIVE_END, actor: o[T - 1].actor };
62
+ break;
63
+ case 30:
64
+ y.setDiagramTitle(o[T].substring(6)), this.$ = o[T].substring(6);
65
+ break;
66
+ case 31:
67
+ y.setDiagramTitle(o[T].substring(7)), this.$ = o[T].substring(7);
68
+ break;
69
+ case 32:
70
+ this.$ = o[T].trim(), y.setAccTitle(this.$);
71
+ break;
72
+ case 33:
73
+ case 34:
74
+ this.$ = o[T].trim(), y.setAccDescription(this.$);
75
+ break;
76
+ case 35:
77
+ o[T - 1].unshift({ type: "loopStart", loopText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.LOOP_START }), o[T - 1].push({ type: "loopEnd", loopText: o[T - 2], signalType: y.LINETYPE.LOOP_END }), this.$ = o[T - 1];
78
+ break;
79
+ case 36:
80
+ o[T - 1].unshift({ type: "rectStart", color: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.RECT_START }), o[T - 1].push({ type: "rectEnd", color: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.RECT_END }), this.$ = o[T - 1];
81
+ break;
82
+ case 37:
83
+ o[T - 1].unshift({ type: "optStart", optText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.OPT_START }), o[T - 1].push({ type: "optEnd", optText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.OPT_END }), this.$ = o[T - 1];
84
+ break;
85
+ case 38:
86
+ o[T - 1].unshift({ type: "altStart", altText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.ALT_START }), o[T - 1].push({ type: "altEnd", signalType: y.LINETYPE.ALT_END }), this.$ = o[T - 1];
87
+ break;
88
+ case 39:
89
+ o[T - 1].unshift({ type: "parStart", parText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.PAR_START }), o[T - 1].push({ type: "parEnd", signalType: y.LINETYPE.PAR_END }), this.$ = o[T - 1];
90
+ break;
91
+ case 40:
92
+ o[T - 1].unshift({ type: "parStart", parText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.PAR_OVER_START }), o[T - 1].push({ type: "parEnd", signalType: y.LINETYPE.PAR_END }), this.$ = o[T - 1];
93
+ break;
94
+ case 41:
95
+ o[T - 1].unshift({ type: "criticalStart", criticalText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.CRITICAL_START }), o[T - 1].push({ type: "criticalEnd", signalType: y.LINETYPE.CRITICAL_END }), this.$ = o[T - 1];
96
+ break;
97
+ case 42:
98
+ o[T - 1].unshift({ type: "breakStart", breakText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.BREAK_START }), o[T - 1].push({ type: "breakEnd", optText: y.parseMessage(o[T - 2]), signalType: y.LINETYPE.BREAK_END }), this.$ = o[T - 1];
99
+ break;
100
+ case 44:
101
+ this.$ = o[T - 3].concat([{ type: "option", optionText: y.parseMessage(o[T - 1]), signalType: y.LINETYPE.CRITICAL_OPTION }, o[T]]);
102
+ break;
103
+ case 46:
104
+ this.$ = o[T - 3].concat([{ type: "and", parText: y.parseMessage(o[T - 1]), signalType: y.LINETYPE.PAR_AND }, o[T]]);
105
+ break;
106
+ case 48:
107
+ this.$ = o[T - 3].concat([{ type: "else", altText: y.parseMessage(o[T - 1]), signalType: y.LINETYPE.ALT_ELSE }, o[T]]);
108
+ break;
109
+ case 49:
110
+ o[T - 3].draw = "participant", o[T - 3].type = "addParticipant", o[T - 3].description = y.parseMessage(o[T - 1]), this.$ = o[T - 3];
111
+ break;
112
+ case 50:
113
+ o[T - 1].draw = "participant", o[T - 1].type = "addParticipant", this.$ = o[T - 1];
114
+ break;
115
+ case 51:
116
+ o[T - 3].draw = "actor", o[T - 3].type = "addParticipant", o[T - 3].description = y.parseMessage(o[T - 1]), this.$ = o[T - 3];
117
+ break;
118
+ case 52:
119
+ case 57:
120
+ o[T - 1].draw = "actor", o[T - 1].type = "addParticipant", this.$ = o[T - 1];
121
+ break;
122
+ case 53:
123
+ o[T - 1].type = "destroyParticipant", this.$ = o[T - 1];
124
+ break;
125
+ case 54:
126
+ o[T - 3].draw = "participant", o[T - 3].type = "addParticipant", o[T - 3].description = y.parseMessage(o[T - 1]), this.$ = o[T - 3];
127
+ break;
128
+ case 55:
129
+ o[T - 1].draw = "participant", o[T - 1].type = "addParticipant", this.$ = o[T - 1];
130
+ break;
131
+ case 56:
132
+ o[T - 3].draw = "actor", o[T - 3].type = "addParticipant", o[T - 3].description = y.parseMessage(o[T - 1]), this.$ = o[T - 3];
133
+ break;
134
+ case 58:
135
+ this.$ = [o[T - 1], { type: "addNote", placement: o[T - 2], actor: o[T - 1].actor, text: o[T] }];
136
+ break;
137
+ case 59:
138
+ o[T - 2] = [].concat(o[T - 1], o[T - 1]).slice(0, 2), o[T - 2][0] = o[T - 2][0].actor, o[T - 2][1] = o[T - 2][1].actor, this.$ = [o[T - 1], { type: "addNote", placement: y.PLACEMENT.OVER, actor: o[T - 2].slice(0, 2), text: o[T] }];
139
+ break;
140
+ case 60:
141
+ this.$ = [o[T - 1], { type: "addLinks", actor: o[T - 1].actor, text: o[T] }];
142
+ break;
143
+ case 61:
144
+ this.$ = [o[T - 1], { type: "addALink", actor: o[T - 1].actor, text: o[T] }];
145
+ break;
146
+ case 62:
147
+ this.$ = [o[T - 1], { type: "addProperties", actor: o[T - 1].actor, text: o[T] }];
148
+ break;
149
+ case 63:
150
+ this.$ = [o[T - 1], { type: "addDetails", actor: o[T - 1].actor, text: o[T] }];
151
+ break;
152
+ case 66:
153
+ this.$ = [o[T - 2], o[T]];
154
+ break;
155
+ case 67:
156
+ this.$ = o[T];
157
+ break;
158
+ case 68:
159
+ this.$ = y.PLACEMENT.LEFTOF;
160
+ break;
161
+ case 69:
162
+ this.$ = y.PLACEMENT.RIGHTOF;
163
+ break;
164
+ case 70:
165
+ this.$ = [
166
+ o[T - 4],
167
+ o[T - 1],
168
+ { type: "addMessage", from: o[T - 4].actor, to: o[T - 1].actor, signalType: o[T - 3], msg: o[T], activate: !0 },
169
+ { type: "activeStart", signalType: y.LINETYPE.ACTIVE_START, actor: o[T - 1].actor }
170
+ ];
171
+ break;
172
+ case 71:
173
+ this.$ = [
174
+ o[T - 4],
175
+ o[T - 1],
176
+ { type: "addMessage", from: o[T - 4].actor, to: o[T - 1].actor, signalType: o[T - 3], msg: o[T] },
177
+ { type: "activeEnd", signalType: y.LINETYPE.ACTIVE_END, actor: o[T - 4].actor }
178
+ ];
179
+ break;
180
+ case 72:
181
+ this.$ = [
182
+ o[T - 4],
183
+ o[T - 1],
184
+ { type: "addMessage", from: o[T - 4].actor, to: o[T - 1].actor, signalType: o[T - 3], msg: o[T], activate: !0, centralConnection: y.LINETYPE.CENTRAL_CONNECTION },
185
+ { type: "centralConnection", signalType: y.LINETYPE.CENTRAL_CONNECTION, actor: o[T - 1].actor }
186
+ ];
187
+ break;
188
+ case 73:
189
+ this.$ = [
190
+ o[T - 4],
191
+ o[T - 1],
192
+ { type: "addMessage", from: o[T - 4].actor, to: o[T - 1].actor, signalType: o[T - 2], msg: o[T], activate: !1, centralConnection: y.LINETYPE.CENTRAL_CONNECTION_REVERSE },
193
+ { type: "centralConnectionReverse", signalType: y.LINETYPE.CENTRAL_CONNECTION_REVERSE, actor: o[T - 4].actor }
194
+ ];
195
+ break;
196
+ case 74:
197
+ this.$ = [
198
+ o[T - 5],
199
+ o[T - 1],
200
+ { type: "addMessage", from: o[T - 5].actor, to: o[T - 1].actor, signalType: o[T - 3], msg: o[T], activate: !0, centralConnection: y.LINETYPE.CENTRAL_CONNECTION_DUAL },
201
+ { type: "centralConnection", signalType: y.LINETYPE.CENTRAL_CONNECTION, actor: o[T - 1].actor },
202
+ { type: "centralConnectionReverse", signalType: y.LINETYPE.CENTRAL_CONNECTION_REVERSE, actor: o[T - 5].actor }
203
+ ];
204
+ break;
205
+ case 75:
206
+ this.$ = [o[T - 3], o[T - 1], { type: "addMessage", from: o[T - 3].actor, to: o[T - 1].actor, signalType: o[T - 2], msg: o[T] }];
207
+ break;
208
+ case 76:
209
+ this.$ = {
210
+ type: "addParticipant",
211
+ actor: o[T - 1],
212
+ config: o[T]
213
+ };
214
+ break;
215
+ case 77:
216
+ this.$ = o[T - 1].trim();
217
+ break;
218
+ case 78:
219
+ case 79:
220
+ this.$ = { type: "addParticipant", actor: o[T] };
221
+ break;
222
+ case 80:
223
+ this.$ = y.LINETYPE.SOLID_OPEN;
224
+ break;
225
+ case 81:
226
+ this.$ = y.LINETYPE.DOTTED_OPEN;
227
+ break;
228
+ case 82:
229
+ this.$ = y.LINETYPE.SOLID;
230
+ break;
231
+ case 83:
232
+ this.$ = y.LINETYPE.SOLID_TOP;
233
+ break;
234
+ case 84:
235
+ this.$ = y.LINETYPE.SOLID_BOTTOM;
236
+ break;
237
+ case 85:
238
+ this.$ = y.LINETYPE.STICK_TOP;
239
+ break;
240
+ case 86:
241
+ this.$ = y.LINETYPE.STICK_BOTTOM;
242
+ break;
243
+ case 87:
244
+ this.$ = y.LINETYPE.SOLID_TOP_DOTTED;
245
+ break;
246
+ case 88:
247
+ this.$ = y.LINETYPE.SOLID_BOTTOM_DOTTED;
248
+ break;
249
+ case 89:
250
+ this.$ = y.LINETYPE.STICK_TOP_DOTTED;
251
+ break;
252
+ case 90:
253
+ this.$ = y.LINETYPE.STICK_BOTTOM_DOTTED;
254
+ break;
255
+ case 91:
256
+ this.$ = y.LINETYPE.SOLID_ARROW_TOP_REVERSE;
257
+ break;
258
+ case 92:
259
+ this.$ = y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;
260
+ break;
261
+ case 93:
262
+ this.$ = y.LINETYPE.STICK_ARROW_TOP_REVERSE;
263
+ break;
264
+ case 94:
265
+ this.$ = y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;
266
+ break;
267
+ case 95:
268
+ this.$ = y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;
269
+ break;
270
+ case 96:
271
+ this.$ = y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;
272
+ break;
273
+ case 97:
274
+ this.$ = y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;
275
+ break;
276
+ case 98:
277
+ this.$ = y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;
278
+ break;
279
+ case 99:
280
+ this.$ = y.LINETYPE.BIDIRECTIONAL_SOLID;
281
+ break;
282
+ case 100:
283
+ this.$ = y.LINETYPE.DOTTED;
284
+ break;
285
+ case 101:
286
+ this.$ = y.LINETYPE.BIDIRECTIONAL_DOTTED;
287
+ break;
288
+ case 102:
289
+ this.$ = y.LINETYPE.SOLID_CROSS;
290
+ break;
291
+ case 103:
292
+ this.$ = y.LINETYPE.DOTTED_CROSS;
293
+ break;
294
+ case 104:
295
+ this.$ = y.LINETYPE.SOLID_POINT;
296
+ break;
297
+ case 105:
298
+ this.$ = y.LINETYPE.DOTTED_POINT;
299
+ break;
300
+ case 106:
301
+ this.$ = y.parseMessage(o[T].trim().substring(1));
302
+ break;
303
+ }
304
+ }, "anonymous"),
305
+ table: [{ 3: 1, 4: t, 5: a, 6: r }, { 1: [3] }, { 3: 5, 4: t, 5: a, 6: r }, { 3: 6, 4: t, 5: a, 6: r }, e([1, 4, 5, 10, 14, 15, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 51, 53, 54, 56, 61, 62, 63, 64, 73], i, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: c, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: p, 15: d, 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, e(M, [2, 5]), { 9: 48, 13: 13, 14: p, 15: d, 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, e(M, [2, 7]), e(M, [2, 8]), e(M, [2, 9]), e(M, [2, 15]), { 13: 49, 51: K, 53: z, 54: X }, { 16: [1, 50] }, { 5: [1, 51] }, { 5: [1, 54], 20: [1, 52], 21: [1, 53] }, { 23: 55, 62: Z, 73: W }, { 23: 57, 62: Z, 73: W }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, { 5: [1, 61] }, { 5: [1, 62] }, e(M, [2, 30]), e(M, [2, 31]), { 33: [1, 63] }, { 35: [1, 64] }, e(M, [2, 34]), { 16: [1, 65] }, { 16: [1, 66] }, { 16: [1, 67] }, { 16: [1, 68] }, { 16: [1, 69] }, { 16: [1, 70] }, { 16: [1, 71] }, { 16: [1, 72] }, { 23: 73, 55: 74, 62: Z, 73: Ct }, { 23: 76, 55: 77, 62: Z, 73: Ct }, { 23: 78, 62: Z, 73: W }, { 69: 79, 72: [1, 80], 78: A, 79: v, 80: dt, 81: st, 82: H, 83: mt, 84: Te, 85: pe, 86: Ee, 87: ue, 88: fe, 89: _e, 90: ge, 91: xe, 92: ye, 93: Ie, 94: Re, 95: Oe, 96: Le, 97: be, 98: me, 99: Se, 100: Ae, 101: we, 102: Ne, 103: Pe }, { 57: 107, 59: [1, 108], 67: [1, 109], 68: [1, 110] }, { 23: 111, 62: Z, 73: W }, e([72, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103], ke, { 23: 112, 62: Z, 73: W }), { 23: 113, 62: Z, 73: W }, { 23: 114, 62: Z, 73: W }, e([5, 66, 72, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104], De), e(M, [2, 6]), e(M, [2, 16]), e(Nt, [2, 10], { 11: 115 }), e(M, [2, 18]), { 5: [1, 117], 20: [1, 116] }, { 5: [1, 118] }, e(M, [2, 22]), { 5: [1, 119] }, e([5, 52, 66, 104], ke), { 5: [1, 120] }, e(M, [2, 25]), e(M, [2, 26]), e(M, [2, 27]), e(M, [2, 28]), e(M, [2, 29]), e(M, [2, 32]), e(M, [2, 33]), e(Mt, i, { 7: 121 }), e(Mt, i, { 7: 122 }), e(Mt, i, { 7: 123 }), e(ve, i, { 41: 124, 7: 125 }), e(Qt, i, { 43: 126, 7: 127 }), e(Qt, i, { 7: 127, 43: 128 }), e(Ce, i, { 46: 129, 7: 130 }), e(Mt, i, { 7: 131 }), { 5: [1, 133], 52: [1, 132] }, { 5: [1, 135], 52: [1, 134] }, e($t, De, { 74: 136, 75: [1, 137] }), { 5: [1, 139], 52: [1, 138] }, { 5: [1, 141], 52: [1, 140] }, { 5: [1, 142] }, { 23: 146, 62: Z, 70: [1, 143], 71: [1, 144], 72: [1, 145], 73: W }, { 69: 147, 78: A, 79: v, 80: dt, 81: st, 82: H, 83: mt, 84: Te, 85: pe, 86: Ee, 87: ue, 88: fe, 89: _e, 90: ge, 91: xe, 92: ye, 93: Ie, 94: Re, 95: Oe, 96: Le, 97: be, 98: me, 99: Se, 100: Ae, 101: we, 102: Ne, 103: Pe }, e(F, [2, 80]), e(F, [2, 81]), e(F, [2, 82]), e(F, [2, 83]), e(F, [2, 84]), e(F, [2, 85]), e(F, [2, 86]), e(F, [2, 87]), e(F, [2, 88]), e(F, [2, 89]), e(F, [2, 90]), e(F, [2, 91]), e(F, [2, 92]), e(F, [2, 93]), e(F, [2, 94]), e(F, [2, 95]), e(F, [2, 96]), e(F, [2, 97]), e(F, [2, 98]), e(F, [2, 99]), e(F, [2, 100]), e(F, [2, 101]), e(F, [2, 102]), e(F, [2, 103]), e(F, [2, 104]), e(F, [2, 105]), { 23: 148, 62: Z, 73: W }, { 23: 150, 60: 149, 62: Z, 73: W }, e(Me, [2, 68]), e(Me, [2, 69]), { 58: 151, 104: lt }, { 58: 153, 104: lt }, { 58: 154, 104: lt }, { 58: 155, 104: lt }, { 4: [1, 158], 5: [1, 160], 12: 157, 13: 159, 17: [1, 156], 51: K, 53: z, 54: X }, { 5: [1, 161] }, e(M, [2, 20]), e(M, [2, 21]), e(M, [2, 23]), e(M, [2, 24]), { 4: c, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: p, 15: d, 17: [1, 162], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 4: c, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: p, 15: d, 17: [1, 163], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 4: c, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: p, 15: d, 17: [1, 164], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 17: [1, 165] }, { 4: c, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: p, 15: d, 17: [2, 47], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 50: [1, 166], 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 17: [1, 167] }, { 4: c, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: p, 15: d, 17: [2, 45], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 49: [1, 168], 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 17: [1, 169] }, { 17: [1, 170] }, { 4: c, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: p, 15: d, 17: [2, 43], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 48: [1, 171], 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 4: c, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: p, 15: d, 17: [1, 172], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: h, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 16: [1, 173] }, e(M, [2, 50]), { 16: [1, 174] }, e(M, [2, 55]), e($t, [2, 76]), { 76: [1, 175] }, { 16: [1, 176] }, e(M, [2, 52]), { 16: [1, 177] }, e(M, [2, 57]), e(M, [2, 53]), { 23: 178, 62: Z, 73: W }, { 23: 179, 62: Z, 73: W }, { 23: 180, 62: Z, 73: W }, { 58: 181, 104: lt }, { 23: 182, 62: Z, 72: [1, 183], 73: W }, { 58: 184, 104: lt }, { 58: 185, 104: lt }, { 66: [1, 186], 104: [2, 67] }, { 5: [2, 60] }, { 5: [2, 106] }, { 5: [2, 61] }, { 5: [2, 62] }, { 5: [2, 63] }, e(M, [2, 17]), e(Nt, [2, 11]), { 13: 187, 51: K, 53: z, 54: X }, e(Nt, [2, 13]), e(Nt, [2, 14]), e(M, [2, 19]), e(M, [2, 35]), e(M, [2, 36]), e(M, [2, 37]), e(M, [2, 38]), { 16: [1, 188] }, e(M, [2, 39]), { 16: [1, 189] }, e(M, [2, 40]), e(M, [2, 41]), { 16: [1, 190] }, e(M, [2, 42]), { 5: [1, 191] }, { 5: [1, 192] }, { 77: [1, 193] }, { 5: [1, 194] }, { 5: [1, 195] }, { 58: 196, 104: lt }, { 58: 197, 104: lt }, { 58: 198, 104: lt }, { 5: [2, 75] }, { 58: 199, 104: lt }, { 23: 200, 62: Z, 73: W }, { 5: [2, 58] }, { 5: [2, 59] }, { 23: 201, 62: Z, 73: W }, e(Nt, [2, 12]), e(ve, i, { 7: 125, 41: 202 }), e(Qt, i, { 7: 127, 43: 203 }), e(Ce, i, { 7: 130, 46: 204 }), e(M, [2, 49]), e(M, [2, 54]), e($t, [2, 77]), e(M, [2, 51]), e(M, [2, 56]), { 5: [2, 70] }, { 5: [2, 71] }, { 5: [2, 72] }, { 5: [2, 73] }, { 58: 205, 104: lt }, { 104: [2, 66] }, { 17: [2, 48] }, { 17: [2, 46] }, { 17: [2, 44] }, { 5: [2, 74] }],
306
+ defaultActions: { 5: [2, 1], 6: [2, 2], 151: [2, 60], 152: [2, 106], 153: [2, 61], 154: [2, 62], 155: [2, 63], 181: [2, 75], 184: [2, 58], 185: [2, 59], 196: [2, 70], 197: [2, 71], 198: [2, 72], 199: [2, 73], 201: [2, 66], 202: [2, 48], 203: [2, 46], 204: [2, 44], 205: [2, 74] },
307
+ parseError: /* @__PURE__ */ f(function(w, C) {
308
+ if (C.recoverable)
309
+ this.trace(w);
310
+ else {
311
+ var D = new Error(w);
312
+ throw D.hash = C, D;
313
+ }
314
+ }, "parseError"),
315
+ parse: /* @__PURE__ */ f(function(w) {
316
+ var C = this, D = [0], y = [], G = [null], o = [], Pt = this.table, T = "", Yt = 0, Be = 0, cr = 2, Ye = 1, lr = o.slice.call(arguments, 1), $ = Object.create(this.lexer), It = { yy: {} };
317
+ for (var te in this.yy)
318
+ Object.prototype.hasOwnProperty.call(this.yy, te) && (It.yy[te] = this.yy[te]);
319
+ $.setInput(w, It.yy), It.yy.lexer = $, It.yy.parser = this, typeof $.yylloc > "u" && ($.yylloc = {});
320
+ var ee = $.yylloc;
321
+ o.push(ee);
322
+ var hr = $.options && $.options.ranges;
323
+ typeof It.yy.parseError == "function" ? this.parseError = It.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
324
+ function dr(ct) {
325
+ D.length = D.length - 2 * ct, G.length = G.length - ct, o.length = o.length - ct;
326
+ }
327
+ f(dr, "popStack");
328
+ function Ve() {
329
+ var ct;
330
+ return ct = y.pop() || $.lex() || Ye, typeof ct != "number" && (ct instanceof Array && (y = ct, ct = y.pop()), ct = C.symbols_[ct] || ct), ct;
331
+ }
332
+ f(Ve, "lex");
333
+ for (var it, Rt, ht, re, St = {}, Vt, Et, We, Wt; ; ) {
334
+ if (Rt = D[D.length - 1], this.defaultActions[Rt] ? ht = this.defaultActions[Rt] : ((it === null || typeof it > "u") && (it = Ve()), ht = Pt[Rt] && Pt[Rt][it]), typeof ht > "u" || !ht.length || !ht[0]) {
335
+ var ae = "";
336
+ Wt = [];
337
+ for (Vt in Pt[Rt])
338
+ this.terminals_[Vt] && Vt > cr && Wt.push("'" + this.terminals_[Vt] + "'");
339
+ $.showPosition ? ae = "Parse error on line " + (Yt + 1) + `:
340
+ ` + $.showPosition() + `
341
+ Expecting ` + Wt.join(", ") + ", got '" + (this.terminals_[it] || it) + "'" : ae = "Parse error on line " + (Yt + 1) + ": Unexpected " + (it == Ye ? "end of input" : "'" + (this.terminals_[it] || it) + "'"), this.parseError(ae, {
342
+ text: $.match,
343
+ token: this.terminals_[it] || it,
344
+ line: $.yylineno,
345
+ loc: ee,
346
+ expected: Wt
347
+ });
348
+ }
349
+ if (ht[0] instanceof Array && ht.length > 1)
350
+ throw new Error("Parse Error: multiple actions possible at state: " + Rt + ", token: " + it);
351
+ switch (ht[0]) {
352
+ case 1:
353
+ D.push(it), G.push($.yytext), o.push($.yylloc), D.push(ht[1]), it = null, Be = $.yyleng, T = $.yytext, Yt = $.yylineno, ee = $.yylloc;
354
+ break;
355
+ case 2:
356
+ if (Et = this.productions_[ht[1]][1], St.$ = G[G.length - Et], St._$ = {
357
+ first_line: o[o.length - (Et || 1)].first_line,
358
+ last_line: o[o.length - 1].last_line,
359
+ first_column: o[o.length - (Et || 1)].first_column,
360
+ last_column: o[o.length - 1].last_column
361
+ }, hr && (St._$.range = [
362
+ o[o.length - (Et || 1)].range[0],
363
+ o[o.length - 1].range[1]
364
+ ]), re = this.performAction.apply(St, [
365
+ T,
366
+ Be,
367
+ Yt,
368
+ It.yy,
369
+ ht[1],
370
+ G,
371
+ o
372
+ ].concat(lr)), typeof re < "u")
373
+ return re;
374
+ Et && (D = D.slice(0, -1 * Et * 2), G = G.slice(0, -1 * Et), o = o.slice(0, -1 * Et)), D.push(this.productions_[ht[1]][0]), G.push(St.$), o.push(St._$), We = Pt[D[D.length - 2]][D[D.length - 1]], D.push(We);
375
+ break;
376
+ case 3:
377
+ return !0;
378
+ }
379
+ }
380
+ return !0;
381
+ }, "parse")
382
+ }, or = /* @__PURE__ */ (function() {
383
+ var _t = {
384
+ EOF: 1,
385
+ parseError: /* @__PURE__ */ f(function(C, D) {
386
+ if (this.yy.parser)
387
+ this.yy.parser.parseError(C, D);
388
+ else
389
+ throw new Error(C);
390
+ }, "parseError"),
391
+ // resets the lexer, sets new input
392
+ setInput: /* @__PURE__ */ f(function(w, C) {
393
+ return this.yy = C || this.yy || {}, this._input = w, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
394
+ first_line: 1,
395
+ first_column: 0,
396
+ last_line: 1,
397
+ last_column: 0
398
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
399
+ }, "setInput"),
400
+ // consumes and returns one char from the input
401
+ input: /* @__PURE__ */ f(function() {
402
+ var w = this._input[0];
403
+ this.yytext += w, this.yyleng++, this.offset++, this.match += w, this.matched += w;
404
+ var C = w.match(/(?:\r\n?|\n).*/g);
405
+ return C ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), w;
406
+ }, "input"),
407
+ // unshifts one char (or a string) into the input
408
+ unput: /* @__PURE__ */ f(function(w) {
409
+ var C = w.length, D = w.split(/(?:\r\n?|\n)/g);
410
+ this._input = w + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - C), this.offset -= C;
411
+ var y = this.match.split(/(?:\r\n?|\n)/g);
412
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), D.length - 1 && (this.yylineno -= D.length - 1);
413
+ var G = this.yylloc.range;
414
+ return this.yylloc = {
415
+ first_line: this.yylloc.first_line,
416
+ last_line: this.yylineno + 1,
417
+ first_column: this.yylloc.first_column,
418
+ last_column: D ? (D.length === y.length ? this.yylloc.first_column : 0) + y[y.length - D.length].length - D[0].length : this.yylloc.first_column - C
419
+ }, this.options.ranges && (this.yylloc.range = [G[0], G[0] + this.yyleng - C]), this.yyleng = this.yytext.length, this;
420
+ }, "unput"),
421
+ // When called from action, caches matched text and appends it on next action
422
+ more: /* @__PURE__ */ f(function() {
423
+ return this._more = !0, this;
424
+ }, "more"),
425
+ // 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.
426
+ reject: /* @__PURE__ */ f(function() {
427
+ if (this.options.backtrack_lexer)
428
+ this._backtrack = !0;
429
+ else
430
+ 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).
431
+ ` + this.showPosition(), {
432
+ text: "",
433
+ token: null,
434
+ line: this.yylineno
435
+ });
436
+ return this;
437
+ }, "reject"),
438
+ // retain first n characters of the match
439
+ less: /* @__PURE__ */ f(function(w) {
440
+ this.unput(this.match.slice(w));
441
+ }, "less"),
442
+ // displays already matched input, i.e. for error messages
443
+ pastInput: /* @__PURE__ */ f(function() {
444
+ var w = this.matched.substr(0, this.matched.length - this.match.length);
445
+ return (w.length > 20 ? "..." : "") + w.substr(-20).replace(/\n/g, "");
446
+ }, "pastInput"),
447
+ // displays upcoming input, i.e. for error messages
448
+ upcomingInput: /* @__PURE__ */ f(function() {
449
+ var w = this.match;
450
+ return w.length < 20 && (w += this._input.substr(0, 20 - w.length)), (w.substr(0, 20) + (w.length > 20 ? "..." : "")).replace(/\n/g, "");
451
+ }, "upcomingInput"),
452
+ // displays the character position where the lexing error occurred, i.e. for error messages
453
+ showPosition: /* @__PURE__ */ f(function() {
454
+ var w = this.pastInput(), C = new Array(w.length + 1).join("-");
455
+ return w + this.upcomingInput() + `
456
+ ` + C + "^";
457
+ }, "showPosition"),
458
+ // test the lexed token: return FALSE when not a match, otherwise return token
459
+ test_match: /* @__PURE__ */ f(function(w, C) {
460
+ var D, y, G;
461
+ if (this.options.backtrack_lexer && (G = {
462
+ yylineno: this.yylineno,
463
+ yylloc: {
464
+ first_line: this.yylloc.first_line,
465
+ last_line: this.last_line,
466
+ first_column: this.yylloc.first_column,
467
+ last_column: this.yylloc.last_column
468
+ },
469
+ yytext: this.yytext,
470
+ match: this.match,
471
+ matches: this.matches,
472
+ matched: this.matched,
473
+ yyleng: this.yyleng,
474
+ offset: this.offset,
475
+ _more: this._more,
476
+ _input: this._input,
477
+ yy: this.yy,
478
+ conditionStack: this.conditionStack.slice(0),
479
+ done: this.done
480
+ }, this.options.ranges && (G.yylloc.range = this.yylloc.range.slice(0))), y = w[0].match(/(?:\r\n?|\n).*/g), y && (this.yylineno += y.length), this.yylloc = {
481
+ first_line: this.yylloc.last_line,
482
+ last_line: this.yylineno + 1,
483
+ first_column: this.yylloc.last_column,
484
+ last_column: y ? y[y.length - 1].length - y[y.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + w[0].length
485
+ }, this.yytext += w[0], this.match += w[0], this.matches = w, 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(w[0].length), this.matched += w[0], D = this.performAction.call(this, this.yy, this, C, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), D)
486
+ return D;
487
+ if (this._backtrack) {
488
+ for (var o in G)
489
+ this[o] = G[o];
490
+ return !1;
491
+ }
492
+ return !1;
493
+ }, "test_match"),
494
+ // return next match in input
495
+ next: /* @__PURE__ */ f(function() {
496
+ if (this.done)
497
+ return this.EOF;
498
+ this._input || (this.done = !0);
499
+ var w, C, D, y;
500
+ this._more || (this.yytext = "", this.match = "");
501
+ for (var G = this._currentRules(), o = 0; o < G.length; o++)
502
+ if (D = this._input.match(this.rules[G[o]]), D && (!C || D[0].length > C[0].length)) {
503
+ if (C = D, y = o, this.options.backtrack_lexer) {
504
+ if (w = this.test_match(D, G[o]), w !== !1)
505
+ return w;
506
+ if (this._backtrack) {
507
+ C = !1;
508
+ continue;
509
+ } else
510
+ return !1;
511
+ } else if (!this.options.flex)
512
+ break;
513
+ }
514
+ return C ? (w = this.test_match(C, G[y]), w !== !1 ? w : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
515
+ ` + this.showPosition(), {
516
+ text: "",
517
+ token: null,
518
+ line: this.yylineno
519
+ });
520
+ }, "next"),
521
+ // return next match that has a token
522
+ lex: /* @__PURE__ */ f(function() {
523
+ var C = this.next();
524
+ return C || this.lex();
525
+ }, "lex"),
526
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
527
+ begin: /* @__PURE__ */ f(function(C) {
528
+ this.conditionStack.push(C);
529
+ }, "begin"),
530
+ // pop the previously active lexer condition state off the condition stack
531
+ popState: /* @__PURE__ */ f(function() {
532
+ var C = this.conditionStack.length - 1;
533
+ return C > 0 ? this.conditionStack.pop() : this.conditionStack[0];
534
+ }, "popState"),
535
+ // produce the lexer rule set which is active for the currently active lexer condition state
536
+ _currentRules: /* @__PURE__ */ f(function() {
537
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
538
+ }, "_currentRules"),
539
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
540
+ topState: /* @__PURE__ */ f(function(C) {
541
+ return C = this.conditionStack.length - 1 - Math.abs(C || 0), C >= 0 ? this.conditionStack[C] : "INITIAL";
542
+ }, "topState"),
543
+ // alias for begin(condition)
544
+ pushState: /* @__PURE__ */ f(function(C) {
545
+ this.begin(C);
546
+ }, "pushState"),
547
+ // return the number of states currently on the stack
548
+ stateStackSize: /* @__PURE__ */ f(function() {
549
+ return this.conditionStack.length;
550
+ }, "stateStackSize"),
551
+ options: { "case-insensitive": !0 },
552
+ performAction: /* @__PURE__ */ f(function(C, D, y, G) {
553
+ switch (y) {
554
+ case 0:
555
+ return 5;
556
+ case 1:
557
+ break;
558
+ case 2:
559
+ break;
560
+ case 3:
561
+ break;
562
+ case 4:
563
+ break;
564
+ case 5:
565
+ break;
566
+ case 6:
567
+ return 20;
568
+ case 7:
569
+ return this.begin("CONFIG"), 75;
570
+ case 8:
571
+ return 76;
572
+ case 9:
573
+ return this.popState(), this.begin("ALIAS"), 77;
574
+ case 10:
575
+ return this.popState(), this.popState(), 77;
576
+ case 11:
577
+ return D.yytext = D.yytext.trim(), 73;
578
+ case 12:
579
+ return D.yytext = D.yytext.trim(), this.begin("ALIAS"), 73;
580
+ case 13:
581
+ return D.yytext = D.yytext.trim(), this.popState(), 73;
582
+ case 14:
583
+ return this.popState(), 10;
584
+ case 15:
585
+ return D.yytext = D.yytext.trim(), this.popState(), 10;
586
+ case 16:
587
+ return this.begin("LINE"), 15;
588
+ case 17:
589
+ return this.begin("ID"), 51;
590
+ case 18:
591
+ return this.begin("ID"), 53;
592
+ case 19:
593
+ return 14;
594
+ case 20:
595
+ return this.begin("ID"), 54;
596
+ case 21:
597
+ return this.popState(), this.popState(), this.begin("LINE"), 52;
598
+ case 22:
599
+ return this.popState(), this.popState(), 5;
600
+ case 23:
601
+ return this.begin("LINE"), 37;
602
+ case 24:
603
+ return this.begin("LINE"), 38;
604
+ case 25:
605
+ return this.begin("LINE"), 39;
606
+ case 26:
607
+ return this.begin("LINE"), 40;
608
+ case 27:
609
+ return this.begin("LINE"), 50;
610
+ case 28:
611
+ return this.begin("LINE"), 42;
612
+ case 29:
613
+ return this.begin("LINE"), 44;
614
+ case 30:
615
+ return this.begin("LINE"), 49;
616
+ case 31:
617
+ return this.begin("LINE"), 45;
618
+ case 32:
619
+ return this.begin("LINE"), 48;
620
+ case 33:
621
+ return this.begin("LINE"), 47;
622
+ case 34:
623
+ return this.popState(), 16;
624
+ case 35:
625
+ return 17;
626
+ case 36:
627
+ return 67;
628
+ case 37:
629
+ return 68;
630
+ case 38:
631
+ return 61;
632
+ case 39:
633
+ return 62;
634
+ case 40:
635
+ return 63;
636
+ case 41:
637
+ return 64;
638
+ case 42:
639
+ return 59;
640
+ case 43:
641
+ return 56;
642
+ case 44:
643
+ return this.begin("ID"), 22;
644
+ case 45:
645
+ return this.begin("ID"), 24;
646
+ case 46:
647
+ return 30;
648
+ case 47:
649
+ return 31;
650
+ case 48:
651
+ return this.begin("acc_title"), 32;
652
+ case 49:
653
+ return this.popState(), "acc_title_value";
654
+ case 50:
655
+ return this.begin("acc_descr"), 34;
656
+ case 51:
657
+ return this.popState(), "acc_descr_value";
658
+ case 52:
659
+ this.begin("acc_descr_multiline");
660
+ break;
661
+ case 53:
662
+ this.popState();
663
+ break;
664
+ case 54:
665
+ return "acc_descr_multiline_value";
666
+ case 55:
667
+ return 6;
668
+ case 56:
669
+ return 19;
670
+ case 57:
671
+ return 21;
672
+ case 58:
673
+ return 66;
674
+ case 59:
675
+ return 5;
676
+ case 60:
677
+ return D.yytext = D.yytext.trim(), 73;
678
+ case 61:
679
+ return 80;
680
+ case 62:
681
+ return 97;
682
+ case 63:
683
+ return 98;
684
+ case 64:
685
+ return 99;
686
+ case 65:
687
+ return 78;
688
+ case 66:
689
+ return 79;
690
+ case 67:
691
+ return 100;
692
+ case 68:
693
+ return 101;
694
+ case 69:
695
+ return 102;
696
+ case 70:
697
+ return 103;
698
+ case 71:
699
+ return 85;
700
+ case 72:
701
+ return 86;
702
+ case 73:
703
+ return 87;
704
+ case 74:
705
+ return 88;
706
+ case 75:
707
+ return 93;
708
+ case 76:
709
+ return 94;
710
+ case 77:
711
+ return 95;
712
+ case 78:
713
+ return 96;
714
+ case 79:
715
+ return 81;
716
+ case 80:
717
+ return 82;
718
+ case 81:
719
+ return 83;
720
+ case 82:
721
+ return 84;
722
+ case 83:
723
+ return 89;
724
+ case 84:
725
+ return 90;
726
+ case 85:
727
+ return 91;
728
+ case 86:
729
+ return 92;
730
+ case 87:
731
+ return 104;
732
+ case 88:
733
+ return 104;
734
+ case 89:
735
+ return 70;
736
+ case 90:
737
+ return 71;
738
+ case 91:
739
+ return 72;
740
+ case 92:
741
+ return 5;
742
+ case 93:
743
+ return 10;
744
+ }
745
+ }, "anonymous"),
746
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\}(?=\s+as\s))/i, /^(?:\})/i, /^(?:[^<>:\n,;@\s]+(?=\s*@\{))/i, /^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i, /^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i, /^(?:[^<>:\n,;@]*<[^\n]*)/i, /^(?:[^\n]+)/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i, /^(?:link(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i, /^(?:properties(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i, /^(?:details(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:<<->>)/i, /^(?:-->>)/i, /^(?:<<-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?:--\|\\)/i, /^(?:--\|\/)/i, /^(?:--\\\\)/i, /^(?:--\/\/)/i, /^(?:\/\|--)/i, /^(?:\\\|--)/i, /^(?:\/\/--)/i, /^(?:\\\\--)/i, /^(?:-\|\\)/i, /^(?:-\|\/)/i, /^(?:-\\\\)/i, /^(?:-\/\/)/i, /^(?:\/\|-)/i, /^(?:\\\|-)/i, /^(?:\/\/-)/i, /^(?:\\\\-)/i, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:\(\))/i, /^(?:$)/i, /^(?:.)/i],
747
+ conditions: { acc_descr_multiline: { rules: [53, 54], inclusive: !1 }, acc_descr: { rules: [51], inclusive: !1 }, acc_title: { rules: [49], inclusive: !1 }, ID: { rules: [2, 3, 7, 11, 12, 13, 14, 15], inclusive: !1 }, ALIAS: { rules: [2, 3, 21, 22], inclusive: !1 }, LINE: { rules: [2, 3, 34], inclusive: !1 }, CONFIG: { rules: [8, 9, 10], inclusive: !1 }, CONFIG_DATA: { rules: [], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 52, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], inclusive: !0 } }
748
+ };
749
+ return _t;
750
+ })();
751
+ jt.lexer = or;
752
+ function Bt() {
753
+ this.yy = {};
754
+ }
755
+ return f(Bt, "Parser"), Bt.prototype = jt, jt.Parser = Bt, new Bt();
756
+ })();
757
+ ie.parser = ie;
758
+ var Ar = ie, wr = {
759
+ SOLID: 0,
760
+ DOTTED: 1,
761
+ NOTE: 2,
762
+ SOLID_CROSS: 3,
763
+ DOTTED_CROSS: 4,
764
+ SOLID_OPEN: 5,
765
+ DOTTED_OPEN: 6,
766
+ LOOP_START: 10,
767
+ LOOP_END: 11,
768
+ ALT_START: 12,
769
+ ALT_ELSE: 13,
770
+ ALT_END: 14,
771
+ OPT_START: 15,
772
+ OPT_END: 16,
773
+ ACTIVE_START: 17,
774
+ ACTIVE_END: 18,
775
+ PAR_START: 19,
776
+ PAR_AND: 20,
777
+ PAR_END: 21,
778
+ RECT_START: 22,
779
+ RECT_END: 23,
780
+ SOLID_POINT: 24,
781
+ DOTTED_POINT: 25,
782
+ AUTONUMBER: 26,
783
+ CRITICAL_START: 27,
784
+ CRITICAL_OPTION: 28,
785
+ CRITICAL_END: 29,
786
+ BREAK_START: 30,
787
+ BREAK_END: 31,
788
+ PAR_OVER_START: 32,
789
+ BIDIRECTIONAL_SOLID: 33,
790
+ BIDIRECTIONAL_DOTTED: 34,
791
+ SOLID_TOP: 41,
792
+ SOLID_BOTTOM: 42,
793
+ STICK_TOP: 43,
794
+ STICK_BOTTOM: 44,
795
+ SOLID_ARROW_TOP_REVERSE: 45,
796
+ SOLID_ARROW_BOTTOM_REVERSE: 46,
797
+ STICK_ARROW_TOP_REVERSE: 47,
798
+ STICK_ARROW_BOTTOM_REVERSE: 48,
799
+ SOLID_TOP_DOTTED: 51,
800
+ SOLID_BOTTOM_DOTTED: 52,
801
+ STICK_TOP_DOTTED: 53,
802
+ STICK_BOTTOM_DOTTED: 54,
803
+ SOLID_ARROW_TOP_REVERSE_DOTTED: 55,
804
+ SOLID_ARROW_BOTTOM_REVERSE_DOTTED: 56,
805
+ STICK_ARROW_TOP_REVERSE_DOTTED: 57,
806
+ STICK_ARROW_BOTTOM_REVERSE_DOTTED: 58,
807
+ CENTRAL_CONNECTION: 59,
808
+ CENTRAL_CONNECTION_REVERSE: 60,
809
+ CENTRAL_CONNECTION_DUAL: 61
810
+ }, Nr = {
811
+ FILLED: 0,
812
+ OPEN: 1
813
+ }, Pr = {
814
+ LEFTOF: 0,
815
+ RIGHTOF: 1,
816
+ OVER: 2
817
+ }, Ft = {
818
+ ACTOR: "actor",
819
+ CONTROL: "control",
820
+ DATABASE: "database",
821
+ ENTITY: "entity"
822
+ }, kr = class {
823
+ constructor() {
824
+ this.state = new Tr(() => ({
825
+ prevActor: void 0,
826
+ actors: /* @__PURE__ */ new Map(),
827
+ createdActors: /* @__PURE__ */ new Map(),
828
+ destroyedActors: /* @__PURE__ */ new Map(),
829
+ boxes: [],
830
+ messages: [],
831
+ notes: [],
832
+ sequenceNumbersEnabled: !1,
833
+ wrapEnabled: void 0,
834
+ currentBox: void 0,
835
+ lastCreated: void 0,
836
+ lastDestroyed: void 0
837
+ })), this.setAccTitle = Ke, this.setAccDescription = fr, this.setDiagramTitle = _r, this.getAccTitle = gr, this.getAccDescription = xr, this.getDiagramTitle = yr, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(j().wrap), this.LINETYPE = wr, this.ARROWTYPE = Nr, this.PLACEMENT = Pr;
838
+ }
839
+ static {
840
+ f(this, "SequenceDB");
841
+ }
842
+ addBox(e) {
843
+ this.state.records.boxes.push({
844
+ name: e.text,
845
+ wrap: e.wrap ?? this.autoWrap(),
846
+ fill: e.color,
847
+ actorKeys: []
848
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
849
+ }
850
+ addActor(e, t, a, r, i) {
851
+ let c = this.state.records.currentBox, s;
852
+ if (i !== void 0) {
853
+ let p;
854
+ i.includes(`
855
+ `) ? p = i + `
856
+ ` : p = `{
857
+ ` + i + `
858
+ }`, s = Ir(p, { schema: Rr });
859
+ }
860
+ r = s?.type ?? r, s?.alias && (!a || a.text === t) && (a = { text: s.alias, wrap: a?.wrap, type: r });
861
+ const n = this.state.records.actors.get(e);
862
+ if (n) {
863
+ if (this.state.records.currentBox && n.box && this.state.records.currentBox !== n.box)
864
+ throw new Error(
865
+ `A same participant should only be defined in one Box: ${n.name} can't be in '${n.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
866
+ );
867
+ if (c = n.box ? n.box : this.state.records.currentBox, n.box = c, n && t === n.name && a == null)
868
+ return;
869
+ }
870
+ if (a?.text == null && (a = { text: t, type: r }), (r == null || a.text == null) && (a = { text: t, type: r }), this.state.records.actors.set(e, {
871
+ box: c,
872
+ name: t,
873
+ description: a.text,
874
+ wrap: a.wrap ?? this.autoWrap(),
875
+ prevActor: this.state.records.prevActor,
876
+ links: {},
877
+ properties: {},
878
+ actorCnt: null,
879
+ rectData: null,
880
+ type: r ?? "participant"
881
+ }), this.state.records.prevActor) {
882
+ const p = this.state.records.actors.get(this.state.records.prevActor);
883
+ p && (p.nextActor = e);
884
+ }
885
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(e), this.state.records.prevActor = e;
886
+ }
887
+ activationCount(e) {
888
+ let t, a = 0;
889
+ if (!e)
890
+ return 0;
891
+ for (t = 0; t < this.state.records.messages.length; t++)
892
+ this.state.records.messages[t].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[t].from === e && a++, this.state.records.messages[t].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[t].from === e && a--;
893
+ return a;
894
+ }
895
+ addMessage(e, t, a, r) {
896
+ this.state.records.messages.push({
897
+ id: this.state.records.messages.length.toString(),
898
+ from: e,
899
+ to: t,
900
+ message: a.text,
901
+ wrap: a.wrap ?? this.autoWrap(),
902
+ answer: r
903
+ });
904
+ }
905
+ addSignal(e, t, a, r, i = !1, c) {
906
+ if (r === this.LINETYPE.ACTIVE_END && this.activationCount(e ?? "") < 1) {
907
+ const n = new Error("Trying to inactivate an inactive participant (" + e + ")");
908
+ throw n.hash = {
909
+ text: "->>-",
910
+ token: "->>-",
911
+ line: "1",
912
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
913
+ expected: ["'ACTIVE_PARTICIPANT'"]
914
+ }, n;
915
+ }
916
+ return this.state.records.messages.push({
917
+ id: this.state.records.messages.length.toString(),
918
+ from: e,
919
+ to: t,
920
+ message: a?.text ?? "",
921
+ wrap: a?.wrap ?? this.autoWrap(),
922
+ type: r,
923
+ activate: i,
924
+ centralConnection: c ?? 0
925
+ }), !0;
926
+ }
927
+ hasAtLeastOneBox() {
928
+ return this.state.records.boxes.length > 0;
929
+ }
930
+ hasAtLeastOneBoxWithTitle() {
931
+ return this.state.records.boxes.some((e) => e.name);
932
+ }
933
+ getMessages() {
934
+ return this.state.records.messages;
935
+ }
936
+ getBoxes() {
937
+ return this.state.records.boxes;
938
+ }
939
+ getActors() {
940
+ return this.state.records.actors;
941
+ }
942
+ getCreatedActors() {
943
+ return this.state.records.createdActors;
944
+ }
945
+ getDestroyedActors() {
946
+ return this.state.records.destroyedActors;
947
+ }
948
+ getActor(e) {
949
+ return this.state.records.actors.get(e);
950
+ }
951
+ getActorKeys() {
952
+ return [...this.state.records.actors.keys()];
953
+ }
954
+ enableSequenceNumbers() {
955
+ this.state.records.sequenceNumbersEnabled = !0;
956
+ }
957
+ disableSequenceNumbers() {
958
+ this.state.records.sequenceNumbersEnabled = !1;
959
+ }
960
+ showSequenceNumbers() {
961
+ return this.state.records.sequenceNumbersEnabled;
962
+ }
963
+ setWrap(e) {
964
+ this.state.records.wrapEnabled = e;
965
+ }
966
+ extractWrap(e) {
967
+ if (e === void 0)
968
+ return {};
969
+ e = e.trim();
970
+ const t = /^:?wrap:/.exec(e) !== null ? !0 : /^:?nowrap:/.exec(e) !== null ? !1 : void 0;
971
+ return { cleanedText: (t === void 0 ? e : e.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: t };
972
+ }
973
+ autoWrap() {
974
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : j().sequence?.wrap ?? !1;
975
+ }
976
+ clear() {
977
+ this.state.reset(), Or();
978
+ }
979
+ parseMessage(e) {
980
+ const t = e.trim(), { wrap: a, cleanedText: r } = this.extractWrap(t), i = {
981
+ text: r,
982
+ wrap: a
983
+ };
984
+ return nt.debug(`parseMessage: ${JSON.stringify(i)}`), i;
985
+ }
986
+ // We expect the box statement to be color first then description
987
+ // The color can be rgb,rgba,hsl,hsla, or css code names #hex codes are not supported for now because of the way the char # is handled
988
+ // We extract first segment as color, the rest of the line is considered as text
989
+ parseBoxData(e) {
990
+ const t = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);
991
+ let a = t?.[1] ? t[1].trim() : "transparent", r = t?.[2] ? t[2].trim() : void 0;
992
+ if (window?.CSS)
993
+ window.CSS.supports("color", a) || (a = "transparent", r = e.trim());
994
+ else {
995
+ const s = new Option().style;
996
+ s.color = a, s.color !== a && (a = "transparent", r = e.trim());
997
+ }
998
+ const { wrap: i, cleanedText: c } = this.extractWrap(r);
999
+ return {
1000
+ text: c ? Ht(c, j()) : void 0,
1001
+ color: a,
1002
+ wrap: i
1003
+ };
1004
+ }
1005
+ addNote(e, t, a) {
1006
+ const r = {
1007
+ actor: e,
1008
+ placement: t,
1009
+ message: a.text,
1010
+ wrap: a.wrap ?? this.autoWrap()
1011
+ }, i = [].concat(e, e);
1012
+ this.state.records.notes.push(r), this.state.records.messages.push({
1013
+ id: this.state.records.messages.length.toString(),
1014
+ from: i[0],
1015
+ to: i[1],
1016
+ message: a.text,
1017
+ wrap: a.wrap ?? this.autoWrap(),
1018
+ type: this.LINETYPE.NOTE,
1019
+ placement: t
1020
+ });
1021
+ }
1022
+ addLinks(e, t) {
1023
+ const a = this.getActor(e);
1024
+ try {
1025
+ let r = Ht(t.text, j());
1026
+ r = r.replace(/&equals;/g, "="), r = r.replace(/&amp;/g, "&");
1027
+ const i = JSON.parse(r);
1028
+ this.insertLinks(a, i);
1029
+ } catch (r) {
1030
+ nt.error("error while parsing actor link text", r);
1031
+ }
1032
+ }
1033
+ addALink(e, t) {
1034
+ const a = this.getActor(e);
1035
+ try {
1036
+ const r = {};
1037
+ let i = Ht(t.text, j());
1038
+ const c = i.indexOf("@");
1039
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
1040
+ const s = i.slice(0, c - 1).trim(), n = i.slice(c + 1).trim();
1041
+ r[s] = n, this.insertLinks(a, r);
1042
+ } catch (r) {
1043
+ nt.error("error while parsing actor link text", r);
1044
+ }
1045
+ }
1046
+ insertLinks(e, t) {
1047
+ if (e.links == null)
1048
+ e.links = t;
1049
+ else
1050
+ for (const a in t)
1051
+ e.links[a] = t[a];
1052
+ }
1053
+ addProperties(e, t) {
1054
+ const a = this.getActor(e);
1055
+ try {
1056
+ const r = Ht(t.text, j()), i = JSON.parse(r);
1057
+ this.insertProperties(a, i);
1058
+ } catch (r) {
1059
+ nt.error("error while parsing actor properties text", r);
1060
+ }
1061
+ }
1062
+ insertProperties(e, t) {
1063
+ if (e.properties == null)
1064
+ e.properties = t;
1065
+ else
1066
+ for (const a in t)
1067
+ e.properties[a] = t[a];
1068
+ }
1069
+ boxEnd() {
1070
+ this.state.records.currentBox = void 0;
1071
+ }
1072
+ addDetails(e, t) {
1073
+ const a = this.getActor(e), r = document.getElementById(t.text);
1074
+ try {
1075
+ const i = r.innerHTML, c = JSON.parse(i);
1076
+ c.properties && this.insertProperties(a, c.properties), c.links && this.insertLinks(a, c.links);
1077
+ } catch (i) {
1078
+ nt.error("error while parsing actor details text", i);
1079
+ }
1080
+ }
1081
+ getActorProperty(e, t) {
1082
+ if (e?.properties !== void 0)
1083
+ return e.properties[t];
1084
+ }
1085
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
1086
+ apply(e) {
1087
+ if (Array.isArray(e))
1088
+ e.forEach((t) => {
1089
+ this.apply(t);
1090
+ });
1091
+ else
1092
+ switch (e.type) {
1093
+ case "sequenceIndex":
1094
+ this.state.records.messages.push({
1095
+ id: this.state.records.messages.length.toString(),
1096
+ from: void 0,
1097
+ to: void 0,
1098
+ message: {
1099
+ start: e.sequenceIndex,
1100
+ step: e.sequenceIndexStep,
1101
+ visible: e.sequenceVisible
1102
+ },
1103
+ wrap: !1,
1104
+ type: e.signalType
1105
+ });
1106
+ break;
1107
+ case "addParticipant":
1108
+ this.addActor(e.actor, e.actor, e.description, e.draw, e.config);
1109
+ break;
1110
+ case "createParticipant":
1111
+ if (this.state.records.actors.has(e.actor))
1112
+ throw new Error(
1113
+ "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior"
1114
+ );
1115
+ this.state.records.lastCreated = e.actor, this.addActor(e.actor, e.actor, e.description, e.draw, e.config), this.state.records.createdActors.set(e.actor, this.state.records.messages.length);
1116
+ break;
1117
+ case "destroyParticipant":
1118
+ this.state.records.lastDestroyed = e.actor, this.state.records.destroyedActors.set(e.actor, this.state.records.messages.length);
1119
+ break;
1120
+ case "activeStart":
1121
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
1122
+ break;
1123
+ case "centralConnection":
1124
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
1125
+ break;
1126
+ case "centralConnectionReverse":
1127
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
1128
+ break;
1129
+ case "activeEnd":
1130
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
1131
+ break;
1132
+ case "addNote":
1133
+ this.addNote(e.actor, e.placement, e.text);
1134
+ break;
1135
+ case "addLinks":
1136
+ this.addLinks(e.actor, e.text);
1137
+ break;
1138
+ case "addALink":
1139
+ this.addALink(e.actor, e.text);
1140
+ break;
1141
+ case "addProperties":
1142
+ this.addProperties(e.actor, e.text);
1143
+ break;
1144
+ case "addDetails":
1145
+ this.addDetails(e.actor, e.text);
1146
+ break;
1147
+ case "addMessage":
1148
+ if (this.state.records.lastCreated) {
1149
+ if (e.to !== this.state.records.lastCreated)
1150
+ throw new Error(
1151
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1152
+ );
1153
+ this.state.records.lastCreated = void 0;
1154
+ } else if (this.state.records.lastDestroyed) {
1155
+ if (e.to !== this.state.records.lastDestroyed && e.from !== this.state.records.lastDestroyed)
1156
+ throw new Error(
1157
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1158
+ );
1159
+ this.state.records.lastDestroyed = void 0;
1160
+ }
1161
+ this.addSignal(
1162
+ e.from,
1163
+ e.to,
1164
+ e.msg,
1165
+ e.signalType,
1166
+ e.activate,
1167
+ e.centralConnection
1168
+ );
1169
+ break;
1170
+ case "boxStart":
1171
+ this.addBox(e.boxData);
1172
+ break;
1173
+ case "boxEnd":
1174
+ this.boxEnd();
1175
+ break;
1176
+ case "loopStart":
1177
+ this.addSignal(void 0, void 0, e.loopText, e.signalType);
1178
+ break;
1179
+ case "loopEnd":
1180
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1181
+ break;
1182
+ case "rectStart":
1183
+ this.addSignal(void 0, void 0, e.color, e.signalType);
1184
+ break;
1185
+ case "rectEnd":
1186
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1187
+ break;
1188
+ case "optStart":
1189
+ this.addSignal(void 0, void 0, e.optText, e.signalType);
1190
+ break;
1191
+ case "optEnd":
1192
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1193
+ break;
1194
+ case "altStart":
1195
+ this.addSignal(void 0, void 0, e.altText, e.signalType);
1196
+ break;
1197
+ case "else":
1198
+ this.addSignal(void 0, void 0, e.altText, e.signalType);
1199
+ break;
1200
+ case "altEnd":
1201
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1202
+ break;
1203
+ case "setAccTitle":
1204
+ Ke(e.text);
1205
+ break;
1206
+ case "parStart":
1207
+ this.addSignal(void 0, void 0, e.parText, e.signalType);
1208
+ break;
1209
+ case "and":
1210
+ this.addSignal(void 0, void 0, e.parText, e.signalType);
1211
+ break;
1212
+ case "parEnd":
1213
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1214
+ break;
1215
+ case "criticalStart":
1216
+ this.addSignal(void 0, void 0, e.criticalText, e.signalType);
1217
+ break;
1218
+ case "option":
1219
+ this.addSignal(void 0, void 0, e.optionText, e.signalType);
1220
+ break;
1221
+ case "criticalEnd":
1222
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1223
+ break;
1224
+ case "breakStart":
1225
+ this.addSignal(void 0, void 0, e.breakText, e.signalType);
1226
+ break;
1227
+ case "breakEnd":
1228
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1229
+ break;
1230
+ }
1231
+ }
1232
+ getConfig() {
1233
+ return j().sequence;
1234
+ }
1235
+ }, Dr = /* @__PURE__ */ f((e) => {
1236
+ const t = e.dropShadow ?? "none", { look: a } = j();
1237
+ return `.actor {
1238
+ stroke: ${e.actorBorder};
1239
+ fill: ${e.actorBkg};
1240
+ stroke-width: ${e.strokeWidth ?? 1};
1241
+ }
1242
+
1243
+ rect.actor.outer-path[data-look="neo"] {
1244
+ filter: ${t};
1245
+ }
1246
+
1247
+ rect.note[data-look="neo"] {
1248
+ stroke:${e.noteBorderColor};
1249
+ fill:${e.noteBkgColor};
1250
+ filter: ${t};
1251
+ }
1252
+
1253
+ text.actor > tspan {
1254
+ fill: ${e.actorTextColor};
1255
+ stroke: none;
1256
+ }
1257
+
1258
+ .actor-line {
1259
+ stroke: ${e.actorLineColor};
1260
+ }
1261
+
1262
+ .innerArc {
1263
+ stroke-width: 1.5;
1264
+ stroke-dasharray: none;
1265
+ }
1266
+
1267
+ .messageLine0 {
1268
+ stroke-width: 1.5;
1269
+ stroke-dasharray: none;
1270
+ stroke: ${e.signalColor};
1271
+ }
1272
+
1273
+ .messageLine1 {
1274
+ stroke-width: 1.5;
1275
+ stroke-dasharray: 2, 2;
1276
+ stroke: ${e.signalColor};
1277
+ }
1278
+
1279
+ [id$="-arrowhead"] path {
1280
+ fill: ${e.signalColor};
1281
+ stroke: ${e.signalColor};
1282
+ }
1283
+
1284
+ .sequenceNumber {
1285
+ fill: ${e.sequenceNumberColor};
1286
+ }
1287
+
1288
+ [id$="-sequencenumber"] {
1289
+ fill: ${e.signalColor};
1290
+ }
1291
+
1292
+ [id$="-crosshead"] path {
1293
+ fill: ${e.signalColor};
1294
+ stroke: ${e.signalColor};
1295
+ }
1296
+
1297
+ .messageText {
1298
+ fill: ${e.signalTextColor};
1299
+ stroke: none;
1300
+ }
1301
+
1302
+ .labelBox {
1303
+ stroke: ${e.labelBoxBorderColor};
1304
+ fill: ${e.labelBoxBkgColor};
1305
+ filter: ${a === "neo" ? t : "none"};
1306
+ }
1307
+
1308
+ .labelText, .labelText > tspan {
1309
+ fill: ${e.labelTextColor};
1310
+ stroke: none;
1311
+ }
1312
+
1313
+ .loopText, .loopText > tspan {
1314
+ fill: ${e.loopTextColor};
1315
+ stroke: none;
1316
+ }
1317
+
1318
+ .sectionTitle, .sectionTitle > tspan {
1319
+ fill: ${e.loopTextColor};
1320
+ stroke: none;
1321
+ }
1322
+
1323
+ .loopLine {
1324
+ stroke-width: 2px;
1325
+ stroke-dasharray: 2, 2;
1326
+ stroke: ${e.labelBoxBorderColor};
1327
+ fill: ${e.labelBoxBorderColor};
1328
+ }
1329
+
1330
+ .note {
1331
+ //stroke: #decc93;
1332
+ stroke: ${e.noteBorderColor};
1333
+ fill: ${e.noteBkgColor};
1334
+ }
1335
+
1336
+ /*
1337
+ * No font-weight here, deliberately. Note text renders inside tspan elements, and a weight emitted at
1338
+ * tspan level outranks the inline style drawText puts on the parent text element from the
1339
+ * sequence.noteFontWeight config key -- so that documented key would never reach the glyphs.
1340
+ * The theme variable formerly emitted here is a different value from that config key, and
1341
+ * git/styles.js reads it as its own bold-label weight under redux and neo, so it cannot be
1342
+ * lowered there either.
1343
+ */
1344
+ .noteText, .noteText > tspan {
1345
+ fill: ${e.noteTextColor};
1346
+ stroke: none;
1347
+ }
1348
+
1349
+ .activation0 {
1350
+ fill: ${e.activationBkgColor};
1351
+ stroke: ${e.activationBorderColor};
1352
+ }
1353
+
1354
+ .activation1 {
1355
+ fill: ${e.activationBkgColor};
1356
+ stroke: ${e.activationBorderColor};
1357
+ }
1358
+
1359
+ .activation2 {
1360
+ fill: ${e.activationBkgColor};
1361
+ stroke: ${e.activationBorderColor};
1362
+ }
1363
+
1364
+ .actorPopupMenu {
1365
+ position: absolute;
1366
+ }
1367
+
1368
+ .actorPopupMenuPanel {
1369
+ position: absolute;
1370
+ fill: ${e.actorBkg};
1371
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1372
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1373
+ }
1374
+ .actor-man circle, line {
1375
+ fill: ${e.actorBkg};
1376
+ stroke-width: 2px;
1377
+ }
1378
+
1379
+ g rect.rect {
1380
+ filter: ${t};
1381
+ stroke: ${e.nodeBorder};
1382
+ }
1383
+ `;
1384
+ }, "getStyles"), vr = Dr, Gt = 44, de = 6, zt = 6, Cr = /* @__PURE__ */ f((e, t) => e.actorTextHeight ?? Q.calculateTextDimensions(e.description ?? "", {
1385
+ fontFamily: t.actorFontFamily,
1386
+ fontSize: t.actorFontSize,
1387
+ fontWeight: t.actorFontWeight
1388
+ }).height, "actorLabelHeight"), Xe = /* @__PURE__ */ f((e) => Gt + de + e + zt, "actorStackHeight"), Mr = /* @__PURE__ */ f((e, t, a) => {
1389
+ const r = e + t, i = r - zt - a / 2;
1390
+ return {
1391
+ lifelineStartY: r,
1392
+ glyphBottomY: r - zt - a - de,
1393
+ labelCenterY: i
1394
+ };
1395
+ }, "headerBands"), Br = /* @__PURE__ */ f((e, t) => {
1396
+ const a = e + zt, r = a + Gt;
1397
+ return {
1398
+ glyphTopY: a,
1399
+ glyphBottomY: r,
1400
+ labelCenterY: r + de + t / 2,
1401
+ stackHeight: Xe(t)
1402
+ };
1403
+ }, "footerBands"), Ot = 36, Yr = -5, Je = 60, He = Je - Yr, vt = /* @__PURE__ */ f((e, t, a, r) => {
1404
+ if (t.look !== "neo")
1405
+ return null;
1406
+ const i = Cr(e, t);
1407
+ return a ? Br(r, i) : Mr(r, e.height, i);
1408
+ }, "neoBands"), gt = "actor-top", xt = "actor-bottom", Xt = "actor-box", Lt = "actor-man", ut = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), J = /* @__PURE__ */ f((e, t) => e?.length ? e[t % e.length] : void 0, "paletteColor"), kt = /* @__PURE__ */ f(function(e, t) {
1409
+ const a = Sr(e, t);
1410
+ return qt().look === "neo" && a.attr("data-look", "neo"), a;
1411
+ }, "drawRect"), Vr = /* @__PURE__ */ f(function(e, t, a, r, i) {
1412
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1413
+ return { height: 0, width: 0 };
1414
+ const c = t.links, s = t.actorCnt, n = t.rectData;
1415
+ var p = "none";
1416
+ i && (p = "block !important");
1417
+ const d = e.append("g");
1418
+ d.attr("id", "actor" + s + "_popup"), d.attr("class", "actorPopupMenu"), d.attr("display", p);
1419
+ var E = "";
1420
+ n.class !== void 0 && (E = " " + n.class);
1421
+ let u = n.width > a ? n.width : a;
1422
+ const _ = d.append("rect");
1423
+ if (_.attr("class", "actorPopupMenuPanel" + E), _.attr("x", n.x), _.attr("y", n.height), _.attr("fill", n.fill), _.attr("stroke", n.stroke), _.attr("width", u), _.attr("height", n.height), _.attr("rx", n.rx), _.attr("ry", n.ry), c != null) {
1424
+ var L = 20;
1425
+ for (let h in c) {
1426
+ var g = d.append("a"), R = ze.sanitizeUrl(c[h]);
1427
+ g.attr("xlink:href", R), g.attr("target", "_blank"), ca(r)(
1428
+ h,
1429
+ g,
1430
+ n.x + 10,
1431
+ n.height + L,
1432
+ u,
1433
+ 20,
1434
+ { class: "actor" },
1435
+ r
1436
+ ), L += 30;
1437
+ }
1438
+ }
1439
+ return _.attr("height", L), { height: n.height + L, width: u };
1440
+ }, "drawPopup"), Jt = /* @__PURE__ */ f(function(e) {
1441
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1442
+ }, "popupMenuToggle"), Ut = /* @__PURE__ */ f(async function(e, t, a = null) {
1443
+ let r = e.append("foreignObject");
1444
+ const i = await Ge(t.text, qt()), s = r.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();
1445
+ if (r.attr("height", Math.round(s.height)).attr("width", Math.round(s.width)), t.class === "noteText") {
1446
+ const n = e.node().firstChild;
1447
+ n.setAttribute("height", s.height + 2 * t.textMargin);
1448
+ const p = n.getBBox();
1449
+ r.attr("x", Math.round(p.x + p.width / 2 - s.width / 2)).attr("y", Math.round(p.y + p.height / 2 - s.height / 2));
1450
+ } else if (a) {
1451
+ let { startx: n, stopx: p, starty: d } = a;
1452
+ if (n > p) {
1453
+ const E = n;
1454
+ n = p, p = E;
1455
+ }
1456
+ r.attr("x", Math.round(n + Math.abs(n - p) / 2 - s.width / 2)), t.class === "loopText" ? r.attr("y", Math.round(d)) : r.attr("y", Math.round(d - s.height));
1457
+ }
1458
+ return [r];
1459
+ }, "drawKatex"), wt = /* @__PURE__ */ f(function(e, t) {
1460
+ let a = 0, r = 0;
1461
+ const i = t.text.split(N.lineBreakRegex), [c, s] = Ue(t.fontSize);
1462
+ let n = [], p = 0, d = /* @__PURE__ */ f(() => t.y, "yfunc");
1463
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1464
+ switch (t.valign) {
1465
+ case "top":
1466
+ case "start":
1467
+ d = /* @__PURE__ */ f(() => Math.round(t.y + t.textMargin), "yfunc");
1468
+ break;
1469
+ case "middle":
1470
+ case "center":
1471
+ d = /* @__PURE__ */ f(() => Math.round(t.y + (a + r + t.textMargin) / 2), "yfunc");
1472
+ break;
1473
+ case "bottom":
1474
+ case "end":
1475
+ d = /* @__PURE__ */ f(() => Math.round(
1476
+ t.y + (a + r + 2 * t.textMargin) - t.textMargin
1477
+ ), "yfunc");
1478
+ break;
1479
+ }
1480
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1481
+ switch (t.anchor) {
1482
+ case "left":
1483
+ case "start":
1484
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1485
+ break;
1486
+ case "middle":
1487
+ case "center":
1488
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1489
+ break;
1490
+ case "right":
1491
+ case "end":
1492
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1493
+ break;
1494
+ }
1495
+ for (let [E, u] of i.entries()) {
1496
+ t.textMargin !== void 0 && t.textMargin === 0 && c !== void 0 && (p = E * c);
1497
+ const _ = e.append("text");
1498
+ _.attr("x", t.x), _.attr("y", d()), t.anchor !== void 0 && _.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && _.style("font-family", t.fontFamily), s !== void 0 && _.style("font-size", s), t.fontWeight !== void 0 && _.style("font-weight", t.fontWeight), t.fill !== void 0 && _.attr("fill", t.fill), t.class !== void 0 && _.attr("class", t.class), t.dy !== void 0 ? _.attr("dy", t.dy) : p !== 0 && _.attr("dy", p);
1499
+ const L = u || Lr;
1500
+ if (t.tspan) {
1501
+ const g = _.append("tspan");
1502
+ g.attr("x", t.x), t.fill !== void 0 && g.attr("fill", t.fill), g.text(L);
1503
+ } else
1504
+ _.text(L);
1505
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (r += (_._groups || _)[0][0].getBBox().height, a = r), n.push(_);
1506
+ }
1507
+ return n;
1508
+ }, "drawText"), Ze = /* @__PURE__ */ f(function(e, t) {
1509
+ function a(i, c, s, n, p) {
1510
+ return i + "," + c + " " + (i + s) + "," + c + " " + (i + s) + "," + (c + n - p) + " " + (i + s - p * 1.2) + "," + (c + n) + " " + i + "," + (c + n);
1511
+ }
1512
+ f(a, "genPoints");
1513
+ const r = e.append("polygon");
1514
+ return r.attr("points", a(t.x, t.y, t.width, t.height, 7)), r.attr("class", "labelBox"), t.y = t.y + t.height / 2, wt(e, t), r;
1515
+ }, "drawLabel"), Y = -1, Qe = /* @__PURE__ */ f((e, t, a, r) => {
1516
+ e.select && a.forEach((i) => {
1517
+ const c = t.get(i), s = e.select("#actor" + c.actorCnt);
1518
+ !r.mirrorActors && c.stopy ? s.attr("y2", c.stopy + c.height / 2) : r.mirrorActors && s.attr("y2", c.stopy);
1519
+ });
1520
+ }, "fixLifeLineHeights"), Wr = /* @__PURE__ */ f(function(e, t, a, r, i, c) {
1521
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, p = s + t.height, { look: d, theme: E, themeVariables: u } = a, { bkgColorArray: _, borderColorArray: L } = u, g = e.append("g").lower();
1522
+ var R = g;
1523
+ r || (Y++, Object.keys(t.links || {}).length && !a.forceMenus && R.attr("onclick", Jt(`actor${Y}_popup`)).attr("cursor", "pointer"), R.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", p).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), R = g.append("g"), t.actorCnt = Y, t.links != null && R.attr("id", "root-" + Y), d === "neo" && R.attr("data-look", "neo"));
1524
+ const h = pt();
1525
+ var O = "actor";
1526
+ t.properties?.class ? O = t.properties.class : h.fill = "#eaeaea", r ? O += ` ${xt}` : O += ` ${gt}`, h.x = t.x, h.y = s, h.width = t.width, h.height = t.height, h.class = O, h.rx = 3, h.ry = 3, h.name = t.name, d === "neo" && (h.rx = 6, h.ry = 6);
1527
+ const x = kt(R, h), m = c.get(t.name) ?? 0;
1528
+ if (ut.has(E) && (x.style("stroke", J(L, m)), x.style("fill", J(_, m))), d === "neo" && x.attr("filter", `url(#${yt(i)})`), t.rectData = h, t.properties?.icon) {
1529
+ const b = t.properties.icon.trim();
1530
+ b.charAt(0) === "@" ? le(R, h.x + h.width - 20, h.y + 10, b.substr(1)) : he(R, h.x + h.width - 20, h.y + 10, b);
1531
+ }
1532
+ r || (R.attr("data-et", "participant"), R.attr("data-type", "participant"), R.attr("data-id", t.name)), ft(a, tt(t.description))(
1533
+ t.description,
1534
+ R,
1535
+ h.x,
1536
+ h.y,
1537
+ h.width,
1538
+ h.height,
1539
+ { class: `actor ${Xt}` },
1540
+ a
1541
+ );
1542
+ let S = t.height;
1543
+ if (x.node) {
1544
+ const b = x.node().getBBox();
1545
+ a.look !== "neo" && (t.height = b.height, S = b.height);
1546
+ }
1547
+ return S;
1548
+ }, "drawActorTypeParticipant"), Kr = /* @__PURE__ */ f(function(e, t, a, r, i, c) {
1549
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, p = s + t.height, { look: d, theme: E, themeVariables: u } = a, { bkgColorArray: _, borderColorArray: L } = u, g = e.append("g").lower();
1550
+ var R = g;
1551
+ r || (Y++, Object.keys(t.links || {}).length && !a.forceMenus && R.attr("onclick", Jt(`actor${Y}_popup`)).attr("cursor", "pointer"), R.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", p).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), R = g.append("g"), t.actorCnt = Y, t.links != null && R.attr("id", "root-" + Y), d === "neo" && R.attr("data-look", "neo"));
1552
+ const h = pt();
1553
+ var O = "actor";
1554
+ t.properties?.class ? O = t.properties.class : h.fill = "#eaeaea", r ? O += ` ${xt}` : O += ` ${gt}`, h.x = t.x, h.y = s, h.width = t.width, h.height = t.height, h.class = O, h.name = t.name;
1555
+ const x = 6;
1556
+ a.look === "neo" && (h.height = t.height - x);
1557
+ const m = {
1558
+ ...h,
1559
+ x: h.x + -x,
1560
+ y: h.y + +x,
1561
+ class: "actor"
1562
+ }, S = kt(R, h), b = kt(R, m);
1563
+ t.rectData = h, d === "neo" && R.attr("filter", `url(#${yt(i)})`);
1564
+ const P = c.get(t.name) ?? 0;
1565
+ if (ut.has(E) && (S.style("stroke", J(L, P)), S.style("fill", J(_, P)), b.style("stroke", J(L, P)), b.style("fill", J(_, P))), t.properties?.icon) {
1566
+ const B = t.properties.icon.trim();
1567
+ B.charAt(0) === "@" ? le(R, h.x + h.width - 20, h.y + 10, B.substr(1)) : he(R, h.x + h.width - 20, h.y + 10, B);
1568
+ }
1569
+ ft(a, tt(t.description))(
1570
+ t.description,
1571
+ R,
1572
+ h.x - x,
1573
+ h.y + x,
1574
+ h.width,
1575
+ h.height,
1576
+ { class: `actor ${Xt}` },
1577
+ a
1578
+ );
1579
+ let k = t.height;
1580
+ if (S.node) {
1581
+ const B = S.node().getBBox();
1582
+ a.look !== "neo" && (t.height = B.height, k = B.height);
1583
+ }
1584
+ return r || (R.attr("data-et", "participant"), R.attr("data-type", "collections"), R.attr("data-id", t.name)), k;
1585
+ }, "drawActorTypeCollections"), Hr = /* @__PURE__ */ f(function(e, t, a, r, i, c) {
1586
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, p = s + t.height, { look: d, theme: E, themeVariables: u } = a, { bkgColorArray: _, borderColorArray: L } = u, g = e.append("g").lower();
1587
+ let R = g;
1588
+ r || (Y++, Object.keys(t.links || {}).length && !a.forceMenus && R.attr("onclick", Jt(`actor${Y}_popup`)).attr("cursor", "pointer"), R.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", p).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), R = g.append("g"), t.actorCnt = Y, t.links != null && R.attr("id", "root-" + Y), d === "neo" && R.attr("data-look", "neo"));
1589
+ const h = pt();
1590
+ let O = "actor";
1591
+ t.properties?.class ? O = t.properties.class : h.fill = "#eaeaea", r ? O += ` ${xt}` : O += ` ${gt}`, R.attr("class", O), h.x = t.x, h.y = s, h.width = t.width, h.height = t.height, h.name = t.name;
1592
+ const x = h.height / 2, m = x / (2.5 + h.height / 50), S = R.append("g"), b = R.append("g"), P = `M ${h.x},${h.y + x}
1593
+ a ${m},${x} 0 0 0 0,${h.height}
1594
+ h ${h.width - 2 * m}
1595
+ a ${m},${x} 0 0 0 0,-${h.height}
1596
+ Z
1597
+ `;
1598
+ S.append("path").attr("d", P), b.append("path").attr(
1599
+ "d",
1600
+ `M ${h.x},${h.y + x}
1601
+ a ${m},${x} 0 0 0 0,${h.height}`
1602
+ ), S.attr("transform", `translate(${m}, ${-(h.height / 2)})`), b.attr("transform", `translate(${h.width - m}, ${-h.height / 2})`), t.rectData = h, d === "neo" && S.attr("filter", `url(#${yt(i)})`);
1603
+ const k = c.get(t.name) ?? 0;
1604
+ if (ut.has(E) && (S.style("stroke", J(L, k)), S.style("fill", J(_, k)), b.style("stroke", J(L, k)), b.style("fill", J(_, k))), t.properties?.icon) {
1605
+ const K = t.properties.icon.trim(), z = h.x + h.width - 20, X = h.y + 10;
1606
+ K.charAt(0) === "@" ? le(R, z, X, K.substr(1)) : he(R, z, X, K);
1607
+ }
1608
+ ft(a, tt(t.description))(
1609
+ t.description,
1610
+ R,
1611
+ h.x,
1612
+ h.y,
1613
+ h.width,
1614
+ h.height,
1615
+ { class: `actor ${Xt}` },
1616
+ a
1617
+ );
1618
+ let B = t.height;
1619
+ const V = S.select("path:last-child");
1620
+ if (V.node()) {
1621
+ const K = V.node().getBBox();
1622
+ a.look !== "neo" && (t.height = K.height, B = K.height);
1623
+ }
1624
+ return r || (R.attr("data-et", "participant"), R.attr("data-type", "queue"), R.attr("data-id", t.name)), B;
1625
+ }, "drawActorTypeQueue"), Fr = /* @__PURE__ */ f(function(e, t, a, r, i, c) {
1626
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, p = vt(t, a, r, s), d = p ? p.lifelineStartY : s + 75, { look: E, theme: u, themeVariables: _ } = a, { bkgColorArray: L, borderColorArray: g, actorBorder: R, actorBkg: h } = _, O = e.append("g").lower();
1627
+ r || (Y++, O.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", d).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = Y);
1628
+ const x = e.append("g");
1629
+ let m = Lt;
1630
+ r ? m += ` ${xt}` : m += ` ${gt}`, x.attr("class", m), x.attr("name", t.name);
1631
+ const S = pt();
1632
+ S.x = t.x, S.y = s, S.fill = "#eaeaea", S.width = t.width, S.height = t.height, S.class = "actor";
1633
+ const b = t.x + t.width / 2, P = p ? p.glyphBottomY - 22 : s + 32, k = 22;
1634
+ x.append("defs").append("marker").attr("id", i + "-filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").attr("stroke-width", 1.2).append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), x.append("circle").attr("cx", b).attr("cy", P).attr("r", k).attr("filter", `${E === "neo" ? `url(#${yt(i)})` : ""}`), x.append("line").attr("marker-end", "url(#" + i + "-filled-head-control)").attr("transform", `translate(${b}, ${P - k})`);
1635
+ const B = c.get(t.name) ?? 0;
1636
+ if (ut.has(u) ? (x.style("stroke", J(g, B)), x.style("fill", J(L, B))) : (x.style("stroke", R), x.style("fill", h)), !p) {
1637
+ const V = x.node().getBBox();
1638
+ t.height = V.height + 2 * (a?.sequence?.labelBoxHeight ?? 0);
1639
+ }
1640
+ return ft(a, tt(t.description))(
1641
+ t.description,
1642
+ x,
1643
+ S.x,
1644
+ p ? p.labelCenterY - S.height / 2 : S.y + k + (r ? 5 : 12),
1645
+ S.width,
1646
+ S.height,
1647
+ { class: `actor ${Lt}` },
1648
+ a
1649
+ ), r || (x.attr("data-et", "participant"), x.attr("data-type", "control"), x.attr("data-id", t.name)), t.height;
1650
+ }, "drawActorTypeControl"), qr = /* @__PURE__ */ f(function(e, t, a, r, i, c) {
1651
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, p = vt(t, a, r, s), d = p ? p.lifelineStartY : s + 75, { look: E, theme: u, themeVariables: _ } = a, { bkgColorArray: L, borderColorArray: g } = _, R = e.append("g").lower(), h = e.append("g");
1652
+ let O = "actor";
1653
+ r ? O += ` ${xt}` : O += ` ${gt}`, h.attr("class", O), h.attr("name", t.name);
1654
+ const x = pt();
1655
+ x.x = t.x, x.y = s, x.fill = "#eaeaea", x.width = t.width, x.height = t.height, x.class = "actor";
1656
+ const m = t.x + t.width / 2, S = p ? p.glyphBottomY - 22 : s + (r ? 10 : 25), b = 22;
1657
+ h.append("circle").attr("cx", m).attr("cy", S).attr("r", b).attr("width", t.width).attr("height", t.height), h.append("line").attr("x1", m - b).attr("x2", m + b).attr("y1", S + b).attr("y2", S + b).attr("stroke-width", 2), E === "neo" && h.attr("filter", `url(#${yt(i)})`);
1658
+ const P = c.get(t.name) ?? 0;
1659
+ if (ut.has(u) && (h.style("stroke", J(g, P)), h.style("fill", J(L, P))), !p) {
1660
+ const k = h.node().getBBox();
1661
+ t.height = k.height + (a?.sequence?.labelBoxHeight ?? 0);
1662
+ }
1663
+ return r || (Y++, R.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", d).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = Y), ft(a, tt(t.description))(
1664
+ t.description,
1665
+ h,
1666
+ x.x,
1667
+ p ? p.labelCenterY - x.height / 2 : x.y + (r ? 15 : 30),
1668
+ x.width,
1669
+ x.height,
1670
+ { class: `actor ${Lt}` },
1671
+ a
1672
+ ), p || h.attr("transform", `translate(0, ${r ? b : b / 2 - 5})`), r || (h.attr("data-et", "participant"), h.attr("data-type", "entity"), h.attr("data-id", t.name)), t.height;
1673
+ }, "drawActorTypeEntity"), zr = /* @__PURE__ */ f(function(e, t, a, r, i, c) {
1674
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, p = vt(t, a, r, s), d = p ? p.lifelineStartY : s + t.height + 2 * a.boxTextMargin, { theme: E, themeVariables: u, look: _ } = a, { bkgColorArray: L, borderColorArray: g, actorBorder: R } = u, h = e.append("g").lower();
1675
+ let O = h;
1676
+ r || (Y++, Object.keys(t.links || {}).length && !a.forceMenus && O.attr("onclick", Jt(`actor${Y}_popup`)).attr("cursor", "pointer"), O.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", d).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), O = h.append("g"), t.actorCnt = Y, t.links != null && O.attr("id", "root-" + Y), _ === "neo" && O.attr("data-look", "neo"));
1677
+ const x = pt();
1678
+ let m = "actor";
1679
+ t.properties?.class ? m = t.properties.class : x.fill = "#eaeaea", r ? m += ` ${xt}` : m += ` ${gt}`, x.x = t.x, x.y = s, x.width = t.width, x.height = t.height, x.class = m, x.name = t.name, x.x = t.x, x.y = s;
1680
+ const S = x.width / 3, b = S / 2, P = b / (2.5 + S / 50), k = p ? Gt : x.width / 3, B = p ? p.glyphBottomY - k - P : x.y, V = O.append("g");
1681
+ V.attr("class", m);
1682
+ const K = `
1683
+ M ${x.x},${B + P}
1684
+ a ${b},${P} 0 0 0 ${S},0
1685
+ a ${b},${P} 0 0 0 -${S},0
1686
+ l 0,${k - 2 * P}
1687
+ a ${b},${P} 0 0 0 ${S},0
1688
+ l 0,-${k - 2 * P}
1689
+ `;
1690
+ V.append("path").attr("d", K), _ === "neo" && V.attr("filter", `url(#${yt(i)})`);
1691
+ const z = c.get(t.name) ?? 0;
1692
+ if (ut.has(E) ? (V.style("stroke", J(g, z)), V.style("fill", J(L, z))) : V.style("stroke", R), V.attr("transform", `translate(${S}, ${P})`), t.rectData = x, ft(a, tt(t.description))(
1693
+ t.description,
1694
+ O,
1695
+ x.x,
1696
+ p ? p.labelCenterY - x.height / 2 : x.y + 35,
1697
+ x.width,
1698
+ x.height,
1699
+ { class: `actor ${Xt}` },
1700
+ a
1701
+ ), !p) {
1702
+ const X = V.select("path:last-child");
1703
+ if (X.node()) {
1704
+ const et = X.node().getBBox();
1705
+ t.height = et.height + (a.sequence.labelBoxHeight ?? 0);
1706
+ }
1707
+ }
1708
+ return r || (O.attr("data-et", "participant"), O.attr("data-type", "database"), O.attr("data-id", t.name)), t.height;
1709
+ }, "drawActorTypeDatabase"), Ur = /* @__PURE__ */ f(function(e, t, a, r, i, c) {
1710
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, p = vt(t, a, r, s), d = p ? p.lifelineStartY : s + 80, E = 22, u = p ? p.glyphBottomY - E : s + 12, _ = e.append("g").lower(), { look: L, theme: g, themeVariables: R } = a, { bkgColorArray: h, borderColorArray: O, actorBorder: x } = R;
1711
+ r || (Y++, _.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", d).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = Y);
1712
+ const m = e.append("g");
1713
+ let S = Lt;
1714
+ r ? S += ` ${xt}` : S += ` ${gt}`, m.attr("class", S), m.attr("name", t.name);
1715
+ const b = pt();
1716
+ b.x = t.x, b.y = s, b.fill = "#eaeaea", b.width = t.width, b.height = t.height, b.class = "actor", m.append("line").attr("id", "actor-man-torso" + Y).attr("x1", t.x + t.width / 2 - E * 2.5).attr("y1", u).attr("x2", t.x + t.width / 2 - 15).attr("y2", u), m.append("line").attr("id", "actor-man-arms" + Y).attr("x1", t.x + t.width / 2 - E * 2.5).attr("y1", u - 10).attr("x2", t.x + t.width / 2 - E * 2.5).attr("y2", u + 10), m.append("circle").attr("cx", t.x + t.width / 2).attr("cy", u).attr("r", E), L === "neo" && m.attr("filter", `url(#${yt(i)})`);
1717
+ const P = c.get(t.name) ?? 0;
1718
+ if (ut.has(g) ? (m.style("stroke", J(O, P)), m.style("fill", J(h, P))) : m.style("stroke", x), !p) {
1719
+ const k = m.node().getBBox();
1720
+ t.height = k.height + (a.sequence.labelBoxHeight ?? 0);
1721
+ }
1722
+ return ft(a, tt(t.description))(
1723
+ t.description,
1724
+ m,
1725
+ b.x,
1726
+ p ? p.labelCenterY - b.height / 2 : b.y + 15,
1727
+ b.width,
1728
+ b.height,
1729
+ { class: `actor ${Lt}` },
1730
+ a
1731
+ ), p || m.attr("transform", `translate(0,${E / 2 + 10})`), r || (m.attr("data-et", "participant"), m.attr("data-type", "boundary"), m.attr("data-id", t.name)), t.height;
1732
+ }, "drawActorTypeBoundary"), Gr = /* @__PURE__ */ f(function(e, t, a, r, i) {
1733
+ const c = r ? t.stopy : t.starty, s = t.x + t.width / 2, n = vt(t, a, r, c), p = n ? n.lifelineStartY : c + 80, { theme: d, themeVariables: E } = a, { bkgColorArray: u, borderColorArray: _, actorBorder: L } = E, g = e.append("g").lower();
1734
+ r || (Y++, g.append("line").attr("id", "actor" + Y).attr("x1", s).attr("y1", p).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = Y);
1735
+ const R = e.append("g");
1736
+ let h = Lt;
1737
+ r ? h += ` ${xt}` : h += ` ${gt}`, R.attr("class", h), R.attr("name", t.name), r || R.attr("data-et", "participant").attr("data-type", "actor").attr("data-id", t.name);
1738
+ const O = n ? Gt / He : 1, x = /* @__PURE__ */ f((k) => n ? n.glyphBottomY - (Je - k) * O : c + k, "gy"), m = /* @__PURE__ */ f((k) => s + k * O, "gx");
1739
+ R.append("line").attr("id", "actor-man-torso" + Y).attr("x1", s).attr("y1", x(25)).attr("x2", s).attr("y2", x(45)), R.append("line").attr("id", "actor-man-arms" + Y).attr("x1", m(-Ot / 2)).attr("y1", x(33)).attr("x2", m(Ot / 2)).attr("y2", x(33)), R.append("line").attr("x1", m(-Ot / 2)).attr("y1", x(60)).attr("x2", s).attr("y2", x(45)), R.append("line").attr("x1", s).attr("y1", x(45)).attr("x2", m(Ot / 2 - 2)).attr("y2", x(60));
1740
+ const S = R.append("circle");
1741
+ S.attr("cx", t.x + t.width / 2), S.attr("cy", x(10)), S.attr("r", 15 * O), S.attr("width", t.width), S.attr("height", t.height), n || (t.height = He);
1742
+ const b = pt();
1743
+ b.x = t.x, b.y = c, b.fill = "#eaeaea", b.width = t.width, b.height = t.height, b.class = "actor", b.rx = 3, b.ry = 3;
1744
+ const P = i.get(t.name) ?? 0;
1745
+ return ut.has(d) ? (R.style("stroke", J(_, P)), R.style("fill", J(u, P))) : R.style("stroke", L), ft(a, tt(t.description))(
1746
+ t.description,
1747
+ R,
1748
+ b.x,
1749
+ n ? n.labelCenterY - b.height / 2 : c + 35,
1750
+ b.width,
1751
+ b.height,
1752
+ { class: `actor ${Lt}` },
1753
+ a
1754
+ ), t.height;
1755
+ }, "drawActorTypeActor"), Xr = /* @__PURE__ */ f(async function(e, t, a, r, i, c, s) {
1756
+ const n = s ?? new Map(
1757
+ [...c.db.getActors().values()].map((p, d) => [p.name, d])
1758
+ );
1759
+ switch (t.type) {
1760
+ case "actor":
1761
+ return await Gr(e, t, a, r, n);
1762
+ case "participant":
1763
+ return await Wr(
1764
+ e,
1765
+ t,
1766
+ a,
1767
+ r,
1768
+ i,
1769
+ n
1770
+ );
1771
+ case "boundary":
1772
+ return await Ur(
1773
+ e,
1774
+ t,
1775
+ a,
1776
+ r,
1777
+ i,
1778
+ n
1779
+ );
1780
+ case "control":
1781
+ return await Fr(
1782
+ e,
1783
+ t,
1784
+ a,
1785
+ r,
1786
+ i,
1787
+ n
1788
+ );
1789
+ case "entity":
1790
+ return await qr(
1791
+ e,
1792
+ t,
1793
+ a,
1794
+ r,
1795
+ i,
1796
+ n
1797
+ );
1798
+ case "database":
1799
+ return await zr(
1800
+ e,
1801
+ t,
1802
+ a,
1803
+ r,
1804
+ i,
1805
+ n
1806
+ );
1807
+ case "collections":
1808
+ return await Kr(
1809
+ e,
1810
+ t,
1811
+ a,
1812
+ r,
1813
+ i,
1814
+ n
1815
+ );
1816
+ case "queue":
1817
+ return await Hr(
1818
+ e,
1819
+ t,
1820
+ a,
1821
+ r,
1822
+ i,
1823
+ n
1824
+ );
1825
+ }
1826
+ }, "drawActor"), Jr = /* @__PURE__ */ f(function(e, t, a) {
1827
+ const i = e.append("g");
1828
+ $e(i, t), t.name && ft(a)(
1829
+ t.name,
1830
+ i,
1831
+ t.x,
1832
+ t.y + a.boxTextMargin + (t.textMaxHeight || 0) / 2,
1833
+ t.width,
1834
+ 0,
1835
+ { class: "text" },
1836
+ a
1837
+ ), i.lower();
1838
+ }, "drawBox"), Zr = /* @__PURE__ */ f(function(e) {
1839
+ return e.append("g");
1840
+ }, "anchorElement"), Qr = /* @__PURE__ */ f(function(e, t, a, r, i, c, s) {
1841
+ const { theme: n, themeVariables: p } = r, { bkgColorArray: d, borderColorArray: E, mainBkg: u } = p, _ = pt(), L = t.anchored, g = t.actor;
1842
+ _.x = t.startx, _.y = t.starty, _.class = "activation" + i % 3, _.width = t.stopx - t.startx, _.height = a - t.starty;
1843
+ const R = kt(L, _), O = (s ?? new Map(
1844
+ [...c.db.getActors().values()].map((x, m) => [x.name, m])
1845
+ )).get(g) ?? 0;
1846
+ ut.has(n) && (R.style("stroke", J(E, O)), R.style("fill", J(d, O) ?? u));
1847
+ }, "drawActivation"), $r = /* @__PURE__ */ f(async function(e, t, a, r, i) {
1848
+ const {
1849
+ boxMargin: c,
1850
+ boxTextMargin: s,
1851
+ labelBoxHeight: n,
1852
+ labelBoxWidth: p,
1853
+ messageFontFamily: d,
1854
+ messageFontSize: E,
1855
+ messageFontWeight: u
1856
+ } = r, _ = e.append("g").attr("data-et", "control-structure").attr("data-id", "i" + i.id), L = /* @__PURE__ */ f(function(h, O, x, m) {
1857
+ return _.append("line").attr("x1", h).attr("y1", O).attr("x2", x).attr("y2", m).attr("class", "loopLine");
1858
+ }, "drawLoopLine");
1859
+ L(t.startx, t.starty, t.stopx, t.starty), L(t.stopx, t.starty, t.stopx, t.stopy), L(t.startx, t.stopy, t.stopx, t.stopy), L(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(h) {
1860
+ L(t.startx, h.y, t.stopx, h.y).style(
1861
+ "stroke-dasharray",
1862
+ "3, 3"
1863
+ );
1864
+ });
1865
+ let g = ce();
1866
+ g.text = a, g.x = t.startx, g.y = t.starty, g.fontFamily = d, g.fontSize = E, g.fontWeight = u, g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.width = Math.max(p ?? 0, 50), g.height = n + (r.look === "neo" ? 15 : 0) || 20, g.textMargin = s, g.class = "labelText", Ze(_, g), g = je(), g.text = t.title, g.x = t.startx + p / 2 + (t.stopx - t.startx) / 2, g.y = t.starty + c + s, g.anchor = "middle", g.valign = "middle", g.textMargin = s, g.class = "loopText", g.fontFamily = d, g.fontSize = E, g.fontWeight = u, g.wrap = !0;
1867
+ let R = tt(g.text) ? await Ut(_, g, t) : wt(_, g);
1868
+ if (t.sectionTitles !== void 0) {
1869
+ for (const [h, O] of Object.entries(t.sectionTitles))
1870
+ if (O.message) {
1871
+ g.text = O.message, g.x = t.startx + (t.stopx - t.startx) / 2, g.y = t.sections[h].y + c + s, g.class = "sectionTitle", g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.fontFamily = d, g.fontSize = E, g.fontWeight = u, g.wrap = t.wrap, tt(g.text) ? (t.starty = t.sections[h].y, await Ut(_, g, t)) : wt(_, g);
1872
+ let x = Math.round(
1873
+ R.map((m) => (m._groups || m)[0][0].getBBox().height).reduce((m, S) => m + S)
1874
+ );
1875
+ t.sections[h].height += x - (c + s);
1876
+ }
1877
+ }
1878
+ return t.height = Math.round(t.stopy - t.starty), _;
1879
+ }, "drawLoop"), $e = /* @__PURE__ */ f(function(e, t) {
1880
+ mr(e, t);
1881
+ }, "drawBackgroundRect"), jr = /* @__PURE__ */ f(function(e, t) {
1882
+ e.append("defs").append("symbol").attr("id", t + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1883
+ "d",
1884
+ "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"
1885
+ );
1886
+ }, "insertDatabaseIcon"), ta = /* @__PURE__ */ f(function(e, t) {
1887
+ e.append("defs").append("symbol").attr("id", t + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1888
+ "d",
1889
+ "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"
1890
+ );
1891
+ }, "insertComputerIcon"), ea = /* @__PURE__ */ f(function(e, t) {
1892
+ e.append("defs").append("symbol").attr("id", t + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1893
+ "d",
1894
+ "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"
1895
+ );
1896
+ }, "insertClockIcon"), ra = /* @__PURE__ */ f(function(e, t) {
1897
+ e.append("defs").append("marker").attr("id", t + "-arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
1898
+ }, "insertArrowHead"), aa = /* @__PURE__ */ f(function(e, t) {
1899
+ e.append("defs").append("marker").attr("id", t + "-filled-head").attr("refX", 15.5).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");
1900
+ }, "insertArrowFilledHead"), sa = /* @__PURE__ */ f(function(e, t) {
1901
+ e.append("defs").append("marker").attr("id", t + "-sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1902
+ }, "insertSequenceNumber"), ia = /* @__PURE__ */ f(function(e, t) {
1903
+ e.append("defs").append("marker").attr("id", t + "-crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
1904
+ }, "insertArrowCrossHead"), yt = /* @__PURE__ */ f((e) => e ? `${e}-drop-shadow` : "drop-shadow", "dropShadowId"), na = /* @__PURE__ */ f(function(e, t, a) {
1905
+ const { theme: r } = t;
1906
+ e.append("defs").append("filter").attr("id", yt(a)).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", "0.06").attr("flood-color", `${r === "redux" || r === "redux-color" ? "#000000" : "#FFFFFF"}`);
1907
+ }, "insertDropShadow"), je = /* @__PURE__ */ f(function() {
1908
+ return {
1909
+ x: 0,
1910
+ y: 0,
1911
+ fill: void 0,
1912
+ anchor: void 0,
1913
+ style: "#666",
1914
+ width: void 0,
1915
+ height: void 0,
1916
+ textMargin: 0,
1917
+ rx: 0,
1918
+ ry: 0,
1919
+ tspan: !0,
1920
+ valign: void 0
1921
+ };
1922
+ }, "getTextObj"), oa = /* @__PURE__ */ f(function() {
1923
+ return {
1924
+ x: 0,
1925
+ y: 0,
1926
+ fill: "#EDF2AE",
1927
+ stroke: "#666",
1928
+ width: 100,
1929
+ anchor: "start",
1930
+ height: 100,
1931
+ rx: 0,
1932
+ ry: 0
1933
+ };
1934
+ }, "getNoteRect"), ft = /* @__PURE__ */ (function() {
1935
+ function e(c, s, n, p, d, E, u) {
1936
+ const _ = s.append("text").attr("x", n + d / 2).attr("y", p + E / 2 + 5).style("text-anchor", "middle").text(c);
1937
+ i(_, u);
1938
+ }
1939
+ f(e, "byText");
1940
+ function t(c, s, n, p, d, E, u, _) {
1941
+ const { actorFontSize: L, actorFontFamily: g, actorFontWeight: R } = _, [h, O] = Ue(L), x = c.split(N.lineBreakRegex);
1942
+ for (let m = 0; m < x.length; m++) {
1943
+ const S = m * h - h * (x.length - 1) / 2, b = s.append("text").attr("x", n + d / 2).attr("y", p).style("text-anchor", "middle").style("font-size", O).style("font-weight", R).style("font-family", g);
1944
+ b.append("tspan").attr("x", n + d / 2).attr("dy", S).text(x[m]), b.attr("y", p + E / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), i(b, u);
1945
+ }
1946
+ }
1947
+ f(t, "byTspan");
1948
+ function a(c, s, n, p, d, E, u, _) {
1949
+ const L = s.append("switch"), R = L.append("foreignObject").attr("x", n).attr("y", p).attr("width", d).attr("height", E).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1950
+ R.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(c), t(c, L, n, p, d, E, u, _), i(R, u);
1951
+ }
1952
+ f(a, "byFo");
1953
+ async function r(c, s, n, p, d, E, u, _) {
1954
+ const L = await Dt(c, qt()), g = s.append("switch"), h = g.append("foreignObject").attr("x", n + d / 2 - L.width / 2).attr("y", p + E / 2 - L.height / 2).attr("width", L.width).attr("height", L.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1955
+ h.append("div").style("text-align", "center").style("vertical-align", "middle").html(await Ge(c, qt())), t(c, g, n, p, d, E, u, _), i(h, u);
1956
+ }
1957
+ f(r, "byKatex");
1958
+ function i(c, s) {
1959
+ for (const n in s)
1960
+ s.hasOwnProperty(n) && c.attr(n, s[n]);
1961
+ }
1962
+ return f(i, "_setTextAttrs"), function(c, s = !1) {
1963
+ return s ? r : c.textPlacement === "fo" ? a : c.textPlacement === "old" ? e : t;
1964
+ };
1965
+ })(), ca = /* @__PURE__ */ (function() {
1966
+ function e(i, c, s, n, p, d, E) {
1967
+ const u = c.append("text").attr("x", s).attr("y", n).style("text-anchor", "start").text(i);
1968
+ r(u, E);
1969
+ }
1970
+ f(e, "byText");
1971
+ function t(i, c, s, n, p, d, E, u) {
1972
+ const { actorFontSize: _, actorFontFamily: L, actorFontWeight: g } = u, R = i.split(N.lineBreakRegex);
1973
+ for (let h = 0; h < R.length; h++) {
1974
+ const O = h * _ - _ * (R.length - 1) / 2, x = c.append("text").attr("x", s).attr("y", n).style("text-anchor", "start").style("font-size", _).style("font-weight", g).style("font-family", L);
1975
+ x.append("tspan").attr("x", s).attr("dy", O).text(R[h]), x.attr("y", n + d / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(x, E);
1976
+ }
1977
+ }
1978
+ f(t, "byTspan");
1979
+ function a(i, c, s, n, p, d, E, u) {
1980
+ const _ = c.append("switch"), g = _.append("foreignObject").attr("x", s).attr("y", n).attr("width", p).attr("height", d).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1981
+ g.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, _, s, n, p, d, E, u), r(g, E);
1982
+ }
1983
+ f(a, "byFo");
1984
+ function r(i, c) {
1985
+ for (const s in c)
1986
+ c.hasOwnProperty(s) && i.attr(s, c[s]);
1987
+ }
1988
+ return f(r, "_setTextAttrs"), function(i) {
1989
+ return i.textPlacement === "fo" ? a : i.textPlacement === "old" ? e : t;
1990
+ };
1991
+ })(), la = /* @__PURE__ */ f(function(e, t) {
1992
+ e.append("defs").append("marker").attr("id", t + "-solidTopArrowHead").attr("refX", 7.9).attr("refY", 7.25).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 8 L 0 8 z");
1993
+ }, "insertSolidTopArrowHead"), ha = /* @__PURE__ */ f(function(e, t) {
1994
+ e.append("defs").append("marker").attr("id", t + "-solidBottomArrowHead").attr("refX", 7.9).attr("refY", 0.75).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 0 L 0 8 z");
1995
+ }, "insertSolidBottomArrowHead"), da = /* @__PURE__ */ f(function(e, t) {
1996
+ e.append("defs").append("marker").attr("id", t + "-stickTopArrowHead").attr("refX", 7.5).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 7 7").attr("stroke", "black").attr("stroke-width", 1.5).attr("fill", "none");
1997
+ }, "insertStickTopArrowHead"), Ta = /* @__PURE__ */ f(function(e, t) {
1998
+ e.append("defs").append("marker").attr("id", t + "-stickBottomArrowHead").attr("refX", 7.5).attr("refY", 0).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 7 L 7 0").attr("stroke", "black").attr("stroke-width", 1.5).attr("fill", "none");
1999
+ }, "insertStickBottomArrowHead"), q = {
2000
+ drawRect: kt,
2001
+ drawText: wt,
2002
+ drawLabel: Ze,
2003
+ drawActor: Xr,
2004
+ drawBox: Jr,
2005
+ drawPopup: Vr,
2006
+ anchorElement: Zr,
2007
+ drawActivation: Qr,
2008
+ drawLoop: $r,
2009
+ drawBackgroundRect: $e,
2010
+ insertArrowHead: ra,
2011
+ insertArrowFilledHead: aa,
2012
+ insertSequenceNumber: sa,
2013
+ insertArrowCrossHead: ia,
2014
+ insertDatabaseIcon: jr,
2015
+ insertComputerIcon: ta,
2016
+ insertClockIcon: ea,
2017
+ getTextObj: je,
2018
+ getNoteRect: oa,
2019
+ fixLifeLineHeights: Qe,
2020
+ sanitizeUrl: ze.sanitizeUrl,
2021
+ insertDropShadow: na,
2022
+ insertSolidTopArrowHead: la,
2023
+ insertSolidBottomArrowHead: ha,
2024
+ insertStickTopArrowHead: da,
2025
+ insertStickBottomArrowHead: Ta
2026
+ }, l = {}, I = {
2027
+ data: {
2028
+ startx: void 0,
2029
+ stopx: void 0,
2030
+ starty: void 0,
2031
+ stopy: void 0
2032
+ },
2033
+ verticalPos: 0,
2034
+ sequenceItems: [],
2035
+ activations: [],
2036
+ models: {
2037
+ getHeight: /* @__PURE__ */ f(function() {
2038
+ return Math.max.apply(
2039
+ null,
2040
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
2041
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.messages.length === 0 ? 0 : this.messages.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.notes.length === 0 ? 0 : this.notes.map((e) => e.height || 0).reduce((e, t) => e + t));
2042
+ }, "getHeight"),
2043
+ clear: /* @__PURE__ */ f(function() {
2044
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
2045
+ }, "clear"),
2046
+ addBox: /* @__PURE__ */ f(function(e) {
2047
+ this.boxes.push(e);
2048
+ }, "addBox"),
2049
+ addActor: /* @__PURE__ */ f(function(e) {
2050
+ this.actors.push(e);
2051
+ }, "addActor"),
2052
+ addLoop: /* @__PURE__ */ f(function(e) {
2053
+ this.loops.push(e);
2054
+ }, "addLoop"),
2055
+ addMessage: /* @__PURE__ */ f(function(e) {
2056
+ this.messages.push(e);
2057
+ }, "addMessage"),
2058
+ addNote: /* @__PURE__ */ f(function(e) {
2059
+ this.notes.push(e);
2060
+ }, "addNote"),
2061
+ lastActor: /* @__PURE__ */ f(function() {
2062
+ return this.actors[this.actors.length - 1];
2063
+ }, "lastActor"),
2064
+ lastLoop: /* @__PURE__ */ f(function() {
2065
+ return this.loops[this.loops.length - 1];
2066
+ }, "lastLoop"),
2067
+ lastMessage: /* @__PURE__ */ f(function() {
2068
+ return this.messages[this.messages.length - 1];
2069
+ }, "lastMessage"),
2070
+ lastNote: /* @__PURE__ */ f(function() {
2071
+ return this.notes[this.notes.length - 1];
2072
+ }, "lastNote"),
2073
+ actors: [],
2074
+ boxes: [],
2075
+ loops: [],
2076
+ messages: [],
2077
+ notes: []
2078
+ },
2079
+ init: /* @__PURE__ */ f(function() {
2080
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
2081
+ startx: void 0,
2082
+ stopx: void 0,
2083
+ starty: void 0,
2084
+ stopy: void 0
2085
+ }, this.verticalPos = 0, rr(j());
2086
+ }, "init"),
2087
+ updateVal: /* @__PURE__ */ f(function(e, t, a, r) {
2088
+ e[t] === void 0 ? e[t] = a : e[t] = r(a, e[t]);
2089
+ }, "updateVal"),
2090
+ updateBounds: /* @__PURE__ */ f(function(e, t, a, r) {
2091
+ const i = this;
2092
+ let c = 0;
2093
+ function s(n) {
2094
+ return /* @__PURE__ */ f(function(d) {
2095
+ c++;
2096
+ const E = i.sequenceItems.length - c + 1;
2097
+ i.updateVal(d, "starty", t - E * l.boxMargin, Math.min), i.updateVal(d, "stopy", r + E * l.boxMargin, Math.max), i.updateVal(I.data, "startx", e - E * l.boxMargin, Math.min), i.updateVal(I.data, "stopx", a + E * l.boxMargin, Math.max), n !== "activation" && (i.updateVal(d, "startx", e - E * l.boxMargin, Math.min), i.updateVal(d, "stopx", a + E * l.boxMargin, Math.max), i.updateVal(I.data, "starty", t - E * l.boxMargin, Math.min), i.updateVal(I.data, "stopy", r + E * l.boxMargin, Math.max));
2098
+ }, "updateItemBounds");
2099
+ }
2100
+ f(s, "updateFn"), this.sequenceItems.forEach(s()), this.activations.forEach(s("activation"));
2101
+ }, "updateBounds"),
2102
+ insert: /* @__PURE__ */ f(function(e, t, a, r) {
2103
+ const i = N.getMin(e, a), c = N.getMax(e, a), s = N.getMin(t, r), n = N.getMax(t, r);
2104
+ this.updateVal(I.data, "startx", i, Math.min), this.updateVal(I.data, "starty", s, Math.min), this.updateVal(I.data, "stopx", c, Math.max), this.updateVal(I.data, "stopy", n, Math.max), this.updateBounds(i, s, c, n);
2105
+ }, "insert"),
2106
+ newActivation: /* @__PURE__ */ f(function(e, t, a) {
2107
+ const r = a.get(e.from), i = Zt(e.from).length || 0, c = r.x + r.width / 2 + (i - 1) * l.activationWidth / 2;
2108
+ this.activations.push({
2109
+ startx: c,
2110
+ starty: this.verticalPos + 2,
2111
+ stopx: c + l.activationWidth,
2112
+ stopy: void 0,
2113
+ actor: e.from,
2114
+ anchored: q.anchorElement(t)
2115
+ });
2116
+ }, "newActivation"),
2117
+ endActivation: /* @__PURE__ */ f(function(e) {
2118
+ const t = this.activations.map(function(a) {
2119
+ return a.actor;
2120
+ }).lastIndexOf(e.from);
2121
+ return this.activations.splice(t, 1)[0];
2122
+ }, "endActivation"),
2123
+ createLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
2124
+ return {
2125
+ startx: void 0,
2126
+ starty: this.verticalPos,
2127
+ stopx: void 0,
2128
+ stopy: void 0,
2129
+ title: e.message,
2130
+ wrap: e.wrap,
2131
+ width: e.width,
2132
+ height: 0,
2133
+ fill: t
2134
+ };
2135
+ }, "createLoop"),
2136
+ newLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
2137
+ this.sequenceItems.push(this.createLoop(e, t));
2138
+ }, "newLoop"),
2139
+ endLoop: /* @__PURE__ */ f(function() {
2140
+ return this.sequenceItems.pop();
2141
+ }, "endLoop"),
2142
+ isLoopOverlap: /* @__PURE__ */ f(function() {
2143
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
2144
+ }, "isLoopOverlap"),
2145
+ addSectionToLoop: /* @__PURE__ */ f(function(e) {
2146
+ const t = this.sequenceItems.pop();
2147
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: I.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
2148
+ }, "addSectionToLoop"),
2149
+ saveVerticalPos: /* @__PURE__ */ f(function() {
2150
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
2151
+ }, "saveVerticalPos"),
2152
+ resetVerticalPos: /* @__PURE__ */ f(function() {
2153
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
2154
+ }, "resetVerticalPos"),
2155
+ bumpVerticalPos: /* @__PURE__ */ f(function(e) {
2156
+ this.verticalPos = this.verticalPos + e, this.data.stopy = N.getMax(this.data.stopy, this.verticalPos);
2157
+ }, "bumpVerticalPos"),
2158
+ getVerticalPos: /* @__PURE__ */ f(function() {
2159
+ return this.verticalPos;
2160
+ }, "getVerticalPos"),
2161
+ getBounds: /* @__PURE__ */ f(function() {
2162
+ return { bounds: this.data, models: this.models };
2163
+ }, "getBounds")
2164
+ }, pa = /* @__PURE__ */ f(async function(e, t, a) {
2165
+ I.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = I.getVerticalPos();
2166
+ const r = pt();
2167
+ r.x = t.startx, r.y = t.starty, r.width = t.width || l.width, r.class = "note";
2168
+ const i = e.append("g");
2169
+ i.attr("data-et", "note"), i.attr("data-id", "i" + a);
2170
+ const c = q.drawRect(i, r), s = ce();
2171
+ s.x = t.startx, s.y = t.starty, s.width = r.width, s.dy = "1em", s.text = t.message, s.class = "noteText", s.fontFamily = l.noteFontFamily, s.fontSize = l.noteFontSize, s.fontWeight = l.noteFontWeight, s.anchor = l.noteAlign, s.textMargin = l.noteMargin, s.valign = "center";
2172
+ const n = tt(s.text) ? await Ut(i, s) : wt(i, s), p = Math.round(
2173
+ n.map((d) => (d._groups || d)[0][0].getBBox().height).reduce((d, E) => d + E)
2174
+ );
2175
+ c.attr("height", p + 2 * l.noteMargin), t.height += p + 2 * l.noteMargin, I.bumpVerticalPos(p + 2 * l.noteMargin), t.stopy = t.starty + p + 2 * l.noteMargin, t.stopx = t.startx + r.width, I.insert(t.startx, t.starty, t.stopx, t.stopy), I.models.addNote(t);
2176
+ }, "drawNote"), Fe = /* @__PURE__ */ f(function(e, t, a, r, i, c, s) {
2177
+ const n = r.db.getActors(), p = n.get(t.from), d = n.get(t.to), E = a.sequenceVisible;
2178
+ let u = p.x + p.width / 2, _ = d.x + d.width / 2;
2179
+ const L = u <= _, g = nr(t, r), R = e.append("g"), h = 16.5, O = /* @__PURE__ */ f((P, k) => {
2180
+ const B = P ? h : -h;
2181
+ return k ? -B : B;
2182
+ }, "getCircleOffset"), x = /* @__PURE__ */ f((P) => {
2183
+ R.append("circle").attr("cx", P).attr("cy", s).attr("r", 5).attr("width", 10).attr("height", 10);
2184
+ }, "drawCircle"), { CENTRAL_CONNECTION: m, CENTRAL_CONNECTION_REVERSE: S, CENTRAL_CONNECTION_DUAL: b } = r.db.LINETYPE;
2185
+ if (E)
2186
+ switch (t.centralConnection) {
2187
+ case m:
2188
+ g && (_ += O(L, !0));
2189
+ break;
2190
+ case S:
2191
+ g || (u += O(L, !1));
2192
+ break;
2193
+ case b:
2194
+ g ? _ += O(L, !0) : u += O(L, !1);
2195
+ break;
2196
+ }
2197
+ switch (t.centralConnection) {
2198
+ case m:
2199
+ x(_);
2200
+ break;
2201
+ case S:
2202
+ x(u);
2203
+ break;
2204
+ case b:
2205
+ x(u), x(_);
2206
+ break;
2207
+ }
2208
+ }, "drawCentralConnection"), bt = /* @__PURE__ */ f((e) => ({
2209
+ fontFamily: e.messageFontFamily,
2210
+ fontSize: e.messageFontSize,
2211
+ fontWeight: e.messageFontWeight
2212
+ }), "messageFont"), At = /* @__PURE__ */ f((e) => ({
2213
+ fontFamily: e.noteFontFamily,
2214
+ fontSize: e.noteFontSize,
2215
+ fontWeight: e.noteFontWeight
2216
+ }), "noteFont"), ne = /* @__PURE__ */ f((e) => ({
2217
+ fontFamily: e.actorFontFamily,
2218
+ fontSize: e.actorFontSize,
2219
+ fontWeight: e.actorFontWeight
2220
+ }), "actorFont");
2221
+ async function tr(e, t) {
2222
+ I.bumpVerticalPos(10);
2223
+ const { startx: a, stopx: r, message: i } = t, c = N.splitBreaks(i).length, s = tt(i), n = s ? await Dt(i, j()) : Q.calculateTextDimensions(i, bt(l));
2224
+ if (!s) {
2225
+ const u = n.height / c;
2226
+ t.height += u, I.bumpVerticalPos(u);
2227
+ }
2228
+ let p, d = n.height - 10;
2229
+ const E = n.width;
2230
+ if (a === r) {
2231
+ p = I.getVerticalPos() + d, l.rightAngles || (d += l.boxMargin, p = I.getVerticalPos() + d), d += 30;
2232
+ const u = N.getMax(E / 2, l.width / 2);
2233
+ I.insert(
2234
+ a - u,
2235
+ I.getVerticalPos() - 10 + d,
2236
+ r + u,
2237
+ I.getVerticalPos() + 30 + d
2238
+ );
2239
+ } else
2240
+ d += l.boxMargin, p = I.getVerticalPos() + d, I.insert(a, p - 10, r, p);
2241
+ return I.bumpVerticalPos(d), t.height += d, t.stopy = t.starty + t.height, I.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), p;
2242
+ }
2243
+ f(tr, "boundMessage");
2244
+ var Ea = /* @__PURE__ */ f(async function(e, t, a, r, i, c) {
2245
+ const { startx: s, stopx: n, starty: p, message: d, type: E, sequenceIndex: u, sequenceVisible: _ } = t, L = Q.calculateTextDimensions(d, bt(l)), g = ce();
2246
+ g.x = Math.min(s, n), g.y = p + 10, g.width = Math.abs(n - s), g.class = "messageText", g.dy = "1em", g.text = d, g.fontFamily = l.messageFontFamily, g.fontSize = l.messageFontSize, g.fontWeight = l.messageFontWeight, g.anchor = l.messageAlign, g.valign = "center", g.textMargin = l.wrapPadding, g.tspan = !1, tt(g.text) ? await Ut(e, g, { startx: s, stopx: n, starty: a }) : wt(e, g);
2247
+ const R = L.width;
2248
+ let h;
2249
+ if (s === n) {
2250
+ const x = _ || l.showSequenceNumbers, m = nr(i, r), S = Ia(i, r), b = s + (x && (m || S) ? 10 : 0);
2251
+ l.rightAngles ? h = e.append("path").attr(
2252
+ "d",
2253
+ `M ${b},${a} H ${s + N.getMax(l.width / 2, R / 2)} V ${a + 25} H ${s}`
2254
+ ) : h = e.append("path").attr(
2255
+ "d",
2256
+ "M " + b + "," + a + " C " + (b + 60) + "," + (a - 10) + " " + (s + 60) + "," + (a + 30) + " " + s + "," + (a + 20)
2257
+ ), se(i, r) && Fe(e, i, t, r, s, n, a);
2258
+ } else
2259
+ h = e.append("line"), h.attr("x1", s), h.attr("y1", a), h.attr("x2", n), h.attr("y2", a), se(i, r) && Fe(e, i, t, r, s, n, a);
2260
+ E === r.db.LINETYPE.DOTTED || E === r.db.LINETYPE.DOTTED_CROSS || E === r.db.LINETYPE.DOTTED_POINT || E === r.db.LINETYPE.DOTTED_OPEN || E === r.db.LINETYPE.BIDIRECTIONAL_DOTTED || E === r.db.LINETYPE.SOLID_TOP_DOTTED || E === r.db.LINETYPE.SOLID_BOTTOM_DOTTED || E === r.db.LINETYPE.STICK_TOP_DOTTED || E === r.db.LINETYPE.STICK_BOTTOM_DOTTED || E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED ? (h.style("stroke-dasharray", "3, 3"), h.attr("class", "messageLine1")) : h.attr("class", "messageLine0"), h.attr("data-et", "message"), h.attr("data-id", "i" + t.id), h.attr("data-from", t.from), h.attr("data-to", t.to);
2261
+ let O = "";
2262
+ if (l.arrowMarkerAbsolute && (O = br(!0)), h.attr("stroke-width", 2), h.attr("stroke", "none"), h.style("fill", "none"), (E === r.db.LINETYPE.SOLID_TOP || E === r.db.LINETYPE.SOLID_TOP_DOTTED) && h.attr("marker-end", "url(" + O + "#" + c + "-solidTopArrowHead)"), (E === r.db.LINETYPE.SOLID_BOTTOM || E === r.db.LINETYPE.SOLID_BOTTOM_DOTTED) && h.attr("marker-end", "url(" + O + "#" + c + "-solidBottomArrowHead)"), (E === r.db.LINETYPE.STICK_TOP || E === r.db.LINETYPE.STICK_TOP_DOTTED) && h.attr("marker-end", "url(" + O + "#" + c + "-stickTopArrowHead)"), (E === r.db.LINETYPE.STICK_BOTTOM || E === r.db.LINETYPE.STICK_BOTTOM_DOTTED) && h.attr("marker-end", "url(" + O + "#" + c + "-stickBottomArrowHead)"), (E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED) && h.attr("marker-start", "url(" + O + "#" + c + "-solidBottomArrowHead)"), (E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED) && h.attr("marker-start", "url(" + O + "#" + c + "-solidTopArrowHead)"), (E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED) && h.attr("marker-start", "url(" + O + "#" + c + "-stickBottomArrowHead)"), (E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED) && h.attr("marker-start", "url(" + O + "#" + c + "-stickTopArrowHead)"), (E === r.db.LINETYPE.SOLID || E === r.db.LINETYPE.DOTTED) && h.attr("marker-end", "url(" + O + "#" + c + "-arrowhead)"), (E === r.db.LINETYPE.BIDIRECTIONAL_SOLID || E === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (h.attr("marker-start", "url(" + O + "#" + c + "-arrowhead)"), h.attr("marker-end", "url(" + O + "#" + c + "-arrowhead)")), (E === r.db.LINETYPE.SOLID_POINT || E === r.db.LINETYPE.DOTTED_POINT) && h.attr("marker-end", "url(" + O + "#" + c + "-filled-head)"), (E === r.db.LINETYPE.SOLID_CROSS || E === r.db.LINETYPE.DOTTED_CROSS) && h.attr("marker-end", "url(" + O + "#" + c + "-crosshead)"), _ || l.showSequenceNumbers) {
2263
+ const x = E === r.db.LINETYPE.BIDIRECTIONAL_SOLID || E === r.db.LINETYPE.BIDIRECTIONAL_DOTTED, m = E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED, S = 6, b = se(i, r);
2264
+ let P = s, k = n;
2265
+ x ? (s < n ? P = s + S * 2 : (P = s - S + (b ? -5 : 0), P += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), h.attr("x1", P)) : m ? (n > s ? k = n - 2 * S : (k = n - S, P += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), k += b ? 15 : 0, h.attr("x2", k), h.attr("x1", P)) : h.attr("x1", s + S);
2266
+ let B = 0;
2267
+ const V = s === n, K = s <= n;
2268
+ V ? B = t.fromBounds + 1 : m ? B = K ? t.toBounds - 1 : t.fromBounds + 1 : B = K ? t.fromBounds + 1 : t.toBounds - 1;
2269
+ let z = "12px";
2270
+ const X = u.toString().length;
2271
+ X > 5 ? z = "7px" : X > 3 && (z = "9px"), e.append("line").attr("x1", B).attr("y1", a).attr("x2", B).attr("y2", a).attr("stroke-width", 0).attr("marker-start", "url(" + O + "#" + c + "-sequencenumber)"), e.append("text").attr("x", B).attr("y", a + 4).attr("font-family", "sans-serif").attr("font-size", z).attr("text-anchor", "middle").attr("class", "sequenceNumber").text(u);
2272
+ }
2273
+ }, "drawMessage"), ua = /* @__PURE__ */ f(function(e, t, a, r, i, c, s) {
2274
+ let n = 0, p = 0, d, E = 0;
2275
+ for (const u of r) {
2276
+ const _ = t.get(u), L = _.box;
2277
+ d && d != L && (s || I.models.addBox(d), p += l.boxMargin + d.margin), L && L != d && (s || (L.x = n + p, L.y = i), p += L.margin), _.width = N.getMax(_.width || l.width, l.width), _.height = N.getMax(_.height || l.height, l.height), _.margin = _.margin || l.actorMargin, E = N.getMax(E, _.height), a.get(_.name) && (p += _.width / 2), _.x = n + p, _.starty = I.getVerticalPos(), I.insert(_.x, i, _.x + _.width, _.height), n += _.width + p, _.box && (_.box.width = n + L.margin - _.box.x), p = _.margin, d = _.box, I.models.addActor(_);
2278
+ }
2279
+ d && !s && I.models.addBox(d), I.bumpVerticalPos(E);
2280
+ }, "addActorRenderingData"), oe = /* @__PURE__ */ f(async function(e, t, a, r, i, c, s) {
2281
+ if (r) {
2282
+ let n = 0;
2283
+ I.bumpVerticalPos(l.boxMargin * 2);
2284
+ for (const p of a) {
2285
+ const d = t.get(p);
2286
+ d.stopy || (d.stopy = I.getVerticalPos());
2287
+ const E = await q.drawActor(
2288
+ e,
2289
+ d,
2290
+ l,
2291
+ !0,
2292
+ i,
2293
+ c,
2294
+ s
2295
+ );
2296
+ n = N.getMax(n, E);
2297
+ }
2298
+ I.bumpVerticalPos(n + l.boxMargin);
2299
+ } else
2300
+ for (const n of a) {
2301
+ const p = t.get(n);
2302
+ await q.drawActor(e, p, l, !1, i, c, s);
2303
+ }
2304
+ }, "drawActors"), er = /* @__PURE__ */ f(function(e, t, a, r) {
2305
+ let i = 0, c = 0;
2306
+ for (const s of a) {
2307
+ const n = t.get(s), p = _a(n), d = q.drawPopup(
2308
+ e,
2309
+ n,
2310
+ p,
2311
+ l,
2312
+ l.forceMenus,
2313
+ r
2314
+ );
2315
+ d.height > i && (i = d.height), d.width + n.x > c && (c = d.width + n.x);
2316
+ }
2317
+ return { maxHeight: i, maxWidth: c };
2318
+ }, "drawActorsPopup"), rr = /* @__PURE__ */ f(function(e) {
2319
+ ur(l, e), e.fontFamily && (l.actorFontFamily = l.noteFontFamily = l.messageFontFamily = e.fontFamily), e.fontSize && (l.actorFontSize = l.noteFontSize = l.messageFontSize = e.fontSize), e.fontWeight && (l.actorFontWeight = l.noteFontWeight = l.messageFontWeight = e.fontWeight);
2320
+ }, "setConf"), Zt = /* @__PURE__ */ f(function(e) {
2321
+ return I.activations.filter(function(t) {
2322
+ return t.actor === e;
2323
+ });
2324
+ }, "actorActivations"), qe = /* @__PURE__ */ f(function(e, t) {
2325
+ const a = t.get(e), r = Zt(e), i = r.reduce(
2326
+ function(s, n) {
2327
+ return N.getMin(s, n.startx);
2328
+ },
2329
+ a.x + a.width / 2 - 1
2330
+ ), c = r.reduce(
2331
+ function(s, n) {
2332
+ return N.getMax(s, n.stopx);
2333
+ },
2334
+ a.x + a.width / 2 + 1
2335
+ );
2336
+ return [i, c];
2337
+ }, "activationBounds");
2338
+ function Tt(e, t, a, r, i) {
2339
+ I.bumpVerticalPos(a);
2340
+ let c = r;
2341
+ if (t.id && t.message && e[t.id]) {
2342
+ const s = e[t.id].width, n = bt(l);
2343
+ t.message = Q.wrapLabel(`[${t.message}]`, s - 2 * l.wrapPadding, n), t.width = s, t.wrap = !0;
2344
+ const p = Q.calculateTextDimensions(t.message, n), d = N.getMax(p.height, l.labelBoxHeight);
2345
+ c = r + d, nt.debug(`${d} - ${t.message}`);
2346
+ }
2347
+ i(t), I.bumpVerticalPos(c);
2348
+ }
2349
+ f(Tt, "adjustLoopHeightForWrap");
2350
+ function ar(e, t, a, r, i, c, s) {
2351
+ function n(E, u) {
2352
+ E.x < i.get(e.from).x ? (I.insert(
2353
+ t.stopx - u,
2354
+ t.starty,
2355
+ t.startx,
2356
+ t.stopy + E.height / 2 + l.noteMargin
2357
+ ), t.stopx = t.stopx + u) : (I.insert(
2358
+ t.startx,
2359
+ t.starty,
2360
+ t.stopx + u,
2361
+ t.stopy + E.height / 2 + l.noteMargin
2362
+ ), t.stopx = t.stopx - u);
2363
+ }
2364
+ f(n, "receiverAdjustment");
2365
+ function p(E, u) {
2366
+ E.x < i.get(e.to).x ? (I.insert(
2367
+ t.startx - u,
2368
+ t.starty,
2369
+ t.stopx,
2370
+ t.stopy + E.height / 2 + l.noteMargin
2371
+ ), t.startx = t.startx + u) : (I.insert(
2372
+ t.stopx,
2373
+ t.starty,
2374
+ t.startx + u,
2375
+ t.stopy + E.height / 2 + l.noteMargin
2376
+ ), t.startx = t.startx - u);
2377
+ }
2378
+ f(p, "senderAdjustment");
2379
+ const d = [
2380
+ Ft.ACTOR,
2381
+ Ft.CONTROL,
2382
+ Ft.ENTITY,
2383
+ Ft.DATABASE
2384
+ ];
2385
+ if (c.get(e.to) == r) {
2386
+ const E = i.get(e.to), u = d.includes(E.type) ? Ot / 2 + 3 : E.width / 2 + 3;
2387
+ n(E, u), E.starty = a - E.height / 2, I.bumpVerticalPos(E.height / 2);
2388
+ } else if (s.get(e.from) == r) {
2389
+ const E = i.get(e.from);
2390
+ if (l.mirrorActors) {
2391
+ const u = d.includes(E.type) ? Ot / 2 : E.width / 2;
2392
+ p(E, u);
2393
+ }
2394
+ E.stopy = a - E.height / 2, I.bumpVerticalPos(E.height / 2);
2395
+ } else if (s.get(e.to) == r) {
2396
+ const E = i.get(e.to);
2397
+ if (l.mirrorActors) {
2398
+ const u = d.includes(E.type) ? Ot / 2 + 3 : E.width / 2 + 3;
2399
+ n(E, u);
2400
+ }
2401
+ E.stopy = a - E.height / 2, I.bumpVerticalPos(E.height / 2);
2402
+ }
2403
+ }
2404
+ f(ar, "adjustCreatedDestroyedData");
2405
+ var fa = /* @__PURE__ */ f(async function(e, t, a, r) {
2406
+ const { securityLevel: i, sequence: c, look: s, themeVariables: n } = j();
2407
+ l = c;
2408
+ let p;
2409
+ i === "sandbox" && (p = Kt("#i" + t));
2410
+ const d = i === "sandbox" ? Kt(p.nodes()[0].contentDocument.body) : Kt("body"), E = i === "sandbox" ? p.nodes()[0].contentDocument : document;
2411
+ I.init(), nt.debug(r.db);
2412
+ const u = i === "sandbox" ? d.select(`[id="${t}"]`) : Kt(`[id="${t}"]`), _ = r.db.getActors(), L = r.db.getCreatedActors(), g = r.db.getDestroyedActors(), R = r.db.getBoxes();
2413
+ let h = r.db.getActorKeys();
2414
+ const O = r.db.getMessages(), x = r.db.getDiagramTitle(), m = r.db.hasAtLeastOneBox(), S = r.db.hasAtLeastOneBoxWithTitle(), b = await sr(_, O, r);
2415
+ if (l.height = await ir(_, b, R), q.insertComputerIcon(u, t), q.insertDatabaseIcon(u, t), q.insertClockIcon(u, t), m && (I.bumpVerticalPos(l.boxMargin), S && I.bumpVerticalPos(R[0].textMaxHeight)), l.hideUnusedParticipants === !0) {
2416
+ const A = /* @__PURE__ */ new Set();
2417
+ O.forEach((v) => {
2418
+ A.add(v.from), A.add(v.to);
2419
+ }), h = h.filter((v) => A.has(v));
2420
+ }
2421
+ const P = new Map(
2422
+ h.map((A, v) => [_.get(A)?.name ?? A, v])
2423
+ );
2424
+ ua(u, _, L, h, 0, O, !1);
2425
+ const k = await Oa(O, _, b, r);
2426
+ q.insertArrowHead(u, t), q.insertArrowCrossHead(u, t), q.insertArrowFilledHead(u, t), q.insertSequenceNumber(u, t), q.insertSolidTopArrowHead(u, t), q.insertSolidBottomArrowHead(u, t), q.insertStickTopArrowHead(u, t), q.insertStickBottomArrowHead(u, t), s === "neo" && q.insertDropShadow(u, l, t);
2427
+ function B(A, v) {
2428
+ const dt = I.endActivation(A);
2429
+ dt.starty + 18 > v && (dt.starty = v - 6, v += 12), q.drawActivation(
2430
+ u,
2431
+ dt,
2432
+ v,
2433
+ l,
2434
+ Zt(A.from).length,
2435
+ r,
2436
+ P
2437
+ ), I.insert(dt.startx, v - 10, dt.stopx, v);
2438
+ }
2439
+ f(B, "activeEnd");
2440
+ let V = 1, K = 1;
2441
+ const z = [], X = [];
2442
+ let et = 0;
2443
+ for (const A of O) {
2444
+ let v, dt, st;
2445
+ switch (A.type) {
2446
+ case r.db.LINETYPE.NOTE:
2447
+ I.resetVerticalPos(), dt = A.noteModel, await pa(u, dt, A.id);
2448
+ break;
2449
+ case r.db.LINETYPE.ACTIVE_START:
2450
+ I.newActivation(A, u, _);
2451
+ break;
2452
+ case r.db.LINETYPE.CENTRAL_CONNECTION:
2453
+ I.newActivation(A, u, _);
2454
+ break;
2455
+ case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:
2456
+ I.newActivation(A, u, _);
2457
+ break;
2458
+ case r.db.LINETYPE.ACTIVE_END:
2459
+ B(A, I.getVerticalPos());
2460
+ break;
2461
+ case r.db.LINETYPE.LOOP_START:
2462
+ Tt(
2463
+ k,
2464
+ A,
2465
+ l.boxMargin,
2466
+ l.boxMargin + l.boxTextMargin,
2467
+ (H) => I.newLoop(H)
2468
+ );
2469
+ break;
2470
+ case r.db.LINETYPE.LOOP_END:
2471
+ v = I.endLoop(), await q.drawLoop(u, v, "loop", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2472
+ break;
2473
+ case r.db.LINETYPE.RECT_START:
2474
+ Tt(k, A, l.boxMargin, l.boxMargin, (H) => {
2475
+ let mt = H.message;
2476
+ mt || (mt = n?.rectBkgColor || n?.actorBkg || "rgba(128, 128, 128, 0.5)"), I.newLoop(void 0, mt);
2477
+ });
2478
+ break;
2479
+ case r.db.LINETYPE.RECT_END:
2480
+ v = I.endLoop(), X.push(v), I.models.addLoop(v), I.bumpVerticalPos(v.stopy - I.getVerticalPos());
2481
+ break;
2482
+ case r.db.LINETYPE.OPT_START:
2483
+ Tt(
2484
+ k,
2485
+ A,
2486
+ l.boxMargin,
2487
+ l.boxMargin + l.boxTextMargin,
2488
+ (H) => I.newLoop(H)
2489
+ );
2490
+ break;
2491
+ case r.db.LINETYPE.OPT_END:
2492
+ v = I.endLoop(), await q.drawLoop(u, v, "opt", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2493
+ break;
2494
+ case r.db.LINETYPE.ALT_START:
2495
+ Tt(
2496
+ k,
2497
+ A,
2498
+ l.boxMargin,
2499
+ l.boxMargin + l.boxTextMargin,
2500
+ (H) => I.newLoop(H)
2501
+ );
2502
+ break;
2503
+ case r.db.LINETYPE.ALT_ELSE:
2504
+ Tt(
2505
+ k,
2506
+ A,
2507
+ l.boxMargin + l.boxTextMargin,
2508
+ l.boxMargin,
2509
+ (H) => I.addSectionToLoop(H)
2510
+ );
2511
+ break;
2512
+ case r.db.LINETYPE.ALT_END:
2513
+ v = I.endLoop(), await q.drawLoop(u, v, "alt", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2514
+ break;
2515
+ case r.db.LINETYPE.PAR_START:
2516
+ case r.db.LINETYPE.PAR_OVER_START:
2517
+ Tt(
2518
+ k,
2519
+ A,
2520
+ l.boxMargin,
2521
+ l.boxMargin + l.boxTextMargin,
2522
+ (H) => I.newLoop(H)
2523
+ ), I.saveVerticalPos();
2524
+ break;
2525
+ case r.db.LINETYPE.PAR_AND:
2526
+ Tt(
2527
+ k,
2528
+ A,
2529
+ l.boxMargin + l.boxTextMargin,
2530
+ l.boxMargin,
2531
+ (H) => I.addSectionToLoop(H)
2532
+ );
2533
+ break;
2534
+ case r.db.LINETYPE.PAR_END:
2535
+ v = I.endLoop(), await q.drawLoop(u, v, "par", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2536
+ break;
2537
+ case r.db.LINETYPE.AUTONUMBER:
2538
+ V = A.message.start || V, K = A.message.step || K, A.message.visible ? r.db.enableSequenceNumbers() : r.db.disableSequenceNumbers();
2539
+ break;
2540
+ case r.db.LINETYPE.CRITICAL_START:
2541
+ Tt(
2542
+ k,
2543
+ A,
2544
+ l.boxMargin,
2545
+ l.boxMargin + l.boxTextMargin,
2546
+ (H) => I.newLoop(H)
2547
+ );
2548
+ break;
2549
+ case r.db.LINETYPE.CRITICAL_OPTION:
2550
+ Tt(
2551
+ k,
2552
+ A,
2553
+ l.boxMargin + l.boxTextMargin,
2554
+ l.boxMargin,
2555
+ (H) => I.addSectionToLoop(H)
2556
+ );
2557
+ break;
2558
+ case r.db.LINETYPE.CRITICAL_END:
2559
+ v = I.endLoop(), await q.drawLoop(u, v, "critical", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2560
+ break;
2561
+ case r.db.LINETYPE.BREAK_START:
2562
+ Tt(
2563
+ k,
2564
+ A,
2565
+ l.boxMargin,
2566
+ l.boxMargin + l.boxTextMargin,
2567
+ (H) => I.newLoop(H)
2568
+ );
2569
+ break;
2570
+ case r.db.LINETYPE.BREAK_END:
2571
+ v = I.endLoop(), await q.drawLoop(u, v, "break", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2572
+ break;
2573
+ default:
2574
+ try {
2575
+ st = A.msgModel, st.starty = I.getVerticalPos(), st.sequenceIndex = V, st.sequenceVisible = r.db.showSequenceNumbers(), st.id = A.id, st.from = A.from, st.to = A.to;
2576
+ const H = await tr(u, st);
2577
+ ar(
2578
+ A,
2579
+ st,
2580
+ H,
2581
+ et,
2582
+ _,
2583
+ L,
2584
+ g
2585
+ ), z.push({ messageModel: st, lineStartY: H, msg: A }), I.models.addMessage(st);
2586
+ } catch (H) {
2587
+ nt.error("error while drawing message", H);
2588
+ }
2589
+ }
2590
+ [
2591
+ r.db.LINETYPE.SOLID_OPEN,
2592
+ r.db.LINETYPE.DOTTED_OPEN,
2593
+ r.db.LINETYPE.SOLID,
2594
+ r.db.LINETYPE.SOLID_TOP,
2595
+ r.db.LINETYPE.SOLID_BOTTOM,
2596
+ r.db.LINETYPE.STICK_TOP,
2597
+ r.db.LINETYPE.STICK_BOTTOM,
2598
+ r.db.LINETYPE.SOLID_TOP_DOTTED,
2599
+ r.db.LINETYPE.SOLID_BOTTOM_DOTTED,
2600
+ r.db.LINETYPE.STICK_TOP_DOTTED,
2601
+ r.db.LINETYPE.STICK_BOTTOM_DOTTED,
2602
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2603
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
2604
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2605
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2606
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2607
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2608
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2609
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2610
+ r.db.LINETYPE.DOTTED,
2611
+ r.db.LINETYPE.SOLID_CROSS,
2612
+ r.db.LINETYPE.DOTTED_CROSS,
2613
+ r.db.LINETYPE.SOLID_POINT,
2614
+ r.db.LINETYPE.DOTTED_POINT,
2615
+ r.db.LINETYPE.BIDIRECTIONAL_SOLID,
2616
+ r.db.LINETYPE.BIDIRECTIONAL_DOTTED
2617
+ ].includes(A.type) && (V = Math.round((V + K) * 100) / 100), et++;
2618
+ }
2619
+ nt.debug("createdActors", L), nt.debug("destroyedActors", g), await oe(u, _, h, !1, t, r, P);
2620
+ for (const A of z)
2621
+ await Ea(u, A.messageModel, A.lineStartY, r, A.msg, t);
2622
+ l.mirrorActors && await oe(u, _, h, !0, t, r, P), X.forEach((A) => q.drawBackgroundRect(u, A)), Qe(u, _, h, l);
2623
+ for (const A of I.models.boxes) {
2624
+ A.height = I.getVerticalPos() - A.y, I.insert(A.x, A.y, A.x + A.width, A.height);
2625
+ const v = l.boxMargin * 2;
2626
+ A.startx = A.x - v, A.starty = A.y - v * 0.25, A.stopx = A.startx + A.width + 2 * v, A.stopy = A.starty + A.height + v * 0.75, A.stroke = "rgb(0,0,0, 0.5)", q.drawBox(u, A, l);
2627
+ }
2628
+ m && I.bumpVerticalPos(l.boxMargin);
2629
+ const rt = er(u, _, h, E), { bounds: U } = I.getBounds();
2630
+ U.startx === void 0 && (U.startx = 0), U.starty === void 0 && (U.starty = 0), U.stopx === void 0 && (U.stopx = 0), U.stopy === void 0 && (U.stopy = 0);
2631
+ let ot = U.stopy - U.starty;
2632
+ ot < rt.maxHeight && (ot = rt.maxHeight);
2633
+ let at = ot + 2 * l.diagramMarginY;
2634
+ l.mirrorActors && (at = at - l.boxMargin + l.bottomMarginAdj);
2635
+ let W = U.stopx - U.startx;
2636
+ W < rt.maxWidth && (W = rt.maxWidth);
2637
+ const M = W + 2 * l.diagramMarginX;
2638
+ x && u.append("text").text(x).attr("x", (U.stopx - U.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), Er(u, at, M, l.useMaxWidth);
2639
+ const Z = x ? 40 : 0, Ct = _.size && s === "neo" ? 30 : 0;
2640
+ u.attr(
2641
+ "viewBox",
2642
+ U.startx - l.diagramMarginX + " -" + (l.diagramMarginY + Z) + " " + M + " " + (at + Z + Ct)
2643
+ ), nt.debug("models:", I.models);
2644
+ }, "draw");
2645
+ async function sr(e, t, a) {
2646
+ const r = {};
2647
+ for (const i of t)
2648
+ if (e.get(i.to) && e.get(i.from)) {
2649
+ const c = e.get(i.to);
2650
+ if (i.placement === a.db.PLACEMENT.LEFTOF && !c.prevActor || i.placement === a.db.PLACEMENT.RIGHTOF && !c.nextActor)
2651
+ continue;
2652
+ const s = i.placement !== void 0, n = !s, p = s ? At(l) : bt(l), d = i.wrap ? Q.wrapLabel(i.message, l.width - 2 * l.wrapPadding, p) : i.message, u = (tt(d) ? await Dt(i.message, j()) : Q.calculateTextDimensions(d, p)).width + 2 * l.wrapPadding;
2653
+ n && i.from === c.nextActor ? r[i.to] = N.getMax(
2654
+ r[i.to] || 0,
2655
+ u
2656
+ ) : n && i.from === c.prevActor ? r[i.from] = N.getMax(
2657
+ r[i.from] || 0,
2658
+ u
2659
+ ) : n && i.from === i.to ? (r[i.from] = N.getMax(
2660
+ r[i.from] || 0,
2661
+ u / 2
2662
+ ), r[i.to] = N.getMax(
2663
+ r[i.to] || 0,
2664
+ u / 2
2665
+ )) : i.placement === a.db.PLACEMENT.RIGHTOF ? r[i.from] = N.getMax(
2666
+ r[i.from] || 0,
2667
+ u
2668
+ ) : i.placement === a.db.PLACEMENT.LEFTOF ? r[c.prevActor] = N.getMax(
2669
+ r[c.prevActor] || 0,
2670
+ u
2671
+ ) : i.placement === a.db.PLACEMENT.OVER && (c.prevActor && (r[c.prevActor] = N.getMax(
2672
+ r[c.prevActor] || 0,
2673
+ u / 2
2674
+ )), c.nextActor && (r[i.from] = N.getMax(
2675
+ r[i.from] || 0,
2676
+ u / 2
2677
+ )));
2678
+ }
2679
+ return nt.debug("maxMessageWidthPerActor:", r), r;
2680
+ }
2681
+ f(sr, "getMaxMessageWidthPerActor");
2682
+ var _a = /* @__PURE__ */ f(function(e) {
2683
+ let t = 0;
2684
+ const a = ne(l);
2685
+ for (const r in e.links) {
2686
+ const c = Q.calculateTextDimensions(r, a).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2687
+ t < c && (t = c);
2688
+ }
2689
+ return t;
2690
+ }, "getRequiredPopupWidth");
2691
+ async function ir(e, t, a) {
2692
+ let r = 0;
2693
+ for (const c of e.keys()) {
2694
+ const s = e.get(c);
2695
+ s.wrap && (s.description = Q.wrapLabel(
2696
+ s.description,
2697
+ l.width - 2 * l.wrapPadding,
2698
+ ne(l)
2699
+ ));
2700
+ const n = tt(s.description) ? await Dt(s.description, j()) : Q.calculateTextDimensions(s.description, ne(l));
2701
+ s.width = s.wrap ? l.width : N.getMax(l.width, n.width + 2 * l.wrapPadding), j().look === "neo" ? (s.actorTextHeight = n.height, s.height = N.getMax(Xe(n.height), l.height)) : s.height = s.wrap ? N.getMax(n.height, l.height) : l.height, r = N.getMax(r, s.height);
2702
+ }
2703
+ for (const c in t) {
2704
+ const s = e.get(c);
2705
+ if (!s)
2706
+ continue;
2707
+ const n = e.get(s.nextActor);
2708
+ if (!n) {
2709
+ const u = t[c] + l.actorMargin - s.width / 2;
2710
+ s.margin = N.getMax(u, l.actorMargin);
2711
+ continue;
2712
+ }
2713
+ const d = t[c] + l.actorMargin - s.width / 2 - n.width / 2;
2714
+ s.margin = N.getMax(d, l.actorMargin);
2715
+ }
2716
+ let i = 0;
2717
+ return a.forEach((c) => {
2718
+ const s = bt(l);
2719
+ let n = c.actorKeys.reduce((u, _) => u += e.get(_).width + (e.get(_).margin || 0), 0);
2720
+ const p = l.boxMargin * 8;
2721
+ n += p, n -= 2 * l.boxTextMargin, c.wrap && (c.name = Q.wrapLabel(c.name, n - 2 * l.wrapPadding, s));
2722
+ const d = Q.calculateTextDimensions(c.name, s);
2723
+ i = N.getMax(d.height, i);
2724
+ const E = N.getMax(n, d.width + 2 * l.wrapPadding);
2725
+ if (c.margin = l.boxTextMargin, n < E) {
2726
+ const u = (E - n) / 2;
2727
+ c.margin += u;
2728
+ }
2729
+ }), a.forEach((c) => c.textMaxHeight = i), N.getMax(r, l.height);
2730
+ }
2731
+ f(ir, "calculateActorMargins");
2732
+ var ga = /* @__PURE__ */ f(async function(e, t, a) {
2733
+ const r = t.get(e.from), i = t.get(e.to), c = r.x, s = i.x, n = e.wrap && e.message;
2734
+ let p = tt(e.message) ? await Dt(e.message, j()) : Q.calculateTextDimensions(
2735
+ n ? Q.wrapLabel(e.message, l.width, At(l)) : e.message,
2736
+ At(l)
2737
+ );
2738
+ const d = {
2739
+ width: n ? l.width : N.getMax(l.width, p.width + 2 * l.noteMargin),
2740
+ height: 0,
2741
+ startx: r.x,
2742
+ stopx: 0,
2743
+ starty: 0,
2744
+ stopy: 0,
2745
+ message: e.message
2746
+ };
2747
+ return e.placement === a.db.PLACEMENT.RIGHTOF ? (d.width = n ? N.getMax(l.width, p.width) : N.getMax(
2748
+ r.width / 2 + i.width / 2,
2749
+ p.width + 2 * l.noteMargin
2750
+ ), d.startx = c + (r.width + l.actorMargin) / 2) : e.placement === a.db.PLACEMENT.LEFTOF ? (d.width = n ? N.getMax(l.width, p.width + 2 * l.noteMargin) : N.getMax(
2751
+ r.width / 2 + i.width / 2,
2752
+ p.width + 2 * l.noteMargin
2753
+ ), d.startx = c - d.width + (r.width - l.actorMargin) / 2) : e.to === e.from ? (p = Q.calculateTextDimensions(
2754
+ n ? Q.wrapLabel(e.message, N.getMax(l.width, r.width), At(l)) : e.message,
2755
+ At(l)
2756
+ ), d.width = n ? N.getMax(l.width, r.width) : N.getMax(r.width, l.width, p.width + 2 * l.noteMargin), d.startx = c + (r.width - d.width) / 2) : (d.width = Math.abs(c + r.width / 2 - (s + i.width / 2)) + l.actorMargin, d.startx = c < s ? c + r.width / 2 - l.actorMargin / 2 : s + i.width / 2 - l.actorMargin / 2), n && (d.message = Q.wrapLabel(
2757
+ e.message,
2758
+ d.width - 2 * l.wrapPadding,
2759
+ At(l)
2760
+ )), nt.debug(
2761
+ `NM:[${d.startx},${d.stopx},${d.starty},${d.stopy}:${d.width},${d.height}=${e.message}]`
2762
+ ), d;
2763
+ }, "buildNoteModel"), xa = 4, se = /* @__PURE__ */ f(function(e, t) {
2764
+ const { CENTRAL_CONNECTION: a, CENTRAL_CONNECTION_REVERSE: r, CENTRAL_CONNECTION_DUAL: i } = t.db.LINETYPE;
2765
+ return [a, r, i].includes(
2766
+ e.centralConnection
2767
+ );
2768
+ }, "hasCentralConnection"), ya = /* @__PURE__ */ f(function(e, t, a) {
2769
+ const {
2770
+ CENTRAL_CONNECTION_REVERSE: r,
2771
+ CENTRAL_CONNECTION_DUAL: i,
2772
+ BIDIRECTIONAL_SOLID: c,
2773
+ BIDIRECTIONAL_DOTTED: s
2774
+ } = t.db.LINETYPE;
2775
+ let n = 0;
2776
+ return (e.centralConnection === r || e.centralConnection === i) && (n += xa), (e.centralConnection === r || e.centralConnection === i) && (e.type === c || e.type === s) && (n += a ? 0 : -6), n;
2777
+ }, "calculateCentralConnectionOffset"), nr = /* @__PURE__ */ f(function(e, t) {
2778
+ const {
2779
+ SOLID_ARROW_TOP_REVERSE: a,
2780
+ SOLID_ARROW_TOP_REVERSE_DOTTED: r,
2781
+ SOLID_ARROW_BOTTOM_REVERSE: i,
2782
+ SOLID_ARROW_BOTTOM_REVERSE_DOTTED: c,
2783
+ STICK_ARROW_TOP_REVERSE: s,
2784
+ STICK_ARROW_TOP_REVERSE_DOTTED: n,
2785
+ STICK_ARROW_BOTTOM_REVERSE: p,
2786
+ STICK_ARROW_BOTTOM_REVERSE_DOTTED: d
2787
+ } = t.db.LINETYPE;
2788
+ return [
2789
+ a,
2790
+ r,
2791
+ i,
2792
+ c,
2793
+ s,
2794
+ n,
2795
+ p,
2796
+ d
2797
+ ].includes(e.type);
2798
+ }, "isReverseArrowType"), Ia = /* @__PURE__ */ f(function(e, t) {
2799
+ const { BIDIRECTIONAL_SOLID: a, BIDIRECTIONAL_DOTTED: r } = t.db.LINETYPE;
2800
+ return [a, r].includes(e.type);
2801
+ }, "isBidirectionalArrowType"), Ra = /* @__PURE__ */ f(function(e, t, a) {
2802
+ const { look: r } = j();
2803
+ if (![
2804
+ a.db.LINETYPE.SOLID_OPEN,
2805
+ a.db.LINETYPE.DOTTED_OPEN,
2806
+ a.db.LINETYPE.SOLID,
2807
+ a.db.LINETYPE.SOLID_TOP,
2808
+ a.db.LINETYPE.SOLID_BOTTOM,
2809
+ a.db.LINETYPE.STICK_TOP,
2810
+ a.db.LINETYPE.STICK_BOTTOM,
2811
+ a.db.LINETYPE.SOLID_TOP_DOTTED,
2812
+ a.db.LINETYPE.SOLID_BOTTOM_DOTTED,
2813
+ a.db.LINETYPE.STICK_TOP_DOTTED,
2814
+ a.db.LINETYPE.STICK_BOTTOM_DOTTED,
2815
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2816
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
2817
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2818
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2819
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2820
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2821
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2822
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2823
+ a.db.LINETYPE.DOTTED,
2824
+ a.db.LINETYPE.SOLID_CROSS,
2825
+ a.db.LINETYPE.DOTTED_CROSS,
2826
+ a.db.LINETYPE.SOLID_POINT,
2827
+ a.db.LINETYPE.DOTTED_POINT,
2828
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2829
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED
2830
+ ].includes(e.type))
2831
+ return {};
2832
+ const [i, c] = qe(e.from, t), [s, n] = qe(e.to, t), p = i <= s;
2833
+ let d = p ? c : i, E = p ? s : n;
2834
+ r === "neo" && (e.type !== a.db.LINETYPE.SOLID_OPEN && (E += p ? -3 : 3), (e.type === a.db.LINETYPE.BIDIRECTIONAL_SOLID || e.type === a.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (d += p ? 3 : -3)), d += ya(e, a, p);
2835
+ const u = Math.abs(s - n) > 2, _ = /* @__PURE__ */ f((h) => p ? -h : h, "adjustValue");
2836
+ e.from === e.to ? E = d : (e.activate && !u && (E += _(l.activationWidth / 2 - 1)), [
2837
+ a.db.LINETYPE.SOLID_OPEN,
2838
+ a.db.LINETYPE.DOTTED_OPEN,
2839
+ a.db.LINETYPE.STICK_TOP,
2840
+ a.db.LINETYPE.STICK_BOTTOM,
2841
+ a.db.LINETYPE.STICK_TOP_DOTTED,
2842
+ a.db.LINETYPE.STICK_BOTTOM_DOTTED,
2843
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2844
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2845
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2846
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2847
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2848
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2849
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2850
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
2851
+ ].includes(e.type) || (E += _(3)), [
2852
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2853
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED,
2854
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2855
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2856
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2857
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
2858
+ ].includes(e.type) && (d -= _(3)));
2859
+ const L = [i, c, s, n], g = Math.abs(d - E);
2860
+ e.wrap && e.message && (e.message = Q.wrapLabel(
2861
+ e.message,
2862
+ N.getMax(g + 2 * l.wrapPadding, l.width),
2863
+ bt(l)
2864
+ ));
2865
+ const R = Q.calculateTextDimensions(e.message, bt(l));
2866
+ return {
2867
+ width: N.getMax(
2868
+ e.wrap ? 0 : R.width + 2 * l.wrapPadding,
2869
+ g + 2 * l.wrapPadding,
2870
+ l.width
2871
+ ),
2872
+ height: 0,
2873
+ startx: d,
2874
+ stopx: E,
2875
+ starty: 0,
2876
+ stopy: 0,
2877
+ message: e.message,
2878
+ type: e.type,
2879
+ wrap: e.wrap,
2880
+ fromBounds: Math.min.apply(null, L),
2881
+ toBounds: Math.max.apply(null, L)
2882
+ };
2883
+ }, "buildMessageModel"), Oa = /* @__PURE__ */ f(async function(e, t, a, r) {
2884
+ const i = {}, c = [];
2885
+ let s, n, p;
2886
+ for (const d of e) {
2887
+ switch (d.type) {
2888
+ case r.db.LINETYPE.LOOP_START:
2889
+ case r.db.LINETYPE.ALT_START:
2890
+ case r.db.LINETYPE.OPT_START:
2891
+ case r.db.LINETYPE.PAR_START:
2892
+ case r.db.LINETYPE.PAR_OVER_START:
2893
+ case r.db.LINETYPE.CRITICAL_START:
2894
+ case r.db.LINETYPE.BREAK_START:
2895
+ c.push({
2896
+ id: d.id,
2897
+ msg: d.message,
2898
+ from: Number.MAX_SAFE_INTEGER,
2899
+ to: Number.MIN_SAFE_INTEGER,
2900
+ width: 0
2901
+ });
2902
+ break;
2903
+ case r.db.LINETYPE.ALT_ELSE:
2904
+ case r.db.LINETYPE.PAR_AND:
2905
+ case r.db.LINETYPE.CRITICAL_OPTION:
2906
+ d.message && (s = c.pop(), i[s.id] = s, i[d.id] = s, c.push(s));
2907
+ break;
2908
+ case r.db.LINETYPE.LOOP_END:
2909
+ case r.db.LINETYPE.ALT_END:
2910
+ case r.db.LINETYPE.OPT_END:
2911
+ case r.db.LINETYPE.PAR_END:
2912
+ case r.db.LINETYPE.CRITICAL_END:
2913
+ case r.db.LINETYPE.BREAK_END:
2914
+ s = c.pop(), i[s.id] = s;
2915
+ break;
2916
+ case r.db.LINETYPE.ACTIVE_START:
2917
+ {
2918
+ const u = t.get(d.from ? d.from : d.to.actor), _ = Zt(d.from ? d.from : d.to.actor).length, L = u.x + u.width / 2 + (_ - 1) * l.activationWidth / 2, g = {
2919
+ startx: L,
2920
+ stopx: L + l.activationWidth,
2921
+ actor: d.from,
2922
+ enabled: !0
2923
+ };
2924
+ I.activations.push(g);
2925
+ }
2926
+ break;
2927
+ case r.db.LINETYPE.ACTIVE_END:
2928
+ {
2929
+ const u = I.activations.map((_) => _.actor).lastIndexOf(d.from);
2930
+ I.activations.splice(u, 1).splice(0, 1);
2931
+ }
2932
+ break;
2933
+ }
2934
+ d.placement !== void 0 ? (n = await ga(d, t, r), d.noteModel = n, c.forEach((u) => {
2935
+ s = u, s.from = N.getMin(s.from, n.startx), s.to = N.getMax(s.to, n.startx + n.width), s.width = N.getMax(s.width, Math.abs(s.from - s.to)) - l.labelBoxWidth;
2936
+ })) : (p = Ra(d, t, r), d.msgModel = p, p.startx && p.stopx && c.length > 0 && c.forEach((u) => {
2937
+ if (s = u, p.startx === p.stopx) {
2938
+ const _ = t.get(d.from), L = t.get(d.to);
2939
+ s.from = N.getMin(
2940
+ _.x - p.width / 2,
2941
+ _.x - _.width / 2,
2942
+ s.from
2943
+ ), s.to = N.getMax(
2944
+ L.x + p.width / 2,
2945
+ L.x + _.width / 2,
2946
+ s.to
2947
+ ), s.width = N.getMax(s.width, Math.abs(s.to - s.from)) - l.labelBoxWidth;
2948
+ } else
2949
+ s.from = N.getMin(p.startx, s.from), s.to = N.getMax(p.stopx, s.to), s.width = N.getMax(s.width, p.width) - l.labelBoxWidth;
2950
+ }));
2951
+ }
2952
+ return I.activations = [], nt.debug("Loop type widths:", i), i;
2953
+ }, "calculateLoopBounds"), La = {
2954
+ bounds: I,
2955
+ drawActors: oe,
2956
+ drawActorsPopup: er,
2957
+ setConf: rr,
2958
+ draw: fa
2959
+ }, Aa = {
2960
+ parser: Ar,
2961
+ get db() {
2962
+ return new kr();
2963
+ },
2964
+ renderer: La,
2965
+ styles: vr,
2966
+ init: /* @__PURE__ */ f((e) => {
2967
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, pr({ sequence: { wrap: e.wrap } }));
2968
+ }, "init")
2969
+ };
2970
+ export {
2971
+ Aa as diagram
2972
+ };