@prosopo/procaptcha-bundle 3.0.8 → 3.0.10
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/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +1 -0
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -0
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -0
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts +2 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +1 -1
- 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-Dw6ydLe3.js → captchaComponentProvider-B7Vxx339.js} +266 -100
- 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-DqwVRCwA.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/util/captcha/captchaComponentProvider.d.ts +1 -0
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -0
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -0
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaType.d.ts +2 -1
- package/dist/bundle/util/captcha/captchaType.d.ts.map +1 -1
- 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-BpzncYOb.js +0 -612
- package/dist/bundle/ProcaptchaWidget-D961oZ27.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-Dw6ydLe3.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
|
|
6
|
-
const re = (e) => Object.values(e),
|
|
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
|
+
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), Fe = async (e) => {
|
|
|
27
33
|
context: { environment: e }
|
|
28
34
|
});
|
|
29
35
|
};
|
|
30
|
-
let
|
|
31
|
-
const
|
|
36
|
+
let R = [];
|
|
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: {
|
|
@@ -39,18 +48,20 @@ const $e = async (e) => {
|
|
|
39
48
|
datasetId: r.datasetId
|
|
40
49
|
}
|
|
41
50
|
};
|
|
42
|
-
},
|
|
51
|
+
}, $e = async (e, t, r, o, a) => {
|
|
43
52
|
try {
|
|
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++) {
|
|
@@ -61,7 +72,7 @@ function V() {
|
|
|
61
72
|
}, V.apply(null, arguments);
|
|
62
73
|
}
|
|
63
74
|
var fe = { exports: {} }, c = {};
|
|
64
|
-
var d = typeof Symbol == "function" && Symbol.for, X = d ? Symbol.for("react.element") : 60103, J = d ? Symbol.for("react.portal") : 60106,
|
|
75
|
+
var d = typeof Symbol == "function" && Symbol.for, X = d ? Symbol.for("react.element") : 60103, J = d ? Symbol.for("react.portal") : 60106, L = d ? Symbol.for("react.fragment") : 60107, F = d ? Symbol.for("react.strict_mode") : 60108, $ = d ? Symbol.for("react.profiler") : 60114, D = d ? Symbol.for("react.provider") : 60109, z = d ? Symbol.for("react.context") : 60110, Z = d ? Symbol.for("react.async_mode") : 60111, U = d ? Symbol.for("react.concurrent_mode") : 60111, H = d ? Symbol.for("react.forward_ref") : 60112, K = d ? Symbol.for("react.suspense") : 60113, ze = d ? Symbol.for("react.suspense_list") : 60120, W = d ? Symbol.for("react.memo") : 60115, q = d ? Symbol.for("react.lazy") : 60116, Ue = d ? Symbol.for("react.block") : 60121, He = d ? Symbol.for("react.fundamental") : 60117, Ke = d ? Symbol.for("react.responder") : 60118, We = d ? Symbol.for("react.scope") : 60119;
|
|
65
76
|
function y(e) {
|
|
66
77
|
if (typeof e == "object" && e !== null) {
|
|
67
78
|
var t = e.$$typeof;
|
|
@@ -69,16 +80,16 @@ function y(e) {
|
|
|
69
80
|
case X:
|
|
70
81
|
switch (e = e.type, e) {
|
|
71
82
|
case Z:
|
|
72
|
-
case
|
|
73
|
-
case F:
|
|
83
|
+
case U:
|
|
74
84
|
case L:
|
|
75
85
|
case $:
|
|
86
|
+
case F:
|
|
76
87
|
case K:
|
|
77
88
|
return e;
|
|
78
89
|
default:
|
|
79
90
|
switch (e = e && e.$$typeof, e) {
|
|
80
91
|
case z:
|
|
81
|
-
case
|
|
92
|
+
case H:
|
|
82
93
|
case q:
|
|
83
94
|
case W:
|
|
84
95
|
case D:
|
|
@@ -93,20 +104,20 @@ function y(e) {
|
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
106
|
function he(e) {
|
|
96
|
-
return y(e) ===
|
|
107
|
+
return y(e) === U;
|
|
97
108
|
}
|
|
98
109
|
c.AsyncMode = Z;
|
|
99
|
-
c.ConcurrentMode =
|
|
110
|
+
c.ConcurrentMode = U;
|
|
100
111
|
c.ContextConsumer = z;
|
|
101
112
|
c.ContextProvider = D;
|
|
102
113
|
c.Element = X;
|
|
103
|
-
c.ForwardRef =
|
|
104
|
-
c.Fragment =
|
|
114
|
+
c.ForwardRef = H;
|
|
115
|
+
c.Fragment = L;
|
|
105
116
|
c.Lazy = q;
|
|
106
117
|
c.Memo = W;
|
|
107
118
|
c.Portal = J;
|
|
108
|
-
c.Profiler =
|
|
109
|
-
c.StrictMode =
|
|
119
|
+
c.Profiler = $;
|
|
120
|
+
c.StrictMode = F;
|
|
110
121
|
c.Suspense = K;
|
|
111
122
|
c.isAsyncMode = function(e) {
|
|
112
123
|
return he(e) || y(e) === Z;
|
|
@@ -122,10 +133,10 @@ c.isElement = function(e) {
|
|
|
122
133
|
return typeof e == "object" && e !== null && e.$$typeof === X;
|
|
123
134
|
};
|
|
124
135
|
c.isForwardRef = function(e) {
|
|
125
|
-
return y(e) ===
|
|
136
|
+
return y(e) === H;
|
|
126
137
|
};
|
|
127
138
|
c.isFragment = function(e) {
|
|
128
|
-
return y(e) ===
|
|
139
|
+
return y(e) === L;
|
|
129
140
|
};
|
|
130
141
|
c.isLazy = function(e) {
|
|
131
142
|
return y(e) === q;
|
|
@@ -137,16 +148,16 @@ c.isPortal = function(e) {
|
|
|
137
148
|
return y(e) === J;
|
|
138
149
|
};
|
|
139
150
|
c.isProfiler = function(e) {
|
|
140
|
-
return y(e) ===
|
|
151
|
+
return y(e) === $;
|
|
141
152
|
};
|
|
142
153
|
c.isStrictMode = function(e) {
|
|
143
|
-
return y(e) ===
|
|
154
|
+
return y(e) === F;
|
|
144
155
|
};
|
|
145
156
|
c.isSuspense = function(e) {
|
|
146
157
|
return y(e) === K;
|
|
147
158
|
};
|
|
148
159
|
c.isValidElementType = function(e) {
|
|
149
|
-
return typeof e == "string" || typeof e == "function" || e ===
|
|
160
|
+
return typeof e == "string" || typeof e == "function" || e === L || e === U || e === $ || e === F || e === K || e === ze || typeof e == "object" && e !== null && (e.$$typeof === q || e.$$typeof === W || e.$$typeof === D || e.$$typeof === z || e.$$typeof === H || e.$$typeof === He || e.$$typeof === Ke || e.$$typeof === We || e.$$typeof === Ue);
|
|
150
161
|
};
|
|
151
162
|
c.typeOf = y;
|
|
152
163
|
fe.exports = c;
|
|
@@ -230,8 +241,8 @@ var Xe = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|def
|
|
|
230
241
|
var ee = de(f.concat(k), S.registered, I);
|
|
231
242
|
C += S.key + "-" + ee.name, s !== void 0 && (C += " " + s);
|
|
232
243
|
var be = P && u === void 0 ? oe(E) : b, O = {};
|
|
233
|
-
for (var
|
|
234
|
-
P &&
|
|
244
|
+
for (var j in p)
|
|
245
|
+
P && j === "as" || be(j) && (O[j] = p[j]);
|
|
235
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,
|
|
@@ -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 N;
|
|
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
|
-
})(N || (N = {}));
|
|
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,22 +719,30 @@ 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
748
|
return this.post(N.INSERT_MANY, t, {
|
|
@@ -690,12 +762,42 @@ class lt extends ct {
|
|
|
690
762
|
}
|
|
691
763
|
});
|
|
692
764
|
}
|
|
765
|
+
deleteAllUserAccessPolicies(t, r) {
|
|
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
|
+
}
|
|
775
|
+
}
|
|
776
|
+
);
|
|
777
|
+
}
|
|
693
778
|
}
|
|
694
|
-
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) => {
|
|
695
790
|
const r = await (await pt())(), a = await new (await De(e.web2))().getAccount(e);
|
|
696
791
|
if (!e.account.address)
|
|
697
792
|
throw new pe("GENERAL.SITE_KEY_MISSING");
|
|
698
|
-
const n = await
|
|
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
|
+
);
|
|
699
801
|
return {
|
|
700
802
|
captchaType: u.captchaType,
|
|
701
803
|
sessionId: u.sessionId,
|
|
@@ -706,52 +808,116 @@ const ut = m.lazy(async () => import("./ProcaptchaWidget-D961oZ27.js")), ge = (e
|
|
|
706
808
|
};
|
|
707
809
|
}, se = (e, t, r, o, a, n) => {
|
|
708
810
|
const s = e === "light" ? Ne : Me;
|
|
709
|
-
return t === "invisible" ? null : v.jsx(
|
|
710
|
-
|
|
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
|
+
);
|
|
711
824
|
}, ie = (e) => ({
|
|
712
825
|
loading: !1,
|
|
713
826
|
attemptCount: e || 0
|
|
714
|
-
}), ht = ({
|
|
827
|
+
}), ht = ({
|
|
828
|
+
config: e,
|
|
829
|
+
callbacks: t,
|
|
830
|
+
restart: r,
|
|
831
|
+
i18n: o,
|
|
832
|
+
detectBot: a = ft
|
|
833
|
+
}) => {
|
|
715
834
|
const n = m.useRef(ie(0)), s = M(t);
|
|
716
835
|
m.useEffect(() => {
|
|
717
836
|
e.language && (o ? o.language !== e.language && o.changeLanguage(e.language).then((h) => h) : Oe().then((h) => {
|
|
718
837
|
h.language !== e.language && h.changeLanguage(e.language).then((l) => l);
|
|
719
838
|
}));
|
|
720
839
|
}, [o, e.language]);
|
|
721
|
-
const [u, b] = m.useState(
|
|
722
|
-
|
|
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
|
+
);
|
|
723
853
|
}, g = (h, l) => {
|
|
724
854
|
l === "CAPTCHA.NO_SESSION_FOUND" && setTimeout(() => {
|
|
725
855
|
f();
|
|
726
|
-
}, 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
|
+
);
|
|
727
866
|
}, f = () => {
|
|
728
867
|
setTimeout(() => {
|
|
729
868
|
P(0), s.onReset(), r();
|
|
730
869
|
}, 1e4);
|
|
731
870
|
}, T = async () => {
|
|
732
|
-
await
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
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 = {
|
|
738
912
|
...n.current,
|
|
739
|
-
loading: !1
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
userAccount: l.userAccount,
|
|
748
|
-
restart: r
|
|
749
|
-
};
|
|
750
|
-
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 = {
|
|
751
|
-
...n.current,
|
|
752
|
-
loading: !1
|
|
753
|
-
});
|
|
754
|
-
}, T, P, n.current.attemptCount, 5).finally(() => {
|
|
913
|
+
loading: !1
|
|
914
|
+
});
|
|
915
|
+
},
|
|
916
|
+
T,
|
|
917
|
+
P,
|
|
918
|
+
n.current.attemptCount,
|
|
919
|
+
5
|
|
920
|
+
).finally(() => {
|
|
755
921
|
n.current.attemptCount >= 5 && (g(), f());
|
|
756
922
|
});
|
|
757
923
|
};
|
|
@@ -793,10 +959,10 @@ export {
|
|
|
793
959
|
De as E,
|
|
794
960
|
lt as P,
|
|
795
961
|
Ve as a,
|
|
796
|
-
|
|
962
|
+
Fe as b,
|
|
797
963
|
Ye as c,
|
|
798
964
|
kt as d,
|
|
799
965
|
M as g,
|
|
800
966
|
w as j,
|
|
801
|
-
|
|
967
|
+
$e as p
|
|
802
968
|
};
|
|
@@ -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) {
|