bg-editor 0.0.7 → 0.0.8

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 (58) hide show
  1. package/dist/umo-editor.js +89809 -7
  2. package/package.json +21 -1
  3. package/dist/_baseUniq-CK68Es8H.js +0 -473
  4. package/dist/arc-cD-4ba7d.js +0 -84
  5. package/dist/architecture-U656AL7Q-jxTBuJdN.js +0 -6
  6. package/dist/architectureDiagram-VXUJARFQ-D3XlpFhb.js +0 -4660
  7. package/dist/blockDiagram-VD42YOAC-BslbvMOG.js +0 -2262
  8. package/dist/c4Diagram-YG6GDRKO-DD3uWYPM.js +0 -1581
  9. package/dist/channel-DjTSKqWx.js +0 -6
  10. package/dist/chunk-4BX2VUAB-lfhsh4gk.js +0 -9
  11. package/dist/chunk-55IACEB6-O42zw0MT.js +0 -9
  12. package/dist/chunk-B4BG7PRW-CAose2Ox.js +0 -1376
  13. package/dist/chunk-DI55MBZ5-DkOlwdzs.js +0 -1371
  14. package/dist/chunk-FMBD7UC4-XviEvZms.js +0 -20
  15. package/dist/chunk-QN33PNHL-CNGSzgpw.js +0 -20
  16. package/dist/chunk-QZHKN3VN-CRgLUJXR.js +0 -16
  17. package/dist/chunk-TZMSLE5B-BkHNUxTN.js +0 -65
  18. package/dist/classDiagram-2ON5EDUG-Cakz_SCw.js +0 -17
  19. package/dist/classDiagram-v2-WZHVMYZB-Cakz_SCw.js +0 -17
  20. package/dist/clone-CIrbb4_D.js +0 -9
  21. package/dist/cose-bilkent-S5V4N54A-EoSlB5N_.js +0 -2606
  22. package/dist/cytoscape.esm-DoU_GB5M.js +0 -18732
  23. package/dist/dagre-6UL2VRFP-BPH1NIvl.js +0 -444
  24. package/dist/defaultLocale-DEnRyJdC.js +0 -172
  25. package/dist/diagram-PSM6KHXK-DCRoLhFv.js +0 -396
  26. package/dist/diagram-QEK2KX5R-2gxFpsCA.js +0 -218
  27. package/dist/diagram-S2PKOQOG-BIPpN2G8.js +0 -143
  28. package/dist/erDiagram-Q2GNP2WA-pfb2dpnp.js +0 -842
  29. package/dist/flowDiagram-NV44I4VS-Dv631-Fh.js +0 -1621
  30. package/dist/ganttDiagram-LVOFAZNH-BOKYXijK.js +0 -2500
  31. package/dist/gitGraph-F6HP7TQM-CRerkbyh.js +0 -6
  32. package/dist/gitGraphDiagram-NY62KEGX-CgO9x7O1.js +0 -700
  33. package/dist/graph-CG-rVaun.js +0 -382
  34. package/dist/index-LPeu-5gp.js +0 -164788
  35. package/dist/info-NVLQJR56-CZcMDuD4.js +0 -6
  36. package/dist/infoDiagram-ER5ION4S-CpfjxDXT.js +0 -25
  37. package/dist/init-Dbt-6wo9.js +0 -17
  38. package/dist/journeyDiagram-XKPGCS4Q-D4m1xk_j.js +0 -837
  39. package/dist/kanban-definition-3W4ZIXB7-GUMW-GDO.js +0 -719
  40. package/dist/layout-C7pGfQvF.js +0 -1416
  41. package/dist/linear-CQdBpz9H.js +0 -260
  42. package/dist/mermaid-parser.core-C3Lk4un7.js +0 -14143
  43. package/dist/min-D7xNMq31.js +0 -39
  44. package/dist/mindmap-definition-VGOIOE7T-GfQh2q9s.js +0 -784
  45. package/dist/ordinal-mgyNSFm_.js +0 -62
  46. package/dist/packet-BFZMPI3H-DughJE3g.js +0 -6
  47. package/dist/pie-7BOR55EZ-B1py7mee.js +0 -6
  48. package/dist/pieDiagram-ADFJNKIX-DENmX4xL.js +0 -162
  49. package/dist/quadrantDiagram-AYHSOK5B-BFVycH-W.js +0 -1023
  50. package/dist/radar-NHE76QYJ-DuTW4rXt.js +0 -6
  51. package/dist/requirementDiagram-UZGBJVZJ-f8rb43Mp.js +0 -851
  52. package/dist/sankeyDiagram-TZEHDZUN-CUN0tZ5p.js +0 -811
  53. package/dist/sequenceDiagram-WL72ISMW-7X4nul9T.js +0 -2512
  54. package/dist/stateDiagram-FKZM4ZOC-CypL793K.js +0 -264
  55. package/dist/stateDiagram-v2-4FDKWEC3-D5vS5FM5.js +0 -17
  56. package/dist/timeline-definition-IT6M3QCI-B_WOoOGO.js +0 -798
  57. package/dist/treemap-KMMF4GRG-BzINyJBJ.js +0 -6
  58. package/dist/xychartDiagram-PRI3JC2R-Llw16NDY.js +0 -1341
@@ -1,811 +0,0 @@
1
- import "./style.css";
2
- import { _ as g, p as _t, q as xt, s as vt, g as bt, b as wt, a as St, c as lt, z as Lt, d as H, V as Et, y as At, k as Tt } from "./index-LPeu-5gp.js";
3
- import { o as Mt } from "./ordinal-mgyNSFm_.js";
4
- function Nt(t) {
5
- for (var e = t.length / 6 | 0, i = new Array(e), a = 0; a < e; ) i[a] = "#" + t.slice(a * 6, ++a * 6);
6
- return i;
7
- }
8
- const It = Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
9
- function ct(t, e) {
10
- let i;
11
- if (e === void 0)
12
- for (const a of t)
13
- a != null && (i < a || i === void 0 && a >= a) && (i = a);
14
- else {
15
- let a = -1;
16
- for (let h of t)
17
- (h = e(h, ++a, t)) != null && (i < h || i === void 0 && h >= h) && (i = h);
18
- }
19
- return i;
20
- }
21
- function pt(t, e) {
22
- let i;
23
- if (e === void 0)
24
- for (const a of t)
25
- a != null && (i > a || i === void 0 && a >= a) && (i = a);
26
- else {
27
- let a = -1;
28
- for (let h of t)
29
- (h = e(h, ++a, t)) != null && (i > h || i === void 0 && h >= h) && (i = h);
30
- }
31
- return i;
32
- }
33
- function nt(t, e) {
34
- let i = 0;
35
- if (e === void 0)
36
- for (let a of t)
37
- (a = +a) && (i += a);
38
- else {
39
- let a = -1;
40
- for (let h of t)
41
- (h = +e(h, ++a, t)) && (i += h);
42
- }
43
- return i;
44
- }
45
- function Pt(t) {
46
- return t.target.depth;
47
- }
48
- function Ct(t) {
49
- return t.depth;
50
- }
51
- function Ot(t, e) {
52
- return e - 1 - t.height;
53
- }
54
- function mt(t, e) {
55
- return t.sourceLinks.length ? t.depth : e - 1;
56
- }
57
- function zt(t) {
58
- return t.targetLinks.length ? t.depth : t.sourceLinks.length ? pt(t.sourceLinks, Pt) - 1 : 0;
59
- }
60
- function X(t) {
61
- return function() {
62
- return t;
63
- };
64
- }
65
- function ut(t, e) {
66
- return Q(t.source, e.source) || t.index - e.index;
67
- }
68
- function ht(t, e) {
69
- return Q(t.target, e.target) || t.index - e.index;
70
- }
71
- function Q(t, e) {
72
- return t.y0 - e.y0;
73
- }
74
- function it(t) {
75
- return t.value;
76
- }
77
- function Dt(t) {
78
- return t.index;
79
- }
80
- function $t(t) {
81
- return t.nodes;
82
- }
83
- function jt(t) {
84
- return t.links;
85
- }
86
- function ft(t, e) {
87
- const i = t.get(e);
88
- if (!i) throw new Error("missing: " + e);
89
- return i;
90
- }
91
- function yt({ nodes: t }) {
92
- for (const e of t) {
93
- let i = e.y0, a = i;
94
- for (const h of e.sourceLinks)
95
- h.y0 = i + h.width / 2, i += h.width;
96
- for (const h of e.targetLinks)
97
- h.y1 = a + h.width / 2, a += h.width;
98
- }
99
- }
100
- function Bt() {
101
- let t = 0, e = 0, i = 1, a = 1, h = 24, b = 8, p, k = Dt, s = mt, o, l, _ = $t, x = jt, y = 6;
102
- function v() {
103
- const n = { nodes: _.apply(null, arguments), links: x.apply(null, arguments) };
104
- return M(n), T(n), N(n), C(n), S(n), yt(n), n;
105
- }
106
- v.update = function(n) {
107
- return yt(n), n;
108
- }, v.nodeId = function(n) {
109
- return arguments.length ? (k = typeof n == "function" ? n : X(n), v) : k;
110
- }, v.nodeAlign = function(n) {
111
- return arguments.length ? (s = typeof n == "function" ? n : X(n), v) : s;
112
- }, v.nodeSort = function(n) {
113
- return arguments.length ? (o = n, v) : o;
114
- }, v.nodeWidth = function(n) {
115
- return arguments.length ? (h = +n, v) : h;
116
- }, v.nodePadding = function(n) {
117
- return arguments.length ? (b = p = +n, v) : b;
118
- }, v.nodes = function(n) {
119
- return arguments.length ? (_ = typeof n == "function" ? n : X(n), v) : _;
120
- }, v.links = function(n) {
121
- return arguments.length ? (x = typeof n == "function" ? n : X(n), v) : x;
122
- }, v.linkSort = function(n) {
123
- return arguments.length ? (l = n, v) : l;
124
- }, v.size = function(n) {
125
- return arguments.length ? (t = e = 0, i = +n[0], a = +n[1], v) : [i - t, a - e];
126
- }, v.extent = function(n) {
127
- return arguments.length ? (t = +n[0][0], i = +n[1][0], e = +n[0][1], a = +n[1][1], v) : [[t, e], [i, a]];
128
- }, v.iterations = function(n) {
129
- return arguments.length ? (y = +n, v) : y;
130
- };
131
- function M({ nodes: n, links: f }) {
132
- for (const [c, r] of n.entries())
133
- r.index = c, r.sourceLinks = [], r.targetLinks = [];
134
- const u = new Map(n.map((c, r) => [k(c, r, n), c]));
135
- for (const [c, r] of f.entries()) {
136
- r.index = c;
137
- let { source: m, target: w } = r;
138
- typeof m != "object" && (m = r.source = ft(u, m)), typeof w != "object" && (w = r.target = ft(u, w)), m.sourceLinks.push(r), w.targetLinks.push(r);
139
- }
140
- if (l != null)
141
- for (const { sourceLinks: c, targetLinks: r } of n)
142
- c.sort(l), r.sort(l);
143
- }
144
- function T({ nodes: n }) {
145
- for (const f of n)
146
- f.value = f.fixedValue === void 0 ? Math.max(nt(f.sourceLinks, it), nt(f.targetLinks, it)) : f.fixedValue;
147
- }
148
- function N({ nodes: n }) {
149
- const f = n.length;
150
- let u = new Set(n), c = /* @__PURE__ */ new Set(), r = 0;
151
- for (; u.size; ) {
152
- for (const m of u) {
153
- m.depth = r;
154
- for (const { target: w } of m.sourceLinks)
155
- c.add(w);
156
- }
157
- if (++r > f) throw new Error("circular link");
158
- u = c, c = /* @__PURE__ */ new Set();
159
- }
160
- }
161
- function C({ nodes: n }) {
162
- const f = n.length;
163
- let u = new Set(n), c = /* @__PURE__ */ new Set(), r = 0;
164
- for (; u.size; ) {
165
- for (const m of u) {
166
- m.height = r;
167
- for (const { source: w } of m.targetLinks)
168
- c.add(w);
169
- }
170
- if (++r > f) throw new Error("circular link");
171
- u = c, c = /* @__PURE__ */ new Set();
172
- }
173
- }
174
- function D({ nodes: n }) {
175
- const f = ct(n, (r) => r.depth) + 1, u = (i - t - h) / (f - 1), c = new Array(f);
176
- for (const r of n) {
177
- const m = Math.max(0, Math.min(f - 1, Math.floor(s.call(null, r, f))));
178
- r.layer = m, r.x0 = t + m * u, r.x1 = r.x0 + h, c[m] ? c[m].push(r) : c[m] = [r];
179
- }
180
- if (o) for (const r of c)
181
- r.sort(o);
182
- return c;
183
- }
184
- function R(n) {
185
- const f = pt(n, (u) => (a - e - (u.length - 1) * p) / nt(u, it));
186
- for (const u of n) {
187
- let c = e;
188
- for (const r of u) {
189
- r.y0 = c, r.y1 = c + r.value * f, c = r.y1 + p;
190
- for (const m of r.sourceLinks)
191
- m.width = m.value * f;
192
- }
193
- c = (a - c + p) / (u.length + 1);
194
- for (let r = 0; r < u.length; ++r) {
195
- const m = u[r];
196
- m.y0 += c * (r + 1), m.y1 += c * (r + 1);
197
- }
198
- A(u);
199
- }
200
- }
201
- function S(n) {
202
- const f = D(n);
203
- p = Math.min(b, (a - e) / (ct(f, (u) => u.length) - 1)), R(f);
204
- for (let u = 0; u < y; ++u) {
205
- const c = Math.pow(0.99, u), r = Math.max(1 - c, (u + 1) / y);
206
- B(f, c, r), P(f, c, r);
207
- }
208
- }
209
- function P(n, f, u) {
210
- for (let c = 1, r = n.length; c < r; ++c) {
211
- const m = n[c];
212
- for (const w of m) {
213
- let L = 0, V = 0;
214
- for (const { source: Y, value: et } of w.targetLinks) {
215
- let q = et * (w.layer - Y.layer);
216
- L += $(Y, w) * q, V += q;
217
- }
218
- if (!(V > 0)) continue;
219
- let G = (L / V - w.y0) * f;
220
- w.y0 += G, w.y1 += G, E(w);
221
- }
222
- o === void 0 && m.sort(Q), O(m, u);
223
- }
224
- }
225
- function B(n, f, u) {
226
- for (let c = n.length, r = c - 2; r >= 0; --r) {
227
- const m = n[r];
228
- for (const w of m) {
229
- let L = 0, V = 0;
230
- for (const { target: Y, value: et } of w.sourceLinks) {
231
- let q = et * (Y.layer - w.layer);
232
- L += I(w, Y) * q, V += q;
233
- }
234
- if (!(V > 0)) continue;
235
- let G = (L / V - w.y0) * f;
236
- w.y0 += G, w.y1 += G, E(w);
237
- }
238
- o === void 0 && m.sort(Q), O(m, u);
239
- }
240
- }
241
- function O(n, f) {
242
- const u = n.length >> 1, c = n[u];
243
- d(n, c.y0 - p, u - 1, f), z(n, c.y1 + p, u + 1, f), d(n, a, n.length - 1, f), z(n, e, 0, f);
244
- }
245
- function z(n, f, u, c) {
246
- for (; u < n.length; ++u) {
247
- const r = n[u], m = (f - r.y0) * c;
248
- m > 1e-6 && (r.y0 += m, r.y1 += m), f = r.y1 + p;
249
- }
250
- }
251
- function d(n, f, u, c) {
252
- for (; u >= 0; --u) {
253
- const r = n[u], m = (r.y1 - f) * c;
254
- m > 1e-6 && (r.y0 -= m, r.y1 -= m), f = r.y0 - p;
255
- }
256
- }
257
- function E({ sourceLinks: n, targetLinks: f }) {
258
- if (l === void 0) {
259
- for (const { source: { sourceLinks: u } } of f)
260
- u.sort(ht);
261
- for (const { target: { targetLinks: u } } of n)
262
- u.sort(ut);
263
- }
264
- }
265
- function A(n) {
266
- if (l === void 0)
267
- for (const { sourceLinks: f, targetLinks: u } of n)
268
- f.sort(ht), u.sort(ut);
269
- }
270
- function $(n, f) {
271
- let u = n.y0 - (n.sourceLinks.length - 1) * p / 2;
272
- for (const { target: c, width: r } of n.sourceLinks) {
273
- if (c === f) break;
274
- u += r + p;
275
- }
276
- for (const { source: c, width: r } of f.targetLinks) {
277
- if (c === n) break;
278
- u -= r;
279
- }
280
- return u;
281
- }
282
- function I(n, f) {
283
- let u = f.y0 - (f.targetLinks.length - 1) * p / 2;
284
- for (const { source: c, width: r } of f.targetLinks) {
285
- if (c === n) break;
286
- u += r + p;
287
- }
288
- for (const { target: c, width: r } of n.sourceLinks) {
289
- if (c === f) break;
290
- u -= r;
291
- }
292
- return u;
293
- }
294
- return v;
295
- }
296
- var st = Math.PI, rt = 2 * st, F = 1e-6, Rt = rt - F;
297
- function ot() {
298
- this._x0 = this._y0 = // start of current subpath
299
- this._x1 = this._y1 = null, this._ = "";
300
- }
301
- function kt() {
302
- return new ot();
303
- }
304
- ot.prototype = kt.prototype = {
305
- constructor: ot,
306
- moveTo: function(t, e) {
307
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +e);
308
- },
309
- closePath: function() {
310
- this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
311
- },
312
- lineTo: function(t, e) {
313
- this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +e);
314
- },
315
- quadraticCurveTo: function(t, e, i, a) {
316
- this._ += "Q" + +t + "," + +e + "," + (this._x1 = +i) + "," + (this._y1 = +a);
317
- },
318
- bezierCurveTo: function(t, e, i, a, h, b) {
319
- this._ += "C" + +t + "," + +e + "," + +i + "," + +a + "," + (this._x1 = +h) + "," + (this._y1 = +b);
320
- },
321
- arcTo: function(t, e, i, a, h) {
322
- t = +t, e = +e, i = +i, a = +a, h = +h;
323
- var b = this._x1, p = this._y1, k = i - t, s = a - e, o = b - t, l = p - e, _ = o * o + l * l;
324
- if (h < 0) throw new Error("negative radius: " + h);
325
- if (this._x1 === null)
326
- this._ += "M" + (this._x1 = t) + "," + (this._y1 = e);
327
- else if (_ > F) if (!(Math.abs(l * k - s * o) > F) || !h)
328
- this._ += "L" + (this._x1 = t) + "," + (this._y1 = e);
329
- else {
330
- var x = i - b, y = a - p, v = k * k + s * s, M = x * x + y * y, T = Math.sqrt(v), N = Math.sqrt(_), C = h * Math.tan((st - Math.acos((v + _ - M) / (2 * T * N))) / 2), D = C / N, R = C / T;
331
- Math.abs(D - 1) > F && (this._ += "L" + (t + D * o) + "," + (e + D * l)), this._ += "A" + h + "," + h + ",0,0," + +(l * x > o * y) + "," + (this._x1 = t + R * k) + "," + (this._y1 = e + R * s);
332
- }
333
- },
334
- arc: function(t, e, i, a, h, b) {
335
- t = +t, e = +e, i = +i, b = !!b;
336
- var p = i * Math.cos(a), k = i * Math.sin(a), s = t + p, o = e + k, l = 1 ^ b, _ = b ? a - h : h - a;
337
- if (i < 0) throw new Error("negative radius: " + i);
338
- this._x1 === null ? this._ += "M" + s + "," + o : (Math.abs(this._x1 - s) > F || Math.abs(this._y1 - o) > F) && (this._ += "L" + s + "," + o), i && (_ < 0 && (_ = _ % rt + rt), _ > Rt ? this._ += "A" + i + "," + i + ",0,1," + l + "," + (t - p) + "," + (e - k) + "A" + i + "," + i + ",0,1," + l + "," + (this._x1 = s) + "," + (this._y1 = o) : _ > F && (this._ += "A" + i + "," + i + ",0," + +(_ >= st) + "," + l + "," + (this._x1 = t + i * Math.cos(h)) + "," + (this._y1 = e + i * Math.sin(h))));
339
- },
340
- rect: function(t, e, i, a) {
341
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +e) + "h" + +i + "v" + +a + "h" + -i + "Z";
342
- },
343
- toString: function() {
344
- return this._;
345
- }
346
- };
347
- function dt(t) {
348
- return function() {
349
- return t;
350
- };
351
- }
352
- function Vt(t) {
353
- return t[0];
354
- }
355
- function Ft(t) {
356
- return t[1];
357
- }
358
- var Wt = Array.prototype.slice;
359
- function Ut(t) {
360
- return t.source;
361
- }
362
- function Gt(t) {
363
- return t.target;
364
- }
365
- function Yt(t) {
366
- var e = Ut, i = Gt, a = Vt, h = Ft, b = null;
367
- function p() {
368
- var k, s = Wt.call(arguments), o = e.apply(this, s), l = i.apply(this, s);
369
- if (b || (b = k = kt()), t(b, +a.apply(this, (s[0] = o, s)), +h.apply(this, s), +a.apply(this, (s[0] = l, s)), +h.apply(this, s)), k) return b = null, k + "" || null;
370
- }
371
- return p.source = function(k) {
372
- return arguments.length ? (e = k, p) : e;
373
- }, p.target = function(k) {
374
- return arguments.length ? (i = k, p) : i;
375
- }, p.x = function(k) {
376
- return arguments.length ? (a = typeof k == "function" ? k : dt(+k), p) : a;
377
- }, p.y = function(k) {
378
- return arguments.length ? (h = typeof k == "function" ? k : dt(+k), p) : h;
379
- }, p.context = function(k) {
380
- return arguments.length ? (b = k ?? null, p) : b;
381
- }, p;
382
- }
383
- function qt(t, e, i, a, h) {
384
- t.moveTo(e, i), t.bezierCurveTo(e = (e + a) / 2, i, e, h, a, h);
385
- }
386
- function Ht() {
387
- return Yt(qt);
388
- }
389
- function Xt(t) {
390
- return [t.source.x1, t.y0];
391
- }
392
- function Qt(t) {
393
- return [t.target.x0, t.y1];
394
- }
395
- function Kt() {
396
- return Ht().source(Xt).target(Qt);
397
- }
398
- var at = function() {
399
- var t = /* @__PURE__ */ g(function(k, s, o, l) {
400
- for (o = o || {}, l = k.length; l--; o[k[l]] = s) ;
401
- return o;
402
- }, "o"), e = [1, 9], i = [1, 10], a = [1, 5, 10, 12], h = {
403
- trace: /* @__PURE__ */ g(function() {
404
- }, "trace"),
405
- yy: {},
406
- symbols_: { error: 2, start: 3, SANKEY: 4, NEWLINE: 5, csv: 6, opt_eof: 7, record: 8, csv_tail: 9, EOF: 10, "field[source]": 11, COMMA: 12, "field[target]": 13, "field[value]": 14, field: 15, escaped: 16, non_escaped: 17, DQUOTE: 18, ESCAPED_TEXT: 19, NON_ESCAPED_TEXT: 20, $accept: 0, $end: 1 },
407
- terminals_: { 2: "error", 4: "SANKEY", 5: "NEWLINE", 10: "EOF", 11: "field[source]", 12: "COMMA", 13: "field[target]", 14: "field[value]", 18: "DQUOTE", 19: "ESCAPED_TEXT", 20: "NON_ESCAPED_TEXT" },
408
- productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
409
- performAction: /* @__PURE__ */ g(function(s, o, l, _, x, y, v) {
410
- var M = y.length - 1;
411
- switch (x) {
412
- case 7:
413
- const T = _.findOrCreateNode(y[M - 4].trim().replaceAll('""', '"')), N = _.findOrCreateNode(y[M - 2].trim().replaceAll('""', '"')), C = parseFloat(y[M].trim());
414
- _.addLink(T, N, C);
415
- break;
416
- case 8:
417
- case 9:
418
- case 11:
419
- this.$ = y[M];
420
- break;
421
- case 10:
422
- this.$ = y[M - 1];
423
- break;
424
- }
425
- }, "anonymous"),
426
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: e, 20: i }, { 1: [2, 6], 7: 11, 10: [1, 12] }, t(i, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, t(a, [2, 8]), t(a, [2, 9]), { 19: [1, 16] }, t(a, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, t(i, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: e, 20: i }, { 15: 18, 16: 7, 17: 8, 18: e, 20: i }, { 18: [1, 19] }, t(i, [2, 3]), { 12: [1, 20] }, t(a, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: e, 20: i }, t([1, 5, 10], [2, 7])],
427
- defaultActions: { 11: [2, 1], 12: [2, 5] },
428
- parseError: /* @__PURE__ */ g(function(s, o) {
429
- if (o.recoverable)
430
- this.trace(s);
431
- else {
432
- var l = new Error(s);
433
- throw l.hash = o, l;
434
- }
435
- }, "parseError"),
436
- parse: /* @__PURE__ */ g(function(s) {
437
- var o = this, l = [0], _ = [], x = [null], y = [], v = this.table, M = "", T = 0, N = 0, C = 2, D = 1, R = y.slice.call(arguments, 1), S = Object.create(this.lexer), P = { yy: {} };
438
- for (var B in this.yy)
439
- Object.prototype.hasOwnProperty.call(this.yy, B) && (P.yy[B] = this.yy[B]);
440
- S.setInput(s, P.yy), P.yy.lexer = S, P.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
441
- var O = S.yylloc;
442
- y.push(O);
443
- var z = S.options && S.options.ranges;
444
- typeof P.yy.parseError == "function" ? this.parseError = P.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
445
- function d(L) {
446
- l.length = l.length - 2 * L, x.length = x.length - L, y.length = y.length - L;
447
- }
448
- g(d, "popStack");
449
- function E() {
450
- var L;
451
- return L = _.pop() || S.lex() || D, typeof L != "number" && (L instanceof Array && (_ = L, L = _.pop()), L = o.symbols_[L] || L), L;
452
- }
453
- g(E, "lex");
454
- for (var A, $, I, n, f = {}, u, c, r, m; ; ) {
455
- if ($ = l[l.length - 1], this.defaultActions[$] ? I = this.defaultActions[$] : ((A === null || typeof A > "u") && (A = E()), I = v[$] && v[$][A]), typeof I > "u" || !I.length || !I[0]) {
456
- var w = "";
457
- m = [];
458
- for (u in v[$])
459
- this.terminals_[u] && u > C && m.push("'" + this.terminals_[u] + "'");
460
- S.showPosition ? w = "Parse error on line " + (T + 1) + `:
461
- ` + S.showPosition() + `
462
- Expecting ` + m.join(", ") + ", got '" + (this.terminals_[A] || A) + "'" : w = "Parse error on line " + (T + 1) + ": Unexpected " + (A == D ? "end of input" : "'" + (this.terminals_[A] || A) + "'"), this.parseError(w, {
463
- text: S.match,
464
- token: this.terminals_[A] || A,
465
- line: S.yylineno,
466
- loc: O,
467
- expected: m
468
- });
469
- }
470
- if (I[0] instanceof Array && I.length > 1)
471
- throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + A);
472
- switch (I[0]) {
473
- case 1:
474
- l.push(A), x.push(S.yytext), y.push(S.yylloc), l.push(I[1]), A = null, N = S.yyleng, M = S.yytext, T = S.yylineno, O = S.yylloc;
475
- break;
476
- case 2:
477
- if (c = this.productions_[I[1]][1], f.$ = x[x.length - c], f._$ = {
478
- first_line: y[y.length - (c || 1)].first_line,
479
- last_line: y[y.length - 1].last_line,
480
- first_column: y[y.length - (c || 1)].first_column,
481
- last_column: y[y.length - 1].last_column
482
- }, z && (f._$.range = [
483
- y[y.length - (c || 1)].range[0],
484
- y[y.length - 1].range[1]
485
- ]), n = this.performAction.apply(f, [
486
- M,
487
- N,
488
- T,
489
- P.yy,
490
- I[1],
491
- x,
492
- y
493
- ].concat(R)), typeof n < "u")
494
- return n;
495
- c && (l = l.slice(0, -1 * c * 2), x = x.slice(0, -1 * c), y = y.slice(0, -1 * c)), l.push(this.productions_[I[1]][0]), x.push(f.$), y.push(f._$), r = v[l[l.length - 2]][l[l.length - 1]], l.push(r);
496
- break;
497
- case 3:
498
- return !0;
499
- }
500
- }
501
- return !0;
502
- }, "parse")
503
- }, b = /* @__PURE__ */ function() {
504
- var k = {
505
- EOF: 1,
506
- parseError: /* @__PURE__ */ g(function(o, l) {
507
- if (this.yy.parser)
508
- this.yy.parser.parseError(o, l);
509
- else
510
- throw new Error(o);
511
- }, "parseError"),
512
- // resets the lexer, sets new input
513
- setInput: /* @__PURE__ */ g(function(s, o) {
514
- return this.yy = o || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
515
- first_line: 1,
516
- first_column: 0,
517
- last_line: 1,
518
- last_column: 0
519
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
520
- }, "setInput"),
521
- // consumes and returns one char from the input
522
- input: /* @__PURE__ */ g(function() {
523
- var s = this._input[0];
524
- this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
525
- var o = s.match(/(?:\r\n?|\n).*/g);
526
- return o ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
527
- }, "input"),
528
- // unshifts one char (or a string) into the input
529
- unput: /* @__PURE__ */ g(function(s) {
530
- var o = s.length, l = s.split(/(?:\r\n?|\n)/g);
531
- this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o;
532
- var _ = this.match.split(/(?:\r\n?|\n)/g);
533
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1);
534
- var x = this.yylloc.range;
535
- return this.yylloc = {
536
- first_line: this.yylloc.first_line,
537
- last_line: this.yylineno + 1,
538
- first_column: this.yylloc.first_column,
539
- last_column: l ? (l.length === _.length ? this.yylloc.first_column : 0) + _[_.length - l.length].length - l[0].length : this.yylloc.first_column - o
540
- }, this.options.ranges && (this.yylloc.range = [x[0], x[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this;
541
- }, "unput"),
542
- // When called from action, caches matched text and appends it on next action
543
- more: /* @__PURE__ */ g(function() {
544
- return this._more = !0, this;
545
- }, "more"),
546
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
547
- reject: /* @__PURE__ */ g(function() {
548
- if (this.options.backtrack_lexer)
549
- this._backtrack = !0;
550
- else
551
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
552
- ` + this.showPosition(), {
553
- text: "",
554
- token: null,
555
- line: this.yylineno
556
- });
557
- return this;
558
- }, "reject"),
559
- // retain first n characters of the match
560
- less: /* @__PURE__ */ g(function(s) {
561
- this.unput(this.match.slice(s));
562
- }, "less"),
563
- // displays already matched input, i.e. for error messages
564
- pastInput: /* @__PURE__ */ g(function() {
565
- var s = this.matched.substr(0, this.matched.length - this.match.length);
566
- return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
567
- }, "pastInput"),
568
- // displays upcoming input, i.e. for error messages
569
- upcomingInput: /* @__PURE__ */ g(function() {
570
- var s = this.match;
571
- return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
572
- }, "upcomingInput"),
573
- // displays the character position where the lexing error occurred, i.e. for error messages
574
- showPosition: /* @__PURE__ */ g(function() {
575
- var s = this.pastInput(), o = new Array(s.length + 1).join("-");
576
- return s + this.upcomingInput() + `
577
- ` + o + "^";
578
- }, "showPosition"),
579
- // test the lexed token: return FALSE when not a match, otherwise return token
580
- test_match: /* @__PURE__ */ g(function(s, o) {
581
- var l, _, x;
582
- if (this.options.backtrack_lexer && (x = {
583
- yylineno: this.yylineno,
584
- yylloc: {
585
- first_line: this.yylloc.first_line,
586
- last_line: this.last_line,
587
- first_column: this.yylloc.first_column,
588
- last_column: this.yylloc.last_column
589
- },
590
- yytext: this.yytext,
591
- match: this.match,
592
- matches: this.matches,
593
- matched: this.matched,
594
- yyleng: this.yyleng,
595
- offset: this.offset,
596
- _more: this._more,
597
- _input: this._input,
598
- yy: this.yy,
599
- conditionStack: this.conditionStack.slice(0),
600
- done: this.done
601
- }, this.options.ranges && (x.yylloc.range = this.yylloc.range.slice(0))), _ = s[0].match(/(?:\r\n?|\n).*/g), _ && (this.yylineno += _.length), this.yylloc = {
602
- first_line: this.yylloc.last_line,
603
- last_line: this.yylineno + 1,
604
- first_column: this.yylloc.last_column,
605
- last_column: _ ? _[_.length - 1].length - _[_.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
606
- }, this.yytext += s[0], this.match += s[0], this.matches = s, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(s[0].length), this.matched += s[0], l = this.performAction.call(this, this.yy, this, o, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
607
- return l;
608
- if (this._backtrack) {
609
- for (var y in x)
610
- this[y] = x[y];
611
- return !1;
612
- }
613
- return !1;
614
- }, "test_match"),
615
- // return next match in input
616
- next: /* @__PURE__ */ g(function() {
617
- if (this.done)
618
- return this.EOF;
619
- this._input || (this.done = !0);
620
- var s, o, l, _;
621
- this._more || (this.yytext = "", this.match = "");
622
- for (var x = this._currentRules(), y = 0; y < x.length; y++)
623
- if (l = this._input.match(this.rules[x[y]]), l && (!o || l[0].length > o[0].length)) {
624
- if (o = l, _ = y, this.options.backtrack_lexer) {
625
- if (s = this.test_match(l, x[y]), s !== !1)
626
- return s;
627
- if (this._backtrack) {
628
- o = !1;
629
- continue;
630
- } else
631
- return !1;
632
- } else if (!this.options.flex)
633
- break;
634
- }
635
- return o ? (s = this.test_match(o, x[_]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
636
- ` + this.showPosition(), {
637
- text: "",
638
- token: null,
639
- line: this.yylineno
640
- });
641
- }, "next"),
642
- // return next match that has a token
643
- lex: /* @__PURE__ */ g(function() {
644
- var o = this.next();
645
- return o || this.lex();
646
- }, "lex"),
647
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
648
- begin: /* @__PURE__ */ g(function(o) {
649
- this.conditionStack.push(o);
650
- }, "begin"),
651
- // pop the previously active lexer condition state off the condition stack
652
- popState: /* @__PURE__ */ g(function() {
653
- var o = this.conditionStack.length - 1;
654
- return o > 0 ? this.conditionStack.pop() : this.conditionStack[0];
655
- }, "popState"),
656
- // produce the lexer rule set which is active for the currently active lexer condition state
657
- _currentRules: /* @__PURE__ */ g(function() {
658
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
659
- }, "_currentRules"),
660
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
661
- topState: /* @__PURE__ */ g(function(o) {
662
- return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL";
663
- }, "topState"),
664
- // alias for begin(condition)
665
- pushState: /* @__PURE__ */ g(function(o) {
666
- this.begin(o);
667
- }, "pushState"),
668
- // return the number of states currently on the stack
669
- stateStackSize: /* @__PURE__ */ g(function() {
670
- return this.conditionStack.length;
671
- }, "stateStackSize"),
672
- options: { "case-insensitive": !0 },
673
- performAction: /* @__PURE__ */ g(function(o, l, _, x) {
674
- switch (_) {
675
- case 0:
676
- return this.pushState("csv"), 4;
677
- case 1:
678
- return this.pushState("csv"), 4;
679
- case 2:
680
- return 10;
681
- case 3:
682
- return 5;
683
- case 4:
684
- return 12;
685
- case 5:
686
- return this.pushState("escaped_text"), 18;
687
- case 6:
688
- return 20;
689
- case 7:
690
- return this.popState("escaped_text"), 18;
691
- case 8:
692
- return 19;
693
- }
694
- }, "anonymous"),
695
- rules: [/^(?:sankey-beta\b)/i, /^(?:sankey\b)/i, /^(?:$)/i, /^(?:((\u000D\u000A)|(\u000A)))/i, /^(?:(\u002C))/i, /^(?:(\u0022))/i, /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i, /^(?:(\u0022)(?!(\u0022)))/i, /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],
696
- conditions: { csv: { rules: [2, 3, 4, 5, 6, 7, 8], inclusive: !1 }, escaped_text: { rules: [7, 8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8], inclusive: !0 } }
697
- };
698
- return k;
699
- }();
700
- h.lexer = b;
701
- function p() {
702
- this.yy = {};
703
- }
704
- return g(p, "Parser"), p.prototype = h, h.Parser = p, new p();
705
- }();
706
- at.parser = at;
707
- var K = at, J = [], tt = [], Z = /* @__PURE__ */ new Map(), Zt = /* @__PURE__ */ g(() => {
708
- J = [], tt = [], Z = /* @__PURE__ */ new Map(), At();
709
- }, "clear"), W, Jt = (W = class {
710
- constructor(e, i, a = 0) {
711
- this.source = e, this.target = i, this.value = a;
712
- }
713
- }, g(W, "SankeyLink"), W), te = /* @__PURE__ */ g((t, e, i) => {
714
- J.push(new Jt(t, e, i));
715
- }, "addLink"), U, ee = (U = class {
716
- constructor(e) {
717
- this.ID = e;
718
- }
719
- }, g(U, "SankeyNode"), U), ne = /* @__PURE__ */ g((t) => {
720
- t = Tt.sanitizeText(t, lt());
721
- let e = Z.get(t);
722
- return e === void 0 && (e = new ee(t), Z.set(t, e), tt.push(e)), e;
723
- }, "findOrCreateNode"), ie = /* @__PURE__ */ g(() => tt, "getNodes"), se = /* @__PURE__ */ g(() => J, "getLinks"), re = /* @__PURE__ */ g(() => ({
724
- nodes: tt.map((t) => ({ id: t.ID })),
725
- links: J.map((t) => ({
726
- source: t.source.ID,
727
- target: t.target.ID,
728
- value: t.value
729
- }))
730
- }), "getGraph"), oe = {
731
- nodesMap: Z,
732
- getConfig: /* @__PURE__ */ g(() => lt().sankey, "getConfig"),
733
- getNodes: ie,
734
- getLinks: se,
735
- getGraph: re,
736
- addLink: te,
737
- findOrCreateNode: ne,
738
- getAccTitle: St,
739
- setAccTitle: wt,
740
- getAccDescription: bt,
741
- setAccDescription: vt,
742
- getDiagramTitle: xt,
743
- setDiagramTitle: _t,
744
- clear: Zt
745
- }, j, gt = (j = class {
746
- static next(e) {
747
- return new j(e + ++j.count);
748
- }
749
- constructor(e) {
750
- this.id = e, this.href = `#${e}`;
751
- }
752
- toString() {
753
- return "url(" + this.href + ")";
754
- }
755
- }, g(j, "Uid"), j.count = 0, j), ae = {
756
- left: Ct,
757
- right: Ot,
758
- center: zt,
759
- justify: mt
760
- }, le = /* @__PURE__ */ g(function(t, e, i, a) {
761
- const { securityLevel: h, sankey: b } = lt(), p = Lt.sankey;
762
- let k;
763
- h === "sandbox" && (k = H("#i" + e));
764
- const s = h === "sandbox" ? H(k.nodes()[0].contentDocument.body) : H("body"), o = h === "sandbox" ? s.select(`[id="${e}"]`) : H(`[id="${e}"]`), l = b?.width ?? p.width, _ = b?.height ?? p.width, x = b?.useMaxWidth ?? p.useMaxWidth, y = b?.nodeAlignment ?? p.nodeAlignment, v = b?.prefix ?? p.prefix, M = b?.suffix ?? p.suffix, T = b?.showValues ?? p.showValues, N = a.db.getGraph(), C = ae[y];
765
- Bt().nodeId((d) => d.id).nodeWidth(10).nodePadding(10 + (T ? 15 : 0)).nodeAlign(C).extent([
766
- [0, 0],
767
- [l, _]
768
- ])(N);
769
- const S = Mt(It);
770
- o.append("g").attr("class", "nodes").selectAll(".node").data(N.nodes).join("g").attr("class", "node").attr("id", (d) => (d.uid = gt.next("node-")).id).attr("transform", function(d) {
771
- return "translate(" + d.x0 + "," + d.y0 + ")";
772
- }).attr("x", (d) => d.x0).attr("y", (d) => d.y0).append("rect").attr("height", (d) => d.y1 - d.y0).attr("width", (d) => d.x1 - d.x0).attr("fill", (d) => S(d.id));
773
- const P = /* @__PURE__ */ g(({ id: d, value: E }) => T ? `${d}
774
- ${v}${Math.round(E * 100) / 100}${M}` : d, "getText");
775
- o.append("g").attr("class", "node-labels").attr("font-size", 14).selectAll("text").data(N.nodes).join("text").attr("x", (d) => d.x0 < l / 2 ? d.x1 + 6 : d.x0 - 6).attr("y", (d) => (d.y1 + d.y0) / 2).attr("dy", `${T ? "0" : "0.35"}em`).attr("text-anchor", (d) => d.x0 < l / 2 ? "start" : "end").text(P);
776
- const B = o.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(N.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), O = b?.linkColor ?? "gradient";
777
- if (O === "gradient") {
778
- const d = B.append("linearGradient").attr("id", (E) => (E.uid = gt.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (E) => E.source.x1).attr("x2", (E) => E.target.x0);
779
- d.append("stop").attr("offset", "0%").attr("stop-color", (E) => S(E.source.id)), d.append("stop").attr("offset", "100%").attr("stop-color", (E) => S(E.target.id));
780
- }
781
- let z;
782
- switch (O) {
783
- case "gradient":
784
- z = /* @__PURE__ */ g((d) => d.uid, "coloring");
785
- break;
786
- case "source":
787
- z = /* @__PURE__ */ g((d) => S(d.source.id), "coloring");
788
- break;
789
- case "target":
790
- z = /* @__PURE__ */ g((d) => S(d.target.id), "coloring");
791
- break;
792
- default:
793
- z = O;
794
- }
795
- B.append("path").attr("d", Kt()).attr("stroke", z).attr("stroke-width", (d) => Math.max(1, d.width)), Et(void 0, o, 0, x);
796
- }, "draw"), ce = {
797
- draw: le
798
- }, ue = /* @__PURE__ */ g((t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
799
- `).trim(), "prepareTextForParsing"), he = /* @__PURE__ */ g((t) => `.label {
800
- font-family: ${t.fontFamily};
801
- }`, "getStyles"), fe = he, ye = K.parse.bind(K);
802
- K.parse = (t) => ye(ue(t));
803
- var me = {
804
- styles: fe,
805
- parser: K,
806
- db: oe,
807
- renderer: ce
808
- };
809
- export {
810
- me as diagram
811
- };