@openbkn/workshop 0.2.2-rc.5 → 0.2.2

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 (158) hide show
  1. package/README.md +83 -13
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +341 -218
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,1435 @@
1
+ import { g as Me } from "./chunk-5VM5RSS4-BdpQuzmO.js";
2
+ import { ay as Ke, az as Le, aA as oe, aB as Ye, aC as We, aD as Ve, aE as Ue, aF as He, aG as Ge, aH as Xe, aI as je, aJ as qe, aK as Je, aL as Ze, aM as Qe, aN as $e, aO as et, aP as tt, aQ as st, aR as rt, aS as it, aT as at, aU as nt, aV as ot, aW as lt, aX as ct, _ as u, O as P, k as G, aY as ut, ak as ht, d as gt, l as y, D as dt, F as pt, G as ft, H as bt, I as St, K as xt, c as me, ao as Lt, ar as mt, aZ as yt, m as wt, a_ as Et, ad as ye, a$ as kt, ae as _t } from "./mermaid.core-yQghUlIz.js";
3
+ import { G as Dt } from "./graph-CKJmgLki.js";
4
+ import { c as Tt } from "./channel-B034hcOF.js";
5
+ function Nt(e) {
6
+ return Array.isArray(e);
7
+ }
8
+ function It(e) {
9
+ if (Ke(e)) return e;
10
+ const a = Le(e);
11
+ if (!Ct(e)) return {};
12
+ if (Nt(e)) {
13
+ const s = Array.from(e);
14
+ return e.length > 0 && typeof e[0] == "string" && oe(e, "index") && (s.index = e.index, s.input = e.input), s;
15
+ }
16
+ if (Ye(e)) {
17
+ const s = e, l = s.constructor;
18
+ return new l(s.buffer, s.byteOffset, s.length);
19
+ }
20
+ if (a === "[object ArrayBuffer]") return new ArrayBuffer(e.byteLength);
21
+ if (a === "[object DataView]") {
22
+ const s = e, l = s.buffer, g = s.byteOffset, t = s.byteLength, h = new ArrayBuffer(t), x = new Uint8Array(l, g, t);
23
+ return new Uint8Array(h).set(x), new DataView(h);
24
+ }
25
+ if (a === "[object Boolean]" || a === "[object Number]" || a === "[object String]") {
26
+ const s = e.constructor, l = new s(e.valueOf());
27
+ return a === "[object String]" ? vt(l, e) : se(l, e), l;
28
+ }
29
+ if (a === "[object Date]") return new Date(Number(e));
30
+ if (a === "[object RegExp]") {
31
+ const s = e, l = new RegExp(s.source, s.flags);
32
+ return l.lastIndex = s.lastIndex, l;
33
+ }
34
+ if (a === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(e));
35
+ if (a === "[object Map]") {
36
+ const s = e, l = /* @__PURE__ */ new Map();
37
+ return s.forEach((g, t) => {
38
+ l.set(t, g);
39
+ }), l;
40
+ }
41
+ if (a === "[object Set]") {
42
+ const s = e, l = /* @__PURE__ */ new Set();
43
+ return s.forEach((g) => {
44
+ l.add(g);
45
+ }), l;
46
+ }
47
+ if (a === "[object Arguments]") {
48
+ const s = e, l = {};
49
+ return se(l, s), l.length = s.length, l[Symbol.iterator] = s[Symbol.iterator], l;
50
+ }
51
+ const o = {};
52
+ return At(o, e), se(o, e), Ot(o, e), o;
53
+ }
54
+ function Ct(e) {
55
+ switch (Le(e)) {
56
+ case ct:
57
+ case lt:
58
+ case ot:
59
+ case nt:
60
+ case at:
61
+ case it:
62
+ case rt:
63
+ case st:
64
+ case tt:
65
+ case et:
66
+ case $e:
67
+ case Qe:
68
+ case Ze:
69
+ case Je:
70
+ case qe:
71
+ case je:
72
+ case Xe:
73
+ case Ge:
74
+ case He:
75
+ case Ue:
76
+ case Ve:
77
+ case We:
78
+ return !0;
79
+ default:
80
+ return !1;
81
+ }
82
+ }
83
+ function se(e, a) {
84
+ for (const o in a) oe(a, o) && (e[o] = a[o]);
85
+ }
86
+ function Ot(e, a) {
87
+ const o = Object.getOwnPropertySymbols(a);
88
+ for (let s = 0; s < o.length; s++) {
89
+ const l = o[s];
90
+ Object.prototype.propertyIsEnumerable.call(a, l) && (e[l] = a[l]);
91
+ }
92
+ }
93
+ function vt(e, a) {
94
+ const o = a.valueOf().length;
95
+ for (const s in a) oe(a, s) && (Number.isNaN(Number(s)) || Number(s) >= o) && (e[s] = a[s]);
96
+ }
97
+ function At(e, a) {
98
+ const o = Object.getPrototypeOf(a);
99
+ o !== null && typeof a.constructor == "function" && Object.setPrototypeOf(e, o);
100
+ }
101
+ var ie = (function() {
102
+ var e = /* @__PURE__ */ u(function(O, d, i, c) {
103
+ for (i = i || {}, c = O.length; c--; i[O[c]] = d) ;
104
+ return i;
105
+ }, "o"), a = [1, 15], o = [1, 7], s = [1, 13], l = [1, 14], g = [1, 19], t = [1, 16], h = [1, 17], x = [1, 18], L = [8, 30], b = [8, 10, 21, 28, 29, 30, 31, 39, 43, 46], f = [1, 23], m = [1, 24], w = [8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46], S = [8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46], _ = [1, 49], k = {
106
+ trace: /* @__PURE__ */ u(function() {
107
+ }, "trace"),
108
+ yy: {},
109
+ symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, NODE_ID: 31, nodeShapeNLabel: 32, dirList: 33, DIR: 34, NODE_DSTART: 35, NODE_DEND: 36, BLOCK_ARROW_START: 37, BLOCK_ARROW_END: 38, classDef: 39, CLASSDEF_ID: 40, CLASSDEF_STYLEOPTS: 41, DEFAULT: 42, class: 43, CLASSENTITY_IDS: 44, STYLECLASS: 45, style: 46, STYLE_ENTITY_IDS: 47, STYLE_DEFINITION_DATA: 48, $accept: 0, $end: 1 },
110
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "NODE_ID", 34: "DIR", 35: "NODE_DSTART", 36: "NODE_DEND", 37: "BLOCK_ARROW_START", 38: "BLOCK_ARROW_END", 39: "classDef", 40: "CLASSDEF_ID", 41: "CLASSDEF_STYLEOPTS", 42: "DEFAULT", 43: "class", 44: "CLASSENTITY_IDS", 45: "STYLECLASS", 46: "style", 47: "STYLE_ENTITY_IDS", 48: "STYLE_DEFINITION_DATA" },
111
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [33, 1], [33, 2], [32, 3], [32, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
112
+ performAction: /* @__PURE__ */ u(function(d, i, c, p, E, r, K) {
113
+ var n = r.length - 1;
114
+ switch (E) {
115
+ case 4:
116
+ p.getLogger().debug("Rule: separator (NL) ");
117
+ break;
118
+ case 5:
119
+ p.getLogger().debug("Rule: separator (Space) ");
120
+ break;
121
+ case 6:
122
+ p.getLogger().debug("Rule: separator (EOF) ");
123
+ break;
124
+ case 7:
125
+ p.getLogger().debug("Rule: hierarchy: ", r[n - 1]), p.setHierarchy(r[n - 1]);
126
+ break;
127
+ case 8:
128
+ p.getLogger().debug("Stop NL ");
129
+ break;
130
+ case 9:
131
+ p.getLogger().debug("Stop EOF ");
132
+ break;
133
+ case 10:
134
+ p.getLogger().debug("Stop NL2 ");
135
+ break;
136
+ case 11:
137
+ p.getLogger().debug("Stop EOF2 ");
138
+ break;
139
+ case 12:
140
+ p.getLogger().debug("Rule: statement: ", r[n]), typeof r[n].length == "number" ? this.$ = r[n] : this.$ = [r[n]];
141
+ break;
142
+ case 13:
143
+ p.getLogger().debug("Rule: statement #2: ", r[n - 1]), this.$ = [r[n - 1]].concat(r[n]);
144
+ break;
145
+ case 14:
146
+ p.getLogger().debug("Rule: link: ", r[n], d), this.$ = { edgeTypeStr: r[n], label: "" };
147
+ break;
148
+ case 15:
149
+ p.getLogger().debug("Rule: LABEL link: ", r[n - 3], r[n - 1], r[n]), this.$ = { edgeTypeStr: r[n], label: r[n - 1] };
150
+ break;
151
+ case 18:
152
+ const F = parseInt(r[n]), W = p.generateId();
153
+ this.$ = { id: W, type: "space", label: "", width: F, children: [] };
154
+ break;
155
+ case 23:
156
+ p.getLogger().debug("Rule: (nodeStatement link node) ", r[n - 2], r[n - 1], r[n], " typestr: ", r[n - 1].edgeTypeStr);
157
+ const J = p.edgeStrToEdgeData(r[n - 1].edgeTypeStr), V = p.edgeStrToEdgeStartData(r[n - 1].edgeTypeStr), Z = p.edgeStrToThickness(r[n - 1].edgeTypeStr), D = p.edgeStrToPattern(r[n - 1].edgeTypeStr);
158
+ this.$ = [
159
+ { id: r[n - 2].id, label: r[n - 2].label, type: r[n - 2].type, directions: r[n - 2].directions },
160
+ { id: r[n - 2].id + "-" + r[n].id, start: r[n - 2].id, end: r[n].id, label: r[n - 1].label, type: "edge", thickness: Z, pattern: D, directions: r[n].directions, arrowTypeEnd: J, arrowTypeStart: V },
161
+ { id: r[n].id, label: r[n].label, type: p.typeStr2Type(r[n].typeStr), directions: r[n].directions }
162
+ ];
163
+ break;
164
+ case 24:
165
+ p.getLogger().debug("Rule: nodeStatement (abc88 node size) ", r[n - 1], r[n]), this.$ = { id: r[n - 1].id, label: r[n - 1].label, type: p.typeStr2Type(r[n - 1].typeStr), directions: r[n - 1].directions, widthInColumns: parseInt(r[n], 10) };
166
+ break;
167
+ case 25:
168
+ p.getLogger().debug("Rule: nodeStatement (node) ", r[n]), this.$ = { id: r[n].id, label: r[n].label, type: p.typeStr2Type(r[n].typeStr), directions: r[n].directions, widthInColumns: 1 };
169
+ break;
170
+ case 26:
171
+ p.getLogger().debug("APA123", this ? this : "na"), p.getLogger().debug("COLUMNS: ", r[n]), this.$ = { type: "column-setting", columns: r[n] === "auto" ? -1 : parseInt(r[n]) };
172
+ break;
173
+ case 27:
174
+ p.getLogger().debug("Rule: id-block statement : ", r[n - 2], r[n - 1]), p.generateId(), this.$ = { ...r[n - 2], type: "composite", children: r[n - 1] };
175
+ break;
176
+ case 28:
177
+ p.getLogger().debug("Rule: blockStatement : ", r[n - 2], r[n - 1], r[n]);
178
+ const z = p.generateId();
179
+ this.$ = { id: z, type: "composite", label: "", children: r[n - 1] };
180
+ break;
181
+ case 29:
182
+ p.getLogger().debug("Rule: node (NODE_ID separator): ", r[n]), this.$ = { id: r[n] };
183
+ break;
184
+ case 30:
185
+ p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", r[n - 1], r[n]), this.$ = { id: r[n - 1], label: r[n].label, typeStr: r[n].typeStr, directions: r[n].directions };
186
+ break;
187
+ case 31:
188
+ p.getLogger().debug("Rule: dirList: ", r[n]), this.$ = [r[n]];
189
+ break;
190
+ case 32:
191
+ p.getLogger().debug("Rule: dirList: ", r[n - 1], r[n]), this.$ = [r[n - 1]].concat(r[n]);
192
+ break;
193
+ case 33:
194
+ p.getLogger().debug("Rule: nodeShapeNLabel: ", r[n - 2], r[n - 1], r[n]), this.$ = { typeStr: r[n - 2] + r[n], label: r[n - 1] };
195
+ break;
196
+ case 34:
197
+ p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", r[n - 3], r[n - 2], " #3:", r[n - 1], r[n]), this.$ = { typeStr: r[n - 3] + r[n], label: r[n - 2], directions: r[n - 1] };
198
+ break;
199
+ case 35:
200
+ case 36:
201
+ this.$ = { type: "classDef", id: r[n - 1].trim(), css: r[n].trim() };
202
+ break;
203
+ case 37:
204
+ this.$ = { type: "applyClass", id: r[n - 1].trim(), styleClass: r[n].trim() };
205
+ break;
206
+ case 38:
207
+ this.$ = { type: "applyStyles", id: r[n - 1].trim(), stylesStr: r[n].trim() };
208
+ break;
209
+ }
210
+ }, "anonymous"),
211
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: a, 11: 3, 13: 4, 19: 5, 20: 6, 21: o, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: l, 31: g, 39: t, 43: h, 46: x }, { 8: [1, 20] }, e(L, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: a, 21: o, 28: s, 29: l, 31: g, 39: t, 43: h, 46: x }), e(b, [2, 16], { 14: 22, 15: f, 16: m }), e(b, [2, 17]), e(b, [2, 18]), e(b, [2, 19]), e(b, [2, 20]), e(b, [2, 21]), e(b, [2, 22]), e(w, [2, 25], { 27: [1, 25] }), e(b, [2, 26]), { 19: 26, 26: 12, 31: g }, { 10: a, 11: 27, 13: 4, 19: 5, 20: 6, 21: o, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: l, 31: g, 39: t, 43: h, 46: x }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(S, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(L, [2, 13]), { 26: 35, 31: g }, { 31: [2, 14] }, { 17: [1, 36] }, e(w, [2, 24]), { 10: a, 11: 37, 13: 4, 14: 22, 15: f, 16: m, 19: 5, 20: 6, 21: o, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: l, 31: g, 39: t, 43: h, 46: x }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(S, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(w, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(b, [2, 28]), e(b, [2, 35]), e(b, [2, 36]), e(b, [2, 37]), e(b, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: _ }, { 15: [1, 50] }, e(b, [2, 27]), e(S, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: _, 38: [2, 31] }, { 31: [2, 15] }, e(S, [2, 34]), { 38: [2, 32] }],
212
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
213
+ parseError: /* @__PURE__ */ u(function(d, i) {
214
+ if (i.recoverable)
215
+ this.trace(d);
216
+ else {
217
+ var c = new Error(d);
218
+ throw c.hash = i, c;
219
+ }
220
+ }, "parseError"),
221
+ parse: /* @__PURE__ */ u(function(d) {
222
+ var i = this, c = [0], p = [], E = [null], r = [], K = this.table, n = "", F = 0, W = 0, J = 2, V = 1, Z = r.slice.call(arguments, 1), D = Object.create(this.lexer), z = { yy: {} };
223
+ for (var Q in this.yy)
224
+ Object.prototype.hasOwnProperty.call(this.yy, Q) && (z.yy[Q] = this.yy[Q]);
225
+ D.setInput(d, z.yy), z.yy.lexer = D, z.yy.parser = this, typeof D.yylloc > "u" && (D.yylloc = {});
226
+ var $ = D.yylloc;
227
+ r.push($);
228
+ var Pe = D.options && D.options.ranges;
229
+ typeof z.yy.parseError == "function" ? this.parseError = z.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
230
+ function Fe(I) {
231
+ c.length = c.length - 2 * I, E.length = E.length - I, r.length = r.length - I;
232
+ }
233
+ u(Fe, "popStack");
234
+ function pe() {
235
+ var I;
236
+ return I = p.pop() || D.lex() || V, typeof I != "number" && (I instanceof Array && (p = I, I = p.pop()), I = i.symbols_[I] || I), I;
237
+ }
238
+ u(pe, "lex");
239
+ for (var N, R, v, ee, M = {}, U, B, fe, H; ; ) {
240
+ if (R = c[c.length - 1], this.defaultActions[R] ? v = this.defaultActions[R] : ((N === null || typeof N > "u") && (N = pe()), v = K[R] && K[R][N]), typeof v > "u" || !v.length || !v[0]) {
241
+ var te = "";
242
+ H = [];
243
+ for (U in K[R])
244
+ this.terminals_[U] && U > J && H.push("'" + this.terminals_[U] + "'");
245
+ D.showPosition ? te = "Parse error on line " + (F + 1) + `:
246
+ ` + D.showPosition() + `
247
+ Expecting ` + H.join(", ") + ", got '" + (this.terminals_[N] || N) + "'" : te = "Parse error on line " + (F + 1) + ": Unexpected " + (N == V ? "end of input" : "'" + (this.terminals_[N] || N) + "'"), this.parseError(te, {
248
+ text: D.match,
249
+ token: this.terminals_[N] || N,
250
+ line: D.yylineno,
251
+ loc: $,
252
+ expected: H
253
+ });
254
+ }
255
+ if (v[0] instanceof Array && v.length > 1)
256
+ throw new Error("Parse Error: multiple actions possible at state: " + R + ", token: " + N);
257
+ switch (v[0]) {
258
+ case 1:
259
+ c.push(N), E.push(D.yytext), r.push(D.yylloc), c.push(v[1]), N = null, W = D.yyleng, n = D.yytext, F = D.yylineno, $ = D.yylloc;
260
+ break;
261
+ case 2:
262
+ if (B = this.productions_[v[1]][1], M.$ = E[E.length - B], M._$ = {
263
+ first_line: r[r.length - (B || 1)].first_line,
264
+ last_line: r[r.length - 1].last_line,
265
+ first_column: r[r.length - (B || 1)].first_column,
266
+ last_column: r[r.length - 1].last_column
267
+ }, Pe && (M._$.range = [
268
+ r[r.length - (B || 1)].range[0],
269
+ r[r.length - 1].range[1]
270
+ ]), ee = this.performAction.apply(M, [
271
+ n,
272
+ W,
273
+ F,
274
+ z.yy,
275
+ v[1],
276
+ E,
277
+ r
278
+ ].concat(Z)), typeof ee < "u")
279
+ return ee;
280
+ B && (c = c.slice(0, -1 * B * 2), E = E.slice(0, -1 * B), r = r.slice(0, -1 * B)), c.push(this.productions_[v[1]][0]), E.push(M.$), r.push(M._$), fe = K[c[c.length - 2]][c[c.length - 1]], c.push(fe);
281
+ break;
282
+ case 3:
283
+ return !0;
284
+ }
285
+ }
286
+ return !0;
287
+ }, "parse")
288
+ }, T = /* @__PURE__ */ (function() {
289
+ var O = {
290
+ EOF: 1,
291
+ parseError: /* @__PURE__ */ u(function(i, c) {
292
+ if (this.yy.parser)
293
+ this.yy.parser.parseError(i, c);
294
+ else
295
+ throw new Error(i);
296
+ }, "parseError"),
297
+ // resets the lexer, sets new input
298
+ setInput: /* @__PURE__ */ u(function(d, i) {
299
+ return this.yy = i || this.yy || {}, this._input = d, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
300
+ first_line: 1,
301
+ first_column: 0,
302
+ last_line: 1,
303
+ last_column: 0
304
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
305
+ }, "setInput"),
306
+ // consumes and returns one char from the input
307
+ input: /* @__PURE__ */ u(function() {
308
+ var d = this._input[0];
309
+ this.yytext += d, this.yyleng++, this.offset++, this.match += d, this.matched += d;
310
+ var i = d.match(/(?:\r\n?|\n).*/g);
311
+ return i ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), d;
312
+ }, "input"),
313
+ // unshifts one char (or a string) into the input
314
+ unput: /* @__PURE__ */ u(function(d) {
315
+ var i = d.length, c = d.split(/(?:\r\n?|\n)/g);
316
+ this._input = d + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
317
+ var p = this.match.split(/(?:\r\n?|\n)/g);
318
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
319
+ var E = this.yylloc.range;
320
+ return this.yylloc = {
321
+ first_line: this.yylloc.first_line,
322
+ last_line: this.yylineno + 1,
323
+ first_column: this.yylloc.first_column,
324
+ last_column: c ? (c.length === p.length ? this.yylloc.first_column : 0) + p[p.length - c.length].length - c[0].length : this.yylloc.first_column - i
325
+ }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
326
+ }, "unput"),
327
+ // When called from action, caches matched text and appends it on next action
328
+ more: /* @__PURE__ */ u(function() {
329
+ return this._more = !0, this;
330
+ }, "more"),
331
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
332
+ reject: /* @__PURE__ */ u(function() {
333
+ if (this.options.backtrack_lexer)
334
+ this._backtrack = !0;
335
+ else
336
+ 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).
337
+ ` + this.showPosition(), {
338
+ text: "",
339
+ token: null,
340
+ line: this.yylineno
341
+ });
342
+ return this;
343
+ }, "reject"),
344
+ // retain first n characters of the match
345
+ less: /* @__PURE__ */ u(function(d) {
346
+ this.unput(this.match.slice(d));
347
+ }, "less"),
348
+ // displays already matched input, i.e. for error messages
349
+ pastInput: /* @__PURE__ */ u(function() {
350
+ var d = this.matched.substr(0, this.matched.length - this.match.length);
351
+ return (d.length > 20 ? "..." : "") + d.substr(-20).replace(/\n/g, "");
352
+ }, "pastInput"),
353
+ // displays upcoming input, i.e. for error messages
354
+ upcomingInput: /* @__PURE__ */ u(function() {
355
+ var d = this.match;
356
+ return d.length < 20 && (d += this._input.substr(0, 20 - d.length)), (d.substr(0, 20) + (d.length > 20 ? "..." : "")).replace(/\n/g, "");
357
+ }, "upcomingInput"),
358
+ // displays the character position where the lexing error occurred, i.e. for error messages
359
+ showPosition: /* @__PURE__ */ u(function() {
360
+ var d = this.pastInput(), i = new Array(d.length + 1).join("-");
361
+ return d + this.upcomingInput() + `
362
+ ` + i + "^";
363
+ }, "showPosition"),
364
+ // test the lexed token: return FALSE when not a match, otherwise return token
365
+ test_match: /* @__PURE__ */ u(function(d, i) {
366
+ var c, p, E;
367
+ if (this.options.backtrack_lexer && (E = {
368
+ yylineno: this.yylineno,
369
+ yylloc: {
370
+ first_line: this.yylloc.first_line,
371
+ last_line: this.last_line,
372
+ first_column: this.yylloc.first_column,
373
+ last_column: this.yylloc.last_column
374
+ },
375
+ yytext: this.yytext,
376
+ match: this.match,
377
+ matches: this.matches,
378
+ matched: this.matched,
379
+ yyleng: this.yyleng,
380
+ offset: this.offset,
381
+ _more: this._more,
382
+ _input: this._input,
383
+ yy: this.yy,
384
+ conditionStack: this.conditionStack.slice(0),
385
+ done: this.done
386
+ }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), p = d[0].match(/(?:\r\n?|\n).*/g), p && (this.yylineno += p.length), this.yylloc = {
387
+ first_line: this.yylloc.last_line,
388
+ last_line: this.yylineno + 1,
389
+ first_column: this.yylloc.last_column,
390
+ last_column: p ? p[p.length - 1].length - p[p.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + d[0].length
391
+ }, this.yytext += d[0], this.match += d[0], this.matches = d, 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(d[0].length), this.matched += d[0], c = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
392
+ return c;
393
+ if (this._backtrack) {
394
+ for (var r in E)
395
+ this[r] = E[r];
396
+ return !1;
397
+ }
398
+ return !1;
399
+ }, "test_match"),
400
+ // return next match in input
401
+ next: /* @__PURE__ */ u(function() {
402
+ if (this.done)
403
+ return this.EOF;
404
+ this._input || (this.done = !0);
405
+ var d, i, c, p;
406
+ this._more || (this.yytext = "", this.match = "");
407
+ for (var E = this._currentRules(), r = 0; r < E.length; r++)
408
+ if (c = this._input.match(this.rules[E[r]]), c && (!i || c[0].length > i[0].length)) {
409
+ if (i = c, p = r, this.options.backtrack_lexer) {
410
+ if (d = this.test_match(c, E[r]), d !== !1)
411
+ return d;
412
+ if (this._backtrack) {
413
+ i = !1;
414
+ continue;
415
+ } else
416
+ return !1;
417
+ } else if (!this.options.flex)
418
+ break;
419
+ }
420
+ return i ? (d = this.test_match(i, E[p]), d !== !1 ? d : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
421
+ ` + this.showPosition(), {
422
+ text: "",
423
+ token: null,
424
+ line: this.yylineno
425
+ });
426
+ }, "next"),
427
+ // return next match that has a token
428
+ lex: /* @__PURE__ */ u(function() {
429
+ var i = this.next();
430
+ return i || this.lex();
431
+ }, "lex"),
432
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
433
+ begin: /* @__PURE__ */ u(function(i) {
434
+ this.conditionStack.push(i);
435
+ }, "begin"),
436
+ // pop the previously active lexer condition state off the condition stack
437
+ popState: /* @__PURE__ */ u(function() {
438
+ var i = this.conditionStack.length - 1;
439
+ return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
440
+ }, "popState"),
441
+ // produce the lexer rule set which is active for the currently active lexer condition state
442
+ _currentRules: /* @__PURE__ */ u(function() {
443
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
444
+ }, "_currentRules"),
445
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
446
+ topState: /* @__PURE__ */ u(function(i) {
447
+ return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
448
+ }, "topState"),
449
+ // alias for begin(condition)
450
+ pushState: /* @__PURE__ */ u(function(i) {
451
+ this.begin(i);
452
+ }, "pushState"),
453
+ // return the number of states currently on the stack
454
+ stateStackSize: /* @__PURE__ */ u(function() {
455
+ return this.conditionStack.length;
456
+ }, "stateStackSize"),
457
+ options: {},
458
+ performAction: /* @__PURE__ */ u(function(i, c, p, E) {
459
+ switch (p) {
460
+ case 0:
461
+ return i.getLogger().debug("Found block-beta"), 10;
462
+ case 1:
463
+ return i.getLogger().debug("Found id-block"), 29;
464
+ case 2:
465
+ return i.getLogger().debug("Found block"), 10;
466
+ case 3:
467
+ i.getLogger().debug(".", c.yytext);
468
+ break;
469
+ case 4:
470
+ i.getLogger().debug("_", c.yytext);
471
+ break;
472
+ case 5:
473
+ return 5;
474
+ case 6:
475
+ return c.yytext = -1, 28;
476
+ case 7:
477
+ return c.yytext = c.yytext.replace(/columns\s+/, ""), i.getLogger().debug("COLUMNS (LEX)", c.yytext), 28;
478
+ case 8:
479
+ this.pushState("md_string");
480
+ break;
481
+ case 9:
482
+ return "MD_STR";
483
+ case 10:
484
+ this.popState();
485
+ break;
486
+ case 11:
487
+ this.pushState("string");
488
+ break;
489
+ case 12:
490
+ i.getLogger().debug("LEX: POPPING STR:", c.yytext), this.popState();
491
+ break;
492
+ case 13:
493
+ return i.getLogger().debug("LEX: STR end:", c.yytext), "STR";
494
+ case 14:
495
+ return c.yytext = c.yytext.replace(/space\:/, ""), i.getLogger().debug("SPACE NUM (LEX)", c.yytext), 21;
496
+ case 15:
497
+ return c.yytext = "1", i.getLogger().debug("COLUMNS (LEX)", c.yytext), 21;
498
+ case 16:
499
+ return 42;
500
+ case 17:
501
+ return "LINKSTYLE";
502
+ case 18:
503
+ return "INTERPOLATE";
504
+ case 19:
505
+ return this.pushState("CLASSDEF"), 39;
506
+ case 20:
507
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
508
+ case 21:
509
+ return this.popState(), this.pushState("CLASSDEFID"), 40;
510
+ case 22:
511
+ return this.popState(), 41;
512
+ case 23:
513
+ return this.pushState("CLASS"), 43;
514
+ case 24:
515
+ return this.popState(), this.pushState("CLASS_STYLE"), 44;
516
+ case 25:
517
+ return this.popState(), 45;
518
+ case 26:
519
+ return this.pushState("STYLE_STMNT"), 46;
520
+ case 27:
521
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
522
+ case 28:
523
+ return this.popState(), 48;
524
+ case 29:
525
+ return this.pushState("acc_title"), "acc_title";
526
+ case 30:
527
+ return this.popState(), "acc_title_value";
528
+ case 31:
529
+ return this.pushState("acc_descr"), "acc_descr";
530
+ case 32:
531
+ return this.popState(), "acc_descr_value";
532
+ case 33:
533
+ this.pushState("acc_descr_multiline");
534
+ break;
535
+ case 34:
536
+ this.popState();
537
+ break;
538
+ case 35:
539
+ return "acc_descr_multiline_value";
540
+ case 36:
541
+ return 30;
542
+ case 37:
543
+ return this.popState(), i.getLogger().debug("Lex: (("), "NODE_DEND";
544
+ case 38:
545
+ return this.popState(), i.getLogger().debug("Lex: (("), "NODE_DEND";
546
+ case 39:
547
+ return this.popState(), i.getLogger().debug("Lex: ))"), "NODE_DEND";
548
+ case 40:
549
+ return this.popState(), i.getLogger().debug("Lex: (("), "NODE_DEND";
550
+ case 41:
551
+ return this.popState(), i.getLogger().debug("Lex: (("), "NODE_DEND";
552
+ case 42:
553
+ return this.popState(), i.getLogger().debug("Lex: (-"), "NODE_DEND";
554
+ case 43:
555
+ return this.popState(), i.getLogger().debug("Lex: -)"), "NODE_DEND";
556
+ case 44:
557
+ return this.popState(), i.getLogger().debug("Lex: (("), "NODE_DEND";
558
+ case 45:
559
+ return this.popState(), i.getLogger().debug("Lex: ]]"), "NODE_DEND";
560
+ case 46:
561
+ return this.popState(), i.getLogger().debug("Lex: ("), "NODE_DEND";
562
+ case 47:
563
+ return this.popState(), i.getLogger().debug("Lex: ])"), "NODE_DEND";
564
+ case 48:
565
+ return this.popState(), i.getLogger().debug("Lex: /]"), "NODE_DEND";
566
+ case 49:
567
+ return this.popState(), i.getLogger().debug("Lex: /]"), "NODE_DEND";
568
+ case 50:
569
+ return this.popState(), i.getLogger().debug("Lex: )]"), "NODE_DEND";
570
+ case 51:
571
+ return this.popState(), i.getLogger().debug("Lex: )"), "NODE_DEND";
572
+ case 52:
573
+ return this.popState(), i.getLogger().debug("Lex: ]>"), "NODE_DEND";
574
+ case 53:
575
+ return this.popState(), i.getLogger().debug("Lex: ]"), "NODE_DEND";
576
+ case 54:
577
+ return i.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
578
+ case 55:
579
+ return i.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
580
+ case 56:
581
+ return i.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
582
+ case 57:
583
+ return i.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
584
+ case 58:
585
+ return i.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
586
+ case 59:
587
+ return i.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
588
+ case 60:
589
+ return i.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
590
+ case 61:
591
+ return i.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
592
+ case 62:
593
+ return i.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
594
+ case 63:
595
+ return i.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
596
+ case 64:
597
+ return i.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
598
+ case 65:
599
+ return this.pushState("NODE"), 35;
600
+ case 66:
601
+ return this.pushState("NODE"), 35;
602
+ case 67:
603
+ return this.pushState("NODE"), 35;
604
+ case 68:
605
+ return this.pushState("NODE"), 35;
606
+ case 69:
607
+ return this.pushState("NODE"), 35;
608
+ case 70:
609
+ return this.pushState("NODE"), 35;
610
+ case 71:
611
+ return this.pushState("NODE"), 35;
612
+ case 72:
613
+ return i.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
614
+ case 73:
615
+ return this.pushState("BLOCK_ARROW"), i.getLogger().debug("LEX ARR START"), 37;
616
+ case 74:
617
+ return i.getLogger().debug("Lex: NODE_ID", c.yytext), 31;
618
+ case 75:
619
+ return i.getLogger().debug("Lex: EOF", c.yytext), 8;
620
+ case 76:
621
+ this.pushState("md_string");
622
+ break;
623
+ case 77:
624
+ this.pushState("md_string");
625
+ break;
626
+ case 78:
627
+ return "NODE_DESCR";
628
+ case 79:
629
+ this.popState();
630
+ break;
631
+ case 80:
632
+ i.getLogger().debug("Lex: Starting string"), this.pushState("string");
633
+ break;
634
+ case 81:
635
+ i.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
636
+ break;
637
+ case 82:
638
+ return i.getLogger().debug("LEX: NODE_DESCR:", c.yytext), "NODE_DESCR";
639
+ case 83:
640
+ i.getLogger().debug("LEX POPPING"), this.popState();
641
+ break;
642
+ case 84:
643
+ i.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
644
+ break;
645
+ case 85:
646
+ return c.yytext = c.yytext.replace(/^,\s*/, ""), i.getLogger().debug("Lex (right): dir:", c.yytext), "DIR";
647
+ case 86:
648
+ return c.yytext = c.yytext.replace(/^,\s*/, ""), i.getLogger().debug("Lex (left):", c.yytext), "DIR";
649
+ case 87:
650
+ return c.yytext = c.yytext.replace(/^,\s*/, ""), i.getLogger().debug("Lex (x):", c.yytext), "DIR";
651
+ case 88:
652
+ return c.yytext = c.yytext.replace(/^,\s*/, ""), i.getLogger().debug("Lex (y):", c.yytext), "DIR";
653
+ case 89:
654
+ return c.yytext = c.yytext.replace(/^,\s*/, ""), i.getLogger().debug("Lex (up):", c.yytext), "DIR";
655
+ case 90:
656
+ return c.yytext = c.yytext.replace(/^,\s*/, ""), i.getLogger().debug("Lex (down):", c.yytext), "DIR";
657
+ case 91:
658
+ return c.yytext = "]>", i.getLogger().debug("Lex (ARROW_DIR end):", c.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
659
+ case 92:
660
+ return i.getLogger().debug("Lex: LINK", "#" + c.yytext + "#"), 15;
661
+ case 93:
662
+ return i.getLogger().debug("Lex: LINK", c.yytext), 15;
663
+ case 94:
664
+ return i.getLogger().debug("Lex: LINK", c.yytext), 15;
665
+ case 95:
666
+ return i.getLogger().debug("Lex: LINK", c.yytext), 15;
667
+ case 96:
668
+ return i.getLogger().debug("Lex: START_LINK", c.yytext), this.pushState("LLABEL"), 16;
669
+ case 97:
670
+ return i.getLogger().debug("Lex: START_LINK", c.yytext), this.pushState("LLABEL"), 16;
671
+ case 98:
672
+ return i.getLogger().debug("Lex: START_LINK", c.yytext), this.pushState("LLABEL"), 16;
673
+ case 99:
674
+ this.pushState("md_string");
675
+ break;
676
+ case 100:
677
+ return i.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
678
+ case 101:
679
+ return this.popState(), i.getLogger().debug("Lex: LINK", "#" + c.yytext + "#"), 15;
680
+ case 102:
681
+ return this.popState(), i.getLogger().debug("Lex: LINK", c.yytext), 15;
682
+ case 103:
683
+ return this.popState(), i.getLogger().debug("Lex: LINK", c.yytext), 15;
684
+ case 104:
685
+ return i.getLogger().debug("Lex: COLON", c.yytext), c.yytext = c.yytext.slice(1), 27;
686
+ }
687
+ }, "anonymous"),
688
+ rules: [/^(?:block-beta\b)/, /^(?:block:)/, /^(?:block\b)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
689
+ conditions: { STYLE_DEFINITION: { rules: [28], inclusive: !1 }, STYLE_STMNT: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [22], inclusive: !1 }, CLASSDEF: { rules: [20, 21], inclusive: !1 }, CLASS_STYLE: { rules: [25], inclusive: !1 }, CLASS: { rules: [24], inclusive: !1 }, LLABEL: { rules: [99, 100, 101, 102, 103], inclusive: !1 }, ARROW_DIR: { rules: [85, 86, 87, 88, 89, 90, 91], inclusive: !1 }, BLOCK_ARROW: { rules: [76, 81, 84], inclusive: !1 }, NODE: { rules: [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 77, 80], inclusive: !1 }, md_string: { rules: [9, 10, 78, 79], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [12, 13, 82, 83], inclusive: !1 }, acc_descr_multiline: { rules: [34, 35], inclusive: !1 }, acc_descr: { rules: [32], inclusive: !1 }, acc_title: { rules: [30], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 23, 26, 29, 31, 33, 36, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 92, 93, 94, 95, 96, 97, 98, 104], inclusive: !0 } }
690
+ };
691
+ return O;
692
+ })();
693
+ k.lexer = T;
694
+ function C() {
695
+ this.yy = {};
696
+ }
697
+ return u(C, "Parser"), C.prototype = k, k.Parser = C, new C();
698
+ })();
699
+ ie.parser = ie;
700
+ var zt = ie, A = /* @__PURE__ */ new Map(), le = [], ae = /* @__PURE__ */ new Map(), be = "color", Se = "fill", Bt = "bgFill", we = ",", X = /* @__PURE__ */ new Map(), ce = "", Rt = /* @__PURE__ */ u((e) => wt.sanitizeText(e, me()), "sanitizeText"), Pt = /* @__PURE__ */ u(function(e, a = "") {
701
+ let o = X.get(e);
702
+ o || (o = { id: e, styles: [], textStyles: [] }, X.set(e, o)), a?.split(we).forEach((s) => {
703
+ const l = s.replace(/([^;]*);/, "$1").trim();
704
+ if (RegExp(be).exec(s)) {
705
+ const t = l.replace(Se, Bt).replace(be, Se);
706
+ o.textStyles.push(t);
707
+ }
708
+ o.styles.push(l);
709
+ });
710
+ }, "addStyleClass"), Ft = /* @__PURE__ */ u(function(e, a = "") {
711
+ const o = A.get(e);
712
+ a != null && (o.styles = a.split(we));
713
+ }, "addStyle2Node"), Mt = /* @__PURE__ */ u(function(e, a) {
714
+ e.split(",").forEach(function(o) {
715
+ let s = A.get(o);
716
+ if (s === void 0) {
717
+ const l = o.trim();
718
+ s = { id: l, type: "na", children: [] }, A.set(l, s);
719
+ }
720
+ s.classes || (s.classes = []), s.classes.push(a);
721
+ });
722
+ }, "setCssClass"), Ee = 0, ke = /* @__PURE__ */ u((e, a) => {
723
+ const o = e.flat(), s = [], g = o.find((t) => t?.type === "column-setting")?.columns ?? -1;
724
+ for (const t of o) {
725
+ if (typeof g == "number" && g > 0 && t.type !== "column-setting" && typeof t.widthInColumns == "number" && t.widthInColumns > g && y.warn(
726
+ `Block ${t.id} width ${t.widthInColumns} exceeds configured column width ${g}`
727
+ ), t.label && (t.label = Rt(t.label)), t.type === "classDef") {
728
+ Pt(t.id, t.css);
729
+ continue;
730
+ }
731
+ if (t.type === "applyClass") {
732
+ Mt(t.id, t?.styleClass ?? "");
733
+ continue;
734
+ }
735
+ if (t.type === "applyStyles") {
736
+ t?.stylesStr && Ft(t.id, t?.stylesStr);
737
+ continue;
738
+ }
739
+ if (t.type === "column-setting")
740
+ a.columns = t.columns ?? -1;
741
+ else if (t.type === "edge") {
742
+ const h = (ae.get(t.id) ?? 0) + 1;
743
+ ae.set(t.id, h), t.id = h + "-" + t.id, le.push(t);
744
+ } else {
745
+ t.label || (t.type === "composite" ? t.label = "" : t.label = t.id);
746
+ const h = A.get(t.id);
747
+ if (h === void 0 ? (t.type === "composite" && (t.colorIndex = Ee++), A.set(t.id, t)) : (t.type !== "na" && (h.type = t.type), t.label !== t.id && (h.label = t.label)), t.children && ke(t.children, t), t.type === "space") {
748
+ const x = t.width ?? 1;
749
+ for (let L = 0; L < x; L++) {
750
+ const b = It(t);
751
+ b.id = b.id + "-" + L, A.set(b.id, b), s.push(b);
752
+ }
753
+ } else h === void 0 && s.push(t);
754
+ }
755
+ }
756
+ a.children = s;
757
+ }, "populateBlockDatabase"), ue = [], Y = { id: "root", type: "composite", children: [], columns: -1 }, Kt = /* @__PURE__ */ u(() => {
758
+ y.debug("Clear called"), dt(), Y = { id: "root", type: "composite", children: [], columns: -1 }, A = /* @__PURE__ */ new Map([["root", Y]]), ue = [], X = /* @__PURE__ */ new Map(), le = [], ae = /* @__PURE__ */ new Map(), ce = "", Ee = 0;
759
+ }, "clear");
760
+ function _e(e) {
761
+ switch (y.debug("typeStr2Type", e), e) {
762
+ case "[]":
763
+ return "square";
764
+ case "()":
765
+ return y.debug("we have a round"), "round";
766
+ case "(())":
767
+ return "circle";
768
+ case ">]":
769
+ return "rect_left_inv_arrow";
770
+ case "{}":
771
+ return "diamond";
772
+ case "{{}}":
773
+ return "hexagon";
774
+ case "([])":
775
+ return "stadium";
776
+ case "[[]]":
777
+ return "subroutine";
778
+ case "[()]":
779
+ return "cylinder";
780
+ case "((()))":
781
+ return "doublecircle";
782
+ case "[//]":
783
+ return "lean_right";
784
+ case "[\\\\]":
785
+ return "lean_left";
786
+ case "[/\\]":
787
+ return "trapezoid";
788
+ case "[\\/]":
789
+ return "inv_trapezoid";
790
+ case "<[]>":
791
+ return "block_arrow";
792
+ default:
793
+ return "na";
794
+ }
795
+ }
796
+ u(_e, "typeStr2Type");
797
+ function De(e) {
798
+ return y.debug("typeStr2Type", e), e === "==" ? "thick" : "normal";
799
+ }
800
+ u(De, "edgeTypeStr2Type");
801
+ function Te(e) {
802
+ switch (e.trim().slice(-1)) {
803
+ case "x":
804
+ return "arrow_cross";
805
+ case "o":
806
+ return "arrow_circle";
807
+ case ">":
808
+ return "arrow_point";
809
+ default:
810
+ return "";
811
+ }
812
+ }
813
+ u(Te, "edgeStrToEdgeData");
814
+ function Ne(e) {
815
+ switch (e.trim().charAt(0)) {
816
+ case "x":
817
+ return "arrow_cross";
818
+ case "o":
819
+ return "arrow_circle";
820
+ case "<":
821
+ return "arrow_point";
822
+ default:
823
+ return "arrow_open";
824
+ }
825
+ }
826
+ u(Ne, "edgeStrToEdgeStartData");
827
+ function Ie(e) {
828
+ return e.includes("==") ? "thick" : "normal";
829
+ }
830
+ u(Ie, "edgeStrToThickness");
831
+ function Ce(e) {
832
+ return e.includes(".-") ? "dotted" : "solid";
833
+ }
834
+ u(Ce, "edgeStrToPattern");
835
+ var xe = 0, Yt = /* @__PURE__ */ u(() => (xe++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + xe), "generateId"), Wt = /* @__PURE__ */ u((e) => {
836
+ Y.children = e, ke(e, Y), ue = Y.children;
837
+ }, "setHierarchy"), Vt = /* @__PURE__ */ u((e) => {
838
+ const a = A.get(e);
839
+ return a ? a.columns ? a.columns : a.children ? a.children.length : -1 : -1;
840
+ }, "getColumns"), Ut = /* @__PURE__ */ u(() => [...A.values()], "getBlocksFlat"), Ht = /* @__PURE__ */ u(() => ue || [], "getBlocks"), Gt = /* @__PURE__ */ u(() => le, "getEdges"), Xt = /* @__PURE__ */ u((e) => A.get(e), "getBlock"), jt = /* @__PURE__ */ u((e) => {
841
+ A.set(e.id, e);
842
+ }, "setBlock"), qt = /* @__PURE__ */ u((e) => {
843
+ ce = e;
844
+ }, "setDiagramId"), Jt = /* @__PURE__ */ u(() => ce, "getDiagramId"), Zt = /* @__PURE__ */ u(() => y, "getLogger"), Qt = /* @__PURE__ */ u(function() {
845
+ return X;
846
+ }, "getClasses"), $t = {
847
+ getConfig: /* @__PURE__ */ u(() => P().block, "getConfig"),
848
+ typeStr2Type: _e,
849
+ edgeTypeStr2Type: De,
850
+ edgeStrToEdgeData: Te,
851
+ edgeStrToEdgeStartData: Ne,
852
+ edgeStrToThickness: Ie,
853
+ edgeStrToPattern: Ce,
854
+ getLogger: Zt,
855
+ getBlocksFlat: Ut,
856
+ getBlocks: Ht,
857
+ getEdges: Gt,
858
+ setHierarchy: Wt,
859
+ getBlock: Xt,
860
+ setBlock: jt,
861
+ getColumns: Vt,
862
+ getClasses: Qt,
863
+ clear: Kt,
864
+ generateId: Yt,
865
+ setDiagramId: qt,
866
+ getDiagramId: Jt
867
+ }, es = $t, ts = /* @__PURE__ */ u((e) => {
868
+ const { theme: a, bkgColorArray: o, borderColorArray: s } = e;
869
+ if (!pt(a, s))
870
+ return "";
871
+ const l = ft(e.look), g = bt(o);
872
+ let t = "";
873
+ for (let h = 0; h < St(e.THEME_COLOR_LIMIT, s); h++) {
874
+ const x = s[h % s.length], L = g ? `fill: ${o[h % o.length]};` : "", b = `[data-look="${l}"][data-color-id="color-${h}"]`;
875
+ t += `
876
+
877
+ ${b}.node rect.composite {
878
+ stroke: ${x};
879
+ ${L}
880
+ }
881
+ `;
882
+ }
883
+ return t;
884
+ }, "genColor"), re = /* @__PURE__ */ u((e, a) => {
885
+ const o = Tt, s = o(e, "r"), l = o(e, "g"), g = o(e, "b");
886
+ return xt(s, l, g, a);
887
+ }, "fade"), ss = /* @__PURE__ */ u((e) => `${ts(e)}
888
+ .label {
889
+ font-family: ${e.fontFamily};
890
+ color: ${e.nodeTextColor || e.textColor};
891
+ }
892
+ .cluster-label text {
893
+ fill: ${e.titleColor};
894
+ }
895
+ .cluster-label span {
896
+ color: ${e.titleColor};
897
+ }
898
+
899
+
900
+
901
+ .label text,span {
902
+ fill: ${e.nodeTextColor || e.textColor};
903
+ color: ${e.nodeTextColor || e.textColor};
904
+ }
905
+
906
+ .node rect,
907
+ .node circle,
908
+ .node ellipse,
909
+ .node polygon,
910
+ .node path {
911
+ fill: ${e.mainBkg};
912
+ stroke: ${e.nodeBorder};
913
+ /* From the theme, as every other diagram does. Pinned at 1px here, so block drew a
914
+ thinner border than an identical flowchart node under any theme asking for more --
915
+ the neo theme asks for 2. Nothing downstream corrected it: the neo rules set stroke
916
+ and filter, never stroke-width. */
917
+ stroke-width: ${e.strokeWidth ?? 1}px;
918
+ }
919
+ .flowchart-label text {
920
+ text-anchor: middle;
921
+ }
922
+ // .flowchart-label .text-outer-tspan {
923
+ // text-anchor: middle;
924
+ // }
925
+ // .flowchart-label .text-inner-tspan {
926
+ // text-anchor: start;
927
+ // }
928
+
929
+ .node .label {
930
+ text-align: center;
931
+ }
932
+ .node.clickable {
933
+ cursor: pointer;
934
+ }
935
+
936
+ .arrowheadPath {
937
+ fill: ${e.arrowheadColor};
938
+ }
939
+
940
+ .edgePaths .path {
941
+ stroke: ${e.lineColor};
942
+ stroke-width: 2.0px;
943
+ }
944
+
945
+ .flowchart-link {
946
+ stroke: ${e.lineColor};
947
+ fill: none;
948
+ }
949
+
950
+ .edgeLabel {
951
+ background-color: ${e.edgeLabelBackground};
952
+ /*
953
+ * This is for backward compatibility with existing code that didn't
954
+ * add a \`<p>\` around edge labels.
955
+ *
956
+ * TODO: We should probably remove this in a future release.
957
+ */
958
+ p {
959
+ margin: 0;
960
+ padding: 0;
961
+ display: inline;
962
+ }
963
+ rect {
964
+ opacity: 0.5;
965
+ background-color: ${e.edgeLabelBackground};
966
+ fill: ${e.edgeLabelBackground};
967
+ }
968
+ text-align: center;
969
+ }
970
+
971
+ /* For html labels only */
972
+ .labelBkg {
973
+ background-color: ${e.edgeLabelBackground};
974
+ }
975
+
976
+ .node .cluster {
977
+ // fill: ${re(e.mainBkg, 0.5)};
978
+ fill: ${re(e.clusterBkg, 0.5)};
979
+ stroke: ${re(e.clusterBorder, 0.2)};
980
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
981
+ stroke-width: 1px;
982
+ }
983
+
984
+ .cluster text {
985
+ fill: ${e.titleColor};
986
+ }
987
+
988
+ .cluster span {
989
+ color: ${e.titleColor};
990
+ }
991
+ /* .cluster div {
992
+ color: ${e.titleColor};
993
+ } */
994
+
995
+ div.mermaidTooltip {
996
+ position: absolute;
997
+ text-align: center;
998
+ max-width: 200px;
999
+ padding: 2px;
1000
+ font-family: ${e.fontFamily};
1001
+ font-size: 12px;
1002
+ background: ${e.tertiaryColor};
1003
+ border: 1px solid ${e.border2};
1004
+ border-radius: 2px;
1005
+ pointer-events: none;
1006
+ z-index: 100;
1007
+ }
1008
+
1009
+ .flowchartTitleText {
1010
+ text-anchor: middle;
1011
+ font-size: 18px;
1012
+ fill: ${e.textColor};
1013
+ }
1014
+ ${Me()}
1015
+ `, "getStyles"), rs = ss;
1016
+ function ne(e, a) {
1017
+ if (e === 0 || !Number.isInteger(e))
1018
+ throw new Error("Columns must be an integer !== 0.");
1019
+ if (a < 0 || !Number.isInteger(a))
1020
+ throw new Error("Position must be a non-negative integer." + a);
1021
+ if (e < 0)
1022
+ return { px: a, py: 0 };
1023
+ if (e === 1)
1024
+ return { px: 0, py: a };
1025
+ const o = a % e, s = Math.floor(a / e);
1026
+ return { px: o, py: s };
1027
+ }
1028
+ u(ne, "calculateBlockPosition");
1029
+ var is = /* @__PURE__ */ u((e) => {
1030
+ let a = 0, o = 0;
1031
+ for (const s of e.children) {
1032
+ const { width: l, height: g, x: t, y: h } = s.size ?? { width: 0, height: 0, x: 0, y: 0 };
1033
+ if (y.debug(
1034
+ "getMaxChildSize abc95 child:",
1035
+ s.id,
1036
+ "width:",
1037
+ l,
1038
+ "height:",
1039
+ g,
1040
+ "x:",
1041
+ t,
1042
+ "y:",
1043
+ h,
1044
+ s.type
1045
+ ), s.type === "space")
1046
+ continue;
1047
+ const x = l / (s.widthInColumns ?? 1);
1048
+ x > a && (a = x), g > o && (o = g);
1049
+ }
1050
+ return { width: a, height: o };
1051
+ }, "getMaxChildSize");
1052
+ function j(e, a, o = 0, s = 0, l = 8) {
1053
+ y.debug(
1054
+ "setBlockSizes abc95 (start)",
1055
+ e.id,
1056
+ e?.size?.x,
1057
+ "block width =",
1058
+ e?.size,
1059
+ "siblingWidth",
1060
+ o
1061
+ ), e?.size?.width || (e.size = {
1062
+ width: o,
1063
+ height: s,
1064
+ x: 0,
1065
+ y: 0
1066
+ });
1067
+ let g = 0, t = 0;
1068
+ if (e.children?.length > 0) {
1069
+ for (const S of e.children)
1070
+ j(S, a, 0, 0, l);
1071
+ const h = is(e);
1072
+ g = h.width, t = h.height, y.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", g, t);
1073
+ for (const S of e.children)
1074
+ S.size && (y.debug(
1075
+ `abc95 Setting size of children of ${e.id} id=${S.id} ${g} ${t} ${JSON.stringify(S.size)}`
1076
+ ), S.size.width = g * (S.widthInColumns ?? 1) + l * ((S.widthInColumns ?? 1) - 1), S.size.height = t, S.size.x = 0, S.size.y = 0, y.debug(
1077
+ `abc95 updating size of ${e.id} children child:${S.id} maxWidth:${g} maxHeight:${t}`
1078
+ ));
1079
+ for (const S of e.children)
1080
+ j(S, a, g, t, l);
1081
+ const x = e.columns ?? -1;
1082
+ let L = 0;
1083
+ for (const S of e.children)
1084
+ L += S.widthInColumns ?? 1;
1085
+ let b = e.children.length;
1086
+ x > 0 && x < L && (b = x);
1087
+ const f = Math.ceil(L / b);
1088
+ let m = b * (g + l) + l, w = f * (t + l) + l;
1089
+ if (m < o) {
1090
+ y.debug(
1091
+ `Detected to small sibling: abc95 ${e.id} siblingWidth ${o} siblingHeight ${s} width ${m}`
1092
+ ), m = o, w = s;
1093
+ const S = (o - b * l - l) / b, _ = (s - f * l - l) / f;
1094
+ y.debug("Size indata abc88", e.id, "childWidth", S, "maxWidth", g), y.debug("Size indata abc88", e.id, "childHeight", _, "maxHeight", t), y.debug("Size indata abc88 xSize", b, "padding", l);
1095
+ for (const k of e.children)
1096
+ k.size && (k.size.width = S, k.size.height = _, k.size.x = 0, k.size.y = 0);
1097
+ }
1098
+ if (y.debug(
1099
+ `abc95 (finale calc) ${e.id} xSize ${b} ySize ${f} columns ${x}${e.children.length} width=${Math.max(m, e.size?.width || 0)}`
1100
+ ), m < (e?.size?.width || 0)) {
1101
+ m = e?.size?.width || 0;
1102
+ const S = x > 0 ? Math.min(e.children.length, x) : e.children.length;
1103
+ if (S > 0) {
1104
+ const _ = (m - S * l - l) / S;
1105
+ y.debug("abc95 (growing to fit) width", e.id, m, e.size?.width, _);
1106
+ for (const k of e.children)
1107
+ k.size && (k.size.width = _);
1108
+ }
1109
+ }
1110
+ e.size = {
1111
+ width: m,
1112
+ height: w,
1113
+ x: 0,
1114
+ y: 0
1115
+ };
1116
+ }
1117
+ y.debug(
1118
+ "setBlockSizes abc94 (done)",
1119
+ e.id,
1120
+ e?.size?.x,
1121
+ e?.size?.width,
1122
+ e?.size?.y,
1123
+ e?.size?.height
1124
+ );
1125
+ }
1126
+ u(j, "setBlockSizes");
1127
+ function he(e, a, o = 8) {
1128
+ y.debug(
1129
+ `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`
1130
+ );
1131
+ const s = e.columns ?? -1;
1132
+ if (y.debug("layoutBlocks columns abc95", e.id, "=>", s, e), e.children && // find max width of children
1133
+ e.children.length > 0) {
1134
+ const l = e?.children[0]?.size?.width ?? 0, g = e.children.length * l + (e.children.length - 1) * o;
1135
+ y.debug("widthOfChildren 88", g, "posX");
1136
+ const t = /* @__PURE__ */ new Map();
1137
+ {
1138
+ let f = 0;
1139
+ for (const m of e.children) {
1140
+ if (!m.size)
1141
+ continue;
1142
+ const { py: w } = ne(s, f), S = t.get(w) ?? 0;
1143
+ m.size.height > S && t.set(w, m.size.height);
1144
+ let _ = m?.widthInColumns ?? 1;
1145
+ s > 0 && (_ = Math.min(_, s - f % s)), f += _;
1146
+ }
1147
+ }
1148
+ const h = /* @__PURE__ */ new Map();
1149
+ {
1150
+ let f = 0;
1151
+ const m = [...t.keys()].sort((w, S) => w - S);
1152
+ for (const w of m)
1153
+ h.set(w, f), f += (t.get(w) ?? 0) + o;
1154
+ }
1155
+ let x = 0;
1156
+ y.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1157
+ let L = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -o, b = 0;
1158
+ for (const f of e.children) {
1159
+ const m = e;
1160
+ if (!f.size)
1161
+ continue;
1162
+ const { width: w, height: S } = f.size, { px: _, py: k } = ne(s, x);
1163
+ if (k != b && (b = k, L = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -o, y.debug("New row in layout for block", e.id, " and child ", f.id, b)), y.debug(
1164
+ `abc89 layout blocks (child) id: ${f.id} Pos: ${x} (px, py) ${_},${k} (${m?.size?.x},${m?.size?.y}) parent: ${m.id} width: ${w}${o}`
1165
+ ), m.size) {
1166
+ const C = w / 2;
1167
+ f.size.x = L + o + C, y.debug(
1168
+ `abc91 layout blocks (calc) px, pyid:${f.id} startingPos=X${L} new startingPosX${f.size.x} ${C} padding=${o} width=${w} halfWidth=${C} => x:${f.size.x} y:${f.size.y} ${f.widthInColumns} (width * (child?.w || 1)) / 2 ${w * (f?.widthInColumns ?? 1) / 2}`
1169
+ ), L = f.size.x + C;
1170
+ const O = h.get(k) ?? 0, d = t.get(k) ?? S;
1171
+ f.size.y = m.size.y - m.size.height / 2 + O + d / 2 + o, y.debug(
1172
+ `abc88 layout blocks (calc) px, pyid:${f.id}startingPosX${L}${o}${C}=>x:${f.size.x}y:${f.size.y}${f.widthInColumns}(width * (child?.w || 1)) / 2${w * (f?.widthInColumns ?? 1) / 2}`
1173
+ );
1174
+ }
1175
+ f.children && he(f, a, o);
1176
+ let T = f?.widthInColumns ?? 1;
1177
+ s > 0 && (T = Math.min(T, s - x % s)), x += T, y.debug("abc88 columnsPos", f, x);
1178
+ }
1179
+ }
1180
+ y.debug(
1181
+ `layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`
1182
+ );
1183
+ }
1184
+ u(he, "layoutBlocks");
1185
+ function ge(e, { minX: a, minY: o, maxX: s, maxY: l } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1186
+ if (e.size && e.id !== "root") {
1187
+ const { x: g, y: t, width: h, height: x } = e.size;
1188
+ g - h / 2 < a && (a = g - h / 2), t - x / 2 < o && (o = t - x / 2), g + h / 2 > s && (s = g + h / 2), t + x / 2 > l && (l = t + x / 2);
1189
+ }
1190
+ if (e.children)
1191
+ for (const g of e.children)
1192
+ ({ minX: a, minY: o, maxX: s, maxY: l } = ge(g, { minX: a, minY: o, maxX: s, maxY: l }));
1193
+ return { minX: a, minY: o, maxX: s, maxY: l };
1194
+ }
1195
+ u(ge, "findBounds");
1196
+ function Oe(e) {
1197
+ const a = e.getBlock("root");
1198
+ if (!a)
1199
+ return;
1200
+ const o = me()?.block?.padding ?? 8;
1201
+ j(a, e, 0, 0, o), he(a, e, o), y.debug("getBlocks", JSON.stringify(a, null, 2));
1202
+ const { minX: s, minY: l, maxX: g, maxY: t } = ge(a), h = t - l, x = g - s;
1203
+ return { x: s, y: l, width: x, height: h };
1204
+ }
1205
+ u(Oe, "layout");
1206
+ function de(e, a, o = !1) {
1207
+ const s = e;
1208
+ let l = "default";
1209
+ (s?.classes?.length || 0) > 0 && (l = (s?.classes ?? []).join(" ")), l = l + " flowchart-label";
1210
+ const g = (s?.classes ?? []).flatMap(
1211
+ (S) => a.getClasses().get(S)?.styles ?? []
1212
+ );
1213
+ let t = 0, h = "rect", x;
1214
+ switch (s.type) {
1215
+ case "round":
1216
+ t = 5, h = "rect";
1217
+ break;
1218
+ case "composite":
1219
+ t = 0, h = "composite", x = 0;
1220
+ break;
1221
+ case "square":
1222
+ h = "rect";
1223
+ break;
1224
+ case "diamond":
1225
+ h = "question";
1226
+ break;
1227
+ case "hexagon":
1228
+ h = "hexagon";
1229
+ break;
1230
+ case "block_arrow":
1231
+ h = "block_arrow";
1232
+ break;
1233
+ case "odd":
1234
+ h = "rect_left_inv_arrow";
1235
+ break;
1236
+ case "lean_right":
1237
+ h = "lean_right";
1238
+ break;
1239
+ case "lean_left":
1240
+ h = "lean_left";
1241
+ break;
1242
+ case "trapezoid":
1243
+ h = "trapezoid";
1244
+ break;
1245
+ case "inv_trapezoid":
1246
+ h = "inv_trapezoid";
1247
+ break;
1248
+ case "rect_left_inv_arrow":
1249
+ h = "rect_left_inv_arrow";
1250
+ break;
1251
+ case "circle":
1252
+ h = "circle";
1253
+ break;
1254
+ case "ellipse":
1255
+ h = "ellipse";
1256
+ break;
1257
+ case "stadium":
1258
+ h = "stadium";
1259
+ break;
1260
+ case "subroutine":
1261
+ h = "subroutine";
1262
+ break;
1263
+ case "cylinder":
1264
+ h = "cylinder";
1265
+ break;
1266
+ case "group":
1267
+ h = "rect";
1268
+ break;
1269
+ case "doublecircle":
1270
+ h = "doublecircle";
1271
+ break;
1272
+ default:
1273
+ h = "rect";
1274
+ }
1275
+ const L = Et(s?.styles ?? []), b = s.label, f = s.size ?? { width: 0, height: 0, x: 0, y: 0 }, m = a.getDiagramId();
1276
+ return {
1277
+ labelStyle: L.labelStyle,
1278
+ shape: h,
1279
+ label: b,
1280
+ labelText: b,
1281
+ rx: t,
1282
+ ry: t,
1283
+ class: l,
1284
+ cssClasses: l,
1285
+ cssStyles: s?.styles ?? [],
1286
+ cssCompiledStyles: g,
1287
+ style: L.style,
1288
+ id: s.id,
1289
+ domId: m ? `${m}-${s.id}` : s.id,
1290
+ isGroup: !1,
1291
+ directions: s.directions,
1292
+ width: f.width || void 0,
1293
+ height: f.height || void 0,
1294
+ wrappingWidth: f.width || Number.POSITIVE_INFINITY,
1295
+ x: f.x,
1296
+ y: f.y,
1297
+ positioned: o,
1298
+ intersect: void 0,
1299
+ padding: x ?? P()?.block?.padding ?? 0,
1300
+ widthInColumns: s.widthInColumns ?? 1,
1301
+ colorIndex: s.colorIndex,
1302
+ look: P().look
1303
+ };
1304
+ }
1305
+ u(de, "getNodeFromBlock");
1306
+ async function ve(e, a, o) {
1307
+ const s = de(a, o, !1);
1308
+ if (a.type === "group")
1309
+ return;
1310
+ const l = P(), g = await ye(e, s, { config: l }), t = g.node()?.getBBox() ?? { width: 0, height: 0 }, h = o.getBlock(s.id);
1311
+ h.size = { width: t.width, height: t.height, x: 0, y: 0, node: g }, o.setBlock(h), g.remove();
1312
+ }
1313
+ u(ve, "calculateBlockSize");
1314
+ async function Ae(e, a, o) {
1315
+ const s = de(a, o, !0);
1316
+ if (o.getBlock(s.id).type !== "space") {
1317
+ const g = P(), t = await ye(e, s, { config: g });
1318
+ s.colorIndex !== void 0 && kt(
1319
+ // `insertNode` returns an anchor instead of a group when the node carries a
1320
+ // link, and both are `SVGGraphicsElement`s -- but the union of the two selections
1321
+ // is not assignable to one instantiation of the generic, so it is narrowed here.
1322
+ t,
1323
+ s.colorIndex,
1324
+ g.theme,
1325
+ g.themeVariables?.borderColorArray
1326
+ ), a.intersect = s?.intersect, _t(s);
1327
+ }
1328
+ }
1329
+ u(Ae, "insertBlockPositioned");
1330
+ async function q(e, a, o, s) {
1331
+ for (const l of a)
1332
+ await s(e, l, o), l.children && await q(e, l.children, o, s);
1333
+ }
1334
+ u(q, "performOperations");
1335
+ async function ze(e, a, o) {
1336
+ await q(e, a, o, ve);
1337
+ }
1338
+ u(ze, "calculateBlockSizes");
1339
+ async function Be(e, a, o) {
1340
+ await q(e, a, o, Ae);
1341
+ }
1342
+ u(Be, "insertBlocks");
1343
+ async function Re(e, a, o, s, l) {
1344
+ const g = new Dt({
1345
+ multigraph: !0,
1346
+ compound: !0
1347
+ });
1348
+ g.setGraph({
1349
+ rankdir: "TB",
1350
+ nodesep: 10,
1351
+ ranksep: 10,
1352
+ marginx: 8,
1353
+ marginy: 8
1354
+ });
1355
+ for (const t of o)
1356
+ t.size && g.setNode(t.id, {
1357
+ width: t.size.width,
1358
+ height: t.size.height,
1359
+ intersect: t.intersect
1360
+ });
1361
+ for (const t of a)
1362
+ if (t.start && t.end) {
1363
+ const h = s.getBlock(t.start), x = s.getBlock(t.end);
1364
+ if (h?.size && x?.size) {
1365
+ const L = h.size, b = x.size, f = [
1366
+ { x: L.x, y: L.y },
1367
+ { x: L.x + (b.x - L.x) / 2, y: L.y + (b.y - L.y) / 2 },
1368
+ { x: b.x, y: b.y }
1369
+ ], m = l ? `${l}-${t.id}` : t.id, w = t.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal", S = t.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid", _ = `${w} ${S} flowchart-link LS-a1 LE-b1`;
1370
+ Lt(
1371
+ e,
1372
+ {
1373
+ ...t,
1374
+ id: m,
1375
+ arrowTypeEnd: t.arrowTypeEnd,
1376
+ arrowTypeStart: t.arrowTypeStart,
1377
+ points: f,
1378
+ classes: _
1379
+ },
1380
+ {},
1381
+ "block",
1382
+ g.node(t.start),
1383
+ g.node(t.end),
1384
+ l
1385
+ ), t.label && (await mt(e, {
1386
+ ...t,
1387
+ label: t.label,
1388
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
1389
+ arrowTypeEnd: t.arrowTypeEnd,
1390
+ arrowTypeStart: t.arrowTypeStart,
1391
+ points: f,
1392
+ classes: _
1393
+ }), yt(
1394
+ { ...t, x: f[1].x, y: f[1].y },
1395
+ {
1396
+ originalPath: f
1397
+ }
1398
+ ));
1399
+ }
1400
+ }
1401
+ }
1402
+ u(Re, "insertEdges");
1403
+ var as = /* @__PURE__ */ u(function(e, a) {
1404
+ return a.db.getClasses();
1405
+ }, "getClasses"), ns = /* @__PURE__ */ u(async function(e, a, o, s) {
1406
+ const { securityLevel: l, block: g } = P(), t = s.db;
1407
+ t.setDiagramId(a);
1408
+ let h;
1409
+ l === "sandbox" && (h = G("#i" + a));
1410
+ const x = l === "sandbox" ? G(h.nodes()[0].contentDocument.body) : G("body"), L = l === "sandbox" ? x.select(`[id="${a}"]`) : G(`[id="${a}"]`);
1411
+ ut(L, P()), ht(L, ["point", "circle", "cross"], s.type, a);
1412
+ const f = t.getBlocks(), m = t.getBlocksFlat(), w = t.getEdges(), S = L.insert("g").attr("class", "block");
1413
+ await ze(S, f, t);
1414
+ const _ = Oe(t);
1415
+ await Be(S, f, t), await Re(S, w, m, t, a);
1416
+ const k = S.node()?.getBBox(), T = k && Number.isFinite(k.width) && Number.isFinite(k.height) ? k : _;
1417
+ if (T) {
1418
+ const C = Math.max(1, Math.round(0.125 * (T.width / T.height))), O = T.height + C + 10, d = T.width + 10, { useMaxWidth: i } = g;
1419
+ gt(L, O, d, !!i), y.debug("Here Bounds", _, T), L.attr(
1420
+ "viewBox",
1421
+ `${T.x - 5} ${T.y - 5} ${T.width + 10} ${T.height + 10}`
1422
+ );
1423
+ }
1424
+ }, "draw"), os = {
1425
+ draw: ns,
1426
+ getClasses: as
1427
+ }, gs = {
1428
+ parser: zt,
1429
+ db: es,
1430
+ renderer: os,
1431
+ styles: rs
1432
+ };
1433
+ export {
1434
+ gs as diagram
1435
+ };