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