@prosopo/procaptcha-bundle 4.1.40 → 4.1.42

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/procaptcha-bundle@4.1.40 build:cjs
2
+ > @prosopo/procaptcha-bundle@4.1.42 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -55,20 +55,24 @@ ViteCommonJSConfig: .
55
55
  '@prosopo/datasets'
56
56
  ]
57
57
  }
58
- vite v6.4.1 building SSR bundle for production...
58
+ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
59
+ vite v8.1.5 building ssr environment for production...
59
60
  Bundle build started
60
- transforming...
61
- Build end
62
- ✓ 9 modules transformed.
63
- Entry module "src/index.ts" is using named and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
61
+ 
62
+ ✓ 10 modules transformed.
64
63
  rendering chunks...
65
- dist/cjs/util/timeout.cjs 0.61 kB
66
- dist/cjs/util/widgetThemeResolver.cjs 0.62 kB
67
- dist/cjs/util/config.cjs 0.76 kB
68
- dist/cjs/util/captcha/components/bundleCaptcha.cjs 0.83 kB
69
- dist/cjs/util/language.cjs 0.89 kB
70
- dist/cjs/util/configCreator.cjs 0.93 kB
71
- dist/cjs/util/captcha/captchaRenderer.cjs 2.21 kB
72
- dist/cjs/util/widgetFactory.cjs 3.08 kB
73
- dist/cjs/index.cjs 5.79 kB
74
- ✓ built in 198ms
64
+ computing gzip size...
65
+ dist/cjs/util/widgetThemeResolver.cjs 0.57 kB │ gzip: 0.29 kB
66
+ dist/cjs/util/timeout.cjs 0.63 kB │ gzip: 0.29 kB
67
+ dist/cjs/util/config.cjs 0.66 kB │ gzip: 0.33 kB
68
+ dist/cjs/util/captcha/components/bundleCaptcha.cjs 0.82 kB │ gzip: 0.39 kB
69
+ dist/cjs/util/configCreator.cjs 0.88 kB │ gzip: 0.46 kB
70
+ dist/cjs/_virtual/_rolldown/runtime.cjs 1.00 kB │ gzip: 0.50 kB
71
+ dist/cjs/util/language.cjs 1.08 kB │ gzip: 0.45 kB
72
+ dist/cjs/util/captcha/captchaRenderer.cjs 2.26 kB │ gzip: 0.78 kB
73
+ dist/cjs/util/widgetFactory.cjs 2.73 kB │ gzip: 0.89 kB
74
+ dist/cjs/index.cjs 5.35 kB │ gzip: 1.66 kB
75
+
76
+ [MIXED_EXPORTS] Entry module "src/index.ts" is using named (including "default", "execute", "render", "reset") and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
77
+ 
78
+ ✓ built in 62ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/procaptcha-bundle@4.1.40 build:tsc
2
+ > @prosopo/procaptcha-bundle@4.1.42 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 10:23:10 PM - Projects in this build:
5
+ 12:36:58 PM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../util/tsconfig.json
8
8
  * ../logger/tsconfig.json
@@ -28,53 +28,53 @@
28
28
  * ../procaptcha-frictionless/tsconfig.json
29
29
  * tsconfig.json
30
30
 
31
- 10:23:10 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
31
+ 12:36:58 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/index.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
32
32
 
33
- 10:23:10 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
33
+ 12:36:58 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
34
34
 
35
- 10:23:10 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
35
+ 12:36:58 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
36
36
 
37
- 10:23:10 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/env.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
37
+ 12:36:58 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/index.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
38
38
 
39
- 10:23:10 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
39
+ 12:36:58 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
40
40
 
41
- 10:23:10 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
41
+ 12:36:58 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
42
42
 
43
- 10:23:10 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
43
+ 12:36:58 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/provider/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
44
44
 
45
- 10:23:10 PM - Project '../detector/tsconfig.json' is up to date because newest input '../detector/src/index.js' is older than output '../detector/tsconfig.tsbuildinfo'
45
+ 12:36:58 PM - Project '../detector/tsconfig.json' is up to date because newest input '../detector/src/index.js' is older than output '../detector/tsconfig.tsbuildinfo'
46
46
 
47
- 10:23:10 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
47
+ 12:36:58 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
48
48
 
49
- 10:23:10 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
49
+ 12:36:58 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
50
50
 
51
- 10:23:10 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
51
+ 12:36:58 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
52
52
 
53
- 10:23:10 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
53
+ 12:36:58 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
54
54
 
55
- 10:23:10 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
55
+ 12:36:58 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/providers.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
56
56
 
57
- 10:23:10 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/index.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
57
+ 12:36:58 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWidget.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
58
58
 
59
- 10:23:11 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
59
+ 12:36:58 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
60
60
 
61
- 10:23:11 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
61
+ 12:36:58 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
62
62
 
63
- 10:23:11 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/reactComponents/Honeypot.tsx' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
63
+ 12:36:58 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/simdReadings.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
64
64
 
65
- 10:23:11 PM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/index.ts' is older than output '../procaptcha-pow/tsconfig.tsbuildinfo'
65
+ 12:36:58 PM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/tests/managerHarness.ts' is older than output '../procaptcha-pow/tsconfig.tsbuildinfo'
66
66
 
67
- 10:23:11 PM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/index.ts' is older than output '../procaptcha-puzzle/tsconfig.tsbuildinfo'
67
+ 12:36:58 PM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/index.ts' is older than output '../procaptcha-puzzle/tsconfig.tsbuildinfo'
68
68
 
69
- 10:23:11 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/dataset.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
69
+ 12:36:58 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/dataset.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
70
70
 
71
- 10:23:11 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/index.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
71
+ 12:36:58 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/index.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
72
72
 
73
- 10:23:11 PM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/index.ts' is older than output '../procaptcha-react/tsconfig.tsbuildinfo'
73
+ 12:36:58 PM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/tests/captchaComponent.unit.test.tsx' is older than output '../procaptcha-react/tsconfig.tsbuildinfo'
74
74
 
75
- 10:23:11 PM - Project '../procaptcha-frictionless/tsconfig.json' is up to date because newest input '../procaptcha-frictionless/src/ProcaptchaFrictionless.tsx' is older than output '../procaptcha-frictionless/tsconfig.tsbuildinfo'
75
+ 12:36:58 PM - Project '../procaptcha-frictionless/tsconfig.json' is up to date because newest input '../procaptcha-frictionless/src/tests/customDetectBotSimd.test.ts' is older than output '../procaptcha-frictionless/tsconfig.tsbuildinfo'
76
76
 
77
- 10:23:11 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
77
+ 12:36:58 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
78
78
 
79
- 10:23:11 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-bundle/tsconfig.json'...
79
+ 12:36:58 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-bundle/tsconfig.json'...
80
80
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/procaptcha-bundle@4.1.40 build
2
+ > @prosopo/procaptcha-bundle@4.1.42 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/procaptcha-bundle@4.1.40 build:cross-env
6
+ > @prosopo/procaptcha-bundle@4.1.42 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -59,19 +59,22 @@ ViteEsmConfig: .
59
59
  '@prosopo/datasets'
60
60
  ]
61
61
  }
62
- vite v6.4.1 building SSR bundle for production...
62
+ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
63
+ vite v8.1.5 building ssr environment for production...
63
64
  Bundle build started
64
- transforming...
65
- Build end
66
- ✓ 9 modules transformed.
65
+ 
66
+ ✓ 10 modules transformed.
67
67
  rendering chunks...
68
- dist/util/timeout.js 0.50 kB
69
- dist/util/widgetThemeResolver.js 0.51 kB
70
- dist/util/config.js 0.63 kB
71
- dist/util/captcha/components/bundleCaptcha.js 0.66 kB
72
- dist/util/language.js 0.77 kB
73
- dist/util/configCreator.js 0.86 kB
74
- dist/util/captcha/captchaRenderer.js 2.04 kB
75
- dist/util/widgetFactory.js 2.90 kB
76
- dist/index.js 5.55 kB
77
- ✓ built in 301ms
68
+ computing gzip size...
69
+ dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
70
+ dist/util/widgetThemeResolver.js 0.55 kB │ gzip: 0.29 kB
71
+ dist/util/timeout.js 0.61 kB │ gzip: 0.29 kB
72
+ dist/util/config.js 0.62 kB │ gzip: 0.33 kB
73
+ dist/util/captcha/components/bundleCaptcha.js 0.68 kB │ gzip: 0.35 kB
74
+ dist/util/configCreator.js 0.86 kB │ gzip: 0.45 kB
75
+ dist/util/language.js 1.01 kB │ gzip: 0.44 kB
76
+ dist/util/captcha/captchaRenderer.js 1.93 kB │ gzip: 0.70 kB
77
+ dist/util/widgetFactory.js 2.52 kB │ gzip: 0.85 kB
78
+ dist/index.js 5.03 kB │ gzip: 1.58 kB
79
+
80
+ ✓ built in 56ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @prosopo/procaptcha-bundle
2
2
 
3
+ ## 4.1.42
4
+ ### Patch Changes
5
+
6
+ - @prosopo/procaptcha-frictionless@2.12.23
7
+
8
+ ## 4.1.41
9
+ ### Patch Changes
10
+
11
+ - e14fce6: chore(deps): bump vite to 6.4.3 and mongoose to 8.24.1, and adjust types for the mongoose 8.24 Document/ObjectId changes
12
+ - Updated dependencies [2c47bb7]
13
+ - Updated dependencies [ab3499c]
14
+ - Updated dependencies [0e1171c]
15
+ - Updated dependencies [103318c]
16
+ - Updated dependencies [4cd9035]
17
+ - Updated dependencies [8fba211]
18
+ - Updated dependencies [270a8d8]
19
+ - Updated dependencies [e14fce6]
20
+ - @prosopo/util@3.3.5
21
+ - @prosopo/procaptcha-common@2.11.18
22
+ - @prosopo/locale@3.2.8
23
+ - @prosopo/types@4.10.0
24
+ - @prosopo/dotenv@3.0.50
25
+ - @prosopo/procaptcha-frictionless@2.12.22
26
+
3
27
  ## 4.1.40
4
28
  ### Patch Changes
5
29
 
@@ -0,0 +1,3 @@
1
+ import "node:module";
2
+ //#endregion
3
+ export {};
@@ -0,0 +1,23 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ exports.__toESM = __toESM;
@@ -1,181 +1,143 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const procaptchaCommon = require("@prosopo/procaptcha-common");
4
- const util = require("@prosopo/util");
5
- const config = require("./util/config.cjs");
6
- const widgetFactory$1 = require("./util/widgetFactory.cjs");
7
- const widgetThemeResolver = require("./util/widgetThemeResolver.cjs");
8
- const BUNDLE_NAMES = ["procaptcha.bundle.iife.js", "procaptcha.bundle.js"];
9
- let procaptchaRoots = [];
10
- const widgetFactory = new widgetFactory$1.WidgetFactory(new widgetThemeResolver.WidgetThemeResolver());
11
- const PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
12
- const PROCAPTCHA_READY_EVENT = "procaptcha:ready";
13
- const implicitRender = async () => {
14
- const elements = Array.from(
15
- document.getElementsByClassName("procaptcha")
16
- ).filter((element) => element.tagName.toLowerCase() !== "button");
17
- if (elements.length) {
18
- const firstElement = util.at(elements, 0);
19
- const siteKey = firstElement.getAttribute("data-sitekey");
20
- const web3 = firstElement.getAttribute("data-web3");
21
- const ipv4 = firstElement.getAttribute("data-ipv4") === "true";
22
- const ipv6 = firstElement.getAttribute("data-ipv6") === "true";
23
- if (!siteKey) {
24
- console.error("No site key found");
25
- return;
26
- }
27
- const root = await widgetFactory.createWidgets(
28
- elements,
29
- {
30
- siteKey,
31
- ipv4,
32
- ipv6
33
- },
34
- !(web3 === "true")
35
- );
36
- procaptchaRoots.push(...root);
37
- }
38
- const invisibleButtons = Array.from(
39
- document.getElementsByClassName("procaptcha")
40
- ).filter((button) => button.tagName.toLowerCase() === "button");
41
- if (invisibleButtons.length) {
42
- for (const button of invisibleButtons) {
43
- const siteKey = button.getAttribute("data-sitekey") || "";
44
- const callback = button.getAttribute("data-callback") || "";
45
- const ipv4 = button.getAttribute("data-ipv4") === "true";
46
- const ipv6 = button.getAttribute("data-ipv6") === "true";
47
- const root = await widgetFactory.createWidgets(
48
- [button],
49
- {
50
- siteKey,
51
- callback,
52
- ipv4,
53
- ipv6
54
- },
55
- true,
56
- true
57
- );
58
- procaptchaRoots.push(...root);
59
- button.addEventListener("click", async (event) => {
60
- event.preventDefault();
61
- execute();
62
- });
63
- }
64
- }
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ const require_config = require("./util/config.cjs");
6
+ const require_widgetFactory = require("./util/widgetFactory.cjs");
7
+ const require_widgetThemeResolver = require("./util/widgetThemeResolver.cjs");
8
+ let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
9
+ let _prosopo_util = require("@prosopo/util");
10
+ //#region src/index.ts
11
+ var BUNDLE_NAMES = ["procaptcha.bundle.iife.js", "procaptcha.bundle.js"];
12
+ var procaptchaRoots = [];
13
+ var widgetFactory = new require_widgetFactory.WidgetFactory(new require_widgetThemeResolver.WidgetThemeResolver());
14
+ var PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
15
+ var PROCAPTCHA_READY_EVENT = "procaptcha:ready";
16
+ var implicitRender = async () => {
17
+ const elements = Array.from(document.getElementsByClassName("procaptcha")).filter((element) => element.tagName.toLowerCase() !== "button");
18
+ if (elements.length) {
19
+ const firstElement = (0, _prosopo_util.at)(elements, 0);
20
+ const siteKey = firstElement.getAttribute("data-sitekey");
21
+ const web3 = firstElement.getAttribute("data-web3");
22
+ const ipv4 = firstElement.getAttribute("data-ipv4") === "true";
23
+ const ipv6 = firstElement.getAttribute("data-ipv6") === "true";
24
+ if (!siteKey) {
25
+ console.error("No site key found");
26
+ return;
27
+ }
28
+ const root = await widgetFactory.createWidgets(elements, {
29
+ siteKey,
30
+ ipv4,
31
+ ipv6
32
+ }, !(web3 === "true"));
33
+ procaptchaRoots.push(...root);
34
+ }
35
+ const invisibleButtons = Array.from(document.getElementsByClassName("procaptcha")).filter((button) => button.tagName.toLowerCase() === "button");
36
+ if (invisibleButtons.length) for (const button of invisibleButtons) {
37
+ const siteKey = button.getAttribute("data-sitekey") || "";
38
+ const callback = button.getAttribute("data-callback") || "";
39
+ const ipv4 = button.getAttribute("data-ipv4") === "true";
40
+ const ipv6 = button.getAttribute("data-ipv6") === "true";
41
+ const root = await widgetFactory.createWidgets([button], {
42
+ siteKey,
43
+ callback,
44
+ ipv4,
45
+ ipv6
46
+ }, true, true);
47
+ procaptchaRoots.push(...root);
48
+ button.addEventListener("click", async (event) => {
49
+ event.preventDefault();
50
+ execute();
51
+ });
52
+ }
65
53
  };
66
- const render = async (element, renderOptions) => {
67
- const hasInvisibleSize = Object.prototype.hasOwnProperty.call(renderOptions, "size") && renderOptions.size === "invisible";
68
- const isWeb2 = !renderOptions.web3;
69
- if (hasInvisibleSize || element.tagName.toLowerCase() === "button") {
70
- const roots2 = await widgetFactory.createWidgets(
71
- [element],
72
- renderOptions,
73
- isWeb2,
74
- true
75
- );
76
- procaptchaRoots.push(...roots2);
77
- return;
78
- }
79
- const roots = await widgetFactory.createWidgets(
80
- [element],
81
- renderOptions,
82
- isWeb2,
83
- false
84
- );
85
- procaptchaRoots.push(...roots);
54
+ var render = async (element, renderOptions) => {
55
+ const hasInvisibleSize = Object.prototype.hasOwnProperty.call(renderOptions, "size") && renderOptions.size === "invisible";
56
+ const isWeb2 = !renderOptions.web3;
57
+ if (hasInvisibleSize || element.tagName.toLowerCase() === "button") {
58
+ const roots = await widgetFactory.createWidgets([element], renderOptions, isWeb2, true);
59
+ procaptchaRoots.push(...roots);
60
+ return;
61
+ }
62
+ const roots = await widgetFactory.createWidgets([element], renderOptions, isWeb2, false);
63
+ procaptchaRoots.push(...roots);
86
64
  };
87
65
  function ready(fn) {
88
- if (document && document.readyState !== "loading") {
89
- console.log("document.readyState ready!");
90
- fn();
91
- } else {
92
- console.log("DOMContentLoaded listener!");
93
- document.addEventListener("DOMContentLoaded", () => {
94
- console.log("DOMContentLoaded fired");
95
- console.log(window);
96
- fn();
97
- });
98
- }
66
+ if (document && document.readyState !== "loading") {
67
+ console.log("document.readyState ready!");
68
+ fn();
69
+ } else {
70
+ console.log("DOMContentLoaded listener!");
71
+ document.addEventListener("DOMContentLoaded", () => {
72
+ console.log("DOMContentLoaded fired");
73
+ console.log(window);
74
+ fn();
75
+ });
76
+ }
99
77
  }
100
- const execute = () => {
101
- const containers = findProcaptchaContainers();
102
- if (containers.length === 0) {
103
- console.error("No Procaptcha containers found for execution");
104
- return;
105
- }
106
- const executeEvent = new CustomEvent(PROCAPTCHA_EXECUTE_EVENT, {
107
- detail: {
108
- containerId: containers[0]?.id || "procaptcha-container",
109
- containerCount: containers.length,
110
- timestamp: Date.now()
111
- },
112
- bubbles: true,
113
- cancelable: true
114
- });
115
- document.dispatchEvent(executeEvent);
78
+ var execute = () => {
79
+ const containers = findProcaptchaContainers();
80
+ if (containers.length === 0) {
81
+ console.error("No Procaptcha containers found for execution");
82
+ return;
83
+ }
84
+ const executeEvent = new CustomEvent(PROCAPTCHA_EXECUTE_EVENT, {
85
+ detail: {
86
+ containerId: containers[0]?.id || "procaptcha-container",
87
+ containerCount: containers.length,
88
+ timestamp: Date.now()
89
+ },
90
+ bubbles: true,
91
+ cancelable: true
92
+ });
93
+ document.dispatchEvent(executeEvent);
116
94
  };
117
95
  function findProcaptchaContainers() {
118
- const containers = [];
119
- const invisibleContainers = Array.from(
120
- document.querySelectorAll('[data-size="invisible"]')
121
- );
122
- containers.push(...invisibleContainers);
123
- const idContainers = Array.from(
124
- document.querySelectorAll(
125
- '#procaptcha-container, [id$="-procaptcha-container"]'
126
- )
127
- );
128
- const classContainers = Array.from(
129
- document.getElementsByClassName("p-procaptcha")
130
- );
131
- containers.push(...classContainers);
132
- for (const container of idContainers) {
133
- if (!containers.includes(container)) {
134
- containers.push(container);
135
- }
136
- }
137
- return containers;
96
+ const containers = [];
97
+ const invisibleContainers = Array.from(document.querySelectorAll("[data-size=\"invisible\"]"));
98
+ containers.push(...invisibleContainers);
99
+ const idContainers = Array.from(document.querySelectorAll("#procaptcha-container, [id$=\"-procaptcha-container\"]"));
100
+ const classContainers = Array.from(document.getElementsByClassName("p-procaptcha"));
101
+ containers.push(...classContainers);
102
+ for (const container of idContainers) if (!containers.includes(container)) containers.push(container);
103
+ return containers;
138
104
  }
139
- const start = () => {
140
- const { onloadUrlCallback, renderExplicit } = config.extractParams(BUNDLE_NAMES);
141
- let readyCalled = false;
142
- if (renderExplicit !== "explicit") {
143
- config.getProcaptchaScript(BUNDLE_NAMES)?.addEventListener("load", () => {
144
- ready(implicitRender);
145
- readyCalled = true;
146
- });
147
- if (document.readyState === "complete" && !readyCalled) {
148
- ready(implicitRender);
149
- }
150
- }
151
- if (onloadUrlCallback) {
152
- config.getProcaptchaScript(BUNDLE_NAMES)?.addEventListener("load", () => {
153
- const onloadCallback = procaptchaCommon.getWindowCallback(onloadUrlCallback);
154
- ready(onloadCallback);
155
- });
156
- if (document.readyState === "complete" && !readyCalled) {
157
- const onloadCallback = procaptchaCommon.getWindowCallback(onloadUrlCallback);
158
- ready(onloadCallback);
159
- }
160
- }
105
+ var start = () => {
106
+ const { onloadUrlCallback, renderExplicit } = require_config.extractParams(BUNDLE_NAMES);
107
+ let readyCalled = false;
108
+ if (renderExplicit !== "explicit") {
109
+ require_config.getProcaptchaScript(BUNDLE_NAMES)?.addEventListener("load", () => {
110
+ ready(implicitRender);
111
+ readyCalled = true;
112
+ });
113
+ if (document.readyState === "complete" && !readyCalled) ready(implicitRender);
114
+ }
115
+ if (onloadUrlCallback) {
116
+ require_config.getProcaptchaScript(BUNDLE_NAMES)?.addEventListener("load", () => {
117
+ ready((0, _prosopo_procaptcha_common.getWindowCallback)(onloadUrlCallback));
118
+ });
119
+ if (document.readyState === "complete" && !readyCalled) ready((0, _prosopo_procaptcha_common.getWindowCallback)(onloadUrlCallback));
120
+ }
121
+ };
122
+ var reset = () => {
123
+ for (const root of procaptchaRoots) root.unmount();
124
+ procaptchaRoots = [];
125
+ start();
161
126
  };
162
- const reset = () => {
163
- for (const root of procaptchaRoots) {
164
- root.unmount();
165
- }
166
- procaptchaRoots = [];
167
- start();
127
+ window.procaptcha = {
128
+ ready,
129
+ render,
130
+ reset,
131
+ execute
168
132
  };
169
- window.procaptcha = { ready, render, reset, execute };
170
- const procaptchaReadyEvent = new CustomEvent(PROCAPTCHA_READY_EVENT, {
171
- detail: {
172
- timestamp: Date.now()
173
- },
174
- bubbles: true,
175
- cancelable: false
133
+ var procaptchaReadyEvent = new CustomEvent(PROCAPTCHA_READY_EVENT, {
134
+ detail: { timestamp: Date.now() },
135
+ bubbles: true,
136
+ cancelable: false
176
137
  });
177
138
  document.dispatchEvent(procaptchaReadyEvent);
178
139
  start();
140
+ //#endregion
179
141
  exports.default = ready;
180
142
  exports.execute = execute;
181
143
  exports.render = render;