@airalogy/aimd-recorder 1.17.0 → 1.18.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 (106) hide show
  1. package/README.md +11 -10
  2. package/README.zh-CN.md +11 -10
  3. package/dist/AimdCodeField-BQUuM-EF.js +182 -0
  4. package/dist/{AimdDnaSequenceField-D6ZgCDpp.js → AimdDnaSequenceField-KZU2Zj3E.js} +2 -2
  5. package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js → AimdEditor.vue_vue_type_style_index_0_lang-CzfYPp5r.js} +3922 -3829
  6. package/dist/AimdMarkdownField-t2d8uOeU.js +254 -0
  7. package/dist/AimdMarkdownNoteField-_h1oZSwH.js +259 -0
  8. package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
  9. package/dist/aimd-recorder.css +1 -1
  10. package/dist/arc-DS_ocYoe.js +83 -0
  11. package/dist/architectureDiagram-3BPJPVTR-Dq2W8_tb.js +4692 -0
  12. package/dist/blockDiagram-GPEHLZMM-B4hnSAF_.js +2425 -0
  13. package/dist/c4Diagram-AAUBKEIU-CbffqNLY.js +1577 -0
  14. package/dist/channel-CtXnYrAk.js +5 -0
  15. package/dist/chunk-2J33WTMH-CROScrt5.js +19 -0
  16. package/dist/chunk-4BX2VUAB-DTmsQu5_.js +8 -0
  17. package/dist/chunk-55IACEB6-B5wDJzeX.js +8 -0
  18. package/dist/chunk-727SXJPM-CfyltY6o.js +1528 -0
  19. package/dist/chunk-AQP2D5EJ-B8274EYy.js +1387 -0
  20. package/dist/chunk-FMBD7UC4-CT_FK-SH.js +19 -0
  21. package/dist/chunk-ND2GUHAM-g9GulPi-.js +68 -0
  22. package/dist/chunk-QZHKN3VN-Di5HEktz.js +15 -0
  23. package/dist/classDiagram-4FO5ZUOK-BVUr246k.js +16 -0
  24. package/dist/classDiagram-v2-Q7XG4LA2-BVUr246k.js +16 -0
  25. package/dist/components.js +3279 -2216
  26. package/dist/composables.js +92 -68
  27. package/dist/cose-bilkent-S5V4N54A-GJ4IOO6v.js +2609 -0
  28. package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
  29. package/dist/dagre-BM42HDAG-oL7Br44o.js +445 -0
  30. package/dist/defaultLocale-BgPVtth8.js +171 -0
  31. package/dist/diagram-2AECGRRQ-DtoCG_N4.js +217 -0
  32. package/dist/diagram-5GNKFQAL-f8QNdS7L.js +123 -0
  33. package/dist/diagram-KO2AKTUF-CsJOW_AX.js +461 -0
  34. package/dist/diagram-LMA3HP47-xmEKNZ7y.js +142 -0
  35. package/dist/diagram-OG6HWLK6-unpC7vo8.js +528 -0
  36. package/dist/erDiagram-TEJ5UH35-BGzFnCJD.js +899 -0
  37. package/dist/flowDiagram-I6XJVG4X-LBFhDnOs.js +1628 -0
  38. package/dist/ganttDiagram-6RSMTGT7-CFBc-jPD.js +2707 -0
  39. package/dist/gitGraphDiagram-PVQCEYII-BLduh-Rb.js +815 -0
  40. package/dist/graph-DdlKE625.js +1510 -0
  41. package/dist/index.js +104 -80
  42. package/dist/infoDiagram-5YYISTIA-CLQQI6zM.js +24 -0
  43. package/dist/init-DjUOC4st.js +16 -0
  44. package/dist/ishikawaDiagram-YF4QCWOH-CStdYBmW.js +621 -0
  45. package/dist/journeyDiagram-JHISSGLW-B6mRTzoE.js +834 -0
  46. package/dist/kanban-definition-UN3LZRKU-C-vnN5v4.js +724 -0
  47. package/dist/katex-DNob3HGn.js +11690 -0
  48. package/dist/layout-DDt0fz-M.js +1703 -0
  49. package/dist/linear-C-IAFdOt.js +259 -0
  50. package/dist/mermaid.core-CuZ3nINf.js +15940 -0
  51. package/dist/mindmap-definition-RKZ34NQL-TSZ1Vb3z.js +827 -0
  52. package/dist/ordinal-B6-f3MAq.js +61 -0
  53. package/dist/pieDiagram-4H26LBE5-DYok-1-k.js +163 -0
  54. package/dist/quadrantDiagram-W4KKPZXB-Cg856sbH.js +1024 -0
  55. package/dist/requirementDiagram-4Y6WPE33-BN9fGdlJ.js +882 -0
  56. package/dist/sankeyDiagram-5OEKKPKP-CDqTgonY.js +847 -0
  57. package/dist/sequenceDiagram-3UESZ5HK-Chjrc0-W.js +2891 -0
  58. package/dist/stateDiagram-AJRCARHV-DRyLHrdr.js +263 -0
  59. package/dist/stateDiagram-v2-BHNVJYJU-CZTIDHid.js +16 -0
  60. package/dist/timeline-definition-PNZ67QCA-Bc3D9AAG.js +1055 -0
  61. package/dist/{useFieldRendering-xLajJhyA.js → useCodeBlockRendering-qA6gj4vz.js} +3035 -2254
  62. package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
  63. package/dist/vennDiagram-CIIHVFJN-CYAul48m.js +1557 -0
  64. package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
  65. package/dist/wardleyDiagram-YWT4CUSO-B7Tg0MG9.js +675 -0
  66. package/dist/xychartDiagram-2RQKCTM6-xWYVEqth.js +1342 -0
  67. package/package.json +9 -8
  68. package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
  69. package/src/__tests__/markdown-field.test.ts +150 -1
  70. package/src/__tests__/markdown-note-field.test.ts +86 -3
  71. package/src/__tests__/recorder-assigner-control.test.ts +844 -0
  72. package/src/__tests__/recorder-editor.test.ts +17 -0
  73. package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
  74. package/src/__tests__/step-field.test.ts +47 -1
  75. package/src/__tests__/type-plugins.test.ts +1 -0
  76. package/src/__tests__/var-field-render.test.ts +741 -1
  77. package/src/components/AimdCodeField.vue +24 -5
  78. package/src/components/AimdMarkdownField.vue +548 -11
  79. package/src/components/AimdMarkdownNoteField.vue +241 -30
  80. package/src/components/AimdRecorder.vue +1521 -95
  81. package/src/components/AimdRecorderEditor.vue +276 -8
  82. package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
  83. package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
  84. package/src/components/AimdStepCheckField.vue +82 -18
  85. package/src/components/AimdVarField.vue +694 -25
  86. package/src/components/AimdVarTableField.vue +283 -110
  87. package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
  88. package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
  89. package/src/components/recorderMilkdownPlugin.ts +14 -0
  90. package/src/composables/__tests__/useRecordState.test.ts +86 -0
  91. package/src/composables/__tests__/useVarHelpers.test.ts +133 -0
  92. package/src/composables/index.ts +27 -1
  93. package/src/composables/useAssignerRunner.ts +376 -0
  94. package/src/composables/useCodeBlockRendering.ts +51 -0
  95. package/src/composables/useFieldRendering.ts +32 -4
  96. package/src/composables/useMonacoAutoHeight.ts +127 -0
  97. package/src/composables/useRecordState.ts +22 -3
  98. package/src/composables/useVarHelpers.ts +377 -9
  99. package/src/index.ts +13 -0
  100. package/src/locales.ts +45 -0
  101. package/src/styles/aimd.css +151 -1
  102. package/src/type-plugins.ts +7 -0
  103. package/src/types.ts +93 -2
  104. package/dist/AimdCodeField-DC3DPvgc.js +0 -172
  105. package/dist/AimdMarkdownField-BJ20QtO8.js +0 -67
  106. package/dist/AimdMarkdownNoteField-DwAQhoyk.js +0 -186
@@ -0,0 +1,2425 @@
1
+ import { g as Ee } from "./chunk-FMBD7UC4-CT_FK-SH.js";
2
+ import { an as _e, ao as Xt, ap as Te, aq as Vt, ar as Gt, as as Zt, at as jt, au as wt, av as qt, aw as Jt, ax as Qt, ay as $t, az as te, aA as ee, aB as De, aC as Be, aD as Ne, aE as Ie, aF as Ce, aG as Oe, aH as Re, aI as Ae, aJ as ze, aK as Me, aL as Pe, _ as d, F as at, d as D, e as Fe, l as k, A as We, C as Ye, aM as He, a9 as Ke, aa as Ue, c as A, a6 as Xe, aN as P, aO as Et, aP as $, aQ as Ve, u as tt, k as Ge, aR as Ze, i as Rt, aS as At, aT as je } from "./mermaid.core-CuZ3nINf.js";
3
+ import { G as qe } from "./graph-DdlKE625.js";
4
+ import { c as Je } from "./channel-CtXnYrAk.js";
5
+ function Qe(e) {
6
+ return Array.isArray(e);
7
+ }
8
+ function $e(e) {
9
+ if (_e(e))
10
+ return e;
11
+ const t = Xt(e);
12
+ if (!tr(e))
13
+ return {};
14
+ if (Qe(e)) {
15
+ const s = Array.from(e);
16
+ return e.length > 0 && typeof e[0] == "string" && Object.hasOwn(e, "index") && (s.index = e.index, s.input = e.input), s;
17
+ }
18
+ if (Te(e)) {
19
+ const s = e, i = s.constructor;
20
+ return new i(s.buffer, s.byteOffset, s.length);
21
+ }
22
+ if (t === Vt)
23
+ return new ArrayBuffer(e.byteLength);
24
+ if (t === Gt) {
25
+ const s = e, i = s.buffer, c = s.byteOffset, r = s.byteLength, n = new ArrayBuffer(r), l = new Uint8Array(i, c, r);
26
+ return new Uint8Array(n).set(l), new DataView(n);
27
+ }
28
+ if (t === Zt || t === jt || t === wt) {
29
+ const s = e.constructor, i = new s(e.valueOf());
30
+ return t === wt ? rr(i, e) : yt(i, e), i;
31
+ }
32
+ if (t === qt)
33
+ return new Date(Number(e));
34
+ if (t === Jt) {
35
+ const s = e, i = new RegExp(s.source, s.flags);
36
+ return i.lastIndex = s.lastIndex, i;
37
+ }
38
+ if (t === Qt)
39
+ return Object(Symbol.prototype.valueOf.call(e));
40
+ if (t === $t) {
41
+ const s = e, i = /* @__PURE__ */ new Map();
42
+ return s.forEach((c, r) => {
43
+ i.set(r, c);
44
+ }), i;
45
+ }
46
+ if (t === te) {
47
+ const s = e, i = /* @__PURE__ */ new Set();
48
+ return s.forEach((c) => {
49
+ i.add(c);
50
+ }), i;
51
+ }
52
+ if (t === ee) {
53
+ const s = e, i = {};
54
+ return yt(i, s), i.length = s.length, i[Symbol.iterator] = s[Symbol.iterator], i;
55
+ }
56
+ const a = {};
57
+ return ar(a, e), yt(a, e), er(a, e), a;
58
+ }
59
+ function tr(e) {
60
+ switch (Xt(e)) {
61
+ case ee:
62
+ case Pe:
63
+ case Vt:
64
+ case Gt:
65
+ case Zt:
66
+ case qt:
67
+ case Me:
68
+ case ze:
69
+ case Ae:
70
+ case Re:
71
+ case Oe:
72
+ case $t:
73
+ case jt:
74
+ case Ce:
75
+ case Jt:
76
+ case te:
77
+ case wt:
78
+ case Qt:
79
+ case Ie:
80
+ case Ne:
81
+ case Be:
82
+ case De:
83
+ return !0;
84
+ default:
85
+ return !1;
86
+ }
87
+ }
88
+ function yt(e, t) {
89
+ for (const a in t)
90
+ Object.hasOwn(t, a) && (e[a] = t[a]);
91
+ }
92
+ function er(e, t) {
93
+ const a = Object.getOwnPropertySymbols(t);
94
+ for (let s = 0; s < a.length; s++) {
95
+ const i = a[s];
96
+ Object.prototype.propertyIsEnumerable.call(t, i) && (e[i] = t[i]);
97
+ }
98
+ }
99
+ function rr(e, t) {
100
+ const a = t.valueOf().length;
101
+ for (const s in t)
102
+ Object.hasOwn(t, s) && (Number.isNaN(Number(s)) || Number(s) >= a) && (e[s] = t[s]);
103
+ }
104
+ function ar(e, t) {
105
+ const a = Object.getPrototypeOf(t);
106
+ a !== null && typeof t.constructor == "function" && Object.setPrototypeOf(e, a);
107
+ }
108
+ var mt = (function() {
109
+ var e = /* @__PURE__ */ d(function(T, m, u, y) {
110
+ for (u = u || {}, y = T.length; y--; u[T[y]] = m) ;
111
+ return u;
112
+ }, "o"), t = [1, 15], a = [1, 7], s = [1, 13], i = [1, 14], c = [1, 19], r = [1, 16], n = [1, 17], l = [1, 18], g = [8, 30], o = [8, 10, 21, 28, 29, 30, 31, 39, 43, 46], p = [1, 23], b = [1, 24], x = [8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46], w = [8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46], v = [1, 49], S = {
113
+ trace: /* @__PURE__ */ d(function() {
114
+ }, "trace"),
115
+ yy: {},
116
+ symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, NODE_ID: 31, nodeShapeNLabel: 32, dirList: 33, DIR: 34, NODE_DSTART: 35, NODE_DEND: 36, BLOCK_ARROW_START: 37, BLOCK_ARROW_END: 38, classDef: 39, CLASSDEF_ID: 40, CLASSDEF_STYLEOPTS: 41, DEFAULT: 42, class: 43, CLASSENTITY_IDS: 44, STYLECLASS: 45, style: 46, STYLE_ENTITY_IDS: 47, STYLE_DEFINITION_DATA: 48, $accept: 0, $end: 1 },
117
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "NODE_ID", 34: "DIR", 35: "NODE_DSTART", 36: "NODE_DEND", 37: "BLOCK_ARROW_START", 38: "BLOCK_ARROW_END", 39: "classDef", 40: "CLASSDEF_ID", 41: "CLASSDEF_STYLEOPTS", 42: "DEFAULT", 43: "class", 44: "CLASSENTITY_IDS", 45: "STYLECLASS", 46: "style", 47: "STYLE_ENTITY_IDS", 48: "STYLE_DEFINITION_DATA" },
118
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [33, 1], [33, 2], [32, 3], [32, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
119
+ performAction: /* @__PURE__ */ d(function(m, u, y, L, E, h, W) {
120
+ var f = h.length - 1;
121
+ switch (E) {
122
+ case 4:
123
+ L.getLogger().debug("Rule: separator (NL) ");
124
+ break;
125
+ case 5:
126
+ L.getLogger().debug("Rule: separator (Space) ");
127
+ break;
128
+ case 6:
129
+ L.getLogger().debug("Rule: separator (EOF) ");
130
+ break;
131
+ case 7:
132
+ L.getLogger().debug("Rule: hierarchy: ", h[f - 1]), L.setHierarchy(h[f - 1]);
133
+ break;
134
+ case 8:
135
+ L.getLogger().debug("Stop NL ");
136
+ break;
137
+ case 9:
138
+ L.getLogger().debug("Stop EOF ");
139
+ break;
140
+ case 10:
141
+ L.getLogger().debug("Stop NL2 ");
142
+ break;
143
+ case 11:
144
+ L.getLogger().debug("Stop EOF2 ");
145
+ break;
146
+ case 12:
147
+ L.getLogger().debug("Rule: statement: ", h[f]), typeof h[f].length == "number" ? this.$ = h[f] : this.$ = [h[f]];
148
+ break;
149
+ case 13:
150
+ L.getLogger().debug("Rule: statement #2: ", h[f - 1]), this.$ = [h[f - 1]].concat(h[f]);
151
+ break;
152
+ case 14:
153
+ L.getLogger().debug("Rule: link: ", h[f], m), this.$ = { edgeTypeStr: h[f], label: "" };
154
+ break;
155
+ case 15:
156
+ L.getLogger().debug("Rule: LABEL link: ", h[f - 3], h[f - 1], h[f]), this.$ = { edgeTypeStr: h[f], label: h[f - 1] };
157
+ break;
158
+ case 18:
159
+ const O = parseInt(h[f]), q = L.generateId();
160
+ this.$ = { id: q, type: "space", label: "", width: O, children: [] };
161
+ break;
162
+ case 23:
163
+ L.getLogger().debug("Rule: (nodeStatement link node) ", h[f - 2], h[f - 1], h[f], " typestr: ", h[f - 1].edgeTypeStr);
164
+ const G = L.edgeStrToEdgeData(h[f - 1].edgeTypeStr), st = L.edgeStrToEdgeStartData(h[f - 1].edgeTypeStr), dt = L.edgeStrToThickness(h[f - 1].edgeTypeStr), R = L.edgeStrToPattern(h[f - 1].edgeTypeStr);
165
+ this.$ = [
166
+ { id: h[f - 2].id, label: h[f - 2].label, type: h[f - 2].type, directions: h[f - 2].directions },
167
+ { id: h[f - 2].id + "-" + h[f].id, start: h[f - 2].id, end: h[f].id, label: h[f - 1].label, type: "edge", thickness: dt, pattern: R, directions: h[f].directions, arrowTypeEnd: G, arrowTypeStart: st },
168
+ { id: h[f].id, label: h[f].label, type: L.typeStr2Type(h[f].typeStr), directions: h[f].directions }
169
+ ];
170
+ break;
171
+ case 24:
172
+ L.getLogger().debug("Rule: nodeStatement (abc88 node size) ", h[f - 1], h[f]), this.$ = { id: h[f - 1].id, label: h[f - 1].label, type: L.typeStr2Type(h[f - 1].typeStr), directions: h[f - 1].directions, widthInColumns: parseInt(h[f], 10) };
173
+ break;
174
+ case 25:
175
+ L.getLogger().debug("Rule: nodeStatement (node) ", h[f]), this.$ = { id: h[f].id, label: h[f].label, type: L.typeStr2Type(h[f].typeStr), directions: h[f].directions, widthInColumns: 1 };
176
+ break;
177
+ case 26:
178
+ L.getLogger().debug("APA123", this ? this : "na"), L.getLogger().debug("COLUMNS: ", h[f]), this.$ = { type: "column-setting", columns: h[f] === "auto" ? -1 : parseInt(h[f]) };
179
+ break;
180
+ case 27:
181
+ L.getLogger().debug("Rule: id-block statement : ", h[f - 2], h[f - 1]), L.generateId(), this.$ = { ...h[f - 2], type: "composite", children: h[f - 1] };
182
+ break;
183
+ case 28:
184
+ L.getLogger().debug("Rule: blockStatement : ", h[f - 2], h[f - 1], h[f]);
185
+ const Z = L.generateId();
186
+ this.$ = { id: Z, type: "composite", label: "", children: h[f - 1] };
187
+ break;
188
+ case 29:
189
+ L.getLogger().debug("Rule: node (NODE_ID separator): ", h[f]), this.$ = { id: h[f] };
190
+ break;
191
+ case 30:
192
+ L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", h[f - 1], h[f]), this.$ = { id: h[f - 1], label: h[f].label, typeStr: h[f].typeStr, directions: h[f].directions };
193
+ break;
194
+ case 31:
195
+ L.getLogger().debug("Rule: dirList: ", h[f]), this.$ = [h[f]];
196
+ break;
197
+ case 32:
198
+ L.getLogger().debug("Rule: dirList: ", h[f - 1], h[f]), this.$ = [h[f - 1]].concat(h[f]);
199
+ break;
200
+ case 33:
201
+ L.getLogger().debug("Rule: nodeShapeNLabel: ", h[f - 2], h[f - 1], h[f]), this.$ = { typeStr: h[f - 2] + h[f], label: h[f - 1] };
202
+ break;
203
+ case 34:
204
+ L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", h[f - 3], h[f - 2], " #3:", h[f - 1], h[f]), this.$ = { typeStr: h[f - 3] + h[f], label: h[f - 2], directions: h[f - 1] };
205
+ break;
206
+ case 35:
207
+ case 36:
208
+ this.$ = { type: "classDef", id: h[f - 1].trim(), css: h[f].trim() };
209
+ break;
210
+ case 37:
211
+ this.$ = { type: "applyClass", id: h[f - 1].trim(), styleClass: h[f].trim() };
212
+ break;
213
+ case 38:
214
+ this.$ = { type: "applyStyles", id: h[f - 1].trim(), stylesStr: h[f].trim() };
215
+ break;
216
+ }
217
+ }, "anonymous"),
218
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: t, 11: 3, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 8: [1, 20] }, e(g, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: t, 21: a, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }), e(o, [2, 16], { 14: 22, 15: p, 16: b }), e(o, [2, 17]), e(o, [2, 18]), e(o, [2, 19]), e(o, [2, 20]), e(o, [2, 21]), e(o, [2, 22]), e(x, [2, 25], { 27: [1, 25] }), e(o, [2, 26]), { 19: 26, 26: 12, 31: c }, { 10: t, 11: 27, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(w, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(g, [2, 13]), { 26: 35, 31: c }, { 31: [2, 14] }, { 17: [1, 36] }, e(x, [2, 24]), { 10: t, 11: 37, 13: 4, 14: 22, 15: p, 16: b, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(w, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(x, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(o, [2, 28]), e(o, [2, 35]), e(o, [2, 36]), e(o, [2, 37]), e(o, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: v }, { 15: [1, 50] }, e(o, [2, 27]), e(w, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: v, 38: [2, 31] }, { 31: [2, 15] }, e(w, [2, 34]), { 38: [2, 32] }],
219
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
220
+ parseError: /* @__PURE__ */ d(function(m, u) {
221
+ if (u.recoverable)
222
+ this.trace(m);
223
+ else {
224
+ var y = new Error(m);
225
+ throw y.hash = u, y;
226
+ }
227
+ }, "parseError"),
228
+ parse: /* @__PURE__ */ d(function(m) {
229
+ var u = this, y = [0], L = [], E = [null], h = [], W = this.table, f = "", O = 0, q = 0, G = 2, st = 1, dt = h.slice.call(arguments, 1), R = Object.create(this.lexer), Z = { yy: {} };
230
+ for (var ut in this.yy)
231
+ Object.prototype.hasOwnProperty.call(this.yy, ut) && (Z.yy[ut] = this.yy[ut]);
232
+ R.setInput(m, Z.yy), Z.yy.lexer = R, Z.yy.parser = this, typeof R.yylloc > "u" && (R.yylloc = {});
233
+ var pt = R.yylloc;
234
+ h.push(pt);
235
+ var ke = R.options && R.options.ranges;
236
+ typeof Z.yy.parseError == "function" ? this.parseError = Z.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
237
+ function ve(Y) {
238
+ y.length = y.length - 2 * Y, E.length = E.length - Y, h.length = h.length - Y;
239
+ }
240
+ d(ve, "popStack");
241
+ function Ct() {
242
+ var Y;
243
+ return Y = L.pop() || R.lex() || st, typeof Y != "number" && (Y instanceof Array && (L = Y, Y = L.pop()), Y = u.symbols_[Y] || Y), Y;
244
+ }
245
+ d(Ct, "lex");
246
+ for (var F, J, K, ft, Q = {}, it, j, Ot, nt; ; ) {
247
+ if (J = y[y.length - 1], this.defaultActions[J] ? K = this.defaultActions[J] : ((F === null || typeof F > "u") && (F = Ct()), K = W[J] && W[J][F]), typeof K > "u" || !K.length || !K[0]) {
248
+ var xt = "";
249
+ nt = [];
250
+ for (it in W[J])
251
+ this.terminals_[it] && it > G && nt.push("'" + this.terminals_[it] + "'");
252
+ R.showPosition ? xt = "Parse error on line " + (O + 1) + `:
253
+ ` + R.showPosition() + `
254
+ Expecting ` + nt.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : xt = "Parse error on line " + (O + 1) + ": Unexpected " + (F == st ? "end of input" : "'" + (this.terminals_[F] || F) + "'"), this.parseError(xt, {
255
+ text: R.match,
256
+ token: this.terminals_[F] || F,
257
+ line: R.yylineno,
258
+ loc: pt,
259
+ expected: nt
260
+ });
261
+ }
262
+ if (K[0] instanceof Array && K.length > 1)
263
+ throw new Error("Parse Error: multiple actions possible at state: " + J + ", token: " + F);
264
+ switch (K[0]) {
265
+ case 1:
266
+ y.push(F), E.push(R.yytext), h.push(R.yylloc), y.push(K[1]), F = null, q = R.yyleng, f = R.yytext, O = R.yylineno, pt = R.yylloc;
267
+ break;
268
+ case 2:
269
+ if (j = this.productions_[K[1]][1], Q.$ = E[E.length - j], Q._$ = {
270
+ first_line: h[h.length - (j || 1)].first_line,
271
+ last_line: h[h.length - 1].last_line,
272
+ first_column: h[h.length - (j || 1)].first_column,
273
+ last_column: h[h.length - 1].last_column
274
+ }, ke && (Q._$.range = [
275
+ h[h.length - (j || 1)].range[0],
276
+ h[h.length - 1].range[1]
277
+ ]), ft = this.performAction.apply(Q, [
278
+ f,
279
+ q,
280
+ O,
281
+ Z.yy,
282
+ K[1],
283
+ E,
284
+ h
285
+ ].concat(dt)), typeof ft < "u")
286
+ return ft;
287
+ j && (y = y.slice(0, -1 * j * 2), E = E.slice(0, -1 * j), h = h.slice(0, -1 * j)), y.push(this.productions_[K[1]][0]), E.push(Q.$), h.push(Q._$), Ot = W[y[y.length - 2]][y[y.length - 1]], y.push(Ot);
288
+ break;
289
+ case 3:
290
+ return !0;
291
+ }
292
+ }
293
+ return !0;
294
+ }, "parse")
295
+ }, _ = /* @__PURE__ */ (function() {
296
+ var T = {
297
+ EOF: 1,
298
+ parseError: /* @__PURE__ */ d(function(u, y) {
299
+ if (this.yy.parser)
300
+ this.yy.parser.parseError(u, y);
301
+ else
302
+ throw new Error(u);
303
+ }, "parseError"),
304
+ // resets the lexer, sets new input
305
+ setInput: /* @__PURE__ */ d(function(m, u) {
306
+ return this.yy = u || this.yy || {}, this._input = m, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
307
+ first_line: 1,
308
+ first_column: 0,
309
+ last_line: 1,
310
+ last_column: 0
311
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
312
+ }, "setInput"),
313
+ // consumes and returns one char from the input
314
+ input: /* @__PURE__ */ d(function() {
315
+ var m = this._input[0];
316
+ this.yytext += m, this.yyleng++, this.offset++, this.match += m, this.matched += m;
317
+ var u = m.match(/(?:\r\n?|\n).*/g);
318
+ return u ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), m;
319
+ }, "input"),
320
+ // unshifts one char (or a string) into the input
321
+ unput: /* @__PURE__ */ d(function(m) {
322
+ var u = m.length, y = m.split(/(?:\r\n?|\n)/g);
323
+ this._input = m + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - u), this.offset -= u;
324
+ var L = this.match.split(/(?:\r\n?|\n)/g);
325
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), y.length - 1 && (this.yylineno -= y.length - 1);
326
+ var E = this.yylloc.range;
327
+ return this.yylloc = {
328
+ first_line: this.yylloc.first_line,
329
+ last_line: this.yylineno + 1,
330
+ first_column: this.yylloc.first_column,
331
+ last_column: y ? (y.length === L.length ? this.yylloc.first_column : 0) + L[L.length - y.length].length - y[0].length : this.yylloc.first_column - u
332
+ }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - u]), this.yyleng = this.yytext.length, this;
333
+ }, "unput"),
334
+ // When called from action, caches matched text and appends it on next action
335
+ more: /* @__PURE__ */ d(function() {
336
+ return this._more = !0, this;
337
+ }, "more"),
338
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
339
+ reject: /* @__PURE__ */ d(function() {
340
+ if (this.options.backtrack_lexer)
341
+ this._backtrack = !0;
342
+ else
343
+ 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).
344
+ ` + this.showPosition(), {
345
+ text: "",
346
+ token: null,
347
+ line: this.yylineno
348
+ });
349
+ return this;
350
+ }, "reject"),
351
+ // retain first n characters of the match
352
+ less: /* @__PURE__ */ d(function(m) {
353
+ this.unput(this.match.slice(m));
354
+ }, "less"),
355
+ // displays already matched input, i.e. for error messages
356
+ pastInput: /* @__PURE__ */ d(function() {
357
+ var m = this.matched.substr(0, this.matched.length - this.match.length);
358
+ return (m.length > 20 ? "..." : "") + m.substr(-20).replace(/\n/g, "");
359
+ }, "pastInput"),
360
+ // displays upcoming input, i.e. for error messages
361
+ upcomingInput: /* @__PURE__ */ d(function() {
362
+ var m = this.match;
363
+ return m.length < 20 && (m += this._input.substr(0, 20 - m.length)), (m.substr(0, 20) + (m.length > 20 ? "..." : "")).replace(/\n/g, "");
364
+ }, "upcomingInput"),
365
+ // displays the character position where the lexing error occurred, i.e. for error messages
366
+ showPosition: /* @__PURE__ */ d(function() {
367
+ var m = this.pastInput(), u = new Array(m.length + 1).join("-");
368
+ return m + this.upcomingInput() + `
369
+ ` + u + "^";
370
+ }, "showPosition"),
371
+ // test the lexed token: return FALSE when not a match, otherwise return token
372
+ test_match: /* @__PURE__ */ d(function(m, u) {
373
+ var y, L, E;
374
+ if (this.options.backtrack_lexer && (E = {
375
+ yylineno: this.yylineno,
376
+ yylloc: {
377
+ first_line: this.yylloc.first_line,
378
+ last_line: this.last_line,
379
+ first_column: this.yylloc.first_column,
380
+ last_column: this.yylloc.last_column
381
+ },
382
+ yytext: this.yytext,
383
+ match: this.match,
384
+ matches: this.matches,
385
+ matched: this.matched,
386
+ yyleng: this.yyleng,
387
+ offset: this.offset,
388
+ _more: this._more,
389
+ _input: this._input,
390
+ yy: this.yy,
391
+ conditionStack: this.conditionStack.slice(0),
392
+ done: this.done
393
+ }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), L = m[0].match(/(?:\r\n?|\n).*/g), L && (this.yylineno += L.length), this.yylloc = {
394
+ first_line: this.yylloc.last_line,
395
+ last_line: this.yylineno + 1,
396
+ first_column: this.yylloc.last_column,
397
+ last_column: L ? L[L.length - 1].length - L[L.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + m[0].length
398
+ }, this.yytext += m[0], this.match += m[0], this.matches = m, 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(m[0].length), this.matched += m[0], y = this.performAction.call(this, this.yy, this, u, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), y)
399
+ return y;
400
+ if (this._backtrack) {
401
+ for (var h in E)
402
+ this[h] = E[h];
403
+ return !1;
404
+ }
405
+ return !1;
406
+ }, "test_match"),
407
+ // return next match in input
408
+ next: /* @__PURE__ */ d(function() {
409
+ if (this.done)
410
+ return this.EOF;
411
+ this._input || (this.done = !0);
412
+ var m, u, y, L;
413
+ this._more || (this.yytext = "", this.match = "");
414
+ for (var E = this._currentRules(), h = 0; h < E.length; h++)
415
+ if (y = this._input.match(this.rules[E[h]]), y && (!u || y[0].length > u[0].length)) {
416
+ if (u = y, L = h, this.options.backtrack_lexer) {
417
+ if (m = this.test_match(y, E[h]), m !== !1)
418
+ return m;
419
+ if (this._backtrack) {
420
+ u = !1;
421
+ continue;
422
+ } else
423
+ return !1;
424
+ } else if (!this.options.flex)
425
+ break;
426
+ }
427
+ return u ? (m = this.test_match(u, E[L]), m !== !1 ? m : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
428
+ ` + this.showPosition(), {
429
+ text: "",
430
+ token: null,
431
+ line: this.yylineno
432
+ });
433
+ }, "next"),
434
+ // return next match that has a token
435
+ lex: /* @__PURE__ */ d(function() {
436
+ var u = this.next();
437
+ return u || this.lex();
438
+ }, "lex"),
439
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
440
+ begin: /* @__PURE__ */ d(function(u) {
441
+ this.conditionStack.push(u);
442
+ }, "begin"),
443
+ // pop the previously active lexer condition state off the condition stack
444
+ popState: /* @__PURE__ */ d(function() {
445
+ var u = this.conditionStack.length - 1;
446
+ return u > 0 ? this.conditionStack.pop() : this.conditionStack[0];
447
+ }, "popState"),
448
+ // produce the lexer rule set which is active for the currently active lexer condition state
449
+ _currentRules: /* @__PURE__ */ d(function() {
450
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
451
+ }, "_currentRules"),
452
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
453
+ topState: /* @__PURE__ */ d(function(u) {
454
+ return u = this.conditionStack.length - 1 - Math.abs(u || 0), u >= 0 ? this.conditionStack[u] : "INITIAL";
455
+ }, "topState"),
456
+ // alias for begin(condition)
457
+ pushState: /* @__PURE__ */ d(function(u) {
458
+ this.begin(u);
459
+ }, "pushState"),
460
+ // return the number of states currently on the stack
461
+ stateStackSize: /* @__PURE__ */ d(function() {
462
+ return this.conditionStack.length;
463
+ }, "stateStackSize"),
464
+ options: {},
465
+ performAction: /* @__PURE__ */ d(function(u, y, L, E) {
466
+ switch (L) {
467
+ case 0:
468
+ return u.getLogger().debug("Found block-beta"), 10;
469
+ case 1:
470
+ return u.getLogger().debug("Found id-block"), 29;
471
+ case 2:
472
+ return u.getLogger().debug("Found block"), 10;
473
+ case 3:
474
+ u.getLogger().debug(".", y.yytext);
475
+ break;
476
+ case 4:
477
+ u.getLogger().debug("_", y.yytext);
478
+ break;
479
+ case 5:
480
+ return 5;
481
+ case 6:
482
+ return y.yytext = -1, 28;
483
+ case 7:
484
+ return y.yytext = y.yytext.replace(/columns\s+/, ""), u.getLogger().debug("COLUMNS (LEX)", y.yytext), 28;
485
+ case 8:
486
+ this.pushState("md_string");
487
+ break;
488
+ case 9:
489
+ return "MD_STR";
490
+ case 10:
491
+ this.popState();
492
+ break;
493
+ case 11:
494
+ this.pushState("string");
495
+ break;
496
+ case 12:
497
+ u.getLogger().debug("LEX: POPPING STR:", y.yytext), this.popState();
498
+ break;
499
+ case 13:
500
+ return u.getLogger().debug("LEX: STR end:", y.yytext), "STR";
501
+ case 14:
502
+ return y.yytext = y.yytext.replace(/space\:/, ""), u.getLogger().debug("SPACE NUM (LEX)", y.yytext), 21;
503
+ case 15:
504
+ return y.yytext = "1", u.getLogger().debug("COLUMNS (LEX)", y.yytext), 21;
505
+ case 16:
506
+ return 42;
507
+ case 17:
508
+ return "LINKSTYLE";
509
+ case 18:
510
+ return "INTERPOLATE";
511
+ case 19:
512
+ return this.pushState("CLASSDEF"), 39;
513
+ case 20:
514
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
515
+ case 21:
516
+ return this.popState(), this.pushState("CLASSDEFID"), 40;
517
+ case 22:
518
+ return this.popState(), 41;
519
+ case 23:
520
+ return this.pushState("CLASS"), 43;
521
+ case 24:
522
+ return this.popState(), this.pushState("CLASS_STYLE"), 44;
523
+ case 25:
524
+ return this.popState(), 45;
525
+ case 26:
526
+ return this.pushState("STYLE_STMNT"), 46;
527
+ case 27:
528
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
529
+ case 28:
530
+ return this.popState(), 48;
531
+ case 29:
532
+ return this.pushState("acc_title"), "acc_title";
533
+ case 30:
534
+ return this.popState(), "acc_title_value";
535
+ case 31:
536
+ return this.pushState("acc_descr"), "acc_descr";
537
+ case 32:
538
+ return this.popState(), "acc_descr_value";
539
+ case 33:
540
+ this.pushState("acc_descr_multiline");
541
+ break;
542
+ case 34:
543
+ this.popState();
544
+ break;
545
+ case 35:
546
+ return "acc_descr_multiline_value";
547
+ case 36:
548
+ return 30;
549
+ case 37:
550
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
551
+ case 38:
552
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
553
+ case 39:
554
+ return this.popState(), u.getLogger().debug("Lex: ))"), "NODE_DEND";
555
+ case 40:
556
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
557
+ case 41:
558
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
559
+ case 42:
560
+ return this.popState(), u.getLogger().debug("Lex: (-"), "NODE_DEND";
561
+ case 43:
562
+ return this.popState(), u.getLogger().debug("Lex: -)"), "NODE_DEND";
563
+ case 44:
564
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
565
+ case 45:
566
+ return this.popState(), u.getLogger().debug("Lex: ]]"), "NODE_DEND";
567
+ case 46:
568
+ return this.popState(), u.getLogger().debug("Lex: ("), "NODE_DEND";
569
+ case 47:
570
+ return this.popState(), u.getLogger().debug("Lex: ])"), "NODE_DEND";
571
+ case 48:
572
+ return this.popState(), u.getLogger().debug("Lex: /]"), "NODE_DEND";
573
+ case 49:
574
+ return this.popState(), u.getLogger().debug("Lex: /]"), "NODE_DEND";
575
+ case 50:
576
+ return this.popState(), u.getLogger().debug("Lex: )]"), "NODE_DEND";
577
+ case 51:
578
+ return this.popState(), u.getLogger().debug("Lex: )"), "NODE_DEND";
579
+ case 52:
580
+ return this.popState(), u.getLogger().debug("Lex: ]>"), "NODE_DEND";
581
+ case 53:
582
+ return this.popState(), u.getLogger().debug("Lex: ]"), "NODE_DEND";
583
+ case 54:
584
+ return u.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
585
+ case 55:
586
+ return u.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
587
+ case 56:
588
+ return u.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
589
+ case 57:
590
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
591
+ case 58:
592
+ return u.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
593
+ case 59:
594
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
595
+ case 60:
596
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
597
+ case 61:
598
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
599
+ case 62:
600
+ return u.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
601
+ case 63:
602
+ return u.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
603
+ case 64:
604
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
605
+ case 65:
606
+ return this.pushState("NODE"), 35;
607
+ case 66:
608
+ return this.pushState("NODE"), 35;
609
+ case 67:
610
+ return this.pushState("NODE"), 35;
611
+ case 68:
612
+ return this.pushState("NODE"), 35;
613
+ case 69:
614
+ return this.pushState("NODE"), 35;
615
+ case 70:
616
+ return this.pushState("NODE"), 35;
617
+ case 71:
618
+ return this.pushState("NODE"), 35;
619
+ case 72:
620
+ return u.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
621
+ case 73:
622
+ return this.pushState("BLOCK_ARROW"), u.getLogger().debug("LEX ARR START"), 37;
623
+ case 74:
624
+ return u.getLogger().debug("Lex: NODE_ID", y.yytext), 31;
625
+ case 75:
626
+ return u.getLogger().debug("Lex: EOF", y.yytext), 8;
627
+ case 76:
628
+ this.pushState("md_string");
629
+ break;
630
+ case 77:
631
+ this.pushState("md_string");
632
+ break;
633
+ case 78:
634
+ return "NODE_DESCR";
635
+ case 79:
636
+ this.popState();
637
+ break;
638
+ case 80:
639
+ u.getLogger().debug("Lex: Starting string"), this.pushState("string");
640
+ break;
641
+ case 81:
642
+ u.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
643
+ break;
644
+ case 82:
645
+ return u.getLogger().debug("LEX: NODE_DESCR:", y.yytext), "NODE_DESCR";
646
+ case 83:
647
+ u.getLogger().debug("LEX POPPING"), this.popState();
648
+ break;
649
+ case 84:
650
+ u.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
651
+ break;
652
+ case 85:
653
+ return y.yytext = y.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (right): dir:", y.yytext), "DIR";
654
+ case 86:
655
+ return y.yytext = y.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (left):", y.yytext), "DIR";
656
+ case 87:
657
+ return y.yytext = y.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (x):", y.yytext), "DIR";
658
+ case 88:
659
+ return y.yytext = y.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (y):", y.yytext), "DIR";
660
+ case 89:
661
+ return y.yytext = y.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (up):", y.yytext), "DIR";
662
+ case 90:
663
+ return y.yytext = y.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (down):", y.yytext), "DIR";
664
+ case 91:
665
+ return y.yytext = "]>", u.getLogger().debug("Lex (ARROW_DIR end):", y.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
666
+ case 92:
667
+ return u.getLogger().debug("Lex: LINK", "#" + y.yytext + "#"), 15;
668
+ case 93:
669
+ return u.getLogger().debug("Lex: LINK", y.yytext), 15;
670
+ case 94:
671
+ return u.getLogger().debug("Lex: LINK", y.yytext), 15;
672
+ case 95:
673
+ return u.getLogger().debug("Lex: LINK", y.yytext), 15;
674
+ case 96:
675
+ return u.getLogger().debug("Lex: START_LINK", y.yytext), this.pushState("LLABEL"), 16;
676
+ case 97:
677
+ return u.getLogger().debug("Lex: START_LINK", y.yytext), this.pushState("LLABEL"), 16;
678
+ case 98:
679
+ return u.getLogger().debug("Lex: START_LINK", y.yytext), this.pushState("LLABEL"), 16;
680
+ case 99:
681
+ this.pushState("md_string");
682
+ break;
683
+ case 100:
684
+ return u.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
685
+ case 101:
686
+ return this.popState(), u.getLogger().debug("Lex: LINK", "#" + y.yytext + "#"), 15;
687
+ case 102:
688
+ return this.popState(), u.getLogger().debug("Lex: LINK", y.yytext), 15;
689
+ case 103:
690
+ return this.popState(), u.getLogger().debug("Lex: LINK", y.yytext), 15;
691
+ case 104:
692
+ return u.getLogger().debug("Lex: COLON", y.yytext), y.yytext = y.yytext.slice(1), 27;
693
+ }
694
+ }, "anonymous"),
695
+ rules: [/^(?:block-beta\b)/, /^(?:block:)/, /^(?:block\b)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
696
+ conditions: { STYLE_DEFINITION: { rules: [28], inclusive: !1 }, STYLE_STMNT: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [22], inclusive: !1 }, CLASSDEF: { rules: [20, 21], inclusive: !1 }, CLASS_STYLE: { rules: [25], inclusive: !1 }, CLASS: { rules: [24], inclusive: !1 }, LLABEL: { rules: [99, 100, 101, 102, 103], inclusive: !1 }, ARROW_DIR: { rules: [85, 86, 87, 88, 89, 90, 91], inclusive: !1 }, BLOCK_ARROW: { rules: [76, 81, 84], inclusive: !1 }, NODE: { rules: [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 77, 80], inclusive: !1 }, md_string: { rules: [9, 10, 78, 79], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [12, 13, 82, 83], inclusive: !1 }, acc_descr_multiline: { rules: [34, 35], inclusive: !1 }, acc_descr: { rules: [32], inclusive: !1 }, acc_title: { rules: [30], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 23, 26, 29, 31, 33, 36, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 92, 93, 94, 95, 96, 97, 98, 104], inclusive: !0 } }
697
+ };
698
+ return T;
699
+ })();
700
+ S.lexer = _;
701
+ function I() {
702
+ this.yy = {};
703
+ }
704
+ return d(I, "Parser"), I.prototype = S, S.Parser = I, new I();
705
+ })();
706
+ mt.parser = mt;
707
+ var sr = mt, X = /* @__PURE__ */ new Map(), _t = [], St = /* @__PURE__ */ new Map(), zt = "color", Mt = "fill", ir = "bgFill", re = ",", nr = A(), lt = /* @__PURE__ */ new Map(), Tt = "", cr = /* @__PURE__ */ d((e) => Ge.sanitizeText(e, nr), "sanitizeText"), lr = /* @__PURE__ */ d(function(e, t = "") {
708
+ let a = lt.get(e);
709
+ a || (a = { id: e, styles: [], textStyles: [] }, lt.set(e, a)), t?.split(re).forEach((s) => {
710
+ const i = s.replace(/([^;]*);/, "$1").trim();
711
+ if (RegExp(zt).exec(s)) {
712
+ const r = i.replace(Mt, ir).replace(zt, Mt);
713
+ a.textStyles.push(r);
714
+ }
715
+ a.styles.push(i);
716
+ });
717
+ }, "addStyleClass"), or = /* @__PURE__ */ d(function(e, t = "") {
718
+ const a = X.get(e);
719
+ t != null && (a.styles = t.split(re));
720
+ }, "addStyle2Node"), hr = /* @__PURE__ */ d(function(e, t) {
721
+ e.split(",").forEach(function(a) {
722
+ let s = X.get(a);
723
+ if (s === void 0) {
724
+ const i = a.trim();
725
+ s = { id: i, type: "na", children: [] }, X.set(i, s);
726
+ }
727
+ s.classes || (s.classes = []), s.classes.push(t);
728
+ });
729
+ }, "setCssClass"), ae = /* @__PURE__ */ d((e, t) => {
730
+ const a = e.flat(), s = [], c = a.find((r) => r?.type === "column-setting")?.columns ?? -1;
731
+ for (const r of a) {
732
+ if (typeof c == "number" && c > 0 && r.type !== "column-setting" && typeof r.widthInColumns == "number" && r.widthInColumns > c && k.warn(
733
+ `Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`
734
+ ), r.label && (r.label = cr(r.label)), r.type === "classDef") {
735
+ lr(r.id, r.css);
736
+ continue;
737
+ }
738
+ if (r.type === "applyClass") {
739
+ hr(r.id, r?.styleClass ?? "");
740
+ continue;
741
+ }
742
+ if (r.type === "applyStyles") {
743
+ r?.stylesStr && or(r.id, r?.stylesStr);
744
+ continue;
745
+ }
746
+ if (r.type === "column-setting")
747
+ t.columns = r.columns ?? -1;
748
+ else if (r.type === "edge") {
749
+ const n = (St.get(r.id) ?? 0) + 1;
750
+ St.set(r.id, n), r.id = n + "-" + r.id, _t.push(r);
751
+ } else {
752
+ r.label || (r.type === "composite" ? r.label = "" : r.label = r.id);
753
+ const n = X.get(r.id);
754
+ if (n === void 0 ? X.set(r.id, r) : (r.type !== "na" && (n.type = r.type), r.label !== r.id && (n.label = r.label)), r.children && ae(r.children, r), r.type === "space") {
755
+ const l = r.width ?? 1;
756
+ for (let g = 0; g < l; g++) {
757
+ const o = $e(r);
758
+ o.id = o.id + "-" + g, X.set(o.id, o), s.push(o);
759
+ }
760
+ } else n === void 0 && s.push(r);
761
+ }
762
+ }
763
+ t.children = s;
764
+ }, "populateBlockDatabase"), Dt = [], rt = { id: "root", type: "composite", children: [], columns: -1 }, gr = /* @__PURE__ */ d(() => {
765
+ k.debug("Clear called"), We(), rt = { id: "root", type: "composite", children: [], columns: -1 }, X = /* @__PURE__ */ new Map([["root", rt]]), Dt = [], lt = /* @__PURE__ */ new Map(), _t = [], St = /* @__PURE__ */ new Map(), Tt = "";
766
+ }, "clear");
767
+ function se(e) {
768
+ switch (k.debug("typeStr2Type", e), e) {
769
+ case "[]":
770
+ return "square";
771
+ case "()":
772
+ return k.debug("we have a round"), "round";
773
+ case "(())":
774
+ return "circle";
775
+ case ">]":
776
+ return "rect_left_inv_arrow";
777
+ case "{}":
778
+ return "diamond";
779
+ case "{{}}":
780
+ return "hexagon";
781
+ case "([])":
782
+ return "stadium";
783
+ case "[[]]":
784
+ return "subroutine";
785
+ case "[()]":
786
+ return "cylinder";
787
+ case "((()))":
788
+ return "doublecircle";
789
+ case "[//]":
790
+ return "lean_right";
791
+ case "[\\\\]":
792
+ return "lean_left";
793
+ case "[/\\]":
794
+ return "trapezoid";
795
+ case "[\\/]":
796
+ return "inv_trapezoid";
797
+ case "<[]>":
798
+ return "block_arrow";
799
+ default:
800
+ return "na";
801
+ }
802
+ }
803
+ d(se, "typeStr2Type");
804
+ function ie(e) {
805
+ return k.debug("typeStr2Type", e), e === "==" ? "thick" : "normal";
806
+ }
807
+ d(ie, "edgeTypeStr2Type");
808
+ function ne(e) {
809
+ switch (e.trim().slice(-1)) {
810
+ case "x":
811
+ return "arrow_cross";
812
+ case "o":
813
+ return "arrow_circle";
814
+ case ">":
815
+ return "arrow_point";
816
+ default:
817
+ return "";
818
+ }
819
+ }
820
+ d(ne, "edgeStrToEdgeData");
821
+ function ce(e) {
822
+ switch (e.trim().charAt(0)) {
823
+ case "x":
824
+ return "arrow_cross";
825
+ case "o":
826
+ return "arrow_circle";
827
+ case "<":
828
+ return "arrow_point";
829
+ default:
830
+ return "arrow_open";
831
+ }
832
+ }
833
+ d(ce, "edgeStrToEdgeStartData");
834
+ function le(e) {
835
+ return e.includes("==") ? "thick" : "normal";
836
+ }
837
+ d(le, "edgeStrToThickness");
838
+ function oe(e) {
839
+ return e.includes(".-") ? "dotted" : "solid";
840
+ }
841
+ d(oe, "edgeStrToPattern");
842
+ var Pt = 0, dr = /* @__PURE__ */ d(() => (Pt++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Pt), "generateId"), ur = /* @__PURE__ */ d((e) => {
843
+ rt.children = e, ae(e, rt), Dt = rt.children;
844
+ }, "setHierarchy"), pr = /* @__PURE__ */ d((e) => {
845
+ const t = X.get(e);
846
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
847
+ }, "getColumns"), fr = /* @__PURE__ */ d(() => [...X.values()], "getBlocksFlat"), xr = /* @__PURE__ */ d(() => Dt || [], "getBlocks"), yr = /* @__PURE__ */ d(() => _t, "getEdges"), br = /* @__PURE__ */ d((e) => X.get(e), "getBlock"), wr = /* @__PURE__ */ d((e) => {
848
+ X.set(e.id, e);
849
+ }, "setBlock"), mr = /* @__PURE__ */ d((e) => {
850
+ Tt = e;
851
+ }, "setDiagramId"), Sr = /* @__PURE__ */ d(() => Tt, "getDiagramId"), Lr = /* @__PURE__ */ d(() => k, "getLogger"), kr = /* @__PURE__ */ d(function() {
852
+ return lt;
853
+ }, "getClasses"), vr = {
854
+ getConfig: /* @__PURE__ */ d(() => at().block, "getConfig"),
855
+ typeStr2Type: se,
856
+ edgeTypeStr2Type: ie,
857
+ edgeStrToEdgeData: ne,
858
+ edgeStrToEdgeStartData: ce,
859
+ edgeStrToThickness: le,
860
+ edgeStrToPattern: oe,
861
+ getLogger: Lr,
862
+ getBlocksFlat: fr,
863
+ getBlocks: xr,
864
+ getEdges: yr,
865
+ setHierarchy: ur,
866
+ getBlock: br,
867
+ setBlock: wr,
868
+ getColumns: pr,
869
+ getClasses: kr,
870
+ clear: gr,
871
+ generateId: dr,
872
+ setDiagramId: mr,
873
+ getDiagramId: Sr
874
+ }, Er = vr, bt = /* @__PURE__ */ d((e, t) => {
875
+ const a = Je, s = a(e, "r"), i = a(e, "g"), c = a(e, "b");
876
+ return Ye(s, i, c, t);
877
+ }, "fade"), _r = /* @__PURE__ */ d((e) => `.label {
878
+ font-family: ${e.fontFamily};
879
+ color: ${e.nodeTextColor || e.textColor};
880
+ }
881
+ .cluster-label text {
882
+ fill: ${e.titleColor};
883
+ }
884
+ .cluster-label span,p {
885
+ color: ${e.titleColor};
886
+ }
887
+
888
+
889
+
890
+ .label text,span,p {
891
+ fill: ${e.nodeTextColor || e.textColor};
892
+ color: ${e.nodeTextColor || e.textColor};
893
+ }
894
+
895
+ .node rect,
896
+ .node circle,
897
+ .node ellipse,
898
+ .node polygon,
899
+ .node path {
900
+ fill: ${e.mainBkg};
901
+ stroke: ${e.nodeBorder};
902
+ stroke-width: 1px;
903
+ }
904
+ .flowchart-label text {
905
+ text-anchor: middle;
906
+ }
907
+ // .flowchart-label .text-outer-tspan {
908
+ // text-anchor: middle;
909
+ // }
910
+ // .flowchart-label .text-inner-tspan {
911
+ // text-anchor: start;
912
+ // }
913
+
914
+ .node .label {
915
+ text-align: center;
916
+ }
917
+ .node.clickable {
918
+ cursor: pointer;
919
+ }
920
+
921
+ .arrowheadPath {
922
+ fill: ${e.arrowheadColor};
923
+ }
924
+
925
+ .edgePath .path {
926
+ stroke: ${e.lineColor};
927
+ stroke-width: 2.0px;
928
+ }
929
+
930
+ .flowchart-link {
931
+ stroke: ${e.lineColor};
932
+ fill: none;
933
+ }
934
+
935
+ .edgeLabel {
936
+ background-color: ${e.edgeLabelBackground};
937
+ /*
938
+ * This is for backward compatibility with existing code that didn't
939
+ * add a \`<p>\` around edge labels.
940
+ *
941
+ * TODO: We should probably remove this in a future release.
942
+ */
943
+ p {
944
+ margin: 0;
945
+ padding: 0;
946
+ display: inline;
947
+ }
948
+ rect {
949
+ opacity: 0.5;
950
+ background-color: ${e.edgeLabelBackground};
951
+ fill: ${e.edgeLabelBackground};
952
+ }
953
+ text-align: center;
954
+ }
955
+
956
+ /* For html labels only */
957
+ .labelBkg {
958
+ background-color: ${e.edgeLabelBackground};
959
+ }
960
+
961
+ .node .cluster {
962
+ // fill: ${bt(e.mainBkg, 0.5)};
963
+ fill: ${bt(e.clusterBkg, 0.5)};
964
+ stroke: ${bt(e.clusterBorder, 0.2)};
965
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
966
+ stroke-width: 1px;
967
+ }
968
+
969
+ .cluster text {
970
+ fill: ${e.titleColor};
971
+ }
972
+
973
+ .cluster span,p {
974
+ color: ${e.titleColor};
975
+ }
976
+ /* .cluster div {
977
+ color: ${e.titleColor};
978
+ } */
979
+
980
+ div.mermaidTooltip {
981
+ position: absolute;
982
+ text-align: center;
983
+ max-width: 200px;
984
+ padding: 2px;
985
+ font-family: ${e.fontFamily};
986
+ font-size: 12px;
987
+ background: ${e.tertiaryColor};
988
+ border: 1px solid ${e.border2};
989
+ border-radius: 2px;
990
+ pointer-events: none;
991
+ z-index: 100;
992
+ }
993
+
994
+ .flowchartTitleText {
995
+ text-anchor: middle;
996
+ font-size: 18px;
997
+ fill: ${e.textColor};
998
+ }
999
+ ${Ee()}
1000
+ `, "getStyles"), Tr = _r, Dr = /* @__PURE__ */ d((e, t, a, s) => {
1001
+ t.forEach((i) => {
1002
+ Pr[i](e, a, s);
1003
+ });
1004
+ }, "insertMarkers"), Br = /* @__PURE__ */ d((e, t, a) => {
1005
+ k.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
1006
+ }, "extension"), Nr = /* @__PURE__ */ d((e, t, a) => {
1007
+ e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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");
1008
+ }, "composition"), Ir = /* @__PURE__ */ d((e, t, a) => {
1009
+ e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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");
1010
+ }, "aggregation"), Cr = /* @__PURE__ */ d((e, t, a) => {
1011
+ e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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");
1012
+ }, "dependency"), Or = /* @__PURE__ */ d((e, t, a) => {
1013
+ e.append("defs").append("marker").attr("id", a + "_" + 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", a + "_" + 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);
1014
+ }, "lollipop"), Rr = /* @__PURE__ */ d((e, t, a) => {
1015
+ e.append("marker").attr("id", a + "_" + 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", a + "_" + 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");
1016
+ }, "point"), Ar = /* @__PURE__ */ d((e, t, a) => {
1017
+ e.append("marker").attr("id", a + "_" + 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", a + "_" + 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");
1018
+ }, "circle"), zr = /* @__PURE__ */ d((e, t, a) => {
1019
+ e.append("marker").attr("id", a + "_" + 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", a + "_" + 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");
1020
+ }, "cross"), Mr = /* @__PURE__ */ d((e, t, a) => {
1021
+ e.append("defs").append("marker").attr("id", a + "_" + 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");
1022
+ }, "barb"), Pr = {
1023
+ extension: Br,
1024
+ composition: Nr,
1025
+ aggregation: Ir,
1026
+ dependency: Cr,
1027
+ lollipop: Or,
1028
+ point: Rr,
1029
+ circle: Ar,
1030
+ cross: zr,
1031
+ barb: Mr
1032
+ }, Fr = Dr, C = A()?.block?.padding ?? 8;
1033
+ function Lt(e, t) {
1034
+ if (e === 0 || !Number.isInteger(e))
1035
+ throw new Error("Columns must be an integer !== 0.");
1036
+ if (t < 0 || !Number.isInteger(t))
1037
+ throw new Error("Position must be a non-negative integer." + t);
1038
+ if (e < 0)
1039
+ return { px: t, py: 0 };
1040
+ if (e === 1)
1041
+ return { px: 0, py: t };
1042
+ const a = t % e, s = Math.floor(t / e);
1043
+ return { px: a, py: s };
1044
+ }
1045
+ d(Lt, "calculateBlockPosition");
1046
+ var Wr = /* @__PURE__ */ d((e) => {
1047
+ let t = 0, a = 0;
1048
+ for (const s of e.children) {
1049
+ const { width: i, height: c, x: r, y: n } = s.size ?? { width: 0, height: 0, x: 0, y: 0 };
1050
+ if (k.debug(
1051
+ "getMaxChildSize abc95 child:",
1052
+ s.id,
1053
+ "width:",
1054
+ i,
1055
+ "height:",
1056
+ c,
1057
+ "x:",
1058
+ r,
1059
+ "y:",
1060
+ n,
1061
+ s.type
1062
+ ), s.type === "space")
1063
+ continue;
1064
+ const l = i / (s.widthInColumns ?? 1);
1065
+ l > t && (t = l), c > a && (a = c);
1066
+ }
1067
+ return { width: t, height: a };
1068
+ }, "getMaxChildSize");
1069
+ function ot(e, t, a = 0, s = 0) {
1070
+ k.debug(
1071
+ "setBlockSizes abc95 (start)",
1072
+ e.id,
1073
+ e?.size?.x,
1074
+ "block width =",
1075
+ e?.size,
1076
+ "siblingWidth",
1077
+ a
1078
+ ), e?.size?.width || (e.size = {
1079
+ width: a,
1080
+ height: s,
1081
+ x: 0,
1082
+ y: 0
1083
+ });
1084
+ let i = 0, c = 0;
1085
+ if (e.children?.length > 0) {
1086
+ for (const x of e.children)
1087
+ ot(x, t);
1088
+ const r = Wr(e);
1089
+ i = r.width, c = r.height, k.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", i, c);
1090
+ for (const x of e.children)
1091
+ x.size && (k.debug(
1092
+ `abc95 Setting size of children of ${e.id} id=${x.id} ${i} ${c} ${JSON.stringify(x.size)}`
1093
+ ), x.size.width = i * (x.widthInColumns ?? 1) + C * ((x.widthInColumns ?? 1) - 1), x.size.height = c, x.size.x = 0, x.size.y = 0, k.debug(
1094
+ `abc95 updating size of ${e.id} children child:${x.id} maxWidth:${i} maxHeight:${c}`
1095
+ ));
1096
+ for (const x of e.children)
1097
+ ot(x, t, i, c);
1098
+ const n = e.columns ?? -1;
1099
+ let l = 0;
1100
+ for (const x of e.children)
1101
+ l += x.widthInColumns ?? 1;
1102
+ let g = e.children.length;
1103
+ n > 0 && n < l && (g = n);
1104
+ const o = Math.ceil(l / g);
1105
+ let p = g * (i + C) + C, b = o * (c + C) + C;
1106
+ if (p < a) {
1107
+ k.debug(
1108
+ `Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${s} width ${p}`
1109
+ ), p = a, b = s;
1110
+ const x = (a - g * C - C) / g, w = (s - o * C - C) / o;
1111
+ k.debug("Size indata abc88", e.id, "childWidth", x, "maxWidth", i), k.debug("Size indata abc88", e.id, "childHeight", w, "maxHeight", c), k.debug("Size indata abc88 xSize", g, "padding", C);
1112
+ for (const v of e.children)
1113
+ v.size && (v.size.width = x, v.size.height = w, v.size.x = 0, v.size.y = 0);
1114
+ }
1115
+ if (k.debug(
1116
+ `abc95 (finale calc) ${e.id} xSize ${g} ySize ${o} columns ${n}${e.children.length} width=${Math.max(p, e.size?.width || 0)}`
1117
+ ), p < (e?.size?.width || 0)) {
1118
+ p = e?.size?.width || 0;
1119
+ const x = n > 0 ? Math.min(e.children.length, n) : e.children.length;
1120
+ if (x > 0) {
1121
+ const w = (p - x * C - C) / x;
1122
+ k.debug("abc95 (growing to fit) width", e.id, p, e.size?.width, w);
1123
+ for (const v of e.children)
1124
+ v.size && (v.size.width = w);
1125
+ }
1126
+ }
1127
+ e.size = {
1128
+ width: p,
1129
+ height: b,
1130
+ x: 0,
1131
+ y: 0
1132
+ };
1133
+ }
1134
+ k.debug(
1135
+ "setBlockSizes abc94 (done)",
1136
+ e.id,
1137
+ e?.size?.x,
1138
+ e?.size?.width,
1139
+ e?.size?.y,
1140
+ e?.size?.height
1141
+ );
1142
+ }
1143
+ d(ot, "setBlockSizes");
1144
+ function Bt(e, t) {
1145
+ k.debug(
1146
+ `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`
1147
+ );
1148
+ const a = e.columns ?? -1;
1149
+ if (k.debug("layoutBlocks columns abc95", e.id, "=>", a, e), e.children && // find max width of children
1150
+ e.children.length > 0) {
1151
+ const s = e?.children[0]?.size?.width ?? 0, i = e.children.length * s + (e.children.length - 1) * C;
1152
+ k.debug("widthOfChildren 88", i, "posX");
1153
+ const c = /* @__PURE__ */ new Map();
1154
+ {
1155
+ let o = 0;
1156
+ for (const p of e.children) {
1157
+ if (!p.size)
1158
+ continue;
1159
+ const { py: b } = Lt(a, o), x = c.get(b) ?? 0;
1160
+ p.size.height > x && c.set(b, p.size.height);
1161
+ let w = p?.widthInColumns ?? 1;
1162
+ a > 0 && (w = Math.min(w, a - o % a)), o += w;
1163
+ }
1164
+ }
1165
+ const r = /* @__PURE__ */ new Map();
1166
+ {
1167
+ let o = 0;
1168
+ const p = [...c.keys()].sort((b, x) => b - x);
1169
+ for (const b of p)
1170
+ r.set(b, o), o += (c.get(b) ?? 0) + C;
1171
+ }
1172
+ let n = 0;
1173
+ k.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1174
+ let l = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -C, g = 0;
1175
+ for (const o of e.children) {
1176
+ const p = e;
1177
+ if (!o.size)
1178
+ continue;
1179
+ const { width: b, height: x } = o.size, { px: w, py: v } = Lt(a, n);
1180
+ if (v != g && (g = v, l = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -C, k.debug("New row in layout for block", e.id, " and child ", o.id, g)), k.debug(
1181
+ `abc89 layout blocks (child) id: ${o.id} Pos: ${n} (px, py) ${w},${v} (${p?.size?.x},${p?.size?.y}) parent: ${p.id} width: ${b}${C}`
1182
+ ), p.size) {
1183
+ const _ = b / 2;
1184
+ o.size.x = l + C + _, k.debug(
1185
+ `abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${l} new startingPosX${o.size.x} ${_} padding=${C} width=${b} halfWidth=${_} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${b * (o?.widthInColumns ?? 1) / 2}`
1186
+ ), l = o.size.x + _;
1187
+ const I = r.get(v) ?? 0, T = c.get(v) ?? x;
1188
+ o.size.y = p.size.y - p.size.height / 2 + I + T / 2 + C, k.debug(
1189
+ `abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${l}${C}${_}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${b * (o?.widthInColumns ?? 1) / 2}`
1190
+ );
1191
+ }
1192
+ o.children && Bt(o);
1193
+ let S = o?.widthInColumns ?? 1;
1194
+ a > 0 && (S = Math.min(S, a - n % a)), n += S, k.debug("abc88 columnsPos", o, n);
1195
+ }
1196
+ }
1197
+ k.debug(
1198
+ `layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`
1199
+ );
1200
+ }
1201
+ d(Bt, "layoutBlocks");
1202
+ function Nt(e, { minX: t, minY: a, maxX: s, maxY: i } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1203
+ if (e.size && e.id !== "root") {
1204
+ const { x: c, y: r, width: n, height: l } = e.size;
1205
+ c - n / 2 < t && (t = c - n / 2), r - l / 2 < a && (a = r - l / 2), c + n / 2 > s && (s = c + n / 2), r + l / 2 > i && (i = r + l / 2);
1206
+ }
1207
+ if (e.children)
1208
+ for (const c of e.children)
1209
+ ({ minX: t, minY: a, maxX: s, maxY: i } = Nt(c, { minX: t, minY: a, maxX: s, maxY: i }));
1210
+ return { minX: t, minY: a, maxX: s, maxY: i };
1211
+ }
1212
+ d(Nt, "findBounds");
1213
+ function he(e) {
1214
+ const t = e.getBlock("root");
1215
+ if (!t)
1216
+ return;
1217
+ ot(t, e, 0, 0), Bt(t), k.debug("getBlocks", JSON.stringify(t, null, 2));
1218
+ const { minX: a, minY: s, maxX: i, maxY: c } = Nt(t), r = c - s, n = i - a;
1219
+ return { x: a, y: s, width: n, height: r };
1220
+ }
1221
+ d(he, "layout");
1222
+ var Yr = /* @__PURE__ */ d(async (e, t, a, s = !1, i = !1) => {
1223
+ let c = t || "";
1224
+ typeof c == "object" && (c = c[0]);
1225
+ const r = A(), n = P(r);
1226
+ return await Et(
1227
+ e,
1228
+ c,
1229
+ {
1230
+ style: a,
1231
+ isTitle: s,
1232
+ useHtmlLabels: n,
1233
+ markdown: !1,
1234
+ isNode: i,
1235
+ width: Number.POSITIVE_INFINITY
1236
+ },
1237
+ r
1238
+ );
1239
+ }, "createLabel"), U = Yr, Hr = /* @__PURE__ */ d((e, t, a, s, i) => {
1240
+ t.arrowTypeStart && Ft(e, "start", t.arrowTypeStart, a, s, i), t.arrowTypeEnd && Ft(e, "end", t.arrowTypeEnd, a, s, i);
1241
+ }, "addEdgeMarkers"), Kr = {
1242
+ arrow_cross: "cross",
1243
+ arrow_point: "point",
1244
+ arrow_barb: "barb",
1245
+ arrow_circle: "circle",
1246
+ aggregation: "aggregation",
1247
+ extension: "extension",
1248
+ composition: "composition",
1249
+ dependency: "dependency",
1250
+ lollipop: "lollipop"
1251
+ }, Ft = /* @__PURE__ */ d((e, t, a, s, i, c) => {
1252
+ const r = Kr[a];
1253
+ if (!r) {
1254
+ k.warn(`Unknown arrow type: ${a}`);
1255
+ return;
1256
+ }
1257
+ const n = t === "start" ? "Start" : "End";
1258
+ e.attr(`marker-${t}`, `url(${s}#${i}_${c}-${r}${n})`);
1259
+ }, "addEdgeMarker"), kt = {}, M = {}, Ur = /* @__PURE__ */ d(async (e, t) => {
1260
+ const a = A(), s = P(a), i = e.insert("g").attr("class", "edgeLabel"), c = i.insert("g").attr("class", "label"), r = t.labelType === "markdown", n = await Et(
1261
+ e,
1262
+ t.label,
1263
+ {
1264
+ style: t.labelStyle,
1265
+ useHtmlLabels: s,
1266
+ // TODO: The old code only set addSvgBackground when using markdown, but
1267
+ // this function is only used by block diagrams which never use markdown.
1268
+ addSvgBackground: r,
1269
+ isNode: !1,
1270
+ markdown: r,
1271
+ // If using markdown, wrap using default width
1272
+ width: r ? void 0 : Number.POSITIVE_INFINITY
1273
+ },
1274
+ a
1275
+ );
1276
+ c.node().appendChild(n);
1277
+ let l = n.getBBox(), g = l;
1278
+ if (s) {
1279
+ const p = n.children[0], b = D(n);
1280
+ l = p.getBoundingClientRect(), g = l, b.attr("width", l.width), b.attr("height", l.height);
1281
+ } else {
1282
+ const p = D(n).select("text").node();
1283
+ p && typeof p.getBBox == "function" && (g = p.getBBox());
1284
+ }
1285
+ c.attr("transform", $(g, s)), kt[t.id] = i, t.width = l.width, t.height = l.height;
1286
+ let o;
1287
+ if (t.startLabelLeft) {
1288
+ const p = e.insert("g").attr("class", "edgeTerminals"), b = p.insert("g").attr("class", "inner"), x = await U(b, t.startLabelLeft, t.labelStyle);
1289
+ o = x;
1290
+ let w = x.getBBox();
1291
+ if (s) {
1292
+ const v = x.children[0], S = D(x);
1293
+ w = v.getBoundingClientRect(), S.attr("width", w.width), S.attr("height", w.height);
1294
+ }
1295
+ b.attr("transform", $(w, s)), M[t.id] || (M[t.id] = {}), M[t.id].startLeft = p, et(o, t.startLabelLeft);
1296
+ }
1297
+ if (t.startLabelRight) {
1298
+ const p = e.insert("g").attr("class", "edgeTerminals"), b = p.insert("g").attr("class", "inner"), x = await U(b, t.startLabelRight, t.labelStyle);
1299
+ o = x;
1300
+ let w = x.getBBox();
1301
+ if (s) {
1302
+ const v = x.children[0], S = D(x);
1303
+ w = v.getBoundingClientRect(), S.attr("width", w.width), S.attr("height", w.height);
1304
+ }
1305
+ b.attr("transform", $(w, s)), M[t.id] || (M[t.id] = {}), M[t.id].startRight = p, et(o, t.startLabelRight);
1306
+ }
1307
+ if (t.endLabelLeft) {
1308
+ const p = e.insert("g").attr("class", "edgeTerminals"), b = p.insert("g").attr("class", "inner"), x = await U(p, t.endLabelLeft, t.labelStyle);
1309
+ o = x;
1310
+ let w = x.getBBox();
1311
+ if (s) {
1312
+ const v = x.children[0], S = D(x);
1313
+ w = v.getBoundingClientRect(), S.attr("width", w.width), S.attr("height", w.height);
1314
+ }
1315
+ b.attr("transform", $(w, s)), M[t.id] || (M[t.id] = {}), M[t.id].endLeft = p, et(o, t.endLabelLeft);
1316
+ }
1317
+ if (t.endLabelRight) {
1318
+ const p = e.insert("g").attr("class", "edgeTerminals"), b = p.insert("g").attr("class", "inner"), x = await U(
1319
+ p,
1320
+ t.endLabelRight,
1321
+ t.labelStyle
1322
+ );
1323
+ o = x;
1324
+ let w = x.getBBox();
1325
+ if (s) {
1326
+ const v = x.children[0], S = D(x);
1327
+ w = v.getBoundingClientRect(), S.attr("width", w.width), S.attr("height", w.height);
1328
+ }
1329
+ b.attr("transform", $(w, s)), M[t.id] || (M[t.id] = {}), M[t.id].endRight = p, et(o, t.endLabelRight);
1330
+ }
1331
+ return n;
1332
+ }, "insertEdgeLabel");
1333
+ function et(e, t) {
1334
+ P(A()) && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1335
+ }
1336
+ d(et, "setTerminalWidth");
1337
+ var Xr = /* @__PURE__ */ d((e, t) => {
1338
+ k.debug("Moving label abc88 ", e.id, e.label, kt[e.id], t);
1339
+ let a = t.updatedPath ? t.updatedPath : t.originalPath;
1340
+ const s = A(), { subGraphTitleTotalMargin: i } = Ve(s);
1341
+ if (e.label) {
1342
+ const c = kt[e.id];
1343
+ let r = e.x, n = e.y;
1344
+ if (a) {
1345
+ const l = tt.calcLabelPosition(a);
1346
+ k.debug(
1347
+ "Moving label " + e.label + " from (",
1348
+ r,
1349
+ ",",
1350
+ n,
1351
+ ") to (",
1352
+ l.x,
1353
+ ",",
1354
+ l.y,
1355
+ ") abc88"
1356
+ ), t.updatedPath && (r = l.x, n = l.y);
1357
+ }
1358
+ c.attr("transform", `translate(${r}, ${n + i / 2})`);
1359
+ }
1360
+ if (e.startLabelLeft) {
1361
+ const c = M[e.id].startLeft;
1362
+ let r = e.x, n = e.y;
1363
+ if (a) {
1364
+ const l = tt.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
1365
+ r = l.x, n = l.y;
1366
+ }
1367
+ c.attr("transform", `translate(${r}, ${n})`);
1368
+ }
1369
+ if (e.startLabelRight) {
1370
+ const c = M[e.id].startRight;
1371
+ let r = e.x, n = e.y;
1372
+ if (a) {
1373
+ const l = tt.calcTerminalLabelPosition(
1374
+ e.arrowTypeStart ? 10 : 0,
1375
+ "start_right",
1376
+ a
1377
+ );
1378
+ r = l.x, n = l.y;
1379
+ }
1380
+ c.attr("transform", `translate(${r}, ${n})`);
1381
+ }
1382
+ if (e.endLabelLeft) {
1383
+ const c = M[e.id].endLeft;
1384
+ let r = e.x, n = e.y;
1385
+ if (a) {
1386
+ const l = tt.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
1387
+ r = l.x, n = l.y;
1388
+ }
1389
+ c.attr("transform", `translate(${r}, ${n})`);
1390
+ }
1391
+ if (e.endLabelRight) {
1392
+ const c = M[e.id].endRight;
1393
+ let r = e.x, n = e.y;
1394
+ if (a) {
1395
+ const l = tt.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
1396
+ r = l.x, n = l.y;
1397
+ }
1398
+ c.attr("transform", `translate(${r}, ${n})`);
1399
+ }
1400
+ }, "positionEdgeLabel"), Vr = /* @__PURE__ */ d((e, t) => {
1401
+ const a = e.x, s = e.y, i = Math.abs(t.x - a), c = Math.abs(t.y - s), r = e.width / 2, n = e.height / 2;
1402
+ return i >= r || c >= n;
1403
+ }, "outsideNode"), Gr = /* @__PURE__ */ d((e, t, a) => {
1404
+ k.debug(`intersection calc abc89:
1405
+ outsidePoint: ${JSON.stringify(t)}
1406
+ insidePoint : ${JSON.stringify(a)}
1407
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1408
+ const s = e.x, i = e.y, c = Math.abs(s - a.x), r = e.width / 2;
1409
+ let n = a.x < t.x ? r - c : r + c;
1410
+ const l = e.height / 2, g = Math.abs(t.y - a.y), o = Math.abs(t.x - a.x);
1411
+ if (Math.abs(i - t.y) * r > Math.abs(s - t.x) * l) {
1412
+ let p = a.y < t.y ? t.y - l - i : i - l - t.y;
1413
+ n = o * p / g;
1414
+ const b = {
1415
+ x: a.x < t.x ? a.x + n : a.x - o + n,
1416
+ y: a.y < t.y ? a.y + g - p : a.y - g + p
1417
+ };
1418
+ return n === 0 && (b.x = t.x, b.y = t.y), o === 0 && (b.x = t.x), g === 0 && (b.y = t.y), k.debug(`abc89 topp/bott calc, Q ${g}, q ${p}, R ${o}, r ${n}`, b), b;
1419
+ } else {
1420
+ a.x < t.x ? n = t.x - r - s : n = s - r - t.x;
1421
+ let p = g * n / o, b = a.x < t.x ? a.x + o - n : a.x - o + n, x = a.y < t.y ? a.y + p : a.y - p;
1422
+ return k.debug(`sides calc abc89, Q ${g}, q ${p}, R ${o}, r ${n}`, { _x: b, _y: x }), n === 0 && (b = t.x, x = t.y), o === 0 && (b = t.x), g === 0 && (x = t.y), { x: b, y: x };
1423
+ }
1424
+ }, "intersection"), Wt = /* @__PURE__ */ d((e, t) => {
1425
+ k.debug("abc88 cutPathAtIntersect", e, t);
1426
+ let a = [], s = e[0], i = !1;
1427
+ return e.forEach((c) => {
1428
+ if (!Vr(t, c) && !i) {
1429
+ const r = Gr(t, s, c);
1430
+ let n = !1;
1431
+ a.forEach((l) => {
1432
+ n = n || l.x === r.x && l.y === r.y;
1433
+ }), a.some((l) => l.x === r.x && l.y === r.y) || a.push(r), i = !0;
1434
+ } else
1435
+ s = c, i || a.push(c);
1436
+ }), a;
1437
+ }, "cutPathAtIntersect"), Zr = /* @__PURE__ */ d(function(e, t, a, s, i, c, r) {
1438
+ let n = a.points;
1439
+ k.debug("abc88 InsertEdge: edge=", a, "e=", t);
1440
+ let l = !1;
1441
+ const g = c.node(t.v);
1442
+ var o = c.node(t.w);
1443
+ o?.intersect && g?.intersect && (n = n.slice(1, a.points.length - 1), n.unshift(g.intersect(n[0])), n.push(o.intersect(n[n.length - 1]))), a.toCluster && (k.debug("to cluster abc88", s[a.toCluster]), n = Wt(a.points, s[a.toCluster].node), l = !0), a.fromCluster && (k.debug("from cluster abc88", s[a.fromCluster]), n = Wt(n.reverse(), s[a.fromCluster].node).reverse(), l = !0);
1444
+ const p = n.filter((m) => !Number.isNaN(m.y));
1445
+ let b = Ue;
1446
+ a.curve && (i === "graph" || i === "flowchart") && (b = a.curve);
1447
+ const { x, y: w } = He(a), v = Ke().x(x).y(w).curve(b);
1448
+ let S;
1449
+ switch (a.thickness) {
1450
+ case "normal":
1451
+ S = "edge-thickness-normal";
1452
+ break;
1453
+ case "thick":
1454
+ S = "edge-thickness-thick";
1455
+ break;
1456
+ case "invisible":
1457
+ S = "edge-thickness-thick";
1458
+ break;
1459
+ default:
1460
+ S = "";
1461
+ }
1462
+ switch (a.pattern) {
1463
+ case "solid":
1464
+ S += " edge-pattern-solid";
1465
+ break;
1466
+ case "dotted":
1467
+ S += " edge-pattern-dotted";
1468
+ break;
1469
+ case "dashed":
1470
+ S += " edge-pattern-dashed";
1471
+ break;
1472
+ }
1473
+ const _ = e.append("path").attr("d", v(p)).attr("id", a.id).attr("class", " " + S + (a.classes ? " " + a.classes : "")).attr("style", a.style);
1474
+ let I = "";
1475
+ (A().flowchart.arrowMarkerAbsolute || A().state.arrowMarkerAbsolute) && (I = Xe(!0)), Hr(_, a, I, r, i);
1476
+ let T = {};
1477
+ return l && (T.updatedPath = n), T.originalPath = a.points, T;
1478
+ }, "insertEdge"), jr = /* @__PURE__ */ d((e) => {
1479
+ const t = /* @__PURE__ */ new Set();
1480
+ for (const a of e)
1481
+ switch (a) {
1482
+ case "x":
1483
+ t.add("right"), t.add("left");
1484
+ break;
1485
+ case "y":
1486
+ t.add("up"), t.add("down");
1487
+ break;
1488
+ default:
1489
+ t.add(a);
1490
+ break;
1491
+ }
1492
+ return t;
1493
+ }, "expandAndDeduplicateDirections"), qr = /* @__PURE__ */ d((e, t, a, s) => {
1494
+ const i = jr(e), c = 2, r = t.height + 2 * a.padding, n = r / c, l = s ?? t.width + 2 * n + a.padding, g = a.padding / 2;
1495
+ return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
1496
+ // Bottom
1497
+ { x: 0, y: 0 },
1498
+ { x: n, y: 0 },
1499
+ { x: l / 2, y: 2 * g },
1500
+ { x: l - n, y: 0 },
1501
+ { x: l, y: 0 },
1502
+ // Right
1503
+ { x: l, y: -r / 3 },
1504
+ { x: l + 2 * g, y: -r / 2 },
1505
+ { x: l, y: -2 * r / 3 },
1506
+ { x: l, y: -r },
1507
+ // Top
1508
+ { x: l - n, y: -r },
1509
+ { x: l / 2, y: -r - 2 * g },
1510
+ { x: n, y: -r },
1511
+ // Left
1512
+ { x: 0, y: -r },
1513
+ { x: 0, y: -2 * r / 3 },
1514
+ { x: -2 * g, y: -r / 2 },
1515
+ { x: 0, y: -r / 3 }
1516
+ ] : i.has("right") && i.has("left") && i.has("up") ? [
1517
+ { x: n, y: 0 },
1518
+ { x: l - n, y: 0 },
1519
+ { x: l, y: -r / 2 },
1520
+ { x: l - n, y: -r },
1521
+ { x: n, y: -r },
1522
+ { x: 0, y: -r / 2 }
1523
+ ] : i.has("right") && i.has("left") && i.has("down") ? [
1524
+ { x: 0, y: 0 },
1525
+ { x: n, y: -r },
1526
+ { x: l - n, y: -r },
1527
+ { x: l, y: 0 }
1528
+ ] : i.has("right") && i.has("up") && i.has("down") ? [
1529
+ { x: 0, y: 0 },
1530
+ { x: l, y: -n },
1531
+ { x: l, y: -r + n },
1532
+ { x: 0, y: -r }
1533
+ ] : i.has("left") && i.has("up") && i.has("down") ? [
1534
+ { x: l, y: 0 },
1535
+ { x: 0, y: -n },
1536
+ { x: 0, y: -r + n },
1537
+ { x: l, y: -r }
1538
+ ] : i.has("right") && i.has("left") ? [
1539
+ { x: n, y: 0 },
1540
+ { x: n, y: -g },
1541
+ { x: l - n, y: -g },
1542
+ { x: l - n, y: 0 },
1543
+ { x: l, y: -r / 2 },
1544
+ { x: l - n, y: -r },
1545
+ { x: l - n, y: -r + g },
1546
+ { x: n, y: -r + g },
1547
+ { x: n, y: -r },
1548
+ { x: 0, y: -r / 2 }
1549
+ ] : i.has("up") && i.has("down") ? [
1550
+ // Bottom center
1551
+ { x: l / 2, y: 0 },
1552
+ // Left pont of bottom arrow
1553
+ { x: 0, y: -g },
1554
+ { x: n, y: -g },
1555
+ // Left top over vertical section
1556
+ { x: n, y: -r + g },
1557
+ { x: 0, y: -r + g },
1558
+ // Top of arrow
1559
+ { x: l / 2, y: -r },
1560
+ { x: l, y: -r + g },
1561
+ // Top of right vertical bar
1562
+ { x: l - n, y: -r + g },
1563
+ { x: l - n, y: -g },
1564
+ { x: l, y: -g }
1565
+ ] : i.has("right") && i.has("up") ? [
1566
+ { x: 0, y: 0 },
1567
+ { x: l, y: -n },
1568
+ { x: 0, y: -r }
1569
+ ] : i.has("right") && i.has("down") ? [
1570
+ { x: 0, y: 0 },
1571
+ { x: l, y: 0 },
1572
+ { x: 0, y: -r }
1573
+ ] : i.has("left") && i.has("up") ? [
1574
+ { x: l, y: 0 },
1575
+ { x: 0, y: -n },
1576
+ { x: l, y: -r }
1577
+ ] : i.has("left") && i.has("down") ? [
1578
+ { x: l, y: 0 },
1579
+ { x: 0, y: 0 },
1580
+ { x: l, y: -r }
1581
+ ] : i.has("right") ? [
1582
+ { x: n, y: -g },
1583
+ { x: n, y: -g },
1584
+ { x: l - n, y: -g },
1585
+ { x: l - n, y: 0 },
1586
+ { x: l, y: -r / 2 },
1587
+ { x: l - n, y: -r },
1588
+ { x: l - n, y: -r + g },
1589
+ // top left corner of arrow
1590
+ { x: n, y: -r + g },
1591
+ { x: n, y: -r + g }
1592
+ ] : i.has("left") ? [
1593
+ { x: n, y: 0 },
1594
+ { x: n, y: -g },
1595
+ // Two points, the right corners
1596
+ { x: l - n, y: -g },
1597
+ { x: l - n, y: -r + g },
1598
+ { x: n, y: -r + g },
1599
+ { x: n, y: -r },
1600
+ { x: 0, y: -r / 2 }
1601
+ ] : i.has("up") ? [
1602
+ // Bottom center
1603
+ { x: n, y: -g },
1604
+ // Left top over vertical section
1605
+ { x: n, y: -r + g },
1606
+ { x: 0, y: -r + g },
1607
+ // Top of arrow
1608
+ { x: l / 2, y: -r },
1609
+ { x: l, y: -r + g },
1610
+ // Top of right vertical bar
1611
+ { x: l - n, y: -r + g },
1612
+ { x: l - n, y: -g }
1613
+ ] : i.has("down") ? [
1614
+ // Bottom center
1615
+ { x: l / 2, y: 0 },
1616
+ // Left pont of bottom arrow
1617
+ { x: 0, y: -g },
1618
+ { x: n, y: -g },
1619
+ // Left top over vertical section
1620
+ { x: n, y: -r + g },
1621
+ { x: l - n, y: -r + g },
1622
+ { x: l - n, y: -g },
1623
+ { x: l, y: -g }
1624
+ ] : [{ x: 0, y: 0 }];
1625
+ }, "getArrowPoints");
1626
+ function ge(e, t) {
1627
+ return e.intersect(t);
1628
+ }
1629
+ d(ge, "intersectNode");
1630
+ var Jr = ge;
1631
+ function de(e, t, a, s) {
1632
+ var i = e.x, c = e.y, r = i - s.x, n = c - s.y, l = Math.sqrt(t * t * n * n + a * a * r * r), g = Math.abs(t * a * r / l);
1633
+ s.x < i && (g = -g);
1634
+ var o = Math.abs(t * a * n / l);
1635
+ return s.y < c && (o = -o), { x: i + g, y: c + o };
1636
+ }
1637
+ d(de, "intersectEllipse");
1638
+ var ue = de;
1639
+ function pe(e, t, a) {
1640
+ return ue(e, t, t, a);
1641
+ }
1642
+ d(pe, "intersectCircle");
1643
+ var Qr = pe;
1644
+ function fe(e, t, a, s) {
1645
+ var i, c, r, n, l, g, o, p, b, x, w, v, S, _, I;
1646
+ if (i = t.y - e.y, r = e.x - t.x, l = t.x * e.y - e.x * t.y, b = i * a.x + r * a.y + l, x = i * s.x + r * s.y + l, !(b !== 0 && x !== 0 && vt(b, x)) && (c = s.y - a.y, n = a.x - s.x, g = s.x * a.y - a.x * s.y, o = c * e.x + n * e.y + g, p = c * t.x + n * t.y + g, !(o !== 0 && p !== 0 && vt(o, p)) && (w = i * n - c * r, w !== 0)))
1647
+ return v = Math.abs(w / 2), S = r * g - n * l, _ = S < 0 ? (S - v) / w : (S + v) / w, S = c * l - i * g, I = S < 0 ? (S - v) / w : (S + v) / w, { x: _, y: I };
1648
+ }
1649
+ d(fe, "intersectLine");
1650
+ function vt(e, t) {
1651
+ return e * t > 0;
1652
+ }
1653
+ d(vt, "sameSign");
1654
+ var $r = fe, ta = xe;
1655
+ function xe(e, t, a) {
1656
+ var s = e.x, i = e.y, c = [], r = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
1657
+ typeof t.forEach == "function" ? t.forEach(function(w) {
1658
+ r = Math.min(r, w.x), n = Math.min(n, w.y);
1659
+ }) : (r = Math.min(r, t.x), n = Math.min(n, t.y));
1660
+ for (var l = s - e.width / 2 - r, g = i - e.height / 2 - n, o = 0; o < t.length; o++) {
1661
+ var p = t[o], b = t[o < t.length - 1 ? o + 1 : 0], x = $r(
1662
+ e,
1663
+ a,
1664
+ { x: l + p.x, y: g + p.y },
1665
+ { x: l + b.x, y: g + b.y }
1666
+ );
1667
+ x && c.push(x);
1668
+ }
1669
+ return c.length ? (c.length > 1 && c.sort(function(w, v) {
1670
+ var S = w.x - a.x, _ = w.y - a.y, I = Math.sqrt(S * S + _ * _), T = v.x - a.x, m = v.y - a.y, u = Math.sqrt(T * T + m * m);
1671
+ return I < u ? -1 : I === u ? 0 : 1;
1672
+ }), c[0]) : e;
1673
+ }
1674
+ d(xe, "intersectPolygon");
1675
+ var ea = /* @__PURE__ */ d((e, t) => {
1676
+ var a = e.x, s = e.y, i = t.x - a, c = t.y - s, r = e.width / 2, n = e.height / 2, l, g;
1677
+ return Math.abs(c) * r > Math.abs(i) * n ? (c < 0 && (n = -n), l = c === 0 ? 0 : n * i / c, g = n) : (i < 0 && (r = -r), l = r, g = i === 0 ? 0 : r * c / i), { x: a + l, y: s + g };
1678
+ }, "intersectRect"), ra = ea, B = {
1679
+ node: Jr,
1680
+ circle: Qr,
1681
+ ellipse: ue,
1682
+ polygon: ta,
1683
+ rect: ra
1684
+ }, z = /* @__PURE__ */ d(async (e, t, a, s) => {
1685
+ const i = A();
1686
+ let c;
1687
+ const r = t.useHtmlLabels || P(i);
1688
+ a ? c = a : c = "node default";
1689
+ const n = e.insert("g").attr("class", c).attr("id", t.domId || t.id), l = n.insert("g").attr("class", "label").attr("style", t.labelStyle);
1690
+ let g;
1691
+ t.labelText === void 0 ? g = "" : g = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
1692
+ let o;
1693
+ t.labelType === "markdown" ? o = Et(
1694
+ l,
1695
+ Rt(At(g), i),
1696
+ {
1697
+ useHtmlLabels: r,
1698
+ width: t.width || i.flowchart.wrappingWidth,
1699
+ classes: "markdown-node-label"
1700
+ },
1701
+ i
1702
+ ) : o = await U(
1703
+ l,
1704
+ Rt(At(g), i),
1705
+ t.labelStyle,
1706
+ !1,
1707
+ s
1708
+ );
1709
+ let p = o.getBBox();
1710
+ const b = t.padding / 2;
1711
+ if (P(i)) {
1712
+ const x = o.children[0], w = D(o);
1713
+ await je(x, g), p = x.getBoundingClientRect(), w.attr("width", p.width), w.attr("height", p.height);
1714
+ }
1715
+ return r ? l.attr("transform", "translate(" + -p.width / 2 + ", " + -p.height / 2 + ")") : l.attr("transform", "translate(0, " + -p.height / 2 + ")"), t.centerLabel && l.attr("transform", "translate(" + -p.width / 2 + ", " + -p.height / 2 + ")"), l.insert("rect", ":first-child"), { shapeSvg: n, bbox: p, halfPadding: b, label: l };
1716
+ }, "labelHelper"), N = /* @__PURE__ */ d((e, t) => {
1717
+ const a = t.node().getBBox();
1718
+ e.width = a.width, e.height = a.height;
1719
+ }, "updateNodeBounds");
1720
+ function V(e, t, a, s) {
1721
+ return e.insert("polygon", ":first-child").attr(
1722
+ "points",
1723
+ s.map(function(i) {
1724
+ return i.x + "," + i.y;
1725
+ }).join(" ")
1726
+ ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
1727
+ }
1728
+ d(V, "insertPolygonShape");
1729
+ var aa = /* @__PURE__ */ d(async (e, t) => {
1730
+ t.useHtmlLabels || P(A()) || (t.centerLabel = !0);
1731
+ const { shapeSvg: s, bbox: i, halfPadding: c } = await z(
1732
+ e,
1733
+ t,
1734
+ "node " + t.classes,
1735
+ !0
1736
+ );
1737
+ k.info("Classes = ", t.classes);
1738
+ const r = s.insert("rect", ":first-child");
1739
+ return r.attr("rx", t.rx).attr("ry", t.ry).attr("x", -i.width / 2 - c).attr("y", -i.height / 2 - c).attr("width", i.width + t.padding).attr("height", i.height + t.padding), N(t, r), t.intersect = function(n) {
1740
+ return B.rect(t, n);
1741
+ }, s;
1742
+ }, "note"), sa = aa, Yt = /* @__PURE__ */ d((e) => e ? " " + e : "", "formatClass"), H = /* @__PURE__ */ d((e, t) => `${t || "node default"}${Yt(e.classes)} ${Yt(
1743
+ e.class
1744
+ )}`, "getClassesFromNode"), Ht = /* @__PURE__ */ d(async (e, t) => {
1745
+ const { shapeSvg: a, bbox: s } = await z(
1746
+ e,
1747
+ t,
1748
+ H(t, void 0),
1749
+ !0
1750
+ ), i = s.width + t.padding, c = s.height + t.padding, r = i + c, n = [
1751
+ { x: r / 2, y: 0 },
1752
+ { x: r, y: -r / 2 },
1753
+ { x: r / 2, y: -r },
1754
+ { x: 0, y: -r / 2 }
1755
+ ];
1756
+ k.info("Question main (Circle)");
1757
+ const l = V(a, r, r, n);
1758
+ return l.attr("style", t.style), N(t, l), t.intersect = function(g) {
1759
+ return k.warn("Intersect called"), B.polygon(t, n, g);
1760
+ }, a;
1761
+ }, "question"), ia = /* @__PURE__ */ d((e, t) => {
1762
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = 28, i = [
1763
+ { x: 0, y: s / 2 },
1764
+ { x: s / 2, y: 0 },
1765
+ { x: 0, y: -s / 2 },
1766
+ { x: -s / 2, y: 0 }
1767
+ ];
1768
+ return a.insert("polygon", ":first-child").attr(
1769
+ "points",
1770
+ i.map(function(r) {
1771
+ return r.x + "," + r.y;
1772
+ }).join(" ")
1773
+ ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(r) {
1774
+ return B.circle(t, 14, r);
1775
+ }, a;
1776
+ }, "choice"), na = /* @__PURE__ */ d(async (e, t) => {
1777
+ const { shapeSvg: a, bbox: s } = await z(
1778
+ e,
1779
+ t,
1780
+ H(t, void 0),
1781
+ !0
1782
+ ), i = 4, c = t.positioned ? t.height : s.height + t.padding, r = c / i, n = t.positioned ? t.width : s.width + 2 * r + t.padding, l = [
1783
+ { x: r, y: 0 },
1784
+ { x: n - r, y: 0 },
1785
+ { x: n, y: -c / 2 },
1786
+ { x: n - r, y: -c },
1787
+ { x: r, y: -c },
1788
+ { x: 0, y: -c / 2 }
1789
+ ], g = V(a, n, c, l);
1790
+ return g.attr("style", t.style), N(t, g), t.intersect = function(o) {
1791
+ return B.polygon(t, l, o);
1792
+ }, a;
1793
+ }, "hexagon"), ca = /* @__PURE__ */ d(async (e, t) => {
1794
+ const { shapeSvg: a, bbox: s } = await z(e, t, void 0, !0), i = 2, c = s.height + 2 * t.padding, r = c / i, n = s.width + 2 * r + t.padding, g = t.positioned && (t.widthInColumns ?? 1) > 1 && t.width > n ? t.width : n, o = qr(t.directions, s, t, g), p = V(a, g, c, o);
1795
+ return p.attr("style", t.style), N(t, p), t.intersect = function(b) {
1796
+ return B.polygon(t, o, b);
1797
+ }, a;
1798
+ }, "block_arrow"), la = /* @__PURE__ */ d(async (e, t) => {
1799
+ const { shapeSvg: a, bbox: s } = await z(
1800
+ e,
1801
+ t,
1802
+ H(t, void 0),
1803
+ !0
1804
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1805
+ { x: -c / 2, y: 0 },
1806
+ { x: i, y: 0 },
1807
+ { x: i, y: -c },
1808
+ { x: -c / 2, y: -c },
1809
+ { x: 0, y: -c / 2 }
1810
+ ];
1811
+ return V(a, i, c, r).attr("style", t.style), t.width = i + c, t.height = c, t.intersect = function(l) {
1812
+ return B.polygon(t, r, l);
1813
+ }, a;
1814
+ }, "rect_left_inv_arrow"), oa = /* @__PURE__ */ d(async (e, t) => {
1815
+ const { shapeSvg: a, bbox: s } = await z(e, t, H(t), !0), i = s.width + t.padding, c = s.height + t.padding, r = [
1816
+ { x: -2 * c / 6, y: 0 },
1817
+ { x: i - c / 6, y: 0 },
1818
+ { x: i + 2 * c / 6, y: -c },
1819
+ { x: c / 6, y: -c }
1820
+ ], n = V(a, i, c, r);
1821
+ return n.attr("style", t.style), N(t, n), t.intersect = function(l) {
1822
+ return B.polygon(t, r, l);
1823
+ }, a;
1824
+ }, "lean_right"), ha = /* @__PURE__ */ d(async (e, t) => {
1825
+ const { shapeSvg: a, bbox: s } = await z(
1826
+ e,
1827
+ t,
1828
+ H(t, void 0),
1829
+ !0
1830
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1831
+ { x: 2 * c / 6, y: 0 },
1832
+ { x: i + c / 6, y: 0 },
1833
+ { x: i - 2 * c / 6, y: -c },
1834
+ { x: -c / 6, y: -c }
1835
+ ], n = V(a, i, c, r);
1836
+ return n.attr("style", t.style), N(t, n), t.intersect = function(l) {
1837
+ return B.polygon(t, r, l);
1838
+ }, a;
1839
+ }, "lean_left"), ga = /* @__PURE__ */ d(async (e, t) => {
1840
+ const { shapeSvg: a, bbox: s } = await z(
1841
+ e,
1842
+ t,
1843
+ H(t, void 0),
1844
+ !0
1845
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1846
+ { x: -2 * c / 6, y: 0 },
1847
+ { x: i + 2 * c / 6, y: 0 },
1848
+ { x: i - c / 6, y: -c },
1849
+ { x: c / 6, y: -c }
1850
+ ], n = V(a, i, c, r);
1851
+ return n.attr("style", t.style), N(t, n), t.intersect = function(l) {
1852
+ return B.polygon(t, r, l);
1853
+ }, a;
1854
+ }, "trapezoid"), da = /* @__PURE__ */ d(async (e, t) => {
1855
+ const { shapeSvg: a, bbox: s } = await z(
1856
+ e,
1857
+ t,
1858
+ H(t, void 0),
1859
+ !0
1860
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1861
+ { x: c / 6, y: 0 },
1862
+ { x: i - c / 6, y: 0 },
1863
+ { x: i + 2 * c / 6, y: -c },
1864
+ { x: -2 * c / 6, y: -c }
1865
+ ], n = V(a, i, c, r);
1866
+ return n.attr("style", t.style), N(t, n), t.intersect = function(l) {
1867
+ return B.polygon(t, r, l);
1868
+ }, a;
1869
+ }, "inv_trapezoid"), ua = /* @__PURE__ */ d(async (e, t) => {
1870
+ const { shapeSvg: a, bbox: s } = await z(
1871
+ e,
1872
+ t,
1873
+ H(t, void 0),
1874
+ !0
1875
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1876
+ { x: 0, y: 0 },
1877
+ { x: i + c / 2, y: 0 },
1878
+ { x: i, y: -c / 2 },
1879
+ { x: i + c / 2, y: -c },
1880
+ { x: 0, y: -c }
1881
+ ], n = V(a, i, c, r);
1882
+ return n.attr("style", t.style), N(t, n), t.intersect = function(l) {
1883
+ return B.polygon(t, r, l);
1884
+ }, a;
1885
+ }, "rect_right_inv_arrow"), pa = /* @__PURE__ */ d(async (e, t) => {
1886
+ const { shapeSvg: a, bbox: s } = await z(
1887
+ e,
1888
+ t,
1889
+ H(t, void 0),
1890
+ !0
1891
+ ), i = s.width + t.padding, c = i / 2, r = c / (2.5 + i / 50), n = s.height + r + t.padding, l = "M 0," + r + " a " + c + "," + r + " 0,0,0 " + i + " 0 a " + c + "," + r + " 0,0,0 " + -i + " 0 l 0," + n + " a " + c + "," + r + " 0,0,0 " + i + " 0 l 0," + -n, g = a.attr("label-offset-y", r).insert("path", ":first-child").attr("style", t.style).attr("d", l).attr("transform", "translate(" + -i / 2 + "," + -(n / 2 + r) + ")");
1892
+ return N(t, g), t.intersect = function(o) {
1893
+ const p = B.rect(t, o), b = p.x - t.x;
1894
+ if (c != 0 && (Math.abs(b) < t.width / 2 || Math.abs(b) == t.width / 2 && Math.abs(p.y - t.y) > t.height / 2 - r)) {
1895
+ let x = r * r * (1 - b * b / (c * c));
1896
+ x != 0 && (x = Math.sqrt(x)), x = r - x, o.y - t.y > 0 && (x = -x), p.y += x;
1897
+ }
1898
+ return p;
1899
+ }, a;
1900
+ }, "cylinder"), fa = /* @__PURE__ */ d(async (e, t) => {
1901
+ const { shapeSvg: a, bbox: s, halfPadding: i } = await z(
1902
+ e,
1903
+ t,
1904
+ "node " + t.classes + " " + t.class,
1905
+ !0
1906
+ ), c = a.insert("rect", ":first-child"), r = t.positioned ? t.width : s.width + t.padding, n = t.positioned ? t.height : s.height + t.padding, l = t.positioned ? -r / 2 : -s.width / 2 - i, g = t.positioned ? -n / 2 : -s.height / 2 - i;
1907
+ if (c.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", l).attr("y", g).attr("width", r).attr("height", n), t.props) {
1908
+ const o = new Set(Object.keys(t.props));
1909
+ t.props.borders && (ht(c, t.props.borders, r, n), o.delete("borders")), o.forEach((p) => {
1910
+ k.warn(`Unknown node property ${p}`);
1911
+ });
1912
+ }
1913
+ return N(t, c), t.intersect = function(o) {
1914
+ return B.rect(t, o);
1915
+ }, a;
1916
+ }, "rect"), xa = /* @__PURE__ */ d(async (e, t) => {
1917
+ const { shapeSvg: a, bbox: s, halfPadding: i } = await z(
1918
+ e,
1919
+ t,
1920
+ "node " + t.classes,
1921
+ !0
1922
+ ), c = a.insert("rect", ":first-child"), r = t.positioned ? t.width : s.width + t.padding, n = t.positioned ? t.height : s.height + t.padding, l = t.positioned ? -r / 2 : -s.width / 2 - i, g = t.positioned ? -n / 2 : -s.height / 2 - i;
1923
+ if (c.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", l).attr("y", g).attr("width", r).attr("height", n), t.props) {
1924
+ const o = new Set(Object.keys(t.props));
1925
+ t.props.borders && (ht(c, t.props.borders, r, n), o.delete("borders")), o.forEach((p) => {
1926
+ k.warn(`Unknown node property ${p}`);
1927
+ });
1928
+ }
1929
+ return N(t, c), t.intersect = function(o) {
1930
+ return B.rect(t, o);
1931
+ }, a;
1932
+ }, "composite"), ya = /* @__PURE__ */ d(async (e, t) => {
1933
+ const { shapeSvg: a } = await z(e, t, "label", !0);
1934
+ k.trace("Classes = ", t.class);
1935
+ const s = a.insert("rect", ":first-child"), i = 0, c = 0;
1936
+ if (s.attr("width", i).attr("height", c), a.attr("class", "label edgeLabel"), t.props) {
1937
+ const r = new Set(Object.keys(t.props));
1938
+ t.props.borders && (ht(s, t.props.borders, i, c), r.delete("borders")), r.forEach((n) => {
1939
+ k.warn(`Unknown node property ${n}`);
1940
+ });
1941
+ }
1942
+ return N(t, s), t.intersect = function(r) {
1943
+ return B.rect(t, r);
1944
+ }, a;
1945
+ }, "labelRect");
1946
+ function ht(e, t, a, s) {
1947
+ const i = [], c = /* @__PURE__ */ d((n) => {
1948
+ i.push(n, 0);
1949
+ }, "addBorder"), r = /* @__PURE__ */ d((n) => {
1950
+ i.push(0, n);
1951
+ }, "skipBorder");
1952
+ t.includes("t") ? (k.debug("add top border"), c(a)) : r(a), t.includes("r") ? (k.debug("add right border"), c(s)) : r(s), t.includes("b") ? (k.debug("add bottom border"), c(a)) : r(a), t.includes("l") ? (k.debug("add left border"), c(s)) : r(s), e.attr("stroke-dasharray", i.join(" "));
1953
+ }
1954
+ d(ht, "applyNodePropertyBorders");
1955
+ var ba = /* @__PURE__ */ d(async (e, t) => {
1956
+ let a;
1957
+ t.classes ? a = "node " + t.classes : a = "node default";
1958
+ const s = e.insert("g").attr("class", a).attr("id", t.domId || t.id), i = s.insert("rect", ":first-child"), c = s.insert("line"), r = s.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
1959
+ let l = "";
1960
+ typeof n == "object" ? l = n[0] : l = n, k.info("Label text abc79", l, n, typeof n == "object");
1961
+ const g = await U(r, l, t.labelStyle, !0, !0);
1962
+ let o = { width: 0, height: 0 };
1963
+ if (P(A())) {
1964
+ const v = g.children[0], S = D(g);
1965
+ o = v.getBoundingClientRect(), S.attr("width", o.width), S.attr("height", o.height);
1966
+ }
1967
+ k.info("Text 2", n);
1968
+ const p = n.slice(1, n.length);
1969
+ let b = g.getBBox();
1970
+ const x = await U(
1971
+ r,
1972
+ p.join ? p.join("<br/>") : p,
1973
+ t.labelStyle,
1974
+ !0,
1975
+ !0
1976
+ );
1977
+ if (P(A())) {
1978
+ const v = x.children[0], S = D(x);
1979
+ o = v.getBoundingClientRect(), S.attr("width", o.width), S.attr("height", o.height);
1980
+ }
1981
+ const w = t.padding / 2;
1982
+ return D(x).attr(
1983
+ "transform",
1984
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1985
+ (o.width > b.width ? 0 : (b.width - o.width) / 2) + ", " + (b.height + w + 5) + ")"
1986
+ ), D(g).attr(
1987
+ "transform",
1988
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1989
+ (o.width < b.width ? 0 : -(b.width - o.width) / 2) + ", 0)"
1990
+ ), o = r.node().getBBox(), r.attr(
1991
+ "transform",
1992
+ "translate(" + -o.width / 2 + ", " + (-o.height / 2 - w + 3) + ")"
1993
+ ), i.attr("class", "outer title-state").attr("x", -o.width / 2 - w).attr("y", -o.height / 2 - w).attr("width", o.width + t.padding).attr("height", o.height + t.padding), c.attr("class", "divider").attr("x1", -o.width / 2 - w).attr("x2", o.width / 2 + w).attr("y1", -o.height / 2 - w + b.height + w).attr("y2", -o.height / 2 - w + b.height + w), N(t, i), t.intersect = function(v) {
1994
+ return B.rect(t, v);
1995
+ }, s;
1996
+ }, "rectWithTitle"), wa = /* @__PURE__ */ d(async (e, t) => {
1997
+ const { shapeSvg: a, bbox: s } = await z(
1998
+ e,
1999
+ t,
2000
+ H(t, void 0),
2001
+ !0
2002
+ ), i = s.height + t.padding, c = s.width + i / 4 + t.padding, r = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", i / 2).attr("ry", i / 2).attr("x", -c / 2).attr("y", -i / 2).attr("width", c).attr("height", i);
2003
+ return N(t, r), t.intersect = function(n) {
2004
+ return B.rect(t, n);
2005
+ }, a;
2006
+ }, "stadium"), ma = /* @__PURE__ */ d(async (e, t) => {
2007
+ const { shapeSvg: a, bbox: s, halfPadding: i } = await z(
2008
+ e,
2009
+ t,
2010
+ H(t, void 0),
2011
+ !0
2012
+ ), c = a.insert("circle", ":first-child");
2013
+ return c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i).attr("width", s.width + t.padding).attr("height", s.height + t.padding), k.info("Circle main"), N(t, c), t.intersect = function(r) {
2014
+ return k.info("Circle intersect", t, s.width / 2 + i, r), B.circle(t, s.width / 2 + i, r);
2015
+ }, a;
2016
+ }, "circle"), Sa = /* @__PURE__ */ d(async (e, t) => {
2017
+ const { shapeSvg: a, bbox: s, halfPadding: i } = await z(
2018
+ e,
2019
+ t,
2020
+ H(t, void 0),
2021
+ !0
2022
+ ), c = 5, r = a.insert("g", ":first-child"), n = r.insert("circle"), l = r.insert("circle");
2023
+ return r.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i + c).attr("width", s.width + t.padding + c * 2).attr("height", s.height + t.padding + c * 2), l.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i).attr("width", s.width + t.padding).attr("height", s.height + t.padding), k.info("DoubleCircle main"), N(t, n), t.intersect = function(g) {
2024
+ return k.info("DoubleCircle intersect", t, s.width / 2 + i + c, g), B.circle(t, s.width / 2 + i + c, g);
2025
+ }, a;
2026
+ }, "doublecircle"), La = /* @__PURE__ */ d(async (e, t) => {
2027
+ const { shapeSvg: a, bbox: s } = await z(
2028
+ e,
2029
+ t,
2030
+ H(t, void 0),
2031
+ !0
2032
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
2033
+ { x: 0, y: 0 },
2034
+ { x: i, y: 0 },
2035
+ { x: i, y: -c },
2036
+ { x: 0, y: -c },
2037
+ { x: 0, y: 0 },
2038
+ { x: -8, y: 0 },
2039
+ { x: i + 8, y: 0 },
2040
+ { x: i + 8, y: -c },
2041
+ { x: -8, y: -c },
2042
+ { x: -8, y: 0 }
2043
+ ], n = V(a, i, c, r);
2044
+ return n.attr("style", t.style), N(t, n), t.intersect = function(l) {
2045
+ return B.polygon(t, r, l);
2046
+ }, a;
2047
+ }, "subroutine"), ka = /* @__PURE__ */ d((e, t) => {
2048
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = a.insert("circle", ":first-child");
2049
+ return s.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), N(t, s), t.intersect = function(i) {
2050
+ return B.circle(t, 7, i);
2051
+ }, a;
2052
+ }, "start"), Kt = /* @__PURE__ */ d((e, t, a) => {
2053
+ const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
2054
+ let i = 70, c = 10;
2055
+ a === "LR" && (i = 10, c = 70);
2056
+ const r = s.append("rect").attr("x", -1 * i / 2).attr("y", -1 * c / 2).attr("width", i).attr("height", c).attr("class", "fork-join");
2057
+ return N(t, r), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
2058
+ return B.rect(t, n);
2059
+ }, s;
2060
+ }, "forkJoin"), va = /* @__PURE__ */ d((e, t) => {
2061
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = a.insert("circle", ":first-child"), i = a.insert("circle", ":first-child");
2062
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), s.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), N(t, i), t.intersect = function(c) {
2063
+ return B.circle(t, 7, c);
2064
+ }, a;
2065
+ }, "end"), Ea = /* @__PURE__ */ d(async (e, t) => {
2066
+ const a = t.padding / 2, s = 4, i = 8;
2067
+ let c;
2068
+ t.classes ? c = "node " + t.classes : c = "node default";
2069
+ const r = e.insert("g").attr("class", c).attr("id", t.domId || t.id), n = r.insert("rect", ":first-child"), l = r.insert("line"), g = r.insert("line");
2070
+ let o = 0, p = s;
2071
+ const b = r.insert("g").attr("class", "label");
2072
+ let x = 0;
2073
+ const w = t.classData.annotations?.[0], v = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", S = await U(
2074
+ b,
2075
+ v,
2076
+ t.labelStyle,
2077
+ !0,
2078
+ !0
2079
+ );
2080
+ let _ = S.getBBox();
2081
+ if (P(A())) {
2082
+ const E = S.children[0], h = D(S);
2083
+ _ = E.getBoundingClientRect(), h.attr("width", _.width), h.attr("height", _.height);
2084
+ }
2085
+ t.classData.annotations[0] && (p += _.height + s, o += _.width);
2086
+ let I = t.classData.label;
2087
+ t.classData.type !== void 0 && t.classData.type !== "" && (P(A()) ? I += "&lt;" + t.classData.type + "&gt;" : I += "<" + t.classData.type + ">");
2088
+ const T = await U(
2089
+ b,
2090
+ I,
2091
+ t.labelStyle,
2092
+ !0,
2093
+ !0
2094
+ );
2095
+ D(T).attr("class", "classTitle");
2096
+ let m = T.getBBox();
2097
+ if (P(A())) {
2098
+ const E = T.children[0], h = D(T);
2099
+ m = E.getBoundingClientRect(), h.attr("width", m.width), h.attr("height", m.height);
2100
+ }
2101
+ p += m.height + s, m.width > o && (o = m.width);
2102
+ const u = [];
2103
+ t.classData.members.forEach(async (E) => {
2104
+ const h = E.getDisplayDetails();
2105
+ let W = h.displayText;
2106
+ P(A()) && (W = W.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2107
+ const f = await U(
2108
+ b,
2109
+ W,
2110
+ h.cssStyle ? h.cssStyle : t.labelStyle,
2111
+ !0,
2112
+ !0
2113
+ );
2114
+ let O = f.getBBox();
2115
+ if (P(A())) {
2116
+ const q = f.children[0], G = D(f);
2117
+ O = q.getBoundingClientRect(), G.attr("width", O.width), G.attr("height", O.height);
2118
+ }
2119
+ O.width > o && (o = O.width), p += O.height + s, u.push(f);
2120
+ }), p += i;
2121
+ const y = [];
2122
+ if (t.classData.methods.forEach(async (E) => {
2123
+ const h = E.getDisplayDetails();
2124
+ let W = h.displayText;
2125
+ P(A()) && (W = W.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2126
+ const f = await U(
2127
+ b,
2128
+ W,
2129
+ h.cssStyle ? h.cssStyle : t.labelStyle,
2130
+ !0,
2131
+ !0
2132
+ );
2133
+ let O = f.getBBox();
2134
+ if (P(A())) {
2135
+ const q = f.children[0], G = D(f);
2136
+ O = q.getBoundingClientRect(), G.attr("width", O.width), G.attr("height", O.height);
2137
+ }
2138
+ O.width > o && (o = O.width), p += O.height + s, y.push(f);
2139
+ }), p += i, w) {
2140
+ let E = (o - _.width) / 2;
2141
+ D(S).attr(
2142
+ "transform",
2143
+ "translate( " + (-1 * o / 2 + E) + ", " + -1 * p / 2 + ")"
2144
+ ), x = _.height + s;
2145
+ }
2146
+ let L = (o - m.width) / 2;
2147
+ return D(T).attr(
2148
+ "transform",
2149
+ "translate( " + (-1 * o / 2 + L) + ", " + (-1 * p / 2 + x) + ")"
2150
+ ), x += m.height + s, l.attr("class", "divider").attr("x1", -o / 2 - a).attr("x2", o / 2 + a).attr("y1", -p / 2 - a + i + x).attr("y2", -p / 2 - a + i + x), x += i, u.forEach((E) => {
2151
+ D(E).attr(
2152
+ "transform",
2153
+ "translate( " + -o / 2 + ", " + (-1 * p / 2 + x + i / 2) + ")"
2154
+ );
2155
+ const h = E?.getBBox();
2156
+ x += (h?.height ?? 0) + s;
2157
+ }), x += i, g.attr("class", "divider").attr("x1", -o / 2 - a).attr("x2", o / 2 + a).attr("y1", -p / 2 - a + i + x).attr("y2", -p / 2 - a + i + x), x += i, y.forEach((E) => {
2158
+ D(E).attr(
2159
+ "transform",
2160
+ "translate( " + -o / 2 + ", " + (-1 * p / 2 + x) + ")"
2161
+ );
2162
+ const h = E?.getBBox();
2163
+ x += (h?.height ?? 0) + s;
2164
+ }), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -o / 2 - a).attr("y", -(p / 2) - a).attr("width", o + t.padding).attr("height", p + t.padding), N(t, n), t.intersect = function(E) {
2165
+ return B.rect(t, E);
2166
+ }, r;
2167
+ }, "class_box"), Ut = {
2168
+ rhombus: Ht,
2169
+ composite: xa,
2170
+ question: Ht,
2171
+ rect: fa,
2172
+ labelRect: ya,
2173
+ rectWithTitle: ba,
2174
+ choice: ia,
2175
+ circle: ma,
2176
+ doublecircle: Sa,
2177
+ stadium: wa,
2178
+ hexagon: na,
2179
+ block_arrow: ca,
2180
+ rect_left_inv_arrow: la,
2181
+ lean_right: oa,
2182
+ lean_left: ha,
2183
+ trapezoid: ga,
2184
+ inv_trapezoid: da,
2185
+ rect_right_inv_arrow: ua,
2186
+ cylinder: pa,
2187
+ start: ka,
2188
+ end: va,
2189
+ note: sa,
2190
+ subroutine: La,
2191
+ fork: Kt,
2192
+ join: Kt,
2193
+ class_box: Ea
2194
+ }, ct = {}, ye = /* @__PURE__ */ d(async (e, t, a) => {
2195
+ let s, i;
2196
+ if (t.link) {
2197
+ let c;
2198
+ A().securityLevel === "sandbox" ? c = "_top" : t.linkTarget && (c = t.linkTarget || "_blank"), s = e.insert("svg:a").attr("xlink:href", t.link).attr("target", c), i = await Ut[t.shape](s, t, a);
2199
+ } else
2200
+ i = await Ut[t.shape](e, t, a), s = i;
2201
+ return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), ct[t.id] = s, t.haveCallback && ct[t.id].attr("class", ct[t.id].attr("class") + " clickable"), s;
2202
+ }, "insertNode"), _a = /* @__PURE__ */ d((e) => {
2203
+ const t = ct[e.id];
2204
+ k.trace(
2205
+ "Transforming node",
2206
+ e.diff,
2207
+ e,
2208
+ "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
2209
+ );
2210
+ const a = 8, s = e.diff || 0;
2211
+ return e.clusterNode ? t.attr(
2212
+ "transform",
2213
+ "translate(" + (e.x + s - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")"
2214
+ ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), s;
2215
+ }, "positionNode");
2216
+ function It(e, t, a = !1) {
2217
+ const s = e;
2218
+ let i = "default";
2219
+ (s?.classes?.length || 0) > 0 && (i = (s?.classes ?? []).join(" ")), i = i + " flowchart-label";
2220
+ let c = 0, r = "", n;
2221
+ switch (s.type) {
2222
+ case "round":
2223
+ c = 5, r = "rect";
2224
+ break;
2225
+ case "composite":
2226
+ c = 0, r = "composite", n = 0;
2227
+ break;
2228
+ case "square":
2229
+ r = "rect";
2230
+ break;
2231
+ case "diamond":
2232
+ r = "question";
2233
+ break;
2234
+ case "hexagon":
2235
+ r = "hexagon";
2236
+ break;
2237
+ case "block_arrow":
2238
+ r = "block_arrow";
2239
+ break;
2240
+ case "odd":
2241
+ r = "rect_left_inv_arrow";
2242
+ break;
2243
+ case "lean_right":
2244
+ r = "lean_right";
2245
+ break;
2246
+ case "lean_left":
2247
+ r = "lean_left";
2248
+ break;
2249
+ case "trapezoid":
2250
+ r = "trapezoid";
2251
+ break;
2252
+ case "inv_trapezoid":
2253
+ r = "inv_trapezoid";
2254
+ break;
2255
+ case "rect_left_inv_arrow":
2256
+ r = "rect_left_inv_arrow";
2257
+ break;
2258
+ case "circle":
2259
+ r = "circle";
2260
+ break;
2261
+ case "ellipse":
2262
+ r = "ellipse";
2263
+ break;
2264
+ case "stadium":
2265
+ r = "stadium";
2266
+ break;
2267
+ case "subroutine":
2268
+ r = "subroutine";
2269
+ break;
2270
+ case "cylinder":
2271
+ r = "cylinder";
2272
+ break;
2273
+ case "group":
2274
+ r = "rect";
2275
+ break;
2276
+ case "doublecircle":
2277
+ r = "doublecircle";
2278
+ break;
2279
+ default:
2280
+ r = "rect";
2281
+ }
2282
+ const l = Ze(s?.styles ?? []), g = s.label, o = s.size ?? { width: 0, height: 0, x: 0, y: 0 }, p = t.getDiagramId();
2283
+ return {
2284
+ labelStyle: l.labelStyle,
2285
+ shape: r,
2286
+ labelText: g,
2287
+ rx: c,
2288
+ ry: c,
2289
+ class: i,
2290
+ style: l.style,
2291
+ id: s.id,
2292
+ domId: p ? `${p}-${s.id}` : s.id,
2293
+ directions: s.directions,
2294
+ width: o.width,
2295
+ height: o.height,
2296
+ x: o.x,
2297
+ y: o.y,
2298
+ positioned: a,
2299
+ intersect: void 0,
2300
+ type: s.type,
2301
+ padding: n ?? at()?.block?.padding ?? 0,
2302
+ widthInColumns: s.widthInColumns ?? 1
2303
+ };
2304
+ }
2305
+ d(It, "getNodeFromBlock");
2306
+ async function be(e, t, a) {
2307
+ const s = It(t, a, !1);
2308
+ if (s.type === "group")
2309
+ return;
2310
+ const i = at(), c = await ye(e, s, { config: i }), r = c.node().getBBox(), n = a.getBlock(s.id);
2311
+ n.size = { width: r.width, height: r.height, x: 0, y: 0, node: c }, a.setBlock(n), c.remove();
2312
+ }
2313
+ d(be, "calculateBlockSize");
2314
+ async function we(e, t, a) {
2315
+ const s = It(t, a, !0);
2316
+ if (a.getBlock(s.id).type !== "space") {
2317
+ const c = at();
2318
+ await ye(e, s, { config: c }), t.intersect = s?.intersect, _a(s);
2319
+ }
2320
+ }
2321
+ d(we, "insertBlockPositioned");
2322
+ async function gt(e, t, a, s) {
2323
+ for (const i of t)
2324
+ await s(e, i, a), i.children && await gt(e, i.children, a, s);
2325
+ }
2326
+ d(gt, "performOperations");
2327
+ async function me(e, t, a) {
2328
+ await gt(e, t, a, be);
2329
+ }
2330
+ d(me, "calculateBlockSizes");
2331
+ async function Se(e, t, a) {
2332
+ await gt(e, t, a, we);
2333
+ }
2334
+ d(Se, "insertBlocks");
2335
+ async function Le(e, t, a, s, i) {
2336
+ const c = new qe({
2337
+ multigraph: !0,
2338
+ compound: !0
2339
+ });
2340
+ c.setGraph({
2341
+ rankdir: "TB",
2342
+ nodesep: 10,
2343
+ ranksep: 10,
2344
+ marginx: 8,
2345
+ marginy: 8
2346
+ });
2347
+ for (const r of a)
2348
+ r.size && c.setNode(r.id, {
2349
+ width: r.size.width,
2350
+ height: r.size.height,
2351
+ intersect: r.intersect
2352
+ });
2353
+ for (const r of t)
2354
+ if (r.start && r.end) {
2355
+ const n = s.getBlock(r.start), l = s.getBlock(r.end);
2356
+ if (n?.size && l?.size) {
2357
+ const g = n.size, o = l.size, p = [
2358
+ { x: g.x, y: g.y },
2359
+ { x: g.x + (o.x - g.x) / 2, y: g.y + (o.y - g.y) / 2 },
2360
+ { x: o.x, y: o.y }
2361
+ ], b = i ? `${i}-${r.id}` : r.id, x = r.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal", w = r.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid", v = `${x} ${w} flowchart-link LS-a1 LE-b1`;
2362
+ Zr(
2363
+ e,
2364
+ { v: r.start, w: r.end, name: b },
2365
+ {
2366
+ ...r,
2367
+ id: b,
2368
+ arrowTypeEnd: r.arrowTypeEnd,
2369
+ arrowTypeStart: r.arrowTypeStart,
2370
+ points: p,
2371
+ classes: v
2372
+ },
2373
+ void 0,
2374
+ "block",
2375
+ c,
2376
+ i
2377
+ ), r.label && (await Ur(e, {
2378
+ ...r,
2379
+ label: r.label,
2380
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2381
+ arrowTypeEnd: r.arrowTypeEnd,
2382
+ arrowTypeStart: r.arrowTypeStart,
2383
+ points: p,
2384
+ classes: v
2385
+ }), Xr(
2386
+ { ...r, x: p[1].x, y: p[1].y },
2387
+ {
2388
+ originalPath: p
2389
+ }
2390
+ ));
2391
+ }
2392
+ }
2393
+ }
2394
+ d(Le, "insertEdges");
2395
+ var Ta = /* @__PURE__ */ d(function(e, t) {
2396
+ return t.db.getClasses();
2397
+ }, "getClasses"), Da = /* @__PURE__ */ d(async function(e, t, a, s) {
2398
+ const { securityLevel: i, block: c } = at(), r = s.db;
2399
+ r.setDiagramId(t);
2400
+ let n;
2401
+ i === "sandbox" && (n = D("#i" + t));
2402
+ const l = i === "sandbox" ? D(n.nodes()[0].contentDocument.body) : D("body"), g = i === "sandbox" ? l.select(`[id="${t}"]`) : D(`[id="${t}"]`);
2403
+ Fr(g, ["point", "circle", "cross"], s.type, t);
2404
+ const p = r.getBlocks(), b = r.getBlocksFlat(), x = r.getEdges(), w = g.insert("g").attr("class", "block");
2405
+ await me(w, p, r);
2406
+ const v = he(r);
2407
+ if (await Se(w, p, r), await Le(w, x, b, r, t), v) {
2408
+ const S = v, _ = Math.max(1, Math.round(0.125 * (S.width / S.height))), I = S.height + _ + 10, T = S.width + 10, { useMaxWidth: m } = c;
2409
+ Fe(g, I, T, !!m), k.debug("Here Bounds", v, S), g.attr(
2410
+ "viewBox",
2411
+ `${S.x - 5} ${S.y - 5} ${S.width + 10} ${S.height + 10}`
2412
+ );
2413
+ }
2414
+ }, "draw"), Ba = {
2415
+ draw: Da,
2416
+ getClasses: Ta
2417
+ }, Ra = {
2418
+ parser: sr,
2419
+ db: Er,
2420
+ renderer: Ba,
2421
+ styles: Tr
2422
+ };
2423
+ export {
2424
+ Ra as diagram
2425
+ };