@adyen/kyc-components 4.0.0-beta.1 → 4.0.0-beta.3

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 (346) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-BQ4Yct7L.js → AcceptTermsOfServiceComponent-i222mdxX.js} +53 -49
  2. package/dist/{AccountSetupRejected-UVhxMcAe.js → AccountSetupRejected-DHph9lFl.js} +6 -6
  3. package/dist/{Avatar-NEiNEcRx.js → Avatar-vCjWXfC7.js} +2 -2
  4. package/dist/{BusinessDetailsDropin-l0xfPekL.js → BusinessDetailsDropin-DQcfiSR8.js} +333 -287
  5. package/dist/{BusinessFinancingComponent-Bs-poF2d.js → BusinessFinancingComponent-DC3jzBrq.js} +3 -3
  6. package/dist/{BusinessFinancingDropin-DoRzdS4n.js → BusinessFinancingDropin-D2lMEbNh.js} +161 -264
  7. package/dist/{BusinessFinancingPage-DSlmJmOK.js → BusinessFinancingPage-BPD2cSDR.js} +3 -3
  8. package/dist/{BusinessTypeSelectionPage-Bmi_8K2g.js → BusinessTypeSelectionPage-Cdp8joPJ.js} +82 -87
  9. package/dist/{CZ-BhoS6sd6.js → CZ-BiPeoA9G.js} +11 -1
  10. package/dist/{ContractViewer-R4-gfVmp.js → ContractViewer-B0bZ14Ts.js} +305 -296
  11. package/dist/{CreateIndividualComponent-D3aXuYRk.js → CreateIndividualComponent-D9wnexv4.js} +7 -7
  12. package/dist/{CreateTransferInstrumentComponent-C-ncZ-A8.js → CreateTransferInstrumentComponent-COzPdQjC.js} +4 -4
  13. package/dist/{CustomerSupport-CMFRgQNa.js → CustomerSupport-NGBoBg3N.js} +27 -32
  14. package/dist/{DebugModal-BEmhG3UP.js → DebugModal-I2U6TjGT.js} +43 -35
  15. package/dist/{DecisionMakerDetailsPage-DI2Ubmef.js → DecisionMakerDetailsPage-BN-H1sJF.js} +3 -3
  16. package/dist/{DecisionMakers-BKhtcs_K.js → DecisionMakers-CZ5-IRtU.js} +128 -23
  17. package/dist/{EmbeddedStatus-BsZsXbKc.js → EmbeddedStatus-Blr0seRl.js} +6 -6
  18. package/dist/FormEndState-JB6QFSet.js +59 -0
  19. package/dist/{FormFlow-Bt-mu4Wm.js → FormFlow-DjvdNEiV.js} +18 -19
  20. package/dist/{HU-v3vOxRm8.js → HU-D8vJYkDH.js} +10 -1
  21. package/dist/{IndividualOnfidoDropin-DGMCOm9M.js → IndividualOnfidoDropin-DHhyO2ai.js} +732 -739
  22. package/dist/{Introduction-DJ6qIUPC.js → Introduction-erRXgreE.js} +32 -34
  23. package/dist/LandingLayout-B45lEjOv.js +84 -0
  24. package/dist/{LegalRepresentativeDetailsPage-CyHwQR_W.js → LegalRepresentativeDetailsPage-rS5K4657.js} +3 -3
  25. package/dist/{ManageIndividualComponent-BIMCvcr2.js → ManageIndividualComponent-BEzE5lkX.js} +8 -12
  26. package/dist/{ManagePCIComponent-Blj60xLa.js → ManagePCIComponent-BgdGfAuT.js} +5 -5
  27. package/dist/{ManageTermsOfServiceComponent-CsM23jq3.js → ManageTermsOfServiceComponent-BWkwy6YC.js} +7 -8
  28. package/dist/{ManageTransferInstrumentComponent-Vut9_bRn.js → ManageTransferInstrumentComponent-B8kRNftW.js} +21 -29
  29. package/dist/{OnboardingDropinComponent-BW6er2HU.js → OnboardingDropinComponent-DBW5N3Dr.js} +243 -281
  30. package/dist/{ProviderButton-DAsW5EVa.js → ProviderButton-B58n0cRC.js} +12 -13
  31. package/dist/{Review-DWDbL9-9.js → Review-O6Al47Cu.js} +11 -11
  32. package/dist/{RootBusinessDetailsPage-BTYIldSf.js → RootBusinessDetailsPage-q_6wAcer.js} +3 -3
  33. package/dist/{RootIndividualDetailsPage-DCxJ3ycQ.js → RootIndividualDetailsPage-CiXgSJsV.js} +3 -3
  34. package/dist/{SignPCIComponent-kHaxhkWa.js → SignPCIComponent-cqRNhGdl.js} +17 -19
  35. package/dist/{SingpassSelection-Dmlbiq4Z.js → SingpassSelection-BWEJ3Yi-.js} +6 -9
  36. package/dist/{SoleProprietorshipPage-Bdhs90-q.js → SoleProprietorshipPage-CRcJSpn9.js} +3 -3
  37. package/dist/{SourceOfFundsPage-Bj22DAFv.js → SourceOfFundsPage-BxLGXTHb.js} +500 -481
  38. package/dist/{StoreProvider-BmzY19Td.js → StoreProvider-ClKLaHzy.js} +8753 -10118
  39. package/dist/{TaskItemStatus-CB6FEOnk.js → TaskItemStatus-DrTIwCTx.js} +14 -14
  40. package/dist/TaskStatusIndicator-CTtKjo0m.js +69 -0
  41. package/dist/{TaxReportingDropin-jofokkei.js → TaxReportingDropin-DFZ2ehfk.js} +82 -101
  42. package/dist/{TileGroup-i5Jc08ns.js → TileGroup-BtE472I1.js} +6 -8
  43. package/dist/{TrustDetailsPage-B6HmvYUf.js → TrustDetailsPage-CGiiTbfR.js} +71 -73
  44. package/dist/{TrustMemberCompanyPage-D3VJOq6a.js → TrustMemberCompanyPage-oLNhg0hg.js} +4 -4
  45. package/dist/{TrustMemberIndividualPage-1aeOYsnG.js → TrustMemberIndividualPage-Bgsis586.js} +3 -3
  46. package/dist/{UnincorporatedPartnershipIndividualPage-Bt7e6ncF.js → UnincorporatedPartnershipIndividualPage-DPE3grqL.js} +3 -3
  47. package/dist/{UnincorporatedPartnershipMemberCompanyPage-Ck5C_SEU.js → UnincorporatedPartnershipMemberCompanyPage-HUnc9g0g.js} +3 -3
  48. package/dist/{VerificationErrorAlert-DhtKOmjt.js → VerificationErrorAlert-BBdJmGJu.js} +10 -8
  49. package/dist/{ViewVerificationStatusComponent-DtKLcCGI.js → ViewVerificationStatusComponent-DDtXG_pM.js} +12 -13
  50. package/dist/adyen-business-financing.js +8 -12
  51. package/dist/adyen-individual.js +6 -4
  52. package/dist/adyen-kyc-components.js +135 -118
  53. package/dist/adyen-manage-individual.js +2 -2
  54. package/dist/adyen-manage-pci.js +2 -2
  55. package/dist/adyen-manage-terms-of-service.js +2 -2
  56. package/dist/adyen-manage-transfer-instruments.js +2 -2
  57. package/dist/adyen-onboarding.js +14 -6
  58. package/dist/adyen-sign-pci.js +8 -15
  59. package/dist/adyen-terms-of-service.js +18 -6
  60. package/dist/adyen-transfer-instrument.js +10 -6
  61. package/dist/{adyen-transfer-instrument.vue_vue_type_script_lang-BE-ro1iH.js → adyen-transfer-instrument.vue_vue_type_script_lang-DQBzahGy.js} +5 -1
  62. package/dist/adyen-verification-status.js +2 -2
  63. package/dist/bg-BG-BY3Wa361.js +54 -0
  64. package/dist/bg-BG-BvSUDgGF.js +13 -0
  65. package/dist/bg-BG-HpLj_LOM.js +16 -0
  66. package/dist/cs-CZ-BEFeaKsV.js +54 -0
  67. package/dist/cs-CZ-CQ_M3lEp.js +16 -0
  68. package/dist/cs-CZ-y4mvq4Lv.js +13 -0
  69. package/dist/{css-CQUoQdd2.js → css-BJGWcW8A.js} +2 -2
  70. package/dist/da-DK-D6UK8XT9.js +54 -0
  71. package/dist/da-DK-k4JW3iVF.js +16 -0
  72. package/dist/da-DK-qgQOVjDp.js +13 -0
  73. package/dist/de-DE-B3nctkG8.js +13 -0
  74. package/dist/de-DE-C7mjtS5w.js +16 -0
  75. package/dist/de-DE-DUl6gRKv.js +54 -0
  76. package/dist/de-DE-pSdsxBpQ.js +13 -0
  77. package/dist/decision-makers-group-CgddXgrx.js +1944 -0
  78. package/dist/el-GR-B5j7VZ3E.js +54 -0
  79. package/dist/el-GR-Bvjk5Sw8.js +13 -0
  80. package/dist/el-GR-CEQrkYHW.js +16 -0
  81. package/dist/el-GR-CdgLZhuO.js +13 -0
  82. package/dist/en-US-Bq2Twy6x.js +54 -0
  83. package/dist/en-US-DDagIr01.js +16 -0
  84. package/dist/en-US-DSoLr6rp.js +13 -0
  85. package/dist/es-ES-BRfK6tX7.js +13 -0
  86. package/dist/es-ES-Cavm0szq.js +54 -0
  87. package/dist/es-ES-DB1c74Kv.js +16 -0
  88. package/dist/es-ES-Dy1uR2H_.js +13 -0
  89. package/dist/et-EE-DUWZ2Vqm.js +54 -0
  90. package/dist/et-EE-d9V24rcf.js +13 -0
  91. package/dist/et-EE-xIegUSuv.js +16 -0
  92. package/dist/fi-FI-B0fnAFV2.js +13 -0
  93. package/dist/fi-FI-DVa-ccaW.js +54 -0
  94. package/dist/fi-FI-NCxneAqU.js +16 -0
  95. package/dist/fr-FR-BoKzVp2q.js +13 -0
  96. package/dist/fr-FR-CY9emHgF.js +54 -0
  97. package/dist/fr-FR-Dk6Lw2On.js +13 -0
  98. package/dist/fr-FR-daiUnUwo.js +16 -0
  99. package/dist/{getFieldsWithExistingData-BW8_TEQl.js → getFieldsWithExistingData-BY--eXBQ.js} +3 -4
  100. package/dist/{hasDataChanged-Mu0HyZ3E.js → hasDataChanged-CwfuS4et.js} +4 -4
  101. package/dist/hr-HR-BAUywqDj.js +16 -0
  102. package/dist/hr-HR-CF0AHQzi.js +13 -0
  103. package/dist/hr-HR-CnP5sqih.js +54 -0
  104. package/dist/hu-HU-3GQojIHR.js +16 -0
  105. package/dist/hu-HU-BTlpbCpc.js +54 -0
  106. package/dist/hu-HU-CSPhOvLC.js +13 -0
  107. package/dist/it-IT-BH-eqIKH.js +13 -0
  108. package/dist/it-IT-D7G4BaP7.js +13 -0
  109. package/dist/it-IT-GgHc0cHR.js +54 -0
  110. package/dist/it-IT-pDWPFHEh.js +16 -0
  111. package/dist/ja-JP-B3yqM_FM.js +13 -0
  112. package/dist/ja-JP-BhS-_dIx.js +54 -0
  113. package/dist/ja-JP-DTW_hY1L.js +13 -0
  114. package/dist/ja-JP-scPXJ93L.js +16 -0
  115. package/dist/{json-DWikzB4g.js → json-Dk6RRAV8.js} +2 -2
  116. package/dist/{localizeDateString-QtCjf8Fg.js → localizeDateString-CKCBXzSn.js} +6 -6
  117. package/dist/lt-LT-BcGNy8Ti.js +16 -0
  118. package/dist/lt-LT-DTQGR9M0.js +54 -0
  119. package/dist/lt-LT-Lzl_Cbw-.js +13 -0
  120. package/dist/lv-LV-BQ4F1GrV.js +54 -0
  121. package/dist/lv-LV-CBD07r1Y.js +16 -0
  122. package/dist/lv-LV-y00wN1pj.js +13 -0
  123. package/dist/{mapFinancialReportsToFinancialInformation-C-2jp0wg.js → mapFinancialReportsToFinancialInformation-D_6u_bSS.js} +19 -12
  124. package/dist/minus-circle-filled-BGKeHaxJ.js +17 -0
  125. package/dist/nl-NL-BxJUDHMK.js +16 -0
  126. package/dist/nl-NL-CFzm75Jw.js +13 -0
  127. package/dist/nl-NL-CUcML482.js +54 -0
  128. package/dist/nl-NL-DmnFXAQC.js +13 -0
  129. package/dist/no-NO-BBCvsecq.js +54 -0
  130. package/dist/no-NO-DbvFfP96.js +13 -0
  131. package/dist/no-NO-Drup6Jyy.js +16 -0
  132. package/dist/pl-PL--mmxopYA.js +13 -0
  133. package/dist/pl-PL-BXv8Mmzb.js +16 -0
  134. package/dist/pl-PL-kGaeUP-w.js +54 -0
  135. package/dist/{plaintext-B39yQnOr.js → plaintext-9WNCwUtz.js} +2 -2
  136. package/dist/plus-circle-filled-Cnf1oJTm.js +17 -0
  137. package/dist/preact/adyen-transfer-instrument.js +1 -1
  138. package/dist/pt-PT-BVzXBFp7.js +13 -0
  139. package/dist/pt-PT-D8nU-UM2.js +16 -0
  140. package/dist/pt-PT-DpDxAynk.js +13 -0
  141. package/dist/pt-PT-JVqqgvPs.js +54 -0
  142. package/dist/{resolveEnvironment-Dx0BPNMa.js → resolveEnvironment-DQH1ab0S.js} +3 -3
  143. package/dist/ro-RO-C83h2zHZ.js +54 -0
  144. package/dist/ro-RO-CG33OwqS.js +16 -0
  145. package/dist/ro-RO-Cdmevo9A.js +13 -0
  146. package/dist/ru-RU-FZb2upqh.js +13 -0
  147. package/dist/{rules-CUANHpja.js → rules-CCnLDGvk.js} +43 -70
  148. package/dist/sk-SK-CgLJIuJw.js +54 -0
  149. package/dist/sk-SK-DV_xkO69.js +16 -0
  150. package/dist/sk-SK-nfeuTcY5.js +13 -0
  151. package/dist/sl-SI-B5yeoadY.js +16 -0
  152. package/dist/sl-SI-BzeVaC1Z.js +54 -0
  153. package/dist/sl-SI-DUTZDqkP.js +13 -0
  154. package/dist/style.css +417 -605
  155. package/dist/styles-CLV89_hH.js +417 -605
  156. package/dist/sv-SE-BTx2XKAp.js +13 -0
  157. package/dist/sv-SE-CVmo11gI.js +54 -0
  158. package/dist/sv-SE-CfxyR53r.js +16 -0
  159. package/dist/sv-SE-rckxD-43.js +13 -0
  160. package/dist/types/api/companySelection/useCompanySelection.d.ts +18 -1
  161. package/dist/types/api/configurations/useScenarios.d.ts +6 -6
  162. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +1 -0
  163. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +0 -306
  164. package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +2 -1
  165. package/dist/types/components/Business/forms/BasicInformation/types.d.ts +2 -1
  166. package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +1 -1
  167. package/dist/types/components/Business/forms/rules.d.ts +1 -0
  168. package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsFormConfig.d.ts +1 -2
  169. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +0 -3
  170. package/dist/types/components/EFP/fields/LegalFormField/types.d.ts +4 -2
  171. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +5 -307
  172. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +2 -2
  173. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +1 -2
  174. package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +0 -2
  175. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.d.ts +1 -2
  176. package/dist/types/components/Individual/forms/IndividualOnfido/GuidanceQuestion/GuidanceQuestion.d.ts +7 -3
  177. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.d.ts +0 -1
  178. package/dist/types/components/Individual/mapping/adjustOnfidoIdentificationData.d.ts +3 -0
  179. package/dist/types/components/Individual/mapping/getOnfidoIdentityTypeToApiIdentityTypeMap.d.ts +3 -0
  180. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersGettingStarted.d.ts +5 -0
  181. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersModalContent.d.ts +1 -0
  182. package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoStore.d.ts +6 -0
  183. package/dist/types/components/Shared/FormNavigation/FormNavigationItem.d.ts +1 -2
  184. package/dist/types/components/Shared/Introduction/copy.d.ts +2 -2
  185. package/dist/types/components/Shared/Summary/Summary.d.ts +0 -1
  186. package/dist/types/components/Shared/devex/DebugListener/DebugModal.d.ts +0 -1
  187. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
  188. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +5 -7
  189. package/dist/types/components/Shared/fields/CountryField/types.d.ts +1 -1
  190. package/dist/types/components/Shared/fields/CountryOfGoverningLawField/types.d.ts +1 -1
  191. package/dist/types/components/Shared/fields/Currency/types.d.ts +1 -1
  192. package/dist/types/components/Shared/fields/DBANameField/types.d.ts +1 -3
  193. package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +1 -1
  194. package/dist/types/components/Shared/fields/EInvoicingCodeField/types.d.ts +1 -1
  195. package/dist/types/components/Shared/fields/FinancialReportingDate/types.d.ts +1 -1
  196. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultRegistrationNumberType.d.ts +16 -0
  197. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultVatNumberType.d.ts +13 -0
  198. package/dist/types/components/Shared/fields/LegalCompanyNameField/LegalCompanyNameField.d.ts +1 -2
  199. package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +1 -1
  200. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +12 -0
  201. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/types.d.ts +5 -0
  202. package/dist/types/components/Shared/fields/NumberOfEmployees/types.d.ts +1 -1
  203. package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -2
  204. package/dist/types/components/Shared/fields/PhoneField/types.d.ts +1 -1
  205. package/dist/types/components/Shared/fields/StateField/types.d.ts +1 -1
  206. package/dist/types/components/Shared/fields/StockExchangeMICField/types.d.ts +1 -1
  207. package/dist/types/components/Shared/fields/StockISINField/types.d.ts +1 -1
  208. package/dist/types/components/Shared/fields/StockTickerSymbol/types.d.ts +1 -1
  209. package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +1 -2
  210. package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +5 -3
  211. package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +1 -1
  212. package/dist/types/components/Shared/fields/VatNumberField/VatNumberField.d.ts +1 -1
  213. package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +2 -4
  214. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  215. package/dist/types/components/Shared/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +1 -1
  216. package/dist/types/components/Shared/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
  217. package/dist/types/components/Shared/forms/FinancialInformation/types.d.ts +1 -1
  218. package/dist/types/components/Shared/tasks/TaskList/TaskItemStatus.d.ts +1 -2
  219. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRadioGroup.d.ts +2 -3
  220. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRoleAndType.d.ts +1 -2
  221. package/dist/types/components/ui/atoms/Accordion/Accordion.d.ts +1 -2
  222. package/dist/types/components/ui/atoms/Button/Button.d.ts +2 -3
  223. package/dist/types/components/ui/atoms/Button/Button.types.d.ts +3 -3
  224. package/dist/types/components/ui/atoms/Field/Field.d.ts +3 -6
  225. package/dist/types/components/ui/atoms/Field/Field.types.d.ts +9 -12
  226. package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +4 -6
  227. package/dist/types/components/ui/atoms/InputBase/InputBase.d.ts +4 -4
  228. package/dist/types/components/ui/atoms/List/List.d.ts +12 -0
  229. package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
  230. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +3 -3
  231. package/dist/types/components/ui/atoms/Remove/Remove.d.ts +1 -2
  232. package/dist/types/components/ui/atoms/Select/Select.d.ts +1 -2
  233. package/dist/types/components/ui/atoms/Select/Select.types.d.ts +1 -0
  234. package/dist/types/components/ui/atoms/SelectButton/SelectButton.d.ts +1 -2
  235. package/dist/types/components/ui/atoms/SelectButton/SelectButton.types.d.ts +3 -4
  236. package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -2
  237. package/dist/types/components/ui/atoms/SelectList/SelectList.types.d.ts +2 -2
  238. package/dist/types/components/ui/atoms/SelectListItem/SelectListItem.types.d.ts +3 -3
  239. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +6 -0
  240. package/dist/types/components/ui/atoms/TextArea/TextArea.d.ts +1 -2
  241. package/dist/types/components/ui/atoms/Tile/Tile.d.ts +1 -2
  242. package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +10 -0
  243. package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +8 -0
  244. package/dist/types/components/ui/molecules/Card/Card.d.ts +1 -2
  245. package/dist/types/components/ui/molecules/Card/types.d.ts +3 -3
  246. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +2 -2
  247. package/dist/types/components/ui/molecules/Dropzone/Dropzone.d.ts +1 -2
  248. package/dist/types/components/ui/molecules/Dropzone/FilePicker.d.ts +2 -4
  249. package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +2 -2
  250. package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +2 -2
  251. package/dist/types/components/ui/molecules/FormEndState/FormEndState.d.ts +0 -1
  252. package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +1 -2
  253. package/dist/types/components/ui/molecules/InputDate/InputDate.d.ts +3 -3
  254. package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +2 -2
  255. package/dist/types/constants/keys.d.ts +2 -0
  256. package/dist/types/context/ExperimentContext/types.d.ts +8 -0
  257. package/dist/types/core/EmbedShell/EmbedShell.d.ts +1 -0
  258. package/dist/types/core/UIElement/UIElement.d.ts +1 -0
  259. package/dist/types/core/models/api/financialReport.d.ts +2 -2
  260. package/dist/types/core/models/api/get-scenarios.d.ts +1 -1
  261. package/dist/types/core/models/api/legal-arrangement.d.ts +10 -2
  262. package/dist/types/core/models/api/organization.d.ts +8 -0
  263. package/dist/types/core/user-events.d.ts +1 -1
  264. package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +1 -1
  265. package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +6 -1
  266. package/dist/types/embeds/individual/adyen-individual.types.d.ts +6 -1
  267. package/dist/types/embeds/onboarding/AdyenOnboarding.d.ts +1 -0
  268. package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +4 -1
  269. package/dist/types/embeds/sign-pci/AdyenSignPci.d.ts +0 -1
  270. package/dist/types/embeds/sign-pci/adyen-sign-pci.types.d.ts +5 -3
  271. package/dist/types/embeds/terms-of-service/adyen-terms-of-service.types.d.ts +7 -1
  272. package/dist/types/embeds/transfer-instrument/AdyenTransferInstrument.d.ts +2 -1
  273. package/dist/types/embeds/transfer-instrument/adyen-transfer-instrument.types.d.ts +7 -2
  274. package/dist/types/hooks/useForm/types.d.ts +0 -2
  275. package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +28 -0
  276. package/dist/types/hooks/useMultiForm/types.d.ts +36 -34
  277. package/dist/types/hooks/useMultiForm/useMultiForm.d.ts +1 -1
  278. package/dist/types/language/Language.d.ts +1 -7
  279. package/dist/types/language/i18n.d.ts +2 -0
  280. package/dist/types/language/types.d.ts +3 -0
  281. package/dist/types/language/utils.d.ts +11 -2
  282. package/dist/types/types/datasets/country-code.d.ts +249 -249
  283. package/dist/types/utils/entityAssociationUtil.d.ts +1 -2
  284. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  285. package/dist/types/utils/eventHandlers/handleKeys.d.ts +2 -2
  286. package/dist/types/utils/getDisplayErrorMessage.d.ts +2 -2
  287. package/dist/types/utils/getName.d.ts +2 -2
  288. package/dist/types/utils/makeSelectItemForRole.d.ts +2 -2
  289. package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +1 -0
  290. package/dist/types/utils/regex/patternValidators.d.ts +2 -0
  291. package/dist/types/utils/simulateTextChangeFromKeyboardEvent.d.ts +2 -2
  292. package/dist/types/utils/urlUtils.d.ts +1 -0
  293. package/dist/types/utils/validatorUtils.d.ts +2 -0
  294. package/dist/{useMultiForm-Bwx2nVhh.js → useMultiForm-KQwxav4F.js} +158 -135
  295. package/dist/{useOnboardingStatus-Cwba-HzS.js → useOnboardingStatus-BMyj9Pwn.js} +1 -1
  296. package/dist/{useSalesChannelsSettings-BLzegVJh.js → useSalesChannelsSettings-43TfSoxc.js} +2 -2
  297. package/dist/{useTermsOfServiceStatus-C-i9mF4m.js → useTermsOfServiceStatus-CBHKWYSb.js} +1 -1
  298. package/dist/{useUpdateLegalEntity-xQlAqIqy.js → useUpdateLegalEntity-D8dw9Oc3.js} +2 -2
  299. package/dist/{utils-DXv7uAh6.js → utils-CL9qlD-O.js} +18 -11
  300. package/dist/{validate-BN5p-GhK.js → validate-CeF0YKvL.js} +2 -2
  301. package/dist/vue/adyen-transfer-instrument.js +5 -4
  302. package/dist/{yaml-jFdy-qnY.js → yaml-CBkrSAtc.js} +2 -2
  303. package/dist/zh-CN-wUb4MmTZ.js +13 -0
  304. package/dist/zh-TW-DNTXHLKa.js +13 -0
  305. package/package.json +28 -27
  306. package/dist/FormEndState-C3HCmXcw.js +0 -32
  307. package/dist/SourceOfFunds.module-xwHIboir.js +0 -128
  308. package/dist/bg-BG-COTwZXwN.js +0 -2040
  309. package/dist/cs-CZ-DUlgJKVq.js +0 -2040
  310. package/dist/da-DK-BDzDHhVR.js +0 -2040
  311. package/dist/de-DE-B3TpRjZX.js +0 -994
  312. package/dist/de-DE-DJdgXqS_.js +0 -2040
  313. package/dist/el-GR-CFEuLvxK.js +0 -994
  314. package/dist/el-GR-D5i9BNyh.js +0 -2040
  315. package/dist/en-US-ghR-1_C2.js +0 -994
  316. package/dist/es-ES-BtWn2FOQ.js +0 -994
  317. package/dist/es-ES-VOSWszW5.js +0 -2040
  318. package/dist/et-EE-Bp4Ngsn4.js +0 -2040
  319. package/dist/fi-FI-DaujOE-a.js +0 -2040
  320. package/dist/fr-FR-BdPZxk11.js +0 -2040
  321. package/dist/fr-FR-HvIkGqJf.js +0 -994
  322. package/dist/hr-HR-BY7C7NxY.js +0 -2040
  323. package/dist/hu-HU-DHCty-Tc.js +0 -2040
  324. package/dist/it-IT-BMsuhZEQ.js +0 -2040
  325. package/dist/it-IT-CjbZahlB.js +0 -994
  326. package/dist/ja-JP-4jufT0xh.js +0 -994
  327. package/dist/ja-JP-BYDz1z2G.js +0 -2040
  328. package/dist/lt-LT-DNJ9V9xV.js +0 -2040
  329. package/dist/lv-LV-CFJwN5wq.js +0 -2040
  330. package/dist/nl-NL-B3xjfpMi.js +0 -994
  331. package/dist/nl-NL-DibAf790.js +0 -2040
  332. package/dist/no-NO-DHCy5rXx.js +0 -2040
  333. package/dist/pl-PL-eZBNH5HH.js +0 -2040
  334. package/dist/pt-PT-BpYDD-PX.js +0 -994
  335. package/dist/pt-PT-CiN_Wmfe.js +0 -2040
  336. package/dist/ro-RO-CgyMTvLc.js +0 -2040
  337. package/dist/ru-RU-BlgIj-Q4.js +0 -994
  338. package/dist/sk-SK-B5qlQB_U.js +0 -2040
  339. package/dist/sl-SI-8PPfrGzL.js +0 -2040
  340. package/dist/sv-SE-7lcf_fB9.js +0 -994
  341. package/dist/sv-SE-ZWLw6D3j.js +0 -2040
  342. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/RichText.d.ts +0 -5
  343. package/dist/types/utils/sanitizeHtml.d.ts +0 -3
  344. package/dist/types/utils/useStateFromProp.d.ts +0 -9
  345. package/dist/zh-CN-xYZH718R.js +0 -994
  346. package/dist/zh-TW-DqBBNurv.js +0 -994
@@ -2,23 +2,24 @@
2
2
  {
3
3
  try {
4
4
  let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "52d3345a-d07d-4d8c-b6d3-766fa62cc152", e._sentryDebugIdIdentifier = "sentry-dbid-52d3345a-d07d-4d8c-b6d3-766fa62cc152");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c2c20178-52ca-46e1-9e49-d0ae59916244", e._sentryDebugIdIdentifier = "sentry-dbid-c2c20178-52ca-46e1-9e49-d0ae59916244");
6
6
  } catch (e) {
7
7
  }
8
8
  }
9
9
  ;
10
10
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
11
11
  import { useMemo, useState, useEffect, useCallback } from "preact/hooks";
12
- import { p as useApiContext, bf as useMutation, bh as httpPost, c7 as matchesRegex, c8 as trimValWithOneSpace, c9 as NO_ALPHABET_REGEX, ca as EMOJI_REGEX, cb as hasRepeatedCharacters, cc as isInvalidName, cd as INDIVIDUAL_VALID_CHAR_REGEX, ce as getFormattingRegEx, cf as SPECIAL_CHARS, cg as standardKatakanaValidator, ch as standardKanjiValidator, ar as resolveFieldMetadata, ao as CountryCodes, ci as getSSNType, ap as isEmpty, cj as defaultFieldMetadata, ck as defaultFieldConfig, bE as defaultFieldMetadata$1, bF as fieldConfig, W as TaskTypes, cl as defaultFieldMetadata$2, y as LegalEntityType, cm as defaultFieldConfig$1, cn as getAgeToday, co as euCountries, cp as getIdDocument, cq as getDocument, cr as mapExistingFile, cs as getPageName, ct as getLocalizedIdDocumentTypeOptions, cu as getPage, cv as createDocumentRequest, bS as formatObject, cw as individualApiKeyMapping, bk as individualComponentsKeyMapping, bR as reverseMapping, cx as getNomineeFromAssociation, cy as drop, X as createLogger, P as useAccountHolder, b as useI18nContext, $ as useAnalyticsContext, a5 as useToastContext, a6 as useExperimentsContext, J as useSettingsContext, cz as documentApiUtils, cA as useProviderStatus, g as getLegalEntityCountry, c2 as getAssociatedLeAnalyticsPayload, cB as addressValidators, cC as getAsyncIdNumberValidationRule, bG as getAsyncPhoneValidationRules, cD as addressFormatters, cE as useScenarios, cF as setHasMotionCaptureScenario, cG as useScenarioConfiguration, cH as getPropsFromConfigurations, cI as individualForms, cJ as showIndividualMotionCapture, bO as getRequiredForms, bP as addValidityToForms, bC as getAllowedDecisionMakerRoles, b0 as datasetUtilities, bQ as useFormComposer, c3 as trackNavigation, cK as Individual, cL as composePerScenarioFormConfigurations, cM as omitObscuredFieldsIfUnchanged, cN as filterOutUnwantedAssociationsIfRootLE, c4 as isValidationError, c5 as processValidationErrors, c6 as isMaintenanceModeError, ba as cloneObject, cO as mapAddressLabels, cP as individualDocumentForms, cQ as individualDocumentMapping, cR as individualObscuredFields, cS as mergeAttachments, cT as getFileExtention, ak as getOwnEntityAssociations, cU as hasNomineesChanged, cV as attachNomineeToRole, cW as idVerificationProviderId, cX as doArraysMatch, bD as DecisionMakerType, cY as createFormRules, bB as getAvailableDecisionMakerRoleTypes, cZ as allowedCountriesForNominee, b_ as getAddressSchemaForCountry, b$ as COUNTRIES_WITH_STATES_DATASET, c_ as Scenarios, c$ as isLowRiskCountry, az as Field, bK as Select, d0 as isTruthyValidator, d1 as licenseCardNumberDefaultMetadata, d2 as licenseCardNumberDefaultConfig, aq as mergeFieldMetadataIntoProps, ay as createFormUtils, bL as useFormContext, av as getFieldProps, d3 as idNumberFields, d4 as IdentityNumber, d5 as additionallIdNumberOptions, d6 as MaskedInput, bW as InputDate, d7 as formatDateObj, d8 as DriversLicense, d9 as addressFields, u as useAllowedCountries, K as SettingNames, da as getDefaultTaxIdNumberType, F as FormHeader, ax as ErrorPanel, C as Typography, aF as CountryField, c0 as Address, c1 as getAddressSchemaLabelsByCountry, bU as Link, b8 as Confirm, db as getAgeRangeForLegalRepresentative, dc as IndividualIdNumberTypeSelector, dd as TaxInformationField, de as PatriotActDisclosure, df as isLegalRepresentativeNeeded, aw as nameFields, dg as decisionMakerRoleFields, dh as nomineeFields, di as contactDetailFields, B as Alert, aU as ContextGuidance, a$ as TrustedFieldsProvider, dj as DecisionMakerRole, dk as NomineeDecisionMakerRole, dl as LocalizedNameFields, bq as InputText, bH as ContactDetails, dm as keysOf, a_ as objectsDeepEqual, bN as isEmpty$1, dn as RadioWithLabel, bs as listToRecord, b2 as Modal, Z as Button, bm as Svg, dp as pick, dq as IdVerification, b7 as Spacer, _ as IconButton, c as useDataset, d as datasetIdentifier, L as Loader, dr as isPersonUnderAge, ds as IdDocumentManualUpload, dt as idDocumentUploadFields, du as useFormRouterContext, bM as getFormProps, dv as useCapabilities, dw as hasMotionCaptureScenario, dx as setShowIndividualMotionCapture, dy as shouldShowMotionCapture, dz as MemoizedProofOfRelationship, dA as MemoizedDocumentUpload, dB as MemoizedProofOfResidencyUpload, dC as individualOnfidoApiKeyMapping, dD as individualOnfidoBaseMapping, bn as useQueryClient, dE as individualOnfidoDocumentMapping, dF as individualOnfidoObscuredFields } from "./StoreProvider-BmzY19Td.js";
13
- import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-xQlAqIqy.js";
14
- import { c as contactDetailsValidationRules, u as useValidatePhoneNumberImperatively } from "./validate-BN5p-GhK.js";
15
- import { F as FormContextProvider, a as FormFlow } from "./FormFlow-Bt-mu4Wm.js";
16
- import { u as useSingpassMyInfoLogin, P as ProviderButton } from "./ProviderButton-DAsW5EVa.js";
17
- import { u as useMultiForm } from "./useMultiForm-Bwx2nVhh.js";
18
- import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-BW8_TEQl.js";
19
- import { l as localizeDateString } from "./localizeDateString-QtCjf8Fg.js";
20
- import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-CUANHpja.js";
21
- import { T as TileGroup } from "./TileGroup-i5Jc08ns.js";
12
+ import { p as useApiContext, bi as useMutation, bk as httpPost, bX as matchesRegex, bY as trimValWithOneSpace, bZ as NO_ALPHABET_REGEX, b_ as EMOJI_REGEX, b$ as hasRepeatedCharacters, c0 as isInvalidName, c1 as INDIVIDUAL_VALID_CHAR_REGEX, c2 as getFormattingRegEx, c3 as SPECIAL_CHARS, c4 as standardKatakanaValidator, c5 as standardKanjiValidator, at as resolveFieldMetadata, aq as CountryCodes, c6 as getSSNType, ar as isEmpty, c7 as defaultFieldMetadata, c8 as defaultFieldConfig, c9 as defaultFieldMetadata$1, ca as fieldConfig, X as TaskTypes, cb as taxInformationDefaultFieldMetadata, y as LegalEntityType, cc as taxInformationDefaultFieldConfig, cd as getAgeToday, ce as euCountries, cf as getIdDocument, cg as getDocument, ch as mapExistingFile, ci as getPageName, cj as getLocalizedIdDocumentTypeOptions, ck as getPage, cl as createDocumentRequest, bA as formatObject, cm as individualApiKeyMapping, bn as individualComponentsKeyMapping, bz as reverseMapping, cn as getNomineeFromAssociation, co as drop, Y as createLogger, U as useAccountHolder, ap as useI18nContext, a0 as useAnalyticsContext, a6 as useToastContext, a7 as useExperimentsContext, K as useSettingsContext, cp as documentApiUtils, cq as useProviderStatus, g as getLegalEntityCountry, bP as getAssociatedLeAnalyticsPayload, cr as addressValidators, cs as getAsyncIdNumberValidationRule, ct as getAsyncPhoneValidationRules, cu as addressFormatters, cv as useScenarios, cw as setHasMotionCaptureScenario, cx as useScenarioConfiguration, cy as getPropsFromConfigurations, cz as individualForms, cA as showIndividualMotionCapture, bQ as getRequiredForms, bR as addValidityToForms, cB as getAllowedDecisionMakerRoles, b3 as datasetUtilities, bS as useFormComposer, bT as trackNavigation, cC as Individual, cD as composePerScenarioFormConfigurations, cE as omitObscuredFieldsIfUnchanged, cF as filterOutUnwantedAssociationsIfRootLE, bU as isValidationError, bV as processValidationErrors, bW as isMaintenanceModeError, bd as cloneObject, cG as mapAddressLabels, cH as individualDocumentForms, cI as individualDocumentMapping, cJ as individualObscuredFields, cK as mergeAttachments, cL as getFileExtention, al as getOwnEntityAssociations, cM as hasNomineesChanged, cN as attachNomineeToRole, cO as idVerificationProviderId, cP as doArraysMatch, G as Typography, _ as Button, aB as Field, cQ as DecisionMakerType, cR as createFormRules, cS as getAvailableDecisionMakerRoleTypes, cT as allowedCountriesForNominee, bL as getAddressSchemaForCountry, bM as COUNTRIES_WITH_STATES_DATASET, cU as Scenarios, cV as isLowRiskCountry, bu as Select, cW as isTruthyValidator, cX as licenseCardNumberDefaultMetadata, cY as licenseCardNumberDefaultConfig, as as mergeFieldMetadataIntoProps, aA as createFormUtils, bK as useFormContext, ax as getFieldProps, cZ as idNumberFields, c_ as IdentityNumber, c$ as additionallIdNumberOptions, d0 as MaskedInput, bG as InputDate, d1 as formatDateObj, d2 as DriversLicense, d3 as addressFields, u as useAllowedCountries, M as SettingNames, d4 as getDefaultTaxIdNumberType, F as FormHeader, az as ErrorPanel, aH as CountryField, bN as Address, bO as getAddressSchemaLabelsByCountry, bD as Link, bb as Confirm, d5 as getAgeRangeForLegalRepresentative, d6 as IndividualIdNumberTypeSelector, d7 as TaxInformationField, d8 as PatriotActDisclosure, d9 as isLegalRepresentativeNeeded, ay as nameFields, da as decisionMakerRoleFields, db as nomineeFields, dc as contactDetailFields, B as Alert, aX as ContextGuidance, b2 as TrustedFieldsProvider, dd as DecisionMakerRole, de as NomineeDecisionMakerRole, df as LocalizedNameFields, bE as InputText, dg as ContactDetails, dh as keysOf, b1 as objectsDeepEqual, di as isEmpty$1, dj as RadioWithLabel, dk as listToRecord, b5 as Modal, bp as Svg, dl as pick, dm as IdVerification, ba as Spacer, $ as IconButton, c as useDataset, d as datasetIdentifier, L as Loader, dn as isPersonUnderAge, dp as IdDocumentManualUpload, C as translateStringOrObject, a as useTranslation, aV as Trans, dq as idDocumentUploadFields, dr as useFormRouterContext, ds as getFormProps, dt as useCapabilities, du as hasMotionCaptureScenario, dv as setShowIndividualMotionCapture, dw as shouldShowMotionCapture, dx as MemoizedProofOfRelationship, dy as MemoizedDocumentUpload, dz as MemoizedProofOfResidencyUpload, dA as individualOnfidoApiKeyMapping, dB as individualOnfidoBaseMapping, bq as useQueryClient, dC as individualOnfidoDocumentMapping, dD as individualOnfidoObscuredFields } from "./StoreProvider-ClKLaHzy.js";
13
+ import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-D8dw9Oc3.js";
14
+ import { c as contactDetailsValidationRules, u as useValidatePhoneNumberImperatively } from "./validate-CeF0YKvL.js";
15
+ import { F as FormContextProvider, a as FormFlow } from "./FormFlow-DjvdNEiV.js";
16
+ import { u as useSingpassMyInfoLogin, P as ProviderButton } from "./ProviderButton-B58n0cRC.js";
17
+ import { u as useMultiForm } from "./useMultiForm-KQwxav4F.js";
18
+ import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-BY--eXBQ.js";
19
+ import { l as localizeDateString } from "./localizeDateString-CKCBXzSn.js";
20
+ import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-CCnLDGvk.js";
21
+ import { signal, computed } from "@preact/signals";
22
+ import { T as TileGroup } from "./TileGroup-BtE472I1.js";
22
23
  const verifyIdNumber = async (legalEntityId, baseUrl, data) => {
23
24
  return await httpPost(
24
25
  {
@@ -178,55 +179,51 @@ const personalDetailsValidators = ({
178
179
  existingIdNumber,
179
180
  formVerificationErrors,
180
181
  taxIdNumberType
181
- }) => {
182
- var _a, _b;
183
- return {
184
- taxInformation: (_a = resolveFieldMetadata(
185
- defaultFieldConfig$1[country],
186
- {
187
- taxIdNumberType,
188
- companyType: LegalEntityType.INDIVIDUAL
189
- },
190
- defaultFieldMetadata$2
191
- )) == null ? void 0 : _a.validators,
192
- birthDate: (() => {
193
- const baseValidators = [isNotOutOfRangeBirthDateValidatorRule$1];
194
- if (isSettingEnabled("enforceLegalAge")) {
182
+ }) => ({
183
+ taxInformation: resolveFieldMetadata(
184
+ taxInformationDefaultFieldConfig[country],
185
+ {
186
+ taxIdNumberType,
187
+ companyType: LegalEntityType.INDIVIDUAL
188
+ },
189
+ taxInformationDefaultFieldMetadata
190
+ )?.validators,
191
+ birthDate: (() => {
192
+ const baseValidators = [isNotOutOfRangeBirthDateValidatorRule$1];
193
+ if (isSettingEnabled("enforceLegalAge")) {
194
+ return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
195
+ }
196
+ if (isExperimentEnabled("EnableAgeVerification")) {
197
+ if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
195
198
  return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
196
199
  }
197
- if (isExperimentEnabled("EnableAgeVerification")) {
198
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
199
- return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
200
- }
201
- return [...baseValidators, getCountrySpecificMinimumAgeValidationRule$1(country)];
202
- }
203
- return baseValidators;
204
- })(),
205
- ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
206
- ...contactDetailsValidationRules,
207
- phoneNumber: (_b = resolveFieldMetadata(
208
- fieldConfig[phonePrefix ?? country],
209
- {},
210
- defaultFieldMetadata$1
211
- )) == null ? void 0 : _b.validators,
212
- idNumber: (() => {
213
- var _a2;
214
- const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
215
- return idNumberExempt ? {
216
- validate: () => {
217
- return idNumberExempt || !isEmpty(idNumber);
218
- },
219
- modes: ["blur"]
220
- } : (_a2 = resolveFieldMetadata(
221
- defaultFieldConfig[country],
222
- { idNumberType: derivedIdNumberType },
223
- defaultFieldMetadata
224
- )) == null ? void 0 : _a2.validators;
225
- })(),
226
- ...jaHaniNameValidationRules,
227
- ...jaKanaNameValidationRules
228
- };
229
- };
200
+ return [...baseValidators, getCountrySpecificMinimumAgeValidationRule$1(country)];
201
+ }
202
+ return baseValidators;
203
+ })(),
204
+ ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
205
+ ...contactDetailsValidationRules,
206
+ phoneNumber: resolveFieldMetadata(
207
+ fieldConfig[phonePrefix ?? country],
208
+ {},
209
+ defaultFieldMetadata$1
210
+ )?.validators,
211
+ idNumber: (() => {
212
+ const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
213
+ return idNumberExempt ? {
214
+ validate: () => {
215
+ return idNumberExempt || !isEmpty(idNumber);
216
+ },
217
+ modes: ["blur"]
218
+ } : resolveFieldMetadata(
219
+ defaultFieldConfig[country],
220
+ { idNumberType: derivedIdNumberType },
221
+ defaultFieldMetadata
222
+ )?.validators;
223
+ })(),
224
+ ...jaHaniNameValidationRules,
225
+ ...jaKanaNameValidationRules
226
+ });
230
227
  const mandateIdVerificationForMotionCapture = (showMotionCapture, derivedProps) => {
231
228
  if (!derivedProps) {
232
229
  return void 0;
@@ -259,7 +256,7 @@ const mapApiIdDocumentToSchema = (idDocument2) => {
259
256
  const { hasBackPage } = getLocalizedIdDocumentTypeOptions().find(({ id }) => id === type);
260
257
  let frontPage;
261
258
  let backPage;
262
- if ((attachments == null ? void 0 : attachments.length) === 1) {
259
+ if (attachments?.length === 1) {
263
260
  frontPage = getPage(idDocument2);
264
261
  } else {
265
262
  frontPage = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
@@ -273,32 +270,31 @@ const mapApiIdDocumentToSchema = (idDocument2) => {
273
270
  };
274
271
  };
275
272
  const mapIndividualDocumentToApiDocument = async (data, entityId) => {
276
- var _a, _b;
277
273
  if (!data) return void 0;
278
274
  const { proofOfNationalId, proofOfResidency, proofOfRelationship } = data;
279
275
  const idDocument2 = "idDocument" in data ? data.idDocument : data.manualIdUpload;
280
276
  const entityType = "legalEntity";
281
277
  const documents = await Promise.all([
282
- (idDocument2 == null ? void 0 : idDocument2.idFrontPage) ? createDocumentRequest({
278
+ idDocument2?.idFrontPage ? createDocumentRequest({
283
279
  entityId,
284
280
  entityType,
285
281
  documentType: idDocument2.idDocumentType,
286
- page1: (_a = idDocument2.idFrontPage) == null ? void 0 : _a[0],
287
- page2: (_b = idDocument2.idBackPage) == null ? void 0 : _b[0]
282
+ page1: idDocument2.idFrontPage?.[0],
283
+ page2: idDocument2.idBackPage?.[0]
288
284
  }) : void 0,
289
- (proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) ? createDocumentRequest({
285
+ proofOfNationalId?.proofOfNationalId ? createDocumentRequest({
290
286
  entityId,
291
287
  entityType,
292
288
  documentType: "proofOfNationalIdNumber",
293
289
  page1: proofOfNationalId.proofOfNationalId[0]
294
290
  }) : void 0,
295
- (proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) ? createDocumentRequest({
291
+ proofOfResidency?.proofOfResidency ? createDocumentRequest({
296
292
  entityId,
297
293
  entityType,
298
294
  documentType: "proofOfResidency",
299
295
  page1: proofOfResidency.proofOfResidency[0]
300
296
  }) : void 0,
301
- (proofOfRelationship == null ? void 0 : proofOfRelationship.proofOfRelationship) ? createDocumentRequest({
297
+ proofOfRelationship?.proofOfRelationship ? createDocumentRequest({
302
298
  entityId,
303
299
  entityType,
304
300
  documentType: "proofOfRelationship",
@@ -348,7 +344,7 @@ const adjustIdentificationData = (data, apiData) => {
348
344
  ...identificationData,
349
345
  expiryDate: "",
350
346
  cardNumber: "",
351
- nationalIdExempt: (apiData == null ? void 0 : apiData.nationalIdExempt) ?? !idNumber
347
+ nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
352
348
  };
353
349
  }
354
350
  };
@@ -375,7 +371,6 @@ const mapNameLocalization = (data) => {
375
371
  return localization;
376
372
  };
377
373
  const mapIndividualToLegalEntity = (data) => {
378
- var _a;
379
374
  const requestObj = {
380
375
  ...formatObject(data, individualApiKeyMapping)
381
376
  };
@@ -390,7 +385,7 @@ const mapIndividualToLegalEntity = (data) => {
390
385
  if (localization.length) {
391
386
  requestObj.individual.name.localization = localization;
392
387
  }
393
- if ((_a = personalDetails.phoneNumber) == null ? void 0 : _a.number) {
388
+ if (personalDetails.phoneNumber?.number) {
394
389
  requestObj.individual.phone = {
395
390
  number: personalDetails.phoneNumber.number,
396
391
  type: "mobile"
@@ -401,7 +396,6 @@ const mapIndividualToLegalEntity = (data) => {
401
396
  return requestObj;
402
397
  };
403
398
  const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity, isLegalRepresentative) => {
404
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
405
399
  let individualData = formatObject(
406
400
  legalEntity,
407
401
  individualComponentsKeyMapping
@@ -409,54 +403,47 @@ const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeed
409
403
  individualData = {
410
404
  ...individualData,
411
405
  personalDetails: {
412
- ...individualData == null ? void 0 : individualData.personalDetails,
406
+ ...individualData?.personalDetails,
413
407
  ...isChangingType && {
414
408
  firstName: "",
415
409
  lastName: ""
416
410
  }
417
411
  }
418
412
  };
419
- if (!((_a = individualData.personalDetails) == null ? void 0 : _a.idNumberExempt)) {
413
+ if (!individualData.personalDetails?.idNumberExempt) {
420
414
  individualData.personalDetails.idNumberExempt = false;
421
415
  }
422
416
  const apiIdentityTypeToIdentityTypeMap = reverseMapping(
423
417
  getIdentityTypeToApiIdentityTypeMap(individualData.personalDetails)
424
418
  );
425
- if ((_c = (_b = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _b.identificationData) == null ? void 0 : _c.type) {
419
+ if (legalEntity?.individual?.identificationData?.type) {
426
420
  individualData.personalDetails.typeOfIdentity = apiIdentityTypeToIdentityTypeMap[legalEntity.individual.identificationData.type];
427
421
  }
428
- if ((_d = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _d.length) {
422
+ if (legalEntity?.documentDetails?.length) {
429
423
  individualData = {
430
424
  ...individualData,
431
- ...mapApiDocumentToIndividualDocuments(legalEntity == null ? void 0 : legalEntity.id)
425
+ ...mapApiDocumentToIndividualDocuments(legalEntity?.id)
432
426
  };
433
427
  }
434
- if (((_e = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _e.residentialAddress.country) === "JP" && ((_g = (_f = legalEntity.individual) == null ? void 0 : _f.name) == null ? void 0 : _g.localization)) {
428
+ if (legalEntity?.individual?.residentialAddress.country === "JP" && legalEntity.individual?.name?.localization) {
435
429
  const configs = [
436
430
  {
437
431
  script: "ja-Hani",
438
- mappingFunction: (l) => {
439
- var _a2, _b2;
440
- return {
441
- jaHaniFirstName: (_a2 = l.fields) == null ? void 0 : _a2.firstName,
442
- jaHaniLastName: (_b2 = l.fields) == null ? void 0 : _b2.lastName
443
- };
444
- }
432
+ mappingFunction: (l) => ({
433
+ jaHaniFirstName: l.fields?.firstName,
434
+ jaHaniLastName: l.fields?.lastName
435
+ })
445
436
  },
446
437
  {
447
438
  script: "ja-Kana",
448
- mappingFunction: (l) => {
449
- var _a2, _b2;
450
- return {
451
- jaKanaFirstName: (_a2 = l.fields) == null ? void 0 : _a2.firstName,
452
- jaKanaLastName: (_b2 = l.fields) == null ? void 0 : _b2.lastName
453
- };
454
- }
439
+ mappingFunction: (l) => ({
440
+ jaKanaFirstName: l.fields?.firstName,
441
+ jaKanaLastName: l.fields?.lastName
442
+ })
455
443
  }
456
444
  ];
457
445
  configs.forEach((config) => {
458
- var _a2, _b2;
459
- const localizationToMap = (_b2 = (_a2 = legalEntity.individual) == null ? void 0 : _a2.name.localization) == null ? void 0 : _b2.find(
446
+ const localizationToMap = legalEntity.individual?.name.localization?.find(
460
447
  (l) => l.script === config.script
461
448
  );
462
449
  if (localizationToMap) {
@@ -467,24 +454,24 @@ const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeed
467
454
  }
468
455
  });
469
456
  }
470
- if (!(parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations)) {
457
+ if (!parentLegalEntity?.entityAssociations) {
471
458
  return individualData;
472
459
  }
473
- const associations = ((_h = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _h.filter((ea) => ea.legalEntityId === (legalEntity == null ? void 0 : legalEntity.id))) ?? [];
460
+ const associations = parentLegalEntity?.entityAssociations?.filter((ea) => ea.legalEntityId === legalEntity?.id) ?? [];
474
461
  if (isRoleFieldNeeded) {
475
462
  individualData.personalDetails.role = associations.map((ea) => ea.type);
476
- individualData.personalDetails.jobTitle = (_i = associations.find(
463
+ individualData.personalDetails.jobTitle = associations.find(
477
464
  ({ jobTitle }) => Boolean(jobTitle)
478
- )) == null ? void 0 : _i.jobTitle;
465
+ )?.jobTitle;
479
466
  }
480
467
  individualData.personalDetails = getNomineeFromAssociation(
481
468
  associations,
482
469
  individualData.personalDetails
483
470
  );
484
471
  if (isLegalRepresentative) {
485
- individualData.personalDetails.relationship = (_j = associations.find(
472
+ individualData.personalDetails.relationship = associations.find(
486
473
  ({ relationship }) => Boolean(relationship)
487
- )) == null ? void 0 : _j.relationship;
474
+ )?.relationship;
488
475
  }
489
476
  return individualData;
490
477
  };
@@ -677,7 +664,6 @@ function IndividualDropin({
677
664
  trustedFieldsProvider,
678
665
  trustedRoles
679
666
  }) {
680
- var _a, _b, _c, _d, _e, _f;
681
667
  const { baseUrl, rootLegalEntityId } = useApiContext();
682
668
  const { accountHolder, setAccountHolder } = useAccountHolder();
683
669
  const { i18n } = useI18nContext();
@@ -725,7 +711,7 @@ function IndividualDropin({
725
711
  const [documents, setDocuments] = useState();
726
712
  const [existingAttachments, setExistingAttachments] = useState();
727
713
  const [country, setCountry] = useState(
728
- ((_a = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _a.residencyCountry) ?? parentCountry
714
+ dataFromResponse?.personalDetails?.residencyCountry ?? parentCountry
729
715
  );
730
716
  const [hideFooter, setHideFooter] = useState(false);
731
717
  const [derivedProps, setDerivedProps] = useState();
@@ -756,29 +742,26 @@ function IndividualDropin({
756
742
  });
757
743
  }, []);
758
744
  const individualFieldValidations = useCallback(
759
- (data2) => {
760
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m;
761
- return {
762
- personalDetails: personalDetailsValidators({
763
- country: ((_a2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? country,
764
- isExperimentEnabled,
765
- isSettingEnabled,
766
- taskType,
767
- idNumberType: (_b2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _b2.typeOfIdentity,
768
- phonePrefix: (_d2 = (_c2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _c2.phoneNumber) == null ? void 0 : _d2.phoneCountryCode,
769
- idNumberExempt: (_e2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _e2.idNumberExempt,
770
- idNumber: (_f2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _f2.idNumber,
771
- existingIdNumber: (_g = dataFromResponse.personalDetails) == null ? void 0 : _g.idNumber,
772
- formVerificationErrors: (_h = propProblems == null ? void 0 : propProblems.verificationErrors) == null ? void 0 : _h.personalDetails,
773
- taxIdNumberType: ((_j = (_i = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _i.taxInformation) == null ? void 0 : _j.length) ? (_l = (_k = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _k.taxInformation[0]) == null ? void 0 : _l.type : void 0
774
- }),
775
- address: addressValidators({
776
- isExperimentEnabled,
777
- country: ((_m = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _m.residencyCountry) ?? country,
778
- i18n
779
- })
780
- };
781
- },
745
+ (data2) => ({
746
+ personalDetails: personalDetailsValidators({
747
+ country: data2?.personalDetails?.residencyCountry ?? country,
748
+ isExperimentEnabled,
749
+ isSettingEnabled,
750
+ taskType,
751
+ idNumberType: data2?.personalDetails?.typeOfIdentity,
752
+ phonePrefix: data2?.personalDetails?.phoneNumber?.phoneCountryCode,
753
+ idNumberExempt: data2?.personalDetails?.idNumberExempt,
754
+ idNumber: data2?.personalDetails?.idNumber,
755
+ existingIdNumber: dataFromResponse.personalDetails?.idNumber,
756
+ formVerificationErrors: propProblems?.verificationErrors?.personalDetails,
757
+ taxIdNumberType: data2?.personalDetails?.taxInformation?.length ? data2?.personalDetails?.taxInformation[0]?.type : void 0
758
+ }),
759
+ address: addressValidators({
760
+ isExperimentEnabled,
761
+ country: data2?.personalDetails?.residencyCountry ?? country,
762
+ i18n
763
+ })
764
+ }),
782
765
  [isExperimentEnabled, isSettingEnabled, taskType]
783
766
  );
784
767
  const validatePhoneNumber = useValidatePhoneNumberImperatively();
@@ -787,7 +770,7 @@ function IndividualDropin({
787
770
  (data2) => ({
788
771
  personalDetails: {
789
772
  phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber,
790
- idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2 == null ? void 0 : data2.personalDetails).idNumber
773
+ idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2?.personalDetails).idNumber
791
774
  }
792
775
  }),
793
776
  [getAsyncPhoneValidationRules, getAsyncIdNumberValidationRule]
@@ -812,18 +795,17 @@ function IndividualDropin({
812
795
  []
813
796
  );
814
797
  const form = useMultiForm({
815
- requiredFields: derivedProps == null ? void 0 : derivedProps.requiredFields,
798
+ requiredFields: derivedProps?.requiredFields,
816
799
  defaultData,
817
800
  rules: individualFieldValidations,
818
801
  asyncRules: individualFieldAsyncValidations,
819
- optionalFields: derivedProps == null ? void 0 : derivedProps.optionalFields,
802
+ optionalFields: derivedProps?.optionalFields,
820
803
  formatters
821
804
  });
822
805
  const { data = dataFromResponse } = form;
823
806
  useEffect(() => {
824
- var _a2;
825
- setCountry(((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? parentCountry);
826
- }, [(_b = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b.residencyCountry, parentCountry]);
807
+ setCountry(data?.personalDetails?.residencyCountry ?? parentCountry);
808
+ }, [data?.personalDetails?.residencyCountry, parentCountry]);
827
809
  const { data: scenarios } = useScenarios(country, LegalEntityType.INDIVIDUAL);
828
810
  useEffect(() => {
829
811
  if (!scenarios) return;
@@ -837,27 +819,23 @@ function IndividualDropin({
837
819
  country
838
820
  });
839
821
  const fieldsFromCustomRules = useMemo(
840
- () => {
841
- var _a2;
842
- return rules({
843
- matchingScenario,
844
- data,
845
- country: ((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? country,
846
- taskType,
847
- isExperimentEnabled,
848
- rootLegalEntity: parentLegalEntity,
849
- problems
850
- });
851
- },
822
+ () => rules({
823
+ matchingScenario,
824
+ data,
825
+ country: data?.personalDetails?.residencyCountry ?? country,
826
+ taskType,
827
+ isExperimentEnabled,
828
+ rootLegalEntity: parentLegalEntity,
829
+ problems
830
+ }),
852
831
  [country, matchingScenario, data, taskType, problems]
853
832
  );
854
833
  useEffect(() => {
855
- var _a2;
856
834
  const derivedProps2 = getPropsFromConfigurations(
857
835
  fieldConfigurations,
858
836
  individualForms,
859
- (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
860
- (problems == null ? void 0 : problems.missingData) ?? [],
837
+ problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
838
+ problems?.missingData ?? [],
861
839
  legalEntityResponse ? getFieldsWithExistingData(
862
840
  legalEntityResponse,
863
841
  individualApiKeyMapping,
@@ -873,12 +851,12 @@ function IndividualDropin({
873
851
  fieldsFromCustomRules,
874
852
  {},
875
853
  {},
876
- legalEntityResponse == null ? void 0 : legalEntityResponse.type,
854
+ legalEntityResponse?.type,
877
855
  [],
878
856
  true
879
857
  );
880
858
  const updatedDerivedProps = mandateIdVerificationForMotionCapture(
881
- (_a2 = showIndividualMotionCapture) == null ? void 0 : _a2.value,
859
+ showIndividualMotionCapture?.value,
882
860
  derivedProps2
883
861
  );
884
862
  setDerivedProps(updatedDerivedProps);
@@ -886,46 +864,41 @@ function IndividualDropin({
886
864
  fieldConfigurations,
887
865
  legalEntityResponse,
888
866
  fieldsFromCustomRules,
889
- problems == null ? void 0 : problems.remediationActions,
890
- problems == null ? void 0 : problems.missingData
867
+ problems?.remediationActions,
868
+ problems?.missingData
891
869
  ]);
892
870
  const forms = useMemo(() => {
893
- var _a2;
894
871
  const formsWithUpdatedName = {
895
872
  ...individualForms,
896
873
  idDocument: {
897
874
  ...individualForms.idDocument,
898
- formName: ((_a2 = data.idVerificationMethod) == null ? void 0 : _a2.idVerificationMethod) === "instantVerification" ? "instantVerification" : "idDocument"
875
+ formName: data.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "instantVerification" : "idDocument"
899
876
  }
900
877
  };
901
878
  const requiredForms = getRequiredForms(
902
879
  formsWithUpdatedName,
903
- derivedProps == null ? void 0 : derivedProps.requiredFields,
904
- derivedProps == null ? void 0 : derivedProps.optionalFields
880
+ derivedProps?.requiredFields,
881
+ derivedProps?.optionalFields
905
882
  ).filter(
906
883
  // Prevent showing the ID verification method step when onfido is not enabled
907
- (form2) => {
908
- var _a3, _b2;
909
- return form2.formId !== "idVerificationMethod" || ((_b2 = (_a3 = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _a3.idDocument) == null ? void 0 : _b2.enabled);
910
- }
884
+ (form2) => form2.formId !== "idVerificationMethod" || providerStatus?.statuses?.idDocument?.enabled
911
885
  );
912
886
  return addValidityToForms(requiredForms, form.isValid, problems);
913
887
  }, [
914
888
  derivedProps,
915
889
  form.isValid,
916
890
  problems,
917
- (_d = (_c = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _c.idDocument) == null ? void 0 : _d.enabled,
918
- (_e = data.idVerificationMethod) == null ? void 0 : _e.idVerificationMethod
891
+ providerStatus?.statuses?.idDocument?.enabled,
892
+ data.idVerificationMethod?.idVerificationMethod
919
893
  ]);
920
894
  if (isRoleFieldNeeded && parentLegalEntity) {
921
895
  roleTypes = getAllowedDecisionMakerRoles(parentLegalEntity, taskType);
922
896
  }
923
897
  useEffect(() => {
924
- var _a2;
925
- if (!((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.length)) return;
926
- documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse == null ? void 0 : legalEntityResponse.id).then((res) => {
898
+ if (!legalEntityResponse?.documentDetails?.length) return;
899
+ documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then((res) => {
927
900
  setExistingAttachments(res[0].attachments);
928
- setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse == null ? void 0 : legalEntityResponse.id));
901
+ setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
929
902
  }).catch(() => {
930
903
  showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
931
904
  });
@@ -938,9 +911,8 @@ function IndividualDropin({
938
911
  legalEntity,
939
912
  idDocumentType
940
913
  }) => {
941
- var _a2, _b2, _c2;
942
914
  let updatedLegalEntity;
943
- const leId = (legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newDecisionMaker == null ? void 0 : newDecisionMaker.id);
915
+ const leId = legalEntityResponse?.id || newDecisionMaker?.id;
944
916
  if (!leId) {
945
917
  updatedLegalEntity = await createLegalEntity(legalEntity);
946
918
  userEvents.addTaskEvent("Success", {
@@ -948,8 +920,8 @@ function IndividualDropin({
948
920
  actionType: "submit",
949
921
  legalEntityId: updatedLegalEntity.id,
950
922
  entityType: updatedLegalEntity.type,
951
- countryOfRegistration: ((_a2 = dataSubmitted.personalDetails) == null ? void 0 : _a2.residencyCountry) || null,
952
- roles: ((_b2 = dataSubmitted.personalDetails) == null ? void 0 : _b2.role) || null
923
+ countryOfRegistration: dataSubmitted.personalDetails?.residencyCountry || null,
924
+ roles: dataSubmitted.personalDetails?.role || null
953
925
  });
954
926
  } else {
955
927
  const patchLegalEntity = { ...drop("type").from(legalEntity), id: leId };
@@ -959,7 +931,7 @@ function IndividualDropin({
959
931
  actionType: "submit",
960
932
  legalEntityId: updatedLegalEntity.id,
961
933
  entityType: updatedLegalEntity.type,
962
- countryOfRegistration: ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.residencyCountry) || null,
934
+ countryOfRegistration: dataSubmitted.personalDetails?.residencyCountry || null,
963
935
  documentType: idDocumentType || null
964
936
  });
965
937
  }
@@ -981,10 +953,9 @@ function IndividualDropin({
981
953
  legalEntity,
982
954
  dataSubmitted
983
955
  }) => {
984
- var _a2, _b2, _c2, _d2;
985
956
  if (!isDocumentsRequired(forms2)) return;
986
- if ((_a2 = dataSubmitted.idDocument) == null ? void 0 : _a2.instantIdVerificationData) {
987
- if (((_c2 = (_b2 = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.enabled) === false) {
957
+ if (dataSubmitted.idDocument?.instantIdVerificationData) {
958
+ if (providerStatus?.statuses?.idDocument?.enabled === false) {
988
959
  throw new Error("Provider unexpectedly disabled instant verification flow");
989
960
  }
990
961
  await handleInstantIdVerificationStartCheck(
@@ -997,7 +968,7 @@ function IndividualDropin({
997
968
  legalEntity.id
998
969
  );
999
970
  if (!formattedDocuments || formattedDocuments.length === 0) {
1000
- if (existingAttachments == null ? void 0 : existingAttachments.length)
971
+ if (existingAttachments?.length)
1001
972
  logger$4.log(
1002
973
  "User has already uploaded documents and is not changing them, nothing needs to be done"
1003
974
  );
@@ -1009,26 +980,24 @@ function IndividualDropin({
1009
980
  }
1010
981
  formattedDocuments[0].attachments = mergeAttachments(
1011
982
  existingAttachments ?? [],
1012
- ((_d2 = formattedDocuments[0]) == null ? void 0 : _d2.attachments) ?? []
983
+ formattedDocuments[0]?.attachments ?? []
1013
984
  ).filter((attachment) => attachment.content);
1014
985
  const uploadedDocuments = await documentUtils.uploadDocuments(
1015
986
  formattedDocuments,
1016
987
  legalEntity.id
1017
988
  );
1018
- uploadedDocuments == null ? void 0 : uploadedDocuments.forEach((doc) => {
1019
- var _a3;
989
+ uploadedDocuments?.forEach((doc) => {
1020
990
  userEvents.addTaskEvent("Success", {
1021
991
  ...associatedLeTrackingParams,
1022
992
  actionType: "upload",
1023
993
  documentType: doc.type,
1024
- fileExtention: ((_a3 = doc == null ? void 0 : doc.attachments) == null ? void 0 : _a3.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0)) ?? null
994
+ fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? null
1025
995
  });
1026
996
  });
1027
997
  }
1028
998
  };
1029
999
  const hasRolesChanged = (legalEntity, existingEntityAssociations, newRoles) => {
1030
- var _a2;
1031
- const existingRoles = (_a2 = existingEntityAssociations == null ? void 0 : existingEntityAssociations.filter((ea) => ea.legalEntityId === legalEntity.id)) == null ? void 0 : _a2.map(({ type }) => type);
1000
+ const existingRoles = existingEntityAssociations?.filter((ea) => ea.legalEntityId === legalEntity.id)?.map(({ type }) => type);
1032
1001
  return !doArraysMatch(existingRoles, newRoles);
1033
1002
  };
1034
1003
  const attachAssociationToParentLegalEntity = async ({
@@ -1036,22 +1005,18 @@ function IndividualDropin({
1036
1005
  parentLE,
1037
1006
  dataSubmitted
1038
1007
  }) => {
1039
- var _a2, _b2, _c2, _d2, _e2, _f2;
1040
- const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? (_a2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _a2.role : taskType === TaskTypes.TRUST_MEMBER_INDIVIDUAL || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL ? trustMember == null ? void 0 : trustMember.roles : null;
1008
+ const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? dataSubmitted?.personalDetails?.role : taskType === TaskTypes.TRUST_MEMBER_INDIVIDUAL || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL ? trustMember?.roles : null;
1041
1009
  const existingEntityAssociations = getOwnEntityAssociations(parentLE);
1042
- if (newRoles && (hasRolesChanged(legalEntity, existingEntityAssociations, newRoles) || ((_b2 = dataFromResponse.personalDetails) == null ? void 0 : _b2.jobTitle) !== ((_c2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _c2.jobTitle) || hasNomineesChanged(dataFromResponse.personalDetails, dataSubmitted.personalDetails))) {
1010
+ if (newRoles && (hasRolesChanged(legalEntity, existingEntityAssociations, newRoles) || dataFromResponse.personalDetails?.jobTitle !== dataSubmitted?.personalDetails?.jobTitle || hasNomineesChanged(dataFromResponse.personalDetails, dataSubmitted.personalDetails))) {
1043
1011
  const updatedParentLegalEntity = {
1044
1012
  entityAssociations: [
1045
- ...newRoles.map((role) => {
1046
- var _a3;
1047
- return {
1048
- type: role,
1049
- legalEntityId: legalEntity.id,
1050
- ...DECISION_MAKER_TYPES_WITH_JOBTITLE$1.some((type) => type === role) && {
1051
- jobTitle: (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _a3.jobTitle
1052
- }
1053
- };
1054
- }) || [],
1013
+ ...newRoles.map((role) => ({
1014
+ type: role,
1015
+ legalEntityId: legalEntity.id,
1016
+ ...DECISION_MAKER_TYPES_WITH_JOBTITLE$1.some((type) => type === role) && {
1017
+ jobTitle: dataSubmitted?.personalDetails?.jobTitle
1018
+ }
1019
+ })) || [],
1055
1020
  ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
1056
1021
  ]
1057
1022
  };
@@ -1062,11 +1027,11 @@ function IndividualDropin({
1062
1027
  }
1063
1028
  await updateLegalEntity({ ...updatedParentLegalEntity, id: parentLE.id });
1064
1029
  }
1065
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity.id) || ((_d2 = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _d2.relationship) !== ((_e2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _e2.relationship))) {
1030
+ if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity.id) || dataFromResponse?.personalDetails?.relationship !== dataSubmitted?.personalDetails?.relationship)) {
1066
1031
  const newEntityAssociation = {
1067
1032
  type: "legalRepresentative",
1068
1033
  legalEntityId: legalEntity.id,
1069
- relationship: (_f2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _f2.relationship
1034
+ relationship: dataSubmitted?.personalDetails?.relationship
1070
1035
  };
1071
1036
  const updatedParentLegalEntity = {
1072
1037
  entityAssociations: [newEntityAssociation, ...existingEntityAssociations]
@@ -1075,7 +1040,6 @@ function IndividualDropin({
1075
1040
  }
1076
1041
  };
1077
1042
  const onSubmit = async () => {
1078
- var _a2;
1079
1043
  setLoadingStatus("loading");
1080
1044
  const dataSubmitted = omitObscuredFieldsIfUnchanged(
1081
1045
  individualObscuredFields,
@@ -1087,12 +1051,9 @@ function IndividualDropin({
1087
1051
  }
1088
1052
  try {
1089
1053
  const legalEntity = mapIndividualToLegalEntity(dataSubmitted);
1090
- const idDocumentType = (_a2 = idDocumentTypeOptions.find(
1091
- ({ id }) => {
1092
- var _a3;
1093
- return ((_a3 = dataSubmitted == null ? void 0 : dataSubmitted.idDocument) == null ? void 0 : _a3.idDocumentType) === id;
1094
- }
1095
- )) == null ? void 0 : _a2.id;
1054
+ const idDocumentType = idDocumentTypeOptions.find(
1055
+ ({ id }) => dataSubmitted?.idDocument?.idDocumentType === id
1056
+ )?.id;
1096
1057
  legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
1097
1058
  taskType,
1098
1059
  legalEntityResponse,
@@ -1114,7 +1075,7 @@ function IndividualDropin({
1114
1075
  }
1115
1076
  setLoadingStatus("success");
1116
1077
  clearToasts();
1117
- externalOnSubmit == null ? void 0 : externalOnSubmit(dataSubmitted);
1078
+ externalOnSubmit?.(dataSubmitted);
1118
1079
  } catch (e) {
1119
1080
  logger$4.error("Failed to update individual", e);
1120
1081
  if (isValidationError(e)) {
@@ -1140,17 +1101,13 @@ function IndividualDropin({
1140
1101
  const isDocumentsRequired = (forms2) => forms2.some((form2) => individualDocumentForms.includes(form2.formId));
1141
1102
  const datasetUtils = datasetUtilities(i18n.locale);
1142
1103
  const formatIdDocument = (idDocument2) => {
1143
- var _a2, _b2;
1144
1104
  if (!idDocument2) return void 0;
1145
- const documentType = (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) ? onfidoDocumentTypeMapping.find(
1146
- (document) => {
1147
- var _a3;
1148
- return ((_a3 = idDocument2.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document.id;
1149
- }
1105
+ const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
1106
+ (document) => idDocument2.instantIdVerificationData?.document_front.type === document.id
1150
1107
  ) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
1151
1108
  if (!documentType) return void 0;
1152
- const frontPage = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
1153
- const backPage = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
1109
+ const frontPage = idDocument2.idFrontPage?.[0];
1110
+ const backPage = idDocument2.idBackPage?.[0];
1154
1111
  if (!frontPage) return void 0;
1155
1112
  return {
1156
1113
  documentType: i18n.get(documentType.name),
@@ -1168,12 +1125,11 @@ function IndividualDropin({
1168
1125
  proofOfResidency,
1169
1126
  proofOfRelationship
1170
1127
  }) => {
1171
- var _a2, _b2, _c2;
1172
- const proofOfNationalIdFile = (_a2 = proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) == null ? void 0 : _a2[0];
1173
- const proofOfResidencyFile = (_b2 = proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) == null ? void 0 : _b2[0];
1174
- const proofOfRelationshipFile = (_c2 = proofOfRelationship == null ? void 0 : proofOfRelationship.proofOfRelationship) == null ? void 0 : _c2[0];
1128
+ const proofOfNationalIdFile = proofOfNationalId?.proofOfNationalId?.[0];
1129
+ const proofOfResidencyFile = proofOfResidency?.proofOfResidency?.[0];
1130
+ const proofOfRelationshipFile = proofOfRelationship?.proofOfRelationship?.[0];
1175
1131
  return {
1176
- ...((idDocument2 == null ? void 0 : idDocument2.idDocumentType) || (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData)) && {
1132
+ ...(idDocument2?.idDocumentType || idDocument2?.instantIdVerificationData) && {
1177
1133
  idDocument: formatIdDocument(idDocument2)
1178
1134
  },
1179
1135
  ...proofOfNationalIdFile && {
@@ -1194,14 +1150,13 @@ function IndividualDropin({
1194
1150
  };
1195
1151
  };
1196
1152
  const formatDataForSummary = () => {
1197
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h;
1198
1153
  let summaryData = cloneObject(data);
1199
- if ((_a2 = summaryData.personalDetails) == null ? void 0 : _a2.residencyCountry) {
1154
+ if (summaryData.personalDetails?.residencyCountry) {
1200
1155
  summaryData.personalDetails.residencyCountry = datasetUtils.getCountryName(
1201
1156
  summaryData.personalDetails.residencyCountry
1202
1157
  );
1203
1158
  }
1204
- if ((_b2 = summaryData.personalDetails) == null ? void 0 : _b2.nationality) {
1159
+ if (summaryData.personalDetails?.nationality) {
1205
1160
  summaryData.personalDetails.nationality = datasetUtils.getCountryName(
1206
1161
  summaryData.personalDetails.nationality
1207
1162
  );
@@ -1213,27 +1168,24 @@ function IndividualDropin({
1213
1168
  individualDocumentForms.forEach((formId) => delete summaryData[formId]);
1214
1169
  summaryData = { ...summaryData, ...formatFileSummaryData(data) };
1215
1170
  }
1216
- if ((_c2 = summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
1171
+ if (summaryData.personalDetails?.accountHolder) {
1217
1172
  summaryData.personalDetails.accountHolder = i18n.get(
1218
1173
  summaryData.personalDetails.accountHolder
1219
1174
  );
1220
1175
  }
1221
- if ((_d2 = summaryData.personalDetails) == null ? void 0 : _d2.birthDate) {
1176
+ if (summaryData.personalDetails?.birthDate) {
1222
1177
  summaryData.personalDetails.birthDate = localizeDateString(
1223
1178
  summaryData.personalDetails.birthDate,
1224
1179
  i18n.locale
1225
1180
  );
1226
1181
  }
1227
- if ((_e2 = summaryData.personalDetails) == null ? void 0 : _e2.phoneNumber) {
1182
+ if (summaryData.personalDetails?.phoneNumber) {
1228
1183
  delete summaryData.personalDetails.phoneNumber;
1229
- summaryData.personalDetails.phoneNumber = (_g = (_f2 = data.personalDetails) == null ? void 0 : _f2.phoneNumber) == null ? void 0 : _g.number;
1184
+ summaryData.personalDetails.phoneNumber = data.personalDetails?.phoneNumber?.number;
1230
1185
  }
1231
- if ((_h = summaryData.personalDetails) == null ? void 0 : _h.taxInformation) {
1186
+ if (summaryData.personalDetails?.taxInformation) {
1232
1187
  const taxInformation = summaryData.personalDetails.taxInformation.find(
1233
- (taxId) => {
1234
- var _a3;
1235
- return taxId.country === ((_a3 = data.personalDetails) == null ? void 0 : _a3.nationality);
1236
- }
1188
+ (taxId) => taxId.country === data.personalDetails?.nationality
1237
1189
  );
1238
1190
  if (taxInformation) {
1239
1191
  delete summaryData.personalDetails.taxInformation;
@@ -1244,7 +1196,7 @@ function IndividualDropin({
1244
1196
  };
1245
1197
  const summaryOmittedKeys = [
1246
1198
  ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
1247
- ...((_f = data == null ? void 0 : data.personalDetails) == null ? void 0 : _f.idNumberExempt) ? ["idNumber"] : []
1199
+ ...data?.personalDetails?.idNumberExempt ? ["idNumber"] : []
1248
1200
  ];
1249
1201
  const {
1250
1202
  handleNextClick,
@@ -1305,7 +1257,7 @@ function IndividualDropin({
1305
1257
  onNext: handleNextClick,
1306
1258
  onBack: handleBackClick,
1307
1259
  setHideFooter,
1308
- legalEntityId: legalEntityResponse == null ? void 0 : legalEntityResponse.id,
1260
+ legalEntityId: legalEntityResponse?.id,
1309
1261
  allowedRoles: roleTypes,
1310
1262
  shouldValidate,
1311
1263
  accountHolder,
@@ -1360,59 +1312,120 @@ const additionalPersonalDetailsValidators = ({
1360
1312
  formVerificationErrors,
1361
1313
  i18n,
1362
1314
  taxIdNumberType
1363
- }) => {
1364
- var _a;
1365
- return {
1366
- taxInformation: (_a = resolveFieldMetadata(
1367
- defaultFieldConfig$1[country],
1368
- {
1369
- taxIdNumberType,
1370
- companyType: LegalEntityType.INDIVIDUAL
1371
- },
1372
- defaultFieldMetadata$2
1373
- )) == null ? void 0 : _a.validators,
1374
- birthDate: (() => {
1375
- const baseValidators = [isNotOutOfRangeBirthDateValidatorRule];
1376
- if (isSettingEnabled("enforceLegalAge")) {
1315
+ }) => ({
1316
+ taxInformation: resolveFieldMetadata(
1317
+ taxInformationDefaultFieldConfig[country],
1318
+ {
1319
+ taxIdNumberType,
1320
+ companyType: LegalEntityType.INDIVIDUAL
1321
+ },
1322
+ taxInformationDefaultFieldMetadata
1323
+ )?.validators,
1324
+ birthDate: (() => {
1325
+ const baseValidators = [isNotOutOfRangeBirthDateValidatorRule];
1326
+ if (isSettingEnabled("enforceLegalAge")) {
1327
+ return [...baseValidators, buildMinimumAgeValidationRule(18)];
1328
+ }
1329
+ if (isExperimentEnabled("EnableAgeVerification")) {
1330
+ if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
1377
1331
  return [...baseValidators, buildMinimumAgeValidationRule(18)];
1378
1332
  }
1379
- if (isExperimentEnabled("EnableAgeVerification")) {
1380
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
1381
- return [...baseValidators, buildMinimumAgeValidationRule(18)];
1382
- }
1383
- return [...baseValidators, getCountrySpecificMinimumAgeValidationRule(country)];
1384
- }
1385
- return baseValidators;
1386
- })(),
1387
- ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
1388
- ...contactDetailsValidationRules,
1389
- idNumber: (() => {
1390
- var _a2;
1391
- const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
1392
- return idNumberExempt ? {
1393
- validate: () => {
1394
- return idNumberExempt || !isEmpty(idNumber);
1395
- },
1396
- modes: ["blur"]
1397
- } : (_a2 = resolveFieldMetadata(
1398
- defaultFieldConfig[country],
1399
- { idNumberType: derivedIdNumberType },
1400
- defaultFieldMetadata
1401
- )) == null ? void 0 : _a2.validators;
1402
- })(),
1403
- ...addressValidators({
1404
- isExperimentEnabled,
1405
- country,
1406
- i18n
1407
- })
1408
- };
1409
- };
1333
+ return [...baseValidators, getCountrySpecificMinimumAgeValidationRule(country)];
1334
+ }
1335
+ return baseValidators;
1336
+ })(),
1337
+ ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
1338
+ ...contactDetailsValidationRules,
1339
+ idNumber: (() => {
1340
+ const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
1341
+ return idNumberExempt ? {
1342
+ validate: () => {
1343
+ return idNumberExempt || !isEmpty(idNumber);
1344
+ },
1345
+ modes: ["blur"]
1346
+ } : resolveFieldMetadata(
1347
+ defaultFieldConfig[country],
1348
+ { idNumberType: derivedIdNumberType },
1349
+ defaultFieldMetadata
1350
+ )?.validators;
1351
+ })(),
1352
+ ...addressValidators({
1353
+ isExperimentEnabled,
1354
+ country,
1355
+ i18n
1356
+ })
1357
+ });
1410
1358
  const basicDetailsValidators = ({
1411
1359
  isExperimentEnabled = () => false
1412
1360
  }) => ({
1413
1361
  ...contactDetailsValidationRules,
1414
1362
  ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0
1415
1363
  });
1364
+ const guidanceQuestion = "adyen-kyc-guidance-question";
1365
+ const options = "adyen-kyc-options";
1366
+ const styles$6 = {
1367
+ guidanceQuestion,
1368
+ options
1369
+ };
1370
+ var GuidanceQuestionValues = /* @__PURE__ */ ((GuidanceQuestionValues2) => {
1371
+ GuidanceQuestionValues2["YES"] = "Yes";
1372
+ GuidanceQuestionValues2["NO"] = "No";
1373
+ return GuidanceQuestionValues2;
1374
+ })(GuidanceQuestionValues || {});
1375
+ const GuidanceQuestion = (props) => {
1376
+ const {
1377
+ descriptionLinkText,
1378
+ errorMessage,
1379
+ name,
1380
+ noLabel,
1381
+ onChange,
1382
+ onDescriptionLinkClick,
1383
+ question,
1384
+ value,
1385
+ yesLabel
1386
+ } = props;
1387
+ const { i18n } = useI18nContext();
1388
+ const userEvents = useAnalyticsContext();
1389
+ const handleChange = (selectedValue) => {
1390
+ userEvents.addFieldEvent("Interacted with form field", {
1391
+ actionType: "select",
1392
+ field: name,
1393
+ returnValue: selectedValue
1394
+ });
1395
+ const newValue = selectedValue || null;
1396
+ onChange(newValue);
1397
+ };
1398
+ const yesTileLabel = yesLabel ?? i18n.get("yes");
1399
+ const noTileLabel = noLabel ?? i18n.get("no");
1400
+ return /* @__PURE__ */ jsxs("div", { className: styles$6.guidanceQuestion, children: [
1401
+ /* @__PURE__ */ jsx(Typography, { variant: "body", el: "p", children: question }),
1402
+ descriptionLinkText && onDescriptionLinkClick && /* @__PURE__ */ jsx(Button, { variant: "link", onClick: onDescriptionLinkClick, children: descriptionLinkText }),
1403
+ /* @__PURE__ */ jsx(Field, { name, className: styles$6.options, children: () => /* @__PURE__ */ jsx(
1404
+ TileGroup,
1405
+ {
1406
+ allowMultiple: false,
1407
+ errorMessage,
1408
+ isHorizontal: true,
1409
+ maxSelected: 1,
1410
+ name,
1411
+ onChange: handleChange,
1412
+ selected: value || "",
1413
+ tiles: [
1414
+ {
1415
+ label: yesTileLabel,
1416
+ value: "Yes"
1417
+ /* YES */
1418
+ },
1419
+ {
1420
+ label: noTileLabel,
1421
+ value: "No"
1422
+ /* NO */
1423
+ }
1424
+ ]
1425
+ }
1426
+ ) })
1427
+ ] });
1428
+ };
1416
1429
  const areArraysDifferent = (a = [], b = []) => {
1417
1430
  if (a.length !== b.length) {
1418
1431
  return true;
@@ -1422,22 +1435,21 @@ const areArraysDifferent = (a = [], b = []) => {
1422
1435
  return sortedA.some((item, index) => item !== sortedB[index]);
1423
1436
  };
1424
1437
  const calculateRoles = (data) => {
1425
- var _a, _b, _c, _d;
1426
1438
  const roleMappings = [
1427
1439
  {
1428
- isApplicable: ((_a = data == null ? void 0 : data.signatoryQuestionnaire) == null ? void 0 : _a.isSignatory) === "yes",
1440
+ isApplicable: data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES,
1429
1441
  role: DecisionMakerType.SIGNATORY
1430
1442
  },
1431
1443
  {
1432
- isApplicable: ((_b = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _b.isOwner) === "yes",
1444
+ isApplicable: data?.uboQuestionnaire?.isOwner === GuidanceQuestionValues.YES,
1433
1445
  role: DecisionMakerType.OWNER
1434
1446
  },
1435
1447
  {
1436
- isApplicable: ((_c = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _c.isControllingPerson) === "yes",
1448
+ isApplicable: data?.uboQuestionnaire?.isControllingPerson === GuidanceQuestionValues.YES,
1437
1449
  role: DecisionMakerType.CONTROLLING_PERSON
1438
1450
  },
1439
1451
  {
1440
- isApplicable: ((_d = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _d.isDirector) === "yes",
1452
+ isApplicable: data?.uboQuestionnaire?.isDirector === GuidanceQuestionValues.YES,
1441
1453
  role: DecisionMakerType.DIRECTOR
1442
1454
  }
1443
1455
  ];
@@ -1498,32 +1510,30 @@ const individualOnfidoRules = ({
1498
1510
  return void 0;
1499
1511
  },
1500
1512
  isDirectorIdNumberRequiredForCountry: () => {
1501
- var _a, _b, _c, _d, _e;
1502
- if (!((_a = data.basicDetails) == null ? void 0 : _a.role)) {
1513
+ if (!data.basicDetails?.role) {
1503
1514
  return REQUIRED;
1504
1515
  }
1505
- if ((_c = (_b = data.basicDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1516
+ if (data.basicDetails?.role?.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1506
1517
  return REQUIRED;
1507
1518
  }
1508
- if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && ((_e = (_d = data.basicDetails) == null ? void 0 : _d.role) == null ? void 0 : _e.some((role) => role === DecisionMakerType.DIRECTOR))) {
1519
+ if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && data.basicDetails?.role?.some((role) => role === DecisionMakerType.DIRECTOR)) {
1509
1520
  return REQUIRED;
1510
1521
  }
1511
1522
  },
1512
1523
  idNumberRules: () => {
1513
- var _a, _b, _c, _d, _e, _f, _g, _h;
1514
- if ((_a = data.additionalPersonalDetails) == null ? void 0 : _a.idNumberExempt) {
1524
+ if (data.additionalPersonalDetails?.idNumberExempt) {
1515
1525
  return OPTIONAL;
1516
1526
  }
1517
- if (!((_b = data.basicDetails) == null ? void 0 : _b.role)) {
1527
+ if (!data.basicDetails?.role) {
1518
1528
  return REQUIRED;
1519
1529
  }
1520
- if (country === CountryCodes.UnitedStates && ((_d = (_c = data.basicDetails) == null ? void 0 : _c.role) == null ? void 0 : _d.every((role) => role === DecisionMakerType.SIGNATORY))) {
1530
+ if (country === CountryCodes.UnitedStates && data.basicDetails?.role?.every((role) => role === DecisionMakerType.SIGNATORY)) {
1521
1531
  return void 0;
1522
1532
  }
1523
- if ((_f = (_e = data.basicDetails) == null ? void 0 : _e.role) == null ? void 0 : _f.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1533
+ if (data.basicDetails?.role?.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1524
1534
  return REQUIRED;
1525
1535
  }
1526
- if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && ((_h = (_g = data.basicDetails) == null ? void 0 : _g.role) == null ? void 0 : _h.some((role) => role === DecisionMakerType.DIRECTOR))) {
1536
+ if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && data.basicDetails?.role?.some((role) => role === DecisionMakerType.DIRECTOR)) {
1527
1537
  return REQUIRED;
1528
1538
  }
1529
1539
  },
@@ -1533,11 +1543,10 @@ const individualOnfidoRules = ({
1533
1543
  }
1534
1544
  },
1535
1545
  idNumberExemptIfApplicableCountry: () => {
1536
- var _a, _b;
1537
- if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && (matchingScenario == null ? void 0 : matchingScenario.includes(Scenarios.L_TAXINFO))) {
1546
+ if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && matchingScenario?.includes(Scenarios.L_TAXINFO)) {
1538
1547
  return void 0;
1539
1548
  }
1540
- if (country === CountryCodes.UnitedStates && ((_b = (_a = data.basicDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.every((role) => role === DecisionMakerType.SIGNATORY))) {
1549
+ if (country === CountryCodes.UnitedStates && data.basicDetails?.role?.every((role) => role === DecisionMakerType.SIGNATORY)) {
1541
1550
  return void 0;
1542
1551
  }
1543
1552
  if (ID_NUMBER_EXEMPT_COUNTRIES.includes(country)) {
@@ -1545,30 +1554,25 @@ const individualOnfidoRules = ({
1545
1554
  }
1546
1555
  },
1547
1556
  hasChosenIdType: () => {
1548
- var _a;
1549
- return ((_a = data == null ? void 0 : data.manualIdUpload) == null ? void 0 : _a.idDocumentType) ? REQUIRED : void 0;
1557
+ return data?.manualIdUpload?.idDocumentType ? REQUIRED : void 0;
1550
1558
  },
1551
1559
  backPageIfRequiredForIdType: () => {
1552
1560
  const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
1553
1561
  const idDocumentOption = idDocumentTypeOptions.find(
1554
- ({ id }) => {
1555
- var _a;
1556
- return id === ((_a = data.manualIdUpload) == null ? void 0 : _a.idDocumentType);
1557
- }
1562
+ ({ id }) => id === data.manualIdUpload?.idDocumentType
1558
1563
  );
1559
- return (idDocumentOption == null ? void 0 : idDocumentOption.hasBackPage) ? REQUIRED : void 0;
1564
+ return idDocumentOption?.hasBackPage ? REQUIRED : void 0;
1560
1565
  },
1561
1566
  isProofOfResidencyRequired: () => {
1562
- var _a, _b, _c, _d, _e, _f;
1563
- if ((_b = (_a = data.proofOfResidency) == null ? void 0 : _a.proofOfResidency) == null ? void 0 : _b.length) {
1567
+ if (data.proofOfResidency?.proofOfResidency?.length) {
1564
1568
  return REQUIRED;
1565
1569
  }
1566
- const isInstantFlow = ((_c = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _c.idVerificationMethod) === "instantVerification";
1570
+ const isInstantFlow = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
1567
1571
  if (!isInstantFlow) {
1568
1572
  return void 0;
1569
1573
  }
1570
- const documentCountry = (_e = (_d = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _d.idDocument) == null ? void 0 : _e.documentCountry;
1571
- const residenceCountry = ((_f = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _f.country) ?? country;
1574
+ const documentCountry = data?.idVerificationMethod?.idDocument?.documentCountry;
1575
+ const residenceCountry = data?.additionalPersonalDetails?.country ?? country;
1572
1576
  if (!documentCountry || !residenceCountry) {
1573
1577
  return void 0;
1574
1578
  }
@@ -1579,15 +1583,13 @@ const individualOnfidoRules = ({
1579
1583
  }
1580
1584
  },
1581
1585
  isProofOfNationalIdRequired: () => {
1582
- var _a, _b;
1583
- if ((_b = (_a = data.proofOfNationalId) == null ? void 0 : _a.proofOfNationalId) == null ? void 0 : _b.length) {
1586
+ if (data.proofOfNationalId?.proofOfNationalId?.length) {
1584
1587
  return REQUIRED;
1585
1588
  }
1586
1589
  },
1587
1590
  contactsIfRequiredForRole: () => {
1588
- var _a, _b;
1589
1591
  if (taskType === TaskTypes.DECISION_MAKER) {
1590
- if ((_b = (_a = data.basicDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.includes(DecisionMakerType.SIGNATORY)) {
1592
+ if (data.basicDetails?.role?.includes(DecisionMakerType.SIGNATORY)) {
1591
1593
  return REQUIRED;
1592
1594
  }
1593
1595
  return;
@@ -1596,22 +1598,20 @@ const individualOnfidoRules = ({
1596
1598
  },
1597
1599
  requiredIfPhoneScenarioDisabled: () => !isExperimentEnabled("EnablePhoneFieldScenario") ? REQUIRED : void 0,
1598
1600
  jobTitleIfRequiredForRole: () => {
1599
- var _a, _b;
1600
1601
  if (taskType !== TaskTypes.DECISION_MAKER) return;
1601
- if (((_b = (_a = data.basicDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.some(
1602
+ if (data.basicDetails?.role?.some(
1602
1603
  (role) => DECISION_MAKER_TYPES_WITH_JOBTITLE.includes(role)
1603
- )) || JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1604
+ ) || JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1604
1605
  return REQUIRED;
1605
1606
  }
1606
1607
  },
1607
1608
  nationalityIfRequiredForRole: () => {
1608
- var _a, _b;
1609
1609
  const enableNationalitySGHK = isExperimentEnabled("EnableNationalitySGHK");
1610
- const rootLegalEntityCountry = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _a.registeredAddress.country;
1610
+ const rootLegalEntityCountry = rootLegalEntity?.organization?.registeredAddress.country;
1611
1611
  if (enableNationalitySGHK && rootLegalEntityCountry && NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(rootLegalEntityCountry)) {
1612
1612
  return REQUIRED;
1613
1613
  }
1614
- if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || ((_b = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _b.nationality)) {
1614
+ if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || data?.additionalPersonalDetails?.nationality) {
1615
1615
  return REQUIRED;
1616
1616
  }
1617
1617
  },
@@ -1621,20 +1621,17 @@ const individualOnfidoRules = ({
1621
1621
  }
1622
1622
  },
1623
1623
  licenseCardNumberRules: () => {
1624
- var _a;
1625
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense" && LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1624
+ if (data.additionalPersonalDetails?.typeOfIdentity === "driversLicense" && LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1626
1625
  return REQUIRED;
1627
1626
  }
1628
1627
  },
1629
1628
  issuerStateRequired: () => {
1630
- var _a;
1631
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1629
+ if (data.additionalPersonalDetails?.typeOfIdentity === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1632
1630
  return REQUIRED;
1633
1631
  }
1634
1632
  },
1635
1633
  expiryDateRequired: () => {
1636
- var _a;
1637
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "passport" && EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1634
+ if (data.additionalPersonalDetails?.typeOfIdentity === "passport" && EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1638
1635
  return REQUIRED;
1639
1636
  }
1640
1637
  },
@@ -1642,80 +1639,69 @@ const individualOnfidoRules = ({
1642
1639
  isProofOfRelationshipRequired: () => void 0,
1643
1640
  // not required until more clarity from product
1644
1641
  addressIfRequiredForCountry: () => {
1645
- var _a;
1646
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1642
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1647
1643
  return addressSchema.includes("address") ? "REQUIRED" : void 0;
1648
1644
  },
1649
1645
  otherAddressInfoIfRequiredForCountry: () => {
1650
- var _a;
1651
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1646
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1652
1647
  return addressSchema.includes("otherAddressInformation") ? "OPTIONAL" : void 0;
1653
1648
  },
1654
1649
  postalCodeIfRequiredForCountry: () => {
1655
- var _a;
1656
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1650
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1657
1651
  return addressSchema.includes("postalCode") ? "REQUIRED" : void 0;
1658
1652
  },
1659
1653
  cityIfRequiredForCountry: () => {
1660
- var _a;
1661
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1654
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1662
1655
  return addressSchema.includes("city") ? "REQUIRED" : void 0;
1663
1656
  },
1664
1657
  stateOrProvinceIfRequiredForCountry: () => {
1665
- var _a, _b;
1666
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1667
- return addressSchema.includes("stateOrProvince") && COUNTRIES_WITH_STATES_DATASET.includes(((_b = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _b.country) ?? country) ? "REQUIRED" : void 0;
1658
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1659
+ return addressSchema.includes("stateOrProvince") && COUNTRIES_WITH_STATES_DATASET.includes(data?.additionalPersonalDetails?.country ?? country) ? "REQUIRED" : void 0;
1668
1660
  },
1669
1661
  nomineeDirectorRequiredForCountry: () => {
1670
- var _a, _b, _c;
1671
- if (allowedCountriesForNominee.includes(((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country) ?? country) && ((_c = (_b = data == null ? void 0 : data.basicDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.includes(DecisionMakerType.DIRECTOR))) {
1662
+ if (allowedCountriesForNominee.includes(data?.additionalPersonalDetails?.country ?? country) && data?.basicDetails?.role?.includes(DecisionMakerType.DIRECTOR)) {
1672
1663
  return "REQUIRED";
1673
1664
  }
1674
1665
  },
1675
1666
  nomineeShareHolderRequiredForCountry: () => {
1676
- var _a, _b, _c;
1677
- if (allowedCountriesForNominee.includes(((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country) ?? country) && ((_c = (_b = data == null ? void 0 : data.basicDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.includes(DecisionMakerType.OWNER))) {
1667
+ if (allowedCountriesForNominee.includes(data?.additionalPersonalDetails?.country ?? country) && data?.basicDetails?.role?.includes(DecisionMakerType.OWNER)) {
1678
1668
  return "REQUIRED";
1679
1669
  }
1680
1670
  },
1681
1671
  isUsingInstantVerificationOrHasExistingDocument: () => {
1682
- var _a, _b;
1683
- const isUsingInstantVerification = ((_a = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _a.idVerificationMethod) === "instantVerification";
1684
- const existingDocument = (_b = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _b.idDocument;
1672
+ const isUsingInstantVerification = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
1673
+ const existingDocument = data?.idVerificationMethod?.idDocument;
1685
1674
  return isUsingInstantVerification || existingDocument ? REQUIRED : void 0;
1686
1675
  },
1687
1676
  isManualIdFlow: () => {
1688
- var _a;
1689
- const isManualFlow = ((_a = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _a.idVerificationMethod) === "manualVerification";
1677
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1690
1678
  return isManualFlow ? "REQUIRED" : void 0;
1691
1679
  },
1692
1680
  isManualIdFlowAndNotProvidingIdNumber: () => {
1693
- var _a, _b, _c;
1694
- const hasMissingId = (_a = problems == null ? void 0 : problems.missingData) == null ? void 0 : _a.some(
1681
+ const hasMissingId = problems?.missingData?.some(
1695
1682
  (error) => error.code === ID_MISSING_DATA_ERROR_CODE
1696
1683
  );
1697
- const isManualFlow = ((_b = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _b.idVerificationMethod) === "manualVerification";
1698
- const idNumberExempt = (_c = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _c.idNumberExempt;
1684
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1685
+ const idNumberExempt = data?.additionalPersonalDetails?.idNumberExempt;
1699
1686
  return isManualFlow && (idNumberExempt || hasMissingId) ? "REQUIRED" : void 0;
1700
1687
  },
1701
1688
  isManualIdFlowAndHasMissingData: () => {
1702
- var _a, _b;
1703
- const hasMissingId = (_a = problems == null ? void 0 : problems.missingData) == null ? void 0 : _a.some(
1689
+ const hasMissingId = problems?.missingData?.some(
1704
1690
  (error) => error.code === ID_MISSING_DATA_ERROR_CODE
1705
1691
  );
1706
- const isManualFlow = ((_b = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _b.idVerificationMethod) === "manualVerification";
1692
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1707
1693
  return isManualFlow && hasMissingId ? "REQUIRED" : void 0;
1708
1694
  },
1709
1695
  idVerificationRequired: () => {
1710
1696
  return REQUIRED;
1711
1697
  },
1712
1698
  isGuidedDecisionMakersFlowEnabled: () => {
1713
- if (isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow")) {
1699
+ if (!isExperimentEnabled("DisableGuidedDecisionMakersFlow") && (isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow"))) {
1714
1700
  return "REQUIRED";
1715
1701
  }
1716
1702
  },
1717
1703
  isGuidedDecisionMakersFlowDisabled: () => {
1718
- if (!isExperimentEnabled("EnableGuidedDecisionMakersFlow") && !isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow")) {
1704
+ if (isExperimentEnabled("DisableGuidedDecisionMakersFlow") || !isExperimentEnabled("EnableGuidedDecisionMakersFlow") && !isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow")) {
1719
1705
  return "REQUIRED";
1720
1706
  }
1721
1707
  },
@@ -1786,7 +1772,6 @@ const identityValidationRules = (country) => {
1786
1772
  }
1787
1773
  };
1788
1774
  function Identity(props) {
1789
- var _a, _b, _c;
1790
1775
  const { additionalPersonalDetails, country, idNumberType, handleFieldChange } = props;
1791
1776
  const {
1792
1777
  data,
@@ -1838,7 +1823,7 @@ function Identity(props) {
1838
1823
  const mergedProps = useMemo(() => {
1839
1824
  const idNumberMetadata = resolveFieldMetadata(
1840
1825
  defaultFieldConfig[country],
1841
- { idNumberType: data == null ? void 0 : data.typeOfIdentity },
1826
+ { idNumberType: data?.typeOfIdentity },
1842
1827
  defaultFieldMetadata
1843
1828
  );
1844
1829
  return mergeFieldMetadataIntoProps(
@@ -1850,21 +1835,21 @@ function Identity(props) {
1850
1835
  initialFormUtilProps
1851
1836
  )
1852
1837
  );
1853
- }, [country, data == null ? void 0 : data.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData]);
1838
+ }, [country, data?.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData]);
1854
1839
  const { i18n } = useI18nContext();
1855
1840
  const formUtils = useMemo(() => createFormUtils(mergedProps, i18n), [mergedProps, i18n]);
1856
1841
  const { form } = useFormContext();
1857
- const defaultIdNumber = (_b = (_a = form == null ? void 0 : form.defaultData) == null ? void 0 : _a.additionalPersonalDetails) == null ? void 0 : _b.idNumber;
1842
+ const defaultIdNumber = form?.defaultData?.additionalPersonalDetails?.idNumber;
1858
1843
  const ssnType = getSSNType(formVerificationErrors, defaultIdNumber);
1859
1844
  const today = /* @__PURE__ */ new Date();
1860
1845
  const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
1861
1846
  const isCountryAustralia = country === CountryCodes.Australia;
1862
1847
  const isCountryNewZealand = country === CountryCodes.NewZealand;
1863
1848
  useEffect(() => {
1864
- if ((data == null ? void 0 : data.typeOfIdentity) === "nationalIdNumber") {
1849
+ if (data?.typeOfIdentity === "nationalIdNumber") {
1865
1850
  handleFieldChange("typeOfIdentity")(void 0);
1866
1851
  }
1867
- }, [data == null ? void 0 : data.typeOfIdentity, handleFieldChange]);
1852
+ }, [data?.typeOfIdentity, handleFieldChange]);
1868
1853
  if (!handleFieldChange) {
1869
1854
  return;
1870
1855
  }
@@ -1887,15 +1872,15 @@ function Identity(props) {
1887
1872
  /* @__PURE__ */ jsx(
1888
1873
  TypeOfIdentity,
1889
1874
  {
1890
- availableIdentityTypesOptions: (_c = additionallIdNumberOptions) == null ? void 0 : _c[country],
1891
- selectedIdentityType: data == null ? void 0 : data.typeOfIdentity,
1875
+ availableIdentityTypesOptions: additionallIdNumberOptions?.[country],
1876
+ selectedIdentityType: data?.typeOfIdentity,
1892
1877
  setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
1893
1878
  label: formUtils.getLabel("typeOfIdentity"),
1894
- isValid: Boolean(valid == null ? void 0 : valid.typeOfIdentity),
1879
+ isValid: Boolean(valid?.typeOfIdentity),
1895
1880
  errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
1896
1881
  }
1897
1882
  ),
1898
- (isCountryAustralia || isCountryNewZealand) && (data == null ? void 0 : data.typeOfIdentity) === "passport" && /* @__PURE__ */ jsx(
1883
+ (isCountryAustralia || isCountryNewZealand) && data?.typeOfIdentity === "passport" && /* @__PURE__ */ jsx(
1899
1884
  MaskedInput,
1900
1885
  {
1901
1886
  name: "idNumber",
@@ -1904,43 +1889,43 @@ function Identity(props) {
1904
1889
  formatGuidance: formUtils.getGuidanceText("idNumber"),
1905
1890
  errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1906
1891
  shouldValidate,
1907
- isValid: Boolean(valid == null ? void 0 : valid.idNumber),
1892
+ isValid: Boolean(valid?.idNumber),
1908
1893
  "aria-required": formUtils.isRequiredField("idNumber"),
1909
- "aria-invalid": !(valid == null ? void 0 : valid.idNumber),
1894
+ "aria-invalid": !valid?.idNumber,
1910
1895
  onBlur: handleFieldChange("idNumber", "blur"),
1911
1896
  readonly: formUtils.isReadOnly("idNumber"),
1912
- value: (data == null ? void 0 : data.idNumber) ?? "",
1897
+ value: data?.idNumber ?? "",
1913
1898
  onInput: handleFieldChange("idNumber", "input"),
1914
- acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
1899
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1915
1900
  ...formUtils.getMask("idNumber")
1916
1901
  }
1917
1902
  ),
1918
- isCountryNewZealand && (data == null ? void 0 : data.typeOfIdentity) === "passport" && /* @__PURE__ */ jsx(
1903
+ isCountryNewZealand && data?.typeOfIdentity === "passport" && /* @__PURE__ */ jsx(
1919
1904
  Field,
1920
1905
  {
1921
1906
  name: "expiryDate",
1922
1907
  label: formUtils.getLabel("passportExpiryDate"),
1923
1908
  errorMessage: formUtils.getErrorMessage("expiryDate", errors, fieldValidationErrors),
1924
- isValid: valid == null ? void 0 : valid.expiryDate,
1909
+ isValid: valid?.expiryDate,
1925
1910
  children: (childProps) => /* @__PURE__ */ jsx(
1926
1911
  InputDate,
1927
1912
  {
1928
1913
  ...childProps,
1929
1914
  name: "expiryDate",
1930
- value: data == null ? void 0 : data.expiryDate,
1915
+ value: data?.expiryDate,
1931
1916
  placeholder: i18n.get("datePlaceholder"),
1932
1917
  readonly: formUtils.isReadOnly("expiryDate"),
1933
1918
  onInput: handleFieldChange("expiryDate", "input"),
1934
1919
  onBlur: handleFieldChange("expiryDate", "blur"),
1935
1920
  "aria-required": true,
1936
- "aria-invalid": !(valid == null ? void 0 : valid.expiryDate),
1921
+ "aria-invalid": !valid?.expiryDate,
1937
1922
  min: formatDateObj(today),
1938
1923
  max: formatDateObj(maxExpiryDateSelection)
1939
1924
  }
1940
1925
  )
1941
1926
  }
1942
1927
  ),
1943
- (isCountryAustralia || isCountryNewZealand) && (data == null ? void 0 : data.typeOfIdentity) === "driversLicense" && /* @__PURE__ */ jsx(
1928
+ (isCountryAustralia || isCountryNewZealand) && data?.typeOfIdentity === "driversLicense" && /* @__PURE__ */ jsx(
1944
1929
  DriversLicense,
1945
1930
  {
1946
1931
  country,
@@ -1952,9 +1937,9 @@ function Identity(props) {
1952
1937
  onCardNumberBlur: handleFieldChange("licenseCardNumber", "blur"),
1953
1938
  formUtils,
1954
1939
  isValid: {
1955
- idNumber: Boolean(valid == null ? void 0 : valid.idNumber),
1956
- licenseCardNumber: Boolean(valid == null ? void 0 : valid.licenseCardNumber),
1957
- issuerState: Boolean(valid == null ? void 0 : valid.issuerState)
1940
+ idNumber: Boolean(valid?.idNumber),
1941
+ licenseCardNumber: Boolean(valid?.licenseCardNumber),
1942
+ issuerState: Boolean(valid?.issuerState)
1958
1943
  },
1959
1944
  errorMessages: {
1960
1945
  idNumber: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
@@ -1977,14 +1962,14 @@ function Identity(props) {
1977
1962
  formatGuidance: formUtils.getGuidanceText("idNumber"),
1978
1963
  errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1979
1964
  shouldValidate,
1980
- isValid: Boolean(valid == null ? void 0 : valid.idNumber),
1965
+ isValid: Boolean(valid?.idNumber),
1981
1966
  "aria-required": formUtils.isRequiredField("idNumber"),
1982
- "aria-invalid": Boolean(!(valid == null ? void 0 : valid.idNumber)),
1967
+ "aria-invalid": Boolean(!valid?.idNumber),
1983
1968
  onBlur: handleFieldChange("idNumber", "blur"),
1984
1969
  readonly: formUtils.isReadOnly("idNumber"),
1985
- value: (data == null ? void 0 : data.idNumber) ?? "",
1970
+ value: data?.idNumber ?? "",
1986
1971
  onInput: handleFieldChange("idNumber", "input"),
1987
- acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
1972
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1988
1973
  ...formUtils.getMask("idNumber")
1989
1974
  }
1990
1975
  )
@@ -2016,7 +2001,6 @@ const additionalPersonalDetailsFields = [
2016
2001
  "taxInformation"
2017
2002
  ];
2018
2003
  function AdditionalPersonalDetails(props) {
2019
- var _a, _b;
2020
2004
  const { i18n } = useI18nContext();
2021
2005
  const allowedCountries = useAllowedCountries();
2022
2006
  const [showLegalRepresentativePrompt, setShowLegalRepresentativePrompt] = useState(false);
@@ -2036,21 +2020,21 @@ function AdditionalPersonalDetails(props) {
2036
2020
  taskType,
2037
2021
  handleFieldChange
2038
2022
  } = props;
2039
- const country = (data == null ? void 0 : data.country) ?? defaultCountry;
2023
+ const country = data?.country ?? defaultCountry;
2040
2024
  const isIndividual = taskType === TaskTypes.INDIVIDUAL;
2041
2025
  const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
2042
2026
  const [taxIdNumberType, setTaxIdNumberType] = useState(
2043
- getDefaultTaxIdNumberType(data == null ? void 0 : data.taxInformation, country, LegalEntityType.INDIVIDUAL)
2027
+ getDefaultTaxIdNumberType(data?.taxInformation, country, LegalEntityType.INDIVIDUAL)
2044
2028
  );
2045
2029
  const mergedProps = mergeFieldMetadataIntoProps(
2046
2030
  "taxInformation",
2047
2031
  resolveFieldMetadata(
2048
- defaultFieldConfig$1[country],
2032
+ taxInformationDefaultFieldConfig[country],
2049
2033
  {
2050
2034
  taxIdNumberType,
2051
2035
  companyType: LegalEntityType.INDIVIDUAL
2052
2036
  },
2053
- defaultFieldMetadata$2
2037
+ taxInformationDefaultFieldMetadata
2054
2038
  ),
2055
2039
  props
2056
2040
  );
@@ -2090,7 +2074,7 @@ function AdditionalPersonalDetails(props) {
2090
2074
  CountryField,
2091
2075
  {
2092
2076
  data: { country },
2093
- valid: { country: valid == null ? void 0 : valid.country },
2077
+ valid: { country: valid?.country },
2094
2078
  errors: {
2095
2079
  country: formUtils.getErrorMessage("country", errors, fieldValidationErrors)
2096
2080
  },
@@ -2129,19 +2113,19 @@ function AdditionalPersonalDetails(props) {
2129
2113
  name: "birthDate",
2130
2114
  label: formUtils.getLabel("birthDate"),
2131
2115
  errorMessage: birthDateErrorMessage,
2132
- isValid: valid == null ? void 0 : valid.birthDate,
2116
+ isValid: valid?.birthDate,
2133
2117
  children: (childProps) => /* @__PURE__ */ jsx(
2134
2118
  InputDate,
2135
2119
  {
2136
2120
  ...childProps,
2137
2121
  name: "birthDate",
2138
- value: data == null ? void 0 : data.birthDate,
2122
+ value: data?.birthDate,
2139
2123
  placeholder: i18n.get("datePlaceholder"),
2140
2124
  readonly: formUtils.isReadOnly("birthDate"),
2141
2125
  onInput: handleFieldChange("birthDate", "input"),
2142
2126
  onBlur: handleBirthDateChange,
2143
2127
  "aria-required": true,
2144
- "aria-invalid": !(valid == null ? void 0 : valid.birthDate),
2128
+ "aria-invalid": !valid?.birthDate,
2145
2129
  max: formatDateObj(/* @__PURE__ */ new Date())
2146
2130
  }
2147
2131
  )
@@ -2152,7 +2136,7 @@ function AdditionalPersonalDetails(props) {
2152
2136
  {
2153
2137
  title: i18n.get("legalRepresentativeForMinorIsRequired"),
2154
2138
  description: i18n.get("becauseThisPersonIsUnderXYearsOld", {
2155
- values: { age: ((_b = (_a = getAgeRangeForLegalRepresentative(country)) == null ? void 0 : _a.max) == null ? void 0 : _b.toString()) ?? "" }
2139
+ values: { age: getAgeRangeForLegalRepresentative(country)?.max?.toString() ?? "" }
2156
2140
  }),
2157
2141
  onCancel: () => {
2158
2142
  setShowLegalRepresentativePrompt(false);
@@ -2169,7 +2153,7 @@ function AdditionalPersonalDetails(props) {
2169
2153
  {
2170
2154
  country,
2171
2155
  handleFieldChange: handleFieldChange("typeOfIdentity", "input"),
2172
- selected: data == null ? void 0 : data.typeOfIdentity
2156
+ selected: data?.typeOfIdentity
2173
2157
  }
2174
2158
  ),
2175
2159
  /* @__PURE__ */ jsx(
@@ -2178,15 +2162,15 @@ function AdditionalPersonalDetails(props) {
2178
2162
  additionalPersonalDetails: props,
2179
2163
  country,
2180
2164
  errors,
2181
- idNumberType: data == null ? void 0 : data.typeOfIdentity,
2165
+ idNumberType: data?.typeOfIdentity,
2182
2166
  handleFieldChange
2183
2167
  }
2184
2168
  ),
2185
2169
  showField(["taxInformation"]) && /* @__PURE__ */ jsx(
2186
2170
  TaxInformationField,
2187
2171
  {
2188
- data: { taxInformation: data == null ? void 0 : data.taxInformation },
2189
- valid: { taxInformation: valid == null ? void 0 : valid.taxInformation },
2172
+ data: { taxInformation: data?.taxInformation },
2173
+ valid: { taxInformation: valid?.taxInformation },
2190
2174
  errors: {
2191
2175
  taxInformation: formUtils.getErrorMessage(
2192
2176
  "taxInformation",
@@ -2196,7 +2180,6 @@ function AdditionalPersonalDetails(props) {
2196
2180
  },
2197
2181
  labels: formUtils.getFieldLabels(["taxInformation"]),
2198
2182
  mask: formUtils.getMask("taxInformation"),
2199
- helperText: formUtils.getFieldHelperText(["taxInformation"]),
2200
2183
  guidanceText: formUtils.getFieldGuidanceText(["taxInformation"]),
2201
2184
  readonly: formUtils.isReadOnly("taxInformation"),
2202
2185
  shouldValidate,
@@ -2206,14 +2189,14 @@ function AdditionalPersonalDetails(props) {
2206
2189
  companyType: LegalEntityType.INDIVIDUAL,
2207
2190
  taxIdNumberType,
2208
2191
  setTaxIdNumberType,
2209
- defaultData: data == null ? void 0 : data.taxInformation
2192
+ defaultData: data?.taxInformation
2210
2193
  }
2211
2194
  ),
2212
2195
  formUtils.isRequiredField("nationality") && /* @__PURE__ */ jsx(
2213
2196
  CountryField,
2214
2197
  {
2215
- data: { country: data == null ? void 0 : data.nationality },
2216
- valid: { country: valid == null ? void 0 : valid.nationality },
2198
+ data: { country: data?.nationality },
2199
+ valid: { country: valid?.nationality },
2217
2200
  name: "nationality",
2218
2201
  errors: {
2219
2202
  country: formUtils.getErrorMessage("nationality", errors, fieldValidationErrors)
@@ -2239,13 +2222,13 @@ const basicDetailsFields = [
2239
2222
  "jaKanaLastName"
2240
2223
  ];
2241
2224
  function BasicDetails(props) {
2242
- var _a, _b, _c;
2243
2225
  const { i18n } = useI18nContext();
2244
2226
  const {
2245
2227
  form: { triggerValidation }
2246
2228
  } = useFormContext();
2247
2229
  const { isExperimentEnabled } = useExperimentsContext();
2248
2230
  const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
2231
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
2249
2232
  const {
2250
2233
  country,
2251
2234
  data,
@@ -2296,8 +2279,8 @@ function BasicDetails(props) {
2296
2279
  title: i18n.get({
2297
2280
  key: "legalRepresentativeFor",
2298
2281
  values: {
2299
- firstName: ((_a = parentLegalEntity == null ? void 0 : parentLegalEntity.individual) == null ? void 0 : _a.name.firstName) || "",
2300
- lastName: ((_b = parentLegalEntity == null ? void 0 : parentLegalEntity.individual) == null ? void 0 : _b.name.lastName) || ""
2282
+ firstName: parentLegalEntity?.individual?.name.firstName || "",
2283
+ lastName: parentLegalEntity?.individual?.name.lastName || ""
2301
2284
  }
2302
2285
  })
2303
2286
  }
@@ -2314,7 +2297,7 @@ function BasicDetails(props) {
2314
2297
  isDecisionMakerTask && trustedFieldsProvider === TrustedFieldsProvider.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, { color: "secondary", variant: "caption", children: i18n.get(
2315
2298
  "weSelectedSomeRolesBasedOnMyinfoBusinessDataAboutYourCompanysAppointmentHoldersAndShareholders"
2316
2299
  ) }),
2317
- isDecisionMakerTask && !isGuidedDecisionMakersFlowEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [
2300
+ isDecisionMakerTask && (isGuidedDecisionMakersFlowDisabled || !isGuidedDecisionMakersFlowEnabled) && /* @__PURE__ */ jsxs(Fragment, { children: [
2318
2301
  /* @__PURE__ */ jsx(
2319
2302
  DecisionMakerRole,
2320
2303
  {
@@ -2331,7 +2314,7 @@ function BasicDetails(props) {
2331
2314
  NomineeDecisionMakerRole,
2332
2315
  {
2333
2316
  ...nomineeProps,
2334
- roles: data == null ? void 0 : data.role,
2317
+ roles: data?.role,
2335
2318
  country,
2336
2319
  handleFieldChange
2337
2320
  }
@@ -2356,7 +2339,7 @@ function BasicDetails(props) {
2356
2339
  {
2357
2340
  ...childProps,
2358
2341
  name: "jobTitle",
2359
- value: data == null ? void 0 : data.jobTitle,
2342
+ value: data?.jobTitle,
2360
2343
  placeholder: formUtils.getPlaceholder("jobTitle"),
2361
2344
  readonly: formUtils.isReadOnly("jobTitle"),
2362
2345
  onInput: handleFieldChange("jobTitle", "input"),
@@ -2366,7 +2349,7 @@ function BasicDetails(props) {
2366
2349
  )
2367
2350
  }
2368
2351
  ),
2369
- !!((_c = contactDetailsFormProps == null ? void 0 : contactDetailsFormProps.requiredFields) == null ? void 0 : _c.length) && /* @__PURE__ */ jsx(
2352
+ !!contactDetailsFormProps?.requiredFields?.length && /* @__PURE__ */ jsx(
2370
2353
  ContactDetails,
2371
2354
  {
2372
2355
  ...contactDetailsFormProps,
@@ -2475,16 +2458,17 @@ const useDataConflicts = (providedData, detectedData, rules2 = {}, onAutoResolve
2475
2458
  const wasAutoResolved2 = autoResolvedPatches.size > 0;
2476
2459
  const resolvedData2 = wasAutoResolved2 ? { ...providedData ?? {}, ...Object.fromEntries(autoResolvedPatches) } : void 0;
2477
2460
  if (wasAutoResolved2 && !hasConflicts2 && resolvedData2) {
2478
- onAutoResolve == null ? void 0 : onAutoResolve(resolvedData2);
2461
+ onAutoResolve?.(resolvedData2);
2479
2462
  }
2480
2463
  return { hasConflicts: hasConflicts2, conflictingProperties: conflictingProperties2, wasAutoResolved: wasAutoResolved2, resolvedData: resolvedData2 };
2481
2464
  }, [providedData, detectedData, rules2, onAutoResolve]);
2482
2465
  return { hasConflicts, conflictingProperties, wasAutoResolved, resolvedData };
2483
2466
  };
2467
+ const isNextStepDisabled = signal(false);
2484
2468
  const conflictRowTable = "adyen-kyc-conflict-row-table";
2485
2469
  const conflictRowList = "adyen-kyc-conflict-row-list";
2486
2470
  const conflictRowListOptionLabel = "adyen-kyc-conflict-row-list-option-label";
2487
- const styles$6 = {
2471
+ const styles$5 = {
2488
2472
  conflictRowTable,
2489
2473
  conflictRowList,
2490
2474
  conflictRowListOptionLabel
@@ -2510,7 +2494,7 @@ const ConflictRow = ({
2510
2494
  }
2511
2495
  }, [hasOnlyProvided, hasOnlyDetected, onSelect, selected]);
2512
2496
  if (hasOnlyProvided || hasOnlyDetected) return;
2513
- return showAs === "listItem" ? /* @__PURE__ */ jsxs("div", { className: styles$6.conflictRowList, children: [
2497
+ return showAs === "listItem" ? /* @__PURE__ */ jsxs("div", { className: styles$5.conflictRowList, children: [
2514
2498
  /* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: i18n.get(label) }) }),
2515
2499
  /* @__PURE__ */ jsxs("dd", { children: [
2516
2500
  /* @__PURE__ */ jsxs("div", { children: [
@@ -2519,7 +2503,7 @@ const ConflictRow = ({
2519
2503
  {
2520
2504
  variant: "caption",
2521
2505
  color: "tertiary",
2522
- className: styles$6.conflictRowListOptionLabel,
2506
+ className: styles$5.conflictRowListOptionLabel,
2523
2507
  children: i18n.get("youEntered")
2524
2508
  }
2525
2509
  ),
@@ -2539,7 +2523,7 @@ const ConflictRow = ({
2539
2523
  {
2540
2524
  variant: "caption",
2541
2525
  color: "tertiary",
2542
- className: styles$6.conflictRowListOptionLabel,
2526
+ className: styles$5.conflictRowListOptionLabel,
2543
2527
  children: i18n.get("weDetected")
2544
2528
  }
2545
2529
  ),
@@ -2554,7 +2538,7 @@ const ConflictRow = ({
2554
2538
  )
2555
2539
  ] })
2556
2540
  ] })
2557
- ] }) : /* @__PURE__ */ jsxs("tr", { className: styles$6.conflictRowTable, children: [
2541
+ ] }) : /* @__PURE__ */ jsxs("tr", { className: styles$5.conflictRowTable, children: [
2558
2542
  /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: i18n.get(label) }) }),
2559
2543
  /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(
2560
2544
  RadioWithLabel,
@@ -2580,7 +2564,7 @@ const dataConflictsWrapper = "adyen-kyc-data-conflicts-wrapper";
2580
2564
  const dataConflictsHeader = "adyen-kyc-data-conflicts-header";
2581
2565
  const dataConflictsTable = "adyen-kyc-data-conflicts-table";
2582
2566
  const dataConflictsList = "adyen-kyc-data-conflicts-list";
2583
- const styles$5 = {
2567
+ const styles$4 = {
2584
2568
  dataConflictsWrapper,
2585
2569
  dataConflictsHeader,
2586
2570
  dataConflictsTable,
@@ -2621,13 +2605,13 @@ const DataConflictsModal = ({
2621
2605
  // No dependencies, as setShowError and setResolutions are stable.
2622
2606
  );
2623
2607
  return /* @__PURE__ */ jsxs(Modal, { ariaLabel: i18n.get(title), onClose: () => setShowCancelModal(true), inset: true, children: [
2624
- /* @__PURE__ */ jsxs("div", { className: styles$5.dataConflictsWrapper, children: [
2625
- /* @__PURE__ */ jsxs("div", { className: styles$5.dataConflictsHeader, children: [
2608
+ /* @__PURE__ */ jsxs("div", { className: styles$4.dataConflictsWrapper, children: [
2609
+ /* @__PURE__ */ jsxs("div", { className: styles$4.dataConflictsHeader, children: [
2626
2610
  /* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h1", children: i18n.get(title) }),
2627
2611
  /* @__PURE__ */ jsx(Typography, { variant: "body", children: i18n.get(explanation) })
2628
2612
  ] }),
2629
2613
  showError ? /* @__PURE__ */ jsx(Alert, { variant: "error", title: i18n.get("chooseTheCorrectDetailsBeforeProceeding") }) : void 0,
2630
- /* @__PURE__ */ jsx("dl", { className: styles$5.dataConflictsList, children: keysOf(conflictItems).map((property) => /* @__PURE__ */ jsx(
2614
+ /* @__PURE__ */ jsx("dl", { className: styles$4.dataConflictsList, children: keysOf(conflictItems).map((property) => /* @__PURE__ */ jsx(
2631
2615
  ConflictRow,
2632
2616
  {
2633
2617
  showAs: "listItem",
@@ -2640,7 +2624,7 @@ const DataConflictsModal = ({
2640
2624
  },
2641
2625
  property
2642
2626
  )) }),
2643
- /* @__PURE__ */ jsxs("table", { className: styles$5.dataConflictsTable, children: [
2627
+ /* @__PURE__ */ jsxs("table", { className: styles$4.dataConflictsTable, children: [
2644
2628
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
2645
2629
  /* @__PURE__ */ jsx("th", {}),
2646
2630
  /* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "tertiary", children: i18n.get("youEntered") }) }),
@@ -2698,12 +2682,12 @@ const DataConflictsModal = ({
2698
2682
  ] });
2699
2683
  };
2700
2684
  const verificationDisclaimer = "adyen-kyc-verification-disclaimer";
2701
- const styles$4 = {
2685
+ const styles$3 = {
2702
2686
  verificationDisclaimer
2703
2687
  };
2704
2688
  const IdVerificationDisclaimer = () => {
2705
2689
  const { i18n } = useI18nContext();
2706
- return /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "tertiary", className: styles$4.verificationDisclaimer, children: [
2690
+ return /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "tertiary", className: styles$3.verificationDisclaimer, children: [
2707
2691
  i18n.get("ifYouChooseToUseOnfido"),
2708
2692
  " ",
2709
2693
  /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: i18n.get("onfidoPrivacyPolicy") }),
@@ -2716,25 +2700,25 @@ const IdVerificationDisclaimer = () => {
2716
2700
  const verificationHeader = "adyen-kyc-verification-header";
2717
2701
  const verificationHeaderImage = "adyen-kyc-verification-header-image";
2718
2702
  const verificationHeaderContent = "adyen-kyc-verification-header-content";
2719
- const styles$3 = {
2703
+ const styles$2 = {
2720
2704
  verificationHeader,
2721
2705
  verificationHeaderImage,
2722
2706
  verificationHeaderContent
2723
2707
  };
2724
2708
  const IdVerificationHeader = () => {
2725
2709
  const { i18n } = useI18nContext();
2726
- return /* @__PURE__ */ jsxs("div", { className: styles$3.verificationHeader, children: [
2710
+ return /* @__PURE__ */ jsxs("div", { className: styles$2.verificationHeader, children: [
2727
2711
  /* @__PURE__ */ jsx(
2728
2712
  Svg,
2729
2713
  {
2730
- className: styles$3.verificationHeaderImage,
2714
+ className: styles$2.verificationHeaderImage,
2731
2715
  type: "image",
2732
2716
  name: "passport-front-green",
2733
2717
  title: i18n.get("instantIDVerificationDescription")
2734
2718
  }
2735
2719
  ),
2736
2720
  /* @__PURE__ */ jsx(Typography, { variant: "title-l", children: i18n.get("capturePersonalDetails") }),
2737
- /* @__PURE__ */ jsxs(Typography, { variant: "body", color: "primary", className: styles$3.verificationHeaderContent, children: [
2721
+ /* @__PURE__ */ jsxs(Typography, { variant: "body", color: "primary", className: styles$2.verificationHeaderContent, children: [
2738
2722
  i18n.get("takeOrUploadAPhoto"),
2739
2723
  " ",
2740
2724
  /* @__PURE__ */ jsx(Link, { href: "https://onfido.com", external: true, inline: true, children: i18n.get("onfido") })
@@ -2744,7 +2728,7 @@ const IdVerificationHeader = () => {
2744
2728
  const verifyOnfidoContainer = "adyen-kyc-verify-onfido-container";
2745
2729
  const verifyOnfidoError = "adyen-kyc-verify-onfido-error";
2746
2730
  const verifyOnfidoContent = "adyen-kyc-verify-onfido-content";
2747
- const styles$2 = {
2731
+ const styles$1 = {
2748
2732
  verifyOnfidoContainer,
2749
2733
  verifyOnfidoError,
2750
2734
  verifyOnfidoContent
@@ -2755,13 +2739,13 @@ const toIndividualOnfidoConflictSchema = ({
2755
2739
  }) => {
2756
2740
  return {
2757
2741
  // from basicDetails
2758
- firstName: basicDetails == null ? void 0 : basicDetails.firstName,
2759
- lastName: basicDetails == null ? void 0 : basicDetails.lastName,
2760
- email: basicDetails == null ? void 0 : basicDetails.email,
2761
- phoneNumber: basicDetails == null ? void 0 : basicDetails.phoneNumber,
2742
+ firstName: basicDetails?.firstName,
2743
+ lastName: basicDetails?.lastName,
2744
+ email: basicDetails?.email,
2745
+ phoneNumber: basicDetails?.phoneNumber,
2762
2746
  // from additionalPersonalDetails
2763
- birthDate: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.birthDate,
2764
- nationality: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.nationality,
2747
+ birthDate: additionalPersonalDetails?.birthDate,
2748
+ nationality: additionalPersonalDetails?.nationality,
2765
2749
  address: pick(
2766
2750
  "address",
2767
2751
  "otherAddressInformation",
@@ -2771,11 +2755,11 @@ const toIndividualOnfidoConflictSchema = ({
2771
2755
  "country"
2772
2756
  ).from(additionalPersonalDetails),
2773
2757
  // from additionalPersonalDetails (flattened so that `id` fields can be compared at granular level)
2774
- idNumber: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.idNumber,
2775
- typeOfIdentity: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.typeOfIdentity,
2776
- issuerState: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.issuerState,
2777
- licenseCardNumber: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.licenseCardNumber,
2778
- expiryDate: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.expiryDate
2758
+ idNumber: additionalPersonalDetails?.idNumber,
2759
+ typeOfIdentity: additionalPersonalDetails?.typeOfIdentity,
2760
+ issuerState: additionalPersonalDetails?.issuerState,
2761
+ licenseCardNumber: additionalPersonalDetails?.licenseCardNumber,
2762
+ expiryDate: additionalPersonalDetails?.expiryDate
2779
2763
  };
2780
2764
  };
2781
2765
  const fromIndividualOnfidoConflictSchema = ({
@@ -2890,12 +2874,12 @@ const OnfidoVerificationModal = ({
2890
2874
  ) });
2891
2875
  };
2892
2876
  const uploadedDocument = "adyen-kyc-uploaded-document";
2893
- const styles$1 = {
2877
+ const styles = {
2894
2878
  uploadedDocument
2895
2879
  };
2896
2880
  const UploadedDocument = ({ document, onDelete, onUpdate }) => {
2897
2881
  const { i18n } = useI18nContext();
2898
- return /* @__PURE__ */ jsxs("article", { className: styles$1.uploadedDocument, children: [
2882
+ return /* @__PURE__ */ jsxs("article", { className: styles.uploadedDocument, children: [
2899
2883
  /* @__PURE__ */ jsxs("div", { children: [
2900
2884
  /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "title", children: i18n.get(document.idDocumentType) }),
2901
2885
  /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("uploadedOn", {
@@ -2925,7 +2909,6 @@ const idVerificationMethodFields = [
2925
2909
  "idDocument"
2926
2910
  ];
2927
2911
  function IdVerificationMethod(props) {
2928
- var _a, _b, _c, _d, _e, _f;
2929
2912
  const {
2930
2913
  legalEntityId,
2931
2914
  handlers,
@@ -2940,7 +2923,7 @@ function IdVerificationMethod(props) {
2940
2923
  form: { data, handleChangeFor, setFormData }
2941
2924
  } = useFormContext();
2942
2925
  const datasetUtils = datasetUtilities(i18n.locale);
2943
- const existingDocument = (_a = data.idVerificationMethod) == null ? void 0 : _a.idDocument;
2926
+ const existingDocument = data.idVerificationMethod?.idDocument;
2944
2927
  const hasExistingDocument = !isEmpty$1(existingDocument);
2945
2928
  const handleFieldChange = useCallback(
2946
2929
  (fieldName, mode = "input") => handleChangeFor(fieldName, "idVerificationMethod", mode),
@@ -2977,7 +2960,6 @@ function IdVerificationMethod(props) {
2977
2960
  handlers.handleContinueToAdditionalDetails();
2978
2961
  };
2979
2962
  const validateExtractionResult = (extractionResult) => {
2980
- var _a2;
2981
2963
  const { isExpired, isValidDocumentType, dateOfBirth, issuingCountry } = extractionResult;
2982
2964
  if (isExpired) {
2983
2965
  return { key: "theDocumentYouUploadedIsExpired" };
@@ -2989,7 +2971,7 @@ function IdVerificationMethod(props) {
2989
2971
  return {
2990
2972
  key: "weDontAcceptDocumentsOrInformationAboutAnyoneYoungerThan_",
2991
2973
  options: {
2992
- values: { minimumOnboardingAge: ((_a2 = extractionResult.minimumOnboardingAge) == null ? void 0 : _a2.toString()) ?? "" }
2974
+ values: { minimumOnboardingAge: extractionResult.minimumOnboardingAge?.toString() ?? "" }
2993
2975
  }
2994
2976
  };
2995
2977
  }
@@ -3002,9 +2984,9 @@ function IdVerificationMethod(props) {
3002
2984
  onAutoResolve
3003
2985
  );
3004
2986
  const minimumApplicantDetails = {
3005
- firstName: (_b = data.basicDetails) == null ? void 0 : _b.firstName,
3006
- lastName: (_c = data.basicDetails) == null ? void 0 : _c.lastName,
3007
- residencyCountry: (_d = data.additionalPersonalDetails) == null ? void 0 : _d.country
2987
+ firstName: data.basicDetails?.firstName,
2988
+ lastName: data.basicDetails?.lastName,
2989
+ residencyCountry: data.additionalPersonalDetails?.country
3008
2990
  };
3009
2991
  const launchOnfido = () => {
3010
2992
  clearError();
@@ -3041,11 +3023,25 @@ function IdVerificationMethod(props) {
3041
3023
  });
3042
3024
  setStatus("ready");
3043
3025
  } catch (err) {
3044
- handleOnfidoError(err);
3026
+ handleOnfidoExtractionError(err);
3027
+ handleFieldChange("idDocument")({
3028
+ instantIdVerificationData: onfidoResult,
3029
+ idDocumentType: onfidoResult.document_front.type,
3030
+ modificationDate: (/* @__PURE__ */ new Date()).toISOString()
3031
+ });
3045
3032
  } finally {
3046
3033
  setShowLoadingSpinner(false);
3047
3034
  }
3048
3035
  };
3036
+ const handleOnfidoExtractionError = (error2) => {
3037
+ logger$2.error("Onfido extraction error", error2);
3038
+ userEvents.addPageEvent("Encountered error", {
3039
+ actionType: "submit",
3040
+ returnType: "onfido",
3041
+ returnValue: "weCouldNotExtractDocumentInformation"
3042
+ });
3043
+ setStatus("ready");
3044
+ };
3049
3045
  const handleOnfidoError = (error2) => {
3050
3046
  logger$2.error("Onfido error", error2);
3051
3047
  setError({ key: "weCouldNotReachOnfido" });
@@ -3088,7 +3084,7 @@ function IdVerificationMethod(props) {
3088
3084
  handleFieldChange("idDocument")(void 0);
3089
3085
  }
3090
3086
  };
3091
- if (hasLiveSelfieErrorCode && ((_e = data.idVerificationMethod) == null ? void 0 : _e.idVerificationMethod) === "existingDocument") {
3087
+ if (hasLiveSelfieErrorCode && data.idVerificationMethod?.idVerificationMethod === "existingDocument") {
3092
3088
  handleDeleteDocument();
3093
3089
  }
3094
3090
  const handleCancelDeleteDocument = () => {
@@ -3115,7 +3111,8 @@ function IdVerificationMethod(props) {
3115
3111
  };
3116
3112
  const modalProvidedData = resolvedData || comparableExistingData;
3117
3113
  const formUtils = createFormUtils(props, i18n);
3118
- return /* @__PURE__ */ jsxs("div", { className: styles$2.verifyOnfidoContainer, children: [
3114
+ isNextStepDisabled.value = showLoadingSpinner;
3115
+ return /* @__PURE__ */ jsxs("div", { className: styles$1.verifyOnfidoContainer, children: [
3119
3116
  /* @__PURE__ */ jsx(
3120
3117
  ErrorPanel,
3121
3118
  {
@@ -3131,10 +3128,10 @@ function IdVerificationMethod(props) {
3131
3128
  {
3132
3129
  variant: "error",
3133
3130
  title: i18n.get(error.key, error.options),
3134
- className: styles$2.verifyOnfidoError
3131
+ className: styles$1.verifyOnfidoError
3135
3132
  }
3136
3133
  ) : void 0,
3137
- /* @__PURE__ */ jsx("div", { className: styles$2.verifyOnfidoContent, children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : /* @__PURE__ */ jsx(Fragment, { children: hasExistingDocument ? /* @__PURE__ */ jsx(
3134
+ /* @__PURE__ */ jsx("div", { className: styles$1.verifyOnfidoContent, children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : /* @__PURE__ */ jsx(Fragment, { children: hasExistingDocument ? /* @__PURE__ */ jsx(
3138
3135
  UploadedDocument,
3139
3136
  {
3140
3137
  document: existingDocument,
@@ -3152,7 +3149,7 @@ function IdVerificationMethod(props) {
3152
3149
  onClick: launchOnfido
3153
3150
  }
3154
3151
  ),
3155
- !((_f = showIndividualMotionCapture) == null ? void 0 : _f.value) && /* @__PURE__ */ jsx(
3152
+ !showIndividualMotionCapture?.value && /* @__PURE__ */ jsx(
3156
3153
  Button,
3157
3154
  {
3158
3155
  onClick: () => setStatus("confirmManualFlowModal"),
@@ -3216,13 +3213,12 @@ function IdVerificationMethod(props) {
3216
3213
  ] });
3217
3214
  }
3218
3215
  const ManualIdUpload = () => {
3219
- var _a, _b;
3220
3216
  const { form } = useFormContext();
3221
3217
  const { handleChangeFor } = form;
3222
3218
  const data = form.data.manualIdUpload;
3223
3219
  const valid = form.valid.manualIdUpload;
3224
3220
  const errors = form.errors.manualIdUpload;
3225
- const name = `${(_a = form.data.basicDetails) == null ? void 0 : _a.firstName} ${(_b = form.data.basicDetails) == null ? void 0 : _b.lastName}`;
3221
+ const name = `${form.data.basicDetails?.firstName} ${form.data.basicDetails?.lastName}`;
3226
3222
  const handleFieldChange = (fieldName, mode) => handleChangeFor(fieldName, "manualIdUpload", mode);
3227
3223
  return /* @__PURE__ */ jsx(
3228
3224
  IdDocumentManualUpload,
@@ -3235,54 +3231,8 @@ const ManualIdUpload = () => {
3235
3231
  }
3236
3232
  );
3237
3233
  };
3238
- const getDisplayErrorMessage = (errorMessage, i18n) => {
3239
- return typeof errorMessage !== "boolean" ? i18n.get(errorMessage) : errorMessage;
3240
- };
3241
- const guidanceQuestion = "adyen-kyc-guidance-question";
3242
- const options = "adyen-kyc-options";
3243
- const styles = {
3244
- guidanceQuestion,
3245
- options
3246
- };
3247
- const GuidanceQuestion = (props) => {
3248
- const {
3249
- descriptionLinkText,
3250
- errorMessage,
3251
- name,
3252
- noLabel,
3253
- onChange,
3254
- onDescriptionLinkClick,
3255
- question,
3256
- value,
3257
- yesLabel
3258
- } = props;
3259
- const { i18n } = useI18nContext();
3260
- const handleChange = (selectedValue) => {
3261
- const newValue = selectedValue || null;
3262
- onChange(newValue);
3263
- };
3264
- const yesTileLabel = yesLabel ?? i18n.get("yes");
3265
- const noTileLabel = noLabel ?? i18n.get("no");
3266
- return /* @__PURE__ */ jsxs("div", { className: styles.guidanceQuestion, children: [
3267
- /* @__PURE__ */ jsx(Typography, { variant: "body", el: "p", children: question }),
3268
- descriptionLinkText && onDescriptionLinkClick && /* @__PURE__ */ jsx(Button, { variant: "link", onClick: onDescriptionLinkClick, children: descriptionLinkText }),
3269
- /* @__PURE__ */ jsx(Field, { name, className: styles.options, children: () => /* @__PURE__ */ jsx(
3270
- TileGroup,
3271
- {
3272
- allowMultiple: false,
3273
- errorMessage,
3274
- isHorizontal: true,
3275
- maxSelected: 1,
3276
- name,
3277
- onChange: handleChange,
3278
- selected: value || "",
3279
- tiles: [
3280
- { label: yesTileLabel, value: "yes" },
3281
- { label: noTileLabel, value: "no" }
3282
- ]
3283
- }
3284
- ) })
3285
- ] });
3234
+ const getDisplayErrorMessage = (errorMessage, t) => {
3235
+ return typeof errorMessage !== "boolean" ? translateStringOrObject(t, errorMessage) : errorMessage;
3286
3236
  };
3287
3237
  const SignatoryQuestionnaireModalContent = () => {
3288
3238
  const { i18n } = useI18nContext();
@@ -3295,7 +3245,9 @@ const SignatoryQuestionnaireModalContent = () => {
3295
3245
  ] });
3296
3246
  };
3297
3247
  function SignatoryQuestionnaire(props) {
3248
+ const { t } = useTranslation();
3298
3249
  const { i18n } = useI18nContext();
3250
+ const userEvents = useAnalyticsContext();
3299
3251
  const [isModalOpen, setIsModalOpen] = useState(false);
3300
3252
  const {
3301
3253
  data,
@@ -3309,8 +3261,19 @@ function SignatoryQuestionnaire(props) {
3309
3261
  if (!handleFieldChange) {
3310
3262
  return;
3311
3263
  }
3312
- const toggleModal = () => {
3313
- setIsModalOpen(!isModalOpen);
3264
+ const openModal = () => {
3265
+ userEvents.addPageEvent("Opened modal", {
3266
+ actionType: "open",
3267
+ label: "isSignatoryModal"
3268
+ });
3269
+ setIsModalOpen(true);
3270
+ };
3271
+ const closeModal = () => {
3272
+ userEvents.addPageEvent("Closed modal", {
3273
+ actionType: "close",
3274
+ label: "isSignatoryModal"
3275
+ });
3276
+ setIsModalOpen(false);
3314
3277
  };
3315
3278
  const errorMessage = formUtils.getErrorMessage("isSignatory", errors, fieldValidationErrors);
3316
3279
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__personal-details", "aria-describedby": "ariaErrorField", children: [
@@ -3328,25 +3291,19 @@ function SignatoryQuestionnaire(props) {
3328
3291
  GuidanceQuestion,
3329
3292
  {
3330
3293
  name: "isSignatory",
3331
- value: data == null ? void 0 : data.isSignatory,
3294
+ value: data?.isSignatory,
3332
3295
  onChange: handleFieldChange("isSignatory"),
3333
- onDescriptionLinkClick: toggleModal,
3296
+ onDescriptionLinkClick: openModal,
3334
3297
  question: i18n.get("signatoryQuestion"),
3335
3298
  descriptionLinkText: i18n.get("whatDoesThisMean"),
3336
- errorMessage: getDisplayErrorMessage(errorMessage, i18n)
3299
+ errorMessage: getDisplayErrorMessage(errorMessage, t)
3337
3300
  }
3338
3301
  ),
3339
- isModalOpen && /* @__PURE__ */ jsx(Modal, { onClose: toggleModal, ariaLabel: i18n.get("moreAboutAuthorizedSignatories"), inset: true, children: /* @__PURE__ */ jsx(SignatoryQuestionnaireModalContent, {}) })
3302
+ isModalOpen && /* @__PURE__ */ jsx(Modal, { onClose: closeModal, ariaLabel: i18n.get("moreAboutAuthorizedSignatories"), inset: true, children: /* @__PURE__ */ jsx(SignatoryQuestionnaireModalContent, {}) })
3340
3303
  ] });
3341
3304
  }
3342
- const RichText = ({ content }) => {
3343
- if (!content) {
3344
- return null;
3345
- }
3346
- const parts = content.split(/<strong>|<\/strong>/);
3347
- return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, index) => index % 2 === 1 ? /* @__PURE__ */ jsx("strong", { children: part }, index) : part) });
3348
- };
3349
3305
  const UboQuestionnaireModalContent = ({ modalType }) => {
3306
+ const { t } = useTranslation();
3350
3307
  const { i18n } = useI18nContext();
3351
3308
  switch (modalType) {
3352
3309
  case "isOwner":
@@ -3378,10 +3335,10 @@ const UboQuestionnaireModalContent = ({ modalType }) => {
3378
3335
  /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("controllingPersonDescriptionQ1") }),
3379
3336
  /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("controllingPersonDescriptionA1P1") }),
3380
3337
  /* @__PURE__ */ jsxs("ul", { children: [
3381
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RichText, { content: i18n.get("controllingPersonDescriptionA1L1") }) }),
3382
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RichText, { content: i18n.get("controllingPersonDescriptionA1L2") }) }),
3383
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RichText, { content: i18n.get("controllingPersonDescriptionA1L3") }) }),
3384
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RichText, { content: i18n.get("controllingPersonDescriptionA1L4") }) })
3338
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L1"] }) }),
3339
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L2"] }) }),
3340
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L3"] }) }),
3341
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L4"] }) })
3385
3342
  ] }),
3386
3343
  /* @__PURE__ */ jsx(
3387
3344
  Alert,
@@ -3417,7 +3374,9 @@ const uboQuestionnaireFields = [
3417
3374
  "isNomineeShareholder"
3418
3375
  ];
3419
3376
  function UboQuestionnaire(props) {
3377
+ const { t } = useTranslation();
3420
3378
  const { i18n } = useI18nContext();
3379
+ const userEvents = useAnalyticsContext();
3421
3380
  const {
3422
3381
  data,
3423
3382
  description,
@@ -3433,9 +3392,19 @@ function UboQuestionnaire(props) {
3433
3392
  return;
3434
3393
  }
3435
3394
  const openModal = (modalType) => () => {
3395
+ userEvents.addPageEvent("Opened modal", {
3396
+ actionType: "open",
3397
+ label: `${modalType}Modal`
3398
+ });
3436
3399
  setActiveModal(modalType);
3437
3400
  };
3438
3401
  const closeModal = () => {
3402
+ if (activeModal) {
3403
+ userEvents.addPageEvent("Closed modal", {
3404
+ actionType: "close",
3405
+ label: `${activeModal}Modal`
3406
+ });
3407
+ }
3439
3408
  setActiveModal(null);
3440
3409
  };
3441
3410
  const modalAriaLabelMap = {
@@ -3479,56 +3448,56 @@ function UboQuestionnaire(props) {
3479
3448
  GuidanceQuestion,
3480
3449
  {
3481
3450
  name: "isDirector",
3482
- value: data == null ? void 0 : data.isDirector,
3451
+ value: data?.isDirector,
3483
3452
  onChange: handleFieldChange("isDirector"),
3484
3453
  onDescriptionLinkClick: openModal("isDirector"),
3485
3454
  question: i18n.get("directorQuestion"),
3486
3455
  descriptionLinkText: i18n.get("whatDoesThisMean"),
3487
- errorMessage: getDisplayErrorMessage(isDirectorErrorMessage, i18n)
3456
+ errorMessage: getDisplayErrorMessage(isDirectorErrorMessage, t)
3488
3457
  }
3489
3458
  ),
3490
- formUtils.isRequiredField("isNomineeDirector") && (data == null ? void 0 : data.isDirector) === "yes" && /* @__PURE__ */ jsx(
3459
+ formUtils.isRequiredField("isNomineeDirector") && data?.isDirector === GuidanceQuestionValues.YES && /* @__PURE__ */ jsx(
3491
3460
  GuidanceQuestion,
3492
3461
  {
3493
3462
  name: "isNomineeDirector",
3494
- value: data == null ? void 0 : data.isNomineeDirector,
3463
+ value: data?.isNomineeDirector,
3495
3464
  onChange: handleFieldChange("isNomineeDirector"),
3496
3465
  question: i18n.get("nomineeDirectorQuestion"),
3497
- errorMessage: getDisplayErrorMessage(isNomineeDirectorErrorMessage, i18n)
3466
+ errorMessage: getDisplayErrorMessage(isNomineeDirectorErrorMessage, t)
3498
3467
  }
3499
3468
  ),
3500
3469
  formUtils.isRequiredField("isOwner") && /* @__PURE__ */ jsx(
3501
3470
  GuidanceQuestion,
3502
3471
  {
3503
3472
  name: "isOwner",
3504
- value: data == null ? void 0 : data.isOwner,
3473
+ value: data?.isOwner,
3505
3474
  onChange: handleFieldChange("isOwner"),
3506
3475
  onDescriptionLinkClick: openModal("isOwner"),
3507
3476
  question: i18n.get("ownerQuestion"),
3508
3477
  descriptionLinkText: i18n.get("whatDoesThisMean"),
3509
- errorMessage: getDisplayErrorMessage(isOwnerErrorMessage, i18n)
3478
+ errorMessage: getDisplayErrorMessage(isOwnerErrorMessage, t)
3510
3479
  }
3511
3480
  ),
3512
- formUtils.isRequiredField("isNomineeShareholder") && (data == null ? void 0 : data.isOwner) === "yes" && /* @__PURE__ */ jsx(
3481
+ formUtils.isRequiredField("isNomineeShareholder") && data?.isOwner === GuidanceQuestionValues.YES && /* @__PURE__ */ jsx(
3513
3482
  GuidanceQuestion,
3514
3483
  {
3515
3484
  name: "isNomineeShareholder",
3516
- value: data == null ? void 0 : data.isNomineeShareholder,
3485
+ value: data?.isNomineeShareholder,
3517
3486
  onChange: handleFieldChange("isNomineeShareholder"),
3518
3487
  question: i18n.get("nomineeShareHolderQuestion"),
3519
- errorMessage: getDisplayErrorMessage(isNomineeShareholderErrorMessage, i18n)
3488
+ errorMessage: getDisplayErrorMessage(isNomineeShareholderErrorMessage, t)
3520
3489
  }
3521
3490
  ),
3522
3491
  formUtils.isRequiredField("isControllingPerson") && /* @__PURE__ */ jsx(
3523
3492
  GuidanceQuestion,
3524
3493
  {
3525
3494
  name: "isControllingPerson",
3526
- value: data == null ? void 0 : data.isControllingPerson,
3495
+ value: data?.isControllingPerson,
3527
3496
  onChange: handleFieldChange("isControllingPerson"),
3528
3497
  onDescriptionLinkClick: openModal("isControllingPerson"),
3529
3498
  question: i18n.get("controllingPersonQuestion"),
3530
3499
  descriptionLinkText: i18n.get("whatDoesThisMean"),
3531
- errorMessage: getDisplayErrorMessage(isControllingPersonErrorMessage, i18n)
3500
+ errorMessage: getDisplayErrorMessage(isControllingPersonErrorMessage, t)
3532
3501
  }
3533
3502
  ),
3534
3503
  activeModal && /* @__PURE__ */ jsx(Modal, { onClose: closeModal, ariaLabel: modalAriaLabelMap[activeModal], inset: true, children: /* @__PURE__ */ jsx(UboQuestionnaireModalContent, { modalType: activeModal }) })
@@ -3593,14 +3562,15 @@ const proofOfNationalIdFormID = individualOnfidoForms.proofOfNationalId.formId;
3593
3562
  const proofOfRelationshipFormID = individualOnfidoForms.proofOfRelationship.formId;
3594
3563
  const LIVE_SELFIE_ERROR_CODE = "2_8210";
3595
3564
  function IndividualOnfido(props) {
3596
- var _a, _b, _c, _d, _e, _f;
3597
3565
  const { i18n } = useI18nContext();
3566
+ const userEvents = useAnalyticsContext();
3598
3567
  const {
3599
3568
  form: { errors, valid, fieldProblems: fieldValidationErrors, handleChangeFor, setFormData }
3600
3569
  } = useFormContext();
3601
3570
  const { setFormIndex } = useFormRouterContext();
3602
3571
  const { isExperimentEnabled } = useExperimentsContext();
3603
3572
  const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
3573
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
3604
3574
  const [isDecisionMakerNotRequiredModalOpen, setIsDecisionMakerNotRequiredModalOpen] = useState(false);
3605
3575
  const {
3606
3576
  activeForm: propActiveForm,
@@ -3625,31 +3595,42 @@ function IndividualOnfido(props) {
3625
3595
  const proofOfResidencyFormProps = getFormProps(props, proofOfResidencyFormID);
3626
3596
  const proofOfNationalIdFormProps = getFormProps(props, proofOfNationalIdFormID);
3627
3597
  const proofOfRelationshipFormProps = getFormProps(props, proofOfRelationshipFormID);
3628
- const countryOfResidence = ((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country) ?? defaultCountry;
3598
+ const countryOfResidence = data?.additionalPersonalDetails?.country ?? defaultCountry;
3629
3599
  const handleNextForPersonNotRequired = () => {
3630
- var _a2;
3631
- if (!(data == null ? void 0 : data.signatoryQuestionnaire) && !(data == null ? void 0 : data.uboQuestionnaire)) return;
3600
+ if (!data?.signatoryQuestionnaire && !data?.uboQuestionnaire) return;
3632
3601
  const { signatoryQuestionnaire, uboQuestionnaire } = data;
3633
- const isDirectorApplicable = (_a2 = uboQuestionnaireFormProps == null ? void 0 : uboQuestionnaireFormProps.requiredFields) == null ? void 0 : _a2.includes("isDirector");
3634
- const isNotRequired = signatoryQuestionnaire && uboQuestionnaire && (signatoryQuestionnaire == null ? void 0 : signatoryQuestionnaire.isSignatory) === "no" && (uboQuestionnaire == null ? void 0 : uboQuestionnaire.isOwner) === "no" && (uboQuestionnaire == null ? void 0 : uboQuestionnaire.isControllingPerson) === "no" && (!isDirectorApplicable || (uboQuestionnaire == null ? void 0 : uboQuestionnaire.isDirector) === "no");
3602
+ const isDirectorApplicable = uboQuestionnaireFormProps?.requiredFields?.includes("isDirector");
3603
+ const isNotRequired = signatoryQuestionnaire && uboQuestionnaire && signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.NO && uboQuestionnaire?.isOwner === GuidanceQuestionValues.NO && uboQuestionnaire?.isControllingPerson === GuidanceQuestionValues.NO && (!isDirectorApplicable || uboQuestionnaire?.isDirector === GuidanceQuestionValues.NO);
3635
3604
  if (isNotRequired) {
3605
+ userEvents.addPageEvent("Opened modal", {
3606
+ actionType: "open",
3607
+ label: "personalInfoNotNeeded"
3608
+ });
3636
3609
  setIsDecisionMakerNotRequiredModalOpen(true);
3637
3610
  } else {
3638
- onNext == null ? void 0 : onNext();
3611
+ onNext?.();
3639
3612
  }
3640
3613
  };
3641
3614
  useEffect(() => {
3642
3615
  if (propActiveForm.formId === uboQuestionnaireFormID) {
3643
- setNextHandler == null ? void 0 : setNextHandler(() => handleNextForPersonNotRequired);
3616
+ setNextHandler?.(() => handleNextForPersonNotRequired);
3644
3617
  } else {
3645
- setNextHandler == null ? void 0 : setNextHandler(void 0);
3618
+ setNextHandler?.(void 0);
3646
3619
  }
3647
3620
  }, [propActiveForm, setNextHandler, data]);
3648
3621
  const handleCloseModalAndGoBack = () => {
3622
+ userEvents.addPageEvent("Closed modal", {
3623
+ actionType: "close",
3624
+ label: "personalInfoNotNeeded"
3625
+ });
3649
3626
  setIsDecisionMakerNotRequiredModalOpen(false);
3650
- handleHomeClick == null ? void 0 : handleHomeClick();
3627
+ handleHomeClick?.();
3651
3628
  };
3652
3629
  const handleCloseModalAndChangeAnswers = () => {
3630
+ userEvents.addPageEvent("Clicked button", {
3631
+ actionType: "cancel",
3632
+ label: `personalInfoNotNeeded`
3633
+ });
3653
3634
  setIsDecisionMakerNotRequiredModalOpen(false);
3654
3635
  };
3655
3636
  const gotoFormByFormId = (formId) => {
@@ -3669,34 +3650,37 @@ function IndividualOnfido(props) {
3669
3650
  const capabilities = useCapabilities();
3670
3651
  const newRoles = useMemo(() => calculateRoles(data), [data]);
3671
3652
  useEffect(() => {
3672
- var _a2;
3673
- if (isGuidedDecisionMakersFlowEnabled) {
3674
- const currentRoles = ((_a2 = data == null ? void 0 : data.basicDetails) == null ? void 0 : _a2.role) ?? [];
3653
+ if (!isGuidedDecisionMakersFlowDisabled && isGuidedDecisionMakersFlowEnabled) {
3654
+ const currentRoles = data?.basicDetails?.role ?? [];
3675
3655
  if (areArraysDifferent(newRoles, currentRoles)) {
3676
- const basicDetailsData = (data == null ? void 0 : data.basicDetails) ?? {};
3656
+ const basicDetailsData = data?.basicDetails ?? {};
3677
3657
  setFormData("basicDetails", { ...basicDetailsData, role: newRoles });
3678
3658
  }
3679
3659
  }
3680
- }, [newRoles, data == null ? void 0 : data.basicDetails, setFormData, isGuidedDecisionMakersFlowEnabled]);
3681
- const hasMotionCaptureScenarioValue = (_b = hasMotionCaptureScenario) == null ? void 0 : _b.value;
3660
+ }, [
3661
+ newRoles,
3662
+ data?.basicDetails,
3663
+ setFormData,
3664
+ isGuidedDecisionMakersFlowDisabled,
3665
+ isGuidedDecisionMakersFlowEnabled
3666
+ ]);
3667
+ const hasMotionCaptureScenarioValue = hasMotionCaptureScenario?.value;
3682
3668
  useEffect(() => {
3683
- var _a2;
3684
3669
  setShowIndividualMotionCapture(
3685
3670
  shouldShowMotionCapture({
3686
3671
  capabilities,
3687
- userRoles: (_a2 = data == null ? void 0 : data.basicDetails) == null ? void 0 : _a2.role,
3672
+ userRoles: data?.basicDetails?.role,
3688
3673
  taskType,
3689
3674
  hasMotionScenario: hasMotionCaptureScenarioValue
3690
3675
  })
3691
3676
  );
3692
- }, [(_c = data == null ? void 0 : data.basicDetails) == null ? void 0 : _c.role, taskType, capabilities, hasMotionCaptureScenarioValue]);
3693
- const fullName = `${(_d = data == null ? void 0 : data.basicDetails) == null ? void 0 : _d.firstName} ${(_e = data == null ? void 0 : data.basicDetails) == null ? void 0 : _e.lastName}`;
3677
+ }, [data?.basicDetails?.role, taskType, capabilities, hasMotionCaptureScenarioValue]);
3678
+ const fullName = `${data?.basicDetails?.firstName} ${data?.basicDetails?.lastName}`;
3694
3679
  const handleFieldChange = (formName) => (fieldName, mode) => handleChangeFor(fieldName, formName, mode);
3695
- const hasLiveSelfieErrorCode = (_f = problems == null ? void 0 : problems.missingData) == null ? void 0 : _f.some(
3680
+ const hasLiveSelfieErrorCode = problems?.missingData?.some(
3696
3681
  (problem) => problem.code === LIVE_SELFIE_ERROR_CODE && problem.type === "dataMissing"
3697
3682
  );
3698
3683
  const renderActiveForm = (activeForm) => {
3699
- var _a2, _b2;
3700
3684
  switch (activeForm.formId) {
3701
3685
  case signatoryQuestionnaireFormID:
3702
3686
  return /* @__PURE__ */ jsx(
@@ -3706,8 +3690,8 @@ function IndividualOnfido(props) {
3706
3690
  heading: i18n.get("signatoryQuestionnaireHeader"),
3707
3691
  id: signatoryQuestionnaireFormID,
3708
3692
  handleFieldChange: handleFieldChange("signatoryQuestionnaire"),
3709
- errors: errors == null ? void 0 : errors.signatoryQuestionnaire,
3710
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.signatoryQuestionnaire
3693
+ errors: errors?.signatoryQuestionnaire,
3694
+ fieldValidationErrors: fieldValidationErrors?.signatoryQuestionnaire
3711
3695
  }
3712
3696
  );
3713
3697
  case uboQuestionnaireFormID:
@@ -3719,8 +3703,8 @@ function IndividualOnfido(props) {
3719
3703
  description: i18n.get("uboQuestionnaireDescription"),
3720
3704
  id: uboQuestionnaireFormID,
3721
3705
  handleFieldChange: handleFieldChange("uboQuestionnaire"),
3722
- errors: errors == null ? void 0 : errors.uboQuestionnaire,
3723
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.uboQuestionnaire
3706
+ errors: errors?.uboQuestionnaire,
3707
+ fieldValidationErrors: fieldValidationErrors?.uboQuestionnaire
3724
3708
  }
3725
3709
  );
3726
3710
  case basicDetailsFormID:
@@ -3728,7 +3712,7 @@ function IndividualOnfido(props) {
3728
3712
  BasicDetails,
3729
3713
  {
3730
3714
  ...basicDetailsFormProps,
3731
- data: (data == null ? void 0 : data.basicDetails) ?? {},
3715
+ data: data?.basicDetails ?? {},
3732
3716
  heading: i18n.get("basicInformationFormName"),
3733
3717
  taskType,
3734
3718
  id: basicDetailsFormID,
@@ -3737,9 +3721,9 @@ function IndividualOnfido(props) {
3737
3721
  parentLegalEntity,
3738
3722
  trustedFieldsProvider,
3739
3723
  trustedRoles,
3740
- errors: errors == null ? void 0 : errors.basicDetails,
3741
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.basicDetails,
3742
- valid: valid == null ? void 0 : valid.basicDetails,
3724
+ errors: errors?.basicDetails,
3725
+ fieldValidationErrors: fieldValidationErrors?.basicDetails,
3726
+ valid: valid?.basicDetails,
3743
3727
  handleFieldChange: handleFieldChange("basicDetails")
3744
3728
  }
3745
3729
  );
@@ -3753,8 +3737,8 @@ function IndividualOnfido(props) {
3753
3737
  handleDeleteDocument,
3754
3738
  handleUpdateDocument
3755
3739
  },
3756
- formVerificationErrors: (_a2 = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _a2.idVerificationMethod,
3757
- fieldValidationErrors: (_b2 = problems == null ? void 0 : problems.validationErrors) == null ? void 0 : _b2.idVerificationMethod,
3740
+ formVerificationErrors: problems?.verificationErrors?.idVerificationMethod,
3741
+ fieldValidationErrors: problems?.validationErrors?.idVerificationMethod,
3758
3742
  hasLiveSelfieErrorCode
3759
3743
  }
3760
3744
  );
@@ -3764,12 +3748,12 @@ function IndividualOnfido(props) {
3764
3748
  {
3765
3749
  ...additionalPersonalDetailsFormProps,
3766
3750
  country: countryOfResidence,
3767
- data: (data == null ? void 0 : data.additionalPersonalDetails) ?? {},
3751
+ data: data?.additionalPersonalDetails ?? {},
3768
3752
  heading: i18n.get("additionalPersonalDetails"),
3769
3753
  id: additionalPersonalDetailsFormID,
3770
- errors: errors == null ? void 0 : errors.additionalPersonalDetails,
3771
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.additionalPersonalDetails,
3772
- valid: valid == null ? void 0 : valid.additionalPersonalDetails,
3754
+ errors: errors?.additionalPersonalDetails,
3755
+ fieldValidationErrors: fieldValidationErrors?.additionalPersonalDetails,
3756
+ valid: valid?.additionalPersonalDetails,
3773
3757
  taskType,
3774
3758
  handleFieldChange: handleFieldChange("additionalPersonalDetails")
3775
3759
  }
@@ -3781,7 +3765,7 @@ function IndividualOnfido(props) {
3781
3765
  MemoizedProofOfResidencyUpload,
3782
3766
  {
3783
3767
  ...proofOfResidencyFormProps,
3784
- data: data == null ? void 0 : data.proofOfResidency,
3768
+ data: data?.proofOfResidency,
3785
3769
  id: proofOfResidencyFormID,
3786
3770
  name: fullName,
3787
3771
  errors: errors.proofOfResidency,
@@ -3795,7 +3779,7 @@ function IndividualOnfido(props) {
3795
3779
  MemoizedDocumentUpload,
3796
3780
  {
3797
3781
  ...proofOfNationalIdFormProps,
3798
- data: data == null ? void 0 : data.proofOfNationalId,
3782
+ data: data?.proofOfNationalId,
3799
3783
  documentField: "proofOfNationalId",
3800
3784
  documentType: "registrationDocument",
3801
3785
  heading: i18n.get("proofOfNationalId"),
@@ -3811,7 +3795,7 @@ function IndividualOnfido(props) {
3811
3795
  MemoizedProofOfRelationship,
3812
3796
  {
3813
3797
  ...proofOfRelationshipFormProps,
3814
- data: data == null ? void 0 : data.proofOfRelationship,
3798
+ data: data?.proofOfRelationship,
3815
3799
  id: proofOfRelationshipFormID,
3816
3800
  name: fullName,
3817
3801
  errors: errors.proofOfRelationship,
@@ -3839,23 +3823,67 @@ function IndividualOnfido(props) {
3839
3823
  )
3840
3824
  ] });
3841
3825
  }
3826
+ const getOnfidoIdentityTypeToApiIdentityTypeMap = (data) => {
3827
+ const { country } = data;
3828
+ switch (country) {
3829
+ case CountryCodes.HongKong:
3830
+ return {
3831
+ passport: "passport",
3832
+ driversLicense: "driversLicense",
3833
+ proofOfIdentityCard: "nationalIdNumber"
3834
+ };
3835
+ default:
3836
+ return {
3837
+ nationalIdNumber: "nationalIdNumber",
3838
+ passport: "passport",
3839
+ driversLicense: "driversLicense",
3840
+ proofOfIdentityCard: "identityCard"
3841
+ };
3842
+ }
3843
+ };
3844
+ const adjustOnfidoIdentificationData = (data, apiData) => {
3845
+ const { typeOfIdentity, idNumber, idNumberExempt } = data;
3846
+ const identificationData = {
3847
+ ...apiData,
3848
+ number: idNumber,
3849
+ type: getOnfidoIdentityTypeToApiIdentityTypeMap(data)[typeOfIdentity] ?? "nationalIdNumber"
3850
+ };
3851
+ switch (typeOfIdentity) {
3852
+ case "passport":
3853
+ return {
3854
+ ...identificationData,
3855
+ cardNumber: ""
3856
+ };
3857
+ case "driversLicense":
3858
+ return {
3859
+ ...identificationData,
3860
+ expiryDate: ""
3861
+ };
3862
+ default:
3863
+ return idNumber === void 0 && idNumberExempt === void 0 ? void 0 : {
3864
+ ...identificationData,
3865
+ expiryDate: "",
3866
+ cardNumber: "",
3867
+ nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
3868
+ };
3869
+ }
3870
+ };
3842
3871
  const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEnabled, matchingScenario) => {
3843
- var _a, _b, _c, _d, _e;
3844
3872
  const legalEntity = {
3845
3873
  ...formatObject(individualOnfido, individualOnfidoApiKeyMapping),
3846
3874
  type: LegalEntityType.INDIVIDUAL
3847
3875
  };
3848
3876
  if (individualOnfido.additionalPersonalDetails) {
3849
- if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && (matchingScenario == null ? void 0 : matchingScenario.includes(Scenarios.L_TAXINFO)) && ((_a = individualOnfido.additionalPersonalDetails) == null ? void 0 : _a.idNumber) && ((_b = individualOnfido.additionalPersonalDetails) == null ? void 0 : _b.typeOfIdentity) && ((_c = individualOnfido.additionalPersonalDetails) == null ? void 0 : _c.country) === CountryCodes.Spain) {
3877
+ if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && matchingScenario?.includes(Scenarios.L_TAXINFO) && individualOnfido.additionalPersonalDetails?.idNumber && individualOnfido.additionalPersonalDetails?.typeOfIdentity && individualOnfido.additionalPersonalDetails?.country === CountryCodes.Spain) {
3850
3878
  legalEntity.individual.taxInformation = [
3851
3879
  {
3852
3880
  country: individualOnfido.additionalPersonalDetails.country,
3853
3881
  number: individualOnfido.additionalPersonalDetails.idNumber,
3854
- type: individualOnfido.additionalPersonalDetails.typeOfIdentity
3882
+ type: individualOnfido.additionalPersonalDetails.typeOfIdentity.toUpperCase()
3855
3883
  }
3856
3884
  ];
3857
3885
  }
3858
- legalEntity.individual.identificationData = adjustIdentificationData(
3886
+ legalEntity.individual.identificationData = adjustOnfidoIdentificationData(
3859
3887
  individualOnfido.additionalPersonalDetails,
3860
3888
  legalEntity.individual.identificationData
3861
3889
  );
@@ -3864,7 +3892,7 @@ const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEn
3864
3892
  if (localization.length) {
3865
3893
  legalEntity.individual.name.localization = localization;
3866
3894
  }
3867
- if ((_d = individualOnfido.basicDetails) == null ? void 0 : _d.phoneNumber) {
3895
+ if (individualOnfido.basicDetails?.phoneNumber) {
3868
3896
  const phone = {
3869
3897
  number: individualOnfido.basicDetails.phoneNumber.number,
3870
3898
  type: "mobile"
@@ -3872,7 +3900,7 @@ const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEn
3872
3900
  if (phone.number && legalEntity.individual) {
3873
3901
  legalEntity.individual.phone = phone;
3874
3902
  } else {
3875
- (_e = legalEntity == null ? void 0 : legalEntity.individual) == null ? true : delete _e.phone;
3903
+ delete legalEntity?.individual?.phone;
3876
3904
  }
3877
3905
  }
3878
3906
  return legalEntity;
@@ -3881,14 +3909,13 @@ const getIndividualSchemaFromAPI = {
3881
3909
  ...individualOnfidoBaseMapping
3882
3910
  };
3883
3911
  const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity) => {
3884
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3885
3912
  let individualOnfido = {
3886
3913
  ...formatObject(legalEntity, getIndividualSchemaFromAPI)
3887
3914
  };
3888
3915
  individualOnfido = {
3889
3916
  ...individualOnfido,
3890
3917
  basicDetails: {
3891
- ...individualOnfido == null ? void 0 : individualOnfido.basicDetails,
3918
+ ...individualOnfido?.basicDetails,
3892
3919
  ...isChangingType && {
3893
3920
  firstName: "",
3894
3921
  lastName: "",
@@ -3896,7 +3923,7 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3896
3923
  }
3897
3924
  },
3898
3925
  signatoryQuestionnaire: {
3899
- isSignatory: isChangingType ? null : ((_a = individualOnfido.signatoryQuestionnaire) == null ? void 0 : _a.isSignatory) ?? null
3926
+ isSignatory: isChangingType ? null : individualOnfido.signatoryQuestionnaire?.isSignatory ?? null
3900
3927
  },
3901
3928
  uboQuestionnaire: isChangingType ? {
3902
3929
  isOwner: null,
@@ -3905,14 +3932,14 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3905
3932
  isNomineeShareholder: null,
3906
3933
  isNomineeDirector: null
3907
3934
  } : {
3908
- isOwner: ((_b = individualOnfido.uboQuestionnaire) == null ? void 0 : _b.isOwner) ?? null,
3909
- isControllingPerson: ((_c = individualOnfido.uboQuestionnaire) == null ? void 0 : _c.isControllingPerson) ?? null,
3910
- isDirector: ((_d = individualOnfido.uboQuestionnaire) == null ? void 0 : _d.isDirector) ?? null,
3911
- isNomineeDirector: ((_e = individualOnfido.uboQuestionnaire) == null ? void 0 : _e.isNomineeDirector) ?? null,
3912
- isNomineeShareholder: ((_f = individualOnfido.uboQuestionnaire) == null ? void 0 : _f.isNomineeShareholder) ?? null
3935
+ isOwner: individualOnfido.uboQuestionnaire?.isOwner ?? null,
3936
+ isControllingPerson: individualOnfido.uboQuestionnaire?.isControllingPerson ?? null,
3937
+ isDirector: individualOnfido.uboQuestionnaire?.isDirector ?? null,
3938
+ isNomineeDirector: individualOnfido.uboQuestionnaire?.isNomineeDirector ?? null,
3939
+ isNomineeShareholder: individualOnfido.uboQuestionnaire?.isNomineeShareholder ?? null
3913
3940
  }
3914
3941
  };
3915
- if ((_g = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _g.length) {
3942
+ if (legalEntity?.documentDetails?.length) {
3916
3943
  individualOnfido = {
3917
3944
  ...individualOnfido,
3918
3945
  idVerificationMethod: {
@@ -3922,32 +3949,31 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3922
3949
  }
3923
3950
  };
3924
3951
  }
3925
- if ((_i = (_h = legalEntity.individual) == null ? void 0 : _h.name) == null ? void 0 : _i.localization) {
3952
+ if (legalEntity.individual?.identificationData?.type && individualOnfido.additionalPersonalDetails) {
3953
+ const apiIdentityTypeToIdentityTypeMap = reverseMapping(
3954
+ getOnfidoIdentityTypeToApiIdentityTypeMap(individualOnfido.additionalPersonalDetails)
3955
+ );
3956
+ individualOnfido.additionalPersonalDetails.typeOfIdentity = apiIdentityTypeToIdentityTypeMap[legalEntity.individual.identificationData.type];
3957
+ }
3958
+ if (legalEntity.individual?.name?.localization) {
3926
3959
  const configs = [
3927
3960
  {
3928
3961
  script: "ja-Hani",
3929
- mappingFunction: (l) => {
3930
- var _a2, _b2;
3931
- return {
3932
- jaHaniFirstName: (_a2 = l.fields) == null ? void 0 : _a2.firstName,
3933
- jaHaniLastName: (_b2 = l.fields) == null ? void 0 : _b2.lastName
3934
- };
3935
- }
3962
+ mappingFunction: (l) => ({
3963
+ jaHaniFirstName: l.fields?.firstName,
3964
+ jaHaniLastName: l.fields?.lastName
3965
+ })
3936
3966
  },
3937
3967
  {
3938
3968
  script: "ja-Kana",
3939
- mappingFunction: (l) => {
3940
- var _a2, _b2;
3941
- return {
3942
- jaKanaFirstName: (_a2 = l.fields) == null ? void 0 : _a2.firstName,
3943
- jaKanaLastName: (_b2 = l.fields) == null ? void 0 : _b2.lastName
3944
- };
3945
- }
3969
+ mappingFunction: (l) => ({
3970
+ jaKanaFirstName: l.fields?.firstName,
3971
+ jaKanaLastName: l.fields?.lastName
3972
+ })
3946
3973
  }
3947
3974
  ];
3948
3975
  configs.forEach((config) => {
3949
- var _a2, _b2;
3950
- const localizationToMap = (_b2 = (_a2 = legalEntity.individual) == null ? void 0 : _a2.name.localization) == null ? void 0 : _b2.find(
3976
+ const localizationToMap = legalEntity.individual?.name.localization?.find(
3951
3977
  (l) => l.script === config.script
3952
3978
  );
3953
3979
  if (localizationToMap) {
@@ -3958,19 +3984,19 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3958
3984
  }
3959
3985
  });
3960
3986
  }
3961
- if (!(parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations)) {
3987
+ if (!parentLegalEntity?.entityAssociations) {
3962
3988
  return individualOnfido;
3963
3989
  }
3964
- const associations = ((_j = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _j.filter((ea) => ea.legalEntityId === (legalEntity == null ? void 0 : legalEntity.id))) ?? [];
3990
+ const associations = parentLegalEntity?.entityAssociations?.filter((ea) => ea.legalEntityId === legalEntity?.id) ?? [];
3965
3991
  if (isRoleFieldNeeded && individualOnfido.basicDetails) {
3966
3992
  individualOnfido.basicDetails.role = associations.map((ea) => ea.type);
3967
- individualOnfido.basicDetails.jobTitle = (_k = associations.find(
3993
+ individualOnfido.basicDetails.jobTitle = associations.find(
3968
3994
  ({ jobTitle }) => Boolean(jobTitle)
3969
- )) == null ? void 0 : _k.jobTitle;
3995
+ )?.jobTitle;
3970
3996
  }
3971
3997
  if (isRoleFieldNeeded && individualOnfido.signatoryQuestionnaire && individualOnfido.uboQuestionnaire) {
3972
3998
  const associationTypes = new Set(associations.map((ea) => ea.type));
3973
- const hasAssociation = (type) => associationTypes.has(type) ? "yes" : "no";
3999
+ const hasAssociation = (type) => associationTypes.has(type) ? GuidanceQuestionValues.YES : GuidanceQuestionValues.NO;
3974
4000
  individualOnfido.signatoryQuestionnaire.isSignatory = hasAssociation(
3975
4001
  DecisionMakerType.SIGNATORY
3976
4002
  );
@@ -3979,7 +4005,7 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3979
4005
  DecisionMakerType.CONTROLLING_PERSON
3980
4006
  );
3981
4007
  individualOnfido.uboQuestionnaire.isDirector = hasAssociation(DecisionMakerType.DIRECTOR);
3982
- const hasNomineeAssociation = (type) => associations.some((ea) => ea.type === type && ea.nominee) ? "yes" : "no";
4008
+ const hasNomineeAssociation = (type) => associations.some((ea) => ea.type === type && ea.nominee) ? GuidanceQuestionValues.YES : GuidanceQuestionValues.NO;
3983
4009
  individualOnfido.uboQuestionnaire.isNomineeDirector = hasNomineeAssociation(
3984
4010
  DecisionMakerType.DIRECTOR
3985
4011
  );
@@ -3994,8 +4020,7 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3994
4020
  return individualOnfido;
3995
4021
  };
3996
4022
  const mapDocumentDetailToIdDocument = (documents) => {
3997
- var _a;
3998
- const activeDocument = (_a = documents.filter((document) => document.active)) == null ? void 0 : _a[0];
4023
+ const activeDocument = documents.find((document) => document.active);
3999
4024
  return activeDocument ? {
4000
4025
  idDocumentType: activeDocument.type,
4001
4026
  modificationDate: activeDocument.modificationDate
@@ -4219,7 +4244,6 @@ function IndividualOnfidoDropin({
4219
4244
  trustedFieldsProvider,
4220
4245
  trustedRoles
4221
4246
  }) {
4222
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4223
4247
  const { baseUrl, rootLegalEntityId } = useApiContext();
4224
4248
  const { accountHolder, setAccountHolder } = useAccountHolder();
4225
4249
  const { i18n } = useI18nContext();
@@ -4229,12 +4253,13 @@ function IndividualOnfidoDropin({
4229
4253
  const { isSettingEnabled } = useSettingsContext();
4230
4254
  const queryClient = useQueryClient();
4231
4255
  const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
4256
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
4232
4257
  const defaultCountry = "NL";
4233
4258
  const { data: providerStatus } = useProviderStatus({
4234
4259
  providers: ["idDocument"],
4235
4260
  country: legalEntityResponse ? getLegalEntityCountry(legalEntityResponse) : defaultCountry
4236
4261
  });
4237
- const isInstantVerificationEnabled = ((_b = (_a = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _a.idDocument) == null ? void 0 : _b.enabled) ?? true;
4262
+ const isInstantVerificationEnabled = providerStatus?.statuses?.idDocument?.enabled ?? true;
4238
4263
  const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
4239
4264
  const isRoleFieldNeeded = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
4240
4265
  const dataFromResponse = useMemo(() => {
@@ -4265,7 +4290,7 @@ function IndividualOnfidoDropin({
4265
4290
  const [existingAttachments, setExistingAttachments] = useState();
4266
4291
  const [documents, setDocuments] = useState();
4267
4292
  const [country, setCountry] = useState(
4268
- ((_c = dataFromResponse == null ? void 0 : dataFromResponse.additionalPersonalDetails) == null ? void 0 : _c.country) ?? parentCountry
4293
+ dataFromResponse?.additionalPersonalDetails?.country ?? parentCountry
4269
4294
  );
4270
4295
  const [derivedProps, setDerivedProps] = useState();
4271
4296
  const [nextHandler, setNextHandler] = useState();
@@ -4290,34 +4315,31 @@ function IndividualOnfidoDropin({
4290
4315
  });
4291
4316
  }, []);
4292
4317
  const individualFieldValidations = useCallback(
4293
- (data2) => {
4294
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
4295
- return {
4296
- basicDetails: basicDetailsValidators({
4297
- isExperimentEnabled
4298
- }),
4299
- additionalPersonalDetails: additionalPersonalDetailsValidators({
4300
- country: ((_a2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? country,
4301
- isExperimentEnabled,
4302
- isSettingEnabled,
4303
- taskType,
4304
- idNumberType: (_b2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _b2.typeOfIdentity,
4305
- idNumberExempt: (_c2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _c2.idNumberExempt,
4306
- idNumber: (_d2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _d2.idNumber,
4307
- existingIdNumber: (_e2 = dataFromResponse.additionalPersonalDetails) == null ? void 0 : _e2.idNumber,
4308
- formVerificationErrors: (_f2 = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _f2.additionalPersonalDetails,
4309
- i18n,
4310
- taxIdNumberType: ((_h2 = (_g2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _g2.taxInformation) == null ? void 0 : _h2.length) ? (_j2 = (_i2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _i2.taxInformation[0]) == null ? void 0 : _j2.type : void 0
4311
- })
4312
- };
4313
- },
4318
+ (data2) => ({
4319
+ basicDetails: basicDetailsValidators({
4320
+ isExperimentEnabled
4321
+ }),
4322
+ additionalPersonalDetails: additionalPersonalDetailsValidators({
4323
+ country: data2?.additionalPersonalDetails?.country ?? country,
4324
+ isExperimentEnabled,
4325
+ isSettingEnabled,
4326
+ taskType,
4327
+ idNumberType: data2?.additionalPersonalDetails?.typeOfIdentity,
4328
+ idNumberExempt: data2?.additionalPersonalDetails?.idNumberExempt,
4329
+ idNumber: data2?.additionalPersonalDetails?.idNumber,
4330
+ existingIdNumber: dataFromResponse.additionalPersonalDetails?.idNumber,
4331
+ formVerificationErrors: problems?.verificationErrors?.additionalPersonalDetails,
4332
+ i18n,
4333
+ taxIdNumberType: data2?.additionalPersonalDetails?.taxInformation?.length ? data2?.additionalPersonalDetails?.taxInformation[0]?.type : void 0
4334
+ })
4335
+ }),
4314
4336
  [
4315
4337
  country,
4316
- (_d = dataFromResponse.additionalPersonalDetails) == null ? void 0 : _d.idNumber,
4338
+ dataFromResponse.additionalPersonalDetails?.idNumber,
4317
4339
  i18n,
4318
4340
  isExperimentEnabled,
4319
4341
  isSettingEnabled,
4320
- (_e = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _e.additionalPersonalDetails,
4342
+ problems?.verificationErrors?.additionalPersonalDetails,
4321
4343
  taskType
4322
4344
  ]
4323
4345
  );
@@ -4329,7 +4351,7 @@ function IndividualOnfidoDropin({
4329
4351
  phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber
4330
4352
  },
4331
4353
  additionalPersonalDetails: {
4332
- idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2 == null ? void 0 : data2.additionalPersonalDetails).idNumber
4354
+ idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2?.additionalPersonalDetails).idNumber
4333
4355
  }
4334
4356
  }),
4335
4357
  [verifyIdNumber2, validatePhoneNumber]
@@ -4346,11 +4368,11 @@ function IndividualOnfidoDropin({
4346
4368
  };
4347
4369
  }, [documents, dataFromResponse]);
4348
4370
  const form = useMultiForm({
4349
- requiredFields: derivedProps == null ? void 0 : derivedProps.requiredFields,
4371
+ requiredFields: derivedProps?.requiredFields,
4350
4372
  defaultData,
4351
4373
  rules: individualFieldValidations,
4352
4374
  asyncRules: individualFieldAsyncValidations,
4353
- optionalFields: derivedProps == null ? void 0 : derivedProps.optionalFields
4375
+ optionalFields: derivedProps?.optionalFields
4354
4376
  });
4355
4377
  const documentUtils = documentApiUtils({
4356
4378
  baseUrl: baseUrl.value,
@@ -4358,9 +4380,8 @@ function IndividualOnfidoDropin({
4358
4380
  });
4359
4381
  const { data, requiredFields } = form;
4360
4382
  useEffect(() => {
4361
- var _a2;
4362
- setCountry(((_a2 = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? parentCountry);
4363
- }, [(_f = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _f.country, parentCountry]);
4383
+ setCountry(data?.additionalPersonalDetails?.country ?? parentCountry);
4384
+ }, [data?.additionalPersonalDetails?.country, parentCountry]);
4364
4385
  const { data: scenarios } = useScenarios(country, LegalEntityType.INDIVIDUAL);
4365
4386
  useEffect(() => {
4366
4387
  if (!scenarios) return;
@@ -4374,27 +4395,23 @@ function IndividualOnfidoDropin({
4374
4395
  country
4375
4396
  });
4376
4397
  const fieldsFromCustomRules = useMemo(
4377
- () => {
4378
- var _a2;
4379
- return individualOnfidoRules({
4380
- matchingScenario,
4381
- data,
4382
- country: ((_a2 = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? country,
4383
- taskType,
4384
- isExperimentEnabled,
4385
- rootLegalEntity: parentLegalEntity,
4386
- problems
4387
- });
4388
- },
4398
+ () => individualOnfidoRules({
4399
+ matchingScenario,
4400
+ data,
4401
+ country: data?.additionalPersonalDetails?.country ?? country,
4402
+ taskType,
4403
+ isExperimentEnabled,
4404
+ rootLegalEntity: parentLegalEntity,
4405
+ problems
4406
+ }),
4389
4407
  [country, matchingScenario, data, isExperimentEnabled, parentLegalEntity, taskType, problems]
4390
4408
  );
4391
4409
  useEffect(() => {
4392
- var _a2;
4393
4410
  const derivedProps2 = getPropsFromConfigurations(
4394
4411
  fieldConfigurations,
4395
4412
  individualOnfidoForms,
4396
- (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
4397
- (problems == null ? void 0 : problems.missingData) ?? [],
4413
+ problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
4414
+ problems?.missingData ?? [],
4398
4415
  legalEntityResponse ? getFieldsWithExistingData(
4399
4416
  legalEntityResponse,
4400
4417
  individualOnfidoApiKeyMapping,
@@ -4409,12 +4426,12 @@ function IndividualOnfidoDropin({
4409
4426
  fieldsFromCustomRules,
4410
4427
  {},
4411
4428
  {},
4412
- legalEntityResponse == null ? void 0 : legalEntityResponse.type,
4429
+ legalEntityResponse?.type,
4413
4430
  [],
4414
4431
  true
4415
4432
  );
4416
4433
  const updatedDerivedProps = mandateIdVerificationForMotionCapture(
4417
- (_a2 = showIndividualMotionCapture) == null ? void 0 : _a2.value,
4434
+ showIndividualMotionCapture?.value,
4418
4435
  derivedProps2
4419
4436
  );
4420
4437
  if (updatedDerivedProps) {
@@ -4424,15 +4441,14 @@ function IndividualOnfidoDropin({
4424
4441
  fieldConfigurations,
4425
4442
  legalEntityResponse,
4426
4443
  fieldsFromCustomRules,
4427
- problems == null ? void 0 : problems.remediationActions,
4428
- problems == null ? void 0 : problems.missingData
4444
+ problems?.remediationActions,
4445
+ problems?.missingData
4429
4446
  ]);
4430
4447
  useEffect(() => {
4431
- var _a2;
4432
- if (!((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.length)) return;
4433
- documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse == null ? void 0 : legalEntityResponse.id).then((res) => {
4448
+ if (!legalEntityResponse?.documentDetails?.length) return;
4449
+ documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then((res) => {
4434
4450
  setExistingAttachments(res[0].attachments);
4435
- setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse == null ? void 0 : legalEntityResponse.id));
4451
+ setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
4436
4452
  }).catch(() => {
4437
4453
  showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
4438
4454
  });
@@ -4440,8 +4456,8 @@ function IndividualOnfidoDropin({
4440
4456
  const forms = useMemo(() => {
4441
4457
  const requiredForms = getRequiredForms(
4442
4458
  individualOnfidoForms,
4443
- derivedProps == null ? void 0 : derivedProps.requiredFields,
4444
- derivedProps == null ? void 0 : derivedProps.optionalFields
4459
+ derivedProps?.requiredFields,
4460
+ derivedProps?.optionalFields
4445
4461
  );
4446
4462
  const filteredForms = !isInstantVerificationEnabled ? requiredForms.filter((f) => f.formId !== "idVerificationMethod") : requiredForms;
4447
4463
  return addValidityToForms(filteredForms, form.isValid, problems);
@@ -4465,9 +4481,8 @@ function IndividualOnfidoDropin({
4465
4481
  legalEntity,
4466
4482
  idDocumentType
4467
4483
  }) => {
4468
- var _a2, _b2, _c2;
4469
4484
  let updatedLegalEntity;
4470
- const leId = (legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newDecisionMaker == null ? void 0 : newDecisionMaker.id);
4485
+ const leId = legalEntityResponse?.id || newDecisionMaker?.id;
4471
4486
  if (!leId) {
4472
4487
  updatedLegalEntity = await createLegalEntity(legalEntity);
4473
4488
  userEvents.addTaskEvent("Success", {
@@ -4475,8 +4490,8 @@ function IndividualOnfidoDropin({
4475
4490
  actionType: "submit",
4476
4491
  legalEntityId: updatedLegalEntity.id,
4477
4492
  entityType: updatedLegalEntity.type,
4478
- countryOfRegistration: ((_a2 = dataSubmitted.additionalPersonalDetails) == null ? void 0 : _a2.country) || null,
4479
- roles: ((_b2 = dataSubmitted.basicDetails) == null ? void 0 : _b2.role) || null
4493
+ countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country || null,
4494
+ roles: dataSubmitted.basicDetails?.role || null
4480
4495
  });
4481
4496
  } else {
4482
4497
  updatedLegalEntity = await updateLegalEntity({ ...drop("type").from(legalEntity), id: leId });
@@ -4485,7 +4500,7 @@ function IndividualOnfidoDropin({
4485
4500
  actionType: "submit",
4486
4501
  legalEntityId: updatedLegalEntity.id,
4487
4502
  entityType: updatedLegalEntity.type,
4488
- countryOfRegistration: ((_c2 = dataSubmitted.additionalPersonalDetails) == null ? void 0 : _c2.country) || null,
4503
+ countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country || null,
4489
4504
  documentType: idDocumentType || null
4490
4505
  });
4491
4506
  }
@@ -4495,10 +4510,9 @@ function IndividualOnfidoDropin({
4495
4510
  legalEntity,
4496
4511
  dataSubmitted
4497
4512
  }) => {
4498
- var _a2, _b2, _c2, _d2;
4499
- const idDocument2 = (_a2 = dataSubmitted.idVerificationMethod) == null ? void 0 : _a2.idDocument;
4500
- if (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) {
4501
- if (((_c2 = (_b2 = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.enabled) === false) {
4513
+ const idDocument2 = dataSubmitted.idVerificationMethod?.idDocument;
4514
+ if (idDocument2?.instantIdVerificationData) {
4515
+ if (providerStatus?.statuses?.idDocument?.enabled === false) {
4502
4516
  throw new Error("Provider unexpectedly disabled instant verification flow");
4503
4517
  }
4504
4518
  await handleInstantIdVerificationStartCheck(
@@ -4511,7 +4525,7 @@ function IndividualOnfidoDropin({
4511
4525
  legalEntity.id
4512
4526
  );
4513
4527
  if (!formattedDocuments || formattedDocuments.length === 0) {
4514
- if (existingAttachments == null ? void 0 : existingAttachments.length)
4528
+ if (existingAttachments?.length)
4515
4529
  logger.log(
4516
4530
  "User has already uploaded documents and is not changing them, nothing needs to be done"
4517
4531
  );
@@ -4523,25 +4537,24 @@ function IndividualOnfidoDropin({
4523
4537
  }
4524
4538
  formattedDocuments[0].attachments = mergeAttachments(
4525
4539
  existingAttachments ?? [],
4526
- ((_d2 = formattedDocuments[0]) == null ? void 0 : _d2.attachments) ?? []
4540
+ formattedDocuments[0]?.attachments ?? []
4527
4541
  ).filter((attachment) => attachment.content);
4528
4542
  const uploadedDocuments = await documentUtils.uploadDocuments(
4529
4543
  formattedDocuments,
4530
4544
  legalEntity.id
4531
4545
  );
4532
- uploadedDocuments == null ? void 0 : uploadedDocuments.forEach((doc) => {
4533
- var _a3;
4546
+ uploadedDocuments?.forEach((doc) => {
4534
4547
  userEvents.addTaskEvent("Success", {
4535
4548
  ...associatedLeTrackingParams,
4536
4549
  actionType: "upload",
4537
4550
  documentType: doc.type,
4538
- fileExtention: ((_a3 = doc == null ? void 0 : doc.attachments) == null ? void 0 : _a3.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0)) ?? null
4551
+ fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? null
4539
4552
  });
4540
4553
  });
4541
4554
  }
4542
4555
  };
4543
4556
  const hasRolesChanged = (legalEntityId, existingEntityAssociations, newRoles) => {
4544
- const existingRoles = existingEntityAssociations == null ? void 0 : existingEntityAssociations.filter((association) => association.legalEntityId === legalEntityId).map(({ type }) => type);
4557
+ const existingRoles = existingEntityAssociations?.filter((association) => association.legalEntityId === legalEntityId).map(({ type }) => type);
4545
4558
  return !doArraysMatch(existingRoles, newRoles);
4546
4559
  };
4547
4560
  const attachAssociationToParentLegalEntity = async ({
@@ -4549,26 +4562,22 @@ function IndividualOnfidoDropin({
4549
4562
  parentLE,
4550
4563
  dataSubmitted
4551
4564
  }) => {
4552
- var _a2, _b2, _c2;
4553
- const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? (_a2 = dataSubmitted == null ? void 0 : dataSubmitted.basicDetails) == null ? void 0 : _a2.role : null;
4565
+ const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? dataSubmitted?.basicDetails?.role : null;
4554
4566
  const existingEntityAssociations = getOwnEntityAssociations(parentLE);
4555
- if (newRoles && (hasRolesChanged(legalEntity == null ? void 0 : legalEntity.id, existingEntityAssociations, newRoles) || ((_b2 = dataFromResponse.basicDetails) == null ? void 0 : _b2.jobTitle) !== ((_c2 = dataSubmitted == null ? void 0 : dataSubmitted.basicDetails) == null ? void 0 : _c2.jobTitle) || hasNomineesChanged(dataFromResponse.basicDetails, dataSubmitted.basicDetails))) {
4567
+ if (newRoles && (hasRolesChanged(legalEntity?.id, existingEntityAssociations, newRoles) || dataFromResponse.basicDetails?.jobTitle !== dataSubmitted?.basicDetails?.jobTitle || hasNomineesChanged(dataFromResponse.basicDetails, dataSubmitted.basicDetails))) {
4556
4568
  const updatedParentLegalEntity = {
4557
4569
  entityAssociations: [
4558
- ...newRoles.map((role) => {
4559
- var _a3;
4560
- return {
4561
- type: role,
4562
- legalEntityId: legalEntity.id,
4563
- ...DECISION_MAKER_TYPES_WITH_JOBTITLE.some((type) => type === role) && {
4564
- jobTitle: (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.basicDetails) == null ? void 0 : _a3.jobTitle
4565
- }
4566
- };
4567
- }) || [],
4570
+ ...newRoles.map((role) => ({
4571
+ type: role,
4572
+ legalEntityId: legalEntity.id,
4573
+ ...DECISION_MAKER_TYPES_WITH_JOBTITLE.some((type) => type === role) && {
4574
+ jobTitle: dataSubmitted?.basicDetails?.jobTitle
4575
+ }
4576
+ })) || [],
4568
4577
  ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
4569
4578
  ]
4570
4579
  };
4571
- const nomineeDataSource = isGuidedDecisionMakersFlowEnabled ? dataSubmitted == null ? void 0 : dataSubmitted.uboQuestionnaire : dataSubmitted.basicDetails;
4580
+ const nomineeDataSource = !isGuidedDecisionMakersFlowDisabled && isGuidedDecisionMakersFlowEnabled ? dataSubmitted?.uboQuestionnaire : dataSubmitted.basicDetails;
4572
4581
  if (nomineeDataSource && updatedParentLegalEntity.entityAssociations) {
4573
4582
  updatedParentLegalEntity.entityAssociations = updatedParentLegalEntity.entityAssociations.map(
4574
4583
  (ea) => attachNomineeToRole(ea, country, nomineeDataSource)
@@ -4578,7 +4587,6 @@ function IndividualOnfidoDropin({
4578
4587
  }
4579
4588
  };
4580
4589
  const onSubmit = async () => {
4581
- var _a2, _b2;
4582
4590
  setLoadingStatus("loading");
4583
4591
  const dataSubmitted = omitObscuredFieldsIfUnchanged(
4584
4592
  individualOnfidoObscuredFields,
@@ -4594,12 +4602,9 @@ function IndividualOnfidoDropin({
4594
4602
  isExperimentEnabled,
4595
4603
  matchingScenario
4596
4604
  );
4597
- const idDocumentType = (_a2 = idDocumentTypeOptions.find(
4598
- ({ id }) => {
4599
- var _a3, _b3;
4600
- return ((_b3 = (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.idVerificationMethod) == null ? void 0 : _a3.idDocument) == null ? void 0 : _b3.idDocumentType) === id;
4601
- }
4602
- )) == null ? void 0 : _a2.id;
4605
+ const idDocumentType = idDocumentTypeOptions.find(
4606
+ ({ id }) => dataSubmitted?.idVerificationMethod?.idDocument?.idDocumentType === id
4607
+ )?.id;
4603
4608
  legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
4604
4609
  taskType,
4605
4610
  legalEntityResponse,
@@ -4611,7 +4616,7 @@ function IndividualOnfidoDropin({
4611
4616
  idDocumentType
4612
4617
  });
4613
4618
  setAccountHolder(accountHolder);
4614
- if (((_b2 = dataSubmitted.idVerificationMethod) == null ? void 0 : _b2.idVerificationMethod) !== "existingDocument") {
4619
+ if (dataSubmitted.idVerificationMethod?.idVerificationMethod !== "existingDocument") {
4615
4620
  await submitDocuments({ legalEntity: createdLegalEntity, dataSubmitted });
4616
4621
  }
4617
4622
  if (parentLegalEntity) {
@@ -4627,7 +4632,7 @@ function IndividualOnfidoDropin({
4627
4632
  }
4628
4633
  setLoadingStatus("success");
4629
4634
  clearToasts();
4630
- externalOnSubmit == null ? void 0 : externalOnSubmit(dataSubmitted);
4635
+ externalOnSubmit?.(dataSubmitted);
4631
4636
  } catch (e) {
4632
4637
  logger.error("Failed to update individual", e);
4633
4638
  if (isValidationError(e)) {
@@ -4651,17 +4656,13 @@ function IndividualOnfidoDropin({
4651
4656
  };
4652
4657
  const datasetUtils = datasetUtilities(i18n.locale);
4653
4658
  const formatIdDocument = (idDocument2) => {
4654
- var _a2, _b2;
4655
4659
  if (!idDocument2) return void 0;
4656
- const documentType = (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) ? onfidoDocumentTypeMapping.find(
4657
- (document) => {
4658
- var _a3;
4659
- return ((_a3 = idDocument2.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document.id;
4660
- }
4660
+ const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
4661
+ (document) => idDocument2.instantIdVerificationData?.document_front.type === document.id
4661
4662
  ) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
4662
4663
  if (!documentType) return void 0;
4663
- const frontPage = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
4664
- const backPage = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
4664
+ const frontPage = idDocument2.idFrontPage?.[0];
4665
+ const backPage = idDocument2.idBackPage?.[0];
4665
4666
  if (!frontPage) return void 0;
4666
4667
  return {
4667
4668
  documentType: i18n.get(documentType.name),
@@ -4680,13 +4681,12 @@ function IndividualOnfidoDropin({
4680
4681
  proofOfResidency,
4681
4682
  proofOfRelationship
4682
4683
  }) => {
4683
- var _a2, _b2, _c2;
4684
- const proofOfNationalIdFile = (_a2 = proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) == null ? void 0 : _a2[0];
4685
- const proofOfResidencyFile = (_b2 = proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) == null ? void 0 : _b2[0];
4686
- const proofOfRelationshipFile = (_c2 = proofOfRelationship == null ? void 0 : proofOfRelationship.proofOfRelationship) == null ? void 0 : _c2[0];
4687
- const idDocument2 = (idVerificationMethod == null ? void 0 : idVerificationMethod.idVerificationMethod) === "manualVerification" ? manualIdUpload : idVerificationMethod == null ? void 0 : idVerificationMethod.idDocument;
4684
+ const proofOfNationalIdFile = proofOfNationalId?.proofOfNationalId?.[0];
4685
+ const proofOfResidencyFile = proofOfResidency?.proofOfResidency?.[0];
4686
+ const proofOfRelationshipFile = proofOfRelationship?.proofOfRelationship?.[0];
4687
+ const idDocument2 = idVerificationMethod?.idVerificationMethod === "manualVerification" ? manualIdUpload : idVerificationMethod?.idDocument;
4688
4688
  return {
4689
- ...((idDocument2 == null ? void 0 : idDocument2.idDocumentType) || (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData)) && {
4689
+ ...(idDocument2?.idDocumentType || idDocument2?.instantIdVerificationData) && {
4690
4690
  idDocument: formatIdDocument(idDocument2)
4691
4691
  },
4692
4692
  ...proofOfNationalIdFile && {
@@ -4708,17 +4708,16 @@ function IndividualOnfidoDropin({
4708
4708
  };
4709
4709
  const isManualVerificationOrExistingDoc = (idVerificationMethod) => idVerificationMethod === "manualVerification" || idVerificationMethod === "existingDocument";
4710
4710
  const formatDataForSummary = () => {
4711
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
4712
4711
  let summaryData = cloneObject(data);
4713
- if ((_a2 = summaryData == null ? void 0 : summaryData.basicDetails) == null ? void 0 : _a2.phoneNumber) {
4712
+ if (summaryData?.basicDetails?.phoneNumber) {
4714
4713
  summaryData.basicDetails.phoneNumber = summaryData.basicDetails.phoneNumber.number;
4715
4714
  }
4716
- if ((_b2 = summaryData.additionalPersonalDetails) == null ? void 0 : _b2.country) {
4715
+ if (summaryData.additionalPersonalDetails?.country) {
4717
4716
  summaryData.additionalPersonalDetails.country = datasetUtils.getCountryName(
4718
4717
  summaryData.additionalPersonalDetails.country
4719
4718
  );
4720
4719
  }
4721
- if ((_c2 = summaryData.additionalPersonalDetails) == null ? void 0 : _c2.nationality) {
4720
+ if (summaryData.additionalPersonalDetails?.nationality) {
4722
4721
  summaryData.additionalPersonalDetails.nationality = datasetUtils.getCountryName(
4723
4722
  summaryData.additionalPersonalDetails.nationality
4724
4723
  );
@@ -4726,62 +4725,56 @@ function IndividualOnfidoDropin({
4726
4725
  if (summaryData.additionalPersonalDetails) {
4727
4726
  summaryData.address = mapAddressLabels(summaryData.additionalPersonalDetails, datasetUtils);
4728
4727
  }
4729
- if ((_d2 = summaryData.basicDetails) == null ? void 0 : _d2.accountHolder) {
4728
+ if (summaryData.basicDetails?.accountHolder) {
4730
4729
  summaryData.basicDetails.accountHolder = i18n.get(summaryData.basicDetails.accountHolder);
4731
4730
  }
4732
- if ((_e2 = summaryData.additionalPersonalDetails) == null ? void 0 : _e2.birthDate) {
4731
+ if (summaryData.additionalPersonalDetails?.birthDate) {
4733
4732
  summaryData.additionalPersonalDetails.birthDate = localizeDateString(
4734
4733
  summaryData.additionalPersonalDetails.birthDate,
4735
4734
  i18n.locale
4736
4735
  );
4737
4736
  }
4738
- if (isManualVerificationOrExistingDoc((_f2 = summaryData.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod) || summaryData.proofOfResidency) {
4737
+ if (isManualVerificationOrExistingDoc(summaryData.idVerificationMethod?.idVerificationMethod) || summaryData.proofOfResidency) {
4739
4738
  const fileSummaryData = formatFileSummaryData(data);
4740
4739
  summaryData = { ...summaryData, ...fileSummaryData };
4741
4740
  summaryData.manualIdUpload = { ...summaryData.idDocument };
4742
4741
  summaryData.idVerificationMethod.idDocument = { ...summaryData.idDocument };
4743
4742
  }
4744
- if ((_g2 = summaryData.additionalPersonalDetails) == null ? void 0 : _g2.taxInformation) {
4743
+ if (summaryData.additionalPersonalDetails?.taxInformation) {
4745
4744
  const taxInformation = summaryData.additionalPersonalDetails.taxInformation.find(
4746
- (taxId) => {
4747
- var _a3;
4748
- return taxId.country === ((_a3 = data.additionalPersonalDetails) == null ? void 0 : _a3.nationality);
4749
- }
4745
+ (taxId) => taxId.country === data.additionalPersonalDetails?.nationality
4750
4746
  );
4751
4747
  if (taxInformation) {
4752
4748
  delete summaryData.additionalPersonalDetails.taxInformation;
4753
4749
  summaryData.additionalPersonalDetails[taxInformation.type] = taxInformation.number;
4754
4750
  }
4755
4751
  }
4756
- if (summaryData == null ? void 0 : summaryData.signatoryQuestionnaire) {
4757
- summaryData.signatoryQuestionnaire = ((_h2 = data == null ? void 0 : data.signatoryQuestionnaire) == null ? void 0 : _h2.isSignatory) === "yes" ? [i18n.get("signatorySummaryLabel")] : [];
4752
+ if (summaryData?.signatoryQuestionnaire) {
4753
+ summaryData.signatoryQuestionnaire = data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES ? [i18n.get("signatorySummaryLabel")] : [];
4758
4754
  }
4759
- if (summaryData == null ? void 0 : summaryData.uboQuestionnaire) {
4755
+ if (summaryData?.uboQuestionnaire) {
4760
4756
  const roleFieldToLabelMap = {
4761
4757
  isOwner: "ownerSummaryLabel",
4762
4758
  isControllingPerson: "controllingPersonSummaryLabel",
4763
4759
  isDirector: "directorSummaryLabel"
4764
4760
  };
4765
4761
  summaryData.uboQuestionnaire = Object.keys(roleFieldToLabelMap).flatMap(
4766
- (field) => {
4767
- var _a3;
4768
- return ((_a3 = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _a3[field]) === "yes" ? [i18n.get(roleFieldToLabelMap[field])] : [];
4769
- }
4762
+ (field) => data?.uboQuestionnaire?.[field] === GuidanceQuestionValues.YES ? [i18n.get(roleFieldToLabelMap[field])] : []
4770
4763
  );
4771
4764
  }
4772
4765
  return summaryData;
4773
4766
  };
4774
4767
  const omittedKeysForSummary = [
4775
4768
  ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
4776
- ...((_g = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _g.idNumberExempt) ? ["idNumber"] : [],
4777
- ...isManualVerificationOrExistingDoc((_h = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _h.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
4769
+ ...data?.additionalPersonalDetails?.idNumberExempt ? ["idNumber"] : [],
4770
+ ...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
4778
4771
  ];
4779
4772
  const omittedFormsForSummary = [
4780
- ...((_i = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _i.idVerificationMethod) === "instantVerification" ? ["idDocument"] : [],
4781
- ...((_j = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _j.idVerificationMethod) === "manualVerification" ? ["idVerificationMethod"] : []
4773
+ ...data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? ["idDocument"] : [],
4774
+ ...data?.idVerificationMethod?.idVerificationMethod === "manualVerification" ? ["idVerificationMethod"] : []
4782
4775
  ];
4783
4776
  const customLabelsForSummary = {
4784
- idVerificationMethod: ((_k = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _k.idVerificationMethod) === "instantVerification" ? "idVerificationMethod" : "idDocument"
4777
+ idVerificationMethod: data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "idVerificationMethod" : "idDocument"
4785
4778
  };
4786
4779
  const {
4787
4780
  handleNextClick,
@@ -4798,10 +4791,10 @@ function IndividualOnfidoDropin({
4798
4791
  triggerValidation: form.triggerValidation
4799
4792
  // TODO: figure out type of nested keys
4800
4793
  });
4801
- const disableNextButton = useMemo(() => {
4802
- const isVerificationMethod = (activeForm == null ? void 0 : activeForm.formId) === "idVerificationMethod";
4803
- return isVerificationMethod && !(activeForm == null ? void 0 : activeForm.isValid);
4804
- }, [activeForm]);
4794
+ const disableNextButton = computed(() => {
4795
+ const isVerificationMethod = activeForm?.formId === "idVerificationMethod";
4796
+ return isVerificationMethod && !activeForm?.isValid || isNextStepDisabled.value;
4797
+ });
4805
4798
  const handleTrackNavigation = useCallback(
4806
4799
  (props) => {
4807
4800
  trackNavigation({
@@ -4826,7 +4819,7 @@ function IndividualOnfidoDropin({
4826
4819
  },
4827
4820
  asModal,
4828
4821
  currentStep: steps.current,
4829
- disableNextButton,
4822
+ disableNextButton: disableNextButton.value,
4830
4823
  forms,
4831
4824
  gotoFormByFormIndex,
4832
4825
  handleBackClick,
@@ -4847,7 +4840,7 @@ function IndividualOnfidoDropin({
4847
4840
  problems,
4848
4841
  onNext: handleNextClick,
4849
4842
  onBack: handleBackClick,
4850
- legalEntityId: legalEntityResponse == null ? void 0 : legalEntityResponse.id,
4843
+ legalEntityId: legalEntityResponse?.id,
4851
4844
  allowedRoles: roleTypes,
4852
4845
  shouldValidate,
4853
4846
  accountHolder,