@marimo-team/islands 0.13.16-dev2 → 0.13.16-dev4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BizAnuDQ.js → ConnectedDataExplorerComponent-W-BOfG8M.js} +1495 -1496
  2. package/dist/{VegaLite-BvtjUHLS.js → VegaLite-C9hsmU75.js} +12483 -12485
  3. package/dist/{_baseUniq-C1K8a5jF.js → _baseUniq-JsDeIdvj.js} +13 -13
  4. package/dist/{any-language-editor-D3C2KiQW.js → any-language-editor-BzZqDQm_.js} +2 -2
  5. package/dist/{architectureDiagram-IEHRJDOE-DhrFWr1a.js → architectureDiagram-IEHRJDOE-DnNsdc8e.js} +1800 -1800
  6. package/dist/asn1-jKiBa2Ya.js +10 -10
  7. package/dist/assets/{save-worker-9HEtFDM0.js → save-worker-DwN_qfSx.js} +695 -702
  8. package/dist/assets/{worker-BGGm0KYZ.js → worker-BzMPE1Lq.js} +732 -739
  9. package/dist/assets/{worker-BNsqBj5w.js → worker-ISYYr8IB.js} +726 -732
  10. package/dist/blockDiagram-JOT3LUYC-C_KEbscf.js +2249 -0
  11. package/dist/{c4Diagram-VJAJSXHY-DKSU0_Zg.js → c4Diagram-VJAJSXHY-B7trZ6_H.js} +401 -400
  12. package/dist/{channel-DMiLp-mI.js → channel-CwUzkjN9.js} +1 -1
  13. package/dist/chunk-4BMEZGHF-C4_0qa8X.js +9 -0
  14. package/dist/chunk-A2AXSNBT-DApfdN4z.js +1373 -0
  15. package/dist/chunk-AEK57VVT-D_rUaIu3.js +1416 -0
  16. package/dist/{chunk-D6G4REZN-BZV3ukOi.js → chunk-D6G4REZN-BJurAONC.js} +2 -2
  17. package/dist/{chunk-RZ5BOZE2-B4rOVQD8.js → chunk-RZ5BOZE2-ChOs68Hz.js} +8 -8
  18. package/dist/chunk-XZIHB7SX-CGbScEEe.js +16 -0
  19. package/dist/{classDiagram-GIVACNV2-DLRT4_A4.js → classDiagram-GIVACNV2-CqVjeibK.js} +2 -2
  20. package/dist/{classDiagram-v2-COTLJTTW-DLRT4_A4.js → classDiagram-v2-COTLJTTW-CqVjeibK.js} +2 -2
  21. package/dist/clojure-CCKyeQKf.js +2 -2
  22. package/dist/{clone-CPwu6xRn.js → clone-BPHB9gtw.js} +1 -1
  23. package/dist/css-bIlmDBTK.js +19 -19
  24. package/dist/{cytoscape.esm-DAyNQ0qu.js → cytoscape.esm-CCQ3SVU1.js} +2301 -2301
  25. package/dist/dagre-OKDRZEBW-EJUR9APO.js +447 -0
  26. package/dist/{data-editor-CYvUeKhw.js → data-editor-CvujN_l-.js} +5785 -5795
  27. package/dist/{diagram-SSKATNLV-D8WhiY2q.js → diagram-SSKATNLV-Bs-Zy3OO.js} +13 -13
  28. package/dist/{diagram-VNBRO52H-Bil9sOsr.js → diagram-VNBRO52H-rhV7IJ0T.js} +3 -3
  29. package/dist/{erDiagram-Q7BY3M3F-J-Jm-DD7.js → erDiagram-Q7BY3M3F-DwuCpdOL.js} +263 -262
  30. package/dist/flowDiagram-4HSFHLVR-CpbGvx3R.js +1623 -0
  31. package/dist/{ganttDiagram-APWFNJXF-C2G0-fOq.js → ganttDiagram-APWFNJXF-B9ih7Ggj.js} +45 -45
  32. package/dist/gitGraphDiagram-7IBYFJ6S-tTFS2NlF.js +712 -0
  33. package/dist/{graph-BFerxzEi.js → graph-DiSBbvS5.js} +9 -9
  34. package/dist/{index-DfpR00QG.js → index-BZo5-DOE.js} +99 -98
  35. package/dist/{index-j8M50mVa.js → index-CmU7bpCv.js} +4 -4
  36. package/dist/{index-DkuVwdVm.js → index-KrnLhU30.js} +9 -9
  37. package/dist/{index-BhtvwOag.js → index-TeAlNqJE.js} +28 -28
  38. package/dist/{infoDiagram-PH2N3AL5-AYtb1_Lz.js → infoDiagram-PH2N3AL5-COt3b362.js} +3 -3
  39. package/dist/javascript-WMWNx-Vj.js +47 -47
  40. package/dist/{journeyDiagram-U35MCT3I-Bdz9gIBI.js → journeyDiagram-U35MCT3I-Civ2cUVg.js} +18 -18
  41. package/dist/kanban-definition-NDS4AKOZ-QxhTc8lo.js +719 -0
  42. package/dist/{katex-9tX9hjoM.js → katex-CUSbq6rG.js} +2180 -2180
  43. package/dist/{layout-Qs-BVu8V.js → layout-B0SQ1LdD.js} +27 -27
  44. package/dist/{linear-SIbCb7yI.js → linear-Bn_UtFyT.js} +2 -2
  45. package/dist/main-ClxYr2BI.js +169878 -0
  46. package/dist/main.js +1 -1
  47. package/dist/mermaid-M3c3q4Qd.js +14517 -0
  48. package/dist/{mhchem-L5-rce7L.js → mhchem-Db_f2n8C.js} +30 -30
  49. package/dist/{min-BTA1UVkn.js → min-C0Jzc_ko.js} +2 -2
  50. package/dist/{mindmap-definition-ALO5MXBD-CdrD5BzZ.js → mindmap-definition-ALO5MXBD-BW8IbhiG.js} +359 -359
  51. package/dist/mllike-BSnXJBGA.js +7 -7
  52. package/dist/{pieDiagram-IB7DONF6-BbbxWeqU.js → pieDiagram-IB7DONF6-DIa7m5Au.js} +34 -34
  53. package/dist/pug-BqUR2bBq.js +35 -35
  54. package/dist/python-B5QdSKoL.js +18 -18
  55. package/dist/quadrantDiagram-7GDLP6J5-D1HtkiJK.js +1025 -0
  56. package/dist/{radar-MK3ICKWK-Z5R0bt0z.js → radar-MK3ICKWK-Dm3jRuoE.js} +2555 -2554
  57. package/dist/{react-plotly-DqDxe4Uh.js → react-plotly-CJ3A7ju0.js} +6595 -6597
  58. package/dist/{requirementDiagram-KVF5MWMF-DMnvzAxX.js → requirementDiagram-KVF5MWMF-b-q1aUEu.js} +251 -250
  59. package/dist/rpm-IznJm2Xc.js +9 -9
  60. package/dist/{sankeyDiagram-QLVOVGJD-DbUWg3a4.js → sankeyDiagram-QLVOVGJD-Bo4y0LBQ.js} +339 -338
  61. package/dist/{sequenceDiagram-X6HHIX6F-JltcBwLF.js → sequenceDiagram-X6HHIX6F-DMq4wla5.js} +822 -821
  62. package/dist/{slides-component-DVr5mf9p.js → slides-component-Cyh202Vq.js} +280 -280
  63. package/dist/sql-mMre1Bo3.js +9 -9
  64. package/dist/{stateDiagram-DGXRK772-qbXtyoS6.js → stateDiagram-DGXRK772-D_y0WAcv.js} +17 -17
  65. package/dist/{stateDiagram-v2-YXO3MK2T-Ba7q5pMK.js → stateDiagram-v2-YXO3MK2T-CHK5LNw7.js} +2 -2
  66. package/dist/style.css +1 -1
  67. package/dist/{time-DHD8Fix8.js → time-YVQKuiUR.js} +2 -2
  68. package/dist/{timeline-definition-BDJGKUSR-q4gOCBRq.js → timeline-definition-BDJGKUSR-DH63_P4w.js} +261 -261
  69. package/dist/timer-BYwnU4DF.js +378 -378
  70. package/dist/ttcn-cfg-Bac_acMi.js +9 -9
  71. package/dist/{vega-component-D2NZFVvw.js → vega-component-CUFBFMjm.js} +82 -82
  72. package/dist/{xychartDiagram-VJFVF3MP-BZs9xPvU.js → xychartDiagram-VJFVF3MP-3NU7tduZ.js} +472 -471
  73. package/package.json +1 -1
  74. package/dist/blockDiagram-JOT3LUYC-COVagShg.js +0 -2248
  75. package/dist/chunk-4BMEZGHF-CeMSohVe.js +0 -9
  76. package/dist/chunk-A2AXSNBT-mQ3fXQfx.js +0 -1372
  77. package/dist/chunk-AEK57VVT-B7kw2yt6.js +0 -1415
  78. package/dist/chunk-XZIHB7SX-C3-5SkZh.js +0 -15
  79. package/dist/dagre-OKDRZEBW-yEQf6TwX.js +0 -447
  80. package/dist/flowDiagram-4HSFHLVR-Dhymtq1g.js +0 -1622
  81. package/dist/gitGraphDiagram-7IBYFJ6S-DCZAwPro.js +0 -712
  82. package/dist/kanban-definition-NDS4AKOZ-ByLpDX9Y.js +0 -719
  83. package/dist/main-Cx3zrED9.js +0 -156521
  84. package/dist/mermaid-DAi_EtLa.js +0 -11991
  85. package/dist/quadrantDiagram-7GDLP6J5-1UQgbW9Z.js +0 -1024
@@ -0,0 +1,2249 @@
1
+ var _a, _b;
2
+ import { _ as d, G as rt, d as O, e as oe, l as L, z as he, B as de, c as R, a2 as ge, a3 as j, a4 as Wt, a5 as ue, u as $, k as pe, a6 as fe, a7 as xt, a8 as xe, i as Tt } from "./mermaid-M3c3q4Qd.js";
3
+ import { c as ye } from "./clone-BPHB9gtw.js";
4
+ import { G as be } from "./graph-DiSBbvS5.js";
5
+ import { c as we } from "./channel-CwUzkjN9.js";
6
+ import { l as me, k as Le } from "./timer-BYwnU4DF.js";
7
+ var yt = function() {
8
+ var e = /* @__PURE__ */ d(function(D, y, g, f) {
9
+ for (g = g || {}, f = D.length; f--; g[D[f]] = y) ;
10
+ return g;
11
+ }, "o"), t = [1, 7], s = [1, 13], n = [1, 14], i = [1, 15], r = [1, 19], a = [1, 16], l = [1, 17], c = [1, 18], u = [8, 30], h = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], x = [1, 23], w = [1, 24], b = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], S = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], E = [1, 49], k = {
12
+ trace: /* @__PURE__ */ d(function() {
13
+ }, "trace"),
14
+ yy: {},
15
+ symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, block: 31, NODE_ID: 32, nodeShapeNLabel: 33, dirList: 34, DIR: 35, NODE_DSTART: 36, NODE_DEND: 37, BLOCK_ARROW_START: 38, BLOCK_ARROW_END: 39, classDef: 40, CLASSDEF_ID: 41, CLASSDEF_STYLEOPTS: 42, DEFAULT: 43, class: 44, CLASSENTITY_IDS: 45, STYLECLASS: 46, style: 47, STYLE_ENTITY_IDS: 48, STYLE_DEFINITION_DATA: 49, $accept: 0, $end: 1 },
16
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
17
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
18
+ performAction: /* @__PURE__ */ d(function(y, g, f, m, v, o, W) {
19
+ var p = o.length - 1;
20
+ switch (v) {
21
+ case 4:
22
+ m.getLogger().debug("Rule: separator (NL) ");
23
+ break;
24
+ case 5:
25
+ m.getLogger().debug("Rule: separator (Space) ");
26
+ break;
27
+ case 6:
28
+ m.getLogger().debug("Rule: separator (EOF) ");
29
+ break;
30
+ case 7:
31
+ m.getLogger().debug("Rule: hierarchy: ", o[p - 1]), m.setHierarchy(o[p - 1]);
32
+ break;
33
+ case 8:
34
+ m.getLogger().debug("Stop NL ");
35
+ break;
36
+ case 9:
37
+ m.getLogger().debug("Stop EOF ");
38
+ break;
39
+ case 10:
40
+ m.getLogger().debug("Stop NL2 ");
41
+ break;
42
+ case 11:
43
+ m.getLogger().debug("Stop EOF2 ");
44
+ break;
45
+ case 12:
46
+ m.getLogger().debug("Rule: statement: ", o[p]), typeof o[p].length == "number" ? this.$ = o[p] : this.$ = [o[p]];
47
+ break;
48
+ case 13:
49
+ m.getLogger().debug("Rule: statement #2: ", o[p - 1]), this.$ = [o[p - 1]].concat(o[p]);
50
+ break;
51
+ case 14:
52
+ m.getLogger().debug("Rule: link: ", o[p], y), this.$ = { edgeTypeStr: o[p], label: "" };
53
+ break;
54
+ case 15:
55
+ m.getLogger().debug("Rule: LABEL link: ", o[p - 3], o[p - 1], o[p]), this.$ = { edgeTypeStr: o[p], label: o[p - 1] };
56
+ break;
57
+ case 18:
58
+ const I = parseInt(o[p]), Z = m.generateId();
59
+ this.$ = { id: Z, type: "space", label: "", width: I, children: [] };
60
+ break;
61
+ case 23:
62
+ m.getLogger().debug("Rule: (nodeStatement link node) ", o[p - 2], o[p - 1], o[p], " typestr: ", o[p - 1].edgeTypeStr);
63
+ const V = m.edgeStrToEdgeData(o[p - 1].edgeTypeStr);
64
+ this.$ = [
65
+ { id: o[p - 2].id, label: o[p - 2].label, type: o[p - 2].type, directions: o[p - 2].directions },
66
+ { id: o[p - 2].id + "-" + o[p].id, start: o[p - 2].id, end: o[p].id, label: o[p - 1].label, type: "edge", directions: o[p].directions, arrowTypeEnd: V, arrowTypeStart: "arrow_open" },
67
+ { id: o[p].id, label: o[p].label, type: m.typeStr2Type(o[p].typeStr), directions: o[p].directions }
68
+ ];
69
+ break;
70
+ case 24:
71
+ m.getLogger().debug("Rule: nodeStatement (abc88 node size) ", o[p - 1], o[p]), this.$ = { id: o[p - 1].id, label: o[p - 1].label, type: m.typeStr2Type(o[p - 1].typeStr), directions: o[p - 1].directions, widthInColumns: parseInt(o[p], 10) };
72
+ break;
73
+ case 25:
74
+ m.getLogger().debug("Rule: nodeStatement (node) ", o[p]), this.$ = { id: o[p].id, label: o[p].label, type: m.typeStr2Type(o[p].typeStr), directions: o[p].directions, widthInColumns: 1 };
75
+ break;
76
+ case 26:
77
+ m.getLogger().debug("APA123", this ? this : "na"), m.getLogger().debug("COLUMNS: ", o[p]), this.$ = { type: "column-setting", columns: o[p] === "auto" ? -1 : parseInt(o[p]) };
78
+ break;
79
+ case 27:
80
+ m.getLogger().debug("Rule: id-block statement : ", o[p - 2], o[p - 1]), m.generateId(), this.$ = { ...o[p - 2], type: "composite", children: o[p - 1] };
81
+ break;
82
+ case 28:
83
+ m.getLogger().debug("Rule: blockStatement : ", o[p - 2], o[p - 1], o[p]);
84
+ const at = m.generateId();
85
+ this.$ = { id: at, type: "composite", label: "", children: o[p - 1] };
86
+ break;
87
+ case 29:
88
+ m.getLogger().debug("Rule: node (NODE_ID separator): ", o[p]), this.$ = { id: o[p] };
89
+ break;
90
+ case 30:
91
+ m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", o[p - 1], o[p]), this.$ = { id: o[p - 1], label: o[p].label, typeStr: o[p].typeStr, directions: o[p].directions };
92
+ break;
93
+ case 31:
94
+ m.getLogger().debug("Rule: dirList: ", o[p]), this.$ = [o[p]];
95
+ break;
96
+ case 32:
97
+ m.getLogger().debug("Rule: dirList: ", o[p - 1], o[p]), this.$ = [o[p - 1]].concat(o[p]);
98
+ break;
99
+ case 33:
100
+ m.getLogger().debug("Rule: nodeShapeNLabel: ", o[p - 2], o[p - 1], o[p]), this.$ = { typeStr: o[p - 2] + o[p], label: o[p - 1] };
101
+ break;
102
+ case 34:
103
+ m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", o[p - 3], o[p - 2], " #3:", o[p - 1], o[p]), this.$ = { typeStr: o[p - 3] + o[p], label: o[p - 2], directions: o[p - 1] };
104
+ break;
105
+ case 35:
106
+ case 36:
107
+ this.$ = { type: "classDef", id: o[p - 1].trim(), css: o[p].trim() };
108
+ break;
109
+ case 37:
110
+ this.$ = { type: "applyClass", id: o[p - 1].trim(), styleClass: o[p].trim() };
111
+ break;
112
+ case 38:
113
+ this.$ = { type: "applyStyles", id: o[p - 1].trim(), stylesStr: o[p].trim() };
114
+ break;
115
+ }
116
+ }, "anonymous"),
117
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: t, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: n, 31: i, 32: r, 40: a, 44: l, 47: c }, { 8: [1, 20] }, e(u, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: t, 28: s, 29: n, 31: i, 32: r, 40: a, 44: l, 47: c }), e(h, [2, 16], { 14: 22, 15: x, 16: w }), e(h, [2, 17]), e(h, [2, 18]), e(h, [2, 19]), e(h, [2, 20]), e(h, [2, 21]), e(h, [2, 22]), e(b, [2, 25], { 27: [1, 25] }), e(h, [2, 26]), { 19: 26, 26: 12, 32: r }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: t, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: n, 31: i, 32: r, 40: a, 44: l, 47: c }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, e(S, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, e(u, [2, 13]), { 26: 35, 32: r }, { 32: [2, 14] }, { 17: [1, 36] }, e(b, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: x, 16: w, 19: 5, 20: 6, 21: t, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: n, 31: i, 32: r, 40: a, 44: l, 47: c }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, e(S, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(b, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(h, [2, 28]), e(h, [2, 35]), e(h, [2, 36]), e(h, [2, 37]), e(h, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: E }, { 15: [1, 50] }, e(h, [2, 27]), e(S, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: E, 39: [2, 31] }, { 32: [2, 15] }, e(S, [2, 34]), { 39: [2, 32] }],
118
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
119
+ parseError: /* @__PURE__ */ d(function(y, g) {
120
+ if (g.recoverable)
121
+ this.trace(y);
122
+ else {
123
+ var f = new Error(y);
124
+ throw f.hash = g, f;
125
+ }
126
+ }, "parseError"),
127
+ parse: /* @__PURE__ */ d(function(y) {
128
+ var g = this, f = [0], m = [], v = [null], o = [], W = this.table, p = "", I = 0, Z = 0, V = 2, at = 1, ne = o.slice.call(arguments, 1), z = Object.create(this.lexer), q = { yy: {} };
129
+ for (var gt in this.yy)
130
+ Object.prototype.hasOwnProperty.call(this.yy, gt) && (q.yy[gt] = this.yy[gt]);
131
+ z.setInput(y, q.yy), q.yy.lexer = z, q.yy.parser = this, typeof z.yylloc > "u" && (z.yylloc = {});
132
+ var ut = z.yylloc;
133
+ o.push(ut);
134
+ var le = z.options && z.options.ranges;
135
+ typeof q.yy.parseError == "function" ? this.parseError = q.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
136
+ function ce(P) {
137
+ f.length = f.length - 2 * P, v.length = v.length - P, o.length = o.length - P;
138
+ }
139
+ d(ce, "popStack");
140
+ function Dt() {
141
+ var P;
142
+ return P = m.pop() || z.lex() || at, typeof P != "number" && (P instanceof Array && (m = P, P = m.pop()), P = g.symbols_[P] || P), P;
143
+ }
144
+ d(Dt, "lex");
145
+ for (var F, J, H, pt, Q = {}, st, G, Nt, it; ; ) {
146
+ if (J = f[f.length - 1], this.defaultActions[J] ? H = this.defaultActions[J] : ((F === null || typeof F > "u") && (F = Dt()), H = W[J] && W[J][F]), typeof H > "u" || !H.length || !H[0]) {
147
+ var ft = "";
148
+ it = [];
149
+ for (st in W[J])
150
+ this.terminals_[st] && st > V && it.push("'" + this.terminals_[st] + "'");
151
+ z.showPosition ? ft = "Parse error on line " + (I + 1) + `:
152
+ ` + z.showPosition() + `
153
+ Expecting ` + it.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : ft = "Parse error on line " + (I + 1) + ": Unexpected " + (F == at ? "end of input" : "'" + (this.terminals_[F] || F) + "'"), this.parseError(ft, {
154
+ text: z.match,
155
+ token: this.terminals_[F] || F,
156
+ line: z.yylineno,
157
+ loc: ut,
158
+ expected: it
159
+ });
160
+ }
161
+ if (H[0] instanceof Array && H.length > 1)
162
+ throw new Error("Parse Error: multiple actions possible at state: " + J + ", token: " + F);
163
+ switch (H[0]) {
164
+ case 1:
165
+ f.push(F), v.push(z.yytext), o.push(z.yylloc), f.push(H[1]), F = null, Z = z.yyleng, p = z.yytext, I = z.yylineno, ut = z.yylloc;
166
+ break;
167
+ case 2:
168
+ if (G = this.productions_[H[1]][1], Q.$ = v[v.length - G], Q._$ = {
169
+ first_line: o[o.length - (G || 1)].first_line,
170
+ last_line: o[o.length - 1].last_line,
171
+ first_column: o[o.length - (G || 1)].first_column,
172
+ last_column: o[o.length - 1].last_column
173
+ }, le && (Q._$.range = [
174
+ o[o.length - (G || 1)].range[0],
175
+ o[o.length - 1].range[1]
176
+ ]), pt = this.performAction.apply(Q, [
177
+ p,
178
+ Z,
179
+ I,
180
+ q.yy,
181
+ H[1],
182
+ v,
183
+ o
184
+ ].concat(ne)), typeof pt < "u")
185
+ return pt;
186
+ G && (f = f.slice(0, -1 * G * 2), v = v.slice(0, -1 * G), o = o.slice(0, -1 * G)), f.push(this.productions_[H[1]][0]), v.push(Q.$), o.push(Q._$), Nt = W[f[f.length - 2]][f[f.length - 1]], f.push(Nt);
187
+ break;
188
+ case 3:
189
+ return true;
190
+ }
191
+ }
192
+ return true;
193
+ }, "parse")
194
+ }, B = /* @__PURE__ */ function() {
195
+ var D = {
196
+ EOF: 1,
197
+ parseError: /* @__PURE__ */ d(function(g, f) {
198
+ if (this.yy.parser)
199
+ this.yy.parser.parseError(g, f);
200
+ else
201
+ throw new Error(g);
202
+ }, "parseError"),
203
+ // resets the lexer, sets new input
204
+ setInput: /* @__PURE__ */ d(function(y, g) {
205
+ return this.yy = g || this.yy || {}, this._input = y, this._more = this._backtrack = this.done = false, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
206
+ first_line: 1,
207
+ first_column: 0,
208
+ last_line: 1,
209
+ last_column: 0
210
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
211
+ }, "setInput"),
212
+ // consumes and returns one char from the input
213
+ input: /* @__PURE__ */ d(function() {
214
+ var y = this._input[0];
215
+ this.yytext += y, this.yyleng++, this.offset++, this.match += y, this.matched += y;
216
+ var g = y.match(/(?:\r\n?|\n).*/g);
217
+ return g ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), y;
218
+ }, "input"),
219
+ // unshifts one char (or a string) into the input
220
+ unput: /* @__PURE__ */ d(function(y) {
221
+ var g = y.length, f = y.split(/(?:\r\n?|\n)/g);
222
+ this._input = y + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - g), this.offset -= g;
223
+ var m = this.match.split(/(?:\r\n?|\n)/g);
224
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), f.length - 1 && (this.yylineno -= f.length - 1);
225
+ var v = this.yylloc.range;
226
+ return this.yylloc = {
227
+ first_line: this.yylloc.first_line,
228
+ last_line: this.yylineno + 1,
229
+ first_column: this.yylloc.first_column,
230
+ last_column: f ? (f.length === m.length ? this.yylloc.first_column : 0) + m[m.length - f.length].length - f[0].length : this.yylloc.first_column - g
231
+ }, this.options.ranges && (this.yylloc.range = [v[0], v[0] + this.yyleng - g]), this.yyleng = this.yytext.length, this;
232
+ }, "unput"),
233
+ // When called from action, caches matched text and appends it on next action
234
+ more: /* @__PURE__ */ d(function() {
235
+ return this._more = true, this;
236
+ }, "more"),
237
+ // 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.
238
+ reject: /* @__PURE__ */ d(function() {
239
+ if (this.options.backtrack_lexer)
240
+ this._backtrack = true;
241
+ else
242
+ 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).
243
+ ` + this.showPosition(), {
244
+ text: "",
245
+ token: null,
246
+ line: this.yylineno
247
+ });
248
+ return this;
249
+ }, "reject"),
250
+ // retain first n characters of the match
251
+ less: /* @__PURE__ */ d(function(y) {
252
+ this.unput(this.match.slice(y));
253
+ }, "less"),
254
+ // displays already matched input, i.e. for error messages
255
+ pastInput: /* @__PURE__ */ d(function() {
256
+ var y = this.matched.substr(0, this.matched.length - this.match.length);
257
+ return (y.length > 20 ? "..." : "") + y.substr(-20).replace(/\n/g, "");
258
+ }, "pastInput"),
259
+ // displays upcoming input, i.e. for error messages
260
+ upcomingInput: /* @__PURE__ */ d(function() {
261
+ var y = this.match;
262
+ return y.length < 20 && (y += this._input.substr(0, 20 - y.length)), (y.substr(0, 20) + (y.length > 20 ? "..." : "")).replace(/\n/g, "");
263
+ }, "upcomingInput"),
264
+ // displays the character position where the lexing error occurred, i.e. for error messages
265
+ showPosition: /* @__PURE__ */ d(function() {
266
+ var y = this.pastInput(), g = new Array(y.length + 1).join("-");
267
+ return y + this.upcomingInput() + `
268
+ ` + g + "^";
269
+ }, "showPosition"),
270
+ // test the lexed token: return FALSE when not a match, otherwise return token
271
+ test_match: /* @__PURE__ */ d(function(y, g) {
272
+ var f, m, v;
273
+ if (this.options.backtrack_lexer && (v = {
274
+ yylineno: this.yylineno,
275
+ yylloc: {
276
+ first_line: this.yylloc.first_line,
277
+ last_line: this.last_line,
278
+ first_column: this.yylloc.first_column,
279
+ last_column: this.yylloc.last_column
280
+ },
281
+ yytext: this.yytext,
282
+ match: this.match,
283
+ matches: this.matches,
284
+ matched: this.matched,
285
+ yyleng: this.yyleng,
286
+ offset: this.offset,
287
+ _more: this._more,
288
+ _input: this._input,
289
+ yy: this.yy,
290
+ conditionStack: this.conditionStack.slice(0),
291
+ done: this.done
292
+ }, this.options.ranges && (v.yylloc.range = this.yylloc.range.slice(0))), m = y[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
293
+ first_line: this.yylloc.last_line,
294
+ last_line: this.yylineno + 1,
295
+ first_column: this.yylloc.last_column,
296
+ last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + y[0].length
297
+ }, this.yytext += y[0], this.match += y[0], this.matches = y, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = false, this._backtrack = false, this._input = this._input.slice(y[0].length), this.matched += y[0], f = this.performAction.call(this, this.yy, this, g, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = false), f)
298
+ return f;
299
+ if (this._backtrack) {
300
+ for (var o in v)
301
+ this[o] = v[o];
302
+ return false;
303
+ }
304
+ return false;
305
+ }, "test_match"),
306
+ // return next match in input
307
+ next: /* @__PURE__ */ d(function() {
308
+ if (this.done)
309
+ return this.EOF;
310
+ this._input || (this.done = true);
311
+ var y, g, f, m;
312
+ this._more || (this.yytext = "", this.match = "");
313
+ for (var v = this._currentRules(), o = 0; o < v.length; o++)
314
+ if (f = this._input.match(this.rules[v[o]]), f && (!g || f[0].length > g[0].length)) {
315
+ if (g = f, m = o, this.options.backtrack_lexer) {
316
+ if (y = this.test_match(f, v[o]), y !== false)
317
+ return y;
318
+ if (this._backtrack) {
319
+ g = false;
320
+ continue;
321
+ } else
322
+ return false;
323
+ } else if (!this.options.flex)
324
+ break;
325
+ }
326
+ return g ? (y = this.test_match(g, v[m]), y !== false ? y : false) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
327
+ ` + this.showPosition(), {
328
+ text: "",
329
+ token: null,
330
+ line: this.yylineno
331
+ });
332
+ }, "next"),
333
+ // return next match that has a token
334
+ lex: /* @__PURE__ */ d(function() {
335
+ var g = this.next();
336
+ return g || this.lex();
337
+ }, "lex"),
338
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
339
+ begin: /* @__PURE__ */ d(function(g) {
340
+ this.conditionStack.push(g);
341
+ }, "begin"),
342
+ // pop the previously active lexer condition state off the condition stack
343
+ popState: /* @__PURE__ */ d(function() {
344
+ var g = this.conditionStack.length - 1;
345
+ return g > 0 ? this.conditionStack.pop() : this.conditionStack[0];
346
+ }, "popState"),
347
+ // produce the lexer rule set which is active for the currently active lexer condition state
348
+ _currentRules: /* @__PURE__ */ d(function() {
349
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
350
+ }, "_currentRules"),
351
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
352
+ topState: /* @__PURE__ */ d(function(g) {
353
+ return g = this.conditionStack.length - 1 - Math.abs(g || 0), g >= 0 ? this.conditionStack[g] : "INITIAL";
354
+ }, "topState"),
355
+ // alias for begin(condition)
356
+ pushState: /* @__PURE__ */ d(function(g) {
357
+ this.begin(g);
358
+ }, "pushState"),
359
+ // return the number of states currently on the stack
360
+ stateStackSize: /* @__PURE__ */ d(function() {
361
+ return this.conditionStack.length;
362
+ }, "stateStackSize"),
363
+ options: {},
364
+ performAction: /* @__PURE__ */ d(function(g, f, m, v) {
365
+ switch (m) {
366
+ case 0:
367
+ return 10;
368
+ case 1:
369
+ return g.getLogger().debug("Found space-block"), 31;
370
+ case 2:
371
+ return g.getLogger().debug("Found nl-block"), 31;
372
+ case 3:
373
+ return g.getLogger().debug("Found space-block"), 29;
374
+ case 4:
375
+ g.getLogger().debug(".", f.yytext);
376
+ break;
377
+ case 5:
378
+ g.getLogger().debug("_", f.yytext);
379
+ break;
380
+ case 6:
381
+ return 5;
382
+ case 7:
383
+ return f.yytext = -1, 28;
384
+ case 8:
385
+ return f.yytext = f.yytext.replace(/columns\s+/, ""), g.getLogger().debug("COLUMNS (LEX)", f.yytext), 28;
386
+ case 9:
387
+ this.pushState("md_string");
388
+ break;
389
+ case 10:
390
+ return "MD_STR";
391
+ case 11:
392
+ this.popState();
393
+ break;
394
+ case 12:
395
+ this.pushState("string");
396
+ break;
397
+ case 13:
398
+ g.getLogger().debug("LEX: POPPING STR:", f.yytext), this.popState();
399
+ break;
400
+ case 14:
401
+ return g.getLogger().debug("LEX: STR end:", f.yytext), "STR";
402
+ case 15:
403
+ return f.yytext = f.yytext.replace(/space\:/, ""), g.getLogger().debug("SPACE NUM (LEX)", f.yytext), 21;
404
+ case 16:
405
+ return f.yytext = "1", g.getLogger().debug("COLUMNS (LEX)", f.yytext), 21;
406
+ case 17:
407
+ return 43;
408
+ case 18:
409
+ return "LINKSTYLE";
410
+ case 19:
411
+ return "INTERPOLATE";
412
+ case 20:
413
+ return this.pushState("CLASSDEF"), 40;
414
+ case 21:
415
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
416
+ case 22:
417
+ return this.popState(), this.pushState("CLASSDEFID"), 41;
418
+ case 23:
419
+ return this.popState(), 42;
420
+ case 24:
421
+ return this.pushState("CLASS"), 44;
422
+ case 25:
423
+ return this.popState(), this.pushState("CLASS_STYLE"), 45;
424
+ case 26:
425
+ return this.popState(), 46;
426
+ case 27:
427
+ return this.pushState("STYLE_STMNT"), 47;
428
+ case 28:
429
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 48;
430
+ case 29:
431
+ return this.popState(), 49;
432
+ case 30:
433
+ return this.pushState("acc_title"), "acc_title";
434
+ case 31:
435
+ return this.popState(), "acc_title_value";
436
+ case 32:
437
+ return this.pushState("acc_descr"), "acc_descr";
438
+ case 33:
439
+ return this.popState(), "acc_descr_value";
440
+ case 34:
441
+ this.pushState("acc_descr_multiline");
442
+ break;
443
+ case 35:
444
+ this.popState();
445
+ break;
446
+ case 36:
447
+ return "acc_descr_multiline_value";
448
+ case 37:
449
+ return 30;
450
+ case 38:
451
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
452
+ case 39:
453
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
454
+ case 40:
455
+ return this.popState(), g.getLogger().debug("Lex: ))"), "NODE_DEND";
456
+ case 41:
457
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
458
+ case 42:
459
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
460
+ case 43:
461
+ return this.popState(), g.getLogger().debug("Lex: (-"), "NODE_DEND";
462
+ case 44:
463
+ return this.popState(), g.getLogger().debug("Lex: -)"), "NODE_DEND";
464
+ case 45:
465
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
466
+ case 46:
467
+ return this.popState(), g.getLogger().debug("Lex: ]]"), "NODE_DEND";
468
+ case 47:
469
+ return this.popState(), g.getLogger().debug("Lex: ("), "NODE_DEND";
470
+ case 48:
471
+ return this.popState(), g.getLogger().debug("Lex: ])"), "NODE_DEND";
472
+ case 49:
473
+ return this.popState(), g.getLogger().debug("Lex: /]"), "NODE_DEND";
474
+ case 50:
475
+ return this.popState(), g.getLogger().debug("Lex: /]"), "NODE_DEND";
476
+ case 51:
477
+ return this.popState(), g.getLogger().debug("Lex: )]"), "NODE_DEND";
478
+ case 52:
479
+ return this.popState(), g.getLogger().debug("Lex: )"), "NODE_DEND";
480
+ case 53:
481
+ return this.popState(), g.getLogger().debug("Lex: ]>"), "NODE_DEND";
482
+ case 54:
483
+ return this.popState(), g.getLogger().debug("Lex: ]"), "NODE_DEND";
484
+ case 55:
485
+ return g.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 36;
486
+ case 56:
487
+ return g.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 36;
488
+ case 57:
489
+ return g.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 36;
490
+ case 58:
491
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
492
+ case 59:
493
+ return g.getLogger().debug("Lex: ((("), this.pushState("NODE"), 36;
494
+ case 60:
495
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
496
+ case 61:
497
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
498
+ case 62:
499
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
500
+ case 63:
501
+ return g.getLogger().debug("Lexc: >"), this.pushState("NODE"), 36;
502
+ case 64:
503
+ return g.getLogger().debug("Lexa: (["), this.pushState("NODE"), 36;
504
+ case 65:
505
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
506
+ case 66:
507
+ return this.pushState("NODE"), 36;
508
+ case 67:
509
+ return this.pushState("NODE"), 36;
510
+ case 68:
511
+ return this.pushState("NODE"), 36;
512
+ case 69:
513
+ return this.pushState("NODE"), 36;
514
+ case 70:
515
+ return this.pushState("NODE"), 36;
516
+ case 71:
517
+ return this.pushState("NODE"), 36;
518
+ case 72:
519
+ return this.pushState("NODE"), 36;
520
+ case 73:
521
+ return g.getLogger().debug("Lexa: ["), this.pushState("NODE"), 36;
522
+ case 74:
523
+ return this.pushState("BLOCK_ARROW"), g.getLogger().debug("LEX ARR START"), 38;
524
+ case 75:
525
+ return g.getLogger().debug("Lex: NODE_ID", f.yytext), 32;
526
+ case 76:
527
+ return g.getLogger().debug("Lex: EOF", f.yytext), 8;
528
+ case 77:
529
+ this.pushState("md_string");
530
+ break;
531
+ case 78:
532
+ this.pushState("md_string");
533
+ break;
534
+ case 79:
535
+ return "NODE_DESCR";
536
+ case 80:
537
+ this.popState();
538
+ break;
539
+ case 81:
540
+ g.getLogger().debug("Lex: Starting string"), this.pushState("string");
541
+ break;
542
+ case 82:
543
+ g.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
544
+ break;
545
+ case 83:
546
+ return g.getLogger().debug("LEX: NODE_DESCR:", f.yytext), "NODE_DESCR";
547
+ case 84:
548
+ g.getLogger().debug("LEX POPPING"), this.popState();
549
+ break;
550
+ case 85:
551
+ g.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
552
+ break;
553
+ case 86:
554
+ return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (right): dir:", f.yytext), "DIR";
555
+ case 87:
556
+ return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (left):", f.yytext), "DIR";
557
+ case 88:
558
+ return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (x):", f.yytext), "DIR";
559
+ case 89:
560
+ return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (y):", f.yytext), "DIR";
561
+ case 90:
562
+ return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (up):", f.yytext), "DIR";
563
+ case 91:
564
+ return f.yytext = f.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (down):", f.yytext), "DIR";
565
+ case 92:
566
+ return f.yytext = "]>", g.getLogger().debug("Lex (ARROW_DIR end):", f.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
567
+ case 93:
568
+ return g.getLogger().debug("Lex: LINK", "#" + f.yytext + "#"), 15;
569
+ case 94:
570
+ return g.getLogger().debug("Lex: LINK", f.yytext), 15;
571
+ case 95:
572
+ return g.getLogger().debug("Lex: LINK", f.yytext), 15;
573
+ case 96:
574
+ return g.getLogger().debug("Lex: LINK", f.yytext), 15;
575
+ case 97:
576
+ return g.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
577
+ case 98:
578
+ return g.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
579
+ case 99:
580
+ return g.getLogger().debug("Lex: START_LINK", f.yytext), this.pushState("LLABEL"), 16;
581
+ case 100:
582
+ this.pushState("md_string");
583
+ break;
584
+ case 101:
585
+ return g.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
586
+ case 102:
587
+ return this.popState(), g.getLogger().debug("Lex: LINK", "#" + f.yytext + "#"), 15;
588
+ case 103:
589
+ return this.popState(), g.getLogger().debug("Lex: LINK", f.yytext), 15;
590
+ case 104:
591
+ return this.popState(), g.getLogger().debug("Lex: LINK", f.yytext), 15;
592
+ case 105:
593
+ return g.getLogger().debug("Lex: COLON", f.yytext), f.yytext = f.yytext.slice(1), 27;
594
+ }
595
+ }, "anonymous"),
596
+ rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
597
+ conditions: { STYLE_DEFINITION: { rules: [29], inclusive: false }, STYLE_STMNT: { rules: [28], inclusive: false }, CLASSDEFID: { rules: [23], inclusive: false }, CLASSDEF: { rules: [21, 22], inclusive: false }, CLASS_STYLE: { rules: [26], inclusive: false }, CLASS: { rules: [25], inclusive: false }, LLABEL: { rules: [100, 101, 102, 103, 104], inclusive: false }, ARROW_DIR: { rules: [86, 87, 88, 89, 90, 91, 92], inclusive: false }, BLOCK_ARROW: { rules: [77, 82, 85], inclusive: false }, NODE: { rules: [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], inclusive: false }, md_string: { rules: [10, 11, 79, 80], inclusive: false }, space: { rules: [], inclusive: false }, string: { rules: [13, 14, 83, 84], inclusive: false }, acc_descr_multiline: { rules: [35, 36], inclusive: false }, acc_descr: { rules: [33], inclusive: false }, acc_title: { rules: [31], inclusive: false }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], inclusive: true } }
598
+ };
599
+ return D;
600
+ }();
601
+ k.lexer = B;
602
+ function _() {
603
+ this.yy = {};
604
+ }
605
+ return d(_, "Parser"), _.prototype = k, k.Parser = _, new _();
606
+ }();
607
+ yt.parser = yt;
608
+ var Se = yt, X = /* @__PURE__ */ new Map(), St = [], bt = /* @__PURE__ */ new Map(), Bt = "color", Ct = "fill", ke = "bgFill", Pt = ",", ve = R(), ct = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ d((e) => pe.sanitizeText(e, ve), "sanitizeText"), _e = /* @__PURE__ */ d(function(e, t = "") {
609
+ let s = ct.get(e);
610
+ s || (s = { id: e, styles: [], textStyles: [] }, ct.set(e, s)), t == null ? void 0 : t.split(Pt).forEach((n) => {
611
+ const i = n.replace(/([^;]*);/, "$1").trim();
612
+ if (RegExp(Bt).exec(n)) {
613
+ const a = i.replace(Ct, ke).replace(Bt, Ct);
614
+ s.textStyles.push(a);
615
+ }
616
+ s.styles.push(i);
617
+ });
618
+ }, "addStyleClass"), De = /* @__PURE__ */ d(function(e, t = "") {
619
+ const s = X.get(e);
620
+ t != null && (s.styles = t.split(Pt));
621
+ }, "addStyle2Node"), Ne = /* @__PURE__ */ d(function(e, t) {
622
+ e.split(",").forEach(function(s) {
623
+ let n = X.get(s);
624
+ if (n === void 0) {
625
+ const i = s.trim();
626
+ n = { id: i, type: "na", children: [] }, X.set(i, n);
627
+ }
628
+ n.classes || (n.classes = []), n.classes.push(t);
629
+ });
630
+ }, "setCssClass"), Yt = /* @__PURE__ */ d((e, t) => {
631
+ const s = e.flat(), n = [];
632
+ for (const i of s) {
633
+ if (i.label && (i.label = Ee(i.label)), i.type === "classDef") {
634
+ _e(i.id, i.css);
635
+ continue;
636
+ }
637
+ if (i.type === "applyClass") {
638
+ Ne(i.id, (i == null ? void 0 : i.styleClass) ?? "");
639
+ continue;
640
+ }
641
+ if (i.type === "applyStyles") {
642
+ (i == null ? void 0 : i.stylesStr) && De(i.id, i == null ? void 0 : i.stylesStr);
643
+ continue;
644
+ }
645
+ if (i.type === "column-setting")
646
+ t.columns = i.columns ?? -1;
647
+ else if (i.type === "edge") {
648
+ const r = (bt.get(i.id) ?? 0) + 1;
649
+ bt.set(i.id, r), i.id = r + "-" + i.id, St.push(i);
650
+ } else {
651
+ i.label || (i.type === "composite" ? i.label = "" : i.label = i.id);
652
+ const r = X.get(i.id);
653
+ if (r === void 0 ? X.set(i.id, i) : (i.type !== "na" && (r.type = i.type), i.label !== i.id && (r.label = i.label)), i.children && Yt(i.children, i), i.type === "space") {
654
+ const a = i.width ?? 1;
655
+ for (let l = 0; l < a; l++) {
656
+ const c = ye(i);
657
+ c.id = c.id + "-" + l, X.set(c.id, c), n.push(c);
658
+ }
659
+ } else r === void 0 && n.push(i);
660
+ }
661
+ }
662
+ t.children = n;
663
+ }, "populateBlockDatabase"), kt = [], et = { id: "root", type: "composite", children: [], columns: -1 }, Te = /* @__PURE__ */ d(() => {
664
+ L.debug("Clear called"), he(), et = { id: "root", type: "composite", children: [], columns: -1 }, X = /* @__PURE__ */ new Map([["root", et]]), kt = [], ct = /* @__PURE__ */ new Map(), St = [], bt = /* @__PURE__ */ new Map();
665
+ }, "clear");
666
+ function Ht(e) {
667
+ switch (L.debug("typeStr2Type", e), e) {
668
+ case "[]":
669
+ return "square";
670
+ case "()":
671
+ return L.debug("we have a round"), "round";
672
+ case "(())":
673
+ return "circle";
674
+ case ">]":
675
+ return "rect_left_inv_arrow";
676
+ case "{}":
677
+ return "diamond";
678
+ case "{{}}":
679
+ return "hexagon";
680
+ case "([])":
681
+ return "stadium";
682
+ case "[[]]":
683
+ return "subroutine";
684
+ case "[()]":
685
+ return "cylinder";
686
+ case "((()))":
687
+ return "doublecircle";
688
+ case "[//]":
689
+ return "lean_right";
690
+ case "[\\\\]":
691
+ return "lean_left";
692
+ case "[/\\]":
693
+ return "trapezoid";
694
+ case "[\\/]":
695
+ return "inv_trapezoid";
696
+ case "<[]>":
697
+ return "block_arrow";
698
+ default:
699
+ return "na";
700
+ }
701
+ }
702
+ d(Ht, "typeStr2Type");
703
+ function Kt(e) {
704
+ switch (L.debug("typeStr2Type", e), e) {
705
+ case "==":
706
+ return "thick";
707
+ default:
708
+ return "normal";
709
+ }
710
+ }
711
+ d(Kt, "edgeTypeStr2Type");
712
+ function Xt(e) {
713
+ switch (e.trim()) {
714
+ case "--x":
715
+ return "arrow_cross";
716
+ case "--o":
717
+ return "arrow_circle";
718
+ default:
719
+ return "arrow_point";
720
+ }
721
+ }
722
+ d(Xt, "edgeStrToEdgeData");
723
+ var It = 0, Be = /* @__PURE__ */ d(() => (It++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + It), "generateId"), Ce = /* @__PURE__ */ d((e) => {
724
+ et.children = e, Yt(e, et), kt = et.children;
725
+ }, "setHierarchy"), Ie = /* @__PURE__ */ d((e) => {
726
+ const t = X.get(e);
727
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
728
+ }, "getColumns"), Oe = /* @__PURE__ */ d(() => [...X.values()], "getBlocksFlat"), Re = /* @__PURE__ */ d(() => kt || [], "getBlocks"), ze = /* @__PURE__ */ d(() => St, "getEdges"), Ae = /* @__PURE__ */ d((e) => X.get(e), "getBlock"), Me = /* @__PURE__ */ d((e) => {
729
+ X.set(e.id, e);
730
+ }, "setBlock"), Fe = /* @__PURE__ */ d(() => console, "getLogger"), We = /* @__PURE__ */ d(function() {
731
+ return ct;
732
+ }, "getClasses"), Pe = {
733
+ getConfig: /* @__PURE__ */ d(() => rt().block, "getConfig"),
734
+ typeStr2Type: Ht,
735
+ edgeTypeStr2Type: Kt,
736
+ edgeStrToEdgeData: Xt,
737
+ getLogger: Fe,
738
+ getBlocksFlat: Oe,
739
+ getBlocks: Re,
740
+ getEdges: ze,
741
+ setHierarchy: Ce,
742
+ getBlock: Ae,
743
+ setBlock: Me,
744
+ getColumns: Ie,
745
+ getClasses: We,
746
+ clear: Te,
747
+ generateId: Be
748
+ }, Ye = Pe, nt = /* @__PURE__ */ d((e, t) => {
749
+ const s = we, n = s(e, "r"), i = s(e, "g"), r = s(e, "b");
750
+ return de(n, i, r, t);
751
+ }, "fade"), He = /* @__PURE__ */ d((e) => `.label {
752
+ font-family: ${e.fontFamily};
753
+ color: ${e.nodeTextColor || e.textColor};
754
+ }
755
+ .cluster-label text {
756
+ fill: ${e.titleColor};
757
+ }
758
+ .cluster-label span,p {
759
+ color: ${e.titleColor};
760
+ }
761
+
762
+
763
+
764
+ .label text,span,p {
765
+ fill: ${e.nodeTextColor || e.textColor};
766
+ color: ${e.nodeTextColor || e.textColor};
767
+ }
768
+
769
+ .node rect,
770
+ .node circle,
771
+ .node ellipse,
772
+ .node polygon,
773
+ .node path {
774
+ fill: ${e.mainBkg};
775
+ stroke: ${e.nodeBorder};
776
+ stroke-width: 1px;
777
+ }
778
+ .flowchart-label text {
779
+ text-anchor: middle;
780
+ }
781
+ // .flowchart-label .text-outer-tspan {
782
+ // text-anchor: middle;
783
+ // }
784
+ // .flowchart-label .text-inner-tspan {
785
+ // text-anchor: start;
786
+ // }
787
+
788
+ .node .label {
789
+ text-align: center;
790
+ }
791
+ .node.clickable {
792
+ cursor: pointer;
793
+ }
794
+
795
+ .arrowheadPath {
796
+ fill: ${e.arrowheadColor};
797
+ }
798
+
799
+ .edgePath .path {
800
+ stroke: ${e.lineColor};
801
+ stroke-width: 2.0px;
802
+ }
803
+
804
+ .flowchart-link {
805
+ stroke: ${e.lineColor};
806
+ fill: none;
807
+ }
808
+
809
+ .edgeLabel {
810
+ background-color: ${e.edgeLabelBackground};
811
+ rect {
812
+ opacity: 0.5;
813
+ background-color: ${e.edgeLabelBackground};
814
+ fill: ${e.edgeLabelBackground};
815
+ }
816
+ text-align: center;
817
+ }
818
+
819
+ /* For html labels only */
820
+ .labelBkg {
821
+ background-color: ${nt(e.edgeLabelBackground, 0.5)};
822
+ // background-color:
823
+ }
824
+
825
+ .node .cluster {
826
+ // fill: ${nt(e.mainBkg, 0.5)};
827
+ fill: ${nt(e.clusterBkg, 0.5)};
828
+ stroke: ${nt(e.clusterBorder, 0.2)};
829
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
830
+ stroke-width: 1px;
831
+ }
832
+
833
+ .cluster text {
834
+ fill: ${e.titleColor};
835
+ }
836
+
837
+ .cluster span,p {
838
+ color: ${e.titleColor};
839
+ }
840
+ /* .cluster div {
841
+ color: ${e.titleColor};
842
+ } */
843
+
844
+ div.mermaidTooltip {
845
+ position: absolute;
846
+ text-align: center;
847
+ max-width: 200px;
848
+ padding: 2px;
849
+ font-family: ${e.fontFamily};
850
+ font-size: 12px;
851
+ background: ${e.tertiaryColor};
852
+ border: 1px solid ${e.border2};
853
+ border-radius: 2px;
854
+ pointer-events: none;
855
+ z-index: 100;
856
+ }
857
+
858
+ .flowchartTitleText {
859
+ text-anchor: middle;
860
+ font-size: 18px;
861
+ fill: ${e.textColor};
862
+ }
863
+ `, "getStyles"), Ke = He, Xe = /* @__PURE__ */ d((e, t, s, n) => {
864
+ t.forEach((i) => {
865
+ tr[i](e, s, n);
866
+ });
867
+ }, "insertMarkers"), Ue = /* @__PURE__ */ d((e, t, s) => {
868
+ L.trace("Making markers for ", s), e.append("defs").append("marker").attr("id", s + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", s + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
869
+ }, "extension"), je = /* @__PURE__ */ d((e, t, s) => {
870
+ e.append("defs").append("marker").attr("id", s + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", s + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
871
+ }, "composition"), Ve = /* @__PURE__ */ d((e, t, s) => {
872
+ e.append("defs").append("marker").attr("id", s + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", s + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
873
+ }, "aggregation"), Ge = /* @__PURE__ */ d((e, t, s) => {
874
+ e.append("defs").append("marker").attr("id", s + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", s + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).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");
875
+ }, "dependency"), Ze = /* @__PURE__ */ d((e, t, s) => {
876
+ e.append("defs").append("marker").attr("id", s + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", s + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
877
+ }, "lollipop"), qe = /* @__PURE__ */ d((e, t, s) => {
878
+ e.append("marker").attr("id", s + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).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").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", s + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
879
+ }, "point"), Je = /* @__PURE__ */ d((e, t, s) => {
880
+ e.append("marker").attr("id", s + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", s + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
881
+ }, "circle"), Qe = /* @__PURE__ */ d((e, t, s) => {
882
+ e.append("marker").attr("id", s + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", s + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
883
+ }, "cross"), $e = /* @__PURE__ */ d((e, t, s) => {
884
+ e.append("defs").append("marker").attr("id", s + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
885
+ }, "barb"), tr = {
886
+ extension: Ue,
887
+ composition: je,
888
+ aggregation: Ve,
889
+ dependency: Ge,
890
+ lollipop: Ze,
891
+ point: qe,
892
+ circle: Je,
893
+ cross: Qe,
894
+ barb: $e
895
+ }, er = Xe, C = ((_b = (_a = R()) == null ? void 0 : _a.block) == null ? void 0 : _b.padding) ?? 8;
896
+ function Ut(e, t) {
897
+ if (e === 0 || !Number.isInteger(e))
898
+ throw new Error("Columns must be an integer !== 0.");
899
+ if (t < 0 || !Number.isInteger(t))
900
+ throw new Error("Position must be a non-negative integer." + t);
901
+ if (e < 0)
902
+ return { px: t, py: 0 };
903
+ if (e === 1)
904
+ return { px: 0, py: t };
905
+ const s = t % e, n = Math.floor(t / e);
906
+ return { px: s, py: n };
907
+ }
908
+ d(Ut, "calculateBlockPosition");
909
+ var rr = /* @__PURE__ */ d((e) => {
910
+ let t = 0, s = 0;
911
+ for (const n of e.children) {
912
+ const { width: i, height: r, x: a, y: l } = n.size ?? { width: 0, height: 0, x: 0, y: 0 };
913
+ L.debug(
914
+ "getMaxChildSize abc95 child:",
915
+ n.id,
916
+ "width:",
917
+ i,
918
+ "height:",
919
+ r,
920
+ "x:",
921
+ a,
922
+ "y:",
923
+ l,
924
+ n.type
925
+ ), n.type !== "space" && (i > t && (t = i / (e.widthInColumns ?? 1)), r > s && (s = r));
926
+ }
927
+ return { width: t, height: s };
928
+ }, "getMaxChildSize");
929
+ function ot(e, t, s = 0, n = 0) {
930
+ var _a2, _b2, _c, _d, _e2, _f, _g, _h, _i, _j, _k;
931
+ L.debug(
932
+ "setBlockSizes abc95 (start)",
933
+ e.id,
934
+ (_a2 = e == null ? void 0 : e.size) == null ? void 0 : _a2.x,
935
+ "block width =",
936
+ e == null ? void 0 : e.size,
937
+ "sieblingWidth",
938
+ s
939
+ ), ((_b2 = e == null ? void 0 : e.size) == null ? void 0 : _b2.width) || (e.size = {
940
+ width: s,
941
+ height: n,
942
+ x: 0,
943
+ y: 0
944
+ });
945
+ let i = 0, r = 0;
946
+ if (((_c = e.children) == null ? void 0 : _c.length) > 0) {
947
+ for (const b of e.children)
948
+ ot(b, t);
949
+ const a = rr(e);
950
+ i = a.width, r = a.height, L.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", i, r);
951
+ for (const b of e.children)
952
+ b.size && (L.debug(
953
+ `abc95 Setting size of children of ${e.id} id=${b.id} ${i} ${r} ${JSON.stringify(b.size)}`
954
+ ), b.size.width = i * (b.widthInColumns ?? 1) + C * ((b.widthInColumns ?? 1) - 1), b.size.height = r, b.size.x = 0, b.size.y = 0, L.debug(
955
+ `abc95 updating size of ${e.id} children child:${b.id} maxWidth:${i} maxHeight:${r}`
956
+ ));
957
+ for (const b of e.children)
958
+ ot(b, t, i, r);
959
+ const l = e.columns ?? -1;
960
+ let c = 0;
961
+ for (const b of e.children)
962
+ c += b.widthInColumns ?? 1;
963
+ let u = e.children.length;
964
+ l > 0 && l < c && (u = l);
965
+ const h = Math.ceil(c / u);
966
+ let x = u * (i + C) + C, w = h * (r + C) + C;
967
+ if (x < s) {
968
+ L.debug(
969
+ `Detected to small siebling: abc95 ${e.id} sieblingWidth ${s} sieblingHeight ${n} width ${x}`
970
+ ), x = s, w = n;
971
+ const b = (s - u * C - C) / u, S = (n - h * C - C) / h;
972
+ L.debug("Size indata abc88", e.id, "childWidth", b, "maxWidth", i), L.debug("Size indata abc88", e.id, "childHeight", S, "maxHeight", r), L.debug("Size indata abc88 xSize", u, "padding", C);
973
+ for (const E of e.children)
974
+ E.size && (E.size.width = b, E.size.height = S, E.size.x = 0, E.size.y = 0);
975
+ }
976
+ if (L.debug(
977
+ `abc95 (finale calc) ${e.id} xSize ${u} ySize ${h} columns ${l}${e.children.length} width=${Math.max(x, ((_d = e.size) == null ? void 0 : _d.width) || 0)}`
978
+ ), x < (((_e2 = e == null ? void 0 : e.size) == null ? void 0 : _e2.width) || 0)) {
979
+ x = ((_f = e == null ? void 0 : e.size) == null ? void 0 : _f.width) || 0;
980
+ const b = l > 0 ? Math.min(e.children.length, l) : e.children.length;
981
+ if (b > 0) {
982
+ const S = (x - b * C - C) / b;
983
+ L.debug("abc95 (growing to fit) width", e.id, x, (_g = e.size) == null ? void 0 : _g.width, S);
984
+ for (const E of e.children)
985
+ E.size && (E.size.width = S);
986
+ }
987
+ }
988
+ e.size = {
989
+ width: x,
990
+ height: w,
991
+ x: 0,
992
+ y: 0
993
+ };
994
+ }
995
+ L.debug(
996
+ "setBlockSizes abc94 (done)",
997
+ e.id,
998
+ (_h = e == null ? void 0 : e.size) == null ? void 0 : _h.x,
999
+ (_i = e == null ? void 0 : e.size) == null ? void 0 : _i.width,
1000
+ (_j = e == null ? void 0 : e.size) == null ? void 0 : _j.y,
1001
+ (_k = e == null ? void 0 : e.size) == null ? void 0 : _k.height
1002
+ );
1003
+ }
1004
+ d(ot, "setBlockSizes");
1005
+ function vt(e, t) {
1006
+ var _a2, _b2, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
1007
+ L.debug(
1008
+ `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(_a2 = e == null ? void 0 : e.size) == null ? void 0 : _a2.x} y: ${(_b2 = e == null ? void 0 : e.size) == null ? void 0 : _b2.y} width: ${(_c = e == null ? void 0 : e.size) == null ? void 0 : _c.width}`
1009
+ );
1010
+ const s = e.columns ?? -1;
1011
+ if (L.debug("layoutBlocks columns abc95", e.id, "=>", s, e), e.children && // find max width of children
1012
+ e.children.length > 0) {
1013
+ const n = ((_e2 = (_d = e == null ? void 0 : e.children[0]) == null ? void 0 : _d.size) == null ? void 0 : _e2.width) ?? 0, i = e.children.length * n + (e.children.length - 1) * C;
1014
+ L.debug("widthOfChildren 88", i, "posX");
1015
+ let r = 0;
1016
+ L.debug("abc91 block?.size?.x", e.id, (_f = e == null ? void 0 : e.size) == null ? void 0 : _f.x);
1017
+ let a = ((_g = e == null ? void 0 : e.size) == null ? void 0 : _g.x) ? ((_h = e == null ? void 0 : e.size) == null ? void 0 : _h.x) + (-((_i = e == null ? void 0 : e.size) == null ? void 0 : _i.width) / 2 || 0) : -C, l = 0;
1018
+ for (const c of e.children) {
1019
+ const u = e;
1020
+ if (!c.size)
1021
+ continue;
1022
+ const { width: h, height: x } = c.size, { px: w, py: b } = Ut(s, r);
1023
+ if (b != l && (l = b, a = ((_j = e == null ? void 0 : e.size) == null ? void 0 : _j.x) ? ((_k = e == null ? void 0 : e.size) == null ? void 0 : _k.x) + (-((_l = e == null ? void 0 : e.size) == null ? void 0 : _l.width) / 2 || 0) : -C, L.debug("New row in layout for block", e.id, " and child ", c.id, l)), L.debug(
1024
+ `abc89 layout blocks (child) id: ${c.id} Pos: ${r} (px, py) ${w},${b} (${(_m = u == null ? void 0 : u.size) == null ? void 0 : _m.x},${(_n = u == null ? void 0 : u.size) == null ? void 0 : _n.y}) parent: ${u.id} width: ${h}${C}`
1025
+ ), u.size) {
1026
+ const S = h / 2;
1027
+ c.size.x = a + C + S, L.debug(
1028
+ `abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${a} new startingPosX${c.size.x} ${S} padding=${C} width=${h} halfWidth=${S} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${h * ((c == null ? void 0 : c.widthInColumns) ?? 1) / 2}`
1029
+ ), a = c.size.x + S, c.size.y = u.size.y - u.size.height / 2 + b * (x + C) + x / 2 + C, L.debug(
1030
+ `abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${a}${C}${S}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${h * ((c == null ? void 0 : c.widthInColumns) ?? 1) / 2}`
1031
+ );
1032
+ }
1033
+ c.children && vt(c), r += (c == null ? void 0 : c.widthInColumns) ?? 1, L.debug("abc88 columnsPos", c, r);
1034
+ }
1035
+ }
1036
+ L.debug(
1037
+ `layout blocks (<==layoutBlocks) ${e.id} x: ${(_o = e == null ? void 0 : e.size) == null ? void 0 : _o.x} y: ${(_p = e == null ? void 0 : e.size) == null ? void 0 : _p.y} width: ${(_q = e == null ? void 0 : e.size) == null ? void 0 : _q.width}`
1038
+ );
1039
+ }
1040
+ d(vt, "layoutBlocks");
1041
+ function Et(e, { minX: t, minY: s, maxX: n, maxY: i } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1042
+ if (e.size && e.id !== "root") {
1043
+ const { x: r, y: a, width: l, height: c } = e.size;
1044
+ r - l / 2 < t && (t = r - l / 2), a - c / 2 < s && (s = a - c / 2), r + l / 2 > n && (n = r + l / 2), a + c / 2 > i && (i = a + c / 2);
1045
+ }
1046
+ if (e.children)
1047
+ for (const r of e.children)
1048
+ ({ minX: t, minY: s, maxX: n, maxY: i } = Et(r, { minX: t, minY: s, maxX: n, maxY: i }));
1049
+ return { minX: t, minY: s, maxX: n, maxY: i };
1050
+ }
1051
+ d(Et, "findBounds");
1052
+ function jt(e) {
1053
+ const t = e.getBlock("root");
1054
+ if (!t)
1055
+ return;
1056
+ ot(t, e, 0, 0), vt(t), L.debug("getBlocks", JSON.stringify(t, null, 2));
1057
+ const { minX: s, minY: n, maxX: i, maxY: r } = Et(t), a = r - n, l = i - s;
1058
+ return { x: s, y: n, width: l, height: a };
1059
+ }
1060
+ d(jt, "layout");
1061
+ function wt(e, t) {
1062
+ t && e.attr("style", t);
1063
+ }
1064
+ d(wt, "applyStyle");
1065
+ function Vt(e) {
1066
+ const t = O(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), s = t.append("xhtml:div"), n = e.label, i = e.isNode ? "nodeLabel" : "edgeLabel", r = s.append("span");
1067
+ return r.html(n), wt(r, e.labelStyle), r.attr("class", i), wt(s, e.labelStyle), s.style("display", "inline-block"), s.style("white-space", "nowrap"), s.attr("xmlns", "http://www.w3.org/1999/xhtml"), t.node();
1068
+ }
1069
+ d(Vt, "addHtmlLabel");
1070
+ var ar = /* @__PURE__ */ d((e, t, s, n) => {
1071
+ let i = e || "";
1072
+ if (typeof i == "object" && (i = i[0]), j(R().flowchart.htmlLabels)) {
1073
+ i = i.replace(/\\n|\n/g, "<br />"), L.debug("vertexText" + i);
1074
+ const r = {
1075
+ isNode: n,
1076
+ label: fe(xt(i)),
1077
+ labelStyle: t.replace("fill:", "color:")
1078
+ };
1079
+ return Vt(r);
1080
+ } else {
1081
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
1082
+ r.setAttribute("style", t.replace("color:", "fill:"));
1083
+ let a = [];
1084
+ typeof i == "string" ? a = i.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(i) ? a = i : a = [];
1085
+ for (const l of a) {
1086
+ const c = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
1087
+ c.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), c.setAttribute("dy", "1em"), c.setAttribute("x", "0"), s ? c.setAttribute("class", "title-row") : c.setAttribute("class", "row"), c.textContent = l.trim(), r.appendChild(c);
1088
+ }
1089
+ return r;
1090
+ }
1091
+ }, "createLabel"), K = ar, sr = /* @__PURE__ */ d((e, t, s, n, i) => {
1092
+ t.arrowTypeStart && Ot(e, "start", t.arrowTypeStart, s, n, i), t.arrowTypeEnd && Ot(e, "end", t.arrowTypeEnd, s, n, i);
1093
+ }, "addEdgeMarkers"), ir = {
1094
+ arrow_cross: "cross",
1095
+ arrow_point: "point",
1096
+ arrow_barb: "barb",
1097
+ arrow_circle: "circle",
1098
+ aggregation: "aggregation",
1099
+ extension: "extension",
1100
+ composition: "composition",
1101
+ dependency: "dependency",
1102
+ lollipop: "lollipop"
1103
+ }, Ot = /* @__PURE__ */ d((e, t, s, n, i, r) => {
1104
+ const a = ir[s];
1105
+ if (!a) {
1106
+ L.warn(`Unknown arrow type: ${s}`);
1107
+ return;
1108
+ }
1109
+ const l = t === "start" ? "Start" : "End";
1110
+ e.attr(`marker-${t}`, `url(${n}#${i}_${r}-${a}${l})`);
1111
+ }, "addEdgeMarker"), mt = {}, M = {}, nr = /* @__PURE__ */ d((e, t) => {
1112
+ const s = R(), n = j(s.flowchart.htmlLabels), i = t.labelType === "markdown" ? Wt(
1113
+ e,
1114
+ t.label,
1115
+ {
1116
+ style: t.labelStyle,
1117
+ useHtmlLabels: n,
1118
+ addSvgBackground: true
1119
+ },
1120
+ s
1121
+ ) : K(t.label, t.labelStyle), r = e.insert("g").attr("class", "edgeLabel"), a = r.insert("g").attr("class", "label");
1122
+ a.node().appendChild(i);
1123
+ let l = i.getBBox();
1124
+ if (n) {
1125
+ const u = i.children[0], h = O(i);
1126
+ l = u.getBoundingClientRect(), h.attr("width", l.width), h.attr("height", l.height);
1127
+ }
1128
+ a.attr("transform", "translate(" + -l.width / 2 + ", " + -l.height / 2 + ")"), mt[t.id] = r, t.width = l.width, t.height = l.height;
1129
+ let c;
1130
+ if (t.startLabelLeft) {
1131
+ const u = K(t.startLabelLeft, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), x = h.insert("g").attr("class", "inner");
1132
+ c = x.node().appendChild(u);
1133
+ const w = u.getBBox();
1134
+ x.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), M[t.id] || (M[t.id] = {}), M[t.id].startLeft = h, tt(c, t.startLabelLeft);
1135
+ }
1136
+ if (t.startLabelRight) {
1137
+ const u = K(t.startLabelRight, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), x = h.insert("g").attr("class", "inner");
1138
+ c = h.node().appendChild(u), x.node().appendChild(u);
1139
+ const w = u.getBBox();
1140
+ x.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), M[t.id] || (M[t.id] = {}), M[t.id].startRight = h, tt(c, t.startLabelRight);
1141
+ }
1142
+ if (t.endLabelLeft) {
1143
+ const u = K(t.endLabelLeft, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), x = h.insert("g").attr("class", "inner");
1144
+ c = x.node().appendChild(u);
1145
+ const w = u.getBBox();
1146
+ x.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), h.node().appendChild(u), M[t.id] || (M[t.id] = {}), M[t.id].endLeft = h, tt(c, t.endLabelLeft);
1147
+ }
1148
+ if (t.endLabelRight) {
1149
+ const u = K(t.endLabelRight, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), x = h.insert("g").attr("class", "inner");
1150
+ c = x.node().appendChild(u);
1151
+ const w = u.getBBox();
1152
+ x.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), h.node().appendChild(u), M[t.id] || (M[t.id] = {}), M[t.id].endRight = h, tt(c, t.endLabelRight);
1153
+ }
1154
+ return i;
1155
+ }, "insertEdgeLabel");
1156
+ function tt(e, t) {
1157
+ R().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1158
+ }
1159
+ d(tt, "setTerminalWidth");
1160
+ var lr = /* @__PURE__ */ d((e, t) => {
1161
+ L.debug("Moving label abc88 ", e.id, e.label, mt[e.id], t);
1162
+ let s = t.updatedPath ? t.updatedPath : t.originalPath;
1163
+ const n = R(), { subGraphTitleTotalMargin: i } = ue(n);
1164
+ if (e.label) {
1165
+ const r = mt[e.id];
1166
+ let a = e.x, l = e.y;
1167
+ if (s) {
1168
+ const c = $.calcLabelPosition(s);
1169
+ L.debug(
1170
+ "Moving label " + e.label + " from (",
1171
+ a,
1172
+ ",",
1173
+ l,
1174
+ ") to (",
1175
+ c.x,
1176
+ ",",
1177
+ c.y,
1178
+ ") abc88"
1179
+ ), t.updatedPath && (a = c.x, l = c.y);
1180
+ }
1181
+ r.attr("transform", `translate(${a}, ${l + i / 2})`);
1182
+ }
1183
+ if (e.startLabelLeft) {
1184
+ const r = M[e.id].startLeft;
1185
+ let a = e.x, l = e.y;
1186
+ if (s) {
1187
+ const c = $.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", s);
1188
+ a = c.x, l = c.y;
1189
+ }
1190
+ r.attr("transform", `translate(${a}, ${l})`);
1191
+ }
1192
+ if (e.startLabelRight) {
1193
+ const r = M[e.id].startRight;
1194
+ let a = e.x, l = e.y;
1195
+ if (s) {
1196
+ const c = $.calcTerminalLabelPosition(
1197
+ e.arrowTypeStart ? 10 : 0,
1198
+ "start_right",
1199
+ s
1200
+ );
1201
+ a = c.x, l = c.y;
1202
+ }
1203
+ r.attr("transform", `translate(${a}, ${l})`);
1204
+ }
1205
+ if (e.endLabelLeft) {
1206
+ const r = M[e.id].endLeft;
1207
+ let a = e.x, l = e.y;
1208
+ if (s) {
1209
+ const c = $.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", s);
1210
+ a = c.x, l = c.y;
1211
+ }
1212
+ r.attr("transform", `translate(${a}, ${l})`);
1213
+ }
1214
+ if (e.endLabelRight) {
1215
+ const r = M[e.id].endRight;
1216
+ let a = e.x, l = e.y;
1217
+ if (s) {
1218
+ const c = $.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", s);
1219
+ a = c.x, l = c.y;
1220
+ }
1221
+ r.attr("transform", `translate(${a}, ${l})`);
1222
+ }
1223
+ }, "positionEdgeLabel"), cr = /* @__PURE__ */ d((e, t) => {
1224
+ const s = e.x, n = e.y, i = Math.abs(t.x - s), r = Math.abs(t.y - n), a = e.width / 2, l = e.height / 2;
1225
+ return i >= a || r >= l;
1226
+ }, "outsideNode"), or = /* @__PURE__ */ d((e, t, s) => {
1227
+ L.debug(`intersection calc abc89:
1228
+ outsidePoint: ${JSON.stringify(t)}
1229
+ insidePoint : ${JSON.stringify(s)}
1230
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1231
+ const n = e.x, i = e.y, r = Math.abs(n - s.x), a = e.width / 2;
1232
+ let l = s.x < t.x ? a - r : a + r;
1233
+ const c = e.height / 2, u = Math.abs(t.y - s.y), h = Math.abs(t.x - s.x);
1234
+ if (Math.abs(i - t.y) * a > Math.abs(n - t.x) * c) {
1235
+ let x = s.y < t.y ? t.y - c - i : i - c - t.y;
1236
+ l = h * x / u;
1237
+ const w = {
1238
+ x: s.x < t.x ? s.x + l : s.x - h + l,
1239
+ y: s.y < t.y ? s.y + u - x : s.y - u + x
1240
+ };
1241
+ return l === 0 && (w.x = t.x, w.y = t.y), h === 0 && (w.x = t.x), u === 0 && (w.y = t.y), L.debug(`abc89 topp/bott calc, Q ${u}, q ${x}, R ${h}, r ${l}`, w), w;
1242
+ } else {
1243
+ s.x < t.x ? l = t.x - a - n : l = n - a - t.x;
1244
+ let x = u * l / h, w = s.x < t.x ? s.x + h - l : s.x - h + l, b = s.y < t.y ? s.y + x : s.y - x;
1245
+ return L.debug(`sides calc abc89, Q ${u}, q ${x}, R ${h}, r ${l}`, { _x: w, _y: b }), l === 0 && (w = t.x, b = t.y), h === 0 && (w = t.x), u === 0 && (b = t.y), { x: w, y: b };
1246
+ }
1247
+ }, "intersection"), Rt = /* @__PURE__ */ d((e, t) => {
1248
+ L.debug("abc88 cutPathAtIntersect", e, t);
1249
+ let s = [], n = e[0], i = false;
1250
+ return e.forEach((r) => {
1251
+ if (!cr(t, r) && !i) {
1252
+ const a = or(t, n, r);
1253
+ let l = false;
1254
+ s.forEach((c) => {
1255
+ l = l || c.x === a.x && c.y === a.y;
1256
+ }), s.some((c) => c.x === a.x && c.y === a.y) || s.push(a), i = true;
1257
+ } else
1258
+ n = r, i || s.push(r);
1259
+ }), s;
1260
+ }, "cutPathAtIntersect"), hr = /* @__PURE__ */ d(function(e, t, s, n, i, r, a) {
1261
+ let l = s.points;
1262
+ L.debug("abc88 InsertEdge: edge=", s, "e=", t);
1263
+ let c = false;
1264
+ const u = r.node(t.v);
1265
+ var h = r.node(t.w);
1266
+ (h == null ? void 0 : h.intersect) && (u == null ? void 0 : u.intersect) && (l = l.slice(1, s.points.length - 1), l.unshift(u.intersect(l[0])), l.push(h.intersect(l[l.length - 1]))), s.toCluster && (L.debug("to cluster abc88", n[s.toCluster]), l = Rt(s.points, n[s.toCluster].node), c = true), s.fromCluster && (L.debug("from cluster abc88", n[s.fromCluster]), l = Rt(l.reverse(), n[s.fromCluster].node).reverse(), c = true);
1267
+ const x = l.filter((y) => !Number.isNaN(y.y));
1268
+ let w = Le;
1269
+ s.curve && (i === "graph" || i === "flowchart") && (w = s.curve);
1270
+ const { x: b, y: S } = ge(s), E = me().x(b).y(S).curve(w);
1271
+ let k;
1272
+ switch (s.thickness) {
1273
+ case "normal":
1274
+ k = "edge-thickness-normal";
1275
+ break;
1276
+ case "thick":
1277
+ k = "edge-thickness-thick";
1278
+ break;
1279
+ case "invisible":
1280
+ k = "edge-thickness-thick";
1281
+ break;
1282
+ default:
1283
+ k = "";
1284
+ }
1285
+ switch (s.pattern) {
1286
+ case "solid":
1287
+ k += " edge-pattern-solid";
1288
+ break;
1289
+ case "dotted":
1290
+ k += " edge-pattern-dotted";
1291
+ break;
1292
+ case "dashed":
1293
+ k += " edge-pattern-dashed";
1294
+ break;
1295
+ }
1296
+ const B = e.append("path").attr("d", E(x)).attr("id", s.id).attr("class", " " + k + (s.classes ? " " + s.classes : "")).attr("style", s.style);
1297
+ let _ = "";
1298
+ (R().flowchart.arrowMarkerAbsolute || R().state.arrowMarkerAbsolute) && (_ = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, _ = _.replace(/\(/g, "\\("), _ = _.replace(/\)/g, "\\)")), sr(B, s, _, a, i);
1299
+ let D = {};
1300
+ return c && (D.updatedPath = l), D.originalPath = s.points, D;
1301
+ }, "insertEdge"), dr = /* @__PURE__ */ d((e) => {
1302
+ const t = /* @__PURE__ */ new Set();
1303
+ for (const s of e)
1304
+ switch (s) {
1305
+ case "x":
1306
+ t.add("right"), t.add("left");
1307
+ break;
1308
+ case "y":
1309
+ t.add("up"), t.add("down");
1310
+ break;
1311
+ default:
1312
+ t.add(s);
1313
+ break;
1314
+ }
1315
+ return t;
1316
+ }, "expandAndDeduplicateDirections"), gr = /* @__PURE__ */ d((e, t, s) => {
1317
+ const n = dr(e), i = 2, r = t.height + 2 * s.padding, a = r / i, l = t.width + 2 * a + s.padding, c = s.padding / 2;
1318
+ return n.has("right") && n.has("left") && n.has("up") && n.has("down") ? [
1319
+ // Bottom
1320
+ { x: 0, y: 0 },
1321
+ { x: a, y: 0 },
1322
+ { x: l / 2, y: 2 * c },
1323
+ { x: l - a, y: 0 },
1324
+ { x: l, y: 0 },
1325
+ // Right
1326
+ { x: l, y: -r / 3 },
1327
+ { x: l + 2 * c, y: -r / 2 },
1328
+ { x: l, y: -2 * r / 3 },
1329
+ { x: l, y: -r },
1330
+ // Top
1331
+ { x: l - a, y: -r },
1332
+ { x: l / 2, y: -r - 2 * c },
1333
+ { x: a, y: -r },
1334
+ // Left
1335
+ { x: 0, y: -r },
1336
+ { x: 0, y: -2 * r / 3 },
1337
+ { x: -2 * c, y: -r / 2 },
1338
+ { x: 0, y: -r / 3 }
1339
+ ] : n.has("right") && n.has("left") && n.has("up") ? [
1340
+ { x: a, y: 0 },
1341
+ { x: l - a, y: 0 },
1342
+ { x: l, y: -r / 2 },
1343
+ { x: l - a, y: -r },
1344
+ { x: a, y: -r },
1345
+ { x: 0, y: -r / 2 }
1346
+ ] : n.has("right") && n.has("left") && n.has("down") ? [
1347
+ { x: 0, y: 0 },
1348
+ { x: a, y: -r },
1349
+ { x: l - a, y: -r },
1350
+ { x: l, y: 0 }
1351
+ ] : n.has("right") && n.has("up") && n.has("down") ? [
1352
+ { x: 0, y: 0 },
1353
+ { x: l, y: -a },
1354
+ { x: l, y: -r + a },
1355
+ { x: 0, y: -r }
1356
+ ] : n.has("left") && n.has("up") && n.has("down") ? [
1357
+ { x: l, y: 0 },
1358
+ { x: 0, y: -a },
1359
+ { x: 0, y: -r + a },
1360
+ { x: l, y: -r }
1361
+ ] : n.has("right") && n.has("left") ? [
1362
+ { x: a, y: 0 },
1363
+ { x: a, y: -c },
1364
+ { x: l - a, y: -c },
1365
+ { x: l - a, y: 0 },
1366
+ { x: l, y: -r / 2 },
1367
+ { x: l - a, y: -r },
1368
+ { x: l - a, y: -r + c },
1369
+ { x: a, y: -r + c },
1370
+ { x: a, y: -r },
1371
+ { x: 0, y: -r / 2 }
1372
+ ] : n.has("up") && n.has("down") ? [
1373
+ // Bottom center
1374
+ { x: l / 2, y: 0 },
1375
+ // Left pont of bottom arrow
1376
+ { x: 0, y: -c },
1377
+ { x: a, y: -c },
1378
+ // Left top over vertical section
1379
+ { x: a, y: -r + c },
1380
+ { x: 0, y: -r + c },
1381
+ // Top of arrow
1382
+ { x: l / 2, y: -r },
1383
+ { x: l, y: -r + c },
1384
+ // Top of right vertical bar
1385
+ { x: l - a, y: -r + c },
1386
+ { x: l - a, y: -c },
1387
+ { x: l, y: -c }
1388
+ ] : n.has("right") && n.has("up") ? [
1389
+ { x: 0, y: 0 },
1390
+ { x: l, y: -a },
1391
+ { x: 0, y: -r }
1392
+ ] : n.has("right") && n.has("down") ? [
1393
+ { x: 0, y: 0 },
1394
+ { x: l, y: 0 },
1395
+ { x: 0, y: -r }
1396
+ ] : n.has("left") && n.has("up") ? [
1397
+ { x: l, y: 0 },
1398
+ { x: 0, y: -a },
1399
+ { x: l, y: -r }
1400
+ ] : n.has("left") && n.has("down") ? [
1401
+ { x: l, y: 0 },
1402
+ { x: 0, y: 0 },
1403
+ { x: l, y: -r }
1404
+ ] : n.has("right") ? [
1405
+ { x: a, y: -c },
1406
+ { x: a, y: -c },
1407
+ { x: l - a, y: -c },
1408
+ { x: l - a, y: 0 },
1409
+ { x: l, y: -r / 2 },
1410
+ { x: l - a, y: -r },
1411
+ { x: l - a, y: -r + c },
1412
+ // top left corner of arrow
1413
+ { x: a, y: -r + c },
1414
+ { x: a, y: -r + c }
1415
+ ] : n.has("left") ? [
1416
+ { x: a, y: 0 },
1417
+ { x: a, y: -c },
1418
+ // Two points, the right corners
1419
+ { x: l - a, y: -c },
1420
+ { x: l - a, y: -r + c },
1421
+ { x: a, y: -r + c },
1422
+ { x: a, y: -r },
1423
+ { x: 0, y: -r / 2 }
1424
+ ] : n.has("up") ? [
1425
+ // Bottom center
1426
+ { x: a, y: -c },
1427
+ // Left top over vertical section
1428
+ { x: a, y: -r + c },
1429
+ { x: 0, y: -r + c },
1430
+ // Top of arrow
1431
+ { x: l / 2, y: -r },
1432
+ { x: l, y: -r + c },
1433
+ // Top of right vertical bar
1434
+ { x: l - a, y: -r + c },
1435
+ { x: l - a, y: -c }
1436
+ ] : n.has("down") ? [
1437
+ // Bottom center
1438
+ { x: l / 2, y: 0 },
1439
+ // Left pont of bottom arrow
1440
+ { x: 0, y: -c },
1441
+ { x: a, y: -c },
1442
+ // Left top over vertical section
1443
+ { x: a, y: -r + c },
1444
+ { x: l - a, y: -r + c },
1445
+ { x: l - a, y: -c },
1446
+ { x: l, y: -c }
1447
+ ] : [{ x: 0, y: 0 }];
1448
+ }, "getArrowPoints");
1449
+ function Gt(e, t) {
1450
+ return e.intersect(t);
1451
+ }
1452
+ d(Gt, "intersectNode");
1453
+ var ur = Gt;
1454
+ function Zt(e, t, s, n) {
1455
+ var i = e.x, r = e.y, a = i - n.x, l = r - n.y, c = Math.sqrt(t * t * l * l + s * s * a * a), u = Math.abs(t * s * a / c);
1456
+ n.x < i && (u = -u);
1457
+ var h = Math.abs(t * s * l / c);
1458
+ return n.y < r && (h = -h), { x: i + u, y: r + h };
1459
+ }
1460
+ d(Zt, "intersectEllipse");
1461
+ var qt = Zt;
1462
+ function Jt(e, t, s) {
1463
+ return qt(e, t, t, s);
1464
+ }
1465
+ d(Jt, "intersectCircle");
1466
+ var pr = Jt;
1467
+ function Qt(e, t, s, n) {
1468
+ var i, r, a, l, c, u, h, x, w, b, S, E, k, B, _;
1469
+ if (i = t.y - e.y, a = e.x - t.x, c = t.x * e.y - e.x * t.y, w = i * s.x + a * s.y + c, b = i * n.x + a * n.y + c, !(w !== 0 && b !== 0 && Lt(w, b)) && (r = n.y - s.y, l = s.x - n.x, u = n.x * s.y - s.x * n.y, h = r * e.x + l * e.y + u, x = r * t.x + l * t.y + u, !(h !== 0 && x !== 0 && Lt(h, x)) && (S = i * l - r * a, S !== 0)))
1470
+ return E = Math.abs(S / 2), k = a * u - l * c, B = k < 0 ? (k - E) / S : (k + E) / S, k = r * c - i * u, _ = k < 0 ? (k - E) / S : (k + E) / S, { x: B, y: _ };
1471
+ }
1472
+ d(Qt, "intersectLine");
1473
+ function Lt(e, t) {
1474
+ return e * t > 0;
1475
+ }
1476
+ d(Lt, "sameSign");
1477
+ var fr = Qt, xr = $t;
1478
+ function $t(e, t, s) {
1479
+ var n = e.x, i = e.y, r = [], a = Number.POSITIVE_INFINITY, l = Number.POSITIVE_INFINITY;
1480
+ typeof t.forEach == "function" ? t.forEach(function(S) {
1481
+ a = Math.min(a, S.x), l = Math.min(l, S.y);
1482
+ }) : (a = Math.min(a, t.x), l = Math.min(l, t.y));
1483
+ for (var c = n - e.width / 2 - a, u = i - e.height / 2 - l, h = 0; h < t.length; h++) {
1484
+ var x = t[h], w = t[h < t.length - 1 ? h + 1 : 0], b = fr(
1485
+ e,
1486
+ s,
1487
+ { x: c + x.x, y: u + x.y },
1488
+ { x: c + w.x, y: u + w.y }
1489
+ );
1490
+ b && r.push(b);
1491
+ }
1492
+ return r.length ? (r.length > 1 && r.sort(function(S, E) {
1493
+ var k = S.x - s.x, B = S.y - s.y, _ = Math.sqrt(k * k + B * B), D = E.x - s.x, y = E.y - s.y, g = Math.sqrt(D * D + y * y);
1494
+ return _ < g ? -1 : _ === g ? 0 : 1;
1495
+ }), r[0]) : e;
1496
+ }
1497
+ d($t, "intersectPolygon");
1498
+ var yr = /* @__PURE__ */ d((e, t) => {
1499
+ var s = e.x, n = e.y, i = t.x - s, r = t.y - n, a = e.width / 2, l = e.height / 2, c, u;
1500
+ return Math.abs(r) * a > Math.abs(i) * l ? (r < 0 && (l = -l), c = r === 0 ? 0 : l * i / r, u = l) : (i < 0 && (a = -a), c = a, u = i === 0 ? 0 : a * r / i), { x: s + c, y: n + u };
1501
+ }, "intersectRect"), br = yr, N = {
1502
+ node: ur,
1503
+ circle: pr,
1504
+ ellipse: qt,
1505
+ polygon: xr,
1506
+ rect: br
1507
+ }, A = /* @__PURE__ */ d(async (e, t, s, n) => {
1508
+ const i = R();
1509
+ let r;
1510
+ const a = t.useHtmlLabels || j(i.flowchart.htmlLabels);
1511
+ s ? r = s : r = "node default";
1512
+ const l = e.insert("g").attr("class", r).attr("id", t.domId || t.id), c = l.insert("g").attr("class", "label").attr("style", t.labelStyle);
1513
+ let u;
1514
+ t.labelText === void 0 ? u = "" : u = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
1515
+ const h = c.node();
1516
+ let x;
1517
+ t.labelType === "markdown" ? x = Wt(
1518
+ c,
1519
+ Tt(xt(u), i),
1520
+ {
1521
+ useHtmlLabels: a,
1522
+ width: t.width || i.flowchart.wrappingWidth,
1523
+ classes: "markdown-node-label"
1524
+ },
1525
+ i
1526
+ ) : x = h.appendChild(
1527
+ K(Tt(xt(u), i), t.labelStyle, false, n)
1528
+ );
1529
+ let w = x.getBBox();
1530
+ const b = t.padding / 2;
1531
+ if (j(i.flowchart.htmlLabels)) {
1532
+ const S = x.children[0], E = O(x), k = S.getElementsByTagName("img");
1533
+ if (k) {
1534
+ const B = u.replace(/<img[^>]*>/g, "").trim() === "";
1535
+ await Promise.all(
1536
+ [...k].map(
1537
+ (_) => new Promise((D) => {
1538
+ function y() {
1539
+ if (_.style.display = "flex", _.style.flexDirection = "column", B) {
1540
+ const g = i.fontSize ? i.fontSize : window.getComputedStyle(document.body).fontSize, m = parseInt(g, 10) * 5 + "px";
1541
+ _.style.minWidth = m, _.style.maxWidth = m;
1542
+ } else
1543
+ _.style.width = "100%";
1544
+ D(_);
1545
+ }
1546
+ d(y, "setupImage"), setTimeout(() => {
1547
+ _.complete && y();
1548
+ }), _.addEventListener("error", y), _.addEventListener("load", y);
1549
+ })
1550
+ )
1551
+ );
1552
+ }
1553
+ w = S.getBoundingClientRect(), E.attr("width", w.width), E.attr("height", w.height);
1554
+ }
1555
+ return a ? c.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")") : c.attr("transform", "translate(0, " + -w.height / 2 + ")"), t.centerLabel && c.attr("transform", "translate(" + -w.width / 2 + ", " + -w.height / 2 + ")"), c.insert("rect", ":first-child"), { shapeSvg: l, bbox: w, halfPadding: b, label: c };
1556
+ }, "labelHelper"), T = /* @__PURE__ */ d((e, t) => {
1557
+ const s = t.node().getBBox();
1558
+ e.width = s.width, e.height = s.height;
1559
+ }, "updateNodeBounds");
1560
+ function U(e, t, s, n) {
1561
+ return e.insert("polygon", ":first-child").attr(
1562
+ "points",
1563
+ n.map(function(i) {
1564
+ return i.x + "," + i.y;
1565
+ }).join(" ")
1566
+ ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + s / 2 + ")");
1567
+ }
1568
+ d(U, "insertPolygonShape");
1569
+ var wr = /* @__PURE__ */ d(async (e, t) => {
1570
+ t.useHtmlLabels || R().flowchart.htmlLabels || (t.centerLabel = true);
1571
+ const { shapeSvg: n, bbox: i, halfPadding: r } = await A(
1572
+ e,
1573
+ t,
1574
+ "node " + t.classes,
1575
+ true
1576
+ );
1577
+ L.info("Classes = ", t.classes);
1578
+ const a = n.insert("rect", ":first-child");
1579
+ return a.attr("rx", t.rx).attr("ry", t.ry).attr("x", -i.width / 2 - r).attr("y", -i.height / 2 - r).attr("width", i.width + t.padding).attr("height", i.height + t.padding), T(t, a), t.intersect = function(l) {
1580
+ return N.rect(t, l);
1581
+ }, n;
1582
+ }, "note"), mr = wr, zt = /* @__PURE__ */ d((e) => e ? " " + e : "", "formatClass"), Y = /* @__PURE__ */ d((e, t) => `${t || "node default"}${zt(e.classes)} ${zt(
1583
+ e.class
1584
+ )}`, "getClassesFromNode"), At = /* @__PURE__ */ d(async (e, t) => {
1585
+ const { shapeSvg: s, bbox: n } = await A(
1586
+ e,
1587
+ t,
1588
+ Y(t, void 0),
1589
+ true
1590
+ ), i = n.width + t.padding, r = n.height + t.padding, a = i + r, l = [
1591
+ { x: a / 2, y: 0 },
1592
+ { x: a, y: -a / 2 },
1593
+ { x: a / 2, y: -a },
1594
+ { x: 0, y: -a / 2 }
1595
+ ];
1596
+ L.info("Question main (Circle)");
1597
+ const c = U(s, a, a, l);
1598
+ return c.attr("style", t.style), T(t, c), t.intersect = function(u) {
1599
+ return L.warn("Intersect called"), N.polygon(t, l, u);
1600
+ }, s;
1601
+ }, "question"), Lr = /* @__PURE__ */ d((e, t) => {
1602
+ const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = 28, i = [
1603
+ { x: 0, y: n / 2 },
1604
+ { x: n / 2, y: 0 },
1605
+ { x: 0, y: -28 / 2 },
1606
+ { x: -28 / 2, y: 0 }
1607
+ ];
1608
+ return s.insert("polygon", ":first-child").attr(
1609
+ "points",
1610
+ i.map(function(a) {
1611
+ return a.x + "," + a.y;
1612
+ }).join(" ")
1613
+ ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(a) {
1614
+ return N.circle(t, 14, a);
1615
+ }, s;
1616
+ }, "choice"), Sr = /* @__PURE__ */ d(async (e, t) => {
1617
+ const { shapeSvg: s, bbox: n } = await A(
1618
+ e,
1619
+ t,
1620
+ Y(t, void 0),
1621
+ true
1622
+ ), i = 4, r = n.height + t.padding, a = r / i, l = n.width + 2 * a + t.padding, c = [
1623
+ { x: a, y: 0 },
1624
+ { x: l - a, y: 0 },
1625
+ { x: l, y: -r / 2 },
1626
+ { x: l - a, y: -r },
1627
+ { x: a, y: -r },
1628
+ { x: 0, y: -r / 2 }
1629
+ ], u = U(s, l, r, c);
1630
+ return u.attr("style", t.style), T(t, u), t.intersect = function(h) {
1631
+ return N.polygon(t, c, h);
1632
+ }, s;
1633
+ }, "hexagon"), kr = /* @__PURE__ */ d(async (e, t) => {
1634
+ const { shapeSvg: s, bbox: n } = await A(e, t, void 0, true), i = 2, r = n.height + 2 * t.padding, a = r / i, l = n.width + 2 * a + t.padding, c = gr(t.directions, n, t), u = U(s, l, r, c);
1635
+ return u.attr("style", t.style), T(t, u), t.intersect = function(h) {
1636
+ return N.polygon(t, c, h);
1637
+ }, s;
1638
+ }, "block_arrow"), vr = /* @__PURE__ */ d(async (e, t) => {
1639
+ const { shapeSvg: s, bbox: n } = await A(
1640
+ e,
1641
+ t,
1642
+ Y(t, void 0),
1643
+ true
1644
+ ), i = n.width + t.padding, r = n.height + t.padding, a = [
1645
+ { x: -r / 2, y: 0 },
1646
+ { x: i, y: 0 },
1647
+ { x: i, y: -r },
1648
+ { x: -r / 2, y: -r },
1649
+ { x: 0, y: -r / 2 }
1650
+ ];
1651
+ return U(s, i, r, a).attr("style", t.style), t.width = i + r, t.height = r, t.intersect = function(c) {
1652
+ return N.polygon(t, a, c);
1653
+ }, s;
1654
+ }, "rect_left_inv_arrow"), Er = /* @__PURE__ */ d(async (e, t) => {
1655
+ const { shapeSvg: s, bbox: n } = await A(e, t, Y(t), true), i = n.width + t.padding, r = n.height + t.padding, a = [
1656
+ { x: -2 * r / 6, y: 0 },
1657
+ { x: i - r / 6, y: 0 },
1658
+ { x: i + 2 * r / 6, y: -r },
1659
+ { x: r / 6, y: -r }
1660
+ ], l = U(s, i, r, a);
1661
+ return l.attr("style", t.style), T(t, l), t.intersect = function(c) {
1662
+ return N.polygon(t, a, c);
1663
+ }, s;
1664
+ }, "lean_right"), _r = /* @__PURE__ */ d(async (e, t) => {
1665
+ const { shapeSvg: s, bbox: n } = await A(
1666
+ e,
1667
+ t,
1668
+ Y(t, void 0),
1669
+ true
1670
+ ), i = n.width + t.padding, r = n.height + t.padding, a = [
1671
+ { x: 2 * r / 6, y: 0 },
1672
+ { x: i + r / 6, y: 0 },
1673
+ { x: i - 2 * r / 6, y: -r },
1674
+ { x: -r / 6, y: -r }
1675
+ ], l = U(s, i, r, a);
1676
+ return l.attr("style", t.style), T(t, l), t.intersect = function(c) {
1677
+ return N.polygon(t, a, c);
1678
+ }, s;
1679
+ }, "lean_left"), Dr = /* @__PURE__ */ d(async (e, t) => {
1680
+ const { shapeSvg: s, bbox: n } = await A(
1681
+ e,
1682
+ t,
1683
+ Y(t, void 0),
1684
+ true
1685
+ ), i = n.width + t.padding, r = n.height + t.padding, a = [
1686
+ { x: -2 * r / 6, y: 0 },
1687
+ { x: i + 2 * r / 6, y: 0 },
1688
+ { x: i - r / 6, y: -r },
1689
+ { x: r / 6, y: -r }
1690
+ ], l = U(s, i, r, a);
1691
+ return l.attr("style", t.style), T(t, l), t.intersect = function(c) {
1692
+ return N.polygon(t, a, c);
1693
+ }, s;
1694
+ }, "trapezoid"), Nr = /* @__PURE__ */ d(async (e, t) => {
1695
+ const { shapeSvg: s, bbox: n } = await A(
1696
+ e,
1697
+ t,
1698
+ Y(t, void 0),
1699
+ true
1700
+ ), i = n.width + t.padding, r = n.height + t.padding, a = [
1701
+ { x: r / 6, y: 0 },
1702
+ { x: i - r / 6, y: 0 },
1703
+ { x: i + 2 * r / 6, y: -r },
1704
+ { x: -2 * r / 6, y: -r }
1705
+ ], l = U(s, i, r, a);
1706
+ return l.attr("style", t.style), T(t, l), t.intersect = function(c) {
1707
+ return N.polygon(t, a, c);
1708
+ }, s;
1709
+ }, "inv_trapezoid"), Tr = /* @__PURE__ */ d(async (e, t) => {
1710
+ const { shapeSvg: s, bbox: n } = await A(
1711
+ e,
1712
+ t,
1713
+ Y(t, void 0),
1714
+ true
1715
+ ), i = n.width + t.padding, r = n.height + t.padding, a = [
1716
+ { x: 0, y: 0 },
1717
+ { x: i + r / 2, y: 0 },
1718
+ { x: i, y: -r / 2 },
1719
+ { x: i + r / 2, y: -r },
1720
+ { x: 0, y: -r }
1721
+ ], l = U(s, i, r, a);
1722
+ return l.attr("style", t.style), T(t, l), t.intersect = function(c) {
1723
+ return N.polygon(t, a, c);
1724
+ }, s;
1725
+ }, "rect_right_inv_arrow"), Br = /* @__PURE__ */ d(async (e, t) => {
1726
+ const { shapeSvg: s, bbox: n } = await A(
1727
+ e,
1728
+ t,
1729
+ Y(t, void 0),
1730
+ true
1731
+ ), i = n.width + t.padding, r = i / 2, a = r / (2.5 + i / 50), l = n.height + a + t.padding, c = "M 0," + a + " a " + r + "," + a + " 0,0,0 " + i + " 0 a " + r + "," + a + " 0,0,0 " + -i + " 0 l 0," + l + " a " + r + "," + a + " 0,0,0 " + i + " 0 l 0," + -l, u = s.attr("label-offset-y", a).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -i / 2 + "," + -(l / 2 + a) + ")");
1732
+ return T(t, u), t.intersect = function(h) {
1733
+ const x = N.rect(t, h), w = x.x - t.x;
1734
+ if (r != 0 && (Math.abs(w) < t.width / 2 || Math.abs(w) == t.width / 2 && Math.abs(x.y - t.y) > t.height / 2 - a)) {
1735
+ let b = a * a * (1 - w * w / (r * r));
1736
+ b != 0 && (b = Math.sqrt(b)), b = a - b, h.y - t.y > 0 && (b = -b), x.y += b;
1737
+ }
1738
+ return x;
1739
+ }, s;
1740
+ }, "cylinder"), Cr = /* @__PURE__ */ d(async (e, t) => {
1741
+ const { shapeSvg: s, bbox: n, halfPadding: i } = await A(
1742
+ e,
1743
+ t,
1744
+ "node " + t.classes + " " + t.class,
1745
+ true
1746
+ ), r = s.insert("rect", ":first-child"), a = t.positioned ? t.width : n.width + t.padding, l = t.positioned ? t.height : n.height + t.padding, c = t.positioned ? -a / 2 : -n.width / 2 - i, u = t.positioned ? -l / 2 : -n.height / 2 - i;
1747
+ if (r.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", u).attr("width", a).attr("height", l), t.props) {
1748
+ const h = new Set(Object.keys(t.props));
1749
+ t.props.borders && (ht(r, t.props.borders, a, l), h.delete("borders")), h.forEach((x) => {
1750
+ L.warn(`Unknown node property ${x}`);
1751
+ });
1752
+ }
1753
+ return T(t, r), t.intersect = function(h) {
1754
+ return N.rect(t, h);
1755
+ }, s;
1756
+ }, "rect"), Ir = /* @__PURE__ */ d(async (e, t) => {
1757
+ const { shapeSvg: s, bbox: n, halfPadding: i } = await A(
1758
+ e,
1759
+ t,
1760
+ "node " + t.classes,
1761
+ true
1762
+ ), r = s.insert("rect", ":first-child"), a = t.positioned ? t.width : n.width + t.padding, l = t.positioned ? t.height : n.height + t.padding, c = t.positioned ? -a / 2 : -n.width / 2 - i, u = t.positioned ? -l / 2 : -n.height / 2 - i;
1763
+ if (r.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", u).attr("width", a).attr("height", l), t.props) {
1764
+ const h = new Set(Object.keys(t.props));
1765
+ t.props.borders && (ht(r, t.props.borders, a, l), h.delete("borders")), h.forEach((x) => {
1766
+ L.warn(`Unknown node property ${x}`);
1767
+ });
1768
+ }
1769
+ return T(t, r), t.intersect = function(h) {
1770
+ return N.rect(t, h);
1771
+ }, s;
1772
+ }, "composite"), Or = /* @__PURE__ */ d(async (e, t) => {
1773
+ const { shapeSvg: s } = await A(e, t, "label", true);
1774
+ L.trace("Classes = ", t.class);
1775
+ const n = s.insert("rect", ":first-child"), i = 0, r = 0;
1776
+ if (n.attr("width", i).attr("height", r), s.attr("class", "label edgeLabel"), t.props) {
1777
+ const a = new Set(Object.keys(t.props));
1778
+ t.props.borders && (ht(n, t.props.borders, i, r), a.delete("borders")), a.forEach((l) => {
1779
+ L.warn(`Unknown node property ${l}`);
1780
+ });
1781
+ }
1782
+ return T(t, n), t.intersect = function(a) {
1783
+ return N.rect(t, a);
1784
+ }, s;
1785
+ }, "labelRect");
1786
+ function ht(e, t, s, n) {
1787
+ const i = [], r = /* @__PURE__ */ d((l) => {
1788
+ i.push(l, 0);
1789
+ }, "addBorder"), a = /* @__PURE__ */ d((l) => {
1790
+ i.push(0, l);
1791
+ }, "skipBorder");
1792
+ t.includes("t") ? (L.debug("add top border"), r(s)) : a(s), t.includes("r") ? (L.debug("add right border"), r(n)) : a(n), t.includes("b") ? (L.debug("add bottom border"), r(s)) : a(s), t.includes("l") ? (L.debug("add left border"), r(n)) : a(n), e.attr("stroke-dasharray", i.join(" "));
1793
+ }
1794
+ d(ht, "applyNodePropertyBorders");
1795
+ var Rr = /* @__PURE__ */ d((e, t) => {
1796
+ let s;
1797
+ t.classes ? s = "node " + t.classes : s = "node default";
1798
+ const n = e.insert("g").attr("class", s).attr("id", t.domId || t.id), i = n.insert("rect", ":first-child"), r = n.insert("line"), a = n.insert("g").attr("class", "label"), l = t.labelText.flat ? t.labelText.flat() : t.labelText;
1799
+ let c = "";
1800
+ typeof l == "object" ? c = l[0] : c = l, L.info("Label text abc79", c, l, typeof l == "object");
1801
+ const u = a.node().appendChild(K(c, t.labelStyle, true, true));
1802
+ let h = { width: 0, height: 0 };
1803
+ if (j(R().flowchart.htmlLabels)) {
1804
+ const E = u.children[0], k = O(u);
1805
+ h = E.getBoundingClientRect(), k.attr("width", h.width), k.attr("height", h.height);
1806
+ }
1807
+ L.info("Text 2", l);
1808
+ const x = l.slice(1, l.length);
1809
+ let w = u.getBBox();
1810
+ const b = a.node().appendChild(
1811
+ K(x.join ? x.join("<br/>") : x, t.labelStyle, true, true)
1812
+ );
1813
+ if (j(R().flowchart.htmlLabels)) {
1814
+ const E = b.children[0], k = O(b);
1815
+ h = E.getBoundingClientRect(), k.attr("width", h.width), k.attr("height", h.height);
1816
+ }
1817
+ const S = t.padding / 2;
1818
+ return O(b).attr(
1819
+ "transform",
1820
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1821
+ (h.width > w.width ? 0 : (w.width - h.width) / 2) + ", " + (w.height + S + 5) + ")"
1822
+ ), O(u).attr(
1823
+ "transform",
1824
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1825
+ (h.width < w.width ? 0 : -(w.width - h.width) / 2) + ", 0)"
1826
+ ), h = a.node().getBBox(), a.attr(
1827
+ "transform",
1828
+ "translate(" + -h.width / 2 + ", " + (-h.height / 2 - S + 3) + ")"
1829
+ ), i.attr("class", "outer title-state").attr("x", -h.width / 2 - S).attr("y", -h.height / 2 - S).attr("width", h.width + t.padding).attr("height", h.height + t.padding), r.attr("class", "divider").attr("x1", -h.width / 2 - S).attr("x2", h.width / 2 + S).attr("y1", -h.height / 2 - S + w.height + S).attr("y2", -h.height / 2 - S + w.height + S), T(t, i), t.intersect = function(E) {
1830
+ return N.rect(t, E);
1831
+ }, n;
1832
+ }, "rectWithTitle"), zr = /* @__PURE__ */ d(async (e, t) => {
1833
+ const { shapeSvg: s, bbox: n } = await A(
1834
+ e,
1835
+ t,
1836
+ Y(t, void 0),
1837
+ true
1838
+ ), i = n.height + t.padding, r = n.width + i / 4 + t.padding, a = s.insert("rect", ":first-child").attr("style", t.style).attr("rx", i / 2).attr("ry", i / 2).attr("x", -r / 2).attr("y", -i / 2).attr("width", r).attr("height", i);
1839
+ return T(t, a), t.intersect = function(l) {
1840
+ return N.rect(t, l);
1841
+ }, s;
1842
+ }, "stadium"), Ar = /* @__PURE__ */ d(async (e, t) => {
1843
+ const { shapeSvg: s, bbox: n, halfPadding: i } = await A(
1844
+ e,
1845
+ t,
1846
+ Y(t, void 0),
1847
+ true
1848
+ ), r = s.insert("circle", ":first-child");
1849
+ return r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + i).attr("width", n.width + t.padding).attr("height", n.height + t.padding), L.info("Circle main"), T(t, r), t.intersect = function(a) {
1850
+ return L.info("Circle intersect", t, n.width / 2 + i, a), N.circle(t, n.width / 2 + i, a);
1851
+ }, s;
1852
+ }, "circle"), Mr = /* @__PURE__ */ d(async (e, t) => {
1853
+ const { shapeSvg: s, bbox: n, halfPadding: i } = await A(
1854
+ e,
1855
+ t,
1856
+ Y(t, void 0),
1857
+ true
1858
+ ), r = 5, a = s.insert("g", ":first-child"), l = a.insert("circle"), c = a.insert("circle");
1859
+ return a.attr("class", t.class), l.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + i + r).attr("width", n.width + t.padding + r * 2).attr("height", n.height + t.padding + r * 2), c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + i).attr("width", n.width + t.padding).attr("height", n.height + t.padding), L.info("DoubleCircle main"), T(t, l), t.intersect = function(u) {
1860
+ return L.info("DoubleCircle intersect", t, n.width / 2 + i + r, u), N.circle(t, n.width / 2 + i + r, u);
1861
+ }, s;
1862
+ }, "doublecircle"), Fr = /* @__PURE__ */ d(async (e, t) => {
1863
+ const { shapeSvg: s, bbox: n } = await A(
1864
+ e,
1865
+ t,
1866
+ Y(t, void 0),
1867
+ true
1868
+ ), i = n.width + t.padding, r = n.height + t.padding, a = [
1869
+ { x: 0, y: 0 },
1870
+ { x: i, y: 0 },
1871
+ { x: i, y: -r },
1872
+ { x: 0, y: -r },
1873
+ { x: 0, y: 0 },
1874
+ { x: -8, y: 0 },
1875
+ { x: i + 8, y: 0 },
1876
+ { x: i + 8, y: -r },
1877
+ { x: -8, y: -r },
1878
+ { x: -8, y: 0 }
1879
+ ], l = U(s, i, r, a);
1880
+ return l.attr("style", t.style), T(t, l), t.intersect = function(c) {
1881
+ return N.polygon(t, a, c);
1882
+ }, s;
1883
+ }, "subroutine"), Wr = /* @__PURE__ */ d((e, t) => {
1884
+ const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = s.insert("circle", ":first-child");
1885
+ return n.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), T(t, n), t.intersect = function(i) {
1886
+ return N.circle(t, 7, i);
1887
+ }, s;
1888
+ }, "start"), Mt = /* @__PURE__ */ d((e, t, s) => {
1889
+ const n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
1890
+ let i = 70, r = 10;
1891
+ s === "LR" && (i = 10, r = 70);
1892
+ const a = n.append("rect").attr("x", -1 * i / 2).attr("y", -1 * r / 2).attr("width", i).attr("height", r).attr("class", "fork-join");
1893
+ return T(t, a), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(l) {
1894
+ return N.rect(t, l);
1895
+ }, n;
1896
+ }, "forkJoin"), Pr = /* @__PURE__ */ d((e, t) => {
1897
+ const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = s.insert("circle", ":first-child"), i = s.insert("circle", ":first-child");
1898
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), n.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), T(t, i), t.intersect = function(r) {
1899
+ return N.circle(t, 7, r);
1900
+ }, s;
1901
+ }, "end"), Yr = /* @__PURE__ */ d((e, t) => {
1902
+ var _a2;
1903
+ const s = t.padding / 2, n = 4, i = 8;
1904
+ let r;
1905
+ t.classes ? r = "node " + t.classes : r = "node default";
1906
+ const a = e.insert("g").attr("class", r).attr("id", t.domId || t.id), l = a.insert("rect", ":first-child"), c = a.insert("line"), u = a.insert("line");
1907
+ let h = 0, x = n;
1908
+ const w = a.insert("g").attr("class", "label");
1909
+ let b = 0;
1910
+ const S = (_a2 = t.classData.annotations) == null ? void 0 : _a2[0], E = t.classData.annotations[0] ? "\xAB" + t.classData.annotations[0] + "\xBB" : "", k = w.node().appendChild(K(E, t.labelStyle, true, true));
1911
+ let B = k.getBBox();
1912
+ if (j(R().flowchart.htmlLabels)) {
1913
+ const v = k.children[0], o = O(k);
1914
+ B = v.getBoundingClientRect(), o.attr("width", B.width), o.attr("height", B.height);
1915
+ }
1916
+ t.classData.annotations[0] && (x += B.height + n, h += B.width);
1917
+ let _ = t.classData.label;
1918
+ t.classData.type !== void 0 && t.classData.type !== "" && (R().flowchart.htmlLabels ? _ += "&lt;" + t.classData.type + "&gt;" : _ += "<" + t.classData.type + ">");
1919
+ const D = w.node().appendChild(K(_, t.labelStyle, true, true));
1920
+ O(D).attr("class", "classTitle");
1921
+ let y = D.getBBox();
1922
+ if (j(R().flowchart.htmlLabels)) {
1923
+ const v = D.children[0], o = O(D);
1924
+ y = v.getBoundingClientRect(), o.attr("width", y.width), o.attr("height", y.height);
1925
+ }
1926
+ x += y.height + n, y.width > h && (h = y.width);
1927
+ const g = [];
1928
+ t.classData.members.forEach((v) => {
1929
+ const o = v.getDisplayDetails();
1930
+ let W = o.displayText;
1931
+ R().flowchart.htmlLabels && (W = W.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1932
+ const p = w.node().appendChild(
1933
+ K(
1934
+ W,
1935
+ o.cssStyle ? o.cssStyle : t.labelStyle,
1936
+ true,
1937
+ true
1938
+ )
1939
+ );
1940
+ let I = p.getBBox();
1941
+ if (j(R().flowchart.htmlLabels)) {
1942
+ const Z = p.children[0], V = O(p);
1943
+ I = Z.getBoundingClientRect(), V.attr("width", I.width), V.attr("height", I.height);
1944
+ }
1945
+ I.width > h && (h = I.width), x += I.height + n, g.push(p);
1946
+ }), x += i;
1947
+ const f = [];
1948
+ if (t.classData.methods.forEach((v) => {
1949
+ const o = v.getDisplayDetails();
1950
+ let W = o.displayText;
1951
+ R().flowchart.htmlLabels && (W = W.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1952
+ const p = w.node().appendChild(
1953
+ K(
1954
+ W,
1955
+ o.cssStyle ? o.cssStyle : t.labelStyle,
1956
+ true,
1957
+ true
1958
+ )
1959
+ );
1960
+ let I = p.getBBox();
1961
+ if (j(R().flowchart.htmlLabels)) {
1962
+ const Z = p.children[0], V = O(p);
1963
+ I = Z.getBoundingClientRect(), V.attr("width", I.width), V.attr("height", I.height);
1964
+ }
1965
+ I.width > h && (h = I.width), x += I.height + n, f.push(p);
1966
+ }), x += i, S) {
1967
+ let v = (h - B.width) / 2;
1968
+ O(k).attr(
1969
+ "transform",
1970
+ "translate( " + (-1 * h / 2 + v) + ", " + -1 * x / 2 + ")"
1971
+ ), b = B.height + n;
1972
+ }
1973
+ let m = (h - y.width) / 2;
1974
+ return O(D).attr(
1975
+ "transform",
1976
+ "translate( " + (-1 * h / 2 + m) + ", " + (-1 * x / 2 + b) + ")"
1977
+ ), b += y.height + n, c.attr("class", "divider").attr("x1", -h / 2 - s).attr("x2", h / 2 + s).attr("y1", -x / 2 - s + i + b).attr("y2", -x / 2 - s + i + b), b += i, g.forEach((v) => {
1978
+ O(v).attr(
1979
+ "transform",
1980
+ "translate( " + -h / 2 + ", " + (-1 * x / 2 + b + i / 2) + ")"
1981
+ );
1982
+ const o = v == null ? void 0 : v.getBBox();
1983
+ b += ((o == null ? void 0 : o.height) ?? 0) + n;
1984
+ }), b += i, u.attr("class", "divider").attr("x1", -h / 2 - s).attr("x2", h / 2 + s).attr("y1", -x / 2 - s + i + b).attr("y2", -x / 2 - s + i + b), b += i, f.forEach((v) => {
1985
+ O(v).attr(
1986
+ "transform",
1987
+ "translate( " + -h / 2 + ", " + (-1 * x / 2 + b) + ")"
1988
+ );
1989
+ const o = v == null ? void 0 : v.getBBox();
1990
+ b += ((o == null ? void 0 : o.height) ?? 0) + n;
1991
+ }), l.attr("style", t.style).attr("class", "outer title-state").attr("x", -h / 2 - s).attr("y", -(x / 2) - s).attr("width", h + t.padding).attr("height", x + t.padding), T(t, l), t.intersect = function(v) {
1992
+ return N.rect(t, v);
1993
+ }, a;
1994
+ }, "class_box"), Ft = {
1995
+ rhombus: At,
1996
+ composite: Ir,
1997
+ question: At,
1998
+ rect: Cr,
1999
+ labelRect: Or,
2000
+ rectWithTitle: Rr,
2001
+ choice: Lr,
2002
+ circle: Ar,
2003
+ doublecircle: Mr,
2004
+ stadium: zr,
2005
+ hexagon: Sr,
2006
+ block_arrow: kr,
2007
+ rect_left_inv_arrow: vr,
2008
+ lean_right: Er,
2009
+ lean_left: _r,
2010
+ trapezoid: Dr,
2011
+ inv_trapezoid: Nr,
2012
+ rect_right_inv_arrow: Tr,
2013
+ cylinder: Br,
2014
+ start: Wr,
2015
+ end: Pr,
2016
+ note: mr,
2017
+ subroutine: Fr,
2018
+ fork: Mt,
2019
+ join: Mt,
2020
+ class_box: Yr
2021
+ }, lt = {}, te = /* @__PURE__ */ d(async (e, t, s) => {
2022
+ let n, i;
2023
+ if (t.link) {
2024
+ let r;
2025
+ R().securityLevel === "sandbox" ? r = "_top" : t.linkTarget && (r = t.linkTarget || "_blank"), n = e.insert("svg:a").attr("xlink:href", t.link).attr("target", r), i = await Ft[t.shape](n, t, s);
2026
+ } else
2027
+ i = await Ft[t.shape](e, t, s), n = i;
2028
+ return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), lt[t.id] = n, t.haveCallback && lt[t.id].attr("class", lt[t.id].attr("class") + " clickable"), n;
2029
+ }, "insertNode"), Hr = /* @__PURE__ */ d((e) => {
2030
+ const t = lt[e.id];
2031
+ L.trace(
2032
+ "Transforming node",
2033
+ e.diff,
2034
+ e,
2035
+ "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
2036
+ );
2037
+ const s = 8, n = e.diff || 0;
2038
+ return e.clusterNode ? t.attr(
2039
+ "transform",
2040
+ "translate(" + (e.x + n - e.width / 2) + ", " + (e.y - e.height / 2 - s) + ")"
2041
+ ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), n;
2042
+ }, "positionNode");
2043
+ function _t(e, t, s = false) {
2044
+ var _a2, _b2, _c;
2045
+ const n = e;
2046
+ let i = "default";
2047
+ (((_a2 = n == null ? void 0 : n.classes) == null ? void 0 : _a2.length) || 0) > 0 && (i = ((n == null ? void 0 : n.classes) ?? []).join(" ")), i = i + " flowchart-label";
2048
+ let r = 0, a = "", l;
2049
+ switch (n.type) {
2050
+ case "round":
2051
+ r = 5, a = "rect";
2052
+ break;
2053
+ case "composite":
2054
+ r = 0, a = "composite", l = 0;
2055
+ break;
2056
+ case "square":
2057
+ a = "rect";
2058
+ break;
2059
+ case "diamond":
2060
+ a = "question";
2061
+ break;
2062
+ case "hexagon":
2063
+ a = "hexagon";
2064
+ break;
2065
+ case "block_arrow":
2066
+ a = "block_arrow";
2067
+ break;
2068
+ case "odd":
2069
+ a = "rect_left_inv_arrow";
2070
+ break;
2071
+ case "lean_right":
2072
+ a = "lean_right";
2073
+ break;
2074
+ case "lean_left":
2075
+ a = "lean_left";
2076
+ break;
2077
+ case "trapezoid":
2078
+ a = "trapezoid";
2079
+ break;
2080
+ case "inv_trapezoid":
2081
+ a = "inv_trapezoid";
2082
+ break;
2083
+ case "rect_left_inv_arrow":
2084
+ a = "rect_left_inv_arrow";
2085
+ break;
2086
+ case "circle":
2087
+ a = "circle";
2088
+ break;
2089
+ case "ellipse":
2090
+ a = "ellipse";
2091
+ break;
2092
+ case "stadium":
2093
+ a = "stadium";
2094
+ break;
2095
+ case "subroutine":
2096
+ a = "subroutine";
2097
+ break;
2098
+ case "cylinder":
2099
+ a = "cylinder";
2100
+ break;
2101
+ case "group":
2102
+ a = "rect";
2103
+ break;
2104
+ case "doublecircle":
2105
+ a = "doublecircle";
2106
+ break;
2107
+ default:
2108
+ a = "rect";
2109
+ }
2110
+ const c = xe((n == null ? void 0 : n.styles) ?? []), u = n.label, h = n.size ?? { width: 0, height: 0, x: 0, y: 0 };
2111
+ return {
2112
+ labelStyle: c.labelStyle,
2113
+ shape: a,
2114
+ labelText: u,
2115
+ rx: r,
2116
+ ry: r,
2117
+ class: i,
2118
+ style: c.style,
2119
+ id: n.id,
2120
+ directions: n.directions,
2121
+ width: h.width,
2122
+ height: h.height,
2123
+ x: h.x,
2124
+ y: h.y,
2125
+ positioned: s,
2126
+ intersect: void 0,
2127
+ type: n.type,
2128
+ padding: l ?? ((_c = (_b2 = rt()) == null ? void 0 : _b2.block) == null ? void 0 : _c.padding) ?? 0
2129
+ };
2130
+ }
2131
+ d(_t, "getNodeFromBlock");
2132
+ async function ee(e, t, s) {
2133
+ const n = _t(t, s, false);
2134
+ if (n.type === "group")
2135
+ return;
2136
+ const i = rt(), r = await te(e, n, { config: i }), a = r.node().getBBox(), l = s.getBlock(n.id);
2137
+ l.size = { width: a.width, height: a.height, x: 0, y: 0, node: r }, s.setBlock(l), r.remove();
2138
+ }
2139
+ d(ee, "calculateBlockSize");
2140
+ async function re(e, t, s) {
2141
+ const n = _t(t, s, true);
2142
+ if (s.getBlock(n.id).type !== "space") {
2143
+ const r = rt();
2144
+ await te(e, n, { config: r }), t.intersect = n == null ? void 0 : n.intersect, Hr(n);
2145
+ }
2146
+ }
2147
+ d(re, "insertBlockPositioned");
2148
+ async function dt(e, t, s, n) {
2149
+ for (const i of t)
2150
+ await n(e, i, s), i.children && await dt(e, i.children, s, n);
2151
+ }
2152
+ d(dt, "performOperations");
2153
+ async function ae(e, t, s) {
2154
+ await dt(e, t, s, ee);
2155
+ }
2156
+ d(ae, "calculateBlockSizes");
2157
+ async function se(e, t, s) {
2158
+ await dt(e, t, s, re);
2159
+ }
2160
+ d(se, "insertBlocks");
2161
+ async function ie(e, t, s, n, i) {
2162
+ const r = new be({
2163
+ multigraph: true,
2164
+ compound: true
2165
+ });
2166
+ r.setGraph({
2167
+ rankdir: "TB",
2168
+ nodesep: 10,
2169
+ ranksep: 10,
2170
+ marginx: 8,
2171
+ marginy: 8
2172
+ });
2173
+ for (const a of s)
2174
+ a.size && r.setNode(a.id, {
2175
+ width: a.size.width,
2176
+ height: a.size.height,
2177
+ intersect: a.intersect
2178
+ });
2179
+ for (const a of t)
2180
+ if (a.start && a.end) {
2181
+ const l = n.getBlock(a.start), c = n.getBlock(a.end);
2182
+ if ((l == null ? void 0 : l.size) && (c == null ? void 0 : c.size)) {
2183
+ const u = l.size, h = c.size, x = [
2184
+ { x: u.x, y: u.y },
2185
+ { x: u.x + (h.x - u.x) / 2, y: u.y + (h.y - u.y) / 2 },
2186
+ { x: h.x, y: h.y }
2187
+ ];
2188
+ hr(
2189
+ e,
2190
+ { v: a.start, w: a.end, name: a.id },
2191
+ {
2192
+ ...a,
2193
+ arrowTypeEnd: a.arrowTypeEnd,
2194
+ arrowTypeStart: a.arrowTypeStart,
2195
+ points: x,
2196
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2197
+ },
2198
+ void 0,
2199
+ "block",
2200
+ r,
2201
+ i
2202
+ ), a.label && (await nr(e, {
2203
+ ...a,
2204
+ label: a.label,
2205
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2206
+ arrowTypeEnd: a.arrowTypeEnd,
2207
+ arrowTypeStart: a.arrowTypeStart,
2208
+ points: x,
2209
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2210
+ }), lr(
2211
+ { ...a, x: x[1].x, y: x[1].y },
2212
+ {
2213
+ originalPath: x
2214
+ }
2215
+ ));
2216
+ }
2217
+ }
2218
+ }
2219
+ d(ie, "insertEdges");
2220
+ var Kr = /* @__PURE__ */ d(function(e, t) {
2221
+ return t.db.getClasses();
2222
+ }, "getClasses"), Xr = /* @__PURE__ */ d(async function(e, t, s, n) {
2223
+ const { securityLevel: i, block: r } = rt(), a = n.db;
2224
+ let l;
2225
+ i === "sandbox" && (l = O("#i" + t));
2226
+ const c = i === "sandbox" ? O(l.nodes()[0].contentDocument.body) : O("body"), u = i === "sandbox" ? c.select(`[id="${t}"]`) : O(`[id="${t}"]`);
2227
+ er(u, ["point", "circle", "cross"], n.type, t);
2228
+ const x = a.getBlocks(), w = a.getBlocksFlat(), b = a.getEdges(), S = u.insert("g").attr("class", "block");
2229
+ await ae(S, x, a);
2230
+ const E = jt(a);
2231
+ if (await se(S, x, a), await ie(S, b, w, a, t), E) {
2232
+ const k = E, B = Math.max(1, Math.round(0.125 * (k.width / k.height))), _ = k.height + B + 10, D = k.width + 10, { useMaxWidth: y } = r;
2233
+ oe(u, _, D, !!y), L.debug("Here Bounds", E, k), u.attr(
2234
+ "viewBox",
2235
+ `${k.x - 5} ${k.y - 5} ${k.width + 10} ${k.height + 10}`
2236
+ );
2237
+ }
2238
+ }, "draw"), Ur = {
2239
+ draw: Xr,
2240
+ getClasses: Kr
2241
+ }, Jr = {
2242
+ parser: Se,
2243
+ db: Ye,
2244
+ renderer: Ur,
2245
+ styles: Ke
2246
+ };
2247
+ export {
2248
+ Jr as diagram
2249
+ };