UNPKG

@nfdi4plants/swate-components

Version:

Customizable React components for ontology annotation, based on Swate and the ARC.

1,858 lines 241 kB
import * as Zn from "react"; import ka, { createElement as S, useEffect as $a, useLayoutEffect as Na, useState as Bi } from "react"; import { createPortal as Aa } from "react-dom"; function Pt(e) { return Array.isArray(e) || ArrayBuffer.isView(e); } function Ma(e) { return e != null && typeof e == "object" && Symbol.iterator in e; } function Oa(e) { return e != null && typeof e.GetEnumerator == "function"; } function Ra(e) { return e != null && typeof e.CompareTo == "function"; } function Fa(e) { return e != null && typeof e.Equals == "function"; } function Ju(e) { return e != null && typeof e.GetHashCode == "function"; } function Pa(e) { return e != null && typeof e.Dispose == "function"; } function ae(e) { Pa(e) && e.Dispose(); } function P() { return null; } function xs(e, t) { var n, r; return ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === ((r = Object.getPrototypeOf(t)) == null ? void 0 : r.constructor); } class Da { constructor(t) { this.iter = t, this.current = P(); } "System.Collections.Generic.IEnumerator`1.get_Current"() { return this.current; } "System.Collections.IEnumerator.get_Current"() { return this.current; } "System.Collections.IEnumerator.MoveNext"() { const t = this.iter.next(); return this.current = t.value, !t.done; } "System.Collections.IEnumerator.Reset"() { throw new Error("JS iterators cannot be reset"); } Dispose() { } } function ne(e) { return Oa(e) ? e.GetEnumerator() : new Da(e[Symbol.iterator]()); } function ar(e) { return { next() { const t = e["System.Collections.IEnumerator.MoveNext"](), n = t ? e["System.Collections.Generic.IEnumerator`1.get_Current"]() : void 0; return { done: !t, value: n }; } }; } class Re { constructor(t) { this.factory = t, this.isValueCreated = !1; } get Value() { return this.isValueCreated || (this.createdValue = this.factory(), this.isValueCreated = !0), this.createdValue; } get IsValueCreated() { return this.isValueCreated; } } function ye(e, t) { return e.toString(10).padStart(t, "0"); } function Gi(e) { const t = e; return typeof t.offset == "number" ? t.offset : e.kind === 1 ? 0 : e.getTimezoneOffset() * -6e4; } function zu(e, t) { return e = e, e.toString(t); } function xa(e, t) { return e = e, e.toString(t); } let Xs = class Dr { static id(t) { return Dr.idMap.has(t) || Dr.idMap.set(t, ++Dr.count), Dr.idMap.get(t); } }; Xs.idMap = /* @__PURE__ */ new WeakMap(); Xs.count = 0; function Ys(e) { let t = 0, n = 5381; const r = e.length; for (; t < r; ) n = n * 33 ^ e.charCodeAt(t++); return n; } function zr(e) { return e * 2654435761 | 0; } function Wu(e) { return Ys(e.toString(32)); } function cr(e) { let t = 0; const n = e.length; for (let r = 0; r < n; r++) { const s = e[r]; t = (t << 5) + t ^ s; } return t; } function Ba(e) { if (e == null) return 0; switch (typeof e) { case "boolean": return e ? 1 : 0; case "number": return zr(e); case "bigint": return Wu(e); case "string": return Ys(e); default: return zr(Xs.id(e)); } } function Ga(e) { return Ju(e) ? e.GetHashCode() : Ba(e); } function La(e) { return e.getTime(); } function Ha(e) { const t = e.length, n = new Array(t); for (let r = 0; r < t; r++) n[r] = Ue(e[r]); return cr(n); } function Ue(e) { var t; if (e == null) return 0; switch (typeof e) { case "boolean": return e ? 1 : 0; case "number": return zr(e); case "bigint": return Wu(e); case "string": return Ys(e); default: { if (Ju(e)) return e.GetHashCode(); if (Pt(e)) return Ha(e); if (e instanceof Date) return La(e); if (((t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) === Object) { const n = Object.values(e).map((r) => Ue(r)); return cr(n); } else return zr(Xs.id(e)); } } } function ho(e) { return Ga(e); } function Go(e, t, n) { if (e == null) return t == null; if (t == null || e.length !== t.length) return !1; for (let r = 0; r < e.length; r++) if (!n(e[r], t[r])) return !1; return !0; } function Ku(e, t) { return Go(e, t, Q); } function ja(e, t) { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return !1; n.sort(), r.sort(); for (let s = 0; s < n.length; s++) if (n[s] !== r[s] || !Q(e[n[s]], t[r[s]])) return !1; return !0; } function Q(e, t) { var n; return e === t ? !0 : e == null ? t == null : t == null ? !1 : Fa(e) ? e.Equals(t) : Pt(e) ? Pt(t) && Ku(e, t) : typeof e != "object" ? !1 : e instanceof Date ? t instanceof Date && Zu(e, t) === 0 : ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === Object && ja(e, t); } function Zu(e, t) { let n, r; return "offset" in e && "offset" in t ? (n = e.getTime(), r = t.getTime()) : (n = e.getTime() + Gi(e), r = t.getTime() + Gi(t)), n === r ? 0 : n < r ? -1 : 1; } function Ut(e, t) { return e === t ? 0 : e < t ? -1 : 1; } function Va(e, t, n) { if (e == null) return t == null ? 0 : 1; if (t == null) return -1; if (e.length !== t.length) return e.length < t.length ? -1 : 1; for (let r = 0, s = 0; r < e.length; r++) if (s = n(e[r], t[r]), s !== 0) return s; return 0; } function Qu(e, t) { return Va(e, t, dt); } function Ua(e, t) { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return n.length < r.length ? -1 : 1; n.sort(), r.sort(); for (let s = 0, o = 0; s < n.length; s++) { const i = n[s]; if (i !== r[s]) return i < r[s] ? -1 : 1; if (o = dt(e[i], t[i]), o !== 0) return o; } return 0; } function dt(e, t) { var n; return e === t ? 0 : e == null ? t == null ? 0 : -1 : t == null ? 1 : Ra(e) ? e.CompareTo(t) : Pt(e) ? Pt(t) ? Qu(e, t) : -1 : typeof e != "object" ? e < t ? -1 : 1 : e instanceof Date ? t instanceof Date ? Zu(e, t) : -1 : ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === Object ? Ua(e, t) : -1; } function q(e) { const t = {}; for (const n of e) t[n[0]] = n[1]; return t; } function qa(e, t = 0) { const n = Math.pow(10, t), r = +(t ? e * n : e).toFixed(8), s = Math.floor(r), o = r - s, i = 1e-8, l = o > 0.5 - i && o < 0.5 + i ? s % 2 === 0 ? s : s + 1 : Math.round(r); return t ? l / n : l; } const Xu = /* @__PURE__ */ new WeakMap(); function Ja(e) { if (e == null) return null; const t = (n, r) => e(n)(r); return Xu.set(t, e), t; } function za(e) { return Xu.get(e) ?? ((t) => (n) => e(t, n)); } function Wa(e) { let t = 0, n = "["; for (const r of e) { if (t === 0) n += qe(r); else if (t === 100) { n += "; ..."; break; } else n += "; " + qe(r); t++; } return n + "]"; } function qe(e, t = 0) { var n; if (e != null && typeof e == "object") { if (typeof e.toString == "function") return e.toString(); if (Symbol.iterator in e) return Wa(e); { const r = (n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor; return r === Object && t < 10 ? "{ " + Object.entries(e).map(([s, o]) => s + " = " + qe(o, t + 1)).join(` `) + " }" : (r == null ? void 0 : r.name) ?? ""; } } return String(e); } function Ka(e, t) { if (t.length === 0) return e; { let n, r = !0; return t.length === 1 ? (n = qe(t[0]), r = n.indexOf(" ") >= 0) : n = t.map((s) => qe(s)).join(", "), e + (r ? " (" : " ") + n + (r ? ")" : ""); } } let Gt = class { get name() { return this.cases()[this.tag]; } toJSON() { return this.fields.length === 0 ? this.name : [this.name].concat(this.fields); } toString() { return Ka(this.name, this.fields); } GetHashCode() { const t = this.fields.map((n) => Ue(n)); return t.splice(0, 0, zr(this.tag)), cr(t); } Equals(t) { return this === t ? !0 : xs(this, t) && this.tag === t.tag ? Ku(this.fields, t.fields) : !1; } CompareTo(t) { return this === t ? 0 : xs(this, t) ? this.tag === t.tag ? Qu(this.fields, t.fields) : this.tag < t.tag ? -1 : 1 : -1; } }; function Za(e) { const t = {}, n = Object.keys(e); for (let r = 0; r < n.length; r++) t[n[r]] = e[n[r]]; return t; } function Qa(e) { return "{ " + Object.entries(e).map(([t, n]) => t + " = " + qe(n)).join(` `) + " }"; } function Xa(e) { const t = Object.values(e).map((n) => Ue(n)); return cr(t); } function Ya(e, t) { if (e === t) return !0; if (xs(e, t)) { const n = Object.keys(e); for (let r = 0; r < n.length; r++) if (!Q(e[n[r]], t[n[r]])) return !1; return !0; } else return !1; } function ec(e, t) { if (e === t) return 0; if (xs(e, t)) { const n = Object.keys(e); for (let r = 0; r < n.length; r++) { const s = dt(e[n[r]], t[n[r]]); if (s !== 0) return s; } return 0; } else return -1; } let Tt = class { toJSON() { return Za(this); } toString() { return Qa(this); } GetHashCode() { return Xa(this); } Equals(t) { return Ya(this, t); } CompareTo(t) { return ec(this, t); } }; class an { get contents() { return this.getter(); } set contents(t) { this.setter(t); } constructor(t, n) { typeof n == "function" ? (this.getter = t, this.setter = n) : (this.getter = () => t, this.setter = (r) => { t = r; }); } } class tc { constructor(t) { this.message = t; } } function nc(e) { return e instanceof tc || e instanceof Error; } function rc(e) { return e instanceof Promise; } function Bs(e) { return nc(e) || rc(e) ? e : new Error(String(e)); } var me = {}, sc = 28, oc = 1, fr = 1e6, ic = 1e6, uc = -29, lc = 29, ac = !1, es = "[big.js] ", $n = es + "Invalid ", eo = $n + "decimal places", cc = $n + "rounding mode", Yu = es + "Division by zero", At = void 0, fc = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; function el() { function e(t) { var n = this; if (!(n instanceof e)) return t === At ? el() : new e(t); if (t instanceof e) n.s = t.s, n.e = t.e, n.c = t.c.slice(), hc(n); else { if (typeof t != "string") { if (e.strict === !0) throw TypeError($n + "number"); t = t === 0 && 1 / t < 0 ? "-0" : String(t); } dc(n, t); } n.constructor = e; } return e.prototype = me, e.DP = sc, e.RM = oc, e.NE = uc, e.PE = lc, e.strict = ac, e; } function hc(e) { if (e.c.length > 1 && !e.c[0]) { let t = e.c.findIndex((n) => n); e.c = e.c.slice(t), e.e = e.e - t; } } function dc(e, t) { var n, r, s; if (!fc.test(t)) throw Error($n + "number"); for (e.s = t.charAt(0) == "-" ? (t = t.slice(1), -1) : 1, (n = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (n < 0 && (n = r), n += +t.slice(r + 1), t = t.substring(0, r)) : n < 0 && (n = t.length), s = t.length, r = 0; r < n && r < s && t.charAt(r) == "0"; ) ++r; if (r == s) e.c = [e.e = 0]; else for (e.e = n - r - 1, e.c = [], n = 0; r < s; ) e.c[n++] = +t.charAt(r++); return e = fn(e, Je.DP + 1, Je.RM), e; } function fn(e, t, n, r) { var s = e.c; if (n === At && (n = Je.RM), n !== 0 && n !== 1 && n !== 2 && n !== 3) throw Error(cc); if (t < 1) r = n === 3 && (r || !!s[0]) || t === 0 && (n === 1 && s[0] >= 5 || n === 2 && (s[0] > 5 || s[0] === 5 && (r || s[1] !== At))), s.length = 1, r ? (e.e = e.e - t + 1, s[0] = 1) : s[0] = e.e = 0; else if (t < s.length) { const o = s.findIndex((i, l) => l >= t && i > 0) < 0; if (r = n === 1 && s[t] >= 5 || n === 2 && (s[t] > 5 || s[t] === 5 && (r || s[t + 1] !== At || s[t - 1] & 1)) || n === 3 && (r || !o), s.length = t--, r) for (; ++s[t] > 9; ) s[t] = 0, t-- || (++e.e, s.unshift(1)); for (t = s.length; !s[--t]; ) s.pop(); } return e; } function hr(e, t, n) { var r = e.e, s = e.c.join(""), o = s.length; if (t) s = s.charAt(0) + (o > 1 ? "." + s.slice(1) : "") + (r < 0 ? "e" : "e+") + r; else if (r < 0) { for (; ++r; ) s = "0" + s; s = "0." + s; } else if (r > 0) if (++r > o) for (r -= o; r--; ) s += "0"; else r < o && (s = s.slice(0, r) + "." + s.slice(r)); else o > 1 && (s = s.charAt(0) + "." + s.slice(1)); return e.s < 0 && n ? "-" + s : s; } me.abs = function() { var e = new this.constructor(this); return e.s = 1, e; }; me.cmp = function(s) { var t, n = this.constructor, r = new n(this), s = new n(s), o = r.c, i = s.c, l = r.s, u = s.s, a = r.e, c = s.e; if (!o[0] || !i[0]) return o[0] ? l : i[0] ? -u : 0; if (l != u) return l; if (t = l < 0, a != c) return a > c ^ t ? 1 : -1; for (u = Math.max(o.length, i.length), l = 0; l < u; l++) if (a = l < o.length ? o[l] : 0, c = l < i.length ? i[l] : 0, a != c) return a > c ^ t ? 1 : -1; return 0; }; me.div = function(r) { var t = this.constructor, n = new t(this), r = new t(r), s = n.c, o = r.c, i = n.s == r.s ? 1 : -1, l = t.DP; if (l !== ~~l || l < 0 || l > fr) throw Error(eo); if (!o[0]) throw Error(Yu); if (!s[0]) return r.s = i, r.c = [r.e = 0], r; var u, a, c, m, p, w = o.slice(), y = u = o.length, I = s.length, b = s.slice(0, u), v = b.length, D = r, x = D.c = [], X = 0, ee = l + (D.e = n.e - r.e) + 1; for (D.s = i, i = ee < 0 ? 0 : ee, w.unshift(0); v++ < u; ) b.push(0); do { for (c = 0; c < 10; c++) { if (u != (v = b.length)) m = u > v ? 1 : -1; else for (p = -1, m = 0; ++p < u; ) if (o[p] != b[p]) { m = o[p] > b[p] ? 1 : -1; break; } if (m < 0) { for (a = v == u ? o : w; v; ) { if (b[--v] < a[v]) { for (p = v; p && !b[--p]; ) b[p] = 9; --b[p], b[v] += 10; } b[v] -= a[v]; } for (; !b[0]; ) b.shift(); } else break; } x[X++] = m ? c : ++c, b[0] && m ? b[v] = s[y] || 0 : b = [s[y]]; } while ((y++ < I || b[0] !== At) && i--); return !x[0] && X != 1 && (x.shift(), D.e--, ee--), X > ee && fn(D, ee, t.RM, b[0] !== At), D; }; me.eq = function(e) { return this.cmp(e) === 0; }; me.gt = function(e) { return this.cmp(e) > 0; }; me.gte = function(e) { return this.cmp(e) > -1; }; me.lt = function(e) { return this.cmp(e) < 0; }; me.lte = function(e) { return this.cmp(e) < 1; }; me.minus = me.sub = function(l) { var t, n, r, s, o = this.constructor, i = new o(this), l = new o(l), u = i.s, a = l.s; if (u != a) return l.s = -a, i.plus(l); var c = i.c.slice(), m = i.e, p = l.c, w = l.e; if (!c[0] || !p[0]) return p[0] ? l.s = -a : c[0] ? l = new o(i) : l.s = 1, l; if (u = m - w) { for ((s = u < 0) ? (u = -u, r = c) : (w = m, r = p), r.reverse(), a = u; a--; ) r.push(0); r.reverse(); } else for (n = ((s = c.length < p.length) ? c : p).length, u = a = 0; a < n; a++) if (c[a] != p[a]) { s = c[a] < p[a]; break; } if (s && (r = c, c = p, p = r, l.s = -l.s), (a = (n = p.length) - (t = c.length)) > 0) for (; a--; ) c[t++] = 0; for (a = t; n > u; ) { if (c[--n] < p[n]) { for (t = n; t && !c[--t]; ) c[t] = 9; --c[t], c[n] += 10; } c[n] -= p[n]; } for (; c[--a] === 0; ) c.pop(); for (; c[0] === 0; ) c.shift(), --w; return c[0] || (l.s = 1, c = [w = 0]), l.c = c, l.e = w, l; }; me.mod = function(s) { var t, n = this.constructor, r = new n(this), s = new n(s), o = r.s, i = s.s; if (!s.c[0]) throw Error(Yu); return r.s = s.s = 1, t = s.cmp(r) == 1, r.s = o, s.s = i, t ? new n(r) : (o = n.DP, i = n.RM, n.DP = n.RM = 0, r = r.div(s), n.DP = o, n.RM = i, this.minus(r.times(s))); }; me.plus = me.add = function(i) { var t, n, r, s = this.constructor, o = new s(this), i = new s(i); if (o.s != i.s) return i.s = -i.s, o.minus(i); var l = o.e, u = o.c, a = i.e, c = i.c; if (!u[0] || !c[0]) return c[0] || (u[0] ? i = new s(o) : i.s = o.s), i; if (u = u.slice(), t = l - a) { for (t > 0 ? (a = l, r = c) : (t = -t, r = u), r.reverse(); t--; ) r.push(0); r.reverse(); } for (u.length - c.length < 0 && (r = c, c = u, u = r), t = c.length, n = 0; t; u[t] %= 10) n = (u[--t] = u[t] + c[t] + n) / 10 | 0; for (n && (u.unshift(n), ++a), t = u.length; u[--t] === 0; ) u.pop(); return i.c = u, i.e = a, i; }; me.pow = function(e) { var t = this.constructor, n = new t(this), r = new t("1"), s = new t("1"), o = e < 0; if (e !== ~~e || e < -1e6 || e > ic) throw Error($n + "exponent"); for (o && (e = -e); e & 1 && (r = r.times(n)), e >>= 1, !!e; ) n = n.times(n); return o ? s.div(r) : r; }; me.prec = function(e, t) { if (e !== ~~e || e < 1 || e > fr) throw Error($n + "precision"); return fn(new this.constructor(this), e, t); }; me.round = function(e, t) { if (e === At) e = 0; else if (e !== ~~e || e < -1e6 || e > fr) throw Error(eo); return fn(new this.constructor(this), e + this.e + 1, t); }; me.sqrt = function() { var e, t, n, r = this.constructor, s = new r(this), o = s.s, i = s.e, l = new r("0.5"); if (!s.c[0]) return new r(s); if (o < 0) throw Error(es + "No square root"); o = Math.sqrt(s + ""), o === 0 || o === 1 / 0 ? (t = s.c.join(""), t.length + i & 1 || (t += "0"), o = Math.sqrt(t), i = ((i + 1) / 2 | 0) - (i < 0 || i & 1), e = new r((o == 1 / 0 ? "5e" : (o = o.toExponential()).slice(0, o.indexOf("e") + 1)) + i)) : e = new r(o + ""), i = e.e + (r.DP += 4); do n = e, e = l.times(n.plus(s.div(n))); while (n.c.slice(0, i).join("") !== e.c.slice(0, i).join("")); return fn(e, (r.DP -= 4) + e.e + 1, r.RM); }; me.times = me.mul = function(s) { var t, n = this.constructor, r = new n(this), s = new n(s), o = r.c, i = s.c, l = o.length, u = i.length, a = r.e, c = s.e; if (s.s = r.s == s.s ? 1 : -1, !o[0] || !i[0]) return s.c = [s.e = 0], s; for (s.e = a + c, l < u && (t = o, o = i, i = t, c = l, l = u, u = c), t = new Array(c = l + u); c--; ) t[c] = 0; for (a = u; a--; ) { for (u = 0, c = l + a; c > a; ) u = t[c] + i[a] * o[c - a - 1] + u, t[c--] = u % 10, u = u / 10 | 0; t[c] = u; } for (u ? ++s.e : t.shift(), a = t.length; !t[--a]; ) t.pop(); return s.c = t, s; }; me.toExponential = function(e, t) { var n = this, r = n.c[0]; if (e !== At) { if (e !== ~~e || e < 0 || e > fr) throw Error(eo); for (n = fn(new n.constructor(n), ++e, t); n.c.length < e; ) n.c.push(0); } return hr(n, !0, !!r); }; me.toFixed = function(e, t) { var n = this, r = n.c[0]; if (e !== At) { if (e !== ~~e || e < 0 || e > fr) throw Error(eo); for (n = fn(new n.constructor(n), e + n.e + 1, t), e = e + n.e + 1; n.c.length < e; ) n.c.push(0); } return hr(n, !1, !!r); }; me.toJSON = me.toString = function() { var e = this, t = e.constructor; return hr(e, e.e <= t.NE || e.e >= t.PE, !!e.c[0]); }; me.toNumber = function() { var e = Number(hr(this, !0, !0)); if (this.constructor.strict === !0 && !this.eq(e.toString())) throw Error(es + "Imprecise conversion"); return e; }; me.toPrecision = function(e, t) { var n = this, r = n.constructor, s = n.c[0]; if (e !== At) { if (e !== ~~e || e < 1 || e > fr) throw Error($n + "precision"); for (n = fn(new r(n), e, t); n.c.length < e; ) n.c.push(0); } return hr(n, e <= n.e || n.e <= r.NE || n.e >= r.PE, !!s); }; me.valueOf = function() { var e = this, t = e.constructor; if (t.strict === !0) throw Error(es + "valueOf disallowed"); return hr(e, e.e <= t.NE || e.e >= t.PE, !0); }; var Je = el(); const Nn = Symbol("numeric"); function tl(e) { return typeof e == "number" || typeof e == "bigint" || (e == null ? void 0 : e[Nn]); } function mc(e, t) { return typeof e == "number" || typeof e == "bigint" ? e < t ? -1 : e > t ? 1 : 0 : e.CompareTo(t); } function Lo(e, t) { return typeof e == "number" ? e * t : typeof e == "bigint" ? e * BigInt(t) : e[Nn]().multiply(t); } function Is(e, t) { return typeof e == "number" ? e.toFixed(t) : typeof e == "bigint" ? e : e[Nn]().toFixed(t); } function Gs(e, t) { return typeof e == "number" ? e.toPrecision(t) : typeof e == "bigint" ? e : e[Nn]().toPrecision(t); } function Ls(e, t) { return typeof e == "number" ? e.toExponential(t) : typeof e == "bigint" ? e : e[Nn]().toExponential(t); } function Hs(e) { return typeof e == "number" ? (Number(e) >>> 0).toString(16) : typeof e == "bigint" ? BigInt.asUintN(64, e).toString(16) : e[Nn]().toHex(); } Je.prototype.GetHashCode = function() { return cr([this.s, this.e].concat(this.c)); }; Je.prototype.Equals = function(e) { return !this.cmp(e); }; Je.prototype.CompareTo = function(e) { return this.cmp(e); }; Je.prototype[Nn] = function() { const e = this; return { multiply: (t) => e.mul(t), toPrecision: (t) => e.toPrecision(t), toExponential: (t) => e.toExponential(t), toFixed: (t) => e.toFixed(t), toHex: () => (Number(e) >>> 0).toString(16) }; }; new Je(0); new Je(1); new Je(-1); new Je("79228162514264337593543950335"); new Je("-79228162514264337593543950335"); function pc(e) { return e.toString(); } function gc(e, t) { const n = new Uint8Array(t * 301 / 1e3 + 1 | 0); let r = 1; for (let s = e.length - 1; s >= 0; s--) { let o = e[s]; for (let i = 0; i < r; i++) { const l = n[i] * 16 + o | 0; n[i] = l % 10 | 0, o = l / 10 | 0; } for (; o > 0; ) n[r++] = o % 10 | 0, o = o / 10 | 0; } return n.slice(0, r); } function mo(e, t, n) { for (let r = 0; r < 8; r++) e[n + r] = t >> r * 4 & 15; } function yc(e, t, n, r, s) { const i = new Uint8Array(24); mo(i, e, 0), mo(i, t, 8), mo(i, n, 16); const l = gc(i, 96); s = s & 127; const u = new Je(0); return u.c = Array.from(l.reverse()), u.e = l.length - s - 1, u.s = r ? -1 : 1, new Je(u); } let yi = class { constructor(t, n, r, s, o, i, l) { this.fullname = t, this.generics = n, this.construct = r, this.parent = s, this.fields = o, this.cases = i, this.enumCases = l; } toString() { return Ie(this); } GetHashCode() { return nl(this); } Equals(t) { return js(this, t); } }; function ze(e) { return e.generics != null ? e.generics : []; } function nl(e) { const t = Ys(e.fullname), n = ze(e).map(nl); return cr([t, ...n]); } function js(e, t) { return e.fullname === "" ? t.fullname === "" && Go(Wr(e), Wr(t), ([n, r], [s, o]) => n === s && js(r, o)) : e.fullname === t.fullname && Go(ze(e), ze(t), js); } function $e(e) { if (Array.isArray(e)) return e[0]; if (e instanceof yi) { const t = to(e); if (t != null) return $e(t) + "[]"; { const n = e.fullname.lastIndexOf("."); return n === -1 ? e.fullname : e.fullname.substr(n + 1); } } else return e.name; } function Ie(e) { const t = to(e); return t != null ? Ie(t) + "[]" : e.generics == null || e.generics.length === 0 ? e.fullname : e.fullname + "[" + e.generics.map((n) => Ie(n)).join(",") + "]"; } function _c(e) { return to(e) != null; } function to(e) { var t; return e.fullname === "[]" && ((t = e.generics) == null ? void 0 : t.length) === 1 ? e.generics[0] : void 0; } function wc(e) { return e.generics != null && e.generics.length > 0; } function Cc(e) { return e.enumCases != null && e.enumCases.length > 0; } function bc(e) { var t; return (t = e.generics) == null ? void 0 : t[0]; } function rl(e) { if (e.cases != null) return e.cases(); throw new Error(`${e.fullname} is not an F# union type`); } function Wr(e) { if (e.fields != null) return e.fields(); throw new Error(`${e.fullname} is not an F# record type`); } function Sc(e) { if (ol(e) && e.generics != null) return e.generics; throw new Error(`${e.fullname} is not a tuple type`); } function sl(e) { if (no(e) && e.generics != null) { const t = e.generics; return [t[0], t[1]]; } else throw new Error(`${e.fullname} is not an F# function type`); } function Tc(e) { return e instanceof yi ? e.cases != null : e instanceof Gt; } function vc(e) { return e instanceof yi ? e.fields != null : e instanceof Tt; } function ol(e) { return e.fullname.startsWith("System.Tuple"); } function no(e) { return e.fullname === "Microsoft.FSharp.Core.FSharpFunc`2"; } function Ec(e, t) { const r = rl(t)[e.tag]; if (r == null) throw new Error(`Cannot find case ${e.name} in union type`); return [r, e.fields]; } function Ic(e) { return e.fields == null ? [] : e.fields; } function kc(e, t) { return e[t[0]]; } function kt(e, t) { const n = (e.fields || []).length; if (t.length !== n) throw new Error(`Expected an array of length ${n} but got ${t.length}`); const r = e.declaringType.construct; return r == null ? {} : (e.declaringType.cases ? e.declaringType.cases().length == 1 : !1) ? new r(...t) : new r(e.tag, t); } function il(e, t) { const n = Wr(e); if (n.length !== t.length) throw new Error(`Expected an array of length ${n.length} but got ${t.length}`); return e.construct != null ? new e.construct(...t) : n.reduce((r, [s, o], i) => (r[s] = t[i], r), {}); } function Kr(e) { return Array.isArray(e) || ArrayBuffer.isView(e); } function $c(e) { return e != null && typeof e.CompareTo == "function"; } function Nc(e) { return e != null && typeof e.Equals == "function"; } function Ac(e) { return e != null && typeof e.GetHashCode == "function"; } function Vs(e, t) { var n, r; return ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === ((r = Object.getPrototypeOf(t)) == null ? void 0 : r.constructor); } function Li(e, t) { return e.toString(10).padStart(t, "0"); } function Hi(e) { const t = e; return typeof t.offset == "number" ? t.offset : e.kind === 1 ? 0 : e.getTimezoneOffset() * -6e4; } class rn { static id(t) { return rn.idMap.has(t) || rn.idMap.set(t, ++rn.count), rn.idMap.get(t); } } rn.idMap = /* @__PURE__ */ new WeakMap(); rn.count = 0; function _i(e) { let t = 0, n = 5381; const r = e.length; for (; t < r; ) n = n * 33 ^ e.charCodeAt(t++); return n; } function Ho(e) { return e * 2654435761 | 0; } function Mc(e) { return _i(e.toString(32)); } function ts(e) { let t = 0; const n = e.length; for (let r = 0; r < n; r++) { const s = e[r]; t = (t << 5) + t ^ s; } return t; } function Oc(e) { return e.getTime(); } function Rc(e) { const t = e.length, n = new Array(t); for (let r = 0; r < t; r++) n[r] = ns(e[r]); return ts(n); } function ns(e) { var t; if (e == null) return 0; switch (typeof e) { case "boolean": return e ? 1 : 0; case "number": return Ho(e); case "bigint": return Mc(e); case "string": return _i(e); default: { if (Ac(e)) return e.GetHashCode(); if (Kr(e)) return Rc(e); if (e instanceof Date) return Oc(e); if (((t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) === Object) { const n = Object.values(e).map((r) => ns(r)); return ts(n); } else return Ho(rn.id(e)); } } } function jo(e, t, n) { if (e == null) return t == null; if (t == null || e.length !== t.length) return !1; for (let r = 0; r < e.length; r++) if (!n(e[r], t[r])) return !1; return !0; } function ul(e, t) { return jo(e, t, ro); } function Fc(e, t) { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return !1; n.sort(), r.sort(); for (let s = 0; s < n.length; s++) if (n[s] !== r[s] || !ro(e[n[s]], t[r[s]])) return !1; return !0; } function ro(e, t) { var n; return e === t ? !0 : e == null ? t == null : t == null ? !1 : Nc(e) ? e.Equals(t) : Kr(e) ? Kr(t) && ul(e, t) : typeof e != "object" ? !1 : e instanceof Date ? t instanceof Date && ll(e, t) === 0 : ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === Object && Fc(e, t); } function ll(e, t) { let n, r; return "offset" in e && "offset" in t ? (n = e.getTime(), r = t.getTime()) : (n = e.getTime() + Hi(e), r = t.getTime() + Hi(t)), n === r ? 0 : n < r ? -1 : 1; } function Pc(e, t, n) { if (e == null) return t == null ? 0 : 1; if (t == null) return -1; if (e.length !== t.length) return e.length < t.length ? -1 : 1; for (let r = 0, s = 0; r < e.length; r++) if (s = n(e[r], t[r]), s !== 0) return s; return 0; } function al(e, t) { return Pc(e, t, so); } function Dc(e, t) { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return n.length < r.length ? -1 : 1; n.sort(), r.sort(); for (let s = 0, o = 0; s < n.length; s++) { const i = n[s]; if (i !== r[s]) return i < r[s] ? -1 : 1; if (o = so(e[i], t[i]), o !== 0) return o; } return 0; } function so(e, t) { var n; return e === t ? 0 : e == null ? t == null ? 0 : -1 : t == null ? 1 : $c(e) ? e.CompareTo(t) : Kr(e) ? Kr(t) ? al(e, t) : -1 : typeof e != "object" ? e < t ? -1 : 1 : e instanceof Date ? t instanceof Date ? ll(e, t) : -1 : ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === Object ? Dc(e, t) : -1; } let ji = class Vo { constructor(t) { this.value = t; } toJSON() { return this.value; } // Don't add "Some" for consistency with erased options toString() { return String(this.value); } GetHashCode() { return ns(this.value); } Equals(t) { return t == null ? !1 : ro(this.value, t instanceof Vo ? t.value : t); } CompareTo(t) { return t == null ? 1 : so(this.value, t instanceof Vo ? t.value : t); } }; function xc(e) { return e == null || e instanceof ji ? new ji(e) : e; } function Bc(e) { let t = 0, n = "["; for (const r of e) { if (t === 0) n += En(r); else if (t === 100) { n += "; ..."; break; } else n += "; " + En(r); t++; } return n + "]"; } function En(e, t = 0) { var n; if (e != null && typeof e == "object") { if (typeof e.toString == "function") return e.toString(); if (Symbol.iterator in e) return Bc(e); { const r = (n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor; return r === Object && t < 10 ? "{ " + Object.entries(e).map(([s, o]) => s + " = " + En(o, t + 1)).join(` `) + " }" : (r == null ? void 0 : r.name) ?? ""; } } return String(e); } function Gc(e, t) { if (t.length === 0) return e; { let n, r = !0; return t.length === 1 ? (n = En(t[0]), r = n.indexOf(" ") >= 0) : n = t.map((s) => En(s)).join(", "), e + (r ? " (" : " ") + n + (r ? ")" : ""); } } class Lc { get name() { return this.cases()[this.tag]; } toJSON() { return this.fields.length === 0 ? this.name : [this.name].concat(this.fields); } toString() { return Gc(this.name, this.fields); } GetHashCode() { const t = this.fields.map((n) => ns(n)); return t.splice(0, 0, Ho(this.tag)), ts(t); } Equals(t) { return this === t ? !0 : Vs(this, t) && this.tag === t.tag ? ul(this.fields, t.fields) : !1; } CompareTo(t) { return this === t ? 0 : Vs(this, t) ? this.tag === t.tag ? al(this.fields, t.fields) : this.tag < t.tag ? -1 : 1 : -1; } } function Hc(e) { const t = {}, n = Object.keys(e); for (let r = 0; r < n.length; r++) t[n[r]] = e[n[r]]; return t; } function jc(e) { return "{ " + Object.entries(e).map(([t, n]) => t + " = " + En(n)).join(` `) + " }"; } function Vc(e) { const t = Object.values(e).map((n) => ns(n)); return ts(t); } function Uc(e, t) { if (e === t) return !0; if (Vs(e, t)) { const n = Object.keys(e); for (let r = 0; r < n.length; r++) if (!ro(e[n[r]], t[n[r]])) return !1; return !0; } else return !1; } function qc(e, t) { if (e === t) return 0; if (Vs(e, t)) { const n = Object.keys(e); for (let r = 0; r < n.length; r++) { const s = so(e[n[r]], t[n[r]]); if (s !== 0) return s; } return 0; } else return -1; } class An { toJSON() { return Hc(this); } toString() { return jc(this); } GetHashCode() { return Vc(this); } Equals(t) { return Uc(this, t); } CompareTo(t) { return qc(this, t); } } const dr = Symbol("numeric"); function Jc(e) { return typeof e == "number" || typeof e == "bigint" || (e == null ? void 0 : e[dr]); } function zc(e, t) { return typeof e == "number" || typeof e == "bigint" ? e < t ? -1 : e > t ? 1 : 0 : e.CompareTo(t); } function Wc(e, t) { return typeof e == "number" ? e * t : typeof e == "bigint" ? e * BigInt(t) : e[dr]().multiply(t); } function Kc(e, t) { return typeof e == "number" ? e.toFixed(t) : typeof e == "bigint" ? e : e[dr]().toFixed(t); } function Vi(e, t) { return typeof e == "number" ? e.toPrecision(t) : typeof e == "bigint" ? e : e[dr]().toPrecision(t); } function Ui(e, t) { return typeof e == "number" ? e.toExponential(t) : typeof e == "bigint" ? e : e[dr]().toExponential(t); } function qi(e) { return typeof e == "number" ? (Number(e) >>> 0).toString(16) : typeof e == "bigint" ? BigInt.asUintN(64, e).toString(16) : e[dr]().toHex(); } class Zc { constructor(t, n, r, s) { this.declaringType = t, this.tag = n, this.name = r, this.fields = s; } } let vt = class { constructor(t, n, r, s, o, i, l) { this.fullname = t, this.generics = n, this.construct = r, this.parent = s, this.fields = o, this.cases = i, this.enumCases = l; } toString() { return Jo(this); } GetHashCode() { return cl(this); } Equals(t) { return qo(this, t); } }; function Uo(e) { return e.generics != null ? e.generics : []; } function cl(e) { const t = _i(e.fullname), n = Uo(e).map(cl); return ts([t, ...n]); } function qo(e, t) { return e.fullname === "" ? t.fullname === "" && jo(Ji(e), Ji(t), ([n, r], [s, o]) => n === s && qo(r, o)) : e.fullname === t.fullname && jo(Uo(e), Uo(t), qo); } function Un(e, t, n, r) { return new vt(e, t, n, r); } function Mn(e, t, n, r) { return new vt(e, t, n, void 0, r); } function Qc(e, t, n, r) { const s = new vt(e, t, n, void 0, void 0, () => { const o = n.prototype.cases(); return r().map((i, l) => new Zc(s, l, o[l], i)); }); return s; } function qn(e, t) { return new vt("Microsoft.FSharp.Core.FSharpFunc`2", [e, t]); } function Tn(e) { return new vt("Microsoft.FSharp.Core.FSharpOption`1", [e]); } function Xc(e) { return new vt("Microsoft.FSharp.Collections.FSharpList`1", [e]); } function Qn(e) { return new vt("[]", [e]); } const Yc = new vt("Microsoft.FSharp.Core.Unit"), mt = new vt("System.String"), fl = new vt("System.Boolean"), wi = new vt("System.Int32"); function Jo(e) { const t = ef(e); return t != null ? Jo(t) + "[]" : e.generics == null || e.generics.length === 0 ? e.fullname : e.fullname + "[" + e.generics.map((n) => Jo(n)).join(",") + "]"; } function ef(e) { var t; return e.fullname === "[]" && ((t = e.generics) == null ? void 0 : t.length) === 1 ? e.generics[0] : void 0; } function Ji(e) { if (e.fields != null) return e.fields(); throw new Error(`${e.fullname} is not an F# record type`); } function tf(e) { const t = e < 0; e = Math.abs(e); const n = ~~(e / 36e5), r = e % 36e5 / 6e4; return (t ? "-" : "+") + Li(n, 2) + ":" + Li(r, 2); } function nf(e, t) { return new Date(e.getTime() + (e.offset ?? 0)).toISOString().replace(/\.\d+/, "").replace(/[A-Z]|\.\d+/g, " ") + tf(e.offset ?? 0); } function rf(e, t) { return e.kind === 1 ? e.toUTCString() : e.toLocaleString(); } function sf(e, t, n) { return e.offset != null ? nf(e) : rf(e); } const Rr = /(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g; function of(e, t) { return zc(e, t) < 0; } function uf(e) { return { input: e, cont: ff(e) }; } function lf(e, t) { return typeof t == "string" ? e(t) : t.cont(e); } function af(e) { return lf((t) => t, e); } function cf(e, t, n, r, s) { let o = ""; if (t = t || "", s = s || "", Jc(e)) switch (s.toLowerCase() !== "x" && (of(e, 0) ? (e = Wc(e, -1), o = "-") : t.indexOf(" ") >= 0 ? o = " " : t.indexOf("+") >= 0 && (o = "+")), r = r == null ? null : parseInt(r, 10), s) { case "f": case "F": r = r ?? 6, e = Kc(e, r); break; case "g": case "G": e = r != null ? Vi(e, r) : Vi(e); break; case "e": case "E": e = r != null ? Ui(e, r) : Ui(e); break; case "x": e = qi(e); break; case "X": e = qi(e).toUpperCase(); break; default: e = String(e); break; } else e instanceof Date ? e = sf(e) : e = En(e); if (n = typeof n == "number" ? n : parseInt(n, 10), isNaN(n)) e = o + e; else { const i = t.indexOf("0") >= 0, l = t.indexOf("-") >= 0, u = l || !i ? " " : "0"; u === "0" ? (e = zi(e, n - o.length, u, l), e = o + e) : e = zi(o + e, n, u, l); } return e; } function hl(e, t, n, r = "", s = -1) { return (...o) => { let i = r; const l = t.slice(), u = n.slice(); for (const a of o) { const [, , c, m, p, w] = u[0]; let y = m; if (s >= 0) y = s, s = -1; else if (y === "*") { if (a < 0) throw new Error("Non-negative number required"); s = a; continue; } i += l[0], i += cf(a, c, y, p, w), l.splice(0, 1), u.splice(0, 1); } return u.length === 0 ? (i += l[0], e(i)) : hl(e, l, u, i, s); }; } function ff(e) { return (t) => { Rr.lastIndex = 0; const n = [], r = []; let s = 0, o = Rr.exec(e); for (; o; ) { const i = o.index + (o[1] || "").length; n.push(e.substring(s, i).replace(/%%/g, "%")), r.push(o), s = Rr.lastIndex, Rr.lastIndex -= 1, o = Rr.exec(e); } return n.length === 0 ? t(e.replace(/%%/g, "%")) : (n.push(e.substring(s).replace(/%%/g, "%")), hl(t, n, r)); }; } function zi(e, t, n, r) { n = n || " ", t = t - e.length; for (let s = 0; s < t; s++) e = r ? e + n : n + e; return e; } function hf(e, t) { if (!e(t)) return xc(t); } BigInt.prototype.toJSON = function() { return `${this.toString()}`; }; const dl = 0n; function df(e) { return e < dl ? -e : e; } function mf(e) { return BigInt(e); } function po(e) { return BigInt(Math.trunc(e)); } function pf(e) { return BigInt(e); } function go(e) { return BigInt.asIntN(64, e); } function Wi(e) { return BigInt.asUintN(64, e); } function gf(e) { return Number(e); } function Ki(e) { const t = e < dl, n = df(e), r = Number(BigInt.asUintN(32, n)), s = Number(BigInt.asUintN(32, n >> 32n)), o = Number(BigInt.asUintN(32, n >> 64n)); return yc(r, s, o, t, 0); } function yf(e) { return e.toString(); } function _f(e) { return BigInt(e); } const wf = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], Cf = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], bf = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], Sf = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; function st(e, t, n) { let r = 0, s = t; for (; s < e.length && e[s] === n; ) s++, r++; return r; } function Zi(e, t) { return t >= e.length - 1 ? -1 : e.charCodeAt(t + 1); } function Tf(e, t) { let n = t; const r = e[t]; let s = "", o = !1; for (; t < e.length; ) { t++; const i = e[t]; if (i === r) { o = !0; break; } else if (i === "\\") if (t < e.length) t++, s += e[t]; else throw new Error("Invalid string format"); else s += i; } if (!o) throw new Error(`Invalid string format could not find matching quote for ${r}`); return [s, t - n + 1]; } function Ci(e, t, n) { let r = 0, s = 0, o = ""; const i = n ? bi( e.getTime(), 1 /* DateKind.UTC */ ) : e; for (; r < t.length; ) { const l = t[r]; switch (l) { case "d": switch (s = st(t, r, "d"), r += s, s) { case 1: o += Xi(i); break; case 2: o += ye(Xi(i), 2); break; case 3: o += wf[tu(i)]; break; case 4: o += Cf[tu(i)]; break; } break; case "f": if (s = st(t, r, "f"), r += s, s <= 3) { const b = 10 ** (3 - s); o += ye(Math.floor(ps(i) / b), s); } else s <= 7 && (o += ("" + ps(i)).padEnd(s, "0")); break; case "F": if (s = st(t, r, "F"), r += s, s <= 3) { const b = 10 ** (3 - s), v = Math.floor(ps(i) / b); v != 0 && (o += ye(v, s)); } else if (s <= 7) { const b = ps(i); b != 0 && (o += ye(b, 3)); } break; case "g": s = st(t, r, "g"), r += s, s <= 2 && (o += "A.D."); break; case "h": switch (s = st(t, r, "h"), r += s, s) { case 1: const b = ms(i) % 12; o += b || 12; break; case 2: const v = ms(i) % 12; o += ye(v || 12, 2); break; } break; case "H": switch (s = st(t, r, "H"), r += s, s) { case 1: o += ms(i); break; case 2: o += ye(ms(i), 2); break; } break; case "K": switch (s = st(t, r, "K"), r += s, s) { case 1: switch (Qi(i)) { case 1: o += "Z"; break; case 2: o += tr(i.getTimezoneOffset() * -6e4); break; } break; } break; case "m": switch (s = st(t, r, "m"), r += s, s) { case 1: o += Yi(i); break; case 2: o += ye(Yi(i), 2); break; } break; case "M": switch (s = st(t, r, "M"), r += s, s) { case 1: o += gs(i); break; case 2: o += ye(gs(i), 2); break; case 3: o += bf[gs(i) - 1]; break; case 4: o += Sf[gs(i) - 1]; break; } break; case "s": switch (s = st(t, r, "s"), r += s, s) { case 1: o += eu(i); break; case 2: o += ye(eu(i), 2); break; } break; case "t": switch (s = st(t, r, "t"), r += s, s) { case 1: o += i.getHours() < 12 ? "A" : "P"; break; case 2: o += i.getHours() < 12 ? "AM" : "PM"; break; } break; case "y": switch (s = st(t, r, "y"), r += s, s) { case 1: o += i.getFullYear() % 100; break; case 2: o += ye(i.getFullYear() % 100, 2); break; case 3: o += ye(i.getFullYear(), 3); break; case 4: o += ye(i.getFullYear(), 4); break; case 5: o += ye(i.getFullYear(), 5); break; } break; case "z": s = st(t, r, "z"), r += s; let u = ""; switch (Qi(i)) { case 1: u = "+00:00"; break; case 2: u = tr(i.getTimezoneOffset() * -6e4); break; case 0: u = tr(Nf(i).getTimezoneOffset() * -6e4); break; } const a = u[0] === "-" ? "-" : "+", c = parseInt(u.substring(1, 3), 10), m = parseInt(u.substring(4, 6), 10); switch (s) { case 1: o += `${a}${c}`; break; case 2: o += `${a}${ye(c, 2)}`; break; default: o += `${a}${ye(c, 2)}:${ye(m, 2)}`; break; } break; case ":": o += ":", r++; break; case "/": o += "/", r++; break; case "'": case '"': const [p, w] = Tf(t, r); o += p, r += w; break; case "%": const y = Zi(t, r); if (y >= 0 && y !== 37) r += 2, o += Ci(i, String.fromCharCode(y), n); else throw new Error("Invalid format string"); break; case "\\": const I = Zi(t, r); if (I >= 0) r += 2, o += String.fromCharCode(I); else throw new Error("Invalid format string"); break; default: r++, o += l; break; } } return o; } function Qi(e) { return e.kind || 0; } function tr(e) { const t = e < 0; e = Math.abs(e); const n = ~~(e / 36e5), r = e % 36e5 / 6e4; return (t ? "-" : "+") + ye(n, 2) + ":" + ye(r, 2); } function Us(e, t) { const n = e.toISOString(); return t === "first" ? n.substring(0, n.indexOf("T")) : n.substring(n.indexOf("T") + 1, n.length - 1); } function vf(e, t) { if (t) return e.toISOString(); { const n = e.kind == null ? !0 : e.kind === 2; return ye(e.getFullYear(), 4) + "-" + ye(e.getMonth() + 1, 2) + "-" + ye(e.getDate(), 2) + "T" + ye(e.getHours(), 2) + ":" + ye(e.getMinutes(), 2) + ":" + ye(e.getSeconds(), 2) + "." + ye(e.getMilliseconds(), 3) + (n ? tr(e.getTimezoneOffset() * -6e4) : ""); } } function Ef(e, t) { const n = e.toISOString(); return n.substring(0, n.length - 1) + tr(t); } function If(e, t) { const n = new Date(e.getTime() + (e.offset ?? 0)); if (typeof t != "string") return n.toISOString().replace(/\.\d+/, "").replace(/[A-Z]|\.\d+/g, " ") + tr(e.offset ?? 0); if (t.length === 1) switch (t) { case "D": case "d": return Us(n, "first"); case "T": case "t": return Us(n, "second"); case "O": case "o": return Ef(n, e.offset ?? 0); default: throw new Error("Unrecognized Date print format"); } else return Ci(n, t, !0); } function kf(e, t) { const n = e.kind === 1; if (typeof t != "string") return n ? e.toUTCString() : e.toLocaleString(); if (t.length === 1) switch (t) { case "D": case "d": return n ? Us(e, "first") : e.toLocaleDateString(); case "T": case "t": return n ? Us(e, "second") : e.toLocaleTimeString(); case "O": case "o": return vf(e, n); default: throw new Error("Unrecognized Date print format"); } else return Ci(e, t, n); } function rr(e, t, n) { return e.offset != null ? If(e, t) : kf(e, t); } function bi(e, t) { const n = new Date(e); return n.kind = (t ?? 0) | 0, n; } function ml(e) { function t() { throw new Error(`The string is not a valid Date: ${e}`); } (e == null || e.trim() === "") && t(), e.length === 10 && e[4] === "-" && e[7] === "-" && (e += "T00:00:00"); let n = new Date(e), r = null; if (isNaN(n.getTime())) { const s = /^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(e); if (s != null) { let o, i = 0; if (s[2] != null) { const l = s[2].split(":"), u = parseInt(l[0], 10); i = u * 3600 + parseInt(l[1] || "0", 10) * 60 + parseFloat(l[2] || "0"), s[3] != null && s[3].toUpperCase() === "PM" && u < 12 && (i += 720); } if (s[4] != null) { if (s[1] != null) o = /* @__PURE__ */ new Date(s[1] + " UTC"); else { const l = /* @__PURE__ */ new Date(); o = /* @__PURE__ */ new Date(l.getUTCFullYear() + "/" + (l.getUTCMonth() + 1) + "/" + l.getUTCDate()); } if (s[4] === "Z") r = "Z"; else { let l = parseInt(s[5], 10) * 60 + parseInt(s[6] || "0", 10); s[4][0] === "-" && (l *= -1), r = l, i -= l * 60; } } else if (s[1] != null) o = new Date(s[1]); else { const l = /* @__PURE__ */ new Date(); o = /* @__PURE__ */ new Date(l.getFullYear() + "/" + (l.getMonth() + 1) + "/" + l.getDate()); } n = new Date(o.getTime() + i * 1e3), n = new Date(n.getTime() + (n.getTimezoneOffset() - o.getTimezoneOffset()) * 6e4); } else t(); isNaN(n.getTime()) && t(); } return [n, r]; } function $f(e, t = !1) { const [n, r] = ml(e), s = r != null ? t && r === "Z" ? 1 : 2 : 0; return bi(n.getTime(), s); } function Nf(e) { return e.kind === 2 ? e : bi( e.getTime(), 2 /* DateKind.Local */ ); } function Xi(e) { return e.kind === 1 ? e.getUTCDate() : e.getDate(); } function ms(e) { return e.kind === 1 ? e.getUTCHours() : e.getHours(); } function ps(e) { return e.kind === 1 ? e.getUTCMilliseconds() : e.getMilliseconds(); } function Yi(e) { return e.kind === 1 ? e.getUTCMinutes() : e.getMinutes(); } function gs(e) { return (e.kind === 1 ? e.getUTCMonth() : e.getMonth()) + 1; } function eu(e) { return e.kind === 1 ? e.getUTCSeconds() : e.getSeconds(); } function tu(e) { return e.kind === 1 ? e.getUTCDay() : e.getDay(); } function pl(e) { return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } const Fr = /(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g, Af = /\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g; function gl(e, t) { return mc(e, t) < 0; } function Mf(e, t, n) { return e == null ? t == null ? 0 : -1 : t == null ? 1 : e.localeCompare(t); } function zo(e, t, n) { return e.length >= t.length ? Mf(e.substr(e.length - t.length, t.length), t) === 0 : !1; } function L(e) { return { inp