@fibery/custom-app-text-editor 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/LICENSE +214 -0
  2. package/README.md +33 -0
  3. package/lib/abnfDiagram-VRR7QNED-BgjOQqEh.js +89 -0
  4. package/lib/arc-Dp0rqagO.js +82 -0
  5. package/lib/architecture-TIHT7OUA-DDwCCw0y.js +3 -0
  6. package/lib/architectureDiagram-ZJ3FMSHR-BucIluTN.js +4129 -0
  7. package/lib/array-CApNbSU9.js +6 -0
  8. package/lib/blockDiagram-677ZJIJ3-CWYuHThP.js +3157 -0
  9. package/lib/c4Diagram-LMCZKHZV-Cr3_W-xe.js +2982 -0
  10. package/lib/channel-Bb7a6w5c.js +5 -0
  11. package/lib/chunk-2Q5K7J3B-CINvUK-A.js +15 -0
  12. package/lib/chunk-32BRIVSS-b-BvyGz0.js +61 -0
  13. package/lib/chunk-52WLFC77-Cf8zEoqs.js +593 -0
  14. package/lib/chunk-5VM5RSS4-Dnx15xMv.js +5 -0
  15. package/lib/chunk-7BUUIJ7U-B018BbRy.js +82 -0
  16. package/lib/chunk-C7G6YPKG-CmOuVFlJ.js +67 -0
  17. package/lib/chunk-EX3LRPZG-LynZw14I.js +2042 -0
  18. package/lib/chunk-HOUHSVGY-Br7ZSMKe.js +275 -0
  19. package/lib/chunk-ICXQ74PX-VqT5WUTt.js +1330 -0
  20. package/lib/chunk-JWPE2WC7-Ch0jmUXM.js +8 -0
  21. package/lib/chunk-KEIR6QF5-RwFi50en.js +21456 -0
  22. package/lib/chunk-MOJQB5TN-rQ4AfTd9.js +490 -0
  23. package/lib/chunk-OGEWGWER-BvF6eV9Q.js +32 -0
  24. package/lib/chunk-PUDLZKDR-BW7SZvCB.js +4135 -0
  25. package/lib/chunk-Q4XR5HBZ-CRgGP3ez.js +1635 -0
  26. package/lib/chunk-RYQCIY6F-CHlASUpG.js +241 -0
  27. package/lib/chunk-V7JOEXUC-OY39ml6X.js +3357 -0
  28. package/lib/chunk-VR4S4FIN-Bk7IFdYB.js +26 -0
  29. package/lib/chunk-WYO6CB5R-MV-yOaop.js +3769 -0
  30. package/lib/chunk-XXDRQBXY-Djd1ChwJ.js +9 -0
  31. package/lib/chunk-Y2CYZVJY-QdJ4V9rh.js +12 -0
  32. package/lib/chunk-ZGVPDNZ5-l81xl1BI.js +3738 -0
  33. package/lib/classDiagram-OUVF2IWQ--wRzSvLt.js +30 -0
  34. package/lib/classDiagram-v2-EOCWNBFH-ChMCdPO-.js +30 -0
  35. package/lib/cose-bilkent-JH36ORCC-CyVZn5M3.js +2254 -0
  36. package/lib/custom-app-text-editor.css +2 -0
  37. package/lib/custom-app-text-editor.js +81102 -0
  38. package/lib/cynefin-VYW2F7L2-CMgnLl46.js +3 -0
  39. package/lib/cynefinDiagram-TSTJHNR4-988Y73wV.js +355 -0
  40. package/lib/cytoscape.esm-DMXbtFI-.js +18145 -0
  41. package/lib/dagre-Dmarb1s8.js +1699 -0
  42. package/lib/dagre-VKFMJZFB-Bf-pz2Lx.js +328 -0
  43. package/lib/defaultLocale-A87O3snN.js +198 -0
  44. package/lib/diagram-FQU43EPY-BT8WeVzc.js +432 -0
  45. package/lib/diagram-G47NLZAW-vZ2XG37l.js +527 -0
  46. package/lib/diagram-NH7WQ7WH-CH0IfHB0.js +134 -0
  47. package/lib/diagram-OA4YK3LP-BgwQcJfp.js +300 -0
  48. package/lib/diagram-WEI45ONY-Cd3sVPil.js +214 -0
  49. package/lib/dist-PGS6ynRO.js +59 -0
  50. package/lib/ebnfDiagram-CCIWWBDH-CwBFb2Fm.js +100 -0
  51. package/lib/erDiagram-Q63AITRT-BshRACvj.js +1727 -0
  52. package/lib/eventmodeling-45OFAUF4-BDhzj03B.js +3 -0
  53. package/lib/flowDiagram-23GEKE2U-C3zDgFvZ.js +16 -0
  54. package/lib/ganttDiagram-NO4QXBWP-BD5PiE8x.js +3073 -0
  55. package/lib/gitGraph-TEB2WS4Q-DJA_hE4G.js +3 -0
  56. package/lib/gitGraphDiagram-IHSO6WYX-BAhccBh3.js +733 -0
  57. package/lib/graphlib-DglfpsVp.js +1267 -0
  58. package/lib/index.browser-Dv9K8IAp.js +26 -0
  59. package/lib/info-DKCQHKI2-BD_vOCz6.js +3 -0
  60. package/lib/infoDiagram-FWYZ7A6U-CGZnf03G.js +20 -0
  61. package/lib/init-sjaVZO3f.js +13 -0
  62. package/lib/ishikawaDiagram-FXEZZL3T-PFfVM0NO.js +719 -0
  63. package/lib/journeyDiagram-5HDEW3XC-CRGz7dcx.js +884 -0
  64. package/lib/kanban-definition-HUTT4EX6-BBH4Yn5e.js +974 -0
  65. package/lib/line-CJQicKfr.js +34 -0
  66. package/lib/linear-B9Cv96-J.js +288 -0
  67. package/lib/map-C7KALUOH.js +241 -0
  68. package/lib/mermaid-parser.core-BupC9XGF.js +638 -0
  69. package/lib/mermaid-renderer-Cp0xusfR.js +2425 -0
  70. package/lib/mindmap-definition-LN4V7U3C-CWL1sg0K.js +978 -0
  71. package/lib/ordinal-CNQzPcrr.js +65 -0
  72. package/lib/packet-7NZHBO7P-CgBlALV1.js +3 -0
  73. package/lib/path-DVvH25eQ.js +84 -0
  74. package/lib/pegDiagram-2B236MQR-BKv8dTtv.js +94 -0
  75. package/lib/pie-RZYD4A2V-CryPC-P_.js +3 -0
  76. package/lib/pieDiagram-ENE6RG2P-CXeFg_cL.js +203 -0
  77. package/lib/quadrantDiagram-ABIIQ3AL-v_u3aC8Y.js +2001 -0
  78. package/lib/radar-I7S5WNFK-DgzJDRy3.js +3 -0
  79. package/lib/railroad-3IZDKUUU-DFp3mbpB.js +3 -0
  80. package/lib/railroad-abnf-AHOZXSZD-BRjidKH0.js +3 -0
  81. package/lib/railroad-ebnf-EBAXGLYW-PgrDWact.js +3 -0
  82. package/lib/railroad-peg-LSFZ7HO6-CMKir81Y.js +3 -0
  83. package/lib/railroadDiagram-RFXS5EU6-mEC9tVS-.js +76 -0
  84. package/lib/requirementDiagram-TGXJPOKE-BAEzI7V4.js +2223 -0
  85. package/lib/rolldown-runtime-DArdT4gl.js +23 -0
  86. package/lib/rough.esm-B2w_aYoc.js +1361 -0
  87. package/lib/sankeyDiagram-HTMAVEWB-Dbu-sl2E.js +972 -0
  88. package/lib/sequenceDiagram-DBY2YBRQ-DCuWmWHX.js +4156 -0
  89. package/lib/sizeCapture-X5ZJPWSS-BEIM84He.js +46 -0
  90. package/lib/src-DQbL46sB.js +2139 -0
  91. package/lib/src-DuuHKEe6.js +704 -0
  92. package/lib/stateDiagram-2N3HPSRC-fs9QmDMR.js +220 -0
  93. package/lib/stateDiagram-v2-6OUMAXLB-wWxYbttN.js +30 -0
  94. package/lib/swimlanes-5IMT3BWC-QaXUd9db.js +5069 -0
  95. package/lib/swimlanesDiagram-G3AALYLV-BtGToCzH.js +30 -0
  96. package/lib/timeline-definition-FHXFAJF6-CAsyJrsw.js +1069 -0
  97. package/lib/treeView-QDETBFTQ-DVp4aTZQ.js +3 -0
  98. package/lib/treemap-6X3UGDF4-BbBnHMHJ.js +3 -0
  99. package/lib/types.d.ts +44 -0
  100. package/lib/v4-CZv9Hsqq.js +33 -0
  101. package/lib/vennDiagram-L72KCM5P-C87u0gjr.js +1880 -0
  102. package/lib/wardley-OPB4EBWU-B-RXhnoN.js +3 -0
  103. package/lib/wardleyDiagram-EHGQE667-BxviBDl_.js +645 -0
  104. package/lib/xychartDiagram-FW5EYKEG-BQQhanuH.js +2098 -0
  105. package/package.json +29 -0
@@ -0,0 +1,2042 @@
1
+ import { n as e } from "./chunk-Y2CYZVJY-QdJ4V9rh.js";
2
+ import { m as t, p as n } from "./src-DQbL46sB.js";
3
+ import { $ as r, H as i, K as a, U as o, a as s, s as c, v as l, w as u, x as d, y as f } from "./chunk-WYO6CB5R-MV-yOaop.js";
4
+ import { g as p, s as m } from "./chunk-ICXQ74PX-VqT5WUTt.js";
5
+ import { t as h } from "./chunk-32BRIVSS-b-BvyGz0.js";
6
+ import { t as g } from "./chunk-XXDRQBXY-Djd1ChwJ.js";
7
+ import { t as _ } from "./chunk-VR4S4FIN-Bk7IFdYB.js";
8
+ import { i as v } from "./mermaid-renderer-Cp0xusfR.js";
9
+ //#region ../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-EX3LRPZG.mjs
10
+ var y = (function() {
11
+ var t = /* @__PURE__ */ e(function(e, t, n, r) {
12
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
13
+ return n;
14
+ }, "o"), n = [1, 2], r = [1, 3], i = [1, 4], a = [2, 4], o = [1, 9], s = [1, 11], c = [1, 16], l = [1, 17], u = [1, 18], d = [1, 19], f = [1, 33], p = [1, 20], m = [1, 21], h = [1, 22], g = [1, 23], _ = [1, 24], v = [1, 26], y = [1, 27], b = [1, 28], x = [1, 29], S = [1, 30], C = [1, 31], w = [1, 32], T = [1, 35], E = [1, 36], D = [1, 37], O = [1, 38], k = [1, 34], A = [
15
+ 1,
16
+ 4,
17
+ 5,
18
+ 16,
19
+ 17,
20
+ 19,
21
+ 21,
22
+ 22,
23
+ 24,
24
+ 25,
25
+ 26,
26
+ 27,
27
+ 28,
28
+ 29,
29
+ 33,
30
+ 35,
31
+ 37,
32
+ 38,
33
+ 41,
34
+ 45,
35
+ 48,
36
+ 51,
37
+ 52,
38
+ 53,
39
+ 54,
40
+ 57
41
+ ], j = [
42
+ 1,
43
+ 4,
44
+ 5,
45
+ 14,
46
+ 15,
47
+ 16,
48
+ 17,
49
+ 19,
50
+ 21,
51
+ 22,
52
+ 24,
53
+ 25,
54
+ 26,
55
+ 27,
56
+ 28,
57
+ 29,
58
+ 33,
59
+ 35,
60
+ 37,
61
+ 38,
62
+ 39,
63
+ 40,
64
+ 41,
65
+ 45,
66
+ 48,
67
+ 51,
68
+ 52,
69
+ 53,
70
+ 54,
71
+ 57
72
+ ], M = [
73
+ 4,
74
+ 5,
75
+ 16,
76
+ 17,
77
+ 19,
78
+ 21,
79
+ 22,
80
+ 24,
81
+ 25,
82
+ 26,
83
+ 27,
84
+ 28,
85
+ 29,
86
+ 33,
87
+ 35,
88
+ 37,
89
+ 38,
90
+ 41,
91
+ 45,
92
+ 48,
93
+ 51,
94
+ 52,
95
+ 53,
96
+ 54,
97
+ 57
98
+ ], N = {
99
+ trace: /* @__PURE__ */ e(function() {}, "trace"),
100
+ yy: {},
101
+ symbols_: {
102
+ error: 2,
103
+ start: 3,
104
+ SPACE: 4,
105
+ NL: 5,
106
+ SD: 6,
107
+ document: 7,
108
+ line: 8,
109
+ statement: 9,
110
+ classDefStatement: 10,
111
+ styleStatement: 11,
112
+ cssClassStatement: 12,
113
+ idStatement: 13,
114
+ DESCR: 14,
115
+ "-->": 15,
116
+ HIDE_EMPTY: 16,
117
+ scale: 17,
118
+ WIDTH: 18,
119
+ COMPOSIT_STATE: 19,
120
+ STRUCT_START: 20,
121
+ STRUCT_STOP: 21,
122
+ STATE_DESCR: 22,
123
+ AS: 23,
124
+ ID: 24,
125
+ FORK: 25,
126
+ JOIN: 26,
127
+ CHOICE: 27,
128
+ CONCURRENT: 28,
129
+ note: 29,
130
+ notePosition: 30,
131
+ NOTE_TEXT: 31,
132
+ direction: 32,
133
+ acc_title: 33,
134
+ acc_title_value: 34,
135
+ acc_descr: 35,
136
+ acc_descr_value: 36,
137
+ acc_descr_multiline_value: 37,
138
+ CLICK: 38,
139
+ STRING: 39,
140
+ HREF: 40,
141
+ classDef: 41,
142
+ CLASSDEF_ID: 42,
143
+ CLASSDEF_STYLEOPTS: 43,
144
+ DEFAULT: 44,
145
+ style: 45,
146
+ STYLE_IDS: 46,
147
+ STYLEDEF_STYLEOPTS: 47,
148
+ class: 48,
149
+ CLASSENTITY_IDS: 49,
150
+ STYLECLASS: 50,
151
+ direction_tb: 51,
152
+ direction_bt: 52,
153
+ direction_rl: 53,
154
+ direction_lr: 54,
155
+ eol: 55,
156
+ ";": 56,
157
+ EDGE_STATE: 57,
158
+ STYLE_SEPARATOR: 58,
159
+ left_of: 59,
160
+ right_of: 60,
161
+ $accept: 0,
162
+ $end: 1
163
+ },
164
+ terminals_: {
165
+ 2: "error",
166
+ 4: "SPACE",
167
+ 5: "NL",
168
+ 6: "SD",
169
+ 14: "DESCR",
170
+ 15: "-->",
171
+ 16: "HIDE_EMPTY",
172
+ 17: "scale",
173
+ 18: "WIDTH",
174
+ 19: "COMPOSIT_STATE",
175
+ 20: "STRUCT_START",
176
+ 21: "STRUCT_STOP",
177
+ 22: "STATE_DESCR",
178
+ 23: "AS",
179
+ 24: "ID",
180
+ 25: "FORK",
181
+ 26: "JOIN",
182
+ 27: "CHOICE",
183
+ 28: "CONCURRENT",
184
+ 29: "note",
185
+ 31: "NOTE_TEXT",
186
+ 33: "acc_title",
187
+ 34: "acc_title_value",
188
+ 35: "acc_descr",
189
+ 36: "acc_descr_value",
190
+ 37: "acc_descr_multiline_value",
191
+ 38: "CLICK",
192
+ 39: "STRING",
193
+ 40: "HREF",
194
+ 41: "classDef",
195
+ 42: "CLASSDEF_ID",
196
+ 43: "CLASSDEF_STYLEOPTS",
197
+ 44: "DEFAULT",
198
+ 45: "style",
199
+ 46: "STYLE_IDS",
200
+ 47: "STYLEDEF_STYLEOPTS",
201
+ 48: "class",
202
+ 49: "CLASSENTITY_IDS",
203
+ 50: "STYLECLASS",
204
+ 51: "direction_tb",
205
+ 52: "direction_bt",
206
+ 53: "direction_rl",
207
+ 54: "direction_lr",
208
+ 56: ";",
209
+ 57: "EDGE_STATE",
210
+ 58: "STYLE_SEPARATOR",
211
+ 59: "left_of",
212
+ 60: "right_of"
213
+ },
214
+ productions_: [
215
+ 0,
216
+ [3, 2],
217
+ [3, 2],
218
+ [3, 2],
219
+ [7, 0],
220
+ [7, 2],
221
+ [8, 2],
222
+ [8, 1],
223
+ [8, 1],
224
+ [9, 1],
225
+ [9, 1],
226
+ [9, 1],
227
+ [9, 1],
228
+ [9, 2],
229
+ [9, 3],
230
+ [9, 4],
231
+ [9, 1],
232
+ [9, 2],
233
+ [9, 1],
234
+ [9, 4],
235
+ [9, 3],
236
+ [9, 6],
237
+ [9, 1],
238
+ [9, 1],
239
+ [9, 1],
240
+ [9, 1],
241
+ [9, 4],
242
+ [9, 4],
243
+ [9, 1],
244
+ [9, 2],
245
+ [9, 2],
246
+ [9, 1],
247
+ [9, 5],
248
+ [9, 5],
249
+ [10, 3],
250
+ [10, 3],
251
+ [11, 3],
252
+ [12, 3],
253
+ [32, 1],
254
+ [32, 1],
255
+ [32, 1],
256
+ [32, 1],
257
+ [55, 1],
258
+ [55, 1],
259
+ [13, 1],
260
+ [13, 1],
261
+ [13, 3],
262
+ [13, 3],
263
+ [30, 1],
264
+ [30, 1]
265
+ ],
266
+ performAction: /* @__PURE__ */ e(function(e, t, n, r, i, a, o) {
267
+ var s = a.length - 1;
268
+ switch (i) {
269
+ case 3: return r.setRootDoc(a[s]), a[s];
270
+ case 4:
271
+ this.$ = [];
272
+ break;
273
+ case 5:
274
+ a[s] != "nl" && (a[s - 1].push(a[s]), this.$ = a[s - 1]);
275
+ break;
276
+ case 6:
277
+ case 7:
278
+ this.$ = a[s];
279
+ break;
280
+ case 8:
281
+ this.$ = "nl";
282
+ break;
283
+ case 12:
284
+ this.$ = a[s];
285
+ break;
286
+ case 13:
287
+ let e = a[s - 1];
288
+ e.description = r.trimColon(a[s]), this.$ = e;
289
+ break;
290
+ case 14:
291
+ this.$ = {
292
+ stmt: "relation",
293
+ state1: a[s - 2],
294
+ state2: a[s]
295
+ };
296
+ break;
297
+ case 15:
298
+ let t = r.trimColon(a[s]);
299
+ this.$ = {
300
+ stmt: "relation",
301
+ state1: a[s - 3],
302
+ state2: a[s - 1],
303
+ description: t
304
+ };
305
+ break;
306
+ case 19:
307
+ this.$ = {
308
+ stmt: "state",
309
+ id: a[s - 3],
310
+ type: "default",
311
+ description: "",
312
+ doc: a[s - 1]
313
+ };
314
+ break;
315
+ case 20:
316
+ var c = a[s], l = a[s - 2].trim();
317
+ if (a[s].match(":")) {
318
+ var u = a[s].split(":");
319
+ c = u[0], l = [l, u[1]];
320
+ }
321
+ this.$ = {
322
+ stmt: "state",
323
+ id: c,
324
+ type: "default",
325
+ description: l
326
+ };
327
+ break;
328
+ case 21:
329
+ this.$ = {
330
+ stmt: "state",
331
+ id: a[s - 3],
332
+ type: "default",
333
+ description: a[s - 5],
334
+ doc: a[s - 1]
335
+ };
336
+ break;
337
+ case 22:
338
+ this.$ = {
339
+ stmt: "state",
340
+ id: a[s],
341
+ type: "fork"
342
+ };
343
+ break;
344
+ case 23:
345
+ this.$ = {
346
+ stmt: "state",
347
+ id: a[s],
348
+ type: "join"
349
+ };
350
+ break;
351
+ case 24:
352
+ this.$ = {
353
+ stmt: "state",
354
+ id: a[s],
355
+ type: "choice"
356
+ };
357
+ break;
358
+ case 25:
359
+ this.$ = {
360
+ stmt: "state",
361
+ id: r.getDividerId(),
362
+ type: "divider"
363
+ };
364
+ break;
365
+ case 26:
366
+ this.$ = {
367
+ stmt: "state",
368
+ id: a[s - 1].trim(),
369
+ note: {
370
+ position: a[s - 2].trim(),
371
+ text: a[s].trim()
372
+ }
373
+ };
374
+ break;
375
+ case 29:
376
+ this.$ = a[s].trim(), r.setAccTitle(this.$);
377
+ break;
378
+ case 30:
379
+ case 31:
380
+ this.$ = a[s].trim(), r.setAccDescription(this.$);
381
+ break;
382
+ case 32:
383
+ this.$ = {
384
+ stmt: "click",
385
+ id: a[s - 3],
386
+ url: a[s - 2],
387
+ tooltip: a[s - 1]
388
+ };
389
+ break;
390
+ case 33:
391
+ this.$ = {
392
+ stmt: "click",
393
+ id: a[s - 3],
394
+ url: a[s - 1],
395
+ tooltip: ""
396
+ };
397
+ break;
398
+ case 34:
399
+ case 35:
400
+ this.$ = {
401
+ stmt: "classDef",
402
+ id: a[s - 1].trim(),
403
+ classes: a[s].trim()
404
+ };
405
+ break;
406
+ case 36:
407
+ this.$ = {
408
+ stmt: "style",
409
+ id: a[s - 1].trim(),
410
+ styleClass: a[s].trim()
411
+ };
412
+ break;
413
+ case 37:
414
+ this.$ = {
415
+ stmt: "applyClass",
416
+ id: a[s - 1].trim(),
417
+ styleClass: a[s].trim()
418
+ };
419
+ break;
420
+ case 38:
421
+ r.setDirection("TB"), this.$ = {
422
+ stmt: "dir",
423
+ value: "TB"
424
+ };
425
+ break;
426
+ case 39:
427
+ r.setDirection("BT"), this.$ = {
428
+ stmt: "dir",
429
+ value: "BT"
430
+ };
431
+ break;
432
+ case 40:
433
+ r.setDirection("RL"), this.$ = {
434
+ stmt: "dir",
435
+ value: "RL"
436
+ };
437
+ break;
438
+ case 41:
439
+ r.setDirection("LR"), this.$ = {
440
+ stmt: "dir",
441
+ value: "LR"
442
+ };
443
+ break;
444
+ case 44:
445
+ case 45:
446
+ this.$ = {
447
+ stmt: "state",
448
+ id: a[s].trim(),
449
+ type: "default",
450
+ description: ""
451
+ };
452
+ break;
453
+ case 46:
454
+ this.$ = {
455
+ stmt: "state",
456
+ id: a[s - 2].trim(),
457
+ classes: [a[s].trim()],
458
+ type: "default",
459
+ description: ""
460
+ };
461
+ break;
462
+ case 47: this.$ = {
463
+ stmt: "state",
464
+ id: a[s - 2].trim(),
465
+ classes: [a[s].trim()],
466
+ type: "default",
467
+ description: ""
468
+ };
469
+ }
470
+ }, "anonymous"),
471
+ table: [
472
+ {
473
+ 3: 1,
474
+ 4: n,
475
+ 5: r,
476
+ 6: i
477
+ },
478
+ { 1: [3] },
479
+ {
480
+ 3: 5,
481
+ 4: n,
482
+ 5: r,
483
+ 6: i
484
+ },
485
+ {
486
+ 3: 6,
487
+ 4: n,
488
+ 5: r,
489
+ 6: i
490
+ },
491
+ t([
492
+ 1,
493
+ 4,
494
+ 5,
495
+ 16,
496
+ 17,
497
+ 19,
498
+ 22,
499
+ 24,
500
+ 25,
501
+ 26,
502
+ 27,
503
+ 28,
504
+ 29,
505
+ 33,
506
+ 35,
507
+ 37,
508
+ 38,
509
+ 41,
510
+ 45,
511
+ 48,
512
+ 51,
513
+ 52,
514
+ 53,
515
+ 54,
516
+ 57
517
+ ], a, { 7: 7 }),
518
+ { 1: [2, 1] },
519
+ { 1: [2, 2] },
520
+ {
521
+ 1: [2, 3],
522
+ 4: o,
523
+ 5: s,
524
+ 8: 8,
525
+ 9: 10,
526
+ 10: 12,
527
+ 11: 13,
528
+ 12: 14,
529
+ 13: 15,
530
+ 16: c,
531
+ 17: l,
532
+ 19: u,
533
+ 22: d,
534
+ 24: f,
535
+ 25: p,
536
+ 26: m,
537
+ 27: h,
538
+ 28: g,
539
+ 29: _,
540
+ 32: 25,
541
+ 33: v,
542
+ 35: y,
543
+ 37: b,
544
+ 38: x,
545
+ 41: S,
546
+ 45: C,
547
+ 48: w,
548
+ 51: T,
549
+ 52: E,
550
+ 53: D,
551
+ 54: O,
552
+ 57: k
553
+ },
554
+ t(A, [2, 5]),
555
+ {
556
+ 9: 39,
557
+ 10: 12,
558
+ 11: 13,
559
+ 12: 14,
560
+ 13: 15,
561
+ 16: c,
562
+ 17: l,
563
+ 19: u,
564
+ 22: d,
565
+ 24: f,
566
+ 25: p,
567
+ 26: m,
568
+ 27: h,
569
+ 28: g,
570
+ 29: _,
571
+ 32: 25,
572
+ 33: v,
573
+ 35: y,
574
+ 37: b,
575
+ 38: x,
576
+ 41: S,
577
+ 45: C,
578
+ 48: w,
579
+ 51: T,
580
+ 52: E,
581
+ 53: D,
582
+ 54: O,
583
+ 57: k
584
+ },
585
+ t(A, [2, 7]),
586
+ t(A, [2, 8]),
587
+ t(A, [2, 9]),
588
+ t(A, [2, 10]),
589
+ t(A, [2, 11]),
590
+ t(A, [2, 12], {
591
+ 14: [1, 40],
592
+ 15: [1, 41]
593
+ }),
594
+ t(A, [2, 16]),
595
+ { 18: [1, 42] },
596
+ t(A, [2, 18], { 20: [1, 43] }),
597
+ { 23: [1, 44] },
598
+ t(A, [2, 22]),
599
+ t(A, [2, 23]),
600
+ t(A, [2, 24]),
601
+ t(A, [2, 25]),
602
+ {
603
+ 30: 45,
604
+ 31: [1, 46],
605
+ 59: [1, 47],
606
+ 60: [1, 48]
607
+ },
608
+ t(A, [2, 28]),
609
+ { 34: [1, 49] },
610
+ { 36: [1, 50] },
611
+ t(A, [2, 31]),
612
+ {
613
+ 13: 51,
614
+ 24: f,
615
+ 57: k
616
+ },
617
+ {
618
+ 42: [1, 52],
619
+ 44: [1, 53]
620
+ },
621
+ { 46: [1, 54] },
622
+ { 49: [1, 55] },
623
+ t(j, [2, 44], { 58: [1, 56] }),
624
+ t(j, [2, 45], { 58: [1, 57] }),
625
+ t(A, [2, 38]),
626
+ t(A, [2, 39]),
627
+ t(A, [2, 40]),
628
+ t(A, [2, 41]),
629
+ t(A, [2, 6]),
630
+ t(A, [2, 13]),
631
+ {
632
+ 13: 58,
633
+ 24: f,
634
+ 57: k
635
+ },
636
+ t(A, [2, 17]),
637
+ t(M, a, { 7: 59 }),
638
+ { 24: [1, 60] },
639
+ { 24: [1, 61] },
640
+ { 23: [1, 62] },
641
+ { 24: [2, 48] },
642
+ { 24: [2, 49] },
643
+ t(A, [2, 29]),
644
+ t(A, [2, 30]),
645
+ {
646
+ 39: [1, 63],
647
+ 40: [1, 64]
648
+ },
649
+ { 43: [1, 65] },
650
+ { 43: [1, 66] },
651
+ { 47: [1, 67] },
652
+ { 50: [1, 68] },
653
+ { 24: [1, 69] },
654
+ { 24: [1, 70] },
655
+ t(A, [2, 14], { 14: [1, 71] }),
656
+ {
657
+ 4: o,
658
+ 5: s,
659
+ 8: 8,
660
+ 9: 10,
661
+ 10: 12,
662
+ 11: 13,
663
+ 12: 14,
664
+ 13: 15,
665
+ 16: c,
666
+ 17: l,
667
+ 19: u,
668
+ 21: [1, 72],
669
+ 22: d,
670
+ 24: f,
671
+ 25: p,
672
+ 26: m,
673
+ 27: h,
674
+ 28: g,
675
+ 29: _,
676
+ 32: 25,
677
+ 33: v,
678
+ 35: y,
679
+ 37: b,
680
+ 38: x,
681
+ 41: S,
682
+ 45: C,
683
+ 48: w,
684
+ 51: T,
685
+ 52: E,
686
+ 53: D,
687
+ 54: O,
688
+ 57: k
689
+ },
690
+ t(A, [2, 20], { 20: [1, 73] }),
691
+ { 31: [1, 74] },
692
+ { 24: [1, 75] },
693
+ { 39: [1, 76] },
694
+ { 39: [1, 77] },
695
+ t(A, [2, 34]),
696
+ t(A, [2, 35]),
697
+ t(A, [2, 36]),
698
+ t(A, [2, 37]),
699
+ t(j, [2, 46]),
700
+ t(j, [2, 47]),
701
+ t(A, [2, 15]),
702
+ t(A, [2, 19]),
703
+ t(M, a, { 7: 78 }),
704
+ t(A, [2, 26]),
705
+ t(A, [2, 27]),
706
+ { 5: [1, 79] },
707
+ { 5: [1, 80] },
708
+ {
709
+ 4: o,
710
+ 5: s,
711
+ 8: 8,
712
+ 9: 10,
713
+ 10: 12,
714
+ 11: 13,
715
+ 12: 14,
716
+ 13: 15,
717
+ 16: c,
718
+ 17: l,
719
+ 19: u,
720
+ 21: [1, 81],
721
+ 22: d,
722
+ 24: f,
723
+ 25: p,
724
+ 26: m,
725
+ 27: h,
726
+ 28: g,
727
+ 29: _,
728
+ 32: 25,
729
+ 33: v,
730
+ 35: y,
731
+ 37: b,
732
+ 38: x,
733
+ 41: S,
734
+ 45: C,
735
+ 48: w,
736
+ 51: T,
737
+ 52: E,
738
+ 53: D,
739
+ 54: O,
740
+ 57: k
741
+ },
742
+ t(A, [2, 32]),
743
+ t(A, [2, 33]),
744
+ t(A, [2, 21])
745
+ ],
746
+ defaultActions: {
747
+ 5: [2, 1],
748
+ 6: [2, 2],
749
+ 47: [2, 48],
750
+ 48: [2, 49]
751
+ },
752
+ parseError: /* @__PURE__ */ e(function(e, t) {
753
+ if (t.recoverable) this.trace(e);
754
+ else {
755
+ var n = Error(e);
756
+ throw n.hash = t, n;
757
+ }
758
+ }, "parseError"),
759
+ parse: /* @__PURE__ */ e(function(t) {
760
+ var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
761
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
762
+ h.setInput(t, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
763
+ var v = h.yylloc;
764
+ o.push(v);
765
+ var y = h.options && h.options.ranges;
766
+ this.parseError = typeof g.yy.parseError == "function" ? g.yy.parseError : Object.getPrototypeOf(this).parseError;
767
+ function b(e) {
768
+ r.length -= 2 * e, a.length -= e, o.length -= e;
769
+ }
770
+ e(b, "popStack");
771
+ function x() {
772
+ var e = i.pop() || h.lex() || p;
773
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
774
+ }
775
+ e(x, "lex");
776
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
777
+ if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
778
+ var M = "";
779
+ for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
780
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
781
+ text: h.match,
782
+ token: this.terminals_[S] || S,
783
+ line: h.yylineno,
784
+ loc: v,
785
+ expected: j
786
+ });
787
+ }
788
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
789
+ switch (T[0]) {
790
+ case 1:
791
+ r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
792
+ break;
793
+ case 2:
794
+ if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
795
+ first_line: o[o.length - (k || 1)].first_line,
796
+ last_line: o[o.length - 1].last_line,
797
+ first_column: o[o.length - (k || 1)].first_column,
798
+ last_column: o[o.length - 1].last_column
799
+ }, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
800
+ c,
801
+ u,
802
+ l,
803
+ g.yy,
804
+ T[1],
805
+ a,
806
+ o
807
+ ].concat(m)), E !== void 0) return E;
808
+ k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
809
+ break;
810
+ case 3: return !0;
811
+ }
812
+ }
813
+ return !0;
814
+ }, "parse")
815
+ };
816
+ N.lexer = /* @__PURE__ */ (function() {
817
+ return {
818
+ EOF: 1,
819
+ parseError: /* @__PURE__ */ e(function(e, t) {
820
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
821
+ else throw Error(e);
822
+ }, "parseError"),
823
+ setInput: /* @__PURE__ */ e(function(e, t) {
824
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
825
+ first_line: 1,
826
+ first_column: 0,
827
+ last_line: 1,
828
+ last_column: 0
829
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
830
+ }, "setInput"),
831
+ input: /* @__PURE__ */ e(function() {
832
+ var e = this._input[0];
833
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
834
+ }, "input"),
835
+ unput: /* @__PURE__ */ e(function(e) {
836
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
837
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
838
+ var r = this.match.split(/(?:\r\n?|\n)/g);
839
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
840
+ var i = this.yylloc.range;
841
+ return this.yylloc = {
842
+ first_line: this.yylloc.first_line,
843
+ last_line: this.yylineno + 1,
844
+ first_column: this.yylloc.first_column,
845
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
846
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
847
+ }, "unput"),
848
+ more: /* @__PURE__ */ e(function() {
849
+ return this._more = !0, this;
850
+ }, "more"),
851
+ reject: /* @__PURE__ */ e(function() {
852
+ if (this.options.backtrack_lexer) this._backtrack = !0;
853
+ 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(), {
854
+ text: "",
855
+ token: null,
856
+ line: this.yylineno
857
+ });
858
+ return this;
859
+ }, "reject"),
860
+ less: /* @__PURE__ */ e(function(e) {
861
+ this.unput(this.match.slice(e));
862
+ }, "less"),
863
+ pastInput: /* @__PURE__ */ e(function() {
864
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
865
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
866
+ }, "pastInput"),
867
+ upcomingInput: /* @__PURE__ */ e(function() {
868
+ var e = this.match;
869
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
870
+ }, "upcomingInput"),
871
+ showPosition: /* @__PURE__ */ e(function() {
872
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
873
+ return e + this.upcomingInput() + "\n" + t + "^";
874
+ }, "showPosition"),
875
+ test_match: /* @__PURE__ */ e(function(e, t) {
876
+ var n, r, i;
877
+ if (this.options.backtrack_lexer && (i = {
878
+ yylineno: this.yylineno,
879
+ yylloc: {
880
+ first_line: this.yylloc.first_line,
881
+ last_line: this.last_line,
882
+ first_column: this.yylloc.first_column,
883
+ last_column: this.yylloc.last_column
884
+ },
885
+ yytext: this.yytext,
886
+ match: this.match,
887
+ matches: this.matches,
888
+ matched: this.matched,
889
+ yyleng: this.yyleng,
890
+ offset: this.offset,
891
+ _more: this._more,
892
+ _input: this._input,
893
+ yy: this.yy,
894
+ conditionStack: this.conditionStack.slice(0),
895
+ done: this.done
896
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
897
+ first_line: this.yylloc.last_line,
898
+ last_line: this.yylineno + 1,
899
+ first_column: this.yylloc.last_column,
900
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
901
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
902
+ if (this._backtrack) {
903
+ for (var a in i) this[a] = i[a];
904
+ return !1;
905
+ }
906
+ return !1;
907
+ }, "test_match"),
908
+ next: /* @__PURE__ */ e(function() {
909
+ if (this.done) return this.EOF;
910
+ this._input || (this.done = !0);
911
+ var e, t, n, r;
912
+ this._more || (this.yytext = "", this.match = "");
913
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
914
+ if (t = n, r = a, this.options.backtrack_lexer) {
915
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
916
+ if (this._backtrack) {
917
+ t = !1;
918
+ continue;
919
+ }
920
+ return !1;
921
+ }
922
+ if (!this.options.flex) break;
923
+ }
924
+ return t ? (e = this.test_match(t, i[r]), e !== !1 && e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
925
+ text: "",
926
+ token: null,
927
+ line: this.yylineno
928
+ });
929
+ }, "next"),
930
+ lex: /* @__PURE__ */ e(function() {
931
+ return this.next() || this.lex();
932
+ }, "lex"),
933
+ begin: /* @__PURE__ */ e(function(e) {
934
+ this.conditionStack.push(e);
935
+ }, "begin"),
936
+ popState: /* @__PURE__ */ e(function() {
937
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
938
+ }, "popState"),
939
+ _currentRules: /* @__PURE__ */ e(function() {
940
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
941
+ }, "_currentRules"),
942
+ topState: /* @__PURE__ */ e(function(e) {
943
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
944
+ }, "topState"),
945
+ pushState: /* @__PURE__ */ e(function(e) {
946
+ this.begin(e);
947
+ }, "pushState"),
948
+ stateStackSize: /* @__PURE__ */ e(function() {
949
+ return this.conditionStack.length;
950
+ }, "stateStackSize"),
951
+ options: { "case-insensitive": !0 },
952
+ performAction: /* @__PURE__ */ e(function(t, n, r, i) {
953
+ function a() {
954
+ let e = n.yytext.indexOf("%%");
955
+ if (e === 0) return !1;
956
+ if (e > 0) {
957
+ let r = n.yytext.slice(0, e), i = n.yytext.slice(e);
958
+ i && t.lexer.unput(i), n.yytext = r;
959
+ }
960
+ return !0;
961
+ }
962
+ switch (e(a, "processId"), r) {
963
+ case 0: return 38;
964
+ case 1: return 40;
965
+ case 2: return 39;
966
+ case 3: return 44;
967
+ case 4: return 51;
968
+ case 5: return 52;
969
+ case 6: return 53;
970
+ case 7: return 54;
971
+ case 8: return 5;
972
+ case 9: break;
973
+ case 10: break;
974
+ case 11: break;
975
+ case 12: break;
976
+ case 13: return this.pushState("SCALE"), 17;
977
+ case 14: return 18;
978
+ case 15:
979
+ this.popState();
980
+ break;
981
+ case 16: return this.begin("acc_title"), 33;
982
+ case 17: return this.popState(), "acc_title_value";
983
+ case 18: return this.begin("acc_descr"), 35;
984
+ case 19: return this.popState(), "acc_descr_value";
985
+ case 20:
986
+ this.begin("acc_descr_multiline");
987
+ break;
988
+ case 21:
989
+ this.popState();
990
+ break;
991
+ case 22: return "acc_descr_multiline_value";
992
+ case 23: return this.pushState("CLASSDEF"), 41;
993
+ case 24: return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
994
+ case 25: return this.popState(), this.pushState("CLASSDEFID"), 42;
995
+ case 26: return this.popState(), 43;
996
+ case 27: return this.pushState("CLASS"), 48;
997
+ case 28: return this.popState(), this.pushState("CLASS_STYLE"), 49;
998
+ case 29: return this.popState(), 50;
999
+ case 30: return this.pushState("STYLE"), 45;
1000
+ case 31: return this.popState(), this.pushState("STYLEDEF_STYLES"), 46;
1001
+ case 32: return this.popState(), 47;
1002
+ case 33: return this.pushState("SCALE"), 17;
1003
+ case 34: return 18;
1004
+ case 35:
1005
+ this.popState();
1006
+ break;
1007
+ case 36:
1008
+ this.pushState("STATE");
1009
+ break;
1010
+ case 37: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25;
1011
+ case 38: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26;
1012
+ case 39: return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27;
1013
+ case 40: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25;
1014
+ case 41: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26;
1015
+ case 42: return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27;
1016
+ case 43: return 51;
1017
+ case 44: return 52;
1018
+ case 45: return 53;
1019
+ case 46: return 54;
1020
+ case 47:
1021
+ this.pushState("STATE_STRING");
1022
+ break;
1023
+ case 48: return this.pushState("STATE_ID"), "AS";
1024
+ case 49: return a() ? (this.popState(), "ID") : void 0;
1025
+ case 50:
1026
+ this.popState();
1027
+ break;
1028
+ case 51: return "STATE_DESCR";
1029
+ case 52: throw Error("Error: State name must be a single word. Found: \"" + n.yytext.trim() + "\"");
1030
+ case 53: return 19;
1031
+ case 54:
1032
+ this.popState();
1033
+ break;
1034
+ case 55: return this.popState(), this.pushState("struct"), 20;
1035
+ case 56: return this.popState(), 21;
1036
+ case 57: break;
1037
+ case 58: return this.begin("NOTE"), 29;
1038
+ case 59: return this.popState(), this.pushState("NOTE_ID"), 59;
1039
+ case 60: return this.popState(), this.pushState("NOTE_ID"), 60;
1040
+ case 61:
1041
+ this.popState(), this.pushState("FLOATING_NOTE");
1042
+ break;
1043
+ case 62: return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
1044
+ case 63: break;
1045
+ case 64: return "NOTE_TEXT";
1046
+ case 65: return a() ? (this.popState(), "ID") : void 0;
1047
+ case 66: return a() ? (this.popState(), this.pushState("NOTE_TEXT"), 24) : void 0;
1048
+ case 67: return this.popState(), n.yytext = n.yytext.substr(2).trim(), 31;
1049
+ case 68: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 31;
1050
+ case 69: return 6;
1051
+ case 70: return 6;
1052
+ case 71: return 16;
1053
+ case 72: return 57;
1054
+ case 73: return a() ? 24 : void 0;
1055
+ case 74: return n.yytext = n.yytext.trim(), 14;
1056
+ case 75: return 15;
1057
+ case 76: return 28;
1058
+ case 77: return 58;
1059
+ case 78: return 5;
1060
+ case 79: return "INVALID";
1061
+ }
1062
+ }, "anonymous"),
1063
+ rules: [
1064
+ /^(?:click\b)/i,
1065
+ /^(?:href\b)/i,
1066
+ /^(?:"[^"]*")/i,
1067
+ /^(?:default\b)/i,
1068
+ /^(?:.*direction\s+TB[^\n]*)/i,
1069
+ /^(?:.*direction\s+BT[^\n]*)/i,
1070
+ /^(?:.*direction\s+RL[^\n]*)/i,
1071
+ /^(?:.*direction\s+LR[^\n]*)/i,
1072
+ /^(?:[\n]+)/i,
1073
+ /^(?:[\s]+)/i,
1074
+ /^(?:((?!\n)\s)+)/i,
1075
+ /^(?:#[^\n]*)/i,
1076
+ /^(?:%%(?!\{)[^\n]*)/i,
1077
+ /^(?:scale\s+)/i,
1078
+ /^(?:\d+)/i,
1079
+ /^(?:\s+width\b)/i,
1080
+ /^(?:accTitle\s*:\s*)/i,
1081
+ /^(?:(?!\n||)*[^\n]*)/i,
1082
+ /^(?:accDescr\s*:\s*)/i,
1083
+ /^(?:(?!\n||)*[^\n]*)/i,
1084
+ /^(?:accDescr\s*\{\s*)/i,
1085
+ /^(?:[\}])/i,
1086
+ /^(?:[^\}]*)/i,
1087
+ /^(?:classDef\s+)/i,
1088
+ /^(?:DEFAULT\s+)/i,
1089
+ /^(?:\w+\s+)/i,
1090
+ /^(?:[^\n]*)/i,
1091
+ /^(?:class\s+)/i,
1092
+ /^(?:(\w+)+((,\s*\w+)*))/i,
1093
+ /^(?:[^\n]*)/i,
1094
+ /^(?:style\s+)/i,
1095
+ /^(?:[\w,]+\s+)/i,
1096
+ /^(?:[^\n]*)/i,
1097
+ /^(?:scale\s+)/i,
1098
+ /^(?:\d+)/i,
1099
+ /^(?:\s+width\b)/i,
1100
+ /^(?:state\s+)/i,
1101
+ /^(?:.*<<fork>>)/i,
1102
+ /^(?:.*<<join>>)/i,
1103
+ /^(?:.*<<choice>>)/i,
1104
+ /^(?:.*\[\[fork\]\])/i,
1105
+ /^(?:.*\[\[join\]\])/i,
1106
+ /^(?:.*\[\[choice\]\])/i,
1107
+ /^(?:.*direction\s+TB[^\n]*)/i,
1108
+ /^(?:.*direction\s+BT[^\n]*)/i,
1109
+ /^(?:.*direction\s+RL[^\n]*)/i,
1110
+ /^(?:.*direction\s+LR[^\n]*)/i,
1111
+ /^(?:["])/i,
1112
+ /^(?:\s*as\s+)/i,
1113
+ /^(?:[^\n\{]*)/i,
1114
+ /^(?:["])/i,
1115
+ /^(?:[^"]*)/i,
1116
+ /^(?:\w+\s+\w+.*?\{)/i,
1117
+ /^(?:[^\n\s\{]+)/i,
1118
+ /^(?:\n)/i,
1119
+ /^(?:\{)/i,
1120
+ /^(?:\})/i,
1121
+ /^(?:[\n])/i,
1122
+ /^(?:note\s+)/i,
1123
+ /^(?:left of\b)/i,
1124
+ /^(?:right of\b)/i,
1125
+ /^(?:")/i,
1126
+ /^(?:\s*as\s*)/i,
1127
+ /^(?:["])/i,
1128
+ /^(?:[^"]*)/i,
1129
+ /^(?:[^\n]*)/i,
1130
+ /^(?:\s*[^:\n\s\-]+)/i,
1131
+ /^(?:\s*:[^:\n;]+)/i,
1132
+ /^(?:[\s\S]*?\n\s*end note\b)/i,
1133
+ /^(?:stateDiagram\s+)/i,
1134
+ /^(?:stateDiagram-v2\s+)/i,
1135
+ /^(?:hide empty description\b)/i,
1136
+ /^(?:\[\*\])/i,
1137
+ /^(?:[^:\n\s\-\{]+)/i,
1138
+ /^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,
1139
+ /^(?:-->)/i,
1140
+ /^(?:--)/i,
1141
+ /^(?::::)/i,
1142
+ /^(?:$)/i,
1143
+ /^(?:.)/i
1144
+ ],
1145
+ conditions: {
1146
+ LINE: {
1147
+ rules: [
1148
+ 10,
1149
+ 11,
1150
+ 12
1151
+ ],
1152
+ inclusive: !1
1153
+ },
1154
+ struct: {
1155
+ rules: [
1156
+ 10,
1157
+ 11,
1158
+ 12,
1159
+ 23,
1160
+ 27,
1161
+ 30,
1162
+ 36,
1163
+ 43,
1164
+ 44,
1165
+ 45,
1166
+ 46,
1167
+ 56,
1168
+ 57,
1169
+ 58,
1170
+ 72,
1171
+ 73,
1172
+ 74,
1173
+ 75,
1174
+ 76,
1175
+ 77
1176
+ ],
1177
+ inclusive: !1
1178
+ },
1179
+ FLOATING_NOTE_ID: {
1180
+ rules: [65],
1181
+ inclusive: !1
1182
+ },
1183
+ FLOATING_NOTE: {
1184
+ rules: [
1185
+ 62,
1186
+ 63,
1187
+ 64
1188
+ ],
1189
+ inclusive: !1
1190
+ },
1191
+ NOTE_TEXT: {
1192
+ rules: [67, 68],
1193
+ inclusive: !1
1194
+ },
1195
+ NOTE_ID: {
1196
+ rules: [66],
1197
+ inclusive: !1
1198
+ },
1199
+ NOTE: {
1200
+ rules: [
1201
+ 59,
1202
+ 60,
1203
+ 61
1204
+ ],
1205
+ inclusive: !1
1206
+ },
1207
+ STYLEDEF_STYLEOPTS: {
1208
+ rules: [],
1209
+ inclusive: !1
1210
+ },
1211
+ STYLEDEF_STYLES: {
1212
+ rules: [32],
1213
+ inclusive: !1
1214
+ },
1215
+ STYLE_IDS: {
1216
+ rules: [],
1217
+ inclusive: !1
1218
+ },
1219
+ STYLE: {
1220
+ rules: [31],
1221
+ inclusive: !1
1222
+ },
1223
+ CLASS_STYLE: {
1224
+ rules: [29],
1225
+ inclusive: !1
1226
+ },
1227
+ CLASS: {
1228
+ rules: [28],
1229
+ inclusive: !1
1230
+ },
1231
+ CLASSDEFID: {
1232
+ rules: [26],
1233
+ inclusive: !1
1234
+ },
1235
+ CLASSDEF: {
1236
+ rules: [24, 25],
1237
+ inclusive: !1
1238
+ },
1239
+ acc_descr_multiline: {
1240
+ rules: [21, 22],
1241
+ inclusive: !1
1242
+ },
1243
+ acc_descr: {
1244
+ rules: [19],
1245
+ inclusive: !1
1246
+ },
1247
+ acc_title: {
1248
+ rules: [17],
1249
+ inclusive: !1
1250
+ },
1251
+ SCALE: {
1252
+ rules: [
1253
+ 14,
1254
+ 15,
1255
+ 34,
1256
+ 35
1257
+ ],
1258
+ inclusive: !1
1259
+ },
1260
+ ALIAS: {
1261
+ rules: [],
1262
+ inclusive: !1
1263
+ },
1264
+ STATE_ID: {
1265
+ rules: [49],
1266
+ inclusive: !1
1267
+ },
1268
+ STATE_STRING: {
1269
+ rules: [50, 51],
1270
+ inclusive: !1
1271
+ },
1272
+ FORK_STATE: {
1273
+ rules: [],
1274
+ inclusive: !1
1275
+ },
1276
+ STATE: {
1277
+ rules: [
1278
+ 10,
1279
+ 11,
1280
+ 12,
1281
+ 37,
1282
+ 38,
1283
+ 39,
1284
+ 40,
1285
+ 41,
1286
+ 42,
1287
+ 47,
1288
+ 48,
1289
+ 52,
1290
+ 53,
1291
+ 54,
1292
+ 55
1293
+ ],
1294
+ inclusive: !1
1295
+ },
1296
+ ID: {
1297
+ rules: [
1298
+ 10,
1299
+ 11,
1300
+ 12
1301
+ ],
1302
+ inclusive: !1
1303
+ },
1304
+ INITIAL: {
1305
+ rules: [
1306
+ 0,
1307
+ 1,
1308
+ 2,
1309
+ 3,
1310
+ 4,
1311
+ 5,
1312
+ 6,
1313
+ 7,
1314
+ 8,
1315
+ 9,
1316
+ 11,
1317
+ 12,
1318
+ 13,
1319
+ 16,
1320
+ 18,
1321
+ 20,
1322
+ 23,
1323
+ 27,
1324
+ 30,
1325
+ 33,
1326
+ 36,
1327
+ 55,
1328
+ 58,
1329
+ 69,
1330
+ 70,
1331
+ 71,
1332
+ 72,
1333
+ 73,
1334
+ 74,
1335
+ 75,
1336
+ 77,
1337
+ 78,
1338
+ 79
1339
+ ],
1340
+ inclusive: !0
1341
+ }
1342
+ }
1343
+ };
1344
+ })();
1345
+ function P() {
1346
+ this.yy = {};
1347
+ }
1348
+ return e(P, "Parser"), P.prototype = N, N.Parser = P, new P();
1349
+ })();
1350
+ y.parser = y;
1351
+ var b = y, x = "TB", S = "TB", C = "dir", w = "state", T = "root", E = "relation", D = "classDef", O = "style", k = "applyClass", A = "default", j = "divider", M = "fill:none", N = "fill: #333", P = "c", ee = "markdown", F = "normal", I = "rect", L = "rectWithTitle", te = "stateStart", ne = "stateEnd", R = "divider", re = "roundedWithTitle", ie = "note", ae = "noteGroup", z = "statediagram", oe = `${z}-state`, B = "transition", se = "note", ce = `${B} note-edge`, le = `${z}-${se}`, ue = `${z}-cluster`, de = `${z}-cluster-alt`, V = "parent", H = "note", fe = "state", U = "----", pe = `${U}${H}`, W = `${U}${V}`, G = /* @__PURE__ */ e((e, t = S) => {
1352
+ if (!e.doc) return t;
1353
+ let n = t;
1354
+ for (let t of e.doc) t.stmt === "dir" && (n = t.value);
1355
+ return n;
1356
+ }, "getDir"), me = {
1357
+ getClasses: /* @__PURE__ */ e(function(e, t) {
1358
+ return t.db.getClasses();
1359
+ }, "getClasses"),
1360
+ draw: /* @__PURE__ */ e(async function(e, n, r, i) {
1361
+ t.info("REF0:"), t.info("Drawing state diagram (v2)", n);
1362
+ let { securityLevel: a, state: o, layout: s } = d();
1363
+ i.db.extract(i.db.getRootDocV2());
1364
+ let c = i.db.getData(), l = g(n, a);
1365
+ c.type = i.type, c.layoutAlgorithm = s, c.nodeSpacing = o?.nodeSpacing || 50, c.rankSpacing = o?.rankSpacing || 50, c.markers = d().look === "neo" ? ["barbNeo"] : ["barb"], c.diagramId = n, await v(c, l);
1366
+ try {
1367
+ (typeof i.db.getLinks == "function" ? i.db.getLinks() : /* @__PURE__ */ new Map()).forEach((e, n) => {
1368
+ let r = typeof n == "string" ? n : typeof n?.id == "string" ? n.id : "", i = c.nodes.find((e) => e.id === r);
1369
+ if (!r) {
1370
+ t.warn("⚠️ Invalid or missing stateId from key:", JSON.stringify(n));
1371
+ return;
1372
+ }
1373
+ let a = l.node()?.querySelectorAll("g.node, g.rough-node"), o;
1374
+ if (a?.forEach((e) => {
1375
+ let t = e.textContent?.trim();
1376
+ (e.id === i?.domId || t === r) && (o = e);
1377
+ }), !o) {
1378
+ t.warn("⚠️ Could not find node matching text:", r);
1379
+ return;
1380
+ }
1381
+ let s = o.parentNode;
1382
+ if (!s) {
1383
+ t.warn("⚠️ Node has no parent, cannot wrap:", r);
1384
+ return;
1385
+ }
1386
+ let u = document.createElementNS("http://www.w3.org/2000/svg", "a"), d = e.url.replace(/^"+|"+$/g, "");
1387
+ if (u.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", d), u.setAttribute("target", "_blank"), e.tooltip) {
1388
+ let t = e.tooltip.replace(/^"+|"+$/g, "");
1389
+ u.setAttribute("title", t), o.setAttribute("title", t);
1390
+ }
1391
+ s.replaceChild(u, o), u.appendChild(o), t.info("🔗 Wrapped node in <a> tag for:", r, e.url);
1392
+ });
1393
+ } catch (e) {
1394
+ t.error("❌ Error injecting clickable links:", e);
1395
+ }
1396
+ p.insertTitle(l, "statediagramTitleText", o?.titleTopMargin ?? 25, i.db.getDiagramTitle()), _(l, 8, z, o?.useMaxWidth ?? !0);
1397
+ }, "draw"),
1398
+ getDir: G
1399
+ }, K = /* @__PURE__ */ new Map(), q = 0;
1400
+ function J(e = "", t = 0, n = "", r = U) {
1401
+ return `${fe}-${e}${n !== null && n.length > 0 ? `${r}${n}` : ""}-${t}`;
1402
+ }
1403
+ e(J, "stateDomId");
1404
+ var he = /* @__PURE__ */ e((e, n, r, i, a, o, s, l) => {
1405
+ t.trace("items", n), n.forEach((t) => {
1406
+ switch (t.stmt) {
1407
+ case w:
1408
+ Z(e, t, r, i, a, o, s, l);
1409
+ break;
1410
+ case A:
1411
+ Z(e, t, r, i, a, o, s, l);
1412
+ break;
1413
+ case E: {
1414
+ Z(e, t.state1, r, i, a, o, s, l), Z(e, t.state2, r, i, a, o, s, l);
1415
+ let n = s === "neo", u = {
1416
+ id: "edge" + q,
1417
+ start: t.state1.id,
1418
+ end: t.state2.id,
1419
+ arrowhead: "normal",
1420
+ arrowTypeEnd: n ? "arrow_barb_neo" : "arrow_barb",
1421
+ style: M,
1422
+ labelStyle: "",
1423
+ label: c.sanitizeText(t.description ?? "", d()),
1424
+ arrowheadStyle: N,
1425
+ labelpos: P,
1426
+ labelType: ee,
1427
+ thickness: F,
1428
+ classes: B,
1429
+ look: s
1430
+ };
1431
+ a.push(u), q++;
1432
+ }
1433
+ }
1434
+ });
1435
+ }, "setupDoc"), ge = /* @__PURE__ */ e((e, t = S) => {
1436
+ let n = t;
1437
+ if (e.doc) for (let t of e.doc) t.stmt === "dir" && (n = t.value);
1438
+ return n;
1439
+ }, "getDir");
1440
+ function Y(e, t, n) {
1441
+ if (!t.id || t.id === "</join></fork>" || t.id === "</choice>") return;
1442
+ t.cssClasses && (Array.isArray(t.cssCompiledStyles) || (t.cssCompiledStyles = []), t.cssClasses.split(" ").forEach((e) => {
1443
+ let r = n.get(e);
1444
+ r && (t.cssCompiledStyles = [...t.cssCompiledStyles ?? [], ...r.styles]);
1445
+ }));
1446
+ let r = e.find((e) => e.id === t.id);
1447
+ r ? Object.assign(r, t) : e.push(t);
1448
+ }
1449
+ e(Y, "insertOrUpdateNode");
1450
+ function X(e) {
1451
+ return e?.classes?.join(" ") ?? "";
1452
+ }
1453
+ e(X, "getClassesFromDbInfo");
1454
+ function _e(e) {
1455
+ return e?.styles ?? [];
1456
+ }
1457
+ e(_e, "getStylesFromDbInfo");
1458
+ var Z = /* @__PURE__ */ e((e, n, r, i, a, o, s, l) => {
1459
+ let u = n.id, f = r.get(u), p = X(f), m = _e(f), h = d();
1460
+ if (t.info("dataFetcher parsedItem", n, f, m), u !== "root") {
1461
+ let r = I;
1462
+ n.start === !0 ? r = te : n.start === !1 && (r = ne), n.type !== A && (r = n.type), K.get(u) || K.set(u, {
1463
+ id: u,
1464
+ shape: r,
1465
+ description: c.sanitizeText(u, h),
1466
+ cssClasses: `${p} ${oe}`,
1467
+ cssStyles: m
1468
+ });
1469
+ let d = K.get(u);
1470
+ n.description && (Array.isArray(d.description) ? (d.shape = L, d.description.push(n.description)) : d.description?.length && d.description.length > 0 ? (d.shape = L, d.description = d.description === u ? [n.description] : [d.description, n.description]) : (d.shape = I, d.description = n.description), d.description = c.sanitizeTextOrArray(d.description, h)), d.description?.length === 1 && d.shape === L && (d.shape = d.type === "group" ? re : I), !d.type && n.doc && (t.info("Setting cluster for XCX", u, ge(n)), d.type = "group", d.isGroup = !0, d.dir = ge(n), d.explicitDir = n.doc.some((e) => e.stmt === "dir"), d.shape = n.type === j ? R : re, d.cssClasses = `${d.cssClasses} ${ue} ${o ? de : ""}`);
1471
+ let f = {
1472
+ labelStyle: "",
1473
+ shape: d.shape,
1474
+ label: d.description,
1475
+ cssClasses: d.cssClasses,
1476
+ cssCompiledStyles: [],
1477
+ cssStyles: d.cssStyles,
1478
+ id: u,
1479
+ dir: d.dir,
1480
+ domId: J(u, q),
1481
+ type: d.type,
1482
+ isGroup: d.type === "group",
1483
+ padding: 8,
1484
+ rx: 10,
1485
+ ry: 10,
1486
+ look: s,
1487
+ labelType: "markdown"
1488
+ };
1489
+ if (f.shape === R && (f.label = ""), e && e.id !== "root" && (t.trace("Setting node ", u, " to be child of its parent ", e.id), f.parentId = e.id), f.centerLabel = !0, n.note) {
1490
+ let e = {
1491
+ labelStyle: "",
1492
+ shape: ie,
1493
+ label: n.note.text,
1494
+ labelType: "markdown",
1495
+ cssClasses: le,
1496
+ cssStyles: [],
1497
+ cssCompiledStyles: [],
1498
+ id: u + pe + "-" + q,
1499
+ domId: J(u, q, H),
1500
+ type: d.type,
1501
+ isGroup: d.type === "group",
1502
+ padding: h.flowchart?.padding,
1503
+ look: s,
1504
+ position: n.note.position
1505
+ }, t = u + W, r = {
1506
+ labelStyle: "",
1507
+ shape: ae,
1508
+ label: n.note.text,
1509
+ cssClasses: d.cssClasses,
1510
+ cssStyles: [],
1511
+ id: u + W,
1512
+ domId: J(u, q, V),
1513
+ type: "group",
1514
+ isGroup: !0,
1515
+ padding: 16,
1516
+ look: s,
1517
+ position: n.note.position
1518
+ };
1519
+ q++, r.id = t, e.parentId = t, Y(i, r, l), Y(i, e, l), Y(i, f, l);
1520
+ let o = u, c = e.id;
1521
+ n.note.position === "left of" && (o = e.id, c = u), a.push({
1522
+ id: o + "-" + c,
1523
+ start: o,
1524
+ end: c,
1525
+ arrowhead: "none",
1526
+ arrowTypeEnd: "",
1527
+ style: M,
1528
+ labelStyle: "",
1529
+ classes: ce,
1530
+ arrowheadStyle: N,
1531
+ labelpos: P,
1532
+ labelType: ee,
1533
+ thickness: F,
1534
+ look: s
1535
+ });
1536
+ } else Y(i, f, l);
1537
+ }
1538
+ n.doc && (t.trace("Adding nodes children "), he(n, n.doc, r, i, a, !o, s, l));
1539
+ }, "dataFetcher"), ve = /* @__PURE__ */ e(() => {
1540
+ K.clear(), q = 0;
1541
+ }, "reset"), Q = {
1542
+ START_NODE: "[*]",
1543
+ START_TYPE: "start",
1544
+ END_NODE: "[*]",
1545
+ END_TYPE: "end",
1546
+ COLOR_KEYWORD: "color",
1547
+ FILL_KEYWORD: "fill",
1548
+ BG_FILL: "bgFill",
1549
+ STYLECLASS_SEP: ","
1550
+ }, ye = /* @__PURE__ */ e(() => /* @__PURE__ */ new Map(), "newClassesList"), be = /* @__PURE__ */ e(() => ({
1551
+ relations: [],
1552
+ states: /* @__PURE__ */ new Map(),
1553
+ documents: {}
1554
+ }), "newDoc"), $ = /* @__PURE__ */ e((e) => JSON.parse(JSON.stringify(e)), "clone"), xe = class {
1555
+ constructor(e) {
1556
+ this.version = e, this.nodes = [], this.edges = [], this.rootDoc = [], this.classes = ye(), this.documents = { root: be() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.dividerCnt = 0, this.links = /* @__PURE__ */ new Map(), this.funs = [], this.getAccTitle = f, this.setAccTitle = o, this.getAccDescription = l, this.setAccDescription = i, this.setDiagramTitle = a, this.getDiagramTitle = u, this.clear(), this.setRootDoc = this.setRootDoc.bind(this), this.getDividerId = this.getDividerId.bind(this), this.setDirection = this.setDirection.bind(this), this.trimColon = this.trimColon.bind(this), this.bindFunctions = this.bindFunctions.bind(this);
1557
+ }
1558
+ static {
1559
+ e(this, "StateDB");
1560
+ }
1561
+ static {
1562
+ this.relationType = {
1563
+ AGGREGATION: 0,
1564
+ EXTENSION: 1,
1565
+ COMPOSITION: 2,
1566
+ DEPENDENCY: 3
1567
+ };
1568
+ }
1569
+ extract(e) {
1570
+ this.clear(!0);
1571
+ for (let t of Array.isArray(e) ? e : e.doc) switch (t.stmt) {
1572
+ case w:
1573
+ this.addState(t.id.trim(), t.type, t.doc, t.description, t.note);
1574
+ break;
1575
+ case E:
1576
+ this.addRelation(t.state1, t.state2, t.description);
1577
+ break;
1578
+ case D:
1579
+ this.addStyleClass(t.id.trim(), t.classes);
1580
+ break;
1581
+ case O:
1582
+ this.handleStyleDef(t);
1583
+ break;
1584
+ case k:
1585
+ this.setCssClass(t.id.trim(), t.styleClass);
1586
+ break;
1587
+ case "click": this.addLink(t.id, t.url, t.tooltip);
1588
+ }
1589
+ let t = this.getStates(), n = d();
1590
+ ve(), Z(void 0, this.getRootDocV2(), t, this.nodes, this.edges, !0, n.look, this.classes);
1591
+ for (let e of this.nodes) if (Array.isArray(e.label)) {
1592
+ if (e.description = e.label.slice(1), e.isGroup && e.description.length > 0) throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);
1593
+ e.label = e.label[0];
1594
+ }
1595
+ }
1596
+ handleStyleDef(e) {
1597
+ let t = e.id.trim().split(","), n = e.styleClass.split(",");
1598
+ for (let e of t) {
1599
+ let t = this.getState(e);
1600
+ if (!t) {
1601
+ let n = e.trim();
1602
+ this.addState(n), t = this.getState(n);
1603
+ }
1604
+ t && (t.styles = n.map((e) => e.replace(/;/g, "")?.trim()));
1605
+ }
1606
+ }
1607
+ setRootDoc(e) {
1608
+ t.info("Setting root doc", e), this.rootDoc = e, this.version === 1 ? this.extract(e) : this.extract(this.getRootDocV2());
1609
+ }
1610
+ docTranslator(e, t, n) {
1611
+ if (t.stmt === E) {
1612
+ this.docTranslator(e, t.state1, !0), this.docTranslator(e, t.state2, !1);
1613
+ return;
1614
+ }
1615
+ if (t.stmt === w && (t.id === Q.START_NODE ? (t.id = e.id + (n ? "_start" : "_end"), t.start = n) : t.id = t.id.trim()), t.stmt !== T && t.stmt !== w || !t.doc) return;
1616
+ let r = [], i = [];
1617
+ for (let e of t.doc) if (e.type === j) {
1618
+ let t = $(e);
1619
+ t.doc = $(i), r.push(t), i = [];
1620
+ } else i.push(e);
1621
+ if (r.length > 0 && i.length > 0) {
1622
+ let e = {
1623
+ stmt: w,
1624
+ id: m(),
1625
+ type: "divider",
1626
+ doc: $(i)
1627
+ };
1628
+ r.push($(e)), t.doc = r;
1629
+ }
1630
+ t.doc.forEach((e) => this.docTranslator(t, e, !0));
1631
+ }
1632
+ getRootDocV2() {
1633
+ return this.docTranslator({
1634
+ id: T,
1635
+ stmt: T
1636
+ }, {
1637
+ id: T,
1638
+ stmt: T,
1639
+ doc: this.rootDoc
1640
+ }, !0), {
1641
+ id: T,
1642
+ doc: this.rootDoc
1643
+ };
1644
+ }
1645
+ addState(e, n = A, r = void 0, i = void 0, a = void 0, o = void 0, s = void 0, l = void 0) {
1646
+ let u = e?.trim();
1647
+ if (!this.currentDocument.states.has(u)) t.info("Adding state ", u, i), this.currentDocument.states.set(u, {
1648
+ stmt: w,
1649
+ id: u,
1650
+ descriptions: [],
1651
+ type: n,
1652
+ doc: r,
1653
+ note: a,
1654
+ classes: [],
1655
+ styles: [],
1656
+ textStyles: []
1657
+ });
1658
+ else {
1659
+ let e = this.currentDocument.states.get(u);
1660
+ if (!e) throw Error(`State not found: ${u}`);
1661
+ e.doc ||= r, e.type ||= n;
1662
+ }
1663
+ if (i && (t.info("Setting state description", u, i), (Array.isArray(i) ? i : [i]).forEach((e) => this.addDescription(u, e.trim()))), a) {
1664
+ let e = this.currentDocument.states.get(u);
1665
+ if (!e) throw Error(`State not found: ${u}`);
1666
+ e.note = a, e.note.text = c.sanitizeText(e.note.text, d());
1667
+ }
1668
+ o && (t.info("Setting state classes", u, o), (Array.isArray(o) ? o : [o]).forEach((e) => this.setCssClass(u, e.trim()))), s && (t.info("Setting state styles", u, s), (Array.isArray(s) ? s : [s]).forEach((e) => this.setStyle(u, e.trim()))), l && (t.info("Setting state styles", u, s), (Array.isArray(l) ? l : [l]).forEach((e) => this.setTextStyle(u, e.trim())));
1669
+ }
1670
+ clear(e) {
1671
+ this.nodes = [], this.edges = [], this.funs = [this.setupToolTips.bind(this)], this.documents = { root: be() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.classes = ye(), e || (this.links = /* @__PURE__ */ new Map(), s());
1672
+ }
1673
+ getState(e) {
1674
+ return this.currentDocument.states.get(e);
1675
+ }
1676
+ getStates() {
1677
+ return this.currentDocument.states;
1678
+ }
1679
+ logDocuments() {
1680
+ t.info("Documents = ", this.documents);
1681
+ }
1682
+ getRelations() {
1683
+ return this.currentDocument.relations;
1684
+ }
1685
+ addLink(e, n, r) {
1686
+ this.links.set(e, {
1687
+ url: n,
1688
+ tooltip: r
1689
+ }), t.warn("Adding link", e, n, r);
1690
+ }
1691
+ getLinks() {
1692
+ return this.links;
1693
+ }
1694
+ startIdIfNeeded(e = "") {
1695
+ return e === Q.START_NODE ? (this.startEndCount++, `${Q.START_TYPE}${this.startEndCount}`) : e;
1696
+ }
1697
+ startTypeIfNeeded(e = "", t = A) {
1698
+ return e === Q.START_NODE ? Q.START_TYPE : t;
1699
+ }
1700
+ endIdIfNeeded(e = "") {
1701
+ return e === Q.END_NODE ? (this.startEndCount++, `${Q.END_TYPE}${this.startEndCount}`) : e;
1702
+ }
1703
+ endTypeIfNeeded(e = "", t = A) {
1704
+ return e === Q.END_NODE ? Q.END_TYPE : t;
1705
+ }
1706
+ addRelationObjs(e, t, n = "") {
1707
+ let r = this.startIdIfNeeded(e.id.trim()), i = this.startTypeIfNeeded(e.id.trim(), e.type), a = this.startIdIfNeeded(t.id.trim()), o = this.startTypeIfNeeded(t.id.trim(), t.type);
1708
+ this.addState(r, i, e.doc, e.description, e.note, e.classes, e.styles, e.textStyles), this.addState(a, o, t.doc, t.description, t.note, t.classes, t.styles, t.textStyles), this.currentDocument.relations.push({
1709
+ id1: r,
1710
+ id2: a,
1711
+ relationTitle: c.sanitizeText(n, d())
1712
+ });
1713
+ }
1714
+ addRelation(e, t, n) {
1715
+ if (typeof e == "object" && typeof t == "object") this.addRelationObjs(e, t, n);
1716
+ else if (typeof e == "string" && typeof t == "string") {
1717
+ let r = this.startIdIfNeeded(e.trim()), i = this.startTypeIfNeeded(e), a = this.endIdIfNeeded(t.trim()), o = this.endTypeIfNeeded(t);
1718
+ this.addState(r, i), this.addState(a, o), this.currentDocument.relations.push({
1719
+ id1: r,
1720
+ id2: a,
1721
+ relationTitle: n ? c.sanitizeText(n, d()) : void 0
1722
+ });
1723
+ }
1724
+ }
1725
+ addDescription(e, t) {
1726
+ let n = this.currentDocument.states.get(e), r = t.startsWith(":") ? t.replace(":", "").trim() : t;
1727
+ n?.descriptions?.push(c.sanitizeText(r, d()));
1728
+ }
1729
+ cleanupLabel(e) {
1730
+ return e.startsWith(":") ? e.slice(2).trim() : e.trim();
1731
+ }
1732
+ getDividerId() {
1733
+ return this.dividerCnt++, `divider-id-${this.dividerCnt}`;
1734
+ }
1735
+ addStyleClass(e, t = "") {
1736
+ this.classes.has(e) || this.classes.set(e, {
1737
+ id: e,
1738
+ styles: [],
1739
+ textStyles: []
1740
+ });
1741
+ let n = this.classes.get(e);
1742
+ t && n && t.split(Q.STYLECLASS_SEP).forEach((e) => {
1743
+ let t = e.replace(/([^;]*);/, "$1").trim();
1744
+ if (RegExp(Q.COLOR_KEYWORD).exec(e)) {
1745
+ let e = t.replace(Q.FILL_KEYWORD, Q.BG_FILL).replace(Q.COLOR_KEYWORD, Q.FILL_KEYWORD);
1746
+ n.textStyles.push(e);
1747
+ }
1748
+ n.styles.push(t);
1749
+ });
1750
+ }
1751
+ getClasses() {
1752
+ return this.classes;
1753
+ }
1754
+ setupToolTips(e) {
1755
+ let t = h();
1756
+ n(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover", (e) => {
1757
+ let i = n(e.currentTarget), a = i.attr("title");
1758
+ if (a === null) return;
1759
+ let o = e.currentTarget?.getBoundingClientRect();
1760
+ t.transition().duration(200).style("opacity", ".9"), t.style("left", window.scrollX + o.left + (o.right - o.left) / 2 + "px").style("top", window.scrollY + o.bottom + "px"), t.html(r.sanitize(a)), i.classed("hover", !0);
1761
+ }).on("mouseout", (e) => {
1762
+ t.transition().duration(500).style("opacity", 0), n(e.currentTarget).classed("hover", !1);
1763
+ });
1764
+ }
1765
+ setCssClass(e, t) {
1766
+ e.split(",").forEach((e) => {
1767
+ let n = this.getState(e);
1768
+ if (!n) {
1769
+ let t = e.trim();
1770
+ this.addState(t), n = this.getState(t);
1771
+ }
1772
+ n?.classes?.push(t);
1773
+ });
1774
+ }
1775
+ setStyle(e, t) {
1776
+ this.getState(e)?.styles?.push(t);
1777
+ }
1778
+ setTextStyle(e, t) {
1779
+ this.getState(e)?.textStyles?.push(t);
1780
+ }
1781
+ bindFunctions(e) {
1782
+ this.funs.forEach((t) => {
1783
+ t(e);
1784
+ });
1785
+ }
1786
+ getDirectionStatement() {
1787
+ return this.rootDoc.find((e) => e.stmt === C);
1788
+ }
1789
+ getDirection() {
1790
+ return this.getDirectionStatement()?.value ?? x;
1791
+ }
1792
+ setDirection(e) {
1793
+ let t = this.getDirectionStatement();
1794
+ t ? t.value = e : this.rootDoc.unshift({
1795
+ stmt: C,
1796
+ value: e
1797
+ });
1798
+ }
1799
+ trimColon(e) {
1800
+ return e.startsWith(":") ? e.slice(1).trim() : e.trim();
1801
+ }
1802
+ getData() {
1803
+ let e = d();
1804
+ return {
1805
+ nodes: this.nodes,
1806
+ edges: this.edges,
1807
+ other: {},
1808
+ config: e,
1809
+ direction: G(this.getRootDocV2())
1810
+ };
1811
+ }
1812
+ getConfig() {
1813
+ return d().state;
1814
+ }
1815
+ }, Se = /* @__PURE__ */ e((e) => `
1816
+ defs [id$="-barbEnd"] {
1817
+ fill: ${e.transitionColor};
1818
+ stroke: ${e.transitionColor};
1819
+ }
1820
+ g.stateGroup text {
1821
+ fill: ${e.nodeBorder};
1822
+ stroke: none;
1823
+ font-size: 10px;
1824
+ }
1825
+ g.stateGroup text {
1826
+ fill: ${e.textColor};
1827
+ stroke: none;
1828
+ font-size: 10px;
1829
+
1830
+ }
1831
+ g.stateGroup .state-title {
1832
+ font-weight: bolder;
1833
+ fill: ${e.stateLabelColor};
1834
+ }
1835
+
1836
+ g.stateGroup rect {
1837
+ fill: ${e.mainBkg};
1838
+ stroke: ${e.nodeBorder};
1839
+ }
1840
+
1841
+ g.stateGroup line {
1842
+ stroke: ${e.lineColor};
1843
+ stroke-width: ${e.strokeWidth || 1};
1844
+ }
1845
+
1846
+ .transition {
1847
+ stroke: ${e.transitionColor};
1848
+ stroke-width: ${e.strokeWidth || 1};
1849
+ fill: none;
1850
+ }
1851
+
1852
+ .stateGroup .composit {
1853
+ fill: ${e.background};
1854
+ border-bottom: 1px
1855
+ }
1856
+
1857
+ .stateGroup .alt-composit {
1858
+ fill: #e0e0e0;
1859
+ border-bottom: 1px
1860
+ }
1861
+
1862
+ .state-note {
1863
+ stroke: ${e.noteBorderColor};
1864
+ fill: ${e.noteBkgColor};
1865
+
1866
+ text {
1867
+ fill: ${e.noteTextColor};
1868
+ stroke: none;
1869
+ font-size: 10px;
1870
+ }
1871
+ }
1872
+
1873
+ .stateLabel .box {
1874
+ stroke: none;
1875
+ stroke-width: 0;
1876
+ fill: ${e.mainBkg};
1877
+ opacity: 0.5;
1878
+ }
1879
+
1880
+ .edgeLabel .label rect {
1881
+ fill: ${e.labelBackgroundColor};
1882
+ opacity: 0.5;
1883
+ }
1884
+ .edgeLabel {
1885
+ background-color: ${e.edgeLabelBackground};
1886
+ p {
1887
+ background-color: ${e.edgeLabelBackground};
1888
+ }
1889
+ rect {
1890
+ opacity: 0.5;
1891
+ background-color: ${e.edgeLabelBackground};
1892
+ fill: ${e.edgeLabelBackground};
1893
+ }
1894
+ text-align: center;
1895
+ }
1896
+ .edgeLabel .label text {
1897
+ fill: ${e.transitionLabelColor || e.tertiaryTextColor};
1898
+ }
1899
+ .label div .edgeLabel {
1900
+ color: ${e.transitionLabelColor || e.tertiaryTextColor};
1901
+ }
1902
+
1903
+ .stateLabel text {
1904
+ fill: ${e.stateLabelColor};
1905
+ font-size: 10px;
1906
+ font-weight: bold;
1907
+ }
1908
+
1909
+ .node circle.state-start {
1910
+ fill: ${e.specialStateColor};
1911
+ stroke: ${e.specialStateColor};
1912
+ }
1913
+
1914
+ .node .fork-join {
1915
+ fill: ${e.specialStateColor};
1916
+ stroke: ${e.specialStateColor};
1917
+ }
1918
+
1919
+ .node circle.state-end {
1920
+ fill: ${e.innerEndBackground};
1921
+ stroke: ${e.background};
1922
+ stroke-width: 1.5
1923
+ }
1924
+ .end-state-inner {
1925
+ fill: ${e.compositeBackground || e.background};
1926
+ // stroke: ${e.background};
1927
+ stroke-width: 1.5
1928
+ }
1929
+
1930
+ .node rect {
1931
+ fill: ${e.stateBkg || e.mainBkg};
1932
+ stroke: ${e.stateBorder || e.nodeBorder};
1933
+ stroke-width: ${e.strokeWidth || 1}px;
1934
+ }
1935
+ .node polygon {
1936
+ fill: ${e.mainBkg};
1937
+ stroke: ${e.stateBorder || e.nodeBorder};;
1938
+ stroke-width: ${e.strokeWidth || 1}px;
1939
+ }
1940
+ [id$="-barbEnd"] {
1941
+ fill: ${e.lineColor};
1942
+ }
1943
+
1944
+ .statediagram-cluster rect {
1945
+ fill: ${e.compositeTitleBackground};
1946
+ stroke: ${e.stateBorder || e.nodeBorder};
1947
+ stroke-width: ${e.strokeWidth || 1}px;
1948
+ }
1949
+
1950
+ .cluster-label, .nodeLabel {
1951
+ color: ${e.stateLabelColor};
1952
+ // line-height: 1;
1953
+ }
1954
+
1955
+ .statediagram-cluster rect.outer {
1956
+ rx: 5px;
1957
+ ry: 5px;
1958
+ }
1959
+ .statediagram-state .divider {
1960
+ stroke: ${e.stateBorder || e.nodeBorder};
1961
+ }
1962
+
1963
+ .statediagram-state .title-state {
1964
+ rx: 5px;
1965
+ ry: 5px;
1966
+ }
1967
+ .statediagram-cluster.statediagram-cluster .inner {
1968
+ fill: ${e.compositeBackground || e.background};
1969
+ }
1970
+ .statediagram-cluster.statediagram-cluster-alt .inner {
1971
+ fill: ${e.altBackground ? e.altBackground : "#efefef"};
1972
+ }
1973
+
1974
+ .statediagram-cluster .inner {
1975
+ rx:0;
1976
+ ry:0;
1977
+ }
1978
+
1979
+ .statediagram-state rect.basic {
1980
+ rx: 5px;
1981
+ ry: 5px;
1982
+ }
1983
+ .statediagram-state rect.divider {
1984
+ stroke-dasharray: 10,10;
1985
+ fill: ${e.altBackground ? e.altBackground : "#efefef"};
1986
+ }
1987
+
1988
+ .note-edge {
1989
+ stroke-dasharray: 5;
1990
+ }
1991
+
1992
+ .statediagram-note rect {
1993
+ fill: ${e.noteBkgColor};
1994
+ stroke: ${e.noteBorderColor};
1995
+ stroke-width: 1px;
1996
+ rx: 0;
1997
+ ry: 0;
1998
+ }
1999
+ .statediagram-note rect {
2000
+ fill: ${e.noteBkgColor};
2001
+ stroke: ${e.noteBorderColor};
2002
+ stroke-width: 1px;
2003
+ rx: 0;
2004
+ ry: 0;
2005
+ }
2006
+
2007
+ .statediagram-note text {
2008
+ fill: ${e.noteTextColor};
2009
+ }
2010
+
2011
+ .statediagram-note .nodeLabel {
2012
+ color: ${e.noteTextColor};
2013
+ }
2014
+ .statediagram .edgeLabel {
2015
+ color: red; // ${e.noteTextColor};
2016
+ }
2017
+
2018
+ [id$="-dependencyStart"], [id$="-dependencyEnd"] {
2019
+ fill: ${e.lineColor};
2020
+ stroke: ${e.lineColor};
2021
+ stroke-width: ${e.strokeWidth || 1};
2022
+ }
2023
+
2024
+ .statediagramTitleText {
2025
+ text-anchor: middle;
2026
+ font-size: 18px;
2027
+ fill: ${e.textColor};
2028
+ }
2029
+
2030
+ [data-look="neo"].statediagram-cluster rect {
2031
+ fill: ${e.mainBkg};
2032
+ stroke: ${e.useGradient ? "url(" + e.svgId + "-gradient)" : e.stateBorder || e.nodeBorder};
2033
+ stroke-width: ${e.strokeWidth ?? 1};
2034
+ }
2035
+ [data-look="neo"].statediagram-cluster rect.outer {
2036
+ rx: ${e.radius}px;
2037
+ ry: ${e.radius}px;
2038
+ filter: ${e.dropShadow ? e.dropShadow.replace("url(#drop-shadow)", `url(${e.svgId}-drop-shadow)`) : "none"}
2039
+ }
2040
+ `, "getStyles");
2041
+ //#endregion
2042
+ export { Se as i, b as n, me as r, xe as t };