@schmitech/chatbot-widget 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/_basePickBy-C3-QE0dl-5eQ6L29l.js +152 -0
  2. package/dist/_baseUniq-CstiM9Lp-AFR_Ns0a.js +615 -0
  3. package/dist/arc-W3NKKXLI-DHbDwLx0.js +84 -0
  4. package/dist/architecture-U656AL7Q-fn9wJZsH-BLoGjtkP.js +6 -0
  5. package/dist/architectureDiagram-VXUJARFQ-zzJsgPC6-C4OfUE0m.js +4667 -0
  6. package/dist/blockDiagram-VD42YOAC-D-In4h7h-BYXdRmeG.js +2266 -0
  7. package/dist/c4Diagram-YG6GDRKO-DBs8r9gh-BdLuHgPT.js +1582 -0
  8. package/dist/channel-RBWQyMSg-Cx0HUumY.js +6 -0
  9. package/dist/chatbot-widget.bundle.js +4473 -1556
  10. package/dist/chatbot-widget.css +1 -1
  11. package/dist/chatbot-widget.es.js +12 -63659
  12. package/dist/chatbot-widget.umd.js +4472 -1555
  13. package/dist/chunk-4BX2VUAB-BqD7w0AR-CbA2613c.js +10 -0
  14. package/dist/chunk-55IACEB6-D8pvDVEJ-DrL4SJSR.js +9 -0
  15. package/dist/chunk-B4BG7PRW-Dwma1pSy-BWjG5dc6.js +1375 -0
  16. package/dist/chunk-DI55MBZ5-BY2XXvZz-DbAvz3Pq.js +1383 -0
  17. package/dist/chunk-FMBD7UC4-BeiLbQ8U-BNaZTCv4.js +20 -0
  18. package/dist/chunk-QN33PNHL-BkO3hOeq-DkU1EzGA.js +21 -0
  19. package/dist/chunk-QZHKN3VN-Cwlo2qTG-DMmeZmp5.js +16 -0
  20. package/dist/chunk-TZMSLE5B-BnXK-OiF-RfzVsOBe.js +65 -0
  21. package/dist/classDiagram-2ON5EDUG-Crd6O69V-kCZrFOLN.js +17 -0
  22. package/dist/classDiagram-v2-WZHVMYZB-Crd6O69V-kCZrFOLN.js +17 -0
  23. package/dist/clone-CfLgyC8S-DsDOh4B4.js +9 -0
  24. package/dist/config/index.d.ts +4 -2
  25. package/dist/cose-bilkent-S5V4N54A-DKeVcPDK-de_7nZTY.js +2609 -0
  26. package/dist/cytoscape.esm-CjI2IsL8-Be2K4mI6.js +18723 -0
  27. package/dist/dagre-6UL2VRFP-BPf604Df-BhZs6zCq.js +448 -0
  28. package/dist/diagram-PSM6KHXK-DeLcpEV3-qb4rujeN.js +532 -0
  29. package/dist/diagram-QEK2KX5R-C_5RR1NJ-C5kZWmRl.js +222 -0
  30. package/dist/diagram-S2PKOQOG-DVx43aon-4nlw6iDz.js +144 -0
  31. package/dist/erDiagram-Q2GNP2WA-DgUeO5_h-DHc9Yphl.js +841 -0
  32. package/dist/flowDiagram-NV44I4VS-C5HQUzU9-DHjbmAtJ.js +1628 -0
  33. package/dist/ganttDiagram-JELNMOA3-DgSZ1ixF-C3hJs_k9.js +1936 -0
  34. package/dist/gitGraph-F6HP7TQM-UL7-Bx1s-Cog5rj3j.js +6 -0
  35. package/dist/gitGraphDiagram-NY62KEGX-DY5loT9K-CEcKQNrM.js +713 -0
  36. package/dist/graph-BfwqPHx6-DErF9dBN.js +248 -0
  37. package/dist/index-B5s_uaP2.js +124168 -0
  38. package/dist/index-BAOVR-xx-thst7Pu6.js +13251 -0
  39. package/dist/info-NVLQJR56-BsqQ0RXQ-BcYgZCCY.js +6 -0
  40. package/dist/infoDiagram-WHAUD3N6-DIqQ6vCk-BuiAAMSH.js +25 -0
  41. package/dist/journeyDiagram-XKPGCS4Q-DXjg3S3r-Byi_TGXs.js +835 -0
  42. package/dist/kanban-definition-3W4ZIXB7-Uxt7Am6n-jy96nA-g.js +721 -0
  43. package/dist/layout-CSfkE668-BjigbqJL.js +1333 -0
  44. package/dist/mermaid-parser.core-LjuO4CL3-BLqmPe8-.js +12891 -0
  45. package/dist/mindmap-definition-VGOIOE7T-DXwVuAPE-SK4e1Sse.js +787 -0
  46. package/dist/packet-BFZMPI3H-DJWkrKrV-BamBev9S.js +6 -0
  47. package/dist/pie-7BOR55EZ-DC8hTFwn-D1bcIQbR.js +6 -0
  48. package/dist/pieDiagram-ADFJNKIX-Cj0EHHtj-Dbr09c-S.js +161 -0
  49. package/dist/quadrantDiagram-AYHSOK5B-CnLDz007-Ci0DQl2T.js +1024 -0
  50. package/dist/radar-NHE76QYJ-Bijk-Fk9-9nAmDCMr.js +6 -0
  51. package/dist/requirementDiagram-UZGBJVZJ-rDaI-8Be-CSEc4S33.js +851 -0
  52. package/dist/sankeyDiagram-TZEHDZUN-A0YO8ixs-Zj8Z0j0n.js +810 -0
  53. package/dist/sequenceDiagram-WL72ISMW-BFF7TtP7-Dcofckjv.js +2519 -0
  54. package/dist/shared/styles.d.ts +1 -1
  55. package/dist/stateDiagram-FKZM4ZOC-ofFsB7HJ-BJBX12rE.js +264 -0
  56. package/dist/stateDiagram-v2-4FDKWEC3-CEZFbksU-BywmU88h.js +17 -0
  57. package/dist/timeline-definition-IT6M3QCI-5W361ZNm-MP_ufVe7.js +800 -0
  58. package/dist/treemap-KMMF4GRG-pGRoYcSn-BeZ7sXgP.js +6 -0
  59. package/dist/ui/Message.d.ts +1 -5
  60. package/dist/ui/MessagesList.d.ts +1 -5
  61. package/dist/utils/contentFiltering.d.ts +12 -0
  62. package/dist/xychartDiagram-PRI3JC2R-CSr0GxaP-DBgCtplP.js +1297 -0
  63. package/package.json +3 -3
  64. package/dist/ui/TypingEffect.d.ts +0 -18
@@ -0,0 +1,2519 @@
1
+ import { d as Ee, p as Ut, y as lt, x as we, m as Gt, h as Kt } from "./chunk-TZMSLE5B-BnXK-OiF-RfzVsOBe.js";
2
+ import { x as y, J as Ie, p as at, f as At, a as X, l as re, G as ke, i as Le, n as L, u as ee, h as ve, w as Pe, g as _e, B as Ae, z as Ne, C as Me, H as Oe, L as Se, y as Nt, v as V, aw as kt, ax as W, an as se, ay as De, az as $e, aA as ie, S as qt } from "./index-B5s_uaP2.js";
3
+ import { e as Re } from "./chunk-QZHKN3VN-Cwlo2qTG-DMmeZmp5.js";
4
+ typeof window < "u" && (window.global = window);
5
+ var zt = function() {
6
+ var e = /* @__PURE__ */ y(function(ct, I, k, E) {
7
+ for (k = k || {}, E = ct.length; E--; k[ct[E]] = I) ;
8
+ return k;
9
+ }, "o"), t = [1, 2], o = [1, 3], a = [1, 4], r = [2, 4], s = [1, 9], c = [1, 11], h = [1, 13], g = [1, 14], i = [1, 16], d = [1, 17], n = [1, 18], u = [1, 24], b = [1, 25], m = [1, 26], w = [1, 27], P = [1, 28], A = [1, 29], N = [1, 30], M = [1, 31], $ = [1, 32], B = [1, 33], q = [1, 34], Z = [1, 35], rt = [1, 36], z = [1, 37], H = [1, 38], F = [1, 39], R = [1, 41], Q = [1, 42], j = [1, 43], J = [1, 44], st = [1, 45], D = [1, 46], T = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], v = [2, 71], U = [4, 5, 16, 50, 52, 53], tt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], S = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], Rt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 55, 60, 61, 62, 63, 71], Xt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 55, 60, 61, 62, 63, 71], nt = [69, 70, 71], ht = [1, 127], Ct = {
10
+ trace: /* @__PURE__ */ y(function() {
11
+ }, "trace"),
12
+ yy: {},
13
+ symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, actor_with_config: 54, note: 55, placement: 56, text2: 57, over: 58, actor_pair: 59, links: 60, link: 61, properties: 62, details: 63, spaceList: 64, ",": 65, left_of: 66, right_of: 67, signaltype: 68, "+": 69, "-": 70, ACTOR: 71, config_object: 72, CONFIG_START: 73, CONFIG_CONTENT: 74, CONFIG_END: 75, SOLID_OPEN_ARROW: 76, DOTTED_OPEN_ARROW: 77, SOLID_ARROW: 78, BIDIRECTIONAL_SOLID_ARROW: 79, DOTTED_ARROW: 80, BIDIRECTIONAL_DOTTED_ARROW: 81, SOLID_CROSS: 82, DOTTED_CROSS: 83, SOLID_POINT: 84, DOTTED_POINT: 85, TXT: 86, $accept: 0, $end: 1 },
14
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 55: "note", 58: "over", 60: "links", 61: "link", 62: "properties", 63: "details", 65: ",", 66: "left_of", 67: "right_of", 69: "+", 70: "-", 71: "ACTOR", 73: "CONFIG_START", 74: "CONFIG_CONTENT", 75: "CONFIG_END", 76: "SOLID_OPEN_ARROW", 77: "DOTTED_OPEN_ARROW", 78: "SOLID_ARROW", 79: "BIDIRECTIONAL_SOLID_ARROW", 80: "DOTTED_ARROW", 81: "BIDIRECTIONAL_DOTTED_ARROW", 82: "SOLID_CROSS", 83: "DOTTED_CROSS", 84: "SOLID_POINT", 85: "DOTTED_POINT", 86: "TXT" },
15
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [64, 2], [64, 1], [59, 3], [59, 1], [56, 1], [56, 1], [17, 5], [17, 5], [17, 4], [54, 2], [72, 3], [22, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [57, 1]],
16
+ performAction: /* @__PURE__ */ y(function(ct, I, k, E, O, p, G) {
17
+ var x = p.length - 1;
18
+ switch (O) {
19
+ case 3:
20
+ return E.apply(p[x]), p[x];
21
+ case 4:
22
+ case 9:
23
+ this.$ = [];
24
+ break;
25
+ case 5:
26
+ case 10:
27
+ p[x - 1].push(p[x]), this.$ = p[x - 1];
28
+ break;
29
+ case 6:
30
+ case 7:
31
+ case 11:
32
+ case 12:
33
+ this.$ = p[x];
34
+ break;
35
+ case 8:
36
+ case 13:
37
+ this.$ = [];
38
+ break;
39
+ case 15:
40
+ p[x].type = "createParticipant", this.$ = p[x];
41
+ break;
42
+ case 16:
43
+ p[x - 1].unshift({ type: "boxStart", boxData: E.parseBoxData(p[x - 2]) }), p[x - 1].push({ type: "boxEnd", boxText: p[x - 2] }), this.$ = p[x - 1];
44
+ break;
45
+ case 18:
46
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(p[x - 2]), sequenceIndexStep: Number(p[x - 1]), sequenceVisible: !0, signalType: E.LINETYPE.AUTONUMBER };
47
+ break;
48
+ case 19:
49
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(p[x - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: E.LINETYPE.AUTONUMBER };
50
+ break;
51
+ case 20:
52
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: E.LINETYPE.AUTONUMBER };
53
+ break;
54
+ case 21:
55
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: E.LINETYPE.AUTONUMBER };
56
+ break;
57
+ case 22:
58
+ this.$ = { type: "activeStart", signalType: E.LINETYPE.ACTIVE_START, actor: p[x - 1].actor };
59
+ break;
60
+ case 23:
61
+ this.$ = { type: "activeEnd", signalType: E.LINETYPE.ACTIVE_END, actor: p[x - 1].actor };
62
+ break;
63
+ case 29:
64
+ E.setDiagramTitle(p[x].substring(6)), this.$ = p[x].substring(6);
65
+ break;
66
+ case 30:
67
+ E.setDiagramTitle(p[x].substring(7)), this.$ = p[x].substring(7);
68
+ break;
69
+ case 31:
70
+ this.$ = p[x].trim(), E.setAccTitle(this.$);
71
+ break;
72
+ case 32:
73
+ case 33:
74
+ this.$ = p[x].trim(), E.setAccDescription(this.$);
75
+ break;
76
+ case 34:
77
+ p[x - 1].unshift({ type: "loopStart", loopText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.LOOP_START }), p[x - 1].push({ type: "loopEnd", loopText: p[x - 2], signalType: E.LINETYPE.LOOP_END }), this.$ = p[x - 1];
78
+ break;
79
+ case 35:
80
+ p[x - 1].unshift({ type: "rectStart", color: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.RECT_START }), p[x - 1].push({ type: "rectEnd", color: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.RECT_END }), this.$ = p[x - 1];
81
+ break;
82
+ case 36:
83
+ p[x - 1].unshift({ type: "optStart", optText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.OPT_START }), p[x - 1].push({ type: "optEnd", optText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.OPT_END }), this.$ = p[x - 1];
84
+ break;
85
+ case 37:
86
+ p[x - 1].unshift({ type: "altStart", altText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.ALT_START }), p[x - 1].push({ type: "altEnd", signalType: E.LINETYPE.ALT_END }), this.$ = p[x - 1];
87
+ break;
88
+ case 38:
89
+ p[x - 1].unshift({ type: "parStart", parText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.PAR_START }), p[x - 1].push({ type: "parEnd", signalType: E.LINETYPE.PAR_END }), this.$ = p[x - 1];
90
+ break;
91
+ case 39:
92
+ p[x - 1].unshift({ type: "parStart", parText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.PAR_OVER_START }), p[x - 1].push({ type: "parEnd", signalType: E.LINETYPE.PAR_END }), this.$ = p[x - 1];
93
+ break;
94
+ case 40:
95
+ p[x - 1].unshift({ type: "criticalStart", criticalText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.CRITICAL_START }), p[x - 1].push({ type: "criticalEnd", signalType: E.LINETYPE.CRITICAL_END }), this.$ = p[x - 1];
96
+ break;
97
+ case 41:
98
+ p[x - 1].unshift({ type: "breakStart", breakText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.BREAK_START }), p[x - 1].push({ type: "breakEnd", optText: E.parseMessage(p[x - 2]), signalType: E.LINETYPE.BREAK_END }), this.$ = p[x - 1];
99
+ break;
100
+ case 43:
101
+ this.$ = p[x - 3].concat([{ type: "option", optionText: E.parseMessage(p[x - 1]), signalType: E.LINETYPE.CRITICAL_OPTION }, p[x]]);
102
+ break;
103
+ case 45:
104
+ this.$ = p[x - 3].concat([{ type: "and", parText: E.parseMessage(p[x - 1]), signalType: E.LINETYPE.PAR_AND }, p[x]]);
105
+ break;
106
+ case 47:
107
+ this.$ = p[x - 3].concat([{ type: "else", altText: E.parseMessage(p[x - 1]), signalType: E.LINETYPE.ALT_ELSE }, p[x]]);
108
+ break;
109
+ case 48:
110
+ p[x - 3].draw = "participant", p[x - 3].type = "addParticipant", p[x - 3].description = E.parseMessage(p[x - 1]), this.$ = p[x - 3];
111
+ break;
112
+ case 49:
113
+ p[x - 1].draw = "participant", p[x - 1].type = "addParticipant", this.$ = p[x - 1];
114
+ break;
115
+ case 50:
116
+ p[x - 3].draw = "actor", p[x - 3].type = "addParticipant", p[x - 3].description = E.parseMessage(p[x - 1]), this.$ = p[x - 3];
117
+ break;
118
+ case 51:
119
+ p[x - 1].draw = "actor", p[x - 1].type = "addParticipant", this.$ = p[x - 1];
120
+ break;
121
+ case 52:
122
+ p[x - 1].type = "destroyParticipant", this.$ = p[x - 1];
123
+ break;
124
+ case 53:
125
+ p[x - 1].draw = "participant", p[x - 1].type = "addParticipant", this.$ = p[x - 1];
126
+ break;
127
+ case 54:
128
+ this.$ = [p[x - 1], { type: "addNote", placement: p[x - 2], actor: p[x - 1].actor, text: p[x] }];
129
+ break;
130
+ case 55:
131
+ p[x - 2] = [].concat(p[x - 1], p[x - 1]).slice(0, 2), p[x - 2][0] = p[x - 2][0].actor, p[x - 2][1] = p[x - 2][1].actor, this.$ = [p[x - 1], { type: "addNote", placement: E.PLACEMENT.OVER, actor: p[x - 2].slice(0, 2), text: p[x] }];
132
+ break;
133
+ case 56:
134
+ this.$ = [p[x - 1], { type: "addLinks", actor: p[x - 1].actor, text: p[x] }];
135
+ break;
136
+ case 57:
137
+ this.$ = [p[x - 1], { type: "addALink", actor: p[x - 1].actor, text: p[x] }];
138
+ break;
139
+ case 58:
140
+ this.$ = [p[x - 1], { type: "addProperties", actor: p[x - 1].actor, text: p[x] }];
141
+ break;
142
+ case 59:
143
+ this.$ = [p[x - 1], { type: "addDetails", actor: p[x - 1].actor, text: p[x] }];
144
+ break;
145
+ case 62:
146
+ this.$ = [p[x - 2], p[x]];
147
+ break;
148
+ case 63:
149
+ this.$ = p[x];
150
+ break;
151
+ case 64:
152
+ this.$ = E.PLACEMENT.LEFTOF;
153
+ break;
154
+ case 65:
155
+ this.$ = E.PLACEMENT.RIGHTOF;
156
+ break;
157
+ case 66:
158
+ this.$ = [
159
+ p[x - 4],
160
+ p[x - 1],
161
+ { type: "addMessage", from: p[x - 4].actor, to: p[x - 1].actor, signalType: p[x - 3], msg: p[x], activate: !0 },
162
+ { type: "activeStart", signalType: E.LINETYPE.ACTIVE_START, actor: p[x - 1].actor }
163
+ ];
164
+ break;
165
+ case 67:
166
+ this.$ = [
167
+ p[x - 4],
168
+ p[x - 1],
169
+ { type: "addMessage", from: p[x - 4].actor, to: p[x - 1].actor, signalType: p[x - 3], msg: p[x] },
170
+ { type: "activeEnd", signalType: E.LINETYPE.ACTIVE_END, actor: p[x - 4].actor }
171
+ ];
172
+ break;
173
+ case 68:
174
+ this.$ = [p[x - 3], p[x - 1], { type: "addMessage", from: p[x - 3].actor, to: p[x - 1].actor, signalType: p[x - 2], msg: p[x] }];
175
+ break;
176
+ case 69:
177
+ this.$ = {
178
+ type: "addParticipant",
179
+ actor: p[x - 1],
180
+ config: p[x]
181
+ };
182
+ break;
183
+ case 70:
184
+ this.$ = p[x - 1].trim();
185
+ break;
186
+ case 71:
187
+ this.$ = { type: "addParticipant", actor: p[x] };
188
+ break;
189
+ case 72:
190
+ this.$ = E.LINETYPE.SOLID_OPEN;
191
+ break;
192
+ case 73:
193
+ this.$ = E.LINETYPE.DOTTED_OPEN;
194
+ break;
195
+ case 74:
196
+ this.$ = E.LINETYPE.SOLID;
197
+ break;
198
+ case 75:
199
+ this.$ = E.LINETYPE.BIDIRECTIONAL_SOLID;
200
+ break;
201
+ case 76:
202
+ this.$ = E.LINETYPE.DOTTED;
203
+ break;
204
+ case 77:
205
+ this.$ = E.LINETYPE.BIDIRECTIONAL_DOTTED;
206
+ break;
207
+ case 78:
208
+ this.$ = E.LINETYPE.SOLID_CROSS;
209
+ break;
210
+ case 79:
211
+ this.$ = E.LINETYPE.DOTTED_CROSS;
212
+ break;
213
+ case 80:
214
+ this.$ = E.LINETYPE.SOLID_POINT;
215
+ break;
216
+ case 81:
217
+ this.$ = E.LINETYPE.DOTTED_POINT;
218
+ break;
219
+ case 82:
220
+ this.$ = E.parseMessage(p[x].trim().substring(1));
221
+ break;
222
+ }
223
+ }, "anonymous"),
224
+ table: [{ 3: 1, 4: t, 5: o, 6: a }, { 1: [3] }, { 3: 5, 4: t, 5: o, 6: a }, { 3: 6, 4: t, 5: o, 6: a }, e([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: g, 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, e(T, [2, 5]), { 9: 47, 12: 12, 13: h, 14: g, 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, e(T, [2, 7]), e(T, [2, 8]), e(T, [2, 14]), { 12: 48, 50: z, 52: H, 53: F }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 71: D }, { 22: 55, 71: D }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, e(T, [2, 29]), e(T, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, e(T, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 54: 72, 71: [1, 73] }, { 22: 74, 71: D }, { 22: 75, 71: D }, { 68: 76, 76: [1, 77], 77: [1, 78], 78: [1, 79], 79: [1, 80], 80: [1, 81], 81: [1, 82], 82: [1, 83], 83: [1, 84], 84: [1, 85], 85: [1, 86] }, { 56: 87, 58: [1, 88], 66: [1, 89], 67: [1, 90] }, { 22: 91, 71: D }, { 22: 92, 71: D }, { 22: 93, 71: D }, { 22: 94, 71: D }, e([5, 51, 65, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86], v), e(T, [2, 6]), e(T, [2, 15]), e(U, [2, 9], { 10: 95 }), e(T, [2, 17]), { 5: [1, 97], 19: [1, 96] }, { 5: [1, 98] }, e(T, [2, 21]), { 5: [1, 99] }, { 5: [1, 100] }, e(T, [2, 24]), e(T, [2, 25]), e(T, [2, 26]), e(T, [2, 27]), e(T, [2, 28]), e(T, [2, 31]), e(T, [2, 32]), e(tt, r, { 7: 101 }), e(tt, r, { 7: 102 }), e(tt, r, { 7: 103 }), e(S, r, { 40: 104, 7: 105 }), e(Rt, r, { 42: 106, 7: 107 }), e(Rt, r, { 7: 107, 42: 108 }), e(Xt, r, { 45: 109, 7: 110 }), e(tt, r, { 7: 111 }), { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, e([5, 51], v, { 72: 115, 73: [1, 116] }), { 5: [1, 118], 51: [1, 117] }, { 5: [1, 119] }, { 22: 122, 69: [1, 120], 70: [1, 121], 71: D }, e(nt, [2, 72]), e(nt, [2, 73]), e(nt, [2, 74]), e(nt, [2, 75]), e(nt, [2, 76]), e(nt, [2, 77]), e(nt, [2, 78]), e(nt, [2, 79]), e(nt, [2, 80]), e(nt, [2, 81]), { 22: 123, 71: D }, { 22: 125, 59: 124, 71: D }, { 71: [2, 64] }, { 71: [2, 65] }, { 57: 126, 86: ht }, { 57: 128, 86: ht }, { 57: 129, 86: ht }, { 57: 130, 86: ht }, { 4: [1, 133], 5: [1, 135], 11: 132, 12: 134, 16: [1, 131], 50: z, 52: H, 53: F }, { 5: [1, 136] }, e(T, [2, 19]), e(T, [2, 20]), e(T, [2, 22]), e(T, [2, 23]), { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: g, 16: [1, 137], 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: g, 16: [1, 138], 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: g, 16: [1, 139], 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, { 16: [1, 140] }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: g, 16: [2, 46], 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 49: [1, 141], 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, { 16: [1, 142] }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: g, 16: [2, 44], 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 48: [1, 143], 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, { 16: [1, 144] }, { 16: [1, 145] }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: g, 16: [2, 42], 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 47: [1, 146], 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: g, 16: [1, 147], 17: 15, 18: i, 21: d, 22: 40, 23: n, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: b, 31: m, 33: w, 35: P, 36: A, 37: N, 38: M, 39: $, 41: B, 43: q, 44: Z, 46: rt, 50: z, 52: H, 53: F, 55: R, 60: Q, 61: j, 62: J, 63: st, 71: D }, { 15: [1, 148] }, e(T, [2, 49]), e(T, [2, 53]), { 5: [2, 69] }, { 74: [1, 149] }, { 15: [1, 150] }, e(T, [2, 51]), e(T, [2, 52]), { 22: 151, 71: D }, { 22: 152, 71: D }, { 57: 153, 86: ht }, { 57: 154, 86: ht }, { 57: 155, 86: ht }, { 65: [1, 156], 86: [2, 63] }, { 5: [2, 56] }, { 5: [2, 82] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [2, 59] }, e(T, [2, 16]), e(U, [2, 10]), { 12: 157, 50: z, 52: H, 53: F }, e(U, [2, 12]), e(U, [2, 13]), e(T, [2, 18]), e(T, [2, 34]), e(T, [2, 35]), e(T, [2, 36]), e(T, [2, 37]), { 15: [1, 158] }, e(T, [2, 38]), { 15: [1, 159] }, e(T, [2, 39]), e(T, [2, 40]), { 15: [1, 160] }, e(T, [2, 41]), { 5: [1, 161] }, { 75: [1, 162] }, { 5: [1, 163] }, { 57: 164, 86: ht }, { 57: 165, 86: ht }, { 5: [2, 68] }, { 5: [2, 54] }, { 5: [2, 55] }, { 22: 166, 71: D }, e(U, [2, 11]), e(S, r, { 7: 105, 40: 167 }), e(Rt, r, { 7: 107, 42: 168 }), e(Xt, r, { 7: 110, 45: 169 }), e(T, [2, 48]), { 5: [2, 70] }, e(T, [2, 50]), { 5: [2, 66] }, { 5: [2, 67] }, { 86: [2, 62] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
225
+ defaultActions: { 5: [2, 1], 6: [2, 2], 89: [2, 64], 90: [2, 65], 115: [2, 69], 126: [2, 56], 127: [2, 82], 128: [2, 57], 129: [2, 58], 130: [2, 59], 153: [2, 68], 154: [2, 54], 155: [2, 55], 162: [2, 70], 164: [2, 66], 165: [2, 67], 166: [2, 62], 167: [2, 47], 168: [2, 45], 169: [2, 43] },
226
+ parseError: /* @__PURE__ */ y(function(ct, I) {
227
+ if (I.recoverable)
228
+ this.trace(ct);
229
+ else {
230
+ var k = new Error(ct);
231
+ throw k.hash = I, k;
232
+ }
233
+ }, "parseError"),
234
+ parse: /* @__PURE__ */ y(function(ct) {
235
+ var I = this, k = [0], E = [], O = [null], p = [], G = this.table, x = "", vt = 0, Zt = 0, be = 2, Qt = 1, fe = p.slice.call(arguments, 1), Y = Object.create(this.lexer), yt = { yy: {} };
236
+ for (var Bt in this.yy)
237
+ Object.prototype.hasOwnProperty.call(this.yy, Bt) && (yt.yy[Bt] = this.yy[Bt]);
238
+ Y.setInput(ct, yt.yy), yt.yy.lexer = Y, yt.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
239
+ var Yt = Y.yylloc;
240
+ p.push(Yt);
241
+ var me = Y.options && Y.options.ranges;
242
+ typeof yt.yy.parseError == "function" ? this.parseError = yt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
243
+ function Te(et) {
244
+ k.length = k.length - 2 * et, O.length = O.length - et, p.length = p.length - et;
245
+ }
246
+ y(Te, "popStack");
247
+ function Jt() {
248
+ var et;
249
+ return et = E.pop() || Y.lex() || Qt, typeof et != "number" && (et instanceof Array && (E = et, et = E.pop()), et = I.symbols_[et] || et), et;
250
+ }
251
+ y(Jt, "lex");
252
+ for (var K, bt, it, Vt, Tt = {}, Pt, dt, te, _t; ; ) {
253
+ if (bt = k[k.length - 1], this.defaultActions[bt] ? it = this.defaultActions[bt] : ((K === null || typeof K > "u") && (K = Jt()), it = G[bt] && G[bt][K]), typeof it > "u" || !it.length || !it[0]) {
254
+ var Ft = "";
255
+ _t = [];
256
+ for (Pt in G[bt])
257
+ this.terminals_[Pt] && Pt > be && _t.push("'" + this.terminals_[Pt] + "'");
258
+ Y.showPosition ? Ft = "Parse error on line " + (vt + 1) + `:
259
+ ` + Y.showPosition() + `
260
+ Expecting ` + _t.join(", ") + ", got '" + (this.terminals_[K] || K) + "'" : Ft = "Parse error on line " + (vt + 1) + ": Unexpected " + (K == Qt ? "end of input" : "'" + (this.terminals_[K] || K) + "'"), this.parseError(Ft, {
261
+ text: Y.match,
262
+ token: this.terminals_[K] || K,
263
+ line: Y.yylineno,
264
+ loc: Yt,
265
+ expected: _t
266
+ });
267
+ }
268
+ if (it[0] instanceof Array && it.length > 1)
269
+ throw new Error("Parse Error: multiple actions possible at state: " + bt + ", token: " + K);
270
+ switch (it[0]) {
271
+ case 1:
272
+ k.push(K), O.push(Y.yytext), p.push(Y.yylloc), k.push(it[1]), K = null, Zt = Y.yyleng, x = Y.yytext, vt = Y.yylineno, Yt = Y.yylloc;
273
+ break;
274
+ case 2:
275
+ if (dt = this.productions_[it[1]][1], Tt.$ = O[O.length - dt], Tt._$ = {
276
+ first_line: p[p.length - (dt || 1)].first_line,
277
+ last_line: p[p.length - 1].last_line,
278
+ first_column: p[p.length - (dt || 1)].first_column,
279
+ last_column: p[p.length - 1].last_column
280
+ }, me && (Tt._$.range = [
281
+ p[p.length - (dt || 1)].range[0],
282
+ p[p.length - 1].range[1]
283
+ ]), Vt = this.performAction.apply(Tt, [
284
+ x,
285
+ Zt,
286
+ vt,
287
+ yt.yy,
288
+ it[1],
289
+ O,
290
+ p
291
+ ].concat(fe)), typeof Vt < "u")
292
+ return Vt;
293
+ dt && (k = k.slice(0, -1 * dt * 2), O = O.slice(0, -1 * dt), p = p.slice(0, -1 * dt)), k.push(this.productions_[it[1]][0]), O.push(Tt.$), p.push(Tt._$), te = G[k[k.length - 2]][k[k.length - 1]], k.push(te);
294
+ break;
295
+ case 3:
296
+ return !0;
297
+ }
298
+ }
299
+ return !0;
300
+ }, "parse")
301
+ }, ye = /* @__PURE__ */ function() {
302
+ var ct = {
303
+ EOF: 1,
304
+ parseError: /* @__PURE__ */ y(function(I, k) {
305
+ if (this.yy.parser)
306
+ this.yy.parser.parseError(I, k);
307
+ else
308
+ throw new Error(I);
309
+ }, "parseError"),
310
+ // resets the lexer, sets new input
311
+ setInput: /* @__PURE__ */ y(function(I, k) {
312
+ return this.yy = k || this.yy || {}, this._input = I, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
313
+ first_line: 1,
314
+ first_column: 0,
315
+ last_line: 1,
316
+ last_column: 0
317
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
318
+ }, "setInput"),
319
+ // consumes and returns one char from the input
320
+ input: /* @__PURE__ */ y(function() {
321
+ var I = this._input[0];
322
+ this.yytext += I, this.yyleng++, this.offset++, this.match += I, this.matched += I;
323
+ var k = I.match(/(?:\r\n?|\n).*/g);
324
+ return k ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), I;
325
+ }, "input"),
326
+ // unshifts one char (or a string) into the input
327
+ unput: /* @__PURE__ */ y(function(I) {
328
+ var k = I.length, E = I.split(/(?:\r\n?|\n)/g);
329
+ this._input = I + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - k), this.offset -= k;
330
+ var O = this.match.split(/(?:\r\n?|\n)/g);
331
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), E.length - 1 && (this.yylineno -= E.length - 1);
332
+ var p = this.yylloc.range;
333
+ return this.yylloc = {
334
+ first_line: this.yylloc.first_line,
335
+ last_line: this.yylineno + 1,
336
+ first_column: this.yylloc.first_column,
337
+ last_column: E ? (E.length === O.length ? this.yylloc.first_column : 0) + O[O.length - E.length].length - E[0].length : this.yylloc.first_column - k
338
+ }, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - k]), this.yyleng = this.yytext.length, this;
339
+ }, "unput"),
340
+ // When called from action, caches matched text and appends it on next action
341
+ more: /* @__PURE__ */ y(function() {
342
+ return this._more = !0, this;
343
+ }, "more"),
344
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
345
+ reject: /* @__PURE__ */ y(function() {
346
+ if (this.options.backtrack_lexer)
347
+ this._backtrack = !0;
348
+ else
349
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
350
+ ` + this.showPosition(), {
351
+ text: "",
352
+ token: null,
353
+ line: this.yylineno
354
+ });
355
+ return this;
356
+ }, "reject"),
357
+ // retain first n characters of the match
358
+ less: /* @__PURE__ */ y(function(I) {
359
+ this.unput(this.match.slice(I));
360
+ }, "less"),
361
+ // displays already matched input, i.e. for error messages
362
+ pastInput: /* @__PURE__ */ y(function() {
363
+ var I = this.matched.substr(0, this.matched.length - this.match.length);
364
+ return (I.length > 20 ? "..." : "") + I.substr(-20).replace(/\n/g, "");
365
+ }, "pastInput"),
366
+ // displays upcoming input, i.e. for error messages
367
+ upcomingInput: /* @__PURE__ */ y(function() {
368
+ var I = this.match;
369
+ return I.length < 20 && (I += this._input.substr(0, 20 - I.length)), (I.substr(0, 20) + (I.length > 20 ? "..." : "")).replace(/\n/g, "");
370
+ }, "upcomingInput"),
371
+ // displays the character position where the lexing error occurred, i.e. for error messages
372
+ showPosition: /* @__PURE__ */ y(function() {
373
+ var I = this.pastInput(), k = new Array(I.length + 1).join("-");
374
+ return I + this.upcomingInput() + `
375
+ ` + k + "^";
376
+ }, "showPosition"),
377
+ // test the lexed token: return FALSE when not a match, otherwise return token
378
+ test_match: /* @__PURE__ */ y(function(I, k) {
379
+ var E, O, p;
380
+ if (this.options.backtrack_lexer && (p = {
381
+ yylineno: this.yylineno,
382
+ yylloc: {
383
+ first_line: this.yylloc.first_line,
384
+ last_line: this.last_line,
385
+ first_column: this.yylloc.first_column,
386
+ last_column: this.yylloc.last_column
387
+ },
388
+ yytext: this.yytext,
389
+ match: this.match,
390
+ matches: this.matches,
391
+ matched: this.matched,
392
+ yyleng: this.yyleng,
393
+ offset: this.offset,
394
+ _more: this._more,
395
+ _input: this._input,
396
+ yy: this.yy,
397
+ conditionStack: this.conditionStack.slice(0),
398
+ done: this.done
399
+ }, this.options.ranges && (p.yylloc.range = this.yylloc.range.slice(0))), O = I[0].match(/(?:\r\n?|\n).*/g), O && (this.yylineno += O.length), this.yylloc = {
400
+ first_line: this.yylloc.last_line,
401
+ last_line: this.yylineno + 1,
402
+ first_column: this.yylloc.last_column,
403
+ last_column: O ? O[O.length - 1].length - O[O.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + I[0].length
404
+ }, this.yytext += I[0], this.match += I[0], this.matches = I, 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(I[0].length), this.matched += I[0], E = this.performAction.call(this, this.yy, this, k, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), E)
405
+ return E;
406
+ if (this._backtrack) {
407
+ for (var G in p)
408
+ this[G] = p[G];
409
+ return !1;
410
+ }
411
+ return !1;
412
+ }, "test_match"),
413
+ // return next match in input
414
+ next: /* @__PURE__ */ y(function() {
415
+ if (this.done)
416
+ return this.EOF;
417
+ this._input || (this.done = !0);
418
+ var I, k, E, O;
419
+ this._more || (this.yytext = "", this.match = "");
420
+ for (var p = this._currentRules(), G = 0; G < p.length; G++)
421
+ if (E = this._input.match(this.rules[p[G]]), E && (!k || E[0].length > k[0].length)) {
422
+ if (k = E, O = G, this.options.backtrack_lexer) {
423
+ if (I = this.test_match(E, p[G]), I !== !1)
424
+ return I;
425
+ if (this._backtrack) {
426
+ k = !1;
427
+ continue;
428
+ } else
429
+ return !1;
430
+ } else if (!this.options.flex)
431
+ break;
432
+ }
433
+ return k ? (I = this.test_match(k, p[O]), I !== !1 ? I : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
434
+ ` + this.showPosition(), {
435
+ text: "",
436
+ token: null,
437
+ line: this.yylineno
438
+ });
439
+ }, "next"),
440
+ // return next match that has a token
441
+ lex: /* @__PURE__ */ y(function() {
442
+ var I = this.next();
443
+ return I || this.lex();
444
+ }, "lex"),
445
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
446
+ begin: /* @__PURE__ */ y(function(I) {
447
+ this.conditionStack.push(I);
448
+ }, "begin"),
449
+ // pop the previously active lexer condition state off the condition stack
450
+ popState: /* @__PURE__ */ y(function() {
451
+ var I = this.conditionStack.length - 1;
452
+ return I > 0 ? this.conditionStack.pop() : this.conditionStack[0];
453
+ }, "popState"),
454
+ // produce the lexer rule set which is active for the currently active lexer condition state
455
+ _currentRules: /* @__PURE__ */ y(function() {
456
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
457
+ }, "_currentRules"),
458
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
459
+ topState: /* @__PURE__ */ y(function(I) {
460
+ return I = this.conditionStack.length - 1 - Math.abs(I || 0), I >= 0 ? this.conditionStack[I] : "INITIAL";
461
+ }, "topState"),
462
+ // alias for begin(condition)
463
+ pushState: /* @__PURE__ */ y(function(I) {
464
+ this.begin(I);
465
+ }, "pushState"),
466
+ // return the number of states currently on the stack
467
+ stateStackSize: /* @__PURE__ */ y(function() {
468
+ return this.conditionStack.length;
469
+ }, "stateStackSize"),
470
+ options: { "case-insensitive": !0 },
471
+ performAction: /* @__PURE__ */ y(function(I, k, E, O) {
472
+ switch (E) {
473
+ case 0:
474
+ return 5;
475
+ case 1:
476
+ break;
477
+ case 2:
478
+ break;
479
+ case 3:
480
+ break;
481
+ case 4:
482
+ break;
483
+ case 5:
484
+ break;
485
+ case 6:
486
+ return 19;
487
+ case 7:
488
+ return this.begin("CONFIG"), 73;
489
+ case 8:
490
+ return 74;
491
+ case 9:
492
+ return this.popState(), this.popState(), 75;
493
+ case 10:
494
+ return k.yytext = k.yytext.trim(), 71;
495
+ case 11:
496
+ return k.yytext = k.yytext.trim(), this.begin("ALIAS"), 71;
497
+ case 12:
498
+ return this.begin("LINE"), 14;
499
+ case 13:
500
+ return this.begin("ID"), 50;
501
+ case 14:
502
+ return this.begin("ID"), 52;
503
+ case 15:
504
+ return 13;
505
+ case 16:
506
+ return this.begin("ID"), 53;
507
+ case 17:
508
+ return k.yytext = k.yytext.trim(), this.begin("ALIAS"), 71;
509
+ case 18:
510
+ return this.popState(), this.popState(), this.begin("LINE"), 51;
511
+ case 19:
512
+ return this.popState(), this.popState(), 5;
513
+ case 20:
514
+ return this.begin("LINE"), 36;
515
+ case 21:
516
+ return this.begin("LINE"), 37;
517
+ case 22:
518
+ return this.begin("LINE"), 38;
519
+ case 23:
520
+ return this.begin("LINE"), 39;
521
+ case 24:
522
+ return this.begin("LINE"), 49;
523
+ case 25:
524
+ return this.begin("LINE"), 41;
525
+ case 26:
526
+ return this.begin("LINE"), 43;
527
+ case 27:
528
+ return this.begin("LINE"), 48;
529
+ case 28:
530
+ return this.begin("LINE"), 44;
531
+ case 29:
532
+ return this.begin("LINE"), 47;
533
+ case 30:
534
+ return this.begin("LINE"), 46;
535
+ case 31:
536
+ return this.popState(), 15;
537
+ case 32:
538
+ return 16;
539
+ case 33:
540
+ return 66;
541
+ case 34:
542
+ return 67;
543
+ case 35:
544
+ return 60;
545
+ case 36:
546
+ return 61;
547
+ case 37:
548
+ return 62;
549
+ case 38:
550
+ return 63;
551
+ case 39:
552
+ return 58;
553
+ case 40:
554
+ return 55;
555
+ case 41:
556
+ return this.begin("ID"), 21;
557
+ case 42:
558
+ return this.begin("ID"), 23;
559
+ case 43:
560
+ return 29;
561
+ case 44:
562
+ return 30;
563
+ case 45:
564
+ return this.begin("acc_title"), 31;
565
+ case 46:
566
+ return this.popState(), "acc_title_value";
567
+ case 47:
568
+ return this.begin("acc_descr"), 33;
569
+ case 48:
570
+ return this.popState(), "acc_descr_value";
571
+ case 49:
572
+ this.begin("acc_descr_multiline");
573
+ break;
574
+ case 50:
575
+ this.popState();
576
+ break;
577
+ case 51:
578
+ return "acc_descr_multiline_value";
579
+ case 52:
580
+ return 6;
581
+ case 53:
582
+ return 18;
583
+ case 54:
584
+ return 20;
585
+ case 55:
586
+ return 65;
587
+ case 56:
588
+ return 5;
589
+ case 57:
590
+ return k.yytext = k.yytext.trim(), 71;
591
+ case 58:
592
+ return 78;
593
+ case 59:
594
+ return 79;
595
+ case 60:
596
+ return 80;
597
+ case 61:
598
+ return 81;
599
+ case 62:
600
+ return 76;
601
+ case 63:
602
+ return 77;
603
+ case 64:
604
+ return 82;
605
+ case 65:
606
+ return 83;
607
+ case 66:
608
+ return 84;
609
+ case 67:
610
+ return 85;
611
+ case 68:
612
+ return 86;
613
+ case 69:
614
+ return 86;
615
+ case 70:
616
+ return 69;
617
+ case 71:
618
+ return 70;
619
+ case 72:
620
+ return 5;
621
+ case 73:
622
+ return "INVALID";
623
+ }
624
+ }, "anonymous"),
625
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\})/i, /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i, /^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:<<->>)/i, /^(?:-->>)/i, /^(?:<<-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
626
+ conditions: { acc_descr_multiline: { rules: [50, 51], inclusive: !1 }, acc_descr: { rules: [48], inclusive: !1 }, acc_title: { rules: [46], inclusive: !1 }, ID: { rules: [2, 3, 7, 10, 11, 17], inclusive: !1 }, ALIAS: { rules: [2, 3, 18, 19], inclusive: !1 }, LINE: { rules: [2, 3, 31], inclusive: !1 }, CONFIG: { rules: [8, 9], inclusive: !1 }, CONFIG_DATA: { rules: [], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], inclusive: !0 } }
627
+ };
628
+ return ct;
629
+ }();
630
+ Ct.lexer = ye;
631
+ function Lt() {
632
+ this.yy = {};
633
+ }
634
+ return y(Lt, "Parser"), Lt.prototype = Ct, Ct.Parser = Lt, new Lt();
635
+ }();
636
+ zt.parser = zt;
637
+ var Ce = zt, Be = {
638
+ SOLID: 0,
639
+ DOTTED: 1,
640
+ NOTE: 2,
641
+ SOLID_CROSS: 3,
642
+ DOTTED_CROSS: 4,
643
+ SOLID_OPEN: 5,
644
+ DOTTED_OPEN: 6,
645
+ LOOP_START: 10,
646
+ LOOP_END: 11,
647
+ ALT_START: 12,
648
+ ALT_ELSE: 13,
649
+ ALT_END: 14,
650
+ OPT_START: 15,
651
+ OPT_END: 16,
652
+ ACTIVE_START: 17,
653
+ ACTIVE_END: 18,
654
+ PAR_START: 19,
655
+ PAR_AND: 20,
656
+ PAR_END: 21,
657
+ RECT_START: 22,
658
+ RECT_END: 23,
659
+ SOLID_POINT: 24,
660
+ DOTTED_POINT: 25,
661
+ AUTONUMBER: 26,
662
+ CRITICAL_START: 27,
663
+ CRITICAL_OPTION: 28,
664
+ CRITICAL_END: 29,
665
+ BREAK_START: 30,
666
+ BREAK_END: 31,
667
+ PAR_OVER_START: 32,
668
+ BIDIRECTIONAL_SOLID: 33,
669
+ BIDIRECTIONAL_DOTTED: 34
670
+ }, Ye = {
671
+ FILLED: 0,
672
+ OPEN: 1
673
+ }, Ve = {
674
+ LEFTOF: 0,
675
+ RIGHTOF: 1,
676
+ OVER: 2
677
+ }, Mt = {
678
+ ACTOR: "actor",
679
+ CONTROL: "control",
680
+ DATABASE: "database",
681
+ ENTITY: "entity"
682
+ }, Wt, Fe = (Wt = class {
683
+ constructor() {
684
+ this.state = new Re(() => ({
685
+ prevActor: void 0,
686
+ actors: /* @__PURE__ */ new Map(),
687
+ createdActors: /* @__PURE__ */ new Map(),
688
+ destroyedActors: /* @__PURE__ */ new Map(),
689
+ boxes: [],
690
+ messages: [],
691
+ notes: [],
692
+ sequenceNumbersEnabled: !1,
693
+ wrapEnabled: void 0,
694
+ currentBox: void 0,
695
+ lastCreated: void 0,
696
+ lastDestroyed: void 0
697
+ })), this.setAccTitle = ee, this.setAccDescription = ve, this.setDiagramTitle = Pe, this.getAccTitle = _e, this.getAccDescription = Ae, this.getDiagramTitle = Ne, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(at().wrap), this.LINETYPE = Be, this.ARROWTYPE = Ye, this.PLACEMENT = Ve;
698
+ }
699
+ addBox(e) {
700
+ this.state.records.boxes.push({
701
+ name: e.text,
702
+ wrap: e.wrap ?? this.autoWrap(),
703
+ fill: e.color,
704
+ actorKeys: []
705
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
706
+ }
707
+ addActor(e, t, o, a, r) {
708
+ let s = this.state.records.currentBox, c;
709
+ if (r !== void 0) {
710
+ let g;
711
+ r.includes(`
712
+ `) ? g = r + `
713
+ ` : g = `{
714
+ ` + r + `
715
+ }`, c = Me(g, { schema: Oe });
716
+ }
717
+ a = (c == null ? void 0 : c.type) ?? a;
718
+ const h = this.state.records.actors.get(e);
719
+ if (h) {
720
+ if (this.state.records.currentBox && h.box && this.state.records.currentBox !== h.box)
721
+ throw new Error(
722
+ `A same participant should only be defined in one Box: ${h.name} can't be in '${h.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
723
+ );
724
+ if (s = h.box ? h.box : this.state.records.currentBox, h.box = s, h && t === h.name && o == null)
725
+ return;
726
+ }
727
+ if ((o == null ? void 0 : o.text) == null && (o = { text: t, type: a }), (a == null || o.text == null) && (o = { text: t, type: a }), this.state.records.actors.set(e, {
728
+ box: s,
729
+ name: t,
730
+ description: o.text,
731
+ wrap: o.wrap ?? this.autoWrap(),
732
+ prevActor: this.state.records.prevActor,
733
+ links: {},
734
+ properties: {},
735
+ actorCnt: null,
736
+ rectData: null,
737
+ type: a ?? "participant"
738
+ }), this.state.records.prevActor) {
739
+ const g = this.state.records.actors.get(this.state.records.prevActor);
740
+ g && (g.nextActor = e);
741
+ }
742
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(e), this.state.records.prevActor = e;
743
+ }
744
+ activationCount(e) {
745
+ let t, o = 0;
746
+ if (!e)
747
+ return 0;
748
+ for (t = 0; t < this.state.records.messages.length; t++)
749
+ this.state.records.messages[t].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[t].from === e && o++, this.state.records.messages[t].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[t].from === e && o--;
750
+ return o;
751
+ }
752
+ addMessage(e, t, o, a) {
753
+ this.state.records.messages.push({
754
+ id: this.state.records.messages.length.toString(),
755
+ from: e,
756
+ to: t,
757
+ message: o.text,
758
+ wrap: o.wrap ?? this.autoWrap(),
759
+ answer: a
760
+ });
761
+ }
762
+ addSignal(e, t, o, a, r = !1) {
763
+ if (a === this.LINETYPE.ACTIVE_END && this.activationCount(e ?? "") < 1) {
764
+ const s = new Error("Trying to inactivate an inactive participant (" + e + ")");
765
+ throw s.hash = {
766
+ text: "->>-",
767
+ token: "->>-",
768
+ line: "1",
769
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
770
+ expected: ["'ACTIVE_PARTICIPANT'"]
771
+ }, s;
772
+ }
773
+ return this.state.records.messages.push({
774
+ id: this.state.records.messages.length.toString(),
775
+ from: e,
776
+ to: t,
777
+ message: (o == null ? void 0 : o.text) ?? "",
778
+ wrap: (o == null ? void 0 : o.wrap) ?? this.autoWrap(),
779
+ type: a,
780
+ activate: r
781
+ }), !0;
782
+ }
783
+ hasAtLeastOneBox() {
784
+ return this.state.records.boxes.length > 0;
785
+ }
786
+ hasAtLeastOneBoxWithTitle() {
787
+ return this.state.records.boxes.some((e) => e.name);
788
+ }
789
+ getMessages() {
790
+ return this.state.records.messages;
791
+ }
792
+ getBoxes() {
793
+ return this.state.records.boxes;
794
+ }
795
+ getActors() {
796
+ return this.state.records.actors;
797
+ }
798
+ getCreatedActors() {
799
+ return this.state.records.createdActors;
800
+ }
801
+ getDestroyedActors() {
802
+ return this.state.records.destroyedActors;
803
+ }
804
+ getActor(e) {
805
+ return this.state.records.actors.get(e);
806
+ }
807
+ getActorKeys() {
808
+ return [...this.state.records.actors.keys()];
809
+ }
810
+ enableSequenceNumbers() {
811
+ this.state.records.sequenceNumbersEnabled = !0;
812
+ }
813
+ disableSequenceNumbers() {
814
+ this.state.records.sequenceNumbersEnabled = !1;
815
+ }
816
+ showSequenceNumbers() {
817
+ return this.state.records.sequenceNumbersEnabled;
818
+ }
819
+ setWrap(e) {
820
+ this.state.records.wrapEnabled = e;
821
+ }
822
+ extractWrap(e) {
823
+ if (e === void 0)
824
+ return {};
825
+ e = e.trim();
826
+ const t = /^:?wrap:/.exec(e) !== null ? !0 : /^:?nowrap:/.exec(e) !== null ? !1 : void 0;
827
+ return { cleanedText: (t === void 0 ? e : e.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: t };
828
+ }
829
+ autoWrap() {
830
+ var e;
831
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : ((e = at().sequence) == null ? void 0 : e.wrap) ?? !1;
832
+ }
833
+ clear() {
834
+ this.state.reset(), Se();
835
+ }
836
+ parseMessage(e) {
837
+ const t = e.trim(), { wrap: o, cleanedText: a } = this.extractWrap(t), r = {
838
+ text: a,
839
+ wrap: o
840
+ };
841
+ return X.debug(`parseMessage: ${JSON.stringify(r)}`), r;
842
+ }
843
+ // We expect the box statement to be color first then description
844
+ // The color can be rgb,rgba,hsl,hsla, or css code names #hex codes are not supported for now because of the way the char # is handled
845
+ // We extract first segment as color, the rest of the line is considered as text
846
+ parseBoxData(e) {
847
+ const t = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);
848
+ let o = t != null && t[1] ? t[1].trim() : "transparent", a = t != null && t[2] ? t[2].trim() : void 0;
849
+ if (window != null && window.CSS)
850
+ window.CSS.supports("color", o) || (o = "transparent", a = e.trim());
851
+ else {
852
+ const c = new Option().style;
853
+ c.color = o, c.color !== o && (o = "transparent", a = e.trim());
854
+ }
855
+ const { wrap: r, cleanedText: s } = this.extractWrap(a);
856
+ return {
857
+ text: s ? Nt(s, at()) : void 0,
858
+ color: o,
859
+ wrap: r
860
+ };
861
+ }
862
+ addNote(e, t, o) {
863
+ const a = {
864
+ actor: e,
865
+ placement: t,
866
+ message: o.text,
867
+ wrap: o.wrap ?? this.autoWrap()
868
+ }, r = [].concat(e, e);
869
+ this.state.records.notes.push(a), this.state.records.messages.push({
870
+ id: this.state.records.messages.length.toString(),
871
+ from: r[0],
872
+ to: r[1],
873
+ message: o.text,
874
+ wrap: o.wrap ?? this.autoWrap(),
875
+ type: this.LINETYPE.NOTE,
876
+ placement: t
877
+ });
878
+ }
879
+ addLinks(e, t) {
880
+ const o = this.getActor(e);
881
+ try {
882
+ let a = Nt(t.text, at());
883
+ a = a.replace(/&equals;/g, "="), a = a.replace(/&amp;/g, "&");
884
+ const r = JSON.parse(a);
885
+ this.insertLinks(o, r);
886
+ } catch (a) {
887
+ X.error("error while parsing actor link text", a);
888
+ }
889
+ }
890
+ addALink(e, t) {
891
+ const o = this.getActor(e);
892
+ try {
893
+ const a = {};
894
+ let r = Nt(t.text, at());
895
+ const s = r.indexOf("@");
896
+ r = r.replace(/&equals;/g, "="), r = r.replace(/&amp;/g, "&");
897
+ const c = r.slice(0, s - 1).trim(), h = r.slice(s + 1).trim();
898
+ a[c] = h, this.insertLinks(o, a);
899
+ } catch (a) {
900
+ X.error("error while parsing actor link text", a);
901
+ }
902
+ }
903
+ insertLinks(e, t) {
904
+ if (e.links == null)
905
+ e.links = t;
906
+ else
907
+ for (const o in t)
908
+ e.links[o] = t[o];
909
+ }
910
+ addProperties(e, t) {
911
+ const o = this.getActor(e);
912
+ try {
913
+ const a = Nt(t.text, at()), r = JSON.parse(a);
914
+ this.insertProperties(o, r);
915
+ } catch (a) {
916
+ X.error("error while parsing actor properties text", a);
917
+ }
918
+ }
919
+ insertProperties(e, t) {
920
+ if (e.properties == null)
921
+ e.properties = t;
922
+ else
923
+ for (const o in t)
924
+ e.properties[o] = t[o];
925
+ }
926
+ boxEnd() {
927
+ this.state.records.currentBox = void 0;
928
+ }
929
+ addDetails(e, t) {
930
+ const o = this.getActor(e), a = document.getElementById(t.text);
931
+ try {
932
+ const r = a.innerHTML, s = JSON.parse(r);
933
+ s.properties && this.insertProperties(o, s.properties), s.links && this.insertLinks(o, s.links);
934
+ } catch (r) {
935
+ X.error("error while parsing actor details text", r);
936
+ }
937
+ }
938
+ getActorProperty(e, t) {
939
+ if ((e == null ? void 0 : e.properties) !== void 0)
940
+ return e.properties[t];
941
+ }
942
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
943
+ apply(e) {
944
+ if (Array.isArray(e))
945
+ e.forEach((t) => {
946
+ this.apply(t);
947
+ });
948
+ else
949
+ switch (e.type) {
950
+ case "sequenceIndex":
951
+ this.state.records.messages.push({
952
+ id: this.state.records.messages.length.toString(),
953
+ from: void 0,
954
+ to: void 0,
955
+ message: {
956
+ start: e.sequenceIndex,
957
+ step: e.sequenceIndexStep,
958
+ visible: e.sequenceVisible
959
+ },
960
+ wrap: !1,
961
+ type: e.signalType
962
+ });
963
+ break;
964
+ case "addParticipant":
965
+ this.addActor(e.actor, e.actor, e.description, e.draw, e.config);
966
+ break;
967
+ case "createParticipant":
968
+ if (this.state.records.actors.has(e.actor))
969
+ throw new Error(
970
+ "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior"
971
+ );
972
+ this.state.records.lastCreated = e.actor, this.addActor(e.actor, e.actor, e.description, e.draw, e.config), this.state.records.createdActors.set(e.actor, this.state.records.messages.length);
973
+ break;
974
+ case "destroyParticipant":
975
+ this.state.records.lastDestroyed = e.actor, this.state.records.destroyedActors.set(e.actor, this.state.records.messages.length);
976
+ break;
977
+ case "activeStart":
978
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
979
+ break;
980
+ case "activeEnd":
981
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
982
+ break;
983
+ case "addNote":
984
+ this.addNote(e.actor, e.placement, e.text);
985
+ break;
986
+ case "addLinks":
987
+ this.addLinks(e.actor, e.text);
988
+ break;
989
+ case "addALink":
990
+ this.addALink(e.actor, e.text);
991
+ break;
992
+ case "addProperties":
993
+ this.addProperties(e.actor, e.text);
994
+ break;
995
+ case "addDetails":
996
+ this.addDetails(e.actor, e.text);
997
+ break;
998
+ case "addMessage":
999
+ if (this.state.records.lastCreated) {
1000
+ if (e.to !== this.state.records.lastCreated)
1001
+ throw new Error(
1002
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1003
+ );
1004
+ this.state.records.lastCreated = void 0;
1005
+ } else if (this.state.records.lastDestroyed) {
1006
+ if (e.to !== this.state.records.lastDestroyed && e.from !== this.state.records.lastDestroyed)
1007
+ throw new Error(
1008
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1009
+ );
1010
+ this.state.records.lastDestroyed = void 0;
1011
+ }
1012
+ this.addSignal(e.from, e.to, e.msg, e.signalType, e.activate);
1013
+ break;
1014
+ case "boxStart":
1015
+ this.addBox(e.boxData);
1016
+ break;
1017
+ case "boxEnd":
1018
+ this.boxEnd();
1019
+ break;
1020
+ case "loopStart":
1021
+ this.addSignal(void 0, void 0, e.loopText, e.signalType);
1022
+ break;
1023
+ case "loopEnd":
1024
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1025
+ break;
1026
+ case "rectStart":
1027
+ this.addSignal(void 0, void 0, e.color, e.signalType);
1028
+ break;
1029
+ case "rectEnd":
1030
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1031
+ break;
1032
+ case "optStart":
1033
+ this.addSignal(void 0, void 0, e.optText, e.signalType);
1034
+ break;
1035
+ case "optEnd":
1036
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1037
+ break;
1038
+ case "altStart":
1039
+ this.addSignal(void 0, void 0, e.altText, e.signalType);
1040
+ break;
1041
+ case "else":
1042
+ this.addSignal(void 0, void 0, e.altText, e.signalType);
1043
+ break;
1044
+ case "altEnd":
1045
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1046
+ break;
1047
+ case "setAccTitle":
1048
+ ee(e.text);
1049
+ break;
1050
+ case "parStart":
1051
+ this.addSignal(void 0, void 0, e.parText, e.signalType);
1052
+ break;
1053
+ case "and":
1054
+ this.addSignal(void 0, void 0, e.parText, e.signalType);
1055
+ break;
1056
+ case "parEnd":
1057
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1058
+ break;
1059
+ case "criticalStart":
1060
+ this.addSignal(void 0, void 0, e.criticalText, e.signalType);
1061
+ break;
1062
+ case "option":
1063
+ this.addSignal(void 0, void 0, e.optionText, e.signalType);
1064
+ break;
1065
+ case "criticalEnd":
1066
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1067
+ break;
1068
+ case "breakStart":
1069
+ this.addSignal(void 0, void 0, e.breakText, e.signalType);
1070
+ break;
1071
+ case "breakEnd":
1072
+ this.addSignal(void 0, void 0, void 0, e.signalType);
1073
+ break;
1074
+ }
1075
+ }
1076
+ getConfig() {
1077
+ return at().sequence;
1078
+ }
1079
+ }, y(Wt, "SequenceDB"), Wt), We = /* @__PURE__ */ y((e) => `.actor {
1080
+ stroke: ${e.actorBorder};
1081
+ fill: ${e.actorBkg};
1082
+ }
1083
+
1084
+ text.actor > tspan {
1085
+ fill: ${e.actorTextColor};
1086
+ stroke: none;
1087
+ }
1088
+
1089
+ .actor-line {
1090
+ stroke: ${e.actorLineColor};
1091
+ }
1092
+
1093
+ .innerArc {
1094
+ stroke-width: 1.5;
1095
+ stroke-dasharray: none;
1096
+ }
1097
+
1098
+ .messageLine0 {
1099
+ stroke-width: 1.5;
1100
+ stroke-dasharray: none;
1101
+ stroke: ${e.signalColor};
1102
+ }
1103
+
1104
+ .messageLine1 {
1105
+ stroke-width: 1.5;
1106
+ stroke-dasharray: 2, 2;
1107
+ stroke: ${e.signalColor};
1108
+ }
1109
+
1110
+ #arrowhead path {
1111
+ fill: ${e.signalColor};
1112
+ stroke: ${e.signalColor};
1113
+ }
1114
+
1115
+ .sequenceNumber {
1116
+ fill: ${e.sequenceNumberColor};
1117
+ }
1118
+
1119
+ #sequencenumber {
1120
+ fill: ${e.signalColor};
1121
+ }
1122
+
1123
+ #crosshead path {
1124
+ fill: ${e.signalColor};
1125
+ stroke: ${e.signalColor};
1126
+ }
1127
+
1128
+ .messageText {
1129
+ fill: ${e.signalTextColor};
1130
+ stroke: none;
1131
+ }
1132
+
1133
+ .labelBox {
1134
+ stroke: ${e.labelBoxBorderColor};
1135
+ fill: ${e.labelBoxBkgColor};
1136
+ }
1137
+
1138
+ .labelText, .labelText > tspan {
1139
+ fill: ${e.labelTextColor};
1140
+ stroke: none;
1141
+ }
1142
+
1143
+ .loopText, .loopText > tspan {
1144
+ fill: ${e.loopTextColor};
1145
+ stroke: none;
1146
+ }
1147
+
1148
+ .loopLine {
1149
+ stroke-width: 2px;
1150
+ stroke-dasharray: 2, 2;
1151
+ stroke: ${e.labelBoxBorderColor};
1152
+ fill: ${e.labelBoxBorderColor};
1153
+ }
1154
+
1155
+ .note {
1156
+ //stroke: #decc93;
1157
+ stroke: ${e.noteBorderColor};
1158
+ fill: ${e.noteBkgColor};
1159
+ }
1160
+
1161
+ .noteText, .noteText > tspan {
1162
+ fill: ${e.noteTextColor};
1163
+ stroke: none;
1164
+ }
1165
+
1166
+ .activation0 {
1167
+ fill: ${e.activationBkgColor};
1168
+ stroke: ${e.activationBorderColor};
1169
+ }
1170
+
1171
+ .activation1 {
1172
+ fill: ${e.activationBkgColor};
1173
+ stroke: ${e.activationBorderColor};
1174
+ }
1175
+
1176
+ .activation2 {
1177
+ fill: ${e.activationBkgColor};
1178
+ stroke: ${e.activationBorderColor};
1179
+ }
1180
+
1181
+ .actorPopupMenu {
1182
+ position: absolute;
1183
+ }
1184
+
1185
+ .actorPopupMenuPanel {
1186
+ position: absolute;
1187
+ fill: ${e.actorBkg};
1188
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1189
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1190
+ }
1191
+ .actor-man line {
1192
+ stroke: ${e.actorBorder};
1193
+ fill: ${e.actorBkg};
1194
+ }
1195
+ .actor-man circle, line {
1196
+ stroke: ${e.actorBorder};
1197
+ fill: ${e.actorBkg};
1198
+ stroke-width: 2px;
1199
+ }
1200
+
1201
+ `, "getStyles"), qe = We, ft = 36, ut = "actor-top", xt = "actor-bottom", St = "actor-box", gt = "actor-man", It = /* @__PURE__ */ y(function(e, t) {
1202
+ return we(e, t);
1203
+ }, "drawRect"), ze = /* @__PURE__ */ y(function(e, t, o, a, r) {
1204
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1205
+ return { height: 0, width: 0 };
1206
+ const s = t.links, c = t.actorCnt, h = t.rectData;
1207
+ var g = "none";
1208
+ r && (g = "block !important");
1209
+ const i = e.append("g");
1210
+ i.attr("id", "actor" + c + "_popup"), i.attr("class", "actorPopupMenu"), i.attr("display", g);
1211
+ var d = "";
1212
+ h.class !== void 0 && (d = " " + h.class);
1213
+ let n = h.width > o ? h.width : o;
1214
+ const u = i.append("rect");
1215
+ if (u.attr("class", "actorPopupMenuPanel" + d), u.attr("x", h.x), u.attr("y", h.height), u.attr("fill", h.fill), u.attr("stroke", h.stroke), u.attr("width", n), u.attr("height", h.height), u.attr("rx", h.rx), u.attr("ry", h.ry), s != null) {
1216
+ var b = 20;
1217
+ for (let P in s) {
1218
+ var m = i.append("a"), w = re.sanitizeUrl(s[P]);
1219
+ m.attr("xlink:href", w), m.attr("target", "_blank"), pa(a)(
1220
+ P,
1221
+ m,
1222
+ h.x + 10,
1223
+ h.height + b,
1224
+ n,
1225
+ 20,
1226
+ { class: "actor" },
1227
+ a
1228
+ ), b += 30;
1229
+ }
1230
+ }
1231
+ return u.attr("height", b), { height: h.height + b, width: n };
1232
+ }, "drawPopup"), Dt = /* @__PURE__ */ y(function(e) {
1233
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1234
+ }, "popupMenuToggle"), Ot = /* @__PURE__ */ y(async function(e, t, o = null) {
1235
+ let a = e.append("foreignObject");
1236
+ const r = await ie(t.text, qt()), s = a.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();
1237
+ if (a.attr("height", Math.round(s.height)).attr("width", Math.round(s.width)), t.class === "noteText") {
1238
+ const c = e.node().firstChild;
1239
+ c.setAttribute("height", s.height + 2 * t.textMargin);
1240
+ const h = c.getBBox();
1241
+ a.attr("x", Math.round(h.x + h.width / 2 - s.width / 2)).attr("y", Math.round(h.y + h.height / 2 - s.height / 2));
1242
+ } else if (o) {
1243
+ let { startx: c, stopx: h, starty: g } = o;
1244
+ if (c > h) {
1245
+ const i = c;
1246
+ c = h, h = i;
1247
+ }
1248
+ a.attr("x", Math.round(c + Math.abs(c - h) / 2 - s.width / 2)), t.class === "loopText" ? a.attr("y", Math.round(g)) : a.attr("y", Math.round(g - s.height));
1249
+ }
1250
+ return [a];
1251
+ }, "drawKatex"), wt = /* @__PURE__ */ y(function(e, t) {
1252
+ let o = 0, a = 0;
1253
+ const r = t.text.split(L.lineBreakRegex), [s, c] = se(t.fontSize);
1254
+ let h = [], g = 0, i = /* @__PURE__ */ y(() => t.y, "yfunc");
1255
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1256
+ switch (t.valign) {
1257
+ case "top":
1258
+ case "start":
1259
+ i = /* @__PURE__ */ y(() => Math.round(t.y + t.textMargin), "yfunc");
1260
+ break;
1261
+ case "middle":
1262
+ case "center":
1263
+ i = /* @__PURE__ */ y(() => Math.round(t.y + (o + a + t.textMargin) / 2), "yfunc");
1264
+ break;
1265
+ case "bottom":
1266
+ case "end":
1267
+ i = /* @__PURE__ */ y(() => Math.round(
1268
+ t.y + (o + a + 2 * t.textMargin) - t.textMargin
1269
+ ), "yfunc");
1270
+ break;
1271
+ }
1272
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1273
+ switch (t.anchor) {
1274
+ case "left":
1275
+ case "start":
1276
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1277
+ break;
1278
+ case "middle":
1279
+ case "center":
1280
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1281
+ break;
1282
+ case "right":
1283
+ case "end":
1284
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1285
+ break;
1286
+ }
1287
+ for (let [d, n] of r.entries()) {
1288
+ t.textMargin !== void 0 && t.textMargin === 0 && s !== void 0 && (g = d * s);
1289
+ const u = e.append("text");
1290
+ u.attr("x", t.x), u.attr("y", i()), t.anchor !== void 0 && u.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && u.style("font-family", t.fontFamily), c !== void 0 && u.style("font-size", c), t.fontWeight !== void 0 && u.style("font-weight", t.fontWeight), t.fill !== void 0 && u.attr("fill", t.fill), t.class !== void 0 && u.attr("class", t.class), t.dy !== void 0 ? u.attr("dy", t.dy) : g !== 0 && u.attr("dy", g);
1291
+ const b = n || De;
1292
+ if (t.tspan) {
1293
+ const m = u.append("tspan");
1294
+ m.attr("x", t.x), t.fill !== void 0 && m.attr("fill", t.fill), m.text(b);
1295
+ } else
1296
+ u.text(b);
1297
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (a += (u._groups || u)[0][0].getBBox().height, o = a), h.push(u);
1298
+ }
1299
+ return h;
1300
+ }, "drawText"), oe = /* @__PURE__ */ y(function(e, t) {
1301
+ function o(r, s, c, h, g) {
1302
+ return r + "," + s + " " + (r + c) + "," + s + " " + (r + c) + "," + (s + h - g) + " " + (r + c - g * 1.2) + "," + (s + h) + " " + r + "," + (s + h);
1303
+ }
1304
+ y(o, "genPoints");
1305
+ const a = e.append("polygon");
1306
+ return a.attr("points", o(t.x, t.y, t.width, t.height, 7)), a.attr("class", "labelBox"), t.y = t.y + t.height / 2, wt(e, t), a;
1307
+ }, "drawLabel"), _ = -1, ne = /* @__PURE__ */ y((e, t, o, a) => {
1308
+ e.select && o.forEach((r) => {
1309
+ const s = t.get(r), c = e.select("#actor" + s.actorCnt);
1310
+ !a.mirrorActors && s.stopy ? c.attr("y2", s.stopy + s.height / 2) : a.mirrorActors && c.attr("y2", s.stopy);
1311
+ });
1312
+ }, "fixLifeLineHeights"), He = /* @__PURE__ */ y(function(e, t, o, a) {
1313
+ var r, s;
1314
+ const c = a ? t.stopy : t.starty, h = t.x + t.width / 2, g = c + t.height, i = e.append("g").lower();
1315
+ var d = i;
1316
+ a || (_++, Object.keys(t.links || {}).length && !o.forceMenus && d.attr("onclick", Dt(`actor${_}_popup`)).attr("cursor", "pointer"), d.append("line").attr("id", "actor" + _).attr("x1", h).attr("y1", g).attr("x2", h).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), d = i.append("g"), t.actorCnt = _, t.links != null && d.attr("id", "root-" + _));
1317
+ const n = lt();
1318
+ var u = "actor";
1319
+ (r = t.properties) != null && r.class ? u = t.properties.class : n.fill = "#eaeaea", a ? u += ` ${xt}` : u += ` ${ut}`, n.x = t.x, n.y = c, n.width = t.width, n.height = t.height, n.class = u, n.rx = 3, n.ry = 3, n.name = t.name;
1320
+ const b = It(d, n);
1321
+ if (t.rectData = n, (s = t.properties) != null && s.icon) {
1322
+ const w = t.properties.icon.trim();
1323
+ w.charAt(0) === "@" ? Gt(d, n.x + n.width - 20, n.y + 10, w.substr(1)) : Kt(d, n.x + n.width - 20, n.y + 10, w);
1324
+ }
1325
+ pt(o, W(t.description))(
1326
+ t.description,
1327
+ d,
1328
+ n.x,
1329
+ n.y,
1330
+ n.width,
1331
+ n.height,
1332
+ { class: `actor ${St}` },
1333
+ o
1334
+ );
1335
+ let m = t.height;
1336
+ if (b.node) {
1337
+ const w = b.node().getBBox();
1338
+ t.height = w.height, m = w.height;
1339
+ }
1340
+ return m;
1341
+ }, "drawActorTypeParticipant"), je = /* @__PURE__ */ y(function(e, t, o, a) {
1342
+ var r, s;
1343
+ const c = a ? t.stopy : t.starty, h = t.x + t.width / 2, g = c + t.height, i = e.append("g").lower();
1344
+ var d = i;
1345
+ a || (_++, Object.keys(t.links || {}).length && !o.forceMenus && d.attr("onclick", Dt(`actor${_}_popup`)).attr("cursor", "pointer"), d.append("line").attr("id", "actor" + _).attr("x1", h).attr("y1", g).attr("x2", h).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), d = i.append("g"), t.actorCnt = _, t.links != null && d.attr("id", "root-" + _));
1346
+ const n = lt();
1347
+ var u = "actor";
1348
+ (r = t.properties) != null && r.class ? u = t.properties.class : n.fill = "#eaeaea", a ? u += ` ${xt}` : u += ` ${ut}`, n.x = t.x, n.y = c, n.width = t.width, n.height = t.height, n.class = u, n.name = t.name;
1349
+ const b = 6, m = {
1350
+ ...n,
1351
+ x: n.x + -b,
1352
+ y: n.y + +b,
1353
+ class: "actor"
1354
+ }, w = It(d, n);
1355
+ if (It(d, m), t.rectData = n, (s = t.properties) != null && s.icon) {
1356
+ const A = t.properties.icon.trim();
1357
+ A.charAt(0) === "@" ? Gt(d, n.x + n.width - 20, n.y + 10, A.substr(1)) : Kt(d, n.x + n.width - 20, n.y + 10, A);
1358
+ }
1359
+ pt(o, W(t.description))(
1360
+ t.description,
1361
+ d,
1362
+ n.x - b,
1363
+ n.y + b,
1364
+ n.width,
1365
+ n.height,
1366
+ { class: `actor ${St}` },
1367
+ o
1368
+ );
1369
+ let P = t.height;
1370
+ if (w.node) {
1371
+ const A = w.node().getBBox();
1372
+ t.height = A.height, P = A.height;
1373
+ }
1374
+ return P;
1375
+ }, "drawActorTypeCollections"), Ue = /* @__PURE__ */ y(function(e, t, o, a) {
1376
+ var r, s;
1377
+ const c = a ? t.stopy : t.starty, h = t.x + t.width / 2, g = c + t.height, i = e.append("g").lower();
1378
+ let d = i;
1379
+ a || (_++, Object.keys(t.links || {}).length && !o.forceMenus && d.attr("onclick", Dt(`actor${_}_popup`)).attr("cursor", "pointer"), d.append("line").attr("id", "actor" + _).attr("x1", h).attr("y1", g).attr("x2", h).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), d = i.append("g"), t.actorCnt = _, t.links != null && d.attr("id", "root-" + _));
1380
+ const n = lt();
1381
+ let u = "actor";
1382
+ (r = t.properties) != null && r.class ? u = t.properties.class : n.fill = "#eaeaea", a ? u += ` ${xt}` : u += ` ${ut}`, n.x = t.x, n.y = c, n.width = t.width, n.height = t.height, n.class = u, n.name = t.name;
1383
+ const b = n.height / 2, m = b / (2.5 + n.height / 50), w = d.append("g"), P = d.append("g");
1384
+ if (w.append("path").attr(
1385
+ "d",
1386
+ `M ${n.x},${n.y + b}
1387
+ a ${m},${b} 0 0 0 0,${n.height}
1388
+ h ${n.width - 2 * m}
1389
+ a ${m},${b} 0 0 0 0,-${n.height}
1390
+ Z
1391
+ `
1392
+ ).attr("class", u), P.append("path").attr(
1393
+ "d",
1394
+ `M ${n.x},${n.y + b}
1395
+ a ${m},${b} 0 0 0 0,${n.height}`
1396
+ ).attr("stroke", "#666").attr("stroke-width", "1px").attr("class", u), w.attr("transform", `translate(${m}, ${-(n.height / 2)})`), P.attr("transform", `translate(${n.width - m}, ${-n.height / 2})`), t.rectData = n, (s = t.properties) != null && s.icon) {
1397
+ const M = t.properties.icon.trim(), $ = n.x + n.width - 20, B = n.y + 10;
1398
+ M.charAt(0) === "@" ? Gt(d, $, B, M.substr(1)) : Kt(d, $, B, M);
1399
+ }
1400
+ pt(o, W(t.description))(
1401
+ t.description,
1402
+ d,
1403
+ n.x,
1404
+ n.y,
1405
+ n.width,
1406
+ n.height,
1407
+ { class: `actor ${St}` },
1408
+ o
1409
+ );
1410
+ let A = t.height;
1411
+ const N = w.select("path:last-child");
1412
+ if (N.node()) {
1413
+ const M = N.node().getBBox();
1414
+ t.height = M.height, A = M.height;
1415
+ }
1416
+ return A;
1417
+ }, "drawActorTypeQueue"), Ge = /* @__PURE__ */ y(function(e, t, o, a) {
1418
+ var r;
1419
+ const s = a ? t.stopy : t.starty, c = t.x + t.width / 2, h = s + 75, g = e.append("g").lower();
1420
+ a || (_++, g.append("line").attr("id", "actor" + _).attr("x1", c).attr("y1", h).attr("x2", c).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = _);
1421
+ const i = e.append("g");
1422
+ let d = gt;
1423
+ a ? d += ` ${xt}` : d += ` ${ut}`, i.attr("class", d), i.attr("name", t.name);
1424
+ const n = lt();
1425
+ n.x = t.x, n.y = s, n.fill = "#eaeaea", n.width = t.width, n.height = t.height, n.class = "actor";
1426
+ const u = t.x + t.width / 2, b = s + 30, m = 18;
1427
+ i.append("defs").append("marker").attr("id", "filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), i.append("circle").attr("cx", u).attr("cy", b).attr("r", m).attr("fill", "#eaeaf7").attr("stroke", "#666").attr("stroke-width", 1.2), i.append("line").attr("marker-end", "url(#filled-head-control)").attr("transform", `translate(${u}, ${b - m})`);
1428
+ const w = i.node().getBBox();
1429
+ return t.height = w.height + 2 * (((r = o == null ? void 0 : o.sequence) == null ? void 0 : r.labelBoxHeight) ?? 0), pt(o, W(t.description))(
1430
+ t.description,
1431
+ i,
1432
+ n.x,
1433
+ n.y + m + (a ? 5 : 10),
1434
+ n.width,
1435
+ n.height,
1436
+ { class: `actor ${gt}` },
1437
+ o
1438
+ ), t.height;
1439
+ }, "drawActorTypeControl"), Ke = /* @__PURE__ */ y(function(e, t, o, a) {
1440
+ var r;
1441
+ const s = a ? t.stopy : t.starty, c = t.x + t.width / 2, h = s + 75, g = e.append("g").lower(), i = e.append("g");
1442
+ let d = gt;
1443
+ a ? d += ` ${xt}` : d += ` ${ut}`, i.attr("class", d), i.attr("name", t.name);
1444
+ const n = lt();
1445
+ n.x = t.x, n.y = s, n.fill = "#eaeaea", n.width = t.width, n.height = t.height, n.class = "actor";
1446
+ const u = t.x + t.width / 2, b = s + (a ? 10 : 25), m = 18;
1447
+ i.append("circle").attr("cx", u).attr("cy", b).attr("r", m).attr("width", t.width).attr("height", t.height), i.append("line").attr("x1", u - m).attr("x2", u + m).attr("y1", b + m).attr("y2", b + m).attr("stroke", "#333").attr("stroke-width", 2);
1448
+ const w = i.node().getBBox();
1449
+ return t.height = w.height + (((r = o == null ? void 0 : o.sequence) == null ? void 0 : r.labelBoxHeight) ?? 0), a || (_++, g.append("line").attr("id", "actor" + _).attr("x1", c).attr("y1", h).attr("x2", c).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = _), pt(o, W(t.description))(
1450
+ t.description,
1451
+ i,
1452
+ n.x,
1453
+ n.y + (a ? (b - s + m - 5) / 2 : (b + m - s) / 2),
1454
+ n.width,
1455
+ n.height,
1456
+ { class: `actor ${gt}` },
1457
+ o
1458
+ ), a ? i.attr("transform", `translate(0, ${m / 2})`) : i.attr("transform", `translate(0, ${m / 2})`), t.height;
1459
+ }, "drawActorTypeEntity"), Xe = /* @__PURE__ */ y(function(e, t, o, a) {
1460
+ var r;
1461
+ const s = a ? t.stopy : t.starty, c = t.x + t.width / 2, h = s + t.height + 2 * o.boxTextMargin, g = e.append("g").lower();
1462
+ let i = g;
1463
+ a || (_++, Object.keys(t.links || {}).length && !o.forceMenus && i.attr("onclick", Dt(`actor${_}_popup`)).attr("cursor", "pointer"), i.append("line").attr("id", "actor" + _).attr("x1", c).attr("y1", h).attr("x2", c).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), i = g.append("g"), t.actorCnt = _, t.links != null && i.attr("id", "root-" + _));
1464
+ const d = lt();
1465
+ let n = "actor";
1466
+ (r = t.properties) != null && r.class ? n = t.properties.class : d.fill = "#eaeaea", a ? n += ` ${xt}` : n += ` ${ut}`, d.x = t.x, d.y = s, d.width = t.width, d.height = t.height, d.class = n, d.name = t.name, d.x = t.x, d.y = s;
1467
+ const u = d.width / 4, b = d.width / 4, m = u / 2, w = m / (2.5 + u / 50), P = i.append("g"), A = `
1468
+ M ${d.x},${d.y + w}
1469
+ a ${m},${w} 0 0 0 ${u},0
1470
+ a ${m},${w} 0 0 0 -${u},0
1471
+ l 0,${b - 2 * w}
1472
+ a ${m},${w} 0 0 0 ${u},0
1473
+ l 0,-${b - 2 * w}
1474
+ `;
1475
+ P.append("path").attr("d", A).attr("fill", "#eaeaea").attr("stroke", "#000").attr("stroke-width", 1).attr("class", n), a ? P.attr("transform", `translate(${u * 1.5}, ${d.height / 4 - 2 * w})`) : P.attr("transform", `translate(${u * 1.5}, ${(d.height + w) / 4})`), t.rectData = d, pt(o, W(t.description))(
1476
+ t.description,
1477
+ i,
1478
+ d.x,
1479
+ d.y + (a ? (d.height + b) / 4 : (d.height + w) / 2),
1480
+ d.width,
1481
+ d.height,
1482
+ { class: `actor ${St}` },
1483
+ o
1484
+ );
1485
+ const N = P.select("path:last-child");
1486
+ if (N.node()) {
1487
+ const M = N.node().getBBox();
1488
+ t.height = M.height + (o.sequence.labelBoxHeight ?? 0);
1489
+ }
1490
+ return t.height;
1491
+ }, "drawActorTypeDatabase"), Ze = /* @__PURE__ */ y(function(e, t, o, a) {
1492
+ const r = a ? t.stopy : t.starty, s = t.x + t.width / 2, c = r + 80, h = 30, g = e.append("g").lower();
1493
+ a || (_++, g.append("line").attr("id", "actor" + _).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = _);
1494
+ const i = e.append("g");
1495
+ let d = gt;
1496
+ a ? d += ` ${xt}` : d += ` ${ut}`, i.attr("class", d), i.attr("name", t.name);
1497
+ const n = lt();
1498
+ n.x = t.x, n.y = r, n.fill = "#eaeaea", n.width = t.width, n.height = t.height, n.class = "actor", i.append("line").attr("id", "actor-man-torso" + _).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 10).attr("x2", t.x + t.width / 2 - 15).attr("y2", r + 10), i.append("line").attr("id", "actor-man-arms" + _).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 0).attr("x2", t.x + t.width / 2 - h * 2.5).attr("y2", r + 20), i.append("circle").attr("cx", t.x + t.width / 2).attr("cy", r + 10).attr("r", h);
1499
+ const u = i.node().getBBox();
1500
+ return t.height = u.height + (o.sequence.labelBoxHeight ?? 0), pt(o, W(t.description))(
1501
+ t.description,
1502
+ i,
1503
+ n.x,
1504
+ n.y + (a ? h / 2 - 4 : h / 2 + 3),
1505
+ n.width,
1506
+ n.height,
1507
+ { class: `actor ${gt}` },
1508
+ o
1509
+ ), a ? i.attr("transform", `translate(0,${h / 2 + 7})`) : i.attr("transform", `translate(0,${h / 2 + 7})`), t.height;
1510
+ }, "drawActorTypeBoundary"), Qe = /* @__PURE__ */ y(function(e, t, o, a) {
1511
+ const r = a ? t.stopy : t.starty, s = t.x + t.width / 2, c = r + 80, h = e.append("g").lower();
1512
+ a || (_++, h.append("line").attr("id", "actor" + _).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = _);
1513
+ const g = e.append("g");
1514
+ let i = gt;
1515
+ a ? i += ` ${xt}` : i += ` ${ut}`, g.attr("class", i), g.attr("name", t.name);
1516
+ const d = lt();
1517
+ d.x = t.x, d.y = r, d.fill = "#eaeaea", d.width = t.width, d.height = t.height, d.class = "actor", d.rx = 3, d.ry = 3, g.append("line").attr("id", "actor-man-torso" + _).attr("x1", s).attr("y1", r + 25).attr("x2", s).attr("y2", r + 45), g.append("line").attr("id", "actor-man-arms" + _).attr("x1", s - ft / 2).attr("y1", r + 33).attr("x2", s + ft / 2).attr("y2", r + 33), g.append("line").attr("x1", s - ft / 2).attr("y1", r + 60).attr("x2", s).attr("y2", r + 45), g.append("line").attr("x1", s).attr("y1", r + 45).attr("x2", s + ft / 2 - 2).attr("y2", r + 60);
1518
+ const n = g.append("circle");
1519
+ n.attr("cx", t.x + t.width / 2), n.attr("cy", r + 10), n.attr("r", 15), n.attr("width", t.width), n.attr("height", t.height);
1520
+ const u = g.node().getBBox();
1521
+ return t.height = u.height, pt(o, W(t.description))(
1522
+ t.description,
1523
+ g,
1524
+ d.x,
1525
+ d.y + 35,
1526
+ d.width,
1527
+ d.height,
1528
+ { class: `actor ${gt}` },
1529
+ o
1530
+ ), t.height;
1531
+ }, "drawActorTypeActor"), Je = /* @__PURE__ */ y(async function(e, t, o, a) {
1532
+ switch (t.type) {
1533
+ case "actor":
1534
+ return await Qe(e, t, o, a);
1535
+ case "participant":
1536
+ return await He(e, t, o, a);
1537
+ case "boundary":
1538
+ return await Ze(e, t, o, a);
1539
+ case "control":
1540
+ return await Ge(e, t, o, a);
1541
+ case "entity":
1542
+ return await Ke(e, t, o, a);
1543
+ case "database":
1544
+ return await Xe(e, t, o, a);
1545
+ case "collections":
1546
+ return await je(e, t, o, a);
1547
+ case "queue":
1548
+ return await Ue(e, t, o, a);
1549
+ }
1550
+ }, "drawActor"), ta = /* @__PURE__ */ y(function(e, t, o) {
1551
+ const a = e.append("g");
1552
+ ce(a, t), t.name && pt(o)(
1553
+ t.name,
1554
+ a,
1555
+ t.x,
1556
+ t.y + o.boxTextMargin + (t.textMaxHeight || 0) / 2,
1557
+ t.width,
1558
+ 0,
1559
+ { class: "text" },
1560
+ o
1561
+ ), a.lower();
1562
+ }, "drawBox"), ea = /* @__PURE__ */ y(function(e) {
1563
+ return e.append("g");
1564
+ }, "anchorElement"), aa = /* @__PURE__ */ y(function(e, t, o, a, r) {
1565
+ const s = lt(), c = t.anchored;
1566
+ s.x = t.startx, s.y = t.starty, s.class = "activation" + r % 3, s.width = t.stopx - t.startx, s.height = o - t.starty, It(c, s);
1567
+ }, "drawActivation"), ra = /* @__PURE__ */ y(async function(e, t, o, a) {
1568
+ const {
1569
+ boxMargin: r,
1570
+ boxTextMargin: s,
1571
+ labelBoxHeight: c,
1572
+ labelBoxWidth: h,
1573
+ messageFontFamily: g,
1574
+ messageFontSize: i,
1575
+ messageFontWeight: d
1576
+ } = a, n = e.append("g"), u = /* @__PURE__ */ y(function(w, P, A, N) {
1577
+ return n.append("line").attr("x1", w).attr("y1", P).attr("x2", A).attr("y2", N).attr("class", "loopLine");
1578
+ }, "drawLoopLine");
1579
+ u(t.startx, t.starty, t.stopx, t.starty), u(t.stopx, t.starty, t.stopx, t.stopy), u(t.startx, t.stopy, t.stopx, t.stopy), u(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(w) {
1580
+ u(t.startx, w.y, t.stopx, w.y).style(
1581
+ "stroke-dasharray",
1582
+ "3, 3"
1583
+ );
1584
+ });
1585
+ let b = Ut();
1586
+ b.text = o, b.x = t.startx, b.y = t.starty, b.fontFamily = g, b.fontSize = i, b.fontWeight = d, b.anchor = "middle", b.valign = "middle", b.tspan = !1, b.width = h || 50, b.height = c || 20, b.textMargin = s, b.class = "labelText", oe(n, b), b = le(), b.text = t.title, b.x = t.startx + h / 2 + (t.stopx - t.startx) / 2, b.y = t.starty + r + s, b.anchor = "middle", b.valign = "middle", b.textMargin = s, b.class = "loopText", b.fontFamily = g, b.fontSize = i, b.fontWeight = d, b.wrap = !0;
1587
+ let m = W(b.text) ? await Ot(n, b, t) : wt(n, b);
1588
+ if (t.sectionTitles !== void 0) {
1589
+ for (const [w, P] of Object.entries(t.sectionTitles))
1590
+ if (P.message) {
1591
+ b.text = P.message, b.x = t.startx + (t.stopx - t.startx) / 2, b.y = t.sections[w].y + r + s, b.class = "loopText", b.anchor = "middle", b.valign = "middle", b.tspan = !1, b.fontFamily = g, b.fontSize = i, b.fontWeight = d, b.wrap = t.wrap, W(b.text) ? (t.starty = t.sections[w].y, await Ot(n, b, t)) : wt(n, b);
1592
+ let A = Math.round(
1593
+ m.map((N) => (N._groups || N)[0][0].getBBox().height).reduce((N, M) => N + M)
1594
+ );
1595
+ t.sections[w].height += A - (r + s);
1596
+ }
1597
+ }
1598
+ return t.height = Math.round(t.stopy - t.starty), n;
1599
+ }, "drawLoop"), ce = /* @__PURE__ */ y(function(e, t) {
1600
+ Ee(e, t);
1601
+ }, "drawBackgroundRect"), sa = /* @__PURE__ */ y(function(e) {
1602
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1603
+ "d",
1604
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1605
+ );
1606
+ }, "insertDatabaseIcon"), ia = /* @__PURE__ */ y(function(e) {
1607
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1608
+ "d",
1609
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1610
+ );
1611
+ }, "insertComputerIcon"), oa = /* @__PURE__ */ y(function(e) {
1612
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1613
+ "d",
1614
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1615
+ );
1616
+ }, "insertClockIcon"), na = /* @__PURE__ */ y(function(e) {
1617
+ e.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
1618
+ }, "insertArrowHead"), ca = /* @__PURE__ */ y(function(e) {
1619
+ e.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1620
+ }, "insertArrowFilledHead"), la = /* @__PURE__ */ y(function(e) {
1621
+ e.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1622
+ }, "insertSequenceNumber"), ha = /* @__PURE__ */ y(function(e) {
1623
+ e.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
1624
+ }, "insertArrowCrossHead"), le = /* @__PURE__ */ y(function() {
1625
+ return {
1626
+ x: 0,
1627
+ y: 0,
1628
+ fill: void 0,
1629
+ anchor: void 0,
1630
+ style: "#666",
1631
+ width: void 0,
1632
+ height: void 0,
1633
+ textMargin: 0,
1634
+ rx: 0,
1635
+ ry: 0,
1636
+ tspan: !0,
1637
+ valign: void 0
1638
+ };
1639
+ }, "getTextObj"), da = /* @__PURE__ */ y(function() {
1640
+ return {
1641
+ x: 0,
1642
+ y: 0,
1643
+ fill: "#EDF2AE",
1644
+ stroke: "#666",
1645
+ width: 100,
1646
+ anchor: "start",
1647
+ height: 100,
1648
+ rx: 0,
1649
+ ry: 0
1650
+ };
1651
+ }, "getNoteRect"), pt = /* @__PURE__ */ function() {
1652
+ function e(s, c, h, g, i, d, n) {
1653
+ const u = c.append("text").attr("x", h + i / 2).attr("y", g + d / 2 + 5).style("text-anchor", "middle").text(s);
1654
+ r(u, n);
1655
+ }
1656
+ y(e, "byText");
1657
+ function t(s, c, h, g, i, d, n, u) {
1658
+ const { actorFontSize: b, actorFontFamily: m, actorFontWeight: w } = u, [P, A] = se(b), N = s.split(L.lineBreakRegex);
1659
+ for (let M = 0; M < N.length; M++) {
1660
+ const $ = M * P - P * (N.length - 1) / 2, B = c.append("text").attr("x", h + i / 2).attr("y", g).style("text-anchor", "middle").style("font-size", A).style("font-weight", w).style("font-family", m);
1661
+ B.append("tspan").attr("x", h + i / 2).attr("dy", $).text(N[M]), B.attr("y", g + d / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(B, n);
1662
+ }
1663
+ }
1664
+ y(t, "byTspan");
1665
+ function o(s, c, h, g, i, d, n, u) {
1666
+ const b = c.append("switch"), m = b.append("foreignObject").attr("x", h).attr("y", g).attr("width", i).attr("height", d).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1667
+ m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(s), t(s, b, h, g, i, d, n, u), r(m, n);
1668
+ }
1669
+ y(o, "byFo");
1670
+ async function a(s, c, h, g, i, d, n, u) {
1671
+ const b = await kt(s, qt()), m = c.append("switch"), w = m.append("foreignObject").attr("x", h + i / 2 - b.width / 2).attr("y", g + d / 2 - b.height / 2).attr("width", b.width).attr("height", b.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1672
+ w.append("div").style("text-align", "center").style("vertical-align", "middle").html(await ie(s, qt())), t(s, m, h, g, i, d, n, u), r(w, n);
1673
+ }
1674
+ y(a, "byKatex");
1675
+ function r(s, c) {
1676
+ for (const h in c)
1677
+ c.hasOwnProperty(h) && s.attr(h, c[h]);
1678
+ }
1679
+ return y(r, "_setTextAttrs"), function(s, c = !1) {
1680
+ return c ? a : s.textPlacement === "fo" ? o : s.textPlacement === "old" ? e : t;
1681
+ };
1682
+ }(), pa = /* @__PURE__ */ function() {
1683
+ function e(r, s, c, h, g, i, d) {
1684
+ const n = s.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(r);
1685
+ a(n, d);
1686
+ }
1687
+ y(e, "byText");
1688
+ function t(r, s, c, h, g, i, d, n) {
1689
+ const { actorFontSize: u, actorFontFamily: b, actorFontWeight: m } = n, w = r.split(L.lineBreakRegex);
1690
+ for (let P = 0; P < w.length; P++) {
1691
+ const A = P * u - u * (w.length - 1) / 2, N = s.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", u).style("font-weight", m).style("font-family", b);
1692
+ N.append("tspan").attr("x", c).attr("dy", A).text(w[P]), N.attr("y", h + i / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), a(N, d);
1693
+ }
1694
+ }
1695
+ y(t, "byTspan");
1696
+ function o(r, s, c, h, g, i, d, n) {
1697
+ const u = s.append("switch"), b = u.append("foreignObject").attr("x", c).attr("y", h).attr("width", g).attr("height", i).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1698
+ b.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, u, c, h, g, i, d, n), a(b, d);
1699
+ }
1700
+ y(o, "byFo");
1701
+ function a(r, s) {
1702
+ for (const c in s)
1703
+ s.hasOwnProperty(c) && r.attr(c, s[c]);
1704
+ }
1705
+ return y(a, "_setTextAttrs"), function(r) {
1706
+ return r.textPlacement === "fo" ? o : r.textPlacement === "old" ? e : t;
1707
+ };
1708
+ }(), C = {
1709
+ drawRect: It,
1710
+ drawText: wt,
1711
+ drawLabel: oe,
1712
+ drawActor: Je,
1713
+ drawBox: ta,
1714
+ drawPopup: ze,
1715
+ anchorElement: ea,
1716
+ drawActivation: aa,
1717
+ drawLoop: ra,
1718
+ drawBackgroundRect: ce,
1719
+ insertArrowHead: na,
1720
+ insertArrowFilledHead: ca,
1721
+ insertSequenceNumber: la,
1722
+ insertArrowCrossHead: ha,
1723
+ insertDatabaseIcon: sa,
1724
+ insertComputerIcon: ia,
1725
+ insertClockIcon: oa,
1726
+ getTextObj: le,
1727
+ getNoteRect: da,
1728
+ fixLifeLineHeights: ne,
1729
+ sanitizeUrl: re.sanitizeUrl
1730
+ }, l = {}, f = {
1731
+ data: {
1732
+ startx: void 0,
1733
+ stopx: void 0,
1734
+ starty: void 0,
1735
+ stopy: void 0
1736
+ },
1737
+ verticalPos: 0,
1738
+ sequenceItems: [],
1739
+ activations: [],
1740
+ models: {
1741
+ getHeight: /* @__PURE__ */ y(function() {
1742
+ return Math.max.apply(
1743
+ null,
1744
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1745
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.messages.length === 0 ? 0 : this.messages.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.notes.length === 0 ? 0 : this.notes.map((e) => e.height || 0).reduce((e, t) => e + t));
1746
+ }, "getHeight"),
1747
+ clear: /* @__PURE__ */ y(function() {
1748
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1749
+ }, "clear"),
1750
+ addBox: /* @__PURE__ */ y(function(e) {
1751
+ this.boxes.push(e);
1752
+ }, "addBox"),
1753
+ addActor: /* @__PURE__ */ y(function(e) {
1754
+ this.actors.push(e);
1755
+ }, "addActor"),
1756
+ addLoop: /* @__PURE__ */ y(function(e) {
1757
+ this.loops.push(e);
1758
+ }, "addLoop"),
1759
+ addMessage: /* @__PURE__ */ y(function(e) {
1760
+ this.messages.push(e);
1761
+ }, "addMessage"),
1762
+ addNote: /* @__PURE__ */ y(function(e) {
1763
+ this.notes.push(e);
1764
+ }, "addNote"),
1765
+ lastActor: /* @__PURE__ */ y(function() {
1766
+ return this.actors[this.actors.length - 1];
1767
+ }, "lastActor"),
1768
+ lastLoop: /* @__PURE__ */ y(function() {
1769
+ return this.loops[this.loops.length - 1];
1770
+ }, "lastLoop"),
1771
+ lastMessage: /* @__PURE__ */ y(function() {
1772
+ return this.messages[this.messages.length - 1];
1773
+ }, "lastMessage"),
1774
+ lastNote: /* @__PURE__ */ y(function() {
1775
+ return this.notes[this.notes.length - 1];
1776
+ }, "lastNote"),
1777
+ actors: [],
1778
+ boxes: [],
1779
+ loops: [],
1780
+ messages: [],
1781
+ notes: []
1782
+ },
1783
+ init: /* @__PURE__ */ y(function() {
1784
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1785
+ startx: void 0,
1786
+ stopx: void 0,
1787
+ starty: void 0,
1788
+ stopy: void 0
1789
+ }, this.verticalPos = 0, pe(at());
1790
+ }, "init"),
1791
+ updateVal: /* @__PURE__ */ y(function(e, t, o, a) {
1792
+ e[t] === void 0 ? e[t] = o : e[t] = a(o, e[t]);
1793
+ }, "updateVal"),
1794
+ updateBounds: /* @__PURE__ */ y(function(e, t, o, a) {
1795
+ const r = this;
1796
+ let s = 0;
1797
+ function c(h) {
1798
+ return /* @__PURE__ */ y(function(g) {
1799
+ s++;
1800
+ const i = r.sequenceItems.length - s + 1;
1801
+ r.updateVal(g, "starty", t - i * l.boxMargin, Math.min), r.updateVal(g, "stopy", a + i * l.boxMargin, Math.max), r.updateVal(f.data, "startx", e - i * l.boxMargin, Math.min), r.updateVal(f.data, "stopx", o + i * l.boxMargin, Math.max), h !== "activation" && (r.updateVal(g, "startx", e - i * l.boxMargin, Math.min), r.updateVal(g, "stopx", o + i * l.boxMargin, Math.max), r.updateVal(f.data, "starty", t - i * l.boxMargin, Math.min), r.updateVal(f.data, "stopy", a + i * l.boxMargin, Math.max));
1802
+ }, "updateItemBounds");
1803
+ }
1804
+ y(c, "updateFn"), this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1805
+ }, "updateBounds"),
1806
+ insert: /* @__PURE__ */ y(function(e, t, o, a) {
1807
+ const r = L.getMin(e, o), s = L.getMax(e, o), c = L.getMin(t, a), h = L.getMax(t, a);
1808
+ this.updateVal(f.data, "startx", r, Math.min), this.updateVal(f.data, "starty", c, Math.min), this.updateVal(f.data, "stopx", s, Math.max), this.updateVal(f.data, "stopy", h, Math.max), this.updateBounds(r, c, s, h);
1809
+ }, "insert"),
1810
+ newActivation: /* @__PURE__ */ y(function(e, t, o) {
1811
+ const a = o.get(e.from), r = $t(e.from).length || 0, s = a.x + a.width / 2 + (r - 1) * l.activationWidth / 2;
1812
+ this.activations.push({
1813
+ startx: s,
1814
+ starty: this.verticalPos + 2,
1815
+ stopx: s + l.activationWidth,
1816
+ stopy: void 0,
1817
+ actor: e.from,
1818
+ anchored: C.anchorElement(t)
1819
+ });
1820
+ }, "newActivation"),
1821
+ endActivation: /* @__PURE__ */ y(function(e) {
1822
+ const t = this.activations.map(function(o) {
1823
+ return o.actor;
1824
+ }).lastIndexOf(e.from);
1825
+ return this.activations.splice(t, 1)[0];
1826
+ }, "endActivation"),
1827
+ createLoop: /* @__PURE__ */ y(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1828
+ return {
1829
+ startx: void 0,
1830
+ starty: this.verticalPos,
1831
+ stopx: void 0,
1832
+ stopy: void 0,
1833
+ title: e.message,
1834
+ wrap: e.wrap,
1835
+ width: e.width,
1836
+ height: 0,
1837
+ fill: t
1838
+ };
1839
+ }, "createLoop"),
1840
+ newLoop: /* @__PURE__ */ y(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1841
+ this.sequenceItems.push(this.createLoop(e, t));
1842
+ }, "newLoop"),
1843
+ endLoop: /* @__PURE__ */ y(function() {
1844
+ return this.sequenceItems.pop();
1845
+ }, "endLoop"),
1846
+ isLoopOverlap: /* @__PURE__ */ y(function() {
1847
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
1848
+ }, "isLoopOverlap"),
1849
+ addSectionToLoop: /* @__PURE__ */ y(function(e) {
1850
+ const t = this.sequenceItems.pop();
1851
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: f.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
1852
+ }, "addSectionToLoop"),
1853
+ saveVerticalPos: /* @__PURE__ */ y(function() {
1854
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1855
+ }, "saveVerticalPos"),
1856
+ resetVerticalPos: /* @__PURE__ */ y(function() {
1857
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1858
+ }, "resetVerticalPos"),
1859
+ bumpVerticalPos: /* @__PURE__ */ y(function(e) {
1860
+ this.verticalPos = this.verticalPos + e, this.data.stopy = L.getMax(this.data.stopy, this.verticalPos);
1861
+ }, "bumpVerticalPos"),
1862
+ getVerticalPos: /* @__PURE__ */ y(function() {
1863
+ return this.verticalPos;
1864
+ }, "getVerticalPos"),
1865
+ getBounds: /* @__PURE__ */ y(function() {
1866
+ return { bounds: this.data, models: this.models };
1867
+ }, "getBounds")
1868
+ }, ga = /* @__PURE__ */ y(async function(e, t) {
1869
+ f.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = f.getVerticalPos();
1870
+ const o = lt();
1871
+ o.x = t.startx, o.y = t.starty, o.width = t.width || l.width, o.class = "note";
1872
+ const a = e.append("g"), r = C.drawRect(a, o), s = Ut();
1873
+ s.x = t.startx, s.y = t.starty, s.width = o.width, s.dy = "1em", s.text = t.message, s.class = "noteText", s.fontFamily = l.noteFontFamily, s.fontSize = l.noteFontSize, s.fontWeight = l.noteFontWeight, s.anchor = l.noteAlign, s.textMargin = l.noteMargin, s.valign = "center";
1874
+ const c = W(s.text) ? await Ot(a, s) : wt(a, s), h = Math.round(
1875
+ c.map((g) => (g._groups || g)[0][0].getBBox().height).reduce((g, i) => g + i)
1876
+ );
1877
+ r.attr("height", h + 2 * l.noteMargin), t.height += h + 2 * l.noteMargin, f.bumpVerticalPos(h + 2 * l.noteMargin), t.stopy = t.starty + h + 2 * l.noteMargin, t.stopx = t.startx + o.width, f.insert(t.startx, t.starty, t.stopx, t.stopy), f.models.addNote(t);
1878
+ }, "drawNote"), mt = /* @__PURE__ */ y((e) => ({
1879
+ fontFamily: e.messageFontFamily,
1880
+ fontSize: e.messageFontSize,
1881
+ fontWeight: e.messageFontWeight
1882
+ }), "messageFont"), Et = /* @__PURE__ */ y((e) => ({
1883
+ fontFamily: e.noteFontFamily,
1884
+ fontSize: e.noteFontSize,
1885
+ fontWeight: e.noteFontWeight
1886
+ }), "noteFont"), Ht = /* @__PURE__ */ y((e) => ({
1887
+ fontFamily: e.actorFontFamily,
1888
+ fontSize: e.actorFontSize,
1889
+ fontWeight: e.actorFontWeight
1890
+ }), "actorFont");
1891
+ async function he(e, t) {
1892
+ f.bumpVerticalPos(10);
1893
+ const { startx: o, stopx: a, message: r } = t, s = L.splitBreaks(r).length, c = W(r), h = c ? await kt(r, at()) : V.calculateTextDimensions(r, mt(l));
1894
+ if (!c) {
1895
+ const n = h.height / s;
1896
+ t.height += n, f.bumpVerticalPos(n);
1897
+ }
1898
+ let g, i = h.height - 10;
1899
+ const d = h.width;
1900
+ if (o === a) {
1901
+ g = f.getVerticalPos() + i, l.rightAngles || (i += l.boxMargin, g = f.getVerticalPos() + i), i += 30;
1902
+ const n = L.getMax(d / 2, l.width / 2);
1903
+ f.insert(
1904
+ o - n,
1905
+ f.getVerticalPos() - 10 + i,
1906
+ a + n,
1907
+ f.getVerticalPos() + 30 + i
1908
+ );
1909
+ } else
1910
+ i += l.boxMargin, g = f.getVerticalPos() + i, f.insert(o, g - 10, a, g);
1911
+ return f.bumpVerticalPos(i), t.height += i, t.stopy = t.starty + t.height, f.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), g;
1912
+ }
1913
+ y(he, "boundMessage");
1914
+ var ua = /* @__PURE__ */ y(async function(e, t, o, a) {
1915
+ const { startx: r, stopx: s, starty: c, message: h, type: g, sequenceIndex: i, sequenceVisible: d } = t, n = V.calculateTextDimensions(h, mt(l)), u = Ut();
1916
+ u.x = r, u.y = c + 10, u.width = s - r, u.class = "messageText", u.dy = "1em", u.text = h, u.fontFamily = l.messageFontFamily, u.fontSize = l.messageFontSize, u.fontWeight = l.messageFontWeight, u.anchor = l.messageAlign, u.valign = "center", u.textMargin = l.wrapPadding, u.tspan = !1, W(u.text) ? await Ot(e, u, { startx: r, stopx: s, starty: o }) : wt(e, u);
1917
+ const b = n.width;
1918
+ let m;
1919
+ r === s ? l.rightAngles ? m = e.append("path").attr(
1920
+ "d",
1921
+ `M ${r},${o} H ${r + L.getMax(l.width / 2, b / 2)} V ${o + 25} H ${r}`
1922
+ ) : m = e.append("path").attr(
1923
+ "d",
1924
+ "M " + r + "," + o + " C " + (r + 60) + "," + (o - 10) + " " + (r + 60) + "," + (o + 30) + " " + r + "," + (o + 20)
1925
+ ) : (m = e.append("line"), m.attr("x1", r), m.attr("y1", o), m.attr("x2", s), m.attr("y2", o)), g === a.db.LINETYPE.DOTTED || g === a.db.LINETYPE.DOTTED_CROSS || g === a.db.LINETYPE.DOTTED_POINT || g === a.db.LINETYPE.DOTTED_OPEN || g === a.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (m.style("stroke-dasharray", "3, 3"), m.attr("class", "messageLine1")) : m.attr("class", "messageLine0");
1926
+ let w = "";
1927
+ l.arrowMarkerAbsolute && (w = $e(!0)), m.attr("stroke-width", 2), m.attr("stroke", "none"), m.style("fill", "none"), (g === a.db.LINETYPE.SOLID || g === a.db.LINETYPE.DOTTED) && m.attr("marker-end", "url(" + w + "#arrowhead)"), (g === a.db.LINETYPE.BIDIRECTIONAL_SOLID || g === a.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (m.attr("marker-start", "url(" + w + "#arrowhead)"), m.attr("marker-end", "url(" + w + "#arrowhead)")), (g === a.db.LINETYPE.SOLID_POINT || g === a.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + w + "#filled-head)"), (g === a.db.LINETYPE.SOLID_CROSS || g === a.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + w + "#crosshead)"), (d || l.showSequenceNumbers) && ((g === a.db.LINETYPE.BIDIRECTIONAL_SOLID || g === a.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (r < s ? m.attr("x1", r + 12) : m.attr("x1", r + 6)), e.append("line").attr("x1", r).attr("y1", o).attr("x2", r).attr("y2", o).attr("stroke-width", 0).attr("marker-start", "url(" + w + "#sequencenumber)"), e.append("text").attr("x", r).attr("y", o + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(i));
1928
+ }, "drawMessage"), xa = /* @__PURE__ */ y(function(e, t, o, a, r, s, c) {
1929
+ let h = 0, g = 0, i, d = 0;
1930
+ for (const n of a) {
1931
+ const u = t.get(n), b = u.box;
1932
+ i && i != b && (c || f.models.addBox(i), g += l.boxMargin + i.margin), b && b != i && (c || (b.x = h + g, b.y = r), g += b.margin), u.width = u.width || l.width, u.height = L.getMax(u.height || l.height, l.height), u.margin = u.margin || l.actorMargin, d = L.getMax(d, u.height), o.get(u.name) && (g += u.width / 2), u.x = h + g, u.starty = f.getVerticalPos(), f.insert(u.x, r, u.x + u.width, u.height), h += u.width + g, u.box && (u.box.width = h + b.margin - u.box.x), g = u.margin, i = u.box, f.models.addActor(u);
1933
+ }
1934
+ i && !c && f.models.addBox(i), f.bumpVerticalPos(d);
1935
+ }, "addActorRenderingData"), jt = /* @__PURE__ */ y(async function(e, t, o, a) {
1936
+ if (a) {
1937
+ let r = 0;
1938
+ f.bumpVerticalPos(l.boxMargin * 2);
1939
+ for (const s of o) {
1940
+ const c = t.get(s);
1941
+ c.stopy || (c.stopy = f.getVerticalPos());
1942
+ const h = await C.drawActor(e, c, l, !0);
1943
+ r = L.getMax(r, h);
1944
+ }
1945
+ f.bumpVerticalPos(r + l.boxMargin);
1946
+ } else
1947
+ for (const r of o) {
1948
+ const s = t.get(r);
1949
+ await C.drawActor(e, s, l, !1);
1950
+ }
1951
+ }, "drawActors"), de = /* @__PURE__ */ y(function(e, t, o, a) {
1952
+ let r = 0, s = 0;
1953
+ for (const c of o) {
1954
+ const h = t.get(c), g = ba(h), i = C.drawPopup(
1955
+ e,
1956
+ h,
1957
+ g,
1958
+ l,
1959
+ l.forceMenus,
1960
+ a
1961
+ );
1962
+ i.height > r && (r = i.height), i.width + h.x > s && (s = i.width + h.x);
1963
+ }
1964
+ return { maxHeight: r, maxWidth: s };
1965
+ }, "drawActorsPopup"), pe = /* @__PURE__ */ y(function(e) {
1966
+ Le(l, e), e.fontFamily && (l.actorFontFamily = l.noteFontFamily = l.messageFontFamily = e.fontFamily), e.fontSize && (l.actorFontSize = l.noteFontSize = l.messageFontSize = e.fontSize), e.fontWeight && (l.actorFontWeight = l.noteFontWeight = l.messageFontWeight = e.fontWeight);
1967
+ }, "setConf"), $t = /* @__PURE__ */ y(function(e) {
1968
+ return f.activations.filter(function(t) {
1969
+ return t.actor === e;
1970
+ });
1971
+ }, "actorActivations"), ae = /* @__PURE__ */ y(function(e, t) {
1972
+ const o = t.get(e), a = $t(e), r = a.reduce(
1973
+ function(c, h) {
1974
+ return L.getMin(c, h.startx);
1975
+ },
1976
+ o.x + o.width / 2 - 1
1977
+ ), s = a.reduce(
1978
+ function(c, h) {
1979
+ return L.getMax(c, h.stopx);
1980
+ },
1981
+ o.x + o.width / 2 + 1
1982
+ );
1983
+ return [r, s];
1984
+ }, "activationBounds");
1985
+ function ot(e, t, o, a, r) {
1986
+ f.bumpVerticalPos(o);
1987
+ let s = a;
1988
+ if (t.id && t.message && e[t.id]) {
1989
+ const c = e[t.id].width, h = mt(l);
1990
+ t.message = V.wrapLabel(`[${t.message}]`, c - 2 * l.wrapPadding, h), t.width = c, t.wrap = !0;
1991
+ const g = V.calculateTextDimensions(t.message, h), i = L.getMax(g.height, l.labelBoxHeight);
1992
+ s = a + i, X.debug(`${i} - ${t.message}`);
1993
+ }
1994
+ r(t), f.bumpVerticalPos(s);
1995
+ }
1996
+ y(ot, "adjustLoopHeightForWrap");
1997
+ function ge(e, t, o, a, r, s, c) {
1998
+ function h(d, n) {
1999
+ d.x < r.get(e.from).x ? (f.insert(
2000
+ t.stopx - n,
2001
+ t.starty,
2002
+ t.startx,
2003
+ t.stopy + d.height / 2 + l.noteMargin
2004
+ ), t.stopx = t.stopx + n) : (f.insert(
2005
+ t.startx,
2006
+ t.starty,
2007
+ t.stopx + n,
2008
+ t.stopy + d.height / 2 + l.noteMargin
2009
+ ), t.stopx = t.stopx - n);
2010
+ }
2011
+ y(h, "receiverAdjustment");
2012
+ function g(d, n) {
2013
+ d.x < r.get(e.to).x ? (f.insert(
2014
+ t.startx - n,
2015
+ t.starty,
2016
+ t.stopx,
2017
+ t.stopy + d.height / 2 + l.noteMargin
2018
+ ), t.startx = t.startx + n) : (f.insert(
2019
+ t.stopx,
2020
+ t.starty,
2021
+ t.startx + n,
2022
+ t.stopy + d.height / 2 + l.noteMargin
2023
+ ), t.startx = t.startx - n);
2024
+ }
2025
+ y(g, "senderAdjustment");
2026
+ const i = [
2027
+ Mt.ACTOR,
2028
+ Mt.CONTROL,
2029
+ Mt.ENTITY,
2030
+ Mt.DATABASE
2031
+ ];
2032
+ if (s.get(e.to) == a) {
2033
+ const d = r.get(e.to), n = i.includes(d.type) ? ft / 2 + 3 : d.width / 2 + 3;
2034
+ h(d, n), d.starty = o - d.height / 2, f.bumpVerticalPos(d.height / 2);
2035
+ } else if (c.get(e.from) == a) {
2036
+ const d = r.get(e.from);
2037
+ if (l.mirrorActors) {
2038
+ const n = i.includes(d.type) ? ft / 2 : d.width / 2;
2039
+ g(d, n);
2040
+ }
2041
+ d.stopy = o - d.height / 2, f.bumpVerticalPos(d.height / 2);
2042
+ } else if (c.get(e.to) == a) {
2043
+ const d = r.get(e.to);
2044
+ if (l.mirrorActors) {
2045
+ const n = i.includes(d.type) ? ft / 2 + 3 : d.width / 2 + 3;
2046
+ h(d, n);
2047
+ }
2048
+ d.stopy = o - d.height / 2, f.bumpVerticalPos(d.height / 2);
2049
+ }
2050
+ }
2051
+ y(ge, "adjustCreatedDestroyedData");
2052
+ var ya = /* @__PURE__ */ y(async function(e, t, o, a) {
2053
+ const { securityLevel: r, sequence: s } = at();
2054
+ l = s;
2055
+ let c;
2056
+ r === "sandbox" && (c = At("#i" + t));
2057
+ const h = r === "sandbox" ? At(c.nodes()[0].contentDocument.body) : At("body"), g = r === "sandbox" ? c.nodes()[0].contentDocument : document;
2058
+ f.init(), X.debug(a.db);
2059
+ const i = r === "sandbox" ? h.select(`[id="${t}"]`) : At(`[id="${t}"]`), d = a.db.getActors(), n = a.db.getCreatedActors(), u = a.db.getDestroyedActors(), b = a.db.getBoxes();
2060
+ let m = a.db.getActorKeys();
2061
+ const w = a.db.getMessages(), P = a.db.getDiagramTitle(), A = a.db.hasAtLeastOneBox(), N = a.db.hasAtLeastOneBoxWithTitle(), M = await ue(d, w, a);
2062
+ if (l.height = await xe(d, M, b), C.insertComputerIcon(i), C.insertDatabaseIcon(i), C.insertClockIcon(i), A && (f.bumpVerticalPos(l.boxMargin), N && f.bumpVerticalPos(b[0].textMaxHeight)), l.hideUnusedParticipants === !0) {
2063
+ const T = /* @__PURE__ */ new Set();
2064
+ w.forEach((v) => {
2065
+ T.add(v.from), T.add(v.to);
2066
+ }), m = m.filter((v) => T.has(v));
2067
+ }
2068
+ xa(i, d, n, m, 0, w, !1);
2069
+ const $ = await Ta(w, d, M, a);
2070
+ C.insertArrowHead(i), C.insertArrowCrossHead(i), C.insertArrowFilledHead(i), C.insertSequenceNumber(i);
2071
+ function B(T, v) {
2072
+ const U = f.endActivation(T);
2073
+ U.starty + 18 > v && (U.starty = v - 6, v += 12), C.drawActivation(
2074
+ i,
2075
+ U,
2076
+ v,
2077
+ l,
2078
+ $t(T.from).length
2079
+ ), f.insert(U.startx, v - 10, U.stopx, v);
2080
+ }
2081
+ y(B, "activeEnd");
2082
+ let q = 1, Z = 1;
2083
+ const rt = [], z = [];
2084
+ let H = 0;
2085
+ for (const T of w) {
2086
+ let v, U, tt;
2087
+ switch (T.type) {
2088
+ case a.db.LINETYPE.NOTE:
2089
+ f.resetVerticalPos(), U = T.noteModel, await ga(i, U);
2090
+ break;
2091
+ case a.db.LINETYPE.ACTIVE_START:
2092
+ f.newActivation(T, i, d);
2093
+ break;
2094
+ case a.db.LINETYPE.ACTIVE_END:
2095
+ B(T, f.getVerticalPos());
2096
+ break;
2097
+ case a.db.LINETYPE.LOOP_START:
2098
+ ot(
2099
+ $,
2100
+ T,
2101
+ l.boxMargin,
2102
+ l.boxMargin + l.boxTextMargin,
2103
+ (S) => f.newLoop(S)
2104
+ );
2105
+ break;
2106
+ case a.db.LINETYPE.LOOP_END:
2107
+ v = f.endLoop(), await C.drawLoop(i, v, "loop", l), f.bumpVerticalPos(v.stopy - f.getVerticalPos()), f.models.addLoop(v);
2108
+ break;
2109
+ case a.db.LINETYPE.RECT_START:
2110
+ ot(
2111
+ $,
2112
+ T,
2113
+ l.boxMargin,
2114
+ l.boxMargin,
2115
+ (S) => f.newLoop(void 0, S.message)
2116
+ );
2117
+ break;
2118
+ case a.db.LINETYPE.RECT_END:
2119
+ v = f.endLoop(), z.push(v), f.models.addLoop(v), f.bumpVerticalPos(v.stopy - f.getVerticalPos());
2120
+ break;
2121
+ case a.db.LINETYPE.OPT_START:
2122
+ ot(
2123
+ $,
2124
+ T,
2125
+ l.boxMargin,
2126
+ l.boxMargin + l.boxTextMargin,
2127
+ (S) => f.newLoop(S)
2128
+ );
2129
+ break;
2130
+ case a.db.LINETYPE.OPT_END:
2131
+ v = f.endLoop(), await C.drawLoop(i, v, "opt", l), f.bumpVerticalPos(v.stopy - f.getVerticalPos()), f.models.addLoop(v);
2132
+ break;
2133
+ case a.db.LINETYPE.ALT_START:
2134
+ ot(
2135
+ $,
2136
+ T,
2137
+ l.boxMargin,
2138
+ l.boxMargin + l.boxTextMargin,
2139
+ (S) => f.newLoop(S)
2140
+ );
2141
+ break;
2142
+ case a.db.LINETYPE.ALT_ELSE:
2143
+ ot(
2144
+ $,
2145
+ T,
2146
+ l.boxMargin + l.boxTextMargin,
2147
+ l.boxMargin,
2148
+ (S) => f.addSectionToLoop(S)
2149
+ );
2150
+ break;
2151
+ case a.db.LINETYPE.ALT_END:
2152
+ v = f.endLoop(), await C.drawLoop(i, v, "alt", l), f.bumpVerticalPos(v.stopy - f.getVerticalPos()), f.models.addLoop(v);
2153
+ break;
2154
+ case a.db.LINETYPE.PAR_START:
2155
+ case a.db.LINETYPE.PAR_OVER_START:
2156
+ ot(
2157
+ $,
2158
+ T,
2159
+ l.boxMargin,
2160
+ l.boxMargin + l.boxTextMargin,
2161
+ (S) => f.newLoop(S)
2162
+ ), f.saveVerticalPos();
2163
+ break;
2164
+ case a.db.LINETYPE.PAR_AND:
2165
+ ot(
2166
+ $,
2167
+ T,
2168
+ l.boxMargin + l.boxTextMargin,
2169
+ l.boxMargin,
2170
+ (S) => f.addSectionToLoop(S)
2171
+ );
2172
+ break;
2173
+ case a.db.LINETYPE.PAR_END:
2174
+ v = f.endLoop(), await C.drawLoop(i, v, "par", l), f.bumpVerticalPos(v.stopy - f.getVerticalPos()), f.models.addLoop(v);
2175
+ break;
2176
+ case a.db.LINETYPE.AUTONUMBER:
2177
+ q = T.message.start || q, Z = T.message.step || Z, T.message.visible ? a.db.enableSequenceNumbers() : a.db.disableSequenceNumbers();
2178
+ break;
2179
+ case a.db.LINETYPE.CRITICAL_START:
2180
+ ot(
2181
+ $,
2182
+ T,
2183
+ l.boxMargin,
2184
+ l.boxMargin + l.boxTextMargin,
2185
+ (S) => f.newLoop(S)
2186
+ );
2187
+ break;
2188
+ case a.db.LINETYPE.CRITICAL_OPTION:
2189
+ ot(
2190
+ $,
2191
+ T,
2192
+ l.boxMargin + l.boxTextMargin,
2193
+ l.boxMargin,
2194
+ (S) => f.addSectionToLoop(S)
2195
+ );
2196
+ break;
2197
+ case a.db.LINETYPE.CRITICAL_END:
2198
+ v = f.endLoop(), await C.drawLoop(i, v, "critical", l), f.bumpVerticalPos(v.stopy - f.getVerticalPos()), f.models.addLoop(v);
2199
+ break;
2200
+ case a.db.LINETYPE.BREAK_START:
2201
+ ot(
2202
+ $,
2203
+ T,
2204
+ l.boxMargin,
2205
+ l.boxMargin + l.boxTextMargin,
2206
+ (S) => f.newLoop(S)
2207
+ );
2208
+ break;
2209
+ case a.db.LINETYPE.BREAK_END:
2210
+ v = f.endLoop(), await C.drawLoop(i, v, "break", l), f.bumpVerticalPos(v.stopy - f.getVerticalPos()), f.models.addLoop(v);
2211
+ break;
2212
+ default:
2213
+ try {
2214
+ tt = T.msgModel, tt.starty = f.getVerticalPos(), tt.sequenceIndex = q, tt.sequenceVisible = a.db.showSequenceNumbers();
2215
+ const S = await he(i, tt);
2216
+ ge(
2217
+ T,
2218
+ tt,
2219
+ S,
2220
+ H,
2221
+ d,
2222
+ n,
2223
+ u
2224
+ ), rt.push({ messageModel: tt, lineStartY: S }), f.models.addMessage(tt);
2225
+ } catch (S) {
2226
+ X.error("error while drawing message", S);
2227
+ }
2228
+ }
2229
+ [
2230
+ a.db.LINETYPE.SOLID_OPEN,
2231
+ a.db.LINETYPE.DOTTED_OPEN,
2232
+ a.db.LINETYPE.SOLID,
2233
+ a.db.LINETYPE.DOTTED,
2234
+ a.db.LINETYPE.SOLID_CROSS,
2235
+ a.db.LINETYPE.DOTTED_CROSS,
2236
+ a.db.LINETYPE.SOLID_POINT,
2237
+ a.db.LINETYPE.DOTTED_POINT,
2238
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2239
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED
2240
+ ].includes(T.type) && (q = q + Z), H++;
2241
+ }
2242
+ X.debug("createdActors", n), X.debug("destroyedActors", u), await jt(i, d, m, !1);
2243
+ for (const T of rt)
2244
+ await ua(i, T.messageModel, T.lineStartY, a);
2245
+ l.mirrorActors && await jt(i, d, m, !0), z.forEach((T) => C.drawBackgroundRect(i, T)), ne(i, d, m, l);
2246
+ for (const T of f.models.boxes) {
2247
+ T.height = f.getVerticalPos() - T.y, f.insert(T.x, T.y, T.x + T.width, T.height);
2248
+ const v = l.boxMargin * 2;
2249
+ T.startx = T.x - v, T.starty = T.y - v * 0.25, T.stopx = T.startx + T.width + 2 * v, T.stopy = T.starty + T.height + v * 0.75, T.stroke = "rgb(0,0,0, 0.5)", C.drawBox(i, T, l);
2250
+ }
2251
+ A && f.bumpVerticalPos(l.boxMargin);
2252
+ const F = de(i, d, m, g), { bounds: R } = f.getBounds();
2253
+ R.startx === void 0 && (R.startx = 0), R.starty === void 0 && (R.starty = 0), R.stopx === void 0 && (R.stopx = 0), R.stopy === void 0 && (R.stopy = 0);
2254
+ let Q = R.stopy - R.starty;
2255
+ Q < F.maxHeight && (Q = F.maxHeight);
2256
+ let j = Q + 2 * l.diagramMarginY;
2257
+ l.mirrorActors && (j = j - l.boxMargin + l.bottomMarginAdj);
2258
+ let J = R.stopx - R.startx;
2259
+ J < F.maxWidth && (J = F.maxWidth);
2260
+ const st = J + 2 * l.diagramMarginX;
2261
+ P && i.append("text").text(P).attr("x", (R.stopx - R.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), ke(i, j, st, l.useMaxWidth);
2262
+ const D = P ? 40 : 0;
2263
+ i.attr(
2264
+ "viewBox",
2265
+ R.startx - l.diagramMarginX + " -" + (l.diagramMarginY + D) + " " + st + " " + (j + D)
2266
+ ), X.debug("models:", f.models);
2267
+ }, "draw");
2268
+ async function ue(e, t, o) {
2269
+ const a = {};
2270
+ for (const r of t)
2271
+ if (e.get(r.to) && e.get(r.from)) {
2272
+ const s = e.get(r.to);
2273
+ if (r.placement === o.db.PLACEMENT.LEFTOF && !s.prevActor || r.placement === o.db.PLACEMENT.RIGHTOF && !s.nextActor)
2274
+ continue;
2275
+ const c = r.placement !== void 0, h = !c, g = c ? Et(l) : mt(l), i = r.wrap ? V.wrapLabel(r.message, l.width - 2 * l.wrapPadding, g) : r.message, d = (W(i) ? await kt(r.message, at()) : V.calculateTextDimensions(i, g)).width + 2 * l.wrapPadding;
2276
+ h && r.from === s.nextActor ? a[r.to] = L.getMax(
2277
+ a[r.to] || 0,
2278
+ d
2279
+ ) : h && r.from === s.prevActor ? a[r.from] = L.getMax(
2280
+ a[r.from] || 0,
2281
+ d
2282
+ ) : h && r.from === r.to ? (a[r.from] = L.getMax(
2283
+ a[r.from] || 0,
2284
+ d / 2
2285
+ ), a[r.to] = L.getMax(
2286
+ a[r.to] || 0,
2287
+ d / 2
2288
+ )) : r.placement === o.db.PLACEMENT.RIGHTOF ? a[r.from] = L.getMax(
2289
+ a[r.from] || 0,
2290
+ d
2291
+ ) : r.placement === o.db.PLACEMENT.LEFTOF ? a[s.prevActor] = L.getMax(
2292
+ a[s.prevActor] || 0,
2293
+ d
2294
+ ) : r.placement === o.db.PLACEMENT.OVER && (s.prevActor && (a[s.prevActor] = L.getMax(
2295
+ a[s.prevActor] || 0,
2296
+ d / 2
2297
+ )), s.nextActor && (a[r.from] = L.getMax(
2298
+ a[r.from] || 0,
2299
+ d / 2
2300
+ )));
2301
+ }
2302
+ return X.debug("maxMessageWidthPerActor:", a), a;
2303
+ }
2304
+ y(ue, "getMaxMessageWidthPerActor");
2305
+ var ba = /* @__PURE__ */ y(function(e) {
2306
+ let t = 0;
2307
+ const o = Ht(l);
2308
+ for (const a in e.links) {
2309
+ const r = V.calculateTextDimensions(a, o).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2310
+ t < r && (t = r);
2311
+ }
2312
+ return t;
2313
+ }, "getRequiredPopupWidth");
2314
+ async function xe(e, t, o) {
2315
+ let a = 0;
2316
+ for (const s of e.keys()) {
2317
+ const c = e.get(s);
2318
+ c.wrap && (c.description = V.wrapLabel(
2319
+ c.description,
2320
+ l.width - 2 * l.wrapPadding,
2321
+ Ht(l)
2322
+ ));
2323
+ const h = W(c.description) ? await kt(c.description, at()) : V.calculateTextDimensions(c.description, Ht(l));
2324
+ c.width = c.wrap ? l.width : L.getMax(l.width, h.width + 2 * l.wrapPadding), c.height = c.wrap ? L.getMax(h.height, l.height) : l.height, a = L.getMax(a, c.height);
2325
+ }
2326
+ for (const s in t) {
2327
+ const c = e.get(s);
2328
+ if (!c)
2329
+ continue;
2330
+ const h = e.get(c.nextActor);
2331
+ if (!h) {
2332
+ const i = t[s] + l.actorMargin - c.width / 2;
2333
+ c.margin = L.getMax(i, l.actorMargin);
2334
+ continue;
2335
+ }
2336
+ const g = t[s] + l.actorMargin - c.width / 2 - h.width / 2;
2337
+ c.margin = L.getMax(g, l.actorMargin);
2338
+ }
2339
+ let r = 0;
2340
+ return o.forEach((s) => {
2341
+ const c = mt(l);
2342
+ let h = s.actorKeys.reduce((n, u) => n += e.get(u).width + (e.get(u).margin || 0), 0);
2343
+ const g = l.boxMargin * 8;
2344
+ h += g, h -= 2 * l.boxTextMargin, s.wrap && (s.name = V.wrapLabel(s.name, h - 2 * l.wrapPadding, c));
2345
+ const i = V.calculateTextDimensions(s.name, c);
2346
+ r = L.getMax(i.height, r);
2347
+ const d = L.getMax(h, i.width + 2 * l.wrapPadding);
2348
+ if (s.margin = l.boxTextMargin, h < d) {
2349
+ const n = (d - h) / 2;
2350
+ s.margin += n;
2351
+ }
2352
+ }), o.forEach((s) => s.textMaxHeight = r), L.getMax(a, l.height);
2353
+ }
2354
+ y(xe, "calculateActorMargins");
2355
+ var fa = /* @__PURE__ */ y(async function(e, t, o) {
2356
+ const a = t.get(e.from), r = t.get(e.to), s = a.x, c = r.x, h = e.wrap && e.message;
2357
+ let g = W(e.message) ? await kt(e.message, at()) : V.calculateTextDimensions(
2358
+ h ? V.wrapLabel(e.message, l.width, Et(l)) : e.message,
2359
+ Et(l)
2360
+ );
2361
+ const i = {
2362
+ width: h ? l.width : L.getMax(l.width, g.width + 2 * l.noteMargin),
2363
+ height: 0,
2364
+ startx: a.x,
2365
+ stopx: 0,
2366
+ starty: 0,
2367
+ stopy: 0,
2368
+ message: e.message
2369
+ };
2370
+ return e.placement === o.db.PLACEMENT.RIGHTOF ? (i.width = h ? L.getMax(l.width, g.width) : L.getMax(
2371
+ a.width / 2 + r.width / 2,
2372
+ g.width + 2 * l.noteMargin
2373
+ ), i.startx = s + (a.width + l.actorMargin) / 2) : e.placement === o.db.PLACEMENT.LEFTOF ? (i.width = h ? L.getMax(l.width, g.width + 2 * l.noteMargin) : L.getMax(
2374
+ a.width / 2 + r.width / 2,
2375
+ g.width + 2 * l.noteMargin
2376
+ ), i.startx = s - i.width + (a.width - l.actorMargin) / 2) : e.to === e.from ? (g = V.calculateTextDimensions(
2377
+ h ? V.wrapLabel(e.message, L.getMax(l.width, a.width), Et(l)) : e.message,
2378
+ Et(l)
2379
+ ), i.width = h ? L.getMax(l.width, a.width) : L.getMax(a.width, l.width, g.width + 2 * l.noteMargin), i.startx = s + (a.width - i.width) / 2) : (i.width = Math.abs(s + a.width / 2 - (c + r.width / 2)) + l.actorMargin, i.startx = s < c ? s + a.width / 2 - l.actorMargin / 2 : c + r.width / 2 - l.actorMargin / 2), h && (i.message = V.wrapLabel(
2380
+ e.message,
2381
+ i.width - 2 * l.wrapPadding,
2382
+ Et(l)
2383
+ )), X.debug(
2384
+ `NM:[${i.startx},${i.stopx},${i.starty},${i.stopy}:${i.width},${i.height}=${e.message}]`
2385
+ ), i;
2386
+ }, "buildNoteModel"), ma = /* @__PURE__ */ y(function(e, t, o) {
2387
+ if (![
2388
+ o.db.LINETYPE.SOLID_OPEN,
2389
+ o.db.LINETYPE.DOTTED_OPEN,
2390
+ o.db.LINETYPE.SOLID,
2391
+ o.db.LINETYPE.DOTTED,
2392
+ o.db.LINETYPE.SOLID_CROSS,
2393
+ o.db.LINETYPE.DOTTED_CROSS,
2394
+ o.db.LINETYPE.SOLID_POINT,
2395
+ o.db.LINETYPE.DOTTED_POINT,
2396
+ o.db.LINETYPE.BIDIRECTIONAL_SOLID,
2397
+ o.db.LINETYPE.BIDIRECTIONAL_DOTTED
2398
+ ].includes(e.type))
2399
+ return {};
2400
+ const [a, r] = ae(e.from, t), [s, c] = ae(e.to, t), h = a <= s;
2401
+ let g = h ? r : a, i = h ? s : c;
2402
+ const d = Math.abs(s - c) > 2, n = /* @__PURE__ */ y((w) => h ? -w : w, "adjustValue");
2403
+ e.from === e.to ? i = g : (e.activate && !d && (i += n(l.activationWidth / 2 - 1)), [o.db.LINETYPE.SOLID_OPEN, o.db.LINETYPE.DOTTED_OPEN].includes(e.type) || (i += n(3)), [o.db.LINETYPE.BIDIRECTIONAL_SOLID, o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2404
+ e.type
2405
+ ) && (g -= n(3)));
2406
+ const u = [a, r, s, c], b = Math.abs(g - i);
2407
+ e.wrap && e.message && (e.message = V.wrapLabel(
2408
+ e.message,
2409
+ L.getMax(b + 2 * l.wrapPadding, l.width),
2410
+ mt(l)
2411
+ ));
2412
+ const m = V.calculateTextDimensions(e.message, mt(l));
2413
+ return {
2414
+ width: L.getMax(
2415
+ e.wrap ? 0 : m.width + 2 * l.wrapPadding,
2416
+ b + 2 * l.wrapPadding,
2417
+ l.width
2418
+ ),
2419
+ height: 0,
2420
+ startx: g,
2421
+ stopx: i,
2422
+ starty: 0,
2423
+ stopy: 0,
2424
+ message: e.message,
2425
+ type: e.type,
2426
+ wrap: e.wrap,
2427
+ fromBounds: Math.min.apply(null, u),
2428
+ toBounds: Math.max.apply(null, u)
2429
+ };
2430
+ }, "buildMessageModel"), Ta = /* @__PURE__ */ y(async function(e, t, o, a) {
2431
+ const r = {}, s = [];
2432
+ let c, h, g;
2433
+ for (const i of e) {
2434
+ switch (i.type) {
2435
+ case a.db.LINETYPE.LOOP_START:
2436
+ case a.db.LINETYPE.ALT_START:
2437
+ case a.db.LINETYPE.OPT_START:
2438
+ case a.db.LINETYPE.PAR_START:
2439
+ case a.db.LINETYPE.PAR_OVER_START:
2440
+ case a.db.LINETYPE.CRITICAL_START:
2441
+ case a.db.LINETYPE.BREAK_START:
2442
+ s.push({
2443
+ id: i.id,
2444
+ msg: i.message,
2445
+ from: Number.MAX_SAFE_INTEGER,
2446
+ to: Number.MIN_SAFE_INTEGER,
2447
+ width: 0
2448
+ });
2449
+ break;
2450
+ case a.db.LINETYPE.ALT_ELSE:
2451
+ case a.db.LINETYPE.PAR_AND:
2452
+ case a.db.LINETYPE.CRITICAL_OPTION:
2453
+ i.message && (c = s.pop(), r[c.id] = c, r[i.id] = c, s.push(c));
2454
+ break;
2455
+ case a.db.LINETYPE.LOOP_END:
2456
+ case a.db.LINETYPE.ALT_END:
2457
+ case a.db.LINETYPE.OPT_END:
2458
+ case a.db.LINETYPE.PAR_END:
2459
+ case a.db.LINETYPE.CRITICAL_END:
2460
+ case a.db.LINETYPE.BREAK_END:
2461
+ c = s.pop(), r[c.id] = c;
2462
+ break;
2463
+ case a.db.LINETYPE.ACTIVE_START:
2464
+ {
2465
+ const d = t.get(i.from ? i.from : i.to.actor), n = $t(i.from ? i.from : i.to.actor).length, u = d.x + d.width / 2 + (n - 1) * l.activationWidth / 2, b = {
2466
+ startx: u,
2467
+ stopx: u + l.activationWidth,
2468
+ actor: i.from,
2469
+ enabled: !0
2470
+ };
2471
+ f.activations.push(b);
2472
+ }
2473
+ break;
2474
+ case a.db.LINETYPE.ACTIVE_END:
2475
+ {
2476
+ const d = f.activations.map((n) => n.actor).lastIndexOf(i.from);
2477
+ f.activations.splice(d, 1).splice(0, 1);
2478
+ }
2479
+ break;
2480
+ }
2481
+ i.placement !== void 0 ? (h = await fa(i, t, a), i.noteModel = h, s.forEach((d) => {
2482
+ c = d, 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)) - l.labelBoxWidth;
2483
+ })) : (g = ma(i, t, a), i.msgModel = g, g.startx && g.stopx && s.length > 0 && s.forEach((d) => {
2484
+ if (c = d, g.startx === g.stopx) {
2485
+ const n = t.get(i.from), u = t.get(i.to);
2486
+ c.from = L.getMin(
2487
+ n.x - g.width / 2,
2488
+ n.x - n.width / 2,
2489
+ c.from
2490
+ ), c.to = L.getMax(
2491
+ u.x + g.width / 2,
2492
+ u.x + n.width / 2,
2493
+ c.to
2494
+ ), c.width = L.getMax(c.width, Math.abs(c.to - c.from)) - l.labelBoxWidth;
2495
+ } else
2496
+ c.from = L.getMin(g.startx, c.from), c.to = L.getMax(g.stopx, c.to), c.width = L.getMax(c.width, g.width) - l.labelBoxWidth;
2497
+ }));
2498
+ }
2499
+ return f.activations = [], X.debug("Loop type widths:", r), r;
2500
+ }, "calculateLoopBounds"), Ea = {
2501
+ bounds: f,
2502
+ drawActors: jt,
2503
+ drawActorsPopup: de,
2504
+ setConf: pe,
2505
+ draw: ya
2506
+ }, La = {
2507
+ parser: Ce,
2508
+ get db() {
2509
+ return new Fe();
2510
+ },
2511
+ renderer: Ea,
2512
+ styles: qe,
2513
+ init: /* @__PURE__ */ y((e) => {
2514
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, Ie({ sequence: { wrap: e.wrap } }));
2515
+ }, "init")
2516
+ };
2517
+ export {
2518
+ La as diagram
2519
+ };