altcha 1.0.7 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/altcha.js CHANGED
@@ -1,1140 +1,2015 @@
1
- var jt = Object.defineProperty;
2
- var Pt = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var B = (n, e, t) => Pt(n, typeof e != "symbol" ? e + "" : e, t);
4
- const ht = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGQ9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIHAoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBiKGUsdCxyKXtpZih0eXBlb2YgY3J5cHRvPiJ1Inx8ISgic3VidGxlImluIGNyeXB0byl8fCEoImRpZ2VzdCJpbiBjcnlwdG8uc3VidGxlKSl0aHJvdyBuZXcgRXJyb3IoIldlYiBDcnlwdG8gaXMgbm90IGF2YWlsYWJsZS4gU2VjdXJlIGNvbnRleHQgaXMgcmVxdWlyZWQgKGh0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTL2RvY3MvV2ViL1NlY3VyaXR5L1NlY3VyZV9Db250ZXh0cykuIik7cmV0dXJuIHAoYXdhaXQgY3J5cHRvLnN1YnRsZS5kaWdlc3Qoci50b1VwcGVyQ2FzZSgpLGQuZW5jb2RlKGUrdCkpKX1mdW5jdGlvbiB3KGUsdCxyPSJTSEEtMjU2IixuPTFlNixzPTApe2NvbnN0IG89bmV3IEFib3J0Q29udHJvbGxlcixhPURhdGUubm93KCk7cmV0dXJue3Byb21pc2U6KGFzeW5jKCk9Pntmb3IobGV0IGM9cztjPD1uO2MrPTEpe2lmKG8uc2lnbmFsLmFib3J0ZWQpcmV0dXJuIG51bGw7aWYoYXdhaXQgYih0LGMscik9PT1lKXJldHVybntudW1iZXI6Yyx0b29rOkRhdGUubm93KCktYX19cmV0dXJuIG51bGx9KSgpLGNvbnRyb2xsZXI6b319ZnVuY3Rpb24gaChlKXtjb25zdCB0PWF0b2IoZSkscj1uZXcgVWludDhBcnJheSh0Lmxlbmd0aCk7Zm9yKGxldCBuPTA7bjx0Lmxlbmd0aDtuKyspcltuXT10LmNoYXJDb2RlQXQobik7cmV0dXJuIHJ9ZnVuY3Rpb24gZyhlLHQ9MTIpe2NvbnN0IHI9bmV3IFVpbnQ4QXJyYXkodCk7Zm9yKGxldCBuPTA7bjx0O24rKylyW25dPWUlMjU2LGU9TWF0aC5mbG9vcihlLzI1Nik7cmV0dXJuIHJ9YXN5bmMgZnVuY3Rpb24gbShlLHQ9IiIscj0xZTYsbj0wKXtjb25zdCBzPSJBRVMtR0NNIixvPW5ldyBBYm9ydENvbnRyb2xsZXIsYT1EYXRlLm5vdygpLGw9YXN5bmMoKT0+e2ZvcihsZXQgdT1uO3U8PXI7dSs9MSl7aWYoby5zaWduYWwuYWJvcnRlZHx8IWN8fCF5KXJldHVybiBudWxsO3RyeXtjb25zdCBmPWF3YWl0IGNyeXB0by5zdWJ0bGUuZGVjcnlwdCh7bmFtZTpzLGl2OmcodSl9LGMseSk7aWYoZilyZXR1cm57Y2xlYXJUZXh0Om5ldyBUZXh0RGVjb2RlcigpLmRlY29kZShmKSx0b29rOkRhdGUubm93KCktYX19Y2F0Y2h7fX1yZXR1cm4gbnVsbH07bGV0IGM9bnVsbCx5PW51bGw7dHJ5e3k9aChlKTtjb25zdCB1PWF3YWl0IGNyeXB0by5zdWJ0bGUuZGlnZXN0KCJTSEEtMjU2IixkLmVuY29kZSh0KSk7Yz1hd2FpdCBjcnlwdG8uc3VidGxlLmltcG9ydEtleSgicmF3Iix1LHMsITEsWyJkZWNyeXB0Il0pfWNhdGNoe3JldHVybntwcm9taXNlOlByb21pc2UucmVqZWN0KCksY29udHJvbGxlcjpvfX1yZXR1cm57cHJvbWlzZTpsKCksY29udHJvbGxlcjpvfX1sZXQgaTtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOnIsc3RhcnQ6bixtYXg6c309ZS5kYXRhO2xldCBvPW51bGw7aWYodD09PSJhYm9ydCIpaT09bnVsbHx8aS5hYm9ydCgpLGk9dm9pZCAwO2Vsc2UgaWYodD09PSJ3b3JrIil7aWYoIm9iZnVzY2F0ZWQiaW4gcil7Y29uc3R7a2V5OmEsb2JmdXNjYXRlZDpsfT1yfHx7fTtvPWF3YWl0IG0obCxhLHMsbil9ZWxzZXtjb25zdHthbGdvcml0aG06YSxjaGFsbGVuZ2U6bCxzYWx0OmN9PXJ8fHt9O289dyhsLGMsYSxzLG4pfWk9by5jb250cm9sbGVyLG8ucHJvbWlzZS50aGVuKGE9PntzZWxmLnBvc3RNZXNzYWdlKGEmJnsuLi5hLHdvcmtlcjohMH0pfSl9fX0pKCk7Cg==", Ft = (n) => Uint8Array.from(atob(n), (e) => e.charCodeAt(0)), nt = typeof self < "u" && self.Blob && new Blob([Ft(ht)], { type: "text/javascript;charset=utf-8" });
5
- function Mt(n) {
6
- let e;
1
+ var vi = Object.defineProperty;
2
+ var Pr = (e) => {
3
+ throw TypeError(e);
4
+ };
5
+ var gi = (e, t, r) => t in e ? vi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
6
+ var ne = (e, t, r) => gi(e, typeof t != "symbol" ? t + "" : t, r), zr = (e, t, r) => t.has(e) || Pr("Cannot " + r);
7
+ var M = (e, t, r) => (zr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Yt = (e, t, r) => t.has(e) ? Pr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Ft = (e, t, r, l) => (zr(e, t, "write to private field"), l ? l.call(e, r) : t.set(e, r), r);
8
+ const Hr = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGQ9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIHAoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBiKGUsdCxyKXtpZih0eXBlb2YgY3J5cHRvPiJ1Inx8ISgic3VidGxlImluIGNyeXB0byl8fCEoImRpZ2VzdCJpbiBjcnlwdG8uc3VidGxlKSl0aHJvdyBuZXcgRXJyb3IoIldlYiBDcnlwdG8gaXMgbm90IGF2YWlsYWJsZS4gU2VjdXJlIGNvbnRleHQgaXMgcmVxdWlyZWQgKGh0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTL2RvY3MvV2ViL1NlY3VyaXR5L1NlY3VyZV9Db250ZXh0cykuIik7cmV0dXJuIHAoYXdhaXQgY3J5cHRvLnN1YnRsZS5kaWdlc3Qoci50b1VwcGVyQ2FzZSgpLGQuZW5jb2RlKGUrdCkpKX1mdW5jdGlvbiB3KGUsdCxyPSJTSEEtMjU2IixuPTFlNixzPTApe2NvbnN0IG89bmV3IEFib3J0Q29udHJvbGxlcixhPURhdGUubm93KCk7cmV0dXJue3Byb21pc2U6KGFzeW5jKCk9Pntmb3IobGV0IGM9cztjPD1uO2MrPTEpe2lmKG8uc2lnbmFsLmFib3J0ZWQpcmV0dXJuIG51bGw7aWYoYXdhaXQgYih0LGMscik9PT1lKXJldHVybntudW1iZXI6Yyx0b29rOkRhdGUubm93KCktYX19cmV0dXJuIG51bGx9KSgpLGNvbnRyb2xsZXI6b319ZnVuY3Rpb24gaChlKXtjb25zdCB0PWF0b2IoZSkscj1uZXcgVWludDhBcnJheSh0Lmxlbmd0aCk7Zm9yKGxldCBuPTA7bjx0Lmxlbmd0aDtuKyspcltuXT10LmNoYXJDb2RlQXQobik7cmV0dXJuIHJ9ZnVuY3Rpb24gZyhlLHQ9MTIpe2NvbnN0IHI9bmV3IFVpbnQ4QXJyYXkodCk7Zm9yKGxldCBuPTA7bjx0O24rKylyW25dPWUlMjU2LGU9TWF0aC5mbG9vcihlLzI1Nik7cmV0dXJuIHJ9YXN5bmMgZnVuY3Rpb24gbShlLHQ9IiIscj0xZTYsbj0wKXtjb25zdCBzPSJBRVMtR0NNIixvPW5ldyBBYm9ydENvbnRyb2xsZXIsYT1EYXRlLm5vdygpLGw9YXN5bmMoKT0+e2ZvcihsZXQgdT1uO3U8PXI7dSs9MSl7aWYoby5zaWduYWwuYWJvcnRlZHx8IWN8fCF5KXJldHVybiBudWxsO3RyeXtjb25zdCBmPWF3YWl0IGNyeXB0by5zdWJ0bGUuZGVjcnlwdCh7bmFtZTpzLGl2OmcodSl9LGMseSk7aWYoZilyZXR1cm57Y2xlYXJUZXh0Om5ldyBUZXh0RGVjb2RlcigpLmRlY29kZShmKSx0b29rOkRhdGUubm93KCktYX19Y2F0Y2h7fX1yZXR1cm4gbnVsbH07bGV0IGM9bnVsbCx5PW51bGw7dHJ5e3k9aChlKTtjb25zdCB1PWF3YWl0IGNyeXB0by5zdWJ0bGUuZGlnZXN0KCJTSEEtMjU2IixkLmVuY29kZSh0KSk7Yz1hd2FpdCBjcnlwdG8uc3VidGxlLmltcG9ydEtleSgicmF3Iix1LHMsITEsWyJkZWNyeXB0Il0pfWNhdGNoe3JldHVybntwcm9taXNlOlByb21pc2UucmVqZWN0KCksY29udHJvbGxlcjpvfX1yZXR1cm57cHJvbWlzZTpsKCksY29udHJvbGxlcjpvfX1sZXQgaTtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOnIsc3RhcnQ6bixtYXg6c309ZS5kYXRhO2xldCBvPW51bGw7aWYodD09PSJhYm9ydCIpaT09bnVsbHx8aS5hYm9ydCgpLGk9dm9pZCAwO2Vsc2UgaWYodD09PSJ3b3JrIil7aWYoIm9iZnVzY2F0ZWQiaW4gcil7Y29uc3R7a2V5OmEsb2JmdXNjYXRlZDpsfT1yfHx7fTtvPWF3YWl0IG0obCxhLHMsbil9ZWxzZXtjb25zdHthbGdvcml0aG06YSxjaGFsbGVuZ2U6bCxzYWx0OmN9PXJ8fHt9O289dyhsLGMsYSxzLG4pfWk9by5jb250cm9sbGVyLG8ucHJvbWlzZS50aGVuKGE9PntzZWxmLnBvc3RNZXNzYWdlKGEmJnsuLi5hLHdvcmtlcjohMH0pfSl9fX0pKCk7Cg==", _i = (e) => Uint8Array.from(atob(e), (t) => t.charCodeAt(0)), Gr = typeof self < "u" && self.Blob && new Blob([_i(Hr)], { type: "text/javascript;charset=utf-8" });
9
+ function mi(e) {
10
+ let t;
7
11
  try {
8
- if (e = nt && (self.URL || self.webkitURL).createObjectURL(nt), !e) throw "";
9
- const t = new Worker(e, {
10
- name: n == null ? void 0 : n.name
12
+ if (t = Gr && (self.URL || self.webkitURL).createObjectURL(Gr), !t) throw "";
13
+ const r = new Worker(t, {
14
+ name: e == null ? void 0 : e.name
11
15
  });
12
- return t.addEventListener("error", () => {
13
- (self.URL || self.webkitURL).revokeObjectURL(e);
14
- }), t;
16
+ return r.addEventListener("error", () => {
17
+ (self.URL || self.webkitURL).revokeObjectURL(t);
18
+ }), r;
15
19
  } catch {
16
20
  return new Worker(
17
- "data:text/javascript;base64," + ht,
21
+ "data:text/javascript;base64," + Hr,
18
22
  {
19
- name: n == null ? void 0 : n.name
23
+ name: e == null ? void 0 : e.name
20
24
  }
21
25
  );
22
26
  } finally {
23
- e && (self.URL || self.webkitURL).revokeObjectURL(e);
27
+ t && (self.URL || self.webkitURL).revokeObjectURL(t);
24
28
  }
25
29
  }
26
- function Ce() {
30
+ const bi = "5";
31
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(bi);
32
+ const yi = 1, pi = 4, wi = 8, Ei = 16, xi = 1, ki = 2, Jr = "[", Kr = "[!", qr = "]", Me = {}, j = Symbol(), Qr = !1;
33
+ var en = Array.isArray, Ci = Array.from, kt = Object.keys, Ct = Object.defineProperty, Ae = Object.getOwnPropertyDescriptor, Ri = Object.getOwnPropertyDescriptors, Ii = Object.prototype, $i = Array.prototype, Xt = Object.getPrototypeOf;
34
+ function tn(e) {
35
+ for (var t = 0; t < e.length; t++)
36
+ e[t]();
27
37
  }
28
- function Ut(n, e) {
29
- for (const t in e) n[t] = e[t];
30
- return (
31
- /** @type {T & S} */
32
- n
33
- );
38
+ const ae = 2, rn = 4, ht = 8, Jt = 16, oe = 32, vt = 64, Zt = 128, Ve = 256, Rt = 512, B = 1024, Ce = 2048, gt = 4096, He = 8192, qe = 16384, Si = 32768, Kt = 65536, Ni = 1 << 19, nn = 1 << 20, ut = Symbol("$state"), ln = Symbol("legacy props"), Li = Symbol("");
39
+ function an(e) {
40
+ return e === this.v;
34
41
  }
35
- function gt(n) {
36
- return n();
42
+ function Ai(e, t) {
43
+ return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
37
44
  }
38
- function rt() {
39
- return /* @__PURE__ */ Object.create(null);
45
+ function on(e) {
46
+ return !Ai(e, this.v);
40
47
  }
41
- function we(n) {
42
- n.forEach(gt);
48
+ function Ti(e) {
49
+ throw new Error("https://svelte.dev/e/effect_in_teardown");
43
50
  }
44
- function mt(n) {
45
- return typeof n == "function";
51
+ function Vi() {
52
+ throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
46
53
  }
47
- function Ht(n, e) {
48
- return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
54
+ function Pi(e) {
55
+ throw new Error("https://svelte.dev/e/effect_orphan");
49
56
  }
50
- function Bt(n) {
51
- return Object.keys(n).length === 0;
57
+ function zi() {
58
+ throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
52
59
  }
53
- function Dt(n, e, t, i) {
54
- if (n) {
55
- const o = bt(n, e, t, i);
56
- return n[0](o);
57
- }
60
+ function Gi() {
61
+ throw new Error("https://svelte.dev/e/hydration_failed");
62
+ }
63
+ function Di(e) {
64
+ throw new Error("https://svelte.dev/e/props_invalid_value");
65
+ }
66
+ function Yi() {
67
+ throw new Error("https://svelte.dev/e/state_descriptors_fixed");
58
68
  }
59
- function bt(n, e, t, i) {
60
- return n[1] && i ? Ut(t.ctx.slice(), n[1](i(e))) : t.ctx;
69
+ function Fi() {
70
+ throw new Error("https://svelte.dev/e/state_prototype_fixed");
71
+ }
72
+ function Oi() {
73
+ throw new Error("https://svelte.dev/e/state_unsafe_local_read");
74
+ }
75
+ function Xi() {
76
+ throw new Error("https://svelte.dev/e/state_unsafe_mutation");
77
+ }
78
+ let sn = !1;
79
+ function ce(e) {
80
+ return {
81
+ f: 0,
82
+ // TODO ideally we could skip this altogether, but it causes type errors
83
+ v: e,
84
+ reactions: null,
85
+ equals: an,
86
+ version: 0
87
+ };
61
88
  }
62
- function Jt(n, e, t, i) {
63
- if (n[2] && i) {
64
- const o = n[2](i(t));
65
- if (e.dirty === void 0)
66
- return o;
67
- if (typeof o == "object") {
68
- const l = [], s = Math.max(e.dirty.length, o.length);
69
- for (let d = 0; d < s; d += 1)
70
- l[d] = e.dirty[d] | o[d];
71
- return l;
89
+ function Fe(e) {
90
+ return /* @__PURE__ */ Zi(ce(e));
91
+ }
92
+ // @__NO_SIDE_EFFECTS__
93
+ function un(e, t = !1) {
94
+ const r = ce(e);
95
+ return t || (r.equals = on), r;
96
+ }
97
+ // @__NO_SIDE_EFFECTS__
98
+ function Zi(e) {
99
+ return R !== null && R.f & ae && (de === null ? nl([e]) : de.push(e)), e;
100
+ }
101
+ function V(e, t) {
102
+ return R !== null && ll() && R.f & (ae | Jt) && // If the source was created locally within the current derived, then
103
+ // we allow the mutation.
104
+ (de === null || !de.includes(e)) && Xi(), Wi(e, t);
105
+ }
106
+ function Wi(e, t) {
107
+ return e.equals(t) || (e.v = t, e.version = $n(), fn(e, Ce), y !== null && y.f & B && !(y.f & oe) && (O !== null && O.includes(e) ? (ve(y, Ce), Vt(y)) : xe === null ? il([e]) : xe.push(e))), t;
108
+ }
109
+ function fn(e, t) {
110
+ var r = e.reactions;
111
+ if (r !== null)
112
+ for (var l = r.length, i = 0; i < l; i++) {
113
+ var a = r[i], o = a.f;
114
+ o & Ce || (ve(a, t), o & (B | Ve) && (o & ae ? fn(
115
+ /** @type {Derived} */
116
+ a,
117
+ gt
118
+ ) : Vt(
119
+ /** @type {Effect} */
120
+ a
121
+ )));
72
122
  }
73
- return e.dirty | o;
123
+ }
124
+ function Nt(e) {
125
+ console.warn("https://svelte.dev/e/hydration_mismatch");
126
+ }
127
+ let z = !1;
128
+ function We(e) {
129
+ z = e;
130
+ }
131
+ let P;
132
+ function Re(e) {
133
+ if (e === null)
134
+ throw Nt(), Me;
135
+ return P = e;
136
+ }
137
+ function Je() {
138
+ return Re(
139
+ /** @type {TemplateNode} */
140
+ /* @__PURE__ */ $e(P)
141
+ );
142
+ }
143
+ function H(e) {
144
+ if (z) {
145
+ if (/* @__PURE__ */ $e(P) !== null)
146
+ throw Nt(), Me;
147
+ P = e;
74
148
  }
75
- return e.dirty;
76
149
  }
77
- function Ot(n, e, t, i, o, l) {
78
- if (o) {
79
- const s = bt(e, t, i, l);
80
- n.p(s, o);
150
+ function Ui() {
151
+ for (var e = 0, t = P; ; ) {
152
+ if (t.nodeType === 8) {
153
+ var r = (
154
+ /** @type {Comment} */
155
+ t.data
156
+ );
157
+ if (r === qr) {
158
+ if (e === 0) return t;
159
+ e -= 1;
160
+ } else (r === Jr || r === Kr) && (e += 1);
161
+ }
162
+ var l = (
163
+ /** @type {TemplateNode} */
164
+ /* @__PURE__ */ $e(t)
165
+ );
166
+ t.remove(), t = l;
81
167
  }
82
168
  }
83
- function Kt(n) {
84
- if (n.ctx.length > 32) {
85
- const e = [], t = n.ctx.length / 32;
86
- for (let i = 0; i < t; i++)
87
- e[i] = -1;
169
+ function le(e, t = null, r) {
170
+ if (typeof e != "object" || e === null || ut in e)
88
171
  return e;
89
- }
90
- return -1;
172
+ const l = Xt(e);
173
+ if (l !== Ii && l !== $i)
174
+ return e;
175
+ var i = /* @__PURE__ */ new Map(), a = en(e), o = ce(0);
176
+ a && i.set("length", ce(
177
+ /** @type {any[]} */
178
+ e.length
179
+ ));
180
+ var d;
181
+ return new Proxy(
182
+ /** @type {any} */
183
+ e,
184
+ {
185
+ defineProperty(u, f, c) {
186
+ (!("value" in c) || c.configurable === !1 || c.enumerable === !1 || c.writable === !1) && Yi();
187
+ var v = i.get(f);
188
+ return v === void 0 ? (v = ce(c.value), i.set(f, v)) : V(v, le(c.value, d)), !0;
189
+ },
190
+ deleteProperty(u, f) {
191
+ var c = i.get(f);
192
+ if (c === void 0)
193
+ f in u && i.set(f, ce(j));
194
+ else {
195
+ if (a && typeof f == "string") {
196
+ var v = (
197
+ /** @type {Source<number>} */
198
+ i.get("length")
199
+ ), g = Number(f);
200
+ Number.isInteger(g) && g < v.v && V(v, g);
201
+ }
202
+ V(c, j), Dr(o);
203
+ }
204
+ return !0;
205
+ },
206
+ get(u, f, c) {
207
+ var p;
208
+ if (f === ut)
209
+ return e;
210
+ var v = i.get(f), g = f in u;
211
+ if (v === void 0 && (!g || (p = Ae(u, f)) != null && p.writable) && (v = ce(le(g ? u[f] : j, d)), i.set(f, v)), v !== void 0) {
212
+ var m = h(v);
213
+ return m === j ? void 0 : m;
214
+ }
215
+ return Reflect.get(u, f, c);
216
+ },
217
+ getOwnPropertyDescriptor(u, f) {
218
+ var c = Reflect.getOwnPropertyDescriptor(u, f);
219
+ if (c && "value" in c) {
220
+ var v = i.get(f);
221
+ v && (c.value = h(v));
222
+ } else if (c === void 0) {
223
+ var g = i.get(f), m = g == null ? void 0 : g.v;
224
+ if (g !== void 0 && m !== j)
225
+ return {
226
+ enumerable: !0,
227
+ configurable: !0,
228
+ value: m,
229
+ writable: !0
230
+ };
231
+ }
232
+ return c;
233
+ },
234
+ has(u, f) {
235
+ var m;
236
+ if (f === ut)
237
+ return !0;
238
+ var c = i.get(f), v = c !== void 0 && c.v !== j || Reflect.has(u, f);
239
+ if (c !== void 0 || y !== null && (!v || (m = Ae(u, f)) != null && m.writable)) {
240
+ c === void 0 && (c = ce(v ? le(u[f], d) : j), i.set(f, c));
241
+ var g = h(c);
242
+ if (g === j)
243
+ return !1;
244
+ }
245
+ return v;
246
+ },
247
+ set(u, f, c, v) {
248
+ var Z;
249
+ var g = i.get(f), m = f in u;
250
+ if (a && f === "length")
251
+ for (var p = c; p < /** @type {Source<number>} */
252
+ g.v; p += 1) {
253
+ var L = i.get(p + "");
254
+ L !== void 0 ? V(L, j) : p in u && (L = ce(j), i.set(p + "", L));
255
+ }
256
+ g === void 0 ? (!m || (Z = Ae(u, f)) != null && Z.writable) && (g = ce(void 0), V(g, le(c, d)), i.set(f, g)) : (m = g.v !== j, V(g, le(c, d)));
257
+ var G = Reflect.getOwnPropertyDescriptor(u, f);
258
+ if (G != null && G.set && G.set.call(v, c), !m) {
259
+ if (a && typeof f == "string") {
260
+ var Q = (
261
+ /** @type {Source<number>} */
262
+ i.get("length")
263
+ ), D = Number(f);
264
+ Number.isInteger(D) && D >= Q.v && V(Q, D + 1);
265
+ }
266
+ Dr(o);
267
+ }
268
+ return !0;
269
+ },
270
+ ownKeys(u) {
271
+ h(o);
272
+ var f = Reflect.ownKeys(u).filter((g) => {
273
+ var m = i.get(g);
274
+ return m === void 0 || m.v !== j;
275
+ });
276
+ for (var [c, v] of i)
277
+ v.v !== j && !(c in u) && f.push(c);
278
+ return f;
279
+ },
280
+ setPrototypeOf() {
281
+ Fi();
282
+ }
283
+ }
284
+ );
91
285
  }
92
- function L(n, e) {
93
- n.appendChild(e);
286
+ function Dr(e, t = 1) {
287
+ V(e, e.v + t);
94
288
  }
95
- function $t(n, e, t) {
96
- const i = Qt(n);
97
- if (!i.getElementById(e)) {
98
- const o = A("style");
99
- o.id = e, o.textContent = t, qt(i, o);
289
+ var Yr, cn, dn;
290
+ function Wt() {
291
+ if (Yr === void 0) {
292
+ Yr = window;
293
+ var e = Element.prototype, t = Node.prototype;
294
+ cn = Ae(t, "firstChild").get, dn = Ae(t, "nextSibling").get, e.__click = void 0, e.__className = "", e.__attributes = null, e.__styles = null, e.__e = void 0, Text.prototype.__t = void 0;
100
295
  }
101
296
  }
102
- function Qt(n) {
103
- if (!n) return document;
104
- const e = n.getRootNode ? n.getRootNode() : n.ownerDocument;
105
- return e && /** @type {ShadowRoot} */
106
- e.host ? (
107
- /** @type {ShadowRoot} */
108
- e
109
- ) : n.ownerDocument;
297
+ function Lt(e = "") {
298
+ return document.createTextNode(e);
110
299
  }
111
- function qt(n, e) {
112
- return L(
113
- /** @type {Document} */
114
- n.head || n,
115
- e
116
- ), e.sheet;
300
+ // @__NO_SIDE_EFFECTS__
301
+ function Te(e) {
302
+ return cn.call(e);
117
303
  }
118
- function T(n, e, t) {
119
- n.insertBefore(e, t || null);
304
+ // @__NO_SIDE_EFFECTS__
305
+ function $e(e) {
306
+ return dn.call(e);
120
307
  }
121
- function W(n) {
122
- n.parentNode && n.parentNode.removeChild(n);
308
+ function J(e, t) {
309
+ if (!z)
310
+ return /* @__PURE__ */ Te(e);
311
+ var r = (
312
+ /** @type {TemplateNode} */
313
+ /* @__PURE__ */ Te(P)
314
+ );
315
+ return r === null && (r = P.appendChild(Lt())), Re(r), r;
316
+ }
317
+ function Ot(e, t) {
318
+ if (!z) {
319
+ var r = (
320
+ /** @type {DocumentFragment} */
321
+ /* @__PURE__ */ Te(
322
+ /** @type {Node} */
323
+ e
324
+ )
325
+ );
326
+ return r instanceof Comment && r.data === "" ? /* @__PURE__ */ $e(r) : r;
327
+ }
328
+ return P;
329
+ }
330
+ function me(e, t = 1, r = !1) {
331
+ let l = z ? P : e;
332
+ for (var i; t--; )
333
+ i = l, l = /** @type {TemplateNode} */
334
+ /* @__PURE__ */ $e(l);
335
+ if (!z)
336
+ return l;
337
+ var a = l == null ? void 0 : l.nodeType;
338
+ if (r && a !== 3) {
339
+ var o = Lt();
340
+ return l === null ? i == null || i.after(o) : l.before(o), Re(o), o;
341
+ }
342
+ return Re(l), /** @type {TemplateNode} */
343
+ l;
344
+ }
345
+ function Mi(e) {
346
+ e.textContent = "";
347
+ }
348
+ // @__NO_SIDE_EFFECTS__
349
+ function ot(e) {
350
+ var t = ae | Ce;
351
+ y === null ? t |= Ve : y.f |= nn;
352
+ var r = R !== null && R.f & ae ? (
353
+ /** @type {Derived} */
354
+ R
355
+ ) : null;
356
+ const l = {
357
+ children: null,
358
+ ctx: X,
359
+ deps: null,
360
+ equals: an,
361
+ f: t,
362
+ fn: e,
363
+ reactions: null,
364
+ v: (
365
+ /** @type {V} */
366
+ null
367
+ ),
368
+ version: 0,
369
+ parent: r ?? y
370
+ };
371
+ return r !== null && (r.children ?? (r.children = [])).push(l), l;
372
+ }
373
+ function hn(e) {
374
+ var t = e.children;
375
+ if (t !== null) {
376
+ e.children = null;
377
+ for (var r = 0; r < t.length; r += 1) {
378
+ var l = t[r];
379
+ l.f & ae ? qt(
380
+ /** @type {Derived} */
381
+ l
382
+ ) : Pe(
383
+ /** @type {Effect} */
384
+ l
385
+ );
386
+ }
387
+ }
123
388
  }
124
- function A(n) {
125
- return document.createElement(n);
389
+ function ji(e) {
390
+ for (var t = e.parent; t !== null; ) {
391
+ if (!(t.f & ae))
392
+ return (
393
+ /** @type {Effect} */
394
+ t
395
+ );
396
+ t = t.parent;
397
+ }
398
+ return null;
126
399
  }
127
- function Q(n) {
128
- return document.createElementNS("http://www.w3.org/2000/svg", n);
400
+ function vn(e) {
401
+ var t, r = y;
402
+ he(ji(e));
403
+ try {
404
+ hn(e), t = Sn(e);
405
+ } finally {
406
+ he(r);
407
+ }
408
+ return t;
129
409
  }
130
- function en(n) {
131
- return document.createTextNode(n);
410
+ function gn(e) {
411
+ var t = vn(e), r = (Ue || e.f & Ve) && e.deps !== null ? gt : B;
412
+ ve(e, r), e.equals(t) || (e.v = t, e.version = $n());
413
+ }
414
+ function qt(e) {
415
+ hn(e), dt(e, 0), ve(e, qe), e.v = e.children = e.deps = e.ctx = e.reactions = null;
416
+ }
417
+ function Bi(e) {
418
+ y === null && R === null && Pi(), R !== null && R.f & Ve && Vi(), nr && Ti();
419
+ }
420
+ function Hi(e, t) {
421
+ var r = t.last;
422
+ r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
423
+ }
424
+ function Qe(e, t, r, l = !0) {
425
+ var i = (e & vt) !== 0, a = y, o = {
426
+ ctx: X,
427
+ deps: null,
428
+ deriveds: null,
429
+ nodes_start: null,
430
+ nodes_end: null,
431
+ f: e | Ce,
432
+ first: null,
433
+ fn: t,
434
+ last: null,
435
+ next: null,
436
+ parent: i ? null : a,
437
+ prev: null,
438
+ teardown: null,
439
+ transitions: null,
440
+ version: 0
441
+ };
442
+ if (r) {
443
+ var d = je;
444
+ try {
445
+ Xr(!0), Tt(o), o.f |= Si;
446
+ } catch (c) {
447
+ throw Pe(o), c;
448
+ } finally {
449
+ Xr(d);
450
+ }
451
+ } else t !== null && Vt(o);
452
+ var u = r && o.deps === null && o.first === null && o.nodes_start === null && o.teardown === null && (o.f & nn) === 0;
453
+ if (!u && !i && l && (a !== null && Hi(o, a), R !== null && R.f & ae)) {
454
+ var f = (
455
+ /** @type {Derived} */
456
+ R
457
+ );
458
+ (f.children ?? (f.children = [])).push(o);
459
+ }
460
+ return o;
132
461
  }
133
- function $() {
134
- return en(" ");
462
+ function Ji(e) {
463
+ const t = Qe(ht, null, !1);
464
+ return ve(t, B), t.teardown = e, t;
135
465
  }
136
- function Le(n, e, t, i) {
137
- return n.addEventListener(e, t, i), () => n.removeEventListener(e, t, i);
466
+ function Ut(e) {
467
+ Bi();
468
+ var t = y !== null && (y.f & oe) !== 0 && X !== null && !X.m;
469
+ if (t) {
470
+ var r = (
471
+ /** @type {ComponentContext} */
472
+ X
473
+ );
474
+ (r.e ?? (r.e = [])).push({
475
+ fn: e,
476
+ effect: y,
477
+ reaction: R
478
+ });
479
+ } else {
480
+ var l = Qt(e);
481
+ return l;
482
+ }
483
+ }
484
+ function _n(e) {
485
+ const t = Qe(vt, e, !0);
486
+ return () => {
487
+ Pe(t);
488
+ };
138
489
  }
139
- function a(n, e, t) {
140
- t == null ? n.removeAttribute(e) : n.getAttribute(e) !== t && n.setAttribute(e, t);
490
+ function Qt(e) {
491
+ return Qe(rn, e, !1);
141
492
  }
142
- function tn(n) {
143
- return Array.from(n.childNodes);
493
+ function er(e) {
494
+ return Qe(ht, e, !0);
144
495
  }
145
- function it(n, e, t) {
146
- n.classList.toggle(e, !!t);
496
+ function Oe(e) {
497
+ return tr(e);
147
498
  }
148
- function nn(n, e, { bubbles: t = !1, cancelable: i = !1 } = {}) {
149
- return new CustomEvent(n, { detail: e, bubbles: t, cancelable: i });
499
+ function tr(e, t = 0) {
500
+ return Qe(ht | Jt | t, e, !0);
150
501
  }
151
- function rn(n) {
152
- const e = {};
153
- return n.childNodes.forEach(
154
- /** @param {Element} node */
155
- (t) => {
156
- e[t.slot || "default"] = !0;
502
+ function It(e, t = !0) {
503
+ return Qe(ht | oe, e, !0, t);
504
+ }
505
+ function mn(e) {
506
+ var t = e.teardown;
507
+ if (t !== null) {
508
+ const r = nr, l = R;
509
+ Zr(!0), Ie(null);
510
+ try {
511
+ t.call(null);
512
+ } finally {
513
+ Zr(r), Ie(l);
157
514
  }
158
- ), e;
159
- }
160
- let pe;
161
- function ve(n) {
162
- pe = n;
163
- }
164
- function Ge() {
165
- if (!pe) throw new Error("Function called outside component initialization");
166
- return pe;
167
- }
168
- function on(n) {
169
- Ge().$$.on_mount.push(n);
170
- }
171
- function ln(n) {
172
- Ge().$$.on_destroy.push(n);
173
- }
174
- function sn() {
175
- const n = Ge();
176
- return (e, t, { cancelable: i = !1 } = {}) => {
177
- const o = n.$$.callbacks[e];
178
- if (o) {
179
- const l = nn(
180
- /** @type {string} */
181
- e,
182
- t,
183
- { cancelable: i }
515
+ }
516
+ }
517
+ function bn(e) {
518
+ var t = e.deriveds;
519
+ if (t !== null) {
520
+ e.deriveds = null;
521
+ for (var r = 0; r < t.length; r += 1)
522
+ qt(t[r]);
523
+ }
524
+ }
525
+ function yn(e, t = !1) {
526
+ var r = e.first;
527
+ for (e.first = e.last = null; r !== null; ) {
528
+ var l = r.next;
529
+ Pe(r, t), r = l;
530
+ }
531
+ }
532
+ function Ki(e) {
533
+ for (var t = e.first; t !== null; ) {
534
+ var r = t.next;
535
+ t.f & oe || Pe(t), t = r;
536
+ }
537
+ }
538
+ function Pe(e, t = !0) {
539
+ var r = !1;
540
+ if ((t || e.f & Ni) && e.nodes_start !== null) {
541
+ for (var l = e.nodes_start, i = e.nodes_end; l !== null; ) {
542
+ var a = l === i ? null : (
543
+ /** @type {TemplateNode} */
544
+ /* @__PURE__ */ $e(l)
184
545
  );
185
- return o.slice().forEach((s) => {
186
- s.call(n, l);
187
- }), !l.defaultPrevented;
546
+ l.remove(), l = a;
188
547
  }
189
- return !0;
190
- };
548
+ r = !0;
549
+ }
550
+ yn(e, t && !r), bn(e), dt(e, 0), ve(e, qe);
551
+ var o = e.transitions;
552
+ if (o !== null)
553
+ for (const u of o)
554
+ u.stop();
555
+ mn(e);
556
+ var d = e.parent;
557
+ d !== null && d.first !== null && pn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = null;
558
+ }
559
+ function pn(e) {
560
+ var t = e.parent, r = e.prev, l = e.next;
561
+ r !== null && (r.next = l), l !== null && (l.prev = r), t !== null && (t.first === e && (t.first = l), t.last === e && (t.last = r));
562
+ }
563
+ function Fr(e, t) {
564
+ var r = [];
565
+ wn(e, r, !0), qi(r, () => {
566
+ Pe(e), t && t();
567
+ });
191
568
  }
192
- const ae = [], Ie = [];
193
- let fe = [];
194
- const ot = [], yt = /* @__PURE__ */ Promise.resolve();
195
- let Ve = !1;
196
- function vt() {
197
- Ve || (Ve = !0, yt.then(w));
569
+ function qi(e, t) {
570
+ var r = e.length;
571
+ if (r > 0) {
572
+ var l = () => --r || t();
573
+ for (var i of e)
574
+ i.out(l);
575
+ } else
576
+ t();
577
+ }
578
+ function wn(e, t, r) {
579
+ if (!(e.f & He)) {
580
+ if (e.f ^= He, e.transitions !== null)
581
+ for (const o of e.transitions)
582
+ (o.is_global || r) && t.push(o);
583
+ for (var l = e.first; l !== null; ) {
584
+ var i = l.next, a = (l.f & Kt) !== 0 || (l.f & oe) !== 0;
585
+ wn(l, t, a ? r : !1), l = i;
586
+ }
587
+ }
588
+ }
589
+ function Or(e) {
590
+ En(e, !0);
591
+ }
592
+ function En(e, t) {
593
+ if (e.f & He) {
594
+ _t(e) && Tt(e), e.f ^= He;
595
+ for (var r = e.first; r !== null; ) {
596
+ var l = r.next, i = (r.f & Kt) !== 0 || (r.f & oe) !== 0;
597
+ En(r, i ? t : !1), r = l;
598
+ }
599
+ if (e.transitions !== null)
600
+ for (const a of e.transitions)
601
+ (a.is_global || t) && a.in();
602
+ }
603
+ }
604
+ const Qi = typeof requestIdleCallback > "u" ? (e) => setTimeout(e, 1) : requestIdleCallback;
605
+ let $t = !1, St = !1, Mt = [], jt = [];
606
+ function xn() {
607
+ $t = !1;
608
+ const e = Mt.slice();
609
+ Mt = [], tn(e);
610
+ }
611
+ function kn() {
612
+ St = !1;
613
+ const e = jt.slice();
614
+ jt = [], tn(e);
615
+ }
616
+ function rr(e) {
617
+ $t || ($t = !0, queueMicrotask(xn)), Mt.push(e);
618
+ }
619
+ function el(e) {
620
+ St || (St = !0, Qi(kn)), jt.push(e);
198
621
  }
199
- function cn() {
200
- return vt(), yt;
622
+ function tl() {
623
+ $t && xn(), St && kn();
201
624
  }
202
- function Se(n) {
203
- fe.push(n);
625
+ function Cn(e) {
626
+ throw new Error("https://svelte.dev/e/lifecycle_outside_component");
204
627
  }
205
- const ze = /* @__PURE__ */ new Set();
206
- let ce = 0;
207
- function w() {
208
- if (ce !== 0)
628
+ const Rn = 0, rl = 1;
629
+ let wt = !1, Et = Rn, ft = !1, ct = null, je = !1, nr = !1;
630
+ function Xr(e) {
631
+ je = e;
632
+ }
633
+ function Zr(e) {
634
+ nr = e;
635
+ }
636
+ let Le = [], Be = 0;
637
+ let R = null;
638
+ function Ie(e) {
639
+ R = e;
640
+ }
641
+ let y = null;
642
+ function he(e) {
643
+ y = e;
644
+ }
645
+ let de = null;
646
+ function nl(e) {
647
+ de = e;
648
+ }
649
+ let O = null, q = 0, xe = null;
650
+ function il(e) {
651
+ xe = e;
652
+ }
653
+ let In = 0, Ue = !1, X = null;
654
+ function $n() {
655
+ return ++In;
656
+ }
657
+ function ll() {
658
+ return !sn;
659
+ }
660
+ function _t(e) {
661
+ var o, d;
662
+ var t = e.f;
663
+ if (t & Ce)
664
+ return !0;
665
+ if (t & gt) {
666
+ var r = e.deps, l = (t & Ve) !== 0;
667
+ if (r !== null) {
668
+ var i;
669
+ if (t & Rt) {
670
+ for (i = 0; i < r.length; i++)
671
+ ((o = r[i]).reactions ?? (o.reactions = [])).push(e);
672
+ e.f ^= Rt;
673
+ }
674
+ for (i = 0; i < r.length; i++) {
675
+ var a = r[i];
676
+ if (_t(
677
+ /** @type {Derived} */
678
+ a
679
+ ) && gn(
680
+ /** @type {Derived} */
681
+ a
682
+ ), l && y !== null && !Ue && !((d = a == null ? void 0 : a.reactions) != null && d.includes(e)) && (a.reactions ?? (a.reactions = [])).push(e), a.version > e.version)
683
+ return !0;
684
+ }
685
+ }
686
+ l || ve(e, B);
687
+ }
688
+ return !1;
689
+ }
690
+ function al(e, t) {
691
+ for (var r = t; r !== null; ) {
692
+ if (r.f & Zt)
693
+ try {
694
+ r.fn(e);
695
+ return;
696
+ } catch {
697
+ r.f ^= Zt;
698
+ }
699
+ r = r.parent;
700
+ }
701
+ throw wt = !1, e;
702
+ }
703
+ function ol(e) {
704
+ return (e.f & qe) === 0 && (e.parent === null || (e.parent.f & Zt) === 0);
705
+ }
706
+ function At(e, t, r, l) {
707
+ if (wt) {
708
+ if (r === null && (wt = !1), ol(t))
709
+ throw e;
710
+ return;
711
+ }
712
+ r !== null && (wt = !0);
713
+ {
714
+ al(e, t);
209
715
  return;
210
- const n = pe;
211
- do {
716
+ }
717
+ }
718
+ function Sn(e) {
719
+ var g;
720
+ var t = O, r = q, l = xe, i = R, a = Ue, o = de, d = X, u = e.f;
721
+ O = /** @type {null | Value[]} */
722
+ null, q = 0, xe = null, R = u & (oe | vt) ? null : e, Ue = !je && (u & Ve) !== 0, de = null, X = e.ctx;
723
+ try {
724
+ var f = (
725
+ /** @type {Function} */
726
+ (0, e.fn)()
727
+ ), c = e.deps;
728
+ if (O !== null) {
729
+ var v;
730
+ if (dt(e, q), c !== null && q > 0)
731
+ for (c.length = q + O.length, v = 0; v < O.length; v++)
732
+ c[q + v] = O[v];
733
+ else
734
+ e.deps = c = O;
735
+ if (!Ue)
736
+ for (v = q; v < c.length; v++)
737
+ ((g = c[v]).reactions ?? (g.reactions = [])).push(e);
738
+ } else c !== null && q < c.length && (dt(e, q), c.length = q);
739
+ return f;
740
+ } finally {
741
+ O = t, q = r, xe = l, R = i, Ue = a, de = o, X = d;
742
+ }
743
+ }
744
+ function sl(e, t) {
745
+ let r = t.reactions;
746
+ if (r !== null) {
747
+ var l = r.indexOf(e);
748
+ if (l !== -1) {
749
+ var i = r.length - 1;
750
+ i === 0 ? r = t.reactions = null : (r[l] = r[i], r.pop());
751
+ }
752
+ }
753
+ r === null && t.f & ae && // Destroying a child effect while updating a parent effect can cause a dependency to appear
754
+ // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
755
+ // allows us to skip the expensive work of disconnecting and immediately reconnecting it
756
+ (O === null || !O.includes(t)) && (ve(t, gt), t.f & (Ve | Rt) || (t.f ^= Rt), dt(
757
+ /** @type {Derived} **/
758
+ t,
759
+ 0
760
+ ));
761
+ }
762
+ function dt(e, t) {
763
+ var r = e.deps;
764
+ if (r !== null)
765
+ for (var l = t; l < r.length; l++)
766
+ sl(e, r[l]);
767
+ }
768
+ function Tt(e) {
769
+ var t = e.f;
770
+ if (!(t & qe)) {
771
+ ve(e, B);
772
+ var r = y, l = X;
773
+ y = e;
212
774
  try {
213
- for (; ce < ae.length; ) {
214
- const e = ae[ce];
215
- ce++, ve(e), an(e.$$);
216
- }
775
+ t & Jt ? Ki(e) : yn(e), bn(e), mn(e);
776
+ var i = Sn(e);
777
+ e.teardown = typeof i == "function" ? i : null, e.version = In;
778
+ } catch (a) {
779
+ At(a, e, r, l || e.ctx);
780
+ } finally {
781
+ y = r;
782
+ }
783
+ }
784
+ }
785
+ function Nn() {
786
+ if (Be > 1e3) {
787
+ Be = 0;
788
+ try {
789
+ zi();
217
790
  } catch (e) {
218
- throw ae.length = 0, ce = 0, e;
791
+ if (ct !== null)
792
+ At(e, ct, null);
793
+ else
794
+ throw e;
795
+ }
796
+ }
797
+ Be++;
798
+ }
799
+ function Ln(e) {
800
+ var t = e.length;
801
+ if (t !== 0) {
802
+ Nn();
803
+ var r = je;
804
+ je = !0;
805
+ try {
806
+ for (var l = 0; l < t; l++) {
807
+ var i = e[l];
808
+ i.f & B || (i.f ^= B);
809
+ var a = [];
810
+ An(i, a), ul(a);
811
+ }
812
+ } finally {
813
+ je = r;
814
+ }
815
+ }
816
+ }
817
+ function ul(e) {
818
+ var t = e.length;
819
+ if (t !== 0)
820
+ for (var r = 0; r < t; r++) {
821
+ var l = e[r];
822
+ if (!(l.f & (qe | He)))
823
+ try {
824
+ _t(l) && (Tt(l), l.deps === null && l.first === null && l.nodes_start === null && (l.teardown === null ? pn(l) : l.fn = null));
825
+ } catch (i) {
826
+ At(i, l, null, l.ctx);
827
+ }
828
+ }
829
+ }
830
+ function fl() {
831
+ if (ft = !1, Be > 1001)
832
+ return;
833
+ const e = Le;
834
+ Le = [], Ln(e), ft || (Be = 0, ct = null);
835
+ }
836
+ function Vt(e) {
837
+ Et === Rn && (ft || (ft = !0, queueMicrotask(fl))), ct = e;
838
+ for (var t = e; t.parent !== null; ) {
839
+ t = t.parent;
840
+ var r = t.f;
841
+ if (r & (vt | oe)) {
842
+ if (!(r & B)) return;
843
+ t.f ^= B;
219
844
  }
220
- for (ve(null), ae.length = 0, ce = 0; Ie.length; ) Ie.pop()();
221
- for (let e = 0; e < fe.length; e += 1) {
222
- const t = fe[e];
223
- ze.has(t) || (ze.add(t), t());
845
+ }
846
+ Le.push(t);
847
+ }
848
+ function An(e, t) {
849
+ var r = e.first, l = [];
850
+ e: for (; r !== null; ) {
851
+ var i = r.f, a = (i & oe) !== 0, o = a && (i & B) !== 0, d = r.next;
852
+ if (!o && !(i & He))
853
+ if (i & ht) {
854
+ if (a)
855
+ r.f ^= B;
856
+ else
857
+ try {
858
+ _t(r) && Tt(r);
859
+ } catch (v) {
860
+ At(v, r, null, r.ctx);
861
+ }
862
+ var u = r.first;
863
+ if (u !== null) {
864
+ r = u;
865
+ continue;
866
+ }
867
+ } else i & rn && l.push(r);
868
+ if (d === null) {
869
+ let v = r.parent;
870
+ for (; v !== null; ) {
871
+ if (e === v)
872
+ break e;
873
+ var f = v.next;
874
+ if (f !== null) {
875
+ r = f;
876
+ continue e;
877
+ }
878
+ v = v.parent;
879
+ }
224
880
  }
225
- fe.length = 0;
226
- } while (ae.length);
227
- for (; ot.length; )
228
- ot.pop()();
229
- Ve = !1, ze.clear(), ve(n);
230
- }
231
- function an(n) {
232
- if (n.fragment !== null) {
233
- n.update(), we(n.before_update);
234
- const e = n.dirty;
235
- n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(Se);
236
- }
237
- }
238
- function fn(n) {
239
- const e = [], t = [];
240
- fe.forEach((i) => n.indexOf(i) === -1 ? e.push(i) : t.push(i)), t.forEach((i) => i()), fe = e;
241
- }
242
- const xe = /* @__PURE__ */ new Set();
243
- let un;
244
- function pt(n, e) {
245
- n && n.i && (xe.delete(n), n.i(e));
246
- }
247
- function dn(n, e, t, i) {
248
- if (n && n.o) {
249
- if (xe.has(n)) return;
250
- xe.add(n), un.c.push(() => {
251
- xe.delete(n);
252
- }), n.o(e);
253
- }
254
- }
255
- function hn(n, e, t) {
256
- const { fragment: i, after_update: o } = n.$$;
257
- i && i.m(e, t), Se(() => {
258
- const l = n.$$.on_mount.map(gt).filter(mt);
259
- n.$$.on_destroy ? n.$$.on_destroy.push(...l) : we(l), n.$$.on_mount = [];
260
- }), o.forEach(Se);
261
- }
262
- function gn(n, e) {
263
- const t = n.$$;
264
- t.fragment !== null && (fn(t.after_update), we(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
265
- }
266
- function mn(n, e) {
267
- n.$$.dirty[0] === -1 && (ae.push(n), vt(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
268
- }
269
- function bn(n, e, t, i, o, l, s = null, d = [-1]) {
270
- const h = pe;
271
- ve(n);
272
- const f = n.$$ = {
273
- fragment: null,
274
- ctx: [],
275
- // state
276
- props: l,
277
- update: Ce,
278
- not_equal: o,
279
- bound: rt(),
280
- // lifecycle
281
- on_mount: [],
282
- on_destroy: [],
283
- on_disconnect: [],
284
- before_update: [],
285
- after_update: [],
286
- context: new Map(e.context || (h ? h.$$.context : [])),
287
- // everything else
288
- callbacks: rt(),
289
- dirty: d,
290
- skip_bound: !1,
291
- root: e.target || h.$$.root
881
+ r = d;
882
+ }
883
+ for (var c = 0; c < l.length; c++)
884
+ u = l[c], t.push(u), An(u, t);
885
+ }
886
+ function k(e) {
887
+ var t = Et, r = Le;
888
+ try {
889
+ Nn();
890
+ const i = [];
891
+ Et = rl, Le = i, ft = !1, Ln(r);
892
+ var l = e == null ? void 0 : e();
893
+ return tl(), (Le.length > 0 || i.length > 0) && k(), Be = 0, ct = null, l;
894
+ } finally {
895
+ Et = t, Le = r;
896
+ }
897
+ }
898
+ async function cl() {
899
+ await Promise.resolve(), k();
900
+ }
901
+ function h(e) {
902
+ var c;
903
+ var t = e.f, r = (t & ae) !== 0;
904
+ if (r && t & qe) {
905
+ var l = vn(
906
+ /** @type {Derived} */
907
+ e
908
+ );
909
+ return qt(
910
+ /** @type {Derived} */
911
+ e
912
+ ), l;
913
+ }
914
+ if (R !== null) {
915
+ de !== null && de.includes(e) && Oi();
916
+ var i = R.deps;
917
+ O === null && i !== null && i[q] === e ? q++ : O === null ? O = [e] : O.push(e), xe !== null && y !== null && y.f & B && !(y.f & oe) && xe.includes(e) && (ve(y, Ce), Vt(y));
918
+ } else if (r && /** @type {Derived} */
919
+ e.deps === null)
920
+ for (var a = (
921
+ /** @type {Derived} */
922
+ e
923
+ ), o = a.parent, d = a; o !== null; )
924
+ if (o.f & ae) {
925
+ var u = (
926
+ /** @type {Derived} */
927
+ o
928
+ );
929
+ d = u, o = u.parent;
930
+ } else {
931
+ var f = (
932
+ /** @type {Effect} */
933
+ o
934
+ );
935
+ (c = f.deriveds) != null && c.includes(d) || (f.deriveds ?? (f.deriveds = [])).push(d);
936
+ break;
937
+ }
938
+ return r && (a = /** @type {Derived} */
939
+ e, _t(a) && gn(a)), e.v;
940
+ }
941
+ function Ke(e) {
942
+ const t = R;
943
+ try {
944
+ return R = null, e();
945
+ } finally {
946
+ R = t;
947
+ }
948
+ }
949
+ const dl = ~(Ce | gt | B);
950
+ function ve(e, t) {
951
+ e.f = e.f & dl | t;
952
+ }
953
+ function Tn(e, t = !1, r) {
954
+ X = {
955
+ p: X,
956
+ c: null,
957
+ e: null,
958
+ m: !1,
959
+ s: e,
960
+ x: null,
961
+ l: null
292
962
  };
293
- s && s(f.root);
294
- let I = !1;
295
- if (f.ctx = t ? t(n, e.props || {}, (v, P, ...F) => {
296
- const M = F.length ? F[0] : P;
297
- return f.ctx && o(f.ctx[v], f.ctx[v] = M) && (!f.skip_bound && f.bound[v] && f.bound[v](M), I && mn(n, v)), P;
298
- }) : [], f.update(), I = !0, we(f.before_update), f.fragment = i ? i(f.ctx) : !1, e.target) {
299
- if (e.hydrate) {
300
- const v = tn(e.target);
301
- f.fragment && f.fragment.l(v), v.forEach(W);
963
+ }
964
+ function Vn(e) {
965
+ const t = X;
966
+ if (t !== null) {
967
+ e !== void 0 && (t.x = e);
968
+ const o = t.e;
969
+ if (o !== null) {
970
+ var r = y, l = R;
971
+ t.e = null;
972
+ try {
973
+ for (var i = 0; i < o.length; i++) {
974
+ var a = o[i];
975
+ he(a.effect), Ie(a.reaction), Qt(a.fn);
976
+ }
977
+ } finally {
978
+ he(r), Ie(l);
979
+ }
980
+ }
981
+ X = t.p, t.m = !0;
982
+ }
983
+ return e || /** @type {T} */
984
+ {};
985
+ }
986
+ let Wr = !1;
987
+ function Pn() {
988
+ Wr || (Wr = !0, document.addEventListener(
989
+ "reset",
990
+ (e) => {
991
+ Promise.resolve().then(() => {
992
+ var t;
993
+ if (!e.defaultPrevented)
994
+ for (
995
+ const r of
996
+ /**@type {HTMLFormElement} */
997
+ e.target.elements
998
+ )
999
+ (t = r.__on_r) == null || t.call(r);
1000
+ });
1001
+ },
1002
+ // In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)
1003
+ { capture: !0 }
1004
+ ));
1005
+ }
1006
+ function zn(e) {
1007
+ var t = R, r = y;
1008
+ Ie(null), he(null);
1009
+ try {
1010
+ return e();
1011
+ } finally {
1012
+ Ie(t), he(r);
1013
+ }
1014
+ }
1015
+ function hl(e, t, r, l = r) {
1016
+ e.addEventListener(t, () => zn(r));
1017
+ const i = e.__on_r;
1018
+ i ? e.__on_r = () => {
1019
+ i(), l(!0);
1020
+ } : e.__on_r = () => l(!0), Pn();
1021
+ }
1022
+ const Gn = /* @__PURE__ */ new Set(), Bt = /* @__PURE__ */ new Set();
1023
+ function vl(e, t, r, l) {
1024
+ function i(a) {
1025
+ if (l.capture || st.call(t, a), !a.cancelBubble)
1026
+ return zn(() => r.call(this, a));
1027
+ }
1028
+ return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? rr(() => {
1029
+ t.addEventListener(e, i, l);
1030
+ }) : t.addEventListener(e, i, l), i;
1031
+ }
1032
+ function gl(e, t, r, l, i) {
1033
+ var a = { capture: l, passive: i }, o = vl(e, t, r, a);
1034
+ (t === document.body || t === window || t === document) && Ji(() => {
1035
+ t.removeEventListener(e, o, a);
1036
+ });
1037
+ }
1038
+ function _l(e) {
1039
+ for (var t = 0; t < e.length; t++)
1040
+ Gn.add(e[t]);
1041
+ for (var r of Bt)
1042
+ r(e);
1043
+ }
1044
+ function st(e) {
1045
+ var D;
1046
+ var t = this, r = (
1047
+ /** @type {Node} */
1048
+ t.ownerDocument
1049
+ ), l = e.type, i = ((D = e.composedPath) == null ? void 0 : D.call(e)) || [], a = (
1050
+ /** @type {null | Element} */
1051
+ i[0] || e.target
1052
+ ), o = 0, d = e.__root;
1053
+ if (d) {
1054
+ var u = i.indexOf(d);
1055
+ if (u !== -1 && (t === document || t === /** @type {any} */
1056
+ window)) {
1057
+ e.__root = t;
1058
+ return;
1059
+ }
1060
+ var f = i.indexOf(t);
1061
+ if (f === -1)
1062
+ return;
1063
+ u <= f && (o = u);
1064
+ }
1065
+ if (a = /** @type {Element} */
1066
+ i[o] || e.target, a !== t) {
1067
+ Ct(e, "currentTarget", {
1068
+ configurable: !0,
1069
+ get() {
1070
+ return a || r;
1071
+ }
1072
+ });
1073
+ var c = R, v = y;
1074
+ Ie(null), he(null);
1075
+ try {
1076
+ for (var g, m = []; a !== null; ) {
1077
+ var p = a.assignedSlot || a.parentNode || /** @type {any} */
1078
+ a.host || null;
1079
+ try {
1080
+ var L = a["__" + l];
1081
+ if (L !== void 0 && !/** @type {any} */
1082
+ a.disabled)
1083
+ if (en(L)) {
1084
+ var [G, ...Q] = L;
1085
+ G.apply(a, [e, ...Q]);
1086
+ } else
1087
+ L.call(a, e);
1088
+ } catch (Z) {
1089
+ g ? m.push(Z) : g = Z;
1090
+ }
1091
+ if (e.cancelBubble || p === t || p === null)
1092
+ break;
1093
+ a = p;
1094
+ }
1095
+ if (g) {
1096
+ for (let Z of m)
1097
+ queueMicrotask(() => {
1098
+ throw Z;
1099
+ });
1100
+ throw g;
1101
+ }
1102
+ } finally {
1103
+ e.__root = t, delete e.currentTarget, Ie(c), he(v);
1104
+ }
1105
+ }
1106
+ }
1107
+ function Dn(e) {
1108
+ var t = document.createElement("template");
1109
+ return t.innerHTML = e, t.content;
1110
+ }
1111
+ function ke(e, t) {
1112
+ var r = (
1113
+ /** @type {Effect} */
1114
+ y
1115
+ );
1116
+ r.nodes_start === null && (r.nodes_start = e, r.nodes_end = t);
1117
+ }
1118
+ // @__NO_SIDE_EFFECTS__
1119
+ function se(e, t) {
1120
+ var r = (t & xi) !== 0, l = (t & ki) !== 0, i, a = !e.startsWith("<!>");
1121
+ return () => {
1122
+ if (z)
1123
+ return ke(P, null), P;
1124
+ i === void 0 && (i = Dn(a ? e : "<!>" + e), r || (i = /** @type {Node} */
1125
+ /* @__PURE__ */ Te(i)));
1126
+ var o = (
1127
+ /** @type {TemplateNode} */
1128
+ l ? document.importNode(i, !0) : i.cloneNode(!0)
1129
+ );
1130
+ if (r) {
1131
+ var d = (
1132
+ /** @type {TemplateNode} */
1133
+ /* @__PURE__ */ Te(o)
1134
+ ), u = (
1135
+ /** @type {TemplateNode} */
1136
+ o.lastChild
1137
+ );
1138
+ ke(d, u);
302
1139
  } else
303
- f.fragment && f.fragment.c();
304
- e.intro && pt(n.$$.fragment), hn(n, e.target, e.anchor), w();
1140
+ ke(o, o);
1141
+ return o;
1142
+ };
1143
+ }
1144
+ function ml() {
1145
+ if (z)
1146
+ return ke(P, null), P;
1147
+ var e = document.createDocumentFragment(), t = document.createComment(""), r = Lt();
1148
+ return e.append(t, r), ke(t, r), e;
1149
+ }
1150
+ function K(e, t) {
1151
+ if (z) {
1152
+ y.nodes_end = P, Je();
1153
+ return;
1154
+ }
1155
+ e !== null && e.before(
1156
+ /** @type {Node} */
1157
+ t
1158
+ );
1159
+ }
1160
+ const bl = ["touchstart", "touchmove"];
1161
+ function yl(e) {
1162
+ return bl.includes(e);
1163
+ }
1164
+ function Yn(e, t) {
1165
+ return Fn(e, t);
1166
+ }
1167
+ function pl(e, t) {
1168
+ Wt(), t.intro = t.intro ?? !1;
1169
+ const r = t.target, l = z, i = P;
1170
+ try {
1171
+ for (var a = (
1172
+ /** @type {TemplateNode} */
1173
+ /* @__PURE__ */ Te(r)
1174
+ ); a && (a.nodeType !== 8 || /** @type {Comment} */
1175
+ a.data !== Jr); )
1176
+ a = /** @type {TemplateNode} */
1177
+ /* @__PURE__ */ $e(a);
1178
+ if (!a)
1179
+ throw Me;
1180
+ We(!0), Re(
1181
+ /** @type {Comment} */
1182
+ a
1183
+ ), Je();
1184
+ const o = Fn(e, { ...t, anchor: a });
1185
+ if (P === null || P.nodeType !== 8 || /** @type {Comment} */
1186
+ P.data !== qr)
1187
+ throw Nt(), Me;
1188
+ return We(!1), /** @type {Exports} */
1189
+ o;
1190
+ } catch (o) {
1191
+ if (o === Me)
1192
+ return t.recover === !1 && Gi(), Wt(), Mi(r), We(!1), Yn(e, t);
1193
+ throw o;
1194
+ } finally {
1195
+ We(l), Re(i);
1196
+ }
1197
+ }
1198
+ const Xe = /* @__PURE__ */ new Map();
1199
+ function Fn(e, { target: t, anchor: r, props: l = {}, events: i, context: a, intro: o = !0 }) {
1200
+ Wt();
1201
+ var d = /* @__PURE__ */ new Set(), u = (v) => {
1202
+ for (var g = 0; g < v.length; g++) {
1203
+ var m = v[g];
1204
+ if (!d.has(m)) {
1205
+ d.add(m);
1206
+ var p = yl(m);
1207
+ t.addEventListener(m, st, { passive: p });
1208
+ var L = Xe.get(m);
1209
+ L === void 0 ? (document.addEventListener(m, st, { passive: p }), Xe.set(m, 1)) : Xe.set(m, L + 1);
1210
+ }
1211
+ }
1212
+ };
1213
+ u(Ci(Gn)), Bt.add(u);
1214
+ var f = void 0, c = _n(() => {
1215
+ var v = r ?? t.appendChild(Lt());
1216
+ return It(() => {
1217
+ if (a) {
1218
+ Tn({});
1219
+ var g = (
1220
+ /** @type {ComponentContext} */
1221
+ X
1222
+ );
1223
+ g.c = a;
1224
+ }
1225
+ i && (l.$$events = i), z && ke(
1226
+ /** @type {TemplateNode} */
1227
+ v,
1228
+ null
1229
+ ), f = e(v, l) || {}, z && (y.nodes_end = P), a && Vn();
1230
+ }), () => {
1231
+ var p;
1232
+ for (var g of d) {
1233
+ t.removeEventListener(g, st);
1234
+ var m = (
1235
+ /** @type {number} */
1236
+ Xe.get(g)
1237
+ );
1238
+ --m === 0 ? (document.removeEventListener(g, st), Xe.delete(g)) : Xe.set(g, m);
1239
+ }
1240
+ Bt.delete(u), Ht.delete(f), v !== r && ((p = v.parentNode) == null || p.removeChild(v));
1241
+ };
1242
+ });
1243
+ return Ht.set(f, c), f;
1244
+ }
1245
+ let Ht = /* @__PURE__ */ new WeakMap();
1246
+ function wl(e) {
1247
+ const t = Ht.get(e);
1248
+ t && t();
1249
+ }
1250
+ function Ee(e, t, r = !1) {
1251
+ z && Je();
1252
+ var l = e, i = null, a = null, o = j, d = r ? Kt : 0, u = !1;
1253
+ const f = (v, g = !0) => {
1254
+ u = !0, c(g, v);
1255
+ }, c = (v, g) => {
1256
+ if (o === (o = v)) return;
1257
+ let m = !1;
1258
+ if (z) {
1259
+ const p = (
1260
+ /** @type {Comment} */
1261
+ l.data === Kr
1262
+ );
1263
+ !!o === p && (l = Ui(), Re(l), We(!1), m = !0);
1264
+ }
1265
+ o ? (i ? Or(i) : g && (i = It(() => g(l))), a && Fr(a, () => {
1266
+ a = null;
1267
+ })) : (a ? Or(a) : g && (a = It(() => g(l))), i && Fr(i, () => {
1268
+ i = null;
1269
+ })), m && We(!0);
1270
+ };
1271
+ tr(() => {
1272
+ u = !1, t(f), u || c(null, null);
1273
+ }, d), z && (l = P);
1274
+ }
1275
+ function Ze(e, t, r, l, i) {
1276
+ var a = e, o = "", d;
1277
+ tr(() => {
1278
+ if (o === (o = t() ?? "")) {
1279
+ z && Je();
1280
+ return;
1281
+ }
1282
+ d !== void 0 && (Pe(d), d = void 0), o !== "" && (d = It(() => {
1283
+ if (z) {
1284
+ P.data;
1285
+ for (var u = Je(), f = u; u !== null && (u.nodeType !== 8 || /** @type {Comment} */
1286
+ u.data !== ""); )
1287
+ f = u, u = /** @type {TemplateNode} */
1288
+ /* @__PURE__ */ $e(u);
1289
+ if (u === null)
1290
+ throw Nt(), Me;
1291
+ ke(P, f), a = Re(u);
1292
+ return;
1293
+ }
1294
+ var c = o + "", v = Dn(c);
1295
+ ke(
1296
+ /** @type {TemplateNode} */
1297
+ /* @__PURE__ */ Te(v),
1298
+ /** @type {TemplateNode} */
1299
+ v.lastChild
1300
+ ), a.before(v);
1301
+ }));
1302
+ });
1303
+ }
1304
+ function El(e, t, r, l, i) {
1305
+ var d;
1306
+ z && Je();
1307
+ var a = (d = t.$$slots) == null ? void 0 : d[r], o = !1;
1308
+ a === !0 && (a = t.children, o = !0), a === void 0 || a(e, o ? () => l : l);
1309
+ }
1310
+ function xl(e, t) {
1311
+ rr(() => {
1312
+ var r = e.getRootNode(), l = (
1313
+ /** @type {ShadowRoot} */
1314
+ r.host ? (
1315
+ /** @type {ShadowRoot} */
1316
+ r
1317
+ ) : (
1318
+ /** @type {Document} */
1319
+ r.head ?? /** @type {Document} */
1320
+ r.ownerDocument.head
1321
+ )
1322
+ );
1323
+ if (!l.querySelector("#" + t.hash)) {
1324
+ const i = document.createElement("style");
1325
+ i.id = t.hash, i.textContent = t.code, l.appendChild(i);
1326
+ }
1327
+ });
1328
+ }
1329
+ function Ur(e) {
1330
+ if (z) {
1331
+ var t = !1, r = () => {
1332
+ if (!t) {
1333
+ if (t = !0, e.hasAttribute("value")) {
1334
+ var l = e.value;
1335
+ ie(e, "value", null), e.value = l;
1336
+ }
1337
+ if (e.hasAttribute("checked")) {
1338
+ var i = e.checked;
1339
+ ie(e, "checked", null), e.checked = i;
1340
+ }
1341
+ }
1342
+ };
1343
+ e.__on_r = r, el(r), Pn();
1344
+ }
1345
+ }
1346
+ function kl(e, t) {
1347
+ var r = e.__attributes ?? (e.__attributes = {});
1348
+ r.value === (r.value = // treat null and undefined the same for the initial value
1349
+ t ?? void 0) || // @ts-expect-error
1350
+ // `progress` elements always need their value set when its `0`
1351
+ e.value === t && (t !== 0 || e.nodeName !== "PROGRESS") || (e.value = t);
1352
+ }
1353
+ function ie(e, t, r, l) {
1354
+ var i = e.__attributes ?? (e.__attributes = {});
1355
+ z && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || i[t] !== (i[t] = r) && (t === "style" && "__styles" in e && (e.__styles = {}), t === "loading" && (e[Li] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Cl(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
1356
+ }
1357
+ var Mr = /* @__PURE__ */ new Map();
1358
+ function Cl(e) {
1359
+ var t = Mr.get(e.nodeName);
1360
+ if (t) return t;
1361
+ Mr.set(e.nodeName, t = []);
1362
+ for (var r, l = Xt(e), i = Element.prototype; i !== l; ) {
1363
+ r = Ri(l);
1364
+ for (var a in r)
1365
+ r[a].set && t.push(a);
1366
+ l = Xt(l);
1367
+ }
1368
+ return t;
1369
+ }
1370
+ function Rl(e, t, r) {
1371
+ if (r) {
1372
+ if (e.classList.contains(t)) return;
1373
+ e.classList.add(t);
1374
+ } else {
1375
+ if (!e.classList.contains(t)) return;
1376
+ e.classList.remove(t);
1377
+ }
1378
+ }
1379
+ function Il(e, t, r = t) {
1380
+ hl(e, "change", (l) => {
1381
+ var i = l ? e.defaultChecked : e.checked;
1382
+ r(i);
1383
+ }), // If we are hydrating and the value has since changed,
1384
+ // then use the update value from the input instead.
1385
+ (z && e.defaultChecked !== e.checked || // If defaultChecked is set, then checked == defaultChecked
1386
+ Ke(t) == null) && r(e.checked), er(() => {
1387
+ var l = t();
1388
+ e.checked = !!l;
1389
+ });
1390
+ }
1391
+ function jr(e, t) {
1392
+ return e === t || (e == null ? void 0 : e[ut]) === t;
1393
+ }
1394
+ function Br(e = {}, t, r, l) {
1395
+ return Qt(() => {
1396
+ var i, a;
1397
+ return er(() => {
1398
+ i = a, a = [], Ke(() => {
1399
+ e !== r(...a) && (t(e, ...a), i && jr(r(...i), e) && t(null, ...i));
1400
+ });
1401
+ }), () => {
1402
+ rr(() => {
1403
+ a && jr(r(...a), e) && t(null, ...a);
1404
+ });
1405
+ };
1406
+ }), e;
1407
+ }
1408
+ function On(e) {
1409
+ X === null && Cn(), Ut(() => {
1410
+ const t = Ke(e);
1411
+ if (typeof t == "function") return (
1412
+ /** @type {() => void} */
1413
+ t
1414
+ );
1415
+ });
1416
+ }
1417
+ function $l(e) {
1418
+ X === null && Cn(), On(() => () => Ke(e));
1419
+ }
1420
+ let pt = !1;
1421
+ function Sl(e) {
1422
+ var t = pt;
1423
+ try {
1424
+ return pt = !1, [e(), pt];
1425
+ } finally {
1426
+ pt = t;
305
1427
  }
306
- ve(h);
307
1428
  }
308
- let wt;
309
- typeof HTMLElement == "function" && (wt = class extends HTMLElement {
310
- constructor(e, t, i) {
1429
+ function Nl(e) {
1430
+ for (var t = y, r = y; t !== null && !(t.f & (oe | vt)); )
1431
+ t = t.parent;
1432
+ try {
1433
+ return he(t), e();
1434
+ } finally {
1435
+ he(r);
1436
+ }
1437
+ }
1438
+ function N(e, t, r, l) {
1439
+ var ye;
1440
+ var i = (r & yi) !== 0, a = !sn, o = (r & wi) !== 0, d = (r & Ei) !== 0, u = !1, f;
1441
+ o ? [f, u] = Sl(() => (
1442
+ /** @type {V} */
1443
+ e[t]
1444
+ )) : f = /** @type {V} */
1445
+ e[t];
1446
+ var c = ut in e || ln in e, v = ((ye = Ae(e, t)) == null ? void 0 : ye.set) ?? (c && o && t in e ? (I) => e[t] = I : void 0), g = (
1447
+ /** @type {V} */
1448
+ l
1449
+ ), m = !0, p = !1, L = () => (p = !0, m && (m = !1, d ? g = Ke(
1450
+ /** @type {() => V} */
1451
+ l
1452
+ ) : g = /** @type {V} */
1453
+ l), g);
1454
+ f === void 0 && l !== void 0 && (v && a && Di(), f = L(), v && v(f));
1455
+ var G;
1456
+ if (G = () => {
1457
+ var I = (
1458
+ /** @type {V} */
1459
+ e[t]
1460
+ );
1461
+ return I === void 0 ? L() : (m = !0, p = !1, I);
1462
+ }, !(r & pi))
1463
+ return G;
1464
+ if (v) {
1465
+ var Q = e.$$legacy;
1466
+ return function(I, W) {
1467
+ return arguments.length > 0 ? ((!W || Q || u) && v(W ? G() : I), I) : G();
1468
+ };
1469
+ }
1470
+ var D = !1, Z = !1, ge = /* @__PURE__ */ un(f), F = Nl(
1471
+ () => /* @__PURE__ */ ot(() => {
1472
+ var I = G(), W = h(ge);
1473
+ return D ? (D = !1, Z = !0, W) : (Z = !1, ge.v = I);
1474
+ })
1475
+ );
1476
+ return i || (F.equals = on), function(I, W) {
1477
+ if (arguments.length > 0) {
1478
+ const ue = W ? h(F) : o ? le(I) : I;
1479
+ return F.equals(ue) || (D = !0, V(ge, ue), p && g !== void 0 && (g = ue), Ke(() => h(F))), I;
1480
+ }
1481
+ return h(F);
1482
+ };
1483
+ }
1484
+ function Ll(e) {
1485
+ return new Al(e);
1486
+ }
1487
+ var be, te;
1488
+ class Al {
1489
+ /**
1490
+ * @param {ComponentConstructorOptions & {
1491
+ * component: any;
1492
+ * }} options
1493
+ */
1494
+ constructor(t) {
1495
+ /** @type {any} */
1496
+ Yt(this, be);
1497
+ /** @type {Record<string, any>} */
1498
+ Yt(this, te);
1499
+ var a;
1500
+ var r = /* @__PURE__ */ new Map(), l = (o, d) => {
1501
+ var u = /* @__PURE__ */ un(d);
1502
+ return r.set(o, u), u;
1503
+ };
1504
+ const i = new Proxy(
1505
+ { ...t.props || {}, $$events: {} },
1506
+ {
1507
+ get(o, d) {
1508
+ return h(r.get(d) ?? l(d, Reflect.get(o, d)));
1509
+ },
1510
+ has(o, d) {
1511
+ return d === ln ? !0 : (h(r.get(d) ?? l(d, Reflect.get(o, d))), Reflect.has(o, d));
1512
+ },
1513
+ set(o, d, u) {
1514
+ return V(r.get(d) ?? l(d, u), u), Reflect.set(o, d, u);
1515
+ }
1516
+ }
1517
+ );
1518
+ Ft(this, te, (t.hydrate ? pl : Yn)(t.component, {
1519
+ target: t.target,
1520
+ anchor: t.anchor,
1521
+ props: i,
1522
+ context: t.context,
1523
+ intro: t.intro ?? !1,
1524
+ recover: t.recover
1525
+ })), (!((a = t == null ? void 0 : t.props) != null && a.$$host) || t.sync === !1) && k(), Ft(this, be, i.$$events);
1526
+ for (const o of Object.keys(M(this, te)))
1527
+ o === "$set" || o === "$destroy" || o === "$on" || Ct(this, o, {
1528
+ get() {
1529
+ return M(this, te)[o];
1530
+ },
1531
+ /** @param {any} value */
1532
+ set(d) {
1533
+ M(this, te)[o] = d;
1534
+ },
1535
+ enumerable: !0
1536
+ });
1537
+ M(this, te).$set = /** @param {Record<string, any>} next */
1538
+ (o) => {
1539
+ Object.assign(i, o);
1540
+ }, M(this, te).$destroy = () => {
1541
+ wl(M(this, te));
1542
+ };
1543
+ }
1544
+ /** @param {Record<string, any>} props */
1545
+ $set(t) {
1546
+ M(this, te).$set(t);
1547
+ }
1548
+ /**
1549
+ * @param {string} event
1550
+ * @param {(...args: any[]) => any} callback
1551
+ * @returns {any}
1552
+ */
1553
+ $on(t, r) {
1554
+ M(this, be)[t] = M(this, be)[t] || [];
1555
+ const l = (...i) => r.call(this, ...i);
1556
+ return M(this, be)[t].push(l), () => {
1557
+ M(this, be)[t] = M(this, be)[t].filter(
1558
+ /** @param {any} fn */
1559
+ (i) => i !== l
1560
+ );
1561
+ };
1562
+ }
1563
+ $destroy() {
1564
+ M(this, te).$destroy();
1565
+ }
1566
+ }
1567
+ be = new WeakMap(), te = new WeakMap();
1568
+ let Xn;
1569
+ typeof HTMLElement == "function" && (Xn = class extends HTMLElement {
1570
+ /**
1571
+ * @param {*} $$componentCtor
1572
+ * @param {*} $$slots
1573
+ * @param {*} use_shadow_dom
1574
+ */
1575
+ constructor(t, r, l) {
311
1576
  super();
312
1577
  /** The Svelte component constructor */
313
- B(this, "$$ctor");
1578
+ ne(this, "$$ctor");
314
1579
  /** Slots */
315
- B(this, "$$s");
316
- /** The Svelte component instance */
317
- B(this, "$$c");
1580
+ ne(this, "$$s");
1581
+ /** @type {any} The Svelte component instance */
1582
+ ne(this, "$$c");
318
1583
  /** Whether or not the custom element is connected */
319
- B(this, "$$cn", !1);
320
- /** Component props data */
321
- B(this, "$$d", {});
1584
+ ne(this, "$$cn", !1);
1585
+ /** @type {Record<string, any>} Component props data */
1586
+ ne(this, "$$d", {});
322
1587
  /** `true` if currently in the process of reflecting component props back to attributes */
323
- B(this, "$$r", !1);
1588
+ ne(this, "$$r", !1);
324
1589
  /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
325
- B(this, "$$p_d", {});
326
- /** @type {Record<string, Function[]>} Event listeners */
327
- B(this, "$$l", {});
328
- /** @type {Map<Function, Function>} Event listener unsubscribe functions */
329
- B(this, "$$l_u", /* @__PURE__ */ new Map());
330
- this.$$ctor = e, this.$$s = t, i && this.attachShadow({ mode: "open" });
331
- }
332
- addEventListener(e, t, i) {
333
- if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
334
- const o = this.$$c.$on(e, t);
335
- this.$$l_u.set(t, o);
336
- }
337
- super.addEventListener(e, t, i);
1590
+ ne(this, "$$p_d", {});
1591
+ /** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
1592
+ ne(this, "$$l", {});
1593
+ /** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
1594
+ ne(this, "$$l_u", /* @__PURE__ */ new Map());
1595
+ /** @type {any} The managed render effect for reflecting attributes */
1596
+ ne(this, "$$me");
1597
+ this.$$ctor = t, this.$$s = r, l && this.attachShadow({ mode: "open" });
338
1598
  }
339
- removeEventListener(e, t, i) {
340
- if (super.removeEventListener(e, t, i), this.$$c) {
341
- const o = this.$$l_u.get(t);
342
- o && (o(), this.$$l_u.delete(t));
1599
+ /**
1600
+ * @param {string} type
1601
+ * @param {EventListenerOrEventListenerObject} listener
1602
+ * @param {boolean | AddEventListenerOptions} [options]
1603
+ */
1604
+ addEventListener(t, r, l) {
1605
+ if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(r), this.$$c) {
1606
+ const i = this.$$c.$on(t, r);
1607
+ this.$$l_u.set(r, i);
343
1608
  }
344
- if (this.$$l[e]) {
345
- const o = this.$$l[e].indexOf(t);
346
- o >= 0 && this.$$l[e].splice(o, 1);
1609
+ super.addEventListener(t, r, l);
1610
+ }
1611
+ /**
1612
+ * @param {string} type
1613
+ * @param {EventListenerOrEventListenerObject} listener
1614
+ * @param {boolean | AddEventListenerOptions} [options]
1615
+ */
1616
+ removeEventListener(t, r, l) {
1617
+ if (super.removeEventListener(t, r, l), this.$$c) {
1618
+ const i = this.$$l_u.get(r);
1619
+ i && (i(), this.$$l_u.delete(r));
347
1620
  }
348
1621
  }
349
1622
  async connectedCallback() {
350
1623
  if (this.$$cn = !0, !this.$$c) {
351
- let e = function(l) {
352
- return () => {
353
- let s;
354
- return {
355
- c: function() {
356
- s = A("slot"), l !== "default" && a(s, "name", l);
357
- },
358
- /**
359
- * @param {HTMLElement} target
360
- * @param {HTMLElement} [anchor]
361
- */
362
- m: function(f, I) {
363
- T(f, s, I);
364
- },
365
- d: function(f) {
366
- f && W(s);
367
- }
368
- };
1624
+ let t = function(i) {
1625
+ return (a) => {
1626
+ const o = document.createElement("slot");
1627
+ i !== "default" && (o.name = i), K(a, o);
369
1628
  };
370
1629
  };
371
1630
  if (await Promise.resolve(), !this.$$cn || this.$$c)
372
1631
  return;
373
- const t = {}, i = rn(this);
374
- for (const l of this.$$s)
375
- l in i && (t[l] = [e(l)]);
376
- for (const l of this.attributes) {
377
- const s = this.$$g_p(l.name);
378
- s in this.$$d || (this.$$d[s] = Ee(s, l.value, this.$$p_d, "toProp"));
1632
+ const r = {}, l = Tl(this);
1633
+ for (const i of this.$$s)
1634
+ i in l && (i === "default" && !this.$$d.children ? (this.$$d.children = t(i), r.default = !0) : r[i] = t(i));
1635
+ for (const i of this.attributes) {
1636
+ const a = this.$$g_p(i.name);
1637
+ a in this.$$d || (this.$$d[a] = xt(a, i.value, this.$$p_d, "toProp"));
379
1638
  }
380
- for (const l in this.$$p_d)
381
- !(l in this.$$d) && this[l] !== void 0 && (this.$$d[l] = this[l], delete this[l]);
382
- this.$$c = new this.$$ctor({
1639
+ for (const i in this.$$p_d)
1640
+ !(i in this.$$d) && this[i] !== void 0 && (this.$$d[i] = this[i], delete this[i]);
1641
+ this.$$c = Ll({
1642
+ component: this.$$ctor,
383
1643
  target: this.shadowRoot || this,
384
1644
  props: {
385
1645
  ...this.$$d,
386
- $$slots: t,
387
- $$scope: {
388
- ctx: []
389
- }
1646
+ $$slots: r,
1647
+ $$host: this
390
1648
  }
391
- });
392
- const o = () => {
393
- this.$$r = !0;
394
- for (const l in this.$$p_d)
395
- if (this.$$d[l] = this.$$c.$$.ctx[this.$$c.$$.props[l]], this.$$p_d[l].reflect) {
396
- const s = Ee(
397
- l,
398
- this.$$d[l],
1649
+ }), this.$$me = _n(() => {
1650
+ er(() => {
1651
+ var i;
1652
+ this.$$r = !0;
1653
+ for (const a of kt(this.$$c)) {
1654
+ if (!((i = this.$$p_d[a]) != null && i.reflect)) continue;
1655
+ this.$$d[a] = this.$$c[a];
1656
+ const o = xt(
1657
+ a,
1658
+ this.$$d[a],
399
1659
  this.$$p_d,
400
1660
  "toAttribute"
401
1661
  );
402
- s == null ? this.removeAttribute(this.$$p_d[l].attribute || l) : this.setAttribute(this.$$p_d[l].attribute || l, s);
1662
+ o == null ? this.removeAttribute(this.$$p_d[a].attribute || a) : this.setAttribute(this.$$p_d[a].attribute || a, o);
403
1663
  }
404
- this.$$r = !1;
405
- };
406
- this.$$c.$$.after_update.push(o), o();
407
- for (const l in this.$$l)
408
- for (const s of this.$$l[l]) {
409
- const d = this.$$c.$on(l, s);
410
- this.$$l_u.set(s, d);
1664
+ this.$$r = !1;
1665
+ });
1666
+ });
1667
+ for (const i in this.$$l)
1668
+ for (const a of this.$$l[i]) {
1669
+ const o = this.$$c.$on(i, a);
1670
+ this.$$l_u.set(a, o);
411
1671
  }
412
1672
  this.$$l = {};
413
1673
  }
414
1674
  }
415
1675
  // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
416
1676
  // and setting attributes through setAttribute etc, this is helpful
417
- attributeChangedCallback(e, t, i) {
418
- var o;
419
- this.$$r || (e = this.$$g_p(e), this.$$d[e] = Ee(e, i, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [e]: this.$$d[e] }));
1677
+ /**
1678
+ * @param {string} attr
1679
+ * @param {string} _oldValue
1680
+ * @param {string} newValue
1681
+ */
1682
+ attributeChangedCallback(t, r, l) {
1683
+ var i;
1684
+ this.$$r || (t = this.$$g_p(t), this.$$d[t] = xt(t, l, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] }));
420
1685
  }
421
1686
  disconnectedCallback() {
422
1687
  this.$$cn = !1, Promise.resolve().then(() => {
423
- !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$c = void 0);
1688
+ !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
424
1689
  });
425
1690
  }
426
- $$g_p(e) {
427
- return Object.keys(this.$$p_d).find(
428
- (t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e
429
- ) || e;
1691
+ /**
1692
+ * @param {string} attribute_name
1693
+ */
1694
+ $$g_p(t) {
1695
+ return kt(this.$$p_d).find(
1696
+ (r) => this.$$p_d[r].attribute === t || !this.$$p_d[r].attribute && r.toLowerCase() === t
1697
+ ) || t;
430
1698
  }
431
1699
  });
432
- function Ee(n, e, t, i) {
433
- var l;
434
- const o = (l = t[n]) == null ? void 0 : l.type;
435
- if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !i || !t[n])
436
- return e;
437
- if (i === "toAttribute")
438
- switch (o) {
1700
+ function xt(e, t, r, l) {
1701
+ var a;
1702
+ const i = (a = r[e]) == null ? void 0 : a.type;
1703
+ if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !l || !r[e])
1704
+ return t;
1705
+ if (l === "toAttribute")
1706
+ switch (i) {
439
1707
  case "Object":
440
1708
  case "Array":
441
- return e == null ? null : JSON.stringify(e);
1709
+ return t == null ? null : JSON.stringify(t);
442
1710
  case "Boolean":
443
- return e ? "" : null;
1711
+ return t ? "" : null;
444
1712
  case "Number":
445
- return e ?? null;
1713
+ return t ?? null;
446
1714
  default:
447
- return e;
1715
+ return t;
448
1716
  }
449
1717
  else
450
- switch (o) {
1718
+ switch (i) {
451
1719
  case "Object":
452
1720
  case "Array":
453
- return e && JSON.parse(e);
1721
+ return t && JSON.parse(t);
454
1722
  case "Boolean":
455
- return e;
1723
+ return t;
456
1724
  case "Number":
457
- return e != null ? +e : e;
1725
+ return t != null ? +t : t;
458
1726
  default:
459
- return e;
1727
+ return t;
460
1728
  }
461
1729
  }
462
- function yn(n, e, t, i, o, l) {
463
- let s = class extends wt {
1730
+ function Tl(e) {
1731
+ const t = {};
1732
+ return e.childNodes.forEach((r) => {
1733
+ t[
1734
+ /** @type {Element} node */
1735
+ r.slot || "default"
1736
+ ] = !0;
1737
+ }), t;
1738
+ }
1739
+ function Vl(e, t, r, l, i, a) {
1740
+ let o = class extends Xn {
464
1741
  constructor() {
465
- super(n, t, o), this.$$p_d = e;
1742
+ super(e, r, i), this.$$p_d = t;
466
1743
  }
467
1744
  static get observedAttributes() {
468
- return Object.keys(e).map(
469
- (d) => (e[d].attribute || d).toLowerCase()
1745
+ return kt(t).map(
1746
+ (d) => (t[d].attribute || d).toLowerCase()
470
1747
  );
471
1748
  }
472
1749
  };
473
- return Object.keys(e).forEach((d) => {
474
- Object.defineProperty(s.prototype, d, {
1750
+ return kt(t).forEach((d) => {
1751
+ Ct(o.prototype, d, {
475
1752
  get() {
476
1753
  return this.$$c && d in this.$$c ? this.$$c[d] : this.$$d[d];
477
- },
478
- set(h) {
479
- var f;
480
- h = Ee(d, h, e), this.$$d[d] = h, (f = this.$$c) == null || f.$set({ [d]: h });
481
- }
482
- });
483
- }), i.forEach((d) => {
484
- Object.defineProperty(s.prototype, d, {
485
- get() {
486
- var h;
487
- return (h = this.$$c) == null ? void 0 : h[d];
488
- }
489
- });
490
- }), n.element = /** @type {any} */
491
- s, s;
492
- }
493
- class vn {
494
- constructor() {
495
- /**
496
- * ### PRIVATE API
497
- *
498
- * Do not use, may change at any time
499
- *
500
- * @type {any}
501
- */
502
- B(this, "$$");
503
- /**
504
- * ### PRIVATE API
505
- *
506
- * Do not use, may change at any time
507
- *
508
- * @type {any}
509
- */
510
- B(this, "$$set");
511
- }
512
- /** @returns {void} */
513
- $destroy() {
514
- gn(this, 1), this.$destroy = Ce;
515
- }
516
- /**
517
- * @template {Extract<keyof Events, string>} K
518
- * @param {K} type
519
- * @param {((e: Events[K]) => void) | null | undefined} callback
520
- * @returns {() => void}
521
- */
522
- $on(e, t) {
523
- if (!mt(t))
524
- return Ce;
525
- const i = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
526
- return i.push(t), () => {
527
- const o = i.indexOf(t);
528
- o !== -1 && i.splice(o, 1);
529
- };
530
- }
531
- /**
532
- * @param {Partial<Props>} props
533
- * @returns {void}
534
- */
535
- $set(e) {
536
- this.$$set && !Bt(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
537
- }
1754
+ },
1755
+ set(u) {
1756
+ var v;
1757
+ u = xt(d, u, t), this.$$d[d] = u;
1758
+ var f = this.$$c;
1759
+ if (f) {
1760
+ var c = (v = Ae(f, d)) == null ? void 0 : v.get;
1761
+ c ? f[d] = u : f.$set({ [d]: u });
1762
+ }
1763
+ }
1764
+ });
1765
+ }), l.forEach((d) => {
1766
+ Ct(o.prototype, d, {
1767
+ get() {
1768
+ var u;
1769
+ return (u = this.$$c) == null ? void 0 : u[d];
1770
+ }
1771
+ });
1772
+ }), e.element = /** @type {any} */
1773
+ o, o;
538
1774
  }
539
- const pn = "4";
540
- typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(pn);
541
- const _t = new TextEncoder();
542
- function wn(n) {
543
- return [...new Uint8Array(n)].map((e) => e.toString(16).padStart(2, "0")).join("");
1775
+ const Zn = new TextEncoder();
1776
+ function Pl(e) {
1777
+ return [...new Uint8Array(e)].map((t) => t.toString(16).padStart(2, "0")).join("");
544
1778
  }
545
- async function _n(n, e = "SHA-256", t = 1e5) {
546
- const i = Date.now().toString(16);
547
- n || (n = Math.round(Math.random() * t));
548
- const o = await kt(i, n, e);
1779
+ async function zl(e, t = "SHA-256", r = 1e5) {
1780
+ const l = Date.now().toString(16);
1781
+ e || (e = Math.round(Math.random() * r));
1782
+ const i = await Wn(l, e, t);
549
1783
  return {
550
- algorithm: e,
551
- challenge: o,
552
- salt: i,
1784
+ algorithm: t,
1785
+ challenge: i,
1786
+ salt: l,
553
1787
  signature: ""
554
1788
  };
555
1789
  }
556
- async function kt(n, e, t) {
1790
+ async function Wn(e, t, r) {
557
1791
  if (typeof crypto > "u" || !("subtle" in crypto) || !("digest" in crypto.subtle))
558
1792
  throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");
559
- return wn(
1793
+ return Pl(
560
1794
  await crypto.subtle.digest(
561
- t.toUpperCase(),
562
- _t.encode(n + e)
1795
+ r.toUpperCase(),
1796
+ Zn.encode(e + t)
563
1797
  )
564
1798
  );
565
1799
  }
566
- function kn(n, e, t = "SHA-256", i = 1e6, o = 0) {
567
- const l = new AbortController(), s = Date.now();
1800
+ function Gl(e, t, r = "SHA-256", l = 1e6, i = 0) {
1801
+ const a = new AbortController(), o = Date.now();
568
1802
  return {
569
1803
  promise: (async () => {
570
- for (let h = o; h <= i; h += 1) {
571
- if (l.signal.aborted)
1804
+ for (let u = i; u <= l; u += 1) {
1805
+ if (a.signal.aborted)
572
1806
  return null;
573
- if (await kt(e, h, t) === n)
1807
+ if (await Wn(t, u, r) === e)
574
1808
  return {
575
- number: h,
576
- took: Date.now() - s
1809
+ number: u,
1810
+ took: Date.now() - o
577
1811
  };
578
1812
  }
579
1813
  return null;
580
1814
  })(),
581
- controller: l
1815
+ controller: a
582
1816
  };
583
1817
  }
584
- function xn() {
1818
+ function Dl() {
585
1819
  try {
586
1820
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
587
1821
  } catch {
588
1822
  }
589
1823
  }
590
- function En(n) {
591
- const e = atob(n), t = new Uint8Array(e.length);
592
- for (let i = 0; i < e.length; i++)
593
- t[i] = e.charCodeAt(i);
594
- return t;
1824
+ function Yl(e) {
1825
+ const t = atob(e), r = new Uint8Array(t.length);
1826
+ for (let l = 0; l < t.length; l++)
1827
+ r[l] = t.charCodeAt(l);
1828
+ return r;
595
1829
  }
596
- function Cn(n, e = 12) {
597
- const t = new Uint8Array(e);
598
- for (let i = 0; i < e; i++)
599
- t[i] = n % 256, n = Math.floor(n / 256);
600
- return t;
1830
+ function Fl(e, t = 12) {
1831
+ const r = new Uint8Array(t);
1832
+ for (let l = 0; l < t; l++)
1833
+ r[l] = e % 256, e = Math.floor(e / 256);
1834
+ return r;
601
1835
  }
602
- async function In(n, e = "", t = 1e6, i = 0) {
603
- const o = "AES-GCM", l = new AbortController(), s = Date.now(), d = async () => {
604
- for (let I = i; I <= t; I += 1) {
605
- if (l.signal.aborted || !h || !f)
1836
+ async function Ol(e, t = "", r = 1e6, l = 0) {
1837
+ const i = "AES-GCM", a = new AbortController(), o = Date.now(), d = async () => {
1838
+ for (let c = l; c <= r; c += 1) {
1839
+ if (a.signal.aborted || !u || !f)
606
1840
  return null;
607
1841
  try {
608
1842
  const v = await crypto.subtle.decrypt(
609
1843
  {
610
- name: o,
611
- iv: Cn(I)
1844
+ name: i,
1845
+ iv: Fl(c)
612
1846
  },
613
- h,
1847
+ u,
614
1848
  f
615
1849
  );
616
1850
  if (v)
617
1851
  return {
618
1852
  clearText: new TextDecoder().decode(v),
619
- took: Date.now() - s
1853
+ took: Date.now() - o
620
1854
  };
621
1855
  } catch {
622
1856
  }
623
1857
  }
624
1858
  return null;
625
1859
  };
626
- let h = null, f = null;
1860
+ let u = null, f = null;
627
1861
  try {
628
- f = En(n);
629
- const I = await crypto.subtle.digest(
1862
+ f = Yl(e);
1863
+ const c = await crypto.subtle.digest(
630
1864
  "SHA-256",
631
- _t.encode(e)
1865
+ Zn.encode(t)
632
1866
  );
633
- h = await crypto.subtle.importKey(
1867
+ u = await crypto.subtle.importKey(
634
1868
  "raw",
635
- I,
636
- o,
1869
+ c,
1870
+ i,
637
1871
  !1,
638
1872
  ["decrypt"]
639
1873
  );
640
1874
  } catch {
641
1875
  return {
642
1876
  promise: Promise.reject(),
643
- controller: l
1877
+ controller: a
644
1878
  };
645
1879
  }
646
1880
  return {
647
1881
  promise: d(),
648
- controller: l
649
- };
650
- }
651
- var m = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.VERIFIED = "verified", n.VERIFYING = "verifying", n.UNVERIFIED = "unverified", n.EXPIRED = "expired", n))(m || {});
652
- function Rn(n) {
653
- $t(n, "svelte-ddsc3z", '.altcha.svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left}.altcha.svelte-ddsc3z.svelte-ddsc3z:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow.svelte-ddsc3z{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z:not([data-state=unverified]){display:block}.altcha-anchor-arrow.svelte-ddsc3z.svelte-ddsc3z{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main.svelte-ddsc3z.svelte-ddsc3z{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-ddsc3z.svelte-ddsc3z{flex-grow:1}.altcha-label.svelte-ddsc3z label.svelte-ddsc3z{cursor:pointer}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z{color:currentColor;opacity:0.3}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-error.svelte-ddsc3z.svelte-ddsc3z{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-footer.svelte-ddsc3z>.svelte-ddsc3z:first-child{flex-grow:1}.altcha-footer.svelte-ddsc3z a{color:currentColor}.altcha-checkbox.svelte-ddsc3z.svelte-ddsc3z{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-ddsc3z input.svelte-ddsc3z{width:18px;height:18px;margin:0}.altcha-hidden.svelte-ddsc3z.svelte-ddsc3z{display:none}.altcha-spinner.svelte-ddsc3z.svelte-ddsc3z{animation:svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-ddsc3z-altcha-spinner{100%{transform:rotate(360deg)}}');
654
- }
655
- function lt(n) {
656
- let e, t, i;
657
- return {
658
- c() {
659
- e = Q("svg"), t = Q("path"), i = Q("path"), a(t, "d", "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"), a(t, "fill", "currentColor"), a(t, "opacity", ".25"), a(i, "d", "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"), a(i, "fill", "currentColor"), a(i, "class", "altcha-spinner svelte-ddsc3z"), a(e, "width", "24"), a(e, "height", "24"), a(e, "viewBox", "0 0 24 24"), a(e, "xmlns", "http://www.w3.org/2000/svg");
660
- },
661
- m(o, l) {
662
- T(o, e, l), L(e, t), L(e, i);
663
- },
664
- d(o) {
665
- o && W(e);
666
- }
667
- };
668
- }
669
- function Ln(n) {
670
- let e, t = (
671
- /*_strings*/
672
- n[11].label + ""
673
- ), i;
674
- return {
675
- c() {
676
- e = A("label"), a(e, "for", i = /*name*/
677
- n[4] + "_checkbox"), a(e, "class", "svelte-ddsc3z");
678
- },
679
- m(o, l) {
680
- T(o, e, l), e.innerHTML = t;
681
- },
682
- p(o, l) {
683
- l[0] & /*_strings*/
684
- 2048 && t !== (t = /*_strings*/
685
- o[11].label + "") && (e.innerHTML = t), l[0] & /*name*/
686
- 16 && i !== (i = /*name*/
687
- o[4] + "_checkbox") && a(e, "for", i);
688
- },
689
- d(o) {
690
- o && W(e);
691
- }
692
- };
693
- }
694
- function zn(n) {
695
- let e, t = (
696
- /*_strings*/
697
- n[11].verifying + ""
698
- );
699
- return {
700
- c() {
701
- e = A("span");
702
- },
703
- m(i, o) {
704
- T(i, e, o), e.innerHTML = t;
705
- },
706
- p(i, o) {
707
- o[0] & /*_strings*/
708
- 2048 && t !== (t = /*_strings*/
709
- i[11].verifying + "") && (e.innerHTML = t);
710
- },
711
- d(i) {
712
- i && W(e);
713
- }
714
- };
715
- }
716
- function Vn(n) {
717
- let e, t = (
718
- /*_strings*/
719
- n[11].verified + ""
720
- ), i, o;
721
- return {
722
- c() {
723
- e = A("span"), i = $(), o = A("input"), a(o, "type", "hidden"), a(
724
- o,
725
- "name",
726
- /*name*/
727
- n[4]
728
- ), o.value = /*payload*/
729
- n[6];
730
- },
731
- m(l, s) {
732
- T(l, e, s), e.innerHTML = t, T(l, i, s), T(l, o, s);
733
- },
734
- p(l, s) {
735
- s[0] & /*_strings*/
736
- 2048 && t !== (t = /*_strings*/
737
- l[11].verified + "") && (e.innerHTML = t), s[0] & /*name*/
738
- 16 && a(
739
- o,
740
- "name",
741
- /*name*/
742
- l[4]
743
- ), s[0] & /*payload*/
744
- 64 && (o.value = /*payload*/
745
- l[6]);
746
- },
747
- d(l) {
748
- l && (W(e), W(i), W(o));
749
- }
750
- };
751
- }
752
- function st(n) {
753
- let e, t, i, o, l, s, d;
754
- return {
755
- c() {
756
- e = A("div"), t = A("a"), i = Q("svg"), o = Q("path"), l = Q("path"), s = Q("path"), a(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), a(o, "fill", "currentColor"), a(l, "d", "M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"), a(l, "fill", "currentColor"), a(s, "d", "M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"), a(s, "fill", "currentColor"), a(i, "width", "22"), a(i, "height", "22"), a(i, "viewBox", "0 0 20 20"), a(i, "fill", "none"), a(i, "xmlns", "http://www.w3.org/2000/svg"), a(t, "href", xt), a(t, "target", "_blank"), a(t, "class", "altcha-logo svelte-ddsc3z"), a(t, "aria-label", d = /*_strings*/
757
- n[11].ariaLinkLabel);
758
- },
759
- m(h, f) {
760
- T(h, e, f), L(e, t), L(t, i), L(i, o), L(i, l), L(i, s);
761
- },
762
- p(h, f) {
763
- f[0] & /*_strings*/
764
- 2048 && d !== (d = /*_strings*/
765
- h[11].ariaLinkLabel) && a(t, "aria-label", d);
766
- },
767
- d(h) {
768
- h && W(e);
769
- }
770
- };
771
- }
772
- function ct(n) {
773
- let e, t, i, o;
774
- function l(h, f) {
775
- return (
776
- /*state*/
777
- h[7] === m.EXPIRED ? Gn : Sn
778
- );
779
- }
780
- let s = l(n), d = s(n);
781
- return {
782
- c() {
783
- e = A("div"), t = Q("svg"), i = Q("path"), o = $(), d.c(), a(i, "stroke-linecap", "round"), a(i, "stroke-linejoin", "round"), a(i, "d", "M6 18L18 6M6 6l12 12"), a(t, "width", "14"), a(t, "height", "14"), a(t, "xmlns", "http://www.w3.org/2000/svg"), a(t, "fill", "none"), a(t, "viewBox", "0 0 24 24"), a(t, "stroke-width", "1.5"), a(t, "stroke", "currentColor"), a(e, "class", "altcha-error svelte-ddsc3z");
784
- },
785
- m(h, f) {
786
- T(h, e, f), L(e, t), L(t, i), L(e, o), d.m(e, null);
787
- },
788
- p(h, f) {
789
- s === (s = l(h)) && d ? d.p(h, f) : (d.d(1), d = s(h), d && (d.c(), d.m(e, null)));
790
- },
791
- d(h) {
792
- h && W(e), d.d();
793
- }
794
- };
795
- }
796
- function Sn(n) {
797
- let e, t = (
798
- /*_strings*/
799
- n[11].error + ""
800
- );
801
- return {
802
- c() {
803
- e = A("div"), a(
804
- e,
805
- "title",
806
- /*error*/
807
- n[5]
808
- );
809
- },
810
- m(i, o) {
811
- T(i, e, o), e.innerHTML = t;
812
- },
813
- p(i, o) {
814
- o[0] & /*_strings*/
815
- 2048 && t !== (t = /*_strings*/
816
- i[11].error + "") && (e.innerHTML = t), o[0] & /*error*/
817
- 32 && a(
818
- e,
819
- "title",
820
- /*error*/
821
- i[5]
822
- );
823
- },
824
- d(i) {
825
- i && W(e);
826
- }
827
- };
828
- }
829
- function Gn(n) {
830
- let e, t = (
831
- /*_strings*/
832
- n[11].expired + ""
833
- );
834
- return {
835
- c() {
836
- e = A("div"), a(
837
- e,
838
- "title",
839
- /*error*/
840
- n[5]
841
- );
842
- },
843
- m(i, o) {
844
- T(i, e, o), e.innerHTML = t;
845
- },
846
- p(i, o) {
847
- o[0] & /*_strings*/
848
- 2048 && t !== (t = /*_strings*/
849
- i[11].expired + "") && (e.innerHTML = t), o[0] & /*error*/
850
- 32 && a(
851
- e,
852
- "title",
853
- /*error*/
854
- i[5]
855
- );
856
- },
857
- d(i) {
858
- i && W(e);
859
- }
860
- };
861
- }
862
- function at(n) {
863
- let e, t, i = (
864
- /*_strings*/
865
- n[11].footer + ""
866
- );
867
- return {
868
- c() {
869
- e = A("div"), t = A("div"), a(t, "class", "svelte-ddsc3z"), a(e, "class", "altcha-footer svelte-ddsc3z");
870
- },
871
- m(o, l) {
872
- T(o, e, l), L(e, t), t.innerHTML = i;
873
- },
874
- p(o, l) {
875
- l[0] & /*_strings*/
876
- 2048 && i !== (i = /*_strings*/
877
- o[11].footer + "") && (t.innerHTML = i);
878
- },
879
- d(o) {
880
- o && W(e);
881
- }
882
- };
883
- }
884
- function ft(n) {
885
- let e;
886
- return {
887
- c() {
888
- e = A("div"), a(e, "class", "altcha-anchor-arrow svelte-ddsc3z");
889
- },
890
- m(t, i) {
891
- T(t, e, i), n[48](e);
892
- },
893
- p: Ce,
894
- d(t) {
895
- t && W(e), n[48](null);
896
- }
897
- };
898
- }
899
- function Nn(n) {
900
- let e, t, i, o, l, s, d, h, f, I, v, P, F, M, S, z, O;
901
- const K = (
902
- /*#slots*/
903
- n[46].default
904
- ), Z = Dt(
905
- K,
906
- n,
907
- /*$$scope*/
908
- n[45],
909
- null
910
- );
911
- let G = (
912
- /*state*/
913
- n[7] === m.VERIFYING && lt()
914
- );
915
- function q(u, b) {
916
- return (
917
- /*state*/
918
- u[7] === m.VERIFIED ? Vn : (
919
- /*state*/
920
- u[7] === m.VERIFYING ? zn : Ln
921
- )
922
- );
923
- }
924
- let D = q(n), Y = D(n), x = (
925
- /*hidelogo*/
926
- (n[3] !== !0 || /*isFreeSaaS*/
927
- n[12]) && st(n)
928
- ), N = (
929
- /*error*/
930
- (n[5] || /*state*/
931
- n[7] === m.EXPIRED) && ct(n)
932
- ), V = (
933
- /*_strings*/
934
- n[11].footer && /*hidefooter*/
935
- (n[2] !== !0 || /*isFreeSaaS*/
936
- n[12]) && at(n)
937
- ), _ = (
938
- /*floating*/
939
- n[1] && ft(n)
940
- );
941
- return {
942
- c() {
943
- Z && Z.c(), e = $(), t = A("div"), i = A("div"), G && G.c(), o = $(), l = A("div"), s = A("input"), f = $(), I = A("div"), Y.c(), v = $(), x && x.c(), P = $(), N && N.c(), F = $(), V && V.c(), M = $(), _ && _.c(), a(s, "type", "checkbox"), a(s, "id", d = /*name*/
944
- n[4] + "_checkbox"), s.required = h = /*auto*/
945
- n[0] !== "onsubmit" && (!/*floating*/
946
- n[1] || /*auto*/
947
- n[0] !== "off"), a(s, "class", "svelte-ddsc3z"), a(l, "class", "altcha-checkbox svelte-ddsc3z"), it(
948
- l,
949
- "altcha-hidden",
950
- /*state*/
951
- n[7] === m.VERIFYING
952
- ), a(I, "class", "altcha-label svelte-ddsc3z"), a(i, "class", "altcha-main svelte-ddsc3z"), a(t, "class", "altcha svelte-ddsc3z"), a(
953
- t,
954
- "data-state",
955
- /*state*/
956
- n[7]
957
- ), a(
958
- t,
959
- "data-floating",
960
- /*floating*/
961
- n[1]
962
- );
963
- },
964
- m(u, b) {
965
- Z && Z.m(u, b), T(u, e, b), T(u, t, b), L(t, i), G && G.m(i, null), L(i, o), L(i, l), L(l, s), s.checked = /*checked*/
966
- n[8], L(i, f), L(i, I), Y.m(I, null), L(i, v), x && x.m(i, null), L(t, P), N && N.m(t, null), L(t, F), V && V.m(t, null), L(t, M), _ && _.m(t, null), n[49](t), S = !0, z || (O = [
967
- Le(
968
- s,
969
- "change",
970
- /*input_change_handler*/
971
- n[47]
972
- ),
973
- Le(
974
- s,
975
- "change",
976
- /*onCheckedChange*/
977
- n[13]
978
- ),
979
- Le(
980
- s,
981
- "invalid",
982
- /*onInvalid*/
983
- n[14]
984
- )
985
- ], z = !0);
986
- },
987
- p(u, b) {
988
- Z && Z.p && (!S || b[1] & /*$$scope*/
989
- 16384) && Ot(
990
- Z,
991
- K,
992
- u,
993
- /*$$scope*/
994
- u[45],
995
- S ? Jt(
996
- K,
997
- /*$$scope*/
998
- u[45],
999
- b,
1000
- null
1001
- ) : Kt(
1002
- /*$$scope*/
1003
- u[45]
1004
- ),
1005
- null
1006
- ), /*state*/
1007
- u[7] === m.VERIFYING ? G || (G = lt(), G.c(), G.m(i, o)) : G && (G.d(1), G = null), (!S || b[0] & /*name*/
1008
- 16 && d !== (d = /*name*/
1009
- u[4] + "_checkbox")) && a(s, "id", d), (!S || b[0] & /*auto, floating*/
1010
- 3 && h !== (h = /*auto*/
1011
- u[0] !== "onsubmit" && (!/*floating*/
1012
- u[1] || /*auto*/
1013
- u[0] !== "off"))) && (s.required = h), b[0] & /*checked*/
1014
- 256 && (s.checked = /*checked*/
1015
- u[8]), (!S || b[0] & /*state*/
1016
- 128) && it(
1017
- l,
1018
- "altcha-hidden",
1019
- /*state*/
1020
- u[7] === m.VERIFYING
1021
- ), D === (D = q(u)) && Y ? Y.p(u, b) : (Y.d(1), Y = D(u), Y && (Y.c(), Y.m(I, null))), /*hidelogo*/
1022
- u[3] !== !0 || /*isFreeSaaS*/
1023
- u[12] ? x ? x.p(u, b) : (x = st(u), x.c(), x.m(i, null)) : x && (x.d(1), x = null), /*error*/
1024
- u[5] || /*state*/
1025
- u[7] === m.EXPIRED ? N ? N.p(u, b) : (N = ct(u), N.c(), N.m(t, F)) : N && (N.d(1), N = null), /*_strings*/
1026
- u[11].footer && /*hidefooter*/
1027
- (u[2] !== !0 || /*isFreeSaaS*/
1028
- u[12]) ? V ? V.p(u, b) : (V = at(u), V.c(), V.m(t, M)) : V && (V.d(1), V = null), /*floating*/
1029
- u[1] ? _ ? _.p(u, b) : (_ = ft(u), _.c(), _.m(t, null)) : _ && (_.d(1), _ = null), (!S || b[0] & /*state*/
1030
- 128) && a(
1031
- t,
1032
- "data-state",
1033
- /*state*/
1034
- u[7]
1035
- ), (!S || b[0] & /*floating*/
1036
- 2) && a(
1037
- t,
1038
- "data-floating",
1039
- /*floating*/
1040
- u[1]
1041
- );
1042
- },
1043
- i(u) {
1044
- S || (pt(Z, u), S = !0);
1045
- },
1046
- o(u) {
1047
- dn(Z, u), S = !1;
1048
- },
1049
- d(u) {
1050
- u && (W(e), W(t)), Z && Z.d(u), G && G.d(), Y.d(), x && x.d(), N && N.d(), V && V.d(), _ && _.d(), n[49](null), z = !1, we(O);
1051
- }
1882
+ controller: a
1052
1883
  };
1053
1884
  }
1054
- const ut = "Visit Altcha.org", xt = "https://altcha.org/";
1055
- function dt(n) {
1056
- return JSON.parse(n);
1057
- }
1058
- function An(n, e, t) {
1059
- var qe, et;
1060
- let i, o, l, s, { $$slots: d = {}, $$scope: h } = e, { auto: f = void 0 } = e, { blockspam: I = void 0 } = e, { challengeurl: v = void 0 } = e, { challengejson: P = void 0 } = e, { debug: F = !1 } = e, { delay: M = 0 } = e, { expire: S = void 0 } = e, { floating: z = void 0 } = e, { floatinganchor: O = void 0 } = e, { floatingoffset: K = void 0 } = e, { hidefooter: Z = !1 } = e, { hidelogo: G = !1 } = e, { name: q = "altcha" } = e, { maxnumber: D = 1e6 } = e, { mockerror: Y = !1 } = e, { obfuscated: x = void 0 } = e, { plugins: N = void 0 } = e, { refetchonexpire: V = !0 } = e, { spamfilter: _ = !1 } = e, { strings: u = void 0 } = e, { test: b = !1 } = e, { verifyurl: ee = void 0 } = e, { workers: le = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ue = void 0 } = e;
1061
- const de = sn(), Ne = ["SHA-256", "SHA-384", "SHA-512"], Ae = (et = (qe = document.documentElement.lang) == null ? void 0 : qe.split("-")) == null ? void 0 : et[0];
1062
- let re = !1, E, ie = null, se = null, y = null, he = null, J = null, oe = null, te = [], C = m.UNVERIFIED;
1063
- ln(() => {
1064
- Et(), y && (y.removeEventListener("submit", je), y.removeEventListener("reset", Pe), y.removeEventListener("focusin", Te), y = null), J && (clearTimeout(J), J = null), document.removeEventListener("click", Ye), document.removeEventListener("scroll", We), window.removeEventListener("resize", Me);
1065
- }), on(() => {
1066
- k("mounted", "1.0.7"), k("workers", le), zt(), k("plugins", te.length ? te.map((r) => r.constructor.pluginName).join(", ") : "none"), b && k("using test mode"), S && ke(S), f !== void 0 && k("auto", f), z !== void 0 && Ue(z), y = E.closest("form"), y && (y.addEventListener("submit", je, { capture: !0 }), y.addEventListener("reset", Pe), f === "onfocus" && y.addEventListener("focusin", Te)), f === "onload" && (x ? ge() : ne()), i && (Z || G) && k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(() => {
1067
- de("load");
1885
+ var x = /* @__PURE__ */ ((e) => (e.ERROR = "error", e.VERIFIED = "verified", e.VERIFYING = "verifying", e.UNVERIFIED = "unverified", e.EXPIRED = "expired", e))(x || {}), Xl = /* @__PURE__ */ se('<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" fill="currentColor" opacity=".25" class="svelte-ddsc3z"></path><path d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" fill="currentColor" class="altcha-spinner svelte-ddsc3z"></path></svg>'), Zl = /* @__PURE__ */ se('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span> <input type="hidden" class="svelte-ddsc3z">', 1), Wl = /* @__PURE__ */ se('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span>'), Ul = /* @__PURE__ */ se('<label class="svelte-ddsc3z"><!></label>'), Ml = /* @__PURE__ */ se('<div class="svelte-ddsc3z"><a target="_blank" class="altcha-logo svelte-ddsc3z"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><path d="M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z" fill="currentColor" class="svelte-ddsc3z"></path><path d="M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z" fill="currentColor" class="svelte-ddsc3z"></path><path d="M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z" fill="currentColor" class="svelte-ddsc3z"></path></svg></a></div>'), jl = /* @__PURE__ */ se('<div class="svelte-ddsc3z"><!></div>'), Bl = /* @__PURE__ */ se('<div class="svelte-ddsc3z"><!></div>'), Hl = /* @__PURE__ */ se('<div class="altcha-error svelte-ddsc3z"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="svelte-ddsc3z"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" class="svelte-ddsc3z"></path></svg> <!></div>'), Jl = /* @__PURE__ */ se('<div class="altcha-footer svelte-ddsc3z"><div class="svelte-ddsc3z"><!></div></div>'), Kl = /* @__PURE__ */ se('<div class="altcha-anchor-arrow svelte-ddsc3z"></div>'), ql = /* @__PURE__ */ se('<!> <div class="altcha svelte-ddsc3z"><div class="altcha-main svelte-ddsc3z"><!> <div class="altcha-checkbox svelte-ddsc3z"><input type="checkbox" class="svelte-ddsc3z"></div> <div class="altcha-label svelte-ddsc3z"><!></div> <!></div> <!> <!> <!></div>', 1);
1886
+ const Ql = {
1887
+ hash: "svelte-ddsc3z",
1888
+ code: `.altcha.svelte-ddsc3z {background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left;}.altcha.svelte-ddsc3z:focus-within {border-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z {background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999;}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow:where(.svelte-ddsc3z) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto;}.altcha[data-floating=bottom].svelte-ddsc3z:focus-within::after {border-bottom-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating=top].svelte-ddsc3z:focus-within::after {border-top-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z:not([data-state=unverified]) {display:block;}.altcha-anchor-arrow.svelte-ddsc3z {border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0;}.altcha-main.svelte-ddsc3z {align-items:center;display:flex;gap:0.4rem;padding:0.7rem;}.altcha-label.svelte-ddsc3z {flex-grow:1;}.altcha-label.svelte-ddsc3z label:where(.svelte-ddsc3z) {cursor:pointer;}.altcha-logo.svelte-ddsc3z {color:currentColor;opacity:0.3;}.altcha-logo.svelte-ddsc3z:hover {opacity:1;}.altcha-error.svelte-ddsc3z {color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem;}.altcha-footer.svelte-ddsc3z {align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right;}.altcha-footer.svelte-ddsc3z:hover {opacity:1;}.altcha-footer.svelte-ddsc3z > :where(.svelte-ddsc3z):first-child {flex-grow:1;}.altcha-footer.svelte-ddsc3z a {color:currentColor;}.altcha-checkbox.svelte-ddsc3z {display:flex;align-items:center;height:24px;width:24px;}.altcha-checkbox.svelte-ddsc3z input:where(.svelte-ddsc3z) {width:18px;height:18px;margin:0;}.altcha-hidden.svelte-ddsc3z {display:none;}.altcha-spinner.svelte-ddsc3z {
1889
+ animation: svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center;}
1890
+
1891
+ @keyframes svelte-ddsc3z-altcha-spinner {
1892
+ 100% {
1893
+ transform: rotate(360deg);
1894
+ }
1895
+ }`
1896
+ };
1897
+ function ea(e, t) {
1898
+ var Ar, Tr;
1899
+ Tn(t, !0), xl(e, Ql);
1900
+ let r = N(t, "auto", 7, void 0), l = N(t, "blockspam", 7, void 0), i = N(t, "challengeurl", 7, void 0), a = N(t, "challengejson", 7, void 0), o = N(t, "customfetch", 7, void 0), d = N(t, "debug", 7, !1), u = N(t, "delay", 7, 0), f = N(t, "expire", 7, void 0), c = N(t, "floating", 7, void 0), v = N(t, "floatinganchor", 7, void 0), g = N(t, "floatingoffset", 7, void 0), m = N(t, "hidefooter", 7, !1), p = N(t, "hidelogo", 7, !1), L = N(t, "name", 7, "altcha"), G = N(t, "maxnumber", 7, 1e6), Q = N(t, "mockerror", 7, !1), D = N(t, "obfuscated", 7, void 0), Z = N(t, "plugins", 7, void 0), ge = N(t, "refetchonexpire", 7, !0), F = N(t, "spamfilter", 7, !1), ye = N(t, "strings", 7, void 0), I = N(t, "test", 7, !1), W = N(t, "verifyurl", 7, void 0), ue = N(t, "workers", 23, () => Math.min(16, navigator.hardwareConcurrency || 8)), et = N(t, "workerurl", 7, void 0);
1901
+ const ir = ["SHA-256", "SHA-384", "SHA-512"], lr = "Visit Altcha.org", ar = "https://altcha.org/", tt = (n, s) => {
1902
+ t.$$host.dispatchEvent(new CustomEvent(n, { detail: s }));
1903
+ }, or = (Tr = (Ar = document.documentElement.lang) == null ? void 0 : Ar.split("-")) == null ? void 0 : Tr[0], Pt = /* @__PURE__ */ ot(() => {
1904
+ var n;
1905
+ return i() && new URL(i(), location.origin).host.endsWith(".altcha.org") && !!((n = i()) != null && n.includes("apiKey=ckey_"));
1906
+ }), zt = /* @__PURE__ */ ot(() => a() ? br(a()) : void 0), sr = /* @__PURE__ */ ot(() => ye() ? br(ye()) : {}), ee = /* @__PURE__ */ ot(() => {
1907
+ var n;
1908
+ return {
1909
+ ariaLinkLabel: lr,
1910
+ error: "Verification failed. Try again later.",
1911
+ expired: "Verification expired. Try again.",
1912
+ footer: `Protected by <a href="${ar}" target="_blank" aria-label="${((n = h(sr)) == null ? void 0 : n.ariaLinkLabel) || lr}">ALTCHA</a>`,
1913
+ label: "I'm not a robot",
1914
+ verified: "Verified",
1915
+ verifying: "Verifying...",
1916
+ waitAlert: "Verifying... please wait.",
1917
+ ...h(sr)
1918
+ };
1919
+ });
1920
+ let ze = Fe(!1), $ = Fe(le(x.UNVERIFIED)), U = Fe(void 0), rt = Fe(null), Ge = null, w = null, De = Fe(null), fe = null, pe = [], Se = Fe(null);
1921
+ Ut(() => {
1922
+ qn(h(De));
1923
+ }), Ut(() => {
1924
+ Qn(h($));
1925
+ }), $l(() => {
1926
+ Un(), w && (w.removeEventListener("submit", vr), w.removeEventListener("reset", gr), w.removeEventListener("focusin", hr), w = null), fe && (clearTimeout(fe), fe = null), document.removeEventListener("click", cr), document.removeEventListener("scroll", dr), window.removeEventListener("resize", mr);
1927
+ }), On(() => {
1928
+ var n;
1929
+ S("mounted", "1.1.0"), S("workers", ue()), Jn(), S("plugins", pe.length ? pe.map((s) => s.constructor.pluginName).join(", ") : "none"), I() && S("using test mode"), f() && bt(f()), r() !== void 0 && S("auto", r()), c() !== void 0 && yr(c()), w = (n = h(U)) == null ? void 0 : n.closest("form"), w && (w.addEventListener("submit", vr, { capture: !0 }), w.addEventListener("reset", gr), r() === "onfocus" && w.addEventListener("focusin", hr)), r() === "onload" && (D() ? nt() : we()), h(Pt) && (m() || p()) && S("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(() => {
1930
+ tt("load");
1068
1931
  });
1069
1932
  });
1070
- function Xe(r, c) {
1933
+ function ur(n, s) {
1071
1934
  return btoa(JSON.stringify({
1072
- algorithm: r.algorithm,
1073
- challenge: r.challenge,
1074
- number: c.number,
1075
- salt: r.salt,
1076
- signature: r.signature,
1077
- test: b ? !0 : void 0,
1078
- took: c.took
1935
+ algorithm: n.algorithm,
1936
+ challenge: n.challenge,
1937
+ number: s.number,
1938
+ salt: n.salt,
1939
+ signature: n.signature,
1940
+ test: I() ? !0 : void 0,
1941
+ took: s.took
1079
1942
  }));
1080
1943
  }
1081
- function Et() {
1082
- for (const r of te)
1083
- r.destroy();
1084
- }
1085
- function Ze() {
1086
- v && V && C === m.VERIFIED ? ne() : me(m.EXPIRED, s.expired);
1087
- }
1088
- async function Ct() {
1089
- var r;
1090
- if (Y)
1091
- throw k("mocking error"), new Error("Mocked error.");
1092
- if (o)
1093
- return k("using provided json data"), o;
1094
- if (b)
1095
- return k("generating test challenge", { test: b }), _n(typeof b != "boolean" ? +b : void 0);
1944
+ function Un() {
1945
+ for (const n of pe)
1946
+ n.destroy();
1947
+ }
1948
+ function fr() {
1949
+ i() && ge() && h($) === x.VERIFIED ? we() : it(x.EXPIRED, h(ee).expired);
1950
+ }
1951
+ async function Mn() {
1952
+ var n;
1953
+ if (Q())
1954
+ throw S("mocking error"), new Error("Mocked error.");
1955
+ if (h(zt))
1956
+ return S("using provided json data"), h(zt);
1957
+ if (I())
1958
+ return S("generating test challenge", { test: I() }), zl(typeof I() != "boolean" ? +I() : void 0);
1096
1959
  {
1097
- if (!v && y) {
1098
- const p = y.getAttribute("action");
1099
- p != null && p.includes("/form/") && t(15, v = p + "/altcha");
1960
+ if (!i() && w) {
1961
+ const A = w.getAttribute("action");
1962
+ A != null && A.includes("/form/") && i(A + "/altcha");
1100
1963
  }
1101
- if (!v)
1964
+ if (!i())
1102
1965
  throw new Error("Attribute challengeurl not set.");
1103
- k("fetching challenge from", v);
1104
- const c = await fetch(v, {
1105
- headers: _ ? { "x-altcha-spam-filter": "1" } : {}
1106
- });
1107
- if (c.status !== 200)
1108
- throw new Error(`Server responded with ${c.status}.`);
1109
- const g = c.headers.get("Expires"), R = c.headers.get("X-Altcha-Config"), U = await c.json(), j = new URLSearchParams((r = U.salt.split("?")) == null ? void 0 : r[1]), X = j.get("expires") || j.get("expire");
1110
- if (X) {
1111
- const p = new Date(+X * 1e3), H = isNaN(p.getTime()) ? 0 : p.getTime() - Date.now();
1112
- H > 0 && ke(H);
1966
+ S("fetching challenge from", i());
1967
+ let s = null, _ = null;
1968
+ if (o())
1969
+ if (S("using customfetch"), typeof o() == "string") {
1970
+ if (s = globalThis[o()] || null, !s)
1971
+ throw new Error(`Custom fetch function not found: ${o()}`);
1972
+ } else
1973
+ s = o();
1974
+ const E = {
1975
+ headers: F() !== !1 ? { "x-altcha-spam-filter": "1" } : {}
1976
+ };
1977
+ if (s) {
1978
+ if (_ = await s(i(), E), !_ || !(_ instanceof Response))
1979
+ throw new Error("Custom fetch function did not return a response.");
1980
+ } else
1981
+ _ = await fetch(i(), E);
1982
+ if (_.status !== 200)
1983
+ throw new Error(`Server responded with ${_.status}.`);
1984
+ const T = _.headers.get("Expires"), C = _.headers.get("X-Altcha-Config"), b = await _.json(), Y = new URLSearchParams((n = b.salt.split("?")) == null ? void 0 : n[1]), _e = Y.get("expires") || Y.get("expire");
1985
+ if (_e) {
1986
+ const A = new Date(+_e * 1e3), re = isNaN(A.getTime()) ? 0 : A.getTime() - Date.now();
1987
+ re > 0 && bt(re);
1113
1988
  }
1114
- if (R)
1989
+ if (C)
1115
1990
  try {
1116
- const p = JSON.parse(R);
1117
- p && typeof p == "object" && (p.verifyurl && (p.verifyurl = new URL(p.verifyurl, new URL(v)).toString()), De(p));
1118
- } catch (p) {
1119
- k("unable to configure from X-Altcha-Config", p);
1991
+ const A = JSON.parse(C);
1992
+ A && typeof A == "object" && (A.verifyurl && (A.verifyurl = new URL(A.verifyurl, new URL(i())).toString()), Er(A));
1993
+ } catch (A) {
1994
+ S("unable to configure from X-Altcha-Config", A);
1120
1995
  }
1121
- if (!S && (g != null && g.length)) {
1122
- const p = Date.parse(g);
1123
- if (p) {
1124
- const H = p - Date.now();
1125
- H > 0 && ke(H);
1996
+ if (!f() && (T != null && T.length)) {
1997
+ const A = Date.parse(T);
1998
+ if (A) {
1999
+ const re = A - Date.now();
2000
+ re > 0 && bt(re);
1126
2001
  }
1127
2002
  }
1128
- return U;
2003
+ return b;
1129
2004
  }
1130
2005
  }
1131
- function It(r) {
1132
- var g;
1133
- const c = y == null ? void 0 : y.querySelector(typeof r == "string" ? `input[name="${r}"]` : 'input[type="email"]:not([data-no-spamfilter])');
1134
- return ((g = c == null ? void 0 : c.value) == null ? void 0 : g.slice(c.value.indexOf("@"))) || void 0;
2006
+ function jn(n) {
2007
+ var _;
2008
+ const s = w == null ? void 0 : w.querySelector(typeof n == "string" ? `input[name="${n}"]` : 'input[type="email"]:not([data-no-spamfilter])');
2009
+ return ((_ = s == null ? void 0 : s.value) == null ? void 0 : _.slice(s.value.indexOf("@"))) || void 0;
1135
2010
  }
1136
- function Rt() {
1137
- return _ === "ipAddress" ? {
2011
+ function Bn() {
2012
+ return F() === "ipAddress" ? {
1138
2013
  blockedCountries: void 0,
1139
2014
  classifier: void 0,
1140
2015
  disableRules: void 0,
@@ -1145,7 +2020,7 @@ function An(n, e, t) {
1145
2020
  ipAddress: void 0,
1146
2021
  text: void 0,
1147
2022
  timeZone: void 0
1148
- } : typeof _ == "object" ? _ : {
2023
+ } : typeof F() == "object" ? F() : {
1149
2024
  blockedCountries: void 0,
1150
2025
  classifier: void 0,
1151
2026
  disableRules: void 0,
@@ -1158,562 +2033,561 @@ function An(n, e, t) {
1158
2033
  timeZone: void 0
1159
2034
  };
1160
2035
  }
1161
- function Lt(r) {
2036
+ function Hn(n) {
1162
2037
  return [
1163
- ...(y == null ? void 0 : y.querySelectorAll(r != null && r.length ? r.map((g) => `input[name="${g}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
2038
+ ...(w == null ? void 0 : w.querySelectorAll(n != null && n.length ? n.map((_) => `input[name="${_}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []
1164
2039
  ].reduce(
1165
- (g, R) => {
1166
- const U = R.name, j = R.value;
1167
- return U && j && (g[U] = /\n/.test(j) ? j.replace(new RegExp("(?<!\\r)\\n", "g"), `\r
1168
- `) : j), g;
2040
+ (_, E) => {
2041
+ const T = E.name, C = E.value;
2042
+ return T && C && (_[T] = /\n/.test(C) ? C.replace(new RegExp("(?<!\\r)\\n", "g"), `\r
2043
+ `) : C), _;
1169
2044
  },
1170
2045
  {}
1171
2046
  );
1172
2047
  }
1173
- function zt() {
1174
- const r = N !== void 0 ? N.split(",") : void 0;
1175
- for (const c of globalThis.altchaPlugins)
1176
- (!r || r.includes(c.pluginName)) && te.push(new c({
1177
- el: E,
1178
- clarify: ge,
1179
- dispatch: de,
1180
- getConfiguration: Je,
1181
- getFloatingAnchor: Oe,
1182
- getState: Ke,
1183
- log: k,
1184
- reset: me,
1185
- solve: Be,
1186
- setState: Qe,
1187
- setFloatingAnchor: $e,
1188
- verify: ne
2048
+ function Jn() {
2049
+ const n = Z() !== void 0 ? Z().split(",") : void 0;
2050
+ for (const s of globalThis.altchaPlugins)
2051
+ (!n || n.includes(s.pluginName)) && pe.push(new s({
2052
+ el: h(U),
2053
+ clarify: nt,
2054
+ dispatch: tt,
2055
+ getConfiguration: xr,
2056
+ getFloatingAnchor: kr,
2057
+ getState: Cr,
2058
+ log: S,
2059
+ reset: it,
2060
+ solve: wr,
2061
+ setState: Ne,
2062
+ setFloatingAnchor: Rr,
2063
+ verify: we
1189
2064
  }));
1190
2065
  }
1191
- function k(...r) {
1192
- (F || r.some((c) => c instanceof Error)) && console[r[0] instanceof Error ? "error" : "log"]("ALTCHA", `[name=${q}]`, ...r);
2066
+ function S(...n) {
2067
+ (d() || n.some((s) => s instanceof Error)) && console[n[0] instanceof Error ? "error" : "log"]("ALTCHA", `[name=${L()}]`, ...n);
2068
+ }
2069
+ function Kn() {
2070
+ [x.UNVERIFIED, x.ERROR, x.EXPIRED].includes(h($)) ? F() !== !1 && (w == null ? void 0 : w.reportValidity()) === !1 ? V(ze, !1) : D() ? nt() : we() : V(ze, !0);
1193
2071
  }
1194
- function Vt() {
1195
- [m.UNVERIFIED, m.ERROR, m.EXPIRED].includes(C) ? _ && (y == null ? void 0 : y.reportValidity()) === !1 ? t(8, re = !1) : x ? ge() : ne() : t(8, re = !0);
2072
+ function cr(n) {
2073
+ const s = n.target;
2074
+ c() && s && !h(U).contains(s) && (h($) === x.VERIFIED || r() === "off" && h($) === x.UNVERIFIED) && (h(U).style.display = "none");
1196
2075
  }
1197
- function Ye(r) {
1198
- const c = r.target;
1199
- z && c && !E.contains(c) && (C === m.VERIFIED || f === "off" && C === m.UNVERIFIED) && t(9, E.style.display = "none", E);
2076
+ function dr() {
2077
+ c() && h($) !== x.UNVERIFIED && mt();
1200
2078
  }
1201
- function We() {
1202
- z && C !== m.UNVERIFIED && _e();
2079
+ function qn(n) {
2080
+ for (const s of pe)
2081
+ typeof s.onErrorChange == "function" && s.onErrorChange(h(De));
1203
2082
  }
1204
- function St(r) {
1205
- for (const c of te)
1206
- typeof c.onErrorChange == "function" && c.onErrorChange(he);
2083
+ function hr(n) {
2084
+ h($) === x.UNVERIFIED && we();
1207
2085
  }
1208
- function Te(r) {
1209
- C === m.UNVERIFIED && ne();
2086
+ function vr(n) {
2087
+ w && r() === "onsubmit" ? h($) === x.UNVERIFIED ? (n.preventDefault(), n.stopPropagation(), we().then(() => {
2088
+ w == null || w.requestSubmit();
2089
+ })) : h($) !== x.VERIFIED && (n.preventDefault(), n.stopPropagation(), h($) === x.VERIFYING && _r()) : w && c() && r() === "off" && h($) === x.UNVERIFIED && (n.preventDefault(), n.stopPropagation(), h(U).style.display = "block", mt());
1210
2090
  }
1211
- function je(r) {
1212
- y && f === "onsubmit" ? C === m.UNVERIFIED ? (r.preventDefault(), r.stopPropagation(), ne().then(() => {
1213
- y == null || y.requestSubmit();
1214
- })) : C !== m.VERIFIED && (r.preventDefault(), r.stopPropagation(), C === m.VERIFYING && Fe()) : y && z && f === "off" && C === m.UNVERIFIED && (r.preventDefault(), r.stopPropagation(), t(9, E.style.display = "block", E), _e());
2091
+ function gr() {
2092
+ it();
1215
2093
  }
1216
- function Pe() {
1217
- me();
2094
+ function _r() {
2095
+ h($) === x.VERIFYING && h(ee).waitAlert && alert(h(ee).waitAlert);
1218
2096
  }
1219
- function Fe() {
1220
- C === m.VERIFYING && s.waitAlert && alert(s.waitAlert);
2097
+ function Qn(n) {
2098
+ for (const s of pe)
2099
+ typeof s.onStateChange == "function" && s.onStateChange(h($));
2100
+ c() && h($) !== x.UNVERIFIED && requestAnimationFrame(() => {
2101
+ mt();
2102
+ }), V(ze, h($) === x.VERIFIED);
1221
2103
  }
1222
- function Gt(r) {
1223
- for (const c of te)
1224
- typeof c.onStateChange == "function" && c.onStateChange(C);
1225
- z && C !== m.UNVERIFIED && requestAnimationFrame(() => {
1226
- _e();
1227
- }), t(8, re = C === m.VERIFIED);
2104
+ function mr() {
2105
+ c() && mt();
1228
2106
  }
1229
- function Me() {
1230
- z && _e();
2107
+ function br(n) {
2108
+ return JSON.parse(n);
1231
2109
  }
1232
- function _e(r = 20) {
1233
- if (E)
1234
- if (se || (se = (O ? document.querySelector(O) : y == null ? void 0 : y.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')) || y), se) {
1235
- const c = parseInt(K, 10) || 12, g = se.getBoundingClientRect(), R = E.getBoundingClientRect(), U = document.documentElement.clientHeight, j = document.documentElement.clientWidth, X = z === "auto" ? g.bottom + R.height + c + r > U : z === "top", p = Math.max(r, Math.min(j - r - R.width, g.left + g.width / 2 - R.width / 2));
1236
- if (X ? t(9, E.style.top = `${g.top - (R.height + c)}px`, E) : t(9, E.style.top = `${g.bottom + c}px`, E), t(9, E.style.left = `${p}px`, E), E.setAttribute("data-floating", X ? "top" : "bottom"), ie) {
1237
- const H = ie.getBoundingClientRect();
1238
- t(10, ie.style.left = g.left - p + g.width / 2 - H.width / 2 + "px", ie);
2110
+ function mt(n = 20) {
2111
+ if (h(U))
2112
+ if (Ge || (Ge = (v() ? document.querySelector(v()) : w == null ? void 0 : w.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')) || w), Ge) {
2113
+ const s = parseInt(g(), 10) || 12, _ = Ge.getBoundingClientRect(), E = h(U).getBoundingClientRect(), T = document.documentElement.clientHeight, C = document.documentElement.clientWidth, b = c() === "auto" ? _.bottom + E.height + s + n > T : c() === "top", Y = Math.max(n, Math.min(C - n - E.width, _.left + _.width / 2 - E.width / 2));
2114
+ if (b ? h(U).style.top = `${_.top - (E.height + s)}px` : h(U).style.top = `${_.bottom + s}px`, h(U).style.left = `${Y}px`, h(U).setAttribute("data-floating", b ? "top" : "bottom"), h(rt)) {
2115
+ const _e = h(rt).getBoundingClientRect();
2116
+ h(rt).style.left = _.left - Y + _.width / 2 - _e.width / 2 + "px";
1239
2117
  }
1240
2118
  } else
1241
- k("unable to find floating anchor element");
2119
+ S("unable to find floating anchor element");
1242
2120
  }
1243
- async function Nt(r) {
1244
- if (!ee)
2121
+ async function ei(n) {
2122
+ if (!W())
1245
2123
  throw new Error("Attribute verifyurl not set.");
1246
- k("requesting server verification from", ee);
1247
- const c = { payload: r };
1248
- if (_) {
1249
- const { blockedCountries: U, classifier: j, disableRules: X, email: p, expectedLanguages: H, expectedCountries: Re, fields: be, ipAddress: ye, text: Tt, timeZone: tt } = Rt();
1250
- c.blockedCountries = U, c.classifier = j, c.disableRules = X, c.email = p === !1 ? void 0 : It(p), c.expectedCountries = Re, c.expectedLanguages = H || (Ae ? [Ae] : void 0), c.fields = be === !1 ? void 0 : Lt(be), c.ipAddress = ye === !1 ? void 0 : ye || "auto", c.text = Tt, c.timeZone = tt === !1 ? void 0 : tt || xn();
2124
+ S("requesting server verification from", W());
2125
+ const s = { payload: n };
2126
+ if (F() !== !1) {
2127
+ const {
2128
+ blockedCountries: T,
2129
+ classifier: C,
2130
+ disableRules: b,
2131
+ email: Y,
2132
+ expectedLanguages: _e,
2133
+ expectedCountries: A,
2134
+ fields: re,
2135
+ ipAddress: at,
2136
+ text: hi,
2137
+ timeZone: Vr
2138
+ } = Bn();
2139
+ s.blockedCountries = T, s.classifier = C, s.disableRules = b, s.email = Y === !1 ? void 0 : jn(Y), s.expectedCountries = A, s.expectedLanguages = _e || (or ? [or] : void 0), s.fields = re === !1 ? void 0 : Hn(re), s.ipAddress = at === !1 ? void 0 : at || "auto", s.text = hi, s.timeZone = Vr === !1 ? void 0 : Vr || Dl();
1251
2140
  }
1252
- const g = await fetch(ee, {
1253
- body: JSON.stringify(c),
2141
+ const _ = await fetch(W(), {
2142
+ body: JSON.stringify(s),
1254
2143
  headers: { "content-type": "application/json" },
1255
2144
  method: "POST"
1256
2145
  });
1257
- if (g.status !== 200)
1258
- throw new Error(`Server responded with ${g.status}.`);
1259
- const R = await g.json();
1260
- if (R != null && R.payload && t(6, oe = R.payload), de("serververification", R), I && R.classification === "BAD")
2146
+ if (_.status !== 200)
2147
+ throw new Error(`Server responded with ${_.status}.`);
2148
+ const E = await _.json();
2149
+ if (E != null && E.payload && V(Se, le(E.payload)), tt("serververification", E), l() && E.classification === "BAD")
1261
2150
  throw new Error("SpamFilter returned negative classification.");
1262
2151
  }
1263
- function ke(r) {
1264
- k("expire", r), J && (clearTimeout(J), J = null), r < 1 ? Ze() : J = setTimeout(Ze, r);
2152
+ function bt(n) {
2153
+ S("expire", n), fe && (clearTimeout(fe), fe = null), n < 1 ? fr() : fe = setTimeout(fr, n);
1265
2154
  }
1266
- function Ue(r) {
1267
- k("floating", r), z !== r && (t(9, E.style.left = "", E), t(9, E.style.top = "", E)), t(1, z = r === !0 || r === "" ? "auto" : r === !1 || r === "false" ? void 0 : z), z ? (f || t(0, f = "onsubmit"), document.addEventListener("scroll", We), document.addEventListener("click", Ye), window.addEventListener("resize", Me)) : f === "onsubmit" && t(0, f = void 0);
2155
+ function yr(n) {
2156
+ S("floating", n), c() !== n && (h(U).style.left = "", h(U).style.top = ""), c(n === !0 || n === "" ? "auto" : n === !1 || n === "false" ? void 0 : c()), c() ? (r() || r("onsubmit"), document.addEventListener("scroll", dr), document.addEventListener("click", cr), window.addEventListener("resize", mr)) : r() === "onsubmit" && r(void 0);
1268
2157
  }
1269
- function He(r) {
1270
- if (!r.algorithm)
2158
+ function pr(n) {
2159
+ if (!n.algorithm)
1271
2160
  throw new Error("Invalid challenge. Property algorithm is missing.");
1272
- if (r.signature === void 0)
2161
+ if (n.signature === void 0)
1273
2162
  throw new Error("Invalid challenge. Property signature is missing.");
1274
- if (!Ne.includes(r.algorithm.toUpperCase()))
1275
- throw new Error(`Unknown algorithm value. Allowed values: ${Ne.join(", ")}`);
1276
- if (!r.challenge || r.challenge.length < 40)
2163
+ if (!ir.includes(n.algorithm.toUpperCase()))
2164
+ throw new Error(`Unknown algorithm value. Allowed values: ${ir.join(", ")}`);
2165
+ if (!n.challenge || n.challenge.length < 40)
1277
2166
  throw new Error("Challenge is too short. Min. 40 chars.");
1278
- if (!r.salt || r.salt.length < 10)
2167
+ if (!n.salt || n.salt.length < 10)
1279
2168
  throw new Error("Salt is too short. Min. 10 chars.");
1280
2169
  }
1281
- async function Be(r) {
1282
- let c = null;
2170
+ async function wr(n) {
2171
+ let s = null;
1283
2172
  if ("Worker" in window) {
1284
2173
  try {
1285
- c = await At(r, r.maxnumber);
1286
- } catch (g) {
1287
- k(g);
2174
+ s = await ti(n, n.maxnumber);
2175
+ } catch (_) {
2176
+ S(_);
1288
2177
  }
1289
- if ((c == null ? void 0 : c.number) !== void 0 || "obfuscated" in r)
1290
- return { data: r, solution: c };
2178
+ if ((s == null ? void 0 : s.number) !== void 0 || "obfuscated" in n)
2179
+ return { data: n, solution: s };
1291
2180
  }
1292
- if ("obfuscated" in r) {
1293
- const g = await In(r.obfuscated, r.key, r.maxnumber);
1294
- return { data: r, solution: await g.promise };
2181
+ if ("obfuscated" in n) {
2182
+ const _ = await Ol(n.obfuscated, n.key, n.maxnumber);
2183
+ return { data: n, solution: await _.promise };
1295
2184
  }
1296
2185
  return {
1297
- data: r,
1298
- solution: await kn(r.challenge, r.salt, r.algorithm, r.maxnumber || D).promise
2186
+ data: n,
2187
+ solution: await Gl(n.challenge, n.salt, n.algorithm, n.maxnumber || G()).promise
1299
2188
  };
1300
2189
  }
1301
- async function At(r, c = typeof b == "number" ? b : D, g = Math.ceil(le)) {
1302
- const R = [];
1303
- g = Math.min(16, Math.max(1, g));
1304
- for (let X = 0; X < g; X++)
1305
- R.push(altchaCreateWorker(ue));
1306
- const U = Math.ceil(c / g), j = await Promise.all(R.map((X, p) => {
1307
- const H = p * U;
1308
- return new Promise((Re) => {
1309
- X.addEventListener("message", (be) => {
1310
- if (be.data)
1311
- for (const ye of R)
1312
- ye !== X && ye.postMessage({ type: "abort" });
1313
- Re(be.data);
1314
- }), X.postMessage({
1315
- payload: r,
1316
- max: H + U,
1317
- start: H,
2190
+ async function ti(n, s = typeof I() == "number" ? I() : G(), _ = Math.ceil(ue())) {
2191
+ const E = [];
2192
+ _ = Math.min(16, Math.max(1, _));
2193
+ for (let b = 0; b < _; b++)
2194
+ E.push(altchaCreateWorker(et()));
2195
+ const T = Math.ceil(s / _), C = await Promise.all(E.map((b, Y) => {
2196
+ const _e = Y * T;
2197
+ return new Promise((A) => {
2198
+ b.addEventListener("message", (re) => {
2199
+ if (re.data)
2200
+ for (const at of E)
2201
+ at !== b && at.postMessage({ type: "abort" });
2202
+ A(re.data);
2203
+ }), b.postMessage({
2204
+ payload: n,
2205
+ max: _e + T,
2206
+ start: _e,
1318
2207
  type: "work"
1319
2208
  });
1320
2209
  });
1321
2210
  }));
1322
- for (const X of R)
1323
- X.terminate();
1324
- return j.find((X) => !!X) || null;
2211
+ for (const b of E)
2212
+ b.terminate();
2213
+ return C.find((b) => !!b) || null;
1325
2214
  }
1326
- async function ge() {
1327
- if (!x) {
1328
- t(7, C = m.ERROR);
2215
+ async function nt() {
2216
+ if (!D()) {
2217
+ Ne(x.ERROR);
1329
2218
  return;
1330
2219
  }
1331
- const r = te.find((c) => c.constructor.pluginName === "obfuscation");
1332
- if (!r || !("clarify" in r)) {
1333
- t(7, C = m.ERROR), k("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");
2220
+ const n = pe.find((s) => s.constructor.pluginName === "obfuscation");
2221
+ if (!n || !("clarify" in n)) {
2222
+ Ne(x.ERROR), S("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");
1334
2223
  return;
1335
2224
  }
1336
- if ("clarify" in r && typeof r.clarify == "function")
1337
- return r.clarify();
2225
+ if ("clarify" in n && typeof n.clarify == "function")
2226
+ return n.clarify();
1338
2227
  }
1339
- function De(r) {
1340
- r.obfuscated !== void 0 && t(24, x = r.obfuscated), r.auto !== void 0 && (t(0, f = r.auto), f === "onload" && (x ? ge() : ne())), r.blockspam !== void 0 && t(16, I = !!r.blockspam), r.floatinganchor !== void 0 && t(20, O = r.floatinganchor), r.delay !== void 0 && t(18, M = r.delay), r.floatingoffset !== void 0 && t(21, K = r.floatingoffset), r.floating !== void 0 && Ue(r.floating), r.expire !== void 0 && (ke(r.expire), t(19, S = r.expire)), r.challenge && (He(r.challenge), o = r.challenge), r.challengeurl !== void 0 && t(15, v = r.challengeurl), r.debug !== void 0 && t(17, F = !!r.debug), r.hidefooter !== void 0 && t(2, Z = !!r.hidefooter), r.hidelogo !== void 0 && t(3, G = !!r.hidelogo), r.maxnumber !== void 0 && t(22, D = +r.maxnumber), r.mockerror !== void 0 && t(23, Y = !!r.mockerror), r.name !== void 0 && t(4, q = r.name), r.refetchonexpire !== void 0 && t(25, V = !!r.refetchonexpire), r.spamfilter !== void 0 && t(26, _ = typeof r.spamfilter == "object" ? r.spamfilter : !!r.spamfilter), r.strings && t(44, l = r.strings), r.test !== void 0 && t(27, b = typeof r.test == "number" ? r.test : !!r.test), r.verifyurl !== void 0 && t(28, ee = r.verifyurl), r.workers !== void 0 && t(29, le = +r.workers), r.workerurl !== void 0 && t(30, ue = r.workerurl);
2228
+ function Er(n) {
2229
+ n.obfuscated !== void 0 && D(n.obfuscated), n.auto !== void 0 && (r(n.auto), r() === "onload" && (D() ? nt() : we())), n.blockspam !== void 0 && l(!!n.blockspam), n.customfetch !== void 0 && o(n.customfetch), n.floatinganchor !== void 0 && v(n.floatinganchor), n.delay !== void 0 && u(n.delay), n.floatingoffset !== void 0 && g(n.floatingoffset), n.floating !== void 0 && yr(n.floating), n.expire !== void 0 && (bt(n.expire), f(n.expire)), n.challenge && (a(typeof n.challenge == "string" ? n.challenge : JSON.stringify(n.challenge)), pr(h(zt))), n.challengeurl !== void 0 && i(n.challengeurl), n.debug !== void 0 && d(!!n.debug), n.hidefooter !== void 0 && m(!!n.hidefooter), n.hidelogo !== void 0 && p(!!n.hidelogo), n.maxnumber !== void 0 && G(+n.maxnumber), n.mockerror !== void 0 && Q(!!n.mockerror), n.name !== void 0 && L(n.name), n.refetchonexpire !== void 0 && ge(!!n.refetchonexpire), n.spamfilter !== void 0 && F(typeof n.spamfilter == "object" ? n.spamfilter : !!n.spamfilter), n.strings && ye(typeof n.strings == "string" ? n.strings : JSON.stringify(n.strings)), n.test !== void 0 && I(typeof n.test == "number" ? n.test : !!n.test), n.verifyurl !== void 0 && W(n.verifyurl), n.workers !== void 0 && ue(+n.workers), n.workerurl !== void 0 && et(n.workerurl);
1341
2230
  }
1342
- function Je() {
2231
+ function xr() {
1343
2232
  return {
1344
- auto: f,
1345
- blockspam: I,
1346
- challengeurl: v,
1347
- debug: F,
1348
- delay: M,
1349
- expire: S,
1350
- floating: z,
1351
- floatinganchor: O,
1352
- floatingoffset: K,
1353
- hidefooter: Z,
1354
- hidelogo: G,
1355
- name: q,
1356
- maxnumber: D,
1357
- mockerror: Y,
1358
- obfuscated: x,
1359
- refetchonexpire: V,
1360
- spamfilter: _,
1361
- strings: s,
1362
- test: b,
1363
- verifyurl: ee,
1364
- workers: le,
1365
- workerurl: ue
2233
+ auto: r(),
2234
+ blockspam: l(),
2235
+ challengeurl: i(),
2236
+ debug: d(),
2237
+ delay: u(),
2238
+ expire: f(),
2239
+ floating: c(),
2240
+ floatinganchor: v(),
2241
+ floatingoffset: g(),
2242
+ hidefooter: m(),
2243
+ hidelogo: p(),
2244
+ name: L(),
2245
+ maxnumber: G(),
2246
+ mockerror: Q(),
2247
+ obfuscated: D(),
2248
+ refetchonexpire: ge(),
2249
+ spamfilter: F(),
2250
+ strings: h(ee),
2251
+ test: I(),
2252
+ verifyurl: W(),
2253
+ workers: ue(),
2254
+ workerurl: et()
1366
2255
  };
1367
2256
  }
1368
- function Oe() {
1369
- return se;
2257
+ function kr() {
2258
+ return Ge;
1370
2259
  }
1371
- function Xt(r) {
1372
- return te.find((c) => c.constructor.pluginName === r);
2260
+ function ri(n) {
2261
+ return pe.find((s) => s.constructor.pluginName === n);
1373
2262
  }
1374
- function Ke() {
1375
- return C;
2263
+ function Cr() {
2264
+ return h($);
1376
2265
  }
1377
- function me(r = m.UNVERIFIED, c = null) {
1378
- J && (clearTimeout(J), J = null), t(8, re = !1), t(5, he = c), t(6, oe = null), t(7, C = r);
2266
+ function it(n = x.UNVERIFIED, s = null) {
2267
+ fe && (clearTimeout(fe), fe = null), V(ze, !1), V(Se, null), Ne(n, s);
1379
2268
  }
1380
- function $e(r) {
1381
- se = r;
2269
+ function Rr(n) {
2270
+ Ge = n;
1382
2271
  }
1383
- function Qe(r, c = null) {
1384
- t(7, C = r), t(5, he = c);
2272
+ function Ne(n, s = null) {
2273
+ V($, le(n)), V(De, le(s)), tt("statechange", {
2274
+ payload: h(Se),
2275
+ state: h($)
2276
+ });
1385
2277
  }
1386
- async function ne() {
1387
- return me(m.VERIFYING), await new Promise((r) => setTimeout(r, M || 0)), Ct().then((r) => (He(r), k("challenge", r), Be(r))).then(({ data: r, solution: c }) => {
1388
- if (k("solution", c), "challenge" in r && c && !("clearText" in c))
1389
- if ((c == null ? void 0 : c.number) !== void 0) {
1390
- if (ee)
1391
- return Nt(Xe(r, c));
1392
- t(6, oe = Xe(r, c)), k("payload", oe);
2278
+ async function we() {
2279
+ return it(x.VERIFYING), await new Promise((n) => setTimeout(n, u() || 0)), Mn().then((n) => (pr(n), S("challenge", n), wr(n))).then(({ data: n, solution: s }) => {
2280
+ if (S("solution", s), "challenge" in n && s && !("clearText" in s))
2281
+ if ((s == null ? void 0 : s.number) !== void 0) {
2282
+ if (W())
2283
+ return ei(ur(n, s));
2284
+ V(Se, le(ur(n, s))), S("payload", h(Se));
1393
2285
  } else
1394
- throw k("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned.");
2286
+ throw S("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned.");
1395
2287
  }).then(() => {
1396
- t(7, C = m.VERIFIED), k("verified"), cn().then(() => {
1397
- de("verified", { payload: oe });
2288
+ Ne(x.VERIFIED), S("verified"), cl().then(() => {
2289
+ tt("verified", { payload: h(Se) });
1398
2290
  });
1399
- }).catch((r) => {
1400
- k(r), t(7, C = m.ERROR), t(5, he = r.message);
2291
+ }).catch((n) => {
2292
+ S(n), Ne(x.ERROR, n.message);
1401
2293
  });
1402
2294
  }
1403
- function Zt() {
1404
- re = this.checked, t(8, re);
2295
+ var Ir = ql(), $r = Ot(Ir);
2296
+ El($r, t, "default", {});
2297
+ var lt = me($r, 2), Gt = J(lt), Sr = J(Gt);
2298
+ {
2299
+ var ni = (n) => {
2300
+ var s = Xl();
2301
+ K(n, s);
2302
+ };
2303
+ Ee(Sr, (n) => {
2304
+ h($) === x.VERIFYING && n(ni);
2305
+ });
1405
2306
  }
1406
- function Yt(r) {
1407
- Ie[r ? "unshift" : "push"](() => {
1408
- ie = r, t(10, ie);
2307
+ var yt = me(Sr, 2), Ye = J(yt);
2308
+ Ur(Ye), Ye.__change = Kn, H(yt);
2309
+ var Dt = me(yt, 2), ii = J(Dt);
2310
+ {
2311
+ var li = (n) => {
2312
+ var s = Zl(), _ = Ot(s), E = J(_);
2313
+ Ze(E, () => h(ee).verified), H(_);
2314
+ var T = me(_, 2);
2315
+ Ur(T), Oe(() => {
2316
+ ie(T, "name", L()), kl(T, h(Se));
2317
+ }), K(n, s);
2318
+ }, ai = (n) => {
2319
+ var s = ml(), _ = Ot(s);
2320
+ {
2321
+ var E = (C) => {
2322
+ var b = Wl(), Y = J(b);
2323
+ Ze(Y, () => h(ee).verifying), H(b), K(C, b);
2324
+ }, T = (C) => {
2325
+ var b = Ul(), Y = J(b);
2326
+ Ze(Y, () => h(ee).label), H(b), Oe(() => ie(b, "for", `${L() ?? ""}_checkbox`)), K(C, b);
2327
+ };
2328
+ Ee(
2329
+ _,
2330
+ (C) => {
2331
+ h($) === x.VERIFYING ? C(E) : C(T, !1);
2332
+ },
2333
+ !0
2334
+ );
2335
+ }
2336
+ K(n, s);
2337
+ };
2338
+ Ee(ii, (n) => {
2339
+ h($) === x.VERIFIED ? n(li) : n(ai, !1);
1409
2340
  });
1410
2341
  }
1411
- function Wt(r) {
1412
- Ie[r ? "unshift" : "push"](() => {
1413
- E = r, t(9, E);
2342
+ H(Dt);
2343
+ var oi = me(Dt, 2);
2344
+ {
2345
+ var si = (n) => {
2346
+ var s = Ml(), _ = J(s);
2347
+ ie(_, "href", ar), H(s), Oe(() => ie(_, "aria-label", h(ee).ariaLinkLabel)), K(n, s);
2348
+ };
2349
+ Ee(oi, (n) => {
2350
+ (p() !== !0 || h(Pt)) && n(si);
1414
2351
  });
1415
2352
  }
1416
- return n.$$set = (r) => {
1417
- "auto" in r && t(0, f = r.auto), "blockspam" in r && t(16, I = r.blockspam), "challengeurl" in r && t(15, v = r.challengeurl), "challengejson" in r && t(31, P = r.challengejson), "debug" in r && t(17, F = r.debug), "delay" in r && t(18, M = r.delay), "expire" in r && t(19, S = r.expire), "floating" in r && t(1, z = r.floating), "floatinganchor" in r && t(20, O = r.floatinganchor), "floatingoffset" in r && t(21, K = r.floatingoffset), "hidefooter" in r && t(2, Z = r.hidefooter), "hidelogo" in r && t(3, G = r.hidelogo), "name" in r && t(4, q = r.name), "maxnumber" in r && t(22, D = r.maxnumber), "mockerror" in r && t(23, Y = r.mockerror), "obfuscated" in r && t(24, x = r.obfuscated), "plugins" in r && t(32, N = r.plugins), "refetchonexpire" in r && t(25, V = r.refetchonexpire), "spamfilter" in r && t(26, _ = r.spamfilter), "strings" in r && t(33, u = r.strings), "test" in r && t(27, b = r.test), "verifyurl" in r && t(28, ee = r.verifyurl), "workers" in r && t(29, le = r.workers), "workerurl" in r && t(30, ue = r.workerurl), "$$scope" in r && t(45, h = r.$$scope);
1418
- }, n.$$.update = () => {
1419
- n.$$.dirty[0] & /*challengeurl*/
1420
- 32768 | n.$$.dirty[1] & /*challengejson*/
1421
- 1 && t(12, i = P && new URL(P, location.origin).host.endsWith(".altcha.org") && !!(v != null && v.includes("apiKey=ckey_"))), n.$$.dirty[1] & /*challengejson*/
1422
- 1 && (o = P ? dt(P) : void 0), n.$$.dirty[1] & /*strings*/
1423
- 4 && t(44, l = u ? dt(u) : {}), n.$$.dirty[1] & /*parsedStrings*/
1424
- 8192 && t(11, s = {
1425
- ariaLinkLabel: ut,
1426
- error: "Verification failed. Try again later.",
1427
- expired: "Verification expired. Try again.",
1428
- footer: `Protected by <a href="${xt}" target="_blank" aria-label="${l.ariaLinkLabel || ut}">ALTCHA</a>`,
1429
- label: "I'm not a robot",
1430
- verified: "Verified",
1431
- verifying: "Verifying...",
1432
- waitAlert: "Verifying... please wait.",
1433
- ...l
1434
- }), n.$$.dirty[0] & /*payload, state*/
1435
- 192 && de("statechange", { payload: oe, state: C }), n.$$.dirty[0] & /*error*/
1436
- 32 && St(), n.$$.dirty[0] & /*state*/
1437
- 128 && Gt();
1438
- }, [
1439
- f,
1440
- z,
1441
- Z,
1442
- G,
1443
- q,
1444
- he,
1445
- oe,
1446
- C,
1447
- re,
1448
- E,
1449
- ie,
1450
- s,
1451
- i,
1452
- Vt,
1453
- Fe,
1454
- v,
1455
- I,
1456
- F,
1457
- M,
1458
- S,
1459
- O,
1460
- K,
1461
- D,
1462
- Y,
1463
- x,
1464
- V,
1465
- _,
1466
- b,
1467
- ee,
1468
- le,
1469
- ue,
1470
- P,
1471
- N,
1472
- u,
1473
- ge,
1474
- De,
1475
- Je,
1476
- Oe,
1477
- Xt,
1478
- Ke,
1479
- me,
1480
- $e,
1481
- Qe,
1482
- ne,
1483
- l,
1484
- h,
1485
- d,
1486
- Zt,
1487
- Yt,
1488
- Wt
1489
- ];
1490
- }
1491
- class Xn extends vn {
1492
- constructor(e) {
1493
- super(), bn(
1494
- this,
1495
- e,
1496
- An,
1497
- Nn,
1498
- Ht,
2353
+ H(Gt);
2354
+ var Nr = me(Gt, 2);
2355
+ {
2356
+ var ui = (n) => {
2357
+ var s = Hl(), _ = me(J(s), 2);
1499
2358
  {
1500
- auto: 0,
1501
- blockspam: 16,
1502
- challengeurl: 15,
1503
- challengejson: 31,
1504
- debug: 17,
1505
- delay: 18,
1506
- expire: 19,
1507
- floating: 1,
1508
- floatinganchor: 20,
1509
- floatingoffset: 21,
1510
- hidefooter: 2,
1511
- hidelogo: 3,
1512
- name: 4,
1513
- maxnumber: 22,
1514
- mockerror: 23,
1515
- obfuscated: 24,
1516
- plugins: 32,
1517
- refetchonexpire: 25,
1518
- spamfilter: 26,
1519
- strings: 33,
1520
- test: 27,
1521
- verifyurl: 28,
1522
- workers: 29,
1523
- workerurl: 30,
1524
- clarify: 34,
1525
- configure: 35,
1526
- getConfiguration: 36,
1527
- getFloatingAnchor: 37,
1528
- getPlugin: 38,
1529
- getState: 39,
1530
- reset: 40,
1531
- setFloatingAnchor: 41,
1532
- setState: 42,
1533
- verify: 43
1534
- },
1535
- Rn,
1536
- [-1, -1, -1]
1537
- );
1538
- }
1539
- get auto() {
1540
- return this.$$.ctx[0];
1541
- }
1542
- set auto(e) {
1543
- this.$$set({ auto: e }), w();
1544
- }
1545
- get blockspam() {
1546
- return this.$$.ctx[16];
1547
- }
1548
- set blockspam(e) {
1549
- this.$$set({ blockspam: e }), w();
1550
- }
1551
- get challengeurl() {
1552
- return this.$$.ctx[15];
1553
- }
1554
- set challengeurl(e) {
1555
- this.$$set({ challengeurl: e }), w();
1556
- }
1557
- get challengejson() {
1558
- return this.$$.ctx[31];
1559
- }
1560
- set challengejson(e) {
1561
- this.$$set({ challengejson: e }), w();
1562
- }
1563
- get debug() {
1564
- return this.$$.ctx[17];
1565
- }
1566
- set debug(e) {
1567
- this.$$set({ debug: e }), w();
1568
- }
1569
- get delay() {
1570
- return this.$$.ctx[18];
1571
- }
1572
- set delay(e) {
1573
- this.$$set({ delay: e }), w();
1574
- }
1575
- get expire() {
1576
- return this.$$.ctx[19];
1577
- }
1578
- set expire(e) {
1579
- this.$$set({ expire: e }), w();
1580
- }
1581
- get floating() {
1582
- return this.$$.ctx[1];
1583
- }
1584
- set floating(e) {
1585
- this.$$set({ floating: e }), w();
1586
- }
1587
- get floatinganchor() {
1588
- return this.$$.ctx[20];
1589
- }
1590
- set floatinganchor(e) {
1591
- this.$$set({ floatinganchor: e }), w();
1592
- }
1593
- get floatingoffset() {
1594
- return this.$$.ctx[21];
1595
- }
1596
- set floatingoffset(e) {
1597
- this.$$set({ floatingoffset: e }), w();
1598
- }
1599
- get hidefooter() {
1600
- return this.$$.ctx[2];
1601
- }
1602
- set hidefooter(e) {
1603
- this.$$set({ hidefooter: e }), w();
1604
- }
1605
- get hidelogo() {
1606
- return this.$$.ctx[3];
1607
- }
1608
- set hidelogo(e) {
1609
- this.$$set({ hidelogo: e }), w();
1610
- }
1611
- get name() {
1612
- return this.$$.ctx[4];
1613
- }
1614
- set name(e) {
1615
- this.$$set({ name: e }), w();
1616
- }
1617
- get maxnumber() {
1618
- return this.$$.ctx[22];
1619
- }
1620
- set maxnumber(e) {
1621
- this.$$set({ maxnumber: e }), w();
1622
- }
1623
- get mockerror() {
1624
- return this.$$.ctx[23];
1625
- }
1626
- set mockerror(e) {
1627
- this.$$set({ mockerror: e }), w();
1628
- }
1629
- get obfuscated() {
1630
- return this.$$.ctx[24];
1631
- }
1632
- set obfuscated(e) {
1633
- this.$$set({ obfuscated: e }), w();
1634
- }
1635
- get plugins() {
1636
- return this.$$.ctx[32];
1637
- }
1638
- set plugins(e) {
1639
- this.$$set({ plugins: e }), w();
1640
- }
1641
- get refetchonexpire() {
1642
- return this.$$.ctx[25];
1643
- }
1644
- set refetchonexpire(e) {
1645
- this.$$set({ refetchonexpire: e }), w();
1646
- }
1647
- get spamfilter() {
1648
- return this.$$.ctx[26];
1649
- }
1650
- set spamfilter(e) {
1651
- this.$$set({ spamfilter: e }), w();
1652
- }
1653
- get strings() {
1654
- return this.$$.ctx[33];
1655
- }
1656
- set strings(e) {
1657
- this.$$set({ strings: e }), w();
1658
- }
1659
- get test() {
1660
- return this.$$.ctx[27];
1661
- }
1662
- set test(e) {
1663
- this.$$set({ test: e }), w();
1664
- }
1665
- get verifyurl() {
1666
- return this.$$.ctx[28];
1667
- }
1668
- set verifyurl(e) {
1669
- this.$$set({ verifyurl: e }), w();
1670
- }
1671
- get workers() {
1672
- return this.$$.ctx[29];
1673
- }
1674
- set workers(e) {
1675
- this.$$set({ workers: e }), w();
1676
- }
1677
- get workerurl() {
1678
- return this.$$.ctx[30];
1679
- }
1680
- set workerurl(e) {
1681
- this.$$set({ workerurl: e }), w();
1682
- }
1683
- get clarify() {
1684
- return this.$$.ctx[34];
1685
- }
1686
- get configure() {
1687
- return this.$$.ctx[35];
1688
- }
1689
- get getConfiguration() {
1690
- return this.$$.ctx[36];
1691
- }
1692
- get getFloatingAnchor() {
1693
- return this.$$.ctx[37];
1694
- }
1695
- get getPlugin() {
1696
- return this.$$.ctx[38];
1697
- }
1698
- get getState() {
1699
- return this.$$.ctx[39];
1700
- }
1701
- get reset() {
1702
- return this.$$.ctx[40];
1703
- }
1704
- get setFloatingAnchor() {
1705
- return this.$$.ctx[41];
2359
+ var E = (C) => {
2360
+ var b = jl(), Y = J(b);
2361
+ Ze(Y, () => h(ee).expired), H(b), Oe(() => ie(b, "title", h(De))), K(C, b);
2362
+ }, T = (C) => {
2363
+ var b = Bl(), Y = J(b);
2364
+ Ze(Y, () => h(ee).error), H(b), Oe(() => ie(b, "title", h(De))), K(C, b);
2365
+ };
2366
+ Ee(_, (C) => {
2367
+ h($) === x.EXPIRED ? C(E) : C(T, !1);
2368
+ });
2369
+ }
2370
+ H(s), K(n, s);
2371
+ };
2372
+ Ee(Nr, (n) => {
2373
+ (h(De) || h($) === x.EXPIRED) && n(ui);
2374
+ });
1706
2375
  }
1707
- get setState() {
1708
- return this.$$.ctx[42];
2376
+ var Lr = me(Nr, 2);
2377
+ {
2378
+ var fi = (n) => {
2379
+ var s = Jl(), _ = J(s), E = J(_);
2380
+ Ze(E, () => h(ee).footer), H(_), H(s), K(n, s);
2381
+ };
2382
+ Ee(Lr, (n) => {
2383
+ h(ee).footer && (m() !== !0 || h(Pt)) && n(fi);
2384
+ });
1709
2385
  }
1710
- get verify() {
1711
- return this.$$.ctx[43];
2386
+ var ci = me(Lr, 2);
2387
+ {
2388
+ var di = (n) => {
2389
+ var s = Kl();
2390
+ Br(s, (_) => V(rt, _), () => h(rt)), K(n, s);
2391
+ };
2392
+ Ee(ci, (n) => {
2393
+ c() && n(di);
2394
+ });
1712
2395
  }
2396
+ return H(lt), Br(lt, (n) => V(U, n), () => h(U)), Oe(() => {
2397
+ ie(lt, "data-state", h($)), ie(lt, "data-floating", c()), Rl(yt, "altcha-hidden", h($) === x.VERIFYING), ie(Ye, "id", `${L() ?? ""}_checkbox`), Ye.required = r() !== "onsubmit" && (!c() || r() !== "off");
2398
+ }), gl("invalid", Ye, _r), Il(Ye, () => h(ze), (n) => V(ze, n)), K(e, Ir), Vn({
2399
+ clarify: nt,
2400
+ configure: Er,
2401
+ getConfiguration: xr,
2402
+ getFloatingAnchor: kr,
2403
+ getPlugin: ri,
2404
+ getState: Cr,
2405
+ reset: it,
2406
+ setFloatingAnchor: Rr,
2407
+ setState: Ne,
2408
+ verify: we,
2409
+ get auto() {
2410
+ return r();
2411
+ },
2412
+ set auto(n = void 0) {
2413
+ r(n), k();
2414
+ },
2415
+ get blockspam() {
2416
+ return l();
2417
+ },
2418
+ set blockspam(n = void 0) {
2419
+ l(n), k();
2420
+ },
2421
+ get challengeurl() {
2422
+ return i();
2423
+ },
2424
+ set challengeurl(n = void 0) {
2425
+ i(n), k();
2426
+ },
2427
+ get challengejson() {
2428
+ return a();
2429
+ },
2430
+ set challengejson(n = void 0) {
2431
+ a(n), k();
2432
+ },
2433
+ get customfetch() {
2434
+ return o();
2435
+ },
2436
+ set customfetch(n = void 0) {
2437
+ o(n), k();
2438
+ },
2439
+ get debug() {
2440
+ return d();
2441
+ },
2442
+ set debug(n = !1) {
2443
+ d(n), k();
2444
+ },
2445
+ get delay() {
2446
+ return u();
2447
+ },
2448
+ set delay(n = 0) {
2449
+ u(n), k();
2450
+ },
2451
+ get expire() {
2452
+ return f();
2453
+ },
2454
+ set expire(n = void 0) {
2455
+ f(n), k();
2456
+ },
2457
+ get floating() {
2458
+ return c();
2459
+ },
2460
+ set floating(n = void 0) {
2461
+ c(n), k();
2462
+ },
2463
+ get floatinganchor() {
2464
+ return v();
2465
+ },
2466
+ set floatinganchor(n = void 0) {
2467
+ v(n), k();
2468
+ },
2469
+ get floatingoffset() {
2470
+ return g();
2471
+ },
2472
+ set floatingoffset(n = void 0) {
2473
+ g(n), k();
2474
+ },
2475
+ get hidefooter() {
2476
+ return m();
2477
+ },
2478
+ set hidefooter(n = !1) {
2479
+ m(n), k();
2480
+ },
2481
+ get hidelogo() {
2482
+ return p();
2483
+ },
2484
+ set hidelogo(n = !1) {
2485
+ p(n), k();
2486
+ },
2487
+ get name() {
2488
+ return L();
2489
+ },
2490
+ set name(n = "altcha") {
2491
+ L(n), k();
2492
+ },
2493
+ get maxnumber() {
2494
+ return G();
2495
+ },
2496
+ set maxnumber(n = 1e6) {
2497
+ G(n), k();
2498
+ },
2499
+ get mockerror() {
2500
+ return Q();
2501
+ },
2502
+ set mockerror(n = !1) {
2503
+ Q(n), k();
2504
+ },
2505
+ get obfuscated() {
2506
+ return D();
2507
+ },
2508
+ set obfuscated(n = void 0) {
2509
+ D(n), k();
2510
+ },
2511
+ get plugins() {
2512
+ return Z();
2513
+ },
2514
+ set plugins(n = void 0) {
2515
+ Z(n), k();
2516
+ },
2517
+ get refetchonexpire() {
2518
+ return ge();
2519
+ },
2520
+ set refetchonexpire(n = !0) {
2521
+ ge(n), k();
2522
+ },
2523
+ get spamfilter() {
2524
+ return F();
2525
+ },
2526
+ set spamfilter(n = !1) {
2527
+ F(n), k();
2528
+ },
2529
+ get strings() {
2530
+ return ye();
2531
+ },
2532
+ set strings(n = void 0) {
2533
+ ye(n), k();
2534
+ },
2535
+ get test() {
2536
+ return I();
2537
+ },
2538
+ set test(n = !1) {
2539
+ I(n), k();
2540
+ },
2541
+ get verifyurl() {
2542
+ return W();
2543
+ },
2544
+ set verifyurl(n = void 0) {
2545
+ W(n), k();
2546
+ },
2547
+ get workers() {
2548
+ return ue();
2549
+ },
2550
+ set workers(n = Math.min(16, navigator.hardwareConcurrency || 8)) {
2551
+ ue(n), k();
2552
+ },
2553
+ get workerurl() {
2554
+ return et();
2555
+ },
2556
+ set workerurl(n = void 0) {
2557
+ et(n), k();
2558
+ }
2559
+ });
1713
2560
  }
1714
- customElements.define("altcha-widget", yn(
1715
- Xn,
1716
- { auto: {}, blockspam: {}, challengeurl: {}, challengejson: {}, debug: { type: "Boolean" }, delay: {}, expire: {}, floating: {}, floatinganchor: {}, floatingoffset: {}, hidefooter: { type: "Boolean" }, hidelogo: { type: "Boolean" }, name: {}, maxnumber: {}, mockerror: { type: "Boolean" }, obfuscated: {}, plugins: {}, refetchonexpire: { type: "Boolean" }, spamfilter: { type: "Boolean" }, strings: {}, test: { type: "Boolean" }, verifyurl: {}, workers: {}, workerurl: {} },
2561
+ _l(["change"]);
2562
+ customElements.define("altcha-widget", Vl(
2563
+ ea,
2564
+ {
2565
+ blockspam: { type: "Boolean" },
2566
+ debug: { type: "Boolean" },
2567
+ delay: { type: "Number" },
2568
+ expire: { type: "Number" },
2569
+ floatingoffset: { type: "Number" },
2570
+ hidefooter: { type: "Boolean" },
2571
+ hidelogo: { type: "Boolean" },
2572
+ maxnumber: { type: "Number" },
2573
+ mockerror: { type: "Boolean" },
2574
+ refetchonexpire: { type: "Boolean" },
2575
+ test: { type: "Boolean" },
2576
+ workers: { type: "Number" },
2577
+ auto: {},
2578
+ challengeurl: {},
2579
+ challengejson: {},
2580
+ customfetch: {},
2581
+ floating: {},
2582
+ floatinganchor: {},
2583
+ name: {},
2584
+ obfuscated: {},
2585
+ plugins: {},
2586
+ spamfilter: {},
2587
+ strings: {},
2588
+ verifyurl: {},
2589
+ workerurl: {}
2590
+ },
1717
2591
  ["default"],
1718
2592
  [
1719
2593
  "clarify",
@@ -1729,8 +2603,8 @@ customElements.define("altcha-widget", yn(
1729
2603
  ],
1730
2604
  !1
1731
2605
  ));
1732
- globalThis.altchaCreateWorker = (n) => n ? new Worker(new URL(n)) : new Mt();
2606
+ globalThis.altchaCreateWorker = (e) => e ? new Worker(new URL(e)) : new mi();
1733
2607
  globalThis.altchaPlugins = globalThis.altchaPlugins || [];
1734
2608
  export {
1735
- Xn as Altcha
2609
+ ea as Altcha
1736
2610
  };