@omg-dev/app 0.5.1 → 0.6.1

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 (113) hide show
  1. package/dist-lib/{ChangelogPage-BzsTWlhq.js → ChangelogPage-Cjj_DiYL.js} +33 -1
  2. package/dist-lib/{File-B-qYa2zY.js → File-DQRr5F_e.js} +1761 -1826
  3. package/dist-lib/FileEditor-BrI3dfcp.js +6895 -0
  4. package/dist-lib/FileTreePane-J8P-OiHb.js +8413 -0
  5. package/dist-lib/{FileViewer-Clmf04v1.js → FileViewer-DRrfus7c.js} +1 -1
  6. package/dist-lib/{SessionFilesPanel-K4lGGdJ4.js → SessionFilesPanel-DxVJ43fE.js} +69 -69
  7. package/dist-lib/{TermView-CWr-zJmM.js → TermView-B4V-DyD-.js} +521 -530
  8. package/dist-lib/{abnfDiagram-VRR7QNED-Chn1Z_p9.js → abnfDiagram-VRR7QNED-CiXfOnAu.js} +4 -4
  9. package/dist-lib/{arc-B652oHQ-.js → arc-QOMNKQA5.js} +1 -1
  10. package/dist-lib/{architectureDiagram-ZJ3FMSHR-CMatArpz.js → architectureDiagram-ZJ3FMSHR-BcFBTmfD.js} +2059 -2064
  11. package/dist-lib/{blockDiagram-677ZJIJ3-CEOPfI9A.js → blockDiagram-677ZJIJ3-Qj8-RIV3.js} +920 -925
  12. package/dist-lib/{c4Diagram-LMCZKHZV-DcUHrESL.js → c4Diagram-LMCZKHZV-BpinEmj4.js} +598 -593
  13. package/dist-lib/{channel-B5lJFbed.js → channel-D6YHMmF7.js} +1 -1
  14. package/dist-lib/{chat-engine-P0yDhFOX.js → chat-engine-CUiDTHFP.js} +1173 -1218
  15. package/dist-lib/chunk-2Q5K7J3B-CFSi414U.js +18 -0
  16. package/dist-lib/{chunk-32BRIVSS-IYmNSvH8.js → chunk-32BRIVSS-DvywQiCk.js} +1 -1
  17. package/dist-lib/{chunk-5VM5RSS4-DO2g-xIj.js → chunk-5VM5RSS4-xd6XuI9Q.js} +1 -1
  18. package/dist-lib/{chunk-BO2N2NFS-kYiI5SD9.js → chunk-BO2N2NFS-BbJdm-59.js} +4892 -4903
  19. package/dist-lib/{chunk-EX3LRPZG-N96wfks9.js → chunk-EX3LRPZG-BLDKx-Yg.js} +507 -514
  20. package/dist-lib/chunk-JWPE2WC7-DnwG7Xzp.js +8 -0
  21. package/dist-lib/chunk-MOJQB5TN-BrENeFT5.js +670 -0
  22. package/dist-lib/chunk-RYQCIY6F-I-J4fVFd.js +313 -0
  23. package/dist-lib/{chunk-V7JOEXUC-DQwf2vkP.js → chunk-V7JOEXUC-Bkakcs1-.js} +458 -453
  24. package/dist-lib/chunk-VR4S4FIN-BDq3jZ0m.js +19 -0
  25. package/dist-lib/{chunk-XXDRQBXY-Ccv4aRcn.js → chunk-XXDRQBXY-DRKeYnrF.js} +1 -1
  26. package/dist-lib/{classDiagram-v2-EOCWNBFH-DOn-rhuL.js → classDiagram-OUVF2IWQ-DISUfvR5.js} +2 -2
  27. package/dist-lib/{classDiagram-OUVF2IWQ-DOn-rhuL.js → classDiagram-v2-EOCWNBFH-DISUfvR5.js} +2 -2
  28. package/dist-lib/{coding-agents-page-DCafIpWL.js → coding-agents-page-DtxZ0nbQ.js} +152 -131
  29. package/dist-lib/computer-page-DIJeFOZz.js +8860 -0
  30. package/dist-lib/{cose-bilkent-JH36ORCC-C-tACTrT.js → cose-bilkent-JH36ORCC-DCfmoChv.js} +281 -281
  31. package/dist-lib/{create-BrnHvSDE.js → create-CBk9uwJH.js} +2 -2
  32. package/dist-lib/cynefin-VYW2F7L2-XAY3mHv8.js +24430 -0
  33. package/dist-lib/{cynefinDiagram-TSTJHNR4-Be7CamD2.js → cynefinDiagram-TSTJHNR4-CrgvPEr1.js} +3 -3
  34. package/dist-lib/{cytoscape.esm-B0ledd6M.js → cytoscape.esm-BB6Ga9He.js} +3 -3
  35. package/dist-lib/dagre-VKFMJZFB-CE5k06mJ.js +343 -0
  36. package/dist-lib/{diagram-FQU43EPY-Jg12ow4Z.js → diagram-FQU43EPY-gOcCiJEN.js} +136 -139
  37. package/dist-lib/diagram-G47NLZAW-BVJLfRsd.js +531 -0
  38. package/dist-lib/diagram-NH7WQ7WH-u6QnHasL.js +145 -0
  39. package/dist-lib/diagram-OA4YK3LP-D4Kcl3uM.js +350 -0
  40. package/dist-lib/{diagram-WEI45ONY-D1kKPOc_.js → diagram-WEI45ONY-6a__oIb0.js} +38 -42
  41. package/dist-lib/{ebnfDiagram-CCIWWBDH-BhQWrGMc.js → ebnfDiagram-CCIWWBDH-PXSrB6lG.js} +4 -4
  42. package/dist-lib/{embedded-CLYU5z7h.js → embedded-PUsgcSTE.js} +10592 -10725
  43. package/dist-lib/{engine-compile-BeDRSL6Y.js → engine-compile-D_stzVMa.js} +2939 -2991
  44. package/dist-lib/{erDiagram-Q63AITRT-D2q6Nmwa.js → erDiagram-Q63AITRT-BbsttUCs.js} +286 -284
  45. package/dist-lib/flowDiagram-23GEKE2U-CX5x3zVA.js +1641 -0
  46. package/dist-lib/{ganttDiagram-NO4QXBWP-C_Lj-cJB.js → ganttDiagram-NO4QXBWP-Bq0aSPs8.js} +2 -2
  47. package/dist-lib/gitGraphDiagram-IHSO6WYX-BjAezjIv.js +815 -0
  48. package/dist-lib/{graph-B68L3K2T.js → graph-DAHC4kPm.js} +2 -2
  49. package/dist-lib/{highlighted-body-OFNGDK62-C2DGVKV8.js → highlighted-body-OFNGDK62-DWhG_ijx.js} +1 -1
  50. package/dist-lib/index-B0neMIbR.js +16520 -0
  51. package/dist-lib/index-BBC0E3Qg.js +4994 -0
  52. package/dist-lib/{index-Dtkd4mEk.js → index-CE7H8LiZ.js} +2 -2
  53. package/dist-lib/{index-DWkBvb-9.js → index-FgVvPpIY.js} +2 -2
  54. package/dist-lib/index.js +1 -1
  55. package/dist-lib/{infoDiagram-FWYZ7A6U-BbUkT0KS.js → infoDiagram-FWYZ7A6U-Bo_FNR91.js} +2 -2
  56. package/dist-lib/ishikawaDiagram-FXEZZL3T-C5bGD-Eb.js +624 -0
  57. package/dist-lib/{journeyDiagram-5HDEW3XC-CgykmVSC.js → journeyDiagram-5HDEW3XC-C8qM7SxF.js} +4 -4
  58. package/dist-lib/kanban-definition-HUTT4EX6-C-EK5Puz.js +724 -0
  59. package/dist-lib/{katex-jHfnQmlp.js → katex-DoRnZ_sp.js} +1 -1
  60. package/dist-lib/{layout-BGrtsiRL.js → layout-DBbo_M5I.js} +2 -2
  61. package/dist-lib/{linear-B5ZSwawJ.js → linear-zGzX0-I0.js} +1 -1
  62. package/dist-lib/{map-hbfFlSln.js → map-DRdzG8Ho.js} +1 -1
  63. package/dist-lib/mermaid-GHXKKRXX-hOE9C3qW.js +4 -0
  64. package/dist-lib/{mindmap-definition-LN4V7U3C-CfhfeEht.js → mindmap-definition-LN4V7U3C-DlVCRx6k.js} +310 -311
  65. package/dist-lib/{pegDiagram-2B236MQR-CYDAJHPF.js → pegDiagram-2B236MQR-DrKNikeG.js} +4 -4
  66. package/dist-lib/{pieDiagram-ENE6RG2P-udKxQm4p.js → pieDiagram-ENE6RG2P-Fm_jc0HL.js} +83 -84
  67. package/dist-lib/quadrantDiagram-ABIIQ3AL-zDRY0VtB.js +1029 -0
  68. package/dist-lib/{railroadDiagram-RFXS5EU6-q0Svkmuy.js → railroadDiagram-RFXS5EU6-BQuFX39y.js} +4 -4
  69. package/dist-lib/{requirementDiagram-TGXJPOKE-tNxRI1gc.js → requirementDiagram-TGXJPOKE-BWwBQZXn.js} +269 -268
  70. package/dist-lib/{resume-session-sheet-CHwpwguS.js → resume-session-sheet-DTe_2QtJ.js} +2 -3
  71. package/dist-lib/sankeyDiagram-HTMAVEWB-BjRyuB6L.js +859 -0
  72. package/dist-lib/{sequenceDiagram-DBY2YBRQ-Dvl2_CXL.js → sequenceDiagram-DBY2YBRQ-69pcw_2M.js} +892 -899
  73. package/dist-lib/{session-token-usage-BUz6b-IB.js → session-token-usage-DY4vFlfs.js} +82 -83
  74. package/dist-lib/{shadow-text-size-CBCTdbYU.js → shadow-text-size-smWA4wIU.js} +1 -2
  75. package/dist-lib/{shipped-page-CXy85bsL.js → shipped-page-B-ruG8li.js} +233 -236
  76. package/dist-lib/sizeCapture-X5ZJPWSS-DqkV8s1N.js +46 -0
  77. package/dist-lib/{stateDiagram-2N3HPSRC-CnWB7HvU.js → stateDiagram-2N3HPSRC-0vE3REl_.js} +4 -4
  78. package/dist-lib/{stateDiagram-v2-6OUMAXLB-DnZ0UI2p.js → stateDiagram-v2-6OUMAXLB-u_56Obsh.js} +2 -2
  79. package/dist-lib/{streamdown-response-CUB9sK6V.js → streamdown-response-BQy3geXs.js} +290 -297
  80. package/dist-lib/styles.css +1 -1
  81. package/dist-lib/swimlanes-5IMT3BWC-H0raIBd1.js +5332 -0
  82. package/dist-lib/{swimlanesDiagram-G3AALYLV-CKyOeqF_.js → swimlanesDiagram-G3AALYLV-By52HaDu.js} +2 -2
  83. package/dist-lib/timeline-definition-FHXFAJF6-h1LLYUQk.js +1055 -0
  84. package/dist-lib/vennDiagram-L72KCM5P-B4wDw_Kh.js +1578 -0
  85. package/dist-lib/wardleyDiagram-EHGQE667-DLMBGiwD.js +678 -0
  86. package/dist-lib/{xychartDiagram-FW5EYKEG-m3s7caPv.js → xychartDiagram-FW5EYKEG-BHvf5Noj.js} +526 -496
  87. package/package.json +4 -3
  88. package/dist-lib/FileEditor-BIz0qCyW.js +0 -6892
  89. package/dist-lib/FileTreePane-BG2k7gTc.js +0 -8422
  90. package/dist-lib/chunk-2Q5K7J3B-Ex8Ly28R.js +0 -15
  91. package/dist-lib/chunk-JWPE2WC7-DFPBClX_.js +0 -9
  92. package/dist-lib/chunk-MOJQB5TN-dusfI9ob.js +0 -664
  93. package/dist-lib/chunk-RYQCIY6F-fkeERzIG.js +0 -315
  94. package/dist-lib/chunk-VR4S4FIN-hOZG7eF3.js +0 -20
  95. package/dist-lib/cynefin-VYW2F7L2-DQXPWaog.js +0 -23853
  96. package/dist-lib/dagre-VKFMJZFB-BhCjK7XQ.js +0 -346
  97. package/dist-lib/diagram-G47NLZAW-C3_z2t6T.js +0 -530
  98. package/dist-lib/diagram-NH7WQ7WH-DUdK08IT.js +0 -143
  99. package/dist-lib/diagram-OA4YK3LP-TUUyRYY3.js +0 -353
  100. package/dist-lib/flowDiagram-23GEKE2U-DU3S3biU.js +0 -1645
  101. package/dist-lib/gitGraphDiagram-IHSO6WYX-CvGu0XAR.js +0 -828
  102. package/dist-lib/index-DcwavxA1.js +0 -5062
  103. package/dist-lib/index-JkCQXUYs.js +0 -16566
  104. package/dist-lib/ishikawaDiagram-FXEZZL3T-D_Y6Tuyb.js +0 -622
  105. package/dist-lib/kanban-definition-HUTT4EX6-CPFLTskY.js +0 -726
  106. package/dist-lib/mermaid-GHXKKRXX-Ox_2d3uB.js +0 -4
  107. package/dist-lib/quadrantDiagram-ABIIQ3AL-BmDmLczk.js +0 -1025
  108. package/dist-lib/sankeyDiagram-HTMAVEWB-B9Bl7f2P.js +0 -847
  109. package/dist-lib/sizeCapture-X5ZJPWSS-B1EeO3N9.js +0 -47
  110. package/dist-lib/swimlanes-5IMT3BWC-CvqDJcS9.js +0 -5353
  111. package/dist-lib/timeline-definition-FHXFAJF6-b15X0Oru.js +0 -1066
  112. package/dist-lib/vennDiagram-L72KCM5P-C4lh5m77.js +0 -1585
  113. package/dist-lib/wardleyDiagram-EHGQE667-Cev6fT_D.js +0 -684
@@ -1,847 +0,0 @@
1
- import { o as xt, p as _t, s as vt, g as bt, b as St, a as wt, _ as d, c as lt, b8 as Lt, d as H, ad as Et, q as At, k as Tt } from "./index-JkCQXUYs.js";
2
- import { o as Mt } from "./ordinal-DfAQgscy.js";
3
- function Nt(t) {
4
- for (var n = t.length / 6 | 0, s = new Array(n), a = 0; a < n; ) s[a] = "#" + t.slice(a * 6, ++a * 6);
5
- return s;
6
- }
7
- const Ct = Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
8
- function ct(t, n) {
9
- let s;
10
- if (n === void 0)
11
- for (const a of t)
12
- a != null && (s < a || s === void 0 && a >= a) && (s = a);
13
- else {
14
- let a = -1;
15
- for (let u of t)
16
- (u = n(u, ++a, t)) != null && (s < u || s === void 0 && u >= u) && (s = u);
17
- }
18
- return s;
19
- }
20
- function pt(t, n) {
21
- let s;
22
- if (n === void 0)
23
- for (const a of t)
24
- a != null && (s > a || s === void 0 && a >= a) && (s = a);
25
- else {
26
- let a = -1;
27
- for (let u of t)
28
- (u = n(u, ++a, t)) != null && (s > u || s === void 0 && u >= u) && (s = u);
29
- }
30
- return s;
31
- }
32
- function nt(t, n) {
33
- let s = 0;
34
- if (n === void 0)
35
- for (let a of t)
36
- (a = +a) && (s += a);
37
- else {
38
- let a = -1;
39
- for (let u of t)
40
- (u = +n(u, ++a, t)) && (s += u);
41
- }
42
- return s;
43
- }
44
- function Pt(t) {
45
- return t.target.depth;
46
- }
47
- function It(t) {
48
- return t.depth;
49
- }
50
- function Ot(t, n) {
51
- return n - 1 - t.height;
52
- }
53
- function kt(t, n) {
54
- return t.sourceLinks.length ? t.depth : n - 1;
55
- }
56
- function $t(t) {
57
- return t.targetLinks.length ? t.depth : t.sourceLinks.length ? pt(t.sourceLinks, Pt) - 1 : 0;
58
- }
59
- function X(t) {
60
- return function() {
61
- return t;
62
- };
63
- }
64
- function ut(t, n) {
65
- return Q(t.source, n.source) || t.index - n.index;
66
- }
67
- function ht(t, n) {
68
- return Q(t.target, n.target) || t.index - n.index;
69
- }
70
- function Q(t, n) {
71
- return t.y0 - n.y0;
72
- }
73
- function it(t) {
74
- return t.value;
75
- }
76
- function Dt(t) {
77
- return t.index;
78
- }
79
- function jt(t) {
80
- return t.nodes;
81
- }
82
- function zt(t) {
83
- return t.links;
84
- }
85
- function ft(t, n) {
86
- const s = t.get(n);
87
- if (!s) throw new Error("missing: " + n);
88
- return s;
89
- }
90
- function yt({ nodes: t }) {
91
- for (const n of t) {
92
- let s = n.y0, a = s;
93
- for (const u of n.sourceLinks)
94
- u.y0 = s + u.width / 2, s += u.width;
95
- for (const u of n.targetLinks)
96
- u.y1 = a + u.width / 2, a += u.width;
97
- }
98
- }
99
- function Bt() {
100
- let t = 0, n = 0, s = 1, a = 1, u = 24, y = 8, p, m = Dt, o = kt, l, h, x = jt, _ = zt, g = 6;
101
- function v() {
102
- const i = { nodes: x.apply(null, arguments), links: _.apply(null, arguments) };
103
- return T(i), A(i), M(i), I(i), S(i), yt(i), i;
104
- }
105
- v.update = function(i) {
106
- return yt(i), i;
107
- }, v.nodeId = function(i) {
108
- return arguments.length ? (m = typeof i == "function" ? i : X(i), v) : m;
109
- }, v.nodeAlign = function(i) {
110
- return arguments.length ? (o = typeof i == "function" ? i : X(i), v) : o;
111
- }, v.nodeSort = function(i) {
112
- return arguments.length ? (l = i, v) : l;
113
- }, v.nodeWidth = function(i) {
114
- return arguments.length ? (u = +i, v) : u;
115
- }, v.nodePadding = function(i) {
116
- return arguments.length ? (y = p = +i, v) : y;
117
- }, v.nodes = function(i) {
118
- return arguments.length ? (x = typeof i == "function" ? i : X(i), v) : x;
119
- }, v.links = function(i) {
120
- return arguments.length ? (_ = typeof i == "function" ? i : X(i), v) : _;
121
- }, v.linkSort = function(i) {
122
- return arguments.length ? (h = i, v) : h;
123
- }, v.size = function(i) {
124
- return arguments.length ? (t = n = 0, s = +i[0], a = +i[1], v) : [s - t, a - n];
125
- }, v.extent = function(i) {
126
- return arguments.length ? (t = +i[0][0], s = +i[1][0], n = +i[0][1], a = +i[1][1], v) : [[t, n], [s, a]];
127
- }, v.iterations = function(i) {
128
- return arguments.length ? (g = +i, v) : g;
129
- };
130
- function T({ nodes: i, links: f }) {
131
- for (const [e, r] of i.entries())
132
- r.index = e, r.sourceLinks = [], r.targetLinks = [];
133
- const c = new Map(i.map((e, r) => [m(e, r, i), e]));
134
- for (const [e, r] of f.entries()) {
135
- r.index = e;
136
- let { source: k, target: b } = r;
137
- typeof k != "object" && (k = r.source = ft(c, k)), typeof b != "object" && (b = r.target = ft(c, b)), k.sourceLinks.push(r), b.targetLinks.push(r);
138
- }
139
- if (h != null)
140
- for (const { sourceLinks: e, targetLinks: r } of i)
141
- e.sort(h), r.sort(h);
142
- }
143
- function A({ nodes: i }) {
144
- for (const f of i)
145
- f.value = f.fixedValue === void 0 ? Math.max(nt(f.sourceLinks, it), nt(f.targetLinks, it)) : f.fixedValue;
146
- }
147
- function M({ nodes: i }) {
148
- const f = i.length;
149
- let c = new Set(i), e = /* @__PURE__ */ new Set(), r = 0;
150
- for (; c.size; ) {
151
- for (const k of c) {
152
- k.depth = r;
153
- for (const { target: b } of k.sourceLinks)
154
- e.add(b);
155
- }
156
- if (++r > f) throw new Error("circular link");
157
- c = e, e = /* @__PURE__ */ new Set();
158
- }
159
- }
160
- function I({ nodes: i }) {
161
- const f = i.length;
162
- let c = new Set(i), e = /* @__PURE__ */ new Set(), r = 0;
163
- for (; c.size; ) {
164
- for (const k of c) {
165
- k.height = r;
166
- for (const { source: b } of k.targetLinks)
167
- e.add(b);
168
- }
169
- if (++r > f) throw new Error("circular link");
170
- c = e, e = /* @__PURE__ */ new Set();
171
- }
172
- }
173
- function N({ nodes: i }) {
174
- const f = ct(i, (r) => r.depth) + 1, c = (s - t - u) / (f - 1), e = new Array(f);
175
- for (const r of i) {
176
- const k = Math.max(0, Math.min(f - 1, Math.floor(o.call(null, r, f))));
177
- r.layer = k, r.x0 = t + k * c, r.x1 = r.x0 + u, e[k] ? e[k].push(r) : e[k] = [r];
178
- }
179
- if (l) for (const r of e)
180
- r.sort(l);
181
- return e;
182
- }
183
- function D(i) {
184
- const f = pt(i, (c) => (a - n - (c.length - 1) * p) / nt(c, it));
185
- for (const c of i) {
186
- let e = n;
187
- for (const r of c) {
188
- r.y0 = e, r.y1 = e + r.value * f, e = r.y1 + p;
189
- for (const k of r.sourceLinks)
190
- k.width = k.value * f;
191
- }
192
- e = (a - e + p) / (c.length + 1);
193
- for (let r = 0; r < c.length; ++r) {
194
- const k = c[r];
195
- k.y0 += e * (r + 1), k.y1 += e * (r + 1);
196
- }
197
- w(c);
198
- }
199
- }
200
- function S(i) {
201
- const f = N(i);
202
- p = Math.min(y, (a - n) / (ct(f, (c) => c.length) - 1)), D(f);
203
- for (let c = 0; c < g; ++c) {
204
- const e = Math.pow(0.99, c), r = Math.max(1 - e, (c + 1) / g);
205
- R(f, e, r), C(f, e, r);
206
- }
207
- }
208
- function C(i, f, c) {
209
- for (let e = 1, r = i.length; e < r; ++e) {
210
- const k = i[e];
211
- for (const b of k) {
212
- let L = 0, B = 0;
213
- for (const { source: Y, value: et } of b.targetLinks) {
214
- let q = et * (b.layer - Y.layer);
215
- L += P(Y, b) * q, B += q;
216
- }
217
- if (!(B > 0)) continue;
218
- let U = (L / B - b.y0) * f;
219
- b.y0 += U, b.y1 += U, z(b);
220
- }
221
- l === void 0 && k.sort(Q), j(k, c);
222
- }
223
- }
224
- function R(i, f, c) {
225
- for (let e = i.length, r = e - 2; r >= 0; --r) {
226
- const k = i[r];
227
- for (const b of k) {
228
- let L = 0, B = 0;
229
- for (const { target: Y, value: et } of b.sourceLinks) {
230
- let q = et * (Y.layer - b.layer);
231
- L += E(b, Y) * q, B += q;
232
- }
233
- if (!(B > 0)) continue;
234
- let U = (L / B - b.y0) * f;
235
- b.y0 += U, b.y1 += U, z(b);
236
- }
237
- l === void 0 && k.sort(Q), j(k, c);
238
- }
239
- }
240
- function j(i, f) {
241
- const c = i.length >> 1, e = i[c];
242
- O(i, e.y0 - p, c - 1, f), V(i, e.y1 + p, c + 1, f), O(i, a, i.length - 1, f), V(i, n, 0, f);
243
- }
244
- function V(i, f, c, e) {
245
- for (; c < i.length; ++c) {
246
- const r = i[c], k = (f - r.y0) * e;
247
- k > 1e-6 && (r.y0 += k, r.y1 += k), f = r.y1 + p;
248
- }
249
- }
250
- function O(i, f, c, e) {
251
- for (; c >= 0; --c) {
252
- const r = i[c], k = (r.y1 - f) * e;
253
- k > 1e-6 && (r.y0 -= k, r.y1 -= k), f = r.y0 - p;
254
- }
255
- }
256
- function z({ sourceLinks: i, targetLinks: f }) {
257
- if (h === void 0) {
258
- for (const { source: { sourceLinks: c } } of f)
259
- c.sort(ht);
260
- for (const { target: { targetLinks: c } } of i)
261
- c.sort(ut);
262
- }
263
- }
264
- function w(i) {
265
- if (h === void 0)
266
- for (const { sourceLinks: f, targetLinks: c } of i)
267
- f.sort(ht), c.sort(ut);
268
- }
269
- function P(i, f) {
270
- let c = i.y0 - (i.sourceLinks.length - 1) * p / 2;
271
- for (const { target: e, width: r } of i.sourceLinks) {
272
- if (e === f) break;
273
- c += r + p;
274
- }
275
- for (const { source: e, width: r } of f.targetLinks) {
276
- if (e === i) break;
277
- c -= r;
278
- }
279
- return c;
280
- }
281
- function E(i, f) {
282
- let c = f.y0 - (f.targetLinks.length - 1) * p / 2;
283
- for (const { source: e, width: r } of f.targetLinks) {
284
- if (e === i) break;
285
- c += r + p;
286
- }
287
- for (const { target: e, width: r } of i.sourceLinks) {
288
- if (e === f) break;
289
- c -= r;
290
- }
291
- return c;
292
- }
293
- return v;
294
- }
295
- var rt = Math.PI, st = 2 * rt, F = 1e-6, Ft = st - F;
296
- function ot() {
297
- this._x0 = this._y0 = // start of current subpath
298
- this._x1 = this._y1 = null, this._ = "";
299
- }
300
- function mt() {
301
- return new ot();
302
- }
303
- ot.prototype = mt.prototype = {
304
- constructor: ot,
305
- moveTo: function(t, n) {
306
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n);
307
- },
308
- closePath: function() {
309
- this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
310
- },
311
- lineTo: function(t, n) {
312
- this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n);
313
- },
314
- quadraticCurveTo: function(t, n, s, a) {
315
- this._ += "Q" + +t + "," + +n + "," + (this._x1 = +s) + "," + (this._y1 = +a);
316
- },
317
- bezierCurveTo: function(t, n, s, a, u, y) {
318
- this._ += "C" + +t + "," + +n + "," + +s + "," + +a + "," + (this._x1 = +u) + "," + (this._y1 = +y);
319
- },
320
- arcTo: function(t, n, s, a, u) {
321
- t = +t, n = +n, s = +s, a = +a, u = +u;
322
- var y = this._x1, p = this._y1, m = s - t, o = a - n, l = y - t, h = p - n, x = l * l + h * h;
323
- if (u < 0) throw new Error("negative radius: " + u);
324
- if (this._x1 === null)
325
- this._ += "M" + (this._x1 = t) + "," + (this._y1 = n);
326
- else if (x > F) if (!(Math.abs(h * m - o * l) > F) || !u)
327
- this._ += "L" + (this._x1 = t) + "," + (this._y1 = n);
328
- else {
329
- var _ = s - y, g = a - p, v = m * m + o * o, T = _ * _ + g * g, A = Math.sqrt(v), M = Math.sqrt(x), I = u * Math.tan((rt - Math.acos((v + x - T) / (2 * A * M))) / 2), N = I / M, D = I / A;
330
- Math.abs(N - 1) > F && (this._ += "L" + (t + N * l) + "," + (n + N * h)), this._ += "A" + u + "," + u + ",0,0," + +(h * _ > l * g) + "," + (this._x1 = t + D * m) + "," + (this._y1 = n + D * o);
331
- }
332
- },
333
- arc: function(t, n, s, a, u, y) {
334
- t = +t, n = +n, s = +s, y = !!y;
335
- var p = s * Math.cos(a), m = s * Math.sin(a), o = t + p, l = n + m, h = 1 ^ y, x = y ? a - u : u - a;
336
- if (s < 0) throw new Error("negative radius: " + s);
337
- this._x1 === null ? this._ += "M" + o + "," + l : (Math.abs(this._x1 - o) > F || Math.abs(this._y1 - l) > F) && (this._ += "L" + o + "," + l), s && (x < 0 && (x = x % st + st), x > Ft ? this._ += "A" + s + "," + s + ",0,1," + h + "," + (t - p) + "," + (n - m) + "A" + s + "," + s + ",0,1," + h + "," + (this._x1 = o) + "," + (this._y1 = l) : x > F && (this._ += "A" + s + "," + s + ",0," + +(x >= rt) + "," + h + "," + (this._x1 = t + s * Math.cos(u)) + "," + (this._y1 = n + s * Math.sin(u))));
338
- },
339
- rect: function(t, n, s, a) {
340
- this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n) + "h" + +s + "v" + +a + "h" + -s + "Z";
341
- },
342
- toString: function() {
343
- return this._;
344
- }
345
- };
346
- function dt(t) {
347
- return function() {
348
- return t;
349
- };
350
- }
351
- function Rt(t) {
352
- return t[0];
353
- }
354
- function Vt(t) {
355
- return t[1];
356
- }
357
- var Wt = Array.prototype.slice;
358
- function Gt(t) {
359
- return t.source;
360
- }
361
- function Ut(t) {
362
- return t.target;
363
- }
364
- function Yt(t) {
365
- var n = Gt, s = Ut, a = Rt, u = Vt, y = null;
366
- function p() {
367
- var m, o = Wt.call(arguments), l = n.apply(this, o), h = s.apply(this, o);
368
- if (y || (y = m = mt()), t(y, +a.apply(this, (o[0] = l, o)), +u.apply(this, o), +a.apply(this, (o[0] = h, o)), +u.apply(this, o)), m) return y = null, m + "" || null;
369
- }
370
- return p.source = function(m) {
371
- return arguments.length ? (n = m, p) : n;
372
- }, p.target = function(m) {
373
- return arguments.length ? (s = m, p) : s;
374
- }, p.x = function(m) {
375
- return arguments.length ? (a = typeof m == "function" ? m : dt(+m), p) : a;
376
- }, p.y = function(m) {
377
- return arguments.length ? (u = typeof m == "function" ? m : dt(+m), p) : u;
378
- }, p.context = function(m) {
379
- return arguments.length ? (y = m ?? null, p) : y;
380
- }, p;
381
- }
382
- function qt(t, n, s, a, u) {
383
- t.moveTo(n, s), t.bezierCurveTo(n = (n + a) / 2, s, n, u, a, u);
384
- }
385
- function Ht() {
386
- return Yt(qt);
387
- }
388
- function Xt(t) {
389
- return [t.source.x1, t.y0];
390
- }
391
- function Qt(t) {
392
- return [t.target.x0, t.y1];
393
- }
394
- function Kt() {
395
- return Ht().source(Xt).target(Qt);
396
- }
397
- var at = (function() {
398
- var t = /* @__PURE__ */ d(function(m, o, l, h) {
399
- for (l = l || {}, h = m.length; h--; l[m[h]] = o) ;
400
- return l;
401
- }, "o"), n = [1, 9], s = [1, 10], a = [1, 5, 10, 12], u = {
402
- trace: /* @__PURE__ */ d(function() {
403
- }, "trace"),
404
- yy: {},
405
- 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 },
406
- 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" },
407
- productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
408
- performAction: /* @__PURE__ */ d(function(o, l, h, x, _, g, v) {
409
- var T = g.length - 1;
410
- switch (_) {
411
- case 7:
412
- const A = x.findOrCreateNode(g[T - 4].trim().replaceAll('""', '"')), M = x.findOrCreateNode(g[T - 2].trim().replaceAll('""', '"')), I = parseFloat(g[T].trim());
413
- x.addLink(A, M, I);
414
- break;
415
- case 8:
416
- case 9:
417
- case 11:
418
- this.$ = g[T];
419
- break;
420
- case 10:
421
- this.$ = g[T - 1];
422
- break;
423
- }
424
- }, "anonymous"),
425
- 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])],
426
- defaultActions: { 11: [2, 1], 12: [2, 5] },
427
- parseError: /* @__PURE__ */ d(function(o, l) {
428
- if (l.recoverable)
429
- this.trace(o);
430
- else {
431
- var h = new Error(o);
432
- throw h.hash = l, h;
433
- }
434
- }, "parseError"),
435
- parse: /* @__PURE__ */ d(function(o) {
436
- var l = this, h = [0], x = [], _ = [null], g = [], v = this.table, T = "", A = 0, M = 0, I = 2, N = 1, D = g.slice.call(arguments, 1), S = Object.create(this.lexer), C = { yy: {} };
437
- for (var R in this.yy)
438
- Object.prototype.hasOwnProperty.call(this.yy, R) && (C.yy[R] = this.yy[R]);
439
- S.setInput(o, C.yy), C.yy.lexer = S, C.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
440
- var j = S.yylloc;
441
- g.push(j);
442
- var V = S.options && S.options.ranges;
443
- typeof C.yy.parseError == "function" ? this.parseError = C.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
444
- function O(L) {
445
- h.length = h.length - 2 * L, _.length = _.length - L, g.length = g.length - L;
446
- }
447
- d(O, "popStack");
448
- function z() {
449
- var L;
450
- return L = x.pop() || S.lex() || N, typeof L != "number" && (L instanceof Array && (x = L, L = x.pop()), L = l.symbols_[L] || L), L;
451
- }
452
- d(z, "lex");
453
- for (var w, P, E, i, f = {}, c, e, r, k; ; ) {
454
- if (P = h[h.length - 1], this.defaultActions[P] ? E = this.defaultActions[P] : ((w === null || typeof w > "u") && (w = z()), E = v[P] && v[P][w]), typeof E > "u" || !E.length || !E[0]) {
455
- var b = "";
456
- k = [];
457
- for (c in v[P])
458
- this.terminals_[c] && c > I && k.push("'" + this.terminals_[c] + "'");
459
- S.showPosition ? b = "Parse error on line " + (A + 1) + `:
460
- ` + S.showPosition() + `
461
- Expecting ` + k.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : b = "Parse error on line " + (A + 1) + ": Unexpected " + (w == N ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(b, {
462
- text: S.match,
463
- token: this.terminals_[w] || w,
464
- line: S.yylineno,
465
- loc: j,
466
- expected: k
467
- });
468
- }
469
- if (E[0] instanceof Array && E.length > 1)
470
- throw new Error("Parse Error: multiple actions possible at state: " + P + ", token: " + w);
471
- switch (E[0]) {
472
- case 1:
473
- h.push(w), _.push(S.yytext), g.push(S.yylloc), h.push(E[1]), w = null, M = S.yyleng, T = S.yytext, A = S.yylineno, j = S.yylloc;
474
- break;
475
- case 2:
476
- if (e = this.productions_[E[1]][1], f.$ = _[_.length - e], f._$ = {
477
- first_line: g[g.length - (e || 1)].first_line,
478
- last_line: g[g.length - 1].last_line,
479
- first_column: g[g.length - (e || 1)].first_column,
480
- last_column: g[g.length - 1].last_column
481
- }, V && (f._$.range = [
482
- g[g.length - (e || 1)].range[0],
483
- g[g.length - 1].range[1]
484
- ]), i = this.performAction.apply(f, [
485
- T,
486
- M,
487
- A,
488
- C.yy,
489
- E[1],
490
- _,
491
- g
492
- ].concat(D)), typeof i < "u")
493
- return i;
494
- e && (h = h.slice(0, -1 * e * 2), _ = _.slice(0, -1 * e), g = g.slice(0, -1 * e)), h.push(this.productions_[E[1]][0]), _.push(f.$), g.push(f._$), r = v[h[h.length - 2]][h[h.length - 1]], h.push(r);
495
- break;
496
- case 3:
497
- return !0;
498
- }
499
- }
500
- return !0;
501
- }, "parse")
502
- }, y = /* @__PURE__ */ (function() {
503
- var m = {
504
- EOF: 1,
505
- parseError: /* @__PURE__ */ d(function(l, h) {
506
- if (this.yy.parser)
507
- this.yy.parser.parseError(l, h);
508
- else
509
- throw new Error(l);
510
- }, "parseError"),
511
- // resets the lexer, sets new input
512
- setInput: /* @__PURE__ */ d(function(o, l) {
513
- return this.yy = l || this.yy || {}, this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
514
- first_line: 1,
515
- first_column: 0,
516
- last_line: 1,
517
- last_column: 0
518
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
519
- }, "setInput"),
520
- // consumes and returns one char from the input
521
- input: /* @__PURE__ */ d(function() {
522
- var o = this._input[0];
523
- this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o;
524
- var l = o.match(/(?:\r\n?|\n).*/g);
525
- return l ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o;
526
- }, "input"),
527
- // unshifts one char (or a string) into the input
528
- unput: /* @__PURE__ */ d(function(o) {
529
- var l = o.length, h = o.split(/(?:\r\n?|\n)/g);
530
- this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
531
- var x = this.match.split(/(?:\r\n?|\n)/g);
532
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), h.length - 1 && (this.yylineno -= h.length - 1);
533
- var _ = this.yylloc.range;
534
- return this.yylloc = {
535
- first_line: this.yylloc.first_line,
536
- last_line: this.yylineno + 1,
537
- first_column: this.yylloc.first_column,
538
- last_column: h ? (h.length === x.length ? this.yylloc.first_column : 0) + x[x.length - h.length].length - h[0].length : this.yylloc.first_column - l
539
- }, this.options.ranges && (this.yylloc.range = [_[0], _[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
540
- }, "unput"),
541
- // When called from action, caches matched text and appends it on next action
542
- more: /* @__PURE__ */ d(function() {
543
- return this._more = !0, this;
544
- }, "more"),
545
- // 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.
546
- reject: /* @__PURE__ */ d(function() {
547
- if (this.options.backtrack_lexer)
548
- this._backtrack = !0;
549
- else
550
- 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).
551
- ` + this.showPosition(), {
552
- text: "",
553
- token: null,
554
- line: this.yylineno
555
- });
556
- return this;
557
- }, "reject"),
558
- // retain first n characters of the match
559
- less: /* @__PURE__ */ d(function(o) {
560
- this.unput(this.match.slice(o));
561
- }, "less"),
562
- // displays already matched input, i.e. for error messages
563
- pastInput: /* @__PURE__ */ d(function() {
564
- var o = this.matched.substr(0, this.matched.length - this.match.length);
565
- return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, "");
566
- }, "pastInput"),
567
- // displays upcoming input, i.e. for error messages
568
- upcomingInput: /* @__PURE__ */ d(function() {
569
- var o = this.match;
570
- return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, "");
571
- }, "upcomingInput"),
572
- // displays the character position where the lexing error occurred, i.e. for error messages
573
- showPosition: /* @__PURE__ */ d(function() {
574
- var o = this.pastInput(), l = new Array(o.length + 1).join("-");
575
- return o + this.upcomingInput() + `
576
- ` + l + "^";
577
- }, "showPosition"),
578
- // test the lexed token: return FALSE when not a match, otherwise return token
579
- test_match: /* @__PURE__ */ d(function(o, l) {
580
- var h, x, _;
581
- if (this.options.backtrack_lexer && (_ = {
582
- yylineno: this.yylineno,
583
- yylloc: {
584
- first_line: this.yylloc.first_line,
585
- last_line: this.last_line,
586
- first_column: this.yylloc.first_column,
587
- last_column: this.yylloc.last_column
588
- },
589
- yytext: this.yytext,
590
- match: this.match,
591
- matches: this.matches,
592
- matched: this.matched,
593
- yyleng: this.yyleng,
594
- offset: this.offset,
595
- _more: this._more,
596
- _input: this._input,
597
- yy: this.yy,
598
- conditionStack: this.conditionStack.slice(0),
599
- done: this.done
600
- }, this.options.ranges && (_.yylloc.range = this.yylloc.range.slice(0))), x = o[0].match(/(?:\r\n?|\n).*/g), x && (this.yylineno += x.length), this.yylloc = {
601
- first_line: this.yylloc.last_line,
602
- last_line: this.yylineno + 1,
603
- first_column: this.yylloc.last_column,
604
- last_column: x ? x[x.length - 1].length - x[x.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length
605
- }, this.yytext += o[0], this.match += o[0], this.matches = o, 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(o[0].length), this.matched += o[0], h = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), h)
606
- return h;
607
- if (this._backtrack) {
608
- for (var g in _)
609
- this[g] = _[g];
610
- return !1;
611
- }
612
- return !1;
613
- }, "test_match"),
614
- // return next match in input
615
- next: /* @__PURE__ */ d(function() {
616
- if (this.done)
617
- return this.EOF;
618
- this._input || (this.done = !0);
619
- var o, l, h, x;
620
- this._more || (this.yytext = "", this.match = "");
621
- for (var _ = this._currentRules(), g = 0; g < _.length; g++)
622
- if (h = this._input.match(this.rules[_[g]]), h && (!l || h[0].length > l[0].length)) {
623
- if (l = h, x = g, this.options.backtrack_lexer) {
624
- if (o = this.test_match(h, _[g]), o !== !1)
625
- return o;
626
- if (this._backtrack) {
627
- l = !1;
628
- continue;
629
- } else
630
- return !1;
631
- } else if (!this.options.flex)
632
- break;
633
- }
634
- return l ? (o = this.test_match(l, _[x]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
635
- ` + this.showPosition(), {
636
- text: "",
637
- token: null,
638
- line: this.yylineno
639
- });
640
- }, "next"),
641
- // return next match that has a token
642
- lex: /* @__PURE__ */ d(function() {
643
- var l = this.next();
644
- return l || this.lex();
645
- }, "lex"),
646
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
647
- begin: /* @__PURE__ */ d(function(l) {
648
- this.conditionStack.push(l);
649
- }, "begin"),
650
- // pop the previously active lexer condition state off the condition stack
651
- popState: /* @__PURE__ */ d(function() {
652
- var l = this.conditionStack.length - 1;
653
- return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
654
- }, "popState"),
655
- // produce the lexer rule set which is active for the currently active lexer condition state
656
- _currentRules: /* @__PURE__ */ d(function() {
657
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
658
- }, "_currentRules"),
659
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
660
- topState: /* @__PURE__ */ d(function(l) {
661
- return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
662
- }, "topState"),
663
- // alias for begin(condition)
664
- pushState: /* @__PURE__ */ d(function(l) {
665
- this.begin(l);
666
- }, "pushState"),
667
- // return the number of states currently on the stack
668
- stateStackSize: /* @__PURE__ */ d(function() {
669
- return this.conditionStack.length;
670
- }, "stateStackSize"),
671
- options: { "case-insensitive": !0 },
672
- performAction: /* @__PURE__ */ d(function(l, h, x, _) {
673
- switch (x) {
674
- case 0:
675
- return this.pushState("csv"), 4;
676
- case 1:
677
- return this.pushState("csv"), 4;
678
- case 2:
679
- return 10;
680
- case 3:
681
- return 5;
682
- case 4:
683
- return 12;
684
- case 5:
685
- return this.pushState("escaped_text"), 18;
686
- case 6:
687
- return 20;
688
- case 7:
689
- return this.popState("escaped_text"), 18;
690
- case 8:
691
- return 19;
692
- }
693
- }, "anonymous"),
694
- 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],
695
- 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 } }
696
- };
697
- return m;
698
- })();
699
- u.lexer = y;
700
- function p() {
701
- this.yy = {};
702
- }
703
- return d(p, "Parser"), p.prototype = u, u.Parser = p, new p();
704
- })();
705
- at.parser = at;
706
- var K = at, J = [], tt = [], Z = /* @__PURE__ */ new Map(), Zt = /* @__PURE__ */ d(() => {
707
- J = [], tt = [], Z = /* @__PURE__ */ new Map(), At();
708
- }, "clear"), W, Jt = (W = class {
709
- constructor(n, s, a = 0) {
710
- this.source = n, this.target = s, this.value = a;
711
- }
712
- }, d(W, "SankeyLink"), W), te = /* @__PURE__ */ d((t, n, s) => {
713
- J.push(new Jt(t, n, s));
714
- }, "addLink"), G, ee = (G = class {
715
- constructor(n) {
716
- this.ID = n;
717
- }
718
- }, d(G, "SankeyNode"), G), ne = /* @__PURE__ */ d((t) => {
719
- t = Tt.sanitizeText(t, lt());
720
- let n = Z.get(t);
721
- return n === void 0 && (n = new ee(t), Z.set(t, n), tt.push(n)), n;
722
- }, "findOrCreateNode"), ie = /* @__PURE__ */ d(() => tt, "getNodes"), re = /* @__PURE__ */ d(() => J, "getLinks"), se = /* @__PURE__ */ d(() => ({
723
- nodes: tt.map((t) => ({ id: t.ID })),
724
- links: J.map((t) => ({
725
- source: t.source.ID,
726
- target: t.target.ID,
727
- value: t.value
728
- }))
729
- }), "getGraph"), oe = {
730
- nodesMap: Z,
731
- getConfig: /* @__PURE__ */ d(() => lt().sankey, "getConfig"),
732
- getNodes: ie,
733
- getLinks: re,
734
- getGraph: se,
735
- addLink: te,
736
- findOrCreateNode: ne,
737
- getAccTitle: wt,
738
- setAccTitle: St,
739
- getAccDescription: bt,
740
- setAccDescription: vt,
741
- getDiagramTitle: _t,
742
- setDiagramTitle: xt,
743
- clear: Zt
744
- }, $, gt = ($ = class {
745
- static next(n) {
746
- return new $(n + ++$.count);
747
- }
748
- constructor(n) {
749
- this.id = n, this.href = `#${n}`;
750
- }
751
- toString() {
752
- return "url(" + this.href + ")";
753
- }
754
- }, d($, "Uid"), $.count = 0, $), ae = {
755
- left: It,
756
- right: Ot,
757
- center: $t,
758
- justify: kt
759
- }, le = /* @__PURE__ */ d((t) => {
760
- let n = 0, s = 0;
761
- for (const a of t) {
762
- const u = a.value ?? 0;
763
- u > n && (n = u, s = a.layer ?? 0);
764
- }
765
- return s;
766
- }, "findCentralNodeLayer"), ce = /* @__PURE__ */ d(function(t, n, s, a) {
767
- const { securityLevel: u, sankey: y } = lt(), p = Lt.sankey;
768
- let m;
769
- u === "sandbox" && (m = H("#i" + n));
770
- const o = u === "sandbox" ? H(m.nodes()[0].contentDocument.body) : H("body"), l = u === "sandbox" ? o.select(`[id="${n}"]`) : H(`[id="${n}"]`), h = (y == null ? void 0 : y.width) ?? p.width, x = (y == null ? void 0 : y.height) ?? p.width, _ = (y == null ? void 0 : y.useMaxWidth) ?? p.useMaxWidth, g = (y == null ? void 0 : y.nodeAlignment) ?? p.nodeAlignment, v = (y == null ? void 0 : y.prefix) ?? p.prefix, T = (y == null ? void 0 : y.suffix) ?? p.suffix, A = (y == null ? void 0 : y.showValues) ?? p.showValues, M = (y == null ? void 0 : y.nodeWidth) ?? p.nodeWidth ?? 10, I = (y == null ? void 0 : y.nodePadding) ?? p.nodePadding ?? 12, N = (y == null ? void 0 : y.labelStyle) ?? p.labelStyle ?? "legacy", D = (y == null ? void 0 : y.nodeColors) ?? {}, S = a.db.getGraph(), C = ae[g];
771
- Bt().nodeId((e) => e.id).nodeWidth(M).nodePadding(I + (A ? 15 : 0)).nodeAlign(C).extent([
772
- [0, 0],
773
- [h, x]
774
- ])(S);
775
- const j = le(S.nodes), V = Mt(Ct), O = /* @__PURE__ */ d((e) => D[e] ?? V(e), "getNodeColor");
776
- l.append("g").attr("class", "nodes").selectAll(".node").data(S.nodes).join("g").attr("class", "node").attr("id", (e) => (e.uid = gt.next("node-")).id).attr("transform", function(e) {
777
- return "translate(" + e.x0 + "," + e.y0 + ")";
778
- }).attr("x", (e) => e.x0).attr("y", (e) => e.y0).append("rect").attr("height", (e) => e.y1 - e.y0).attr("width", (e) => e.x1 - e.x0).attr("fill", (e) => O(e.id));
779
- const z = /* @__PURE__ */ d(({ id: e, value: r }) => A ? `${e}
780
- ${v}${Math.round(r * 100) / 100}${T}` : e, "getText"), w = /* @__PURE__ */ d((e) => N === "outlined" ? (e.layer ?? 0) < j ? { x: e.x0 - 6, anchor: "end" } : { x: e.x1 + 6, anchor: "start" } : e.x0 < h / 2 ? { x: e.x1 + 6, anchor: "start" } : { x: e.x0 - 6, anchor: "end" }, "getLabelPosition"), P = l.append("g").attr("class", "node-labels").attr("font-size", 14), E = /* @__PURE__ */ d((e) => P.selectAll(e ? `.${e}` : "text").data(S.nodes).join("text").attr("class", e ?? null).attr("x", (r) => w(r).x).attr("y", (r) => (r.y1 + r.y0) / 2).attr("dy", `${A ? "0" : "0.35"}em`).attr("text-anchor", (r) => w(r).anchor).text(z), "appendLabel");
781
- N === "outlined" ? (E("sankey-label-bg"), E("sankey-label-fg")) : E();
782
- const i = l.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(S.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), f = (y == null ? void 0 : y.linkColor) ?? "gradient";
783
- if (f === "gradient") {
784
- const e = i.append("linearGradient").attr("id", (r) => (r.uid = gt.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (r) => r.source.x1).attr("x2", (r) => r.target.x0);
785
- e.append("stop").attr("offset", "0%").attr("stop-color", (r) => O(r.source.id)), e.append("stop").attr("offset", "100%").attr("stop-color", (r) => O(r.target.id));
786
- }
787
- let c;
788
- switch (f) {
789
- case "gradient":
790
- c = /* @__PURE__ */ d((e) => e.uid, "coloring");
791
- break;
792
- case "source":
793
- c = /* @__PURE__ */ d((e) => O(e.source.id), "coloring");
794
- break;
795
- case "target":
796
- c = /* @__PURE__ */ d((e) => O(e.target.id), "coloring");
797
- break;
798
- default:
799
- c = f;
800
- }
801
- i.append("path").attr("d", Kt()).attr("stroke", c).attr("stroke-width", (e) => Math.max(1, e.width)), Et(void 0, l, 0, _);
802
- }, "draw"), ue = {
803
- draw: ce
804
- }, he = /* @__PURE__ */ d((t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
805
- `).trim(), "prepareTextForParsing"), fe = /* @__PURE__ */ d((t) => `.label {
806
- font-family: ${t.fontFamily};
807
- }
808
-
809
- .node-labels {
810
- font-family: ${t.fontFamily};
811
- }
812
-
813
- /* Outlined label style - background stroke for better readability */
814
- .sankey-label-bg {
815
- stroke: ${t.mainBkg || t.background || "#fff"};
816
- stroke-width: 4px;
817
- stroke-linejoin: round;
818
- paint-order: stroke;
819
- }
820
-
821
- /* Foreground label text */
822
- .sankey-label-fg {
823
- fill: ${t.textColor};
824
- }
825
-
826
- /* Node styling */
827
- .node rect {
828
- shape-rendering: crispEdges;
829
- }
830
-
831
- /* Link styling */
832
- .link {
833
- fill: none;
834
- stroke-opacity: 0.5;
835
- mix-blend-mode: multiply;
836
- }
837
- `, "getStyles"), ye = fe, de = K.parse.bind(K);
838
- K.parse = (t) => de(he(t));
839
- var ke = {
840
- styles: ye,
841
- parser: K,
842
- db: oe,
843
- renderer: ue
844
- };
845
- export {
846
- ke as diagram
847
- };