@tap-payments/auth-jsconnect 2.7.11-test → 2.7.11

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 (566) hide show
  1. package/build/@types/app.d.ts +47 -4
  2. package/build/@types/app.js +22 -0
  3. package/build/@types/config.d.ts +4 -0
  4. package/build/@types/form.d.ts +11 -1
  5. package/build/@types/redux.d.ts +1 -0
  6. package/build/api/account.d.ts +4 -1
  7. package/build/api/account.js +15 -1
  8. package/build/api/auth.d.ts +35 -20
  9. package/build/api/auth.js +1 -1
  10. package/build/api/axios.js +1 -2
  11. package/build/api/data.d.ts +4 -17
  12. package/build/api/data.js +5 -45
  13. package/build/api/entity.d.ts +3 -2
  14. package/build/api/entity.js +12 -4
  15. package/build/api/firebase.js +68 -8
  16. package/build/api/index.d.ts +14 -25
  17. package/build/api/lead.d.ts +16 -3
  18. package/build/api/lead.js +16 -0
  19. package/build/api/user.d.ts +7 -0
  20. package/build/api/user.js +9 -1
  21. package/build/app/rootReducer.d.ts +1 -0
  22. package/build/app/rootReducer.js +3 -1
  23. package/build/app/settings.d.ts +1 -0
  24. package/build/app/settings.js +16 -11
  25. package/build/app/store.d.ts +2 -0
  26. package/build/assets/currencies/SARSymbol.d.ts +7 -0
  27. package/build/assets/currencies/SARSymbol.js +28 -0
  28. package/build/assets/currencies/index.d.ts +2 -0
  29. package/build/assets/currencies/index.js +2 -0
  30. package/build/assets/currencies/utils.d.ts +4 -0
  31. package/build/assets/currencies/utils.js +4 -0
  32. package/build/assets/locales/ar.json +358 -151
  33. package/build/assets/locales/en.json +354 -150
  34. package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -5
  35. package/build/components/AnimationFlow/AnimationFlow.js +5 -5
  36. package/build/components/AnimationFlow/BottomSheet.d.ts +3 -1
  37. package/build/components/AnimationFlow/BottomSheet.js +42 -14
  38. package/build/components/AnimationFlow/Dialog.d.ts +4 -3
  39. package/build/components/AnimationFlow/Dialog.js +5 -3
  40. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
  41. package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
  42. package/build/components/ArabicDatePicker/style.css +32 -3
  43. package/build/components/DatePicker/DatePicker.d.ts +1 -1
  44. package/build/components/DatePicker/DatePicker.js +2 -2
  45. package/build/components/Footer/Footer.js +2 -1
  46. package/build/components/Input/Input.js +1 -1
  47. package/build/components/Providers/ThemeProvider.js +3 -3
  48. package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
  49. package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
  50. package/build/components/TextWithCurrency/index.d.ts +2 -0
  51. package/build/components/TextWithCurrency/index.js +2 -0
  52. package/build/components/Tooltip/Tooltip.js +1 -1
  53. package/build/constants/api.d.ts +5 -7
  54. package/build/constants/api.js +11 -15
  55. package/build/constants/app.d.ts +41 -0
  56. package/build/constants/app.js +369 -36
  57. package/build/constants/assets.d.ts +7 -0
  58. package/build/constants/assets.js +11 -1
  59. package/build/constants/dummy.d.ts +4 -219
  60. package/build/constants/dummy.js +64 -6194
  61. package/build/constants/flows.d.ts +26 -0
  62. package/build/constants/flows.js +27 -0
  63. package/build/constants/index.d.ts +1 -0
  64. package/build/constants/index.js +1 -0
  65. package/build/constants/validation.d.ts +2 -0
  66. package/build/constants/validation.js +2 -0
  67. package/build/features/app/auth/authStore.d.ts +29 -8
  68. package/build/features/app/auth/authStore.js +495 -149
  69. package/build/features/app/bank/bankStore.d.ts +13 -18
  70. package/build/features/app/bank/bankStore.js +186 -153
  71. package/build/features/app/board/boardStore.d.ts +5 -1
  72. package/build/features/app/board/boardStore.js +82 -51
  73. package/build/features/app/brand/brandStore.d.ts +17 -33
  74. package/build/features/app/brand/brandStore.js +254 -257
  75. package/build/features/app/business/businessStore.d.ts +37 -15
  76. package/build/features/app/business/businessStore.js +443 -235
  77. package/build/features/app/connect/connectStore.d.ts +33 -5
  78. package/build/features/app/connect/connectStore.js +355 -120
  79. package/build/features/app/connectExpress/connectExpressStore.d.ts +64 -27
  80. package/build/features/app/connectExpress/connectExpressStore.js +826 -394
  81. package/build/features/app/entity/entityStore.d.ts +20 -36
  82. package/build/features/app/entity/entityStore.js +204 -238
  83. package/build/features/app/individual/individualStore.d.ts +18 -34
  84. package/build/features/app/individual/individualStore.js +269 -292
  85. package/build/features/app/kyc/kycStore.d.ts +67 -0
  86. package/build/features/app/kyc/kycStore.js +432 -0
  87. package/build/features/app/password/passwordStore.d.ts +33 -18
  88. package/build/features/app/password/passwordStore.js +260 -219
  89. package/build/features/app/signIn/signInStore.js +19 -15
  90. package/build/features/app/tax/taxStore.d.ts +13 -7
  91. package/build/features/app/tax/taxStore.js +170 -136
  92. package/build/features/auth/Auth.d.ts +5 -6
  93. package/build/features/auth/Auth.js +40 -15
  94. package/build/features/auth/screens/AccountNotFound/AccountNotFound.js +2 -5
  95. package/build/features/auth/screens/AuthSwitch/AuthSwitch.d.ts +5 -0
  96. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +58 -0
  97. package/build/features/auth/screens/AuthSwitch/index.d.ts +3 -0
  98. package/build/features/auth/screens/AuthSwitch/index.js +2 -0
  99. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +2 -8
  100. package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
  101. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +8 -2
  102. package/build/features/auth/screens/CivilID/CivilID.js +4 -35
  103. package/build/features/auth/screens/{NID → DOB}/DOB.js +3 -3
  104. package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
  105. package/build/features/auth/screens/DOB/DOBForm.js +59 -0
  106. package/build/features/auth/screens/DOB/index.d.ts +3 -0
  107. package/build/features/auth/screens/DOB/index.js +2 -0
  108. package/build/features/{connectExpress/screens/IdentityOTP → auth/screens/DOB}/validation.d.ts +4 -4
  109. package/build/features/auth/screens/DOB/validation.js +4 -0
  110. package/build/features/auth/screens/Email/Email.d.ts +5 -0
  111. package/build/features/auth/screens/Email/Email.js +57 -0
  112. package/build/features/auth/screens/Email/EmailField.d.ts +8 -0
  113. package/build/features/auth/screens/Email/EmailField.js +52 -0
  114. package/build/features/auth/screens/Email/index.d.ts +3 -0
  115. package/build/features/auth/screens/Email/index.js +2 -0
  116. package/build/features/auth/screens/Email/validation.d.ts +8 -0
  117. package/build/features/auth/screens/Email/validation.js +4 -0
  118. package/build/features/auth/screens/EmailSent/EmailSent.d.ts +5 -0
  119. package/build/features/auth/screens/EmailSent/EmailSent.js +79 -0
  120. package/build/features/auth/screens/EmailSent/index.d.ts +2 -0
  121. package/build/features/auth/screens/EmailSent/index.js +2 -0
  122. package/build/features/auth/screens/MigratingData/MigratingData.d.ts +5 -0
  123. package/build/features/auth/screens/MigratingData/MigratingData.js +44 -0
  124. package/build/features/auth/screens/MigratingData/index.d.ts +2 -0
  125. package/build/features/auth/screens/MigratingData/index.js +2 -0
  126. package/build/features/auth/screens/Mobile/Mobile.js +6 -38
  127. package/build/features/auth/screens/Mobile/MobileNumber.js +13 -15
  128. package/build/features/auth/screens/Mobile/validation.js +11 -3
  129. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  130. package/build/features/auth/screens/NID/NID.js +7 -43
  131. package/build/features/auth/screens/NID/validation.d.ts +0 -3
  132. package/build/features/auth/screens/NID/validation.js +0 -1
  133. package/build/features/auth/screens/OTP/OTP.js +41 -10
  134. package/build/features/auth/screens/OTP/OTPInput.js +23 -6
  135. package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
  136. package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
  137. package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
  138. package/build/features/auth/screens/OperatorError/index.js +2 -0
  139. package/build/features/auth/screens/Password/Password.d.ts +5 -0
  140. package/build/features/auth/screens/Password/Password.js +61 -0
  141. package/build/features/auth/screens/Password/PasswordField.d.ts +5 -0
  142. package/build/features/auth/screens/Password/PasswordField.js +28 -0
  143. package/build/features/auth/screens/Password/index.d.ts +3 -0
  144. package/build/features/auth/screens/Password/index.js +2 -0
  145. package/build/features/auth/screens/Password/validation.d.ts +8 -0
  146. package/build/features/auth/screens/Password/validation.js +4 -0
  147. package/build/features/auth/screens/PreparingData/PreparingData.js +3 -0
  148. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.d.ts +5 -0
  149. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.js +21 -0
  150. package/build/features/auth/screens/ResetPasswordMessage/index.d.ts +3 -0
  151. package/build/features/auth/screens/ResetPasswordMessage/index.js +2 -0
  152. package/build/features/auth/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  153. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +35 -0
  154. package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
  155. package/build/features/auth/screens/VerifyNafath/index.js +2 -0
  156. package/build/features/bank/Bank.d.ts +5 -1
  157. package/build/features/bank/Bank.js +22 -9
  158. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  159. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
  160. package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
  161. package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
  162. package/build/features/bank/screens/OperatorError/index.js +2 -0
  163. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  164. package/build/features/bank/screens/Verify/Verify.js +7 -6
  165. package/build/features/board/Board.d.ts +2 -0
  166. package/build/features/board/Board.js +24 -13
  167. package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
  168. package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
  169. package/build/features/board/screens/OperatorError/index.d.ts +3 -0
  170. package/build/features/board/screens/OperatorError/index.js +2 -0
  171. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  172. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  173. package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
  174. package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
  175. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -4
  176. package/build/features/board/screens/Verify/Verify.js +3 -2
  177. package/build/features/brand/Brand.d.ts +5 -1
  178. package/build/features/brand/Brand.js +22 -9
  179. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +5 -5
  180. package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
  181. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +6 -6
  182. package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -1
  183. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -5
  184. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -4
  185. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  186. package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
  187. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  188. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  189. package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
  190. package/build/features/brand/screens/BrandInfo/BrandName.js +2 -2
  191. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
  192. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
  193. package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
  194. package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
  195. package/build/features/brand/screens/OperatorError/index.js +2 -0
  196. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  197. package/build/features/brand/screens/Verify/Verify.js +3 -2
  198. package/build/features/business/Business.js +20 -12
  199. package/build/features/business/screens/Activities/Activities.js +26 -9
  200. package/build/features/business/screens/Activities/ActivitiesList.d.ts +4 -4
  201. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  202. package/build/features/business/screens/Activities/OperationStartDate.d.ts +5 -3
  203. package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
  204. package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +2 -2
  205. package/build/features/business/screens/BusinessType/BusinessType.js +11 -3
  206. package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
  207. package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -8
  208. package/build/features/business/screens/Customers/CustomerLocations.js +5 -3
  209. package/build/features/business/screens/Customers/Customers.js +50 -10
  210. package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +3 -1
  211. package/build/features/business/screens/Customers/ExpectedCustomers.js +5 -3
  212. package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +3 -1
  213. package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -6
  214. package/build/features/business/screens/Customers/RefundPolicy.d.ts +12 -5
  215. package/build/features/business/screens/Customers/RefundPolicy.js +13 -13
  216. package/build/features/business/screens/Customers/TransactionPolicy.d.ts +4 -1
  217. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -5
  218. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  219. package/build/features/business/screens/Customers/validation.js +3 -8
  220. package/build/features/business/screens/DOB/DOB.d.ts +6 -0
  221. package/build/features/business/screens/DOB/DOB.js +45 -0
  222. package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
  223. package/build/features/business/screens/DOB/DOBForm.js +72 -0
  224. package/build/features/business/screens/DOB/index.d.ts +3 -0
  225. package/build/features/business/screens/DOB/index.js +2 -0
  226. package/build/features/business/screens/DOB/validation.d.ts +8 -0
  227. package/build/features/business/screens/DOB/validation.js +4 -0
  228. package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
  229. package/build/features/business/screens/IDBOD/validation.d.ts +0 -3
  230. package/build/features/business/screens/IDBOD/validation.js +0 -1
  231. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  232. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -0
  233. package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → business/screens/MobileOwnership/MobileNumber.d.ts} +0 -2
  234. package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
  235. package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
  236. package/build/features/business/screens/MobileOwnership/index.js +2 -0
  237. package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
  238. package/build/features/business/screens/MobileOwnership/validation.js +38 -0
  239. package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
  240. package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
  241. package/build/features/business/screens/OperatorError/index.d.ts +3 -0
  242. package/build/features/business/screens/OperatorError/index.js +2 -0
  243. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
  244. package/build/features/business/screens/Verify/Verify.js +15 -4
  245. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  246. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +35 -0
  247. package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
  248. package/build/features/business/screens/VerifyNafath/index.js +2 -0
  249. package/build/features/connect/Connect.d.ts +5 -1
  250. package/build/features/connect/Connect.js +16 -9
  251. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
  252. package/build/features/connect/screens/CivilID/CivilID.js +6 -1
  253. package/build/features/{auth/screens/NID → connect/screens/DOB}/DOB.d.ts +1 -2
  254. package/build/features/connect/screens/{NID → DOB}/DOB.js +2 -2
  255. package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
  256. package/build/features/connect/screens/DOB/DOBForm.js +59 -0
  257. package/build/features/connect/screens/DOB/index.d.ts +3 -0
  258. package/build/features/connect/screens/DOB/index.js +2 -0
  259. package/build/features/connect/screens/DOB/validation.d.ts +8 -0
  260. package/build/features/connect/screens/DOB/validation.js +4 -0
  261. package/build/features/connect/screens/Individual/Email.js +1 -3
  262. package/build/features/connect/screens/Individual/Individual.js +11 -5
  263. package/build/features/connect/screens/Individual/MobileNumber.js +8 -7
  264. package/build/features/connect/screens/Individual/validation.js +11 -3
  265. package/build/features/connect/screens/Merchant/BrandName.js +2 -2
  266. package/build/features/connect/screens/Mobile/Mobile.js +12 -9
  267. package/build/features/connect/screens/Mobile/MobileNumber.js +8 -7
  268. package/build/features/connect/screens/Mobile/validation.js +11 -3
  269. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  270. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
  271. package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  272. package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
  273. package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
  274. package/build/features/connect/screens/MobileOwnership/index.js +2 -0
  275. package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
  276. package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
  277. package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
  278. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  279. package/build/features/connect/screens/NID/NID.js +5 -11
  280. package/build/features/connect/screens/NID/validation.d.ts +0 -3
  281. package/build/features/connect/screens/NID/validation.js +0 -1
  282. package/build/features/connect/screens/OTP/OTP.js +6 -6
  283. package/build/features/connect/screens/OTP/OTPInput.js +3 -11
  284. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  285. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  286. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +35 -0
  287. package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
  288. package/build/features/connect/screens/VerifyNafath/index.js +2 -0
  289. package/build/features/connectExpress/ConnectExpress.d.ts +5 -2
  290. package/build/features/connectExpress/ConnectExpress.js +62 -39
  291. package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
  292. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
  293. package/build/features/connectExpress/screens/CivilID/CivilID.js +6 -1
  294. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +2 -2
  295. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +8 -1
  296. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  297. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +1 -1
  298. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +30 -7
  299. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  300. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +9 -8
  301. package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +11 -3
  302. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
  303. package/build/features/connectExpress/screens/{NID → DOB}/DOB.d.ts +1 -2
  304. package/build/features/connectExpress/screens/{NID → DOB}/DOB.js +3 -3
  305. package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
  306. package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
  307. package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
  308. package/build/features/connectExpress/screens/DOB/index.js +2 -0
  309. package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
  310. package/build/features/connectExpress/screens/DOB/validation.js +4 -0
  311. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
  312. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
  313. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
  314. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
  315. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
  316. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +35 -0
  317. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
  318. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
  319. package/build/features/connectExpress/screens/Mobile/Mobile.js +10 -3
  320. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -8
  321. package/build/features/connectExpress/screens/Mobile/validation.js +21 -6
  322. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  323. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -0
  324. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  325. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
  326. package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
  327. package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
  328. package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
  329. package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
  330. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  331. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  332. package/build/features/connectExpress/screens/NID/NID.js +10 -10
  333. package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
  334. package/build/features/connectExpress/screens/NID/TAC.js +2 -2
  335. package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
  336. package/build/features/connectExpress/screens/NID/validation.js +0 -2
  337. package/build/features/connectExpress/screens/NIDMissed/NID.js +3 -3
  338. package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +0 -3
  339. package/build/features/connectExpress/screens/NIDMissed/validation.js +0 -1
  340. package/build/features/connectExpress/screens/OTP/OTP.js +13 -15
  341. package/build/features/connectExpress/screens/OTP/OTPInput.js +12 -10
  342. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
  343. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
  344. package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
  345. package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
  346. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
  347. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
  348. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
  349. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
  350. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
  351. package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.js +3 -3
  352. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
  353. package/build/features/connectExpress/screens/{IdentityOTP/OTP.js → VerifyMobileAuthOTP/VerifyMobileAuthOTP.js} +22 -21
  354. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
  355. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
  356. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  357. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +41 -0
  358. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
  359. package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
  360. package/build/features/entity/Entity.d.ts +4 -1
  361. package/build/features/entity/Entity.js +22 -9
  362. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +4 -4
  363. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +5 -5
  364. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +5 -5
  365. package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
  366. package/build/features/entity/screens/EntityName/EntityName.js +31 -14
  367. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +5 -5
  368. package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
  369. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
  370. package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
  371. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
  372. package/build/features/entity/screens/EntityName/IssuingDate.js +15 -8
  373. package/build/features/entity/screens/EntityName/LegalName.js +1 -13
  374. package/build/features/entity/screens/EntityName/LicenseNumber.js +6 -8
  375. package/build/features/entity/screens/EntityName/UnifiedNumber.js +4 -6
  376. package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
  377. package/build/features/entity/screens/EntityName/validation.js +1 -10
  378. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
  379. package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
  380. package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
  381. package/build/features/entity/screens/OperatorError/index.js +2 -0
  382. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  383. package/build/features/entity/screens/Verify/Verify.js +3 -2
  384. package/build/features/featuresScreens.d.ts +1 -0
  385. package/build/features/featuresScreens.js +216 -13
  386. package/build/features/individual/Individual.d.ts +4 -1
  387. package/build/features/individual/Individual.js +22 -9
  388. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
  389. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
  390. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -4
  391. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +4 -4
  392. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  393. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
  394. package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
  395. package/build/features/individual/screens/IndividualList/MobileNumber.js +8 -10
  396. package/build/features/individual/screens/IndividualList/UserList.js +7 -7
  397. package/build/features/individual/screens/IndividualList/validation.js +11 -4
  398. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  399. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
  400. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
  401. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +6 -5
  402. package/build/features/individual/screens/IndividualPersonalInfo/validation.js +11 -3
  403. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +9 -11
  404. package/build/features/individual/screens/IndividualPhoneInfo/validation.js +11 -3
  405. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
  406. package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
  407. package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
  408. package/build/features/individual/screens/OperatorError/index.js +2 -0
  409. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  410. package/build/features/individual/screens/Verify/Verify.js +3 -2
  411. package/build/features/kyc/KYC.d.ts +11 -0
  412. package/build/features/kyc/KYC.js +99 -0
  413. package/build/features/kyc/index.d.ts +1 -0
  414. package/build/features/kyc/index.js +1 -0
  415. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
  416. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
  417. package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
  418. package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
  419. package/build/features/kyc/screens/Loading/Loading.d.ts +4 -0
  420. package/build/features/kyc/screens/Loading/Loading.js +10 -0
  421. package/build/features/kyc/screens/Loading/index.d.ts +2 -0
  422. package/build/features/kyc/screens/Loading/index.js +2 -0
  423. package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +5 -0
  424. package/build/features/kyc/screens/OperatorError/OperatorError.js +9 -0
  425. package/build/features/kyc/screens/OperatorError/index.d.ts +2 -0
  426. package/build/features/kyc/screens/OperatorError/index.js +2 -0
  427. package/build/features/kyc/screens/Success/Success.d.ts +5 -0
  428. package/build/features/kyc/screens/Success/Success.js +32 -0
  429. package/build/features/kyc/screens/Success/index.d.ts +2 -0
  430. package/build/features/kyc/screens/Success/index.js +2 -0
  431. package/build/features/kyc/screens/Terms/Header.d.ts +6 -0
  432. package/build/features/kyc/screens/Terms/Header.js +36 -0
  433. package/build/features/kyc/screens/Terms/Terms.d.ts +4 -0
  434. package/build/features/kyc/screens/Terms/Terms.js +87 -0
  435. package/build/features/kyc/screens/Terms/index.d.ts +2 -0
  436. package/build/features/kyc/screens/Terms/index.js +2 -0
  437. package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
  438. package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
  439. package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
  440. package/build/features/kyc/screens/TokenError/index.js +2 -0
  441. package/build/features/kyc/screens/Users/Users.d.ts +3 -0
  442. package/build/features/kyc/screens/Users/Users.js +76 -0
  443. package/build/features/kyc/screens/Users/index.d.ts +2 -0
  444. package/build/features/kyc/screens/Users/index.js +2 -0
  445. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  446. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +45 -0
  447. package/build/features/kyc/screens/VerifyNafath/index.d.ts +3 -0
  448. package/build/features/kyc/screens/VerifyNafath/index.js +2 -0
  449. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +5 -0
  450. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +44 -0
  451. package/build/features/kyc/screens/VerifyPaci/index.d.ts +3 -0
  452. package/build/features/kyc/screens/VerifyPaci/index.js +2 -0
  453. package/build/features/password/Password.d.ts +4 -1
  454. package/build/features/password/Password.js +88 -31
  455. package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
  456. package/build/features/password/screens/OTP/OTP.js +3 -3
  457. package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
  458. package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
  459. package/build/features/password/screens/OperatorError/index.d.ts +3 -0
  460. package/build/features/password/screens/OperatorError/index.js +2 -0
  461. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  462. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  463. package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
  464. package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
  465. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  466. package/build/features/password/screens/Verify/Verify.js +7 -6
  467. package/build/features/shared/Address/CountryList.d.ts +5 -5
  468. package/build/features/shared/Address/InputSelect.d.ts +5 -5
  469. package/build/features/shared/Background/Background.js +1 -1
  470. package/build/features/shared/Background/LogoBackground.js +5 -17
  471. package/build/features/shared/BusinessCountry/BusinessCountry.js +1 -1
  472. package/build/features/shared/Button/Button.js +3 -1
  473. package/build/features/shared/Button/EmailProvidersButtons.js +2 -0
  474. package/build/features/shared/Button/FlowsButtons.js +18 -4
  475. package/build/features/shared/Button/NafathButton.d.ts +8 -0
  476. package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +12 -3
  477. package/build/features/shared/Button/index.d.ts +2 -2
  478. package/build/features/shared/Button/index.js +2 -2
  479. package/build/features/shared/Calender/Calender.d.ts +2 -1
  480. package/build/features/shared/Calender/Calender.js +3 -3
  481. package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
  482. package/build/features/shared/Containers/FeatureContainer.js +5 -3
  483. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  484. package/build/features/shared/Dialog/DialogContainer.js +5 -4
  485. package/build/features/shared/Input/Input.d.ts +3 -3
  486. package/build/features/shared/NafathVerification/NafathVerification.d.ts +14 -0
  487. package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
  488. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
  489. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
  490. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
  491. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
  492. package/build/features/shared/NafathVerification/index.d.ts +2 -0
  493. package/build/features/shared/NafathVerification/index.js +2 -0
  494. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +6 -1
  495. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +10 -13
  496. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  497. package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
  498. package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
  499. package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
  500. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
  501. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
  502. package/build/features/signIn/SignIn.js +18 -7
  503. package/build/features/signIn/screens/Mobile/MobileNumber.js +8 -7
  504. package/build/features/signIn/screens/Mobile/validation.js +11 -3
  505. package/build/features/signIn/screens/OTP/OTP.js +5 -4
  506. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
  507. package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
  508. package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
  509. package/build/features/signIn/screens/OperatorError/index.js +2 -0
  510. package/build/features/tax/Tax.d.ts +4 -1
  511. package/build/features/tax/Tax.js +22 -9
  512. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
  513. package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
  514. package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
  515. package/build/features/tax/screens/OperatorError/index.js +2 -0
  516. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  517. package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
  518. package/build/features/tax/screens/Verify/Verify.js +7 -6
  519. package/build/hooks/index.d.ts +3 -0
  520. package/build/hooks/index.js +3 -0
  521. package/build/hooks/useAppConfig.d.ts +1 -1
  522. package/build/hooks/useAppConfig.js +2 -2
  523. package/build/hooks/useAppDispatch.d.ts +1 -0
  524. package/build/hooks/useAppTheme.js +4 -3
  525. package/build/hooks/useCountDown.d.ts +10 -0
  526. package/build/hooks/useCountDown.js +17 -0
  527. package/build/hooks/useFormDirtyCheck.d.ts +10 -0
  528. package/build/hooks/useFormDirtyCheck.js +66 -0
  529. package/build/hooks/useSanitizedTranslation.d.ts +2 -0
  530. package/build/hooks/useSanitizedTranslation.js +15 -0
  531. package/build/hooks/useVerifyToken.d.ts +4 -2
  532. package/build/hooks/useVerifyToken.js +9 -4
  533. package/build/index.css +360 -120
  534. package/build/index.d.ts +3 -2
  535. package/build/index.js +4 -2
  536. package/build/theme/components.js +7 -0
  537. package/build/theme/palette.js +2 -1
  538. package/build/theme/shadows.js +1 -1
  539. package/build/theme/theme.d.ts +1 -1
  540. package/build/theme/theme.js +2 -2
  541. package/build/utils/array.js +2 -2
  542. package/build/utils/common.d.ts +1 -0
  543. package/build/utils/common.js +16 -3
  544. package/build/utils/error.d.ts +1 -0
  545. package/build/utils/error.js +3 -0
  546. package/build/utils/object.d.ts +1 -0
  547. package/build/utils/object.js +3 -0
  548. package/build/utils/string.d.ts +6 -2
  549. package/build/utils/string.js +28 -3
  550. package/build/utils/validation.d.ts +2 -0
  551. package/build/utils/validation.js +6 -0
  552. package/package.json +3 -4
  553. package/build/features/business/screens/OTP/OTP.d.ts +0 -8
  554. package/build/features/business/screens/OTP/OTP.js +0 -90
  555. package/build/features/business/screens/OTP/index.d.ts +0 -3
  556. package/build/features/business/screens/OTP/index.js +0 -2
  557. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
  558. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -54
  559. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
  560. package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
  561. package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
  562. package/build/features/shared/Button/AbsherButton.d.ts +0 -8
  563. /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
  564. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.d.ts +0 -0
  565. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.d.ts +0 -0
  566. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.js +0 -0
@@ -18,9 +18,8 @@ import Text from '../../../../components/Text';
18
18
  import { clearError, connectSelector, resetOTPScreen, verifyAuth } from '../../../app/connect/connectStore';
19
19
  import Button from '../../../shared/Button';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
- import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
21
+ import { useAppDispatch, useAppSelector, useLanguage, useSetFromDefaultValues, useSanitizedTranslation } from '../../../../hooks';
22
22
  import { handlePrevScreenStep } from '../../../../app/settings';
23
- import { useLanguage } from '../../../../hooks';
24
23
  import { AuthForType } from '../../../../@types';
25
24
  import { useForm, FormProvider } from 'react-hook-form';
26
25
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -50,6 +49,7 @@ var FormStyled = styled(Form)(function () { return ({
50
49
  var OTP = function () {
51
50
  var _a;
52
51
  var dispatch = useAppDispatch();
52
+ var t = useTranslation().t;
53
53
  var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
54
54
  var otp = data.otpData.otp;
55
55
  var methods = useForm({
@@ -60,7 +60,7 @@ var OTP = function () {
60
60
  mode: 'onChange'
61
61
  });
62
62
  useSetFromDefaultValues(methods, data.otpData);
63
- var t = useTranslation().t;
63
+ var st = useSanitizedTranslation();
64
64
  var isAr = useLanguage().isAr;
65
65
  var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
66
66
  React.useEffect(function () {
@@ -84,9 +84,9 @@ var OTP = function () {
84
84
  dispatch(handlePrevScreenStep(startWithNID ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
85
85
  };
86
86
  var disabled = !methods.formState.isValid;
87
- var phone = ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + (data.mobileData.mobile || '');
87
+ var phone = data.mobileData.mobile ? ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + data.mobileData.mobile : '';
88
88
  var idNumber = data.nidData.nid;
89
- var title = startWithNID ? t('opt_nid_sent_title', { provider: 'ABSHER' }) : t('ide_opt_sent_title');
90
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: startWithNID ? maskID(idNumber) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
89
+ var title = startWithNID ? t('opt_nid_sent_title', { provider: 'ABSHER' }) : st('ide_opt_sent_title');
90
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: startWithNID ? maskID(idNumber) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
91
91
  };
92
92
  export default React.memo(OTP);
@@ -17,8 +17,7 @@ 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
- import { clearError, connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
20
+ import { clearError, connectSelector, resendOTPMobile } from '../../../app/connect/connectStore';
22
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
23
22
  import { sendCustomEventToGTM } from '../../../../utils';
24
23
  var BoxStyled = styled(Box)(function (_a) {
@@ -34,8 +33,7 @@ var OTPInput = function (_a) {
34
33
  var t = useTranslation().t;
35
34
  var dispatch = useAppDispatch();
36
35
  var otpControl = useController({ name: 'otp', control: control });
37
- var _c = useAppSelector(connectSelector), data = _c.data, error = _c.error;
38
- var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
36
+ var error = useAppSelector(connectSelector).error;
39
37
  var handleOnOTPChange = function (otp) {
40
38
  if (error)
41
39
  dispatch(clearError());
@@ -54,13 +52,7 @@ var OTPInput = function (_a) {
54
52
  sendEventAskAnotherOTP();
55
53
  dispatch(resendOTPMobile());
56
54
  };
57
- var handleOnResendAbsherOTP = function () {
58
- if (otpControl.field.value)
59
- setValue('otp', '', { shouldValidate: true });
60
- sendEventAskAnotherOTP();
61
- dispatch(resendOTPNID());
62
- };
63
55
  var otpValue = otpControl.field.value;
64
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: startWithNID ? handleOnResendAbsherOTP : handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
56
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
65
57
  };
66
58
  export default React.memo(OTPInput);
@@ -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') });
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface VerifyNafathProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<() => JSX.Element | null>;
5
+ export default _default;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { connectSelector, verifyNafath as verifyNafathFun } from '../../../app/connect/connectStore';
4
+ import NafathVerification from '../../../shared/NafathVerification';
5
+ import { handlePrevScreenStep } from '../../../../app/settings';
6
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
+ var VerifyNafath = function () {
8
+ var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
9
+ var _b = React.useState(false), failed = _b[0], setFailed = _b[1];
10
+ var _c = React.useState(false), isReady = _c[0], setIsReady = _c[1];
11
+ var dispatch = useAppDispatch();
12
+ var data = useAppSelector(connectSelector).data;
13
+ var responseBody = data.nidData.responseBody;
14
+ var _d = responseBody || {}, expiry = _d.expiry, app_url_android = _d.app_url_android, app_url_ios = _d.app_url_ios, random = _d.random;
15
+ React.useEffect(function () {
16
+ if (responseBody && !isReady) {
17
+ setIsReady(true);
18
+ }
19
+ }, [responseBody]);
20
+ React.useEffect(function () {
21
+ if (!isReady)
22
+ return;
23
+ var promise = dispatch(verifyNafathFun({ onSuccess: function () { return setSuccess(true); }, onFailure: function () { return setFailed(true); } }));
24
+ return function () {
25
+ promise === null || promise === void 0 ? void 0 : promise.abort();
26
+ };
27
+ }, [isReady]);
28
+ var onBack = React.useCallback(function () {
29
+ dispatch(handlePrevScreenStep());
30
+ }, []);
31
+ if (!isReady)
32
+ return null;
33
+ return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, failed: failed, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
34
+ };
35
+ export default React.memo(VerifyNafath);
@@ -0,0 +1,3 @@
1
+ import VerifyNafath, { VerifyNafathProps } from './VerifyNafath';
2
+ export type { VerifyNafathProps };
3
+ export default VerifyNafath;
@@ -0,0 +1,2 @@
1
+ import VerifyNafath from './VerifyNafath';
2
+ export default VerifyNafath;
@@ -2,10 +2,13 @@
2
2
  import { LibConfig } from '../../@types';
3
3
  export interface ConnectExpressLibProps extends LibConfig {
4
4
  leadId?: string;
5
- showBoard?: boolean;
6
5
  configToken?: string;
7
6
  }
8
- export declare function ConnectExpressElement(props: ConnectExpressLibProps): JSX.Element;
7
+ interface ConnectExpressFullProps extends ConnectExpressLibProps {
8
+ unmount?: () => void;
9
+ }
10
+ export declare function ConnectExpressElement(props: ConnectExpressFullProps): JSX.Element;
9
11
  export declare function renderConnectExpressLib(config: ConnectExpressLibProps, elementId: string): {
10
12
  unmount: () => void;
11
13
  };
14
+ export {};
@@ -61,79 +61,102 @@ import React, { memo } from 'react';
61
61
  import { createRoot } from 'react-dom/client';
62
62
  import { FeatureContainer } from '../shared/Containers';
63
63
  import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useAppDispatch } from '../../hooks';
64
- import { handleCurrentActiveScreen, settingsSelector } from '../../app/settings';
64
+ import { handleCurrentActiveScreen, handleOpen, settingsSelector } from '../../app/settings';
65
65
  import AnimationFlow from '../../components/AnimationFlow';
66
66
  import { store } from '../../app/store';
67
- import { connectExpressSelector, setIsLeadIdPassed, setLeadId, retrieveLeadIdentityByIdAsync, setShowBoard, setDefaultCountryCode } from '../app/connectExpress/connectExpressStore';
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 } 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';
74
74
  var ConnectExpress = memo(function (_a) {
75
- var leadId = _a.leadId, postURL = _a.postURL, showBoard = _a.showBoard, configToken = _a.configToken, props = __rest(_a, ["leadId", "postURL", "showBoard", "configToken"]);
75
+ var _b, _c, _d;
76
+ var leadId = _a.leadId, postURL = _a.postURL, configToken = _a.configToken, props = __rest(_a, ["leadId", "postURL", "configToken"]);
76
77
  var theme = useAppTheme().theme;
77
78
  var dispatch = useAppDispatch();
78
- var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
79
- var _c = useAppSelector(connectExpressSelector), connectExpressError = _c.error, loading = _c.loading, customLoading = _c.customLoading, connectData = _c.data;
79
+ var _e = useAppSelector(settingsSelector), data = _e.data, error = _e.error, settingLoading = _e.loading;
80
+ var _f = useAppSelector(connectExpressSelector), connectExpressError = _f.error, loading = _f.loading, customLoading = _f.customLoading, connectData = _f.data;
80
81
  var onVerifyConfigTokenSuccess = function (data) { return __awaiter(void 0, void 0, void 0, function () {
81
- var _a, lead, board;
82
- return __generator(this, function (_b) {
83
- _a = data || {}, lead = _a.lead, board = _a.board;
82
+ var lead;
83
+ return __generator(this, function (_a) {
84
+ lead = (data || {}).lead;
84
85
  if (lead === null || lead === void 0 ? void 0 : lead.id) {
85
86
  dispatch(setIsLeadIdPassed(true));
86
87
  dispatch(setLeadId(lead.id));
87
88
  }
88
- if (showBoard === false || (board === null || board === void 0 ? void 0 : board.display) === false)
89
- dispatch(setShowBoard(false));
90
89
  return [2];
91
90
  });
92
91
  }); };
93
92
  useAppConfig(__assign(__assign(__assign({ navigation: CONNECT_EXPRESS_SCREENS_NAVIGATION, maturity: 'express' }, props), { postURL: postURL, configToken: configToken }), (configToken && { onVerifyConfigTokenSuccess: onVerifyConfigTokenSuccess })));
94
- useErrorListener(connectExpressError || error);
93
+ useErrorListener(connectExpressError || error, {
94
+ event: 'Send Event',
95
+ event_category: 'User Registration Flow',
96
+ event_action: 'Registration Error'
97
+ });
95
98
  useStepStartedListener();
96
- var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant;
99
+ var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant, appConfig = data.appConfig;
100
+ var animationDirection = open ? (_b = appConfig.features) === null || _b === void 0 ? void 0 : _b.dialogStartTransition : (_c = appConfig.features) === null || _c === void 0 ? void 0 : _c.dialogEndTransition;
97
101
  React.useEffect(function () {
98
- if (typeof showBoard === 'boolean' && !configToken)
99
- dispatch(setShowBoard(showBoard));
102
+ initializeGTM();
100
103
  sendPageView({
101
- title: 'Connect Express'
104
+ title: 'Connect Express',
105
+ connect_flow: 'Express'
102
106
  });
103
107
  }, []);
104
108
  React.useEffect(function () {
105
- var _a;
109
+ var _a, _b, _c;
106
110
  if (!!((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2)) {
107
111
  dispatch(setDefaultCountryCode(data.businessCountry));
112
+ sendCustomEventToGTM({
113
+ event: 'Send Event',
114
+ event_category: 'User Registration Flow',
115
+ event_action: 'Registration Landing Page Viewed',
116
+ event_label: (_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2
117
+ });
118
+ sendCustomDimension({
119
+ event: 'PageView',
120
+ website_country: (_c = data.businessCountry) === null || _c === void 0 ? void 0 : _c.iso2
121
+ });
108
122
  }
109
123
  }, [data.businessCountry]);
110
124
  React.useEffect(function () {
111
125
  var _a, _b;
112
- if (settingLoading)
126
+ if (settingLoading || !props.open)
113
127
  return;
114
- if (data.isValidOperator && props.open) {
115
- if (configToken && connectData.leadId) {
116
- dispatch(retrieveLeadIdentityByIdAsync(connectData.leadId));
117
- return;
118
- }
119
- if (leadId) {
120
- if (props.scope !== 'auth') {
121
- dispatch(setIsLeadIdPassed(true));
122
- }
123
- dispatch(setLeadId(leadId));
124
- dispatch(retrieveLeadIdentityByIdAsync(leadId));
125
- return;
126
- }
127
- if (!((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2)) {
128
- dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
129
- return;
130
- }
131
- if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
132
- dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
128
+ if (!data.isValidOperator) {
129
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_OPERATOR_ERROR_STEP'));
130
+ return;
131
+ }
132
+ if (configToken && connectData.leadId) {
133
+ dispatch(retrieveLeadIdentityByIdAsync(connectData.leadId));
134
+ return;
135
+ }
136
+ if (leadId) {
137
+ if (props.scope !== 'auth') {
138
+ dispatch(setIsLeadIdPassed(true));
133
139
  }
140
+ dispatch(setLeadId(leadId));
141
+ dispatch(retrieveLeadIdentityByIdAsync(leadId));
142
+ return;
143
+ }
144
+ if (!((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2)) {
145
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
146
+ return;
147
+ }
148
+ if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
149
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
134
150
  }
135
151
  }, [data.isValidOperator, settingLoading]);
136
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !isTapOrigin, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: true }, { children: connectExpressFeatureScreens.map(function (_a, index) {
152
+ var handleDialogClose = function () {
153
+ dispatch(handleOpen(false));
154
+ setTimeout(function () {
155
+ var _a;
156
+ (_a = props.unmount) === null || _a === void 0 ? void 0 : _a.call(props);
157
+ }, 1100);
158
+ };
159
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, animationDirection: animationDirection, onClose: ((_d = appConfig.features) === null || _d === void 0 ? void 0 : _d.closeButton) ? handleDialogClose : undefined, loading: settingLoading || customLoading, error: error, open: open, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !isTapOrigin, dialogEdgeFormat: appConfig.dialogEdgeFormat, features: __assign({ tapTextLogo: false, poweredBy: !isTapOrigin }, appConfig.features) }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: true, isTapOrigin: isTapOrigin }, { children: connectExpressFeatureScreens.map(function (_a, index) {
137
160
  var Element = _a.element, name = _a.name;
138
161
  var isActive = activeScreen.name === name;
139
162
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -145,7 +168,7 @@ export function ConnectExpressElement(props) {
145
168
  export function renderConnectExpressLib(config, elementId) {
146
169
  var el = findOrCreateElementAndInject(elementId);
147
170
  var root = createRoot(el);
148
- root.render(_jsx(ConnectExpressElement, __assign({}, config)));
149
171
  var unmount = function () { return root.unmount(); };
172
+ root.render(_jsx(ConnectExpressElement, __assign({}, config, { unmount: unmount })));
150
173
  return { unmount: unmount };
151
174
  }
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useController, useFormContext } from 'react-hook-form';
5
5
  import { KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH, LICENSE_NUMBER_MAX_LENGTH, LICENSE_NUMBER_MIN_LENGTH } from '../../../../constants';
6
- import { removeAllOtherThanCharsNumberSlashAndHyphen, isSA } from '../../../../utils';
6
+ import { isSA, cleanFLandCRNumber } from '../../../../utils';
7
7
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
8
8
  import ClearIcon from '../../../shared/ClearIcon';
9
9
  import CheckIcon from '../../../shared/CheckIcon';
@@ -19,7 +19,7 @@ var LicenseNumber = function () {
19
19
  var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
20
20
  var handleFLNumberChange = function (_a) {
21
21
  var target = _a.target;
22
- var value = removeAllOtherThanCharsNumberSlashAndHyphen(target.value);
22
+ var value = cleanFLandCRNumber(target.value);
23
23
  licenseNumberControl.field.onChange(value);
24
24
  };
25
25
  var clearLicenseNumber = function () {
@@ -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:
@@ -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,6 +79,11 @@ 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 () {
@@ -63,7 +63,7 @@ import Input from '../../../shared/Input';
63
63
  import { EndAdornment } from '../../../shared/EndAdornment';
64
64
  import { ScreenContainer } from '../../../shared/Containers';
65
65
  import { checkBrandNameAvailabilityAsync, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
66
- import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
66
+ import { removeAllOtherThanCharsNumbersAndSpace, removeLeadingSpace } from '../../../../utils';
67
67
  import { BRAND_NAME_MAX_LENGTH } from '../../../../constants';
68
68
  var LabelContainerStyled = styled(Box)(function (_a) {
69
69
  var theme = _a.theme;
@@ -121,7 +121,7 @@ var BrandName = function (_a) {
121
121
  }); }, 500);
122
122
  var handleBrandNameChange = function (_a) {
123
123
  var target = _a.target;
124
- var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
124
+ var value = removeLeadingSpace(removeAllOtherThanCharsNumbersAndSpace(target.value));
125
125
  brandControl.field.onChange(value);
126
126
  };
127
127
  React.useEffect(function () {
@@ -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());
@@ -14,7 +14,7 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { CR_MIN_LICENSE_LENGTH, CR_NUMBER_MAX_LENGTH, FL_MIN_LICENSE_LENGTH, FL_NUMBER_MAX_LENGTH, KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH } from '../../../../constants';
17
- import { removeAllOtherThanCharsAndNumber, isKW, isOtherThanKWOrSA } from '../../../../utils';
17
+ import { isKW, isOtherThanKWOrSA, cleanFLandCRNumber } from '../../../../utils';
18
18
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
19
19
  import ClearIcon from '../../../shared/ClearIcon';
20
20
  import CheckIcon from '../../../shared/CheckIcon';
@@ -36,7 +36,7 @@ var LicenseNumber = function (_a) {
36
36
  var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
37
37
  var handleFLNumberChange = function (_a) {
38
38
  var target = _a.target;
39
- var value = removeAllOtherThanCharsAndNumber(target.value);
39
+ var value = cleanFLandCRNumber(target.value);
40
40
  licenseNumberControl.field.onChange(value);
41
41
  };
42
42
  var clearLicenseNumber = function () {
@@ -10,7 +10,7 @@ export declare const TACContainerStyled: import("@emotion/styled").StyledCompone
10
10
  sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
11
11
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
12
12
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
13
- }, keyof import("@mui/material/OverridableComponent").CommonProps | ("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, {}, {}>;
13
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & TACContainerStyledProps, {}, {}>;
14
14
  interface TACProps {
15
15
  show: boolean;
16
16
  readOnly?: boolean;
@@ -18,8 +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';
22
- import { countriesCode } from '../../../../constants';
21
+ import { deepCopy, isKW, sendCustomEventToGTM } from '../../../../utils';
23
22
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
24
23
  import Form from '../../../../components/Form';
25
24
  import Collapse from '../../../../components/Collapse';
@@ -49,7 +48,7 @@ var CollectIndividualInfo = function (_a) {
49
48
  var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
50
49
  var startWithNIDMissed = otpData.authFor === AuthForType.NATIONAL_ID_MISSED;
51
50
  var contact = ((responseData === null || responseData === void 0 ? void 0 : responseData.leadData) || {}).contact;
52
- var countryCode = individualData.countryCode;
51
+ var countryCode = individualData.countryCode, isPrevDob = individualData.isPrevDob;
53
52
  var isEmailAvailable = (responseData || {}).isEmailAvailable;
54
53
  var methods = useForm({
55
54
  resolver: yupResolver(CollectIndividualInfoValidation),
@@ -60,6 +59,13 @@ var CollectIndividualInfo = function (_a) {
60
59
  var originalReadOnly = useFormReadOnly(methods);
61
60
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
62
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
+ }, []);
63
69
  React.useEffect(function () {
64
70
  if (countryCode.iso2 !== methods.getValues('countryCode.iso2'))
65
71
  methods.setValue('countryCode', countryCode);
@@ -69,11 +75,28 @@ var CollectIndividualInfo = function (_a) {
69
75
  };
70
76
  var onBack = function () {
71
77
  var _a;
72
- dispatch(resetIndividualScreen());
78
+ if (!individualData.isPrevDob) {
79
+ dispatch(resetIndividualScreen());
80
+ }
73
81
  var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
74
- var screen = startWithNID ? (isKW(code) ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP') : 'CONNECT_EXPRESS_MOBILE_STEP';
82
+ var screen = 'CONNECT_EXPRESS_MOBILE_STEP';
83
+ if (startWithNID) {
84
+ if (isKW(code))
85
+ screen = 'CONNECT_EXPRESS_CIVIL_ID_STEP';
86
+ else {
87
+ screen = 'CONNECT_EXPRESS_NID_STEP';
88
+ if (isPrevDob)
89
+ screen = 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP';
90
+ }
91
+ }
75
92
  if (startWithNIDMissed) {
76
- screen = isKW(code) ? 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP' : 'CONNECT_EXPRESS_NID_MISSED_STEP';
93
+ if (isKW(code))
94
+ screen = 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP';
95
+ else {
96
+ screen = 'CONNECT_EXPRESS_NID_MISSED_STEP';
97
+ if (isPrevDob)
98
+ screen = 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP';
99
+ }
77
100
  }
78
101
  dispatch(handlePrevScreenStep(screen));
79
102
  };
@@ -93,6 +116,6 @@ var CollectIndividualInfo = function (_a) {
93
116
  var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email;
94
117
  var disabled = emailErrChecks || emailChecking || !isEmailValid;
95
118
  var emailReadOnly = readOnly['email'] && !((_b = methods.getFieldState('email').error) === null || _b === void 0 ? void 0 : _b.message) && !methods.getFieldState('email').isDirty;
96
- 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: countriesCode }), _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') })) }))] })) })) }));
119
+ 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') })) }))] })) })) }));
97
120
  };
98
121
  export default React.memo(CollectIndividualInfo);
@@ -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;
@@ -26,7 +26,7 @@ import { useTranslation } from 'react-i18next';
26
26
  import { useController, useFormContext } from 'react-hook-form';
27
27
  import Box from '@mui/material/Box';
28
28
  import { styled, alpha } from '@mui/material/styles';
29
- import { removeAllCharsFromNumber } from '../../../../utils';
29
+ import { getMobileNumberLen, removeAllCharsFromNumber } from '../../../../utils';
30
30
  import { useLanguage } from '../../../../hooks';
31
31
  import Text from '../../../../components/Text';
32
32
  import Collapse from '../../../../components/Collapse';
@@ -93,9 +93,10 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
93
93
  var countryName = (isAr ? (_b = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.name) === null || _c === void 0 ? void 0 : _c.english) || '';
94
94
  var error = !!mobileValue ? (_d = phoneControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message : '';
95
95
  var isSA = countryCodeValue.iso2 === 'SA';
96
- var mobileLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits;
97
- var isStartsWith5 = mobileValue.startsWith('5');
98
- var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
96
+ var mobileMaxLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.max_digits;
97
+ var mobileMinLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.min_digits;
98
+ var requiredMaxLen = getMobileNumberLen(mobileMaxLen, mobileValue);
99
+ var requiredMinLen = getMobileNumberLen(mobileMinLen, mobileValue);
99
100
  React.useEffect(function () {
100
101
  if (mobileValue)
101
102
  setValue('mobile', mobileValue, { shouldValidate: true });
@@ -137,16 +138,16 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
137
138
  var filteredCountries = countries.filter(function (country) {
138
139
  return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
139
140
  country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
140
- country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
141
- country.name.english.toLowerCase().startsWith(value.toLowerCase());
141
+ country.name.arabic.toLowerCase().includes(value.toLowerCase()) ||
142
+ country.name.english.toLowerCase().includes(value.toLowerCase());
142
143
  });
143
144
  setCountries(filteredCountries);
144
145
  };
145
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { mb: 3 } }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { readOnly: readOnly, inputProps: { maxLength: requiredLen }, type: 'tel', disabled: !!anchorEl, onClick: onCloseCountryList, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: function () {
146
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { mb: 3 } }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { readOnly: readOnly, inputProps: { maxLength: requiredMaxLen }, type: 'tel', disabled: !!anchorEl, onClick: onCloseCountryList, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: function () {
146
147
  if (readOnly)
147
148
  return;
148
149
  toggleCountryList();
149
- } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: requiredLen, number: '05|5' }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
150
+ } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { minLength: requiredMinLen, length: requiredMaxLen, number: '05|5' }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
150
151
  return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIcon, {})] }));
151
152
  } })] }))] })) })));
152
153
  });