@tap-payments/auth-jsconnect 1.0.84 → 1.0.87

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 (55) hide show
  1. package/build/@types/app.d.ts +11 -7
  2. package/build/app/settings.d.ts +4 -1
  3. package/build/app/settings.js +14 -3
  4. package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
  5. package/build/components/AnimationFlow/AnimationFlow.js +3 -3
  6. package/build/components/AnimationFlow/BottomSheet.js +7 -2
  7. package/build/components/AnimationFlow/Dialog.d.ts +2 -1
  8. package/build/components/AnimationFlow/Dialog.js +6 -4
  9. package/build/components/AnimationFlow/Loader.js +1 -1
  10. package/build/constants/api.js +1 -1
  11. package/build/constants/assets.d.ts +3 -0
  12. package/build/constants/assets.js +3 -0
  13. package/build/features/app/bank/bankStore.js +1 -1
  14. package/build/features/app/business/businessStore.js +12 -10
  15. package/build/features/app/individual/individualStore.js +1 -1
  16. package/build/features/app/password/passwordStore.js +1 -1
  17. package/build/features/app/tax/taxStore.js +1 -1
  18. package/build/features/bank/Bank.js +8 -8
  19. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  20. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -4
  21. package/build/features/business/Business.js +8 -8
  22. package/build/features/business/screens/Customers/ExpectedSalesRange.js +1 -1
  23. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -6
  24. package/build/features/connect/Connect.js +8 -8
  25. package/build/features/connect/screens/Individual/MobileNumber.js +10 -4
  26. package/build/features/connect/screens/Mobile/MobileNumber.js +10 -4
  27. package/build/features/individual/Individual.js +8 -8
  28. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +16 -5
  29. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -4
  30. package/build/features/password/Password.js +8 -8
  31. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -4
  32. package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +1 -1
  33. package/build/features/shared/Background/Background.d.ts +10 -0
  34. package/build/features/shared/Background/Background.js +29 -0
  35. package/build/features/shared/Background/LogoBackground.d.ts +6 -0
  36. package/build/features/shared/Background/LogoBackground.js +70 -0
  37. package/build/features/shared/Background/index.d.ts +2 -0
  38. package/build/features/shared/Background/index.js +2 -0
  39. package/build/features/shared/Button/Button.d.ts +1 -2
  40. package/build/features/shared/Button/FlowsButtons.js +35 -20
  41. package/build/features/shared/Button/SuccessButton.d.ts +3 -3
  42. package/build/features/shared/Button/SuccessButton.js +32 -37
  43. package/build/features/shared/Containers/FeatureContainer.js +3 -0
  44. package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
  45. package/build/features/tax/Tax.js +8 -8
  46. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -5
  47. package/build/hooks/useAppConfig.js +12 -3
  48. package/build/theme/components.js +9 -0
  49. package/build/utils/array.d.ts +1 -0
  50. package/build/utils/array.js +13 -2
  51. package/build/utils/locale.d.ts +1 -1
  52. package/build/utils/locale.js +5 -3
  53. package/build/utils/validation.d.ts +1 -0
  54. package/build/utils/validation.js +3 -0
  55. package/package.json +1 -1
@@ -105,6 +105,8 @@ interface LibCallbacks {
105
105
  }
106
106
  export interface LibConfig extends LibCallbacks {
107
107
  publicKey: string;
108
+ open: boolean;
109
+ merchantDomain: string;
108
110
  language: LanguageMode;
109
111
  appInfo: AppInfo;
110
112
  businessCountryCode: string;
@@ -150,14 +152,16 @@ export interface DeviceInfo {
150
152
  entry: Entry;
151
153
  }
152
154
  export interface LocalProps {
153
- en: {
154
- translation: {
155
- [key: string]: any;
155
+ [country: string]: {
156
+ ar: {
157
+ translation: {
158
+ [key: string]: string;
159
+ };
156
160
  };
157
- };
158
- ar: {
159
- translation: {
160
- [key: string]: any;
161
+ en: {
162
+ translation: {
163
+ [key: string]: string;
164
+ };
161
165
  };
162
166
  };
163
167
  }
@@ -19,10 +19,13 @@ export interface SettingsData {
19
19
  deviceInfo: DeviceInfo;
20
20
  appConfig: LibConfig;
21
21
  open: boolean;
22
+ isTapOrigin: boolean;
22
23
  }
23
24
  export interface SettingsState extends SharedState<SettingsData> {
24
25
  }
25
26
  export declare const settingsSlice: import("@reduxjs/toolkit").Slice<SettingsState, {
27
+ handleIsTapOrigin: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<boolean>) => void;
28
+ handleOpen: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<boolean>) => void;
26
29
  handleSkin: (state: SettingsState, action: ActionState<ThemeMode>) => void;
27
30
  handleLanguage: (state: SettingsState, action: ActionState<LanguageMode>) => void;
28
31
  handleNextScreenStep: (state: SettingsState, action: ActionState<string | undefined>) => void;
@@ -31,7 +34,7 @@ export declare const settingsSlice: import("@reduxjs/toolkit").Slice<SettingsSta
31
34
  handleActiveFlowScreens: (state: SettingsState, action: ActionState<Array<ScreenStepNavigation>>) => void;
32
35
  handleSetAppConfig: (state: SettingsState, action: ActionState<LibConfig>) => void;
33
36
  }, "settings">;
34
- export declare const handleSkin: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeMode, string>, handleLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<LanguageMode, string>, handleActiveFlowScreens: import("@reduxjs/toolkit").ActionCreatorWithPayload<ScreenStepNavigation[], string>, handleNextScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handlePrevScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handleCurrentActiveScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleSetAppConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<LibConfig, string>;
37
+ export declare const handleSkin: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeMode, string>, handleLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<LanguageMode, string>, handleActiveFlowScreens: import("@reduxjs/toolkit").ActionCreatorWithPayload<ScreenStepNavigation[], string>, handleNextScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handlePrevScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handleCurrentActiveScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleSetAppConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<LibConfig, string>, handleOpen: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handleIsTapOrigin: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
35
38
  declare const _default: import("redux").Reducer<SettingsState, import("redux").AnyAction>;
36
39
  export default _default;
37
40
  export declare const settingsSelector: (state: RootState) => SettingsState;
@@ -92,6 +92,7 @@ var initialState = {
92
92
  loading: false,
93
93
  data: {
94
94
  open: true,
95
+ isTapOrigin: true,
95
96
  skin: getStoredData(LOCAL_STORAGE_KEYS.themeMode) || 'light',
96
97
  language: getStoredData(LOCAL_STORAGE_KEYS.languageMode) || 'en',
97
98
  featureScreensNavigation: [],
@@ -104,6 +105,12 @@ export var settingsSlice = createSlice({
104
105
  name: 'settings',
105
106
  initialState: initialState,
106
107
  reducers: {
108
+ handleIsTapOrigin: function (state, action) {
109
+ state.data.isTapOrigin = action.payload;
110
+ },
111
+ handleOpen: function (state, action) {
112
+ state.data.open = action.payload;
113
+ },
107
114
  handleSkin: function (state, action) {
108
115
  state.data.skin = action.payload;
109
116
  storeData(LOCAL_STORAGE_KEYS.themeMode, action.payload);
@@ -158,7 +165,7 @@ export var settingsSlice = createSlice({
158
165
  state.data.activeScreen = action.payload[0];
159
166
  },
160
167
  handleSetAppConfig: function (state, action) {
161
- var _a = action.payload, appInfo = _a.appInfo, businessCountryCode = _a.businessCountryCode, language = _a.language, onError = _a.onError, onFlowCompleted = _a.onFlowCompleted, publicKey = _a.publicKey;
168
+ var _a = action.payload, appInfo = _a.appInfo, businessCountryCode = _a.businessCountryCode, language = _a.language, onError = _a.onError, onFlowCompleted = _a.onFlowCompleted, publicKey = _a.publicKey, merchantDomain = _a.merchantDomain, open = _a.open;
162
169
  if (!appInfo.name)
163
170
  throw new Error('App name is required');
164
171
  if (!businessCountryCode)
@@ -171,6 +178,10 @@ export var settingsSlice = createSlice({
171
178
  throw new Error('On error function is required');
172
179
  if (!onFlowCompleted)
173
180
  throw new Error('On flow completed function is required');
181
+ if (!merchantDomain)
182
+ throw new Error('Merchant domain is required');
183
+ if (typeof open !== 'boolean')
184
+ throw new Error('Open is required');
174
185
  state.data.appConfig = action.payload;
175
186
  }
176
187
  },
@@ -240,7 +251,7 @@ export var settingsSlice = createSlice({
240
251
  .addCase(getLocale.fulfilled, function (state, action) {
241
252
  state.loading = false;
242
253
  state.error = null;
243
- updateLocale(action.payload);
254
+ updateLocale(action.payload, state.data.appConfig.businessCountryCode);
244
255
  })
245
256
  .addCase(getLocale.rejected, function (state, action) {
246
257
  state.loading = false;
@@ -248,6 +259,6 @@ export var settingsSlice = createSlice({
248
259
  });
249
260
  }
250
261
  });
251
- export var handleSkin = (_a = settingsSlice.actions, _a.handleSkin), handleLanguage = _a.handleLanguage, handleActiveFlowScreens = _a.handleActiveFlowScreens, handleNextScreenStep = _a.handleNextScreenStep, handlePrevScreenStep = _a.handlePrevScreenStep, handleCurrentActiveScreen = _a.handleCurrentActiveScreen, handleSetAppConfig = _a.handleSetAppConfig;
262
+ export var handleSkin = (_a = settingsSlice.actions, _a.handleSkin), handleLanguage = _a.handleLanguage, handleActiveFlowScreens = _a.handleActiveFlowScreens, handleNextScreenStep = _a.handleNextScreenStep, handlePrevScreenStep = _a.handlePrevScreenStep, handleCurrentActiveScreen = _a.handleCurrentActiveScreen, handleSetAppConfig = _a.handleSetAppConfig, handleOpen = _a.handleOpen, handleIsTapOrigin = _a.handleIsTapOrigin;
252
263
  export default settingsSlice.reducer;
253
264
  export var settingsSelector = function (state) { return state.settings; };
@@ -2,10 +2,11 @@ import * as React from 'react';
2
2
  export interface AnimationFlowProps {
3
3
  open: boolean;
4
4
  children: React.ReactNode;
5
+ isTapOrigin?: boolean;
5
6
  footer?: React.ReactNode;
6
7
  type?: 'PUPOP' | 'BOTTOMSHEET';
7
8
  breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
8
9
  loading?: boolean;
9
10
  error?: string | null;
10
11
  }
11
- export default function AnimationFlow({ open, children, breakpoint, type, footer, loading, error }: AnimationFlowProps): JSX.Element;
12
+ export default function AnimationFlow({ open, children, breakpoint, type, footer, loading, error, isTapOrigin }: AnimationFlowProps): JSX.Element;
@@ -17,7 +17,7 @@ import BottomSheet from './BottomSheet';
17
17
  import Loader from './Loader';
18
18
  import Error from './Error';
19
19
  export default function AnimationFlow(_a) {
20
- var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, footer = _a.footer, loading = _a.loading, error = _a.error;
20
+ var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, footer = _a.footer, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin;
21
21
  var theme = useTheme();
22
22
  var matches = useMediaQuery(theme.breakpoints.down(breakpoint || 'sm'));
23
23
  if (loading) {
@@ -27,10 +27,10 @@ export default function AnimationFlow(_a) {
27
27
  return _jsx(Error, { error: error });
28
28
  }
29
29
  if (type === 'PUPOP') {
30
- return (_jsx(Dialog, __assign({ footer: footer, open: open }, { children: children })));
30
+ return (_jsx(Dialog, __assign({ footer: footer, open: open, isTapOrigin: isTapOrigin }, { children: children })));
31
31
  }
32
32
  if (type === 'BOTTOMSHEET') {
33
33
  return _jsx(BottomSheet, __assign({ open: open }, { children: children }));
34
34
  }
35
- return matches ? (_jsx(BottomSheet, __assign({ open: open }, { children: children }))) : (_jsx(Dialog, __assign({ open: open, footer: footer }, { children: children })));
35
+ return matches ? (_jsx(BottomSheet, __assign({ open: open }, { children: children }))) : (_jsx(Dialog, __assign({ open: open, footer: footer, isTapOrigin: isTapOrigin }, { children: children })));
36
36
  }
@@ -32,8 +32,13 @@ var BottomSheetStyled = styled(BottomSheet)(function (_a) {
32
32
  width: '75px',
33
33
  height: '5px'
34
34
  },
35
+ '[data-rsbs-backdrop]': {
36
+ backgroundColor: 'transparent'
37
+ },
35
38
  '[data-rsbs-header]': {
36
- paddingBottom: theme.spacing(3)
39
+ paddingBottom: theme.spacing(6),
40
+ position: 'absolute',
41
+ width: '100vw'
37
42
  },
38
43
  '[data-rsbs-overlay]': {
39
44
  backgroundColor: theme.palette.background.paper
@@ -57,7 +62,7 @@ var BottomSheetComponent = function (_a) {
57
62
  var open = _a.open, children = _a.children, rest = __rest(_a, ["open", "children"]);
58
63
  var getMinHeight = function (maxHeight) {
59
64
  var element = document.getElementById('main-feature-container');
60
- var height = element ? element.clientHeight + 30 : 0;
65
+ var height = element ? element.clientHeight + 40 : 0;
61
66
  return height || maxHeight * 0.7;
62
67
  };
63
68
  return (_jsx(BottomSheetStyled, __assign({ open: open, snapPoints: function (_a) {
@@ -2,9 +2,10 @@ import * as React from 'react';
2
2
  import { DialogProps as MUIDialogProps } from '@mui/material/Dialog';
3
3
  export interface DialogProps extends MUIDialogProps {
4
4
  open: boolean;
5
+ isTapOrigin?: boolean;
5
6
  children: React.ReactNode;
6
7
  footer?: React.ReactNode;
7
8
  transitionDuration?: number;
8
9
  }
9
- declare const _default: React.MemoExoticComponent<({ open, children, footer, transitionDuration, ...rest }: DialogProps) => JSX.Element>;
10
+ declare const _default: React.MemoExoticComponent<({ open, children, footer, transitionDuration, isTapOrigin, ...rest }: DialogProps) => JSX.Element>;
10
11
  export default _default;
@@ -32,6 +32,7 @@ import { useLanguage } from '../../hooks';
32
32
  import Slide from '../Slide';
33
33
  import LogoBadge from '../LogoBadge';
34
34
  import Icon from '../Icon';
35
+ import Collapse from '../Collapse';
35
36
  var Transition = React.forwardRef(function Transition(props, ref) {
36
37
  return _jsx(Slide, __assign({ direction: 'up', ref: ref }, props));
37
38
  });
@@ -42,7 +43,7 @@ var PaperStyled = styled(Paper)(function (_a) {
42
43
  borderRadius: theme.spacing(1.5),
43
44
  backgroundColor: theme.palette.background.paper,
44
45
  color: theme.palette.text.primary,
45
- margin: "".concat(theme.spacing(5, 4, 4, 5), " !important"),
46
+ margin: "".concat(theme.spacing(5, 4, 5, 4), " !important"),
46
47
  maxHeight: "calc(100% - ".concat(theme.spacing(10), ") !important"),
47
48
  width: theme.spacing(46.875),
48
49
  maxWidth: theme.spacing(46.875)
@@ -52,6 +53,7 @@ var DialogContentStyled = styled(DialogContent)(function (_a) {
52
53
  var theme = _a.theme;
53
54
  return ({
54
55
  padding: theme.spacing(0),
56
+ paddingTop: theme.spacing(3.75),
55
57
  width: '100%',
56
58
  '&::-webkit-scrollbar': {
57
59
  width: '0px'
@@ -70,7 +72,7 @@ var LogoIconBoxStyled = styled(Box)(function (_a) {
70
72
  var _b;
71
73
  var theme = _a.theme;
72
74
  return (_b = {
73
- paddingTop: theme.spacing(6.875),
75
+ paddingTop: theme.spacing(3.125),
74
76
  paddingBottom: theme.spacing(2.5),
75
77
  width: '100%',
76
78
  display: 'flex',
@@ -90,7 +92,7 @@ var LogoIconStyled = styled(Icon)(function (_a) {
90
92
  });
91
93
  });
92
94
  var Dialog = function (_a) {
93
- var open = _a.open, children = _a.children, footer = _a.footer, transitionDuration = _a.transitionDuration, rest = __rest(_a, ["open", "children", "footer", "transitionDuration"]);
95
+ var open = _a.open, children = _a.children, footer = _a.footer, transitionDuration = _a.transitionDuration, isTapOrigin = _a.isTapOrigin, rest = __rest(_a, ["open", "children", "footer", "transitionDuration", "isTapOrigin"]);
94
96
  var isAr = useLanguage().isAr;
95
97
  return (_jsxs(MuiDialog, __assign({ PaperProps: {
96
98
  elevation: 0
@@ -98,6 +100,6 @@ var Dialog = function (_a) {
98
100
  '& .MuiDialog-paper': {
99
101
  overflowY: 'visible'
100
102
  }
101
- }, PaperComponent: PaperStyled, open: open, TransitionComponent: Transition, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, { children: [_jsxs(DialogContentStyled, { children: [_jsx(LogoBadge, { src: ICONS_NAMES.LOGO_ICON }), _jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) }), children] }), footer] })));
103
+ }, hideBackdrop: true, PaperComponent: PaperStyled, open: open, TransitionComponent: Transition, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, { children: [_jsxs(DialogContentStyled, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [_jsx(LogoBadge, { src: ICONS_NAMES.LOGO_ICON }), _jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) })] })), children] }), footer] })));
102
104
  };
103
105
  export default React.memo(Dialog);
@@ -12,5 +12,5 @@ var BoxStyled = styled(Box)(function () { return ({
12
12
  zIndex: 2
13
13
  }); });
14
14
  export default function FlowLoading() {
15
- return (_jsx(BoxStyled, { children: _jsx(Loader, { svgStyle: { width: 60, height: 60 }, innerColor: '#000', outerColor: '#000', toggleAnimation: true }) }));
15
+ return (_jsx(BoxStyled, { children: _jsx(Loader, { svgStyle: { width: 60, height: 60 }, innerColor: 'white', outerColor: 'white', toggleAnimation: true }) }));
16
16
  }
@@ -22,7 +22,7 @@ var SIGNUP_PATH = '/signup';
22
22
  var SOURCE_INCOME_PATH = '/v2/sourceOfIncome';
23
23
  var MONTHLY_INCOME_PATH = '/v2/monthlyIncome';
24
24
  var BRAND_LIST_PATH = '/brand/list';
25
- var FIREBASE_URL = 'https://goconnect-195cd-default-rtdb.asia-southeast1.firebasedatabase.app/sandbox/local.json';
25
+ var FIREBASE_URL = 'https://goconnect-195cd-default-rtdb.asia-southeast1.firebasedatabase.app/locale.json';
26
26
  export var ENDPOINT_PATHS = {
27
27
  BASE_URL: API_BASE_URL,
28
28
  BUSINESS_COUNTRIES: API_BUSINESS_COUNTRIES,
@@ -25,6 +25,9 @@ export declare const ICONS_NAMES: {
25
25
  CR_ICON: string;
26
26
  CR_ACTIVE_ICON: string;
27
27
  INSTAGRAM_ACTIVE_ICON: string;
28
+ TAP_LOGO_EN_ICON: string;
29
+ TAP_LOGO_TEXT_AR: string;
30
+ TAP_LOGO_TEXT_EN: string;
28
31
  TAP_EN: string;
29
32
  TAP_AR: string;
30
33
  ID_IMAGE: string;
@@ -25,6 +25,9 @@ export var ICONS_NAMES = {
25
25
  CR_ICON: ICONS_FULL_PATH + '/cr' + ICONS_EXTENSION,
26
26
  CR_ACTIVE_ICON: ICONS_FULL_PATH + '/cr_active' + ICONS_EXTENSION,
27
27
  INSTAGRAM_ACTIVE_ICON: ICONS_FULL_PATH + '/Insta-active' + ICONS_EXTENSION,
28
+ TAP_LOGO_EN_ICON: ICONS_FULL_PATH + '/tap-white-logo' + ICONS_EXTENSION,
29
+ TAP_LOGO_TEXT_AR: ICONS_FULL_PATH + '/tap-white-text-ar' + ICONS_EXTENSION,
30
+ TAP_LOGO_TEXT_EN: ICONS_FULL_PATH + '/tap-white-text-en' + ICONS_EXTENSION,
28
31
  TAP_EN: 'https://tap-connecet.b-cdn.net/imgs/tapEN' + ICONS_EXTENSION,
29
32
  TAP_AR: 'https://tap-connecet.b-cdn.net/imgs/tapAR' + ICONS_EXTENSION,
30
33
  ID_IMAGE: 'https://villageofwarwick.org/wp-content/uploads/2020/02/ICON99-512-1.png',
@@ -307,7 +307,7 @@ export var bankSlice = createSlice({
307
307
  state.error = description;
308
308
  return;
309
309
  }
310
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: (response === null || response === void 0 ? void 0 : response.flows) || [] });
310
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
311
311
  removeRequestHeaders();
312
312
  })
313
313
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -299,15 +299,13 @@ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', funct
299
299
  return [4, API.entityService.createEntityInfo(requestBody)];
300
300
  case 1:
301
301
  data = (_f.sent()).data;
302
- if (!!data.errors) return [3, 3];
303
- thunkApi.dispatch(updateStepName(stepName));
304
- return [4, thunkApi.dispatch(retrieveDataList())];
305
- case 2:
306
- _f.sent();
307
- thunkApi.dispatch(handleNextScreenStep());
308
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
309
- _f.label = 3;
310
- case 3: return [2, { data: data, formData: __assign({}, params) }];
302
+ thunkApi.dispatch(retrieveDataList());
303
+ if (!data.errors) {
304
+ thunkApi.dispatch(updateStepName(stepName));
305
+ thunkApi.dispatch(handleNextScreenStep());
306
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
307
+ }
308
+ return [2, { data: data, formData: __assign({}, params) }];
311
309
  }
312
310
  });
313
311
  }); });
@@ -658,6 +656,7 @@ export var businessSlice = createSlice({
658
656
  if (!!selectedActivity)
659
657
  state.data.activitiesData.activities = [selectedActivity];
660
658
  state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, data), state.data.businessTypeData.responseBody), { activities: activities });
659
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity });
661
660
  })
662
661
  .addCase(updateLeadBusinessType.rejected, function (state, action) {
663
662
  state.loading = false;
@@ -706,7 +705,10 @@ export var businessSlice = createSlice({
706
705
  return;
707
706
  }
708
707
  state.data.activitiesData = formData;
708
+ console.log('updateActivitiesInfo', state.data.activitiesData.responseBody);
709
+ console.log('updateActivitiesInfo', data);
709
710
  state.data.activitiesData.responseBody = __assign(__assign({}, data), state.data.activitiesData.responseBody);
711
+ console.log('updateActivitiesInfo', state.data.activitiesData.responseBody);
710
712
  })
711
713
  .addCase(updateActivitiesInfo.rejected, function (state, action) {
712
714
  state.loading = false;
@@ -770,7 +772,7 @@ export var businessSlice = createSlice({
770
772
  state.error = description;
771
773
  return;
772
774
  }
773
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: response.flows });
775
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
774
776
  removeRequestHeaders();
775
777
  })
776
778
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -392,7 +392,7 @@ export var individualSlice = createSlice({
392
392
  state.error = description;
393
393
  return;
394
394
  }
395
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: response.flows });
395
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
396
396
  removeRequestHeaders();
397
397
  })
398
398
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -299,7 +299,7 @@ export var passwordSlice = createSlice({
299
299
  state.error = description;
300
300
  return;
301
301
  }
302
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: response.flows });
302
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
303
303
  removeRequestHeaders();
304
304
  })
305
305
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -297,7 +297,7 @@ export var taxSlice = createSlice({
297
297
  state.error = description;
298
298
  return;
299
299
  }
300
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: response.flows });
300
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
301
301
  removeRequestHeaders();
302
302
  })
303
303
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect } from 'react';
13
+ import { memo, useEffect } from 'react';
14
14
  import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig } from '../../hooks';
15
15
  import { settingsSelector } from '../../app/settings';
16
16
  import AnimationFlow from '../../components/AnimationFlow';
@@ -23,15 +23,15 @@ import { BANK_SCREENS_NAVIGATION } from '../../constants';
23
23
  import { bankFeatureScreens } from '../featuresScreens';
24
24
  import CustomFooter from '../shared/Footer';
25
25
  import { bankSelector, verifyLeadToken } from '../app/bank/bankStore';
26
+ import Background from '../shared/Background';
26
27
  var Bank = memo(function (props) {
27
- var open = React.useState(true)[0];
28
28
  var theme = useAppTheme().theme;
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
31
  var customLoading = useAppSelector(bankSelector).customLoading;
32
32
  var loading = useAppConfig(__assign({ navigation: BANK_SCREENS_NAVIGATION }, props)).loading;
33
33
  useErrorListener();
34
- var activeScreen = data.activeScreen;
34
+ var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
35
35
  var verifyToken = function () {
36
36
  var token = getParameterByName('token');
37
37
  if (!token)
@@ -42,11 +42,11 @@ var Bank = memo(function (props) {
42
42
  if (!loading)
43
43
  verifyToken();
44
44
  }, [loading]);
45
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
46
- var Element = _a.element, name = _a.name;
47
- var isActive = activeScreen.name === name;
48
- return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
49
- }) }) })) })));
45
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
46
+ var Element = _a.element, name = _a.name;
47
+ var isActive = activeScreen.name === name;
48
+ return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
49
+ }) }) })) })) })));
50
50
  });
51
51
  export function BankLib(props) {
52
52
  return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Bank, __assign({}, props)) })));
@@ -3,8 +3,8 @@ import * as yup from 'yup';
3
3
  export var BankValidation = yup.object().shape({
4
4
  iban: yup
5
5
  .string()
6
- .matches(/^[a-zA-Z]{2}\d{14,}$/g, 'invalid_iban_format')
7
- .min(16, 'invalid_iban_format')
6
+ .matches(/^[a-zA-Z]{2}[a-zA-Z0-9]{13,34}$/g, 'invalid_iban_format')
7
+ .min(15, 'invalid_iban_format')
8
8
  .max(34, 'invalid_iban_format')
9
9
  .required('alert_iban'),
10
10
  bankName: yup.string().optional(),
@@ -16,7 +16,7 @@ import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { showLastFour } from '../../../../utils';
19
+ import { allAreTruthy, showLastFour } from '../../../../utils';
20
20
  import { bankSelector } from '../../../app/bank/bankStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
@@ -76,8 +76,6 @@ var SuccessWithFlowButtons = function () {
76
76
  setIsAcceptance(true);
77
77
  var isCompleted = status === 'completed' && name !== 'password';
78
78
  var isIndividual = name === 'individual';
79
- if (name !== 'password')
80
- statuses.push(isCompleted);
81
79
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
82
80
  var hoverSrc = "".concat(name, "_white_icon");
83
81
  return {
@@ -90,7 +88,7 @@ var SuccessWithFlowButtons = function () {
90
88
  };
91
89
  });
92
90
  setButtons(mappedFlows);
93
- var isAllCompleted = statuses.filter(function (status) { return status; }).length === flows.length;
91
+ var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
94
92
  if (isAllCompleted)
95
93
  setIsPayout(true);
96
94
  };
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect } from 'react';
13
+ import { memo, useEffect } from 'react';
14
14
  import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
15
15
  import { settingsSelector } from '../../app/settings';
16
16
  import { FeatureContainer } from '../shared/Containers';
@@ -23,15 +23,15 @@ import { getParameterByName, reactElement } from '../../utils';
23
23
  import { BUSINESS_SCREENS_NAVIGATION } from '../../constants';
24
24
  import { businessFeatureScreens } from '../featuresScreens';
25
25
  import CustomFooter from '../shared/Footer';
26
+ import Background from '../shared/Background';
26
27
  var Business = memo(function (props) {
27
- var open = React.useState(true)[0];
28
28
  var theme = useAppTheme().theme;
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
31
  var customLoading = useAppSelector(businessSelector).customLoading;
32
32
  var loading = useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props)).loading;
33
33
  useErrorListener();
34
- var activeScreen = data.activeScreen;
34
+ var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
35
35
  var verifyToken = function () {
36
36
  var token = getParameterByName('token');
37
37
  if (!token)
@@ -45,11 +45,11 @@ var Business = memo(function (props) {
45
45
  useEffect(function () {
46
46
  dispatch(getCountries());
47
47
  }, []);
48
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
49
- var Element = _a.element, name = _a.name;
50
- var isActive = activeScreen.name === name;
51
- return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
52
- }) }) })) })));
48
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
49
+ var Element = _a.element, name = _a.name;
50
+ var isActive = activeScreen.name === name;
51
+ return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
52
+ }) }) })) })) })));
53
53
  });
54
54
  export function BusinessLib(props) {
55
55
  return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Business, __assign({}, props)) })));
@@ -87,7 +87,7 @@ var ExpectedSalesRange = function (_a) {
87
87
  var item = isExist(expectedSales || [], expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id);
88
88
  if (item)
89
89
  setSubIndex(item.id);
90
- }, [anchorEl]);
90
+ }, [anchorEl, expectedSalesRangeValue]);
91
91
  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 }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
92
92
  var isOnlyOneItem = !item.sub || item.sub.length === 1;
93
93
  if (isOnlyOneItem)
@@ -15,9 +15,9 @@ import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES } from '../../../../constants';
18
- import { useAppSelector, useLanguage } from '../../../../hooks';
18
+ import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
19
19
  import { businessSelector } from '../../../app/business/businessStore';
20
- import { showLastFour } from '../../../../utils';
20
+ import { allAreTruthy, showLastFour } from '../../../../utils';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
23
23
  import Container from '../../../shared/Containers/ScreenContainer';
@@ -46,6 +46,7 @@ var SuccessWithFlowButtons = function () {
46
46
  var _a, _b, _c;
47
47
  var t = useTranslation().t;
48
48
  var isAr = useLanguage().isAr;
49
+ var dispatch = useAppDispatch();
49
50
  var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
50
51
  var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
51
52
  var data = useAppSelector(businessSelector).data;
@@ -60,7 +61,6 @@ var SuccessWithFlowButtons = function () {
60
61
  var reMapFlowData = function (flows) {
61
62
  if (flows === void 0) { flows = []; }
62
63
  var images = ICONS_NAMES;
63
- var statuses = [];
64
64
  var mappedFlows = flows.map(function (_a) {
65
65
  var name = _a.name, url = _a.url, status = _a.status;
66
66
  var type = status === 'initiated' ? 'pending' : 'completed';
@@ -76,8 +76,6 @@ var SuccessWithFlowButtons = function () {
76
76
  setIsAcceptance(true);
77
77
  var isCompleted = status === 'completed' && name !== 'password';
78
78
  var isIndividual = name === 'individual';
79
- if (name !== 'password')
80
- statuses.push(isCompleted);
81
79
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
82
80
  var hoverSrc = "".concat(name, "_white_icon");
83
81
  return {
@@ -90,7 +88,7 @@ var SuccessWithFlowButtons = function () {
90
88
  };
91
89
  });
92
90
  setButtons(mappedFlows);
93
- var isAllCompleted = statuses.filter(function (status) { return status; }).length === flows.length;
91
+ var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
94
92
  if (isAllCompleted)
95
93
  setIsPayout(true);
96
94
  };
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import React, { memo, useEffect } from 'react';
13
+ import { memo, useEffect } from 'react';
14
14
  import { FeatureContainer } from '../shared/Containers';
15
15
  import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
16
16
  import { settingsSelector } from '../../app/settings';
@@ -23,22 +23,22 @@ import { reactElement } from '../../utils';
23
23
  import { CONNECT_SCREENS_NAVIGATION } from '../../constants';
24
24
  import { connectFeatureScreens } from '../featuresScreens';
25
25
  import CustomFooter from '../shared/Footer';
26
+ import Background from '../shared/Background';
26
27
  var Connect = memo(function (props) {
27
- var open = React.useState(true)[0];
28
28
  var theme = useAppTheme().theme;
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
31
  useAppConfig(__assign({ navigation: CONNECT_SCREENS_NAVIGATION }, props));
32
32
  useErrorListener();
33
- var activeScreen = data.activeScreen;
33
+ var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
34
34
  useEffect(function () {
35
35
  dispatch(getCountries());
36
36
  }, []);
37
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ loading: settingLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
38
- var Element = _a.element, name = _a.name;
39
- var isActive = activeScreen.name === name;
40
- return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
41
- }) }) })) })));
37
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
38
+ var Element = _a.element, name = _a.name;
39
+ var isActive = activeScreen.name === name;
40
+ return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
41
+ }) }) })) })) })));
42
42
  });
43
43
  export function ConnectLib(props) {
44
44
  return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Connect, __assign({}, props)) })));