@prosopo/procaptcha-bundle 3.0.13 → 3.1.6
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/tests/util/renderLogic.test.js +19 -9
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
- 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/captchaComponentProvider.js +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- 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/captchaRenderer.js +2 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +6 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -1
- package/CHANGELOG.md +347 -0
- package/dist/bundle/{ProcaptchaWidget-BIt2pcrz.js → ProcaptchaWidget-CJ-4hVS1.js} +24 -24
- package/dist/bundle/{ProcaptchaWidget-CXxnCzl2.js → ProcaptchaWidget-Cw3s7cGX.js} +290 -268
- package/dist/bundle/{builder-DNHtDoNG.js → builder-ByZ5z580.js} +3 -1
- package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +1002 -0
- package/dist/bundle/{captchaRenderer-CqnUYyKY.js → captchaRenderer-s4QuLEen.js} +23 -22
- package/dist/bundle/{commonChunk-BKceWhtS.js → commonChunk-BjvuHlB1.js} +62 -68
- package/dist/bundle/{emotion-element-5486c51c.browser.esm-CimrRZxS.js → emotion-element-c39617d8.browser.esm-BNNnmykm.js} +343 -345
- package/dist/bundle/index-BuQg3Zno.js +1884 -0
- package/dist/bundle/{index-KHTbPva_.js → index-DIdd2cUz.js} +1 -1
- package/dist/bundle/{index-hrOz2CPm.js → index-IgqrmVIs.js} +61 -59
- package/dist/bundle/nobleChunk-Bbltwf44.js +2728 -0
- package/dist/bundle/procaptcha.bundle.js +2 -2
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/dist/bundle/{utilCryptoChunk-BKe3CKqn.js → utilCryptoChunk-D6ZLkbFV.js} +252 -243
- package/dist/bundle/{web2Chunk-Cqw91v-J.js → web2Chunk-CNoojUDK.js} +1067 -977
- package/dist/bundle/web3Chunk-BlYvY4Ea.js +525 -0
- package/dist/bundle/{zodChunk-wTu9ZHzV.js → zodChunk-aEfPZzrp.js} +3 -3
- package/dist/cjs/util/captcha/captchaComponentProvider.cjs +3 -2
- package/dist/cjs/util/captcha/captchaRenderer.cjs +4 -3
- package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +4 -3
- package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
- package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
- package/dist/cjs/util/widgetFactory.cjs +7 -2
- package/dist/util/captcha/captchaComponentProvider.js +3 -2
- package/dist/util/captcha/captchaRenderer.js +4 -3
- package/dist/util/captcha/components/frictionlessCaptcha.js +4 -3
- package/dist/util/captcha/components/imageCaptcha.js +1 -1
- package/dist/util/captcha/components/powCaptcha.js +1 -1
- package/dist/util/widgetFactory.js +7 -2
- package/package.json +19 -20
- package/stats.html +1 -1
- package/vite.test.config.ts +3 -2
- package/dist/bundle/captchaComponentProvider-BGEAkC9Y.js +0 -968
- package/dist/bundle/index-7Xh-Mf8v.js +0 -1318
- package/dist/bundle/nobleChunk-CQ4ENyKh.js +0 -3769
- package/dist/bundle/web3Chunk-BcwDKvjL.js +0 -517
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { r as
|
|
3
|
-
import { P as
|
|
4
|
-
var l,
|
|
5
|
-
l =
|
|
6
|
-
function
|
|
7
|
-
return o || (o = ""),
|
|
8
|
-
defaultEnvironment:
|
|
1
|
+
import { c as C, j as v, C as f } from "./emotion-element-c39617d8.browser.esm-BNNnmykm.js";
|
|
2
|
+
import { r as A } from "./index-DIdd2cUz.js";
|
|
3
|
+
import { P as b, b as R, L as i } from "./web2Chunk-CNoojUDK.js";
|
|
4
|
+
var l, y = A;
|
|
5
|
+
l = y.createRoot;
|
|
6
|
+
function E(o, e = "light", t, a = !0, c = !1, r) {
|
|
7
|
+
return o || (o = ""), b.parse({
|
|
8
|
+
defaultEnvironment: R.parse("production"),
|
|
9
9
|
userAccountAddress: r || "",
|
|
10
10
|
account: {
|
|
11
11
|
address: o
|
|
@@ -19,38 +19,39 @@ function y(o, e = "light", t, a = !0, c = !1, r) {
|
|
|
19
19
|
language: t
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const x = (o, e, t) => {
|
|
23
23
|
const a = (o == null ? void 0 : o.language) || e.getAttribute("data-language");
|
|
24
|
-
a && (t.language =
|
|
25
|
-
},
|
|
24
|
+
a && (t.language = L(a));
|
|
25
|
+
}, L = (o) => {
|
|
26
26
|
try {
|
|
27
27
|
return i.parse(o);
|
|
28
28
|
} catch {
|
|
29
29
|
return console.error("Invalid language attribute: ".concat(o)), i.parse("en");
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, P = (o, e, t) => {
|
|
32
32
|
const a = (o == null ? void 0 : o["challenge-valid-length"]) || e.getAttribute("data-challenge-valid-length");
|
|
33
33
|
a && (t.captchas.image.solutionTimeout = Number.parseInt(a), t.captchas.pow.solutionTimeout = Number.parseInt(a));
|
|
34
34
|
};
|
|
35
|
-
class
|
|
35
|
+
class j {
|
|
36
36
|
constructor(e) {
|
|
37
37
|
this.captchaComponentProvider = e;
|
|
38
38
|
}
|
|
39
|
-
renderCaptcha(e, t, a, c, r, h, u
|
|
40
|
-
const
|
|
39
|
+
renderCaptcha(e, t, a, c, r, h, u, m) {
|
|
40
|
+
const g = (a == null ? void 0 : a.captchaType) || e.defaultCaptchaType, n = E(a.siteKey, a.theme, a.language, r, u, a.userAccountAddress);
|
|
41
41
|
this.readAndValidateSettings(t, n, a);
|
|
42
|
-
const s = this.createReactRoot(t, e.identifierPrefix),
|
|
42
|
+
const s = this.createReactRoot(t, e.identifierPrefix), p = this.makeEmotionCache(e.emotionCacheKey, t), d = this.captchaComponentProvider.getCaptchaComponent(g, {
|
|
43
43
|
config: n,
|
|
44
44
|
i18n: h,
|
|
45
|
-
callbacks: c
|
|
45
|
+
callbacks: c,
|
|
46
|
+
container: m
|
|
46
47
|
});
|
|
47
|
-
return this.renderCaptchaComponent(s,
|
|
48
|
+
return this.renderCaptchaComponent(s, p, d), s;
|
|
48
49
|
}
|
|
49
50
|
readAndValidateSettings(e, t, a) {
|
|
50
|
-
|
|
51
|
+
P(a, e, t), x(a, e, t);
|
|
51
52
|
}
|
|
52
53
|
makeEmotionCache(e, t) {
|
|
53
|
-
return
|
|
54
|
+
return C({
|
|
54
55
|
key: e,
|
|
55
56
|
prepend: !0,
|
|
56
57
|
container: t
|
|
@@ -62,9 +63,9 @@ class V {
|
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
renderCaptchaComponent(e, t, a) {
|
|
65
|
-
e.render(
|
|
66
|
+
e.render(v.jsx(f, { value: t, children: a }));
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
j as CaptchaRenderer
|
|
70
71
|
};
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { z as L } from "./zodChunk-
|
|
2
|
-
|
|
3
|
-
const f = "info", m = "debug", d = "trace", v = "warn", b = "error", k = "fatal";
|
|
1
|
+
import { z as L } from "./zodChunk-aEfPZzrp.js";
|
|
2
|
+
const h = "info", d = "debug", m = "trace", b = "warn", k = "error", w = "fatal";
|
|
4
3
|
L.enum([
|
|
5
|
-
|
|
6
|
-
m,
|
|
4
|
+
h,
|
|
7
5
|
d,
|
|
8
|
-
|
|
6
|
+
m,
|
|
9
7
|
b,
|
|
10
|
-
k
|
|
8
|
+
k,
|
|
9
|
+
w
|
|
11
10
|
]);
|
|
12
|
-
const
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
11
|
+
const P = {
|
|
12
|
+
[m]: 5,
|
|
13
|
+
[d]: 4,
|
|
14
|
+
[h]: 3,
|
|
15
|
+
[b]: 2,
|
|
16
|
+
[k]: 1,
|
|
17
|
+
[w]: 0
|
|
19
18
|
};
|
|
20
|
-
function
|
|
19
|
+
function S(s, t) {
|
|
21
20
|
const e = new E(t);
|
|
22
|
-
return e.setLogLevel(
|
|
21
|
+
return e.setLogLevel(s), e;
|
|
23
22
|
}
|
|
24
|
-
const
|
|
25
|
-
L.enum([g,
|
|
23
|
+
const D = typeof window < "u" && typeof window.document < "u", g = "json", M = "plain";
|
|
24
|
+
L.enum([g, M]);
|
|
26
25
|
class E {
|
|
27
|
-
constructor(t, e =
|
|
28
|
-
this.scope = t, this.levelMap = e, this.pretty = 0, this.printStack = !1, this.format = g, this.level =
|
|
26
|
+
constructor(t, e = P) {
|
|
27
|
+
this.scope = t, this.levelMap = e, this.pretty = 0, this.printStack = !1, this.format = g, this.level = h, this.levelNum = this.levelMap[this.level];
|
|
29
28
|
}
|
|
30
29
|
setFormat(t) {
|
|
31
30
|
if (this.format = t, this.format !== g)
|
|
@@ -62,49 +61,49 @@ class E {
|
|
|
62
61
|
unpackError(t) {
|
|
63
62
|
const e = t, r = { ...t };
|
|
64
63
|
r.name = e.name || "Error", this.printStack && (e.stack && (r.stack = e.stack), e.stacktrace && (r.stacktrace = e.stacktrace)), e.cause && (r.cause = e.cause), e.code && (r.code = e.code), e.details && (r.details = e.details), e.context && (r.context = e.context), e.data && (r.data = e.data), e.info && (r.info = e.info), e.metadata && (r.metadata = e.metadata), e.status && (r.status = e.status), e.statusCode && (r.statusCode = e.statusCode), e.cause && (e.cause instanceof Error ? r.cause = this.unpackError(e.cause) : r.cause = e.cause);
|
|
65
|
-
const
|
|
64
|
+
const a = e.message || e.msg || "";
|
|
66
65
|
return e.message && e.msg && (r.msg = e.msg), {
|
|
67
|
-
msg:
|
|
66
|
+
msg: a,
|
|
68
67
|
data: r
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
70
|
print(t, e, r) {
|
|
72
71
|
if (this.levelMap[r] > this.levelNum)
|
|
73
72
|
return;
|
|
74
|
-
const
|
|
75
|
-
let { data: c, msg: i, err:
|
|
76
|
-
if (
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
|
|
73
|
+
const a = (/* @__PURE__ */ new Date()).toISOString();
|
|
74
|
+
let { data: c, msg: i, err: l } = e(), o, u;
|
|
75
|
+
if (l)
|
|
76
|
+
if (l instanceof Error || typeof l == "object") {
|
|
77
|
+
const f = this.unpackError(l);
|
|
78
|
+
o = f.msg, u = f.data;
|
|
80
79
|
} else
|
|
81
|
-
|
|
80
|
+
o = String(l);
|
|
82
81
|
this.defaultData && (c = { ...this.defaultData, ...c });
|
|
83
|
-
const n = { scope: this.scope, ts:
|
|
84
|
-
if (c && (n.data = c), i && (n.msg = i),
|
|
85
|
-
i ||
|
|
82
|
+
const n = { scope: this.scope, ts: a, level: this.level };
|
|
83
|
+
if (c && (n.data = c), i && (n.msg = i), o && (n.err = o), u && (n.errData = u), D)
|
|
84
|
+
i || o ? t(i || o, n) : t(n);
|
|
86
85
|
else {
|
|
87
|
-
const
|
|
88
|
-
t(
|
|
86
|
+
const f = v(n), x = JSON.stringify(f, null, this.pretty);
|
|
87
|
+
t(x);
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
info(t) {
|
|
92
|
-
this.print(console.info.bind(console), t,
|
|
91
|
+
this.print(console.info.bind(console), t, h);
|
|
93
92
|
}
|
|
94
93
|
debug(t) {
|
|
95
|
-
this.print(console.debug.bind(console), t,
|
|
94
|
+
this.print(console.debug.bind(console), t, d);
|
|
96
95
|
}
|
|
97
96
|
trace(t) {
|
|
98
|
-
this.print(console.trace.bind(console), t,
|
|
97
|
+
this.print(console.trace.bind(console), t, m);
|
|
99
98
|
}
|
|
100
99
|
warn(t) {
|
|
101
|
-
this.print(console.warn.bind(console), t,
|
|
100
|
+
this.print(console.warn.bind(console), t, b);
|
|
102
101
|
}
|
|
103
102
|
error(t) {
|
|
104
|
-
this.print(console.error.bind(console), t,
|
|
103
|
+
this.print(console.error.bind(console), t, k);
|
|
105
104
|
}
|
|
106
105
|
fatal(t) {
|
|
107
|
-
this.print(console.error.bind(console), t,
|
|
106
|
+
this.print(console.error.bind(console), t, w);
|
|
108
107
|
}
|
|
109
108
|
log(t, e) {
|
|
110
109
|
switch (t) {
|
|
@@ -131,17 +130,24 @@ class E {
|
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
|
-
const
|
|
135
|
-
|
|
133
|
+
const v = (s) => {
|
|
134
|
+
if (typeof s == "bigint")
|
|
135
|
+
return s.toString();
|
|
136
|
+
if (N(s))
|
|
137
|
+
for (const t of Object.keys(s))
|
|
138
|
+
s[t] = v(s[t]);
|
|
139
|
+
return s;
|
|
140
|
+
}, N = (s) => Object === (s == null ? void 0 : s.constructor), O = { t: (s) => s };
|
|
141
|
+
class y extends Error {
|
|
136
142
|
constructor(t, e) {
|
|
137
|
-
const r = (e == null ? void 0 : e.logger) ||
|
|
143
|
+
const r = (e == null ? void 0 : e.logger) || S("info", import.meta.url), a = (e == null ? void 0 : e.logLevel) || "error", c = (e == null ? void 0 : e.i18n) || O;
|
|
138
144
|
t instanceof Error ? (super(c.t(t.message)), this.translationKey = e == null ? void 0 : e.translationKey, this.context = {
|
|
139
145
|
...e == null ? void 0 : e.context,
|
|
140
146
|
...e != null && e.translationKey ? { translationMessage: c.t(e.translationKey) } : {}
|
|
141
|
-
}) : (super(c.t(t)), this.translationKey = t, this.context = e == null ? void 0 : e.context), e != null && e.silent || this.logError(r,
|
|
147
|
+
}) : (super(c.t(t)), this.translationKey = t, this.context = e == null ? void 0 : e.context), e != null && e.silent || this.logError(r, a, e == null ? void 0 : e.name);
|
|
142
148
|
}
|
|
143
149
|
logError(t, e, r) {
|
|
144
|
-
const
|
|
150
|
+
const a = { error: this.message, context: this.context }, c = { errorType: r || this.name, errorParams: a };
|
|
145
151
|
if (e === "debug") {
|
|
146
152
|
t.debug(() => ({ data: { ...c, stack: this.stack } }));
|
|
147
153
|
return;
|
|
@@ -149,38 +155,26 @@ class w extends Error {
|
|
|
149
155
|
t.error(() => ({ data: { ...c } }));
|
|
150
156
|
}
|
|
151
157
|
}
|
|
152
|
-
class
|
|
158
|
+
class F extends y {
|
|
153
159
|
constructor(t, e) {
|
|
154
|
-
const r = (e == null ? void 0 : e.name) || "ProsopoError",
|
|
155
|
-
super(t,
|
|
160
|
+
const r = (e == null ? void 0 : e.name) || "ProsopoError", a = { ...e, name: r };
|
|
161
|
+
super(t, a);
|
|
156
162
|
}
|
|
157
163
|
}
|
|
158
|
-
class K extends
|
|
164
|
+
class K extends y {
|
|
159
165
|
constructor(t, e) {
|
|
160
|
-
const r = (e == null ? void 0 : e.name) || "ProsopoEnvError",
|
|
161
|
-
super(t,
|
|
166
|
+
const r = (e == null ? void 0 : e.name) || "ProsopoEnvError", a = { ...e, name: r };
|
|
167
|
+
super(t, a);
|
|
162
168
|
}
|
|
163
169
|
}
|
|
164
|
-
class
|
|
170
|
+
class A extends y {
|
|
165
171
|
constructor(t, e) {
|
|
166
|
-
const r = (e == null ? void 0 : e.name) || "ProsopoDatasetError",
|
|
167
|
-
super(t,
|
|
172
|
+
const r = (e == null ? void 0 : e.name) || "ProsopoDatasetError", a = { ...e, name: r };
|
|
173
|
+
super(t, a);
|
|
168
174
|
}
|
|
169
175
|
}
|
|
170
|
-
const M = "";
|
|
171
|
-
function A(a, t) {
|
|
172
|
-
return a.join(M);
|
|
173
|
-
}
|
|
174
|
-
function O(a, t) {
|
|
175
|
-
return y(a, t);
|
|
176
|
-
}
|
|
177
|
-
function C(a) {
|
|
178
|
-
return O(A(a));
|
|
179
|
-
}
|
|
180
176
|
export {
|
|
181
|
-
|
|
177
|
+
F as P,
|
|
182
178
|
K as a,
|
|
183
|
-
|
|
184
|
-
C as c,
|
|
185
|
-
O as h
|
|
179
|
+
A as b
|
|
186
180
|
};
|