@prosopo/procaptcha-bundle 3.0.9 → 3.0.11
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/CHANGELOG.md +38 -0
- package/dist/bundle/ProcaptchaWidget-48FxVPQd.js +187 -0
- package/dist/bundle/ProcaptchaWidget-B2BzhXLv.js +992 -0
- package/dist/bundle/builder-DNHtDoNG.js +44 -0
- package/dist/bundle/{captchaComponentProvider-CZppE3Vb.js → captchaComponentProvider-B7Vxx339.js} +256 -99
- package/dist/bundle/{captchaRenderer-CY8KuZK-.js → captchaRenderer-DdOlOCKw.js} +3 -3
- package/dist/bundle/{commonChunk-24zMb_mF.js → commonChunk-HCVkoCqn.js} +9 -12
- package/dist/bundle/{emotion-element-5486c51c.browser.esm-PRDDgd_k.js → emotion-element-5486c51c.browser.esm-D7qvHZDV.js} +1 -1
- package/dist/bundle/{fp.esm-BADUiinQ.js → fp.esm-DYWeNGcH.js} +648 -548
- package/dist/bundle/index-7Xh-Mf8v.js +1318 -0
- package/dist/bundle/{index-BiwZ4wVT.js → index-C00_J7av.js} +48 -12
- package/dist/bundle/{index-BzOMq-ud.js → index-DyYmvHVN.js} +1 -1
- package/dist/bundle/locales/ar/translation.json +12 -11
- package/dist/bundle/locales/az/translation.json +12 -11
- package/dist/bundle/locales/cs/translation.json +12 -11
- package/dist/bundle/locales/de/translation.json +12 -11
- package/dist/bundle/locales/el/translation.json +12 -11
- package/dist/bundle/locales/en/translation.json +4 -3
- package/dist/bundle/locales/es/translation.json +12 -11
- package/dist/bundle/locales/fi/translation.json +29 -28
- package/dist/bundle/locales/fr/translation.json +12 -11
- package/dist/bundle/locales/hi/translation.json +41 -40
- package/dist/bundle/locales/hu/translation.json +12 -11
- package/dist/bundle/locales/id/translation.json +12 -11
- package/dist/bundle/locales/it/translation.json +12 -11
- package/dist/bundle/locales/ja/translation.json +12 -11
- package/dist/bundle/locales/jv/translation.json +12 -11
- package/dist/bundle/locales/ko/translation.json +7 -6
- package/dist/bundle/locales/ml/translation.json +12 -11
- package/dist/bundle/locales/ms/translation.json +12 -11
- package/dist/bundle/locales/nl/translation.json +12 -11
- package/dist/bundle/locales/no/translation.json +12 -11
- package/dist/bundle/locales/pl/translation.json +12 -11
- package/dist/bundle/locales/pt/translation.json +12 -11
- package/dist/bundle/locales/pt-BR/translation.json +12 -11
- package/dist/bundle/locales/ro/translation.json +12 -11
- package/dist/bundle/locales/ru/translation.json +12 -11
- package/dist/bundle/locales/sr/translation.json +12 -11
- package/dist/bundle/locales/sv/translation.json +12 -11
- package/dist/bundle/locales/th/translation.json +12 -11
- package/dist/bundle/locales/tr/translation.json +7 -6
- package/dist/bundle/locales/uk/translation.json +12 -11
- package/dist/bundle/locales/vi/translation.json +12 -11
- package/dist/bundle/locales/zh-CN/translation.json +12 -11
- package/dist/bundle/nobleChunk-Qozzkbsq.js +3648 -0
- package/dist/bundle/procaptcha.bundle.js +2 -2
- package/dist/bundle/{utilCryptoChunk-CIPUtfoO.js → utilCryptoChunk-qm-BM2eT.js} +618 -647
- package/dist/bundle/{web2Chunk-7Vd8yt2r.js → web2Chunk-DCsWA5PR.js} +1150 -994
- package/dist/bundle/{web3Chunk-DrUvbVNW.js → web3Chunk-B8txCqUJ.js} +3 -3
- package/dist/index.js +142 -108
- package/dist/util/captcha/captchaComponentProvider.js +18 -10
- package/dist/util/captcha/captchaComponentsList.js +6 -5
- package/dist/util/captcha/captchaRenderer.js +58 -40
- package/dist/util/captcha/captchaType.js +9 -5
- package/dist/util/captcha/components/frictionlessCaptcha.js +19 -9
- package/dist/util/captcha/components/imageCaptcha.js +13 -5
- package/dist/util/captcha/components/powCaptcha.js +13 -5
- package/dist/util/config.js +15 -12
- package/dist/util/configCreator.js +21 -22
- package/dist/util/language.js +14 -13
- package/dist/util/timeout.js +13 -8
- package/dist/util/widgetFactory.js +77 -55
- package/dist/util/widgetThemeResolver.js +14 -17
- package/package.json +23 -20
- package/stats.html +1 -1
- package/vite.cjs.config.ts +2 -3
- package/vite.esm.config.ts +20 -0
- package/vite.test.config.ts +9 -5
- package/dist/bundle/ProcaptchaWidget-D_kzGjgO.js +0 -612
- package/dist/bundle/ProcaptchaWidget-DlrcrISF.js +0 -148
- package/dist/bundle/builder-CQlqPNRd.js +0 -37
- package/dist/bundle/index-BRg_gWPo.js +0 -1328
- package/dist/bundle/nobleChunk-Xl5XLrx3.js +0 -3635
- package/dist/components.d.ts +0 -5
- package/dist/components.d.ts.map +0 -1
- package/dist/components.js +0 -5
- package/dist/components.js.map +0 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/tests/util/captchaType.test.d.ts +0 -2
- package/dist/tests/util/captchaType.test.d.ts.map +0 -1
- package/dist/tests/util/captchaType.test.js +0 -36
- package/dist/tests/util/captchaType.test.js.map +0 -1
- package/dist/tests/util/config.test.d.ts +0 -2
- package/dist/tests/util/config.test.d.ts.map +0 -1
- package/dist/tests/util/config.test.js +0 -69
- package/dist/tests/util/config.test.js.map +0 -1
- package/dist/tests/util/renderLogic.test.d.ts +0 -2
- package/dist/tests/util/renderLogic.test.d.ts.map +0 -1
- package/dist/tests/util/renderLogic.test.js +0 -126
- package/dist/tests/util/renderLogic.test.js.map +0 -1
- package/dist/util/captcha/captchaComponentProvider.d.ts +0 -8
- package/dist/util/captcha/captchaComponentProvider.d.ts.map +0 -1
- package/dist/util/captcha/captchaComponentProvider.js.map +0 -1
- package/dist/util/captcha/captchaComponentsList.d.ts +0 -6
- package/dist/util/captcha/captchaComponentsList.d.ts.map +0 -1
- package/dist/util/captcha/captchaComponentsList.js.map +0 -1
- package/dist/util/captcha/captchaProps.d.ts +0 -9
- package/dist/util/captcha/captchaProps.d.ts.map +0 -1
- package/dist/util/captcha/captchaProps.js +0 -2
- package/dist/util/captcha/captchaProps.js.map +0 -1
- package/dist/util/captcha/captchaRenderer.d.ts +0 -24
- package/dist/util/captcha/captchaRenderer.d.ts.map +0 -1
- package/dist/util/captcha/captchaRenderer.js.map +0 -1
- package/dist/util/captcha/captchaType.d.ts +0 -3
- package/dist/util/captcha/captchaType.d.ts.map +0 -1
- package/dist/util/captcha/captchaType.js.map +0 -1
- package/dist/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
- package/dist/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/dist/util/captcha/components/frictionlessCaptcha.js.map +0 -1
- package/dist/util/captcha/components/imageCaptcha.d.ts +0 -4
- package/dist/util/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/dist/util/captcha/components/imageCaptcha.js.map +0 -1
- package/dist/util/captcha/components/powCaptcha.d.ts +0 -4
- package/dist/util/captcha/components/powCaptcha.d.ts.map +0 -1
- package/dist/util/captcha/components/powCaptcha.js.map +0 -1
- package/dist/util/config.d.ts +0 -6
- package/dist/util/config.d.ts.map +0 -1
- package/dist/util/config.js.map +0 -1
- package/dist/util/configCreator.d.ts +0 -5
- package/dist/util/configCreator.d.ts.map +0 -1
- package/dist/util/configCreator.js.map +0 -1
- package/dist/util/language.d.ts +0 -3
- package/dist/util/language.d.ts.map +0 -1
- package/dist/util/language.js.map +0 -1
- package/dist/util/timeout.d.ts +0 -3
- package/dist/util/timeout.d.ts.map +0 -1
- package/dist/util/timeout.js.map +0 -1
- package/dist/util/widgetFactory.d.ts +0 -18
- package/dist/util/widgetFactory.d.ts.map +0 -1
- package/dist/util/widgetFactory.js.map +0 -1
- package/dist/util/widgetThemeResolver.d.ts +0 -9
- package/dist/util/widgetThemeResolver.d.ts.map +0 -1
- package/dist/util/widgetThemeResolver.js.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const F = (s, i) => (c) => {
|
|
2
|
+
Object.assign(s, c), i(c);
|
|
3
|
+
}, d = (s, i) => {
|
|
4
|
+
const c = s(i), l = (n) => {
|
|
5
|
+
c.current = n;
|
|
6
|
+
};
|
|
7
|
+
return [c.current, l];
|
|
8
|
+
}, G = (s, i) => {
|
|
9
|
+
const [c, l] = s(!1), [u, n] = s(0), [r, f] = s([]), [p, m] = d(i, void 0), [h, v] = s(!1), [a, g] = s(
|
|
10
|
+
void 0
|
|
11
|
+
), [A, C] = s(!1), [b, w] = s(void 0), [I, M] = s(void 0), [D, H] = d(i, void 0), [T, j] = d(
|
|
12
|
+
i,
|
|
13
|
+
void 0
|
|
14
|
+
), [E, L] = d(i, void 0), [O, P] = s(!1), [U, k] = s(0), [q, y] = s(void 0), [z, B] = s(void 0);
|
|
15
|
+
return [
|
|
16
|
+
// the state
|
|
17
|
+
{
|
|
18
|
+
isHuman: c,
|
|
19
|
+
index: u,
|
|
20
|
+
solutions: r,
|
|
21
|
+
captchaApi: p,
|
|
22
|
+
showModal: h,
|
|
23
|
+
challenge: a,
|
|
24
|
+
loading: A,
|
|
25
|
+
account: b,
|
|
26
|
+
dappAccount: I,
|
|
27
|
+
submission: D,
|
|
28
|
+
timeout: T,
|
|
29
|
+
successfullChallengeTimeout: E,
|
|
30
|
+
sendData: O,
|
|
31
|
+
attemptCount: U,
|
|
32
|
+
error: q,
|
|
33
|
+
sessionId: z
|
|
34
|
+
},
|
|
35
|
+
// and method to update the state
|
|
36
|
+
(o) => {
|
|
37
|
+
o.account !== void 0 && w(o.account), o.isHuman !== void 0 && l(o.isHuman), o.index !== void 0 && n(o.index), o.solutions !== void 0 && f(o.solutions.slice()), o.captchaApi !== void 0 && m(o.captchaApi), o.showModal !== void 0 && v(o.showModal), o.challenge !== void 0 && g(o.challenge), o.loading !== void 0 && C(o.loading), o.showModal !== void 0 && v(o.showModal), o.dappAccount !== void 0 && M(o.dappAccount), o.submission !== void 0 && H(o.submission), o.timeout !== void 0 && j(o.timeout), o.successfullChallengeTimeout !== void 0 && L(o.timeout), o.sendData !== void 0 && P(o.sendData), o.attemptCount !== void 0 && k(o.attemptCount), o.error !== void 0 && y(o.error), o.sessionId !== void 0 && B(o.sessionId);
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
F as b,
|
|
43
|
+
G as u
|
|
44
|
+
};
|
package/dist/bundle/{captchaComponentProvider-CZppE3Vb.js → captchaComponentProvider-B7Vxx339.js}
RENAMED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { h as ce, j as v, E as le, a as ue, s as de, w as Se, T as Pe, u as Pt, i as xe, r as we, b as Ce, g as Te, m as Ee } from "./emotion-element-5486c51c.browser.esm-
|
|
2
|
-
import { a as Ae, r as m, c as x, A as i, S as ke, d as Ie, e as B, U as te, l as Oe, P as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { g as
|
|
1
|
+
import { h as ce, j as v, E as le, a as ue, s as de, w as Se, T as Pe, u as Pt, i as xe, r as we, b as Ce, g as Te, m as Ee } from "./emotion-element-5486c51c.browser.esm-D7qvHZDV.js";
|
|
2
|
+
import { a as Ae, r as m, c as x, A as i, S as ke, d as Ie, e as B, U as te, l as Oe, P as je, C as _ } from "./web2Chunk-DCsWA5PR.js";
|
|
3
|
+
import { g as Re, W as _e, l as Ne, d as Me } from "./index-C00_J7av.js";
|
|
4
|
+
import { a as pe } from "./commonChunk-HCVkoCqn.js";
|
|
5
|
+
import { g as Et } from "./bnChunk-DRlDxTFg.js";
|
|
6
6
|
const re = (e) => Object.values(e), Le = async (e) => {
|
|
7
7
|
if (e === "production") {
|
|
8
|
-
const t = await fetch(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const t = await fetch(
|
|
9
|
+
"https://provider-list.prosopo.io/",
|
|
10
|
+
{
|
|
11
|
+
method: "GET",
|
|
12
|
+
mode: "cors"
|
|
13
|
+
}
|
|
14
|
+
).then((r) => r.json());
|
|
12
15
|
return re(t);
|
|
13
16
|
}
|
|
14
17
|
if (e === "staging") {
|
|
15
|
-
const t = await fetch(
|
|
18
|
+
const t = await fetch(
|
|
19
|
+
"https://provider-list.prosopo.io/staging.json",
|
|
20
|
+
{ method: "GET", mode: "cors" }
|
|
21
|
+
).then((r) => r.json());
|
|
16
22
|
return re(t);
|
|
17
23
|
}
|
|
18
24
|
if (e === "development")
|
|
@@ -27,11 +33,14 @@ const re = (e) => Object.values(e), Le = async (e) => {
|
|
|
27
33
|
context: { environment: e }
|
|
28
34
|
});
|
|
29
35
|
};
|
|
30
|
-
let
|
|
36
|
+
let R = [];
|
|
31
37
|
const Fe = async (e) => {
|
|
32
38
|
const t = (o, a) => Math.floor(Math.random() * (a - o + 1) + o);
|
|
33
|
-
|
|
34
|
-
const r = Ae(
|
|
39
|
+
R.length === 0 && (R = await Le(e.defaultEnvironment));
|
|
40
|
+
const r = Ae(
|
|
41
|
+
R,
|
|
42
|
+
t(0, R.length - 1)
|
|
43
|
+
);
|
|
35
44
|
return {
|
|
36
45
|
providerAccount: r.address,
|
|
37
46
|
provider: {
|
|
@@ -44,13 +53,15 @@ const Fe = async (e) => {
|
|
|
44
53
|
await e();
|
|
45
54
|
} catch (n) {
|
|
46
55
|
if (o >= a)
|
|
47
|
-
return console.error(n), console.error(
|
|
56
|
+
return console.error(n), console.error(
|
|
57
|
+
`Max retries (${o} of ${a}) reached, aborting`
|
|
58
|
+
), r();
|
|
48
59
|
console.error(n), r(), await t();
|
|
49
60
|
}
|
|
50
61
|
}, M = (e) => ({
|
|
51
|
-
...
|
|
62
|
+
...Re(void 0),
|
|
52
63
|
...e
|
|
53
|
-
}), De = async (e) => e ? (await import("./web2Chunk-
|
|
64
|
+
}), De = async (e) => e ? (await import("./web2Chunk-DCsWA5PR.js").then((t) => t.j)).default : (await import("./web3Chunk-B8txCqUJ.js")).default;
|
|
54
65
|
function V() {
|
|
55
66
|
return V = Object.assign ? Object.assign.bind() : function(e) {
|
|
56
67
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -219,24 +230,24 @@ var Xe = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|def
|
|
|
219
230
|
f.push(g[h], g[0][h]);
|
|
220
231
|
}
|
|
221
232
|
var l = Se(function(p, S, A) {
|
|
222
|
-
var E = P && p.as || a, C = "", k = [],
|
|
233
|
+
var E = P && p.as || a, C = "", k = [], I = p;
|
|
223
234
|
if (p.theme == null) {
|
|
224
|
-
|
|
235
|
+
I = {};
|
|
225
236
|
for (var Q in p)
|
|
226
|
-
|
|
227
|
-
|
|
237
|
+
I[Q] = p[Q];
|
|
238
|
+
I.theme = m.useContext(Pe);
|
|
228
239
|
}
|
|
229
240
|
typeof p.className == "string" ? C = Te(S.registered, k, p.className) : p.className != null && (C = p.className + " ");
|
|
230
|
-
var ee = de(f.concat(k), S.registered,
|
|
241
|
+
var ee = de(f.concat(k), S.registered, I);
|
|
231
242
|
C += S.key + "-" + ee.name, s !== void 0 && (C += " " + s);
|
|
232
|
-
var be = P && u === void 0 ? oe(E) : b,
|
|
243
|
+
var be = P && u === void 0 ? oe(E) : b, O = {};
|
|
233
244
|
for (var j in p)
|
|
234
|
-
P && j === "as" || be(j) && (
|
|
235
|
-
return
|
|
245
|
+
P && j === "as" || be(j) && (O[j] = p[j]);
|
|
246
|
+
return O.className = C, A && (O.ref = A), /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement(et, {
|
|
236
247
|
cache: S,
|
|
237
248
|
serialized: ee,
|
|
238
249
|
isStringTag: typeof E == "string"
|
|
239
|
-
}), /* @__PURE__ */ m.createElement(E,
|
|
250
|
+
}), /* @__PURE__ */ m.createElement(E, O));
|
|
240
251
|
});
|
|
241
252
|
return l.displayName = n !== void 0 ? n : "Styled(" + (typeof a == "string" ? a : a.displayName || a.name || "Component") + ")", l.defaultProps = t.defaultProps, l.__emotion_real = l, l.__emotion_base = a, l.__emotion_styles = f, l.__emotion_forwardProp = u, Object.defineProperty(l, "toString", {
|
|
242
253
|
value: function() {
|
|
@@ -409,7 +420,17 @@ const ot = Ye`{
|
|
|
409
420
|
margin: "0",
|
|
410
421
|
borderStyle: "solid",
|
|
411
422
|
borderWidth: "1px"
|
|
412
|
-
}, ne = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", nt = "https://docs.prosopo.io/en/basics/faq/", st = () => Array.from(
|
|
423
|
+
}, ne = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", nt = "https://docs.prosopo.io/en/basics/faq/", st = () => Array.from(
|
|
424
|
+
{ length: 8 },
|
|
425
|
+
() => ne[Math.floor(Math.random() * ne.length)]
|
|
426
|
+
).join(""), it = ({
|
|
427
|
+
theme: e,
|
|
428
|
+
onChange: t,
|
|
429
|
+
checked: r,
|
|
430
|
+
labelText: o,
|
|
431
|
+
error: a,
|
|
432
|
+
loading: n
|
|
433
|
+
}) => {
|
|
413
434
|
const s = {
|
|
414
435
|
...at,
|
|
415
436
|
border: `1px solid ${e.palette.background.contrastText}`
|
|
@@ -441,15 +462,55 @@ const ot = Ye`{
|
|
|
441
462
|
minWidth: "28px",
|
|
442
463
|
minHeight: "28px"
|
|
443
464
|
}), [u, e, r]), f = st();
|
|
444
|
-
return
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
465
|
+
return /* @__PURE__ */ Ve(
|
|
466
|
+
"span",
|
|
467
|
+
{
|
|
468
|
+
style: {
|
|
469
|
+
display: "inline-flex",
|
|
470
|
+
alignItems: "center",
|
|
471
|
+
minHeight: "58px"
|
|
472
|
+
},
|
|
473
|
+
children: [
|
|
474
|
+
n ? /* @__PURE__ */ w(
|
|
475
|
+
"div",
|
|
476
|
+
{
|
|
477
|
+
className: _e,
|
|
478
|
+
"aria-label": "Loading spinner"
|
|
479
|
+
}
|
|
480
|
+
) : /* @__PURE__ */ w(
|
|
481
|
+
"input",
|
|
482
|
+
{
|
|
483
|
+
name: f,
|
|
484
|
+
id: f,
|
|
485
|
+
onMouseEnter: () => b(!0),
|
|
486
|
+
onMouseLeave: () => b(!1),
|
|
487
|
+
css: ot,
|
|
488
|
+
type: "checkbox",
|
|
489
|
+
"aria-live": "assertive",
|
|
490
|
+
"aria-label": o,
|
|
491
|
+
onChange: (T) => {
|
|
492
|
+
T.preventDefault(), T.stopPropagation(), b(!1), t();
|
|
493
|
+
},
|
|
494
|
+
checked: r,
|
|
495
|
+
style: g,
|
|
496
|
+
disabled: a !== void 0,
|
|
497
|
+
className: n ? "checkbox__loading-spinner" : "",
|
|
498
|
+
"data-cy": "captcha-checkbox"
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
a ? /* @__PURE__ */ w(P, { htmFor: f, children: /* @__PURE__ */ w(
|
|
502
|
+
"a",
|
|
503
|
+
{
|
|
504
|
+
css: {
|
|
505
|
+
color: e.palette.error.main
|
|
506
|
+
},
|
|
507
|
+
href: nt,
|
|
508
|
+
children: a
|
|
509
|
+
}
|
|
510
|
+
) }) : /* @__PURE__ */ w(P, { htmFor: f, children: o })
|
|
511
|
+
]
|
|
512
|
+
}
|
|
513
|
+
);
|
|
453
514
|
};
|
|
454
515
|
class G extends Error {
|
|
455
516
|
constructor(t, r, o) {
|
|
@@ -464,7 +525,8 @@ class ct {
|
|
|
464
525
|
var o;
|
|
465
526
|
try {
|
|
466
527
|
const a = await fetch(this.baseURL + t, r);
|
|
467
|
-
if (!a.ok &&
|
|
528
|
+
if (!a.ok && // Only throw an error if the response is not JSON and not a 400 error
|
|
529
|
+
a.status !== 400 && !((o = a.headers.get("content-type")) != null && o.includes("application/json")))
|
|
468
530
|
throw new G(a.status, a.statusText, a.url);
|
|
469
531
|
return this.responseHandler(a);
|
|
470
532
|
} catch (a) {
|
|
@@ -484,7 +546,8 @@ class ct {
|
|
|
484
546
|
...o,
|
|
485
547
|
headers: a
|
|
486
548
|
});
|
|
487
|
-
if (!s.ok &&
|
|
549
|
+
if (!s.ok && // Only throw an error if the response is not JSON and not a 400 error
|
|
550
|
+
s.status !== 400 && !((n = s.headers.get("content-type")) != null && n.includes("application/json")))
|
|
488
551
|
throw new G(s.status, s.statusText, s.url);
|
|
489
552
|
return this.responseHandler(s);
|
|
490
553
|
} catch (s) {
|
|
@@ -502,10 +565,7 @@ class ct {
|
|
|
502
565
|
return t instanceof G ? console.error("HTTP error:", t) : console.error("API request error:", t), Promise.reject(t);
|
|
503
566
|
}
|
|
504
567
|
}
|
|
505
|
-
var
|
|
506
|
-
(function(e) {
|
|
507
|
-
e.INSERT_MANY = "/v1/prosopo/user-access-policy/rules/insert-many", e.DELETE_MANY = "/v1/prosopo/user-access-policy/rules/delete-many", e.DELETE_ALL = "/v1/prosopo/user-access-policy/rules/delete-all";
|
|
508
|
-
})(I || (I = {}));
|
|
568
|
+
var N = /* @__PURE__ */ ((e) => (e.INSERT_MANY = "/v1/prosopo/user-access-policy/rules/insert-many", e.DELETE_MANY = "/v1/prosopo/user-access-policy/rules/delete-many", e.DELETE_ALL = "/v1/prosopo/user-access-policy/rules/delete-all", e))(N || {});
|
|
509
569
|
class lt extends ct {
|
|
510
570
|
constructor(t, r) {
|
|
511
571
|
const o = t.startsWith("http") ? t : `https://${t}`;
|
|
@@ -610,11 +670,15 @@ class lt extends ct {
|
|
|
610
670
|
});
|
|
611
671
|
}
|
|
612
672
|
submitUserEvents(t, r) {
|
|
613
|
-
return this.post(
|
|
614
|
-
|
|
615
|
-
|
|
673
|
+
return this.post(
|
|
674
|
+
x.SubmitUserEvents,
|
|
675
|
+
{ events: t, string: r },
|
|
676
|
+
{
|
|
677
|
+
headers: {
|
|
678
|
+
"Prosopo-Site-Key": this.account
|
|
679
|
+
}
|
|
616
680
|
}
|
|
617
|
-
|
|
681
|
+
);
|
|
618
682
|
}
|
|
619
683
|
getProviderStatus() {
|
|
620
684
|
return this.fetch(x.GetProviderStatus, {
|
|
@@ -655,25 +719,33 @@ class lt extends ct {
|
|
|
655
719
|
});
|
|
656
720
|
}
|
|
657
721
|
updateDetectorKey(t, r, o) {
|
|
658
|
-
return this.post(
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
722
|
+
return this.post(
|
|
723
|
+
B.UpdateDetectorKey,
|
|
724
|
+
te.parse({ detectorKey: t }),
|
|
725
|
+
{
|
|
726
|
+
headers: {
|
|
727
|
+
"Prosopo-Site-Key": this.account,
|
|
728
|
+
timestamp: r,
|
|
729
|
+
signature: o
|
|
730
|
+
}
|
|
663
731
|
}
|
|
664
|
-
|
|
732
|
+
);
|
|
665
733
|
}
|
|
666
734
|
removeDetectorKey(t, r, o) {
|
|
667
|
-
return this.post(
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
735
|
+
return this.post(
|
|
736
|
+
B.RemoveDetectorKey,
|
|
737
|
+
te.parse({ detectorKey: t }),
|
|
738
|
+
{
|
|
739
|
+
headers: {
|
|
740
|
+
"Prosopo-Site-Key": this.account,
|
|
741
|
+
timestamp: r,
|
|
742
|
+
signature: o
|
|
743
|
+
}
|
|
672
744
|
}
|
|
673
|
-
|
|
745
|
+
);
|
|
674
746
|
}
|
|
675
747
|
insertUserAccessPolicies(t, r, o) {
|
|
676
|
-
return this.post(
|
|
748
|
+
return this.post(N.INSERT_MANY, t, {
|
|
677
749
|
headers: {
|
|
678
750
|
"Prosopo-Site-Key": this.account,
|
|
679
751
|
timestamp: r,
|
|
@@ -682,7 +754,7 @@ class lt extends ct {
|
|
|
682
754
|
});
|
|
683
755
|
}
|
|
684
756
|
deleteUserAccessPolicies(t, r, o) {
|
|
685
|
-
return this.post(
|
|
757
|
+
return this.post(N.DELETE_MANY, t, {
|
|
686
758
|
headers: {
|
|
687
759
|
"Prosopo-Site-Key": this.account,
|
|
688
760
|
timestamp: r,
|
|
@@ -691,20 +763,41 @@ class lt extends ct {
|
|
|
691
763
|
});
|
|
692
764
|
}
|
|
693
765
|
deleteAllUserAccessPolicies(t, r) {
|
|
694
|
-
return this.post(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
766
|
+
return this.post(
|
|
767
|
+
N.DELETE_ALL,
|
|
768
|
+
{},
|
|
769
|
+
{
|
|
770
|
+
headers: {
|
|
771
|
+
"Prosopo-Site-Key": this.account,
|
|
772
|
+
timestamp: t,
|
|
773
|
+
signature: r
|
|
774
|
+
}
|
|
699
775
|
}
|
|
700
|
-
|
|
776
|
+
);
|
|
701
777
|
}
|
|
702
778
|
}
|
|
703
|
-
const ut = m.lazy(
|
|
779
|
+
const ut = m.lazy(
|
|
780
|
+
async () => import("./ProcaptchaWidget-48FxVPQd.js")
|
|
781
|
+
), ge = (e) => /* @__PURE__ */ w(m.Suspense, { children: /* @__PURE__ */ w(
|
|
782
|
+
ut,
|
|
783
|
+
{
|
|
784
|
+
config: e.config,
|
|
785
|
+
callbacks: e.callbacks,
|
|
786
|
+
frictionlessState: e.frictionlessState,
|
|
787
|
+
i18n: e.i18n
|
|
788
|
+
}
|
|
789
|
+
) }), dt = m.lazy(async () => import("./ProcaptchaWidget-B2BzhXLv.js")), ve = (e) => /* @__PURE__ */ w(m.Suspense, { children: /* @__PURE__ */ w(dt, { ...e }) }), pt = async () => (await import("./index-7Xh-Mf8v.js")).default, ft = async (e) => {
|
|
704
790
|
const r = await (await pt())(), a = await new (await De(e.web2))().getAccount(e);
|
|
705
791
|
if (!e.account.address)
|
|
706
792
|
throw new pe("GENERAL.SITE_KEY_MISSING");
|
|
707
|
-
const n = await Fe(e), u = await new lt(
|
|
793
|
+
const n = await Fe(e), u = await new lt(
|
|
794
|
+
n.provider.url,
|
|
795
|
+
e.account.address
|
|
796
|
+
).getFrictionlessCaptcha(
|
|
797
|
+
r.token,
|
|
798
|
+
e.account.address,
|
|
799
|
+
a.account.address
|
|
800
|
+
);
|
|
708
801
|
return {
|
|
709
802
|
captchaType: u.captchaType,
|
|
710
803
|
sessionId: u.sessionId,
|
|
@@ -715,52 +808,116 @@ const ut = m.lazy(async () => import("./ProcaptchaWidget-DlrcrISF.js")), ge = (e
|
|
|
715
808
|
};
|
|
716
809
|
}, se = (e, t, r, o, a, n) => {
|
|
717
810
|
const s = e === "light" ? Ne : Me;
|
|
718
|
-
return t === "invisible" ? null : v.jsx(
|
|
719
|
-
|
|
811
|
+
return t === "invisible" ? null : /* @__PURE__ */ v.jsx(
|
|
812
|
+
it,
|
|
813
|
+
{
|
|
814
|
+
theme: s,
|
|
815
|
+
onChange: async () => {
|
|
816
|
+
},
|
|
817
|
+
checked: !1,
|
|
818
|
+
labelText: o ? a("WIDGET.I_AM_HUMAN") : "",
|
|
819
|
+
error: r,
|
|
820
|
+
"aria-label": "human checkbox",
|
|
821
|
+
loading: n
|
|
822
|
+
}
|
|
823
|
+
);
|
|
720
824
|
}, ie = (e) => ({
|
|
721
825
|
loading: !1,
|
|
722
826
|
attemptCount: e || 0
|
|
723
|
-
}), ht = ({
|
|
827
|
+
}), ht = ({
|
|
828
|
+
config: e,
|
|
829
|
+
callbacks: t,
|
|
830
|
+
restart: r,
|
|
831
|
+
i18n: o,
|
|
832
|
+
detectBot: a = ft
|
|
833
|
+
}) => {
|
|
724
834
|
const n = m.useRef(ie(0)), s = M(t);
|
|
725
835
|
m.useEffect(() => {
|
|
726
836
|
e.language && (o ? o.language !== e.language && o.changeLanguage(e.language).then((h) => h) : Oe().then((h) => {
|
|
727
837
|
h.language !== e.language && h.changeLanguage(e.language).then((l) => l);
|
|
728
838
|
}));
|
|
729
839
|
}, [o, e.language]);
|
|
730
|
-
const [u, b] = m.useState(
|
|
731
|
-
|
|
840
|
+
const [u, b] = m.useState(
|
|
841
|
+
se(
|
|
842
|
+
e.theme,
|
|
843
|
+
e.mode,
|
|
844
|
+
n.current.errorMessage,
|
|
845
|
+
o.isInitialized,
|
|
846
|
+
o.t,
|
|
847
|
+
!0
|
|
848
|
+
)
|
|
849
|
+
), P = (h) => {
|
|
850
|
+
n.current = ie(
|
|
851
|
+
h || n.current.attemptCount
|
|
852
|
+
);
|
|
732
853
|
}, g = (h, l) => {
|
|
733
854
|
l === "CAPTCHA.NO_SESSION_FOUND" && setTimeout(() => {
|
|
734
855
|
f();
|
|
735
|
-
}, 0), b(
|
|
856
|
+
}, 0), b(
|
|
857
|
+
se(
|
|
858
|
+
e.theme,
|
|
859
|
+
e.mode,
|
|
860
|
+
h || "Cannot load CAPTCHA",
|
|
861
|
+
o.isInitialized,
|
|
862
|
+
o.t,
|
|
863
|
+
!1
|
|
864
|
+
)
|
|
865
|
+
);
|
|
736
866
|
}, f = () => {
|
|
737
867
|
setTimeout(() => {
|
|
738
868
|
P(0), s.onReset(), r();
|
|
739
869
|
}, 1e4);
|
|
740
870
|
}, T = async () => {
|
|
741
|
-
await $e(
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
871
|
+
await $e(
|
|
872
|
+
async () => {
|
|
873
|
+
var S, A, E, C, k;
|
|
874
|
+
n.current.attemptCount += 1;
|
|
875
|
+
const h = je.parse(e), l = await a(h);
|
|
876
|
+
if ((S = l.error) != null && S.message) {
|
|
877
|
+
n.current = {
|
|
878
|
+
...n.current,
|
|
879
|
+
loading: !1,
|
|
880
|
+
errorMessage: (A = l.error) == null ? void 0 : A.message
|
|
881
|
+
}, s.onError(new Error((E = l.error) == null ? void 0 : E.message)), g((C = l.error) == null ? void 0 : C.message, (k = l.error) == null ? void 0 : k.key);
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
const p = {
|
|
885
|
+
provider: l.provider,
|
|
886
|
+
sessionId: l.sessionId,
|
|
887
|
+
userAccount: l.userAccount,
|
|
888
|
+
restart: r
|
|
889
|
+
// Pass restart function
|
|
890
|
+
};
|
|
891
|
+
l.captchaType === "image" ? b(
|
|
892
|
+
/* @__PURE__ */ v.jsx(
|
|
893
|
+
ve,
|
|
894
|
+
{
|
|
895
|
+
config: e,
|
|
896
|
+
callbacks: t,
|
|
897
|
+
frictionlessState: p,
|
|
898
|
+
i18n: o
|
|
899
|
+
}
|
|
900
|
+
)
|
|
901
|
+
) : (b(
|
|
902
|
+
/* @__PURE__ */ v.jsx(
|
|
903
|
+
ge,
|
|
904
|
+
{
|
|
905
|
+
config: e,
|
|
906
|
+
callbacks: t,
|
|
907
|
+
frictionlessState: p,
|
|
908
|
+
i18n: o
|
|
909
|
+
}
|
|
910
|
+
)
|
|
911
|
+
), n.current = {
|
|
747
912
|
...n.current,
|
|
748
|
-
loading: !1
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
userAccount: l.userAccount,
|
|
757
|
-
restart: r
|
|
758
|
-
};
|
|
759
|
-
l.captchaType === "image" ? b(v.jsx(ve, { config: e, callbacks: t, frictionlessState: p, i18n: o })) : (b(v.jsx(ge, { config: e, callbacks: t, frictionlessState: p, i18n: o })), n.current = {
|
|
760
|
-
...n.current,
|
|
761
|
-
loading: !1
|
|
762
|
-
});
|
|
763
|
-
}, T, P, n.current.attemptCount, 5).finally(() => {
|
|
913
|
+
loading: !1
|
|
914
|
+
});
|
|
915
|
+
},
|
|
916
|
+
T,
|
|
917
|
+
P,
|
|
918
|
+
n.current.attemptCount,
|
|
919
|
+
5
|
|
920
|
+
).finally(() => {
|
|
764
921
|
n.current.attemptCount >= 5 && (g(), f());
|
|
765
922
|
});
|
|
766
923
|
};
|
|
@@ -781,13 +938,13 @@ const ut = m.lazy(async () => import("./ProcaptchaWidget-DlrcrISF.js")), ge = (e
|
|
|
781
938
|
const { config: t, callbacks: r, i18n: o } = e;
|
|
782
939
|
return v.jsx(ge, { config: t, callbacks: M(r), i18n: o });
|
|
783
940
|
}, vt = {
|
|
784
|
-
[
|
|
785
|
-
[
|
|
786
|
-
[
|
|
941
|
+
[_.image]: yt,
|
|
942
|
+
[_.pow]: gt,
|
|
943
|
+
[_.frictionless]: mt
|
|
787
944
|
};
|
|
788
945
|
class bt {
|
|
789
946
|
getCaptchaComponent(t, r) {
|
|
790
|
-
if (t ===
|
|
947
|
+
if (t === _.invisible)
|
|
791
948
|
throw new Error("Not Implemented");
|
|
792
949
|
const o = vt[t];
|
|
793
950
|
return "rendering ".concat(t), v.jsx(o, { config: r.config, callbacks: r.callbacks, i18n: r.i18n });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as d, j as C, C as v } from "./emotion-element-5486c51c.browser.esm-
|
|
2
|
-
import { r as f } from "./index-
|
|
3
|
-
import { P as A, b, L as i } from "./web2Chunk-
|
|
1
|
+
import { c as d, j as C, C as v } from "./emotion-element-5486c51c.browser.esm-D7qvHZDV.js";
|
|
2
|
+
import { r as f } from "./index-DyYmvHVN.js";
|
|
3
|
+
import { P as A, b, L as i } from "./web2Chunk-DCsWA5PR.js";
|
|
4
4
|
var l, R = f;
|
|
5
5
|
l = R.createRoot;
|
|
6
6
|
function y(o, e = "light", t, a = !0, c = !1, r) {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { z as L } from "./zodChunk-wTu9ZHzV.js";
|
|
2
|
-
import { b as y } from "./utilCryptoChunk-
|
|
3
|
-
const f = "info", m = "debug", d = "trace",
|
|
2
|
+
import { b as y } from "./utilCryptoChunk-qm-BM2eT.js";
|
|
3
|
+
const f = "info", m = "debug", d = "trace", v = "warn", b = "error", k = "fatal";
|
|
4
4
|
L.enum([
|
|
5
5
|
f,
|
|
6
6
|
m,
|
|
7
7
|
d,
|
|
8
|
-
|
|
8
|
+
v,
|
|
9
9
|
b,
|
|
10
|
-
|
|
10
|
+
k
|
|
11
11
|
]);
|
|
12
12
|
const x = {
|
|
13
13
|
[d]: 5,
|
|
14
14
|
[m]: 4,
|
|
15
15
|
[f]: 3,
|
|
16
|
-
[
|
|
16
|
+
[v]: 2,
|
|
17
17
|
[b]: 1,
|
|
18
|
-
[
|
|
18
|
+
[k]: 0
|
|
19
19
|
};
|
|
20
20
|
function P(a, t) {
|
|
21
21
|
const e = new E(t);
|
|
@@ -98,13 +98,13 @@ class E {
|
|
|
98
98
|
this.print(console.trace.bind(console), t, d);
|
|
99
99
|
}
|
|
100
100
|
warn(t) {
|
|
101
|
-
this.print(console.warn.bind(console), t,
|
|
101
|
+
this.print(console.warn.bind(console), t, v);
|
|
102
102
|
}
|
|
103
103
|
error(t) {
|
|
104
104
|
this.print(console.error.bind(console), t, b);
|
|
105
105
|
}
|
|
106
106
|
fatal(t) {
|
|
107
|
-
this.print(console.error.bind(console), t,
|
|
107
|
+
this.print(console.error.bind(console), t, k);
|
|
108
108
|
}
|
|
109
109
|
log(t, e) {
|
|
110
110
|
switch (t) {
|
|
@@ -146,10 +146,7 @@ class w extends Error {
|
|
|
146
146
|
t.debug(() => ({ data: { ...c, stack: this.stack } }));
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
t.
|
|
150
|
-
data: c,
|
|
151
|
-
stack: this.stack
|
|
152
|
-
}));
|
|
149
|
+
t.error(() => ({ data: { ...c } }));
|
|
153
150
|
}
|
|
154
151
|
}
|
|
155
152
|
class J extends w {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as Sr } from "./bnChunk-DRlDxTFg.js";
|
|
2
|
-
import { r as k, R as se } from "./web2Chunk-
|
|
2
|
+
import { r as k, R as se } from "./web2Chunk-DCsWA5PR.js";
|
|
3
3
|
var he = { exports: {} }, H = {};
|
|
4
4
|
var $e = k, _e = Symbol.for("react.element"), Ae = Symbol.for("react.fragment"), Re = Object.prototype.hasOwnProperty, Oe = $e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Pe = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
5
5
|
function le(e, r, t) {
|