@webskill/sdk 0.21.0 → 0.23.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 (135) hide show
  1. package/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
  2. package/dist/agent.d.ts +3 -3
  3. package/dist/agent.js +1174 -169
  4. package/dist/{approval-DwN2o2QG.js → approval-7CuZS3Z4.js} +104 -18
  5. package/dist/arc-8U_6NQWm.js +130 -0
  6. package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
  7. package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
  8. package/dist/array-DQfpQNY8.js +8 -0
  9. package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
  10. package/dist/browser.d.ts +455 -49
  11. package/dist/browser.js +2134 -138
  12. package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
  13. package/dist/channel-CZxxLrG7.js +9 -0
  14. package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
  15. package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
  16. package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
  17. package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
  18. package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
  19. package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
  20. package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
  21. package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
  22. package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
  23. package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
  24. package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
  25. package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
  26. package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
  27. package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
  28. package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
  29. package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
  30. package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
  31. package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
  32. package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
  33. package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
  34. package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
  35. package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
  36. package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
  37. package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
  38. package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
  39. package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
  40. package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
  41. package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
  42. package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
  43. package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
  44. package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
  45. package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
  46. package/dist/defaultLocale-B_EoOkSF.js +249 -0
  47. package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
  48. package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
  49. package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
  50. package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
  51. package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
  52. package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
  53. package/dist/dist-UajCDt3n.js +92 -0
  54. package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
  55. package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
  56. package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
  57. package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
  58. package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
  59. package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
  60. package/dist/{toolSource-C9oNuKmr.js → geometry-CRhuySKV.js} +169 -12
  61. package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
  62. package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
  63. package/dist/governance.d.ts +22 -4
  64. package/dist/governance.js +100 -10
  65. package/dist/graphlib-tk9gQYuN.js +4194 -0
  66. package/dist/{index-DHopiH_m.d.ts → index-7No55dRb.d.ts} +161 -11
  67. package/dist/{index-B8Tgmpwh.d.ts → index-ShvCB5I9.d.ts} +2 -2
  68. package/dist/{index-CYLt5u4L.d.ts → index-V76_OFj2.d.ts} +789 -21
  69. package/dist/index.d.ts +4 -4
  70. package/dist/index.js +11 -9
  71. package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
  72. package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
  73. package/dist/init-CMOIWdg-.js +16 -0
  74. package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
  75. package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
  76. package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
  77. package/dist/katex-BcRRvyh_.js +26465 -0
  78. package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
  79. package/dist/line-LgV8iVMV.js +48 -0
  80. package/dist/linear-BWKR0Tqd.js +393 -0
  81. package/dist/linkedDocument-CZZOl9cO.js +456 -0
  82. package/dist/mcp.d.ts +2 -2
  83. package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
  84. package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
  85. package/dist/mermaid.core-DMtwGCHy.js +1756 -0
  86. package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
  87. package/dist/node.d.ts +3 -3
  88. package/dist/node.js +12 -5
  89. package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
  90. package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
  91. package/dist/ordinal-CxA6GHQS.js +84 -0
  92. package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
  93. package/dist/path-C27Z2Bjv.js +106 -0
  94. package/dist/{pathSecurity-B1owvJAF.js → pathSecurity-CirkQwWP.js} +12 -1
  95. package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
  96. package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
  97. package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
  98. package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
  99. package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
  100. package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
  101. package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
  102. package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
  103. package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
  104. package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
  105. package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
  106. package/dist/rough.cjs-AmDd_NQk.js +1395 -0
  107. package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
  108. package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
  109. package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
  110. package/dist/{skill-CAJMsLod.js → skill-WSUDp6A1.js} +1 -1
  111. package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-S4_HJ_Fl-Cvy9LqVu.d.ts} +35 -4
  112. package/dist/src-NkhI3UMl.js +2653 -0
  113. package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
  114. package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
  115. package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
  116. package/dist/testing.d.ts +2 -1
  117. package/dist/testing.js +1 -1
  118. package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
  119. package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
  120. package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
  121. package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BiZBXGm4.d.ts} +66 -8
  122. package/dist/ui-react.d.ts +3 -3
  123. package/dist/ui-react.js +3746 -96
  124. package/dist/ui-vue.d.ts +1 -1
  125. package/dist/ui.d.ts +3 -3
  126. package/dist/ui.js +2 -2
  127. package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
  128. package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
  129. package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
  130. package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
  131. package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-D5VMUnrv.js} +2 -2
  132. package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
  133. package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
  134. package/package.json +1 -1
  135. package/dist/linkedDocument-C0gj1sMq.js +0 -245
@@ -0,0 +1,1312 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
2
+ import { m as log } from "./src-NkhI3UMl.js";
3
+ import { b as getConfig, f as defaultConfig_default, it as isDark, k as getUserDefinedConfig, nt as lighten, tt as darken, x as getConfig2, z as sanitizeText } from "./chunk-O7XYJQB3-B6K0KOSL.js";
4
+ import "./chunk-ZIGJFQKS-DqEFBuHR.js";
5
+ import "./chunk-742MDFTN-CPmgCGwC.js";
6
+ import "./chunk-MBY4JIJT-C34L7a4f.js";
7
+ import "./chunk-7PRAP22T-BHED6GVs.js";
8
+ import "./chunk-7INBJB4K-C9jq9o66.js";
9
+ import "./chunk-5DYCD2WN-Bt97YGTd.js";
10
+ import "./chunk-Z7XXMR3K-oLg1h8F3.js";
11
+ import { t as getDiagramElement } from "./chunk-XXDRQBXY-DPbSy4kg.js";
12
+ import { t as setupViewPortForSVG } from "./chunk-WEXAMYUT-Ba6jFWhB.js";
13
+ import "./chunk-UA2S7LBM-DxHM29_K.js";
14
+ import { r as render, t as getRegisteredLayoutAlgorithm } from "./chunk-GNY47TPC-Bpvq1T49.js";
15
+
16
+ //#region ../../node_modules/.pnpm/uuid@14.0.2/node_modules/uuid/dist-node/stringify.js
17
+ const byteToHex = [];
18
+ for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
19
+ function unsafeStringify(arr, offset = 0) {
20
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
21
+ }
22
+
23
+ //#endregion
24
+ //#region ../../node_modules/.pnpm/uuid@14.0.2/node_modules/uuid/dist-node/rng.js
25
+ const rnds8 = /* @__PURE__ */ new Uint8Array(16);
26
+ function rng() {
27
+ return crypto.getRandomValues(rnds8);
28
+ }
29
+
30
+ //#endregion
31
+ //#region ../../node_modules/.pnpm/uuid@14.0.2/node_modules/uuid/dist-node/v4.js
32
+ function v4(options, buf, offset) {
33
+ if (!buf && !options && crypto.randomUUID) return crypto.randomUUID();
34
+ return _v4(options, buf, offset);
35
+ }
36
+ function _v4(options, buf, offset) {
37
+ options = options || {};
38
+ const rnds = options.random ?? options.rng?.() ?? rng();
39
+ if (rnds.length < 16) throw new Error("Random bytes length must be >= 16");
40
+ rnds[6] = rnds[6] & 15 | 64;
41
+ rnds[8] = rnds[8] & 63 | 128;
42
+ if (buf) {
43
+ offset = offset || 0;
44
+ if (offset < 0 || offset + 16 > buf.length) throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
45
+ for (let i = 0; i < 16; ++i) buf[offset + i] = rnds[i];
46
+ return buf;
47
+ }
48
+ return unsafeStringify(rnds);
49
+ }
50
+
51
+ //#endregion
52
+ //#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-NLK3R4M7.mjs
53
+ var parser = (function() {
54
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
55
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v);
56
+ return o2;
57
+ }, "o"), $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [
58
+ 6,
59
+ 7,
60
+ 8
61
+ ], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [
62
+ 6,
63
+ 7,
64
+ 11
65
+ ], $Vc = [
66
+ 1,
67
+ 6,
68
+ 13,
69
+ 15,
70
+ 16,
71
+ 19,
72
+ 22
73
+ ], $Vd = [1, 33], $Ve = [1, 34], $Vf = [
74
+ 1,
75
+ 6,
76
+ 7,
77
+ 11,
78
+ 13,
79
+ 15,
80
+ 16,
81
+ 19,
82
+ 22
83
+ ];
84
+ var parser2 = {
85
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
86
+ yy: {},
87
+ symbols_: {
88
+ "error": 2,
89
+ "start": 3,
90
+ "mindMap": 4,
91
+ "spaceLines": 5,
92
+ "SPACELINE": 6,
93
+ "NL": 7,
94
+ "MINDMAP": 8,
95
+ "document": 9,
96
+ "stop": 10,
97
+ "EOF": 11,
98
+ "statement": 12,
99
+ "SPACELIST": 13,
100
+ "node": 14,
101
+ "ICON": 15,
102
+ "CLASS": 16,
103
+ "nodeWithId": 17,
104
+ "nodeWithoutId": 18,
105
+ "NODE_DSTART": 19,
106
+ "NODE_DESCR": 20,
107
+ "NODE_DEND": 21,
108
+ "NODE_ID": 22,
109
+ "$accept": 0,
110
+ "$end": 1
111
+ },
112
+ terminals_: {
113
+ 2: "error",
114
+ 6: "SPACELINE",
115
+ 7: "NL",
116
+ 8: "MINDMAP",
117
+ 11: "EOF",
118
+ 13: "SPACELIST",
119
+ 15: "ICON",
120
+ 16: "CLASS",
121
+ 19: "NODE_DSTART",
122
+ 20: "NODE_DESCR",
123
+ 21: "NODE_DEND",
124
+ 22: "NODE_ID"
125
+ },
126
+ productions_: [
127
+ 0,
128
+ [3, 1],
129
+ [3, 2],
130
+ [5, 1],
131
+ [5, 2],
132
+ [5, 2],
133
+ [4, 2],
134
+ [4, 3],
135
+ [10, 1],
136
+ [10, 1],
137
+ [10, 1],
138
+ [10, 2],
139
+ [10, 2],
140
+ [9, 3],
141
+ [9, 2],
142
+ [12, 2],
143
+ [12, 2],
144
+ [12, 2],
145
+ [12, 1],
146
+ [12, 1],
147
+ [12, 1],
148
+ [12, 1],
149
+ [12, 1],
150
+ [14, 1],
151
+ [14, 1],
152
+ [18, 3],
153
+ [17, 1],
154
+ [17, 4]
155
+ ],
156
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
157
+ var $0 = $$.length - 1;
158
+ switch (yystate) {
159
+ case 6:
160
+ case 7: return yy;
161
+ case 8:
162
+ yy.getLogger().trace("Stop NL ");
163
+ break;
164
+ case 9:
165
+ yy.getLogger().trace("Stop EOF ");
166
+ break;
167
+ case 11:
168
+ yy.getLogger().trace("Stop NL2 ");
169
+ break;
170
+ case 12:
171
+ yy.getLogger().trace("Stop EOF2 ");
172
+ break;
173
+ case 15:
174
+ yy.getLogger().info("Node: ", $$[$0].id);
175
+ yy.addNode($$[$0 - 1].length, $$[$0].id, $$[$0].descr, $$[$0].type);
176
+ break;
177
+ case 16:
178
+ yy.getLogger().trace("Icon: ", $$[$0]);
179
+ yy.decorateNode({ icon: $$[$0] });
180
+ break;
181
+ case 17:
182
+ case 21:
183
+ yy.decorateNode({ class: $$[$0] });
184
+ break;
185
+ case 18:
186
+ yy.getLogger().trace("SPACELIST");
187
+ break;
188
+ case 19:
189
+ yy.getLogger().trace("Node: ", $$[$0].id);
190
+ yy.addNode(0, $$[$0].id, $$[$0].descr, $$[$0].type);
191
+ break;
192
+ case 20:
193
+ yy.decorateNode({ icon: $$[$0] });
194
+ break;
195
+ case 25:
196
+ yy.getLogger().trace("node found ..", $$[$0 - 2]);
197
+ this.$ = {
198
+ id: $$[$0 - 1],
199
+ descr: $$[$0 - 1],
200
+ type: yy.getType($$[$0 - 2], $$[$0])
201
+ };
202
+ break;
203
+ case 26:
204
+ this.$ = {
205
+ id: $$[$0],
206
+ descr: $$[$0],
207
+ type: yy.nodeType.DEFAULT
208
+ };
209
+ break;
210
+ case 27:
211
+ yy.getLogger().trace("node found ..", $$[$0 - 3]);
212
+ this.$ = {
213
+ id: $$[$0 - 3],
214
+ descr: $$[$0 - 1],
215
+ type: yy.getType($$[$0 - 2], $$[$0])
216
+ };
217
+ break;
218
+ }
219
+ }, "anonymous"),
220
+ table: [
221
+ {
222
+ 3: 1,
223
+ 4: 2,
224
+ 5: 3,
225
+ 6: [1, 5],
226
+ 8: $V0
227
+ },
228
+ { 1: [3] },
229
+ { 1: [2, 1] },
230
+ {
231
+ 4: 6,
232
+ 6: [1, 7],
233
+ 7: [1, 8],
234
+ 8: $V0
235
+ },
236
+ {
237
+ 6: $V1,
238
+ 7: [1, 10],
239
+ 9: 9,
240
+ 12: 11,
241
+ 13: $V2,
242
+ 14: 14,
243
+ 15: $V3,
244
+ 16: $V4,
245
+ 17: 17,
246
+ 18: 18,
247
+ 19: $V5,
248
+ 22: $V6
249
+ },
250
+ o($V7, [2, 3]),
251
+ { 1: [2, 2] },
252
+ o($V7, [2, 4]),
253
+ o($V7, [2, 5]),
254
+ {
255
+ 1: [2, 6],
256
+ 6: $V1,
257
+ 12: 21,
258
+ 13: $V2,
259
+ 14: 14,
260
+ 15: $V3,
261
+ 16: $V4,
262
+ 17: 17,
263
+ 18: 18,
264
+ 19: $V5,
265
+ 22: $V6
266
+ },
267
+ {
268
+ 6: $V1,
269
+ 9: 22,
270
+ 12: 11,
271
+ 13: $V2,
272
+ 14: 14,
273
+ 15: $V3,
274
+ 16: $V4,
275
+ 17: 17,
276
+ 18: 18,
277
+ 19: $V5,
278
+ 22: $V6
279
+ },
280
+ {
281
+ 6: $V8,
282
+ 7: $V9,
283
+ 10: 23,
284
+ 11: $Va
285
+ },
286
+ o($Vb, [2, 22], {
287
+ 17: 17,
288
+ 18: 18,
289
+ 14: 27,
290
+ 15: [1, 28],
291
+ 16: [1, 29],
292
+ 19: $V5,
293
+ 22: $V6
294
+ }),
295
+ o($Vb, [2, 18]),
296
+ o($Vb, [2, 19]),
297
+ o($Vb, [2, 20]),
298
+ o($Vb, [2, 21]),
299
+ o($Vb, [2, 23]),
300
+ o($Vb, [2, 24]),
301
+ o($Vb, [2, 26], { 19: [1, 30] }),
302
+ { 20: [1, 31] },
303
+ {
304
+ 6: $V8,
305
+ 7: $V9,
306
+ 10: 32,
307
+ 11: $Va
308
+ },
309
+ {
310
+ 1: [2, 7],
311
+ 6: $V1,
312
+ 12: 21,
313
+ 13: $V2,
314
+ 14: 14,
315
+ 15: $V3,
316
+ 16: $V4,
317
+ 17: 17,
318
+ 18: 18,
319
+ 19: $V5,
320
+ 22: $V6
321
+ },
322
+ o($Vc, [2, 14], {
323
+ 7: $Vd,
324
+ 11: $Ve
325
+ }),
326
+ o($Vf, [2, 8]),
327
+ o($Vf, [2, 9]),
328
+ o($Vf, [2, 10]),
329
+ o($Vb, [2, 15]),
330
+ o($Vb, [2, 16]),
331
+ o($Vb, [2, 17]),
332
+ { 20: [1, 35] },
333
+ { 21: [1, 36] },
334
+ o($Vc, [2, 13], {
335
+ 7: $Vd,
336
+ 11: $Ve
337
+ }),
338
+ o($Vf, [2, 11]),
339
+ o($Vf, [2, 12]),
340
+ { 21: [1, 37] },
341
+ o($Vb, [2, 25]),
342
+ o($Vb, [2, 27])
343
+ ],
344
+ defaultActions: {
345
+ 2: [2, 1],
346
+ 6: [2, 2]
347
+ },
348
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
349
+ if (hash.recoverable) this.trace(str);
350
+ else {
351
+ var error = new Error(str);
352
+ error.hash = hash;
353
+ throw error;
354
+ }
355
+ }, "parseError"),
356
+ parse: /* @__PURE__ */ __name(function parse(input) {
357
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
358
+ var args = lstack.slice.call(arguments, 1);
359
+ var lexer2 = Object.create(this.lexer);
360
+ var sharedState = { yy: {} };
361
+ for (var k in this.yy) if (Object.prototype.hasOwnProperty.call(this.yy, k)) sharedState.yy[k] = this.yy[k];
362
+ lexer2.setInput(input, sharedState.yy);
363
+ sharedState.yy.lexer = lexer2;
364
+ sharedState.yy.parser = this;
365
+ if (typeof lexer2.yylloc == "undefined") lexer2.yylloc = {};
366
+ var yyloc = lexer2.yylloc;
367
+ lstack.push(yyloc);
368
+ var ranges = lexer2.options && lexer2.options.ranges;
369
+ if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
370
+ else this.parseError = Object.getPrototypeOf(this).parseError;
371
+ function popStack(n) {
372
+ stack.length = stack.length - 2 * n;
373
+ vstack.length = vstack.length - n;
374
+ lstack.length = lstack.length - n;
375
+ }
376
+ __name(popStack, "popStack");
377
+ function lex() {
378
+ var token = tstack.pop() || lexer2.lex() || EOF;
379
+ if (typeof token !== "number") {
380
+ if (token instanceof Array) {
381
+ tstack = token;
382
+ token = tstack.pop();
383
+ }
384
+ token = self.symbols_[token] || token;
385
+ }
386
+ return token;
387
+ }
388
+ __name(lex, "lex");
389
+ var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
390
+ while (true) {
391
+ state = stack[stack.length - 1];
392
+ if (this.defaultActions[state]) action = this.defaultActions[state];
393
+ else {
394
+ if (symbol === null || typeof symbol == "undefined") symbol = lex();
395
+ action = table[state] && table[state][symbol];
396
+ }
397
+ if (typeof action === "undefined" || !action.length || !action[0]) {
398
+ var errStr = "";
399
+ expected = [];
400
+ for (p in table[state]) if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
401
+ if (lexer2.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
402
+ else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
403
+ this.parseError(errStr, {
404
+ text: lexer2.match,
405
+ token: this.terminals_[symbol] || symbol,
406
+ line: lexer2.yylineno,
407
+ loc: yyloc,
408
+ expected
409
+ });
410
+ }
411
+ if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
412
+ switch (action[0]) {
413
+ case 1:
414
+ stack.push(symbol);
415
+ vstack.push(lexer2.yytext);
416
+ lstack.push(lexer2.yylloc);
417
+ stack.push(action[1]);
418
+ symbol = null;
419
+ if (!preErrorSymbol) {
420
+ yyleng = lexer2.yyleng;
421
+ yytext = lexer2.yytext;
422
+ yylineno = lexer2.yylineno;
423
+ yyloc = lexer2.yylloc;
424
+ if (recovering > 0) recovering--;
425
+ } else {
426
+ symbol = preErrorSymbol;
427
+ preErrorSymbol = null;
428
+ }
429
+ break;
430
+ case 2:
431
+ len = this.productions_[action[1]][1];
432
+ yyval.$ = vstack[vstack.length - len];
433
+ yyval._$ = {
434
+ first_line: lstack[lstack.length - (len || 1)].first_line,
435
+ last_line: lstack[lstack.length - 1].last_line,
436
+ first_column: lstack[lstack.length - (len || 1)].first_column,
437
+ last_column: lstack[lstack.length - 1].last_column
438
+ };
439
+ if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
440
+ r = this.performAction.apply(yyval, [
441
+ yytext,
442
+ yyleng,
443
+ yylineno,
444
+ sharedState.yy,
445
+ action[1],
446
+ vstack,
447
+ lstack
448
+ ].concat(args));
449
+ if (typeof r !== "undefined") return r;
450
+ if (len) {
451
+ stack = stack.slice(0, -1 * len * 2);
452
+ vstack = vstack.slice(0, -1 * len);
453
+ lstack = lstack.slice(0, -1 * len);
454
+ }
455
+ stack.push(this.productions_[action[1]][0]);
456
+ vstack.push(yyval.$);
457
+ lstack.push(yyval._$);
458
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
459
+ stack.push(newState);
460
+ break;
461
+ case 3: return true;
462
+ }
463
+ }
464
+ return true;
465
+ }, "parse")
466
+ };
467
+ parser2.lexer = /* @__PURE__ */ (function() {
468
+ return {
469
+ EOF: 1,
470
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
471
+ if (this.yy.parser) this.yy.parser.parseError(str, hash);
472
+ else throw new Error(str);
473
+ }, "parseError"),
474
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
475
+ this.yy = yy || this.yy || {};
476
+ this._input = input;
477
+ this._more = this._backtrack = this.done = false;
478
+ this.yylineno = this.yyleng = 0;
479
+ this.yytext = this.matched = this.match = "";
480
+ this.conditionStack = ["INITIAL"];
481
+ this.yylloc = {
482
+ first_line: 1,
483
+ first_column: 0,
484
+ last_line: 1,
485
+ last_column: 0
486
+ };
487
+ if (this.options.ranges) this.yylloc.range = [0, 0];
488
+ this.offset = 0;
489
+ return this;
490
+ }, "setInput"),
491
+ input: /* @__PURE__ */ __name(function() {
492
+ var ch = this._input[0];
493
+ this.yytext += ch;
494
+ this.yyleng++;
495
+ this.offset++;
496
+ this.match += ch;
497
+ this.matched += ch;
498
+ if (ch.match(/(?:\r\n?|\n).*/g)) {
499
+ this.yylineno++;
500
+ this.yylloc.last_line++;
501
+ } else this.yylloc.last_column++;
502
+ if (this.options.ranges) this.yylloc.range[1]++;
503
+ this._input = this._input.slice(1);
504
+ return ch;
505
+ }, "input"),
506
+ unput: /* @__PURE__ */ __name(function(ch) {
507
+ var len = ch.length;
508
+ var lines = ch.split(/(?:\r\n?|\n)/g);
509
+ this._input = ch + this._input;
510
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
511
+ this.offset -= len;
512
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
513
+ this.match = this.match.substr(0, this.match.length - 1);
514
+ this.matched = this.matched.substr(0, this.matched.length - 1);
515
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
516
+ var r = this.yylloc.range;
517
+ this.yylloc = {
518
+ first_line: this.yylloc.first_line,
519
+ last_line: this.yylineno + 1,
520
+ first_column: this.yylloc.first_column,
521
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
522
+ };
523
+ if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
524
+ this.yyleng = this.yytext.length;
525
+ return this;
526
+ }, "unput"),
527
+ more: /* @__PURE__ */ __name(function() {
528
+ this._more = true;
529
+ return this;
530
+ }, "more"),
531
+ reject: /* @__PURE__ */ __name(function() {
532
+ if (this.options.backtrack_lexer) this._backtrack = true;
533
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
534
+ text: "",
535
+ token: null,
536
+ line: this.yylineno
537
+ });
538
+ return this;
539
+ }, "reject"),
540
+ less: /* @__PURE__ */ __name(function(n) {
541
+ this.unput(this.match.slice(n));
542
+ }, "less"),
543
+ pastInput: /* @__PURE__ */ __name(function() {
544
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
545
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
546
+ }, "pastInput"),
547
+ upcomingInput: /* @__PURE__ */ __name(function() {
548
+ var next = this.match;
549
+ if (next.length < 20) next += this._input.substr(0, 20 - next.length);
550
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
551
+ }, "upcomingInput"),
552
+ showPosition: /* @__PURE__ */ __name(function() {
553
+ var pre = this.pastInput();
554
+ var c = new Array(pre.length + 1).join("-");
555
+ return pre + this.upcomingInput() + "\n" + c + "^";
556
+ }, "showPosition"),
557
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
558
+ var token, lines, backup;
559
+ if (this.options.backtrack_lexer) {
560
+ backup = {
561
+ yylineno: this.yylineno,
562
+ yylloc: {
563
+ first_line: this.yylloc.first_line,
564
+ last_line: this.last_line,
565
+ first_column: this.yylloc.first_column,
566
+ last_column: this.yylloc.last_column
567
+ },
568
+ yytext: this.yytext,
569
+ match: this.match,
570
+ matches: this.matches,
571
+ matched: this.matched,
572
+ yyleng: this.yyleng,
573
+ offset: this.offset,
574
+ _more: this._more,
575
+ _input: this._input,
576
+ yy: this.yy,
577
+ conditionStack: this.conditionStack.slice(0),
578
+ done: this.done
579
+ };
580
+ if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
581
+ }
582
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
583
+ if (lines) this.yylineno += lines.length;
584
+ this.yylloc = {
585
+ first_line: this.yylloc.last_line,
586
+ last_line: this.yylineno + 1,
587
+ first_column: this.yylloc.last_column,
588
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
589
+ };
590
+ this.yytext += match[0];
591
+ this.match += match[0];
592
+ this.matches = match;
593
+ this.yyleng = this.yytext.length;
594
+ if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
595
+ this._more = false;
596
+ this._backtrack = false;
597
+ this._input = this._input.slice(match[0].length);
598
+ this.matched += match[0];
599
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
600
+ if (this.done && this._input) this.done = false;
601
+ if (token) return token;
602
+ else if (this._backtrack) {
603
+ for (var k in backup) this[k] = backup[k];
604
+ return false;
605
+ }
606
+ return false;
607
+ }, "test_match"),
608
+ next: /* @__PURE__ */ __name(function() {
609
+ if (this.done) return this.EOF;
610
+ if (!this._input) this.done = true;
611
+ var token, match, tempMatch, index;
612
+ if (!this._more) {
613
+ this.yytext = "";
614
+ this.match = "";
615
+ }
616
+ var rules = this._currentRules();
617
+ for (var i = 0; i < rules.length; i++) {
618
+ tempMatch = this._input.match(this.rules[rules[i]]);
619
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
620
+ match = tempMatch;
621
+ index = i;
622
+ if (this.options.backtrack_lexer) {
623
+ token = this.test_match(tempMatch, rules[i]);
624
+ if (token !== false) return token;
625
+ else if (this._backtrack) {
626
+ match = false;
627
+ continue;
628
+ } else return false;
629
+ } else if (!this.options.flex) break;
630
+ }
631
+ }
632
+ if (match) {
633
+ token = this.test_match(match, rules[index]);
634
+ if (token !== false) return token;
635
+ return false;
636
+ }
637
+ if (this._input === "") return this.EOF;
638
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
639
+ text: "",
640
+ token: null,
641
+ line: this.yylineno
642
+ });
643
+ }, "next"),
644
+ lex: /* @__PURE__ */ __name(function lex() {
645
+ var r = this.next();
646
+ if (r) return r;
647
+ else return this.lex();
648
+ }, "lex"),
649
+ begin: /* @__PURE__ */ __name(function begin(condition) {
650
+ this.conditionStack.push(condition);
651
+ }, "begin"),
652
+ popState: /* @__PURE__ */ __name(function popState() {
653
+ if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
654
+ else return this.conditionStack[0];
655
+ }, "popState"),
656
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
657
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
658
+ else return this.conditions["INITIAL"].rules;
659
+ }, "_currentRules"),
660
+ topState: /* @__PURE__ */ __name(function topState(n) {
661
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
662
+ if (n >= 0) return this.conditionStack[n];
663
+ else return "INITIAL";
664
+ }, "topState"),
665
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
666
+ this.begin(condition);
667
+ }, "pushState"),
668
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
669
+ return this.conditionStack.length;
670
+ }, "stateStackSize"),
671
+ options: { "case-insensitive": true },
672
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
673
+ switch ($avoiding_name_collisions) {
674
+ case 0:
675
+ yy.getLogger().trace("Found comment", yy_.yytext);
676
+ return 6;
677
+ case 1: return 8;
678
+ case 2:
679
+ this.begin("CLASS");
680
+ break;
681
+ case 3:
682
+ this.popState();
683
+ return 16;
684
+ case 4:
685
+ this.popState();
686
+ break;
687
+ case 5:
688
+ yy.getLogger().trace("Begin icon");
689
+ this.begin("ICON");
690
+ break;
691
+ case 6:
692
+ yy.getLogger().trace("SPACELINE");
693
+ return 6;
694
+ case 7: return 7;
695
+ case 8: return 15;
696
+ case 9:
697
+ yy.getLogger().trace("end icon");
698
+ this.popState();
699
+ break;
700
+ case 10:
701
+ yy.getLogger().trace("Exploding node");
702
+ this.begin("NODE");
703
+ return 19;
704
+ case 11:
705
+ yy.getLogger().trace("Cloud");
706
+ this.begin("NODE");
707
+ return 19;
708
+ case 12:
709
+ yy.getLogger().trace("Explosion Bang");
710
+ this.begin("NODE");
711
+ return 19;
712
+ case 13:
713
+ yy.getLogger().trace("Cloud Bang");
714
+ this.begin("NODE");
715
+ return 19;
716
+ case 14:
717
+ this.begin("NODE");
718
+ return 19;
719
+ case 15:
720
+ this.begin("NODE");
721
+ return 19;
722
+ case 16:
723
+ this.begin("NODE");
724
+ return 19;
725
+ case 17:
726
+ this.begin("NODE");
727
+ return 19;
728
+ case 18: return 13;
729
+ case 19: return 22;
730
+ case 20: return 11;
731
+ case 21:
732
+ this.begin("NSTR2");
733
+ break;
734
+ case 22: return "NODE_DESCR";
735
+ case 23:
736
+ this.popState();
737
+ break;
738
+ case 24:
739
+ yy.getLogger().trace("Starting NSTR");
740
+ this.begin("NSTR");
741
+ break;
742
+ case 25:
743
+ yy.getLogger().trace("description:", yy_.yytext);
744
+ return "NODE_DESCR";
745
+ case 26:
746
+ this.popState();
747
+ break;
748
+ case 27:
749
+ this.popState();
750
+ yy.getLogger().trace("node end ))");
751
+ return "NODE_DEND";
752
+ case 28:
753
+ this.popState();
754
+ yy.getLogger().trace("node end )");
755
+ return "NODE_DEND";
756
+ case 29:
757
+ this.popState();
758
+ yy.getLogger().trace("node end ...", yy_.yytext);
759
+ return "NODE_DEND";
760
+ case 30:
761
+ this.popState();
762
+ yy.getLogger().trace("node end ((");
763
+ return "NODE_DEND";
764
+ case 31:
765
+ this.popState();
766
+ yy.getLogger().trace("node end (-");
767
+ return "NODE_DEND";
768
+ case 32:
769
+ this.popState();
770
+ yy.getLogger().trace("node end (-");
771
+ return "NODE_DEND";
772
+ case 33:
773
+ this.popState();
774
+ yy.getLogger().trace("node end ((");
775
+ return "NODE_DEND";
776
+ case 34:
777
+ this.popState();
778
+ yy.getLogger().trace("node end ((");
779
+ return "NODE_DEND";
780
+ case 35:
781
+ yy.getLogger().trace("Long description:", yy_.yytext);
782
+ return 20;
783
+ case 36:
784
+ yy.getLogger().trace("Long description:", yy_.yytext);
785
+ return 20;
786
+ }
787
+ }, "anonymous"),
788
+ rules: [
789
+ /^(?:\s*%%.*)/i,
790
+ /^(?:mindmap\b)/i,
791
+ /^(?::::)/i,
792
+ /^(?:.+)/i,
793
+ /^(?:\n)/i,
794
+ /^(?:::icon\()/i,
795
+ /^(?:[\s]+[\n])/i,
796
+ /^(?:[\n]+)/i,
797
+ /^(?:[^\)]+)/i,
798
+ /^(?:\))/i,
799
+ /^(?:-\))/i,
800
+ /^(?:\(-)/i,
801
+ /^(?:\)\))/i,
802
+ /^(?:\))/i,
803
+ /^(?:\(\()/i,
804
+ /^(?:\{\{)/i,
805
+ /^(?:\()/i,
806
+ /^(?:\[)/i,
807
+ /^(?:[\s]+)/i,
808
+ /^(?:[^\(\[\n\)\{\}]+)/i,
809
+ /^(?:$)/i,
810
+ /^(?:["][`])/i,
811
+ /^(?:[^`"]+)/i,
812
+ /^(?:[`]["])/i,
813
+ /^(?:["])/i,
814
+ /^(?:[^"]+)/i,
815
+ /^(?:["])/i,
816
+ /^(?:[\)]\))/i,
817
+ /^(?:[\)])/i,
818
+ /^(?:[\]])/i,
819
+ /^(?:\}\})/i,
820
+ /^(?:\(-)/i,
821
+ /^(?:-\))/i,
822
+ /^(?:\(\()/i,
823
+ /^(?:\()/i,
824
+ /^(?:[^\)\]\(\}]+)/i,
825
+ /^(?:.+(?!\(\())/i
826
+ ],
827
+ conditions: {
828
+ "CLASS": {
829
+ "rules": [3, 4],
830
+ "inclusive": false
831
+ },
832
+ "ICON": {
833
+ "rules": [8, 9],
834
+ "inclusive": false
835
+ },
836
+ "NSTR2": {
837
+ "rules": [22, 23],
838
+ "inclusive": false
839
+ },
840
+ "NSTR": {
841
+ "rules": [25, 26],
842
+ "inclusive": false
843
+ },
844
+ "NODE": {
845
+ "rules": [
846
+ 21,
847
+ 24,
848
+ 27,
849
+ 28,
850
+ 29,
851
+ 30,
852
+ 31,
853
+ 32,
854
+ 33,
855
+ 34,
856
+ 35,
857
+ 36
858
+ ],
859
+ "inclusive": false
860
+ },
861
+ "INITIAL": {
862
+ "rules": [
863
+ 0,
864
+ 1,
865
+ 2,
866
+ 5,
867
+ 6,
868
+ 7,
869
+ 10,
870
+ 11,
871
+ 12,
872
+ 13,
873
+ 14,
874
+ 15,
875
+ 16,
876
+ 17,
877
+ 18,
878
+ 19,
879
+ 20
880
+ ],
881
+ "inclusive": true
882
+ }
883
+ }
884
+ };
885
+ })();
886
+ function Parser() {
887
+ this.yy = {};
888
+ }
889
+ __name(Parser, "Parser");
890
+ Parser.prototype = parser2;
891
+ parser2.Parser = Parser;
892
+ return new Parser();
893
+ })();
894
+ parser.parser = parser;
895
+ var mindmap_default = parser;
896
+ var MAX_SECTIONS = 12;
897
+ var nodeType = {
898
+ DEFAULT: 0,
899
+ NO_BORDER: 0,
900
+ ROUNDED_RECT: 1,
901
+ RECT: 2,
902
+ CIRCLE: 3,
903
+ CLOUD: 4,
904
+ BANG: 5,
905
+ HEXAGON: 6
906
+ };
907
+ var MindmapDB = class {
908
+ constructor() {
909
+ this.nodes = [];
910
+ this.count = 0;
911
+ this.elements = {};
912
+ this.getLogger = this.getLogger.bind(this);
913
+ this.nodeType = nodeType;
914
+ this.clear();
915
+ this.getType = this.getType.bind(this);
916
+ this.getElementById = this.getElementById.bind(this);
917
+ this.getParent = this.getParent.bind(this);
918
+ this.getMindmap = this.getMindmap.bind(this);
919
+ this.addNode = this.addNode.bind(this);
920
+ this.decorateNode = this.decorateNode.bind(this);
921
+ }
922
+ static {
923
+ __name(this, "MindmapDB");
924
+ }
925
+ clear() {
926
+ this.nodes = [];
927
+ this.count = 0;
928
+ this.elements = {};
929
+ this.baseLevel = void 0;
930
+ }
931
+ getParent(level) {
932
+ for (let i = this.nodes.length - 1; i >= 0; i--) if (this.nodes[i].level < level) return this.nodes[i];
933
+ return null;
934
+ }
935
+ getMindmap() {
936
+ return this.nodes.length > 0 ? this.nodes[0] : null;
937
+ }
938
+ addNode(level, id, descr, type) {
939
+ log.info("addNode", level, id, descr, type);
940
+ let isRoot = false;
941
+ if (this.nodes.length === 0) {
942
+ this.baseLevel = level;
943
+ level = 0;
944
+ isRoot = true;
945
+ } else if (this.baseLevel !== void 0) {
946
+ level = level - this.baseLevel;
947
+ isRoot = false;
948
+ }
949
+ const conf = getConfig2();
950
+ let padding = conf.mindmap?.padding ?? defaultConfig_default.mindmap.padding;
951
+ switch (type) {
952
+ case this.nodeType.ROUNDED_RECT:
953
+ case this.nodeType.RECT:
954
+ case this.nodeType.HEXAGON:
955
+ padding *= 2;
956
+ break;
957
+ }
958
+ const node = {
959
+ id: this.count++,
960
+ nodeId: sanitizeText(id, conf),
961
+ level,
962
+ descr: sanitizeText(descr, conf),
963
+ type,
964
+ children: [],
965
+ width: conf.mindmap?.maxNodeWidth ?? defaultConfig_default.mindmap.maxNodeWidth,
966
+ padding,
967
+ isRoot
968
+ };
969
+ const parent = this.getParent(level);
970
+ if (parent) {
971
+ parent.children.push(node);
972
+ this.nodes.push(node);
973
+ } else if (isRoot) this.nodes.push(node);
974
+ else throw new Error(`There can be only one root. No parent could be found for ("${node.descr}")`);
975
+ }
976
+ getType(startStr, endStr) {
977
+ log.debug("In get type", startStr, endStr);
978
+ switch (startStr) {
979
+ case "[": return this.nodeType.RECT;
980
+ case "(": return endStr === ")" ? this.nodeType.ROUNDED_RECT : this.nodeType.CLOUD;
981
+ case "((": return this.nodeType.CIRCLE;
982
+ case ")": return this.nodeType.CLOUD;
983
+ case "))": return this.nodeType.BANG;
984
+ case "{{": return this.nodeType.HEXAGON;
985
+ default: return this.nodeType.DEFAULT;
986
+ }
987
+ }
988
+ setElementForId(id, element) {
989
+ this.elements[id] = element;
990
+ }
991
+ getElementById(id) {
992
+ return this.elements[id];
993
+ }
994
+ decorateNode(decoration) {
995
+ if (!decoration) return;
996
+ const config = getConfig2();
997
+ const node = this.nodes[this.nodes.length - 1];
998
+ if (decoration.icon) node.icon = sanitizeText(decoration.icon, config);
999
+ if (decoration.class) node.class = sanitizeText(decoration.class, config);
1000
+ }
1001
+ type2Str(type) {
1002
+ switch (type) {
1003
+ case this.nodeType.DEFAULT: return "no-border";
1004
+ case this.nodeType.RECT: return "rect";
1005
+ case this.nodeType.ROUNDED_RECT: return "rounded-rect";
1006
+ case this.nodeType.CIRCLE: return "circle";
1007
+ case this.nodeType.CLOUD: return "cloud";
1008
+ case this.nodeType.BANG: return "bang";
1009
+ case this.nodeType.HEXAGON: return "hexgon";
1010
+ default: return "no-border";
1011
+ }
1012
+ }
1013
+ /**
1014
+ * Assign section numbers to nodes based on their position relative to root
1015
+ * @param node - The mindmap node to process
1016
+ * @param sectionNumber - The section number to assign (undefined for root)
1017
+ */
1018
+ assignSections(node, sectionNumber) {
1019
+ if (node.level === 0) node.section = void 0;
1020
+ else node.section = sectionNumber;
1021
+ if (node.children) for (const [index, child] of node.children.entries()) {
1022
+ const childSectionNumber = node.level === 0 ? index % (MAX_SECTIONS - 1) : sectionNumber;
1023
+ this.assignSections(child, childSectionNumber);
1024
+ }
1025
+ }
1026
+ /**
1027
+ * Convert mindmap tree structure to flat array of nodes
1028
+ * @param node - The mindmap node to process
1029
+ * @param processedNodes - Array to collect processed nodes
1030
+ */
1031
+ flattenNodes(node, processedNodes) {
1032
+ const conf = getConfig2();
1033
+ const cssClasses = ["mindmap-node"];
1034
+ if (node.isRoot === true) cssClasses.push("section-root", "section--1");
1035
+ else if (node.section !== void 0) cssClasses.push(`section-${node.section}`);
1036
+ if (node.class) cssClasses.push(node.class);
1037
+ const classes = cssClasses.join(" ");
1038
+ const getShapeFromType = /* @__PURE__ */ __name((type) => {
1039
+ const isReduxTheme = (conf.theme?.toLowerCase() ?? "").includes("redux");
1040
+ switch (type) {
1041
+ case nodeType.CIRCLE: return "mindmapCircle";
1042
+ case nodeType.RECT: return "rect";
1043
+ case nodeType.ROUNDED_RECT: return "rounded";
1044
+ case nodeType.CLOUD: return "cloud";
1045
+ case nodeType.BANG: return "bang";
1046
+ case nodeType.HEXAGON: return "hexagon";
1047
+ case nodeType.DEFAULT: return isReduxTheme ? "rounded" : "defaultMindmapNode";
1048
+ case nodeType.NO_BORDER:
1049
+ default: return "rect";
1050
+ }
1051
+ }, "getShapeFromType");
1052
+ const processedNode = {
1053
+ id: node.id.toString(),
1054
+ domId: "node_" + node.id.toString(),
1055
+ label: node.descr,
1056
+ labelType: "markdown",
1057
+ isGroup: false,
1058
+ shape: getShapeFromType(node.type),
1059
+ width: node.width,
1060
+ height: node.height ?? 0,
1061
+ padding: node.padding,
1062
+ cssClasses: classes,
1063
+ cssStyles: [],
1064
+ look: conf.look,
1065
+ icon: node.icon,
1066
+ x: node.x,
1067
+ y: node.y,
1068
+ level: node.level,
1069
+ nodeId: node.nodeId,
1070
+ type: node.type,
1071
+ section: node.section
1072
+ };
1073
+ processedNodes.push(processedNode);
1074
+ if (node.children) for (const child of node.children) this.flattenNodes(child, processedNodes);
1075
+ }
1076
+ /**
1077
+ * Generate edges from parent-child relationships in mindmap tree
1078
+ * @param node - The mindmap node to process
1079
+ * @param edges - Array to collect edges
1080
+ */
1081
+ generateEdges(node, edges) {
1082
+ if (!node.children) return;
1083
+ const conf = getConfig2();
1084
+ for (const child of node.children) {
1085
+ let edgeClasses = "edge";
1086
+ if (child.section !== void 0) edgeClasses += ` section-edge-${child.section}`;
1087
+ const edgeDepth = node.level + 1;
1088
+ edgeClasses += ` edge-depth-${edgeDepth}`;
1089
+ const edge = {
1090
+ id: `edge_${node.id}_${child.id}`,
1091
+ start: node.id.toString(),
1092
+ end: child.id.toString(),
1093
+ type: "normal",
1094
+ curve: "basis",
1095
+ thickness: "normal",
1096
+ look: conf.look,
1097
+ classes: edgeClasses,
1098
+ depth: node.level,
1099
+ section: child.section
1100
+ };
1101
+ edges.push(edge);
1102
+ this.generateEdges(child, edges);
1103
+ }
1104
+ }
1105
+ /**
1106
+ * Get structured data for layout algorithms
1107
+ * Following the pattern established by ER diagrams
1108
+ * @returns Structured data containing nodes, edges, and config
1109
+ */
1110
+ getData() {
1111
+ const mindmapRoot = this.getMindmap();
1112
+ const config = getConfig2();
1113
+ const hasUserDefinedLayout = getUserDefinedConfig().layout !== void 0;
1114
+ const finalConfig = config;
1115
+ if (!hasUserDefinedLayout) finalConfig.layout = "cose-bilkent";
1116
+ if (!mindmapRoot) return {
1117
+ nodes: [],
1118
+ edges: [],
1119
+ config: finalConfig
1120
+ };
1121
+ log.debug("getData: mindmapRoot", mindmapRoot, config);
1122
+ this.assignSections(mindmapRoot);
1123
+ const processedNodes = [];
1124
+ const processedEdges = [];
1125
+ this.flattenNodes(mindmapRoot, processedNodes);
1126
+ this.generateEdges(mindmapRoot, processedEdges);
1127
+ log.debug(`getData: processed ${processedNodes.length} nodes and ${processedEdges.length} edges`);
1128
+ const shapes = /* @__PURE__ */ new Map();
1129
+ for (const node of processedNodes) shapes.set(node.id, {
1130
+ shape: node.shape,
1131
+ width: node.width,
1132
+ height: node.height,
1133
+ padding: node.padding
1134
+ });
1135
+ return {
1136
+ nodes: processedNodes,
1137
+ edges: processedEdges,
1138
+ config: finalConfig,
1139
+ rootNode: mindmapRoot,
1140
+ markers: ["point"],
1141
+ direction: "TB",
1142
+ nodeSpacing: 50,
1143
+ rankSpacing: 50,
1144
+ shapes: Object.fromEntries(shapes),
1145
+ type: "mindmap",
1146
+ diagramId: "mindmap-" + v4()
1147
+ };
1148
+ }
1149
+ getLogger() {
1150
+ return log;
1151
+ }
1152
+ };
1153
+ var mindmapRenderer_default = { draw: /* @__PURE__ */ __name(async (text, id, _version, diagObj) => {
1154
+ log.debug("Rendering mindmap diagram\n" + text);
1155
+ const db = diagObj.db;
1156
+ const data4Layout = db.getData();
1157
+ const svg = getDiagramElement(id, data4Layout.config.securityLevel);
1158
+ data4Layout.type = diagObj.type;
1159
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(data4Layout.config.layout, { fallback: "cose-bilkent" });
1160
+ data4Layout.diagramId = id;
1161
+ if (!db.getMindmap()) return;
1162
+ data4Layout.nodes.forEach((node) => {
1163
+ if (node.shape === "rounded") {
1164
+ node.radius = 15;
1165
+ node.taper = 15;
1166
+ node.stroke = "none";
1167
+ node.width = 0;
1168
+ node.padding = 15;
1169
+ } else if (node.shape === "circle") node.padding = 10;
1170
+ else if (node.shape === "rect") {
1171
+ node.width = 0;
1172
+ node.padding = 10;
1173
+ } else if (node.shape === "hexagon") {
1174
+ node.width = 0;
1175
+ node.height = 0;
1176
+ }
1177
+ });
1178
+ await render(data4Layout, svg);
1179
+ const { themeVariables } = getConfig();
1180
+ const { useGradient, gradientStart, gradientStop } = themeVariables;
1181
+ if (useGradient && gradientStart && gradientStop) {
1182
+ const svgId = svg.attr("id");
1183
+ const gradient = svg.append("defs").append("linearGradient").attr("id", `${svgId}-gradient`).attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
1184
+ gradient.append("stop").attr("offset", "0%").attr("stop-color", gradientStart).attr("stop-opacity", 1);
1185
+ gradient.append("stop").attr("offset", "100%").attr("stop-color", gradientStop).attr("stop-opacity", 1);
1186
+ }
1187
+ setupViewPortForSVG(svg, data4Layout.config.mindmap?.padding ?? defaultConfig_default.mindmap.padding, "mindmapDiagram", data4Layout.config.mindmap?.useMaxWidth ?? defaultConfig_default.mindmap.useMaxWidth);
1188
+ }, "draw") };
1189
+ var genSections = /* @__PURE__ */ __name((options) => {
1190
+ const { theme, look } = options;
1191
+ let sections = "";
1192
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1193
+ options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1194
+ if (isDark(options["lineColor" + i])) options["lineColor" + i] = lighten(options["lineColor" + i], 20);
1195
+ else options["lineColor" + i] = darken(options["lineColor" + i], 20);
1196
+ }
1197
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1198
+ const sw = "" + (look === "neo" ? Math.max(10 - (i - 1) * 2, 2) : 17 - 3 * i);
1199
+ sections += `
1200
+ .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} polygon, .section-${i - 1} path {
1201
+ fill: ${options["cScale" + i]};
1202
+ }
1203
+ .section-${i - 1} text {
1204
+ fill: ${options["cScaleLabel" + i]};
1205
+ }
1206
+ .section-${i - 1} span {
1207
+ color: ${options["cScaleLabel" + i]};
1208
+ }
1209
+ .node-icon-${i - 1} {
1210
+ font-size: 40px;
1211
+ color: ${options["cScaleLabel" + i]};
1212
+ }
1213
+ .section-edge-${i - 1}{
1214
+ stroke: ${options["cScale" + i]};
1215
+ }
1216
+ .edge-depth-${i - 1}{
1217
+ stroke-width: ${sw};
1218
+ }
1219
+ .section-${i - 1} line {
1220
+ stroke: ${options["cScaleInv" + i]} ;
1221
+ stroke-width: 3;
1222
+ }
1223
+
1224
+ .disabled, .disabled circle, .disabled text {
1225
+ fill: lightgray;
1226
+ }
1227
+ .disabled text {
1228
+ fill: #efefef;
1229
+ }
1230
+ [data-look="neo"].mindmap-node.section-${i - 1} rect, [data-look="neo"].mindmap-node.section-${i - 1} path, [data-look="neo"].mindmap-node.section-${i - 1} circle, [data-look="neo"].mindmap-node.section-${i - 1} polygon {
1231
+ fill: ${theme === "redux" || theme === "redux-dark" || theme === "neutral" ? options.mainBkg : options["cScale" + i]};
1232
+ stroke: ${theme === "redux" || theme === "redux-dark" ? options.nodeBorder : options["cScale" + i]};
1233
+ stroke-width: ${options.strokeWidth ?? 2}px;
1234
+ }
1235
+ [data-look="neo"].section-edge-${i - 1}{
1236
+ stroke: ${theme?.includes("redux") || theme === "neo-dark" ? options.nodeBorder : options["cScale" + i]};
1237
+ }
1238
+ [data-look="neo"].mindmap-node.section-${i - 1} text {
1239
+ fill: ${theme === "redux" || theme === "redux-dark" ? options.nodeBorder : options["cScaleLabel" + (theme === "neutral" ? 1 : i)]};
1240
+ }
1241
+ `;
1242
+ }
1243
+ return sections;
1244
+ }, "genSections");
1245
+ var genGradient = /* @__PURE__ */ __name((THEME_COLOR_LIMIT, svgId, mainBkg) => {
1246
+ let sections = "";
1247
+ for (let i = 0; i < THEME_COLOR_LIMIT; i++) sections += `
1248
+ [data-look="neo"].mindmap-node.section-${i - 1} rect, [data-look="neo"].mindmap-node.section-${i - 1} path, [data-look="neo"].mindmap-node.section-${i - 1} circle, [data-look="neo"].mindmap-node.section-${i - 1} polygon {
1249
+ stroke: url(${svgId}-gradient);
1250
+ fill: ${mainBkg};
1251
+ }
1252
+ .section-${i - 1} line {
1253
+ stroke-width: 0;
1254
+ }`;
1255
+ return sections;
1256
+ }, "genGradient");
1257
+ var diagram = {
1258
+ get db() {
1259
+ return new MindmapDB();
1260
+ },
1261
+ renderer: mindmapRenderer_default,
1262
+ parser: mindmap_default,
1263
+ styles: /* @__PURE__ */ __name((options) => {
1264
+ const { theme } = options;
1265
+ const svgId = options.svgId;
1266
+ const scopedDropShadow = options.dropShadow ? options.dropShadow.replace("url(#drop-shadow)", `url(${svgId}-drop-shadow)`) : "none";
1267
+ return `
1268
+ .edge {
1269
+ stroke-width: 3;
1270
+ }
1271
+ ${genSections(options)}
1272
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
1273
+ fill: ${options.git0};
1274
+ }
1275
+ .section-root text {
1276
+ fill: ${options.gitBranchLabel0};
1277
+ }
1278
+ .section-root span {
1279
+ color: ${theme?.includes("redux") ? options.nodeBorder : options.gitBranchLabel0};
1280
+ }
1281
+ .icon-container {
1282
+ height:100%;
1283
+ display: flex;
1284
+ justify-content: center;
1285
+ align-items: center;
1286
+ }
1287
+ .edge {
1288
+ fill: none;
1289
+ }
1290
+ .mindmap-node-label {
1291
+ dy: 1em;
1292
+ alignment-baseline: middle;
1293
+ text-anchor: middle;
1294
+ dominant-baseline: middle;
1295
+ text-align: center;
1296
+ }
1297
+ [data-look="neo"].mindmap-node {
1298
+ filter: ${scopedDropShadow};
1299
+ }
1300
+ [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
1301
+ fill: ${theme?.includes("redux") ? options.mainBkg : options.git0};
1302
+ }
1303
+ [data-look="neo"].mindmap-node.section-root .text-inner-tspan {
1304
+ fill: ${theme?.includes("redux") ? options.nodeBorder : options["cScaleLabel" + (theme === "neutral" ? 1 : 0)]};
1305
+ }
1306
+ ${options.useGradient && svgId && options.mainBkg ? genGradient(options.THEME_COLOR_LIMIT, svgId, options.mainBkg) : ""}
1307
+ `;
1308
+ }, "getStyles")
1309
+ };
1310
+
1311
+ //#endregion
1312
+ export { diagram };