chrono-phylo-tree 1.1.8 → 1.1.10

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,1551 @@
1
+ import Pt, { useState as X, useEffect as Ot } from "react";
2
+ const Lt = (s, ...r) => s.sort(
3
+ (u, a) => {
4
+ for (const c of r) {
5
+ const [f, h] = [u, a].map((b) => c(b));
6
+ if (f !== h) return f - h;
7
+ }
8
+ return 0;
9
+ }
10
+ );
11
+ class yt {
12
+ constructor(r = "", u = 0, a = 0, c = void 0, f = [], h = void 0, b = void 0) {
13
+ if (this.name = "", this.apparition = 0, this.duration = 0, this.ancestor = void 0, this.descendants = [], this.description = void 0, this.display = !0, this.image = void 0, a <= 0)
14
+ throw new Error("The duration of the species must be greater than 0");
15
+ this.name = r, this.apparition = u, this.duration = a, this.ancestor = c, this.descendants = f, this.description = h === "" ? void 0 : h, this.image = b === "" ? void 0 : b;
16
+ }
17
+ onPosition(r = !0) {
18
+ return r && this.firstAncestor().stepsUntil(this) % 2 === 0;
19
+ }
20
+ copy() {
21
+ const r = this.firstAncestor(), u = r.allDescendants(!1).indexOf(this);
22
+ return yt.fromJSON(r.toJSON()).allDescendants(!1)[u];
23
+ }
24
+ unlinkAncestor() {
25
+ if (!this.ancestor)
26
+ return;
27
+ this.ancestor.descendants = this.ancestor.descendants.filter((u) => u !== this);
28
+ const r = this.ancestor;
29
+ return this.ancestor = void 0, [r.firstAncestor(), this];
30
+ }
31
+ unlinkDescendant(r) {
32
+ if (this.descendants.includes(r))
33
+ return this.descendants = this.descendants.filter((u) => u !== r), r.ancestor = void 0, [this.firstAncestor(), r];
34
+ }
35
+ linkAncestor(r) {
36
+ if (!(this.ancestor === r && r.descendants.includes(this))) {
37
+ if (r.apparition > this.apparition)
38
+ throw new Error(`The ancestor's apparition (${r.apparition}) must be before or equal the descendant's apparition (${this.apparition})`);
39
+ if (r.extinction() < this.apparition)
40
+ throw new Error(`The ancestor's extinction (${r.extinction()}) must be after or equal the descendant's apparition (${this.apparition})`);
41
+ this.ancestor !== r && this.unlinkAncestor(), this.ancestor = r, r.descendants.push(this);
42
+ }
43
+ }
44
+ linkDescendant(r) {
45
+ if (!(r.ancestor === this && this.descendants.includes(r))) {
46
+ if (r.apparition < this.apparition)
47
+ throw new Error(`The descendant's apparition (${r.apparition}) must be after or equal the ancestor's apparition (${this.apparition})`);
48
+ if (r.extinction() > this.extinction())
49
+ throw new Error(`The descendant's extinction (${r.extinction()}) must be before or equal the ancestor's extinction (${this.extinction()})`);
50
+ this.descendants.includes(r) || (r.ancestor && r.unlinkAncestor(), this.descendants.push(r), r.ancestor = this);
51
+ }
52
+ }
53
+ linkDescendants(r) {
54
+ for (const u of r)
55
+ try {
56
+ this.linkDescendant(u);
57
+ } catch (a) {
58
+ console.error(`Error linking descendant ${u.name} to ancestor ${this.name}:`, a);
59
+ }
60
+ }
61
+ addDescendant(r = "", u = 0, a = 0, c = void 0, f = void 0, h = !1) {
62
+ if (u < 0 || u > this.duration)
63
+ throw new Error(`The apparition of the descendant must be between the apparition (${this.apparition}) and the extinction (${this.extinction()}) of the ancestor`);
64
+ const b = h ? this.copy() : this, j = new yt(
65
+ r,
66
+ b.apparition + Math.max(u, 0),
67
+ Math.max(a, 0),
68
+ void 0,
69
+ [],
70
+ c,
71
+ f
72
+ );
73
+ return j.linkAncestor(b), h ? b : j;
74
+ }
75
+ removeDescendant(r) {
76
+ this.descendants = this.descendants.filter((u) => u !== r);
77
+ }
78
+ addAncestor(r = "", u = 0, a = 0, c = void 0, f = void 0, h = !0, b = !1) {
79
+ if (u < 0)
80
+ throw new Error(`The apparition of the ancestor must be before or equal the apparition (${this.apparition}) of the descendant`);
81
+ if (a < u)
82
+ throw new Error(`The extiction of the ancestor must be after or equal the apparition (${this.apparition}) of the descendant`);
83
+ const j = b ? this.copy() : this, o = new yt(
84
+ r,
85
+ j.apparition - Math.max(u, 0),
86
+ a,
87
+ void 0,
88
+ [],
89
+ c,
90
+ f
91
+ );
92
+ return o.display = h, j.linkAncestor(o), b ? j : o;
93
+ }
94
+ extinction() {
95
+ return this.apparition + this.duration;
96
+ }
97
+ absoluteExtinction() {
98
+ return this.descendants.length > 0 ? Math.max(...this.allDescendants(!1).map((r) => r.extinction())) : this.extinction();
99
+ }
100
+ absoluteDuration() {
101
+ return this.absoluteExtinction() - this.apparition;
102
+ }
103
+ firstAncestor(r = !1) {
104
+ return this.ancestor ? this.ancestor.display || r ? this.ancestor.firstAncestor() : this : this;
105
+ }
106
+ cousinsExtinction() {
107
+ return this.firstAncestor().absoluteExtinction();
108
+ }
109
+ allDescendants(r = !0) {
110
+ const u = r ? Lt(this.descendants, (o) => -o.apparition, (o) => -o.absoluteExtinction()) : this.descendants;
111
+ if (u.length === 0)
112
+ return [this];
113
+ const a = u.filter((o) => o.apparition >= this.extinction()), c = u.filter((o) => a.indexOf(o) === -1), h = (this.onPosition(r) ? Math.ceil : Math.floor)(a.length / 2), b = a.slice(0, h), j = a.slice(h);
114
+ return b.flatMap((o) => o.allDescendants(r)).concat([this]).concat(j.flatMap((o) => o.allDescendants(r))).concat(c.flatMap((o) => o.allDescendants(r)));
115
+ }
116
+ stepsChain(r, u = !1) {
117
+ var a;
118
+ return this.allDescendants(!1).includes(r) ? [this].concat(((a = this.descendants.find((c) => c.allDescendants(!1).includes(r))) == null ? void 0 : a.stepsChain(r)) ?? []).filter((c) => c.display || u) : [];
119
+ }
120
+ stepsUntil(r, u = !1) {
121
+ if (this.allDescendants(!1).includes(r))
122
+ return this.stepsChain(r, u).length - 1;
123
+ }
124
+ stepsUntilLastDescendant(r = !1) {
125
+ return this.descendants.length === 0 ? 0 : Math.max(...this.allDescendants(!1).filter((u) => u.descendants.length === 0).map((u) => this.stepsUntil(u, r) ?? 0));
126
+ }
127
+ toJSON() {
128
+ return {
129
+ name: this.name,
130
+ apparition: this.ancestor ? void 0 : this.apparition,
131
+ afterApparition: this.ancestor ? this.apparition - this.ancestor.apparition : void 0,
132
+ description: this.description,
133
+ duration: this.duration,
134
+ descendants: this.descendants.length > 0 ? this.descendants.map((r) => r.toJSON()) : void 0,
135
+ image: this.image
136
+ };
137
+ }
138
+ async saveJSON(r = void 0) {
139
+ try {
140
+ const u = JSON.stringify(this.toJSON(), null, 2), a = new Blob([u], { type: "application/json" }), c = URL.createObjectURL(a), f = document.createElement("a");
141
+ f.href = c, f.download = r ?? `${this.name}.json`, f.click(), URL.revokeObjectURL(c);
142
+ } catch (u) {
143
+ console.error("Error saving file:", u);
144
+ }
145
+ }
146
+ static fromJSON(r, u) {
147
+ const a = r.afterApparition ?? 0, c = u ? u.apparition : r.apparition ?? 0, f = new yt(r.name ?? "", c + a, r.duration ?? 0, u, [], r.description, r.image);
148
+ if (r.descendants)
149
+ for (const h of r.descendants)
150
+ f.descendants.push(yt.fromJSON(h, f));
151
+ return f;
152
+ }
153
+ }
154
+ function It(s) {
155
+ return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
156
+ }
157
+ var kt = { exports: {} }, Et = {};
158
+ /**
159
+ * @license React
160
+ * react-jsx-runtime.production.js
161
+ *
162
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
163
+ *
164
+ * This source code is licensed under the MIT license found in the
165
+ * LICENSE file in the root directory of this source tree.
166
+ */
167
+ var Ct;
168
+ function Ft() {
169
+ if (Ct) return Et;
170
+ Ct = 1;
171
+ var s = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
172
+ function u(a, c, f) {
173
+ var h = null;
174
+ if (f !== void 0 && (h = "" + f), c.key !== void 0 && (h = "" + c.key), "key" in c) {
175
+ f = {};
176
+ for (var b in c)
177
+ b !== "key" && (f[b] = c[b]);
178
+ } else f = c;
179
+ return c = f.ref, {
180
+ $$typeof: s,
181
+ type: a,
182
+ key: h,
183
+ ref: c !== void 0 ? c : null,
184
+ props: f
185
+ };
186
+ }
187
+ return Et.Fragment = r, Et.jsx = u, Et.jsxs = u, Et;
188
+ }
189
+ var wt = {};
190
+ /**
191
+ * @license React
192
+ * react-jsx-runtime.development.js
193
+ *
194
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
195
+ *
196
+ * This source code is licensed under the MIT license found in the
197
+ * LICENSE file in the root directory of this source tree.
198
+ */
199
+ var At;
200
+ function Ut() {
201
+ return At || (At = 1, process.env.NODE_ENV !== "production" && function() {
202
+ function s(t) {
203
+ if (t == null) return null;
204
+ if (typeof t == "function")
205
+ return t.$$typeof === K ? null : t.displayName || t.name || null;
206
+ if (typeof t == "string") return t;
207
+ switch (t) {
208
+ case Z:
209
+ return "Fragment";
210
+ case ot:
211
+ return "Portal";
212
+ case e:
213
+ return "Profiler";
214
+ case x:
215
+ return "StrictMode";
216
+ case g:
217
+ return "Suspense";
218
+ case C:
219
+ return "SuspenseList";
220
+ }
221
+ if (typeof t == "object")
222
+ switch (typeof t.tag == "number" && console.error(
223
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
224
+ ), t.$$typeof) {
225
+ case i:
226
+ return (t.displayName || "Context") + ".Provider";
227
+ case n:
228
+ return (t._context.displayName || "Context") + ".Consumer";
229
+ case p:
230
+ var l = t.render;
231
+ return t = t.displayName, t || (t = l.displayName || l.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
232
+ case V:
233
+ return l = t.displayName || null, l !== null ? l : s(t.type) || "Memo";
234
+ case lt:
235
+ l = t._payload, t = t._init;
236
+ try {
237
+ return s(t(l));
238
+ } catch {
239
+ }
240
+ }
241
+ return null;
242
+ }
243
+ function r(t) {
244
+ return "" + t;
245
+ }
246
+ function u(t) {
247
+ try {
248
+ r(t);
249
+ var l = !1;
250
+ } catch {
251
+ l = !0;
252
+ }
253
+ if (l) {
254
+ l = console;
255
+ var m = l.error, w = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
256
+ return m.call(
257
+ l,
258
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
259
+ w
260
+ ), r(t);
261
+ }
262
+ }
263
+ function a() {
264
+ }
265
+ function c() {
266
+ if (B === 0) {
267
+ G = console.log, et = console.info, dt = console.warn, D = console.error, I = console.group, H = console.groupCollapsed, k = console.groupEnd;
268
+ var t = {
269
+ configurable: !0,
270
+ enumerable: !0,
271
+ value: a,
272
+ writable: !0
273
+ };
274
+ Object.defineProperties(console, {
275
+ info: t,
276
+ log: t,
277
+ warn: t,
278
+ error: t,
279
+ group: t,
280
+ groupCollapsed: t,
281
+ groupEnd: t
282
+ });
283
+ }
284
+ B++;
285
+ }
286
+ function f() {
287
+ if (B--, B === 0) {
288
+ var t = { configurable: !0, enumerable: !0, writable: !0 };
289
+ Object.defineProperties(console, {
290
+ log: E({}, t, { value: G }),
291
+ info: E({}, t, { value: et }),
292
+ warn: E({}, t, { value: dt }),
293
+ error: E({}, t, { value: D }),
294
+ group: E({}, t, { value: I }),
295
+ groupCollapsed: E({}, t, { value: H }),
296
+ groupEnd: E({}, t, { value: k })
297
+ });
298
+ }
299
+ 0 > B && console.error(
300
+ "disabledDepth fell below zero. This is a bug in React. Please file an issue."
301
+ );
302
+ }
303
+ function h(t) {
304
+ if (Y === void 0)
305
+ try {
306
+ throw Error();
307
+ } catch (m) {
308
+ var l = m.stack.trim().match(/\n( *(at )?)/);
309
+ Y = l && l[1] || "", tt = -1 < m.stack.indexOf(`
310
+ at`) ? " (<anonymous>)" : -1 < m.stack.indexOf("@") ? "@unknown:0:0" : "";
311
+ }
312
+ return `
313
+ ` + Y + t + tt;
314
+ }
315
+ function b(t, l) {
316
+ if (!t || $) return "";
317
+ var m = q.get(t);
318
+ if (m !== void 0) return m;
319
+ $ = !0, m = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
320
+ var w = null;
321
+ w = y.H, y.H = null, c();
322
+ try {
323
+ var W = {
324
+ DetermineComponentFrameRoot: function() {
325
+ try {
326
+ if (l) {
327
+ var gt = function() {
328
+ throw Error();
329
+ };
330
+ if (Object.defineProperty(gt.prototype, "props", {
331
+ set: function() {
332
+ throw Error();
333
+ }
334
+ }), typeof Reflect == "object" && Reflect.construct) {
335
+ try {
336
+ Reflect.construct(gt, []);
337
+ } catch (bt) {
338
+ var xt = bt;
339
+ }
340
+ Reflect.construct(t, [], gt);
341
+ } else {
342
+ try {
343
+ gt.call();
344
+ } catch (bt) {
345
+ xt = bt;
346
+ }
347
+ t.call(gt.prototype);
348
+ }
349
+ } else {
350
+ try {
351
+ throw Error();
352
+ } catch (bt) {
353
+ xt = bt;
354
+ }
355
+ (gt = t()) && typeof gt.catch == "function" && gt.catch(function() {
356
+ });
357
+ }
358
+ } catch (bt) {
359
+ if (bt && xt && typeof bt.stack == "string")
360
+ return [bt.stack, xt.stack];
361
+ }
362
+ return [null, null];
363
+ }
364
+ };
365
+ W.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
366
+ var S = Object.getOwnPropertyDescriptor(
367
+ W.DetermineComponentFrameRoot,
368
+ "name"
369
+ );
370
+ S && S.configurable && Object.defineProperty(
371
+ W.DetermineComponentFrameRoot,
372
+ "name",
373
+ { value: "DetermineComponentFrameRoot" }
374
+ );
375
+ var _ = W.DetermineComponentFrameRoot(), it = _[0], _t = _[1];
376
+ if (it && _t) {
377
+ var at = it.split(`
378
+ `), pt = _t.split(`
379
+ `);
380
+ for (_ = S = 0; S < at.length && !at[S].includes(
381
+ "DetermineComponentFrameRoot"
382
+ ); )
383
+ S++;
384
+ for (; _ < pt.length && !pt[_].includes(
385
+ "DetermineComponentFrameRoot"
386
+ ); )
387
+ _++;
388
+ if (S === at.length || _ === pt.length)
389
+ for (S = at.length - 1, _ = pt.length - 1; 1 <= S && 0 <= _ && at[S] !== pt[_]; )
390
+ _--;
391
+ for (; 1 <= S && 0 <= _; S--, _--)
392
+ if (at[S] !== pt[_]) {
393
+ if (S !== 1 || _ !== 1)
394
+ do
395
+ if (S--, _--, 0 > _ || at[S] !== pt[_]) {
396
+ var ct = `
397
+ ` + at[S].replace(
398
+ " at new ",
399
+ " at "
400
+ );
401
+ return t.displayName && ct.includes("<anonymous>") && (ct = ct.replace("<anonymous>", t.displayName)), typeof t == "function" && q.set(t, ct), ct;
402
+ }
403
+ while (1 <= S && 0 <= _);
404
+ break;
405
+ }
406
+ }
407
+ } finally {
408
+ $ = !1, y.H = w, f(), Error.prepareStackTrace = m;
409
+ }
410
+ return at = (at = t ? t.displayName || t.name : "") ? h(at) : "", typeof t == "function" && q.set(t, at), at;
411
+ }
412
+ function j(t) {
413
+ if (t == null) return "";
414
+ if (typeof t == "function") {
415
+ var l = t.prototype;
416
+ return b(
417
+ t,
418
+ !(!l || !l.isReactComponent)
419
+ );
420
+ }
421
+ if (typeof t == "string") return h(t);
422
+ switch (t) {
423
+ case g:
424
+ return h("Suspense");
425
+ case C:
426
+ return h("SuspenseList");
427
+ }
428
+ if (typeof t == "object")
429
+ switch (t.$$typeof) {
430
+ case p:
431
+ return t = b(t.render, !1), t;
432
+ case V:
433
+ return j(t.type);
434
+ case lt:
435
+ l = t._payload, t = t._init;
436
+ try {
437
+ return j(t(l));
438
+ } catch {
439
+ }
440
+ }
441
+ return "";
442
+ }
443
+ function o() {
444
+ var t = y.A;
445
+ return t === null ? null : t.getOwner();
446
+ }
447
+ function R(t) {
448
+ if (rt.call(t, "key")) {
449
+ var l = Object.getOwnPropertyDescriptor(t, "key").get;
450
+ if (l && l.isReactWarning) return !1;
451
+ }
452
+ return t.key !== void 0;
453
+ }
454
+ function T(t, l) {
455
+ function m() {
456
+ ht || (ht = !0, console.error(
457
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
458
+ l
459
+ ));
460
+ }
461
+ m.isReactWarning = !0, Object.defineProperty(t, "key", {
462
+ get: m,
463
+ configurable: !0
464
+ });
465
+ }
466
+ function L() {
467
+ var t = s(this.type);
468
+ return O[t] || (O[t] = !0, console.error(
469
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
470
+ )), t = this.props.ref, t !== void 0 ? t : null;
471
+ }
472
+ function U(t, l, m, w, W, S) {
473
+ return m = S.ref, t = {
474
+ $$typeof: ut,
475
+ type: t,
476
+ key: l,
477
+ props: S,
478
+ _owner: W
479
+ }, (m !== void 0 ? m : null) !== null ? Object.defineProperty(t, "ref", {
480
+ enumerable: !1,
481
+ get: L
482
+ }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
483
+ configurable: !1,
484
+ enumerable: !1,
485
+ writable: !0,
486
+ value: 0
487
+ }), Object.defineProperty(t, "_debugInfo", {
488
+ configurable: !1,
489
+ enumerable: !1,
490
+ writable: !0,
491
+ value: null
492
+ }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
493
+ }
494
+ function P(t, l, m, w, W, S) {
495
+ if (typeof t == "string" || typeof t == "function" || t === Z || t === e || t === x || t === g || t === C || t === ft || typeof t == "object" && t !== null && (t.$$typeof === lt || t.$$typeof === V || t.$$typeof === i || t.$$typeof === n || t.$$typeof === p || t.$$typeof === N || t.getModuleId !== void 0)) {
496
+ var _ = l.children;
497
+ if (_ !== void 0)
498
+ if (w)
499
+ if (v(_)) {
500
+ for (w = 0; w < _.length; w++)
501
+ z(_[w], t);
502
+ Object.freeze && Object.freeze(_);
503
+ } else
504
+ console.error(
505
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
506
+ );
507
+ else z(_, t);
508
+ } else
509
+ _ = "", (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (_ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), t === null ? w = "null" : v(t) ? w = "array" : t !== void 0 && t.$$typeof === ut ? (w = "<" + (s(t.type) || "Unknown") + " />", _ = " Did you accidentally export a JSX literal instead of a component?") : w = typeof t, console.error(
510
+ "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
511
+ w,
512
+ _
513
+ );
514
+ if (rt.call(l, "key")) {
515
+ _ = s(t);
516
+ var it = Object.keys(l).filter(function(at) {
517
+ return at !== "key";
518
+ });
519
+ w = 0 < it.length ? "{key: someKey, " + it.join(": ..., ") + ": ...}" : "{key: someKey}", J[_ + w] || (it = 0 < it.length ? "{" + it.join(": ..., ") + ": ...}" : "{}", console.error(
520
+ `A props object containing a "key" prop is being spread into JSX:
521
+ let props = %s;
522
+ <%s {...props} />
523
+ React keys must be passed directly to JSX without using spread:
524
+ let props = %s;
525
+ <%s key={someKey} {...props} />`,
526
+ w,
527
+ _,
528
+ it,
529
+ _
530
+ ), J[_ + w] = !0);
531
+ }
532
+ if (_ = null, m !== void 0 && (u(m), _ = "" + m), R(l) && (u(l.key), _ = "" + l.key), "key" in l) {
533
+ m = {};
534
+ for (var _t in l)
535
+ _t !== "key" && (m[_t] = l[_t]);
536
+ } else m = l;
537
+ return _ && T(
538
+ m,
539
+ typeof t == "function" ? t.displayName || t.name || "Unknown" : t
540
+ ), U(t, _, S, W, o(), m);
541
+ }
542
+ function z(t, l) {
543
+ if (typeof t == "object" && t && t.$$typeof !== M) {
544
+ if (v(t))
545
+ for (var m = 0; m < t.length; m++) {
546
+ var w = t[m];
547
+ F(w) && Q(w, l);
548
+ }
549
+ else if (F(t))
550
+ t._store && (t._store.validated = 1);
551
+ else if (t === null || typeof t != "object" ? m = null : (m = A && t[A] || t["@@iterator"], m = typeof m == "function" ? m : null), typeof m == "function" && m !== t.entries && (m = m.call(t), m !== t))
552
+ for (; !(t = m.next()).done; )
553
+ F(t.value) && Q(t.value, l);
554
+ }
555
+ }
556
+ function F(t) {
557
+ return typeof t == "object" && t !== null && t.$$typeof === ut;
558
+ }
559
+ function Q(t, l) {
560
+ if (t._store && !t._store.validated && t.key == null && (t._store.validated = 1, l = st(l), !vt[l])) {
561
+ vt[l] = !0;
562
+ var m = "";
563
+ t && t._owner != null && t._owner !== o() && (m = null, typeof t._owner.tag == "number" ? m = s(t._owner.type) : typeof t._owner.name == "string" && (m = t._owner.name), m = " It was passed a child from " + m + ".");
564
+ var w = y.getCurrentStack;
565
+ y.getCurrentStack = function() {
566
+ var W = j(t.type);
567
+ return w && (W += w() || ""), W;
568
+ }, console.error(
569
+ 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
570
+ l,
571
+ m
572
+ ), y.getCurrentStack = w;
573
+ }
574
+ }
575
+ function st(t) {
576
+ var l = "", m = o();
577
+ return m && (m = s(m.type)) && (l = `
578
+
579
+ Check the render method of \`` + m + "`."), l || (t = s(t)) && (l = `
580
+
581
+ Check the top-level render call using <` + t + ">."), l;
582
+ }
583
+ var nt = Pt, ut = Symbol.for("react.transitional.element"), ot = Symbol.for("react.portal"), Z = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), e = Symbol.for("react.profiler"), n = Symbol.for("react.consumer"), i = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), V = Symbol.for("react.memo"), lt = Symbol.for("react.lazy"), ft = Symbol.for("react.offscreen"), A = Symbol.iterator, K = Symbol.for("react.client.reference"), y = nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rt = Object.prototype.hasOwnProperty, E = Object.assign, N = Symbol.for("react.client.reference"), v = Array.isArray, B = 0, G, et, dt, D, I, H, k;
584
+ a.__reactDisabledLog = !0;
585
+ var Y, tt, $ = !1, q = new (typeof WeakMap == "function" ? WeakMap : Map)(), M = Symbol.for("react.client.reference"), ht, O = {}, J = {}, vt = {};
586
+ wt.Fragment = Z, wt.jsx = function(t, l, m, w, W) {
587
+ return P(t, l, m, !1, w, W);
588
+ }, wt.jsxs = function(t, l, m, w, W) {
589
+ return P(t, l, m, !0, w, W);
590
+ };
591
+ }()), wt;
592
+ }
593
+ var Tt;
594
+ function $t() {
595
+ return Tt || (Tt = 1, process.env.NODE_ENV === "production" ? kt.exports = Ft() : kt.exports = Ut()), kt.exports;
596
+ }
597
+ var d = $t();
598
+ const Zt = ({
599
+ speciesList: s,
600
+ width: r = 1e3,
601
+ height: u = 50,
602
+ padding: a = 0,
603
+ stroke: c = "grey",
604
+ format: f = (T) => T.toString(),
605
+ chronoScale: h = !0,
606
+ showImages: b = !0,
607
+ presentTime: j,
608
+ handleMouseMove: o,
609
+ children: R
610
+ }) => {
611
+ const T = s.map((z) => z.copy()), L = Math.min(...T.map((z) => z.apparition)), U = Math.max(...T.map((z) => z.apparition - L)), P = new yt(
612
+ "",
613
+ L,
614
+ U,
615
+ void 0,
616
+ []
617
+ );
618
+ return P.display = !1, P.linkDescendants(T), /* @__PURE__ */ d.jsx(
619
+ qt,
620
+ {
621
+ commonAncestor: P,
622
+ width: r,
623
+ height: u,
624
+ padding: a,
625
+ stroke: c,
626
+ format: f,
627
+ chronoScale: h,
628
+ showImages: b,
629
+ presentTime: j,
630
+ handleMouseMove: o,
631
+ children: (z, F, Q, st) => R == null ? void 0 : R(z, F, Q, st)
632
+ }
633
+ );
634
+ }, qt = ({
635
+ commonAncestor: s,
636
+ width: r = 1e3,
637
+ height: u = 50,
638
+ padding: a = 0,
639
+ stroke: c = "grey",
640
+ format: f = (T) => T.toString(),
641
+ chronoScale: h = !0,
642
+ showImages: b = !0,
643
+ presentTime: j,
644
+ handleMouseMove: o,
645
+ children: R
646
+ }) => {
647
+ const [T, L] = X(!1), [U, P] = X(void 0), [z, F] = X(void 0), [Q, st] = X(s.allDescendants().reduce((e, n) => e.set(n, !0), /* @__PURE__ */ new Map()));
648
+ Ot(() => {
649
+ st(s.allDescendants().reduce((e, n) => e.set(n, !0), /* @__PURE__ */ new Map()));
650
+ }, [s]);
651
+ const nt = (e) => {
652
+ P(T ? void 0 : e), L(!T);
653
+ }, ut = (e) => {
654
+ const n = new Map(Q);
655
+ n.set(e, !Q.get(e)), st(n);
656
+ }, ot = (e) => {
657
+ F(e);
658
+ }, Z = j !== void 0 && h, x = (e) => b ? e.map((n) => n.image ? 2 : 1).reduce((n, i) => n + i) : e.length;
659
+ return /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
660
+ /* @__PURE__ */ d.jsx(
661
+ "svg",
662
+ {
663
+ width: r * (Z ? (Math.min(j, s.absoluteExtinction()) - s.apparition) / s.absoluteDuration() : 1),
664
+ height: u * x(Z ? s.allDescendants().filter((e) => e.apparition < j) : s.allDescendants()),
665
+ onMouseMove: (e) => {
666
+ o == null || o(e.clientX, e.clientY);
667
+ },
668
+ children: /* @__PURE__ */ d.jsx(
669
+ Nt,
670
+ {
671
+ commonAncestor: s,
672
+ species: s,
673
+ y: -1,
674
+ scaleX: r / (h ? s.absoluteDuration() : Math.max(0, s.stepsUntilLastDescendant()) + 1),
675
+ scaleY: u,
676
+ padding: a,
677
+ stroke: c,
678
+ format: f,
679
+ chronoScale: h,
680
+ showImages: b,
681
+ presentTime: j,
682
+ toggleShowMenu: nt,
683
+ hoverShowMenu: ot,
684
+ showDesc: Q,
685
+ changeShowDesc: ut
686
+ }
687
+ )
688
+ }
689
+ ),
690
+ R == null ? void 0 : R(U, T, nt, z)
691
+ ] });
692
+ }, Nt = ({
693
+ commonAncestor: s,
694
+ species: r,
695
+ y: u,
696
+ scaleX: a,
697
+ scaleY: c,
698
+ padding: f = 0,
699
+ stroke: h = "grey",
700
+ format: b = (z) => z.toString(),
701
+ chronoScale: j = !0,
702
+ showImages: o = !0,
703
+ presentTime: R = void 0,
704
+ toggleShowMenu: T,
705
+ hoverShowMenu: L,
706
+ showDesc: U,
707
+ changeShowDesc: P
708
+ }) => {
709
+ const z = R !== void 0 && j, F = s.allDescendants().filter((x) => z ? x.apparition < R : !0), Q = F.indexOf(r), st = (j ? r.apparition - s.apparition : s.stepsUntil(r) ?? 0) * a, nt = st + (j ? Math.min(U.get(r) ? r.duration : r.absoluteDuration(), z ? R - r.apparition : r.absoluteDuration()) : 1) * a, ut = o && Q > 0 ? [...Array(Q).keys()].map((x) => F[x]).map((x) => (x.image ? 2 : 1) * c).reduce((x, e) => x + e) : Q * c, ot = r.descendants.filter((x) => z ? x.apparition < R : !0), Z = ot.length > 0 ? st + (Math.min(...ot.map((x) => x.apparition)) - r.apparition) * a : nt;
710
+ return /* @__PURE__ */ d.jsxs("g", { children: [
711
+ u >= 0 && /* @__PURE__ */ d.jsx(
712
+ "line",
713
+ {
714
+ x1: st,
715
+ y1: u,
716
+ x2: st,
717
+ y2: ut,
718
+ stroke: h
719
+ }
720
+ ),
721
+ r.display && /* @__PURE__ */ d.jsx(
722
+ zt,
723
+ {
724
+ commonAncestor: s,
725
+ species: r,
726
+ height: c,
727
+ x1: st,
728
+ x2: nt,
729
+ x0: Z,
730
+ y: ut,
731
+ stroke: h,
732
+ changeShowDesc: () => P(r),
733
+ showDesc: U.get(r),
734
+ padding: f,
735
+ format: b,
736
+ chronoScale: j,
737
+ showImages: o,
738
+ presentTime: R,
739
+ toggleShowMenu: T,
740
+ hoverShowMenu: L
741
+ }
742
+ ),
743
+ r.descendants.map((x, e) => /* @__PURE__ */ d.jsx("g", { className: U.get(r) && ot.includes(x) ? "block" : "hidden", children: /* @__PURE__ */ d.jsx(
744
+ Nt,
745
+ {
746
+ commonAncestor: s,
747
+ species: x,
748
+ y: x.display ? ut : -1,
749
+ scaleX: a,
750
+ scaleY: c,
751
+ padding: f,
752
+ stroke: h,
753
+ format: b,
754
+ chronoScale: j,
755
+ showImages: o,
756
+ presentTime: R,
757
+ toggleShowMenu: T,
758
+ showDesc: U,
759
+ changeShowDesc: P,
760
+ hoverShowMenu: L
761
+ }
762
+ ) }, F.length + e))
763
+ ] }, Q);
764
+ }, zt = ({
765
+ commonAncestor: s,
766
+ species: r,
767
+ height: u,
768
+ x1: a,
769
+ x2: c,
770
+ x0: f,
771
+ y: h,
772
+ stroke: b,
773
+ showDesc: j = !0,
774
+ changeShowDesc: o = () => {
775
+ },
776
+ padding: R = 0,
777
+ format: T = (nt) => nt.toString(),
778
+ chronoScale: L = !0,
779
+ showImages: U = !0,
780
+ presentTime: P,
781
+ toggleShowMenu: z,
782
+ hoverShowMenu: F,
783
+ className: Q,
784
+ buttonClassName: st
785
+ }) => {
786
+ const nt = P !== void 0, ut = s.allDescendants().filter((i) => nt ? i.apparition < P : !0), ot = (i) => ut.indexOf(i), Z = r.ancestor && ot(r) > ot(r.ancestor) ? -3 : 1, x = r.descendants.filter((i) => nt ? i.apparition < P : !0), e = x.filter((i) => i.apparition === r.extinction()).length === 0, n = T(Math.min(j ? r.extinction() : r.absoluteExtinction(), nt ? P : r.absoluteExtinction()));
787
+ return /* @__PURE__ */ d.jsxs("g", { children: [
788
+ /* @__PURE__ */ d.jsx(
789
+ "line",
790
+ {
791
+ x1: a,
792
+ y1: h,
793
+ x2: c,
794
+ y2: h,
795
+ stroke: b
796
+ }
797
+ ),
798
+ /* @__PURE__ */ d.jsx(
799
+ "foreignObject",
800
+ {
801
+ x: a + R,
802
+ y: h + R * Z,
803
+ width: (L ? f ?? c : c) - a - 2 * R,
804
+ height: u + (U && r.image ? u : 0),
805
+ children: /* @__PURE__ */ d.jsxs("div", { className: `flex flex-row justify-between w-full ${Q ?? ""}`, children: [
806
+ /* @__PURE__ */ d.jsx("div", { children: L ? T(r.apparition) : "" }),
807
+ /* @__PURE__ */ d.jsxs(
808
+ "button",
809
+ {
810
+ className: `p-0.625 justify-center flex flex-col items-center ${st ?? ""}`,
811
+ onClick: () => z(r),
812
+ onMouseEnter: () => F(r),
813
+ onMouseLeave: () => F(void 0),
814
+ children: [
815
+ r.name,
816
+ r.image && U && /* @__PURE__ */ d.jsx(
817
+ "img",
818
+ {
819
+ src: r.image,
820
+ alt: r.name,
821
+ style: { height: u }
822
+ }
823
+ )
824
+ ]
825
+ }
826
+ ),
827
+ x.length > 0 ? /* @__PURE__ */ d.jsx("button", { onClick: o, className: "h-1", style: { maxWidth: 4 }, children: (e || !j) && (!f || f === c) ? n : "" }) : /* @__PURE__ */ d.jsx("div", { children: L ? n : "" })
828
+ ] })
829
+ }
830
+ ),
831
+ L && f && f < c && /* @__PURE__ */ d.jsx(
832
+ "foreignObject",
833
+ {
834
+ x: f + R,
835
+ y: h + R * Z,
836
+ width: c - f - 2 * R,
837
+ height: u,
838
+ children: /* @__PURE__ */ d.jsx("div", { className: "flex flex-row justify-end w-full", children: (e || !j) && L ? n : "" })
839
+ }
840
+ )
841
+ ] });
842
+ }, Wt = (s, r, u) => s < r ? r : s > u ? u : s;
843
+ var jt = { exports: {} };
844
+ /* @license
845
+ Papa Parse
846
+ v5.5.2
847
+ https://github.com/mholt/PapaParse
848
+ License: MIT
849
+ */
850
+ var Yt = jt.exports, Dt;
851
+ function Jt() {
852
+ return Dt || (Dt = 1, function(s, r) {
853
+ ((u, a) => {
854
+ s.exports = a();
855
+ })(Yt, function u() {
856
+ var a = typeof self < "u" ? self : typeof window < "u" ? window : a !== void 0 ? a : {}, c, f = !a.document && !!a.postMessage, h = a.IS_PAPA_WORKER || !1, b = {}, j = 0, o = {};
857
+ function R(e) {
858
+ this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, (function(n) {
859
+ var i = ot(n);
860
+ i.chunkSize = parseInt(i.chunkSize), n.step || n.chunk || (i.chunkSize = null), this._handle = new z(i), (this._handle.streamer = this)._config = i;
861
+ }).call(this, e), this.parseChunk = function(n, i) {
862
+ var p = parseInt(this._config.skipFirstNLines) || 0;
863
+ if (this.isFirstChunk && 0 < p) {
864
+ let C = this._config.newline;
865
+ C || (g = this._config.quoteChar || '"', C = this._handle.guessLineEndings(n, g)), n = [...n.split(C).slice(p)].join(C);
866
+ }
867
+ this.isFirstChunk && x(this._config.beforeFirstChunk) && (g = this._config.beforeFirstChunk(n)) !== void 0 && (n = g), this.isFirstChunk = !1, this._halted = !1;
868
+ var p = this._partialLine + n, g = (this._partialLine = "", this._handle.parse(p, this._baseIndex, !this._finished));
869
+ if (!this._handle.paused() && !this._handle.aborted()) {
870
+ if (n = g.meta.cursor, p = (this._finished || (this._partialLine = p.substring(n - this._baseIndex), this._baseIndex = n), g && g.data && (this._rowCount += g.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), h) a.postMessage({ results: g, workerId: o.WORKER_ID, finished: p });
871
+ else if (x(this._config.chunk) && !i) {
872
+ if (this._config.chunk(g, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
873
+ this._completeResults = g = void 0;
874
+ }
875
+ return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(g.data), this._completeResults.errors = this._completeResults.errors.concat(g.errors), this._completeResults.meta = g.meta), this._completed || !p || !x(this._config.complete) || g && g.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), p || g && g.meta.paused || this._nextChunk(), g;
876
+ }
877
+ this._halted = !0;
878
+ }, this._sendError = function(n) {
879
+ x(this._config.error) ? this._config.error(n) : h && this._config.error && a.postMessage({ workerId: o.WORKER_ID, error: n, finished: !1 });
880
+ };
881
+ }
882
+ function T(e) {
883
+ var n;
884
+ (e = e || {}).chunkSize || (e.chunkSize = o.RemoteChunkSize), R.call(this, e), this._nextChunk = f ? function() {
885
+ this._readChunk(), this._chunkLoaded();
886
+ } : function() {
887
+ this._readChunk();
888
+ }, this.stream = function(i) {
889
+ this._input = i, this._nextChunk();
890
+ }, this._readChunk = function() {
891
+ if (this._finished) this._chunkLoaded();
892
+ else {
893
+ if (n = new XMLHttpRequest(), this._config.withCredentials && (n.withCredentials = this._config.withCredentials), f || (n.onload = Z(this._chunkLoaded, this), n.onerror = Z(this._chunkError, this)), n.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !f), this._config.downloadRequestHeaders) {
894
+ var i, p = this._config.downloadRequestHeaders;
895
+ for (i in p) n.setRequestHeader(i, p[i]);
896
+ }
897
+ var g;
898
+ this._config.chunkSize && (g = this._start + this._config.chunkSize - 1, n.setRequestHeader("Range", "bytes=" + this._start + "-" + g));
899
+ try {
900
+ n.send(this._config.downloadRequestBody);
901
+ } catch (C) {
902
+ this._chunkError(C.message);
903
+ }
904
+ f && n.status === 0 && this._chunkError();
905
+ }
906
+ }, this._chunkLoaded = function() {
907
+ n.readyState === 4 && (n.status < 200 || 400 <= n.status ? this._chunkError() : (this._start += this._config.chunkSize || n.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((i) => (i = i.getResponseHeader("Content-Range")) !== null ? parseInt(i.substring(i.lastIndexOf("/") + 1)) : -1)(n), this.parseChunk(n.responseText)));
908
+ }, this._chunkError = function(i) {
909
+ i = n.statusText || i, this._sendError(new Error(i));
910
+ };
911
+ }
912
+ function L(e) {
913
+ (e = e || {}).chunkSize || (e.chunkSize = o.LocalChunkSize), R.call(this, e);
914
+ var n, i, p = typeof FileReader < "u";
915
+ this.stream = function(g) {
916
+ this._input = g, i = g.slice || g.webkitSlice || g.mozSlice, p ? ((n = new FileReader()).onload = Z(this._chunkLoaded, this), n.onerror = Z(this._chunkError, this)) : n = new FileReaderSync(), this._nextChunk();
917
+ }, this._nextChunk = function() {
918
+ this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
919
+ }, this._readChunk = function() {
920
+ var g = this._input, C = (this._config.chunkSize && (C = Math.min(this._start + this._config.chunkSize, this._input.size), g = i.call(g, this._start, C)), n.readAsText(g, this._config.encoding));
921
+ p || this._chunkLoaded({ target: { result: C } });
922
+ }, this._chunkLoaded = function(g) {
923
+ this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(g.target.result);
924
+ }, this._chunkError = function() {
925
+ this._sendError(n.error);
926
+ };
927
+ }
928
+ function U(e) {
929
+ var n;
930
+ R.call(this, e = e || {}), this.stream = function(i) {
931
+ return n = i, this._nextChunk();
932
+ }, this._nextChunk = function() {
933
+ var i, p;
934
+ if (!this._finished) return i = this._config.chunkSize, n = i ? (p = n.substring(0, i), n.substring(i)) : (p = n, ""), this._finished = !n, this.parseChunk(p);
935
+ };
936
+ }
937
+ function P(e) {
938
+ R.call(this, e = e || {});
939
+ var n = [], i = !0, p = !1;
940
+ this.pause = function() {
941
+ R.prototype.pause.apply(this, arguments), this._input.pause();
942
+ }, this.resume = function() {
943
+ R.prototype.resume.apply(this, arguments), this._input.resume();
944
+ }, this.stream = function(g) {
945
+ this._input = g, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
946
+ }, this._checkIsFinished = function() {
947
+ p && n.length === 1 && (this._finished = !0);
948
+ }, this._nextChunk = function() {
949
+ this._checkIsFinished(), n.length ? this.parseChunk(n.shift()) : i = !0;
950
+ }, this._streamData = Z(function(g) {
951
+ try {
952
+ n.push(typeof g == "string" ? g : g.toString(this._config.encoding)), i && (i = !1, this._checkIsFinished(), this.parseChunk(n.shift()));
953
+ } catch (C) {
954
+ this._streamError(C);
955
+ }
956
+ }, this), this._streamError = Z(function(g) {
957
+ this._streamCleanUp(), this._sendError(g);
958
+ }, this), this._streamEnd = Z(function() {
959
+ this._streamCleanUp(), p = !0, this._streamData("");
960
+ }, this), this._streamCleanUp = Z(function() {
961
+ this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
962
+ }, this);
963
+ }
964
+ function z(e) {
965
+ var n, i, p, g, C = Math.pow(2, 53), V = -C, lt = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, ft = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, A = this, K = 0, y = 0, rt = !1, E = !1, N = [], v = { data: [], errors: [], meta: {} };
966
+ function B(D) {
967
+ return e.skipEmptyLines === "greedy" ? D.join("").trim() === "" : D.length === 1 && D[0].length === 0;
968
+ }
969
+ function G() {
970
+ if (v && p && (dt("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + o.DefaultDelimiter + "'"), p = !1), e.skipEmptyLines && (v.data = v.data.filter(function(k) {
971
+ return !B(k);
972
+ })), et()) {
973
+ let k = function(Y, tt) {
974
+ x(e.transformHeader) && (Y = e.transformHeader(Y, tt)), N.push(Y);
975
+ };
976
+ if (v) if (Array.isArray(v.data[0])) {
977
+ for (var D = 0; et() && D < v.data.length; D++) v.data[D].forEach(k);
978
+ v.data.splice(0, 1);
979
+ } else v.data.forEach(k);
980
+ }
981
+ function I(k, Y) {
982
+ for (var tt = e.header ? {} : [], $ = 0; $ < k.length; $++) {
983
+ var q = $, M = k[$], M = ((ht, O) => ((J) => (e.dynamicTypingFunction && e.dynamicTyping[J] === void 0 && (e.dynamicTyping[J] = e.dynamicTypingFunction(J)), (e.dynamicTyping[J] || e.dynamicTyping) === !0))(ht) ? O === "true" || O === "TRUE" || O !== "false" && O !== "FALSE" && (((J) => {
984
+ if (lt.test(J) && (J = parseFloat(J), V < J && J < C))
985
+ return 1;
986
+ })(O) ? parseFloat(O) : ft.test(O) ? new Date(O) : O === "" ? null : O) : O)(q = e.header ? $ >= N.length ? "__parsed_extra" : N[$] : q, M = e.transform ? e.transform(M, q) : M);
987
+ q === "__parsed_extra" ? (tt[q] = tt[q] || [], tt[q].push(M)) : tt[q] = M;
988
+ }
989
+ return e.header && ($ > N.length ? dt("FieldMismatch", "TooManyFields", "Too many fields: expected " + N.length + " fields but parsed " + $, y + Y) : $ < N.length && dt("FieldMismatch", "TooFewFields", "Too few fields: expected " + N.length + " fields but parsed " + $, y + Y)), tt;
990
+ }
991
+ var H;
992
+ v && (e.header || e.dynamicTyping || e.transform) && (H = 1, !v.data.length || Array.isArray(v.data[0]) ? (v.data = v.data.map(I), H = v.data.length) : v.data = I(v.data, 0), e.header && v.meta && (v.meta.fields = N), y += H);
993
+ }
994
+ function et() {
995
+ return e.header && N.length === 0;
996
+ }
997
+ function dt(D, I, H, k) {
998
+ D = { type: D, code: I, message: H }, k !== void 0 && (D.row = k), v.errors.push(D);
999
+ }
1000
+ x(e.step) && (g = e.step, e.step = function(D) {
1001
+ v = D, et() ? G() : (G(), v.data.length !== 0 && (K += D.data.length, e.preview && K > e.preview ? i.abort() : (v.data = v.data[0], g(v, A))));
1002
+ }), this.parse = function(D, I, H) {
1003
+ var k = e.quoteChar || '"', k = (e.newline || (e.newline = this.guessLineEndings(D, k)), p = !1, e.delimiter ? x(e.delimiter) && (e.delimiter = e.delimiter(D), v.meta.delimiter = e.delimiter) : ((k = ((Y, tt, $, q, M) => {
1004
+ var ht, O, J, vt;
1005
+ M = M || [",", " ", "|", ";", o.RECORD_SEP, o.UNIT_SEP];
1006
+ for (var t = 0; t < M.length; t++) {
1007
+ for (var l, m = M[t], w = 0, W = 0, S = 0, _ = (J = void 0, new Q({ comments: q, delimiter: m, newline: tt, preview: 10 }).parse(Y)), it = 0; it < _.data.length; it++) $ && B(_.data[it]) ? S++ : (l = _.data[it].length, W += l, J === void 0 ? J = l : 0 < l && (w += Math.abs(l - J), J = l));
1008
+ 0 < _.data.length && (W /= _.data.length - S), (O === void 0 || w <= O) && (vt === void 0 || vt < W) && 1.99 < W && (O = w, ht = m, vt = W);
1009
+ }
1010
+ return { successful: !!(e.delimiter = ht), bestDelimiter: ht };
1011
+ })(D, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = k.bestDelimiter : (p = !0, e.delimiter = o.DefaultDelimiter), v.meta.delimiter = e.delimiter), ot(e));
1012
+ return e.preview && e.header && k.preview++, n = D, i = new Q(k), v = i.parse(n, I, H), G(), rt ? { meta: { paused: !0 } } : v || { meta: { paused: !1 } };
1013
+ }, this.paused = function() {
1014
+ return rt;
1015
+ }, this.pause = function() {
1016
+ rt = !0, i.abort(), n = x(e.chunk) ? "" : n.substring(i.getCharIndex());
1017
+ }, this.resume = function() {
1018
+ A.streamer._halted ? (rt = !1, A.streamer.parseChunk(n, !0)) : setTimeout(A.resume, 3);
1019
+ }, this.aborted = function() {
1020
+ return E;
1021
+ }, this.abort = function() {
1022
+ E = !0, i.abort(), v.meta.aborted = !0, x(e.complete) && e.complete(v), n = "";
1023
+ }, this.guessLineEndings = function(Y, k) {
1024
+ Y = Y.substring(0, 1048576);
1025
+ var k = new RegExp(F(k) + "([^]*?)" + F(k), "gm"), H = (Y = Y.replace(k, "")).split("\r"), k = Y.split(`
1026
+ `), Y = 1 < k.length && k[0].length < H[0].length;
1027
+ if (H.length === 1 || Y) return `
1028
+ `;
1029
+ for (var tt = 0, $ = 0; $ < H.length; $++) H[$][0] === `
1030
+ ` && tt++;
1031
+ return tt >= H.length / 2 ? `\r
1032
+ ` : "\r";
1033
+ };
1034
+ }
1035
+ function F(e) {
1036
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1037
+ }
1038
+ function Q(e) {
1039
+ var n = (e = e || {}).delimiter, i = e.newline, p = e.comments, g = e.step, C = e.preview, V = e.fastMode, lt = null, ft = !1, A = e.quoteChar == null ? '"' : e.quoteChar, K = A;
1040
+ if (e.escapeChar !== void 0 && (K = e.escapeChar), (typeof n != "string" || -1 < o.BAD_DELIMITERS.indexOf(n)) && (n = ","), p === n) throw new Error("Comment character same as delimiter");
1041
+ p === !0 ? p = "#" : (typeof p != "string" || -1 < o.BAD_DELIMITERS.indexOf(p)) && (p = !1), i !== `
1042
+ ` && i !== "\r" && i !== `\r
1043
+ ` && (i = `
1044
+ `);
1045
+ var y = 0, rt = !1;
1046
+ this.parse = function(E, N, v) {
1047
+ if (typeof E != "string") throw new Error("Input must be a string");
1048
+ var B = E.length, G = n.length, et = i.length, dt = p.length, D = x(g), I = [], H = [], k = [], Y = y = 0;
1049
+ if (!E) return w();
1050
+ if (V || V !== !1 && E.indexOf(A) === -1) {
1051
+ for (var tt = E.split(i), $ = 0; $ < tt.length; $++) {
1052
+ if (k = tt[$], y += k.length, $ !== tt.length - 1) y += i.length;
1053
+ else if (v) return w();
1054
+ if (!p || k.substring(0, dt) !== p) {
1055
+ if (D) {
1056
+ if (I = [], vt(k.split(n)), W(), rt) return w();
1057
+ } else vt(k.split(n));
1058
+ if (C && C <= $) return I = I.slice(0, C), w(!0);
1059
+ }
1060
+ }
1061
+ return w();
1062
+ }
1063
+ for (var q = E.indexOf(n, y), M = E.indexOf(i, y), ht = new RegExp(F(K) + F(A), "g"), O = E.indexOf(A, y); ; ) if (E[y] === A) for (O = y, y++; ; ) {
1064
+ if ((O = E.indexOf(A, O + 1)) === -1) return v || H.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: I.length, index: y }), l();
1065
+ if (O === B - 1) return l(E.substring(y, O).replace(ht, A));
1066
+ if (A === K && E[O + 1] === K) O++;
1067
+ else if (A === K || O === 0 || E[O - 1] !== K) {
1068
+ q !== -1 && q < O + 1 && (q = E.indexOf(n, O + 1));
1069
+ var J = t((M = M !== -1 && M < O + 1 ? E.indexOf(i, O + 1) : M) === -1 ? q : Math.min(q, M));
1070
+ if (E.substr(O + 1 + J, G) === n) {
1071
+ k.push(E.substring(y, O).replace(ht, A)), E[y = O + 1 + J + G] !== A && (O = E.indexOf(A, y)), q = E.indexOf(n, y), M = E.indexOf(i, y);
1072
+ break;
1073
+ }
1074
+ if (J = t(M), E.substring(O + 1 + J, O + 1 + J + et) === i) {
1075
+ if (k.push(E.substring(y, O).replace(ht, A)), m(O + 1 + J + et), q = E.indexOf(n, y), O = E.indexOf(A, y), D && (W(), rt)) return w();
1076
+ if (C && I.length >= C) return w(!0);
1077
+ break;
1078
+ }
1079
+ H.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: I.length, index: y }), O++;
1080
+ }
1081
+ }
1082
+ else if (p && k.length === 0 && E.substring(y, y + dt) === p) {
1083
+ if (M === -1) return w();
1084
+ y = M + et, M = E.indexOf(i, y), q = E.indexOf(n, y);
1085
+ } else if (q !== -1 && (q < M || M === -1)) k.push(E.substring(y, q)), y = q + G, q = E.indexOf(n, y);
1086
+ else {
1087
+ if (M === -1) break;
1088
+ if (k.push(E.substring(y, M)), m(M + et), D && (W(), rt)) return w();
1089
+ if (C && I.length >= C) return w(!0);
1090
+ }
1091
+ return l();
1092
+ function vt(S) {
1093
+ I.push(S), Y = y;
1094
+ }
1095
+ function t(S) {
1096
+ var _ = 0;
1097
+ return _ = S !== -1 && (S = E.substring(O + 1, S)) && S.trim() === "" ? S.length : _;
1098
+ }
1099
+ function l(S) {
1100
+ return v || (S === void 0 && (S = E.substring(y)), k.push(S), y = B, vt(k), D && W()), w();
1101
+ }
1102
+ function m(S) {
1103
+ y = S, vt(k), k = [], M = E.indexOf(i, y);
1104
+ }
1105
+ function w(S) {
1106
+ if (e.header && !N && I.length && !ft) {
1107
+ var _ = I[0], it = {}, _t = new Set(_);
1108
+ let at = !1;
1109
+ for (let pt = 0; pt < _.length; pt++) {
1110
+ let ct = _[pt];
1111
+ if (it[ct = x(e.transformHeader) ? e.transformHeader(ct, pt) : ct]) {
1112
+ let gt, xt = it[ct];
1113
+ for (; gt = ct + "_" + xt, xt++, _t.has(gt); ) ;
1114
+ _t.add(gt), _[pt] = gt, it[ct]++, at = !0, (lt = lt === null ? {} : lt)[gt] = ct;
1115
+ } else it[ct] = 1, _[pt] = ct;
1116
+ _t.add(ct);
1117
+ }
1118
+ at && console.warn("Duplicate headers found and renamed."), ft = !0;
1119
+ }
1120
+ return { data: I, errors: H, meta: { delimiter: n, linebreak: i, aborted: rt, truncated: !!S, cursor: Y + (N || 0), renamedHeaders: lt } };
1121
+ }
1122
+ function W() {
1123
+ g(w()), I = [], H = [];
1124
+ }
1125
+ }, this.abort = function() {
1126
+ rt = !0;
1127
+ }, this.getCharIndex = function() {
1128
+ return y;
1129
+ };
1130
+ }
1131
+ function st(e) {
1132
+ var n = e.data, i = b[n.workerId], p = !1;
1133
+ if (n.error) i.userError(n.error, n.file);
1134
+ else if (n.results && n.results.data) {
1135
+ var g = { abort: function() {
1136
+ p = !0, nt(n.workerId, { data: [], errors: [], meta: { aborted: !0 } });
1137
+ }, pause: ut, resume: ut };
1138
+ if (x(i.userStep)) {
1139
+ for (var C = 0; C < n.results.data.length && (i.userStep({ data: n.results.data[C], errors: n.results.errors, meta: n.results.meta }, g), !p); C++) ;
1140
+ delete n.results;
1141
+ } else x(i.userChunk) && (i.userChunk(n.results, g, n.file), delete n.results);
1142
+ }
1143
+ n.finished && !p && nt(n.workerId, n.results);
1144
+ }
1145
+ function nt(e, n) {
1146
+ var i = b[e];
1147
+ x(i.userComplete) && i.userComplete(n), i.terminate(), delete b[e];
1148
+ }
1149
+ function ut() {
1150
+ throw new Error("Not implemented.");
1151
+ }
1152
+ function ot(e) {
1153
+ if (typeof e != "object" || e === null) return e;
1154
+ var n, i = Array.isArray(e) ? [] : {};
1155
+ for (n in e) i[n] = ot(e[n]);
1156
+ return i;
1157
+ }
1158
+ function Z(e, n) {
1159
+ return function() {
1160
+ e.apply(n, arguments);
1161
+ };
1162
+ }
1163
+ function x(e) {
1164
+ return typeof e == "function";
1165
+ }
1166
+ return o.parse = function(e, n) {
1167
+ var i = (n = n || {}).dynamicTyping || !1;
1168
+ if (x(i) && (n.dynamicTypingFunction = i, i = {}), n.dynamicTyping = i, n.transform = !!x(n.transform) && n.transform, !n.worker || !o.WORKERS_SUPPORTED) return i = null, o.NODE_STREAM_INPUT, typeof e == "string" ? (e = ((p) => p.charCodeAt(0) !== 65279 ? p : p.slice(1))(e), i = new (n.download ? T : U)(n)) : e.readable === !0 && x(e.read) && x(e.on) ? i = new P(n) : (a.File && e instanceof File || e instanceof Object) && (i = new L(n)), i.stream(e);
1169
+ (i = (() => {
1170
+ var p;
1171
+ return !!o.WORKERS_SUPPORTED && (p = (() => {
1172
+ var g = a.URL || a.webkitURL || null, C = u.toString();
1173
+ return o.BLOB_URL || (o.BLOB_URL = g.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", C, ")();"], { type: "text/javascript" })));
1174
+ })(), (p = new a.Worker(p)).onmessage = st, p.id = j++, b[p.id] = p);
1175
+ })()).userStep = n.step, i.userChunk = n.chunk, i.userComplete = n.complete, i.userError = n.error, n.step = x(n.step), n.chunk = x(n.chunk), n.complete = x(n.complete), n.error = x(n.error), delete n.worker, i.postMessage({ input: e, config: n, workerId: i.id });
1176
+ }, o.unparse = function(e, n) {
1177
+ var i = !1, p = !0, g = ",", C = `\r
1178
+ `, V = '"', lt = V + V, ft = !1, A = null, K = !1, y = ((() => {
1179
+ if (typeof n == "object") {
1180
+ if (typeof n.delimiter != "string" || o.BAD_DELIMITERS.filter(function(N) {
1181
+ return n.delimiter.indexOf(N) !== -1;
1182
+ }).length || (g = n.delimiter), typeof n.quotes != "boolean" && typeof n.quotes != "function" && !Array.isArray(n.quotes) || (i = n.quotes), typeof n.skipEmptyLines != "boolean" && typeof n.skipEmptyLines != "string" || (ft = n.skipEmptyLines), typeof n.newline == "string" && (C = n.newline), typeof n.quoteChar == "string" && (V = n.quoteChar), typeof n.header == "boolean" && (p = n.header), Array.isArray(n.columns)) {
1183
+ if (n.columns.length === 0) throw new Error("Option columns is empty");
1184
+ A = n.columns;
1185
+ }
1186
+ n.escapeChar !== void 0 && (lt = n.escapeChar + V), n.escapeFormulae instanceof RegExp ? K = n.escapeFormulae : typeof n.escapeFormulae == "boolean" && n.escapeFormulae && (K = /^[=+\-@\t\r].*$/);
1187
+ }
1188
+ })(), new RegExp(F(V), "g"));
1189
+ if (typeof e == "string" && (e = JSON.parse(e)), Array.isArray(e)) {
1190
+ if (!e.length || Array.isArray(e[0])) return rt(null, e, ft);
1191
+ if (typeof e[0] == "object") return rt(A || Object.keys(e[0]), e, ft);
1192
+ } else if (typeof e == "object") return typeof e.data == "string" && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || A), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : typeof e.data[0] == "object" ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || typeof e.data[0] == "object" || (e.data = [e.data])), rt(e.fields || [], e.data || [], ft);
1193
+ throw new Error("Unable to serialize unrecognized input");
1194
+ function rt(N, v, B) {
1195
+ var G = "", et = (typeof N == "string" && (N = JSON.parse(N)), typeof v == "string" && (v = JSON.parse(v)), Array.isArray(N) && 0 < N.length), dt = !Array.isArray(v[0]);
1196
+ if (et && p) {
1197
+ for (var D = 0; D < N.length; D++) 0 < D && (G += g), G += E(N[D], D);
1198
+ 0 < v.length && (G += C);
1199
+ }
1200
+ for (var I = 0; I < v.length; I++) {
1201
+ var H = (et ? N : v[I]).length, k = !1, Y = et ? Object.keys(v[I]).length === 0 : v[I].length === 0;
1202
+ if (B && !et && (k = B === "greedy" ? v[I].join("").trim() === "" : v[I].length === 1 && v[I][0].length === 0), B === "greedy" && et) {
1203
+ for (var tt = [], $ = 0; $ < H; $++) {
1204
+ var q = dt ? N[$] : $;
1205
+ tt.push(v[I][q]);
1206
+ }
1207
+ k = tt.join("").trim() === "";
1208
+ }
1209
+ if (!k) {
1210
+ for (var M = 0; M < H; M++) {
1211
+ 0 < M && !Y && (G += g);
1212
+ var ht = et && dt ? N[M] : M;
1213
+ G += E(v[I][ht], M);
1214
+ }
1215
+ I < v.length - 1 && (!B || 0 < H && !Y) && (G += C);
1216
+ }
1217
+ }
1218
+ return G;
1219
+ }
1220
+ function E(N, v) {
1221
+ var B, G;
1222
+ return N == null ? "" : N.constructor === Date ? JSON.stringify(N).slice(1, 25) : (G = !1, K && typeof N == "string" && K.test(N) && (N = "'" + N, G = !0), B = N.toString().replace(y, lt), (G = G || i === !0 || typeof i == "function" && i(N, v) || Array.isArray(i) && i[v] || ((et, dt) => {
1223
+ for (var D = 0; D < dt.length; D++) if (-1 < et.indexOf(dt[D])) return !0;
1224
+ return !1;
1225
+ })(B, o.BAD_DELIMITERS) || -1 < B.indexOf(g) || B.charAt(0) === " " || B.charAt(B.length - 1) === " ") ? V + B + V : B);
1226
+ }
1227
+ }, o.RECORD_SEP = "", o.UNIT_SEP = "", o.BYTE_ORDER_MARK = "\uFEFF", o.BAD_DELIMITERS = ["\r", `
1228
+ `, '"', o.BYTE_ORDER_MARK], o.WORKERS_SUPPORTED = !f && !!a.Worker, o.NODE_STREAM_INPUT = 1, o.LocalChunkSize = 10485760, o.RemoteChunkSize = 5242880, o.DefaultDelimiter = ",", o.Parser = Q, o.ParserHandle = z, o.NetworkStreamer = T, o.FileStreamer = L, o.StringStreamer = U, o.ReadableStreamStreamer = P, a.jQuery && ((c = a.jQuery).fn.parse = function(e) {
1229
+ var n = e.config || {}, i = [];
1230
+ return this.each(function(C) {
1231
+ if (!(c(this).prop("tagName").toUpperCase() === "INPUT" && c(this).attr("type").toLowerCase() === "file" && a.FileReader) || !this.files || this.files.length === 0) return !0;
1232
+ for (var V = 0; V < this.files.length; V++) i.push({ file: this.files[V], inputElem: this, instanceConfig: c.extend({}, n) });
1233
+ }), p(), this;
1234
+ function p() {
1235
+ if (i.length === 0) x(e.complete) && e.complete();
1236
+ else {
1237
+ var C, V, lt, ft, A = i[0];
1238
+ if (x(e.before)) {
1239
+ var K = e.before(A.file, A.inputElem);
1240
+ if (typeof K == "object") {
1241
+ if (K.action === "abort") return C = "AbortError", V = A.file, lt = A.inputElem, ft = K.reason, void (x(e.error) && e.error({ name: C }, V, lt, ft));
1242
+ if (K.action === "skip") return void g();
1243
+ typeof K.config == "object" && (A.instanceConfig = c.extend(A.instanceConfig, K.config));
1244
+ } else if (K === "skip") return void g();
1245
+ }
1246
+ var y = A.instanceConfig.complete;
1247
+ A.instanceConfig.complete = function(rt) {
1248
+ x(y) && y(rt, A.file, A.inputElem), g();
1249
+ }, o.parse(A.file, A.instanceConfig);
1250
+ }
1251
+ }
1252
+ function g() {
1253
+ i.splice(0, 1), p();
1254
+ }
1255
+ }), h && (a.onmessage = function(e) {
1256
+ e = e.data, o.WORKER_ID === void 0 && e && (o.WORKER_ID = e.workerId), typeof e.input == "string" ? a.postMessage({ workerId: o.WORKER_ID, results: o.parse(e.input, e.config), finished: !0 }) : (a.File && e.input instanceof File || e.input instanceof Object) && (e = o.parse(e.input, e.config)) && a.postMessage({ workerId: o.WORKER_ID, results: e, finished: !0 });
1257
+ }), (T.prototype = Object.create(R.prototype)).constructor = T, (L.prototype = Object.create(R.prototype)).constructor = L, (U.prototype = Object.create(U.prototype)).constructor = U, (P.prototype = Object.create(R.prototype)).constructor = P, o;
1258
+ });
1259
+ }(jt)), jt.exports;
1260
+ }
1261
+ var Bt = Jt();
1262
+ const Ht = /* @__PURE__ */ It(Bt);
1263
+ let Mt = [];
1264
+ const Rt = async (s) => {
1265
+ const a = await (await fetch(s)).body.getReader().read(), f = new TextDecoder("utf-8").decode(a.value), { data: h } = Ht.parse(f, {
1266
+ header: !0,
1267
+ dynamicTyping: !0,
1268
+ delimiter: ";"
1269
+ });
1270
+ return h;
1271
+ }, Kt = (s = "/translate.csv") => (async (r = "/translate.csv") => {
1272
+ Mt = await Rt(r);
1273
+ })(s), mt = (s, r, u = [], a = "/translate.csv") => {
1274
+ const [c, f] = X([]);
1275
+ Ot(() => {
1276
+ Rt(a).then(f), Kt(a);
1277
+ }, [r]);
1278
+ const h = c.find((b) => b.code === s) ?? Mt.find((b) => b.code === s);
1279
+ try {
1280
+ const b = h[r];
1281
+ return u.reduce((o, R, T) => o.replace(`{${T}}`, R), b);
1282
+ } catch {
1283
+ return;
1284
+ }
1285
+ }, te = async (s, r, u = [], a = "/translate.csv") => {
1286
+ const f = (await Rt(a)).find((h) => h.code === s);
1287
+ try {
1288
+ const h = f[r];
1289
+ return u.reduce((b, j, o) => b.replace(`{${o}}`, j), h);
1290
+ } catch {
1291
+ return "";
1292
+ }
1293
+ }, ee = (s = "/translate.csv") => {
1294
+ const [r, u] = X(/* @__PURE__ */ new Map());
1295
+ return Ot(() => {
1296
+ (async () => {
1297
+ const f = (await Rt(s)).find((h) => h.code === "lan");
1298
+ if (f) {
1299
+ delete f.code;
1300
+ const h = new Map(Object.entries(f));
1301
+ u(h);
1302
+ }
1303
+ })();
1304
+ }, []), r;
1305
+ }, ne = ({ species: s, language: r, open: u, onClose: a, saveSpecies: c, createDescendant: f, createAncestor: h, deleteAncestor: b, deleteSpecies: j }) => {
1306
+ const [o, R] = X(s.name), [T, L] = X(s.apparition), [U, P] = X(s.duration), [z, F] = X(s.description ?? ""), [Q, st] = X(!1), [nt, ut] = X(!1), [ot, Z] = X(s.image ?? ""), x = () => {
1307
+ st(!Q);
1308
+ }, e = () => {
1309
+ ut(!nt);
1310
+ }, n = (i) => i.ancestor ? i.ancestor.descendants.length === 1 && n(i.ancestor) : !0;
1311
+ return /* @__PURE__ */ d.jsx(Xt, { open: u, onClose: a, children: /* @__PURE__ */ d.jsx("form", { style: { backgroundColor: "grey" }, className: "flex flex-col text-start w-auto fixed p-2.5", children: /* @__PURE__ */ d.jsxs(
1312
+ St,
1313
+ {
1314
+ name: o,
1315
+ setName: R,
1316
+ apparition: T,
1317
+ setApparition: (i) => {
1318
+ L(s.ancestor ? Wt(i, s.ancestor.apparition, s.ancestor.extinction()) : i), P(s.descendants.length > 0 ? Math.max(Math.max(...s.descendants.map((p) => p.apparition)) - T, U) : U);
1319
+ },
1320
+ minApparition: s.ancestor ? s.ancestor.apparition : void 0,
1321
+ maxApparition: s.ancestor ? s.ancestor.extinction() : void 0,
1322
+ duration: U,
1323
+ setDuration: P,
1324
+ minDuration: s.descendants.length > 0 ? Math.max(...s.descendants.map((i) => i.apparition)) - T : void 0,
1325
+ maxDuration: s.descendants.length > 0 ? Math.max(...s.descendants.map((i) => i.apparition)) - T : void 0,
1326
+ description: z,
1327
+ setDescription: F,
1328
+ image: ot,
1329
+ setImage: Z,
1330
+ language: r,
1331
+ children: [
1332
+ /* @__PURE__ */ d.jsx("button", { onClick: async () => {
1333
+ try {
1334
+ await (c == null ? void 0 : c(s, o, T, U, z, ot)), a == null || a();
1335
+ } catch (i) {
1336
+ console.error(i);
1337
+ }
1338
+ }, children: mt("spbtn00", r ?? "") }),
1339
+ /* @__PURE__ */ d.jsx("button", { type: "button", onClick: j, children: mt("spbtn01", r ?? "") }),
1340
+ /* @__PURE__ */ d.jsx("button", { type: "button", onClick: x, children: mt("spbtn02", r ?? "") }),
1341
+ Q && /* @__PURE__ */ d.jsx(
1342
+ Vt,
1343
+ {
1344
+ species: s,
1345
+ language: r,
1346
+ onClose: a,
1347
+ createDescendant: f
1348
+ }
1349
+ ),
1350
+ s.ancestor ? n(s) && /* @__PURE__ */ d.jsx("button", { type: "button", onClick: async () => {
1351
+ try {
1352
+ await (b == null ? void 0 : b()), a == null || a();
1353
+ } catch (i) {
1354
+ console.error(i);
1355
+ }
1356
+ }, children: mt("spbtn04" + (s.ancestor.ancestor ? "_0" : ""), r ?? "") }) : /* @__PURE__ */ d.jsx("button", { type: "button", onClick: e, children: mt("spbtn03", r ?? "") }),
1357
+ nt && /* @__PURE__ */ d.jsx(
1358
+ Gt,
1359
+ {
1360
+ species: s,
1361
+ language: r,
1362
+ onClose: a,
1363
+ createAncestor: h
1364
+ }
1365
+ ),
1366
+ /* @__PURE__ */ d.jsx("button", { type: "button", onClick: a, children: mt("spbtn05", r ?? "") })
1367
+ ]
1368
+ }
1369
+ ) }) });
1370
+ }, St = ({
1371
+ name: s,
1372
+ setName: r,
1373
+ apparition: u,
1374
+ setApparition: a,
1375
+ minApparition: c,
1376
+ maxApparition: f,
1377
+ duration: h,
1378
+ setDuration: b,
1379
+ minDuration: j,
1380
+ maxDuration: o,
1381
+ description: R,
1382
+ setDescription: T,
1383
+ language: L,
1384
+ image: U,
1385
+ setImage: P,
1386
+ children: z
1387
+ }) => /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1388
+ /* @__PURE__ */ d.jsx("table", { children: /* @__PURE__ */ d.jsxs("tbody", { children: [
1389
+ /* @__PURE__ */ d.jsxs("tr", { children: [
1390
+ /* @__PURE__ */ d.jsxs("td", { children: [
1391
+ mt("splbl00", L ?? ""),
1392
+ ":"
1393
+ ] }),
1394
+ /* @__PURE__ */ d.jsx("td", { children: /* @__PURE__ */ d.jsx(
1395
+ "input",
1396
+ {
1397
+ type: "text",
1398
+ value: s,
1399
+ onChange: (F) => r(F.target.value)
1400
+ }
1401
+ ) })
1402
+ ] }),
1403
+ /* @__PURE__ */ d.jsxs("tr", { children: [
1404
+ /* @__PURE__ */ d.jsxs("td", { children: [
1405
+ mt("splbl01", L ?? ""),
1406
+ ":"
1407
+ ] }),
1408
+ /* @__PURE__ */ d.jsx("td", { children: /* @__PURE__ */ d.jsx(
1409
+ "input",
1410
+ {
1411
+ type: "number",
1412
+ min: c,
1413
+ max: f,
1414
+ value: u,
1415
+ onChange: (F) => a(Number(F.target.value))
1416
+ }
1417
+ ) })
1418
+ ] }),
1419
+ /* @__PURE__ */ d.jsxs("tr", { children: [
1420
+ /* @__PURE__ */ d.jsxs("td", { children: [
1421
+ mt("splbl02", L ?? ""),
1422
+ ":"
1423
+ ] }),
1424
+ /* @__PURE__ */ d.jsx("td", { children: /* @__PURE__ */ d.jsx(
1425
+ "input",
1426
+ {
1427
+ type: "number",
1428
+ min: j,
1429
+ max: o,
1430
+ value: h,
1431
+ onChange: (F) => b(Number(F.target.value))
1432
+ }
1433
+ ) })
1434
+ ] }),
1435
+ /* @__PURE__ */ d.jsxs("tr", { children: [
1436
+ /* @__PURE__ */ d.jsxs("td", { children: [
1437
+ mt("splbl03", L ?? ""),
1438
+ ":"
1439
+ ] }),
1440
+ /* @__PURE__ */ d.jsx("td", { children: /* @__PURE__ */ d.jsx(
1441
+ "textarea",
1442
+ {
1443
+ value: R,
1444
+ onChange: (F) => T(F.target.value)
1445
+ }
1446
+ ) })
1447
+ ] }),
1448
+ /* @__PURE__ */ d.jsxs("tr", { children: [
1449
+ /* @__PURE__ */ d.jsxs("td", { children: [
1450
+ mt("splbl04", L ?? ""),
1451
+ ":"
1452
+ ] }),
1453
+ /* @__PURE__ */ d.jsx("td", { children: /* @__PURE__ */ d.jsx(
1454
+ "input",
1455
+ {
1456
+ type: "text",
1457
+ value: U,
1458
+ onChange: (F) => P(F.target.value)
1459
+ }
1460
+ ) })
1461
+ ] }),
1462
+ /* @__PURE__ */ d.jsx("tr", { children: /* @__PURE__ */ d.jsx("td", { colSpan: 2, children: /* @__PURE__ */ d.jsx(
1463
+ "img",
1464
+ {
1465
+ src: U,
1466
+ style: { height: "100px" }
1467
+ }
1468
+ ) }) })
1469
+ ] }) }),
1470
+ z
1471
+ ] }), Vt = ({ species: s, language: r, onClose: u, createDescendant: a }) => {
1472
+ const [c, f] = X(""), [h, b] = X(s.duration), [j, o] = X(s.duration), [R, T] = X(""), [L, U] = X("");
1473
+ return /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx(
1474
+ St,
1475
+ {
1476
+ name: c,
1477
+ setName: f,
1478
+ apparition: s.apparition + h,
1479
+ setApparition: (P) => b(P - s.apparition),
1480
+ minApparition: s.apparition,
1481
+ maxApparition: s.extinction(),
1482
+ duration: j,
1483
+ setDuration: o,
1484
+ description: R,
1485
+ setDescription: T,
1486
+ image: L,
1487
+ setImage: U,
1488
+ language: r,
1489
+ children: /* @__PURE__ */ d.jsx("button", { type: "button", onClick: async () => {
1490
+ try {
1491
+ await (a == null ? void 0 : a(s, c, h, j, R, L)), u == null || u();
1492
+ } catch (P) {
1493
+ console.error(P);
1494
+ }
1495
+ }, children: mt("cdbtn00", r ?? "") })
1496
+ }
1497
+ ) });
1498
+ }, Gt = ({ species: s, language: r, onClose: u, createAncestor: a }) => {
1499
+ const [c, f] = X(""), [h, b] = X(s.duration), [j, o] = X(s.duration), [R, T] = X(""), [L, U] = X("");
1500
+ return /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx(
1501
+ St,
1502
+ {
1503
+ name: c,
1504
+ setName: f,
1505
+ apparition: s.apparition - h,
1506
+ setApparition: (P) => {
1507
+ b(s.apparition - P), o(Math.max(s.apparition - P, j));
1508
+ },
1509
+ maxApparition: s.apparition,
1510
+ duration: j,
1511
+ setDuration: o,
1512
+ minDuration: h,
1513
+ description: R,
1514
+ setDescription: T,
1515
+ image: L,
1516
+ setImage: U,
1517
+ language: r,
1518
+ children: /* @__PURE__ */ d.jsx("button", { type: "button", onClick: async () => {
1519
+ try {
1520
+ await (a == null ? void 0 : a(s, c, h, j, R, L)), u == null || u();
1521
+ } catch (P) {
1522
+ console.error(P);
1523
+ }
1524
+ }, children: mt("cdbtn00", r ?? "") })
1525
+ }
1526
+ ) });
1527
+ }, Xt = ({ open: s, onClose: r, children: u }) => /* @__PURE__ */ d.jsx(
1528
+ "div",
1529
+ {
1530
+ style: { backgroundColor: s ? "rgba(0, 0, 0, 0.2)" : "rgba(0, 0, 0, 0)" },
1531
+ className: `flex fixed inset-0 justify-center items-center transition-colors duration-300 ease-in-out ${s ? "visible" : "hidden"}`,
1532
+ onClick: r,
1533
+ children: /* @__PURE__ */ d.jsx(
1534
+ "div",
1535
+ {
1536
+ onClick: (a) => a.stopPropagation(),
1537
+ className: "flex justify-center items-center",
1538
+ children: u
1539
+ }
1540
+ )
1541
+ }
1542
+ );
1543
+ export {
1544
+ ne as Menu,
1545
+ Zt as MultiplePhTrees,
1546
+ qt as PhTree,
1547
+ yt as Species,
1548
+ mt as codeText,
1549
+ te as codeTextAlt,
1550
+ ee as getLanguageOptions
1551
+ };