@tap-payments/auth-jsconnect 2.1.5-test → 2.1.7-test

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 (39) hide show
  1. package/build/api/entity.d.ts +1 -1
  2. package/build/app/settings.d.ts +1 -0
  3. package/build/app/settings.js +1 -1
  4. package/build/constants/app.d.ts +1 -0
  5. package/build/constants/app.js +11 -4
  6. package/build/features/app/business/businessStore.js +1 -1
  7. package/build/features/app/entity/entityStore.d.ts +11 -1
  8. package/build/features/app/entity/entityStore.js +139 -4
  9. package/build/features/app/password/passwordStore.d.ts +1 -7
  10. package/build/features/app/password/passwordStore.js +27 -16
  11. package/build/features/bank/screens/BankDetails/IBAN.js +4 -1
  12. package/build/features/connect/screens/Merchant/Merchant.js +10 -4
  13. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +2 -1
  14. package/build/features/connect/screens/Merchant/SalesChannels.js +4 -6
  15. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +3 -1
  16. package/build/features/connect/screens/Merchant/SocialMedia.js +7 -33
  17. package/build/features/connect/screens/Merchant/validation.js +3 -5
  18. package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
  19. package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
  20. package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
  21. package/build/features/entity/screens/Customers/Customers.js +90 -0
  22. package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
  23. package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
  24. package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
  25. package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
  26. package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
  27. package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
  28. package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
  29. package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
  30. package/build/features/entity/screens/Customers/index.d.ts +3 -0
  31. package/build/features/entity/screens/Customers/index.js +2 -0
  32. package/build/features/entity/screens/Customers/validation.d.ts +20 -0
  33. package/build/features/entity/screens/Customers/validation.js +13 -0
  34. package/build/features/featuresScreens.js +5 -0
  35. package/build/features/password/screens/Success/Success.js +7 -3
  36. package/build/hooks/useAppConfig.js +1 -1
  37. package/build/utils/array.d.ts +1 -0
  38. package/build/utils/array.js +8 -0
  39. package/package.json +129 -129
@@ -0,0 +1,98 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import * as React from 'react';
25
+ import Box from '@mui/material/Box';
26
+ import { styled } from '@mui/material/styles';
27
+ import { useTranslation } from 'react-i18next';
28
+ import { useController, useFormContext } from 'react-hook-form';
29
+ import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
30
+ import SimpleList from '../../../../components/SimpleList';
31
+ import Collapse from '../../../../components/Collapse';
32
+ import ExpandIcon from '../../../../components/ExpandIcon';
33
+ import { ScreenContainer } from '../../../shared/Containers';
34
+ import { CheckIconStyled, InputLabelStyled, InputStyled, NameContainer } from './CustomerLocations';
35
+ import { entitySelector, clearError } from '../../../app/entity/entityStore';
36
+ import Search from '../../../shared/Search';
37
+ var ListItemContainer = styled(Box)(function (_a) {
38
+ var theme = _a.theme;
39
+ return ({
40
+ display: 'flex',
41
+ direction: theme.direction
42
+ });
43
+ });
44
+ var SimpleListStyled = styled((SimpleList))(function () { return ({
45
+ height: 'fit-content'
46
+ }); });
47
+ var ExpectedCustomers = function (_a) {
48
+ var rest = __rest(_a, []);
49
+ var _b = React.useState([]), expectedCustomersList = _b[0], setExpectedCustomersList = _b[1];
50
+ var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
51
+ var t = useTranslation().t;
52
+ var isAr = useLanguage().isAr;
53
+ var dispatch = useAppDispatch();
54
+ var control = useFormContext().control;
55
+ var expectedCustomerControl = useController({ name: 'expectedCustomer', control: control });
56
+ var _d = useAppSelector(entitySelector), data = _d.data, error = _d.error;
57
+ var verify = data.verify;
58
+ var response = verify.responseBody;
59
+ var onOpenList = function (event) {
60
+ var _a;
61
+ setAnchorEl(event.currentTarget);
62
+ (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
63
+ };
64
+ var onCloseList = function () {
65
+ var _a, _b;
66
+ setAnchorEl(null);
67
+ (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
68
+ if (((_b = response === null || response === void 0 ? void 0 : response.expectedCustomerSales) === null || _b === void 0 ? void 0 : _b.length) > 0) {
69
+ setExpectedCustomersList(response === null || response === void 0 ? void 0 : response.expectedCustomerSales);
70
+ }
71
+ };
72
+ React.useEffect(function () {
73
+ var _a;
74
+ if (((_a = response === null || response === void 0 ? void 0 : response.expectedCustomerSales) === null || _a === void 0 ? void 0 : _a.length) > 0) {
75
+ setExpectedCustomersList(response === null || response === void 0 ? void 0 : response.expectedCustomerSales);
76
+ }
77
+ }, [response === null || response === void 0 ? void 0 : response.expectedCustomerSales]);
78
+ var onSelectItem = function (expectedCustomers) {
79
+ expectedCustomerControl.field.onChange(expectedCustomers);
80
+ if (error)
81
+ dispatch(clearError());
82
+ onCloseList();
83
+ };
84
+ var handleSearch = function (value) {
85
+ var _a;
86
+ var filteredList = (_a = response === null || response === void 0 ? void 0 : response.expectedCustomerSales) === null || _a === void 0 ? void 0 : _a.filter(function (customer) {
87
+ return customer.name.en.toLowerCase().startsWith(value.toLowerCase()) ||
88
+ customer.name.ar.toLowerCase().startsWith(value.toLowerCase());
89
+ });
90
+ setExpectedCustomersList(filteredList);
91
+ };
92
+ var expectedCustomersValue = expectedCustomerControl.field.value;
93
+ var expectedCustomersSelected = expectedCustomersValue;
94
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: true, placeholder: t('choose_expected_sales'), value: isAr ? expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.ar : expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.en, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedCustomersList, onSelectItem: onSelectItem, renderItem: function (item) {
95
+ return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.name.ar : item.name.en })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})] }));
96
+ } })] }))] }) })));
97
+ };
98
+ export default ExpectedCustomers;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface ExpectedSalesRangeProps {
3
+ show: boolean;
4
+ onListOpen?: () => void;
5
+ onListClose?: () => void;
6
+ }
7
+ declare const ExpectedSalesRange: ({ show, onListClose, onListOpen }: ExpectedSalesRangeProps) => JSX.Element;
8
+ export default ExpectedSalesRange;
@@ -0,0 +1,127 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import Box from '@mui/material/Box';
15
+ import { styled } from '@mui/material/styles';
16
+ import { useTranslation } from 'react-i18next';
17
+ import { useController, useFormContext } from 'react-hook-form';
18
+ import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
19
+ import SimpleList from '../../../../components/SimpleList';
20
+ import Collapse from '../../../../components/Collapse';
21
+ import ExpandIcon from '../../../../components/ExpandIcon';
22
+ import { entitySelector, clearError } from '../../../app/entity/entityStore';
23
+ import { isExist } from '../../../../utils';
24
+ import { ScreenContainer } from '../../../shared/Containers';
25
+ import { InputLabelStyled, CheckIconStyled, InputStyled, NameContainer } from './CustomerLocations';
26
+ import Search from '../../../shared/Search';
27
+ var ListItem = styled(Box)(function (_a) {
28
+ var theme = _a.theme;
29
+ return ({
30
+ display: 'flex',
31
+ justifyContent: 'space-between',
32
+ width: '100%',
33
+ paddingInlineStart: theme.spacing(2.5),
34
+ paddingInlineEnd: theme.spacing(2.5),
35
+ paddingTop: theme.spacing(1.5),
36
+ paddingBottom: theme.spacing(1.5)
37
+ });
38
+ });
39
+ var ListItemContainer = styled(Box)(function () { return ({
40
+ display: 'flex',
41
+ flexDirection: 'column',
42
+ width: '100%'
43
+ }); });
44
+ var SimpleListStyled = styled((SimpleList))(function () { return ({
45
+ height: 'fit-content'
46
+ }); });
47
+ var ExpectedSalesRange = function (_a) {
48
+ var show = _a.show, onListClose = _a.onListClose, onListOpen = _a.onListOpen;
49
+ var _b = React.useState([]), expectedSalesRangeList = _b[0], setExpectedSalesRangeList = _b[1];
50
+ var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
51
+ var _d = React.useState(''), subIndex = _d[0], setSubIndex = _d[1];
52
+ var t = useTranslation().t;
53
+ var isAr = useLanguage().isAr;
54
+ var control = useFormContext().control;
55
+ var dispatch = useAppDispatch();
56
+ var expectedSaleControl = useController({ name: 'expectedSale', control: control });
57
+ var _e = useAppSelector(entitySelector), data = _e.data, error = _e.error;
58
+ var verify = data.verify;
59
+ var expectedSales = (verify.responseBody || {}).expectedSales;
60
+ var expectedSalesRangeValue = expectedSaleControl.field.value;
61
+ var handleOpenMainMenu = function (event) {
62
+ setAnchorEl(event.currentTarget);
63
+ onListOpen === null || onListOpen === void 0 ? void 0 : onListOpen();
64
+ };
65
+ var handleCloseMainMenu = function () {
66
+ setAnchorEl(null);
67
+ onListClose === null || onListClose === void 0 ? void 0 : onListClose();
68
+ handleCloseSubMenu();
69
+ if ((expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) > 0) {
70
+ setExpectedSalesRangeList(expectedSales);
71
+ }
72
+ };
73
+ var handleOpenSubMenu = function (index) {
74
+ if (subIndex === index)
75
+ setSubIndex('');
76
+ else
77
+ setSubIndex(index);
78
+ };
79
+ var handleCloseSubMenu = function () {
80
+ setSubIndex('');
81
+ };
82
+ React.useEffect(function () {
83
+ if ((expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) > 0) {
84
+ setExpectedSalesRangeList(expectedSales);
85
+ }
86
+ }, [expectedSales]);
87
+ var onSelectItem = function (expectedSalesRange) {
88
+ handleCloseMainMenu();
89
+ if (error)
90
+ dispatch(clearError());
91
+ expectedSaleControl.field.onChange(expectedSalesRange);
92
+ };
93
+ var handleSearch = function (value) {
94
+ var filteredList = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.filter(function (salesRange) {
95
+ var _a, _b, _c;
96
+ return salesRange.name.en.toLowerCase().includes(value.toLowerCase()) ||
97
+ salesRange.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase()) ||
98
+ salesRange.name.ar.toLowerCase().includes(value.toLowerCase()) ||
99
+ ((_a = salesRange.sub) === null || _a === void 0 ? void 0 : _a.find(function (obj) { return obj.name.en.toLowerCase().includes(value.toLowerCase()); })) ||
100
+ ((_b = salesRange.sub) === null || _b === void 0 ? void 0 : _b.find(function (obj) {
101
+ return obj.name.en.toLowerCase().replace(',', '').includes(value.toLowerCase());
102
+ })) ||
103
+ ((_c = salesRange.sub) === null || _c === void 0 ? void 0 : _c.find(function (obj) { return obj.name.ar.toLowerCase().includes(value.toLowerCase()); }));
104
+ });
105
+ setExpectedSalesRangeList(filteredList);
106
+ };
107
+ React.useEffect(function () {
108
+ var item = isExist(expectedSales || [], expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id);
109
+ if (item)
110
+ setSubIndex(item.id);
111
+ }, [anchorEl, expectedSalesRangeValue]);
112
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_yearly') }), _jsx(InputStyled, { readOnly: true, value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
113
+ var isOnlyOneItem = !item.sub || item.sub.length === 1;
114
+ if (isOnlyOneItem)
115
+ onSelectItem(item);
116
+ else
117
+ handleOpenSubMenu(item.id);
118
+ }, renderItem: function (item) {
119
+ var _a;
120
+ var isOnlyOneItem = !item.sub || ((_a = item.sub) === null || _a === void 0 ? void 0 : _a.length) === 1;
121
+ var showCheck = item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) && isOnlyOneItem;
122
+ return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 8%)', borderBottom: '1px solid rgba(227, 232, 238, 0.8)' }, (isOnlyOneItem && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isSelected: item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id), sx: __assign({}, (isOnlyOneItem && { paddingInlineStart: '5px' })) }, { children: isAr ? item.name.ar : item.name.en })), showCheck ? _jsx(CheckIconStyled, {}) : !isOnlyOneItem && _jsx(ExpandIcon, { anchorEl: subIndex === item.id })] })), _jsx(Collapse, __assign({ in: item.id === subIndex && !isOnlyOneItem }, { children: _jsx(SimpleListStyled, { sx: { pt: 0, pb: 0 }, list: (!isOnlyOneItem && item.sub) || [], onSelectItem: onSelectItem, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (item, idx) {
123
+ return (_jsxs(ListItem, __assign({ sx: { mt: idx === 0 ? 1 : 0 } }, { children: [_jsx(NameContainer, __assign({ isSelected: item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) }, { children: isAr ? item.name.ar : item.name.en })), item.id === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) && _jsx(CheckIconStyled, {})] })));
124
+ } }) }))] }));
125
+ } })] }))] }) })));
126
+ };
127
+ export default ExpectedSalesRange;
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ export declare const ContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
+ children?: React.ReactNode;
4
+ component?: React.ElementType<any> | undefined;
5
+ ref?: React.Ref<unknown> | undefined;
6
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
7
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
8
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
9
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
10
+ export declare const CheckboxStyled: import("@emotion/styled").StyledComponent<import("../../../../components/CheckBox").CheckboxProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
11
+ export declare const TextStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
12
+ align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
13
+ children?: React.ReactNode;
14
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
15
+ gutterBottom?: boolean | undefined;
16
+ noWrap?: boolean | undefined;
17
+ paragraph?: boolean | undefined;
18
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
19
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | undefined;
20
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2", string>> | undefined;
21
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
22
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
23
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
24
+ export declare const LinkStyled: import("@emotion/styled").StyledComponent<Omit<import("@mui/material/Link").LinkBaseProps, "classes"> & {
25
+ children?: React.ReactNode;
26
+ classes?: Partial<import("@mui/material/Link").LinkClasses> | undefined;
27
+ color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material/styles").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined>);
28
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
29
+ TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material/styles").ClassNameMap<never>>) | undefined;
30
+ underline?: "none" | "always" | "hover" | undefined;
31
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | undefined;
32
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "key" | keyof React.AnchorHTMLAttributes<HTMLAnchorElement>> & {
33
+ ref?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject<HTMLAnchorElement> | null | undefined;
34
+ }, "type" | keyof import("@mui/material/OverridableComponent").CommonProps | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "translate" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "underline" | "variant" | "href" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy" | "TypographyClasses"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
35
+ declare const RefundPolicy: () => JSX.Element;
36
+ export default RefundPolicy;
@@ -0,0 +1,84 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Box from '@mui/material/Box';
14
+ import { styled, alpha } from '@mui/material/styles';
15
+ import CheckBox from '../../../../components/CheckBox';
16
+ import Collapse from '../../../../components/Collapse';
17
+ import { useTranslation } from 'react-i18next';
18
+ import { useLanguage } from '../../../../hooks';
19
+ import { useController, useFormContext } from 'react-hook-form';
20
+ import Text from '../../../../components/Text';
21
+ import Link from '@mui/material/Link';
22
+ import Warning from '../../../../components/Warning';
23
+ import { EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
24
+ import { ScreenContainer } from '../../../shared/Containers';
25
+ import { settingsSelector } from '../../../../app/settings';
26
+ import { useAppSelector } from '../../../../hooks';
27
+ export var ContainerStyled = styled(Box)(function (_a) {
28
+ var theme = _a.theme;
29
+ return ({
30
+ display: 'flex',
31
+ flexDirection: 'row',
32
+ alignItems: 'center',
33
+ padding: theme.spacing(0, 2.5, 1.5, 2.5)
34
+ });
35
+ });
36
+ export var CheckboxStyled = styled(CheckBox)(function (_a) {
37
+ var theme = _a.theme;
38
+ return ({
39
+ margin: theme.spacing(0),
40
+ padding: theme.spacing(0),
41
+ marginInlineEnd: theme.spacing(1),
42
+ color: theme.palette.primary.main,
43
+ '& .MuiSvgIcon-root': {
44
+ fontSize: 30
45
+ },
46
+ '&.Mui-checked': {
47
+ color: theme.palette.text.primary,
48
+ borderRadius: theme.spacing(2.5)
49
+ }
50
+ });
51
+ });
52
+ var CollapseStyled = styled(Collapse)(function () { return ({
53
+ width: '100%'
54
+ }); });
55
+ export var TextStyled = styled(Text)(function (_a) {
56
+ var theme = _a.theme;
57
+ return (__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2));
58
+ });
59
+ export var LinkStyled = styled(Link)(function (_a) {
60
+ var theme = _a.theme;
61
+ return ({
62
+ color: theme.palette.primary.main,
63
+ fontWeight: theme.typography.fontWeightMedium,
64
+ letterSpacing: theme.spacing(0)
65
+ });
66
+ });
67
+ var RefundPolicy = function () {
68
+ var _a;
69
+ var t = useTranslation().t;
70
+ var isAr = useLanguage().isAr;
71
+ var control = useFormContext().control;
72
+ var settingsData = useAppSelector(settingsSelector).data;
73
+ var refundControl = useController({ control: control, name: 'refundPolicy' });
74
+ var refundChecked = refundControl.field.value;
75
+ var warningMessage = (_a = refundControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
76
+ var countryCode = settingsData.businessCountry.iso2.toLowerCase();
77
+ var handleRefundCheckedChange = function (event, checked) {
78
+ refundControl.field.onChange(checked);
79
+ };
80
+ return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr
81
+ ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR
82
+ : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
83
+ };
84
+ export default RefundPolicy;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const TransactionPolicy: () => JSX.Element;
3
+ export default TransactionPolicy;
@@ -0,0 +1,44 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { styled } from '@mui/material/styles';
14
+ import Collapse from '../../../../components/Collapse';
15
+ import { useTranslation } from 'react-i18next';
16
+ import { useLanguage } from '../../../../hooks';
17
+ import { useController, useFormContext } from 'react-hook-form';
18
+ import Warning from '../../../../components/Warning';
19
+ import { EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
20
+ import { ContainerStyled, CheckboxStyled, TextStyled, LinkStyled } from './RefundPolicy';
21
+ import { ScreenContainer } from '../../../shared/Containers';
22
+ import { settingsSelector } from '../../../../app/settings';
23
+ import { useAppSelector } from '../../../../hooks';
24
+ var CollapseStyled = styled(Collapse)(function () { return ({
25
+ width: '100%'
26
+ }); });
27
+ var TransactionPolicy = function () {
28
+ var _a;
29
+ var t = useTranslation().t;
30
+ var isAr = useLanguage().isAr;
31
+ var control = useFormContext().control;
32
+ var settingsData = useAppSelector(settingsSelector).data;
33
+ var transactionControl = useController({ control: control, name: 'transactionPolicy' });
34
+ var transactionChecked = transactionControl.field.value;
35
+ var warningMessage = (_a = transactionControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
36
+ var countryCode = settingsData.businessCountry.iso2.toLowerCase();
37
+ var handleTransactionCheckedChange = function (event, checked) {
38
+ transactionControl.field.onChange(checked);
39
+ };
40
+ return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr
41
+ ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR
42
+ : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
43
+ };
44
+ export default TransactionPolicy;
@@ -0,0 +1,3 @@
1
+ import Customers, { CustomersProps } from './Customers';
2
+ export type { CustomersProps };
3
+ export default Customers;
@@ -0,0 +1,2 @@
1
+ import Customers from './Customers';
2
+ export default Customers;
@@ -0,0 +1,20 @@
1
+ import * as yup from 'yup';
2
+ export declare const CustomerInfoValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
4
+ expectedCustomers: any;
5
+ expectedSalesRange: any;
6
+ refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
7
+ transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
8
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
+ customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
10
+ expectedCustomers: any;
11
+ expectedSalesRange: any;
12
+ refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
13
+ transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
14
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
+ customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
16
+ expectedCustomers: any;
17
+ expectedSalesRange: any;
18
+ refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
19
+ transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
20
+ }>>>;
@@ -0,0 +1,13 @@
1
+ import * as yup from 'yup';
2
+ var objectElements = {
3
+ id: yup.number(),
4
+ name_ar: yup.string(),
5
+ name_en: yup.string()
6
+ };
7
+ export var CustomerInfoValidation = yup.object().shape({
8
+ customerLocations: yup.array().required('please_choose_base'),
9
+ expectedCustomers: yup.object().shape(objectElements).required('select_expected_customers_serve'),
10
+ expectedSalesRange: yup.object().shape(objectElements).required('select_expected_sales'),
11
+ refundPolicy: yup.boolean().required().isTrue('refund_policy_error'),
12
+ transactionPolicy: yup.boolean().required().isTrue('transaction_policy_error')
13
+ });
@@ -44,6 +44,7 @@ import SignInOTPPage from './signIn/screens/OTP';
44
44
  import SignInPasswordPage from './signIn/screens/Password';
45
45
  import EntityVerifyPage from './entity/screens/Verify';
46
46
  import EntityInfoConfirmPage from './entity/screens/EntityInfoConfirm';
47
+ import EntityCustomersPage from './entity/screens/Customers';
47
48
  import EntitySuccessPage from './entity/screens/Success';
48
49
  import EntitySuccessWithFlowPage from './entity/screens/SuccessWithFlowButtons';
49
50
  import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSuccess';
@@ -227,6 +228,10 @@ export var entityFeatureScreens = [
227
228
  name: 'ENTITY_INFO_STEP',
228
229
  element: EntityInfoConfirmPage
229
230
  },
231
+ {
232
+ name: 'ENTITY_CUSTOMERS_STEP',
233
+ element: EntityCustomersPage
234
+ },
230
235
  {
231
236
  name: 'ENTITY_DETAILS_SUCCESS_STEP',
232
237
  element: EntitySuccessPage
@@ -8,15 +8,19 @@ import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
8
8
  var Success = function (_a) {
9
9
  var t = useTranslation().t;
10
10
  var dispatch = useAppDispatch();
11
- var _b = useAppSelector(passwordSelector), loading = _b.loading, error = _b.error, data = _b.data;
11
+ var _b = useAppSelector(passwordSelector), error = _b.error, loading = _b.loading, data = _b.data;
12
12
  var operationType = data.verify.operationType;
13
- var onSuccess = function () {
13
+ var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
14
+ React.useEffect(function () {
14
15
  if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
15
16
  dispatch(retrieveBoardResetPasswordSuccess());
16
17
  return;
17
18
  }
18
19
  dispatch(updateBoardSuccess());
20
+ }, []);
21
+ var onSuccess = function () {
22
+ setClicked(true);
19
23
  };
20
- return (_jsx(SuccessScreen, { title: t('password_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
24
+ return (_jsx(SuccessScreen, { title: t('password_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && loading, error: error || '' }));
21
25
  };
22
26
  export default React.memo(Success);
@@ -56,6 +56,6 @@ export var useAppConfig = function (_a) {
56
56
  setBaseUrl();
57
57
  setAppConfig();
58
58
  dispatch(handleLanguage(rest.language));
59
- dispatch(fetchAppSettingsSync({ disableCountries: disableCountries, disableLocale: disableLocale }));
59
+ dispatch(fetchAppSettingsSync({ disableCountries: disableCountries, disableLocale: disableLocale, mdn: rest.merchantDomain }));
60
60
  }, []);
61
61
  };
@@ -59,3 +59,4 @@ export declare const fixBrandList: (items: Array<{
59
59
  }>, salesChannel: Array<SaleChannel>) => {
60
60
  channel_services: any[];
61
61
  }[];
62
+ export declare const findFirstId: (items: Array<SaleChannel>) => string;
@@ -121,3 +121,11 @@ export var fixBrandList = function (items, salesChannel) {
121
121
  return __assign(__assign({}, item), { channel_services: removeDuplicationById(mapBrandSalesChannel(salesChannel, item.channel_services || [])) });
122
122
  });
123
123
  };
124
+ export var findFirstId = function (items) {
125
+ var first = items[0];
126
+ if (!first)
127
+ return '';
128
+ if (first.sub && first.sub.length > 0)
129
+ return first.sub[0].id;
130
+ return first.id;
131
+ };