@gen-epix/ui-phylogenetic-tree 2.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,986 @@
1
+ import { i as e, n as t, r as n, t as r } from "../../_chunks/identity.js";
2
+ import { NumberUtil as i } from "@gen-epix/ui-core/utils/NumberUtil";
3
+ import { StringUtil as a } from "@gen-epix/ui-core/utils/StringUtil";
4
+ //#region ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/head.js
5
+ var o = /* @__PURE__ */ n(((e, t) => {
6
+ function n(e) {
7
+ return e && e.length ? e[0] : void 0;
8
+ }
9
+ t.exports = n;
10
+ })), s = /* @__PURE__ */ n(((e, t) => {
11
+ t.exports = o();
12
+ })), c = /* @__PURE__ */ n(((e, t) => {
13
+ function n(e, t) {
14
+ for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
15
+ return i;
16
+ }
17
+ t.exports = n;
18
+ })), l = /* @__PURE__ */ n(((e, t) => {
19
+ t.exports = typeof global == "object" && global && global.Object === Object && global;
20
+ })), u = /* @__PURE__ */ n(((e, t) => {
21
+ var n = l(), r = typeof self == "object" && self && self.Object === Object && self;
22
+ t.exports = n || r || Function("return this")();
23
+ })), d = /* @__PURE__ */ n(((e, t) => {
24
+ t.exports = u().Symbol;
25
+ })), f = /* @__PURE__ */ n(((e, t) => {
26
+ var n = d(), r = Object.prototype, i = r.hasOwnProperty, a = r.toString, o = n ? n.toStringTag : void 0;
27
+ function s(e) {
28
+ var t = i.call(e, o), n = e[o];
29
+ try {
30
+ e[o] = void 0;
31
+ var r = !0;
32
+ } catch {}
33
+ var s = a.call(e);
34
+ return r && (t ? e[o] = n : delete e[o]), s;
35
+ }
36
+ t.exports = s;
37
+ })), p = /* @__PURE__ */ n(((e, t) => {
38
+ var n = Object.prototype.toString;
39
+ function r(e) {
40
+ return n.call(e);
41
+ }
42
+ t.exports = r;
43
+ })), m = /* @__PURE__ */ n(((e, t) => {
44
+ var n = d(), r = f(), i = p(), a = "[object Null]", o = "[object Undefined]", s = n ? n.toStringTag : void 0;
45
+ function c(e) {
46
+ return e == null ? e === void 0 ? o : a : s && s in Object(e) ? r(e) : i(e);
47
+ }
48
+ t.exports = c;
49
+ })), h = /* @__PURE__ */ n(((e, t) => {
50
+ function n(e) {
51
+ var t = typeof e;
52
+ return e != null && (t == "object" || t == "function");
53
+ }
54
+ t.exports = n;
55
+ })), g = /* @__PURE__ */ n(((e, t) => {
56
+ var n = m(), r = h(), i = "[object AsyncFunction]", a = "[object Function]", o = "[object GeneratorFunction]", s = "[object Proxy]";
57
+ function c(e) {
58
+ if (!r(e)) return !1;
59
+ var t = n(e);
60
+ return t == a || t == o || t == i || t == s;
61
+ }
62
+ t.exports = c;
63
+ })), _ = /* @__PURE__ */ n(((e, t) => {
64
+ t.exports = u()["__core-js_shared__"];
65
+ })), v = /* @__PURE__ */ n(((e, t) => {
66
+ var n = _(), r = function() {
67
+ var e = /[^.]+$/.exec(n && n.keys && n.keys.IE_PROTO || "");
68
+ return e ? "Symbol(src)_1." + e : "";
69
+ }();
70
+ function i(e) {
71
+ return !!r && r in e;
72
+ }
73
+ t.exports = i;
74
+ })), y = /* @__PURE__ */ n(((e, t) => {
75
+ var n = Function.prototype.toString;
76
+ function r(e) {
77
+ if (e != null) {
78
+ try {
79
+ return n.call(e);
80
+ } catch {}
81
+ try {
82
+ return e + "";
83
+ } catch {}
84
+ }
85
+ return "";
86
+ }
87
+ t.exports = r;
88
+ })), b = /* @__PURE__ */ n(((e, t) => {
89
+ var n = g(), r = v(), i = h(), a = y(), o = /[\\^$.*+?()[\]{}|]/g, s = /^\[object .+?Constructor\]$/, c = Function.prototype, l = Object.prototype, u = c.toString, d = l.hasOwnProperty, f = RegExp("^" + u.call(d).replace(o, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
90
+ function p(e) {
91
+ return !i(e) || r(e) ? !1 : (n(e) ? f : s).test(a(e));
92
+ }
93
+ t.exports = p;
94
+ })), x = /* @__PURE__ */ n(((e, t) => {
95
+ function n(e, t) {
96
+ return e?.[t];
97
+ }
98
+ t.exports = n;
99
+ })), S = /* @__PURE__ */ n(((e, t) => {
100
+ var n = b(), r = x();
101
+ function i(e, t) {
102
+ var i = r(e, t);
103
+ return n(i) ? i : void 0;
104
+ }
105
+ t.exports = i;
106
+ })), C = /* @__PURE__ */ n(((e, t) => {
107
+ t.exports = S()(Object, "create");
108
+ })), w = /* @__PURE__ */ n(((e, t) => {
109
+ var n = C();
110
+ function r() {
111
+ this.__data__ = n ? n(null) : {}, this.size = 0;
112
+ }
113
+ t.exports = r;
114
+ })), T = /* @__PURE__ */ n(((e, t) => {
115
+ function n(e) {
116
+ var t = this.has(e) && delete this.__data__[e];
117
+ return this.size -= +!!t, t;
118
+ }
119
+ t.exports = n;
120
+ })), E = /* @__PURE__ */ n(((e, t) => {
121
+ var n = C(), r = "__lodash_hash_undefined__", i = Object.prototype.hasOwnProperty;
122
+ function a(e) {
123
+ var t = this.__data__;
124
+ if (n) {
125
+ var a = t[e];
126
+ return a === r ? void 0 : a;
127
+ }
128
+ return i.call(t, e) ? t[e] : void 0;
129
+ }
130
+ t.exports = a;
131
+ })), D = /* @__PURE__ */ n(((e, t) => {
132
+ var n = C(), r = Object.prototype.hasOwnProperty;
133
+ function i(e) {
134
+ var t = this.__data__;
135
+ return n ? t[e] !== void 0 : r.call(t, e);
136
+ }
137
+ t.exports = i;
138
+ })), O = /* @__PURE__ */ n(((e, t) => {
139
+ var n = C(), r = "__lodash_hash_undefined__";
140
+ function i(e, t) {
141
+ var i = this.__data__;
142
+ return this.size += +!this.has(e), i[e] = n && t === void 0 ? r : t, this;
143
+ }
144
+ t.exports = i;
145
+ })), k = /* @__PURE__ */ n(((e, t) => {
146
+ var n = w(), r = T(), i = E(), a = D(), o = O();
147
+ function s(e) {
148
+ var t = -1, n = e == null ? 0 : e.length;
149
+ for (this.clear(); ++t < n;) {
150
+ var r = e[t];
151
+ this.set(r[0], r[1]);
152
+ }
153
+ }
154
+ s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
155
+ })), A = /* @__PURE__ */ n(((e, t) => {
156
+ function n() {
157
+ this.__data__ = [], this.size = 0;
158
+ }
159
+ t.exports = n;
160
+ })), j = /* @__PURE__ */ n(((e, t) => {
161
+ function n(e, t) {
162
+ return e === t || e !== e && t !== t;
163
+ }
164
+ t.exports = n;
165
+ })), M = /* @__PURE__ */ n(((e, t) => {
166
+ var n = j();
167
+ function r(e, t) {
168
+ for (var r = e.length; r--;) if (n(e[r][0], t)) return r;
169
+ return -1;
170
+ }
171
+ t.exports = r;
172
+ })), N = /* @__PURE__ */ n(((e, t) => {
173
+ var n = M(), r = Array.prototype.splice;
174
+ function i(e) {
175
+ var t = this.__data__, i = n(t, e);
176
+ return i < 0 ? !1 : (i == t.length - 1 ? t.pop() : r.call(t, i, 1), --this.size, !0);
177
+ }
178
+ t.exports = i;
179
+ })), ee = /* @__PURE__ */ n(((e, t) => {
180
+ var n = M();
181
+ function r(e) {
182
+ var t = this.__data__, r = n(t, e);
183
+ return r < 0 ? void 0 : t[r][1];
184
+ }
185
+ t.exports = r;
186
+ })), te = /* @__PURE__ */ n(((e, t) => {
187
+ var n = M();
188
+ function r(e) {
189
+ return n(this.__data__, e) > -1;
190
+ }
191
+ t.exports = r;
192
+ })), ne = /* @__PURE__ */ n(((e, t) => {
193
+ var n = M();
194
+ function r(e, t) {
195
+ var r = this.__data__, i = n(r, e);
196
+ return i < 0 ? (++this.size, r.push([e, t])) : r[i][1] = t, this;
197
+ }
198
+ t.exports = r;
199
+ })), re = /* @__PURE__ */ n(((e, t) => {
200
+ var n = A(), r = N(), i = ee(), a = te(), o = ne();
201
+ function s(e) {
202
+ var t = -1, n = e == null ? 0 : e.length;
203
+ for (this.clear(); ++t < n;) {
204
+ var r = e[t];
205
+ this.set(r[0], r[1]);
206
+ }
207
+ }
208
+ s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
209
+ })), ie = /* @__PURE__ */ n(((e, t) => {
210
+ t.exports = S()(u(), "Map");
211
+ })), ae = /* @__PURE__ */ n(((e, t) => {
212
+ var n = k(), r = re(), i = ie();
213
+ function a() {
214
+ this.size = 0, this.__data__ = {
215
+ hash: new n(),
216
+ map: new (i || r)(),
217
+ string: new n()
218
+ };
219
+ }
220
+ t.exports = a;
221
+ })), P = /* @__PURE__ */ n(((e, t) => {
222
+ function n(e) {
223
+ var t = typeof e;
224
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
225
+ }
226
+ t.exports = n;
227
+ })), F = /* @__PURE__ */ n(((e, t) => {
228
+ var n = P();
229
+ function r(e, t) {
230
+ var r = e.__data__;
231
+ return n(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
232
+ }
233
+ t.exports = r;
234
+ })), I = /* @__PURE__ */ n(((e, t) => {
235
+ var n = F();
236
+ function r(e) {
237
+ var t = n(this, e).delete(e);
238
+ return this.size -= +!!t, t;
239
+ }
240
+ t.exports = r;
241
+ })), L = /* @__PURE__ */ n(((e, t) => {
242
+ var n = F();
243
+ function r(e) {
244
+ return n(this, e).get(e);
245
+ }
246
+ t.exports = r;
247
+ })), R = /* @__PURE__ */ n(((e, t) => {
248
+ var n = F();
249
+ function r(e) {
250
+ return n(this, e).has(e);
251
+ }
252
+ t.exports = r;
253
+ })), z = /* @__PURE__ */ n(((e, t) => {
254
+ var n = F();
255
+ function r(e, t) {
256
+ var r = n(this, e), i = r.size;
257
+ return r.set(e, t), this.size += r.size == i ? 0 : 1, this;
258
+ }
259
+ t.exports = r;
260
+ })), B = /* @__PURE__ */ n(((e, t) => {
261
+ var n = ae(), r = I(), i = L(), a = R(), o = z();
262
+ function s(e) {
263
+ var t = -1, n = e == null ? 0 : e.length;
264
+ for (this.clear(); ++t < n;) {
265
+ var r = e[t];
266
+ this.set(r[0], r[1]);
267
+ }
268
+ }
269
+ s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
270
+ })), V = /* @__PURE__ */ n(((e, t) => {
271
+ function n(e) {
272
+ return this.__data__.set(e, "__lodash_hash_undefined__"), this;
273
+ }
274
+ t.exports = n;
275
+ })), H = /* @__PURE__ */ n(((e, t) => {
276
+ function n(e) {
277
+ return this.__data__.has(e);
278
+ }
279
+ t.exports = n;
280
+ })), U = /* @__PURE__ */ n(((e, t) => {
281
+ var n = B(), r = V(), i = H();
282
+ function a(e) {
283
+ var t = -1, r = e == null ? 0 : e.length;
284
+ for (this.__data__ = new n(); ++t < r;) this.add(e[t]);
285
+ }
286
+ a.prototype.add = a.prototype.push = r, a.prototype.has = i, t.exports = a;
287
+ })), W = /* @__PURE__ */ n(((e, t) => {
288
+ function n(e, t, n, r) {
289
+ for (var i = e.length, a = n + (r ? 1 : -1); r ? a-- : ++a < i;) if (t(e[a], a, e)) return a;
290
+ return -1;
291
+ }
292
+ t.exports = n;
293
+ })), G = /* @__PURE__ */ n(((e, t) => {
294
+ function n(e) {
295
+ return e !== e;
296
+ }
297
+ t.exports = n;
298
+ })), K = /* @__PURE__ */ n(((e, t) => {
299
+ function n(e, t, n) {
300
+ for (var r = n - 1, i = e.length; ++r < i;) if (e[r] === t) return r;
301
+ return -1;
302
+ }
303
+ t.exports = n;
304
+ })), q = /* @__PURE__ */ n(((e, t) => {
305
+ var n = W(), r = G(), i = K();
306
+ function a(e, t, a) {
307
+ return t === t ? i(e, t, a) : n(e, r, a);
308
+ }
309
+ t.exports = a;
310
+ })), J = /* @__PURE__ */ n(((e, t) => {
311
+ var n = q();
312
+ function r(e, t) {
313
+ return !!(e != null && e.length) && n(e, t, 0) > -1;
314
+ }
315
+ t.exports = r;
316
+ })), oe = /* @__PURE__ */ n(((e, t) => {
317
+ function n(e, t, n) {
318
+ for (var r = -1, i = e == null ? 0 : e.length; ++r < i;) if (n(t, e[r])) return !0;
319
+ return !1;
320
+ }
321
+ t.exports = n;
322
+ })), se = /* @__PURE__ */ n(((e, t) => {
323
+ function n(e) {
324
+ return function(t) {
325
+ return e(t);
326
+ };
327
+ }
328
+ t.exports = n;
329
+ })), ce = /* @__PURE__ */ n(((e, t) => {
330
+ function n(e, t) {
331
+ return e.has(t);
332
+ }
333
+ t.exports = n;
334
+ })), le = /* @__PURE__ */ n(((e, t) => {
335
+ var n = U(), r = J(), i = oe(), a = c(), o = se(), s = ce(), l = Math.min;
336
+ function u(e, t, c) {
337
+ for (var u = c ? i : r, d = e[0].length, f = e.length, p = f, m = Array(f), h = Infinity, g = []; p--;) {
338
+ var _ = e[p];
339
+ p && t && (_ = a(_, o(t))), h = l(_.length, h), m[p] = !c && (t || d >= 120 && _.length >= 120) ? new n(p && _) : void 0;
340
+ }
341
+ _ = e[0];
342
+ var v = -1, y = m[0];
343
+ outer: for (; ++v < d && g.length < h;) {
344
+ var b = _[v], x = t ? t(b) : b;
345
+ if (b = c || b !== 0 ? b : 0, !(y ? s(y, x) : u(g, x, c))) {
346
+ for (p = f; --p;) {
347
+ var S = m[p];
348
+ if (!(S ? s(S, x) : u(e[p], x, c))) continue outer;
349
+ }
350
+ y && y.push(x), g.push(b);
351
+ }
352
+ }
353
+ return g;
354
+ }
355
+ t.exports = u;
356
+ })), ue = /* @__PURE__ */ n(((e, t) => {
357
+ function n(e, t, n) {
358
+ switch (n.length) {
359
+ case 0: return e.call(t);
360
+ case 1: return e.call(t, n[0]);
361
+ case 2: return e.call(t, n[0], n[1]);
362
+ case 3: return e.call(t, n[0], n[1], n[2]);
363
+ }
364
+ return e.apply(t, n);
365
+ }
366
+ t.exports = n;
367
+ })), de = /* @__PURE__ */ n(((e, t) => {
368
+ var n = ue(), r = Math.max;
369
+ function i(e, t, i) {
370
+ return t = r(t === void 0 ? e.length - 1 : t, 0), function() {
371
+ for (var a = arguments, o = -1, s = r(a.length - t, 0), c = Array(s); ++o < s;) c[o] = a[t + o];
372
+ o = -1;
373
+ for (var l = Array(t + 1); ++o < t;) l[o] = a[o];
374
+ return l[t] = i(c), n(e, this, l);
375
+ };
376
+ }
377
+ t.exports = i;
378
+ })), fe = /* @__PURE__ */ n(((e, t) => {
379
+ function n(e) {
380
+ return function() {
381
+ return e;
382
+ };
383
+ }
384
+ t.exports = n;
385
+ })), pe = /* @__PURE__ */ n(((e, t) => {
386
+ var n = S();
387
+ t.exports = function() {
388
+ try {
389
+ var e = n(Object, "defineProperty");
390
+ return e({}, "", {}), e;
391
+ } catch {}
392
+ }();
393
+ })), me = /* @__PURE__ */ n(((e, t) => {
394
+ var n = fe(), i = pe(), a = r();
395
+ t.exports = i ? function(e, t) {
396
+ return i(e, "toString", {
397
+ configurable: !0,
398
+ enumerable: !1,
399
+ value: n(t),
400
+ writable: !0
401
+ });
402
+ } : a;
403
+ })), he = /* @__PURE__ */ n(((e, t) => {
404
+ var n = Date.now;
405
+ function r(e) {
406
+ var t = 0, r = 0;
407
+ return function() {
408
+ var i = n(), a = 16 - (i - r);
409
+ if (r = i, a > 0) {
410
+ if (++t >= 800) return arguments[0];
411
+ } else t = 0;
412
+ return e.apply(void 0, arguments);
413
+ };
414
+ }
415
+ t.exports = r;
416
+ })), ge = /* @__PURE__ */ n(((e, t) => {
417
+ var n = me();
418
+ t.exports = he()(n);
419
+ })), _e = /* @__PURE__ */ n(((e, t) => {
420
+ var n = r(), i = de(), a = ge();
421
+ function o(e, t) {
422
+ return a(i(e, t, n), e + "");
423
+ }
424
+ t.exports = o;
425
+ })), ve = /* @__PURE__ */ n(((e, t) => {
426
+ function n(e) {
427
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= 9007199254740991;
428
+ }
429
+ t.exports = n;
430
+ })), ye = /* @__PURE__ */ n(((e, t) => {
431
+ var n = g(), r = ve();
432
+ function i(e) {
433
+ return e != null && r(e.length) && !n(e);
434
+ }
435
+ t.exports = i;
436
+ })), Y = /* @__PURE__ */ n(((e, t) => {
437
+ function n(e) {
438
+ return typeof e == "object" && !!e;
439
+ }
440
+ t.exports = n;
441
+ })), be = /* @__PURE__ */ n(((e, t) => {
442
+ var n = ye(), r = Y();
443
+ function i(e) {
444
+ return r(e) && n(e);
445
+ }
446
+ t.exports = i;
447
+ })), xe = /* @__PURE__ */ n(((e, t) => {
448
+ var n = be();
449
+ function r(e) {
450
+ return n(e) ? e : [];
451
+ }
452
+ t.exports = r;
453
+ })), Se = /* @__PURE__ */ n(((e, t) => {
454
+ var n = c(), r = le(), i = _e(), a = xe();
455
+ t.exports = i(function(e) {
456
+ var t = n(e, a);
457
+ return t.length && t[0] === e[0] ? r(t) : [];
458
+ });
459
+ })), Ce = /* @__PURE__ */ n(((e, t) => {
460
+ function n(e) {
461
+ var t = e == null ? 0 : e.length;
462
+ return t ? e[t - 1] : void 0;
463
+ }
464
+ t.exports = n;
465
+ })), we = /* @__PURE__ */ n(((e, t) => {
466
+ var n = /\s/;
467
+ function r(e) {
468
+ for (var t = e.length; t-- && n.test(e.charAt(t)););
469
+ return t;
470
+ }
471
+ t.exports = r;
472
+ })), Te = /* @__PURE__ */ n(((e, t) => {
473
+ var n = we(), r = /^\s+/;
474
+ function i(e) {
475
+ return e && e.slice(0, n(e) + 1).replace(r, "");
476
+ }
477
+ t.exports = i;
478
+ })), X = /* @__PURE__ */ n(((e, t) => {
479
+ var n = m(), r = Y(), i = "[object Symbol]";
480
+ function a(e) {
481
+ return typeof e == "symbol" || r(e) && n(e) == i;
482
+ }
483
+ t.exports = a;
484
+ })), Z = /* @__PURE__ */ n(((e, t) => {
485
+ var n = Te(), r = h(), i = X(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
486
+ function u(e) {
487
+ if (typeof e == "number") return e;
488
+ if (i(e)) return a;
489
+ if (r(e)) {
490
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
491
+ e = r(t) ? t + "" : t;
492
+ }
493
+ if (typeof e != "string") return e === 0 ? e : +e;
494
+ e = n(e);
495
+ var u = s.test(e);
496
+ return u || c.test(e) ? l(e.slice(2), u ? 2 : 8) : o.test(e) ? a : +e;
497
+ }
498
+ t.exports = u;
499
+ })), Ee = /* @__PURE__ */ n(((e, t) => {
500
+ var n = Z(), r = Infinity, i = 17976931348623157e292;
501
+ function a(e) {
502
+ return e ? (e = n(e), e === r || e === -r ? (e < 0 ? -1 : 1) * i : e === e ? e : 0) : e === 0 ? e : 0;
503
+ }
504
+ t.exports = a;
505
+ })), De = /* @__PURE__ */ n(((e, t) => {
506
+ var n = Ee();
507
+ function r(e) {
508
+ var t = n(e), r = t % 1;
509
+ return t === t ? r ? t - r : t : 0;
510
+ }
511
+ t.exports = r;
512
+ })), Oe = /* @__PURE__ */ n(((e, t) => {
513
+ t.exports = Array.isArray;
514
+ })), ke = /* @__PURE__ */ n(((e, t) => {
515
+ var n = d(), r = c(), i = Oe(), a = X(), o = Infinity, s = n ? n.prototype : void 0, l = s ? s.toString : void 0;
516
+ function u(e) {
517
+ if (typeof e == "string") return e;
518
+ if (i(e)) return r(e, u) + "";
519
+ if (a(e)) return l ? l.call(e) : "";
520
+ var t = e + "";
521
+ return t == "0" && 1 / e == -o ? "-0" : t;
522
+ }
523
+ t.exports = u;
524
+ })), Ae = /* @__PURE__ */ n(((e, t) => {
525
+ var n = ke();
526
+ function r(e) {
527
+ return e == null ? "" : n(e);
528
+ }
529
+ t.exports = r;
530
+ })), je = /* @__PURE__ */ n(((e, t) => {
531
+ var n = u(), r = De(), i = Z(), a = Ae(), o = n.isFinite, s = Math.min;
532
+ function c(e) {
533
+ var t = Math[e];
534
+ return function(e, n) {
535
+ if (e = i(e), n = n == null ? 0 : s(r(n), 292), n && o(e)) {
536
+ var c = (a(e) + "e").split("e");
537
+ return c = (a(t(c[0] + "e" + (+c[1] + n))) + "e").split("e"), +(c[0] + "e" + (+c[1] - n));
538
+ }
539
+ return t(e);
540
+ };
541
+ }
542
+ t.exports = c;
543
+ })), Q = /* @__PURE__ */ n(((e, t) => {
544
+ t.exports = je()("round");
545
+ })), Me = /* @__PURE__ */ e(s(), 1), $ = /* @__PURE__ */ e(Se(), 1), Ne = /* @__PURE__ */ e(Ce(), 1), Pe = /* @__PURE__ */ e(Q(), 1), Fe = class e {
546
+ static assembleTree(t) {
547
+ let { ancestorDotRadius: n, itemHeight: r, leafDotRadius: i, minimumDistancePercentageToShowLabel: a, pixelToGeneticDistanceRatio: o, rootNode: s, sortedLeafNames: c, treeCanvasWidth: l, treePadding: u } = t, d = 0, f = {
548
+ ancestorNodes: [],
549
+ distanceTexts: [],
550
+ horizontalAncestorTreeLines: [],
551
+ horizontalLinePathPropertiesMap: /* @__PURE__ */ new Map(),
552
+ leafNodes: [],
553
+ leafTreeLines: [],
554
+ nodePathPropertiesMap: /* @__PURE__ */ new Map(),
555
+ supportLines: [],
556
+ verticalAncestorTreeLines: [],
557
+ verticalLinePathPropertiesMap: /* @__PURE__ */ new Map()
558
+ }, p = {
559
+ ancestorDotRadius: n,
560
+ itemHeight: r,
561
+ leafDotRadius: i,
562
+ minimumDistancePercentageToShowLabel: a,
563
+ pixelToGeneticDistanceRatio: o,
564
+ rootNode: s,
565
+ treeAssembly: f,
566
+ treeCanvasWidth: l,
567
+ treePadding: u
568
+ }, m = (t, n = 0) => {
569
+ if (!t) return;
570
+ let r = [];
571
+ if (t.children?.forEach((e) => {
572
+ r.push(m(e, n + (t.branchLength?.toNumber() ?? 0)));
573
+ }), !t.children?.length) {
574
+ let r = e.assembleLeafNode(p, t, n, d, c.indexOf(t.name));
575
+ return d++, r;
576
+ }
577
+ return e.assembleAncestorNode(p, t, r);
578
+ };
579
+ return m(s), f;
580
+ }
581
+ static createTreeAddresses(e) {
582
+ let t = {}, n = (e, r = []) => {
583
+ if (t[e.name] = r.join("."), e.children?.length) {
584
+ let t = e.children.some((e) => (e.branchLength?.toNumber() ?? 0) === 0) ? 2 : 1;
585
+ e.children.forEach((e) => {
586
+ (e.branchLength?.toNumber() ?? 0) === 0 ? n(e, [...r, 1]) : (n(e, [...r, t]), t++);
587
+ });
588
+ }
589
+ return e;
590
+ };
591
+ return n(e), t;
592
+ }
593
+ static drawDivider(t) {
594
+ let { canvas: n, devicePixelRatio: r, y: i } = t;
595
+ e.draw(n, r, (e) => {
596
+ e.strokeStyle = "#EEEEEE", e.lineWidth = 1, e.beginPath(), e.moveTo(0, i), e.lineTo(n.width, i), e.stroke();
597
+ });
598
+ }
599
+ static drawGuides(t) {
600
+ let { canvas: n, devicePixelRatio: r, endY: i, geneticTreeWidth: a, horizontalScrollPosition: o = 0, paddingBottom: s = 0, paddingTop: c = 0, pixelToGeneticDistanceRatio: l, regularFillColorSupportLine: u, startY: d, tickerMarkScale: f, treePadding: p, zoomLevel: m } = t, h = n.clientHeight || n.height / r;
601
+ e.draw(n, r, (t) => {
602
+ t.strokeStyle = u, t.setLineDash([3, 1]), e.forEachScaleLine({
603
+ callback: (e) => {
604
+ t.beginPath(), t.moveTo(e, d ?? c), t.lineTo(e, i ?? h - s), t.stroke(), t.closePath();
605
+ },
606
+ devicePixelRatio: r,
607
+ geneticTreeWidth: a,
608
+ horizontalScrollPosition: o,
609
+ pixelToGeneticDistanceRatio: l,
610
+ tickerMarkScale: f,
611
+ treePadding: p,
612
+ zoomLevel: m
613
+ }), t.setLineDash([0, 0]);
614
+ });
615
+ }
616
+ static drawScale(n) {
617
+ let { canvas: r, devicePixelRatio: a, fontFamily: o, geneticTreeWidth: s, headerHeight: c, horizontalScrollPosition: l = 0, pixelToGeneticDistanceRatio: u, scaleColor: d, tickerMarkScale: f, treePadding: p, zoomLevel: m } = n;
618
+ e.draw(r, a, (n) => {
619
+ n.fillStyle = d, e.forEachScaleLine({
620
+ callback: (e, r, a) => {
621
+ n.beginPath(), n.textAlign = "center", n.font = `bold 11px ${o}`;
622
+ let s = new t(f[1]).times(a - 1 - r).toNumber();
623
+ n.fillText(i.toStringWithPrecision(s, f[2]), e, c * .61), n.closePath();
624
+ },
625
+ devicePixelRatio: a,
626
+ geneticTreeWidth: s,
627
+ horizontalScrollPosition: l,
628
+ pixelToGeneticDistanceRatio: u,
629
+ tickerMarkScale: f,
630
+ treePadding: p,
631
+ zoomLevel: m
632
+ });
633
+ });
634
+ }
635
+ static drawTree(t) {
636
+ let { canvas: n, devicePixelRatio: r, dimFn: i, headerHeight: a = 0, highlightedNodeNames: o = [], horizontalScrollPosition: s, isLinked: c, itemHeight: l, nodeNameColors: u, range: d, scrollPosition: f = 0, shouldShowDistances: p, shouldShowSupportLinesWhenUnlinked: m, supportLineColorLinked: h, supportLineColorUnlinked: g, treeAssembly: _, treeColor: v, treeFont: y, verticalScrollPosition: b, zoomLevel: x } = t, S = e.getCanvasContext(n), C = a * r, w = () => {
637
+ S.setTransform(1 / x * r, 0, 0, 1 / x * r, -s + .5, -b + a * r + .5);
638
+ }, T = () => {
639
+ S.setTransform(r, 0, 0, r, -s + .5, a * r + .5);
640
+ }, E = () => {
641
+ w(), S.fillStyle = "black", S.strokeStyle = "black", S.textAlign = "center", S.font = y, S.lineWidth = 1, _.verticalAncestorTreeLines.forEach(({ nodeNames: t, shape: n }) => {
642
+ S.strokeStyle = e.getFillStyle(v, i, o, t), S.stroke(n);
643
+ }), _.horizontalAncestorTreeLines.forEach(({ nodeNames: t, shape: n }) => {
644
+ S.strokeStyle = e.getFillStyle(v, i, o, t), S.stroke(n);
645
+ }), d && _.supportLines.forEach(({ fromX: t, fromY: a, nodeName: u, toX: p, toY: _ }) => {
646
+ let v = n.height - C, y = a / x * r - b, E = y >= 0 && y <= v, D = l > 0 ? Math.floor(_ / l) : -1, O = d && D >= d.startIndex && D <= d.endIndex, k = o.length && o.includes(u);
647
+ !E && !O || !k && !c && !m || (c && S.setLineDash([1, 4]), S.beginPath(), c ? S.strokeStyle = e.getFillStyle(h, i, o, u) : S.strokeStyle = e.getFillStyle(g, i, o, u), S.moveTo(t, a), T(), S.lineTo(p + s / r, _ - f), w(), S.stroke(), S.setLineDash([]));
648
+ }), p && _.distanceTexts.forEach(({ nodeNames: e, text: t, x: n, y: r }) => {
649
+ o.length && (0, $.default)(e, o).length > 0 && (S.fillStyle = v, S.fillText(t, n, r));
650
+ }), _.ancestorNodes.forEach(({ nodeNames: t, shape: n }) => {
651
+ S.fillStyle = e.getFillStyle(v, i, o, t), S.fill(n);
652
+ }), _.leafTreeLines.forEach(({ nodeName: t, shape: n }) => {
653
+ S.strokeStyle = e.getFillStyle(v, i, o, t), S.stroke(n);
654
+ }), _.leafNodes.forEach(({ nodeName: t, shape: n }) => {
655
+ S.fillStyle = e.getFillStyle(u?.[t] ?? v, i, o, t), S.fill(n);
656
+ });
657
+ };
658
+ if (a > 0) {
659
+ S.save(), S.setTransform(1, 0, 0, 1, 0, 0), S.beginPath(), S.rect(0, C, n.width, Math.max(0, n.height - C)), S.clip(), E(), S.restore(), w();
660
+ return;
661
+ }
662
+ E();
663
+ }
664
+ static drawTreeCanvas(t) {
665
+ let { backgroundColor: n, canvas: r, devicePixelRatio: i, dimFn: a, fontFamily: o, geneticTreeWidth: s, headerHeight: c = 0, highlightedNodeNames: l, horizontalScrollPosition: u, isLinked: d, itemHeight: f, nodeNameColors: p, pixelToGeneticDistanceRatio: m, range: h, regularFillColorSupportLine: g, scaleColor: _, scrollPosition: v = 0, shouldShowDistances: y, shouldShowSupportLinesWhenUnlinked: b, supportLineColorLinked: x, supportLineColorUnlinked: S, tickerMarkScale: C, treeAssembly: w, treeCanvasHeight: T, treeCanvasWidth: E, treeColor: D, treeFont: O, treePadding: k, verticalScrollPosition: A, zoomLevel: j } = t, M = e.getCanvasContext(r);
666
+ M.reset(), r.width = r.clientWidth * i, r.height = r.clientHeight * i, M.imageSmoothingEnabled = j > 1, M.imageSmoothingQuality = "high", e.drawBackground({
667
+ backgroundColor: n,
668
+ canvas: r,
669
+ devicePixelRatio: i,
670
+ treeCanvasHeight: T + c,
671
+ treeCanvasWidth: E
672
+ }), e.drawGuides({
673
+ canvas: r,
674
+ devicePixelRatio: i,
675
+ endY: c + T,
676
+ geneticTreeWidth: s,
677
+ horizontalScrollPosition: u,
678
+ pixelToGeneticDistanceRatio: m,
679
+ regularFillColorSupportLine: g,
680
+ startY: c,
681
+ tickerMarkScale: C,
682
+ treePadding: k,
683
+ zoomLevel: j
684
+ }), c > 0 && (e.drawGuides({
685
+ canvas: r,
686
+ devicePixelRatio: i,
687
+ endY: c,
688
+ geneticTreeWidth: s,
689
+ horizontalScrollPosition: u,
690
+ pixelToGeneticDistanceRatio: m,
691
+ regularFillColorSupportLine: g,
692
+ startY: c * .7,
693
+ tickerMarkScale: C,
694
+ treePadding: k,
695
+ zoomLevel: j
696
+ }), e.drawGuides({
697
+ canvas: r,
698
+ devicePixelRatio: i,
699
+ endY: c * .3,
700
+ geneticTreeWidth: s,
701
+ horizontalScrollPosition: u,
702
+ pixelToGeneticDistanceRatio: m,
703
+ regularFillColorSupportLine: g,
704
+ startY: 0,
705
+ tickerMarkScale: C,
706
+ treePadding: k,
707
+ zoomLevel: j
708
+ }), e.drawScale({
709
+ canvas: r,
710
+ devicePixelRatio: i,
711
+ fontFamily: o,
712
+ geneticTreeWidth: s,
713
+ headerHeight: c,
714
+ horizontalScrollPosition: u,
715
+ pixelToGeneticDistanceRatio: m,
716
+ scaleColor: _,
717
+ tickerMarkScale: C,
718
+ treePadding: k,
719
+ zoomLevel: j
720
+ }), e.drawDivider({
721
+ canvas: r,
722
+ devicePixelRatio: i,
723
+ y: 0
724
+ }), e.drawDivider({
725
+ canvas: r,
726
+ devicePixelRatio: i,
727
+ y: c - 1
728
+ })), e.drawTree({
729
+ canvas: r,
730
+ devicePixelRatio: i,
731
+ dimFn: a,
732
+ headerHeight: c,
733
+ highlightedNodeNames: l,
734
+ horizontalScrollPosition: u,
735
+ isLinked: d,
736
+ itemHeight: f,
737
+ nodeNameColors: p,
738
+ range: h,
739
+ scrollPosition: v,
740
+ shouldShowDistances: y,
741
+ shouldShowSupportLinesWhenUnlinked: b,
742
+ supportLineColorLinked: x,
743
+ supportLineColorUnlinked: S,
744
+ treeAssembly: w,
745
+ treeColor: D,
746
+ treeFont: O,
747
+ verticalScrollPosition: A,
748
+ zoomLevel: j
749
+ });
750
+ }
751
+ static findNewTreeRoot(e, n, r) {
752
+ let i, a = (e) => {
753
+ if (!i && (r === "node" && e.name === n && (i = e), e.children)) {
754
+ let t = e.children.find((e) => e.name === n);
755
+ r === "parent" && t ? i = e : e.children.forEach((e) => a(e));
756
+ }
757
+ };
758
+ return a(e), {
759
+ ...i,
760
+ branchLength: new t(0),
761
+ maxBranchLength: i.maxBranchLength.sub(i.branchLength)
762
+ };
763
+ }
764
+ static getMinGeneticScaleUnit(e) {
765
+ if (!e) return Infinity;
766
+ let t = Infinity, n = (e) => {
767
+ let r = e.branchLength?.toNumber() ?? 0;
768
+ !e.children?.length && r && r < t && (t = r), e?.children?.forEach((e) => n(e));
769
+ };
770
+ return n(e), t;
771
+ }
772
+ static getNewScrollPositionForZoomLevel(e) {
773
+ let { currentZoomLevel: t, dimensionSize: n, eventOffset: r, newZoomLevel: i, scrollPosition: a } = e, o = (r * devicePixelRatio + a) * t;
774
+ return a - (o / (n / (n / t)) - o / (n / (n / i)));
775
+ }
776
+ static getPathPropertiesFromCanvas(t) {
777
+ let { canvas: n, devicePixelRatio: r, event: i, treeAssembly: a } = t, o = e.getCanvasContext(n), s = i.target.getBoundingClientRect(), c = (i.clientX - s.left) * r, l = (i.clientY - s.top) * r;
778
+ for (let e of a.nodePathPropertiesMap.keys()) if (o.isPointInPath(e, c, l)) return a.nodePathPropertiesMap.get(e);
779
+ let u = [
780
+ (i.clientY - 1 - s.top) * r,
781
+ l,
782
+ (i.clientY + 1 - s.top) * r
783
+ ];
784
+ for (let e of a.horizontalLinePathPropertiesMap.keys()) for (let t of u) if (o.isPointInStroke(e, c, t)) return a.horizontalLinePathPropertiesMap.get(e);
785
+ let d = [
786
+ (i.clientX - 1 - s.left) * r,
787
+ c,
788
+ (i.clientX + 1 - s.left) * r
789
+ ];
790
+ for (let e of a.verticalLinePathPropertiesMap.keys()) for (let t of d) if (o.isPointInStroke(e, t, l)) return a.verticalLinePathPropertiesMap.get(e);
791
+ }
792
+ static getSanitizedScrollPosition(e) {
793
+ let { devicePixelRatio: t, headerHeight: n, internalZoomLevel: r, isLinked: i, positionX: a, positionY: o, treeCanvasHeight: s, treeCanvasWidth: c, treeHeight: l, treePadding: u } = e, d, f, p = u * t;
794
+ if (i && r === 1) if (l < s) f = 0, d = 0;
795
+ else {
796
+ let e = Math.round(t * 100) / 100, n = [
797
+ [1, 0],
798
+ [1.1, 1],
799
+ [1.25, 4],
800
+ [1.5, 7],
801
+ [1.75, 11],
802
+ [2, 0],
803
+ [2.2, 4],
804
+ [2.5, 7],
805
+ [3, 15]
806
+ ].find(([t]) => e <= t)?.[1] ?? 0;
807
+ f = 0, d = l * t - s * t - n;
808
+ }
809
+ else f = -s * t + p + n * t, d = l / r * t - p - n * t;
810
+ let m = Math.max(Math.min(d, o), f), h = Math.min(0, -c + 2 * p), g = Math.max(0, c / r * t - 2 * p);
811
+ return {
812
+ newPositionX: Math.max(Math.min(g, a), h),
813
+ newPositionY: m
814
+ };
815
+ }
816
+ static getScrollPositionFromTreeVisibility(e) {
817
+ let { itemHeight: t, treeCanvasHeight: n, treeHeight: r, treeSize: i, verticalScrollPosition: a, zoomLevel: o } = e, s = t / o, c = Math.round(a / s), l = Math.round(n / s), u = (Math.max(0, c) + Math.min(c + l, i)) / 2;
818
+ return Math.max(0, Math.min(r - n, u * t - n / 2));
819
+ }
820
+ static getTickMarkScale(e) {
821
+ let { geneticTreeWidth: n, maxScaleWidthPx: r, minGeneticScaleUnit: i, minScaleWidthPx: a, scaleIncrements: o, treeWidthMinusPadding: s, zoomLevel: c } = e;
822
+ if (!s || !n || !i) return [
823
+ 0,
824
+ 0,
825
+ 0
826
+ ];
827
+ let l = s / c, u = Math.floor(l / r) + 1, d = Math.ceil(l / a) + 1;
828
+ if (n.div(i).add(1).lessThan(d) && (d = Math.max(n.div(i).ceil().toNumber(), 2)), u > d && (u = d), d === 2) return [
829
+ 2,
830
+ i,
831
+ i
832
+ ];
833
+ let f = new t(n), p = new t(10).pow(f.log(10).floor().minus(1)), m = o.map((e) => new t(e).times(p)), h = [
834
+ new t(0),
835
+ new t(0),
836
+ new t(Infinity)
837
+ ];
838
+ for (let e = u; e <= d; e++) for (let n of m) {
839
+ if (n.lt(i)) continue;
840
+ let r = n.times(e).minus(f).abs();
841
+ r.lt(h[2]) && (h = [
842
+ t(e),
843
+ n,
844
+ r
845
+ ]);
846
+ }
847
+ return [
848
+ h[0].add(1).toNumber(),
849
+ h[1].toNumber(),
850
+ i
851
+ ];
852
+ }
853
+ static sanitizeTree(e, n) {
854
+ let r = (e) => {
855
+ let t = [];
856
+ if (e.children?.forEach((e) => {
857
+ t.push(r(e));
858
+ }), t.filter((e) => !!e).forEach((t) => {
859
+ e.children.splice(e.children.indexOf(t.node), +(t.node.children.length === t.nodesToMove.length), ...t.nodesToMove), e.subTreeNames.splice(e.subTreeNames.indexOf(t.node.name), +(t.node.children.length === t.nodesToMove.length), ...t.nodesToMove.map((e) => e.subTreeNames).flat());
860
+ }), e.children?.length) {
861
+ let t = [];
862
+ return e.children.forEach((n) => {
863
+ (e.branchLength?.toNumber() ?? 0) === 0 && t.push(n);
864
+ }), {
865
+ node: e,
866
+ nodesToMove: t
867
+ };
868
+ }
869
+ return null;
870
+ };
871
+ return r(e), (e.children?.every((e) => (e.branchLength?.toNumber() ?? 0) === 0) ?? !1) && e.children?.length ? (e.name = `Generated-${a.createHash(e.subTreeNames.join(","))}`, {
872
+ branchLength: new t(n),
873
+ children: [e],
874
+ maxBranchLength: new t(n),
875
+ name: "root",
876
+ size: e.size,
877
+ subTreeLeaveNames: e.subTreeLeaveNames,
878
+ subTreeNames: [e.name, ...e.subTreeNames]
879
+ }) : e;
880
+ }
881
+ static assembleAncestorNode(t, n, r) {
882
+ let i = (0, Me.default)(r), a = (0, Ne.default)(r), o = i.x, s = o - (n.branchLength?.toNumber() ?? 0) * t.pixelToGeneticDistanceRatio, c = (i.y + a.y) / 2, l = r.map((e) => e.nodeNames).flat(), u = e.getDistanceLabel(t, n.branchLength);
883
+ [r.filter((e) => e.y < c).sort((e, t) => e.y - t.y), r.filter((e) => e.y > c).sort((e, t) => t.y - e.y)].forEach((e) => {
884
+ let n = [];
885
+ e.forEach((r, i) => {
886
+ let a = i === e.length - 1 ? c : e[i + 1].y;
887
+ n.push(...r.nodeNames);
888
+ let o = new Path2D();
889
+ o.moveTo(r.x, r.y), o.lineTo(r.x, a), o.closePath(), t.treeAssembly.verticalAncestorTreeLines.push({
890
+ nodeNames: [...n],
891
+ shape: o
892
+ }), t.treeAssembly.verticalLinePathPropertiesMap.set(o, { subTreeLeaveNames: n });
893
+ });
894
+ });
895
+ let d = new Path2D();
896
+ if (d.moveTo(s - .5, c), d.lineTo(o + .5, c), d.closePath(), t.treeAssembly.horizontalAncestorTreeLines.push({
897
+ nodeNames: [n.name, ...l],
898
+ shape: d
899
+ }), t.treeAssembly.horizontalLinePathPropertiesMap.set(d, { subTreeLeaveNames: l }), u && t.treeAssembly.distanceTexts.push({
900
+ nodeNames: [n.name, ...l],
901
+ text: u,
902
+ x: (s + o) / 2,
903
+ y: c + 12
904
+ }), n.children.every((e) => (e.branchLength?.toNumber() ?? 0) > 0)) {
905
+ let e = new Path2D();
906
+ e.arc(o, c, t.ancestorDotRadius, 0, 2 * Math.PI, !1), t.treeAssembly.ancestorNodes.push({
907
+ nodeNames: [n.name, ...l],
908
+ shape: e
909
+ }), t.treeAssembly.nodePathPropertiesMap.set(e, {
910
+ subTreeLeaveNames: n.subTreeLeaveNames,
911
+ treeNode: n
912
+ });
913
+ }
914
+ return {
915
+ nodeNames: l,
916
+ x: s,
917
+ y: c
918
+ };
919
+ }
920
+ static assembleLeafNode(t, n, r = 0, i = 0, a = 0) {
921
+ let o = (r + (n.branchLength?.toNumber() ?? 0)) * t.pixelToGeneticDistanceRatio + t.treePadding, s = i * t.itemHeight + t.itemHeight / 2, c = o - (n.branchLength?.toNumber() ?? 0) * t.pixelToGeneticDistanceRatio, l = e.getDistanceLabel(t, n.branchLength), u = new Path2D();
922
+ u.moveTo(c - .5, s), u.lineTo(o, s), u.closePath(), t.treeAssembly.leafTreeLines.push({
923
+ nodeName: n.name,
924
+ shape: u
925
+ }), t.treeAssembly.horizontalLinePathPropertiesMap.set(u, { subTreeLeaveNames: n.subTreeLeaveNames }), l && t.treeAssembly.distanceTexts.push({
926
+ nodeNames: [n.name],
927
+ text: l,
928
+ x: (c + o) / 2,
929
+ y: s + 12
930
+ });
931
+ let d = a * t.itemHeight + t.itemHeight / 2;
932
+ t.treeAssembly.supportLines.push({
933
+ fromX: o,
934
+ fromY: s,
935
+ nodeName: n.name,
936
+ toX: t.treeCanvasWidth,
937
+ toY: d
938
+ });
939
+ let f = new Path2D();
940
+ return f.arc(o, s, t.leafDotRadius, 0, 2 * Math.PI, !1), f.closePath(), t.treeAssembly.nodePathPropertiesMap.set(f, {
941
+ subTreeLeaveNames: n.subTreeLeaveNames,
942
+ treeNode: n
943
+ }), t.treeAssembly.leafNodes.push({
944
+ nodeName: n.name,
945
+ shape: f
946
+ }), {
947
+ nodeNames: [n.name],
948
+ x: c,
949
+ y: s
950
+ };
951
+ }
952
+ static draw(t, n, r) {
953
+ let i = e.getCanvasContext(t);
954
+ i.scale(n, n), i.translate(.5, .5), r(i), i.translate(-.5, -.5), i.scale(1 / n, 1 / n);
955
+ }
956
+ static drawBackground(t) {
957
+ let { backgroundColor: n, canvas: r, devicePixelRatio: i, treeCanvasHeight: a, treeCanvasWidth: o } = t;
958
+ e.draw(r, i, (e) => {
959
+ e.fillStyle = n, e.fillRect(0, 0, o, a);
960
+ });
961
+ }
962
+ static forEachScaleLine(e) {
963
+ let { callback: n, devicePixelRatio: r, geneticTreeWidth: i, horizontalScrollPosition: a = 0, pixelToGeneticDistanceRatio: o, tickerMarkScale: s, treePadding: c, zoomLevel: l } = e, u = s[0], d = s[1], f = new t(d).times(o).div(l), p = f.times(u - 1), m = i.times(o).div(l), h = p.minus(m);
964
+ for (let e = 0; e < u; e++) n(new t(e).times(f).plus(new t(c).div(l)).minus(h).minus(new t(a).div(r)).toNumber(), e, u);
965
+ }
966
+ static getCanvasContext(e) {
967
+ let t = e.getContext("2d");
968
+ if (!t) throw Error("Failed to acquire 2D canvas context.");
969
+ return t;
970
+ }
971
+ static getDistanceLabel(e, t) {
972
+ let n = e.rootNode.maxBranchLength ? Math.max(1, 4 - String(Math.round(e.rootNode.maxBranchLength.toNumber())).length) : null;
973
+ return !e.rootNode.maxBranchLength || e.rootNode.maxBranchLength.toNumber() === 0 || !t || t.toNumber() === 0 || t.div(e.rootNode.maxBranchLength).mul(100).lessThan(e.minimumDistancePercentageToShowLabel) ? null : String((0, Pe.default)(t.toNumber(), n));
974
+ }
975
+ static getFillStyle(e, t, n, r) {
976
+ if (n.length) {
977
+ let i;
978
+ return i = Array.isArray(r) ? (0, $.default)(r, n).length > 0 : n.includes(r), i ? e : t(e);
979
+ }
980
+ return e;
981
+ }
982
+ };
983
+ //#endregion
984
+ export { Fe as TreeUtil };
985
+
986
+ //# sourceMappingURL=index.js.map