@prosopo/procaptcha-react 0.2.39 → 0.2.40

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 (67) hide show
  1. package/dist/cjs/components/CaptchaWidget.cjs +3 -1
  2. package/dist/cjs/components/Modal.cjs +6 -25
  3. package/dist/cjs/style/Modal.css +41 -0
  4. package/dist/components/Button.js +65 -55
  5. package/dist/components/CaptchaComponent.js +156 -59
  6. package/dist/components/CaptchaPlaceholder.js +97 -42
  7. package/dist/components/CaptchaWidget.js +144 -65
  8. package/dist/components/Checkbox.js +45 -31
  9. package/dist/components/ExtensionAccountSelect.js +47 -30
  10. package/dist/components/LoadingSpinner.js +12 -10
  11. package/dist/components/Modal.js +16 -34
  12. package/dist/components/Procaptcha.js +8 -7
  13. package/dist/components/ProcaptchaWidget.js +221 -130
  14. package/dist/components/collector.js +24 -23
  15. package/dist/components/index.js +11 -7
  16. package/dist/components/theme.js +38 -35
  17. package/dist/index.d.ts +42 -3
  18. package/dist/index.js +12 -3
  19. package/dist/style/Modal.css +41 -0
  20. package/dist/util/index.js +12 -7
  21. package/package.json +9 -8
  22. package/public/style/Modal.css +41 -0
  23. package/vite.config.ts +22 -0
  24. package/dist/components/Button.d.ts +0 -10
  25. package/dist/components/Button.d.ts.map +0 -1
  26. package/dist/components/Button.js.map +0 -1
  27. package/dist/components/CaptchaComponent.d.ts +0 -14
  28. package/dist/components/CaptchaComponent.d.ts.map +0 -1
  29. package/dist/components/CaptchaComponent.js.map +0 -1
  30. package/dist/components/CaptchaPlaceholder.d.ts +0 -6
  31. package/dist/components/CaptchaPlaceholder.d.ts.map +0 -1
  32. package/dist/components/CaptchaPlaceholder.js.map +0 -1
  33. package/dist/components/CaptchaWidget.d.ts +0 -9
  34. package/dist/components/CaptchaWidget.d.ts.map +0 -1
  35. package/dist/components/CaptchaWidget.js.map +0 -1
  36. package/dist/components/Checkbox.d.ts +0 -9
  37. package/dist/components/Checkbox.d.ts.map +0 -1
  38. package/dist/components/Checkbox.js.map +0 -1
  39. package/dist/components/ExtensionAccountSelect.d.ts +0 -7
  40. package/dist/components/ExtensionAccountSelect.d.ts.map +0 -1
  41. package/dist/components/ExtensionAccountSelect.js.map +0 -1
  42. package/dist/components/LoadingSpinner.d.ts +0 -6
  43. package/dist/components/LoadingSpinner.d.ts.map +0 -1
  44. package/dist/components/LoadingSpinner.js.map +0 -1
  45. package/dist/components/Modal.d.ts +0 -8
  46. package/dist/components/Modal.d.ts.map +0 -1
  47. package/dist/components/Modal.js.map +0 -1
  48. package/dist/components/Procaptcha.d.ts +0 -6
  49. package/dist/components/Procaptcha.d.ts.map +0 -1
  50. package/dist/components/Procaptcha.js.map +0 -1
  51. package/dist/components/ProcaptchaWidget.d.ts +0 -8
  52. package/dist/components/ProcaptchaWidget.d.ts.map +0 -1
  53. package/dist/components/ProcaptchaWidget.js.map +0 -1
  54. package/dist/components/collector.d.ts +0 -8
  55. package/dist/components/collector.d.ts.map +0 -1
  56. package/dist/components/collector.js.map +0 -1
  57. package/dist/components/index.d.ts +0 -7
  58. package/dist/components/index.d.ts.map +0 -1
  59. package/dist/components/index.js.map +0 -1
  60. package/dist/components/theme.d.ts +0 -51
  61. package/dist/components/theme.d.ts.map +0 -1
  62. package/dist/components/theme.js.map +0 -1
  63. package/dist/index.d.ts.map +0 -1
  64. package/dist/index.js.map +0 -1
  65. package/dist/util/index.d.ts +0 -9
  66. package/dist/util/index.d.ts.map +0 -1
  67. package/dist/util/index.js.map +0 -1
@@ -64,8 +64,10 @@ const CaptchaWidget = ({ challenge, solution, onClick, themeColor }) => {
64
64
  // removes whitespace below imgs
65
65
  objectFit: "contain",
66
66
  // contain the entire image in the img tag
67
- aspectRatio: "1/1"
67
+ aspectRatio: "1/1",
68
68
  // force AR to be 1, letterboxing images with different aspect ratios
69
+ height: "auto"
70
+ // make the img tag responsive to its container
69
71
  },
70
72
  src: item.data,
71
73
  alt: `Captcha image ${index + 1}`
@@ -1,36 +1,17 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
+ require("../style/Modal.css");
3
4
  const React = require("react");
4
5
  const ModalComponent = React.memo((props, nextProps) => {
5
6
  const { show, children } = props;
6
7
  console.log("rendering modal with show: ", show);
7
- const display = show ? "flex" : "none";
8
+ const display = show ? "block" : "none";
8
9
  const ModalOuterDivCss = {
9
- overflow: "auto",
10
- width: "100%",
11
- maxHeight: "100%",
12
- position: "fixed",
13
- top: "0",
14
- left: "0",
15
- height: "100%",
16
- background: "rgba(0, 0, 0, 0.6)",
17
- zIndex: "2147483646",
18
- transition: "all 0.5s",
19
10
  display
20
11
  };
21
- const ModalInnerDivCSS = {
22
- maxWidth: "500px",
23
- margin: "auto",
24
- position: "fixed",
25
- background: "white",
26
- height: "100%",
27
- maxHeight: "100%",
28
- top: "50%",
29
- left: "50%",
30
- transform: "translate(-50%, -50%)",
31
- zIndex: "2147483647",
32
- transition: "all 0.5s"
33
- };
34
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style: ModalOuterDivCss, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: ModalInnerDivCSS, children }) });
12
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modalOuter", style: ModalOuterDivCss, children: [
13
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalBackground" }),
14
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modalInner", children })
15
+ ] });
35
16
  });
36
17
  module.exports = ModalComponent;
@@ -0,0 +1,41 @@
1
+ .modalOuter {
2
+ position: fixed;
3
+ z-index: 1300;
4
+ inset: 0;
5
+ }
6
+
7
+ .modalBackground {
8
+ position: fixed;
9
+ display: -webkit-box;
10
+ display: -webkit-flex;
11
+ display: -ms-flexbox;
12
+ display: flex;
13
+ -webkit-align-items: center;
14
+ -webkit-box-align: center;
15
+ -ms-flex-align: center;
16
+ align-items: center;
17
+ -webkit-box-pack: center;
18
+ -ms-flex-pack: center;
19
+ -webkit-justify-content: center;
20
+ justify-content: center;
21
+ right: 0;
22
+ bottom: 0;
23
+ top: 0;
24
+ left: 0;
25
+ background-color: rgba(0, 0, 0, 0.5);
26
+ -webkit-tap-highlight-color: transparent;
27
+ z-index: -1;
28
+ }
29
+ .modalInner {
30
+ position: absolute;
31
+ top: 50%;
32
+ left: 50%;
33
+ transform: translate(-50%, -50%);
34
+ width: 400px;
35
+ background-color: rgb(255, 255, 255);
36
+ border: none;
37
+ box-shadow:
38
+ rgba(0, 0, 0, 0.2) 0px 11px 15px -7px,
39
+ rgba(0, 0, 0, 0.14) 0px 24px 38px 3px,
40
+ rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
41
+ }
@@ -1,59 +1,69 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { darkTheme, lightTheme } from './theme.js';
3
- import { useMemo, useState } from 'react';
4
- import addDataAttr from '../util/index.js';
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { lightTheme, darkTheme } from "./theme.js";
3
+ import { useMemo, useState } from "react";
4
+ import addDataAttr from "../util/index.js";
5
5
  const buttonStyleBase = {
6
- display: 'inline-flex',
7
- alignItems: 'center',
8
- justifyContent: 'center',
9
- position: 'relative',
10
- boxSizing: 'border-box',
11
- outline: '0px',
12
- border: '0px',
13
- margin: '0px',
14
- cursor: 'pointer',
15
- userSelect: 'none',
16
- verticalAlign: 'middle',
17
- appearance: undefined,
18
- textDecoration: 'none',
19
- fontWeight: '500',
20
- fontSize: '0.875rem',
21
- lineHeight: '1.75',
22
- letterSpacing: '0.02857em',
23
- textTransform: 'uppercase',
24
- minWidth: '64px',
25
- padding: '6px 16px',
26
- borderRadius: '4px',
27
- transition: 'background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
28
- color: 'rgb(0, 0, 0)',
29
- backgroundColor: '#ffffff',
30
- boxShadow: 'rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px',
6
+ display: "inline-flex",
7
+ alignItems: "center",
8
+ justifyContent: "center",
9
+ position: "relative",
10
+ boxSizing: "border-box",
11
+ outline: "0px",
12
+ border: "0px",
13
+ margin: "0px",
14
+ cursor: "pointer",
15
+ userSelect: "none",
16
+ verticalAlign: "middle",
17
+ appearance: void 0,
18
+ textDecoration: "none",
19
+ fontWeight: "500",
20
+ fontSize: "0.875rem",
21
+ lineHeight: "1.75",
22
+ letterSpacing: "0.02857em",
23
+ textTransform: "uppercase",
24
+ minWidth: "64px",
25
+ padding: "6px 16px",
26
+ borderRadius: "4px",
27
+ transition: "background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
28
+ color: "rgb(0, 0, 0)",
29
+ backgroundColor: "#ffffff",
30
+ boxShadow: "rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px"
31
31
  };
32
32
  const Button = ({ themeColor, buttonType, text, onClick }) => {
33
- const theme = useMemo(() => (themeColor === 'light' ? lightTheme : darkTheme), [themeColor]);
34
- const [hover, setHover] = useState(false);
35
- const buttonStyle = useMemo(() => {
36
- const baseStyle = {
37
- ...buttonStyleBase,
38
- color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText,
39
- };
40
- if (buttonType === 'cancel') {
41
- return {
42
- ...baseStyle,
43
- backgroundColor: hover ? theme.palette.grey[600] : 'transparent',
44
- };
45
- }
46
- else {
47
- return {
48
- ...baseStyle,
49
- backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default,
50
- };
51
- }
52
- }, [buttonType, hover, theme]);
53
- return (_jsx("button", { ...addDataAttr({ dev: { cy: `button-${buttonType}` } }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), style: buttonStyle, onClick: (e) => {
54
- e.preventDefault();
55
- onClick();
56
- }, children: text }));
33
+ const theme = useMemo(() => themeColor === "light" ? lightTheme : darkTheme, [themeColor]);
34
+ const [hover, setHover] = useState(false);
35
+ const buttonStyle = useMemo(() => {
36
+ const baseStyle = {
37
+ ...buttonStyleBase,
38
+ color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText
39
+ };
40
+ if (buttonType === "cancel") {
41
+ return {
42
+ ...baseStyle,
43
+ backgroundColor: hover ? theme.palette.grey[600] : "transparent"
44
+ };
45
+ } else {
46
+ return {
47
+ ...baseStyle,
48
+ backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default
49
+ };
50
+ }
51
+ }, [buttonType, hover, theme]);
52
+ return /* @__PURE__ */ jsx(
53
+ "button",
54
+ {
55
+ ...addDataAttr({ dev: { cy: `button-${buttonType}` } }),
56
+ onMouseEnter: () => setHover(true),
57
+ onMouseLeave: () => setHover(false),
58
+ style: buttonStyle,
59
+ onClick: (e) => {
60
+ e.preventDefault();
61
+ onClick();
62
+ },
63
+ children: text
64
+ }
65
+ );
66
+ };
67
+ export {
68
+ Button as default
57
69
  };
58
- export default Button;
59
- //# sourceMappingURL=Button.js.map
@@ -1,60 +1,157 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { CaptchaWidget } from './CaptchaWidget.js';
3
- import { Suspense, useMemo } from 'react';
4
- import { at } from '@prosopo/util';
5
- import { darkTheme, lightTheme } from './theme.js';
6
- import { useTranslation } from '@prosopo/common';
7
- import Button from './Button.js';
8
- import addDataAttr from '../util/index.js';
9
- const CaptchaComponent = ({ challenge, index, solutions, onSubmit, onCancel, onClick, onNext, themeColor, }) => {
10
- const { t } = useTranslation();
11
- const captcha = challenge.captchas ? at(challenge.captchas, index) : null;
12
- const solution = solutions ? at(solutions, index) : [];
13
- const theme = useMemo(() => (themeColor === 'light' ? lightTheme : darkTheme), [themeColor]);
14
- return (_jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx("div", { style: {
15
- overflowX: 'auto',
16
- overflowY: 'auto',
17
- width: '100%',
18
- maxWidth: '500px',
19
- maxHeight: '100%',
20
- display: 'flex',
21
- flexDirection: 'column',
22
- }, children: _jsxs("div", { style: {
23
- backgroundColor: theme.palette.background.default,
24
- display: 'flex',
25
- flexDirection: 'column',
26
- minWidth: '300px',
27
- }, children: [_jsxs("div", { style: {
28
- display: 'flex',
29
- alignItems: 'center',
30
- width: '100%',
31
- backgroundColor: theme.palette.primary.main,
32
- padding: '24px 16px',
33
- }, children: [_jsxs("p", { style: {
34
- color: '#ffffff',
35
- fontWeight: 700,
36
- lineHeight: 1.5,
37
- }, children: [t('WIDGET.SELECT_ALL'), ': '] }), _jsx("p", { style: {
38
- color: '#ffffff',
39
- fontWeight: 700,
40
- textTransform: 'capitalize',
41
- lineHeight: 1.5,
42
- }, children: `${at(challenge.captchas, index).captcha.target}` })] }), _jsx("div", { ...addDataAttr({ dev: { cy: 'captcha-' + index } }), children: captcha && (_jsx(CaptchaWidget, { challenge: captcha, solution: solution, onClick: onClick, themeColor: themeColor })) }), _jsx("div", { style: {
43
- display: 'flex',
44
- alignItems: 'center',
45
- justifyContent: 'center',
46
- width: '100%',
47
- }, ...addDataAttr({ dev: { cy: 'dots-captcha' } }) }), _jsx("div", { style: {
48
- padding: '8px 16px',
49
- display: 'flex',
50
- width: '100%',
51
- } }), _jsxs("div", { style: {
52
- padding: '0 16px 16px',
53
- display: 'flex',
54
- alignItems: 'center',
55
- justifyContent: 'space-between',
56
- lineHeight: 1.75,
57
- }, children: [_jsx(Button, { themeColor: themeColor, buttonType: "cancel", onClick: onCancel, text: t('WIDGET.CANCEL') }), _jsx(Button, { themeColor: themeColor, buttonType: "next", text: index < challenge.captchas.length - 1 ? t('WIDGET.NEXT') : t('WIDGET.SUBMIT'), onClick: index < challenge.captchas.length - 1 ? onNext : onSubmit })] })] }) }) }));
1
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
2
+ import { CaptchaWidget } from "./CaptchaWidget.js";
3
+ import { useMemo, Suspense } from "react";
4
+ import { at } from "@prosopo/util";
5
+ import { lightTheme, darkTheme } from "./theme.js";
6
+ import { useTranslation } from "@prosopo/common";
7
+ import Button from "./Button.js";
8
+ import addDataAttr from "../util/index.js";
9
+ const CaptchaComponent = ({
10
+ challenge,
11
+ index,
12
+ solutions,
13
+ onSubmit,
14
+ onCancel,
15
+ onClick,
16
+ onNext,
17
+ themeColor
18
+ }) => {
19
+ const { t } = useTranslation();
20
+ const captcha = challenge.captchas ? at(challenge.captchas, index) : null;
21
+ const solution = solutions ? at(solutions, index) : [];
22
+ const theme = useMemo(() => themeColor === "light" ? lightTheme : darkTheme, [themeColor]);
23
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsx(
24
+ "div",
25
+ {
26
+ style: {
27
+ // introduce scroll bars when screen < minWidth of children
28
+ overflowX: "auto",
29
+ overflowY: "auto",
30
+ width: "100%",
31
+ maxWidth: "500px",
32
+ maxHeight: "100%",
33
+ display: "flex",
34
+ flexDirection: "column"
35
+ },
36
+ children: /* @__PURE__ */ jsxs(
37
+ "div",
38
+ {
39
+ style: {
40
+ backgroundColor: theme.palette.background.default,
41
+ display: "flex",
42
+ flexDirection: "column",
43
+ minWidth: "300px"
44
+ },
45
+ children: [
46
+ /* @__PURE__ */ jsxs(
47
+ "div",
48
+ {
49
+ style: {
50
+ display: "flex",
51
+ alignItems: "center",
52
+ width: "100%",
53
+ backgroundColor: theme.palette.primary.main,
54
+ padding: "24px 16px"
55
+ },
56
+ children: [
57
+ /* @__PURE__ */ jsxs(
58
+ "p",
59
+ {
60
+ style: {
61
+ color: "#ffffff",
62
+ fontWeight: 700,
63
+ lineHeight: 1.5
64
+ },
65
+ children: [
66
+ t("WIDGET.SELECT_ALL"),
67
+ ": "
68
+ ]
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx(
72
+ "p",
73
+ {
74
+ style: {
75
+ color: "#ffffff",
76
+ fontWeight: 700,
77
+ textTransform: "capitalize",
78
+ lineHeight: 1.5
79
+ },
80
+ children: `${at(challenge.captchas, index).captcha.target}`
81
+ }
82
+ )
83
+ ]
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsx("div", { ...addDataAttr({ dev: { cy: "captcha-" + index } }), children: captcha && /* @__PURE__ */ jsx(
87
+ CaptchaWidget,
88
+ {
89
+ challenge: captcha,
90
+ solution,
91
+ onClick,
92
+ themeColor
93
+ }
94
+ ) }),
95
+ /* @__PURE__ */ jsx(
96
+ "div",
97
+ {
98
+ style: {
99
+ display: "flex",
100
+ alignItems: "center",
101
+ justifyContent: "center",
102
+ width: "100%"
103
+ },
104
+ ...addDataAttr({ dev: { cy: "dots-captcha" } })
105
+ }
106
+ ),
107
+ /* @__PURE__ */ jsx(
108
+ "div",
109
+ {
110
+ style: {
111
+ padding: "8px 16px",
112
+ display: "flex",
113
+ width: "100%"
114
+ }
115
+ }
116
+ ),
117
+ /* @__PURE__ */ jsxs(
118
+ "div",
119
+ {
120
+ style: {
121
+ padding: "0 16px 16px",
122
+ display: "flex",
123
+ alignItems: "center",
124
+ justifyContent: "space-between",
125
+ lineHeight: 1.75
126
+ },
127
+ children: [
128
+ /* @__PURE__ */ jsx(
129
+ Button,
130
+ {
131
+ themeColor,
132
+ buttonType: "cancel",
133
+ onClick: onCancel,
134
+ text: t("WIDGET.CANCEL")
135
+ }
136
+ ),
137
+ /* @__PURE__ */ jsx(
138
+ Button,
139
+ {
140
+ themeColor,
141
+ buttonType: "next",
142
+ text: index < challenge.captchas.length - 1 ? t("WIDGET.NEXT") : t("WIDGET.SUBMIT"),
143
+ onClick: index < challenge.captchas.length - 1 ? onNext : onSubmit
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ )
149
+ ]
150
+ }
151
+ )
152
+ }
153
+ ) });
154
+ };
155
+ export {
156
+ CaptchaComponent as default
58
157
  };
59
- export default CaptchaComponent;
60
- //# sourceMappingURL=CaptchaComponent.js.map
@@ -1,9 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import { LoadingSpinner } from './LoadingSpinner.js';
3
- import { css } from '@emotion/react';
4
- import { darkTheme, lightTheme } from './theme.js';
5
- import { useMemo } from 'react';
6
- const logoStyle = css `
1
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
2
+ import { LoadingSpinner } from "./LoadingSpinner.js";
3
+ import { css } from "@emotion/react";
4
+ import { lightTheme, darkTheme } from "./theme.js";
5
+ import { useMemo } from "react";
6
+ const logoStyle = css`
7
7
  align-items: center;
8
8
  justify-content: flex-end;
9
9
  display: flex;
@@ -34,44 +34,99 @@ const logoStyle = css `
34
34
  } /* logoWithoutText */
35
35
  }
36
36
  `;
37
- export const ProcaptchaPlaceholder = (props) => {
38
- const darkMode = props.darkMode;
39
- const styleWidth = { maxWidth: '400px', minWidth: '200px', margin: '8px' };
40
- const themeColor = darkMode ? 'light' : 'dark';
41
- const theme = useMemo(() => (darkMode === 'light' ? lightTheme : darkTheme), [darkMode]);
42
- return (_jsx("div", { children: _jsx("div", { style: { maxWidth: '100%', maxHeight: '100%', overflowX: 'auto' }, children: _jsxs("div", { style: styleWidth, "data-cy": 'button-human', children: [' ', _jsxs("div", { style: {
43
- padding: '8px',
44
- border: '1px solid',
45
- backgroundColor: theme.palette.background.default,
46
- borderColor: theme.palette.grey[300],
47
- borderRadius: '8px',
48
- display: 'flex',
49
- justifyContent: 'space-between',
50
- alignItems: 'center',
51
- flexWrap: 'wrap',
52
- }, children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsx("div", { style: {
53
- display: 'flex',
54
- justifyContent: 'flex-start',
55
- alignItems: 'center',
56
- flexWrap: 'wrap',
57
- }, children: _jsx("div", { style: {
58
- height: '50px',
59
- width: '50px',
60
- display: 'flex',
61
- alignItems: 'center',
62
- justifyContent: 'center',
63
- flexDirection: 'column',
64
- verticalAlign: 'middle',
65
- }, children: _jsx("div", { style: {
66
- display: 'flex',
67
- }, children: _jsx("div", { style: { flex: 1 }, children: _jsx(LoadingSpinner, { themeColor: themeColor }) }) }) }) }) }), _jsx("div", { children: _jsx("a", { href: "https://www.prosopo.io/#features?ref=accounts.prosopo.io&utm_campaign=widget&utm_medium=checkbox", target: "_blank", "aria-label": "Visit prosopo.io to learn more about the service and its accessibility options.", children: _jsx("div", { children: _jsxs("div", { children: [_jsx("div", { css: logoStyle, dangerouslySetInnerHTML: {
68
- __html: darkMode === 'light' ? logoWithoutTextBlack : logoWithoutTextWhite,
69
- } }), _jsx("div", { css: logoStyle, dangerouslySetInnerHTML: {
70
- __html: darkMode === 'light' ? logoWithTextBlack : logoWithTextWhite,
71
- } })] }) }) }) })] })] }) }) }));
37
+ const ProcaptchaPlaceholder = (props) => {
38
+ const darkMode = props.darkMode;
39
+ const styleWidth = { maxWidth: "400px", minWidth: "200px", margin: "8px" };
40
+ const themeColor = darkMode ? "light" : "dark";
41
+ const theme = useMemo(() => darkMode === "light" ? lightTheme : darkTheme, [darkMode]);
42
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", { style: { maxWidth: "100%", maxHeight: "100%", overflowX: "auto" }, children: /* @__PURE__ */ jsxs("div", { style: styleWidth, "data-cy": "button-human", children: [
43
+ " ",
44
+ /* @__PURE__ */ jsxs(
45
+ "div",
46
+ {
47
+ style: {
48
+ padding: "8px",
49
+ border: "1px solid",
50
+ backgroundColor: theme.palette.background.default,
51
+ borderColor: theme.palette.grey[300],
52
+ borderRadius: "8px",
53
+ display: "flex",
54
+ justifyContent: "space-between",
55
+ alignItems: "center",
56
+ flexWrap: "wrap"
57
+ },
58
+ children: [
59
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx(
60
+ "div",
61
+ {
62
+ style: {
63
+ display: "flex",
64
+ justifyContent: "flex-start",
65
+ alignItems: "center",
66
+ flexWrap: "wrap"
67
+ },
68
+ children: /* @__PURE__ */ jsx(
69
+ "div",
70
+ {
71
+ style: {
72
+ height: "50px",
73
+ width: "50px",
74
+ display: "flex",
75
+ alignItems: "center",
76
+ justifyContent: "center",
77
+ flexDirection: "column",
78
+ verticalAlign: "middle"
79
+ },
80
+ children: /* @__PURE__ */ jsx(
81
+ "div",
82
+ {
83
+ style: {
84
+ display: "flex"
85
+ },
86
+ children: /* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsx(LoadingSpinner, { themeColor }) })
87
+ }
88
+ )
89
+ }
90
+ )
91
+ }
92
+ ) }),
93
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
94
+ "a",
95
+ {
96
+ href: "https://www.prosopo.io/#features?ref=accounts.prosopo.io&utm_campaign=widget&utm_medium=checkbox",
97
+ target: "_blank",
98
+ "aria-label": "Visit prosopo.io to learn more about the service and its accessibility options.",
99
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { children: [
100
+ /* @__PURE__ */ jsx(
101
+ "div",
102
+ {
103
+ css: logoStyle,
104
+ dangerouslySetInnerHTML: {
105
+ __html: darkMode === "light" ? logoWithoutTextBlack : logoWithoutTextWhite
106
+ }
107
+ }
108
+ ),
109
+ /* @__PURE__ */ jsx(
110
+ "div",
111
+ {
112
+ css: logoStyle,
113
+ dangerouslySetInnerHTML: {
114
+ __html: darkMode === "light" ? logoWithTextBlack : logoWithTextWhite
115
+ }
116
+ }
117
+ )
118
+ ] }) })
119
+ }
120
+ ) })
121
+ ]
122
+ }
123
+ )
124
+ ] }) }) });
72
125
  };
73
126
  const logoWithTextBlack = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#1d1d1b;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>';
74
127
  const logoWithTextWhite = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#fff;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>';
75
128
  const logoWithoutTextWhite = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 348" height="35px"><path id="Vector" d="M95.7053 40.2707C127.005 40.2707 157.022 52.6841 179.154 74.78C201.286 96.8759 213.719 126.844 213.719 158.093H254.056C254.056 70.7808 183.16 -4.57764e-05 95.7053 -4.57764e-05V40.2707Z" fill="#fff"/><path id="Vector_2" d="M42.8365 93.0614C58.3333 93.0614 73.6784 96.1087 87.9955 102.029C102.313 107.95 115.322 116.628 126.279 127.568C137.237 138.508 145.93 151.496 151.86 165.79C157.79 180.084 160.843 195.404 160.843 210.875H201.179C201.179 123.564 130.291 52.7906 42.8365 52.7906V93.0614Z" fill="#fff"/><path id="Vector_3" d="M158.367 305.005C127.07 305.003 97.056 292.59 74.926 270.496C52.796 248.402 40.3626 218.437 40.3604 187.191H0.0239563C0.0239563 274.503 70.9123 345.276 158.367 345.276V305.005Z" fill="#fff"/><path id="Vector_4" d="M211.219 252.239C195.722 252.239 180.376 249.191 166.059 243.27C151.741 237.349 138.732 228.67 127.774 217.729C116.816 206.788 108.123 193.799 102.194 179.505C96.2637 165.21 93.2121 149.889 93.2132 134.417H52.8687C52.8687 221.729 123.765 292.509 211.219 292.509V252.239Z" fill="#fff"/></g><defs><clipPath id="clip0_1_2"><rect width="254" height="345" fill="white"/></clipPath></defs></svg>';
76
129
  const logoWithoutTextBlack = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 348" height="35px"><path id="Vector" d="M95.7053 40.2707C127.005 40.2707 157.022 52.6841 179.154 74.78C201.286 96.8759 213.719 126.844 213.719 158.093H254.056C254.056 70.7808 183.16 -4.57764e-05 95.7053 -4.57764e-05V40.2707Z" fill="#000000"/><path id="Vector_2" d="M42.8365 93.0614C58.3333 93.0614 73.6784 96.1087 87.9955 102.029C102.313 107.95 115.322 116.628 126.279 127.568C137.237 138.508 145.93 151.496 151.86 165.79C157.79 180.084 160.843 195.404 160.843 210.875H201.179C201.179 123.564 130.291 52.7906 42.8365 52.7906V93.0614Z" fill="#000000"/><path id="Vector_3" d="M158.367 305.005C127.07 305.003 97.056 292.59 74.926 270.496C52.796 248.402 40.3626 218.437 40.3604 187.191H0.0239563C0.0239563 274.503 70.9123 345.276 158.367 345.276V305.005Z" fill="#000000"/><path id="Vector_4" d="M211.219 252.239C195.722 252.239 180.376 249.191 166.059 243.27C151.741 237.349 138.732 228.67 127.774 217.729C116.816 206.788 108.123 193.799 102.194 179.505C96.2637 165.21 93.2121 149.889 93.2132 134.417H52.8687C52.8687 221.729 123.765 292.509 211.219 292.509V252.239Z" fill="#000000"/></g><defs><clipPath id="clip0_1_2"><rect width="254" height="345" fill="white"/></clipPath></defs></svg>';
77
- //# sourceMappingURL=CaptchaPlaceholder.js.map
130
+ export {
131
+ ProcaptchaPlaceholder
132
+ };