@tap-payments/auth-jsconnect 2.0.51 → 2.0.52

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 (292) hide show
  1. package/build/@types/app.d.ts +90 -7
  2. package/build/@types/app.js +7 -0
  3. package/build/@types/form.d.ts +21 -20
  4. package/build/@types/theme.d.ts +1 -1
  5. package/build/api/account.d.ts +2 -2
  6. package/build/api/auth.d.ts +11 -11
  7. package/build/api/availabilityServices.d.ts +3 -3
  8. package/build/api/axios.js +1 -1
  9. package/build/api/board.d.ts +3 -3
  10. package/build/api/country.d.ts +1 -1
  11. package/build/api/data.d.ts +10 -10
  12. package/build/api/document.d.ts +2 -2
  13. package/build/api/entity.d.ts +12 -12
  14. package/build/api/file.d.ts +1 -1
  15. package/build/api/individual.d.ts +5 -5
  16. package/build/api/lead.d.ts +10 -10
  17. package/build/api/operator.d.ts +1 -1
  18. package/build/api/operator.js +1 -1
  19. package/build/api/user.d.ts +2 -2
  20. package/build/app/settings.d.ts +4 -11
  21. package/build/app/settings.js +13 -5
  22. package/build/app/store.d.ts +4 -4
  23. package/build/assets/locales/ar.json +3 -1
  24. package/build/assets/locales/en.json +3 -1
  25. package/build/components/DatePicker/DatePicker.js +1 -0
  26. package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
  27. package/build/components/RadioGroup/RadioGroup.js +5 -9
  28. package/build/components/RadioGroup/index.d.ts +1 -1
  29. package/build/components/Slide/Slide.d.ts +1 -1
  30. package/build/constants/app.d.ts +3 -2
  31. package/build/constants/app.js +1 -0
  32. package/build/constants/validation.d.ts +1 -0
  33. package/build/constants/validation.js +1 -0
  34. package/build/features/app/bank/bankStore.d.ts +9 -73
  35. package/build/features/app/bank/bankStore.js +68 -91
  36. package/build/features/app/brand/brandStore.d.ts +16 -103
  37. package/build/features/app/brand/brandStore.js +62 -49
  38. package/build/features/app/business/businessStore.d.ts +18 -162
  39. package/build/features/app/business/businessStore.js +4 -3
  40. package/build/features/app/connect/connectStore.d.ts +13 -121
  41. package/build/features/app/connect/connectStore.js +5 -4
  42. package/build/features/app/connectExpress/connectExpressStore.d.ts +22 -211
  43. package/build/features/app/connectExpress/connectExpressStore.js +9 -10
  44. package/build/features/app/entity/entityStore.d.ts +9 -74
  45. package/build/features/app/entity/entityStore.js +129 -152
  46. package/build/features/app/individual/individualStore.d.ts +21 -167
  47. package/build/features/app/individual/individualStore.js +176 -202
  48. package/build/features/app/password/passwordStore.d.ts +12 -102
  49. package/build/features/app/password/passwordStore.js +1 -1
  50. package/build/features/app/signIn/signInStore.d.ts +7 -61
  51. package/build/features/app/signIn/signInStore.js +1 -1
  52. package/build/features/app/tax/taxStore.d.ts +8 -62
  53. package/build/features/app/tax/taxStore.js +48 -62
  54. package/build/features/bank/screens/BankDetails/BankDetails.js +20 -5
  55. package/build/features/bank/screens/BankDetails/BankName.d.ts +4 -1
  56. package/build/features/bank/screens/BankDetails/BankName.js +8 -7
  57. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +5 -2
  58. package/build/features/bank/screens/BankDetails/BankStatement.js +3 -8
  59. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
  60. package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -7
  61. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
  62. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +12 -13
  63. package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
  64. package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
  65. package/build/features/bank/screens/BankDetails/validation.d.ts +14 -14
  66. package/build/features/bank/screens/BankDetails/validation.js +16 -21
  67. package/build/features/bank/screens/Verify/OTPInput.js +5 -3
  68. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +15 -18
  69. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +14 -9
  70. package/build/features/brand/screens/BrandActivities/BrandActivities.js +14 -5
  71. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +12 -16
  72. package/build/features/brand/screens/BrandActivities/CustomerBase.js +16 -13
  73. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
  74. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +22 -9
  75. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
  76. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +20 -7
  77. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +13 -6
  78. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +23 -12
  79. package/build/features/brand/screens/BrandActivities/TAC.d.ts +14 -1
  80. package/build/features/brand/screens/BrandActivities/TAC.js +21 -12
  81. package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
  82. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +18 -4
  83. package/build/features/brand/screens/BrandActivities/validation.d.ts +7 -7
  84. package/build/features/brand/screens/BrandActivities/validation.js +10 -19
  85. package/build/features/brand/screens/BrandInfo/BrandInfo.js +20 -12
  86. package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
  87. package/build/features/brand/screens/BrandInfo/BrandLogo.js +52 -0
  88. package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
  89. package/build/features/brand/screens/BrandInfo/BrandName.js +3 -3
  90. package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
  91. package/build/features/brand/screens/BrandInfo/SalesChannels.js +2 -1
  92. package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
  93. package/build/features/brand/screens/BrandInfo/Segments.js +12 -2
  94. package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
  95. package/build/features/brand/screens/BrandInfo/TeamSize.js +12 -2
  96. package/build/features/brand/screens/BrandInfo/validation.d.ts +6 -6
  97. package/build/features/brand/screens/BrandInfo/validation.js +36 -42
  98. package/build/features/brand/screens/Verify/OTPInput.js +5 -3
  99. package/build/features/business/screens/Activities/ActivitiesList.d.ts +12 -17
  100. package/build/features/business/screens/Activities/ActivitiesList.js +5 -5
  101. package/build/features/business/screens/Activities/OperationStartDate.d.ts +2 -2
  102. package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
  103. package/build/features/business/screens/BusinessType/Article.d.ts +1 -1
  104. package/build/features/business/screens/BusinessType/LicenseList.js +1 -1
  105. package/build/features/business/screens/BusinessType/LicenseType.d.ts +5 -5
  106. package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -15
  107. package/build/features/business/screens/Customers/CustomerLocations.js +5 -5
  108. package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -2
  109. package/build/features/business/screens/Customers/ExpectedSalesRange.js +12 -2
  110. package/build/features/business/screens/Customers/RefundPolicy.d.ts +5 -5
  111. package/build/features/business/screens/IDBOD/DOB.js +1 -1
  112. package/build/features/business/screens/Verify/OTPInput.js +5 -3
  113. package/build/features/connect/screens/Individual/Email.js +1 -1
  114. package/build/features/connect/screens/Merchant/BrandList.js +1 -1
  115. package/build/features/connect/screens/Merchant/BrandName.js +1 -1
  116. package/build/features/connect/screens/Merchant/Segments.js +6 -1
  117. package/build/features/connect/screens/Merchant/TeamSize.js +6 -1
  118. package/build/features/connect/screens/Merchant/validation.js +5 -5
  119. package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
  120. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.d.ts +2 -1
  121. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +3 -3
  122. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +5 -3
  123. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.d.ts +2 -1
  124. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +7 -5
  125. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.d.ts +1 -1
  126. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +1 -1
  127. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +7 -6
  128. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +4 -2
  129. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +14 -1
  130. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +9 -10
  131. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +9 -5
  132. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.d.ts +2 -1
  133. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -3
  134. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.d.ts +1 -0
  135. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +6 -2
  136. package/build/features/connectExpress/screens/CollectIndividualInfo/Name.d.ts +2 -1
  137. package/build/features/connectExpress/screens/CollectIndividualInfo/Name.js +2 -2
  138. package/build/features/connectExpress/screens/Mobile/Mobile.js +4 -2
  139. package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +1 -0
  140. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +6 -2
  141. package/build/features/connectExpress/screens/Mobile/TAC.d.ts +2 -1
  142. package/build/features/connectExpress/screens/Mobile/TAC.js +3 -1
  143. package/build/features/connectExpress/screens/NID/DOB.d.ts +2 -1
  144. package/build/features/connectExpress/screens/NID/DOB.js +2 -2
  145. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  146. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  147. package/build/features/connectExpress/screens/NID/NID.js +4 -2
  148. package/build/features/connectExpress/screens/NID/TAC.d.ts +14 -1
  149. package/build/features/connectExpress/screens/NID/TAC.js +9 -10
  150. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +14 -18
  151. package/build/features/entity/screens/EntityCapital/ActivityList.js +20 -27
  152. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
  153. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +7 -3
  154. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
  155. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +7 -3
  156. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
  157. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +7 -3
  158. package/build/features/entity/screens/EntityCapital/EntityCapital.js +19 -17
  159. package/build/features/entity/screens/EntityCapital/validation.d.ts +10 -10
  160. package/build/features/entity/screens/EntityCapital/validation.js +4 -10
  161. package/build/features/entity/screens/EntityName/Article.d.ts +5 -2
  162. package/build/features/entity/screens/EntityName/Article.js +9 -6
  163. package/build/features/entity/screens/EntityName/EntityName.js +20 -5
  164. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +14 -18
  165. package/build/features/entity/screens/EntityName/EntityTypeList.js +24 -27
  166. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +4 -3
  167. package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
  168. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +4 -3
  169. package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
  170. package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
  171. package/build/features/entity/screens/EntityName/LegalName.js +8 -4
  172. package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
  173. package/build/features/entity/screens/EntityName/LicenseCertificate.js +8 -9
  174. package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
  175. package/build/features/entity/screens/EntityName/LicenseNumber.js +8 -5
  176. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
  177. package/build/features/entity/screens/EntityName/UnifiedNumber.js +8 -5
  178. package/build/features/entity/screens/EntityName/validation.d.ts +35 -35
  179. package/build/features/entity/screens/EntityName/validation.js +68 -93
  180. package/build/features/entity/screens/Verify/OTPInput.js +5 -3
  181. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
  182. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +25 -6
  183. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +7 -1
  184. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +21 -9
  185. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
  186. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +8 -6
  187. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
  188. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +25 -25
  189. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +2 -1
  190. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +25 -25
  191. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +6 -5
  192. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +8 -6
  193. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
  194. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +8 -2
  195. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
  196. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
  197. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
  198. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +8 -9
  199. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
  200. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +25 -25
  201. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +2 -2
  202. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +6 -11
  203. package/build/features/individual/screens/IndividualList/Email.js +1 -1
  204. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
  205. package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
  206. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
  207. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +12 -2
  208. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
  209. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +12 -2
  210. package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
  211. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +3 -3
  212. package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
  213. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  214. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
  215. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +4 -5
  216. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +7 -6
  217. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +4 -2
  218. package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
  219. package/build/features/individual/screens/IndividualPersonalInfo/ID.js +2 -7
  220. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
  221. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -4
  222. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
  223. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +13 -7
  224. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
  225. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +11 -10
  226. package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
  227. package/build/features/individual/screens/IndividualPersonalInfo/Name.js +2 -2
  228. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
  229. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +13 -7
  230. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
  231. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
  232. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +4 -2
  233. package/build/features/individual/screens/Verify/OTPInput.js +5 -3
  234. package/build/features/password/screens/Verify/OTPInput.js +5 -3
  235. package/build/features/shared/Address/CountryList.d.ts +9 -9
  236. package/build/features/shared/Address/CountryList.js +1 -1
  237. package/build/features/shared/Address/InputSelect.d.ts +9 -9
  238. package/build/features/shared/Address/InputSelect.js +2 -2
  239. package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
  240. package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
  241. package/build/features/shared/Button/FlowsButtons.js +15 -20
  242. package/build/features/shared/Button/IndividualActionButtons.d.ts +1 -1
  243. package/build/features/shared/Containers/FeatureContainer.d.ts +1 -1
  244. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  245. package/build/features/shared/GenericError/GenericError.js +1 -1
  246. package/build/features/shared/Input/Input.d.ts +3 -3
  247. package/build/features/shared/Input/Input.js +2 -3
  248. package/build/features/shared/OTP/OTP.d.ts +2 -1
  249. package/build/features/shared/OTP/OTP.js +2 -2
  250. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
  251. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +5 -4
  252. package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
  253. package/build/features/shared/SalesChannels/SalesChannel.js +5 -4
  254. package/build/features/shared/UploadFile/FileUpload.d.ts +6 -4
  255. package/build/features/shared/UploadFile/FileUpload.js +19 -15
  256. package/build/features/shared/UploadFile/UploadFile.d.ts +2 -2
  257. package/build/features/shared/UploadFile/UploadFile.js +7 -7
  258. package/build/features/shared/UploadFile/UploadWrapper.d.ts +5 -3
  259. package/build/features/shared/UploadFile/UploadWrapper.js +3 -2
  260. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +5 -4
  261. package/build/features/shared/UploadMultipleFile/UploadFile.js +14 -10
  262. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +4 -3
  263. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +3 -3
  264. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
  265. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +12 -12
  266. package/build/features/tax/screens/TaxDetails/TaxDetails.js +9 -4
  267. package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
  268. package/build/features/tax/screens/TaxDetails/TaxDocument.js +3 -8
  269. package/build/features/tax/screens/TaxDetails/VATId.d.ts +4 -1
  270. package/build/features/tax/screens/TaxDetails/VATId.js +5 -7
  271. package/build/features/tax/screens/TaxDetails/validation.d.ts +4 -4
  272. package/build/features/tax/screens/TaxDetails/validation.js +2 -5
  273. package/build/features/tax/screens/Verify/OTPInput.js +5 -3
  274. package/build/hooks/index.d.ts +3 -0
  275. package/build/hooks/index.js +3 -0
  276. package/build/hooks/useAppConfig.d.ts +1 -1
  277. package/build/hooks/useAppConfig.js +4 -2
  278. package/build/hooks/useDataNoneEditable.d.ts +2 -0
  279. package/build/hooks/useDataNoneEditable.js +19 -0
  280. package/build/hooks/useFormErrorAndUpdateReadOnly.d.ts +6 -0
  281. package/build/hooks/useFormErrorAndUpdateReadOnly.js +48 -0
  282. package/build/hooks/useFormReadOnly.d.ts +6 -0
  283. package/build/hooks/useFormReadOnly.js +40 -0
  284. package/build/utils/error.d.ts +1 -0
  285. package/build/utils/error.js +3 -0
  286. package/build/utils/object.d.ts +4 -0
  287. package/build/utils/object.js +17 -0
  288. package/build/utils/string.d.ts +1 -1
  289. package/build/utils/string.js +13 -7
  290. package/package.json +2 -2
  291. package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +0 -20
  292. package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
@@ -24,7 +24,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
24
24
  function verb(n) { return function (v) { return step([n, v]); }; }
25
25
  function step(op) {
26
26
  if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
27
+ while (_) try {
28
28
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
29
  if (y = 0, t) op = [op[0] & 2, t.value];
30
30
  switch (op[0]) {
@@ -71,14 +71,14 @@ import API from '../../../api';
71
71
  import { FlowsTypes, IndividualGender, IndividualType, DocumentPurpose } from '../../../@types';
72
72
  import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
73
73
  import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
74
- import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
74
+ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
75
75
  export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
76
76
  var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
77
77
  return __awaiter(void 0, void 0, void 0, function () {
78
- var payload, settings, data, boardData, individualData, countryCode, boardInfoData, boardInfoStatus, countries, board_id, board_info_id, notification, _b, id, type, data_1, info, hasIndividualCompleted, birthCountry;
79
- var _c, _d, _e, _f, _g, _h, _j, _k;
80
- return __generator(this, function (_l) {
81
- switch (_l.label) {
78
+ var payload, settings, data, boardData, individualData, countryCode, boardInfoData, countries, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry;
79
+ var _c, _d, _e, _f, _g, _h, _j;
80
+ return __generator(this, function (_k) {
81
+ switch (_k.label) {
82
82
  case 0:
83
83
  payload = {
84
84
  service_name: 'tap_email',
@@ -87,8 +87,8 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
87
87
  settings = thunkApi.getState().settings;
88
88
  return [4, API.leadService.verifyLeadToken(payload)];
89
89
  case 1:
90
- data = (_l.sent()).data;
91
- boardInfoStatus = undefined;
90
+ data = (_k.sent()).data;
91
+ boardInfoData = undefined;
92
92
  countries = settings.data.countries;
93
93
  if (((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
94
94
  throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
@@ -100,70 +100,61 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
100
100
  }
101
101
  if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
102
102
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
103
- return [3, 17];
103
+ return [3, 15];
104
104
  case 2:
105
- if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 16];
105
+ if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 14];
106
106
  board_id = data === null || data === void 0 ? void 0 : data.id;
107
107
  board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
108
108
  if (!(board_id && board_info_id)) return [3, 5];
109
109
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
110
110
  case 3:
111
- boardInfoData = _l.sent();
111
+ boardInfoData = _k.sent();
112
112
  notification = (boardInfoData || {}).notification;
113
113
  _b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
114
114
  if (!(id && type)) return [3, 5];
115
115
  return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
116
116
  case 4:
117
- data_1 = (_l.sent()).data;
117
+ data_1 = (_k.sent()).data;
118
118
  individualData = data_1 || {};
119
- _l.label = 5;
119
+ _k.label = 5;
120
120
  case 5:
121
- if (!board_id) return [3, 8];
121
+ if (!board_id) return [3, 7];
122
122
  return [4, API.boardService.retrieveBoardDetails(board_id)];
123
123
  case 6:
124
- boardData = _l.sent();
125
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
124
+ boardData = _k.sent();
125
+ _k.label = 7;
126
126
  case 7:
127
- boardInfoStatus = _l.sent();
128
- _l.label = 8;
129
- case 8:
130
127
  if (!countryCode) {
131
128
  countryCode = (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.country;
132
129
  if (countryCode)
133
130
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
134
131
  }
135
- info = (boardInfoStatus || {}).info;
136
- hasIndividualCompleted = ((_e = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _e === void 0 ? void 0 : _e.status) === 'completed';
137
- if (!hasIndividualCompleted) return [3, 9];
138
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
139
- return [3, 15];
132
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
133
+ if (!((_e = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _e === void 0 ? void 0 : _e.id)) return [3, 9];
134
+ return [4, thunkApi.dispatch(getIndividualList((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id))];
135
+ case 8:
136
+ _k.sent();
137
+ _k.label = 9;
140
138
  case 9:
141
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 12];
142
- if (!((_f = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _f === void 0 ? void 0 : _f.id)) return [3, 11];
143
- return [4, thunkApi.dispatch(getIndividualList((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id))];
139
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
140
+ return [3, 13];
144
141
  case 10:
145
- _l.sent();
146
- _l.label = 11;
142
+ birthCountry = ((_g = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _g === void 0 ? void 0 : _g.country) || countryCode;
143
+ if (!birthCountry) return [3, 12];
144
+ return [4, thunkApi.dispatch(getCityList(birthCountry))];
147
145
  case 11:
148
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
149
- return [3, 15];
146
+ _k.sent();
147
+ _k.label = 12;
150
148
  case 12:
151
- birthCountry = ((_h = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _h === void 0 ? void 0 : _h.country) || countryCode;
152
- if (!birthCountry) return [3, 14];
153
- return [4, thunkApi.dispatch(getCityList(birthCountry))];
154
- case 13:
155
- _l.sent();
156
- _l.label = 14;
149
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
150
+ _k.label = 13;
151
+ case 13: return [3, 15];
157
152
  case 14:
158
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
159
- _l.label = 15;
160
- case 15: return [3, 17];
161
- case 16:
162
153
  if (isUpdatePhoneInfo) {
163
154
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
164
155
  }
165
- _l.label = 17;
166
- case 17: return [2, {
156
+ _k.label = 15;
157
+ case 15: return [2, {
167
158
  data: data,
168
159
  boardResponse: {
169
160
  brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
@@ -171,14 +162,13 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
171
162
  entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
172
163
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
173
164
  merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
174
- name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
175
- contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
165
+ name: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.names,
166
+ contact: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.contact,
176
167
  individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
177
168
  countries: countries,
178
169
  countryCode: countryCode,
179
170
  notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
180
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
181
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
171
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business
182
172
  },
183
173
  token: token
184
174
  }];
@@ -411,10 +401,10 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetai
411
401
  });
412
402
  }); });
413
403
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
414
- var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, boardInfoStatus, countryCode, notification, _c, id, type, data_3, info, hasIndividualCompleted, birthCountry;
415
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
416
- return __generator(this, function (_q) {
417
- switch (_q.label) {
404
+ var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, boardInfoData, individualData, boardData, countryCode, notification, _c, id, type, data_3, birthCountry;
405
+ var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
406
+ return __generator(this, function (_p) {
407
+ switch (_p.label) {
418
408
  case 0:
419
409
  _a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
420
410
  responseBody = individual.data.verify.responseBody;
@@ -429,62 +419,53 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
429
419
  };
430
420
  return [4, API.leadService.verifyLeadOTP(payload)];
431
421
  case 1:
432
- data = (_q.sent()).data;
433
- boardInfoStatus = undefined;
422
+ data = (_p.sent()).data;
423
+ boardData = undefined;
434
424
  if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
435
425
  throw new Error(data.errors[0].description);
436
- if (!board_id) return [3, 4];
426
+ if (!board_id) return [3, 3];
437
427
  return [4, API.boardService.retrieveBoardDetails(board_id)];
438
428
  case 2:
439
- boardData = _q.sent();
440
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
429
+ boardData = _p.sent();
430
+ _p.label = 3;
441
431
  case 3:
442
- boardInfoStatus = _q.sent();
443
- _q.label = 4;
444
- case 4:
445
432
  countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
446
- if (!(board_id && board_info_id)) return [3, 7];
433
+ if (!(board_id && board_info_id)) return [3, 6];
447
434
  return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
448
- case 5:
449
- boardInfoData = _q.sent();
435
+ case 4:
436
+ boardInfoData = _p.sent();
450
437
  notification = (boardInfoData || {}).notification;
451
438
  _c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
452
- if (!(id && type)) return [3, 7];
439
+ if (!(id && type)) return [3, 6];
453
440
  return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
454
- case 6:
455
- data_3 = (_q.sent()).data;
441
+ case 5:
442
+ data_3 = (_p.sent()).data;
456
443
  individualData = data_3 || {};
457
- _q.label = 7;
458
- case 7:
444
+ _p.label = 6;
445
+ case 6:
459
446
  if (countryCode)
460
447
  thunkApi.dispatch(handleSetCountryByIso2(countryCode));
461
- info = (boardInfoStatus || {}).info;
462
- hasIndividualCompleted = ((_g = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'individual'; })) === null || _g === void 0 ? void 0 : _g.status) === 'completed';
463
- if (!hasIndividualCompleted) return [3, 8];
464
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
465
- return [3, 14];
448
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 9];
449
+ if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 8];
450
+ return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id))];
451
+ case 7:
452
+ _p.sent();
453
+ _p.label = 8;
466
454
  case 8:
467
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 11];
468
- if (!((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)) return [3, 10];
469
- return [4, thunkApi.dispatch(getIndividualList((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id))];
455
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
456
+ return [3, 12];
470
457
  case 9:
471
- _q.sent();
472
- _q.label = 10;
458
+ birthCountry = ((_j = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _j === void 0 ? void 0 : _j.country) || countryCode;
459
+ if (!birthCountry) return [3, 11];
460
+ return [4, thunkApi.dispatch(getCityList(birthCountry))];
473
461
  case 10:
474
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
475
- return [3, 14];
462
+ _p.sent();
463
+ _p.label = 11;
476
464
  case 11:
477
- birthCountry = ((_k = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _k === void 0 ? void 0 : _k.country) || countryCode;
478
- if (!birthCountry) return [3, 13];
479
- return [4, thunkApi.dispatch(getCityList(birthCountry))];
465
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
466
+ _p.label = 12;
480
467
  case 12:
481
- _q.sent();
482
- _q.label = 13;
483
- case 13:
484
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
485
- _q.label = 14;
486
- case 14:
487
- (_m = (_l = settings.data.appConfig).onStepCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, settings.data.activeScreen.name, { otp: params.otp });
468
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, { otp: params.otp });
488
469
  return [2, {
489
470
  data: data,
490
471
  boardResponse: {
@@ -493,14 +474,13 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
493
474
  entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
494
475
  merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
495
476
  merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
496
- name: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.names,
497
- contact: (_p = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _p === void 0 ? void 0 : _p.contact,
477
+ name: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.names,
478
+ contact: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.contact,
498
479
  individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
499
480
  countries: countries,
500
481
  countryCode: countryCode,
501
482
  notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
502
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
503
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
483
+ business: boardData === null || boardData === void 0 ? void 0 : boardData.business
504
484
  },
505
485
  formData: __assign({}, params)
506
486
  }];
@@ -538,10 +518,10 @@ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', func
538
518
  });
539
519
  }); });
540
520
  export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
541
- var _a, settings, individual, _b, notification, user, entity, _c, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isNameEditable, isEmailEditable, isMobileNumberEditable, isMobileCountryEditable, isNidEditable, isIssuedCountryEditable, isExpiryEditable, isIdTypeEditable, isNationalityEditable, hasContact, hasPhone, hasIdentification, hasBirth, names, contact, requestBody, data;
542
- var _d, _e, _f, _g;
543
- return __generator(this, function (_h) {
544
- switch (_h.label) {
521
+ var _a, settings, individual, _b, notification, user, entity, _c, id, type, name, email, mobile, countryCode, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isNameNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, contact, requestBody, data;
522
+ var _d, _e, _f, _g, _h, _j;
523
+ return __generator(this, function (_k) {
524
+ switch (_k.label) {
545
525
  case 0:
546
526
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
547
527
  _b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user, entity = _b.entity;
@@ -551,57 +531,52 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
551
531
  data_status = (user || {}).data_status;
552
532
  userName = getUserNameObject(name);
553
533
  identification_id_type = nid && (nid === null || nid === void 0 ? void 0 : nid.startsWith('1')) ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
554
- isNameEditable = true;
555
- isEmailEditable = true;
556
- isMobileNumberEditable = true;
557
- isMobileCountryEditable = true;
558
- isNidEditable = true;
559
- isIssuedCountryEditable = true;
560
- isExpiryEditable = true;
561
- isIdTypeEditable = true;
562
- isNationalityEditable = true;
534
+ isNameNonEditable = hasNoneEditableValue(data_status, 'name');
535
+ isEmailNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.contact, 'email');
536
+ isMobileNumberNonEditable = hasNoneEditableValue((_d = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _d === void 0 ? void 0 : _d.phone, 'number');
537
+ isMobileCountryNonEditable = hasNoneEditableValue((_e = data_status === null || data_status === void 0 ? void 0 : data_status.contact) === null || _e === void 0 ? void 0 : _e.phone, 'country_code');
538
+ isNidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'id');
539
+ isIssuedCountryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'issuer_country');
540
+ isExpiryNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'expiry');
541
+ isIdTypeNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.identification, 'type');
542
+ isNationalityNonEditable = hasNoneEditableValue(data_status, 'nationality');
543
+ isDOBNonEditable = hasNoneEditableValue(data_status, 'birth.date');
544
+ isBirthCityNonEditable = hasNoneEditableValue(data_status, 'birth.city');
545
+ isBirthCountryNonEditable = hasNoneEditableValue(data_status, 'birth.country');
563
546
  hasContact = email || mobile || countryCode;
564
547
  hasPhone = mobile && (countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix);
565
548
  hasIdentification = nid || issuedCountry || identification_id_type || expiryDate;
566
549
  hasBirth = placeOfBirthCity || placeOfBirthCountry;
567
- names = isNameEditable
568
- ? {
550
+ contact = hasContact && !(isEmailNonEditable && isMobileCountryNonEditable && isMobileNumberNonEditable)
551
+ ? __assign({ email: isEmailNonEditable ? undefined : email }, (!((isMobileCountryNonEditable && isMobileNumberNonEditable) || !hasPhone) && {
552
+ phone: {
553
+ country_code: isMobileCountryNonEditable ? undefined : (_f = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _f === void 0 ? void 0 : _f.toString(),
554
+ number: isMobileNumberNonEditable || !mobile ? undefined : mobile
555
+ }
556
+ })) : undefined;
557
+ requestBody = __assign(__assign(__assign(__assign(__assign(__assign(__assign({ id: id, type: type, gender: gender || undefined }, (!(isNameNonEditable || !userName.first) && {
558
+ names: {
569
559
  en: userName,
570
560
  ar: userName
571
561
  }
572
- : undefined;
573
- contact = hasContact
574
- ? {
575
- email: isEmailEditable ? email : undefined,
576
- phone: hasPhone
577
- ? {
578
- country_code: isMobileCountryEditable ? (_d = countryCode === null || countryCode === void 0 ? void 0 : countryCode.idd_prefix) === null || _d === void 0 ? void 0 : _d.toString() : undefined,
579
- number: isMobileNumberEditable ? mobile : undefined
580
- }
581
- : undefined
562
+ })), { contact: contact }), (hasIdentification &&
563
+ !(isNidNonEditable && isIssuedCountryNonEditable && isExpiryNonEditable && isIdTypeNonEditable) && {
564
+ identification: {
565
+ id: isNidNonEditable || !nid ? undefined : nid,
566
+ issued_country_code: isIssuedCountryNonEditable ? undefined : issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2,
567
+ expiry: isExpiryNonEditable || !expiryDate ? undefined : new Date(expiryDate).getTime(),
568
+ type: isIdTypeNonEditable || !identification_id_type ? undefined : identification_id_type
582
569
  }
583
- : undefined;
584
- requestBody = {
585
- id: id,
586
- type: type,
587
- names: names,
588
- gender: gender || undefined,
589
- contact: contact,
590
- identification: hasIdentification
591
- ? {
592
- id: isNidEditable ? nid : undefined,
593
- issued_country_code: isIssuedCountryEditable ? issuedCountry === null || issuedCountry === void 0 ? void 0 : issuedCountry.iso2 : undefined,
594
- expiry: isExpiryEditable ? new Date(expiryDate).getTime() : undefined,
595
- type: isIdTypeEditable ? identification_id_type : undefined
596
- }
597
- : undefined,
598
- date_of_birth: dob,
599
- birth: hasBirth && {
600
- city: (_e = placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.name) === null || _e === void 0 ? void 0 : _e.en,
601
- country: placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
602
- },
603
- nationality: isNationalityEditable ? nationality === null || nationality === void 0 ? void 0 : nationality.iso2 : undefined,
604
- encryption_contract: [
570
+ })), (!isDOBNonEditable && {
571
+ date_of_birth: dob
572
+ })), (!((isBirthCityNonEditable && isBirthCountryNonEditable) || !hasBirth) && {
573
+ birth: {
574
+ city: isBirthCityNonEditable ? undefined : (_g = placeOfBirthCity === null || placeOfBirthCity === void 0 ? void 0 : placeOfBirthCity.name) === null || _g === void 0 ? void 0 : _g.en,
575
+ country: isBirthCountryNonEditable ? undefined : placeOfBirthCountry === null || placeOfBirthCountry === void 0 ? void 0 : placeOfBirthCountry.iso2
576
+ }
577
+ })), (!isNationalityNonEditable && {
578
+ nationality: nationality === null || nationality === void 0 ? void 0 : nationality.iso2
579
+ })), { encryption_contract: [
605
580
  'gender',
606
581
  'contact.email',
607
582
  'contact.phone.country_code',
@@ -614,26 +589,24 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
614
589
  'birth.country',
615
590
  'date_of_birth',
616
591
  'nationality'
617
- ],
618
- step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO
619
- };
592
+ ], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
620
593
  return [4, API.individualService.updateIndividual(requestBody)];
621
594
  case 1:
622
- data = (_h.sent()).data;
595
+ data = _k.sent();
623
596
  if (!(type === IndividualType.USER || type === IndividualType.BUYER)) return [3, 3];
624
597
  return [4, thunkApi.dispatch(retrieveDataList(code))];
625
598
  case 2:
626
- _h.sent();
627
- _h.label = 3;
599
+ _k.sent();
600
+ _k.label = 3;
628
601
  case 3:
629
- thunkApi.dispatch(handleNextScreenStep());
630
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
602
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
603
+ (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, requestBody);
631
604
  return [2, { data: data, formData: params }];
632
605
  }
633
606
  });
634
607
  }); });
635
608
  export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
636
- var _a, settings, individual, _b, notification, user, _c, id, type, civilID, signatureFileId, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, isOccupationEditable, isSourceIncomeEditable, isPEPEditable, isInfluencerEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data;
609
+ var _a, settings, individual, _b, notification, user, _c, id, type, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, payload, requestBody, data, civilID, signatureFileId, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody;
637
610
  var _d, _e;
638
611
  return __generator(this, function (_f) {
639
612
  switch (_f.label) {
@@ -641,60 +614,18 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
641
614
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
642
615
  _b = individual.data.verify.responseBody || {}, notification = _b.notification, user = _b.user;
643
616
  _c = ((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
644
- civilID = params.civilID, signatureFileId = params.signatureFileId;
645
- businessCountry = settings.data.businessCountry;
646
- hasCivilIdDocument = (civilID || []).length > 0;
647
- hasSignatureDocument = (signatureFileId || []).length > 0;
648
- isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
649
- civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
650
- signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
651
- if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 2];
652
- documentBody = {
653
- id: civilIdDocument.id,
654
- images: civilID
655
- };
656
- return [4, API.documentService.addFilesToExistingDocument(documentBody)];
657
- case 1:
658
- _f.sent();
659
- _f.label = 2;
660
- case 2:
661
- if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 4];
662
- documentBody = {
663
- id: signatureDocument.id,
664
- images: signatureFileId
665
- };
666
- return [4, API.documentService.addFilesToExistingDocument(documentBody)];
667
- case 3:
668
- _f.sent();
669
- _f.label = 4;
670
- case 4:
671
- documentsList = [];
672
- if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
673
- documentsList.push({ type: 'Civil ID File', images: civilID });
674
- if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
675
- documentsList.push({ type: 'Signature File', images: signatureFileId });
676
- if (!(documentsList.length > 0)) return [3, 6];
677
- documentBody = {
678
- individual_type_id: id || '',
679
- country: businessCountry.iso2,
680
- documents: documentsList
681
- };
682
- return [4, API.documentService.updateDocumentInfo(documentBody)];
683
- case 5:
684
- _f.sent();
685
- _f.label = 6;
686
- case 6:
687
617
  occupation = params.occupation, sourceIncome = params.sourceIncome, monthlyIncome = params.monthlyIncome, isPEP = params.isPEP, isInfluencer = params.isInfluencer, shareCount = params.shareCount, shareValue = params.shareValue;
688
- isOccupationEditable = true;
689
- isSourceIncomeEditable = true;
690
- isPEPEditable = true;
691
- isInfluencerEditable = true;
618
+ isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
619
+ isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
620
+ isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
621
+ isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
622
+ isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
692
623
  isSharesAvailable = shareCount || shareValue;
693
- pepInfo = isPEPEditable ? isPEP : undefined;
694
- influencerInfo = isInfluencerEditable ? isInfluencer : undefined;
695
- occupationInfo = isOccupationEditable ? (occupation === null || occupation === void 0 ? void 0 : occupation.id) && { id: occupation.id } : undefined;
696
- sourceIncomeInfo = isSourceIncomeEditable ? (sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) && [{ id: sourceIncome.id }] : undefined;
697
- monthlyIncomeInfo = (monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) && { id: monthlyIncome.id };
624
+ pepInfo = isPEPNonEditable ? undefined : isPEP;
625
+ influencerInfo = isInfluencerNonEditable ? undefined : isInfluencer;
626
+ occupationInfo = isOccupationNonEditable || !(occupation === null || occupation === void 0 ? void 0 : occupation.id) ? undefined : { id: occupation.id };
627
+ sourceIncomeInfo = isSourceIncomeNonEditable || !(sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.id) ? undefined : [{ id: sourceIncome.id }];
628
+ monthlyIncomeInfo = isMonthlyIncomeNonEditable || !(monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome.id) ? undefined : { id: monthlyIncome.id };
698
629
  userPayload = {
699
630
  occupation: occupationInfo,
700
631
  source_income: sourceIncomeInfo,
@@ -730,8 +661,51 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
730
661
  payload = {};
731
662
  requestBody = __assign(__assign({ id: id, type: type }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
732
663
  return [4, API.individualService.updateIndividual(requestBody)];
664
+ case 1:
665
+ data = _f.sent();
666
+ civilID = params.civilID, signatureFileId = params.signatureFileId;
667
+ businessCountry = settings.data.businessCountry;
668
+ hasCivilIdDocument = (civilID || []).length > 0;
669
+ hasSignatureDocument = (signatureFileId || []).length > 0;
670
+ isSendSignatureFile = (user === null || user === void 0 ? void 0 : user.is_authorized) && (type === IndividualType.USER || type === IndividualType.BUYER);
671
+ civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
672
+ signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
673
+ if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 3];
674
+ documentBody = {
675
+ id: civilIdDocument.id,
676
+ images: civilID
677
+ };
678
+ return [4, API.documentService.addFilesToExistingDocument(documentBody)];
679
+ case 2:
680
+ _f.sent();
681
+ _f.label = 3;
682
+ case 3:
683
+ if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 5];
684
+ documentBody = {
685
+ id: signatureDocument.id,
686
+ images: signatureFileId
687
+ };
688
+ return [4, API.documentService.addFilesToExistingDocument(documentBody)];
689
+ case 4:
690
+ _f.sent();
691
+ _f.label = 5;
692
+ case 5:
693
+ documentsList = [];
694
+ if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
695
+ documentsList.push({ type: DocumentPurpose.IDENTITY_DOCUMENT, images: civilID });
696
+ if (isSendSignatureFile && hasSignatureDocument && !(signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id))
697
+ documentsList.push({ type: DocumentPurpose.CUSTOMER_SIGNATURE, images: signatureFileId });
698
+ if (!(documentsList.length > 0)) return [3, 7];
699
+ documentBody = {
700
+ individual_type_id: id || '',
701
+ country: businessCountry.iso2,
702
+ documents: documentsList
703
+ };
704
+ return [4, API.documentService.updateDocumentInfo(documentBody)];
705
+ case 6:
706
+ _f.sent();
707
+ _f.label = 7;
733
708
  case 7:
734
- data = (_f.sent()).data;
735
709
  thunkApi.dispatch(handleNextScreenStep());
736
710
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
737
711
  return [2, { data: data, formData: params }];