@fibery/custom-app-text-editor 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/LICENSE +214 -0
  2. package/README.md +33 -0
  3. package/lib/abnfDiagram-VRR7QNED-BgjOQqEh.js +89 -0
  4. package/lib/arc-Dp0rqagO.js +82 -0
  5. package/lib/architecture-TIHT7OUA-DDwCCw0y.js +3 -0
  6. package/lib/architectureDiagram-ZJ3FMSHR-BucIluTN.js +4129 -0
  7. package/lib/array-CApNbSU9.js +6 -0
  8. package/lib/blockDiagram-677ZJIJ3-CWYuHThP.js +3157 -0
  9. package/lib/c4Diagram-LMCZKHZV-Cr3_W-xe.js +2982 -0
  10. package/lib/channel-Bb7a6w5c.js +5 -0
  11. package/lib/chunk-2Q5K7J3B-CINvUK-A.js +15 -0
  12. package/lib/chunk-32BRIVSS-b-BvyGz0.js +61 -0
  13. package/lib/chunk-52WLFC77-Cf8zEoqs.js +593 -0
  14. package/lib/chunk-5VM5RSS4-Dnx15xMv.js +5 -0
  15. package/lib/chunk-7BUUIJ7U-B018BbRy.js +82 -0
  16. package/lib/chunk-C7G6YPKG-CmOuVFlJ.js +67 -0
  17. package/lib/chunk-EX3LRPZG-LynZw14I.js +2042 -0
  18. package/lib/chunk-HOUHSVGY-Br7ZSMKe.js +275 -0
  19. package/lib/chunk-ICXQ74PX-VqT5WUTt.js +1330 -0
  20. package/lib/chunk-JWPE2WC7-Ch0jmUXM.js +8 -0
  21. package/lib/chunk-KEIR6QF5-RwFi50en.js +21456 -0
  22. package/lib/chunk-MOJQB5TN-rQ4AfTd9.js +490 -0
  23. package/lib/chunk-OGEWGWER-BvF6eV9Q.js +32 -0
  24. package/lib/chunk-PUDLZKDR-BW7SZvCB.js +4135 -0
  25. package/lib/chunk-Q4XR5HBZ-CRgGP3ez.js +1635 -0
  26. package/lib/chunk-RYQCIY6F-CHlASUpG.js +241 -0
  27. package/lib/chunk-V7JOEXUC-OY39ml6X.js +3357 -0
  28. package/lib/chunk-VR4S4FIN-Bk7IFdYB.js +26 -0
  29. package/lib/chunk-WYO6CB5R-MV-yOaop.js +3769 -0
  30. package/lib/chunk-XXDRQBXY-Djd1ChwJ.js +9 -0
  31. package/lib/chunk-Y2CYZVJY-QdJ4V9rh.js +12 -0
  32. package/lib/chunk-ZGVPDNZ5-l81xl1BI.js +3738 -0
  33. package/lib/classDiagram-OUVF2IWQ--wRzSvLt.js +30 -0
  34. package/lib/classDiagram-v2-EOCWNBFH-ChMCdPO-.js +30 -0
  35. package/lib/cose-bilkent-JH36ORCC-CyVZn5M3.js +2254 -0
  36. package/lib/custom-app-text-editor.css +2 -0
  37. package/lib/custom-app-text-editor.js +81102 -0
  38. package/lib/cynefin-VYW2F7L2-CMgnLl46.js +3 -0
  39. package/lib/cynefinDiagram-TSTJHNR4-988Y73wV.js +355 -0
  40. package/lib/cytoscape.esm-DMXbtFI-.js +18145 -0
  41. package/lib/dagre-Dmarb1s8.js +1699 -0
  42. package/lib/dagre-VKFMJZFB-Bf-pz2Lx.js +328 -0
  43. package/lib/defaultLocale-A87O3snN.js +198 -0
  44. package/lib/diagram-FQU43EPY-BT8WeVzc.js +432 -0
  45. package/lib/diagram-G47NLZAW-vZ2XG37l.js +527 -0
  46. package/lib/diagram-NH7WQ7WH-CH0IfHB0.js +134 -0
  47. package/lib/diagram-OA4YK3LP-BgwQcJfp.js +300 -0
  48. package/lib/diagram-WEI45ONY-Cd3sVPil.js +214 -0
  49. package/lib/dist-PGS6ynRO.js +59 -0
  50. package/lib/ebnfDiagram-CCIWWBDH-CwBFb2Fm.js +100 -0
  51. package/lib/erDiagram-Q63AITRT-BshRACvj.js +1727 -0
  52. package/lib/eventmodeling-45OFAUF4-BDhzj03B.js +3 -0
  53. package/lib/flowDiagram-23GEKE2U-C3zDgFvZ.js +16 -0
  54. package/lib/ganttDiagram-NO4QXBWP-BD5PiE8x.js +3073 -0
  55. package/lib/gitGraph-TEB2WS4Q-DJA_hE4G.js +3 -0
  56. package/lib/gitGraphDiagram-IHSO6WYX-BAhccBh3.js +733 -0
  57. package/lib/graphlib-DglfpsVp.js +1267 -0
  58. package/lib/index.browser-Dv9K8IAp.js +26 -0
  59. package/lib/info-DKCQHKI2-BD_vOCz6.js +3 -0
  60. package/lib/infoDiagram-FWYZ7A6U-CGZnf03G.js +20 -0
  61. package/lib/init-sjaVZO3f.js +13 -0
  62. package/lib/ishikawaDiagram-FXEZZL3T-PFfVM0NO.js +719 -0
  63. package/lib/journeyDiagram-5HDEW3XC-CRGz7dcx.js +884 -0
  64. package/lib/kanban-definition-HUTT4EX6-BBH4Yn5e.js +974 -0
  65. package/lib/line-CJQicKfr.js +34 -0
  66. package/lib/linear-B9Cv96-J.js +288 -0
  67. package/lib/map-C7KALUOH.js +241 -0
  68. package/lib/mermaid-parser.core-BupC9XGF.js +638 -0
  69. package/lib/mermaid-renderer-Cp0xusfR.js +2425 -0
  70. package/lib/mindmap-definition-LN4V7U3C-CWL1sg0K.js +978 -0
  71. package/lib/ordinal-CNQzPcrr.js +65 -0
  72. package/lib/packet-7NZHBO7P-CgBlALV1.js +3 -0
  73. package/lib/path-DVvH25eQ.js +84 -0
  74. package/lib/pegDiagram-2B236MQR-BKv8dTtv.js +94 -0
  75. package/lib/pie-RZYD4A2V-CryPC-P_.js +3 -0
  76. package/lib/pieDiagram-ENE6RG2P-CXeFg_cL.js +203 -0
  77. package/lib/quadrantDiagram-ABIIQ3AL-v_u3aC8Y.js +2001 -0
  78. package/lib/radar-I7S5WNFK-DgzJDRy3.js +3 -0
  79. package/lib/railroad-3IZDKUUU-DFp3mbpB.js +3 -0
  80. package/lib/railroad-abnf-AHOZXSZD-BRjidKH0.js +3 -0
  81. package/lib/railroad-ebnf-EBAXGLYW-PgrDWact.js +3 -0
  82. package/lib/railroad-peg-LSFZ7HO6-CMKir81Y.js +3 -0
  83. package/lib/railroadDiagram-RFXS5EU6-mEC9tVS-.js +76 -0
  84. package/lib/requirementDiagram-TGXJPOKE-BAEzI7V4.js +2223 -0
  85. package/lib/rolldown-runtime-DArdT4gl.js +23 -0
  86. package/lib/rough.esm-B2w_aYoc.js +1361 -0
  87. package/lib/sankeyDiagram-HTMAVEWB-Dbu-sl2E.js +972 -0
  88. package/lib/sequenceDiagram-DBY2YBRQ-DCuWmWHX.js +4156 -0
  89. package/lib/sizeCapture-X5ZJPWSS-BEIM84He.js +46 -0
  90. package/lib/src-DQbL46sB.js +2139 -0
  91. package/lib/src-DuuHKEe6.js +704 -0
  92. package/lib/stateDiagram-2N3HPSRC-fs9QmDMR.js +220 -0
  93. package/lib/stateDiagram-v2-6OUMAXLB-wWxYbttN.js +30 -0
  94. package/lib/swimlanes-5IMT3BWC-QaXUd9db.js +5069 -0
  95. package/lib/swimlanesDiagram-G3AALYLV-BtGToCzH.js +30 -0
  96. package/lib/timeline-definition-FHXFAJF6-CAsyJrsw.js +1069 -0
  97. package/lib/treeView-QDETBFTQ-DVp4aTZQ.js +3 -0
  98. package/lib/treemap-6X3UGDF4-BbBnHMHJ.js +3 -0
  99. package/lib/types.d.ts +44 -0
  100. package/lib/v4-CZv9Hsqq.js +33 -0
  101. package/lib/vennDiagram-L72KCM5P-C87u0gjr.js +1880 -0
  102. package/lib/wardley-OPB4EBWU-B-RXhnoN.js +3 -0
  103. package/lib/wardleyDiagram-EHGQE667-BxviBDl_.js +645 -0
  104. package/lib/xychartDiagram-FW5EYKEG-BQQhanuH.js +2098 -0
  105. package/package.json +29 -0
@@ -0,0 +1,3157 @@
1
+ import { n as e } from "./chunk-Y2CYZVJY-QdJ4V9rh.js";
2
+ import { m as t, p as n } from "./src-DQbL46sB.js";
3
+ import { O as r, T as i, a, b as o, c as s, it as c, s as l, x as u, z as d } from "./chunk-WYO6CB5R-MV-yOaop.js";
4
+ import { t as f } from "./channel-Bb7a6w5c.js";
5
+ import { A as p, B as m, C as h, D as g, E as _, F as v, G as y, H as b, I as x, L as S, M as C, N as w, O as T, P as E, R as D, T as O, U as k, V as A, W as j, a as M, b as ee, et as te, g as N, j as ne, k as re, l as ie, v as ae, w as oe, z as se } from "./chunk-ICXQ74PX-VqT5WUTt.js";
6
+ import { t as ce } from "./line-CJQicKfr.js";
7
+ import "./chunk-HOUHSVGY-Br7ZSMKe.js";
8
+ import { n as P } from "./chunk-Q4XR5HBZ-CRgGP3ez.js";
9
+ import { t as le } from "./chunk-5VM5RSS4-Dnx15xMv.js";
10
+ import { n as ue, t as F } from "./chunk-7BUUIJ7U-B018BbRy.js";
11
+ import { n as de, t as fe } from "./chunk-OGEWGWER-BvF6eV9Q.js";
12
+ import { t as pe } from "./graphlib-DglfpsVp.js";
13
+ //#region ../../node_modules/.pnpm/es-toolkit@1.49.0/node_modules/es-toolkit/dist/compat/predicate/isArray.mjs
14
+ function me(e) {
15
+ return Array.isArray(e);
16
+ }
17
+ //#endregion
18
+ //#region ../../node_modules/.pnpm/es-toolkit@1.49.0/node_modules/es-toolkit/dist/compat/object/clone.mjs
19
+ function he(e) {
20
+ if (ee(e)) return e;
21
+ let t = y(e);
22
+ if (!ge(e)) return {};
23
+ if (me(e)) {
24
+ let t = Array.from(e);
25
+ return e.length > 0 && typeof e[0] == "string" && Object.hasOwn(e, "index") && (t.index = e.index, t.input = e.input), t;
26
+ }
27
+ if (ae(e)) {
28
+ let t = e, n = t.constructor;
29
+ return new n(t.buffer, t.byteOffset, t.length);
30
+ }
31
+ if (t === "[object ArrayBuffer]") return new ArrayBuffer(e.byteLength);
32
+ if (t === "[object DataView]") {
33
+ let t = e, n = t.buffer, r = t.byteOffset, i = t.byteLength, a = new ArrayBuffer(i), o = new Uint8Array(n, r, i);
34
+ return new Uint8Array(a).set(o), new DataView(a);
35
+ }
36
+ if (t === "[object Boolean]" || t === "[object Number]" || t === "[object String]") {
37
+ let n = e.constructor, r = new n(e.valueOf());
38
+ return t === "[object String]" ? ye(r, e) : _e(r, e), r;
39
+ }
40
+ if (t === "[object Date]") return new Date(Number(e));
41
+ if (t === "[object RegExp]") {
42
+ let t = e, n = new RegExp(t.source, t.flags);
43
+ return n.lastIndex = t.lastIndex, n;
44
+ }
45
+ if (t === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(e));
46
+ if (t === "[object Map]") {
47
+ let t = e, n = /* @__PURE__ */ new Map();
48
+ return t.forEach((e, t) => {
49
+ n.set(t, e);
50
+ }), n;
51
+ }
52
+ if (t === "[object Set]") {
53
+ let t = e, n = /* @__PURE__ */ new Set();
54
+ return t.forEach((e) => {
55
+ n.add(e);
56
+ }), n;
57
+ }
58
+ if (t === "[object Arguments]") {
59
+ let t = e, n = {};
60
+ return _e(n, t), n.length = t.length, n[Symbol.iterator] = t[Symbol.iterator], n;
61
+ }
62
+ let n = {};
63
+ return be(n, e), _e(n, e), ve(n, e), n;
64
+ }
65
+ function ge(e) {
66
+ switch (y(e)) {
67
+ case h:
68
+ case O:
69
+ case oe:
70
+ case g:
71
+ case _:
72
+ case T:
73
+ case re:
74
+ case p:
75
+ case w:
76
+ case ne:
77
+ case C:
78
+ case E:
79
+ case v:
80
+ case x:
81
+ case S:
82
+ case D:
83
+ case se:
84
+ case m:
85
+ case k:
86
+ case j:
87
+ case A:
88
+ case b: return !0;
89
+ default: return !1;
90
+ }
91
+ }
92
+ function _e(e, t) {
93
+ for (let n in t) Object.hasOwn(t, n) && (e[n] = t[n]);
94
+ }
95
+ function ve(e, t) {
96
+ let n = Object.getOwnPropertySymbols(t);
97
+ for (let r = 0; r < n.length; r++) {
98
+ let i = n[r];
99
+ Object.prototype.propertyIsEnumerable.call(t, i) && (e[i] = t[i]);
100
+ }
101
+ }
102
+ function ye(e, t) {
103
+ let n = t.valueOf().length;
104
+ for (let r in t) Object.hasOwn(t, r) && (Number.isNaN(Number(r)) || Number(r) >= n) && (e[r] = t[r]);
105
+ }
106
+ function be(e, t) {
107
+ let n = Object.getPrototypeOf(t);
108
+ n !== null && typeof t.constructor == "function" && Object.setPrototypeOf(e, n);
109
+ }
110
+ //#endregion
111
+ //#region ../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-677ZJIJ3.mjs
112
+ var xe = (function() {
113
+ var t = /* @__PURE__ */ e(function(e, t, n, r) {
114
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
115
+ return n;
116
+ }, "o"), n = [1, 15], r = [1, 7], i = [1, 13], a = [1, 14], o = [1, 19], s = [1, 16], c = [1, 17], l = [1, 18], u = [8, 30], d = [
117
+ 8,
118
+ 10,
119
+ 21,
120
+ 28,
121
+ 29,
122
+ 30,
123
+ 31,
124
+ 39,
125
+ 43,
126
+ 46
127
+ ], f = [1, 23], p = [1, 24], m = [
128
+ 8,
129
+ 10,
130
+ 15,
131
+ 16,
132
+ 21,
133
+ 28,
134
+ 29,
135
+ 30,
136
+ 31,
137
+ 39,
138
+ 43,
139
+ 46
140
+ ], h = [
141
+ 8,
142
+ 10,
143
+ 15,
144
+ 16,
145
+ 21,
146
+ 27,
147
+ 28,
148
+ 29,
149
+ 30,
150
+ 31,
151
+ 39,
152
+ 43,
153
+ 46
154
+ ], g = [1, 49], _ = {
155
+ trace: /* @__PURE__ */ e(function() {}, "trace"),
156
+ yy: {},
157
+ symbols_: {
158
+ error: 2,
159
+ spaceLines: 3,
160
+ SPACELINE: 4,
161
+ NL: 5,
162
+ separator: 6,
163
+ SPACE: 7,
164
+ EOF: 8,
165
+ start: 9,
166
+ BLOCK_DIAGRAM_KEY: 10,
167
+ document: 11,
168
+ stop: 12,
169
+ statement: 13,
170
+ link: 14,
171
+ LINK: 15,
172
+ START_LINK: 16,
173
+ LINK_LABEL: 17,
174
+ STR: 18,
175
+ nodeStatement: 19,
176
+ columnsStatement: 20,
177
+ SPACE_BLOCK: 21,
178
+ blockStatement: 22,
179
+ classDefStatement: 23,
180
+ cssClassStatement: 24,
181
+ styleStatement: 25,
182
+ node: 26,
183
+ SIZE: 27,
184
+ COLUMNS: 28,
185
+ "id-block": 29,
186
+ end: 30,
187
+ NODE_ID: 31,
188
+ nodeShapeNLabel: 32,
189
+ dirList: 33,
190
+ DIR: 34,
191
+ NODE_DSTART: 35,
192
+ NODE_DEND: 36,
193
+ BLOCK_ARROW_START: 37,
194
+ BLOCK_ARROW_END: 38,
195
+ classDef: 39,
196
+ CLASSDEF_ID: 40,
197
+ CLASSDEF_STYLEOPTS: 41,
198
+ DEFAULT: 42,
199
+ class: 43,
200
+ CLASSENTITY_IDS: 44,
201
+ STYLECLASS: 45,
202
+ style: 46,
203
+ STYLE_ENTITY_IDS: 47,
204
+ STYLE_DEFINITION_DATA: 48,
205
+ $accept: 0,
206
+ $end: 1
207
+ },
208
+ terminals_: {
209
+ 2: "error",
210
+ 4: "SPACELINE",
211
+ 5: "NL",
212
+ 7: "SPACE",
213
+ 8: "EOF",
214
+ 10: "BLOCK_DIAGRAM_KEY",
215
+ 15: "LINK",
216
+ 16: "START_LINK",
217
+ 17: "LINK_LABEL",
218
+ 18: "STR",
219
+ 21: "SPACE_BLOCK",
220
+ 27: "SIZE",
221
+ 28: "COLUMNS",
222
+ 29: "id-block",
223
+ 30: "end",
224
+ 31: "NODE_ID",
225
+ 34: "DIR",
226
+ 35: "NODE_DSTART",
227
+ 36: "NODE_DEND",
228
+ 37: "BLOCK_ARROW_START",
229
+ 38: "BLOCK_ARROW_END",
230
+ 39: "classDef",
231
+ 40: "CLASSDEF_ID",
232
+ 41: "CLASSDEF_STYLEOPTS",
233
+ 42: "DEFAULT",
234
+ 43: "class",
235
+ 44: "CLASSENTITY_IDS",
236
+ 45: "STYLECLASS",
237
+ 46: "style",
238
+ 47: "STYLE_ENTITY_IDS",
239
+ 48: "STYLE_DEFINITION_DATA"
240
+ },
241
+ productions_: [
242
+ 0,
243
+ [3, 1],
244
+ [3, 2],
245
+ [3, 2],
246
+ [6, 1],
247
+ [6, 1],
248
+ [6, 1],
249
+ [9, 3],
250
+ [12, 1],
251
+ [12, 1],
252
+ [12, 2],
253
+ [12, 2],
254
+ [11, 1],
255
+ [11, 2],
256
+ [14, 1],
257
+ [14, 4],
258
+ [13, 1],
259
+ [13, 1],
260
+ [13, 1],
261
+ [13, 1],
262
+ [13, 1],
263
+ [13, 1],
264
+ [13, 1],
265
+ [19, 3],
266
+ [19, 2],
267
+ [19, 1],
268
+ [20, 1],
269
+ [22, 4],
270
+ [22, 3],
271
+ [26, 1],
272
+ [26, 2],
273
+ [33, 1],
274
+ [33, 2],
275
+ [32, 3],
276
+ [32, 4],
277
+ [23, 3],
278
+ [23, 3],
279
+ [24, 3],
280
+ [25, 3]
281
+ ],
282
+ performAction: /* @__PURE__ */ e(function(e, t, n, r, i, a, o) {
283
+ var s = a.length - 1;
284
+ switch (i) {
285
+ case 4:
286
+ r.getLogger().debug("Rule: separator (NL) ");
287
+ break;
288
+ case 5:
289
+ r.getLogger().debug("Rule: separator (Space) ");
290
+ break;
291
+ case 6:
292
+ r.getLogger().debug("Rule: separator (EOF) ");
293
+ break;
294
+ case 7:
295
+ r.getLogger().debug("Rule: hierarchy: ", a[s - 1]), r.setHierarchy(a[s - 1]);
296
+ break;
297
+ case 8:
298
+ r.getLogger().debug("Stop NL ");
299
+ break;
300
+ case 9:
301
+ r.getLogger().debug("Stop EOF ");
302
+ break;
303
+ case 10:
304
+ r.getLogger().debug("Stop NL2 ");
305
+ break;
306
+ case 11:
307
+ r.getLogger().debug("Stop EOF2 ");
308
+ break;
309
+ case 12:
310
+ r.getLogger().debug("Rule: statement: ", a[s]), this.$ = typeof a[s].length == "number" ? a[s] : [a[s]];
311
+ break;
312
+ case 13:
313
+ r.getLogger().debug("Rule: statement #2: ", a[s - 1]), this.$ = [a[s - 1]].concat(a[s]);
314
+ break;
315
+ case 14:
316
+ r.getLogger().debug("Rule: link: ", a[s], e), this.$ = {
317
+ edgeTypeStr: a[s],
318
+ label: ""
319
+ };
320
+ break;
321
+ case 15:
322
+ r.getLogger().debug("Rule: LABEL link: ", a[s - 3], a[s - 1], a[s]), this.$ = {
323
+ edgeTypeStr: a[s],
324
+ label: a[s - 1]
325
+ };
326
+ break;
327
+ case 18:
328
+ let t = parseInt(a[s]), n = r.generateId();
329
+ this.$ = {
330
+ id: n,
331
+ type: "space",
332
+ label: "",
333
+ width: t,
334
+ children: []
335
+ };
336
+ break;
337
+ case 23:
338
+ r.getLogger().debug("Rule: (nodeStatement link node) ", a[s - 2], a[s - 1], a[s], " typestr: ", a[s - 1].edgeTypeStr);
339
+ let i = r.edgeStrToEdgeData(a[s - 1].edgeTypeStr), o = r.edgeStrToEdgeStartData(a[s - 1].edgeTypeStr), c = r.edgeStrToThickness(a[s - 1].edgeTypeStr), l = r.edgeStrToPattern(a[s - 1].edgeTypeStr);
340
+ this.$ = [
341
+ {
342
+ id: a[s - 2].id,
343
+ label: a[s - 2].label,
344
+ type: a[s - 2].type,
345
+ directions: a[s - 2].directions
346
+ },
347
+ {
348
+ id: a[s - 2].id + "-" + a[s].id,
349
+ start: a[s - 2].id,
350
+ end: a[s].id,
351
+ label: a[s - 1].label,
352
+ type: "edge",
353
+ thickness: c,
354
+ pattern: l,
355
+ directions: a[s].directions,
356
+ arrowTypeEnd: i,
357
+ arrowTypeStart: o
358
+ },
359
+ {
360
+ id: a[s].id,
361
+ label: a[s].label,
362
+ type: r.typeStr2Type(a[s].typeStr),
363
+ directions: a[s].directions
364
+ }
365
+ ];
366
+ break;
367
+ case 24:
368
+ r.getLogger().debug("Rule: nodeStatement (abc88 node size) ", a[s - 1], a[s]), this.$ = {
369
+ id: a[s - 1].id,
370
+ label: a[s - 1].label,
371
+ type: r.typeStr2Type(a[s - 1].typeStr),
372
+ directions: a[s - 1].directions,
373
+ widthInColumns: parseInt(a[s], 10)
374
+ };
375
+ break;
376
+ case 25:
377
+ r.getLogger().debug("Rule: nodeStatement (node) ", a[s]), this.$ = {
378
+ id: a[s].id,
379
+ label: a[s].label,
380
+ type: r.typeStr2Type(a[s].typeStr),
381
+ directions: a[s].directions,
382
+ widthInColumns: 1
383
+ };
384
+ break;
385
+ case 26:
386
+ r.getLogger().debug("APA123", this ? this : "na"), r.getLogger().debug("COLUMNS: ", a[s]), this.$ = {
387
+ type: "column-setting",
388
+ columns: a[s] === "auto" ? -1 : parseInt(a[s])
389
+ };
390
+ break;
391
+ case 27:
392
+ r.getLogger().debug("Rule: id-block statement : ", a[s - 2], a[s - 1]), r.generateId(), this.$ = {
393
+ ...a[s - 2],
394
+ type: "composite",
395
+ children: a[s - 1]
396
+ };
397
+ break;
398
+ case 28:
399
+ r.getLogger().debug("Rule: blockStatement : ", a[s - 2], a[s - 1], a[s]);
400
+ let u = r.generateId();
401
+ this.$ = {
402
+ id: u,
403
+ type: "composite",
404
+ label: "",
405
+ children: a[s - 1]
406
+ };
407
+ break;
408
+ case 29:
409
+ r.getLogger().debug("Rule: node (NODE_ID separator): ", a[s]), this.$ = { id: a[s] };
410
+ break;
411
+ case 30:
412
+ r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", a[s - 1], a[s]), this.$ = {
413
+ id: a[s - 1],
414
+ label: a[s].label,
415
+ typeStr: a[s].typeStr,
416
+ directions: a[s].directions
417
+ };
418
+ break;
419
+ case 31:
420
+ r.getLogger().debug("Rule: dirList: ", a[s]), this.$ = [a[s]];
421
+ break;
422
+ case 32:
423
+ r.getLogger().debug("Rule: dirList: ", a[s - 1], a[s]), this.$ = [a[s - 1]].concat(a[s]);
424
+ break;
425
+ case 33:
426
+ r.getLogger().debug("Rule: nodeShapeNLabel: ", a[s - 2], a[s - 1], a[s]), this.$ = {
427
+ typeStr: a[s - 2] + a[s],
428
+ label: a[s - 1]
429
+ };
430
+ break;
431
+ case 34:
432
+ r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", a[s - 3], a[s - 2], " #3:", a[s - 1], a[s]), this.$ = {
433
+ typeStr: a[s - 3] + a[s],
434
+ label: a[s - 2],
435
+ directions: a[s - 1]
436
+ };
437
+ break;
438
+ case 35:
439
+ case 36:
440
+ this.$ = {
441
+ type: "classDef",
442
+ id: a[s - 1].trim(),
443
+ css: a[s].trim()
444
+ };
445
+ break;
446
+ case 37:
447
+ this.$ = {
448
+ type: "applyClass",
449
+ id: a[s - 1].trim(),
450
+ styleClass: a[s].trim()
451
+ };
452
+ break;
453
+ case 38: this.$ = {
454
+ type: "applyStyles",
455
+ id: a[s - 1].trim(),
456
+ stylesStr: a[s].trim()
457
+ };
458
+ }
459
+ }, "anonymous"),
460
+ table: [
461
+ {
462
+ 9: 1,
463
+ 10: [1, 2]
464
+ },
465
+ { 1: [3] },
466
+ {
467
+ 10: n,
468
+ 11: 3,
469
+ 13: 4,
470
+ 19: 5,
471
+ 20: 6,
472
+ 21: r,
473
+ 22: 8,
474
+ 23: 9,
475
+ 24: 10,
476
+ 25: 11,
477
+ 26: 12,
478
+ 28: i,
479
+ 29: a,
480
+ 31: o,
481
+ 39: s,
482
+ 43: c,
483
+ 46: l
484
+ },
485
+ { 8: [1, 20] },
486
+ t(u, [2, 12], {
487
+ 13: 4,
488
+ 19: 5,
489
+ 20: 6,
490
+ 22: 8,
491
+ 23: 9,
492
+ 24: 10,
493
+ 25: 11,
494
+ 26: 12,
495
+ 11: 21,
496
+ 10: n,
497
+ 21: r,
498
+ 28: i,
499
+ 29: a,
500
+ 31: o,
501
+ 39: s,
502
+ 43: c,
503
+ 46: l
504
+ }),
505
+ t(d, [2, 16], {
506
+ 14: 22,
507
+ 15: f,
508
+ 16: p
509
+ }),
510
+ t(d, [2, 17]),
511
+ t(d, [2, 18]),
512
+ t(d, [2, 19]),
513
+ t(d, [2, 20]),
514
+ t(d, [2, 21]),
515
+ t(d, [2, 22]),
516
+ t(m, [2, 25], { 27: [1, 25] }),
517
+ t(d, [2, 26]),
518
+ {
519
+ 19: 26,
520
+ 26: 12,
521
+ 31: o
522
+ },
523
+ {
524
+ 10: n,
525
+ 11: 27,
526
+ 13: 4,
527
+ 19: 5,
528
+ 20: 6,
529
+ 21: r,
530
+ 22: 8,
531
+ 23: 9,
532
+ 24: 10,
533
+ 25: 11,
534
+ 26: 12,
535
+ 28: i,
536
+ 29: a,
537
+ 31: o,
538
+ 39: s,
539
+ 43: c,
540
+ 46: l
541
+ },
542
+ {
543
+ 40: [1, 28],
544
+ 42: [1, 29]
545
+ },
546
+ { 44: [1, 30] },
547
+ { 47: [1, 31] },
548
+ t(h, [2, 29], {
549
+ 32: 32,
550
+ 35: [1, 33],
551
+ 37: [1, 34]
552
+ }),
553
+ { 1: [2, 7] },
554
+ t(u, [2, 13]),
555
+ {
556
+ 26: 35,
557
+ 31: o
558
+ },
559
+ { 31: [2, 14] },
560
+ { 17: [1, 36] },
561
+ t(m, [2, 24]),
562
+ {
563
+ 10: n,
564
+ 11: 37,
565
+ 13: 4,
566
+ 14: 22,
567
+ 15: f,
568
+ 16: p,
569
+ 19: 5,
570
+ 20: 6,
571
+ 21: r,
572
+ 22: 8,
573
+ 23: 9,
574
+ 24: 10,
575
+ 25: 11,
576
+ 26: 12,
577
+ 28: i,
578
+ 29: a,
579
+ 31: o,
580
+ 39: s,
581
+ 43: c,
582
+ 46: l
583
+ },
584
+ { 30: [1, 38] },
585
+ { 41: [1, 39] },
586
+ { 41: [1, 40] },
587
+ { 45: [1, 41] },
588
+ { 48: [1, 42] },
589
+ t(h, [2, 30]),
590
+ { 18: [1, 43] },
591
+ { 18: [1, 44] },
592
+ t(m, [2, 23]),
593
+ { 18: [1, 45] },
594
+ { 30: [1, 46] },
595
+ t(d, [2, 28]),
596
+ t(d, [2, 35]),
597
+ t(d, [2, 36]),
598
+ t(d, [2, 37]),
599
+ t(d, [2, 38]),
600
+ { 36: [1, 47] },
601
+ {
602
+ 33: 48,
603
+ 34: g
604
+ },
605
+ { 15: [1, 50] },
606
+ t(d, [2, 27]),
607
+ t(h, [2, 33]),
608
+ { 38: [1, 51] },
609
+ {
610
+ 33: 52,
611
+ 34: g,
612
+ 38: [2, 31]
613
+ },
614
+ { 31: [2, 15] },
615
+ t(h, [2, 34]),
616
+ { 38: [2, 32] }
617
+ ],
618
+ defaultActions: {
619
+ 20: [2, 7],
620
+ 23: [2, 14],
621
+ 50: [2, 15],
622
+ 52: [2, 32]
623
+ },
624
+ parseError: /* @__PURE__ */ e(function(e, t) {
625
+ if (t.recoverable) this.trace(e);
626
+ else {
627
+ var n = Error(e);
628
+ throw n.hash = t, n;
629
+ }
630
+ }, "parseError"),
631
+ parse: /* @__PURE__ */ e(function(t) {
632
+ var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
633
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
634
+ h.setInput(t, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
635
+ var v = h.yylloc;
636
+ o.push(v);
637
+ var y = h.options && h.options.ranges;
638
+ this.parseError = typeof g.yy.parseError == "function" ? g.yy.parseError : Object.getPrototypeOf(this).parseError;
639
+ function b(e) {
640
+ r.length -= 2 * e, a.length -= e, o.length -= e;
641
+ }
642
+ e(b, "popStack");
643
+ function x() {
644
+ var e = i.pop() || h.lex() || p;
645
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
646
+ }
647
+ e(x, "lex");
648
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
649
+ if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
650
+ var M = "";
651
+ for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
652
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
653
+ text: h.match,
654
+ token: this.terminals_[S] || S,
655
+ line: h.yylineno,
656
+ loc: v,
657
+ expected: j
658
+ });
659
+ }
660
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
661
+ switch (T[0]) {
662
+ case 1:
663
+ r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
664
+ break;
665
+ case 2:
666
+ if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
667
+ first_line: o[o.length - (k || 1)].first_line,
668
+ last_line: o[o.length - 1].last_line,
669
+ first_column: o[o.length - (k || 1)].first_column,
670
+ last_column: o[o.length - 1].last_column
671
+ }, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
672
+ c,
673
+ u,
674
+ l,
675
+ g.yy,
676
+ T[1],
677
+ a,
678
+ o
679
+ ].concat(m)), E !== void 0) return E;
680
+ k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
681
+ break;
682
+ case 3: return !0;
683
+ }
684
+ }
685
+ return !0;
686
+ }, "parse")
687
+ };
688
+ _.lexer = /* @__PURE__ */ (function() {
689
+ return {
690
+ EOF: 1,
691
+ parseError: /* @__PURE__ */ e(function(e, t) {
692
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
693
+ else throw Error(e);
694
+ }, "parseError"),
695
+ setInput: /* @__PURE__ */ e(function(e, t) {
696
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
697
+ first_line: 1,
698
+ first_column: 0,
699
+ last_line: 1,
700
+ last_column: 0
701
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
702
+ }, "setInput"),
703
+ input: /* @__PURE__ */ e(function() {
704
+ var e = this._input[0];
705
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
706
+ }, "input"),
707
+ unput: /* @__PURE__ */ e(function(e) {
708
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
709
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
710
+ var r = this.match.split(/(?:\r\n?|\n)/g);
711
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
712
+ var i = this.yylloc.range;
713
+ return this.yylloc = {
714
+ first_line: this.yylloc.first_line,
715
+ last_line: this.yylineno + 1,
716
+ first_column: this.yylloc.first_column,
717
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
718
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
719
+ }, "unput"),
720
+ more: /* @__PURE__ */ e(function() {
721
+ return this._more = !0, this;
722
+ }, "more"),
723
+ reject: /* @__PURE__ */ e(function() {
724
+ if (this.options.backtrack_lexer) this._backtrack = !0;
725
+ else 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).\n" + this.showPosition(), {
726
+ text: "",
727
+ token: null,
728
+ line: this.yylineno
729
+ });
730
+ return this;
731
+ }, "reject"),
732
+ less: /* @__PURE__ */ e(function(e) {
733
+ this.unput(this.match.slice(e));
734
+ }, "less"),
735
+ pastInput: /* @__PURE__ */ e(function() {
736
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
737
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
738
+ }, "pastInput"),
739
+ upcomingInput: /* @__PURE__ */ e(function() {
740
+ var e = this.match;
741
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
742
+ }, "upcomingInput"),
743
+ showPosition: /* @__PURE__ */ e(function() {
744
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
745
+ return e + this.upcomingInput() + "\n" + t + "^";
746
+ }, "showPosition"),
747
+ test_match: /* @__PURE__ */ e(function(e, t) {
748
+ var n, r, i;
749
+ if (this.options.backtrack_lexer && (i = {
750
+ yylineno: this.yylineno,
751
+ yylloc: {
752
+ first_line: this.yylloc.first_line,
753
+ last_line: this.last_line,
754
+ first_column: this.yylloc.first_column,
755
+ last_column: this.yylloc.last_column
756
+ },
757
+ yytext: this.yytext,
758
+ match: this.match,
759
+ matches: this.matches,
760
+ matched: this.matched,
761
+ yyleng: this.yyleng,
762
+ offset: this.offset,
763
+ _more: this._more,
764
+ _input: this._input,
765
+ yy: this.yy,
766
+ conditionStack: this.conditionStack.slice(0),
767
+ done: this.done
768
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
769
+ first_line: this.yylloc.last_line,
770
+ last_line: this.yylineno + 1,
771
+ first_column: this.yylloc.last_column,
772
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
773
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
774
+ if (this._backtrack) {
775
+ for (var a in i) this[a] = i[a];
776
+ return !1;
777
+ }
778
+ return !1;
779
+ }, "test_match"),
780
+ next: /* @__PURE__ */ e(function() {
781
+ if (this.done) return this.EOF;
782
+ this._input || (this.done = !0);
783
+ var e, t, n, r;
784
+ this._more || (this.yytext = "", this.match = "");
785
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
786
+ if (t = n, r = a, this.options.backtrack_lexer) {
787
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
788
+ if (this._backtrack) {
789
+ t = !1;
790
+ continue;
791
+ }
792
+ return !1;
793
+ }
794
+ if (!this.options.flex) break;
795
+ }
796
+ return t ? (e = this.test_match(t, i[r]), e !== !1 && e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
797
+ text: "",
798
+ token: null,
799
+ line: this.yylineno
800
+ });
801
+ }, "next"),
802
+ lex: /* @__PURE__ */ e(function() {
803
+ return this.next() || this.lex();
804
+ }, "lex"),
805
+ begin: /* @__PURE__ */ e(function(e) {
806
+ this.conditionStack.push(e);
807
+ }, "begin"),
808
+ popState: /* @__PURE__ */ e(function() {
809
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
810
+ }, "popState"),
811
+ _currentRules: /* @__PURE__ */ e(function() {
812
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
813
+ }, "_currentRules"),
814
+ topState: /* @__PURE__ */ e(function(e) {
815
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
816
+ }, "topState"),
817
+ pushState: /* @__PURE__ */ e(function(e) {
818
+ this.begin(e);
819
+ }, "pushState"),
820
+ stateStackSize: /* @__PURE__ */ e(function() {
821
+ return this.conditionStack.length;
822
+ }, "stateStackSize"),
823
+ options: {},
824
+ performAction: /* @__PURE__ */ e(function(e, t, n, r) {
825
+ switch (n) {
826
+ case 0: return e.getLogger().debug("Found block-beta"), 10;
827
+ case 1: return e.getLogger().debug("Found id-block"), 29;
828
+ case 2: return e.getLogger().debug("Found block"), 10;
829
+ case 3:
830
+ e.getLogger().debug(".", t.yytext);
831
+ break;
832
+ case 4:
833
+ e.getLogger().debug("_", t.yytext);
834
+ break;
835
+ case 5: return 5;
836
+ case 6: return t.yytext = -1, 28;
837
+ case 7: return t.yytext = t.yytext.replace(/columns\s+/, ""), e.getLogger().debug("COLUMNS (LEX)", t.yytext), 28;
838
+ case 8:
839
+ this.pushState("md_string");
840
+ break;
841
+ case 9: return "MD_STR";
842
+ case 10:
843
+ this.popState();
844
+ break;
845
+ case 11:
846
+ this.pushState("string");
847
+ break;
848
+ case 12:
849
+ e.getLogger().debug("LEX: POPPING STR:", t.yytext), this.popState();
850
+ break;
851
+ case 13: return e.getLogger().debug("LEX: STR end:", t.yytext), "STR";
852
+ case 14: return t.yytext = t.yytext.replace(/space\:/, ""), e.getLogger().debug("SPACE NUM (LEX)", t.yytext), 21;
853
+ case 15: return t.yytext = "1", e.getLogger().debug("COLUMNS (LEX)", t.yytext), 21;
854
+ case 16: return 42;
855
+ case 17: return "LINKSTYLE";
856
+ case 18: return "INTERPOLATE";
857
+ case 19: return this.pushState("CLASSDEF"), 39;
858
+ case 20: return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
859
+ case 21: return this.popState(), this.pushState("CLASSDEFID"), 40;
860
+ case 22: return this.popState(), 41;
861
+ case 23: return this.pushState("CLASS"), 43;
862
+ case 24: return this.popState(), this.pushState("CLASS_STYLE"), 44;
863
+ case 25: return this.popState(), 45;
864
+ case 26: return this.pushState("STYLE_STMNT"), 46;
865
+ case 27: return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
866
+ case 28: return this.popState(), 48;
867
+ case 29: return this.pushState("acc_title"), "acc_title";
868
+ case 30: return this.popState(), "acc_title_value";
869
+ case 31: return this.pushState("acc_descr"), "acc_descr";
870
+ case 32: return this.popState(), "acc_descr_value";
871
+ case 33:
872
+ this.pushState("acc_descr_multiline");
873
+ break;
874
+ case 34:
875
+ this.popState();
876
+ break;
877
+ case 35: return "acc_descr_multiline_value";
878
+ case 36: return 30;
879
+ case 37: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
880
+ case 38: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
881
+ case 39: return this.popState(), e.getLogger().debug("Lex: ))"), "NODE_DEND";
882
+ case 40: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
883
+ case 41: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
884
+ case 42: return this.popState(), e.getLogger().debug("Lex: (-"), "NODE_DEND";
885
+ case 43: return this.popState(), e.getLogger().debug("Lex: -)"), "NODE_DEND";
886
+ case 44: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
887
+ case 45: return this.popState(), e.getLogger().debug("Lex: ]]"), "NODE_DEND";
888
+ case 46: return this.popState(), e.getLogger().debug("Lex: ("), "NODE_DEND";
889
+ case 47: return this.popState(), e.getLogger().debug("Lex: ])"), "NODE_DEND";
890
+ case 48: return this.popState(), e.getLogger().debug("Lex: /]"), "NODE_DEND";
891
+ case 49: return this.popState(), e.getLogger().debug("Lex: /]"), "NODE_DEND";
892
+ case 50: return this.popState(), e.getLogger().debug("Lex: )]"), "NODE_DEND";
893
+ case 51: return this.popState(), e.getLogger().debug("Lex: )"), "NODE_DEND";
894
+ case 52: return this.popState(), e.getLogger().debug("Lex: ]>"), "NODE_DEND";
895
+ case 53: return this.popState(), e.getLogger().debug("Lex: ]"), "NODE_DEND";
896
+ case 54: return e.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
897
+ case 55: return e.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
898
+ case 56: return e.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
899
+ case 57: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
900
+ case 58: return e.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
901
+ case 59: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
902
+ case 60: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
903
+ case 61: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
904
+ case 62: return e.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
905
+ case 63: return e.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
906
+ case 64: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
907
+ case 65: return this.pushState("NODE"), 35;
908
+ case 66: return this.pushState("NODE"), 35;
909
+ case 67: return this.pushState("NODE"), 35;
910
+ case 68: return this.pushState("NODE"), 35;
911
+ case 69: return this.pushState("NODE"), 35;
912
+ case 70: return this.pushState("NODE"), 35;
913
+ case 71: return this.pushState("NODE"), 35;
914
+ case 72: return e.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
915
+ case 73: return this.pushState("BLOCK_ARROW"), e.getLogger().debug("LEX ARR START"), 37;
916
+ case 74: return e.getLogger().debug("Lex: NODE_ID", t.yytext), 31;
917
+ case 75: return e.getLogger().debug("Lex: EOF", t.yytext), 8;
918
+ case 76:
919
+ this.pushState("md_string");
920
+ break;
921
+ case 77:
922
+ this.pushState("md_string");
923
+ break;
924
+ case 78: return "NODE_DESCR";
925
+ case 79:
926
+ this.popState();
927
+ break;
928
+ case 80:
929
+ e.getLogger().debug("Lex: Starting string"), this.pushState("string");
930
+ break;
931
+ case 81:
932
+ e.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
933
+ break;
934
+ case 82: return e.getLogger().debug("LEX: NODE_DESCR:", t.yytext), "NODE_DESCR";
935
+ case 83:
936
+ e.getLogger().debug("LEX POPPING"), this.popState();
937
+ break;
938
+ case 84:
939
+ e.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
940
+ break;
941
+ case 85: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (right): dir:", t.yytext), "DIR";
942
+ case 86: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (left):", t.yytext), "DIR";
943
+ case 87: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (x):", t.yytext), "DIR";
944
+ case 88: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (y):", t.yytext), "DIR";
945
+ case 89: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (up):", t.yytext), "DIR";
946
+ case 90: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (down):", t.yytext), "DIR";
947
+ case 91: return t.yytext = "]>", e.getLogger().debug("Lex (ARROW_DIR end):", t.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
948
+ case 92: return e.getLogger().debug("Lex: LINK", "#" + t.yytext + "#"), 15;
949
+ case 93: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
950
+ case 94: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
951
+ case 95: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
952
+ case 96: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
953
+ case 97: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
954
+ case 98: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
955
+ case 99:
956
+ this.pushState("md_string");
957
+ break;
958
+ case 100: return e.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
959
+ case 101: return this.popState(), e.getLogger().debug("Lex: LINK", "#" + t.yytext + "#"), 15;
960
+ case 102: return this.popState(), e.getLogger().debug("Lex: LINK", t.yytext), 15;
961
+ case 103: return this.popState(), e.getLogger().debug("Lex: LINK", t.yytext), 15;
962
+ case 104: return e.getLogger().debug("Lex: COLON", t.yytext), t.yytext = t.yytext.slice(1), 27;
963
+ }
964
+ }, "anonymous"),
965
+ rules: [
966
+ /^(?:block-beta\b)/,
967
+ /^(?:block:)/,
968
+ /^(?:block\b)/,
969
+ /^(?:[\s]+)/,
970
+ /^(?:[\n]+)/,
971
+ /^(?:((\u000D\u000A)|(\u000A)))/,
972
+ /^(?:columns\s+auto\b)/,
973
+ /^(?:columns\s+[\d]+)/,
974
+ /^(?:["][`])/,
975
+ /^(?:[^`"]+)/,
976
+ /^(?:[`]["])/,
977
+ /^(?:["])/,
978
+ /^(?:["])/,
979
+ /^(?:[^"]*)/,
980
+ /^(?:space[:]\d+)/,
981
+ /^(?:space\b)/,
982
+ /^(?:default\b)/,
983
+ /^(?:linkStyle\b)/,
984
+ /^(?:interpolate\b)/,
985
+ /^(?:classDef\s+)/,
986
+ /^(?:DEFAULT\s+)/,
987
+ /^(?:\w+\s+)/,
988
+ /^(?:[^\n]*)/,
989
+ /^(?:class\s+)/,
990
+ /^(?:(\w+)+((,\s*\w+)*))/,
991
+ /^(?:[^\n]*)/,
992
+ /^(?:style\s+)/,
993
+ /^(?:(\w+)+((,\s*\w+)*))/,
994
+ /^(?:[^\n]*)/,
995
+ /^(?:accTitle\s*:\s*)/,
996
+ /^(?:(?!\n||)*[^\n]*)/,
997
+ /^(?:accDescr\s*:\s*)/,
998
+ /^(?:(?!\n||)*[^\n]*)/,
999
+ /^(?:accDescr\s*\{\s*)/,
1000
+ /^(?:[\}])/,
1001
+ /^(?:[^\}]*)/,
1002
+ /^(?:end\b\s*)/,
1003
+ /^(?:\(\(\()/,
1004
+ /^(?:\)\)\))/,
1005
+ /^(?:[\)]\))/,
1006
+ /^(?:\}\})/,
1007
+ /^(?:\})/,
1008
+ /^(?:\(-)/,
1009
+ /^(?:-\))/,
1010
+ /^(?:\(\()/,
1011
+ /^(?:\]\])/,
1012
+ /^(?:\()/,
1013
+ /^(?:\]\))/,
1014
+ /^(?:\\\])/,
1015
+ /^(?:\/\])/,
1016
+ /^(?:\)\])/,
1017
+ /^(?:[\)])/,
1018
+ /^(?:\]>)/,
1019
+ /^(?:[\]])/,
1020
+ /^(?:-\))/,
1021
+ /^(?:\(-)/,
1022
+ /^(?:\)\))/,
1023
+ /^(?:\))/,
1024
+ /^(?:\(\(\()/,
1025
+ /^(?:\(\()/,
1026
+ /^(?:\{\{)/,
1027
+ /^(?:\{)/,
1028
+ /^(?:>)/,
1029
+ /^(?:\(\[)/,
1030
+ /^(?:\()/,
1031
+ /^(?:\[\[)/,
1032
+ /^(?:\[\|)/,
1033
+ /^(?:\[\()/,
1034
+ /^(?:\)\)\))/,
1035
+ /^(?:\[\\)/,
1036
+ /^(?:\[\/)/,
1037
+ /^(?:\[\\)/,
1038
+ /^(?:\[)/,
1039
+ /^(?:<\[)/,
1040
+ /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,
1041
+ /^(?:$)/,
1042
+ /^(?:["][`])/,
1043
+ /^(?:["][`])/,
1044
+ /^(?:[^`"]+)/,
1045
+ /^(?:[`]["])/,
1046
+ /^(?:["])/,
1047
+ /^(?:["])/,
1048
+ /^(?:[^"]+)/,
1049
+ /^(?:["])/,
1050
+ /^(?:\]>\s*\()/,
1051
+ /^(?:,?\s*right\s*)/,
1052
+ /^(?:,?\s*left\s*)/,
1053
+ /^(?:,?\s*x\s*)/,
1054
+ /^(?:,?\s*y\s*)/,
1055
+ /^(?:,?\s*up\s*)/,
1056
+ /^(?:,?\s*down\s*)/,
1057
+ /^(?:\)\s*)/,
1058
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1059
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1060
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1061
+ /^(?:\s*~~[\~]+\s*)/,
1062
+ /^(?:\s*[xo<]?--\s*)/,
1063
+ /^(?:\s*[xo<]?==\s*)/,
1064
+ /^(?:\s*[xo<]?-\.\s*)/,
1065
+ /^(?:["][`])/,
1066
+ /^(?:["])/,
1067
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1068
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1069
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1070
+ /^(?::\d+)/
1071
+ ],
1072
+ conditions: {
1073
+ STYLE_DEFINITION: {
1074
+ rules: [28],
1075
+ inclusive: !1
1076
+ },
1077
+ STYLE_STMNT: {
1078
+ rules: [27],
1079
+ inclusive: !1
1080
+ },
1081
+ CLASSDEFID: {
1082
+ rules: [22],
1083
+ inclusive: !1
1084
+ },
1085
+ CLASSDEF: {
1086
+ rules: [20, 21],
1087
+ inclusive: !1
1088
+ },
1089
+ CLASS_STYLE: {
1090
+ rules: [25],
1091
+ inclusive: !1
1092
+ },
1093
+ CLASS: {
1094
+ rules: [24],
1095
+ inclusive: !1
1096
+ },
1097
+ LLABEL: {
1098
+ rules: [
1099
+ 99,
1100
+ 100,
1101
+ 101,
1102
+ 102,
1103
+ 103
1104
+ ],
1105
+ inclusive: !1
1106
+ },
1107
+ ARROW_DIR: {
1108
+ rules: [
1109
+ 85,
1110
+ 86,
1111
+ 87,
1112
+ 88,
1113
+ 89,
1114
+ 90,
1115
+ 91
1116
+ ],
1117
+ inclusive: !1
1118
+ },
1119
+ BLOCK_ARROW: {
1120
+ rules: [
1121
+ 76,
1122
+ 81,
1123
+ 84
1124
+ ],
1125
+ inclusive: !1
1126
+ },
1127
+ NODE: {
1128
+ rules: [
1129
+ 37,
1130
+ 38,
1131
+ 39,
1132
+ 40,
1133
+ 41,
1134
+ 42,
1135
+ 43,
1136
+ 44,
1137
+ 45,
1138
+ 46,
1139
+ 47,
1140
+ 48,
1141
+ 49,
1142
+ 50,
1143
+ 51,
1144
+ 52,
1145
+ 53,
1146
+ 77,
1147
+ 80
1148
+ ],
1149
+ inclusive: !1
1150
+ },
1151
+ md_string: {
1152
+ rules: [
1153
+ 9,
1154
+ 10,
1155
+ 78,
1156
+ 79
1157
+ ],
1158
+ inclusive: !1
1159
+ },
1160
+ space: {
1161
+ rules: [],
1162
+ inclusive: !1
1163
+ },
1164
+ string: {
1165
+ rules: [
1166
+ 12,
1167
+ 13,
1168
+ 82,
1169
+ 83
1170
+ ],
1171
+ inclusive: !1
1172
+ },
1173
+ acc_descr_multiline: {
1174
+ rules: [34, 35],
1175
+ inclusive: !1
1176
+ },
1177
+ acc_descr: {
1178
+ rules: [32],
1179
+ inclusive: !1
1180
+ },
1181
+ acc_title: {
1182
+ rules: [30],
1183
+ inclusive: !1
1184
+ },
1185
+ INITIAL: {
1186
+ rules: [
1187
+ 0,
1188
+ 1,
1189
+ 2,
1190
+ 3,
1191
+ 4,
1192
+ 5,
1193
+ 6,
1194
+ 7,
1195
+ 8,
1196
+ 11,
1197
+ 14,
1198
+ 15,
1199
+ 16,
1200
+ 17,
1201
+ 18,
1202
+ 19,
1203
+ 23,
1204
+ 26,
1205
+ 29,
1206
+ 31,
1207
+ 33,
1208
+ 36,
1209
+ 54,
1210
+ 55,
1211
+ 56,
1212
+ 57,
1213
+ 58,
1214
+ 59,
1215
+ 60,
1216
+ 61,
1217
+ 62,
1218
+ 63,
1219
+ 64,
1220
+ 65,
1221
+ 66,
1222
+ 67,
1223
+ 68,
1224
+ 69,
1225
+ 70,
1226
+ 71,
1227
+ 72,
1228
+ 73,
1229
+ 74,
1230
+ 75,
1231
+ 92,
1232
+ 93,
1233
+ 94,
1234
+ 95,
1235
+ 96,
1236
+ 97,
1237
+ 98,
1238
+ 104
1239
+ ],
1240
+ inclusive: !0
1241
+ }
1242
+ }
1243
+ };
1244
+ })();
1245
+ function v() {
1246
+ this.yy = {};
1247
+ }
1248
+ return e(v, "Parser"), v.prototype = _, _.Parser = v, new v();
1249
+ })();
1250
+ xe.parser = xe;
1251
+ var Se = xe, I = /* @__PURE__ */ new Map(), Ce = [], we = /* @__PURE__ */ new Map(), Te = "color", Ee = "fill", De = "bgFill", Oe = ",", L = /* @__PURE__ */ new Map(), ke = "", Ae = /* @__PURE__ */ e((e) => l.sanitizeText(e, u()), "sanitizeText"), je = /* @__PURE__ */ e(function(e, t = "") {
1252
+ let n = L.get(e);
1253
+ n || (n = {
1254
+ id: e,
1255
+ styles: [],
1256
+ textStyles: []
1257
+ }, L.set(e, n)), t?.split(Oe).forEach((e) => {
1258
+ let t = e.replace(/([^;]*);/, "$1").trim();
1259
+ if (RegExp(Te).exec(e)) {
1260
+ let e = t.replace(Ee, De).replace(Te, Ee);
1261
+ n.textStyles.push(e);
1262
+ }
1263
+ n.styles.push(t);
1264
+ });
1265
+ }, "addStyleClass"), Me = /* @__PURE__ */ e(function(e, t = "") {
1266
+ let n = I.get(e);
1267
+ t != null && (n.styles = t.split(Oe));
1268
+ }, "addStyle2Node"), Ne = /* @__PURE__ */ e(function(e, t) {
1269
+ e.split(",").forEach(function(e) {
1270
+ let n = I.get(e);
1271
+ if (n === void 0) {
1272
+ let t = e.trim();
1273
+ n = {
1274
+ id: t,
1275
+ type: "na",
1276
+ children: []
1277
+ }, I.set(t, n);
1278
+ }
1279
+ n.classes || (n.classes = []), n.classes.push(t);
1280
+ });
1281
+ }, "setCssClass"), Pe = /* @__PURE__ */ e((e, n) => {
1282
+ let r = e.flat(), i = [], a = r.find((e) => e?.type === "column-setting")?.columns ?? -1;
1283
+ for (let e of r) {
1284
+ if (typeof a == "number" && a > 0 && e.type !== "column-setting" && typeof e.widthInColumns == "number" && e.widthInColumns > a && t.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${a}`), e.label &&= Ae(e.label), e.type === "classDef") {
1285
+ je(e.id, e.css);
1286
+ continue;
1287
+ }
1288
+ if (e.type === "applyClass") {
1289
+ Ne(e.id, e?.styleClass ?? "");
1290
+ continue;
1291
+ }
1292
+ if (e.type === "applyStyles") {
1293
+ e?.stylesStr && Me(e.id, e?.stylesStr);
1294
+ continue;
1295
+ }
1296
+ if (e.type === "column-setting") n.columns = e.columns ?? -1;
1297
+ else if (e.type === "edge") {
1298
+ let t = (we.get(e.id) ?? 0) + 1;
1299
+ we.set(e.id, t), e.id = t + "-" + e.id, Ce.push(e);
1300
+ } else {
1301
+ e.label ||= e.type === "composite" ? "" : e.id;
1302
+ let t = I.get(e.id);
1303
+ if (t === void 0 ? I.set(e.id, e) : (e.type !== "na" && (t.type = e.type), e.label !== e.id && (t.label = e.label)), e.children && Pe(e.children, e), e.type === "space") {
1304
+ let t = e.width ?? 1;
1305
+ for (let n = 0; n < t; n++) {
1306
+ let t = he(e);
1307
+ t.id = t.id + "-" + n, I.set(t.id, t), i.push(t);
1308
+ }
1309
+ } else t === void 0 && i.push(e);
1310
+ }
1311
+ }
1312
+ n.children = i;
1313
+ }, "populateBlockDatabase"), Fe = [], R = {
1314
+ id: "root",
1315
+ type: "composite",
1316
+ children: [],
1317
+ columns: -1
1318
+ }, Ie = /* @__PURE__ */ e(() => {
1319
+ t.debug("Clear called"), a(), R = {
1320
+ id: "root",
1321
+ type: "composite",
1322
+ children: [],
1323
+ columns: -1
1324
+ }, I = /* @__PURE__ */ new Map([["root", R]]), Fe = [], L = /* @__PURE__ */ new Map(), Ce = [], we = /* @__PURE__ */ new Map(), ke = "";
1325
+ }, "clear");
1326
+ function Le(e) {
1327
+ switch (t.debug("typeStr2Type", e), e) {
1328
+ case "[]": return "square";
1329
+ case "()": return t.debug("we have a round"), "round";
1330
+ case "(())": return "circle";
1331
+ case ">]": return "rect_left_inv_arrow";
1332
+ case "{}": return "diamond";
1333
+ case "{{}}": return "hexagon";
1334
+ case "([])": return "stadium";
1335
+ case "[[]]": return "subroutine";
1336
+ case "[()]": return "cylinder";
1337
+ case "((()))": return "doublecircle";
1338
+ case "[//]": return "lean_right";
1339
+ case "[\\\\]": return "lean_left";
1340
+ case "[/\\]": return "trapezoid";
1341
+ case "[\\/]": return "inv_trapezoid";
1342
+ case "<[]>": return "block_arrow";
1343
+ default: return "na";
1344
+ }
1345
+ }
1346
+ e(Le, "typeStr2Type");
1347
+ function Re(e) {
1348
+ switch (t.debug("typeStr2Type", e), e) {
1349
+ case "==": return "thick";
1350
+ default: return "normal";
1351
+ }
1352
+ }
1353
+ e(Re, "edgeTypeStr2Type");
1354
+ function ze(e) {
1355
+ switch (e.trim().slice(-1)) {
1356
+ case "x": return "arrow_cross";
1357
+ case "o": return "arrow_circle";
1358
+ case ">": return "arrow_point";
1359
+ default: return "";
1360
+ }
1361
+ }
1362
+ e(ze, "edgeStrToEdgeData");
1363
+ function Be(e) {
1364
+ switch (e.trim().charAt(0)) {
1365
+ case "x": return "arrow_cross";
1366
+ case "o": return "arrow_circle";
1367
+ case "<": return "arrow_point";
1368
+ default: return "arrow_open";
1369
+ }
1370
+ }
1371
+ e(Be, "edgeStrToEdgeStartData");
1372
+ function Ve(e) {
1373
+ return e.includes("==") ? "thick" : "normal";
1374
+ }
1375
+ e(Ve, "edgeStrToThickness");
1376
+ function He(e) {
1377
+ return e.includes(".-") ? "dotted" : "solid";
1378
+ }
1379
+ e(He, "edgeStrToPattern");
1380
+ var Ue = 0, We = {
1381
+ getConfig: /* @__PURE__ */ e(() => o().block, "getConfig"),
1382
+ typeStr2Type: Le,
1383
+ edgeTypeStr2Type: Re,
1384
+ edgeStrToEdgeData: ze,
1385
+ edgeStrToEdgeStartData: Be,
1386
+ edgeStrToThickness: Ve,
1387
+ edgeStrToPattern: He,
1388
+ getLogger: /* @__PURE__ */ e(() => t, "getLogger"),
1389
+ getBlocksFlat: /* @__PURE__ */ e(() => [...I.values()], "getBlocksFlat"),
1390
+ getBlocks: /* @__PURE__ */ e(() => Fe || [], "getBlocks"),
1391
+ getEdges: /* @__PURE__ */ e(() => Ce, "getEdges"),
1392
+ setHierarchy: /* @__PURE__ */ e((e) => {
1393
+ R.children = e, Pe(e, R), Fe = R.children;
1394
+ }, "setHierarchy"),
1395
+ getBlock: /* @__PURE__ */ e((e) => I.get(e), "getBlock"),
1396
+ setBlock: /* @__PURE__ */ e((e) => {
1397
+ I.set(e.id, e);
1398
+ }, "setBlock"),
1399
+ getColumns: /* @__PURE__ */ e((e) => {
1400
+ let t = I.get(e);
1401
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
1402
+ }, "getColumns"),
1403
+ getClasses: /* @__PURE__ */ e(function() {
1404
+ return L;
1405
+ }, "getClasses"),
1406
+ clear: Ie,
1407
+ generateId: /* @__PURE__ */ e(() => (Ue++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Ue), "generateId"),
1408
+ setDiagramId: /* @__PURE__ */ e((e) => {
1409
+ ke = e;
1410
+ }, "setDiagramId"),
1411
+ getDiagramId: /* @__PURE__ */ e(() => ke, "getDiagramId")
1412
+ }, z = /* @__PURE__ */ e((e, t) => {
1413
+ let n = f, r = n(e, "r"), i = n(e, "g"), a = n(e, "b");
1414
+ return c(r, i, a, t);
1415
+ }, "fade"), Ge = /* @__PURE__ */ e((e) => `.label {
1416
+ font-family: ${e.fontFamily};
1417
+ color: ${e.nodeTextColor || e.textColor};
1418
+ }
1419
+ .cluster-label text {
1420
+ fill: ${e.titleColor};
1421
+ }
1422
+ .cluster-label span,p {
1423
+ color: ${e.titleColor};
1424
+ }
1425
+
1426
+
1427
+
1428
+ .label text,span,p {
1429
+ fill: ${e.nodeTextColor || e.textColor};
1430
+ color: ${e.nodeTextColor || e.textColor};
1431
+ }
1432
+
1433
+ .node rect,
1434
+ .node circle,
1435
+ .node ellipse,
1436
+ .node polygon,
1437
+ .node path {
1438
+ fill: ${e.mainBkg};
1439
+ stroke: ${e.nodeBorder};
1440
+ stroke-width: 1px;
1441
+ }
1442
+ .flowchart-label text {
1443
+ text-anchor: middle;
1444
+ }
1445
+ // .flowchart-label .text-outer-tspan {
1446
+ // text-anchor: middle;
1447
+ // }
1448
+ // .flowchart-label .text-inner-tspan {
1449
+ // text-anchor: start;
1450
+ // }
1451
+
1452
+ .node .label {
1453
+ text-align: center;
1454
+ }
1455
+ .node.clickable {
1456
+ cursor: pointer;
1457
+ }
1458
+
1459
+ .arrowheadPath {
1460
+ fill: ${e.arrowheadColor};
1461
+ }
1462
+
1463
+ .edgePath .path {
1464
+ stroke: ${e.lineColor};
1465
+ stroke-width: 2.0px;
1466
+ }
1467
+
1468
+ .flowchart-link {
1469
+ stroke: ${e.lineColor};
1470
+ fill: none;
1471
+ }
1472
+
1473
+ .edgeLabel {
1474
+ background-color: ${e.edgeLabelBackground};
1475
+ /*
1476
+ * This is for backward compatibility with existing code that didn't
1477
+ * add a \`<p>\` around edge labels.
1478
+ *
1479
+ * TODO: We should probably remove this in a future release.
1480
+ */
1481
+ p {
1482
+ margin: 0;
1483
+ padding: 0;
1484
+ display: inline;
1485
+ }
1486
+ rect {
1487
+ opacity: 0.5;
1488
+ background-color: ${e.edgeLabelBackground};
1489
+ fill: ${e.edgeLabelBackground};
1490
+ }
1491
+ text-align: center;
1492
+ }
1493
+
1494
+ /* For html labels only */
1495
+ .labelBkg {
1496
+ background-color: ${e.edgeLabelBackground};
1497
+ }
1498
+
1499
+ .node .cluster {
1500
+ // fill: ${z(e.mainBkg, .5)};
1501
+ fill: ${z(e.clusterBkg, .5)};
1502
+ stroke: ${z(e.clusterBorder, .2)};
1503
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
1504
+ stroke-width: 1px;
1505
+ }
1506
+
1507
+ .cluster text {
1508
+ fill: ${e.titleColor};
1509
+ }
1510
+
1511
+ .cluster span,p {
1512
+ color: ${e.titleColor};
1513
+ }
1514
+ /* .cluster div {
1515
+ color: ${e.titleColor};
1516
+ } */
1517
+
1518
+ div.mermaidTooltip {
1519
+ position: absolute;
1520
+ text-align: center;
1521
+ max-width: 200px;
1522
+ padding: 2px;
1523
+ font-family: ${e.fontFamily};
1524
+ font-size: 12px;
1525
+ background: ${e.tertiaryColor};
1526
+ border: 1px solid ${e.border2};
1527
+ border-radius: 2px;
1528
+ pointer-events: none;
1529
+ z-index: 100;
1530
+ }
1531
+
1532
+ .flowchartTitleText {
1533
+ text-anchor: middle;
1534
+ font-size: 18px;
1535
+ fill: ${e.textColor};
1536
+ }
1537
+ ${le()}
1538
+ `, "getStyles"), Ke = /* @__PURE__ */ e((e, t, n, r) => {
1539
+ t.forEach((t) => {
1540
+ qe[t](e, n, r);
1541
+ });
1542
+ }, "insertMarkers"), qe = {
1543
+ extension: /* @__PURE__ */ e((e, n, r) => {
1544
+ t.trace("Making markers for ", r), e.append("defs").append("marker").attr("id", r + "_" + n + "-extensionStart").attr("class", "marker extension " + n).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", r + "_" + n + "-extensionEnd").attr("class", "marker extension " + n).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");
1545
+ }, "extension"),
1546
+ composition: /* @__PURE__ */ e((e, t, n) => {
1547
+ e.append("defs").append("marker").attr("id", n + "_" + 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", n + "_" + 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");
1548
+ }, "composition"),
1549
+ aggregation: /* @__PURE__ */ e((e, t, n) => {
1550
+ e.append("defs").append("marker").attr("id", n + "_" + 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", n + "_" + 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");
1551
+ }, "aggregation"),
1552
+ dependency: /* @__PURE__ */ e((e, t, n) => {
1553
+ e.append("defs").append("marker").attr("id", n + "_" + 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", n + "_" + 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");
1554
+ }, "dependency"),
1555
+ lollipop: /* @__PURE__ */ e((e, t, n) => {
1556
+ e.append("defs").append("marker").attr("id", n + "_" + 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", n + "_" + 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);
1557
+ }, "lollipop"),
1558
+ point: /* @__PURE__ */ e((e, t, n) => {
1559
+ e.append("marker").attr("id", n + "_" + 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", n + "_" + 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");
1560
+ }, "point"),
1561
+ circle: /* @__PURE__ */ e((e, t, n) => {
1562
+ e.append("marker").attr("id", n + "_" + 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", n + "_" + 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");
1563
+ }, "circle"),
1564
+ cross: /* @__PURE__ */ e((e, t, n) => {
1565
+ e.append("marker").attr("id", n + "_" + 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", n + "_" + 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");
1566
+ }, "cross"),
1567
+ barb: /* @__PURE__ */ e((e, t, n) => {
1568
+ e.append("defs").append("marker").attr("id", n + "_" + 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");
1569
+ }, "barb")
1570
+ }, Je = Ke;
1571
+ function B(e, t) {
1572
+ if (e === 0 || !Number.isInteger(e)) throw Error("Columns must be an integer !== 0.");
1573
+ if (t < 0 || !Number.isInteger(t)) throw Error("Position must be a non-negative integer." + t);
1574
+ return e < 0 ? {
1575
+ px: t,
1576
+ py: 0
1577
+ } : e === 1 ? {
1578
+ px: 0,
1579
+ py: t
1580
+ } : {
1581
+ px: t % e,
1582
+ py: Math.floor(t / e)
1583
+ };
1584
+ }
1585
+ e(B, "calculateBlockPosition");
1586
+ var Ye = /* @__PURE__ */ e((e) => {
1587
+ let n = 0, r = 0;
1588
+ for (let i of e.children) {
1589
+ let { width: e, height: a, x: o, y: s } = i.size ?? {
1590
+ width: 0,
1591
+ height: 0,
1592
+ x: 0,
1593
+ y: 0
1594
+ };
1595
+ if (t.debug("getMaxChildSize abc95 child:", i.id, "width:", e, "height:", a, "x:", o, "y:", s, i.type), i.type === "space") continue;
1596
+ let c = e / (i.widthInColumns ?? 1);
1597
+ c > n && (n = c), a > r && (r = a);
1598
+ }
1599
+ return {
1600
+ width: n,
1601
+ height: r
1602
+ };
1603
+ }, "getMaxChildSize");
1604
+ function V(e, n, r = 0, i = 0, a = 8) {
1605
+ t.debug("setBlockSizes abc95 (start)", e.id, e?.size?.x, "block width =", e?.size, "siblingWidth", r), e?.size?.width || (e.size = {
1606
+ width: r,
1607
+ height: i,
1608
+ x: 0,
1609
+ y: 0
1610
+ });
1611
+ let o = 0, s = 0;
1612
+ if (e.children?.length > 0) {
1613
+ for (let t of e.children) V(t, n, 0, 0, a);
1614
+ let c = Ye(e);
1615
+ o = c.width, s = c.height, t.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", o, s);
1616
+ for (let n of e.children) n.size && (t.debug(`abc95 Setting size of children of ${e.id} id=${n.id} ${o} ${s} ${JSON.stringify(n.size)}`), n.size.width = o * (n.widthInColumns ?? 1) + a * ((n.widthInColumns ?? 1) - 1), n.size.height = s, n.size.x = 0, n.size.y = 0, t.debug(`abc95 updating size of ${e.id} children child:${n.id} maxWidth:${o} maxHeight:${s}`));
1617
+ for (let t of e.children) V(t, n, o, s, a);
1618
+ let l = e.columns ?? -1, u = 0;
1619
+ for (let t of e.children) u += t.widthInColumns ?? 1;
1620
+ let d = e.children.length;
1621
+ l > 0 && l < u && (d = l);
1622
+ let f = Math.ceil(u / d), p = d * (o + a) + a, m = f * (s + a) + a;
1623
+ if (p < r) {
1624
+ t.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${r} siblingHeight ${i} width ${p}`), p = r, m = i;
1625
+ let n = (r - d * a - a) / d, c = (i - f * a - a) / f;
1626
+ t.debug("Size indata abc88", e.id, "childWidth", n, "maxWidth", o), t.debug("Size indata abc88", e.id, "childHeight", c, "maxHeight", s), t.debug("Size indata abc88 xSize", d, "padding", a);
1627
+ for (let t of e.children) t.size && (t.size.width = n, t.size.height = c, t.size.x = 0, t.size.y = 0);
1628
+ }
1629
+ if (t.debug(`abc95 (finale calc) ${e.id} xSize ${d} ySize ${f} columns ${l}${e.children.length} width=${Math.max(p, e.size?.width || 0)}`), p < (e?.size?.width || 0)) {
1630
+ p = e?.size?.width || 0;
1631
+ let n = l > 0 ? Math.min(e.children.length, l) : e.children.length;
1632
+ if (n > 0) {
1633
+ let r = (p - n * a - a) / n;
1634
+ t.debug("abc95 (growing to fit) width", e.id, p, e.size?.width, r);
1635
+ for (let t of e.children) t.size && (t.size.width = r);
1636
+ }
1637
+ }
1638
+ e.size = {
1639
+ width: p,
1640
+ height: m,
1641
+ x: 0,
1642
+ y: 0
1643
+ };
1644
+ }
1645
+ t.debug("setBlockSizes abc94 (done)", e.id, e?.size?.x, e?.size?.width, e?.size?.y, e?.size?.height);
1646
+ }
1647
+ e(V, "setBlockSizes");
1648
+ function H(e, n, r = 8) {
1649
+ t.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1650
+ let i = e.columns ?? -1;
1651
+ if (t.debug("layoutBlocks columns abc95", e.id, "=>", i, e), e.children && e.children.length > 0) {
1652
+ let a = e?.children[0]?.size?.width ?? 0, o = e.children.length * a + (e.children.length - 1) * r;
1653
+ t.debug("widthOfChildren 88", o, "posX");
1654
+ let s = /* @__PURE__ */ new Map();
1655
+ {
1656
+ let t = 0;
1657
+ for (let n of e.children) {
1658
+ if (!n.size) continue;
1659
+ let { py: e } = B(i, t), r = s.get(e) ?? 0;
1660
+ n.size.height > r && s.set(e, n.size.height);
1661
+ let a = n?.widthInColumns ?? 1;
1662
+ i > 0 && (a = Math.min(a, i - t % i)), t += a;
1663
+ }
1664
+ }
1665
+ let c = /* @__PURE__ */ new Map();
1666
+ {
1667
+ let e = 0, t = [...s.keys()].sort((e, t) => e - t);
1668
+ for (let n of t) c.set(n, e), e += (s.get(n) ?? 0) + r;
1669
+ }
1670
+ let l = 0;
1671
+ t.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1672
+ let u = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -r, d = 0;
1673
+ for (let a of e.children) {
1674
+ let o = e;
1675
+ if (!a.size) continue;
1676
+ let { width: f, height: p } = a.size, { px: m, py: h } = B(i, l);
1677
+ if (h != d && (d = h, u = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -r, t.debug("New row in layout for block", e.id, " and child ", a.id, d)), t.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${l} (px, py) ${m},${h} (${o?.size?.x},${o?.size?.y}) parent: ${o.id} width: ${f}${r}`), o.size) {
1678
+ let e = f / 2;
1679
+ a.size.x = u + r + e, t.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${u} new startingPosX${a.size.x} ${e} padding=${r} width=${f} halfWidth=${e} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${f * (a?.widthInColumns ?? 1) / 2}`), u = a.size.x + e;
1680
+ let n = c.get(h) ?? 0, i = s.get(h) ?? p;
1681
+ a.size.y = o.size.y - o.size.height / 2 + n + i / 2 + r, t.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${u}${r}${e}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${f * (a?.widthInColumns ?? 1) / 2}`);
1682
+ }
1683
+ a.children && H(a, n, r);
1684
+ let g = a?.widthInColumns ?? 1;
1685
+ i > 0 && (g = Math.min(g, i - l % i)), l += g, t.debug("abc88 columnsPos", a, l);
1686
+ }
1687
+ }
1688
+ t.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1689
+ }
1690
+ e(H, "layoutBlocks");
1691
+ function Xe(e, { minX: t, minY: n, maxX: r, maxY: i } = {
1692
+ minX: 0,
1693
+ minY: 0,
1694
+ maxX: 0,
1695
+ maxY: 0
1696
+ }) {
1697
+ if (e.size && e.id !== "root") {
1698
+ let { x: a, y: o, width: s, height: c } = e.size;
1699
+ a - s / 2 < t && (t = a - s / 2), o - c / 2 < n && (n = o - c / 2), a + s / 2 > r && (r = a + s / 2), o + c / 2 > i && (i = o + c / 2);
1700
+ }
1701
+ if (e.children) for (let a of e.children) ({minX: t, minY: n, maxX: r, maxY: i} = Xe(a, {
1702
+ minX: t,
1703
+ minY: n,
1704
+ maxX: r,
1705
+ maxY: i
1706
+ }));
1707
+ return {
1708
+ minX: t,
1709
+ minY: n,
1710
+ maxX: r,
1711
+ maxY: i
1712
+ };
1713
+ }
1714
+ e(Xe, "findBounds");
1715
+ function Ze(e) {
1716
+ let n = e.getBlock("root");
1717
+ if (!n) return;
1718
+ let r = u()?.block?.padding ?? 8;
1719
+ V(n, e, 0, 0, r), H(n, e, r), t.debug("getBlocks", JSON.stringify(n, null, 2));
1720
+ let { minX: i, minY: a, maxX: o, maxY: s } = Xe(n), c = s - a;
1721
+ return {
1722
+ x: i,
1723
+ y: a,
1724
+ width: o - i,
1725
+ height: c
1726
+ };
1727
+ }
1728
+ e(Ze, "layout");
1729
+ var U = /* @__PURE__ */ e(async (e, t, n, r = !1, a = !1) => {
1730
+ let o = t || "";
1731
+ typeof o == "object" && (o = o[0]);
1732
+ let s = u(), c = i(s);
1733
+ return await P(e, o, {
1734
+ style: n,
1735
+ isTitle: r,
1736
+ useHtmlLabels: c,
1737
+ markdown: !1,
1738
+ isNode: a,
1739
+ width: Infinity
1740
+ }, s);
1741
+ }, "createLabel"), Qe = /* @__PURE__ */ e((e, t, n, r, i) => {
1742
+ t.arrowTypeStart && et(e, "start", t.arrowTypeStart, n, r, i), t.arrowTypeEnd && et(e, "end", t.arrowTypeEnd, n, r, i);
1743
+ }, "addEdgeMarkers"), $e = {
1744
+ arrow_cross: "cross",
1745
+ arrow_point: "point",
1746
+ arrow_barb: "barb",
1747
+ arrow_circle: "circle",
1748
+ aggregation: "aggregation",
1749
+ extension: "extension",
1750
+ composition: "composition",
1751
+ dependency: "dependency",
1752
+ lollipop: "lollipop"
1753
+ }, et = /* @__PURE__ */ e((e, n, r, i, a, o) => {
1754
+ let s = $e[r];
1755
+ if (!s) {
1756
+ t.warn(`Unknown arrow type: ${r}`);
1757
+ return;
1758
+ }
1759
+ let c = n === "start" ? "Start" : "End";
1760
+ e.attr(`marker-${n}`, `url(${i}#${a}_${o}-${s}${c})`);
1761
+ }, "addEdgeMarker"), tt = {}, W = {}, nt = /* @__PURE__ */ e(async (e, t) => {
1762
+ let r = u(), a = i(r), o = e.insert("g").attr("class", "edgeLabel"), s = o.insert("g").attr("class", "label"), c = t.labelType === "markdown", l = await P(e, t.label, {
1763
+ style: t.labelStyle,
1764
+ useHtmlLabels: a,
1765
+ addSvgBackground: c,
1766
+ isNode: !1,
1767
+ markdown: c,
1768
+ width: c ? void 0 : Infinity
1769
+ }, r);
1770
+ s.node().appendChild(l);
1771
+ let d = l.getBBox(), f = d;
1772
+ if (a) {
1773
+ let e = l.children[0], t = n(l);
1774
+ d = e.getBoundingClientRect(), f = d, t.attr("width", d.width), t.attr("height", d.height);
1775
+ } else {
1776
+ let e = n(l).select("text").node();
1777
+ e && typeof e.getBBox == "function" && (f = e.getBBox());
1778
+ }
1779
+ s.attr("transform", F(f, a)), tt[t.id] = o, t.width = d.width, t.height = d.height;
1780
+ let p;
1781
+ if (t.startLabelLeft) {
1782
+ let r = e.insert("g").attr("class", "edgeTerminals"), i = r.insert("g").attr("class", "inner"), o = await U(i, t.startLabelLeft, t.labelStyle);
1783
+ p = o;
1784
+ let s = o.getBBox();
1785
+ if (a) {
1786
+ let e = o.children[0], t = n(o);
1787
+ s = e.getBoundingClientRect(), t.attr("width", s.width), t.attr("height", s.height);
1788
+ }
1789
+ i.attr("transform", F(s, a)), W[t.id] || (W[t.id] = {}), W[t.id].startLeft = r, G(p, t.startLabelLeft);
1790
+ }
1791
+ if (t.startLabelRight) {
1792
+ let r = e.insert("g").attr("class", "edgeTerminals"), i = r.insert("g").attr("class", "inner"), o = await U(i, t.startLabelRight, t.labelStyle);
1793
+ p = o;
1794
+ let s = o.getBBox();
1795
+ if (a) {
1796
+ let e = o.children[0], t = n(o);
1797
+ s = e.getBoundingClientRect(), t.attr("width", s.width), t.attr("height", s.height);
1798
+ }
1799
+ i.attr("transform", F(s, a)), W[t.id] || (W[t.id] = {}), W[t.id].startRight = r, G(p, t.startLabelRight);
1800
+ }
1801
+ if (t.endLabelLeft) {
1802
+ let r = e.insert("g").attr("class", "edgeTerminals"), i = r.insert("g").attr("class", "inner"), o = await U(r, t.endLabelLeft, t.labelStyle);
1803
+ p = o;
1804
+ let s = o.getBBox();
1805
+ if (a) {
1806
+ let e = o.children[0], t = n(o);
1807
+ s = e.getBoundingClientRect(), t.attr("width", s.width), t.attr("height", s.height);
1808
+ }
1809
+ i.attr("transform", F(s, a)), W[t.id] || (W[t.id] = {}), W[t.id].endLeft = r, G(p, t.endLabelLeft);
1810
+ }
1811
+ if (t.endLabelRight) {
1812
+ let r = e.insert("g").attr("class", "edgeTerminals"), i = r.insert("g").attr("class", "inner"), o = await U(r, t.endLabelRight, t.labelStyle);
1813
+ p = o;
1814
+ let s = o.getBBox();
1815
+ if (a) {
1816
+ let e = o.children[0], t = n(o);
1817
+ s = e.getBoundingClientRect(), t.attr("width", s.width), t.attr("height", s.height);
1818
+ }
1819
+ i.attr("transform", F(s, a)), W[t.id] || (W[t.id] = {}), W[t.id].endRight = r, G(p, t.endLabelRight);
1820
+ }
1821
+ return l;
1822
+ }, "insertEdgeLabel");
1823
+ function G(e, t) {
1824
+ i(u()) && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1825
+ }
1826
+ e(G, "setTerminalWidth");
1827
+ var rt = /* @__PURE__ */ e((e, n) => {
1828
+ t.debug("Moving label abc88 ", e.id, e.label, tt[e.id], n);
1829
+ let r = n.updatedPath ? n.updatedPath : n.originalPath, i = u(), { subGraphTitleTotalMargin: a } = de(i);
1830
+ if (e.label) {
1831
+ let i = tt[e.id], o = e.x, s = e.y;
1832
+ if (r) {
1833
+ let i = N.calcLabelPosition(r);
1834
+ t.debug("Moving label " + e.label + " from (", o, ",", s, ") to (", i.x, ",", i.y, ") abc88"), n.updatedPath && (o = i.x, s = i.y);
1835
+ }
1836
+ i.attr("transform", `translate(${o}, ${s + a / 2})`);
1837
+ }
1838
+ if (e.startLabelLeft) {
1839
+ let t = W[e.id].startLeft, n = e.x, i = e.y;
1840
+ if (r) {
1841
+ let t = N.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", r);
1842
+ n = t.x, i = t.y;
1843
+ }
1844
+ t.attr("transform", `translate(${n}, ${i})`);
1845
+ }
1846
+ if (e.startLabelRight) {
1847
+ let t = W[e.id].startRight, n = e.x, i = e.y;
1848
+ if (r) {
1849
+ let t = N.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_right", r);
1850
+ n = t.x, i = t.y;
1851
+ }
1852
+ t.attr("transform", `translate(${n}, ${i})`);
1853
+ }
1854
+ if (e.endLabelLeft) {
1855
+ let t = W[e.id].endLeft, n = e.x, i = e.y;
1856
+ if (r) {
1857
+ let t = N.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", r);
1858
+ n = t.x, i = t.y;
1859
+ }
1860
+ t.attr("transform", `translate(${n}, ${i})`);
1861
+ }
1862
+ if (e.endLabelRight) {
1863
+ let t = W[e.id].endRight, n = e.x, i = e.y;
1864
+ if (r) {
1865
+ let t = N.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", r);
1866
+ n = t.x, i = t.y;
1867
+ }
1868
+ t.attr("transform", `translate(${n}, ${i})`);
1869
+ }
1870
+ }, "positionEdgeLabel"), it = /* @__PURE__ */ e((e, t) => {
1871
+ let n = e.x, r = e.y, i = Math.abs(t.x - n), a = Math.abs(t.y - r), o = e.width / 2, s = e.height / 2;
1872
+ return i >= o || a >= s;
1873
+ }, "outsideNode"), at = /* @__PURE__ */ e((e, n, r) => {
1874
+ t.debug(`intersection calc abc89:
1875
+ outsidePoint: ${JSON.stringify(n)}
1876
+ insidePoint : ${JSON.stringify(r)}
1877
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1878
+ let i = e.x, a = e.y, o = Math.abs(i - r.x), s = e.width / 2, c = r.x < n.x ? s - o : s + o, l = e.height / 2, u = Math.abs(n.y - r.y), d = Math.abs(n.x - r.x);
1879
+ if (Math.abs(a - n.y) * s > Math.abs(i - n.x) * l) {
1880
+ let e = r.y < n.y ? n.y - l - a : a - l - n.y;
1881
+ c = d * e / u;
1882
+ let i = {
1883
+ x: r.x < n.x ? r.x + c : r.x - d + c,
1884
+ y: r.y < n.y ? r.y + u - e : r.y - u + e
1885
+ };
1886
+ return c === 0 && (i.x = n.x, i.y = n.y), d === 0 && (i.x = n.x), u === 0 && (i.y = n.y), t.debug(`abc89 topp/bott calc, Q ${u}, q ${e}, R ${d}, r ${c}`, i), i;
1887
+ }
1888
+ {
1889
+ c = r.x < n.x ? n.x - s - i : i - s - n.x;
1890
+ let e = u * c / d, a = r.x < n.x ? r.x + d - c : r.x - d + c, o = r.y < n.y ? r.y + e : r.y - e;
1891
+ return t.debug(`sides calc abc89, Q ${u}, q ${e}, R ${d}, r ${c}`, {
1892
+ _x: a,
1893
+ _y: o
1894
+ }), c === 0 && (a = n.x, o = n.y), d === 0 && (a = n.x), u === 0 && (o = n.y), {
1895
+ x: a,
1896
+ y: o
1897
+ };
1898
+ }
1899
+ }, "intersection"), ot = /* @__PURE__ */ e((e, n) => {
1900
+ t.debug("abc88 cutPathAtIntersect", e, n);
1901
+ let r = [], i = e[0], a = !1;
1902
+ return e.forEach((e) => {
1903
+ if (!it(n, e) && !a) {
1904
+ let t = at(n, i, e), o = !1;
1905
+ r.forEach((e) => {
1906
+ o ||= e.x === t.x && e.y === t.y;
1907
+ }), r.some((e) => e.x === t.x && e.y === t.y) || r.push(t), a = !0;
1908
+ } else i = e, a || r.push(e);
1909
+ }), r;
1910
+ }, "cutPathAtIntersect"), st = /* @__PURE__ */ e(function(e, n, i, a, o, s, c) {
1911
+ let l = i.points;
1912
+ t.debug("abc88 InsertEdge: edge=", i, "e=", n);
1913
+ let d = !1, f = s.node(n.v);
1914
+ var p = s.node(n.w);
1915
+ p?.intersect && f?.intersect && (l = l.slice(1, i.points.length - 1), l.unshift(f.intersect(l[0])), l.push(p.intersect(l[l.length - 1]))), i.toCluster && (t.debug("to cluster abc88", a[i.toCluster]), l = ot(i.points, a[i.toCluster].node), d = !0), i.fromCluster && (t.debug("from cluster abc88", a[i.fromCluster]), l = ot(l.reverse(), a[i.fromCluster].node).reverse(), d = !0);
1916
+ let m = l.filter((e) => !Number.isNaN(e.y)), h = te;
1917
+ i.curve && (o === "graph" || o === "flowchart") && (h = i.curve);
1918
+ let { x: g, y: _ } = ue(i), v = ce().x(g).y(_).curve(h), y;
1919
+ switch (i.thickness) {
1920
+ case "normal":
1921
+ y = "edge-thickness-normal";
1922
+ break;
1923
+ case "thick":
1924
+ y = "edge-thickness-thick";
1925
+ break;
1926
+ case "invisible":
1927
+ y = "edge-thickness-thick";
1928
+ break;
1929
+ default: y = "";
1930
+ }
1931
+ switch (i.pattern) {
1932
+ case "solid":
1933
+ y += " edge-pattern-solid";
1934
+ break;
1935
+ case "dotted":
1936
+ y += " edge-pattern-dotted";
1937
+ break;
1938
+ case "dashed": y += " edge-pattern-dashed";
1939
+ }
1940
+ let b = e.append("path").attr("d", v(m)).attr("id", i.id).attr("class", " " + y + (i.classes ? " " + i.classes : "")).attr("style", i.style), x = "";
1941
+ (u().flowchart.arrowMarkerAbsolute || u().state.arrowMarkerAbsolute) && (x = r(!0)), Qe(b, i, x, c, o);
1942
+ let S = {};
1943
+ return d && (S.updatedPath = l), S.originalPath = i.points, S;
1944
+ }, "insertEdge"), ct = /* @__PURE__ */ e((e) => {
1945
+ let t = /* @__PURE__ */ new Set();
1946
+ for (let n of e) switch (n) {
1947
+ case "x":
1948
+ t.add("right"), t.add("left");
1949
+ break;
1950
+ case "y":
1951
+ t.add("up"), t.add("down");
1952
+ break;
1953
+ default: t.add(n);
1954
+ }
1955
+ return t;
1956
+ }, "expandAndDeduplicateDirections"), lt = /* @__PURE__ */ e((e, t, n, r) => {
1957
+ let i = ct(e), a = t.height + 2 * n.padding, o = a / 2, s = r ?? t.width + 2 * o + n.padding, c = n.padding / 2;
1958
+ return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
1959
+ {
1960
+ x: 0,
1961
+ y: 0
1962
+ },
1963
+ {
1964
+ x: o,
1965
+ y: 0
1966
+ },
1967
+ {
1968
+ x: s / 2,
1969
+ y: 2 * c
1970
+ },
1971
+ {
1972
+ x: s - o,
1973
+ y: 0
1974
+ },
1975
+ {
1976
+ x: s,
1977
+ y: 0
1978
+ },
1979
+ {
1980
+ x: s,
1981
+ y: -a / 3
1982
+ },
1983
+ {
1984
+ x: s + 2 * c,
1985
+ y: -a / 2
1986
+ },
1987
+ {
1988
+ x: s,
1989
+ y: -2 * a / 3
1990
+ },
1991
+ {
1992
+ x: s,
1993
+ y: -a
1994
+ },
1995
+ {
1996
+ x: s - o,
1997
+ y: -a
1998
+ },
1999
+ {
2000
+ x: s / 2,
2001
+ y: -a - 2 * c
2002
+ },
2003
+ {
2004
+ x: o,
2005
+ y: -a
2006
+ },
2007
+ {
2008
+ x: 0,
2009
+ y: -a
2010
+ },
2011
+ {
2012
+ x: 0,
2013
+ y: -2 * a / 3
2014
+ },
2015
+ {
2016
+ x: -2 * c,
2017
+ y: -a / 2
2018
+ },
2019
+ {
2020
+ x: 0,
2021
+ y: -a / 3
2022
+ }
2023
+ ] : i.has("right") && i.has("left") && i.has("up") ? [
2024
+ {
2025
+ x: o,
2026
+ y: 0
2027
+ },
2028
+ {
2029
+ x: s - o,
2030
+ y: 0
2031
+ },
2032
+ {
2033
+ x: s,
2034
+ y: -a / 2
2035
+ },
2036
+ {
2037
+ x: s - o,
2038
+ y: -a
2039
+ },
2040
+ {
2041
+ x: o,
2042
+ y: -a
2043
+ },
2044
+ {
2045
+ x: 0,
2046
+ y: -a / 2
2047
+ }
2048
+ ] : i.has("right") && i.has("left") && i.has("down") ? [
2049
+ {
2050
+ x: 0,
2051
+ y: 0
2052
+ },
2053
+ {
2054
+ x: o,
2055
+ y: -a
2056
+ },
2057
+ {
2058
+ x: s - o,
2059
+ y: -a
2060
+ },
2061
+ {
2062
+ x: s,
2063
+ y: 0
2064
+ }
2065
+ ] : i.has("right") && i.has("up") && i.has("down") ? [
2066
+ {
2067
+ x: 0,
2068
+ y: 0
2069
+ },
2070
+ {
2071
+ x: s,
2072
+ y: -o
2073
+ },
2074
+ {
2075
+ x: s,
2076
+ y: -a + o
2077
+ },
2078
+ {
2079
+ x: 0,
2080
+ y: -a
2081
+ }
2082
+ ] : i.has("left") && i.has("up") && i.has("down") ? [
2083
+ {
2084
+ x: s,
2085
+ y: 0
2086
+ },
2087
+ {
2088
+ x: 0,
2089
+ y: -o
2090
+ },
2091
+ {
2092
+ x: 0,
2093
+ y: -a + o
2094
+ },
2095
+ {
2096
+ x: s,
2097
+ y: -a
2098
+ }
2099
+ ] : i.has("right") && i.has("left") ? [
2100
+ {
2101
+ x: o,
2102
+ y: 0
2103
+ },
2104
+ {
2105
+ x: o,
2106
+ y: -c
2107
+ },
2108
+ {
2109
+ x: s - o,
2110
+ y: -c
2111
+ },
2112
+ {
2113
+ x: s - o,
2114
+ y: 0
2115
+ },
2116
+ {
2117
+ x: s,
2118
+ y: -a / 2
2119
+ },
2120
+ {
2121
+ x: s - o,
2122
+ y: -a
2123
+ },
2124
+ {
2125
+ x: s - o,
2126
+ y: -a + c
2127
+ },
2128
+ {
2129
+ x: o,
2130
+ y: -a + c
2131
+ },
2132
+ {
2133
+ x: o,
2134
+ y: -a
2135
+ },
2136
+ {
2137
+ x: 0,
2138
+ y: -a / 2
2139
+ }
2140
+ ] : i.has("up") && i.has("down") ? [
2141
+ {
2142
+ x: s / 2,
2143
+ y: 0
2144
+ },
2145
+ {
2146
+ x: 0,
2147
+ y: -c
2148
+ },
2149
+ {
2150
+ x: o,
2151
+ y: -c
2152
+ },
2153
+ {
2154
+ x: o,
2155
+ y: -a + c
2156
+ },
2157
+ {
2158
+ x: 0,
2159
+ y: -a + c
2160
+ },
2161
+ {
2162
+ x: s / 2,
2163
+ y: -a
2164
+ },
2165
+ {
2166
+ x: s,
2167
+ y: -a + c
2168
+ },
2169
+ {
2170
+ x: s - o,
2171
+ y: -a + c
2172
+ },
2173
+ {
2174
+ x: s - o,
2175
+ y: -c
2176
+ },
2177
+ {
2178
+ x: s,
2179
+ y: -c
2180
+ }
2181
+ ] : i.has("right") && i.has("up") ? [
2182
+ {
2183
+ x: 0,
2184
+ y: 0
2185
+ },
2186
+ {
2187
+ x: s,
2188
+ y: -o
2189
+ },
2190
+ {
2191
+ x: 0,
2192
+ y: -a
2193
+ }
2194
+ ] : i.has("right") && i.has("down") ? [
2195
+ {
2196
+ x: 0,
2197
+ y: 0
2198
+ },
2199
+ {
2200
+ x: s,
2201
+ y: 0
2202
+ },
2203
+ {
2204
+ x: 0,
2205
+ y: -a
2206
+ }
2207
+ ] : i.has("left") && i.has("up") ? [
2208
+ {
2209
+ x: s,
2210
+ y: 0
2211
+ },
2212
+ {
2213
+ x: 0,
2214
+ y: -o
2215
+ },
2216
+ {
2217
+ x: s,
2218
+ y: -a
2219
+ }
2220
+ ] : i.has("left") && i.has("down") ? [
2221
+ {
2222
+ x: s,
2223
+ y: 0
2224
+ },
2225
+ {
2226
+ x: 0,
2227
+ y: 0
2228
+ },
2229
+ {
2230
+ x: s,
2231
+ y: -a
2232
+ }
2233
+ ] : i.has("right") ? [
2234
+ {
2235
+ x: o,
2236
+ y: -c
2237
+ },
2238
+ {
2239
+ x: o,
2240
+ y: -c
2241
+ },
2242
+ {
2243
+ x: s - o,
2244
+ y: -c
2245
+ },
2246
+ {
2247
+ x: s - o,
2248
+ y: 0
2249
+ },
2250
+ {
2251
+ x: s,
2252
+ y: -a / 2
2253
+ },
2254
+ {
2255
+ x: s - o,
2256
+ y: -a
2257
+ },
2258
+ {
2259
+ x: s - o,
2260
+ y: -a + c
2261
+ },
2262
+ {
2263
+ x: o,
2264
+ y: -a + c
2265
+ },
2266
+ {
2267
+ x: o,
2268
+ y: -a + c
2269
+ }
2270
+ ] : i.has("left") ? [
2271
+ {
2272
+ x: o,
2273
+ y: 0
2274
+ },
2275
+ {
2276
+ x: o,
2277
+ y: -c
2278
+ },
2279
+ {
2280
+ x: s - o,
2281
+ y: -c
2282
+ },
2283
+ {
2284
+ x: s - o,
2285
+ y: -a + c
2286
+ },
2287
+ {
2288
+ x: o,
2289
+ y: -a + c
2290
+ },
2291
+ {
2292
+ x: o,
2293
+ y: -a
2294
+ },
2295
+ {
2296
+ x: 0,
2297
+ y: -a / 2
2298
+ }
2299
+ ] : i.has("up") ? [
2300
+ {
2301
+ x: o,
2302
+ y: -c
2303
+ },
2304
+ {
2305
+ x: o,
2306
+ y: -a + c
2307
+ },
2308
+ {
2309
+ x: 0,
2310
+ y: -a + c
2311
+ },
2312
+ {
2313
+ x: s / 2,
2314
+ y: -a
2315
+ },
2316
+ {
2317
+ x: s,
2318
+ y: -a + c
2319
+ },
2320
+ {
2321
+ x: s - o,
2322
+ y: -a + c
2323
+ },
2324
+ {
2325
+ x: s - o,
2326
+ y: -c
2327
+ }
2328
+ ] : i.has("down") ? [
2329
+ {
2330
+ x: s / 2,
2331
+ y: 0
2332
+ },
2333
+ {
2334
+ x: 0,
2335
+ y: -c
2336
+ },
2337
+ {
2338
+ x: o,
2339
+ y: -c
2340
+ },
2341
+ {
2342
+ x: o,
2343
+ y: -a + c
2344
+ },
2345
+ {
2346
+ x: s - o,
2347
+ y: -a + c
2348
+ },
2349
+ {
2350
+ x: s - o,
2351
+ y: -c
2352
+ },
2353
+ {
2354
+ x: s,
2355
+ y: -c
2356
+ }
2357
+ ] : [{
2358
+ x: 0,
2359
+ y: 0
2360
+ }];
2361
+ }, "getArrowPoints");
2362
+ function ut(e, t) {
2363
+ return e.intersect(t);
2364
+ }
2365
+ e(ut, "intersectNode");
2366
+ var dt = ut;
2367
+ function ft(e, t, n, r) {
2368
+ var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
2369
+ r.x < i && (l = -l);
2370
+ var u = Math.abs(t * n * s / c);
2371
+ return r.y < a && (u = -u), {
2372
+ x: i + l,
2373
+ y: a + u
2374
+ };
2375
+ }
2376
+ e(ft, "intersectEllipse");
2377
+ var pt = ft;
2378
+ function mt(e, t, n) {
2379
+ return pt(e, t, t, n);
2380
+ }
2381
+ e(mt, "intersectCircle");
2382
+ var ht = mt;
2383
+ function gt(e, t, n, r) {
2384
+ var i = t.y - e.y, a, o = e.x - t.x, s, c = t.x * e.y - e.x * t.y, l, u, d, f = i * n.x + o * n.y + c, p = i * r.x + o * r.y + c, m, h, g, _, v;
2385
+ if (!(f !== 0 && p !== 0 && _t(f, p)) && (a = r.y - n.y, s = n.x - r.x, l = r.x * n.y - n.x * r.y, u = a * e.x + s * e.y + l, d = a * t.x + s * t.y + l, !(u !== 0 && d !== 0 && _t(u, d)) && (m = i * s - a * o, m !== 0))) return h = Math.abs(m / 2), g = o * l - s * c, _ = g < 0 ? (g - h) / m : (g + h) / m, g = a * c - i * l, v = g < 0 ? (g - h) / m : (g + h) / m, {
2386
+ x: _,
2387
+ y: v
2388
+ };
2389
+ }
2390
+ e(gt, "intersectLine");
2391
+ function _t(e, t) {
2392
+ return e * t > 0;
2393
+ }
2394
+ e(_t, "sameSign");
2395
+ var vt = gt, yt = bt;
2396
+ function bt(e, t, n) {
2397
+ var r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
2398
+ typeof t.forEach == "function" ? t.forEach(function(e) {
2399
+ o = Math.min(o, e.x), s = Math.min(s, e.y);
2400
+ }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
2401
+ for (var c = r - e.width / 2 - o, l = i - e.height / 2 - s, u = 0; u < t.length; u++) {
2402
+ var d = t[u], f = t[u < t.length - 1 ? u + 1 : 0], p = vt(e, n, {
2403
+ x: c + d.x,
2404
+ y: l + d.y
2405
+ }, {
2406
+ x: c + f.x,
2407
+ y: l + f.y
2408
+ });
2409
+ p && a.push(p);
2410
+ }
2411
+ return a.length ? (a.length > 1 && a.sort(function(e, t) {
2412
+ var r = e.x - n.x, i = e.y - n.y, a = Math.sqrt(r * r + i * i), o = t.x - n.x, s = t.y - n.y, c = Math.sqrt(o * o + s * s);
2413
+ return a < c ? -1 : a === c ? 0 : 1;
2414
+ }), a[0]) : e;
2415
+ }
2416
+ e(bt, "intersectPolygon");
2417
+ var K = {
2418
+ node: dt,
2419
+ circle: ht,
2420
+ ellipse: pt,
2421
+ polygon: yt,
2422
+ rect: /* @__PURE__ */ e((e, t) => {
2423
+ var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
2424
+ return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
2425
+ x: n + c,
2426
+ y: r + l
2427
+ };
2428
+ }, "intersectRect")
2429
+ }, q = /* @__PURE__ */ e(async (e, t, r, a) => {
2430
+ let o = u(), s, c = t.useHtmlLabels || i(o);
2431
+ s = r || "node default";
2432
+ let l = e.insert("g").attr("class", s).attr("id", t.domId || t.id), f = l.insert("g").attr("class", "label").attr("style", t.labelStyle), p;
2433
+ p = t.labelText === void 0 ? "" : typeof t.labelText == "string" ? t.labelText : t.labelText[0];
2434
+ let m;
2435
+ m = t.labelType === "markdown" ? P(f, d(M(p), o), {
2436
+ useHtmlLabels: c,
2437
+ width: t.width || o.flowchart.wrappingWidth,
2438
+ classes: "markdown-node-label"
2439
+ }, o) : await U(f, d(M(p), o), t.labelStyle, !1, a);
2440
+ let h = m.getBBox(), g = t.padding / 2;
2441
+ if (i(o)) {
2442
+ let e = m.children[0], t = n(m);
2443
+ await fe(e, p), h = e.getBoundingClientRect(), t.attr("width", h.width), t.attr("height", h.height);
2444
+ }
2445
+ return c ? f.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")") : f.attr("transform", "translate(0, " + -h.height / 2 + ")"), t.centerLabel && f.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")"), f.insert("rect", ":first-child"), {
2446
+ shapeSvg: l,
2447
+ bbox: h,
2448
+ halfPadding: g,
2449
+ label: f
2450
+ };
2451
+ }, "labelHelper"), J = /* @__PURE__ */ e((e, t) => {
2452
+ let n = t.node().getBBox();
2453
+ e.width = n.width, e.height = n.height;
2454
+ }, "updateNodeBounds");
2455
+ function Y(e, t, n, r) {
2456
+ return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
2457
+ return e.x + "," + e.y;
2458
+ }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
2459
+ }
2460
+ e(Y, "insertPolygonShape");
2461
+ var xt = /* @__PURE__ */ e(async (e, n) => {
2462
+ n.useHtmlLabels || i(u()) || (n.centerLabel = !0);
2463
+ let { shapeSvg: r, bbox: a, halfPadding: o } = await q(e, n, "node " + n.classes, !0);
2464
+ t.info("Classes = ", n.classes);
2465
+ let s = r.insert("rect", ":first-child");
2466
+ return s.attr("rx", n.rx).attr("ry", n.ry).attr("x", -a.width / 2 - o).attr("y", -a.height / 2 - o).attr("width", a.width + n.padding).attr("height", a.height + n.padding), J(n, s), n.intersect = function(e) {
2467
+ return K.rect(n, e);
2468
+ }, r;
2469
+ }, "note"), St = /* @__PURE__ */ e((e) => e ? " " + e : "", "formatClass"), X = /* @__PURE__ */ e((e, t) => `${t || "node default"}${St(e.classes)} ${St(e.class)}`, "getClassesFromNode"), Ct = /* @__PURE__ */ e(async (e, n) => {
2470
+ let { shapeSvg: r, bbox: i } = await q(e, n, X(n, void 0), !0), a = i.width + n.padding + (i.height + n.padding), o = [
2471
+ {
2472
+ x: a / 2,
2473
+ y: 0
2474
+ },
2475
+ {
2476
+ x: a,
2477
+ y: -a / 2
2478
+ },
2479
+ {
2480
+ x: a / 2,
2481
+ y: -a
2482
+ },
2483
+ {
2484
+ x: 0,
2485
+ y: -a / 2
2486
+ }
2487
+ ];
2488
+ t.info("Question main (Circle)");
2489
+ let s = Y(r, a, a, o);
2490
+ return s.attr("style", n.style), J(n, s), n.intersect = function(e) {
2491
+ return t.warn("Intersect called"), K.polygon(n, o, e);
2492
+ }, r;
2493
+ }, "question"), wt = /* @__PURE__ */ e((e, t) => {
2494
+ let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
2495
+ return n.insert("polygon", ":first-child").attr("points", [
2496
+ {
2497
+ x: 0,
2498
+ y: 14
2499
+ },
2500
+ {
2501
+ x: 14,
2502
+ y: 0
2503
+ },
2504
+ {
2505
+ x: 0,
2506
+ y: -14
2507
+ },
2508
+ {
2509
+ x: -14,
2510
+ y: 0
2511
+ }
2512
+ ].map(function(e) {
2513
+ return e.x + "," + e.y;
2514
+ }).join(" ")).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(e) {
2515
+ return K.circle(t, 14, e);
2516
+ }, n;
2517
+ }, "choice"), Tt = /* @__PURE__ */ e(async (e, t) => {
2518
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = t.positioned ? t.height : r.height + t.padding, a = i / 4, o = t.positioned ? t.width : r.width + 2 * a + t.padding, s = [
2519
+ {
2520
+ x: a,
2521
+ y: 0
2522
+ },
2523
+ {
2524
+ x: o - a,
2525
+ y: 0
2526
+ },
2527
+ {
2528
+ x: o,
2529
+ y: -i / 2
2530
+ },
2531
+ {
2532
+ x: o - a,
2533
+ y: -i
2534
+ },
2535
+ {
2536
+ x: a,
2537
+ y: -i
2538
+ },
2539
+ {
2540
+ x: 0,
2541
+ y: -i / 2
2542
+ }
2543
+ ], c = Y(n, o, i, s);
2544
+ return c.attr("style", t.style), J(t, c), t.intersect = function(e) {
2545
+ return K.polygon(t, s, e);
2546
+ }, n;
2547
+ }, "hexagon"), Et = /* @__PURE__ */ e(async (e, t) => {
2548
+ let { shapeSvg: n, bbox: r } = await q(e, t, void 0, !0), i = r.height + 2 * t.padding, a = i / 2, o = r.width + 2 * a + t.padding, s = t.positioned && (t.widthInColumns ?? 1) > 1 && t.width > o ? t.width : o, c = lt(t.directions, r, t, s), l = Y(n, s, i, c);
2549
+ return l.attr("style", t.style), J(t, l), t.intersect = function(e) {
2550
+ return K.polygon(t, c, e);
2551
+ }, n;
2552
+ }, "block_arrow"), Dt = /* @__PURE__ */ e(async (e, t) => {
2553
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2554
+ {
2555
+ x: -a / 2,
2556
+ y: 0
2557
+ },
2558
+ {
2559
+ x: i,
2560
+ y: 0
2561
+ },
2562
+ {
2563
+ x: i,
2564
+ y: -a
2565
+ },
2566
+ {
2567
+ x: -a / 2,
2568
+ y: -a
2569
+ },
2570
+ {
2571
+ x: 0,
2572
+ y: -a / 2
2573
+ }
2574
+ ];
2575
+ return Y(n, i, a, o).attr("style", t.style), t.width = i + a, t.height = a, t.intersect = function(e) {
2576
+ return K.polygon(t, o, e);
2577
+ }, n;
2578
+ }, "rect_left_inv_arrow"), Ot = /* @__PURE__ */ e(async (e, t) => {
2579
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2580
+ {
2581
+ x: -2 * a / 6,
2582
+ y: 0
2583
+ },
2584
+ {
2585
+ x: i - a / 6,
2586
+ y: 0
2587
+ },
2588
+ {
2589
+ x: i + 2 * a / 6,
2590
+ y: -a
2591
+ },
2592
+ {
2593
+ x: a / 6,
2594
+ y: -a
2595
+ }
2596
+ ], s = Y(n, i, a, o);
2597
+ return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2598
+ return K.polygon(t, o, e);
2599
+ }, n;
2600
+ }, "lean_right"), kt = /* @__PURE__ */ e(async (e, t) => {
2601
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2602
+ {
2603
+ x: 2 * a / 6,
2604
+ y: 0
2605
+ },
2606
+ {
2607
+ x: i + a / 6,
2608
+ y: 0
2609
+ },
2610
+ {
2611
+ x: i - 2 * a / 6,
2612
+ y: -a
2613
+ },
2614
+ {
2615
+ x: -a / 6,
2616
+ y: -a
2617
+ }
2618
+ ], s = Y(n, i, a, o);
2619
+ return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2620
+ return K.polygon(t, o, e);
2621
+ }, n;
2622
+ }, "lean_left"), At = /* @__PURE__ */ e(async (e, t) => {
2623
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2624
+ {
2625
+ x: -2 * a / 6,
2626
+ y: 0
2627
+ },
2628
+ {
2629
+ x: i + 2 * a / 6,
2630
+ y: 0
2631
+ },
2632
+ {
2633
+ x: i - a / 6,
2634
+ y: -a
2635
+ },
2636
+ {
2637
+ x: a / 6,
2638
+ y: -a
2639
+ }
2640
+ ], s = Y(n, i, a, o);
2641
+ return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2642
+ return K.polygon(t, o, e);
2643
+ }, n;
2644
+ }, "trapezoid"), jt = /* @__PURE__ */ e(async (e, t) => {
2645
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2646
+ {
2647
+ x: a / 6,
2648
+ y: 0
2649
+ },
2650
+ {
2651
+ x: i - a / 6,
2652
+ y: 0
2653
+ },
2654
+ {
2655
+ x: i + 2 * a / 6,
2656
+ y: -a
2657
+ },
2658
+ {
2659
+ x: -2 * a / 6,
2660
+ y: -a
2661
+ }
2662
+ ], s = Y(n, i, a, o);
2663
+ return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2664
+ return K.polygon(t, o, e);
2665
+ }, n;
2666
+ }, "inv_trapezoid"), Mt = /* @__PURE__ */ e(async (e, t) => {
2667
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2668
+ {
2669
+ x: 0,
2670
+ y: 0
2671
+ },
2672
+ {
2673
+ x: i + a / 2,
2674
+ y: 0
2675
+ },
2676
+ {
2677
+ x: i,
2678
+ y: -a / 2
2679
+ },
2680
+ {
2681
+ x: i + a / 2,
2682
+ y: -a
2683
+ },
2684
+ {
2685
+ x: 0,
2686
+ y: -a
2687
+ }
2688
+ ], s = Y(n, i, a, o);
2689
+ return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2690
+ return K.polygon(t, o, e);
2691
+ }, n;
2692
+ }, "rect_right_inv_arrow"), Nt = /* @__PURE__ */ e(async (e, t) => {
2693
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = i / 2, o = a / (2.5 + i / 50), s = r.height + o + t.padding, c = "M 0," + o + " a " + a + "," + o + " 0,0,0 " + i + " 0 a " + a + "," + o + " 0,0,0 " + -i + " 0 l 0," + s + " a " + a + "," + o + " 0,0,0 " + i + " 0 l 0," + -s;
2694
+ return J(t, n.attr("label-offset-y", o).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -i / 2 + "," + -(s / 2 + o) + ")")), t.intersect = function(e) {
2695
+ let n = K.rect(t, e), r = n.x - t.x;
2696
+ if (a != 0 && (Math.abs(r) < t.width / 2 || Math.abs(r) == t.width / 2 && Math.abs(n.y - t.y) > t.height / 2 - o)) {
2697
+ let i = o * o * (1 - r * r / (a * a));
2698
+ i != 0 && (i = Math.sqrt(i)), i = o - i, e.y - t.y > 0 && (i = -i), n.y += i;
2699
+ }
2700
+ return n;
2701
+ }, n;
2702
+ }, "cylinder"), Pt = /* @__PURE__ */ e(async (e, n) => {
2703
+ let { shapeSvg: r, bbox: i, halfPadding: a } = await q(e, n, "node " + n.classes + " " + n.class, !0), o = r.insert("rect", ":first-child"), s = n.positioned ? n.width : i.width + n.padding, c = n.positioned ? n.height : i.height + n.padding, l = n.positioned ? -s / 2 : -i.width / 2 - a, u = n.positioned ? -c / 2 : -i.height / 2 - a;
2704
+ if (o.attr("class", "basic label-container").attr("style", n.style).attr("rx", n.rx).attr("ry", n.ry).attr("x", l).attr("y", u).attr("width", s).attr("height", c), n.props) {
2705
+ let e = new Set(Object.keys(n.props));
2706
+ n.props.borders && (Z(o, n.props.borders, s, c), e.delete("borders")), e.forEach((e) => {
2707
+ t.warn(`Unknown node property ${e}`);
2708
+ });
2709
+ }
2710
+ return J(n, o), n.intersect = function(e) {
2711
+ return K.rect(n, e);
2712
+ }, r;
2713
+ }, "rect"), Ft = /* @__PURE__ */ e(async (e, n) => {
2714
+ let { shapeSvg: r, bbox: i, halfPadding: a } = await q(e, n, "node " + n.classes, !0), o = r.insert("rect", ":first-child"), s = n.positioned ? n.width : i.width + n.padding, c = n.positioned ? n.height : i.height + n.padding, l = n.positioned ? -s / 2 : -i.width / 2 - a, u = n.positioned ? -c / 2 : -i.height / 2 - a;
2715
+ if (o.attr("class", "basic cluster composite label-container").attr("style", n.style).attr("rx", n.rx).attr("ry", n.ry).attr("x", l).attr("y", u).attr("width", s).attr("height", c), n.props) {
2716
+ let e = new Set(Object.keys(n.props));
2717
+ n.props.borders && (Z(o, n.props.borders, s, c), e.delete("borders")), e.forEach((e) => {
2718
+ t.warn(`Unknown node property ${e}`);
2719
+ });
2720
+ }
2721
+ return J(n, o), n.intersect = function(e) {
2722
+ return K.rect(n, e);
2723
+ }, r;
2724
+ }, "composite"), It = /* @__PURE__ */ e(async (e, n) => {
2725
+ let { shapeSvg: r } = await q(e, n, "label", !0);
2726
+ t.trace("Classes = ", n.class);
2727
+ let i = r.insert("rect", ":first-child");
2728
+ if (i.attr("width", 0).attr("height", 0), r.attr("class", "label edgeLabel"), n.props) {
2729
+ let e = new Set(Object.keys(n.props));
2730
+ n.props.borders && (Z(i, n.props.borders, 0, 0), e.delete("borders")), e.forEach((e) => {
2731
+ t.warn(`Unknown node property ${e}`);
2732
+ });
2733
+ }
2734
+ return J(n, i), n.intersect = function(e) {
2735
+ return K.rect(n, e);
2736
+ }, r;
2737
+ }, "labelRect");
2738
+ function Z(n, r, i, a) {
2739
+ let o = [], s = /* @__PURE__ */ e((e) => {
2740
+ o.push(e, 0);
2741
+ }, "addBorder"), c = /* @__PURE__ */ e((e) => {
2742
+ o.push(0, e);
2743
+ }, "skipBorder");
2744
+ r.includes("t") ? (t.debug("add top border"), s(i)) : c(i), r.includes("r") ? (t.debug("add right border"), s(a)) : c(a), r.includes("b") ? (t.debug("add bottom border"), s(i)) : c(i), r.includes("l") ? (t.debug("add left border"), s(a)) : c(a), n.attr("stroke-dasharray", o.join(" "));
2745
+ }
2746
+ e(Z, "applyNodePropertyBorders");
2747
+ var Lt = /* @__PURE__ */ e(async (e, r) => {
2748
+ let a;
2749
+ a = r.classes ? "node " + r.classes : "node default";
2750
+ let o = e.insert("g").attr("class", a).attr("id", r.domId || r.id), s = o.insert("rect", ":first-child"), c = o.insert("line"), l = o.insert("g").attr("class", "label"), d = r.labelText.flat ? r.labelText.flat() : r.labelText, f = "";
2751
+ f = typeof d == "object" ? d[0] : d, t.info("Label text abc79", f, d, typeof d == "object");
2752
+ let p = await U(l, f, r.labelStyle, !0, !0), m = {
2753
+ width: 0,
2754
+ height: 0
2755
+ };
2756
+ if (i(u())) {
2757
+ let e = p.children[0], t = n(p);
2758
+ m = e.getBoundingClientRect(), t.attr("width", m.width), t.attr("height", m.height);
2759
+ }
2760
+ t.info("Text 2", d);
2761
+ let h = d.slice(1, d.length), g = p.getBBox(), _ = await U(l, h.join ? h.join("<br/>") : h, r.labelStyle, !0, !0);
2762
+ if (i(u())) {
2763
+ let e = _.children[0], t = n(_);
2764
+ m = e.getBoundingClientRect(), t.attr("width", m.width), t.attr("height", m.height);
2765
+ }
2766
+ let v = r.padding / 2;
2767
+ return n(_).attr("transform", "translate( " + (m.width > g.width ? 0 : (g.width - m.width) / 2) + ", " + (g.height + v + 5) + ")"), n(p).attr("transform", "translate( " + (m.width < g.width ? 0 : -(g.width - m.width) / 2) + ", 0)"), m = l.node().getBBox(), l.attr("transform", "translate(" + -m.width / 2 + ", " + (-m.height / 2 - v + 3) + ")"), s.attr("class", "outer title-state").attr("x", -m.width / 2 - v).attr("y", -m.height / 2 - v).attr("width", m.width + r.padding).attr("height", m.height + r.padding), c.attr("class", "divider").attr("x1", -m.width / 2 - v).attr("x2", m.width / 2 + v).attr("y1", -m.height / 2 - v + g.height + v).attr("y2", -m.height / 2 - v + g.height + v), J(r, s), r.intersect = function(e) {
2768
+ return K.rect(r, e);
2769
+ }, o;
2770
+ }, "rectWithTitle"), Rt = /* @__PURE__ */ e(async (e, t) => {
2771
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.height + t.padding, a = r.width + i / 4 + t.padding;
2772
+ return J(t, n.insert("rect", ":first-child").attr("style", t.style).attr("rx", i / 2).attr("ry", i / 2).attr("x", -a / 2).attr("y", -i / 2).attr("width", a).attr("height", i)), t.intersect = function(e) {
2773
+ return K.rect(t, e);
2774
+ }, n;
2775
+ }, "stadium"), zt = /* @__PURE__ */ e(async (e, n) => {
2776
+ let { shapeSvg: r, bbox: i, halfPadding: a } = await q(e, n, X(n, void 0), !0), o = r.insert("circle", ":first-child");
2777
+ return o.attr("style", n.style).attr("rx", n.rx).attr("ry", n.ry).attr("r", i.width / 2 + a).attr("width", i.width + n.padding).attr("height", i.height + n.padding), t.info("Circle main"), J(n, o), n.intersect = function(e) {
2778
+ return t.info("Circle intersect", n, i.width / 2 + a, e), K.circle(n, i.width / 2 + a, e);
2779
+ }, r;
2780
+ }, "circle"), Bt = /* @__PURE__ */ e(async (e, n) => {
2781
+ let { shapeSvg: r, bbox: i, halfPadding: a } = await q(e, n, X(n, void 0), !0), o = r.insert("g", ":first-child"), s = o.insert("circle"), c = o.insert("circle");
2782
+ return o.attr("class", n.class), s.attr("style", n.style).attr("rx", n.rx).attr("ry", n.ry).attr("r", i.width / 2 + a + 5).attr("width", i.width + n.padding + 10).attr("height", i.height + n.padding + 10), c.attr("style", n.style).attr("rx", n.rx).attr("ry", n.ry).attr("r", i.width / 2 + a).attr("width", i.width + n.padding).attr("height", i.height + n.padding), t.info("DoubleCircle main"), J(n, s), n.intersect = function(e) {
2783
+ return t.info("DoubleCircle intersect", n, i.width / 2 + a + 5, e), K.circle(n, i.width / 2 + a + 5, e);
2784
+ }, r;
2785
+ }, "doublecircle"), Vt = /* @__PURE__ */ e(async (e, t) => {
2786
+ let { shapeSvg: n, bbox: r } = await q(e, t, X(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2787
+ {
2788
+ x: 0,
2789
+ y: 0
2790
+ },
2791
+ {
2792
+ x: i,
2793
+ y: 0
2794
+ },
2795
+ {
2796
+ x: i,
2797
+ y: -a
2798
+ },
2799
+ {
2800
+ x: 0,
2801
+ y: -a
2802
+ },
2803
+ {
2804
+ x: 0,
2805
+ y: 0
2806
+ },
2807
+ {
2808
+ x: -8,
2809
+ y: 0
2810
+ },
2811
+ {
2812
+ x: i + 8,
2813
+ y: 0
2814
+ },
2815
+ {
2816
+ x: i + 8,
2817
+ y: -a
2818
+ },
2819
+ {
2820
+ x: -8,
2821
+ y: -a
2822
+ },
2823
+ {
2824
+ x: -8,
2825
+ y: 0
2826
+ }
2827
+ ], s = Y(n, i, a, o);
2828
+ return s.attr("style", t.style), J(t, s), t.intersect = function(e) {
2829
+ return K.polygon(t, o, e);
2830
+ }, n;
2831
+ }, "subroutine"), Ht = /* @__PURE__ */ e((e, t) => {
2832
+ let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), r = n.insert("circle", ":first-child");
2833
+ return r.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), J(t, r), t.intersect = function(e) {
2834
+ return K.circle(t, 7, e);
2835
+ }, n;
2836
+ }, "start"), Ut = /* @__PURE__ */ e((e, t, n) => {
2837
+ let r = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 70, a = 10;
2838
+ return n === "LR" && (i = 10, a = 70), J(t, r.append("rect").attr("x", -1 * i / 2).attr("y", -1 * a / 2).attr("width", i).attr("height", a).attr("class", "fork-join")), t.height += t.padding / 2, t.width += t.padding / 2, t.intersect = function(e) {
2839
+ return K.rect(t, e);
2840
+ }, r;
2841
+ }, "forkJoin"), Wt = {
2842
+ rhombus: Ct,
2843
+ composite: Ft,
2844
+ question: Ct,
2845
+ rect: Pt,
2846
+ labelRect: It,
2847
+ rectWithTitle: Lt,
2848
+ choice: wt,
2849
+ circle: zt,
2850
+ doublecircle: Bt,
2851
+ stadium: Rt,
2852
+ hexagon: Tt,
2853
+ block_arrow: Et,
2854
+ rect_left_inv_arrow: Dt,
2855
+ lean_right: Ot,
2856
+ lean_left: kt,
2857
+ trapezoid: At,
2858
+ inv_trapezoid: jt,
2859
+ rect_right_inv_arrow: Mt,
2860
+ cylinder: Nt,
2861
+ start: Ht,
2862
+ end: /* @__PURE__ */ e((e, t) => {
2863
+ let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), r = n.insert("circle", ":first-child"), i = n.insert("circle", ":first-child");
2864
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), r.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), J(t, i), t.intersect = function(e) {
2865
+ return K.circle(t, 7, e);
2866
+ }, n;
2867
+ }, "end"),
2868
+ note: xt,
2869
+ subroutine: Vt,
2870
+ fork: Ut,
2871
+ join: Ut,
2872
+ class_box: /* @__PURE__ */ e(async (e, t) => {
2873
+ let r = t.padding / 2, a;
2874
+ a = t.classes ? "node " + t.classes : "node default";
2875
+ let o = e.insert("g").attr("class", a).attr("id", t.domId || t.id), s = o.insert("rect", ":first-child"), c = o.insert("line"), l = o.insert("line"), d = 0, f = 4, p = o.insert("g").attr("class", "label"), m = 0, h = t.classData.annotations?.[0], g = await U(p, t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", t.labelStyle, !0, !0), _ = g.getBBox();
2876
+ if (i(u())) {
2877
+ let e = g.children[0], t = n(g);
2878
+ _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
2879
+ }
2880
+ t.classData.annotations[0] && (f += _.height + 4, d += _.width);
2881
+ let v = t.classData.label;
2882
+ t.classData.type !== void 0 && t.classData.type !== "" && (i(u()) ? v += "&lt;" + t.classData.type + "&gt;" : v += "<" + t.classData.type + ">");
2883
+ let y = await U(p, v, t.labelStyle, !0, !0);
2884
+ n(y).attr("class", "classTitle");
2885
+ let b = y.getBBox();
2886
+ if (i(u())) {
2887
+ let e = y.children[0], t = n(y);
2888
+ b = e.getBoundingClientRect(), t.attr("width", b.width), t.attr("height", b.height);
2889
+ }
2890
+ f += b.height + 4, b.width > d && (d = b.width);
2891
+ let x = [];
2892
+ t.classData.members.forEach(async (e) => {
2893
+ let r = e.getDisplayDetails(), a = r.displayText;
2894
+ i(u()) && (a = a.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2895
+ let o = await U(p, a, r.cssStyle ? r.cssStyle : t.labelStyle, !0, !0), s = o.getBBox();
2896
+ if (i(u())) {
2897
+ let e = o.children[0], t = n(o);
2898
+ s = e.getBoundingClientRect(), t.attr("width", s.width), t.attr("height", s.height);
2899
+ }
2900
+ s.width > d && (d = s.width), f += s.height + 4, x.push(o);
2901
+ }), f += 8;
2902
+ let S = [];
2903
+ if (t.classData.methods.forEach(async (e) => {
2904
+ let r = e.getDisplayDetails(), a = r.displayText;
2905
+ i(u()) && (a = a.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2906
+ let o = await U(p, a, r.cssStyle ? r.cssStyle : t.labelStyle, !0, !0), s = o.getBBox();
2907
+ if (i(u())) {
2908
+ let e = o.children[0], t = n(o);
2909
+ s = e.getBoundingClientRect(), t.attr("width", s.width), t.attr("height", s.height);
2910
+ }
2911
+ s.width > d && (d = s.width), f += s.height + 4, S.push(o);
2912
+ }), f += 8, h) {
2913
+ let e = (d - _.width) / 2;
2914
+ n(g).attr("transform", "translate( " + (-1 * d / 2 + e) + ", " + -1 * f / 2 + ")"), m = _.height + 4;
2915
+ }
2916
+ let C = (d - b.width) / 2;
2917
+ return n(y).attr("transform", "translate( " + (-1 * d / 2 + C) + ", " + (-1 * f / 2 + m) + ")"), m += b.height + 4, c.attr("class", "divider").attr("x1", -d / 2 - r).attr("x2", d / 2 + r).attr("y1", -f / 2 - r + 8 + m).attr("y2", -f / 2 - r + 8 + m), m += 8, x.forEach((e) => {
2918
+ n(e).attr("transform", "translate( " + -d / 2 + ", " + (-1 * f / 2 + m + 4) + ")");
2919
+ let t = e?.getBBox();
2920
+ m += (t?.height ?? 0) + 4;
2921
+ }), m += 8, l.attr("class", "divider").attr("x1", -d / 2 - r).attr("x2", d / 2 + r).attr("y1", -f / 2 - r + 8 + m).attr("y2", -f / 2 - r + 8 + m), m += 8, S.forEach((e) => {
2922
+ n(e).attr("transform", "translate( " + -d / 2 + ", " + (-1 * f / 2 + m) + ")");
2923
+ let t = e?.getBBox();
2924
+ m += (t?.height ?? 0) + 4;
2925
+ }), s.attr("style", t.style).attr("class", "outer title-state").attr("x", -d / 2 - r).attr("y", -(f / 2) - r).attr("width", d + t.padding).attr("height", f + t.padding), J(t, s), t.intersect = function(e) {
2926
+ return K.rect(t, e);
2927
+ }, o;
2928
+ }, "class_box")
2929
+ }, Q = {}, Gt = /* @__PURE__ */ e(async (e, t, n) => {
2930
+ let r, i;
2931
+ if (t.link) {
2932
+ let a;
2933
+ u().securityLevel === "sandbox" ? a = "_top" : t.linkTarget && (a = t.linkTarget || "_blank"), r = e.insert("svg:a").attr("xlink:href", t.link).attr("target", a), i = await Wt[t.shape](r, t, n);
2934
+ } else i = await Wt[t.shape](e, t, n), r = i;
2935
+ return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), Q[t.id] = r, t.haveCallback && Q[t.id].attr("class", Q[t.id].attr("class") + " clickable"), r;
2936
+ }, "insertNode"), Kt = /* @__PURE__ */ e((e) => {
2937
+ let n = Q[e.id];
2938
+ t.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
2939
+ let r = e.diff || 0;
2940
+ return e.clusterNode ? n.attr("transform", "translate(" + (e.x + r - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : n.attr("transform", "translate(" + e.x + ", " + e.y + ")"), r;
2941
+ }, "positionNode");
2942
+ function qt(e, t, n = !1) {
2943
+ let r = e, i = "default";
2944
+ (r?.classes?.length || 0) > 0 && (i = (r?.classes ?? []).join(" ")), i += " flowchart-label";
2945
+ let a = 0, s = "", c;
2946
+ switch (r.type) {
2947
+ case "round":
2948
+ a = 5, s = "rect";
2949
+ break;
2950
+ case "composite":
2951
+ a = 0, s = "composite", c = 0;
2952
+ break;
2953
+ case "square":
2954
+ s = "rect";
2955
+ break;
2956
+ case "diamond":
2957
+ s = "question";
2958
+ break;
2959
+ case "hexagon":
2960
+ s = "hexagon";
2961
+ break;
2962
+ case "block_arrow":
2963
+ s = "block_arrow";
2964
+ break;
2965
+ case "odd":
2966
+ s = "rect_left_inv_arrow";
2967
+ break;
2968
+ case "lean_right":
2969
+ s = "lean_right";
2970
+ break;
2971
+ case "lean_left":
2972
+ s = "lean_left";
2973
+ break;
2974
+ case "trapezoid":
2975
+ s = "trapezoid";
2976
+ break;
2977
+ case "inv_trapezoid":
2978
+ s = "inv_trapezoid";
2979
+ break;
2980
+ case "rect_left_inv_arrow":
2981
+ s = "rect_left_inv_arrow";
2982
+ break;
2983
+ case "circle":
2984
+ s = "circle";
2985
+ break;
2986
+ case "ellipse":
2987
+ s = "ellipse";
2988
+ break;
2989
+ case "stadium":
2990
+ s = "stadium";
2991
+ break;
2992
+ case "subroutine":
2993
+ s = "subroutine";
2994
+ break;
2995
+ case "cylinder":
2996
+ s = "cylinder";
2997
+ break;
2998
+ case "group":
2999
+ s = "rect";
3000
+ break;
3001
+ case "doublecircle":
3002
+ s = "doublecircle";
3003
+ break;
3004
+ default: s = "rect";
3005
+ }
3006
+ let l = ie(r?.styles ?? []), u = r.label, d = r.size ?? {
3007
+ width: 0,
3008
+ height: 0,
3009
+ x: 0,
3010
+ y: 0
3011
+ }, f = t.getDiagramId();
3012
+ return {
3013
+ labelStyle: l.labelStyle,
3014
+ shape: s,
3015
+ labelText: u,
3016
+ rx: a,
3017
+ ry: a,
3018
+ class: i,
3019
+ style: l.style,
3020
+ id: r.id,
3021
+ domId: f ? `${f}-${r.id}` : r.id,
3022
+ directions: r.directions,
3023
+ width: d.width,
3024
+ height: d.height,
3025
+ x: d.x,
3026
+ y: d.y,
3027
+ positioned: n,
3028
+ intersect: void 0,
3029
+ type: r.type,
3030
+ padding: c ?? o()?.block?.padding ?? 0,
3031
+ widthInColumns: r.widthInColumns ?? 1
3032
+ };
3033
+ }
3034
+ e(qt, "getNodeFromBlock");
3035
+ async function Jt(e, t, n) {
3036
+ let r = qt(t, n, !1);
3037
+ if (r.type === "group") return;
3038
+ let i = await Gt(e, r, { config: o() }), a = i.node().getBBox(), s = n.getBlock(r.id);
3039
+ s.size = {
3040
+ width: a.width,
3041
+ height: a.height,
3042
+ x: 0,
3043
+ y: 0,
3044
+ node: i
3045
+ }, n.setBlock(s), i.remove();
3046
+ }
3047
+ e(Jt, "calculateBlockSize");
3048
+ async function Yt(e, t, n) {
3049
+ let r = qt(t, n, !0);
3050
+ n.getBlock(r.id).type !== "space" && (await Gt(e, r, { config: o() }), t.intersect = r?.intersect, Kt(r));
3051
+ }
3052
+ e(Yt, "insertBlockPositioned");
3053
+ async function $(e, t, n, r) {
3054
+ for (let i of t) await r(e, i, n), i.children && await $(e, i.children, n, r);
3055
+ }
3056
+ e($, "performOperations");
3057
+ async function Xt(e, t, n) {
3058
+ await $(e, t, n, Jt);
3059
+ }
3060
+ e(Xt, "calculateBlockSizes");
3061
+ async function Zt(e, t, n) {
3062
+ await $(e, t, n, Yt);
3063
+ }
3064
+ e(Zt, "insertBlocks");
3065
+ async function Qt(e, t, n, r, i) {
3066
+ let a = new pe({
3067
+ multigraph: !0,
3068
+ compound: !0
3069
+ });
3070
+ a.setGraph({
3071
+ rankdir: "TB",
3072
+ nodesep: 10,
3073
+ ranksep: 10,
3074
+ marginx: 8,
3075
+ marginy: 8
3076
+ });
3077
+ for (let e of n) e.size && a.setNode(e.id, {
3078
+ width: e.size.width,
3079
+ height: e.size.height,
3080
+ intersect: e.intersect
3081
+ });
3082
+ for (let n of t) if (n.start && n.end) {
3083
+ let t = r.getBlock(n.start), o = r.getBlock(n.end);
3084
+ if (t?.size && o?.size) {
3085
+ let r = t.size, s = o.size, c = [
3086
+ {
3087
+ x: r.x,
3088
+ y: r.y
3089
+ },
3090
+ {
3091
+ x: r.x + (s.x - r.x) / 2,
3092
+ y: r.y + (s.y - r.y) / 2
3093
+ },
3094
+ {
3095
+ x: s.x,
3096
+ y: s.y
3097
+ }
3098
+ ], l = i ? `${i}-${n.id}` : n.id, u = `${n.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal"} ${n.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;
3099
+ st(e, {
3100
+ v: n.start,
3101
+ w: n.end,
3102
+ name: l
3103
+ }, {
3104
+ ...n,
3105
+ id: l,
3106
+ arrowTypeEnd: n.arrowTypeEnd,
3107
+ arrowTypeStart: n.arrowTypeStart,
3108
+ points: c,
3109
+ classes: u
3110
+ }, void 0, "block", a, i), n.label && (await nt(e, {
3111
+ ...n,
3112
+ label: n.label,
3113
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
3114
+ arrowTypeEnd: n.arrowTypeEnd,
3115
+ arrowTypeStart: n.arrowTypeStart,
3116
+ points: c,
3117
+ classes: u
3118
+ }), rt({
3119
+ ...n,
3120
+ x: c[1].x,
3121
+ y: c[1].y
3122
+ }, { originalPath: c }));
3123
+ }
3124
+ }
3125
+ }
3126
+ e(Qt, "insertEdges");
3127
+ var $t = {
3128
+ parser: Se,
3129
+ db: We,
3130
+ renderer: {
3131
+ draw: /* @__PURE__ */ e(async function(e, r, i, a) {
3132
+ let { securityLevel: c, block: l } = o(), u = a.db;
3133
+ u.setDiagramId(r);
3134
+ let d;
3135
+ c === "sandbox" && (d = n("#i" + r));
3136
+ let f = n(c === "sandbox" ? d.nodes()[0].contentDocument.body : "body"), p = c === "sandbox" ? f.select(`[id="${r}"]`) : n(`[id="${r}"]`);
3137
+ Je(p, [
3138
+ "point",
3139
+ "circle",
3140
+ "cross"
3141
+ ], a.type, r);
3142
+ let m = u.getBlocks(), h = u.getBlocksFlat(), g = u.getEdges(), _ = p.insert("g").attr("class", "block");
3143
+ await Xt(_, m, u);
3144
+ let v = Ze(u);
3145
+ if (await Zt(_, m, u), await Qt(_, g, h, u, r), v) {
3146
+ let e = v, n = Math.max(1, Math.round(.125 * (e.width / e.height))), r = e.height + n + 10, i = e.width + 10, { useMaxWidth: a } = l;
3147
+ s(p, r, i, !!a), t.debug("Here Bounds", v, e), p.attr("viewBox", `${e.x - 5} ${e.y - 5} ${e.width + 10} ${e.height + 10}`);
3148
+ }
3149
+ }, "draw"),
3150
+ getClasses: /* @__PURE__ */ e(function(e, t) {
3151
+ return t.db.getClasses();
3152
+ }, "getClasses")
3153
+ },
3154
+ styles: Ge
3155
+ };
3156
+ //#endregion
3157
+ export { $t as diagram };