altcha 0.1.7 → 0.1.9

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,37 +1,37 @@
1
- var Ae = Object.defineProperty;
2
- var Ge = (t, e, n) => e in t ? Ae(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var x = (t, e, n) => (Ge(t, typeof e != "symbol" ? e + "" : e, n), n);
1
+ var Ge = Object.defineProperty;
2
+ var Se = (t, e, n) => e in t ? Ge(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var L = (t, e, n) => (Se(t, typeof e != "symbol" ? e + "" : e, n), n);
4
4
  function Z() {
5
5
  }
6
- function de(t) {
6
+ function ge(t) {
7
7
  return t();
8
8
  }
9
9
  function ie() {
10
10
  return /* @__PURE__ */ Object.create(null);
11
11
  }
12
- function W(t) {
13
- t.forEach(de);
12
+ function P(t) {
13
+ t.forEach(ge);
14
14
  }
15
- function ve(t) {
15
+ function be(t) {
16
16
  return typeof t == "function";
17
17
  }
18
- function Se(t, e) {
18
+ function Ue(t, e) {
19
19
  return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
20
20
  }
21
- function Ue(t) {
21
+ function Ve(t) {
22
22
  return Object.keys(t).length === 0;
23
23
  }
24
- function g(t, e) {
24
+ function b(t, e) {
25
25
  t.appendChild(e);
26
26
  }
27
- function Ve(t, e, n) {
28
- const i = Me(t);
29
- if (!i.getElementById(e)) {
30
- const l = _("style");
31
- l.id = e, l.textContent = n, Fe(i, l);
27
+ function Me(t, e, n) {
28
+ const o = Fe(t);
29
+ if (!o.getElementById(e)) {
30
+ const l = $("style");
31
+ l.id = e, l.textContent = n, Oe(o, l);
32
32
  }
33
33
  }
34
- function Me(t) {
34
+ function Fe(t) {
35
35
  if (!t)
36
36
  return document;
37
37
  const e = t.getRootNode ? t.getRootNode() : t.ownerDocument;
@@ -41,47 +41,47 @@ function Me(t) {
41
41
  e
42
42
  ) : t.ownerDocument;
43
43
  }
44
- function Fe(t, e) {
45
- return g(
44
+ function Oe(t, e) {
45
+ return b(
46
46
  /** @type {Document} */
47
47
  t.head || t,
48
48
  e
49
49
  ), e.sheet;
50
50
  }
51
- function R(t, e, n) {
51
+ function N(t, e, n) {
52
52
  t.insertBefore(e, n || null);
53
53
  }
54
- function L(t) {
54
+ function I(t) {
55
55
  t.parentNode && t.parentNode.removeChild(t);
56
56
  }
57
- function _(t) {
57
+ function $(t) {
58
58
  return document.createElement(t);
59
59
  }
60
- function G(t) {
60
+ function S(t) {
61
61
  return document.createElementNS("http://www.w3.org/2000/svg", t);
62
62
  }
63
- function Oe(t) {
63
+ function Ye(t) {
64
64
  return document.createTextNode(t);
65
65
  }
66
66
  function M() {
67
- return Oe(" ");
67
+ return Ye(" ");
68
68
  }
69
- function K(t, e, n, i) {
70
- return t.addEventListener(e, n, i), () => t.removeEventListener(e, n, i);
69
+ function K(t, e, n, o) {
70
+ return t.addEventListener(e, n, o), () => t.removeEventListener(e, n, o);
71
71
  }
72
72
  function c(t, e, n) {
73
73
  n == null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n);
74
74
  }
75
- function Ye(t) {
75
+ function Ze(t) {
76
76
  return Array.from(t.childNodes);
77
77
  }
78
78
  function le(t, e, n) {
79
79
  t.classList.toggle(e, !!n);
80
80
  }
81
- function Ze(t, e, { bubbles: n = !1, cancelable: i = !1 } = {}) {
82
- return new CustomEvent(t, { detail: e, bubbles: n, cancelable: i });
81
+ function Be(t, e, { bubbles: n = !1, cancelable: o = !1 } = {}) {
82
+ return new CustomEvent(t, { detail: e, bubbles: n, cancelable: o });
83
83
  }
84
- function Be(t) {
84
+ function He(t) {
85
85
  const e = {};
86
86
  return t.childNodes.forEach(
87
87
  /** @param {Element} node */
@@ -90,31 +90,31 @@ function Be(t) {
90
90
  }
91
91
  ), e;
92
92
  }
93
- let H;
94
- function B(t) {
95
- H = t;
93
+ let W;
94
+ function H(t) {
95
+ W = t;
96
96
  }
97
97
  function ee() {
98
- if (!H)
98
+ if (!W)
99
99
  throw new Error("Function called outside component initialization");
100
- return H;
100
+ return W;
101
101
  }
102
- function He(t) {
102
+ function We(t) {
103
103
  ee().$$.on_mount.push(t);
104
104
  }
105
- function We(t) {
105
+ function Pe(t) {
106
106
  ee().$$.on_destroy.push(t);
107
107
  }
108
- function Pe() {
108
+ function Te() {
109
109
  const t = ee();
110
- return (e, n, { cancelable: i = !1 } = {}) => {
110
+ return (e, n, { cancelable: o = !1 } = {}) => {
111
111
  const l = t.$$.callbacks[e];
112
112
  if (l) {
113
- const r = Ze(
113
+ const r = Be(
114
114
  /** @type {string} */
115
115
  e,
116
116
  n,
117
- { cancelable: i }
117
+ { cancelable: o }
118
118
  );
119
119
  return l.slice().forEach((s) => {
120
120
  s.call(t, r);
@@ -125,13 +125,13 @@ function Pe() {
125
125
  }
126
126
  const O = [], J = [];
127
127
  let Y = [];
128
- const oe = [], ge = /* @__PURE__ */ Promise.resolve();
128
+ const se = [], me = /* @__PURE__ */ Promise.resolve();
129
129
  let Q = !1;
130
- function me() {
131
- Q || (Q = !0, ge.then(C));
130
+ function ve() {
131
+ Q || (Q = !0, me.then(C));
132
132
  }
133
- function Te() {
134
- return me(), ge;
133
+ function Xe() {
134
+ return ve(), me;
135
135
  }
136
136
  function q(t) {
137
137
  Y.push(t);
@@ -141,17 +141,17 @@ let F = 0;
141
141
  function C() {
142
142
  if (F !== 0)
143
143
  return;
144
- const t = H;
144
+ const t = W;
145
145
  do {
146
146
  try {
147
147
  for (; F < O.length; ) {
148
148
  const e = O[F];
149
- F++, B(e), Xe(e.$$);
149
+ F++, H(e), De(e.$$);
150
150
  }
151
151
  } catch (e) {
152
152
  throw O.length = 0, F = 0, e;
153
153
  }
154
- for (B(null), O.length = 0, F = 0; J.length; )
154
+ for (H(null), O.length = 0, F = 0; J.length; )
155
155
  J.pop()();
156
156
  for (let e = 0; e < Y.length; e += 1) {
157
157
  const n = Y[e];
@@ -159,43 +159,43 @@ function C() {
159
159
  }
160
160
  Y.length = 0;
161
161
  } while (O.length);
162
- for (; oe.length; )
163
- oe.pop()();
164
- Q = !1, z.clear(), B(t);
162
+ for (; se.length; )
163
+ se.pop()();
164
+ Q = !1, z.clear(), H(t);
165
165
  }
166
- function Xe(t) {
166
+ function De(t) {
167
167
  if (t.fragment !== null) {
168
- t.update(), W(t.before_update);
168
+ t.update(), P(t.before_update);
169
169
  const e = t.dirty;
170
170
  t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(q);
171
171
  }
172
172
  }
173
- function De(t) {
173
+ function Ke(t) {
174
174
  const e = [], n = [];
175
- Y.forEach((i) => t.indexOf(i) === -1 ? e.push(i) : n.push(i)), n.forEach((i) => i()), Y = e;
175
+ Y.forEach((o) => t.indexOf(o) === -1 ? e.push(o) : n.push(o)), n.forEach((o) => o()), Y = e;
176
176
  }
177
- const Ke = /* @__PURE__ */ new Set();
178
- function ze(t, e) {
179
- t && t.i && (Ke.delete(t), t.i(e));
177
+ const ze = /* @__PURE__ */ new Set();
178
+ function Je(t, e) {
179
+ t && t.i && (ze.delete(t), t.i(e));
180
180
  }
181
- function Je(t, e, n) {
182
- const { fragment: i, after_update: l } = t.$$;
183
- i && i.m(e, n), q(() => {
184
- const r = t.$$.on_mount.map(de).filter(ve);
185
- t.$$.on_destroy ? t.$$.on_destroy.push(...r) : W(r), t.$$.on_mount = [];
181
+ function Qe(t, e, n) {
182
+ const { fragment: o, after_update: l } = t.$$;
183
+ o && o.m(e, n), q(() => {
184
+ const r = t.$$.on_mount.map(ge).filter(be);
185
+ t.$$.on_destroy ? t.$$.on_destroy.push(...r) : P(r), t.$$.on_mount = [];
186
186
  }), l.forEach(q);
187
187
  }
188
- function Qe(t, e) {
188
+ function qe(t, e) {
189
189
  const n = t.$$;
190
- n.fragment !== null && (De(n.after_update), W(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []);
190
+ n.fragment !== null && (Ke(n.after_update), P(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []);
191
191
  }
192
- function qe(t, e) {
193
- t.$$.dirty[0] === -1 && (O.push(t), me(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
192
+ function et(t, e) {
193
+ t.$$.dirty[0] === -1 && (O.push(t), ve(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
194
194
  }
195
- function et(t, e, n, i, l, r, s = null, a = [-1]) {
196
- const f = H;
197
- B(t);
198
- const u = t.$$ = {
195
+ function tt(t, e, n, o, l, r, s = null, u = [-1]) {
196
+ const f = W;
197
+ H(t);
198
+ const a = t.$$ = {
199
199
  fragment: null,
200
200
  ctx: [],
201
201
  // state
@@ -212,58 +212,58 @@ function et(t, e, n, i, l, r, s = null, a = [-1]) {
212
212
  context: new Map(e.context || (f ? f.$$.context : [])),
213
213
  // everything else
214
214
  callbacks: ie(),
215
- dirty: a,
215
+ dirty: u,
216
216
  skip_bound: !1,
217
217
  root: e.target || f.$$.root
218
218
  };
219
- s && s(u.root);
220
- let N = !1;
221
- if (u.ctx = n ? n(t, e.props || {}, (y, j, ...I) => {
222
- const A = I.length ? I[0] : j;
223
- return u.ctx && l(u.ctx[y], u.ctx[y] = A) && (!u.skip_bound && u.bound[y] && u.bound[y](A), N && qe(t, y)), j;
224
- }) : [], u.update(), N = !0, W(u.before_update), u.fragment = i ? i(u.ctx) : !1, e.target) {
219
+ s && s(a.root);
220
+ let R = !1;
221
+ if (a.ctx = n ? n(t, e.props || {}, (p, j, ...x) => {
222
+ const A = x.length ? x[0] : j;
223
+ return a.ctx && l(a.ctx[p], a.ctx[p] = A) && (!a.skip_bound && a.bound[p] && a.bound[p](A), R && et(t, p)), j;
224
+ }) : [], a.update(), R = !0, P(a.before_update), a.fragment = o ? o(a.ctx) : !1, e.target) {
225
225
  if (e.hydrate) {
226
- const y = Ye(e.target);
227
- u.fragment && u.fragment.l(y), y.forEach(L);
226
+ const p = Ze(e.target);
227
+ a.fragment && a.fragment.l(p), p.forEach(I);
228
228
  } else
229
- u.fragment && u.fragment.c();
230
- e.intro && ze(t.$$.fragment), Je(t, e.target, e.anchor), C();
229
+ a.fragment && a.fragment.c();
230
+ e.intro && Je(t.$$.fragment), Qe(t, e.target, e.anchor), C();
231
231
  }
232
- B(f);
232
+ H(f);
233
233
  }
234
- let we;
235
- typeof HTMLElement == "function" && (we = class extends HTMLElement {
236
- constructor(e, n, i) {
234
+ let _e;
235
+ typeof HTMLElement == "function" && (_e = class extends HTMLElement {
236
+ constructor(e, n, o) {
237
237
  super();
238
238
  /** The Svelte component constructor */
239
- x(this, "$$ctor");
239
+ L(this, "$$ctor");
240
240
  /** Slots */
241
- x(this, "$$s");
241
+ L(this, "$$s");
242
242
  /** The Svelte component instance */
243
- x(this, "$$c");
243
+ L(this, "$$c");
244
244
  /** Whether or not the custom element is connected */
245
- x(this, "$$cn", !1);
245
+ L(this, "$$cn", !1);
246
246
  /** Component props data */
247
- x(this, "$$d", {});
247
+ L(this, "$$d", {});
248
248
  /** `true` if currently in the process of reflecting component props back to attributes */
249
- x(this, "$$r", !1);
249
+ L(this, "$$r", !1);
250
250
  /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
251
- x(this, "$$p_d", {});
251
+ L(this, "$$p_d", {});
252
252
  /** @type {Record<string, Function[]>} Event listeners */
253
- x(this, "$$l", {});
253
+ L(this, "$$l", {});
254
254
  /** @type {Map<Function, Function>} Event listener unsubscribe functions */
255
- x(this, "$$l_u", /* @__PURE__ */ new Map());
256
- this.$$ctor = e, this.$$s = n, i && this.attachShadow({ mode: "open" });
255
+ L(this, "$$l_u", /* @__PURE__ */ new Map());
256
+ this.$$ctor = e, this.$$s = n, o && this.attachShadow({ mode: "open" });
257
257
  }
258
- addEventListener(e, n, i) {
258
+ addEventListener(e, n, o) {
259
259
  if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) {
260
260
  const l = this.$$c.$on(e, n);
261
261
  this.$$l_u.set(n, l);
262
262
  }
263
- super.addEventListener(e, n, i);
263
+ super.addEventListener(e, n, o);
264
264
  }
265
- removeEventListener(e, n, i) {
266
- if (super.removeEventListener(e, n, i), this.$$c) {
265
+ removeEventListener(e, n, o) {
266
+ if (super.removeEventListener(e, n, o), this.$$c) {
267
267
  const l = this.$$l_u.get(n);
268
268
  l && (l(), this.$$l_u.delete(n));
269
269
  }
@@ -275,26 +275,26 @@ typeof HTMLElement == "function" && (we = class extends HTMLElement {
275
275
  let s;
276
276
  return {
277
277
  c: function() {
278
- s = _("slot"), r !== "default" && c(s, "name", r);
278
+ s = $("slot"), r !== "default" && c(s, "name", r);
279
279
  },
280
280
  /**
281
281
  * @param {HTMLElement} target
282
282
  * @param {HTMLElement} [anchor]
283
283
  */
284
- m: function(u, N) {
285
- R(u, s, N);
284
+ m: function(a, R) {
285
+ N(a, s, R);
286
286
  },
287
- d: function(u) {
288
- u && L(s);
287
+ d: function(a) {
288
+ a && I(s);
289
289
  }
290
290
  };
291
291
  };
292
292
  };
293
293
  if (await Promise.resolve(), !this.$$cn || this.$$c)
294
294
  return;
295
- const n = {}, i = Be(this);
295
+ const n = {}, o = He(this);
296
296
  for (const r of this.$$s)
297
- r in i && (n[r] = [e(r)]);
297
+ r in o && (n[r] = [e(r)]);
298
298
  for (const r of this.attributes) {
299
299
  const s = this.$$g_p(r.name);
300
300
  s in this.$$d || (this.$$d[s] = T(s, r.value, this.$$p_d, "toProp"));
@@ -328,17 +328,17 @@ typeof HTMLElement == "function" && (we = class extends HTMLElement {
328
328
  this.$$c.$$.after_update.push(l), l();
329
329
  for (const r in this.$$l)
330
330
  for (const s of this.$$l[r]) {
331
- const a = this.$$c.$on(r, s);
332
- this.$$l_u.set(s, a);
331
+ const u = this.$$c.$on(r, s);
332
+ this.$$l_u.set(s, u);
333
333
  }
334
334
  this.$$l = {};
335
335
  }
336
336
  }
337
337
  // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
338
338
  // and setting attributes through setAttribute etc, this is helpful
339
- attributeChangedCallback(e, n, i) {
339
+ attributeChangedCallback(e, n, o) {
340
340
  var l;
341
- this.$$r || (e = this.$$g_p(e), this.$$d[e] = T(e, i, this.$$p_d, "toProp"), (l = this.$$c) == null || l.$set({ [e]: this.$$d[e] }));
341
+ this.$$r || (e = this.$$g_p(e), this.$$d[e] = T(e, o, this.$$p_d, "toProp"), (l = this.$$c) == null || l.$set({ [e]: this.$$d[e] }));
342
342
  }
343
343
  disconnectedCallback() {
344
344
  this.$$cn = !1, Promise.resolve().then(() => {
@@ -351,12 +351,12 @@ typeof HTMLElement == "function" && (we = class extends HTMLElement {
351
351
  ) || e;
352
352
  }
353
353
  });
354
- function T(t, e, n, i) {
354
+ function T(t, e, n, o) {
355
355
  var r;
356
356
  const l = (r = n[t]) == null ? void 0 : r.type;
357
- if (e = l === "Boolean" && typeof e != "boolean" ? e != null : e, !i || !n[t])
357
+ if (e = l === "Boolean" && typeof e != "boolean" ? e != null : e, !o || !n[t])
358
358
  return e;
359
- if (i === "toAttribute")
359
+ if (o === "toAttribute")
360
360
  switch (l) {
361
361
  case "Object":
362
362
  case "Array":
@@ -381,38 +381,38 @@ function T(t, e, n, i) {
381
381
  return e;
382
382
  }
383
383
  }
384
- function tt(t, e, n, i, l, r) {
385
- let s = class extends we {
384
+ function nt(t, e, n, o, l, r) {
385
+ let s = class extends _e {
386
386
  constructor() {
387
387
  super(t, n, l), this.$$p_d = e;
388
388
  }
389
389
  static get observedAttributes() {
390
390
  return Object.keys(e).map(
391
- (a) => (e[a].attribute || a).toLowerCase()
391
+ (u) => (e[u].attribute || u).toLowerCase()
392
392
  );
393
393
  }
394
394
  };
395
- return Object.keys(e).forEach((a) => {
396
- Object.defineProperty(s.prototype, a, {
395
+ return Object.keys(e).forEach((u) => {
396
+ Object.defineProperty(s.prototype, u, {
397
397
  get() {
398
- return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
398
+ return this.$$c && u in this.$$c ? this.$$c[u] : this.$$d[u];
399
399
  },
400
400
  set(f) {
401
- var u;
402
- f = T(a, f, e), this.$$d[a] = f, (u = this.$$c) == null || u.$set({ [a]: f });
401
+ var a;
402
+ f = T(u, f, e), this.$$d[u] = f, (a = this.$$c) == null || a.$set({ [u]: f });
403
403
  }
404
404
  });
405
- }), i.forEach((a) => {
406
- Object.defineProperty(s.prototype, a, {
405
+ }), o.forEach((u) => {
406
+ Object.defineProperty(s.prototype, u, {
407
407
  get() {
408
408
  var f;
409
- return (f = this.$$c) == null ? void 0 : f[a];
409
+ return (f = this.$$c) == null ? void 0 : f[u];
410
410
  }
411
411
  });
412
412
  }), r && (s = r(s)), t.element = /** @type {any} */
413
413
  s, s;
414
414
  }
415
- class nt {
415
+ class rt {
416
416
  constructor() {
417
417
  /**
418
418
  * ### PRIVATE API
@@ -421,7 +421,7 @@ class nt {
421
421
  *
422
422
  * @type {any}
423
423
  */
424
- x(this, "$$");
424
+ L(this, "$$");
425
425
  /**
426
426
  * ### PRIVATE API
427
427
  *
@@ -429,11 +429,11 @@ class nt {
429
429
  *
430
430
  * @type {any}
431
431
  */
432
- x(this, "$$set");
432
+ L(this, "$$set");
433
433
  }
434
434
  /** @returns {void} */
435
435
  $destroy() {
436
- Qe(this, 1), this.$destroy = Z;
436
+ qe(this, 1), this.$destroy = Z;
437
437
  }
438
438
  /**
439
439
  * @template {Extract<keyof Events, string>} K
@@ -442,12 +442,12 @@ class nt {
442
442
  * @returns {() => void}
443
443
  */
444
444
  $on(e, n) {
445
- if (!ve(n))
445
+ if (!be(n))
446
446
  return Z;
447
- const i = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
448
- return i.push(n), () => {
449
- const l = i.indexOf(n);
450
- l !== -1 && i.splice(l, 1);
447
+ const o = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
448
+ return o.push(n), () => {
449
+ const l = o.indexOf(n);
450
+ l !== -1 && o.splice(l, 1);
451
451
  };
452
452
  }
453
453
  /**
@@ -455,16 +455,16 @@ class nt {
455
455
  * @returns {void}
456
456
  */
457
457
  $set(e) {
458
- this.$$set && !Ue(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
458
+ this.$$set && !Ve(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
459
459
  }
460
460
  }
461
- const rt = "4";
462
- typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(rt);
463
- const be = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHI9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGMoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAobj0+bi50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBsKGUsbixhKXtyZXR1cm4gYyhhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChhLnRvVXBwZXJDYXNlKCksci5lbmNvZGUoZStuKSkpfWFzeW5jIGZ1bmN0aW9uIGkoZSxuLGE9IlNIQS0yNTYiLG89MWU3KXtjb25zdCBzPURhdGUubm93KCk7Zm9yKGxldCB0PTA7dDw9bzt0KyspaWYoYXdhaXQgbChuLHQsYSk9PT1lKXJldHVybntudW1iZXI6dCx0b29rOkRhdGUubm93KCktc307cmV0dXJuIG51bGx9b25tZXNzYWdlPWFzeW5jIGU9Pntjb25zdHthbGc6bixjaGFsbGVuZ2U6YSxtYXg6byxzYWx0OnN9PWUuZGF0YXx8e307aWYoYSYmcyl7Y29uc3QgdD1hd2FpdCBpKGEscyxuLG8pO3NlbGYucG9zdE1lc3NhZ2UodCYmey4uLnQsd29ya2VyOiEwfSl9ZWxzZSBzZWxmLnBvc3RNZXNzYWdlKG51bGwpfX0pKCk7Cg==", it = (t) => Uint8Array.from(atob(t), (e) => e.charCodeAt(0)), se = typeof window < "u" && window.Blob && new Blob([it(be)], { type: "text/javascript;charset=utf-8" });
461
+ const ot = "4";
462
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ot);
463
+ const we = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHI9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIGMoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAobj0+bi50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBsKGUsbixhKXtyZXR1cm4gYyhhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChhLnRvVXBwZXJDYXNlKCksci5lbmNvZGUoZStuKSkpfWFzeW5jIGZ1bmN0aW9uIGkoZSxuLGE9IlNIQS0yNTYiLG89MWU3KXtjb25zdCBzPURhdGUubm93KCk7Zm9yKGxldCB0PTA7dDw9bzt0KyspaWYoYXdhaXQgbChuLHQsYSk9PT1lKXJldHVybntudW1iZXI6dCx0b29rOkRhdGUubm93KCktc307cmV0dXJuIG51bGx9b25tZXNzYWdlPWFzeW5jIGU9Pntjb25zdHthbGc6bixjaGFsbGVuZ2U6YSxtYXg6byxzYWx0OnN9PWUuZGF0YXx8e307aWYoYSYmcyl7Y29uc3QgdD1hd2FpdCBpKGEscyxuLG8pO3NlbGYucG9zdE1lc3NhZ2UodCYmey4uLnQsd29ya2VyOiEwfSl9ZWxzZSBzZWxmLnBvc3RNZXNzYWdlKG51bGwpfX0pKCk7Cg==", it = (t) => Uint8Array.from(atob(t), (e) => e.charCodeAt(0)), ce = typeof window < "u" && window.Blob && new Blob([it(we)], { type: "text/javascript;charset=utf-8" });
464
464
  function lt(t) {
465
465
  let e;
466
466
  try {
467
- if (e = se && (window.URL || window.webkitURL).createObjectURL(se), !e)
467
+ if (e = ce && (window.URL || window.webkitURL).createObjectURL(ce), !e)
468
468
  throw "";
469
469
  const n = new Worker(e, {
470
470
  name: t == null ? void 0 : t.name
@@ -474,7 +474,7 @@ function lt(t) {
474
474
  }), n;
475
475
  } catch {
476
476
  return new Worker(
477
- "data:text/javascript;base64," + be,
477
+ "data:text/javascript;base64," + we,
478
478
  {
479
479
  name: t == null ? void 0 : t.name
480
480
  }
@@ -483,12 +483,12 @@ function lt(t) {
483
483
  e && (window.URL || window.webkitURL).revokeObjectURL(e);
484
484
  }
485
485
  }
486
- const ot = 1e7, st = new TextEncoder();
487
- function ct(t) {
486
+ const st = 1e7, ct = new TextEncoder();
487
+ function ut(t) {
488
488
  return [...new Uint8Array(t)].map((e) => e.toString(16).padStart(2, "0")).join("");
489
489
  }
490
490
  async function at(t = 1e5, e = "SHA-256") {
491
- const n = Date.now().toString(16), i = Math.round(Math.random() * t), l = await $e(n, i, e);
491
+ const n = Date.now().toString(16), o = Math.round(Math.random() * t), l = await $e(n, o, e);
492
492
  return {
493
493
  algorithm: e,
494
494
  challenge: l,
@@ -497,11 +497,11 @@ async function at(t = 1e5, e = "SHA-256") {
497
497
  };
498
498
  }
499
499
  async function $e(t, e, n) {
500
- return ct(await crypto.subtle.digest(n.toUpperCase(), st.encode(t + e)));
500
+ return ut(await crypto.subtle.digest(n.toUpperCase(), ct.encode(t + e)));
501
501
  }
502
- async function ut(t, e, n = "SHA-256", i = ot) {
502
+ async function ft(t, e, n = "SHA-256", o = st) {
503
503
  const l = Date.now();
504
- for (let r = 0; r <= i; r++)
504
+ for (let r = 0; r <= o; r++)
505
505
  if (await $e(e, r, n) === t)
506
506
  return {
507
507
  number: r,
@@ -509,79 +509,79 @@ async function ut(t, e, n = "SHA-256", i = ot) {
509
509
  };
510
510
  return null;
511
511
  }
512
- var p = /* @__PURE__ */ ((t) => (t.ERROR = "error", t.VERIFIED = "verified", t.VERIFYING = "verifying", t.UNVERIFIED = "unverified", t))(p || {});
513
- function ft(t) {
514
- Ve(t, "svelte-1wvv726", ".altcha.svelte-1wvv726.svelte-1wvv726{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 3px) 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);overflow:hidden;position:relative;text-align:left}.altcha.svelte-1wvv726.svelte-1wvv726:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha-main.svelte-1wvv726.svelte-1wvv726{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-1wvv726.svelte-1wvv726{flex-grow:1}.altcha-label.svelte-1wvv726 label.svelte-1wvv726{cursor:pointer}.altcha-logo.svelte-1wvv726.svelte-1wvv726{color:currentColor;opacity:0.3}.altcha-logo.svelte-1wvv726.svelte-1wvv726:hover{opacity:1}.altcha-error.svelte-1wvv726.svelte-1wvv726{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-1wvv726.svelte-1wvv726{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-1wvv726.svelte-1wvv726:hover{opacity:1}.altcha-footer.svelte-1wvv726>.svelte-1wvv726:first-child{flex-grow:1}.altcha-footer.svelte-1wvv726 a{color:currentColor}.altcha-checkbox.svelte-1wvv726.svelte-1wvv726{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-1wvv726 input.svelte-1wvv726{width:18px;height:18px;margin:0}.altcha-hidden.svelte-1wvv726.svelte-1wvv726{display:none}.altcha-spinner.svelte-1wvv726.svelte-1wvv726{animation:svelte-1wvv726-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-1wvv726-altcha-spinner{100%{transform:rotate(360deg)}}");
512
+ var y = /* @__PURE__ */ ((t) => (t.ERROR = "error", t.VERIFIED = "verified", t.VERIFYING = "verifying", t.UNVERIFIED = "unverified", t))(y || {});
513
+ function ht(t) {
514
+ Me(t, "svelte-vuofbg", ".altcha.svelte-vuofbg.svelte-vuofbg{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);overflow:hidden;position:relative;text-align:left}.altcha.svelte-vuofbg.svelte-vuofbg:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha-main.svelte-vuofbg.svelte-vuofbg{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-vuofbg.svelte-vuofbg{flex-grow:1}.altcha-label.svelte-vuofbg label.svelte-vuofbg{cursor:pointer}.altcha-logo.svelte-vuofbg.svelte-vuofbg{color:currentColor;opacity:0.3}.altcha-logo.svelte-vuofbg.svelte-vuofbg:hover{opacity:1}.altcha-error.svelte-vuofbg.svelte-vuofbg{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-vuofbg.svelte-vuofbg{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-vuofbg.svelte-vuofbg:hover{opacity:1}.altcha-footer.svelte-vuofbg>.svelte-vuofbg:first-child{flex-grow:1}.altcha-footer.svelte-vuofbg a{color:currentColor}.altcha-checkbox.svelte-vuofbg.svelte-vuofbg{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-vuofbg input.svelte-vuofbg{width:18px;height:18px;margin:0}.altcha-hidden.svelte-vuofbg.svelte-vuofbg{display:none}.altcha-spinner.svelte-vuofbg.svelte-vuofbg{animation:svelte-vuofbg-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-vuofbg-altcha-spinner{100%{transform:rotate(360deg)}}");
515
515
  }
516
- function ce(t) {
517
- let e, n, i;
516
+ function ue(t) {
517
+ let e, n, o;
518
518
  return {
519
519
  c() {
520
- e = G("svg"), n = G("path"), i = G("path"), c(n, "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"), c(n, "fill", "currentColor"), c(n, "opacity", ".25"), c(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"), c(i, "fill", "currentColor"), c(i, "class", "altcha-spinner svelte-1wvv726"), c(e, "width", "24"), c(e, "height", "24"), c(e, "viewBox", "0 0 24 24"), c(e, "xmlns", "http://www.w3.org/2000/svg");
520
+ e = S("svg"), n = S("path"), o = S("path"), c(n, "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"), c(n, "fill", "currentColor"), c(n, "opacity", ".25"), c(o, "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"), c(o, "fill", "currentColor"), c(o, "class", "altcha-spinner svelte-vuofbg"), c(e, "width", "24"), c(e, "height", "24"), c(e, "viewBox", "0 0 24 24"), c(e, "xmlns", "http://www.w3.org/2000/svg");
521
521
  },
522
522
  m(l, r) {
523
- R(l, e, r), g(e, n), g(e, i);
523
+ N(l, e, r), b(e, n), b(e, o);
524
524
  },
525
525
  d(l) {
526
- l && L(e);
526
+ l && I(e);
527
527
  }
528
528
  };
529
529
  }
530
- function ht(t) {
530
+ function dt(t) {
531
531
  let e, n = (
532
532
  /*_strings*/
533
533
  t[9].label + ""
534
- ), i;
534
+ ), o;
535
535
  return {
536
536
  c() {
537
- e = _("label"), c(e, "for", i = /*name*/
538
- t[3] + "_checkbox"), c(e, "class", "svelte-1wvv726");
537
+ e = $("label"), c(e, "for", o = /*name*/
538
+ t[3] + "_checkbox"), c(e, "class", "svelte-vuofbg");
539
539
  },
540
540
  m(l, r) {
541
- R(l, e, r), e.innerHTML = n;
541
+ N(l, e, r), e.innerHTML = n;
542
542
  },
543
543
  p(l, r) {
544
544
  r[0] & /*_strings*/
545
545
  512 && n !== (n = /*_strings*/
546
546
  l[9].label + "") && (e.innerHTML = n), r[0] & /*name*/
547
- 8 && i !== (i = /*name*/
548
- l[3] + "_checkbox") && c(e, "for", i);
547
+ 8 && o !== (o = /*name*/
548
+ l[3] + "_checkbox") && c(e, "for", o);
549
549
  },
550
550
  d(l) {
551
- l && L(e);
551
+ l && I(e);
552
552
  }
553
553
  };
554
554
  }
555
- function dt(t) {
555
+ function gt(t) {
556
556
  let e, n = (
557
557
  /*_strings*/
558
558
  t[9].verifying + ""
559
559
  );
560
560
  return {
561
561
  c() {
562
- e = _("span");
562
+ e = $("span");
563
563
  },
564
- m(i, l) {
565
- R(i, e, l), e.innerHTML = n;
564
+ m(o, l) {
565
+ N(o, e, l), e.innerHTML = n;
566
566
  },
567
- p(i, l) {
567
+ p(o, l) {
568
568
  l[0] & /*_strings*/
569
569
  512 && n !== (n = /*_strings*/
570
- i[9].verifying + "") && (e.innerHTML = n);
570
+ o[9].verifying + "") && (e.innerHTML = n);
571
571
  },
572
- d(i) {
573
- i && L(e);
572
+ d(o) {
573
+ o && I(e);
574
574
  }
575
575
  };
576
576
  }
577
- function vt(t) {
577
+ function bt(t) {
578
578
  let e, n = (
579
579
  /*_strings*/
580
580
  t[9].verified + ""
581
- ), i, l;
581
+ ), o, l;
582
582
  return {
583
583
  c() {
584
- e = _("span"), i = M(), l = _("input"), c(l, "type", "hidden"), c(
584
+ e = $("span"), o = M(), l = $("input"), c(l, "type", "hidden"), c(
585
585
  l,
586
586
  "name",
587
587
  /*name*/
@@ -590,7 +590,7 @@ function vt(t) {
590
590
  t[4];
591
591
  },
592
592
  m(r, s) {
593
- R(r, e, s), e.innerHTML = n, R(r, i, s), R(r, l, s);
593
+ N(r, e, s), e.innerHTML = n, N(r, o, s), N(r, l, s);
594
594
  },
595
595
  p(r, s) {
596
596
  s[0] & /*_strings*/
@@ -606,129 +606,129 @@ function vt(t) {
606
606
  r[4]);
607
607
  },
608
608
  d(r) {
609
- r && (L(e), L(i), L(l));
609
+ r && (I(e), I(o), I(l));
610
610
  }
611
611
  };
612
612
  }
613
613
  function ae(t) {
614
- let e, n, i, l, r, s;
614
+ let e, n, o, l, r, s;
615
615
  return {
616
616
  c() {
617
- e = _("div"), n = _("a"), i = G("svg"), l = G("path"), r = G("path"), s = G("path"), c(l, "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"), c(l, "fill", "currentColor"), c(r, "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"), c(r, "fill", "currentColor"), c(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"), c(s, "fill", "currentColor"), c(i, "width", "22"), c(i, "height", "22"), c(i, "viewBox", "0 0 20 20"), c(i, "fill", "none"), c(i, "xmlns", "http://www.w3.org/2000/svg"), c(n, "href", _e), c(n, "target", "_blank"), c(n, "class", "altcha-logo svelte-1wvv726");
617
+ e = $("div"), n = $("a"), o = S("svg"), l = S("path"), r = S("path"), s = S("path"), c(l, "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"), c(l, "fill", "currentColor"), c(r, "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"), c(r, "fill", "currentColor"), c(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"), c(s, "fill", "currentColor"), c(o, "width", "22"), c(o, "height", "22"), c(o, "viewBox", "0 0 20 20"), c(o, "fill", "none"), c(o, "xmlns", "http://www.w3.org/2000/svg"), c(n, "href", ye), c(n, "target", "_blank"), c(n, "class", "altcha-logo svelte-vuofbg");
618
618
  },
619
- m(a, f) {
620
- R(a, e, f), g(e, n), g(n, i), g(i, l), g(i, r), g(i, s);
619
+ m(u, f) {
620
+ N(u, e, f), b(e, n), b(n, o), b(o, l), b(o, r), b(o, s);
621
621
  },
622
622
  p: Z,
623
- d(a) {
624
- a && L(e);
623
+ d(u) {
624
+ u && I(e);
625
625
  }
626
626
  };
627
627
  }
628
- function ue(t) {
629
- let e, n, i, l, r, s = (
628
+ function fe(t) {
629
+ let e, n, o, l, r, s = (
630
630
  /*_strings*/
631
631
  t[9].error + ""
632
632
  );
633
633
  return {
634
634
  c() {
635
- e = _("div"), n = G("svg"), i = G("path"), l = M(), r = _("div"), c(i, "stroke-linecap", "round"), c(i, "stroke-linejoin", "round"), c(i, "d", "M6 18L18 6M6 6l12 12"), c(n, "width", "14"), c(n, "height", "14"), c(n, "xmlns", "http://www.w3.org/2000/svg"), c(n, "fill", "none"), c(n, "viewBox", "0 0 24 24"), c(n, "stroke-width", "1.5"), c(n, "stroke", "currentColor"), c(
635
+ e = $("div"), n = S("svg"), o = S("path"), l = M(), r = $("div"), c(o, "stroke-linecap", "round"), c(o, "stroke-linejoin", "round"), c(o, "d", "M6 18L18 6M6 6l12 12"), c(n, "width", "14"), c(n, "height", "14"), c(n, "xmlns", "http://www.w3.org/2000/svg"), c(n, "fill", "none"), c(n, "viewBox", "0 0 24 24"), c(n, "stroke-width", "1.5"), c(n, "stroke", "currentColor"), c(
636
636
  r,
637
637
  "title",
638
638
  /*error*/
639
639
  t[8]
640
- ), c(e, "class", "altcha-error svelte-1wvv726");
640
+ ), c(e, "class", "altcha-error svelte-vuofbg");
641
641
  },
642
- m(a, f) {
643
- R(a, e, f), g(e, n), g(n, i), g(e, l), g(e, r), r.innerHTML = s;
642
+ m(u, f) {
643
+ N(u, e, f), b(e, n), b(n, o), b(e, l), b(e, r), r.innerHTML = s;
644
644
  },
645
- p(a, f) {
645
+ p(u, f) {
646
646
  f[0] & /*_strings*/
647
647
  512 && s !== (s = /*_strings*/
648
- a[9].error + "") && (r.innerHTML = s), f[0] & /*error*/
648
+ u[9].error + "") && (r.innerHTML = s), f[0] & /*error*/
649
649
  256 && c(
650
650
  r,
651
651
  "title",
652
652
  /*error*/
653
- a[8]
653
+ u[8]
654
654
  );
655
655
  },
656
- d(a) {
657
- a && L(e);
656
+ d(u) {
657
+ u && I(e);
658
658
  }
659
659
  };
660
660
  }
661
- function fe(t) {
662
- let e, n, i = (
661
+ function he(t) {
662
+ let e, n, o = (
663
663
  /*_strings*/
664
664
  t[9].footer + ""
665
665
  );
666
666
  return {
667
667
  c() {
668
- e = _("div"), n = _("div"), c(n, "class", "svelte-1wvv726"), c(e, "class", "altcha-footer svelte-1wvv726");
668
+ e = $("div"), n = $("div"), c(n, "class", "svelte-vuofbg"), c(e, "class", "altcha-footer svelte-vuofbg");
669
669
  },
670
670
  m(l, r) {
671
- R(l, e, r), g(e, n), n.innerHTML = i;
671
+ N(l, e, r), b(e, n), n.innerHTML = o;
672
672
  },
673
673
  p(l, r) {
674
674
  r[0] & /*_strings*/
675
- 512 && i !== (i = /*_strings*/
676
- l[9].footer + "") && (n.innerHTML = i);
675
+ 512 && o !== (o = /*_strings*/
676
+ l[9].footer + "") && (n.innerHTML = o);
677
677
  },
678
678
  d(l) {
679
- l && L(e);
679
+ l && I(e);
680
680
  }
681
681
  };
682
682
  }
683
- function gt(t) {
684
- let e, n, i, l, r, s, a, f, u, N, y, j, I, A, b = (
683
+ function mt(t) {
684
+ let e, n, o, l, r, s, u, f, a, R, p, j, x, A, _ = (
685
685
  /*state*/
686
- t[5] === p.VERIFYING && ce()
686
+ t[5] === y.VERIFYING && ue()
687
687
  );
688
- function S(h, w) {
688
+ function G(h, v) {
689
689
  return (
690
690
  /*state*/
691
- h[5] === p.VERIFIED ? vt : (
691
+ h[5] === y.VERIFIED ? bt : (
692
692
  /*state*/
693
- h[5] === p.VERIFYING ? dt : ht
693
+ h[5] === y.VERIFYING ? gt : dt
694
694
  )
695
695
  );
696
696
  }
697
- let V = S(t), k = V(t), v = (
697
+ let V = G(t), k = V(t), g = (
698
698
  /*hidelogo*/
699
699
  t[2] !== !0 && ae()
700
700
  ), m = (
701
701
  /*error*/
702
- t[8] && ue(t)
702
+ t[8] && fe(t)
703
703
  ), d = (
704
704
  /*_strings*/
705
705
  t[9].footer && /*hidefooter*/
706
- t[1] !== !0 && fe(t)
706
+ t[1] !== !0 && he(t)
707
707
  );
708
708
  return {
709
709
  c() {
710
- e = _("div"), n = _("div"), b && b.c(), i = M(), l = _("div"), r = _("input"), f = M(), u = _("div"), k.c(), N = M(), v && v.c(), y = M(), m && m.c(), j = M(), d && d.c(), c(r, "type", "checkbox"), c(r, "id", s = /*name*/
711
- t[3] + "_checkbox"), r.required = a = /*auto*/
712
- t[0] !== "onsubmit", c(r, "class", "svelte-1wvv726"), c(l, "class", "altcha-checkbox svelte-1wvv726"), le(
710
+ e = $("div"), n = $("div"), _ && _.c(), o = M(), l = $("div"), r = $("input"), f = M(), a = $("div"), k.c(), R = M(), g && g.c(), p = M(), m && m.c(), j = M(), d && d.c(), c(r, "type", "checkbox"), c(r, "id", s = /*name*/
711
+ t[3] + "_checkbox"), r.required = u = /*auto*/
712
+ t[0] !== "onsubmit", c(r, "class", "svelte-vuofbg"), c(l, "class", "altcha-checkbox svelte-vuofbg"), le(
713
713
  l,
714
714
  "altcha-hidden",
715
715
  /*state*/
716
- t[5] === p.VERIFYING
717
- ), c(u, "class", "altcha-label svelte-1wvv726"), c(n, "class", "altcha-main svelte-1wvv726"), c(e, "class", "altcha svelte-1wvv726"), c(
716
+ t[5] === y.VERIFYING
717
+ ), c(a, "class", "altcha-label svelte-vuofbg"), c(n, "class", "altcha-main svelte-vuofbg"), c(e, "class", "altcha svelte-vuofbg"), c(
718
718
  e,
719
719
  "data-state",
720
720
  /*state*/
721
721
  t[5]
722
722
  );
723
723
  },
724
- m(h, w) {
725
- R(h, e, w), g(e, n), b && b.m(n, null), g(n, i), g(n, l), g(l, r), r.checked = /*checked*/
726
- t[6], g(n, f), g(n, u), k.m(u, null), g(n, N), v && v.m(n, null), g(e, y), m && m.m(e, null), g(e, j), d && d.m(e, null), t[23](e), I || (A = [
724
+ m(h, v) {
725
+ N(h, e, v), b(e, n), _ && _.m(n, null), b(n, o), b(n, l), b(l, r), r.checked = /*checked*/
726
+ t[6], b(n, f), b(n, a), k.m(a, null), b(n, R), g && g.m(n, null), b(e, p), m && m.m(e, null), b(e, j), d && d.m(e, null), t[24](e), x || (A = [
727
727
  K(
728
728
  r,
729
729
  "change",
730
730
  /*input_change_handler*/
731
- t[22]
731
+ t[23]
732
732
  ),
733
733
  K(
734
734
  r,
@@ -742,27 +742,27 @@ function gt(t) {
742
742
  /*onInvalid*/
743
743
  t[11]
744
744
  )
745
- ], I = !0);
745
+ ], x = !0);
746
746
  },
747
- p(h, w) {
747
+ p(h, v) {
748
748
  /*state*/
749
- h[5] === p.VERIFYING ? b || (b = ce(), b.c(), b.m(n, i)) : b && (b.d(1), b = null), w[0] & /*name*/
749
+ h[5] === y.VERIFYING ? _ || (_ = ue(), _.c(), _.m(n, o)) : _ && (_.d(1), _ = null), v[0] & /*name*/
750
750
  8 && s !== (s = /*name*/
751
- h[3] + "_checkbox") && c(r, "id", s), w[0] & /*auto*/
752
- 1 && a !== (a = /*auto*/
753
- h[0] !== "onsubmit") && (r.required = a), w[0] & /*checked*/
751
+ h[3] + "_checkbox") && c(r, "id", s), v[0] & /*auto*/
752
+ 1 && u !== (u = /*auto*/
753
+ h[0] !== "onsubmit") && (r.required = u), v[0] & /*checked*/
754
754
  64 && (r.checked = /*checked*/
755
- h[6]), w[0] & /*state*/
755
+ h[6]), v[0] & /*state*/
756
756
  32 && le(
757
757
  l,
758
758
  "altcha-hidden",
759
759
  /*state*/
760
- h[5] === p.VERIFYING
761
- ), V === (V = S(h)) && k ? k.p(h, w) : (k.d(1), k = V(h), k && (k.c(), k.m(u, null))), /*hidelogo*/
762
- h[2] !== !0 ? v ? v.p(h, w) : (v = ae(), v.c(), v.m(n, null)) : v && (v.d(1), v = null), /*error*/
763
- h[8] ? m ? m.p(h, w) : (m = ue(h), m.c(), m.m(e, j)) : m && (m.d(1), m = null), /*_strings*/
760
+ h[5] === y.VERIFYING
761
+ ), V === (V = G(h)) && k ? k.p(h, v) : (k.d(1), k = V(h), k && (k.c(), k.m(a, null))), /*hidelogo*/
762
+ h[2] !== !0 ? g ? g.p(h, v) : (g = ae(), g.c(), g.m(n, null)) : g && (g.d(1), g = null), /*error*/
763
+ h[8] ? m ? m.p(h, v) : (m = fe(h), m.c(), m.m(e, j)) : m && (m.d(1), m = null), /*_strings*/
764
764
  h[9].footer && /*hidefooter*/
765
- h[1] !== !0 ? d ? d.p(h, w) : (d = fe(h), d.c(), d.m(e, null)) : d && (d.d(1), d = null), w[0] & /*state*/
765
+ h[1] !== !0 ? d ? d.p(h, v) : (d = he(h), d.c(), d.m(e, null)) : d && (d.d(1), d = null), v[0] & /*state*/
766
766
  32 && c(
767
767
  e,
768
768
  "data-state",
@@ -773,194 +773,199 @@ function gt(t) {
773
773
  i: Z,
774
774
  o: Z,
775
775
  d(h) {
776
- h && L(e), b && b.d(), k.d(), v && v.d(), m && m.d(), d && d.d(), t[23](null), I = !1, W(A);
776
+ h && I(e), _ && _.d(), k.d(), g && g.d(), m && m.d(), d && d.d(), t[24](null), x = !1, P(A);
777
777
  }
778
778
  };
779
779
  }
780
- const _e = "https://altcha.org/";
781
- function he(t) {
780
+ const ye = "https://altcha.org/";
781
+ function de(t) {
782
782
  return JSON.parse(t);
783
783
  }
784
- function mt(t, e, n) {
785
- let i, l, r, { auto: s = void 0 } = e, { challengeurl: a = void 0 } = e, { challengejson: f = void 0 } = e, { debug: u = !1 } = e, { hidefooter: N = !1 } = e, { hidelogo: y = !1 } = e, { name: j = "altcha" } = e, { maxnumber: I = void 0 } = e, { mockerror: A = !1 } = e, { strings: b = void 0 } = e, { test: S = !1 } = e;
786
- const V = Pe(), k = ["SHA-256", "SHA-384", "SHA-512"];
787
- let v = !1, m, d = null, h = null, w = null, U = p.UNVERIFIED;
788
- We(() => {
784
+ function vt(t, e, n) {
785
+ let o, l, r, { auto: s = void 0 } = e, { challengeurl: u = void 0 } = e, { challengejson: f = void 0 } = e, { debug: a = !1 } = e, { hidefooter: R = !1 } = e, { hidelogo: p = !1 } = e, { name: j = "altcha" } = e, { maxnumber: x = void 0 } = e, { mockerror: A = !1 } = e, { strings: _ = void 0 } = e, { test: G = !1 } = e;
786
+ const V = Te(), k = ["SHA-256", "SHA-384", "SHA-512"];
787
+ let g = !1, m, d = null, h = null, v = null, U = y.UNVERIFIED;
788
+ Pe(() => {
789
789
  d && (d.removeEventListener("submit", te), d.removeEventListener("reset", ne), d = null);
790
- }), He(() => {
791
- E("mounted", "0.1.7"), S && E("using test mode"), s !== void 0 && E("auto", s), d = m.closest("form"), d && (d.addEventListener("submit", te), d.addEventListener("reset", ne)), s === "onload" && P();
790
+ }), We(() => {
791
+ E("mounted", "0.1.9"), G && E("using test mode"), s !== void 0 && E("auto", s), d = m.closest("form"), d && (d.addEventListener("submit", te), d.addEventListener("reset", ne)), s === "onload" && B();
792
792
  });
793
- function E(...o) {
794
- (u || o.some(($) => $ instanceof Error)) && console[o[0] instanceof Error ? "error" : "log"]("ALTCHA", ...o);
793
+ function E(...i) {
794
+ (a || i.some((w) => w instanceof Error)) && console[i[0] instanceof Error ? "error" : "log"]("ALTCHA", ...i);
795
795
  }
796
- function te(o) {
797
- d && s === "onsubmit" && U === p.UNVERIFIED && (o.preventDefault(), o.stopPropagation(), P().then(() => {
796
+ function te(i) {
797
+ d && s === "onsubmit" && U === y.UNVERIFIED && (i.preventDefault(), i.stopPropagation(), B().then(() => {
798
798
  d == null || d.requestSubmit();
799
799
  }));
800
800
  }
801
801
  function ne() {
802
802
  X();
803
803
  }
804
- function pe(o, $) {
804
+ function pe(i, w) {
805
805
  return btoa(JSON.stringify({
806
- algorithm: o.algorithm,
807
- challenge: o.challenge,
808
- number: $.number,
809
- salt: o.salt,
810
- signature: o.signature,
811
- test: S ? !0 : void 0,
812
- took: $.took
806
+ algorithm: i.algorithm,
807
+ challenge: i.challenge,
808
+ number: w.number,
809
+ salt: i.salt,
810
+ signature: i.signature,
811
+ test: G ? !0 : void 0,
812
+ took: w.took
813
813
  }));
814
814
  }
815
- function ye(o) {
816
- if (!o.algorithm)
815
+ function re(i) {
816
+ if (!i.algorithm)
817
817
  throw new Error("Invalid challenge. Property algorithm is missing.");
818
- if (o.signature === void 0)
818
+ if (i.signature === void 0)
819
819
  throw new Error("Invalid challenge. Property signature is missing.");
820
- if (!k.includes(o.algorithm.toUpperCase()))
820
+ if (!k.includes(i.algorithm.toUpperCase()))
821
821
  throw new Error(`Unknown algorithm value. Allowed values: ${k.join(", ")}`);
822
- if (!o.challenge || o.challenge.length < 40)
822
+ if (!i.challenge || i.challenge.length < 40)
823
823
  throw new Error("Challenge is too short. Min. 40 chars.");
824
- if (!o.salt || o.salt.length < 10)
824
+ if (!i.salt || i.salt.length < 10)
825
825
  throw new Error("Salt is too short. Min. 10 chars.");
826
826
  }
827
827
  async function ke() {
828
828
  if (A)
829
829
  throw E("mocking error"), new Error("Mocked error.");
830
- if (i)
831
- return E("using provided json data"), i;
832
- if (S)
830
+ if (o)
831
+ return E("using provided json data"), o;
832
+ if (G)
833
833
  return E("generating test challenge"), at();
834
834
  {
835
- if (!a)
835
+ if (!u)
836
836
  throw new Error("Attribute challengeurl not set.");
837
- E("fetching challenge from", a);
838
- const o = await fetch(a);
839
- if (o.status !== 200)
840
- throw new Error(`Server responded with ${o.status}.`);
841
- return o.json();
837
+ E("fetching challenge from", u);
838
+ const i = await fetch(u);
839
+ if (i.status !== 200)
840
+ throw new Error(`Server responded with ${i.status}.`);
841
+ return i.json();
842
842
  }
843
843
  }
844
- async function Ee(o) {
845
- let $ = null;
844
+ async function Ee(i) {
845
+ let w = null;
846
846
  if ("Worker" in window) {
847
847
  try {
848
- $ = await Ce(o.challenge, o.salt, o.algorithm);
848
+ w = await Ce(i.challenge, i.salt, i.algorithm);
849
849
  } catch (D) {
850
850
  E(D);
851
851
  }
852
- if (($ == null ? void 0 : $.number) !== void 0)
853
- return { data: o, solution: $ };
852
+ if ((w == null ? void 0 : w.number) !== void 0)
853
+ return { data: i, solution: w };
854
854
  }
855
855
  return {
856
- data: o,
857
- solution: await ut(o.challenge, o.salt, o.algorithm, I)
856
+ data: i,
857
+ solution: await ft(i.challenge, i.salt, i.algorithm, x)
858
858
  };
859
859
  }
860
- async function Ce(o, $, D) {
861
- const re = new lt();
862
- return new Promise((Ne) => {
863
- re.addEventListener("message", (je) => {
864
- Ne(je.data);
865
- }), re.postMessage({ alg: D, challenge: o, max: I, salt: $ });
860
+ async function Ce(i, w, D) {
861
+ const oe = new lt();
862
+ return new Promise((je) => {
863
+ oe.addEventListener("message", (Ae) => {
864
+ je(Ae.data);
865
+ }), oe.postMessage({ alg: D, challenge: i, max: x, salt: w });
866
866
  });
867
867
  }
868
868
  function xe() {
869
- [p.UNVERIFIED, p.ERROR].includes(U) ? P() : n(6, v = !0);
869
+ [y.UNVERIFIED, y.ERROR].includes(U) ? B() : n(6, g = !0);
870
870
  }
871
871
  function Le() {
872
- U === p.VERIFYING && alert(r.waitAlert);
872
+ U === y.VERIFYING && alert(r.waitAlert);
873
+ }
874
+ function Ie(i) {
875
+ i.auto !== void 0 && (n(0, s = i.auto), s === "onload" && B()), i.challenge && (re(i.challenge), o = i.challenge), i.debug !== void 0 && n(12, a = !!i.debug), i.hidefooter !== void 0 && n(1, R = !!i.hidefooter), i.hidelogo !== void 0 && n(2, p = !!i.hidelogo), i.maxnumber !== void 0 && n(13, x = +i.maxnumber), i.mockerror !== void 0 && n(14, A = !!i.mockerror), i.name !== void 0 && n(3, j = i.name), i.test !== void 0 && n(15, G = !!i.test), i.strings && n(22, l = i.strings);
873
876
  }
874
- function X(o = p.UNVERIFIED) {
875
- n(6, v = !1), n(8, h = null), n(4, w = null), n(5, U = o);
877
+ function X(i = y.UNVERIFIED) {
878
+ n(6, g = !1), n(8, h = null), n(4, v = null), n(5, U = i);
876
879
  }
877
- async function P() {
878
- return X(p.VERIFYING), ke().then((o) => (ye(o), E("challenge", o), Ee(o))).then(({ data: o, solution: $ }) => {
879
- if (E("solution", $), ($ == null ? void 0 : $.number) !== void 0)
880
- E("verified"), n(5, U = p.VERIFIED), n(6, v = !0), n(4, w = pe(o, $)), E("payload", w), Te().then(() => {
881
- V("verified", { payload: w });
880
+ async function B() {
881
+ return X(y.VERIFYING), ke().then((i) => (re(i), E("challenge", i), Ee(i))).then(({ data: i, solution: w }) => {
882
+ if (E("solution", w), (w == null ? void 0 : w.number) !== void 0)
883
+ E("verified"), n(5, U = y.VERIFIED), n(6, g = !0), n(4, v = pe(i, w)), E("payload", v), Xe().then(() => {
884
+ V("verified", { payload: v });
882
885
  });
883
886
  else
884
887
  throw new Error("Unexpected result returned.");
885
- }).catch((o) => {
886
- E(o), n(5, U = p.ERROR), n(6, v = !1), n(8, h = o);
888
+ }).catch((i) => {
889
+ E(i), n(5, U = y.ERROR), n(6, g = !1), n(8, h = i);
887
890
  });
888
891
  }
889
- function Ie() {
890
- v = this.checked, n(6, v);
892
+ function Re() {
893
+ g = this.checked, n(6, g);
891
894
  }
892
- function Re(o) {
893
- J[o ? "unshift" : "push"](() => {
894
- m = o, n(7, m);
895
+ function Ne(i) {
896
+ J[i ? "unshift" : "push"](() => {
897
+ m = i, n(7, m);
895
898
  });
896
899
  }
897
- return t.$$set = (o) => {
898
- "auto" in o && n(0, s = o.auto), "challengeurl" in o && n(12, a = o.challengeurl), "challengejson" in o && n(13, f = o.challengejson), "debug" in o && n(14, u = o.debug), "hidefooter" in o && n(1, N = o.hidefooter), "hidelogo" in o && n(2, y = o.hidelogo), "name" in o && n(3, j = o.name), "maxnumber" in o && n(15, I = o.maxnumber), "mockerror" in o && n(16, A = o.mockerror), "strings" in o && n(17, b = o.strings), "test" in o && n(18, S = o.test);
900
+ return t.$$set = (i) => {
901
+ "auto" in i && n(0, s = i.auto), "challengeurl" in i && n(16, u = i.challengeurl), "challengejson" in i && n(17, f = i.challengejson), "debug" in i && n(12, a = i.debug), "hidefooter" in i && n(1, R = i.hidefooter), "hidelogo" in i && n(2, p = i.hidelogo), "name" in i && n(3, j = i.name), "maxnumber" in i && n(13, x = i.maxnumber), "mockerror" in i && n(14, A = i.mockerror), "strings" in i && n(18, _ = i.strings), "test" in i && n(15, G = i.test);
899
902
  }, t.$$.update = () => {
900
903
  t.$$.dirty[0] & /*challengejson*/
901
- 8192 && (i = f ? he(f) : void 0), t.$$.dirty[0] & /*strings*/
902
- 131072 && n(21, l = b ? he(b) : {}), t.$$.dirty[0] & /*parsedStrings*/
903
- 2097152 && n(9, r = {
904
+ 131072 && (o = f ? de(f) : void 0), t.$$.dirty[0] & /*strings*/
905
+ 262144 && n(22, l = _ ? de(_) : {}), t.$$.dirty[0] & /*parsedStrings*/
906
+ 4194304 && n(9, r = {
904
907
  error: "Verification failed. Try again later.",
905
- footer: `Protected by <a href="${_e}" target="_blank">ALTCHA</a>`,
908
+ footer: `Protected by <a href="${ye}" target="_blank">ALTCHA</a>`,
906
909
  label: "I'm not a robot",
907
910
  verified: "Verified",
908
911
  verifying: "Verifying...",
909
912
  waitAlert: "Verifying... please wait.",
910
913
  ...l
911
914
  }), t.$$.dirty[0] & /*payload, state*/
912
- 48 && V("statechange", { payload: w, state: U });
915
+ 48 && V("statechange", { payload: v, state: U });
913
916
  }, [
914
917
  s,
915
- N,
916
- y,
918
+ R,
919
+ p,
917
920
  j,
918
- w,
919
- U,
920
921
  v,
922
+ U,
923
+ g,
921
924
  m,
922
925
  h,
923
926
  r,
924
927
  xe,
925
928
  Le,
926
929
  a,
927
- f,
928
- u,
929
- I,
930
+ x,
930
931
  A,
931
- b,
932
- S,
932
+ G,
933
+ u,
934
+ f,
935
+ _,
936
+ Ie,
933
937
  X,
934
- P,
938
+ B,
935
939
  l,
936
- Ie,
937
- Re
940
+ Re,
941
+ Ne
938
942
  ];
939
943
  }
940
- class wt extends nt {
944
+ class _t extends rt {
941
945
  constructor(e) {
942
- super(), et(
946
+ super(), tt(
943
947
  this,
944
948
  e,
949
+ vt,
945
950
  mt,
946
- gt,
947
- Se,
951
+ Ue,
948
952
  {
949
953
  auto: 0,
950
- challengeurl: 12,
951
- challengejson: 13,
952
- debug: 14,
954
+ challengeurl: 16,
955
+ challengejson: 17,
956
+ debug: 12,
953
957
  hidefooter: 1,
954
958
  hidelogo: 2,
955
959
  name: 3,
956
- maxnumber: 15,
957
- mockerror: 16,
958
- strings: 17,
959
- test: 18,
960
- reset: 19,
961
- verify: 20
960
+ maxnumber: 13,
961
+ mockerror: 14,
962
+ strings: 18,
963
+ test: 15,
964
+ configure: 19,
965
+ reset: 20,
966
+ verify: 21
962
967
  },
963
- ft,
968
+ ht,
964
969
  [-1, -1]
965
970
  );
966
971
  }
@@ -971,19 +976,19 @@ class wt extends nt {
971
976
  this.$$set({ auto: e }), C();
972
977
  }
973
978
  get challengeurl() {
974
- return this.$$.ctx[12];
979
+ return this.$$.ctx[16];
975
980
  }
976
981
  set challengeurl(e) {
977
982
  this.$$set({ challengeurl: e }), C();
978
983
  }
979
984
  get challengejson() {
980
- return this.$$.ctx[13];
985
+ return this.$$.ctx[17];
981
986
  }
982
987
  set challengejson(e) {
983
988
  this.$$set({ challengejson: e }), C();
984
989
  }
985
990
  get debug() {
986
- return this.$$.ctx[14];
991
+ return this.$$.ctx[12];
987
992
  }
988
993
  set debug(e) {
989
994
  this.$$set({ debug: e }), C();
@@ -1007,37 +1012,40 @@ class wt extends nt {
1007
1012
  this.$$set({ name: e }), C();
1008
1013
  }
1009
1014
  get maxnumber() {
1010
- return this.$$.ctx[15];
1015
+ return this.$$.ctx[13];
1011
1016
  }
1012
1017
  set maxnumber(e) {
1013
1018
  this.$$set({ maxnumber: e }), C();
1014
1019
  }
1015
1020
  get mockerror() {
1016
- return this.$$.ctx[16];
1021
+ return this.$$.ctx[14];
1017
1022
  }
1018
1023
  set mockerror(e) {
1019
1024
  this.$$set({ mockerror: e }), C();
1020
1025
  }
1021
1026
  get strings() {
1022
- return this.$$.ctx[17];
1027
+ return this.$$.ctx[18];
1023
1028
  }
1024
1029
  set strings(e) {
1025
1030
  this.$$set({ strings: e }), C();
1026
1031
  }
1027
1032
  get test() {
1028
- return this.$$.ctx[18];
1033
+ return this.$$.ctx[15];
1029
1034
  }
1030
1035
  set test(e) {
1031
1036
  this.$$set({ test: e }), C();
1032
1037
  }
1033
- get reset() {
1038
+ get configure() {
1034
1039
  return this.$$.ctx[19];
1035
1040
  }
1036
- get verify() {
1041
+ get reset() {
1037
1042
  return this.$$.ctx[20];
1038
1043
  }
1044
+ get verify() {
1045
+ return this.$$.ctx[21];
1046
+ }
1039
1047
  }
1040
- customElements.define("altcha-widget", tt(wt, { auto: {}, challengeurl: {}, challengejson: {}, debug: { type: "Boolean" }, hidefooter: { type: "Boolean" }, hidelogo: { type: "Boolean" }, name: {}, maxnumber: {}, mockerror: { type: "Boolean" }, strings: {}, test: { type: "Boolean" } }, [], ["reset", "verify"], !1));
1048
+ customElements.define("altcha-widget", nt(_t, { auto: {}, challengeurl: {}, challengejson: {}, debug: { type: "Boolean" }, hidefooter: { type: "Boolean" }, hidelogo: { type: "Boolean" }, name: {}, maxnumber: {}, mockerror: { type: "Boolean" }, strings: {}, test: { type: "Boolean" } }, [], ["configure", "reset", "verify"], !1));
1041
1049
  export {
1042
- wt as Altcha
1050
+ _t as Altcha
1043
1051
  };