hexagon-editor 0.1.5 → 0.1.7

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 (117) hide show
  1. package/README.md +44 -24
  2. package/dist/MarkdownEditor.vue.d.ts +28 -26
  3. package/dist/MarkdownEditor.vue.d.ts.map +1 -1
  4. package/dist/{MarkdownEditorLinkForm-C7CGgA83.js → MarkdownEditorLinkForm-B9dEX3WT.js} +1 -1
  5. package/dist/{base-Bnv2-Te4.js → base-BPdMUtQo.js} +141 -137
  6. package/dist/components/MarkdownEditorToolbar.vue.d.ts +4 -3
  7. package/dist/components/MarkdownEditorToolbar.vue.d.ts.map +1 -1
  8. package/dist/configure.d.ts +0 -2
  9. package/dist/configure.d.ts.map +1 -1
  10. package/dist/configure.js +11 -12
  11. package/dist/core/basic-editor-markdown.d.ts.map +1 -1
  12. package/dist/core/basic-editor-renderers.d.ts +6 -4
  13. package/dist/core/basic-editor-renderers.d.ts.map +1 -1
  14. package/dist/core/basic-editor-types.d.ts +2 -0
  15. package/dist/core/basic-editor-types.d.ts.map +1 -1
  16. package/dist/core/basic-editor.d.ts +1 -1
  17. package/dist/core/basic-editor.d.ts.map +1 -1
  18. package/dist/core/index.d.ts +0 -2
  19. package/dist/core/index.d.ts.map +1 -1
  20. package/dist/core.js +28 -31
  21. package/dist/extensions.js +1 -1
  22. package/dist/forms/MarkdownEditorImageForm.vue.d.ts +2 -2
  23. package/dist/forms/MarkdownEditorImageForm.vue.d.ts.map +1 -1
  24. package/dist/forms/MarkdownEditorLinkForm.vue.d.ts +2 -2
  25. package/dist/forms/MarkdownEditorTextInput.vue.d.ts +2 -2
  26. package/dist/forms/MarkdownEditorTextInput.vue.d.ts.map +1 -1
  27. package/dist/forms.js +1 -1
  28. package/dist/{full-C-o2lPBX.js → full-Da8esvj2.js} +1 -1
  29. package/dist/{full-specs-Cl-ODShc.js → full-specs-hXKoMF-0.js} +1 -1
  30. package/dist/index-D_CMntQU.js +3173 -0
  31. package/dist/index.css +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +240 -236
  35. package/dist/{markup-commands-B2NMfYHE.js → markup-commands-BYsx8ADT.js} +1989 -1963
  36. package/dist/presets.js +2 -2
  37. package/dist/public-types.d.ts +22 -0
  38. package/dist/public-types.d.ts.map +1 -1
  39. package/dist/renderer/MarkdownRenderer.vue.d.ts +2 -0
  40. package/dist/renderer/MarkdownRenderer.vue.d.ts.map +1 -1
  41. package/dist/renderer/markdown.d.ts +2 -1
  42. package/dist/renderer/markdown.d.ts.map +1 -1
  43. package/dist/renderer.css +1 -1
  44. package/dist/renderer.js +3590 -200
  45. package/package.json +106 -108
  46. package/dist/MarkdownEditorLinkForm.css +0 -1
  47. package/dist/abnfDiagram-N423BO3Z-DCf6sPky.js +0 -87
  48. package/dist/arc-y6UeoJpJ.js +0 -83
  49. package/dist/architectureDiagram-T3A2C74G-Cc3_3-cI.js +0 -4778
  50. package/dist/base.css +0 -1
  51. package/dist/blockDiagram-VBNYF7ZC-DWVLZwXY.js +0 -2419
  52. package/dist/c4Diagram-5PPSVZJV-CaIN7qay.js +0 -1577
  53. package/dist/channel-BwXGcavV.js +0 -5
  54. package/dist/chunk-2GRJ4B5K-O75udjPr.js +0 -68
  55. package/dist/chunk-2Q5K7J3B-CySL0lOA.js +0 -15
  56. package/dist/chunk-5RXB4S5H-BKPnLCOJ.js +0 -1408
  57. package/dist/chunk-5VM5RSS4--it1VJIv.js +0 -19
  58. package/dist/chunk-6Q2QTUOP-DNiML-50.js +0 -664
  59. package/dist/chunk-GF5L2VYU-z7A-k0-V.js +0 -1533
  60. package/dist/chunk-JWPE2WC7-DAjx3Kjr.js +0 -8
  61. package/dist/chunk-KBJHAD2P-D4R1VW0r.js +0 -19
  62. package/dist/chunk-RYQCIY6F-DmJAYxq8.js +0 -313
  63. package/dist/chunk-XXDRQBXY-CK913N-t.js +0 -8
  64. package/dist/classDiagram-JCYQIIEL-Djipq_HJ.js +0 -16
  65. package/dist/classDiagram-v2-OCEON4UE-Djipq_HJ.js +0 -16
  66. package/dist/core/optional-renderers.d.ts +0 -9
  67. package/dist/core/optional-renderers.d.ts.map +0 -1
  68. package/dist/cose-bilkent-JH36ORCC-CXuKFbXy.js +0 -2608
  69. package/dist/cynefin-VYW2F7L2-Bkk-F_Js.js +0 -23766
  70. package/dist/cynefinDiagram-MW4NZA55-DwOK40hm.js +0 -299
  71. package/dist/cytoscape.esm-3W4EOjxC.js +0 -18756
  72. package/dist/dagre-VZM6K2ZE-0VsGm8Ag.js +0 -340
  73. package/dist/defaultLocale-BgPVtth8.js +0 -171
  74. package/dist/diagram-7IWD3JNH-BrApu1hz.js +0 -350
  75. package/dist/diagram-B4RE2ZJO-CVXoBg2r.js +0 -461
  76. package/dist/diagram-LBJQPF4R-Dp0eSz2L.js +0 -142
  77. package/dist/diagram-Q27KOJAE-DWIltqIH.js +0 -528
  78. package/dist/diagram-UB23O5K3-B7z2Lj3K.js +0 -219
  79. package/dist/ebnfDiagram-BXEA7PRR-CYgE6z_2.js +0 -109
  80. package/dist/erDiagram-JOGREHBK-D3QWrPo-.js +0 -910
  81. package/dist/flowDiagram-UKHOOZJN-CfjPcHNW.js +0 -1638
  82. package/dist/ganttDiagram-PKOTCBZU-ECmaWI-9.js +0 -2711
  83. package/dist/gitGraphDiagram-DS77QQ5N-DgG1RGJ8.js +0 -815
  84. package/dist/graph-DAHC4kPm.js +0 -1545
  85. package/dist/infoDiagram-6WML65LV-B1Yl3nZV.js +0 -24
  86. package/dist/init-DjUOC4st.js +0 -16
  87. package/dist/ishikawaDiagram-WSZJBQD7-4sngaB5o.js +0 -621
  88. package/dist/journeyDiagram-NVQOT4AX-B_6AmR_j.js +0 -834
  89. package/dist/kanban-definition-27J2QSJJ-B8BO9o8J.js +0 -724
  90. package/dist/katex-ByXcxnHy.js +0 -14436
  91. package/dist/katex-DoRnZ_sp.js +0 -11682
  92. package/dist/layout-DBbo_M5I.js +0 -1519
  93. package/dist/linear-BEdRfKba.js +0 -259
  94. package/dist/map-DRdzG8Ho.js +0 -224
  95. package/dist/markup-commands.css +0 -1
  96. package/dist/mermaid.core-CR0bA2Wa.js +0 -16496
  97. package/dist/mindmap-definition-FAOFIHXS-DnPz807N.js +0 -827
  98. package/dist/optional-renderers-BalvqqvY.js +0 -11
  99. package/dist/ordinal-B6-f3MAq.js +0 -61
  100. package/dist/pegDiagram-VL7TDLO6-csGWlzs8.js +0 -95
  101. package/dist/pieDiagram-7S7Q4E2Y-Bqs8j5FX.js +0 -207
  102. package/dist/quadrantDiagram-CIZ2JOQS-jzP4lRrY.js +0 -1023
  103. package/dist/railroadDiagram-AXF67PYL-BSCyR24u.js +0 -77
  104. package/dist/renderer/mermaid-runtime.d.ts +0 -4
  105. package/dist/renderer/mermaid-runtime.d.ts.map +0 -1
  106. package/dist/requirementDiagram-LRYGKXZP-DmEkLYqX.js +0 -882
  107. package/dist/sankeyDiagram-W5VNT64P-CYvRYMTh.js +0 -847
  108. package/dist/sequenceDiagram-SI44F4Z6-CyWbDtPA.js +0 -2888
  109. package/dist/sizeCapture-X5ZJPWSS-xKhYCY84.js +0 -46
  110. package/dist/stateDiagram-OKZ733FA-DP44R2Dd.js +0 -263
  111. package/dist/stateDiagram-v2-UEYNNEHI-BvlOisND.js +0 -16
  112. package/dist/swimlanes-SLNWSIFB-BKFp8twH.js +0 -5332
  113. package/dist/swimlanesDiagram-ULZ7WXOC-CTvIFuHq.js +0 -13
  114. package/dist/timeline-definition-Z64GVDOM-B4137uIl.js +0 -1055
  115. package/dist/vennDiagram-T6HMQDX7-CPs8gXjx.js +0 -1578
  116. package/dist/wardleyDiagram-T6FBY63Y-BYp13hbI.js +0 -675
  117. package/dist/xychartDiagram-ELKLHX3M-DTT37K2u.js +0 -1388
@@ -1,2888 +0,0 @@
1
- import { I as er } from "./chunk-2Q5K7J3B-CySL0lOA.js";
2
- import { _ as x, F as rr, c as $, d as Yt, l as at, j as Me, e as ar, f as sr, k as N, b as De, s as ir, n as nr, a as or, g as cr, o as lr, G as hr, J as dr, p as Tr, i as Wt, x as Z, H as Q, I as kt, K as Be, Z as pr, y as Ft, L as Er, M as Ve } from "./mermaid.core-CR0bA2Wa.js";
3
- import { a as ur, b as se, g as dt, d as fr, c as ie, e as ne } from "./chunk-2GRJ4B5K-O75udjPr.js";
4
- var ee = (function() {
5
- var e = /* @__PURE__ */ x(function(ut, S, v, P) {
6
- for (v = v || {}, P = ut.length; P--; v[ut[P]] = S) ;
7
- return v;
8
- }, "o"), t = [1, 2], a = [1, 3], r = [1, 4], i = [2, 4], n = [1, 9], s = [1, 11], c = [1, 12], E = [1, 14], h = [1, 15], p = [1, 17], _ = [1, 18], u = [1, 19], O = [1, 25], T = [1, 26], g = [1, 27], f = [1, 28], I = [1, 29], L = [1, 30], b = [1, 31], w = [1, 32], A = [1, 33], D = [1, 34], M = [1, 35], V = [1, 36], W = [1, 37], U = [1, 38], G = [1, 39], X = [1, 40], nt = [1, 42], j = [1, 43], q = [1, 44], st = [1, 45], tt = [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], St = [1, 74], Dt = [1, 80], m = [1, 81], k = [1, 82], lt = [1, 83], et = [1, 84], K = [1, 85], Ot = [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], wt = [4, 5, 17, 51, 53, 54], vt = [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], Gt = [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], Xt = [5, 52], F = [70, 71, 72, 73], ot = [1, 151], Jt = {
9
- trace: /* @__PURE__ */ x(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__ */ x(function(S, v, P, y, z, o, Nt) {
16
- var d = o.length - 1;
17
- switch (z) {
18
- case 3:
19
- return y.apply(o[d]), o[d];
20
- case 4:
21
- case 10:
22
- this.$ = [];
23
- break;
24
- case 5:
25
- case 11:
26
- o[d - 1].push(o[d]), this.$ = o[d - 1];
27
- break;
28
- case 6:
29
- case 7:
30
- case 12:
31
- case 13:
32
- this.$ = o[d];
33
- break;
34
- case 8:
35
- case 9:
36
- case 14:
37
- this.$ = [];
38
- break;
39
- case 16:
40
- o[d].type = "createParticipant", this.$ = o[d];
41
- break;
42
- case 17:
43
- o[d - 1].unshift({ type: "boxStart", boxData: y.parseBoxData(o[d - 2]) }), o[d - 1].push({ type: "boxEnd", boxText: o[d - 2] }), this.$ = o[d - 1];
44
- break;
45
- case 19:
46
- this.$ = { type: "sequenceIndex", sequenceIndex: Number(o[d - 2]), sequenceIndexStep: Number(o[d - 1]), sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
47
- break;
48
- case 20:
49
- this.$ = { type: "sequenceIndex", sequenceIndex: Number(o[d - 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[d - 1].actor };
59
- break;
60
- case 24:
61
- this.$ = { type: "activeEnd", signalType: y.LINETYPE.ACTIVE_END, actor: o[d - 1].actor };
62
- break;
63
- case 30:
64
- y.setDiagramTitle(o[d].substring(6)), this.$ = o[d].substring(6);
65
- break;
66
- case 31:
67
- y.setDiagramTitle(o[d].substring(7)), this.$ = o[d].substring(7);
68
- break;
69
- case 32:
70
- this.$ = o[d].trim(), y.setAccTitle(this.$);
71
- break;
72
- case 33:
73
- case 34:
74
- this.$ = o[d].trim(), y.setAccDescription(this.$);
75
- break;
76
- case 35:
77
- o[d - 1].unshift({ type: "loopStart", loopText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.LOOP_START }), o[d - 1].push({ type: "loopEnd", loopText: o[d - 2], signalType: y.LINETYPE.LOOP_END }), this.$ = o[d - 1];
78
- break;
79
- case 36:
80
- o[d - 1].unshift({ type: "rectStart", color: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.RECT_START }), o[d - 1].push({ type: "rectEnd", color: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.RECT_END }), this.$ = o[d - 1];
81
- break;
82
- case 37:
83
- o[d - 1].unshift({ type: "optStart", optText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.OPT_START }), o[d - 1].push({ type: "optEnd", optText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.OPT_END }), this.$ = o[d - 1];
84
- break;
85
- case 38:
86
- o[d - 1].unshift({ type: "altStart", altText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.ALT_START }), o[d - 1].push({ type: "altEnd", signalType: y.LINETYPE.ALT_END }), this.$ = o[d - 1];
87
- break;
88
- case 39:
89
- o[d - 1].unshift({ type: "parStart", parText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.PAR_START }), o[d - 1].push({ type: "parEnd", signalType: y.LINETYPE.PAR_END }), this.$ = o[d - 1];
90
- break;
91
- case 40:
92
- o[d - 1].unshift({ type: "parStart", parText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.PAR_OVER_START }), o[d - 1].push({ type: "parEnd", signalType: y.LINETYPE.PAR_END }), this.$ = o[d - 1];
93
- break;
94
- case 41:
95
- o[d - 1].unshift({ type: "criticalStart", criticalText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.CRITICAL_START }), o[d - 1].push({ type: "criticalEnd", signalType: y.LINETYPE.CRITICAL_END }), this.$ = o[d - 1];
96
- break;
97
- case 42:
98
- o[d - 1].unshift({ type: "breakStart", breakText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.BREAK_START }), o[d - 1].push({ type: "breakEnd", optText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.BREAK_END }), this.$ = o[d - 1];
99
- break;
100
- case 44:
101
- this.$ = o[d - 3].concat([{ type: "option", optionText: y.parseMessage(o[d - 1]), signalType: y.LINETYPE.CRITICAL_OPTION }, o[d]]);
102
- break;
103
- case 46:
104
- this.$ = o[d - 3].concat([{ type: "and", parText: y.parseMessage(o[d - 1]), signalType: y.LINETYPE.PAR_AND }, o[d]]);
105
- break;
106
- case 48:
107
- this.$ = o[d - 3].concat([{ type: "else", altText: y.parseMessage(o[d - 1]), signalType: y.LINETYPE.ALT_ELSE }, o[d]]);
108
- break;
109
- case 49:
110
- o[d - 3].draw = "participant", o[d - 3].type = "addParticipant", o[d - 3].description = y.parseMessage(o[d - 1]), this.$ = o[d - 3];
111
- break;
112
- case 50:
113
- o[d - 1].draw = "participant", o[d - 1].type = "addParticipant", this.$ = o[d - 1];
114
- break;
115
- case 51:
116
- o[d - 3].draw = "actor", o[d - 3].type = "addParticipant", o[d - 3].description = y.parseMessage(o[d - 1]), this.$ = o[d - 3];
117
- break;
118
- case 52:
119
- case 57:
120
- o[d - 1].draw = "actor", o[d - 1].type = "addParticipant", this.$ = o[d - 1];
121
- break;
122
- case 53:
123
- o[d - 1].type = "destroyParticipant", this.$ = o[d - 1];
124
- break;
125
- case 54:
126
- o[d - 3].draw = "participant", o[d - 3].type = "addParticipant", o[d - 3].description = y.parseMessage(o[d - 1]), this.$ = o[d - 3];
127
- break;
128
- case 55:
129
- o[d - 1].draw = "participant", o[d - 1].type = "addParticipant", this.$ = o[d - 1];
130
- break;
131
- case 56:
132
- o[d - 3].draw = "actor", o[d - 3].type = "addParticipant", o[d - 3].description = y.parseMessage(o[d - 1]), this.$ = o[d - 3];
133
- break;
134
- case 58:
135
- this.$ = [o[d - 1], { type: "addNote", placement: o[d - 2], actor: o[d - 1].actor, text: o[d] }];
136
- break;
137
- case 59:
138
- o[d - 2] = [].concat(o[d - 1], o[d - 1]).slice(0, 2), o[d - 2][0] = o[d - 2][0].actor, o[d - 2][1] = o[d - 2][1].actor, this.$ = [o[d - 1], { type: "addNote", placement: y.PLACEMENT.OVER, actor: o[d - 2].slice(0, 2), text: o[d] }];
139
- break;
140
- case 60:
141
- this.$ = [o[d - 1], { type: "addLinks", actor: o[d - 1].actor, text: o[d] }];
142
- break;
143
- case 61:
144
- this.$ = [o[d - 1], { type: "addALink", actor: o[d - 1].actor, text: o[d] }];
145
- break;
146
- case 62:
147
- this.$ = [o[d - 1], { type: "addProperties", actor: o[d - 1].actor, text: o[d] }];
148
- break;
149
- case 63:
150
- this.$ = [o[d - 1], { type: "addDetails", actor: o[d - 1].actor, text: o[d] }];
151
- break;
152
- case 66:
153
- this.$ = [o[d - 2], o[d]];
154
- break;
155
- case 67:
156
- this.$ = o[d];
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[d - 4],
167
- o[d - 1],
168
- { type: "addMessage", from: o[d - 4].actor, to: o[d - 1].actor, signalType: o[d - 3], msg: o[d], activate: !0 },
169
- { type: "activeStart", signalType: y.LINETYPE.ACTIVE_START, actor: o[d - 1].actor }
170
- ];
171
- break;
172
- case 71:
173
- this.$ = [
174
- o[d - 4],
175
- o[d - 1],
176
- { type: "addMessage", from: o[d - 4].actor, to: o[d - 1].actor, signalType: o[d - 3], msg: o[d] },
177
- { type: "activeEnd", signalType: y.LINETYPE.ACTIVE_END, actor: o[d - 4].actor }
178
- ];
179
- break;
180
- case 72:
181
- this.$ = [
182
- o[d - 4],
183
- o[d - 1],
184
- { type: "addMessage", from: o[d - 4].actor, to: o[d - 1].actor, signalType: o[d - 3], msg: o[d], activate: !0, centralConnection: y.LINETYPE.CENTRAL_CONNECTION },
185
- { type: "centralConnection", signalType: y.LINETYPE.CENTRAL_CONNECTION, actor: o[d - 1].actor }
186
- ];
187
- break;
188
- case 73:
189
- this.$ = [
190
- o[d - 4],
191
- o[d - 1],
192
- { type: "addMessage", from: o[d - 4].actor, to: o[d - 1].actor, signalType: o[d - 2], msg: o[d], activate: !1, centralConnection: y.LINETYPE.CENTRAL_CONNECTION_REVERSE },
193
- { type: "centralConnectionReverse", signalType: y.LINETYPE.CENTRAL_CONNECTION_REVERSE, actor: o[d - 4].actor }
194
- ];
195
- break;
196
- case 74:
197
- this.$ = [
198
- o[d - 5],
199
- o[d - 1],
200
- { type: "addMessage", from: o[d - 5].actor, to: o[d - 1].actor, signalType: o[d - 3], msg: o[d], activate: !0, centralConnection: y.LINETYPE.CENTRAL_CONNECTION_DUAL },
201
- { type: "centralConnection", signalType: y.LINETYPE.CENTRAL_CONNECTION, actor: o[d - 1].actor },
202
- { type: "centralConnectionReverse", signalType: y.LINETYPE.CENTRAL_CONNECTION_REVERSE, actor: o[d - 5].actor }
203
- ];
204
- break;
205
- case 75:
206
- this.$ = [o[d - 3], o[d - 1], { type: "addMessage", from: o[d - 3].actor, to: o[d - 1].actor, signalType: o[d - 2], msg: o[d] }];
207
- break;
208
- case 76:
209
- this.$ = {
210
- type: "addParticipant",
211
- actor: o[d - 1],
212
- config: o[d]
213
- };
214
- break;
215
- case 77:
216
- this.$ = o[d - 1].trim();
217
- break;
218
- case 78:
219
- this.$ = { type: "addParticipant", actor: o[d] };
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[d].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: c, 13: 13, 14: E, 15: h, 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, e(C, [2, 5]), { 9: 48, 13: 13, 14: E, 15: h, 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 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: X }, { 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: St }, { 23: 75, 55: 76, 73: St }, { 23: 77, 73: Y }, { 69: 78, 72: [1, 79], 78: Dt, 79: m, 80: k, 81: lt, 82: et, 83: K, 84: Ot, 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(wt, [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(vt, i, { 7: 120 }), e(vt, i, { 7: 121 }), e(vt, i, { 7: 122 }), e(Ae, i, { 41: 123, 7: 124 }), e(Gt, i, { 43: 125, 7: 126 }), e(Gt, i, { 7: 126, 43: 127 }), e(Se, i, { 46: 128, 7: 129 }), e(vt, i, { 7: 130 }), { 5: [1, 132], 52: [1, 131] }, { 5: [1, 134], 52: [1, 133] }, e(Xt, 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: Dt, 79: m, 80: k, 81: lt, 82: et, 83: K, 84: Ot, 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(F, [2, 79]), e(F, [2, 80]), e(F, [2, 81]), e(F, [2, 82]), e(F, [2, 83]), e(F, [2, 84]), e(F, [2, 85]), e(F, [2, 86]), e(F, [2, 87]), e(F, [2, 88]), e(F, [2, 89]), e(F, [2, 90]), e(F, [2, 91]), e(F, [2, 92]), e(F, [2, 93]), e(F, [2, 94]), e(F, [2, 95]), e(F, [2, 96]), e(F, [2, 97]), e(F, [2, 98]), e(F, [2, 99]), e(F, [2, 100]), e(F, [2, 101]), e(F, [2, 102]), e(F, [2, 103]), e(F, [2, 104]), { 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: X }, { 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: c, 13: 13, 14: E, 15: h, 17: [1, 161], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [1, 162], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [1, 163], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 17: [1, 164] }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [2, 47], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 50: [1, 165], 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 17: [1, 166] }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [2, 45], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 49: [1, 167], 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 17: [1, 168] }, { 17: [1, 169] }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [2, 43], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 48: [1, 170], 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [1, 171], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 16: [1, 172] }, e(C, [2, 50]), { 16: [1, 173] }, e(C, [2, 55]), e(Xt, [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(wt, [2, 11]), { 13: 186, 51: U, 53: G, 54: X }, e(wt, [2, 13]), e(wt, [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(wt, [2, 12]), e(Ae, i, { 7: 124, 41: 201 }), e(Gt, i, { 7: 126, 43: 202 }), e(Se, i, { 7: 129, 46: 203 }), e(C, [2, 49]), e(C, [2, 54]), e(Xt, [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__ */ x(function(S, v) {
307
- if (v.recoverable)
308
- this.trace(S);
309
- else {
310
- var P = new Error(S);
311
- throw P.hash = v, P;
312
- }
313
- }, "parseError"),
314
- parse: /* @__PURE__ */ x(function(S) {
315
- var v = this, P = [0], y = [], z = [null], o = [], Nt = this.table, d = "", Mt = 0, we = 0, Qe = 2, Ne = 1, $e = o.slice.call(arguments, 1), J = Object.create(this.lexer), gt = { yy: {} };
316
- for (var Zt in this.yy)
317
- Object.prototype.hasOwnProperty.call(this.yy, Zt) && (gt.yy[Zt] = this.yy[Zt]);
318
- J.setInput(S, gt.yy), gt.yy.lexer = J, gt.yy.parser = this, typeof J.yylloc > "u" && (J.yylloc = {});
319
- var Qt = J.yylloc;
320
- o.push(Qt);
321
- var je = J.options && J.options.ranges;
322
- typeof gt.yy.parseError == "function" ? this.parseError = gt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
323
- function tr(it) {
324
- P.length = P.length - 2 * it, z.length = z.length - it, o.length = o.length - it;
325
- }
326
- x(tr, "popStack");
327
- function Pe() {
328
- var it;
329
- return it = y.pop() || J.lex() || Ne, typeof it != "number" && (it instanceof Array && (y = it, it = y.pop()), it = v.symbols_[it] || it), it;
330
- }
331
- x(Pe, "lex");
332
- for (var rt, xt, ct, $t, Lt = {}, Bt, Tt, ke, Vt; ; ) {
333
- if (xt = P[P.length - 1], this.defaultActions[xt] ? ct = this.defaultActions[xt] : ((rt === null || typeof rt > "u") && (rt = Pe()), ct = Nt[xt] && Nt[xt][rt]), typeof ct > "u" || !ct.length || !ct[0]) {
334
- var jt = "";
335
- Vt = [];
336
- for (Bt in Nt[xt])
337
- this.terminals_[Bt] && Bt > Qe && Vt.push("'" + this.terminals_[Bt] + "'");
338
- J.showPosition ? jt = "Parse error on line " + (Mt + 1) + `:
339
- ` + J.showPosition() + `
340
- Expecting ` + Vt.join(", ") + ", got '" + (this.terminals_[rt] || rt) + "'" : jt = "Parse error on line " + (Mt + 1) + ": Unexpected " + (rt == Ne ? "end of input" : "'" + (this.terminals_[rt] || rt) + "'"), this.parseError(jt, {
341
- text: J.match,
342
- token: this.terminals_[rt] || rt,
343
- line: J.yylineno,
344
- loc: Qt,
345
- expected: Vt
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
- P.push(rt), z.push(J.yytext), o.push(J.yylloc), P.push(ct[1]), rt = null, we = J.yyleng, d = J.yytext, Mt = J.yylineno, Qt = J.yylloc;
353
- break;
354
- case 2:
355
- if (Tt = this.productions_[ct[1]][1], Lt.$ = z[z.length - Tt], Lt._$ = {
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 && (Lt._$.range = [
361
- o[o.length - (Tt || 1)].range[0],
362
- o[o.length - 1].range[1]
363
- ]), $t = this.performAction.apply(Lt, [
364
- d,
365
- we,
366
- Mt,
367
- gt.yy,
368
- ct[1],
369
- z,
370
- o
371
- ].concat($e)), typeof $t < "u")
372
- return $t;
373
- Tt && (P = P.slice(0, -1 * Tt * 2), z = z.slice(0, -1 * Tt), o = o.slice(0, -1 * Tt)), P.push(this.productions_[ct[1]][0]), z.push(Lt.$), o.push(Lt._$), ke = Nt[P[P.length - 2]][P[P.length - 1]], P.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__ */ x(function(v, P) {
385
- if (this.yy.parser)
386
- this.yy.parser.parseError(v, P);
387
- else
388
- throw new Error(v);
389
- }, "parseError"),
390
- // resets the lexer, sets new input
391
- setInput: /* @__PURE__ */ x(function(S, v) {
392
- return this.yy = v || this.yy || {}, this._input = S, 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__ */ x(function() {
401
- var S = this._input[0];
402
- this.yytext += S, this.yyleng++, this.offset++, this.match += S, this.matched += S;
403
- var v = S.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), S;
405
- }, "input"),
406
- // unshifts one char (or a string) into the input
407
- unput: /* @__PURE__ */ x(function(S) {
408
- var v = S.length, P = S.split(/(?:\r\n?|\n)/g);
409
- this._input = S + 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), P.length - 1 && (this.yylineno -= P.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: P ? (P.length === y.length ? this.yylloc.first_column : 0) + y[y.length - P.length].length - P[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__ */ x(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__ */ x(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__ */ x(function(S) {
439
- this.unput(this.match.slice(S));
440
- }, "less"),
441
- // displays already matched input, i.e. for error messages
442
- pastInput: /* @__PURE__ */ x(function() {
443
- var S = this.matched.substr(0, this.matched.length - this.match.length);
444
- return (S.length > 20 ? "..." : "") + S.substr(-20).replace(/\n/g, "");
445
- }, "pastInput"),
446
- // displays upcoming input, i.e. for error messages
447
- upcomingInput: /* @__PURE__ */ x(function() {
448
- var S = this.match;
449
- return S.length < 20 && (S += this._input.substr(0, 20 - S.length)), (S.substr(0, 20) + (S.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__ */ x(function() {
453
- var S = this.pastInput(), v = new Array(S.length + 1).join("-");
454
- return S + this.upcomingInput() + `
455
- ` + v + "^";
456
- }, "showPosition"),
457
- // test the lexed token: return FALSE when not a match, otherwise return token
458
- test_match: /* @__PURE__ */ x(function(S, v) {
459
- var P, 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 = S[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 + S[0].length
484
- }, this.yytext += S[0], this.match += S[0], this.matches = S, 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(S[0].length), this.matched += S[0], P = this.performAction.call(this, this.yy, this, v, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), P)
485
- return P;
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__ */ x(function() {
495
- if (this.done)
496
- return this.EOF;
497
- this._input || (this.done = !0);
498
- var S, v, P, y;
499
- this._more || (this.yytext = "", this.match = "");
500
- for (var z = this._currentRules(), o = 0; o < z.length; o++)
501
- if (P = this._input.match(this.rules[z[o]]), P && (!v || P[0].length > v[0].length)) {
502
- if (v = P, y = o, this.options.backtrack_lexer) {
503
- if (S = this.test_match(P, z[o]), S !== !1)
504
- return S;
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 ? (S = this.test_match(v, z[y]), S !== !1 ? S : !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__ */ x(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__ */ x(function(v) {
527
- this.conditionStack.push(v);
528
- }, "begin"),
529
- // pop the previously active lexer condition state off the condition stack
530
- popState: /* @__PURE__ */ x(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__ */ x(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__ */ x(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__ */ x(function(v) {
544
- this.begin(v);
545
- }, "pushState"),
546
- // return the number of states currently on the stack
547
- stateStackSize: /* @__PURE__ */ x(function() {
548
- return this.conditionStack.length;
549
- }, "stateStackSize"),
550
- options: { "case-insensitive": !0 },
551
- performAction: /* @__PURE__ */ x(function(v, P, 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 P.yytext = P.yytext.trim(), 73;
577
- case 12:
578
- return P.yytext = P.yytext.trim(), this.begin("ALIAS"), 73;
579
- case 13:
580
- return P.yytext = P.yytext.trim(), this.popState(), 73;
581
- case 14:
582
- return this.popState(), 10;
583
- case 15:
584
- return P.yytext = P.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 P.yytext = P.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]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \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
- Jt.lexer = Ze;
751
- function Ct() {
752
- this.yy = {};
753
- }
754
- return x(Ct, "Parser"), Ct.prototype = Jt, Jt.Parser = Ct, new Ct();
755
- })();
756
- ee.parser = ee;
757
- var _r = ee, 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
- }, Kt = {
817
- ACTOR: "actor",
818
- CONTROL: "control",
819
- DATABASE: "database",
820
- ENTITY: "entity"
821
- }, mt, yr = (mt = class {
822
- constructor() {
823
- this.state = new er(() => ({
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 = ir, this.setDiagramTitle = nr, this.getAccTitle = or, this.getAccDescription = cr, this.getDiagramTitle = lr, 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, c;
848
- if (n !== void 0) {
849
- let h;
850
- n.includes(`
851
- `) ? h = n + `
852
- ` : h = `{
853
- ` + n + `
854
- }`, c = hr(h, { schema: dr });
855
- }
856
- i = c?.type ?? i, c?.alias && (!r || r.text === a) && (r = { text: c.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 h = this.state.records.actors.get(this.state.records.prevActor);
879
- h && (h.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(), Tr();
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 c = new Option().style;
992
- c.color = r, c.color !== r && (r = "transparent", i = t.trim());
993
- }
994
- const { wrap: n, cleanedText: s } = this.extractWrap(i);
995
- return {
996
- text: s ? Wt(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 = Wt(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 = Wt(a.text, $());
1034
- const s = n.indexOf("@");
1035
- n = n.replace(/&equals;/g, "="), n = n.replace(/&amp;/g, "&");
1036
- const c = n.slice(0, s - 1).trim(), E = n.slice(s + 1).trim();
1037
- i[c] = 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 = Wt(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
- }, x(mt, "SequenceDB"), mt), Rr = /* @__PURE__ */ x((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
- .sectionTitle, .sectionTitle > tspan {
1315
- fill: ${e.loopTextColor};
1316
- stroke: none;
1317
- }
1318
-
1319
- .loopLine {
1320
- stroke-width: 2px;
1321
- stroke-dasharray: 2, 2;
1322
- stroke: ${e.labelBoxBorderColor};
1323
- fill: ${e.labelBoxBorderColor};
1324
- }
1325
-
1326
- .note {
1327
- //stroke: #decc93;
1328
- stroke: ${e.noteBorderColor};
1329
- fill: ${e.noteBkgColor};
1330
- }
1331
-
1332
- .noteText, .noteText > tspan {
1333
- fill: ${e.noteTextColor};
1334
- stroke: none;
1335
- ${e.noteFontWeight ? `font-weight: ${e.noteFontWeight};` : ""}
1336
- }
1337
-
1338
- .activation0 {
1339
- fill: ${e.activationBkgColor};
1340
- stroke: ${e.activationBorderColor};
1341
- }
1342
-
1343
- .activation1 {
1344
- fill: ${e.activationBkgColor};
1345
- stroke: ${e.activationBorderColor};
1346
- }
1347
-
1348
- .activation2 {
1349
- fill: ${e.activationBkgColor};
1350
- stroke: ${e.activationBorderColor};
1351
- }
1352
-
1353
- .actorPopupMenu {
1354
- position: absolute;
1355
- }
1356
-
1357
- .actorPopupMenuPanel {
1358
- position: absolute;
1359
- fill: ${e.actorBkg};
1360
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1361
- filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1362
- }
1363
- .actor-man circle, line {
1364
- fill: ${e.actorBkg};
1365
- stroke-width: 2px;
1366
- }
1367
-
1368
- g rect.rect {
1369
- filter: ${t};
1370
- stroke: ${e.nodeBorder};
1371
- }
1372
- `;
1373
- }, "getStyles"), Or = Rr, It = 36, ft = "actor-top", _t = "actor-bottom", qt = "actor-box", yt = "actor-man", pt = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Pt = /* @__PURE__ */ x(function(e, t) {
1374
- const a = fr(e, t);
1375
- return Ft().look === "neo" && a.attr("data-look", "neo"), a;
1376
- }, "drawRect"), Lr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1377
- if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1378
- return { height: 0, width: 0 };
1379
- const n = t.links, s = t.actorCnt, c = t.rectData;
1380
- var E = "none";
1381
- i && (E = "block !important");
1382
- const h = e.append("g");
1383
- h.attr("id", "actor" + s + "_popup"), h.attr("class", "actorPopupMenu"), h.attr("display", E);
1384
- var p = "";
1385
- c.class !== void 0 && (p = " " + c.class);
1386
- let _ = c.width > a ? c.width : a;
1387
- const u = h.append("rect");
1388
- if (u.attr("class", "actorPopupMenuPanel" + p), u.attr("x", c.x), u.attr("y", c.height), u.attr("fill", c.fill), u.attr("stroke", c.stroke), u.attr("width", _), u.attr("height", c.height), u.attr("rx", c.rx), u.attr("ry", c.ry), n != null) {
1389
- var O = 20;
1390
- for (let f in n) {
1391
- var T = h.append("a"), g = Me.sanitizeUrl(n[f]);
1392
- T.attr("xlink:href", g), T.attr("target", "_blank"), Gr(r)(
1393
- f,
1394
- T,
1395
- c.x + 10,
1396
- c.height + O,
1397
- _,
1398
- 20,
1399
- { class: "actor" },
1400
- r
1401
- ), O += 30;
1402
- }
1403
- }
1404
- return u.attr("height", O), { height: c.height + O, width: _ };
1405
- }, "drawPopup"), zt = /* @__PURE__ */ x(function(e) {
1406
- return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1407
- }, "popupMenuToggle"), Ht = /* @__PURE__ */ x(async function(e, t, a = null) {
1408
- let r = e.append("foreignObject");
1409
- const i = await Ve(t.text, Ft()), s = r.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();
1410
- if (r.attr("height", Math.round(s.height)).attr("width", Math.round(s.width)), t.class === "noteText") {
1411
- const c = e.node().firstChild;
1412
- c.setAttribute("height", s.height + 2 * t.textMargin);
1413
- const E = c.getBBox();
1414
- 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));
1415
- } else if (a) {
1416
- let { startx: c, stopx: E, starty: h } = a;
1417
- if (c > E) {
1418
- const p = c;
1419
- c = E, E = p;
1420
- }
1421
- r.attr("x", Math.round(c + Math.abs(c - E) / 2 - s.width / 2)), t.class === "loopText" ? r.attr("y", Math.round(h)) : r.attr("y", Math.round(h - s.height));
1422
- }
1423
- return [r];
1424
- }, "drawKatex"), At = /* @__PURE__ */ x(function(e, t) {
1425
- let a = 0, r = 0;
1426
- const i = t.text.split(N.lineBreakRegex), [n, s] = Be(t.fontSize);
1427
- let c = [], E = 0, h = /* @__PURE__ */ x(() => t.y, "yfunc");
1428
- if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1429
- switch (t.valign) {
1430
- case "top":
1431
- case "start":
1432
- h = /* @__PURE__ */ x(() => Math.round(t.y + t.textMargin), "yfunc");
1433
- break;
1434
- case "middle":
1435
- case "center":
1436
- h = /* @__PURE__ */ x(() => Math.round(t.y + (a + r + t.textMargin) / 2), "yfunc");
1437
- break;
1438
- case "bottom":
1439
- case "end":
1440
- h = /* @__PURE__ */ x(() => Math.round(
1441
- t.y + (a + r + 2 * t.textMargin) - t.textMargin
1442
- ), "yfunc");
1443
- break;
1444
- }
1445
- if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1446
- switch (t.anchor) {
1447
- case "left":
1448
- case "start":
1449
- t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1450
- break;
1451
- case "middle":
1452
- case "center":
1453
- t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1454
- break;
1455
- case "right":
1456
- case "end":
1457
- t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1458
- break;
1459
- }
1460
- for (let [p, _] of i.entries()) {
1461
- t.textMargin !== void 0 && t.textMargin === 0 && n !== void 0 && (E = p * n);
1462
- const u = e.append("text");
1463
- u.attr("x", t.x), u.attr("y", h()), 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);
1464
- const O = _ || pr;
1465
- if (t.tspan) {
1466
- const T = u.append("tspan");
1467
- T.attr("x", t.x), t.fill !== void 0 && T.attr("fill", t.fill), T.text(O);
1468
- } else
1469
- u.text(O);
1470
- t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (r += (u._groups || u)[0][0].getBBox().height, a = r), c.push(u);
1471
- }
1472
- return c;
1473
- }, "drawText"), Ye = /* @__PURE__ */ x(function(e, t) {
1474
- function a(i, n, s, c, E) {
1475
- return i + "," + n + " " + (i + s) + "," + n + " " + (i + s) + "," + (n + c - E) + " " + (i + s - E * 1.2) + "," + (n + c) + " " + i + "," + (n + c);
1476
- }
1477
- x(a, "genPoints");
1478
- const r = e.append("polygon");
1479
- 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, At(e, t), r;
1480
- }, "drawLabel"), B = -1, We = /* @__PURE__ */ x((e, t, a, r) => {
1481
- e.select && a.forEach((i) => {
1482
- const n = t.get(i), s = e.select("#actor" + n.actorCnt);
1483
- !r.mirrorActors && n.stopy ? s.attr("y2", n.stopy + n.height / 2) : r.mirrorActors && s.attr("y2", n.stopy);
1484
- });
1485
- }, "fixLifeLineHeights"), br = /* @__PURE__ */ x(function(e, t, a, r, i) {
1486
- const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + t.height, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u } = p, O = e.append("g").lower();
1487
- var T = O;
1488
- r || (B++, Object.keys(t.links || {}).length && !a.forceMenus && T.attr("onclick", zt(`actor${B}_popup`)).attr("cursor", "pointer"), T.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), T = O.append("g"), t.actorCnt = B, t.links != null && T.attr("id", "root-" + B), E === "neo" && T.attr("data-look", "neo"));
1489
- const g = dt();
1490
- var f = "actor";
1491
- t.properties?.class ? f = t.properties.class : g.fill = "#eaeaea", r ? f += ` ${_t}` : f += ` ${ft}`, g.x = t.x, g.y = n, g.width = t.width, g.height = t.height, g.class = f, g.rx = 3, g.ry = 3, g.name = t.name, E === "neo" && (g.rx = 6, g.ry = 6);
1492
- const I = Pt(T, g), L = i.get(t.name) ?? 0;
1493
- if (pt.has(h) && (I.style("stroke", u[L % u.length]), I.style("fill", _[L % u.length])), E === "neo" && I.attr("filter", "url(#drop-shadow)"), t.rectData = g, t.properties?.icon) {
1494
- const w = t.properties.icon.trim();
1495
- w.charAt(0) === "@" ? ie(T, g.x + g.width - 20, g.y + 10, w.substr(1)) : ne(T, g.x + g.width - 20, g.y + 10, w);
1496
- }
1497
- r || (T.attr("data-et", "participant"), T.attr("data-type", "participant"), T.attr("data-id", t.name)), Et(a, Q(t.description))(
1498
- t.description,
1499
- T,
1500
- g.x,
1501
- g.y,
1502
- g.width,
1503
- g.height,
1504
- { class: `actor ${qt}` },
1505
- a
1506
- );
1507
- let b = t.height;
1508
- if (I.node) {
1509
- const w = I.node().getBBox();
1510
- t.height = w.height, b = w.height;
1511
- }
1512
- return b;
1513
- }, "drawActorTypeParticipant"), mr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1514
- const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + t.height, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u } = p, O = e.append("g").lower();
1515
- var T = O;
1516
- r || (B++, Object.keys(t.links || {}).length && !a.forceMenus && T.attr("onclick", zt(`actor${B}_popup`)).attr("cursor", "pointer"), T.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), T = O.append("g"), t.actorCnt = B, t.links != null && T.attr("id", "root-" + B), E === "neo" && T.attr("data-look", "neo"));
1517
- const g = dt();
1518
- var f = "actor";
1519
- t.properties?.class ? f = t.properties.class : g.fill = "#eaeaea", r ? f += ` ${_t}` : f += ` ${ft}`, g.x = t.x, g.y = n, g.width = t.width, g.height = t.height, g.class = f, g.name = t.name;
1520
- const I = 6, L = {
1521
- ...g,
1522
- x: g.x + -I,
1523
- y: g.y + +I,
1524
- class: "actor"
1525
- }, b = Pt(T, g), w = Pt(T, L);
1526
- t.rectData = g, E === "neo" && T.attr("filter", "url(#drop-shadow)");
1527
- const A = i.get(t.name) ?? 0;
1528
- if (pt.has(h) && (b.style("stroke", u[A % u.length]), b.style("fill", _[A % u.length]), w.style("stroke", u[A % u.length]), w.style("fill", _[A % u.length])), t.properties?.icon) {
1529
- const M = t.properties.icon.trim();
1530
- M.charAt(0) === "@" ? ie(T, g.x + g.width - 20, g.y + 10, M.substr(1)) : ne(T, g.x + g.width - 20, g.y + 10, M);
1531
- }
1532
- Et(a, Q(t.description))(
1533
- t.description,
1534
- T,
1535
- g.x - I,
1536
- g.y + I,
1537
- g.width,
1538
- g.height,
1539
- { class: `actor ${qt}` },
1540
- a
1541
- );
1542
- let D = t.height;
1543
- if (b.node) {
1544
- const M = b.node().getBBox();
1545
- t.height = M.height, D = M.height;
1546
- }
1547
- return r || (T.attr("data-et", "participant"), T.attr("data-type", "collections"), T.attr("data-id", t.name)), D;
1548
- }, "drawActorTypeCollections"), Ar = /* @__PURE__ */ x(function(e, t, a, r, i) {
1549
- const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + t.height, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u } = p, O = e.append("g").lower();
1550
- let T = O;
1551
- r || (B++, Object.keys(t.links || {}).length && !a.forceMenus && T.attr("onclick", zt(`actor${B}_popup`)).attr("cursor", "pointer"), T.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), T = O.append("g"), t.actorCnt = B, t.links != null && T.attr("id", "root-" + B), E === "neo" && T.attr("data-look", "neo"));
1552
- const g = dt();
1553
- let f = "actor";
1554
- t.properties?.class ? f = t.properties.class : g.fill = "#eaeaea", r ? f += ` ${_t}` : f += ` ${ft}`, T.attr("class", f), g.x = t.x, g.y = n, g.width = t.width, g.height = t.height, g.name = t.name;
1555
- const I = g.height / 2, L = I / (2.5 + g.height / 50), b = T.append("g"), w = T.append("g"), A = `M ${g.x},${g.y + I}
1556
- a ${L},${I} 0 0 0 0,${g.height}
1557
- h ${g.width - 2 * L}
1558
- a ${L},${I} 0 0 0 0,-${g.height}
1559
- Z
1560
- `;
1561
- b.append("path").attr("d", A), w.append("path").attr(
1562
- "d",
1563
- `M ${g.x},${g.y + I}
1564
- a ${L},${I} 0 0 0 0,${g.height}`
1565
- ), b.attr("transform", `translate(${L}, ${-(g.height / 2)})`), w.attr("transform", `translate(${g.width - L}, ${-g.height / 2})`), t.rectData = g, E === "neo" && b.attr("filter", "url(#drop-shadow)");
1566
- const D = i.get(t.name) ?? 0;
1567
- if (pt.has(h) && (b.style("stroke", u[D % u.length]), b.style("fill", _[D % u.length]), w.style("stroke", u[D % u.length]), w.style("fill", _[D % u.length])), t.properties?.icon) {
1568
- const W = t.properties.icon.trim(), U = g.x + g.width - 20, G = g.y + 10;
1569
- W.charAt(0) === "@" ? ie(T, U, G, W.substr(1)) : ne(T, U, G, W);
1570
- }
1571
- Et(a, Q(t.description))(
1572
- t.description,
1573
- T,
1574
- g.x,
1575
- g.y,
1576
- g.width,
1577
- g.height,
1578
- { class: `actor ${qt}` },
1579
- a
1580
- );
1581
- let M = t.height;
1582
- const V = b.select("path:last-child");
1583
- if (V.node()) {
1584
- const W = V.node().getBBox();
1585
- t.height = W.height, M = W.height;
1586
- }
1587
- return r || (T.attr("data-et", "participant"), T.attr("data-type", "queue"), T.attr("data-id", t.name)), M;
1588
- }, "drawActorTypeQueue"), Sr = /* @__PURE__ */ x(function(e, t, a, r, i, n) {
1589
- const s = r ? t.stopy : t.starty, c = t.x + t.width / 2, E = s + 75, { look: h, theme: p, themeVariables: _ } = a, { bkgColorArray: u, borderColorArray: O, actorBorder: T, actorBkg: g } = _, f = e.append("g").lower();
1590
- r || (B++, f.append("line").attr("id", "actor" + B).attr("x1", c).attr("y1", E).attr("x2", c).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 = B);
1591
- const I = e.append("g");
1592
- let L = yt;
1593
- r ? L += ` ${_t}` : L += ` ${ft}`, I.attr("class", L), I.attr("name", t.name);
1594
- const b = dt();
1595
- b.x = t.x, b.y = s, b.fill = "#eaeaea", b.width = t.width, b.height = t.height, b.class = "actor";
1596
- const w = t.x + t.width / 2, A = s + 32, D = 22;
1597
- 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", w).attr("cy", A).attr("r", D).attr("filter", `${h === "neo" ? "url(#drop-shadow)" : ""}`), I.append("line").attr("marker-end", "url(#" + i + "-filled-head-control)").attr("transform", `translate(${w}, ${A - D})`);
1598
- const M = n.get(t.name) ?? 0;
1599
- pt.has(p) ? (I.style("stroke", O[M % O.length]), I.style("fill", u[M % O.length])) : (I.style("stroke", T), I.style("fill", g));
1600
- const V = I.node().getBBox();
1601
- return t.height = V.height + 2 * (a?.sequence?.labelBoxHeight ?? 0), Et(a, Q(t.description))(
1602
- t.description,
1603
- I,
1604
- b.x,
1605
- b.y + D + (r ? 5 : 12),
1606
- b.width,
1607
- b.height,
1608
- { class: `actor ${yt}` },
1609
- a
1610
- ), r || (I.attr("data-et", "participant"), I.attr("data-type", "control"), I.attr("data-id", t.name)), t.height;
1611
- }, "drawActorTypeControl"), wr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1612
- const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + 75, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u } = p, O = e.append("g").lower(), T = e.append("g");
1613
- let g = "actor";
1614
- r ? g += ` ${_t}` : g += ` ${ft}`, T.attr("class", g), T.attr("name", t.name);
1615
- const f = dt();
1616
- f.x = t.x, f.y = n, f.fill = "#eaeaea", f.width = t.width, f.height = t.height, f.class = "actor";
1617
- const I = t.x + t.width / 2, L = n + (r ? 10 : 25), b = 22;
1618
- T.append("circle").attr("cx", I).attr("cy", L).attr("r", b).attr("width", t.width).attr("height", t.height), T.append("line").attr("x1", I - b).attr("x2", I + b).attr("y1", L + b).attr("y2", L + b).attr("stroke-width", 2), E === "neo" && T.attr("filter", "url(#drop-shadow)");
1619
- const w = i.get(t.name) ?? 0;
1620
- pt.has(h) && (T.style("stroke", u[w % u.length]), T.style("fill", _[w % u.length]));
1621
- const A = T.node().getBBox();
1622
- return t.height = A.height + (a?.sequence?.labelBoxHeight ?? 0), r || (B++, O.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = B), Et(a, Q(t.description))(
1623
- t.description,
1624
- T,
1625
- f.x,
1626
- f.y + (r ? 15 : 30),
1627
- f.width,
1628
- f.height,
1629
- { class: `actor ${yt}` },
1630
- a
1631
- ), r ? T.attr("transform", `translate(0, ${b})`) : (T.attr("transform", `translate(0, ${b / 2 - 5})`), T.attr("data-et", "participant"), T.attr("data-type", "entity"), T.attr("data-id", t.name)), t.height;
1632
- }, "drawActorTypeEntity"), Nr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1633
- const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + t.height + 2 * a.boxTextMargin, { theme: E, themeVariables: h, look: p } = a, { bkgColorArray: _, borderColorArray: u, actorBorder: O } = h, T = e.append("g").lower();
1634
- let g = T;
1635
- r || (B++, Object.keys(t.links || {}).length && !a.forceMenus && g.attr("onclick", zt(`actor${B}_popup`)).attr("cursor", "pointer"), g.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), g = T.append("g"), t.actorCnt = B, t.links != null && g.attr("id", "root-" + B), p === "neo" && g.attr("data-look", "neo"));
1636
- const f = dt();
1637
- let I = "actor";
1638
- t.properties?.class ? I = t.properties.class : f.fill = "#eaeaea", r ? I += ` ${_t}` : I += ` ${ft}`, f.x = t.x, f.y = n, f.width = t.width, f.height = t.height, f.class = I, f.name = t.name, f.x = t.x, f.y = n;
1639
- const L = f.width / 3, b = f.width / 3, w = L / 2, A = w / (2.5 + L / 50), D = g.append("g");
1640
- D.attr("class", I);
1641
- const M = `
1642
- M ${f.x},${f.y + A}
1643
- a ${w},${A} 0 0 0 ${L},0
1644
- a ${w},${A} 0 0 0 -${L},0
1645
- l 0,${b - 2 * A}
1646
- a ${w},${A} 0 0 0 ${L},0
1647
- l 0,-${b - 2 * A}
1648
- `;
1649
- D.append("path").attr("d", M), p === "neo" && D.attr("filter", "url(#drop-shadow)");
1650
- const V = i.get(t.name) ?? 0;
1651
- pt.has(E) ? (D.style("stroke", u[V % u.length]), D.style("fill", _[V % u.length])) : D.style("stroke", O), D.attr("transform", `translate(${L}, ${A})`), t.rectData = f, Et(a, Q(t.description))(
1652
- t.description,
1653
- g,
1654
- f.x,
1655
- f.y + 35,
1656
- f.width,
1657
- f.height,
1658
- { class: `actor ${qt}` },
1659
- a
1660
- );
1661
- const W = D.select("path:last-child");
1662
- if (W.node()) {
1663
- const U = W.node().getBBox();
1664
- t.height = U.height + (a.sequence.labelBoxHeight ?? 0);
1665
- }
1666
- return r || (g.attr("data-et", "participant"), g.attr("data-type", "database"), g.attr("data-id", t.name)), t.height;
1667
- }, "drawActorTypeDatabase"), Pr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1668
- const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + 80, E = 22, h = e.append("g").lower(), { look: p, theme: _, themeVariables: u } = a, { bkgColorArray: O, borderColorArray: T, actorBorder: g } = u;
1669
- r || (B++, h.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = B);
1670
- const f = e.append("g");
1671
- let I = yt;
1672
- r ? I += ` ${_t}` : I += ` ${ft}`, f.attr("class", I), f.attr("name", t.name);
1673
- const L = dt();
1674
- L.x = t.x, L.y = n, L.fill = "#eaeaea", L.width = t.width, L.height = t.height, L.class = "actor", f.append("line").attr("id", "actor-man-torso" + B).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), f.append("line").attr("id", "actor-man-arms" + B).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), f.append("circle").attr("cx", t.x + t.width / 2).attr("cy", n + 12).attr("r", E), p === "neo" && f.attr("filter", "url(#drop-shadow)");
1675
- const b = i.get(t.name) ?? 0;
1676
- pt.has(_) ? (f.style("stroke", T[b % T.length]), f.style("fill", O[b % T.length])) : f.style("stroke", g);
1677
- const w = f.node().getBBox();
1678
- return t.height = w.height + (a.sequence.labelBoxHeight ?? 0), Et(a, Q(t.description))(
1679
- t.description,
1680
- f,
1681
- L.x,
1682
- L.y + 15,
1683
- L.width,
1684
- L.height,
1685
- { class: `actor ${yt}` },
1686
- a
1687
- ), f.attr("transform", `translate(0,${E / 2 + 10})`), r || (f.attr("data-et", "participant"), f.attr("data-type", "boundary"), f.attr("data-id", t.name)), t.height;
1688
- }, "drawActorTypeBoundary"), kr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1689
- const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + 80, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u, actorBorder: O } = p, T = e.append("g").lower();
1690
- r || (B++, T.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = B);
1691
- const g = e.append("g");
1692
- let f = yt;
1693
- r ? f += ` ${_t}` : f += ` ${ft}`, g.attr("class", f), g.attr("name", t.name), r || g.attr("data-et", "participant").attr("data-type", "actor").attr("data-id", t.name);
1694
- const I = E === "neo" ? 0.5 : 1, L = E === "neo" ? n + (1 - I) * 30 : n;
1695
- g.append("line").attr("id", "actor-man-torso" + B).attr("x1", s).attr("y1", L + 25 * I).attr("x2", s).attr("y2", L + 45 * I), g.append("line").attr("id", "actor-man-arms" + B).attr("x1", s - It / 2 * I).attr("y1", L + 33 * I).attr("x2", s + It / 2 * I).attr("y2", L + 33 * I), g.append("line").attr("x1", s - It / 2 * I).attr("y1", L + 60 * I).attr("x2", s).attr("y2", L + 45 * I), g.append("line").attr("x1", s).attr("y1", L + 45 * I).attr("x2", s + (It / 2 - 2) * I).attr("y2", L + 60 * I);
1696
- const b = g.append("circle");
1697
- 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);
1698
- const w = g.node().getBBox();
1699
- t.height = w.height;
1700
- const A = dt();
1701
- 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;
1702
- const D = i.get(t.name) ?? 0;
1703
- return pt.has(h) ? (g.style("stroke", u[D % u.length]), g.style("fill", _[D % u.length])) : g.style("stroke", O), Et(a, Q(t.description))(
1704
- t.description,
1705
- g,
1706
- A.x,
1707
- L + 35 * I - (E === "neo" ? 10 : 0),
1708
- A.width,
1709
- A.height,
1710
- { class: `actor ${yt}` },
1711
- a
1712
- ), t.height;
1713
- }, "drawActorTypeActor"), Dr = /* @__PURE__ */ x(async function(e, t, a, r, i, n, s) {
1714
- const c = s ?? new Map(
1715
- [...n.db.getActors().values()].map((E, h) => [E.name, h])
1716
- );
1717
- switch (t.type) {
1718
- case "actor":
1719
- return await kr(e, t, a, r, c);
1720
- case "participant":
1721
- return await br(e, t, a, r, c);
1722
- case "boundary":
1723
- return await Pr(e, t, a, r, c);
1724
- case "control":
1725
- return await Sr(
1726
- e,
1727
- t,
1728
- a,
1729
- r,
1730
- i,
1731
- c
1732
- );
1733
- case "entity":
1734
- return await wr(e, t, a, r, c);
1735
- case "database":
1736
- return await Nr(e, t, a, r, c);
1737
- case "collections":
1738
- return await mr(e, t, a, r, c);
1739
- case "queue":
1740
- return await Ar(e, t, a, r, c);
1741
- }
1742
- }, "drawActor"), vr = /* @__PURE__ */ x(function(e, t, a) {
1743
- const i = e.append("g");
1744
- Ke(i, t), t.name && Et(a)(
1745
- t.name,
1746
- i,
1747
- t.x,
1748
- t.y + a.boxTextMargin + (t.textMaxHeight || 0) / 2,
1749
- t.width,
1750
- 0,
1751
- { class: "text" },
1752
- a
1753
- ), i.lower();
1754
- }, "drawBox"), Cr = /* @__PURE__ */ x(function(e) {
1755
- return e.append("g");
1756
- }, "anchorElement"), Mr = /* @__PURE__ */ x(function(e, t, a, r, i, n, s) {
1757
- const { theme: c, themeVariables: E } = r, { bkgColorArray: h, borderColorArray: p, mainBkg: _ } = E, u = dt(), O = t.anchored, T = t.actor;
1758
- u.x = t.startx, u.y = t.starty, u.class = "activation" + i % 3, u.width = t.stopx - t.startx, u.height = a - t.starty;
1759
- const g = Pt(O, u), I = (s ?? new Map(
1760
- [...n.db.getActors().values()].map((L, b) => [L.name, b])
1761
- )).get(T) ?? 0;
1762
- pt.has(c) && (g.style("stroke", p[I % p.length]), g.style("fill", h[I % p.length] ?? _));
1763
- }, "drawActivation"), Br = /* @__PURE__ */ x(async function(e, t, a, r, i) {
1764
- const {
1765
- boxMargin: n,
1766
- boxTextMargin: s,
1767
- labelBoxHeight: c,
1768
- labelBoxWidth: E,
1769
- messageFontFamily: h,
1770
- messageFontSize: p,
1771
- messageFontWeight: _
1772
- } = r, u = e.append("g").attr("data-et", "control-structure").attr("data-id", "i" + i.id), O = /* @__PURE__ */ x(function(f, I, L, b) {
1773
- return u.append("line").attr("x1", f).attr("y1", I).attr("x2", L).attr("y2", b).attr("class", "loopLine");
1774
- }, "drawLoopLine");
1775
- 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(f) {
1776
- O(t.startx, f.y, t.stopx, f.y).style(
1777
- "stroke-dasharray",
1778
- "3, 3"
1779
- );
1780
- });
1781
- let T = se();
1782
- T.text = a, T.x = t.startx, T.y = t.starty, T.fontFamily = h, T.fontSize = p, T.fontWeight = _, T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.width = Math.max(E ?? 0, 50), T.height = c + (r.look === "neo" ? 15 : 0) || 20, T.textMargin = s, T.class = "labelText", Ye(u, T), T = Fe(), T.text = t.title, T.x = t.startx + E / 2 + (t.stopx - t.startx) / 2, T.y = t.starty + n + s, T.anchor = "middle", T.valign = "middle", T.textMargin = s, T.class = "loopText", T.fontFamily = h, T.fontSize = p, T.fontWeight = _, T.wrap = !0;
1783
- let g = Q(T.text) ? await Ht(u, T, t) : At(u, T);
1784
- if (t.sectionTitles !== void 0) {
1785
- for (const [f, I] of Object.entries(t.sectionTitles))
1786
- if (I.message) {
1787
- T.text = I.message, T.x = t.startx + (t.stopx - t.startx) / 2, T.y = t.sections[f].y + n + s, T.class = "sectionTitle", T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.fontFamily = h, T.fontSize = p, T.fontWeight = _, T.wrap = t.wrap, Q(T.text) ? (t.starty = t.sections[f].y, await Ht(u, T, t)) : At(u, T);
1788
- let L = Math.round(
1789
- g.map((b) => (b._groups || b)[0][0].getBBox().height).reduce((b, w) => b + w)
1790
- );
1791
- t.sections[f].height += L - (n + s);
1792
- }
1793
- }
1794
- return t.height = Math.round(t.stopy - t.starty), u;
1795
- }, "drawLoop"), Ke = /* @__PURE__ */ x(function(e, t) {
1796
- ur(e, t);
1797
- }, "drawBackgroundRect"), Vr = /* @__PURE__ */ x(function(e, t) {
1798
- e.append("defs").append("symbol").attr("id", t + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1799
- "d",
1800
- "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"
1801
- );
1802
- }, "insertDatabaseIcon"), Yr = /* @__PURE__ */ x(function(e, t) {
1803
- e.append("defs").append("symbol").attr("id", t + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1804
- "d",
1805
- "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"
1806
- );
1807
- }, "insertComputerIcon"), Wr = /* @__PURE__ */ x(function(e, t) {
1808
- e.append("defs").append("symbol").attr("id", t + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1809
- "d",
1810
- "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"
1811
- );
1812
- }, "insertClockIcon"), Kr = /* @__PURE__ */ x(function(e, t) {
1813
- 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");
1814
- }, "insertArrowHead"), Fr = /* @__PURE__ */ x(function(e, t) {
1815
- 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");
1816
- }, "insertArrowFilledHead"), Hr = /* @__PURE__ */ x(function(e, t) {
1817
- 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);
1818
- }, "insertSequenceNumber"), qr = /* @__PURE__ */ x(function(e, t) {
1819
- 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");
1820
- }, "insertArrowCrossHead"), zr = /* @__PURE__ */ x(function(e, t) {
1821
- const { theme: a } = t;
1822
- 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"}`);
1823
- }, "insertDropShadow"), Fe = /* @__PURE__ */ x(function() {
1824
- return {
1825
- x: 0,
1826
- y: 0,
1827
- fill: void 0,
1828
- anchor: void 0,
1829
- style: "#666",
1830
- width: void 0,
1831
- height: void 0,
1832
- textMargin: 0,
1833
- rx: 0,
1834
- ry: 0,
1835
- tspan: !0,
1836
- valign: void 0
1837
- };
1838
- }, "getTextObj"), Ur = /* @__PURE__ */ x(function() {
1839
- return {
1840
- x: 0,
1841
- y: 0,
1842
- fill: "#EDF2AE",
1843
- stroke: "#666",
1844
- width: 100,
1845
- anchor: "start",
1846
- height: 100,
1847
- rx: 0,
1848
- ry: 0
1849
- };
1850
- }, "getNoteRect"), Et = /* @__PURE__ */ (function() {
1851
- function e(n, s, c, E, h, p, _) {
1852
- const u = s.append("text").attr("x", c + h / 2).attr("y", E + p / 2 + 5).style("text-anchor", "middle").text(n);
1853
- i(u, _);
1854
- }
1855
- x(e, "byText");
1856
- function t(n, s, c, E, h, p, _, u) {
1857
- const { actorFontSize: O, actorFontFamily: T, actorFontWeight: g } = u, [f, I] = Be(O), L = n.split(N.lineBreakRegex);
1858
- for (let b = 0; b < L.length; b++) {
1859
- const w = b * f - f * (L.length - 1) / 2, A = s.append("text").attr("x", c + h / 2).attr("y", E).style("text-anchor", "middle").style("font-size", I).style("font-weight", g).style("font-family", T);
1860
- A.append("tspan").attr("x", c + h / 2).attr("dy", w).text(L[b]), A.attr("y", E + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), i(A, _);
1861
- }
1862
- }
1863
- x(t, "byTspan");
1864
- function a(n, s, c, E, h, p, _, u) {
1865
- const O = s.append("switch"), g = O.append("foreignObject").attr("x", c).attr("y", E).attr("width", h).attr("height", p).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1866
- g.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(n), t(n, O, c, E, h, p, _, u), i(g, _);
1867
- }
1868
- x(a, "byFo");
1869
- async function r(n, s, c, E, h, p, _, u) {
1870
- const O = await kt(n, Ft()), T = s.append("switch"), f = T.append("foreignObject").attr("x", c + h / 2 - O.width / 2).attr("y", E + p / 2 - O.height / 2).attr("width", O.width).attr("height", O.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1871
- f.append("div").style("text-align", "center").style("vertical-align", "middle").html(await Ve(n, Ft())), t(n, T, c, E, h, p, _, u), i(f, _);
1872
- }
1873
- x(r, "byKatex");
1874
- function i(n, s) {
1875
- for (const c in s)
1876
- s.hasOwnProperty(c) && n.attr(c, s[c]);
1877
- }
1878
- return x(i, "_setTextAttrs"), function(n, s = !1) {
1879
- return s ? r : n.textPlacement === "fo" ? a : n.textPlacement === "old" ? e : t;
1880
- };
1881
- })(), Gr = /* @__PURE__ */ (function() {
1882
- function e(i, n, s, c, E, h, p) {
1883
- const _ = n.append("text").attr("x", s).attr("y", c).style("text-anchor", "start").text(i);
1884
- r(_, p);
1885
- }
1886
- x(e, "byText");
1887
- function t(i, n, s, c, E, h, p, _) {
1888
- const { actorFontSize: u, actorFontFamily: O, actorFontWeight: T } = _, g = i.split(N.lineBreakRegex);
1889
- for (let f = 0; f < g.length; f++) {
1890
- const I = f * u - u * (g.length - 1) / 2, L = n.append("text").attr("x", s).attr("y", c).style("text-anchor", "start").style("font-size", u).style("font-weight", T).style("font-family", O);
1891
- L.append("tspan").attr("x", s).attr("dy", I).text(g[f]), L.attr("y", c + h / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(L, p);
1892
- }
1893
- }
1894
- x(t, "byTspan");
1895
- function a(i, n, s, c, E, h, p, _) {
1896
- const u = n.append("switch"), T = u.append("foreignObject").attr("x", s).attr("y", c).attr("width", E).attr("height", h).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1897
- T.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, u, s, c, E, h, p, _), r(T, p);
1898
- }
1899
- x(a, "byFo");
1900
- function r(i, n) {
1901
- for (const s in n)
1902
- n.hasOwnProperty(s) && i.attr(s, n[s]);
1903
- }
1904
- return x(r, "_setTextAttrs"), function(i) {
1905
- return i.textPlacement === "fo" ? a : i.textPlacement === "old" ? e : t;
1906
- };
1907
- })(), Xr = /* @__PURE__ */ x(function(e, t) {
1908
- 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");
1909
- }, "insertSolidTopArrowHead"), Jr = /* @__PURE__ */ x(function(e, t) {
1910
- 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");
1911
- }, "insertSolidBottomArrowHead"), Zr = /* @__PURE__ */ x(function(e, t) {
1912
- 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");
1913
- }, "insertStickTopArrowHead"), Qr = /* @__PURE__ */ x(function(e, t) {
1914
- 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");
1915
- }, "insertStickBottomArrowHead"), H = {
1916
- drawRect: Pt,
1917
- drawText: At,
1918
- drawLabel: Ye,
1919
- drawActor: Dr,
1920
- drawBox: vr,
1921
- drawPopup: Lr,
1922
- anchorElement: Cr,
1923
- drawActivation: Mr,
1924
- drawLoop: Br,
1925
- drawBackgroundRect: Ke,
1926
- insertArrowHead: Kr,
1927
- insertArrowFilledHead: Fr,
1928
- insertSequenceNumber: Hr,
1929
- insertArrowCrossHead: qr,
1930
- insertDatabaseIcon: Vr,
1931
- insertComputerIcon: Yr,
1932
- insertClockIcon: Wr,
1933
- getTextObj: Fe,
1934
- getNoteRect: Ur,
1935
- fixLifeLineHeights: We,
1936
- sanitizeUrl: Me.sanitizeUrl,
1937
- insertDropShadow: zr,
1938
- insertSolidTopArrowHead: Xr,
1939
- insertSolidBottomArrowHead: Jr,
1940
- insertStickTopArrowHead: Zr,
1941
- insertStickBottomArrowHead: Qr
1942
- }, l = {}, R = {
1943
- data: {
1944
- startx: void 0,
1945
- stopx: void 0,
1946
- starty: void 0,
1947
- stopy: void 0
1948
- },
1949
- verticalPos: 0,
1950
- sequenceItems: [],
1951
- activations: [],
1952
- models: {
1953
- getHeight: /* @__PURE__ */ x(function() {
1954
- return Math.max.apply(
1955
- null,
1956
- this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1957
- ) + (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));
1958
- }, "getHeight"),
1959
- clear: /* @__PURE__ */ x(function() {
1960
- this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1961
- }, "clear"),
1962
- addBox: /* @__PURE__ */ x(function(e) {
1963
- this.boxes.push(e);
1964
- }, "addBox"),
1965
- addActor: /* @__PURE__ */ x(function(e) {
1966
- this.actors.push(e);
1967
- }, "addActor"),
1968
- addLoop: /* @__PURE__ */ x(function(e) {
1969
- this.loops.push(e);
1970
- }, "addLoop"),
1971
- addMessage: /* @__PURE__ */ x(function(e) {
1972
- this.messages.push(e);
1973
- }, "addMessage"),
1974
- addNote: /* @__PURE__ */ x(function(e) {
1975
- this.notes.push(e);
1976
- }, "addNote"),
1977
- lastActor: /* @__PURE__ */ x(function() {
1978
- return this.actors[this.actors.length - 1];
1979
- }, "lastActor"),
1980
- lastLoop: /* @__PURE__ */ x(function() {
1981
- return this.loops[this.loops.length - 1];
1982
- }, "lastLoop"),
1983
- lastMessage: /* @__PURE__ */ x(function() {
1984
- return this.messages[this.messages.length - 1];
1985
- }, "lastMessage"),
1986
- lastNote: /* @__PURE__ */ x(function() {
1987
- return this.notes[this.notes.length - 1];
1988
- }, "lastNote"),
1989
- actors: [],
1990
- boxes: [],
1991
- loops: [],
1992
- messages: [],
1993
- notes: []
1994
- },
1995
- init: /* @__PURE__ */ x(function() {
1996
- this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1997
- startx: void 0,
1998
- stopx: void 0,
1999
- starty: void 0,
2000
- stopy: void 0
2001
- }, this.verticalPos = 0, ze($());
2002
- }, "init"),
2003
- updateVal: /* @__PURE__ */ x(function(e, t, a, r) {
2004
- e[t] === void 0 ? e[t] = a : e[t] = r(a, e[t]);
2005
- }, "updateVal"),
2006
- updateBounds: /* @__PURE__ */ x(function(e, t, a, r) {
2007
- const i = this;
2008
- let n = 0;
2009
- function s(c) {
2010
- return /* @__PURE__ */ x(function(h) {
2011
- n++;
2012
- const p = i.sequenceItems.length - n + 1;
2013
- i.updateVal(h, "starty", t - p * l.boxMargin, Math.min), i.updateVal(h, "stopy", r + p * l.boxMargin, Math.max), i.updateVal(R.data, "startx", e - p * l.boxMargin, Math.min), i.updateVal(R.data, "stopx", a + p * l.boxMargin, Math.max), c !== "activation" && (i.updateVal(h, "startx", e - p * l.boxMargin, Math.min), i.updateVal(h, "stopx", a + p * l.boxMargin, Math.max), i.updateVal(R.data, "starty", t - p * l.boxMargin, Math.min), i.updateVal(R.data, "stopy", r + p * l.boxMargin, Math.max));
2014
- }, "updateItemBounds");
2015
- }
2016
- x(s, "updateFn"), this.sequenceItems.forEach(s()), this.activations.forEach(s("activation"));
2017
- }, "updateBounds"),
2018
- insert: /* @__PURE__ */ x(function(e, t, a, r) {
2019
- const i = N.getMin(e, a), n = N.getMax(e, a), s = N.getMin(t, r), c = N.getMax(t, r);
2020
- 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", c, Math.max), this.updateBounds(i, s, n, c);
2021
- }, "insert"),
2022
- newActivation: /* @__PURE__ */ x(function(e, t, a) {
2023
- const r = a.get(e.from), i = Ut(e.from).length || 0, n = r.x + r.width / 2 + (i - 1) * l.activationWidth / 2;
2024
- this.activations.push({
2025
- startx: n,
2026
- starty: this.verticalPos + 2,
2027
- stopx: n + l.activationWidth,
2028
- stopy: void 0,
2029
- actor: e.from,
2030
- anchored: H.anchorElement(t)
2031
- });
2032
- }, "newActivation"),
2033
- endActivation: /* @__PURE__ */ x(function(e) {
2034
- const t = this.activations.map(function(a) {
2035
- return a.actor;
2036
- }).lastIndexOf(e.from);
2037
- return this.activations.splice(t, 1)[0];
2038
- }, "endActivation"),
2039
- createLoop: /* @__PURE__ */ x(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
2040
- return {
2041
- startx: void 0,
2042
- starty: this.verticalPos,
2043
- stopx: void 0,
2044
- stopy: void 0,
2045
- title: e.message,
2046
- wrap: e.wrap,
2047
- width: e.width,
2048
- height: 0,
2049
- fill: t
2050
- };
2051
- }, "createLoop"),
2052
- newLoop: /* @__PURE__ */ x(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
2053
- this.sequenceItems.push(this.createLoop(e, t));
2054
- }, "newLoop"),
2055
- endLoop: /* @__PURE__ */ x(function() {
2056
- return this.sequenceItems.pop();
2057
- }, "endLoop"),
2058
- isLoopOverlap: /* @__PURE__ */ x(function() {
2059
- return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
2060
- }, "isLoopOverlap"),
2061
- addSectionToLoop: /* @__PURE__ */ x(function(e) {
2062
- const t = this.sequenceItems.pop();
2063
- t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: R.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
2064
- }, "addSectionToLoop"),
2065
- saveVerticalPos: /* @__PURE__ */ x(function() {
2066
- this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
2067
- }, "saveVerticalPos"),
2068
- resetVerticalPos: /* @__PURE__ */ x(function() {
2069
- this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
2070
- }, "resetVerticalPos"),
2071
- bumpVerticalPos: /* @__PURE__ */ x(function(e) {
2072
- this.verticalPos = this.verticalPos + e, this.data.stopy = N.getMax(this.data.stopy, this.verticalPos);
2073
- }, "bumpVerticalPos"),
2074
- getVerticalPos: /* @__PURE__ */ x(function() {
2075
- return this.verticalPos;
2076
- }, "getVerticalPos"),
2077
- getBounds: /* @__PURE__ */ x(function() {
2078
- return { bounds: this.data, models: this.models };
2079
- }, "getBounds")
2080
- }, $r = /* @__PURE__ */ x(async function(e, t, a) {
2081
- R.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = R.getVerticalPos();
2082
- const r = dt();
2083
- r.x = t.startx, r.y = t.starty, r.width = t.width || l.width, r.class = "note";
2084
- const i = e.append("g");
2085
- i.attr("data-et", "note"), i.attr("data-id", "i" + a);
2086
- const n = H.drawRect(i, r), s = se();
2087
- s.x = t.startx, s.y = t.starty, s.width = r.width, s.dy = "1em", s.text = t.message, s.class = "noteText", s.fontFamily = l.noteFontFamily, s.fontSize = l.noteFontSize, s.fontWeight = l.noteFontWeight, s.anchor = l.noteAlign, s.textMargin = l.noteMargin, s.valign = "center";
2088
- const c = Q(s.text) ? await Ht(i, s) : At(i, s), E = Math.round(
2089
- c.map((h) => (h._groups || h)[0][0].getBBox().height).reduce((h, p) => h + p)
2090
- );
2091
- n.attr("height", E + 2 * l.noteMargin), t.height += E + 2 * l.noteMargin, R.bumpVerticalPos(E + 2 * l.noteMargin), t.stopy = t.starty + E + 2 * l.noteMargin, t.stopx = t.startx + r.width, R.insert(t.startx, t.starty, t.stopx, t.stopy), R.models.addNote(t);
2092
- }, "drawNote"), ve = /* @__PURE__ */ x(function(e, t, a, r, i, n, s) {
2093
- const c = r.db.getActors(), E = c.get(t.from), h = c.get(t.to), p = a.sequenceVisible;
2094
- let _ = E.x + E.width / 2, u = h.x + h.width / 2;
2095
- const O = _ <= u, T = Je(t, r), g = e.append("g"), f = 16.5, I = /* @__PURE__ */ x((D, M) => {
2096
- const V = D ? f : -f;
2097
- return M ? -V : V;
2098
- }, "getCircleOffset"), L = /* @__PURE__ */ x((D) => {
2099
- g.append("circle").attr("cx", D).attr("cy", s).attr("r", 5).attr("width", 10).attr("height", 10);
2100
- }, "drawCircle"), { CENTRAL_CONNECTION: b, CENTRAL_CONNECTION_REVERSE: w, CENTRAL_CONNECTION_DUAL: A } = r.db.LINETYPE;
2101
- if (p)
2102
- switch (t.centralConnection) {
2103
- case b:
2104
- T && (u += I(O, !0));
2105
- break;
2106
- case w:
2107
- T || (_ += I(O, !1));
2108
- break;
2109
- case A:
2110
- T ? u += I(O, !0) : _ += I(O, !1);
2111
- break;
2112
- }
2113
- switch (t.centralConnection) {
2114
- case b:
2115
- L(u);
2116
- break;
2117
- case w:
2118
- L(_);
2119
- break;
2120
- case A:
2121
- L(_), L(u);
2122
- break;
2123
- }
2124
- }, "drawCentralConnection"), Rt = /* @__PURE__ */ x((e) => ({
2125
- fontFamily: e.messageFontFamily,
2126
- fontSize: e.messageFontSize,
2127
- fontWeight: e.messageFontWeight
2128
- }), "messageFont"), bt = /* @__PURE__ */ x((e) => ({
2129
- fontFamily: e.noteFontFamily,
2130
- fontSize: e.noteFontSize,
2131
- fontWeight: e.noteFontWeight
2132
- }), "noteFont"), re = /* @__PURE__ */ x((e) => ({
2133
- fontFamily: e.actorFontFamily,
2134
- fontSize: e.actorFontSize,
2135
- fontWeight: e.actorFontWeight
2136
- }), "actorFont");
2137
- async function He(e, t) {
2138
- R.bumpVerticalPos(10);
2139
- const { startx: a, stopx: r, message: i } = t, n = N.splitBreaks(i).length, s = Q(i), c = s ? await kt(i, $()) : Z.calculateTextDimensions(i, Rt(l));
2140
- if (!s) {
2141
- const _ = c.height / n;
2142
- t.height += _, R.bumpVerticalPos(_);
2143
- }
2144
- let E, h = c.height - 10;
2145
- const p = c.width;
2146
- if (a === r) {
2147
- E = R.getVerticalPos() + h, l.rightAngles || (h += l.boxMargin, E = R.getVerticalPos() + h), h += 30;
2148
- const _ = N.getMax(p / 2, l.width / 2);
2149
- R.insert(
2150
- a - _,
2151
- R.getVerticalPos() - 10 + h,
2152
- r + _,
2153
- R.getVerticalPos() + 30 + h
2154
- );
2155
- } else
2156
- h += l.boxMargin, E = R.getVerticalPos() + h, R.insert(a, E - 10, r, E);
2157
- return R.bumpVerticalPos(h), t.height += h, t.stopy = t.starty + t.height, R.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), E;
2158
- }
2159
- x(He, "boundMessage");
2160
- var jr = /* @__PURE__ */ x(async function(e, t, a, r, i, n) {
2161
- const { startx: s, stopx: c, starty: E, message: h, type: p, sequenceIndex: _, sequenceVisible: u } = t, O = Z.calculateTextDimensions(h, Rt(l)), T = se();
2162
- T.x = Math.min(s, c), T.y = E + 10, T.width = Math.abs(c - s), T.class = "messageText", T.dy = "1em", T.text = h, T.fontFamily = l.messageFontFamily, T.fontSize = l.messageFontSize, T.fontWeight = l.messageFontWeight, T.anchor = l.messageAlign, T.valign = "center", T.textMargin = l.wrapPadding, T.tspan = !1, Q(T.text) ? await Ht(e, T, { startx: s, stopx: c, starty: a }) : At(e, T);
2163
- const g = O.width;
2164
- let f;
2165
- if (s === c) {
2166
- const L = u || l.showSequenceNumbers, b = Je(i, r), w = na(i, r), A = s + (L && (b || w) ? 10 : 0);
2167
- l.rightAngles ? f = e.append("path").attr(
2168
- "d",
2169
- `M ${A},${a} H ${s + N.getMax(l.width / 2, g / 2)} V ${a + 25} H ${s}`
2170
- ) : f = e.append("path").attr(
2171
- "d",
2172
- "M " + A + "," + a + " C " + (A + 60) + "," + (a - 10) + " " + (s + 60) + "," + (a + 30) + " " + s + "," + (a + 20)
2173
- ), te(i, r) && ve(e, i, t, r, s, c, a);
2174
- } else
2175
- f = e.append("line"), f.attr("x1", s), f.attr("y1", a), f.attr("x2", c), f.attr("y2", a), te(i, r) && ve(e, i, t, r, s, c, a);
2176
- p === r.db.LINETYPE.DOTTED || p === r.db.LINETYPE.DOTTED_CROSS || p === r.db.LINETYPE.DOTTED_POINT || p === r.db.LINETYPE.DOTTED_OPEN || p === r.db.LINETYPE.BIDIRECTIONAL_DOTTED || p === r.db.LINETYPE.SOLID_TOP_DOTTED || p === r.db.LINETYPE.SOLID_BOTTOM_DOTTED || p === r.db.LINETYPE.STICK_TOP_DOTTED || p === r.db.LINETYPE.STICK_BOTTOM_DOTTED || p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED ? (f.style("stroke-dasharray", "3, 3"), f.attr("class", "messageLine1")) : f.attr("class", "messageLine0"), f.attr("data-et", "message"), f.attr("data-id", "i" + t.id), f.attr("data-from", t.from), f.attr("data-to", t.to);
2177
- let I = "";
2178
- if (l.arrowMarkerAbsolute && (I = Er(!0)), f.attr("stroke-width", 2), f.attr("stroke", "none"), f.style("fill", "none"), (p === r.db.LINETYPE.SOLID_TOP || p === r.db.LINETYPE.SOLID_TOP_DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-solidTopArrowHead)"), (p === r.db.LINETYPE.SOLID_BOTTOM || p === r.db.LINETYPE.SOLID_BOTTOM_DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-solidBottomArrowHead)"), (p === r.db.LINETYPE.STICK_TOP || p === r.db.LINETYPE.STICK_TOP_DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-stickTopArrowHead)"), (p === r.db.LINETYPE.STICK_BOTTOM || p === r.db.LINETYPE.STICK_BOTTOM_DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-stickBottomArrowHead)"), (p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED) && f.attr("marker-start", "url(" + I + "#" + n + "-solidBottomArrowHead)"), (p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED) && f.attr("marker-start", "url(" + I + "#" + n + "-solidTopArrowHead)"), (p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED) && f.attr("marker-start", "url(" + I + "#" + n + "-stickBottomArrowHead)"), (p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED) && f.attr("marker-start", "url(" + I + "#" + n + "-stickTopArrowHead)"), (p === r.db.LINETYPE.SOLID || p === r.db.LINETYPE.DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-arrowhead)"), (p === r.db.LINETYPE.BIDIRECTIONAL_SOLID || p === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (f.attr("marker-start", "url(" + I + "#" + n + "-arrowhead)"), f.attr("marker-end", "url(" + I + "#" + n + "-arrowhead)")), (p === r.db.LINETYPE.SOLID_POINT || p === r.db.LINETYPE.DOTTED_POINT) && f.attr("marker-end", "url(" + I + "#" + n + "-filled-head)"), (p === r.db.LINETYPE.SOLID_CROSS || p === r.db.LINETYPE.DOTTED_CROSS) && f.attr("marker-end", "url(" + I + "#" + n + "-crosshead)"), u || l.showSequenceNumbers) {
2179
- const L = p === r.db.LINETYPE.BIDIRECTIONAL_SOLID || p === r.db.LINETYPE.BIDIRECTIONAL_DOTTED, b = p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED, w = 6, A = te(i, r);
2180
- let D = s, M = c;
2181
- L ? (s < c ? D = s + w * 2 : (D = s - w + (A ? -5 : 0), D += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), f.attr("x1", D)) : b ? (c > s ? M = c - 2 * w : (M = c - w, D += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), M += A ? 15 : 0, f.attr("x2", M), f.attr("x1", D)) : f.attr("x1", s + w);
2182
- let V = 0;
2183
- const W = s === c, U = s <= c;
2184
- W ? V = t.fromBounds + 1 : b ? V = U ? t.toBounds - 1 : t.fromBounds + 1 : V = U ? t.fromBounds + 1 : t.toBounds - 1;
2185
- let G = "12px";
2186
- const X = _.toString().length;
2187
- X > 5 ? G = "7px" : X > 3 && (G = "9px"), 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", G).attr("text-anchor", "middle").attr("class", "sequenceNumber").text(_);
2188
- }
2189
- }, "drawMessage"), ta = /* @__PURE__ */ x(function(e, t, a, r, i, n, s) {
2190
- let c = 0, E = 0, h, p = 0;
2191
- for (const _ of r) {
2192
- const u = t.get(_), O = u.box;
2193
- h && h != O && (s || R.models.addBox(h), E += l.boxMargin + h.margin), O && O != h && (s || (O.x = c + E, O.y = i), E += O.margin), u.width = N.getMax(u.width || l.width, l.width), u.height = N.getMax(u.height || l.height, l.height), u.margin = u.margin || l.actorMargin, p = N.getMax(p, u.height), a.get(u.name) && (E += u.width / 2), u.x = c + E, u.starty = R.getVerticalPos(), R.insert(u.x, i, u.x + u.width, u.height), c += u.width + E, u.box && (u.box.width = c + O.margin - u.box.x), E = u.margin, h = u.box, R.models.addActor(u);
2194
- }
2195
- h && !s && R.models.addBox(h), R.bumpVerticalPos(p);
2196
- }, "addActorRenderingData"), ae = /* @__PURE__ */ x(async function(e, t, a, r, i, n, s) {
2197
- if (r) {
2198
- let c = 0;
2199
- R.bumpVerticalPos(l.boxMargin * 2);
2200
- for (const E of a) {
2201
- const h = t.get(E);
2202
- h.stopy || (h.stopy = R.getVerticalPos());
2203
- const p = await H.drawActor(
2204
- e,
2205
- h,
2206
- l,
2207
- !0,
2208
- i,
2209
- n,
2210
- s
2211
- );
2212
- c = N.getMax(c, p);
2213
- }
2214
- R.bumpVerticalPos(c + l.boxMargin);
2215
- } else
2216
- for (const c of a) {
2217
- const E = t.get(c);
2218
- await H.drawActor(e, E, l, !1, i, n, s);
2219
- }
2220
- }, "drawActors"), qe = /* @__PURE__ */ x(function(e, t, a, r) {
2221
- let i = 0, n = 0;
2222
- for (const s of a) {
2223
- const c = t.get(s), E = ra(c), h = H.drawPopup(
2224
- e,
2225
- c,
2226
- E,
2227
- l,
2228
- l.forceMenus,
2229
- r
2230
- );
2231
- h.height > i && (i = h.height), h.width + c.x > n && (n = h.width + c.x);
2232
- }
2233
- return { maxHeight: i, maxWidth: n };
2234
- }, "drawActorsPopup"), ze = /* @__PURE__ */ x(function(e) {
2235
- sr(l, e), e.fontFamily && (l.actorFontFamily = l.noteFontFamily = l.messageFontFamily = e.fontFamily), e.fontSize && (l.actorFontSize = l.noteFontSize = l.messageFontSize = e.fontSize), e.fontWeight && (l.actorFontWeight = l.noteFontWeight = l.messageFontWeight = e.fontWeight);
2236
- }, "setConf"), Ut = /* @__PURE__ */ x(function(e) {
2237
- return R.activations.filter(function(t) {
2238
- return t.actor === e;
2239
- });
2240
- }, "actorActivations"), Ce = /* @__PURE__ */ x(function(e, t) {
2241
- const a = t.get(e), r = Ut(e), i = r.reduce(
2242
- function(s, c) {
2243
- return N.getMin(s, c.startx);
2244
- },
2245
- a.x + a.width / 2 - 1
2246
- ), n = r.reduce(
2247
- function(s, c) {
2248
- return N.getMax(s, c.stopx);
2249
- },
2250
- a.x + a.width / 2 + 1
2251
- );
2252
- return [i, n];
2253
- }, "activationBounds");
2254
- function ht(e, t, a, r, i) {
2255
- R.bumpVerticalPos(a);
2256
- let n = r;
2257
- if (t.id && t.message && e[t.id]) {
2258
- const s = e[t.id].width, c = Rt(l);
2259
- t.message = Z.wrapLabel(`[${t.message}]`, s - 2 * l.wrapPadding, c), t.width = s, t.wrap = !0;
2260
- const E = Z.calculateTextDimensions(t.message, c), h = N.getMax(E.height, l.labelBoxHeight);
2261
- n = r + h, at.debug(`${h} - ${t.message}`);
2262
- }
2263
- i(t), R.bumpVerticalPos(n);
2264
- }
2265
- x(ht, "adjustLoopHeightForWrap");
2266
- function Ue(e, t, a, r, i, n, s) {
2267
- function c(p, _) {
2268
- p.x < i.get(e.from).x ? (R.insert(
2269
- t.stopx - _,
2270
- t.starty,
2271
- t.startx,
2272
- t.stopy + p.height / 2 + l.noteMargin
2273
- ), t.stopx = t.stopx + _) : (R.insert(
2274
- t.startx,
2275
- t.starty,
2276
- t.stopx + _,
2277
- t.stopy + p.height / 2 + l.noteMargin
2278
- ), t.stopx = t.stopx - _);
2279
- }
2280
- x(c, "receiverAdjustment");
2281
- function E(p, _) {
2282
- p.x < i.get(e.to).x ? (R.insert(
2283
- t.startx - _,
2284
- t.starty,
2285
- t.stopx,
2286
- t.stopy + p.height / 2 + l.noteMargin
2287
- ), t.startx = t.startx + _) : (R.insert(
2288
- t.stopx,
2289
- t.starty,
2290
- t.startx + _,
2291
- t.stopy + p.height / 2 + l.noteMargin
2292
- ), t.startx = t.startx - _);
2293
- }
2294
- x(E, "senderAdjustment");
2295
- const h = [
2296
- Kt.ACTOR,
2297
- Kt.CONTROL,
2298
- Kt.ENTITY,
2299
- Kt.DATABASE
2300
- ];
2301
- if (n.get(e.to) == r) {
2302
- const p = i.get(e.to), _ = h.includes(p.type) ? It / 2 + 3 : p.width / 2 + 3;
2303
- c(p, _), p.starty = a - p.height / 2, R.bumpVerticalPos(p.height / 2);
2304
- } else if (s.get(e.from) == r) {
2305
- const p = i.get(e.from);
2306
- if (l.mirrorActors) {
2307
- const _ = h.includes(p.type) ? It / 2 : p.width / 2;
2308
- E(p, _);
2309
- }
2310
- p.stopy = a - p.height / 2, R.bumpVerticalPos(p.height / 2);
2311
- } else if (s.get(e.to) == r) {
2312
- const p = i.get(e.to);
2313
- if (l.mirrorActors) {
2314
- const _ = h.includes(p.type) ? It / 2 + 3 : p.width / 2 + 3;
2315
- c(p, _);
2316
- }
2317
- p.stopy = a - p.height / 2, R.bumpVerticalPos(p.height / 2);
2318
- }
2319
- }
2320
- x(Ue, "adjustCreatedDestroyedData");
2321
- var ea = /* @__PURE__ */ x(async function(e, t, a, r) {
2322
- const { securityLevel: i, sequence: n, look: s, themeVariables: c } = $();
2323
- l = n;
2324
- let E;
2325
- i === "sandbox" && (E = Yt("#i" + t));
2326
- const h = i === "sandbox" ? Yt(E.nodes()[0].contentDocument.body) : Yt("body"), p = i === "sandbox" ? E.nodes()[0].contentDocument : document;
2327
- R.init(), at.debug(r.db);
2328
- const _ = i === "sandbox" ? h.select(`[id="${t}"]`) : Yt(`[id="${t}"]`), u = r.db.getActors(), O = r.db.getCreatedActors(), T = r.db.getDestroyedActors(), g = r.db.getBoxes();
2329
- let f = r.db.getActorKeys();
2330
- const I = r.db.getMessages(), L = r.db.getDiagramTitle(), b = r.db.hasAtLeastOneBox(), w = r.db.hasAtLeastOneBoxWithTitle(), A = await Ge(u, I, r);
2331
- if (l.height = await Xe(u, A, g), H.insertComputerIcon(_, t), H.insertDatabaseIcon(_, t), H.insertClockIcon(_, t), b && (R.bumpVerticalPos(l.boxMargin), w && R.bumpVerticalPos(g[0].textMaxHeight)), l.hideUnusedParticipants === !0) {
2332
- const m = /* @__PURE__ */ new Set();
2333
- I.forEach((k) => {
2334
- m.add(k.from), m.add(k.to);
2335
- }), f = f.filter((k) => m.has(k));
2336
- }
2337
- const D = new Map(
2338
- f.map((m, k) => [u.get(m)?.name ?? m, k])
2339
- );
2340
- ta(_, u, O, f, 0, I, !1);
2341
- const M = await ca(I, u, A, r);
2342
- H.insertArrowHead(_, t), H.insertArrowCrossHead(_, t), H.insertArrowFilledHead(_, t), H.insertSequenceNumber(_, t), H.insertSolidTopArrowHead(_, t), H.insertSolidBottomArrowHead(_, t), H.insertStickTopArrowHead(_, t), H.insertStickBottomArrowHead(_, t), s === "neo" && H.insertDropShadow(_, l);
2343
- function V(m, k) {
2344
- const lt = R.endActivation(m);
2345
- lt.starty + 18 > k && (lt.starty = k - 6, k += 12), H.drawActivation(
2346
- _,
2347
- lt,
2348
- k,
2349
- l,
2350
- Ut(m.from).length,
2351
- r,
2352
- D
2353
- ), R.insert(lt.startx, k - 10, lt.stopx, k);
2354
- }
2355
- x(V, "activeEnd");
2356
- let W = 1, U = 1;
2357
- const G = [], X = [];
2358
- let nt = 0;
2359
- for (const m of I) {
2360
- let k, lt, et;
2361
- switch (m.type) {
2362
- case r.db.LINETYPE.NOTE:
2363
- R.resetVerticalPos(), lt = m.noteModel, await $r(_, lt, m.id);
2364
- break;
2365
- case r.db.LINETYPE.ACTIVE_START:
2366
- R.newActivation(m, _, u);
2367
- break;
2368
- case r.db.LINETYPE.CENTRAL_CONNECTION:
2369
- R.newActivation(m, _, u);
2370
- break;
2371
- case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:
2372
- R.newActivation(m, _, u);
2373
- break;
2374
- case r.db.LINETYPE.ACTIVE_END:
2375
- V(m, R.getVerticalPos());
2376
- break;
2377
- case r.db.LINETYPE.LOOP_START:
2378
- ht(
2379
- M,
2380
- m,
2381
- l.boxMargin,
2382
- l.boxMargin + l.boxTextMargin,
2383
- (K) => R.newLoop(K)
2384
- );
2385
- break;
2386
- case r.db.LINETYPE.LOOP_END:
2387
- k = R.endLoop(), await H.drawLoop(_, k, "loop", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2388
- break;
2389
- case r.db.LINETYPE.RECT_START:
2390
- ht(M, m, l.boxMargin, l.boxMargin, (K) => {
2391
- let Ot = K.message;
2392
- Ot || (Ot = c?.rectBkgColor || c?.actorBkg || "rgba(128, 128, 128, 0.5)"), R.newLoop(void 0, Ot);
2393
- });
2394
- break;
2395
- case r.db.LINETYPE.RECT_END:
2396
- k = R.endLoop(), X.push(k), R.models.addLoop(k), R.bumpVerticalPos(k.stopy - R.getVerticalPos());
2397
- break;
2398
- case r.db.LINETYPE.OPT_START:
2399
- ht(
2400
- M,
2401
- m,
2402
- l.boxMargin,
2403
- l.boxMargin + l.boxTextMargin,
2404
- (K) => R.newLoop(K)
2405
- );
2406
- break;
2407
- case r.db.LINETYPE.OPT_END:
2408
- k = R.endLoop(), await H.drawLoop(_, k, "opt", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2409
- break;
2410
- case r.db.LINETYPE.ALT_START:
2411
- ht(
2412
- M,
2413
- m,
2414
- l.boxMargin,
2415
- l.boxMargin + l.boxTextMargin,
2416
- (K) => R.newLoop(K)
2417
- );
2418
- break;
2419
- case r.db.LINETYPE.ALT_ELSE:
2420
- ht(
2421
- M,
2422
- m,
2423
- l.boxMargin + l.boxTextMargin,
2424
- l.boxMargin,
2425
- (K) => R.addSectionToLoop(K)
2426
- );
2427
- break;
2428
- case r.db.LINETYPE.ALT_END:
2429
- k = R.endLoop(), await H.drawLoop(_, k, "alt", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2430
- break;
2431
- case r.db.LINETYPE.PAR_START:
2432
- case r.db.LINETYPE.PAR_OVER_START:
2433
- ht(
2434
- M,
2435
- m,
2436
- l.boxMargin,
2437
- l.boxMargin + l.boxTextMargin,
2438
- (K) => R.newLoop(K)
2439
- ), R.saveVerticalPos();
2440
- break;
2441
- case r.db.LINETYPE.PAR_AND:
2442
- ht(
2443
- M,
2444
- m,
2445
- l.boxMargin + l.boxTextMargin,
2446
- l.boxMargin,
2447
- (K) => R.addSectionToLoop(K)
2448
- );
2449
- break;
2450
- case r.db.LINETYPE.PAR_END:
2451
- k = R.endLoop(), await H.drawLoop(_, k, "par", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2452
- break;
2453
- case r.db.LINETYPE.AUTONUMBER:
2454
- W = m.message.start || W, U = m.message.step || U, m.message.visible ? r.db.enableSequenceNumbers() : r.db.disableSequenceNumbers();
2455
- break;
2456
- case r.db.LINETYPE.CRITICAL_START:
2457
- ht(
2458
- M,
2459
- m,
2460
- l.boxMargin,
2461
- l.boxMargin + l.boxTextMargin,
2462
- (K) => R.newLoop(K)
2463
- );
2464
- break;
2465
- case r.db.LINETYPE.CRITICAL_OPTION:
2466
- ht(
2467
- M,
2468
- m,
2469
- l.boxMargin + l.boxTextMargin,
2470
- l.boxMargin,
2471
- (K) => R.addSectionToLoop(K)
2472
- );
2473
- break;
2474
- case r.db.LINETYPE.CRITICAL_END:
2475
- k = R.endLoop(), await H.drawLoop(_, k, "critical", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2476
- break;
2477
- case r.db.LINETYPE.BREAK_START:
2478
- ht(
2479
- M,
2480
- m,
2481
- l.boxMargin,
2482
- l.boxMargin + l.boxTextMargin,
2483
- (K) => R.newLoop(K)
2484
- );
2485
- break;
2486
- case r.db.LINETYPE.BREAK_END:
2487
- k = R.endLoop(), await H.drawLoop(_, k, "break", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2488
- break;
2489
- default:
2490
- try {
2491
- et = m.msgModel, et.starty = R.getVerticalPos(), et.sequenceIndex = W, et.sequenceVisible = r.db.showSequenceNumbers(), et.id = m.id, et.from = m.from, et.to = m.to;
2492
- const K = await He(_, et);
2493
- Ue(
2494
- m,
2495
- et,
2496
- K,
2497
- nt,
2498
- u,
2499
- O,
2500
- T
2501
- ), G.push({ messageModel: et, lineStartY: K, msg: m }), R.models.addMessage(et);
2502
- } catch (K) {
2503
- at.error("error while drawing message", K);
2504
- }
2505
- }
2506
- [
2507
- r.db.LINETYPE.SOLID_OPEN,
2508
- r.db.LINETYPE.DOTTED_OPEN,
2509
- r.db.LINETYPE.SOLID,
2510
- r.db.LINETYPE.SOLID_TOP,
2511
- r.db.LINETYPE.SOLID_BOTTOM,
2512
- r.db.LINETYPE.STICK_TOP,
2513
- r.db.LINETYPE.STICK_BOTTOM,
2514
- r.db.LINETYPE.SOLID_TOP_DOTTED,
2515
- r.db.LINETYPE.SOLID_BOTTOM_DOTTED,
2516
- r.db.LINETYPE.STICK_TOP_DOTTED,
2517
- r.db.LINETYPE.STICK_BOTTOM_DOTTED,
2518
- r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2519
- r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
2520
- r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2521
- r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2522
- r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2523
- r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2524
- r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2525
- r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2526
- r.db.LINETYPE.DOTTED,
2527
- r.db.LINETYPE.SOLID_CROSS,
2528
- r.db.LINETYPE.DOTTED_CROSS,
2529
- r.db.LINETYPE.SOLID_POINT,
2530
- r.db.LINETYPE.DOTTED_POINT,
2531
- r.db.LINETYPE.BIDIRECTIONAL_SOLID,
2532
- r.db.LINETYPE.BIDIRECTIONAL_DOTTED
2533
- ].includes(m.type) && (W = Math.round((W + U) * 100) / 100), nt++;
2534
- }
2535
- at.debug("createdActors", O), at.debug("destroyedActors", T), await ae(_, u, f, !1, t, r, D);
2536
- for (const m of G)
2537
- await jr(_, m.messageModel, m.lineStartY, r, m.msg, t);
2538
- l.mirrorActors && await ae(_, u, f, !0, t, r, D), X.forEach((m) => H.drawBackgroundRect(_, m)), We(_, u, f, l);
2539
- for (const m of R.models.boxes) {
2540
- m.height = R.getVerticalPos() - m.y, R.insert(m.x, m.y, m.x + m.width, m.height);
2541
- const k = l.boxMargin * 2;
2542
- m.startx = m.x - k, m.starty = m.y - k * 0.25, m.stopx = m.startx + m.width + 2 * k, m.stopy = m.starty + m.height + k * 0.75, m.stroke = "rgb(0,0,0, 0.5)", H.drawBox(_, m, l);
2543
- }
2544
- b && R.bumpVerticalPos(l.boxMargin);
2545
- const j = qe(_, u, f, p), { bounds: q } = R.getBounds();
2546
- 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);
2547
- let st = q.stopy - q.starty;
2548
- st < j.maxHeight && (st = j.maxHeight);
2549
- let tt = st + 2 * l.diagramMarginY;
2550
- l.mirrorActors && (tt = tt - l.boxMargin + l.bottomMarginAdj);
2551
- let Y = q.stopx - q.startx;
2552
- Y < j.maxWidth && (Y = j.maxWidth);
2553
- const C = Y + 2 * l.diagramMarginX;
2554
- L && _.append("text").text(L).attr("x", (q.stopx - q.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), ar(_, tt, C, l.useMaxWidth);
2555
- const St = L ? 40 : 0, Dt = u.size && s === "neo" ? 30 : 0;
2556
- _.attr(
2557
- "viewBox",
2558
- q.startx - l.diagramMarginX + " -" + (l.diagramMarginY + St) + " " + C + " " + (tt + St + Dt)
2559
- ), at.debug("models:", R.models);
2560
- }, "draw");
2561
- async function Ge(e, t, a) {
2562
- const r = {};
2563
- for (const i of t)
2564
- if (e.get(i.to) && e.get(i.from)) {
2565
- const n = e.get(i.to);
2566
- if (i.placement === a.db.PLACEMENT.LEFTOF && !n.prevActor || i.placement === a.db.PLACEMENT.RIGHTOF && !n.nextActor)
2567
- continue;
2568
- const s = i.placement !== void 0, c = !s, E = s ? bt(l) : Rt(l), h = i.wrap ? Z.wrapLabel(i.message, l.width - 2 * l.wrapPadding, E) : i.message, _ = (Q(h) ? await kt(i.message, $()) : Z.calculateTextDimensions(h, E)).width + 2 * l.wrapPadding;
2569
- c && i.from === n.nextActor ? r[i.to] = N.getMax(
2570
- r[i.to] || 0,
2571
- _
2572
- ) : c && i.from === n.prevActor ? r[i.from] = N.getMax(
2573
- r[i.from] || 0,
2574
- _
2575
- ) : c && i.from === i.to ? (r[i.from] = N.getMax(
2576
- r[i.from] || 0,
2577
- _ / 2
2578
- ), r[i.to] = N.getMax(
2579
- r[i.to] || 0,
2580
- _ / 2
2581
- )) : i.placement === a.db.PLACEMENT.RIGHTOF ? r[i.from] = N.getMax(
2582
- r[i.from] || 0,
2583
- _
2584
- ) : i.placement === a.db.PLACEMENT.LEFTOF ? r[n.prevActor] = N.getMax(
2585
- r[n.prevActor] || 0,
2586
- _
2587
- ) : i.placement === a.db.PLACEMENT.OVER && (n.prevActor && (r[n.prevActor] = N.getMax(
2588
- r[n.prevActor] || 0,
2589
- _ / 2
2590
- )), n.nextActor && (r[i.from] = N.getMax(
2591
- r[i.from] || 0,
2592
- _ / 2
2593
- )));
2594
- }
2595
- return at.debug("maxMessageWidthPerActor:", r), r;
2596
- }
2597
- x(Ge, "getMaxMessageWidthPerActor");
2598
- var ra = /* @__PURE__ */ x(function(e) {
2599
- let t = 0;
2600
- const a = re(l);
2601
- for (const r in e.links) {
2602
- const n = Z.calculateTextDimensions(r, a).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2603
- t < n && (t = n);
2604
- }
2605
- return t;
2606
- }, "getRequiredPopupWidth");
2607
- async function Xe(e, t, a) {
2608
- let r = 0;
2609
- for (const n of e.keys()) {
2610
- const s = e.get(n);
2611
- s.wrap && (s.description = Z.wrapLabel(
2612
- s.description,
2613
- l.width - 2 * l.wrapPadding,
2614
- re(l)
2615
- ));
2616
- const c = Q(s.description) ? await kt(s.description, $()) : Z.calculateTextDimensions(s.description, re(l));
2617
- s.width = s.wrap ? l.width : N.getMax(l.width, c.width + 2 * l.wrapPadding), s.height = s.wrap ? N.getMax(c.height, l.height) : l.height, r = N.getMax(r, s.height);
2618
- }
2619
- for (const n in t) {
2620
- const s = e.get(n);
2621
- if (!s)
2622
- continue;
2623
- const c = e.get(s.nextActor);
2624
- if (!c) {
2625
- const _ = t[n] + l.actorMargin - s.width / 2;
2626
- s.margin = N.getMax(_, l.actorMargin);
2627
- continue;
2628
- }
2629
- const h = t[n] + l.actorMargin - s.width / 2 - c.width / 2;
2630
- s.margin = N.getMax(h, l.actorMargin);
2631
- }
2632
- let i = 0;
2633
- return a.forEach((n) => {
2634
- const s = Rt(l);
2635
- let c = n.actorKeys.reduce((_, u) => _ += e.get(u).width + (e.get(u).margin || 0), 0);
2636
- const E = l.boxMargin * 8;
2637
- c += E, c -= 2 * l.boxTextMargin, n.wrap && (n.name = Z.wrapLabel(n.name, c - 2 * l.wrapPadding, s));
2638
- const h = Z.calculateTextDimensions(n.name, s);
2639
- i = N.getMax(h.height, i);
2640
- const p = N.getMax(c, h.width + 2 * l.wrapPadding);
2641
- if (n.margin = l.boxTextMargin, c < p) {
2642
- const _ = (p - c) / 2;
2643
- n.margin += _;
2644
- }
2645
- }), a.forEach((n) => n.textMaxHeight = i), N.getMax(r, l.height);
2646
- }
2647
- x(Xe, "calculateActorMargins");
2648
- var aa = /* @__PURE__ */ x(async function(e, t, a) {
2649
- const r = t.get(e.from), i = t.get(e.to), n = r.x, s = i.x, c = e.wrap && e.message;
2650
- let E = Q(e.message) ? await kt(e.message, $()) : Z.calculateTextDimensions(
2651
- c ? Z.wrapLabel(e.message, l.width, bt(l)) : e.message,
2652
- bt(l)
2653
- );
2654
- const h = {
2655
- width: c ? l.width : N.getMax(l.width, E.width + 2 * l.noteMargin),
2656
- height: 0,
2657
- startx: r.x,
2658
- stopx: 0,
2659
- starty: 0,
2660
- stopy: 0,
2661
- message: e.message
2662
- };
2663
- return e.placement === a.db.PLACEMENT.RIGHTOF ? (h.width = c ? N.getMax(l.width, E.width) : N.getMax(
2664
- r.width / 2 + i.width / 2,
2665
- E.width + 2 * l.noteMargin
2666
- ), h.startx = n + (r.width + l.actorMargin) / 2) : e.placement === a.db.PLACEMENT.LEFTOF ? (h.width = c ? N.getMax(l.width, E.width + 2 * l.noteMargin) : N.getMax(
2667
- r.width / 2 + i.width / 2,
2668
- E.width + 2 * l.noteMargin
2669
- ), h.startx = n - h.width + (r.width - l.actorMargin) / 2) : e.to === e.from ? (E = Z.calculateTextDimensions(
2670
- c ? Z.wrapLabel(e.message, N.getMax(l.width, r.width), bt(l)) : e.message,
2671
- bt(l)
2672
- ), h.width = c ? N.getMax(l.width, r.width) : N.getMax(r.width, l.width, E.width + 2 * l.noteMargin), h.startx = n + (r.width - h.width) / 2) : (h.width = Math.abs(n + r.width / 2 - (s + i.width / 2)) + l.actorMargin, h.startx = n < s ? n + r.width / 2 - l.actorMargin / 2 : s + i.width / 2 - l.actorMargin / 2), c && (h.message = Z.wrapLabel(
2673
- e.message,
2674
- h.width - 2 * l.wrapPadding,
2675
- bt(l)
2676
- )), at.debug(
2677
- `NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${e.message}]`
2678
- ), h;
2679
- }, "buildNoteModel"), sa = 4, te = /* @__PURE__ */ x(function(e, t) {
2680
- const { CENTRAL_CONNECTION: a, CENTRAL_CONNECTION_REVERSE: r, CENTRAL_CONNECTION_DUAL: i } = t.db.LINETYPE;
2681
- return [a, r, i].includes(
2682
- e.centralConnection
2683
- );
2684
- }, "hasCentralConnection"), ia = /* @__PURE__ */ x(function(e, t, a) {
2685
- const {
2686
- CENTRAL_CONNECTION_REVERSE: r,
2687
- CENTRAL_CONNECTION_DUAL: i,
2688
- BIDIRECTIONAL_SOLID: n,
2689
- BIDIRECTIONAL_DOTTED: s
2690
- } = t.db.LINETYPE;
2691
- let c = 0;
2692
- return (e.centralConnection === r || e.centralConnection === i) && (c += sa), (e.centralConnection === r || e.centralConnection === i) && (e.type === n || e.type === s) && (c += a ? 0 : -6), c;
2693
- }, "calculateCentralConnectionOffset"), Je = /* @__PURE__ */ x(function(e, t) {
2694
- const {
2695
- SOLID_ARROW_TOP_REVERSE: a,
2696
- SOLID_ARROW_TOP_REVERSE_DOTTED: r,
2697
- SOLID_ARROW_BOTTOM_REVERSE: i,
2698
- SOLID_ARROW_BOTTOM_REVERSE_DOTTED: n,
2699
- STICK_ARROW_TOP_REVERSE: s,
2700
- STICK_ARROW_TOP_REVERSE_DOTTED: c,
2701
- STICK_ARROW_BOTTOM_REVERSE: E,
2702
- STICK_ARROW_BOTTOM_REVERSE_DOTTED: h
2703
- } = t.db.LINETYPE;
2704
- return [
2705
- a,
2706
- r,
2707
- i,
2708
- n,
2709
- s,
2710
- c,
2711
- E,
2712
- h
2713
- ].includes(e.type);
2714
- }, "isReverseArrowType"), na = /* @__PURE__ */ x(function(e, t) {
2715
- const { BIDIRECTIONAL_SOLID: a, BIDIRECTIONAL_DOTTED: r } = t.db.LINETYPE;
2716
- return [a, r].includes(e.type);
2717
- }, "isBidirectionalArrowType"), oa = /* @__PURE__ */ x(function(e, t, a) {
2718
- const { look: r } = $();
2719
- if (![
2720
- a.db.LINETYPE.SOLID_OPEN,
2721
- a.db.LINETYPE.DOTTED_OPEN,
2722
- a.db.LINETYPE.SOLID,
2723
- a.db.LINETYPE.SOLID_TOP,
2724
- a.db.LINETYPE.SOLID_BOTTOM,
2725
- a.db.LINETYPE.STICK_TOP,
2726
- a.db.LINETYPE.STICK_BOTTOM,
2727
- a.db.LINETYPE.SOLID_TOP_DOTTED,
2728
- a.db.LINETYPE.SOLID_BOTTOM_DOTTED,
2729
- a.db.LINETYPE.STICK_TOP_DOTTED,
2730
- a.db.LINETYPE.STICK_BOTTOM_DOTTED,
2731
- a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2732
- a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
2733
- a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2734
- a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2735
- a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2736
- a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2737
- a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2738
- a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2739
- a.db.LINETYPE.DOTTED,
2740
- a.db.LINETYPE.SOLID_CROSS,
2741
- a.db.LINETYPE.DOTTED_CROSS,
2742
- a.db.LINETYPE.SOLID_POINT,
2743
- a.db.LINETYPE.DOTTED_POINT,
2744
- a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2745
- a.db.LINETYPE.BIDIRECTIONAL_DOTTED
2746
- ].includes(e.type))
2747
- return {};
2748
- const [i, n] = Ce(e.from, t), [s, c] = Ce(e.to, t), E = i <= s;
2749
- let h = E ? n : i, p = E ? s : c;
2750
- r === "neo" && (e.type !== a.db.LINETYPE.SOLID_OPEN && (p += E ? -3 : 3), (e.type === a.db.LINETYPE.BIDIRECTIONAL_SOLID || e.type === a.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (h += E ? 3 : -3)), h += ia(e, a, E);
2751
- const _ = Math.abs(s - c) > 2, u = /* @__PURE__ */ x((f) => E ? -f : f, "adjustValue");
2752
- e.from === e.to ? p = h : (e.activate && !_ && (p += u(l.activationWidth / 2 - 1)), [
2753
- a.db.LINETYPE.SOLID_OPEN,
2754
- a.db.LINETYPE.DOTTED_OPEN,
2755
- a.db.LINETYPE.STICK_TOP,
2756
- a.db.LINETYPE.STICK_BOTTOM,
2757
- a.db.LINETYPE.STICK_TOP_DOTTED,
2758
- a.db.LINETYPE.STICK_BOTTOM_DOTTED,
2759
- a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2760
- a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2761
- a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2762
- a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2763
- a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2764
- a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2765
- a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2766
- a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
2767
- ].includes(e.type) || (p += u(3)), [
2768
- a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2769
- a.db.LINETYPE.BIDIRECTIONAL_DOTTED,
2770
- a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2771
- a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2772
- a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2773
- a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
2774
- ].includes(e.type) && (h -= u(3)));
2775
- const O = [i, n, s, c], T = Math.abs(h - p);
2776
- e.wrap && e.message && (e.message = Z.wrapLabel(
2777
- e.message,
2778
- N.getMax(T + 2 * l.wrapPadding, l.width),
2779
- Rt(l)
2780
- ));
2781
- const g = Z.calculateTextDimensions(e.message, Rt(l));
2782
- return {
2783
- width: N.getMax(
2784
- e.wrap ? 0 : g.width + 2 * l.wrapPadding,
2785
- T + 2 * l.wrapPadding,
2786
- l.width
2787
- ),
2788
- height: 0,
2789
- startx: h,
2790
- stopx: p,
2791
- starty: 0,
2792
- stopy: 0,
2793
- message: e.message,
2794
- type: e.type,
2795
- wrap: e.wrap,
2796
- fromBounds: Math.min.apply(null, O),
2797
- toBounds: Math.max.apply(null, O)
2798
- };
2799
- }, "buildMessageModel"), ca = /* @__PURE__ */ x(async function(e, t, a, r) {
2800
- const i = {}, n = [];
2801
- let s, c, E;
2802
- for (const h of e) {
2803
- switch (h.type) {
2804
- case r.db.LINETYPE.LOOP_START:
2805
- case r.db.LINETYPE.ALT_START:
2806
- case r.db.LINETYPE.OPT_START:
2807
- case r.db.LINETYPE.PAR_START:
2808
- case r.db.LINETYPE.PAR_OVER_START:
2809
- case r.db.LINETYPE.CRITICAL_START:
2810
- case r.db.LINETYPE.BREAK_START:
2811
- n.push({
2812
- id: h.id,
2813
- msg: h.message,
2814
- from: Number.MAX_SAFE_INTEGER,
2815
- to: Number.MIN_SAFE_INTEGER,
2816
- width: 0
2817
- });
2818
- break;
2819
- case r.db.LINETYPE.ALT_ELSE:
2820
- case r.db.LINETYPE.PAR_AND:
2821
- case r.db.LINETYPE.CRITICAL_OPTION:
2822
- h.message && (s = n.pop(), i[s.id] = s, i[h.id] = s, n.push(s));
2823
- break;
2824
- case r.db.LINETYPE.LOOP_END:
2825
- case r.db.LINETYPE.ALT_END:
2826
- case r.db.LINETYPE.OPT_END:
2827
- case r.db.LINETYPE.PAR_END:
2828
- case r.db.LINETYPE.CRITICAL_END:
2829
- case r.db.LINETYPE.BREAK_END:
2830
- s = n.pop(), i[s.id] = s;
2831
- break;
2832
- case r.db.LINETYPE.ACTIVE_START:
2833
- {
2834
- const _ = t.get(h.from ? h.from : h.to.actor), u = Ut(h.from ? h.from : h.to.actor).length, O = _.x + _.width / 2 + (u - 1) * l.activationWidth / 2, T = {
2835
- startx: O,
2836
- stopx: O + l.activationWidth,
2837
- actor: h.from,
2838
- enabled: !0
2839
- };
2840
- R.activations.push(T);
2841
- }
2842
- break;
2843
- case r.db.LINETYPE.ACTIVE_END:
2844
- {
2845
- const _ = R.activations.map((u) => u.actor).lastIndexOf(h.from);
2846
- R.activations.splice(_, 1).splice(0, 1);
2847
- }
2848
- break;
2849
- }
2850
- h.placement !== void 0 ? (c = await aa(h, t, r), h.noteModel = c, n.forEach((_) => {
2851
- s = _, s.from = N.getMin(s.from, c.startx), s.to = N.getMax(s.to, c.startx + c.width), s.width = N.getMax(s.width, Math.abs(s.from - s.to)) - l.labelBoxWidth;
2852
- })) : (E = oa(h, t, r), h.msgModel = E, E.startx && E.stopx && n.length > 0 && n.forEach((_) => {
2853
- if (s = _, E.startx === E.stopx) {
2854
- const u = t.get(h.from), O = t.get(h.to);
2855
- s.from = N.getMin(
2856
- u.x - E.width / 2,
2857
- u.x - u.width / 2,
2858
- s.from
2859
- ), s.to = N.getMax(
2860
- O.x + E.width / 2,
2861
- O.x + u.width / 2,
2862
- s.to
2863
- ), s.width = N.getMax(s.width, Math.abs(s.to - s.from)) - l.labelBoxWidth;
2864
- } else
2865
- s.from = N.getMin(E.startx, s.from), s.to = N.getMax(E.stopx, s.to), s.width = N.getMax(s.width, E.width) - l.labelBoxWidth;
2866
- }));
2867
- }
2868
- return R.activations = [], at.debug("Loop type widths:", i), i;
2869
- }, "calculateLoopBounds"), la = {
2870
- bounds: R,
2871
- drawActors: ae,
2872
- drawActorsPopup: qe,
2873
- setConf: ze,
2874
- draw: ea
2875
- }, pa = {
2876
- parser: _r,
2877
- get db() {
2878
- return new yr();
2879
- },
2880
- renderer: la,
2881
- styles: Or,
2882
- init: /* @__PURE__ */ x((e) => {
2883
- e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, rr({ sequence: { wrap: e.wrap } }));
2884
- }, "init")
2885
- };
2886
- export {
2887
- pa as diagram
2888
- };