altcha 0.1.8 → 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/README.md +49 -2
- package/dist/altcha.iife.js +1 -1
- package/dist/altcha.js +349 -341
- package/dist/altcha.umd.cjs +1 -1
- package/package.json +3 -2
package/dist/altcha.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
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
|
|
6
|
+
function ge(t) {
|
|
7
7
|
return t();
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function ie() {
|
|
10
10
|
return /* @__PURE__ */ Object.create(null);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
t.forEach(
|
|
12
|
+
function P(t) {
|
|
13
|
+
t.forEach(ge);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function be(t) {
|
|
16
16
|
return typeof t == "function";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
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
|
|
21
|
+
function Ve(t) {
|
|
22
22
|
return Object.keys(t).length === 0;
|
|
23
23
|
}
|
|
24
24
|
function b(t, e) {
|
|
25
25
|
t.appendChild(e);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const o =
|
|
27
|
+
function Me(t, e, n) {
|
|
28
|
+
const o = Fe(t);
|
|
29
29
|
if (!o.getElementById(e)) {
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const l = $("style");
|
|
31
|
+
l.id = e, l.textContent = n, Oe(o, l);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Fe(t) {
|
|
35
35
|
if (!t)
|
|
36
36
|
return document;
|
|
37
37
|
const e = t.getRootNode ? t.getRootNode() : t.ownerDocument;
|
|
@@ -41,30 +41,30 @@ function Me(t) {
|
|
|
41
41
|
e
|
|
42
42
|
) : t.ownerDocument;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Oe(t, e) {
|
|
45
45
|
return b(
|
|
46
46
|
/** @type {Document} */
|
|
47
47
|
t.head || t,
|
|
48
48
|
e
|
|
49
49
|
), e.sheet;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function N(t, e, n) {
|
|
52
52
|
t.insertBefore(e, n || null);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function I(t) {
|
|
55
55
|
t.parentNode && t.parentNode.removeChild(t);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function $(t) {
|
|
58
58
|
return document.createElement(t);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function S(t) {
|
|
61
61
|
return document.createElementNS("http://www.w3.org/2000/svg", t);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ye(t) {
|
|
64
64
|
return document.createTextNode(t);
|
|
65
65
|
}
|
|
66
66
|
function M() {
|
|
67
|
-
return
|
|
67
|
+
return Ye(" ");
|
|
68
68
|
}
|
|
69
69
|
function K(t, e, n, o) {
|
|
70
70
|
return t.addEventListener(e, n, o), () => t.removeEventListener(e, n, o);
|
|
@@ -72,16 +72,16 @@ function K(t, e, n, o) {
|
|
|
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
|
|
75
|
+
function Ze(t) {
|
|
76
76
|
return Array.from(t.childNodes);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function le(t, e, n) {
|
|
79
79
|
t.classList.toggle(e, !!n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Be(t, e, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
82
82
|
return new CustomEvent(t, { detail: e, bubbles: n, cancelable: o });
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function He(t) {
|
|
85
85
|
const e = {};
|
|
86
86
|
return t.childNodes.forEach(
|
|
87
87
|
/** @param {Element} node */
|
|
@@ -90,33 +90,33 @@ function Be(t) {
|
|
|
90
90
|
}
|
|
91
91
|
), e;
|
|
92
92
|
}
|
|
93
|
-
let
|
|
94
|
-
function
|
|
95
|
-
|
|
93
|
+
let W;
|
|
94
|
+
function H(t) {
|
|
95
|
+
W = t;
|
|
96
96
|
}
|
|
97
97
|
function ee() {
|
|
98
|
-
if (!
|
|
98
|
+
if (!W)
|
|
99
99
|
throw new Error("Function called outside component initialization");
|
|
100
|
-
return
|
|
100
|
+
return W;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function We(t) {
|
|
103
103
|
ee().$$.on_mount.push(t);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Pe(t) {
|
|
106
106
|
ee().$$.on_destroy.push(t);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Te() {
|
|
109
109
|
const t = ee();
|
|
110
110
|
return (e, n, { cancelable: o = !1 } = {}) => {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
const r =
|
|
111
|
+
const l = t.$$.callbacks[e];
|
|
112
|
+
if (l) {
|
|
113
|
+
const r = Be(
|
|
114
114
|
/** @type {string} */
|
|
115
115
|
e,
|
|
116
116
|
n,
|
|
117
117
|
{ cancelable: o }
|
|
118
118
|
);
|
|
119
|
-
return
|
|
119
|
+
return l.slice().forEach((s) => {
|
|
120
120
|
s.call(t, r);
|
|
121
121
|
}), !r.defaultPrevented;
|
|
122
122
|
}
|
|
@@ -125,13 +125,13 @@ function Pe() {
|
|
|
125
125
|
}
|
|
126
126
|
const O = [], J = [];
|
|
127
127
|
let Y = [];
|
|
128
|
-
const
|
|
128
|
+
const se = [], me = /* @__PURE__ */ Promise.resolve();
|
|
129
129
|
let Q = !1;
|
|
130
|
-
function
|
|
131
|
-
Q || (Q = !0,
|
|
130
|
+
function ve() {
|
|
131
|
+
Q || (Q = !0, me.then(C));
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
return
|
|
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 =
|
|
144
|
+
const t = W;
|
|
145
145
|
do {
|
|
146
146
|
try {
|
|
147
147
|
for (; F < O.length; ) {
|
|
148
148
|
const e = O[F];
|
|
149
|
-
F++,
|
|
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 (
|
|
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,50 +159,50 @@ function C() {
|
|
|
159
159
|
}
|
|
160
160
|
Y.length = 0;
|
|
161
161
|
} while (O.length);
|
|
162
|
-
for (;
|
|
163
|
-
|
|
164
|
-
Q = !1, z.clear(),
|
|
162
|
+
for (; se.length; )
|
|
163
|
+
se.pop()();
|
|
164
|
+
Q = !1, z.clear(), H(t);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function De(t) {
|
|
167
167
|
if (t.fragment !== null) {
|
|
168
|
-
t.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
|
|
173
|
+
function Ke(t) {
|
|
174
174
|
const e = [], n = [];
|
|
175
175
|
Y.forEach((o) => t.indexOf(o) === -1 ? e.push(o) : n.push(o)), n.forEach((o) => o()), Y = e;
|
|
176
176
|
}
|
|
177
|
-
const
|
|
178
|
-
function
|
|
179
|
-
t && t.i && (
|
|
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
|
|
182
|
-
const { fragment: o, after_update:
|
|
181
|
+
function Qe(t, e, n) {
|
|
182
|
+
const { fragment: o, after_update: l } = t.$$;
|
|
183
183
|
o && o.m(e, n), q(() => {
|
|
184
|
-
const r = t.$$.on_mount.map(
|
|
185
|
-
t.$$.on_destroy ? t.$$.on_destroy.push(...r) :
|
|
186
|
-
}),
|
|
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
|
+
}), l.forEach(q);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function qe(t, e) {
|
|
189
189
|
const n = t.$$;
|
|
190
|
-
n.fragment !== null && (
|
|
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
|
|
193
|
-
t.$$.dirty[0] === -1 && (O.push(t),
|
|
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
|
|
196
|
-
const f =
|
|
197
|
-
|
|
198
|
-
const
|
|
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
|
|
202
202
|
props: r,
|
|
203
203
|
update: Z,
|
|
204
|
-
not_equal:
|
|
205
|
-
bound:
|
|
204
|
+
not_equal: l,
|
|
205
|
+
bound: ie(),
|
|
206
206
|
// lifecycle
|
|
207
207
|
on_mount: [],
|
|
208
208
|
on_destroy: [],
|
|
@@ -211,61 +211,61 @@ function et(t, e, n, o, i, r, s = null, a = [-1]) {
|
|
|
211
211
|
after_update: [],
|
|
212
212
|
context: new Map(e.context || (f ? f.$$.context : [])),
|
|
213
213
|
// everything else
|
|
214
|
-
callbacks:
|
|
215
|
-
dirty:
|
|
214
|
+
callbacks: ie(),
|
|
215
|
+
dirty: u,
|
|
216
216
|
skip_bound: !1,
|
|
217
217
|
root: e.target || f.$$.root
|
|
218
218
|
};
|
|
219
|
-
s && s(
|
|
220
|
-
let
|
|
221
|
-
if (
|
|
222
|
-
const A =
|
|
223
|
-
return
|
|
224
|
-
}) : [],
|
|
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
|
|
227
|
-
|
|
226
|
+
const p = Ze(e.target);
|
|
227
|
+
a.fragment && a.fragment.l(p), p.forEach(I);
|
|
228
228
|
} else
|
|
229
|
-
|
|
230
|
-
e.intro &&
|
|
229
|
+
a.fragment && a.fragment.c();
|
|
230
|
+
e.intro && Je(t.$$.fragment), Qe(t, e.target, e.anchor), C();
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
H(f);
|
|
233
233
|
}
|
|
234
|
-
let
|
|
235
|
-
typeof HTMLElement == "function" && (
|
|
234
|
+
let _e;
|
|
235
|
+
typeof HTMLElement == "function" && (_e = class extends HTMLElement {
|
|
236
236
|
constructor(e, n, o) {
|
|
237
237
|
super();
|
|
238
238
|
/** The Svelte component constructor */
|
|
239
|
-
|
|
239
|
+
L(this, "$$ctor");
|
|
240
240
|
/** Slots */
|
|
241
|
-
|
|
241
|
+
L(this, "$$s");
|
|
242
242
|
/** The Svelte component instance */
|
|
243
|
-
|
|
243
|
+
L(this, "$$c");
|
|
244
244
|
/** Whether or not the custom element is connected */
|
|
245
|
-
|
|
245
|
+
L(this, "$$cn", !1);
|
|
246
246
|
/** Component props data */
|
|
247
|
-
|
|
247
|
+
L(this, "$$d", {});
|
|
248
248
|
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
249
|
-
|
|
249
|
+
L(this, "$$r", !1);
|
|
250
250
|
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
251
|
-
|
|
251
|
+
L(this, "$$p_d", {});
|
|
252
252
|
/** @type {Record<string, Function[]>} Event listeners */
|
|
253
|
-
|
|
253
|
+
L(this, "$$l", {});
|
|
254
254
|
/** @type {Map<Function, Function>} Event listener unsubscribe functions */
|
|
255
|
-
|
|
255
|
+
L(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
256
256
|
this.$$ctor = e, this.$$s = n, o && this.attachShadow({ mode: "open" });
|
|
257
257
|
}
|
|
258
258
|
addEventListener(e, n, o) {
|
|
259
259
|
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) {
|
|
260
|
-
const
|
|
261
|
-
this.$$l_u.set(n,
|
|
260
|
+
const l = this.$$c.$on(e, n);
|
|
261
|
+
this.$$l_u.set(n, l);
|
|
262
262
|
}
|
|
263
263
|
super.addEventListener(e, n, o);
|
|
264
264
|
}
|
|
265
265
|
removeEventListener(e, n, o) {
|
|
266
266
|
if (super.removeEventListener(e, n, o), this.$$c) {
|
|
267
|
-
const
|
|
268
|
-
|
|
267
|
+
const l = this.$$l_u.get(n);
|
|
268
|
+
l && (l(), this.$$l_u.delete(n));
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
async connectedCallback() {
|
|
@@ -275,24 +275,24 @@ typeof HTMLElement == "function" && (ve = class extends HTMLElement {
|
|
|
275
275
|
let s;
|
|
276
276
|
return {
|
|
277
277
|
c: function() {
|
|
278
|
-
s =
|
|
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(
|
|
285
|
-
|
|
284
|
+
m: function(a, R) {
|
|
285
|
+
N(a, s, R);
|
|
286
286
|
},
|
|
287
|
-
d: function(
|
|
288
|
-
|
|
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 = {}, o =
|
|
295
|
+
const n = {}, o = He(this);
|
|
296
296
|
for (const r of this.$$s)
|
|
297
297
|
r in o && (n[r] = [e(r)]);
|
|
298
298
|
for (const r of this.attributes) {
|
|
@@ -311,7 +311,7 @@ typeof HTMLElement == "function" && (ve = class extends HTMLElement {
|
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
});
|
|
314
|
-
const
|
|
314
|
+
const l = () => {
|
|
315
315
|
this.$$r = !0;
|
|
316
316
|
for (const r in this.$$p_d)
|
|
317
317
|
if (this.$$d[r] = this.$$c.$$.ctx[this.$$c.$$.props[r]], this.$$p_d[r].reflect) {
|
|
@@ -325,11 +325,11 @@ typeof HTMLElement == "function" && (ve = class extends HTMLElement {
|
|
|
325
325
|
}
|
|
326
326
|
this.$$r = !1;
|
|
327
327
|
};
|
|
328
|
-
this.$$c.$$.after_update.push(
|
|
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
|
|
332
|
-
this.$$l_u.set(s,
|
|
331
|
+
const u = this.$$c.$on(r, s);
|
|
332
|
+
this.$$l_u.set(s, u);
|
|
333
333
|
}
|
|
334
334
|
this.$$l = {};
|
|
335
335
|
}
|
|
@@ -337,8 +337,8 @@ typeof HTMLElement == "function" && (ve = class extends HTMLElement {
|
|
|
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
339
|
attributeChangedCallback(e, n, o) {
|
|
340
|
-
var
|
|
341
|
-
this.$$r || (e = this.$$g_p(e), this.$$d[e] = T(e, o, this.$$p_d, "toProp"), (
|
|
340
|
+
var l;
|
|
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(() => {
|
|
@@ -353,11 +353,11 @@ typeof HTMLElement == "function" && (ve = class extends HTMLElement {
|
|
|
353
353
|
});
|
|
354
354
|
function T(t, e, n, o) {
|
|
355
355
|
var r;
|
|
356
|
-
const
|
|
357
|
-
if (e =
|
|
356
|
+
const l = (r = n[t]) == null ? void 0 : r.type;
|
|
357
|
+
if (e = l === "Boolean" && typeof e != "boolean" ? e != null : e, !o || !n[t])
|
|
358
358
|
return e;
|
|
359
359
|
if (o === "toAttribute")
|
|
360
|
-
switch (
|
|
360
|
+
switch (l) {
|
|
361
361
|
case "Object":
|
|
362
362
|
case "Array":
|
|
363
363
|
return e == null ? null : JSON.stringify(e);
|
|
@@ -369,7 +369,7 @@ function T(t, e, n, o) {
|
|
|
369
369
|
return e;
|
|
370
370
|
}
|
|
371
371
|
else
|
|
372
|
-
switch (
|
|
372
|
+
switch (l) {
|
|
373
373
|
case "Object":
|
|
374
374
|
case "Array":
|
|
375
375
|
return e && JSON.parse(e);
|
|
@@ -381,38 +381,38 @@ function T(t, e, n, o) {
|
|
|
381
381
|
return e;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
let s = class extends
|
|
384
|
+
function nt(t, e, n, o, l, r) {
|
|
385
|
+
let s = class extends _e {
|
|
386
386
|
constructor() {
|
|
387
|
-
super(t, n,
|
|
387
|
+
super(t, n, l), this.$$p_d = e;
|
|
388
388
|
}
|
|
389
389
|
static get observedAttributes() {
|
|
390
390
|
return Object.keys(e).map(
|
|
391
|
-
(
|
|
391
|
+
(u) => (e[u].attribute || u).toLowerCase()
|
|
392
392
|
);
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
|
-
return Object.keys(e).forEach((
|
|
396
|
-
Object.defineProperty(s.prototype,
|
|
395
|
+
return Object.keys(e).forEach((u) => {
|
|
396
|
+
Object.defineProperty(s.prototype, u, {
|
|
397
397
|
get() {
|
|
398
|
-
return this.$$c &&
|
|
398
|
+
return this.$$c && u in this.$$c ? this.$$c[u] : this.$$d[u];
|
|
399
399
|
},
|
|
400
400
|
set(f) {
|
|
401
|
-
var
|
|
402
|
-
f = T(
|
|
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
|
-
}), o.forEach((
|
|
406
|
-
Object.defineProperty(s.prototype,
|
|
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[
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
432
|
+
L(this, "$$set");
|
|
433
433
|
}
|
|
434
434
|
/** @returns {void} */
|
|
435
435
|
$destroy() {
|
|
436
|
-
|
|
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 (!
|
|
445
|
+
if (!be(n))
|
|
446
446
|
return Z;
|
|
447
447
|
const o = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
|
|
448
448
|
return o.push(n), () => {
|
|
449
|
-
const
|
|
450
|
-
|
|
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 && !
|
|
458
|
+
this.$$set && !Ve(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
const
|
|
462
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
463
|
-
const
|
|
464
|
-
function
|
|
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
|
+
function lt(t) {
|
|
465
465
|
let e;
|
|
466
466
|
try {
|
|
467
|
-
if (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 it(t) {
|
|
|
474
474
|
}), n;
|
|
475
475
|
} catch {
|
|
476
476
|
return new Worker(
|
|
477
|
-
"data:text/javascript;base64," +
|
|
477
|
+
"data:text/javascript;base64," + we,
|
|
478
478
|
{
|
|
479
479
|
name: t == null ? void 0 : t.name
|
|
480
480
|
}
|
|
@@ -483,238 +483,238 @@ function it(t) {
|
|
|
483
483
|
e && (window.URL || window.webkitURL).revokeObjectURL(e);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
const
|
|
487
|
-
function
|
|
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), o = Math.round(Math.random() * t),
|
|
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
|
-
challenge:
|
|
494
|
+
challenge: l,
|
|
495
495
|
salt: n,
|
|
496
496
|
signature: ""
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
-
async function
|
|
500
|
-
return
|
|
499
|
+
async function $e(t, e, n) {
|
|
500
|
+
return ut(await crypto.subtle.digest(n.toUpperCase(), ct.encode(t + e)));
|
|
501
501
|
}
|
|
502
|
-
async function
|
|
503
|
-
const
|
|
502
|
+
async function ft(t, e, n = "SHA-256", o = st) {
|
|
503
|
+
const l = Date.now();
|
|
504
504
|
for (let r = 0; r <= o; r++)
|
|
505
|
-
if (await
|
|
505
|
+
if (await $e(e, r, n) === t)
|
|
506
506
|
return {
|
|
507
507
|
number: r,
|
|
508
|
-
took: Date.now() -
|
|
508
|
+
took: Date.now() - l
|
|
509
509
|
};
|
|
510
510
|
return null;
|
|
511
511
|
}
|
|
512
|
-
var
|
|
513
|
-
function
|
|
514
|
-
|
|
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
|
|
516
|
+
function ue(t) {
|
|
517
517
|
let e, n, o;
|
|
518
518
|
return {
|
|
519
519
|
c() {
|
|
520
|
-
e =
|
|
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
|
-
m(
|
|
523
|
-
|
|
522
|
+
m(l, r) {
|
|
523
|
+
N(l, e, r), b(e, n), b(e, o);
|
|
524
524
|
},
|
|
525
|
-
d(
|
|
526
|
-
|
|
525
|
+
d(l) {
|
|
526
|
+
l && I(e);
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function dt(t) {
|
|
531
531
|
let e, n = (
|
|
532
532
|
/*_strings*/
|
|
533
533
|
t[9].label + ""
|
|
534
534
|
), o;
|
|
535
535
|
return {
|
|
536
536
|
c() {
|
|
537
|
-
e =
|
|
537
|
+
e = $("label"), c(e, "for", o = /*name*/
|
|
538
538
|
t[3] + "_checkbox"), c(e, "class", "svelte-vuofbg");
|
|
539
539
|
},
|
|
540
|
-
m(
|
|
541
|
-
|
|
540
|
+
m(l, r) {
|
|
541
|
+
N(l, e, r), e.innerHTML = n;
|
|
542
542
|
},
|
|
543
|
-
p(
|
|
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
547
|
8 && o !== (o = /*name*/
|
|
548
|
-
|
|
548
|
+
l[3] + "_checkbox") && c(e, "for", o);
|
|
549
549
|
},
|
|
550
|
-
d(
|
|
551
|
-
|
|
550
|
+
d(l) {
|
|
551
|
+
l && I(e);
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
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 =
|
|
562
|
+
e = $("span");
|
|
563
563
|
},
|
|
564
|
-
m(o,
|
|
565
|
-
|
|
564
|
+
m(o, l) {
|
|
565
|
+
N(o, e, l), e.innerHTML = n;
|
|
566
566
|
},
|
|
567
|
-
p(o,
|
|
568
|
-
|
|
567
|
+
p(o, l) {
|
|
568
|
+
l[0] & /*_strings*/
|
|
569
569
|
512 && n !== (n = /*_strings*/
|
|
570
570
|
o[9].verifying + "") && (e.innerHTML = n);
|
|
571
571
|
},
|
|
572
572
|
d(o) {
|
|
573
|
-
o &&
|
|
573
|
+
o && I(e);
|
|
574
574
|
}
|
|
575
575
|
};
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function bt(t) {
|
|
578
578
|
let e, n = (
|
|
579
579
|
/*_strings*/
|
|
580
580
|
t[9].verified + ""
|
|
581
|
-
), o,
|
|
581
|
+
), o, l;
|
|
582
582
|
return {
|
|
583
583
|
c() {
|
|
584
|
-
e =
|
|
585
|
-
|
|
584
|
+
e = $("span"), o = M(), l = $("input"), c(l, "type", "hidden"), c(
|
|
585
|
+
l,
|
|
586
586
|
"name",
|
|
587
587
|
/*name*/
|
|
588
588
|
t[3]
|
|
589
|
-
),
|
|
589
|
+
), l.value = /*payload*/
|
|
590
590
|
t[4];
|
|
591
591
|
},
|
|
592
592
|
m(r, s) {
|
|
593
|
-
|
|
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*/
|
|
597
597
|
512 && n !== (n = /*_strings*/
|
|
598
598
|
r[9].verified + "") && (e.innerHTML = n), s[0] & /*name*/
|
|
599
599
|
8 && c(
|
|
600
|
-
|
|
600
|
+
l,
|
|
601
601
|
"name",
|
|
602
602
|
/*name*/
|
|
603
603
|
r[3]
|
|
604
604
|
), s[0] & /*payload*/
|
|
605
|
-
16 && (
|
|
605
|
+
16 && (l.value = /*payload*/
|
|
606
606
|
r[4]);
|
|
607
607
|
},
|
|
608
608
|
d(r) {
|
|
609
|
-
r && (
|
|
609
|
+
r && (I(e), I(o), I(l));
|
|
610
610
|
}
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
613
|
function ae(t) {
|
|
614
|
-
let e, n, o,
|
|
614
|
+
let e, n, o, l, r, s;
|
|
615
615
|
return {
|
|
616
616
|
c() {
|
|
617
|
-
e =
|
|
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(
|
|
620
|
-
|
|
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(
|
|
624
|
-
|
|
623
|
+
d(u) {
|
|
624
|
+
u && I(e);
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
let e, n, o,
|
|
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 =
|
|
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
640
|
), c(e, "class", "altcha-error svelte-vuofbg");
|
|
641
641
|
},
|
|
642
|
-
m(
|
|
643
|
-
|
|
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(
|
|
645
|
+
p(u, f) {
|
|
646
646
|
f[0] & /*_strings*/
|
|
647
647
|
512 && s !== (s = /*_strings*/
|
|
648
|
-
|
|
648
|
+
u[9].error + "") && (r.innerHTML = s), f[0] & /*error*/
|
|
649
649
|
256 && c(
|
|
650
650
|
r,
|
|
651
651
|
"title",
|
|
652
652
|
/*error*/
|
|
653
|
-
|
|
653
|
+
u[8]
|
|
654
654
|
);
|
|
655
655
|
},
|
|
656
|
-
d(
|
|
657
|
-
|
|
656
|
+
d(u) {
|
|
657
|
+
u && I(e);
|
|
658
658
|
}
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function he(t) {
|
|
662
662
|
let e, n, o = (
|
|
663
663
|
/*_strings*/
|
|
664
664
|
t[9].footer + ""
|
|
665
665
|
);
|
|
666
666
|
return {
|
|
667
667
|
c() {
|
|
668
|
-
e =
|
|
668
|
+
e = $("div"), n = $("div"), c(n, "class", "svelte-vuofbg"), c(e, "class", "altcha-footer svelte-vuofbg");
|
|
669
669
|
},
|
|
670
|
-
m(
|
|
671
|
-
|
|
670
|
+
m(l, r) {
|
|
671
|
+
N(l, e, r), b(e, n), n.innerHTML = o;
|
|
672
672
|
},
|
|
673
|
-
p(
|
|
673
|
+
p(l, r) {
|
|
674
674
|
r[0] & /*_strings*/
|
|
675
675
|
512 && o !== (o = /*_strings*/
|
|
676
|
-
|
|
676
|
+
l[9].footer + "") && (n.innerHTML = o);
|
|
677
677
|
},
|
|
678
|
-
d(
|
|
679
|
-
|
|
678
|
+
d(l) {
|
|
679
|
+
l && I(e);
|
|
680
680
|
}
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
let e, n, o,
|
|
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] ===
|
|
686
|
+
t[5] === y.VERIFYING && ue()
|
|
687
687
|
);
|
|
688
|
-
function
|
|
688
|
+
function G(h, v) {
|
|
689
689
|
return (
|
|
690
690
|
/*state*/
|
|
691
|
-
h[5] ===
|
|
691
|
+
h[5] === y.VERIFIED ? bt : (
|
|
692
692
|
/*state*/
|
|
693
|
-
h[5] ===
|
|
693
|
+
h[5] === y.VERIFYING ? gt : dt
|
|
694
694
|
)
|
|
695
695
|
);
|
|
696
696
|
}
|
|
697
|
-
let 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] &&
|
|
702
|
+
t[8] && fe(t)
|
|
703
703
|
), d = (
|
|
704
704
|
/*_strings*/
|
|
705
705
|
t[9].footer && /*hidefooter*/
|
|
706
|
-
t[1] !== !0 &&
|
|
706
|
+
t[1] !== !0 && he(t)
|
|
707
707
|
);
|
|
708
708
|
return {
|
|
709
709
|
c() {
|
|
710
|
-
e =
|
|
711
|
-
t[3] + "_checkbox"), r.required =
|
|
712
|
-
t[0] !== "onsubmit", c(r, "class", "svelte-vuofbg"), c(
|
|
713
|
-
|
|
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
|
+
l,
|
|
714
714
|
"altcha-hidden",
|
|
715
715
|
/*state*/
|
|
716
|
-
t[5] ===
|
|
717
|
-
), 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*/
|
|
@@ -722,13 +722,13 @@ function bt(t) {
|
|
|
722
722
|
);
|
|
723
723
|
},
|
|
724
724
|
m(h, v) {
|
|
725
|
-
|
|
726
|
-
t[6], b(n, f), b(n,
|
|
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[
|
|
731
|
+
t[23]
|
|
732
732
|
),
|
|
733
733
|
K(
|
|
734
734
|
r,
|
|
@@ -742,27 +742,27 @@ function bt(t) {
|
|
|
742
742
|
/*onInvalid*/
|
|
743
743
|
t[11]
|
|
744
744
|
)
|
|
745
|
-
],
|
|
745
|
+
], x = !0);
|
|
746
746
|
},
|
|
747
747
|
p(h, v) {
|
|
748
748
|
/*state*/
|
|
749
|
-
h[5] ===
|
|
749
|
+
h[5] === y.VERIFYING ? _ || (_ = ue(), _.c(), _.m(n, o)) : _ && (_.d(1), _ = null), v[0] & /*name*/
|
|
750
750
|
8 && s !== (s = /*name*/
|
|
751
751
|
h[3] + "_checkbox") && c(r, "id", s), v[0] & /*auto*/
|
|
752
|
-
1 &&
|
|
753
|
-
h[0] !== "onsubmit") && (r.required =
|
|
752
|
+
1 && u !== (u = /*auto*/
|
|
753
|
+
h[0] !== "onsubmit") && (r.required = u), v[0] & /*checked*/
|
|
754
754
|
64 && (r.checked = /*checked*/
|
|
755
755
|
h[6]), v[0] & /*state*/
|
|
756
|
-
32 &&
|
|
757
|
-
|
|
756
|
+
32 && le(
|
|
757
|
+
l,
|
|
758
758
|
"altcha-hidden",
|
|
759
759
|
/*state*/
|
|
760
|
-
h[5] ===
|
|
761
|
-
), V === (V =
|
|
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
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 =
|
|
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, v) : (d =
|
|
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,55 +773,55 @@ function bt(t) {
|
|
|
773
773
|
i: Z,
|
|
774
774
|
o: Z,
|
|
775
775
|
d(h) {
|
|
776
|
-
h &&
|
|
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
|
|
781
|
-
function
|
|
780
|
+
const ye = "https://altcha.org/";
|
|
781
|
+
function de(t) {
|
|
782
782
|
return JSON.parse(t);
|
|
783
783
|
}
|
|
784
|
-
function
|
|
785
|
-
let o,
|
|
786
|
-
const V =
|
|
787
|
-
let g = !1, m, d = null, h = null, v = null, U =
|
|
788
|
-
|
|
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
|
-
}),
|
|
791
|
-
E("mounted", "0.1.
|
|
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(...
|
|
794
|
-
(
|
|
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(
|
|
797
|
-
d && s === "onsubmit" && U ===
|
|
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(
|
|
804
|
+
function pe(i, w) {
|
|
805
805
|
return btoa(JSON.stringify({
|
|
806
|
-
algorithm:
|
|
807
|
-
challenge:
|
|
808
|
-
number:
|
|
809
|
-
salt:
|
|
810
|
-
signature:
|
|
811
|
-
test:
|
|
812
|
-
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
|
|
816
|
-
if (!
|
|
815
|
+
function re(i) {
|
|
816
|
+
if (!i.algorithm)
|
|
817
817
|
throw new Error("Invalid challenge. Property algorithm is missing.");
|
|
818
|
-
if (
|
|
818
|
+
if (i.signature === void 0)
|
|
819
819
|
throw new Error("Invalid challenge. Property signature is missing.");
|
|
820
|
-
if (!k.includes(
|
|
820
|
+
if (!k.includes(i.algorithm.toUpperCase()))
|
|
821
821
|
throw new Error(`Unknown algorithm value. Allowed values: ${k.join(", ")}`);
|
|
822
|
-
if (!
|
|
822
|
+
if (!i.challenge || i.challenge.length < 40)
|
|
823
823
|
throw new Error("Challenge is too short. Min. 40 chars.");
|
|
824
|
-
if (!
|
|
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() {
|
|
@@ -829,91 +829,94 @@ function mt(t, e, n) {
|
|
|
829
829
|
throw E("mocking error"), new Error("Mocked error.");
|
|
830
830
|
if (o)
|
|
831
831
|
return E("using provided json data"), o;
|
|
832
|
-
if (
|
|
832
|
+
if (G)
|
|
833
833
|
return E("generating test challenge"), at();
|
|
834
834
|
{
|
|
835
|
-
if (!
|
|
835
|
+
if (!u)
|
|
836
836
|
throw new Error("Attribute challengeurl not set.");
|
|
837
|
-
E("fetching challenge from",
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
throw new Error(`Server responded with ${
|
|
841
|
-
return
|
|
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(
|
|
845
|
-
let
|
|
844
|
+
async function Ee(i) {
|
|
845
|
+
let w = null;
|
|
846
846
|
if ("Worker" in window) {
|
|
847
847
|
try {
|
|
848
|
-
|
|
848
|
+
w = await Ce(i.challenge, i.salt, i.algorithm);
|
|
849
849
|
} catch (D) {
|
|
850
850
|
E(D);
|
|
851
851
|
}
|
|
852
|
-
if ((
|
|
853
|
-
return { data:
|
|
852
|
+
if ((w == null ? void 0 : w.number) !== void 0)
|
|
853
|
+
return { data: i, solution: w };
|
|
854
854
|
}
|
|
855
855
|
return {
|
|
856
|
-
data:
|
|
857
|
-
solution: await
|
|
856
|
+
data: i,
|
|
857
|
+
solution: await ft(i.challenge, i.salt, i.algorithm, x)
|
|
858
858
|
};
|
|
859
859
|
}
|
|
860
|
-
async function Ce(
|
|
861
|
-
const
|
|
862
|
-
return new Promise((
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
}),
|
|
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
|
-
[
|
|
869
|
+
[y.UNVERIFIED, y.ERROR].includes(U) ? B() : n(6, g = !0);
|
|
870
870
|
}
|
|
871
871
|
function Le() {
|
|
872
|
-
U ===
|
|
872
|
+
U === y.VERIFYING && alert(r.waitAlert);
|
|
873
873
|
}
|
|
874
|
-
function
|
|
875
|
-
n(
|
|
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);
|
|
876
876
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
877
|
+
function X(i = y.UNVERIFIED) {
|
|
878
|
+
n(6, g = !1), n(8, h = null), n(4, v = null), n(5, U = i);
|
|
879
|
+
}
|
|
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(() => {
|
|
881
884
|
V("verified", { payload: v });
|
|
882
885
|
});
|
|
883
886
|
else
|
|
884
887
|
throw new Error("Unexpected result returned.");
|
|
885
|
-
}).catch((
|
|
886
|
-
E(
|
|
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
|
|
892
|
+
function Re() {
|
|
890
893
|
g = this.checked, n(6, g);
|
|
891
894
|
}
|
|
892
|
-
function
|
|
893
|
-
J[
|
|
894
|
-
m =
|
|
895
|
+
function Ne(i) {
|
|
896
|
+
J[i ? "unshift" : "push"](() => {
|
|
897
|
+
m = i, n(7, m);
|
|
895
898
|
});
|
|
896
899
|
}
|
|
897
|
-
return t.$$set = (
|
|
898
|
-
"auto" in
|
|
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
|
-
|
|
902
|
-
|
|
903
|
-
|
|
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="${
|
|
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
915
|
48 && V("statechange", { payload: v, state: U });
|
|
913
916
|
}, [
|
|
914
917
|
s,
|
|
915
|
-
|
|
916
|
-
|
|
918
|
+
R,
|
|
919
|
+
p,
|
|
917
920
|
j,
|
|
918
921
|
v,
|
|
919
922
|
U,
|
|
@@ -924,43 +927,45 @@ function mt(t, e, n) {
|
|
|
924
927
|
xe,
|
|
925
928
|
Le,
|
|
926
929
|
a,
|
|
927
|
-
|
|
928
|
-
u,
|
|
929
|
-
I,
|
|
930
|
+
x,
|
|
930
931
|
A,
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
i,
|
|
932
|
+
G,
|
|
933
|
+
u,
|
|
934
|
+
f,
|
|
935
|
+
_,
|
|
936
936
|
Ie,
|
|
937
|
-
|
|
937
|
+
X,
|
|
938
|
+
B,
|
|
939
|
+
l,
|
|
940
|
+
Re,
|
|
941
|
+
Ne
|
|
938
942
|
];
|
|
939
943
|
}
|
|
940
|
-
class
|
|
944
|
+
class _t extends rt {
|
|
941
945
|
constructor(e) {
|
|
942
|
-
super(),
|
|
946
|
+
super(), tt(
|
|
943
947
|
this,
|
|
944
948
|
e,
|
|
949
|
+
vt,
|
|
945
950
|
mt,
|
|
946
|
-
|
|
947
|
-
Se,
|
|
951
|
+
Ue,
|
|
948
952
|
{
|
|
949
953
|
auto: 0,
|
|
950
|
-
challengeurl:
|
|
951
|
-
challengejson:
|
|
952
|
-
debug:
|
|
954
|
+
challengeurl: 16,
|
|
955
|
+
challengejson: 17,
|
|
956
|
+
debug: 12,
|
|
953
957
|
hidefooter: 1,
|
|
954
958
|
hidelogo: 2,
|
|
955
959
|
name: 3,
|
|
956
|
-
maxnumber:
|
|
957
|
-
mockerror:
|
|
958
|
-
strings:
|
|
959
|
-
test:
|
|
960
|
-
|
|
961
|
-
|
|
960
|
+
maxnumber: 13,
|
|
961
|
+
mockerror: 14,
|
|
962
|
+
strings: 18,
|
|
963
|
+
test: 15,
|
|
964
|
+
configure: 19,
|
|
965
|
+
reset: 20,
|
|
966
|
+
verify: 21
|
|
962
967
|
},
|
|
963
|
-
|
|
968
|
+
ht,
|
|
964
969
|
[-1, -1]
|
|
965
970
|
);
|
|
966
971
|
}
|
|
@@ -971,19 +976,19 @@ class vt extends nt {
|
|
|
971
976
|
this.$$set({ auto: e }), C();
|
|
972
977
|
}
|
|
973
978
|
get challengeurl() {
|
|
974
|
-
return this.$$.ctx[
|
|
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[
|
|
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[
|
|
991
|
+
return this.$$.ctx[12];
|
|
987
992
|
}
|
|
988
993
|
set debug(e) {
|
|
989
994
|
this.$$set({ debug: e }), C();
|
|
@@ -1007,37 +1012,40 @@ class vt extends nt {
|
|
|
1007
1012
|
this.$$set({ name: e }), C();
|
|
1008
1013
|
}
|
|
1009
1014
|
get maxnumber() {
|
|
1010
|
-
return this.$$.ctx[
|
|
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[
|
|
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[
|
|
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[
|
|
1033
|
+
return this.$$.ctx[15];
|
|
1029
1034
|
}
|
|
1030
1035
|
set test(e) {
|
|
1031
1036
|
this.$$set({ test: e }), C();
|
|
1032
1037
|
}
|
|
1033
|
-
get
|
|
1038
|
+
get configure() {
|
|
1034
1039
|
return this.$$.ctx[19];
|
|
1035
1040
|
}
|
|
1036
|
-
get
|
|
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",
|
|
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
|
-
|
|
1050
|
+
_t as Altcha
|
|
1043
1051
|
};
|