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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/build/@types/app.d.ts +1 -0
  2. package/build/@types/form.d.ts +1 -0
  3. package/build/@types/redux.d.ts +1 -0
  4. package/build/api/entity.d.ts +2 -2
  5. package/build/api/entity.js +12 -4
  6. package/build/api/index.d.ts +2 -2
  7. package/build/components/Tooltip/Tooltip.js +1 -1
  8. package/build/constants/api.d.ts +0 -1
  9. package/build/constants/api.js +0 -2
  10. package/build/constants/app.d.ts +0 -1
  11. package/build/constants/app.js +0 -1
  12. package/build/features/app/bank/bankStore.d.ts +13 -18
  13. package/build/features/app/bank/bankStore.js +184 -165
  14. package/build/features/app/board/boardStore.js +52 -30
  15. package/build/features/app/brand/brandStore.d.ts +16 -33
  16. package/build/features/app/brand/brandStore.js +239 -242
  17. package/build/features/app/business/businessStore.d.ts +0 -5
  18. package/build/features/app/business/businessStore.js +76 -87
  19. package/build/features/app/connectExpress/connectExpressStore.d.ts +15 -6
  20. package/build/features/app/connectExpress/connectExpressStore.js +111 -52
  21. package/build/features/app/entity/entityStore.d.ts +20 -36
  22. package/build/features/app/entity/entityStore.js +196 -246
  23. package/build/features/app/individual/individualStore.d.ts +22 -38
  24. package/build/features/app/individual/individualStore.js +263 -266
  25. package/build/features/app/password/passwordStore.d.ts +40 -23
  26. package/build/features/app/password/passwordStore.js +226 -233
  27. package/build/features/app/tax/taxStore.d.ts +13 -7
  28. package/build/features/app/tax/taxStore.js +168 -147
  29. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +13 -1
  30. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +4 -26
  31. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +7 -1
  32. package/build/features/bank/Bank.d.ts +1 -0
  33. package/build/features/bank/Bank.js +7 -4
  34. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  35. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
  36. package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
  37. package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
  38. package/build/features/bank/screens/OperatorError/index.js +2 -0
  39. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  40. package/build/features/bank/screens/Verify/Verify.js +5 -5
  41. package/build/features/board/Board.js +8 -4
  42. package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
  43. package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
  44. package/build/features/board/screens/OperatorError/index.d.ts +3 -0
  45. package/build/features/board/screens/OperatorError/index.js +2 -0
  46. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -4
  47. package/build/features/brand/Brand.d.ts +1 -0
  48. package/build/features/brand/Brand.js +7 -4
  49. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +8 -35
  50. package/build/features/brand/screens/BrandActivities/BrandActivities.js +49 -12
  51. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +3 -3
  52. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
  53. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +5 -18
  54. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  55. package/build/features/brand/screens/BrandActivities/TAC.d.ts +2 -7
  56. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  57. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  58. package/build/features/brand/screens/BrandInfo/BrandInfo.js +23 -5
  59. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +23 -7
  60. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
  61. package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
  62. package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
  63. package/build/features/brand/screens/OperatorError/index.js +2 -0
  64. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  65. package/build/features/brand/screens/Verify/Verify.js +1 -1
  66. package/build/features/business/Business.js +9 -4
  67. package/build/features/business/screens/Activities/Activities.js +12 -3
  68. package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
  69. package/build/features/business/screens/Activities/OperationStartDate.d.ts +1 -1
  70. package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +1 -1
  71. package/build/features/business/screens/BusinessType/BusinessType.js +10 -2
  72. package/build/features/business/screens/BusinessType/LicenseType.d.ts +4 -26
  73. package/build/features/business/screens/CivilID/CivilID.js +1 -1
  74. package/build/features/business/screens/Customers/CustomerLocations.d.ts +9 -36
  75. package/build/features/business/screens/Customers/Customers.js +12 -3
  76. package/build/features/business/screens/Customers/ExpectedSalesRange.js +6 -3
  77. package/build/features/business/screens/Customers/RefundPolicy.d.ts +5 -18
  78. package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
  79. package/build/features/business/screens/OTP/OTP.js +1 -1
  80. package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
  81. package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
  82. package/build/features/business/screens/OperatorError/index.d.ts +3 -0
  83. package/build/features/business/screens/OperatorError/index.js +2 -0
  84. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -2
  85. package/build/features/business/screens/Verify/Verify.js +13 -3
  86. package/build/features/connect/Connect.js +3 -2
  87. package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
  88. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +9 -2
  89. package/build/features/connect/screens/CivilID/CivilID.js +1 -1
  90. package/build/features/connect/screens/Individual/Email.js +3 -1
  91. package/build/features/connect/screens/Individual/Individual.js +1 -1
  92. package/build/features/connect/screens/Merchant/BrandList.js +3 -3
  93. package/build/features/connect/screens/Merchant/Merchant.js +1 -1
  94. package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
  95. package/build/features/connect/screens/Mobile/Mobile.js +11 -8
  96. package/build/features/connect/screens/NID/NID.js +1 -1
  97. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  98. package/build/features/connectExpress/ConnectExpress.js +2 -1
  99. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +5 -2
  100. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +9 -0
  101. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +90 -0
  102. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +6 -1
  103. package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +3 -0
  104. package/build/features/connectExpress/screens/AuthenticationList/validation.js +10 -0
  105. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
  106. package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
  107. package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
  108. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
  109. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +4 -26
  110. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +2 -7
  111. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
  112. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -1
  113. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
  114. package/build/features/connectExpress/screens/Mobile/Mobile.js +9 -2
  115. package/build/features/connectExpress/screens/NID/NID.js +1 -1
  116. package/build/features/connectExpress/screens/NID/TAC.d.ts +2 -7
  117. package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
  118. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
  119. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
  120. package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
  121. package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
  122. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
  123. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
  124. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
  125. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
  126. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  127. package/build/features/entity/Entity.d.ts +1 -0
  128. package/build/features/entity/Entity.js +7 -4
  129. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -2
  130. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
  131. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
  132. package/build/features/entity/screens/EntityCapital/EntityCapital.js +34 -10
  133. package/build/features/entity/screens/EntityName/EntityName.js +32 -15
  134. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +8 -35
  135. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +1 -1
  136. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +1 -1
  137. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
  138. package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
  139. package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
  140. package/build/features/entity/screens/OperatorError/index.js +2 -0
  141. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  142. package/build/features/entity/screens/Verify/Verify.js +1 -1
  143. package/build/features/featuresScreens.js +67 -7
  144. package/build/features/individual/Individual.d.ts +1 -0
  145. package/build/features/individual/Individual.js +7 -4
  146. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +1 -1
  147. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -14
  148. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +14 -0
  149. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +76 -0
  150. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
  151. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +4 -26
  152. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
  153. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +4 -1
  154. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +3 -2
  155. package/build/features/individual/screens/IndividualList/Email.js +3 -2
  156. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +2 -2
  157. package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
  158. package/build/features/individual/screens/IndividualList/UserList.js +13 -9
  159. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +4 -2
  160. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +4 -26
  161. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +1 -1
  162. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +76 -20
  163. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  164. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
  165. package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
  166. package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
  167. package/build/features/individual/screens/OperatorError/index.js +2 -0
  168. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  169. package/build/features/individual/screens/Verify/Verify.js +1 -1
  170. package/build/features/password/Password.d.ts +1 -0
  171. package/build/features/password/Password.js +75 -28
  172. package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
  173. package/build/features/password/screens/OTP/OTP.js +1 -1
  174. package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
  175. package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
  176. package/build/features/password/screens/OperatorError/index.d.ts +3 -0
  177. package/build/features/password/screens/OperatorError/index.js +2 -0
  178. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  179. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  180. package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
  181. package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
  182. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  183. package/build/features/password/screens/Verify/Verify.js +5 -5
  184. package/build/features/shared/Address/CountryList.d.ts +7 -23
  185. package/build/features/shared/Address/InputSelect.d.ts +7 -23
  186. package/build/features/shared/Button/FlowsButtons.js +13 -3
  187. package/build/features/shared/Containers/FeatureContainer.d.ts +1 -0
  188. package/build/features/shared/Containers/FeatureContainer.js +3 -3
  189. package/build/features/shared/Input/Input.d.ts +2 -2
  190. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +5 -1
  191. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
  192. package/build/features/shared/UploadFile/FileUpload.d.ts +2 -7
  193. package/build/features/shared/UploadFile/UploadFile.d.ts +2 -7
  194. package/build/features/shared/UploadFile/UploadWrapper.d.ts +2 -7
  195. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -7
  196. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -7
  197. package/build/features/signIn/SignIn.js +12 -3
  198. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
  199. package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
  200. package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
  201. package/build/features/signIn/screens/OperatorError/index.js +2 -0
  202. package/build/features/tax/Tax.d.ts +1 -0
  203. package/build/features/tax/Tax.js +7 -4
  204. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
  205. package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
  206. package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
  207. package/build/features/tax/screens/OperatorError/index.js +2 -0
  208. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  209. package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
  210. package/build/features/tax/screens/Verify/Verify.js +5 -5
  211. package/build/hooks/index.d.ts +1 -0
  212. package/build/hooks/index.js +1 -0
  213. package/build/hooks/useFormDirtyCheck.d.ts +10 -0
  214. package/build/hooks/useFormDirtyCheck.js +66 -0
  215. package/build/hooks/useVerifyToken.d.ts +5 -2
  216. package/build/hooks/useVerifyToken.js +10 -5
  217. package/build/utils/common.js +3 -3
  218. package/build/utils/locale.js +2 -1
  219. package/build/utils/string.d.ts +5 -2
  220. package/build/utils/string.js +34 -5
  221. package/package.json +2 -2
@@ -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 || !!error;
104
+ var disabled = !methods.formState.isValid;
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 '../../../../features/shared/GenericError';
4
+ import GenericError from '../../../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') });
@@ -100,7 +100,8 @@ var ConnectExpress = memo(function (_a) {
100
100
  React.useEffect(function () {
101
101
  initializeGTM();
102
102
  sendPageView({
103
- title: 'Connect Express'
103
+ title: 'Connect Express',
104
+ connect_flow: 'Express'
104
105
  });
105
106
  }, []);
106
107
  React.useEffect(function () {
@@ -29,6 +29,7 @@ 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';
32
33
  var ListType;
33
34
  (function (ListType) {
34
35
  ListType["BrandList"] = "BrandList";
@@ -64,7 +65,8 @@ var AuthenticationList = function (_a) {
64
65
  var dispatch = useAppDispatch();
65
66
  var onSubmit = function (formData) {
66
67
  if (isAddEntity) {
67
- var data_1 = { licenseNumber: formData.licenseNumber, legalName: formData.legalName, brandInfo: formData.brandInfo };
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 };
68
70
  dispatch(createEntity(deepCopy(data_1)));
69
71
  return;
70
72
  }
@@ -76,6 +78,7 @@ var AuthenticationList = function (_a) {
76
78
  setIsAddEntity(false);
77
79
  methods.setValue('licenseNumber', '');
78
80
  methods.setValue('legalName', '');
81
+ methods.setValue('licenseType', '');
79
82
  methods.setValue('entityInfo', undefined, { shouldValidate: true });
80
83
  return;
81
84
  }
@@ -96,6 +99,6 @@ var AuthenticationList = function (_a) {
96
99
  };
97
100
  var isBrandList = listActive === ListType.BrandList;
98
101
  var isEntityList = listActive === ListType.EntityList;
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') })) }))] })) })) }));
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') })) }))] })) })) }));
100
103
  };
101
104
  export default React.memo(AuthenticationList);
@@ -0,0 +1,9 @@
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"> & {
3
+ 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"> & {
6
+ 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>, {}, {}>;
8
+ declare const Type: () => import("react/jsx-runtime").JSX.Element;
9
+ export default Type;
@@ -0,0 +1,90 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { styled, alpha } from '@mui/material/styles';
15
+ import InfoIcon from '@mui/icons-material/Info';
16
+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
17
+ import { useTranslation } from 'react-i18next';
18
+ import { useController, useFormContext } from 'react-hook-form';
19
+ import Text from '../../../../components/Text';
20
+ import { ScreenContainer } from '../../../shared/Containers';
21
+ import Mandatory from '../../../shared/Mandatory';
22
+ import RadioLabel from '../../../../components/RadioLabel';
23
+ import { LicenseType } from '../../../../@types';
24
+ import RadioGroup from '../../../../components/RadioGroup';
25
+ import Tooltip from '../../../../components/Tooltip';
26
+ import Radio from '../../../../components/Radio';
27
+ import { clearError, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
28
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
29
+ var LabelTextStyled = styled(Text)(function (_a) {
30
+ var theme = _a.theme;
31
+ return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
32
+ });
33
+ var RadioGroupStyled = styled(RadioGroup)(function (_a) {
34
+ var theme = _a.theme;
35
+ return ({
36
+ marginInlineStart: theme.spacing(0.25)
37
+ });
38
+ });
39
+ var RadioStyled = styled(Radio)(function (_a) {
40
+ var theme = _a.theme;
41
+ return ({
42
+ '& .MuiSvgIcon-root': {
43
+ fontSize: theme.spacing(2.25),
44
+ width: theme.spacing(2.25),
45
+ height: theme.spacing(2.25)
46
+ }
47
+ });
48
+ });
49
+ var LabelStyled = styled('span')(function () { return ({
50
+ display: 'inline-flex',
51
+ alignItems: 'center'
52
+ }); });
53
+ export var InfoIconStyled = styled(InfoIcon)(function (_a) {
54
+ var theme = _a.theme;
55
+ return ({
56
+ width: theme.spacing(2.75),
57
+ height: theme.spacing(2.125),
58
+ cursor: 'pointer',
59
+ color: alpha(theme.palette.text.primary, 0.4),
60
+ display: 'inline-flex'
61
+ });
62
+ });
63
+ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
64
+ var theme = _a.theme;
65
+ return ({
66
+ width: theme.spacing(2.75),
67
+ height: theme.spacing(2.125),
68
+ cursor: 'pointer',
69
+ color: alpha(theme.palette.text.primary, 0.4),
70
+ display: 'inline-flex'
71
+ });
72
+ });
73
+ var Type = function () {
74
+ var t = useTranslation().t;
75
+ var control = useFormContext().control;
76
+ var error = useAppSelector(connectExpressSelector).error;
77
+ var _a = React.useState(false), isCRHovered = _a[0], setIsCRHovered = _a[1];
78
+ var _b = React.useState(false), isFLHovered = _b[0], setIsFLHovered = _b[1];
79
+ var typeControl = useController({ control: control, name: 'licenseType' });
80
+ var dispatch = useAppDispatch();
81
+ var handleOnChange = function (_a) {
82
+ var target = _a.target;
83
+ if (error)
84
+ dispatch(clearError());
85
+ typeControl.field.onChange(target.value);
86
+ };
87
+ var typeValue = typeControl.field.value;
88
+ return (_jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })));
89
+ };
90
+ export default Type;
@@ -81,6 +81,7 @@ var EntityList = function (_a) {
81
81
  if (filteredEntityList.length) {
82
82
  setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
83
83
  setValue('licenseNumber', '');
84
+ setValue('licenseType', '');
84
85
  setValue('legalName', '');
85
86
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
86
87
  }
@@ -121,8 +122,12 @@ var EntityList = function (_a) {
121
122
  selectedEntityControl.field.onChange(entity);
122
123
  if (entity.id === ADD_ENTITY)
123
124
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
124
- else
125
+ else {
126
+ setValue('licenseNumber', '');
127
+ setValue('legalName', '');
128
+ setValue('licenseType', '');
125
129
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
130
+ }
126
131
  onCloseEntityList();
127
132
  };
128
133
  var selectedEntity = selectedEntityControl.field.value;
@@ -3,15 +3,18 @@ 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>;
6
7
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
8
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
8
9
  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>>;
9
10
  entityInfo: any;
10
11
  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>;
11
13
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
12
14
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
15
  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>>;
14
16
  entityInfo: any;
15
17
  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>;
16
19
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
17
20
  }>>>;
@@ -34,6 +34,16 @@ 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(''),
37
47
  legalName: yup
38
48
  .string()
39
49
  .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 } from '../../../../utils';
56
+ import { findCountryByIso2, isKW, isOtherThanKWOrSA, sendCustomEventToGTM } 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,6 +81,12 @@ 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
+ });
84
90
  if (!data.leadId) return [3, 2];
85
91
  return [4, dispatch(updateBusinessCountryAsync(iso2))];
86
92
  case 1:
@@ -89,7 +89,7 @@ var CivilID = function (_a) {
89
89
  var onBackToCountryList = function () {
90
90
  dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
91
91
  };
92
- var disabled = !methods.formState.isValid || !!error;
92
+ var disabled = !methods.formState.isValid;
93
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;
94
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') }))] }))] })) })) }));
95
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 || !!error;
51
+ var disabled = !methods.formState.isValid;
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);
@@ -87,7 +87,7 @@ var CollectBusinessInfo = function (_a) {
87
87
  var onBack = function () {
88
88
  dispatch(handlePrevScreenStep());
89
89
  };
90
- var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
90
+ var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName;
91
91
  var disabled = brandErrChecks || brandNameChecking || isBrandNameAvailable == false;
92
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 () {
93
93
  setListActive(true);
@@ -1,32 +1,10 @@
1
1
  import * as React from 'react';
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"> & {
2
+ export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref"> & {
14
3
  ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
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"> & {
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"> & {
28
6
  ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
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>, {}, {}>;
7
+ }, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
30
8
  type LicenseTypeProps = {
31
9
  show: boolean;
32
10
  readOnly?: boolean;
@@ -3,14 +3,9 @@ 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").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"> & {
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"> & {
12
7
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
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, {}, {}>;
8
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & TACContainerStyledProps, {}, {}>;
14
9
  interface TACProps {
15
10
  show: boolean;
16
11
  readOnly?: boolean;
@@ -96,7 +96,7 @@ var CollectIndividualInfo = function (_a) {
96
96
  }, [responseData]);
97
97
  var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
98
98
  var isEmailValid = typeof isEmailAvailable === 'undefined' ? isLeadEmailAvailable : isEmailAvailable;
99
- var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
99
+ var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email;
100
100
  var disabled = emailErrChecks || emailChecking || !isEmailValid;
101
101
  var emailReadOnly = readOnly['email'] && !((_b = methods.getFieldState('email').error) === null || _b === void 0 ? void 0 : _b.message) && !methods.getFieldState('email').isDirty;
102
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,6 +53,7 @@ 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';
56
57
  import Collapse from '../../../../components/Collapse';
57
58
  import { ScreenContainer } from '../../../shared/Containers';
58
59
  import Input from '../../../shared/Input';
@@ -88,7 +89,8 @@ var Email = function (_a) {
88
89
  });
89
90
  }); }, 500);
90
91
  var handleEmailChange = function (event) {
91
- emailControl.field.onChange(event.target.value);
92
+ var value = removeAllOtherThanCharsNumbersAtAndDot(event.target.value);
93
+ emailControl.field.onChange(value);
92
94
  };
93
95
  React.useEffect(function () {
94
96
  var isValid = emailValue && !error && emailValue.length > 3;
@@ -1,34 +1,24 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import * as React from 'react';
14
- import { useTranslation } from 'react-i18next';
15
- import { isNetworkError } from '../../../../utils';
16
- import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
3
+ import { isNetworkError, sleep } from '../../../../utils';
4
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
17
5
  import { connectExpressSelector, createAccountAsync } from '../../../app/connectExpress/connectExpressStore';
18
6
  import CreateAccountLoading from '../../../shared/CreateAccountLoading';
19
- import Button from '../../../shared/Button';
20
7
  var CreateAccountLoader = function (_a) {
21
8
  var dispatch = useAppDispatch();
22
- var isAr = useLanguage().isAr;
23
- var t = useTranslation().t;
24
- var _b = useAppSelector(connectExpressSelector), error = _b.error, loading = _b.loading;
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]);
25
12
  React.useEffect(function () {
26
- dispatch(createAccountAsync());
13
+ dispatch(createAccountAsync({ isRetry: false }));
27
14
  }, []);
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') }))) })));
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 });
33
23
  };
34
24
  export default React.memo(CreateAccountLoader);
@@ -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 } from '../../../../utils';
33
+ import { deepCopy, sendCustomEventToGTM } from '../../../../utils';
34
34
  var FormStyled = styled(Form)(function () { return ({
35
35
  display: 'flex',
36
36
  flexDirection: 'column'
@@ -96,6 +96,13 @@ 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
+ });
99
106
  dispatch(handlePrevScreenStep(screen));
100
107
  };
101
108
  var onBackToCountryList = function () {
@@ -109,7 +116,7 @@ var Mobile = function (_a) {
109
116
  };
110
117
  var originalReadOnly = useFormReadOnly(methods);
111
118
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
112
- var disabled = !methods.formState.isValid || !!error;
119
+ var disabled = !methods.formState.isValid;
113
120
  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') })))] }))] }))] })) })) }));
114
121
  };
115
122
  export default React.memo(Mobile);
@@ -96,7 +96,7 @@ var NID = function (_a) {
96
96
  };
97
97
  var originalReadOnly = useFormReadOnly(methods);
98
98
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
99
- var disabled = !methods.formState.isValid || !!error;
99
+ var disabled = !methods.formState.isValid;
100
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;
101
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') }))] }))] }))] })) })) }));
102
102
  };
@@ -3,14 +3,9 @@ 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").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"> & {
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"> & {
12
7
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
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, {}, {}>;
8
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & TACContainerStyledProps, {}, {}>;
14
9
  interface TACProps {
15
10
  show: boolean;
16
11
  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 || !!error;
59
+ var disabled = !methods.formState.isValid;
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);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface OperatorErrorProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: OperatorErrorProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import GenericError from '../../../shared/GenericError';
5
+ var OperatorError = function (_a) {
6
+ var t = useTranslation().t;
7
+ return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
8
+ };
9
+ export default React.memo(OperatorError);
@@ -0,0 +1,3 @@
1
+ import OperatorError, { OperatorErrorProps } from './OperatorError';
2
+ export type { OperatorErrorProps };
3
+ export default OperatorError;
@@ -0,0 +1,2 @@
1
+ import OperatorError from './OperatorError';
2
+ export default OperatorError;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface PrepareDataLoadingProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: PrepareDataLoadingProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export default _default;
@@ -0,0 +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
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { isNetworkError } from '../../../../utils';
16
+ import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
17
+ import DataLoading from '../../../shared/DataLoading';
18
+ import Button from '../../../shared/Button';
19
+ import { connectExpressSelector, retrieveDetailsAfterCreateAccountAsync } from '../../../app/connectExpress/connectExpressStore';
20
+ var PrepareDataLoading = function (_a) {
21
+ var dispatch = useAppDispatch();
22
+ var isAr = useLanguage().isAr;
23
+ var t = useTranslation().t;
24
+ var _b = useAppSelector(connectExpressSelector), error = _b.error, loading = _b.loading;
25
+ React.useEffect(function () {
26
+ dispatch(retrieveDetailsAfterCreateAccountAsync());
27
+ }, []);
28
+ var onReTry = function () {
29
+ dispatch(retrieveDetailsAfterCreateAccountAsync());
30
+ };
31
+ var isNE = React.useMemo(function () { return isNetworkError(error); }, [error]);
32
+ return (_jsx(DataLoading, __assign({ error: error }, { children: isNE && (_jsx(Button, __assign({ onClick: onReTry, disableBack: true, isAr: isAr, loading: loading }, { children: t('try_again') }))) })));
33
+ };
34
+ export default React.memo(PrepareDataLoading);
@@ -0,0 +1,2 @@
1
+ import PrepareDataLoading from './PrepareDataLoading';
2
+ export default PrepareDataLoading;
@@ -0,0 +1,2 @@
1
+ import PrepareDataLoading from './PrepareDataLoading';
2
+ export default PrepareDataLoading;
@@ -36,6 +36,6 @@ var SuccessWithFlowButtons = function () {
36
36
  var name = _a.name;
37
37
  return name !== FlowsTypes.PASSWORD;
38
38
  }); }, [flows]);
39
- return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, loading: loading, boardId: boardId, boardInfoId: boardInfoId, brand: brand, business: business, entity: entity, flows: filteredFlows || [], merchant: merchant, individuals: individualsInfo, user: __assign({ names: { en: name } }, user), onClose: isScopeAuthentication ? onClose : undefined, status: status }));
39
+ return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, loading: loading, boardId: boardId, boardInfoId: boardInfoId, brand: brand, business: business, entity: entity, flows: filteredFlows || [], merchant: merchant, individuals: individualsInfo, user: __assign({ names: { en: name } }, user), onClose: isScopeAuthentication ? onClose : undefined, recipient: recipient, status: status }));
40
40
  };
41
41
  export default memo(SuccessWithFlowButtons);