@prosopo/procaptcha-react 0.3.1 → 0.3.3
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/README.md +3 -9
- package/dist/cjs/components/Modal.cjs +0 -1
- package/dist/cjs/components/Procaptcha.cjs +4 -2
- package/dist/cjs/components/ProcaptchaWidget.cjs +81 -220
- package/dist/cjs/components/collector.cjs +4 -3
- package/dist/cjs/web-components/dist/CaptchaPlaceholder.cjs +13 -55
- package/dist/cjs/web-components/dist/Checkbox.cjs +21 -11
- package/dist/cjs/web-components/dist/Containers.cjs +42 -0
- package/dist/cjs/web-components/dist/LoadingSpinner.cjs +4 -0
- package/dist/cjs/web-components/dist/Logo.cjs +16 -0
- package/dist/cjs/web-components/dist/LogoWithText.cjs +10 -0
- package/dist/cjs/web-components/dist/LogoWithoutText.cjs +10 -0
- package/dist/cjs/web-components/dist/WidgetConstants.cjs +12 -0
- package/dist/cjs/web-components/dist/index.cjs +11 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/CaptchaComponent.d.ts +2 -2
- package/dist/components/CaptchaComponent.d.ts.map +1 -1
- package/dist/components/CaptchaComponent.js.map +1 -1
- package/dist/components/CaptchaWidget.d.ts +2 -2
- package/dist/components/CaptchaWidget.d.ts.map +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +0 -1
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/Procaptcha.d.ts +4 -2
- package/dist/components/Procaptcha.d.ts.map +1 -1
- package/dist/components/Procaptcha.js +1 -1
- package/dist/components/Procaptcha.js.map +1 -1
- package/dist/components/ProcaptchaWidget.d.ts +1 -5
- package/dist/components/ProcaptchaWidget.d.ts.map +1 -1
- package/dist/components/ProcaptchaWidget.js +32 -155
- package/dist/components/ProcaptchaWidget.js.map +1 -1
- package/dist/components/collector.d.ts +3 -2
- package/dist/components/collector.d.ts.map +1 -1
- package/dist/components/collector.js +4 -3
- package/dist/components/collector.js.map +1 -1
- package/package.json +8 -8
- package/typedoc.config.js +13 -0
- package/vite.cjs.config.ts +13 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const WidgetConstants = require("./WidgetConstants.cjs");
|
|
4
|
+
const styled = require("@emotion/styled");
|
|
5
|
+
const ContainerDiv = styled.div`
|
|
6
|
+
container-type: inline-size;
|
|
7
|
+
`;
|
|
8
|
+
const WidthBasedStylesDiv = styled.div`
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
max-height: 100%;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
height: ${WidgetConstants.WIDGET_OUTER_HEIGHT}px;
|
|
13
|
+
@container (max-width: 243px) {
|
|
14
|
+
#logo-without-text {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#logo-with-text {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
@container (min-width: 244px) and (max-width: 339px) {
|
|
23
|
+
#logo-without-text {
|
|
24
|
+
display: inherit;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#logo-with-text {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@container (min-width: 340px) {
|
|
32
|
+
#logo-without-text {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#logo-with-text {
|
|
37
|
+
display: inherit;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
exports.ContainerDiv = ContainerDiv;
|
|
42
|
+
exports.WidthBasedStylesDiv = WidthBasedStylesDiv;
|
|
@@ -7,6 +7,9 @@ const styled = require("@emotion/styled");
|
|
|
7
7
|
const LoadingSpinner = ({ themeColor }) => {
|
|
8
8
|
const theme$1 = React.useMemo(() => themeColor === "light" ? theme.lightTheme : theme.darkTheme, [themeColor]);
|
|
9
9
|
const StyledDiv = styled.div`
|
|
10
|
+
margin-top: 0;
|
|
11
|
+
margin-left: 15px;
|
|
12
|
+
margin-right: 15px;
|
|
10
13
|
width: 2em;
|
|
11
14
|
height: 2em;
|
|
12
15
|
border: 4px solid ${theme$1.palette.background.contrastText};
|
|
@@ -15,6 +18,7 @@ const LoadingSpinner = ({ themeColor }) => {
|
|
|
15
18
|
display: inherit;
|
|
16
19
|
box-sizing: border-box;
|
|
17
20
|
animation: rotation 1s linear infinite;
|
|
21
|
+
|
|
18
22
|
@keyframes rotation {
|
|
19
23
|
0% {
|
|
20
24
|
transform: rotate(0deg);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
|
+
const LogoWithText = require("./LogoWithText.cjs");
|
|
4
|
+
const LogoWithoutText = require("./LogoWithoutText.cjs");
|
|
5
|
+
const styled = require("@emotion/styled");
|
|
6
|
+
const LogoContainer = styled.div`
|
|
7
|
+
padding: 8px;
|
|
8
|
+
flex: 1 1 0;
|
|
9
|
+
`;
|
|
10
|
+
const LogoInnerContainer = styled.div`
|
|
11
|
+
padding: 8px;
|
|
12
|
+
`;
|
|
13
|
+
const Logo = ({ themeColor }) => {
|
|
14
|
+
return jsxRuntime.jsx(LogoContainer, { children: jsxRuntime.jsxs(LogoInnerContainer, { children: [jsxRuntime.jsx(LogoWithoutText.LogoWithoutText, { themeColor }), jsxRuntime.jsx(LogoWithText.LogoWithText, { themeColor })] }) });
|
|
15
|
+
};
|
|
16
|
+
module.exports = Logo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const LogoWithText = ({ themeColor }) => {
|
|
6
|
+
const fill = React.useMemo(() => themeColor === "light" ? "#1d1d1b" : "#fff", [themeColor]);
|
|
7
|
+
return jsxRuntime.jsxs("svg", { className: "logo", id: "logo-with-text", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2062.63 468.67", height: "35px", width: "140px", style: { fill }, children: [jsxRuntime.jsx("title", { children: "Prosopo Logo With Text" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" }), jsxRuntime.jsx("path", { 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)" })] });
|
|
8
|
+
};
|
|
9
|
+
exports.LogoWithText = LogoWithText;
|
|
10
|
+
exports.default = LogoWithText;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const LogoWithoutText = ({ themeColor }) => {
|
|
6
|
+
const fill = React.useMemo(() => themeColor === "light" ? "#1d1d1b" : "#fff", [themeColor]);
|
|
7
|
+
return jsxRuntime.jsxs("svg", { className: "logo", id: "logo-without-text", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 260 348", height: "35px", style: { fill }, children: [jsxRuntime.jsx("title", { children: "Prosopo Logo Without Text" }), jsxRuntime.jsx("path", { 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" }), jsxRuntime.jsx("path", { 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" }), jsxRuntime.jsx("path", { 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" }), jsxRuntime.jsx("path", { 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" })] });
|
|
8
|
+
};
|
|
9
|
+
exports.LogoWithoutText = LogoWithoutText;
|
|
10
|
+
exports.default = LogoWithoutText;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const WIDGET_URL = "https://prosopo.io/?ref=accounts.prosopo.io&utm_campaign=widget&utm_medium=checkbox#features";
|
|
4
|
+
const WIDGET_URL_TEXT = "Visit prosopo.io to learn more about the service and its accessibility options.";
|
|
5
|
+
const WIDGET_INNER_HEIGHT = 74;
|
|
6
|
+
const WIDGET_OUTER_HEIGHT = 80;
|
|
7
|
+
const WIDGET_DIMENSIONS = { maxWidth: "400px", minWidth: "200px", minHeight: `${WIDGET_OUTER_HEIGHT}px` };
|
|
8
|
+
exports.WIDGET_DIMENSIONS = WIDGET_DIMENSIONS;
|
|
9
|
+
exports.WIDGET_INNER_HEIGHT = WIDGET_INNER_HEIGHT;
|
|
10
|
+
exports.WIDGET_OUTER_HEIGHT = WIDGET_OUTER_HEIGHT;
|
|
11
|
+
exports.WIDGET_URL = WIDGET_URL;
|
|
12
|
+
exports.WIDGET_URL_TEXT = WIDGET_URL_TEXT;
|
|
@@ -4,8 +4,19 @@ const CaptchaPlaceholder = require("./CaptchaPlaceholder.cjs");
|
|
|
4
4
|
const LoadingSpinner = require("./LoadingSpinner.cjs");
|
|
5
5
|
const theme = require("./theme.cjs");
|
|
6
6
|
const Checkbox = require("./Checkbox.cjs");
|
|
7
|
+
const Logo = require("./Logo.cjs");
|
|
8
|
+
const Containers = require("./Containers.cjs");
|
|
9
|
+
const WidgetConstants = require("./WidgetConstants.cjs");
|
|
7
10
|
exports.ProcaptchaPlaceholder = CaptchaPlaceholder.ProcaptchaPlaceholder;
|
|
8
11
|
exports.LoadingSpinner = LoadingSpinner.LoadingSpinner;
|
|
9
12
|
exports.darkTheme = theme.darkTheme;
|
|
10
13
|
exports.lightTheme = theme.lightTheme;
|
|
11
14
|
exports.Checkbox = Checkbox.Checkbox;
|
|
15
|
+
exports.Logo = Logo;
|
|
16
|
+
exports.ContainerDiv = Containers.ContainerDiv;
|
|
17
|
+
exports.WidthBasedStylesDiv = Containers.WidthBasedStylesDiv;
|
|
18
|
+
exports.WIDGET_DIMENSIONS = WidgetConstants.WIDGET_DIMENSIONS;
|
|
19
|
+
exports.WIDGET_INNER_HEIGHT = WidgetConstants.WIDGET_INNER_HEIGHT;
|
|
20
|
+
exports.WIDGET_OUTER_HEIGHT = WidgetConstants.WIDGET_OUTER_HEIGHT;
|
|
21
|
+
exports.WIDGET_URL = WidgetConstants.WIDGET_URL;
|
|
22
|
+
exports.WIDGET_URL_TEXT = WidgetConstants.WIDGET_URL_TEXT;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,EAAE,oBAAoB,EAAoC,MAAM,OAAO,CAAA;AAGrF,UAAU,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACjE,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACf;AAgCD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmCjC,CAAA;AACD,eAAe,MAAM,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAc,EAAuC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrF,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAS1C,MAAM,eAAe,GAAkB;IACnC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,SAAS;IACrB,cAAc,EAAE,MAAM;IACtB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,WAAW;IAC1B,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,KAAK;IACnB,UAAU,EACN,+MAA+M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UAAU,EAAE,EAAE,EAAE,CAAC,EACxD,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAClC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACnC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACX,CAAC,CAAC,cAAc,EAAE,CAAA;YAClB,OAAO,EAAE,CAAA;QACb,CAAC,YAEA,IAAI,GACA,CACZ,CAAA;AACL,CAAC,CAAA;AACD,eAAe,MAAM,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CaptchaResponseBody } from '@prosopo/types';
|
|
2
2
|
export interface CaptchaComponentProps {
|
|
3
|
-
challenge:
|
|
3
|
+
challenge: CaptchaResponseBody;
|
|
4
4
|
index: number;
|
|
5
5
|
solutions: string[][];
|
|
6
6
|
onSubmit: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaComponent.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaptchaComponent.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AASpD,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAAE,mBAAmB,CAAA;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,EAAE,EAAE,CAAA;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;CAC/B;AAED,QAAA,MAAM,gBAAgB,sFASnB,qBAAqB,qDA8GvB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaComponent.js","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CaptchaComponent.js","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAa1C,MAAM,gBAAgB,GAAG,CAAC,EACtB,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,GACU,EAAE,EAAE;IACxB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACzE,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACtD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IA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GACxB,CACL,GACC,EACN,cACI,KAAK,EAAE;4BACH,OAAO,EAAE,MAAM;4BACf,UAAU,EAAE,QAAQ;4BACpB,cAAc,EAAE,QAAQ;4BACxB,KAAK,EAAE,MAAM;yBAChB,KACG,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,CAAC,GAClD,EACF,cACI,KAAK,EAAE;4BACH,OAAO,EAAE,UAAU;4BACnB,OAAO,EAAE,MAAM;4BACf,KAAK,EAAE,MAAM;yBAChB,GACE,EACP,eACI,KAAK,EAAE;4BACH,OAAO,EAAE,aAAa;4BACtB,OAAO,EAAE,MAAM;4BACf,UAAU,EAAE,QAAQ;4BACpB,cAAc,EAAE,eAAe;4BAC/B,UAAU,EAAE,IAAI;yBACnB,aAED,KAAC,MAAM,IACH,UAAU,EAAE,UAAU,EACtB,UAAU,EAAC,QAAQ,EACnB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,CAAC,CAAC,eAAe,CAAC,GAClB,EACV,KAAC,MAAM,IACH,UAAU,EAAE,UAAU,EACtB,UAAU,EAAC,MAAM,EACjB,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,EACnF,OAAO,EAAE,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,GAC5D,IACR,IACJ,GACJ,GACC,CACd,CAAA;AACL,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CaptchaWithProof } from '@prosopo/types';
|
|
2
2
|
export interface CaptchaWidgetProps {
|
|
3
|
-
challenge:
|
|
3
|
+
challenge: CaptchaWithProof;
|
|
4
4
|
solution: string[];
|
|
5
5
|
onClick: (hash: string) => void;
|
|
6
6
|
themeColor: 'light' | 'dark';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaWidget.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"CaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaWidget.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAKjD,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,gBAAgB,CAAA;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;CAC/B;AASD,eAAO,MAAM,aAAa,iDAAkD,kBAAkB,qDAuH7F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,KAAK,UAAU,GAAG;IACd,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC5B,CAAA;AAED,QAAA,MAAM,cAAc,oCAAsB,UAAU,aAAa,UAAU,sDA0CzE,CAAA;AAEF,eAAe,cAAc,CAAA"}
|
package/dist/components/Modal.js
CHANGED
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
const ModalComponent = React.memo((props, nextProps) => {
|
|
4
4
|
const { show, children } = props;
|
|
5
|
-
console.log('rendering modal with show: ', show);
|
|
6
5
|
const display = show ? 'block' : 'none';
|
|
7
6
|
const ModalOuterDivCss = {
|
|
8
7
|
position: 'fixed',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":";AAaA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAM5C,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,KAAiB,EAAE,SAAqB,EAAE,EAAE;IAC3E,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAChC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAA;IACvC,MAAM,gBAAgB,GAAkB;QACpC,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,CAAC;QACR,OAAO;KACV,CAAA;IAED,MAAM,kBAAkB,GAAkB;QACtC,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,oBAAoB;QACrC,MAAM,EAAE,CAAC,CAAC;KACb,CAAA;IACD,MAAM,gBAAgB,GAAkB;QACpC,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,uBAAuB;QAClC,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,oBAAoB;QACrC,MAAM,EAAE,MAAM;QACd,SAAS,EACL,qHAAqH;KAC5H,CAAA;IAED,OAAO,CACH,eAAK,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,gBAAgB,aAC/C,cAAK,SAAS,EAAC,iBAAiB,EAAC,KAAK,EAAE,kBAAkB,GAAQ,EAClE,cAAK,SAAS,EAAC,YAAY,EAAC,KAAK,EAAE,gBAAgB,YAC9C,QAAQ,GACP,IACJ,CACT,CAAA;AACL,CAAC,CAAC,CAAA;AAEF,eAAe,cAAc,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { LazyExoticComponent } from 'react';
|
|
2
|
+
import { ProcaptchaEvents } from '@prosopo/types';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
declare const ProcaptchaWidget: LazyExoticComponent<(props: any, callbacks: Partial<ProcaptchaEvents>) => ReactElement>;
|
|
3
5
|
type ProcaptchaProps = React.ComponentProps<typeof ProcaptchaWidget>;
|
|
4
6
|
declare const Procaptcha: (props: ProcaptchaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
7
|
export default Procaptcha;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Procaptcha.d.ts","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Procaptcha.d.ts","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAkB,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGpC,QAAA,MAAM,gBAAgB,EAAE,mBAAmB,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,YAAY,CAE7G,CAAA;AACD,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEpE,QAAA,MAAM,UAAU,UAAW,eAAe,qDAIzC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { ProcaptchaPlaceholder } from '@prosopo/web-components';
|
|
3
2
|
import { Suspense, lazy } from 'react';
|
|
3
|
+
import { ProcaptchaPlaceholder } from '@prosopo/web-components';
|
|
4
4
|
const ProcaptchaWidget = lazy(async () => import('./ProcaptchaWidget.js'));
|
|
5
5
|
const Procaptcha = (props) => (_jsx(Suspense, { fallback: _jsx(ProcaptchaPlaceholder, { darkMode: props.config.theme }), children: _jsx(ProcaptchaWidget, { config: props.config, callbacks: props.callbacks }) }));
|
|
6
6
|
export default Procaptcha;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Procaptcha.js","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Procaptcha.js","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAuB,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAI/D,MAAM,gBAAgB,GAA4F,IAAI,CAClH,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAC9C,CAAA;AAGD,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,CAC3C,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,qBAAqB,IAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,GAAI,YACvE,KAAC,gBAAgB,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAqB,GAChF,CACd,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ProcaptchaProps {
|
|
3
|
-
config: ProcaptchaConfigOptional;
|
|
4
|
-
callbacks?: Partial<ProcaptchaCallbacks>;
|
|
5
|
-
}
|
|
1
|
+
import { ProcaptchaProps } from '@prosopo/types';
|
|
6
2
|
declare const ProcaptchaWidget: (props: ProcaptchaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
3
|
export default ProcaptchaWidget;
|
|
8
4
|
//# sourceMappingURL=ProcaptchaWidget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProcaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAOhD,QAAA,MAAM,gBAAgB,UAAW,eAAe,qDA2G/C,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,168 +1,45 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { Checkbox, LoadingSpinner, darkTheme, lightTheme } from '@prosopo/web-components';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { Checkbox, ContainerDiv, LoadingSpinner, WIDGET_DIMENSIONS, WIDGET_INNER_HEIGHT, WIDGET_URL, WIDGET_URL_TEXT, WidthBasedStylesDiv, darkTheme, lightTheme, } from '@prosopo/web-components';
|
|
3
|
+
import { Logo } from '@prosopo/web-components';
|
|
4
|
+
import { Manager } from '@prosopo/procaptcha';
|
|
5
|
+
import { useProcaptcha } from '@prosopo/procaptcha-common';
|
|
6
|
+
import { useRef, useState } from 'react';
|
|
6
7
|
import CaptchaComponent from './CaptchaComponent.js';
|
|
7
8
|
import Collector from './collector.js';
|
|
8
9
|
import Modal from './Modal.js';
|
|
9
|
-
const logoStyle = css `
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: flex-end;
|
|
12
|
-
display: flex;
|
|
13
|
-
padding: 8px;
|
|
14
|
-
|
|
15
|
-
@media (max-width: 245px) {
|
|
16
|
-
&:nth-of-type(1),
|
|
17
|
-
&:nth-of-type(2) {
|
|
18
|
-
display: none;
|
|
19
|
-
} /* Both logos hidden */
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@media (min-width: 245px) and (max-width: 400px) {
|
|
23
|
-
&:nth-of-type(1) {
|
|
24
|
-
display: flex;
|
|
25
|
-
} /* logoWithText */
|
|
26
|
-
&:nth-of-type(2) {
|
|
27
|
-
display: none;
|
|
28
|
-
} /* logoWithoutText */
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@media (min-width: 401px) {
|
|
32
|
-
&:nth-of-type(1) {
|
|
33
|
-
display: none;
|
|
34
|
-
} /* logoWithText */
|
|
35
|
-
&:nth-of-type(2) {
|
|
36
|
-
display: flex;
|
|
37
|
-
} /* logoWithoutText */
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
const useRefAsState = (defaultValue) => {
|
|
41
|
-
const ref = useRef(defaultValue);
|
|
42
|
-
const setter = (value) => {
|
|
43
|
-
ref.current = value;
|
|
44
|
-
};
|
|
45
|
-
const value = ref.current;
|
|
46
|
-
return [value, setter];
|
|
47
|
-
};
|
|
48
|
-
const useProcaptcha = () => {
|
|
49
|
-
const [isHuman, setIsHuman] = useState(false);
|
|
50
|
-
const [index, setIndex] = useState(0);
|
|
51
|
-
const [solutions, setSolutions] = useState([]);
|
|
52
|
-
const [captchaApi, setCaptchaApi] = useRefAsState(undefined);
|
|
53
|
-
const [showModal, setShowModal] = useState(false);
|
|
54
|
-
const [challenge, setChallenge] = useState(undefined);
|
|
55
|
-
const [loading, setLoading] = useState(false);
|
|
56
|
-
const [account, setAccount] = useState(undefined);
|
|
57
|
-
const [dappAccount, setDappAccount] = useState(undefined);
|
|
58
|
-
const [submission, setSubmission] = useRefAsState(undefined);
|
|
59
|
-
const [timeout, setTimeout] = useRefAsState(undefined);
|
|
60
|
-
const [blockNumber, setBlockNumber] = useRefAsState(undefined);
|
|
61
|
-
const [successfullChallengeTimeout, setSuccessfullChallengeTimeout] = useRefAsState(undefined);
|
|
62
|
-
const [sendData, setSendData] = useState(false);
|
|
63
|
-
return [
|
|
64
|
-
{
|
|
65
|
-
isHuman,
|
|
66
|
-
index,
|
|
67
|
-
solutions,
|
|
68
|
-
captchaApi,
|
|
69
|
-
showModal,
|
|
70
|
-
challenge,
|
|
71
|
-
loading,
|
|
72
|
-
account,
|
|
73
|
-
dappAccount,
|
|
74
|
-
submission,
|
|
75
|
-
timeout,
|
|
76
|
-
blockNumber,
|
|
77
|
-
successfullChallengeTimeout,
|
|
78
|
-
sendData,
|
|
79
|
-
},
|
|
80
|
-
(nextState) => {
|
|
81
|
-
if (nextState.account !== undefined)
|
|
82
|
-
setAccount(nextState.account);
|
|
83
|
-
if (nextState.isHuman !== undefined)
|
|
84
|
-
setIsHuman(nextState.isHuman);
|
|
85
|
-
if (nextState.index !== undefined)
|
|
86
|
-
setIndex(nextState.index);
|
|
87
|
-
if (nextState.solutions !== undefined)
|
|
88
|
-
setSolutions(nextState.solutions.slice());
|
|
89
|
-
if (nextState.captchaApi !== undefined)
|
|
90
|
-
setCaptchaApi(nextState.captchaApi);
|
|
91
|
-
if (nextState.showModal !== undefined)
|
|
92
|
-
setShowModal(nextState.showModal);
|
|
93
|
-
if (nextState.challenge !== undefined)
|
|
94
|
-
setChallenge(nextState.challenge);
|
|
95
|
-
if (nextState.loading !== undefined)
|
|
96
|
-
setLoading(nextState.loading);
|
|
97
|
-
if (nextState.showModal !== undefined)
|
|
98
|
-
setShowModal(nextState.showModal);
|
|
99
|
-
if (nextState.dappAccount !== undefined)
|
|
100
|
-
setDappAccount(nextState.dappAccount);
|
|
101
|
-
if (nextState.submission !== undefined)
|
|
102
|
-
setSubmission(nextState.submission);
|
|
103
|
-
if (nextState.timeout !== undefined)
|
|
104
|
-
setTimeout(nextState.timeout);
|
|
105
|
-
if (nextState.successfullChallengeTimeout !== undefined)
|
|
106
|
-
setSuccessfullChallengeTimeout(nextState.timeout);
|
|
107
|
-
if (nextState.blockNumber !== undefined)
|
|
108
|
-
setBlockNumber(nextState.blockNumber);
|
|
109
|
-
if (nextState.sendData !== undefined)
|
|
110
|
-
setSendData(nextState.sendData);
|
|
111
|
-
},
|
|
112
|
-
];
|
|
113
|
-
};
|
|
114
10
|
const ProcaptchaWidget = (props) => {
|
|
115
|
-
console.log('config', props.config);
|
|
116
11
|
const config = props.config;
|
|
117
12
|
const callbacks = props.callbacks || {};
|
|
118
|
-
const [state, updateState] = useProcaptcha();
|
|
119
|
-
console.log('state', state);
|
|
13
|
+
const [state, updateState] = useProcaptcha(useState, useRef);
|
|
120
14
|
const manager = Manager(config, state, updateState, callbacks);
|
|
121
|
-
const styleWidth = { maxWidth: '400px', minWidth: '200px', margin: '8px' };
|
|
122
15
|
const themeColor = props.config.theme === 'light' ? 'light' : 'dark';
|
|
123
|
-
const theme =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
display: 'flex',
|
|
138
|
-
justifyContent: 'flex-start',
|
|
139
|
-
alignItems: 'center',
|
|
140
|
-
flexWrap: 'wrap',
|
|
141
|
-
}, children: [_jsxs("div", { style: {
|
|
142
|
-
height: '50px',
|
|
143
|
-
width: '50px',
|
|
144
|
-
display: 'flex',
|
|
16
|
+
const theme = props.config.theme === 'light' ? lightTheme : darkTheme;
|
|
17
|
+
return (_jsx("div", { children: _jsxs("div", { style: { maxWidth: '100%', maxHeight: '100%', overflowX: 'auto' }, children: [_jsx(Modal, { show: state.showModal, children: state.challenge ? (_jsx(CaptchaComponent, { challenge: state.challenge, index: state.index, solutions: state.solutions, onSubmit: manager.submit, onCancel: manager.cancel, onClick: manager.select, onNext: manager.nextRound, themeColor: config.theme ?? 'light' })) : (_jsx("div", { children: "No challenge set." })) }), _jsxs(ContainerDiv, { children: [_jsx(WidthBasedStylesDiv, { children: _jsxs("div", { style: WIDGET_DIMENSIONS, "data-cy": 'button-human', children: [' ', _jsxs("div", { style: {
|
|
18
|
+
padding: '2px',
|
|
19
|
+
border: '1px solid',
|
|
20
|
+
backgroundColor: theme.palette.background.default,
|
|
21
|
+
borderColor: theme.palette.grey[300],
|
|
22
|
+
borderRadius: '8px',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
flexWrap: 'wrap',
|
|
26
|
+
justifyContent: 'space-between',
|
|
27
|
+
minHeight: `${WIDGET_INNER_HEIGHT}px`,
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
}, children: [_jsx("div", { style: { display: 'inline-flex', flexDirection: 'column' }, children: _jsx("div", { style: {
|
|
145
30
|
alignItems: 'center',
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
:
|
|
157
|
-
|
|
158
|
-
__html: props.config.theme === 'light'
|
|
159
|
-
? logoWithTextBlack
|
|
160
|
-
: logoWithTextWhite,
|
|
161
|
-
} })] }) }) }) })] })] })] }), config.devOnlyWatchEvents && (_jsx(Collector, { onProcessData: manager.exportData, sendData: state.showModal }))] }));
|
|
31
|
+
flex: 1,
|
|
32
|
+
}, children: _jsxs("div", { style: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
verticalAlign: 'middle',
|
|
38
|
+
}, children: [_jsx("div", { style: {
|
|
39
|
+
display: !state.loading ? 'flex' : 'none',
|
|
40
|
+
}, children: _jsx(Checkbox, { themeColor: themeColor, onChange: manager.start, checked: state.isHuman, labelText: "I am human" }) }), _jsx("div", { style: {
|
|
41
|
+
display: state.loading ? 'flex' : 'none',
|
|
42
|
+
}, children: _jsx("div", { style: { display: 'inline-flex' }, children: _jsx(LoadingSpinner, { themeColor: themeColor }) }) })] }) }) }), _jsx("div", { style: { display: 'inline-flex', flexDirection: 'column' }, children: _jsx("a", { href: WIDGET_URL, target: "_blank", "aria-label": WIDGET_URL_TEXT, children: _jsx("div", { style: { flex: 1 }, children: _jsx(Logo, { themeColor: themeColor }) }) }) })] })] }) }), config.devOnlyWatchEvents && (_jsx(Collector, { onProcessData: manager.exportData, sendData: state.sendData, account: state.account }))] })] }) }));
|
|
162
43
|
};
|
|
163
|
-
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>';
|
|
164
|
-
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>';
|
|
165
|
-
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>';
|
|
166
|
-
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>';
|
|
167
44
|
export default ProcaptchaWidget;
|
|
168
45
|
//# sourceMappingURL=ProcaptchaWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcaptchaWidget.js","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ProcaptchaWidget.js","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":";AAcA,OAAO,EACH,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,SAAS,EACT,UAAU,GACb,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,O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C,KAAC,cAAc,IAAC,UAAU,EAAE,UAAU,GAAI,GACxC,GACJ,IACJ,GACJ,GACJ,EACN,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,YAC3D,YAAG,IAAI,EAAE,UAAU,EAAE,MAAM,EAAC,QAAQ,gBAAa,eAAe,YAC5D,cAAK,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YACnB,KAAC,IAAI,IAAC,UAAU,EAAE,UAAU,GAAS,GACnC,GACN,GACF,IACJ,IACJ,GACY,EACrB,MAAM,CAAC,kBAAkB,IAAI,CAC1B,KAAC,SAAS,IACN,aAAa,EAAE,OAAO,CAAC,UAAU,EACjC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,GACb,CAChB,IACU,IACb,GACJ,CACT,CAAA;AACL,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { StoredEvents } from '@prosopo/types';
|
|
1
|
+
import { Account, StoredEvents } from '@prosopo/types';
|
|
2
2
|
type CollectorProps = {
|
|
3
3
|
onProcessData: (data: StoredEvents) => void;
|
|
4
4
|
sendData: boolean;
|
|
5
|
+
account: Account | undefined;
|
|
5
6
|
};
|
|
6
|
-
declare const Collector: ({ onProcessData, sendData }: CollectorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const Collector: ({ onProcessData, sendData, account }: CollectorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default Collector;
|
|
8
9
|
//# sourceMappingURL=collector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/components/collector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/components/collector.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAA8D,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAIlH,KAAK,cAAc,GAAG;IAClB,aAAa,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IAC3C,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/B,CAAA;AAED,QAAA,MAAM,SAAS,yCAA0C,cAAc,qDAuBtE,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { startCollector } from '@prosopo/procaptcha';
|
|
4
|
-
const Collector = ({ onProcessData, sendData }) => {
|
|
4
|
+
const Collector = ({ onProcessData, sendData, account }) => {
|
|
5
5
|
const [mouseEvents, setStoredMouseEvents] = useState([]);
|
|
6
6
|
const [touchEvents, setStoredTouchEvents] = useState([]);
|
|
7
7
|
const [keyboardEvents, setStoredKeyboardEvents] = useState([]);
|
|
@@ -17,8 +17,9 @@ const Collector = ({ onProcessData, sendData }) => {
|
|
|
17
17
|
touchEvents,
|
|
18
18
|
keyboardEvents,
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
if (account)
|
|
21
|
+
onProcessData(userEvents);
|
|
22
|
+
}, [sendData, account]);
|
|
22
23
|
return _jsx("div", { ref: ref });
|
|
23
24
|
};
|
|
24
25
|
export default Collector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../src/components/collector.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../src/components/collector.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAoB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAQpD,MAAM,SAAS,GAAG,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAkB,EAAE,EAAE;IACvE,MAAM,CAAC,WAAW,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAsB,EAAE,CAAC,CAAA;IAC7E,MAAM,CAAC,WAAW,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAsB,EAAE,CAAC,CAAA;IAC7E,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAA;IAEtF,MAAM,GAAG,GAA4C,MAAM,CAAiB,IAAI,CAAC,CAAA;IAEjF,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE;YACpB,cAAc,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;SACnG;IACL,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,UAAU,GAAG;YACf,WAAW;YACX,WAAW;YACX,cAAc;SACjB,CAAA;QACD,IAAI,OAAO;YAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IAC1C,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;IAEvB,OAAO,cAAK,GAAG,EAAE,GAAG,GAAQ,CAAA;AAChC,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}
|