@prosopo/procaptcha-react 0.1.16 → 0.1.18

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 (33) hide show
  1. package/package.json +12 -11
  2. package/dist/components/CaptchaComponent.d.ts +0 -13
  3. package/dist/components/CaptchaComponent.d.ts.map +0 -1
  4. package/dist/components/CaptchaComponent.js +0 -67
  5. package/dist/components/CaptchaComponent.js.map +0 -1
  6. package/dist/components/CaptchaWidget.d.ts +0 -9
  7. package/dist/components/CaptchaWidget.d.ts.map +0 -1
  8. package/dist/components/CaptchaWidget.js +0 -77
  9. package/dist/components/CaptchaWidget.js.map +0 -1
  10. package/dist/components/ExtensionAccountSelect.d.ts +0 -7
  11. package/dist/components/ExtensionAccountSelect.d.ts.map +0 -1
  12. package/dist/components/ExtensionAccountSelect.js +0 -31
  13. package/dist/components/ExtensionAccountSelect.js.map +0 -1
  14. package/dist/components/Procaptcha.d.ts +0 -10
  15. package/dist/components/Procaptcha.d.ts.map +0 -1
  16. package/dist/components/Procaptcha.js +0 -121
  17. package/dist/components/Procaptcha.js.map +0 -1
  18. package/dist/components/index.d.ts +0 -5
  19. package/dist/components/index.d.ts.map +0 -1
  20. package/dist/components/index.js +0 -20
  21. package/dist/components/index.js.map +0 -1
  22. package/dist/components/theme.d.ts +0 -3
  23. package/dist/components/theme.d.ts.map +0 -1
  24. package/dist/components/theme.js +0 -10
  25. package/dist/components/theme.js.map +0 -1
  26. package/dist/index.d.ts +0 -3
  27. package/dist/index.d.ts.map +0 -1
  28. package/dist/index.js +0 -18
  29. package/dist/index.js.map +0 -1
  30. package/dist/util/index.d.ts +0 -14
  31. package/dist/util/index.d.ts.map +0 -1
  32. package/dist/util/index.js +0 -15
  33. package/dist/util/index.js.map +0 -1
package/package.json CHANGED
@@ -1,38 +1,39 @@
1
1
  {
2
2
  "name": "@prosopo/procaptcha-react",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
7
+ "type": "module",
7
8
  "types": "./dist/index.d.ts",
8
9
  "source": "./src/index.ts",
9
10
  "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1",
11
11
  "clean": "tsc --build --clean",
12
12
  "build": "tsc --build --verbose",
13
13
  "lint": "npx eslint .",
14
- "lint:fix": "npx eslint . --fix"
14
+ "lint:fix": "npx eslint . --fix --config ../../.eslintrc.js"
15
15
  },
16
16
  "browserslist": [
17
17
  "> 0.5%, last 2 versions, not dead"
18
18
  ],
19
19
  "dependencies": {
20
- "@emotion/react": "^11.10.4",
21
- "@emotion/styled": "^11.10.4",
22
- "@mui/icons-material": "^5.11.16",
23
- "@mui/material": "^5.13.3",
20
+ "@emotion/react": "^11.11.1",
21
+ "@emotion/styled": "^11.11.0",
22
+ "@mui/icons-material": "^5.14.3",
23
+ "@mui/material": "^5.14.5",
24
24
  "@polkadot/extension-dapp": "0.46.5",
25
25
  "@polkadot/extension-inject": "0.46.5",
26
26
  "@polkadot/types": "10.9.1",
27
- "@prosopo/common": "^0.1.16",
28
- "@prosopo/procaptcha": "^0.1.16",
29
- "i18next": "^22.5.0",
27
+ "@prosopo/common": "^0.1.18",
28
+ "@prosopo/procaptcha": "^0.1.18",
29
+ "i18next": "^21.9.2",
30
30
  "react": "^18.2.0",
31
31
  "react-dom": "^18.2.0",
32
32
  "zod": "^3.17.9"
33
33
  },
34
34
  "devDependencies": {
35
- "typescript": "^4.9.4"
35
+ "tslib": "^2.6.2",
36
+ "typescript": "^5.1.6"
36
37
  },
37
38
  "repository": {
38
39
  "type": "git",
@@ -1,13 +0,0 @@
1
- import { GetCaptchaResponse } from '@prosopo/api';
2
- export interface CaptchaComponentProps {
3
- challenge: GetCaptchaResponse;
4
- index: number;
5
- solutions: string[][];
6
- onSubmit: () => void;
7
- onCancel: () => void;
8
- onClick: (hash: string) => void;
9
- onNext: () => void;
10
- }
11
- export declare const CaptchaComponent: (props: CaptchaComponentProps) => import("react/jsx-runtime").JSX.Element;
12
- export default CaptchaComponent;
13
- //# sourceMappingURL=CaptchaComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptchaComponent.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAUjD,MAAM,WAAW,qBAAqB;IAClC,SAAS,EAAE,kBAAkB,CAAA;IAC7B,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;CACrB;AAED,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,4CAgI5D,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -1,67 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { useTranslation } from '@prosopo/common';
3
- import Box from '@mui/material/Box';
4
- import Button from '@mui/material/Button';
5
- import CaptchaWidget from './CaptchaWidget';
6
- import ThemeProvider from '@mui/material/styles/ThemeProvider';
7
- import Typography from '@mui/material/Typography';
8
- import addDataAttr from '../util';
9
- import theme from './theme';
10
- export const CaptchaComponent = (props) => {
11
- const { t } = useTranslation();
12
- const { challenge, index, solutions, onSubmit, onCancel, onClick, onNext } = props;
13
- const captcha = challenge.captchas[index];
14
- const solution = solutions[index];
15
- return (_jsx(ThemeProvider, { theme: theme, children: _jsx(Box, { sx: {
16
- // center the popup horizontally and vertically
17
- display: 'flex',
18
- alignItems: 'center',
19
- justifyContent: 'center',
20
- // fill entire screen
21
- width: '100%',
22
- height: '100%',
23
- }, children: _jsx(Box, { sx: {
24
- // introduce scroll bars when screen < minWidth of children
25
- overflowX: 'auto',
26
- overflowY: 'auto',
27
- width: '100%',
28
- // limit the popup width
29
- maxWidth: '450px',
30
- // maxHeight introduces vertical scroll bars if children content longer than window
31
- maxHeight: '100%',
32
- }, children: _jsxs(Box, { bgcolor: theme.palette.background.default, sx: {
33
- display: 'flex',
34
- flexDirection: 'column',
35
- // the min width of the popup before scroll bars appear
36
- minWidth: '300px',
37
- }, children: [_jsxs(Box, { px: 2, py: 3, sx: {
38
- // center the header
39
- display: 'flex',
40
- alignItems: 'center',
41
- width: '100%',
42
- }, bgcolor: theme.palette.primary.main, children: [_jsxs(Typography, { sx: {
43
- color: '#ffffff',
44
- fontWeight: 700,
45
- }, children: [t('WIDGET.SELECT_ALL'), ': '] }), _jsx(Typography, { px: 1, sx: {
46
- color: '#ffffff',
47
- fontWeight: 700,
48
- textTransform: 'uppercase',
49
- fontSize: theme.typography.h6.fontSize,
50
- }, children: `${props.challenge.captchas[props.index].captcha.target}` })] }), _jsx(Box, { ...addDataAttr({ dev: { cy: 'captcha-' + props.index } }), children: _jsx(CaptchaWidget, { challenge: captcha, solution: solution, onClick: onClick }) }), _jsx(Box, { px: 2, py: 1, sx: {
51
- display: 'flex',
52
- alignItems: 'center',
53
- justifyContent: 'center',
54
- width: '100%',
55
- }, ...addDataAttr({ dev: { cy: 'dots-captcha' } }), children: challenge.captchas.map((_, i) => (_jsx(Box, { sx: {
56
- width: 7,
57
- height: 7,
58
- borderRadius: '50%',
59
- border: '1px solid #CFCFCF',
60
- }, mx: 0.5, bgcolor: index === i ? theme.palette.background.default : '#CFCFCF' }, i))) }), _jsxs(Box, { px: 2, pt: 0, pb: 2, sx: {
61
- display: 'flex',
62
- alignItems: 'center',
63
- justifyContent: 'space-between',
64
- }, children: [_jsx(Button, { onClick: onCancel, variant: "text", children: t('WIDGET.CANCEL') }), _jsx(Button, { color: "primary", onClick: index < challenge.captchas.length - 1 ? onNext : onSubmit, variant: "contained", ...addDataAttr({ dev: { cy: 'button-next' } }), children: index < challenge.captchas.length - 1 ? t('WIDGET.NEXT') : t('WIDGET.SUBMIT') })] })] }) }) }) }));
65
- };
66
- export default CaptchaComponent;
67
- //# sourceMappingURL=CaptchaComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptchaComponent.js","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,GAAG,MAAM,mBAAmB,CAAA;AACnC,OAAO,MAAM,MAAM,sBAAsB,CAAA;AACzC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,aAAa,MAAM,oCAAoC,CAAA;AAC9D,OAAO,UAAU,MAAM,0BAA0B,CAAA;AACjD,OAAO,WAAW,MAAM,SAAS,CAAA;AACjC,OAAO,KAAK,MAAM,SAAS,CAAA;AAY3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;IAC7D,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IAClF,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IACzC,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;IAEjC,OAAO,CACH,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YACvB,KAAC,GAAG,IACA,EAAE,EAAE;gBACA,+CAA+C;gBAC/C,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,QAAQ;gBACpB,cAAc,EAAE,QAAQ;gBACxB,qBAAqB;gBACrB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;aACjB,YAED,KAAC,GAAG,IACA,EAAE,EAAE;oBACA,2DAA2D;oBAC3D,SAAS,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a,EAAE,EAAE,CAAC,YAE9C,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GACzE,IACP,IACJ,GACJ,GACJ,GACM,CACnB,CAAA;AACL,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -1,9 +0,0 @@
1
- import { CaptchaResponseCaptcha } from '@prosopo/procaptcha';
2
- export interface CaptchaWidgetProps {
3
- challenge: CaptchaResponseCaptcha;
4
- solution: string[];
5
- onClick: (hash: string) => void;
6
- }
7
- export declare const CaptchaWidget: (props: CaptchaWidgetProps) => import("react/jsx-runtime").JSX.Element;
8
- export default CaptchaWidget;
9
- //# sourceMappingURL=CaptchaWidget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaWidget.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAM5D,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,sBAAsB,CAAA;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC;AASD,eAAO,MAAM,aAAa,UAAW,kBAAkB,4CA4GtD,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,77 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useTheme } from '@mui/material';
3
- import Box from '@mui/material/Box';
4
- import CheckIcon from '@mui/icons-material/Check';
5
- import Fade from '@mui/material/Fade';
6
- const getHash = (item) => {
7
- if (!item.hash) {
8
- throw new Error('item.hash is undefined');
9
- }
10
- return item.hash;
11
- };
12
- export const CaptchaWidget = (props) => {
13
- // env
14
- const { challenge, solution, onClick } = props;
15
- const items = challenge.captcha.items;
16
- const theme = useTheme();
17
- return (_jsx(_Fragment, { children: _jsx(Box, { pr: 0.5, pb: 0.5, sx: {
18
- // expand to full height / width of parent
19
- width: '100%',
20
- height: '100%',
21
- // display children in flex, spreading them evenly and wrapping when row length exceeded
22
- display: 'flex',
23
- flexDirection: 'row',
24
- flexWrap: 'wrap',
25
- }, children: items.map((item, index) => {
26
- const hash = getHash(item);
27
- return (_jsx(Box, { pt: 0.5, pl: 0.5, sx: {
28
- // enable the items in the grid to grow in width to use up excess space
29
- flexGrow: 1,
30
- // make the width of each item 1/3rd of the width overall, i.e. 3 columns
31
- flexBasis: '33.3333%',
32
- // include the padding / margin / border in the width
33
- boxSizing: 'border-box',
34
- }, children: _jsxs(Box, { sx: { cursor: 'pointer', height: '100%', width: '100%' }, onClick: () => onClick(hash), children: [_jsx(Box, { sx: { border: 1, borderColor: 'lightgray' }, children: _jsx("img", { style: {
35
- width: '100%',
36
- backgroundColor: 'lightgray',
37
- display: 'block',
38
- objectFit: 'contain',
39
- aspectRatio: '1/1', // force AR to be 1, letterboxing images with different aspect ratios
40
- }, src: item.data, alt: `Captcha image ${index + 1}` }) }), _jsx(Fade, { in: solution.includes(hash), children: _jsx(Box, { sx: {
41
- // relative to where the element _should_ be positioned
42
- position: 'relative',
43
- // make the overlay the full height/width of an item
44
- width: '100%',
45
- height: '100%',
46
- // shift it up 100% to overlay the item element
47
- top: '-100%',
48
- // transition on opacity upon (de)selection
49
- transitionDuration: '300ms',
50
- transitionProperty: 'opacity',
51
- }, children: _jsx(Box, { sx: {
52
- // make the overlay absolute positioned compare to its container
53
- position: 'absolute',
54
- // spread across 100% width/height of the item box
55
- top: 0,
56
- left: 0,
57
- bottom: 0,
58
- right: 0,
59
- height: '100%',
60
- width: '100%',
61
- // display overlays in center
62
- display: 'flex',
63
- alignItems: 'center',
64
- justifyContent: 'center',
65
- // make bg half opacity, i.e. shadowing the item's img
66
- backgroundColor: 'rgba(0,0,0,0.5)',
67
- }, children: _jsx(CheckIcon, { htmlColor: theme.palette.background.default, sx: {
68
- // img must be displayed as block otherwise get's a bottom whitespace border
69
- display: 'block',
70
- // how big the overlay icon is
71
- width: '35%',
72
- height: '35%',
73
- } }) }) }) })] }) }, index));
74
- }) }) }));
75
- };
76
- export default CaptchaWidget;
77
- //# sourceMappingURL=CaptchaWidget.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptchaWidget.js","sourceRoot":"","sources":["../../src/components/CaptchaWidget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAS,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,GAAG,MAAM,mBAAmB,CAAA;AACnC,OAAO,SAAS,MAAM,2BAA2B,CAAA;AACjD,OAAO,IAAI,MAAM,oBAAoB,CAAA;AAQrC,MAAM,OAAO,GAAG,CAAC,IAAS,EAAE,EAAE;IAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;KAC5C;IACD,OAAO,IAAI,CAAC,IAAI,CAAA;AACpB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAE,EAAE;IACvD,MAAM;IACN,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IAC9C,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAA;IACrC,MAAM,KAAK,GAAU,QAAQ,EAAE,CAAA;IAE/B,OAAO,CACH,4BACI,KAAC,GAAG,IACA,EAAE,EAAE,GAAG,EACP,EAAE,EAAE,GAAG,EACP,EAAE,EAAE;gBACA,0CAA0C;gBAC1C,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;gBACd,wFAAwF;gBACxF,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,KAAK;gBACpB,QAAQ,EAAE,MAAM;aACnB,YAEA,KAAK,CAAC,GAAG,CAAC,CA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AChE,QAAQ,EAAE,UAAU;4CACpB,kDAAkD;4CAClD,GAAG,EAAE,CAAC;4CACN,IAAI,EAAE,CAAC;4CACP,MAAM,EAAE,CAAC;4CACT,KAAK,EAAE,CAAC;4CACR,MAAM,EAAE,MAAM;4CACd,KAAK,EAAE,MAAM;4CACb,6BAA6B;4CAC7B,OAAO,EAAE,MAAM;4CACf,UAAU,EAAE,QAAQ;4CACpB,cAAc,EAAE,QAAQ;4CACxB,sDAAsD;4CACtD,eAAe,EAAE,iBAAiB;yCACrC,YAED,KAAC,SAAS,IACN,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAC3C,EAAE,EAAE;gDACA,4EAA4E;gDAC5E,OAAO,EAAE,OAAO;gDAChB,8BAA8B;gDAC9B,KAAK,EAAE,KAAK;gDACZ,MAAM,EAAE,KAAK;6CAChB,GACH,GACA,GACJ,GACH,IACL,IAlED,KAAK,CAmER,CACT,CAAA;YACL,CAAC,CAAC,GACA,GACP,CACN,CAAA;AACL,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,7 +0,0 @@
1
- export declare const ExtensionAccountSelect: ({ value, dappName, onChange, }: {
2
- value?: string | undefined;
3
- dappName: string;
4
- onChange: (value: string) => void;
5
- }) => import("react/jsx-runtime").JSX.Element;
6
- export default ExtensionAccountSelect;
7
- //# sourceMappingURL=ExtensionAccountSelect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExtensionAccountSelect.d.ts","sourceRoot":"","sources":["../../src/components/ExtensionAccountSelect.tsx"],"names":[],"mappings":"AAuBA,eAAO,MAAM,sBAAsB;;cAMrB,MAAM;sBACE,MAAM,KAAK,IAAI;6CAqCpC,CAAA;AAED,eAAe,sBAAsB,CAAA"}
@@ -1,31 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { useTranslation } from '@prosopo/common';
4
- import { web3AccountsSubscribe, web3Enable } from '@polkadot/extension-dapp';
5
- import Autocomplete from '@mui/material/Autocomplete';
6
- import TextField from '@mui/material/TextField';
7
- export const ExtensionAccountSelect = ({ value, dappName, onChange, }) => {
8
- const { t } = useTranslation();
9
- const [accounts, setAccounts] = useState([]);
10
- useEffect(() => {
11
- const prom = web3Enable(dappName).then(() => {
12
- return web3AccountsSubscribe(setAccounts);
13
- });
14
- return () => {
15
- prom.then((unsub) => unsub());
16
- };
17
- }, []);
18
- const account = accounts.find((a) => a.address === value) || null;
19
- return (_jsx(Autocomplete, { disablePortal: true, id: "select-account", options: accounts, value: account, isOptionEqualToValue: (option, value) => option.address === value.address, onChange: (event, value) => {
20
- if (value) {
21
- console.log('Selected account:', value);
22
- onChange(value.address);
23
- }
24
- else {
25
- console.log('Deselected account');
26
- onChange('');
27
- }
28
- }, sx: { width: 550 }, getOptionLabel: (option) => `${option.meta.name}: ${option.address}`, renderInput: (props) => _jsx(TextField, { ...props, label: t('WIDGET.SELECT_ACCOUNT') }) }));
29
- };
30
- export default ExtensionAccountSelect;
31
- //# sourceMappingURL=ExtensionAccountSelect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExtensionAccountSelect.js","sourceRoot":"","sources":["../../src/components/ExtensionAccountSelect.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAkB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,YAAY,MAAM,4BAA4B,CAAA;AACrD,OAAO,SAAS,MAAM,yBAAyB,CAAA;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACnC,KAAK,EACL,QAAQ,EACR,QAAQ,GAKX,EAAE,EAAE;IACD,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAA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C,KAAK,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,uBAAuB,CAAC,GAAI,GACrF,CACL,CAAA;AACL,CAAC,CAAA;AAED,eAAe,sBAAsB,CAAA"}
@@ -1,10 +0,0 @@
1
- import { ProcaptchaCallbacks, ProcaptchaConfigOptional } from '@prosopo/procaptcha';
2
- /**
3
- * The props for the Procaptcha component.
4
- */
5
- export interface ProcaptchaProps {
6
- config: ProcaptchaConfigOptional;
7
- callbacks?: Partial<ProcaptchaCallbacks>;
8
- }
9
- export declare const Procaptcha: (props: ProcaptchaProps) => import("react/jsx-runtime").JSX.Element;
10
- //# sourceMappingURL=Procaptcha.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Procaptcha.d.ts","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIH,mBAAmB,EACnB,wBAAwB,EAK3B,MAAM,qBAAqB,CAAA;AAS5B;;GAEG;AACH,MAAM,WAAW,eAAe;IAE5B,MAAM,EAAE,wBAAwB,CAAA;IAEhC,SAAS,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;CAC3C;AAqFD,eAAO,MAAM,UAAU,UAAW,eAAe,4CA0GhD,CAAA"}
@@ -1,121 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Manager, } from '@prosopo/procaptcha';
3
- import { Alert, Backdrop, CircularProgress } from '@mui/material';
4
- import { useRef, useState } from 'react';
5
- import Box from '@mui/material/Box';
6
- import CaptchaComponent from './CaptchaComponent';
7
- import Checkbox from '@mui/material/Checkbox';
8
- import Link from '@mui/material/Link';
9
- import Typography from '@mui/material/Typography';
10
- /**
11
- * Wrap a ref to be the same format as useState.
12
- * @param defaultValue the default value if the state is not already initialised
13
- * @returns a ref in the same format as a state, e.g. [value, setValue]
14
- */
15
- const useRefAsState = (defaultValue) => {
16
- const ref = useRef(defaultValue);
17
- const setter = (value) => {
18
- ref.current = value;
19
- };
20
- const value = ref.current;
21
- return [value, setter];
22
- };
23
- const useProcaptcha = () => {
24
- // useRef == do not render on variable change
25
- // useState == do render on variable change
26
- // only need to render on visible variables changing
27
- const [isHuman, setIsHuman] = useState(false);
28
- const [index, setIndex] = useState(-1);
29
- const [solutions, setSolutions] = useState([]);
30
- const [captchaApi, setCaptchaApi] = useRefAsState(undefined);
31
- const [showModal, setShowModal] = useState(false);
32
- const [challenge, setChallenge] = useState(undefined);
33
- const [loading, setLoading] = useState(false);
34
- const [account, setAccount] = useState(undefined);
35
- const [dappAccount, setDappAccount] = useState(undefined);
36
- const [submission, setSubmission] = useRefAsState(undefined);
37
- const [timeout, setTimeout] = useRefAsState(undefined);
38
- const [blockNumber, setBlockNumber] = useRefAsState(undefined);
39
- const map = {
40
- isHuman: setIsHuman,
41
- index: setIndex,
42
- solutions: setSolutions,
43
- captchaApi: setCaptchaApi,
44
- showModal: setShowModal,
45
- challenge: setChallenge,
46
- loading: setLoading,
47
- account: setAccount,
48
- dappAccount: setDappAccount,
49
- submission: setSubmission,
50
- timeout: setTimeout,
51
- blockNumber: setBlockNumber,
52
- // don't provide method for updating config, should remain constant
53
- };
54
- return [
55
- // the state
56
- {
57
- isHuman,
58
- index,
59
- solutions,
60
- captchaApi,
61
- showModal,
62
- challenge,
63
- loading,
64
- account,
65
- dappAccount,
66
- submission,
67
- timeout,
68
- blockNumber,
69
- },
70
- // and method to update the state
71
- (nextState) => {
72
- if (nextState.solutions) {
73
- // force a copy of the array to ensure a re-render
74
- // nutshell: react doesn't look inside an array for changes, hence changes to the array need to result in a fresh array
75
- nextState.solutions = nextState.solutions.slice();
76
- }
77
- for (const key in nextState) {
78
- const setter = map[key];
79
- if (!setter) {
80
- throw new Error(`Unknown key ${key}, cannot set state`);
81
- }
82
- setter(nextState[key]);
83
- }
84
- },
85
- ];
86
- };
87
- export const Procaptcha = (props) => {
88
- console.log('config', props.config);
89
- const config = props.config;
90
- const callbacks = props.callbacks || {};
91
- const [state, updateState] = useProcaptcha();
92
- console.log('state', state);
93
- const manager = Manager(config, state, updateState, callbacks);
94
- return (_jsxs(Box, { sx: { maxWidth: '100%', maxHeight: '100%', overflowX: 'auto' }, children: [_jsx(Backdrop, { open: state.showModal, sx: { zIndex: (theme) => theme.zIndex.drawer + 1 }, 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 })) : (_jsx(Alert, { children: "No challenge set." })) }), _jsx(Box, { p: 1, sx: { minWidth: '200px' }, "data-cy": 'button-human', children: _jsxs(Box, { p: 1, border: 1, borderColor: "grey.300", borderRadius: 2, sx: {
95
- display: 'flex',
96
- justifyContent: 'space-between',
97
- alignItems: 'center',
98
- flexWrap: 'wrap',
99
- backgroundColor: 'white',
100
- }, children: [_jsx(Box, { sx: { display: 'flex', flexDirection: 'column' }, children: _jsxs(Box, { sx: {
101
- display: 'flex',
102
- justifyContent: 'flex-start',
103
- alignItems: 'center',
104
- flexWrap: 'wrap',
105
- }, children: [_jsxs(Box, { sx: {
106
- height: '50px',
107
- width: '50px',
108
- display: 'flex',
109
- alignItems: 'center',
110
- justifyContent: 'center',
111
- flexDirection: 'column',
112
- }, children: [_jsx(Box, { sx: {
113
- display: !state.loading ? 'block' : 'none',
114
- }, children: _jsx(Checkbox, { onChange: manager.start, checked: state.isHuman, inputProps: { 'aria-label': 'controlled' }, sx: {
115
- '& .MuiSvgIcon-root': { fontSize: 32 },
116
- } }) }), _jsx(Box, { sx: {
117
- display: state.loading ? 'block' : 'none',
118
- }, children: _jsx(Box, { pt: '5px', children: _jsx(CircularProgress, { size: '24px', disableShrink: true }) }) })] }), _jsx(Box, { p: 1, children: _jsx(Typography, { color: "common.black", children: "I am a human" }) })] }) }), _jsx(Box, { p: 1, sx: { flexGrow: '1', maxWidth: '140px', minWidth: '140px' }, children: _jsx(Link, { href: "https://prosopo.io", target: "_blank", children: _jsx(Box, { children: _jsx("div", { style: { width: '100%', display: 'flex', alignItems: 'middle' }, dangerouslySetInnerHTML: { __html: logo } }) }) }) })] }) })] }));
119
- };
120
- const logo = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67"><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>';
121
- //# sourceMappingURL=Procaptcha.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Procaptcha.js","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGH,OAAO,GAOV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,GAAG,MAAM,mBAAmB,CAAA;AACnC,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAC7C,OAAO,IAAI,MAAM,oBAAoB,CAAA;AACrC,OAAO,UAAU,MAAM,0BAA0B,CAAA;AAYjD;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAK,YAAe,EAA2B,EAAE;IACnE,MAAM,GAAG,GAAG,MAAM,CAAI,YAAY,CAAC,CAAA;IACnC,MAAM,MAAM,GAAG,CAAC,KAAQ,EAAE,EAAE;QACxB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;IACvB,CAAC,CAAA;IACD,MAAM,KAAK,GAAM,G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,EAAE,YAClE,KAAC,IAAI,IAAC,IAAI,EAAC,oBAAoB,EAAC,MAAM,EAAC,QAAQ,YAC3C,KAAC,GAAG,cACA,cACI,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,EAC/D,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GACtC,GACL,GACH,GACL,IACJ,GACJ,IACJ,CACT,CAAA;AACL,CAAC,CAAA;AAED,MAAM,IAAI,GACN,wjHAAwjH,CAAA"}
@@ -1,5 +0,0 @@
1
- export * from './CaptchaWidget';
2
- export * from './CaptchaComponent';
3
- export { default as ExtensionAccountSelect } from './ExtensionAccountSelect';
4
- export * from './Procaptcha';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAeA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAC5E,cAAc,cAAc,CAAA"}
@@ -1,20 +0,0 @@
1
- // Copyright (C) 2021-2023 Prosopo (UK) Ltd.
2
- // This file is part of procaptcha-react <https://github.com/prosopo/procaptcha-react>.
3
- //
4
- // procaptcha-react is free software: you can redistribute it and/or modify
5
- // it under the terms of the GNU General Public License as published by
6
- // the Free Software Foundation, either version 3 of the License, or
7
- // (at your option) any later version.
8
- //
9
- // procaptcha-react is distributed in the hope that it will be useful,
10
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- // GNU General Public License for more details.
13
- //
14
- // You should have received a copy of the GNU General Public License
15
- // along with procaptcha-react. If not, see <http://www.gnu.org/licenses/>.
16
- export * from './CaptchaWidget';
17
- export * from './CaptchaComponent';
18
- export { default as ExtensionAccountSelect } from './ExtensionAccountSelect';
19
- export * from './Procaptcha';
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,uFAAuF;AACvF,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAC5E,cAAc,cAAc,CAAA"}
@@ -1,3 +0,0 @@
1
- declare const _default: import("@mui/material").Theme;
2
- export default _default;
3
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/components/theme.ts"],"names":[],"mappings":";AAEA,wBAOE"}
@@ -1,10 +0,0 @@
1
- import { createTheme } from '@mui/material';
2
- export default createTheme({
3
- palette: {
4
- primary: {
5
- main: '#1976d2',
6
- contrastText: '#fff',
7
- },
8
- },
9
- });
10
- //# sourceMappingURL=theme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/components/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,eAAe,WAAW,CAAC;IACvB,OAAO,EAAE;QACL,OAAO,EAAE;YACL,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,MAAM;SACvB;KACJ;CACJ,CAAC,CAAA"}
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './components';
2
- export * from './util';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA"}
package/dist/index.js DELETED
@@ -1,18 +0,0 @@
1
- // Copyright (C) 2021-2022 Prosopo (UK) Ltd.
2
- // This file is part of procaptcha-react <https://github.com/prosopo/procaptcha-react>.
3
- //
4
- // procaptcha-react is free software: you can redistribute it and/or modify
5
- // it under the terms of the GNU General Public License as published by
6
- // the Free Software Foundation, either version 3 of the License, or
7
- // (at your option) any later version.
8
- //
9
- // procaptcha-react is distributed in the hope that it will be useful,
10
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- // GNU General Public License for more details.
13
- //
14
- // You should have received a copy of the GNU General Public License
15
- // along with procaptcha-react. If not, see <http://www.gnu.org/licenses/>.
16
- export * from './components';
17
- export * from './util';
18
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,uFAAuF;AACvF,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA"}
@@ -1,14 +0,0 @@
1
- /**
2
- * maps any data to data attributes (mapped to { data-[key]: value })
3
- *
4
- * dev - only in development mode
5
- */
6
- export default function addDataAttr({ general, dev, }: {
7
- general?: {
8
- [key: string]: string;
9
- };
10
- dev?: {
11
- [key: string]: string;
12
- };
13
- }): {};
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAChC,OAAO,EACP,GAAG,GACN,EAAE;IACC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACnC,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAClC,MAKA"}
@@ -1,15 +0,0 @@
1
- function renameKeysForDataAttr(data = {}) {
2
- return Object.keys(data).reduce((prev, curr) => ({ ...prev, [`data-${curr}`]: data[curr] }), {});
3
- }
4
- /**
5
- * maps any data to data attributes (mapped to { data-[key]: value })
6
- *
7
- * dev - only in development mode
8
- */
9
- export default function addDataAttr({ general, dev, }) {
10
- return {
11
- ...renameKeysForDataAttr(general),
12
- ...(process.env.NODE_ENV === 'development' ? renameKeysForDataAttr(dev) : {}),
13
- };
14
- }
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,SAAS,qBAAqB,CAAC,OAAkC,EAAE;IAC/D,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AACpG,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAChC,OAAO,EACP,GAAG,GAIN;IACG,OAAO;QACH,GAAG,qBAAqB,CAAC,OAAO,CAAC;QACjC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAChF,CAAA;AACL,CAAC"}