altcha
Version:
Privacy-first CAPTCHA widget, compliant with global regulations (GDPR/HIPAA/CCPA/LGDP/DPDPA/PIPL) and WCAG accessible. No tracking, self-verifying.
1,911 lines • 99.9 kB
JavaScript
const Yn = `(function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,l=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=l;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const l="AES-GCM",o=new AbortController,a=Date.now(),s=async()=>{for(let i=n;i<=r;i+=1){if(o.signal.aborted||!c||!u)return null;try{const f=await crypto.subtle.decrypt({name:l,iv:g(i)},c,u);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,u=null;try{u=h(e);const i=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",i,l,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:s(),controller:o}}let y;onmessage=async e=>{const{type:t,payload:r,start:n,max:l}=e.data;let o=null;if(t==="abort")y?.abort(),y=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:s}=r||{};o=await m(s,a,l,n)}else{const{algorithm:a,challenge:s,salt:c}=r||{};o=w(s,c,a,l,n)}y=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
`, Dn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Yn], { type: "text/javascript;charset=utf-8" });
function Ni(e) {
let t;
try {
if (t = Dn && (self.URL || self.webkitURL).createObjectURL(Dn), !t) throw "";
const r = new Worker(t, {
name: e?.name
});
return r.addEventListener("error", () => {
(self.URL || self.webkitURL).revokeObjectURL(t);
}), r;
} catch {
return new Worker(
"data:text/javascript;charset=utf-8," + encodeURIComponent(Yn),
{
name: e?.name
}
);
}
}
const Li = "5";
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(Li);
const Pi = 1, Oi = 4, Fi = 8, Mi = 16, Vi = 1, Ui = 2, Mr = "[", Zn = "[!", zn = "]", bt = {}, ae = Symbol(), ji = "http://www.w3.org/1999/xhtml", Nn = !1;
function Jn(e) {
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
}
var Kn = Array.isArray, qi = Array.prototype.indexOf, Bi = Array.from, or = Object.keys, Mt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, Hi = Object.getOwnPropertyDescriptors, Gi = Object.prototype, Wi = Array.prototype, Xn = Object.getPrototypeOf, Ln = Object.isExtensible;
const yt = () => {
};
function Qn(e) {
for (var t = 0; t < e.length; t++)
e[t]();
}
function Yi(e, t, r = !1) {
return e === void 0 ? r ? (
/** @type {() => V} */
t()
) : (
/** @type {V} */
t
) : e;
}
const me = 2, eo = 4, fr = 8, Vr = 16, De = 32, it = 64, ir = 128, fe = 256, ar = 512, le = 1024, Ie = 2048, at = 4096, wt = 8192, dr = 16384, Zi = 32768, Ur = 65536, zi = 1 << 19, to = 1 << 20, Sr = 1 << 21, Ot = Symbol("$state"), ro = Symbol("legacy props"), Ji = Symbol("");
function Ki(e) {
throw new Error("https://svelte.dev/e/effect_in_teardown");
}
function Xi() {
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
}
function Qi(e) {
throw new Error("https://svelte.dev/e/effect_orphan");
}
function ea() {
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
}
function ta() {
throw new Error("https://svelte.dev/e/hydration_failed");
}
function ra(e) {
throw new Error("https://svelte.dev/e/props_invalid_value");
}
function na() {
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
}
function oa() {
throw new Error("https://svelte.dev/e/state_prototype_fixed");
}
function ia() {
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
}
function hr(e) {
console.warn("https://svelte.dev/e/hydration_mismatch");
}
let O = !1;
function _t(e) {
O = e;
}
let P;
function Ue(e) {
if (e === null)
throw hr(), bt;
return P = e;
}
function Et() {
return Ue(
/** @type {TemplateNode} */
/* @__PURE__ */ Be(P)
);
}
function Z(e) {
if (O) {
if (/* @__PURE__ */ Be(P) !== null)
throw hr(), bt;
P = e;
}
}
function aa() {
for (var e = 0, t = P; ; ) {
if (t.nodeType === 8) {
var r = (
/** @type {Comment} */
t.data
);
if (r === zn) {
if (e === 0) return t;
e -= 1;
} else (r === Mr || r === Zn) && (e += 1);
}
var o = (
/** @type {TemplateNode} */
/* @__PURE__ */ Be(t)
);
t.remove(), t = o;
}
}
let la = !1;
function Me(e) {
if (typeof e != "object" || e === null || Ot in e)
return e;
const t = Xn(e);
if (t !== Gi && t !== Wi)
return e;
var r = /* @__PURE__ */ new Map(), o = Kn(e), l = /* @__PURE__ */ N(0), a = $, s = (c) => {
var f = $;
Re(a);
var d = c();
return Re(f), d;
};
return o && r.set("length", /* @__PURE__ */ N(
/** @type {any[]} */
e.length
)), new Proxy(
/** @type {any} */
e,
{
defineProperty(c, f, d) {
(!("value" in d) || d.configurable === !1 || d.enumerable === !1 || d.writable === !1) && na();
var m = r.get(f);
return m === void 0 ? (m = s(() => /* @__PURE__ */ N(d.value)), r.set(f, m)) : b(
m,
s(() => Me(d.value))
), !0;
},
deleteProperty(c, f) {
var d = r.get(f);
if (d === void 0)
f in c && (r.set(
f,
s(() => /* @__PURE__ */ N(ae))
), Ir(l));
else {
if (o && typeof f == "string") {
var m = (
/** @type {Source<number>} */
r.get("length")
), v = Number(f);
Number.isInteger(v) && v < m.v && b(m, v);
}
b(d, ae), Ir(l);
}
return !0;
},
get(c, f, d) {
if (f === Ot)
return e;
var m = r.get(f), v = f in c;
if (m === void 0 && (!v || rt(c, f)?.writable) && (m = s(() => /* @__PURE__ */ N(Me(v ? c[f] : ae))), r.set(f, m)), m !== void 0) {
var _ = i(m);
return _ === ae ? void 0 : _;
}
return Reflect.get(c, f, d);
},
getOwnPropertyDescriptor(c, f) {
var d = Reflect.getOwnPropertyDescriptor(c, f);
if (d && "value" in d) {
var m = r.get(f);
m && (d.value = i(m));
} else if (d === void 0) {
var v = r.get(f), _ = v?.v;
if (v !== void 0 && _ !== ae)
return {
enumerable: !0,
configurable: !0,
value: _,
writable: !0
};
}
return d;
},
has(c, f) {
if (f === Ot)
return !0;
var d = r.get(f), m = d !== void 0 && d.v !== ae || Reflect.has(c, f);
if (d !== void 0 || S !== null && (!m || rt(c, f)?.writable)) {
d === void 0 && (d = s(() => /* @__PURE__ */ N(m ? Me(c[f]) : ae)), r.set(f, d));
var v = i(d);
if (v === ae)
return !1;
}
return m;
},
set(c, f, d, m) {
var v = r.get(f), _ = f in c;
if (o && f === "length")
for (var w = d; w < /** @type {Source<number>} */
v.v; w += 1) {
var F = r.get(w + "");
F !== void 0 ? b(F, ae) : w in c && (F = s(() => /* @__PURE__ */ N(ae)), r.set(w + "", F));
}
v === void 0 ? (!_ || rt(c, f)?.writable) && (v = s(() => /* @__PURE__ */ N(void 0)), b(
v,
s(() => Me(d))
), r.set(f, v)) : (_ = v.v !== ae, b(
v,
s(() => Me(d))
));
var M = Reflect.getOwnPropertyDescriptor(c, f);
if (M?.set && M.set.call(m, d), !_) {
if (o && typeof f == "string") {
var U = (
/** @type {Source<number>} */
r.get("length")
), I = Number(f);
Number.isInteger(I) && I >= U.v && b(U, I + 1);
}
Ir(l);
}
return !0;
},
ownKeys(c) {
i(l);
var f = Reflect.ownKeys(c).filter((v) => {
var _ = r.get(v);
return _ === void 0 || _.v !== ae;
});
for (var [d, m] of r)
m.v !== ae && !(d in c) && f.push(d);
return f;
},
setPrototypeOf() {
oa();
}
}
);
}
function Ir(e, t = 1) {
b(e, e.v + t);
}
var Pn, no, oo, io;
function Tr() {
if (Pn === void 0) {
Pn = window, no = /Firefox/.test(navigator.userAgent);
var e = Element.prototype, t = Node.prototype, r = Text.prototype;
oo = rt(t, "firstChild").get, io = rt(t, "nextSibling").get, Ln(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Ln(r) && (r.__t = void 0);
}
}
function vr(e = "") {
return document.createTextNode(e);
}
// @__NO_SIDE_EFFECTS__
function ve(e) {
return oo.call(e);
}
// @__NO_SIDE_EFFECTS__
function Be(e) {
return io.call(e);
}
function z(e, t) {
if (!O)
return /* @__PURE__ */ ve(e);
var r = (
/** @type {TemplateNode} */
/* @__PURE__ */ ve(P)
);
return r === null && (r = P.appendChild(vr())), Ue(r), r;
}
function Nt(e, t) {
if (!O) {
var r = (
/** @type {DocumentFragment} */
/* @__PURE__ */ ve(
/** @type {Node} */
e
)
);
return r instanceof Comment && r.data === "" ? /* @__PURE__ */ Be(r) : r;
}
return P;
}
function J(e, t = 1, r = !1) {
let o = O ? P : e;
for (var l; t--; )
l = o, o = /** @type {TemplateNode} */
/* @__PURE__ */ Be(o);
if (!O)
return o;
var a = o?.nodeType;
if (r && a !== 3) {
var s = vr();
return o === null ? l?.after(s) : o.before(s), Ue(s), s;
}
return Ue(o), /** @type {TemplateNode} */
o;
}
function sa(e) {
e.textContent = "";
}
function ao(e) {
return e === this.v;
}
function lo(e, t) {
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
}
function jr(e) {
return !lo(e, this.v);
}
// @__NO_SIDE_EFFECTS__
function gr(e) {
var t = me | Ie, r = $ !== null && ($.f & me) !== 0 ? (
/** @type {Derived} */
$
) : null;
return S === null || r !== null && (r.f & fe) !== 0 ? t |= fe : S.f |= to, {
ctx: ne,
deps: null,
effects: null,
equals: ao,
f: t,
fn: e,
reactions: null,
rv: 0,
v: (
/** @type {V} */
null
),
wv: 0,
parent: r ?? S
};
}
// @__NO_SIDE_EFFECTS__
function Lt(e) {
const t = /* @__PURE__ */ gr(e);
return wo(t), t;
}
// @__NO_SIDE_EFFECTS__
function ua(e) {
const t = /* @__PURE__ */ gr(e);
return t.equals = jr, t;
}
function so(e) {
var t = e.effects;
if (t !== null) {
e.effects = null;
for (var r = 0; r < t.length; r += 1)
je(
/** @type {Effect} */
t[r]
);
}
}
function ca(e) {
for (var t = e.parent; t !== null; ) {
if ((t.f & me) === 0)
return (
/** @type {Effect} */
t
);
t = t.parent;
}
return null;
}
function uo(e) {
var t, r = S;
qe(ca(e));
try {
so(e), t = ko(e);
} finally {
qe(r);
}
return t;
}
function co(e) {
var t = uo(e), r = (Ve || (e.f & fe) !== 0) && e.deps !== null ? at : le;
_e(e, r), e.equals(t) || (e.v = t, e.wv = xo());
}
function fa(e) {
S === null && $ === null && Qi(), $ !== null && ($.f & fe) !== 0 && S === null && Xi(), qt && Ki();
}
function da(e, t) {
var r = t.last;
r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
}
function lt(e, t, r, o = !0) {
var l = S, a = {
ctx: ne,
deps: null,
nodes_start: null,
nodes_end: null,
f: e | Ie,
first: null,
fn: t,
last: null,
next: null,
parent: l,
prev: null,
teardown: null,
transitions: null,
wv: 0
};
if (r)
try {
Wr(a), a.f |= Zi;
} catch (f) {
throw je(a), f;
}
else t !== null && mr(a);
var s = r && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (to | ir)) === 0;
if (!s && o && (l !== null && da(a, l), $ !== null && ($.f & me) !== 0)) {
var c = (
/** @type {Derived} */
$
);
(c.effects ??= []).push(a);
}
return a;
}
function qr(e) {
const t = lt(fr, null, !1);
return _e(t, le), t.teardown = e, t;
}
function Dr(e) {
fa();
var t = S !== null && (S.f & De) !== 0 && ne !== null && !ne.m;
if (t) {
var r = (
/** @type {ComponentContext} */
ne
);
(r.e ??= []).push({
fn: e,
effect: S,
reaction: $
});
} else {
var o = Br(e);
return o;
}
}
function ha(e) {
const t = lt(it, e, !0);
return () => {
je(t);
};
}
function va(e) {
const t = lt(it, e, !0);
return (r = {}) => new Promise((o) => {
r.outro ? Lr(t, () => {
je(t), o(void 0);
}) : (je(t), o(void 0));
});
}
function Br(e) {
return lt(eo, e, !1);
}
function Hr(e) {
return lt(fr, e, !0);
}
function Ce(e, t = [], r = gr) {
const o = t.map(r);
return fo(() => e(...o.map(i)));
}
function fo(e, t = 0) {
return lt(fr | Vr | t, e, !0);
}
function Nr(e, t = !0) {
return lt(fr | De, e, !0, t);
}
function ho(e) {
var t = e.teardown;
if (t !== null) {
const r = qt, o = $;
Fn(!0), Re(null);
try {
t.call(null);
} finally {
Fn(r), Re(o);
}
}
}
function vo(e, t = !1) {
var r = e.first;
for (e.first = e.last = null; r !== null; ) {
var o = r.next;
(r.f & it) !== 0 ? r.parent = null : je(r, t), r = o;
}
}
function ga(e) {
for (var t = e.first; t !== null; ) {
var r = t.next;
(t.f & De) === 0 && je(t), t = r;
}
}
function je(e, t = !0) {
var r = !1;
(t || (e.f & zi) !== 0) && e.nodes_start !== null && (go(
e.nodes_start,
/** @type {TemplateNode} */
e.nodes_end
), r = !0), vo(e, t && !r), cr(e, 0), _e(e, dr);
var o = e.transitions;
if (o !== null)
for (const a of o)
a.stop();
ho(e);
var l = e.parent;
l !== null && l.first !== null && po(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = null;
}
function go(e, t) {
for (; e !== null; ) {
var r = e === t ? null : (
/** @type {TemplateNode} */
/* @__PURE__ */ Be(e)
);
e.remove(), e = r;
}
}
function po(e) {
var t = e.parent, r = e.prev, o = e.next;
r !== null && (r.next = o), o !== null && (o.prev = r), t !== null && (t.first === e && (t.first = o), t.last === e && (t.last = r));
}
function Lr(e, t) {
var r = [];
mo(e, r, !0), pa(r, () => {
je(e), t && t();
});
}
function pa(e, t) {
var r = e.length;
if (r > 0) {
var o = () => --r || t();
for (var l of e)
l.out(o);
} else
t();
}
function mo(e, t, r) {
if ((e.f & wt) === 0) {
if (e.f ^= wt, e.transitions !== null)
for (const s of e.transitions)
(s.is_global || r) && t.push(s);
for (var o = e.first; o !== null; ) {
var l = o.next, a = (o.f & Ur) !== 0 || (o.f & De) !== 0;
mo(o, t, a ? r : !1), o = l;
}
}
}
function On(e) {
_o(e, !0);
}
function _o(e, t) {
if ((e.f & wt) !== 0) {
e.f ^= wt, (e.f & le) === 0 && (e.f ^= le), Bt(e) && (_e(e, Ie), mr(e));
for (var r = e.first; r !== null; ) {
var o = r.next, l = (r.f & Ur) !== 0 || (r.f & De) !== 0;
_o(r, l ? t : !1), r = o;
}
if (e.transitions !== null)
for (const a of e.transitions)
(a.is_global || t) && a.in();
}
}
const ma = typeof requestIdleCallback > "u" ? (e) => setTimeout(e, 1) : requestIdleCallback;
let Vt = [], Ut = [];
function bo() {
var e = Vt;
Vt = [], Qn(e);
}
function yo() {
var e = Ut;
Ut = [], Qn(e);
}
function Gr(e) {
Vt.length === 0 && queueMicrotask(bo), Vt.push(e);
}
function _a(e) {
Ut.length === 0 && ma(yo), Ut.push(e);
}
function ba() {
Vt.length > 0 && bo(), Ut.length > 0 && yo();
}
let tr = !1, lr = !1, sr = null, nt = !1, qt = !1;
function Fn(e) {
qt = e;
}
let Ft = [];
let $ = null, ke = !1;
function Re(e) {
$ = e;
}
let S = null;
function qe(e) {
S = e;
}
let Te = null;
function wo(e) {
$ !== null && $.f & Sr && (Te === null ? Te = [e] : Te.push(e));
}
let re = null, ce = 0, he = null;
function ya(e) {
he = e;
}
let Eo = 1, ur = 0, Ve = !1;
function xo() {
return ++Eo;
}
function Bt(e) {
var t = e.f;
if ((t & Ie) !== 0)
return !0;
if ((t & at) !== 0) {
var r = e.deps, o = (t & fe) !== 0;
if (r !== null) {
var l, a, s = (t & ar) !== 0, c = o && S !== null && !Ve, f = r.length;
if (s || c) {
var d = (
/** @type {Derived} */
e
), m = d.parent;
for (l = 0; l < f; l++)
a = r[l], (s || !a?.reactions?.includes(d)) && (a.reactions ??= []).push(d);
s && (d.f ^= ar), c && m !== null && (m.f & fe) === 0 && (d.f ^= fe);
}
for (l = 0; l < f; l++)
if (a = r[l], Bt(
/** @type {Derived} */
a
) && co(
/** @type {Derived} */
a
), a.wv > e.wv)
return !0;
}
(!o || S !== null && !Ve) && _e(e, le);
}
return !1;
}
function wa(e, t) {
for (var r = t; r !== null; ) {
if ((r.f & ir) !== 0)
try {
r.fn(e);
return;
} catch {
r.f ^= ir;
}
r = r.parent;
}
throw tr = !1, e;
}
function Mn(e) {
return (e.f & dr) === 0 && (e.parent === null || (e.parent.f & ir) === 0);
}
function pr(e, t, r, o) {
if (tr) {
if (r === null && (tr = !1), Mn(t))
throw e;
return;
}
if (r !== null && (tr = !0), wa(e, t), Mn(t))
throw e;
}
function Co(e, t, r = !0) {
var o = e.reactions;
if (o !== null)
for (var l = 0; l < o.length; l++) {
var a = o[l];
Te?.includes(e) || ((a.f & me) !== 0 ? Co(
/** @type {Derived} */
a,
t,
!1
) : t === a && (r ? _e(a, Ie) : (a.f & le) !== 0 && _e(a, at), mr(
/** @type {Effect} */
a
)));
}
}
function ko(e) {
var t = re, r = ce, o = he, l = $, a = Ve, s = Te, c = ne, f = ke, d = e.f;
re = /** @type {null | Value[]} */
null, ce = 0, he = null, Ve = (d & fe) !== 0 && (ke || !nt || $ === null), $ = (d & (De | it)) === 0 ? e : null, Te = null, Vn(e.ctx), ke = !1, ur++, e.f |= Sr;
try {
var m = (
/** @type {Function} */
(0, e.fn)()
), v = e.deps;
if (re !== null) {
var _;
if (cr(e, ce), v !== null && ce > 0)
for (v.length = ce + re.length, _ = 0; _ < re.length; _++)
v[ce + _] = re[_];
else
e.deps = v = re;
if (!Ve)
for (_ = ce; _ < v.length; _++)
(v[_].reactions ??= []).push(e);
} else v !== null && ce < v.length && (cr(e, ce), v.length = ce);
if (To() && he !== null && !ke && v !== null && (e.f & (me | at | Ie)) === 0)
for (_ = 0; _ < /** @type {Source[]} */
he.length; _++)
Co(
he[_],
/** @type {Effect} */
e
);
return l !== null && l !== e && (ur++, he !== null && (o === null ? o = he : o.push(.../** @type {Source[]} */
he))), m;
} finally {
re = t, ce = r, he = o, $ = l, Ve = a, Te = s, Vn(c), ke = f, e.f ^= Sr;
}
}
function Ea(e, t) {
let r = t.reactions;
if (r !== null) {
var o = qi.call(r, e);
if (o !== -1) {
var l = r.length - 1;
l === 0 ? r = t.reactions = null : (r[o] = r[l], r.pop());
}
}
r === null && (t.f & me) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
(re === null || !re.includes(t)) && (_e(t, at), (t.f & (fe | ar)) === 0 && (t.f ^= ar), so(
/** @type {Derived} **/
t
), cr(
/** @type {Derived} **/
t,
0
));
}
function cr(e, t) {
var r = e.deps;
if (r !== null)
for (var o = t; o < r.length; o++)
Ea(e, r[o]);
}
function Wr(e) {
var t = e.f;
if ((t & dr) === 0) {
_e(e, le);
var r = S, o = ne, l = nt;
S = e, nt = !0;
try {
(t & Vr) !== 0 ? ga(e) : vo(e), ho(e);
var a = ko(e);
e.teardown = typeof a == "function" ? a : null, e.wv = Eo;
var s = e.deps, c;
Nn && la && e.f & Ie;
} catch (f) {
pr(f, e, r, o || e.ctx);
} finally {
nt = l, S = r;
}
}
}
function xa() {
try {
ea();
} catch (e) {
if (sr !== null)
pr(e, sr, null);
else
throw e;
}
}
function Ao() {
var e = nt;
try {
var t = 0;
for (nt = !0; Ft.length > 0; ) {
t++ > 1e3 && xa();
var r = Ft, o = r.length;
Ft = [];
for (var l = 0; l < o; l++) {
var a = ka(r[l]);
Ca(a);
}
jt.clear();
}
} finally {
lr = !1, nt = e, sr = null;
}
}
function Ca(e) {
var t = e.length;
if (t !== 0)
for (var r = 0; r < t; r++) {
var o = e[r];
if ((o.f & (dr | wt)) === 0)
try {
Bt(o) && (Wr(o), o.deps === null && o.first === null && o.nodes_start === null && (o.teardown === null ? po(o) : o.fn = null));
} catch (l) {
pr(l, o, null, o.ctx);
}
}
}
function mr(e) {
lr || (lr = !0, queueMicrotask(Ao));
for (var t = sr = e; t.parent !== null; ) {
t = t.parent;
var r = t.f;
if ((r & (it | De)) !== 0) {
if ((r & le) === 0) return;
t.f ^= le;
}
}
Ft.push(t);
}
function ka(e) {
for (var t = [], r = e; r !== null; ) {
var o = r.f, l = (o & (De | it)) !== 0, a = l && (o & le) !== 0;
if (!a && (o & wt) === 0) {
if ((o & eo) !== 0)
t.push(r);
else if (l)
r.f ^= le;
else
try {
Bt(r) && Wr(r);
} catch (f) {
pr(f, r, null, r.ctx);
}
var s = r.first;
if (s !== null) {
r = s;
continue;
}
}
var c = r.parent;
for (r = r.next; r === null && c !== null; )
r = c.next, c = c.parent;
}
return t;
}
function E(e) {
for (var t; ; ) {
if (ba(), Ft.length === 0)
return (
/** @type {T} */
t
);
lr = !0, Ao();
}
}
async function Rr() {
await Promise.resolve(), E();
}
function i(e) {
var t = e.f, r = (t & me) !== 0;
if ($ !== null && !ke) {
if (!Te?.includes(e)) {
var o = $.deps;
e.rv < ur && (e.rv = ur, re === null && o !== null && o[ce] === e ? ce++ : re === null ? re = [e] : (!Ve || !re.includes(e)) && re.push(e));
}
} else if (r && /** @type {Derived} */
e.deps === null && /** @type {Derived} */
e.effects === null) {
var l = (
/** @type {Derived} */
e
), a = l.parent;
a !== null && (a.f & fe) === 0 && (l.f ^= fe);
}
return r && (l = /** @type {Derived} */
e, Bt(l) && co(l)), qt && jt.has(e) ? jt.get(e) : e.v;
}
function ot(e) {
var t = ke;
try {
return ke = !0, e();
} finally {
ke = t;
}
}
const Aa = -7169;
function _e(e, t) {
e.f = e.f & Aa | t;
}
const jt = /* @__PURE__ */ new Map();
function Io(e, t) {
var r = {
f: 0,
// TODO ideally we could skip this altogether, but it causes type errors
v: e,
reactions: null,
equals: ao,
rv: 0,
wv: 0
};
return r;
}
// @__NO_SIDE_EFFECTS__
function N(e, t) {
const r = Io(e);
return wo(r), r;
}
// @__NO_SIDE_EFFECTS__
function Yr(e, t = !1) {
const r = Io(e);
return t || (r.equals = jr), r;
}
function b(e, t, r = !1) {
$ !== null && !ke && To() && ($.f & (me | Vr)) !== 0 && !Te?.includes(e) && ia();
let o = r ? Me(t) : t;
return Ia(e, o);
}
function Ia(e, t) {
if (!e.equals(t)) {
var r = e.v;
qt ? jt.set(e, t) : jt.set(e, r), e.v = t, (e.f & me) !== 0 && ((e.f & Ie) !== 0 && uo(
/** @type {Derived} */
e
), _e(e, (e.f & fe) === 0 ? le : at)), e.wv = xo(), Ro(e, Ie), S !== null && (S.f & le) !== 0 && (S.f & (De | it)) === 0 && (he === null ? ya([e]) : he.push(e));
}
return t;
}
function Ro(e, t) {
var r = e.reactions;
if (r !== null)
for (var o = r.length, l = 0; l < o; l++) {
var a = r[l], s = a.f;
(s & Ie) === 0 && (_e(a, t), (s & (le | fe)) !== 0 && ((s & me) !== 0 ? Ro(
/** @type {Derived} */
a,
at
) : mr(
/** @type {Effect} */
a
)));
}
}
let ne = null;
function Vn(e) {
ne = e;
}
function $o(e, t = !1, r) {
var o = ne = {
p: ne,
c: null,
d: !1,
e: null,
m: !1,
s: e,
x: null,
l: null
};
qr(() => {
o.d = !0;
});
}
function So(e) {
const t = ne;
if (t !== null) {
e !== void 0 && (t.x = e);
const s = t.e;
if (s !== null) {
var r = S, o = $;
t.e = null;
try {
for (var l = 0; l < s.length; l++) {
var a = s[l];
qe(a.effect), Re(a.reaction), Br(a.fn);
}
} finally {
qe(r), Re(o);
}
}
ne = t.p, t.m = !0;
}
return e || /** @type {T} */
{};
}
function To() {
return !0;
}
const Ra = ["touchstart", "touchmove"];
function $a(e) {
return Ra.includes(e);
}
function Sa(e, t) {
if (t) {
const r = document.body;
e.autofocus = !0, Gr(() => {
document.activeElement === r && e.focus();
});
}
}
let Un = !1;
function Do() {
Un || (Un = !0, document.addEventListener(
"reset",
(e) => {
Promise.resolve().then(() => {
if (!e.defaultPrevented)
for (
const t of
/**@type {HTMLFormElement} */
e.target.elements
)
t.__on_r?.();
});
},
// In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)
{ capture: !0 }
));
}
function No(e) {
var t = $, r = S;
Re(null), qe(null);
try {
return e();
} finally {
Re(t), qe(r);
}
}
function Ta(e, t, r, o = r) {
e.addEventListener(t, () => No(r));
const l = e.__on_r;
l ? e.__on_r = () => {
l(), o(!0);
} : e.__on_r = () => o(!0), Do();
}
const Lo = /* @__PURE__ */ new Set(), Pr = /* @__PURE__ */ new Set();
function Da(e, t, r, o = {}) {
function l(a) {
if (o.capture || Pt.call(t, a), !a.cancelBubble)
return No(() => r?.call(this, a));
}
return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Gr(() => {
t.addEventListener(e, l, o);
}) : t.addEventListener(e, l, o), l;
}
function Fe(e, t, r, o, l) {
var a = { capture: o, passive: l }, s = Da(e, t, r, a);
(t === document.body || t === window || t === document) && qr(() => {
t.removeEventListener(e, s, a);
});
}
function Na(e) {
for (var t = 0; t < e.length; t++)
Lo.add(e[t]);
for (var r of Pr)
r(e);
}
function Pt(e) {
var t = this, r = (
/** @type {Node} */
t.ownerDocument
), o = e.type, l = e.composedPath?.() || [], a = (
/** @type {null | Element} */
l[0] || e.target
), s = 0, c = e.__root;
if (c) {
var f = l.indexOf(c);
if (f !== -1 && (t === document || t === /** @type {any} */
window)) {
e.__root = t;
return;
}
var d = l.indexOf(t);
if (d === -1)
return;
f <= d && (s = f);
}
if (a = /** @type {Element} */
l[s] || e.target, a !== t) {
Mt(e, "currentTarget", {
configurable: !0,
get() {
return a || r;
}
});
var m = $, v = S;
Re(null), qe(null);
try {
for (var _, w = []; a !== null; ) {
var F = a.assignedSlot || a.parentNode || /** @type {any} */
a.host || null;
try {
var M = a["__" + o];
if (M != null && (!/** @type {any} */
a.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
// -> the target could not have been disabled because it emits the event in the first place
e.target === a))
if (Kn(M)) {
var [U, ...I] = M;
U.apply(a, [e, ...I]);
} else
M.call(a, e);
} catch (ee) {
_ ? w.push(ee) : _ = ee;
}
if (e.cancelBubble || F === t || F === null)
break;
a = F;
}
if (_) {
for (let ee of w)
queueMicrotask(() => {
throw ee;
});
throw _;
}
} finally {
e.__root = t, delete e.currentTarget, Re(m), qe(v);
}
}
}
function Zr(e) {
var t = document.createElement("template");
return t.innerHTML = e, t.content;
}
function Ae(e, t) {
var r = (
/** @type {Effect} */
S
);
r.nodes_start === null && (r.nodes_start = e, r.nodes_end = t);
}
// @__NO_SIDE_EFFECTS__
function be(e, t) {
var r = (t & Vi) !== 0, o = (t & Ui) !== 0, l, a = !e.startsWith("<!>");
return () => {
if (O)
return Ae(P, null), P;
l === void 0 && (l = Zr(a ? e : "<!>" + e), r || (l = /** @type {Node} */
/* @__PURE__ */ ve(l)));
var s = (
/** @type {TemplateNode} */
o || no ? document.importNode(l, !0) : l.cloneNode(!0)
);
if (r) {
var c = (
/** @type {TemplateNode} */
/* @__PURE__ */ ve(s)
), f = (
/** @type {TemplateNode} */
s.lastChild
);
Ae(c, f);
} else
Ae(s, s);
return s;
};
}
// @__NO_SIDE_EFFECTS__
function _r(e, t, r = "svg") {
var o = !e.startsWith("<!>"), l = `<${r}>${o ? e : "<!>" + e}</${r}>`, a;
return () => {
if (O)
return Ae(P, null), P;
if (!a) {
var s = (
/** @type {DocumentFragment} */
Zr(l)
), c = (
/** @type {Element} */
/* @__PURE__ */ ve(s)
);
a = /** @type {Element} */
/* @__PURE__ */ ve(c);
}
var f = (
/** @type {TemplateNode} */
a.cloneNode(!0)
);
return Ae(f, f), f;
};
}
function Xt() {
if (O)
return Ae(P, null), P;
var e = document.createDocumentFragment(), t = document.createComment(""), r = vr();
return e.append(t, r), Ae(t, r), e;
}
function B(e, t) {
if (O) {
S.nodes_end = P, Et();
return;
}
e !== null && e.before(
/** @type {Node} */
t
);
}
function La(e, t) {
var r = t == null ? "" : typeof t == "object" ? t + "" : t;
r !== (e.__t ??= e.nodeValue) && (e.__t = r, e.nodeValue = r + "");
}
function Po(e, t) {
return Oo(e, t);
}
function Pa(e, t) {
Tr(), t.intro = t.intro ?? !1;
const r = t.target, o = O, l = P;
try {
for (var a = (
/** @type {TemplateNode} */
/* @__PURE__ */ ve(r)
); a && (a.nodeType !== 8 || /** @type {Comment} */
a.data !== Mr); )
a = /** @type {TemplateNode} */
/* @__PURE__ */ Be(a);
if (!a)
throw bt;
_t(!0), Ue(
/** @type {Comment} */
a
), Et();
const s = Oo(e, { ...t, anchor: a });
if (P === null || P.nodeType !== 8 || /** @type {Comment} */
P.data !== zn)
throw hr(), bt;
return _t(!1), /** @type {Exports} */
s;
} catch (s) {
if (s === bt)
return t.recover === !1 && ta(), Tr(), sa(r), _t(!1), Po(e, t);
throw s;
} finally {
_t(o), Ue(l);
}
}
const pt = /* @__PURE__ */ new Map();
function Oo(e, { target: t, anchor: r, props: o = {}, events: l, context: a, intro: s = !0 }) {
Tr();
var c = /* @__PURE__ */ new Set(), f = (v) => {
for (var _ = 0; _ < v.length; _++) {
var w = v[_];
if (!c.has(w)) {
c.add(w);
var F = $a(w);
t.addEventListener(w, Pt, { passive: F });
var M = pt.get(w);
M === void 0 ? (document.addEventListener(w, Pt, { passive: F }), pt.set(w, 1)) : pt.set(w, M + 1);
}
}
};
f(Bi(Lo)), Pr.add(f);
var d = void 0, m = va(() => {
var v = r ?? t.appendChild(vr());
return Nr(() => {
if (a) {
$o({});
var _ = (
/** @type {ComponentContext} */
ne
);
_.c = a;
}
l && (o.$$events = l), O && Ae(
/** @type {TemplateNode} */
v,
null
), d = e(v, o) || {}, O && (S.nodes_end = P), a && So();
}), () => {
for (var _ of c) {
t.removeEventListener(_, Pt);
var w = (
/** @type {number} */
pt.get(_)
);
--w === 0 ? (document.removeEventListener(_, Pt), pt.delete(_)) : pt.set(_, w);
}
Pr.delete(f), v !== r && v.parentNode?.removeChild(v);
};
});
return Or.set(d, m), d;
}
let Or = /* @__PURE__ */ new WeakMap();
function Oa(e, t) {
const r = Or.get(e);
return r ? (Or.delete(e), r(t)) : Promise.resolve();
}
function K(e, t, [r, o] = [0, 0]) {
O && r === 0 && Et();
var l = e, a = null, s = null, c = ae, f = r > 0 ? Ur : 0, d = !1;
const m = (_, w = !0) => {
d = !0, v(w, _);
}, v = (_, w) => {
if (c === (c = _)) return;
let F = !1;
if (O && o !== -1) {
if (r === 0) {
const U = (
/** @type {Comment} */
l.data
);
U === Mr ? o = 0 : U === Zn ? o = 1 / 0 : (o = parseInt(U.substring(1)), o !== o && (o = c ? 1 / 0 : -1));
}
const M = o > r;
!!c === M && (l = aa(), Ue(l), _t(!1), F = !0, o = -1);
}
c ? (a ? On(a) : w && (a = Nr(() => w(l))), s && Lr(s, () => {
s = null;
})) : (s ? On(s) : w && (s = Nr(() => w(l, [r + 1, o]))), a && Lr(a, () => {
a = null;
})), F && _t(!0);
};
fo(() => {
d = !1, t(m), d || v(null, null);
}, f), O && (l = P);
}
function tt(e, t, r = !1, o = !1, l = !1) {
var a = e, s = "";
Ce(() => {
var c = (
/** @type {Effect} */
S
);
if (s === (s = t() ?? "")) {
O && Et();
return;
}
if (c.nodes_start !== null && (go(
c.nodes_start,
/** @type {TemplateNode} */
c.nodes_end
), c.nodes_start = c.nodes_end = null), s !== "") {
if (O) {
P.data;
for (var f = Et(), d = f; f !== null && (f.nodeType !== 8 || /** @type {Comment} */
f.data !== ""); )
d = f, f = /** @type {TemplateNode} */
/* @__PURE__ */ Be(f);
if (f === null)
throw hr(), bt;
Ae(P, d), a = Ue(f);
return;
}
var m = s + "";
r ? m = `<svg>${m}</svg>` : o && (m = `<math>${m}</math>`);
var v = Zr(m);
if ((r || o) && (v = /** @type {Element} */
/* @__PURE__ */ ve(v)), Ae(
/** @type {TemplateNode} */
/* @__PURE__ */ ve(v),
/** @type {TemplateNode} */
v.lastChild
), r || o)
for (; /* @__PURE__ */ ve(v); )
a.before(
/** @type {Node} */
/* @__PURE__ */ ve(v)
);
else
a.before(v);
}
});
}
function Fa(e, t, r, o, l) {
O && Et();
var a = t.$$slots?.[r], s = !1;
a === !0 && (a = t.children, s = !0), a === void 0 || a(e, s ? () => o : o);
}
const jn = [...`
\r\f \v\uFEFF`];
function Ma(e, t, r) {
var o = "" + e;
if (r) {
for (var l in r)
if (r[l])
o = o ? o + " " + l : l;
else if (o.length)
for (var a = l.length, s = 0; (s = o.indexOf(l, s)) >= 0; ) {
var c = s + a;
(s === 0 || jn.includes(o[s - 1])) && (c === o.length || jn.includes(o[c])) ? o = (s === 0 ? "" : o.substring(0, s)) + o.substring(c + 1) : s = c;
}
}
return o === "" ? null : o;
}
function Va(e, t, r, o, l, a) {
var s = e.__className;
if (O || s !== r || s === void 0) {
var c = Ma(r, o, a);
(!O || c !== e.getAttribute("class")) && (c == null ? e.removeAttribute("class") : e.className = c), e.__className = r;
} else if (a && l !== a)
for (var f in a) {
var d = !!a[f];
(l == null || d !== !!l[f]) && e.classList.toggle(f, d);
}
return a;
}
const Ua = Symbol("is custom element"), ja = Symbol("is html");
function qn(e) {
if (O) {
var t = !1, r = () => {
if (!t) {
if (t = !0, e.hasAttribute("value")) {
var o = e.value;
R(e, "value", null), e.value = o;
}
if (e.hasAttribute("checked")) {
var l = e.checked;
R(e, "checked", null), e.checked = l;
}
}
};
e.__on_r = r, _a(r), Do();
}
}
function qa(e, t) {
var r = Fo(e);
r.value === (r.value = // treat null and undefined the same for the initial value
t ?? void 0) || // @ts-expect-error
// `progress` elements always need their value set when it's `0`
e.value === t && (t !== 0 || e.nodeName !== "PROGRESS") || (e.value = t ?? "");
}
function R(e, t, r, o) {
var l = Fo(e);
O && (l[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || l[t] !== (l[t] = r) && (t === "loading" && (e[Ji] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Ba(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
}
function Fo(e) {
return (
/** @type {Record<string | symbol, unknown>} **/
// @ts-expect-error
e.__attributes ??= {
[Ua]: e.nodeName.includes("-"),
[ja]: e.namespaceURI === ji
}
);
}
var Bn = /* @__PURE__ */ new Map();
function Ba(e) {
var t = Bn.get(e.nodeName);
if (t) return t;
Bn.set(e.nodeName, t = []);
for (var r, o = e, l = Element.prototype; l !== o; ) {
r = Hi(o);
for (var a in r)
r[a].set && t.push(a);
o = Xn(o);
}
return t;
}
function Ha(e, t, r = t) {
Ta(e, "change", (o) => {
var l = o ? e.defaultChecked : e.checked;
r(l);
}), // If we are hydrating and the value has since changed,
// then use the update value from the input instead.
(O && e.defaultChecked !== e.checked || // If defaultChecked is set, then checked == defaultChecked
ot(t) == null) && r(e.checked), Hr(() => {
var o = t();
e.checked = !!o;
});
}
function Hn(e, t) {
return e === t || e?.[Ot] === t;
}
function Qt(e = {}, t, r, o) {
return Br(() => {
var l, a;
return Hr(() => {
l = a, a = [], ot(() => {
e !== r(...a) && (t(e, ...a), l && Hn(r(...l), e) && t(null, ...l));
});
}), () => {
Gr(() => {
a && Hn(r(...a), e) && t(null, ...a);
});
};
}), e;
}
function Mo(e) {
ne === null && Jn(), Dr(() => {
const t = ot(e);
if (typeof t == "function") return (
/** @type {() => void} */
t
);
});
}
function Ga(e) {
ne === null && Jn(), Mo(() => () => ot(e));
}
function Vo(e, t, r) {
if (e == null)
return t(void 0), yt;
const o = ot(
() => e.subscribe(
t,
// @ts-expect-error
r
)
);
return o.unsubscribe ? () => o.unsubscribe() : o;
}
const mt = [];
function Wa(e, t = yt) {
let r = null;
const o = /* @__PURE__ */ new Set();
function l(c) {
if (lo(e, c) && (e = c, r)) {
const f = !mt.length;
for (const d of o)
d[1](), mt.push(d, e);
if (f) {
for (let d = 0; d < mt.length; d += 2)
mt[d][0](mt[d + 1]);
mt.length = 0;
}
}
}
function a(c) {
l(c(
/** @type {T} */
e
));
}
function s(c, f = yt) {
const d = [c, f];
return o.add(d), o.size === 1 && (r = t(l, a) || yt), c(
/** @type {T} */
e
), () => {
o.delete(d), o.size === 0 && r && (r(), r = null);
};
}
return { set: l, update: a, subscribe: s };
}
function rr(e) {
let t;
return Vo(e, (r) => t = r)(), t;
}
let er = !1, Fr = Symbol();
function Ya(e, t, r) {
const o = r[t] ??= {
store: null,
source: /* @__PURE__ */ Yr(void 0),
unsubscribe: yt
};
if (o.store !== e && !(Fr in r))
if (o.unsubscribe(), o.store = e ?? null, e == null)
o.source.v = void 0, o.unsubscribe = yt;
else {
var l = !0;
o.unsubscribe = Vo(e, (a) => {
l ? o.source.v = a : b(o.source, a);
}), l = !1;
}
return e && Fr in r ? rr(e) : i(o.source);
}
function Za() {
const e = {};
function t() {
qr(() => {
for (var r in e)
e[r].unsubscribe();
Mt(e, Fr, {
enumerable: !1,
value: !0
});
});
}
return [e, t];
}
function za(e) {
var t = er;
try {
return er = !1, [e(), er];
} finally {
er = t;
}
}
function Gn(e) {
return e.ctx?.d ?? !1;
}
function x(e, t, r, o) {
var l = (r & Pi) !== 0, a = !0, s = (r & Fi) !== 0, c = (r & Mi) !== 0, f = !1, d;
s ? [d, f] = za(() => (
/** @type {V} */
e[t]
)) : d = /** @type {V} */
e[t];
var m = Ot in e || ro in e, v = s && (rt(e, t)?.set ?? (m && t in e && ((j) => e[t] = j))) || void 0, _ = (
/** @type {V} */
o
), w = !0, F = !1, M = () => (F = !0, w && (w = !1, c ? _ = ot(
/** @type {() => V} */
o
) : _ = /** @type {V} */
o), _);
d === void 0 && o !== void 0 && (v && a && ra(), d = M(), v && v(d));
var U;
if (U = () => {
var j = (
/** @type {V} */
e[t]
);
return j === void 0 ? M() : (w = !0, F = !1, j);
}, (r & Oi) === 0)
return U;
if (v) {
var I = e.$$legacy;
return function(j, se) {
return arguments.length > 0 ? ((!se || I || f) && v(se ? U() : j), j) : U();
};
}
var ee = !1, $e = /* @__PURE__ */ Yr(d), X = /* @__PURE__ */ gr(() => {
var j = U(), se = i($e);
return ee ? (ee = !1, se) : $e.v = j;
});
return s && i(X), l || (X.equals = jr), function(j, se) {
if (arguments.length > 0) {
const He = se ? i(X) : s ? Me(j) : j;
if (!X.equals(He)) {
if (ee = !0, b($e, He), F && _ !== void 0 && (_ = He), Gn(X))
return j;
ot(() => i(X));
}
return j;
}
return Gn(X) ? X.v : i(X);
};
}
function Ja(e) {
return new Ka(e);
}
class Ka {
/** @type {any} */
#t;
/** @type {Record<string, any>} */
#e;
/**
* @param {ComponentConstructorOptions & {
* component: any;
* }} options
*/
constructor(t) {
var r = /* @__PURE__ */ new Map(), o = (a, s) => {
var c = /* @__PURE__ */ Yr(s);
return r.set(a, c), c;
};
const l = new Proxy(
{ ...t.props || {}, $$events: {} },
{
get(a, s) {
return i(r.get(s) ?? o(s, Reflect.get(a, s)));
},
has(a, s) {
return s === ro ? !0 : (i(r.get(s) ?? o(s, Reflect.get(a, s))), Reflect.has(a, s));
},
set(a, s, c) {
return b(r.get(s) ?? o(s, c), c), Reflect.set(a, s, c);
}
}
);
this.#e = (t.hydrate ? Pa : Po)(t.component, {
target: t.target,
anchor: t.anchor,
props: l,
context: t.context,
intro: t.intro ?? !1,
recover: t.recover
}), (!t?.props?.$$host || t.sync === !1) && E(), this.#t = l.$$events;
for (const a of Object.keys(this.#e))
a === "$set" || a === "$destroy" || a === "$on" || Mt(this, a, {
get() {
return this.#e[a];
},
/** @param {any} value */
set(s) {
this.#e[a] = s;
},
enumerable: !0
});
this.#e.$set = /** @param {Record<string, any>} next */
(a) => {
Object.assign(l, a);
}, this.#e.$destroy = () => {
Oa(this.#e);
};
}
/** @param {Record<string, any>} props */
$set(t) {
this.#e.$set(t);
}
/**
* @param {string} event
* @param {(...args: any[]) => any} callback
* @returns {any}
*/
$on(t, r) {
this.#t[t] = this.#t[t] || [];
const o = (...l) => r.call(this, ...l);
return this.#t[t].push(o), () => {
this.#t[t] = this.#t[t].filter(
/** @param {any} fn */
(l) => l !== o
);
};
}
$destroy() {
this.#e.$destroy();
}
}
let Uo;
typeof HTMLElement == "function" && (Uo = class extends HTMLElement {
/** The Svelte component constructor */
$$ctor;
/** Slots */
$$s;
/** @type {any} The Svelte component instance */
$$c;
/** Whether or not the custom element is connected */
$$cn = !1;
/** @type {Record<string, any>} Component props data */
$$d = {};
/** `true` if currently in the process of reflecting component props back to attributes */
$$r = !1;
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
$$p_d = {};
/** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
$$l = {};
/** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
$$l_u = /* @__PURE__ */ new Map();
/** @type {any} The managed render effect for reflecting attributes */
$$me;
/**
* @param {*} $$componentCtor
* @param {*} $$slots
* @param {*} use_shadow_dom
*/
constructor(e, t, r) {
super(), this.$$ctor = e, this.$$s = t, r && this.attachShadow({ mode: "open" });
}
/**
* @param {string} type
* @param {EventListenerOrEventListenerObject} listener
* @param {boolean | AddEventListenerOptions} [options]
*/
addEventListener(e, t, r) {
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
const o = this.$$c.$on(e, t);
this.$$l_u.set(t, o);
}
super.addEventListener(e, t, r);
}
/**
* @param {string} type
* @param {EventListenerOrEventListenerObject} listener
* @param {boolean | AddEventListenerOptions} [options]
*/
removeEventListener(e, t, r) {
if (super.removeEventListener(e, t, r), this.$$c) {
const o = this.$$l_u.get(t);
o && (o(), this.$$l_u.delete(t));
}
}
async connectedCallback() {
if (this.$$cn = !0, !this.$$c) {
let e = function(o) {
return (l) => {
const a = document.createElement("slot");
o !== "default" && (a.name = o), B(l, a);
};
};
if (await Promise.resolve(), !this.$$cn || this.$$c)
return;
const t = {}, r = Xa(this);
for (const o of this.$$s)
o in r && (o === "default" && !this.$$d.children ? (this.$$d.children = e(o), t.default = !0) : t[o] = e(o));
for (const o of this.attributes) {
const l = this.$$g_p(o.name);
l in this.$$d || (this.$$d[l] = nr(l, o.value, this.$$p_d, "toProp"));
}
for (const o in this.$$p_d)
!(o in this.$$d) && this[o] !== void 0 && (this.$$d[o] = this[o], delete this[o]);
this.$$c = Ja({
component: this.$$ctor,
target: this.shadowRoot || this,
props: {
...this.$$d,
$$slots: t,
$$host: this
}
}), this.$$me = ha(() => {
Hr(() => {
this.$$r = !0;
for (const o of or(this.$$c)) {
if (!this.$$p_d[o]?.reflect) continue;
this.$$d[o] = this.$$c[o];
const l = nr(
o,
this.$$d[o],
this.$$p_d,
"toAttribute"
);
l == null ? this.removeAttribute(this.$$p_d[o].attribute || o) : this.setAttribute(this.$$p_d[o].attribute || o, l);
}
this.$$r = !1;
});
});
for (const o in this.$$l)
for (const l of this.$$l[o]) {
const a = this.$$c.$on(o, l);
this.$$l_u.set(l, a);
}
this.$$l = {};
}
}
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
// and setting attributes through setAttribute etc, this is helpful
/**
* @param {string} attr
* @param {string} _oldValue
* @param {string} newValue
*/
attributeChangedCallback(e, t, r) {
this.$$r || (e = this.$$g_p(e), this.$$d[e] = nr(e, r, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
}
disconnectedCallback() {
this.$$cn = !1, Promise.resolve().then(() => {
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
});
}
/**
* @param {string} attribute_name
*/
$$g_p(e) {
return or(this.$$p_d).find(
(t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e
) || e;
}
});
function nr(e, t, r, o) {
const l = r[e]?.type;
if (t = l === "Boolean" && typeof t != "boolean" ? t != null : t, !o || !r[e])
return t;
if (o === "toAttribute")
switch (l) {
case "Object":
case "Array":
return t == null ? null : JSON.stringify(t);
case "Boolean":
return t ? "" : null;
case "Number":
return t ?? null;
default:
return t;
}
else
switch (l) {
case "Object":
case "Array":
return t && JSON.parse(t);
case "Boolean":
return t;
// conversion already handled above
case "Number":
return t != null ? +t : t;
default:
return t;
}
}
function Xa(e) {
const t = {};
return e.childNodes.forEach((r) => {
t[
/** @type {Element} node */
r.slot || "default"
] = !0;
}), t;
}
function Qa(e, t, r, o, l, a) {
let s = class extends Uo {
constructor() {
super(e, r, l), this.$$p_d = t;
}
static get observedAttributes() {
return or(t).map(
(c) => (t[c].attribute || c).toLowerCase()
);
}
};
return or(t).forEach((c) => {
Mt(s.prototype, c, {
get() {
return this.$$c && c in this.$$c ? this.$$c[c] : this.$$d[c];
},
set(f) {
f = nr(c, f, t), this.$$d[c] = f;
var d = this.$$c;
if (d) {
var m = rt(d, c)?.get;
m ? d[c] = f : d.$set({ [c]: f });
}
}
});
}), o.forEach((c) => {
Mt(s.prototype, c, {
get() {
return this.$$c?.[c];
}
});
}), e.element = /** @