@ucap-llm/ai-ui 1.1.13 → 1.1.15

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 (111) hide show
  1. package/_basePickBy-DMehTBs0-8955b30b.mjs +151 -0
  2. package/_basePickBy-e7598e72.mjs +153 -0
  3. package/{_baseUniq-2bcae05e.mjs → _baseUniq-8cd7fbc4.mjs} +150 -150
  4. package/_baseUniq-DPnX6tpB-5eb6efbd.mjs +615 -0
  5. package/ai-ui.es.js +9 -8
  6. package/ai-ui.umd.js +3425 -923
  7. package/arc-8909f880.mjs +85 -0
  8. package/arc-qimaJRLH-591a6072.mjs +85 -0
  9. package/architecture-4AB2E3PP-DFmEpUnA-62fe65dd.mjs +10 -0
  10. package/architecture-4AB2E3PP-b04ae9dd.mjs +10 -0
  11. package/{architectureDiagram-IEHRJDOE-e4684ef3.mjs → architectureDiagram-IEHRJDOE-1ccc2c64.mjs} +123 -123
  12. package/architectureDiagram-IEHRJDOE-BRVAVUEE-c068faae.mjs +4641 -0
  13. package/{blockDiagram-JOT3LUYC-504ee31e.mjs → blockDiagram-JOT3LUYC-63569de5.mjs} +5 -5
  14. package/blockDiagram-JOT3LUYC-Cs4tSRey-54d8e29b.mjs +2251 -0
  15. package/{c4Diagram-VJAJSXHY-c5ba6af4.mjs → c4Diagram-VJAJSXHY-355a4170.mjs} +23 -23
  16. package/c4Diagram-VJAJSXHY-C3F9fO0L-0df97cd8.mjs +1583 -0
  17. package/channel-CuHzivgY-bb3d765a.mjs +5 -0
  18. package/channel-a1f4f18c.mjs +5 -0
  19. package/{chunk-4BMEZGHF-8d9a2e4f.mjs → chunk-4BMEZGHF-705995af.mjs} +1 -1
  20. package/chunk-4BMEZGHF-btTOjzEX-c9c5432c.mjs +9 -0
  21. package/{chunk-A2AXSNBT-41ae29f2.mjs → chunk-A2AXSNBT-3a857566.mjs} +10 -10
  22. package/chunk-A2AXSNBT-CPBZRsS7-a80df701.mjs +1373 -0
  23. package/{chunk-AEK57VVT-69e121d6.mjs → chunk-AEK57VVT-6c60e1ee.mjs} +45 -45
  24. package/chunk-AEK57VVT-D62Iwyam-238a3d85.mjs +1361 -0
  25. package/{chunk-D6G4REZN-472adc5b.mjs → chunk-D6G4REZN-11c52918.mjs} +5 -5
  26. package/chunk-D6G4REZN-HlFmQTJy-20704636.mjs +64 -0
  27. package/chunk-RZ5BOZE2-DIFgOqDt-495bec03.mjs +24 -0
  28. package/{chunk-RZ5BOZE2-b7d5d4f5.mjs → chunk-RZ5BOZE2-d6db8103.mjs} +9 -9
  29. package/chunk-XZIHB7SX-CCrbsG0u-f30e4124.mjs +15 -0
  30. package/{chunk-XZIHB7SX-56c08d07.mjs → chunk-XZIHB7SX-fafd3ca2.mjs} +1 -1
  31. package/classDiagram-GIVACNV2-Bv5U0XPL-622b22ed.mjs +18 -0
  32. package/{classDiagram-v2-COTLJTTW-1deea5cc.mjs → classDiagram-GIVACNV2-eca9aeb6.mjs} +5 -5
  33. package/classDiagram-v2-COTLJTTW-Bv5U0XPL-622b22ed.mjs +18 -0
  34. package/{classDiagram-GIVACNV2-1deea5cc.mjs → classDiagram-v2-COTLJTTW-eca9aeb6.mjs} +5 -5
  35. package/{clone-1f18a17f.mjs → clone-327a1426.mjs} +1 -1
  36. package/clone-Csc9uFbU-6c4f28bd.mjs +8 -0
  37. package/cytoscape.esm-Swd9B-1A-3101f241.mjs +18730 -0
  38. package/{dagre-OKDRZEBW-74e73dcf.mjs → dagre-OKDRZEBW-9059bb36.mjs} +81 -81
  39. package/dagre-OKDRZEBW-CoMQYlxF-96274fb0.mjs +448 -0
  40. package/{diagram-SSKATNLV-1a562cb0.mjs → diagram-SSKATNLV-70f68e72.mjs} +34 -34
  41. package/diagram-SSKATNLV-CPuZUaGP-50edcaa0.mjs +225 -0
  42. package/{diagram-VNBRO52H-b765e46f.mjs → diagram-VNBRO52H-39273710.mjs} +35 -35
  43. package/diagram-VNBRO52H-DIIZ-Sll-969266e6.mjs +130 -0
  44. package/{erDiagram-Q7BY3M3F-022c4343.mjs → erDiagram-Q7BY3M3F-96ba3906.mjs} +3 -3
  45. package/erDiagram-Q7BY3M3F-ZKWAM_uE-41c0350d.mjs +843 -0
  46. package/{flowDiagram-4HSFHLVR-6036e284.mjs → flowDiagram-4HSFHLVR-795e3830.mjs} +29 -29
  47. package/flowDiagram-4HSFHLVR-CUJXGEG3-801dde13.mjs +1624 -0
  48. package/{ganttDiagram-APWFNJXF-be871387.mjs → ganttDiagram-APWFNJXF-736e67b6.mjs} +398 -398
  49. package/ganttDiagram-APWFNJXF-C1pgubbs-20beffc3.mjs +2527 -0
  50. package/gitGraph-O2Q2CXLX-00465db9.mjs +10 -0
  51. package/gitGraph-O2Q2CXLX-BYavwGzs-e5f1990e.mjs +10 -0
  52. package/{gitGraphDiagram-7IBYFJ6S-da63c888.mjs → gitGraphDiagram-7IBYFJ6S-115329ab.mjs} +88 -88
  53. package/gitGraphDiagram-7IBYFJ6S-CndxirR4-b39d4089.mjs +716 -0
  54. package/{graph-e71f0e3e.mjs → graph-9e073c5f.mjs} +8 -8
  55. package/graph-DOmtxVvg-727f4e14.mjs +247 -0
  56. package/index-433e2395.mjs +168385 -0
  57. package/info-4N47QTOZ-688db415.mjs +10 -0
  58. package/info-4N47QTOZ-DPyDFN1Z-821cf2f7.mjs +10 -0
  59. package/{infoDiagram-PH2N3AL5-3e1c1c1f.mjs → infoDiagram-PH2N3AL5-29e9585a.mjs} +9 -9
  60. package/infoDiagram-PH2N3AL5-BkSS3vpU-ef4bf66d.mjs +26 -0
  61. package/init-DjUOC4st-87c930f1.mjs +16 -0
  62. package/{journeyDiagram-U35MCT3I-6d29748d.mjs → journeyDiagram-U35MCT3I-7c5644d1.mjs} +41 -41
  63. package/journeyDiagram-U35MCT3I-BN-kCDeJ-ac350902.mjs +811 -0
  64. package/{kanban-definition-NDS4AKOZ-c231ae4c.mjs → kanban-definition-NDS4AKOZ-eff441f9.mjs} +47 -47
  65. package/kanban-definition-NDS4AKOZ-gaDUOiKt-efdba942.mjs +720 -0
  66. package/{layout-b9b9e407.mjs → layout-501d22f0.mjs} +19 -19
  67. package/layout-8X5HiOVA-b6e13cf9.mjs +1323 -0
  68. package/linear-BgV5F0PU-8137edad.mjs +447 -0
  69. package/{linear-99040ddc.mjs → linear-fd3cd932.mjs} +56 -56
  70. package/{mermaid-parser.core-55f134dc.mjs → mermaid-parser.core-6eb44241.mjs} +160 -160
  71. package/mermaid-parser.core-BTS3sfcL-8c80284a.mjs +12810 -0
  72. package/{mindmap-definition-ALO5MXBD-938e2e65.mjs → mindmap-definition-ALO5MXBD-2fe3c748.mjs} +1 -1
  73. package/mindmap-definition-ALO5MXBD-B8q_1sIj-c3599d3c.mjs +3225 -0
  74. package/ordinal-DfAQgscy-1c8e46a9.mjs +65 -0
  75. package/package.json +2 -2
  76. package/packet-KVYON367-DcfdOX-U-afac932a.mjs +10 -0
  77. package/packet-KVYON367-c82af3fe.mjs +10 -0
  78. package/pie-R6RNRRYF-DKruFncB-d07f60c2.mjs +10 -0
  79. package/pie-R6RNRRYF-eb27797b.mjs +10 -0
  80. package/pieDiagram-IB7DONF6-Bijui6_Q-db9fdf3a.mjs +166 -0
  81. package/{pieDiagram-IB7DONF6-6a11673b.mjs → pieDiagram-IB7DONF6-e6863984.mjs} +36 -36
  82. package/{quadrantDiagram-7GDLP6J5-a4a4d9ac.mjs → quadrantDiagram-7GDLP6J5-88df12c2.mjs} +15 -15
  83. package/quadrantDiagram-7GDLP6J5-DzIzViUj-b13add98.mjs +1027 -0
  84. package/radar-MK3ICKWK-723229d0.mjs +10 -0
  85. package/radar-MK3ICKWK-D8wbkmr5-3165faf6.mjs +10 -0
  86. package/{requirementDiagram-KVF5MWMF-a7093c74.mjs → requirementDiagram-KVF5MWMF-7228051c.mjs} +50 -50
  87. package/requirementDiagram-KVF5MWMF-Hqsbdpfq-23374f24.mjs +853 -0
  88. package/{sankeyDiagram-QLVOVGJD-f4bcbb2d.mjs → sankeyDiagram-QLVOVGJD-00a31a99.mjs} +87 -87
  89. package/sankeyDiagram-QLVOVGJD-DGCeusqJ-8ca7e64d.mjs +826 -0
  90. package/{sequenceDiagram-X6HHIX6F-9071cfff.mjs → sequenceDiagram-X6HHIX6F-de203309.mjs} +3 -3
  91. package/sequenceDiagram-X6HHIX6F-kuEE9wSd-5f0ec5cd.mjs +2283 -0
  92. package/{stateDiagram-DGXRK772-fb22a7a5.mjs → stateDiagram-DGXRK772-2341237a.mjs} +48 -48
  93. package/stateDiagram-DGXRK772-Cq-Ce3WP-266efa7f.mjs +274 -0
  94. package/{stateDiagram-v2-YXO3MK2T-67326b76.mjs → stateDiagram-v2-YXO3MK2T-8c81deed.mjs} +5 -5
  95. package/stateDiagram-v2-YXO3MK2T-CplwFWn1-c0024e4e.mjs +18 -0
  96. package/style.css +10 -1
  97. package/timeline-definition-BDJGKUSR-USv5sZzx-22548912.mjs +806 -0
  98. package/{timeline-definition-BDJGKUSR-44f50d45.mjs → timeline-definition-BDJGKUSR-e615901b.mjs} +79 -79
  99. package/{xychartDiagram-VJFVF3MP-2df503f6.mjs → xychartDiagram-VJFVF3MP-9ad66a6b.mjs} +28 -28
  100. package/xychartDiagram-VJFVF3MP-CXCfFZBM-e5ca151e.mjs +1306 -0
  101. package/_basePickBy-12958109.mjs +0 -153
  102. package/arc-14f9a207.mjs +0 -85
  103. package/architecture-4AB2E3PP-bb512ddb.mjs +0 -10
  104. package/channel-7bd711b4.mjs +0 -5
  105. package/gitGraph-O2Q2CXLX-83cfcbef.mjs +0 -10
  106. package/index-f83d4b07.mjs +0 -97448
  107. package/info-4N47QTOZ-20cf90f5.mjs +0 -10
  108. package/katex-2e45926a.mjs +0 -11700
  109. package/packet-KVYON367-453a49e8.mjs +0 -10
  110. package/pie-R6RNRRYF-4d95c8dc.mjs +0 -10
  111. package/radar-MK3ICKWK-100e8fa4.mjs +0 -10
@@ -0,0 +1,2283 @@
1
+ import { x as xe, y as kt, p as $t, d as ye, m as me, h as Te } from "./chunk-D6G4REZN-HlFmQTJy-20704636.mjs";
2
+ import { e as be } from "./chunk-XZIHB7SX-CCrbsG0u-f30e4124.mjs";
3
+ import { v as g, g as Gt, h as Ee, j as jt, Y as fe, i as we, G as Ie, K as Le, k as Pe, l as Q, r as ke, J as K, w as It, T as L, a5 as Jt, ah as ct, ai as Tt, q as $, aj as Ut, C as Dt, ak as ve, c as _e, e as Lt, X as Ae } from "./index-433e2395.mjs";
4
+ import "vue";
5
+ var Rt = function() {
6
+ var t = /* @__PURE__ */ g(function(ot, f, P, E) {
7
+ for (P = P || {}, E = ot.length; E--; P[ot[E]] = f)
8
+ ;
9
+ return P;
10
+ }, "o"), e = [1, 2], n = [1, 3], a = [1, 4], s = [2, 4], r = [1, 9], c = [1, 11], h = [1, 13], p = [1, 14], i = [1, 16], x = [1, 17], m = [1, 18], u = [1, 24], T = [1, 25], w = [1, 26], I = [1, 27], v = [1, 28], R = [1, 29], M = [1, 30], C = [1, 31], S = [1, 32], V = [1, 33], F = [1, 34], X = [1, 35], tt = [1, 36], W = [1, 37], q = [1, 38], Y = [1, 39], O = [1, 41], G = [1, 42], z = [1, 43], J = [1, 44], et = [1, 45], N = [1, 46], b = [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, 54, 59, 60, 61, 62, 70], k = [4, 5, 16, 50, 52, 53], U = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], st = [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, 54, 59, 60, 61, 62, 70], _ = [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, 54, 59, 60, 61, 62, 70], Ft = [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, 54, 59, 60, 61, 62, 70], it = [68, 69, 70], dt = [1, 122], _t = {
11
+ trace: /* @__PURE__ */ g(function() {
12
+ }, "trace"),
13
+ yy: {},
14
+ 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, note: 54, placement: 55, text2: 56, over: 57, actor_pair: 58, links: 59, link: 60, properties: 61, details: 62, spaceList: 63, ",": 64, left_of: 65, right_of: 66, signaltype: 67, "+": 68, "-": 69, ACTOR: 70, SOLID_OPEN_ARROW: 71, DOTTED_OPEN_ARROW: 72, SOLID_ARROW: 73, BIDIRECTIONAL_SOLID_ARROW: 74, DOTTED_ARROW: 75, BIDIRECTIONAL_DOTTED_ARROW: 76, SOLID_CROSS: 77, DOTTED_CROSS: 78, SOLID_POINT: 79, DOTTED_POINT: 80, TXT: 81, $accept: 0, $end: 1 },
15
+ 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", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "BIDIRECTIONAL_SOLID_ARROW", 75: "DOTTED_ARROW", 76: "BIDIRECTIONAL_DOTTED_ARROW", 77: "SOLID_CROSS", 78: "DOTTED_CROSS", 79: "SOLID_POINT", 80: "DOTTED_POINT", 81: "TXT" },
16
+ 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], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]],
17
+ performAction: /* @__PURE__ */ g(function(ot, f, P, E, A, d, H) {
18
+ var l = d.length - 1;
19
+ switch (A) {
20
+ case 3:
21
+ return E.apply(d[l]), d[l];
22
+ case 4:
23
+ case 9:
24
+ this.$ = [];
25
+ break;
26
+ case 5:
27
+ case 10:
28
+ d[l - 1].push(d[l]), this.$ = d[l - 1];
29
+ break;
30
+ case 6:
31
+ case 7:
32
+ case 11:
33
+ case 12:
34
+ this.$ = d[l];
35
+ break;
36
+ case 8:
37
+ case 13:
38
+ this.$ = [];
39
+ break;
40
+ case 15:
41
+ d[l].type = "createParticipant", this.$ = d[l];
42
+ break;
43
+ case 16:
44
+ d[l - 1].unshift({ type: "boxStart", boxData: E.parseBoxData(d[l - 2]) }), d[l - 1].push({ type: "boxEnd", boxText: d[l - 2] }), this.$ = d[l - 1];
45
+ break;
46
+ case 18:
47
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[l - 2]), sequenceIndexStep: Number(d[l - 1]), sequenceVisible: !0, signalType: E.LINETYPE.AUTONUMBER };
48
+ break;
49
+ case 19:
50
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[l - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: E.LINETYPE.AUTONUMBER };
51
+ break;
52
+ case 20:
53
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: E.LINETYPE.AUTONUMBER };
54
+ break;
55
+ case 21:
56
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: E.LINETYPE.AUTONUMBER };
57
+ break;
58
+ case 22:
59
+ this.$ = { type: "activeStart", signalType: E.LINETYPE.ACTIVE_START, actor: d[l - 1].actor };
60
+ break;
61
+ case 23:
62
+ this.$ = { type: "activeEnd", signalType: E.LINETYPE.ACTIVE_END, actor: d[l - 1].actor };
63
+ break;
64
+ case 29:
65
+ E.setDiagramTitle(d[l].substring(6)), this.$ = d[l].substring(6);
66
+ break;
67
+ case 30:
68
+ E.setDiagramTitle(d[l].substring(7)), this.$ = d[l].substring(7);
69
+ break;
70
+ case 31:
71
+ this.$ = d[l].trim(), E.setAccTitle(this.$);
72
+ break;
73
+ case 32:
74
+ case 33:
75
+ this.$ = d[l].trim(), E.setAccDescription(this.$);
76
+ break;
77
+ case 34:
78
+ d[l - 1].unshift({ type: "loopStart", loopText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.LOOP_START }), d[l - 1].push({ type: "loopEnd", loopText: d[l - 2], signalType: E.LINETYPE.LOOP_END }), this.$ = d[l - 1];
79
+ break;
80
+ case 35:
81
+ d[l - 1].unshift({ type: "rectStart", color: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.RECT_START }), d[l - 1].push({ type: "rectEnd", color: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.RECT_END }), this.$ = d[l - 1];
82
+ break;
83
+ case 36:
84
+ d[l - 1].unshift({ type: "optStart", optText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.OPT_START }), d[l - 1].push({ type: "optEnd", optText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.OPT_END }), this.$ = d[l - 1];
85
+ break;
86
+ case 37:
87
+ d[l - 1].unshift({ type: "altStart", altText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.ALT_START }), d[l - 1].push({ type: "altEnd", signalType: E.LINETYPE.ALT_END }), this.$ = d[l - 1];
88
+ break;
89
+ case 38:
90
+ d[l - 1].unshift({ type: "parStart", parText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.PAR_START }), d[l - 1].push({ type: "parEnd", signalType: E.LINETYPE.PAR_END }), this.$ = d[l - 1];
91
+ break;
92
+ case 39:
93
+ d[l - 1].unshift({ type: "parStart", parText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.PAR_OVER_START }), d[l - 1].push({ type: "parEnd", signalType: E.LINETYPE.PAR_END }), this.$ = d[l - 1];
94
+ break;
95
+ case 40:
96
+ d[l - 1].unshift({ type: "criticalStart", criticalText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.CRITICAL_START }), d[l - 1].push({ type: "criticalEnd", signalType: E.LINETYPE.CRITICAL_END }), this.$ = d[l - 1];
97
+ break;
98
+ case 41:
99
+ d[l - 1].unshift({ type: "breakStart", breakText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.BREAK_START }), d[l - 1].push({ type: "breakEnd", optText: E.parseMessage(d[l - 2]), signalType: E.LINETYPE.BREAK_END }), this.$ = d[l - 1];
100
+ break;
101
+ case 43:
102
+ this.$ = d[l - 3].concat([{ type: "option", optionText: E.parseMessage(d[l - 1]), signalType: E.LINETYPE.CRITICAL_OPTION }, d[l]]);
103
+ break;
104
+ case 45:
105
+ this.$ = d[l - 3].concat([{ type: "and", parText: E.parseMessage(d[l - 1]), signalType: E.LINETYPE.PAR_AND }, d[l]]);
106
+ break;
107
+ case 47:
108
+ this.$ = d[l - 3].concat([{ type: "else", altText: E.parseMessage(d[l - 1]), signalType: E.LINETYPE.ALT_ELSE }, d[l]]);
109
+ break;
110
+ case 48:
111
+ d[l - 3].draw = "participant", d[l - 3].type = "addParticipant", d[l - 3].description = E.parseMessage(d[l - 1]), this.$ = d[l - 3];
112
+ break;
113
+ case 49:
114
+ d[l - 1].draw = "participant", d[l - 1].type = "addParticipant", this.$ = d[l - 1];
115
+ break;
116
+ case 50:
117
+ d[l - 3].draw = "actor", d[l - 3].type = "addParticipant", d[l - 3].description = E.parseMessage(d[l - 1]), this.$ = d[l - 3];
118
+ break;
119
+ case 51:
120
+ d[l - 1].draw = "actor", d[l - 1].type = "addParticipant", this.$ = d[l - 1];
121
+ break;
122
+ case 52:
123
+ d[l - 1].type = "destroyParticipant", this.$ = d[l - 1];
124
+ break;
125
+ case 53:
126
+ this.$ = [d[l - 1], { type: "addNote", placement: d[l - 2], actor: d[l - 1].actor, text: d[l] }];
127
+ break;
128
+ case 54:
129
+ d[l - 2] = [].concat(d[l - 1], d[l - 1]).slice(0, 2), d[l - 2][0] = d[l - 2][0].actor, d[l - 2][1] = d[l - 2][1].actor, this.$ = [d[l - 1], { type: "addNote", placement: E.PLACEMENT.OVER, actor: d[l - 2].slice(0, 2), text: d[l] }];
130
+ break;
131
+ case 55:
132
+ this.$ = [d[l - 1], { type: "addLinks", actor: d[l - 1].actor, text: d[l] }];
133
+ break;
134
+ case 56:
135
+ this.$ = [d[l - 1], { type: "addALink", actor: d[l - 1].actor, text: d[l] }];
136
+ break;
137
+ case 57:
138
+ this.$ = [d[l - 1], { type: "addProperties", actor: d[l - 1].actor, text: d[l] }];
139
+ break;
140
+ case 58:
141
+ this.$ = [d[l - 1], { type: "addDetails", actor: d[l - 1].actor, text: d[l] }];
142
+ break;
143
+ case 61:
144
+ this.$ = [d[l - 2], d[l]];
145
+ break;
146
+ case 62:
147
+ this.$ = d[l];
148
+ break;
149
+ case 63:
150
+ this.$ = E.PLACEMENT.LEFTOF;
151
+ break;
152
+ case 64:
153
+ this.$ = E.PLACEMENT.RIGHTOF;
154
+ break;
155
+ case 65:
156
+ this.$ = [
157
+ d[l - 4],
158
+ d[l - 1],
159
+ { type: "addMessage", from: d[l - 4].actor, to: d[l - 1].actor, signalType: d[l - 3], msg: d[l], activate: !0 },
160
+ { type: "activeStart", signalType: E.LINETYPE.ACTIVE_START, actor: d[l - 1].actor }
161
+ ];
162
+ break;
163
+ case 66:
164
+ this.$ = [
165
+ d[l - 4],
166
+ d[l - 1],
167
+ { type: "addMessage", from: d[l - 4].actor, to: d[l - 1].actor, signalType: d[l - 3], msg: d[l] },
168
+ { type: "activeEnd", signalType: E.LINETYPE.ACTIVE_END, actor: d[l - 4].actor }
169
+ ];
170
+ break;
171
+ case 67:
172
+ this.$ = [d[l - 3], d[l - 1], { type: "addMessage", from: d[l - 3].actor, to: d[l - 1].actor, signalType: d[l - 2], msg: d[l] }];
173
+ break;
174
+ case 68:
175
+ this.$ = { type: "addParticipant", actor: d[l] };
176
+ break;
177
+ case 69:
178
+ this.$ = E.LINETYPE.SOLID_OPEN;
179
+ break;
180
+ case 70:
181
+ this.$ = E.LINETYPE.DOTTED_OPEN;
182
+ break;
183
+ case 71:
184
+ this.$ = E.LINETYPE.SOLID;
185
+ break;
186
+ case 72:
187
+ this.$ = E.LINETYPE.BIDIRECTIONAL_SOLID;
188
+ break;
189
+ case 73:
190
+ this.$ = E.LINETYPE.DOTTED;
191
+ break;
192
+ case 74:
193
+ this.$ = E.LINETYPE.BIDIRECTIONAL_DOTTED;
194
+ break;
195
+ case 75:
196
+ this.$ = E.LINETYPE.SOLID_CROSS;
197
+ break;
198
+ case 76:
199
+ this.$ = E.LINETYPE.DOTTED_CROSS;
200
+ break;
201
+ case 77:
202
+ this.$ = E.LINETYPE.SOLID_POINT;
203
+ break;
204
+ case 78:
205
+ this.$ = E.LINETYPE.DOTTED_POINT;
206
+ break;
207
+ case 79:
208
+ this.$ = E.parseMessage(d[l].trim().substring(1));
209
+ break;
210
+ }
211
+ }, "anonymous"),
212
+ table: [{ 3: 1, 4: e, 5: n, 6: a }, { 1: [3] }, { 3: 5, 4: e, 5: n, 6: a }, { 3: 6, 4: e, 5: n, 6: a }, t([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], s, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: r, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: p, 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, t(b, [2, 5]), { 9: 47, 12: 12, 13: h, 14: p, 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, t(b, [2, 7]), t(b, [2, 8]), t(b, [2, 14]), { 12: 48, 50: W, 52: q, 53: Y }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: N }, { 22: 55, 70: N }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, t(b, [2, 29]), t(b, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, t(b, [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, 70: N }, { 22: 72, 70: N }, { 22: 73, 70: N }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82], 79: [1, 83], 80: [1, 84] }, { 55: 85, 57: [1, 86], 65: [1, 87], 66: [1, 88] }, { 22: 89, 70: N }, { 22: 90, 70: N }, { 22: 91, 70: N }, { 22: 92, 70: N }, t([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], [2, 68]), t(b, [2, 6]), t(b, [2, 15]), t(k, [2, 9], { 10: 93 }), t(b, [2, 17]), { 5: [1, 95], 19: [1, 94] }, { 5: [1, 96] }, t(b, [2, 21]), { 5: [1, 97] }, { 5: [1, 98] }, t(b, [2, 24]), t(b, [2, 25]), t(b, [2, 26]), t(b, [2, 27]), t(b, [2, 28]), t(b, [2, 31]), t(b, [2, 32]), t(U, s, { 7: 99 }), t(U, s, { 7: 100 }), t(U, s, { 7: 101 }), t(st, s, { 40: 102, 7: 103 }), t(_, s, { 42: 104, 7: 105 }), t(_, s, { 7: 105, 42: 106 }), t(Ft, s, { 45: 107, 7: 108 }), t(U, s, { 7: 109 }), { 5: [1, 111], 51: [1, 110] }, { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, { 22: 117, 68: [1, 115], 69: [1, 116], 70: N }, t(it, [2, 69]), t(it, [2, 70]), t(it, [2, 71]), t(it, [2, 72]), t(it, [2, 73]), t(it, [2, 74]), t(it, [2, 75]), t(it, [2, 76]), t(it, [2, 77]), t(it, [2, 78]), { 22: 118, 70: N }, { 22: 120, 58: 119, 70: N }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 121, 81: dt }, { 56: 123, 81: dt }, { 56: 124, 81: dt }, { 56: 125, 81: dt }, { 4: [1, 128], 5: [1, 130], 11: 127, 12: 129, 16: [1, 126], 50: W, 52: q, 53: Y }, { 5: [1, 131] }, t(b, [2, 19]), t(b, [2, 20]), t(b, [2, 22]), t(b, [2, 23]), { 4: r, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: p, 16: [1, 132], 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, { 4: r, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: p, 16: [1, 133], 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, { 4: r, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: p, 16: [1, 134], 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, { 16: [1, 135] }, { 4: r, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: p, 16: [2, 46], 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 49: [1, 136], 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, { 16: [1, 137] }, { 4: r, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: p, 16: [2, 44], 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 48: [1, 138], 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, { 16: [1, 139] }, { 16: [1, 140] }, { 4: r, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: p, 16: [2, 42], 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 47: [1, 141], 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, { 4: r, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: p, 16: [1, 142], 17: 15, 18: i, 21: x, 22: 40, 23: m, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: T, 31: w, 33: I, 35: v, 36: R, 37: M, 38: C, 39: S, 41: V, 43: F, 44: X, 46: tt, 50: W, 52: q, 53: Y, 54: O, 59: G, 60: z, 61: J, 62: et, 70: N }, { 15: [1, 143] }, t(b, [2, 49]), { 15: [1, 144] }, t(b, [2, 51]), t(b, [2, 52]), { 22: 145, 70: N }, { 22: 146, 70: N }, { 56: 147, 81: dt }, { 56: 148, 81: dt }, { 56: 149, 81: dt }, { 64: [1, 150], 81: [2, 62] }, { 5: [2, 55] }, { 5: [2, 79] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, t(b, [2, 16]), t(k, [2, 10]), { 12: 151, 50: W, 52: q, 53: Y }, t(k, [2, 12]), t(k, [2, 13]), t(b, [2, 18]), t(b, [2, 34]), t(b, [2, 35]), t(b, [2, 36]), t(b, [2, 37]), { 15: [1, 152] }, t(b, [2, 38]), { 15: [1, 153] }, t(b, [2, 39]), t(b, [2, 40]), { 15: [1, 154] }, t(b, [2, 41]), { 5: [1, 155] }, { 5: [1, 156] }, { 56: 157, 81: dt }, { 56: 158, 81: dt }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 159, 70: N }, t(k, [2, 11]), t(st, s, { 7: 103, 40: 160 }), t(_, s, { 7: 105, 42: 161 }), t(Ft, s, { 7: 108, 45: 162 }), t(b, [2, 48]), t(b, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 81: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
213
+ defaultActions: { 5: [2, 1], 6: [2, 2], 87: [2, 63], 88: [2, 64], 121: [2, 55], 122: [2, 79], 123: [2, 56], 124: [2, 57], 125: [2, 58], 147: [2, 67], 148: [2, 53], 149: [2, 54], 157: [2, 65], 158: [2, 66], 159: [2, 61], 160: [2, 47], 161: [2, 45], 162: [2, 43] },
214
+ parseError: /* @__PURE__ */ g(function(ot, f) {
215
+ if (f.recoverable)
216
+ this.trace(ot);
217
+ else {
218
+ var P = new Error(ot);
219
+ throw P.hash = f, P;
220
+ }
221
+ }, "parseError"),
222
+ parse: /* @__PURE__ */ g(function(ot) {
223
+ var f = this, P = [0], E = [], A = [null], d = [], H = this.table, l = "", Et = 0, Wt = 0, le = 2, qt = 1, pe = d.slice.call(arguments, 1), B = Object.create(this.lexer), lt = { yy: {} };
224
+ for (var At in this.yy)
225
+ Object.prototype.hasOwnProperty.call(this.yy, At) && (lt.yy[At] = this.yy[At]);
226
+ B.setInput(ot, lt.yy), lt.yy.lexer = B, lt.yy.parser = this, typeof B.yylloc > "u" && (B.yylloc = {});
227
+ var Nt = B.yylloc;
228
+ d.push(Nt);
229
+ var ge = B.options && B.options.ranges;
230
+ typeof lt.yy.parseError == "function" ? this.parseError = lt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
231
+ function ue(Z) {
232
+ P.length = P.length - 2 * Z, A.length = A.length - Z, d.length = d.length - Z;
233
+ }
234
+ g(ue, "popStack");
235
+ function zt() {
236
+ var Z;
237
+ return Z = E.pop() || B.lex() || qt, typeof Z != "number" && (Z instanceof Array && (E = Z, Z = E.pop()), Z = f.symbols_[Z] || Z), Z;
238
+ }
239
+ g(zt, "lex");
240
+ for (var j, pt, at, Mt, xt = {}, ft, ht, Ht, wt; ; ) {
241
+ if (pt = P[P.length - 1], this.defaultActions[pt] ? at = this.defaultActions[pt] : ((j === null || typeof j > "u") && (j = zt()), at = H[pt] && H[pt][j]), typeof at > "u" || !at.length || !at[0]) {
242
+ var Ot = "";
243
+ wt = [];
244
+ for (ft in H[pt])
245
+ this.terminals_[ft] && ft > le && wt.push("'" + this.terminals_[ft] + "'");
246
+ B.showPosition ? Ot = "Parse error on line " + (Et + 1) + `:
247
+ ` + B.showPosition() + `
248
+ Expecting ` + wt.join(", ") + ", got '" + (this.terminals_[j] || j) + "'" : Ot = "Parse error on line " + (Et + 1) + ": Unexpected " + (j == qt ? "end of input" : "'" + (this.terminals_[j] || j) + "'"), this.parseError(Ot, {
249
+ text: B.match,
250
+ token: this.terminals_[j] || j,
251
+ line: B.yylineno,
252
+ loc: Nt,
253
+ expected: wt
254
+ });
255
+ }
256
+ if (at[0] instanceof Array && at.length > 1)
257
+ throw new Error("Parse Error: multiple actions possible at state: " + pt + ", token: " + j);
258
+ switch (at[0]) {
259
+ case 1:
260
+ P.push(j), A.push(B.yytext), d.push(B.yylloc), P.push(at[1]), j = null, Wt = B.yyleng, l = B.yytext, Et = B.yylineno, Nt = B.yylloc;
261
+ break;
262
+ case 2:
263
+ if (ht = this.productions_[at[1]][1], xt.$ = A[A.length - ht], xt._$ = {
264
+ first_line: d[d.length - (ht || 1)].first_line,
265
+ last_line: d[d.length - 1].last_line,
266
+ first_column: d[d.length - (ht || 1)].first_column,
267
+ last_column: d[d.length - 1].last_column
268
+ }, ge && (xt._$.range = [
269
+ d[d.length - (ht || 1)].range[0],
270
+ d[d.length - 1].range[1]
271
+ ]), Mt = this.performAction.apply(xt, [
272
+ l,
273
+ Wt,
274
+ Et,
275
+ lt.yy,
276
+ at[1],
277
+ A,
278
+ d
279
+ ].concat(pe)), typeof Mt < "u")
280
+ return Mt;
281
+ ht && (P = P.slice(0, -1 * ht * 2), A = A.slice(0, -1 * ht), d = d.slice(0, -1 * ht)), P.push(this.productions_[at[1]][0]), A.push(xt.$), d.push(xt._$), Ht = H[P[P.length - 2]][P[P.length - 1]], P.push(Ht);
282
+ break;
283
+ case 3:
284
+ return !0;
285
+ }
286
+ }
287
+ return !0;
288
+ }, "parse")
289
+ }, he = /* @__PURE__ */ function() {
290
+ var ot = {
291
+ EOF: 1,
292
+ parseError: /* @__PURE__ */ g(function(f, P) {
293
+ if (this.yy.parser)
294
+ this.yy.parser.parseError(f, P);
295
+ else
296
+ throw new Error(f);
297
+ }, "parseError"),
298
+ // resets the lexer, sets new input
299
+ setInput: /* @__PURE__ */ g(function(f, P) {
300
+ return this.yy = P || this.yy || {}, this._input = f, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
301
+ first_line: 1,
302
+ first_column: 0,
303
+ last_line: 1,
304
+ last_column: 0
305
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
306
+ }, "setInput"),
307
+ // consumes and returns one char from the input
308
+ input: /* @__PURE__ */ g(function() {
309
+ var f = this._input[0];
310
+ this.yytext += f, this.yyleng++, this.offset++, this.match += f, this.matched += f;
311
+ var P = f.match(/(?:\r\n?|\n).*/g);
312
+ return P ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), f;
313
+ }, "input"),
314
+ // unshifts one char (or a string) into the input
315
+ unput: /* @__PURE__ */ g(function(f) {
316
+ var P = f.length, E = f.split(/(?:\r\n?|\n)/g);
317
+ this._input = f + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - P), this.offset -= P;
318
+ var A = this.match.split(/(?:\r\n?|\n)/g);
319
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), E.length - 1 && (this.yylineno -= E.length - 1);
320
+ var d = this.yylloc.range;
321
+ return this.yylloc = {
322
+ first_line: this.yylloc.first_line,
323
+ last_line: this.yylineno + 1,
324
+ first_column: this.yylloc.first_column,
325
+ last_column: E ? (E.length === A.length ? this.yylloc.first_column : 0) + A[A.length - E.length].length - E[0].length : this.yylloc.first_column - P
326
+ }, this.options.ranges && (this.yylloc.range = [d[0], d[0] + this.yyleng - P]), this.yyleng = this.yytext.length, this;
327
+ }, "unput"),
328
+ // When called from action, caches matched text and appends it on next action
329
+ more: /* @__PURE__ */ g(function() {
330
+ return this._more = !0, this;
331
+ }, "more"),
332
+ // 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.
333
+ reject: /* @__PURE__ */ g(function() {
334
+ if (this.options.backtrack_lexer)
335
+ this._backtrack = !0;
336
+ else
337
+ 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).
338
+ ` + this.showPosition(), {
339
+ text: "",
340
+ token: null,
341
+ line: this.yylineno
342
+ });
343
+ return this;
344
+ }, "reject"),
345
+ // retain first n characters of the match
346
+ less: /* @__PURE__ */ g(function(f) {
347
+ this.unput(this.match.slice(f));
348
+ }, "less"),
349
+ // displays already matched input, i.e. for error messages
350
+ pastInput: /* @__PURE__ */ g(function() {
351
+ var f = this.matched.substr(0, this.matched.length - this.match.length);
352
+ return (f.length > 20 ? "..." : "") + f.substr(-20).replace(/\n/g, "");
353
+ }, "pastInput"),
354
+ // displays upcoming input, i.e. for error messages
355
+ upcomingInput: /* @__PURE__ */ g(function() {
356
+ var f = this.match;
357
+ return f.length < 20 && (f += this._input.substr(0, 20 - f.length)), (f.substr(0, 20) + (f.length > 20 ? "..." : "")).replace(/\n/g, "");
358
+ }, "upcomingInput"),
359
+ // displays the character position where the lexing error occurred, i.e. for error messages
360
+ showPosition: /* @__PURE__ */ g(function() {
361
+ var f = this.pastInput(), P = new Array(f.length + 1).join("-");
362
+ return f + this.upcomingInput() + `
363
+ ` + P + "^";
364
+ }, "showPosition"),
365
+ // test the lexed token: return FALSE when not a match, otherwise return token
366
+ test_match: /* @__PURE__ */ g(function(f, P) {
367
+ var E, A, d;
368
+ if (this.options.backtrack_lexer && (d = {
369
+ yylineno: this.yylineno,
370
+ yylloc: {
371
+ first_line: this.yylloc.first_line,
372
+ last_line: this.last_line,
373
+ first_column: this.yylloc.first_column,
374
+ last_column: this.yylloc.last_column
375
+ },
376
+ yytext: this.yytext,
377
+ match: this.match,
378
+ matches: this.matches,
379
+ matched: this.matched,
380
+ yyleng: this.yyleng,
381
+ offset: this.offset,
382
+ _more: this._more,
383
+ _input: this._input,
384
+ yy: this.yy,
385
+ conditionStack: this.conditionStack.slice(0),
386
+ done: this.done
387
+ }, this.options.ranges && (d.yylloc.range = this.yylloc.range.slice(0))), A = f[0].match(/(?:\r\n?|\n).*/g), A && (this.yylineno += A.length), this.yylloc = {
388
+ first_line: this.yylloc.last_line,
389
+ last_line: this.yylineno + 1,
390
+ first_column: this.yylloc.last_column,
391
+ last_column: A ? A[A.length - 1].length - A[A.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + f[0].length
392
+ }, this.yytext += f[0], this.match += f[0], this.matches = f, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(f[0].length), this.matched += f[0], E = this.performAction.call(this, this.yy, this, P, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), E)
393
+ return E;
394
+ if (this._backtrack) {
395
+ for (var H in d)
396
+ this[H] = d[H];
397
+ return !1;
398
+ }
399
+ return !1;
400
+ }, "test_match"),
401
+ // return next match in input
402
+ next: /* @__PURE__ */ g(function() {
403
+ if (this.done)
404
+ return this.EOF;
405
+ this._input || (this.done = !0);
406
+ var f, P, E, A;
407
+ this._more || (this.yytext = "", this.match = "");
408
+ for (var d = this._currentRules(), H = 0; H < d.length; H++)
409
+ if (E = this._input.match(this.rules[d[H]]), E && (!P || E[0].length > P[0].length)) {
410
+ if (P = E, A = H, this.options.backtrack_lexer) {
411
+ if (f = this.test_match(E, d[H]), f !== !1)
412
+ return f;
413
+ if (this._backtrack) {
414
+ P = !1;
415
+ continue;
416
+ } else
417
+ return !1;
418
+ } else if (!this.options.flex)
419
+ break;
420
+ }
421
+ return P ? (f = this.test_match(P, d[A]), f !== !1 ? f : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
422
+ ` + this.showPosition(), {
423
+ text: "",
424
+ token: null,
425
+ line: this.yylineno
426
+ });
427
+ }, "next"),
428
+ // return next match that has a token
429
+ lex: /* @__PURE__ */ g(function() {
430
+ var f = this.next();
431
+ return f || this.lex();
432
+ }, "lex"),
433
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
434
+ begin: /* @__PURE__ */ g(function(f) {
435
+ this.conditionStack.push(f);
436
+ }, "begin"),
437
+ // pop the previously active lexer condition state off the condition stack
438
+ popState: /* @__PURE__ */ g(function() {
439
+ var f = this.conditionStack.length - 1;
440
+ return f > 0 ? this.conditionStack.pop() : this.conditionStack[0];
441
+ }, "popState"),
442
+ // produce the lexer rule set which is active for the currently active lexer condition state
443
+ _currentRules: /* @__PURE__ */ g(function() {
444
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
445
+ }, "_currentRules"),
446
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
447
+ topState: /* @__PURE__ */ g(function(f) {
448
+ return f = this.conditionStack.length - 1 - Math.abs(f || 0), f >= 0 ? this.conditionStack[f] : "INITIAL";
449
+ }, "topState"),
450
+ // alias for begin(condition)
451
+ pushState: /* @__PURE__ */ g(function(f) {
452
+ this.begin(f);
453
+ }, "pushState"),
454
+ // return the number of states currently on the stack
455
+ stateStackSize: /* @__PURE__ */ g(function() {
456
+ return this.conditionStack.length;
457
+ }, "stateStackSize"),
458
+ options: { "case-insensitive": !0 },
459
+ performAction: /* @__PURE__ */ g(function(f, P, E, A) {
460
+ switch (E) {
461
+ case 0:
462
+ return 5;
463
+ case 1:
464
+ break;
465
+ case 2:
466
+ break;
467
+ case 3:
468
+ break;
469
+ case 4:
470
+ break;
471
+ case 5:
472
+ break;
473
+ case 6:
474
+ return 19;
475
+ case 7:
476
+ return this.begin("LINE"), 14;
477
+ case 8:
478
+ return this.begin("ID"), 50;
479
+ case 9:
480
+ return this.begin("ID"), 52;
481
+ case 10:
482
+ return 13;
483
+ case 11:
484
+ return this.begin("ID"), 53;
485
+ case 12:
486
+ return P.yytext = P.yytext.trim(), this.begin("ALIAS"), 70;
487
+ case 13:
488
+ return this.popState(), this.popState(), this.begin("LINE"), 51;
489
+ case 14:
490
+ return this.popState(), this.popState(), 5;
491
+ case 15:
492
+ return this.begin("LINE"), 36;
493
+ case 16:
494
+ return this.begin("LINE"), 37;
495
+ case 17:
496
+ return this.begin("LINE"), 38;
497
+ case 18:
498
+ return this.begin("LINE"), 39;
499
+ case 19:
500
+ return this.begin("LINE"), 49;
501
+ case 20:
502
+ return this.begin("LINE"), 41;
503
+ case 21:
504
+ return this.begin("LINE"), 43;
505
+ case 22:
506
+ return this.begin("LINE"), 48;
507
+ case 23:
508
+ return this.begin("LINE"), 44;
509
+ case 24:
510
+ return this.begin("LINE"), 47;
511
+ case 25:
512
+ return this.begin("LINE"), 46;
513
+ case 26:
514
+ return this.popState(), 15;
515
+ case 27:
516
+ return 16;
517
+ case 28:
518
+ return 65;
519
+ case 29:
520
+ return 66;
521
+ case 30:
522
+ return 59;
523
+ case 31:
524
+ return 60;
525
+ case 32:
526
+ return 61;
527
+ case 33:
528
+ return 62;
529
+ case 34:
530
+ return 57;
531
+ case 35:
532
+ return 54;
533
+ case 36:
534
+ return this.begin("ID"), 21;
535
+ case 37:
536
+ return this.begin("ID"), 23;
537
+ case 38:
538
+ return 29;
539
+ case 39:
540
+ return 30;
541
+ case 40:
542
+ return this.begin("acc_title"), 31;
543
+ case 41:
544
+ return this.popState(), "acc_title_value";
545
+ case 42:
546
+ return this.begin("acc_descr"), 33;
547
+ case 43:
548
+ return this.popState(), "acc_descr_value";
549
+ case 44:
550
+ this.begin("acc_descr_multiline");
551
+ break;
552
+ case 45:
553
+ this.popState();
554
+ break;
555
+ case 46:
556
+ return "acc_descr_multiline_value";
557
+ case 47:
558
+ return 6;
559
+ case 48:
560
+ return 18;
561
+ case 49:
562
+ return 20;
563
+ case 50:
564
+ return 64;
565
+ case 51:
566
+ return 5;
567
+ case 52:
568
+ return P.yytext = P.yytext.trim(), 70;
569
+ case 53:
570
+ return 73;
571
+ case 54:
572
+ return 74;
573
+ case 55:
574
+ return 75;
575
+ case 56:
576
+ return 76;
577
+ case 57:
578
+ return 71;
579
+ case 58:
580
+ return 72;
581
+ case 59:
582
+ return 77;
583
+ case 60:
584
+ return 78;
585
+ case 61:
586
+ return 79;
587
+ case 62:
588
+ return 80;
589
+ case 63:
590
+ return 81;
591
+ case 64:
592
+ return 68;
593
+ case 65:
594
+ return 69;
595
+ case 66:
596
+ return 5;
597
+ case 67:
598
+ return "INVALID";
599
+ }
600
+ }, "anonymous"),
601
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \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],
602
+ conditions: { acc_descr_multiline: { rules: [45, 46], inclusive: !1 }, acc_descr: { rules: [43], inclusive: !1 }, acc_title: { rules: [41], inclusive: !1 }, ID: { rules: [2, 3, 12], inclusive: !1 }, ALIAS: { rules: [2, 3, 13, 14], inclusive: !1 }, LINE: { rules: [2, 3, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67], inclusive: !0 } }
603
+ };
604
+ return ot;
605
+ }();
606
+ _t.lexer = he;
607
+ function bt() {
608
+ this.yy = {};
609
+ }
610
+ return g(bt, "Parser"), bt.prototype = _t, _t.Parser = bt, new bt();
611
+ }();
612
+ Rt.parser = Rt;
613
+ var Ne = Rt, Me = {
614
+ SOLID: 0,
615
+ DOTTED: 1,
616
+ NOTE: 2,
617
+ SOLID_CROSS: 3,
618
+ DOTTED_CROSS: 4,
619
+ SOLID_OPEN: 5,
620
+ DOTTED_OPEN: 6,
621
+ LOOP_START: 10,
622
+ LOOP_END: 11,
623
+ ALT_START: 12,
624
+ ALT_ELSE: 13,
625
+ ALT_END: 14,
626
+ OPT_START: 15,
627
+ OPT_END: 16,
628
+ ACTIVE_START: 17,
629
+ ACTIVE_END: 18,
630
+ PAR_START: 19,
631
+ PAR_AND: 20,
632
+ PAR_END: 21,
633
+ RECT_START: 22,
634
+ RECT_END: 23,
635
+ SOLID_POINT: 24,
636
+ DOTTED_POINT: 25,
637
+ AUTONUMBER: 26,
638
+ CRITICAL_START: 27,
639
+ CRITICAL_OPTION: 28,
640
+ CRITICAL_END: 29,
641
+ BREAK_START: 30,
642
+ BREAK_END: 31,
643
+ PAR_OVER_START: 32,
644
+ BIDIRECTIONAL_SOLID: 33,
645
+ BIDIRECTIONAL_DOTTED: 34
646
+ }, Oe = {
647
+ FILLED: 0,
648
+ OPEN: 1
649
+ }, Se = {
650
+ LEFTOF: 0,
651
+ RIGHTOF: 1,
652
+ OVER: 2
653
+ }, St, De = (St = class {
654
+ constructor() {
655
+ this.state = new be(() => ({
656
+ prevActor: void 0,
657
+ actors: /* @__PURE__ */ new Map(),
658
+ createdActors: /* @__PURE__ */ new Map(),
659
+ destroyedActors: /* @__PURE__ */ new Map(),
660
+ boxes: [],
661
+ messages: [],
662
+ notes: [],
663
+ sequenceNumbersEnabled: !1,
664
+ wrapEnabled: void 0,
665
+ currentBox: void 0,
666
+ lastCreated: void 0,
667
+ lastDestroyed: void 0
668
+ })), this.setAccTitle = jt, this.setAccDescription = fe, this.setDiagramTitle = we, this.getAccTitle = Ie, this.getAccDescription = Le, this.getDiagramTitle = Pe, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(Q().wrap), this.LINETYPE = Me, this.ARROWTYPE = Oe, this.PLACEMENT = Se;
669
+ }
670
+ addBox(t) {
671
+ this.state.records.boxes.push({
672
+ name: t.text,
673
+ wrap: t.wrap ?? this.autoWrap(),
674
+ fill: t.color,
675
+ actorKeys: []
676
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
677
+ }
678
+ addActor(t, e, n, a) {
679
+ let s = this.state.records.currentBox;
680
+ const r = this.state.records.actors.get(t);
681
+ if (r) {
682
+ if (this.state.records.currentBox && r.box && this.state.records.currentBox !== r.box)
683
+ throw new Error(
684
+ `A same participant should only be defined in one Box: ${r.name} can't be in '${r.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
685
+ );
686
+ if (s = r.box ? r.box : this.state.records.currentBox, r.box = s, r && e === r.name && n == null)
687
+ return;
688
+ }
689
+ if ((n == null ? void 0 : n.text) == null && (n = { text: e, type: a }), (a == null || n.text == null) && (n = { text: e, type: a }), this.state.records.actors.set(t, {
690
+ box: s,
691
+ name: e,
692
+ description: n.text,
693
+ wrap: n.wrap ?? this.autoWrap(),
694
+ prevActor: this.state.records.prevActor,
695
+ links: {},
696
+ properties: {},
697
+ actorCnt: null,
698
+ rectData: null,
699
+ type: a ?? "participant"
700
+ }), this.state.records.prevActor) {
701
+ const c = this.state.records.actors.get(this.state.records.prevActor);
702
+ c && (c.nextActor = t);
703
+ }
704
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
705
+ }
706
+ activationCount(t) {
707
+ let e, n = 0;
708
+ if (!t)
709
+ return 0;
710
+ for (e = 0; e < this.state.records.messages.length; e++)
711
+ this.state.records.messages[e].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[e].from === t && n++, this.state.records.messages[e].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[e].from === t && n--;
712
+ return n;
713
+ }
714
+ addMessage(t, e, n, a) {
715
+ this.state.records.messages.push({
716
+ id: this.state.records.messages.length.toString(),
717
+ from: t,
718
+ to: e,
719
+ message: n.text,
720
+ wrap: n.wrap ?? this.autoWrap(),
721
+ answer: a
722
+ });
723
+ }
724
+ addSignal(t, e, n, a, s = !1) {
725
+ if (a === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
726
+ const r = new Error("Trying to inactivate an inactive participant (" + t + ")");
727
+ throw r.hash = {
728
+ text: "->>-",
729
+ token: "->>-",
730
+ line: "1",
731
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
732
+ expected: ["'ACTIVE_PARTICIPANT'"]
733
+ }, r;
734
+ }
735
+ return this.state.records.messages.push({
736
+ id: this.state.records.messages.length.toString(),
737
+ from: t,
738
+ to: e,
739
+ message: (n == null ? void 0 : n.text) ?? "",
740
+ wrap: (n == null ? void 0 : n.wrap) ?? this.autoWrap(),
741
+ type: a,
742
+ activate: s
743
+ }), !0;
744
+ }
745
+ hasAtLeastOneBox() {
746
+ return this.state.records.boxes.length > 0;
747
+ }
748
+ hasAtLeastOneBoxWithTitle() {
749
+ return this.state.records.boxes.some((t) => t.name);
750
+ }
751
+ getMessages() {
752
+ return this.state.records.messages;
753
+ }
754
+ getBoxes() {
755
+ return this.state.records.boxes;
756
+ }
757
+ getActors() {
758
+ return this.state.records.actors;
759
+ }
760
+ getCreatedActors() {
761
+ return this.state.records.createdActors;
762
+ }
763
+ getDestroyedActors() {
764
+ return this.state.records.destroyedActors;
765
+ }
766
+ getActor(t) {
767
+ return this.state.records.actors.get(t);
768
+ }
769
+ getActorKeys() {
770
+ return [...this.state.records.actors.keys()];
771
+ }
772
+ enableSequenceNumbers() {
773
+ this.state.records.sequenceNumbersEnabled = !0;
774
+ }
775
+ disableSequenceNumbers() {
776
+ this.state.records.sequenceNumbersEnabled = !1;
777
+ }
778
+ showSequenceNumbers() {
779
+ return this.state.records.sequenceNumbersEnabled;
780
+ }
781
+ setWrap(t) {
782
+ this.state.records.wrapEnabled = t;
783
+ }
784
+ extractWrap(t) {
785
+ if (t === void 0)
786
+ return {};
787
+ t = t.trim();
788
+ const e = /^:?wrap:/.exec(t) !== null ? !0 : /^:?nowrap:/.exec(t) !== null ? !1 : void 0;
789
+ return { cleanedText: (e === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: e };
790
+ }
791
+ autoWrap() {
792
+ var t;
793
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : ((t = Q().sequence) == null ? void 0 : t.wrap) ?? !1;
794
+ }
795
+ clear() {
796
+ this.state.reset(), ke();
797
+ }
798
+ parseMessage(t) {
799
+ const e = t.trim(), { wrap: n, cleanedText: a } = this.extractWrap(e), s = {
800
+ text: a,
801
+ wrap: n
802
+ };
803
+ return K.debug(`parseMessage: ${JSON.stringify(s)}`), s;
804
+ }
805
+ // We expect the box statement to be color first then description
806
+ // 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
807
+ // We extract first segment as color, the rest of the line is considered as text
808
+ parseBoxData(t) {
809
+ const e = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
810
+ let n = e != null && e[1] ? e[1].trim() : "transparent", a = e != null && e[2] ? e[2].trim() : void 0;
811
+ if (window != null && window.CSS)
812
+ window.CSS.supports("color", n) || (n = "transparent", a = t.trim());
813
+ else {
814
+ const c = new Option().style;
815
+ c.color = n, c.color !== n && (n = "transparent", a = t.trim());
816
+ }
817
+ const { wrap: s, cleanedText: r } = this.extractWrap(a);
818
+ return {
819
+ text: r ? It(r, Q()) : void 0,
820
+ color: n,
821
+ wrap: s
822
+ };
823
+ }
824
+ addNote(t, e, n) {
825
+ const a = {
826
+ actor: t,
827
+ placement: e,
828
+ message: n.text,
829
+ wrap: n.wrap ?? this.autoWrap()
830
+ }, s = [].concat(t, t);
831
+ this.state.records.notes.push(a), this.state.records.messages.push({
832
+ id: this.state.records.messages.length.toString(),
833
+ from: s[0],
834
+ to: s[1],
835
+ message: n.text,
836
+ wrap: n.wrap ?? this.autoWrap(),
837
+ type: this.LINETYPE.NOTE,
838
+ placement: e
839
+ });
840
+ }
841
+ addLinks(t, e) {
842
+ const n = this.getActor(t);
843
+ try {
844
+ let a = It(e.text, Q());
845
+ a = a.replace(/&equals;/g, "="), a = a.replace(/&amp;/g, "&");
846
+ const s = JSON.parse(a);
847
+ this.insertLinks(n, s);
848
+ } catch (a) {
849
+ K.error("error while parsing actor link text", a);
850
+ }
851
+ }
852
+ addALink(t, e) {
853
+ const n = this.getActor(t);
854
+ try {
855
+ const a = {};
856
+ let s = It(e.text, Q());
857
+ const r = s.indexOf("@");
858
+ s = s.replace(/&equals;/g, "="), s = s.replace(/&amp;/g, "&");
859
+ const c = s.slice(0, r - 1).trim(), h = s.slice(r + 1).trim();
860
+ a[c] = h, this.insertLinks(n, a);
861
+ } catch (a) {
862
+ K.error("error while parsing actor link text", a);
863
+ }
864
+ }
865
+ insertLinks(t, e) {
866
+ if (t.links == null)
867
+ t.links = e;
868
+ else
869
+ for (const n in e)
870
+ t.links[n] = e[n];
871
+ }
872
+ addProperties(t, e) {
873
+ const n = this.getActor(t);
874
+ try {
875
+ const a = It(e.text, Q()), s = JSON.parse(a);
876
+ this.insertProperties(n, s);
877
+ } catch (a) {
878
+ K.error("error while parsing actor properties text", a);
879
+ }
880
+ }
881
+ insertProperties(t, e) {
882
+ if (t.properties == null)
883
+ t.properties = e;
884
+ else
885
+ for (const n in e)
886
+ t.properties[n] = e[n];
887
+ }
888
+ boxEnd() {
889
+ this.state.records.currentBox = void 0;
890
+ }
891
+ addDetails(t, e) {
892
+ const n = this.getActor(t), a = document.getElementById(e.text);
893
+ try {
894
+ const s = a.innerHTML, r = JSON.parse(s);
895
+ r.properties && this.insertProperties(n, r.properties), r.links && this.insertLinks(n, r.links);
896
+ } catch (s) {
897
+ K.error("error while parsing actor details text", s);
898
+ }
899
+ }
900
+ getActorProperty(t, e) {
901
+ if ((t == null ? void 0 : t.properties) !== void 0)
902
+ return t.properties[e];
903
+ }
904
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
905
+ apply(t) {
906
+ if (Array.isArray(t))
907
+ t.forEach((e) => {
908
+ this.apply(e);
909
+ });
910
+ else
911
+ switch (t.type) {
912
+ case "sequenceIndex":
913
+ this.state.records.messages.push({
914
+ id: this.state.records.messages.length.toString(),
915
+ from: void 0,
916
+ to: void 0,
917
+ message: {
918
+ start: t.sequenceIndex,
919
+ step: t.sequenceIndexStep,
920
+ visible: t.sequenceVisible
921
+ },
922
+ wrap: !1,
923
+ type: t.signalType
924
+ });
925
+ break;
926
+ case "addParticipant":
927
+ this.addActor(t.actor, t.actor, t.description, t.draw);
928
+ break;
929
+ case "createParticipant":
930
+ if (this.state.records.actors.has(t.actor))
931
+ throw new Error(
932
+ "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"
933
+ );
934
+ this.state.records.lastCreated = t.actor, this.addActor(t.actor, t.actor, t.description, t.draw), this.state.records.createdActors.set(t.actor, this.state.records.messages.length);
935
+ break;
936
+ case "destroyParticipant":
937
+ this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
938
+ break;
939
+ case "activeStart":
940
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
941
+ break;
942
+ case "activeEnd":
943
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
944
+ break;
945
+ case "addNote":
946
+ this.addNote(t.actor, t.placement, t.text);
947
+ break;
948
+ case "addLinks":
949
+ this.addLinks(t.actor, t.text);
950
+ break;
951
+ case "addALink":
952
+ this.addALink(t.actor, t.text);
953
+ break;
954
+ case "addProperties":
955
+ this.addProperties(t.actor, t.text);
956
+ break;
957
+ case "addDetails":
958
+ this.addDetails(t.actor, t.text);
959
+ break;
960
+ case "addMessage":
961
+ if (this.state.records.lastCreated) {
962
+ if (t.to !== this.state.records.lastCreated)
963
+ throw new Error(
964
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
965
+ );
966
+ this.state.records.lastCreated = void 0;
967
+ } else if (this.state.records.lastDestroyed) {
968
+ if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
969
+ throw new Error(
970
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
971
+ );
972
+ this.state.records.lastDestroyed = void 0;
973
+ }
974
+ this.addSignal(t.from, t.to, t.msg, t.signalType, t.activate);
975
+ break;
976
+ case "boxStart":
977
+ this.addBox(t.boxData);
978
+ break;
979
+ case "boxEnd":
980
+ this.boxEnd();
981
+ break;
982
+ case "loopStart":
983
+ this.addSignal(void 0, void 0, t.loopText, t.signalType);
984
+ break;
985
+ case "loopEnd":
986
+ this.addSignal(void 0, void 0, void 0, t.signalType);
987
+ break;
988
+ case "rectStart":
989
+ this.addSignal(void 0, void 0, t.color, t.signalType);
990
+ break;
991
+ case "rectEnd":
992
+ this.addSignal(void 0, void 0, void 0, t.signalType);
993
+ break;
994
+ case "optStart":
995
+ this.addSignal(void 0, void 0, t.optText, t.signalType);
996
+ break;
997
+ case "optEnd":
998
+ this.addSignal(void 0, void 0, void 0, t.signalType);
999
+ break;
1000
+ case "altStart":
1001
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1002
+ break;
1003
+ case "else":
1004
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1005
+ break;
1006
+ case "altEnd":
1007
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1008
+ break;
1009
+ case "setAccTitle":
1010
+ jt(t.text);
1011
+ break;
1012
+ case "parStart":
1013
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1014
+ break;
1015
+ case "and":
1016
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1017
+ break;
1018
+ case "parEnd":
1019
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1020
+ break;
1021
+ case "criticalStart":
1022
+ this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1023
+ break;
1024
+ case "option":
1025
+ this.addSignal(void 0, void 0, t.optionText, t.signalType);
1026
+ break;
1027
+ case "criticalEnd":
1028
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1029
+ break;
1030
+ case "breakStart":
1031
+ this.addSignal(void 0, void 0, t.breakText, t.signalType);
1032
+ break;
1033
+ case "breakEnd":
1034
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1035
+ break;
1036
+ }
1037
+ }
1038
+ getConfig() {
1039
+ return Q().sequence;
1040
+ }
1041
+ }, g(St, "SequenceDB"), St), Re = /* @__PURE__ */ g((t) => `.actor {
1042
+ stroke: ${t.actorBorder};
1043
+ fill: ${t.actorBkg};
1044
+ }
1045
+
1046
+ text.actor > tspan {
1047
+ fill: ${t.actorTextColor};
1048
+ stroke: none;
1049
+ }
1050
+
1051
+ .actor-line {
1052
+ stroke: ${t.actorLineColor};
1053
+ }
1054
+
1055
+ .messageLine0 {
1056
+ stroke-width: 1.5;
1057
+ stroke-dasharray: none;
1058
+ stroke: ${t.signalColor};
1059
+ }
1060
+
1061
+ .messageLine1 {
1062
+ stroke-width: 1.5;
1063
+ stroke-dasharray: 2, 2;
1064
+ stroke: ${t.signalColor};
1065
+ }
1066
+
1067
+ #arrowhead path {
1068
+ fill: ${t.signalColor};
1069
+ stroke: ${t.signalColor};
1070
+ }
1071
+
1072
+ .sequenceNumber {
1073
+ fill: ${t.sequenceNumberColor};
1074
+ }
1075
+
1076
+ #sequencenumber {
1077
+ fill: ${t.signalColor};
1078
+ }
1079
+
1080
+ #crosshead path {
1081
+ fill: ${t.signalColor};
1082
+ stroke: ${t.signalColor};
1083
+ }
1084
+
1085
+ .messageText {
1086
+ fill: ${t.signalTextColor};
1087
+ stroke: none;
1088
+ }
1089
+
1090
+ .labelBox {
1091
+ stroke: ${t.labelBoxBorderColor};
1092
+ fill: ${t.labelBoxBkgColor};
1093
+ }
1094
+
1095
+ .labelText, .labelText > tspan {
1096
+ fill: ${t.labelTextColor};
1097
+ stroke: none;
1098
+ }
1099
+
1100
+ .loopText, .loopText > tspan {
1101
+ fill: ${t.loopTextColor};
1102
+ stroke: none;
1103
+ }
1104
+
1105
+ .loopLine {
1106
+ stroke-width: 2px;
1107
+ stroke-dasharray: 2, 2;
1108
+ stroke: ${t.labelBoxBorderColor};
1109
+ fill: ${t.labelBoxBorderColor};
1110
+ }
1111
+
1112
+ .note {
1113
+ //stroke: #decc93;
1114
+ stroke: ${t.noteBorderColor};
1115
+ fill: ${t.noteBkgColor};
1116
+ }
1117
+
1118
+ .noteText, .noteText > tspan {
1119
+ fill: ${t.noteTextColor};
1120
+ stroke: none;
1121
+ }
1122
+
1123
+ .activation0 {
1124
+ fill: ${t.activationBkgColor};
1125
+ stroke: ${t.activationBorderColor};
1126
+ }
1127
+
1128
+ .activation1 {
1129
+ fill: ${t.activationBkgColor};
1130
+ stroke: ${t.activationBorderColor};
1131
+ }
1132
+
1133
+ .activation2 {
1134
+ fill: ${t.activationBkgColor};
1135
+ stroke: ${t.activationBorderColor};
1136
+ }
1137
+
1138
+ .actorPopupMenu {
1139
+ position: absolute;
1140
+ }
1141
+
1142
+ .actorPopupMenuPanel {
1143
+ position: absolute;
1144
+ fill: ${t.actorBkg};
1145
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1146
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1147
+ }
1148
+ .actor-man line {
1149
+ stroke: ${t.actorBorder};
1150
+ fill: ${t.actorBkg};
1151
+ }
1152
+ .actor-man circle, line {
1153
+ stroke: ${t.actorBorder};
1154
+ fill: ${t.actorBkg};
1155
+ stroke-width: 2px;
1156
+ }
1157
+ `, "getStyles"), Ce = Re, gt = 18 * 2, Zt = "actor-top", Qt = "actor-bottom", Be = "actor-box", Kt = "actor-man", Yt = /* @__PURE__ */ g(function(t, e) {
1158
+ return xe(t, e);
1159
+ }, "drawRect"), $e = /* @__PURE__ */ g(function(t, e, n, a, s) {
1160
+ if (e.links === void 0 || e.links === null || Object.keys(e.links).length === 0)
1161
+ return { height: 0, width: 0 };
1162
+ const r = e.links, c = e.actorCnt, h = e.rectData;
1163
+ var p = "none";
1164
+ s && (p = "block !important");
1165
+ const i = t.append("g");
1166
+ i.attr("id", "actor" + c + "_popup"), i.attr("class", "actorPopupMenu"), i.attr("display", p);
1167
+ var x = "";
1168
+ h.class !== void 0 && (x = " " + h.class);
1169
+ let m = h.width > n ? h.width : n;
1170
+ const u = i.append("rect");
1171
+ if (u.attr("class", "actorPopupMenuPanel" + x), u.attr("x", h.x), u.attr("y", h.height), u.attr("fill", h.fill), u.attr("stroke", h.stroke), u.attr("width", m), u.attr("height", h.height), u.attr("rx", h.rx), u.attr("ry", h.ry), r != null) {
1172
+ var T = 20;
1173
+ for (let v in r) {
1174
+ var w = i.append("a"), I = Gt.sanitizeUrl(r[v]);
1175
+ w.attr("xlink:href", I), w.attr("target", "_blank"), ea(a)(
1176
+ v,
1177
+ w,
1178
+ h.x + 10,
1179
+ h.height + T,
1180
+ m,
1181
+ 20,
1182
+ { class: "actor" },
1183
+ a
1184
+ ), T += 30;
1185
+ }
1186
+ }
1187
+ return u.attr("height", T), { height: h.height + T, width: m };
1188
+ }, "drawPopup"), Ye = /* @__PURE__ */ g(function(t) {
1189
+ return "var pu = document.getElementById('" + t + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1190
+ }, "popupMenuToggle"), Pt = /* @__PURE__ */ g(async function(t, e, n = null) {
1191
+ let a = t.append("foreignObject");
1192
+ const s = await Ut(e.text, Dt()), r = a.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();
1193
+ if (a.attr("height", Math.round(r.height)).attr("width", Math.round(r.width)), e.class === "noteText") {
1194
+ const c = t.node().firstChild;
1195
+ c.setAttribute("height", r.height + 2 * e.textMargin);
1196
+ const h = c.getBBox();
1197
+ a.attr("x", Math.round(h.x + h.width / 2 - r.width / 2)).attr("y", Math.round(h.y + h.height / 2 - r.height / 2));
1198
+ } else if (n) {
1199
+ let { startx: c, stopx: h, starty: p } = n;
1200
+ if (c > h) {
1201
+ const i = c;
1202
+ c = h, h = i;
1203
+ }
1204
+ a.attr("x", Math.round(c + Math.abs(c - h) / 2 - r.width / 2)), e.class === "loopText" ? a.attr("y", Math.round(p)) : a.attr("y", Math.round(p - r.height));
1205
+ }
1206
+ return [a];
1207
+ }, "drawKatex"), mt = /* @__PURE__ */ g(function(t, e) {
1208
+ let n = 0, a = 0;
1209
+ const s = e.text.split(L.lineBreakRegex), [r, c] = Jt(e.fontSize);
1210
+ let h = [], p = 0, i = /* @__PURE__ */ g(() => e.y, "yfunc");
1211
+ if (e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0)
1212
+ switch (e.valign) {
1213
+ case "top":
1214
+ case "start":
1215
+ i = /* @__PURE__ */ g(() => Math.round(e.y + e.textMargin), "yfunc");
1216
+ break;
1217
+ case "middle":
1218
+ case "center":
1219
+ i = /* @__PURE__ */ g(() => Math.round(e.y + (n + a + e.textMargin) / 2), "yfunc");
1220
+ break;
1221
+ case "bottom":
1222
+ case "end":
1223
+ i = /* @__PURE__ */ g(() => Math.round(
1224
+ e.y + (n + a + 2 * e.textMargin) - e.textMargin
1225
+ ), "yfunc");
1226
+ break;
1227
+ }
1228
+ if (e.anchor !== void 0 && e.textMargin !== void 0 && e.width !== void 0)
1229
+ switch (e.anchor) {
1230
+ case "left":
1231
+ case "start":
1232
+ e.x = Math.round(e.x + e.textMargin), e.anchor = "start", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1233
+ break;
1234
+ case "middle":
1235
+ case "center":
1236
+ e.x = Math.round(e.x + e.width / 2), e.anchor = "middle", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1237
+ break;
1238
+ case "right":
1239
+ case "end":
1240
+ e.x = Math.round(e.x + e.width - e.textMargin), e.anchor = "end", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1241
+ break;
1242
+ }
1243
+ for (let [x, m] of s.entries()) {
1244
+ e.textMargin !== void 0 && e.textMargin === 0 && r !== void 0 && (p = x * r);
1245
+ const u = t.append("text");
1246
+ u.attr("x", e.x), u.attr("y", i()), e.anchor !== void 0 && u.attr("text-anchor", e.anchor).attr("dominant-baseline", e.dominantBaseline).attr("alignment-baseline", e.alignmentBaseline), e.fontFamily !== void 0 && u.style("font-family", e.fontFamily), c !== void 0 && u.style("font-size", c), e.fontWeight !== void 0 && u.style("font-weight", e.fontWeight), e.fill !== void 0 && u.attr("fill", e.fill), e.class !== void 0 && u.attr("class", e.class), e.dy !== void 0 ? u.attr("dy", e.dy) : p !== 0 && u.attr("dy", p);
1247
+ const T = m || ve;
1248
+ if (e.tspan) {
1249
+ const w = u.append("tspan");
1250
+ w.attr("x", e.x), e.fill !== void 0 && w.attr("fill", e.fill), w.text(T);
1251
+ } else
1252
+ u.text(T);
1253
+ e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0 && (a += (u._groups || u)[0][0].getBBox().height, n = a), h.push(u);
1254
+ }
1255
+ return h;
1256
+ }, "drawText"), te = /* @__PURE__ */ g(function(t, e) {
1257
+ function n(s, r, c, h, p) {
1258
+ return s + "," + r + " " + (s + c) + "," + r + " " + (s + c) + "," + (r + h - p) + " " + (s + c - p * 1.2) + "," + (r + h) + " " + s + "," + (r + h);
1259
+ }
1260
+ g(n, "genPoints");
1261
+ const a = t.append("polygon");
1262
+ return a.attr("points", n(e.x, e.y, e.width, e.height, 7)), a.attr("class", "labelBox"), e.y = e.y + e.height / 2, mt(t, e), a;
1263
+ }, "drawLabel"), nt = -1, ee = /* @__PURE__ */ g((t, e, n, a) => {
1264
+ t.select && n.forEach((s) => {
1265
+ const r = e.get(s), c = t.select("#actor" + r.actorCnt);
1266
+ !a.mirrorActors && r.stopy ? c.attr("y2", r.stopy + r.height / 2) : a.mirrorActors && c.attr("y2", r.stopy);
1267
+ });
1268
+ }, "fixLifeLineHeights"), Ve = /* @__PURE__ */ g(function(t, e, n, a) {
1269
+ var s, r;
1270
+ const c = a ? e.stopy : e.starty, h = e.x + e.width / 2, p = c + e.height, i = t.append("g").lower();
1271
+ var x = i;
1272
+ a || (nt++, Object.keys(e.links || {}).length && !n.forceMenus && x.attr("onclick", Ye(`actor${nt}_popup`)).attr("cursor", "pointer"), x.append("line").attr("id", "actor" + nt).attr("x1", h).attr("y1", p).attr("x2", h).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", e.name), x = i.append("g"), e.actorCnt = nt, e.links != null && x.attr("id", "root-" + nt));
1273
+ const m = kt();
1274
+ var u = "actor";
1275
+ (s = e.properties) != null && s.class ? u = e.properties.class : m.fill = "#eaeaea", a ? u += ` ${Qt}` : u += ` ${Zt}`, m.x = e.x, m.y = c, m.width = e.width, m.height = e.height, m.class = u, m.rx = 3, m.ry = 3, m.name = e.name;
1276
+ const T = Yt(x, m);
1277
+ if (e.rectData = m, (r = e.properties) != null && r.icon) {
1278
+ const I = e.properties.icon.trim();
1279
+ I.charAt(0) === "@" ? me(x, m.x + m.width - 20, m.y + 10, I.substr(1)) : Te(x, m.x + m.width - 20, m.y + 10, I);
1280
+ }
1281
+ Vt(n, ct(e.description))(
1282
+ e.description,
1283
+ x,
1284
+ m.x,
1285
+ m.y,
1286
+ m.width,
1287
+ m.height,
1288
+ { class: `actor ${Be}` },
1289
+ n
1290
+ );
1291
+ let w = e.height;
1292
+ if (T.node) {
1293
+ const I = T.node().getBBox();
1294
+ e.height = I.height, w = I.height;
1295
+ }
1296
+ return w;
1297
+ }, "drawActorTypeParticipant"), Fe = /* @__PURE__ */ g(function(t, e, n, a) {
1298
+ const s = a ? e.stopy : e.starty, r = e.x + e.width / 2, c = s + 80, h = t.append("g").lower();
1299
+ a || (nt++, h.append("line").attr("id", "actor" + nt).attr("x1", r).attr("y1", c).attr("x2", r).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", e.name), e.actorCnt = nt);
1300
+ const p = t.append("g");
1301
+ let i = Kt;
1302
+ a ? i += ` ${Qt}` : i += ` ${Zt}`, p.attr("class", i), p.attr("name", e.name);
1303
+ const x = kt();
1304
+ x.x = e.x, x.y = s, x.fill = "#eaeaea", x.width = e.width, x.height = e.height, x.class = "actor", x.rx = 3, x.ry = 3, p.append("line").attr("id", "actor-man-torso" + nt).attr("x1", r).attr("y1", s + 25).attr("x2", r).attr("y2", s + 45), p.append("line").attr("id", "actor-man-arms" + nt).attr("x1", r - gt / 2).attr("y1", s + 33).attr("x2", r + gt / 2).attr("y2", s + 33), p.append("line").attr("x1", r - gt / 2).attr("y1", s + 60).attr("x2", r).attr("y2", s + 45), p.append("line").attr("x1", r).attr("y1", s + 45).attr("x2", r + gt / 2 - 2).attr("y2", s + 60);
1305
+ const m = p.append("circle");
1306
+ m.attr("cx", e.x + e.width / 2), m.attr("cy", s + 10), m.attr("r", 15), m.attr("width", e.width), m.attr("height", e.height);
1307
+ const u = p.node().getBBox();
1308
+ return e.height = u.height, Vt(n, ct(e.description))(
1309
+ e.description,
1310
+ p,
1311
+ x.x,
1312
+ x.y + 35,
1313
+ x.width,
1314
+ x.height,
1315
+ { class: `actor ${Kt}` },
1316
+ n
1317
+ ), e.height;
1318
+ }, "drawActorTypeActor"), We = /* @__PURE__ */ g(async function(t, e, n, a) {
1319
+ switch (e.type) {
1320
+ case "actor":
1321
+ return await Fe(t, e, n, a);
1322
+ case "participant":
1323
+ return await Ve(t, e, n, a);
1324
+ }
1325
+ }, "drawActor"), qe = /* @__PURE__ */ g(function(t, e, n) {
1326
+ const a = t.append("g");
1327
+ ae(a, e), e.name && Vt(n)(
1328
+ e.name,
1329
+ a,
1330
+ e.x,
1331
+ e.y + (e.textMaxHeight || 0) / 2,
1332
+ e.width,
1333
+ 0,
1334
+ { class: "text" },
1335
+ n
1336
+ ), a.lower();
1337
+ }, "drawBox"), ze = /* @__PURE__ */ g(function(t) {
1338
+ return t.append("g");
1339
+ }, "anchorElement"), He = /* @__PURE__ */ g(function(t, e, n, a, s) {
1340
+ const r = kt(), c = e.anchored;
1341
+ r.x = e.startx, r.y = e.starty, r.class = "activation" + s % 3, r.width = e.stopx - e.startx, r.height = n - e.starty, Yt(c, r);
1342
+ }, "drawActivation"), je = /* @__PURE__ */ g(async function(t, e, n, a) {
1343
+ const {
1344
+ boxMargin: s,
1345
+ boxTextMargin: r,
1346
+ labelBoxHeight: c,
1347
+ labelBoxWidth: h,
1348
+ messageFontFamily: p,
1349
+ messageFontSize: i,
1350
+ messageFontWeight: x
1351
+ } = a, m = t.append("g"), u = /* @__PURE__ */ g(function(I, v, R, M) {
1352
+ return m.append("line").attr("x1", I).attr("y1", v).attr("x2", R).attr("y2", M).attr("class", "loopLine");
1353
+ }, "drawLoopLine");
1354
+ u(e.startx, e.starty, e.stopx, e.starty), u(e.stopx, e.starty, e.stopx, e.stopy), u(e.startx, e.stopy, e.stopx, e.stopy), u(e.startx, e.starty, e.startx, e.stopy), e.sections !== void 0 && e.sections.forEach(function(I) {
1355
+ u(e.startx, I.y, e.stopx, I.y).style(
1356
+ "stroke-dasharray",
1357
+ "3, 3"
1358
+ );
1359
+ });
1360
+ let T = $t();
1361
+ T.text = n, T.x = e.startx, T.y = e.starty, T.fontFamily = p, T.fontSize = i, T.fontWeight = x, T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.width = h || 50, T.height = c || 20, T.textMargin = r, T.class = "labelText", te(m, T), T = se(), T.text = e.title, T.x = e.startx + h / 2 + (e.stopx - e.startx) / 2, T.y = e.starty + s + r, T.anchor = "middle", T.valign = "middle", T.textMargin = r, T.class = "loopText", T.fontFamily = p, T.fontSize = i, T.fontWeight = x, T.wrap = !0;
1362
+ let w = ct(T.text) ? await Pt(m, T, e) : mt(m, T);
1363
+ if (e.sectionTitles !== void 0) {
1364
+ for (const [I, v] of Object.entries(e.sectionTitles))
1365
+ if (v.message) {
1366
+ T.text = v.message, T.x = e.startx + (e.stopx - e.startx) / 2, T.y = e.sections[I].y + s + r, T.class = "loopText", T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.fontFamily = p, T.fontSize = i, T.fontWeight = x, T.wrap = e.wrap, ct(T.text) ? (e.starty = e.sections[I].y, await Pt(m, T, e)) : mt(m, T);
1367
+ let R = Math.round(
1368
+ w.map((M) => (M._groups || M)[0][0].getBBox().height).reduce((M, C) => M + C)
1369
+ );
1370
+ e.sections[I].height += R - (s + r);
1371
+ }
1372
+ }
1373
+ return e.height = Math.round(e.stopy - e.starty), m;
1374
+ }, "drawLoop"), ae = /* @__PURE__ */ g(function(t, e) {
1375
+ ye(t, e);
1376
+ }, "drawBackgroundRect"), Ke = /* @__PURE__ */ g(function(t) {
1377
+ t.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1378
+ "d",
1379
+ "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"
1380
+ );
1381
+ }, "insertDatabaseIcon"), Xe = /* @__PURE__ */ g(function(t) {
1382
+ t.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1383
+ "d",
1384
+ "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"
1385
+ );
1386
+ }, "insertComputerIcon"), Ge = /* @__PURE__ */ g(function(t) {
1387
+ t.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1388
+ "d",
1389
+ "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"
1390
+ );
1391
+ }, "insertClockIcon"), Je = /* @__PURE__ */ g(function(t) {
1392
+ t.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");
1393
+ }, "insertArrowHead"), Ue = /* @__PURE__ */ g(function(t) {
1394
+ t.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");
1395
+ }, "insertArrowFilledHead"), Ze = /* @__PURE__ */ g(function(t) {
1396
+ t.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);
1397
+ }, "insertSequenceNumber"), Qe = /* @__PURE__ */ g(function(t) {
1398
+ t.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");
1399
+ }, "insertArrowCrossHead"), se = /* @__PURE__ */ g(function() {
1400
+ return {
1401
+ x: 0,
1402
+ y: 0,
1403
+ fill: void 0,
1404
+ anchor: void 0,
1405
+ style: "#666",
1406
+ width: void 0,
1407
+ height: void 0,
1408
+ textMargin: 0,
1409
+ rx: 0,
1410
+ ry: 0,
1411
+ tspan: !0,
1412
+ valign: void 0
1413
+ };
1414
+ }, "getTextObj"), ta = /* @__PURE__ */ g(function() {
1415
+ return {
1416
+ x: 0,
1417
+ y: 0,
1418
+ fill: "#EDF2AE",
1419
+ stroke: "#666",
1420
+ width: 100,
1421
+ anchor: "start",
1422
+ height: 100,
1423
+ rx: 0,
1424
+ ry: 0
1425
+ };
1426
+ }, "getNoteRect"), Vt = /* @__PURE__ */ function() {
1427
+ function t(r, c, h, p, i, x, m) {
1428
+ const u = c.append("text").attr("x", h + i / 2).attr("y", p + x / 2 + 5).style("text-anchor", "middle").text(r);
1429
+ s(u, m);
1430
+ }
1431
+ g(t, "byText");
1432
+ function e(r, c, h, p, i, x, m, u) {
1433
+ const { actorFontSize: T, actorFontFamily: w, actorFontWeight: I } = u, [v, R] = Jt(T), M = r.split(L.lineBreakRegex);
1434
+ for (let C = 0; C < M.length; C++) {
1435
+ const S = C * v - v * (M.length - 1) / 2, V = c.append("text").attr("x", h + i / 2).attr("y", p).style("text-anchor", "middle").style("font-size", R).style("font-weight", I).style("font-family", w);
1436
+ V.append("tspan").attr("x", h + i / 2).attr("dy", S).text(M[C]), V.attr("y", p + x / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(V, m);
1437
+ }
1438
+ }
1439
+ g(e, "byTspan");
1440
+ function n(r, c, h, p, i, x, m, u) {
1441
+ const T = c.append("switch"), w = T.append("foreignObject").attr("x", h).attr("y", p).attr("width", i).attr("height", x).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1442
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), e(r, T, h, p, i, x, m, u), s(w, m);
1443
+ }
1444
+ g(n, "byFo");
1445
+ async function a(r, c, h, p, i, x, m, u) {
1446
+ const T = await Tt(r, Dt()), w = c.append("switch"), I = w.append("foreignObject").attr("x", h + i / 2 - T.width / 2).attr("y", p + x / 2 - T.height / 2).attr("width", T.width).attr("height", T.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1447
+ I.append("div").style("text-align", "center").style("vertical-align", "middle").html(await Ut(r, Dt())), e(r, w, h, p, i, x, m, u), s(I, m);
1448
+ }
1449
+ g(a, "byKatex");
1450
+ function s(r, c) {
1451
+ for (const h in c)
1452
+ c.hasOwnProperty(h) && r.attr(h, c[h]);
1453
+ }
1454
+ return g(s, "_setTextAttrs"), function(r, c = !1) {
1455
+ return c ? a : r.textPlacement === "fo" ? n : r.textPlacement === "old" ? t : e;
1456
+ };
1457
+ }(), ea = /* @__PURE__ */ function() {
1458
+ function t(s, r, c, h, p, i, x) {
1459
+ const m = r.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(s);
1460
+ a(m, x);
1461
+ }
1462
+ g(t, "byText");
1463
+ function e(s, r, c, h, p, i, x, m) {
1464
+ const { actorFontSize: u, actorFontFamily: T, actorFontWeight: w } = m, I = s.split(L.lineBreakRegex);
1465
+ for (let v = 0; v < I.length; v++) {
1466
+ const R = v * u - u * (I.length - 1) / 2, M = r.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", u).style("font-weight", w).style("font-family", T);
1467
+ M.append("tspan").attr("x", c).attr("dy", R).text(I[v]), M.attr("y", h + i / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), a(M, x);
1468
+ }
1469
+ }
1470
+ g(e, "byTspan");
1471
+ function n(s, r, c, h, p, i, x, m) {
1472
+ const u = r.append("switch"), T = u.append("foreignObject").attr("x", c).attr("y", h).attr("width", p).attr("height", i).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1473
+ T.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(s), e(s, u, c, h, p, i, x, m), a(T, x);
1474
+ }
1475
+ g(n, "byFo");
1476
+ function a(s, r) {
1477
+ for (const c in r)
1478
+ r.hasOwnProperty(c) && s.attr(c, r[c]);
1479
+ }
1480
+ return g(a, "_setTextAttrs"), function(s) {
1481
+ return s.textPlacement === "fo" ? n : s.textPlacement === "old" ? t : e;
1482
+ };
1483
+ }(), D = {
1484
+ drawRect: Yt,
1485
+ drawText: mt,
1486
+ drawLabel: te,
1487
+ drawActor: We,
1488
+ drawBox: qe,
1489
+ drawPopup: $e,
1490
+ anchorElement: ze,
1491
+ drawActivation: He,
1492
+ drawLoop: je,
1493
+ drawBackgroundRect: ae,
1494
+ insertArrowHead: Je,
1495
+ insertArrowFilledHead: Ue,
1496
+ insertSequenceNumber: Ze,
1497
+ insertArrowCrossHead: Qe,
1498
+ insertDatabaseIcon: Ke,
1499
+ insertComputerIcon: Xe,
1500
+ insertClockIcon: Ge,
1501
+ getTextObj: se,
1502
+ getNoteRect: ta,
1503
+ fixLifeLineHeights: ee,
1504
+ sanitizeUrl: Gt.sanitizeUrl
1505
+ }, o = {}, y = {
1506
+ data: {
1507
+ startx: void 0,
1508
+ stopx: void 0,
1509
+ starty: void 0,
1510
+ stopy: void 0
1511
+ },
1512
+ verticalPos: 0,
1513
+ sequenceItems: [],
1514
+ activations: [],
1515
+ models: {
1516
+ getHeight: /* @__PURE__ */ g(function() {
1517
+ return Math.max.apply(
1518
+ null,
1519
+ this.actors.length === 0 ? [0] : this.actors.map((t) => t.height || 0)
1520
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.messages.length === 0 ? 0 : this.messages.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.notes.length === 0 ? 0 : this.notes.map((t) => t.height || 0).reduce((t, e) => t + e));
1521
+ }, "getHeight"),
1522
+ clear: /* @__PURE__ */ g(function() {
1523
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1524
+ }, "clear"),
1525
+ addBox: /* @__PURE__ */ g(function(t) {
1526
+ this.boxes.push(t);
1527
+ }, "addBox"),
1528
+ addActor: /* @__PURE__ */ g(function(t) {
1529
+ this.actors.push(t);
1530
+ }, "addActor"),
1531
+ addLoop: /* @__PURE__ */ g(function(t) {
1532
+ this.loops.push(t);
1533
+ }, "addLoop"),
1534
+ addMessage: /* @__PURE__ */ g(function(t) {
1535
+ this.messages.push(t);
1536
+ }, "addMessage"),
1537
+ addNote: /* @__PURE__ */ g(function(t) {
1538
+ this.notes.push(t);
1539
+ }, "addNote"),
1540
+ lastActor: /* @__PURE__ */ g(function() {
1541
+ return this.actors[this.actors.length - 1];
1542
+ }, "lastActor"),
1543
+ lastLoop: /* @__PURE__ */ g(function() {
1544
+ return this.loops[this.loops.length - 1];
1545
+ }, "lastLoop"),
1546
+ lastMessage: /* @__PURE__ */ g(function() {
1547
+ return this.messages[this.messages.length - 1];
1548
+ }, "lastMessage"),
1549
+ lastNote: /* @__PURE__ */ g(function() {
1550
+ return this.notes[this.notes.length - 1];
1551
+ }, "lastNote"),
1552
+ actors: [],
1553
+ boxes: [],
1554
+ loops: [],
1555
+ messages: [],
1556
+ notes: []
1557
+ },
1558
+ init: /* @__PURE__ */ g(function() {
1559
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1560
+ startx: void 0,
1561
+ stopx: void 0,
1562
+ starty: void 0,
1563
+ stopy: void 0
1564
+ }, this.verticalPos = 0, oe(Q());
1565
+ }, "init"),
1566
+ updateVal: /* @__PURE__ */ g(function(t, e, n, a) {
1567
+ t[e] === void 0 ? t[e] = n : t[e] = a(n, t[e]);
1568
+ }, "updateVal"),
1569
+ updateBounds: /* @__PURE__ */ g(function(t, e, n, a) {
1570
+ const s = this;
1571
+ let r = 0;
1572
+ function c(h) {
1573
+ return /* @__PURE__ */ g(function(p) {
1574
+ r++;
1575
+ const i = s.sequenceItems.length - r + 1;
1576
+ s.updateVal(p, "starty", e - i * o.boxMargin, Math.min), s.updateVal(p, "stopy", a + i * o.boxMargin, Math.max), s.updateVal(y.data, "startx", t - i * o.boxMargin, Math.min), s.updateVal(y.data, "stopx", n + i * o.boxMargin, Math.max), h !== "activation" && (s.updateVal(p, "startx", t - i * o.boxMargin, Math.min), s.updateVal(p, "stopx", n + i * o.boxMargin, Math.max), s.updateVal(y.data, "starty", e - i * o.boxMargin, Math.min), s.updateVal(y.data, "stopy", a + i * o.boxMargin, Math.max));
1577
+ }, "updateItemBounds");
1578
+ }
1579
+ g(c, "updateFn"), this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1580
+ }, "updateBounds"),
1581
+ insert: /* @__PURE__ */ g(function(t, e, n, a) {
1582
+ const s = L.getMin(t, n), r = L.getMax(t, n), c = L.getMin(e, a), h = L.getMax(e, a);
1583
+ this.updateVal(y.data, "startx", s, Math.min), this.updateVal(y.data, "starty", c, Math.min), this.updateVal(y.data, "stopx", r, Math.max), this.updateVal(y.data, "stopy", h, Math.max), this.updateBounds(s, c, r, h);
1584
+ }, "insert"),
1585
+ newActivation: /* @__PURE__ */ g(function(t, e, n) {
1586
+ const a = n.get(t.from), s = vt(t.from).length || 0, r = a.x + a.width / 2 + (s - 1) * o.activationWidth / 2;
1587
+ this.activations.push({
1588
+ startx: r,
1589
+ starty: this.verticalPos + 2,
1590
+ stopx: r + o.activationWidth,
1591
+ stopy: void 0,
1592
+ actor: t.from,
1593
+ anchored: D.anchorElement(e)
1594
+ });
1595
+ }, "newActivation"),
1596
+ endActivation: /* @__PURE__ */ g(function(t) {
1597
+ const e = this.activations.map(function(n) {
1598
+ return n.actor;
1599
+ }).lastIndexOf(t.from);
1600
+ return this.activations.splice(e, 1)[0];
1601
+ }, "endActivation"),
1602
+ createLoop: /* @__PURE__ */ g(function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
1603
+ return {
1604
+ startx: void 0,
1605
+ starty: this.verticalPos,
1606
+ stopx: void 0,
1607
+ stopy: void 0,
1608
+ title: t.message,
1609
+ wrap: t.wrap,
1610
+ width: t.width,
1611
+ height: 0,
1612
+ fill: e
1613
+ };
1614
+ }, "createLoop"),
1615
+ newLoop: /* @__PURE__ */ g(function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
1616
+ this.sequenceItems.push(this.createLoop(t, e));
1617
+ }, "newLoop"),
1618
+ endLoop: /* @__PURE__ */ g(function() {
1619
+ return this.sequenceItems.pop();
1620
+ }, "endLoop"),
1621
+ isLoopOverlap: /* @__PURE__ */ g(function() {
1622
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
1623
+ }, "isLoopOverlap"),
1624
+ addSectionToLoop: /* @__PURE__ */ g(function(t) {
1625
+ const e = this.sequenceItems.pop();
1626
+ e.sections = e.sections || [], e.sectionTitles = e.sectionTitles || [], e.sections.push({ y: y.getVerticalPos(), height: 0 }), e.sectionTitles.push(t), this.sequenceItems.push(e);
1627
+ }, "addSectionToLoop"),
1628
+ saveVerticalPos: /* @__PURE__ */ g(function() {
1629
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1630
+ }, "saveVerticalPos"),
1631
+ resetVerticalPos: /* @__PURE__ */ g(function() {
1632
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1633
+ }, "resetVerticalPos"),
1634
+ bumpVerticalPos: /* @__PURE__ */ g(function(t) {
1635
+ this.verticalPos = this.verticalPos + t, this.data.stopy = L.getMax(this.data.stopy, this.verticalPos);
1636
+ }, "bumpVerticalPos"),
1637
+ getVerticalPos: /* @__PURE__ */ g(function() {
1638
+ return this.verticalPos;
1639
+ }, "getVerticalPos"),
1640
+ getBounds: /* @__PURE__ */ g(function() {
1641
+ return { bounds: this.data, models: this.models };
1642
+ }, "getBounds")
1643
+ }, aa = /* @__PURE__ */ g(async function(t, e) {
1644
+ y.bumpVerticalPos(o.boxMargin), e.height = o.boxMargin, e.starty = y.getVerticalPos();
1645
+ const n = kt();
1646
+ n.x = e.startx, n.y = e.starty, n.width = e.width || o.width, n.class = "note";
1647
+ const a = t.append("g"), s = D.drawRect(a, n), r = $t();
1648
+ r.x = e.startx, r.y = e.starty, r.width = n.width, r.dy = "1em", r.text = e.message, r.class = "noteText", r.fontFamily = o.noteFontFamily, r.fontSize = o.noteFontSize, r.fontWeight = o.noteFontWeight, r.anchor = o.noteAlign, r.textMargin = o.noteMargin, r.valign = "center";
1649
+ const c = ct(r.text) ? await Pt(a, r) : mt(a, r), h = Math.round(
1650
+ c.map((p) => (p._groups || p)[0][0].getBBox().height).reduce((p, i) => p + i)
1651
+ );
1652
+ s.attr("height", h + 2 * o.noteMargin), e.height += h + 2 * o.noteMargin, y.bumpVerticalPos(h + 2 * o.noteMargin), e.stopy = e.starty + h + 2 * o.noteMargin, e.stopx = e.startx + n.width, y.insert(e.startx, e.starty, e.stopx, e.stopy), y.models.addNote(e);
1653
+ }, "drawNote"), ut = /* @__PURE__ */ g((t) => ({
1654
+ fontFamily: t.messageFontFamily,
1655
+ fontSize: t.messageFontSize,
1656
+ fontWeight: t.messageFontWeight
1657
+ }), "messageFont"), yt = /* @__PURE__ */ g((t) => ({
1658
+ fontFamily: t.noteFontFamily,
1659
+ fontSize: t.noteFontSize,
1660
+ fontWeight: t.noteFontWeight
1661
+ }), "noteFont"), Ct = /* @__PURE__ */ g((t) => ({
1662
+ fontFamily: t.actorFontFamily,
1663
+ fontSize: t.actorFontSize,
1664
+ fontWeight: t.actorFontWeight
1665
+ }), "actorFont");
1666
+ async function re(t, e) {
1667
+ y.bumpVerticalPos(10);
1668
+ const { startx: n, stopx: a, message: s } = e, r = L.splitBreaks(s).length, c = ct(s), h = c ? await Tt(s, Q()) : $.calculateTextDimensions(s, ut(o));
1669
+ if (!c) {
1670
+ const m = h.height / r;
1671
+ e.height += m, y.bumpVerticalPos(m);
1672
+ }
1673
+ let p, i = h.height - 10;
1674
+ const x = h.width;
1675
+ if (n === a) {
1676
+ p = y.getVerticalPos() + i, o.rightAngles || (i += o.boxMargin, p = y.getVerticalPos() + i), i += 30;
1677
+ const m = L.getMax(x / 2, o.width / 2);
1678
+ y.insert(
1679
+ n - m,
1680
+ y.getVerticalPos() - 10 + i,
1681
+ a + m,
1682
+ y.getVerticalPos() + 30 + i
1683
+ );
1684
+ } else
1685
+ i += o.boxMargin, p = y.getVerticalPos() + i, y.insert(n, p - 10, a, p);
1686
+ return y.bumpVerticalPos(i), e.height += i, e.stopy = e.starty + e.height, y.insert(e.fromBounds, e.starty, e.toBounds, e.stopy), p;
1687
+ }
1688
+ g(re, "boundMessage");
1689
+ var sa = /* @__PURE__ */ g(async function(t, e, n, a) {
1690
+ const { startx: s, stopx: r, starty: c, message: h, type: p, sequenceIndex: i, sequenceVisible: x } = e, m = $.calculateTextDimensions(h, ut(o)), u = $t();
1691
+ u.x = s, u.y = c + 10, u.width = r - s, u.class = "messageText", u.dy = "1em", u.text = h, u.fontFamily = o.messageFontFamily, u.fontSize = o.messageFontSize, u.fontWeight = o.messageFontWeight, u.anchor = o.messageAlign, u.valign = "center", u.textMargin = o.wrapPadding, u.tspan = !1, ct(u.text) ? await Pt(t, u, { startx: s, stopx: r, starty: n }) : mt(t, u);
1692
+ const T = m.width;
1693
+ let w;
1694
+ s === r ? o.rightAngles ? w = t.append("path").attr(
1695
+ "d",
1696
+ `M ${s},${n} H ${s + L.getMax(o.width / 2, T / 2)} V ${n + 25} H ${s}`
1697
+ ) : w = t.append("path").attr(
1698
+ "d",
1699
+ "M " + s + "," + n + " C " + (s + 60) + "," + (n - 10) + " " + (s + 60) + "," + (n + 30) + " " + s + "," + (n + 20)
1700
+ ) : (w = t.append("line"), w.attr("x1", s), w.attr("y1", n), w.attr("x2", r), w.attr("y2", n)), p === a.db.LINETYPE.DOTTED || p === a.db.LINETYPE.DOTTED_CROSS || p === a.db.LINETYPE.DOTTED_POINT || p === a.db.LINETYPE.DOTTED_OPEN || p === a.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (w.style("stroke-dasharray", "3, 3"), w.attr("class", "messageLine1")) : w.attr("class", "messageLine0");
1701
+ let I = "";
1702
+ o.arrowMarkerAbsolute && (I = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, I = I.replace(/\(/g, "\\("), I = I.replace(/\)/g, "\\)")), w.attr("stroke-width", 2), w.attr("stroke", "none"), w.style("fill", "none"), (p === a.db.LINETYPE.SOLID || p === a.db.LINETYPE.DOTTED) && w.attr("marker-end", "url(" + I + "#arrowhead)"), (p === a.db.LINETYPE.BIDIRECTIONAL_SOLID || p === a.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (w.attr("marker-start", "url(" + I + "#arrowhead)"), w.attr("marker-end", "url(" + I + "#arrowhead)")), (p === a.db.LINETYPE.SOLID_POINT || p === a.db.LINETYPE.DOTTED_POINT) && w.attr("marker-end", "url(" + I + "#filled-head)"), (p === a.db.LINETYPE.SOLID_CROSS || p === a.db.LINETYPE.DOTTED_CROSS) && w.attr("marker-end", "url(" + I + "#crosshead)"), (x || o.showSequenceNumbers) && (w.attr("marker-start", "url(" + I + "#sequencenumber)"), t.append("text").attr("x", s).attr("y", n + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(i));
1703
+ }, "drawMessage"), ra = /* @__PURE__ */ g(function(t, e, n, a, s, r, c) {
1704
+ let h = 0, p = 0, i, x = 0;
1705
+ for (const m of a) {
1706
+ const u = e.get(m), T = u.box;
1707
+ i && i != T && (c || y.models.addBox(i), p += o.boxMargin + i.margin), T && T != i && (c || (T.x = h + p, T.y = s), p += T.margin), u.width = u.width || o.width, u.height = L.getMax(u.height || o.height, o.height), u.margin = u.margin || o.actorMargin, x = L.getMax(x, u.height), n.get(u.name) && (p += u.width / 2), u.x = h + p, u.starty = y.getVerticalPos(), y.insert(u.x, s, u.x + u.width, u.height), h += u.width + p, u.box && (u.box.width = h + T.margin - u.box.x), p = u.margin, i = u.box, y.models.addActor(u);
1708
+ }
1709
+ i && !c && y.models.addBox(i), y.bumpVerticalPos(x);
1710
+ }, "addActorRenderingData"), Bt = /* @__PURE__ */ g(async function(t, e, n, a) {
1711
+ if (a) {
1712
+ let s = 0;
1713
+ y.bumpVerticalPos(o.boxMargin * 2);
1714
+ for (const r of n) {
1715
+ const c = e.get(r);
1716
+ c.stopy || (c.stopy = y.getVerticalPos());
1717
+ const h = await D.drawActor(t, c, o, !0);
1718
+ s = L.getMax(s, h);
1719
+ }
1720
+ y.bumpVerticalPos(s + o.boxMargin);
1721
+ } else
1722
+ for (const s of n) {
1723
+ const r = e.get(s);
1724
+ await D.drawActor(t, r, o, !1);
1725
+ }
1726
+ }, "drawActors"), ie = /* @__PURE__ */ g(function(t, e, n, a) {
1727
+ let s = 0, r = 0;
1728
+ for (const c of n) {
1729
+ const h = e.get(c), p = oa(h), i = D.drawPopup(
1730
+ t,
1731
+ h,
1732
+ p,
1733
+ o,
1734
+ o.forceMenus,
1735
+ a
1736
+ );
1737
+ i.height > s && (s = i.height), i.width + h.x > r && (r = i.width + h.x);
1738
+ }
1739
+ return { maxHeight: s, maxWidth: r };
1740
+ }, "drawActorsPopup"), oe = /* @__PURE__ */ g(function(t) {
1741
+ _e(o, t), t.fontFamily && (o.actorFontFamily = o.noteFontFamily = o.messageFontFamily = t.fontFamily), t.fontSize && (o.actorFontSize = o.noteFontSize = o.messageFontSize = t.fontSize), t.fontWeight && (o.actorFontWeight = o.noteFontWeight = o.messageFontWeight = t.fontWeight);
1742
+ }, "setConf"), vt = /* @__PURE__ */ g(function(t) {
1743
+ return y.activations.filter(function(e) {
1744
+ return e.actor === t;
1745
+ });
1746
+ }, "actorActivations"), Xt = /* @__PURE__ */ g(function(t, e) {
1747
+ const n = e.get(t), a = vt(t), s = a.reduce(
1748
+ function(c, h) {
1749
+ return L.getMin(c, h.startx);
1750
+ },
1751
+ n.x + n.width / 2 - 1
1752
+ ), r = a.reduce(
1753
+ function(c, h) {
1754
+ return L.getMax(c, h.stopx);
1755
+ },
1756
+ n.x + n.width / 2 + 1
1757
+ );
1758
+ return [s, r];
1759
+ }, "activationBounds");
1760
+ function rt(t, e, n, a, s) {
1761
+ y.bumpVerticalPos(n);
1762
+ let r = a;
1763
+ if (e.id && e.message && t[e.id]) {
1764
+ const c = t[e.id].width, h = ut(o);
1765
+ e.message = $.wrapLabel(`[${e.message}]`, c - 2 * o.wrapPadding, h), e.width = c, e.wrap = !0;
1766
+ const p = $.calculateTextDimensions(e.message, h), i = L.getMax(p.height, o.labelBoxHeight);
1767
+ r = a + i, K.debug(`${i} - ${e.message}`);
1768
+ }
1769
+ s(e), y.bumpVerticalPos(r);
1770
+ }
1771
+ g(rt, "adjustLoopHeightForWrap");
1772
+ function ne(t, e, n, a, s, r, c) {
1773
+ function h(i, x) {
1774
+ i.x < s.get(t.from).x ? (y.insert(
1775
+ e.stopx - x,
1776
+ e.starty,
1777
+ e.startx,
1778
+ e.stopy + i.height / 2 + o.noteMargin
1779
+ ), e.stopx = e.stopx + x) : (y.insert(
1780
+ e.startx,
1781
+ e.starty,
1782
+ e.stopx + x,
1783
+ e.stopy + i.height / 2 + o.noteMargin
1784
+ ), e.stopx = e.stopx - x);
1785
+ }
1786
+ g(h, "receiverAdjustment");
1787
+ function p(i, x) {
1788
+ i.x < s.get(t.to).x ? (y.insert(
1789
+ e.startx - x,
1790
+ e.starty,
1791
+ e.stopx,
1792
+ e.stopy + i.height / 2 + o.noteMargin
1793
+ ), e.startx = e.startx + x) : (y.insert(
1794
+ e.stopx,
1795
+ e.starty,
1796
+ e.startx + x,
1797
+ e.stopy + i.height / 2 + o.noteMargin
1798
+ ), e.startx = e.startx - x);
1799
+ }
1800
+ if (g(p, "senderAdjustment"), r.get(t.to) == a) {
1801
+ const i = s.get(t.to), x = i.type == "actor" ? gt / 2 + 3 : i.width / 2 + 3;
1802
+ h(i, x), i.starty = n - i.height / 2, y.bumpVerticalPos(i.height / 2);
1803
+ } else if (c.get(t.from) == a) {
1804
+ const i = s.get(t.from);
1805
+ if (o.mirrorActors) {
1806
+ const x = i.type == "actor" ? gt / 2 : i.width / 2;
1807
+ p(i, x);
1808
+ }
1809
+ i.stopy = n - i.height / 2, y.bumpVerticalPos(i.height / 2);
1810
+ } else if (c.get(t.to) == a) {
1811
+ const i = s.get(t.to);
1812
+ if (o.mirrorActors) {
1813
+ const x = i.type == "actor" ? gt / 2 + 3 : i.width / 2 + 3;
1814
+ h(i, x);
1815
+ }
1816
+ i.stopy = n - i.height / 2, y.bumpVerticalPos(i.height / 2);
1817
+ }
1818
+ }
1819
+ g(ne, "adjustCreatedDestroyedData");
1820
+ var ia = /* @__PURE__ */ g(async function(t, e, n, a) {
1821
+ const { securityLevel: s, sequence: r } = Q();
1822
+ o = r;
1823
+ let c;
1824
+ s === "sandbox" && (c = Lt("#i" + e));
1825
+ const h = s === "sandbox" ? Lt(c.nodes()[0].contentDocument.body) : Lt("body"), p = s === "sandbox" ? c.nodes()[0].contentDocument : document;
1826
+ y.init(), K.debug(a.db);
1827
+ const i = s === "sandbox" ? h.select(`[id="${e}"]`) : Lt(`[id="${e}"]`), x = a.db.getActors(), m = a.db.getCreatedActors(), u = a.db.getDestroyedActors(), T = a.db.getBoxes();
1828
+ let w = a.db.getActorKeys();
1829
+ const I = a.db.getMessages(), v = a.db.getDiagramTitle(), R = a.db.hasAtLeastOneBox(), M = a.db.hasAtLeastOneBoxWithTitle(), C = await ce(x, I, a);
1830
+ if (o.height = await de(x, C, T), D.insertComputerIcon(i), D.insertDatabaseIcon(i), D.insertClockIcon(i), R && (y.bumpVerticalPos(o.boxMargin), M && y.bumpVerticalPos(T[0].textMaxHeight)), o.hideUnusedParticipants === !0) {
1831
+ const b = /* @__PURE__ */ new Set();
1832
+ I.forEach((k) => {
1833
+ b.add(k.from), b.add(k.to);
1834
+ }), w = w.filter((k) => b.has(k));
1835
+ }
1836
+ ra(i, x, m, w, 0, I, !1);
1837
+ const S = await da(I, x, C, a);
1838
+ D.insertArrowHead(i), D.insertArrowCrossHead(i), D.insertArrowFilledHead(i), D.insertSequenceNumber(i);
1839
+ function V(b, k) {
1840
+ const U = y.endActivation(b);
1841
+ U.starty + 18 > k && (U.starty = k - 6, k += 12), D.drawActivation(
1842
+ i,
1843
+ U,
1844
+ k,
1845
+ o,
1846
+ vt(b.from).length
1847
+ ), y.insert(U.startx, k - 10, U.stopx, k);
1848
+ }
1849
+ g(V, "activeEnd");
1850
+ let F = 1, X = 1;
1851
+ const tt = [], W = [];
1852
+ let q = 0;
1853
+ for (const b of I) {
1854
+ let k, U, st;
1855
+ switch (b.type) {
1856
+ case a.db.LINETYPE.NOTE:
1857
+ y.resetVerticalPos(), U = b.noteModel, await aa(i, U);
1858
+ break;
1859
+ case a.db.LINETYPE.ACTIVE_START:
1860
+ y.newActivation(b, i, x);
1861
+ break;
1862
+ case a.db.LINETYPE.ACTIVE_END:
1863
+ V(b, y.getVerticalPos());
1864
+ break;
1865
+ case a.db.LINETYPE.LOOP_START:
1866
+ rt(
1867
+ S,
1868
+ b,
1869
+ o.boxMargin,
1870
+ o.boxMargin + o.boxTextMargin,
1871
+ (_) => y.newLoop(_)
1872
+ );
1873
+ break;
1874
+ case a.db.LINETYPE.LOOP_END:
1875
+ k = y.endLoop(), await D.drawLoop(i, k, "loop", o), y.bumpVerticalPos(k.stopy - y.getVerticalPos()), y.models.addLoop(k);
1876
+ break;
1877
+ case a.db.LINETYPE.RECT_START:
1878
+ rt(
1879
+ S,
1880
+ b,
1881
+ o.boxMargin,
1882
+ o.boxMargin,
1883
+ (_) => y.newLoop(void 0, _.message)
1884
+ );
1885
+ break;
1886
+ case a.db.LINETYPE.RECT_END:
1887
+ k = y.endLoop(), W.push(k), y.models.addLoop(k), y.bumpVerticalPos(k.stopy - y.getVerticalPos());
1888
+ break;
1889
+ case a.db.LINETYPE.OPT_START:
1890
+ rt(
1891
+ S,
1892
+ b,
1893
+ o.boxMargin,
1894
+ o.boxMargin + o.boxTextMargin,
1895
+ (_) => y.newLoop(_)
1896
+ );
1897
+ break;
1898
+ case a.db.LINETYPE.OPT_END:
1899
+ k = y.endLoop(), await D.drawLoop(i, k, "opt", o), y.bumpVerticalPos(k.stopy - y.getVerticalPos()), y.models.addLoop(k);
1900
+ break;
1901
+ case a.db.LINETYPE.ALT_START:
1902
+ rt(
1903
+ S,
1904
+ b,
1905
+ o.boxMargin,
1906
+ o.boxMargin + o.boxTextMargin,
1907
+ (_) => y.newLoop(_)
1908
+ );
1909
+ break;
1910
+ case a.db.LINETYPE.ALT_ELSE:
1911
+ rt(
1912
+ S,
1913
+ b,
1914
+ o.boxMargin + o.boxTextMargin,
1915
+ o.boxMargin,
1916
+ (_) => y.addSectionToLoop(_)
1917
+ );
1918
+ break;
1919
+ case a.db.LINETYPE.ALT_END:
1920
+ k = y.endLoop(), await D.drawLoop(i, k, "alt", o), y.bumpVerticalPos(k.stopy - y.getVerticalPos()), y.models.addLoop(k);
1921
+ break;
1922
+ case a.db.LINETYPE.PAR_START:
1923
+ case a.db.LINETYPE.PAR_OVER_START:
1924
+ rt(
1925
+ S,
1926
+ b,
1927
+ o.boxMargin,
1928
+ o.boxMargin + o.boxTextMargin,
1929
+ (_) => y.newLoop(_)
1930
+ ), y.saveVerticalPos();
1931
+ break;
1932
+ case a.db.LINETYPE.PAR_AND:
1933
+ rt(
1934
+ S,
1935
+ b,
1936
+ o.boxMargin + o.boxTextMargin,
1937
+ o.boxMargin,
1938
+ (_) => y.addSectionToLoop(_)
1939
+ );
1940
+ break;
1941
+ case a.db.LINETYPE.PAR_END:
1942
+ k = y.endLoop(), await D.drawLoop(i, k, "par", o), y.bumpVerticalPos(k.stopy - y.getVerticalPos()), y.models.addLoop(k);
1943
+ break;
1944
+ case a.db.LINETYPE.AUTONUMBER:
1945
+ F = b.message.start || F, X = b.message.step || X, b.message.visible ? a.db.enableSequenceNumbers() : a.db.disableSequenceNumbers();
1946
+ break;
1947
+ case a.db.LINETYPE.CRITICAL_START:
1948
+ rt(
1949
+ S,
1950
+ b,
1951
+ o.boxMargin,
1952
+ o.boxMargin + o.boxTextMargin,
1953
+ (_) => y.newLoop(_)
1954
+ );
1955
+ break;
1956
+ case a.db.LINETYPE.CRITICAL_OPTION:
1957
+ rt(
1958
+ S,
1959
+ b,
1960
+ o.boxMargin + o.boxTextMargin,
1961
+ o.boxMargin,
1962
+ (_) => y.addSectionToLoop(_)
1963
+ );
1964
+ break;
1965
+ case a.db.LINETYPE.CRITICAL_END:
1966
+ k = y.endLoop(), await D.drawLoop(i, k, "critical", o), y.bumpVerticalPos(k.stopy - y.getVerticalPos()), y.models.addLoop(k);
1967
+ break;
1968
+ case a.db.LINETYPE.BREAK_START:
1969
+ rt(
1970
+ S,
1971
+ b,
1972
+ o.boxMargin,
1973
+ o.boxMargin + o.boxTextMargin,
1974
+ (_) => y.newLoop(_)
1975
+ );
1976
+ break;
1977
+ case a.db.LINETYPE.BREAK_END:
1978
+ k = y.endLoop(), await D.drawLoop(i, k, "break", o), y.bumpVerticalPos(k.stopy - y.getVerticalPos()), y.models.addLoop(k);
1979
+ break;
1980
+ default:
1981
+ try {
1982
+ st = b.msgModel, st.starty = y.getVerticalPos(), st.sequenceIndex = F, st.sequenceVisible = a.db.showSequenceNumbers();
1983
+ const _ = await re(i, st);
1984
+ ne(
1985
+ b,
1986
+ st,
1987
+ _,
1988
+ q,
1989
+ x,
1990
+ m,
1991
+ u
1992
+ ), tt.push({ messageModel: st, lineStartY: _ }), y.models.addMessage(st);
1993
+ } catch (_) {
1994
+ K.error("error while drawing message", _);
1995
+ }
1996
+ }
1997
+ [
1998
+ a.db.LINETYPE.SOLID_OPEN,
1999
+ a.db.LINETYPE.DOTTED_OPEN,
2000
+ a.db.LINETYPE.SOLID,
2001
+ a.db.LINETYPE.DOTTED,
2002
+ a.db.LINETYPE.SOLID_CROSS,
2003
+ a.db.LINETYPE.DOTTED_CROSS,
2004
+ a.db.LINETYPE.SOLID_POINT,
2005
+ a.db.LINETYPE.DOTTED_POINT,
2006
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2007
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED
2008
+ ].includes(b.type) && (F = F + X), q++;
2009
+ }
2010
+ K.debug("createdActors", m), K.debug("destroyedActors", u), await Bt(i, x, w, !1);
2011
+ for (const b of tt)
2012
+ await sa(i, b.messageModel, b.lineStartY, a);
2013
+ o.mirrorActors && await Bt(i, x, w, !0), W.forEach((b) => D.drawBackgroundRect(i, b)), ee(i, x, w, o);
2014
+ for (const b of y.models.boxes)
2015
+ b.height = y.getVerticalPos() - b.y, y.insert(b.x, b.y, b.x + b.width, b.height), b.startx = b.x, b.starty = b.y, b.stopx = b.startx + b.width, b.stopy = b.starty + b.height, b.stroke = "rgb(0,0,0, 0.5)", D.drawBox(i, b, o);
2016
+ R && y.bumpVerticalPos(o.boxMargin);
2017
+ const Y = ie(i, x, w, p), { bounds: O } = y.getBounds();
2018
+ O.startx === void 0 && (O.startx = 0), O.starty === void 0 && (O.starty = 0), O.stopx === void 0 && (O.stopx = 0), O.stopy === void 0 && (O.stopy = 0);
2019
+ let G = O.stopy - O.starty;
2020
+ G < Y.maxHeight && (G = Y.maxHeight);
2021
+ let z = G + 2 * o.diagramMarginY;
2022
+ o.mirrorActors && (z = z - o.boxMargin + o.bottomMarginAdj);
2023
+ let J = O.stopx - O.startx;
2024
+ J < Y.maxWidth && (J = Y.maxWidth);
2025
+ const et = J + 2 * o.diagramMarginX;
2026
+ v && i.append("text").text(v).attr("x", (O.stopx - O.startx) / 2 - 2 * o.diagramMarginX).attr("y", -25), Ae(i, z, et, o.useMaxWidth);
2027
+ const N = v ? 40 : 0;
2028
+ i.attr(
2029
+ "viewBox",
2030
+ O.startx - o.diagramMarginX + " -" + (o.diagramMarginY + N) + " " + et + " " + (z + N)
2031
+ ), K.debug("models:", y.models);
2032
+ }, "draw");
2033
+ async function ce(t, e, n) {
2034
+ const a = {};
2035
+ for (const s of e)
2036
+ if (t.get(s.to) && t.get(s.from)) {
2037
+ const r = t.get(s.to);
2038
+ if (s.placement === n.db.PLACEMENT.LEFTOF && !r.prevActor || s.placement === n.db.PLACEMENT.RIGHTOF && !r.nextActor)
2039
+ continue;
2040
+ const c = s.placement !== void 0, h = !c, p = c ? yt(o) : ut(o), i = s.wrap ? $.wrapLabel(s.message, o.width - 2 * o.wrapPadding, p) : s.message, x = (ct(i) ? await Tt(s.message, Q()) : $.calculateTextDimensions(i, p)).width + 2 * o.wrapPadding;
2041
+ h && s.from === r.nextActor ? a[s.to] = L.getMax(
2042
+ a[s.to] || 0,
2043
+ x
2044
+ ) : h && s.from === r.prevActor ? a[s.from] = L.getMax(
2045
+ a[s.from] || 0,
2046
+ x
2047
+ ) : h && s.from === s.to ? (a[s.from] = L.getMax(
2048
+ a[s.from] || 0,
2049
+ x / 2
2050
+ ), a[s.to] = L.getMax(
2051
+ a[s.to] || 0,
2052
+ x / 2
2053
+ )) : s.placement === n.db.PLACEMENT.RIGHTOF ? a[s.from] = L.getMax(
2054
+ a[s.from] || 0,
2055
+ x
2056
+ ) : s.placement === n.db.PLACEMENT.LEFTOF ? a[r.prevActor] = L.getMax(
2057
+ a[r.prevActor] || 0,
2058
+ x
2059
+ ) : s.placement === n.db.PLACEMENT.OVER && (r.prevActor && (a[r.prevActor] = L.getMax(
2060
+ a[r.prevActor] || 0,
2061
+ x / 2
2062
+ )), r.nextActor && (a[s.from] = L.getMax(
2063
+ a[s.from] || 0,
2064
+ x / 2
2065
+ )));
2066
+ }
2067
+ return K.debug("maxMessageWidthPerActor:", a), a;
2068
+ }
2069
+ g(ce, "getMaxMessageWidthPerActor");
2070
+ var oa = /* @__PURE__ */ g(function(t) {
2071
+ let e = 0;
2072
+ const n = Ct(o);
2073
+ for (const a in t.links) {
2074
+ const s = $.calculateTextDimensions(a, n).width + 2 * o.wrapPadding + 2 * o.boxMargin;
2075
+ e < s && (e = s);
2076
+ }
2077
+ return e;
2078
+ }, "getRequiredPopupWidth");
2079
+ async function de(t, e, n) {
2080
+ let a = 0;
2081
+ for (const r of t.keys()) {
2082
+ const c = t.get(r);
2083
+ c.wrap && (c.description = $.wrapLabel(
2084
+ c.description,
2085
+ o.width - 2 * o.wrapPadding,
2086
+ Ct(o)
2087
+ ));
2088
+ const h = ct(c.description) ? await Tt(c.description, Q()) : $.calculateTextDimensions(c.description, Ct(o));
2089
+ c.width = c.wrap ? o.width : L.getMax(o.width, h.width + 2 * o.wrapPadding), c.height = c.wrap ? L.getMax(h.height, o.height) : o.height, a = L.getMax(a, c.height);
2090
+ }
2091
+ for (const r in e) {
2092
+ const c = t.get(r);
2093
+ if (!c)
2094
+ continue;
2095
+ const h = t.get(c.nextActor);
2096
+ if (!h) {
2097
+ const i = e[r] + o.actorMargin - c.width / 2;
2098
+ c.margin = L.getMax(i, o.actorMargin);
2099
+ continue;
2100
+ }
2101
+ const p = e[r] + o.actorMargin - c.width / 2 - h.width / 2;
2102
+ c.margin = L.getMax(p, o.actorMargin);
2103
+ }
2104
+ let s = 0;
2105
+ return n.forEach((r) => {
2106
+ const c = ut(o);
2107
+ let h = r.actorKeys.reduce((x, m) => x += t.get(m).width + (t.get(m).margin || 0), 0);
2108
+ h -= 2 * o.boxTextMargin, r.wrap && (r.name = $.wrapLabel(r.name, h - 2 * o.wrapPadding, c));
2109
+ const p = $.calculateTextDimensions(r.name, c);
2110
+ s = L.getMax(p.height, s);
2111
+ const i = L.getMax(h, p.width + 2 * o.wrapPadding);
2112
+ if (r.margin = o.boxTextMargin, h < i) {
2113
+ const x = (i - h) / 2;
2114
+ r.margin += x;
2115
+ }
2116
+ }), n.forEach((r) => r.textMaxHeight = s), L.getMax(a, o.height);
2117
+ }
2118
+ g(de, "calculateActorMargins");
2119
+ var na = /* @__PURE__ */ g(async function(t, e, n) {
2120
+ const a = e.get(t.from), s = e.get(t.to), r = a.x, c = s.x, h = t.wrap && t.message;
2121
+ let p = ct(t.message) ? await Tt(t.message, Q()) : $.calculateTextDimensions(
2122
+ h ? $.wrapLabel(t.message, o.width, yt(o)) : t.message,
2123
+ yt(o)
2124
+ );
2125
+ const i = {
2126
+ width: h ? o.width : L.getMax(o.width, p.width + 2 * o.noteMargin),
2127
+ height: 0,
2128
+ startx: a.x,
2129
+ stopx: 0,
2130
+ starty: 0,
2131
+ stopy: 0,
2132
+ message: t.message
2133
+ };
2134
+ return t.placement === n.db.PLACEMENT.RIGHTOF ? (i.width = h ? L.getMax(o.width, p.width) : L.getMax(
2135
+ a.width / 2 + s.width / 2,
2136
+ p.width + 2 * o.noteMargin
2137
+ ), i.startx = r + (a.width + o.actorMargin) / 2) : t.placement === n.db.PLACEMENT.LEFTOF ? (i.width = h ? L.getMax(o.width, p.width + 2 * o.noteMargin) : L.getMax(
2138
+ a.width / 2 + s.width / 2,
2139
+ p.width + 2 * o.noteMargin
2140
+ ), i.startx = r - i.width + (a.width - o.actorMargin) / 2) : t.to === t.from ? (p = $.calculateTextDimensions(
2141
+ h ? $.wrapLabel(t.message, L.getMax(o.width, a.width), yt(o)) : t.message,
2142
+ yt(o)
2143
+ ), i.width = h ? L.getMax(o.width, a.width) : L.getMax(a.width, o.width, p.width + 2 * o.noteMargin), i.startx = r + (a.width - i.width) / 2) : (i.width = Math.abs(r + a.width / 2 - (c + s.width / 2)) + o.actorMargin, i.startx = r < c ? r + a.width / 2 - o.actorMargin / 2 : c + s.width / 2 - o.actorMargin / 2), h && (i.message = $.wrapLabel(
2144
+ t.message,
2145
+ i.width - 2 * o.wrapPadding,
2146
+ yt(o)
2147
+ )), K.debug(
2148
+ `NM:[${i.startx},${i.stopx},${i.starty},${i.stopy}:${i.width},${i.height}=${t.message}]`
2149
+ ), i;
2150
+ }, "buildNoteModel"), ca = /* @__PURE__ */ g(function(t, e, n) {
2151
+ if (![
2152
+ n.db.LINETYPE.SOLID_OPEN,
2153
+ n.db.LINETYPE.DOTTED_OPEN,
2154
+ n.db.LINETYPE.SOLID,
2155
+ n.db.LINETYPE.DOTTED,
2156
+ n.db.LINETYPE.SOLID_CROSS,
2157
+ n.db.LINETYPE.DOTTED_CROSS,
2158
+ n.db.LINETYPE.SOLID_POINT,
2159
+ n.db.LINETYPE.DOTTED_POINT,
2160
+ n.db.LINETYPE.BIDIRECTIONAL_SOLID,
2161
+ n.db.LINETYPE.BIDIRECTIONAL_DOTTED
2162
+ ].includes(t.type))
2163
+ return {};
2164
+ const [a, s] = Xt(t.from, e), [r, c] = Xt(t.to, e), h = a <= r;
2165
+ let p = h ? s : a, i = h ? r : c;
2166
+ const x = Math.abs(r - c) > 2, m = /* @__PURE__ */ g((I) => h ? -I : I, "adjustValue");
2167
+ t.from === t.to ? i = p : (t.activate && !x && (i += m(o.activationWidth / 2 - 1)), [n.db.LINETYPE.SOLID_OPEN, n.db.LINETYPE.DOTTED_OPEN].includes(t.type) || (i += m(3)), [n.db.LINETYPE.BIDIRECTIONAL_SOLID, n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2168
+ t.type
2169
+ ) && (p -= m(3)));
2170
+ const u = [a, s, r, c], T = Math.abs(p - i);
2171
+ t.wrap && t.message && (t.message = $.wrapLabel(
2172
+ t.message,
2173
+ L.getMax(T + 2 * o.wrapPadding, o.width),
2174
+ ut(o)
2175
+ ));
2176
+ const w = $.calculateTextDimensions(t.message, ut(o));
2177
+ return {
2178
+ width: L.getMax(
2179
+ t.wrap ? 0 : w.width + 2 * o.wrapPadding,
2180
+ T + 2 * o.wrapPadding,
2181
+ o.width
2182
+ ),
2183
+ height: 0,
2184
+ startx: p,
2185
+ stopx: i,
2186
+ starty: 0,
2187
+ stopy: 0,
2188
+ message: t.message,
2189
+ type: t.type,
2190
+ wrap: t.wrap,
2191
+ fromBounds: Math.min.apply(null, u),
2192
+ toBounds: Math.max.apply(null, u)
2193
+ };
2194
+ }, "buildMessageModel"), da = /* @__PURE__ */ g(async function(t, e, n, a) {
2195
+ const s = {}, r = [];
2196
+ let c, h, p;
2197
+ for (const i of t) {
2198
+ switch (i.type) {
2199
+ case a.db.LINETYPE.LOOP_START:
2200
+ case a.db.LINETYPE.ALT_START:
2201
+ case a.db.LINETYPE.OPT_START:
2202
+ case a.db.LINETYPE.PAR_START:
2203
+ case a.db.LINETYPE.PAR_OVER_START:
2204
+ case a.db.LINETYPE.CRITICAL_START:
2205
+ case a.db.LINETYPE.BREAK_START:
2206
+ r.push({
2207
+ id: i.id,
2208
+ msg: i.message,
2209
+ from: Number.MAX_SAFE_INTEGER,
2210
+ to: Number.MIN_SAFE_INTEGER,
2211
+ width: 0
2212
+ });
2213
+ break;
2214
+ case a.db.LINETYPE.ALT_ELSE:
2215
+ case a.db.LINETYPE.PAR_AND:
2216
+ case a.db.LINETYPE.CRITICAL_OPTION:
2217
+ i.message && (c = r.pop(), s[c.id] = c, s[i.id] = c, r.push(c));
2218
+ break;
2219
+ case a.db.LINETYPE.LOOP_END:
2220
+ case a.db.LINETYPE.ALT_END:
2221
+ case a.db.LINETYPE.OPT_END:
2222
+ case a.db.LINETYPE.PAR_END:
2223
+ case a.db.LINETYPE.CRITICAL_END:
2224
+ case a.db.LINETYPE.BREAK_END:
2225
+ c = r.pop(), s[c.id] = c;
2226
+ break;
2227
+ case a.db.LINETYPE.ACTIVE_START:
2228
+ {
2229
+ const x = e.get(i.from ? i.from : i.to.actor), m = vt(i.from ? i.from : i.to.actor).length, u = x.x + x.width / 2 + (m - 1) * o.activationWidth / 2, T = {
2230
+ startx: u,
2231
+ stopx: u + o.activationWidth,
2232
+ actor: i.from,
2233
+ enabled: !0
2234
+ };
2235
+ y.activations.push(T);
2236
+ }
2237
+ break;
2238
+ case a.db.LINETYPE.ACTIVE_END:
2239
+ {
2240
+ const x = y.activations.map((m) => m.actor).lastIndexOf(i.from);
2241
+ y.activations.splice(x, 1).splice(0, 1);
2242
+ }
2243
+ break;
2244
+ }
2245
+ i.placement !== void 0 ? (h = await na(i, e, a), i.noteModel = h, r.forEach((x) => {
2246
+ c = x, c.from = L.getMin(c.from, h.startx), c.to = L.getMax(c.to, h.startx + h.width), c.width = L.getMax(c.width, Math.abs(c.from - c.to)) - o.labelBoxWidth;
2247
+ })) : (p = ca(i, e, a), i.msgModel = p, p.startx && p.stopx && r.length > 0 && r.forEach((x) => {
2248
+ if (c = x, p.startx === p.stopx) {
2249
+ const m = e.get(i.from), u = e.get(i.to);
2250
+ c.from = L.getMin(
2251
+ m.x - p.width / 2,
2252
+ m.x - m.width / 2,
2253
+ c.from
2254
+ ), c.to = L.getMax(
2255
+ u.x + p.width / 2,
2256
+ u.x + m.width / 2,
2257
+ c.to
2258
+ ), c.width = L.getMax(c.width, Math.abs(c.to - c.from)) - o.labelBoxWidth;
2259
+ } else
2260
+ c.from = L.getMin(p.startx, c.from), c.to = L.getMax(p.stopx, c.to), c.width = L.getMax(c.width, p.width) - o.labelBoxWidth;
2261
+ }));
2262
+ }
2263
+ return y.activations = [], K.debug("Loop type widths:", s), s;
2264
+ }, "calculateLoopBounds"), ha = {
2265
+ bounds: y,
2266
+ drawActors: Bt,
2267
+ drawActorsPopup: ie,
2268
+ setConf: oe,
2269
+ draw: ia
2270
+ }, xa = {
2271
+ parser: Ne,
2272
+ get db() {
2273
+ return new De();
2274
+ },
2275
+ renderer: ha,
2276
+ styles: Ce,
2277
+ init: /* @__PURE__ */ g((t) => {
2278
+ t.sequence || (t.sequence = {}), t.wrap && (t.sequence.wrap = t.wrap, Ee({ sequence: { wrap: t.wrap } }));
2279
+ }, "init")
2280
+ };
2281
+ export {
2282
+ xa as diagram
2283
+ };