@data_wise/hyper-markdown 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +201 -0
  3. package/dist/_basePickBy-CU9zxouA.js +151 -0
  4. package/dist/_baseUniq-Dfv1esQT.js +614 -0
  5. package/dist/arc-c3dke9_g.js +83 -0
  6. package/dist/architecture-U656AL7Q-zgUqrnAb.js +5 -0
  7. package/dist/architectureDiagram-VXUJARFQ-Dv4YjP5o.js +4665 -0
  8. package/dist/blockDiagram-VD42YOAC-D98UGbTn.js +2265 -0
  9. package/dist/c4Diagram-YG6GDRKO-XUzUdD_2.js +1581 -0
  10. package/dist/channel-C5xtftmJ.js +5 -0
  11. package/dist/chunk-4BX2VUAB-DEeESiZ5.js +9 -0
  12. package/dist/chunk-55IACEB6-DHxOGacI.js +8 -0
  13. package/dist/chunk-B4BG7PRW-8o0v-7qo.js +1376 -0
  14. package/dist/chunk-DI55MBZ5-DW3vqV--.js +1382 -0
  15. package/dist/chunk-FMBD7UC4-DDdtUAG0.js +19 -0
  16. package/dist/chunk-QN33PNHL-CSSbo0QX.js +20 -0
  17. package/dist/chunk-QZHKN3VN-w9zLiEAG.js +15 -0
  18. package/dist/chunk-TZMSLE5B-t-rP83k8.js +64 -0
  19. package/dist/classDiagram-2ON5EDUG-e9sZhnve.js +16 -0
  20. package/dist/classDiagram-v2-WZHVMYZB-e9sZhnve.js +16 -0
  21. package/dist/clone-DiTglB0h.js +8 -0
  22. package/dist/cose-bilkent-S5V4N54A-CWVtemhp.js +2605 -0
  23. package/dist/cytoscape.esm-ZmItrg9y.js +18731 -0
  24. package/dist/dagre-6UL2VRFP-MV2ZfZta.js +447 -0
  25. package/dist/defaultLocale-D7EN2tov.js +171 -0
  26. package/dist/diagram-PSM6KHXK-5lJpUCK9.js +534 -0
  27. package/dist/diagram-QEK2KX5R-CNU6jJsS.js +221 -0
  28. package/dist/diagram-S2PKOQOG-BKjk2v_A.js +143 -0
  29. package/dist/erDiagram-Q2GNP2WA-BtAVbAYU.js +842 -0
  30. package/dist/flowDiagram-NV44I4VS-DISVIV3t.js +1627 -0
  31. package/dist/ganttDiagram-LVOFAZNH-Ddt7ksjd.js +2499 -0
  32. package/dist/gitGraph-F6HP7TQM-BAIad0GA.js +5 -0
  33. package/dist/gitGraphDiagram-NY62KEGX-C-l5siHi.js +712 -0
  34. package/dist/graph-DoqhIGWS.js +247 -0
  35. package/dist/hyper-markdown.es.js +11 -0
  36. package/dist/hyper-markdown.umd.js +3180 -0
  37. package/dist/index-D8q1QLkY.js +139643 -0
  38. package/dist/info-NVLQJR56-temdJZnQ.js +5 -0
  39. package/dist/infoDiagram-ER5ION4S-CWrTqrrP.js +24 -0
  40. package/dist/init-DjUOC4st.js +16 -0
  41. package/dist/journeyDiagram-XKPGCS4Q-033aYkz7.js +836 -0
  42. package/dist/kanban-definition-3W4ZIXB7-Dz47qxF_.js +720 -0
  43. package/dist/katex-dDbcVckU.js +11687 -0
  44. package/dist/layout-DRpSHON1.js +1335 -0
  45. package/dist/linear-BO6pDEmK.js +259 -0
  46. package/dist/mermaid-parser.core-D_tMj5cA.js +12921 -0
  47. package/dist/mindmap-definition-VGOIOE7T-BsHgjAmS.js +786 -0
  48. package/dist/ordinal-DfAQgscy.js +61 -0
  49. package/dist/packet-BFZMPI3H-Bzlf_wLW.js +5 -0
  50. package/dist/pie-7BOR55EZ-Czidi0ky.js +5 -0
  51. package/dist/pieDiagram-ADFJNKIX-CSpQeOry.js +161 -0
  52. package/dist/quadrantDiagram-AYHSOK5B-flM7H9xo.js +1024 -0
  53. package/dist/radar-NHE76QYJ-D1f__eiC.js +5 -0
  54. package/dist/requirementDiagram-UZGBJVZJ-1iG0LrwF.js +852 -0
  55. package/dist/sankeyDiagram-TZEHDZUN-0SClKoX9.js +810 -0
  56. package/dist/sequenceDiagram-WL72ISMW-Bwbc6j-1.js +2518 -0
  57. package/dist/stateDiagram-FKZM4ZOC-BuNY3ZqE.js +263 -0
  58. package/dist/stateDiagram-v2-4FDKWEC3-CB1nMpEc.js +16 -0
  59. package/dist/style.css +10 -0
  60. package/dist/timeline-definition-IT6M3QCI-CjFYKVsS.js +801 -0
  61. package/dist/treemap-KMMF4GRG-Cs8Vv-VD.js +5 -0
  62. package/dist/xychartDiagram-PRI3JC2R-B6hpuUj2.js +1340 -0
  63. package/package.json +70 -0
  64. package/types/index.d.ts +34 -0
@@ -0,0 +1,447 @@
1
+ import { _ as X, ar as F, as as Y, at as _, au as H, l as i, c as V, av as z, aw as U, ag as $, al as q, ah as P, af as K, ax as Q, ay as W, az as Z } from "./index-D8q1QLkY.js";
2
+ import { G as B } from "./graph-DoqhIGWS.js";
3
+ import { l as I } from "./layout-DRpSHON1.js";
4
+ import { i as x } from "./_baseUniq-Dfv1esQT.js";
5
+ import { c as L } from "./clone-DiTglB0h.js";
6
+ import { m as A } from "./_basePickBy-CU9zxouA.js";
7
+ function p(e) {
8
+ var t = {
9
+ options: {
10
+ directed: e.isDirected(),
11
+ multigraph: e.isMultigraph(),
12
+ compound: e.isCompound()
13
+ },
14
+ nodes: ee(e),
15
+ edges: ne(e)
16
+ };
17
+ return x(e.graph()) || (t.value = L(e.graph())), t;
18
+ }
19
+ function ee(e) {
20
+ return A(e.nodes(), function(t) {
21
+ var n = e.node(t), o = e.parent(t), c = { v: t };
22
+ return x(n) || (c.value = n), x(o) || (c.parent = o), c;
23
+ });
24
+ }
25
+ function ne(e) {
26
+ return A(e.edges(), function(t) {
27
+ var n = e.edge(t), o = { v: t.v, w: t.w };
28
+ return x(t.name) || (o.name = t.name), x(n) || (o.value = n), o;
29
+ });
30
+ }
31
+ var f = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ X(() => {
32
+ b.clear(), J.clear(), f.clear();
33
+ }, "clear"), O = /* @__PURE__ */ X((e, t) => {
34
+ const n = b.get(t) || [];
35
+ return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
36
+ }, "isDescendant"), se = /* @__PURE__ */ X((e, t) => {
37
+ const n = b.get(t) || [];
38
+ return i.info("Descendants of ", t, " is ", n), i.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || O(e.v, t) || O(e.w, t) || n.includes(e.w) : (i.debug("Tilt, ", t, ",not in descendants"), !1);
39
+ }, "edgeInCluster"), G = /* @__PURE__ */ X((e, t, n, o) => {
40
+ i.warn(
41
+ "Copying children of ",
42
+ e,
43
+ "root",
44
+ o,
45
+ "data",
46
+ t.node(e),
47
+ o
48
+ );
49
+ const c = t.children(e) || [];
50
+ e !== o && c.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", c), c.forEach((a) => {
51
+ if (t.children(a).length > 0)
52
+ G(a, t, n, o);
53
+ else {
54
+ const r = t.node(a);
55
+ i.info("cp ", a, " to ", o, " with parent ", e), n.setNode(a, r), o !== t.parent(a) && (i.warn("Setting parent", a, t.parent(a)), n.setParent(a, t.parent(a))), e !== o && a !== e ? (i.debug("Setting parent", a, e), n.setParent(a, e)) : (i.info("In copy ", e, "root", o, "data", t.node(e), o), i.debug(
56
+ "Not Setting parent for node=",
57
+ a,
58
+ "cluster!==rootId",
59
+ e !== o,
60
+ "node!==clusterId",
61
+ a !== e
62
+ ));
63
+ const u = t.edges(a);
64
+ i.debug("Copying Edges", u), u.forEach((l) => {
65
+ i.info("Edge", l);
66
+ const v = t.edge(l.v, l.w, l.name);
67
+ i.info("Edge data", v, o);
68
+ try {
69
+ se(l, o) ? (i.info("Copying as ", l.v, l.w, v, l.name), n.setEdge(l.v, l.w, v, l.name), i.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : i.info(
70
+ "Skipping copy of edge ",
71
+ l.v,
72
+ "-->",
73
+ l.w,
74
+ " rootId: ",
75
+ o,
76
+ " clusterId:",
77
+ e
78
+ );
79
+ } catch (C) {
80
+ i.error(C);
81
+ }
82
+ });
83
+ }
84
+ i.debug("Removing node", a), t.removeNode(a);
85
+ });
86
+ }, "copy"), R = /* @__PURE__ */ X((e, t) => {
87
+ const n = t.children(e);
88
+ let o = [...n];
89
+ for (const c of n)
90
+ J.set(c, e), o = [...o, ...R(c, t)];
91
+ return o;
92
+ }, "extractDescendants"), ie = /* @__PURE__ */ X((e, t, n) => {
93
+ const o = e.edges().filter((l) => l.v === t || l.w === t), c = e.edges().filter((l) => l.v === n || l.w === n), a = o.map((l) => ({ v: l.v === t ? n : l.v, w: l.w === t ? t : l.w })), r = c.map((l) => ({ v: l.v, w: l.w }));
94
+ return a.filter((l) => r.some((v) => l.v === v.v && l.w === v.w));
95
+ }, "findCommonEdges"), D = /* @__PURE__ */ X((e, t, n) => {
96
+ const o = t.children(e);
97
+ if (i.trace("Searching children of id ", e, o), o.length < 1)
98
+ return e;
99
+ let c;
100
+ for (const a of o) {
101
+ const r = D(a, t, n), u = ie(t, n, r);
102
+ if (r)
103
+ if (u.length > 0)
104
+ c = r;
105
+ else
106
+ return r;
107
+ }
108
+ return c;
109
+ }, "findNonClusterChild"), k = /* @__PURE__ */ X((e) => !f.has(e) || !f.get(e).externalConnections ? e : f.has(e) ? f.get(e).id : e, "getAnchorId"), re = /* @__PURE__ */ X((e, t) => {
110
+ if (!e || t > 10) {
111
+ i.debug("Opting out, no graph ");
112
+ return;
113
+ } else
114
+ i.debug("Opting in, graph ");
115
+ e.nodes().forEach(function(n) {
116
+ e.children(n).length > 0 && (i.warn(
117
+ "Cluster identified",
118
+ n,
119
+ " Replacement id in edges: ",
120
+ D(n, e, n)
121
+ ), b.set(n, R(n, e)), f.set(n, { id: D(n, e, n), clusterData: e.node(n) }));
122
+ }), e.nodes().forEach(function(n) {
123
+ const o = e.children(n), c = e.edges();
124
+ o.length > 0 ? (i.debug("Cluster identified", n, b), c.forEach((a) => {
125
+ const r = O(a.v, n), u = O(a.w, n);
126
+ r ^ u && (i.warn("Edge: ", a, " leaves cluster ", n), i.warn("Descendants of XXX ", n, ": ", b.get(n)), f.get(n).externalConnections = !0);
127
+ })) : i.debug("Not a cluster ", n, b);
128
+ });
129
+ for (let n of f.keys()) {
130
+ const o = f.get(n).id, c = e.parent(o);
131
+ c !== n && f.has(c) && !f.get(c).externalConnections && (f.get(n).id = c);
132
+ }
133
+ e.edges().forEach(function(n) {
134
+ const o = e.edge(n);
135
+ i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
136
+ let c = n.v, a = n.w;
137
+ if (i.warn(
138
+ "Fix XXX",
139
+ f,
140
+ "ids:",
141
+ n.v,
142
+ n.w,
143
+ "Translating: ",
144
+ f.get(n.v),
145
+ " --- ",
146
+ f.get(n.w)
147
+ ), f.get(n.v) || f.get(n.w)) {
148
+ if (i.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), c = k(n.v), a = k(n.w), e.removeEdge(n.v, n.w, n.name), c !== n.v) {
149
+ const r = e.parent(c);
150
+ f.get(r).externalConnections = !0, o.fromCluster = n.v;
151
+ }
152
+ if (a !== n.w) {
153
+ const r = e.parent(a);
154
+ f.get(r).externalConnections = !0, o.toCluster = n.w;
155
+ }
156
+ i.warn("Fix Replacing with XXX", c, a, n.name), e.setEdge(c, a, o, n.name);
157
+ }
158
+ }), i.warn("Adjusted Graph", p(e)), T(e, 0), i.trace(f);
159
+ }, "adjustClustersAndEdges"), T = /* @__PURE__ */ X((e, t) => {
160
+ var c, a;
161
+ if (i.warn("extractor - ", t, p(e), e.children("D")), t > 10) {
162
+ i.error("Bailing out");
163
+ return;
164
+ }
165
+ let n = e.nodes(), o = !1;
166
+ for (const r of n) {
167
+ const u = e.children(r);
168
+ o = o || u.length > 0;
169
+ }
170
+ if (!o) {
171
+ i.debug("Done, no node has children", e.nodes());
172
+ return;
173
+ }
174
+ i.debug("Nodes = ", n, t);
175
+ for (const r of n)
176
+ if (i.debug(
177
+ "Extracting node",
178
+ r,
179
+ f,
180
+ f.has(r) && !f.get(r).externalConnections,
181
+ !e.parent(r),
182
+ e.node(r),
183
+ e.children("D"),
184
+ " Depth ",
185
+ t
186
+ ), !f.has(r))
187
+ i.debug("Not a cluster", r, t);
188
+ else if (!f.get(r).externalConnections && e.children(r) && e.children(r).length > 0) {
189
+ i.warn(
190
+ "Cluster without external connections, without a parent and with children",
191
+ r,
192
+ t
193
+ );
194
+ let l = e.graph().rankdir === "TB" ? "LR" : "TB";
195
+ (a = (c = f.get(r)) == null ? void 0 : c.clusterData) != null && a.dir && (l = f.get(r).clusterData.dir, i.warn("Fixing dir", f.get(r).clusterData.dir, l));
196
+ const v = new B({
197
+ multigraph: !0,
198
+ compound: !0
199
+ }).setGraph({
200
+ rankdir: l,
201
+ nodesep: 50,
202
+ ranksep: 50,
203
+ marginx: 8,
204
+ marginy: 8
205
+ }).setDefaultEdgeLabel(function() {
206
+ return {};
207
+ });
208
+ i.warn("Old graph before copy", p(e)), G(r, e, v, r), e.setNode(r, {
209
+ clusterNode: !0,
210
+ id: r,
211
+ clusterData: f.get(r).clusterData,
212
+ label: f.get(r).label,
213
+ graph: v
214
+ }), i.warn("New graph after copy node: (", r, ")", p(v)), i.debug("Old graph after copy", p(e));
215
+ } else
216
+ i.warn(
217
+ "Cluster ** ",
218
+ r,
219
+ " **not meeting the criteria !externalConnections:",
220
+ !f.get(r).externalConnections,
221
+ " no parent: ",
222
+ !e.parent(r),
223
+ " children ",
224
+ e.children(r) && e.children(r).length > 0,
225
+ e.children("D"),
226
+ t
227
+ ), i.debug(f);
228
+ n = e.nodes(), i.warn("New list of nodes", n);
229
+ for (const r of n) {
230
+ const u = e.node(r);
231
+ i.warn(" Now next level", r, u), u != null && u.clusterNode && T(u.graph, t + 1);
232
+ }
233
+ }, "extractor"), M = /* @__PURE__ */ X((e, t) => {
234
+ if (t.length === 0)
235
+ return [];
236
+ let n = Object.assign([], t);
237
+ return t.forEach((o) => {
238
+ const c = e.children(o), a = M(e, c);
239
+ n = [...n, ...a];
240
+ }), n;
241
+ }, "sorter"), oe = /* @__PURE__ */ X((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ X(async (e, t, n, o, c, a) => {
242
+ i.warn("Graph in recursive render:XAX", p(t), c);
243
+ const r = t.graph().rankdir;
244
+ i.trace("Dir in recursive render - dir:", r);
245
+ const u = e.insert("g").attr("class", "root");
246
+ t.nodes() ? i.info("Recursive render XXX", t.nodes()) : i.info("No nodes found for", t), t.edges().length > 0 && i.info("Recursive edges", t.edge(t.edges()[0]));
247
+ const l = u.insert("g").attr("class", "clusters"), v = u.insert("g").attr("class", "edgePaths"), C = u.insert("g").attr("class", "edgeLabels"), g = u.insert("g").attr("class", "nodes");
248
+ await Promise.all(
249
+ t.nodes().map(async function(d) {
250
+ const s = t.node(d);
251
+ if (c !== void 0) {
252
+ const w = JSON.parse(JSON.stringify(c.clusterData));
253
+ i.trace(
254
+ `Setting data for parent cluster XXX
255
+ Node.id = `,
256
+ d,
257
+ `
258
+ data=`,
259
+ w.height,
260
+ `
261
+ Parent cluster`,
262
+ c.height
263
+ ), t.setNode(c.id, w), t.parent(d) || (i.trace("Setting parent", d, c.id), t.setParent(d, c.id, w));
264
+ }
265
+ if (i.info("(Insert) Node XXX" + d + ": " + JSON.stringify(t.node(d))), s != null && s.clusterNode) {
266
+ i.info("Cluster identified XBX", d, s.width, t.node(d));
267
+ const { ranksep: w, nodesep: m } = t.graph();
268
+ s.graph.setGraph({
269
+ ...s.graph.graph(),
270
+ ranksep: w + 25,
271
+ nodesep: m
272
+ });
273
+ const N = await j(
274
+ g,
275
+ s.graph,
276
+ n,
277
+ o,
278
+ t.node(d),
279
+ a
280
+ ), S = N.elem;
281
+ z(s, S), s.diff = N.diff || 0, i.info(
282
+ "New compound node after recursive render XAX",
283
+ d,
284
+ "width",
285
+ // node,
286
+ s.width,
287
+ "height",
288
+ s.height
289
+ // node.x,
290
+ // node.y
291
+ ), U(S, s);
292
+ } else
293
+ t.children(d).length > 0 ? (i.trace(
294
+ "Cluster - the non recursive path XBX",
295
+ d,
296
+ s.id,
297
+ s,
298
+ s.width,
299
+ "Graph:",
300
+ t
301
+ ), i.trace(D(s.id, t)), f.set(s.id, { id: D(s.id, t), node: s })) : (i.trace("Node - the non recursive path XAX", d, g, t.node(d), r), await $(g, t.node(d), { config: a, dir: r }));
302
+ })
303
+ ), await (/* @__PURE__ */ X(async () => {
304
+ const d = t.edges().map(async function(s) {
305
+ const w = t.edge(s.v, s.w, s.name);
306
+ i.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), i.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), i.info(
307
+ "Fix",
308
+ f,
309
+ "ids:",
310
+ s.v,
311
+ s.w,
312
+ "Translating: ",
313
+ f.get(s.v),
314
+ f.get(s.w)
315
+ ), await Z(C, w);
316
+ });
317
+ await Promise.all(d);
318
+ }, "processEdges"))(), i.info("Graph before layout:", JSON.stringify(p(t))), i.info("############################################# XXX"), i.info("### Layout ### XXX"), i.info("############################################# XXX"), I(t), i.info("Graph after layout:", JSON.stringify(p(t)));
319
+ let E = 0, { subGraphTitleTotalMargin: y } = q(a);
320
+ return await Promise.all(
321
+ oe(t).map(async function(d) {
322
+ var w;
323
+ const s = t.node(d);
324
+ if (i.info(
325
+ "Position XBX => " + d + ": (" + s.x,
326
+ "," + s.y,
327
+ ") width: ",
328
+ s.width,
329
+ " height: ",
330
+ s.height
331
+ ), s != null && s.clusterNode)
332
+ s.y += y, i.info(
333
+ "A tainted cluster node XBX1",
334
+ d,
335
+ s.id,
336
+ s.width,
337
+ s.height,
338
+ s.x,
339
+ s.y,
340
+ t.parent(d)
341
+ ), f.get(s.id).node = s, P(s);
342
+ else if (t.children(d).length > 0) {
343
+ i.info(
344
+ "A pure cluster node XBX1",
345
+ d,
346
+ s.id,
347
+ s.x,
348
+ s.y,
349
+ s.width,
350
+ s.height,
351
+ t.parent(d)
352
+ ), s.height += y, t.node(s.parentId);
353
+ const m = (s == null ? void 0 : s.padding) / 2 || 0, N = ((w = s == null ? void 0 : s.labelBBox) == null ? void 0 : w.height) || 0, S = N - m || 0;
354
+ i.debug("OffsetY", S, "labelHeight", N, "halfPadding", m), await K(l, s), f.get(s.id).node = s;
355
+ } else {
356
+ const m = t.node(s.parentId);
357
+ s.y += y / 2, i.info(
358
+ "A regular node XBX1 - using the padding",
359
+ s.id,
360
+ "parent",
361
+ s.parentId,
362
+ s.width,
363
+ s.height,
364
+ s.x,
365
+ s.y,
366
+ "offsetY",
367
+ s.offsetY,
368
+ "parent",
369
+ m,
370
+ m == null ? void 0 : m.offsetY,
371
+ s
372
+ ), P(s);
373
+ }
374
+ })
375
+ ), t.edges().forEach(function(d) {
376
+ const s = t.edge(d);
377
+ i.info("Edge " + d.v + " -> " + d.w + ": " + JSON.stringify(s), s), s.points.forEach((S) => S.y += y / 2);
378
+ const w = t.node(d.v);
379
+ var m = t.node(d.w);
380
+ const N = Q(v, s, f, n, w, m, o);
381
+ W(s, N);
382
+ }), t.nodes().forEach(function(d) {
383
+ const s = t.node(d);
384
+ i.info(d, s.type, s.diff), s.isGroup && (E = s.diff);
385
+ }), i.warn("Returning from recursive render XAX", u, E), { elem: u, diff: E };
386
+ }, "recursiveRender"), ge = /* @__PURE__ */ X(async (e, t) => {
387
+ var a, r, u, l, v, C;
388
+ const n = new B({
389
+ multigraph: !0,
390
+ compound: !0
391
+ }).setGraph({
392
+ rankdir: e.direction,
393
+ nodesep: ((a = e.config) == null ? void 0 : a.nodeSpacing) || ((u = (r = e.config) == null ? void 0 : r.flowchart) == null ? void 0 : u.nodeSpacing) || e.nodeSpacing,
394
+ ranksep: ((l = e.config) == null ? void 0 : l.rankSpacing) || ((C = (v = e.config) == null ? void 0 : v.flowchart) == null ? void 0 : C.rankSpacing) || e.rankSpacing,
395
+ marginx: 8,
396
+ marginy: 8
397
+ }).setDefaultEdgeLabel(function() {
398
+ return {};
399
+ }), o = t.select("g");
400
+ F(o, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((g) => {
401
+ n.setNode(g.id, { ...g }), g.parentId && n.setParent(g.id, g.parentId);
402
+ }), i.debug("Edges:", e.edges), e.edges.forEach((g) => {
403
+ if (g.start === g.end) {
404
+ const h = g.start, E = h + "---" + h + "---1", y = h + "---" + h + "---2", d = n.node(h);
405
+ n.setNode(E, {
406
+ domId: E,
407
+ id: E,
408
+ parentId: d.parentId,
409
+ labelStyle: "",
410
+ label: "",
411
+ padding: 0,
412
+ shape: "labelRect",
413
+ // shape: 'rect',
414
+ style: "",
415
+ width: 10,
416
+ height: 10
417
+ }), n.setParent(E, d.parentId), n.setNode(y, {
418
+ domId: y,
419
+ id: y,
420
+ parentId: d.parentId,
421
+ labelStyle: "",
422
+ padding: 0,
423
+ // shape: 'rect',
424
+ shape: "labelRect",
425
+ label: "",
426
+ style: "",
427
+ width: 10,
428
+ height: 10
429
+ }), n.setParent(y, d.parentId);
430
+ const s = structuredClone(g), w = structuredClone(g), m = structuredClone(g);
431
+ s.label = "", s.arrowTypeEnd = "none", s.id = h + "-cyclic-special-1", w.arrowTypeStart = "none", w.arrowTypeEnd = "none", w.id = h + "-cyclic-special-mid", m.label = "", d.isGroup && (s.fromCluster = h, m.toCluster = h), m.id = h + "-cyclic-special-2", m.arrowTypeStart = "none", n.setEdge(h, E, s, h + "-cyclic-special-0"), n.setEdge(E, y, w, h + "-cyclic-special-1"), n.setEdge(y, h, m, h + "-cyc<lic-special-2");
432
+ } else
433
+ n.setEdge(g.start, g.end, { ...g }, g.id);
434
+ }), i.warn("Graph at first:", JSON.stringify(p(n))), re(n), i.warn("Graph after XAX:", JSON.stringify(p(n)));
435
+ const c = V();
436
+ await j(
437
+ o,
438
+ n,
439
+ e.type,
440
+ e.diagramId,
441
+ void 0,
442
+ c
443
+ );
444
+ }, "render");
445
+ export {
446
+ ge as render
447
+ };
@@ -0,0 +1,171 @@
1
+ function H(n) {
2
+ return Math.abs(n = Math.round(n)) >= 1e21 ? n.toLocaleString("en").replace(/,/g, "") : n.toString(10);
3
+ }
4
+ function j(n, t) {
5
+ if ((e = (n = t ? n.toExponential(t - 1) : n.toExponential()).indexOf("e")) < 0) return null;
6
+ var e, i = n.slice(0, e);
7
+ return [
8
+ i.length > 1 ? i[0] + i.slice(2) : i,
9
+ +n.slice(e + 1)
10
+ ];
11
+ }
12
+ function J(n) {
13
+ return n = j(Math.abs(n)), n ? n[1] : NaN;
14
+ }
15
+ function K(n, t) {
16
+ return function(e, i) {
17
+ for (var o = e.length, f = [], c = 0, u = n[0], p = 0; o > 0 && u > 0 && (p + u + 1 > i && (u = Math.max(1, i - p)), f.push(e.substring(o -= u, o + u)), !((p += u + 1) > i)); )
18
+ u = n[c = (c + 1) % n.length];
19
+ return f.reverse().join(t);
20
+ };
21
+ }
22
+ function Q(n) {
23
+ return function(t) {
24
+ return t.replace(/[0-9]/g, function(e) {
25
+ return n[+e];
26
+ });
27
+ };
28
+ }
29
+ var V = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
30
+ function N(n) {
31
+ if (!(t = V.exec(n))) throw new Error("invalid format: " + n);
32
+ var t;
33
+ return new $({
34
+ fill: t[1],
35
+ align: t[2],
36
+ sign: t[3],
37
+ symbol: t[4],
38
+ zero: t[5],
39
+ width: t[6],
40
+ comma: t[7],
41
+ precision: t[8] && t[8].slice(1),
42
+ trim: t[9],
43
+ type: t[10]
44
+ });
45
+ }
46
+ N.prototype = $.prototype;
47
+ function $(n) {
48
+ this.fill = n.fill === void 0 ? " " : n.fill + "", this.align = n.align === void 0 ? ">" : n.align + "", this.sign = n.sign === void 0 ? "-" : n.sign + "", this.symbol = n.symbol === void 0 ? "" : n.symbol + "", this.zero = !!n.zero, this.width = n.width === void 0 ? void 0 : +n.width, this.comma = !!n.comma, this.precision = n.precision === void 0 ? void 0 : +n.precision, this.trim = !!n.trim, this.type = n.type === void 0 ? "" : n.type + "";
49
+ }
50
+ $.prototype.toString = function() {
51
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
52
+ };
53
+ function W(n) {
54
+ n: for (var t = n.length, e = 1, i = -1, o; e < t; ++e)
55
+ switch (n[e]) {
56
+ case ".":
57
+ i = o = e;
58
+ break;
59
+ case "0":
60
+ i === 0 && (i = e), o = e;
61
+ break;
62
+ default:
63
+ if (!+n[e]) break n;
64
+ i > 0 && (i = 0);
65
+ break;
66
+ }
67
+ return i > 0 ? n.slice(0, i) + n.slice(o + 1) : n;
68
+ }
69
+ var U;
70
+ function _(n, t) {
71
+ var e = j(n, t);
72
+ if (!e) return n + "";
73
+ var i = e[0], o = e[1], f = o - (U = Math.max(-8, Math.min(8, Math.floor(o / 3))) * 3) + 1, c = i.length;
74
+ return f === c ? i : f > c ? i + new Array(f - c + 1).join("0") : f > 0 ? i.slice(0, f) + "." + i.slice(f) : "0." + new Array(1 - f).join("0") + j(n, Math.max(0, t + f - 1))[0];
75
+ }
76
+ function G(n, t) {
77
+ var e = j(n, t);
78
+ if (!e) return n + "";
79
+ var i = e[0], o = e[1];
80
+ return o < 0 ? "0." + new Array(-o).join("0") + i : i.length > o + 1 ? i.slice(0, o + 1) + "." + i.slice(o + 1) : i + new Array(o - i.length + 2).join("0");
81
+ }
82
+ const I = {
83
+ "%": (n, t) => (n * 100).toFixed(t),
84
+ b: (n) => Math.round(n).toString(2),
85
+ c: (n) => n + "",
86
+ d: H,
87
+ e: (n, t) => n.toExponential(t),
88
+ f: (n, t) => n.toFixed(t),
89
+ g: (n, t) => n.toPrecision(t),
90
+ o: (n) => Math.round(n).toString(8),
91
+ p: (n, t) => G(n * 100, t),
92
+ r: G,
93
+ s: _,
94
+ X: (n) => Math.round(n).toString(16).toUpperCase(),
95
+ x: (n) => Math.round(n).toString(16)
96
+ };
97
+ function X(n) {
98
+ return n;
99
+ }
100
+ var O = Array.prototype.map, R = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
101
+ function v(n) {
102
+ var t = n.grouping === void 0 || n.thousands === void 0 ? X : K(O.call(n.grouping, Number), n.thousands + ""), e = n.currency === void 0 ? "" : n.currency[0] + "", i = n.currency === void 0 ? "" : n.currency[1] + "", o = n.decimal === void 0 ? "." : n.decimal + "", f = n.numerals === void 0 ? X : Q(O.call(n.numerals, String)), c = n.percent === void 0 ? "%" : n.percent + "", u = n.minus === void 0 ? "−" : n.minus + "", p = n.nan === void 0 ? "NaN" : n.nan + "";
103
+ function F(a) {
104
+ a = N(a);
105
+ var x = a.fill, M = a.align, m = a.sign, w = a.symbol, l = a.zero, S = a.width, E = a.comma, g = a.precision, L = a.trim, d = a.type;
106
+ d === "n" ? (E = !0, d = "g") : I[d] || (g === void 0 && (g = 12), L = !0, d = "g"), (l || x === "0" && M === "=") && (l = !0, x = "0", M = "=");
107
+ var Z = w === "$" ? e : w === "#" && /[boxX]/.test(d) ? "0" + d.toLowerCase() : "", q = w === "$" ? i : /[%p]/.test(d) ? c : "", T = I[d], B = /[defgprs%]/.test(d);
108
+ g = g === void 0 ? 6 : /[gprs]/.test(d) ? Math.max(1, Math.min(21, g)) : Math.max(0, Math.min(20, g));
109
+ function C(r) {
110
+ var y = Z, h = q, b, D, k;
111
+ if (d === "c")
112
+ h = T(r) + h, r = "";
113
+ else {
114
+ r = +r;
115
+ var P = r < 0 || 1 / r < 0;
116
+ if (r = isNaN(r) ? p : T(Math.abs(r), g), L && (r = W(r)), P && +r == 0 && m !== "+" && (P = !1), y = (P ? m === "(" ? m : u : m === "-" || m === "(" ? "" : m) + y, h = (d === "s" ? R[8 + U / 3] : "") + h + (P && m === "(" ? ")" : ""), B) {
117
+ for (b = -1, D = r.length; ++b < D; )
118
+ if (k = r.charCodeAt(b), 48 > k || k > 57) {
119
+ h = (k === 46 ? o + r.slice(b + 1) : r.slice(b)) + h, r = r.slice(0, b);
120
+ break;
121
+ }
122
+ }
123
+ }
124
+ E && !l && (r = t(r, 1 / 0));
125
+ var z = y.length + r.length + h.length, s = z < S ? new Array(S - z + 1).join(x) : "";
126
+ switch (E && l && (r = t(s + r, s.length ? S - h.length : 1 / 0), s = ""), M) {
127
+ case "<":
128
+ r = y + r + h + s;
129
+ break;
130
+ case "=":
131
+ r = y + s + r + h;
132
+ break;
133
+ case "^":
134
+ r = s.slice(0, z = s.length >> 1) + y + r + h + s.slice(z);
135
+ break;
136
+ default:
137
+ r = s + y + r + h;
138
+ break;
139
+ }
140
+ return f(r);
141
+ }
142
+ return C.toString = function() {
143
+ return a + "";
144
+ }, C;
145
+ }
146
+ function Y(a, x) {
147
+ var M = F((a = N(a), a.type = "f", a)), m = Math.max(-8, Math.min(8, Math.floor(J(x) / 3))) * 3, w = Math.pow(10, -m), l = R[8 + m / 3];
148
+ return function(S) {
149
+ return M(w * S) + l;
150
+ };
151
+ }
152
+ return {
153
+ format: F,
154
+ formatPrefix: Y
155
+ };
156
+ }
157
+ var A, nn, tn;
158
+ rn({
159
+ thousands: ",",
160
+ grouping: [3],
161
+ currency: ["$", ""]
162
+ });
163
+ function rn(n) {
164
+ return A = v(n), nn = A.format, tn = A.formatPrefix, A;
165
+ }
166
+ export {
167
+ tn as a,
168
+ nn as b,
169
+ J as e,
170
+ N as f
171
+ };