@prosopo/procaptcha-bundle 2.6.12 → 3.0.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.
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 +141 -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
@@ -0,0 +1,802 @@
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) => {
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());
12
+ return re(t);
13
+ }
14
+ if (e === "staging") {
15
+ const t = await fetch("https://provider-list.prosopo.io/staging.json", { method: "GET", mode: "cors" }).then((r) => r.json());
16
+ return re(t);
17
+ }
18
+ if (e === "development")
19
+ return [
20
+ {
21
+ address: "5EjTA28bKSbFPPyMbUjNtArxyqjwq38r1BapVmLZShaqEedV",
22
+ url: "http://localhost:9229",
23
+ datasetId: "0x9f460e81ac9c71b486f796a21bb36e2263694756a6621134d110da217fd3ef25"
24
+ }
25
+ ];
26
+ throw new pe("CONFIG.UNKNOWN_ENVIRONMENT", {
27
+ context: { environment: e }
28
+ });
29
+ };
30
+ let j = [];
31
+ const $e = async (e) => {
32
+ 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));
35
+ return {
36
+ providerAccount: r.address,
37
+ provider: {
38
+ url: r.url,
39
+ datasetId: r.datasetId
40
+ }
41
+ };
42
+ }, Le = async (e, t, r, o, a) => {
43
+ try {
44
+ await e();
45
+ } catch (n) {
46
+ if (o >= a)
47
+ return console.error(n), console.error(`Max retries (${o} of ${a}) reached, aborting`), r();
48
+ console.error(n), r(), await t();
49
+ }
50
+ }, M = (e) => ({
51
+ ...je(void 0),
52
+ ...e
53
+ }), De = async (e) => e ? (await import("./web2Chunk-7Vd8yt2r.js").then((t) => t.j)).default : (await import("./web3Chunk-DrUvbVNW.js")).default;
54
+ function V() {
55
+ return V = Object.assign ? Object.assign.bind() : function(e) {
56
+ for (var t = 1; t < arguments.length; t++) {
57
+ var r = arguments[t];
58
+ for (var o in r) ({}).hasOwnProperty.call(r, o) && (e[o] = r[o]);
59
+ }
60
+ return e;
61
+ }, V.apply(null, arguments);
62
+ }
63
+ 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;
65
+ function y(e) {
66
+ if (typeof e == "object" && e !== null) {
67
+ var t = e.$$typeof;
68
+ switch (t) {
69
+ case X:
70
+ switch (e = e.type, e) {
71
+ case Z:
72
+ case H:
73
+ case F:
74
+ case L:
75
+ case $:
76
+ case K:
77
+ return e;
78
+ default:
79
+ switch (e = e && e.$$typeof, e) {
80
+ case z:
81
+ case U:
82
+ case q:
83
+ case W:
84
+ case D:
85
+ return e;
86
+ default:
87
+ return t;
88
+ }
89
+ }
90
+ case J:
91
+ return t;
92
+ }
93
+ }
94
+ }
95
+ function he(e) {
96
+ return y(e) === H;
97
+ }
98
+ c.AsyncMode = Z;
99
+ c.ConcurrentMode = H;
100
+ c.ContextConsumer = z;
101
+ c.ContextProvider = D;
102
+ c.Element = X;
103
+ c.ForwardRef = U;
104
+ c.Fragment = F;
105
+ c.Lazy = q;
106
+ c.Memo = W;
107
+ c.Portal = J;
108
+ c.Profiler = L;
109
+ c.StrictMode = $;
110
+ c.Suspense = K;
111
+ c.isAsyncMode = function(e) {
112
+ return he(e) || y(e) === Z;
113
+ };
114
+ c.isConcurrentMode = he;
115
+ c.isContextConsumer = function(e) {
116
+ return y(e) === z;
117
+ };
118
+ c.isContextProvider = function(e) {
119
+ return y(e) === D;
120
+ };
121
+ c.isElement = function(e) {
122
+ return typeof e == "object" && e !== null && e.$$typeof === X;
123
+ };
124
+ c.isForwardRef = function(e) {
125
+ return y(e) === U;
126
+ };
127
+ c.isFragment = function(e) {
128
+ return y(e) === F;
129
+ };
130
+ c.isLazy = function(e) {
131
+ return y(e) === q;
132
+ };
133
+ c.isMemo = function(e) {
134
+ return y(e) === W;
135
+ };
136
+ c.isPortal = function(e) {
137
+ return y(e) === J;
138
+ };
139
+ c.isProfiler = function(e) {
140
+ return y(e) === L;
141
+ };
142
+ c.isStrictMode = function(e) {
143
+ return y(e) === $;
144
+ };
145
+ c.isSuspense = function(e) {
146
+ return y(e) === K;
147
+ };
148
+ 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);
150
+ };
151
+ c.typeOf = y;
152
+ fe.exports = c;
153
+ var qe = fe.exports, me = qe;
154
+ var Be = {
155
+ $$typeof: !0,
156
+ render: !0,
157
+ defaultProps: !0,
158
+ displayName: !0,
159
+ propTypes: !0
160
+ }, Ge = {
161
+ $$typeof: !0,
162
+ compare: !0,
163
+ defaultProps: !0,
164
+ displayName: !0,
165
+ propTypes: !0,
166
+ type: !0
167
+ }, ye = {};
168
+ ye[me.ForwardRef] = Be;
169
+ ye[me.Memo] = Ge;
170
+ var At = Object.prototype;
171
+ function w(e, t, r) {
172
+ return ce.call(t, "css") ? v.jsx(le, ue(e, t), r) : v.jsx(e, t, r);
173
+ }
174
+ function Ve(e, t, r) {
175
+ return ce.call(t, "css") ? v.jsxs(le, ue(e, t), r) : v.jsxs(e, t, r);
176
+ }
177
+ function Ye() {
178
+ for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
179
+ t[r] = arguments[r];
180
+ return de(t);
181
+ }
182
+ var Xe = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, Je = /* @__PURE__ */ Ee(
183
+ function(e) {
184
+ return Xe.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
185
+ }
186
+ /* Z+1 */
187
+ ), Ze = Je, Qe = function(t) {
188
+ return t !== "theme";
189
+ }, oe = function(t) {
190
+ return typeof t == "string" && // 96 is one less than the char code
191
+ // for "a" so this is checking that
192
+ // it's a lowercase character
193
+ t.charCodeAt(0) > 96 ? Ze : Qe;
194
+ }, ae = function(t, r, o) {
195
+ var a;
196
+ if (r) {
197
+ var n = r.shouldForwardProp;
198
+ a = t.__emotion_forwardProp && n ? function(s) {
199
+ return t.__emotion_forwardProp(s) && n(s);
200
+ } : n;
201
+ }
202
+ return typeof a != "function" && o && (a = t.__emotion_forwardProp), a;
203
+ }, et = function(t) {
204
+ var r = t.cache, o = t.serialized, a = t.isStringTag;
205
+ return we(r, o, a), Ce(function() {
206
+ return xe(r, o, a);
207
+ }), null;
208
+ }, tt = function e(t, r) {
209
+ var o = t.__emotion_real === t, a = o && t.__emotion_base || t, n, s;
210
+ r !== void 0 && (n = r.label, s = r.target);
211
+ var u = ae(t, r, o), b = u || oe(a), P = !b("as");
212
+ return function() {
213
+ var g = arguments, f = o && t.__emotion_styles !== void 0 ? t.__emotion_styles.slice(0) : [];
214
+ if (n !== void 0 && f.push("label:" + n + ";"), g[0] == null || g[0].raw === void 0)
215
+ f.push.apply(f, g);
216
+ else {
217
+ f.push(g[0][0]);
218
+ for (var T = g.length, h = 1; h < T; h++)
219
+ f.push(g[h], g[0][h]);
220
+ }
221
+ var l = Se(function(p, S, A) {
222
+ var E = P && p.as || a, C = "", k = [], I = p;
223
+ if (p.theme == null) {
224
+ I = {};
225
+ for (var Q in p)
226
+ I[Q] = p[Q];
227
+ I.theme = m.useContext(Pe);
228
+ }
229
+ 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, I);
231
+ C += S.key + "-" + ee.name, s !== void 0 && (C += " " + s);
232
+ 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]);
235
+ return O.className = C, A && (O.ref = A), /* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement(et, {
236
+ cache: S,
237
+ serialized: ee,
238
+ isStringTag: typeof E == "string"
239
+ }), /* @__PURE__ */ m.createElement(E, O));
240
+ });
241
+ 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
+ value: function() {
243
+ return "." + s;
244
+ }
245
+ }), l.withComponent = function(p, S) {
246
+ return e(p, V({}, r, S, {
247
+ shouldForwardProp: ae(l, S, !0)
248
+ })).apply(void 0, f);
249
+ }, l;
250
+ };
251
+ }, rt = [
252
+ "a",
253
+ "abbr",
254
+ "address",
255
+ "area",
256
+ "article",
257
+ "aside",
258
+ "audio",
259
+ "b",
260
+ "base",
261
+ "bdi",
262
+ "bdo",
263
+ "big",
264
+ "blockquote",
265
+ "body",
266
+ "br",
267
+ "button",
268
+ "canvas",
269
+ "caption",
270
+ "cite",
271
+ "code",
272
+ "col",
273
+ "colgroup",
274
+ "data",
275
+ "datalist",
276
+ "dd",
277
+ "del",
278
+ "details",
279
+ "dfn",
280
+ "dialog",
281
+ "div",
282
+ "dl",
283
+ "dt",
284
+ "em",
285
+ "embed",
286
+ "fieldset",
287
+ "figcaption",
288
+ "figure",
289
+ "footer",
290
+ "form",
291
+ "h1",
292
+ "h2",
293
+ "h3",
294
+ "h4",
295
+ "h5",
296
+ "h6",
297
+ "head",
298
+ "header",
299
+ "hgroup",
300
+ "hr",
301
+ "html",
302
+ "i",
303
+ "iframe",
304
+ "img",
305
+ "input",
306
+ "ins",
307
+ "kbd",
308
+ "keygen",
309
+ "label",
310
+ "legend",
311
+ "li",
312
+ "link",
313
+ "main",
314
+ "map",
315
+ "mark",
316
+ "marquee",
317
+ "menu",
318
+ "menuitem",
319
+ "meta",
320
+ "meter",
321
+ "nav",
322
+ "noscript",
323
+ "object",
324
+ "ol",
325
+ "optgroup",
326
+ "option",
327
+ "output",
328
+ "p",
329
+ "param",
330
+ "picture",
331
+ "pre",
332
+ "progress",
333
+ "q",
334
+ "rp",
335
+ "rt",
336
+ "ruby",
337
+ "s",
338
+ "samp",
339
+ "script",
340
+ "section",
341
+ "select",
342
+ "small",
343
+ "source",
344
+ "span",
345
+ "strong",
346
+ "style",
347
+ "sub",
348
+ "summary",
349
+ "sup",
350
+ "table",
351
+ "tbody",
352
+ "td",
353
+ "textarea",
354
+ "tfoot",
355
+ "th",
356
+ "thead",
357
+ "time",
358
+ "title",
359
+ "tr",
360
+ "track",
361
+ "u",
362
+ "ul",
363
+ "var",
364
+ "video",
365
+ "wbr",
366
+ // SVG
367
+ "circle",
368
+ "clipPath",
369
+ "defs",
370
+ "ellipse",
371
+ "foreignObject",
372
+ "g",
373
+ "image",
374
+ "line",
375
+ "linearGradient",
376
+ "mask",
377
+ "path",
378
+ "pattern",
379
+ "polygon",
380
+ "polyline",
381
+ "radialGradient",
382
+ "rect",
383
+ "stop",
384
+ "svg",
385
+ "text",
386
+ "tspan"
387
+ ], Y = tt.bind();
388
+ rt.forEach(function(e) {
389
+ Y[e] = Y(e);
390
+ });
391
+ const ot = Ye`{
392
+ &:before {
393
+ content: '""';
394
+ position: absolute;
395
+ height: 100%;
396
+ width: 100%;
397
+ }
398
+ }`, at = {
399
+ width: "28px",
400
+ height: "28px",
401
+ minWidth: "14px",
402
+ minHeight: "14px",
403
+ top: "auto",
404
+ left: "auto",
405
+ opacity: "1",
406
+ borderRadius: "12.5%",
407
+ appearance: "none",
408
+ cursor: "pointer",
409
+ margin: "0",
410
+ borderStyle: "solid",
411
+ 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 }) => {
413
+ const s = {
414
+ ...at,
415
+ border: `1px solid ${e.palette.background.contrastText}`
416
+ }, [u, b] = m.useState(!1), P = Y.label`
417
+ color: ${e.palette.background.contrastText};
418
+ position: relative;
419
+ display: flex;
420
+ cursor: pointer;
421
+ user-select: none;
422
+
423
+ @container widget (max-width: 219px) {
424
+ display: none;
425
+ }
426
+ @container widget (min-width: 220px) {
427
+ font-size: 12px;
428
+ }
429
+ @container widget (min-width: 250px) {
430
+ font-size: 14px;
431
+ }
432
+ @container widget (min-width: 270px) {
433
+ font-size: 16px;
434
+ }
435
+ `, g = m.useMemo(() => ({
436
+ ...s,
437
+ borderColor: u ? e.palette.background.contrastText : e.palette.border,
438
+ appearance: r ? "auto" : "none",
439
+ flex: 1,
440
+ margin: "15px",
441
+ minWidth: "28px",
442
+ minHeight: "28px"
443
+ }), [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 })] });
453
+ };
454
+ class G extends Error {
455
+ constructor(t, r, o) {
456
+ super(`HTTP error! status: ${t} (${r}) for URL: ${o}`), this.status = t, this.statusText = r, this.url = o, this.name = "HttpError";
457
+ }
458
+ }
459
+ class ct {
460
+ constructor(t, r = "") {
461
+ this.baseURL = t + r;
462
+ }
463
+ async fetch(t, r) {
464
+ var o;
465
+ try {
466
+ 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")))
468
+ throw new G(a.status, a.statusText, a.url);
469
+ return this.responseHandler(a);
470
+ } catch (a) {
471
+ return this.errorHandler(a);
472
+ }
473
+ }
474
+ async post(t, r, o) {
475
+ var n;
476
+ const a = {
477
+ "Content-Type": "application/json",
478
+ ...(o == null ? void 0 : o.headers) || {}
479
+ };
480
+ try {
481
+ const s = await fetch(this.baseURL + t, {
482
+ method: "POST",
483
+ body: JSON.stringify(r),
484
+ ...o,
485
+ headers: a
486
+ });
487
+ if (!s.ok && s.status !== 400 && !((n = s.headers.get("content-type")) != null && n.includes("application/json")))
488
+ throw new G(s.status, s.statusText, s.url);
489
+ return this.responseHandler(s);
490
+ } catch (s) {
491
+ return this.errorHandler(s);
492
+ }
493
+ }
494
+ async responseHandler(t) {
495
+ try {
496
+ return await t.json();
497
+ } catch (r) {
498
+ throw console.error("Error parsing JSON:", r), r;
499
+ }
500
+ }
501
+ errorHandler(t) {
502
+ return t instanceof G ? console.error("HTTP error:", t) : console.error("API request error:", t), Promise.reject(t);
503
+ }
504
+ }
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 = {}));
509
+ class lt extends ct {
510
+ constructor(t, r) {
511
+ const o = t.startsWith("http") ? t : `https://${t}`;
512
+ super(o), this.account = r;
513
+ }
514
+ getCaptchaChallenge(t, r, o) {
515
+ const { provider: a } = r, n = this.account, s = {
516
+ [i.dapp]: n,
517
+ [i.user]: t,
518
+ [i.datasetId]: a.datasetId
519
+ };
520
+ return o && (s[i.sessionId] = o), this.post(x.GetImageCaptchaChallenge, s, {
521
+ headers: {
522
+ "Prosopo-Site-Key": this.account,
523
+ "Prosopo-User": t
524
+ }
525
+ });
526
+ }
527
+ submitCaptchaSolution(t, r, o, a, n, s) {
528
+ const u = {
529
+ [i.user]: o,
530
+ [i.dapp]: this.account,
531
+ [i.captchas]: t,
532
+ [i.requestHash]: r,
533
+ [i.timestamp]: a,
534
+ [i.signature]: {
535
+ [i.user]: {
536
+ [i.timestamp]: s
537
+ },
538
+ [i.provider]: {
539
+ [i.requestHash]: n
540
+ }
541
+ }
542
+ };
543
+ return this.post(x.SubmitImageCaptchaSolution, u, {
544
+ headers: {
545
+ "Prosopo-Site-Key": this.account,
546
+ "Prosopo-User": o
547
+ }
548
+ });
549
+ }
550
+ verifyDappUser(t, r, o, a, n) {
551
+ const s = {
552
+ [i.token]: t,
553
+ [i.dappSignature]: r,
554
+ [i.ip]: n
555
+ };
556
+ return a && (s[i.maxVerifiedTime] = a), this.post(x.VerifyImageCaptchaSolutionDapp, s, {
557
+ headers: {
558
+ "Prosopo-Site-Key": this.account,
559
+ "Prosopo-User": o
560
+ }
561
+ });
562
+ }
563
+ getPowCaptchaChallenge(t, r, o) {
564
+ const a = {
565
+ [i.user]: t.toString(),
566
+ [i.dapp]: r.toString(),
567
+ ...o && { [i.sessionId]: o }
568
+ };
569
+ return this.post(x.GetPowCaptchaChallenge, a, {
570
+ headers: {
571
+ "Prosopo-Site-Key": this.account,
572
+ "Prosopo-User": t
573
+ }
574
+ });
575
+ }
576
+ submitPowCaptchaSolution(t, r, o, a, n, s) {
577
+ const u = ke.parse({
578
+ [i.challenge]: t.challenge,
579
+ [i.difficulty]: t.difficulty,
580
+ [i.timestamp]: t.timestamp,
581
+ [i.user]: r.toString(),
582
+ [i.dapp]: o.toString(),
583
+ [i.nonce]: a,
584
+ [i.verifiedTimeout]: s,
585
+ [i.signature]: {
586
+ [i.provider]: t[i.signature][i.provider],
587
+ [i.user]: {
588
+ [i.timestamp]: n
589
+ }
590
+ }
591
+ });
592
+ return this.post(x.SubmitPowCaptchaSolution, u, {
593
+ headers: {
594
+ "Prosopo-Site-Key": this.account,
595
+ "Prosopo-User": r
596
+ }
597
+ });
598
+ }
599
+ getFrictionlessCaptcha(t, r, o) {
600
+ const a = {
601
+ [i.token]: t,
602
+ [i.dapp]: r,
603
+ [i.user]: o
604
+ };
605
+ return this.post(x.GetFrictionlessCaptchaChallenge, a, {
606
+ headers: {
607
+ "Prosopo-Site-Key": this.account,
608
+ "Prosopo-User": o
609
+ }
610
+ });
611
+ }
612
+ submitUserEvents(t, r) {
613
+ return this.post(x.SubmitUserEvents, { events: t, string: r }, {
614
+ headers: {
615
+ "Prosopo-Site-Key": this.account
616
+ }
617
+ });
618
+ }
619
+ getProviderStatus() {
620
+ return this.fetch(x.GetProviderStatus, {
621
+ headers: {
622
+ "Prosopo-Site-Key": this.account
623
+ }
624
+ });
625
+ }
626
+ getProviderDetails() {
627
+ return this.fetch(Ie.GetProviderDetails, {
628
+ headers: {
629
+ "Prosopo-Site-Key": this.account
630
+ }
631
+ });
632
+ }
633
+ submitPowCaptchaVerify(t, r, o, a, n) {
634
+ const s = {
635
+ [i.token]: t,
636
+ [i.dappSignature]: r,
637
+ [i.verifiedTimeout]: o,
638
+ [i.ip]: n
639
+ };
640
+ return this.post(x.VerifyPowCaptchaSolution, s, {
641
+ headers: {
642
+ "Prosopo-Site-Key": this.account,
643
+ "Prosopo-User": a
644
+ }
645
+ });
646
+ }
647
+ registerSiteKey(t, r, o, a, n) {
648
+ const s = { siteKey: t, tier: r, settings: o };
649
+ return this.post(B.SiteKeyRegister, s, {
650
+ headers: {
651
+ "Prosopo-Site-Key": this.account,
652
+ timestamp: a,
653
+ signature: n
654
+ }
655
+ });
656
+ }
657
+ 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
663
+ }
664
+ });
665
+ }
666
+ 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
672
+ }
673
+ });
674
+ }
675
+ insertUserAccessPolicies(t, r, o) {
676
+ return this.post(N.INSERT_MANY, t, {
677
+ headers: {
678
+ "Prosopo-Site-Key": this.account,
679
+ timestamp: r,
680
+ signature: o
681
+ }
682
+ });
683
+ }
684
+ deleteUserAccessPolicies(t, r, o) {
685
+ return this.post(N.DELETE_MANY, t, {
686
+ headers: {
687
+ "Prosopo-Site-Key": this.account,
688
+ timestamp: r,
689
+ signature: o
690
+ }
691
+ });
692
+ }
693
+ }
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) => {
695
+ const r = await (await pt())(), a = await new (await De(e.web2))().getAccount(e);
696
+ if (!e.account.address)
697
+ 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);
699
+ return {
700
+ captchaType: u.captchaType,
701
+ sessionId: u.sessionId,
702
+ provider: n,
703
+ status: u.status,
704
+ userAccount: a,
705
+ error: u.error
706
+ };
707
+ }, se = (e, t, r, o, a, n) => {
708
+ 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 });
711
+ }, ie = (e) => ({
712
+ loading: !1,
713
+ attemptCount: e || 0
714
+ }), ht = ({ config: e, callbacks: t, restart: r, i18n: o, detectBot: a = ft }) => {
715
+ const n = m.useRef(ie(0)), s = M(t);
716
+ m.useEffect(() => {
717
+ e.language && (o ? o.language !== e.language && o.changeLanguage(e.language).then((h) => h) : Oe().then((h) => {
718
+ h.language !== e.language && h.changeLanguage(e.language).then((l) => l);
719
+ }));
720
+ }, [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);
723
+ }, g = (h, l) => {
724
+ l === "CAPTCHA.NO_SESSION_FOUND" && setTimeout(() => {
725
+ f();
726
+ }, 0), b(se(e.theme, e.mode, h || "Cannot load CAPTCHA", o.isInitialized, o.t, !1));
727
+ }, f = () => {
728
+ setTimeout(() => {
729
+ P(0), s.onReset(), r();
730
+ }, 1e4);
731
+ }, 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 = {
738
+ ...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(() => {
755
+ n.current.attemptCount >= 5 && (g(), f());
756
+ });
757
+ };
758
+ return m.useEffect(() => {
759
+ (async () => {
760
+ await T();
761
+ })();
762
+ }, [e, t, a, e.language]), u;
763
+ }, mt = (e) => {
764
+ const { config: t, callbacks: r, i18n: o } = e, [a, n] = m.useState(0), s = () => {
765
+ n((u) => u + 1);
766
+ };
767
+ return v.jsx(ht, { config: t, callbacks: M(r), restart: s, i18n: o }, a);
768
+ }, yt = (e) => {
769
+ const { config: t, callbacks: r, i18n: o } = e;
770
+ return v.jsx(ve, { config: t, callbacks: M(r), i18n: o });
771
+ }, gt = (e) => {
772
+ const { config: t, callbacks: r, i18n: o } = e;
773
+ return v.jsx(ge, { config: t, callbacks: M(r), i18n: o });
774
+ }, vt = {
775
+ [_.image]: yt,
776
+ [_.pow]: gt,
777
+ [_.frictionless]: mt
778
+ };
779
+ class bt {
780
+ getCaptchaComponent(t, r) {
781
+ if (t === _.invisible)
782
+ throw new Error("Not Implemented");
783
+ const o = vt[t];
784
+ return "rendering ".concat(t), v.jsx(o, { config: r.config, callbacks: r.callbacks, i18n: r.i18n });
785
+ }
786
+ }
787
+ const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
788
+ __proto__: null,
789
+ CaptchaComponentProvider: bt
790
+ }, Symbol.toStringTag, { value: "Module" }));
791
+ export {
792
+ it as C,
793
+ De as E,
794
+ lt as P,
795
+ Ve as a,
796
+ $e as b,
797
+ Ye as c,
798
+ kt as d,
799
+ M as g,
800
+ w as j,
801
+ Le as p
802
+ };