simple-code-graph-viewer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3634 @@
1
+ const Te = ["1.0"];
2
+ class B extends Error {
3
+ constructor(e) {
4
+ super(e), this.name = "SchemaValidationError";
5
+ }
6
+ }
7
+ function hu(t) {
8
+ if (typeof t != "object" || t === null)
9
+ throw new B("Graph data must be a non-null object");
10
+ const e = t;
11
+ if (typeof e.schema_version != "string")
12
+ throw new B("Missing or invalid schema_version");
13
+ if (!Te.includes(e.schema_version))
14
+ throw new B(
15
+ `Unsupported schema_version "${e.schema_version}". Supported: ${Te.join(", ")}`
16
+ );
17
+ if (typeof e.meta != "object" || e.meta === null)
18
+ throw new B("meta must be a non-null object");
19
+ if (!Array.isArray(e.nodes))
20
+ throw new B("nodes must be an array");
21
+ for (let r = 0; r < e.nodes.length; r++) {
22
+ const i = e.nodes[r];
23
+ if (typeof i.id != "string")
24
+ throw new B(`nodes[${r}] must have a string "id"`);
25
+ if (typeof i.name != "string")
26
+ throw new B(`nodes[${r}] must have a string "name"`);
27
+ if (typeof i.kind != "string")
28
+ throw new B(`nodes[${r}] must have a string "kind"`);
29
+ if (typeof i.language != "string")
30
+ throw new B(`nodes[${r}] must have a string "language"`);
31
+ if (typeof i.metrics != "object" || i.metrics === null)
32
+ throw new B(`nodes[${r}] must have a non-null object "metrics"`);
33
+ if (!Array.isArray(i.tags))
34
+ throw new B(`nodes[${r}] must have an array "tags"`);
35
+ if (i.metrics != null && typeof i.metrics == "object") {
36
+ const o = i.metrics;
37
+ "functions" in o && !Array.isArray(o.functions) && console.warn(
38
+ `Warning: nodes[${r}].metrics.functions should be an array`
39
+ );
40
+ }
41
+ }
42
+ if (!Array.isArray(e.links))
43
+ throw new B("links must be an array");
44
+ for (let r = 0; r < e.links.length; r++) {
45
+ const i = e.links[r];
46
+ if (typeof i.source != "string")
47
+ throw new B(`links[${r}] must have a string "source"`);
48
+ if (typeof i.target != "string")
49
+ throw new B(`links[${r}] must have a string "target"`);
50
+ if (typeof i.kind != "string")
51
+ throw new B(`links[${r}] must have a string "kind"`);
52
+ if (typeof i.weight != "number")
53
+ throw new B(`links[${r}] must have a number "weight"`);
54
+ if (!Array.isArray(i.evidence))
55
+ throw new B(`links[${r}] must have an array "evidence"`);
56
+ }
57
+ const n = new Set(
58
+ e.nodes.map((r) => r.id)
59
+ );
60
+ if (n.size !== e.nodes.length)
61
+ throw new B("Duplicate node IDs detected");
62
+ for (const r of e.links)
63
+ n.has(r.source) || console.warn(
64
+ `Warning: link source "${r.source}" does not match any node id`
65
+ ), n.has(r.target) || console.warn(
66
+ `Warning: link target "${r.target}" does not match any node id`
67
+ );
68
+ return t;
69
+ }
70
+ var ue = "http://www.w3.org/1999/xhtml";
71
+ const Ie = {
72
+ svg: "http://www.w3.org/2000/svg",
73
+ xhtml: ue,
74
+ xlink: "http://www.w3.org/1999/xlink",
75
+ xml: "http://www.w3.org/XML/1998/namespace",
76
+ xmlns: "http://www.w3.org/2000/xmlns/"
77
+ };
78
+ function te(t) {
79
+ var e = t += "", n = e.indexOf(":");
80
+ return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Ie.hasOwnProperty(e) ? { space: Ie[e], local: t } : t;
81
+ }
82
+ function Yn(t) {
83
+ return function() {
84
+ var e = this.ownerDocument, n = this.namespaceURI;
85
+ return n === ue && e.documentElement.namespaceURI === ue ? e.createElement(t) : e.createElementNS(n, t);
86
+ };
87
+ }
88
+ function Gn(t) {
89
+ return function() {
90
+ return this.ownerDocument.createElementNS(t.space, t.local);
91
+ };
92
+ }
93
+ function ln(t) {
94
+ var e = te(t);
95
+ return (e.local ? Gn : Yn)(e);
96
+ }
97
+ function Un() {
98
+ }
99
+ function ve(t) {
100
+ return t == null ? Un : function() {
101
+ return this.querySelector(t);
102
+ };
103
+ }
104
+ function Kn(t) {
105
+ typeof t != "function" && (t = ve(t));
106
+ for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
107
+ for (var o = e[i], a = o.length, s = r[i] = new Array(a), c, u, l = 0; l < a; ++l)
108
+ (c = o[l]) && (u = t.call(c, c.__data__, l, o)) && ("__data__" in c && (u.__data__ = c.__data__), s[l] = u);
109
+ return new K(r, this._parents);
110
+ }
111
+ function Wn(t) {
112
+ return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
113
+ }
114
+ function Zn() {
115
+ return [];
116
+ }
117
+ function fn(t) {
118
+ return t == null ? Zn : function() {
119
+ return this.querySelectorAll(t);
120
+ };
121
+ }
122
+ function Qn(t) {
123
+ return function() {
124
+ return Wn(t.apply(this, arguments));
125
+ };
126
+ }
127
+ function Jn(t) {
128
+ typeof t == "function" ? t = Qn(t) : t = fn(t);
129
+ for (var e = this._groups, n = e.length, r = [], i = [], o = 0; o < n; ++o)
130
+ for (var a = e[o], s = a.length, c, u = 0; u < s; ++u)
131
+ (c = a[u]) && (r.push(t.call(c, c.__data__, u, a)), i.push(c));
132
+ return new K(r, i);
133
+ }
134
+ function hn(t) {
135
+ return function() {
136
+ return this.matches(t);
137
+ };
138
+ }
139
+ function dn(t) {
140
+ return function(e) {
141
+ return e.matches(t);
142
+ };
143
+ }
144
+ var jn = Array.prototype.find;
145
+ function tr(t) {
146
+ return function() {
147
+ return jn.call(this.children, t);
148
+ };
149
+ }
150
+ function er() {
151
+ return this.firstElementChild;
152
+ }
153
+ function nr(t) {
154
+ return this.select(t == null ? er : tr(typeof t == "function" ? t : dn(t)));
155
+ }
156
+ var rr = Array.prototype.filter;
157
+ function ir() {
158
+ return Array.from(this.children);
159
+ }
160
+ function or(t) {
161
+ return function() {
162
+ return rr.call(this.children, t);
163
+ };
164
+ }
165
+ function ar(t) {
166
+ return this.selectAll(t == null ? ir : or(typeof t == "function" ? t : dn(t)));
167
+ }
168
+ function sr(t) {
169
+ typeof t != "function" && (t = hn(t));
170
+ for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
171
+ for (var o = e[i], a = o.length, s = r[i] = [], c, u = 0; u < a; ++u)
172
+ (c = o[u]) && t.call(c, c.__data__, u, o) && s.push(c);
173
+ return new K(r, this._parents);
174
+ }
175
+ function mn(t) {
176
+ return new Array(t.length);
177
+ }
178
+ function ur() {
179
+ return new K(this._enter || this._groups.map(mn), this._parents);
180
+ }
181
+ function qt(t, e) {
182
+ this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
183
+ }
184
+ qt.prototype = {
185
+ constructor: qt,
186
+ appendChild: function(t) {
187
+ return this._parent.insertBefore(t, this._next);
188
+ },
189
+ insertBefore: function(t, e) {
190
+ return this._parent.insertBefore(t, e);
191
+ },
192
+ querySelector: function(t) {
193
+ return this._parent.querySelector(t);
194
+ },
195
+ querySelectorAll: function(t) {
196
+ return this._parent.querySelectorAll(t);
197
+ }
198
+ };
199
+ function cr(t) {
200
+ return function() {
201
+ return t;
202
+ };
203
+ }
204
+ function lr(t, e, n, r, i, o) {
205
+ for (var a = 0, s, c = e.length, u = o.length; a < u; ++a)
206
+ (s = e[a]) ? (s.__data__ = o[a], r[a] = s) : n[a] = new qt(t, o[a]);
207
+ for (; a < c; ++a)
208
+ (s = e[a]) && (i[a] = s);
209
+ }
210
+ function fr(t, e, n, r, i, o, a) {
211
+ var s, c, u = /* @__PURE__ */ new Map(), l = e.length, h = o.length, f = new Array(l), d;
212
+ for (s = 0; s < l; ++s)
213
+ (c = e[s]) && (f[s] = d = a.call(c, c.__data__, s, e) + "", u.has(d) ? i[s] = c : u.set(d, c));
214
+ for (s = 0; s < h; ++s)
215
+ d = a.call(t, o[s], s, o) + "", (c = u.get(d)) ? (r[s] = c, c.__data__ = o[s], u.delete(d)) : n[s] = new qt(t, o[s]);
216
+ for (s = 0; s < l; ++s)
217
+ (c = e[s]) && u.get(f[s]) === c && (i[s] = c);
218
+ }
219
+ function hr(t) {
220
+ return t.__data__;
221
+ }
222
+ function dr(t, e) {
223
+ if (!arguments.length) return Array.from(this, hr);
224
+ var n = e ? fr : lr, r = this._parents, i = this._groups;
225
+ typeof t != "function" && (t = cr(t));
226
+ for (var o = i.length, a = new Array(o), s = new Array(o), c = new Array(o), u = 0; u < o; ++u) {
227
+ var l = r[u], h = i[u], f = h.length, d = mr(t.call(l, l && l.__data__, u, r)), x = d.length, y = s[u] = new Array(x), v = a[u] = new Array(x), g = c[u] = new Array(f);
228
+ n(l, h, y, v, g, d, e);
229
+ for (var b = 0, N = 0, p, _; b < x; ++b)
230
+ if (p = y[b]) {
231
+ for (b >= N && (N = b + 1); !(_ = v[N]) && ++N < x; ) ;
232
+ p._next = _ || null;
233
+ }
234
+ }
235
+ return a = new K(a, r), a._enter = s, a._exit = c, a;
236
+ }
237
+ function mr(t) {
238
+ return typeof t == "object" && "length" in t ? t : Array.from(t);
239
+ }
240
+ function gr() {
241
+ return new K(this._exit || this._groups.map(mn), this._parents);
242
+ }
243
+ function pr(t, e, n) {
244
+ var r = this.enter(), i = this, o = this.exit();
245
+ return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? o.remove() : n(o), r && i ? r.merge(i).order() : i;
246
+ }
247
+ function yr(t) {
248
+ for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, o = r.length, a = Math.min(i, o), s = new Array(i), c = 0; c < a; ++c)
249
+ for (var u = n[c], l = r[c], h = u.length, f = s[c] = new Array(h), d, x = 0; x < h; ++x)
250
+ (d = u[x] || l[x]) && (f[x] = d);
251
+ for (; c < i; ++c)
252
+ s[c] = n[c];
253
+ return new K(s, this._parents);
254
+ }
255
+ function vr() {
256
+ for (var t = this._groups, e = -1, n = t.length; ++e < n; )
257
+ for (var r = t[e], i = r.length - 1, o = r[i], a; --i >= 0; )
258
+ (a = r[i]) && (o && a.compareDocumentPosition(o) ^ 4 && o.parentNode.insertBefore(a, o), o = a);
259
+ return this;
260
+ }
261
+ function wr(t) {
262
+ t || (t = xr);
263
+ function e(h, f) {
264
+ return h && f ? t(h.__data__, f.__data__) : !h - !f;
265
+ }
266
+ for (var n = this._groups, r = n.length, i = new Array(r), o = 0; o < r; ++o) {
267
+ for (var a = n[o], s = a.length, c = i[o] = new Array(s), u, l = 0; l < s; ++l)
268
+ (u = a[l]) && (c[l] = u);
269
+ c.sort(e);
270
+ }
271
+ return new K(i, this._parents).order();
272
+ }
273
+ function xr(t, e) {
274
+ return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
275
+ }
276
+ function _r() {
277
+ var t = arguments[0];
278
+ return arguments[0] = this, t.apply(null, arguments), this;
279
+ }
280
+ function br() {
281
+ return Array.from(this);
282
+ }
283
+ function Cr() {
284
+ for (var t = this._groups, e = 0, n = t.length; e < n; ++e)
285
+ for (var r = t[e], i = 0, o = r.length; i < o; ++i) {
286
+ var a = r[i];
287
+ if (a) return a;
288
+ }
289
+ return null;
290
+ }
291
+ function Mr() {
292
+ let t = 0;
293
+ for (const e of this) ++t;
294
+ return t;
295
+ }
296
+ function Er() {
297
+ return !this.node();
298
+ }
299
+ function Nr(t) {
300
+ for (var e = this._groups, n = 0, r = e.length; n < r; ++n)
301
+ for (var i = e[n], o = 0, a = i.length, s; o < a; ++o)
302
+ (s = i[o]) && t.call(s, s.__data__, o, i);
303
+ return this;
304
+ }
305
+ function kr(t) {
306
+ return function() {
307
+ this.removeAttribute(t);
308
+ };
309
+ }
310
+ function Ar(t) {
311
+ return function() {
312
+ this.removeAttributeNS(t.space, t.local);
313
+ };
314
+ }
315
+ function Sr(t, e) {
316
+ return function() {
317
+ this.setAttribute(t, e);
318
+ };
319
+ }
320
+ function $r(t, e) {
321
+ return function() {
322
+ this.setAttributeNS(t.space, t.local, e);
323
+ };
324
+ }
325
+ function Tr(t, e) {
326
+ return function() {
327
+ var n = e.apply(this, arguments);
328
+ n == null ? this.removeAttribute(t) : this.setAttribute(t, n);
329
+ };
330
+ }
331
+ function Ir(t, e) {
332
+ return function() {
333
+ var n = e.apply(this, arguments);
334
+ n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n);
335
+ };
336
+ }
337
+ function Lr(t, e) {
338
+ var n = te(t);
339
+ if (arguments.length < 2) {
340
+ var r = this.node();
341
+ return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n);
342
+ }
343
+ return this.each((e == null ? n.local ? Ar : kr : typeof e == "function" ? n.local ? Ir : Tr : n.local ? $r : Sr)(n, e));
344
+ }
345
+ function gn(t) {
346
+ return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
347
+ }
348
+ function zr(t) {
349
+ return function() {
350
+ this.style.removeProperty(t);
351
+ };
352
+ }
353
+ function Rr(t, e, n) {
354
+ return function() {
355
+ this.style.setProperty(t, e, n);
356
+ };
357
+ }
358
+ function Dr(t, e, n) {
359
+ return function() {
360
+ var r = e.apply(this, arguments);
361
+ r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n);
362
+ };
363
+ }
364
+ function Pr(t, e, n) {
365
+ return arguments.length > 1 ? this.each((e == null ? zr : typeof e == "function" ? Dr : Rr)(t, e, n ?? "")) : yt(this.node(), t);
366
+ }
367
+ function yt(t, e) {
368
+ return t.style.getPropertyValue(e) || gn(t).getComputedStyle(t, null).getPropertyValue(e);
369
+ }
370
+ function Fr(t) {
371
+ return function() {
372
+ delete this[t];
373
+ };
374
+ }
375
+ function Hr(t, e) {
376
+ return function() {
377
+ this[t] = e;
378
+ };
379
+ }
380
+ function Or(t, e) {
381
+ return function() {
382
+ var n = e.apply(this, arguments);
383
+ n == null ? delete this[t] : this[t] = n;
384
+ };
385
+ }
386
+ function Br(t, e) {
387
+ return arguments.length > 1 ? this.each((e == null ? Fr : typeof e == "function" ? Or : Hr)(t, e)) : this.node()[t];
388
+ }
389
+ function pn(t) {
390
+ return t.trim().split(/^|\s+/);
391
+ }
392
+ function we(t) {
393
+ return t.classList || new yn(t);
394
+ }
395
+ function yn(t) {
396
+ this._node = t, this._names = pn(t.getAttribute("class") || "");
397
+ }
398
+ yn.prototype = {
399
+ add: function(t) {
400
+ var e = this._names.indexOf(t);
401
+ e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" ")));
402
+ },
403
+ remove: function(t) {
404
+ var e = this._names.indexOf(t);
405
+ e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" ")));
406
+ },
407
+ contains: function(t) {
408
+ return this._names.indexOf(t) >= 0;
409
+ }
410
+ };
411
+ function vn(t, e) {
412
+ for (var n = we(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]);
413
+ }
414
+ function wn(t, e) {
415
+ for (var n = we(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]);
416
+ }
417
+ function Xr(t) {
418
+ return function() {
419
+ vn(this, t);
420
+ };
421
+ }
422
+ function qr(t) {
423
+ return function() {
424
+ wn(this, t);
425
+ };
426
+ }
427
+ function Vr(t, e) {
428
+ return function() {
429
+ (e.apply(this, arguments) ? vn : wn)(this, t);
430
+ };
431
+ }
432
+ function Yr(t, e) {
433
+ var n = pn(t + "");
434
+ if (arguments.length < 2) {
435
+ for (var r = we(this.node()), i = -1, o = n.length; ++i < o; ) if (!r.contains(n[i])) return !1;
436
+ return !0;
437
+ }
438
+ return this.each((typeof e == "function" ? Vr : e ? Xr : qr)(n, e));
439
+ }
440
+ function Gr() {
441
+ this.textContent = "";
442
+ }
443
+ function Ur(t) {
444
+ return function() {
445
+ this.textContent = t;
446
+ };
447
+ }
448
+ function Kr(t) {
449
+ return function() {
450
+ var e = t.apply(this, arguments);
451
+ this.textContent = e ?? "";
452
+ };
453
+ }
454
+ function Wr(t) {
455
+ return arguments.length ? this.each(t == null ? Gr : (typeof t == "function" ? Kr : Ur)(t)) : this.node().textContent;
456
+ }
457
+ function Zr() {
458
+ this.innerHTML = "";
459
+ }
460
+ function Qr(t) {
461
+ return function() {
462
+ this.innerHTML = t;
463
+ };
464
+ }
465
+ function Jr(t) {
466
+ return function() {
467
+ var e = t.apply(this, arguments);
468
+ this.innerHTML = e ?? "";
469
+ };
470
+ }
471
+ function jr(t) {
472
+ return arguments.length ? this.each(t == null ? Zr : (typeof t == "function" ? Jr : Qr)(t)) : this.node().innerHTML;
473
+ }
474
+ function ti() {
475
+ this.nextSibling && this.parentNode.appendChild(this);
476
+ }
477
+ function ei() {
478
+ return this.each(ti);
479
+ }
480
+ function ni() {
481
+ this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
482
+ }
483
+ function ri() {
484
+ return this.each(ni);
485
+ }
486
+ function ii(t) {
487
+ var e = typeof t == "function" ? t : ln(t);
488
+ return this.select(function() {
489
+ return this.appendChild(e.apply(this, arguments));
490
+ });
491
+ }
492
+ function oi() {
493
+ return null;
494
+ }
495
+ function ai(t, e) {
496
+ var n = typeof t == "function" ? t : ln(t), r = e == null ? oi : typeof e == "function" ? e : ve(e);
497
+ return this.select(function() {
498
+ return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null);
499
+ });
500
+ }
501
+ function si() {
502
+ var t = this.parentNode;
503
+ t && t.removeChild(this);
504
+ }
505
+ function ui() {
506
+ return this.each(si);
507
+ }
508
+ function ci() {
509
+ var t = this.cloneNode(!1), e = this.parentNode;
510
+ return e ? e.insertBefore(t, this.nextSibling) : t;
511
+ }
512
+ function li() {
513
+ var t = this.cloneNode(!0), e = this.parentNode;
514
+ return e ? e.insertBefore(t, this.nextSibling) : t;
515
+ }
516
+ function fi(t) {
517
+ return this.select(t ? li : ci);
518
+ }
519
+ function hi(t) {
520
+ return arguments.length ? this.property("__data__", t) : this.node().__data__;
521
+ }
522
+ function di(t) {
523
+ return function(e) {
524
+ t.call(this, e, this.__data__);
525
+ };
526
+ }
527
+ function mi(t) {
528
+ return t.trim().split(/^|\s+/).map(function(e) {
529
+ var n = "", r = e.indexOf(".");
530
+ return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n };
531
+ });
532
+ }
533
+ function gi(t) {
534
+ return function() {
535
+ var e = this.__on;
536
+ if (e) {
537
+ for (var n = 0, r = -1, i = e.length, o; n < i; ++n)
538
+ o = e[n], (!t.type || o.type === t.type) && o.name === t.name ? this.removeEventListener(o.type, o.listener, o.options) : e[++r] = o;
539
+ ++r ? e.length = r : delete this.__on;
540
+ }
541
+ };
542
+ }
543
+ function pi(t, e, n) {
544
+ return function() {
545
+ var r = this.__on, i, o = di(e);
546
+ if (r) {
547
+ for (var a = 0, s = r.length; a < s; ++a)
548
+ if ((i = r[a]).type === t.type && i.name === t.name) {
549
+ this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = o, i.options = n), i.value = e;
550
+ return;
551
+ }
552
+ }
553
+ this.addEventListener(t.type, o, n), i = { type: t.type, name: t.name, value: e, listener: o, options: n }, r ? r.push(i) : this.__on = [i];
554
+ };
555
+ }
556
+ function yi(t, e, n) {
557
+ var r = mi(t + ""), i, o = r.length, a;
558
+ if (arguments.length < 2) {
559
+ var s = this.node().__on;
560
+ if (s) {
561
+ for (var c = 0, u = s.length, l; c < u; ++c)
562
+ for (i = 0, l = s[c]; i < o; ++i)
563
+ if ((a = r[i]).type === l.type && a.name === l.name)
564
+ return l.value;
565
+ }
566
+ return;
567
+ }
568
+ for (s = e ? pi : gi, i = 0; i < o; ++i) this.each(s(r[i], e, n));
569
+ return this;
570
+ }
571
+ function xn(t, e, n) {
572
+ var r = gn(t), i = r.CustomEvent;
573
+ typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i);
574
+ }
575
+ function vi(t, e) {
576
+ return function() {
577
+ return xn(this, t, e);
578
+ };
579
+ }
580
+ function wi(t, e) {
581
+ return function() {
582
+ return xn(this, t, e.apply(this, arguments));
583
+ };
584
+ }
585
+ function xi(t, e) {
586
+ return this.each((typeof e == "function" ? wi : vi)(t, e));
587
+ }
588
+ function* _i() {
589
+ for (var t = this._groups, e = 0, n = t.length; e < n; ++e)
590
+ for (var r = t[e], i = 0, o = r.length, a; i < o; ++i)
591
+ (a = r[i]) && (yield a);
592
+ }
593
+ var _n = [null];
594
+ function K(t, e) {
595
+ this._groups = t, this._parents = e;
596
+ }
597
+ function At() {
598
+ return new K([[document.documentElement]], _n);
599
+ }
600
+ function bi() {
601
+ return this;
602
+ }
603
+ K.prototype = At.prototype = {
604
+ constructor: K,
605
+ select: Kn,
606
+ selectAll: Jn,
607
+ selectChild: nr,
608
+ selectChildren: ar,
609
+ filter: sr,
610
+ data: dr,
611
+ enter: ur,
612
+ exit: gr,
613
+ join: pr,
614
+ merge: yr,
615
+ selection: bi,
616
+ order: vr,
617
+ sort: wr,
618
+ call: _r,
619
+ nodes: br,
620
+ node: Cr,
621
+ size: Mr,
622
+ empty: Er,
623
+ each: Nr,
624
+ attr: Lr,
625
+ style: Pr,
626
+ property: Br,
627
+ classed: Yr,
628
+ text: Wr,
629
+ html: jr,
630
+ raise: ei,
631
+ lower: ri,
632
+ append: ii,
633
+ insert: ai,
634
+ remove: ui,
635
+ clone: fi,
636
+ datum: hi,
637
+ on: yi,
638
+ dispatch: xi,
639
+ [Symbol.iterator]: _i
640
+ };
641
+ function j(t) {
642
+ return typeof t == "string" ? new K([[document.querySelector(t)]], [document.documentElement]) : new K([[t]], _n);
643
+ }
644
+ function Ci(t) {
645
+ let e;
646
+ for (; e = t.sourceEvent; ) t = e;
647
+ return t;
648
+ }
649
+ function it(t, e) {
650
+ if (t = Ci(t), e === void 0 && (e = t.currentTarget), e) {
651
+ var n = e.ownerSVGElement || e;
652
+ if (n.createSVGPoint) {
653
+ var r = n.createSVGPoint();
654
+ return r.x = t.clientX, r.y = t.clientY, r = r.matrixTransform(e.getScreenCTM().inverse()), [r.x, r.y];
655
+ }
656
+ if (e.getBoundingClientRect) {
657
+ var i = e.getBoundingClientRect();
658
+ return [t.clientX - i.left - e.clientLeft, t.clientY - i.top - e.clientTop];
659
+ }
660
+ }
661
+ return [t.pageX, t.pageY];
662
+ }
663
+ function Ft(t, e) {
664
+ return t == null || e == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
665
+ }
666
+ function Mi(t, e) {
667
+ return t == null || e == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
668
+ }
669
+ function bn(t) {
670
+ let e, n, r;
671
+ t.length !== 2 ? (e = Ft, n = (s, c) => Ft(t(s), c), r = (s, c) => t(s) - c) : (e = t === Ft || t === Mi ? t : Ei, n = t, r = t);
672
+ function i(s, c, u = 0, l = s.length) {
673
+ if (u < l) {
674
+ if (e(c, c) !== 0) return l;
675
+ do {
676
+ const h = u + l >>> 1;
677
+ n(s[h], c) < 0 ? u = h + 1 : l = h;
678
+ } while (u < l);
679
+ }
680
+ return u;
681
+ }
682
+ function o(s, c, u = 0, l = s.length) {
683
+ if (u < l) {
684
+ if (e(c, c) !== 0) return l;
685
+ do {
686
+ const h = u + l >>> 1;
687
+ n(s[h], c) <= 0 ? u = h + 1 : l = h;
688
+ } while (u < l);
689
+ }
690
+ return u;
691
+ }
692
+ function a(s, c, u = 0, l = s.length) {
693
+ const h = i(s, c, u, l - 1);
694
+ return h > u && r(s[h - 1], c) > -r(s[h], c) ? h - 1 : h;
695
+ }
696
+ return { left: i, center: a, right: o };
697
+ }
698
+ function Ei() {
699
+ return 0;
700
+ }
701
+ function Ni(t) {
702
+ return t === null ? NaN : +t;
703
+ }
704
+ const ki = bn(Ft), Ai = ki.right;
705
+ bn(Ni).center;
706
+ class Le extends Map {
707
+ constructor(e, n = Ti) {
708
+ if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: n } }), e != null) for (const [r, i] of e) this.set(r, i);
709
+ }
710
+ get(e) {
711
+ return super.get(ze(this, e));
712
+ }
713
+ has(e) {
714
+ return super.has(ze(this, e));
715
+ }
716
+ set(e, n) {
717
+ return super.set(Si(this, e), n);
718
+ }
719
+ delete(e) {
720
+ return super.delete($i(this, e));
721
+ }
722
+ }
723
+ function ze({ _intern: t, _key: e }, n) {
724
+ const r = e(n);
725
+ return t.has(r) ? t.get(r) : n;
726
+ }
727
+ function Si({ _intern: t, _key: e }, n) {
728
+ const r = e(n);
729
+ return t.has(r) ? t.get(r) : (t.set(r, n), n);
730
+ }
731
+ function $i({ _intern: t, _key: e }, n) {
732
+ const r = e(n);
733
+ return t.has(r) && (n = t.get(r), t.delete(r)), n;
734
+ }
735
+ function Ti(t) {
736
+ return t !== null && typeof t == "object" ? t.valueOf() : t;
737
+ }
738
+ const Ii = Math.sqrt(50), Li = Math.sqrt(10), zi = Math.sqrt(2);
739
+ function Vt(t, e, n) {
740
+ const r = (e - t) / Math.max(0, n), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), a = o >= Ii ? 10 : o >= Li ? 5 : o >= zi ? 2 : 1;
741
+ let s, c, u;
742
+ return i < 0 ? (u = Math.pow(10, -i) / a, s = Math.round(t * u), c = Math.round(e * u), s / u < t && ++s, c / u > e && --c, u = -u) : (u = Math.pow(10, i) * a, s = Math.round(t / u), c = Math.round(e / u), s * u < t && ++s, c * u > e && --c), c < s && 0.5 <= n && n < 2 ? Vt(t, e, n * 2) : [s, c, u];
743
+ }
744
+ function Ri(t, e, n) {
745
+ if (e = +e, t = +t, n = +n, !(n > 0)) return [];
746
+ if (t === e) return [t];
747
+ const r = e < t, [i, o, a] = r ? Vt(e, t, n) : Vt(t, e, n);
748
+ if (!(o >= i)) return [];
749
+ const s = o - i + 1, c = new Array(s);
750
+ if (r)
751
+ if (a < 0) for (let u = 0; u < s; ++u) c[u] = (o - u) / -a;
752
+ else for (let u = 0; u < s; ++u) c[u] = (o - u) * a;
753
+ else if (a < 0) for (let u = 0; u < s; ++u) c[u] = (i + u) / -a;
754
+ else for (let u = 0; u < s; ++u) c[u] = (i + u) * a;
755
+ return c;
756
+ }
757
+ function ce(t, e, n) {
758
+ return e = +e, t = +t, n = +n, Vt(t, e, n)[2];
759
+ }
760
+ function Di(t, e, n) {
761
+ e = +e, t = +t, n = +n;
762
+ const r = e < t, i = r ? ce(e, t, n) : ce(t, e, n);
763
+ return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
764
+ }
765
+ function Cn(t, e) {
766
+ switch (arguments.length) {
767
+ case 0:
768
+ break;
769
+ case 1:
770
+ this.range(t);
771
+ break;
772
+ default:
773
+ this.range(e).domain(t);
774
+ break;
775
+ }
776
+ return this;
777
+ }
778
+ const Re = /* @__PURE__ */ Symbol("implicit");
779
+ function xe() {
780
+ var t = new Le(), e = [], n = [], r = Re;
781
+ function i(o) {
782
+ let a = t.get(o);
783
+ if (a === void 0) {
784
+ if (r !== Re) return r;
785
+ t.set(o, a = e.push(o) - 1);
786
+ }
787
+ return n[a % n.length];
788
+ }
789
+ return i.domain = function(o) {
790
+ if (!arguments.length) return e.slice();
791
+ e = [], t = new Le();
792
+ for (const a of o)
793
+ t.has(a) || t.set(a, e.push(a) - 1);
794
+ return i;
795
+ }, i.range = function(o) {
796
+ return arguments.length ? (n = Array.from(o), i) : n.slice();
797
+ }, i.unknown = function(o) {
798
+ return arguments.length ? (r = o, i) : r;
799
+ }, i.copy = function() {
800
+ return xe(e, n).unknown(r);
801
+ }, Cn.apply(i, arguments), i;
802
+ }
803
+ function _e(t, e, n) {
804
+ t.prototype = e.prototype = n, n.constructor = t;
805
+ }
806
+ function Mn(t, e) {
807
+ var n = Object.create(t.prototype);
808
+ for (var r in e) n[r] = e[r];
809
+ return n;
810
+ }
811
+ function St() {
812
+ }
813
+ var Mt = 0.7, Yt = 1 / Mt, gt = "\\s*([+-]?\\d+)\\s*", Et = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", tt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Pi = /^#([0-9a-f]{3,8})$/, Fi = new RegExp(`^rgb\\(${gt},${gt},${gt}\\)$`), Hi = new RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`), Oi = new RegExp(`^rgba\\(${gt},${gt},${gt},${Et}\\)$`), Bi = new RegExp(`^rgba\\(${tt},${tt},${tt},${Et}\\)$`), Xi = new RegExp(`^hsl\\(${Et},${tt},${tt}\\)$`), qi = new RegExp(`^hsla\\(${Et},${tt},${tt},${Et}\\)$`), De = {
814
+ aliceblue: 15792383,
815
+ antiquewhite: 16444375,
816
+ aqua: 65535,
817
+ aquamarine: 8388564,
818
+ azure: 15794175,
819
+ beige: 16119260,
820
+ bisque: 16770244,
821
+ black: 0,
822
+ blanchedalmond: 16772045,
823
+ blue: 255,
824
+ blueviolet: 9055202,
825
+ brown: 10824234,
826
+ burlywood: 14596231,
827
+ cadetblue: 6266528,
828
+ chartreuse: 8388352,
829
+ chocolate: 13789470,
830
+ coral: 16744272,
831
+ cornflowerblue: 6591981,
832
+ cornsilk: 16775388,
833
+ crimson: 14423100,
834
+ cyan: 65535,
835
+ darkblue: 139,
836
+ darkcyan: 35723,
837
+ darkgoldenrod: 12092939,
838
+ darkgray: 11119017,
839
+ darkgreen: 25600,
840
+ darkgrey: 11119017,
841
+ darkkhaki: 12433259,
842
+ darkmagenta: 9109643,
843
+ darkolivegreen: 5597999,
844
+ darkorange: 16747520,
845
+ darkorchid: 10040012,
846
+ darkred: 9109504,
847
+ darksalmon: 15308410,
848
+ darkseagreen: 9419919,
849
+ darkslateblue: 4734347,
850
+ darkslategray: 3100495,
851
+ darkslategrey: 3100495,
852
+ darkturquoise: 52945,
853
+ darkviolet: 9699539,
854
+ deeppink: 16716947,
855
+ deepskyblue: 49151,
856
+ dimgray: 6908265,
857
+ dimgrey: 6908265,
858
+ dodgerblue: 2003199,
859
+ firebrick: 11674146,
860
+ floralwhite: 16775920,
861
+ forestgreen: 2263842,
862
+ fuchsia: 16711935,
863
+ gainsboro: 14474460,
864
+ ghostwhite: 16316671,
865
+ gold: 16766720,
866
+ goldenrod: 14329120,
867
+ gray: 8421504,
868
+ green: 32768,
869
+ greenyellow: 11403055,
870
+ grey: 8421504,
871
+ honeydew: 15794160,
872
+ hotpink: 16738740,
873
+ indianred: 13458524,
874
+ indigo: 4915330,
875
+ ivory: 16777200,
876
+ khaki: 15787660,
877
+ lavender: 15132410,
878
+ lavenderblush: 16773365,
879
+ lawngreen: 8190976,
880
+ lemonchiffon: 16775885,
881
+ lightblue: 11393254,
882
+ lightcoral: 15761536,
883
+ lightcyan: 14745599,
884
+ lightgoldenrodyellow: 16448210,
885
+ lightgray: 13882323,
886
+ lightgreen: 9498256,
887
+ lightgrey: 13882323,
888
+ lightpink: 16758465,
889
+ lightsalmon: 16752762,
890
+ lightseagreen: 2142890,
891
+ lightskyblue: 8900346,
892
+ lightslategray: 7833753,
893
+ lightslategrey: 7833753,
894
+ lightsteelblue: 11584734,
895
+ lightyellow: 16777184,
896
+ lime: 65280,
897
+ limegreen: 3329330,
898
+ linen: 16445670,
899
+ magenta: 16711935,
900
+ maroon: 8388608,
901
+ mediumaquamarine: 6737322,
902
+ mediumblue: 205,
903
+ mediumorchid: 12211667,
904
+ mediumpurple: 9662683,
905
+ mediumseagreen: 3978097,
906
+ mediumslateblue: 8087790,
907
+ mediumspringgreen: 64154,
908
+ mediumturquoise: 4772300,
909
+ mediumvioletred: 13047173,
910
+ midnightblue: 1644912,
911
+ mintcream: 16121850,
912
+ mistyrose: 16770273,
913
+ moccasin: 16770229,
914
+ navajowhite: 16768685,
915
+ navy: 128,
916
+ oldlace: 16643558,
917
+ olive: 8421376,
918
+ olivedrab: 7048739,
919
+ orange: 16753920,
920
+ orangered: 16729344,
921
+ orchid: 14315734,
922
+ palegoldenrod: 15657130,
923
+ palegreen: 10025880,
924
+ paleturquoise: 11529966,
925
+ palevioletred: 14381203,
926
+ papayawhip: 16773077,
927
+ peachpuff: 16767673,
928
+ peru: 13468991,
929
+ pink: 16761035,
930
+ plum: 14524637,
931
+ powderblue: 11591910,
932
+ purple: 8388736,
933
+ rebeccapurple: 6697881,
934
+ red: 16711680,
935
+ rosybrown: 12357519,
936
+ royalblue: 4286945,
937
+ saddlebrown: 9127187,
938
+ salmon: 16416882,
939
+ sandybrown: 16032864,
940
+ seagreen: 3050327,
941
+ seashell: 16774638,
942
+ sienna: 10506797,
943
+ silver: 12632256,
944
+ skyblue: 8900331,
945
+ slateblue: 6970061,
946
+ slategray: 7372944,
947
+ slategrey: 7372944,
948
+ snow: 16775930,
949
+ springgreen: 65407,
950
+ steelblue: 4620980,
951
+ tan: 13808780,
952
+ teal: 32896,
953
+ thistle: 14204888,
954
+ tomato: 16737095,
955
+ turquoise: 4251856,
956
+ violet: 15631086,
957
+ wheat: 16113331,
958
+ white: 16777215,
959
+ whitesmoke: 16119285,
960
+ yellow: 16776960,
961
+ yellowgreen: 10145074
962
+ };
963
+ _e(St, dt, {
964
+ copy(t) {
965
+ return Object.assign(new this.constructor(), this, t);
966
+ },
967
+ displayable() {
968
+ return this.rgb().displayable();
969
+ },
970
+ hex: Pe,
971
+ // Deprecated! Use color.formatHex.
972
+ formatHex: Pe,
973
+ formatHex8: Vi,
974
+ formatHsl: Yi,
975
+ formatRgb: Fe,
976
+ toString: Fe
977
+ });
978
+ function Pe() {
979
+ return this.rgb().formatHex();
980
+ }
981
+ function Vi() {
982
+ return this.rgb().formatHex8();
983
+ }
984
+ function Yi() {
985
+ return En(this).formatHsl();
986
+ }
987
+ function Fe() {
988
+ return this.rgb().formatRgb();
989
+ }
990
+ function dt(t) {
991
+ var e, n;
992
+ return t = (t + "").trim().toLowerCase(), (e = Pi.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? He(e) : n === 3 ? new U(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Tt(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Tt(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Fi.exec(t)) ? new U(e[1], e[2], e[3], 1) : (e = Hi.exec(t)) ? new U(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Oi.exec(t)) ? Tt(e[1], e[2], e[3], e[4]) : (e = Bi.exec(t)) ? Tt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Xi.exec(t)) ? Xe(e[1], e[2] / 100, e[3] / 100, 1) : (e = qi.exec(t)) ? Xe(e[1], e[2] / 100, e[3] / 100, e[4]) : De.hasOwnProperty(t) ? He(De[t]) : t === "transparent" ? new U(NaN, NaN, NaN, 0) : null;
993
+ }
994
+ function He(t) {
995
+ return new U(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
996
+ }
997
+ function Tt(t, e, n, r) {
998
+ return r <= 0 && (t = e = n = NaN), new U(t, e, n, r);
999
+ }
1000
+ function Gi(t) {
1001
+ return t instanceof St || (t = dt(t)), t ? (t = t.rgb(), new U(t.r, t.g, t.b, t.opacity)) : new U();
1002
+ }
1003
+ function le(t, e, n, r) {
1004
+ return arguments.length === 1 ? Gi(t) : new U(t, e, n, r ?? 1);
1005
+ }
1006
+ function U(t, e, n, r) {
1007
+ this.r = +t, this.g = +e, this.b = +n, this.opacity = +r;
1008
+ }
1009
+ _e(U, le, Mn(St, {
1010
+ brighter(t) {
1011
+ return t = t == null ? Yt : Math.pow(Yt, t), new U(this.r * t, this.g * t, this.b * t, this.opacity);
1012
+ },
1013
+ darker(t) {
1014
+ return t = t == null ? Mt : Math.pow(Mt, t), new U(this.r * t, this.g * t, this.b * t, this.opacity);
1015
+ },
1016
+ rgb() {
1017
+ return this;
1018
+ },
1019
+ clamp() {
1020
+ return new U(ft(this.r), ft(this.g), ft(this.b), Gt(this.opacity));
1021
+ },
1022
+ displayable() {
1023
+ return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
1024
+ },
1025
+ hex: Oe,
1026
+ // Deprecated! Use color.formatHex.
1027
+ formatHex: Oe,
1028
+ formatHex8: Ui,
1029
+ formatRgb: Be,
1030
+ toString: Be
1031
+ }));
1032
+ function Oe() {
1033
+ return `#${lt(this.r)}${lt(this.g)}${lt(this.b)}`;
1034
+ }
1035
+ function Ui() {
1036
+ return `#${lt(this.r)}${lt(this.g)}${lt(this.b)}${lt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
1037
+ }
1038
+ function Be() {
1039
+ const t = Gt(this.opacity);
1040
+ return `${t === 1 ? "rgb(" : "rgba("}${ft(this.r)}, ${ft(this.g)}, ${ft(this.b)}${t === 1 ? ")" : `, ${t})`}`;
1041
+ }
1042
+ function Gt(t) {
1043
+ return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
1044
+ }
1045
+ function ft(t) {
1046
+ return Math.max(0, Math.min(255, Math.round(t) || 0));
1047
+ }
1048
+ function lt(t) {
1049
+ return t = ft(t), (t < 16 ? "0" : "") + t.toString(16);
1050
+ }
1051
+ function Xe(t, e, n, r) {
1052
+ return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Q(t, e, n, r);
1053
+ }
1054
+ function En(t) {
1055
+ if (t instanceof Q) return new Q(t.h, t.s, t.l, t.opacity);
1056
+ if (t instanceof St || (t = dt(t)), !t) return new Q();
1057
+ if (t instanceof Q) return t;
1058
+ t = t.rgb();
1059
+ var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), o = Math.max(e, n, r), a = NaN, s = o - i, c = (o + i) / 2;
1060
+ return s ? (e === o ? a = (n - r) / s + (n < r) * 6 : n === o ? a = (r - e) / s + 2 : a = (e - n) / s + 4, s /= c < 0.5 ? o + i : 2 - o - i, a *= 60) : s = c > 0 && c < 1 ? 0 : a, new Q(a, s, c, t.opacity);
1061
+ }
1062
+ function Ki(t, e, n, r) {
1063
+ return arguments.length === 1 ? En(t) : new Q(t, e, n, r ?? 1);
1064
+ }
1065
+ function Q(t, e, n, r) {
1066
+ this.h = +t, this.s = +e, this.l = +n, this.opacity = +r;
1067
+ }
1068
+ _e(Q, Ki, Mn(St, {
1069
+ brighter(t) {
1070
+ return t = t == null ? Yt : Math.pow(Yt, t), new Q(this.h, this.s, this.l * t, this.opacity);
1071
+ },
1072
+ darker(t) {
1073
+ return t = t == null ? Mt : Math.pow(Mt, t), new Q(this.h, this.s, this.l * t, this.opacity);
1074
+ },
1075
+ rgb() {
1076
+ var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r;
1077
+ return new U(
1078
+ ie(t >= 240 ? t - 240 : t + 120, i, r),
1079
+ ie(t, i, r),
1080
+ ie(t < 120 ? t + 240 : t - 120, i, r),
1081
+ this.opacity
1082
+ );
1083
+ },
1084
+ clamp() {
1085
+ return new Q(qe(this.h), It(this.s), It(this.l), Gt(this.opacity));
1086
+ },
1087
+ displayable() {
1088
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
1089
+ },
1090
+ formatHsl() {
1091
+ const t = Gt(this.opacity);
1092
+ return `${t === 1 ? "hsl(" : "hsla("}${qe(this.h)}, ${It(this.s) * 100}%, ${It(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
1093
+ }
1094
+ }));
1095
+ function qe(t) {
1096
+ return t = (t || 0) % 360, t < 0 ? t + 360 : t;
1097
+ }
1098
+ function It(t) {
1099
+ return Math.max(0, Math.min(1, t || 0));
1100
+ }
1101
+ function ie(t, e, n) {
1102
+ return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255;
1103
+ }
1104
+ const be = (t) => () => t;
1105
+ function Wi(t, e) {
1106
+ return function(n) {
1107
+ return t + n * e;
1108
+ };
1109
+ }
1110
+ function Zi(t, e, n) {
1111
+ return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) {
1112
+ return Math.pow(t + r * e, n);
1113
+ };
1114
+ }
1115
+ function Qi(t) {
1116
+ return (t = +t) == 1 ? Nn : function(e, n) {
1117
+ return n - e ? Zi(e, n, t) : be(isNaN(e) ? n : e);
1118
+ };
1119
+ }
1120
+ function Nn(t, e) {
1121
+ var n = e - t;
1122
+ return n ? Wi(t, n) : be(isNaN(t) ? e : t);
1123
+ }
1124
+ const Ut = (function t(e) {
1125
+ var n = Qi(e);
1126
+ function r(i, o) {
1127
+ var a = n((i = le(i)).r, (o = le(o)).r), s = n(i.g, o.g), c = n(i.b, o.b), u = Nn(i.opacity, o.opacity);
1128
+ return function(l) {
1129
+ return i.r = a(l), i.g = s(l), i.b = c(l), i.opacity = u(l), i + "";
1130
+ };
1131
+ }
1132
+ return r.gamma = t, r;
1133
+ })(1);
1134
+ function Ji(t, e) {
1135
+ e || (e = []);
1136
+ var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i;
1137
+ return function(o) {
1138
+ for (i = 0; i < n; ++i) r[i] = t[i] * (1 - o) + e[i] * o;
1139
+ return r;
1140
+ };
1141
+ }
1142
+ function ji(t) {
1143
+ return ArrayBuffer.isView(t) && !(t instanceof DataView);
1144
+ }
1145
+ function to(t, e) {
1146
+ var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), o = new Array(n), a;
1147
+ for (a = 0; a < r; ++a) i[a] = Ce(t[a], e[a]);
1148
+ for (; a < n; ++a) o[a] = e[a];
1149
+ return function(s) {
1150
+ for (a = 0; a < r; ++a) o[a] = i[a](s);
1151
+ return o;
1152
+ };
1153
+ }
1154
+ function eo(t, e) {
1155
+ var n = /* @__PURE__ */ new Date();
1156
+ return t = +t, e = +e, function(r) {
1157
+ return n.setTime(t * (1 - r) + e * r), n;
1158
+ };
1159
+ }
1160
+ function Z(t, e) {
1161
+ return t = +t, e = +e, function(n) {
1162
+ return t * (1 - n) + e * n;
1163
+ };
1164
+ }
1165
+ function no(t, e) {
1166
+ var n = {}, r = {}, i;
1167
+ (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {});
1168
+ for (i in e)
1169
+ i in t ? n[i] = Ce(t[i], e[i]) : r[i] = e[i];
1170
+ return function(o) {
1171
+ for (i in n) r[i] = n[i](o);
1172
+ return r;
1173
+ };
1174
+ }
1175
+ var fe = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, oe = new RegExp(fe.source, "g");
1176
+ function ro(t) {
1177
+ return function() {
1178
+ return t;
1179
+ };
1180
+ }
1181
+ function io(t) {
1182
+ return function(e) {
1183
+ return t(e) + "";
1184
+ };
1185
+ }
1186
+ function kn(t, e) {
1187
+ var n = fe.lastIndex = oe.lastIndex = 0, r, i, o, a = -1, s = [], c = [];
1188
+ for (t = t + "", e = e + ""; (r = fe.exec(t)) && (i = oe.exec(e)); )
1189
+ (o = i.index) > n && (o = e.slice(n, o), s[a] ? s[a] += o : s[++a] = o), (r = r[0]) === (i = i[0]) ? s[a] ? s[a] += i : s[++a] = i : (s[++a] = null, c.push({ i: a, x: Z(r, i) })), n = oe.lastIndex;
1190
+ return n < e.length && (o = e.slice(n), s[a] ? s[a] += o : s[++a] = o), s.length < 2 ? c[0] ? io(c[0].x) : ro(e) : (e = c.length, function(u) {
1191
+ for (var l = 0, h; l < e; ++l) s[(h = c[l]).i] = h.x(u);
1192
+ return s.join("");
1193
+ });
1194
+ }
1195
+ function Ce(t, e) {
1196
+ var n = typeof e, r;
1197
+ return e == null || n === "boolean" ? be(e) : (n === "number" ? Z : n === "string" ? (r = dt(e)) ? (e = r, Ut) : kn : e instanceof dt ? Ut : e instanceof Date ? eo : ji(e) ? Ji : Array.isArray(e) ? to : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? no : Z)(t, e);
1198
+ }
1199
+ function oo(t, e) {
1200
+ return t = +t, e = +e, function(n) {
1201
+ return Math.round(t * (1 - n) + e * n);
1202
+ };
1203
+ }
1204
+ var Ve = 180 / Math.PI, he = {
1205
+ translateX: 0,
1206
+ translateY: 0,
1207
+ rotate: 0,
1208
+ skewX: 0,
1209
+ scaleX: 1,
1210
+ scaleY: 1
1211
+ };
1212
+ function An(t, e, n, r, i, o) {
1213
+ var a, s, c;
1214
+ return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (c = t * n + e * r) && (n -= t * c, r -= e * c), (s = Math.sqrt(n * n + r * r)) && (n /= s, r /= s, c /= s), t * r < e * n && (t = -t, e = -e, c = -c, a = -a), {
1215
+ translateX: i,
1216
+ translateY: o,
1217
+ rotate: Math.atan2(e, t) * Ve,
1218
+ skewX: Math.atan(c) * Ve,
1219
+ scaleX: a,
1220
+ scaleY: s
1221
+ };
1222
+ }
1223
+ var Lt;
1224
+ function ao(t) {
1225
+ const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
1226
+ return e.isIdentity ? he : An(e.a, e.b, e.c, e.d, e.e, e.f);
1227
+ }
1228
+ function so(t) {
1229
+ return t == null || (Lt || (Lt = document.createElementNS("http://www.w3.org/2000/svg", "g")), Lt.setAttribute("transform", t), !(t = Lt.transform.baseVal.consolidate())) ? he : (t = t.matrix, An(t.a, t.b, t.c, t.d, t.e, t.f));
1230
+ }
1231
+ function Sn(t, e, n, r) {
1232
+ function i(u) {
1233
+ return u.length ? u.pop() + " " : "";
1234
+ }
1235
+ function o(u, l, h, f, d, x) {
1236
+ if (u !== h || l !== f) {
1237
+ var y = d.push("translate(", null, e, null, n);
1238
+ x.push({ i: y - 4, x: Z(u, h) }, { i: y - 2, x: Z(l, f) });
1239
+ } else (h || f) && d.push("translate(" + h + e + f + n);
1240
+ }
1241
+ function a(u, l, h, f) {
1242
+ u !== l ? (u - l > 180 ? l += 360 : l - u > 180 && (u += 360), f.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Z(u, l) })) : l && h.push(i(h) + "rotate(" + l + r);
1243
+ }
1244
+ function s(u, l, h, f) {
1245
+ u !== l ? f.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Z(u, l) }) : l && h.push(i(h) + "skewX(" + l + r);
1246
+ }
1247
+ function c(u, l, h, f, d, x) {
1248
+ if (u !== h || l !== f) {
1249
+ var y = d.push(i(d) + "scale(", null, ",", null, ")");
1250
+ x.push({ i: y - 4, x: Z(u, h) }, { i: y - 2, x: Z(l, f) });
1251
+ } else (h !== 1 || f !== 1) && d.push(i(d) + "scale(" + h + "," + f + ")");
1252
+ }
1253
+ return function(u, l) {
1254
+ var h = [], f = [];
1255
+ return u = t(u), l = t(l), o(u.translateX, u.translateY, l.translateX, l.translateY, h, f), a(u.rotate, l.rotate, h, f), s(u.skewX, l.skewX, h, f), c(u.scaleX, u.scaleY, l.scaleX, l.scaleY, h, f), u = l = null, function(d) {
1256
+ for (var x = -1, y = f.length, v; ++x < y; ) h[(v = f[x]).i] = v.x(d);
1257
+ return h.join("");
1258
+ };
1259
+ };
1260
+ }
1261
+ var uo = Sn(ao, "px, ", "px)", "deg)"), co = Sn(so, ", ", ")", ")"), lo = 1e-12;
1262
+ function Ye(t) {
1263
+ return ((t = Math.exp(t)) + 1 / t) / 2;
1264
+ }
1265
+ function fo(t) {
1266
+ return ((t = Math.exp(t)) - 1 / t) / 2;
1267
+ }
1268
+ function ho(t) {
1269
+ return ((t = Math.exp(2 * t)) - 1) / (t + 1);
1270
+ }
1271
+ const mo = (function t(e, n, r) {
1272
+ function i(o, a) {
1273
+ var s = o[0], c = o[1], u = o[2], l = a[0], h = a[1], f = a[2], d = l - s, x = h - c, y = d * d + x * x, v, g;
1274
+ if (y < lo)
1275
+ g = Math.log(f / u) / e, v = function(I) {
1276
+ return [
1277
+ s + I * d,
1278
+ c + I * x,
1279
+ u * Math.exp(e * I * g)
1280
+ ];
1281
+ };
1282
+ else {
1283
+ var b = Math.sqrt(y), N = (f * f - u * u + r * y) / (2 * u * n * b), p = (f * f - u * u - r * y) / (2 * f * n * b), _ = Math.log(Math.sqrt(N * N + 1) - N), A = Math.log(Math.sqrt(p * p + 1) - p);
1284
+ g = (A - _) / e, v = function(I) {
1285
+ var S = I * g, L = Ye(_), z = u / (n * b) * (L * ho(e * S + _) - fo(_));
1286
+ return [
1287
+ s + z * d,
1288
+ c + z * x,
1289
+ u * L / Ye(e * S + _)
1290
+ ];
1291
+ };
1292
+ }
1293
+ return v.duration = g * 1e3 * e / Math.SQRT2, v;
1294
+ }
1295
+ return i.rho = function(o) {
1296
+ var a = Math.max(1e-3, +o), s = a * a, c = s * s;
1297
+ return t(a, s, c);
1298
+ }, i;
1299
+ })(Math.SQRT2, 2, 4);
1300
+ function go(t) {
1301
+ return function() {
1302
+ return t;
1303
+ };
1304
+ }
1305
+ function po(t) {
1306
+ return +t;
1307
+ }
1308
+ var Ge = [0, 1];
1309
+ function st(t) {
1310
+ return t;
1311
+ }
1312
+ function de(t, e) {
1313
+ return (e -= t = +t) ? function(n) {
1314
+ return (n - t) / e;
1315
+ } : go(isNaN(e) ? NaN : 0.5);
1316
+ }
1317
+ function yo(t, e) {
1318
+ var n;
1319
+ return t > e && (n = t, t = e, e = n), function(r) {
1320
+ return Math.max(t, Math.min(e, r));
1321
+ };
1322
+ }
1323
+ function vo(t, e, n) {
1324
+ var r = t[0], i = t[1], o = e[0], a = e[1];
1325
+ return i < r ? (r = de(i, r), o = n(a, o)) : (r = de(r, i), o = n(o, a)), function(s) {
1326
+ return o(r(s));
1327
+ };
1328
+ }
1329
+ function wo(t, e, n) {
1330
+ var r = Math.min(t.length, e.length) - 1, i = new Array(r), o = new Array(r), a = -1;
1331
+ for (t[r] < t[0] && (t = t.slice().reverse(), e = e.slice().reverse()); ++a < r; )
1332
+ i[a] = de(t[a], t[a + 1]), o[a] = n(e[a], e[a + 1]);
1333
+ return function(s) {
1334
+ var c = Ai(t, s, 1, r) - 1;
1335
+ return o[c](i[c](s));
1336
+ };
1337
+ }
1338
+ function xo(t, e) {
1339
+ return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());
1340
+ }
1341
+ function _o() {
1342
+ var t = Ge, e = Ge, n = Ce, r, i, o, a = st, s, c, u;
1343
+ function l() {
1344
+ var f = Math.min(t.length, e.length);
1345
+ return a !== st && (a = yo(t[0], t[f - 1])), s = f > 2 ? wo : vo, c = u = null, h;
1346
+ }
1347
+ function h(f) {
1348
+ return f == null || isNaN(f = +f) ? o : (c || (c = s(t.map(r), e, n)))(r(a(f)));
1349
+ }
1350
+ return h.invert = function(f) {
1351
+ return a(i((u || (u = s(e, t.map(r), Z)))(f)));
1352
+ }, h.domain = function(f) {
1353
+ return arguments.length ? (t = Array.from(f, po), l()) : t.slice();
1354
+ }, h.range = function(f) {
1355
+ return arguments.length ? (e = Array.from(f), l()) : e.slice();
1356
+ }, h.rangeRound = function(f) {
1357
+ return e = Array.from(f), n = oo, l();
1358
+ }, h.clamp = function(f) {
1359
+ return arguments.length ? (a = f ? !0 : st, l()) : a !== st;
1360
+ }, h.interpolate = function(f) {
1361
+ return arguments.length ? (n = f, l()) : n;
1362
+ }, h.unknown = function(f) {
1363
+ return arguments.length ? (o = f, h) : o;
1364
+ }, function(f, d) {
1365
+ return r = f, i = d, l();
1366
+ };
1367
+ }
1368
+ function bo(t) {
1369
+ return Math.abs(t = Math.round(t)) >= 1e21 ? t.toLocaleString("en").replace(/,/g, "") : t.toString(10);
1370
+ }
1371
+ function Kt(t, e) {
1372
+ if (!isFinite(t) || t === 0) return null;
1373
+ var n = (t = e ? t.toExponential(e - 1) : t.toExponential()).indexOf("e"), r = t.slice(0, n);
1374
+ return [
1375
+ r.length > 1 ? r[0] + r.slice(2) : r,
1376
+ +t.slice(n + 1)
1377
+ ];
1378
+ }
1379
+ function vt(t) {
1380
+ return t = Kt(Math.abs(t)), t ? t[1] : NaN;
1381
+ }
1382
+ function Co(t, e) {
1383
+ return function(n, r) {
1384
+ for (var i = n.length, o = [], a = 0, s = t[0], c = 0; i > 0 && s > 0 && (c + s + 1 > r && (s = Math.max(1, r - c)), o.push(n.substring(i -= s, i + s)), !((c += s + 1) > r)); )
1385
+ s = t[a = (a + 1) % t.length];
1386
+ return o.reverse().join(e);
1387
+ };
1388
+ }
1389
+ function Mo(t) {
1390
+ return function(e) {
1391
+ return e.replace(/[0-9]/g, function(n) {
1392
+ return t[+n];
1393
+ });
1394
+ };
1395
+ }
1396
+ var Eo = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
1397
+ function Wt(t) {
1398
+ if (!(e = Eo.exec(t))) throw new Error("invalid format: " + t);
1399
+ var e;
1400
+ return new Me({
1401
+ fill: e[1],
1402
+ align: e[2],
1403
+ sign: e[3],
1404
+ symbol: e[4],
1405
+ zero: e[5],
1406
+ width: e[6],
1407
+ comma: e[7],
1408
+ precision: e[8] && e[8].slice(1),
1409
+ trim: e[9],
1410
+ type: e[10]
1411
+ });
1412
+ }
1413
+ Wt.prototype = Me.prototype;
1414
+ function Me(t) {
1415
+ this.fill = t.fill === void 0 ? " " : t.fill + "", this.align = t.align === void 0 ? ">" : t.align + "", this.sign = t.sign === void 0 ? "-" : t.sign + "", this.symbol = t.symbol === void 0 ? "" : t.symbol + "", this.zero = !!t.zero, this.width = t.width === void 0 ? void 0 : +t.width, this.comma = !!t.comma, this.precision = t.precision === void 0 ? void 0 : +t.precision, this.trim = !!t.trim, this.type = t.type === void 0 ? "" : t.type + "";
1416
+ }
1417
+ Me.prototype.toString = function() {
1418
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
1419
+ };
1420
+ function No(t) {
1421
+ t: for (var e = t.length, n = 1, r = -1, i; n < e; ++n)
1422
+ switch (t[n]) {
1423
+ case ".":
1424
+ r = i = n;
1425
+ break;
1426
+ case "0":
1427
+ r === 0 && (r = n), i = n;
1428
+ break;
1429
+ default:
1430
+ if (!+t[n]) break t;
1431
+ r > 0 && (r = 0);
1432
+ break;
1433
+ }
1434
+ return r > 0 ? t.slice(0, r) + t.slice(i + 1) : t;
1435
+ }
1436
+ var Zt;
1437
+ function ko(t, e) {
1438
+ var n = Kt(t, e);
1439
+ if (!n) return Zt = void 0, t.toPrecision(e);
1440
+ var r = n[0], i = n[1], o = i - (Zt = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, a = r.length;
1441
+ return o === a ? r : o > a ? r + new Array(o - a + 1).join("0") : o > 0 ? r.slice(0, o) + "." + r.slice(o) : "0." + new Array(1 - o).join("0") + Kt(t, Math.max(0, e + o - 1))[0];
1442
+ }
1443
+ function Ue(t, e) {
1444
+ var n = Kt(t, e);
1445
+ if (!n) return t + "";
1446
+ var r = n[0], i = n[1];
1447
+ return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");
1448
+ }
1449
+ const Ke = {
1450
+ "%": (t, e) => (t * 100).toFixed(e),
1451
+ b: (t) => Math.round(t).toString(2),
1452
+ c: (t) => t + "",
1453
+ d: bo,
1454
+ e: (t, e) => t.toExponential(e),
1455
+ f: (t, e) => t.toFixed(e),
1456
+ g: (t, e) => t.toPrecision(e),
1457
+ o: (t) => Math.round(t).toString(8),
1458
+ p: (t, e) => Ue(t * 100, e),
1459
+ r: Ue,
1460
+ s: ko,
1461
+ X: (t) => Math.round(t).toString(16).toUpperCase(),
1462
+ x: (t) => Math.round(t).toString(16)
1463
+ };
1464
+ function We(t) {
1465
+ return t;
1466
+ }
1467
+ var Ze = Array.prototype.map, Qe = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
1468
+ function Ao(t) {
1469
+ var e = t.grouping === void 0 || t.thousands === void 0 ? We : Co(Ze.call(t.grouping, Number), t.thousands + ""), n = t.currency === void 0 ? "" : t.currency[0] + "", r = t.currency === void 0 ? "" : t.currency[1] + "", i = t.decimal === void 0 ? "." : t.decimal + "", o = t.numerals === void 0 ? We : Mo(Ze.call(t.numerals, String)), a = t.percent === void 0 ? "%" : t.percent + "", s = t.minus === void 0 ? "−" : t.minus + "", c = t.nan === void 0 ? "NaN" : t.nan + "";
1470
+ function u(h, f) {
1471
+ h = Wt(h);
1472
+ var d = h.fill, x = h.align, y = h.sign, v = h.symbol, g = h.zero, b = h.width, N = h.comma, p = h.precision, _ = h.trim, A = h.type;
1473
+ A === "n" ? (N = !0, A = "g") : Ke[A] || (p === void 0 && (p = 12), _ = !0, A = "g"), (g || d === "0" && x === "=") && (g = !0, d = "0", x = "=");
1474
+ var I = (f && f.prefix !== void 0 ? f.prefix : "") + (v === "$" ? n : v === "#" && /[boxX]/.test(A) ? "0" + A.toLowerCase() : ""), S = (v === "$" ? r : /[%p]/.test(A) ? a : "") + (f && f.suffix !== void 0 ? f.suffix : ""), L = Ke[A], z = /[defgprs%]/.test(A);
1475
+ p = p === void 0 ? 6 : /[gprs]/.test(A) ? Math.max(1, Math.min(21, p)) : Math.max(0, Math.min(20, p));
1476
+ function R($) {
1477
+ var P = I, m = S, C, w, E;
1478
+ if (A === "c")
1479
+ m = L($) + m, $ = "";
1480
+ else {
1481
+ $ = +$;
1482
+ var T = $ < 0 || 1 / $ < 0;
1483
+ if ($ = isNaN($) ? c : L(Math.abs($), p), _ && ($ = No($)), T && +$ == 0 && y !== "+" && (T = !1), P = (T ? y === "(" ? y : s : y === "-" || y === "(" ? "" : y) + P, m = (A === "s" && !isNaN($) && Zt !== void 0 ? Qe[8 + Zt / 3] : "") + m + (T && y === "(" ? ")" : ""), z) {
1484
+ for (C = -1, w = $.length; ++C < w; )
1485
+ if (E = $.charCodeAt(C), 48 > E || E > 57) {
1486
+ m = (E === 46 ? i + $.slice(C + 1) : $.slice(C)) + m, $ = $.slice(0, C);
1487
+ break;
1488
+ }
1489
+ }
1490
+ }
1491
+ N && !g && ($ = e($, 1 / 0));
1492
+ var M = P.length + $.length + m.length, k = M < b ? new Array(b - M + 1).join(d) : "";
1493
+ switch (N && g && ($ = e(k + $, k.length ? b - m.length : 1 / 0), k = ""), x) {
1494
+ case "<":
1495
+ $ = P + $ + m + k;
1496
+ break;
1497
+ case "=":
1498
+ $ = P + k + $ + m;
1499
+ break;
1500
+ case "^":
1501
+ $ = k.slice(0, M = k.length >> 1) + P + $ + m + k.slice(M);
1502
+ break;
1503
+ default:
1504
+ $ = k + P + $ + m;
1505
+ break;
1506
+ }
1507
+ return o($);
1508
+ }
1509
+ return R.toString = function() {
1510
+ return h + "";
1511
+ }, R;
1512
+ }
1513
+ function l(h, f) {
1514
+ var d = Math.max(-8, Math.min(8, Math.floor(vt(f) / 3))) * 3, x = Math.pow(10, -d), y = u((h = Wt(h), h.type = "f", h), { suffix: Qe[8 + d / 3] });
1515
+ return function(v) {
1516
+ return y(x * v);
1517
+ };
1518
+ }
1519
+ return {
1520
+ format: u,
1521
+ formatPrefix: l
1522
+ };
1523
+ }
1524
+ var zt, $n, Tn;
1525
+ So({
1526
+ thousands: ",",
1527
+ grouping: [3],
1528
+ currency: ["$", ""]
1529
+ });
1530
+ function So(t) {
1531
+ return zt = Ao(t), $n = zt.format, Tn = zt.formatPrefix, zt;
1532
+ }
1533
+ function $o(t) {
1534
+ return Math.max(0, -vt(Math.abs(t)));
1535
+ }
1536
+ function To(t, e) {
1537
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(vt(e) / 3))) * 3 - vt(Math.abs(t)));
1538
+ }
1539
+ function Io(t, e) {
1540
+ return t = Math.abs(t), e = Math.abs(e) - t, Math.max(0, vt(e) - vt(t)) + 1;
1541
+ }
1542
+ function Lo(t, e, n, r) {
1543
+ var i = Di(t, e, n), o;
1544
+ switch (r = Wt(r ?? ",f"), r.type) {
1545
+ case "s": {
1546
+ var a = Math.max(Math.abs(t), Math.abs(e));
1547
+ return r.precision == null && !isNaN(o = To(i, a)) && (r.precision = o), Tn(r, a);
1548
+ }
1549
+ case "":
1550
+ case "e":
1551
+ case "g":
1552
+ case "p":
1553
+ case "r": {
1554
+ r.precision == null && !isNaN(o = Io(i, Math.max(Math.abs(t), Math.abs(e)))) && (r.precision = o - (r.type === "e"));
1555
+ break;
1556
+ }
1557
+ case "f":
1558
+ case "%": {
1559
+ r.precision == null && !isNaN(o = $o(i)) && (r.precision = o - (r.type === "%") * 2);
1560
+ break;
1561
+ }
1562
+ }
1563
+ return $n(r);
1564
+ }
1565
+ function zo(t) {
1566
+ var e = t.domain;
1567
+ return t.ticks = function(n) {
1568
+ var r = e();
1569
+ return Ri(r[0], r[r.length - 1], n ?? 10);
1570
+ }, t.tickFormat = function(n, r) {
1571
+ var i = e();
1572
+ return Lo(i[0], i[i.length - 1], n ?? 10, r);
1573
+ }, t.nice = function(n) {
1574
+ n == null && (n = 10);
1575
+ var r = e(), i = 0, o = r.length - 1, a = r[i], s = r[o], c, u, l = 10;
1576
+ for (s < a && (u = a, a = s, s = u, u = i, i = o, o = u); l-- > 0; ) {
1577
+ if (u = ce(a, s, n), u === c)
1578
+ return r[i] = a, r[o] = s, e(r);
1579
+ if (u > 0)
1580
+ a = Math.floor(a / u) * u, s = Math.ceil(s / u) * u;
1581
+ else if (u < 0)
1582
+ a = Math.ceil(a * u) / u, s = Math.floor(s * u) / u;
1583
+ else
1584
+ break;
1585
+ c = u;
1586
+ }
1587
+ return t;
1588
+ }, t;
1589
+ }
1590
+ function Je(t) {
1591
+ return function(e) {
1592
+ return e < 0 ? -Math.pow(-e, t) : Math.pow(e, t);
1593
+ };
1594
+ }
1595
+ function Ro(t) {
1596
+ return t < 0 ? -Math.sqrt(-t) : Math.sqrt(t);
1597
+ }
1598
+ function Do(t) {
1599
+ return t < 0 ? -t * t : t * t;
1600
+ }
1601
+ function Po(t) {
1602
+ var e = t(st, st), n = 1;
1603
+ function r() {
1604
+ return n === 1 ? t(st, st) : n === 0.5 ? t(Ro, Do) : t(Je(n), Je(1 / n));
1605
+ }
1606
+ return e.exponent = function(i) {
1607
+ return arguments.length ? (n = +i, r()) : n;
1608
+ }, zo(e);
1609
+ }
1610
+ function In() {
1611
+ var t = Po(_o());
1612
+ return t.copy = function() {
1613
+ return xo(t, In()).exponent(t.exponent());
1614
+ }, Cn.apply(t, arguments), t;
1615
+ }
1616
+ function Ln() {
1617
+ return In.apply(null, arguments).exponent(0.5);
1618
+ }
1619
+ function zn(t) {
1620
+ for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6);
1621
+ return n;
1622
+ }
1623
+ const Fo = zn("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"), Ho = zn("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"), Oo = 960, Bo = 600;
1624
+ function Xo() {
1625
+ return xe(Ho);
1626
+ }
1627
+ function qo() {
1628
+ return xe(Fo);
1629
+ }
1630
+ const Vo = 6;
1631
+ function Yo() {
1632
+ const t = Ln().domain([0, 2e3]).range([4, 20]).clamp(!0);
1633
+ return (e) => e === null ? Vo : t(e);
1634
+ }
1635
+ function Go() {
1636
+ const t = Ln().domain([0, 20]).range([1, 8]).clamp(!0);
1637
+ return (e) => t(e);
1638
+ }
1639
+ function Uo(t, e) {
1640
+ var n, r = 1;
1641
+ t == null && (t = 0), e == null && (e = 0);
1642
+ function i() {
1643
+ var o, a = n.length, s, c = 0, u = 0;
1644
+ for (o = 0; o < a; ++o)
1645
+ s = n[o], c += s.x, u += s.y;
1646
+ for (c = (c / a - t) * r, u = (u / a - e) * r, o = 0; o < a; ++o)
1647
+ s = n[o], s.x -= c, s.y -= u;
1648
+ }
1649
+ return i.initialize = function(o) {
1650
+ n = o;
1651
+ }, i.x = function(o) {
1652
+ return arguments.length ? (t = +o, i) : t;
1653
+ }, i.y = function(o) {
1654
+ return arguments.length ? (e = +o, i) : e;
1655
+ }, i.strength = function(o) {
1656
+ return arguments.length ? (r = +o, i) : r;
1657
+ }, i;
1658
+ }
1659
+ function Ko(t) {
1660
+ const e = +this._x.call(null, t), n = +this._y.call(null, t);
1661
+ return Rn(this.cover(e, n), e, n, t);
1662
+ }
1663
+ function Rn(t, e, n, r) {
1664
+ if (isNaN(e) || isNaN(n)) return t;
1665
+ var i, o = t._root, a = { data: r }, s = t._x0, c = t._y0, u = t._x1, l = t._y1, h, f, d, x, y, v, g, b;
1666
+ if (!o) return t._root = a, t;
1667
+ for (; o.length; )
1668
+ if ((y = e >= (h = (s + u) / 2)) ? s = h : u = h, (v = n >= (f = (c + l) / 2)) ? c = f : l = f, i = o, !(o = o[g = v << 1 | y])) return i[g] = a, t;
1669
+ if (d = +t._x.call(null, o.data), x = +t._y.call(null, o.data), e === d && n === x) return a.next = o, i ? i[g] = a : t._root = a, t;
1670
+ do
1671
+ i = i ? i[g] = new Array(4) : t._root = new Array(4), (y = e >= (h = (s + u) / 2)) ? s = h : u = h, (v = n >= (f = (c + l) / 2)) ? c = f : l = f;
1672
+ while ((g = v << 1 | y) === (b = (x >= f) << 1 | d >= h));
1673
+ return i[b] = o, i[g] = a, t;
1674
+ }
1675
+ function Wo(t) {
1676
+ var e, n, r = t.length, i, o, a = new Array(r), s = new Array(r), c = 1 / 0, u = 1 / 0, l = -1 / 0, h = -1 / 0;
1677
+ for (n = 0; n < r; ++n)
1678
+ isNaN(i = +this._x.call(null, e = t[n])) || isNaN(o = +this._y.call(null, e)) || (a[n] = i, s[n] = o, i < c && (c = i), i > l && (l = i), o < u && (u = o), o > h && (h = o));
1679
+ if (c > l || u > h) return this;
1680
+ for (this.cover(c, u).cover(l, h), n = 0; n < r; ++n)
1681
+ Rn(this, a[n], s[n], t[n]);
1682
+ return this;
1683
+ }
1684
+ function Zo(t, e) {
1685
+ if (isNaN(t = +t) || isNaN(e = +e)) return this;
1686
+ var n = this._x0, r = this._y0, i = this._x1, o = this._y1;
1687
+ if (isNaN(n))
1688
+ i = (n = Math.floor(t)) + 1, o = (r = Math.floor(e)) + 1;
1689
+ else {
1690
+ for (var a = i - n || 1, s = this._root, c, u; n > t || t >= i || r > e || e >= o; )
1691
+ switch (u = (e < r) << 1 | t < n, c = new Array(4), c[u] = s, s = c, a *= 2, u) {
1692
+ case 0:
1693
+ i = n + a, o = r + a;
1694
+ break;
1695
+ case 1:
1696
+ n = i - a, o = r + a;
1697
+ break;
1698
+ case 2:
1699
+ i = n + a, r = o - a;
1700
+ break;
1701
+ case 3:
1702
+ n = i - a, r = o - a;
1703
+ break;
1704
+ }
1705
+ this._root && this._root.length && (this._root = s);
1706
+ }
1707
+ return this._x0 = n, this._y0 = r, this._x1 = i, this._y1 = o, this;
1708
+ }
1709
+ function Qo() {
1710
+ var t = [];
1711
+ return this.visit(function(e) {
1712
+ if (!e.length) do
1713
+ t.push(e.data);
1714
+ while (e = e.next);
1715
+ }), t;
1716
+ }
1717
+ function Jo(t) {
1718
+ return arguments.length ? this.cover(+t[0][0], +t[0][1]).cover(+t[1][0], +t[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]];
1719
+ }
1720
+ function V(t, e, n, r, i) {
1721
+ this.node = t, this.x0 = e, this.y0 = n, this.x1 = r, this.y1 = i;
1722
+ }
1723
+ function jo(t, e, n) {
1724
+ var r, i = this._x0, o = this._y0, a, s, c, u, l = this._x1, h = this._y1, f = [], d = this._root, x, y;
1725
+ for (d && f.push(new V(d, i, o, l, h)), n == null ? n = 1 / 0 : (i = t - n, o = e - n, l = t + n, h = e + n, n *= n); x = f.pop(); )
1726
+ if (!(!(d = x.node) || (a = x.x0) > l || (s = x.y0) > h || (c = x.x1) < i || (u = x.y1) < o))
1727
+ if (d.length) {
1728
+ var v = (a + c) / 2, g = (s + u) / 2;
1729
+ f.push(
1730
+ new V(d[3], v, g, c, u),
1731
+ new V(d[2], a, g, v, u),
1732
+ new V(d[1], v, s, c, g),
1733
+ new V(d[0], a, s, v, g)
1734
+ ), (y = (e >= g) << 1 | t >= v) && (x = f[f.length - 1], f[f.length - 1] = f[f.length - 1 - y], f[f.length - 1 - y] = x);
1735
+ } else {
1736
+ var b = t - +this._x.call(null, d.data), N = e - +this._y.call(null, d.data), p = b * b + N * N;
1737
+ if (p < n) {
1738
+ var _ = Math.sqrt(n = p);
1739
+ i = t - _, o = e - _, l = t + _, h = e + _, r = d.data;
1740
+ }
1741
+ }
1742
+ return r;
1743
+ }
1744
+ function ta(t) {
1745
+ if (isNaN(l = +this._x.call(null, t)) || isNaN(h = +this._y.call(null, t))) return this;
1746
+ var e, n = this._root, r, i, o, a = this._x0, s = this._y0, c = this._x1, u = this._y1, l, h, f, d, x, y, v, g;
1747
+ if (!n) return this;
1748
+ if (n.length) for (; ; ) {
1749
+ if ((x = l >= (f = (a + c) / 2)) ? a = f : c = f, (y = h >= (d = (s + u) / 2)) ? s = d : u = d, e = n, !(n = n[v = y << 1 | x])) return this;
1750
+ if (!n.length) break;
1751
+ (e[v + 1 & 3] || e[v + 2 & 3] || e[v + 3 & 3]) && (r = e, g = v);
1752
+ }
1753
+ for (; n.data !== t; ) if (i = n, !(n = n.next)) return this;
1754
+ return (o = n.next) && delete n.next, i ? (o ? i.next = o : delete i.next, this) : e ? (o ? e[v] = o : delete e[v], (n = e[0] || e[1] || e[2] || e[3]) && n === (e[3] || e[2] || e[1] || e[0]) && !n.length && (r ? r[g] = n : this._root = n), this) : (this._root = o, this);
1755
+ }
1756
+ function ea(t) {
1757
+ for (var e = 0, n = t.length; e < n; ++e) this.remove(t[e]);
1758
+ return this;
1759
+ }
1760
+ function na() {
1761
+ return this._root;
1762
+ }
1763
+ function ra() {
1764
+ var t = 0;
1765
+ return this.visit(function(e) {
1766
+ if (!e.length) do
1767
+ ++t;
1768
+ while (e = e.next);
1769
+ }), t;
1770
+ }
1771
+ function ia(t) {
1772
+ var e = [], n, r = this._root, i, o, a, s, c;
1773
+ for (r && e.push(new V(r, this._x0, this._y0, this._x1, this._y1)); n = e.pop(); )
1774
+ if (!t(r = n.node, o = n.x0, a = n.y0, s = n.x1, c = n.y1) && r.length) {
1775
+ var u = (o + s) / 2, l = (a + c) / 2;
1776
+ (i = r[3]) && e.push(new V(i, u, l, s, c)), (i = r[2]) && e.push(new V(i, o, l, u, c)), (i = r[1]) && e.push(new V(i, u, a, s, l)), (i = r[0]) && e.push(new V(i, o, a, u, l));
1777
+ }
1778
+ return this;
1779
+ }
1780
+ function oa(t) {
1781
+ var e = [], n = [], r;
1782
+ for (this._root && e.push(new V(this._root, this._x0, this._y0, this._x1, this._y1)); r = e.pop(); ) {
1783
+ var i = r.node;
1784
+ if (i.length) {
1785
+ var o, a = r.x0, s = r.y0, c = r.x1, u = r.y1, l = (a + c) / 2, h = (s + u) / 2;
1786
+ (o = i[0]) && e.push(new V(o, a, s, l, h)), (o = i[1]) && e.push(new V(o, l, s, c, h)), (o = i[2]) && e.push(new V(o, a, h, l, u)), (o = i[3]) && e.push(new V(o, l, h, c, u));
1787
+ }
1788
+ n.push(r);
1789
+ }
1790
+ for (; r = n.pop(); )
1791
+ t(r.node, r.x0, r.y0, r.x1, r.y1);
1792
+ return this;
1793
+ }
1794
+ function aa(t) {
1795
+ return t[0];
1796
+ }
1797
+ function sa(t) {
1798
+ return arguments.length ? (this._x = t, this) : this._x;
1799
+ }
1800
+ function ua(t) {
1801
+ return t[1];
1802
+ }
1803
+ function ca(t) {
1804
+ return arguments.length ? (this._y = t, this) : this._y;
1805
+ }
1806
+ function Ee(t, e, n) {
1807
+ var r = new Ne(e ?? aa, n ?? ua, NaN, NaN, NaN, NaN);
1808
+ return t == null ? r : r.addAll(t);
1809
+ }
1810
+ function Ne(t, e, n, r, i, o) {
1811
+ this._x = t, this._y = e, this._x0 = n, this._y0 = r, this._x1 = i, this._y1 = o, this._root = void 0;
1812
+ }
1813
+ function je(t) {
1814
+ for (var e = { data: t.data }, n = e; t = t.next; ) n = n.next = { data: t.data };
1815
+ return e;
1816
+ }
1817
+ var Y = Ee.prototype = Ne.prototype;
1818
+ Y.copy = function() {
1819
+ var t = new Ne(this._x, this._y, this._x0, this._y0, this._x1, this._y1), e = this._root, n, r;
1820
+ if (!e) return t;
1821
+ if (!e.length) return t._root = je(e), t;
1822
+ for (n = [{ source: e, target: t._root = new Array(4) }]; e = n.pop(); )
1823
+ for (var i = 0; i < 4; ++i)
1824
+ (r = e.source[i]) && (r.length ? n.push({ source: r, target: e.target[i] = new Array(4) }) : e.target[i] = je(r));
1825
+ return t;
1826
+ };
1827
+ Y.add = Ko;
1828
+ Y.addAll = Wo;
1829
+ Y.cover = Zo;
1830
+ Y.data = Qo;
1831
+ Y.extent = Jo;
1832
+ Y.find = jo;
1833
+ Y.remove = ta;
1834
+ Y.removeAll = ea;
1835
+ Y.root = na;
1836
+ Y.size = ra;
1837
+ Y.visit = ia;
1838
+ Y.visitAfter = oa;
1839
+ Y.x = sa;
1840
+ Y.y = ca;
1841
+ function ht(t) {
1842
+ return function() {
1843
+ return t;
1844
+ };
1845
+ }
1846
+ function ut(t) {
1847
+ return (t() - 0.5) * 1e-6;
1848
+ }
1849
+ function la(t) {
1850
+ return t.x + t.vx;
1851
+ }
1852
+ function fa(t) {
1853
+ return t.y + t.vy;
1854
+ }
1855
+ function ha(t) {
1856
+ var e, n, r, i = 1, o = 1;
1857
+ typeof t != "function" && (t = ht(t == null ? 1 : +t));
1858
+ function a() {
1859
+ for (var u, l = e.length, h, f, d, x, y, v, g = 0; g < o; ++g)
1860
+ for (h = Ee(e, la, fa).visitAfter(s), u = 0; u < l; ++u)
1861
+ f = e[u], y = n[f.index], v = y * y, d = f.x + f.vx, x = f.y + f.vy, h.visit(b);
1862
+ function b(N, p, _, A, I) {
1863
+ var S = N.data, L = N.r, z = y + L;
1864
+ if (S) {
1865
+ if (S.index > f.index) {
1866
+ var R = d - S.x - S.vx, $ = x - S.y - S.vy, P = R * R + $ * $;
1867
+ P < z * z && (R === 0 && (R = ut(r), P += R * R), $ === 0 && ($ = ut(r), P += $ * $), P = (z - (P = Math.sqrt(P))) / P * i, f.vx += (R *= P) * (z = (L *= L) / (v + L)), f.vy += ($ *= P) * z, S.vx -= R * (z = 1 - z), S.vy -= $ * z);
1868
+ }
1869
+ return;
1870
+ }
1871
+ return p > d + z || A < d - z || _ > x + z || I < x - z;
1872
+ }
1873
+ }
1874
+ function s(u) {
1875
+ if (u.data) return u.r = n[u.data.index];
1876
+ for (var l = u.r = 0; l < 4; ++l)
1877
+ u[l] && u[l].r > u.r && (u.r = u[l].r);
1878
+ }
1879
+ function c() {
1880
+ if (e) {
1881
+ var u, l = e.length, h;
1882
+ for (n = new Array(l), u = 0; u < l; ++u) h = e[u], n[h.index] = +t(h, u, e);
1883
+ }
1884
+ }
1885
+ return a.initialize = function(u, l) {
1886
+ e = u, r = l, c();
1887
+ }, a.iterations = function(u) {
1888
+ return arguments.length ? (o = +u, a) : o;
1889
+ }, a.strength = function(u) {
1890
+ return arguments.length ? (i = +u, a) : i;
1891
+ }, a.radius = function(u) {
1892
+ return arguments.length ? (t = typeof u == "function" ? u : ht(+u), c(), a) : t;
1893
+ }, a;
1894
+ }
1895
+ function da(t) {
1896
+ return t.index;
1897
+ }
1898
+ function tn(t, e) {
1899
+ var n = t.get(e);
1900
+ if (!n) throw new Error("node not found: " + e);
1901
+ return n;
1902
+ }
1903
+ function ma(t) {
1904
+ var e = da, n = h, r, i = ht(30), o, a, s, c, u, l = 1;
1905
+ t == null && (t = []);
1906
+ function h(v) {
1907
+ return 1 / Math.min(s[v.source.index], s[v.target.index]);
1908
+ }
1909
+ function f(v) {
1910
+ for (var g = 0, b = t.length; g < l; ++g)
1911
+ for (var N = 0, p, _, A, I, S, L, z; N < b; ++N)
1912
+ p = t[N], _ = p.source, A = p.target, I = A.x + A.vx - _.x - _.vx || ut(u), S = A.y + A.vy - _.y - _.vy || ut(u), L = Math.sqrt(I * I + S * S), L = (L - o[N]) / L * v * r[N], I *= L, S *= L, A.vx -= I * (z = c[N]), A.vy -= S * z, _.vx += I * (z = 1 - z), _.vy += S * z;
1913
+ }
1914
+ function d() {
1915
+ if (a) {
1916
+ var v, g = a.length, b = t.length, N = new Map(a.map((_, A) => [e(_, A, a), _])), p;
1917
+ for (v = 0, s = new Array(g); v < b; ++v)
1918
+ p = t[v], p.index = v, typeof p.source != "object" && (p.source = tn(N, p.source)), typeof p.target != "object" && (p.target = tn(N, p.target)), s[p.source.index] = (s[p.source.index] || 0) + 1, s[p.target.index] = (s[p.target.index] || 0) + 1;
1919
+ for (v = 0, c = new Array(b); v < b; ++v)
1920
+ p = t[v], c[v] = s[p.source.index] / (s[p.source.index] + s[p.target.index]);
1921
+ r = new Array(b), x(), o = new Array(b), y();
1922
+ }
1923
+ }
1924
+ function x() {
1925
+ if (a)
1926
+ for (var v = 0, g = t.length; v < g; ++v)
1927
+ r[v] = +n(t[v], v, t);
1928
+ }
1929
+ function y() {
1930
+ if (a)
1931
+ for (var v = 0, g = t.length; v < g; ++v)
1932
+ o[v] = +i(t[v], v, t);
1933
+ }
1934
+ return f.initialize = function(v, g) {
1935
+ a = v, u = g, d();
1936
+ }, f.links = function(v) {
1937
+ return arguments.length ? (t = v, d(), f) : t;
1938
+ }, f.id = function(v) {
1939
+ return arguments.length ? (e = v, f) : e;
1940
+ }, f.iterations = function(v) {
1941
+ return arguments.length ? (l = +v, f) : l;
1942
+ }, f.strength = function(v) {
1943
+ return arguments.length ? (n = typeof v == "function" ? v : ht(+v), x(), f) : n;
1944
+ }, f.distance = function(v) {
1945
+ return arguments.length ? (i = typeof v == "function" ? v : ht(+v), y(), f) : i;
1946
+ }, f;
1947
+ }
1948
+ var ga = { value: () => {
1949
+ } };
1950
+ function $t() {
1951
+ for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) {
1952
+ if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r);
1953
+ n[r] = [];
1954
+ }
1955
+ return new Ht(n);
1956
+ }
1957
+ function Ht(t) {
1958
+ this._ = t;
1959
+ }
1960
+ function pa(t, e) {
1961
+ return t.trim().split(/^|\s+/).map(function(n) {
1962
+ var r = "", i = n.indexOf(".");
1963
+ if (i >= 0 && (r = n.slice(i + 1), n = n.slice(0, i)), n && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n);
1964
+ return { type: n, name: r };
1965
+ });
1966
+ }
1967
+ Ht.prototype = $t.prototype = {
1968
+ constructor: Ht,
1969
+ on: function(t, e) {
1970
+ var n = this._, r = pa(t + "", n), i, o = -1, a = r.length;
1971
+ if (arguments.length < 2) {
1972
+ for (; ++o < a; ) if ((i = (t = r[o]).type) && (i = ya(n[i], t.name))) return i;
1973
+ return;
1974
+ }
1975
+ if (e != null && typeof e != "function") throw new Error("invalid callback: " + e);
1976
+ for (; ++o < a; )
1977
+ if (i = (t = r[o]).type) n[i] = en(n[i], t.name, e);
1978
+ else if (e == null) for (i in n) n[i] = en(n[i], t.name, null);
1979
+ return this;
1980
+ },
1981
+ copy: function() {
1982
+ var t = {}, e = this._;
1983
+ for (var n in e) t[n] = e[n].slice();
1984
+ return new Ht(t);
1985
+ },
1986
+ call: function(t, e) {
1987
+ if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, o; r < i; ++r) n[r] = arguments[r + 2];
1988
+ if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
1989
+ for (o = this._[t], r = 0, i = o.length; r < i; ++r) o[r].value.apply(e, n);
1990
+ },
1991
+ apply: function(t, e, n) {
1992
+ if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
1993
+ for (var r = this._[t], i = 0, o = r.length; i < o; ++i) r[i].value.apply(e, n);
1994
+ }
1995
+ };
1996
+ function ya(t, e) {
1997
+ for (var n = 0, r = t.length, i; n < r; ++n)
1998
+ if ((i = t[n]).name === e)
1999
+ return i.value;
2000
+ }
2001
+ function en(t, e, n) {
2002
+ for (var r = 0, i = t.length; r < i; ++r)
2003
+ if (t[r].name === e) {
2004
+ t[r] = ga, t = t.slice(0, r).concat(t.slice(r + 1));
2005
+ break;
2006
+ }
2007
+ return n != null && t.push({ name: e, value: n }), t;
2008
+ }
2009
+ var wt = 0, bt = 0, xt = 0, Dn = 1e3, Qt, Ct, Jt = 0, mt = 0, ee = 0, Nt = typeof performance == "object" && performance.now ? performance : Date, Pn = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
2010
+ setTimeout(t, 17);
2011
+ };
2012
+ function ke() {
2013
+ return mt || (Pn(va), mt = Nt.now() + ee);
2014
+ }
2015
+ function va() {
2016
+ mt = 0;
2017
+ }
2018
+ function jt() {
2019
+ this._call = this._time = this._next = null;
2020
+ }
2021
+ jt.prototype = Ae.prototype = {
2022
+ constructor: jt,
2023
+ restart: function(t, e, n) {
2024
+ if (typeof t != "function") throw new TypeError("callback is not a function");
2025
+ n = (n == null ? ke() : +n) + (e == null ? 0 : +e), !this._next && Ct !== this && (Ct ? Ct._next = this : Qt = this, Ct = this), this._call = t, this._time = n, me();
2026
+ },
2027
+ stop: function() {
2028
+ this._call && (this._call = null, this._time = 1 / 0, me());
2029
+ }
2030
+ };
2031
+ function Ae(t, e, n) {
2032
+ var r = new jt();
2033
+ return r.restart(t, e, n), r;
2034
+ }
2035
+ function wa() {
2036
+ ke(), ++wt;
2037
+ for (var t = Qt, e; t; )
2038
+ (e = mt - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
2039
+ --wt;
2040
+ }
2041
+ function nn() {
2042
+ mt = (Jt = Nt.now()) + ee, wt = bt = 0;
2043
+ try {
2044
+ wa();
2045
+ } finally {
2046
+ wt = 0, _a(), mt = 0;
2047
+ }
2048
+ }
2049
+ function xa() {
2050
+ var t = Nt.now(), e = t - Jt;
2051
+ e > Dn && (ee -= e, Jt = t);
2052
+ }
2053
+ function _a() {
2054
+ for (var t, e = Qt, n, r = 1 / 0; e; )
2055
+ e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : Qt = n);
2056
+ Ct = t, me(r);
2057
+ }
2058
+ function me(t) {
2059
+ if (!wt) {
2060
+ bt && (bt = clearTimeout(bt));
2061
+ var e = t - mt;
2062
+ e > 24 ? (t < 1 / 0 && (bt = setTimeout(nn, t - Nt.now() - ee)), xt && (xt = clearInterval(xt))) : (xt || (Jt = Nt.now(), xt = setInterval(xa, Dn)), wt = 1, Pn(nn));
2063
+ }
2064
+ }
2065
+ function rn(t, e, n) {
2066
+ var r = new jt();
2067
+ return e = e == null ? 0 : +e, r.restart((i) => {
2068
+ r.stop(), t(i + e);
2069
+ }, e, n), r;
2070
+ }
2071
+ const ba = 1664525, Ca = 1013904223, on = 4294967296;
2072
+ function Ma() {
2073
+ let t = 1;
2074
+ return () => (t = (ba * t + Ca) % on) / on;
2075
+ }
2076
+ function Ea(t) {
2077
+ return t.x;
2078
+ }
2079
+ function Na(t) {
2080
+ return t.y;
2081
+ }
2082
+ var ka = 10, Aa = Math.PI * (3 - Math.sqrt(5));
2083
+ function Sa(t) {
2084
+ var e, n = 1, r = 1e-3, i = 1 - Math.pow(r, 1 / 300), o = 0, a = 0.6, s = /* @__PURE__ */ new Map(), c = Ae(h), u = $t("tick", "end"), l = Ma();
2085
+ t == null && (t = []);
2086
+ function h() {
2087
+ f(), u.call("tick", e), n < r && (c.stop(), u.call("end", e));
2088
+ }
2089
+ function f(y) {
2090
+ var v, g = t.length, b;
2091
+ y === void 0 && (y = 1);
2092
+ for (var N = 0; N < y; ++N)
2093
+ for (n += (o - n) * i, s.forEach(function(p) {
2094
+ p(n);
2095
+ }), v = 0; v < g; ++v)
2096
+ b = t[v], b.fx == null ? b.x += b.vx *= a : (b.x = b.fx, b.vx = 0), b.fy == null ? b.y += b.vy *= a : (b.y = b.fy, b.vy = 0);
2097
+ return e;
2098
+ }
2099
+ function d() {
2100
+ for (var y = 0, v = t.length, g; y < v; ++y) {
2101
+ if (g = t[y], g.index = y, g.fx != null && (g.x = g.fx), g.fy != null && (g.y = g.fy), isNaN(g.x) || isNaN(g.y)) {
2102
+ var b = ka * Math.sqrt(0.5 + y), N = y * Aa;
2103
+ g.x = b * Math.cos(N), g.y = b * Math.sin(N);
2104
+ }
2105
+ (isNaN(g.vx) || isNaN(g.vy)) && (g.vx = g.vy = 0);
2106
+ }
2107
+ }
2108
+ function x(y) {
2109
+ return y.initialize && y.initialize(t, l), y;
2110
+ }
2111
+ return d(), e = {
2112
+ tick: f,
2113
+ restart: function() {
2114
+ return c.restart(h), e;
2115
+ },
2116
+ stop: function() {
2117
+ return c.stop(), e;
2118
+ },
2119
+ nodes: function(y) {
2120
+ return arguments.length ? (t = y, d(), s.forEach(x), e) : t;
2121
+ },
2122
+ alpha: function(y) {
2123
+ return arguments.length ? (n = +y, e) : n;
2124
+ },
2125
+ alphaMin: function(y) {
2126
+ return arguments.length ? (r = +y, e) : r;
2127
+ },
2128
+ alphaDecay: function(y) {
2129
+ return arguments.length ? (i = +y, e) : +i;
2130
+ },
2131
+ alphaTarget: function(y) {
2132
+ return arguments.length ? (o = +y, e) : o;
2133
+ },
2134
+ velocityDecay: function(y) {
2135
+ return arguments.length ? (a = 1 - y, e) : 1 - a;
2136
+ },
2137
+ randomSource: function(y) {
2138
+ return arguments.length ? (l = y, s.forEach(x), e) : l;
2139
+ },
2140
+ force: function(y, v) {
2141
+ return arguments.length > 1 ? (v == null ? s.delete(y) : s.set(y, x(v)), e) : s.get(y);
2142
+ },
2143
+ find: function(y, v, g) {
2144
+ var b = 0, N = t.length, p, _, A, I, S;
2145
+ for (g == null ? g = 1 / 0 : g *= g, b = 0; b < N; ++b)
2146
+ I = t[b], p = y - I.x, _ = v - I.y, A = p * p + _ * _, A < g && (S = I, g = A);
2147
+ return S;
2148
+ },
2149
+ on: function(y, v) {
2150
+ return arguments.length > 1 ? (u.on(y, v), e) : u.on(y);
2151
+ }
2152
+ };
2153
+ }
2154
+ function $a() {
2155
+ var t, e, n, r, i = ht(-30), o, a = 1, s = 1 / 0, c = 0.81;
2156
+ function u(d) {
2157
+ var x, y = t.length, v = Ee(t, Ea, Na).visitAfter(h);
2158
+ for (r = d, x = 0; x < y; ++x) e = t[x], v.visit(f);
2159
+ }
2160
+ function l() {
2161
+ if (t) {
2162
+ var d, x = t.length, y;
2163
+ for (o = new Array(x), d = 0; d < x; ++d) y = t[d], o[y.index] = +i(y, d, t);
2164
+ }
2165
+ }
2166
+ function h(d) {
2167
+ var x = 0, y, v, g = 0, b, N, p;
2168
+ if (d.length) {
2169
+ for (b = N = p = 0; p < 4; ++p)
2170
+ (y = d[p]) && (v = Math.abs(y.value)) && (x += y.value, g += v, b += v * y.x, N += v * y.y);
2171
+ d.x = b / g, d.y = N / g;
2172
+ } else {
2173
+ y = d, y.x = y.data.x, y.y = y.data.y;
2174
+ do
2175
+ x += o[y.data.index];
2176
+ while (y = y.next);
2177
+ }
2178
+ d.value = x;
2179
+ }
2180
+ function f(d, x, y, v) {
2181
+ if (!d.value) return !0;
2182
+ var g = d.x - e.x, b = d.y - e.y, N = v - x, p = g * g + b * b;
2183
+ if (N * N / c < p)
2184
+ return p < s && (g === 0 && (g = ut(n), p += g * g), b === 0 && (b = ut(n), p += b * b), p < a && (p = Math.sqrt(a * p)), e.vx += g * d.value * r / p, e.vy += b * d.value * r / p), !0;
2185
+ if (d.length || p >= s) return;
2186
+ (d.data !== e || d.next) && (g === 0 && (g = ut(n), p += g * g), b === 0 && (b = ut(n), p += b * b), p < a && (p = Math.sqrt(a * p)));
2187
+ do
2188
+ d.data !== e && (N = o[d.data.index] * r / p, e.vx += g * N, e.vy += b * N);
2189
+ while (d = d.next);
2190
+ }
2191
+ return u.initialize = function(d, x) {
2192
+ t = d, n = x, l();
2193
+ }, u.strength = function(d) {
2194
+ return arguments.length ? (i = typeof d == "function" ? d : ht(+d), l(), u) : i;
2195
+ }, u.distanceMin = function(d) {
2196
+ return arguments.length ? (a = d * d, u) : Math.sqrt(a);
2197
+ }, u.distanceMax = function(d) {
2198
+ return arguments.length ? (s = d * d, u) : Math.sqrt(s);
2199
+ }, u.theta = function(d) {
2200
+ return arguments.length ? (c = d * d, u) : Math.sqrt(c);
2201
+ }, u;
2202
+ }
2203
+ const Ta = 100, Ia = -200, La = 20;
2204
+ function za(t, e, n, r) {
2205
+ return Sa(t).force(
2206
+ "link",
2207
+ ma(e).id((i) => i.id).distance(Ta)
2208
+ ).force("charge", $a().strength(Ia)).force("center", Uo(n / 2, r / 2)).force("collide", ha().radius(La));
2209
+ }
2210
+ function Ra(t, e, n, r) {
2211
+ const i = t.selectAll(".mv-node").data(e).join("g").attr("class", "mv-node");
2212
+ return i.append("circle").attr("r", (o) => r(o.metrics.loc)).attr("fill", (o) => n(o.kind)), i.append("text").text((o) => o.name).attr("dx", 0).attr("dy", (o) => r(o.metrics.loc) + 12), i;
2213
+ }
2214
+ function Da(t, e, n, r) {
2215
+ return t.selectAll(".mv-link").data(e).join("line").attr("class", "mv-link").attr("stroke", (i) => n(i.kind)).attr("stroke-width", (i) => r(i.weight));
2216
+ }
2217
+ const Pa = { passive: !1 }, kt = { capture: !0, passive: !1 };
2218
+ function ae(t) {
2219
+ t.stopImmediatePropagation();
2220
+ }
2221
+ function pt(t) {
2222
+ t.preventDefault(), t.stopImmediatePropagation();
2223
+ }
2224
+ function Fn(t) {
2225
+ var e = t.document.documentElement, n = j(t).on("dragstart.drag", pt, kt);
2226
+ "onselectstart" in e ? n.on("selectstart.drag", pt, kt) : (e.__noselect = e.style.MozUserSelect, e.style.MozUserSelect = "none");
2227
+ }
2228
+ function Hn(t, e) {
2229
+ var n = t.document.documentElement, r = j(t).on("dragstart.drag", null);
2230
+ e && (r.on("click.drag", pt, kt), setTimeout(function() {
2231
+ r.on("click.drag", null);
2232
+ }, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
2233
+ }
2234
+ const Rt = (t) => () => t;
2235
+ function ge(t, {
2236
+ sourceEvent: e,
2237
+ subject: n,
2238
+ target: r,
2239
+ identifier: i,
2240
+ active: o,
2241
+ x: a,
2242
+ y: s,
2243
+ dx: c,
2244
+ dy: u,
2245
+ dispatch: l
2246
+ }) {
2247
+ Object.defineProperties(this, {
2248
+ type: { value: t, enumerable: !0, configurable: !0 },
2249
+ sourceEvent: { value: e, enumerable: !0, configurable: !0 },
2250
+ subject: { value: n, enumerable: !0, configurable: !0 },
2251
+ target: { value: r, enumerable: !0, configurable: !0 },
2252
+ identifier: { value: i, enumerable: !0, configurable: !0 },
2253
+ active: { value: o, enumerable: !0, configurable: !0 },
2254
+ x: { value: a, enumerable: !0, configurable: !0 },
2255
+ y: { value: s, enumerable: !0, configurable: !0 },
2256
+ dx: { value: c, enumerable: !0, configurable: !0 },
2257
+ dy: { value: u, enumerable: !0, configurable: !0 },
2258
+ _: { value: l }
2259
+ });
2260
+ }
2261
+ ge.prototype.on = function() {
2262
+ var t = this._.on.apply(this._, arguments);
2263
+ return t === this._ ? this : t;
2264
+ };
2265
+ function Fa(t) {
2266
+ return !t.ctrlKey && !t.button;
2267
+ }
2268
+ function Ha() {
2269
+ return this.parentNode;
2270
+ }
2271
+ function Oa(t, e) {
2272
+ return e ?? { x: t.x, y: t.y };
2273
+ }
2274
+ function Ba() {
2275
+ return navigator.maxTouchPoints || "ontouchstart" in this;
2276
+ }
2277
+ function Xa() {
2278
+ var t = Fa, e = Ha, n = Oa, r = Ba, i = {}, o = $t("start", "drag", "end"), a = 0, s, c, u, l, h = 0;
2279
+ function f(p) {
2280
+ p.on("mousedown.drag", d).filter(r).on("touchstart.drag", v).on("touchmove.drag", g, Pa).on("touchend.drag touchcancel.drag", b).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
2281
+ }
2282
+ function d(p, _) {
2283
+ if (!(l || !t.call(this, p, _))) {
2284
+ var A = N(this, e.call(this, p, _), p, _, "mouse");
2285
+ A && (j(p.view).on("mousemove.drag", x, kt).on("mouseup.drag", y, kt), Fn(p.view), ae(p), u = !1, s = p.clientX, c = p.clientY, A("start", p));
2286
+ }
2287
+ }
2288
+ function x(p) {
2289
+ if (pt(p), !u) {
2290
+ var _ = p.clientX - s, A = p.clientY - c;
2291
+ u = _ * _ + A * A > h;
2292
+ }
2293
+ i.mouse("drag", p);
2294
+ }
2295
+ function y(p) {
2296
+ j(p.view).on("mousemove.drag mouseup.drag", null), Hn(p.view, u), pt(p), i.mouse("end", p);
2297
+ }
2298
+ function v(p, _) {
2299
+ if (t.call(this, p, _)) {
2300
+ var A = p.changedTouches, I = e.call(this, p, _), S = A.length, L, z;
2301
+ for (L = 0; L < S; ++L)
2302
+ (z = N(this, I, p, _, A[L].identifier, A[L])) && (ae(p), z("start", p, A[L]));
2303
+ }
2304
+ }
2305
+ function g(p) {
2306
+ var _ = p.changedTouches, A = _.length, I, S;
2307
+ for (I = 0; I < A; ++I)
2308
+ (S = i[_[I].identifier]) && (pt(p), S("drag", p, _[I]));
2309
+ }
2310
+ function b(p) {
2311
+ var _ = p.changedTouches, A = _.length, I, S;
2312
+ for (l && clearTimeout(l), l = setTimeout(function() {
2313
+ l = null;
2314
+ }, 500), I = 0; I < A; ++I)
2315
+ (S = i[_[I].identifier]) && (ae(p), S("end", p, _[I]));
2316
+ }
2317
+ function N(p, _, A, I, S, L) {
2318
+ var z = o.copy(), R = it(L || A, _), $, P, m;
2319
+ if ((m = n.call(p, new ge("beforestart", {
2320
+ sourceEvent: A,
2321
+ target: f,
2322
+ identifier: S,
2323
+ active: a,
2324
+ x: R[0],
2325
+ y: R[1],
2326
+ dx: 0,
2327
+ dy: 0,
2328
+ dispatch: z
2329
+ }), I)) != null)
2330
+ return $ = m.x - R[0] || 0, P = m.y - R[1] || 0, function C(w, E, T) {
2331
+ var M = R, k;
2332
+ switch (w) {
2333
+ case "start":
2334
+ i[S] = C, k = a++;
2335
+ break;
2336
+ case "end":
2337
+ delete i[S], --a;
2338
+ // falls through
2339
+ case "drag":
2340
+ R = it(T || E, _), k = a;
2341
+ break;
2342
+ }
2343
+ z.call(
2344
+ w,
2345
+ p,
2346
+ new ge(w, {
2347
+ sourceEvent: E,
2348
+ subject: m,
2349
+ target: f,
2350
+ identifier: S,
2351
+ active: k,
2352
+ x: R[0] + $,
2353
+ y: R[1] + P,
2354
+ dx: R[0] - M[0],
2355
+ dy: R[1] - M[1],
2356
+ dispatch: z
2357
+ }),
2358
+ I
2359
+ );
2360
+ };
2361
+ }
2362
+ return f.filter = function(p) {
2363
+ return arguments.length ? (t = typeof p == "function" ? p : Rt(!!p), f) : t;
2364
+ }, f.container = function(p) {
2365
+ return arguments.length ? (e = typeof p == "function" ? p : Rt(p), f) : e;
2366
+ }, f.subject = function(p) {
2367
+ return arguments.length ? (n = typeof p == "function" ? p : Rt(p), f) : n;
2368
+ }, f.touchable = function(p) {
2369
+ return arguments.length ? (r = typeof p == "function" ? p : Rt(!!p), f) : r;
2370
+ }, f.on = function() {
2371
+ var p = o.on.apply(o, arguments);
2372
+ return p === o ? f : p;
2373
+ }, f.clickDistance = function(p) {
2374
+ return arguments.length ? (h = (p = +p) * p, f) : Math.sqrt(h);
2375
+ }, f;
2376
+ }
2377
+ var qa = $t("start", "end", "cancel", "interrupt"), Va = [], On = 0, an = 1, pe = 2, Ot = 3, sn = 4, ye = 5, Bt = 6;
2378
+ function ne(t, e, n, r, i, o) {
2379
+ var a = t.__transition;
2380
+ if (!a) t.__transition = {};
2381
+ else if (n in a) return;
2382
+ Ya(t, n, {
2383
+ name: e,
2384
+ index: r,
2385
+ // For context during callback.
2386
+ group: i,
2387
+ // For context during callback.
2388
+ on: qa,
2389
+ tween: Va,
2390
+ time: o.time,
2391
+ delay: o.delay,
2392
+ duration: o.duration,
2393
+ ease: o.ease,
2394
+ timer: null,
2395
+ state: On
2396
+ });
2397
+ }
2398
+ function Se(t, e) {
2399
+ var n = J(t, e);
2400
+ if (n.state > On) throw new Error("too late; already scheduled");
2401
+ return n;
2402
+ }
2403
+ function et(t, e) {
2404
+ var n = J(t, e);
2405
+ if (n.state > Ot) throw new Error("too late; already running");
2406
+ return n;
2407
+ }
2408
+ function J(t, e) {
2409
+ var n = t.__transition;
2410
+ if (!n || !(n = n[e])) throw new Error("transition not found");
2411
+ return n;
2412
+ }
2413
+ function Ya(t, e, n) {
2414
+ var r = t.__transition, i;
2415
+ r[e] = n, n.timer = Ae(o, 0, n.time);
2416
+ function o(u) {
2417
+ n.state = an, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay);
2418
+ }
2419
+ function a(u) {
2420
+ var l, h, f, d;
2421
+ if (n.state !== an) return c();
2422
+ for (l in r)
2423
+ if (d = r[l], d.name === n.name) {
2424
+ if (d.state === Ot) return rn(a);
2425
+ d.state === sn ? (d.state = Bt, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[l]) : +l < e && (d.state = Bt, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[l]);
2426
+ }
2427
+ if (rn(function() {
2428
+ n.state === Ot && (n.state = sn, n.timer.restart(s, n.delay, n.time), s(u));
2429
+ }), n.state = pe, n.on.call("start", t, t.__data__, n.index, n.group), n.state === pe) {
2430
+ for (n.state = Ot, i = new Array(f = n.tween.length), l = 0, h = -1; l < f; ++l)
2431
+ (d = n.tween[l].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d);
2432
+ i.length = h + 1;
2433
+ }
2434
+ }
2435
+ function s(u) {
2436
+ for (var l = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(c), n.state = ye, 1), h = -1, f = i.length; ++h < f; )
2437
+ i[h].call(t, l);
2438
+ n.state === ye && (n.on.call("end", t, t.__data__, n.index, n.group), c());
2439
+ }
2440
+ function c() {
2441
+ n.state = Bt, n.timer.stop(), delete r[e];
2442
+ for (var u in r) return;
2443
+ delete t.__transition;
2444
+ }
2445
+ }
2446
+ function Xt(t, e) {
2447
+ var n = t.__transition, r, i, o = !0, a;
2448
+ if (n) {
2449
+ e = e == null ? null : e + "";
2450
+ for (a in n) {
2451
+ if ((r = n[a]).name !== e) {
2452
+ o = !1;
2453
+ continue;
2454
+ }
2455
+ i = r.state > pe && r.state < ye, r.state = Bt, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a];
2456
+ }
2457
+ o && delete t.__transition;
2458
+ }
2459
+ }
2460
+ function Ga(t) {
2461
+ return this.each(function() {
2462
+ Xt(this, t);
2463
+ });
2464
+ }
2465
+ function Ua(t, e) {
2466
+ var n, r;
2467
+ return function() {
2468
+ var i = et(this, t), o = i.tween;
2469
+ if (o !== n) {
2470
+ r = n = o;
2471
+ for (var a = 0, s = r.length; a < s; ++a)
2472
+ if (r[a].name === e) {
2473
+ r = r.slice(), r.splice(a, 1);
2474
+ break;
2475
+ }
2476
+ }
2477
+ i.tween = r;
2478
+ };
2479
+ }
2480
+ function Ka(t, e, n) {
2481
+ var r, i;
2482
+ if (typeof n != "function") throw new Error();
2483
+ return function() {
2484
+ var o = et(this, t), a = o.tween;
2485
+ if (a !== r) {
2486
+ i = (r = a).slice();
2487
+ for (var s = { name: e, value: n }, c = 0, u = i.length; c < u; ++c)
2488
+ if (i[c].name === e) {
2489
+ i[c] = s;
2490
+ break;
2491
+ }
2492
+ c === u && i.push(s);
2493
+ }
2494
+ o.tween = i;
2495
+ };
2496
+ }
2497
+ function Wa(t, e) {
2498
+ var n = this._id;
2499
+ if (t += "", arguments.length < 2) {
2500
+ for (var r = J(this.node(), n).tween, i = 0, o = r.length, a; i < o; ++i)
2501
+ if ((a = r[i]).name === t)
2502
+ return a.value;
2503
+ return null;
2504
+ }
2505
+ return this.each((e == null ? Ua : Ka)(n, t, e));
2506
+ }
2507
+ function $e(t, e, n) {
2508
+ var r = t._id;
2509
+ return t.each(function() {
2510
+ var i = et(this, r);
2511
+ (i.value || (i.value = {}))[e] = n.apply(this, arguments);
2512
+ }), function(i) {
2513
+ return J(i, r).value[e];
2514
+ };
2515
+ }
2516
+ function Bn(t, e) {
2517
+ var n;
2518
+ return (typeof e == "number" ? Z : e instanceof dt ? Ut : (n = dt(e)) ? (e = n, Ut) : kn)(t, e);
2519
+ }
2520
+ function Za(t) {
2521
+ return function() {
2522
+ this.removeAttribute(t);
2523
+ };
2524
+ }
2525
+ function Qa(t) {
2526
+ return function() {
2527
+ this.removeAttributeNS(t.space, t.local);
2528
+ };
2529
+ }
2530
+ function Ja(t, e, n) {
2531
+ var r, i = n + "", o;
2532
+ return function() {
2533
+ var a = this.getAttribute(t);
2534
+ return a === i ? null : a === r ? o : o = e(r = a, n);
2535
+ };
2536
+ }
2537
+ function ja(t, e, n) {
2538
+ var r, i = n + "", o;
2539
+ return function() {
2540
+ var a = this.getAttributeNS(t.space, t.local);
2541
+ return a === i ? null : a === r ? o : o = e(r = a, n);
2542
+ };
2543
+ }
2544
+ function ts(t, e, n) {
2545
+ var r, i, o;
2546
+ return function() {
2547
+ var a, s = n(this), c;
2548
+ return s == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), c = s + "", a === c ? null : a === r && c === i ? o : (i = c, o = e(r = a, s)));
2549
+ };
2550
+ }
2551
+ function es(t, e, n) {
2552
+ var r, i, o;
2553
+ return function() {
2554
+ var a, s = n(this), c;
2555
+ return s == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), c = s + "", a === c ? null : a === r && c === i ? o : (i = c, o = e(r = a, s)));
2556
+ };
2557
+ }
2558
+ function ns(t, e) {
2559
+ var n = te(t), r = n === "transform" ? co : Bn;
2560
+ return this.attrTween(t, typeof e == "function" ? (n.local ? es : ts)(n, r, $e(this, "attr." + t, e)) : e == null ? (n.local ? Qa : Za)(n) : (n.local ? ja : Ja)(n, r, e));
2561
+ }
2562
+ function rs(t, e) {
2563
+ return function(n) {
2564
+ this.setAttribute(t, e.call(this, n));
2565
+ };
2566
+ }
2567
+ function is(t, e) {
2568
+ return function(n) {
2569
+ this.setAttributeNS(t.space, t.local, e.call(this, n));
2570
+ };
2571
+ }
2572
+ function os(t, e) {
2573
+ var n, r;
2574
+ function i() {
2575
+ var o = e.apply(this, arguments);
2576
+ return o !== r && (n = (r = o) && is(t, o)), n;
2577
+ }
2578
+ return i._value = e, i;
2579
+ }
2580
+ function as(t, e) {
2581
+ var n, r;
2582
+ function i() {
2583
+ var o = e.apply(this, arguments);
2584
+ return o !== r && (n = (r = o) && rs(t, o)), n;
2585
+ }
2586
+ return i._value = e, i;
2587
+ }
2588
+ function ss(t, e) {
2589
+ var n = "attr." + t;
2590
+ if (arguments.length < 2) return (n = this.tween(n)) && n._value;
2591
+ if (e == null) return this.tween(n, null);
2592
+ if (typeof e != "function") throw new Error();
2593
+ var r = te(t);
2594
+ return this.tween(n, (r.local ? os : as)(r, e));
2595
+ }
2596
+ function us(t, e) {
2597
+ return function() {
2598
+ Se(this, t).delay = +e.apply(this, arguments);
2599
+ };
2600
+ }
2601
+ function cs(t, e) {
2602
+ return e = +e, function() {
2603
+ Se(this, t).delay = e;
2604
+ };
2605
+ }
2606
+ function ls(t) {
2607
+ var e = this._id;
2608
+ return arguments.length ? this.each((typeof t == "function" ? us : cs)(e, t)) : J(this.node(), e).delay;
2609
+ }
2610
+ function fs(t, e) {
2611
+ return function() {
2612
+ et(this, t).duration = +e.apply(this, arguments);
2613
+ };
2614
+ }
2615
+ function hs(t, e) {
2616
+ return e = +e, function() {
2617
+ et(this, t).duration = e;
2618
+ };
2619
+ }
2620
+ function ds(t) {
2621
+ var e = this._id;
2622
+ return arguments.length ? this.each((typeof t == "function" ? fs : hs)(e, t)) : J(this.node(), e).duration;
2623
+ }
2624
+ function ms(t, e) {
2625
+ if (typeof e != "function") throw new Error();
2626
+ return function() {
2627
+ et(this, t).ease = e;
2628
+ };
2629
+ }
2630
+ function gs(t) {
2631
+ var e = this._id;
2632
+ return arguments.length ? this.each(ms(e, t)) : J(this.node(), e).ease;
2633
+ }
2634
+ function ps(t, e) {
2635
+ return function() {
2636
+ var n = e.apply(this, arguments);
2637
+ if (typeof n != "function") throw new Error();
2638
+ et(this, t).ease = n;
2639
+ };
2640
+ }
2641
+ function ys(t) {
2642
+ if (typeof t != "function") throw new Error();
2643
+ return this.each(ps(this._id, t));
2644
+ }
2645
+ function vs(t) {
2646
+ typeof t != "function" && (t = hn(t));
2647
+ for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i)
2648
+ for (var o = e[i], a = o.length, s = r[i] = [], c, u = 0; u < a; ++u)
2649
+ (c = o[u]) && t.call(c, c.__data__, u, o) && s.push(c);
2650
+ return new at(r, this._parents, this._name, this._id);
2651
+ }
2652
+ function ws(t) {
2653
+ if (t._id !== this._id) throw new Error();
2654
+ for (var e = this._groups, n = t._groups, r = e.length, i = n.length, o = Math.min(r, i), a = new Array(r), s = 0; s < o; ++s)
2655
+ for (var c = e[s], u = n[s], l = c.length, h = a[s] = new Array(l), f, d = 0; d < l; ++d)
2656
+ (f = c[d] || u[d]) && (h[d] = f);
2657
+ for (; s < r; ++s)
2658
+ a[s] = e[s];
2659
+ return new at(a, this._parents, this._name, this._id);
2660
+ }
2661
+ function xs(t) {
2662
+ return (t + "").trim().split(/^|\s+/).every(function(e) {
2663
+ var n = e.indexOf(".");
2664
+ return n >= 0 && (e = e.slice(0, n)), !e || e === "start";
2665
+ });
2666
+ }
2667
+ function _s(t, e, n) {
2668
+ var r, i, o = xs(e) ? Se : et;
2669
+ return function() {
2670
+ var a = o(this, t), s = a.on;
2671
+ s !== r && (i = (r = s).copy()).on(e, n), a.on = i;
2672
+ };
2673
+ }
2674
+ function bs(t, e) {
2675
+ var n = this._id;
2676
+ return arguments.length < 2 ? J(this.node(), n).on.on(t) : this.each(_s(n, t, e));
2677
+ }
2678
+ function Cs(t) {
2679
+ return function() {
2680
+ var e = this.parentNode;
2681
+ for (var n in this.__transition) if (+n !== t) return;
2682
+ e && e.removeChild(this);
2683
+ };
2684
+ }
2685
+ function Ms() {
2686
+ return this.on("end.remove", Cs(this._id));
2687
+ }
2688
+ function Es(t) {
2689
+ var e = this._name, n = this._id;
2690
+ typeof t != "function" && (t = ve(t));
2691
+ for (var r = this._groups, i = r.length, o = new Array(i), a = 0; a < i; ++a)
2692
+ for (var s = r[a], c = s.length, u = o[a] = new Array(c), l, h, f = 0; f < c; ++f)
2693
+ (l = s[f]) && (h = t.call(l, l.__data__, f, s)) && ("__data__" in l && (h.__data__ = l.__data__), u[f] = h, ne(u[f], e, n, f, u, J(l, n)));
2694
+ return new at(o, this._parents, e, n);
2695
+ }
2696
+ function Ns(t) {
2697
+ var e = this._name, n = this._id;
2698
+ typeof t != "function" && (t = fn(t));
2699
+ for (var r = this._groups, i = r.length, o = [], a = [], s = 0; s < i; ++s)
2700
+ for (var c = r[s], u = c.length, l, h = 0; h < u; ++h)
2701
+ if (l = c[h]) {
2702
+ for (var f = t.call(l, l.__data__, h, c), d, x = J(l, n), y = 0, v = f.length; y < v; ++y)
2703
+ (d = f[y]) && ne(d, e, n, y, f, x);
2704
+ o.push(f), a.push(l);
2705
+ }
2706
+ return new at(o, a, e, n);
2707
+ }
2708
+ var ks = At.prototype.constructor;
2709
+ function As() {
2710
+ return new ks(this._groups, this._parents);
2711
+ }
2712
+ function Ss(t, e) {
2713
+ var n, r, i;
2714
+ return function() {
2715
+ var o = yt(this, t), a = (this.style.removeProperty(t), yt(this, t));
2716
+ return o === a ? null : o === n && a === r ? i : i = e(n = o, r = a);
2717
+ };
2718
+ }
2719
+ function Xn(t) {
2720
+ return function() {
2721
+ this.style.removeProperty(t);
2722
+ };
2723
+ }
2724
+ function $s(t, e, n) {
2725
+ var r, i = n + "", o;
2726
+ return function() {
2727
+ var a = yt(this, t);
2728
+ return a === i ? null : a === r ? o : o = e(r = a, n);
2729
+ };
2730
+ }
2731
+ function Ts(t, e, n) {
2732
+ var r, i, o;
2733
+ return function() {
2734
+ var a = yt(this, t), s = n(this), c = s + "";
2735
+ return s == null && (c = s = (this.style.removeProperty(t), yt(this, t))), a === c ? null : a === r && c === i ? o : (i = c, o = e(r = a, s));
2736
+ };
2737
+ }
2738
+ function Is(t, e) {
2739
+ var n, r, i, o = "style." + e, a = "end." + o, s;
2740
+ return function() {
2741
+ var c = et(this, t), u = c.on, l = c.value[o] == null ? s || (s = Xn(e)) : void 0;
2742
+ (u !== n || i !== l) && (r = (n = u).copy()).on(a, i = l), c.on = r;
2743
+ };
2744
+ }
2745
+ function Ls(t, e, n) {
2746
+ var r = (t += "") == "transform" ? uo : Bn;
2747
+ return e == null ? this.styleTween(t, Ss(t, r)).on("end.style." + t, Xn(t)) : typeof e == "function" ? this.styleTween(t, Ts(t, r, $e(this, "style." + t, e))).each(Is(this._id, t)) : this.styleTween(t, $s(t, r, e), n).on("end.style." + t, null);
2748
+ }
2749
+ function zs(t, e, n) {
2750
+ return function(r) {
2751
+ this.style.setProperty(t, e.call(this, r), n);
2752
+ };
2753
+ }
2754
+ function Rs(t, e, n) {
2755
+ var r, i;
2756
+ function o() {
2757
+ var a = e.apply(this, arguments);
2758
+ return a !== i && (r = (i = a) && zs(t, a, n)), r;
2759
+ }
2760
+ return o._value = e, o;
2761
+ }
2762
+ function Ds(t, e, n) {
2763
+ var r = "style." + (t += "");
2764
+ if (arguments.length < 2) return (r = this.tween(r)) && r._value;
2765
+ if (e == null) return this.tween(r, null);
2766
+ if (typeof e != "function") throw new Error();
2767
+ return this.tween(r, Rs(t, e, n ?? ""));
2768
+ }
2769
+ function Ps(t) {
2770
+ return function() {
2771
+ this.textContent = t;
2772
+ };
2773
+ }
2774
+ function Fs(t) {
2775
+ return function() {
2776
+ var e = t(this);
2777
+ this.textContent = e ?? "";
2778
+ };
2779
+ }
2780
+ function Hs(t) {
2781
+ return this.tween("text", typeof t == "function" ? Fs($e(this, "text", t)) : Ps(t == null ? "" : t + ""));
2782
+ }
2783
+ function Os(t) {
2784
+ return function(e) {
2785
+ this.textContent = t.call(this, e);
2786
+ };
2787
+ }
2788
+ function Bs(t) {
2789
+ var e, n;
2790
+ function r() {
2791
+ var i = t.apply(this, arguments);
2792
+ return i !== n && (e = (n = i) && Os(i)), e;
2793
+ }
2794
+ return r._value = t, r;
2795
+ }
2796
+ function Xs(t) {
2797
+ var e = "text";
2798
+ if (arguments.length < 1) return (e = this.tween(e)) && e._value;
2799
+ if (t == null) return this.tween(e, null);
2800
+ if (typeof t != "function") throw new Error();
2801
+ return this.tween(e, Bs(t));
2802
+ }
2803
+ function qs() {
2804
+ for (var t = this._name, e = this._id, n = qn(), r = this._groups, i = r.length, o = 0; o < i; ++o)
2805
+ for (var a = r[o], s = a.length, c, u = 0; u < s; ++u)
2806
+ if (c = a[u]) {
2807
+ var l = J(c, e);
2808
+ ne(c, t, n, u, a, {
2809
+ time: l.time + l.delay + l.duration,
2810
+ delay: 0,
2811
+ duration: l.duration,
2812
+ ease: l.ease
2813
+ });
2814
+ }
2815
+ return new at(r, this._parents, t, n);
2816
+ }
2817
+ function Vs() {
2818
+ var t, e, n = this, r = n._id, i = n.size();
2819
+ return new Promise(function(o, a) {
2820
+ var s = { value: a }, c = { value: function() {
2821
+ --i === 0 && o();
2822
+ } };
2823
+ n.each(function() {
2824
+ var u = et(this, r), l = u.on;
2825
+ l !== t && (e = (t = l).copy(), e._.cancel.push(s), e._.interrupt.push(s), e._.end.push(c)), u.on = e;
2826
+ }), i === 0 && o();
2827
+ });
2828
+ }
2829
+ var Ys = 0;
2830
+ function at(t, e, n, r) {
2831
+ this._groups = t, this._parents = e, this._name = n, this._id = r;
2832
+ }
2833
+ function qn() {
2834
+ return ++Ys;
2835
+ }
2836
+ var rt = At.prototype;
2837
+ at.prototype = {
2838
+ constructor: at,
2839
+ select: Es,
2840
+ selectAll: Ns,
2841
+ selectChild: rt.selectChild,
2842
+ selectChildren: rt.selectChildren,
2843
+ filter: vs,
2844
+ merge: ws,
2845
+ selection: As,
2846
+ transition: qs,
2847
+ call: rt.call,
2848
+ nodes: rt.nodes,
2849
+ node: rt.node,
2850
+ size: rt.size,
2851
+ empty: rt.empty,
2852
+ each: rt.each,
2853
+ on: bs,
2854
+ attr: ns,
2855
+ attrTween: ss,
2856
+ style: Ls,
2857
+ styleTween: Ds,
2858
+ text: Hs,
2859
+ textTween: Xs,
2860
+ remove: Ms,
2861
+ tween: Wa,
2862
+ delay: ls,
2863
+ duration: ds,
2864
+ ease: gs,
2865
+ easeVarying: ys,
2866
+ end: Vs,
2867
+ [Symbol.iterator]: rt[Symbol.iterator]
2868
+ };
2869
+ function Gs(t) {
2870
+ return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
2871
+ }
2872
+ var Us = {
2873
+ time: null,
2874
+ // Set on use.
2875
+ delay: 0,
2876
+ duration: 250,
2877
+ ease: Gs
2878
+ };
2879
+ function Ks(t, e) {
2880
+ for (var n; !(n = t.__transition) || !(n = n[e]); )
2881
+ if (!(t = t.parentNode))
2882
+ throw new Error(`transition ${e} not found`);
2883
+ return n;
2884
+ }
2885
+ function Ws(t) {
2886
+ var e, n;
2887
+ t instanceof at ? (e = t._id, t = t._name) : (e = qn(), (n = Us).time = ke(), t = t == null ? null : t + "");
2888
+ for (var r = this._groups, i = r.length, o = 0; o < i; ++o)
2889
+ for (var a = r[o], s = a.length, c, u = 0; u < s; ++u)
2890
+ (c = a[u]) && ne(c, t, e, u, a, n || Ks(c, e));
2891
+ return new at(r, this._parents, t, e);
2892
+ }
2893
+ At.prototype.interrupt = Ga;
2894
+ At.prototype.transition = Ws;
2895
+ const Dt = (t) => () => t;
2896
+ function Zs(t, {
2897
+ sourceEvent: e,
2898
+ target: n,
2899
+ transform: r,
2900
+ dispatch: i
2901
+ }) {
2902
+ Object.defineProperties(this, {
2903
+ type: { value: t, enumerable: !0, configurable: !0 },
2904
+ sourceEvent: { value: e, enumerable: !0, configurable: !0 },
2905
+ target: { value: n, enumerable: !0, configurable: !0 },
2906
+ transform: { value: r, enumerable: !0, configurable: !0 },
2907
+ _: { value: i }
2908
+ });
2909
+ }
2910
+ function ot(t, e, n) {
2911
+ this.k = t, this.x = e, this.y = n;
2912
+ }
2913
+ ot.prototype = {
2914
+ constructor: ot,
2915
+ scale: function(t) {
2916
+ return t === 1 ? this : new ot(this.k * t, this.x, this.y);
2917
+ },
2918
+ translate: function(t, e) {
2919
+ return t === 0 & e === 0 ? this : new ot(this.k, this.x + this.k * t, this.y + this.k * e);
2920
+ },
2921
+ apply: function(t) {
2922
+ return [t[0] * this.k + this.x, t[1] * this.k + this.y];
2923
+ },
2924
+ applyX: function(t) {
2925
+ return t * this.k + this.x;
2926
+ },
2927
+ applyY: function(t) {
2928
+ return t * this.k + this.y;
2929
+ },
2930
+ invert: function(t) {
2931
+ return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k];
2932
+ },
2933
+ invertX: function(t) {
2934
+ return (t - this.x) / this.k;
2935
+ },
2936
+ invertY: function(t) {
2937
+ return (t - this.y) / this.k;
2938
+ },
2939
+ rescaleX: function(t) {
2940
+ return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t));
2941
+ },
2942
+ rescaleY: function(t) {
2943
+ return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t));
2944
+ },
2945
+ toString: function() {
2946
+ return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
2947
+ }
2948
+ };
2949
+ var Vn = new ot(1, 0, 0);
2950
+ ot.prototype;
2951
+ function se(t) {
2952
+ t.stopImmediatePropagation();
2953
+ }
2954
+ function _t(t) {
2955
+ t.preventDefault(), t.stopImmediatePropagation();
2956
+ }
2957
+ function Qs(t) {
2958
+ return (!t.ctrlKey || t.type === "wheel") && !t.button;
2959
+ }
2960
+ function Js() {
2961
+ var t = this;
2962
+ return t instanceof SVGElement ? (t = t.ownerSVGElement || t, t.hasAttribute("viewBox") ? (t = t.viewBox.baseVal, [[t.x, t.y], [t.x + t.width, t.y + t.height]]) : [[0, 0], [t.width.baseVal.value, t.height.baseVal.value]]) : [[0, 0], [t.clientWidth, t.clientHeight]];
2963
+ }
2964
+ function un() {
2965
+ return this.__zoom || Vn;
2966
+ }
2967
+ function js(t) {
2968
+ return -t.deltaY * (t.deltaMode === 1 ? 0.05 : t.deltaMode ? 1 : 2e-3) * (t.ctrlKey ? 10 : 1);
2969
+ }
2970
+ function tu() {
2971
+ return navigator.maxTouchPoints || "ontouchstart" in this;
2972
+ }
2973
+ function eu(t, e, n) {
2974
+ var r = t.invertX(e[0][0]) - n[0][0], i = t.invertX(e[1][0]) - n[1][0], o = t.invertY(e[0][1]) - n[0][1], a = t.invertY(e[1][1]) - n[1][1];
2975
+ return t.translate(
2976
+ i > r ? (r + i) / 2 : Math.min(0, r) || Math.max(0, i),
2977
+ a > o ? (o + a) / 2 : Math.min(0, o) || Math.max(0, a)
2978
+ );
2979
+ }
2980
+ function nu() {
2981
+ var t = Qs, e = Js, n = eu, r = js, i = tu, o = [0, 1 / 0], a = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], s = 250, c = mo, u = $t("start", "zoom", "end"), l, h, f, d = 500, x = 150, y = 0, v = 10;
2982
+ function g(m) {
2983
+ m.property("__zoom", un).on("wheel.zoom", S, { passive: !1 }).on("mousedown.zoom", L).on("dblclick.zoom", z).filter(i).on("touchstart.zoom", R).on("touchmove.zoom", $).on("touchend.zoom touchcancel.zoom", P).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
2984
+ }
2985
+ g.transform = function(m, C, w, E) {
2986
+ var T = m.selection ? m.selection() : m;
2987
+ T.property("__zoom", un), m !== T ? _(m, C, w, E) : T.interrupt().each(function() {
2988
+ A(this, arguments).event(E).start().zoom(null, typeof C == "function" ? C.apply(this, arguments) : C).end();
2989
+ });
2990
+ }, g.scaleBy = function(m, C, w, E) {
2991
+ g.scaleTo(m, function() {
2992
+ var T = this.__zoom.k, M = typeof C == "function" ? C.apply(this, arguments) : C;
2993
+ return T * M;
2994
+ }, w, E);
2995
+ }, g.scaleTo = function(m, C, w, E) {
2996
+ g.transform(m, function() {
2997
+ var T = e.apply(this, arguments), M = this.__zoom, k = w == null ? p(T) : typeof w == "function" ? w.apply(this, arguments) : w, D = M.invert(k), F = typeof C == "function" ? C.apply(this, arguments) : C;
2998
+ return n(N(b(M, F), k, D), T, a);
2999
+ }, w, E);
3000
+ }, g.translateBy = function(m, C, w, E) {
3001
+ g.transform(m, function() {
3002
+ return n(this.__zoom.translate(
3003
+ typeof C == "function" ? C.apply(this, arguments) : C,
3004
+ typeof w == "function" ? w.apply(this, arguments) : w
3005
+ ), e.apply(this, arguments), a);
3006
+ }, null, E);
3007
+ }, g.translateTo = function(m, C, w, E, T) {
3008
+ g.transform(m, function() {
3009
+ var M = e.apply(this, arguments), k = this.__zoom, D = E == null ? p(M) : typeof E == "function" ? E.apply(this, arguments) : E;
3010
+ return n(Vn.translate(D[0], D[1]).scale(k.k).translate(
3011
+ typeof C == "function" ? -C.apply(this, arguments) : -C,
3012
+ typeof w == "function" ? -w.apply(this, arguments) : -w
3013
+ ), M, a);
3014
+ }, E, T);
3015
+ };
3016
+ function b(m, C) {
3017
+ return C = Math.max(o[0], Math.min(o[1], C)), C === m.k ? m : new ot(C, m.x, m.y);
3018
+ }
3019
+ function N(m, C, w) {
3020
+ var E = C[0] - w[0] * m.k, T = C[1] - w[1] * m.k;
3021
+ return E === m.x && T === m.y ? m : new ot(m.k, E, T);
3022
+ }
3023
+ function p(m) {
3024
+ return [(+m[0][0] + +m[1][0]) / 2, (+m[0][1] + +m[1][1]) / 2];
3025
+ }
3026
+ function _(m, C, w, E) {
3027
+ m.on("start.zoom", function() {
3028
+ A(this, arguments).event(E).start();
3029
+ }).on("interrupt.zoom end.zoom", function() {
3030
+ A(this, arguments).event(E).end();
3031
+ }).tween("zoom", function() {
3032
+ var T = this, M = arguments, k = A(T, M).event(E), D = e.apply(T, M), F = w == null ? p(D) : typeof w == "function" ? w.apply(T, M) : w, X = Math.max(D[1][0] - D[0][0], D[1][1] - D[0][1]), H = T.__zoom, q = typeof C == "function" ? C.apply(T, M) : C, G = c(H.invert(F).concat(X / H.k), q.invert(F).concat(X / q.k));
3033
+ return function(W) {
3034
+ if (W === 1) W = q;
3035
+ else {
3036
+ var nt = G(W), re = X / nt[2];
3037
+ W = new ot(re, F[0] - nt[0] * re, F[1] - nt[1] * re);
3038
+ }
3039
+ k.zoom(null, W);
3040
+ };
3041
+ });
3042
+ }
3043
+ function A(m, C, w) {
3044
+ return !w && m.__zooming || new I(m, C);
3045
+ }
3046
+ function I(m, C) {
3047
+ this.that = m, this.args = C, this.active = 0, this.sourceEvent = null, this.extent = e.apply(m, C), this.taps = 0;
3048
+ }
3049
+ I.prototype = {
3050
+ event: function(m) {
3051
+ return m && (this.sourceEvent = m), this;
3052
+ },
3053
+ start: function() {
3054
+ return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
3055
+ },
3056
+ zoom: function(m, C) {
3057
+ return this.mouse && m !== "mouse" && (this.mouse[1] = C.invert(this.mouse[0])), this.touch0 && m !== "touch" && (this.touch0[1] = C.invert(this.touch0[0])), this.touch1 && m !== "touch" && (this.touch1[1] = C.invert(this.touch1[0])), this.that.__zoom = C, this.emit("zoom"), this;
3058
+ },
3059
+ end: function() {
3060
+ return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
3061
+ },
3062
+ emit: function(m) {
3063
+ var C = j(this.that).datum();
3064
+ u.call(
3065
+ m,
3066
+ this.that,
3067
+ new Zs(m, {
3068
+ sourceEvent: this.sourceEvent,
3069
+ target: g,
3070
+ transform: this.that.__zoom,
3071
+ dispatch: u
3072
+ }),
3073
+ C
3074
+ );
3075
+ }
3076
+ };
3077
+ function S(m, ...C) {
3078
+ if (!t.apply(this, arguments)) return;
3079
+ var w = A(this, C).event(m), E = this.__zoom, T = Math.max(o[0], Math.min(o[1], E.k * Math.pow(2, r.apply(this, arguments)))), M = it(m);
3080
+ if (w.wheel)
3081
+ (w.mouse[0][0] !== M[0] || w.mouse[0][1] !== M[1]) && (w.mouse[1] = E.invert(w.mouse[0] = M)), clearTimeout(w.wheel);
3082
+ else {
3083
+ if (E.k === T) return;
3084
+ w.mouse = [M, E.invert(M)], Xt(this), w.start();
3085
+ }
3086
+ _t(m), w.wheel = setTimeout(k, x), w.zoom("mouse", n(N(b(E, T), w.mouse[0], w.mouse[1]), w.extent, a));
3087
+ function k() {
3088
+ w.wheel = null, w.end();
3089
+ }
3090
+ }
3091
+ function L(m, ...C) {
3092
+ if (f || !t.apply(this, arguments)) return;
3093
+ var w = m.currentTarget, E = A(this, C, !0).event(m), T = j(m.view).on("mousemove.zoom", F, !0).on("mouseup.zoom", X, !0), M = it(m, w), k = m.clientX, D = m.clientY;
3094
+ Fn(m.view), se(m), E.mouse = [M, this.__zoom.invert(M)], Xt(this), E.start();
3095
+ function F(H) {
3096
+ if (_t(H), !E.moved) {
3097
+ var q = H.clientX - k, G = H.clientY - D;
3098
+ E.moved = q * q + G * G > y;
3099
+ }
3100
+ E.event(H).zoom("mouse", n(N(E.that.__zoom, E.mouse[0] = it(H, w), E.mouse[1]), E.extent, a));
3101
+ }
3102
+ function X(H) {
3103
+ T.on("mousemove.zoom mouseup.zoom", null), Hn(H.view, E.moved), _t(H), E.event(H).end();
3104
+ }
3105
+ }
3106
+ function z(m, ...C) {
3107
+ if (t.apply(this, arguments)) {
3108
+ var w = this.__zoom, E = it(m.changedTouches ? m.changedTouches[0] : m, this), T = w.invert(E), M = w.k * (m.shiftKey ? 0.5 : 2), k = n(N(b(w, M), E, T), e.apply(this, C), a);
3109
+ _t(m), s > 0 ? j(this).transition().duration(s).call(_, k, E, m) : j(this).call(g.transform, k, E, m);
3110
+ }
3111
+ }
3112
+ function R(m, ...C) {
3113
+ if (t.apply(this, arguments)) {
3114
+ var w = m.touches, E = w.length, T = A(this, C, m.changedTouches.length === E).event(m), M, k, D, F;
3115
+ for (se(m), k = 0; k < E; ++k)
3116
+ D = w[k], F = it(D, this), F = [F, this.__zoom.invert(F), D.identifier], T.touch0 ? !T.touch1 && T.touch0[2] !== F[2] && (T.touch1 = F, T.taps = 0) : (T.touch0 = F, M = !0, T.taps = 1 + !!l);
3117
+ l && (l = clearTimeout(l)), M && (T.taps < 2 && (h = F[0], l = setTimeout(function() {
3118
+ l = null;
3119
+ }, d)), Xt(this), T.start());
3120
+ }
3121
+ }
3122
+ function $(m, ...C) {
3123
+ if (this.__zooming) {
3124
+ var w = A(this, C).event(m), E = m.changedTouches, T = E.length, M, k, D, F;
3125
+ for (_t(m), M = 0; M < T; ++M)
3126
+ k = E[M], D = it(k, this), w.touch0 && w.touch0[2] === k.identifier ? w.touch0[0] = D : w.touch1 && w.touch1[2] === k.identifier && (w.touch1[0] = D);
3127
+ if (k = w.that.__zoom, w.touch1) {
3128
+ var X = w.touch0[0], H = w.touch0[1], q = w.touch1[0], G = w.touch1[1], W = (W = q[0] - X[0]) * W + (W = q[1] - X[1]) * W, nt = (nt = G[0] - H[0]) * nt + (nt = G[1] - H[1]) * nt;
3129
+ k = b(k, Math.sqrt(W / nt)), D = [(X[0] + q[0]) / 2, (X[1] + q[1]) / 2], F = [(H[0] + G[0]) / 2, (H[1] + G[1]) / 2];
3130
+ } else if (w.touch0) D = w.touch0[0], F = w.touch0[1];
3131
+ else return;
3132
+ w.zoom("touch", n(N(k, D, F), w.extent, a));
3133
+ }
3134
+ }
3135
+ function P(m, ...C) {
3136
+ if (this.__zooming) {
3137
+ var w = A(this, C).event(m), E = m.changedTouches, T = E.length, M, k;
3138
+ for (se(m), f && clearTimeout(f), f = setTimeout(function() {
3139
+ f = null;
3140
+ }, d), M = 0; M < T; ++M)
3141
+ k = E[M], w.touch0 && w.touch0[2] === k.identifier ? delete w.touch0 : w.touch1 && w.touch1[2] === k.identifier && delete w.touch1;
3142
+ if (w.touch1 && !w.touch0 && (w.touch0 = w.touch1, delete w.touch1), w.touch0) w.touch0[1] = this.__zoom.invert(w.touch0[0]);
3143
+ else if (w.end(), w.taps === 2 && (k = it(k, this), Math.hypot(h[0] - k[0], h[1] - k[1]) < v)) {
3144
+ var D = j(this).on("dblclick.zoom");
3145
+ D && D.apply(this, arguments);
3146
+ }
3147
+ }
3148
+ }
3149
+ return g.wheelDelta = function(m) {
3150
+ return arguments.length ? (r = typeof m == "function" ? m : Dt(+m), g) : r;
3151
+ }, g.filter = function(m) {
3152
+ return arguments.length ? (t = typeof m == "function" ? m : Dt(!!m), g) : t;
3153
+ }, g.touchable = function(m) {
3154
+ return arguments.length ? (i = typeof m == "function" ? m : Dt(!!m), g) : i;
3155
+ }, g.extent = function(m) {
3156
+ return arguments.length ? (e = typeof m == "function" ? m : Dt([[+m[0][0], +m[0][1]], [+m[1][0], +m[1][1]]]), g) : e;
3157
+ }, g.scaleExtent = function(m) {
3158
+ return arguments.length ? (o[0] = +m[0], o[1] = +m[1], g) : [o[0], o[1]];
3159
+ }, g.translateExtent = function(m) {
3160
+ return arguments.length ? (a[0][0] = +m[0][0], a[1][0] = +m[1][0], a[0][1] = +m[0][1], a[1][1] = +m[1][1], g) : [[a[0][0], a[0][1]], [a[1][0], a[1][1]]];
3161
+ }, g.constrain = function(m) {
3162
+ return arguments.length ? (n = m, g) : n;
3163
+ }, g.duration = function(m) {
3164
+ return arguments.length ? (s = +m, g) : s;
3165
+ }, g.interpolate = function(m) {
3166
+ return arguments.length ? (c = m, g) : c;
3167
+ }, g.on = function() {
3168
+ var m = u.on.apply(u, arguments);
3169
+ return m === u ? g : m;
3170
+ }, g.clickDistance = function(m) {
3171
+ return arguments.length ? (y = (m = +m) * m, g) : Math.sqrt(y);
3172
+ }, g.tapDistance = function(m) {
3173
+ return arguments.length ? (v = +m, g) : v;
3174
+ }, g;
3175
+ }
3176
+ function ru(t, e) {
3177
+ const n = nu().scaleExtent([0.1, 10]).on("zoom", (r) => {
3178
+ e.attr("transform", r.transform.toString());
3179
+ });
3180
+ return t.call(n), n;
3181
+ }
3182
+ function iu(t, e) {
3183
+ const n = Xa().on("start", (r, i) => {
3184
+ r.active || e.alphaTarget(0.3).restart(), i.fx = i.x, i.fy = i.y;
3185
+ }).on("drag", (r, i) => {
3186
+ i.fx = r.x, i.fy = r.y;
3187
+ }).on("end", (r, i) => {
3188
+ r.active || e.alphaTarget(0), i.fx = null, i.fy = null;
3189
+ });
3190
+ t.call(n);
3191
+ }
3192
+ function ou(t, e, n, r) {
3193
+ return e.on("click.highlight", (i, o) => {
3194
+ i.stopPropagation();
3195
+ const a = r.filter((c) => {
3196
+ if (c.source.id !== o.id && c.target.id !== o.id) return !1;
3197
+ const u = n.filter((l) => l === c).node();
3198
+ return u !== null && !u.classList.contains("mv-hidden");
3199
+ }), s = /* @__PURE__ */ new Set([o.id]);
3200
+ for (const c of a)
3201
+ s.add(c.source.id), s.add(c.target.id);
3202
+ e.classed("mv-highlighted", (c) => s.has(c.id)).classed("mv-dimmed", (c) => !s.has(c.id)), n.classed("mv-highlighted", function(c) {
3203
+ return this.classList.contains("mv-hidden") ? !1 : c.source.id === o.id || c.target.id === o.id;
3204
+ }).classed("mv-dimmed", function(c) {
3205
+ return this.classList.contains("mv-hidden") ? !1 : c.source.id !== o.id && c.target.id !== o.id;
3206
+ });
3207
+ }), t.on("click.highlight", () => {
3208
+ e.classed("mv-highlighted", !1).classed("mv-dimmed", !1), n.classed("mv-highlighted", !1).classed("mv-dimmed", !1);
3209
+ }), () => {
3210
+ e.on("click.highlight", null), t.on("click.highlight", null);
3211
+ };
3212
+ }
3213
+ function au(t, e, n) {
3214
+ const r = [...new Set(n.map((a) => a.kind))], i = document.createElement("div");
3215
+ i.className = "mv-filter-panel", i.setAttribute("role", "group"), i.setAttribute("aria-label", "Edge kind filters");
3216
+ const o = document.createElement("div");
3217
+ o.className = "mv-filter-heading", o.textContent = "Edge Kinds", i.appendChild(o);
3218
+ for (const a of r) {
3219
+ const s = document.createElement("label");
3220
+ s.className = "mv-filter-label";
3221
+ const c = document.createElement("input");
3222
+ c.type = "checkbox", c.checked = !0, c.dataset.kind = a, c.addEventListener("change", () => {
3223
+ e.filter((l) => l.kind === a).classed("mv-hidden", !c.checked);
3224
+ }), s.appendChild(c), s.appendChild(document.createTextNode(` ${a}`)), i.appendChild(s);
3225
+ }
3226
+ return t.appendChild(i), () => {
3227
+ i.remove();
3228
+ };
3229
+ }
3230
+ function su(t, e) {
3231
+ const n = document.createElement("div");
3232
+ n.className = "mv-search";
3233
+ const r = document.createElement("input");
3234
+ r.type = "text", r.placeholder = "Search nodes...", r.className = "mv-search-input", r.setAttribute("aria-label", "Search nodes");
3235
+ let i = null;
3236
+ return r.addEventListener("input", () => {
3237
+ i && clearTimeout(i), i = setTimeout(() => {
3238
+ const o = r.value.trim().toLowerCase();
3239
+ if (o === "") {
3240
+ e.classed("mv-search-dimmed", !1);
3241
+ return;
3242
+ }
3243
+ e.classed("mv-search-dimmed", (a) => !a.name.toLowerCase().includes(o));
3244
+ }, 150);
3245
+ }), n.appendChild(r), t.appendChild(n), () => {
3246
+ i && clearTimeout(i), n.remove();
3247
+ };
3248
+ }
3249
+ function uu(t, e) {
3250
+ const n = document.createElement("div");
3251
+ n.className = "mv-evidence-sidebar", n.classList.add("mv-hidden"), t.appendChild(n);
3252
+ function r(a) {
3253
+ n.classList.remove("mv-hidden"), n.replaceChildren(), t.dispatchEvent(new CustomEvent("mv-sidebar-open", { detail: "evidence" }));
3254
+ const s = document.createElement("div");
3255
+ s.className = "mv-evidence-header";
3256
+ const c = document.createElement("span");
3257
+ c.textContent = `${a.source.name} → ${a.target.name}`;
3258
+ const u = document.createElement("button");
3259
+ u.className = "mv-evidence-close", u.textContent = "×", u.setAttribute("aria-label", "Close"), u.addEventListener("click", i), s.appendChild(c), s.appendChild(u), n.appendChild(s);
3260
+ const l = document.createElement("div");
3261
+ l.className = "mv-evidence-kind", l.textContent = `Kind: ${a.kind}`, n.appendChild(l);
3262
+ const h = document.createElement("ul");
3263
+ h.className = "mv-evidence-list";
3264
+ for (const f of a.evidence) {
3265
+ const d = document.createElement("li");
3266
+ d.textContent = `${f.file}:${f.line}`, h.appendChild(d);
3267
+ }
3268
+ n.appendChild(h);
3269
+ }
3270
+ function i() {
3271
+ n.classList.add("mv-hidden");
3272
+ }
3273
+ e.style("cursor", "pointer").on("click", (a, s) => {
3274
+ a.stopPropagation(), r(s);
3275
+ });
3276
+ function o(a) {
3277
+ a.detail !== "evidence" && i();
3278
+ }
3279
+ return t.addEventListener("mv-sidebar-open", o), {
3280
+ destroy: () => {
3281
+ n.remove(), t.removeEventListener("mv-sidebar-open", o), e.on("click", null);
3282
+ },
3283
+ hideSidebar: i,
3284
+ sidebarElement: n
3285
+ };
3286
+ }
3287
+ const cn = {
3288
+ loc: "LOC",
3289
+ cc: "CC",
3290
+ mi: "MI",
3291
+ max_cc: "CC (Max)",
3292
+ median_cc: "CC (Median)",
3293
+ mi_min: "MI (Min)",
3294
+ mi_median: "MI (Median)"
3295
+ };
3296
+ function cu(t) {
3297
+ return t in cn ? cn[t] : t.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
3298
+ }
3299
+ function O(t, ...e) {
3300
+ const n = document.createElement("p");
3301
+ for (const r of e)
3302
+ if (typeof r == "string")
3303
+ n.appendChild(document.createTextNode(r));
3304
+ else {
3305
+ const i = document.createElement(r.tag);
3306
+ i.textContent = r.text, n.appendChild(i);
3307
+ }
3308
+ t.appendChild(n);
3309
+ }
3310
+ function ct(t, e) {
3311
+ const n = document.createElement("table");
3312
+ n.className = "mv-modal-benchmarks";
3313
+ for (const [r, i] of e) {
3314
+ const o = document.createElement("tr"), a = document.createElement("td");
3315
+ a.textContent = r;
3316
+ const s = document.createElement("td");
3317
+ s.textContent = i, o.appendChild(a), o.appendChild(s), n.appendChild(o);
3318
+ }
3319
+ t.appendChild(n);
3320
+ }
3321
+ const Pt = {
3322
+ loc: {
3323
+ title: "LOC — Lines of Code",
3324
+ build(t) {
3325
+ O(t, "Count of non-empty, non-comment-only lines in the file. Lines with code followed by an inline comment are counted."), O(t, { tag: "strong", text: "Lower is better." }, " Smaller files are easier to understand and maintain."), ct(t, [
3326
+ ["1–100", "Good — small, easy to maintain"],
3327
+ ["100–300", "Moderate — consider if it does too much"],
3328
+ ["300–500", "Concerning — likely needs splitting"],
3329
+ ["500+", "Bad — strong candidate for refactoring"]
3330
+ ]);
3331
+ }
3332
+ },
3333
+ cc: {
3334
+ title: "CC — Cyclomatic Complexity",
3335
+ build(t) {
3336
+ O(
3337
+ t,
3338
+ "Number of independent code paths through a function. Starts at 1, then +1 for each ",
3339
+ { tag: "code", text: "if" },
3340
+ ", ",
3341
+ { tag: "code", text: "elif" },
3342
+ ", ",
3343
+ { tag: "code", text: "while" },
3344
+ ", ",
3345
+ { tag: "code", text: "for" },
3346
+ ", ",
3347
+ { tag: "code", text: "match" },
3348
+ " branch, ",
3349
+ { tag: "code", text: "and" },
3350
+ "/",
3351
+ { tag: "code", text: "or" },
3352
+ " operator, or ternary expression."
3353
+ ), O(t, { tag: "strong", text: "Lower is better." }, " Fewer paths = easier testing."), ct(t, [
3354
+ ["1–5", "Good — simple, easy to test"],
3355
+ ["6–10", "Moderate — still manageable"],
3356
+ ["11–20", "Concerning — hard to test thoroughly"],
3357
+ ["21+", "Bad — should be refactored"]
3358
+ ]);
3359
+ }
3360
+ },
3361
+ max_cc: {
3362
+ title: "CC (Max) — Maximum Cyclomatic Complexity",
3363
+ build(t) {
3364
+ O(t, "The highest CC among all functions in the file. Identifies the single most complex function (the “hotspot”)."), O(t, "A file with CC (Max) = 15 means at least one function has 15 independent code paths."), O(t, { tag: "strong", text: "Lower is better." }), ct(t, [
3365
+ ["1–5", "Good — simple, easy to test"],
3366
+ ["6–10", "Moderate — still manageable"],
3367
+ ["11–20", "Concerning — hard to test thoroughly"],
3368
+ ["21+", "Bad — should be refactored"]
3369
+ ]);
3370
+ }
3371
+ },
3372
+ median_cc: {
3373
+ title: "CC (Median) — Median Cyclomatic Complexity",
3374
+ build(t) {
3375
+ O(
3376
+ t,
3377
+ "The median CC across all functions in the file. Represents the ",
3378
+ { tag: "em", text: "typical" },
3379
+ " function complexity."
3380
+ ), O(t, "Unlike CC (Max), this is not skewed by one bad function. A value above 5 suggests most functions are moderately complex."), O(t, { tag: "strong", text: "Lower is better." }), ct(t, [
3381
+ ["1–5", "Good — simple, easy to test"],
3382
+ ["6–10", "Moderate — still manageable"],
3383
+ ["11–20", "Concerning — hard to test thoroughly"],
3384
+ ["21+", "Bad — should be refactored"]
3385
+ ]);
3386
+ }
3387
+ },
3388
+ mi: {
3389
+ title: "MI — File-Level Maintainability Index",
3390
+ build(t) {
3391
+ O(
3392
+ t,
3393
+ "How hard is this file ",
3394
+ { tag: "em", text: "as a whole" },
3395
+ " to wrap your head around? A composite score (0–171) combining size (LOC), complexity (CC), and information density (Halstead volume)."
3396
+ ), O(
3397
+ t,
3398
+ { tag: "strong", text: "Formula:" },
3399
+ " ",
3400
+ { tag: "code", text: "MI = 171 − 5.2·ln(V) − 0.23·CC − 16.2·ln(LOC)" }
3401
+ ), O(t, "File-level MI is almost always lower than any individual function’s MI, because it aggregates volume and LOC across the entire file. A file with 15 perfectly clean functions can still score low simply because there’s a lot of code in total. Use MI (Min) and MI (Median) for a per-function perspective."), O(t, { tag: "strong", text: "Higher is better." }), ct(t, [
3402
+ ["> 85", "Highly maintainable"],
3403
+ ["65–85", "Moderate"],
3404
+ ["< 65", "Low"]
3405
+ ]);
3406
+ }
3407
+ },
3408
+ mi_min: {
3409
+ title: "MI (Min) — Worst Per-Function MI",
3410
+ build(t) {
3411
+ O(
3412
+ t,
3413
+ "How bad is the worst individual function? The ",
3414
+ { tag: "em", text: "lowest" },
3415
+ " MI among all functions in the file."
3416
+ ), O(t, "Because file-level MI aggregates across the whole file, it can look low even when every function is fine. MI (Min) cuts through that noise—if this number is healthy, no single function is a problem."), O(t, { tag: "strong", text: "Higher is better." }), ct(t, [
3417
+ ["> 85", "Highly maintainable"],
3418
+ ["65–85", "Moderate"],
3419
+ ["< 65", "Low"]
3420
+ ]);
3421
+ }
3422
+ },
3423
+ mi_median: {
3424
+ title: "MI (Median) — Median Per-Function MI",
3425
+ build(t) {
3426
+ O(
3427
+ t,
3428
+ "How maintainable is the ",
3429
+ { tag: "em", text: "typical" },
3430
+ " function? The median MI across all functions in the file."
3431
+ ), O(t, "If MI (Median) is high but MI (Min) is low, most functions are healthy and only one outlier needs attention. If both are low, the file has widespread maintainability issues."), O(t, { tag: "strong", text: "Higher is better." }), ct(t, [
3432
+ ["> 85", "Highly maintainable"],
3433
+ ["65–85", "Moderate"],
3434
+ ["< 65", "Low"]
3435
+ ]);
3436
+ }
3437
+ }
3438
+ };
3439
+ function lu(t, e, n) {
3440
+ const r = document.createElement("div");
3441
+ r.className = "mv-node-detail-sidebar", r.classList.add("mv-hidden"), t.appendChild(r);
3442
+ let i = null;
3443
+ function o(l) {
3444
+ r.classList.remove("mv-hidden"), r.replaceChildren(), t.dispatchEvent(new CustomEvent("mv-sidebar-open", { detail: "node-detail" }));
3445
+ const h = document.createElement("div");
3446
+ h.className = "mv-node-detail-header";
3447
+ const f = document.createElement("span");
3448
+ f.textContent = l.name;
3449
+ const d = document.createElement("button");
3450
+ d.className = "mv-node-detail-close", d.textContent = "×", d.setAttribute("aria-label", "Close"), d.addEventListener("click", c), h.appendChild(f), h.appendChild(d), r.appendChild(h);
3451
+ const x = document.createElement("div");
3452
+ x.className = "mv-node-detail-section";
3453
+ const y = document.createElement("div");
3454
+ y.className = "mv-node-detail-section-heading", y.textContent = "Info", x.appendChild(y);
3455
+ const v = document.createElement("table");
3456
+ v.className = "mv-node-detail-table", s(v, "ID", l.id), s(v, "Kind", l.kind), s(v, "Language", l.language), l.tags.length > 0 && s(v, "Tags", l.tags.join(", ")), x.appendChild(v), r.appendChild(x);
3457
+ const g = document.createElement("div");
3458
+ g.className = "mv-node-detail-section";
3459
+ const b = document.createElement("div");
3460
+ b.className = "mv-node-detail-section-heading", b.textContent = "Metrics", g.appendChild(b);
3461
+ const N = document.createElement("table");
3462
+ N.className = "mv-node-detail-table";
3463
+ const p = l.metrics, _ = Object.keys(p);
3464
+ for (const S of _) {
3465
+ const L = p[S];
3466
+ if (typeof L != "number" && L !== null) continue;
3467
+ const z = cu(S), R = L == null ? "—" : String(L);
3468
+ s(N, z, R, S in Pt ? S : void 0);
3469
+ }
3470
+ g.appendChild(N), r.appendChild(g);
3471
+ const A = l.metrics.functions;
3472
+ if (A && A.length > 0) {
3473
+ const S = [...A].sort((M, k) => k.cc - M.cc), L = 5, z = S.length > L, R = document.createElement("div");
3474
+ R.className = "mv-node-detail-section";
3475
+ const $ = document.createElement("div");
3476
+ $.className = "mv-node-detail-section-heading", $.textContent = `Functions (${S.length})`, R.appendChild($);
3477
+ const P = document.createElement("div");
3478
+ P.className = "mv-node-detail-functions";
3479
+ const m = document.createElement("table");
3480
+ m.className = "mv-node-detail-fn-table";
3481
+ const C = document.createElement("thead"), w = document.createElement("tr"), E = {
3482
+ LOC: "loc",
3483
+ CC: "cc",
3484
+ MI: "mi"
3485
+ };
3486
+ for (const M of ["Name", "Line", "LOC", "CC", "MI"]) {
3487
+ const k = document.createElement("th");
3488
+ k.textContent = M, M in E && (k.title = Pt[E[M]].title), w.appendChild(k);
3489
+ }
3490
+ C.appendChild(w), m.appendChild(C);
3491
+ const T = document.createElement("tbody");
3492
+ if (S.forEach((M, k) => {
3493
+ const D = document.createElement("tr");
3494
+ z && k >= L && D.classList.add("mv-hidden");
3495
+ const F = document.createElement("td");
3496
+ F.className = "mv-node-detail-fn-name", F.textContent = M.name, F.title = M.name, D.appendChild(F);
3497
+ const X = document.createElement("td");
3498
+ X.textContent = `L${M.line}`, D.appendChild(X);
3499
+ const H = document.createElement("td");
3500
+ H.textContent = String(M.loc), D.appendChild(H);
3501
+ const q = document.createElement("td");
3502
+ q.textContent = String(M.cc), M.cc > 10 && q.classList.add("mv-node-detail-fn-warn"), D.appendChild(q);
3503
+ const G = document.createElement("td");
3504
+ M.mi === null ? G.textContent = "—" : (G.textContent = String(M.mi), M.mi < 65 && G.classList.add("mv-node-detail-fn-warn")), D.appendChild(G), T.appendChild(D);
3505
+ }), m.appendChild(T), P.appendChild(m), z) {
3506
+ const M = document.createElement("button");
3507
+ M.className = "mv-node-detail-fn-toggle", M.textContent = `Show all (${S.length})`;
3508
+ let k = !1;
3509
+ M.addEventListener("click", () => {
3510
+ k = !k, T.querySelectorAll("tr").forEach((F, X) => {
3511
+ X >= L && F.classList.toggle("mv-hidden", !k);
3512
+ }), M.textContent = k ? "Show less" : `Show all (${S.length})`;
3513
+ }), P.appendChild(M);
3514
+ }
3515
+ R.appendChild(P), r.appendChild(R);
3516
+ }
3517
+ const I = n.filter(
3518
+ (S) => S.source.id === l.id || S.target.id === l.id
3519
+ );
3520
+ if (I.length > 0) {
3521
+ const S = document.createElement("div");
3522
+ S.className = "mv-node-detail-section";
3523
+ const L = document.createElement("div");
3524
+ L.className = "mv-node-detail-section-heading", L.textContent = `Connections (${I.length})`, S.appendChild(L);
3525
+ const z = document.createElement("ul");
3526
+ z.className = "mv-node-detail-connections";
3527
+ for (const R of I) {
3528
+ const $ = document.createElement("li"), P = R.source.id === l.id, m = P ? R.target : R.source, C = P ? "→" : "←", w = document.createElement("a");
3529
+ w.className = "mv-node-detail-conn-link", w.href = "#", w.textContent = `${C} ${m.name}`, w.addEventListener("click", (T) => {
3530
+ T.preventDefault(), T.stopPropagation();
3531
+ const M = e.filter((k) => k.id === m.id).node();
3532
+ M && M.dispatchEvent(new MouseEvent("click", { bubbles: !0 }));
3533
+ });
3534
+ const E = document.createElement("span");
3535
+ E.className = "mv-node-detail-conn-kind", E.textContent = ` (${R.kind})`, $.appendChild(w), $.appendChild(E), z.appendChild($);
3536
+ }
3537
+ S.appendChild(z), r.appendChild(S);
3538
+ }
3539
+ }
3540
+ function a(l) {
3541
+ const h = document.querySelector(".mv-metric-modal-overlay");
3542
+ h && h.remove();
3543
+ const f = document.createElement("div");
3544
+ f.className = "mv-metric-modal-overlay", f.setAttribute("role", "dialog"), f.setAttribute("aria-modal", "true");
3545
+ const d = document.createElement("div");
3546
+ d.className = "mv-metric-modal";
3547
+ const x = document.createElement("div");
3548
+ x.className = "mv-metric-modal-header";
3549
+ const y = document.createElement("span");
3550
+ y.className = "mv-metric-modal-title";
3551
+ const v = `mv-modal-title-${Date.now()}`;
3552
+ y.id = v, f.setAttribute("aria-labelledby", v), y.textContent = l.title;
3553
+ const g = document.createElement("button");
3554
+ g.className = "mv-metric-modal-close", g.textContent = "×", g.setAttribute("aria-label", "Close"), x.appendChild(y), x.appendChild(g), d.appendChild(x);
3555
+ const b = document.createElement("div");
3556
+ b.className = "mv-metric-modal-body", l.build(b), d.appendChild(b), f.appendChild(d), document.body.appendChild(f), i = f;
3557
+ function N() {
3558
+ f.remove(), i = null, document.removeEventListener("keydown", p);
3559
+ }
3560
+ function p(_) {
3561
+ _.key === "Escape" && N();
3562
+ }
3563
+ g.addEventListener("click", N), f.addEventListener("click", (_) => {
3564
+ _.target === f && N();
3565
+ }), document.addEventListener("keydown", p);
3566
+ }
3567
+ function s(l, h, f, d) {
3568
+ const x = document.createElement("tr"), y = document.createElement("td");
3569
+ if (y.className = "mv-node-detail-label", y.textContent = h, d && d in Pt) {
3570
+ const g = document.createElement("button");
3571
+ g.type = "button", g.className = "mv-metric-info", g.textContent = "?", g.addEventListener("click", (b) => {
3572
+ b.stopPropagation(), a(Pt[d]);
3573
+ }), y.appendChild(g);
3574
+ }
3575
+ const v = document.createElement("td");
3576
+ v.className = "mv-node-detail-value", v.textContent = f, x.appendChild(y), x.appendChild(v), l.appendChild(x);
3577
+ }
3578
+ function c() {
3579
+ r.classList.add("mv-hidden");
3580
+ }
3581
+ e.on("click.nodedetail", (l, h) => {
3582
+ l.stopPropagation(), o(h);
3583
+ });
3584
+ function u(l) {
3585
+ l.detail !== "node-detail" && c();
3586
+ }
3587
+ return t.addEventListener("mv-sidebar-open", u), {
3588
+ destroy: () => {
3589
+ i?.remove(), i = null, r.remove(), t.removeEventListener("mv-sidebar-open", u), e.on("click.nodedetail", null);
3590
+ },
3591
+ hideSidebar: c,
3592
+ sidebarElement: r
3593
+ };
3594
+ }
3595
+ function fu(t, e, n, r) {
3596
+ const i = document.createElement("div");
3597
+ i.className = "mv-controls", t.appendChild(i);
3598
+ const o = au(i, n, r), a = su(i, e), s = uu(t, n), c = lu(t, e, r);
3599
+ function u(l) {
3600
+ const h = l.target;
3601
+ !s.sidebarElement.contains(h) && !c.sidebarElement.contains(h) && (s.hideSidebar(), c.hideSidebar());
3602
+ }
3603
+ return t.addEventListener("click", u), () => {
3604
+ o(), a(), s.destroy(), c.destroy(), t.removeEventListener("click", u), i.remove();
3605
+ };
3606
+ }
3607
+ function du(t, e, n) {
3608
+ const r = n?.width ?? Oo, i = n?.height ?? Bo, o = getComputedStyle(t);
3609
+ o.position === "static" && (t.style.position = "relative"), o.overflow === "visible" && (t.style.overflow = "hidden");
3610
+ const a = Xo(), s = qo(), c = Yo(), u = Go(), l = e.nodes.map((_) => ({ ..._ })), h = new Map(l.map((_) => [_.id, _])), f = e.links.filter((_) => h.has(_.source) && h.has(_.target)).map((_) => ({
3611
+ source: h.get(_.source),
3612
+ target: h.get(_.target),
3613
+ kind: _.kind,
3614
+ weight: _.weight,
3615
+ evidence: _.evidence
3616
+ })), d = j(t).append("svg").attr("width", r).attr("height", i).attr("viewBox", `0 0 ${r} ${i}`), x = d.append("g");
3617
+ ru(d, x);
3618
+ const y = Da(x, f, s, u), v = Ra(x, l, a, c), g = za(l, f, r, i);
3619
+ iu(v, g);
3620
+ const b = ou(d, v, y, f), N = fu(t, v, y, f);
3621
+ g.on("tick", () => {
3622
+ y.attr("x1", (_) => _.source.x).attr("y1", (_) => _.source.y).attr("x2", (_) => _.target.x).attr("y2", (_) => _.target.y), v.attr("transform", (_) => `translate(${_.x},${_.y})`);
3623
+ });
3624
+ function p() {
3625
+ b(), N(), g.stop(), d.remove();
3626
+ }
3627
+ return { destroy: p };
3628
+ }
3629
+ export {
3630
+ B as SchemaValidationError,
3631
+ du as renderGraph,
3632
+ hu as validateGraphData
3633
+ };
3634
+ //# sourceMappingURL=simple-code-graph-viewer.js.map