@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.
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 +38 -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-Dw6ydLe3.js → captchaComponentProvider-B7Vxx339.js} +266 -100
  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-DqwVRCwA.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-BpzncYOb.js +0 -612
  86. package/dist/bundle/ProcaptchaWidget-D961oZ27.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 _ } 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-DqwVRCwA.js";
6
- const re = (e) => Object.values(e), Fe = async (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("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), Fe = async (e) => {
27
33
  context: { environment: e }
28
34
  });
29
35
  };
30
- let j = [];
31
- const $e = async (e) => {
36
+ let R = [];
37
+ const Fe = async (e) => {
32
38
  const t = (o, a) => Math.floor(Math.random() * (a - o + 1) + o);
33
- j.length === 0 && (j = await Fe(e.defaultEnvironment));
34
- const r = Ae(j, t(0, j.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: {
@@ -39,18 +48,20 @@ const $e = async (e) => {
39
48
  datasetId: r.datasetId
40
49
  }
41
50
  };
42
- }, Le = async (e, t, r, o, a) => {
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(`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++) {
@@ -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, F = d ? Symbol.for("react.fragment") : 60107, $ = d ? Symbol.for("react.strict_mode") : 60108, L = 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, H = d ? Symbol.for("react.concurrent_mode") : 60111, U = 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, He = d ? Symbol.for("react.block") : 60121, Ue = d ? Symbol.for("react.fundamental") : 60117, Ke = d ? Symbol.for("react.responder") : 60118, We = d ? Symbol.for("react.scope") : 60119;
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 H:
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 U:
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) === H;
107
+ return y(e) === U;
97
108
  }
98
109
  c.AsyncMode = Z;
99
- c.ConcurrentMode = H;
110
+ c.ConcurrentMode = U;
100
111
  c.ContextConsumer = z;
101
112
  c.ContextProvider = D;
102
113
  c.Element = X;
103
- c.ForwardRef = U;
104
- c.Fragment = F;
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 = L;
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) === U;
136
+ return y(e) === H;
126
137
  };
127
138
  c.isFragment = function(e) {
128
- return y(e) === F;
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) === L;
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 === F || e === H || e === L || e === $ || e === K || e === ze || typeof e == "object" && e !== null && (e.$$typeof === q || e.$$typeof === W || e.$$typeof === D || e.$$typeof === z || e.$$typeof === U || e.$$typeof === Ue || e.$$typeof === Ke || e.$$typeof === We || e.$$typeof === He);
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 R in p)
234
- P && R === "as" || be(R) && (O[R] = p[R]);
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({ 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 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(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,22 +719,30 @@ 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
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(async () => import("./ProcaptchaWidget-D961oZ27.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-BpzncYOb.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) => {
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 $e(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
+ );
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(it, { theme: s, onChange: async () => {
710
- }, 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
+ );
711
824
  }, ie = (e) => ({
712
825
  loading: !1,
713
826
  attemptCount: e || 0
714
- }), 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
+ }) => {
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(se(e.theme, e.mode, n.current.errorMessage, o.isInitialized, o.t, !0)), P = (h) => {
722
- 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
+ );
723
853
  }, g = (h, l) => {
724
854
  l === "CAPTCHA.NO_SESSION_FOUND" && setTimeout(() => {
725
855
  f();
726
- }, 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
+ );
727
866
  }, f = () => {
728
867
  setTimeout(() => {
729
868
  P(0), s.onReset(), r();
730
869
  }, 1e4);
731
870
  }, T = async () => {
732
- await Le(async () => {
733
- var S, A, E, C, k;
734
- n.current.attemptCount += 1;
735
- const h = Re.parse(e), l = await a(h);
736
- if ((S = l.error) != null && S.message) {
737
- 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 = {
738
912
  ...n.current,
739
- loading: !1,
740
- errorMessage: (A = l.error) == null ? void 0 : A.message
741
- }, 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);
742
- return;
743
- }
744
- const p = {
745
- provider: l.provider,
746
- sessionId: l.sessionId,
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
- $e as b,
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
- Le as p
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-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) {