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