@kong-ui-public/documentation 0.3.42 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Tableau10-GLA_9iAD-BMurskAd.js +9 -0
- package/dist/arc-BSRpyMf3-C5dasNo_.js +86 -0
- package/dist/array-CqVTtuYm-fKLgkG2b.js +6 -0
- package/dist/astro-mwoSwJnq-CNh-xuM0.js +27 -0
- package/dist/blockDiagram-6b2b5046-D02VCbQO-CPmGy0xX.js +1224 -0
- package/dist/c-eDnjw9rh-eDnjw9rh.js +87 -0
- package/dist/c4Diagram-b947cdbb-gYcL5VzP-DIDY83e1.js +1578 -0
- package/dist/channel-DHTQ8Ynn-7OPGex2S.js +5 -0
- package/dist/classDiagram-35230388-JdSKLSZv-D2crBRy-.js +217 -0
- package/dist/classDiagram-v2-412acd34-DFFRHXE_-B6aCxlD1.js +200 -0
- package/dist/clone-p6h9XXNm-3JQ-HRC6.js +8 -0
- package/dist/coffee-CRlSxcc3-CY091_1T.js +108 -0
- package/dist/cpp-DizfY48B-CA38N4Mn.js +208 -0
- package/dist/createText-423428c9-LivTKT7b-BXNfjcdp.js +2964 -0
- package/dist/csharp-uGDiXTZn-uGDiXTZn.js +762 -0
- package/dist/css-CAzixsid-CEpuX1HY.js +511 -0
- package/dist/csv-D4BoHddH-D4BoHddH.js +7 -0
- package/dist/diff-Bo5iyMQ2-Bo5iyMQ2.js +7 -0
- package/dist/docker-B10O2enb-B10O2enb.js +7 -0
- package/dist/documentation.es.js +5 -3130
- package/dist/documentation.umd.js +10152 -50
- package/dist/edges-d417c7a0-C1ggiwWz-Aj0OUf7e.js +1082 -0
- package/dist/erDiagram-0ea73325-mz0Z_-DA-Dr01LsTB.js +924 -0
- package/dist/flowDb-d35e309a-CPyxEMIt-lofeyUuw.js +1126 -0
- package/dist/flowDiagram-d949d7c1-DqCa0HNN-BK5wNO9Z.js +782 -0
- package/dist/flowDiagram-v2-49332944-UMosz1sZ-BG39AuNP.js +17 -0
- package/dist/flowchart-elk-definition-27cc417a-D2UKpS6N-r2p34307.js +48387 -0
- package/dist/ganttDiagram-5c869e3b-CVBHw4pG-CaG9QXQM.js +2490 -0
- package/dist/git-commit-CWf81VOF-DtOZSoIU.js +9 -0
- package/dist/git-rebase-sR-yVH_J-D5M2oE9O.js +9 -0
- package/dist/gitGraphDiagram-b9d81de9-BGm3fU0n-CbCpf-4j.js +1262 -0
- package/dist/go-BCCWZWY1-BCCWZWY1.js +7 -0
- package/dist/graph-4FyIWFHN-774TpNLL.js +870 -0
- package/dist/graphql-CT32SSoq-1pBWfpcR.js +18 -0
- package/dist/haml-8RvrfhLO-Bbc4xoLP.js +19 -0
- package/dist/handlebars-Cr5ro0bH-CLcCNLtV.js +15 -0
- package/dist/haskell-BfFu8DD8-BmkPJdLL.js +565 -0
- package/dist/html-BZB5lEhh-B74zAnWx.js +84 -0
- package/dist/html-derivative-0y7sV5Qc-D8-muTWn.js +9 -0
- package/dist/index-8fae9850-_CN7MNjP-Cq-s0PmS.js +373 -0
- package/dist/index-B-5DuDrq.js +29996 -0
- package/dist/infoDiagram-db7b18fc-V446j9uR-GSa8bniv.js +319 -0
- package/dist/ini-BsUFIxsI-BsUFIxsI.js +7 -0
- package/dist/init-DjUOC4st-C8Nwz6AJ.js +16 -0
- package/dist/java-Bk2JzfKB-Bk2JzfKB.js +74 -0
- package/dist/javascript-DqVBMyXe-DqVBMyXe.js +705 -0
- package/dist/journeyDiagram-d5636530-CFiu7dnV-DJMu6A22.js +803 -0
- package/dist/json-B12k4-6m-B12k4-6m.js +31 -0
- package/dist/json5-CvqQZK9I-CvqQZK9I.js +23 -0
- package/dist/jsonc-v2qGKRJY-v2qGKRJY.js +31 -0
- package/dist/jsonl-izxnMeZX-izxnMeZX.js +31 -0
- package/dist/jsx-aDp7j9_Z-aDp7j9_Z.js +705 -0
- package/dist/kotlin-NOMOielb-NOMOielb.js +7 -0
- package/dist/latex-Bw_ghldO-BlUAi6pB.js +339 -0
- package/dist/layout-2-aEcfuw-BqqWy5wB.js +1524 -0
- package/dist/less-CW2GmQHL-CW2GmQHL.js +165 -0
- package/dist/line-nVq5kEiy-DtZd3PHZ.js +34 -0
- package/dist/linear-Bz4oRFvQ-C869GXbm.js +447 -0
- package/dist/liquid-DJ2rh7oT-FwZwa67Y.js +28 -0
- package/dist/lua-5TZ-G8Be-CogscVHC.js +9 -0
- package/dist/make-whncTQWE-whncTQWE.js +7 -0
- package/dist/markdown-DYKdIx5--DYKdIx5-.js +135 -0
- package/dist/material-theme-lighter-BRE1Bis3-BRE1Bis3.js +769 -0
- package/dist/material-theme-palenight-Dhz61Tee-Dhz61Tee.js +769 -0
- package/dist/mdc-D0DPLwil-BfE3hy8_.js +88 -0
- package/dist/mdx-CKDMxEaL-CKDMxEaL.js +7 -0
- package/dist/mermaid-BxNM-z-u-BxNM-z-u.js +7 -0
- package/dist/mindmap-definition-377f8f1f-C2vFYDMs-B71SGbvx.js +19078 -0
- package/dist/nginx-C082G13W-vryM9k1W.js +9 -0
- package/dist/objective-c-BVtzkNiv-BVtzkNiv.js +115 -0
- package/dist/onig-BonMD2gC-BonMD2gC.js +4 -0
- package/dist/ordinal-MUacOSdK-B1MUT0BL.js +65 -0
- package/dist/pascal-CrvtytWS-CrvtytWS.js +7 -0
- package/dist/path-Crsf9Nsj-SiSjwXsf.js +91 -0
- package/dist/perl-D29UPKP6-Dez6-HRy.js +17 -0
- package/dist/php-D7Tl-iS7-BtPFrDEt.js +789 -0
- package/dist/pieDiagram-b0208e96-DhA_SoTh-CfDd9YdA.js +501 -0
- package/dist/plsql-8SPzZKaa-8SPzZKaa.js +7 -0
- package/dist/postcss-Cz2vjx_4-Cz2vjx_4.js +7 -0
- package/dist/powershell-B0buHCuS-B0buHCuS.js +7 -0
- package/dist/proto-6YaU_lta-6YaU_lta.js +7 -0
- package/dist/pug-DbFO7359-duYD8LVa.js +21 -0
- package/dist/python-BQXev0_W-BQXev0_W.js +524 -0
- package/dist/quadrantDiagram-0332be45-C8q96Ohm-DMblaqnx.js +903 -0
- package/dist/r-DU7Q70f1-DU7Q70f1.js +7 -0
- package/dist/reg-DoGLEyFr-DoGLEyFr.js +7 -0
- package/dist/requirementDiagram-bf7890df-D30zCZjB-B_JBC9RM.js +767 -0
- package/dist/rst-Bm1i8IkK-C9EaDq6g.js +26 -0
- package/dist/ruby-CZZKXaz8-BxaDEkRP.js +102 -0
- package/dist/rust-CIl6NRUt-CIl6NRUt.js +7 -0
- package/dist/sankeyDiagram-0acdec17-B4vNjMaS-Bauvtonp.js +816 -0
- package/dist/sass-LqXmC1Fh-LqXmC1Fh.js +8 -0
- package/dist/scss-DjxgF7f7-DGTzny6p.js +98 -0
- package/dist/sequenceDiagram-c18d009d-BniqGSPK-DuYYUmiZ.js +2201 -0
- package/dist/shellscript-CUUTQKn5-CUUTQKn5.js +7 -0
- package/dist/shellsession-BIPXtZci-D6avbCwN.js +9 -0
- package/dist/splunk-C0K00wNV-C0K00wNV.js +7 -0
- package/dist/sql-DkzN59UV-DkzN59UV.js +27 -0
- package/dist/ssh-config-BbWAW6SY-BbWAW6SY.js +7 -0
- package/dist/stateDiagram-43596fc0-F0V9suMd-L2Ywe-J_.js +266 -0
- package/dist/stateDiagram-v2-2ead4f9c-DUgJH8tF-BVo1q2i1.js +184 -0
- package/dist/style.css +1 -1
- package/dist/styles-6860f46c-Dflmq0ac-BRNSwis6.js +1089 -0
- package/dist/styles-7383a064-Dg7mXkpq-C4bItohl.js +430 -0
- package/dist/styles-b2c874b6-HpcOhE4Y-Bj0upXzO.js +960 -0
- package/dist/stylus-CAHdVuhm-CAHdVuhm.js +21 -0
- package/dist/svelte-DAxjO8Sh-D0e501jC.js +29 -0
- package/dist/svgDrawCommon-0ee1b4e9-CNkCfzsJ-Bz_doYLk.js +64 -0
- package/dist/swift-x2DVyVjN-Bz5PC9YM.js +550 -0
- package/dist/timeline-definition-d977decf-Cl38e_0g-D_Dlqa-R.js +794 -0
- package/dist/toml-Dbtbfmwk-Dbtbfmwk.js +75 -0
- package/dist/tsx-BmwsDeeh-BmwsDeeh.js +705 -0
- package/dist/twig-B_Gr-ODl-Cl9Q0GWo.js +58 -0
- package/dist/types/components/DocumentationContent.vue.d.ts +8 -1
- package/dist/types/components/DocumentationContent.vue.d.ts.map +1 -1
- package/dist/types/components/DocumentationDisplay.vue.d.ts +5 -1
- package/dist/types/components/DocumentationDisplay.vue.d.ts.map +1 -1
- package/dist/types/components/ProductDocumentModal.vue.d.ts +1 -1
- package/dist/types/components/ProductDocumentModal.vue.d.ts.map +1 -1
- package/dist/types/composables/useI18n.d.ts +4 -0
- package/dist/types/composables/useI18n.d.ts.map +1 -1
- package/dist/typescript-AEg-ehu7-AEg-ehu7.js +672 -0
- package/dist/v-BuvBsUKm-BuvBsUKm.js +7 -0
- package/dist/vb-cqjo5dul-cqjo5dul.js +7 -0
- package/dist/viml-h3ATW6He-h3ATW6He.js +7 -0
- package/dist/vue-Dz-azHaT-B9qBHMZi.js +71 -0
- package/dist/vue-html-DIGKAAs4-BeHSIJcx.js +11 -0
- package/dist/wasm-xOGcJ9Ts-xOGcJ9Ts.js +7 -0
- package/dist/wgsl-hGLOfCya-hGLOfCya.js +7 -0
- package/dist/xml-CfRpfi_B-BH3JRQfc.js +9 -0
- package/dist/xsl-BAqhSCYL-BTKPZRNQ.js +9 -0
- package/dist/xychartDiagram-e50adddc-JdLmRUgg-HmDalTeo.js +1282 -0
- package/dist/yaml-PGla5xPP-HJurM_FJ.js +206 -0
- package/package.json +13 -13
- package/dist/prism-bash.min-DDo5CyRs-DihCfXgx.js +0 -7
- package/dist/prism-css.min-BrrzZC7b-BrrzZC7b.js +0 -7
- package/dist/prism-docker.min-DnIEokC3-D0v8IWN_.js +0 -22
- package/dist/prism-go.min-C7UmK6TW-C7UmK6TW.js +0 -1
- package/dist/prism-http.min-CsU3-jB8-CQ8PCDXl.js +0 -23
- package/dist/prism-javascript.min-CEqHqgbm-CEqHqgbm.js +0 -8
- package/dist/prism-jq.min-Q555vXZm-Q555vXZm.js +0 -8
- package/dist/prism-json.min-B1GJqK1k-B1GJqK1k.js +0 -1
- package/dist/prism-log.min-SDopTpKN-SDopTpKN.js +0 -1
- package/dist/prism-lua.min-DwRnUVfS-DwRnUVfS.js +0 -1
- package/dist/prism-makefile.min-DyutknhE-DyutknhE.js +0 -1
- package/dist/prism-markdown.min-B7US-xc7-DB9aF_ZA.js +0 -63
- package/dist/prism-python.min-BIfpAh5K-BIfpAh5K.js +0 -1
- package/dist/prism-regex.min-f8DNqi8X-f8DNqi8X.js +0 -4
- package/dist/prism-rest.min-B6veHRJF-B6veHRJF.js +0 -1
- package/dist/prism-rust.min-Cb-Mi-h0-Cb-Mi-h0.js +0 -9
- package/dist/prism-scss.min-B0csyGJo-B0csyGJo.js +0 -1
- package/dist/prism-sql.min-BHXzX-c_-BHXzX-c_.js +0 -1
- package/dist/prism-typescript.min-oSVeWCAd-oSVeWCAd.js +0 -5
- package/dist/prism-xml-doc.min-yj0YzRGe-KgTQx-dc.js +0 -7
- package/dist/prism-yaml.min-CTetcdKA-C1YzP_OY.js +0 -28
|
@@ -0,0 +1,2201 @@
|
|
|
1
|
+
import { m as Kt, g as me, x as be, v as ye, c as lt, s as Ut, b as fe, a as Ee, j as P, aN as Gt, z as Te, l as j, d as kt, b1 as we, e as Pe, h as vt, i as ve, y as $ } from "./index-B-5DuDrq.js";
|
|
2
|
+
import { c as ke, x as _e, y as Le, h as Ie, p as Yt, g as _t } from "./svgDrawCommon-0ee1b4e9-CNkCfzsJ-Bz_doYLk.js";
|
|
3
|
+
var Dt = function() {
|
|
4
|
+
var t = function(at, f, k, b) {
|
|
5
|
+
for (k = k || {}, b = at.length; b--; k[at[b]] = f)
|
|
6
|
+
;
|
|
7
|
+
return k;
|
|
8
|
+
}, e = [1, 2], c = [1, 3], a = [1, 4], s = [2, 4], i = [1, 9], l = [1, 11], d = [1, 13], p = [1, 14], r = [1, 16], x = [1, 17], E = [1, 18], g = [1, 24], m = [1, 25], w = [1, 26], _ = [1, 27], I = [1, 28], O = [1, 29], M = [1, 30], V = [1, 31], S = [1, 32], tt = [1, 33], F = [1, 34], X = [1, 35], G = [1, 36], W = [1, 37], B = [1, 38], C = [1, 39], K = [1, 41], q = [1, 42], U = [1, 43], J = [1, 44], Z = [1, 45], y = [1, 46], v = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], L = [4, 5, 16, 50, 52, 53], dt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], et = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], N = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], Wt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], ct = [68, 69, 70], it = [1, 120], It = {
|
|
9
|
+
trace: function() {
|
|
10
|
+
},
|
|
11
|
+
yy: {},
|
|
12
|
+
symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, note: 54, placement: 55, text2: 56, over: 57, actor_pair: 58, links: 59, link: 60, properties: 61, details: 62, spaceList: 63, ",": 64, left_of: 65, right_of: 66, signaltype: 67, "+": 68, "-": 69, ACTOR: 70, SOLID_OPEN_ARROW: 71, DOTTED_OPEN_ARROW: 72, SOLID_ARROW: 73, DOTTED_ARROW: 74, SOLID_CROSS: 75, DOTTED_CROSS: 76, SOLID_POINT: 77, DOTTED_POINT: 78, TXT: 79, $accept: 0, $end: 1 },
|
|
13
|
+
terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "DOTTED_ARROW", 75: "SOLID_CROSS", 76: "DOTTED_CROSS", 77: "SOLID_POINT", 78: "DOTTED_POINT", 79: "TXT" },
|
|
14
|
+
productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]],
|
|
15
|
+
performAction: function(at, f, k, b, A, n, z) {
|
|
16
|
+
var h = n.length - 1;
|
|
17
|
+
switch (A) {
|
|
18
|
+
case 3:
|
|
19
|
+
return b.apply(n[h]), n[h];
|
|
20
|
+
case 4:
|
|
21
|
+
case 9:
|
|
22
|
+
this.$ = [];
|
|
23
|
+
break;
|
|
24
|
+
case 5:
|
|
25
|
+
case 10:
|
|
26
|
+
n[h - 1].push(n[h]), this.$ = n[h - 1];
|
|
27
|
+
break;
|
|
28
|
+
case 6:
|
|
29
|
+
case 7:
|
|
30
|
+
case 11:
|
|
31
|
+
case 12:
|
|
32
|
+
this.$ = n[h];
|
|
33
|
+
break;
|
|
34
|
+
case 8:
|
|
35
|
+
case 13:
|
|
36
|
+
this.$ = [];
|
|
37
|
+
break;
|
|
38
|
+
case 15:
|
|
39
|
+
n[h].type = "createParticipant", this.$ = n[h];
|
|
40
|
+
break;
|
|
41
|
+
case 16:
|
|
42
|
+
n[h - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(n[h - 2]) }), n[h - 1].push({ type: "boxEnd", boxText: n[h - 2] }), this.$ = n[h - 1];
|
|
43
|
+
break;
|
|
44
|
+
case 18:
|
|
45
|
+
this.$ = { type: "sequenceIndex", sequenceIndex: Number(n[h - 2]), sequenceIndexStep: Number(n[h - 1]), sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
|
|
46
|
+
break;
|
|
47
|
+
case 19:
|
|
48
|
+
this.$ = { type: "sequenceIndex", sequenceIndex: Number(n[h - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
|
|
49
|
+
break;
|
|
50
|
+
case 20:
|
|
51
|
+
this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: b.LINETYPE.AUTONUMBER };
|
|
52
|
+
break;
|
|
53
|
+
case 21:
|
|
54
|
+
this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
|
|
55
|
+
break;
|
|
56
|
+
case 22:
|
|
57
|
+
this.$ = { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: n[h - 1] };
|
|
58
|
+
break;
|
|
59
|
+
case 23:
|
|
60
|
+
this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: n[h - 1] };
|
|
61
|
+
break;
|
|
62
|
+
case 29:
|
|
63
|
+
b.setDiagramTitle(n[h].substring(6)), this.$ = n[h].substring(6);
|
|
64
|
+
break;
|
|
65
|
+
case 30:
|
|
66
|
+
b.setDiagramTitle(n[h].substring(7)), this.$ = n[h].substring(7);
|
|
67
|
+
break;
|
|
68
|
+
case 31:
|
|
69
|
+
this.$ = n[h].trim(), b.setAccTitle(this.$);
|
|
70
|
+
break;
|
|
71
|
+
case 32:
|
|
72
|
+
case 33:
|
|
73
|
+
this.$ = n[h].trim(), b.setAccDescription(this.$);
|
|
74
|
+
break;
|
|
75
|
+
case 34:
|
|
76
|
+
n[h - 1].unshift({ type: "loopStart", loopText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.LOOP_START }), n[h - 1].push({ type: "loopEnd", loopText: n[h - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = n[h - 1];
|
|
77
|
+
break;
|
|
78
|
+
case 35:
|
|
79
|
+
n[h - 1].unshift({ type: "rectStart", color: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.RECT_START }), n[h - 1].push({ type: "rectEnd", color: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = n[h - 1];
|
|
80
|
+
break;
|
|
81
|
+
case 36:
|
|
82
|
+
n[h - 1].unshift({ type: "optStart", optText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.OPT_START }), n[h - 1].push({ type: "optEnd", optText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = n[h - 1];
|
|
83
|
+
break;
|
|
84
|
+
case 37:
|
|
85
|
+
n[h - 1].unshift({ type: "altStart", altText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.ALT_START }), n[h - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = n[h - 1];
|
|
86
|
+
break;
|
|
87
|
+
case 38:
|
|
88
|
+
n[h - 1].unshift({ type: "parStart", parText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.PAR_START }), n[h - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = n[h - 1];
|
|
89
|
+
break;
|
|
90
|
+
case 39:
|
|
91
|
+
n[h - 1].unshift({ type: "parStart", parText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.PAR_OVER_START }), n[h - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = n[h - 1];
|
|
92
|
+
break;
|
|
93
|
+
case 40:
|
|
94
|
+
n[h - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.CRITICAL_START }), n[h - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = n[h - 1];
|
|
95
|
+
break;
|
|
96
|
+
case 41:
|
|
97
|
+
n[h - 1].unshift({ type: "breakStart", breakText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.BREAK_START }), n[h - 1].push({ type: "breakEnd", optText: b.parseMessage(n[h - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = n[h - 1];
|
|
98
|
+
break;
|
|
99
|
+
case 43:
|
|
100
|
+
this.$ = n[h - 3].concat([{ type: "option", optionText: b.parseMessage(n[h - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, n[h]]);
|
|
101
|
+
break;
|
|
102
|
+
case 45:
|
|
103
|
+
this.$ = n[h - 3].concat([{ type: "and", parText: b.parseMessage(n[h - 1]), signalType: b.LINETYPE.PAR_AND }, n[h]]);
|
|
104
|
+
break;
|
|
105
|
+
case 47:
|
|
106
|
+
this.$ = n[h - 3].concat([{ type: "else", altText: b.parseMessage(n[h - 1]), signalType: b.LINETYPE.ALT_ELSE }, n[h]]);
|
|
107
|
+
break;
|
|
108
|
+
case 48:
|
|
109
|
+
n[h - 3].draw = "participant", n[h - 3].type = "addParticipant", n[h - 3].description = b.parseMessage(n[h - 1]), this.$ = n[h - 3];
|
|
110
|
+
break;
|
|
111
|
+
case 49:
|
|
112
|
+
n[h - 1].draw = "participant", n[h - 1].type = "addParticipant", this.$ = n[h - 1];
|
|
113
|
+
break;
|
|
114
|
+
case 50:
|
|
115
|
+
n[h - 3].draw = "actor", n[h - 3].type = "addParticipant", n[h - 3].description = b.parseMessage(n[h - 1]), this.$ = n[h - 3];
|
|
116
|
+
break;
|
|
117
|
+
case 51:
|
|
118
|
+
n[h - 1].draw = "actor", n[h - 1].type = "addParticipant", this.$ = n[h - 1];
|
|
119
|
+
break;
|
|
120
|
+
case 52:
|
|
121
|
+
n[h - 1].type = "destroyParticipant", this.$ = n[h - 1];
|
|
122
|
+
break;
|
|
123
|
+
case 53:
|
|
124
|
+
this.$ = [n[h - 1], { type: "addNote", placement: n[h - 2], actor: n[h - 1].actor, text: n[h] }];
|
|
125
|
+
break;
|
|
126
|
+
case 54:
|
|
127
|
+
n[h - 2] = [].concat(n[h - 1], n[h - 1]).slice(0, 2), n[h - 2][0] = n[h - 2][0].actor, n[h - 2][1] = n[h - 2][1].actor, this.$ = [n[h - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: n[h - 2].slice(0, 2), text: n[h] }];
|
|
128
|
+
break;
|
|
129
|
+
case 55:
|
|
130
|
+
this.$ = [n[h - 1], { type: "addLinks", actor: n[h - 1].actor, text: n[h] }];
|
|
131
|
+
break;
|
|
132
|
+
case 56:
|
|
133
|
+
this.$ = [n[h - 1], { type: "addALink", actor: n[h - 1].actor, text: n[h] }];
|
|
134
|
+
break;
|
|
135
|
+
case 57:
|
|
136
|
+
this.$ = [n[h - 1], { type: "addProperties", actor: n[h - 1].actor, text: n[h] }];
|
|
137
|
+
break;
|
|
138
|
+
case 58:
|
|
139
|
+
this.$ = [n[h - 1], { type: "addDetails", actor: n[h - 1].actor, text: n[h] }];
|
|
140
|
+
break;
|
|
141
|
+
case 61:
|
|
142
|
+
this.$ = [n[h - 2], n[h]];
|
|
143
|
+
break;
|
|
144
|
+
case 62:
|
|
145
|
+
this.$ = n[h];
|
|
146
|
+
break;
|
|
147
|
+
case 63:
|
|
148
|
+
this.$ = b.PLACEMENT.LEFTOF;
|
|
149
|
+
break;
|
|
150
|
+
case 64:
|
|
151
|
+
this.$ = b.PLACEMENT.RIGHTOF;
|
|
152
|
+
break;
|
|
153
|
+
case 65:
|
|
154
|
+
this.$ = [
|
|
155
|
+
n[h - 4],
|
|
156
|
+
n[h - 1],
|
|
157
|
+
{ type: "addMessage", from: n[h - 4].actor, to: n[h - 1].actor, signalType: n[h - 3], msg: n[h], activate: !0 },
|
|
158
|
+
{ type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: n[h - 1] }
|
|
159
|
+
];
|
|
160
|
+
break;
|
|
161
|
+
case 66:
|
|
162
|
+
this.$ = [
|
|
163
|
+
n[h - 4],
|
|
164
|
+
n[h - 1],
|
|
165
|
+
{ type: "addMessage", from: n[h - 4].actor, to: n[h - 1].actor, signalType: n[h - 3], msg: n[h] },
|
|
166
|
+
{ type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: n[h - 4] }
|
|
167
|
+
];
|
|
168
|
+
break;
|
|
169
|
+
case 67:
|
|
170
|
+
this.$ = [n[h - 3], n[h - 1], { type: "addMessage", from: n[h - 3].actor, to: n[h - 1].actor, signalType: n[h - 2], msg: n[h] }];
|
|
171
|
+
break;
|
|
172
|
+
case 68:
|
|
173
|
+
this.$ = { type: "addParticipant", actor: n[h] };
|
|
174
|
+
break;
|
|
175
|
+
case 69:
|
|
176
|
+
this.$ = b.LINETYPE.SOLID_OPEN;
|
|
177
|
+
break;
|
|
178
|
+
case 70:
|
|
179
|
+
this.$ = b.LINETYPE.DOTTED_OPEN;
|
|
180
|
+
break;
|
|
181
|
+
case 71:
|
|
182
|
+
this.$ = b.LINETYPE.SOLID;
|
|
183
|
+
break;
|
|
184
|
+
case 72:
|
|
185
|
+
this.$ = b.LINETYPE.DOTTED;
|
|
186
|
+
break;
|
|
187
|
+
case 73:
|
|
188
|
+
this.$ = b.LINETYPE.SOLID_CROSS;
|
|
189
|
+
break;
|
|
190
|
+
case 74:
|
|
191
|
+
this.$ = b.LINETYPE.DOTTED_CROSS;
|
|
192
|
+
break;
|
|
193
|
+
case 75:
|
|
194
|
+
this.$ = b.LINETYPE.SOLID_POINT;
|
|
195
|
+
break;
|
|
196
|
+
case 76:
|
|
197
|
+
this.$ = b.LINETYPE.DOTTED_POINT;
|
|
198
|
+
break;
|
|
199
|
+
case 77:
|
|
200
|
+
this.$ = b.parseMessage(n[h].trim().substring(1));
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
table: [{ 3: 1, 4: e, 5: c, 6: a }, { 1: [3] }, { 3: 5, 4: e, 5: c, 6: a }, { 3: 6, 4: e, 5: c, 6: a }, t([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], s, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: l, 8: 8, 9: 10, 12: 12, 13: d, 14: p, 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, t(v, [2, 5]), { 9: 47, 12: 12, 13: d, 14: p, 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, t(v, [2, 7]), t(v, [2, 8]), t(v, [2, 14]), { 12: 48, 50: W, 52: B, 53: C }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: y }, { 22: 55, 70: y }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, t(v, [2, 29]), t(v, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, t(v, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 70: y }, { 22: 72, 70: y }, { 22: 73, 70: y }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82] }, { 55: 83, 57: [1, 84], 65: [1, 85], 66: [1, 86] }, { 22: 87, 70: y }, { 22: 88, 70: y }, { 22: 89, 70: y }, { 22: 90, 70: y }, t([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79], [2, 68]), t(v, [2, 6]), t(v, [2, 15]), t(L, [2, 9], { 10: 91 }), t(v, [2, 17]), { 5: [1, 93], 19: [1, 92] }, { 5: [1, 94] }, t(v, [2, 21]), { 5: [1, 95] }, { 5: [1, 96] }, t(v, [2, 24]), t(v, [2, 25]), t(v, [2, 26]), t(v, [2, 27]), t(v, [2, 28]), t(v, [2, 31]), t(v, [2, 32]), t(dt, s, { 7: 97 }), t(dt, s, { 7: 98 }), t(dt, s, { 7: 99 }), t(et, s, { 40: 100, 7: 101 }), t(N, s, { 42: 102, 7: 103 }), t(N, s, { 7: 103, 42: 104 }), t(Wt, s, { 45: 105, 7: 106 }), t(dt, s, { 7: 107 }), { 5: [1, 109], 51: [1, 108] }, { 5: [1, 111], 51: [1, 110] }, { 5: [1, 112] }, { 22: 115, 68: [1, 113], 69: [1, 114], 70: y }, t(ct, [2, 69]), t(ct, [2, 70]), t(ct, [2, 71]), t(ct, [2, 72]), t(ct, [2, 73]), t(ct, [2, 74]), t(ct, [2, 75]), t(ct, [2, 76]), { 22: 116, 70: y }, { 22: 118, 58: 117, 70: y }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 119, 79: it }, { 56: 121, 79: it }, { 56: 122, 79: it }, { 56: 123, 79: it }, { 4: [1, 126], 5: [1, 128], 11: 125, 12: 127, 16: [1, 124], 50: W, 52: B, 53: C }, { 5: [1, 129] }, t(v, [2, 19]), t(v, [2, 20]), t(v, [2, 22]), t(v, [2, 23]), { 4: i, 5: l, 8: 8, 9: 10, 12: 12, 13: d, 14: p, 16: [1, 130], 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, { 4: i, 5: l, 8: 8, 9: 10, 12: 12, 13: d, 14: p, 16: [1, 131], 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, { 4: i, 5: l, 8: 8, 9: 10, 12: 12, 13: d, 14: p, 16: [1, 132], 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, { 16: [1, 133] }, { 4: i, 5: l, 8: 8, 9: 10, 12: 12, 13: d, 14: p, 16: [2, 46], 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 49: [1, 134], 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, { 16: [1, 135] }, { 4: i, 5: l, 8: 8, 9: 10, 12: 12, 13: d, 14: p, 16: [2, 44], 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 48: [1, 136], 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, { 16: [1, 137] }, { 16: [1, 138] }, { 4: i, 5: l, 8: 8, 9: 10, 12: 12, 13: d, 14: p, 16: [2, 42], 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 47: [1, 139], 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, { 4: i, 5: l, 8: 8, 9: 10, 12: 12, 13: d, 14: p, 16: [1, 140], 17: 15, 18: r, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: m, 31: w, 33: _, 35: I, 36: O, 37: M, 38: V, 39: S, 41: tt, 43: F, 44: X, 46: G, 50: W, 52: B, 53: C, 54: K, 59: q, 60: U, 61: J, 62: Z, 70: y }, { 15: [1, 141] }, t(v, [2, 49]), { 15: [1, 142] }, t(v, [2, 51]), t(v, [2, 52]), { 22: 143, 70: y }, { 22: 144, 70: y }, { 56: 145, 79: it }, { 56: 146, 79: it }, { 56: 147, 79: it }, { 64: [1, 148], 79: [2, 62] }, { 5: [2, 55] }, { 5: [2, 77] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, t(v, [2, 16]), t(L, [2, 10]), { 12: 149, 50: W, 52: B, 53: C }, t(L, [2, 12]), t(L, [2, 13]), t(v, [2, 18]), t(v, [2, 34]), t(v, [2, 35]), t(v, [2, 36]), t(v, [2, 37]), { 15: [1, 150] }, t(v, [2, 38]), { 15: [1, 151] }, t(v, [2, 39]), t(v, [2, 40]), { 15: [1, 152] }, t(v, [2, 41]), { 5: [1, 153] }, { 5: [1, 154] }, { 56: 155, 79: it }, { 56: 156, 79: it }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 157, 70: y }, t(L, [2, 11]), t(et, s, { 7: 101, 40: 158 }), t(N, s, { 7: 103, 42: 159 }), t(Wt, s, { 7: 106, 45: 160 }), t(v, [2, 48]), t(v, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 79: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
|
|
205
|
+
defaultActions: { 5: [2, 1], 6: [2, 2], 85: [2, 63], 86: [2, 64], 119: [2, 55], 120: [2, 77], 121: [2, 56], 122: [2, 57], 123: [2, 58], 145: [2, 67], 146: [2, 53], 147: [2, 54], 155: [2, 65], 156: [2, 66], 157: [2, 61], 158: [2, 47], 159: [2, 45], 160: [2, 43] },
|
|
206
|
+
parseError: function(at, f) {
|
|
207
|
+
if (f.recoverable)
|
|
208
|
+
this.trace(at);
|
|
209
|
+
else {
|
|
210
|
+
var k = new Error(at);
|
|
211
|
+
throw k.hash = f, k;
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
parse: function(at) {
|
|
215
|
+
var f = this, k = [0], b = [], A = [null], n = [], z = this.table, h = "", Tt = 0, qt = 0, pe = 2, zt = 1, ge = n.slice.call(arguments, 1), Y = Object.create(this.lexer), ht = { yy: {} };
|
|
216
|
+
for (var Mt in this.yy)
|
|
217
|
+
Object.prototype.hasOwnProperty.call(this.yy, Mt) && (ht.yy[Mt] = this.yy[Mt]);
|
|
218
|
+
Y.setInput(at, ht.yy), ht.yy.lexer = Y, ht.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
|
|
219
|
+
var At = Y.yylloc;
|
|
220
|
+
n.push(At);
|
|
221
|
+
var ue = Y.options && Y.options.ranges;
|
|
222
|
+
typeof ht.yy.parseError == "function" ? this.parseError = ht.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
223
|
+
function xe() {
|
|
224
|
+
var nt;
|
|
225
|
+
return nt = b.pop() || Y.lex() || zt, typeof nt != "number" && (nt instanceof Array && (b = nt, nt = b.pop()), nt = f.symbols_[nt] || nt), nt;
|
|
226
|
+
}
|
|
227
|
+
for (var H, pt, Q, St, mt = {}, wt, ot, Ht, Pt; ; ) {
|
|
228
|
+
if (pt = k[k.length - 1], this.defaultActions[pt] ? Q = this.defaultActions[pt] : ((H === null || typeof H > "u") && (H = xe()), Q = z[pt] && z[pt][H]), typeof Q > "u" || !Q.length || !Q[0]) {
|
|
229
|
+
var Ot = "";
|
|
230
|
+
Pt = [];
|
|
231
|
+
for (wt in z[pt])
|
|
232
|
+
this.terminals_[wt] && wt > pe && Pt.push("'" + this.terminals_[wt] + "'");
|
|
233
|
+
Y.showPosition ? Ot = "Parse error on line " + (Tt + 1) + `:
|
|
234
|
+
` + Y.showPosition() + `
|
|
235
|
+
Expecting ` + Pt.join(", ") + ", got '" + (this.terminals_[H] || H) + "'" : Ot = "Parse error on line " + (Tt + 1) + ": Unexpected " + (H == zt ? "end of input" : "'" + (this.terminals_[H] || H) + "'"), this.parseError(Ot, {
|
|
236
|
+
text: Y.match,
|
|
237
|
+
token: this.terminals_[H] || H,
|
|
238
|
+
line: Y.yylineno,
|
|
239
|
+
loc: At,
|
|
240
|
+
expected: Pt
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
if (Q[0] instanceof Array && Q.length > 1)
|
|
244
|
+
throw new Error("Parse Error: multiple actions possible at state: " + pt + ", token: " + H);
|
|
245
|
+
switch (Q[0]) {
|
|
246
|
+
case 1:
|
|
247
|
+
k.push(H), A.push(Y.yytext), n.push(Y.yylloc), k.push(Q[1]), H = null, qt = Y.yyleng, h = Y.yytext, Tt = Y.yylineno, At = Y.yylloc;
|
|
248
|
+
break;
|
|
249
|
+
case 2:
|
|
250
|
+
if (ot = this.productions_[Q[1]][1], mt.$ = A[A.length - ot], mt._$ = {
|
|
251
|
+
first_line: n[n.length - (ot || 1)].first_line,
|
|
252
|
+
last_line: n[n.length - 1].last_line,
|
|
253
|
+
first_column: n[n.length - (ot || 1)].first_column,
|
|
254
|
+
last_column: n[n.length - 1].last_column
|
|
255
|
+
}, ue && (mt._$.range = [
|
|
256
|
+
n[n.length - (ot || 1)].range[0],
|
|
257
|
+
n[n.length - 1].range[1]
|
|
258
|
+
]), St = this.performAction.apply(mt, [
|
|
259
|
+
h,
|
|
260
|
+
qt,
|
|
261
|
+
Tt,
|
|
262
|
+
ht.yy,
|
|
263
|
+
Q[1],
|
|
264
|
+
A,
|
|
265
|
+
n
|
|
266
|
+
].concat(ge)), typeof St < "u")
|
|
267
|
+
return St;
|
|
268
|
+
ot && (k = k.slice(0, -1 * ot * 2), A = A.slice(0, -1 * ot), n = n.slice(0, -1 * ot)), k.push(this.productions_[Q[1]][0]), A.push(mt.$), n.push(mt._$), Ht = z[k[k.length - 2]][k[k.length - 1]], k.push(Ht);
|
|
269
|
+
break;
|
|
270
|
+
case 3:
|
|
271
|
+
return !0;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return !0;
|
|
275
|
+
}
|
|
276
|
+
}, he = /* @__PURE__ */ function() {
|
|
277
|
+
var at = {
|
|
278
|
+
EOF: 1,
|
|
279
|
+
parseError: function(f, k) {
|
|
280
|
+
if (this.yy.parser)
|
|
281
|
+
this.yy.parser.parseError(f, k);
|
|
282
|
+
else
|
|
283
|
+
throw new Error(f);
|
|
284
|
+
},
|
|
285
|
+
// resets the lexer, sets new input
|
|
286
|
+
setInput: function(f, k) {
|
|
287
|
+
return this.yy = k || this.yy || {}, this._input = f, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
288
|
+
first_line: 1,
|
|
289
|
+
first_column: 0,
|
|
290
|
+
last_line: 1,
|
|
291
|
+
last_column: 0
|
|
292
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
293
|
+
},
|
|
294
|
+
// consumes and returns one char from the input
|
|
295
|
+
input: function() {
|
|
296
|
+
var f = this._input[0];
|
|
297
|
+
this.yytext += f, this.yyleng++, this.offset++, this.match += f, this.matched += f;
|
|
298
|
+
var k = f.match(/(?:\r\n?|\n).*/g);
|
|
299
|
+
return k ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), f;
|
|
300
|
+
},
|
|
301
|
+
// unshifts one char (or a string) into the input
|
|
302
|
+
unput: function(f) {
|
|
303
|
+
var k = f.length, b = f.split(/(?:\r\n?|\n)/g);
|
|
304
|
+
this._input = f + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - k), this.offset -= k;
|
|
305
|
+
var A = this.match.split(/(?:\r\n?|\n)/g);
|
|
306
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), b.length - 1 && (this.yylineno -= b.length - 1);
|
|
307
|
+
var n = this.yylloc.range;
|
|
308
|
+
return this.yylloc = {
|
|
309
|
+
first_line: this.yylloc.first_line,
|
|
310
|
+
last_line: this.yylineno + 1,
|
|
311
|
+
first_column: this.yylloc.first_column,
|
|
312
|
+
last_column: b ? (b.length === A.length ? this.yylloc.first_column : 0) + A[A.length - b.length].length - b[0].length : this.yylloc.first_column - k
|
|
313
|
+
}, this.options.ranges && (this.yylloc.range = [n[0], n[0] + this.yyleng - k]), this.yyleng = this.yytext.length, this;
|
|
314
|
+
},
|
|
315
|
+
// When called from action, caches matched text and appends it on next action
|
|
316
|
+
more: function() {
|
|
317
|
+
return this._more = !0, this;
|
|
318
|
+
},
|
|
319
|
+
// 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.
|
|
320
|
+
reject: function() {
|
|
321
|
+
if (this.options.backtrack_lexer)
|
|
322
|
+
this._backtrack = !0;
|
|
323
|
+
else
|
|
324
|
+
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).
|
|
325
|
+
` + this.showPosition(), {
|
|
326
|
+
text: "",
|
|
327
|
+
token: null,
|
|
328
|
+
line: this.yylineno
|
|
329
|
+
});
|
|
330
|
+
return this;
|
|
331
|
+
},
|
|
332
|
+
// retain first n characters of the match
|
|
333
|
+
less: function(f) {
|
|
334
|
+
this.unput(this.match.slice(f));
|
|
335
|
+
},
|
|
336
|
+
// displays already matched input, i.e. for error messages
|
|
337
|
+
pastInput: function() {
|
|
338
|
+
var f = this.matched.substr(0, this.matched.length - this.match.length);
|
|
339
|
+
return (f.length > 20 ? "..." : "") + f.substr(-20).replace(/\n/g, "");
|
|
340
|
+
},
|
|
341
|
+
// displays upcoming input, i.e. for error messages
|
|
342
|
+
upcomingInput: function() {
|
|
343
|
+
var f = this.match;
|
|
344
|
+
return f.length < 20 && (f += this._input.substr(0, 20 - f.length)), (f.substr(0, 20) + (f.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
345
|
+
},
|
|
346
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
347
|
+
showPosition: function() {
|
|
348
|
+
var f = this.pastInput(), k = new Array(f.length + 1).join("-");
|
|
349
|
+
return f + this.upcomingInput() + `
|
|
350
|
+
` + k + "^";
|
|
351
|
+
},
|
|
352
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
353
|
+
test_match: function(f, k) {
|
|
354
|
+
var b, A, n;
|
|
355
|
+
if (this.options.backtrack_lexer && (n = {
|
|
356
|
+
yylineno: this.yylineno,
|
|
357
|
+
yylloc: {
|
|
358
|
+
first_line: this.yylloc.first_line,
|
|
359
|
+
last_line: this.last_line,
|
|
360
|
+
first_column: this.yylloc.first_column,
|
|
361
|
+
last_column: this.yylloc.last_column
|
|
362
|
+
},
|
|
363
|
+
yytext: this.yytext,
|
|
364
|
+
match: this.match,
|
|
365
|
+
matches: this.matches,
|
|
366
|
+
matched: this.matched,
|
|
367
|
+
yyleng: this.yyleng,
|
|
368
|
+
offset: this.offset,
|
|
369
|
+
_more: this._more,
|
|
370
|
+
_input: this._input,
|
|
371
|
+
yy: this.yy,
|
|
372
|
+
conditionStack: this.conditionStack.slice(0),
|
|
373
|
+
done: this.done
|
|
374
|
+
}, this.options.ranges && (n.yylloc.range = this.yylloc.range.slice(0))), A = f[0].match(/(?:\r\n?|\n).*/g), A && (this.yylineno += A.length), this.yylloc = {
|
|
375
|
+
first_line: this.yylloc.last_line,
|
|
376
|
+
last_line: this.yylineno + 1,
|
|
377
|
+
first_column: this.yylloc.last_column,
|
|
378
|
+
last_column: A ? A[A.length - 1].length - A[A.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + f[0].length
|
|
379
|
+
}, this.yytext += f[0], this.match += f[0], this.matches = f, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(f[0].length), this.matched += f[0], b = this.performAction.call(this, this.yy, this, k, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), b)
|
|
380
|
+
return b;
|
|
381
|
+
if (this._backtrack) {
|
|
382
|
+
for (var z in n)
|
|
383
|
+
this[z] = n[z];
|
|
384
|
+
return !1;
|
|
385
|
+
}
|
|
386
|
+
return !1;
|
|
387
|
+
},
|
|
388
|
+
// return next match in input
|
|
389
|
+
next: function() {
|
|
390
|
+
if (this.done)
|
|
391
|
+
return this.EOF;
|
|
392
|
+
this._input || (this.done = !0);
|
|
393
|
+
var f, k, b, A;
|
|
394
|
+
this._more || (this.yytext = "", this.match = "");
|
|
395
|
+
for (var n = this._currentRules(), z = 0; z < n.length; z++)
|
|
396
|
+
if (b = this._input.match(this.rules[n[z]]), b && (!k || b[0].length > k[0].length)) {
|
|
397
|
+
if (k = b, A = z, this.options.backtrack_lexer) {
|
|
398
|
+
if (f = this.test_match(b, n[z]), f !== !1)
|
|
399
|
+
return f;
|
|
400
|
+
if (this._backtrack) {
|
|
401
|
+
k = !1;
|
|
402
|
+
continue;
|
|
403
|
+
} else
|
|
404
|
+
return !1;
|
|
405
|
+
} else if (!this.options.flex)
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
return k ? (f = this.test_match(k, n[A]), f !== !1 ? f : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
409
|
+
` + this.showPosition(), {
|
|
410
|
+
text: "",
|
|
411
|
+
token: null,
|
|
412
|
+
line: this.yylineno
|
|
413
|
+
});
|
|
414
|
+
},
|
|
415
|
+
// return next match that has a token
|
|
416
|
+
lex: function() {
|
|
417
|
+
var f = this.next();
|
|
418
|
+
return f || this.lex();
|
|
419
|
+
},
|
|
420
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
421
|
+
begin: function(f) {
|
|
422
|
+
this.conditionStack.push(f);
|
|
423
|
+
},
|
|
424
|
+
// pop the previously active lexer condition state off the condition stack
|
|
425
|
+
popState: function() {
|
|
426
|
+
var f = this.conditionStack.length - 1;
|
|
427
|
+
return f > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
428
|
+
},
|
|
429
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
430
|
+
_currentRules: function() {
|
|
431
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
432
|
+
},
|
|
433
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
434
|
+
topState: function(f) {
|
|
435
|
+
return f = this.conditionStack.length - 1 - Math.abs(f || 0), f >= 0 ? this.conditionStack[f] : "INITIAL";
|
|
436
|
+
},
|
|
437
|
+
// alias for begin(condition)
|
|
438
|
+
pushState: function(f) {
|
|
439
|
+
this.begin(f);
|
|
440
|
+
},
|
|
441
|
+
// return the number of states currently on the stack
|
|
442
|
+
stateStackSize: function() {
|
|
443
|
+
return this.conditionStack.length;
|
|
444
|
+
},
|
|
445
|
+
options: { "case-insensitive": !0 },
|
|
446
|
+
performAction: function(f, k, b, A) {
|
|
447
|
+
switch (b) {
|
|
448
|
+
case 0:
|
|
449
|
+
return 5;
|
|
450
|
+
case 1:
|
|
451
|
+
break;
|
|
452
|
+
case 2:
|
|
453
|
+
break;
|
|
454
|
+
case 3:
|
|
455
|
+
break;
|
|
456
|
+
case 4:
|
|
457
|
+
break;
|
|
458
|
+
case 5:
|
|
459
|
+
break;
|
|
460
|
+
case 6:
|
|
461
|
+
return 19;
|
|
462
|
+
case 7:
|
|
463
|
+
return this.begin("LINE"), 14;
|
|
464
|
+
case 8:
|
|
465
|
+
return this.begin("ID"), 50;
|
|
466
|
+
case 9:
|
|
467
|
+
return this.begin("ID"), 52;
|
|
468
|
+
case 10:
|
|
469
|
+
return 13;
|
|
470
|
+
case 11:
|
|
471
|
+
return this.begin("ID"), 53;
|
|
472
|
+
case 12:
|
|
473
|
+
return k.yytext = k.yytext.trim(), this.begin("ALIAS"), 70;
|
|
474
|
+
case 13:
|
|
475
|
+
return this.popState(), this.popState(), this.begin("LINE"), 51;
|
|
476
|
+
case 14:
|
|
477
|
+
return this.popState(), this.popState(), 5;
|
|
478
|
+
case 15:
|
|
479
|
+
return this.begin("LINE"), 36;
|
|
480
|
+
case 16:
|
|
481
|
+
return this.begin("LINE"), 37;
|
|
482
|
+
case 17:
|
|
483
|
+
return this.begin("LINE"), 38;
|
|
484
|
+
case 18:
|
|
485
|
+
return this.begin("LINE"), 39;
|
|
486
|
+
case 19:
|
|
487
|
+
return this.begin("LINE"), 49;
|
|
488
|
+
case 20:
|
|
489
|
+
return this.begin("LINE"), 41;
|
|
490
|
+
case 21:
|
|
491
|
+
return this.begin("LINE"), 43;
|
|
492
|
+
case 22:
|
|
493
|
+
return this.begin("LINE"), 48;
|
|
494
|
+
case 23:
|
|
495
|
+
return this.begin("LINE"), 44;
|
|
496
|
+
case 24:
|
|
497
|
+
return this.begin("LINE"), 47;
|
|
498
|
+
case 25:
|
|
499
|
+
return this.begin("LINE"), 46;
|
|
500
|
+
case 26:
|
|
501
|
+
return this.popState(), 15;
|
|
502
|
+
case 27:
|
|
503
|
+
return 16;
|
|
504
|
+
case 28:
|
|
505
|
+
return 65;
|
|
506
|
+
case 29:
|
|
507
|
+
return 66;
|
|
508
|
+
case 30:
|
|
509
|
+
return 59;
|
|
510
|
+
case 31:
|
|
511
|
+
return 60;
|
|
512
|
+
case 32:
|
|
513
|
+
return 61;
|
|
514
|
+
case 33:
|
|
515
|
+
return 62;
|
|
516
|
+
case 34:
|
|
517
|
+
return 57;
|
|
518
|
+
case 35:
|
|
519
|
+
return 54;
|
|
520
|
+
case 36:
|
|
521
|
+
return this.begin("ID"), 21;
|
|
522
|
+
case 37:
|
|
523
|
+
return this.begin("ID"), 23;
|
|
524
|
+
case 38:
|
|
525
|
+
return 29;
|
|
526
|
+
case 39:
|
|
527
|
+
return 30;
|
|
528
|
+
case 40:
|
|
529
|
+
return this.begin("acc_title"), 31;
|
|
530
|
+
case 41:
|
|
531
|
+
return this.popState(), "acc_title_value";
|
|
532
|
+
case 42:
|
|
533
|
+
return this.begin("acc_descr"), 33;
|
|
534
|
+
case 43:
|
|
535
|
+
return this.popState(), "acc_descr_value";
|
|
536
|
+
case 44:
|
|
537
|
+
this.begin("acc_descr_multiline");
|
|
538
|
+
break;
|
|
539
|
+
case 45:
|
|
540
|
+
this.popState();
|
|
541
|
+
break;
|
|
542
|
+
case 46:
|
|
543
|
+
return "acc_descr_multiline_value";
|
|
544
|
+
case 47:
|
|
545
|
+
return 6;
|
|
546
|
+
case 48:
|
|
547
|
+
return 18;
|
|
548
|
+
case 49:
|
|
549
|
+
return 20;
|
|
550
|
+
case 50:
|
|
551
|
+
return 64;
|
|
552
|
+
case 51:
|
|
553
|
+
return 5;
|
|
554
|
+
case 52:
|
|
555
|
+
return k.yytext = k.yytext.trim(), 70;
|
|
556
|
+
case 53:
|
|
557
|
+
return 73;
|
|
558
|
+
case 54:
|
|
559
|
+
return 74;
|
|
560
|
+
case 55:
|
|
561
|
+
return 71;
|
|
562
|
+
case 56:
|
|
563
|
+
return 72;
|
|
564
|
+
case 57:
|
|
565
|
+
return 75;
|
|
566
|
+
case 58:
|
|
567
|
+
return 76;
|
|
568
|
+
case 59:
|
|
569
|
+
return 77;
|
|
570
|
+
case 60:
|
|
571
|
+
return 78;
|
|
572
|
+
case 61:
|
|
573
|
+
return 79;
|
|
574
|
+
case 62:
|
|
575
|
+
return 68;
|
|
576
|
+
case 63:
|
|
577
|
+
return 69;
|
|
578
|
+
case 64:
|
|
579
|
+
return 5;
|
|
580
|
+
case 65:
|
|
581
|
+
return "INVALID";
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
|
|
585
|
+
conditions: { acc_descr_multiline: { rules: [45, 46], inclusive: !1 }, acc_descr: { rules: [43], inclusive: !1 }, acc_title: { rules: [41], inclusive: !1 }, ID: { rules: [2, 3, 12], inclusive: !1 }, ALIAS: { rules: [2, 3, 13, 14], inclusive: !1 }, LINE: { rules: [2, 3, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65], inclusive: !0 } }
|
|
586
|
+
};
|
|
587
|
+
return at;
|
|
588
|
+
}();
|
|
589
|
+
It.lexer = he;
|
|
590
|
+
function Nt() {
|
|
591
|
+
this.yy = {};
|
|
592
|
+
}
|
|
593
|
+
return Nt.prototype = It, It.Parser = Nt, new Nt();
|
|
594
|
+
}();
|
|
595
|
+
Dt.parser = Dt;
|
|
596
|
+
const Ne = Dt;
|
|
597
|
+
class Me {
|
|
598
|
+
/**
|
|
599
|
+
* @param init - Function that creates the default state.
|
|
600
|
+
*/
|
|
601
|
+
constructor(e) {
|
|
602
|
+
this.init = e, this.records = this.init();
|
|
603
|
+
}
|
|
604
|
+
reset() {
|
|
605
|
+
this.records = this.init();
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
const T = new Me(() => ({
|
|
609
|
+
prevActor: void 0,
|
|
610
|
+
actors: {},
|
|
611
|
+
createdActors: {},
|
|
612
|
+
destroyedActors: {},
|
|
613
|
+
boxes: [],
|
|
614
|
+
messages: [],
|
|
615
|
+
notes: [],
|
|
616
|
+
sequenceNumbersEnabled: !1,
|
|
617
|
+
wrapEnabled: void 0,
|
|
618
|
+
currentBox: void 0,
|
|
619
|
+
lastCreated: void 0,
|
|
620
|
+
lastDestroyed: void 0
|
|
621
|
+
})), Ae = function(t) {
|
|
622
|
+
T.records.boxes.push({
|
|
623
|
+
name: t.text,
|
|
624
|
+
wrap: t.wrap === void 0 && ut() || !!t.wrap,
|
|
625
|
+
fill: t.color,
|
|
626
|
+
actorKeys: []
|
|
627
|
+
}), T.records.currentBox = T.records.boxes.slice(-1)[0];
|
|
628
|
+
}, Rt = function(t, e, c, a) {
|
|
629
|
+
let s = T.records.currentBox;
|
|
630
|
+
const i = T.records.actors[t];
|
|
631
|
+
if (i) {
|
|
632
|
+
if (T.records.currentBox && i.box && T.records.currentBox !== i.box)
|
|
633
|
+
throw new Error(
|
|
634
|
+
"A same participant should only be defined in one Box: " + i.name + " can't be in '" + i.box.name + "' and in '" + T.records.currentBox.name + "' at the same time."
|
|
635
|
+
);
|
|
636
|
+
if (s = i.box ? i.box : T.records.currentBox, i.box = s, i && e === i.name && c == null)
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
(c == null || c.text == null) && (c = { text: e, wrap: null, type: a }), (a == null || c.text == null) && (c = { text: e, wrap: null, type: a }), T.records.actors[t] = {
|
|
640
|
+
box: s,
|
|
641
|
+
name: e,
|
|
642
|
+
description: c.text,
|
|
643
|
+
wrap: c.wrap === void 0 && ut() || !!c.wrap,
|
|
644
|
+
prevActor: T.records.prevActor,
|
|
645
|
+
links: {},
|
|
646
|
+
properties: {},
|
|
647
|
+
actorCnt: null,
|
|
648
|
+
rectData: null,
|
|
649
|
+
type: a || "participant"
|
|
650
|
+
}, T.records.prevActor && T.records.actors[T.records.prevActor] && (T.records.actors[T.records.prevActor].nextActor = t), T.records.currentBox && T.records.currentBox.actorKeys.push(t), T.records.prevActor = t;
|
|
651
|
+
}, Se = (t) => {
|
|
652
|
+
let e, c = 0;
|
|
653
|
+
for (e = 0; e < T.records.messages.length; e++)
|
|
654
|
+
T.records.messages[e].type === ft.ACTIVE_START && T.records.messages[e].from.actor === t && c++, T.records.messages[e].type === ft.ACTIVE_END && T.records.messages[e].from.actor === t && c--;
|
|
655
|
+
return c;
|
|
656
|
+
}, Oe = function(t, e, c, a) {
|
|
657
|
+
T.records.messages.push({
|
|
658
|
+
from: t,
|
|
659
|
+
to: e,
|
|
660
|
+
message: c.text,
|
|
661
|
+
wrap: c.wrap === void 0 && ut() || !!c.wrap,
|
|
662
|
+
answer: a
|
|
663
|
+
});
|
|
664
|
+
}, D = function(t, e, c = { text: void 0, wrap: void 0 }, a, s = !1) {
|
|
665
|
+
if (a === ft.ACTIVE_END && Se(t.actor) < 1) {
|
|
666
|
+
let i = new Error("Trying to inactivate an inactive participant (" + t.actor + ")");
|
|
667
|
+
throw i.hash = {
|
|
668
|
+
text: "->>-",
|
|
669
|
+
token: "->>-",
|
|
670
|
+
line: "1",
|
|
671
|
+
loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
|
|
672
|
+
expected: ["'ACTIVE_PARTICIPANT'"]
|
|
673
|
+
}, i;
|
|
674
|
+
}
|
|
675
|
+
return T.records.messages.push({
|
|
676
|
+
from: t,
|
|
677
|
+
to: e,
|
|
678
|
+
message: c.text,
|
|
679
|
+
wrap: c.wrap === void 0 && ut() || !!c.wrap,
|
|
680
|
+
type: a,
|
|
681
|
+
activate: s
|
|
682
|
+
}), !0;
|
|
683
|
+
}, De = function() {
|
|
684
|
+
return T.records.boxes.length > 0;
|
|
685
|
+
}, Re = function() {
|
|
686
|
+
return T.records.boxes.some((t) => t.name);
|
|
687
|
+
}, Ce = function() {
|
|
688
|
+
return T.records.messages;
|
|
689
|
+
}, $e = function() {
|
|
690
|
+
return T.records.boxes;
|
|
691
|
+
}, Ye = function() {
|
|
692
|
+
return T.records.actors;
|
|
693
|
+
}, Be = function() {
|
|
694
|
+
return T.records.createdActors;
|
|
695
|
+
}, Ve = function() {
|
|
696
|
+
return T.records.destroyedActors;
|
|
697
|
+
}, Et = function(t) {
|
|
698
|
+
return T.records.actors[t];
|
|
699
|
+
}, Fe = function() {
|
|
700
|
+
return Object.keys(T.records.actors);
|
|
701
|
+
}, We = function() {
|
|
702
|
+
T.records.sequenceNumbersEnabled = !0;
|
|
703
|
+
}, qe = function() {
|
|
704
|
+
T.records.sequenceNumbersEnabled = !1;
|
|
705
|
+
}, ze = () => T.records.sequenceNumbersEnabled, He = function(t) {
|
|
706
|
+
T.records.wrapEnabled = t;
|
|
707
|
+
}, ut = () => T.records.wrapEnabled !== void 0 ? T.records.wrapEnabled : lt().sequence.wrap, je = function() {
|
|
708
|
+
T.reset(), Te();
|
|
709
|
+
}, Xe = function(t) {
|
|
710
|
+
const e = t.trim(), c = {
|
|
711
|
+
text: e.replace(/^:?(?:no)?wrap:/, "").trim(),
|
|
712
|
+
wrap: e.match(/^:?wrap:/) !== null ? !0 : e.match(/^:?nowrap:/) !== null ? !1 : void 0
|
|
713
|
+
};
|
|
714
|
+
return j.debug("parseMessage:", c), c;
|
|
715
|
+
}, Ke = function(t) {
|
|
716
|
+
const e = t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);
|
|
717
|
+
let c = e != null && e[1] ? e[1].trim() : "transparent", a = e != null && e[2] ? e[2].trim() : void 0;
|
|
718
|
+
if (window && window.CSS)
|
|
719
|
+
window.CSS.supports("color", c) || (c = "transparent", a = t.trim());
|
|
720
|
+
else {
|
|
721
|
+
const s = new Option().style;
|
|
722
|
+
s.color = c, s.color !== c && (c = "transparent", a = t.trim());
|
|
723
|
+
}
|
|
724
|
+
return {
|
|
725
|
+
color: c,
|
|
726
|
+
text: a !== void 0 ? kt(a.replace(/^:?(?:no)?wrap:/, ""), lt()) : void 0,
|
|
727
|
+
wrap: a !== void 0 ? a.match(/^:?wrap:/) !== null ? !0 : a.match(/^:?nowrap:/) !== null ? !1 : void 0 : void 0
|
|
728
|
+
};
|
|
729
|
+
}, ft = {
|
|
730
|
+
SOLID: 0,
|
|
731
|
+
DOTTED: 1,
|
|
732
|
+
NOTE: 2,
|
|
733
|
+
SOLID_CROSS: 3,
|
|
734
|
+
DOTTED_CROSS: 4,
|
|
735
|
+
SOLID_OPEN: 5,
|
|
736
|
+
DOTTED_OPEN: 6,
|
|
737
|
+
LOOP_START: 10,
|
|
738
|
+
LOOP_END: 11,
|
|
739
|
+
ALT_START: 12,
|
|
740
|
+
ALT_ELSE: 13,
|
|
741
|
+
ALT_END: 14,
|
|
742
|
+
OPT_START: 15,
|
|
743
|
+
OPT_END: 16,
|
|
744
|
+
ACTIVE_START: 17,
|
|
745
|
+
ACTIVE_END: 18,
|
|
746
|
+
PAR_START: 19,
|
|
747
|
+
PAR_AND: 20,
|
|
748
|
+
PAR_END: 21,
|
|
749
|
+
RECT_START: 22,
|
|
750
|
+
RECT_END: 23,
|
|
751
|
+
SOLID_POINT: 24,
|
|
752
|
+
DOTTED_POINT: 25,
|
|
753
|
+
AUTONUMBER: 26,
|
|
754
|
+
CRITICAL_START: 27,
|
|
755
|
+
CRITICAL_OPTION: 28,
|
|
756
|
+
CRITICAL_END: 29,
|
|
757
|
+
BREAK_START: 30,
|
|
758
|
+
BREAK_END: 31,
|
|
759
|
+
PAR_OVER_START: 32
|
|
760
|
+
}, Ue = {
|
|
761
|
+
FILLED: 0,
|
|
762
|
+
OPEN: 1
|
|
763
|
+
}, Ge = {
|
|
764
|
+
LEFTOF: 0,
|
|
765
|
+
RIGHTOF: 1,
|
|
766
|
+
OVER: 2
|
|
767
|
+
}, Jt = function(t, e, c) {
|
|
768
|
+
const a = {
|
|
769
|
+
actor: t,
|
|
770
|
+
placement: e,
|
|
771
|
+
message: c.text,
|
|
772
|
+
wrap: c.wrap === void 0 && ut() || !!c.wrap
|
|
773
|
+
}, s = [].concat(t, t);
|
|
774
|
+
T.records.notes.push(a), T.records.messages.push({
|
|
775
|
+
from: s[0],
|
|
776
|
+
to: s[1],
|
|
777
|
+
message: c.text,
|
|
778
|
+
wrap: c.wrap === void 0 && ut() || !!c.wrap,
|
|
779
|
+
type: ft.NOTE,
|
|
780
|
+
placement: e
|
|
781
|
+
});
|
|
782
|
+
}, Zt = function(t, e) {
|
|
783
|
+
const c = Et(t);
|
|
784
|
+
try {
|
|
785
|
+
let a = kt(e.text, lt());
|
|
786
|
+
a = a.replace(/&/g, "&"), a = a.replace(/=/g, "=");
|
|
787
|
+
const s = JSON.parse(a);
|
|
788
|
+
Bt(c, s);
|
|
789
|
+
} catch (a) {
|
|
790
|
+
j.error("error while parsing actor link text", a);
|
|
791
|
+
}
|
|
792
|
+
}, Je = function(t, e) {
|
|
793
|
+
const c = Et(t);
|
|
794
|
+
try {
|
|
795
|
+
const l = {};
|
|
796
|
+
let d = kt(e.text, lt());
|
|
797
|
+
var a = d.indexOf("@");
|
|
798
|
+
d = d.replace(/&/g, "&"), d = d.replace(/=/g, "=");
|
|
799
|
+
var s = d.slice(0, a - 1).trim(), i = d.slice(a + 1).trim();
|
|
800
|
+
l[s] = i, Bt(c, l);
|
|
801
|
+
} catch (l) {
|
|
802
|
+
j.error("error while parsing actor link text", l);
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
function Bt(t, e) {
|
|
806
|
+
if (t.links == null)
|
|
807
|
+
t.links = e;
|
|
808
|
+
else
|
|
809
|
+
for (let c in e)
|
|
810
|
+
t.links[c] = e[c];
|
|
811
|
+
}
|
|
812
|
+
const Qt = function(t, e) {
|
|
813
|
+
const c = Et(t);
|
|
814
|
+
try {
|
|
815
|
+
let a = kt(e.text, lt());
|
|
816
|
+
const s = JSON.parse(a);
|
|
817
|
+
te(c, s);
|
|
818
|
+
} catch (a) {
|
|
819
|
+
j.error("error while parsing actor properties text", a);
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
function te(t, e) {
|
|
823
|
+
if (t.properties == null)
|
|
824
|
+
t.properties = e;
|
|
825
|
+
else
|
|
826
|
+
for (let c in e)
|
|
827
|
+
t.properties[c] = e[c];
|
|
828
|
+
}
|
|
829
|
+
function Ze() {
|
|
830
|
+
T.records.currentBox = void 0;
|
|
831
|
+
}
|
|
832
|
+
const ee = function(t, e) {
|
|
833
|
+
const c = Et(t), a = document.getElementById(e.text);
|
|
834
|
+
try {
|
|
835
|
+
const s = a.innerHTML, i = JSON.parse(s);
|
|
836
|
+
i.properties && te(c, i.properties), i.links && Bt(c, i.links);
|
|
837
|
+
} catch (s) {
|
|
838
|
+
j.error("error while parsing actor details text", s);
|
|
839
|
+
}
|
|
840
|
+
}, Qe = function(t, e) {
|
|
841
|
+
if (t !== void 0 && t.properties !== void 0)
|
|
842
|
+
return t.properties[e];
|
|
843
|
+
}, ae = function(t) {
|
|
844
|
+
if (Array.isArray(t))
|
|
845
|
+
t.forEach(function(e) {
|
|
846
|
+
ae(e);
|
|
847
|
+
});
|
|
848
|
+
else
|
|
849
|
+
switch (t.type) {
|
|
850
|
+
case "sequenceIndex":
|
|
851
|
+
T.records.messages.push({
|
|
852
|
+
from: void 0,
|
|
853
|
+
to: void 0,
|
|
854
|
+
message: {
|
|
855
|
+
start: t.sequenceIndex,
|
|
856
|
+
step: t.sequenceIndexStep,
|
|
857
|
+
visible: t.sequenceVisible
|
|
858
|
+
},
|
|
859
|
+
wrap: !1,
|
|
860
|
+
type: t.signalType
|
|
861
|
+
});
|
|
862
|
+
break;
|
|
863
|
+
case "addParticipant":
|
|
864
|
+
Rt(t.actor, t.actor, t.description, t.draw);
|
|
865
|
+
break;
|
|
866
|
+
case "createParticipant":
|
|
867
|
+
if (T.records.actors[t.actor])
|
|
868
|
+
throw new Error(
|
|
869
|
+
"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"
|
|
870
|
+
);
|
|
871
|
+
T.records.lastCreated = t.actor, Rt(t.actor, t.actor, t.description, t.draw), T.records.createdActors[t.actor] = T.records.messages.length;
|
|
872
|
+
break;
|
|
873
|
+
case "destroyParticipant":
|
|
874
|
+
T.records.lastDestroyed = t.actor, T.records.destroyedActors[t.actor] = T.records.messages.length;
|
|
875
|
+
break;
|
|
876
|
+
case "activeStart":
|
|
877
|
+
D(t.actor, void 0, void 0, t.signalType);
|
|
878
|
+
break;
|
|
879
|
+
case "activeEnd":
|
|
880
|
+
D(t.actor, void 0, void 0, t.signalType);
|
|
881
|
+
break;
|
|
882
|
+
case "addNote":
|
|
883
|
+
Jt(t.actor, t.placement, t.text);
|
|
884
|
+
break;
|
|
885
|
+
case "addLinks":
|
|
886
|
+
Zt(t.actor, t.text);
|
|
887
|
+
break;
|
|
888
|
+
case "addALink":
|
|
889
|
+
Je(t.actor, t.text);
|
|
890
|
+
break;
|
|
891
|
+
case "addProperties":
|
|
892
|
+
Qt(t.actor, t.text);
|
|
893
|
+
break;
|
|
894
|
+
case "addDetails":
|
|
895
|
+
ee(t.actor, t.text);
|
|
896
|
+
break;
|
|
897
|
+
case "addMessage":
|
|
898
|
+
if (T.records.lastCreated) {
|
|
899
|
+
if (t.to !== T.records.lastCreated)
|
|
900
|
+
throw new Error(
|
|
901
|
+
"The created participant " + T.records.lastCreated + " does not have an associated creating message after its declaration. Please check the sequence diagram."
|
|
902
|
+
);
|
|
903
|
+
T.records.lastCreated = void 0;
|
|
904
|
+
} else if (T.records.lastDestroyed) {
|
|
905
|
+
if (t.to !== T.records.lastDestroyed && t.from !== T.records.lastDestroyed)
|
|
906
|
+
throw new Error(
|
|
907
|
+
"The destroyed participant " + T.records.lastDestroyed + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
|
|
908
|
+
);
|
|
909
|
+
T.records.lastDestroyed = void 0;
|
|
910
|
+
}
|
|
911
|
+
D(t.from, t.to, t.msg, t.signalType, t.activate);
|
|
912
|
+
break;
|
|
913
|
+
case "boxStart":
|
|
914
|
+
Ae(t.boxData);
|
|
915
|
+
break;
|
|
916
|
+
case "boxEnd":
|
|
917
|
+
Ze();
|
|
918
|
+
break;
|
|
919
|
+
case "loopStart":
|
|
920
|
+
D(void 0, void 0, t.loopText, t.signalType);
|
|
921
|
+
break;
|
|
922
|
+
case "loopEnd":
|
|
923
|
+
D(void 0, void 0, void 0, t.signalType);
|
|
924
|
+
break;
|
|
925
|
+
case "rectStart":
|
|
926
|
+
D(void 0, void 0, t.color, t.signalType);
|
|
927
|
+
break;
|
|
928
|
+
case "rectEnd":
|
|
929
|
+
D(void 0, void 0, void 0, t.signalType);
|
|
930
|
+
break;
|
|
931
|
+
case "optStart":
|
|
932
|
+
D(void 0, void 0, t.optText, t.signalType);
|
|
933
|
+
break;
|
|
934
|
+
case "optEnd":
|
|
935
|
+
D(void 0, void 0, void 0, t.signalType);
|
|
936
|
+
break;
|
|
937
|
+
case "altStart":
|
|
938
|
+
D(void 0, void 0, t.altText, t.signalType);
|
|
939
|
+
break;
|
|
940
|
+
case "else":
|
|
941
|
+
D(void 0, void 0, t.altText, t.signalType);
|
|
942
|
+
break;
|
|
943
|
+
case "altEnd":
|
|
944
|
+
D(void 0, void 0, void 0, t.signalType);
|
|
945
|
+
break;
|
|
946
|
+
case "setAccTitle":
|
|
947
|
+
Ut(t.text);
|
|
948
|
+
break;
|
|
949
|
+
case "parStart":
|
|
950
|
+
D(void 0, void 0, t.parText, t.signalType);
|
|
951
|
+
break;
|
|
952
|
+
case "and":
|
|
953
|
+
D(void 0, void 0, t.parText, t.signalType);
|
|
954
|
+
break;
|
|
955
|
+
case "parEnd":
|
|
956
|
+
D(void 0, void 0, void 0, t.signalType);
|
|
957
|
+
break;
|
|
958
|
+
case "criticalStart":
|
|
959
|
+
D(void 0, void 0, t.criticalText, t.signalType);
|
|
960
|
+
break;
|
|
961
|
+
case "option":
|
|
962
|
+
D(void 0, void 0, t.optionText, t.signalType);
|
|
963
|
+
break;
|
|
964
|
+
case "criticalEnd":
|
|
965
|
+
D(void 0, void 0, void 0, t.signalType);
|
|
966
|
+
break;
|
|
967
|
+
case "breakStart":
|
|
968
|
+
D(void 0, void 0, t.breakText, t.signalType);
|
|
969
|
+
break;
|
|
970
|
+
case "breakEnd":
|
|
971
|
+
D(void 0, void 0, void 0, t.signalType);
|
|
972
|
+
break;
|
|
973
|
+
}
|
|
974
|
+
}, jt = {
|
|
975
|
+
addActor: Rt,
|
|
976
|
+
addMessage: Oe,
|
|
977
|
+
addSignal: D,
|
|
978
|
+
addLinks: Zt,
|
|
979
|
+
addDetails: ee,
|
|
980
|
+
addProperties: Qt,
|
|
981
|
+
autoWrap: ut,
|
|
982
|
+
setWrap: He,
|
|
983
|
+
enableSequenceNumbers: We,
|
|
984
|
+
disableSequenceNumbers: qe,
|
|
985
|
+
showSequenceNumbers: ze,
|
|
986
|
+
getMessages: Ce,
|
|
987
|
+
getActors: Ye,
|
|
988
|
+
getCreatedActors: Be,
|
|
989
|
+
getDestroyedActors: Ve,
|
|
990
|
+
getActor: Et,
|
|
991
|
+
getActorKeys: Fe,
|
|
992
|
+
getActorProperty: Qe,
|
|
993
|
+
getAccTitle: me,
|
|
994
|
+
getBoxes: $e,
|
|
995
|
+
getDiagramTitle: be,
|
|
996
|
+
setDiagramTitle: ye,
|
|
997
|
+
getConfig: () => lt().sequence,
|
|
998
|
+
clear: je,
|
|
999
|
+
parseMessage: Xe,
|
|
1000
|
+
parseBoxData: Ke,
|
|
1001
|
+
LINETYPE: ft,
|
|
1002
|
+
ARROWTYPE: Ue,
|
|
1003
|
+
PLACEMENT: Ge,
|
|
1004
|
+
addNote: Jt,
|
|
1005
|
+
setAccTitle: Ut,
|
|
1006
|
+
apply: ae,
|
|
1007
|
+
setAccDescription: fe,
|
|
1008
|
+
getAccDescription: Ee,
|
|
1009
|
+
hasAtLeastOneBox: De,
|
|
1010
|
+
hasAtLeastOneBoxWithTitle: Re
|
|
1011
|
+
}, t0 = (t) => `.actor {
|
|
1012
|
+
stroke: ${t.actorBorder};
|
|
1013
|
+
fill: ${t.actorBkg};
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
text.actor > tspan {
|
|
1017
|
+
fill: ${t.actorTextColor};
|
|
1018
|
+
stroke: none;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.actor-line {
|
|
1022
|
+
stroke: ${t.actorLineColor};
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.messageLine0 {
|
|
1026
|
+
stroke-width: 1.5;
|
|
1027
|
+
stroke-dasharray: none;
|
|
1028
|
+
stroke: ${t.signalColor};
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.messageLine1 {
|
|
1032
|
+
stroke-width: 1.5;
|
|
1033
|
+
stroke-dasharray: 2, 2;
|
|
1034
|
+
stroke: ${t.signalColor};
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
#arrowhead path {
|
|
1038
|
+
fill: ${t.signalColor};
|
|
1039
|
+
stroke: ${t.signalColor};
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
.sequenceNumber {
|
|
1043
|
+
fill: ${t.sequenceNumberColor};
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
#sequencenumber {
|
|
1047
|
+
fill: ${t.signalColor};
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
#crosshead path {
|
|
1051
|
+
fill: ${t.signalColor};
|
|
1052
|
+
stroke: ${t.signalColor};
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
.messageText {
|
|
1056
|
+
fill: ${t.signalTextColor};
|
|
1057
|
+
stroke: none;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
.labelBox {
|
|
1061
|
+
stroke: ${t.labelBoxBorderColor};
|
|
1062
|
+
fill: ${t.labelBoxBkgColor};
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.labelText, .labelText > tspan {
|
|
1066
|
+
fill: ${t.labelTextColor};
|
|
1067
|
+
stroke: none;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
.loopText, .loopText > tspan {
|
|
1071
|
+
fill: ${t.loopTextColor};
|
|
1072
|
+
stroke: none;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
.loopLine {
|
|
1076
|
+
stroke-width: 2px;
|
|
1077
|
+
stroke-dasharray: 2, 2;
|
|
1078
|
+
stroke: ${t.labelBoxBorderColor};
|
|
1079
|
+
fill: ${t.labelBoxBorderColor};
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
.note {
|
|
1083
|
+
//stroke: #decc93;
|
|
1084
|
+
stroke: ${t.noteBorderColor};
|
|
1085
|
+
fill: ${t.noteBkgColor};
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
.noteText, .noteText > tspan {
|
|
1089
|
+
fill: ${t.noteTextColor};
|
|
1090
|
+
stroke: none;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
.activation0 {
|
|
1094
|
+
fill: ${t.activationBkgColor};
|
|
1095
|
+
stroke: ${t.activationBorderColor};
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
.activation1 {
|
|
1099
|
+
fill: ${t.activationBkgColor};
|
|
1100
|
+
stroke: ${t.activationBorderColor};
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
.activation2 {
|
|
1104
|
+
fill: ${t.activationBkgColor};
|
|
1105
|
+
stroke: ${t.activationBorderColor};
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
.actorPopupMenu {
|
|
1109
|
+
position: absolute;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
.actorPopupMenuPanel {
|
|
1113
|
+
position: absolute;
|
|
1114
|
+
fill: ${t.actorBkg};
|
|
1115
|
+
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
|
1116
|
+
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
|
|
1117
|
+
}
|
|
1118
|
+
.actor-man line {
|
|
1119
|
+
stroke: ${t.actorBorder};
|
|
1120
|
+
fill: ${t.actorBkg};
|
|
1121
|
+
}
|
|
1122
|
+
.actor-man circle, line {
|
|
1123
|
+
stroke: ${t.actorBorder};
|
|
1124
|
+
fill: ${t.actorBkg};
|
|
1125
|
+
stroke-width: 2px;
|
|
1126
|
+
}
|
|
1127
|
+
`, e0 = t0, gt = 18 * 2, re = "actor-top", se = "actor-bottom", Vt = function(t, e) {
|
|
1128
|
+
return ke(t, e);
|
|
1129
|
+
}, a0 = function(t, e, c, a, s) {
|
|
1130
|
+
if (e.links === void 0 || e.links === null || Object.keys(e.links).length === 0)
|
|
1131
|
+
return { height: 0, width: 0 };
|
|
1132
|
+
const i = e.links, l = e.actorCnt, d = e.rectData;
|
|
1133
|
+
var p = "none";
|
|
1134
|
+
s && (p = "block !important");
|
|
1135
|
+
const r = t.append("g");
|
|
1136
|
+
r.attr("id", "actor" + l + "_popup"), r.attr("class", "actorPopupMenu"), r.attr("display", p);
|
|
1137
|
+
var x = "";
|
|
1138
|
+
d.class !== void 0 && (x = " " + d.class);
|
|
1139
|
+
let E = d.width > c ? d.width : c;
|
|
1140
|
+
const g = r.append("rect");
|
|
1141
|
+
if (g.attr("class", "actorPopupMenuPanel" + x), g.attr("x", d.x), g.attr("y", d.height), g.attr("fill", d.fill), g.attr("stroke", d.stroke), g.attr("width", E), g.attr("height", d.height), g.attr("rx", d.rx), g.attr("ry", d.ry), i != null) {
|
|
1142
|
+
var m = 20;
|
|
1143
|
+
for (let I in i) {
|
|
1144
|
+
var w = r.append("a"), _ = Kt.sanitizeUrl(i[I]);
|
|
1145
|
+
w.attr("xlink:href", _), w.attr("target", "_blank"), f0(a)(
|
|
1146
|
+
I,
|
|
1147
|
+
w,
|
|
1148
|
+
d.x + 10,
|
|
1149
|
+
d.height + m,
|
|
1150
|
+
E,
|
|
1151
|
+
20,
|
|
1152
|
+
{ class: "actor" },
|
|
1153
|
+
a
|
|
1154
|
+
), m += 30;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return g.attr("height", m), { height: d.height + m, width: E };
|
|
1158
|
+
}, r0 = function(t) {
|
|
1159
|
+
return "var pu = document.getElementById('" + t + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
|
|
1160
|
+
}, yt = function(t, e) {
|
|
1161
|
+
let c = 0, a = 0;
|
|
1162
|
+
const s = e.text.split(P.lineBreakRegex), [i, l] = Gt(e.fontSize);
|
|
1163
|
+
let d = [], p = 0, r = () => e.y;
|
|
1164
|
+
if (e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0)
|
|
1165
|
+
switch (e.valign) {
|
|
1166
|
+
case "top":
|
|
1167
|
+
case "start":
|
|
1168
|
+
r = () => Math.round(e.y + e.textMargin);
|
|
1169
|
+
break;
|
|
1170
|
+
case "middle":
|
|
1171
|
+
case "center":
|
|
1172
|
+
r = () => Math.round(e.y + (c + a + e.textMargin) / 2);
|
|
1173
|
+
break;
|
|
1174
|
+
case "bottom":
|
|
1175
|
+
case "end":
|
|
1176
|
+
r = () => Math.round(
|
|
1177
|
+
e.y + (c + a + 2 * e.textMargin) - e.textMargin
|
|
1178
|
+
);
|
|
1179
|
+
break;
|
|
1180
|
+
}
|
|
1181
|
+
if (e.anchor !== void 0 && e.textMargin !== void 0 && e.width !== void 0)
|
|
1182
|
+
switch (e.anchor) {
|
|
1183
|
+
case "left":
|
|
1184
|
+
case "start":
|
|
1185
|
+
e.x = Math.round(e.x + e.textMargin), e.anchor = "start", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
|
|
1186
|
+
break;
|
|
1187
|
+
case "middle":
|
|
1188
|
+
case "center":
|
|
1189
|
+
e.x = Math.round(e.x + e.width / 2), e.anchor = "middle", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
|
|
1190
|
+
break;
|
|
1191
|
+
case "right":
|
|
1192
|
+
case "end":
|
|
1193
|
+
e.x = Math.round(e.x + e.width - e.textMargin), e.anchor = "end", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
for (let [x, E] of s.entries()) {
|
|
1197
|
+
e.textMargin !== void 0 && e.textMargin === 0 && i !== void 0 && (p = x * i);
|
|
1198
|
+
const g = t.append("text");
|
|
1199
|
+
g.attr("x", e.x), g.attr("y", r()), e.anchor !== void 0 && g.attr("text-anchor", e.anchor).attr("dominant-baseline", e.dominantBaseline).attr("alignment-baseline", e.alignmentBaseline), e.fontFamily !== void 0 && g.style("font-family", e.fontFamily), l !== void 0 && g.style("font-size", l), e.fontWeight !== void 0 && g.style("font-weight", e.fontWeight), e.fill !== void 0 && g.attr("fill", e.fill), e.class !== void 0 && g.attr("class", e.class), e.dy !== void 0 ? g.attr("dy", e.dy) : p !== 0 && g.attr("dy", p);
|
|
1200
|
+
const m = E || we;
|
|
1201
|
+
if (e.tspan) {
|
|
1202
|
+
const w = g.append("tspan");
|
|
1203
|
+
w.attr("x", e.x), e.fill !== void 0 && w.attr("fill", e.fill), w.text(m);
|
|
1204
|
+
} else
|
|
1205
|
+
g.text(m);
|
|
1206
|
+
e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0 && (a += (g._groups || g)[0][0].getBBox().height, c = a), d.push(g);
|
|
1207
|
+
}
|
|
1208
|
+
return d;
|
|
1209
|
+
}, ie = function(t, e) {
|
|
1210
|
+
function c(s, i, l, d, p) {
|
|
1211
|
+
return s + "," + i + " " + (s + l) + "," + i + " " + (s + l) + "," + (i + d - p) + " " + (s + l - p * 1.2) + "," + (i + d) + " " + s + "," + (i + d);
|
|
1212
|
+
}
|
|
1213
|
+
const a = t.append("polygon");
|
|
1214
|
+
return a.attr("points", c(e.x, e.y, e.width, e.height, 7)), a.attr("class", "labelBox"), e.y = e.y + e.height / 2, yt(t, e), a;
|
|
1215
|
+
};
|
|
1216
|
+
let st = -1;
|
|
1217
|
+
const oe = (t, e, c, a) => {
|
|
1218
|
+
t.select && c.forEach((s) => {
|
|
1219
|
+
const i = e[s], l = t.select("#actor" + i.actorCnt);
|
|
1220
|
+
!a.mirrorActors && i.stopy ? l.attr("y2", i.stopy + i.height / 2) : a.mirrorActors && l.attr("y2", i.stopy);
|
|
1221
|
+
});
|
|
1222
|
+
}, s0 = function(t, e, c, a) {
|
|
1223
|
+
const s = a ? e.stopy : e.starty, i = e.x + e.width / 2, l = s + 5, d = t.append("g").lower();
|
|
1224
|
+
var p = d;
|
|
1225
|
+
a || (st++, Object.keys(e.links || {}).length && !c.forceMenus && p.attr("onclick", r0(`actor${st}_popup`)).attr("cursor", "pointer"), p.append("line").attr("id", "actor" + st).attr("x1", i).attr("y1", l).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"), p = d.append("g"), e.actorCnt = st, e.links != null && p.attr("id", "root-" + st));
|
|
1226
|
+
const r = _t();
|
|
1227
|
+
var x = "actor";
|
|
1228
|
+
e.properties != null && e.properties.class ? x = e.properties.class : r.fill = "#eaeaea", a ? x += ` ${se}` : x += ` ${re}`, r.x = e.x, r.y = s, r.width = e.width, r.height = e.height, r.class = x, r.rx = 3, r.ry = 3;
|
|
1229
|
+
const E = Vt(p, r);
|
|
1230
|
+
if (e.rectData = r, e.properties != null && e.properties.icon) {
|
|
1231
|
+
const m = e.properties.icon.trim();
|
|
1232
|
+
m.charAt(0) === "@" ? Le(p, r.x + r.width - 20, r.y + 10, m.substr(1)) : Ie(p, r.x + r.width - 20, r.y + 10, m);
|
|
1233
|
+
}
|
|
1234
|
+
Ft(c)(
|
|
1235
|
+
e.description,
|
|
1236
|
+
p,
|
|
1237
|
+
r.x,
|
|
1238
|
+
r.y,
|
|
1239
|
+
r.width,
|
|
1240
|
+
r.height,
|
|
1241
|
+
{ class: "actor" },
|
|
1242
|
+
c
|
|
1243
|
+
);
|
|
1244
|
+
let g = e.height;
|
|
1245
|
+
if (E.node) {
|
|
1246
|
+
const m = E.node().getBBox();
|
|
1247
|
+
e.height = m.height, g = m.height;
|
|
1248
|
+
}
|
|
1249
|
+
return g;
|
|
1250
|
+
}, i0 = function(t, e, c, a) {
|
|
1251
|
+
const s = a ? e.stopy : e.starty, i = e.x + e.width / 2, l = s + 80;
|
|
1252
|
+
t.lower(), a || (st++, t.append("line").attr("id", "actor" + st).attr("x1", i).attr("y1", l).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"), e.actorCnt = st);
|
|
1253
|
+
const d = t.append("g");
|
|
1254
|
+
let p = "actor-man";
|
|
1255
|
+
a ? p += ` ${se}` : p += ` ${re}`, d.attr("class", p);
|
|
1256
|
+
const r = _t();
|
|
1257
|
+
r.x = e.x, r.y = s, r.fill = "#eaeaea", r.width = e.width, r.height = e.height, r.class = "actor", r.rx = 3, r.ry = 3, d.append("line").attr("id", "actor-man-torso" + st).attr("x1", i).attr("y1", s + 25).attr("x2", i).attr("y2", s + 45), d.append("line").attr("id", "actor-man-arms" + st).attr("x1", i - gt / 2).attr("y1", s + 33).attr("x2", i + gt / 2).attr("y2", s + 33), d.append("line").attr("x1", i - gt / 2).attr("y1", s + 60).attr("x2", i).attr("y2", s + 45), d.append("line").attr("x1", i).attr("y1", s + 45).attr("x2", i + gt / 2 - 2).attr("y2", s + 60);
|
|
1258
|
+
const x = d.append("circle");
|
|
1259
|
+
x.attr("cx", e.x + e.width / 2), x.attr("cy", s + 10), x.attr("r", 15), x.attr("width", e.width), x.attr("height", e.height);
|
|
1260
|
+
const E = d.node().getBBox();
|
|
1261
|
+
return e.height = E.height, Ft(c)(
|
|
1262
|
+
e.description,
|
|
1263
|
+
d,
|
|
1264
|
+
r.x,
|
|
1265
|
+
r.y + 35,
|
|
1266
|
+
r.width,
|
|
1267
|
+
r.height,
|
|
1268
|
+
{ class: "actor" },
|
|
1269
|
+
c
|
|
1270
|
+
), e.height;
|
|
1271
|
+
}, o0 = function(t, e, c, a) {
|
|
1272
|
+
switch (e.type) {
|
|
1273
|
+
case "actor":
|
|
1274
|
+
return i0(t, e, c, a);
|
|
1275
|
+
case "participant":
|
|
1276
|
+
return s0(t, e, c, a);
|
|
1277
|
+
}
|
|
1278
|
+
}, n0 = function(t, e, c) {
|
|
1279
|
+
const a = t.append("g");
|
|
1280
|
+
ne(a, e), e.name && Ft(c)(
|
|
1281
|
+
e.name,
|
|
1282
|
+
a,
|
|
1283
|
+
e.x,
|
|
1284
|
+
e.y + (e.textMaxHeight || 0) / 2,
|
|
1285
|
+
e.width,
|
|
1286
|
+
0,
|
|
1287
|
+
{ class: "text" },
|
|
1288
|
+
c
|
|
1289
|
+
), a.lower();
|
|
1290
|
+
}, c0 = function(t) {
|
|
1291
|
+
return t.append("g");
|
|
1292
|
+
}, l0 = function(t, e, c, a, s) {
|
|
1293
|
+
const i = _t(), l = e.anchored;
|
|
1294
|
+
i.x = e.startx, i.y = e.starty, i.class = "activation" + s % 3, i.width = e.stopx - e.startx, i.height = c - e.starty, Vt(l, i);
|
|
1295
|
+
}, d0 = function(t, e, c, a) {
|
|
1296
|
+
const {
|
|
1297
|
+
boxMargin: s,
|
|
1298
|
+
boxTextMargin: i,
|
|
1299
|
+
labelBoxHeight: l,
|
|
1300
|
+
labelBoxWidth: d,
|
|
1301
|
+
messageFontFamily: p,
|
|
1302
|
+
messageFontSize: r,
|
|
1303
|
+
messageFontWeight: x
|
|
1304
|
+
} = a, E = t.append("g"), g = function(_, I, O, M) {
|
|
1305
|
+
return E.append("line").attr("x1", _).attr("y1", I).attr("x2", O).attr("y2", M).attr("class", "loopLine");
|
|
1306
|
+
};
|
|
1307
|
+
g(e.startx, e.starty, e.stopx, e.starty), g(e.stopx, e.starty, e.stopx, e.stopy), g(e.startx, e.stopy, e.stopx, e.stopy), g(e.startx, e.starty, e.startx, e.stopy), e.sections !== void 0 && e.sections.forEach(function(_) {
|
|
1308
|
+
g(e.startx, _.y, e.stopx, _.y).style(
|
|
1309
|
+
"stroke-dasharray",
|
|
1310
|
+
"3, 3"
|
|
1311
|
+
);
|
|
1312
|
+
});
|
|
1313
|
+
let m = Yt();
|
|
1314
|
+
m.text = c, m.x = e.startx, m.y = e.starty, m.fontFamily = p, m.fontSize = r, m.fontWeight = x, m.anchor = "middle", m.valign = "middle", m.tspan = !1, m.width = d || 50, m.height = l || 20, m.textMargin = i, m.class = "labelText", ie(E, m), m = ce(), m.text = e.title, m.x = e.startx + d / 2 + (e.stopx - e.startx) / 2, m.y = e.starty + s + i, m.anchor = "middle", m.valign = "middle", m.textMargin = i, m.class = "loopText", m.fontFamily = p, m.fontSize = r, m.fontWeight = x, m.wrap = !0;
|
|
1315
|
+
let w = yt(E, m);
|
|
1316
|
+
return e.sectionTitles !== void 0 && e.sectionTitles.forEach(function(_, I) {
|
|
1317
|
+
if (_.message) {
|
|
1318
|
+
m.text = _.message, m.x = e.startx + (e.stopx - e.startx) / 2, m.y = e.sections[I].y + s + i, m.class = "loopText", m.anchor = "middle", m.valign = "middle", m.tspan = !1, m.fontFamily = p, m.fontSize = r, m.fontWeight = x, m.wrap = e.wrap, w = yt(E, m);
|
|
1319
|
+
let O = Math.round(
|
|
1320
|
+
w.map((M) => (M._groups || M)[0][0].getBBox().height).reduce((M, V) => M + V)
|
|
1321
|
+
);
|
|
1322
|
+
e.sections[I].height += O - (s + i);
|
|
1323
|
+
}
|
|
1324
|
+
}), e.height = Math.round(e.stopy - e.starty), E;
|
|
1325
|
+
}, ne = function(t, e) {
|
|
1326
|
+
_e(t, e);
|
|
1327
|
+
}, h0 = function(t) {
|
|
1328
|
+
t.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
|
|
1329
|
+
"d",
|
|
1330
|
+
"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"
|
|
1331
|
+
);
|
|
1332
|
+
}, p0 = function(t) {
|
|
1333
|
+
t.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
|
|
1334
|
+
"d",
|
|
1335
|
+
"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"
|
|
1336
|
+
);
|
|
1337
|
+
}, g0 = function(t) {
|
|
1338
|
+
t.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
|
|
1339
|
+
"d",
|
|
1340
|
+
"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"
|
|
1341
|
+
);
|
|
1342
|
+
}, u0 = function(t) {
|
|
1343
|
+
t.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
|
|
1344
|
+
}, x0 = function(t) {
|
|
1345
|
+
t.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
1346
|
+
}, m0 = function(t) {
|
|
1347
|
+
t.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
|
|
1348
|
+
}, b0 = function(t) {
|
|
1349
|
+
t.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
|
|
1350
|
+
}, ce = function() {
|
|
1351
|
+
return {
|
|
1352
|
+
x: 0,
|
|
1353
|
+
y: 0,
|
|
1354
|
+
fill: void 0,
|
|
1355
|
+
anchor: void 0,
|
|
1356
|
+
style: "#666",
|
|
1357
|
+
width: void 0,
|
|
1358
|
+
height: void 0,
|
|
1359
|
+
textMargin: 0,
|
|
1360
|
+
rx: 0,
|
|
1361
|
+
ry: 0,
|
|
1362
|
+
tspan: !0,
|
|
1363
|
+
valign: void 0
|
|
1364
|
+
};
|
|
1365
|
+
}, y0 = function() {
|
|
1366
|
+
return {
|
|
1367
|
+
x: 0,
|
|
1368
|
+
y: 0,
|
|
1369
|
+
fill: "#EDF2AE",
|
|
1370
|
+
stroke: "#666",
|
|
1371
|
+
width: 100,
|
|
1372
|
+
anchor: "start",
|
|
1373
|
+
height: 100,
|
|
1374
|
+
rx: 0,
|
|
1375
|
+
ry: 0
|
|
1376
|
+
};
|
|
1377
|
+
}, Ft = /* @__PURE__ */ function() {
|
|
1378
|
+
function t(s, i, l, d, p, r, x) {
|
|
1379
|
+
const E = i.append("text").attr("x", l + p / 2).attr("y", d + r / 2 + 5).style("text-anchor", "middle").text(s);
|
|
1380
|
+
a(E, x);
|
|
1381
|
+
}
|
|
1382
|
+
function e(s, i, l, d, p, r, x, E) {
|
|
1383
|
+
const { actorFontSize: g, actorFontFamily: m, actorFontWeight: w } = E, [_, I] = Gt(g), O = s.split(P.lineBreakRegex);
|
|
1384
|
+
for (let M = 0; M < O.length; M++) {
|
|
1385
|
+
const V = M * _ - _ * (O.length - 1) / 2, S = i.append("text").attr("x", l + p / 2).attr("y", d).style("text-anchor", "middle").style("font-size", I).style("font-weight", w).style("font-family", m);
|
|
1386
|
+
S.append("tspan").attr("x", l + p / 2).attr("dy", V).text(O[M]), S.attr("y", d + r / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), a(S, x);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
function c(s, i, l, d, p, r, x, E) {
|
|
1390
|
+
const g = i.append("switch"), m = g.append("foreignObject").attr("x", l).attr("y", d).attr("width", p).attr("height", r).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
1391
|
+
m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(s), e(s, g, l, d, p, r, x, E), a(m, x);
|
|
1392
|
+
}
|
|
1393
|
+
function a(s, i) {
|
|
1394
|
+
for (const l in i)
|
|
1395
|
+
i.hasOwnProperty(l) && s.attr(l, i[l]);
|
|
1396
|
+
}
|
|
1397
|
+
return function(s) {
|
|
1398
|
+
return s.textPlacement === "fo" ? c : s.textPlacement === "old" ? t : e;
|
|
1399
|
+
};
|
|
1400
|
+
}(), f0 = /* @__PURE__ */ function() {
|
|
1401
|
+
function t(s, i, l, d, p, r, x) {
|
|
1402
|
+
const E = i.append("text").attr("x", l).attr("y", d).style("text-anchor", "start").text(s);
|
|
1403
|
+
a(E, x);
|
|
1404
|
+
}
|
|
1405
|
+
function e(s, i, l, d, p, r, x, E) {
|
|
1406
|
+
const { actorFontSize: g, actorFontFamily: m, actorFontWeight: w } = E, _ = s.split(P.lineBreakRegex);
|
|
1407
|
+
for (let I = 0; I < _.length; I++) {
|
|
1408
|
+
const O = I * g - g * (_.length - 1) / 2, M = i.append("text").attr("x", l).attr("y", d).style("text-anchor", "start").style("font-size", g).style("font-weight", w).style("font-family", m);
|
|
1409
|
+
M.append("tspan").attr("x", l).attr("dy", O).text(_[I]), M.attr("y", d + r / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), a(M, x);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
function c(s, i, l, d, p, r, x, E) {
|
|
1413
|
+
const g = i.append("switch"), m = g.append("foreignObject").attr("x", l).attr("y", d).attr("width", p).attr("height", r).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
1414
|
+
m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(s), e(s, g, l, d, p, r, x, E), a(m, x);
|
|
1415
|
+
}
|
|
1416
|
+
function a(s, i) {
|
|
1417
|
+
for (const l in i)
|
|
1418
|
+
i.hasOwnProperty(l) && s.attr(l, i[l]);
|
|
1419
|
+
}
|
|
1420
|
+
return function(s) {
|
|
1421
|
+
return s.textPlacement === "fo" ? c : s.textPlacement === "old" ? t : e;
|
|
1422
|
+
};
|
|
1423
|
+
}(), R = {
|
|
1424
|
+
drawRect: Vt,
|
|
1425
|
+
drawText: yt,
|
|
1426
|
+
drawLabel: ie,
|
|
1427
|
+
drawActor: o0,
|
|
1428
|
+
drawBox: n0,
|
|
1429
|
+
drawPopup: a0,
|
|
1430
|
+
anchorElement: c0,
|
|
1431
|
+
drawActivation: l0,
|
|
1432
|
+
drawLoop: d0,
|
|
1433
|
+
drawBackgroundRect: ne,
|
|
1434
|
+
insertArrowHead: u0,
|
|
1435
|
+
insertArrowFilledHead: x0,
|
|
1436
|
+
insertSequenceNumber: m0,
|
|
1437
|
+
insertArrowCrossHead: b0,
|
|
1438
|
+
insertDatabaseIcon: h0,
|
|
1439
|
+
insertComputerIcon: p0,
|
|
1440
|
+
insertClockIcon: g0,
|
|
1441
|
+
getTextObj: ce,
|
|
1442
|
+
getNoteRect: y0,
|
|
1443
|
+
fixLifeLineHeights: oe,
|
|
1444
|
+
sanitizeUrl: Kt.sanitizeUrl
|
|
1445
|
+
};
|
|
1446
|
+
let o = {};
|
|
1447
|
+
const u = {
|
|
1448
|
+
data: {
|
|
1449
|
+
startx: void 0,
|
|
1450
|
+
stopx: void 0,
|
|
1451
|
+
starty: void 0,
|
|
1452
|
+
stopy: void 0
|
|
1453
|
+
},
|
|
1454
|
+
verticalPos: 0,
|
|
1455
|
+
sequenceItems: [],
|
|
1456
|
+
activations: [],
|
|
1457
|
+
models: {
|
|
1458
|
+
getHeight: function() {
|
|
1459
|
+
return Math.max.apply(
|
|
1460
|
+
null,
|
|
1461
|
+
this.actors.length === 0 ? [0] : this.actors.map((t) => t.height || 0)
|
|
1462
|
+
) + (this.loops.length === 0 ? 0 : this.loops.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.messages.length === 0 ? 0 : this.messages.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.notes.length === 0 ? 0 : this.notes.map((t) => t.height || 0).reduce((t, e) => t + e));
|
|
1463
|
+
},
|
|
1464
|
+
clear: function() {
|
|
1465
|
+
this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
|
|
1466
|
+
},
|
|
1467
|
+
addBox: function(t) {
|
|
1468
|
+
this.boxes.push(t);
|
|
1469
|
+
},
|
|
1470
|
+
addActor: function(t) {
|
|
1471
|
+
this.actors.push(t);
|
|
1472
|
+
},
|
|
1473
|
+
addLoop: function(t) {
|
|
1474
|
+
this.loops.push(t);
|
|
1475
|
+
},
|
|
1476
|
+
addMessage: function(t) {
|
|
1477
|
+
this.messages.push(t);
|
|
1478
|
+
},
|
|
1479
|
+
addNote: function(t) {
|
|
1480
|
+
this.notes.push(t);
|
|
1481
|
+
},
|
|
1482
|
+
lastActor: function() {
|
|
1483
|
+
return this.actors[this.actors.length - 1];
|
|
1484
|
+
},
|
|
1485
|
+
lastLoop: function() {
|
|
1486
|
+
return this.loops[this.loops.length - 1];
|
|
1487
|
+
},
|
|
1488
|
+
lastMessage: function() {
|
|
1489
|
+
return this.messages[this.messages.length - 1];
|
|
1490
|
+
},
|
|
1491
|
+
lastNote: function() {
|
|
1492
|
+
return this.notes[this.notes.length - 1];
|
|
1493
|
+
},
|
|
1494
|
+
actors: [],
|
|
1495
|
+
boxes: [],
|
|
1496
|
+
loops: [],
|
|
1497
|
+
messages: [],
|
|
1498
|
+
notes: []
|
|
1499
|
+
},
|
|
1500
|
+
init: function() {
|
|
1501
|
+
this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
|
|
1502
|
+
startx: void 0,
|
|
1503
|
+
stopx: void 0,
|
|
1504
|
+
starty: void 0,
|
|
1505
|
+
stopy: void 0
|
|
1506
|
+
}, this.verticalPos = 0, de(lt());
|
|
1507
|
+
},
|
|
1508
|
+
updateVal: function(t, e, c, a) {
|
|
1509
|
+
t[e] === void 0 ? t[e] = c : t[e] = a(c, t[e]);
|
|
1510
|
+
},
|
|
1511
|
+
updateBounds: function(t, e, c, a) {
|
|
1512
|
+
const s = this;
|
|
1513
|
+
let i = 0;
|
|
1514
|
+
function l(d) {
|
|
1515
|
+
return function(p) {
|
|
1516
|
+
i++;
|
|
1517
|
+
const r = s.sequenceItems.length - i + 1;
|
|
1518
|
+
s.updateVal(p, "starty", e - r * o.boxMargin, Math.min), s.updateVal(p, "stopy", a + r * o.boxMargin, Math.max), s.updateVal(u.data, "startx", t - r * o.boxMargin, Math.min), s.updateVal(u.data, "stopx", c + r * o.boxMargin, Math.max), d !== "activation" && (s.updateVal(p, "startx", t - r * o.boxMargin, Math.min), s.updateVal(p, "stopx", c + r * o.boxMargin, Math.max), s.updateVal(u.data, "starty", e - r * o.boxMargin, Math.min), s.updateVal(u.data, "stopy", a + r * o.boxMargin, Math.max));
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
this.sequenceItems.forEach(l()), this.activations.forEach(l("activation"));
|
|
1522
|
+
},
|
|
1523
|
+
insert: function(t, e, c, a) {
|
|
1524
|
+
const s = P.getMin(t, c), i = P.getMax(t, c), l = P.getMin(e, a), d = P.getMax(e, a);
|
|
1525
|
+
this.updateVal(u.data, "startx", s, Math.min), this.updateVal(u.data, "starty", l, Math.min), this.updateVal(u.data, "stopx", i, Math.max), this.updateVal(u.data, "stopy", d, Math.max), this.updateBounds(s, l, i, d);
|
|
1526
|
+
},
|
|
1527
|
+
newActivation: function(t, e, c) {
|
|
1528
|
+
const a = c[t.from.actor], s = Lt(t.from.actor).length || 0, i = a.x + a.width / 2 + (s - 1) * o.activationWidth / 2;
|
|
1529
|
+
this.activations.push({
|
|
1530
|
+
startx: i,
|
|
1531
|
+
starty: this.verticalPos + 2,
|
|
1532
|
+
stopx: i + o.activationWidth,
|
|
1533
|
+
stopy: void 0,
|
|
1534
|
+
actor: t.from.actor,
|
|
1535
|
+
anchored: R.anchorElement(e)
|
|
1536
|
+
});
|
|
1537
|
+
},
|
|
1538
|
+
endActivation: function(t) {
|
|
1539
|
+
const e = this.activations.map(function(c) {
|
|
1540
|
+
return c.actor;
|
|
1541
|
+
}).lastIndexOf(t.from.actor);
|
|
1542
|
+
return this.activations.splice(e, 1)[0];
|
|
1543
|
+
},
|
|
1544
|
+
createLoop: function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
|
|
1545
|
+
return {
|
|
1546
|
+
startx: void 0,
|
|
1547
|
+
starty: this.verticalPos,
|
|
1548
|
+
stopx: void 0,
|
|
1549
|
+
stopy: void 0,
|
|
1550
|
+
title: t.message,
|
|
1551
|
+
wrap: t.wrap,
|
|
1552
|
+
width: t.width,
|
|
1553
|
+
height: 0,
|
|
1554
|
+
fill: e
|
|
1555
|
+
};
|
|
1556
|
+
},
|
|
1557
|
+
newLoop: function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
|
|
1558
|
+
this.sequenceItems.push(this.createLoop(t, e));
|
|
1559
|
+
},
|
|
1560
|
+
endLoop: function() {
|
|
1561
|
+
return this.sequenceItems.pop();
|
|
1562
|
+
},
|
|
1563
|
+
isLoopOverlap: function() {
|
|
1564
|
+
return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
|
|
1565
|
+
},
|
|
1566
|
+
addSectionToLoop: function(t) {
|
|
1567
|
+
const e = this.sequenceItems.pop();
|
|
1568
|
+
e.sections = e.sections || [], e.sectionTitles = e.sectionTitles || [], e.sections.push({ y: u.getVerticalPos(), height: 0 }), e.sectionTitles.push(t), this.sequenceItems.push(e);
|
|
1569
|
+
},
|
|
1570
|
+
saveVerticalPos: function() {
|
|
1571
|
+
this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
|
|
1572
|
+
},
|
|
1573
|
+
resetVerticalPos: function() {
|
|
1574
|
+
this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
|
|
1575
|
+
},
|
|
1576
|
+
bumpVerticalPos: function(t) {
|
|
1577
|
+
this.verticalPos = this.verticalPos + t, this.data.stopy = P.getMax(this.data.stopy, this.verticalPos);
|
|
1578
|
+
},
|
|
1579
|
+
getVerticalPos: function() {
|
|
1580
|
+
return this.verticalPos;
|
|
1581
|
+
},
|
|
1582
|
+
getBounds: function() {
|
|
1583
|
+
return { bounds: this.data, models: this.models };
|
|
1584
|
+
}
|
|
1585
|
+
}, E0 = function(t, e) {
|
|
1586
|
+
u.bumpVerticalPos(o.boxMargin), e.height = o.boxMargin, e.starty = u.getVerticalPos();
|
|
1587
|
+
const c = _t();
|
|
1588
|
+
c.x = e.startx, c.y = e.starty, c.width = e.width || o.width, c.class = "note";
|
|
1589
|
+
const a = t.append("g"), s = R.drawRect(a, c), i = Yt();
|
|
1590
|
+
i.x = e.startx, i.y = e.starty, i.width = c.width, i.dy = "1em", i.text = e.message, i.class = "noteText", i.fontFamily = o.noteFontFamily, i.fontSize = o.noteFontSize, i.fontWeight = o.noteFontWeight, i.anchor = o.noteAlign, i.textMargin = o.noteMargin, i.valign = "center";
|
|
1591
|
+
const l = yt(a, i), d = Math.round(
|
|
1592
|
+
l.map((p) => (p._groups || p)[0][0].getBBox().height).reduce((p, r) => p + r)
|
|
1593
|
+
);
|
|
1594
|
+
s.attr("height", d + 2 * o.noteMargin), e.height += d + 2 * o.noteMargin, u.bumpVerticalPos(d + 2 * o.noteMargin), e.stopy = e.starty + d + 2 * o.noteMargin, e.stopx = e.startx + c.width, u.insert(e.startx, e.starty, e.stopx, e.stopy), u.models.addNote(e);
|
|
1595
|
+
}, xt = (t) => ({
|
|
1596
|
+
fontFamily: t.messageFontFamily,
|
|
1597
|
+
fontSize: t.messageFontSize,
|
|
1598
|
+
fontWeight: t.messageFontWeight
|
|
1599
|
+
}), bt = (t) => ({
|
|
1600
|
+
fontFamily: t.noteFontFamily,
|
|
1601
|
+
fontSize: t.noteFontSize,
|
|
1602
|
+
fontWeight: t.noteFontWeight
|
|
1603
|
+
}), Ct = (t) => ({
|
|
1604
|
+
fontFamily: t.actorFontFamily,
|
|
1605
|
+
fontSize: t.actorFontSize,
|
|
1606
|
+
fontWeight: t.actorFontWeight
|
|
1607
|
+
});
|
|
1608
|
+
function T0(t, e) {
|
|
1609
|
+
u.bumpVerticalPos(10);
|
|
1610
|
+
const { startx: c, stopx: a, message: s } = e, i = P.splitBreaks(s).length, l = $.calculateTextDimensions(s, xt(o)), d = l.height / i;
|
|
1611
|
+
e.height += d, u.bumpVerticalPos(d);
|
|
1612
|
+
let p, r = l.height - 10;
|
|
1613
|
+
const x = l.width;
|
|
1614
|
+
if (c === a) {
|
|
1615
|
+
p = u.getVerticalPos() + r, o.rightAngles || (r += o.boxMargin, p = u.getVerticalPos() + r), r += 30;
|
|
1616
|
+
const E = P.getMax(x / 2, o.width / 2);
|
|
1617
|
+
u.insert(
|
|
1618
|
+
c - E,
|
|
1619
|
+
u.getVerticalPos() - 10 + r,
|
|
1620
|
+
a + E,
|
|
1621
|
+
u.getVerticalPos() + 30 + r
|
|
1622
|
+
);
|
|
1623
|
+
} else
|
|
1624
|
+
r += o.boxMargin, p = u.getVerticalPos() + r, u.insert(c, p - 10, a, p);
|
|
1625
|
+
return u.bumpVerticalPos(r), e.height += r, e.stopy = e.starty + e.height, u.insert(e.fromBounds, e.starty, e.toBounds, e.stopy), p;
|
|
1626
|
+
}
|
|
1627
|
+
const w0 = function(t, e, c, a) {
|
|
1628
|
+
const { startx: s, stopx: i, starty: l, message: d, type: p, sequenceIndex: r, sequenceVisible: x } = e, E = $.calculateTextDimensions(d, xt(o)), g = Yt();
|
|
1629
|
+
g.x = s, g.y = l + 10, g.width = i - s, g.class = "messageText", g.dy = "1em", g.text = d, g.fontFamily = o.messageFontFamily, g.fontSize = o.messageFontSize, g.fontWeight = o.messageFontWeight, g.anchor = o.messageAlign, g.valign = "center", g.textMargin = o.wrapPadding, g.tspan = !1, yt(t, g);
|
|
1630
|
+
const m = E.width;
|
|
1631
|
+
let w;
|
|
1632
|
+
s === i ? o.rightAngles ? w = t.append("path").attr(
|
|
1633
|
+
"d",
|
|
1634
|
+
`M ${s},${c} H ${s + P.getMax(o.width / 2, m / 2)} V ${c + 25} H ${s}`
|
|
1635
|
+
) : w = t.append("path").attr(
|
|
1636
|
+
"d",
|
|
1637
|
+
"M " + s + "," + c + " C " + (s + 60) + "," + (c - 10) + " " + (s + 60) + "," + (c + 30) + " " + s + "," + (c + 20)
|
|
1638
|
+
) : (w = t.append("line"), w.attr("x1", s), w.attr("y1", c), w.attr("x2", i), w.attr("y2", c)), p === a.db.LINETYPE.DOTTED || p === a.db.LINETYPE.DOTTED_CROSS || p === a.db.LINETYPE.DOTTED_POINT || p === a.db.LINETYPE.DOTTED_OPEN ? (w.style("stroke-dasharray", "3, 3"), w.attr("class", "messageLine1")) : w.attr("class", "messageLine0");
|
|
1639
|
+
let _ = "";
|
|
1640
|
+
o.arrowMarkerAbsolute && (_ = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, _ = _.replace(/\(/g, "\\("), _ = _.replace(/\)/g, "\\)")), w.attr("stroke-width", 2), w.attr("stroke", "none"), w.style("fill", "none"), (p === a.db.LINETYPE.SOLID || p === a.db.LINETYPE.DOTTED) && w.attr("marker-end", "url(" + _ + "#arrowhead)"), (p === a.db.LINETYPE.SOLID_POINT || p === a.db.LINETYPE.DOTTED_POINT) && w.attr("marker-end", "url(" + _ + "#filled-head)"), (p === a.db.LINETYPE.SOLID_CROSS || p === a.db.LINETYPE.DOTTED_CROSS) && w.attr("marker-end", "url(" + _ + "#crosshead)"), (x || o.showSequenceNumbers) && (w.attr("marker-start", "url(" + _ + "#sequencenumber)"), t.append("text").attr("x", s).attr("y", c + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(r));
|
|
1641
|
+
}, P0 = function(t, e, c, a, s, i, l) {
|
|
1642
|
+
let d = 0, p = 0, r, x = 0;
|
|
1643
|
+
for (const E of a) {
|
|
1644
|
+
const g = e[E], m = g.box;
|
|
1645
|
+
r && r != m && (l || u.models.addBox(r), p += o.boxMargin + r.margin), m && m != r && (l || (m.x = d + p, m.y = s), p += m.margin), g.width = g.width || o.width, g.height = P.getMax(g.height || o.height, o.height), g.margin = g.margin || o.actorMargin, x = P.getMax(x, g.height), c[g.name] && (p += g.width / 2), g.x = d + p, g.starty = u.getVerticalPos(), u.insert(g.x, s, g.x + g.width, g.height), d += g.width + p, g.box && (g.box.width = d + m.margin - g.box.x), p = g.margin, r = g.box, u.models.addActor(g);
|
|
1646
|
+
}
|
|
1647
|
+
r && !l && u.models.addBox(r), u.bumpVerticalPos(x);
|
|
1648
|
+
}, $t = function(t, e, c, a) {
|
|
1649
|
+
if (a) {
|
|
1650
|
+
let s = 0;
|
|
1651
|
+
u.bumpVerticalPos(o.boxMargin * 2);
|
|
1652
|
+
for (const i of c) {
|
|
1653
|
+
const l = e[i];
|
|
1654
|
+
l.stopy || (l.stopy = u.getVerticalPos());
|
|
1655
|
+
const d = R.drawActor(t, l, o, !0);
|
|
1656
|
+
s = P.getMax(s, d);
|
|
1657
|
+
}
|
|
1658
|
+
u.bumpVerticalPos(s + o.boxMargin);
|
|
1659
|
+
} else
|
|
1660
|
+
for (const s of c) {
|
|
1661
|
+
const i = e[s];
|
|
1662
|
+
R.drawActor(t, i, o, !1);
|
|
1663
|
+
}
|
|
1664
|
+
}, le = function(t, e, c, a) {
|
|
1665
|
+
let s = 0, i = 0;
|
|
1666
|
+
for (const l of c) {
|
|
1667
|
+
const d = e[l], p = L0(d), r = R.drawPopup(
|
|
1668
|
+
t,
|
|
1669
|
+
d,
|
|
1670
|
+
p,
|
|
1671
|
+
o,
|
|
1672
|
+
o.forceMenus,
|
|
1673
|
+
a
|
|
1674
|
+
);
|
|
1675
|
+
r.height > s && (s = r.height), r.width + d.x > i && (i = r.width + d.x);
|
|
1676
|
+
}
|
|
1677
|
+
return { maxHeight: s, maxWidth: i };
|
|
1678
|
+
}, de = function(t) {
|
|
1679
|
+
Pe(o, t), t.fontFamily && (o.actorFontFamily = o.noteFontFamily = o.messageFontFamily = t.fontFamily), t.fontSize && (o.actorFontSize = o.noteFontSize = o.messageFontSize = t.fontSize), t.fontWeight && (o.actorFontWeight = o.noteFontWeight = o.messageFontWeight = t.fontWeight);
|
|
1680
|
+
}, Lt = function(t) {
|
|
1681
|
+
return u.activations.filter(function(e) {
|
|
1682
|
+
return e.actor === t;
|
|
1683
|
+
});
|
|
1684
|
+
}, Xt = function(t, e) {
|
|
1685
|
+
const c = e[t], a = Lt(t), s = a.reduce(function(l, d) {
|
|
1686
|
+
return P.getMin(l, d.startx);
|
|
1687
|
+
}, c.x + c.width / 2 - 1), i = a.reduce(function(l, d) {
|
|
1688
|
+
return P.getMax(l, d.stopx);
|
|
1689
|
+
}, c.x + c.width / 2 + 1);
|
|
1690
|
+
return [s, i];
|
|
1691
|
+
};
|
|
1692
|
+
function rt(t, e, c, a, s) {
|
|
1693
|
+
u.bumpVerticalPos(c);
|
|
1694
|
+
let i = a;
|
|
1695
|
+
if (e.id && e.message && t[e.id]) {
|
|
1696
|
+
const l = t[e.id].width, d = xt(o);
|
|
1697
|
+
e.message = $.wrapLabel(`[${e.message}]`, l - 2 * o.wrapPadding, d), e.width = l, e.wrap = !0;
|
|
1698
|
+
const p = $.calculateTextDimensions(e.message, d), r = P.getMax(p.height, o.labelBoxHeight);
|
|
1699
|
+
i = a + r, j.debug(`${r} - ${e.message}`);
|
|
1700
|
+
}
|
|
1701
|
+
s(e), u.bumpVerticalPos(i);
|
|
1702
|
+
}
|
|
1703
|
+
function v0(t, e, c, a, s, i, l) {
|
|
1704
|
+
function d(r, x) {
|
|
1705
|
+
r.x < s[t.from].x ? (u.insert(
|
|
1706
|
+
e.stopx - x,
|
|
1707
|
+
e.starty,
|
|
1708
|
+
e.startx,
|
|
1709
|
+
e.stopy + r.height / 2 + o.noteMargin
|
|
1710
|
+
), e.stopx = e.stopx + x) : (u.insert(
|
|
1711
|
+
e.startx,
|
|
1712
|
+
e.starty,
|
|
1713
|
+
e.stopx + x,
|
|
1714
|
+
e.stopy + r.height / 2 + o.noteMargin
|
|
1715
|
+
), e.stopx = e.stopx - x);
|
|
1716
|
+
}
|
|
1717
|
+
function p(r, x) {
|
|
1718
|
+
r.x < s[t.to].x ? (u.insert(
|
|
1719
|
+
e.startx - x,
|
|
1720
|
+
e.starty,
|
|
1721
|
+
e.stopx,
|
|
1722
|
+
e.stopy + r.height / 2 + o.noteMargin
|
|
1723
|
+
), e.startx = e.startx + x) : (u.insert(
|
|
1724
|
+
e.stopx,
|
|
1725
|
+
e.starty,
|
|
1726
|
+
e.startx + x,
|
|
1727
|
+
e.stopy + r.height / 2 + o.noteMargin
|
|
1728
|
+
), e.startx = e.startx - x);
|
|
1729
|
+
}
|
|
1730
|
+
if (i[t.to] == a) {
|
|
1731
|
+
const r = s[t.to], x = r.type == "actor" ? gt / 2 + 3 : r.width / 2 + 3;
|
|
1732
|
+
d(r, x), r.starty = c - r.height / 2, u.bumpVerticalPos(r.height / 2);
|
|
1733
|
+
} else if (l[t.from] == a) {
|
|
1734
|
+
const r = s[t.from];
|
|
1735
|
+
if (o.mirrorActors) {
|
|
1736
|
+
const x = r.type == "actor" ? gt / 2 : r.width / 2;
|
|
1737
|
+
p(r, x);
|
|
1738
|
+
}
|
|
1739
|
+
r.stopy = c - r.height / 2, u.bumpVerticalPos(r.height / 2);
|
|
1740
|
+
} else if (l[t.to] == a) {
|
|
1741
|
+
const r = s[t.to];
|
|
1742
|
+
if (o.mirrorActors) {
|
|
1743
|
+
const x = r.type == "actor" ? gt / 2 + 3 : r.width / 2 + 3;
|
|
1744
|
+
d(r, x);
|
|
1745
|
+
}
|
|
1746
|
+
r.stopy = c - r.height / 2, u.bumpVerticalPos(r.height / 2);
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
const k0 = function(t, e, c, a) {
|
|
1750
|
+
const { securityLevel: s, sequence: i } = lt();
|
|
1751
|
+
o = i;
|
|
1752
|
+
let l;
|
|
1753
|
+
s === "sandbox" && (l = vt("#i" + e));
|
|
1754
|
+
const d = s === "sandbox" ? vt(l.nodes()[0].contentDocument.body) : vt("body"), p = s === "sandbox" ? l.nodes()[0].contentDocument : document;
|
|
1755
|
+
u.init(), j.debug(a.db);
|
|
1756
|
+
const r = s === "sandbox" ? d.select(`[id="${e}"]`) : vt(`[id="${e}"]`), x = a.db.getActors(), E = a.db.getCreatedActors(), g = a.db.getDestroyedActors(), m = a.db.getBoxes();
|
|
1757
|
+
let w = a.db.getActorKeys();
|
|
1758
|
+
const _ = a.db.getMessages(), I = a.db.getDiagramTitle(), O = a.db.hasAtLeastOneBox(), M = a.db.hasAtLeastOneBoxWithTitle(), V = _0(x, _, a);
|
|
1759
|
+
if (o.height = I0(x, V, m), R.insertComputerIcon(r), R.insertDatabaseIcon(r), R.insertClockIcon(r), O && (u.bumpVerticalPos(o.boxMargin), M && u.bumpVerticalPos(m[0].textMaxHeight)), o.hideUnusedParticipants === !0) {
|
|
1760
|
+
const y = /* @__PURE__ */ new Set();
|
|
1761
|
+
_.forEach((v) => {
|
|
1762
|
+
y.add(v.from), y.add(v.to);
|
|
1763
|
+
}), w = w.filter((v) => y.has(v));
|
|
1764
|
+
}
|
|
1765
|
+
P0(r, x, E, w, 0, _, !1);
|
|
1766
|
+
const S = A0(_, x, V, a);
|
|
1767
|
+
R.insertArrowHead(r), R.insertArrowCrossHead(r), R.insertArrowFilledHead(r), R.insertSequenceNumber(r);
|
|
1768
|
+
function tt(y, v) {
|
|
1769
|
+
const L = u.endActivation(y);
|
|
1770
|
+
L.starty + 18 > v && (L.starty = v - 6, v += 12), R.drawActivation(
|
|
1771
|
+
r,
|
|
1772
|
+
L,
|
|
1773
|
+
v,
|
|
1774
|
+
o,
|
|
1775
|
+
Lt(y.from.actor).length
|
|
1776
|
+
), u.insert(L.startx, v - 10, L.stopx, v);
|
|
1777
|
+
}
|
|
1778
|
+
let F = 1, X = 1;
|
|
1779
|
+
const G = [], W = [];
|
|
1780
|
+
_.forEach(function(y, v) {
|
|
1781
|
+
let L, dt, et;
|
|
1782
|
+
switch (y.type) {
|
|
1783
|
+
case a.db.LINETYPE.NOTE:
|
|
1784
|
+
u.resetVerticalPos(), dt = y.noteModel, E0(r, dt);
|
|
1785
|
+
break;
|
|
1786
|
+
case a.db.LINETYPE.ACTIVE_START:
|
|
1787
|
+
u.newActivation(y, r, x);
|
|
1788
|
+
break;
|
|
1789
|
+
case a.db.LINETYPE.ACTIVE_END:
|
|
1790
|
+
tt(y, u.getVerticalPos());
|
|
1791
|
+
break;
|
|
1792
|
+
case a.db.LINETYPE.LOOP_START:
|
|
1793
|
+
rt(
|
|
1794
|
+
S,
|
|
1795
|
+
y,
|
|
1796
|
+
o.boxMargin,
|
|
1797
|
+
o.boxMargin + o.boxTextMargin,
|
|
1798
|
+
(N) => u.newLoop(N)
|
|
1799
|
+
);
|
|
1800
|
+
break;
|
|
1801
|
+
case a.db.LINETYPE.LOOP_END:
|
|
1802
|
+
L = u.endLoop(), R.drawLoop(r, L, "loop", o), u.bumpVerticalPos(L.stopy - u.getVerticalPos()), u.models.addLoop(L);
|
|
1803
|
+
break;
|
|
1804
|
+
case a.db.LINETYPE.RECT_START:
|
|
1805
|
+
rt(
|
|
1806
|
+
S,
|
|
1807
|
+
y,
|
|
1808
|
+
o.boxMargin,
|
|
1809
|
+
o.boxMargin,
|
|
1810
|
+
(N) => u.newLoop(void 0, N.message)
|
|
1811
|
+
);
|
|
1812
|
+
break;
|
|
1813
|
+
case a.db.LINETYPE.RECT_END:
|
|
1814
|
+
L = u.endLoop(), W.push(L), u.models.addLoop(L), u.bumpVerticalPos(L.stopy - u.getVerticalPos());
|
|
1815
|
+
break;
|
|
1816
|
+
case a.db.LINETYPE.OPT_START:
|
|
1817
|
+
rt(
|
|
1818
|
+
S,
|
|
1819
|
+
y,
|
|
1820
|
+
o.boxMargin,
|
|
1821
|
+
o.boxMargin + o.boxTextMargin,
|
|
1822
|
+
(N) => u.newLoop(N)
|
|
1823
|
+
);
|
|
1824
|
+
break;
|
|
1825
|
+
case a.db.LINETYPE.OPT_END:
|
|
1826
|
+
L = u.endLoop(), R.drawLoop(r, L, "opt", o), u.bumpVerticalPos(L.stopy - u.getVerticalPos()), u.models.addLoop(L);
|
|
1827
|
+
break;
|
|
1828
|
+
case a.db.LINETYPE.ALT_START:
|
|
1829
|
+
rt(
|
|
1830
|
+
S,
|
|
1831
|
+
y,
|
|
1832
|
+
o.boxMargin,
|
|
1833
|
+
o.boxMargin + o.boxTextMargin,
|
|
1834
|
+
(N) => u.newLoop(N)
|
|
1835
|
+
);
|
|
1836
|
+
break;
|
|
1837
|
+
case a.db.LINETYPE.ALT_ELSE:
|
|
1838
|
+
rt(
|
|
1839
|
+
S,
|
|
1840
|
+
y,
|
|
1841
|
+
o.boxMargin + o.boxTextMargin,
|
|
1842
|
+
o.boxMargin,
|
|
1843
|
+
(N) => u.addSectionToLoop(N)
|
|
1844
|
+
);
|
|
1845
|
+
break;
|
|
1846
|
+
case a.db.LINETYPE.ALT_END:
|
|
1847
|
+
L = u.endLoop(), R.drawLoop(r, L, "alt", o), u.bumpVerticalPos(L.stopy - u.getVerticalPos()), u.models.addLoop(L);
|
|
1848
|
+
break;
|
|
1849
|
+
case a.db.LINETYPE.PAR_START:
|
|
1850
|
+
case a.db.LINETYPE.PAR_OVER_START:
|
|
1851
|
+
rt(
|
|
1852
|
+
S,
|
|
1853
|
+
y,
|
|
1854
|
+
o.boxMargin,
|
|
1855
|
+
o.boxMargin + o.boxTextMargin,
|
|
1856
|
+
(N) => u.newLoop(N)
|
|
1857
|
+
), u.saveVerticalPos();
|
|
1858
|
+
break;
|
|
1859
|
+
case a.db.LINETYPE.PAR_AND:
|
|
1860
|
+
rt(
|
|
1861
|
+
S,
|
|
1862
|
+
y,
|
|
1863
|
+
o.boxMargin + o.boxTextMargin,
|
|
1864
|
+
o.boxMargin,
|
|
1865
|
+
(N) => u.addSectionToLoop(N)
|
|
1866
|
+
);
|
|
1867
|
+
break;
|
|
1868
|
+
case a.db.LINETYPE.PAR_END:
|
|
1869
|
+
L = u.endLoop(), R.drawLoop(r, L, "par", o), u.bumpVerticalPos(L.stopy - u.getVerticalPos()), u.models.addLoop(L);
|
|
1870
|
+
break;
|
|
1871
|
+
case a.db.LINETYPE.AUTONUMBER:
|
|
1872
|
+
F = y.message.start || F, X = y.message.step || X, y.message.visible ? a.db.enableSequenceNumbers() : a.db.disableSequenceNumbers();
|
|
1873
|
+
break;
|
|
1874
|
+
case a.db.LINETYPE.CRITICAL_START:
|
|
1875
|
+
rt(
|
|
1876
|
+
S,
|
|
1877
|
+
y,
|
|
1878
|
+
o.boxMargin,
|
|
1879
|
+
o.boxMargin + o.boxTextMargin,
|
|
1880
|
+
(N) => u.newLoop(N)
|
|
1881
|
+
);
|
|
1882
|
+
break;
|
|
1883
|
+
case a.db.LINETYPE.CRITICAL_OPTION:
|
|
1884
|
+
rt(
|
|
1885
|
+
S,
|
|
1886
|
+
y,
|
|
1887
|
+
o.boxMargin + o.boxTextMargin,
|
|
1888
|
+
o.boxMargin,
|
|
1889
|
+
(N) => u.addSectionToLoop(N)
|
|
1890
|
+
);
|
|
1891
|
+
break;
|
|
1892
|
+
case a.db.LINETYPE.CRITICAL_END:
|
|
1893
|
+
L = u.endLoop(), R.drawLoop(r, L, "critical", o), u.bumpVerticalPos(L.stopy - u.getVerticalPos()), u.models.addLoop(L);
|
|
1894
|
+
break;
|
|
1895
|
+
case a.db.LINETYPE.BREAK_START:
|
|
1896
|
+
rt(
|
|
1897
|
+
S,
|
|
1898
|
+
y,
|
|
1899
|
+
o.boxMargin,
|
|
1900
|
+
o.boxMargin + o.boxTextMargin,
|
|
1901
|
+
(N) => u.newLoop(N)
|
|
1902
|
+
);
|
|
1903
|
+
break;
|
|
1904
|
+
case a.db.LINETYPE.BREAK_END:
|
|
1905
|
+
L = u.endLoop(), R.drawLoop(r, L, "break", o), u.bumpVerticalPos(L.stopy - u.getVerticalPos()), u.models.addLoop(L);
|
|
1906
|
+
break;
|
|
1907
|
+
default:
|
|
1908
|
+
try {
|
|
1909
|
+
et = y.msgModel, et.starty = u.getVerticalPos(), et.sequenceIndex = F, et.sequenceVisible = a.db.showSequenceNumbers();
|
|
1910
|
+
const N = T0(r, et);
|
|
1911
|
+
v0(
|
|
1912
|
+
y,
|
|
1913
|
+
et,
|
|
1914
|
+
N,
|
|
1915
|
+
v,
|
|
1916
|
+
x,
|
|
1917
|
+
E,
|
|
1918
|
+
g
|
|
1919
|
+
), G.push({ messageModel: et, lineStartY: N }), u.models.addMessage(et);
|
|
1920
|
+
} catch (N) {
|
|
1921
|
+
j.error("error while drawing message", N);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
[
|
|
1925
|
+
a.db.LINETYPE.SOLID_OPEN,
|
|
1926
|
+
a.db.LINETYPE.DOTTED_OPEN,
|
|
1927
|
+
a.db.LINETYPE.SOLID,
|
|
1928
|
+
a.db.LINETYPE.DOTTED,
|
|
1929
|
+
a.db.LINETYPE.SOLID_CROSS,
|
|
1930
|
+
a.db.LINETYPE.DOTTED_CROSS,
|
|
1931
|
+
a.db.LINETYPE.SOLID_POINT,
|
|
1932
|
+
a.db.LINETYPE.DOTTED_POINT
|
|
1933
|
+
].includes(y.type) && (F = F + X);
|
|
1934
|
+
}), j.debug("createdActors", E), j.debug("destroyedActors", g), $t(r, x, w, !1), G.forEach((y) => w0(r, y.messageModel, y.lineStartY, a)), o.mirrorActors && $t(r, x, w, !0), W.forEach((y) => R.drawBackgroundRect(r, y)), oe(r, x, w, o), u.models.boxes.forEach(function(y) {
|
|
1935
|
+
y.height = u.getVerticalPos() - y.y, u.insert(y.x, y.y, y.x + y.width, y.height), y.startx = y.x, y.starty = y.y, y.stopx = y.startx + y.width, y.stopy = y.starty + y.height, y.stroke = "rgb(0,0,0, 0.5)", R.drawBox(r, y, o);
|
|
1936
|
+
}), O && u.bumpVerticalPos(o.boxMargin);
|
|
1937
|
+
const B = le(r, x, w, p), { bounds: C } = u.getBounds();
|
|
1938
|
+
let K = C.stopy - C.starty;
|
|
1939
|
+
K < B.maxHeight && (K = B.maxHeight);
|
|
1940
|
+
let q = K + 2 * o.diagramMarginY;
|
|
1941
|
+
o.mirrorActors && (q = q - o.boxMargin + o.bottomMarginAdj);
|
|
1942
|
+
let U = C.stopx - C.startx;
|
|
1943
|
+
U < B.maxWidth && (U = B.maxWidth);
|
|
1944
|
+
const J = U + 2 * o.diagramMarginX;
|
|
1945
|
+
I && r.append("text").text(I).attr("x", (C.stopx - C.startx) / 2 - 2 * o.diagramMarginX).attr("y", -25), ve(r, q, J, o.useMaxWidth);
|
|
1946
|
+
const Z = I ? 40 : 0;
|
|
1947
|
+
r.attr(
|
|
1948
|
+
"viewBox",
|
|
1949
|
+
C.startx - o.diagramMarginX + " -" + (o.diagramMarginY + Z) + " " + J + " " + (q + Z)
|
|
1950
|
+
), j.debug("models:", u.models);
|
|
1951
|
+
};
|
|
1952
|
+
function _0(t, e, c) {
|
|
1953
|
+
const a = {};
|
|
1954
|
+
return e.forEach(function(s) {
|
|
1955
|
+
if (t[s.to] && t[s.from]) {
|
|
1956
|
+
const i = t[s.to];
|
|
1957
|
+
if (s.placement === c.db.PLACEMENT.LEFTOF && !i.prevActor || s.placement === c.db.PLACEMENT.RIGHTOF && !i.nextActor)
|
|
1958
|
+
return;
|
|
1959
|
+
const l = s.placement !== void 0, d = !l, p = l ? bt(o) : xt(o), r = s.wrap ? $.wrapLabel(s.message, o.width - 2 * o.wrapPadding, p) : s.message, x = $.calculateTextDimensions(r, p).width + 2 * o.wrapPadding;
|
|
1960
|
+
d && s.from === i.nextActor ? a[s.to] = P.getMax(
|
|
1961
|
+
a[s.to] || 0,
|
|
1962
|
+
x
|
|
1963
|
+
) : d && s.from === i.prevActor ? a[s.from] = P.getMax(
|
|
1964
|
+
a[s.from] || 0,
|
|
1965
|
+
x
|
|
1966
|
+
) : d && s.from === s.to ? (a[s.from] = P.getMax(
|
|
1967
|
+
a[s.from] || 0,
|
|
1968
|
+
x / 2
|
|
1969
|
+
), a[s.to] = P.getMax(
|
|
1970
|
+
a[s.to] || 0,
|
|
1971
|
+
x / 2
|
|
1972
|
+
)) : s.placement === c.db.PLACEMENT.RIGHTOF ? a[s.from] = P.getMax(
|
|
1973
|
+
a[s.from] || 0,
|
|
1974
|
+
x
|
|
1975
|
+
) : s.placement === c.db.PLACEMENT.LEFTOF ? a[i.prevActor] = P.getMax(
|
|
1976
|
+
a[i.prevActor] || 0,
|
|
1977
|
+
x
|
|
1978
|
+
) : s.placement === c.db.PLACEMENT.OVER && (i.prevActor && (a[i.prevActor] = P.getMax(
|
|
1979
|
+
a[i.prevActor] || 0,
|
|
1980
|
+
x / 2
|
|
1981
|
+
)), i.nextActor && (a[s.from] = P.getMax(
|
|
1982
|
+
a[s.from] || 0,
|
|
1983
|
+
x / 2
|
|
1984
|
+
)));
|
|
1985
|
+
}
|
|
1986
|
+
}), j.debug("maxMessageWidthPerActor:", a), a;
|
|
1987
|
+
}
|
|
1988
|
+
const L0 = function(t) {
|
|
1989
|
+
let e = 0;
|
|
1990
|
+
const c = Ct(o);
|
|
1991
|
+
for (const a in t.links) {
|
|
1992
|
+
const s = $.calculateTextDimensions(a, c).width + 2 * o.wrapPadding + 2 * o.boxMargin;
|
|
1993
|
+
e < s && (e = s);
|
|
1994
|
+
}
|
|
1995
|
+
return e;
|
|
1996
|
+
};
|
|
1997
|
+
function I0(t, e, c) {
|
|
1998
|
+
let a = 0;
|
|
1999
|
+
Object.keys(t).forEach((i) => {
|
|
2000
|
+
const l = t[i];
|
|
2001
|
+
l.wrap && (l.description = $.wrapLabel(
|
|
2002
|
+
l.description,
|
|
2003
|
+
o.width - 2 * o.wrapPadding,
|
|
2004
|
+
Ct(o)
|
|
2005
|
+
));
|
|
2006
|
+
const d = $.calculateTextDimensions(l.description, Ct(o));
|
|
2007
|
+
l.width = l.wrap ? o.width : P.getMax(o.width, d.width + 2 * o.wrapPadding), l.height = l.wrap ? P.getMax(d.height, o.height) : o.height, a = P.getMax(a, l.height);
|
|
2008
|
+
});
|
|
2009
|
+
for (const i in e) {
|
|
2010
|
+
const l = t[i];
|
|
2011
|
+
if (!l)
|
|
2012
|
+
continue;
|
|
2013
|
+
const d = t[l.nextActor];
|
|
2014
|
+
if (!d) {
|
|
2015
|
+
const r = e[i] + o.actorMargin - l.width / 2;
|
|
2016
|
+
l.margin = P.getMax(r, o.actorMargin);
|
|
2017
|
+
continue;
|
|
2018
|
+
}
|
|
2019
|
+
const p = e[i] + o.actorMargin - l.width / 2 - d.width / 2;
|
|
2020
|
+
l.margin = P.getMax(p, o.actorMargin);
|
|
2021
|
+
}
|
|
2022
|
+
let s = 0;
|
|
2023
|
+
return c.forEach((i) => {
|
|
2024
|
+
const l = xt(o);
|
|
2025
|
+
let d = i.actorKeys.reduce((x, E) => x += t[E].width + (t[E].margin || 0), 0);
|
|
2026
|
+
d -= 2 * o.boxTextMargin, i.wrap && (i.name = $.wrapLabel(i.name, d - 2 * o.wrapPadding, l));
|
|
2027
|
+
const p = $.calculateTextDimensions(i.name, l);
|
|
2028
|
+
s = P.getMax(p.height, s);
|
|
2029
|
+
const r = P.getMax(d, p.width + 2 * o.wrapPadding);
|
|
2030
|
+
if (i.margin = o.boxTextMargin, d < r) {
|
|
2031
|
+
const x = (r - d) / 2;
|
|
2032
|
+
i.margin += x;
|
|
2033
|
+
}
|
|
2034
|
+
}), c.forEach((i) => i.textMaxHeight = s), P.getMax(a, o.height);
|
|
2035
|
+
}
|
|
2036
|
+
const N0 = function(t, e, c) {
|
|
2037
|
+
const a = e[t.from].x, s = e[t.to].x, i = t.wrap && t.message;
|
|
2038
|
+
let l = $.calculateTextDimensions(
|
|
2039
|
+
i ? $.wrapLabel(t.message, o.width, bt(o)) : t.message,
|
|
2040
|
+
bt(o)
|
|
2041
|
+
);
|
|
2042
|
+
const d = {
|
|
2043
|
+
width: i ? o.width : P.getMax(o.width, l.width + 2 * o.noteMargin),
|
|
2044
|
+
height: 0,
|
|
2045
|
+
startx: e[t.from].x,
|
|
2046
|
+
stopx: 0,
|
|
2047
|
+
starty: 0,
|
|
2048
|
+
stopy: 0,
|
|
2049
|
+
message: t.message
|
|
2050
|
+
};
|
|
2051
|
+
return t.placement === c.db.PLACEMENT.RIGHTOF ? (d.width = i ? P.getMax(o.width, l.width) : P.getMax(
|
|
2052
|
+
e[t.from].width / 2 + e[t.to].width / 2,
|
|
2053
|
+
l.width + 2 * o.noteMargin
|
|
2054
|
+
), d.startx = a + (e[t.from].width + o.actorMargin) / 2) : t.placement === c.db.PLACEMENT.LEFTOF ? (d.width = i ? P.getMax(o.width, l.width + 2 * o.noteMargin) : P.getMax(
|
|
2055
|
+
e[t.from].width / 2 + e[t.to].width / 2,
|
|
2056
|
+
l.width + 2 * o.noteMargin
|
|
2057
|
+
), d.startx = a - d.width + (e[t.from].width - o.actorMargin) / 2) : t.to === t.from ? (l = $.calculateTextDimensions(
|
|
2058
|
+
i ? $.wrapLabel(
|
|
2059
|
+
t.message,
|
|
2060
|
+
P.getMax(o.width, e[t.from].width),
|
|
2061
|
+
bt(o)
|
|
2062
|
+
) : t.message,
|
|
2063
|
+
bt(o)
|
|
2064
|
+
), d.width = i ? P.getMax(o.width, e[t.from].width) : P.getMax(
|
|
2065
|
+
e[t.from].width,
|
|
2066
|
+
o.width,
|
|
2067
|
+
l.width + 2 * o.noteMargin
|
|
2068
|
+
), d.startx = a + (e[t.from].width - d.width) / 2) : (d.width = Math.abs(a + e[t.from].width / 2 - (s + e[t.to].width / 2)) + o.actorMargin, d.startx = a < s ? a + e[t.from].width / 2 - o.actorMargin / 2 : s + e[t.to].width / 2 - o.actorMargin / 2), i && (d.message = $.wrapLabel(
|
|
2069
|
+
t.message,
|
|
2070
|
+
d.width - 2 * o.wrapPadding,
|
|
2071
|
+
bt(o)
|
|
2072
|
+
)), j.debug(
|
|
2073
|
+
`NM:[${d.startx},${d.stopx},${d.starty},${d.stopy}:${d.width},${d.height}=${t.message}]`
|
|
2074
|
+
), d;
|
|
2075
|
+
}, M0 = function(t, e, c) {
|
|
2076
|
+
if (![
|
|
2077
|
+
c.db.LINETYPE.SOLID_OPEN,
|
|
2078
|
+
c.db.LINETYPE.DOTTED_OPEN,
|
|
2079
|
+
c.db.LINETYPE.SOLID,
|
|
2080
|
+
c.db.LINETYPE.DOTTED,
|
|
2081
|
+
c.db.LINETYPE.SOLID_CROSS,
|
|
2082
|
+
c.db.LINETYPE.DOTTED_CROSS,
|
|
2083
|
+
c.db.LINETYPE.SOLID_POINT,
|
|
2084
|
+
c.db.LINETYPE.DOTTED_POINT
|
|
2085
|
+
].includes(t.type))
|
|
2086
|
+
return {};
|
|
2087
|
+
const [a, s] = Xt(t.from, e), [i, l] = Xt(t.to, e), d = a <= i, p = d ? s : a;
|
|
2088
|
+
let r = d ? i : l;
|
|
2089
|
+
const x = Math.abs(i - l) > 2, E = (_) => d ? -_ : _;
|
|
2090
|
+
t.from === t.to ? r = p : (t.activate && !x && (r += E(o.activationWidth / 2 - 1)), [c.db.LINETYPE.SOLID_OPEN, c.db.LINETYPE.DOTTED_OPEN].includes(t.type) || (r += E(3)));
|
|
2091
|
+
const g = [a, s, i, l], m = Math.abs(p - r);
|
|
2092
|
+
t.wrap && t.message && (t.message = $.wrapLabel(
|
|
2093
|
+
t.message,
|
|
2094
|
+
P.getMax(m + 2 * o.wrapPadding, o.width),
|
|
2095
|
+
xt(o)
|
|
2096
|
+
));
|
|
2097
|
+
const w = $.calculateTextDimensions(t.message, xt(o));
|
|
2098
|
+
return {
|
|
2099
|
+
width: P.getMax(
|
|
2100
|
+
t.wrap ? 0 : w.width + 2 * o.wrapPadding,
|
|
2101
|
+
m + 2 * o.wrapPadding,
|
|
2102
|
+
o.width
|
|
2103
|
+
),
|
|
2104
|
+
height: 0,
|
|
2105
|
+
startx: p,
|
|
2106
|
+
stopx: r,
|
|
2107
|
+
starty: 0,
|
|
2108
|
+
stopy: 0,
|
|
2109
|
+
message: t.message,
|
|
2110
|
+
type: t.type,
|
|
2111
|
+
wrap: t.wrap,
|
|
2112
|
+
fromBounds: Math.min.apply(null, g),
|
|
2113
|
+
toBounds: Math.max.apply(null, g)
|
|
2114
|
+
};
|
|
2115
|
+
}, A0 = function(t, e, c, a) {
|
|
2116
|
+
const s = {}, i = [];
|
|
2117
|
+
let l, d, p;
|
|
2118
|
+
return t.forEach(function(r) {
|
|
2119
|
+
switch (r.id = $.random({ length: 10 }), r.type) {
|
|
2120
|
+
case a.db.LINETYPE.LOOP_START:
|
|
2121
|
+
case a.db.LINETYPE.ALT_START:
|
|
2122
|
+
case a.db.LINETYPE.OPT_START:
|
|
2123
|
+
case a.db.LINETYPE.PAR_START:
|
|
2124
|
+
case a.db.LINETYPE.PAR_OVER_START:
|
|
2125
|
+
case a.db.LINETYPE.CRITICAL_START:
|
|
2126
|
+
case a.db.LINETYPE.BREAK_START:
|
|
2127
|
+
i.push({
|
|
2128
|
+
id: r.id,
|
|
2129
|
+
msg: r.message,
|
|
2130
|
+
from: Number.MAX_SAFE_INTEGER,
|
|
2131
|
+
to: Number.MIN_SAFE_INTEGER,
|
|
2132
|
+
width: 0
|
|
2133
|
+
});
|
|
2134
|
+
break;
|
|
2135
|
+
case a.db.LINETYPE.ALT_ELSE:
|
|
2136
|
+
case a.db.LINETYPE.PAR_AND:
|
|
2137
|
+
case a.db.LINETYPE.CRITICAL_OPTION:
|
|
2138
|
+
r.message && (l = i.pop(), s[l.id] = l, s[r.id] = l, i.push(l));
|
|
2139
|
+
break;
|
|
2140
|
+
case a.db.LINETYPE.LOOP_END:
|
|
2141
|
+
case a.db.LINETYPE.ALT_END:
|
|
2142
|
+
case a.db.LINETYPE.OPT_END:
|
|
2143
|
+
case a.db.LINETYPE.PAR_END:
|
|
2144
|
+
case a.db.LINETYPE.CRITICAL_END:
|
|
2145
|
+
case a.db.LINETYPE.BREAK_END:
|
|
2146
|
+
l = i.pop(), s[l.id] = l;
|
|
2147
|
+
break;
|
|
2148
|
+
case a.db.LINETYPE.ACTIVE_START:
|
|
2149
|
+
{
|
|
2150
|
+
const x = e[r.from ? r.from.actor : r.to.actor], E = Lt(r.from ? r.from.actor : r.to.actor).length, g = x.x + x.width / 2 + (E - 1) * o.activationWidth / 2, m = {
|
|
2151
|
+
startx: g,
|
|
2152
|
+
stopx: g + o.activationWidth,
|
|
2153
|
+
actor: r.from.actor,
|
|
2154
|
+
enabled: !0
|
|
2155
|
+
};
|
|
2156
|
+
u.activations.push(m);
|
|
2157
|
+
}
|
|
2158
|
+
break;
|
|
2159
|
+
case a.db.LINETYPE.ACTIVE_END:
|
|
2160
|
+
{
|
|
2161
|
+
const x = u.activations.map((E) => E.actor).lastIndexOf(r.from.actor);
|
|
2162
|
+
delete u.activations.splice(x, 1)[0];
|
|
2163
|
+
}
|
|
2164
|
+
break;
|
|
2165
|
+
}
|
|
2166
|
+
r.placement !== void 0 ? (d = N0(r, e, a), r.noteModel = d, i.forEach((x) => {
|
|
2167
|
+
l = x, l.from = P.getMin(l.from, d.startx), l.to = P.getMax(l.to, d.startx + d.width), l.width = P.getMax(l.width, Math.abs(l.from - l.to)) - o.labelBoxWidth;
|
|
2168
|
+
})) : (p = M0(r, e, a), r.msgModel = p, p.startx && p.stopx && i.length > 0 && i.forEach((x) => {
|
|
2169
|
+
if (l = x, p.startx === p.stopx) {
|
|
2170
|
+
const E = e[r.from], g = e[r.to];
|
|
2171
|
+
l.from = P.getMin(
|
|
2172
|
+
E.x - p.width / 2,
|
|
2173
|
+
E.x - E.width / 2,
|
|
2174
|
+
l.from
|
|
2175
|
+
), l.to = P.getMax(
|
|
2176
|
+
g.x + p.width / 2,
|
|
2177
|
+
g.x + E.width / 2,
|
|
2178
|
+
l.to
|
|
2179
|
+
), l.width = P.getMax(l.width, Math.abs(l.to - l.from)) - o.labelBoxWidth;
|
|
2180
|
+
} else
|
|
2181
|
+
l.from = P.getMin(p.startx, l.from), l.to = P.getMax(p.stopx, l.to), l.width = P.getMax(l.width, p.width) - o.labelBoxWidth;
|
|
2182
|
+
}));
|
|
2183
|
+
}), u.activations = [], j.debug("Loop type widths:", s), s;
|
|
2184
|
+
}, S0 = {
|
|
2185
|
+
bounds: u,
|
|
2186
|
+
drawActors: $t,
|
|
2187
|
+
drawActorsPopup: le,
|
|
2188
|
+
setConf: de,
|
|
2189
|
+
draw: k0
|
|
2190
|
+
}, R0 = {
|
|
2191
|
+
parser: Ne,
|
|
2192
|
+
db: jt,
|
|
2193
|
+
renderer: S0,
|
|
2194
|
+
styles: e0,
|
|
2195
|
+
init: ({ wrap: t }) => {
|
|
2196
|
+
jt.setWrap(t);
|
|
2197
|
+
}
|
|
2198
|
+
};
|
|
2199
|
+
export {
|
|
2200
|
+
R0 as diagram
|
|
2201
|
+
};
|