@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6

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 +79 -8
  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 +340 -217
  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,664 @@
1
+ import { _ as p, l as C, T as H, O as B, D as q, Y as G, d as U, j, c as K } from "./mermaid.core-yQghUlIz.js";
2
+ var A = "", M = "", O = "", D = [], b = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ p((e) => j(e, K()), "sanitizeText"), y = /* @__PURE__ */ p((e) => {
3
+ switch (e.type) {
4
+ case "terminal":
5
+ return { ...e, value: v(e.value) };
6
+ case "nonterminal":
7
+ return { ...e, name: v(e.name) };
8
+ case "sequence":
9
+ return { ...e, elements: e.elements.map(y) };
10
+ case "choice":
11
+ return { ...e, alternatives: e.alternatives.map(y) };
12
+ case "optional":
13
+ return { ...e, element: y(e.element) };
14
+ case "repetition":
15
+ return {
16
+ ...e,
17
+ element: y(e.element),
18
+ separator: e.separator ? y(e.separator) : void 0
19
+ };
20
+ case "special":
21
+ return { ...e, text: v(e.text) };
22
+ }
23
+ }, "sanitizeAstNode"), J = /* @__PURE__ */ p(() => {
24
+ A = "", M = "", O = "", D.length = 0, b.clear(), q(), C.debug("[Railroad] Database cleared");
25
+ }, "clear"), Y = /* @__PURE__ */ p((e) => {
26
+ A = v(e), C.debug("[Railroad] Title set:", e);
27
+ }, "setTitle"), P = /* @__PURE__ */ p(() => A, "getTitle"), Q = /* @__PURE__ */ p((e) => {
28
+ const i = {
29
+ ...e,
30
+ name: v(e.name),
31
+ definition: y(e.definition),
32
+ comment: e.comment ? v(e.comment) : void 0
33
+ };
34
+ C.debug("[Railroad] Adding rule:", i.name), b.has(i.name) && C.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`), D.push(i), b.set(i.name, i);
35
+ }, "addRule"), Z = /* @__PURE__ */ p(() => D, "getRules"), V = /* @__PURE__ */ p((e) => b.get(e), "getRule"), ee = /* @__PURE__ */ p((e) => {
36
+ M = v(e).replace(/^\s+/g, ""), C.debug("[Railroad] Accessibility title set:", e);
37
+ }, "setAccTitle"), te = /* @__PURE__ */ p(() => M, "getAccTitle"), re = /* @__PURE__ */ p((e) => {
38
+ O = v(e).replace(/\n\s+/g, `
39
+ `), C.debug("[Railroad] Accessibility description set:", e);
40
+ }, "setAccDescription"), ie = /* @__PURE__ */ p(() => O, "getAccDescription"), ne = Y, ae = P, oe = {
41
+ clear: J,
42
+ setTitle: Y,
43
+ getTitle: P,
44
+ addRule: Q,
45
+ getRules: Z,
46
+ getRule: V,
47
+ setAccTitle: ee,
48
+ getAccTitle: te,
49
+ setAccDescription: re,
50
+ getAccDescription: ie,
51
+ setDiagramTitle: ne,
52
+ getDiagramTitle: ae
53
+ }, f = {
54
+ // Layout
55
+ compactMode: !1,
56
+ // Spacing
57
+ padding: 10,
58
+ verticalSeparation: 8,
59
+ horizontalSeparation: 10,
60
+ arcRadius: 10,
61
+ // Typography
62
+ fontSize: 14,
63
+ fontFamily: "monospace",
64
+ // Colors - Terminal
65
+ terminalFill: "#FFFFC0",
66
+ terminalStroke: "#000000",
67
+ terminalTextColor: "#000000",
68
+ // Colors - Non-terminal
69
+ nonTerminalFill: "#FFFFFF",
70
+ nonTerminalStroke: "#000000",
71
+ nonTerminalTextColor: "#000000",
72
+ // Colors - Lines
73
+ lineColor: "#000000",
74
+ strokeWidth: 2,
75
+ // Colors - Markers
76
+ markerFill: "#000000",
77
+ // Colors - Comment
78
+ commentFill: "#E8E8E8",
79
+ commentStroke: "#888888",
80
+ commentTextColor: "#666666",
81
+ // Colors - Special
82
+ specialFill: "#F0E0FF",
83
+ specialStroke: "#8800CC",
84
+ // Other
85
+ ruleNameColor: "#000066",
86
+ showMarkers: !0,
87
+ markerRadius: 5
88
+ }, le = /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i, se = /^[\w "',.-]+$/, de = /* @__PURE__ */ new Set([
89
+ "compactMode",
90
+ "padding",
91
+ "verticalSeparation",
92
+ "horizontalSeparation",
93
+ "arcRadius",
94
+ "fontSize",
95
+ "fontFamily",
96
+ "terminalFill",
97
+ "terminalStroke",
98
+ "terminalTextColor",
99
+ "nonTerminalFill",
100
+ "nonTerminalStroke",
101
+ "nonTerminalTextColor",
102
+ "lineColor",
103
+ "strokeWidth",
104
+ "markerFill",
105
+ "commentFill",
106
+ "commentStroke",
107
+ "commentTextColor",
108
+ "specialFill",
109
+ "specialStroke",
110
+ "ruleNameColor",
111
+ "showMarkers",
112
+ "markerRadius"
113
+ ]), L = /* @__PURE__ */ p((e) => e ? Object.keys(e).every(
114
+ (i) => i === "railroad" || de.has(i)
115
+ ) : !1, "isRailroadStyleOptions"), ce = /* @__PURE__ */ p((e) => e ? "railroad" in e && e.railroad ? e.railroad : L(e) ? e : {} : {}, "extractRailroadOverrides"), me = /* @__PURE__ */ p((e) => {
116
+ if (!e || L(e))
117
+ return {};
118
+ const {
119
+ railroad: i,
120
+ svgId: a,
121
+ theme: n,
122
+ look: t,
123
+ ...r
124
+ } = e;
125
+ return r;
126
+ }, "extractThemeOverrides"), m = /* @__PURE__ */ p((e, i) => {
127
+ if (typeof e != "string")
128
+ return i;
129
+ const a = e.trim();
130
+ return le.test(a) ? a : i;
131
+ }, "sanitizeColorValue"), I = /* @__PURE__ */ p((e, i) => {
132
+ if (typeof e != "string")
133
+ return i;
134
+ const a = e.trim();
135
+ return se.test(a) ? a : i;
136
+ }, "sanitizeFontFamilyValue"), F = /* @__PURE__ */ p((e, i) => {
137
+ const a = typeof e == "number" ? e : typeof e == "string" ? Number.parseFloat(e) : Number.NaN;
138
+ return Number.isFinite(a) && a >= 0 ? a : i;
139
+ }, "sanitizeNumberValue"), he = /* @__PURE__ */ p((e) => {
140
+ const i = typeof e == "number" ? e : typeof e == "string" ? Number.parseFloat(e) : Number.NaN;
141
+ return Number.isFinite(i) && i > 0 ? i : void 0;
142
+ }, "parseThemeFontSize"), pe = /* @__PURE__ */ p((e) => {
143
+ const i = I(
144
+ e.fontFamily,
145
+ f.fontFamily
146
+ ), a = he(e.fontSize) ?? f.fontSize;
147
+ return {
148
+ ...f,
149
+ fontFamily: i,
150
+ fontSize: a,
151
+ terminalFill: m(
152
+ e.secondBkg ?? e.secondaryColor,
153
+ f.terminalFill
154
+ ),
155
+ terminalStroke: m(
156
+ e.secondaryBorderColor ?? e.lineColor,
157
+ f.terminalStroke
158
+ ),
159
+ terminalTextColor: m(
160
+ e.secondaryTextColor ?? e.textColor,
161
+ f.terminalTextColor
162
+ ),
163
+ nonTerminalFill: m(
164
+ e.mainBkg ?? e.background,
165
+ f.nonTerminalFill
166
+ ),
167
+ nonTerminalStroke: m(
168
+ e.primaryBorderColor ?? e.lineColor,
169
+ f.nonTerminalStroke
170
+ ),
171
+ nonTerminalTextColor: m(
172
+ e.primaryTextColor ?? e.textColor,
173
+ f.nonTerminalTextColor
174
+ ),
175
+ lineColor: m(e.lineColor, f.lineColor),
176
+ markerFill: m(e.lineColor, f.markerFill),
177
+ commentFill: m(
178
+ e.labelBackground ?? e.tertiaryColor,
179
+ f.commentFill
180
+ ),
181
+ commentStroke: m(
182
+ e.tertiaryBorderColor ?? e.lineColor,
183
+ f.commentStroke
184
+ ),
185
+ commentTextColor: m(
186
+ e.tertiaryTextColor ?? e.textColor,
187
+ f.commentTextColor
188
+ ),
189
+ specialFill: m(
190
+ e.tertiaryColor ?? e.secondaryColor,
191
+ f.specialFill
192
+ ),
193
+ specialStroke: m(
194
+ e.tertiaryBorderColor ?? e.secondaryBorderColor,
195
+ f.specialStroke
196
+ ),
197
+ ruleNameColor: m(
198
+ e.titleColor ?? e.textColor,
199
+ f.ruleNameColor
200
+ )
201
+ };
202
+ }, "buildThemeDefaults"), E = /* @__PURE__ */ p((e) => {
203
+ const i = B(), a = {
204
+ ...G(),
205
+ ...i.themeVariables ?? {},
206
+ ...me(e)
207
+ }, n = pe(a), t = {
208
+ ...i.railroad ?? {},
209
+ ...ce(e)
210
+ };
211
+ return {
212
+ compactMode: t.compactMode ?? n.compactMode,
213
+ padding: F(t.padding, n.padding),
214
+ verticalSeparation: F(
215
+ t.verticalSeparation,
216
+ n.verticalSeparation
217
+ ),
218
+ horizontalSeparation: F(
219
+ t.horizontalSeparation,
220
+ n.horizontalSeparation
221
+ ),
222
+ arcRadius: F(t.arcRadius, n.arcRadius),
223
+ fontSize: F(t.fontSize, n.fontSize),
224
+ fontFamily: I(t.fontFamily, n.fontFamily),
225
+ terminalFill: m(t.terminalFill, n.terminalFill),
226
+ terminalStroke: m(
227
+ t.terminalStroke,
228
+ n.terminalStroke
229
+ ),
230
+ terminalTextColor: m(
231
+ t.terminalTextColor,
232
+ n.terminalTextColor
233
+ ),
234
+ nonTerminalFill: m(
235
+ t.nonTerminalFill,
236
+ n.nonTerminalFill
237
+ ),
238
+ nonTerminalStroke: m(
239
+ t.nonTerminalStroke,
240
+ n.nonTerminalStroke
241
+ ),
242
+ nonTerminalTextColor: m(
243
+ t.nonTerminalTextColor,
244
+ n.nonTerminalTextColor
245
+ ),
246
+ lineColor: m(t.lineColor, n.lineColor),
247
+ strokeWidth: F(t.strokeWidth, n.strokeWidth),
248
+ markerFill: m(t.markerFill, n.markerFill),
249
+ commentFill: m(t.commentFill, n.commentFill),
250
+ commentStroke: m(t.commentStroke, n.commentStroke),
251
+ commentTextColor: m(
252
+ t.commentTextColor,
253
+ n.commentTextColor
254
+ ),
255
+ specialFill: m(t.specialFill, n.specialFill),
256
+ specialStroke: m(t.specialStroke, n.specialStroke),
257
+ ruleNameColor: m(t.ruleNameColor, n.ruleNameColor),
258
+ showMarkers: t.showMarkers ?? n.showMarkers,
259
+ markerRadius: F(t.markerRadius, n.markerRadius)
260
+ };
261
+ }, "buildRailroadStyleOptions"), Te = /* @__PURE__ */ p((e) => {
262
+ const {
263
+ fontFamily: i,
264
+ fontSize: a,
265
+ terminalFill: n,
266
+ terminalStroke: t,
267
+ terminalTextColor: r,
268
+ nonTerminalFill: o,
269
+ nonTerminalStroke: g,
270
+ nonTerminalTextColor: l,
271
+ lineColor: s,
272
+ strokeWidth: h,
273
+ markerFill: u,
274
+ commentFill: c,
275
+ commentStroke: w,
276
+ commentTextColor: d,
277
+ specialFill: T,
278
+ specialStroke: z,
279
+ ruleNameColor: S
280
+ } = E(e);
281
+ return `
282
+ .railroad-diagram {
283
+ font-family: ${i};
284
+ font-size: ${a}px;
285
+ }
286
+
287
+ .railroad-terminal rect {
288
+ fill: ${n};
289
+ stroke: ${t};
290
+ stroke-width: ${h}px;
291
+ }
292
+
293
+ .railroad-terminal text {
294
+ fill: ${r};
295
+ font-family: ${i};
296
+ font-size: ${a}px;
297
+ text-anchor: middle;
298
+ dominant-baseline: middle;
299
+ }
300
+
301
+ .railroad-nonterminal rect {
302
+ fill: ${o};
303
+ stroke: ${g};
304
+ stroke-width: ${h}px;
305
+ }
306
+
307
+ .railroad-nonterminal text {
308
+ fill: ${l};
309
+ font-family: ${i};
310
+ font-size: ${a}px;
311
+ text-anchor: middle;
312
+ dominant-baseline: middle;
313
+ }
314
+
315
+ .railroad-line {
316
+ stroke: ${s};
317
+ stroke-width: ${h}px;
318
+ fill: none;
319
+ }
320
+
321
+ .railroad-start circle,
322
+ .railroad-end circle {
323
+ fill: ${u};
324
+ }
325
+
326
+ .railroad-comment ellipse {
327
+ fill: ${c};
328
+ stroke: ${w};
329
+ stroke-width: ${h}px;
330
+ }
331
+
332
+ .railroad-comment text {
333
+ fill: ${d};
334
+ font-style: italic;
335
+ font-family: ${i};
336
+ font-size: ${a}px;
337
+ text-anchor: middle;
338
+ dominant-baseline: middle;
339
+ }
340
+
341
+ .railroad-special rect {
342
+ fill: ${T};
343
+ stroke: ${z};
344
+ stroke-width: ${h}px;
345
+ stroke-dasharray: 5,3;
346
+ }
347
+
348
+ .railroad-special text {
349
+ fill: ${l};
350
+ font-family: ${i};
351
+ font-size: ${a}px;
352
+ text-anchor: middle;
353
+ dominant-baseline: middle;
354
+ }
355
+
356
+ .railroad-rule-name {
357
+ font-weight: bold;
358
+ fill: ${S};
359
+ font-family: ${i};
360
+ font-size: ${a}px;
361
+ }
362
+
363
+ .railroad-group {
364
+ /* Grouping container, no specific styles */
365
+ }
366
+ `;
367
+ }, "getStyles"), R, x = (R = class {
368
+ constructor() {
369
+ this.d = "";
370
+ }
371
+ moveTo(i, a) {
372
+ return this.d += `M ${i} ${a} `, this;
373
+ }
374
+ lineTo(i, a) {
375
+ return this.d += `L ${i} ${a} `, this;
376
+ }
377
+ horizontalTo(i) {
378
+ return this.d += `H ${i} `, this;
379
+ }
380
+ verticalTo(i) {
381
+ return this.d += `V ${i} `, this;
382
+ }
383
+ arcTo(i, a, n, t, r, o, g) {
384
+ return this.d += `A ${i} ${a} ${n} ${t ? 1 : 0} ${r ? 1 : 0} ${o} ${g} `, this;
385
+ }
386
+ build() {
387
+ return this.d.trim();
388
+ }
389
+ }, p(R, "PathBuilder"), R), $, ue = ($ = class {
390
+ constructor(i, a = E()) {
391
+ this.textCache = /* @__PURE__ */ new Map(), this.svg = i, this.config = a;
392
+ }
393
+ /**
394
+ * Measure text dimensions
395
+ */
396
+ measureText(i) {
397
+ if (this.textCache.has(i))
398
+ return this.textCache.get(i);
399
+ const a = this.svg.append("text").attr("font-family", this.config.fontFamily).attr("font-size", this.config.fontSize).text(i), n = a.node().getBBox(), t = { width: n.width, height: n.height };
400
+ return a.remove(), this.textCache.set(i, t), t;
401
+ }
402
+ /**
403
+ * Render terminal symbol (rounded rectangle)
404
+ */
405
+ renderTerminal(i, a) {
406
+ const n = this.measureText(a), t = n.width + this.config.padding * 2, r = n.height + this.config.padding * 2, o = i.append("g").attr("class", "railroad-terminal");
407
+ return o.append("rect").attr("x", 0).attr("y", 0).attr("width", t).attr("height", r).attr("rx", 10).attr("ry", 10), o.append("text").attr("x", t / 2).attr("y", r / 2).text(a), {
408
+ element: o.node(),
409
+ dimensions: {
410
+ width: t,
411
+ height: r,
412
+ up: r / 2,
413
+ down: r / 2
414
+ }
415
+ };
416
+ }
417
+ /**
418
+ * Render non-terminal symbol (rectangle)
419
+ */
420
+ renderNonTerminal(i, a) {
421
+ const n = this.measureText(a), t = n.width + this.config.padding * 2, r = n.height + this.config.padding * 2, o = i.append("g").attr("class", "railroad-nonterminal");
422
+ return o.append("rect").attr("x", 0).attr("y", 0).attr("width", t).attr("height", r), o.append("text").attr("x", t / 2).attr("y", r / 2).text(a), {
423
+ element: o.node(),
424
+ dimensions: {
425
+ width: t,
426
+ height: r,
427
+ up: r / 2,
428
+ down: r / 2
429
+ }
430
+ };
431
+ }
432
+ /**
433
+ * Render sequence (horizontal concatenation)
434
+ */
435
+ renderSequence(i, a) {
436
+ const n = a.map((s) => this.renderExpression(i, s));
437
+ let t = 0, r = 0, o = 0;
438
+ for (const s of n)
439
+ t += s.dimensions.width, r = Math.max(r, s.dimensions.up), o = Math.max(o, s.dimensions.down);
440
+ t += (n.length - 1) * this.config.horizontalSeparation;
441
+ const g = i.append("g").attr("class", "railroad-sequence");
442
+ let l = 0;
443
+ for (let s = 0; s < n.length; s++) {
444
+ const h = n[s], u = r - h.dimensions.up;
445
+ if (g.node().appendChild(h.element).setAttribute("transform", `translate(${l}, ${u})`), s < n.length - 1) {
446
+ const w = l + h.dimensions.width, d = w + this.config.horizontalSeparation, T = r;
447
+ g.append("path").attr("class", "railroad-line").attr("d", new x().moveTo(w, T).lineTo(d, T).build());
448
+ }
449
+ l += h.dimensions.width + this.config.horizontalSeparation;
450
+ }
451
+ return {
452
+ element: g.node(),
453
+ dimensions: {
454
+ width: t,
455
+ height: r + o,
456
+ up: r,
457
+ down: o
458
+ }
459
+ };
460
+ }
461
+ /**
462
+ * Render choice (vertical alternatives)
463
+ */
464
+ renderChoice(i, a) {
465
+ const n = a.map((c) => this.renderExpression(i, c));
466
+ let t = 0, r = 0;
467
+ for (const c of n)
468
+ t = Math.max(t, c.dimensions.width), r += c.dimensions.height;
469
+ r += (n.length - 1) * this.config.verticalSeparation;
470
+ const o = this.config.arcRadius, g = o * 4, l = t + g, s = i.append("g").attr("class", "railroad-choice");
471
+ let h = 0;
472
+ const u = r / 2;
473
+ for (const c of n) {
474
+ const w = h, d = w + c.dimensions.up, T = o * 2 + (t - c.dimensions.width) / 2;
475
+ s.node().appendChild(c.element).setAttribute("transform", `translate(${T}, ${w})`);
476
+ const S = new x(), k = d > u;
477
+ d === u ? S.moveTo(0, u).lineTo(T, d) : S.moveTo(0, u).arcTo(
478
+ o,
479
+ o,
480
+ 0,
481
+ !1,
482
+ k,
483
+ o,
484
+ u + (k ? o : -o)
485
+ ).lineTo(o, d - (k ? o : -o)).arcTo(o, o, 0, !1, !k, o * 2, d).lineTo(T, d), s.append("path").attr("class", "railroad-line").attr("d", S.build());
486
+ const N = new x(), _ = T + c.dimensions.width, X = l - o * 2;
487
+ d === u ? N.moveTo(_, d).lineTo(l, u) : N.moveTo(_, d).lineTo(X, d).arcTo(
488
+ o,
489
+ o,
490
+ 0,
491
+ !1,
492
+ !k,
493
+ l - o,
494
+ d + (k ? -o : o)
495
+ ).lineTo(l - o, u + (k ? o : -o)).arcTo(o, o, 0, !1, k, l, u), s.append("path").attr("class", "railroad-line").attr("d", N.build()), h += c.dimensions.height + this.config.verticalSeparation;
496
+ }
497
+ return {
498
+ element: s.node(),
499
+ dimensions: {
500
+ width: l,
501
+ height: r,
502
+ up: u,
503
+ down: r - u
504
+ }
505
+ };
506
+ }
507
+ /**
508
+ * Render optional (bypass path above)
509
+ */
510
+ renderOptional(i, a) {
511
+ const n = this.renderExpression(i, a), t = this.config.arcRadius, r = t * 2, o = n.dimensions.width + t * 4, g = n.dimensions.height + r, l = i.append("g").attr("class", "railroad-optional"), s = t * 2, h = r;
512
+ l.node().appendChild(n.element).setAttribute("transform", `translate(${s}, ${h})`);
513
+ const c = h + n.dimensions.up, w = new x().moveTo(0, c).lineTo(t * 2, c);
514
+ l.append("path").attr("class", "railroad-line").attr("d", w.build());
515
+ const d = new x().moveTo(s + n.dimensions.width, c).lineTo(o, c);
516
+ l.append("path").attr("class", "railroad-line").attr("d", d.build());
517
+ const T = new x().moveTo(0, c).arcTo(t, t, 0, !1, !1, t, c - t).lineTo(t, t).arcTo(t, t, 0, !1, !0, t * 2, 0).lineTo(o - t * 2, 0).arcTo(t, t, 0, !1, !0, o - t, t).lineTo(o - t, c - t).arcTo(t, t, 0, !1, !1, o, c);
518
+ return l.append("path").attr("class", "railroad-line").attr("d", T.build()), {
519
+ element: l.node(),
520
+ dimensions: {
521
+ width: o,
522
+ height: g,
523
+ up: c,
524
+ down: g - c
525
+ }
526
+ };
527
+ }
528
+ /**
529
+ * Render repetition (loop back path)
530
+ */
531
+ renderRepetition(i, a, n) {
532
+ const t = this.renderExpression(i, a), r = this.config.arcRadius, o = r * 2, g = t.dimensions.width + r * 4, l = n === 0, s = t.dimensions.height + o + (l ? o : 0), h = i.append("g").attr("class", "railroad-repetition"), u = r * 2, c = l ? o : 0;
533
+ h.node().appendChild(t.element).setAttribute("transform", `translate(${u}, ${c})`);
534
+ const d = c + t.dimensions.up;
535
+ h.append("path").attr("class", "railroad-line").attr(
536
+ "d",
537
+ new x().moveTo(0, d).lineTo(r * 2, d).build()
538
+ ), h.append("path").attr("class", "railroad-line").attr(
539
+ "d",
540
+ new x().moveTo(u + t.dimensions.width, d).lineTo(g, d).build()
541
+ );
542
+ const T = c + t.dimensions.height + r, z = new x().moveTo(u + t.dimensions.width, d).arcTo(
543
+ r,
544
+ r,
545
+ 0,
546
+ !1,
547
+ !0,
548
+ u + t.dimensions.width + r,
549
+ d + r
550
+ ).lineTo(u + t.dimensions.width + r, T).arcTo(
551
+ r,
552
+ r,
553
+ 0,
554
+ !1,
555
+ !0,
556
+ u + t.dimensions.width,
557
+ T + r
558
+ ).lineTo(r * 2, T + r).arcTo(r, r, 0, !1, !0, r, T).lineTo(r, d + r).arcTo(r, r, 0, !1, !0, r * 2, d);
559
+ if (h.append("path").attr("class", "railroad-line").attr("d", z.build()), l) {
560
+ const S = new x().moveTo(0, d).arcTo(r, r, 0, !1, !1, r, d - r).lineTo(r, r).arcTo(r, r, 0, !1, !0, r * 2, 0).lineTo(g - r * 2, 0).arcTo(r, r, 0, !1, !0, g - r, r).lineTo(g - r, d - r).arcTo(r, r, 0, !1, !1, g, d);
561
+ h.append("path").attr("class", "railroad-line").attr("d", S.build());
562
+ }
563
+ return {
564
+ element: h.node(),
565
+ dimensions: {
566
+ width: g,
567
+ height: s,
568
+ up: d,
569
+ down: s - d
570
+ }
571
+ };
572
+ }
573
+ /**
574
+ * Render special sequence
575
+ */
576
+ renderSpecial(i, a) {
577
+ const n = this.measureText("? " + a + " ?"), t = n.width + this.config.padding * 2, r = n.height + this.config.padding * 2, o = i.append("g").attr("class", "railroad-special");
578
+ return o.append("rect").attr("x", 0).attr("y", 0).attr("width", t).attr("height", r), o.append("text").attr("x", t / 2).attr("y", r / 2).text("? " + a + " ?"), {
579
+ element: o.node(),
580
+ dimensions: {
581
+ width: t,
582
+ height: r,
583
+ up: r / 2,
584
+ down: r / 2
585
+ }
586
+ };
587
+ }
588
+ /**
589
+ * Render an expression (recursive)
590
+ */
591
+ renderExpression(i, a) {
592
+ switch (a.type) {
593
+ case "terminal":
594
+ return this.renderTerminal(i, a.value);
595
+ case "nonterminal":
596
+ return this.renderNonTerminal(i, a.name);
597
+ case "sequence":
598
+ return this.renderSequence(i, a.elements);
599
+ case "choice":
600
+ return this.renderChoice(i, a.alternatives);
601
+ case "optional":
602
+ return this.renderOptional(i, a.element);
603
+ case "repetition":
604
+ return this.renderRepetition(i, a.element, a.min);
605
+ case "special":
606
+ return this.renderSpecial(i, a.text);
607
+ default:
608
+ throw new Error(`Unknown node type: ${a.type}`);
609
+ }
610
+ }
611
+ /**
612
+ * Render a single rule
613
+ */
614
+ renderRule(i, a) {
615
+ const n = this.svg.append("g").attr("class", "railroad-rule").attr("transform", `translate(0, ${a})`), t = i.name + " =", r = this.measureText(t).width + 20, o = r + 20, g = n.append("g"), l = this.renderExpression(g, i.definition), s = Math.max(20, l.dimensions.up), h = s - l.dimensions.up;
616
+ return g.attr("transform", `translate(${o}, ${h})`), n.append("g").attr("class", "railroad-rule-name-group").append("text").attr("class", "railroad-rule-name").attr("x", 0).attr("y", s).text(t), n.append("g").attr("class", "railroad-start").append("circle").attr("cx", r).attr("cy", s).attr("r", this.config.markerRadius), n.append("g").attr("class", "railroad-end").append("circle").attr("cx", o + l.dimensions.width + 10).attr("cy", s).attr("r", this.config.markerRadius), n.append("path").attr("class", "railroad-line").attr(
617
+ "d",
618
+ new x().moveTo(r + this.config.markerRadius, s).lineTo(o, s).build()
619
+ ), n.append("path").attr("class", "railroad-line").attr(
620
+ "d",
621
+ new x().moveTo(o + l.dimensions.width, s).lineTo(o + l.dimensions.width + 10 - this.config.markerRadius, s).build()
622
+ ), {
623
+ height: Math.max(40, h + l.dimensions.height + this.config.padding * 2),
624
+ width: o + l.dimensions.width + 10 + this.config.markerRadius
625
+ };
626
+ }
627
+ /**
628
+ * Render all rules
629
+ */
630
+ renderDiagram(i) {
631
+ let a = this.config.padding, n = 0;
632
+ for (const t of i) {
633
+ const r = this.renderRule(t, a);
634
+ a += r.height + this.config.verticalSeparation, n = Math.max(n, r.width);
635
+ }
636
+ return {
637
+ width: n + this.config.padding * 2,
638
+ height: a + this.config.padding
639
+ };
640
+ }
641
+ }, p($, "RailroadRenderer"), $), W = /* @__PURE__ */ p((e, i, a) => {
642
+ U(e, i.height, i.width, a), e.attr("viewBox", `0 0 ${i.width} ${i.height}`);
643
+ }, "configureRailroadSvgSize"), ge = /* @__PURE__ */ p((e, i, a) => {
644
+ C.debug(`[Railroad] Rendering diagram
645
+ ` + e);
646
+ try {
647
+ const n = H(i);
648
+ n.attr("class", "railroad-diagram");
649
+ const r = B().railroad?.useMaxWidth ?? !0, o = oe.getRules();
650
+ if (C.debug(`[Railroad] Rendering ${o.length} rules`), o.length === 0) {
651
+ C.warn("[Railroad] No rules to render"), W(n, { height: 100, width: 200 }, r);
652
+ return;
653
+ }
654
+ const l = new ue(n, E()).renderDiagram(o);
655
+ W(n, l, r), C.debug("[Railroad] Render complete");
656
+ } catch (n) {
657
+ throw C.error("[Railroad] Render error:", n), n;
658
+ }
659
+ }, "draw"), xe = { draw: ge };
660
+ export {
661
+ oe as d,
662
+ Te as g,
663
+ xe as r
664
+ };
@@ -0,0 +1,15 @@
1
+ import { _ as s } from "./mermaid.core-yQghUlIz.js";
2
+ var t, e = (t = class {
3
+ /**
4
+ * @param init - Function that creates the default state.
5
+ */
6
+ constructor(i) {
7
+ this.init = i, this.records = this.init();
8
+ }
9
+ reset() {
10
+ this.records = this.init();
11
+ }
12
+ }, s(t, "ImperativeState"), t);
13
+ export {
14
+ e as I
15
+ };