@prosopo/procaptcha-bundle 3.0.9 → 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.
Files changed (151) hide show
  1. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +1 -0
  2. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  3. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -0
  4. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
  5. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -0
  6. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  7. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts +2 -1
  8. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +1 -1
  9. package/CHANGELOG.md +31 -0
  10. package/dist/bundle/ProcaptchaWidget-48FxVPQd.js +187 -0
  11. package/dist/bundle/ProcaptchaWidget-B2BzhXLv.js +992 -0
  12. package/dist/bundle/builder-DNHtDoNG.js +44 -0
  13. package/dist/bundle/{captchaComponentProvider-CZppE3Vb.js → captchaComponentProvider-B7Vxx339.js} +256 -99
  14. package/dist/bundle/{captchaRenderer-CY8KuZK-.js → captchaRenderer-DdOlOCKw.js} +3 -3
  15. package/dist/bundle/{commonChunk-24zMb_mF.js → commonChunk-HCVkoCqn.js} +9 -12
  16. package/dist/bundle/{emotion-element-5486c51c.browser.esm-PRDDgd_k.js → emotion-element-5486c51c.browser.esm-D7qvHZDV.js} +1 -1
  17. package/dist/bundle/{fp.esm-BADUiinQ.js → fp.esm-DYWeNGcH.js} +648 -548
  18. package/dist/bundle/index-7Xh-Mf8v.js +1318 -0
  19. package/dist/bundle/{index-BiwZ4wVT.js → index-C00_J7av.js} +48 -12
  20. package/dist/bundle/{index-BzOMq-ud.js → index-DyYmvHVN.js} +1 -1
  21. package/dist/bundle/locales/ar/translation.json +12 -11
  22. package/dist/bundle/locales/az/translation.json +12 -11
  23. package/dist/bundle/locales/cs/translation.json +12 -11
  24. package/dist/bundle/locales/de/translation.json +12 -11
  25. package/dist/bundle/locales/el/translation.json +12 -11
  26. package/dist/bundle/locales/en/translation.json +4 -3
  27. package/dist/bundle/locales/es/translation.json +12 -11
  28. package/dist/bundle/locales/fi/translation.json +29 -28
  29. package/dist/bundle/locales/fr/translation.json +12 -11
  30. package/dist/bundle/locales/hi/translation.json +41 -40
  31. package/dist/bundle/locales/hu/translation.json +12 -11
  32. package/dist/bundle/locales/id/translation.json +12 -11
  33. package/dist/bundle/locales/it/translation.json +12 -11
  34. package/dist/bundle/locales/ja/translation.json +12 -11
  35. package/dist/bundle/locales/jv/translation.json +12 -11
  36. package/dist/bundle/locales/ko/translation.json +7 -6
  37. package/dist/bundle/locales/ml/translation.json +12 -11
  38. package/dist/bundle/locales/ms/translation.json +12 -11
  39. package/dist/bundle/locales/nl/translation.json +12 -11
  40. package/dist/bundle/locales/no/translation.json +12 -11
  41. package/dist/bundle/locales/pl/translation.json +12 -11
  42. package/dist/bundle/locales/pt/translation.json +12 -11
  43. package/dist/bundle/locales/pt-BR/translation.json +12 -11
  44. package/dist/bundle/locales/ro/translation.json +12 -11
  45. package/dist/bundle/locales/ru/translation.json +12 -11
  46. package/dist/bundle/locales/sr/translation.json +12 -11
  47. package/dist/bundle/locales/sv/translation.json +12 -11
  48. package/dist/bundle/locales/th/translation.json +12 -11
  49. package/dist/bundle/locales/tr/translation.json +7 -6
  50. package/dist/bundle/locales/uk/translation.json +12 -11
  51. package/dist/bundle/locales/vi/translation.json +12 -11
  52. package/dist/bundle/locales/zh-CN/translation.json +12 -11
  53. package/dist/bundle/nobleChunk-Qozzkbsq.js +3648 -0
  54. package/dist/bundle/procaptcha.bundle.js +2 -2
  55. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts +1 -0
  56. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  57. package/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -0
  58. package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
  59. package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -0
  60. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  61. package/dist/bundle/util/captcha/captchaType.d.ts +2 -1
  62. package/dist/bundle/util/captcha/captchaType.d.ts.map +1 -1
  63. package/dist/bundle/{utilCryptoChunk-CIPUtfoO.js → utilCryptoChunk-qm-BM2eT.js} +618 -647
  64. package/dist/bundle/{web2Chunk-7Vd8yt2r.js → web2Chunk-DCsWA5PR.js} +1150 -994
  65. package/dist/bundle/{web3Chunk-DrUvbVNW.js → web3Chunk-B8txCqUJ.js} +3 -3
  66. package/dist/index.js +142 -108
  67. package/dist/util/captcha/captchaComponentProvider.js +18 -10
  68. package/dist/util/captcha/captchaComponentsList.js +6 -5
  69. package/dist/util/captcha/captchaRenderer.js +58 -40
  70. package/dist/util/captcha/captchaType.js +9 -5
  71. package/dist/util/captcha/components/frictionlessCaptcha.js +19 -9
  72. package/dist/util/captcha/components/imageCaptcha.js +13 -5
  73. package/dist/util/captcha/components/powCaptcha.js +13 -5
  74. package/dist/util/config.js +15 -12
  75. package/dist/util/configCreator.js +21 -22
  76. package/dist/util/language.js +14 -13
  77. package/dist/util/timeout.js +13 -8
  78. package/dist/util/widgetFactory.js +77 -55
  79. package/dist/util/widgetThemeResolver.js +14 -17
  80. package/package.json +23 -20
  81. package/stats.html +1 -1
  82. package/vite.cjs.config.ts +2 -3
  83. package/vite.esm.config.ts +20 -0
  84. package/vite.test.config.ts +9 -5
  85. package/dist/bundle/ProcaptchaWidget-D_kzGjgO.js +0 -612
  86. package/dist/bundle/ProcaptchaWidget-DlrcrISF.js +0 -148
  87. package/dist/bundle/builder-CQlqPNRd.js +0 -37
  88. package/dist/bundle/index-BRg_gWPo.js +0 -1328
  89. package/dist/bundle/nobleChunk-Xl5XLrx3.js +0 -3635
  90. package/dist/components.d.ts +0 -5
  91. package/dist/components.d.ts.map +0 -1
  92. package/dist/components.js +0 -5
  93. package/dist/components.js.map +0 -1
  94. package/dist/index.d.ts +0 -16
  95. package/dist/index.d.ts.map +0 -1
  96. package/dist/index.js.map +0 -1
  97. package/dist/tests/util/captchaType.test.d.ts +0 -2
  98. package/dist/tests/util/captchaType.test.d.ts.map +0 -1
  99. package/dist/tests/util/captchaType.test.js +0 -36
  100. package/dist/tests/util/captchaType.test.js.map +0 -1
  101. package/dist/tests/util/config.test.d.ts +0 -2
  102. package/dist/tests/util/config.test.d.ts.map +0 -1
  103. package/dist/tests/util/config.test.js +0 -69
  104. package/dist/tests/util/config.test.js.map +0 -1
  105. package/dist/tests/util/renderLogic.test.d.ts +0 -2
  106. package/dist/tests/util/renderLogic.test.d.ts.map +0 -1
  107. package/dist/tests/util/renderLogic.test.js +0 -126
  108. package/dist/tests/util/renderLogic.test.js.map +0 -1
  109. package/dist/util/captcha/captchaComponentProvider.d.ts +0 -8
  110. package/dist/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  111. package/dist/util/captcha/captchaComponentProvider.js.map +0 -1
  112. package/dist/util/captcha/captchaComponentsList.d.ts +0 -6
  113. package/dist/util/captcha/captchaComponentsList.d.ts.map +0 -1
  114. package/dist/util/captcha/captchaComponentsList.js.map +0 -1
  115. package/dist/util/captcha/captchaProps.d.ts +0 -9
  116. package/dist/util/captcha/captchaProps.d.ts.map +0 -1
  117. package/dist/util/captcha/captchaProps.js +0 -2
  118. package/dist/util/captcha/captchaProps.js.map +0 -1
  119. package/dist/util/captcha/captchaRenderer.d.ts +0 -24
  120. package/dist/util/captcha/captchaRenderer.d.ts.map +0 -1
  121. package/dist/util/captcha/captchaRenderer.js.map +0 -1
  122. package/dist/util/captcha/captchaType.d.ts +0 -3
  123. package/dist/util/captcha/captchaType.d.ts.map +0 -1
  124. package/dist/util/captcha/captchaType.js.map +0 -1
  125. package/dist/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  126. package/dist/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  127. package/dist/util/captcha/components/frictionlessCaptcha.js.map +0 -1
  128. package/dist/util/captcha/components/imageCaptcha.d.ts +0 -4
  129. package/dist/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  130. package/dist/util/captcha/components/imageCaptcha.js.map +0 -1
  131. package/dist/util/captcha/components/powCaptcha.d.ts +0 -4
  132. package/dist/util/captcha/components/powCaptcha.d.ts.map +0 -1
  133. package/dist/util/captcha/components/powCaptcha.js.map +0 -1
  134. package/dist/util/config.d.ts +0 -6
  135. package/dist/util/config.d.ts.map +0 -1
  136. package/dist/util/config.js.map +0 -1
  137. package/dist/util/configCreator.d.ts +0 -5
  138. package/dist/util/configCreator.d.ts.map +0 -1
  139. package/dist/util/configCreator.js.map +0 -1
  140. package/dist/util/language.d.ts +0 -3
  141. package/dist/util/language.d.ts.map +0 -1
  142. package/dist/util/language.js.map +0 -1
  143. package/dist/util/timeout.d.ts +0 -3
  144. package/dist/util/timeout.d.ts.map +0 -1
  145. package/dist/util/timeout.js.map +0 -1
  146. package/dist/util/widgetFactory.d.ts +0 -18
  147. package/dist/util/widgetFactory.d.ts.map +0 -1
  148. package/dist/util/widgetFactory.js.map +0 -1
  149. package/dist/util/widgetThemeResolver.d.ts +0 -9
  150. package/dist/util/widgetThemeResolver.d.ts.map +0 -1
  151. 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
+ };
@@ -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-PRDDgd_k.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 Re, C as N } from "./web2Chunk-7Vd8yt2r.js";
3
- import { a as pe } from "./commonChunk-24zMb_mF.js";
4
- import { g as Tt } from "./bnChunk-DRlDxTFg.js";
5
- import { g as je, W as _e, l as Ne, d as Me } from "./index-BiwZ4wVT.js";
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("https://provider-list.prosopo.io/", {
9
- method: "GET",
10
- mode: "cors"
11
- }).then((r) => r.json());
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("https://provider-list.prosopo.io/staging.json", { method: "GET", mode: "cors" }).then((r) => r.json());
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
- _.length === 0 && (_ = await Le(e.defaultEnvironment));
34
- const r = Ae(_, t(0, _.length - 1));
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(`Max retries (${o} of ${a}) reached, aborting`), r();
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
- ...je(void 0),
62
+ ...Re(void 0),
52
63
  ...e
53
- }), De = async (e) => e ? (await import("./web2Chunk-7Vd8yt2r.js").then((t) => t.j)).default : (await import("./web3Chunk-DrUvbVNW.js")).default;
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 = [], O = p;
233
+ var E = P && p.as || a, C = "", k = [], I = p;
223
234
  if (p.theme == null) {
224
- O = {};
235
+ I = {};
225
236
  for (var Q in p)
226
- O[Q] = p[Q];
227
- O.theme = m.useContext(Pe);
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, O);
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, R = {};
243
+ var be = P && u === void 0 ? oe(E) : b, O = {};
233
244
  for (var j in p)
234
- P && j === "as" || be(j) && (R[j] = p[j]);
235
- return R.className = C, A && (R.ref = A), /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement(et, {
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, R));
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({ length: 8 }, () => ne[Math.floor(Math.random() * ne.length)]).join(""), it = ({ theme: e, onChange: t, checked: r, labelText: o, error: a, loading: n }) => {
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 Ve("span", { style: {
445
- display: "inline-flex",
446
- alignItems: "center",
447
- minHeight: "58px"
448
- }, children: [n ? w("div", { className: _e, "aria-label": "Loading spinner" }) : w("input", { name: f, id: f, onMouseEnter: () => b(!0), onMouseLeave: () => b(!1), css: ot, type: "checkbox", "aria-live": "assertive", "aria-label": o, onChange: (T) => {
449
- T.preventDefault(), T.stopPropagation(), b(!1), t();
450
- }, checked: r, style: g, disabled: a !== void 0, className: n ? "checkbox__loading-spinner" : "", "data-cy": "captcha-checkbox" }), a ? w(P, { htmFor: f, children: w("a", { css: {
451
- color: e.palette.error.main
452
- }, href: nt, children: a }) }) : w(P, { htmFor: f, children: o })] });
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 && a.status !== 400 && !((o = a.headers.get("content-type")) != null && o.includes("application/json")))
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 && s.status !== 400 && !((n = s.headers.get("content-type")) != null && n.includes("application/json")))
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 I;
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(x.SubmitUserEvents, { events: t, string: r }, {
614
- headers: {
615
- "Prosopo-Site-Key": this.account
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(B.UpdateDetectorKey, te.parse({ detectorKey: t }), {
659
- headers: {
660
- "Prosopo-Site-Key": this.account,
661
- timestamp: r,
662
- signature: o
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(B.RemoveDetectorKey, te.parse({ detectorKey: t }), {
668
- headers: {
669
- "Prosopo-Site-Key": this.account,
670
- timestamp: r,
671
- signature: o
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(I.INSERT_MANY, t, {
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(I.DELETE_MANY, t, {
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(I.DELETE_ALL, {}, {
695
- headers: {
696
- "Prosopo-Site-Key": this.account,
697
- timestamp: t,
698
- signature: 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
+ }
699
775
  }
700
- });
776
+ );
701
777
  }
702
778
  }
703
- const ut = m.lazy(async () => import("./ProcaptchaWidget-DlrcrISF.js")), ge = (e) => w(m.Suspense, { children: w(ut, { config: e.config, callbacks: e.callbacks, frictionlessState: e.frictionlessState, i18n: e.i18n }) }), dt = m.lazy(async () => import("./ProcaptchaWidget-D_kzGjgO.js")), ve = (e) => w(m.Suspense, { children: w(dt, { ...e }) }), pt = async () => (await import("./index-BRg_gWPo.js")).default, ft = async (e) => {
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(n.provider.url, e.account.address).getFrictionlessCaptcha(r.token, e.account.address, a.account.address);
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(it, { theme: s, onChange: async () => {
719
- }, checked: !1, labelText: o ? a("WIDGET.I_AM_HUMAN") : "", error: r, "aria-label": "human checkbox", loading: n });
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 = ({ config: e, callbacks: t, restart: r, i18n: o, detectBot: a = ft }) => {
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(se(e.theme, e.mode, n.current.errorMessage, o.isInitialized, o.t, !0)), P = (h) => {
731
- n.current = ie(h || n.current.attemptCount);
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(se(e.theme, e.mode, h || "Cannot load CAPTCHA", o.isInitialized, o.t, !1));
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(async () => {
742
- var S, A, E, C, k;
743
- n.current.attemptCount += 1;
744
- const h = Re.parse(e), l = await a(h);
745
- if ((S = l.error) != null && S.message) {
746
- n.current = {
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
- errorMessage: (A = l.error) == null ? void 0 : A.message
750
- }, 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);
751
- return;
752
- }
753
- const p = {
754
- provider: l.provider,
755
- sessionId: l.sessionId,
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
- [N.image]: yt,
785
- [N.pow]: gt,
786
- [N.frictionless]: mt
941
+ [_.image]: yt,
942
+ [_.pow]: gt,
943
+ [_.frictionless]: mt
787
944
  };
788
945
  class bt {
789
946
  getCaptchaComponent(t, r) {
790
- if (t === N.invisible)
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-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";
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-CIPUtfoO.js";
3
- const f = "info", m = "debug", d = "trace", k = "warn", b = "error", v = "fatal";
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
- k,
8
+ v,
9
9
  b,
10
- v
10
+ k
11
11
  ]);
12
12
  const x = {
13
13
  [d]: 5,
14
14
  [m]: 4,
15
15
  [f]: 3,
16
- [k]: 2,
16
+ [v]: 2,
17
17
  [b]: 1,
18
- [v]: 0
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, k);
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, v);
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.log(e, () => ({
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-7Vd8yt2r.js";
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) {