@tap-payments/auth-jsconnect 2.8.51-development → 2.8.52-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.
Files changed (229) hide show
  1. package/build/@types/app.d.ts +0 -1
  2. package/build/@types/form.d.ts +0 -1
  3. package/build/@types/redux.d.ts +0 -1
  4. package/build/api/axios.js +1 -2
  5. package/build/api/entity.d.ts +2 -2
  6. package/build/api/entity.js +4 -12
  7. package/build/api/index.d.ts +2 -2
  8. package/build/constants/api.d.ts +1 -0
  9. package/build/constants/api.js +2 -0
  10. package/build/constants/app.d.ts +2 -0
  11. package/build/constants/app.js +2 -0
  12. package/build/features/app/auth/authStore.js +23 -2
  13. package/build/features/app/bank/bankStore.d.ts +18 -13
  14. package/build/features/app/bank/bankStore.js +165 -184
  15. package/build/features/app/board/boardStore.js +30 -52
  16. package/build/features/app/brand/brandStore.d.ts +33 -16
  17. package/build/features/app/brand/brandStore.js +242 -239
  18. package/build/features/app/business/businessStore.d.ts +5 -0
  19. package/build/features/app/business/businessStore.js +87 -76
  20. package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -15
  21. package/build/features/app/connectExpress/connectExpressStore.js +68 -107
  22. package/build/features/app/entity/entityStore.d.ts +36 -20
  23. package/build/features/app/entity/entityStore.js +246 -196
  24. package/build/features/app/individual/individualStore.d.ts +38 -22
  25. package/build/features/app/individual/individualStore.js +266 -263
  26. package/build/features/app/password/passwordStore.d.ts +23 -40
  27. package/build/features/app/password/passwordStore.js +233 -226
  28. package/build/features/app/tax/taxStore.d.ts +7 -13
  29. package/build/features/app/tax/taxStore.js +147 -168
  30. package/build/features/auth/Auth.js +5 -1
  31. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -13
  32. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +26 -4
  33. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +1 -7
  34. package/build/features/auth/screens/OTP/OTP.js +6 -1
  35. package/build/features/auth/screens/OTP/OTPInput.js +11 -0
  36. package/build/features/bank/Bank.d.ts +0 -1
  37. package/build/features/bank/Bank.js +4 -7
  38. package/build/features/bank/screens/BankDetails/BankDetails.js +5 -18
  39. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  40. package/build/features/bank/screens/Verify/Verify.js +5 -5
  41. package/build/features/board/Board.js +4 -8
  42. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
  43. package/build/features/brand/Brand.d.ts +0 -1
  44. package/build/features/brand/Brand.js +4 -7
  45. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +35 -8
  46. package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -49
  47. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +3 -3
  48. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
  49. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +18 -5
  50. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  51. package/build/features/brand/screens/BrandActivities/TAC.d.ts +7 -2
  52. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  53. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  54. package/build/features/brand/screens/BrandInfo/BrandInfo.js +5 -23
  55. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +7 -23
  56. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  57. package/build/features/brand/screens/Verify/Verify.js +1 -1
  58. package/build/features/business/Business.js +4 -9
  59. package/build/features/business/screens/Activities/Activities.js +3 -12
  60. package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
  61. package/build/features/business/screens/Activities/OperationStartDate.d.ts +1 -1
  62. package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +1 -1
  63. package/build/features/business/screens/BusinessType/BusinessType.js +2 -10
  64. package/build/features/business/screens/BusinessType/LicenseType.d.ts +26 -4
  65. package/build/features/business/screens/CivilID/CivilID.js +1 -1
  66. package/build/features/business/screens/Customers/CustomerLocations.d.ts +36 -9
  67. package/build/features/business/screens/Customers/Customers.js +3 -12
  68. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
  69. package/build/features/business/screens/Customers/RefundPolicy.d.ts +18 -5
  70. package/build/features/business/screens/IDBOD/IDBOD.js +2 -10
  71. package/build/features/business/screens/OTP/OTP.js +1 -1
  72. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -14
  73. package/build/features/business/screens/Verify/Verify.js +3 -13
  74. package/build/features/connect/Connect.js +4 -5
  75. package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
  76. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +2 -9
  77. package/build/features/connect/screens/CivilID/CivilID.js +7 -2
  78. package/build/features/connect/screens/Individual/Email.js +1 -3
  79. package/build/features/connect/screens/Individual/Individual.js +1 -1
  80. package/build/features/connect/screens/Merchant/BrandList.js +3 -3
  81. package/build/features/connect/screens/Merchant/Merchant.js +1 -1
  82. package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
  83. package/build/features/connect/screens/Mobile/Mobile.js +8 -11
  84. package/build/features/connect/screens/NID/NID.js +1 -1
  85. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  86. package/build/features/connectExpress/ConnectExpress.js +18 -5
  87. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
  88. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
  89. package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
  90. package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
  91. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +1 -7
  92. package/build/features/connectExpress/screens/CivilID/CivilID.js +7 -2
  93. package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
  94. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +9 -2
  95. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +26 -4
  96. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +7 -2
  97. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +9 -2
  98. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  99. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +24 -14
  100. package/build/features/connectExpress/screens/IdentityOTP/OTP.js +8 -7
  101. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +7 -5
  102. package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -9
  103. package/build/features/connectExpress/screens/NID/NID.js +7 -2
  104. package/build/features/connectExpress/screens/NID/TAC.d.ts +7 -2
  105. package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
  106. package/build/features/connectExpress/screens/OTP/OTP.js +6 -1
  107. package/build/features/connectExpress/screens/OTP/OTPInput.js +11 -1
  108. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  109. package/build/features/entity/Entity.d.ts +0 -1
  110. package/build/features/entity/Entity.js +4 -7
  111. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -2
  112. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
  113. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
  114. package/build/features/entity/screens/EntityCapital/EntityCapital.js +10 -34
  115. package/build/features/entity/screens/EntityName/EntityName.js +15 -32
  116. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +35 -8
  117. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +1 -1
  118. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +1 -1
  119. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  120. package/build/features/entity/screens/Verify/Verify.js +1 -1
  121. package/build/features/featuresScreens.js +7 -67
  122. package/build/features/individual/Individual.d.ts +0 -1
  123. package/build/features/individual/Individual.js +4 -7
  124. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +1 -1
  125. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -54
  126. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
  127. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +26 -4
  128. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
  129. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
  130. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
  131. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  132. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +2 -2
  133. package/build/features/individual/screens/IndividualList/IndividualList.js +5 -18
  134. package/build/features/individual/screens/IndividualList/UserList.js +9 -13
  135. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  136. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +26 -4
  137. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +1 -1
  138. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -76
  139. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  140. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  141. package/build/features/individual/screens/Verify/Verify.js +1 -1
  142. package/build/features/password/Password.d.ts +0 -1
  143. package/build/features/password/Password.js +28 -75
  144. package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
  145. package/build/features/password/screens/OTP/OTP.js +1 -1
  146. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  147. package/build/features/password/screens/Verify/Verify.js +5 -5
  148. package/build/features/shared/Address/CountryList.d.ts +23 -7
  149. package/build/features/shared/Address/InputSelect.d.ts +23 -7
  150. package/build/features/shared/Button/FlowsButtons.js +3 -13
  151. package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
  152. package/build/features/shared/Containers/FeatureContainer.js +3 -3
  153. package/build/features/shared/Input/Input.d.ts +2 -2
  154. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
  155. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
  156. package/build/features/shared/UploadFile/FileUpload.d.ts +7 -2
  157. package/build/features/shared/UploadFile/UploadFile.d.ts +7 -2
  158. package/build/features/shared/UploadFile/UploadWrapper.d.ts +7 -2
  159. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +7 -2
  160. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +7 -2
  161. package/build/features/signIn/SignIn.js +3 -12
  162. package/build/features/tax/Tax.d.ts +0 -1
  163. package/build/features/tax/Tax.js +4 -7
  164. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  165. package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
  166. package/build/features/tax/screens/Verify/Verify.js +5 -5
  167. package/build/hooks/index.d.ts +0 -1
  168. package/build/hooks/index.js +0 -1
  169. package/build/hooks/useVerifyToken.d.ts +2 -5
  170. package/build/hooks/useVerifyToken.js +5 -10
  171. package/build/utils/common.js +4 -4
  172. package/build/utils/locale.js +1 -2
  173. package/build/utils/string.d.ts +2 -5
  174. package/build/utils/string.js +5 -34
  175. package/package.json +2 -2
  176. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
  177. package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
  178. package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
  179. package/build/features/bank/screens/OperatorError/index.js +0 -2
  180. package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
  181. package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
  182. package/build/features/board/screens/OperatorError/index.d.ts +0 -3
  183. package/build/features/board/screens/OperatorError/index.js +0 -2
  184. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
  185. package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
  186. package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
  187. package/build/features/brand/screens/OperatorError/index.js +0 -2
  188. package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
  189. package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
  190. package/build/features/business/screens/OperatorError/index.d.ts +0 -3
  191. package/build/features/business/screens/OperatorError/index.js +0 -2
  192. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -9
  193. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
  194. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
  195. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
  196. package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
  197. package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
  198. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -5
  199. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +0 -34
  200. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +0 -2
  201. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +0 -2
  202. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
  203. package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
  204. package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
  205. package/build/features/entity/screens/OperatorError/index.js +0 -2
  206. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -14
  207. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
  208. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
  209. package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
  210. package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
  211. package/build/features/individual/screens/OperatorError/index.js +0 -2
  212. package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
  213. package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
  214. package/build/features/password/screens/OperatorError/index.d.ts +0 -3
  215. package/build/features/password/screens/OperatorError/index.js +0 -2
  216. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
  217. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
  218. package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
  219. package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
  220. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
  221. package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
  222. package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
  223. package/build/features/signIn/screens/OperatorError/index.js +0 -2
  224. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
  225. package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
  226. package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
  227. package/build/features/tax/screens/OperatorError/index.js +0 -2
  228. package/build/hooks/useFormDirtyCheck.d.ts +0 -10
  229. package/build/hooks/useFormDirtyCheck.js +0 -66
@@ -101,7 +101,7 @@ var NID = function (_a) {
101
101
  React.useEffect(function () {
102
102
  dispatch(resetStore());
103
103
  }, []);
104
- var disabled = !methods.formState.isValid;
104
+ var disabled = !methods.formState.isValid || !!error;
105
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') }))] }))] }))] })) })) }));
106
106
  };
107
107
  export default React.memo(NID);
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
- import GenericError from '../../../shared/GenericError';
4
+ import GenericError from '../../../../features/shared/GenericError';
5
5
  var OperatorError = function (_a) {
6
6
  var t = useTranslation().t;
7
7
  return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
@@ -67,7 +67,7 @@ import { store } from '../../app/store';
67
67
  import { connectExpressSelector, setIsLeadIdPassed, setLeadId, retrieveLeadIdentityByIdAsync, setDefaultCountryCode } from '../app/connectExpress/connectExpressStore';
68
68
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
69
69
  import Collapse from '../../components/Collapse';
70
- import { isKW, findOrCreateElementAndInject, sendPageView, isOtherThanKWOrSA, initializeGTM } from '../../utils';
70
+ import { isKW, findOrCreateElementAndInject, sendPageView, isOtherThanKWOrSA, initializeGTM, sendCustomEventToGTM, sendCustomDimension } from '../../utils';
71
71
  import { CONNECT_EXPRESS_SCREENS_NAVIGATION } from '../../constants';
72
72
  import { connectExpressFeatureScreens } from '../featuresScreens';
73
73
  import Background from '../shared/Background';
@@ -89,20 +89,33 @@ var ConnectExpress = memo(function (_a) {
89
89
  });
90
90
  }); };
91
91
  useAppConfig(__assign(__assign(__assign({ navigation: CONNECT_EXPRESS_SCREENS_NAVIGATION, maturity: 'express' }, props), { postURL: postURL, configToken: configToken }), (configToken && { onVerifyConfigTokenSuccess: onVerifyConfigTokenSuccess })));
92
- useErrorListener(connectExpressError || error);
92
+ useErrorListener(connectExpressError || error, {
93
+ event: 'Send Event',
94
+ event_category: 'User Registration Flow',
95
+ event_action: 'Registration Error'
96
+ });
93
97
  useStepStartedListener();
94
98
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant, appConfig = data.appConfig;
95
99
  React.useEffect(function () {
96
100
  initializeGTM();
97
101
  sendPageView({
98
- title: 'Connect Express',
99
- connect_flow: 'Express'
102
+ title: 'Connect Express'
100
103
  });
101
104
  }, []);
102
105
  React.useEffect(function () {
103
- var _a;
106
+ var _a, _b, _c;
104
107
  if (!!((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2)) {
105
108
  dispatch(setDefaultCountryCode(data.businessCountry));
109
+ sendCustomEventToGTM({
110
+ event: 'Send Event',
111
+ event_category: 'User Registration Flow',
112
+ event_action: 'Registration Landing Page Viewed',
113
+ event_label: (_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2
114
+ });
115
+ sendCustomDimension({
116
+ event: 'PageView',
117
+ website_country: (_c = data.businessCountry) === null || _c === void 0 ? void 0 : _c.iso2
118
+ });
106
119
  }
107
120
  }, [data.businessCountry]);
108
121
  React.useEffect(function () {
@@ -29,7 +29,6 @@ import BrandList from './BrandList';
29
29
  import EntityList from './EntityList';
30
30
  import LicenseNumber from './LicenseNumber';
31
31
  import EntityLegalName from './EntityLegalName';
32
- import LicenseType from './EntityLicenseType';
33
32
  var ListType;
34
33
  (function (ListType) {
35
34
  ListType["BrandList"] = "BrandList";
@@ -65,8 +64,7 @@ var AuthenticationList = function (_a) {
65
64
  var dispatch = useAppDispatch();
66
65
  var onSubmit = function (formData) {
67
66
  if (isAddEntity) {
68
- var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType;
69
- var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType };
67
+ var data_1 = { licenseNumber: formData.licenseNumber, legalName: formData.legalName, brandInfo: formData.brandInfo };
70
68
  dispatch(createEntity(deepCopy(data_1)));
71
69
  return;
72
70
  }
@@ -78,7 +76,6 @@ var AuthenticationList = function (_a) {
78
76
  setIsAddEntity(false);
79
77
  methods.setValue('licenseNumber', '');
80
78
  methods.setValue('legalName', '');
81
- methods.setValue('licenseType', '');
82
79
  methods.setValue('entityInfo', undefined, { shouldValidate: true });
83
80
  return;
84
81
  }
@@ -99,6 +96,6 @@ var AuthenticationList = function (_a) {
99
96
  };
100
97
  var isBrandList = listActive === ListType.BrandList;
101
98
  var isEntityList = listActive === ListType.EntityList;
102
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
99
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
103
100
  };
104
101
  export default React.memo(AuthenticationList);
@@ -81,7 +81,6 @@ var EntityList = function (_a) {
81
81
  if (filteredEntityList.length) {
82
82
  setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
83
83
  setValue('licenseNumber', '');
84
- setValue('licenseType', '');
85
84
  setValue('legalName', '');
86
85
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
87
86
  }
@@ -122,12 +121,8 @@ var EntityList = function (_a) {
122
121
  selectedEntityControl.field.onChange(entity);
123
122
  if (entity.id === ADD_ENTITY)
124
123
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
125
- else {
126
- setValue('licenseNumber', '');
127
- setValue('legalName', '');
128
- setValue('licenseType', '');
124
+ else
129
125
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
130
- }
131
126
  onCloseEntityList();
132
127
  };
133
128
  var selectedEntity = selectedEntityControl.field.value;
@@ -3,18 +3,15 @@ export declare const AuthenticationListValidationSchema: yup.ObjectSchema<import
3
3
  brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
4
4
  entityInfo: any;
5
5
  licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
- licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
6
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
7
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
8
  brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
10
9
  entityInfo: any;
11
10
  licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
12
- licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
13
11
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
12
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
13
  brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
16
14
  entityInfo: any;
17
15
  licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
- licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
19
16
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
20
17
  }>>>;
@@ -34,16 +34,6 @@ export var AuthenticationListValidationSchema = yup.object().shape({
34
34
  .required('');
35
35
  })
36
36
  .required(''),
37
- licenseType: yup
38
- .string()
39
- .when('entityInfo', function (entityInfo) {
40
- var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
41
- if (!isAddEntity) {
42
- return yup.string().optional();
43
- }
44
- return yup.string().required('choose_license_type');
45
- })
46
- .required(''),
47
37
  legalName: yup
48
38
  .string()
49
39
  .when('entityInfo', function (entityInfo) {
@@ -53,7 +53,7 @@ import { ScreenContainer } from '../../../shared/Containers';
53
53
  import BusinessCountry from '../../../shared/BusinessCountry';
54
54
  import Button from '../../../shared/Button';
55
55
  import Collapse from '../../../../components/Collapse';
56
- import { findCountryByIso2, isKW, isOtherThanKWOrSA, sendCustomEventToGTM } from '../../../../utils';
56
+ import { findCountryByIso2, isKW, isOtherThanKWOrSA } from '../../../../utils';
57
57
  import { handleNextScreenStep, handleSetCountryByIso2, settingsSelector } from '../../../../app/settings';
58
58
  import { clearError, connectExpressSelector, setDefaultCountryCode, storeIsStartFromBusinessCountry, updateBusinessCountryAsync } from '../../../app/connectExpress/connectExpressStore';
59
59
  var BusinessCountryScreen = function (_a) {
@@ -81,12 +81,6 @@ var BusinessCountryScreen = function (_a) {
81
81
  return [2];
82
82
  countryCode = findCountryByIso2(settingsData.countries, iso2);
83
83
  dispatch(handleSetCountryByIso2(iso2));
84
- sendCustomEventToGTM({
85
- event: 'Send Event',
86
- event_category: 'User Registration Flow',
87
- event_action: 'Country selection page view',
88
- event_label: iso2
89
- });
90
84
  if (!data.leadId) return [3, 2];
91
85
  return [4, dispatch(updateBusinessCountryAsync(iso2))];
92
86
  case 1:
@@ -27,7 +27,7 @@ import Box from '@mui/material/Box';
27
27
  import Divider from '@mui/material/Divider';
28
28
  import Text from '../../../../components/Text';
29
29
  import IDNumber from './IDNumber';
30
- import { deepCopy } from '../../../../utils';
30
+ import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
31
31
  var FormStyled = styled(Form)(function () { return ({
32
32
  display: 'flex',
33
33
  flexDirection: 'column'
@@ -79,12 +79,17 @@ var CivilID = function (_a) {
79
79
  dispatch(createCivilIdAuthAsync(deepCopy(data)));
80
80
  };
81
81
  var onBack = function () {
82
+ sendCustomEventToGTM({
83
+ event: 'Send Event',
84
+ event_category: 'User Registration Flow',
85
+ event_action: 'Switch to mobile number Login Clicked'
86
+ });
82
87
  dispatch(handlePrevScreenStep());
83
88
  };
84
89
  var onBackToCountryList = function () {
85
90
  dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
86
91
  };
87
- var disabled = !methods.formState.isValid;
92
+ var disabled = !methods.formState.isValid || !!error;
88
93
  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;
89
94
  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: 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') }))] }))] })) })) }));
90
95
  };
@@ -48,7 +48,7 @@ var CivilID = function (_a) {
48
48
  var onBack = function () {
49
49
  dispatch(handlePrevScreenStep());
50
50
  };
51
- var disabled = !methods.formState.isValid;
51
+ var disabled = !methods.formState.isValid || !!error;
52
52
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: 5, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') }))] })) })) }));
53
53
  };
54
54
  export default React.memo(CivilID);
@@ -15,7 +15,7 @@ import { useForm, FormProvider } from 'react-hook-form';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
18
- import { deepCopy, isKW, isSA } from '../../../../utils';
18
+ import { deepCopy, isKW, isSA, sendCustomEventToGTM } from '../../../../utils';
19
19
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
20
20
  import Form from '../../../../components/Form';
21
21
  import Collapse from '../../../../components/Collapse';
@@ -60,6 +60,13 @@ var CollectBusinessInfo = function (_a) {
60
60
  var originalReadOnly = useFormReadOnly(methods);
61
61
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
62
62
  var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
63
+ React.useEffect(function () {
64
+ sendCustomEventToGTM({
65
+ event: 'Send Event',
66
+ event_category: 'User Registration Flow',
67
+ event_action: 'Business License Details Step'
68
+ });
69
+ }, []);
63
70
  React.useEffect(function () {
64
71
  if (error)
65
72
  dispatch(clearError());
@@ -80,7 +87,7 @@ var CollectBusinessInfo = function (_a) {
80
87
  var onBack = function () {
81
88
  dispatch(handlePrevScreenStep());
82
89
  };
83
- var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName;
90
+ var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
84
91
  var disabled = brandErrChecks || brandNameChecking || isBrandNameAvailable == false;
85
92
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'], show: true, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(LicenseList, { readOnly: readOnly['selectedLicense'], onListOpen: function () {
86
93
  setListActive(true);
@@ -1,10 +1,32 @@
1
1
  import * as React from 'react';
2
- export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
2
+ export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
3
+ children?: React.ReactNode;
4
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
5
+ color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
6
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
7
+ htmlColor?: string | undefined;
8
+ inheritViewBox?: boolean | undefined;
9
+ shapeRendering?: string | undefined;
10
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
11
+ titleAccess?: string | undefined;
12
+ viewBox?: string | undefined;
13
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
3
14
  ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
4
- }, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
5
- export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
15
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
16
+ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
17
+ children?: React.ReactNode;
18
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
19
+ color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
20
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
21
+ htmlColor?: string | undefined;
22
+ inheritViewBox?: boolean | undefined;
23
+ shapeRendering?: string | undefined;
24
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
25
+ titleAccess?: string | undefined;
26
+ viewBox?: string | undefined;
27
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
6
28
  ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
7
- }, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
29
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
8
30
  type LicenseTypeProps = {
9
31
  show: boolean;
10
32
  readOnly?: boolean;
@@ -3,9 +3,14 @@ import { BoxProps } from '@mui/material/Box';
3
3
  interface TACContainerStyledProps extends BoxProps {
4
4
  readOnly?: boolean;
5
5
  }
6
- export declare const TACContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ export declare const TACContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
7
+ children?: React.ReactNode;
8
+ component?: React.ElementType<any> | undefined;
9
+ ref?: React.Ref<unknown> | undefined;
10
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
11
+ } & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
7
12
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
8
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & TACContainerStyledProps, {}, {}>;
13
+ }, ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & TACContainerStyledProps, {}, {}>;
9
14
  interface TACProps {
10
15
  show: boolean;
11
16
  readOnly?: boolean;
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
18
18
  import { useAppDispatch, useAppSelector, useExcludeReadOnlyFelids, useFormErrorAndUpdateReadOnly, useFormReadOnly, useSetFromDefaultValues } from '../../../../hooks';
19
19
  import { AuthForType } from '../../../../@types';
20
20
  import { useLanguage } from '../../../../hooks';
21
- import { deepCopy, isKW } from '../../../../utils';
21
+ import { deepCopy, isKW, sendCustomEventToGTM } from '../../../../utils';
22
22
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
23
23
  import Form from '../../../../components/Form';
24
24
  import Collapse from '../../../../components/Collapse';
@@ -59,6 +59,13 @@ var CollectIndividualInfo = function (_a) {
59
59
  var originalReadOnly = useFormReadOnly(methods);
60
60
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
61
61
  var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
62
+ React.useEffect(function () {
63
+ sendCustomEventToGTM({
64
+ event: 'Send Event',
65
+ event_category: 'User Registration Flow',
66
+ event_action: 'Name and Email Page Viewed'
67
+ });
68
+ }, []);
62
69
  React.useEffect(function () {
63
70
  if (countryCode.iso2 !== methods.getValues('countryCode.iso2'))
64
71
  methods.setValue('countryCode', countryCode);
@@ -89,7 +96,7 @@ var CollectIndividualInfo = function (_a) {
89
96
  }, [responseData]);
90
97
  var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
91
98
  var isEmailValid = typeof isEmailAvailable === 'undefined' ? isLeadEmailAvailable : isEmailAvailable;
92
- var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email;
99
+ var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
93
100
  var disabled = emailErrChecks || emailChecking || !isEmailValid;
94
101
  var emailReadOnly = readOnly['email'] && !((_b = methods.getFieldState('email').error) === null || _b === void 0 ? void 0 : _b.message) && !methods.getFieldState('email').isDirty;
95
102
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, { readOnly: readOnly['name'], show: !listActive }), _jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, onListOpen: function () { return handleMenuListClick(); }, onListClose: function () { return handleMenuListClick(); }, countries: settingsData.countries }), _jsx(Email, { readOnly: emailReadOnly, show: !listActive, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
@@ -53,7 +53,6 @@ import { useController, useFormContext } from 'react-hook-form';
53
53
  import axios from 'axios';
54
54
  import { styled } from '@mui/material/styles';
55
55
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
56
- import { removeAllOtherThanCharsNumbersAtAndDot } from '../../../../utils';
57
56
  import Collapse from '../../../../components/Collapse';
58
57
  import { ScreenContainer } from '../../../shared/Containers';
59
58
  import Input from '../../../shared/Input';
@@ -89,8 +88,7 @@ var Email = function (_a) {
89
88
  });
90
89
  }); }, 500);
91
90
  var handleEmailChange = function (event) {
92
- var value = removeAllOtherThanCharsNumbersAtAndDot(event.target.value);
93
- emailControl.field.onChange(value);
91
+ emailControl.field.onChange(event.target.value);
94
92
  };
95
93
  React.useEffect(function () {
96
94
  var isValid = emailValue && !error && emailValue.length > 3;
@@ -1,24 +1,34 @@
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
+ };
1
12
  import { jsx as _jsx } from "react/jsx-runtime";
2
13
  import * as React from 'react';
3
- import { isNetworkError, sleep } from '../../../../utils';
4
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { isNetworkError } from '../../../../utils';
16
+ import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
5
17
  import { connectExpressSelector, createAccountAsync } from '../../../app/connectExpress/connectExpressStore';
6
18
  import CreateAccountLoading from '../../../shared/CreateAccountLoading';
19
+ import Button from '../../../shared/Button';
7
20
  var CreateAccountLoader = function (_a) {
8
21
  var dispatch = useAppDispatch();
9
- var error = useAppSelector(connectExpressSelector).error;
10
- var _b = React.useState(0), isRetryCount = _b[0], setIsRetryCount = _b[1];
11
- var isNE = React.useMemo(function () { return isNetworkError(error); }, [error]);
22
+ var isAr = useLanguage().isAr;
23
+ var t = useTranslation().t;
24
+ var _b = useAppSelector(connectExpressSelector), error = _b.error, loading = _b.loading;
12
25
  React.useEffect(function () {
13
- dispatch(createAccountAsync({ isRetry: false }));
26
+ dispatch(createAccountAsync());
14
27
  }, []);
15
- React.useEffect(function () {
16
- if (isNE && isRetryCount <= 3) {
17
- sleep(2000);
18
- setIsRetryCount(isRetryCount + 1);
19
- dispatch(createAccountAsync({ isRetry: true }));
20
- }
21
- }, [isNE]);
22
- return _jsx(CreateAccountLoading, { error: isNE && isRetryCount <= 3 ? '' : error });
28
+ var onReTry = function () {
29
+ dispatch(createAccountAsync());
30
+ };
31
+ var isNE = React.useMemo(function () { return isNetworkError(error); }, [error]);
32
+ return (_jsx(CreateAccountLoading, __assign({ error: error }, { children: isNE && (_jsx(Button, __assign({ onClick: onReTry, disableBack: true, isAr: isAr, loading: loading }, { children: t('try_again') }))) })));
23
33
  };
24
34
  export default React.memo(CreateAccountLoader);
@@ -15,7 +15,7 @@ import { styled } from '@mui/material/styles';
15
15
  import * as React from 'react';
16
16
  import { useTranslation } from 'react-i18next';
17
17
  import Text from '../../../../components/Text';
18
- import { clearError, connectExpressSelector, verifyMobileOtpAsync, resetOTPValue, verifyNIDOtpLeadIdentityAsync } from '../../../app/connectExpress/connectExpressStore';
18
+ import { clearError, connectExpressSelector, resetOTPValue, verifyNIDOtpLeadIdentityAsync } from '../../../app/connectExpress/connectExpressStore';
19
19
  import Button from '../../../shared/Button';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
@@ -25,7 +25,7 @@ import { AuthForType } from '../../../../@types';
25
25
  import { useForm, FormProvider } from 'react-hook-form';
26
26
  import { yupResolver } from '@hookform/resolvers/yup';
27
27
  import Form from '../../../../components/Form';
28
- import { maskPhone, maskID, deepCopy } from '../../../../utils';
28
+ import { maskPhone, maskID, deepCopy, sendCustomEventToGTM } from '../../../../utils';
29
29
  import { OTPValidation } from './validation';
30
30
  import OTPInput from './OTPInput';
31
31
  var OTPTitleContainerStyled = styled(Box)(function (_a) {
@@ -64,16 +64,17 @@ var OTP = function () {
64
64
  dispatch(clearError());
65
65
  }, [methods.formState.isValid]);
66
66
  React.useEffect(function () {
67
+ sendCustomEventToGTM({
68
+ event: 'Send Event',
69
+ event_category: 'User Registration Flow',
70
+ event_action: 'Absher OTP Page Viewed'
71
+ });
67
72
  return function () {
68
73
  dispatch(resetOTPValue());
69
74
  };
70
75
  }, []);
71
76
  var onSubmit = function (formData) {
72
- if (isNidAuth) {
73
- dispatch(verifyNIDOtpLeadIdentityAsync(deepCopy(formData)));
74
- return;
75
- }
76
- dispatch(verifyMobileOtpAsync(deepCopy(formData)));
77
+ dispatch(verifyNIDOtpLeadIdentityAsync(deepCopy(formData)));
77
78
  };
78
79
  var onBack = function () {
79
80
  dispatch(handlePrevScreenStep());
@@ -17,9 +17,9 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { AuthForType } from '../../../../@types';
21
20
  import { resendNIDAuthIdentityOTP, connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
22
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
+ import { sendCustomEventToGTM } from '../../../../utils';
23
23
  var BoxStyled = styled(Box)(function (_a) {
24
24
  var theme = _a.theme;
25
25
  return ({
@@ -35,20 +35,22 @@ var OTPInput = function (_a) {
35
35
  var otpControl = useController({ name: 'otp', control: control });
36
36
  var _c = useAppSelector(connectExpressSelector), data = _c.data, error = _c.error;
37
37
  var nidData = data.nidData;
38
- var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID_MISSED;
39
38
  var handleOnOTPChange = function (otp) {
40
39
  if (error)
41
40
  dispatch(clearError());
42
41
  otpControl.field.onChange(otp);
43
42
  };
44
- var handleOnResendOTP = function () {
45
- };
46
43
  var handleOnResendAbsherOTP = function () {
47
44
  if (otpControl.field.value)
48
45
  setValue('otp', '', { shouldValidate: true });
46
+ sendCustomEventToGTM({
47
+ event: 'Send Event',
48
+ event_category: 'User Registration Flow',
49
+ event_action: 'Another Absher OTP asked'
50
+ });
49
51
  dispatch(resendNIDAuthIdentityOTP(nidData));
50
52
  };
51
53
  var otpValue = otpControl.field.value;
52
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: isNidAuth ? handleOnResendAbsherOTP : handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
54
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendAbsherOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
53
55
  };
54
56
  export default React.memo(OTPInput);
@@ -30,7 +30,7 @@ import MobileNumber from './MobileNumber';
30
30
  import { PhoneValidationSchema } from './validation';
31
31
  import { ICONS_NAMES } from '../../../../constants';
32
32
  import TAC from './TAC';
33
- import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
33
+ import { deepCopy } from '../../../../utils';
34
34
  var FormStyled = styled(Form)(function () { return ({
35
35
  display: 'flex',
36
36
  flexDirection: 'column'
@@ -96,13 +96,6 @@ var Mobile = function (_a) {
96
96
  };
97
97
  var onBack = function () {
98
98
  var screen = isKuwait ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP';
99
- var eventAction = isKuwait ? 'PACI Click' : 'Abser Click';
100
- sendCustomEventToGTM({
101
- event: 'Send Event',
102
- event_category: 'User Registration Flow',
103
- event_action: eventAction,
104
- event_label: settingData.businessCountry.iso2
105
- });
106
99
  dispatch(handlePrevScreenStep(screen));
107
100
  };
108
101
  var onBackToCountryList = function () {
@@ -116,7 +109,7 @@ var Mobile = function (_a) {
116
109
  };
117
110
  var originalReadOnly = useFormReadOnly(methods);
118
111
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
119
- var disabled = !methods.formState.isValid;
112
+ var disabled = !methods.formState.isValid || !!error;
120
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') })))] }))] }))] })) })) }));
121
114
  };
122
115
  export default React.memo(Mobile);
@@ -29,7 +29,7 @@ import Text from '../../../../components/Text';
29
29
  import IDNumber from './IDNumber';
30
30
  import DOB from './DOB';
31
31
  import TAC from './TAC';
32
- import { deepCopy } from '../../../../utils';
32
+ import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
33
33
  var FormStyled = styled(Form)(function () { return ({
34
34
  display: 'flex',
35
35
  flexDirection: 'column'
@@ -84,6 +84,11 @@ var NID = function (_a) {
84
84
  setCollapse(flag);
85
85
  };
86
86
  var onBack = function () {
87
+ sendCustomEventToGTM({
88
+ event: 'Send Event',
89
+ event_category: 'User Registration Flow',
90
+ event_action: 'Switch to mobile number Login Clicked'
91
+ });
87
92
  dispatch(handlePrevScreenStep());
88
93
  };
89
94
  var onBackToCountryList = function () {
@@ -91,7 +96,7 @@ var NID = function (_a) {
91
96
  };
92
97
  var originalReadOnly = useFormReadOnly(methods);
93
98
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
94
- var disabled = !methods.formState.isValid;
99
+ var disabled = !methods.formState.isValid || !!error;
95
100
  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;
96
101
  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') }))] }))] }))] })) })) }));
97
102
  };
@@ -3,9 +3,14 @@ import { BoxProps } from '@mui/material/Box';
3
3
  interface TACContainerStyledProps extends BoxProps {
4
4
  readOnly?: boolean;
5
5
  }
6
- export declare const TACContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ export declare const TACContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
7
+ children?: React.ReactNode;
8
+ component?: React.ElementType<any> | undefined;
9
+ ref?: React.Ref<unknown> | undefined;
10
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
11
+ } & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
7
12
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
8
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & TACContainerStyledProps, {}, {}>;
13
+ }, ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & TACContainerStyledProps, {}, {}>;
9
14
  interface TACProps {
10
15
  show: boolean;
11
16
  readOnly?: boolean;
@@ -56,7 +56,7 @@ var NID = function (_a) {
56
56
  var onBack = function () {
57
57
  dispatch(handlePrevScreenStep());
58
58
  };
59
- var disabled = !methods.formState.isValid;
59
+ var disabled = !methods.formState.isValid || !!error;
60
60
  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 }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
61
61
  };
62
62
  export default React.memo(NID);