@fibery/custom-app-text-editor 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +214 -0
- package/README.md +33 -0
- package/lib/abnfDiagram-VRR7QNED-BgjOQqEh.js +89 -0
- package/lib/arc-Dp0rqagO.js +82 -0
- package/lib/architecture-TIHT7OUA-DDwCCw0y.js +3 -0
- package/lib/architectureDiagram-ZJ3FMSHR-BucIluTN.js +4129 -0
- package/lib/array-CApNbSU9.js +6 -0
- package/lib/blockDiagram-677ZJIJ3-CWYuHThP.js +3157 -0
- package/lib/c4Diagram-LMCZKHZV-Cr3_W-xe.js +2982 -0
- package/lib/channel-Bb7a6w5c.js +5 -0
- package/lib/chunk-2Q5K7J3B-CINvUK-A.js +15 -0
- package/lib/chunk-32BRIVSS-b-BvyGz0.js +61 -0
- package/lib/chunk-52WLFC77-Cf8zEoqs.js +593 -0
- package/lib/chunk-5VM5RSS4-Dnx15xMv.js +5 -0
- package/lib/chunk-7BUUIJ7U-B018BbRy.js +82 -0
- package/lib/chunk-C7G6YPKG-CmOuVFlJ.js +67 -0
- package/lib/chunk-EX3LRPZG-LynZw14I.js +2042 -0
- package/lib/chunk-HOUHSVGY-Br7ZSMKe.js +275 -0
- package/lib/chunk-ICXQ74PX-VqT5WUTt.js +1330 -0
- package/lib/chunk-JWPE2WC7-Ch0jmUXM.js +8 -0
- package/lib/chunk-KEIR6QF5-RwFi50en.js +21456 -0
- package/lib/chunk-MOJQB5TN-rQ4AfTd9.js +490 -0
- package/lib/chunk-OGEWGWER-BvF6eV9Q.js +32 -0
- package/lib/chunk-PUDLZKDR-BW7SZvCB.js +4135 -0
- package/lib/chunk-Q4XR5HBZ-CRgGP3ez.js +1635 -0
- package/lib/chunk-RYQCIY6F-CHlASUpG.js +241 -0
- package/lib/chunk-V7JOEXUC-OY39ml6X.js +3357 -0
- package/lib/chunk-VR4S4FIN-Bk7IFdYB.js +26 -0
- package/lib/chunk-WYO6CB5R-MV-yOaop.js +3769 -0
- package/lib/chunk-XXDRQBXY-Djd1ChwJ.js +9 -0
- package/lib/chunk-Y2CYZVJY-QdJ4V9rh.js +12 -0
- package/lib/chunk-ZGVPDNZ5-l81xl1BI.js +3738 -0
- package/lib/classDiagram-OUVF2IWQ--wRzSvLt.js +30 -0
- package/lib/classDiagram-v2-EOCWNBFH-ChMCdPO-.js +30 -0
- package/lib/cose-bilkent-JH36ORCC-CyVZn5M3.js +2254 -0
- package/lib/custom-app-text-editor.css +2 -0
- package/lib/custom-app-text-editor.js +81102 -0
- package/lib/cynefin-VYW2F7L2-CMgnLl46.js +3 -0
- package/lib/cynefinDiagram-TSTJHNR4-988Y73wV.js +355 -0
- package/lib/cytoscape.esm-DMXbtFI-.js +18145 -0
- package/lib/dagre-Dmarb1s8.js +1699 -0
- package/lib/dagre-VKFMJZFB-Bf-pz2Lx.js +328 -0
- package/lib/defaultLocale-A87O3snN.js +198 -0
- package/lib/diagram-FQU43EPY-BT8WeVzc.js +432 -0
- package/lib/diagram-G47NLZAW-vZ2XG37l.js +527 -0
- package/lib/diagram-NH7WQ7WH-CH0IfHB0.js +134 -0
- package/lib/diagram-OA4YK3LP-BgwQcJfp.js +300 -0
- package/lib/diagram-WEI45ONY-Cd3sVPil.js +214 -0
- package/lib/dist-PGS6ynRO.js +59 -0
- package/lib/ebnfDiagram-CCIWWBDH-CwBFb2Fm.js +100 -0
- package/lib/erDiagram-Q63AITRT-BshRACvj.js +1727 -0
- package/lib/eventmodeling-45OFAUF4-BDhzj03B.js +3 -0
- package/lib/flowDiagram-23GEKE2U-C3zDgFvZ.js +16 -0
- package/lib/ganttDiagram-NO4QXBWP-BD5PiE8x.js +3073 -0
- package/lib/gitGraph-TEB2WS4Q-DJA_hE4G.js +3 -0
- package/lib/gitGraphDiagram-IHSO6WYX-BAhccBh3.js +733 -0
- package/lib/graphlib-DglfpsVp.js +1267 -0
- package/lib/index.browser-Dv9K8IAp.js +26 -0
- package/lib/info-DKCQHKI2-BD_vOCz6.js +3 -0
- package/lib/infoDiagram-FWYZ7A6U-CGZnf03G.js +20 -0
- package/lib/init-sjaVZO3f.js +13 -0
- package/lib/ishikawaDiagram-FXEZZL3T-PFfVM0NO.js +719 -0
- package/lib/journeyDiagram-5HDEW3XC-CRGz7dcx.js +884 -0
- package/lib/kanban-definition-HUTT4EX6-BBH4Yn5e.js +974 -0
- package/lib/line-CJQicKfr.js +34 -0
- package/lib/linear-B9Cv96-J.js +288 -0
- package/lib/map-C7KALUOH.js +241 -0
- package/lib/mermaid-parser.core-BupC9XGF.js +638 -0
- package/lib/mermaid-renderer-Cp0xusfR.js +2425 -0
- package/lib/mindmap-definition-LN4V7U3C-CWL1sg0K.js +978 -0
- package/lib/ordinal-CNQzPcrr.js +65 -0
- package/lib/packet-7NZHBO7P-CgBlALV1.js +3 -0
- package/lib/path-DVvH25eQ.js +84 -0
- package/lib/pegDiagram-2B236MQR-BKv8dTtv.js +94 -0
- package/lib/pie-RZYD4A2V-CryPC-P_.js +3 -0
- package/lib/pieDiagram-ENE6RG2P-CXeFg_cL.js +203 -0
- package/lib/quadrantDiagram-ABIIQ3AL-v_u3aC8Y.js +2001 -0
- package/lib/radar-I7S5WNFK-DgzJDRy3.js +3 -0
- package/lib/railroad-3IZDKUUU-DFp3mbpB.js +3 -0
- package/lib/railroad-abnf-AHOZXSZD-BRjidKH0.js +3 -0
- package/lib/railroad-ebnf-EBAXGLYW-PgrDWact.js +3 -0
- package/lib/railroad-peg-LSFZ7HO6-CMKir81Y.js +3 -0
- package/lib/railroadDiagram-RFXS5EU6-mEC9tVS-.js +76 -0
- package/lib/requirementDiagram-TGXJPOKE-BAEzI7V4.js +2223 -0
- package/lib/rolldown-runtime-DArdT4gl.js +23 -0
- package/lib/rough.esm-B2w_aYoc.js +1361 -0
- package/lib/sankeyDiagram-HTMAVEWB-Dbu-sl2E.js +972 -0
- package/lib/sequenceDiagram-DBY2YBRQ-DCuWmWHX.js +4156 -0
- package/lib/sizeCapture-X5ZJPWSS-BEIM84He.js +46 -0
- package/lib/src-DQbL46sB.js +2139 -0
- package/lib/src-DuuHKEe6.js +704 -0
- package/lib/stateDiagram-2N3HPSRC-fs9QmDMR.js +220 -0
- package/lib/stateDiagram-v2-6OUMAXLB-wWxYbttN.js +30 -0
- package/lib/swimlanes-5IMT3BWC-QaXUd9db.js +5069 -0
- package/lib/swimlanesDiagram-G3AALYLV-BtGToCzH.js +30 -0
- package/lib/timeline-definition-FHXFAJF6-CAsyJrsw.js +1069 -0
- package/lib/treeView-QDETBFTQ-DVp4aTZQ.js +3 -0
- package/lib/treemap-6X3UGDF4-BbBnHMHJ.js +3 -0
- package/lib/types.d.ts +44 -0
- package/lib/v4-CZv9Hsqq.js +33 -0
- package/lib/vennDiagram-L72KCM5P-C87u0gjr.js +1880 -0
- package/lib/wardley-OPB4EBWU-B-RXhnoN.js +3 -0
- package/lib/wardleyDiagram-EHGQE667-BxviBDl_.js +645 -0
- package/lib/xychartDiagram-FW5EYKEG-BQQhanuH.js +2098 -0
- package/package.json +29 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { n as e } from "./mermaid-parser.core-BupC9XGF.js";
|
|
2
|
+
import { n as t } from "./chunk-Y2CYZVJY-QdJ4V9rh.js";
|
|
3
|
+
import { m as n } from "./src-DQbL46sB.js";
|
|
4
|
+
import { H as r, K as i, U as a, a as o, b as s, c, f as l, v as u, w as d, y as f, z as p } from "./chunk-WYO6CB5R-MV-yOaop.js";
|
|
5
|
+
import { i as m } from "./chunk-ICXQ74PX-VqT5WUTt.js";
|
|
6
|
+
import { t as h } from "./chunk-JWPE2WC7-Ch0jmUXM.js";
|
|
7
|
+
import { r as g, t as _ } from "./chunk-HOUHSVGY-Br7ZSMKe.js";
|
|
8
|
+
import { t as v } from "./chunk-2Q5K7J3B-CINvUK-A.js";
|
|
9
|
+
import { a as y } from "./mermaid-renderer-Cp0xusfR.js";
|
|
10
|
+
//#region ../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OA4YK3LP.mjs
|
|
11
|
+
var b = /[─━│┃└┗├┣]/, x = /[└┗├┣]/, S = /[─━]/, C = /^[\s│┃]+$/, w = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/, T = /^\s*%%/, E = " ";
|
|
12
|
+
function D(e) {
|
|
13
|
+
return e.some((e) => b.test(e));
|
|
14
|
+
}
|
|
15
|
+
t(D, "isBoxDrawingFormat");
|
|
16
|
+
function O(e) {
|
|
17
|
+
for (let t of e) {
|
|
18
|
+
let e = x.exec(t);
|
|
19
|
+
if (e?.index && e.index > 0) return e.index;
|
|
20
|
+
}
|
|
21
|
+
return 4;
|
|
22
|
+
}
|
|
23
|
+
t(O, "inferSegmentWidth");
|
|
24
|
+
function k(e, t) {
|
|
25
|
+
return e.replace(/\bline\s+(\d+)\b/gi, (e, n) => {
|
|
26
|
+
let r = parseInt(n, 10), i = t.get(r);
|
|
27
|
+
return i ? `line ${i}` : e;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
t(k, "remapErrorLines");
|
|
31
|
+
function A(e) {
|
|
32
|
+
let t = e.split("\n"), n = /* @__PURE__ */ new Map(), r = -1;
|
|
33
|
+
for (let [e, n] of t.entries()) if (n.trim() === "treeView-beta") {
|
|
34
|
+
r = e;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
if (r === -1) return {
|
|
38
|
+
text: e,
|
|
39
|
+
lineMap: n
|
|
40
|
+
};
|
|
41
|
+
let i = [];
|
|
42
|
+
for (let e = r + 1; e < t.length; e++) {
|
|
43
|
+
let n = t[e];
|
|
44
|
+
n.trim() === "" || T.test(n) || w.test(n) || C.test(n) || i.push(n.replace(/\t/g, " "));
|
|
45
|
+
}
|
|
46
|
+
if (!D(i)) return {
|
|
47
|
+
text: e,
|
|
48
|
+
lineMap: n
|
|
49
|
+
};
|
|
50
|
+
let a = O(i), o = [], s = 0;
|
|
51
|
+
for (let e = 0; e <= r; e++) o.push(t[e]), s++, n.set(s, e + 1);
|
|
52
|
+
for (let e = r + 1; e < t.length; e++) {
|
|
53
|
+
let r = t[e], i = r.trim(), c = e + 1;
|
|
54
|
+
if (i === "") {
|
|
55
|
+
o.push(r), s++, n.set(s, c);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (T.test(r)) {
|
|
59
|
+
o.push(r), s++, n.set(s, c);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (w.test(r)) {
|
|
63
|
+
o.push(r), s++, n.set(s, c);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (C.test(r)) continue;
|
|
67
|
+
let l = r.replace(/\t/g, " "), u = x.exec(l);
|
|
68
|
+
if (u?.index !== void 0) {
|
|
69
|
+
let e = u.index, t = Math.round(e / a) + 1, r = e + 1;
|
|
70
|
+
for (; r < l.length && S.test(l[r]);) r++;
|
|
71
|
+
for (; r < l.length && l[r] === " ";) r++;
|
|
72
|
+
let i = l.slice(r).trimEnd();
|
|
73
|
+
if (!i) throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);
|
|
74
|
+
let d = E.repeat(t);
|
|
75
|
+
o.push(d + i), s++, n.set(s, c);
|
|
76
|
+
} else if (/^[\s─━│┃└┗├┣]+$/.test(l)) continue;
|
|
77
|
+
else if (b.test(l)) o.push(r), s++, n.set(s, c);
|
|
78
|
+
else if (/^\s+/.test(l)) throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);
|
|
79
|
+
else o.push(r), s++, n.set(s, c);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
text: o.join("\n"),
|
|
83
|
+
lineMap: n
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
t(A, "preprocessBoxDrawing");
|
|
87
|
+
var j = new v(() => ({
|
|
88
|
+
cnt: 1,
|
|
89
|
+
stack: [{
|
|
90
|
+
id: 0,
|
|
91
|
+
level: -1,
|
|
92
|
+
name: "/",
|
|
93
|
+
nodeType: "directory",
|
|
94
|
+
children: []
|
|
95
|
+
}]
|
|
96
|
+
})), M = /* @__PURE__ */ t(() => {
|
|
97
|
+
j.reset(), o();
|
|
98
|
+
}, "clear"), N = /* @__PURE__ */ t(() => j.records.stack[0], "getRoot"), P = /* @__PURE__ */ t(() => j.records.cnt, "getCount"), F = l.treeView, I = {
|
|
99
|
+
clear: M,
|
|
100
|
+
addNode: /* @__PURE__ */ t((e, t, n, r, i, a) => {
|
|
101
|
+
for (; e <= j.records.stack[j.records.stack.length - 1].level;) j.records.stack.pop();
|
|
102
|
+
let o = {
|
|
103
|
+
id: j.records.cnt++,
|
|
104
|
+
level: e,
|
|
105
|
+
name: t,
|
|
106
|
+
nodeType: n,
|
|
107
|
+
icon: i,
|
|
108
|
+
cssClass: r,
|
|
109
|
+
description: a,
|
|
110
|
+
children: []
|
|
111
|
+
};
|
|
112
|
+
j.records.stack[j.records.stack.length - 1].children.push(o), j.records.stack.push(o);
|
|
113
|
+
}, "addNode"),
|
|
114
|
+
getRoot: N,
|
|
115
|
+
getCount: P,
|
|
116
|
+
getConfig: /* @__PURE__ */ t(() => m(F, s().treeView), "getConfig"),
|
|
117
|
+
getAccTitle: f,
|
|
118
|
+
getAccDescription: u,
|
|
119
|
+
getDiagramTitle: d,
|
|
120
|
+
setAccDescription: r,
|
|
121
|
+
setAccTitle: a,
|
|
122
|
+
setDiagramTitle: i
|
|
123
|
+
}, L = /* @__PURE__ */ t((e) => {
|
|
124
|
+
h(e, I);
|
|
125
|
+
for (let t of e.nodes) {
|
|
126
|
+
let e = typeof t.indent == "number" ? t.indent : 0, n = t.name, r = n.endsWith("/");
|
|
127
|
+
r && (n = n.slice(0, -1));
|
|
128
|
+
let i = r ? "directory" : "file", a = t.classAnnotation || void 0, o = t.iconAnnotation, c = o === void 0 ? void 0 : o || "none", l = t.descAnnotation || void 0, u = l ? p(l, s()) : void 0;
|
|
129
|
+
I.addNode(e, n, i, a, c, u);
|
|
130
|
+
}
|
|
131
|
+
}, "populate"), R = { parse: /* @__PURE__ */ t(async (t) => {
|
|
132
|
+
let { text: r, lineMap: i } = A(t);
|
|
133
|
+
try {
|
|
134
|
+
let t = await e("treeView", r);
|
|
135
|
+
n.debug(t), L(t);
|
|
136
|
+
} catch (e) {
|
|
137
|
+
throw i.size > 0 && e instanceof Error && (e.message = k(e.message, i)), e;
|
|
138
|
+
}
|
|
139
|
+
}, "parse") }, z = {
|
|
140
|
+
prefix: "mermaid-treeview",
|
|
141
|
+
height: 24,
|
|
142
|
+
width: 24,
|
|
143
|
+
icons: {
|
|
144
|
+
folder: { body: "<path fill=\"currentColor\" d=\"M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z\"/>" },
|
|
145
|
+
file: { body: "<path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z\" clip-rule=\"evenodd\"/>" }
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
function B(e, t) {
|
|
149
|
+
let n = t?.filenameIcons?.[e];
|
|
150
|
+
if (n) return n;
|
|
151
|
+
let r = e.lastIndexOf(".");
|
|
152
|
+
if (r > 0) {
|
|
153
|
+
let n = e.substring(r).toLowerCase(), i = t?.extensionIcons;
|
|
154
|
+
return i?.[n] ?? i?.[n.slice(1)];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
t(B, "detectIcon");
|
|
158
|
+
function V(e, t) {
|
|
159
|
+
return e.includes(":") ? e : e in z.icons || !t ? `${z.prefix}:${e}` : `${t}:${e}`;
|
|
160
|
+
}
|
|
161
|
+
t(V, "qualifyIcon");
|
|
162
|
+
function H(e, t) {
|
|
163
|
+
if (e.icon !== "none") {
|
|
164
|
+
if (e.icon) return V(e.icon, t.defaultIconPack);
|
|
165
|
+
if (t.showIcons) {
|
|
166
|
+
if (e.nodeType === "file") {
|
|
167
|
+
let n = B(e.name, t);
|
|
168
|
+
if (n === "none") return;
|
|
169
|
+
if (n) return V(n, t.defaultIconPack);
|
|
170
|
+
}
|
|
171
|
+
return `${z.prefix}:${e.nodeType === "directory" ? "folder" : "file"}`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
t(H, "getNodeIcon"), g([{
|
|
176
|
+
name: z.prefix,
|
|
177
|
+
icons: z
|
|
178
|
+
}]);
|
|
179
|
+
var U = 14, W = 4, G = 16, K = /* @__PURE__ */ t((e, t) => `tv-icon-${e}-${t.replace(/[^\w-]/g, "-")}`, "iconSymbolId"), q = /* @__PURE__ */ t(async (e, n, r, i) => {
|
|
180
|
+
let a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ t((e) => {
|
|
181
|
+
let t = H(e, r);
|
|
182
|
+
t && a.add(t), e.children.forEach(o);
|
|
183
|
+
}, "collect");
|
|
184
|
+
if (o(n), a.size === 0) return;
|
|
185
|
+
let s = await Promise.all([...a].map(async (e) => ({
|
|
186
|
+
icon: e,
|
|
187
|
+
svg: await _(e, {
|
|
188
|
+
height: U,
|
|
189
|
+
width: U
|
|
190
|
+
})
|
|
191
|
+
}))), c = e.append("defs");
|
|
192
|
+
for (let { icon: e, svg: t } of s) c.append("g").attr("id", K(i, e)).html(t);
|
|
193
|
+
}, "injectIconDefs"), J = /* @__PURE__ */ t((e, t, n, r, i, a) => {
|
|
194
|
+
let o = r.append("g"), s = "treeView-node-label";
|
|
195
|
+
n.nodeType === "directory" && (s += " treeView-node-dir"), n.cssClass && (s += ` ${n.cssClass}`);
|
|
196
|
+
let c = U + W, l = H(n, i), u = l !== void 0;
|
|
197
|
+
l && o.append("use").attr("xlink:href", `#${K(a, l)}`).attr("x", e + i.paddingX).attr("y", t + i.paddingY).attr("class", "treeView-node-icon");
|
|
198
|
+
let d = o.append("text").text(n.name).attr("dominant-baseline", "middle").attr("class", s), { height: f, width: p } = d.node().getBBox(), m = f + i.paddingY * 2, h = e + i.paddingX + (u ? c : 0);
|
|
199
|
+
d.attr("x", h), d.attr("y", t + m / 2);
|
|
200
|
+
let g = h + p;
|
|
201
|
+
return n.BBox = {
|
|
202
|
+
x: e,
|
|
203
|
+
y: t,
|
|
204
|
+
width: p + i.paddingX * 2 + (u ? c : 0),
|
|
205
|
+
height: m
|
|
206
|
+
}, n.cssClass?.split(/\s+/).includes("highlight") && o.insert("rect", ":first-child").attr("x", e).attr("y", t + 1).attr("width", 0).attr("height", m - 2).attr("rx", 3).attr("class", "treeView-highlight-bg"), {
|
|
207
|
+
node: n,
|
|
208
|
+
nodeGroup: o,
|
|
209
|
+
labelRightEdge: g,
|
|
210
|
+
centerY: t + m / 2
|
|
211
|
+
};
|
|
212
|
+
}, "positionLabel"), Y = /* @__PURE__ */ t((e, t, n, r, i, a) => e.append("line").attr("x1", t).attr("y1", n).attr("x2", r).attr("y2", i).attr("stroke-width", a).attr("class", "treeView-node-line"), "positionLine"), X = /* @__PURE__ */ t((e, n, r, i) => {
|
|
213
|
+
let a = 0, o = 0, s = [], c = /* @__PURE__ */ t((e, t, n, r) => {
|
|
214
|
+
let c = r * (n.rowIndent + n.paddingX), l = J(c, a, t, e, n, i);
|
|
215
|
+
s.push(l);
|
|
216
|
+
let { height: u, width: d } = t.BBox;
|
|
217
|
+
Y(e, c - n.rowIndent, a + u / 2, c, a + u / 2, n.lineThickness), o = Math.max(o, c + d), a += u;
|
|
218
|
+
}, "drawNode"), l = /* @__PURE__ */ t((t, n = 0) => {
|
|
219
|
+
c(e, t, r, n), t.children.forEach((e) => {
|
|
220
|
+
l(e, n + 1);
|
|
221
|
+
});
|
|
222
|
+
let { x: i, y: a, height: o } = t.BBox;
|
|
223
|
+
if (t.children.length) {
|
|
224
|
+
let { y: n, height: s } = t.children[t.children.length - 1].BBox;
|
|
225
|
+
Y(e, i + r.paddingX, a + o, i + r.paddingX, n + s / 2 + r.lineThickness / 2, r.lineThickness);
|
|
226
|
+
}
|
|
227
|
+
}, "processNode");
|
|
228
|
+
l(n);
|
|
229
|
+
let u = s.filter((e) => e.node.description);
|
|
230
|
+
if (u.length > 0) {
|
|
231
|
+
let e = Math.max(...s.map((e) => e.labelRightEdge)) + G;
|
|
232
|
+
for (let t of u) {
|
|
233
|
+
let n = t.nodeGroup.append("text").text(t.node.description).attr("dominant-baseline", "middle").attr("class", "treeView-node-description").attr("x", e).attr("y", t.centerY).node().getBBox();
|
|
234
|
+
o = Math.max(o, e + n.width + r.paddingX);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
for (let e of s) if (e.node.cssClass?.split(/\s+/).includes("highlight")) {
|
|
238
|
+
let t = e.nodeGroup.select(".treeView-highlight-bg");
|
|
239
|
+
if (!t.empty()) {
|
|
240
|
+
let n = o - e.node.BBox.x + 8;
|
|
241
|
+
t.attr("width", n), o = Math.max(o, e.node.BBox.x + n + 2);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
totalHeight: a,
|
|
246
|
+
totalWidth: o
|
|
247
|
+
};
|
|
248
|
+
}, "drawTree"), Z = { draw: /* @__PURE__ */ t(async (e, t, r, i) => {
|
|
249
|
+
n.debug("Rendering treeView diagram\n" + e);
|
|
250
|
+
let a = i.db, o = a.getRoot(), s = a.getConfig(), l = y(t);
|
|
251
|
+
await q(l, o, s, t);
|
|
252
|
+
let u = l.append("g");
|
|
253
|
+
u.attr("class", "tree-view");
|
|
254
|
+
let { totalHeight: d, totalWidth: f } = X(u, o, s, t);
|
|
255
|
+
l.attr("viewBox", `-${s.lineThickness / 2} 0 ${f} ${d}`), c(l, d, f, s.useMaxWidth);
|
|
256
|
+
}, "draw") }, Q = {
|
|
257
|
+
labelFontSize: "16px",
|
|
258
|
+
labelColor: "black",
|
|
259
|
+
lineColor: "black",
|
|
260
|
+
iconColor: "#546e7a",
|
|
261
|
+
descriptionColor: "#6a9955",
|
|
262
|
+
highlightBg: "rgba(255, 193, 7, 0.15)",
|
|
263
|
+
highlightStroke: "#ffc107"
|
|
264
|
+
}, $ = {
|
|
265
|
+
db: I,
|
|
266
|
+
renderer: Z,
|
|
267
|
+
parser: R,
|
|
268
|
+
styles: /* @__PURE__ */ t(({ treeView: e }) => {
|
|
269
|
+
let { labelFontSize: t, labelColor: n, lineColor: r, iconColor: i, descriptionColor: a, highlightBg: o, highlightStroke: s } = m(Q, e);
|
|
270
|
+
return `
|
|
271
|
+
.treeView-node-label {
|
|
272
|
+
font-size: ${t};
|
|
273
|
+
fill: ${n};
|
|
274
|
+
white-space: pre;
|
|
275
|
+
}
|
|
276
|
+
.treeView-node-dir {
|
|
277
|
+
font-weight: bold;
|
|
278
|
+
}
|
|
279
|
+
.treeView-node-line {
|
|
280
|
+
stroke: ${r};
|
|
281
|
+
}
|
|
282
|
+
.treeView-node-icon {
|
|
283
|
+
color: ${i};
|
|
284
|
+
}
|
|
285
|
+
.treeView-node-description {
|
|
286
|
+
font-size: ${t};
|
|
287
|
+
fill: ${a};
|
|
288
|
+
font-style: italic;
|
|
289
|
+
white-space: pre;
|
|
290
|
+
}
|
|
291
|
+
.treeView-highlight-bg {
|
|
292
|
+
fill: ${o};
|
|
293
|
+
stroke: ${s};
|
|
294
|
+
stroke-width: 1;
|
|
295
|
+
}
|
|
296
|
+
`;
|
|
297
|
+
}, "styles")
|
|
298
|
+
};
|
|
299
|
+
//#endregion
|
|
300
|
+
export { $ as diagram };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { n as e } from "./mermaid-parser.core-BupC9XGF.js";
|
|
2
|
+
import { n as t } from "./chunk-Y2CYZVJY-QdJ4V9rh.js";
|
|
3
|
+
import { m as n } from "./src-DQbL46sB.js";
|
|
4
|
+
import { D as r, H as i, K as a, U as o, a as s, b as c, c as l, f as u, v as d, w as f, y as p } from "./chunk-WYO6CB5R-MV-yOaop.js";
|
|
5
|
+
import { i as m } from "./chunk-ICXQ74PX-VqT5WUTt.js";
|
|
6
|
+
import { t as h } from "./chunk-JWPE2WC7-Ch0jmUXM.js";
|
|
7
|
+
import { a as g } from "./mermaid-renderer-Cp0xusfR.js";
|
|
8
|
+
//#region ../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-WEI45ONY.mjs
|
|
9
|
+
var _ = {
|
|
10
|
+
showLegend: !0,
|
|
11
|
+
ticks: 5,
|
|
12
|
+
max: null,
|
|
13
|
+
min: 0,
|
|
14
|
+
graticule: "circle"
|
|
15
|
+
}, v = {
|
|
16
|
+
axes: [],
|
|
17
|
+
curves: [],
|
|
18
|
+
options: _
|
|
19
|
+
}, y = structuredClone(v), b = u.radar, x = /* @__PURE__ */ t(() => m({
|
|
20
|
+
...b,
|
|
21
|
+
...c().radar
|
|
22
|
+
}), "getConfig"), S = /* @__PURE__ */ t(() => y.axes, "getAxes"), C = /* @__PURE__ */ t(() => y.curves, "getCurves"), w = /* @__PURE__ */ t(() => y.options, "getOptions"), T = /* @__PURE__ */ t((e) => {
|
|
23
|
+
y.axes = e.map((e) => ({
|
|
24
|
+
name: e.name,
|
|
25
|
+
label: e.label ?? e.name
|
|
26
|
+
}));
|
|
27
|
+
}, "setAxes"), E = /* @__PURE__ */ t((e) => {
|
|
28
|
+
y.curves = e.map((e) => ({
|
|
29
|
+
name: e.name,
|
|
30
|
+
label: e.label ?? e.name,
|
|
31
|
+
entries: D(e.entries)
|
|
32
|
+
}));
|
|
33
|
+
}, "setCurves"), D = /* @__PURE__ */ t((e) => {
|
|
34
|
+
if (e[0].axis == null) return e.map((e) => e.value);
|
|
35
|
+
let t = S();
|
|
36
|
+
if (t.length === 0) throw Error("Axes must be populated before curves for reference entries");
|
|
37
|
+
return t.map((t) => {
|
|
38
|
+
let n = e.find((e) => e.axis?.$refText === t.name);
|
|
39
|
+
if (n === void 0) throw Error("Missing entry for axis " + t.label);
|
|
40
|
+
return n.value;
|
|
41
|
+
});
|
|
42
|
+
}, "computeCurveEntries"), O = {
|
|
43
|
+
getAxes: S,
|
|
44
|
+
getCurves: C,
|
|
45
|
+
getOptions: w,
|
|
46
|
+
setAxes: T,
|
|
47
|
+
setCurves: E,
|
|
48
|
+
setOptions: /* @__PURE__ */ t((e) => {
|
|
49
|
+
let t = e.reduce((e, t) => (e[t.name] = t, e), {});
|
|
50
|
+
y.options = {
|
|
51
|
+
showLegend: t.showLegend?.value ?? _.showLegend,
|
|
52
|
+
ticks: t.ticks?.value ?? _.ticks,
|
|
53
|
+
max: t.max?.value ?? _.max,
|
|
54
|
+
min: t.min?.value ?? _.min,
|
|
55
|
+
graticule: t.graticule?.value ?? _.graticule
|
|
56
|
+
};
|
|
57
|
+
}, "setOptions"),
|
|
58
|
+
getConfig: x,
|
|
59
|
+
clear: /* @__PURE__ */ t(() => {
|
|
60
|
+
s(), y = structuredClone(v);
|
|
61
|
+
}, "clear"),
|
|
62
|
+
setAccTitle: o,
|
|
63
|
+
getAccTitle: p,
|
|
64
|
+
setDiagramTitle: a,
|
|
65
|
+
getDiagramTitle: f,
|
|
66
|
+
getAccDescription: d,
|
|
67
|
+
setAccDescription: i
|
|
68
|
+
}, k = /* @__PURE__ */ t((e) => {
|
|
69
|
+
h(e, O);
|
|
70
|
+
let { axes: t, curves: n, options: r } = e;
|
|
71
|
+
O.setAxes(t), O.setCurves(n), O.setOptions(r);
|
|
72
|
+
}, "populate"), A = { parse: /* @__PURE__ */ t(async (t) => {
|
|
73
|
+
let r = await e("radar", t);
|
|
74
|
+
n.debug(r), k(r);
|
|
75
|
+
}, "parse") }, j = /* @__PURE__ */ t((e, t, n, r) => {
|
|
76
|
+
let i = r.db, a = i.getAxes(), o = i.getCurves(), s = i.getOptions(), c = i.getConfig(), l = i.getDiagramTitle(), u = M(g(t), c), d = s.max ?? Math.max(...o.map((e) => Math.max(...e.entries))), f = s.min, p = Math.min(c.width, c.height) / 2;
|
|
77
|
+
N(u, a, p, s.ticks, s.graticule), P(u, a, p, c), F(u, a, o, f, d, s.graticule, c), R(u, o, s.showLegend, c), u.append("text").attr("class", "radarTitle").text(l).attr("x", 0).attr("y", -c.height / 2 - c.marginTop);
|
|
78
|
+
}, "draw"), M = /* @__PURE__ */ t((e, t) => {
|
|
79
|
+
let n = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, i = {
|
|
80
|
+
x: t.marginLeft + t.width / 2,
|
|
81
|
+
y: t.marginTop + t.height / 2
|
|
82
|
+
};
|
|
83
|
+
return l(e, r, n, t.useMaxWidth ?? !0), e.attr("viewBox", `0 0 ${n} ${r}`).attr("overflow", "visible"), e.append("g").attr("transform", `translate(${i.x}, ${i.y})`);
|
|
84
|
+
}, "drawFrame"), N = /* @__PURE__ */ t((e, t, n, r, i) => {
|
|
85
|
+
if (i === "circle") for (let t = 0; t < r; t++) {
|
|
86
|
+
let i = n * (t + 1) / r;
|
|
87
|
+
e.append("circle").attr("r", i).attr("class", "radarGraticule");
|
|
88
|
+
}
|
|
89
|
+
else if (i === "polygon") {
|
|
90
|
+
let i = t.length;
|
|
91
|
+
for (let a = 0; a < r; a++) {
|
|
92
|
+
let o = n * (a + 1) / r, s = t.map((e, t) => {
|
|
93
|
+
let n = 2 * t * Math.PI / i - Math.PI / 2;
|
|
94
|
+
return `${o * Math.cos(n)},${o * Math.sin(n)}`;
|
|
95
|
+
}).join(" ");
|
|
96
|
+
e.append("polygon").attr("points", s).attr("class", "radarGraticule");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, "drawGraticule"), P = /* @__PURE__ */ t((e, t, n, r) => {
|
|
100
|
+
let i = t.length;
|
|
101
|
+
for (let a = 0; a < i; a++) {
|
|
102
|
+
let o = t[a].label, s = 2 * a * Math.PI / i - Math.PI / 2, c = Math.cos(s), l = Math.sin(s);
|
|
103
|
+
e.append("line").attr("x1", 0).attr("y1", 0).attr("x2", n * r.axisScaleFactor * c).attr("y2", n * r.axisScaleFactor * l).attr("class", "radarAxisLine");
|
|
104
|
+
let u = c > .01 ? "start" : c < -.01 ? "end" : "middle", d = l > .01 ? "hanging" : l < -.01 ? "auto" : "central";
|
|
105
|
+
e.append("text").text(o).attr("x", n * r.axisLabelFactor * c + 4 * c).attr("y", n * r.axisLabelFactor * l + 4 * l).attr("text-anchor", u).attr("dominant-baseline", d).attr("class", "radarAxisLabel");
|
|
106
|
+
}
|
|
107
|
+
}, "drawAxes");
|
|
108
|
+
function F(e, t, n, r, i, a, o) {
|
|
109
|
+
let s = t.length, c = Math.min(o.width, o.height) / 2;
|
|
110
|
+
n.forEach((t, n) => {
|
|
111
|
+
if (t.entries.length !== s) return;
|
|
112
|
+
let l = t.entries.map((e, t) => {
|
|
113
|
+
let n = 2 * Math.PI * t / s - Math.PI / 2, a = I(e, r, i, c);
|
|
114
|
+
return {
|
|
115
|
+
x: a * Math.cos(n),
|
|
116
|
+
y: a * Math.sin(n)
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
a === "circle" ? e.append("path").attr("d", L(l, o.curveTension)).attr("class", `radarCurve-${n}`) : a === "polygon" && e.append("polygon").attr("points", l.map((e) => `${e.x},${e.y}`).join(" ")).attr("class", `radarCurve-${n}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
t(F, "drawCurves");
|
|
123
|
+
function I(e, t, n, r) {
|
|
124
|
+
return r * (Math.min(Math.max(e, t), n) - t) / (n - t);
|
|
125
|
+
}
|
|
126
|
+
t(I, "relativeRadius");
|
|
127
|
+
function L(e, t) {
|
|
128
|
+
let n = e.length, r = `M${e[0].x},${e[0].y}`;
|
|
129
|
+
for (let i = 0; i < n; i++) {
|
|
130
|
+
let a = e[(i - 1 + n) % n], o = e[i], s = e[(i + 1) % n], c = e[(i + 2) % n], l = {
|
|
131
|
+
x: o.x + (s.x - a.x) * t,
|
|
132
|
+
y: o.y + (s.y - a.y) * t
|
|
133
|
+
}, u = {
|
|
134
|
+
x: s.x - (c.x - o.x) * t,
|
|
135
|
+
y: s.y - (c.y - o.y) * t
|
|
136
|
+
};
|
|
137
|
+
r += ` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`;
|
|
138
|
+
}
|
|
139
|
+
return `${r} Z`;
|
|
140
|
+
}
|
|
141
|
+
t(L, "closedRoundCurve");
|
|
142
|
+
function R(e, t, n, r) {
|
|
143
|
+
if (!n) return;
|
|
144
|
+
let i = (r.width / 2 + r.marginRight) * 3 / 4, a = -(r.height / 2 + r.marginTop) * 3 / 4;
|
|
145
|
+
t.forEach((t, n) => {
|
|
146
|
+
let r = e.append("g").attr("transform", `translate(${i}, ${a + n * 20})`);
|
|
147
|
+
r.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${n}`), r.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(t.label);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
t(R, "drawLegend");
|
|
151
|
+
var z = { draw: j }, B = /* @__PURE__ */ t((e, t) => {
|
|
152
|
+
let n = "";
|
|
153
|
+
for (let r = 0; r < e.THEME_COLOR_LIMIT; r++) {
|
|
154
|
+
let i = e[`cScale${r}`];
|
|
155
|
+
n += `
|
|
156
|
+
.radarCurve-${r} {
|
|
157
|
+
color: ${i};
|
|
158
|
+
fill: ${i};
|
|
159
|
+
fill-opacity: ${t.curveOpacity};
|
|
160
|
+
stroke: ${i};
|
|
161
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
162
|
+
}
|
|
163
|
+
.radarLegendBox-${r} {
|
|
164
|
+
fill: ${i};
|
|
165
|
+
fill-opacity: ${t.curveOpacity};
|
|
166
|
+
stroke: ${i};
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
}
|
|
170
|
+
return n;
|
|
171
|
+
}, "genIndexStyles"), V = /* @__PURE__ */ t((e) => {
|
|
172
|
+
let t = r(), n = c(), i = m(t, n.themeVariables);
|
|
173
|
+
return {
|
|
174
|
+
themeVariables: i,
|
|
175
|
+
radarOptions: m(i.radar, e)
|
|
176
|
+
};
|
|
177
|
+
}, "buildRadarStyleOptions"), H = {
|
|
178
|
+
parser: A,
|
|
179
|
+
db: O,
|
|
180
|
+
renderer: z,
|
|
181
|
+
styles: /* @__PURE__ */ t(({ radar: e } = {}) => {
|
|
182
|
+
let { themeVariables: t, radarOptions: n } = V(e);
|
|
183
|
+
return `
|
|
184
|
+
.radarTitle {
|
|
185
|
+
font-size: ${t.fontSize};
|
|
186
|
+
color: ${t.titleColor};
|
|
187
|
+
dominant-baseline: hanging;
|
|
188
|
+
text-anchor: middle;
|
|
189
|
+
}
|
|
190
|
+
.radarAxisLine {
|
|
191
|
+
stroke: ${n.axisColor};
|
|
192
|
+
stroke-width: ${n.axisStrokeWidth};
|
|
193
|
+
}
|
|
194
|
+
.radarAxisLabel {
|
|
195
|
+
font-size: ${n.axisLabelFontSize}px;
|
|
196
|
+
color: ${n.axisColor};
|
|
197
|
+
}
|
|
198
|
+
.radarGraticule {
|
|
199
|
+
fill: ${n.graticuleColor};
|
|
200
|
+
fill-opacity: ${n.graticuleOpacity};
|
|
201
|
+
stroke: ${n.graticuleColor};
|
|
202
|
+
stroke-width: ${n.graticuleStrokeWidth};
|
|
203
|
+
}
|
|
204
|
+
.radarLegendText {
|
|
205
|
+
text-anchor: start;
|
|
206
|
+
font-size: ${n.legendFontSize}px;
|
|
207
|
+
dominant-baseline: hanging;
|
|
208
|
+
}
|
|
209
|
+
${B(t, n)}
|
|
210
|
+
`;
|
|
211
|
+
}, "styles")
|
|
212
|
+
};
|
|
213
|
+
//#endregion
|
|
214
|
+
export { H as diagram };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-DArdT4gl.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/math.js
|
|
3
|
+
var t = Math.abs, n = Math.atan2, r = Math.cos, i = Math.max, a = Math.min, o = Math.sin, s = Math.sqrt, c = 1e-12, l = Math.PI, u = l / 2, d = 2 * l;
|
|
4
|
+
function f(e) {
|
|
5
|
+
return e > 1 ? 0 : e < -1 ? l : Math.acos(e);
|
|
6
|
+
}
|
|
7
|
+
function p(e) {
|
|
8
|
+
return e >= 1 ? u : e <= -1 ? -u : Math.asin(e);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../../node_modules/.pnpm/@braintree+sanitize-url@7.1.2/node_modules/@braintree/sanitize-url/dist/constants.js
|
|
12
|
+
var m = /* @__PURE__ */ e(((e) => {
|
|
13
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.BLANK_URL = e.relativeFirstCharacters = e.whitespaceEscapeCharsRegex = e.urlSchemeRegex = e.ctrlCharactersRegex = e.htmlCtrlEntityRegex = e.htmlEntitiesRegex = e.invalidProtocolRegex = void 0, e.invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im, e.htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g, e.htmlCtrlEntityRegex = /&(newline|tab);/gi, e.ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, e.urlSchemeRegex = /^.+(:|:)/gim, e.whitespaceEscapeCharsRegex = /(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g, e.relativeFirstCharacters = [".", "/"], e.BLANK_URL = "about:blank";
|
|
14
|
+
})), h = /* @__PURE__ */ e(((e) => {
|
|
15
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.sanitizeUrl = o;
|
|
16
|
+
var t = m();
|
|
17
|
+
function n(e) {
|
|
18
|
+
return t.relativeFirstCharacters.indexOf(e[0]) > -1;
|
|
19
|
+
}
|
|
20
|
+
function r(e) {
|
|
21
|
+
return e.replace(t.ctrlCharactersRegex, "").replace(t.htmlEntitiesRegex, function(e, t) {
|
|
22
|
+
return String.fromCharCode(t);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function i(e) {
|
|
26
|
+
return URL.canParse(e);
|
|
27
|
+
}
|
|
28
|
+
function a(e) {
|
|
29
|
+
try {
|
|
30
|
+
return decodeURIComponent(e);
|
|
31
|
+
} catch {
|
|
32
|
+
return e;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function o(e) {
|
|
36
|
+
if (!e) return t.BLANK_URL;
|
|
37
|
+
var o, s = a(e.trim());
|
|
38
|
+
do
|
|
39
|
+
s = r(s).replace(t.htmlCtrlEntityRegex, "").replace(t.ctrlCharactersRegex, "").replace(t.whitespaceEscapeCharsRegex, "").trim(), s = a(s), o = s.match(t.ctrlCharactersRegex) || s.match(t.htmlEntitiesRegex) || s.match(t.htmlCtrlEntityRegex) || s.match(t.whitespaceEscapeCharsRegex);
|
|
40
|
+
while (o && o.length > 0);
|
|
41
|
+
var c = s;
|
|
42
|
+
if (!c) return t.BLANK_URL;
|
|
43
|
+
if (n(c)) return c;
|
|
44
|
+
var l = c.trimStart(), u = l.match(t.urlSchemeRegex);
|
|
45
|
+
if (!u) return c;
|
|
46
|
+
var d = u[0].toLowerCase().trim();
|
|
47
|
+
if (t.invalidProtocolRegex.test(d)) return t.BLANK_URL;
|
|
48
|
+
var f = l.replace(/\\/g, "/");
|
|
49
|
+
if (d === "mailto:" || d.includes("://")) return f;
|
|
50
|
+
if (d === "http:" || d === "https:") {
|
|
51
|
+
if (!i(f)) return t.BLANK_URL;
|
|
52
|
+
var p = new URL(f);
|
|
53
|
+
return p.protocol = p.protocol.toLowerCase(), p.hostname = p.hostname.toLowerCase(), p.toString();
|
|
54
|
+
}
|
|
55
|
+
return f;
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
//#endregion
|
|
59
|
+
export { n as a, u as c, l as d, o as f, p as i, i as l, d as m, t as n, r as o, s as p, f as r, c as s, h as t, a as u };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { f as e, t } from "./mermaid-parser.core-BupC9XGF.js";
|
|
2
|
+
import { n } from "./chunk-Y2CYZVJY-QdJ4V9rh.js";
|
|
3
|
+
import { m as r } from "./src-DQbL46sB.js";
|
|
4
|
+
import "./chunk-WYO6CB5R-MV-yOaop.js";
|
|
5
|
+
import { n as i, r as a, t as o } from "./chunk-MOJQB5TN-rQ4AfTd9.js";
|
|
6
|
+
import { t as s } from "./chunk-JWPE2WC7-Ch0jmUXM.js";
|
|
7
|
+
import "./mermaid-renderer-Cp0xusfR.js";
|
|
8
|
+
//#region ../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/ebnfDiagram-CCIWWBDH.mjs
|
|
9
|
+
var c = e().RailroadEbnf.parser.LangiumParser, l = /* @__PURE__ */ n((e) => {
|
|
10
|
+
let t = e.alternatives.map(u);
|
|
11
|
+
return t.length === 1 ? t[0] : {
|
|
12
|
+
type: "choice",
|
|
13
|
+
alternatives: t
|
|
14
|
+
};
|
|
15
|
+
}, "transformChoice"), u = /* @__PURE__ */ n((e) => {
|
|
16
|
+
let t = e.elements.map(p);
|
|
17
|
+
return t.length === 1 ? t[0] : {
|
|
18
|
+
type: "sequence",
|
|
19
|
+
elements: t
|
|
20
|
+
};
|
|
21
|
+
}, "transformSequence"), d = /* @__PURE__ */ n((e) => {
|
|
22
|
+
switch (e.$type) {
|
|
23
|
+
case "EbnfTerminal": return {
|
|
24
|
+
type: "terminal",
|
|
25
|
+
value: e.value
|
|
26
|
+
};
|
|
27
|
+
case "EbnfNonTerminal": return {
|
|
28
|
+
type: "nonterminal",
|
|
29
|
+
name: e.name
|
|
30
|
+
};
|
|
31
|
+
case "EbnfSpecial": return {
|
|
32
|
+
type: "special",
|
|
33
|
+
text: e.text
|
|
34
|
+
};
|
|
35
|
+
case "EbnfGroup": return l(e.element);
|
|
36
|
+
case "EbnfOptional": return {
|
|
37
|
+
type: "optional",
|
|
38
|
+
element: l(e.element)
|
|
39
|
+
};
|
|
40
|
+
case "EbnfRepetition": return {
|
|
41
|
+
type: "repetition",
|
|
42
|
+
element: l(e.element),
|
|
43
|
+
min: 0,
|
|
44
|
+
max: Infinity
|
|
45
|
+
};
|
|
46
|
+
default: throw Error(`Unsupported EBNF primary node: ${e.$type}`);
|
|
47
|
+
}
|
|
48
|
+
}, "transformPrimary"), f = /* @__PURE__ */ n((e, t) => {
|
|
49
|
+
switch (t.$type) {
|
|
50
|
+
case "EbnfOptionalPostfix": return {
|
|
51
|
+
type: "optional",
|
|
52
|
+
element: e
|
|
53
|
+
};
|
|
54
|
+
case "EbnfZeroOrMorePostfix": return {
|
|
55
|
+
type: "repetition",
|
|
56
|
+
element: e,
|
|
57
|
+
min: 0,
|
|
58
|
+
max: Infinity
|
|
59
|
+
};
|
|
60
|
+
case "EbnfOneOrMorePostfix": return {
|
|
61
|
+
type: "repetition",
|
|
62
|
+
element: e,
|
|
63
|
+
min: 1,
|
|
64
|
+
max: Infinity
|
|
65
|
+
};
|
|
66
|
+
case "EbnfExceptionPostfix": return {
|
|
67
|
+
type: "sequence",
|
|
68
|
+
elements: [
|
|
69
|
+
e,
|
|
70
|
+
{
|
|
71
|
+
type: "terminal",
|
|
72
|
+
value: "-"
|
|
73
|
+
},
|
|
74
|
+
d(t.except)
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
default: throw Error(`Unsupported EBNF postfix node: ${t.$type}`);
|
|
78
|
+
}
|
|
79
|
+
}, "transformPostfix"), p = /* @__PURE__ */ n((e) => e.postfixes.reduce((e, t) => f(e, t), d(e.base)), "transformTerm"), m = /* @__PURE__ */ n((e) => ({
|
|
80
|
+
name: e.name,
|
|
81
|
+
definition: l(e.definition)
|
|
82
|
+
}), "transformRule"), h = /* @__PURE__ */ n((e) => {
|
|
83
|
+
s(e, o), e.title && o.setTitle(e.title), e.rules.map((e) => o.addRule(m(e)));
|
|
84
|
+
}, "populateDb"), g = {
|
|
85
|
+
parser: {
|
|
86
|
+
parse: /* @__PURE__ */ n((e) => {
|
|
87
|
+
o.clear(), r.debug("[EBNF Parser] Starting Langium parse");
|
|
88
|
+
let n = c.parse(e);
|
|
89
|
+
if (n.lexerErrors.length > 0 || n.parserErrors.length > 0) throw new t(n);
|
|
90
|
+
let i = n.value;
|
|
91
|
+
r.debug("[EBNF Parser] Parsed rules:", i.rules.length), h(i), r.debug("[EBNF Parser] Parse complete");
|
|
92
|
+
}, "parse"),
|
|
93
|
+
parser: { yy: o }
|
|
94
|
+
},
|
|
95
|
+
db: o,
|
|
96
|
+
renderer: a,
|
|
97
|
+
styles: i
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { g as diagram };
|