@prosopo/procaptcha-bundle 3.0.12 → 3.1.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.
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +17 -7
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +2 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +6 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -1
- package/CHANGELOG.md +374 -0
- package/dist/bundle/{ProcaptchaWidget-48FxVPQd.js → ProcaptchaWidget-CJ-4hVS1.js} +25 -25
- package/dist/bundle/{ProcaptchaWidget-B2BzhXLv.js → ProcaptchaWidget-Cw3s7cGX.js} +290 -268
- package/dist/bundle/{builder-DNHtDoNG.js → builder-ByZ5z580.js} +3 -1
- package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +1002 -0
- package/dist/bundle/{captchaRenderer-DdOlOCKw.js → captchaRenderer-s4QuLEen.js} +23 -22
- package/dist/bundle/{commonChunk-HCVkoCqn.js → commonChunk-BjvuHlB1.js} +62 -68
- package/dist/bundle/{emotion-element-5486c51c.browser.esm-D7qvHZDV.js → emotion-element-c39617d8.browser.esm-BNNnmykm.js} +343 -345
- package/dist/bundle/index-BuQg3Zno.js +1884 -0
- package/dist/bundle/{index-DyYmvHVN.js → index-DIdd2cUz.js} +1 -1
- package/dist/bundle/{index-C00_J7av.js → index-IgqrmVIs.js} +61 -59
- package/dist/bundle/nobleChunk-Bbltwf44.js +2728 -0
- package/dist/bundle/procaptcha.bundle.js +2 -2
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/dist/bundle/{utilChunk-sqstc6C5.js → utilChunk-DPr6oTOj.js} +22 -22
- package/dist/bundle/{utilCryptoChunk-qm-BM2eT.js → utilCryptoChunk-D6ZLkbFV.js} +176 -167
- package/dist/bundle/{web2Chunk-DCsWA5PR.js → web2Chunk-CNoojUDK.js} +1083 -983
- package/dist/bundle/web3Chunk-BlYvY4Ea.js +525 -0
- package/dist/bundle/{zodChunk-wTu9ZHzV.js → zodChunk-aEfPZzrp.js} +3 -3
- package/dist/cjs/util/captcha/captchaComponentProvider.cjs +3 -2
- package/dist/cjs/util/captcha/captchaRenderer.cjs +4 -3
- package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +4 -3
- package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
- package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
- package/dist/cjs/util/widgetFactory.cjs +7 -2
- package/dist/util/captcha/captchaComponentProvider.js +3 -2
- package/dist/util/captcha/captchaRenderer.js +4 -3
- package/dist/util/captcha/components/frictionlessCaptcha.js +4 -3
- package/dist/util/captcha/components/imageCaptcha.js +1 -1
- package/dist/util/captcha/components/powCaptcha.js +1 -1
- package/dist/util/widgetFactory.js +7 -2
- package/package.json +25 -26
- package/stats.html +1 -1
- package/vite.test.config.ts +3 -2
- package/dist/bundle/captchaComponentProvider-B7Vxx339.js +0 -968
- package/dist/bundle/index-7Xh-Mf8v.js +0 -1318
- package/dist/bundle/nobleChunk-Qozzkbsq.js +0 -3648
- package/dist/bundle/web3Chunk-B8txCqUJ.js +0 -517
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a as
|
|
1
|
+
import { A, a as v, C as W, l as $ } from "./web2Chunk-CNoojUDK.js";
|
|
2
2
|
function N(e) {
|
|
3
3
|
const t = e.getRootNode();
|
|
4
4
|
return (t instanceof ShadowRoot ? t.host : e).closest("form");
|
|
@@ -40,7 +40,7 @@ const l = () => {
|
|
|
40
40
|
},
|
|
41
41
|
onReload: () => {
|
|
42
42
|
}
|
|
43
|
-
}),
|
|
43
|
+
}), d = (e, t, o) => {
|
|
44
44
|
const a = t.getAttribute(`data-${e}`);
|
|
45
45
|
if (a) {
|
|
46
46
|
const n = u(a);
|
|
@@ -53,15 +53,15 @@ const l = () => {
|
|
|
53
53
|
return u(o);
|
|
54
54
|
};
|
|
55
55
|
function H(e, t, o) {
|
|
56
|
-
const a =
|
|
56
|
+
const a = d(
|
|
57
57
|
"callback",
|
|
58
58
|
o,
|
|
59
59
|
e == null ? void 0 : e.callback
|
|
60
60
|
);
|
|
61
|
-
a && (t.onHuman = (
|
|
62
|
-
I(
|
|
61
|
+
a && (t.onHuman = (r) => {
|
|
62
|
+
I(r, o), a(r);
|
|
63
63
|
});
|
|
64
|
-
const n =
|
|
64
|
+
const n = d(
|
|
65
65
|
"chalexpired-callback",
|
|
66
66
|
o,
|
|
67
67
|
e == null ? void 0 : e["chalexpired-callback"]
|
|
@@ -69,7 +69,7 @@ function H(e, t, o) {
|
|
|
69
69
|
n && (t.onChallengeExpired = () => {
|
|
70
70
|
l(), n();
|
|
71
71
|
});
|
|
72
|
-
const c =
|
|
72
|
+
const c = d(
|
|
73
73
|
"expired-callback",
|
|
74
74
|
o,
|
|
75
75
|
e == null ? void 0 : e["expired-callback"]
|
|
@@ -77,45 +77,45 @@ function H(e, t, o) {
|
|
|
77
77
|
c && (t.onExpired = () => {
|
|
78
78
|
l(), c();
|
|
79
79
|
});
|
|
80
|
-
const i =
|
|
80
|
+
const i = d(
|
|
81
81
|
"error-callback",
|
|
82
82
|
o,
|
|
83
83
|
e == null ? void 0 : e["error-callback"]
|
|
84
84
|
);
|
|
85
|
-
i && (t.onError = (
|
|
86
|
-
l(), i(
|
|
85
|
+
i && (t.onError = (r) => {
|
|
86
|
+
l(), i(r);
|
|
87
87
|
});
|
|
88
|
-
const
|
|
88
|
+
const s = d(
|
|
89
89
|
"close-callback",
|
|
90
90
|
o,
|
|
91
91
|
e == null ? void 0 : e["close-callback"]
|
|
92
92
|
);
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
s && (t.onClose = () => {
|
|
94
|
+
s();
|
|
95
95
|
});
|
|
96
|
-
const
|
|
96
|
+
const p = d(
|
|
97
97
|
"open-callback",
|
|
98
98
|
o,
|
|
99
99
|
e == null ? void 0 : e["open-callback"]
|
|
100
100
|
);
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
p && (t.onOpen = () => {
|
|
102
|
+
p();
|
|
103
103
|
});
|
|
104
|
-
const
|
|
104
|
+
const y = d(
|
|
105
105
|
"failed-callback",
|
|
106
106
|
o,
|
|
107
107
|
e == null ? void 0 : e["failed-callback"]
|
|
108
108
|
);
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
y && (t.onFailed = () => {
|
|
110
|
+
y();
|
|
111
111
|
});
|
|
112
|
-
const
|
|
112
|
+
const w = d(
|
|
113
113
|
"reset-callback",
|
|
114
114
|
o,
|
|
115
115
|
e == null ? void 0 : e["reset-callback"]
|
|
116
116
|
);
|
|
117
|
-
|
|
118
|
-
l(),
|
|
117
|
+
w && (t.onReset = () => {
|
|
118
|
+
l(), w();
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
const I = (e, t) => {
|
|
@@ -128,7 +128,7 @@ const I = (e, t) => {
|
|
|
128
128
|
const a = document.createElement("input");
|
|
129
129
|
a.type = "hidden", a.name = A.procaptchaResponse, a.value = e, o.appendChild(a);
|
|
130
130
|
}
|
|
131
|
-
}, P = "https://prosopo.io", T = "Visit prosopo.io to learn more about the service and its accessibility options.", U = 74, x = 80, F = "80px",
|
|
131
|
+
}, P = "https://prosopo.io", T = "Visit prosopo.io to learn more about the service and its accessibility options.", U = 74, x = 80, F = "80px", _ = "302px", G = "8px", j = "2px", z = "1px solid", E = "checkbox__loading-spinner";
|
|
132
132
|
function B(e) {
|
|
133
133
|
const t = document.createElement("div");
|
|
134
134
|
return t.className = "checkbox", t.innerHTML = X(e) + q, t;
|
|
@@ -291,7 +291,7 @@ function O(e) {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
.widget__outer {
|
|
294
|
-
max-width: ${
|
|
294
|
+
max-width: ${_};
|
|
295
295
|
min-height: 100%;
|
|
296
296
|
overflow-x: auto;
|
|
297
297
|
width: 100%;
|
|
@@ -318,7 +318,7 @@ function O(e) {
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
.widget__dimensions {
|
|
321
|
-
max-width: ${
|
|
321
|
+
max-width: ${_};
|
|
322
322
|
min-height: ${x}px;
|
|
323
323
|
}
|
|
324
324
|
|
|
@@ -358,17 +358,17 @@ const ne = (e) => `
|
|
|
358
358
|
${e}
|
|
359
359
|
</style>
|
|
360
360
|
`, ce = (e) => {
|
|
361
|
-
e.style.display = "flex", e.style.flexDirection = "column", e.style.width = "100%", e.style.maxWidth =
|
|
361
|
+
e.style.display = "flex", e.style.flexDirection = "column", e.style.width = "100%", e.style.maxWidth = _;
|
|
362
362
|
};
|
|
363
363
|
function ie(e, t, o) {
|
|
364
364
|
const a = J(t), n = ae(o);
|
|
365
|
-
|
|
365
|
+
re(n).appendChild(a), e.innerHTML = "", e.appendChild(n);
|
|
366
366
|
const i = K(n);
|
|
367
367
|
if (!(i instanceof HTMLElement))
|
|
368
368
|
throw new Error("Fail to initialize widget: interactive area is not found");
|
|
369
|
-
return i;
|
|
369
|
+
return { widgetInteractiveArea: i, webComponent: n };
|
|
370
370
|
}
|
|
371
|
-
const
|
|
371
|
+
const re = (e) => e.shadowRoot || e, g = {
|
|
372
372
|
0: "#fff",
|
|
373
373
|
100: "#f5f5f5",
|
|
374
374
|
200: "#eeeeee",
|
|
@@ -379,7 +379,7 @@ const le = (e) => e.shadowRoot || e, g = {
|
|
|
379
379
|
700: "#616161",
|
|
380
380
|
800: "#424242",
|
|
381
381
|
900: "#212121"
|
|
382
|
-
}, m = 10,
|
|
382
|
+
}, m = 10, le = {
|
|
383
383
|
palette: {
|
|
384
384
|
mode: "light",
|
|
385
385
|
primary: {
|
|
@@ -433,7 +433,7 @@ const le = (e) => e.shadowRoot || e, g = {
|
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
435
|
function R(e) {
|
|
436
|
-
return Object.values(W).find((a) => a ===
|
|
436
|
+
return Object.values(W).find((a) => a === v(e, 0).getAttribute("data-captcha-type")) || "frictionless";
|
|
437
437
|
}
|
|
438
438
|
const k = (e) => document.querySelector('script[src*="'.concat(e, '"]')), de = (e) => {
|
|
439
439
|
const t = k(e);
|
|
@@ -446,7 +446,7 @@ const k = (e) => document.querySelector('script[src*="'.concat(e, '"]')), de = (
|
|
|
446
446
|
}
|
|
447
447
|
return { onloadUrlCallback: void 0, renderExplicit: void 0 };
|
|
448
448
|
};
|
|
449
|
-
class
|
|
449
|
+
class pe {
|
|
450
450
|
constructor(t) {
|
|
451
451
|
this.widgetThemeResolver = t, this.captchaRenderer = null, this._i18n = null;
|
|
452
452
|
}
|
|
@@ -463,29 +463,31 @@ class he {
|
|
|
463
463
|
}
|
|
464
464
|
async createWidget(t, o, a, n = !0, c = !1) {
|
|
465
465
|
o.theme = this.widgetThemeResolver.resolveWidgetTheme(t, o);
|
|
466
|
-
const i = o.theme === "light" ?
|
|
467
|
-
let
|
|
466
|
+
const i = o.theme === "light" ? le : se;
|
|
467
|
+
let s, p;
|
|
468
468
|
if (c) {
|
|
469
|
-
const
|
|
470
|
-
t.appendChild(
|
|
471
|
-
} else
|
|
472
|
-
r = ie(t, i, "prosopo-procaptcha");
|
|
469
|
+
const r = document.createElement("div");
|
|
470
|
+
t.appendChild(r), s = r, p = r;
|
|
471
|
+
} else {
|
|
472
|
+
const r = ie(t, i, "prosopo-procaptcha");
|
|
473
|
+
s = r.widgetInteractiveArea, p = r.webComponent;
|
|
474
|
+
}
|
|
473
475
|
return (await this.getCaptchaRenderer()).renderCaptcha({
|
|
474
476
|
identifierPrefix: "procaptcha-",
|
|
475
477
|
emotionCacheKey: "procaptcha",
|
|
476
478
|
webComponentTag: "prosopo-procaptcha",
|
|
477
479
|
defaultCaptchaType: W.frictionless
|
|
478
|
-
},
|
|
480
|
+
}, s, o, a, n, this.i18n, c, p);
|
|
479
481
|
}
|
|
480
482
|
async getCaptchaRenderer() {
|
|
481
483
|
return this._i18n === null && (this._i18n = await $()), this.captchaRenderer === null && (this.captchaRenderer = await this.createCaptchaRenderer()), this.captchaRenderer;
|
|
482
484
|
}
|
|
483
485
|
async createCaptchaRenderer() {
|
|
484
|
-
const t = (await import("./captchaRenderer-
|
|
486
|
+
const t = (await import("./captchaRenderer-s4QuLEen.js")).CaptchaRenderer, o = (await import("./captchaComponentProvider-Cn75EmSH.js").then((a) => a.d)).CaptchaComponentProvider;
|
|
485
487
|
return new t(new o());
|
|
486
488
|
}
|
|
487
489
|
}
|
|
488
|
-
class
|
|
490
|
+
class he {
|
|
489
491
|
constructor() {
|
|
490
492
|
this.themesSet = /* @__PURE__ */ new Set(["light", "dark"]), this.defaultTheme = "light";
|
|
491
493
|
}
|
|
@@ -498,11 +500,11 @@ class pe {
|
|
|
498
500
|
}
|
|
499
501
|
}
|
|
500
502
|
const C = "procaptcha.bundle.js";
|
|
501
|
-
let
|
|
502
|
-
const b = new
|
|
503
|
+
let h = [];
|
|
504
|
+
const b = new pe(new he()), fe = "procaptcha:execute", S = async () => {
|
|
503
505
|
const e = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() !== "button");
|
|
504
506
|
if (e.length) {
|
|
505
|
-
const o =
|
|
507
|
+
const o = v(e, 0).getAttribute("data-sitekey"), a = v(e, 0).getAttribute("data-web3");
|
|
506
508
|
if (!o) {
|
|
507
509
|
console.error("No siteKey found");
|
|
508
510
|
return;
|
|
@@ -511,7 +513,7 @@ const b = new he(new pe()), fe = "procaptcha:execute", S = async () => {
|
|
|
511
513
|
captchaType: n,
|
|
512
514
|
siteKey: o
|
|
513
515
|
}, a !== "true");
|
|
514
|
-
|
|
516
|
+
h.push(...c);
|
|
515
517
|
}
|
|
516
518
|
const t = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() === "button");
|
|
517
519
|
if (t.length)
|
|
@@ -521,21 +523,21 @@ const b = new he(new pe()), fe = "procaptcha:execute", S = async () => {
|
|
|
521
523
|
siteKey: a,
|
|
522
524
|
callback: n
|
|
523
525
|
}, !0, !0);
|
|
524
|
-
|
|
525
|
-
|
|
526
|
+
h.push(...i), o.addEventListener("click", async (s) => {
|
|
527
|
+
s.preventDefault(), D();
|
|
526
528
|
});
|
|
527
529
|
}
|
|
528
530
|
}, ue = async (e, t) => {
|
|
529
531
|
const o = Object.prototype.hasOwnProperty.call(t, "size") && t.size === "invisible", a = !t.web3;
|
|
530
532
|
if (o || e.tagName.toLowerCase() === "button") {
|
|
531
533
|
const c = await b.createWidgets([e], t, a, !0);
|
|
532
|
-
|
|
534
|
+
h.push(...c);
|
|
533
535
|
return;
|
|
534
536
|
}
|
|
535
537
|
const n = await b.createWidgets([e], t, a, !1);
|
|
536
|
-
|
|
538
|
+
h.push(...n);
|
|
537
539
|
};
|
|
538
|
-
function
|
|
540
|
+
function f(e) {
|
|
539
541
|
document && document.readyState !== "loading" ? e() : document.addEventListener("DOMContentLoaded", () => {
|
|
540
542
|
e();
|
|
541
543
|
});
|
|
@@ -572,28 +574,28 @@ const L = () => {
|
|
|
572
574
|
const { onloadUrlCallback: o, renderExplicit: a } = de(C);
|
|
573
575
|
let n = !1;
|
|
574
576
|
if (a !== "explicit" && ((e = k(C)) == null || e.addEventListener("load", () => {
|
|
575
|
-
|
|
576
|
-
}), document.readyState === "complete" && !n &&
|
|
577
|
+
f(S), n = !0;
|
|
578
|
+
}), document.readyState === "complete" && !n && f(S)), o && ((t = k(C)) == null || t.addEventListener("load", () => {
|
|
577
579
|
const c = u(o);
|
|
578
|
-
|
|
580
|
+
f(c);
|
|
579
581
|
}), document.readyState === "complete" && !n)) {
|
|
580
582
|
const c = u(o);
|
|
581
|
-
|
|
583
|
+
f(c);
|
|
582
584
|
}
|
|
583
585
|
}, me = () => {
|
|
584
|
-
for (const e of
|
|
586
|
+
for (const e of h)
|
|
585
587
|
e.unmount();
|
|
586
|
-
|
|
588
|
+
h = [], L();
|
|
587
589
|
};
|
|
588
|
-
window.procaptcha = { ready:
|
|
590
|
+
window.procaptcha = { ready: f, render: ue, reset: me, execute: D };
|
|
589
591
|
L();
|
|
590
592
|
export {
|
|
591
593
|
E as W,
|
|
592
|
-
|
|
594
|
+
f as a,
|
|
593
595
|
me as b,
|
|
594
596
|
se as d,
|
|
595
597
|
D as e,
|
|
596
598
|
M as g,
|
|
597
|
-
|
|
599
|
+
le as l,
|
|
598
600
|
ue as r
|
|
599
601
|
};
|