@tap-payments/auth-jsconnect 2.6.19-test → 2.6.20-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,5 +15,6 @@ export interface AnimationFlowProps {
15
15
  pointerEvents?: 'auto' | 'none';
16
16
  merchantInfo?: MerchantInfo;
17
17
  isMaturityExpress?: boolean;
18
+ showTextLogo?: boolean;
18
19
  }
19
- export default function AnimationFlow({ open, children, breakpoint, type, loading, error, isTapOrigin, screenId, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress }: AnimationFlowProps): JSX.Element;
20
+ export default function AnimationFlow({ open, children, breakpoint, type, loading, error, isTapOrigin, screenId, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo }: AnimationFlowProps): JSX.Element;
@@ -16,7 +16,7 @@ import BottomSheet from './BottomSheet';
16
16
  import Loader from './Loader';
17
17
  import Error from './Error';
18
18
  export default function AnimationFlow(_a) {
19
- var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin, screenId = _a.screenId, animationType = _a.animationType, onClose = _a.onClose, onConfirm = _a.onConfirm, _b = _a.pointerEvents, pointerEvents = _b === void 0 ? 'auto' : _b, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress;
19
+ var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin, screenId = _a.screenId, animationType = _a.animationType, onClose = _a.onClose, onConfirm = _a.onConfirm, _b = _a.pointerEvents, pointerEvents = _b === void 0 ? 'auto' : _b, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, showTextLogo = _a.showTextLogo;
20
20
  var small = useScreen(breakpoint).small;
21
21
  if (loading) {
22
22
  return _jsx(Loader, {});
@@ -25,10 +25,10 @@ export default function AnimationFlow(_a) {
25
25
  return _jsx(Error, { error: error });
26
26
  }
27
27
  if (type === 'PUPOP') {
28
- return (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress }, { children: children })));
28
+ return (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo }, { children: children })));
29
29
  }
30
30
  if (type === 'BOTTOMSHEET') {
31
31
  return (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo }, { children: children })));
32
32
  }
33
- return small ? (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, screenId: screenId, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo }, { children: children }))) : (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress }, { children: children })));
33
+ return small ? (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, screenId: screenId, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo }, { children: children }))) : (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo }, { children: children })));
34
34
  }
@@ -12,6 +12,7 @@ export interface DialogProps extends MUIDialogProps {
12
12
  pointerEvents?: 'none' | 'auto';
13
13
  merchantInfo?: MerchantInfo;
14
14
  isMaturityExpress?: boolean;
15
+ showTextLogo?: boolean;
15
16
  }
16
- declare const _default: React.MemoExoticComponent<({ open, children, transitionDuration, isTapOrigin, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, ...rest }: DialogProps) => JSX.Element>;
17
+ declare const _default: React.MemoExoticComponent<({ open, children, transitionDuration, isTapOrigin, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, ...rest }: DialogProps) => JSX.Element>;
17
18
  export default _default;
@@ -104,7 +104,7 @@ var LanguageFooterStyled = styled(Box, { shouldForwardProp: function (prop) { re
104
104
  });
105
105
  });
106
106
  var Dialog = function (_a) {
107
- var open = _a.open, children = _a.children, transitionDuration = _a.transitionDuration, isTapOrigin = _a.isTapOrigin, _b = _a.animationType, animationType = _b === void 0 ? 'slide' : _b, onClose = _a.onClose, onConfirm = _a.onConfirm, _c = _a.pointerEvents, pointerEvents = _c === void 0 ? 'auto' : _c, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, rest = __rest(_a, ["open", "children", "transitionDuration", "isTapOrigin", "animationType", "onClose", "onConfirm", "pointerEvents", "merchantInfo", "isMaturityExpress"]);
107
+ var open = _a.open, children = _a.children, transitionDuration = _a.transitionDuration, isTapOrigin = _a.isTapOrigin, _b = _a.animationType, animationType = _b === void 0 ? 'slide' : _b, onClose = _a.onClose, onConfirm = _a.onConfirm, _c = _a.pointerEvents, pointerEvents = _c === void 0 ? 'auto' : _c, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, showTextLogo = _a.showTextLogo, rest = __rest(_a, ["open", "children", "transitionDuration", "isTapOrigin", "animationType", "onClose", "onConfirm", "pointerEvents", "merchantInfo", "isMaturityExpress", "showTextLogo"]);
108
108
  var isAr = useLanguage().isAr;
109
109
  var animation = {};
110
110
  if (animationType === 'slide') {
@@ -129,6 +129,6 @@ var Dialog = function (_a) {
129
129
  marginBottom: isMaturityExpress ? '60px' : '0px'
130
130
  },
131
131
  pointerEvents: pointerEvents
132
- }, hideBackdrop: true, PaperComponent: PaperStyled, open: open, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, animation, { children: [_jsx(DialogContainer, __assign({ isTapOrigin: isTapOrigin, onClose: onClose, onConfirm: onConfirm }, { children: _jsxs(DialogContentStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [_jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON }), !isMaturityExpress && (_jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) }))] })), children] })) })), isMaturityExpress ? _jsx(PoweredByFooter, {}) : _jsx(CustomFooter, {}), _jsx(LanguageFooterStyled, __assign({ showLanguage: showLanguage }, { children: _jsx(CustomFooter, {}) }))] })));
132
+ }, hideBackdrop: true, PaperComponent: PaperStyled, open: open, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, animation, { children: [_jsx(DialogContainer, __assign({ isTapOrigin: isTapOrigin, onClose: onClose, onConfirm: onConfirm }, { children: _jsxs(DialogContentStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [_jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON }), !isMaturityExpress && showTextLogo && (_jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) }))] })), children] })) })), isMaturityExpress ? _jsx(PoweredByFooter, {}) : _jsx(CustomFooter, {}), _jsx(LanguageFooterStyled, __assign({ showLanguage: showLanguage }, { children: _jsx(CustomFooter, {}) }))] })));
133
133
  };
134
134
  export default React.memo(Dialog);
@@ -7017,25 +7017,6 @@ export var BUSINESS_COUNTRIES = [
7017
7017
  }
7018
7018
  ]
7019
7019
  },
7020
- {
7021
- id: 4,
7022
- title: 'East Asia',
7023
- countries: [
7024
- {
7025
- id: 8,
7026
- label: 'hk',
7027
- country: {
7028
- id: 45,
7029
- name_en: 'China, Hong Kong Special Administrative Region',
7030
- name_ar: 'منطقة هونغ كونغ الصينية الإدارية الخاصة',
7031
- iso2: 'HK',
7032
- iso3: 'HKG',
7033
- idd_prefix: '852',
7034
- logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/HK.svg'
7035
- }
7036
- }
7037
- ]
7038
- },
7039
7020
  {
7040
7021
  id: 5,
7041
7022
  title: 'South East Asia',
@@ -98,6 +98,7 @@ export interface ConnectData {
98
98
  brandData: BrandFormValues & ResponseData;
99
99
  brandSegmentData: BrandSegmentFormValues & ResponseData;
100
100
  flowName: FlowsTypes;
101
+ isStartFromBusinessCountry?: boolean;
101
102
  }
102
103
  export interface ConnectState extends SharedState<ConnectData> {
103
104
  customLoading?: boolean;
@@ -105,6 +106,7 @@ export interface ConnectState extends SharedState<ConnectData> {
105
106
  export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectState, {
106
107
  clearError: (state: ConnectState) => void;
107
108
  storeLeadId: (state: ConnectState, action: ActionState<string>) => void;
109
+ storeIsStartFromBusinessCountry: (state: ConnectState, action: ActionState<boolean>) => void;
108
110
  stopLoader: (state: ConnectState) => void;
109
111
  resetMobileScreen: (state: ConnectState, action: ActionState<CountryCode>) => void;
110
112
  resetNIDScreen: (state: ConnectState) => void;
@@ -115,7 +117,7 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectState
115
117
  setDefaultCountryCode: (state: ConnectState, action: ActionState<CountryCode>) => void;
116
118
  resetStore: (state: ConnectState) => void;
117
119
  }, "connect/store">;
118
- export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storeLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMerchantScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>;
120
+ export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storeLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetMerchantScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
119
121
  declare const _default: import("redux").Reducer<ConnectState, import("redux").AnyAction>;
120
122
  export default _default;
121
123
  export declare const connectSelector: (state: RootState) => ConnectState;
@@ -726,6 +726,7 @@ var initialState = {
726
726
  customLoading: false,
727
727
  data: {
728
728
  leadId: '',
729
+ isStartFromBusinessCountry: false,
729
730
  flowName: FlowsTypes.CONNECT,
730
731
  mobileData: {
731
732
  countryCode: defaultCountry,
@@ -780,6 +781,9 @@ export var connectSlice = createSlice({
780
781
  storeLeadId: function (state, action) {
781
782
  state.data.leadId = action.payload;
782
783
  },
784
+ storeIsStartFromBusinessCountry: function (state, action) {
785
+ state.data.isStartFromBusinessCountry = action.payload;
786
+ },
783
787
  stopLoader: function (state) {
784
788
  state.loading = false;
785
789
  },
@@ -806,7 +810,7 @@ export var connectSlice = createSlice({
806
810
  },
807
811
  resetStore: function (state) {
808
812
  var countryCode = state.data.mobileData.countryCode;
809
- state.data = __assign(__assign({}, initialState.data), { mobileData: __assign(__assign({}, initialState.data.mobileData), { countryCode: countryCode }), individualData: __assign(__assign({}, initialState.data.individualData), { countryCode: countryCode }) });
813
+ state.data = __assign(__assign({}, initialState.data), { isStartFromBusinessCountry: state.data.isStartFromBusinessCountry, mobileData: __assign(__assign({}, initialState.data.mobileData), { countryCode: countryCode }), individualData: __assign(__assign({}, initialState.data.individualData), { countryCode: countryCode }) });
810
814
  }
811
815
  },
812
816
  extraReducers: function (builder) {
@@ -1161,6 +1165,6 @@ export var connectSlice = createSlice({
1161
1165
  });
1162
1166
  }
1163
1167
  });
1164
- export var clearError = (_a = connectSlice.actions, _a.clearError), storeLeadId = _a.storeLeadId, stopLoader = _a.stopLoader, resetMobileScreen = _a.resetMobileScreen, resetOTPScreen = _a.resetOTPScreen, resetIndividualScreen = _a.resetIndividualScreen, resetMerchantScreen = _a.resetMerchantScreen, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setDefaultCountryCode = _a.setDefaultCountryCode;
1168
+ export var clearError = (_a = connectSlice.actions, _a.clearError), storeLeadId = _a.storeLeadId, stopLoader = _a.stopLoader, resetMobileScreen = _a.resetMobileScreen, resetOTPScreen = _a.resetOTPScreen, resetIndividualScreen = _a.resetIndividualScreen, resetMerchantScreen = _a.resetMerchantScreen, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setDefaultCountryCode = _a.setDefaultCountryCode, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry;
1165
1169
  export default connectSlice.reducer;
1166
1170
  export var connectSelector = function (state) { return state.connect; };
@@ -120,6 +120,7 @@ export interface ConnectExpressData {
120
120
  individualData: IndividualFormValues;
121
121
  businessData: BusinessDataFormValues;
122
122
  authenticationData: AuthenticationListFormValues;
123
+ isStartFromBusinessCountry?: boolean;
123
124
  }
124
125
  export interface ConnectExpressState extends SharedState<ConnectExpressData & ResponseData> {
125
126
  customLoading?: boolean;
@@ -129,6 +130,7 @@ export interface ConnectExpressState extends SharedState<ConnectExpressData & Re
129
130
  export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectExpressState, {
130
131
  setLeadId(state: ConnectExpressState, action: ActionState<string>): void;
131
132
  setShowBoard(state: ConnectExpressState, action: ActionState<boolean>): void;
133
+ storeIsStartFromBusinessCountry: (state: ConnectExpressState, action: ActionState<boolean>) => void;
132
134
  setIsLeadIdPassed: (state: ConnectExpressState, action: ActionState<boolean>) => void;
133
135
  clearError: (state: ConnectExpressState) => void;
134
136
  setError(state: ConnectExpressState, action: ActionState<string>): void;
@@ -141,7 +143,7 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectExpre
141
143
  resetStore: (state: ConnectExpressState) => void;
142
144
  resetIndividualScreen: (state: ConnectExpressState) => void;
143
145
  }, "connectExpress/store">;
144
- 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>, setShowBoard: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>;
146
+ 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>, setShowBoard: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
145
147
  declare const _default: import("redux").Reducer<ConnectExpressState, import("redux").AnyAction>;
146
148
  export default _default;
147
149
  export declare const connectExpressSelector: (state: RootState) => ConnectExpressState;
@@ -951,6 +951,7 @@ var initialState = {
951
951
  data: {
952
952
  showBoard: true,
953
953
  isLeadIdPassed: false,
954
+ isStartFromBusinessCountry: false,
954
955
  flowName: FlowsTypes.CONNECT_EXPRESS,
955
956
  mobileData: {
956
957
  countryCode: defaultCountry,
@@ -998,6 +999,9 @@ export var connectSlice = createSlice({
998
999
  setShowBoard: function (state, action) {
999
1000
  state.data.showBoard = action.payload;
1000
1001
  },
1002
+ storeIsStartFromBusinessCountry: function (state, action) {
1003
+ state.data.isStartFromBusinessCountry = action.payload;
1004
+ },
1001
1005
  setIsLeadIdPassed: function (state, action) {
1002
1006
  state.data.isLeadIdPassed = action.payload;
1003
1007
  },
@@ -1469,6 +1473,6 @@ export var connectSlice = createSlice({
1469
1473
  });
1470
1474
  }
1471
1475
  });
1472
- 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, setShowBoard = _a.setShowBoard, resetIndividualScreen = _a.resetIndividualScreen, setDefaultCountryCode = _a.setDefaultCountryCode;
1476
+ 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, setShowBoard = _a.setShowBoard, resetIndividualScreen = _a.resetIndividualScreen, setDefaultCountryCode = _a.setDefaultCountryCode, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry;
1473
1477
  export default connectSlice.reducer;
1474
1478
  export var connectExpressSelector = function (state) { return state.connectExpress; };
@@ -130,7 +130,7 @@ var Connect = memo(function (props) {
130
130
  var handleDialogClose = function () {
131
131
  dispatch(handleOpen(false));
132
132
  };
133
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', onConfirm: handleDialogClose, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: false }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: false }, { children: connectFeatureScreens.map(function (_a, index) {
133
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', onConfirm: handleDialogClose, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: false, showTextLogo: activeScreen.name !== 'CONNECT_BUSINESS_COUNTRY_STEP' }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: false }, { children: connectFeatureScreens.map(function (_a, index) {
134
134
  var Element = _a.element, name = _a.name;
135
135
  var isActive = activeScreen.name === name;
136
136
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -41,11 +41,14 @@ import { ScreenContainer } from '../../../shared/Containers';
41
41
  import BusinessCountry from '../../../shared/BusinessCountry';
42
42
  import { findCountryByIso2, isKW, isOtherThanKWOrSA } from '../../../../utils';
43
43
  import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
44
- import { connectSelector, setDefaultCountryCode, updateBusinessCountry } from '../../../app/connect/connectStore';
44
+ import { connectSelector, setDefaultCountryCode, updateBusinessCountry, storeIsStartFromBusinessCountry } from '../../../app/connect/connectStore';
45
45
  var BusinessCountryScreen = function (_a) {
46
46
  var dispatch = useAppDispatch();
47
47
  var settingsData = useAppSelector(settingsSelector).data;
48
48
  var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading;
49
+ React.useEffect(function () {
50
+ dispatch(storeIsStartFromBusinessCountry(true));
51
+ }, []);
49
52
  var defaultValue = React.useMemo(function () {
50
53
  var _a, _b;
51
54
  return ((_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2) || ((_b = settingsData.ipCountry) === null || _b === void 0 ? void 0 : _b.iso2);
@@ -17,7 +17,7 @@ import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import { civilIDValidationSchema } from './validation';
19
19
  import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
20
- import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
20
+ import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
21
21
  import { deepCopy } from '../../../../utils';
22
22
  import { clearError, connectSelector, createCivilIdAuth, resetMobileScreen, resetStore } from '../../../app/connect/connectStore';
23
23
  import Form from '../../../../components/Form';
@@ -86,10 +86,13 @@ var CivilID = function (_a) {
86
86
  var onBack = function () {
87
87
  dispatch(handlePrevScreenStep('CONNECT_MOBILE_STEP'));
88
88
  };
89
+ var onBackToCountryList = function () {
90
+ dispatch(handleCurrentActiveScreen('CONNECT_BUSINESS_COUNTRY_STEP'));
91
+ };
89
92
  React.useEffect(function () {
90
93
  dispatch(resetStore());
91
94
  }, []);
92
95
  var disabled = !methods.formState.isValid || !!error;
93
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: methods.formState.isValid ? 7.5 : 0, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
96
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: methods.formState.isValid ? 7.5 : 0, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
94
97
  };
95
98
  export default React.memo(CivilID);
@@ -20,7 +20,7 @@ import Collapse from '../../../../components/Collapse';
20
20
  import Form from '../../../../components/Form';
21
21
  import Button, { AbsherButton, MobileButton } from '../../../shared/Button';
22
22
  import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
23
- import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
23
+ import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
24
24
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
25
25
  import { clearError, connectSelector, createMobileAuth, resetNIDScreen, resetCivilScreen, resetOTPScreen, resetStore } from '../../../app/connect/connectStore';
26
26
  import { useLanguage } from '../../../../hooks';
@@ -117,6 +117,9 @@ var Mobile = function (_a) {
117
117
  });
118
118
  dispatch(handlePrevScreenStep(isKWCountry ? 'CONNECT_CIVIL_ID_STEP' : 'CONNECT_NID_STEP'));
119
119
  };
120
+ var onBackToCountryList = function () {
121
+ dispatch(handleCurrentActiveScreen('CONNECT_BUSINESS_COUNTRY_STEP'));
122
+ };
120
123
  React.useEffect(function () {
121
124
  dispatch(resetStore());
122
125
  }, []);
@@ -126,6 +129,6 @@ var Mobile = function (_a) {
126
129
  var disabled = !methods.formState.isValid || !!error;
127
130
  var title = t('join_our_community');
128
131
  var subTitle = t('ide_terms_and_conditions_description');
129
- return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid && !isOtherThanKWOrSACountry }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKWCountry ? (_jsx(MobileButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) }))] }));
132
+ return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid && !isOtherThanKWOrSACountry }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKWCountry ? (_jsx(MobileButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) }))] }));
130
133
  };
131
134
  export default React.memo(Mobile);
@@ -17,7 +17,7 @@ import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import { NIDValidationSchema } from './validation';
19
19
  import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
20
- import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
20
+ import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
21
21
  import { clearError, connectSelector, createNIDAuth, resetMobileScreen, resetStore } from '../../../app/connect/connectStore';
22
22
  import Form from '../../../../components/Form';
23
23
  import Button, { MobileButton } from '../../../shared/Button';
@@ -95,10 +95,13 @@ var NID = function (_a) {
95
95
  });
96
96
  dispatch(handlePrevScreenStep('CONNECT_MOBILE_STEP'));
97
97
  };
98
+ var onBackToCountryList = function () {
99
+ dispatch(handleCurrentActiveScreen('CONNECT_BUSINESS_COUNTRY_STEP'));
100
+ };
98
101
  React.useEffect(function () {
99
102
  dispatch(resetStore());
100
103
  }, []);
101
104
  var disabled = !methods.formState.isValid || !!error;
102
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
105
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
103
106
  };
104
107
  export default React.memo(NID);
@@ -110,16 +110,15 @@ var ConnectExpress = memo(function (_a) {
110
110
  }
111
111
  }, [data.businessCountry]);
112
112
  React.useEffect(function () {
113
- var _a;
113
+ var _a, _b;
114
114
  if (settingLoading)
115
115
  return;
116
116
  if (data.isValidOperator && props.open) {
117
- if (configToken) {
118
- if (connectData.leadId)
119
- dispatch(retrieveLeadIdentityByIdAsync(connectData.leadId));
117
+ if (configToken && connectData.leadId) {
118
+ dispatch(retrieveLeadIdentityByIdAsync(connectData.leadId));
120
119
  return;
121
120
  }
122
- if (leadId && props.scope !== 'auth') {
121
+ if (leadId) {
123
122
  dispatch(setIsLeadIdPassed(true));
124
123
  dispatch(setLeadId(leadId));
125
124
  dispatch(retrieveLeadIdentityByIdAsync(leadId));
@@ -129,7 +128,7 @@ var ConnectExpress = memo(function (_a) {
129
128
  dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
130
129
  return;
131
130
  }
132
- if (data.businessCountry.iso2 && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
131
+ if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
133
132
  dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
134
133
  }
135
134
  }
@@ -41,11 +41,14 @@ import { ScreenContainer } from '../../../shared/Containers';
41
41
  import BusinessCountry from '../../../shared/BusinessCountry';
42
42
  import { findCountryByIso2, isKW, isOtherThanKWOrSA } from '../../../../utils';
43
43
  import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
44
- import { connectExpressSelector, setDefaultCountryCode, updateBusinessCountryAsync } from '../../../app/connectExpress/connectExpressStore';
44
+ import { connectExpressSelector, setDefaultCountryCode, storeIsStartFromBusinessCountry, updateBusinessCountryAsync } from '../../../app/connectExpress/connectExpressStore';
45
45
  var BusinessCountryScreen = function (_a) {
46
46
  var dispatch = useAppDispatch();
47
47
  var settingsData = useAppSelector(settingsSelector).data;
48
48
  var _b = useAppSelector(connectExpressSelector), data = _b.data, loading = _b.loading;
49
+ React.useEffect(function () {
50
+ dispatch(storeIsStartFromBusinessCountry(true));
51
+ }, []);
49
52
  var defaultValue = React.useMemo(function () {
50
53
  var _a, _b;
51
54
  return ((_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2) || ((_b = settingsData.ipCountry) === null || _b === void 0 ? void 0 : _b.iso2);
@@ -17,7 +17,7 @@ import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import { civilIDValidationSchema } from './validation';
19
19
  import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
20
- import { handlePrevScreenStep } from '../../../../app/settings';
20
+ import { handleCurrentActiveScreen, handlePrevScreenStep } from '../../../../app/settings';
21
21
  import { clearError, connectExpressSelector, createCivilIdAuthAsync, resetStore } from '../../../app/connectExpress/connectExpressStore';
22
22
  import Form from '../../../../components/Form';
23
23
  import Button, { MobileButton } from '../../../shared/Button';
@@ -79,7 +79,10 @@ var CivilID = function (_a) {
79
79
  var onBack = function () {
80
80
  dispatch(handlePrevScreenStep());
81
81
  };
82
+ var onBackToCountryList = function () {
83
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
84
+ };
82
85
  var disabled = !methods.formState.isValid || !!error;
83
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: methods.formState.isValid ? 7.5 : 0, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
86
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: methods.formState.isValid ? 7.5 : 0, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
84
87
  };
85
88
  export default React.memo(CivilID);
@@ -20,7 +20,7 @@ import Collapse from '../../../../components/Collapse';
20
20
  import Form from '../../../../components/Form';
21
21
  import Button, { AbsherButton, MobileButton } from '../../../shared/Button';
22
22
  import { useAppDispatch, useAppSelector, useCountry, useFormErrorAndUpdateReadOnly, useFormReadOnly } from '../../../../hooks';
23
- import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
23
+ import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
24
24
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
25
25
  import { clearError, resetStore, connectExpressSelector, createMobileAuthAsync } from '../../../app/connectExpress/connectExpressStore';
26
26
  import { useLanguage } from '../../../../hooks';
@@ -98,6 +98,9 @@ var Mobile = function (_a) {
98
98
  var screen = isKuwait ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP';
99
99
  dispatch(handlePrevScreenStep(screen));
100
100
  };
101
+ var onBackToCountryList = function () {
102
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
103
+ };
101
104
  var handleCountryOpen = function () {
102
105
  setAnchor(true);
103
106
  };
@@ -107,6 +110,6 @@ var Mobile = function (_a) {
107
110
  var originalReadOnly = useFormReadOnly(methods);
108
111
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
109
112
  var disabled = !methods.formState.isValid || !!error;
110
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, countries: settingData.countries, onListOpen: handleCountryOpen, onListClose: handleCountryClose }) }), _jsxs(Collapse, __assign({ in: !anchor }, { children: [_jsx(TAC, { show: isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: (isLeadIdPassed ? !isLeadIdentityIdAvailable : !methods.formState.isValid) && !isOther }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKuwait ? (_jsx(MobileButton, __assign({ disabled: loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) })) }));
113
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, countries: settingData.countries, onListOpen: handleCountryOpen, onListClose: handleCountryClose }) }), _jsxs(Collapse, __assign({ in: !anchor }, { children: [_jsx(TAC, { show: isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Button, __assign({ isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: (isLeadIdPassed ? !isLeadIdentityIdAvailable : !methods.formState.isValid) && !isOther }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKuwait ? (_jsx(MobileButton, __assign({ disabled: loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) })) }));
111
114
  };
112
115
  export default React.memo(Mobile);
@@ -17,7 +17,7 @@ import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import { NIDValidationSchema } from './validation';
19
19
  import { useAppDispatch, useLanguage, useAppSelector, useFormReadOnly, useFormErrorAndUpdateReadOnly } from '../../../../hooks';
20
- import { handlePrevScreenStep } from '../../../../app/settings';
20
+ import { handleCurrentActiveScreen, handlePrevScreenStep } from '../../../../app/settings';
21
21
  import { clearError, connectExpressSelector, createNIDAuthAsync } from '../../../app/connectExpress/connectExpressStore';
22
22
  import Form from '../../../../components/Form';
23
23
  import Button, { MobileButton } from '../../../shared/Button';
@@ -86,10 +86,13 @@ var NID = function (_a) {
86
86
  var onBack = function () {
87
87
  dispatch(handlePrevScreenStep());
88
88
  };
89
+ var onBackToCountryList = function () {
90
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
91
+ };
89
92
  var originalReadOnly = useFormReadOnly(methods);
90
93
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
91
94
  var disabled = !methods.formState.isValid || !!error;
92
95
  var isLeadIdentityIdAvailable = (_c = (_b = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _b === void 0 ? void 0 : _b.identification) === null || _c === void 0 ? void 0 : _c.id;
93
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse, readOnly: readOnly['nid'] }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose, readOnly: readOnly['dob'] }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(TAC, { show: isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Button, __assign({ loading: loading, isAr: isAr, disableBack: true, disabled: disabled, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: isLeadIdPassed ? !isLeadIdentityIdAvailable && !methods.formState.isValid : !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
96
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse, readOnly: readOnly['nid'] }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose, readOnly: readOnly['dob'] }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(TAC, { show: isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: isLeadIdPassed ? !isLeadIdentityIdAvailable && !methods.formState.isValid : !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
94
97
  };
95
98
  export default React.memo(NID);
@@ -98,7 +98,7 @@ var BusinessCountry = function (_a) {
98
98
  var _b, _c;
99
99
  var countries = _a.countries, loading = _a.loading, defaultCountryIso2 = _a.defaultCountryIso2, onSelectCountry = _a.onSelectCountry;
100
100
  var _d = React.useState(countries || []), countryList = _d[0], setCountryList = _d[1];
101
- var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
101
+ var _e = React.useState(true), open = _e[0], setOpen = _e[1];
102
102
  var _f = React.useState(''), subIndex = _f[0], setSubIndex = _f[1];
103
103
  var _g = React.useState(), selectedCountry = _g[0], setSelectedCountry = _g[1];
104
104
  var t = useTranslation().t;
@@ -112,11 +112,11 @@ var BusinessCountry = function (_a) {
112
112
  });
113
113
  }); };
114
114
  var handleCloseMainMenu = function () {
115
- setAnchorEl(null);
115
+ setOpen(false);
116
116
  handleSearch('');
117
117
  };
118
- var handleOpenMainMenu = function (event) {
119
- setAnchorEl(event.currentTarget);
118
+ var handleOpenMainMenu = function () {
119
+ setOpen(true);
120
120
  };
121
121
  var handleOpenSubMenu = function (index) {
122
122
  if (subIndex === index)
@@ -131,6 +131,7 @@ var BusinessCountry = function (_a) {
131
131
  return (r.countries || []).find(function (c) {
132
132
  if (c.country.iso2 === defaultCountryIso2) {
133
133
  setSelectedCountry(c);
134
+ setSubIndex(r.id.toString());
134
135
  return;
135
136
  }
136
137
  });
@@ -144,12 +145,7 @@ var BusinessCountry = function (_a) {
144
145
  });
145
146
  setCountryList(filteredList);
146
147
  };
147
- React.useEffect(function () {
148
- var item = countryList === null || countryList === void 0 ? void 0 : countryList.find(function (r) { var _a; return (_a = r.countries) === null || _a === void 0 ? void 0 : _a.find(function (c) { var _a; return c.country.iso2 === ((_a = countryValue === null || countryValue === void 0 ? void 0 : countryValue.country) === null || _a === void 0 ? void 0 : _a.iso2); }); });
149
- if (item)
150
- setSubIndex(item.id.toString());
151
- }, [anchorEl]);
152
- return (_jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputSelect, { required: true, label: t('country_list_title'), value: (isAr ? (_b = countryValue === null || countryValue === void 0 ? void 0 : countryValue.country) === null || _b === void 0 ? void 0 : _b.name_ar : (_c = countryValue === null || countryValue === void 0 ? void 0 : countryValue.country) === null || _c === void 0 ? void 0 : _c.name_en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_any_country'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: countryList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item, e) {
148
+ return (_jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputSelect, { required: true, label: t('country_list_title'), value: (isAr ? (_b = countryValue === null || countryValue === void 0 ? void 0 : countryValue.country) === null || _b === void 0 ? void 0 : _b.name_ar : (_c = countryValue === null || countryValue === void 0 ? void 0 : countryValue.country) === null || _c === void 0 ? void 0 : _c.name_en) || '', onClick: open ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_any_country'), endAdornment: _jsx(ExpandIcon, { anchorEl: open }) }), _jsxs(Collapse, __assign({ in: open }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: countryList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item, e) {
153
149
  e.stopPropagation();
154
150
  handleOpenSubMenu(item.id.toString());
155
151
  }, renderItem: function (item) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.6.19-test",
3
+ "version": "2.6.20-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",