@tap-payments/auth-jsconnect 2.10.0-beta → 2.10.0-sandbox

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 (84) hide show
  1. package/build/@types/app.d.ts +7 -1
  2. package/build/@types/app.js +7 -0
  3. package/build/@types/form.d.ts +3 -0
  4. package/build/api/account.d.ts +1 -0
  5. package/build/api/account.js +7 -0
  6. package/build/api/auth.d.ts +1 -0
  7. package/build/api/index.d.ts +1 -0
  8. package/build/app/settings.d.ts +1 -0
  9. package/build/app/settings.js +9 -4
  10. package/build/assets/currencies/SARSymbol.d.ts +7 -0
  11. package/build/assets/currencies/SARSymbol.js +28 -0
  12. package/build/assets/currencies/index.d.ts +2 -0
  13. package/build/assets/currencies/index.js +2 -0
  14. package/build/assets/currencies/utils.d.ts +4 -0
  15. package/build/assets/currencies/utils.js +4 -0
  16. package/build/assets/locales/ar.json +10 -1
  17. package/build/assets/locales/en.json +36 -1
  18. package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
  19. package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
  20. package/build/components/TextWithCurrency/index.d.ts +2 -0
  21. package/build/components/TextWithCurrency/index.js +2 -0
  22. package/build/constants/api.d.ts +1 -1
  23. package/build/constants/api.js +2 -2
  24. package/build/constants/app.d.ts +3 -1
  25. package/build/constants/app.js +42 -13
  26. package/build/constants/assets.d.ts +4 -0
  27. package/build/constants/assets.js +9 -2
  28. package/build/constants/validation.d.ts +1 -0
  29. package/build/constants/validation.js +1 -0
  30. package/build/features/app/auth/authStore.d.ts +24 -5
  31. package/build/features/app/auth/authStore.js +186 -89
  32. package/build/features/app/business/businessStore.js +53 -29
  33. package/build/features/app/connect/connectStore.js +47 -35
  34. package/build/features/app/connectExpress/connectExpressStore.d.ts +14 -3
  35. package/build/features/app/connectExpress/connectExpressStore.js +301 -109
  36. package/build/features/app/individual/individualStore.js +0 -1
  37. package/build/features/app/kyc/kycStore.js +49 -25
  38. package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
  39. package/build/features/auth/screens/OTP/OTP.js +15 -3
  40. package/build/features/auth/screens/OTP/index.d.ts +1 -2
  41. package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
  42. package/build/features/auth/screens/Passcode/Passcode.js +82 -0
  43. package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
  44. package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
  45. package/build/features/auth/screens/Passcode/index.d.ts +2 -0
  46. package/build/features/auth/screens/Passcode/index.js +2 -0
  47. package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
  48. package/build/features/auth/screens/Passcode/validation.js +4 -0
  49. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
  50. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
  51. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
  52. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
  53. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
  54. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
  55. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
  56. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
  57. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
  58. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.d.ts +5 -0
  59. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.js +49 -0
  60. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
  61. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.js +88 -0
  62. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
  63. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
  64. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.d.ts +8 -0
  65. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.js +4 -0
  66. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +9 -3
  67. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
  68. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
  69. package/build/features/featuresScreens.js +10 -0
  70. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
  71. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
  72. package/build/features/kyc/screens/Terms/Terms.js +8 -2
  73. package/build/features/kyc/screens/Users/Users.js +1 -1
  74. package/build/features/shared/Background/LogoBackground.js +5 -17
  75. package/build/features/shared/Button/Button.js +1 -2
  76. package/build/features/shared/Button/FlowsButtons.js +2 -1
  77. package/build/features/shared/Input/Input.d.ts +1 -1
  78. package/build/hooks/useAppConfig.js +1 -1
  79. package/build/utils/common.d.ts +1 -1
  80. package/build/utils/common.js +6 -4
  81. package/build/utils/error.d.ts +1 -0
  82. package/build/utils/error.js +3 -0
  83. package/build/utils/string.d.ts +1 -1
  84. package/package.json +3 -4
@@ -1181,7 +1181,6 @@ export var individualSlice = createSlice({
1181
1181
  state.data.individualData.isAuthorized = is_authorized;
1182
1182
  })
1183
1183
  .addCase(retrieveIndividualInfo.rejected, function (state, action) {
1184
- state.addOrRequestDetailLoading = false;
1185
1184
  state.error = action.error.message;
1186
1185
  })
1187
1186
  .addCase(getIndividualList.pending, function (state) {
@@ -49,9 +49,9 @@ var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import { handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
51
51
  import { FlowsTypes } from '../../../@types';
52
- import { CONNECT_FLOWS, KYC_STEP_NAMES, NAFATH_VERIFICATION_FAILED } from '../../../constants';
52
+ import { CONNECT_FLOWS, KYC_STEP_NAMES, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED } from '../../../constants';
53
53
  import API from '../../../api';
54
- import { sendCustomEventToGTM, sleep } from '../../../utils';
54
+ import { isNetworkError, isTimeoutError, sendCustomEventToGTM, sleep } from '../../../utils';
55
55
  export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a, thunkApi) {
56
56
  var token = _a.token;
57
57
  return __awaiter(void 0, void 0, void 0, function () {
@@ -161,7 +161,7 @@ export var createNafathAuth = createAsyncThunk('kyc/createNafathAuth', function
161
161
  });
162
162
  }); });
163
163
  export var verifyNafath = createAsyncThunk('kyc/verifyNafath', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
164
- var kyc, createAuthData, expiry, interval, maxCalls, count, data, isSuccess, isFailed, nextScreen;
164
+ var kyc, createAuthData, expiry, interval, maxCalls, count, data, error_1, isSuccess, isFailed, nextScreen;
165
165
  var _a, _b, _c, _d;
166
166
  return __generator(this, function (_e) {
167
167
  switch (_e.label) {
@@ -174,39 +174,51 @@ export var verifyNafath = createAsyncThunk('kyc/verifyNafath', function (params,
174
174
  count = 1;
175
175
  _e.label = 1;
176
176
  case 1:
177
- if (!(count <= maxCalls)) return [3, 7];
177
+ if (!(count <= maxCalls)) return [3, 10];
178
178
  if (thunkApi.signal.aborted) {
179
- return [3, 7];
179
+ return [3, 10];
180
180
  }
181
- return [4, API.authService.getVerifyAuth(createAuthData === null || createAuthData === void 0 ? void 0 : createAuthData.auth_token)];
181
+ data = undefined;
182
+ _e.label = 2;
182
183
  case 2:
184
+ _e.trys.push([2, 4, , 5]);
185
+ return [4, API.authService.getVerifyAuth(createAuthData === null || createAuthData === void 0 ? void 0 : createAuthData.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
186
+ case 3:
183
187
  data = _e.sent();
188
+ return [3, 5];
189
+ case 4:
190
+ error_1 = _e.sent();
191
+ if (!isNetworkError(error_1.message) && !isTimeoutError(error_1.message)) {
192
+ throw new Error(error_1);
193
+ }
194
+ return [3, 5];
195
+ case 5:
184
196
  isSuccess = ((_a = data === null || data === void 0 ? void 0 : data.status) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'success';
185
197
  isFailed = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'failed';
186
198
  if (isFailed) {
187
199
  (_c = params.onFailure) === null || _c === void 0 ? void 0 : _c.call(params);
188
200
  return [2, { data: data, createAuthData: createAuthData }];
189
201
  }
190
- if (!isSuccess) return [3, 4];
202
+ if (!isSuccess) return [3, 7];
191
203
  (_d = params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params);
192
204
  return [4, thunkApi.dispatch(updateKYCSuccess())];
193
- case 3:
205
+ case 6:
194
206
  _e.sent();
195
207
  nextScreen = CONNECT_FLOWS.kyc.success;
196
208
  return [2, { data: data, nextScreen: nextScreen, createAuthData: createAuthData }];
197
- case 4: return [4, sleep(interval * 1000)];
198
- case 5:
209
+ case 7: return [4, sleep(interval * 1000)];
210
+ case 8:
199
211
  _e.sent();
200
- _e.label = 6;
201
- case 6:
212
+ _e.label = 9;
213
+ case 9:
202
214
  count++;
203
215
  return [3, 1];
204
- case 7: throw new Error(NAFATH_VERIFICATION_FAILED);
216
+ case 10: throw new Error(NAFATH_VERIFICATION_FAILED);
205
217
  }
206
218
  });
207
219
  }); });
208
220
  export var verifyPaci = createAsyncThunk('kyc/verifyPaci', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
209
- var kyc, createAuthData, expiry, interval, maxCalls, count, data, isSuccess, nextScreen;
221
+ var kyc, createAuthData, expiry, interval, maxCalls, count, data, error_2, isSuccess, nextScreen;
210
222
  var _a, _b;
211
223
  return __generator(this, function (_c) {
212
224
  switch (_c.label) {
@@ -219,29 +231,41 @@ export var verifyPaci = createAsyncThunk('kyc/verifyPaci', function (params, thu
219
231
  count = 1;
220
232
  _c.label = 1;
221
233
  case 1:
222
- if (!(count <= maxCalls)) return [3, 7];
234
+ if (!(count <= maxCalls)) return [3, 10];
223
235
  if (thunkApi.signal.aborted) {
224
- return [3, 7];
236
+ return [3, 10];
225
237
  }
226
- return [4, API.authService.getVerifyAuth(createAuthData === null || createAuthData === void 0 ? void 0 : createAuthData.auth_token)];
238
+ data = undefined;
239
+ _c.label = 2;
227
240
  case 2:
241
+ _c.trys.push([2, 4, , 5]);
242
+ return [4, API.authService.getVerifyAuth(createAuthData === null || createAuthData === void 0 ? void 0 : createAuthData.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
243
+ case 3:
228
244
  data = _c.sent();
229
- isSuccess = ((_a = data.status) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'success';
230
- if (!isSuccess) return [3, 4];
245
+ return [3, 5];
246
+ case 4:
247
+ error_2 = _c.sent();
248
+ if (!isNetworkError(error_2.message) && !isTimeoutError(error_2.message)) {
249
+ throw new Error(error_2);
250
+ }
251
+ return [3, 5];
252
+ case 5:
253
+ isSuccess = ((_a = data === null || data === void 0 ? void 0 : data.status) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'success';
254
+ if (!isSuccess) return [3, 7];
231
255
  (_b = params.onSuccess) === null || _b === void 0 ? void 0 : _b.call(params);
232
256
  return [4, thunkApi.dispatch(updateKYCSuccess())];
233
- case 3:
257
+ case 6:
234
258
  _c.sent();
235
259
  nextScreen = CONNECT_FLOWS.kyc.success;
236
260
  return [2, { data: data, nextScreen: nextScreen, createAuthData: createAuthData }];
237
- case 4: return [4, sleep(interval * 1000)];
238
- case 5:
261
+ case 7: return [4, sleep(interval * 1000)];
262
+ case 8:
239
263
  _c.sent();
240
- _c.label = 6;
241
- case 6:
264
+ _c.label = 9;
265
+ case 9:
242
266
  count++;
243
267
  return [3, 1];
244
- case 7: throw new Error('paci_verification_failed');
268
+ case 10: throw new Error('paci_verification_failed');
245
269
  }
246
270
  });
247
271
  }); });
@@ -1,5 +1,16 @@
1
1
  import * as React from 'react';
2
- export interface OTPProps {
3
- }
2
+ export declare const PasscodeLoginStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
4
+ children?: React.ReactNode;
5
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
6
+ gutterBottom?: boolean | undefined;
7
+ noWrap?: boolean | undefined;
8
+ paragraph?: boolean | undefined;
9
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
10
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
11
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", string>> | undefined;
12
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
13
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
14
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "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" | "bottom" | "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>, {}, {}>;
4
15
  declare const _default: React.MemoExoticComponent<() => JSX.Element>;
5
16
  export default _default;
@@ -14,9 +14,9 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useForm, FormProvider } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box/Box';
17
- import { styled } from '@mui/material/styles';
17
+ import { styled, useTheme } from '@mui/material/styles';
18
18
  import Text from '../../../../components/Text';
19
- import { clearError, authSelector, verifyMobileOtp, resetOTPValue, verifyEmailOtp } from '../../../app/auth/authStore';
19
+ import { clearError, authSelector, verifyMobileOtp, resetOTPValue, verifyEmailOtp, createEmailAuth, createMobileAuth } from '../../../app/auth/authStore';
20
20
  import Button from '../../../shared/Button';
21
21
  import { ScreenContainer } from '../../../shared/Containers';
22
22
  import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
@@ -46,8 +46,13 @@ var FormStyled = styled(Form)(function () { return ({
46
46
  display: 'flex',
47
47
  flexDirection: 'column'
48
48
  }); });
49
+ export var PasscodeLoginStyled = styled(Text)(function (_a) {
50
+ var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
51
+ return (__assign(__assign({}, typography.caption), { color: palette.primary.main, lineHeight: 1.75, textAlign: 'center', marginTop: spacing(5), cursor: 'pointer' }));
52
+ });
49
53
  var OTP = function () {
50
54
  var _a;
55
+ var spacing = useTheme().spacing;
51
56
  var dispatch = useAppDispatch();
52
57
  var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
53
58
  var t = useTranslation().t;
@@ -112,7 +117,14 @@ var OTP = function () {
112
117
  screen = 'AUTH_EMAIL_STEP';
113
118
  dispatch(handlePrevScreenStep(screen));
114
119
  };
120
+ var onOTPLoginClick = function () {
121
+ if (isEmailAuth)
122
+ dispatch(createEmailAuth({ email: data.emailData.email }));
123
+ else
124
+ dispatch(createMobileAuth({ mobile: data.mobileData.mobile, countryCode: data.mobileData.countryCode }));
125
+ };
115
126
  var disabled = !methods.formState.isValid;
116
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : getTitle(), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: getNumber() }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
127
+ var showLoginWithPasscode = data.passcodeData.allowOTPToPasscodeRedirection;
128
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : getTitle(), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: getNumber() }))] }) }), _jsx(OTPInput, {}), showLoginWithPasscode && _jsx(PasscodeLoginStyled, __assign({ onClick: onOTPLoginClick }, { children: st('login_with_passcode') })), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, (showLoginWithPasscode && { sx: { marginTop: spacing(2.25) } }), { children: t('next') }))] })) })) }));
117
129
  };
118
130
  export default React.memo(OTP);
@@ -1,3 +1,2 @@
1
- import OTP, { OTPProps } from './OTP';
2
- export type { OTPProps };
1
+ import OTP from './OTP';
3
2
  export default OTP;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ export declare const OTPSignInStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
4
+ children?: React.ReactNode;
5
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
6
+ gutterBottom?: boolean | undefined;
7
+ noWrap?: boolean | undefined;
8
+ paragraph?: boolean | undefined;
9
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
10
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
11
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", string>> | undefined;
12
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
13
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
14
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "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" | "bottom" | "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>, {}, {}>;
15
+ declare const _default: React.MemoExoticComponent<() => JSX.Element>;
16
+ export default _default;
@@ -0,0 +1,82 @@
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/Box';
15
+ import { yupResolver } from '@hookform/resolvers/yup';
16
+ import { useForm, FormProvider } from 'react-hook-form';
17
+ import { styled, useTheme } from '@mui/material/styles';
18
+ import Form from '../../../../components/Form';
19
+ import Text from '../../../../components/Text';
20
+ import { deepCopy } from '../../../../utils';
21
+ import Button from '../../../shared/Button';
22
+ import { handlePrevScreenStep } from '../../../../app/settings';
23
+ import { ScreenContainer } from '../../../shared/Containers';
24
+ import { AuthForType } from '../../../../@types';
25
+ import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
26
+ import { clearError, authSelector, verifyPasscode, createEmailAuth, createMobileAuth } from '../../../app/auth/authStore';
27
+ import { validation } from './validation';
28
+ import PasscodeInput from './PasscodeInput';
29
+ var TitleContainerStyled = styled(Box)(function (_a) {
30
+ var theme = _a.theme;
31
+ return ({
32
+ background: theme.palette.common.white,
33
+ border: '1px solid',
34
+ borderColor: theme.palette.divider,
35
+ direction: theme.direction,
36
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25),
37
+ marginBottom: theme.spacing(5.75)
38
+ });
39
+ });
40
+ var TitleStyled = styled(Text)(function (_a) {
41
+ var theme = _a.theme;
42
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
43
+ });
44
+ var FormStyled = styled(Form)(function () { return ({
45
+ display: 'flex',
46
+ flexDirection: 'column'
47
+ }); });
48
+ export var OTPSignInStyled = styled(Text)(function (_a) {
49
+ var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
50
+ return (__assign(__assign({}, typography.caption), { color: palette.primary.main, lineHeight: 1.75, textAlign: 'center', marginTop: spacing(11.625), cursor: 'pointer' }));
51
+ });
52
+ var Passcode = function () {
53
+ var spacing = useTheme().spacing;
54
+ var isAr = useLanguage().isAr;
55
+ var dispatch = useAppDispatch();
56
+ var st = useSanitizedTranslation();
57
+ var _a = useAppSelector(authSelector), _b = _a.data, passcodeData = _b.passcodeData, otpData = _b.otpData, emailData = _b.emailData, mobileData = _b.mobileData, loading = _a.loading, error = _a.error;
58
+ var methods = useForm({
59
+ resolver: yupResolver(validation),
60
+ defaultValues: passcodeData,
61
+ mode: 'onChange'
62
+ });
63
+ React.useEffect(function () {
64
+ if (error)
65
+ dispatch(clearError());
66
+ }, [methods.formState.isValid]);
67
+ var startWithEmail = otpData.authFor === AuthForType.EMAIL;
68
+ var onSubmit = function (formData) {
69
+ dispatch(verifyPasscode(deepCopy(formData)));
70
+ };
71
+ var onBack = function () {
72
+ dispatch(handlePrevScreenStep(startWithEmail ? 'AUTH_EMAIL_STEP' : 'AUTH_MOBILE_STEP'));
73
+ };
74
+ var onOTPLoginClick = function () {
75
+ if (startWithEmail)
76
+ dispatch(createEmailAuth({ email: emailData.email, skipPasscode: true }));
77
+ else
78
+ dispatch(createMobileAuth({ mobile: mobileData.mobile, countryCode: mobileData.countryCode, skipPasscode: true }));
79
+ };
80
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: loading ? st('ide_otp_waiting_title') : st('passcode_title') }) }), _jsx(PasscodeInput, { disableResend: true }), _jsx(OTPSignInStyled, __assign({ onClick: onOTPLoginClick }, { children: st('sign_in_with_otp') })), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: !methods.formState.isValid, isAr: isAr, loading: loading, error: st(error || ''), sx: { marginTop: spacing(2.5) } }, { children: st('next') }))] })) })) }));
81
+ };
82
+ export default React.memo(Passcode);
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface PasscodeInputProps {
3
+ disableResend?: boolean;
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ disableResend }: PasscodeInputProps) => JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,42 @@
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 } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import Box from '@mui/material/Box/Box';
15
+ import { styled } from '@mui/material/styles';
16
+ import { useController, useFormContext } from 'react-hook-form';
17
+ import OTPField from '../../../shared/OTP';
18
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
19
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
+ import { authSelector, clearError } from '../../../app/auth/authStore';
21
+ var BoxStyled = styled(Box)(function (_a) {
22
+ var theme = _a.theme;
23
+ return ({
24
+ display: 'flex',
25
+ flexDirection: 'column',
26
+ fontFamily: theme.typography.fontFamily
27
+ });
28
+ });
29
+ var PasscodeInput = function (_a) {
30
+ var disableResend = _a.disableResend;
31
+ var dispatch = useAppDispatch();
32
+ var control = useFormContext().control;
33
+ var error = useAppSelector(authSelector).error;
34
+ var _b = useController({ name: 'passcode', control: control }).field, value = _b.value, onChange = _b.onChange;
35
+ var handleOnPasscodeChange = function (passcode) {
36
+ if (error)
37
+ dispatch(clearError());
38
+ onChange(passcode);
39
+ };
40
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, __assign({}, (!disableResend && { timerInSeconds: DEFAULT_TIMER_VALUE }), { value: value, onChange: function (number) { return handleOnPasscodeChange(number.toString()); } })) })));
41
+ };
42
+ export default React.memo(PasscodeInput);
@@ -0,0 +1,2 @@
1
+ import Passcode from './Passcode';
2
+ export default Passcode;
@@ -0,0 +1,2 @@
1
+ import Passcode from './Passcode';
2
+ export default Passcode;
@@ -0,0 +1,8 @@
1
+ import * as yup from 'yup';
2
+ export declare const validation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ passcode: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
+ passcode: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ passcode: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ }>>>;
@@ -0,0 +1,4 @@
1
+ import * as yup from 'yup';
2
+ export var validation = yup.object().shape({
3
+ passcode: yup.string().min(6).required('passcode_required')
4
+ });
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { styled } from '@mui/material/styles';
18
- import { getCurrencyByCountryIso2, isExist } from '../../../../utils';
18
+ import { isExist } from '../../../../utils';
19
19
  import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
20
20
  import { settingsSelector } from '../../../../app/settings';
21
21
  import SimpleList from '../../../../components/SimpleList';
@@ -29,6 +29,7 @@ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
29
29
  import CheckIcon from '../../../shared/CheckIcon';
30
30
  import { InputLabelStyled, NameContainer } from './CustomerBase';
31
31
  import { MandatoryStyled } from './ActivitiesList';
32
+ import TextWithCurrency from '../../../../components/TextWithCurrency';
32
33
  var InputStyled = styled(InputSelect)(function (_a) {
33
34
  var theme = _a.theme;
34
35
  return ({
@@ -71,7 +72,6 @@ var ExpectedSalesRange = function (_a) {
71
72
  var brandActivities = data.brandActivities;
72
73
  var expectedSales = (brandActivities.responseBody || {}).expectedSales;
73
74
  var expectedSalesRangeValue = expectedSaleControl.field.value;
74
- var countryCode = settingsData.businessCountry;
75
75
  var handleOpenMainMenu = function (event) {
76
76
  if (readOnly)
77
77
  return;
@@ -95,9 +95,6 @@ var ExpectedSalesRange = function (_a) {
95
95
  var handleCloseSubMenu = function () {
96
96
  setSubIndex('');
97
97
  };
98
- var getCurrency = React.useMemo(function () {
99
- return t(getCurrencyByCountryIso2(countryCode.iso2));
100
- }, [countryCode.iso2]);
101
98
  React.useEffect(function () {
102
99
  if ((expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) > 0) {
103
100
  setExpectedSalesRangeList(expectedSales);
@@ -126,9 +123,7 @@ var ExpectedSalesRange = function (_a) {
126
123
  if (item)
127
124
  setSubIndex(item.id);
128
125
  }, [anchorEl, expectedSalesRangeValue]);
129
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('expected_sales_monthly', {
130
- currency: getCurrency
131
- }), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _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) {
126
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [_jsx(TextWithCurrency, { text: t('expected_sale_per_month'), countryCode: settingsData.businessCountry.iso2 }), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _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) {
132
127
  var isOnlyOneItem = !item.sub || item.sub.length === 1;
133
128
  if (isOnlyOneItem)
134
129
  onSelectItem(item);
@@ -22,12 +22,13 @@ import Collapse from '../../../../components/Collapse';
22
22
  import ExpandIcon from '../../../../components/ExpandIcon';
23
23
  import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
24
24
  import { businessSelector, clearError } from '../../../app/business/businessStore';
25
- import { getCurrencyByCountryIso2, isExist } from '../../../../utils';
25
+ import { isExist } from '../../../../utils';
26
26
  import { ScreenContainer } from '../../../shared/Containers';
27
27
  import Search from '../../../shared/Search';
28
28
  import InputSelect from '../../../shared/InputSelect';
29
29
  import CheckIcon from '../../../shared/CheckIcon';
30
30
  import { InputLabelStyled, NameContainer } from './CustomerLocations';
31
+ import TextWithCurrency from '../../../../components/TextWithCurrency';
31
32
  var InputStyled = styled(InputSelect)(function (_a) {
32
33
  var theme = _a.theme;
33
34
  return ({
@@ -69,7 +70,6 @@ var ExpectedSalesRange = function (_a) {
69
70
  var activitiesData = data.activitiesData;
70
71
  var expectedSales = (activitiesData.responseBody || {}).expectedSales;
71
72
  var expectedSalesRangeValue = expectedSaleControl.field.value;
72
- var countryCode = settingsData.businessCountry;
73
73
  var handleOpenMainMenu = function (event) {
74
74
  if (readOnly)
75
75
  return;
@@ -121,12 +121,7 @@ var ExpectedSalesRange = function (_a) {
121
121
  if (item)
122
122
  setSubIndex(item.id);
123
123
  }, [anchorEl, expectedSalesRangeValue]);
124
- var getCurrency = React.useMemo(function () {
125
- return t(getCurrencyByCountryIso2(countryCode.iso2));
126
- }, [countryCode.iso2]);
127
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
128
- currency: getCurrency
129
- }) }), _jsx(InputStyled, { readOnly: readOnly, 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(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _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) {
124
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: _jsx(TextWithCurrency, { text: t('expected_sale_per_month'), countryCode: settingsData.businessCountry.iso2 }) }), _jsx(InputStyled, { readOnly: readOnly, 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(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _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) {
130
125
  var isOnlyOneItem = !item.sub || item.sub.length === 1;
131
126
  if (isOnlyOneItem)
132
127
  onSelectItem(item);
@@ -23,7 +23,6 @@ import { Button as SharedButton } from '../../../shared/Button';
23
23
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
24
24
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
25
25
  import { businessSelector, skipUpdateLeadMobile, updateLeadMobile } from '../../../../features/app/business/businessStore';
26
- import Button from '../../../../components/Button';
27
26
  import MobileNumber from './MobileNumber';
28
27
  var FormStyled = styled(Form)(function () { return ({
29
28
  display: 'flex',
@@ -60,10 +59,9 @@ var CurrentMobileContainerStyled = styled(Box)(function (_a) {
60
59
  });
61
60
  var MobileNumberContainer = styled(Box)(function (_a) {
62
61
  var theme = _a.theme;
63
- return ({
64
- display: 'flex',
65
- columnGap: theme.spacing(0.9)
66
- });
62
+ return (__assign({ display: 'flex', columnGap: theme.spacing(0.9), direction: 'ltr' }, (theme.direction === 'rtl' && {
63
+ marginLeft: 'auto'
64
+ })));
67
65
  });
68
66
  var CountryCodeStyled = styled(Text)(function (_a) {
69
67
  var theme = _a.theme;
@@ -100,6 +98,6 @@ var CollectMobileOwnership = function () {
100
98
  var onUpdateLater = function () {
101
99
  dispatch(skipUpdateLeadMobile());
102
100
  };
103
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: t('mobile_ownership_title') }) }), _jsxs(CurrentMobileContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('current_mobile_number') }), _jsxs(MobileNumberContainer, { children: [_jsxs(CountryCodeStyled, { children: ["+", data.mobileData.countryCode.idd_prefix] }), _jsx(MobileNumberStyled, { children: data.mobileData.mobile })] })] }), _jsx(MobileNumber, {}), _jsx(SharedButton, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('update_mobile_number') })), _jsx(UpdateLaterContainerStyled, { children: _jsx(Button, __assign({ variant: 'text', onClick: function () { return onUpdateLater(); } }, { children: t('update_later') })) })] })) })) }));
101
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: t('mobile_ownership_title') }) }), _jsxs(CurrentMobileContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('current_mobile_number') }), _jsxs(MobileNumberContainer, { children: [_jsxs(CountryCodeStyled, { children: ["+", data.mobileData.countryCode.idd_prefix] }), _jsx(MobileNumberStyled, { children: data.mobileData.mobile })] })] }), _jsx(MobileNumber, {}), _jsx(SharedButton, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('update_mobile_number') }))] })) })) }));
104
102
  };
105
103
  export default CollectMobileOwnership;
@@ -23,7 +23,6 @@ import { Button as SharedButton } from '../../../shared/Button';
23
23
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
24
24
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
25
25
  import { connectSelector, skipUpdateLeadMobile, updateLeadMobile } from '../../../../features/app/connect/connectStore';
26
- import Button from '../../../../components/Button';
27
26
  import MobileNumber from './MobileNumber';
28
27
  import { deepCopy } from '../../../../utils';
29
28
  var FormStyled = styled(Form)(function () { return ({
@@ -61,10 +60,9 @@ var CurrentMobileContainerStyled = styled(Box)(function (_a) {
61
60
  });
62
61
  var MobileNumberContainer = styled(Box)(function (_a) {
63
62
  var theme = _a.theme;
64
- return ({
65
- display: 'flex',
66
- columnGap: theme.spacing(0.9)
67
- });
63
+ return (__assign({ display: 'flex', columnGap: theme.spacing(0.9), direction: 'ltr' }, (theme.direction === 'rtl' && {
64
+ marginLeft: 'auto'
65
+ })));
68
66
  });
69
67
  var CountryCodeStyled = styled(Text)(function (_a) {
70
68
  var theme = _a.theme;
@@ -101,6 +99,6 @@ var CollectMobileOwnership = function () {
101
99
  var onUpdateLater = function () {
102
100
  dispatch(skipUpdateLeadMobile());
103
101
  };
104
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: t('mobile_ownership_title') }) }), _jsxs(CurrentMobileContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('current_mobile_number') }), _jsxs(MobileNumberContainer, { children: [_jsxs(CountryCodeStyled, { children: ["+", data.individualData.countryCode.idd_prefix] }), _jsx(MobileNumberStyled, { children: data.individualData.mobile })] })] }), _jsx(MobileNumber, {}), _jsx(SharedButton, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('update_mobile_number') })), _jsx(UpdateLaterContainerStyled, { children: _jsx(Button, __assign({ variant: 'text', onClick: function () { return onUpdateLater(); } }, { children: t('update_later') })) })] })) })) }));
102
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: t('mobile_ownership_title') }) }), _jsxs(CurrentMobileContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('current_mobile_number') }), _jsxs(MobileNumberContainer, { children: [_jsxs(CountryCodeStyled, { children: ["+", data.individualData.countryCode.idd_prefix] }), _jsx(MobileNumberStyled, { children: data.individualData.mobile })] })] }), _jsx(MobileNumber, {}), _jsx(SharedButton, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('update_mobile_number') }))] })) })) }));
105
103
  };
106
104
  export default CollectMobileOwnership;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const GenericPrepareDataLoading: () => JSX.Element;
3
+ export default GenericPrepareDataLoading;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useAppSelector } from '../../../../hooks';
3
+ import DataLoading from '../../../shared/DataLoading';
4
+ import { connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
5
+ var GenericPrepareDataLoading = function () {
6
+ var error = useAppSelector(connectExpressSelector).error;
7
+ return _jsx(DataLoading, { error: error });
8
+ };
9
+ export default GenericPrepareDataLoading;
@@ -0,0 +1,2 @@
1
+ import GenericPrepareDataLoading from './GenericPrepareDataLoading';
2
+ export default GenericPrepareDataLoading;
@@ -0,0 +1,2 @@
1
+ import GenericPrepareDataLoading from './GenericPrepareDataLoading';
2
+ export default GenericPrepareDataLoading;
@@ -24,7 +24,6 @@ import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
24
24
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
25
25
  import { connectExpressSelector, skipUpdateLeadMobile, updateLeadMobile } from '../../../../features/app/connectExpress/connectExpressStore';
26
26
  import { AuthForType } from '../../../../@types';
27
- import Button from '../../../../components/Button';
28
27
  import MobileNumber from './MobileNumber';
29
28
  import { deepCopy } from '../../../../utils';
30
29
  var FormStyled = styled(Form)(function () { return ({
@@ -62,10 +61,9 @@ var CurrentMobileContainerStyled = styled(Box)(function (_a) {
62
61
  });
63
62
  var MobileNumberContainer = styled(Box)(function (_a) {
64
63
  var theme = _a.theme;
65
- return ({
66
- display: 'flex',
67
- columnGap: theme.spacing(0.9)
68
- });
64
+ return (__assign({ display: 'flex', columnGap: theme.spacing(0.9), direction: 'ltr' }, (theme.direction === 'rtl' && {
65
+ marginLeft: 'auto'
66
+ })));
69
67
  });
70
68
  var CountryCodeStyled = styled(Text)(function (_a) {
71
69
  var theme = _a.theme;
@@ -103,6 +101,6 @@ var CollectMobileOwnership = function () {
103
101
  var onUpdateLater = function () {
104
102
  dispatch(skipUpdateLeadMobile());
105
103
  };
106
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: t('mobile_ownership_title') }) }), _jsxs(CurrentMobileContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('current_mobile_number') }), _jsxs(MobileNumberContainer, { children: [_jsxs(CountryCodeStyled, { children: ["+", data.individualData.countryCode.idd_prefix] }), _jsx(MobileNumberStyled, { children: data.individualData.mobile })] })] }), _jsx(MobileNumber, {}), _jsx(SharedButton, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('update_mobile_number') })), _jsx(UpdateLaterContainerStyled, { children: _jsx(Button, __assign({ variant: 'text', onClick: function () { return onUpdateLater(); } }, { children: t('update_later') })) })] })) })) }));
104
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: t('mobile_ownership_title') }) }), _jsxs(CurrentMobileContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('current_mobile_number') }), _jsxs(MobileNumberContainer, { children: [_jsxs(CountryCodeStyled, { children: ["+", data.individualData.countryCode.idd_prefix] }), _jsx(MobileNumberStyled, { children: data.individualData.mobile })] })] }), _jsx(MobileNumber, {}), _jsx(SharedButton, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('update_mobile_number') }))] })) })) }));
107
105
  };
108
106
  export default CollectMobileOwnership;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface OTPProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
5
+ export default _default;