@tap-payments/auth-jsconnect 2.10.10-beta → 2.10.12-beta

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.
@@ -351,6 +351,11 @@ export declare enum AuthForType {
351
351
  NATIONAL_ID = "national_id",
352
352
  NATIONAL_ID_MISSED = "national_id_missed"
353
353
  }
354
+ export declare enum AuthForScreen {
355
+ INDIVIDUAL = "individual",
356
+ DOB = "dob",
357
+ MOBILE_OWNERSHIP = "mobile_ownership"
358
+ }
354
359
  export declare enum AuthTypeNumber {
355
360
  EMAIL_OTP = 5,
356
361
  MOBILE_OTP = 2,
@@ -43,6 +43,12 @@ export var AuthForType;
43
43
  AuthForType["NATIONAL_ID"] = "national_id";
44
44
  AuthForType["NATIONAL_ID_MISSED"] = "national_id_missed";
45
45
  })(AuthForType || (AuthForType = {}));
46
+ export var AuthForScreen;
47
+ (function (AuthForScreen) {
48
+ AuthForScreen["INDIVIDUAL"] = "individual";
49
+ AuthForScreen["DOB"] = "dob";
50
+ AuthForScreen["MOBILE_OWNERSHIP"] = "mobile_ownership";
51
+ })(AuthForScreen || (AuthForScreen = {}));
46
52
  export var AuthTypeNumber;
47
53
  (function (AuthTypeNumber) {
48
54
  AuthTypeNumber[AuthTypeNumber["EMAIL_OTP"] = 5] = "EMAIL_OTP";
@@ -139,6 +139,7 @@ export declare const CONNECT_EXPRESS_STEP_NAMES: {
139
139
  CONNECT_EXPRESS_SUCCESS: string;
140
140
  COLLECT_MOBILE_OWNERSHIP: string;
141
141
  COLLECT_MOBILE_OWNERSHIP_SKIPPED: string;
142
+ VERIFY_AUTH_MOBILE_OTP: string;
142
143
  };
143
144
  export declare const SignIn_STEP_NAMES: {
144
145
  CREATE_AUTH_MOBILE: string;
@@ -230,13 +230,22 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
230
230
  },
231
231
  {
232
232
  name: 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
233
- next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
233
+ next: [
234
+ 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
235
+ 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
236
+ 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP'
237
+ ],
234
238
  prev: ['CONNECT_EXPRESS_NID_STEP', 'CONNECT_EXPRESS_NID_MISSED_STEP'],
235
239
  order: 5
236
240
  },
237
241
  {
238
242
  name: 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
239
- next: ['CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP', 'COLLECT_MOBILE_OWNERSHIP'],
243
+ next: [
244
+ 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
245
+ 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
246
+ 'COLLECT_MOBILE_OWNERSHIP',
247
+ 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP'
248
+ ],
240
249
  prev: [
241
250
  'CONNECT_EXPRESS_MOBILE_STEP',
242
251
  'CONNECT_EXPRESS_NID_STEP',
@@ -253,7 +262,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
253
262
  'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
254
263
  'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
255
264
  'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
256
- 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP'
265
+ 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
266
+ 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP'
257
267
  ],
258
268
  prev: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_NID_MISSED_STEP'],
259
269
  order: 6
@@ -264,29 +274,40 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
264
274
  prev: 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
265
275
  order: 6
266
276
  },
277
+ {
278
+ name: 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP',
279
+ next: [
280
+ 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
281
+ 'COLLECT_MOBILE_OWNERSHIP',
282
+ 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
283
+ 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'
284
+ ],
285
+ prev: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP', 'COLLECT_MOBILE_OWNERSHIP'],
286
+ order: 7
287
+ },
267
288
  {
268
289
  name: 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
269
290
  next: 'CONNECT_EXPRESS_PREPARING_DATA_STEP',
270
291
  prev: '',
271
- order: 7
292
+ order: 8
272
293
  },
273
294
  {
274
295
  name: 'CONNECT_EXPRESS_PREPARING_DATA_STEP',
275
296
  next: 'CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP',
276
297
  prev: '',
277
- order: 8
298
+ order: 9
278
299
  },
279
300
  {
280
301
  name: 'CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP',
281
302
  next: '',
282
303
  prev: '',
283
- order: 9
304
+ order: 10
284
305
  },
285
306
  {
286
307
  name: 'CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP',
287
308
  next: '',
288
309
  prev: '',
289
- order: 9
310
+ order: 11
290
311
  }
291
312
  ];
292
313
  export var AUTH_SCREENS_NAVIGATION = [
@@ -1040,7 +1061,8 @@ export var CONNECT_EXPRESS_STEP_NAMES = {
1040
1061
  VERIFY_AUTH_PASSWORD: 'connect_express_verify_auth_password',
1041
1062
  CONNECT_EXPRESS_SUCCESS: 'connect_express_completed',
1042
1063
  COLLECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
1043
- COLLECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped'
1064
+ COLLECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
1065
+ VERIFY_AUTH_MOBILE_OTP: 'connect_express_auth_mobile'
1044
1066
  };
1045
1067
  export var SignIn_STEP_NAMES = {
1046
1068
  CREATE_AUTH_MOBILE: 'signIn_create_auth_mobile',
@@ -1,7 +1,10 @@
1
1
  export declare const ICONS_BASE_URL = "https://dash.b-cdn.net";
2
2
  export declare const ICONS_PATH = "/icons/menu";
3
+ export declare const ASSETS_BASE_URL = "https://tap-assets.b-cdn.net";
4
+ export declare const ASSETS_PATH = "/icons/connect";
3
5
  export declare const ICONS_EXTENSION = ".svg";
4
6
  export declare const ICONS_FULL_PATH: string;
7
+ export declare const ASSETS_FULL_PATH: string;
5
8
  export declare const ICONS_NAMES: {
6
9
  SIDE_MENU_CLOSE_ICON: string;
7
10
  SIDE_MENU_CLOSE_ICON_DARK: string;
@@ -44,6 +47,7 @@ export declare const ICONS_NAMES: {
44
47
  NAFATH_LOGO: string;
45
48
  NAFATH_VERIFY_ICON: string;
46
49
  EXPRESS_ERROR_ICON: string;
50
+ TAP_LOGO: string;
47
51
  TAP_EN: string;
48
52
  TAP_AR: string;
49
53
  ID_IMAGE: string;
@@ -1,7 +1,13 @@
1
+ import { ThemeMode } from '../@types';
1
2
  export var ICONS_BASE_URL = 'https://dash.b-cdn.net';
2
3
  export var ICONS_PATH = '/icons/menu';
4
+ export var ASSETS_BASE_URL = 'https://tap-assets.b-cdn.net';
5
+ export var ASSETS_PATH = '/icons/connect';
3
6
  export var ICONS_EXTENSION = '.svg';
4
7
  export var ICONS_FULL_PATH = ICONS_BASE_URL + ICONS_PATH;
8
+ export var ASSETS_FULL_PATH = ASSETS_BASE_URL + ASSETS_PATH;
9
+ var generateAssetPath = function (name, theme) { return "".concat(ASSETS_BASE_URL).concat(ASSETS_PATH, "/").concat(theme, "/").concat(name).concat(ICONS_EXTENSION); };
10
+ var generateLightAssetPath = function (name) { return generateAssetPath(name, ThemeMode.LIGHT); };
5
11
  export var ICONS_NAMES = {
6
12
  SIDE_MENU_CLOSE_ICON: ICONS_FULL_PATH + '/side-menu-close' + ICONS_EXTENSION,
7
13
  SIDE_MENU_CLOSE_ICON_DARK: ICONS_FULL_PATH + '/side-menu-close-dark' + ICONS_EXTENSION,
@@ -41,9 +47,10 @@ export var ICONS_NAMES = {
41
47
  TAP_LOGO_TEXT_AR: ICONS_FULL_PATH + '/tap-white-text-ar' + ICONS_EXTENSION,
42
48
  TAP_LOGO_TEXT_EN: ICONS_FULL_PATH + '/tap-white-text-en' + ICONS_EXTENSION,
43
49
  PACI_VERIFY_ICON: ICONS_FULL_PATH + '/PACI_verify_icon' + '.png',
44
- NAFATH_LOGO: 'https://tap-assets.b-cdn.net/icons/connect/light/nafath_button_logo.svg',
45
- NAFATH_VERIFY_ICON: 'https://tap-assets.b-cdn.net/icons/connect/light/nafath_logo.svg',
50
+ NAFATH_LOGO: generateLightAssetPath('nafath_button_logo'),
51
+ NAFATH_VERIFY_ICON: generateLightAssetPath('nafath_logo'),
46
52
  EXPRESS_ERROR_ICON: ICONS_FULL_PATH + '/EXPRESS_error_icon' + '.svg',
53
+ TAP_LOGO: generateLightAssetPath('tap-logo'),
47
54
  TAP_EN: 'https://tap-connecet.b-cdn.net/imgs/tapEN' + ICONS_EXTENSION,
48
55
  TAP_AR: 'https://tap-connecet.b-cdn.net/imgs/tapAR' + ICONS_EXTENSION,
49
56
  ID_IMAGE: 'https://villageofwarwick.org/wp-content/uploads/2020/02/ICON99-512-1.png',
@@ -1,5 +1,5 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { MobileFormValues, NIDFormValues, CivilFormValues, OTPFormValues, IndividualFormValues, SharedState, FlowsTypes, ActionState, CountryCode, AuthForType, BusinessDataFormValues, AsyncThunkParams, AuthenticationListFormValues, AuthMerchantFormValues, DOBFormValues, MobileOwnershipFormValues } from '../../../@types';
2
+ import { MobileFormValues, NIDFormValues, CivilFormValues, OTPFormValues, IndividualFormValues, SharedState, FlowsTypes, ActionState, CountryCode, AuthForType, BusinessDataFormValues, AsyncThunkParams, AuthenticationListFormValues, AuthMerchantFormValues, DOBFormValues, MobileOwnershipFormValues, AuthForScreen } from '../../../@types';
3
3
  import { CancelToken } from 'axios';
4
4
  export declare const updateBusinessCountryAsync: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
5
5
  export declare const retrieveLeadIdentityByIdAsync: import("@reduxjs/toolkit").AsyncThunk<{
@@ -136,6 +136,10 @@ export declare const updateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
136
136
  export declare const skipUpdateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
137
137
  leadResponse: any;
138
138
  }, void, {}>;
139
+ export declare const verifyAuthMobileOtpAsync: import("@reduxjs/toolkit").AsyncThunk<{
140
+ data: any;
141
+ }, OTPFormValues, {}>;
142
+ export declare const resendLeadMobileAuthOTP: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
139
143
  export declare const confirmInfo: import("@reduxjs/toolkit").AsyncThunk<{
140
144
  boardInfo: any;
141
145
  boardData: any;
@@ -159,6 +163,9 @@ export interface ConnectExpressData {
159
163
  individualData: IndividualFormValues & {
160
164
  isPrevDob?: boolean;
161
165
  };
166
+ verifyAuthOtpData: OTPFormValues & {
167
+ authFor: AuthForScreen;
168
+ };
162
169
  businessData: BusinessDataFormValues;
163
170
  authenticationData: AuthenticationListFormValues;
164
171
  authMerchantData: AuthMerchantFormValues;
@@ -180,10 +187,11 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectExpre
180
187
  resetCivilScreen: (state: ConnectExpressState) => void;
181
188
  resetAuthenticationScreen: (state: ConnectExpressState) => void;
182
189
  resetOTPValue: (state: ConnectExpressState) => void;
190
+ resetVerifyAuthOTPValue: (state: ConnectExpressState) => void;
183
191
  resetStore: (state: ConnectExpressState) => void;
184
192
  resetIndividualScreen: (state: ConnectExpressState) => void;
185
193
  }, "connectExpress/store">;
186
- export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setIsLeadIdPassed: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, setLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetAuthenticationScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
194
+ export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setIsLeadIdPassed: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetVerifyAuthOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, setLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetAuthenticationScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
187
195
  declare const _default: import("redux").Reducer<ConnectExpressState, import("redux").AnyAction>;
188
196
  export default _default;
189
197
  export declare const connectExpressSelector: (state: RootState) => ConnectExpressState;
@@ -57,7 +57,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
57
57
  var _a;
58
58
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
59
59
  import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen, handleSetCountryByIso2, onCloseComplete, storeAuthId } from '../../../app/settings';
60
- import { FlowsTypes, AuthForType, BusinessType, LicenseType } from '../../../@types';
60
+ import { FlowsTypes, AuthForType, BusinessType, LicenseType, AuthForScreen } from '../../../@types';
61
61
  import API from '../../../api';
62
62
  import { ADD_NEW_ENTITY, COLLECT_DOB_INFO_NAFATH, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH } from '../../../constants';
63
63
  import { defaultCountry } from '../../../constants';
@@ -1025,7 +1025,7 @@ export var createEntity = createAsyncThunk('connectExpress/createEntity', functi
1025
1025
  });
1026
1026
  }); });
1027
1027
  export var updateLeadDOBAsync = createAsyncThunk('connectExpress/updateLeadDOBAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
1028
- var _a, settings, connectExpress, id, dob, payload, data, needToCollectMoreInfo, creatingAccount;
1028
+ var _a, settings, connectExpress, id, dob, payload, data, needToCollectMoreInfo, creatingAccount, verifyAuthMobile;
1029
1029
  var _b, _c, _d;
1030
1030
  return __generator(this, function (_e) {
1031
1031
  switch (_e.label) {
@@ -1045,6 +1045,10 @@ export var updateLeadDOBAsync = createAsyncThunk('connectExpress/updateLeadDOBAs
1045
1045
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
1046
1046
  needToCollectMoreInfo = data.step_name === 'collect_info';
1047
1047
  creatingAccount = data.step_name === 'create_account';
1048
+ verifyAuthMobile = data.step_name === 'connect_express_auth_mobile';
1049
+ if (verifyAuthMobile) {
1050
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP')); });
1051
+ }
1048
1052
  if (creatingAccount) {
1049
1053
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
1050
1054
  }
@@ -1058,7 +1062,7 @@ export var updateLeadDOBAsync = createAsyncThunk('connectExpress/updateLeadDOBAs
1058
1062
  export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLeadIndividualAsync', function (_a, thunkApi) {
1059
1063
  var formData = _a.formData, originalFormData = _a.originalFormData;
1060
1064
  return __awaiter(void 0, void 0, void 0, function () {
1061
- var _b, settings, connectExpress, id, countryCode, name, email, mobile, phoneCountry, isContactAvailable, payload, data, needToCollectMoreInfo, creatingAccount, collectPhoneOwnershipScreen, isSaudi;
1065
+ var _b, settings, connectExpress, id, countryCode, name, email, mobile, phoneCountry, isContactAvailable, payload, data, needToCollectMoreInfo, creatingAccount, collectPhoneOwnershipScreen, verifyAuthMobile, isSaudi;
1062
1066
  var _c, _d, _e, _f, _g;
1063
1067
  return __generator(this, function (_h) {
1064
1068
  switch (_h.label) {
@@ -1078,6 +1082,10 @@ export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLe
1078
1082
  needToCollectMoreInfo = data.step_name === 'collect_info';
1079
1083
  creatingAccount = data.step_name === 'create_account';
1080
1084
  collectPhoneOwnershipScreen = data.step_name === CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP;
1085
+ verifyAuthMobile = data.step_name === CONNECT_EXPRESS_STEP_NAMES.VERIFY_AUTH_MOBILE_OTP;
1086
+ if (verifyAuthMobile) {
1087
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP')); });
1088
+ }
1081
1089
  if (collectPhoneOwnershipScreen) {
1082
1090
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('COLLECT_MOBILE_OWNERSHIP')); });
1083
1091
  }
@@ -1141,7 +1149,7 @@ export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDat
1141
1149
  });
1142
1150
  });
1143
1151
  export var updateLeadMobile = createAsyncThunk('connectExpress/updateLeadMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
1144
- var _a, settings, connectExpress, id, startWithNID, payload, leadResponse, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen;
1152
+ var _a, settings, connectExpress, id, startWithNID, payload, leadResponse, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen, verifyAuthMobile;
1145
1153
  var _b, _c, _d;
1146
1154
  return __generator(this, function (_e) {
1147
1155
  switch (_e.label) {
@@ -1168,9 +1176,13 @@ export var updateLeadMobile = createAsyncThunk('connectExpress/updateLeadMobile'
1168
1176
  creatingAccount = leadResponse.step_name === 'create_account';
1169
1177
  askDobInfo = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
1170
1178
  collectPhoneOwnershipScreen = leadResponse.step_name === CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP;
1179
+ verifyAuthMobile = leadResponse.step_name === CONNECT_EXPRESS_STEP_NAMES.VERIFY_AUTH_MOBILE_OTP;
1171
1180
  if (collectPhoneOwnershipScreen) {
1172
1181
  throw new Error("The new mobile number doesn't match the national ID, please update the mobile to the correct one");
1173
1182
  }
1183
+ if (verifyAuthMobile) {
1184
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP')); });
1185
+ }
1174
1186
  if (askDobInfo) {
1175
1187
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP')); });
1176
1188
  }
@@ -1195,7 +1207,7 @@ export var updateLeadMobile = createAsyncThunk('connectExpress/updateLeadMobile'
1195
1207
  });
1196
1208
  }); });
1197
1209
  export var skipUpdateLeadMobile = createAsyncThunk('connectExpress/skipUpdateLeadMobile', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
1198
- var _a, settings, connectExpress, id, startWithNID, payload, leadResponse, needToCollectMoreInfo, creatingAccount, askDobInfo;
1210
+ var _a, settings, connectExpress, id, startWithNID, payload, leadResponse, needToCollectMoreInfo, creatingAccount, askDobInfo, verifyAuthMobile;
1199
1211
  var _b, _c, _d;
1200
1212
  return __generator(this, function (_e) {
1201
1213
  switch (_e.label) {
@@ -1215,6 +1227,10 @@ export var skipUpdateLeadMobile = createAsyncThunk('connectExpress/skipUpdateLea
1215
1227
  needToCollectMoreInfo = leadResponse.step_name === 'collect_info';
1216
1228
  creatingAccount = leadResponse.step_name === 'create_account';
1217
1229
  askDobInfo = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
1230
+ verifyAuthMobile = leadResponse.step_name === CONNECT_EXPRESS_STEP_NAMES.VERIFY_AUTH_MOBILE_OTP;
1231
+ if (verifyAuthMobile) {
1232
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP')); });
1233
+ }
1218
1234
  if (askDobInfo) {
1219
1235
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP')); });
1220
1236
  }
@@ -1238,6 +1254,82 @@ export var skipUpdateLeadMobile = createAsyncThunk('connectExpress/skipUpdateLea
1238
1254
  }
1239
1255
  });
1240
1256
  }); });
1257
+ export var verifyAuthMobileOtpAsync = createAsyncThunk('connectExpress/verifyAuthMobileOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
1258
+ var _a, settings, connectExpress, responseData, _b, verify_token, verification_by, payload, data, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen, isSaudi;
1259
+ var _c, _d;
1260
+ return __generator(this, function (_e) {
1261
+ switch (_e.label) {
1262
+ case 0:
1263
+ _a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
1264
+ responseData = (connectExpress.data || {}).responseData;
1265
+ if (!(responseData === null || responseData === void 0 ? void 0 : responseData.verifyAuthMobile))
1266
+ throw new Error('Auth data is missing');
1267
+ _b = responseData.verifyAuthMobile, verify_token = _b.verify_token, verification_by = _b.verification_by;
1268
+ payload = {
1269
+ verify_token: verify_token,
1270
+ data: params.otp,
1271
+ auth_type: 2,
1272
+ service_name: verification_by === null || verification_by === void 0 ? void 0 : verification_by.service_name,
1273
+ sign_in: false,
1274
+ step_name: CONNECT_EXPRESS_STEP_NAMES.VERIFY_AUTH_MOBILE_OTP,
1275
+ encryption_contract: ['data']
1276
+ };
1277
+ return [4, API.authService.verifyExpressLeadIdentity(payload)];
1278
+ case 1:
1279
+ data = _e.sent();
1280
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
1281
+ needToCollectMoreInfo = data.step_name === 'collect_info';
1282
+ creatingAccount = data.step_name === 'create_account';
1283
+ askDobInfo = data.step_name === COLLECT_DOB_INFO_NAFATH;
1284
+ collectPhoneOwnershipScreen = data.step_name === CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP;
1285
+ if (askDobInfo) {
1286
+ sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP')); });
1287
+ }
1288
+ if (creatingAccount) {
1289
+ sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
1290
+ }
1291
+ if (collectPhoneOwnershipScreen) {
1292
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('COLLECT_MOBILE_OWNERSHIP')); });
1293
+ }
1294
+ if (!needToCollectMoreInfo) return [3, 4];
1295
+ isSaudi = isSA(settings.data.businessCountry.iso2);
1296
+ if (!isSaudi) return [3, 3];
1297
+ return [4, thunkApi.dispatch(retrieveEntityListAsync(data.lead.id)).unwrap()];
1298
+ case 2:
1299
+ _e.sent();
1300
+ _e.label = 3;
1301
+ case 3:
1302
+ sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP')); });
1303
+ _e.label = 4;
1304
+ case 4: return [2, { data: data }];
1305
+ }
1306
+ });
1307
+ }); });
1308
+ export var resendLeadMobileAuthOTP = createAsyncThunk('connectExpress/resendLeadMobileAuthOTPExpress', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
1309
+ var connectExpress, payload, data;
1310
+ var _a, _b, _c, _d, _e, _f;
1311
+ return __generator(this, function (_g) {
1312
+ switch (_g.label) {
1313
+ case 0:
1314
+ connectExpress = thunkApi.getState().connectExpress;
1315
+ payload = {
1316
+ id: ((_b = (_a = connectExpress.data.responseData) === null || _a === void 0 ? void 0 : _a.leadData) === null || _b === void 0 ? void 0 : _b.id) || '',
1317
+ contact: {
1318
+ phone: {
1319
+ country_code: (_e = (_d = (_c = connectExpress.data.individualData) === null || _c === void 0 ? void 0 : _c.countryCode) === null || _d === void 0 ? void 0 : _d.idd_prefix) === null || _e === void 0 ? void 0 : _e.toString(),
1320
+ number: ((_f = connectExpress.data.individualData) === null || _f === void 0 ? void 0 : _f.mobile) || ''
1321
+ }
1322
+ },
1323
+ step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL,
1324
+ encryption_contract: ['contact.phone.country_code', 'contact.phone.number']
1325
+ };
1326
+ return [4, API.leadService.updateLeadExpress(payload)];
1327
+ case 1:
1328
+ data = _g.sent();
1329
+ return [2, data];
1330
+ }
1331
+ });
1332
+ }); });
1241
1333
  export var confirmInfo = createAsyncThunk('connectExpress/confirmInfo', function (_a, thunkApi) {
1242
1334
  var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo, merchantInfo = _a.merchantInfo;
1243
1335
  return __awaiter(void 0, void 0, void 0, function () {
@@ -1362,6 +1454,10 @@ var initialState = {
1362
1454
  mobile: '',
1363
1455
  countryCode: defaultCountry
1364
1456
  },
1457
+ verifyAuthOtpData: {
1458
+ otp: '',
1459
+ authFor: AuthForScreen.INDIVIDUAL
1460
+ },
1365
1461
  businessData: {
1366
1462
  brandName: '',
1367
1463
  licenseNumber: '',
@@ -1417,6 +1513,9 @@ export var connectSlice = createSlice({
1417
1513
  resetOTPValue: function (state) {
1418
1514
  state.data.otpData.otp = '';
1419
1515
  },
1516
+ resetVerifyAuthOTPValue: function (state) {
1517
+ state.data.verifyAuthOtpData.otp = '';
1518
+ },
1420
1519
  resetStore: function (state) {
1421
1520
  var _a;
1422
1521
  state.data = __assign(__assign({}, state.data), { responseData: { leadData: (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.leadData } });
@@ -1750,7 +1849,8 @@ export var connectSlice = createSlice({
1750
1849
  state.loading = false;
1751
1850
  state.error = null;
1752
1851
  state.data.dobData = action.payload.formData;
1753
- state.data.responseData = __assign(__assign({}, state.data.responseData), { dobData: action.payload.response });
1852
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { dobData: action.payload.response, verifyAuthMobile: action.payload.response });
1853
+ state.data.verifyAuthOtpData.authFor = AuthForScreen.DOB;
1754
1854
  })
1755
1855
  .addCase(updateLeadDOBAsync.pending, function (state) {
1756
1856
  state.loading = true;
@@ -1766,7 +1866,8 @@ export var connectSlice = createSlice({
1766
1866
  state.error = null;
1767
1867
  var licenseList = [OTHER_CR_LICENSE, OTHER_FL_LICENSE];
1768
1868
  state.data.individualData = action.payload.formData;
1769
- state.data.responseData = __assign(__assign(__assign({}, state.data.responseData), { individualData: action.payload.response }), (!((_b = (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.licenseList) === null || _b === void 0 ? void 0 : _b.length) && { licenseList: licenseList }));
1869
+ state.data.responseData = __assign(__assign(__assign(__assign({}, state.data.responseData), { individualData: action.payload.response }), (!((_b = (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.licenseList) === null || _b === void 0 ? void 0 : _b.length) && { licenseList: licenseList })), { verifyAuthMobile: action.payload.response });
1870
+ state.data.verifyAuthOtpData.authFor = AuthForScreen.INDIVIDUAL;
1770
1871
  })
1771
1872
  .addCase(updateLeadIndividualAsync.pending, function (state) {
1772
1873
  state.loading = true;
@@ -1794,7 +1895,8 @@ export var connectSlice = createSlice({
1794
1895
  state.loading = false;
1795
1896
  state.error = null;
1796
1897
  state.data.individualData.mobile = action.payload.formData.mobile;
1797
- state.data.responseData = __assign(__assign({}, state.data.responseData), { individualData: action.payload.leadResponse });
1898
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { individualData: action.payload.leadResponse, verifyAuthMobile: action.payload.leadResponse });
1899
+ state.data.verifyAuthOtpData.authFor = AuthForScreen.MOBILE_OWNERSHIP;
1798
1900
  })
1799
1901
  .addCase(updateLeadMobile.pending, function (state) {
1800
1902
  state.loading = true;
@@ -1807,7 +1909,8 @@ export var connectSlice = createSlice({
1807
1909
  .addCase(skipUpdateLeadMobile.fulfilled, function (state, action) {
1808
1910
  state.loading = false;
1809
1911
  state.error = null;
1810
- state.data.responseData = __assign(__assign({}, state.data.responseData), { individualData: action.payload.leadResponse });
1912
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { individualData: action.payload.leadResponse, verifyAuthMobile: action.payload.leadResponse });
1913
+ state.data.verifyAuthOtpData.authFor = AuthForScreen.MOBILE_OWNERSHIP;
1811
1914
  })
1812
1915
  .addCase(skipUpdateLeadMobile.pending, function (state) {
1813
1916
  state.loading = true;
@@ -1816,6 +1919,32 @@ export var connectSlice = createSlice({
1816
1919
  .addCase(skipUpdateLeadMobile.rejected, function (state, action) {
1817
1920
  state.loading = false;
1818
1921
  state.error = action.error.message;
1922
+ })
1923
+ .addCase(verifyAuthMobileOtpAsync.fulfilled, function (state, action) {
1924
+ state.loading = false;
1925
+ state.error = null;
1926
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { verifyAuthMobileOtp: action.payload.data });
1927
+ state.data.verifyAuthOtpData.authFor = AuthForScreen.MOBILE_OWNERSHIP;
1928
+ })
1929
+ .addCase(verifyAuthMobileOtpAsync.pending, function (state) {
1930
+ state.loading = true;
1931
+ state.error = null;
1932
+ })
1933
+ .addCase(verifyAuthMobileOtpAsync.rejected, function (state, action) {
1934
+ state.loading = false;
1935
+ state.error = action.error.message;
1936
+ })
1937
+ .addCase(resendLeadMobileAuthOTP.pending, function (state) {
1938
+ state.loading = true;
1939
+ state.error = null;
1940
+ })
1941
+ .addCase(resendLeadMobileAuthOTP.fulfilled, function (state) {
1942
+ state.loading = false;
1943
+ state.error = null;
1944
+ })
1945
+ .addCase(resendLeadMobileAuthOTP.rejected, function (state, action) {
1946
+ state.loading = false;
1947
+ state.error = action.error.message;
1819
1948
  })
1820
1949
  .addCase(createAccountAsync.pending, function (state) {
1821
1950
  state.loading = true;
@@ -1924,6 +2053,6 @@ export var connectSlice = createSlice({
1924
2053
  });
1925
2054
  }
1926
2055
  });
1927
- export var clearError = (_a = connectSlice.actions, _a.clearError), stopLoader = _a.stopLoader, setIsLeadIdPassed = _a.setIsLeadIdPassed, resetMobileScreen = _a.resetMobileScreen, resetOTPValue = _a.resetOTPValue, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setError = _a.setError, setLeadId = _a.setLeadId, resetIndividualScreen = _a.resetIndividualScreen, setDefaultCountryCode = _a.setDefaultCountryCode, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen;
2056
+ export var clearError = (_a = connectSlice.actions, _a.clearError), stopLoader = _a.stopLoader, setIsLeadIdPassed = _a.setIsLeadIdPassed, resetMobileScreen = _a.resetMobileScreen, resetOTPValue = _a.resetOTPValue, resetVerifyAuthOTPValue = _a.resetVerifyAuthOTPValue, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setError = _a.setError, setLeadId = _a.setLeadId, resetIndividualScreen = _a.resetIndividualScreen, setDefaultCountryCode = _a.setDefaultCountryCode, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen;
1928
2057
  export default connectSlice.reducer;
1929
2058
  export var connectExpressSelector = function (state) { return state.connectExpress; };
@@ -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;
@@ -0,0 +1,49 @@
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 { useController, useFormContext } from 'react-hook-form';
15
+ import { useTranslation } from 'react-i18next';
16
+ import Box from '@mui/material/Box/Box';
17
+ import { styled } from '@mui/material/styles';
18
+ import OTPField from '../../../shared/OTP';
19
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
+ import { connectExpressSelector, clearError, resendLeadMobileAuthOTP } from '../../../app/connectExpress/connectExpressStore';
21
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
+ var BoxStyled = styled(Box)(function (_a) {
23
+ var theme = _a.theme;
24
+ return ({
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ fontFamily: theme.typography.fontFamily
28
+ });
29
+ });
30
+ var OTPInput = function (_a) {
31
+ var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
32
+ var t = useTranslation().t;
33
+ var dispatch = useAppDispatch();
34
+ var otpControl = useController({ name: 'otp', control: control });
35
+ var error = useAppSelector(connectExpressSelector).error;
36
+ var handleOnOTPChange = function (otp) {
37
+ if (error)
38
+ dispatch(clearError());
39
+ otpControl.field.onChange(otp);
40
+ };
41
+ var handleOnResendOTP = function () {
42
+ if (otpControl.field.value)
43
+ setValue('otp', '', { shouldValidate: true });
44
+ dispatch(resendLeadMobileAuthOTP());
45
+ };
46
+ var otpValue = otpControl.field.value;
47
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
48
+ };
49
+ export default React.memo(OTPInput);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface VerifyMobileAuthOTPProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<() => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,88 @@
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/Box';
14
+ import { styled } from '@mui/material/styles';
15
+ import * as React from 'react';
16
+ import { useTranslation } from 'react-i18next';
17
+ import Text from '../../../../components/Text';
18
+ import { clearError, connectExpressSelector, verifyAuthMobileOtpAsync, resetVerifyAuthOTPValue } from '../../../app/connectExpress/connectExpressStore';
19
+ import Button from '../../../shared/Button';
20
+ import { ScreenContainer } from '../../../shared/Containers';
21
+ import { useAppDispatch, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
22
+ import { handlePrevScreenStep } from '../../../../app/settings';
23
+ import { useLanguage } from '../../../../hooks';
24
+ import { useForm, FormProvider } from 'react-hook-form';
25
+ import { yupResolver } from '@hookform/resolvers/yup';
26
+ import Form from '../../../../components/Form';
27
+ import { maskPhone, deepCopy } from '../../../../utils';
28
+ import { AuthForScreen } from '../../../../@types';
29
+ import { OTPValidation } from './validation';
30
+ import OTPInput from './OTPInput';
31
+ var OTPTitleContainerStyled = styled(Box)(function (_a) {
32
+ var theme = _a.theme;
33
+ return ({
34
+ background: theme.palette.common.white,
35
+ border: '1px solid',
36
+ borderColor: theme.palette.divider,
37
+ direction: theme.direction,
38
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25),
39
+ marginBottom: theme.spacing(5.75)
40
+ });
41
+ });
42
+ var OTPTitleStyled = styled(Text)(function (_a) {
43
+ var theme = _a.theme;
44
+ 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' }));
45
+ });
46
+ var FormStyled = styled(Form)(function () { return ({
47
+ display: 'flex',
48
+ flexDirection: 'column'
49
+ }); });
50
+ var VerifyMobileAuthOTP = function () {
51
+ var _a, _b, _c, _d, _e, _f;
52
+ var dispatch = useAppDispatch();
53
+ var _g = useAppSelector(connectExpressSelector), data = _g.data, loading = _g.loading, error = _g.error;
54
+ var t = useTranslation().t;
55
+ var st = useSanitizedTranslation();
56
+ var isAr = useLanguage().isAr;
57
+ var methods = useForm({
58
+ resolver: yupResolver(OTPValidation),
59
+ defaultValues: data.verifyAuthOtpData,
60
+ mode: 'onChange'
61
+ });
62
+ React.useEffect(function () {
63
+ if (error)
64
+ dispatch(clearError());
65
+ }, [methods.formState.isValid]);
66
+ React.useEffect(function () {
67
+ return function () {
68
+ dispatch(resetVerifyAuthOTPValue());
69
+ };
70
+ }, []);
71
+ var onSubmit = function (formData) {
72
+ dispatch(verifyAuthMobileOtpAsync(deepCopy(formData)));
73
+ };
74
+ var onBack = function () {
75
+ var authFor = data.verifyAuthOtpData.authFor;
76
+ var step_name = 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP';
77
+ if (authFor === AuthForScreen.DOB)
78
+ step_name = 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP';
79
+ else if (authFor === AuthForScreen.MOBILE_OWNERSHIP)
80
+ step_name = 'COLLECT_MOBILE_OWNERSHIP';
81
+ dispatch(handlePrevScreenStep(step_name));
82
+ };
83
+ var disabled = !methods.formState.isValid;
84
+ var phone = ((_c = (_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.verifyAuthMobile) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to) ? (_f = (_e = (_d = data.responseData) === null || _d === void 0 ? void 0 : _d.verifyAuthMobile) === null || _e === void 0 ? void 0 : _e.verification_by) === null || _f === void 0 ? void 0 : _f.sent_to : '';
85
+ var title = t('ide_opt_sent_title');
86
+ 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') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
87
+ };
88
+ export default React.memo(VerifyMobileAuthOTP);
@@ -0,0 +1,3 @@
1
+ import VerifyMobileAuthOTP, { VerifyMobileAuthOTPProps } from './VerifyMobileAuthOTP';
2
+ export type { VerifyMobileAuthOTPProps };
3
+ export default VerifyMobileAuthOTP;
@@ -0,0 +1,2 @@
1
+ import VerifyMobileAuthOTP from './VerifyMobileAuthOTP';
2
+ export default VerifyMobileAuthOTP;
@@ -0,0 +1,8 @@
1
+ import * as yup from 'yup';
2
+ export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ otp: 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
+ otp: 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
+ otp: 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 OTPValidation = yup.object().shape({
3
+ otp: yup.string().min(6, 'otp_min_length').required('otp_required')
4
+ });
@@ -27,6 +27,7 @@ import ConnectExpressIdentityVerifyNafathScreen from './connectExpress/screens/I
27
27
  import ConnectExpressCollectIndividualScreen from './connectExpress/screens/CollectIndividualInfo';
28
28
  import ConnectExpressCollectDobScreen from './connectExpress/screens/DOB';
29
29
  import ConnectExpressCollectBusinessScreen from './connectExpress/screens/CollectBusinessInfo';
30
+ import ConnectExpressVerifyAuthMobileOtpScreen from './connectExpress/screens/VerifyMobileAuthOTP';
30
31
  import ConnectExpressCreateAccountLoaderScreen from './connectExpress/screens/CreateAccountLoader';
31
32
  import ConnectExpressPreparingDataLoaderScreen from './connectExpress/screens/PrepareDataLoading';
32
33
  import ConnectExpressSuccessFlowButtonsScreen from './connectExpress/screens/SuccessWithFlowButtons';
@@ -262,6 +263,10 @@ export var connectExpressFeatureScreens = [
262
263
  name: 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
263
264
  element: ConnectExpressCollectBusinessScreen
264
265
  },
266
+ {
267
+ name: 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP',
268
+ element: ConnectExpressVerifyAuthMobileOtpScreen
269
+ },
265
270
  {
266
271
  name: 'CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP',
267
272
  element: ConnectExpressAccountAlreadyCreatedScreen
@@ -1,19 +1,16 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import { styled } from '@mui/material/styles';
4
4
  import Box from '@mui/material/Box';
5
5
  import Icon from '../../../components/Icon';
6
6
  import { ICONS_NAMES } from '../../../constants';
7
- import { useLanguage } from '../../../hooks';
8
7
  var BoxStyled = styled(Box)(function (_a) {
9
8
  var _b;
10
9
  var theme = _a.theme;
11
10
  return (_b = {
12
11
  display: 'flex',
13
- flexDirection: 'column',
14
12
  justifyContent: 'center',
15
- alignItems: 'center',
16
- paddingTop: theme.spacing(5)
13
+ paddingTop: theme.spacing(15.75)
17
14
  },
18
15
  _b[theme.breakpoints.down('sm')] = {
19
16
  paddingTop: theme.spacing(11)
@@ -23,20 +20,11 @@ var BoxStyled = styled(Box)(function (_a) {
23
20
  var LogoBadgeStyled = styled(Icon)(function (_a) {
24
21
  var theme = _a.theme;
25
22
  return ({
26
- height: theme.spacing(8.875),
27
- width: theme.spacing(8.875)
28
- });
29
- });
30
- var LogoIconStyled = styled(Icon)(function (_a) {
31
- var theme = _a.theme;
32
- return ({
33
- width: theme.spacing(5.875),
34
- height: theme.spacing(3.625),
35
- marginTop: theme.spacing(2.5)
23
+ height: theme.spacing(9.5),
24
+ width: theme.spacing(19.322)
36
25
  });
37
26
  });
38
27
  var LogoBackground = function () {
39
- var isAr = useLanguage().isAr;
40
- return (_jsxs(BoxStyled, { children: [_jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO_EN_ICON }), _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_LOGO_TEXT_AR : ICONS_NAMES.TAP_LOGO_TEXT_EN, alt: 'tap logo' })] }));
28
+ return (_jsx(BoxStyled, { children: _jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO, alt: 'tap logo' }) }));
41
29
  };
42
30
  export default memo(LogoBackground);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.10.10-beta",
3
+ "version": "2.10.12-beta",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",