const ov = globalThis;
function Ao(e) {
return Ca(function(t, ...n) {
return t == null || // let these methods crash like their originals
e in t && typeof t[e] == "function" ? t[e](...n) : Object.prototype[e].apply(t, n);
}, "Object_" + e);
}
const lu = /* @__PURE__ */ Ao(
"hasOwnProperty"
), cu = /* @__PURE__ */ Ao(
"isPrototypeOf"
), rv = /* @__PURE__ */ Ao(
"propertyIsEnumerable"
), du = /* @__PURE__ */ Ao(
"toString"
);
function av(e) {
return e == null || // let this method crash like its original
"toLocaleString" in e && typeof e.toLocaleString == "function" ? e.toLocaleString() : du(e);
}
const iv = /* @__PURE__ */ Ao(
"valueOf"
);
function sv(e, ...t) {
for (let n = 0, o = t.length; n < o; n++) {
let r = t[n];
if (r != null)
if (typeof r == "object") {
const a = Object.getOwnPropertyDescriptors(r);
for (const i of Reflect.ownKeys(a)) {
const s = a[i];
s.enumerable && Object.defineProperty(e, i, s);
}
} else
it("InvalidArgument: argument #" + (n + 1) + " is not an object");
}
return e;
}
function it(e) {
let t = /^([$a-zA-Z][$a-zA-Z0-9]*):\s*(\S.+)\s*$/.exec(e);
if (t == null)
throw new Error(e);
{
let n = new Error(t[2]);
throw n.name = t[1], n;
}
}
function Yt(e) {
it(`MissingArgument: no ${tt(e)} given`);
}
function lv(e) {
return e != null;
}
function cv(e) {
return e == null;
}
function Jt(e) {
return typeof e == "boolean" || e instanceof Boolean;
}
function dt(e) {
return typeof e == "number" || e instanceof Number;
}
function an(e) {
return dt(e) && isFinite(e.valueOf());
}
function Us(e) {
return dt(e) && isNaN(e.valueOf());
}
function To(e, t, n, o = !0, r = !0) {
if (!dt(e))
return !1;
const a = e.valueOf();
return isNaN(a) ? !1 : !// "ValueIsFiniteNumber" is more robust than "isFinite"
(an(t) && (a < t || !o && a === t) || an(n) && (a > n || !r && a === n));
}
function Pn(e) {
if (!dt(e))
return !1;
const t = e.valueOf();
return isFinite(t) && Math.round(t) === t;
}
function Sr(e, t, n) {
if (!Pn(e))
return !1;
const o = e.valueOf();
return !// "ValueIsFiniteNumber" is more robust than "isFinite"
(an(t) && o < t || an(n) && o > n);
}
function hn(e) {
return Pn(e) && e.valueOf() >= 0;
}
function ya(e) {
return Pn(e) && e.valueOf() >= 1;
}
function Pe(e) {
return typeof e == "string" || e instanceof String;
}
const Ks = /^\s*$/;
function dv(e) {
return st(e, Ks);
}
function qs(e) {
return Pe(e) && !Ks.test(e.valueOf());
}
function st(e, t) {
return (typeof e == "string" || e instanceof String) && t.test(e.valueOf());
}
const uu = /^[^\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F\u2028\u2029\uFFF9-\uFFFB]*$/;
function mn(e) {
return st(e, uu);
}
const pu = /^[^\x00-\x1F\x7F-\x9F\u2028\u2029\uFFF9-\uFFFB]*$/;
function Ee(e) {
return st(e, pu);
}
function Vt(e) {
return typeof e == "function";
}
function xa(e) {
return typeof e == "function" && (e.name ?? "") === "";
}
function Xs(e) {
return typeof e == "function" && !xa(e);
}
const fu = /^function\s*[^(]*\(\)\s*\{\s*\[native code\]\s*\}\s*$/;
function va(e) {
return typeof e == "function" && fu.test(e.toString()) && !e.name.startsWith("bound ");
}
function Ys(e) {
return typeof e == "function" && !va(e);
}
function wa(e) {
return e != null && typeof e == "object";
}
function Ro(e) {
return e != null && typeof e == "object" && Object.getPrototypeOf(e) === Object.prototype;
}
function Js(e) {
return e != null && typeof e == "object" && !(e instanceof Object);
}
const _r = Array.isArray;
function Zs(e, t, n) {
return Ie(
e,
(o) => o !== void 0,
t,
n
);
}
function Ie(e, t, n, o) {
if (!_r(e))
return !1;
try {
for (let r = 0, a = e.length; r < a; r++)
if (!t(e[r]))
return !1;
return !(n != null && e.length < n || o != null && e.length > o);
} catch {
return !1;
}
}
function hu(e, t) {
return Ie(e, (n) => ge(n, t));
}
function uv(e, t) {
return e instanceof t;
}
function pv(e, t) {
return cu(t, e);
}
function Qs(e) {
return e instanceof Date;
}
function Ps(e) {
return e instanceof Error;
}
function el(e) {
return e instanceof RegExp;
}
function ge(e, t) {
return t.indexOf(e) >= 0;
}
function An(e) {
if (!Pe(e))
return !1;
let t = e.valueOf().toLowerCase();
return $o.hasOwnProperty(t) || La.test(t) || Ma.test(t) || Aa.test(t) || Ta.test(t);
}
const gu = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
function Tn(e) {
return st(e, gu);
}
const mu = (
// URL characters after RFC 3986
/^[A-Za-z0-9\-._~:\/?#\[\]@!$&'()*+,;=%]+$/
), bu = /%(?![0-9A-Fa-f]{2})/;
function at(e) {
if (!Pe(e))
return !1;
const t = e.valueOf();
if (!mu.test(t) || // also rejects '' + whitespace
bu.test(t))
return !1;
try {
return new URL(t, "file://"), !0;
} catch {
return !1;
}
}
function yu(e) {
return e.toLowerCase().replace(/:?$/, ":");
}
function xu(e, t) {
if (!at(e))
return !1;
let n;
try {
n = new URL(e.valueOf());
} catch {
return !1;
}
return t == null ? !0 : t.some(
// "parsedURL.protocol" already
(o) => yu(o) === n.protocol
);
}
const vu = /^\+[1-9][0-9]{6,14}$/;
function tl(e) {
return st(e, vu);
}
function nl(e) {
return typeof e == "bigint";
}
function ol(e) {
return typeof e == "symbol";
}
function rl(e) {
return e instanceof Map;
}
function al(e) {
return e instanceof Set;
}
function il(e) {
return ArrayBuffer.isView(e) && !(e instanceof DataView);
}
function sl(e) {
return e instanceof ArrayBuffer;
}
const wu = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
function ll(e) {
return st(e, wu);
}
const ku = /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/;
function cl(e) {
if (!Pe(e))
return !1;
const t = ku.exec(e.valueOf());
if (t == null)
return !1;
const [n, o, r] = [t[1], t[2], t[3]].map(Number), a = new Date(Date.UTC(n, o - 1, r));
return (
// detects overflows like 02-31
a.getUTCFullYear() === n && a.getUTCMonth() === o - 1 && a.getUTCDate() === r
);
}
const Cu = new RegExp(
"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(:[0-9]{2}([.][0-9]+)?)?(Z|[+-][0-9]{2}:[0-9]{2})?$"
);
function dl(e) {
return st(e, Cu) && !isNaN(Date.parse(e.valueOf()));
}
const $u = new RegExp(
"^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])[.]){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$"
);
function ul(e) {
return st(e, $u);
}
const ju = /^[0-9a-fA-F:.]+$/;
function pl(e) {
if (!Pe(e) || !ju.test(e.valueOf()))
return !1;
try {
return new URL("http://[" + e.valueOf() + "]/"), !0;
} catch {
return !1;
}
}
const Iu = new RegExp(
"^(?=.{1,253}$)[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$",
"i"
);
function fl(e) {
return st(e, Iu);
}
function hl(e) {
return Sr(e, 1, 65535);
}
function Co(e, t = /* @__PURE__ */ new WeakSet()) {
switch (!0) {
case e == null:
// deliberately also allows undefined
case Jt(e):
case an(e):
// NaN/Infinity are not serializable
case Pe(e):
return !0;
case Zs(e):
if (t.has(e))
return !1;
t.add(e);
try {
return Ie(
e,
(n) => n === void 0 ? !1 : Co(n, t)
);
} finally {
t.delete(e);
}
case Ro(e):
if (t.has(e))
return !1;
t.add(e);
try {
for (let n in e)
if (e.hasOwnProperty(n) && !Co(e[n], t))
return !1;
return !0;
} finally {
t.delete(e);
}
}
return !1;
}
function gl(e) {
return Ro(e) && Co(e);
}
function ml(e) {
if (!Pe(e))
return !1;
try {
return JSON.parse(e.valueOf()), !0;
} catch {
return !1;
}
}
const Su = new RegExp(
"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
);
function bl(e) {
return st(e, Su);
}
const _u = /^[0-9a-fA-F]+$/;
function yl(e) {
return st(e, _u);
}
const Se = !1, _e = !0;
function ka(e) {
return (
// "valueOf" may return other values for
e instanceof Boolean || // other objects (e.g. Dates)
e instanceof Number || e instanceof String ? e.valueOf() : e
);
}
function Du(e, t, n, o, r) {
if (t == null) {
if (o)
return t;
Yt(e);
}
if (n(t))
return ka(t);
it(
`InvalidArgument: the given ${tt(e)} is no valid ${tt(r)}`
);
}
function te(e, t, n) {
let o = function(a, i) {
return Du(
a,
i,
e,
t,
n
);
}, r = e.name;
if (r != null && /^ValueIs/.test(r)) {
let a = r.replace(
// derive name from validator
/^ValueIs/,
t ? "allow" : "expect"
);
return Ca(o, a);
} else
return o;
}
function Ca(e, t) {
return e == null && it("MissingArgument: no function given"), typeof e != "function" && it("InvalidArgument: the given 1st Argument is not a JavaScript function"), t == null && it("MissingArgument: no desired name given"), typeof t != "string" && !(t instanceof String) && it("InvalidArgument: the given desired name is not a string"), e.name === t || Object.defineProperty(e, "name", {
value: t.valueOf()
}), e;
}
function Et(e, t) {
return Ca(
(n, o, ...r) => o == null ? o : e(n, o, ...r),
t
);
}
function Lu(e, t, n) {
return t == null ? void 0 : Au(e, t, n);
}
const fv = Lu;
function Mu(e, t, n) {
t == null && Yt(e);
const o = ka(t);
if (n == null || n(o) === !0)
return o;
it(`InvalidArgument: the given ${tt(e)} is invalid`);
}
const Au = Mu, on = /* @__PURE__ */ te(
Jt,
_e,
"boolean value"
), hv = on, $a = /* @__PURE__ */ te(
Jt,
Se,
"boolean value"
), gv = $a, Tu = /* @__PURE__ */ te(
dt,
_e,
"numeric value"
), mv = Tu, xl = /* @__PURE__ */ te(
dt,
Se,
"numeric value"
), bv = xl, Ru = /* @__PURE__ */ te(
an,
_e,
"finite numeric value"
), yv = Ru, Fu = /* @__PURE__ */ te(
an,
Se,
"finite numeric value"
), xv = Fu, Ou = /* @__PURE__ */ te(
Us,
_e,
"NaN value"
), vv = Ou, zu = /* @__PURE__ */ te(
Us,
Se,
"NaN value"
), wv = zu, Vu = /* @__PURE__ */ Et(
vl,
"allowNumberInRange"
), kv = Vu;
function vl(e, t, n, o, r, a) {
xl(e, t), isNaN(t) && it(
`InvalidArgument: the given ${tt(e)} is not-a-number`
), r ?? (r = !0), a ?? (a = !0);
const i = n != null && isFinite(n), s = o != null && isFinite(o), c = i && (t < n || !r && t === n), d = s && (t > o || !a && t === o);
switch (!0) {
case (c && s || d && i):
throw new RangeError(
`the given ${tt(e)} (${t}) is outside the allowed range (${n}...${o})`
);
case c:
throw new RangeError(
`the given ${tt(e)} is below the allowed minimum (${t} ${r ? "<" : "<="} ${n})`
);
case d:
throw new RangeError(
`the given ${tt(e)} exceeds the allowed maximum (${t} ${a ? ">" : ">="} ${o})`
);
}
return t.valueOf();
}
const Cv = vl, Nu = /* @__PURE__ */ te(
Pn,
_e,
"integral numeric value"
), $v = Nu, wl = /* @__PURE__ */ te(
Pn,
Se,
"integral numeric value"
), jv = wl, Eu = /* @__PURE__ */ Et(
ja,
"allowIntegerInRange"
), Iv = Eu;
function ja(e, t, n, o) {
wl(e, t);
const r = n != null && isFinite(n), a = o != null && isFinite(o), i = r && t < n, s = a && t > o;
switch (!0) {
case (i && a || s && r):
throw new RangeError(
`the given ${tt(e)} (${t}) is outside the allowed range (${n}...${o})`
);
case i:
throw new RangeError(
`the given ${tt(e)} is below the allowed minimum (${t} < ${n})`
);
case s:
throw new RangeError(
`the given ${tt(e)} exceeds the allowed maximum (${t} > ${o})`
);
}
return t.valueOf();
}
const Sv = ja, kl = /* @__PURE__ */ te(
hn,
_e,
"ordinal number"
), _v = kl, qn = /* @__PURE__ */ te(
hn,
Se,
"ordinal number"
), Dv = qn, Dr = /* @__PURE__ */ te(
ya,
_e,
"cardinal number"
), Qi = Dr, Cl = /* @__PURE__ */ te(
ya,
Se,
"cardinal number"
), Lv = Cl, Lr = /* @__PURE__ */ te(
Pe,
_e,
"literal string"
), Mv = Lr, Ia = /* @__PURE__ */ te(
Pe,
Se,
"literal string"
), Av = Ia, Bu = /* @__PURE__ */ te(
qs,
_e,
"non-empty literal string"
), Tv = Bu, Wu = /* @__PURE__ */ te(
qs,
Se,
"non-empty literal string"
), Rv = Wu, Hu = /* @__PURE__ */ Et(
Sa,
"allowStringMatching"
), Fv = Hu;
function Sa(e, t, n) {
if (Ia(e, t), n.test(t))
return t.valueOf();
it(
`InvalidArgument: the given ${tt(e)} does not match the specified pattern`
);
}
const Ov = Sa, Gu = /* @__PURE__ */ te(
mn,
_e,
"literal text"
), zv = Gu, ot = /* @__PURE__ */ te(
mn,
Se,
"literal text"
), Vv = ot, fn = /* @__PURE__ */ te(
Ee,
_e,
"single line of text"
), Nv = fn, ln = /* @__PURE__ */ te(
Ee,
Se,
"single line of text"
), Ev = ln, Oe = /* @__PURE__ */ te(
Vt,
_e,
"JavaScript function"
), Bv = Oe, Zt = /* @__PURE__ */ te(
Vt,
Se,
"JavaScript function"
), Wv = Zt, Uu = /* @__PURE__ */ te(
xa,
_e,
"anonymous JavaScript function"
), Hv = Uu, Ku = /* @__PURE__ */ te(
xa,
Se,
"anonymous JavaScript function"
), Gv = Ku, qu = /* @__PURE__ */ te(
Xs,
_e,
"named JavaScript function"
), Uv = qu, Xu = /* @__PURE__ */ te(
Xs,
Se,
"named JavaScript function"
), Kv = Xu, Yu = /* @__PURE__ */ te(
va,
_e,
"native JavaScript function"
), qv = Yu, Ju = /* @__PURE__ */ te(
va,
Se,
"native JavaScript function"
), Xv = Ju, Zu = /* @__PURE__ */ te(
Ys,
_e,
"scripted JavaScript function"
), Yv = Zu, Qu = /* @__PURE__ */ te(
Ys,
Se,
"scripted JavaScript function"
), Jv = Qu, Pu = /* @__PURE__ */ te(
wa,
_e,
"JavaScript object"
), Zv = Pu, $l = /* @__PURE__ */ te(
wa,
Se,
"JavaScript object"
), Qv = $l, _a = /* @__PURE__ */ te(
Ro,
_e,
'"plain" JavaScript object'
), Pv = _a, It = /* @__PURE__ */ te(
Ro,
Se,
'"plain" JavaScript object'
), ew = It, ep = /* @__PURE__ */ te(
Js,
_e,
'"vanilla" JavaScript object'
), tw = ep, tp = /* @__PURE__ */ te(
Js,
Se,
'"vanilla" JavaScript object'
), nw = tp, np = /* @__PURE__ */ Et(
jl,
"allowArray"
), ow = np;
function jl(e, t) {
if (t == null && Yt(e), _r(t))
return t;
it(
`InvalidArgument: the given ${tt(e)} is no JavaScript array`
);
}
const rw = jl, op = /* @__PURE__ */ Et(
Il,
"allowList"
), aw = op;
function Il(e, t, n, o, r) {
if (t == null && Yt(e), Zs(t, o, r))
return t;
it(
`InvalidArgument: the given ${tt(e)} is ` + (n == null ? "either not a list or contains an invalid number of elements" : "no " + tt(n))
);
}
const iw = Il, Ht = /* @__PURE__ */ Et(
Sl,
"allowListSatisfying"
), sw = Ht;
function Sl(e, t, n, o, r, a) {
if (t == null && Yt(e), Ie(t, n, r, a))
return t;
it(
`InvalidArgument: the given ${tt(e)} is ` + (o == null ? "either not a list or contains invalid elements" : "no " + tt(o))
);
}
const lw = Sl, rp = /* @__PURE__ */ Et(
_l,
"allowListOf"
), cw = rp;
function _l(e, t, n) {
if (t == null && Yt(e), hu(t, n))
return t;
it(`InvalidArgument: the given value is no ${tt(e)}`);
}
const dw = _l, ap = /* @__PURE__ */ Et(
eo,
"allowInstanceOf"
), uw = ap;
function eo(e, t, n, o) {
if (t == null && Yt(e), t instanceof n)
return t;
it(
`InvalidArgument: the given ${tt(e)} is no ${tt(o)}`
);
}
const pw = eo, ip = /* @__PURE__ */ Et(
Dl,
"allowValueInheritingFrom"
), fw = ip;
function Dl(e, t, n, o) {
if (t == null && Yt(e), n.isPrototypeOf(t))
return t;
it(
`InvalidArgument: the given ${tt(e)} is no ${tt(o)}`
);
}
const hw = Dl, sp = /* @__PURE__ */ te(
Qs,
_e,
"JavaScript Date object"
), gw = sp, lp = /* @__PURE__ */ te(
Qs,
Se,
"JavaScript Date object"
), mw = lp, cp = /* @__PURE__ */ te(
Ps,
_e,
"JavaScript Error object"
), bw = cp, dp = /* @__PURE__ */ te(
Ps,
Se,
"JavaScript Error object"
), yw = dp, up = /* @__PURE__ */ te(
el,
_e,
"JavaScript RegExp object"
), xw = up, pp = /* @__PURE__ */ te(
el,
Se,
"JavaScript RegExp object"
), vw = pp, Ft = /* @__PURE__ */ Et(
_n,
"allowOneOf"
), ww = Ft;
function _n(e, t, n) {
if (t == null && Yt(e), ge(t, n))
return ka(t);
it(
`InvalidArgument: the given ${tt(e)} is not among the supported values`
);
}
const kw = _n, fp = /* @__PURE__ */ te(
An,
_e,
"CSS color specification"
), Cw = fp, hp = /* @__PURE__ */ te(
An,
Se,
"CSS color specification"
), $w = hp, gp = /* @__PURE__ */ te(
Tn,
_e,
"EMail address"
), jw = gp, mp = /* @__PURE__ */ te(
Tn,
Se,
"EMail address"
), Iw = mp, Hn = /* @__PURE__ */ te(
at,
_e,
"URL"
), Sw = Hn, Da = /* @__PURE__ */ te(
at,
Se,
"URL"
), _w = Da, bp = /* @__PURE__ */ Et(
Ll,
"allowAbsoluteURL"
), Dw = bp;
function Ll(e, t, n) {
if (t == null && Yt(e), xu(t, n))
return t.valueOf();
it(
`InvalidArgument: the given ${tt(e)} is no valid absolute URL`
);
}
const Lw = Ll, yp = /* @__PURE__ */ te(
tl,
_e,
"phone number in E.164 format"
), Mw = yp, xp = /* @__PURE__ */ te(
tl,
Se,
"phone number in E.164 format"
), Aw = xp, vp = /* @__PURE__ */ te(
nl,
_e,
"BigInt value"
), Tw = vp, wp = /* @__PURE__ */ te(
nl,
Se,
"BigInt value"
), Rw = wp, kp = /* @__PURE__ */ te(
ol,
_e,
"symbol"
), Fw = kp, Cp = /* @__PURE__ */ te(
ol,
Se,
"symbol"
), Ow = Cp, $p = /* @__PURE__ */ te(
rl,
_e,
"JavaScript Map"
), zw = $p, jp = /* @__PURE__ */ te(
rl,
Se,
"JavaScript Map"
), Vw = jp, Ip = /* @__PURE__ */ te(
al,
_e,
"JavaScript Set"
), Nw = Ip, Sp = /* @__PURE__ */ te(
al,
Se,
"JavaScript Set"
), Ew = Sp, _p = /* @__PURE__ */ te(
il,
_e,
"typed array"
), Bw = _p, Dp = /* @__PURE__ */ te(
il,
Se,
"typed array"
), Ww = Dp, Lp = /* @__PURE__ */ te(
sl,
_e,
"ArrayBuffer"
), Hw = Lp, Mp = /* @__PURE__ */ te(
sl,
Se,
"ArrayBuffer"
), Gw = Mp, Ap = /* @__PURE__ */ te(
ll,
_e,
"UUID"
), Uw = Ap, Tp = /* @__PURE__ */ te(
ll,
Se,
"UUID"
), Kw = Tp, Rp = /* @__PURE__ */ te(
cl,
_e,
"ISO 8601 date"
), qw = Rp, Fp = /* @__PURE__ */ te(
cl,
Se,
"ISO 8601 date"
), Xw = Fp, Op = /* @__PURE__ */ te(
dl,
_e,
"ISO 8601 timestamp"
), Yw = Op, zp = /* @__PURE__ */ te(
dl,
Se,
"ISO 8601 timestamp"
), Jw = zp, Vp = /* @__PURE__ */ te(
ul,
_e,
"IPv4 address"
), Zw = Vp, Np = /* @__PURE__ */ te(
ul,
Se,
"IPv4 address"
), Qw = Np, Ep = /* @__PURE__ */ te(
pl,
_e,
"IPv6 address"
), Pw = Ep, Bp = /* @__PURE__ */ te(
pl,
Se,
"IPv6 address"
), ek = Bp, Wp = /* @__PURE__ */ te(
fl,
_e,
"host name"
), tk = Wp, Hp = /* @__PURE__ */ te(
fl,
Se,
"host name"
), nk = Hp, Gp = /* @__PURE__ */ te(
hl,
_e,
"port number"
), ok = Gp, Up = /* @__PURE__ */ te(
hl,
Se,
"port number"
), rk = Up, Kp = /* @__PURE__ */ te(
Co,
_e,
"serializable value"
), ak = Kp, qp = /* @__PURE__ */ te(
Co,
Se,
"serializable value"
), ik = qp, Xp = /* @__PURE__ */ te(
gl,
_e,
"serializable object"
), sk = Xp, Yp = /* @__PURE__ */ te(
gl,
Se,
"serializable object"
), lk = Yp, Jp = /* @__PURE__ */ te(
ml,
_e,
"JSON string"
), ck = Jp, Zp = /* @__PURE__ */ te(
ml,
Se,
"JSON string"
), dk = Zp, Qp = /* @__PURE__ */ te(
bl,
_e,
"Base64-encoded string"
), uk = Qp, Pp = /* @__PURE__ */ te(
bl,
Se,
"Base64-encoded string"
), pk = Pp, ef = /* @__PURE__ */ te(
yl,
_e,
"hexadecimal string"
), fk = ef, tf = /* @__PURE__ */ te(
yl,
Se,
"hexadecimal string"
), hk = tf, Fo = (
// core of several escaping patterns below
String.raw`\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|` + String.raw`\\u\{[0-9a-fA-F]+\}|\\[0bfnrtv'"\\\/]`
), nf = new RegExp(Fo + "?", "g"), Ml = /[\x00-\x1f\x7f-\x9f]/g, of = {
"\0": "\\0",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
" ": "\\t",
"\v": "\\v"
};
function Al(e) {
return of[e] ?? "\\x" + e.charCodeAt(0).toString(16).padStart(2, "0");
}
function tt(e) {
return e.replace(nf, (t) => t === "\\" ? "\\\\" : t).replace(Ml, Al);
}
const rf = new RegExp(Fo, "g"), af = {
"\\0": "\0",
"\\b": "\b",
"\\f": "\f",
"\\n": `
`,
"\\r": "\r",
"\\t": " ",
"\\v": "\v",
"\\'": "'",
'\\"': '"',
"\\\\": "\\"
};
function sf(e) {
const t = e.charAt(2) === "{" ? parseInt(e.slice(3, -1), 16) : parseInt(e.slice(2), 16);
return t <= 1114111 ? String.fromCodePoint(t) : e;
}
function gk(e) {
return e.replace(rf, (t) => af[t] ?? sf(t));
}
const lf = new RegExp(Fo + "?|'", "g"), cf = new RegExp(Fo + '?|"', "g"), df = new RegExp(Fo + "?|`|\\$\\{", "g"), uf = {
"'": "\\'",
'"': '\\"',
"`": "\\`",
"${": "\\${",
"\\": "\\\\"
};
function pf(e, t = '"') {
const n = t === "'" ? lf : t === "`" ? df : cf;
return e.replace(n, (o) => uf[o] ?? o).replace(Ml, Al);
}
function Lt(e, t = '"') {
return t + pf(e, t) + t;
}
const ff = /[&<>"'\x00-\x1F\x7F-\x9F\\]/g;
function hf(e, t) {
return t = (t || "").trim() || "
", e.replace(ff, (n) => {
switch (n) {
case "&":
return "&";
case "<":
return "<";
case ">":
return ">";
case '"':
return """;
case "'":
return "'";
case "\b":
return "\b";
case "\f":
return "\f";
case `
`:
return t;
case "\r":
return "\r";
case " ":
return "\t";
case "\v":
return "\v";
case "\\":
return "\";
default:
return "" + n.charCodeAt(0).toString(16).padStart(4, "0") + ";";
}
});
}
const gf = /[:`*_\[\]#|~]/g;
function mk(e, t) {
return hf(e, t).replace(
gf,
(n) => "" + n.charCodeAt(0) + ";"
);
}
function lr(e, t, n, o) {
if (e === t)
return !1;
let r, a;
typeof n == "string" ? r = n : n != null && (r = n.Mode, a = n.Tolerance);
let i = typeof e;
if (i !== typeof t)
return !0;
function s(l, f, h, g) {
if (!Array.isArray(f) || l.length !== f.length)
return !0;
for (let b = 0, m = l.length; b < m; b++)
if (lr(l[b], f[b], h, g))
return !0;
return !1;
}
function c(l, f, h, g) {
if (!(f instanceof Map) || l.size !== f.size)
return !0;
let b = !1;
return l.forEach(function(m, v) {
b || (b = !f.has(v) || lr(m, f.get(v), h, g));
}), b;
}
function d(l, f) {
if (!(f instanceof Set) || l.size !== f.size)
return !0;
let h = !1;
return l.forEach(function(g) {
!h && !f.has(g) && (h = !0);
}), h;
}
function u(l, f) {
if (Object.getPrototypeOf(l) !== Object.getPrototypeOf(f) || l.byteLength !== f.byteLength)
return !0;
let h = new Uint8Array(
l.buffer,
l.byteOffset,
l.byteLength
), g = new Uint8Array(
f.buffer,
f.byteOffset,
f.byteLength
);
for (let b = 0, m = h.length; b < m; b++)
if (h[b] !== g[b])
return !0;
return !1;
}
function p(l, f, h, g) {
if (Object.getPrototypeOf(l) !== Object.getPrototypeOf(f))
return !0;
for (let b in l)
if (!(b in f))
return !0;
for (let b in f)
if (!(b in l) || lr(l[b], f[b], h, g))
return !0;
return !1;
}
switch (i) {
case "undefined":
case "boolean":
case "string":
case "bigint":
case "symbol":
case "function":
return !0;
// most primitives are compared using "==="
case "number": {
if (isNaN(e) !== isNaN(t))
return !0;
if (a != null)
return Math.abs(e - t) > a;
const f = Number.EPSILON * Math.max(
// default is relative!
1,
Math.abs(e),
Math.abs(t)
);
return Math.abs(e - t) > f;
}
case "object":
if (e == null || t == null)
return !0;
if (
// boxed primitives are compared by their values
e instanceof Boolean || e instanceof Number || e instanceof String
)
return r === "by-reference" ? !0 : Object.getPrototypeOf(e) !== Object.getPrototypeOf(t) || e.valueOf() !== t.valueOf();
if (e instanceof Date) {
if (r === "by-reference" || !(t instanceof Date))
return !0;
let f = e.getTime(), h = t.getTime();
return f !== h && !(isNaN(f) && isNaN(h));
}
if (e instanceof RegExp)
return r === "by-reference" ? !0 : !(t instanceof RegExp) || e.source !== t.source || e.flags !== t.flags;
o == null && (o = /* @__PURE__ */ new WeakMap());
let l = o.get(e);
return l == null && o.set(e, l = /* @__PURE__ */ new WeakSet()), l.has(t) ? !1 : (l.add(t), Array.isArray(e) ? s(e, t, n, o) : e instanceof Map ? r === "by-reference" ? !0 : c(e, t, n, o) : e instanceof Set ? r === "by-reference" ? !0 : d(e, t) : ArrayBuffer.isView(e) ? r === "by-reference" ? !0 : u(e, t) : r === "by-reference" ? !0 : p(e, t, n, o));
default:
return !0;
}
}
function bk(e, t, n) {
return !lr(e, t, n);
}
function mf(e) {
$l("candidate", e);
for (let t in e)
if (lu(e, t))
return !1;
return !0;
}
function yk(e) {
return !mf(e);
}
function bf(e) {
return /^\s*$/.test(e);
}
function xk(e) {
return !bf(e);
}
function vk(e, t = -1 / 0, n = 1 / 0) {
return Math.max(t, Math.min(e, n));
}
const $o = /* @__PURE__ */ Object.freeze({
transparent: "rgba(0,0,0,0.0)",
aliceblue: "rgba(240,248,255,1.0)",
lightpink: "rgba(255,182,193,1.0)",
antiquewhite: "rgba(250,235,215,1.0)",
lightsalmon: "rgba(255,160,122,1.0)",
aqua: "rgba(0,255,255,1.0)",
lightseagreen: "rgba(32,178,170,1.0)",
aquamarine: "rgba(127,255,212,1.0)",
lightskyblue: "rgba(135,206,250,1.0)",
azure: "rgba(240,255,255,1.0)",
lightslategray: "rgba(119,136,153,1.0)",
beige: "rgba(245,245,220,1.0)",
lightslategrey: "rgba(119,136,153,1.0)",
bisque: "rgba(255,228,196,1.0)",
lightsteelblue: "rgba(176,196,222,1.0)",
black: "rgba(0,0,0,1.0)",
lightyellow: "rgba(255,255,224,1.0)",
blanchedalmond: "rgba(255,235,205,1.0)",
lime: "rgba(0,255,0,1.0)",
blue: "rgba(0,0,255,1.0)",
limegreen: "rgba(50,205,50,1.0)",
blueviolet: "rgba(138,43,226,1.0)",
linen: "rgba(250,240,230,1.0)",
brown: "rgba(165,42,42,1.0)",
magenta: "rgba(255,0,255,1.0)",
burlywood: "rgba(222,184,135,1.0)",
maroon: "rgba(128,0,0,1.0)",
cadetblue: "rgba(95,158,160,1.0)",
mediumaquamarine: "rgba(102,205,170,1.0)",
chartreuse: "rgba(127,255,0,1.0)",
mediumblue: "rgba(0,0,205,1.0)",
chocolate: "rgba(210,105,30,1.0)",
mediumorchid: "rgba(186,85,211,1.0)",
coral: "rgba(255,127,80,1.0)",
mediumpurple: "rgba(147,112,219,1.0)",
cornflowerblue: "rgba(100,149,237,1.0)",
mediumseagreen: "rgba(60,179,113,1.0)",
cornsilk: "rgba(255,248,220,1.0)",
mediumslateblue: "rgba(123,104,238,1.0)",
crimson: "rgba(220,20,60,1.0)",
mediumspringgreen: "rgba(0,250,154,1.0)",
cyan: "rgba(0,255,255,1.0)",
mediumturquoise: "rgba(72,209,204,1.0)",
darkblue: "rgba(0,0,139,1.0)",
mediumvioletred: "rgba(199,21,133,1.0)",
darkcyan: "rgba(0,139,139,1.0)",
midnightblue: "rgba(25,25,112,1.0)",
darkgoldenrod: "rgba(184,134,11,1.0)",
mintcream: "rgba(245,255,250,1.0)",
darkgray: "rgba(169,169,169,1.0)",
mistyrose: "rgba(255,228,225,1.0)",
darkgreen: "rgba(0,100,0,1.0)",
moccasin: "rgba(255,228,181,1.0)",
darkgrey: "rgba(169,169,169,1.0)",
navajowhite: "rgba(255,222,173,1.0)",
darkkhaki: "rgba(189,183,107,1.0)",
navy: "rgba(0,0,128,1.0)",
darkmagenta: "rgba(139,0,139,1.0)",
oldlace: "rgba(253,245,230,1.0)",
darkolivegreen: "rgba(85,107,47,1.0)",
olive: "rgba(128,128,0,1.0)",
darkorange: "rgba(255,140,0,1.0)",
olivedrab: "rgba(107,142,35,1.0)",
darkorchid: "rgba(153,50,204,1.0)",
orange: "rgba(255,165,0,1.0)",
darkred: "rgba(139,0,0,1.0)",
orangered: "rgba(255,69,0,1.0)",
darksalmon: "rgba(233,150,122,1.0)",
orchid: "rgba(218,112,214,1.0)",
darkseagreen: "rgba(143,188,143,1.0)",
palegoldenrod: "rgba(238,232,170,1.0)",
darkslateblue: "rgba(72,61,139,1.0)",
palegreen: "rgba(152,251,152,1.0)",
darkslategray: "rgba(47,79,79,1.0)",
paleturquoise: "rgba(175,238,238,1.0)",
darkslategrey: "rgba(47,79,79,1.0)",
palevioletred: "rgba(219,112,147,1.0)",
darkturquoise: "rgba(0,206,209,1.0)",
papayawhip: "rgba(255,239,213,1.0)",
darkviolet: "rgba(148,0,211,1.0)",
peachpuff: "rgba(255,218,185,1.0)",
deeppink: "rgba(255,20,147,1.0)",
peru: "rgba(205,133,63,1.0)",
deepskyblue: "rgba(0,191,255,1.0)",
pink: "rgba(255,192,203,1.0)",
dimgray: "rgba(105,105,105,1.0)",
plum: "rgba(221,160,221,1.0)",
dimgrey: "rgba(105,105,105,1.0)",
powderblue: "rgba(176,224,230,1.0)",
dodgerblue: "rgba(30,144,255,1.0)",
purple: "rgba(128,0,128,1.0)",
firebrick: "rgba(178,34,34,1.0)",
red: "rgba(255,0,0,1.0)",
floralwhite: "rgba(255,250,240,1.0)",
rosybrown: "rgba(188,143,143,1.0)",
forestgreen: "rgba(34,139,34,1.0)",
royalblue: "rgba(65,105,225,1.0)",
fuchsia: "rgba(255,0,255,1.0)",
saddlebrown: "rgba(139,69,19,1.0)",
gainsboro: "rgba(220,220,220,1.0)",
salmon: "rgba(250,128,114,1.0)",
ghostwhite: "rgba(248,248,255,1.0)",
sandybrown: "rgba(244,164,96,1.0)",
gold: "rgba(255,215,0,1.0)",
seagreen: "rgba(46,139,87,1.0)",
goldenrod: "rgba(218,165,32,1.0)",
seashell: "rgba(255,245,238,1.0)",
gray: "rgba(128,128,128,1.0)",
sienna: "rgba(160,82,45,1.0)",
green: "rgba(0,128,0,1.0)",
silver: "rgba(192,192,192,1.0)",
greenyellow: "rgba(173,255,47,1.0)",
skyblue: "rgba(135,206,235,1.0)",
grey: "rgba(128,128,128,1.0)",
slateblue: "rgba(106,90,205,1.0)",
honeydew: "rgba(240,255,240,1.0)",
slategray: "rgba(112,128,144,1.0)",
hotpink: "rgba(255,105,180,1.0)",
slategrey: "rgba(112,128,144,1.0)",
indianred: "rgba(205,92,92,1.0)",
snow: "rgba(255,250,250,1.0)",
indigo: "rgba(75,0,130,1.0)",
springgreen: "rgba(0,255,127,1.0)",
ivory: "rgba(255,255,240,1.0)",
steelblue: "rgba(70,130,180,1.0)",
khaki: "rgba(240,230,140,1.0)",
tan: "rgba(210,180,140,1.0)",
lavender: "rgba(230,230,250,1.0)",
teal: "rgba(0,128,128,1.0)",
lavenderblush: "rgba(255,240,245,1.0)",
thistle: "rgba(216,191,216,1.0)",
lawngreen: "rgba(124,252,0,1.0)",
tomato: "rgba(255,99,71,1.0)",
lemonchiffon: "rgba(255,250,205,1.0)",
turquoise: "rgba(64,224,208,1.0)",
lightblue: "rgba(173,216,230,1.0)",
violet: "rgba(238,130,238,1.0)",
lightcoral: "rgba(240,128,128,1.0)",
wheat: "rgba(245,222,179,1.0)",
lightcyan: "rgba(224,255,255,1.0)",
white: "rgba(255,255,255,1.0)",
lightgoldenrodyellow: "rgba(250,250,210,1.0)",
whitesmoke: "rgba(245,245,245,1.0)",
lightgray: "rgba(211,211,211,1.0)",
yellow: "rgba(255,255,0,1.0)",
lightgreen: "rgba(144,238,144,1.0)",
yellowgreen: "rgba(154,205,50,1.0)",
lightgrey: "rgba(211,211,211,1.0)"
}), La = /^#[a-fA-F0-9]{6}$/, Ma = /^#[a-fA-F0-9]{8}$/, Aa = (
// not perfect
/^rgb\(([0-9]+),\s*([0-9]+),\s*([0-9]+)\)$/i
), Ta = (
// not perfect
/^rgba\(([0-9]+),\s*([0-9]+),\s*([0-9]+),\s*([01]?[.][0-9]+|[01])\)$/i
);
function yf(e) {
let t = e.toLowerCase();
if ($o.hasOwnProperty(t) && (e = $o[t]), La.test(e))
return e + "FF";
if (Ma.test(e))
return e;
function n(r) {
return r = Math.max(0, Math.min(255, Math.round(r))), r.toString(16).toUpperCase().padStart(2, "0");
}
let o = Aa.exec(e);
if (o != null)
return "#" + n(parseInt(o[1], 10)) + n(parseInt(o[2], 10)) + n(parseInt(o[3], 10)) + "FF";
if (o = Ta.exec(e), o != null)
return "#" + n(parseInt(o[1], 10)) + n(parseInt(o[2], 10)) + n(parseInt(o[3], 10)) + n(parseFloat(o[4]) * 255);
it("InvalidArgument: the given Value is not a valid CSS Color specification");
}
function wk(e) {
let t = e.toLowerCase();
if ($o.hasOwnProperty(t))
return $o[t];
if (La.test(e))
return "rgba(" + parseInt(e.slice(1, 3), 16) + "," + parseInt(e.slice(3, 5), 16) + "," + parseInt(e.slice(5, 7), 16) + ",1)";
if (Ma.test(e))
return "rgba(" + parseInt(e.slice(1, 3), 16) + "," + parseInt(e.slice(3, 5), 16) + "," + parseInt(e.slice(5, 7), 16) + "," + parseInt(e.slice(7), 16) / 255 + ")";
if (Aa.test(e))
return e.slice(0, e.length - 1) + ",1)";
if (Ta.test(e))
return e;
it("InvalidArgument: the given Value is not a valid CSS Color specification");
}
function kk(e) {
return yf(e).slice(0, 7);
}
var St = typeof window < "u" ? window : { screen: {}, navigator: {} }, Xn = (St.matchMedia || (function() {
return { matches: !1 };
})).bind(St), Tl = !1, xf = {
get passive() {
return Tl = !0;
}
}, Rl = function() {
};
St.addEventListener && St.addEventListener("p", Rl, xf);
St.removeEventListener && St.removeEventListener("p", Rl, !1);
var Ck = Tl, $k = "PointerEvent" in St, Ra = "ontouchstart" in St, vf = "TouchEvent" in St, wf = Ra || vf && Xn("(any-pointer: coarse)").matches, Pi = (St.navigator.maxTouchPoints || 0) > 0 || wf, Fl = St.navigator.userAgent || "", kf = Xn("(pointer: coarse)").matches && // both iPad and iPhone can "request desktop site", which sets the userAgent to Macintosh
// so need to check both userAgents to determine if it is an iOS device
// and screen size to separate iPad from iPhone
/iPad|Macintosh/.test(Fl) && Math.min(St.screen.width || 0, St.screen.height || 0) >= 768, Ol = (Xn("(pointer: coarse)").matches || // if the pointer is not coarse and not fine then the browser doesn't support
// interaction media queries (see https://caniuse.com/css-media-interaction)
// so if it has onTouchStartInWindow assume it has a coarse primary pointer
!Xn("(pointer: fine)").matches && Ra) && // bug in firefox (as of v81) on hybrid windows devices where the interaction media queries
// always indicate a touch only device (only has a coarse pointer that can't hover)
// so assume that the primary pointer is not coarse for firefox windows
!/Windows.*Firefox/.test(Fl), Cf = Xn("(any-pointer: fine)").matches || Xn("(any-hover: hover)").matches || // iPads might have an input device that can hover, so assume it has anyHover
kf || // if no onTouchStartInWindow then the browser is indicating that it is not a touch only device
// see above note for supportsTouchEvents
!Ra, es = Pi && (Cf || !Ol) ? "hybrid" : Pi ? "touchOnly" : "mouseOnly", jk = es === "mouseOnly" ? "mouse" : es === "touchOnly" || // if the device is a hybrid, then if the primary pointer is coarse
// assume the primaryInput is touch, otherwise assume it's mouse
Ol ? "touch" : "mouse", Oo, Le, zl, Fa, pn, ts, Vl, Nl, Hr, cr, vo, El, Oa, ea, ta, Bl, gr = {}, mr = [], $f = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, zo = Array.isArray;
function Kt(e, t) {
for (var n in t) e[n] = t[n];
return e;
}
function za(e) {
e && e.parentNode && e.parentNode.removeChild(e);
}
function Yn(e, t, n) {
var o, r, a, i = {};
for (a in t) a == "key" ? o = t[a] : a == "ref" ? r = t[a] : i[a] = t[a];
if (arguments.length > 2 && (i.children = arguments.length > 3 ? Oo.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) i[a] === void 0 && (i[a] = e.defaultProps[a]);
return wo(e, i, o, r, null);
}
function wo(e, t, n, o, r) {
var a = { type: e, props: t, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r ?? ++zl, __i: -1, __u: 0 };
return r == null && Le.vnode != null && Le.vnode(a), a;
}
function jf() {
return { current: null };
}
function Jn(e) {
return e.children;
}
function qt(e, t) {
this.props = e, this.context = t;
}
function Zn(e, t) {
if (t == null) return e.__ ? Zn(e.__, e.__i + 1) : null;
for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
return typeof e.type == "function" ? Zn(e) : null;
}
function If(e) {
if (e.__P && e.__d) {
var t = e.__v, n = t.__e, o = [], r = [], a = Kt({}, t);
a.__v = t.__v + 1, Le.vnode && Le.vnode(a), Va(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, o, n ?? Zn(t), !!(32 & t.__u), r), a.__v = t.__v, a.__.__k[a.__i] = a, Kl(o, a, r), t.__e = t.__ = null, a.__e != n && Wl(a);
}
}
function Wl(e) {
if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
}), Wl(e);
}
function na(e) {
(!e.__d && (e.__d = !0) && pn.push(e) && !br.__r++ || ts != Le.debounceRendering) && ((ts = Le.debounceRendering) || Vl)(br);
}
function br() {
try {
for (var e, t = 1; pn.length; ) pn.length > t && pn.sort(Nl), e = pn.shift(), t = pn.length, If(e);
} finally {
pn.length = br.__r = 0;
}
}
function Hl(e, t, n, o, r, a, i, s, c, d, u) {
var p, l, f, h, g, b, m, v = o && o.__k || mr, C = t.length;
for (c = Sf(n, t, v, c, C), p = 0; p < C; p++) (f = n.__k[p]) != null && (l = f.__i != -1 && v[f.__i] || gr, f.__i = p, b = Va(e, f, l, r, a, i, s, c, d, u), h = f.__e, f.ref && l.ref != f.ref && (l.ref && Na(l.ref, null, f), u.push(f.ref, f.__c || h, f)), g == null && h != null && (g = h), (m = !!(4 & f.__u)) || l.__k === f.__k ? (c = Gl(f, c, e, m), m && l.__e && (l.__e = null)) : typeof f.type == "function" && b !== void 0 ? c = b : h && (c = h.nextSibling), f.__u &= -7);
return n.__e = g, c;
}
function Sf(e, t, n, o, r) {
var a, i, s, c, d, u = n.length, p = u, l = 0;
for (e.__k = new Array(r), a = 0; a < r; a++) (i = t[a]) != null && typeof i != "boolean" && typeof i != "function" ? (typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? i = e.__k[a] = wo(null, i, null, null, null) : zo(i) ? i = e.__k[a] = wo(Jn, { children: i }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? i = e.__k[a] = wo(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : e.__k[a] = i, c = a + l, i.__ = e, i.__b = e.__b + 1, s = null, (d = i.__i = _f(i, n, c, p)) != -1 && (p--, (s = n[d]) && (s.__u |= 2)), s == null || s.__v == null ? (d == -1 && (r > u ? l-- : r < u && l++), typeof i.type != "function" && (i.__u |= 4)) : d != c && (d == c - 1 ? l-- : d == c + 1 ? l++ : (d > c ? l-- : l++, i.__u |= 4))) : e.__k[a] = null;
if (p) for (a = 0; a < u; a++) (s = n[a]) != null && (2 & s.__u) == 0 && (s.__e == o && (o = Zn(s)), Xl(s, s));
return o;
}
function Gl(e, t, n, o) {
var r, a;
if (typeof e.type == "function") {
for (r = e.__k, a = 0; r && a < r.length; a++) r[a] && (r[a].__ = e, t = Gl(r[a], t, n, o));
return t;
}
e.__e != t && (o && (t && e.type && !t.parentNode && (t = Zn(e)), n.insertBefore(e.__e, t || null)), t = e.__e);
do
t = t && t.nextSibling;
while (t != null && t.nodeType == 8);
return t;
}
function Mt(e, t) {
return t = t || [], e == null || typeof e == "boolean" || (zo(e) ? e.some(function(n) {
Mt(n, t);
}) : t.push(e)), t;
}
function _f(e, t, n, o) {
var r, a, i, s = e.key, c = e.type, d = t[n], u = d != null && (2 & d.__u) == 0;
if (d === null && s == null || u && s == d.key && c == d.type) return n;
if (o > (u ? 1 : 0)) {
for (r = n - 1, a = n + 1; r >= 0 || a < t.length; ) if ((d = t[i = r >= 0 ? r-- : a++]) != null && (2 & d.__u) == 0 && s == d.key && c == d.type) return i;
}
return -1;
}
function ns(e, t, n) {
t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || $f.test(t) ? n : n + "px";
}
function tr(e, t, n, o, r) {
var a, i;
e: if (t == "style") if (typeof n == "string") e.style.cssText = n;
else {
if (typeof o == "string" && (e.style.cssText = o = ""), o) for (t in o) n && t in n || ns(e.style, t, "");
if (n) for (t in n) o && n[t] == o[t] || ns(e.style, t, n[t]);
}
else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(El, "$1")), i = t.toLowerCase(), t = i in e || t == "onFocusOut" || t == "onFocusIn" ? i.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + a] = n, n ? o ? n[vo] = o[vo] : (n[vo] = Oa, e.addEventListener(t, a ? ta : ea, a)) : e.removeEventListener(t, a ? ta : ea, a);
else {
if (r == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
e[t] = n ?? "";
break e;
} catch {
}
typeof n == "function" || (n == null || n === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
}
}
function os(e) {
return function(t) {
if (this.l) {
var n = this.l[t.type + e];
if (t[cr] == null) t[cr] = Oa++;
else if (t[cr] < n[vo]) return;
return n(Le.event ? Le.event(t) : t);
}
};
}
function Va(e, t, n, o, r, a, i, s, c, d) {
var u, p, l, f, h, g, b, m, v, C, S, j, x, w, T, L, $ = t.type;
if (t.constructor !== void 0) return null;
128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = Le.__b) && u(t);
e: if (typeof $ == "function") {
p = i.length;
try {
if (v = t.props, C = $.prototype && $.prototype.render, S = (u = $.contextType) && o[u.__c], j = u ? S ? S.props.value : u.__ : o, n.__c ? m = (l = t.__c = n.__c).__ = l.__E : (C ? t.__c = l = new $(v, j) : (t.__c = l = new qt(v, j), l.constructor = $, l.render = Lf), S && S.sub(l), l.state || (l.state = {}), l.__n = o, f = l.__d = !0, l.__h = [], l._sb = []), C && l.__s == null && (l.__s = l.state), C && $.getDerivedStateFromProps != null && (l.__s == l.state && (l.__s = Kt({}, l.__s)), Kt(l.__s, $.getDerivedStateFromProps(v, l.__s))), h = l.props, g = l.state, l.__v = t, f) C && $.getDerivedStateFromProps == null && l.componentWillMount != null && l.componentWillMount(), C && l.componentDidMount != null && l.__h.push(l.componentDidMount);
else {
if (C && $.getDerivedStateFromProps == null && v !== h && l.componentWillReceiveProps != null && l.componentWillReceiveProps(v, j), t.__v == n.__v || !l.__e && l.shouldComponentUpdate != null && l.shouldComponentUpdate(v, l.__s, j) === !1) {
t.__v != n.__v && (l.props = v, l.state = l.__s, l.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(I) {
I && (I.__ = t);
}), mr.push.apply(l.__h, l._sb), l._sb = [], l.__h.length && i.push(l);
break e;
}
l.componentWillUpdate != null && l.componentWillUpdate(v, l.__s, j), C && l.componentDidUpdate != null && l.__h.push(function() {
l.componentDidUpdate(h, g, b);
});
}
if (l.context = j, l.props = v, l.__P = e, l.__e = !1, x = Le.__r, w = 0, C) l.state = l.__s, l.__d = !1, x && x(t), u = l.render(l.props, l.state, l.context), mr.push.apply(l.__h, l._sb), l._sb = [];
else do
l.__d = !1, x && x(t), u = l.render(l.props, l.state, l.context), l.state = l.__s;
while (l.__d && ++w < 25);
l.state = l.__s, l.getChildContext != null && (o = Kt(Kt({}, o), l.getChildContext())), C && !f && l.getSnapshotBeforeUpdate != null && (b = l.getSnapshotBeforeUpdate(h, g)), T = u != null && u.type === Jn && u.key == null ? ql(u.props.children) : u, s = Hl(e, zo(T) ? T : [T], t, n, o, r, a, i, s, c, d), l.base = t.__e, t.__u &= -161, l.__h.length && i.push(l), m && (l.__E = l.__ = null);
} catch (I) {
if (i.length = p, t.__v = null, c || a != null) {
if (I.then) {
for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling; ) s = s.nextSibling;
a != null && (a[a.indexOf(s)] = null), t.__e = s;
} else if (a != null) for (L = a.length; L--; ) za(a[L]);
} else t.__e = n.__e;
t.__k == null && (t.__k = n.__k || []), I.then || Ul(t), Le.__e(I, t, n);
}
} else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = Df(n.__e, t, n, o, r, a, i, c, d);
return (u = Le.diffed) && u(t), 128 & t.__u ? void 0 : s;
}
function Ul(e) {
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(Ul));
}
function Kl(e, t, n) {
for (var o = 0; o < n.length; o++) Na(n[o], n[++o], n[++o]);
Le.__c && Le.__c(t, e), e.some(function(r) {
try {
e = r.__h, r.__h = [], e.some(function(a) {
a.call(r);
});
} catch (a) {
Le.__e(a, r.__v);
}
});
}
function ql(e) {
return typeof e != "object" || e == null || e.__b > 0 ? e : zo(e) ? e.map(ql) : e.constructor !== void 0 ? null : Kt({}, e);
}
function Df(e, t, n, o, r, a, i, s, c) {
var d, u, p, l, f, h, g, b = n.props || gr, m = t.props, v = t.type;
if (v == "svg" ? r = "http://www.w3.org/2000/svg" : v == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), a != null) {
for (d = 0; d < a.length; d++) if ((f = a[d]) && "setAttribute" in f == !!v && (v ? f.localName == v : f.nodeType == 3)) {
e = f, a[d] = null;
break;
}
}
if (e == null) {
if (v == null) return document.createTextNode(m);
e = document.createElementNS(r, v, m.is && m), s && (Le.__m && Le.__m(t, a), s = !1), a = null;
}
if (v == null) b === m || s && e.data == m || (e.data = m);
else {
if (a = v == "textarea" && m.defaultValue != null ? null : a && Oo.call(e.childNodes), !s && a != null) for (b = {}, d = 0; d < e.attributes.length; d++) b[(f = e.attributes[d]).name] = f.value;
for (d in b) f = b[d], d == "dangerouslySetInnerHTML" ? p = f : d == "children" || d in m || d == "value" && "defaultValue" in m || d == "checked" && "defaultChecked" in m || tr(e, d, null, f, r);
for (d in m) f = m[d], d == "children" ? l = f : d == "dangerouslySetInnerHTML" ? u = f : d == "value" ? h = f : d == "checked" ? g = f : s && typeof f != "function" || b[d] === f || tr(e, d, f, b[d], r);
if (u) s || p && (u.__html == p.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];
else if (p && (e.innerHTML = ""), Hl(t.type == "template" ? e.content : e, zo(l) ? l : [l], t, n, o, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, a, i, a ? a[0] : n.__k && Zn(n, 0), s, c), a != null) for (d = a.length; d--; ) za(a[d]);
s && v != "textarea" || (d = "value", v == "progress" && h == null ? e.removeAttribute("value") : h != null && (h !== e[d] || v == "progress" && !h || v == "option" && h != b[d]) && tr(e, d, h, b[d], r), d = "checked", g != null && g != e[d] && tr(e, d, g, b[d], r));
}
return e;
}
function Na(e, t, n) {
try {
if (typeof e == "function") {
var o = typeof e.__u == "function";
o && e.__u(), o && t == null || (e.__u = e(t));
} else e.current = t;
} catch (r) {
Le.__e(r, n);
}
}
function Xl(e, t, n) {
var o, r;
if (Le.unmount && Le.unmount(e), (o = e.ref) && (o.current && o.current != e.__e || Na(o, null, t)), (o = e.__c) != null) {
if (o.componentWillUnmount) try {
o.componentWillUnmount();
} catch (a) {
Le.__e(a, t);
}
o.base = o.__P = o.__n = null;
}
if (o = e.__k) for (r = 0; r < o.length; r++) o[r] && Xl(o[r], t, n || typeof e.type != "function");
n || za(e.__e), e.__c = e.__ = e.__e = void 0;
}
function Lf(e, t, n) {
return this.constructor(e, n);
}
function jo(e, t, n) {
var o, r, a, i;
t == document && (t = document.documentElement), Le.__ && Le.__(e, t), r = (o = typeof n == "function") ? null : n && n.__k || t.__k, a = [], i = [], Va(t, e = (!o && n || t).__k = Yn(Jn, null, [e]), r || gr, gr, t.namespaceURI, !o && n ? [n] : r ? null : t.firstChild ? Oo.call(t.childNodes) : null, a, !o && n ? n : r ? r.__e : t.firstChild, o, i), Kl(a, e, i), e.props.children = null;
}
function Mf(e, t, n) {
var o, r, a, i, s = Kt({}, e.props);
for (a in e.type && e.type.defaultProps && (i = e.type.defaultProps), t) a == "key" ? o = t[a] : a == "ref" ? r = t[a] : s[a] = t[a] === void 0 && i != null ? i[a] : t[a];
return arguments.length > 2 && (s.children = arguments.length > 3 ? Oo.call(arguments, 2) : n), wo(e.type, s, o || e.key, r || e.ref, null);
}
function yn(e) {
function t(n) {
var o, r;
return this.getChildContext || (o = /* @__PURE__ */ new Set(), (r = {})[t.__c] = this, this.getChildContext = function() {
return r;
}, this.componentWillUnmount = function() {
o = null;
}, this.shouldComponentUpdate = function(a) {
this.props.value != a.value && o.forEach(function(i) {
i.__e = !0, na(i);
});
}, this.sub = function(a) {
o.add(a);
var i = a.componentWillUnmount;
a.componentWillUnmount = function() {
o && o.delete(a), i && i.call(a);
};
}), n.children;
}
return t.__c = "__cC" + Bl++, t.__ = e, t.Provider = t.__l = (t.Consumer = function(n, o) {
return n.children(o);
}).contextType = t, t;
}
Oo = mr.slice, Le = { __e: function(e, t, n, o) {
for (var r, a, i; t = t.__; ) if ((r = t.__c) && !r.__) try {
if ((a = r.constructor) && a.getDerivedStateFromError != null && (r.setState(a.getDerivedStateFromError(e)), i = r.__d), r.componentDidCatch != null && (r.componentDidCatch(e, o || {}), i = r.__d), i) return r.__E = r;
} catch (s) {
e = s;
}
throw e;
} }, zl = 0, Fa = function(e) {
return e != null && e.constructor === void 0;
}, qt.prototype.setState = function(e, t) {
var n;
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = Kt({}, this.state), typeof e == "function" && (e = e(Kt({}, n), this.props)), e && Kt(n, e), e != null && this.__v && (t && this._sb.push(t), na(this));
}, qt.prototype.forceUpdate = function(e) {
this.__v && (this.__e = !0, e && this.__h.push(e), na(this));
}, qt.prototype.render = Jn, pn = [], Vl = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Nl = function(e, t) {
return e.__v.__b - t.__v.__b;
}, br.__r = 0, Hr = Math.random().toString(8), cr = "__d" + Hr, vo = "__a" + Hr, El = /(PointerCapture)$|Capture$/i, Oa = 0, ea = os(!1), ta = os(!0), Bl = 0;
var Yl = function(e, t, n, o) {
var r;
t[0] = 0;
for (var a = 1; a < t.length; a++) {
var i = t[a++], s = t[a] ? (t[0] |= i ? 1 : 2, n[t[a++]]) : t[++a];
i === 3 ? o[0] = s : i === 4 ? o[1] = Object.assign(o[1] || {}, s) : i === 5 ? (o[1] = o[1] || {})[t[++a]] = s : i === 6 ? o[1][t[++a]] += s + "" : i ? (r = e.apply(s, Yl(e, s, n, ["", null])), o.push(r), s[0] ? t[0] |= 2 : (t[a - 2] = 0, t[a] = r)) : o.push(s);
}
return o;
}, rs = /* @__PURE__ */ new Map();
function Af(e) {
var t = rs.get(this);
return t || (t = /* @__PURE__ */ new Map(), rs.set(this, t)), (t = Yl(this, t.get(e) || (t.set(e, t = (function(n) {
for (var o, r, a = 1, i = "", s = "", c = [0], d = function(l) {
a === 1 && (l || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(0, l, i) : a === 3 && (l || i) ? (c.push(3, l, i), a = 2) : a === 2 && i === "..." && l ? c.push(4, l, 0) : a === 2 && i && !l ? c.push(5, 0, !0, i) : a >= 5 && ((i || !l && a === 5) && (c.push(a, 0, i, r), a = 6), l && (c.push(a, l, 0, r), a = 6)), i = "";
}, u = 0; u < n.length; u++) {
u && (a === 1 && d(), d(u));
for (var p = 0; p < n[u].length; p++) o = n[u][p], a === 1 ? o === "<" ? (d(), c = [c], a = 3) : i += o : a === 4 ? i === "--" && o === ">" ? (a = 1, i = "") : i = o + i[0] : s ? o === s ? s = "" : i += o : o === '"' || o === "'" ? s = o : o === ">" ? (d(), a = 1) : a && (o === "=" ? (a = 5, r = i, i = "") : o === "/" && (a < 5 || n[u][p + 1] === ">") ? (d(), a === 3 && (c = c[0]), a = c, (c = c[0]).push(2, 0, a), a = 0) : o === " " || o === " " || o === `
` || o === "\r" ? (d(), a = 2) : i += o), a === 3 && i === "!--" && (a = 4, c = c[0]);
}
return d(), c;
})(e)), t), arguments, [])).length > 1 ? t : t[0];
}
var y = Af.bind(Yn), sn, Je, Gr, as, Io = 0, Jl = [], rt = Le, is = rt.__b, ss = rt.__r, ls = rt.diffed, cs = rt.__c, ds = rt.unmount, us = rt.__;
function zn(e, t) {
rt.__h && rt.__h(Je, e, Io || t), Io = 0;
var n = Je.__H || (Je.__H = { __: [], __h: [] });
return e >= n.__.length && n.__.push({}), n.__[e];
}
function Ue(e) {
return Io = 1, Tf(Zl, e);
}
function Tf(e, t, n) {
var o = zn(sn++, 2);
if (o.t = e, !o.__c && (o.__ = [n ? n(t) : Zl(void 0, t), function(s) {
var c = o.__N ? o.__N[0] : o.__[0], d = o.t(c, s);
c !== d && (o.__N = [d, o.__[1]], o.__c.setState({}));
}], o.__c = Je, !Je.__f)) {
var r = function(s, c, d) {
if (!o.__c.__H) return !0;
var u = !1, p = o.__c.props !== s;
if (o.__c.__H.__.some(function(f) {
if (f.__N) {
u = !0;
var h = f.__[0];
f.__ = f.__N, f.__N = void 0, h !== f.__[0] && (p = !0);
}
}), a) {
var l = a.call(this, s, c, d);
return u ? l || p : l;
}
return !u || p;
};
Je.__f = !0;
var a = Je.shouldComponentUpdate, i = Je.componentWillUpdate;
Je.componentWillUpdate = function(s, c, d) {
if (this.__e) {
var u = a;
a = void 0, r(s, c, d), a = u;
}
i && i.call(this, s, c, d);
}, Je.shouldComponentUpdate = r;
}
return o.__N || o.__;
}
function je(e, t) {
var n = zn(sn++, 3);
!rt.__s && Wa(n.__H, t) && (n.__ = e, n.u = t, Je.__H.__h.push(n));
}
function Ea(e, t) {
var n = zn(sn++, 4);
!rt.__s && Wa(n.__H, t) && (n.__ = e, n.u = t, Je.__h.push(n));
}
function U(e) {
return Io = 5, Qt(function() {
return { current: e };
}, []);
}
function Qt(e, t) {
var n = zn(sn++, 7);
return Wa(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
}
function se(e, t) {
return Io = 8, Qt(function() {
return e;
}, t);
}
function bt(e) {
var t = Je.context[e.__c], n = zn(sn++, 9);
return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(Je)), t.props.value) : e.__;
}
function Ba(e) {
var t = zn(sn++, 10), n = Ue();
return t.__ = e, Je.componentDidCatch || (Je.componentDidCatch = function(o, r) {
t.__ && t.__(o, r), n[1](o);
}), [n[0], function() {
n[1](void 0);
}];
}
function Bt() {
var e = zn(sn++, 11);
if (!e.__) {
for (var t = Je.__v; t !== null && !t.__m && t.__ !== null; ) t = t.__;
var n = t.__m || (t.__m = [0, 0]);
e.__ = "P" + n[0] + "-" + n[1]++;
}
return e.__;
}
function Rf() {
for (var e; e = Jl.shift(); ) {
var t = e.__H;
if (e.__P && t) try {
t.__h.some(dr), t.__h.some(oa), t.__h = [];
} catch (n) {
t.__h = [], rt.__e(n, e.__v);
}
}
}
rt.__b = function(e) {
Je = null, is && is(e);
}, rt.__ = function(e, t) {
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), us && us(e, t);
}, rt.__r = function(e) {
ss && ss(e), sn = 0;
var t = (Je = e.__c).__H;
t && (Gr === Je ? (t.__h = [], Je.__h = [], t.__.some(function(n) {
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
})) : (t.__h.some(dr), t.__h.some(oa), t.__h = [], sn = 0)), Gr = Je;
}, rt.diffed = function(e) {
ls && ls(e);
var t = e.__c;
t && t.__H && (t.__H.__h.length && (Jl.push(t) !== 1 && as === rt.requestAnimationFrame || ((as = rt.requestAnimationFrame) || Ff)(Rf)), t.__H.__.some(function(n) {
n.u && (n.__H = n.u, n.u = void 0);
})), Gr = Je = null;
}, rt.__c = function(e, t) {
t.some(function(n) {
try {
n.__h.some(dr), n.__h = n.__h.filter(function(o) {
return !o.__ || oa(o);
});
} catch (o) {
t.some(function(r) {
r.__h && (r.__h = []);
}), t = [], rt.__e(o, n.__v);
}
}), cs && cs(e, t);
}, rt.unmount = function(e) {
ds && ds(e);
var t, n = e.__c;
n && n.__H && (n.__H.__.some(function(o) {
try {
dr(o);
} catch (r) {
t = r;
}
}), n.__H = void 0, t && rt.__e(t, n.__v));
};
var ps = typeof requestAnimationFrame == "function";
function Ff(e) {
var t, n = function() {
clearTimeout(o), ps && cancelAnimationFrame(t), setTimeout(e);
}, o = setTimeout(n, 35);
ps && (t = requestAnimationFrame(n));
}
function dr(e) {
var t = Je, n = e.__c;
typeof n == "function" && (e.__c = void 0, n()), Je = t;
}
function oa(e) {
var t = Je;
e.__c = e.__(), Je = t;
}
function Wa(e, t) {
return !e || e.length !== t.length || t.some(function(n, o) {
return n !== e[o];
});
}
function Zl(e, t) {
return typeof t == "function" ? t(e) : t;
}
function Of(e, t) {
for (var n in t) e[n] = t[n];
return e;
}
function fs(e, t) {
for (var n in e) if (n !== "__source" && !(n in t)) return !0;
for (var o in t) if (o !== "__source" && e[o] !== t[o]) return !0;
return !1;
}
function hs(e, t) {
this.props = e, this.context = t;
}
(hs.prototype = new qt()).isPureReactComponent = !0, hs.prototype.shouldComponentUpdate = function(e, t) {
return fs(this.props, e) || fs(this.state, t);
};
var gs = Le.__b;
Le.__b = function(e) {
e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), gs && gs(e);
};
var zf = Le.__e;
Le.__e = function(e, t, n, o) {
if (e.then) {
for (var r, a = t; a = a.__; ) if ((r = a.__c) && r.__c) return t.__e == null && (t.__e = n.__e, t.__k = n.__k || []), r.__c(e, t);
}
zf(e, t, n, o);
};
var ms = Le.unmount;
function Ql(e, t, n) {
return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(o) {
typeof o.__c == "function" && o.__c();
}), e.__c.__H = null), (e = Of({}, e)).__c != null && (e.__c.__P === n && (e.__c.__P = t), e.__c.__e = !0, e.__c = null), e.__k = e.__k && e.__k.map(function(o) {
return Ql(o, t, n);
})), e;
}
function Pl(e, t, n) {
return e && n && (e.__v = null, e.__k = e.__k && e.__k.map(function(o) {
return Pl(o, t, n);
}), e.__c && e.__c.__P === t && (e.__e && n.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = n)), e;
}
function Ur() {
this.__u = 0, this.o = null, this.__b = null;
}
function ec(e) {
var t = e.__ && e.__.__c;
return t && t.__a && t.__a(e);
}
function nr() {
this.i = null, this.l = null;
}
Le.unmount = function(e) {
var t = e.__c;
t && (t.__z = !0), t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), ms && ms(e);
}, (Ur.prototype = new qt()).__c = function(e, t) {
var n = t.__c, o = this;
o.o == null && (o.o = []), o.o.push(n);
var r = ec(o.__v), a = !1, i = function() {
a || o.__z || (a = !0, n.__R = null, r ? r(c) : c());
};
n.__R = i;
var s = n.__P;
n.__P = null;
var c = function() {
if (!--o.__u) {
if (o.state.__a) {
var d = o.state.__a;
o.__v.__k[0] = Pl(d, d.__c.__P, d.__c.__O);
}
var u;
for (o.setState({ __a: o.__b = null }); u = o.o.pop(); ) u.__P = s, u.forceUpdate();
}
};
o.__u++ || 32 & t.__u || o.setState({ __a: o.__b = o.__v.__k[0] }), e.then(i, i);
}, Ur.prototype.componentWillUnmount = function() {
this.o = [];
}, Ur.prototype.render = function(e, t) {
if (this.__b) {
if (this.__v.__k) {
var n = document.createElement("div"), o = this.__v.__k[0].__c;
this.__v.__k[0] = Ql(this.__b, n, o.__O = o.__P);
}
this.__b = null;
}
var r = t.__a && Yn(Jn, null, e.fallback);
return r && (r.__u &= -33), [Yn(Jn, null, t.__a ? null : e.children), r];
};
var bs = function(e, t, n) {
if (++n[1] === n[0] && e.l.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.l.size)) for (n = e.i; n; ) {
for (; n.length > 3; ) n.pop()();
if (n[1] < n[0]) break;
e.i = n = n[2];
}
};
function Vf(e) {
return this.getChildContext = function() {
return e.context;
}, e.children;
}
function Nf(e) {
var t = this, n = e.h;
if (t.componentWillUnmount = function() {
jo(null, t.v), t.v = null, t.h = null;
}, t.h && t.h !== n && t.componentWillUnmount(), !t.v) {
for (var o = t.__v; o !== null && !o.__m && o.__ !== null; ) o = o.__;
t.h = n, t.v = { nodeType: 1, parentNode: n, childNodes: [], __k: { __m: o.__m }, contains: function() {
return !0;
}, namespaceURI: n.namespaceURI, insertBefore: function(r, a) {
this.childNodes.push(r), t.h.insertBefore(r, a);
}, removeChild: function(r) {
this.childNodes.splice(this.childNodes.indexOf(r) >>> 1, 1), t.h.removeChild(r);
} };
}
jo(Yn(Vf, { context: t.context }, e.__v), t.v);
}
function to(e, t) {
var n = Yn(Nf, { __v: e, h: t });
return n.containerInfo = t, n;
}
(nr.prototype = new qt()).__a = function(e) {
var t = this, n = ec(t.__v), o = t.l.get(e);
return o[0]++, function(r) {
var a = function() {
t.props.revealOrder ? (o.push(r), bs(t, e, o)) : r();
};
n ? n(a) : a();
};
}, nr.prototype.render = function(e) {
this.i = null, this.l = /* @__PURE__ */ new Map();
var t = Mt(e.children);
e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
for (var n = t.length; n--; ) this.l.set(t[n], this.i = [1, 0, this.i]);
return e.children;
}, nr.prototype.componentDidUpdate = nr.prototype.componentDidMount = function() {
var e = this;
this.l.forEach(function(t, n) {
bs(e, n, t);
});
};
var Ef = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Bf = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Wf = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Hf = /[A-Z0-9]/g, Gf = typeof document < "u", Uf = function(e) {
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
};
qt.prototype.isReactComponent = !0, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
Object.defineProperty(qt.prototype, e, { configurable: !0, get: function() {
return this["UNSAFE_" + e];
}, set: function(t) {
Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
} });
});
var ys = Le.event;
Le.event = function(e) {
return ys && (e = ys(e)), e.persist = function() {
}, e.isPropagationStopped = function() {
return this.cancelBubble;
}, e.isDefaultPrevented = function() {
return this.defaultPrevented;
}, e.nativeEvent = e;
};
var Kf = { configurable: !0, get: function() {
return this.class;
} }, xs = Le.vnode;
Le.vnode = function(e) {
typeof e.type == "string" && (function(t) {
var n = t.props, o = t.type, r = {}, a = o.indexOf("-") == -1;
for (var i in n) {
var s = n[i];
if (!(i === "value" && "defaultValue" in n && s == null || Gf && i === "children" && o === "noscript" || i === "class" || i === "className")) {
var c = i.toLowerCase();
i === "defaultValue" && "value" in n && n.value == null ? i = "value" : i === "download" && s === !0 ? s = "" : c === "translate" && s === "no" ? s = !1 : c[0] === "o" && c[1] === "n" ? c === "ondoubleclick" ? i = "ondblclick" : c !== "onchange" || o !== "input" && o !== "textarea" || Uf(n.type) ? c === "onfocus" ? i = "onfocusin" : c === "onblur" ? i = "onfocusout" : Wf.test(i) && (i = c) : c = i = "oninput" : a && Bf.test(i) ? i = i.replace(Hf, "-$&").toLowerCase() : s === null && (s = void 0), c === "oninput" && r[i = c] && (i = "oninputCapture"), r[i] = s;
}
}
o == "select" && (r.multiple && Array.isArray(r.value) && (r.value = Mt(n.children).forEach(function(d) {
d.props.selected = r.value.indexOf(d.props.value) != -1;
})), r.defaultValue != null && (r.value = Mt(n.children).forEach(function(d) {
d.props.selected = r.multiple ? r.defaultValue.indexOf(d.props.value) != -1 : r.defaultValue == d.props.value;
}))), n.class && !n.className ? (r.class = n.class, Object.defineProperty(r, "className", Kf)) : n.className && (r.class = r.className = n.className), t.props = r;
})(e), e.$$typeof = Ef, xs && xs(e);
};
var vs = Le.__r;
Le.__r = function(e) {
vs && vs(e), e.__c;
};
var ws = Le.diffed;
Le.diffed = function(e) {
ws && ws(e);
var t = e.props, n = e.__e;
n != null && e.type === "textarea" && "value" in t && t.value !== n.value && (n.value = t.value == null ? "" : t.value);
};
function ko(e) {
return wa(e);
}
function Me(e) {
return Ro(e);
}
const qf = (async () => {
}).constructor;
function Xf() {
typeof window < "u" && window.addEventListener("unhandledrejection", (e) => {
console.error(
"caught unhandled error in Promise:",
e.reason?.stack ?? e.reason?.message,
e
);
});
}
function de(e) {
debugger;
const t = /^([$a-zA-Z][$a-zA-Z0-9]*):\s*(\S.+)\s*$/.exec(e);
if (t == null)
throw new Error(e);
{
const n = new Error(t[2]);
throw n.name = t[1], n;
}
}
function Yf(e) {
return de(
"ReadOnlyProperty: property " + Lt(e) + " must not be set"
);
}
function ut(e, t) {
const n = te(e, _e, t), o = te(e, Se, t);
return [n, n, o, o];
}
const Jf = /^[a-z$_][a-z$_0-9]*$/i;
function Zf(e) {
return st(e, Jf);
}
const [Ik, Sk, Qf, _k] = /* @__PURE__ */ ut(Zf, "JCL identifier");
function Ha(e) {
return Pe(e) && /^[a-zA-Z][a-zA-Z0-9_-]*$/.test(e);
}
const [Pf, Dk, Ln, Lk] = /* @__PURE__ */ ut(Ha, "name");
function tc(e) {
return Pe(e) && /^[a-zA-Z][a-zA-Z0-9_-]*(\.[a-zA-Z][a-zA-Z0-9_-]*)*$/.test(e);
}
const [Mk, Ak, nc, Tk] = /* @__PURE__ */ ut(tc, "path");
function Mr(e) {
return Pe(e) && /^[+]?[\d\s()\-.]{7,}$/.test(e) && e.replace(/\D/g, "").length >= 3;
}
const [Rk, Fk, Ok, zk] = /* @__PURE__ */ ut(Mr, "phone number");
function Vk(e) {
return Ee(e) && (e.indexOf(",") < 0 ? Tn(e) : Ie(
e.replace(/\s*,\s*/g, ",").split(","),
Tn
));
}
const eh = /* @__PURE__ */ new Set([
"aa",
"ab",
"ae",
"af",
"ak",
"am",
"an",
"ar",
"as",
"av",
"ay",
"az",
"ba",
"be",
"bg",
"bh",
"bi",
"bm",
"bn",
"bo",
"br",
"bs",
"ca",
"ce",
"ch",
"co",
"cr",
"cs",
"cu",
"cv",
"cy",
"da",
"de",
"dv",
"dz",
"ee",
"el",
"en",
"eo",
"es",
"et",
"eu",
"fa",
"ff",
"fi",
"fj",
"fo",
"fr",
"fy",
"ga",
"gd",
"gl",
"gn",
"gu",
"gv",
"ha",
"he",
"hi",
"ho",
"hr",
"ht",
"hu",
"hy",
"hz",
"ia",
"id",
"ie",
"ig",
"ii",
"ik",
"io",
"is",
"it",
"iu",
"ja",
"jv",
"ka",
"kg",
"ki",
"kj",
"kk",
"kl",
"km",
"kn",
"ko",
"kr",
"ks",
"ku",
"kv",
"kw",
"ky",
"la",
"lb",
"lg",
"li",
"ln",
"lo",
"lt",
"lu",
"lv",
"mg",
"mh",
"mi",
"mk",
"ml",
"mn",
"mr",
"ms",
"mt",
"my",
"na",
"nb",
"nd",
"ne",
"ng",
"nl",
"nn",
"no",
"nr",
"nv",
"ny",
"oc",
"oj",
"om",
"or",
"os",
"pa",
"pi",
"pl",
"ps",
"pt",
"qu",
"rm",
"rn",
"ro",
"ru",
"rw",
"sa",
"sc",
"sd",
"se",
"sg",
"si",
"sk",
"sl",
"sm",
"sn",
"so",
"sq",
"sr",
"ss",
"st",
"su",
"sv",
"sw",
"ta",
"te",
"tg",
"th",
"ti",
"tk",
"tl",
"tn",
"to",
"tr",
"ts",
"tt",
"tw",
"ty",
"ug",
"uk",
"ur",
"uz",
"ve",
"vi",
"vo",
"wa",
"wo",
"xh",
"yi",
"yo",
"za",
"zh",
"zu"
]);
function th(e) {
return Pe(e) && eh.has(e.toLowerCase());
}
const [nh, Nk, Ek, Bk] = /* @__PURE__ */ ut(th, "ISO 639-1 Language Code"), oh = /^[a-z0-9]+([._+-][a-z0-9]+)*\/[a-z0-9]+([._+-][a-z0-9]+)*(\s*;\s*[a-z0-9-]+=[a-z0-9.+-]+)*$/i;
function So(e) {
return st(e, oh);
}
const [Wk, Hk, rh, Gk] = /* @__PURE__ */ ut(So, "MIME type"), ah = [
"application/javascript",
"application/typescript",
"application/json",
"application/pdf",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"text/html",
"text/markdown",
"text/plain"
];
function Uk(e) {
return ge(e, ah);
}
const ih = [
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"text/html",
"text/markdown",
"text/plain"
];
function Kk(e) {
return ge(e, ih);
}
const sh = [
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"text/markdown",
"text/plain"
];
function qk(e) {
return ge(e, sh);
}
const lh = [
"image/apng",
"image/avif",
"image/bmp",
"image/gif",
"image/jpeg",
"image/png",
"image/svg+xml",
"image/webp"
];
function Xk(e) {
return ge(e, lh);
}
const ch = new RegExp(
"^[^\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x9F\\u2028\\u2029\\uFFF9-\\uFFFB]*$"
);
function Vo(e) {
return Pe(e) && ch.test(e);
}
function oc(e) {
return (ko(e) || Vt(e)) && Vt(e.then);
}
const [Yk, Jk, Zk, Qk] = /* @__PURE__ */ ut(oc, "JavaScript Promise or thenable");
function dh(e) {
return typeof e == "object" && e != null && typeof e.aborted == "boolean" && typeof e.addEventListener == "function";
}
const [uh, Pk, eC, tC] = /* @__PURE__ */ ut(dh, "JavaScript abort signal");
function ph() {
return typeof window < "u" && "__TAURI_INTERNALS__" in window;
}
function nC() {
return typeof window < "u" && !ph();
}
async function fh(e = "https://cloudflare.com/cdn-cgi/trace", t = 5e3) {
return typeof navigator < "u" && !navigator.onLine ? !1 : await rc(e, t);
}
async function rc(e, t = 5e3) {
Da("server URL", e), Cl("timeout", t);
const n = new URL(e).origin;
if (n === window.location.origin)
return !0;
const o = new AbortController(), r = setTimeout(
() => o.abort(),
t
);
try {
const a = await fetch(n, {
method: "HEAD",
signal: o.signal,
mode: "no-cors",
cache: "no-cache"
});
return clearTimeout(r), a.type === "basic" || a.type === "opaque";
} catch {
return clearTimeout(r), !1;
}
}
async function Nt(e, t = {}) {
Da("resource URL", e), It("option set", t), t = { ...t }, typeof navigator < "u" && !navigator.onLine && de(
"NotConnected: the browser is not connected"
);
const n = Qi("request timeout", t.timeout) ?? 10 * 1e3, o = t.allowRetries === !0, r = Qi("maximum retries", t.maxRetries) ?? 3;
delete t.timeout, delete t.allowRetries, delete t.maxRetries;
const a = t.signal;
function i(c, d) {
const u = c.headers.get("Retry-After");
if (u != null) {
const p = parseInt(u, 10);
if (!isNaN(p))
return Math.max(0, p * 1e3);
const l = Date.parse(u);
if (!isNaN(l))
return Math.max(0, l - Date.now());
}
return Math.min(30 * 1e3, 500 * 2 ** d);
}
let s = 0;
for (; ; ) {
const c = new AbortController();
t.signal = a != null ? AbortSignal.any([c.signal, a]) : c.signal;
let d = !1;
const u = setTimeout(() => {
d = !0, c.abort();
}, n);
let p;
try {
p = await fetch(e, t), clearTimeout(u);
} catch (l) {
clearTimeout(u);
const f = l?.message ?? "";
// timeout by fetch or cancellation by internal timer
(d || f.includes("timeout")) && de("ServerUnreachable: the server is unreachable"), // explicit cancellation
(l?.name === "AbortError" || f.includes("The user aborted a request")) && de(
"RequestAborted: request was aborted"
), (f.includes("Failed to fetch") || f.includes("CORS")) && de("CORSblocked: cross-origin request blocked"), l?.name === "TypeError" && typeof navigator < "u" && !navigator.onLine && de(
"NotConnected: the browser is offline"
), de("ServerUnreachable: the server is unreachable");
}
if (o && s < r && (p.status === 429 || p.status === 503)) {
await new Promise(
(l) => setTimeout(l, i(p, s))
), s++;
continue;
}
switch (!0) {
case p.status === 401:
de("AuthorizationFailure: authorization failed");
case p.status === 403:
de("ForbiddenRequest: request is forbidden");
case p.status === 404:
de("MissingResource: resource not found");
case p.status === 408:
de("RequestTimeout: request timed out");
case p.status === 429:
de("RateLimitExceeded: too many requests");
case p.status === 500:
de("InternalServerError: internal server error");
case p.status === 502:
de("BadGateway: bad gateway");
case p.status === 503:
de("ServiceUnavailable: service is currently not available");
case p.status === 504:
de("GatewayTimeout: gateway timed out");
case p.status >= 400:
de(
"HTTPError: request failed with status " + p.status
);
}
return p;
}
}
async function hh(e, t = {}) {
return await (await Nt(e, t)).text();
}
async function gh(e, t = {}) {
return await (await Nt(e, t)).json();
}
async function mh(e, t = {}) {
return await (await Nt(e, t)).arrayBuffer();
}
async function bh(e, t = {}) {
return await (await Nt(e, t)).blob();
}
async function yh(e, t = {}) {
const o = await (await Nt(e, t)).blob();
let r, a;
const i = new Promise((c, d) => {
r = c, a = d;
}), s = new FileReader();
return s.onloadend = () => r(s.result), s.onerror = a, s.readAsDataURL(o), i;
}
async function xh(e, t = {}) {
const n = await Nt(e, t), o = (n.headers.get("content-type") ?? "").split(";")[0].trim();
switch (!0) {
case o.startsWith("text/html"):
return await _i(await n.text());
case o === "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
return await Ti(await n.arrayBuffer());
case o === "application/pdf":
return await Oi(await n.arrayBuffer());
case o.startsWith("text/markdown"):
return await Li(await n.text());
case o.startsWith("text/"):
case o.includes("javascript"):
case o.includes("typescript"):
case o.includes("json"):
case o.includes("css"):
case o.includes("svg"):
case o.includes("xml"):
return await n.text();
default:
de(`UnsupportedMIMEType: cannot convert content of type "${o}" into plain text`);
}
}
async function vh(e, t = {}) {
const n = await Nt(e, t), o = (n.headers.get("content-type") ?? "").split(";")[0].trim();
switch (!0) {
case o.startsWith("text/html"):
return await n.text();
case o === "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
return await Ri(await n.arrayBuffer());
case o.startsWith("text/markdown"):
return await Mi(await n.text());
default:
de(`UnsupportedMIMEType: cannot convert content of type "${o}" into HTML`);
}
}
async function wh(e, t = {}) {
const n = await Nt(e, t), o = (n.headers.get("content-type") ?? "").split(";")[0].trim();
switch (!0) {
case o.startsWith("text/html"):
return await Di(await n.text());
case o === "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
return await Fi(await n.arrayBuffer());
case o.startsWith("text/markdown"):
return await n.text();
default:
de(`UnsupportedMIMEType: cannot convert content of type "${o}" into Markdown`);
}
}
function ac(e) {
return ja("HTTP status code", e, 100, 599), ic[e] ?? "";
}
const ic = {
/**** 1xx Informational ****/
100: "Continue",
101: "Switching Protocols",
102: "Processing",
103: "Early Hints",
/**** 2xx Success ****/
200: "OK",
201: "Created",
202: "Accepted",
203: "Non-Authoritative Information",
204: "No Content",
205: "Reset Content",
206: "Partial Content",
207: "Multi-Status",
208: "Already Reported",
226: "IM Used",
/**** 3xx Redirection ****/
300: "Multiple Choices",
301: "Moved Permanently",
302: "Found",
303: "See Other",
304: "Not Modified",
305: "Use Proxy",
307: "Temporary Redirect",
308: "Permanent Redirect",
/**** 4xx Client Error ****/
400: "Bad Request",
401: "Unauthorized",
402: "Payment Required",
403: "Forbidden",
404: "Not Found",
405: "Method Not Allowed",
406: "Not Acceptable",
407: "Proxy Authentication Required",
408: "Request Timeout",
409: "Conflict",
410: "Gone",
411: "Length Required",
412: "Precondition Failed",
413: "Payload Too Large",
414: "URI Too Long",
415: "Unsupported Media Type",
416: "Range Not Satisfiable",
417: "Expectation Failed",
418: "I'm a Teapot",
421: "Misdirected Request",
422: "Unprocessable Entity",
423: "Locked",
424: "Failed Dependency",
425: "Too Early",
426: "Upgrade Required",
428: "Precondition Required",
429: "Too Many Requests",
431: "Request Header Fields Too Large",
451: "Unavailable For Legal Reasons",
/**** 5xx Server Error ****/
500: "Internal Server Error",
501: "Not Implemented",
502: "Bad Gateway",
503: "Service Unavailable",
504: "Gateway Timeout",
505: "HTTP Version Not Supported",
506: "Variant Also Negotiates",
507: "Insufficient Storage",
508: "Loop Detected",
510: "Not Extended",
511: "Network Authentication Required"
}, ye = {
/**** Configuration ****/
get Configuration() {
return {
ServerChoice: ye._ServerChoice,
customServer: ye.customServer,
ServerBlacklist: ye.ServerBlacklist,
ServerWhitelist: ye.ServerWhitelist,
ResultBlacklist: ye.ResultBlacklist,
ResultWhitelist: ye.ResultWhitelist
};
},
set Configuration(e) {
It("SearXNG configuration", e);
const {
ServerChoice: t,
customServer: n,
ServerBlacklist: o,
ServerWhitelist: r,
ResultBlacklist: a,
ResultWhitelist: i
} = e;
if (Ft("SearXNG server choice", t, ["custom", "public"]), _a("SearXNG custom Server", n), Ht('SearXNG configuration "ServerBlacklist"', o, at), Ht('SearXNG configuration "ServerWhitelist"', r, at), Ht('SearXNG configuration "ResultBlacklist"', a, at), Ht('SearXNG configuration "ResultWhitelist"', i, at), n != null) {
const { ServerURL: s, Authentication: c, Credentials: d } = n;
Hn("SearXNG custom server url", s), Ft("SearXNG custom server authentication", c, ["none", "basic", "bearer"]), fn("SearXNG custom server credentials", d);
}
ye.ServerChoice = t ?? "public", ye.customServer = n ?? { Authentication: "none" }, ye.ServerBlacklist = o ?? [], ye.ServerWhitelist = r ?? [], ye.ResultBlacklist = a ?? [], ye.ResultWhitelist = i ?? [];
},
/**** preserveConfiguration ****/
preserveConfiguration: function() {
localStorage["SearXNG-Configuration"] = JSON.stringify(ye.Configuration);
},
/**** restoreConfiguration ****/
restoreConfiguration: function() {
if (localStorage["SearXNG-Configuration"] != null)
try {
const e = JSON.parse(localStorage["SearXNG-Configuration"]);
ye.Configuration = e;
} catch (e) {
console.warn('"SearXNG.restoreConfiguration" failed with ' + e);
}
},
/**** hasPreservedConfiguration ****/
get hasPreservedConfiguration() {
return localStorage["SearXNG-Configuration"] != null;
},
set hasPreservedConfiguration(e) {
Yf("SearXNG.hasPreservedConfiguration");
},
/**** customServer[URL/Authentication/Credentials] ****/
_customServer: {
ServerURL: void 0,
Authentication: "none",
Credentials: void 0
},
get customServer() {
return { ...ye._customServer };
},
set customServer(e) {
It("SearXNG custom server setting", e), Hn("SearXNG custom server url", e.ServerURL), Ft("SearXNG custom server authentication", e.Authentication, ["none", "basic", "bearer"]), fn("SearXNG custom server credentials", e.Credentials), ye._customServer = {
ServerURL: e.ServerURL,
Authentication: e.Authentication ?? "none",
Credentials: e.Credentials
};
},
get customServerURL() {
return ye._customServer.ServerURL;
},
set customServerURL(e) {
Hn("SearXNG custom server url", e), ye._customServer.ServerURL = e;
},
get customServerAuthentication() {
return ye._customServer.Authentication;
},
set customServerAuthentication(e) {
Ft("SearXNG custom server authentication", e, ["none", "basic", "bearer"]), ye._customServer.Authentication = e;
},
get customServerCredentials() {
return ye._customServer.Credentials;
},
set customServerCredentials(e) {
fn("SearXNG custom server credentials", e), ye._customServer.Credentials = e;
},
/**** publicServers - fetches the list of registered public SearXNG servers ****/
publicServers: async function(e = {}) {
It("option set", e);
const { ServiceURL: t, Signal: n, ...o } = e;
Hn("SearXNG service URL", t), uh("fetch abort signal", n);
let r;
try {
if (r = await Nt(
t ?? "https://searx.space/data/instances.json",
{
...o,
...n != null ? { signal: n } : {}
}
), r.ok) {
const i = await r.json();
return !Me(i) || !Me(i.instances) ? [] : Object.keys(i.instances).filter(ye.ServerIsAcceptable);
}
} catch (i) {
i.name === "AbortError" ? de("Aborted: SearXNG server scan was aborted") : de("InternalError: SearXNG server scan failed with " + i);
}
const a = Sr(r.status, 100, 599) ? ac(r.status) : "(unknown)";
de(
"InternalError: SearXNG server scan failed with HTTP status " + r.status + " " + a
);
},
/**** ServerBlacklist (for SearXNG servers) ****/
_ServerBlacklist: {},
get ServerBlacklist() {
return Object.keys(ye._ServerBlacklist);
},
set ServerBlacklist(e) {
Ht("SearXNG server blacklist", e, at), ye._ServerBlacklist = {}, (e ?? []).forEach(
(t) => ye._ServerBlacklist[t] = !0
);
},
// note: caller should probably rescan the list of public SearXNG servers
/**** ServerWhitelist (for SearXNG servers) ****/
_ServerWhitelist: {
"http://127.0.0.1:8080": !0,
"http://127.0.0.1:8888": !0,
"http://localhost:8080": !0,
"http://localhost:8888": !0,
"http://[::1]:8080": !0,
"http://[::1]:8888": !0
},
get ServerWhitelist() {
return Array.from(Object.keys(ye._ServerWhitelist));
},
set ServerWhitelist(e) {
Ht("SearXNG server whitelist", e, at), ye._ServerWhitelist = {}, (e ?? []).forEach(
(t) => ye._ServerWhitelist[t] = !0
);
},
// note: caller should probably rescan the list of public SearXNG servers
/**** ServerIsBlacklisted ****/
ServerIsBlacklisted: function(e) {
return at(e) && e in ye._ServerBlacklist;
},
/**** ServerIsWhitelisted ****/
ServerIsWhitelisted: function(e) {
return at(e) && e in ye._ServerWhitelist;
},
/**** ServerIsAcceptable ****/
ServerIsAcceptable: function(e) {
return at(e) && (e.startsWith("https://") || e in ye._ServerWhitelist) && !(e in ye._ServerBlacklist);
},
/**** ServerChoice ****/
_ServerChoice: "public",
get ServerChoice() {
return ye._ServerChoice;
},
set ServerChoice(e) {
_n("SearXNG server choice setting", e, ["public", "custom"]), ye._ServerChoice = e;
},
/**** nextServer ****/
_publicServers: [],
nextServer: async function() {
if (ye._ServerChoice === "custom")
return ye._customServer.ServerURL == null && de(
"MissingCustomServer: custom SearXNG server is missing"
), ye.customServer;
{
let e = ye._publicServers;
if (e.length === 0 && (e = ye._publicServers = await ye.publicServers()), e.length === 0)
de(
"MissingPublicServer: could not find any public SearXNG server"
);
else {
const t = Math.floor(Math.random() * e.length);
return {
ServerURL: e.splice(t, 1)[0],
Authentication: "none",
Credentials: void 0
};
}
}
},
/**** query - uses SearXNG to perform a given query ****/
query: async function(e, t = {}) {
ln("search phrase", e), It("search options", t);
const {
ServerURL: n,
ServerAuthentication: o,
ServerCredentials: r,
language: a,
categories: i,
num_results: s
} = t;
Hn("SearXNG server URL", n), Ft("SearXNG server authentication", o, ["none", "basic", "bearer"]), fn("SearXNG server credentials", r), nh("SearXNG query language", a), Ft("SearXNG query categories", i, ["general"]), Dr("SearXNG query result limit", s);
const c = n == null ? await ye.nextServer() : {
ServerURL: n,
Authentication: o ?? "none",
Credentials: r
};
c.ServerURL == null && de(
"MissingSearXNGServer: no SearXNG server given"
), c.Authentication !== "none" && c.Credentials == null && de(
"MissingCredentials: no SearXNG server credentials given"
);
const d = {};
if (c.Authentication !== "none") {
const p = new Headers();
p.set("Authorization", `${nv(c.Authentication)} ${c.Credentials}`), d.headers = p;
}
e = e.trim(), e === "" && de(
"EmptyArgument: the given search phrase is empty"
);
const u = new URLSearchParams({
q: e,
language: a ?? "en",
format: "html",
categories: i ?? "general",
num_results: "" + (s ?? 20)
});
try {
const l = await (await Nt(
`${c.ServerURL}/search?${u}`,
d
)).text();
return Array.from(l.matchAll(/