@prosopo/procaptcha-bundle 2.6.11 → 3.0.5

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.
Files changed (117) hide show
  1. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
  2. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js +3 -2
  3. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -1
  4. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  5. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +4 -0
  6. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
  7. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -1
  8. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
  9. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  10. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +1 -1
  11. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
  12. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +1 -1
  13. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +1 -1
  14. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +2 -2
  15. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +1 -1
  16. package/CHANGELOG.md +142 -0
  17. package/dist/bundle/ProcaptchaWidget-BpzncYOb.js +612 -0
  18. package/dist/bundle/ProcaptchaWidget-D961oZ27.js +148 -0
  19. package/dist/bundle/bnChunk-DRlDxTFg.js +1137 -0
  20. package/dist/bundle/{browser-ponyfill-Bctlk3uB.js → browser-ponyfill-CvzSbL_o.js} +31 -30
  21. package/dist/bundle/builder-CQlqPNRd.js +37 -0
  22. package/dist/bundle/captchaComponentProvider-Dw6ydLe3.js +802 -0
  23. package/dist/bundle/{captchaRenderer-BAMErqQN.js → captchaRenderer-CY8KuZK-.js} +22 -22
  24. package/dist/bundle/commonChunk-24zMb_mF.js +189 -0
  25. package/dist/bundle/emotion-element-5486c51c.browser.esm-PRDDgd_k.js +918 -0
  26. package/dist/bundle/{fp.esm-DYWeNGcH.js → fp.esm-BADUiinQ.js} +548 -648
  27. package/dist/bundle/index-BRg_gWPo.js +1328 -0
  28. package/dist/bundle/{index-ByKGlSkE.js → index-BzOMq-ud.js} +2 -2
  29. package/dist/bundle/{index-1qH2dz7u.js → index-DqwVRCwA.js} +166 -199
  30. package/dist/bundle/index.d.ts.map +1 -1
  31. package/dist/bundle/locales/ar/translation.json +4 -3
  32. package/dist/bundle/locales/az/translation.json +4 -3
  33. package/dist/bundle/locales/cs/translation.json +4 -3
  34. package/dist/bundle/locales/de/translation.json +4 -3
  35. package/dist/bundle/locales/el/translation.json +4 -3
  36. package/dist/bundle/locales/en/translation.json +4 -3
  37. package/dist/bundle/locales/es/translation.json +4 -3
  38. package/dist/bundle/locales/fi/translation.json +4 -3
  39. package/dist/bundle/locales/fr/translation.json +4 -3
  40. package/dist/bundle/locales/hi/translation.json +4 -3
  41. package/dist/bundle/locales/hu/translation.json +4 -3
  42. package/dist/bundle/locales/id/translation.json +4 -3
  43. package/dist/bundle/locales/it/translation.json +4 -3
  44. package/dist/bundle/locales/ja/translation.json +4 -3
  45. package/dist/bundle/locales/jv/translation.json +4 -3
  46. package/dist/bundle/locales/ko/translation.json +4 -3
  47. package/dist/bundle/locales/ml/translation.json +4 -3
  48. package/dist/bundle/locales/ms/translation.json +4 -3
  49. package/dist/bundle/locales/nl/translation.json +4 -3
  50. package/dist/bundle/locales/no/translation.json +4 -3
  51. package/dist/bundle/locales/pl/translation.json +4 -3
  52. package/dist/bundle/locales/pt/translation.json +4 -3
  53. package/dist/bundle/locales/{pt-br → pt-BR}/translation.json +4 -3
  54. package/dist/bundle/locales/ro/translation.json +4 -3
  55. package/dist/bundle/locales/ru/translation.json +4 -3
  56. package/dist/bundle/locales/sr/translation.json +4 -3
  57. package/dist/bundle/locales/sv/translation.json +4 -3
  58. package/dist/bundle/locales/th/translation.json +4 -3
  59. package/dist/bundle/locales/tr/translation.json +4 -3
  60. package/dist/bundle/locales/uk/translation.json +4 -3
  61. package/dist/bundle/locales/vi/translation.json +4 -3
  62. package/dist/bundle/locales/{zh-cn → zh-CN}/translation.json +4 -3
  63. package/dist/bundle/nobleChunk-Xl5XLrx3.js +3635 -0
  64. package/dist/bundle/procaptcha.bundle.js +6 -5
  65. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  66. package/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -1
  67. package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
  68. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  69. package/dist/bundle/util/configCreator.d.ts +1 -1
  70. package/dist/bundle/util/configCreator.d.ts.map +1 -1
  71. package/dist/bundle/utilChunk-sqstc6C5.js +317 -0
  72. package/dist/bundle/utilCryptoChunk-CIPUtfoO.js +1256 -0
  73. package/dist/bundle/web2Chunk-7Vd8yt2r.js +3711 -0
  74. package/dist/bundle/{hash-CrwduMDb.js → web3Chunk-DrUvbVNW.js} +257 -695
  75. package/dist/bundle/{translations-DEL070wJ.js → zodChunk-wTu9ZHzV.js} +46 -82
  76. package/dist/cjs/index.cjs +8 -2
  77. package/dist/cjs/util/captcha/captchaComponentProvider.cjs +4 -0
  78. package/dist/cjs/util/captcha/captchaRenderer.cjs +2 -1
  79. package/dist/cjs/util/configCreator.cjs +2 -2
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +3 -2
  82. package/dist/index.js.map +1 -1
  83. package/dist/util/captcha/captchaComponentProvider.d.ts +1 -1
  84. package/dist/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  85. package/dist/util/captcha/captchaComponentProvider.js +4 -0
  86. package/dist/util/captcha/captchaComponentProvider.js.map +1 -1
  87. package/dist/util/captcha/captchaComponentsList.d.ts +1 -1
  88. package/dist/util/captcha/captchaComponentsList.d.ts.map +1 -1
  89. package/dist/util/captcha/captchaRenderer.d.ts.map +1 -1
  90. package/dist/util/captcha/captchaRenderer.js +1 -1
  91. package/dist/util/captcha/captchaRenderer.js.map +1 -1
  92. package/dist/util/configCreator.d.ts +1 -1
  93. package/dist/util/configCreator.d.ts.map +1 -1
  94. package/dist/util/configCreator.js +2 -2
  95. package/dist/util/configCreator.js.map +1 -1
  96. package/package.json +21 -14
  97. package/stats.html +1 -1
  98. package/vite.config.ts +47 -4
  99. package/vite.serve.config.ts +2 -0
  100. package/vite.test.config.ts +1 -1
  101. package/webpack.config.cjs +5 -0
  102. package/dist/bundle/ProcaptchaWidget-DPyDGPiI.js +0 -156
  103. package/dist/bundle/ProcaptchaWidget-DoqUlwHS.js +0 -636
  104. package/dist/bundle/_commonjsHelpers-DaMA6jEr.js +0 -8
  105. package/dist/bundle/asU8a-BixKX-w0.js +0 -9
  106. package/dist/bundle/bip39-D7YSihxf.js +0 -260
  107. package/dist/bundle/captchaComponentProvider-BL18T1UE.js +0 -1242
  108. package/dist/bundle/emotion-element-5486c51c.browser.esm-Bjt1gs1F.js +0 -1807
  109. package/dist/bundle/i18nFrontend-DCv3P9jv.js +0 -2273
  110. package/dist/bundle/index-BeN3et18.js +0 -4844
  111. package/dist/bundle/index-BjRdPnnE.js +0 -1198
  112. package/dist/bundle/index-CBquknc2.js +0 -81
  113. package/dist/bundle/index-QVME9Prx.js +0 -32
  114. package/dist/bundle/sha256-CGE_4eEY.js +0 -171
  115. package/dist/bundle/spread-DEmVz7RJ.js +0 -15
  116. package/dist/bundle/toU8a-CPMbkkSw.js +0 -109
  117. package/dist/bundle/useTranslation-BJsfZyOx.js +0 -158
@@ -1,12 +1,12 @@
1
- import { P as d, E as C, c as v, j as f, C as R } from "./emotion-element-5486c51c.browser.esm-Bjt1gs1F.js";
2
- import { r as b } from "./index-ByKGlSkE.js";
3
- import { L as i } from "./translations-DEL070wJ.js";
4
- var s, A = b;
5
- s = A.createRoot;
6
- function E(o, e = "light", t, a = !0, r = !1) {
7
- return o || (o = ""), d.parse({
8
- defaultEnvironment: C.parse("production"),
9
- userAccountAddress: "",
1
+ import { c as d, j as C, C as v } from "./emotion-element-5486c51c.browser.esm-PRDDgd_k.js";
2
+ import { r as f } from "./index-BzOMq-ud.js";
3
+ import { P as A, b, L as i } from "./web2Chunk-7Vd8yt2r.js";
4
+ var l, R = f;
5
+ l = R.createRoot;
6
+ function y(o, e = "light", t, a = !0, c = !1, r) {
7
+ return o || (o = ""), A.parse({
8
+ defaultEnvironment: b.parse("production"),
9
+ userAccountAddress: r || "",
10
10
  account: {
11
11
  address: o
12
12
  },
@@ -14,12 +14,12 @@ function E(o, e = "light", t, a = !0, r = !1) {
14
14
  mongoAtlasUri: "",
15
15
  devOnlyWatchEvents: !1,
16
16
  web2: a,
17
- mode: r ? "invisible" : "visible",
17
+ mode: c ? "invisible" : "visible",
18
18
  theme: e,
19
19
  language: t
20
20
  });
21
21
  }
22
- const y = (o, e, t) => {
22
+ const E = (o, e, t) => {
23
23
  const a = (o == null ? void 0 : o.language) || e.getAttribute("data-language");
24
24
  a && (t.language = x(a));
25
25
  }, x = (o) => {
@@ -36,33 +36,33 @@ class V {
36
36
  constructor(e) {
37
37
  this.captchaComponentProvider = e;
38
38
  }
39
- renderCaptcha(e, t, a, r, l, h, u = !1) {
40
- const m = (a == null ? void 0 : a.captchaType) || e.defaultCaptchaType, c = E(a.siteKey, a.theme, a.language, l, u);
41
- this.readAndValidateSettings(t, c, a);
42
- const n = this.createReactRoot(t, e.identifierPrefix), p = this.makeEmotionCache(e.emotionCacheKey, t), g = this.captchaComponentProvider.getCaptchaComponent(m, {
43
- config: c,
39
+ renderCaptcha(e, t, a, c, r, h, u = !1) {
40
+ const m = (a == null ? void 0 : a.captchaType) || e.defaultCaptchaType, n = y(a.siteKey, a.theme, a.language, r, u, a.userAccountAddress);
41
+ this.readAndValidateSettings(t, n, a);
42
+ const s = this.createReactRoot(t, e.identifierPrefix), g = this.makeEmotionCache(e.emotionCacheKey, t), p = this.captchaComponentProvider.getCaptchaComponent(m, {
43
+ config: n,
44
44
  i18n: h,
45
- callbacks: r
45
+ callbacks: c
46
46
  });
47
- return this.renderCaptchaComponent(n, p, g), n;
47
+ return this.renderCaptchaComponent(s, g, p), s;
48
48
  }
49
49
  readAndValidateSettings(e, t, a) {
50
- L(a, e, t), y(a, e, t);
50
+ L(a, e, t), E(a, e, t);
51
51
  }
52
52
  makeEmotionCache(e, t) {
53
- return v({
53
+ return d({
54
54
  key: e,
55
55
  prepend: !0,
56
56
  container: t
57
57
  });
58
58
  }
59
59
  createReactRoot(e, t) {
60
- return s(e, {
60
+ return l(e, {
61
61
  identifierPrefix: t
62
62
  });
63
63
  }
64
64
  renderCaptchaComponent(e, t, a) {
65
- e.render(f.jsx(R, { value: t, children: a }));
65
+ e.render(C.jsx(v, { value: t, children: a }));
66
66
  }
67
67
  }
68
68
  export {
@@ -0,0 +1,189 @@
1
+ import { z as L } from "./zodChunk-wTu9ZHzV.js";
2
+ import { b as y } from "./utilCryptoChunk-CIPUtfoO.js";
3
+ const f = "info", m = "debug", d = "trace", k = "warn", b = "error", v = "fatal";
4
+ L.enum([
5
+ f,
6
+ m,
7
+ d,
8
+ k,
9
+ b,
10
+ v
11
+ ]);
12
+ const x = {
13
+ [d]: 5,
14
+ [m]: 4,
15
+ [f]: 3,
16
+ [k]: 2,
17
+ [b]: 1,
18
+ [v]: 0
19
+ };
20
+ function P(a, t) {
21
+ const e = new E(t);
22
+ return e.setLogLevel(a), e;
23
+ }
24
+ const S = typeof window < "u" && typeof window.document < "u", g = "json", D = "plain";
25
+ L.enum([g, D]);
26
+ class E {
27
+ constructor(t, e = x) {
28
+ this.scope = t, this.levelMap = e, this.pretty = 0, this.printStack = !1, this.format = g, this.level = f, this.levelNum = this.levelMap[this.level];
29
+ }
30
+ setFormat(t) {
31
+ if (this.format = t, this.format !== g)
32
+ throw new Error("Only JSON format implemented for now");
33
+ }
34
+ getFormat() {
35
+ return this.format;
36
+ }
37
+ with(t) {
38
+ const e = new E(this.scope);
39
+ return e.defaultData = { ...this.defaultData, ...t }, e.setLogLevel(this.getLogLevel()), e;
40
+ }
41
+ getPrintStack() {
42
+ return this.printStack;
43
+ }
44
+ setPrintStack(t) {
45
+ this.printStack = t;
46
+ }
47
+ getPretty() {
48
+ return this.pretty > 0;
49
+ }
50
+ setPretty(t) {
51
+ this.pretty = t ? 2 : 0;
52
+ }
53
+ getScope() {
54
+ return this.scope;
55
+ }
56
+ setLogLevel(t) {
57
+ this.level = t, this.levelNum = this.levelMap[t];
58
+ }
59
+ getLogLevel() {
60
+ return this.level;
61
+ }
62
+ unpackError(t) {
63
+ const e = t, r = { ...t };
64
+ 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 s = e.message || e.msg || "";
66
+ return e.message && e.msg && (r.msg = e.msg), {
67
+ msg: s,
68
+ data: r
69
+ };
70
+ }
71
+ print(t, e, r) {
72
+ if (this.levelMap[r] > this.levelNum)
73
+ return;
74
+ const s = (/* @__PURE__ */ new Date()).toISOString();
75
+ let { data: c, msg: i, err: o } = e(), l, h;
76
+ if (o)
77
+ if (o instanceof Error || typeof o == "object") {
78
+ const u = this.unpackError(o);
79
+ l = u.msg, h = u.data;
80
+ } else
81
+ l = String(o);
82
+ this.defaultData && (c = { ...this.defaultData, ...c });
83
+ const n = { scope: this.scope, ts: s, level: this.level };
84
+ if (c && (n.data = c), i && (n.msg = i), l && (n.err = l), h && (n.errData = h), S)
85
+ i || l ? t(i || l, n) : t(n);
86
+ else {
87
+ const u = JSON.stringify(n, null, this.pretty);
88
+ t(u);
89
+ }
90
+ }
91
+ info(t) {
92
+ this.print(console.info.bind(console), t, f);
93
+ }
94
+ debug(t) {
95
+ this.print(console.debug.bind(console), t, m);
96
+ }
97
+ trace(t) {
98
+ this.print(console.trace.bind(console), t, d);
99
+ }
100
+ warn(t) {
101
+ this.print(console.warn.bind(console), t, k);
102
+ }
103
+ error(t) {
104
+ this.print(console.error.bind(console), t, b);
105
+ }
106
+ fatal(t) {
107
+ this.print(console.error.bind(console), t, v);
108
+ }
109
+ log(t, e) {
110
+ switch (t) {
111
+ case "trace":
112
+ this.trace(e);
113
+ break;
114
+ case "debug":
115
+ this.debug(e);
116
+ break;
117
+ case "info":
118
+ this.info(e);
119
+ break;
120
+ case "warn":
121
+ this.warn(e);
122
+ break;
123
+ case "error":
124
+ this.error(e);
125
+ break;
126
+ case "fatal":
127
+ this.fatal(e);
128
+ break;
129
+ default:
130
+ throw new Error(`Unknown log level: ${t}`);
131
+ }
132
+ }
133
+ }
134
+ const N = { t: (a) => a };
135
+ class w extends Error {
136
+ constructor(t, e) {
137
+ const r = (e == null ? void 0 : e.logger) || P("info", import.meta.url), s = (e == null ? void 0 : e.logLevel) || "error", c = (e == null ? void 0 : e.i18n) || N;
138
+ t instanceof Error ? (super(c.t(t.message)), this.translationKey = e == null ? void 0 : e.translationKey, this.context = {
139
+ ...e == null ? void 0 : e.context,
140
+ ...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, s, e == null ? void 0 : e.name);
142
+ }
143
+ logError(t, e, r) {
144
+ const s = { error: this.message, context: this.context }, c = { errorType: r || this.name, errorParams: s };
145
+ if (e === "debug") {
146
+ t.debug(() => ({ data: { ...c, stack: this.stack } }));
147
+ return;
148
+ }
149
+ t.log(e, () => ({
150
+ data: c,
151
+ stack: this.stack
152
+ }));
153
+ }
154
+ }
155
+ class J extends w {
156
+ constructor(t, e) {
157
+ const r = (e == null ? void 0 : e.name) || "ProsopoError", s = { ...e, name: r };
158
+ super(t, s);
159
+ }
160
+ }
161
+ class K extends w {
162
+ constructor(t, e) {
163
+ const r = (e == null ? void 0 : e.name) || "ProsopoEnvError", s = { ...e, name: r };
164
+ super(t, s);
165
+ }
166
+ }
167
+ class R extends w {
168
+ constructor(t, e) {
169
+ const r = (e == null ? void 0 : e.name) || "ProsopoDatasetError", s = { ...e, name: r };
170
+ super(t, s);
171
+ }
172
+ }
173
+ const M = "";
174
+ function A(a, t) {
175
+ return a.join(M);
176
+ }
177
+ function O(a, t) {
178
+ return y(a, t);
179
+ }
180
+ function C(a) {
181
+ return O(A(a));
182
+ }
183
+ export {
184
+ J as P,
185
+ K as a,
186
+ R as b,
187
+ C as c,
188
+ O as h
189
+ };