@marimo-team/islands 0.15.1 → 0.15.3

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 (189) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DIy_POzQ.js → ConnectedDataExplorerComponent-DfvW3rBn.js} +323 -328
  2. package/dist/{ImageComparisonComponent-4ehfWTqN.js → ImageComparisonComponent-XaJshw7d.js} +13 -13
  3. package/dist/{_baseUniq-Duh9chhg.js → _baseUniq-dN9WKF9m.js} +67 -67
  4. package/dist/any-language-editor-CpFniVi-.js +27 -0
  5. package/dist/{arc-BXrety1g.js → arc-BOhn-m2C.js} +1 -1
  6. package/dist/{architectureDiagram-KFL7JDKH-3xVup6Z2.js → architectureDiagram-W76B3OCA-Bpg85ZKv.js} +144 -144
  7. package/dist/assets/{worker-COGufAQn.js → worker-Y-Q4G-N2.js} +30 -26
  8. package/dist/asterisk-DS281yxp.js +271 -0
  9. package/dist/{blockDiagram-ZYB65J3Q-eEZ6LTIH.js → blockDiagram-QIGZ2CNN-DS1kOHlW.js} +10 -10
  10. package/dist/{c4Diagram-AAMF2YG6-BqjOo55d.js → c4Diagram-FPNF74CW-CyRVKssw.js} +8 -8
  11. package/dist/{channel-BkhHQVue.js → channel-BilGXox7.js} +1 -1
  12. package/dist/{chunk-ANTBXLJU-BkLYh6ot.js → chunk-4BX2VUAB-CZR39zCO.js} +1 -1
  13. package/dist/{chunk-WVR4S24B-DpdvazVp.js → chunk-55IACEB6-BIH-MYov.js} +1 -1
  14. package/dist/{chunk-GLLZNHP4-BGaltx6Q.js → chunk-FMBD7UC4-4PZXFZE8.js} +1 -1
  15. package/dist/{chunk-JBRWN2VN-BZ3JgjiU.js → chunk-K7UQS3LO-CEvWKznk.js} +117 -117
  16. package/dist/{chunk-NRVI72HA-XO3jKXGr.js → chunk-QN33PNHL-D5LO5Jq_.js} +1 -1
  17. package/dist/{chunk-FHKO5MBM-BqvR49qe.js → chunk-QZHKN3VN-6gwUonWI.js} +1 -1
  18. package/dist/{chunk-LXBSTHXV-CJgOmuuc.js → chunk-TVAH2DTR-3gm06QdU.js} +7 -7
  19. package/dist/{chunk-OMD6QJNC-1rwXYaVn.js → chunk-TZMSLE5B-Cm8Iy9bO.js} +1 -1
  20. package/dist/{classDiagram-v2-QTMF73CY-_BeLc0pY.js → classDiagram-KNZD7YFC-DC529O_z.js} +2 -2
  21. package/dist/{classDiagram-3BZAVTQC-_BeLc0pY.js → classDiagram-v2-RKCZMP56-DC529O_z.js} +2 -2
  22. package/dist/{clone-DhXjmfNH.js → clone-CLoRX3j6.js} +1 -1
  23. package/dist/cose-bilkent-S5V4N54A-qf5DlS6Y.js +2609 -0
  24. package/dist/{cytoscape.esm-BYnVVhJX.js → cytoscape.esm-DfdJODL8.js} +34 -34
  25. package/dist/{dagre-2BBEFEWP-DoebA2zc.js → dagre-5GWH7T2D-Ceocls0m.js} +6 -6
  26. package/dist/{data-grid-overlay-editor-DYmc5v9I.js → data-grid-overlay-editor-AqDS_UKe.js} +11 -11
  27. package/dist/{diagram-4IRLE6MV-CxnJ439S.js → diagram-N5W7TBWH-CP66oSiv.js} +59 -60
  28. package/dist/{diagram-RP2FKANI-C-v51IXB.js → diagram-QEK2KX5R-_YD4kxxi.js} +15 -15
  29. package/dist/{diagram-GUPCWM2R-B7MLfHE7.js → diagram-S2PKOQOG-Cnj8T-OP.js} +10 -10
  30. package/dist/dockerfile-Cm8cRYCN.js +194 -0
  31. package/dist/ebnf-DUPDuY4r.js +78 -0
  32. package/dist/{erDiagram-HZWUO2LU-Cv1Slpwd.js → erDiagram-AWTI2OKA-CGnvoHx6.js} +8 -8
  33. package/dist/fcl-CPC2WYrI.js +103 -0
  34. package/dist/{flowDiagram-THRYKUMA-CnjAkcKg.js → flowDiagram-PVAE7QVJ-DG-pr9R9.js} +9 -9
  35. package/dist/{ganttDiagram-WV7ZQ7D5-CRQQ5cqP.js → ganttDiagram-OWAHRB6G-JmChtxvn.js} +34 -34
  36. package/dist/{gitGraphDiagram-OJR772UL-a7Wl_pP8.js → gitGraphDiagram-NY62KEGX-D8wLfOPd.js} +4 -4
  37. package/dist/{glide-data-editor-DrSTYUHP.js → glide-data-editor-9nC3iCIZ.js} +33 -33
  38. package/dist/{graph-Dq4lx1WI.js → graph-CoRe7vAN.js} +3 -3
  39. package/dist/http-D9LttvKF.js +44 -0
  40. package/dist/{index-B_t2cVfJ.js → index-6qYeHHjQ.js} +33090 -32892
  41. package/dist/{index-BhnWrXVh.js → index-BpzLh4Qe.js} +7711 -7711
  42. package/dist/{index-DSAnCCyV.js → index-BthgsgYX.js} +6 -6
  43. package/dist/{index-pBmAzQJl.js → index-MCx5v1x0.js} +2 -2
  44. package/dist/index-jkm77Jrz.js +98 -0
  45. package/dist/{infoDiagram-6WOFNB3A-B4pr_cke.js → infoDiagram-STP46IZ2-BlXxvOrR.js} +2 -2
  46. package/dist/{journeyDiagram-FFXJYRFH-CF8H9tcV.js → journeyDiagram-BIP6EPQ6-CNRYs_Fc.js} +24 -26
  47. package/dist/{kanban-definition-KOZQBZVT-BYfBCo4W.js → kanban-definition-6OIFK2YF-B9HeMAuP.js} +14 -14
  48. package/dist/{layout-D8_YOjKz.js → layout-m2vOUiW1.js} +81 -81
  49. package/dist/{linear-Be5SurQB.js → linear-DU6Q5CX3.js} +35 -35
  50. package/dist/{main-8IC_V2L6.js → main-BD2KGFpU.js} +74594 -68034
  51. package/dist/main.js +1 -1
  52. package/dist/{mermaid-B4v-qVXz.js → mermaid-HVCtvbyx.js} +6160 -7493
  53. package/dist/min-DcGMA4e_.js +80 -0
  54. package/dist/mindmap-definition-Q6HEUPPD-BW8UmIDQ.js +785 -0
  55. package/dist/nginx-zDPm3Z74.js +89 -0
  56. package/dist/{number-overlay-editor-XASk1ikZ.js → number-overlay-editor-D8Hl0Syo.js} +19 -19
  57. package/dist/{pieDiagram-DBDJKBY4-DhPX65dy.js → pieDiagram-ADFJNKIX-Bg-3zg5U.js} +17 -17
  58. package/dist/{quadrantDiagram-YPSRARAO-BjPa8bg5.js → quadrantDiagram-LMRXKWRM-BO4IG6Yz.js} +6 -6
  59. package/dist/{react-plotly-C_6SNkG9.js → react-plotly-dkvHVuRb.js} +3577 -3577
  60. package/dist/{requirementDiagram-EGVEC5DT-CtN_U9bI.js → requirementDiagram-4UW4RH46-5sdTguSM.js} +7 -7
  61. package/dist/{sankeyDiagram-HRAUVNP4-DVi73SZP.js → sankeyDiagram-GR3RE2ED-Buhlv9OI.js} +5 -5
  62. package/dist/sequenceDiagram-C3RYC4MD-C3qsM2UP.js +2519 -0
  63. package/dist/{slides-component-ML7vxRcD.js → slides-component-D209A0-s.js} +66 -66
  64. package/dist/solr-BNlsLglM.js +41 -0
  65. package/dist/spreadsheet-C-cy4P5N.js +49 -0
  66. package/dist/{stateDiagram-UUKSUZ4H-qZ62tNIz.js → stateDiagram-KXAO66HF-CopJ7G6P.js} +5 -5
  67. package/dist/{stateDiagram-v2-EYPG3UTE-BZEyTMgl.js → stateDiagram-v2-UMBNRL4Z-CejL8AKf.js} +2 -2
  68. package/dist/style.css +1 -1
  69. package/dist/tiddlywiki-5wqsXtSk.js +155 -0
  70. package/dist/tiki-__Kn3CeS.js +181 -0
  71. package/dist/{time-CZ2vTSO2.js → time-BwSBitlN.js} +58 -58
  72. package/dist/{timeline-definition-3HZDQTIS-DbWMwd1x.js → timeline-definition-XQNQX7LJ-DzMNTX-C.js} +10 -12
  73. package/dist/{timer-BYwnU4DF.js → timer-B0-z63CM.js} +16 -16
  74. package/dist/{treemap-75Q7IDZK-CocR-oAZ.js → treemap-75Q7IDZK-zeJG07dk.js} +14 -14
  75. package/dist/{vega-component-BrYek_kz.js → vega-component-CUkiTayd.js} +30 -30
  76. package/dist/{xychartDiagram-FDP5SA34-CYiUdiy5.js → xychartDiagram-6GGTOJPD-DiENNXMS.js} +7 -7
  77. package/package.json +39 -39
  78. package/src/__mocks__/notebook.ts +3 -0
  79. package/src/__mocks__/requests.ts +3 -0
  80. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +12 -12
  81. package/src/__tests__/chat-utils.test.ts +26 -211
  82. package/src/components/ai/ai-model-dropdown.tsx +25 -9
  83. package/src/components/app-config/ai-config.tsx +7 -0
  84. package/src/components/chat/chat-components.tsx +71 -0
  85. package/src/components/chat/chat-panel.tsx +481 -291
  86. package/src/components/chat/chat-utils.ts +50 -0
  87. package/src/components/chat/markdown-renderer.tsx +3 -7
  88. package/src/components/chat/tool-call-accordion.tsx +5 -5
  89. package/src/components/datasources/__tests__/utils.test.ts +6 -0
  90. package/src/components/datasources/column-preview.tsx +1 -3
  91. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  92. package/src/components/editor/ai/add-cell-with-ai.tsx +20 -15
  93. package/src/components/editor/ai/ai-completion-editor.tsx +22 -3
  94. package/src/components/editor/ai/completion-handlers.tsx +2 -4
  95. package/src/components/editor/ai/completion-utils.ts +85 -11
  96. package/src/components/editor/alerts/startup-logs-alert.tsx +72 -0
  97. package/src/components/editor/chrome/panels/datasources-panel.tsx +3 -1
  98. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +3 -1
  99. package/src/components/editor/chrome/panels/documentation-panel.tsx +3 -1
  100. package/src/components/editor/chrome/panels/error-panel.tsx +3 -1
  101. package/src/components/editor/chrome/panels/file-explorer-panel.tsx +3 -1
  102. package/src/components/editor/chrome/panels/logs-panel.tsx +3 -1
  103. package/src/components/editor/chrome/panels/outline-panel.tsx +3 -1
  104. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -2
  105. package/src/components/editor/chrome/panels/scratchpad-panel.tsx +3 -1
  106. package/src/components/editor/chrome/panels/secrets-panel.tsx +3 -1
  107. package/src/components/editor/chrome/panels/snippets-panel.tsx +3 -1
  108. package/src/components/editor/chrome/panels/tracing-panel.tsx +3 -1
  109. package/src/components/editor/chrome/panels/variable-panel.tsx +3 -1
  110. package/src/components/editor/chrome/wrapper/app-chrome.tsx +38 -28
  111. package/src/components/editor/controls/command-palette-button.tsx +1 -1
  112. package/src/components/editor/controls/command-palette.tsx +5 -4
  113. package/src/components/editor/controls/state.ts +4 -0
  114. package/src/components/editor/package-alert.tsx +108 -58
  115. package/src/components/editor/renderers/CellArray.tsx +2 -0
  116. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +0 -1
  117. package/src/components/pages/edit-page.tsx +7 -3
  118. package/src/core/ai/chat-utils.ts +26 -43
  119. package/src/core/ai/config.ts +1 -1
  120. package/src/core/ai/context/__tests__/registry.test.ts +277 -3
  121. package/src/core/ai/context/context.ts +11 -1
  122. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +378 -0
  123. package/src/core/ai/context/providers/__tests__/error.test.ts +3 -2
  124. package/src/core/ai/context/providers/__tests__/file.test.ts +119 -0
  125. package/src/core/ai/context/providers/cell-output.ts +349 -0
  126. package/src/core/ai/context/providers/common.ts +5 -1
  127. package/src/core/ai/context/providers/file.ts +287 -0
  128. package/src/core/ai/context/registry.ts +79 -0
  129. package/src/core/ai/state.ts +22 -5
  130. package/src/core/alerts/state.ts +71 -3
  131. package/src/core/cells/cell.ts +2 -2
  132. package/src/core/cells/cells.ts +1 -1
  133. package/src/core/cells/logs.ts +1 -1
  134. package/src/core/cells/runs.ts +6 -5
  135. package/src/core/codemirror/ai/resources.ts +47 -5
  136. package/src/core/codemirror/ai/state.ts +12 -0
  137. package/src/core/codemirror/language/__tests__/sql.test.ts +45 -0
  138. package/src/core/codemirror/markdown/__tests__/commands.test.ts +1 -0
  139. package/src/core/codemirror/theme/dark.ts +1 -1
  140. package/src/core/config/capabilities.ts +1 -1
  141. package/src/core/datasets/__tests__/data-source.test.ts +24 -0
  142. package/src/core/errors/__tests__/errors.test.ts +2 -0
  143. package/src/core/islands/bridge.ts +1 -0
  144. package/src/core/islands/main.ts +1 -0
  145. package/src/core/kernel/messages.ts +12 -6
  146. package/src/core/layout/layout.ts +3 -3
  147. package/src/core/network/requests-network.ts +8 -0
  148. package/src/core/network/requests-static.ts +1 -0
  149. package/src/core/network/requests-toasting.ts +1 -0
  150. package/src/core/network/types.ts +4 -1
  151. package/src/core/wasm/bridge.ts +18 -2
  152. package/src/core/wasm/worker/bootstrap.ts +3 -1
  153. package/src/core/wasm/worker/getMarimoWheel.ts +3 -8
  154. package/src/core/wasm/worker/types.ts +3 -0
  155. package/src/core/websocket/useMarimoWebSocket.tsx +7 -1
  156. package/src/css/app/Cell.css +42 -21
  157. package/src/css/app/codemirror.css +5 -1
  158. package/src/css/globals.css +3 -0
  159. package/src/css/md.css +1 -1
  160. package/src/plugins/impl/MicrophonePlugin.tsx +2 -2
  161. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -9
  162. package/src/plugins/impl/chat/chat-ui.tsx +129 -110
  163. package/src/plugins/impl/chat/types.ts +5 -8
  164. package/src/plugins/impl/code/__tests__/language.test.ts +15 -0
  165. package/src/plugins/impl/code/any-language-editor.tsx +11 -8
  166. package/src/plugins/layout/MimeRenderPlugin.tsx +3 -6
  167. package/src/stories/cell.stories.tsx +6 -0
  168. package/src/stories/layout/vertical/one-column.stories.tsx +215 -0
  169. package/src/theme/useTheme.ts +11 -6
  170. package/src/utils/__tests__/blob.test.ts +37 -0
  171. package/src/utils/arrays.ts +13 -0
  172. package/src/utils/fileToBase64.ts +21 -6
  173. package/src/utils/json/base64.ts +5 -2
  174. package/src/utils/numbers.ts +9 -7
  175. package/dist/any-language-editor-Cvakxnzg.js +0 -45
  176. package/dist/asn1-jKiBa2Ya.js +0 -95
  177. package/dist/clojure-CCKyeQKf.js +0 -800
  178. package/dist/css-BkF-NPzE.js +0 -1553
  179. package/dist/index-CfrpOVe5.js +0 -341
  180. package/dist/index-DIFrY2JV.js +0 -288
  181. package/dist/javascript-C2yteZeJ.js +0 -691
  182. package/dist/min-Q4QXsXWR.js +0 -80
  183. package/dist/mindmap-definition-LNHGMQRG-CebaDS3t.js +0 -3234
  184. package/dist/mllike-BSnXJBGA.js +0 -272
  185. package/dist/pug-CwAQJzGR.js +0 -248
  186. package/dist/python-BkR3uSy8.js +0 -313
  187. package/dist/rpm-IznJm2Xc.js +0 -57
  188. package/dist/sequenceDiagram-WFGC7UMF-C8jImRwI.js +0 -2284
  189. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
@@ -0,0 +1,2519 @@
1
+ var _a;
2
+ import { a as me, b as Kt, g as ct, d as we, c as Xt, e as Jt } from "./chunk-TZMSLE5B-Cm8Iy9bO.js";
3
+ import { _ as f, o as ve, c as st, d as Nt, l as Q, j as ae, e as Ie, f as Le, k as I, b as ee, s as _e, q as Ae, a as ke, g as Pe, t as Ne, v as Se, J as Me, z as Re, i as St, u as W, N as z, O as Lt, P as re, Z as De, Q as Ce, R as ie, G as zt } from "./mermaid-HVCtvbyx.js";
4
+ import { I as Oe } from "./chunk-QZHKN3VN-6gwUonWI.js";
5
+ var Ht = (function() {
6
+ var e = /* @__PURE__ */ f(function(pt, v, A, L) {
7
+ for (A = A || {}, L = pt.length; L--; A[pt[L]] = v) ;
8
+ return A;
9
+ }, "o"), t = [1, 2], n = [1, 3], s = [1, 4], r = [2, 4], i = [1, 9], c = [1, 11], h = [1, 13], o = [1, 14], a = [1, 16], p = [1, 17], g = [1, 18], x = [1, 24], y = [1, 25], m = [1, 26], w = [1, 27], k = [1, 28], N = [1, 29], S = [1, 30], O = [1, 31], B = [1, 32], q = [1, 33], H = [1, 34], Z = [1, 35], at = [1, 36], U = [1, 37], G = [1, 38], F = [1, 39], D = [1, 41], $ = [1, 42], K = [1, 43], j = [1, 44], rt = [1, 45], R = [1, 46], E = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], _ = [2, 71], X = [4, 5, 16, 50, 52, 53], tt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], M = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], Bt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 55, 60, 61, 62, 63, 71], Qt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 55, 60, 61, 62, 63, 71], ot = [69, 70, 71], lt = [1, 127], Vt = {
10
+ trace: /* @__PURE__ */ f(function() {
11
+ }, "trace"),
12
+ yy: {},
13
+ symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, actor_with_config: 54, note: 55, placement: 56, text2: 57, over: 58, actor_pair: 59, links: 60, link: 61, properties: 62, details: 63, spaceList: 64, ",": 65, left_of: 66, right_of: 67, signaltype: 68, "+": 69, "-": 70, ACTOR: 71, config_object: 72, CONFIG_START: 73, CONFIG_CONTENT: 74, CONFIG_END: 75, SOLID_OPEN_ARROW: 76, DOTTED_OPEN_ARROW: 77, SOLID_ARROW: 78, BIDIRECTIONAL_SOLID_ARROW: 79, DOTTED_ARROW: 80, BIDIRECTIONAL_DOTTED_ARROW: 81, SOLID_CROSS: 82, DOTTED_CROSS: 83, SOLID_POINT: 84, DOTTED_POINT: 85, TXT: 86, $accept: 0, $end: 1 },
14
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 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", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 55: "note", 58: "over", 60: "links", 61: "link", 62: "properties", 63: "details", 65: ",", 66: "left_of", 67: "right_of", 69: "+", 70: "-", 71: "ACTOR", 73: "CONFIG_START", 74: "CONFIG_CONTENT", 75: "CONFIG_END", 76: "SOLID_OPEN_ARROW", 77: "DOTTED_OPEN_ARROW", 78: "SOLID_ARROW", 79: "BIDIRECTIONAL_SOLID_ARROW", 80: "DOTTED_ARROW", 81: "BIDIRECTIONAL_DOTTED_ARROW", 82: "SOLID_CROSS", 83: "DOTTED_CROSS", 84: "SOLID_POINT", 85: "DOTTED_POINT", 86: "TXT" },
15
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 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], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [64, 2], [64, 1], [59, 3], [59, 1], [56, 1], [56, 1], [17, 5], [17, 5], [17, 4], [54, 2], [72, 3], [22, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [57, 1]],
16
+ performAction: /* @__PURE__ */ f(function(v, A, L, b, C, d, vt) {
17
+ var u = d.length - 1;
18
+ switch (C) {
19
+ case 3:
20
+ return b.apply(d[u]), d[u];
21
+ case 4:
22
+ case 9:
23
+ this.$ = [];
24
+ break;
25
+ case 5:
26
+ case 10:
27
+ d[u - 1].push(d[u]), this.$ = d[u - 1];
28
+ break;
29
+ case 6:
30
+ case 7:
31
+ case 11:
32
+ case 12:
33
+ this.$ = d[u];
34
+ break;
35
+ case 8:
36
+ case 13:
37
+ this.$ = [];
38
+ break;
39
+ case 15:
40
+ d[u].type = "createParticipant", this.$ = d[u];
41
+ break;
42
+ case 16:
43
+ d[u - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(d[u - 2]) }), d[u - 1].push({ type: "boxEnd", boxText: d[u - 2] }), this.$ = d[u - 1];
44
+ break;
45
+ case 18:
46
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 2]), sequenceIndexStep: Number(d[u - 1]), sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
47
+ break;
48
+ case 19:
49
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
50
+ break;
51
+ case 20:
52
+ this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: b.LINETYPE.AUTONUMBER };
53
+ break;
54
+ case 21:
55
+ this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
56
+ break;
57
+ case 22:
58
+ this.$ = { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: d[u - 1].actor };
59
+ break;
60
+ case 23:
61
+ this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: d[u - 1].actor };
62
+ break;
63
+ case 29:
64
+ b.setDiagramTitle(d[u].substring(6)), this.$ = d[u].substring(6);
65
+ break;
66
+ case 30:
67
+ b.setDiagramTitle(d[u].substring(7)), this.$ = d[u].substring(7);
68
+ break;
69
+ case 31:
70
+ this.$ = d[u].trim(), b.setAccTitle(this.$);
71
+ break;
72
+ case 32:
73
+ case 33:
74
+ this.$ = d[u].trim(), b.setAccDescription(this.$);
75
+ break;
76
+ case 34:
77
+ d[u - 1].unshift({ type: "loopStart", loopText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.LOOP_START }), d[u - 1].push({ type: "loopEnd", loopText: d[u - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = d[u - 1];
78
+ break;
79
+ case 35:
80
+ d[u - 1].unshift({ type: "rectStart", color: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.RECT_START }), d[u - 1].push({ type: "rectEnd", color: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = d[u - 1];
81
+ break;
82
+ case 36:
83
+ d[u - 1].unshift({ type: "optStart", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.OPT_START }), d[u - 1].push({ type: "optEnd", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = d[u - 1];
84
+ break;
85
+ case 37:
86
+ d[u - 1].unshift({ type: "altStart", altText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.ALT_START }), d[u - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = d[u - 1];
87
+ break;
88
+ case 38:
89
+ d[u - 1].unshift({ type: "parStart", parText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.PAR_START }), d[u - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = d[u - 1];
90
+ break;
91
+ case 39:
92
+ d[u - 1].unshift({ type: "parStart", parText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.PAR_OVER_START }), d[u - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = d[u - 1];
93
+ break;
94
+ case 40:
95
+ d[u - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.CRITICAL_START }), d[u - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = d[u - 1];
96
+ break;
97
+ case 41:
98
+ d[u - 1].unshift({ type: "breakStart", breakText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.BREAK_START }), d[u - 1].push({ type: "breakEnd", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = d[u - 1];
99
+ break;
100
+ case 43:
101
+ this.$ = d[u - 3].concat([{ type: "option", optionText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, d[u]]);
102
+ break;
103
+ case 45:
104
+ this.$ = d[u - 3].concat([{ type: "and", parText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.PAR_AND }, d[u]]);
105
+ break;
106
+ case 47:
107
+ this.$ = d[u - 3].concat([{ type: "else", altText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.ALT_ELSE }, d[u]]);
108
+ break;
109
+ case 48:
110
+ d[u - 3].draw = "participant", d[u - 3].type = "addParticipant", d[u - 3].description = b.parseMessage(d[u - 1]), this.$ = d[u - 3];
111
+ break;
112
+ case 49:
113
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
114
+ break;
115
+ case 50:
116
+ d[u - 3].draw = "actor", d[u - 3].type = "addParticipant", d[u - 3].description = b.parseMessage(d[u - 1]), this.$ = d[u - 3];
117
+ break;
118
+ case 51:
119
+ d[u - 1].draw = "actor", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
120
+ break;
121
+ case 52:
122
+ d[u - 1].type = "destroyParticipant", this.$ = d[u - 1];
123
+ break;
124
+ case 53:
125
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
126
+ break;
127
+ case 54:
128
+ this.$ = [d[u - 1], { type: "addNote", placement: d[u - 2], actor: d[u - 1].actor, text: d[u] }];
129
+ break;
130
+ case 55:
131
+ d[u - 2] = [].concat(d[u - 1], d[u - 1]).slice(0, 2), d[u - 2][0] = d[u - 2][0].actor, d[u - 2][1] = d[u - 2][1].actor, this.$ = [d[u - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: d[u - 2].slice(0, 2), text: d[u] }];
132
+ break;
133
+ case 56:
134
+ this.$ = [d[u - 1], { type: "addLinks", actor: d[u - 1].actor, text: d[u] }];
135
+ break;
136
+ case 57:
137
+ this.$ = [d[u - 1], { type: "addALink", actor: d[u - 1].actor, text: d[u] }];
138
+ break;
139
+ case 58:
140
+ this.$ = [d[u - 1], { type: "addProperties", actor: d[u - 1].actor, text: d[u] }];
141
+ break;
142
+ case 59:
143
+ this.$ = [d[u - 1], { type: "addDetails", actor: d[u - 1].actor, text: d[u] }];
144
+ break;
145
+ case 62:
146
+ this.$ = [d[u - 2], d[u]];
147
+ break;
148
+ case 63:
149
+ this.$ = d[u];
150
+ break;
151
+ case 64:
152
+ this.$ = b.PLACEMENT.LEFTOF;
153
+ break;
154
+ case 65:
155
+ this.$ = b.PLACEMENT.RIGHTOF;
156
+ break;
157
+ case 66:
158
+ this.$ = [
159
+ d[u - 4],
160
+ d[u - 1],
161
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u], activate: true },
162
+ { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: d[u - 1].actor }
163
+ ];
164
+ break;
165
+ case 67:
166
+ this.$ = [
167
+ d[u - 4],
168
+ d[u - 1],
169
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u] },
170
+ { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: d[u - 4].actor }
171
+ ];
172
+ break;
173
+ case 68:
174
+ this.$ = [d[u - 3], d[u - 1], { type: "addMessage", from: d[u - 3].actor, to: d[u - 1].actor, signalType: d[u - 2], msg: d[u] }];
175
+ break;
176
+ case 69:
177
+ this.$ = {
178
+ type: "addParticipant",
179
+ actor: d[u - 1],
180
+ config: d[u]
181
+ };
182
+ break;
183
+ case 70:
184
+ this.$ = d[u - 1].trim();
185
+ break;
186
+ case 71:
187
+ this.$ = { type: "addParticipant", actor: d[u] };
188
+ break;
189
+ case 72:
190
+ this.$ = b.LINETYPE.SOLID_OPEN;
191
+ break;
192
+ case 73:
193
+ this.$ = b.LINETYPE.DOTTED_OPEN;
194
+ break;
195
+ case 74:
196
+ this.$ = b.LINETYPE.SOLID;
197
+ break;
198
+ case 75:
199
+ this.$ = b.LINETYPE.BIDIRECTIONAL_SOLID;
200
+ break;
201
+ case 76:
202
+ this.$ = b.LINETYPE.DOTTED;
203
+ break;
204
+ case 77:
205
+ this.$ = b.LINETYPE.BIDIRECTIONAL_DOTTED;
206
+ break;
207
+ case 78:
208
+ this.$ = b.LINETYPE.SOLID_CROSS;
209
+ break;
210
+ case 79:
211
+ this.$ = b.LINETYPE.DOTTED_CROSS;
212
+ break;
213
+ case 80:
214
+ this.$ = b.LINETYPE.SOLID_POINT;
215
+ break;
216
+ case 81:
217
+ this.$ = b.LINETYPE.DOTTED_POINT;
218
+ break;
219
+ case 82:
220
+ this.$ = b.parseMessage(d[u].trim().substring(1));
221
+ break;
222
+ }
223
+ }, "anonymous"),
224
+ table: [{ 3: 1, 4: t, 5: n, 6: s }, { 1: [3] }, { 3: 5, 4: t, 5: n, 6: s }, { 3: 6, 4: t, 5: n, 6: s }, e([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, e(E, [2, 5]), { 9: 47, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, e(E, [2, 7]), e(E, [2, 8]), e(E, [2, 14]), { 12: 48, 50: U, 52: G, 53: F }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 71: R }, { 22: 55, 71: R }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, e(E, [2, 29]), e(E, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, e(E, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 54: 72, 71: [1, 73] }, { 22: 74, 71: R }, { 22: 75, 71: R }, { 68: 76, 76: [1, 77], 77: [1, 78], 78: [1, 79], 79: [1, 80], 80: [1, 81], 81: [1, 82], 82: [1, 83], 83: [1, 84], 84: [1, 85], 85: [1, 86] }, { 56: 87, 58: [1, 88], 66: [1, 89], 67: [1, 90] }, { 22: 91, 71: R }, { 22: 92, 71: R }, { 22: 93, 71: R }, { 22: 94, 71: R }, e([5, 51, 65, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86], _), e(E, [2, 6]), e(E, [2, 15]), e(X, [2, 9], { 10: 95 }), e(E, [2, 17]), { 5: [1, 97], 19: [1, 96] }, { 5: [1, 98] }, e(E, [2, 21]), { 5: [1, 99] }, { 5: [1, 100] }, e(E, [2, 24]), e(E, [2, 25]), e(E, [2, 26]), e(E, [2, 27]), e(E, [2, 28]), e(E, [2, 31]), e(E, [2, 32]), e(tt, r, { 7: 101 }), e(tt, r, { 7: 102 }), e(tt, r, { 7: 103 }), e(M, r, { 40: 104, 7: 105 }), e(Bt, r, { 42: 106, 7: 107 }), e(Bt, r, { 7: 107, 42: 108 }), e(Qt, r, { 45: 109, 7: 110 }), e(tt, r, { 7: 111 }), { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, e([5, 51], _, { 72: 115, 73: [1, 116] }), { 5: [1, 118], 51: [1, 117] }, { 5: [1, 119] }, { 22: 122, 69: [1, 120], 70: [1, 121], 71: R }, e(ot, [2, 72]), e(ot, [2, 73]), e(ot, [2, 74]), e(ot, [2, 75]), e(ot, [2, 76]), e(ot, [2, 77]), e(ot, [2, 78]), e(ot, [2, 79]), e(ot, [2, 80]), e(ot, [2, 81]), { 22: 123, 71: R }, { 22: 125, 59: 124, 71: R }, { 71: [2, 64] }, { 71: [2, 65] }, { 57: 126, 86: lt }, { 57: 128, 86: lt }, { 57: 129, 86: lt }, { 57: 130, 86: lt }, { 4: [1, 133], 5: [1, 135], 11: 132, 12: 134, 16: [1, 131], 50: U, 52: G, 53: F }, { 5: [1, 136] }, e(E, [2, 19]), e(E, [2, 20]), e(E, [2, 22]), e(E, [2, 23]), { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 137], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 138], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 139], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 140] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 46], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 49: [1, 141], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 142] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 44], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 48: [1, 143], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 144] }, { 16: [1, 145] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 42], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 47: [1, 146], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 147], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 15: [1, 148] }, e(E, [2, 49]), e(E, [2, 53]), { 5: [2, 69] }, { 74: [1, 149] }, { 15: [1, 150] }, e(E, [2, 51]), e(E, [2, 52]), { 22: 151, 71: R }, { 22: 152, 71: R }, { 57: 153, 86: lt }, { 57: 154, 86: lt }, { 57: 155, 86: lt }, { 65: [1, 156], 86: [2, 63] }, { 5: [2, 56] }, { 5: [2, 82] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [2, 59] }, e(E, [2, 16]), e(X, [2, 10]), { 12: 157, 50: U, 52: G, 53: F }, e(X, [2, 12]), e(X, [2, 13]), e(E, [2, 18]), e(E, [2, 34]), e(E, [2, 35]), e(E, [2, 36]), e(E, [2, 37]), { 15: [1, 158] }, e(E, [2, 38]), { 15: [1, 159] }, e(E, [2, 39]), e(E, [2, 40]), { 15: [1, 160] }, e(E, [2, 41]), { 5: [1, 161] }, { 75: [1, 162] }, { 5: [1, 163] }, { 57: 164, 86: lt }, { 57: 165, 86: lt }, { 5: [2, 68] }, { 5: [2, 54] }, { 5: [2, 55] }, { 22: 166, 71: R }, e(X, [2, 11]), e(M, r, { 7: 105, 40: 167 }), e(Bt, r, { 7: 107, 42: 168 }), e(Qt, r, { 7: 110, 45: 169 }), e(E, [2, 48]), { 5: [2, 70] }, e(E, [2, 50]), { 5: [2, 66] }, { 5: [2, 67] }, { 86: [2, 62] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
225
+ defaultActions: { 5: [2, 1], 6: [2, 2], 89: [2, 64], 90: [2, 65], 115: [2, 69], 126: [2, 56], 127: [2, 82], 128: [2, 57], 129: [2, 58], 130: [2, 59], 153: [2, 68], 154: [2, 54], 155: [2, 55], 162: [2, 70], 164: [2, 66], 165: [2, 67], 166: [2, 62], 167: [2, 47], 168: [2, 45], 169: [2, 43] },
226
+ parseError: /* @__PURE__ */ f(function(v, A) {
227
+ if (A.recoverable)
228
+ this.trace(v);
229
+ else {
230
+ var L = new Error(v);
231
+ throw L.hash = A, L;
232
+ }
233
+ }, "parseError"),
234
+ parse: /* @__PURE__ */ f(function(v) {
235
+ var A = this, L = [0], b = [], C = [null], d = [], vt = this.table, u = "", At = 0, Zt = 0, ye = 2, $t = 1, Te = d.slice.call(arguments, 1), Y = Object.create(this.lexer), ft = { yy: {} };
236
+ for (var Yt in this.yy)
237
+ Object.prototype.hasOwnProperty.call(this.yy, Yt) && (ft.yy[Yt] = this.yy[Yt]);
238
+ Y.setInput(v, ft.yy), ft.yy.lexer = Y, ft.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
239
+ var Wt = Y.yylloc;
240
+ d.push(Wt);
241
+ var Ee = Y.options && Y.options.ranges;
242
+ typeof ft.yy.parseError == "function" ? this.parseError = ft.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
243
+ function be(et) {
244
+ L.length = L.length - 2 * et, C.length = C.length - et, d.length = d.length - et;
245
+ }
246
+ f(be, "popStack");
247
+ function jt() {
248
+ var et;
249
+ return et = b.pop() || Y.lex() || $t, typeof et != "number" && (et instanceof Array && (b = et, et = b.pop()), et = A.symbols_[et] || et), et;
250
+ }
251
+ f(jt, "lex");
252
+ for (var J, yt, it, Ft, bt = {}, kt, ht, te, Pt; ; ) {
253
+ if (yt = L[L.length - 1], this.defaultActions[yt] ? it = this.defaultActions[yt] : ((J === null || typeof J > "u") && (J = jt()), it = vt[yt] && vt[yt][J]), typeof it > "u" || !it.length || !it[0]) {
254
+ var qt = "";
255
+ Pt = [];
256
+ for (kt in vt[yt])
257
+ this.terminals_[kt] && kt > ye && Pt.push("'" + this.terminals_[kt] + "'");
258
+ Y.showPosition ? qt = "Parse error on line " + (At + 1) + `:
259
+ ` + Y.showPosition() + `
260
+ Expecting ` + Pt.join(", ") + ", got '" + (this.terminals_[J] || J) + "'" : qt = "Parse error on line " + (At + 1) + ": Unexpected " + (J == $t ? "end of input" : "'" + (this.terminals_[J] || J) + "'"), this.parseError(qt, {
261
+ text: Y.match,
262
+ token: this.terminals_[J] || J,
263
+ line: Y.yylineno,
264
+ loc: Wt,
265
+ expected: Pt
266
+ });
267
+ }
268
+ if (it[0] instanceof Array && it.length > 1)
269
+ throw new Error("Parse Error: multiple actions possible at state: " + yt + ", token: " + J);
270
+ switch (it[0]) {
271
+ case 1:
272
+ L.push(J), C.push(Y.yytext), d.push(Y.yylloc), L.push(it[1]), J = null, Zt = Y.yyleng, u = Y.yytext, At = Y.yylineno, Wt = Y.yylloc;
273
+ break;
274
+ case 2:
275
+ if (ht = this.productions_[it[1]][1], bt.$ = C[C.length - ht], bt._$ = {
276
+ first_line: d[d.length - (ht || 1)].first_line,
277
+ last_line: d[d.length - 1].last_line,
278
+ first_column: d[d.length - (ht || 1)].first_column,
279
+ last_column: d[d.length - 1].last_column
280
+ }, Ee && (bt._$.range = [
281
+ d[d.length - (ht || 1)].range[0],
282
+ d[d.length - 1].range[1]
283
+ ]), Ft = this.performAction.apply(bt, [
284
+ u,
285
+ Zt,
286
+ At,
287
+ ft.yy,
288
+ it[1],
289
+ C,
290
+ d
291
+ ].concat(Te)), typeof Ft < "u")
292
+ return Ft;
293
+ ht && (L = L.slice(0, -1 * ht * 2), C = C.slice(0, -1 * ht), d = d.slice(0, -1 * ht)), L.push(this.productions_[it[1]][0]), C.push(bt.$), d.push(bt._$), te = vt[L[L.length - 2]][L[L.length - 1]], L.push(te);
294
+ break;
295
+ case 3:
296
+ return true;
297
+ }
298
+ }
299
+ return true;
300
+ }, "parse")
301
+ }, fe = /* @__PURE__ */ (function() {
302
+ var pt = {
303
+ EOF: 1,
304
+ parseError: /* @__PURE__ */ f(function(A, L) {
305
+ if (this.yy.parser)
306
+ this.yy.parser.parseError(A, L);
307
+ else
308
+ throw new Error(A);
309
+ }, "parseError"),
310
+ // resets the lexer, sets new input
311
+ setInput: /* @__PURE__ */ f(function(v, A) {
312
+ return this.yy = A || this.yy || {}, this._input = v, this._more = this._backtrack = this.done = false, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
313
+ first_line: 1,
314
+ first_column: 0,
315
+ last_line: 1,
316
+ last_column: 0
317
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
318
+ }, "setInput"),
319
+ // consumes and returns one char from the input
320
+ input: /* @__PURE__ */ f(function() {
321
+ var v = this._input[0];
322
+ this.yytext += v, this.yyleng++, this.offset++, this.match += v, this.matched += v;
323
+ var A = v.match(/(?:\r\n?|\n).*/g);
324
+ return A ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), v;
325
+ }, "input"),
326
+ // unshifts one char (or a string) into the input
327
+ unput: /* @__PURE__ */ f(function(v) {
328
+ var A = v.length, L = v.split(/(?:\r\n?|\n)/g);
329
+ this._input = v + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - A), this.offset -= A;
330
+ var b = this.match.split(/(?:\r\n?|\n)/g);
331
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), L.length - 1 && (this.yylineno -= L.length - 1);
332
+ var C = this.yylloc.range;
333
+ return this.yylloc = {
334
+ first_line: this.yylloc.first_line,
335
+ last_line: this.yylineno + 1,
336
+ first_column: this.yylloc.first_column,
337
+ last_column: L ? (L.length === b.length ? this.yylloc.first_column : 0) + b[b.length - L.length].length - L[0].length : this.yylloc.first_column - A
338
+ }, this.options.ranges && (this.yylloc.range = [C[0], C[0] + this.yyleng - A]), this.yyleng = this.yytext.length, this;
339
+ }, "unput"),
340
+ // When called from action, caches matched text and appends it on next action
341
+ more: /* @__PURE__ */ f(function() {
342
+ return this._more = true, this;
343
+ }, "more"),
344
+ // 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.
345
+ reject: /* @__PURE__ */ f(function() {
346
+ if (this.options.backtrack_lexer)
347
+ this._backtrack = true;
348
+ else
349
+ 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).
350
+ ` + this.showPosition(), {
351
+ text: "",
352
+ token: null,
353
+ line: this.yylineno
354
+ });
355
+ return this;
356
+ }, "reject"),
357
+ // retain first n characters of the match
358
+ less: /* @__PURE__ */ f(function(v) {
359
+ this.unput(this.match.slice(v));
360
+ }, "less"),
361
+ // displays already matched input, i.e. for error messages
362
+ pastInput: /* @__PURE__ */ f(function() {
363
+ var v = this.matched.substr(0, this.matched.length - this.match.length);
364
+ return (v.length > 20 ? "..." : "") + v.substr(-20).replace(/\n/g, "");
365
+ }, "pastInput"),
366
+ // displays upcoming input, i.e. for error messages
367
+ upcomingInput: /* @__PURE__ */ f(function() {
368
+ var v = this.match;
369
+ return v.length < 20 && (v += this._input.substr(0, 20 - v.length)), (v.substr(0, 20) + (v.length > 20 ? "..." : "")).replace(/\n/g, "");
370
+ }, "upcomingInput"),
371
+ // displays the character position where the lexing error occurred, i.e. for error messages
372
+ showPosition: /* @__PURE__ */ f(function() {
373
+ var v = this.pastInput(), A = new Array(v.length + 1).join("-");
374
+ return v + this.upcomingInput() + `
375
+ ` + A + "^";
376
+ }, "showPosition"),
377
+ // test the lexed token: return FALSE when not a match, otherwise return token
378
+ test_match: /* @__PURE__ */ f(function(v, A) {
379
+ var L, b, C;
380
+ if (this.options.backtrack_lexer && (C = {
381
+ yylineno: this.yylineno,
382
+ yylloc: {
383
+ first_line: this.yylloc.first_line,
384
+ last_line: this.last_line,
385
+ first_column: this.yylloc.first_column,
386
+ last_column: this.yylloc.last_column
387
+ },
388
+ yytext: this.yytext,
389
+ match: this.match,
390
+ matches: this.matches,
391
+ matched: this.matched,
392
+ yyleng: this.yyleng,
393
+ offset: this.offset,
394
+ _more: this._more,
395
+ _input: this._input,
396
+ yy: this.yy,
397
+ conditionStack: this.conditionStack.slice(0),
398
+ done: this.done
399
+ }, this.options.ranges && (C.yylloc.range = this.yylloc.range.slice(0))), b = v[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
400
+ first_line: this.yylloc.last_line,
401
+ last_line: this.yylineno + 1,
402
+ first_column: this.yylloc.last_column,
403
+ last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + v[0].length
404
+ }, this.yytext += v[0], this.match += v[0], this.matches = v, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = false, this._backtrack = false, this._input = this._input.slice(v[0].length), this.matched += v[0], L = this.performAction.call(this, this.yy, this, A, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = false), L)
405
+ return L;
406
+ if (this._backtrack) {
407
+ for (var d in C)
408
+ this[d] = C[d];
409
+ return false;
410
+ }
411
+ return false;
412
+ }, "test_match"),
413
+ // return next match in input
414
+ next: /* @__PURE__ */ f(function() {
415
+ if (this.done)
416
+ return this.EOF;
417
+ this._input || (this.done = true);
418
+ var v, A, L, b;
419
+ this._more || (this.yytext = "", this.match = "");
420
+ for (var C = this._currentRules(), d = 0; d < C.length; d++)
421
+ if (L = this._input.match(this.rules[C[d]]), L && (!A || L[0].length > A[0].length)) {
422
+ if (A = L, b = d, this.options.backtrack_lexer) {
423
+ if (v = this.test_match(L, C[d]), v !== false)
424
+ return v;
425
+ if (this._backtrack) {
426
+ A = false;
427
+ continue;
428
+ } else
429
+ return false;
430
+ } else if (!this.options.flex)
431
+ break;
432
+ }
433
+ return A ? (v = this.test_match(A, C[b]), v !== false ? v : false) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
434
+ ` + this.showPosition(), {
435
+ text: "",
436
+ token: null,
437
+ line: this.yylineno
438
+ });
439
+ }, "next"),
440
+ // return next match that has a token
441
+ lex: /* @__PURE__ */ f(function() {
442
+ var A = this.next();
443
+ return A || this.lex();
444
+ }, "lex"),
445
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
446
+ begin: /* @__PURE__ */ f(function(A) {
447
+ this.conditionStack.push(A);
448
+ }, "begin"),
449
+ // pop the previously active lexer condition state off the condition stack
450
+ popState: /* @__PURE__ */ f(function() {
451
+ var A = this.conditionStack.length - 1;
452
+ return A > 0 ? this.conditionStack.pop() : this.conditionStack[0];
453
+ }, "popState"),
454
+ // produce the lexer rule set which is active for the currently active lexer condition state
455
+ _currentRules: /* @__PURE__ */ f(function() {
456
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
457
+ }, "_currentRules"),
458
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
459
+ topState: /* @__PURE__ */ f(function(A) {
460
+ return A = this.conditionStack.length - 1 - Math.abs(A || 0), A >= 0 ? this.conditionStack[A] : "INITIAL";
461
+ }, "topState"),
462
+ // alias for begin(condition)
463
+ pushState: /* @__PURE__ */ f(function(A) {
464
+ this.begin(A);
465
+ }, "pushState"),
466
+ // return the number of states currently on the stack
467
+ stateStackSize: /* @__PURE__ */ f(function() {
468
+ return this.conditionStack.length;
469
+ }, "stateStackSize"),
470
+ options: { "case-insensitive": true },
471
+ performAction: /* @__PURE__ */ f(function(A, L, b, C) {
472
+ switch (b) {
473
+ case 0:
474
+ return 5;
475
+ case 1:
476
+ break;
477
+ case 2:
478
+ break;
479
+ case 3:
480
+ break;
481
+ case 4:
482
+ break;
483
+ case 5:
484
+ break;
485
+ case 6:
486
+ return 19;
487
+ case 7:
488
+ return this.begin("CONFIG"), 73;
489
+ case 8:
490
+ return 74;
491
+ case 9:
492
+ return this.popState(), this.popState(), 75;
493
+ case 10:
494
+ return L.yytext = L.yytext.trim(), 71;
495
+ case 11:
496
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
497
+ case 12:
498
+ return this.begin("LINE"), 14;
499
+ case 13:
500
+ return this.begin("ID"), 50;
501
+ case 14:
502
+ return this.begin("ID"), 52;
503
+ case 15:
504
+ return 13;
505
+ case 16:
506
+ return this.begin("ID"), 53;
507
+ case 17:
508
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
509
+ case 18:
510
+ return this.popState(), this.popState(), this.begin("LINE"), 51;
511
+ case 19:
512
+ return this.popState(), this.popState(), 5;
513
+ case 20:
514
+ return this.begin("LINE"), 36;
515
+ case 21:
516
+ return this.begin("LINE"), 37;
517
+ case 22:
518
+ return this.begin("LINE"), 38;
519
+ case 23:
520
+ return this.begin("LINE"), 39;
521
+ case 24:
522
+ return this.begin("LINE"), 49;
523
+ case 25:
524
+ return this.begin("LINE"), 41;
525
+ case 26:
526
+ return this.begin("LINE"), 43;
527
+ case 27:
528
+ return this.begin("LINE"), 48;
529
+ case 28:
530
+ return this.begin("LINE"), 44;
531
+ case 29:
532
+ return this.begin("LINE"), 47;
533
+ case 30:
534
+ return this.begin("LINE"), 46;
535
+ case 31:
536
+ return this.popState(), 15;
537
+ case 32:
538
+ return 16;
539
+ case 33:
540
+ return 66;
541
+ case 34:
542
+ return 67;
543
+ case 35:
544
+ return 60;
545
+ case 36:
546
+ return 61;
547
+ case 37:
548
+ return 62;
549
+ case 38:
550
+ return 63;
551
+ case 39:
552
+ return 58;
553
+ case 40:
554
+ return 55;
555
+ case 41:
556
+ return this.begin("ID"), 21;
557
+ case 42:
558
+ return this.begin("ID"), 23;
559
+ case 43:
560
+ return 29;
561
+ case 44:
562
+ return 30;
563
+ case 45:
564
+ return this.begin("acc_title"), 31;
565
+ case 46:
566
+ return this.popState(), "acc_title_value";
567
+ case 47:
568
+ return this.begin("acc_descr"), 33;
569
+ case 48:
570
+ return this.popState(), "acc_descr_value";
571
+ case 49:
572
+ this.begin("acc_descr_multiline");
573
+ break;
574
+ case 50:
575
+ this.popState();
576
+ break;
577
+ case 51:
578
+ return "acc_descr_multiline_value";
579
+ case 52:
580
+ return 6;
581
+ case 53:
582
+ return 18;
583
+ case 54:
584
+ return 20;
585
+ case 55:
586
+ return 65;
587
+ case 56:
588
+ return 5;
589
+ case 57:
590
+ return L.yytext = L.yytext.trim(), 71;
591
+ case 58:
592
+ return 78;
593
+ case 59:
594
+ return 79;
595
+ case 60:
596
+ return 80;
597
+ case 61:
598
+ return 81;
599
+ case 62:
600
+ return 76;
601
+ case 63:
602
+ return 77;
603
+ case 64:
604
+ return 82;
605
+ case 65:
606
+ return 83;
607
+ case 66:
608
+ return 84;
609
+ case 67:
610
+ return 85;
611
+ case 68:
612
+ return 86;
613
+ case 69:
614
+ return 86;
615
+ case 70:
616
+ return 69;
617
+ case 71:
618
+ return 70;
619
+ case 72:
620
+ return 5;
621
+ case 73:
622
+ return "INVALID";
623
+ }
624
+ }, "anonymous"),
625
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\})/i, /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i, /^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/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\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/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, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
626
+ conditions: { acc_descr_multiline: { rules: [50, 51], inclusive: false }, acc_descr: { rules: [48], inclusive: false }, acc_title: { rules: [46], inclusive: false }, ID: { rules: [2, 3, 7, 10, 11, 17], inclusive: false }, ALIAS: { rules: [2, 3, 18, 19], inclusive: false }, LINE: { rules: [2, 3, 31], inclusive: false }, CONFIG: { rules: [8, 9], inclusive: false }, CONFIG_DATA: { rules: [], inclusive: false }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], inclusive: true } }
627
+ };
628
+ return pt;
629
+ })();
630
+ Vt.lexer = fe;
631
+ function _t() {
632
+ this.yy = {};
633
+ }
634
+ return f(_t, "Parser"), _t.prototype = Vt, Vt.Parser = _t, new _t();
635
+ })();
636
+ Ht.parser = Ht;
637
+ var Be = Ht, Ve = {
638
+ SOLID: 0,
639
+ DOTTED: 1,
640
+ NOTE: 2,
641
+ SOLID_CROSS: 3,
642
+ DOTTED_CROSS: 4,
643
+ SOLID_OPEN: 5,
644
+ DOTTED_OPEN: 6,
645
+ LOOP_START: 10,
646
+ LOOP_END: 11,
647
+ ALT_START: 12,
648
+ ALT_ELSE: 13,
649
+ ALT_END: 14,
650
+ OPT_START: 15,
651
+ OPT_END: 16,
652
+ ACTIVE_START: 17,
653
+ ACTIVE_END: 18,
654
+ PAR_START: 19,
655
+ PAR_AND: 20,
656
+ PAR_END: 21,
657
+ RECT_START: 22,
658
+ RECT_END: 23,
659
+ SOLID_POINT: 24,
660
+ DOTTED_POINT: 25,
661
+ AUTONUMBER: 26,
662
+ CRITICAL_START: 27,
663
+ CRITICAL_OPTION: 28,
664
+ CRITICAL_END: 29,
665
+ BREAK_START: 30,
666
+ BREAK_END: 31,
667
+ PAR_OVER_START: 32,
668
+ BIDIRECTIONAL_SOLID: 33,
669
+ BIDIRECTIONAL_DOTTED: 34
670
+ }, Ye = {
671
+ FILLED: 0,
672
+ OPEN: 1
673
+ }, We = {
674
+ LEFTOF: 0,
675
+ RIGHTOF: 1,
676
+ OVER: 2
677
+ }, Mt = {
678
+ ACTOR: "actor",
679
+ CONTROL: "control",
680
+ DATABASE: "database",
681
+ ENTITY: "entity"
682
+ }, Fe = (_a = class {
683
+ constructor() {
684
+ this.state = new Oe(() => ({
685
+ prevActor: void 0,
686
+ actors: /* @__PURE__ */ new Map(),
687
+ createdActors: /* @__PURE__ */ new Map(),
688
+ destroyedActors: /* @__PURE__ */ new Map(),
689
+ boxes: [],
690
+ messages: [],
691
+ notes: [],
692
+ sequenceNumbersEnabled: false,
693
+ wrapEnabled: void 0,
694
+ currentBox: void 0,
695
+ lastCreated: void 0,
696
+ lastDestroyed: void 0
697
+ })), this.setAccTitle = ee, this.setAccDescription = _e, this.setDiagramTitle = Ae, this.getAccTitle = ke, this.getAccDescription = Pe, this.getDiagramTitle = Ne, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(st().wrap), this.LINETYPE = Ve, this.ARROWTYPE = Ye, this.PLACEMENT = We;
698
+ }
699
+ addBox(e) {
700
+ this.state.records.boxes.push({
701
+ name: e.text,
702
+ wrap: e.wrap ?? this.autoWrap(),
703
+ fill: e.color,
704
+ actorKeys: []
705
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
706
+ }
707
+ addActor(e, t, n, s, r) {
708
+ let i = this.state.records.currentBox, c;
709
+ if (r !== void 0) {
710
+ let o;
711
+ r.includes(`
712
+ `) ? o = r + `
713
+ ` : o = `{
714
+ ` + r + `
715
+ }`, c = Se(o, { schema: Me });
716
+ }
717
+ s = (c == null ? void 0 : c.type) ?? s;
718
+ const h = this.state.records.actors.get(e);
719
+ if (h) {
720
+ if (this.state.records.currentBox && h.box && this.state.records.currentBox !== h.box)
721
+ throw new Error(
722
+ `A same participant should only be defined in one Box: ${h.name} can't be in '${h.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
723
+ );
724
+ if (i = h.box ? h.box : this.state.records.currentBox, h.box = i, h && t === h.name && n == null)
725
+ return;
726
+ }
727
+ if ((n == null ? void 0 : n.text) == null && (n = { text: t, type: s }), (s == null || n.text == null) && (n = { text: t, type: s }), this.state.records.actors.set(e, {
728
+ box: i,
729
+ name: t,
730
+ description: n.text,
731
+ wrap: n.wrap ?? this.autoWrap(),
732
+ prevActor: this.state.records.prevActor,
733
+ links: {},
734
+ properties: {},
735
+ actorCnt: null,
736
+ rectData: null,
737
+ type: s ?? "participant"
738
+ }), this.state.records.prevActor) {
739
+ const o = this.state.records.actors.get(this.state.records.prevActor);
740
+ o && (o.nextActor = e);
741
+ }
742
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(e), this.state.records.prevActor = e;
743
+ }
744
+ activationCount(e) {
745
+ let t, n = 0;
746
+ if (!e)
747
+ return 0;
748
+ for (t = 0; t < this.state.records.messages.length; t++)
749
+ this.state.records.messages[t].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[t].from === e && n++, this.state.records.messages[t].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[t].from === e && n--;
750
+ return n;
751
+ }
752
+ addMessage(e, t, n, s) {
753
+ this.state.records.messages.push({
754
+ id: this.state.records.messages.length.toString(),
755
+ from: e,
756
+ to: t,
757
+ message: n.text,
758
+ wrap: n.wrap ?? this.autoWrap(),
759
+ answer: s
760
+ });
761
+ }
762
+ addSignal(e, t, n, s, r = false) {
763
+ if (s === this.LINETYPE.ACTIVE_END && this.activationCount(e ?? "") < 1) {
764
+ const c = new Error("Trying to inactivate an inactive participant (" + e + ")");
765
+ throw c.hash = {
766
+ text: "->>-",
767
+ token: "->>-",
768
+ line: "1",
769
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
770
+ expected: ["'ACTIVE_PARTICIPANT'"]
771
+ }, c;
772
+ }
773
+ return this.state.records.messages.push({
774
+ id: this.state.records.messages.length.toString(),
775
+ from: e,
776
+ to: t,
777
+ message: (n == null ? void 0 : n.text) ?? "",
778
+ wrap: (n == null ? void 0 : n.wrap) ?? this.autoWrap(),
779
+ type: s,
780
+ activate: r
781
+ }), true;
782
+ }
783
+ hasAtLeastOneBox() {
784
+ return this.state.records.boxes.length > 0;
785
+ }
786
+ hasAtLeastOneBoxWithTitle() {
787
+ return this.state.records.boxes.some((e) => e.name);
788
+ }
789
+ getMessages() {
790
+ return this.state.records.messages;
791
+ }
792
+ getBoxes() {
793
+ return this.state.records.boxes;
794
+ }
795
+ getActors() {
796
+ return this.state.records.actors;
797
+ }
798
+ getCreatedActors() {
799
+ return this.state.records.createdActors;
800
+ }
801
+ getDestroyedActors() {
802
+ return this.state.records.destroyedActors;
803
+ }
804
+ getActor(e) {
805
+ return this.state.records.actors.get(e);
806
+ }
807
+ getActorKeys() {
808
+ return [...this.state.records.actors.keys()];
809
+ }
810
+ enableSequenceNumbers() {
811
+ this.state.records.sequenceNumbersEnabled = true;
812
+ }
813
+ disableSequenceNumbers() {
814
+ this.state.records.sequenceNumbersEnabled = false;
815
+ }
816
+ showSequenceNumbers() {
817
+ return this.state.records.sequenceNumbersEnabled;
818
+ }
819
+ setWrap(e) {
820
+ this.state.records.wrapEnabled = e;
821
+ }
822
+ extractWrap(e) {
823
+ if (e === void 0)
824
+ return {};
825
+ e = e.trim();
826
+ const t = /^:?wrap:/.exec(e) !== null ? true : /^:?nowrap:/.exec(e) !== null ? false : void 0;
827
+ return { cleanedText: (t === void 0 ? e : e.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: t };
828
+ }
829
+ autoWrap() {
830
+ var _a2;
831
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : ((_a2 = st().sequence) == null ? void 0 : _a2.wrap) ?? false;
832
+ }
833
+ clear() {
834
+ this.state.reset(), Re();
835
+ }
836
+ parseMessage(e) {
837
+ const t = e.trim(), { wrap: n, cleanedText: s } = this.extractWrap(t), r = {
838
+ text: s,
839
+ wrap: n
840
+ };
841
+ return Q.debug(`parseMessage: ${JSON.stringify(r)}`), r;
842
+ }
843
+ // We expect the box statement to be color first then description
844
+ // 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
845
+ // We extract first segment as color, the rest of the line is considered as text
846
+ parseBoxData(e) {
847
+ const t = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);
848
+ let n = (t == null ? void 0 : t[1]) ? t[1].trim() : "transparent", s = (t == null ? void 0 : t[2]) ? t[2].trim() : void 0;
849
+ if (window == null ? void 0 : window.CSS)
850
+ window.CSS.supports("color", n) || (n = "transparent", s = e.trim());
851
+ else {
852
+ const c = new Option().style;
853
+ c.color = n, c.color !== n && (n = "transparent", s = e.trim());
854
+ }
855
+ const { wrap: r, cleanedText: i } = this.extractWrap(s);
856
+ return {
857
+ text: i ? St(i, st()) : void 0,
858
+ color: n,
859
+ wrap: r
860
+ };
861
+ }
862
+ addNote(e, t, n) {
863
+ const s = {
864
+ actor: e,
865
+ placement: t,
866
+ message: n.text,
867
+ wrap: n.wrap ?? this.autoWrap()
868
+ }, r = [].concat(e, e);
869
+ this.state.records.notes.push(s), this.state.records.messages.push({
870
+ id: this.state.records.messages.length.toString(),
871
+ from: r[0],
872
+ to: r[1],
873
+ message: n.text,
874
+ wrap: n.wrap ?? this.autoWrap(),
875
+ type: this.LINETYPE.NOTE,
876
+ placement: t
877
+ });
878
+ }
879
+ addLinks(e, t) {
880
+ const n = this.getActor(e);
881
+ try {
882
+ let s = St(t.text, st());
883
+ s = s.replace(/&equals;/g, "="), s = s.replace(/&amp;/g, "&");
884
+ const r = JSON.parse(s);
885
+ this.insertLinks(n, r);
886
+ } catch (s) {
887
+ Q.error("error while parsing actor link text", s);
888
+ }
889
+ }
890
+ addALink(e, t) {
891
+ const n = this.getActor(e);
892
+ try {
893
+ const s = {};
894
+ let r = St(t.text, st());
895
+ const i = r.indexOf("@");
896
+ r = r.replace(/&equals;/g, "="), r = r.replace(/&amp;/g, "&");
897
+ const c = r.slice(0, i - 1).trim(), h = r.slice(i + 1).trim();
898
+ s[c] = h, this.insertLinks(n, s);
899
+ } catch (s) {
900
+ Q.error("error while parsing actor link text", s);
901
+ }
902
+ }
903
+ insertLinks(e, t) {
904
+ if (e.links == null)
905
+ e.links = t;
906
+ else
907
+ for (const n in t)
908
+ e.links[n] = t[n];
909
+ }
910
+ addProperties(e, t) {
911
+ const n = this.getActor(e);
912
+ try {
913
+ const s = St(t.text, st()), r = JSON.parse(s);
914
+ this.insertProperties(n, r);
915
+ } catch (s) {
916
+ Q.error("error while parsing actor properties text", s);
917
+ }
918
+ }
919
+ insertProperties(e, t) {
920
+ if (e.properties == null)
921
+ e.properties = t;
922
+ else
923
+ for (const n in t)
924
+ e.properties[n] = t[n];
925
+ }
926
+ boxEnd() {
927
+ this.state.records.currentBox = void 0;
928
+ }
929
+ addDetails(e, t) {
930
+ const n = this.getActor(e), s = document.getElementById(t.text);
931
+ try {
932
+ const r = s.innerHTML, i = JSON.parse(r);
933
+ i.properties && this.insertProperties(n, i.properties), i.links && this.insertLinks(n, i.links);
934
+ } catch (r) {
935
+ Q.error("error while parsing actor details text", r);
936
+ }
937
+ }
938
+ getActorProperty(e, t) {
939
+ if ((e == null ? void 0 : e.properties) !== void 0)
940
+ return e.properties[t];
941
+ }
942
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
943
+ apply(e) {
944
+ if (Array.isArray(e))
945
+ e.forEach((t) => {
946
+ this.apply(t);
947
+ });
948
+ else
949
+ switch (e.type) {
950
+ case "sequenceIndex":
951
+ this.state.records.messages.push({
952
+ id: this.state.records.messages.length.toString(),
953
+ from: void 0,
954
+ to: void 0,
955
+ message: {
956
+ start: e.sequenceIndex,
957
+ step: e.sequenceIndexStep,
958
+ visible: e.sequenceVisible
959
+ },
960
+ wrap: false,
961
+ type: e.signalType
962
+ });
963
+ break;
964
+ case "addParticipant":
965
+ this.addActor(e.actor, e.actor, e.description, e.draw, e.config);
966
+ break;
967
+ case "createParticipant":
968
+ if (this.state.records.actors.has(e.actor))
969
+ throw new Error(
970
+ "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"
971
+ );
972
+ 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);
973
+ break;
974
+ case "destroyParticipant":
975
+ this.state.records.lastDestroyed = e.actor, this.state.records.destroyedActors.set(e.actor, this.state.records.messages.length);
976
+ break;
977
+ case "activeStart":
978
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
979
+ break;
980
+ case "activeEnd":
981
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
982
+ break;
983
+ case "addNote":
984
+ this.addNote(e.actor, e.placement, e.text);
985
+ break;
986
+ case "addLinks":
987
+ this.addLinks(e.actor, e.text);
988
+ break;
989
+ case "addALink":
990
+ this.addALink(e.actor, e.text);
991
+ break;
992
+ case "addProperties":
993
+ this.addProperties(e.actor, e.text);
994
+ break;
995
+ case "addDetails":
996
+ this.addDetails(e.actor, e.text);
997
+ break;
998
+ case "addMessage":
999
+ if (this.state.records.lastCreated) {
1000
+ if (e.to !== this.state.records.lastCreated)
1001
+ throw new Error(
1002
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1003
+ );
1004
+ this.state.records.lastCreated = void 0;
1005
+ } else if (this.state.records.lastDestroyed) {
1006
+ if (e.to !== this.state.records.lastDestroyed && e.from !== this.state.records.lastDestroyed)
1007
+ throw new Error(
1008
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1009
+ );
1010
+ this.state.records.lastDestroyed = void 0;
1011
+ }
1012
+ this.addSignal(e.from, e.to, e.msg, e.signalType, e.activate);
1013
+ break;
1014
+ case "boxStart":
1015
+ this.addBox(e.boxData);
1016
+ break;
1017
+ case "boxEnd":
1018
+ this.boxEnd();
1019
+ break;
1020
+ case "loopStart":
1021
+ this.addSignal(void 0, void 0, e.loopText, e.signalType);
1022
+ break;
1023
+ case "loopEnd":
1024
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1025
+ break;
1026
+ case "rectStart":
1027
+ this.addSignal(void 0, void 0, e.color, e.signalType);
1028
+ break;
1029
+ case "rectEnd":
1030
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1031
+ break;
1032
+ case "optStart":
1033
+ this.addSignal(void 0, void 0, e.optText, e.signalType);
1034
+ break;
1035
+ case "optEnd":
1036
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1037
+ break;
1038
+ case "altStart":
1039
+ this.addSignal(void 0, void 0, e.altText, e.signalType);
1040
+ break;
1041
+ case "else":
1042
+ this.addSignal(void 0, void 0, e.altText, e.signalType);
1043
+ break;
1044
+ case "altEnd":
1045
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1046
+ break;
1047
+ case "setAccTitle":
1048
+ ee(e.text);
1049
+ break;
1050
+ case "parStart":
1051
+ this.addSignal(void 0, void 0, e.parText, e.signalType);
1052
+ break;
1053
+ case "and":
1054
+ this.addSignal(void 0, void 0, e.parText, e.signalType);
1055
+ break;
1056
+ case "parEnd":
1057
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1058
+ break;
1059
+ case "criticalStart":
1060
+ this.addSignal(void 0, void 0, e.criticalText, e.signalType);
1061
+ break;
1062
+ case "option":
1063
+ this.addSignal(void 0, void 0, e.optionText, e.signalType);
1064
+ break;
1065
+ case "criticalEnd":
1066
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1067
+ break;
1068
+ case "breakStart":
1069
+ this.addSignal(void 0, void 0, e.breakText, e.signalType);
1070
+ break;
1071
+ case "breakEnd":
1072
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1073
+ break;
1074
+ }
1075
+ }
1076
+ getConfig() {
1077
+ return st().sequence;
1078
+ }
1079
+ }, f(_a, "SequenceDB"), _a), qe = /* @__PURE__ */ f((e) => `.actor {
1080
+ stroke: ${e.actorBorder};
1081
+ fill: ${e.actorBkg};
1082
+ }
1083
+
1084
+ text.actor > tspan {
1085
+ fill: ${e.actorTextColor};
1086
+ stroke: none;
1087
+ }
1088
+
1089
+ .actor-line {
1090
+ stroke: ${e.actorLineColor};
1091
+ }
1092
+
1093
+ .innerArc {
1094
+ stroke-width: 1.5;
1095
+ stroke-dasharray: none;
1096
+ }
1097
+
1098
+ .messageLine0 {
1099
+ stroke-width: 1.5;
1100
+ stroke-dasharray: none;
1101
+ stroke: ${e.signalColor};
1102
+ }
1103
+
1104
+ .messageLine1 {
1105
+ stroke-width: 1.5;
1106
+ stroke-dasharray: 2, 2;
1107
+ stroke: ${e.signalColor};
1108
+ }
1109
+
1110
+ #arrowhead path {
1111
+ fill: ${e.signalColor};
1112
+ stroke: ${e.signalColor};
1113
+ }
1114
+
1115
+ .sequenceNumber {
1116
+ fill: ${e.sequenceNumberColor};
1117
+ }
1118
+
1119
+ #sequencenumber {
1120
+ fill: ${e.signalColor};
1121
+ }
1122
+
1123
+ #crosshead path {
1124
+ fill: ${e.signalColor};
1125
+ stroke: ${e.signalColor};
1126
+ }
1127
+
1128
+ .messageText {
1129
+ fill: ${e.signalTextColor};
1130
+ stroke: none;
1131
+ }
1132
+
1133
+ .labelBox {
1134
+ stroke: ${e.labelBoxBorderColor};
1135
+ fill: ${e.labelBoxBkgColor};
1136
+ }
1137
+
1138
+ .labelText, .labelText > tspan {
1139
+ fill: ${e.labelTextColor};
1140
+ stroke: none;
1141
+ }
1142
+
1143
+ .loopText, .loopText > tspan {
1144
+ fill: ${e.loopTextColor};
1145
+ stroke: none;
1146
+ }
1147
+
1148
+ .loopLine {
1149
+ stroke-width: 2px;
1150
+ stroke-dasharray: 2, 2;
1151
+ stroke: ${e.labelBoxBorderColor};
1152
+ fill: ${e.labelBoxBorderColor};
1153
+ }
1154
+
1155
+ .note {
1156
+ //stroke: #decc93;
1157
+ stroke: ${e.noteBorderColor};
1158
+ fill: ${e.noteBkgColor};
1159
+ }
1160
+
1161
+ .noteText, .noteText > tspan {
1162
+ fill: ${e.noteTextColor};
1163
+ stroke: none;
1164
+ }
1165
+
1166
+ .activation0 {
1167
+ fill: ${e.activationBkgColor};
1168
+ stroke: ${e.activationBorderColor};
1169
+ }
1170
+
1171
+ .activation1 {
1172
+ fill: ${e.activationBkgColor};
1173
+ stroke: ${e.activationBorderColor};
1174
+ }
1175
+
1176
+ .activation2 {
1177
+ fill: ${e.activationBkgColor};
1178
+ stroke: ${e.activationBorderColor};
1179
+ }
1180
+
1181
+ .actorPopupMenu {
1182
+ position: absolute;
1183
+ }
1184
+
1185
+ .actorPopupMenuPanel {
1186
+ position: absolute;
1187
+ fill: ${e.actorBkg};
1188
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1189
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1190
+ }
1191
+ .actor-man line {
1192
+ stroke: ${e.actorBorder};
1193
+ fill: ${e.actorBkg};
1194
+ }
1195
+ .actor-man circle, line {
1196
+ stroke: ${e.actorBorder};
1197
+ fill: ${e.actorBkg};
1198
+ stroke-width: 2px;
1199
+ }
1200
+
1201
+ `, "getStyles"), ze = qe, Tt = 36, gt = "actor-top", xt = "actor-bottom", Dt = "actor-box", ut = "actor-man", It = /* @__PURE__ */ f(function(e, t) {
1202
+ return we(e, t);
1203
+ }, "drawRect"), He = /* @__PURE__ */ f(function(e, t, n, s, r) {
1204
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1205
+ return { height: 0, width: 0 };
1206
+ const i = t.links, c = t.actorCnt, h = t.rectData;
1207
+ var o = "none";
1208
+ r && (o = "block !important");
1209
+ const a = e.append("g");
1210
+ a.attr("id", "actor" + c + "_popup"), a.attr("class", "actorPopupMenu"), a.attr("display", o);
1211
+ var p = "";
1212
+ h.class !== void 0 && (p = " " + h.class);
1213
+ let g = h.width > n ? h.width : n;
1214
+ const x = a.append("rect");
1215
+ if (x.attr("class", "actorPopupMenuPanel" + p), x.attr("x", h.x), x.attr("y", h.height), x.attr("fill", h.fill), x.attr("stroke", h.stroke), x.attr("width", g), x.attr("height", h.height), x.attr("rx", h.rx), x.attr("ry", h.ry), i != null) {
1216
+ var y = 20;
1217
+ for (let k in i) {
1218
+ var m = a.append("a"), w = ae.sanitizeUrl(i[k]);
1219
+ m.attr("xlink:href", w), m.attr("target", "_blank"), ps(s)(
1220
+ k,
1221
+ m,
1222
+ h.x + 10,
1223
+ h.height + y,
1224
+ g,
1225
+ 20,
1226
+ { class: "actor" },
1227
+ s
1228
+ ), y += 30;
1229
+ }
1230
+ }
1231
+ return x.attr("height", y), { height: h.height + y, width: g };
1232
+ }, "drawPopup"), Ct = /* @__PURE__ */ f(function(e) {
1233
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1234
+ }, "popupMenuToggle"), Rt = /* @__PURE__ */ f(async function(e, t, n = null) {
1235
+ let s = e.append("foreignObject");
1236
+ const r = await ie(t.text, zt()), c = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();
1237
+ if (s.attr("height", Math.round(c.height)).attr("width", Math.round(c.width)), t.class === "noteText") {
1238
+ const h = e.node().firstChild;
1239
+ h.setAttribute("height", c.height + 2 * t.textMargin);
1240
+ const o = h.getBBox();
1241
+ s.attr("x", Math.round(o.x + o.width / 2 - c.width / 2)).attr("y", Math.round(o.y + o.height / 2 - c.height / 2));
1242
+ } else if (n) {
1243
+ let { startx: h, stopx: o, starty: a } = n;
1244
+ if (h > o) {
1245
+ const p = h;
1246
+ h = o, o = p;
1247
+ }
1248
+ s.attr("x", Math.round(h + Math.abs(h - o) / 2 - c.width / 2)), t.class === "loopText" ? s.attr("y", Math.round(a)) : s.attr("y", Math.round(a - c.height));
1249
+ }
1250
+ return [s];
1251
+ }, "drawKatex"), wt = /* @__PURE__ */ f(function(e, t) {
1252
+ let n = 0, s = 0;
1253
+ const r = t.text.split(I.lineBreakRegex), [i, c] = re(t.fontSize);
1254
+ let h = [], o = 0, a = /* @__PURE__ */ f(() => t.y, "yfunc");
1255
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1256
+ switch (t.valign) {
1257
+ case "top":
1258
+ case "start":
1259
+ a = /* @__PURE__ */ f(() => Math.round(t.y + t.textMargin), "yfunc");
1260
+ break;
1261
+ case "middle":
1262
+ case "center":
1263
+ a = /* @__PURE__ */ f(() => Math.round(t.y + (n + s + t.textMargin) / 2), "yfunc");
1264
+ break;
1265
+ case "bottom":
1266
+ case "end":
1267
+ a = /* @__PURE__ */ f(() => Math.round(
1268
+ t.y + (n + s + 2 * t.textMargin) - t.textMargin
1269
+ ), "yfunc");
1270
+ break;
1271
+ }
1272
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1273
+ switch (t.anchor) {
1274
+ case "left":
1275
+ case "start":
1276
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1277
+ break;
1278
+ case "middle":
1279
+ case "center":
1280
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1281
+ break;
1282
+ case "right":
1283
+ case "end":
1284
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1285
+ break;
1286
+ }
1287
+ for (let [p, g] of r.entries()) {
1288
+ t.textMargin !== void 0 && t.textMargin === 0 && i !== void 0 && (o = p * i);
1289
+ const x = e.append("text");
1290
+ x.attr("x", t.x), x.attr("y", a()), t.anchor !== void 0 && x.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && x.style("font-family", t.fontFamily), c !== void 0 && x.style("font-size", c), t.fontWeight !== void 0 && x.style("font-weight", t.fontWeight), t.fill !== void 0 && x.attr("fill", t.fill), t.class !== void 0 && x.attr("class", t.class), t.dy !== void 0 ? x.attr("dy", t.dy) : o !== 0 && x.attr("dy", o);
1291
+ const y = g || De;
1292
+ if (t.tspan) {
1293
+ const m = x.append("tspan");
1294
+ m.attr("x", t.x), t.fill !== void 0 && m.attr("fill", t.fill), m.text(y);
1295
+ } else
1296
+ x.text(y);
1297
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (s += (x._groups || x)[0][0].getBBox().height, n = s), h.push(x);
1298
+ }
1299
+ return h;
1300
+ }, "drawText"), ne = /* @__PURE__ */ f(function(e, t) {
1301
+ function n(r, i, c, h, o) {
1302
+ return r + "," + i + " " + (r + c) + "," + i + " " + (r + c) + "," + (i + h - o) + " " + (r + c - o * 1.2) + "," + (i + h) + " " + r + "," + (i + h);
1303
+ }
1304
+ f(n, "genPoints");
1305
+ const s = e.append("polygon");
1306
+ return s.attr("points", n(t.x, t.y, t.width, t.height, 7)), s.attr("class", "labelBox"), t.y = t.y + t.height / 2, wt(e, t), s;
1307
+ }, "drawLabel"), P = -1, oe = /* @__PURE__ */ f((e, t, n, s) => {
1308
+ e.select && n.forEach((r) => {
1309
+ const i = t.get(r), c = e.select("#actor" + i.actorCnt);
1310
+ !s.mirrorActors && i.stopy ? c.attr("y2", i.stopy + i.height / 2) : s.mirrorActors && c.attr("y2", i.stopy);
1311
+ });
1312
+ }, "fixLifeLineHeights"), Ue = /* @__PURE__ */ f(function(e, t, n, s) {
1313
+ var _a2, _b;
1314
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1315
+ var o = h;
1316
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ct(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1317
+ const a = ct();
1318
+ var p = "actor";
1319
+ ((_a2 = t.properties) == null ? void 0 : _a2.class) ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.rx = 3, a.ry = 3, a.name = t.name;
1320
+ const g = It(o, a);
1321
+ if (t.rectData = a, (_b = t.properties) == null ? void 0 : _b.icon) {
1322
+ const y = t.properties.icon.trim();
1323
+ y.charAt(0) === "@" ? Xt(o, a.x + a.width - 20, a.y + 10, y.substr(1)) : Jt(o, a.x + a.width - 20, a.y + 10, y);
1324
+ }
1325
+ dt(n, z(t.description))(
1326
+ t.description,
1327
+ o,
1328
+ a.x,
1329
+ a.y,
1330
+ a.width,
1331
+ a.height,
1332
+ { class: `actor ${Dt}` },
1333
+ n
1334
+ );
1335
+ let x = t.height;
1336
+ if (g.node) {
1337
+ const y = g.node().getBBox();
1338
+ t.height = y.height, x = y.height;
1339
+ }
1340
+ return x;
1341
+ }, "drawActorTypeParticipant"), Ge = /* @__PURE__ */ f(function(e, t, n, s) {
1342
+ var _a2, _b;
1343
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1344
+ var o = h;
1345
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ct(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1346
+ const a = ct();
1347
+ var p = "actor";
1348
+ ((_a2 = t.properties) == null ? void 0 : _a2.class) ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1349
+ const g = 6, x = {
1350
+ ...a,
1351
+ x: a.x + -g,
1352
+ y: a.y + +g,
1353
+ class: "actor"
1354
+ }, y = It(o, a);
1355
+ if (It(o, x), t.rectData = a, (_b = t.properties) == null ? void 0 : _b.icon) {
1356
+ const w = t.properties.icon.trim();
1357
+ w.charAt(0) === "@" ? Xt(o, a.x + a.width - 20, a.y + 10, w.substr(1)) : Jt(o, a.x + a.width - 20, a.y + 10, w);
1358
+ }
1359
+ dt(n, z(t.description))(
1360
+ t.description,
1361
+ o,
1362
+ a.x - g,
1363
+ a.y + g,
1364
+ a.width,
1365
+ a.height,
1366
+ { class: `actor ${Dt}` },
1367
+ n
1368
+ );
1369
+ let m = t.height;
1370
+ if (y.node) {
1371
+ const w = y.node().getBBox();
1372
+ t.height = w.height, m = w.height;
1373
+ }
1374
+ return m;
1375
+ }, "drawActorTypeCollections"), Ke = /* @__PURE__ */ f(function(e, t, n, s) {
1376
+ var _a2, _b;
1377
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1378
+ let o = h;
1379
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ct(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1380
+ const a = ct();
1381
+ let p = "actor";
1382
+ ((_a2 = t.properties) == null ? void 0 : _a2.class) ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1383
+ const g = a.height / 2, x = g / (2.5 + a.height / 50), y = o.append("g"), m = o.append("g");
1384
+ if (y.append("path").attr(
1385
+ "d",
1386
+ `M ${a.x},${a.y + g}
1387
+ a ${x},${g} 0 0 0 0,${a.height}
1388
+ h ${a.width - 2 * x}
1389
+ a ${x},${g} 0 0 0 0,-${a.height}
1390
+ Z
1391
+ `
1392
+ ).attr("class", p), m.append("path").attr(
1393
+ "d",
1394
+ `M ${a.x},${a.y + g}
1395
+ a ${x},${g} 0 0 0 0,${a.height}`
1396
+ ).attr("stroke", "#666").attr("stroke-width", "1px").attr("class", p), y.attr("transform", `translate(${x}, ${-(a.height / 2)})`), m.attr("transform", `translate(${a.width - x}, ${-a.height / 2})`), t.rectData = a, (_b = t.properties) == null ? void 0 : _b.icon) {
1397
+ const N = t.properties.icon.trim(), S = a.x + a.width - 20, O = a.y + 10;
1398
+ N.charAt(0) === "@" ? Xt(o, S, O, N.substr(1)) : Jt(o, S, O, N);
1399
+ }
1400
+ dt(n, z(t.description))(
1401
+ t.description,
1402
+ o,
1403
+ a.x,
1404
+ a.y,
1405
+ a.width,
1406
+ a.height,
1407
+ { class: `actor ${Dt}` },
1408
+ n
1409
+ );
1410
+ let w = t.height;
1411
+ const k = y.select("path:last-child");
1412
+ if (k.node()) {
1413
+ const N = k.node().getBBox();
1414
+ t.height = N.height, w = N.height;
1415
+ }
1416
+ return w;
1417
+ }, "drawActorTypeQueue"), Xe = /* @__PURE__ */ f(function(e, t, n, s) {
1418
+ var _a2;
1419
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower();
1420
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1421
+ const o = e.append("g");
1422
+ let a = ut;
1423
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1424
+ const p = ct();
1425
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1426
+ const g = t.x + t.width / 2, x = r + 30, y = 18;
1427
+ o.append("defs").append("marker").attr("id", "filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").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"), o.append("circle").attr("cx", g).attr("cy", x).attr("r", y).attr("fill", "#eaeaf7").attr("stroke", "#666").attr("stroke-width", 1.2), o.append("line").attr("marker-end", "url(#filled-head-control)").attr("transform", `translate(${g}, ${x - y})`);
1428
+ const m = o.node().getBBox();
1429
+ return t.height = m.height + 2 * (((_a2 = n == null ? void 0 : n.sequence) == null ? void 0 : _a2.labelBoxHeight) ?? 0), dt(n, z(t.description))(
1430
+ t.description,
1431
+ o,
1432
+ p.x,
1433
+ p.y + y + (s ? 5 : 10),
1434
+ p.width,
1435
+ p.height,
1436
+ { class: `actor ${ut}` },
1437
+ n
1438
+ ), t.height;
1439
+ }, "drawActorTypeControl"), Je = /* @__PURE__ */ f(function(e, t, n, s) {
1440
+ var _a2;
1441
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower(), o = e.append("g");
1442
+ let a = ut;
1443
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1444
+ const p = ct();
1445
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1446
+ const g = t.x + t.width / 2, x = r + (s ? 10 : 25), y = 18;
1447
+ o.append("circle").attr("cx", g).attr("cy", x).attr("r", y).attr("width", t.width).attr("height", t.height), o.append("line").attr("x1", g - y).attr("x2", g + y).attr("y1", x + y).attr("y2", x + y).attr("stroke", "#333").attr("stroke-width", 2);
1448
+ const m = o.node().getBBox();
1449
+ return t.height = m.height + (((_a2 = n == null ? void 0 : n.sequence) == null ? void 0 : _a2.labelBoxHeight) ?? 0), s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P), dt(n, z(t.description))(
1450
+ t.description,
1451
+ o,
1452
+ p.x,
1453
+ p.y + (s ? (x - r + y - 5) / 2 : (x + y - r) / 2),
1454
+ p.width,
1455
+ p.height,
1456
+ { class: `actor ${ut}` },
1457
+ n
1458
+ ), s ? o.attr("transform", `translate(0, ${y / 2})`) : o.attr("transform", `translate(0, ${y / 2})`), t.height;
1459
+ }, "drawActorTypeEntity"), Qe = /* @__PURE__ */ f(function(e, t, n, s) {
1460
+ var _a2;
1461
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height + 2 * n.boxTextMargin, h = e.append("g").lower();
1462
+ let o = h;
1463
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ct(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1464
+ const a = ct();
1465
+ let p = "actor";
1466
+ ((_a2 = t.properties) == null ? void 0 : _a2.class) ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name, a.x = t.x, a.y = r;
1467
+ const g = a.width / 4, x = a.width / 4, y = g / 2, m = y / (2.5 + g / 50), w = o.append("g"), k = `
1468
+ M ${a.x},${a.y + m}
1469
+ a ${y},${m} 0 0 0 ${g},0
1470
+ a ${y},${m} 0 0 0 -${g},0
1471
+ l 0,${x - 2 * m}
1472
+ a ${y},${m} 0 0 0 ${g},0
1473
+ l 0,-${x - 2 * m}
1474
+ `;
1475
+ w.append("path").attr("d", k).attr("fill", "#eaeaea").attr("stroke", "#000").attr("stroke-width", 1).attr("class", p), s ? w.attr("transform", `translate(${g * 1.5}, ${a.height / 4 - 2 * m})`) : w.attr("transform", `translate(${g * 1.5}, ${(a.height + m) / 4})`), t.rectData = a, dt(n, z(t.description))(
1476
+ t.description,
1477
+ o,
1478
+ a.x,
1479
+ a.y + (s ? (a.height + x) / 4 : (a.height + m) / 2),
1480
+ a.width,
1481
+ a.height,
1482
+ { class: `actor ${Dt}` },
1483
+ n
1484
+ );
1485
+ const N = w.select("path:last-child");
1486
+ if (N.node()) {
1487
+ const S = N.node().getBBox();
1488
+ t.height = S.height + (n.sequence.labelBoxHeight ?? 0);
1489
+ }
1490
+ return t.height;
1491
+ }, "drawActorTypeDatabase"), Ze = /* @__PURE__ */ f(function(e, t, n, s) {
1492
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = 30, o = e.append("g").lower();
1493
+ s || (P++, o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1494
+ const a = e.append("g");
1495
+ let p = ut;
1496
+ s ? p += ` ${xt}` : p += ` ${gt}`, a.attr("class", p), a.attr("name", t.name);
1497
+ const g = ct();
1498
+ g.x = t.x, g.y = r, g.fill = "#eaeaea", g.width = t.width, g.height = t.height, g.class = "actor", a.append("line").attr("id", "actor-man-torso" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 10).attr("x2", t.x + t.width / 2 - 15).attr("y2", r + 10), a.append("line").attr("id", "actor-man-arms" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 0).attr("x2", t.x + t.width / 2 - h * 2.5).attr("y2", r + 20), a.append("circle").attr("cx", t.x + t.width / 2).attr("cy", r + 10).attr("r", h);
1499
+ const x = a.node().getBBox();
1500
+ return t.height = x.height + (n.sequence.labelBoxHeight ?? 0), dt(n, z(t.description))(
1501
+ t.description,
1502
+ a,
1503
+ g.x,
1504
+ g.y + (s ? h / 2 - 4 : h / 2 + 3),
1505
+ g.width,
1506
+ g.height,
1507
+ { class: `actor ${ut}` },
1508
+ n
1509
+ ), s ? a.attr("transform", `translate(0,${h / 2 + 7})`) : a.attr("transform", `translate(0,${h / 2 + 7})`), t.height;
1510
+ }, "drawActorTypeBoundary"), $e = /* @__PURE__ */ f(function(e, t, n, s) {
1511
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = e.append("g").lower();
1512
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1513
+ const o = e.append("g");
1514
+ let a = ut;
1515
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1516
+ const p = ct();
1517
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor", p.rx = 3, p.ry = 3, o.append("line").attr("id", "actor-man-torso" + P).attr("x1", i).attr("y1", r + 25).attr("x2", i).attr("y2", r + 45), o.append("line").attr("id", "actor-man-arms" + P).attr("x1", i - Tt / 2).attr("y1", r + 33).attr("x2", i + Tt / 2).attr("y2", r + 33), o.append("line").attr("x1", i - Tt / 2).attr("y1", r + 60).attr("x2", i).attr("y2", r + 45), o.append("line").attr("x1", i).attr("y1", r + 45).attr("x2", i + Tt / 2 - 2).attr("y2", r + 60);
1518
+ const g = o.append("circle");
1519
+ g.attr("cx", t.x + t.width / 2), g.attr("cy", r + 10), g.attr("r", 15), g.attr("width", t.width), g.attr("height", t.height);
1520
+ const x = o.node().getBBox();
1521
+ return t.height = x.height, dt(n, z(t.description))(
1522
+ t.description,
1523
+ o,
1524
+ p.x,
1525
+ p.y + 35,
1526
+ p.width,
1527
+ p.height,
1528
+ { class: `actor ${ut}` },
1529
+ n
1530
+ ), t.height;
1531
+ }, "drawActorTypeActor"), je = /* @__PURE__ */ f(async function(e, t, n, s) {
1532
+ switch (t.type) {
1533
+ case "actor":
1534
+ return await $e(e, t, n, s);
1535
+ case "participant":
1536
+ return await Ue(e, t, n, s);
1537
+ case "boundary":
1538
+ return await Ze(e, t, n, s);
1539
+ case "control":
1540
+ return await Xe(e, t, n, s);
1541
+ case "entity":
1542
+ return await Je(e, t, n, s);
1543
+ case "database":
1544
+ return await Qe(e, t, n, s);
1545
+ case "collections":
1546
+ return await Ge(e, t, n, s);
1547
+ case "queue":
1548
+ return await Ke(e, t, n, s);
1549
+ }
1550
+ }, "drawActor"), ts = /* @__PURE__ */ f(function(e, t, n) {
1551
+ const r = e.append("g");
1552
+ ce(r, t), t.name && dt(n)(
1553
+ t.name,
1554
+ r,
1555
+ t.x,
1556
+ t.y + n.boxTextMargin + (t.textMaxHeight || 0) / 2,
1557
+ t.width,
1558
+ 0,
1559
+ { class: "text" },
1560
+ n
1561
+ ), r.lower();
1562
+ }, "drawBox"), es = /* @__PURE__ */ f(function(e) {
1563
+ return e.append("g");
1564
+ }, "anchorElement"), ss = /* @__PURE__ */ f(function(e, t, n, s, r) {
1565
+ const i = ct(), c = t.anchored;
1566
+ i.x = t.startx, i.y = t.starty, i.class = "activation" + r % 3, i.width = t.stopx - t.startx, i.height = n - t.starty, It(c, i);
1567
+ }, "drawActivation"), as = /* @__PURE__ */ f(async function(e, t, n, s) {
1568
+ const {
1569
+ boxMargin: r,
1570
+ boxTextMargin: i,
1571
+ labelBoxHeight: c,
1572
+ labelBoxWidth: h,
1573
+ messageFontFamily: o,
1574
+ messageFontSize: a,
1575
+ messageFontWeight: p
1576
+ } = s, g = e.append("g"), x = /* @__PURE__ */ f(function(w, k, N, S) {
1577
+ return g.append("line").attr("x1", w).attr("y1", k).attr("x2", N).attr("y2", S).attr("class", "loopLine");
1578
+ }, "drawLoopLine");
1579
+ x(t.startx, t.starty, t.stopx, t.starty), x(t.stopx, t.starty, t.stopx, t.stopy), x(t.startx, t.stopy, t.stopx, t.stopy), x(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(w) {
1580
+ x(t.startx, w.y, t.stopx, w.y).style(
1581
+ "stroke-dasharray",
1582
+ "3, 3"
1583
+ );
1584
+ });
1585
+ let y = Kt();
1586
+ y.text = n, y.x = t.startx, y.y = t.starty, y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.anchor = "middle", y.valign = "middle", y.tspan = false, y.width = h || 50, y.height = c || 20, y.textMargin = i, y.class = "labelText", ne(g, y), y = le(), y.text = t.title, y.x = t.startx + h / 2 + (t.stopx - t.startx) / 2, y.y = t.starty + r + i, y.anchor = "middle", y.valign = "middle", y.textMargin = i, y.class = "loopText", y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.wrap = true;
1587
+ let m = z(y.text) ? await Rt(g, y, t) : wt(g, y);
1588
+ if (t.sectionTitles !== void 0) {
1589
+ for (const [w, k] of Object.entries(t.sectionTitles))
1590
+ if (k.message) {
1591
+ y.text = k.message, y.x = t.startx + (t.stopx - t.startx) / 2, y.y = t.sections[w].y + r + i, y.class = "loopText", y.anchor = "middle", y.valign = "middle", y.tspan = false, y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.wrap = t.wrap, z(y.text) ? (t.starty = t.sections[w].y, await Rt(g, y, t)) : wt(g, y);
1592
+ let N = Math.round(
1593
+ m.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, O) => S + O)
1594
+ );
1595
+ t.sections[w].height += N - (r + i);
1596
+ }
1597
+ }
1598
+ return t.height = Math.round(t.stopy - t.starty), g;
1599
+ }, "drawLoop"), ce = /* @__PURE__ */ f(function(e, t) {
1600
+ me(e, t);
1601
+ }, "drawBackgroundRect"), rs = /* @__PURE__ */ f(function(e) {
1602
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1603
+ "d",
1604
+ "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"
1605
+ );
1606
+ }, "insertDatabaseIcon"), is = /* @__PURE__ */ f(function(e) {
1607
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1608
+ "d",
1609
+ "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"
1610
+ );
1611
+ }, "insertComputerIcon"), ns = /* @__PURE__ */ f(function(e) {
1612
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1613
+ "d",
1614
+ "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"
1615
+ );
1616
+ }, "insertClockIcon"), os = /* @__PURE__ */ f(function(e) {
1617
+ e.append("defs").append("marker").attr("id", "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");
1618
+ }, "insertArrowHead"), cs = /* @__PURE__ */ f(function(e) {
1619
+ e.append("defs").append("marker").attr("id", "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");
1620
+ }, "insertArrowFilledHead"), ls = /* @__PURE__ */ f(function(e) {
1621
+ e.append("defs").append("marker").attr("id", "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);
1622
+ }, "insertSequenceNumber"), hs = /* @__PURE__ */ f(function(e) {
1623
+ e.append("defs").append("marker").attr("id", "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");
1624
+ }, "insertArrowCrossHead"), le = /* @__PURE__ */ f(function() {
1625
+ return {
1626
+ x: 0,
1627
+ y: 0,
1628
+ fill: void 0,
1629
+ anchor: void 0,
1630
+ style: "#666",
1631
+ width: void 0,
1632
+ height: void 0,
1633
+ textMargin: 0,
1634
+ rx: 0,
1635
+ ry: 0,
1636
+ tspan: true,
1637
+ valign: void 0
1638
+ };
1639
+ }, "getTextObj"), ds = /* @__PURE__ */ f(function() {
1640
+ return {
1641
+ x: 0,
1642
+ y: 0,
1643
+ fill: "#EDF2AE",
1644
+ stroke: "#666",
1645
+ width: 100,
1646
+ anchor: "start",
1647
+ height: 100,
1648
+ rx: 0,
1649
+ ry: 0
1650
+ };
1651
+ }, "getNoteRect"), dt = /* @__PURE__ */ (function() {
1652
+ function e(i, c, h, o, a, p, g) {
1653
+ const x = c.append("text").attr("x", h + a / 2).attr("y", o + p / 2 + 5).style("text-anchor", "middle").text(i);
1654
+ r(x, g);
1655
+ }
1656
+ f(e, "byText");
1657
+ function t(i, c, h, o, a, p, g, x) {
1658
+ const { actorFontSize: y, actorFontFamily: m, actorFontWeight: w } = x, [k, N] = re(y), S = i.split(I.lineBreakRegex);
1659
+ for (let O = 0; O < S.length; O++) {
1660
+ const B = O * k - k * (S.length - 1) / 2, q = c.append("text").attr("x", h + a / 2).attr("y", o).style("text-anchor", "middle").style("font-size", N).style("font-weight", w).style("font-family", m);
1661
+ q.append("tspan").attr("x", h + a / 2).attr("dy", B).text(S[O]), q.attr("y", o + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(q, g);
1662
+ }
1663
+ }
1664
+ f(t, "byTspan");
1665
+ function n(i, c, h, o, a, p, g, x) {
1666
+ const y = c.append("switch"), w = y.append("foreignObject").attr("x", h).attr("y", o).attr("width", a).attr("height", p).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1667
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, y, h, o, a, p, g, x), r(w, g);
1668
+ }
1669
+ f(n, "byFo");
1670
+ async function s(i, c, h, o, a, p, g, x) {
1671
+ const y = await Lt(i, zt()), m = c.append("switch"), k = m.append("foreignObject").attr("x", h + a / 2 - y.width / 2).attr("y", o + p / 2 - y.height / 2).attr("width", y.width).attr("height", y.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1672
+ k.append("div").style("text-align", "center").style("vertical-align", "middle").html(await ie(i, zt())), t(i, m, h, o, a, p, g, x), r(k, g);
1673
+ }
1674
+ f(s, "byKatex");
1675
+ function r(i, c) {
1676
+ for (const h in c)
1677
+ c.hasOwnProperty(h) && i.attr(h, c[h]);
1678
+ }
1679
+ return f(r, "_setTextAttrs"), function(i, c = false) {
1680
+ return c ? s : i.textPlacement === "fo" ? n : i.textPlacement === "old" ? e : t;
1681
+ };
1682
+ })(), ps = /* @__PURE__ */ (function() {
1683
+ function e(r, i, c, h, o, a, p) {
1684
+ const g = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(r);
1685
+ s(g, p);
1686
+ }
1687
+ f(e, "byText");
1688
+ function t(r, i, c, h, o, a, p, g) {
1689
+ const { actorFontSize: x, actorFontFamily: y, actorFontWeight: m } = g, w = r.split(I.lineBreakRegex);
1690
+ for (let k = 0; k < w.length; k++) {
1691
+ const N = k * x - x * (w.length - 1) / 2, S = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", x).style("font-weight", m).style("font-family", y);
1692
+ S.append("tspan").attr("x", c).attr("dy", N).text(w[k]), S.attr("y", h + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, p);
1693
+ }
1694
+ }
1695
+ f(t, "byTspan");
1696
+ function n(r, i, c, h, o, a, p, g) {
1697
+ const x = i.append("switch"), m = x.append("foreignObject").attr("x", c).attr("y", h).attr("width", o).attr("height", a).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1698
+ m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, x, c, h, o, a, p, g), s(m, p);
1699
+ }
1700
+ f(n, "byFo");
1701
+ function s(r, i) {
1702
+ for (const c in i)
1703
+ i.hasOwnProperty(c) && r.attr(c, i[c]);
1704
+ }
1705
+ return f(s, "_setTextAttrs"), function(r) {
1706
+ return r.textPlacement === "fo" ? n : r.textPlacement === "old" ? e : t;
1707
+ };
1708
+ })(), V = {
1709
+ drawRect: It,
1710
+ drawText: wt,
1711
+ drawLabel: ne,
1712
+ drawActor: je,
1713
+ drawBox: ts,
1714
+ drawPopup: He,
1715
+ anchorElement: es,
1716
+ drawActivation: ss,
1717
+ drawLoop: as,
1718
+ drawBackgroundRect: ce,
1719
+ insertArrowHead: os,
1720
+ insertArrowFilledHead: cs,
1721
+ insertSequenceNumber: ls,
1722
+ insertArrowCrossHead: hs,
1723
+ insertDatabaseIcon: rs,
1724
+ insertComputerIcon: is,
1725
+ insertClockIcon: ns,
1726
+ getTextObj: le,
1727
+ getNoteRect: ds,
1728
+ fixLifeLineHeights: oe,
1729
+ sanitizeUrl: ae.sanitizeUrl
1730
+ }, l = {}, T = {
1731
+ data: {
1732
+ startx: void 0,
1733
+ stopx: void 0,
1734
+ starty: void 0,
1735
+ stopy: void 0
1736
+ },
1737
+ verticalPos: 0,
1738
+ sequenceItems: [],
1739
+ activations: [],
1740
+ models: {
1741
+ getHeight: /* @__PURE__ */ f(function() {
1742
+ return Math.max.apply(
1743
+ null,
1744
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1745
+ ) + (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));
1746
+ }, "getHeight"),
1747
+ clear: /* @__PURE__ */ f(function() {
1748
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1749
+ }, "clear"),
1750
+ addBox: /* @__PURE__ */ f(function(e) {
1751
+ this.boxes.push(e);
1752
+ }, "addBox"),
1753
+ addActor: /* @__PURE__ */ f(function(e) {
1754
+ this.actors.push(e);
1755
+ }, "addActor"),
1756
+ addLoop: /* @__PURE__ */ f(function(e) {
1757
+ this.loops.push(e);
1758
+ }, "addLoop"),
1759
+ addMessage: /* @__PURE__ */ f(function(e) {
1760
+ this.messages.push(e);
1761
+ }, "addMessage"),
1762
+ addNote: /* @__PURE__ */ f(function(e) {
1763
+ this.notes.push(e);
1764
+ }, "addNote"),
1765
+ lastActor: /* @__PURE__ */ f(function() {
1766
+ return this.actors[this.actors.length - 1];
1767
+ }, "lastActor"),
1768
+ lastLoop: /* @__PURE__ */ f(function() {
1769
+ return this.loops[this.loops.length - 1];
1770
+ }, "lastLoop"),
1771
+ lastMessage: /* @__PURE__ */ f(function() {
1772
+ return this.messages[this.messages.length - 1];
1773
+ }, "lastMessage"),
1774
+ lastNote: /* @__PURE__ */ f(function() {
1775
+ return this.notes[this.notes.length - 1];
1776
+ }, "lastNote"),
1777
+ actors: [],
1778
+ boxes: [],
1779
+ loops: [],
1780
+ messages: [],
1781
+ notes: []
1782
+ },
1783
+ init: /* @__PURE__ */ f(function() {
1784
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1785
+ startx: void 0,
1786
+ stopx: void 0,
1787
+ starty: void 0,
1788
+ stopy: void 0
1789
+ }, this.verticalPos = 0, pe(st());
1790
+ }, "init"),
1791
+ updateVal: /* @__PURE__ */ f(function(e, t, n, s) {
1792
+ e[t] === void 0 ? e[t] = n : e[t] = s(n, e[t]);
1793
+ }, "updateVal"),
1794
+ updateBounds: /* @__PURE__ */ f(function(e, t, n, s) {
1795
+ const r = this;
1796
+ let i = 0;
1797
+ function c(h) {
1798
+ return /* @__PURE__ */ f(function(a) {
1799
+ i++;
1800
+ const p = r.sequenceItems.length - i + 1;
1801
+ r.updateVal(a, "starty", t - p * l.boxMargin, Math.min), r.updateVal(a, "stopy", s + p * l.boxMargin, Math.max), r.updateVal(T.data, "startx", e - p * l.boxMargin, Math.min), r.updateVal(T.data, "stopx", n + p * l.boxMargin, Math.max), h !== "activation" && (r.updateVal(a, "startx", e - p * l.boxMargin, Math.min), r.updateVal(a, "stopx", n + p * l.boxMargin, Math.max), r.updateVal(T.data, "starty", t - p * l.boxMargin, Math.min), r.updateVal(T.data, "stopy", s + p * l.boxMargin, Math.max));
1802
+ }, "updateItemBounds");
1803
+ }
1804
+ f(c, "updateFn"), this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1805
+ }, "updateBounds"),
1806
+ insert: /* @__PURE__ */ f(function(e, t, n, s) {
1807
+ const r = I.getMin(e, n), i = I.getMax(e, n), c = I.getMin(t, s), h = I.getMax(t, s);
1808
+ this.updateVal(T.data, "startx", r, Math.min), this.updateVal(T.data, "starty", c, Math.min), this.updateVal(T.data, "stopx", i, Math.max), this.updateVal(T.data, "stopy", h, Math.max), this.updateBounds(r, c, i, h);
1809
+ }, "insert"),
1810
+ newActivation: /* @__PURE__ */ f(function(e, t, n) {
1811
+ const s = n.get(e.from), r = Ot(e.from).length || 0, i = s.x + s.width / 2 + (r - 1) * l.activationWidth / 2;
1812
+ this.activations.push({
1813
+ startx: i,
1814
+ starty: this.verticalPos + 2,
1815
+ stopx: i + l.activationWidth,
1816
+ stopy: void 0,
1817
+ actor: e.from,
1818
+ anchored: V.anchorElement(t)
1819
+ });
1820
+ }, "newActivation"),
1821
+ endActivation: /* @__PURE__ */ f(function(e) {
1822
+ const t = this.activations.map(function(n) {
1823
+ return n.actor;
1824
+ }).lastIndexOf(e.from);
1825
+ return this.activations.splice(t, 1)[0];
1826
+ }, "endActivation"),
1827
+ createLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: false, width: void 0 }, t) {
1828
+ return {
1829
+ startx: void 0,
1830
+ starty: this.verticalPos,
1831
+ stopx: void 0,
1832
+ stopy: void 0,
1833
+ title: e.message,
1834
+ wrap: e.wrap,
1835
+ width: e.width,
1836
+ height: 0,
1837
+ fill: t
1838
+ };
1839
+ }, "createLoop"),
1840
+ newLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: false, width: void 0 }, t) {
1841
+ this.sequenceItems.push(this.createLoop(e, t));
1842
+ }, "newLoop"),
1843
+ endLoop: /* @__PURE__ */ f(function() {
1844
+ return this.sequenceItems.pop();
1845
+ }, "endLoop"),
1846
+ isLoopOverlap: /* @__PURE__ */ f(function() {
1847
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : false;
1848
+ }, "isLoopOverlap"),
1849
+ addSectionToLoop: /* @__PURE__ */ f(function(e) {
1850
+ const t = this.sequenceItems.pop();
1851
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: T.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
1852
+ }, "addSectionToLoop"),
1853
+ saveVerticalPos: /* @__PURE__ */ f(function() {
1854
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1855
+ }, "saveVerticalPos"),
1856
+ resetVerticalPos: /* @__PURE__ */ f(function() {
1857
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1858
+ }, "resetVerticalPos"),
1859
+ bumpVerticalPos: /* @__PURE__ */ f(function(e) {
1860
+ this.verticalPos = this.verticalPos + e, this.data.stopy = I.getMax(this.data.stopy, this.verticalPos);
1861
+ }, "bumpVerticalPos"),
1862
+ getVerticalPos: /* @__PURE__ */ f(function() {
1863
+ return this.verticalPos;
1864
+ }, "getVerticalPos"),
1865
+ getBounds: /* @__PURE__ */ f(function() {
1866
+ return { bounds: this.data, models: this.models };
1867
+ }, "getBounds")
1868
+ }, us = /* @__PURE__ */ f(async function(e, t) {
1869
+ T.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = T.getVerticalPos();
1870
+ const n = ct();
1871
+ n.x = t.startx, n.y = t.starty, n.width = t.width || l.width, n.class = "note";
1872
+ const s = e.append("g"), r = V.drawRect(s, n), i = Kt();
1873
+ i.x = t.startx, i.y = t.starty, i.width = n.width, i.dy = "1em", i.text = t.message, i.class = "noteText", i.fontFamily = l.noteFontFamily, i.fontSize = l.noteFontSize, i.fontWeight = l.noteFontWeight, i.anchor = l.noteAlign, i.textMargin = l.noteMargin, i.valign = "center";
1874
+ const c = z(i.text) ? await Rt(s, i) : wt(s, i), h = Math.round(
1875
+ c.map((o) => (o._groups || o)[0][0].getBBox().height).reduce((o, a) => o + a)
1876
+ );
1877
+ r.attr("height", h + 2 * l.noteMargin), t.height += h + 2 * l.noteMargin, T.bumpVerticalPos(h + 2 * l.noteMargin), t.stopy = t.starty + h + 2 * l.noteMargin, t.stopx = t.startx + n.width, T.insert(t.startx, t.starty, t.stopx, t.stopy), T.models.addNote(t);
1878
+ }, "drawNote"), Et = /* @__PURE__ */ f((e) => ({
1879
+ fontFamily: e.messageFontFamily,
1880
+ fontSize: e.messageFontSize,
1881
+ fontWeight: e.messageFontWeight
1882
+ }), "messageFont"), mt = /* @__PURE__ */ f((e) => ({
1883
+ fontFamily: e.noteFontFamily,
1884
+ fontSize: e.noteFontSize,
1885
+ fontWeight: e.noteFontWeight
1886
+ }), "noteFont"), Ut = /* @__PURE__ */ f((e) => ({
1887
+ fontFamily: e.actorFontFamily,
1888
+ fontSize: e.actorFontSize,
1889
+ fontWeight: e.actorFontWeight
1890
+ }), "actorFont");
1891
+ async function he(e, t) {
1892
+ T.bumpVerticalPos(10);
1893
+ const { startx: n, stopx: s, message: r } = t, i = I.splitBreaks(r).length, c = z(r), h = c ? await Lt(r, st()) : W.calculateTextDimensions(r, Et(l));
1894
+ if (!c) {
1895
+ const g = h.height / i;
1896
+ t.height += g, T.bumpVerticalPos(g);
1897
+ }
1898
+ let o, a = h.height - 10;
1899
+ const p = h.width;
1900
+ if (n === s) {
1901
+ o = T.getVerticalPos() + a, l.rightAngles || (a += l.boxMargin, o = T.getVerticalPos() + a), a += 30;
1902
+ const g = I.getMax(p / 2, l.width / 2);
1903
+ T.insert(
1904
+ n - g,
1905
+ T.getVerticalPos() - 10 + a,
1906
+ s + g,
1907
+ T.getVerticalPos() + 30 + a
1908
+ );
1909
+ } else
1910
+ a += l.boxMargin, o = T.getVerticalPos() + a, T.insert(n, o - 10, s, o);
1911
+ return T.bumpVerticalPos(a), t.height += a, t.stopy = t.starty + t.height, T.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), o;
1912
+ }
1913
+ f(he, "boundMessage");
1914
+ var gs = /* @__PURE__ */ f(async function(e, t, n, s) {
1915
+ const { startx: r, stopx: i, starty: c, message: h, type: o, sequenceIndex: a, sequenceVisible: p } = t, g = W.calculateTextDimensions(h, Et(l)), x = Kt();
1916
+ x.x = r, x.y = c + 10, x.width = i - r, x.class = "messageText", x.dy = "1em", x.text = h, x.fontFamily = l.messageFontFamily, x.fontSize = l.messageFontSize, x.fontWeight = l.messageFontWeight, x.anchor = l.messageAlign, x.valign = "center", x.textMargin = l.wrapPadding, x.tspan = false, z(x.text) ? await Rt(e, x, { startx: r, stopx: i, starty: n }) : wt(e, x);
1917
+ const y = g.width;
1918
+ let m;
1919
+ r === i ? l.rightAngles ? m = e.append("path").attr(
1920
+ "d",
1921
+ `M ${r},${n} H ${r + I.getMax(l.width / 2, y / 2)} V ${n + 25} H ${r}`
1922
+ ) : m = e.append("path").attr(
1923
+ "d",
1924
+ "M " + r + "," + n + " C " + (r + 60) + "," + (n - 10) + " " + (r + 60) + "," + (n + 30) + " " + r + "," + (n + 20)
1925
+ ) : (m = e.append("line"), m.attr("x1", r), m.attr("y1", n), m.attr("x2", i), m.attr("y2", n)), o === s.db.LINETYPE.DOTTED || o === s.db.LINETYPE.DOTTED_CROSS || o === s.db.LINETYPE.DOTTED_POINT || o === s.db.LINETYPE.DOTTED_OPEN || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (m.style("stroke-dasharray", "3, 3"), m.attr("class", "messageLine1")) : m.attr("class", "messageLine0");
1926
+ let w = "";
1927
+ l.arrowMarkerAbsolute && (w = Ce(true)), m.attr("stroke-width", 2), m.attr("stroke", "none"), m.style("fill", "none"), (o === s.db.LINETYPE.SOLID || o === s.db.LINETYPE.DOTTED) && m.attr("marker-end", "url(" + w + "#arrowhead)"), (o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (m.attr("marker-start", "url(" + w + "#arrowhead)"), m.attr("marker-end", "url(" + w + "#arrowhead)")), (o === s.db.LINETYPE.SOLID_POINT || o === s.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + w + "#filled-head)"), (o === s.db.LINETYPE.SOLID_CROSS || o === s.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + w + "#crosshead)"), (p || l.showSequenceNumbers) && ((o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (r < i ? m.attr("x1", r + 12) : m.attr("x1", r + 6)), e.append("line").attr("x1", r).attr("y1", n).attr("x2", r).attr("y2", n).attr("stroke-width", 0).attr("marker-start", "url(" + w + "#sequencenumber)"), e.append("text").attr("x", r).attr("y", n + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(a));
1928
+ }, "drawMessage"), xs = /* @__PURE__ */ f(function(e, t, n, s, r, i, c) {
1929
+ let h = 0, o = 0, a, p = 0;
1930
+ for (const g of s) {
1931
+ const x = t.get(g), y = x.box;
1932
+ a && a != y && (c || T.models.addBox(a), o += l.boxMargin + a.margin), y && y != a && (c || (y.x = h + o, y.y = r), o += y.margin), x.width = x.width || l.width, x.height = I.getMax(x.height || l.height, l.height), x.margin = x.margin || l.actorMargin, p = I.getMax(p, x.height), n.get(x.name) && (o += x.width / 2), x.x = h + o, x.starty = T.getVerticalPos(), T.insert(x.x, r, x.x + x.width, x.height), h += x.width + o, x.box && (x.box.width = h + y.margin - x.box.x), o = x.margin, a = x.box, T.models.addActor(x);
1933
+ }
1934
+ a && !c && T.models.addBox(a), T.bumpVerticalPos(p);
1935
+ }, "addActorRenderingData"), Gt = /* @__PURE__ */ f(async function(e, t, n, s) {
1936
+ if (s) {
1937
+ let r = 0;
1938
+ T.bumpVerticalPos(l.boxMargin * 2);
1939
+ for (const i of n) {
1940
+ const c = t.get(i);
1941
+ c.stopy || (c.stopy = T.getVerticalPos());
1942
+ const h = await V.drawActor(e, c, l, true);
1943
+ r = I.getMax(r, h);
1944
+ }
1945
+ T.bumpVerticalPos(r + l.boxMargin);
1946
+ } else
1947
+ for (const r of n) {
1948
+ const i = t.get(r);
1949
+ await V.drawActor(e, i, l, false);
1950
+ }
1951
+ }, "drawActors"), de = /* @__PURE__ */ f(function(e, t, n, s) {
1952
+ let r = 0, i = 0;
1953
+ for (const c of n) {
1954
+ const h = t.get(c), o = ys(h), a = V.drawPopup(
1955
+ e,
1956
+ h,
1957
+ o,
1958
+ l,
1959
+ l.forceMenus,
1960
+ s
1961
+ );
1962
+ a.height > r && (r = a.height), a.width + h.x > i && (i = a.width + h.x);
1963
+ }
1964
+ return { maxHeight: r, maxWidth: i };
1965
+ }, "drawActorsPopup"), pe = /* @__PURE__ */ f(function(e) {
1966
+ Le(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);
1967
+ }, "setConf"), Ot = /* @__PURE__ */ f(function(e) {
1968
+ return T.activations.filter(function(t) {
1969
+ return t.actor === e;
1970
+ });
1971
+ }, "actorActivations"), se = /* @__PURE__ */ f(function(e, t) {
1972
+ const n = t.get(e), s = Ot(e), r = s.reduce(
1973
+ function(c, h) {
1974
+ return I.getMin(c, h.startx);
1975
+ },
1976
+ n.x + n.width / 2 - 1
1977
+ ), i = s.reduce(
1978
+ function(c, h) {
1979
+ return I.getMax(c, h.stopx);
1980
+ },
1981
+ n.x + n.width / 2 + 1
1982
+ );
1983
+ return [r, i];
1984
+ }, "activationBounds");
1985
+ function nt(e, t, n, s, r) {
1986
+ T.bumpVerticalPos(n);
1987
+ let i = s;
1988
+ if (t.id && t.message && e[t.id]) {
1989
+ const c = e[t.id].width, h = Et(l);
1990
+ t.message = W.wrapLabel(`[${t.message}]`, c - 2 * l.wrapPadding, h), t.width = c, t.wrap = true;
1991
+ const o = W.calculateTextDimensions(t.message, h), a = I.getMax(o.height, l.labelBoxHeight);
1992
+ i = s + a, Q.debug(`${a} - ${t.message}`);
1993
+ }
1994
+ r(t), T.bumpVerticalPos(i);
1995
+ }
1996
+ f(nt, "adjustLoopHeightForWrap");
1997
+ function ue(e, t, n, s, r, i, c) {
1998
+ function h(p, g) {
1999
+ p.x < r.get(e.from).x ? (T.insert(
2000
+ t.stopx - g,
2001
+ t.starty,
2002
+ t.startx,
2003
+ t.stopy + p.height / 2 + l.noteMargin
2004
+ ), t.stopx = t.stopx + g) : (T.insert(
2005
+ t.startx,
2006
+ t.starty,
2007
+ t.stopx + g,
2008
+ t.stopy + p.height / 2 + l.noteMargin
2009
+ ), t.stopx = t.stopx - g);
2010
+ }
2011
+ f(h, "receiverAdjustment");
2012
+ function o(p, g) {
2013
+ p.x < r.get(e.to).x ? (T.insert(
2014
+ t.startx - g,
2015
+ t.starty,
2016
+ t.stopx,
2017
+ t.stopy + p.height / 2 + l.noteMargin
2018
+ ), t.startx = t.startx + g) : (T.insert(
2019
+ t.stopx,
2020
+ t.starty,
2021
+ t.startx + g,
2022
+ t.stopy + p.height / 2 + l.noteMargin
2023
+ ), t.startx = t.startx - g);
2024
+ }
2025
+ f(o, "senderAdjustment");
2026
+ const a = [
2027
+ Mt.ACTOR,
2028
+ Mt.CONTROL,
2029
+ Mt.ENTITY,
2030
+ Mt.DATABASE
2031
+ ];
2032
+ if (i.get(e.to) == s) {
2033
+ const p = r.get(e.to), g = a.includes(p.type) ? Tt / 2 + 3 : p.width / 2 + 3;
2034
+ h(p, g), p.starty = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2035
+ } else if (c.get(e.from) == s) {
2036
+ const p = r.get(e.from);
2037
+ if (l.mirrorActors) {
2038
+ const g = a.includes(p.type) ? Tt / 2 : p.width / 2;
2039
+ o(p, g);
2040
+ }
2041
+ p.stopy = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2042
+ } else if (c.get(e.to) == s) {
2043
+ const p = r.get(e.to);
2044
+ if (l.mirrorActors) {
2045
+ const g = a.includes(p.type) ? Tt / 2 + 3 : p.width / 2 + 3;
2046
+ h(p, g);
2047
+ }
2048
+ p.stopy = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2049
+ }
2050
+ }
2051
+ f(ue, "adjustCreatedDestroyedData");
2052
+ var fs = /* @__PURE__ */ f(async function(e, t, n, s) {
2053
+ const { securityLevel: r, sequence: i } = st();
2054
+ l = i;
2055
+ let c;
2056
+ r === "sandbox" && (c = Nt("#i" + t));
2057
+ const h = r === "sandbox" ? Nt(c.nodes()[0].contentDocument.body) : Nt("body"), o = r === "sandbox" ? c.nodes()[0].contentDocument : document;
2058
+ T.init(), Q.debug(s.db);
2059
+ const a = r === "sandbox" ? h.select(`[id="${t}"]`) : Nt(`[id="${t}"]`), p = s.db.getActors(), g = s.db.getCreatedActors(), x = s.db.getDestroyedActors(), y = s.db.getBoxes();
2060
+ let m = s.db.getActorKeys();
2061
+ const w = s.db.getMessages(), k = s.db.getDiagramTitle(), N = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), O = await ge(p, w, s);
2062
+ if (l.height = await xe(p, O, y), V.insertComputerIcon(a), V.insertDatabaseIcon(a), V.insertClockIcon(a), N && (T.bumpVerticalPos(l.boxMargin), S && T.bumpVerticalPos(y[0].textMaxHeight)), l.hideUnusedParticipants === true) {
2063
+ const E = /* @__PURE__ */ new Set();
2064
+ w.forEach((_) => {
2065
+ E.add(_.from), E.add(_.to);
2066
+ }), m = m.filter((_) => E.has(_));
2067
+ }
2068
+ xs(a, p, g, m, 0, w, false);
2069
+ const B = await bs(w, p, O, s);
2070
+ V.insertArrowHead(a), V.insertArrowCrossHead(a), V.insertArrowFilledHead(a), V.insertSequenceNumber(a);
2071
+ function q(E, _) {
2072
+ const X = T.endActivation(E);
2073
+ X.starty + 18 > _ && (X.starty = _ - 6, _ += 12), V.drawActivation(
2074
+ a,
2075
+ X,
2076
+ _,
2077
+ l,
2078
+ Ot(E.from).length
2079
+ ), T.insert(X.startx, _ - 10, X.stopx, _);
2080
+ }
2081
+ f(q, "activeEnd");
2082
+ let H = 1, Z = 1;
2083
+ const at = [], U = [];
2084
+ let G = 0;
2085
+ for (const E of w) {
2086
+ let _, X, tt;
2087
+ switch (E.type) {
2088
+ case s.db.LINETYPE.NOTE:
2089
+ T.resetVerticalPos(), X = E.noteModel, await us(a, X);
2090
+ break;
2091
+ case s.db.LINETYPE.ACTIVE_START:
2092
+ T.newActivation(E, a, p);
2093
+ break;
2094
+ case s.db.LINETYPE.ACTIVE_END:
2095
+ q(E, T.getVerticalPos());
2096
+ break;
2097
+ case s.db.LINETYPE.LOOP_START:
2098
+ nt(
2099
+ B,
2100
+ E,
2101
+ l.boxMargin,
2102
+ l.boxMargin + l.boxTextMargin,
2103
+ (M) => T.newLoop(M)
2104
+ );
2105
+ break;
2106
+ case s.db.LINETYPE.LOOP_END:
2107
+ _ = T.endLoop(), await V.drawLoop(a, _, "loop", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2108
+ break;
2109
+ case s.db.LINETYPE.RECT_START:
2110
+ nt(
2111
+ B,
2112
+ E,
2113
+ l.boxMargin,
2114
+ l.boxMargin,
2115
+ (M) => T.newLoop(void 0, M.message)
2116
+ );
2117
+ break;
2118
+ case s.db.LINETYPE.RECT_END:
2119
+ _ = T.endLoop(), U.push(_), T.models.addLoop(_), T.bumpVerticalPos(_.stopy - T.getVerticalPos());
2120
+ break;
2121
+ case s.db.LINETYPE.OPT_START:
2122
+ nt(
2123
+ B,
2124
+ E,
2125
+ l.boxMargin,
2126
+ l.boxMargin + l.boxTextMargin,
2127
+ (M) => T.newLoop(M)
2128
+ );
2129
+ break;
2130
+ case s.db.LINETYPE.OPT_END:
2131
+ _ = T.endLoop(), await V.drawLoop(a, _, "opt", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2132
+ break;
2133
+ case s.db.LINETYPE.ALT_START:
2134
+ nt(
2135
+ B,
2136
+ E,
2137
+ l.boxMargin,
2138
+ l.boxMargin + l.boxTextMargin,
2139
+ (M) => T.newLoop(M)
2140
+ );
2141
+ break;
2142
+ case s.db.LINETYPE.ALT_ELSE:
2143
+ nt(
2144
+ B,
2145
+ E,
2146
+ l.boxMargin + l.boxTextMargin,
2147
+ l.boxMargin,
2148
+ (M) => T.addSectionToLoop(M)
2149
+ );
2150
+ break;
2151
+ case s.db.LINETYPE.ALT_END:
2152
+ _ = T.endLoop(), await V.drawLoop(a, _, "alt", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2153
+ break;
2154
+ case s.db.LINETYPE.PAR_START:
2155
+ case s.db.LINETYPE.PAR_OVER_START:
2156
+ nt(
2157
+ B,
2158
+ E,
2159
+ l.boxMargin,
2160
+ l.boxMargin + l.boxTextMargin,
2161
+ (M) => T.newLoop(M)
2162
+ ), T.saveVerticalPos();
2163
+ break;
2164
+ case s.db.LINETYPE.PAR_AND:
2165
+ nt(
2166
+ B,
2167
+ E,
2168
+ l.boxMargin + l.boxTextMargin,
2169
+ l.boxMargin,
2170
+ (M) => T.addSectionToLoop(M)
2171
+ );
2172
+ break;
2173
+ case s.db.LINETYPE.PAR_END:
2174
+ _ = T.endLoop(), await V.drawLoop(a, _, "par", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2175
+ break;
2176
+ case s.db.LINETYPE.AUTONUMBER:
2177
+ H = E.message.start || H, Z = E.message.step || Z, E.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
2178
+ break;
2179
+ case s.db.LINETYPE.CRITICAL_START:
2180
+ nt(
2181
+ B,
2182
+ E,
2183
+ l.boxMargin,
2184
+ l.boxMargin + l.boxTextMargin,
2185
+ (M) => T.newLoop(M)
2186
+ );
2187
+ break;
2188
+ case s.db.LINETYPE.CRITICAL_OPTION:
2189
+ nt(
2190
+ B,
2191
+ E,
2192
+ l.boxMargin + l.boxTextMargin,
2193
+ l.boxMargin,
2194
+ (M) => T.addSectionToLoop(M)
2195
+ );
2196
+ break;
2197
+ case s.db.LINETYPE.CRITICAL_END:
2198
+ _ = T.endLoop(), await V.drawLoop(a, _, "critical", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2199
+ break;
2200
+ case s.db.LINETYPE.BREAK_START:
2201
+ nt(
2202
+ B,
2203
+ E,
2204
+ l.boxMargin,
2205
+ l.boxMargin + l.boxTextMargin,
2206
+ (M) => T.newLoop(M)
2207
+ );
2208
+ break;
2209
+ case s.db.LINETYPE.BREAK_END:
2210
+ _ = T.endLoop(), await V.drawLoop(a, _, "break", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2211
+ break;
2212
+ default:
2213
+ try {
2214
+ tt = E.msgModel, tt.starty = T.getVerticalPos(), tt.sequenceIndex = H, tt.sequenceVisible = s.db.showSequenceNumbers();
2215
+ const M = await he(a, tt);
2216
+ ue(
2217
+ E,
2218
+ tt,
2219
+ M,
2220
+ G,
2221
+ p,
2222
+ g,
2223
+ x
2224
+ ), at.push({ messageModel: tt, lineStartY: M }), T.models.addMessage(tt);
2225
+ } catch (M) {
2226
+ Q.error("error while drawing message", M);
2227
+ }
2228
+ }
2229
+ [
2230
+ s.db.LINETYPE.SOLID_OPEN,
2231
+ s.db.LINETYPE.DOTTED_OPEN,
2232
+ s.db.LINETYPE.SOLID,
2233
+ s.db.LINETYPE.DOTTED,
2234
+ s.db.LINETYPE.SOLID_CROSS,
2235
+ s.db.LINETYPE.DOTTED_CROSS,
2236
+ s.db.LINETYPE.SOLID_POINT,
2237
+ s.db.LINETYPE.DOTTED_POINT,
2238
+ s.db.LINETYPE.BIDIRECTIONAL_SOLID,
2239
+ s.db.LINETYPE.BIDIRECTIONAL_DOTTED
2240
+ ].includes(E.type) && (H = H + Z), G++;
2241
+ }
2242
+ Q.debug("createdActors", g), Q.debug("destroyedActors", x), await Gt(a, p, m, false);
2243
+ for (const E of at)
2244
+ await gs(a, E.messageModel, E.lineStartY, s);
2245
+ l.mirrorActors && await Gt(a, p, m, true), U.forEach((E) => V.drawBackgroundRect(a, E)), oe(a, p, m, l);
2246
+ for (const E of T.models.boxes) {
2247
+ E.height = T.getVerticalPos() - E.y, T.insert(E.x, E.y, E.x + E.width, E.height);
2248
+ const _ = l.boxMargin * 2;
2249
+ E.startx = E.x - _, E.starty = E.y - _ * 0.25, E.stopx = E.startx + E.width + 2 * _, E.stopy = E.starty + E.height + _ * 0.75, E.stroke = "rgb(0,0,0, 0.5)", V.drawBox(a, E, l);
2250
+ }
2251
+ N && T.bumpVerticalPos(l.boxMargin);
2252
+ const F = de(a, p, m, o), { bounds: D } = T.getBounds();
2253
+ D.startx === void 0 && (D.startx = 0), D.starty === void 0 && (D.starty = 0), D.stopx === void 0 && (D.stopx = 0), D.stopy === void 0 && (D.stopy = 0);
2254
+ let $ = D.stopy - D.starty;
2255
+ $ < F.maxHeight && ($ = F.maxHeight);
2256
+ let K = $ + 2 * l.diagramMarginY;
2257
+ l.mirrorActors && (K = K - l.boxMargin + l.bottomMarginAdj);
2258
+ let j = D.stopx - D.startx;
2259
+ j < F.maxWidth && (j = F.maxWidth);
2260
+ const rt = j + 2 * l.diagramMarginX;
2261
+ k && a.append("text").text(k).attr("x", (D.stopx - D.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), Ie(a, K, rt, l.useMaxWidth);
2262
+ const R = k ? 40 : 0;
2263
+ a.attr(
2264
+ "viewBox",
2265
+ D.startx - l.diagramMarginX + " -" + (l.diagramMarginY + R) + " " + rt + " " + (K + R)
2266
+ ), Q.debug("models:", T.models);
2267
+ }, "draw");
2268
+ async function ge(e, t, n) {
2269
+ const s = {};
2270
+ for (const r of t)
2271
+ if (e.get(r.to) && e.get(r.from)) {
2272
+ const i = e.get(r.to);
2273
+ if (r.placement === n.db.PLACEMENT.LEFTOF && !i.prevActor || r.placement === n.db.PLACEMENT.RIGHTOF && !i.nextActor)
2274
+ continue;
2275
+ const c = r.placement !== void 0, h = !c, o = c ? mt(l) : Et(l), a = r.wrap ? W.wrapLabel(r.message, l.width - 2 * l.wrapPadding, o) : r.message, g = (z(a) ? await Lt(r.message, st()) : W.calculateTextDimensions(a, o)).width + 2 * l.wrapPadding;
2276
+ h && r.from === i.nextActor ? s[r.to] = I.getMax(
2277
+ s[r.to] || 0,
2278
+ g
2279
+ ) : h && r.from === i.prevActor ? s[r.from] = I.getMax(
2280
+ s[r.from] || 0,
2281
+ g
2282
+ ) : h && r.from === r.to ? (s[r.from] = I.getMax(
2283
+ s[r.from] || 0,
2284
+ g / 2
2285
+ ), s[r.to] = I.getMax(
2286
+ s[r.to] || 0,
2287
+ g / 2
2288
+ )) : r.placement === n.db.PLACEMENT.RIGHTOF ? s[r.from] = I.getMax(
2289
+ s[r.from] || 0,
2290
+ g
2291
+ ) : r.placement === n.db.PLACEMENT.LEFTOF ? s[i.prevActor] = I.getMax(
2292
+ s[i.prevActor] || 0,
2293
+ g
2294
+ ) : r.placement === n.db.PLACEMENT.OVER && (i.prevActor && (s[i.prevActor] = I.getMax(
2295
+ s[i.prevActor] || 0,
2296
+ g / 2
2297
+ )), i.nextActor && (s[r.from] = I.getMax(
2298
+ s[r.from] || 0,
2299
+ g / 2
2300
+ )));
2301
+ }
2302
+ return Q.debug("maxMessageWidthPerActor:", s), s;
2303
+ }
2304
+ f(ge, "getMaxMessageWidthPerActor");
2305
+ var ys = /* @__PURE__ */ f(function(e) {
2306
+ let t = 0;
2307
+ const n = Ut(l);
2308
+ for (const s in e.links) {
2309
+ const i = W.calculateTextDimensions(s, n).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2310
+ t < i && (t = i);
2311
+ }
2312
+ return t;
2313
+ }, "getRequiredPopupWidth");
2314
+ async function xe(e, t, n) {
2315
+ let s = 0;
2316
+ for (const i of e.keys()) {
2317
+ const c = e.get(i);
2318
+ c.wrap && (c.description = W.wrapLabel(
2319
+ c.description,
2320
+ l.width - 2 * l.wrapPadding,
2321
+ Ut(l)
2322
+ ));
2323
+ const h = z(c.description) ? await Lt(c.description, st()) : W.calculateTextDimensions(c.description, Ut(l));
2324
+ c.width = c.wrap ? l.width : I.getMax(l.width, h.width + 2 * l.wrapPadding), c.height = c.wrap ? I.getMax(h.height, l.height) : l.height, s = I.getMax(s, c.height);
2325
+ }
2326
+ for (const i in t) {
2327
+ const c = e.get(i);
2328
+ if (!c)
2329
+ continue;
2330
+ const h = e.get(c.nextActor);
2331
+ if (!h) {
2332
+ const g = t[i] + l.actorMargin - c.width / 2;
2333
+ c.margin = I.getMax(g, l.actorMargin);
2334
+ continue;
2335
+ }
2336
+ const a = t[i] + l.actorMargin - c.width / 2 - h.width / 2;
2337
+ c.margin = I.getMax(a, l.actorMargin);
2338
+ }
2339
+ let r = 0;
2340
+ return n.forEach((i) => {
2341
+ const c = Et(l);
2342
+ let h = i.actorKeys.reduce((g, x) => g += e.get(x).width + (e.get(x).margin || 0), 0);
2343
+ const o = l.boxMargin * 8;
2344
+ h += o, h -= 2 * l.boxTextMargin, i.wrap && (i.name = W.wrapLabel(i.name, h - 2 * l.wrapPadding, c));
2345
+ const a = W.calculateTextDimensions(i.name, c);
2346
+ r = I.getMax(a.height, r);
2347
+ const p = I.getMax(h, a.width + 2 * l.wrapPadding);
2348
+ if (i.margin = l.boxTextMargin, h < p) {
2349
+ const g = (p - h) / 2;
2350
+ i.margin += g;
2351
+ }
2352
+ }), n.forEach((i) => i.textMaxHeight = r), I.getMax(s, l.height);
2353
+ }
2354
+ f(xe, "calculateActorMargins");
2355
+ var Ts = /* @__PURE__ */ f(async function(e, t, n) {
2356
+ const s = t.get(e.from), r = t.get(e.to), i = s.x, c = r.x, h = e.wrap && e.message;
2357
+ let o = z(e.message) ? await Lt(e.message, st()) : W.calculateTextDimensions(
2358
+ h ? W.wrapLabel(e.message, l.width, mt(l)) : e.message,
2359
+ mt(l)
2360
+ );
2361
+ const a = {
2362
+ width: h ? l.width : I.getMax(l.width, o.width + 2 * l.noteMargin),
2363
+ height: 0,
2364
+ startx: s.x,
2365
+ stopx: 0,
2366
+ starty: 0,
2367
+ stopy: 0,
2368
+ message: e.message
2369
+ };
2370
+ return e.placement === n.db.PLACEMENT.RIGHTOF ? (a.width = h ? I.getMax(l.width, o.width) : I.getMax(
2371
+ s.width / 2 + r.width / 2,
2372
+ o.width + 2 * l.noteMargin
2373
+ ), a.startx = i + (s.width + l.actorMargin) / 2) : e.placement === n.db.PLACEMENT.LEFTOF ? (a.width = h ? I.getMax(l.width, o.width + 2 * l.noteMargin) : I.getMax(
2374
+ s.width / 2 + r.width / 2,
2375
+ o.width + 2 * l.noteMargin
2376
+ ), a.startx = i - a.width + (s.width - l.actorMargin) / 2) : e.to === e.from ? (o = W.calculateTextDimensions(
2377
+ h ? W.wrapLabel(e.message, I.getMax(l.width, s.width), mt(l)) : e.message,
2378
+ mt(l)
2379
+ ), a.width = h ? I.getMax(l.width, s.width) : I.getMax(s.width, l.width, o.width + 2 * l.noteMargin), a.startx = i + (s.width - a.width) / 2) : (a.width = Math.abs(i + s.width / 2 - (c + r.width / 2)) + l.actorMargin, a.startx = i < c ? i + s.width / 2 - l.actorMargin / 2 : c + r.width / 2 - l.actorMargin / 2), h && (a.message = W.wrapLabel(
2380
+ e.message,
2381
+ a.width - 2 * l.wrapPadding,
2382
+ mt(l)
2383
+ )), Q.debug(
2384
+ `NM:[${a.startx},${a.stopx},${a.starty},${a.stopy}:${a.width},${a.height}=${e.message}]`
2385
+ ), a;
2386
+ }, "buildNoteModel"), Es = /* @__PURE__ */ f(function(e, t, n) {
2387
+ if (![
2388
+ n.db.LINETYPE.SOLID_OPEN,
2389
+ n.db.LINETYPE.DOTTED_OPEN,
2390
+ n.db.LINETYPE.SOLID,
2391
+ n.db.LINETYPE.DOTTED,
2392
+ n.db.LINETYPE.SOLID_CROSS,
2393
+ n.db.LINETYPE.DOTTED_CROSS,
2394
+ n.db.LINETYPE.SOLID_POINT,
2395
+ n.db.LINETYPE.DOTTED_POINT,
2396
+ n.db.LINETYPE.BIDIRECTIONAL_SOLID,
2397
+ n.db.LINETYPE.BIDIRECTIONAL_DOTTED
2398
+ ].includes(e.type))
2399
+ return {};
2400
+ const [s, r] = se(e.from, t), [i, c] = se(e.to, t), h = s <= i;
2401
+ let o = h ? r : s, a = h ? i : c;
2402
+ const p = Math.abs(i - c) > 2, g = /* @__PURE__ */ f((w) => h ? -w : w, "adjustValue");
2403
+ e.from === e.to ? a = o : (e.activate && !p && (a += g(l.activationWidth / 2 - 1)), [n.db.LINETYPE.SOLID_OPEN, n.db.LINETYPE.DOTTED_OPEN].includes(e.type) || (a += g(3)), [n.db.LINETYPE.BIDIRECTIONAL_SOLID, n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2404
+ e.type
2405
+ ) && (o -= g(3)));
2406
+ const x = [s, r, i, c], y = Math.abs(o - a);
2407
+ e.wrap && e.message && (e.message = W.wrapLabel(
2408
+ e.message,
2409
+ I.getMax(y + 2 * l.wrapPadding, l.width),
2410
+ Et(l)
2411
+ ));
2412
+ const m = W.calculateTextDimensions(e.message, Et(l));
2413
+ return {
2414
+ width: I.getMax(
2415
+ e.wrap ? 0 : m.width + 2 * l.wrapPadding,
2416
+ y + 2 * l.wrapPadding,
2417
+ l.width
2418
+ ),
2419
+ height: 0,
2420
+ startx: o,
2421
+ stopx: a,
2422
+ starty: 0,
2423
+ stopy: 0,
2424
+ message: e.message,
2425
+ type: e.type,
2426
+ wrap: e.wrap,
2427
+ fromBounds: Math.min.apply(null, x),
2428
+ toBounds: Math.max.apply(null, x)
2429
+ };
2430
+ }, "buildMessageModel"), bs = /* @__PURE__ */ f(async function(e, t, n, s) {
2431
+ const r = {}, i = [];
2432
+ let c, h, o;
2433
+ for (const a of e) {
2434
+ switch (a.type) {
2435
+ case s.db.LINETYPE.LOOP_START:
2436
+ case s.db.LINETYPE.ALT_START:
2437
+ case s.db.LINETYPE.OPT_START:
2438
+ case s.db.LINETYPE.PAR_START:
2439
+ case s.db.LINETYPE.PAR_OVER_START:
2440
+ case s.db.LINETYPE.CRITICAL_START:
2441
+ case s.db.LINETYPE.BREAK_START:
2442
+ i.push({
2443
+ id: a.id,
2444
+ msg: a.message,
2445
+ from: Number.MAX_SAFE_INTEGER,
2446
+ to: Number.MIN_SAFE_INTEGER,
2447
+ width: 0
2448
+ });
2449
+ break;
2450
+ case s.db.LINETYPE.ALT_ELSE:
2451
+ case s.db.LINETYPE.PAR_AND:
2452
+ case s.db.LINETYPE.CRITICAL_OPTION:
2453
+ a.message && (c = i.pop(), r[c.id] = c, r[a.id] = c, i.push(c));
2454
+ break;
2455
+ case s.db.LINETYPE.LOOP_END:
2456
+ case s.db.LINETYPE.ALT_END:
2457
+ case s.db.LINETYPE.OPT_END:
2458
+ case s.db.LINETYPE.PAR_END:
2459
+ case s.db.LINETYPE.CRITICAL_END:
2460
+ case s.db.LINETYPE.BREAK_END:
2461
+ c = i.pop(), r[c.id] = c;
2462
+ break;
2463
+ case s.db.LINETYPE.ACTIVE_START:
2464
+ {
2465
+ const g = t.get(a.from ? a.from : a.to.actor), x = Ot(a.from ? a.from : a.to.actor).length, y = g.x + g.width / 2 + (x - 1) * l.activationWidth / 2, m = {
2466
+ startx: y,
2467
+ stopx: y + l.activationWidth,
2468
+ actor: a.from,
2469
+ enabled: true
2470
+ };
2471
+ T.activations.push(m);
2472
+ }
2473
+ break;
2474
+ case s.db.LINETYPE.ACTIVE_END:
2475
+ {
2476
+ const g = T.activations.map((x) => x.actor).lastIndexOf(a.from);
2477
+ T.activations.splice(g, 1).splice(0, 1);
2478
+ }
2479
+ break;
2480
+ }
2481
+ a.placement !== void 0 ? (h = await Ts(a, t, s), a.noteModel = h, i.forEach((g) => {
2482
+ c = g, c.from = I.getMin(c.from, h.startx), c.to = I.getMax(c.to, h.startx + h.width), c.width = I.getMax(c.width, Math.abs(c.from - c.to)) - l.labelBoxWidth;
2483
+ })) : (o = Es(a, t, s), a.msgModel = o, o.startx && o.stopx && i.length > 0 && i.forEach((g) => {
2484
+ if (c = g, o.startx === o.stopx) {
2485
+ const x = t.get(a.from), y = t.get(a.to);
2486
+ c.from = I.getMin(
2487
+ x.x - o.width / 2,
2488
+ x.x - x.width / 2,
2489
+ c.from
2490
+ ), c.to = I.getMax(
2491
+ y.x + o.width / 2,
2492
+ y.x + x.width / 2,
2493
+ c.to
2494
+ ), c.width = I.getMax(c.width, Math.abs(c.to - c.from)) - l.labelBoxWidth;
2495
+ } else
2496
+ c.from = I.getMin(o.startx, c.from), c.to = I.getMax(o.stopx, c.to), c.width = I.getMax(c.width, o.width) - l.labelBoxWidth;
2497
+ }));
2498
+ }
2499
+ return T.activations = [], Q.debug("Loop type widths:", r), r;
2500
+ }, "calculateLoopBounds"), ms = {
2501
+ bounds: T,
2502
+ drawActors: Gt,
2503
+ drawActorsPopup: de,
2504
+ setConf: pe,
2505
+ draw: fs
2506
+ }, Ls = {
2507
+ parser: Be,
2508
+ get db() {
2509
+ return new Fe();
2510
+ },
2511
+ renderer: ms,
2512
+ styles: ze,
2513
+ init: /* @__PURE__ */ f((e) => {
2514
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, ve({ sequence: { wrap: e.wrap } }));
2515
+ }, "init")
2516
+ };
2517
+ export {
2518
+ Ls as diagram
2519
+ };