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