@myrasec/eu-captcha 0.0.10 → 0.0.11
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.
Potentially problematic release.
This version of @myrasec/eu-captcha might be problematic. Click here for more details.
- package/README.md +69 -50
- package/dist/eu-captcha.js +51 -47
- package/dist/eu-captcha.umd.cjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,82 +1,101 @@
|
|
|
1
|
-
This package provides an easy integration of Myra Security
|
|
1
|
+
This package provides an easy integration of EU Captcha from Myra Security.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The package can be use with and without react.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## With react
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Proceed as follows:
|
|
8
8
|
|
|
9
|
-
(
|
|
9
|
+
(1) Install the package.
|
|
10
|
+
```
|
|
11
|
+
npm i @myrasec/eu-captcha
|
|
12
|
+
```
|
|
10
13
|
|
|
11
|
-
(
|
|
14
|
+
(2) Add the code below in your code:
|
|
12
15
|
|
|
13
|
-
```
|
|
14
|
-
import { EuCaptcha, isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
16
|
+
```
|
|
17
|
+
import { EuCaptcha, isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
15
18
|
|
|
16
|
-
// use the public
|
|
17
|
-
const captchaSitekey = "YOUR-SITEKEY-HERE";
|
|
18
|
-
```
|
|
19
|
+
// Here use the public site key which can be found in the backend of the customer.
|
|
20
|
+
const captchaSitekey = "YOUR-SITEKEY-HERE";
|
|
21
|
+
```
|
|
19
22
|
|
|
20
|
-
(
|
|
23
|
+
(3) Render the widget with the syntax below.
|
|
21
24
|
|
|
22
|
-
```
|
|
23
|
-
<EuCaptcha sitekey={captchaSitekey} />
|
|
24
|
-
```
|
|
25
|
+
```
|
|
26
|
+
<EuCaptcha sitekey={captchaSitekey} />
|
|
27
|
+
```
|
|
25
28
|
|
|
26
|
-
You can test the integration using any fake
|
|
27
|
-
does not exist,
|
|
28
|
-
allow traffic to pass.
|
|
29
|
+
You can test the integration using any fake site key.
|
|
30
|
+
If a site key does not exist, the captcha runs with default parameters and all traffic will be passed.
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
You can also set additional properties: theme, width
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
To switch between light/dark theme:
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
```
|
|
37
|
+
<EuCaptcha sitekey={captchaSitekey} theme="dark" />
|
|
38
|
+
```
|
|
35
39
|
|
|
36
|
-
(
|
|
40
|
+
To define the width of the widget (default is 330). Please specify a number.
|
|
37
41
|
|
|
38
|
-
```
|
|
39
|
-
|
|
42
|
+
```
|
|
43
|
+
<EuCaptcha sitekey={captchaSitekey} width=280 />
|
|
44
|
+
```
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
```
|
|
46
|
+
## Without react
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
To use the package without react, you can use the libary as described below.
|
|
45
49
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
Proceed as follows:
|
|
51
|
+
|
|
52
|
+
(1) Install the package.
|
|
53
|
+
```
|
|
54
|
+
npm i @myrasec/eu-captcha
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
(1) Load the JS components asynchronously as descibe below.
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
import { loadEuCaptcha, isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
61
|
+
|
|
62
|
+
loadEuCaptcha();
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
(2) Add the <div> tag to a form of your website manually where the EU CAPTCHA should appear.
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
<div class="eu-captcha" data-sitekey="YOUR-SITEKEY-HERE"></div>
|
|
69
|
+
```
|
|
49
70
|
|
|
50
71
|
## Querying state
|
|
51
72
|
|
|
52
|
-
|
|
73
|
+
Make sure that EU Captcha is done before submitting a form to a server.
|
|
53
74
|
|
|
54
|
-
```
|
|
55
|
-
import { isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
75
|
+
```
|
|
76
|
+
import { isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
56
77
|
|
|
57
|
-
function onSubmit(e) {
|
|
58
|
-
|
|
78
|
+
function onSubmit(e) {
|
|
79
|
+
e.preventDefault();
|
|
59
80
|
|
|
60
|
-
|
|
61
|
-
|
|
81
|
+
if (!isEuCaptchaDone()) {
|
|
82
|
+
// computation has not been completed
|
|
62
83
|
|
|
63
|
-
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
64
86
|
}
|
|
65
|
-
|
|
66
|
-
```
|
|
87
|
+
```
|
|
67
88
|
|
|
68
89
|
## Listening to state change
|
|
69
90
|
|
|
70
|
-
Additionally, a message
|
|
71
|
-
set to 'euCaptchaDone', in case you want to be informed actively to change
|
|
72
|
-
e.g. the state of a button.
|
|
91
|
+
Additionally, in case you want to be informed actively to changes, such as the status of a button, a message can be displayed in the main window with msg.data.type set to 'euCaptchaDone'.
|
|
73
92
|
|
|
74
|
-
```
|
|
75
|
-
function listenForCaptchaDone(msg: MessageEvent) {
|
|
76
|
-
|
|
77
|
-
|
|
93
|
+
```
|
|
94
|
+
function listenForCaptchaDone(msg: MessageEvent) {
|
|
95
|
+
if (msg.data.type === 'euCaptchaDone') {
|
|
96
|
+
// Changes the status of the form, etc.
|
|
97
|
+
}
|
|
78
98
|
}
|
|
79
|
-
}
|
|
80
99
|
|
|
81
|
-
window.addEventListener("message", listenForCaptchaDone, false);
|
|
82
|
-
```
|
|
100
|
+
window.addEventListener("message", listenForCaptchaDone, false);
|
|
101
|
+
```
|
package/dist/eu-captcha.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import ae, { useState as oe, useEffect as le } from "react";
|
|
2
|
-
var
|
|
2
|
+
var v = { exports: {} }, E = {};
|
|
3
3
|
var M;
|
|
4
4
|
function se() {
|
|
5
5
|
if (M) return E;
|
|
6
6
|
M = 1;
|
|
7
|
-
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
8
|
-
function c(
|
|
7
|
+
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), s = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function c(l, u, i) {
|
|
9
9
|
var d = null;
|
|
10
10
|
if (i !== void 0 && (d = "" + i), u.key !== void 0 && (d = "" + u.key), "key" in u) {
|
|
11
11
|
i = {};
|
|
@@ -14,13 +14,13 @@ function se() {
|
|
|
14
14
|
} else i = u;
|
|
15
15
|
return u = i.ref, {
|
|
16
16
|
$$typeof: t,
|
|
17
|
-
type:
|
|
17
|
+
type: l,
|
|
18
18
|
key: d,
|
|
19
19
|
ref: u !== void 0 ? u : null,
|
|
20
20
|
props: i
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return E.Fragment =
|
|
23
|
+
return E.Fragment = s, E.jsx = c, E.jsxs = c, E;
|
|
24
24
|
}
|
|
25
25
|
var _ = {};
|
|
26
26
|
var W;
|
|
@@ -32,7 +32,7 @@ function ue() {
|
|
|
32
32
|
return e.$$typeof === re ? null : e.displayName || e.name || null;
|
|
33
33
|
if (typeof e == "string") return e;
|
|
34
34
|
switch (e) {
|
|
35
|
-
case
|
|
35
|
+
case k:
|
|
36
36
|
return "Fragment";
|
|
37
37
|
case G:
|
|
38
38
|
return "Profiler";
|
|
@@ -60,7 +60,7 @@ function ue() {
|
|
|
60
60
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
61
|
case K:
|
|
62
62
|
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
63
|
-
case
|
|
63
|
+
case y:
|
|
64
64
|
r = e._payload, e = e._init;
|
|
65
65
|
try {
|
|
66
66
|
return t(e(r));
|
|
@@ -69,12 +69,12 @@ function ue() {
|
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function s(e) {
|
|
73
73
|
return "" + e;
|
|
74
74
|
}
|
|
75
75
|
function c(e) {
|
|
76
76
|
try {
|
|
77
|
-
|
|
77
|
+
s(e);
|
|
78
78
|
var r = !1;
|
|
79
79
|
} catch {
|
|
80
80
|
r = !0;
|
|
@@ -86,12 +86,12 @@ function ue() {
|
|
|
86
86
|
r,
|
|
87
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
88
|
a
|
|
89
|
-
),
|
|
89
|
+
), s(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
if (e ===
|
|
94
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
92
|
+
function l(e) {
|
|
93
|
+
if (e === k) return "<>";
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === y)
|
|
95
95
|
return "<...>";
|
|
96
96
|
try {
|
|
97
97
|
var r = t(e);
|
|
@@ -132,7 +132,7 @@ function ue() {
|
|
|
132
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
134
|
}
|
|
135
|
-
function J(e, r, n, a,
|
|
135
|
+
function J(e, r, n, a, p, S) {
|
|
136
136
|
var o = n.ref;
|
|
137
137
|
return e = {
|
|
138
138
|
$$typeof: N,
|
|
@@ -157,15 +157,15 @@ function ue() {
|
|
|
157
157
|
configurable: !1,
|
|
158
158
|
enumerable: !1,
|
|
159
159
|
writable: !0,
|
|
160
|
-
value:
|
|
160
|
+
value: p
|
|
161
161
|
}), Object.defineProperty(e, "_debugTask", {
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
165
|
+
value: S
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function j(e, r, n, a,
|
|
168
|
+
function j(e, r, n, a, p, S) {
|
|
169
169
|
var o = r.children;
|
|
170
170
|
if (o !== void 0)
|
|
171
171
|
if (a)
|
|
@@ -209,29 +209,29 @@ React keys must be passed directly to JSX without using spread:
|
|
|
209
209
|
o,
|
|
210
210
|
n,
|
|
211
211
|
u(),
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
p,
|
|
213
|
+
S
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
function x(e) {
|
|
217
|
-
C(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof ===
|
|
217
|
+
C(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === y && (e._payload.status === "fulfilled" ? C(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
218
|
}
|
|
219
219
|
function C(e) {
|
|
220
220
|
return typeof e == "object" && e !== null && e.$$typeof === N;
|
|
221
221
|
}
|
|
222
|
-
var
|
|
222
|
+
var b = ae, N = /* @__PURE__ */ Symbol.for("react.transitional.element"), V = /* @__PURE__ */ Symbol.for("react.portal"), k = /* @__PURE__ */ Symbol.for("react.fragment"), z = /* @__PURE__ */ Symbol.for("react.strict_mode"), G = /* @__PURE__ */ Symbol.for("react.profiler"), X = /* @__PURE__ */ Symbol.for("react.consumer"), H = /* @__PURE__ */ Symbol.for("react.context"), B = /* @__PURE__ */ Symbol.for("react.forward_ref"), Z = /* @__PURE__ */ Symbol.for("react.suspense"), Q = /* @__PURE__ */ Symbol.for("react.suspense_list"), K = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), ee = /* @__PURE__ */ Symbol.for("react.activity"), re = /* @__PURE__ */ Symbol.for("react.client.reference"), g = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, te = Array.isArray, w = console.createTask ? console.createTask : function() {
|
|
223
223
|
return null;
|
|
224
224
|
};
|
|
225
|
-
|
|
225
|
+
b = {
|
|
226
226
|
react_stack_bottom_frame: function(e) {
|
|
227
227
|
return e();
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
|
-
var $, F = {}, I =
|
|
231
|
-
|
|
230
|
+
var $, F = {}, I = b.react_stack_bottom_frame.bind(
|
|
231
|
+
b,
|
|
232
232
|
i
|
|
233
|
-
)(), L =
|
|
234
|
-
_.Fragment =
|
|
233
|
+
)(), L = w(l(i)), D = {};
|
|
234
|
+
_.Fragment = k, _.jsx = function(e, r, n) {
|
|
235
235
|
var a = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
236
236
|
return j(
|
|
237
237
|
e,
|
|
@@ -239,7 +239,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
239
239
|
n,
|
|
240
240
|
!1,
|
|
241
241
|
a ? Error("react-stack-top-frame") : I,
|
|
242
|
-
a ?
|
|
242
|
+
a ? w(l(e)) : L
|
|
243
243
|
);
|
|
244
244
|
}, _.jsxs = function(e, r, n) {
|
|
245
245
|
var a = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
@@ -249,51 +249,55 @@ React keys must be passed directly to JSX without using spread:
|
|
|
249
249
|
n,
|
|
250
250
|
!0,
|
|
251
251
|
a ? Error("react-stack-top-frame") : I,
|
|
252
|
-
a ?
|
|
252
|
+
a ? w(l(e)) : L
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
255
|
})()), _;
|
|
256
256
|
}
|
|
257
257
|
var U;
|
|
258
258
|
function ie() {
|
|
259
|
-
return U || (U = 1, process.env.NODE_ENV === "production" ?
|
|
259
|
+
return U || (U = 1, process.env.NODE_ENV === "production" ? v.exports = se() : v.exports = ue()), v.exports;
|
|
260
260
|
}
|
|
261
261
|
var P = ie();
|
|
262
|
-
let
|
|
262
|
+
let R = {
|
|
263
263
|
done: !1,
|
|
264
264
|
registered: !1
|
|
265
|
-
},
|
|
265
|
+
}, T = !1, A = null, h = null;
|
|
266
266
|
function ce(t) {
|
|
267
|
-
return typeof window > "u" ? Promise.reject("Cannot load script on server") :
|
|
267
|
+
return typeof window > "u" ? Promise.reject("Cannot load script on server") : h || (h = new Promise((s, c) => {
|
|
268
268
|
if (document.querySelector(`script[src="${t}"]`)) {
|
|
269
|
-
|
|
269
|
+
s();
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
}),
|
|
272
|
+
const l = document.createElement("script");
|
|
273
|
+
l.src = t, l.async = !0, l.onload = () => s(), l.onerror = () => c(new Error(`Failed to load ${t}`)), document.head.appendChild(l);
|
|
274
|
+
}), h);
|
|
275
275
|
}
|
|
276
276
|
function fe(t) {
|
|
277
|
-
t.data.type === "euCaptchaCompleted" && (
|
|
277
|
+
t.data.type === "euCaptchaCompleted" && (R.done = !0);
|
|
278
|
+
}
|
|
279
|
+
function Ee() {
|
|
280
|
+
return R.done;
|
|
278
281
|
}
|
|
279
282
|
function de(t) {
|
|
280
283
|
t = t || {}, typeof t.sitekey == "string" && t.sitekey, typeof t.locale == "string" && t.locale, ce("https://cdn.eu-captcha.eu/verify.js").then(() => {
|
|
281
|
-
A && A(!0),
|
|
282
|
-
}).catch((
|
|
283
|
-
console.error("error during load of eu captcha library: " +
|
|
284
|
+
A && A(!0), R.registered || (R.registered = !0, window.addEventListener("message", fe, !1));
|
|
285
|
+
}).catch((s) => {
|
|
286
|
+
console.error("error during load of eu captcha library: " + s);
|
|
284
287
|
});
|
|
285
288
|
}
|
|
286
|
-
function
|
|
287
|
-
if ([
|
|
289
|
+
function _e(t) {
|
|
290
|
+
if ([T, A] = oe(T), t && t.sitekey && de({
|
|
288
291
|
sitekey: t.sitekey
|
|
289
292
|
}), le(() => {
|
|
290
|
-
}, [
|
|
293
|
+
}, [T]), !T)
|
|
291
294
|
return /* @__PURE__ */ P.jsx(P.Fragment, { children: " " });
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
return /* @__PURE__ */ P.jsx("div", { dangerouslySetInnerHTML: { __html:
|
|
295
|
+
R.done = !1;
|
|
296
|
+
const s = t.theme ?? "light", c = t.width ?? "330", l = window.getEuCaptchaElement(t.sitekey, s, c);
|
|
297
|
+
return /* @__PURE__ */ P.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
|
|
295
298
|
}
|
|
296
299
|
export {
|
|
297
|
-
|
|
300
|
+
_e as EuCaptcha,
|
|
301
|
+
Ee as isEuCaptchaDone,
|
|
298
302
|
de as loadEuCaptcha
|
|
299
303
|
};
|
package/dist/eu-captcha.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(c,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],d):(c=typeof globalThis<"u"?globalThis:c||self,d(c["@myra/eu-captcha"]={},c.React))})(this,(function(c,d){"use strict";var v={exports:{}},E={};var C;function z(){if(C)return E;C=1;var t=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function f(s,l,i){var b=null;if(i!==void 0&&(b=""+i),l.key!==void 0&&(b=""+l.key),"key"in l){i={};for(var R in l)R!=="key"&&(i[R]=l[R])}else i=l;return l=i.ref,{$$typeof:t,type:s,key:b,ref:l!==void 0?l:null,props:i}}return E.Fragment=u,E.jsx=f,E.jsxs=f,E}var _={};var N;function G(){return N||(N=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case ne:return"Profiler";case te:return"StrictMode";case ue:return"Suspense";case le:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case re:return"Portal";case oe:return e.displayName||"Context";case ae:return(e._context.displayName||"Context")+".Consumer";case se:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return r=e.displayName||null,r!==null?r:t(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return t(e(r))}catch{}}return null}function u(e){return""+e}function f(e){try{u(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),u(e)}}function s(e){if(e===w)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=t(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function l(){var e=P.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function b(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function R(e,r){function n(){W||(W=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function K(){var e=t(this.type);return U[e]||(U[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function ee(e,r,n,a,k,A){var o=n.ref;return e={$$typeof:M,type:e,key:r,props:n,_owner:a},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:K}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:k}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function I(e,r,n,a,k,A){var o=r.children;if(o!==void 0)if(a)if(de(o)){for(a=0;a<o.length;a++)D(o[a]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else D(o);if($.call(r,"key")){o=t(e);var m=Object.keys(r).filter(function(me){return me!=="key"});a=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",q[o+a]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,a,o,m,o),q[o+a]=!0)}if(o=null,n!==void 0&&(
|
|
6
|
+
<%s key={someKey} {...props} />`,a,o,m,o),q[o+a]=!0)}if(o=null,n!==void 0&&(f(n),o=""+n),b(r)&&(f(r.key),o=""+r.key),"key"in r){n={};for(var x in r)x!=="key"&&(n[x]=r[x])}else n=r;return o&&R(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),ee(e,o,n,l(),k,A)}function D(e){L(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?L(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function L(e){return typeof e=="object"&&e!==null&&e.$$typeof===M}var y=d,M=Symbol.for("react.transitional.element"),re=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),te=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),oe=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),fe=Symbol.for("react.client.reference"),P=y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,de=Array.isArray,j=console.createTask?console.createTask:function(){return null};y={react_stack_bottom_frame:function(e){return e()}};var W,U={},J=y.react_stack_bottom_frame.bind(y,i)(),V=j(s(i)),q={};_.Fragment=w,_.jsx=function(e,r,n){var a=1e4>P.recentlyCreatedOwnerStacks++;return I(e,r,n,!1,a?Error("react-stack-top-frame"):J,a?j(s(e)):V)},_.jsxs=function(e,r,n){var a=1e4>P.recentlyCreatedOwnerStacks++;return I(e,r,n,!0,a?Error("react-stack-top-frame"):J,a?j(s(e)):V)}})()),_}var Y;function X(){return Y||(Y=1,process.env.NODE_ENV==="production"?v.exports=z():v.exports=G()),v.exports}var S=X();let p={done:!1,registered:!1},T=!1,g=null,h=null;function H(t){return typeof window>"u"?Promise.reject("Cannot load script on server"):h||(h=new Promise((u,f)=>{if(document.querySelector(`script[src="${t}"]`)){u();return}const s=document.createElement("script");s.src=t,s.async=!0,s.onload=()=>u(),s.onerror=()=>f(new Error(`Failed to load ${t}`)),document.head.appendChild(s)}),h)}function B(t){t.data.type==="euCaptchaCompleted"&&(p.done=!0)}function Z(){return p.done}function F(t){t=t||{},typeof t.sitekey=="string"&&t.sitekey,typeof t.locale=="string"&&t.locale,H("https://cdn.eu-captcha.eu/verify.js").then(()=>{g&&g(!0),p.registered||(p.registered=!0,window.addEventListener("message",B,!1))}).catch(u=>{console.error("error during load of eu captcha library: "+u)})}function Q(t){if([T,g]=d.useState(T),t&&t.sitekey&&F({sitekey:t.sitekey}),d.useEffect(()=>{},[T]),!T)return S.jsx(S.Fragment,{children:" "});p.done=!1;const u=t.theme??"light",f=t.width??"330",s=window.getEuCaptchaElement(t.sitekey,u,f);return S.jsx("div",{dangerouslySetInnerHTML:{__html:s}})}c.EuCaptcha=Q,c.isEuCaptchaDone=Z,c.loadEuCaptcha=F,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
|