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