@adyen/kyc-components 4.23.0 → 4.24.0-beta.0

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 (1012) hide show
  1. package/dist/4-people-DKuivE0m.js +35 -0
  2. package/dist/AcceptTermsOfServiceWorkflow-C3JrMbt5.js +28 -0
  3. package/dist/Accordion-Dgdxfe-d.js +112 -0
  4. package/dist/AccountSetupRejected-D63dyojj.js +19 -0
  5. package/dist/AdaptiveWorkflow-XhWdnJv-.js +33 -0
  6. package/dist/AdaptiveWorkflowComponent-pMWy1Vig.js +166 -0
  7. package/dist/AddressFields-BC3QHs2u.js +468 -0
  8. package/dist/Alert-Cc7p0N5h.js +172 -0
  9. package/dist/AnalyticsContext-CpimDlw4.js +21 -0
  10. package/dist/Avatar-oTPu6Ejy.js +54 -0
  11. package/dist/BusinessFinancingDropin-CxHK6KY3.js +1870 -0
  12. package/dist/BusinessFinancingPage-teAAjQl8.js +89 -0
  13. package/dist/BusinessRegistrationNumberField-DKka8aVU.js +103 -0
  14. package/dist/BusinessRegistrationNumberFieldGroup-Df6_sDA0.js +173 -0
  15. package/dist/BusinessTypeSelectionPage-BETJH6LZ.js +457 -0
  16. package/dist/Button-DPJ1k02w.js +108 -0
  17. package/dist/Checkbox-qfdF12cF.js +60 -0
  18. package/dist/ComponentGroup-SozxzKWw.js +32 -0
  19. package/dist/Confirm-DoN9R9Z3.js +77 -0
  20. package/dist/ConstitutionalDocument-Bxsr1hQb.js +1229 -0
  21. package/dist/ContactDetails-CiWftLi4.js +516 -0
  22. package/dist/ContextGuidance-BQPwRscq.js +29 -0
  23. package/dist/ContractViewer-CG9UNGz1.js +1030 -0
  24. package/dist/CountryField-DT6-Jr_b.js +38 -0
  25. package/dist/Currency-oeXHRWzy.js +211 -0
  26. package/dist/CustomerSupport-D0bE0zga.js +141 -0
  27. package/dist/DataConflictsModal-CCaMgguu.js +238 -0
  28. package/dist/DebugModal-Cvp7_Z-i.js +456 -0
  29. package/dist/DecisionMakerDetails-Bbb_8up2.js +569 -0
  30. package/dist/DecisionMakerDetailsPage-BDTMzs1X.js +121 -0
  31. package/dist/DecisionMakers-maoFXpGe.js +594 -0
  32. package/dist/Dropzone-ttbRg2LI.js +250 -0
  33. package/dist/EmbeddedStatus-CYd2p4sP.js +129 -0
  34. package/dist/EndStateLayout-zZPm8S5M.js +83 -0
  35. package/dist/EntityAssociation-C2_Xuvf5.js +163 -0
  36. package/dist/ErrorPanel-D4JNFkvi.js +205 -0
  37. package/dist/Field-DwDJQVSS.js +154 -0
  38. package/dist/FormFlow.module-DqMxjYHl.js +20 -0
  39. package/dist/GlobalEntryModal-CLoPJXFE.js +1203 -0
  40. package/dist/GlobalEntryPage-DNPSSZ3M.js +78 -0
  41. package/dist/Header-DVLlJ6we.js +93 -0
  42. package/dist/Icon-4XR6gZzk.js +175 -0
  43. package/dist/IdentityNumber-3V6ZqvHB.js +540 -0
  44. package/dist/IdentityNumberFieldGroup-CAjlgTWn.js +57 -0
  45. package/dist/IdentityScreeningWorkflow-CBStT1hs.js +307 -0
  46. package/dist/Image-Bn_Yyuof.js +33 -0
  47. package/dist/IndividualDropin-0t7Oj71F.js +4175 -0
  48. package/dist/IndustryCodeFieldGroup-C3Zro2ds.js +189 -0
  49. package/dist/InputDate-Bq3Sb-ZW.js +211 -0
  50. package/dist/InputText-CFDEmEtp.js +119 -0
  51. package/dist/Introduction-z2SqIq1W.js +326 -0
  52. package/dist/InvitedDecisionMakerComponent-CZOVc-t9.js +481 -0
  53. package/dist/JpAddressFields-F1YCOcbO.js +288 -0
  54. package/dist/LandingLayout-BsIoIFzs.js +76 -0
  55. package/dist/LegalCompanyNameField-Cosyjk52.js +108 -0
  56. package/dist/LegalName-CtqIpsfy.js +33 -0
  57. package/dist/LegalRepresentativeDetailsPage-DwIARCpj.js +73 -0
  58. package/dist/Link-CvYhseSD.js +32 -0
  59. package/dist/ListItem-CYTpdOMa.js +70 -0
  60. package/dist/Loader-BVtlpTeo.js +92 -0
  61. package/dist/LoaderWrapper-Dc88hY-P.js +34 -0
  62. package/dist/MaybeModal-C4ySaA8A.js +24 -0
  63. package/dist/Modal-CHES6970.js +109 -0
  64. package/dist/Name-CdCsijr5.js +61 -0
  65. package/dist/NewSummary-D55f70wB.js +73 -0
  66. package/dist/NodeRenderer-B3G7pvjG.js +185 -0
  67. package/dist/PatriotActDisclosure-DqUZeLms.js +266 -0
  68. package/dist/PayoutDetailsDropin-LKMpfono.js +4104 -0
  69. package/dist/PayoutDetailsPage-KNHCeXgk.js +69 -0
  70. package/dist/ProgressBar-DWFxLMUA.js +38 -0
  71. package/dist/RadioGroup-Bf3DlQnZ.js +47 -0
  72. package/dist/RadioWithLabel-DQIOEYpF.js +45 -0
  73. package/dist/Review-CS_-zAlg.js +99 -0
  74. package/dist/RootBusinessDetailsPage-1z2_FAb6.js +67 -0
  75. package/dist/RootBusinessLinesPage-BgbkJaW8.js +1464 -0
  76. package/dist/RootIndividualDetailsPage-DA4hh_gc.js +82 -0
  77. package/dist/Select-phAxjMBQ.js +782 -0
  78. package/dist/SignPCIComponent-tBnZMn1u.js +373 -0
  79. package/dist/SingpassSelection-B6_DsZtn.js +156 -0
  80. package/dist/SoleProprietorshipPage-2s1kA9ZV.js +69 -0
  81. package/dist/SourceOfFundsPage-CTjUdOWK.js +2800 -0
  82. package/dist/SourceOfFundsWorkflow-BZabOpi_.js +28 -0
  83. package/dist/StateContext-B2_Pqd_y.js +9 -0
  84. package/dist/StateField-BpMwetvd.js +55 -0
  85. package/dist/Step-C6XxGAda.js +191 -0
  86. package/dist/StructuredList-nPasiuLi.js +56 -0
  87. package/dist/Summary-DM31WxLr.js +235 -0
  88. package/dist/Task-DwGA1eXE.js +129 -0
  89. package/dist/TaskGroup-T594JSYM.js +46 -0
  90. package/dist/TaskListItem-Dx3hKOqG.js +123 -0
  91. package/dist/TaskStepperContextProvider-DdcsqXT7.js +26 -0
  92. package/dist/TaskVerificationStatus-DEXk_ndE.js +125 -0
  93. package/dist/TaxInformationField-CV7SpMH1.js +242 -0
  94. package/dist/TaxInformationFieldGroup-DI2LzuNr.js +290 -0
  95. package/dist/TaxReportingDropin-xYwJ-ju7.js +480 -0
  96. package/dist/TaxReportingWorkflow-BHyHgiI-.js +28 -0
  97. package/dist/TermsOfServiceManagement-CNQ4J5Gn.js +644 -0
  98. package/dist/TextArea-qGEo3PFG.js +81 -0
  99. package/dist/TileGroup-D1-M64Ul.js +172 -0
  100. package/dist/ToastContext-B_wd2IY2.js +13 -0
  101. package/dist/ToastContextProvider-DjYKMflX.js +103 -0
  102. package/dist/TrustDetailsPage-Byj68n3F.js +1172 -0
  103. package/dist/TrustMemberCompanyPage-Bcz4Ql7s.js +108 -0
  104. package/dist/TrustMemberIndividualPage-D6CgWF88.js +108 -0
  105. package/dist/TrustMemberRoleAndTypePage-IUp5FVRW.js +937 -0
  106. package/dist/TrustMembersOverview-7EoKoSMg.js +453 -0
  107. package/dist/UboTaskItem-BmcGj5_U.js +115 -0
  108. package/dist/UnincorporatedPartnershipIndividualPage-BKpJDhhU.js +78 -0
  109. package/dist/UnincorporatedPartnershipMemberCompanyPage-D8VliL0i.js +78 -0
  110. package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-D00bHhyf.js +256 -0
  111. package/dist/UnincorporatedPartnershipMembersOverview-Dw5IMSkd.js +160 -0
  112. package/dist/VerificationErrorAlert-CixajVtq.js +38 -0
  113. package/dist/Workflow-CWzMRGHX.js +228 -0
  114. package/dist/_rolldown_dynamic_import_helper-sGNwd-kR.js +14 -0
  115. package/dist/accountHolderUtils-CAu4V0ed.js +43 -0
  116. package/dist/adyen-business-financing.js +38 -37
  117. package/dist/adyen-individual-configuration.js +65 -65
  118. package/dist/adyen-individual-status.js +35 -34
  119. package/dist/adyen-invited-decision-maker.js +3 -3
  120. package/dist/adyen-onboarding.js +109 -101
  121. package/dist/adyen-terms-of-service-management.js +3 -3
  122. package/dist/adyen-terms-of-service-status.js +9 -8
  123. package/dist/adyen-transfer-instrument-configuration.js +62 -61
  124. package/dist/adyen-transfer-instrument-management.js +76 -70
  125. package/dist/adyen-verification-status.js +10 -8
  126. package/dist/arrow-right-D2hul7WG.js +20 -0
  127. package/dist/bafinUtils-DDrD6bfK.js +96 -0
  128. package/dist/bag-CRRS1aow.js +20 -0
  129. package/dist/bank-BoirCLLW.js +20 -0
  130. package/dist/bg-BG-B0Ia8sQm.js +7 -0
  131. package/dist/bg-BG-B2xaZ3wB.js +7 -0
  132. package/dist/bg-BG-DAR7_x2a.js +7 -0
  133. package/dist/bg-BG-DqfAUTUt.js +7 -0
  134. package/dist/bg-BG-ivZjQNJZ.js +7 -0
  135. package/dist/bin-BOmfqfrr.js +30 -0
  136. package/dist/birthDateUtils-D6uk7zwm.js +84 -0
  137. package/dist/businessRegistrationNumberPatterns-A08SLm03.js +982 -0
  138. package/dist/capital-DTjbiurV.js +23 -0
  139. package/dist/cash-stack-7KpYpBek.js +33 -0
  140. package/dist/certificate-BPuoJ6Ip.js +23 -0
  141. package/dist/checkmark-BiSLf8M1.js +20 -0
  142. package/dist/checkmark-circle-Ams7bSve.js +28 -0
  143. package/dist/checkmark-circle-fill-_p4ss4ac.js +30 -0
  144. package/dist/checkmark-small-3bw4ftPV.js +20 -0
  145. package/dist/chevron-down-GgZawvoy.js +20 -0
  146. package/dist/chevron-left-TeZTTvo5.js +20 -0
  147. package/dist/chevron-right-Cg8XlTxx.js +20 -0
  148. package/dist/chevron-up-COQUTli0.js +20 -0
  149. package/dist/circle-CypWzg83.js +30 -0
  150. package/dist/circle-small-filled-DfdK2A35.js +20 -0
  151. package/dist/clock-DmfGJ2r9.js +28 -0
  152. package/dist/coins-CBvbB8_X.js +30 -0
  153. package/dist/constants-C8yo0_RA.js +233 -0
  154. package/dist/contract-D1_RJ_xh.js +20 -0
  155. package/dist/countries-BGMTpyJv.js +41 -0
  156. package/dist/country-BEZkohEO.js +25 -0
  157. package/dist/cross-BORHADVQ.js +20 -0
  158. package/dist/cross-circle-fill-CUXdo1x-.js +30 -0
  159. package/dist/cross-circle-fill-small-DdoPZZeo.js +20 -0
  160. package/dist/cs-CZ-BwO4yrI4.js +7 -0
  161. package/dist/cs-CZ-CHMQYoMF.js +7 -0
  162. package/dist/cs-CZ-DsKlW7_D.js +7 -0
  163. package/dist/cs-CZ-NVntX32n.js +7 -0
  164. package/dist/cs-CZ-ywYpJk1F.js +7 -0
  165. package/dist/da-DK-BvT8Ob4A.js +7 -0
  166. package/dist/da-DK-BzBfkSME.js +7 -0
  167. package/dist/da-DK-CE7jnGea.js +7 -0
  168. package/dist/da-DK-DH5YNYFM.js +7 -0
  169. package/dist/da-DK-LPtdP8h0.js +7 -0
  170. package/dist/datasetUtil-BdHPWsxZ.js +45 -0
  171. package/dist/de-DE-C9cUCFOi.js +7 -0
  172. package/dist/de-DE-Cn866nnd.js +7 -0
  173. package/dist/de-DE-DA4LpyZI.js +7 -0
  174. package/dist/de-DE-DKkoZQ0X.js +7 -0
  175. package/dist/de-DE-DY_EJohI.js +7 -0
  176. package/dist/de-DE-vdy64knk.js +7 -0
  177. package/dist/debouncedInputEvent-Fwwp_K_-.js +54 -0
  178. package/dist/debugStore-Dwn1FXrh.js +9 -0
  179. package/dist/decision-makers-group-iEF9oKPp.js +2673 -0
  180. package/dist/decisionMakerRoles-C6LMC4mh.js +185 -0
  181. package/dist/document-1-qvV57JdS.js +20 -0
  182. package/dist/document-person-DiJ7M8-D.js +28 -0
  183. package/dist/download-Ca4w0Yfr.js +23 -0
  184. package/dist/dropinUtils-DTBezwYT.js +491 -0
  185. package/dist/edit-1-D8VhDchs.js +20 -0
  186. package/dist/el-GR-ChapyKa7.js +7 -0
  187. package/dist/el-GR-Cvms0L4K.js +7 -0
  188. package/dist/el-GR-D9PjIB9j.js +7 -0
  189. package/dist/el-GR-Ov9hqMNe.js +7 -0
  190. package/dist/el-GR-aelq5Q0a.js +7 -0
  191. package/dist/el-GR-zFv0QxMR.js +7 -0
  192. package/dist/en-US-B7HQdrn_.js +7 -0
  193. package/dist/en-US-CI7y0UEH.js +7 -0
  194. package/dist/en-US-C_VjFvk_.js +7 -0
  195. package/dist/en-US-Cz4JoU20.js +41 -0
  196. package/dist/en-US-DPr5RN3e.js +7 -0
  197. package/dist/en-US-U0d3NI20.js +7 -0
  198. package/dist/en-US-tFsDZf7y.js +7 -0
  199. package/dist/entityAssociationUtil-CY0grcyH.js +58 -0
  200. package/dist/error-BvgoQFEI.js +36 -0
  201. package/dist/es-ES-BQrdtEfn.js +7 -0
  202. package/dist/es-ES-BdByhG4y.js +7 -0
  203. package/dist/es-ES-BzlHKYJK.js +7 -0
  204. package/dist/es-ES-DCUvAmKI.js +7 -0
  205. package/dist/es-ES-DdrA8McY.js +7 -0
  206. package/dist/es-ES-DhkTbihW.js +7 -0
  207. package/dist/es-LA-3WgncmHx.js +7 -0
  208. package/dist/es-LA-BxtxM3Ty.js +7 -0
  209. package/dist/es-LA-ChRHGYJP.js +7 -0
  210. package/dist/es-LA-JRuDva0n.js +7 -0
  211. package/dist/es-LA-i7tKJmA8.js +7 -0
  212. package/dist/et-EE-BXY66vAz.js +7 -0
  213. package/dist/et-EE-D8TSvkoE.js +7 -0
  214. package/dist/et-EE-DOgb4q9o.js +7 -0
  215. package/dist/et-EE-HHgM0CfO.js +7 -0
  216. package/dist/et-EE-V-YOCgoh.js +7 -0
  217. package/dist/external-link-Dy4le-8Q.js +20 -0
  218. package/dist/fi-FI-B-eTv4bG.js +7 -0
  219. package/dist/fi-FI-CClpbvJJ.js +7 -0
  220. package/dist/fi-FI-CVBmM-U1.js +7 -0
  221. package/dist/fi-FI-DCYPQ6vS.js +7 -0
  222. package/dist/fi-FI-DCbhu29J.js +7 -0
  223. package/dist/fieldConfigurations-CZCFghnK.js +11 -0
  224. package/dist/form-rules-B0RwhsVw.js +284 -0
  225. package/dist/formFieldsUtils-CnDkgahc.js +7 -0
  226. package/dist/formUtils-BHgG8yQZ.js +52 -0
  227. package/dist/formUtils-DVDcdZsP.js +84 -0
  228. package/dist/formatCurrency-BetgkQKi.js +23 -0
  229. package/dist/formatValidationError-q_w9DTrl.js +23 -0
  230. package/dist/fr-FR-B-jA_cbo.js +7 -0
  231. package/dist/fr-FR-BIyJL6Jj.js +7 -0
  232. package/dist/fr-FR-BzyefnBh.js +7 -0
  233. package/dist/fr-FR-C1xYwHeC.js +7 -0
  234. package/dist/fr-FR-D0hY9V44.js +7 -0
  235. package/dist/fr-FR-Doo1FVx-.js +7 -0
  236. package/dist/genUtils-nphCwt1A.js +60 -0
  237. package/dist/getDefaultRegistrationNumberType-CIu4WMln.js +1056 -0
  238. package/dist/getFormSlice-C1ma6Xd4.js +21 -0
  239. package/dist/getLegalEntityCountry-BK-HHa65.js +15 -0
  240. package/dist/getName-DgxRqagk.js +34 -0
  241. package/dist/getProblemsForEntity-Bn6dXidE.js +16 -0
  242. package/dist/getTrustedDecisionMakers-Ta-pURcL.js +25 -0
  243. package/dist/getTrustedFields-BJ88GlM-.js +28 -0
  244. package/dist/gift-Bs_mAgul.js +20 -0
  245. package/dist/globalStore-WASei98w.js +418 -0
  246. package/dist/graph-Co0JhGiY.js +32 -0
  247. package/dist/graph-up-DIvH9haf.js +38 -0
  248. package/dist/headquarter-BESfDGKh.js +42 -0
  249. package/dist/hotel-Vne7G5M6.js +33 -0
  250. package/dist/hr-HR-6Wj5Tf60.js +7 -0
  251. package/dist/hr-HR-B4FRVzrd.js +7 -0
  252. package/dist/hr-HR-B6z7-PYE.js +7 -0
  253. package/dist/hr-HR-BOYktLQ2.js +7 -0
  254. package/dist/hr-HR-Ct_41fWV.js +7 -0
  255. package/dist/http-fdIO--pH.js +204 -0
  256. package/dist/hu-HU-B7ofWKn_.js +7 -0
  257. package/dist/hu-HU-Bwm4UqZz.js +7 -0
  258. package/dist/hu-HU-CO_7jvk9.js +7 -0
  259. package/dist/hu-HU-CgJ_F3l2.js +7 -0
  260. package/dist/hu-HU-DXK7B0r_.js +7 -0
  261. package/dist/image-BQM21XCk.js +23 -0
  262. package/dist/info-DExoPRH5.js +32 -0
  263. package/dist/info-filled-11KMeUso.js +32 -0
  264. package/dist/invalidateRootLegalEntity-BHaVREw-.js +45 -0
  265. package/dist/isEmpty-Uewyl-r6.js +14 -0
  266. package/dist/isEmptyEntity-3OHnhXqG.js +43 -0
  267. package/dist/it-IT-BFIW0DCO.js +7 -0
  268. package/dist/it-IT-CNr6PIu3.js +7 -0
  269. package/dist/it-IT-CQVFYSVx.js +7 -0
  270. package/dist/it-IT-DfGdOsTs.js +7 -0
  271. package/dist/it-IT-DgRuEpeD.js +7 -0
  272. package/dist/it-IT-tZ7dP-Ia.js +7 -0
  273. package/dist/ja-JP--tMJF7eu.js +7 -0
  274. package/dist/ja-JP-BjMyxZiN.js +7 -0
  275. package/dist/ja-JP-Ct54-uwM.js +7 -0
  276. package/dist/ja-JP-CtX9NZKD.js +7 -0
  277. package/dist/ja-JP-DAClbueM.js +7 -0
  278. package/dist/ja-JP-DOuEAOlh.js +7 -0
  279. package/dist/keys-Ce8YnRP2.js +20 -0
  280. package/dist/legalArrangementUtils-C68JdH6I.js +114 -0
  281. package/dist/listToRecord-DumSkYDz.js +10 -0
  282. package/dist/location-zRH5zJ8c.js +23 -0
  283. package/dist/lt-LT-BUuouq_-.js +7 -0
  284. package/dist/lt-LT-Cs3cvyKf.js +7 -0
  285. package/dist/lt-LT-DQp7UGdC.js +7 -0
  286. package/dist/lt-LT-DoYCfhZU.js +7 -0
  287. package/dist/lt-LT-DqtpAjOg.js +7 -0
  288. package/dist/lv-LV-BCXqSzkk.js +7 -0
  289. package/dist/lv-LV-BW0BscAd.js +7 -0
  290. package/dist/lv-LV-C3p57pZV.js +7 -0
  291. package/dist/lv-LV-ZmyUvPst.js +7 -0
  292. package/dist/lv-LV-cKvnQI3j.js +7 -0
  293. package/dist/mail-i1-zg-cv.js +20 -0
  294. package/dist/mapAddressLocalizationToJpAddressSchema-DpOIaxj6.js +26 -0
  295. package/dist/mapExistingFile-BkwRTTRm.js +55 -0
  296. package/dist/mapJpAddressSchemaToAddressLocalizations-D3VO2nhc.js +74 -0
  297. package/dist/mapLegalEntityToIndividualSchema-CBKR-InO.js +251 -0
  298. package/dist/mapScriptLocalization-BCfkZo1y.js +46 -0
  299. package/dist/mapTransferInstrumentToPayoutAccount-ROfaTly6.js +44 -0
  300. package/dist/maskHelpers-C0wnCoJl.js +719 -0
  301. package/dist/minus-circle-filled-CxUdRO8J.js +30 -0
  302. package/dist/nl-NL-B77Xr99l.js +7 -0
  303. package/dist/nl-NL-BUwMAW5C.js +7 -0
  304. package/dist/nl-NL-B_MaTF5h.js +7 -0
  305. package/dist/nl-NL-CePL3t7P.js +7 -0
  306. package/dist/nl-NL-DR5SCDAF.js +7 -0
  307. package/dist/nl-NL-DqGE4Nz5.js +7 -0
  308. package/dist/no-NO-BePxpMbr.js +7 -0
  309. package/dist/no-NO-DGCfRiU8.js +7 -0
  310. package/dist/no-NO-DdI2BI_e.js +7 -0
  311. package/dist/no-NO-P8SZ1t-h.js +7 -0
  312. package/dist/no-NO-oL1v_O9N.js +7 -0
  313. package/dist/options-horizontal-D86T_xAF.js +30 -0
  314. package/dist/partner-Dje0ykF6.js +30 -0
  315. package/dist/patternValidators-DsrZkuOO.js +73 -0
  316. package/dist/pay-by-link-plane-DAiddPu6.js +33 -0
  317. package/dist/payout-DKiGv3F9.js +38 -0
  318. package/dist/pdf-CC8vqpTo.js +22320 -0
  319. package/dist/pdf.worker.min-CdKJICZZ.js +75124 -0
  320. package/dist/person-DgALGIIz.js +23 -0
  321. package/dist/pl-PL-6Q3Ue3F5.js +7 -0
  322. package/dist/pl-PL-B5PBixAB.js +7 -0
  323. package/dist/pl-PL-BCkw9R28.js +7 -0
  324. package/dist/pl-PL-BY6KUTBO.js +7 -0
  325. package/dist/pl-PL-D-s-JI6X.js +7 -0
  326. package/dist/plus-DlQKP2C9.js +20 -0
  327. package/dist/plus-circle-filled-BntUOVIJ.js +30 -0
  328. package/dist/processCapabilities-CWE5UFt8.js +870 -0
  329. package/dist/processValidationErrors-CjsNfiRK.js +62 -0
  330. package/dist/pt-BR-B_XHiDCU.js +7 -0
  331. package/dist/pt-BR-BvNR77Ru.js +7 -0
  332. package/dist/pt-BR-CrLCMcSz2.js +7 -0
  333. package/dist/pt-BR-MrUfWW4a.js +7 -0
  334. package/dist/pt-BR-vwt2tE7H.js +7 -0
  335. package/dist/pt-PT-B17is9TY.js +7 -0
  336. package/dist/pt-PT-BZNPd_Tb.js +7 -0
  337. package/dist/pt-PT-DDYnXawl.js +7 -0
  338. package/dist/pt-PT-DhF8wwYH.js +7 -0
  339. package/dist/pt-PT-Du2K44jh.js +7 -0
  340. package/dist/pt-PT-qAzFgjvF.js +7 -0
  341. package/dist/recurring-DZgT_ekJ.js +23 -0
  342. package/dist/resolveEnvironment-B3aGkYuN.js +1000 -0
  343. package/dist/revenue-accelerate-aMLYFVW6.js +30 -0
  344. package/dist/ro-RO-B3Fcn95o.js +7 -0
  345. package/dist/ro-RO-BA5GhaCE.js +7 -0
  346. package/dist/ro-RO-BmHe4pZ-.js +7 -0
  347. package/dist/ro-RO-DChAv29z.js +7 -0
  348. package/dist/ro-RO-W1t7Mnbn.js +7 -0
  349. package/dist/roleMetadata-Dm1FVuPT.js +56 -0
  350. package/dist/save-uDNye08N.js +20 -0
  351. package/dist/search-0OS6oe8N.js +30 -0
  352. package/dist/show-BWoS9-Y1.js +23 -0
  353. package/dist/sk-SK-BeNF_m_j.js +7 -0
  354. package/dist/sk-SK-C9CiQLgt.js +7 -0
  355. package/dist/sk-SK-CISCMQ2G.js +7 -0
  356. package/dist/sk-SK-CcoUWnJ4.js +7 -0
  357. package/dist/sk-SK-D10Kpths.js +7 -0
  358. package/dist/sl-SI-Bxu4m_5e.js +7 -0
  359. package/dist/sl-SI-DCMml0lX.js +7 -0
  360. package/dist/sl-SI-DmYiMn91.js +7 -0
  361. package/dist/sl-SI-DxomO9JQ.js +7 -0
  362. package/dist/sl-SI-Qe4hzx5a.js +7 -0
  363. package/dist/solution-payments-BMal7uJZ.js +20 -0
  364. package/dist/store-N7ZA4FKy.js +20 -0
  365. package/dist/style.css +2341 -2252
  366. package/dist/styles-DYaAeu4q.js +2337 -2248
  367. package/dist/summaryItem-uDWmtYtt.js +16 -0
  368. package/dist/sv-SE-B-CXDaXM.js +7 -0
  369. package/dist/sv-SE-BzPNBHOj.js +7 -0
  370. package/dist/sv-SE-C9SgeFv6.js +7 -0
  371. package/dist/sv-SE-DESDUMyu.js +7 -0
  372. package/dist/sv-SE-Dq6oK7B5.js +7 -0
  373. package/dist/sv-SE-issaSBHd.js +7 -0
  374. package/dist/terminal-1-0RlQpbUC.js +30 -0
  375. package/dist/toFullWidth-Dgy4X4i8.js +52 -0
  376. package/dist/translation-DbATp_35.js +684 -0
  377. package/dist/trustUtil-5cyXiJnX.js +98 -0
  378. package/dist/types/adaptiveWorkflow/components/Fields/TaxInformation/TaxIdTypeSelectorField.d.ts +1 -2
  379. package/dist/types/adaptiveWorkflow/components/Fields/TaxInformation/TaxInformationFieldGroup.d.ts +1 -2
  380. package/dist/types/adaptiveWorkflow/utils/utils.d.ts +1 -1
  381. package/dist/types/api/configurations/useScenarios.d.ts +1 -1
  382. package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +12 -12
  383. package/dist/types/api/documentValidation/useDocumentValidate.d.ts +2 -2
  384. package/dist/types/api/documents/documents.types.d.ts +9 -0
  385. package/dist/types/api/documents/useCreateDocument.d.ts +10 -3
  386. package/dist/types/api/documents/useDeleteDocument.d.ts +1 -1
  387. package/dist/types/api/documents/useDocument.d.ts +1 -1
  388. package/dist/types/api/documents/useDocuments.d.ts +10 -2
  389. package/dist/types/api/documents/useUpdateDocument.d.ts +3 -3
  390. package/dist/types/api/invitedEntity/getInvitedEntityProblems.d.ts +1 -1
  391. package/dist/types/api/legalEntity/legalEntity.types.d.ts +32 -0
  392. package/dist/types/api/legalEntity/useLegalEntity.d.ts +92 -92
  393. package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +14 -14
  394. package/dist/types/api/taskStatus/useTaskStatuses.d.ts +1 -1
  395. package/dist/types/api/transferInstruments/transferInstruments.types.d.ts +18 -0
  396. package/dist/types/api/transferInstruments/useCreateTransferInstrument.d.ts +2 -2
  397. package/dist/types/api/transferInstruments/useTransferInstrument.d.ts +1 -1
  398. package/dist/types/api/transferInstruments/useUpdateTransferInstrument.d.ts +2 -2
  399. package/dist/types/api/transferInstruments/useUpdateTrustedTransferInstrument.d.ts +1 -1
  400. package/dist/types/components/Apps/tasks/TaskList/TaskList.d.ts +1 -1
  401. package/dist/types/components/BankAccount/fields/BankAccountNumber/fieldConfig.d.ts +2 -0
  402. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +1 -1
  403. package/dist/types/components/BankAccount/forms/PayoutAccount/types.d.ts +1 -1
  404. package/dist/types/components/BankAccount/forms/PayoutCountryDetails/types.d.ts +1 -1
  405. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +1 -1
  406. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +1 -1
  407. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/AccountHolderDescriptionFragment.d.ts +1 -1
  408. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/types.d.ts +1 -1
  409. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/utils.d.ts +1 -1
  410. package/dist/types/components/BankAccount/mapping/mapPayoutAccountSchemaToApiBankAccount.d.ts +2 -2
  411. package/dist/types/components/BankAccount/mapping/mapPayoutDetailsToTransferInstrument.d.ts +3 -3
  412. package/dist/types/components/BankAccount/mapping/mapPayoutDocumentsToApiDocuments.d.ts +2 -2
  413. package/dist/types/components/BankAccount/mapping/mapTransferInstrumentToPayoutAccount.d.ts +1 -1
  414. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +8 -4
  415. package/dist/types/components/BankAccount/tasks/PayoutAccount/PayoutAccountTaskListItem.d.ts +2 -2
  416. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +1 -1
  417. package/dist/types/components/Business/hooks/useBusinessDetailsData.d.ts +1 -1
  418. package/dist/types/components/Business/hooks/useSubmitBusinessDetails.types.d.ts +1 -1
  419. package/dist/types/components/Business/mapping/businessDetails/businessDetailsKeyMappings.d.ts +4 -4
  420. package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +4 -4
  421. package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +1 -1
  422. package/dist/types/components/Business/mapping/businessDetails/solePropBusinessDetailsKeyMappings.d.ts +4 -4
  423. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -1
  424. package/dist/types/components/Business/utils/buildRequiredForms.d.ts +1 -1
  425. package/dist/types/components/Business/utils/getAvailableCompanyStructures.d.ts +1 -2
  426. package/dist/types/components/Business/utils/utils.d.ts +2 -15
  427. package/dist/types/components/BusinessLines/tasks/types.d.ts +1 -1
  428. package/dist/types/components/Contract/tasks/PciDropin/types.d.ts +1 -1
  429. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -1
  430. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +33 -33
  431. package/dist/types/components/EFP/mapping/mapBusinessFinancingToLegalEntity.d.ts +2 -2
  432. package/dist/types/components/EFP/mapping/mapLegalEntityToBusinessFinancing.d.ts +2 -2
  433. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +3 -3
  434. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +3 -4
  435. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsGettingStarted/SourceOfFundsGettingStarted.d.ts +2 -3
  436. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsUploader/SourceOfFundsUpload.d.ts +1 -1
  437. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +1 -3
  438. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +13 -5
  439. package/dist/types/components/EFP/tasks/TaxReportingDropin/TaxReportingGettingStarted.d.ts +2 -2
  440. package/dist/types/components/EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent.d.ts +1 -1
  441. package/dist/types/components/EmbeddedDropins/ManageIndividualComponent/ManageIndividualComponent.d.ts +1 -1
  442. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentComponent.d.ts +1 -1
  443. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverview/ManageTransferInstrumentOverview.d.ts +1 -2
  444. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItem/ManageTransferInstrumentOverviewItem.d.ts +1 -2
  445. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +1 -2
  446. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/types.d.ts +1 -1
  447. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/ViewVerificationStatusComponent.d.ts +1 -1
  448. package/dist/types/components/GlobalEntry/companyTypeMetadata.d.ts +10 -0
  449. package/dist/types/components/GlobalEntry/forms/CompanyStructure/CompanyStructure.d.ts +3 -0
  450. package/dist/types/components/GlobalEntry/forms/CompanyStructure/types.d.ts +10 -0
  451. package/dist/types/components/GlobalEntry/forms/RegistrationInformation/RegistrationInformation.d.ts +1 -1
  452. package/dist/types/components/GlobalEntry/mapping/globalEntryKeyMapping.d.ts +15 -0
  453. package/dist/types/components/GlobalEntry/mapping/mapGlobalEntrySchemaToLegalEntity.d.ts +6 -0
  454. package/dist/types/components/GlobalEntry/mapping/mapLegalEntityToGlobalEntrySchema.d.ts +9 -0
  455. package/dist/types/components/GlobalEntry/rules.d.ts +1 -0
  456. package/dist/types/components/GlobalEntry/tasks/GlobalEntry.d.ts +1 -1
  457. package/dist/types/components/GlobalEntry/tasks/GlobalEntryModal.d.ts +1 -1
  458. package/dist/types/components/GlobalEntry/tasks/types.d.ts +2 -0
  459. package/dist/types/components/GlobalEntry/utils/buildRequiredForms.d.ts +16 -0
  460. package/dist/types/components/GlobalEntry/utils/getAvailableCompanyStructures.d.ts +12 -0
  461. package/dist/types/components/GlobalEntry/utils/submitGlobalEntry.d.ts +20 -0
  462. package/dist/types/components/GlobalEntry/utils/utils.d.ts +18 -0
  463. package/dist/types/components/GlobalEntry/validate.d.ts +3 -1
  464. package/dist/types/components/Individual/forms/BasicDetails/BasicDetails.types.d.ts +3 -3
  465. package/dist/types/components/Individual/forms/IdDocumentUpload/types.d.ts +1 -1
  466. package/dist/types/components/Individual/forms/IdNowVerificationModal/isIdNowModalOpen.d.ts +8 -8
  467. package/dist/types/components/Individual/forms/Individual.types.d.ts +2 -3
  468. package/dist/types/components/Individual/helpers/bafinUtils.d.ts +3 -4
  469. package/dist/types/components/Individual/helpers/findRelevantTaxInformation.d.ts +28 -0
  470. package/dist/types/components/Individual/helpers/hasLiveSelfieError.d.ts +11 -0
  471. package/dist/types/components/Individual/helpers/isManualVerificationOrExistingDoc.d.ts +13 -0
  472. package/dist/types/components/Individual/mapping/individualKeyMappings.d.ts +4 -4
  473. package/dist/types/components/Individual/mapping/mapIndividualDocumentToApiDocument.d.ts +2 -2
  474. package/dist/types/components/Individual/mapping/mapIndividualSchemaToLegalEntity.d.ts +2 -2
  475. package/dist/types/components/Individual/mapping/mapLegalEntityToIndividualSchema.d.ts +1 -1
  476. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +1 -1
  477. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +34 -10
  478. package/dist/types/components/Individual/tasks/DecisionMakers/getTrustedDecisionMakers.d.ts +2 -3
  479. package/dist/types/components/Individual/tasks/DecisionMakers/hooks/useTaskStatusWithTimeout.d.ts +1 -0
  480. package/dist/types/components/Individual/tasks/DecisionMakers/types.d.ts +2 -3
  481. package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
  482. package/dist/types/components/Shared/EntityAssociation/types.d.ts +2 -2
  483. package/dist/types/components/Shared/Introduction/Introduction.d.ts +1 -1
  484. package/dist/types/components/Shared/Introduction/IntroductionScreen.d.ts +1 -1
  485. package/dist/types/components/Shared/Introduction/constants.d.ts +1 -1
  486. package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
  487. package/dist/types/components/Shared/SingpassBanner/SingpassBanner.d.ts +1 -1
  488. package/dist/types/components/Shared/SingpassSelection/types.d.ts +1 -1
  489. package/dist/types/components/Shared/devex/DebugListener/debugInfo.d.ts +1 -2
  490. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/RegistrationNumberTypeSelector/getDefaultRegistrationNumberType.d.ts +1 -2
  491. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/TaxIdNumberTypeSelector.d.ts +1 -2
  492. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/findExistingTaxInformation.d.ts +10 -0
  493. package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +3 -4
  494. package/dist/types/components/Shared/fields/TaxInformationField/taxIdNumberTypes.d.ts +107 -8
  495. package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +7 -6
  496. package/dist/types/components/Shared/fields/VatNumberField/VatNumberTypeSelector/VatNumberTypeSelector.d.ts +1 -2
  497. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  498. package/dist/types/components/Shared/forms/BusinessTypeSelection/types.d.ts +1 -1
  499. package/dist/types/components/Shared/forms/BusinessTypeSelection/useUpdateLegalEntityAndSelectAccountHolder.d.ts +1 -2
  500. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +2 -4
  501. package/dist/types/components/Shared/forms/ConstitutionalDocument/types.d.ts +1 -1
  502. package/dist/types/components/Shared/forms/DocumentUpload/types.d.ts +1 -1
  503. package/dist/types/components/Shared/tasks/CustomerSupport/mapping/customerSupportKeyMapping.d.ts +2 -2
  504. package/dist/types/components/Trust/hooks/useExemptSettlor.d.ts +1 -1
  505. package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +1 -1
  506. package/dist/types/components/Trust/mapping/mapLegalEntityToTrust.d.ts +1 -1
  507. package/dist/types/components/Trust/mapping/mapTrustDocumentToApiDocument.d.ts +2 -2
  508. package/dist/types/components/Trust/mapping/mapTrustToLegalEntity.d.ts +2 -2
  509. package/dist/types/components/Trust/mapping/trustKeyMappings.d.ts +4 -4
  510. package/dist/types/components/Trust/mapping/trustMembers/getTrustMembers.d.ts +1 -1
  511. package/dist/types/components/Trust/mapping/trustMembers/mapEntityAssociationsToTrustMembers.d.ts +3 -4
  512. package/dist/types/components/Trust/mapping/trustMembers/mapRootLegalEntityToTrustMember.d.ts +1 -1
  513. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/types.d.ts +1 -1
  514. package/dist/types/components/Trust/tasks/TrustDropin/types.d.ts +1 -1
  515. package/dist/types/components/Trust/tasks/TrustMembers/types.d.ts +3 -4
  516. package/dist/types/components/Trust/utils/addOrUpdateAssociatedTrustMember.d.ts +1 -1
  517. package/dist/types/components/Trust/utils/addOrUpdateUndefinedBeneficiary.d.ts +1 -1
  518. package/dist/types/components/Trust/utils/createExemptSettlor.d.ts +1 -1
  519. package/dist/types/components/Trust/utils/deleteAssociatedTrustMember.d.ts +1 -1
  520. package/dist/types/components/Trust/utils/deleteUndefinedBeneficiary.d.ts +1 -1
  521. package/dist/types/components/Trust/utils/trustUtil.d.ts +5 -6
  522. package/dist/types/components/Trust/utils/updateExemptSettlorName.d.ts +1 -1
  523. package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +1 -2
  524. package/dist/types/components/UnincorporatedPartnership/mapping/mapLegalEntityToUnincorporatedPartnership.d.ts +1 -1
  525. package/dist/types/components/UnincorporatedPartnership/mapping/mapUnincorporatedPartnershipToLegalEntity.d.ts +2 -2
  526. package/dist/types/components/UnincorporatedPartnership/mapping/unincorporatedPartnershipKeyMappings.d.ts +3 -3
  527. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipMembers/types.d.ts +1 -2
  528. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/types.d.ts +1 -2
  529. package/dist/types/components/UnincorporatedPartnership/utils/unincorporatedPartnershipMembers.d.ts +3 -4
  530. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +1 -1
  531. package/dist/types/context/ToggleContext/types.d.ts +0 -4
  532. package/dist/types/core/errorMapping.d.ts +3 -4
  533. package/dist/types/core/models/api/accountIdentification.d.ts +5 -1
  534. package/dist/types/core/models/api/legal-entity-association.d.ts +0 -19
  535. package/dist/types/core/process-field-configurations.d.ts +4 -6
  536. package/dist/types/core/user-events.d.ts +2 -4
  537. package/dist/types/hooks/introduction/useCanSeeIntroduction.d.ts +1 -1
  538. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +1 -1
  539. package/dist/types/hooks/introduction/useShouldShowIntroduction.d.ts +1 -1
  540. package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +1 -1
  541. package/dist/types/hooks/useAssociatedLegalEntity.d.ts +1 -2
  542. package/dist/types/hooks/useAssociatedLegalRepresentative.d.ts +1 -1
  543. package/dist/types/hooks/useBusinessSetup.d.ts +1 -1
  544. package/dist/types/hooks/useForm/types.d.ts +1 -2
  545. package/dist/types/hooks/useLegalEntityType.d.ts +1 -2
  546. package/dist/types/hooks/useScenarioConfiguration.d.ts +1 -1
  547. package/dist/types/router/DefaultRouteRedirect.d.ts +1 -1
  548. package/dist/types/router/OnboardingRouter.d.ts +1 -2
  549. package/dist/types/router/getDefaultTask.d.ts +1 -1
  550. package/dist/types/stores/globalStore/calculateTaskStatus.d.ts +3 -5
  551. package/dist/types/stores/globalStore/determineTaskIdentifiers.d.ts +3 -5
  552. package/dist/types/stores/globalStore/get-task-status.d.ts +4 -4
  553. package/dist/types/stores/globalStore/globalStore.d.ts +3 -5
  554. package/dist/types/stores/globalStore/isEmptyEntity.d.ts +1 -1
  555. package/dist/types/types/businessEntityType.d.ts +1 -2
  556. package/dist/types/types/errors/capability-problems.d.ts +5 -1
  557. package/dist/types/types/errors/entity-problems.d.ts +8 -5
  558. package/dist/types/types/form-rules.d.ts +1 -1
  559. package/dist/types/utils/accountHolderUtils.d.ts +1 -1
  560. package/dist/types/utils/addLinkedFields.d.ts +2 -2
  561. package/dist/types/utils/analytics/debouncedInputEvent.d.ts +4 -4
  562. package/dist/types/utils/analytics/getAnalyticsAssociatedEntityDetails.d.ts +2 -3
  563. package/dist/types/utils/analytics/getPrefilledDetails.d.ts +2 -2
  564. package/dist/types/utils/api/documentUtils.d.ts +21 -10
  565. package/dist/types/utils/api/getProblemsForEntity.d.ts +1 -1
  566. package/dist/types/utils/api/processCapabilities.d.ts +11 -4
  567. package/dist/types/utils/bankUtils.d.ts +5 -0
  568. package/dist/types/utils/birthDateUtils.d.ts +6 -1
  569. package/dist/types/utils/businessUtils.d.ts +21 -6
  570. package/dist/types/utils/customerSupportUtils.d.ts +2 -3
  571. package/dist/types/utils/decisionMakerRoles.d.ts +4 -5
  572. package/dist/types/utils/entityAssociationUtil.d.ts +21 -12
  573. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  574. package/dist/types/utils/getFieldsWithExistingData.d.ts +2 -2
  575. package/dist/types/utils/getLegalEntityCountry.d.ts +1 -1
  576. package/dist/types/utils/getName.d.ts +3 -3
  577. package/dist/types/utils/getTrustedFields.d.ts +4 -5
  578. package/dist/types/utils/mapping/documentGuidanceMap.d.ts +2 -2
  579. package/dist/types/utils/mapping/getPage.d.ts +3 -4
  580. package/dist/types/utils/mapping/mappingRecord.d.ts +1 -1
  581. package/dist/types/utils/roleMetadata.d.ts +1 -1
  582. package/dist/types/utils/unincorporatedParnershipUtils.d.ts +4 -4
  583. package/dist/types-B9zXzag-.js +18 -0
  584. package/dist/types-BA3bcGAv.js +58 -0
  585. package/dist/types-CZAHRt31.js +147 -0
  586. package/dist/types-Cwq1JAWT.js +31 -0
  587. package/dist/upload-C5NC1E4N.js +23 -0
  588. package/dist/uppercase-DvjwUM0n.js +7 -0
  589. package/dist/useAccountHolder-DDto9d9n.js +102 -0
  590. package/dist/useAdaptiveWorkflow-DryNv0zI.js +28 -0
  591. package/dist/useAllowedCountries-C-nqVePW.js +80 -0
  592. package/dist/useAnalyticsContext-gSnRnYgV.js +12 -0
  593. package/dist/useAssociatedLegalEntity-DtZtKlls.js +35 -0
  594. package/dist/useBusinessDetailsData-DFU0dLxw.js +4732 -0
  595. package/dist/useBusinessLines-BZfFqvS_.js +27 -0
  596. package/dist/useCanSeeIntroduction-DQbanJNE.js +38 -0
  597. package/dist/useCreateLegalEntity-qP7MeAmi.js +24 -0
  598. package/dist/useDataMissingRemediations-ttUrk09_.js +39 -0
  599. package/dist/useDataset-CdLBLq98.js +98 -0
  600. package/dist/useDeleteTransferInstrument-Dtv14H9I.js +31 -0
  601. package/dist/useForm-CWrbJG44.js +504 -0
  602. package/dist/useHideTaskStepper-Dk7ZQ3U8.js +26 -0
  603. package/dist/useId-BkDhUta2.js +28 -0
  604. package/dist/useIndustryCodes-BMK6IMiW.js +32 -0
  605. package/dist/useLegalEntity-DHA8TJeV.js +48 -0
  606. package/dist/useMultiForm-BxASst0O.js +790 -0
  607. package/dist/useNavigate-CO1Mcekp.js +246 -0
  608. package/dist/useOnboardingStatus-Cz6-hSX4.js +23 -0
  609. package/dist/usePciQuestionnaireList-CWz7Ngs6.js +26 -0
  610. package/dist/useSalesChannels-bV9DgyLW.js +47 -0
  611. package/dist/useScenarios-Bn93htbx.js +55 -0
  612. package/dist/useSettingsContext-9O3Aqpfq.js +12 -0
  613. package/dist/useTaskLandedEvent-DwZHcMEQ.js +26 -0
  614. package/dist/useTaskStatus-DJxOWvuN.js +23 -0
  615. package/dist/useTermsOfServiceStatus-CyVxYqpg.js +39 -0
  616. package/dist/useToastContext-B6Mqc2HY.js +12 -0
  617. package/dist/useToggleContext-B_YexrbT.js +21 -0
  618. package/dist/useTrustMembers-DWo3WU8M.js +151 -0
  619. package/dist/useUnincorporatedPartnershipMembers-DwFPW09D.js +69 -0
  620. package/dist/useUpdateBusinessLines-JRPjqoe9.js +43 -0
  621. package/dist/useUpdateLegalEntity-CqmqXsbR.js +29 -0
  622. package/dist/utils-BWumuCvl.js +210 -0
  623. package/dist/utils-CJcGZvj1.js +178 -0
  624. package/dist/utils-CYUYe54m.js +24 -0
  625. package/dist/utils-Ck_mZapQ.js +1755 -0
  626. package/dist/utils-DdHbAadK.js +80 -0
  627. package/dist/utils-SKYT7xU4.js +52 -0
  628. package/dist/validate-BZ1-ZeKr.js +430 -0
  629. package/dist/validate-DTz70AWN.js +224 -0
  630. package/dist/validate-DUcT-JGF.js +178 -0
  631. package/dist/validate-Dr8UKZCX.js +126 -0
  632. package/dist/validateExtractionResult-CntKbt8c.js +343 -0
  633. package/dist/validationError-DV6t8Ubb.js +55 -0
  634. package/dist/validationResult-bjYBDjbU.js +29 -0
  635. package/dist/validatorUtils-D2O6AAZn.js +106 -0
  636. package/dist/warning-circle-fill-C2lMYPJW.js +30 -0
  637. package/dist/warning-diamond-filled-CQ2DdW5g.js +30 -0
  638. package/dist/webinar-BpZWqd-g.js +33 -0
  639. package/package.json +26 -26
  640. package/dist/4-people-Dxu4nHSX.js +0 -35
  641. package/dist/AcceptTermsOfServiceWorkflow-CvKbU2WY.js +0 -28
  642. package/dist/Accordion-Sjyj7C_t.js +0 -112
  643. package/dist/AccountSetupRejected-Cq_nlmLn.js +0 -18
  644. package/dist/AdaptiveWorkflow-CM7ZVGXv.js +0 -210
  645. package/dist/AdaptiveWorkflowComponent-tM1hJ1zF.js +0 -165
  646. package/dist/AddressFields-BsxEdBvQ.js +0 -464
  647. package/dist/Avatar-Zp1T9qAL.js +0 -54
  648. package/dist/BusinessFinancingDropin-vugW4Vvi.js +0 -1857
  649. package/dist/BusinessFinancingPage-0J_LImeN.js +0 -89
  650. package/dist/BusinessRegistrationNumberField-qdC_srMn.js +0 -101
  651. package/dist/BusinessRegistrationNumberFieldGroup-BvC9n4ou.js +0 -171
  652. package/dist/BusinessTypeSelectionPage-WCEqP4G2.js +0 -457
  653. package/dist/Button-DfRmINzF.js +0 -108
  654. package/dist/Checkbox-B730k3Yy.js +0 -108
  655. package/dist/ComponentGroup-CsnkYMbT.js +0 -32
  656. package/dist/ConstitutionalDocument-D92EPGmG.js +0 -1224
  657. package/dist/ContactDetails-DDSd6X0z.js +0 -511
  658. package/dist/ContextGuidance-B2ew1lzC.js +0 -29
  659. package/dist/ContractViewer-JtnAXSDa.js +0 -979
  660. package/dist/Currency-BKTf95Wp.js +0 -210
  661. package/dist/CustomerSupport-CCFayyJG.js +0 -140
  662. package/dist/DataConflictsModal-D-fP_eNs.js +0 -237
  663. package/dist/DebugModal-CG6CvUnj.js +0 -450
  664. package/dist/DecisionMakerDetails-DWC1nORL.js +0 -565
  665. package/dist/DecisionMakerDetailsPage-BVXA74FO.js +0 -122
  666. package/dist/DecisionMakers-Cvm_i6Uf.js +0 -589
  667. package/dist/Dropzone-CNHxDEc3.js +0 -250
  668. package/dist/EmbeddedStatus-tbJfdxm8.js +0 -129
  669. package/dist/EndStateLayout-BK1Hh02g.js +0 -83
  670. package/dist/EntityAssociation-i903L9Dh.js +0 -163
  671. package/dist/ErrorPanel-tnFOlOZU.js +0 -205
  672. package/dist/GlobalEntryModal-DQoIIvGS.js +0 -975
  673. package/dist/GlobalEntryPage-DLRGPpAu.js +0 -78
  674. package/dist/Icon-C3S5_kkS.js +0 -175
  675. package/dist/IdentityNumber-B8MXzXsO.js +0 -536
  676. package/dist/IdentityNumberFieldGroup-D7xb2TY7.js +0 -57
  677. package/dist/IdentityScreeningWorkflow-BdGXtdns.js +0 -307
  678. package/dist/Image-D82terx4.js +0 -33
  679. package/dist/IndividualDropin-C0vTSDYU.js +0 -4138
  680. package/dist/IndustryCodeFieldGroup-CGcE5yYR.js +0 -188
  681. package/dist/InputDate-Ci60MBrH.js +0 -211
  682. package/dist/InputText-CTpVF0Mu.js +0 -154
  683. package/dist/Introduction-Dx6DDaL7.js +0 -327
  684. package/dist/InvitedDecisionMakerComponent-Ckd26d6Y.js +0 -481
  685. package/dist/JpAddressFields-C9MbL5XV.js +0 -287
  686. package/dist/LegalCompanyNameField-D0jM5LDT.js +0 -108
  687. package/dist/LegalName-TjhII9_p.js +0 -33
  688. package/dist/LegalRepresentativeDetailsPage-CvGtANu3.js +0 -74
  689. package/dist/Link-c2jAgGgc.js +0 -32
  690. package/dist/ListItem-C35r8558.js +0 -93
  691. package/dist/Loader-BEpMlKm2.js +0 -92
  692. package/dist/Modal-BsivDPTd.js +0 -129
  693. package/dist/Name-DMf8Uyof.js +0 -61
  694. package/dist/NewSummary-DxWLTnJy.js +0 -73
  695. package/dist/PatriotActDisclosure-ChZ_ePr2.js +0 -265
  696. package/dist/PayoutDetailsDropin-BhtJSFAS.js +0 -4073
  697. package/dist/PayoutDetailsPage-MW5Pygp2.js +0 -70
  698. package/dist/RadioGroup-D8DRUJ2o.js +0 -1806
  699. package/dist/Review-DImhCvoG.js +0 -99
  700. package/dist/RootBusinessDetailsPage-Cmh9Z_4g.js +0 -68
  701. package/dist/RootBusinessLinesPage-C_p-CtCH.js +0 -1455
  702. package/dist/RootIndividualDetailsPage-04cJ6C15.js +0 -80
  703. package/dist/Select-ByVcS_J2.js +0 -1093
  704. package/dist/SignPCIComponent-CAwp2xCC.js +0 -370
  705. package/dist/SingpassSelection-Txx3gp_g.js +0 -157
  706. package/dist/SoleProprietorshipPage-CWegllTo.js +0 -70
  707. package/dist/SourceOfFundsPage-B22iW1ow.js +0 -2781
  708. package/dist/SourceOfFundsWorkflow-BKHZbLR_.js +0 -28
  709. package/dist/StateField-CsO_28Co.js +0 -296
  710. package/dist/Step-BUMarnLL.js +0 -191
  711. package/dist/Task-Bj_CjiHG.js +0 -129
  712. package/dist/TaskGroup-BMXhoq1Y.js +0 -46
  713. package/dist/TaskListItem-BIKdDEzU.js +0 -123
  714. package/dist/TaskStepperContextProvider-D0tKJplv.js +0 -26
  715. package/dist/TaskVerificationStatus-DPA4ZEPa.js +0 -125
  716. package/dist/TaxInformationFieldGroup-D_6IRGj9.js +0 -287
  717. package/dist/TaxReportingDropin-DA475crP.js +0 -475
  718. package/dist/TaxReportingWorkflow-kcto0Ysw.js +0 -28
  719. package/dist/TermsOfServiceManagement-HDnaIeWZ.js +0 -635
  720. package/dist/TextArea-qbFhi8Az.js +0 -81
  721. package/dist/TrustDetailsPage-BqVS0xOU.js +0 -1155
  722. package/dist/TrustMemberCompanyPage-DTe7xWpj.js +0 -109
  723. package/dist/TrustMemberIndividualPage-C1BDs9Rm.js +0 -110
  724. package/dist/TrustMemberRoleAndTypePage-GXWuitmt.js +0 -927
  725. package/dist/TrustMembersOverview-BjJ5fPcC.js +0 -449
  726. package/dist/UboTaskItem-Aq3iNKX0.js +0 -115
  727. package/dist/UnincorporatedPartnershipIndividualPage-DdPh2_sa.js +0 -79
  728. package/dist/UnincorporatedPartnershipMemberCompanyPage-h3OTr_91.js +0 -79
  729. package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-CwemN4fL.js +0 -254
  730. package/dist/UnincorporatedPartnershipMembersOverview-CUczPfUl.js +0 -158
  731. package/dist/VerificationErrorAlert-BBfoLMwb.js +0 -64
  732. package/dist/Workflow-Do7P-qDn.js +0 -228
  733. package/dist/accountHolderUtils-DMi_DHCU.js +0 -44
  734. package/dist/arrow-right-Bk-ewsex.js +0 -20
  735. package/dist/bafinUtils-M2AASP_e.js +0 -1963
  736. package/dist/bag-9BNq_QQO.js +0 -20
  737. package/dist/bank-BRbxxVK5.js +0 -20
  738. package/dist/bg-BG-BtgA44Ui.js +0 -7
  739. package/dist/bg-BG-DX5QKxJz.js +0 -7
  740. package/dist/bg-BG-DYkxVgeJ.js +0 -7
  741. package/dist/bg-BG-K6LIkCdf.js +0 -7
  742. package/dist/bg-BG-uuNDTOoN.js +0 -7
  743. package/dist/bin-DE1613_5.js +0 -30
  744. package/dist/businessRegistrationNumberPatterns-C_MSKHlF.js +0 -981
  745. package/dist/capital-aNk7ragc.js +0 -23
  746. package/dist/cash-stack-DuKKc4Qj.js +0 -33
  747. package/dist/certificate-9gDKvXCm.js +0 -23
  748. package/dist/checkmark-BuqDN4WO.js +0 -20
  749. package/dist/checkmark-circle-OqcwA6N6.js +0 -28
  750. package/dist/checkmark-circle-fill-BfcUovCf.js +0 -30
  751. package/dist/checkmark-small-CBORXg_J.js +0 -20
  752. package/dist/chevron-down-CjRta08O.js +0 -20
  753. package/dist/chevron-left-BEm04mIh.js +0 -20
  754. package/dist/chevron-right-B2GkHG0J.js +0 -20
  755. package/dist/chevron-up-BKfe5Btb.js +0 -20
  756. package/dist/circle-C-uuRI8F.js +0 -30
  757. package/dist/circle-small-filled-Bkh5_ZEu.js +0 -20
  758. package/dist/clock-BWfWiMxz.js +0 -28
  759. package/dist/coins-Cw-jDTUz.js +0 -30
  760. package/dist/constants-BSBlqXY7.js +0 -231
  761. package/dist/contract-PFVBW8xa.js +0 -20
  762. package/dist/countries-BE4iGVAo.js +0 -41
  763. package/dist/country-zZC2TAQB.js +0 -25
  764. package/dist/cross-B37j1-r4.js +0 -20
  765. package/dist/cross-circle-fill-CcjwpLj2.js +0 -30
  766. package/dist/cross-circle-fill-small-CJ4fddNo.js +0 -20
  767. package/dist/cs-CZ-BJSrh3Vp.js +0 -7
  768. package/dist/cs-CZ-CMXGY6Ep.js +0 -7
  769. package/dist/cs-CZ-Ci8c58xJ.js +0 -7
  770. package/dist/cs-CZ-Cu1v5FA8.js +0 -7
  771. package/dist/cs-CZ-lJQmuyHq.js +0 -7
  772. package/dist/da-DK-B9O3xbY6.js +0 -7
  773. package/dist/da-DK-BNwXg4DX.js +0 -7
  774. package/dist/da-DK-C1kmOHvo.js +0 -7
  775. package/dist/da-DK-D53M_d04.js +0 -7
  776. package/dist/da-DK-DjAV5d9A.js +0 -7
  777. package/dist/de-DE-B3sSNcDv.js +0 -7
  778. package/dist/de-DE-C9N6F5oM.js +0 -7
  779. package/dist/de-DE-CjMOQMqQ.js +0 -7
  780. package/dist/de-DE-qJPTCQlG.js +0 -7
  781. package/dist/de-DE-qSBQE-6M.js +0 -7
  782. package/dist/de-DE-w4l6boYT.js +0 -7
  783. package/dist/decision-makers-group-DAoxQRJ3.js +0 -4169
  784. package/dist/decisionMakerRoles-APTR-Ah_.js +0 -185
  785. package/dist/document-1-B3vw8uuK.js +0 -20
  786. package/dist/document-person-CERdIfH0.js +0 -28
  787. package/dist/download-CthdK4dV.js +0 -23
  788. package/dist/edit-1-BW7NwWP7.js +0 -20
  789. package/dist/el-GR-BLNCX9mm.js +0 -7
  790. package/dist/el-GR-Bx996PXx.js +0 -7
  791. package/dist/el-GR-CgoxpC-Q.js +0 -7
  792. package/dist/el-GR-DaAMIpOR.js +0 -7
  793. package/dist/el-GR-DqTetsjB.js +0 -7
  794. package/dist/el-GR-pGsVWsOm.js +0 -7
  795. package/dist/en-US-B82BbZaB.js +0 -7
  796. package/dist/en-US-BUmtG-Wj.js +0 -27
  797. package/dist/en-US-C3i5Oge2.js +0 -7
  798. package/dist/en-US-C8karqc5.js +0 -7
  799. package/dist/en-US-CJPD8qHc.js +0 -7
  800. package/dist/en-US-D0fscfsz.js +0 -7
  801. package/dist/en-US-DapC--Cs.js +0 -7
  802. package/dist/entityAssociationUtil-CLBR9osP.js +0 -59
  803. package/dist/error-CpJV-CLa.js +0 -36
  804. package/dist/es-ES-C14ZT-97.js +0 -7
  805. package/dist/es-ES-DeT4zIDW.js +0 -7
  806. package/dist/es-ES-DyB2KXfT.js +0 -7
  807. package/dist/es-ES-U4-lDfZq.js +0 -7
  808. package/dist/es-ES-tVQDUTJN.js +0 -7
  809. package/dist/es-ES-wvcyuTNN.js +0 -7
  810. package/dist/es-LA-B5IRDCf_.js +0 -7
  811. package/dist/es-LA-B_hzWiiE.js +0 -7
  812. package/dist/es-LA-CG_cu1hM.js +0 -7
  813. package/dist/es-LA-ChLRkx-r.js +0 -7
  814. package/dist/es-LA-mFT_9PL_.js +0 -7
  815. package/dist/et-EE-4_ZUNt3W.js +0 -7
  816. package/dist/et-EE-BCWBT8XN.js +0 -7
  817. package/dist/et-EE-BQEyJFZb.js +0 -7
  818. package/dist/et-EE-DSK7kb3n.js +0 -7
  819. package/dist/et-EE-DWVzz1wR.js +0 -7
  820. package/dist/external-link-CFgynH5A.js +0 -20
  821. package/dist/fi-FI-B-7uBAf5.js +0 -7
  822. package/dist/fi-FI-BeJtSWIh.js +0 -7
  823. package/dist/fi-FI-Caa9ydMd.js +0 -7
  824. package/dist/fi-FI-D06EzKrW.js +0 -7
  825. package/dist/fi-FI-DgMsQBRO.js +0 -7
  826. package/dist/form-rules-zzbZ2bV6.js +0 -1089
  827. package/dist/formatCurrency-Cq3WFpdZ.js +0 -23
  828. package/dist/formatValidationError-BHvKLMYZ.js +0 -23
  829. package/dist/fr-FR-8a-RK9xd.js +0 -7
  830. package/dist/fr-FR-BCfqr4jm.js +0 -7
  831. package/dist/fr-FR-BTJoQq71.js +0 -7
  832. package/dist/fr-FR-CDv300-8.js +0 -7
  833. package/dist/fr-FR-D7DTFYe4.js +0 -7
  834. package/dist/fr-FR-Dl4NL-Nc.js +0 -7
  835. package/dist/genUtils-Ce61IJs8.js +0 -60
  836. package/dist/getDefaultRegistrationNumberType-CI1NVzJR.js +0 -1055
  837. package/dist/getFormSlice-DzRO0UUx.js +0 -52
  838. package/dist/getLegalEntityCountry-CNE5uei8.js +0 -17
  839. package/dist/getName-s7qmFean.js +0 -35
  840. package/dist/getProblemsForEntity-Bh9nSdOW.js +0 -16
  841. package/dist/getTrustedDecisionMakers-DX3nImM5.js +0 -25
  842. package/dist/gift-0jLCte2h.js +0 -20
  843. package/dist/graph-DrxuzQF7.js +0 -32
  844. package/dist/graph-up-4qLbS2Ds.js +0 -38
  845. package/dist/headquarter-3o2GHW5H.js +0 -42
  846. package/dist/hotel-pZlrEAK8.js +0 -33
  847. package/dist/hr-HR-B11sggmG.js +0 -7
  848. package/dist/hr-HR-BjxPRJ1o.js +0 -7
  849. package/dist/hr-HR-COdiWKoq.js +0 -7
  850. package/dist/hr-HR-CXH5M5JZ.js +0 -7
  851. package/dist/hr-HR-me1zsMas.js +0 -7
  852. package/dist/http-DsJtugN1.js +0 -204
  853. package/dist/hu-HU-BNlsrO-l.js +0 -7
  854. package/dist/hu-HU-BQ5310Yi.js +0 -7
  855. package/dist/hu-HU-D1ZZwcl0.js +0 -7
  856. package/dist/hu-HU-DkSsL94T.js +0 -7
  857. package/dist/hu-HU-Dp6xOBN_.js +0 -7
  858. package/dist/image-tfgNnE3G.js +0 -23
  859. package/dist/info-DJW5JooY.js +0 -32
  860. package/dist/info-filled-C5mP6T4Z.js +0 -32
  861. package/dist/it-IT-BORQC-7u.js +0 -7
  862. package/dist/it-IT-BlaVymCj.js +0 -7
  863. package/dist/it-IT-CawjvBDX.js +0 -7
  864. package/dist/it-IT-Cnk7j_gC.js +0 -7
  865. package/dist/it-IT-DIIRAF4_.js +0 -7
  866. package/dist/it-IT-x4LV31GV.js +0 -7
  867. package/dist/ja-JP-CyXnoIu3.js +0 -7
  868. package/dist/ja-JP-DBne3dbI.js +0 -7
  869. package/dist/ja-JP-DS8zN3mY.js +0 -7
  870. package/dist/ja-JP-Dpe9Odla.js +0 -7
  871. package/dist/ja-JP-DrHQO_Se.js +0 -7
  872. package/dist/ja-JP-h3E8hgLv.js +0 -7
  873. package/dist/legal-entity-type-0MfCGzUf.js +0 -13
  874. package/dist/legalArrangementUtils-xvCxpgzJ.js +0 -113
  875. package/dist/location-Dk0rAiaT.js +0 -23
  876. package/dist/lt-LT-8kOI6QVq.js +0 -7
  877. package/dist/lt-LT-B18sQY9g.js +0 -7
  878. package/dist/lt-LT-Byl8QeWO.js +0 -7
  879. package/dist/lt-LT-D3ZUJfjr.js +0 -7
  880. package/dist/lt-LT-Fc1lOUlz.js +0 -7
  881. package/dist/lv-LV-C70c94CI.js +0 -7
  882. package/dist/lv-LV-CXifQKfG.js +0 -7
  883. package/dist/lv-LV-DctYQmfH.js +0 -7
  884. package/dist/lv-LV-Mj_iV56f.js +0 -7
  885. package/dist/lv-LV-adiXoKhv.js +0 -7
  886. package/dist/mail-DG7MBDNE.js +0 -20
  887. package/dist/mapAddressLocalizationToJpAddressSchema-TUaHGQh6.js +0 -26
  888. package/dist/mapExistingFile-CwGW1ru4.js +0 -55
  889. package/dist/mapJpAddressSchemaToAddressLocalizations-CdP6PRAO.js +0 -73
  890. package/dist/mapLegalEntityToIndividualSchema-ByhXwZqs.js +0 -214
  891. package/dist/mapTransferInstrumentToPayoutAccount-6eLKhumO.js +0 -44
  892. package/dist/minus-circle-filled-DglqAgJW.js +0 -30
  893. package/dist/nl-NL-BIpptPn4.js +0 -7
  894. package/dist/nl-NL-BWGCqpWp.js +0 -7
  895. package/dist/nl-NL-Bv8Zk-6e.js +0 -7
  896. package/dist/nl-NL-DOB0b0m4.js +0 -7
  897. package/dist/nl-NL-ehxkZFQd.js +0 -7
  898. package/dist/nl-NL-jt4eYGEY.js +0 -7
  899. package/dist/no-NO-BG1sYkpp.js +0 -7
  900. package/dist/no-NO-CeZQnyyD.js +0 -7
  901. package/dist/no-NO-Chwg5Roi.js +0 -7
  902. package/dist/no-NO-Dx_Z3uoZ.js +0 -7
  903. package/dist/no-NO-P5tRWhV9.js +0 -7
  904. package/dist/options-horizontal-CTUn7IEx.js +0 -30
  905. package/dist/partner-1StoI4_W.js +0 -30
  906. package/dist/pay-by-link-plane-Sa_qkL8C.js +0 -33
  907. package/dist/payout-BAYSxSqU.js +0 -38
  908. package/dist/pdf-uNYg4Mqz.js +0 -22315
  909. package/dist/pdf.worker.min-gK7UJW5a.js +0 -74644
  910. package/dist/person-Da15_s3G.js +0 -23
  911. package/dist/pl-PL-BsXtscoI.js +0 -7
  912. package/dist/pl-PL-CWFdZf24.js +0 -7
  913. package/dist/pl-PL-DSbuyzBx.js +0 -7
  914. package/dist/pl-PL-J9S3_lCf.js +0 -7
  915. package/dist/pl-PL-_KG-ZD1N.js +0 -7
  916. package/dist/plus-BQccvKkd.js +0 -20
  917. package/dist/plus-circle-filled-CqC30FRL.js +0 -30
  918. package/dist/processCapabilities-DRD0Aq2i.js +0 -874
  919. package/dist/processValidationErrors-oxuCOsth.js +0 -62
  920. package/dist/pt-BR-B2q9Nl16.js +0 -7
  921. package/dist/pt-BR-BYbyk6xS.js +0 -7
  922. package/dist/pt-BR-Cph-P8oH.js +0 -7
  923. package/dist/pt-BR-D1yTuXWd2.js +0 -7
  924. package/dist/pt-BR-fKlNUybd.js +0 -7
  925. package/dist/pt-PT-C1gtp2_N.js +0 -7
  926. package/dist/pt-PT-CQQkh5PS.js +0 -7
  927. package/dist/pt-PT-D8ldyR-j.js +0 -7
  928. package/dist/pt-PT-DAvsI-Tr.js +0 -7
  929. package/dist/pt-PT-DhokEMPi.js +0 -7
  930. package/dist/pt-PT-IPhkbQvT.js +0 -7
  931. package/dist/recurring-DSR1fNMh.js +0 -23
  932. package/dist/resolveEnvironment-BYEL10Nc.js +0 -2524
  933. package/dist/revenue-accelerate-CPhAVpPK.js +0 -30
  934. package/dist/ro-RO-C6xoaASq.js +0 -7
  935. package/dist/ro-RO-CP_IrOlX.js +0 -7
  936. package/dist/ro-RO-CQJk7Cpo.js +0 -7
  937. package/dist/ro-RO-CnMe6Mfw.js +0 -7
  938. package/dist/ro-RO-_BLhsnIB.js +0 -7
  939. package/dist/save-DQ-mJX8e.js +0 -20
  940. package/dist/search-DWqWTW_K.js +0 -30
  941. package/dist/show-BbhlD3IY.js +0 -23
  942. package/dist/sk-SK-BOc9IqyW.js +0 -7
  943. package/dist/sk-SK-Bb1CdAzD.js +0 -7
  944. package/dist/sk-SK-Br1Y4_CN.js +0 -7
  945. package/dist/sk-SK-Bx2_85dW.js +0 -7
  946. package/dist/sk-SK-C889qQFo.js +0 -7
  947. package/dist/sl-SI-B-Xa0hlk.js +0 -7
  948. package/dist/sl-SI-BQc61Sz2.js +0 -7
  949. package/dist/sl-SI-DHPadSTy.js +0 -7
  950. package/dist/sl-SI-DO9c7geI.js +0 -7
  951. package/dist/sl-SI-bkhhInrg.js +0 -7
  952. package/dist/solution-payments-D4BORMsX.js +0 -20
  953. package/dist/store-DWaq3ZiC.js +0 -20
  954. package/dist/sv-SE-BXrlr0X5.js +0 -7
  955. package/dist/sv-SE-Dk81lopg.js +0 -7
  956. package/dist/sv-SE-DzsWB30f.js +0 -7
  957. package/dist/sv-SE-IBYnJfbW.js +0 -7
  958. package/dist/sv-SE-X89Q6ZAq.js +0 -7
  959. package/dist/sv-SE-l_UVgmVu.js +0 -7
  960. package/dist/terminal-1-crR-pS_R.js +0 -30
  961. package/dist/translation-BOm4lmPx.js +0 -657
  962. package/dist/types/components/GlobalEntry/globalEntryKeyMapping.d.ts +0 -15
  963. package/dist/types/components/GlobalEntry/utils.d.ts +0 -30
  964. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/getDefaultTaxIdNumberType.d.ts +0 -30
  965. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/inferTaxIdNumberType.d.ts +0 -13
  966. package/dist/types/core/models/api/attachment.d.ts +0 -7
  967. package/dist/types/core/models/api/document.d.ts +0 -25
  968. package/dist/types/core/models/api/entity-type.d.ts +0 -5
  969. package/dist/types/core/models/api/legal-arrangement.d.ts +0 -24
  970. package/dist/types/core/models/api/legal-entity-type.d.ts +0 -8
  971. package/dist/types/core/models/api/legal-entity.d.ts +0 -36
  972. package/dist/types/core/models/api/problem.d.ts +0 -12
  973. package/dist/types/core/models/api/remediating-action.d.ts +0 -5
  974. package/dist/types/core/models/api/transfer-instrument.d.ts +0 -33
  975. package/dist/types/core/models/api/trusted-fields-provider.d.ts +0 -5
  976. package/dist/types/core/models/api/verification-error.d.ts +0 -19
  977. package/dist/types-BeveNAZK.js +0 -19
  978. package/dist/types-wRlt8bxb.js +0 -58
  979. package/dist/upload-D85xAAAm.js +0 -23
  980. package/dist/useAdaptiveWorkflow-DsQESk9f.js +0 -28
  981. package/dist/useBusinessDetailsData-Bja80UYy.js +0 -4722
  982. package/dist/useBusinessLines-BhSN6qCH.js +0 -27
  983. package/dist/useCanSeeIntroduction-BcfQC4IP.js +0 -38
  984. package/dist/useDataMissingRemediations-msU1AJvo.js +0 -39
  985. package/dist/useForm-DbDFfb2S.js +0 -502
  986. package/dist/useHideTaskStepper-CbMcV9mk.js +0 -26
  987. package/dist/useId-oOIS1nsj.js +0 -73
  988. package/dist/useIndustryCodes-uAj90IyS.js +0 -32
  989. package/dist/useLegalEntity-QQXN6YOm.js +0 -48
  990. package/dist/useNavigate-CiKOI5QV.js +0 -246
  991. package/dist/useOnboardingStatus-CsGUjkm-.js +0 -23
  992. package/dist/usePciQuestionnaireList-CFNJD8pS.js +0 -26
  993. package/dist/useSalesChannels-BvGJ9PT6.js +0 -47
  994. package/dist/useScenarios-CGcmXgJv.js +0 -55
  995. package/dist/useTaskLandedEvent-pmN03gtI.js +0 -26
  996. package/dist/useTaskStatus-CgrhdaE_.js +0 -23
  997. package/dist/useTermsOfServiceStatus-DbJDklA2.js +0 -39
  998. package/dist/useTrustMembers-f13Kf1Zk.js +0 -152
  999. package/dist/useUnincorporatedPartnershipMembers-K5jkCKfJ.js +0 -70
  1000. package/dist/useUpdateBusinessLines-DCKYTzxd.js +0 -43
  1001. package/dist/utils-2tir5QtF.js +0 -52
  1002. package/dist/utils-BUOt0VrX.js +0 -179
  1003. package/dist/utils-DBIDcVUN.js +0 -214
  1004. package/dist/validate-BpZBKknS.js +0 -224
  1005. package/dist/validate-CPTQceEQ.js +0 -151
  1006. package/dist/validate-YBDlgvjy.js +0 -429
  1007. package/dist/validate-u6nDNwf1.js +0 -126
  1008. package/dist/validateExtractionResult-dH4TewHf.js +0 -343
  1009. package/dist/validationError-B-B3GC86.js +0 -55
  1010. package/dist/warning-circle-fill-BDTmKU1s.js +0 -30
  1011. package/dist/warning-diamond-filled-BjDL-xa8.js +0 -30
  1012. package/dist/webinar-YMbPoCx3.js +0 -33
@@ -1,4138 +0,0 @@
1
- try {
2
- let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "44051823-df21-483e-959a-5b3524ff3035", e._sentryDebugIdIdentifier = "sentry-dbid-44051823-df21-483e-959a-5b3524ff3035");
4
- } catch (e) {}
5
- import { r as useTranslation, t as Trans } from "./translation-BOm4lmPx.js";
6
- import { B as INDIVIDUAL_VALID_CHAR_REGEX, C as useDataset, D as useCapabilities, E as useAllowedCountries, G as SPECIAL_CHARS, Q as hasMaximumTwoRepeatedCharacters, T as datasetUtilities, U as NO_ALPHABET_UNICODE_REGEX, Y as getFormattingRegEx, c as isLegalRepresentativeNeeded, ct as standardKanjiValidator, et as hasText, ft as useSettingsContext, it as isInvalidName, j as useToggleContext, k as Header, lt as standardKatakanaValidator, nt as isEmpty, o as getAgeRangeForLegalRepresentative, pt as useAccountHolder, s as getAgeToday, st as matchesRegex, w as datasetIdentifier, x as Alert, z as EMOJI_REGEX } from "./resolveEnvironment-BYEL10Nc.js";
7
- import { t as createLogger } from "./logger-Z8AeTE4x.js";
8
- import { t as Typography } from "./Typography-CAc_f5Iq.js";
9
- import { t as Loader } from "./Loader-BEpMlKm2.js";
10
- import { t as Button } from "./Button-DfRmINzF.js";
11
- import { n as httpGet, r as httpPost, s as useApiContext } from "./http-DsJtugN1.js";
12
- import { t as LegalEntityTypes } from "./legal-entity-type-0MfCGzUf.js";
13
- import { t as getLegalEntityCountry } from "./getLegalEntityCountry-CNE5uei8.js";
14
- import { a as objectsDeepEqual, n as doArraysMatch, r as drop, t as cloneObject } from "./genUtils-Ce61IJs8.js";
15
- import { r as euCountries, t as CountryCodes } from "./country-code-CJk2hdPu.js";
16
- import { l as individualDocumentMapping, s as individualApiKeyMapping, u as individualObscuredFields } from "./processCapabilities-DRD0Aq2i.js";
17
- import { t as TaskTypes } from "./taskTypes-3vSkMBDm.js";
18
- import { n as attachNomineeToRole, r as filterOutUnwantedAssociationsIfRootLE, s as getOwnEntityAssociations, t as allowedCountriesForNominee, u as hasNomineesChanged } from "./entityAssociationUtil-CLBR9osP.js";
19
- import { t as DecisionMakerTypes } from "./decision-maker-type-NR4GFAeT.js";
20
- import { t as Scenarios } from "./get-scenarios-Bb-paHmJ.js";
21
- import { s as getAvailableDecisionMakerRoleTypes, t as getAllowedDecisionMakerRoles } from "./decisionMakerRoles-APTR-Ah_.js";
22
- import { i as isLowRiskCountry } from "./country-zZC2TAQB.js";
23
- import { i as useAnalyticsContext, t as Modal } from "./Modal-BsivDPTd.js";
24
- import { a as SettingNames, t as InputText } from "./InputText-CTpVF0Mu.js";
25
- import { _ as getPropsFromConfigurations, d as InputEmail, g as composePerScenarioFormConfigurations, m as resolveFieldMetadata, p as convertFullToHalf, t as createFormRules, u as MaskedInput, v as LandingLayout, y as TrustedFieldsProviders } from "./form-rules-zzbZ2bV6.js";
26
- import { r as useToastContext } from "./useId-oOIS1nsj.js";
27
- import { f as translateTranslatable, p as LoaderWrapper, r as Field, t as Select } from "./Select-ByVcS_J2.js";
28
- import { r as formatObject, s as Confirm } from "./utils-DBIDcVUN.js";
29
- import { d as COUNTRIES_WITH_STATES_DATASET, f as addressFields, i as getAddressSchemaForCountry, m as useCreateLegalEntity, p as useUpdateLegalEntity, s as mapAddressLabels } from "./StateField-CsO_28Co.js";
30
- import { A as mergeFieldMetadataIntoProps, C as preTranslatedSummaryItem, M as FormContextProvider, d as useFormContext, f as addValidityToForms, g as useMultiForm, k as createFormUtils, m as FormFlow, p as getRequiredForms, t as RadioGroup, u as CountryField, v as isTruthyValidator, y as useFormComposer } from "./RadioGroup-D8DRUJ2o.js";
31
- import { t as Image } from "./Image-D82terx4.js";
32
- import { n as useFormRouterContext, t as ErrorPanel } from "./ErrorPanel-tnFOlOZU.js";
33
- import { B as taxInformationDefaultFieldConfig, H as toFullWidth, I as mapSchemaFieldsToApiScriptLocalization, P as isEmpty$1, U as isJapanLocalizationEnabled, V as taxInformationDefaultFieldMetadata, _ as taxIdNumberOptions, a as idNowPostSubmit, i as idNowModalChildEntityId, n as isBafinSignatoryFlow, o as shouldShowIdNowModal, s as showIdNowModal, u as TaxInformationField } from "./bafinUtils-M2AASP_e.js";
34
- import { t as getIndividualLegalEntityName } from "./getName-s7qmFean.js";
35
- import { t as useScenarios } from "./useScenarios-CGcmXgJv.js";
36
- import { a as individualFormDefaultData, i as GuidanceQuestionValues, n as getOnfidoIdentityTypeToApiIdentityTypeMap, o as shouldNavigateToAdditionalPersonalDetailsForMissingData, r as GuidanceQuestion, s as useCreateInvitation, t as mapLegalEntityToIndividualSchema } from "./mapLegalEntityToIndividualSchema-ByhXwZqs.js";
37
- import { n as ALL_ADDRESS_FIELDS, s as useProviderStatus, t as AddressFields } from "./AddressFields-BsxEdBvQ.js";
38
- import { a as contactDetailsValidationRules, c as getAsyncPhoneValidationRules, i as phonePrefixes_default, l as getPhonePlaceholder, n as contactDetailFields, o as defaultFieldMetadata, r as PhoneField, s as fieldConfig, t as ContactDetails, u as useValidatePhoneNumberImperatively } from "./ContactDetails-DDSd6X0z.js";
39
- import { i as useScenarioConfiguration, n as getPage, r as getPageName, t as mapExistingFile } from "./mapExistingFile-CwGW1ru4.js";
40
- import { t as useTaskLandedEvent } from "./useTaskLandedEvent-pmN03gtI.js";
41
- import { i as JP_ADDRESS_REQUIRED_FIELDS, n as mapJpAddressSummary, t as mapJpAddressSchemaToAddressLocalizations } from "./mapJpAddressSchemaToAddressLocalizations-CdP6PRAO.js";
42
- import { n as isMaintenanceModeError, t as processValidationErrors } from "./processValidationErrors-oxuCOsth.js";
43
- import { a as createDocumentRequest, d as mergeAttachments, l as getFileExtention, o as documentApiUtils, p as getLocalizedIdDocumentTypeOptions, s as getDocument, u as getIdDocument } from "./validate-YBDlgvjy.js";
44
- import { i as getFieldsWithExistingData, n as MemoizedDocumentUpload, r as DocumentGuidance, t as PatriotActDisclosure } from "./PatriotActDisclosure-ChZ_ePr2.js";
45
- import { t as localizeDateString } from "./localizeDateString-Dxlqr4rL.js";
46
- import { n as omitObscuredFieldsIfUnchanged, t as AdyenKycSdkError } from "./error-CpJV-CLa.js";
47
- import { a as isValidationError } from "./validationError-B-B3GC86.js";
48
- import { a as getAsyncIdNumberValidationRule, i as defaultFieldMetadata$1, n as idNumberFields, o as licenseCardNumberDefaultConfig, r as defaultFieldConfig, s as licenseCardNumberDefaultMetadata, t as IdentityNumber } from "./IdentityNumber-B8MXzXsO.js";
49
- import { n as formatDateObj, t as InputDate } from "./InputDate-Ci60MBrH.js";
50
- import { t as addressValidators } from "./validate-BpZBKknS.js";
51
- import { n as emailPattern } from "./basePatterns-plHFNzgJ.js";
52
- import { t as TextArea } from "./TextArea-qbFhi8Az.js";
53
- import { t as Dropzone } from "./Dropzone-CNHxDEc3.js";
54
- import { n as getFieldProps, r as getFormProps } from "./getProps-DVqK7eRw.js";
55
- import { t as Link } from "./Link-c2jAgGgc.js";
56
- import { t as ContextGuidance } from "./ContextGuidance-B2ew1lzC.js";
57
- import { n as nameFields, t as Name } from "./Name-DMf8Uyof.js";
58
- import { t as formatValidationError } from "./formatValidationError-BHvKLMYZ.js";
59
- import { a as fromIndividualConflictSchema, c as createAddressConflictRule, d as useExtractDocumentInformation, i as mapExtractionResultToSchema, l as useDataConflicts, n as UploadedDocument, o as toIndividualConflictSchema, r as useIdVerificationToken, s as IdVerificationMethod_module_default, t as validateExtractionResult, u as addressToString } from "./validateExtractionResult-dH4TewHf.js";
60
- import { t as DataConflictsModal } from "./DataConflictsModal-D-fP_eNs.js";
61
- import { Suspense, lazy, memo } from "preact/compat";
62
- import { useCallback as useCallback$1, useEffect as useEffect$1, useMemo as useMemo$1, useRef as useRef$1, useState as useState$1 } from "preact/hooks";
63
- import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime";
64
- import { signal } from "@preact/signals";
65
- import { skipToken, useMutation, useQuery, useQueryClient } from "@tanstack/preact-query";
66
- import { Show } from "@preact/signals/utils";
67
- import { Onfido } from "onfido-sdk-ui";
68
- import parsePhoneNumber from "libphonenumber-js/mobile";
69
- //#region src/api/entityVerifications/useVerifyIdNumber.ts
70
- var verifyIdNumber = async (legalEntityId, baseUrl, data) => {
71
- return await httpPost({
72
- baseUrl,
73
- path: `legalEntities/${legalEntityId}/verifications/idNumber`,
74
- errorHandler: async (response) => {
75
- const responseData = await response;
76
- if (responseData.status === 422) return {
77
- status: 422,
78
- message: responseData.detail,
79
- errorCode: responseData.errorCode
80
- };
81
- if (responseData.status === 500) return {
82
- status: 500,
83
- message: "Service did not respond, do not block verification"
84
- };
85
- }
86
- }, data);
87
- };
88
- var useVerifyIdNumber = (options) => {
89
- const { rootLegalEntityId, baseUrl } = useApiContext();
90
- return useMutation({
91
- mutationFn: (data) => verifyIdNumber(rootLegalEntityId.value, baseUrl.value, data),
92
- ...options
93
- });
94
- };
95
- //#endregion
96
- //#region src/api/idVerificationProviders/idVerificationStartCheck.ts
97
- var startVerificationCheck = async (rootLegalEntityId, baseUrl, data) => {
98
- return httpPost({
99
- baseUrl,
100
- path: `legalEntities/${rootLegalEntityId}/providers/idVerification/process`
101
- }, data);
102
- };
103
- var useIdVerificationStartCheck = (options) => {
104
- const { rootLegalEntityId, baseUrl } = useApiContext();
105
- return useMutation({
106
- mutationFn: (data) => startVerificationCheck(rootLegalEntityId.value, baseUrl.value, data),
107
- ...options
108
- });
109
- };
110
- //#endregion
111
- //#region src/utils/customerSupportUtils.ts
112
- var customerSupportPresubmitProcess = (legalEntityResponse, legalEntityToSubmit) => {
113
- if (legalEntityResponse.type === "individual") return processCustomerSupportForIndividual(legalEntityResponse, legalEntityToSubmit);
114
- if (legalEntityResponse.type === "organization") return processCustomerSupportForOrganization(legalEntityResponse, legalEntityToSubmit);
115
- };
116
- var processCustomerSupportForOrganization = (legalEntityResponse, legalEntityToSubmit) => {
117
- if (!legalEntityResponse.organization?.support) return legalEntityToSubmit.organization?.support ?? void 0;
118
- if (legalEntityResponse.organization?.countryOfGoverningLaw !== legalEntityToSubmit.organization?.countryOfGoverningLaw) {
119
- const customerSupport = legalEntityResponse.organization?.support;
120
- switch (legalEntityToSubmit.organization?.countryOfGoverningLaw) {
121
- case CountryCodes.Japan: return unsetCustomerSupportNumber(customerSupport);
122
- default: return customerSupport;
123
- }
124
- }
125
- };
126
- var processCustomerSupportForIndividual = (legalEntityResponse, legalEntityToSubmit) => {
127
- if (!legalEntityResponse.individual?.support) return legalEntityToSubmit.individual?.support ?? void 0;
128
- if (legalEntityResponse.individual?.residentialAddress.country !== legalEntityToSubmit.individual?.residentialAddress.country) {
129
- const customerSupport = legalEntityResponse.individual?.support;
130
- switch (legalEntityToSubmit.individual?.residentialAddress.country) {
131
- case CountryCodes.Japan: return unsetCustomerSupportNumber(customerSupport);
132
- default: return customerSupport;
133
- }
134
- }
135
- };
136
- var unsetCustomerSupportNumber = (customerSupport) => {
137
- return customerSupport ? {
138
- email: customerSupport.email,
139
- phone: {
140
- number: "",
141
- type: "mobile"
142
- }
143
- } : void 0;
144
- };
145
- //#endregion
146
- //#region src/utils/getSSNType.ts
147
- var ERROR_CODES = {
148
- SSN_REMEDIATION: "1_316",
149
- SSN_4_DIGITS_VALIDATION: "1_3062",
150
- PERSONAL_DETAILS_VALIDATION: "1_30"
151
- };
152
- var getSSNType = (formVerifcationErrors, existingIdNumber) => {
153
- return check4DigitSsnFailed(formVerifcationErrors) || existingIdNumber?.length === 9 ? "ssn" : "ssnLastFour";
154
- };
155
- var check4DigitSsnFailed = (formVerifcationErrors) => {
156
- return (formVerifcationErrors?.[ERROR_CODES.PERSONAL_DETAILS_VALIDATION])?.[ERROR_CODES.SSN_4_DIGITS_VALIDATION]?.some((error) => error.code === ERROR_CODES.SSN_REMEDIATION);
157
- };
158
- //#endregion
159
- //#region src/components/Shared/fields/Name/validate.ts
160
- var nameValidationRulesV4 = () => {
161
- return {
162
- firstName: [{
163
- modes: ["blur"],
164
- validate: (input) => !matchesRegex(NO_ALPHABET_UNICODE_REGEX, input),
165
- errorMessage: "nameMustContainLetters"
166
- }, {
167
- modes: ["blur"],
168
- validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasMaximumTwoRepeatedCharacters(input) && !isInvalidName(input) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, input),
169
- errorMessage: "checkForTypos"
170
- }],
171
- lastName: [{
172
- modes: ["blur"],
173
- validate: (input) => !matchesRegex(NO_ALPHABET_UNICODE_REGEX, input),
174
- errorMessage: "nameMustContainLetters"
175
- }, {
176
- modes: ["blur"],
177
- validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasMaximumTwoRepeatedCharacters(input) && !isInvalidName(input) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, input),
178
- errorMessage: "checkForTypos"
179
- }]
180
- };
181
- };
182
- getFormattingRegEx(SPECIAL_CHARS.replace("-", ""));
183
- //#endregion
184
- //#region src/components/Individual/forms/AdditionalPersonalDetails/validate.ts
185
- var isNotOutOfRangeBirthDateValidatorRule = {
186
- modes: ["blur"],
187
- validate: (birthDate) => !isEmpty(birthDate) && new Date(birthDate) < /* @__PURE__ */ new Date(),
188
- errorMessage: "invalidDateOfBirth"
189
- };
190
- var buildMinimumAgeValidationRule = (minimumAge) => ({
191
- modes: ["blur"],
192
- validate: (birthDate) => !!birthDate && getAgeToday(birthDate) >= minimumAge,
193
- errorMessage: {
194
- key: "youMustXYearsOldToContinue",
195
- values: { minimumAge: minimumAge.toString() }
196
- }
197
- });
198
- var getCountrySpecificMinimumAgeValidationRule = (country) => {
199
- if (!country) return buildMinimumAgeValidationRule(13);
200
- if ([
201
- ...euCountries,
202
- CountryCodes.UnitedKingdom,
203
- CountryCodes.Switzerland
204
- ].some((c) => c === country)) return buildMinimumAgeValidationRule(16);
205
- switch (country) {
206
- case CountryCodes.HongKong:
207
- case CountryCodes.Singapore: return buildMinimumAgeValidationRule(18);
208
- default: return buildMinimumAgeValidationRule(13);
209
- }
210
- };
211
- var additionalPersonalDetailsValidators = ({ country, isFeatureEnabled = () => false, isSettingEnabled = () => false, taskType, idNumberType, idNumberExempt, idNumber, existingIdNumber, formVerificationErrors, t, taxIdNumberType }) => ({
212
- taxInformation: resolveFieldMetadata(taxInformationDefaultFieldConfig[country], {
213
- taxIdNumberType,
214
- companyType: LegalEntityTypes.INDIVIDUAL
215
- }, taxInformationDefaultFieldMetadata)?.validators,
216
- birthDate: (() => {
217
- const baseValidators = [isNotOutOfRangeBirthDateValidatorRule];
218
- if (isSettingEnabled("enforceLegalAge")) return [...baseValidators, buildMinimumAgeValidationRule(18)];
219
- if (isFeatureEnabled("EnableAgeVerification")) {
220
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) return [...baseValidators, buildMinimumAgeValidationRule(18)];
221
- return [...baseValidators, getCountrySpecificMinimumAgeValidationRule(country)];
222
- }
223
- return baseValidators;
224
- })(),
225
- ...isFeatureEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4() : void 0,
226
- ...contactDetailsValidationRules,
227
- idNumber: (() => {
228
- const derivedIdNumberType = country === CountryCodes.UnitedStates || country === CountryCodes.PuertoRico ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
229
- return idNumberExempt ? {
230
- validate: () => {
231
- return idNumberExempt || !isEmpty(idNumber);
232
- },
233
- modes: ["blur"]
234
- } : resolveFieldMetadata(defaultFieldConfig[country], { idNumberType: derivedIdNumberType }, defaultFieldMetadata$1)?.validators;
235
- })(),
236
- ...addressValidators({
237
- isFeatureEnabled,
238
- country,
239
- t
240
- })
241
- });
242
- //#endregion
243
- //#region src/components/Shared/fields/LocalizedNameFields/validate.ts
244
- var localizedNameValidationRulesV4 = (isFeatureEnabled = () => false, country) => {
245
- if (isJapanLocalizationEnabled(isFeatureEnabled, country)) return {
246
- jaHaniFirstName: [{
247
- modes: ["blur"],
248
- validate: hasText,
249
- errorMessage: "fieldIsRequired"
250
- }, {
251
- modes: ["blur"],
252
- validate: (input) => standardKanjiValidator(input),
253
- errorMessage: "checkForTypos"
254
- }],
255
- jaHaniLastName: [{
256
- modes: ["blur"],
257
- validate: hasText,
258
- errorMessage: "fieldIsRequired"
259
- }, {
260
- modes: ["blur"],
261
- validate: (input) => standardKanjiValidator(input),
262
- errorMessage: "checkForTypos"
263
- }],
264
- jaKanaFirstName: [{
265
- modes: ["blur"],
266
- validate: hasText,
267
- errorMessage: "fieldIsRequired"
268
- }, {
269
- modes: ["blur"],
270
- validate: (input) => standardKatakanaValidator(input),
271
- errorMessage: "ensureValidFullWidthKatakana"
272
- }],
273
- jaKanaLastName: [{
274
- modes: ["blur"],
275
- validate: hasText,
276
- errorMessage: "fieldIsRequired"
277
- }, {
278
- modes: ["blur"],
279
- validate: (input) => standardKatakanaValidator(input),
280
- errorMessage: "ensureValidFullWidthKatakana"
281
- }]
282
- };
283
- return {};
284
- };
285
- //#endregion
286
- //#region src/components/Individual/forms/BasicDetails/validate.ts
287
- var basicDetailsValidators = ({ isFeatureEnabled = () => false, country }) => ({
288
- ...contactDetailsValidationRules,
289
- ...isFeatureEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4() : void 0,
290
- ...localizedNameValidationRulesV4(isFeatureEnabled, country)
291
- });
292
- //#endregion
293
- //#region src/components/Individual/forms/IdDocumentUpload/types.ts
294
- var onfidoDocumentTypeMapping = [
295
- {
296
- id: "driversLicense",
297
- name: "driversLicense",
298
- hasBackPage: true
299
- },
300
- {
301
- id: "identityCard",
302
- name: "identityCard",
303
- hasBackPage: true
304
- },
305
- {
306
- id: "passport",
307
- name: "passport",
308
- hasBackPage: false
309
- }
310
- ];
311
- //#endregion
312
- //#region src/api/idNowProvider/useIdNowProvider.ts
313
- var getIdNowProviderIdentificationStatus = async (rootLegalEntityId, baseUrl, legalEntityId) => {
314
- return httpGet({
315
- baseUrl,
316
- path: `legalEntities/${rootLegalEntityId}/child/${legalEntityId}/provider/idnow/identification/status`,
317
- errorHandler: async (response) => {
318
- const responseData = await response;
319
- if (responseData.status === 404) return {
320
- status: 404,
321
- message: responseData.detail,
322
- errorCode: responseData.errorCode
323
- };
324
- }
325
- });
326
- };
327
- var useIdNowIdentificationStatus = (legalEntityId, options) => {
328
- const { rootLegalEntityId, baseUrl } = useApiContext();
329
- return useQuery({
330
- queryKey: legalEntityId === skipToken ? [] : ["idNowProviderIdentificationStatus", legalEntityId],
331
- queryFn: legalEntityId === skipToken ? skipToken : () => getIdNowProviderIdentificationStatus(rootLegalEntityId.value, baseUrl.value, legalEntityId),
332
- ...options
333
- });
334
- };
335
- var idNowProviderStartIdentification = async (rootLegalEntityId, baseUrl, legalEntityId) => {
336
- return httpPost({
337
- baseUrl,
338
- path: `legalEntities/${rootLegalEntityId}/child/${legalEntityId}/provider/idnow/identification/start`
339
- });
340
- };
341
- var useIdNowStartIdentification = (legalEntityId, options) => {
342
- const { rootLegalEntityId, baseUrl } = useApiContext();
343
- return useQuery({
344
- queryKey: legalEntityId === skipToken ? [] : ["idNowProviderStartIdentification", legalEntityId],
345
- queryFn: legalEntityId === skipToken ? skipToken : () => idNowProviderStartIdentification(rootLegalEntityId.value, baseUrl.value, legalEntityId),
346
- ...options
347
- });
348
- };
349
- var IdNowVerificationModal_module_default = {
350
- "idnow-header": "_idnow-header_m87oy_1",
351
- idnowHeader: "_idnow-header_m87oy_1",
352
- "idnow-verification-header-iframe-container": "_idnow-verification-header-iframe-container_m87oy_7",
353
- idnowVerificationHeaderIframeContainer: "_idnow-verification-header-iframe-container_m87oy_7",
354
- "idnow-verification-header-iframe": "_idnow-verification-header-iframe_m87oy_7",
355
- idnowVerificationHeaderIframe: "_idnow-verification-header-iframe_m87oy_7",
356
- "idnow-verification-header-image": "_idnow-verification-header-image_m87oy_18",
357
- idnowVerificationHeaderImage: "_idnow-verification-header-image_m87oy_18"
358
- };
359
- //#endregion
360
- //#region src/components/Individual/forms/IdNowVerificationModal/IFrameWidget.ts
361
- var MOUNT_TIMEOUT = 10 * 1e3;
362
- var activeWidget;
363
- var IFrameWidget = class {
364
- iframeUrl;
365
- iframeElement;
366
- mountInProgress = false;
367
- constructor(iframeElement, url, _vendor, _sdkToken) {
368
- try {
369
- this.iframeUrl = new URL(url);
370
- } catch (err) {
371
- throw new AdyenKycSdkError("WIDGET_URL_MALFORMED", err);
372
- }
373
- this.iframeElement = iframeElement;
374
- }
375
- unmount() {
376
- if (this.mountInProgress) throw new AdyenKycSdkError("Cannot unmount widget, mounting is still in progress");
377
- this.iframeElement.remove();
378
- activeWidget = null;
379
- }
380
- async mount() {
381
- if (activeWidget) throw new AdyenKycSdkError(`You can only have one ${this.constructor.name} mounted at a time`);
382
- activeWidget = this;
383
- if (this.mountInProgress) throw new AdyenKycSdkError("Cannot mount widget, mounting is already in progress");
384
- this.mountInProgress = true;
385
- try {
386
- await new Promise((resolve, reject) => {
387
- const timeoutId = setTimeout(() => {
388
- this.mountInProgress = false;
389
- reject(new AdyenKycSdkError("WIDGET_TIMEOUT"));
390
- }, MOUNT_TIMEOUT);
391
- const cancelTimeout = () => {
392
- if (timeoutId) clearTimeout(timeoutId);
393
- };
394
- this.iframeElement.addEventListener("load", () => {
395
- cancelTimeout();
396
- this.mountInProgress = false;
397
- resolve();
398
- });
399
- requestAnimationFrame(() => {
400
- try {
401
- this.iframeElement.setAttribute("src", this.iframeUrl.href);
402
- } catch (ex) {
403
- cancelTimeout();
404
- this.mountInProgress = false;
405
- reject(ex);
406
- }
407
- });
408
- });
409
- } catch (err) {
410
- throw new AdyenKycSdkError("WIDGET_LAUNCH_FAILED", err);
411
- }
412
- }
413
- async mountAndWaitForResponse() {
414
- await this.mount();
415
- }
416
- };
417
- //#endregion
418
- //#region src/components/Individual/forms/IdNowVerificationModal/IdNowVerificationModal.tsx
419
- var passportFrontGreenImage$1 = lazy(() => import("./passport-front-green-BWuD3-Fs.js"));
420
- /**
421
- * Checks if the IDnow identification status is considered successful.
422
- * @param status - The status object from the IDnow provider.
423
- * @returns True if the provider status is 'SUCCESS', 'SUCCESS_DATA_CHANGED', or 'REVIEW_PENDING'.
424
- */
425
- var isIdNowSuccessful = (status) => {
426
- const providerStatus = status?.providerStatus;
427
- return providerStatus === "SUCCESS" || providerStatus === "SUCCESS_DATA_CHANGED" || providerStatus === "REVIEW_PENDING";
428
- };
429
- var IdNowVerificationModal = ({ handleFinish }) => {
430
- const { t } = useTranslation(["individual", "common"]);
431
- const [isConfirmPresented, setIsConfirmPresented] = useState$1(false);
432
- const [genericError, setGenericError] = useState$1(false);
433
- const widgetContainerRef = useRef$1(null);
434
- const iFrameRef = useRef$1(null);
435
- const iFrameWidgetRef = useRef$1(null);
436
- const [page, setPage] = useState$1(1);
437
- const queryClient = useQueryClient();
438
- const { showToast } = useToastContext();
439
- const { data: idNowStatus, isLoading: isStatusLoading, isError: isStatusError, refetch: refetchIdNowIdentificationStatus } = useIdNowIdentificationStatus(idNowModalChildEntityId.value?.id ?? skipToken, {
440
- enabled: !!idNowModalChildEntityId.value?.id,
441
- refetchOnMount: "always",
442
- refetchInterval: (query) => {
443
- if (query.state.status === "error") return false;
444
- return 1e4;
445
- },
446
- retry: (failureCount, error) => {
447
- if ("status" in error && (error.status === 404 || error.status === 500)) return false;
448
- return failureCount < 3;
449
- }
450
- });
451
- const { data: idNowStart, isLoading, isError: idNowStartError, refetch: refetchIdNowStartIdentification } = useIdNowStartIdentification(idNowModalChildEntityId.value?.id ?? skipToken, { enabled: !!idNowModalChildEntityId.value?.id && page === 2 });
452
- const handleDismiss = () => {
453
- setIsConfirmPresented(true);
454
- };
455
- const handleCancelDismiss = () => {
456
- setIsConfirmPresented(false);
457
- };
458
- const handleConfirmDismiss = () => {
459
- setPage(1);
460
- setGenericError(false);
461
- setIsConfirmPresented(false);
462
- showIdNowModal.value = false;
463
- if (idNowStartError && idNowModalChildEntityId.value?.id) queryClient.resetQueries({ queryKey: ["idNowProviderStartIdentification", idNowModalChildEntityId.value?.id] });
464
- idNowModalChildEntityId.value = void 0;
465
- iFrameWidgetRef.current?.unmount();
466
- iFrameRef.current?.remove();
467
- if (idNowPostSubmit.value) handleFinish?.();
468
- idNowPostSubmit.value = false;
469
- };
470
- if (idNowStatus?.status === "finished") {
471
- if (isIdNowSuccessful(idNowStatus)) {
472
- idNowPostSubmit.value = true;
473
- showToast({
474
- label: t(($) => $["successfullyUpdatedDetails"], { ns: "common" }),
475
- variant: "success"
476
- });
477
- handleConfirmDismiss();
478
- } else if (page === 2) handleConfirmDismiss();
479
- }
480
- if (!isLoading && idNowStartError) {
481
- setGenericError(true);
482
- setPage(1);
483
- }
484
- const initializeIdNowWidget = useCallback$1(async (url) => {
485
- const container = widgetContainerRef.current;
486
- if (!container) return;
487
- const iFrame = document.createElement("iframe");
488
- iFrameRef.current = iFrame;
489
- iFrame.setAttribute("allowFullscreen", "true");
490
- iFrame.setAttribute("name", "idnow");
491
- iFrame.classList.add(IdNowVerificationModal_module_default.idnowVerificationHeaderIframe);
492
- iFrame.setAttribute("height", "800");
493
- iFrame.setAttribute("allow", "camera *;microphone *;geolocation *;clipboard-read *;clipboard-write *");
494
- container.appendChild(iFrame);
495
- try {
496
- iFrameWidgetRef.current = new IFrameWidget(iFrame, url, "idnow", "");
497
- await iFrameWidgetRef.current.mountAndWaitForResponse();
498
- } catch (err) {
499
- console.error("Error occurred:", err);
500
- setGenericError(true);
501
- setPage(1);
502
- }
503
- }, []);
504
- useEffect$1(() => {
505
- if (page === 2 && !isLoading && idNowStart && idNowStart?.url) (async () => {
506
- await refetchIdNowIdentificationStatus();
507
- await initializeIdNowWidget(idNowStart.url);
508
- })();
509
- return () => {
510
- iFrameWidgetRef.current?.unmount();
511
- iFrameRef.current?.remove();
512
- };
513
- }, [
514
- isLoading,
515
- page,
516
- initializeIdNowWidget,
517
- refetchIdNowIdentificationStatus,
518
- idNowStart
519
- ]);
520
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [!isStatusLoading && /* @__PURE__ */ jsxs(Modal, {
521
- size: page === 2 ? "large" : "medium",
522
- showCloseButton: !isLoading && !isStatusLoading,
523
- onClose: handleDismiss,
524
- ariaLabel: t(($) => $["identityVerification"]),
525
- children: [page === 1 && /* @__PURE__ */ jsx("div", {
526
- className: IdNowVerificationModal_module_default.idnowHeader,
527
- children: /* @__PURE__ */ jsx(LandingLayout, {
528
- media: /* @__PURE__ */ jsx(Image, {
529
- className: IdNowVerificationModal_module_default.idnowVerificationHeaderImage,
530
- lazyLoadedImage: passportFrontGreenImage$1
531
- }),
532
- title: t(($) => $["identityVerification"]),
533
- description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
534
- t(($) => $["idNowDescription"], { ns: "individual" }),
535
- /* @__PURE__ */ jsx("br", {}),
536
- /* @__PURE__ */ jsx("br", {}),
537
- getIndividualLegalEntityName(idNowModalChildEntityId.value) && t(($) => $["idNowDescriptionName"], {
538
- ns: "individual",
539
- name: getIndividualLegalEntityName(idNowModalChildEntityId.value)
540
- })
541
- ] }),
542
- error: !isLoading && (genericError || isStatusError) ? /* @__PURE__ */ jsx(Alert, {
543
- variant: "error",
544
- title: t(($) => $["thereWasAnErrorTryAgain"], { ns: "common" })
545
- }) : void 0,
546
- actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
547
- onClick: async () => {
548
- setGenericError(false);
549
- setPage(2);
550
- await refetchIdNowStartIdentification();
551
- },
552
- disabled: isLoading || isStatusLoading || idNowStatus?.status === "finished" && isIdNowSuccessful(idNowStatus),
553
- fullWidth: true,
554
- children: idNowStatus?.status === "pending" ? t(($) => $["continueVerification"], { ns: "common" }) : t(($) => $["startVerification"], { ns: "common" })
555
- }), /* @__PURE__ */ jsx(Button, {
556
- disabled: isLoading || isStatusLoading,
557
- variant: "tertiary",
558
- onClick: handleConfirmDismiss,
559
- fullWidth: true,
560
- children: idNowPostSubmit.value ? t(($) => $["finishLater"], { ns: "common" }) : t(($) => $["editDetails"], { ns: "common" })
561
- })] })
562
- })
563
- }), page === 2 && (isLoading ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsx("div", {
564
- ref: widgetContainerRef,
565
- className: IdNowVerificationModal_module_default.idnowVerificationHeaderIframeContainer
566
- }))]
567
- }), isConfirmPresented && /* @__PURE__ */ jsx(Confirm, {
568
- confirmText: t(($) => $["leave"], { ns: "common" }),
569
- onCancel: handleCancelDismiss,
570
- onConfirm: handleConfirmDismiss,
571
- title: t(($) => $["unsavedChanges"], { ns: "common" })
572
- })] });
573
- };
574
- //#endregion
575
- //#region src/components/Individual/forms/IdVerification/idVerificationProviderId.ts
576
- var idVerificationProviderId = signal();
577
- //#endregion
578
- //#region src/utils/areArraysDifferent.ts
579
- var areArraysDifferent = (a = [], b = []) => {
580
- if (a.length !== b.length) return true;
581
- const sortedA = [...a].sort();
582
- const sortedB = [...b].sort();
583
- return sortedA.some((item, index) => item !== sortedB[index]);
584
- };
585
- //#endregion
586
- //#region src/utils/useModalAction.ts
587
- var useModalAction = () => {
588
- const userEvents = useAnalyticsContext();
589
- return useCallback$1((label, actionType, setModalState, callback) => {
590
- userEvents.addPageEvent(actionType === "open" ? "Opened modal" : actionType === "close" ? "Closed modal" : "Clicked button", {
591
- actionType,
592
- label
593
- });
594
- setModalState(actionType === "open");
595
- callback?.();
596
- }, [userEvents]);
597
- };
598
- //#endregion
599
- //#region src/components/Individual/helpers/roleUtils.ts
600
- var calculateRoles = (data) => {
601
- return [
602
- {
603
- isApplicable: data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES,
604
- role: DecisionMakerTypes.SIGNATORY
605
- },
606
- {
607
- isApplicable: data?.uboQuestionnaire?.isOwner === GuidanceQuestionValues.YES,
608
- role: DecisionMakerTypes.OWNER
609
- },
610
- {
611
- isApplicable: data?.uboQuestionnaire?.isControllingPerson === GuidanceQuestionValues.YES,
612
- role: DecisionMakerTypes.CONTROLLING_PERSON
613
- },
614
- {
615
- isApplicable: data?.uboQuestionnaire?.isDirector === GuidanceQuestionValues.YES,
616
- role: DecisionMakerTypes.DIRECTOR
617
- }
618
- ].filter(({ isApplicable }) => isApplicable).map(({ role }) => role);
619
- };
620
- //#endregion
621
- //#region src/components/Individual/helpers/shouldShowMotionCapture.ts
622
- var showIndividualMotionCapture = signal(void 0);
623
- var setShowIndividualMotionCapture = (showMotionCapture) => {
624
- showIndividualMotionCapture.value = showMotionCapture;
625
- };
626
- var hasMotionCaptureScenario = signal(void 0);
627
- var setHasMotionCaptureScenario = (scenarios) => {
628
- hasMotionCaptureScenario.value = scenarios?.some((scenario) => scenario === Scenarios.L_MOTION || scenario === Scenarios.L1_ID);
629
- };
630
- var allowedRolesForMotionCapture = [DecisionMakerTypes.SIGNATORY];
631
- var shouldShowMotionCapture = ({ capabilities, userRoles, taskType, hasMotionScenario, hasLiveSelfieError, isInvitedEntity = false }) => {
632
- if (hasLiveSelfieError) return true;
633
- if (isInvitedEntity) return shouldShowMotionCaptureForInvitedEntity({
634
- capabilities,
635
- userRoles
636
- });
637
- if (!hasMotionScenario) return false;
638
- const isIndividual = taskType === TaskTypes.INDIVIDUAL;
639
- const hasRequiredRole = userRoles?.some((role) => allowedRolesForMotionCapture.includes(role));
640
- const hasRequiredCapability = capabilities?.issueBankAccount?.requested ?? false;
641
- return (isIndividual || hasRequiredRole) && hasRequiredCapability;
642
- };
643
- var shouldShowMotionCaptureForInvitedEntity = ({ capabilities, userRoles }) => {
644
- if (!userRoles || !userRoles.includes("signatory") || capabilities === void 0) return false;
645
- const rootCapabilitiesToShowMotionCaptureFor = [
646
- "issueBankAccount",
647
- "receiveFromThirdParty",
648
- "sendToThirdParty"
649
- ];
650
- return Object.keys(capabilities).some((capabilityName) => rootCapabilitiesToShowMotionCaptureFor.includes(capabilityName) && capabilities[capabilityName]?.requested);
651
- };
652
- //#endregion
653
- //#region src/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.ts
654
- var individualIdNumberOptions = { [CountryCodes.Spain]: [{
655
- id: "dni",
656
- name: "dni"
657
- }, {
658
- id: "nie",
659
- name: "nie"
660
- }] };
661
- var additionallIdNumberOptions = {
662
- [CountryCodes.NewZealand]: [{
663
- id: "driversLicense",
664
- name: "driversLicense"
665
- }, {
666
- id: "passport",
667
- name: "passportNumber"
668
- }],
669
- [CountryCodes.HongKong]: [
670
- {
671
- id: "proofOfIdentityCard",
672
- name: "stateIssuedProofOfIdentityCard"
673
- },
674
- {
675
- id: "driversLicense",
676
- name: "driversLicense"
677
- },
678
- {
679
- id: "passport",
680
- name: "passportNumber"
681
- }
682
- ],
683
- [CountryCodes.Australia]: [{
684
- id: "driversLicense",
685
- name: "driversLicense"
686
- }, {
687
- id: "passport",
688
- name: "passportNumber"
689
- }]
690
- };
691
- //#endregion
692
- //#region src/components/Shared/fields/IdFieldTypeSelector/IndividualIdNumberTypeSelector.tsx
693
- function IndividualIdNumberTypeSelector({ country, selected, handleFieldChange }) {
694
- const { t } = useTranslation("common");
695
- const options = useMemo$1(() => individualIdNumberOptions[country] ?? [], [country]);
696
- useEffect$1(() => {
697
- if (!selected && options.length > 0) handleFieldChange(options[0].id);
698
- }, [
699
- options,
700
- selected,
701
- handleFieldChange
702
- ]);
703
- if (options.length <= 1) return null;
704
- return /* @__PURE__ */ jsx(Field, {
705
- el: "fieldset",
706
- name: "individualIdNumberType",
707
- label: t(($) => $["whichTypeOfIdNumberDoYouHave"]),
708
- children: (childProps) => /* @__PURE__ */ jsx(RadioGroup, {
709
- ...childProps,
710
- name: "individualIdNumberType",
711
- items: options,
712
- value: selected,
713
- onChange: (value) => handleFieldChange(value)
714
- })
715
- });
716
- }
717
- //#endregion
718
- //#region src/components/Individual/helpers/isDecisionMakerTask.ts
719
- var isDecisionMakerTask = (taskType) => taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
720
- var AdditionalPersonalDetails_module_default = {
721
- "additional-details-section-heading": "_additional-details-section-heading_o3tfa_1",
722
- additionalDetailsSectionHeading: "_additional-details-section-heading_o3tfa_1"
723
- };
724
- //#endregion
725
- //#region src/components/Individual/fields/DriversLicense/DriversLicense.tsx
726
- var DriversLicense = ({ country, driversLicense, onIssuerStateChange, onLicenseNumberInput, onLicenseNumberBlur, onCardNumberInput, onCardNumberBlur, formUtils, isValid, errorMessages, guidanceText, shouldValidate }) => {
727
- const { t: commonT } = useTranslation("common");
728
- const { t: individualT } = useTranslation("individual");
729
- const { dataset: auStates } = useDataset(datasetIdentifier.state("AU"));
730
- const isCountryAustralia = country === CountryCodes.Australia;
731
- const isCountryNewZealand = country === CountryCodes.NewZealand;
732
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
733
- isCountryAustralia && onIssuerStateChange !== void 0 && /* @__PURE__ */ jsx(Field, {
734
- name: "issuerState",
735
- label: formUtils.getLabel("issuerState"),
736
- isValid: isValid.issuerState,
737
- errorMessage: errorMessages.issuerState,
738
- children: (childProps) => /* @__PURE__ */ jsx(Select, {
739
- ...childProps,
740
- name: "issuerState",
741
- onChange: onIssuerStateChange,
742
- isInvalid: false,
743
- items: auStates,
744
- placeholder: commonT(($) => $["selectState"]),
745
- selected: driversLicense.issuerState
746
- })
747
- }),
748
- /* @__PURE__ */ jsxs("div", {
749
- className: "adyen-kyc-field-wrapper",
750
- children: [/* @__PURE__ */ jsx(MaskedInput, {
751
- name: "idNumber",
752
- type: "text",
753
- label: formUtils.getLabel("idNumber", "idNumber"),
754
- formatGuidance: guidanceText.idNumber,
755
- errorMessage: errorMessages.idNumber,
756
- shouldValidate,
757
- isValid: Boolean(isValid.idNumber),
758
- "aria-required": formUtils.isRequiredField("idNumber"),
759
- "aria-invalid": !isValid.idNumber,
760
- onBlur: onLicenseNumberBlur,
761
- readonly: formUtils.isReadOnly("idNumber"),
762
- value: driversLicense.idNumber ?? "",
763
- onInput: onLicenseNumberInput,
764
- acceptObscuredValue: formUtils?.isObscured("idNumber"),
765
- ...formUtils.getMask("idNumber")
766
- }), /* @__PURE__ */ jsx(MaskedInput, {
767
- name: "licenseCardNumber",
768
- type: "text",
769
- label: formUtils.getLabel("licenseCardNumber", "licenseCardNumber"),
770
- formatGuidance: guidanceText.licenseCardNumber,
771
- errorMessage: errorMessages.licenseCardNumber,
772
- shouldValidate,
773
- isValid: Boolean(isValid.licenseCardNumber),
774
- "aria-required": formUtils.isRequiredField("licenseCardNumber"),
775
- "aria-invalid": !isValid.licenseCardNumber,
776
- onBlur: onCardNumberBlur,
777
- readonly: formUtils.isReadOnly("licenseCardNumber"),
778
- value: driversLicense.licenseCardNumber ?? "",
779
- onInput: onCardNumberInput,
780
- acceptObscuredValue: formUtils?.isObscured("licenseCardNumber"),
781
- ...formUtils.getMask("licenseCardNumber")
782
- })]
783
- }),
784
- (isCountryAustralia || isCountryNewZealand) && /* @__PURE__ */ jsx(ContextGuidance, {
785
- title: individualT(($) => $["whereCanIFindTheseNumbersOnMyDriversLicense"]),
786
- content: /* @__PURE__ */ jsxs(Fragment$1, { children: [isCountryAustralia ? `${individualT(($) => $["whereToFindNumbersOnDriversLicense"])}\u00A0` : `${individualT(($) => $["whereToFindNumbersOnDriversLicense__NZ"])}\u00A0`, /* @__PURE__ */ jsx(Link, {
787
- href: isCountryAustralia ? "https://www.usi.gov.au/about/forms-id/drivers-licence" : "https://www.nzta.govt.nz/driver-licences/getting-a-licence/your-driver-licence-explained/",
788
- children: individualT(($) => $["iStillCantFindIt"])
789
- })] }),
790
- titleId: "whereCanIFindTheseNumbersOnMyDriversLicense",
791
- contentId: "whereToFindNumbersOnDriversLicense"
792
- })
793
- ] });
794
- };
795
- //#endregion
796
- //#region src/components/Individual/forms/Individual.rules.ts
797
- var REQUIRED = "REQUIRED";
798
- var OPTIONAL = "OPTIONAL";
799
- var ID_NUMBER_EXEMPT_COUNTRIES = [
800
- CountryCodes.Canada,
801
- CountryCodes.Mexico,
802
- CountryCodes.PuertoRico,
803
- CountryCodes.UnitedStates
804
- ];
805
- var COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES = [
806
- CountryCodes.HongKong,
807
- CountryCodes.Australia,
808
- CountryCodes.NewZealand
809
- ];
810
- var ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES = [CountryCodes.Singapore, CountryCodes.UnitedStates];
811
- var NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore, CountryCodes.HongKong];
812
- var JOB_TITLE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
813
- var ISSUER_REQUIRED_FOR_COUNTRIES = [CountryCodes.Australia];
814
- var EXPIRY_DATE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
815
- var LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand, CountryCodes.Australia];
816
- var TAX_ID_REQUIRED_COUNTRIES = [
817
- CountryCodes.Austria,
818
- CountryCodes.Belgium,
819
- CountryCodes.Croatia,
820
- CountryCodes.Cyprus,
821
- CountryCodes.Estonia,
822
- CountryCodes.Finland,
823
- CountryCodes.France,
824
- CountryCodes.Germany,
825
- CountryCodes.Greece,
826
- CountryCodes.Ireland,
827
- CountryCodes.Latvia,
828
- CountryCodes.Lithuania,
829
- CountryCodes.Luxembourg,
830
- CountryCodes.Malta,
831
- CountryCodes.Netherlands,
832
- CountryCodes.Portugal,
833
- CountryCodes.Slovakia,
834
- CountryCodes.Slovenia,
835
- CountryCodes.UnitedKingdom
836
- ];
837
- var DECISION_MAKER_TYPES_WITH_JOBTITLE = [DecisionMakerTypes.SIGNATORY, DecisionMakerTypes.CONTROLLING_PERSON];
838
- var ID_MISSING_DATA_ERROR_CODE = "2_8071";
839
- var REMEDIATION_CODES_UPLOAD_ID = [
840
- "1_301",
841
- "1_302",
842
- "1_303"
843
- ];
844
- var individualRules = ({ matchingScenario, data, country, taskType, isFeatureEnabled = () => false, rootLegalEntity, problems }) => createFormRules({
845
- countryUsesTaxId: () => {
846
- if (matchingScenario?.includes(Scenarios.L_TAXINFO) && TAX_ID_REQUIRED_COUNTRIES.includes(country)) return "REQUIRED";
847
- },
848
- isDirectorIdNumberRequiredForCountry: () => {
849
- if (!data.basicDetails?.role) return REQUIRED;
850
- if (data.basicDetails?.role?.some((role) => role !== DecisionMakerTypes.DIRECTOR)) return REQUIRED;
851
- if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && data.basicDetails?.role?.some((role) => role === DecisionMakerTypes.DIRECTOR)) return REQUIRED;
852
- },
853
- idNumberRules: () => {
854
- if (data.additionalPersonalDetails?.idNumberExempt) return OPTIONAL;
855
- if (!data.basicDetails?.role) return REQUIRED;
856
- if (country === CountryCodes.UnitedStates && data.basicDetails?.role?.every((role) => role === DecisionMakerTypes.SIGNATORY)) return;
857
- if (data.basicDetails?.role?.some((role) => role !== DecisionMakerTypes.DIRECTOR)) return REQUIRED;
858
- if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && data.basicDetails?.role?.some((role) => role === DecisionMakerTypes.DIRECTOR)) return REQUIRED;
859
- },
860
- requiredIfDecisionMakerTask: () => {
861
- if (taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER) return REQUIRED;
862
- },
863
- idNumberExemptIfApplicableCountry: () => {
864
- if (matchingScenario?.includes(Scenarios.L_TAXINFO)) return;
865
- if (country === CountryCodes.UnitedStates && data.basicDetails?.role?.every((role) => role === DecisionMakerTypes.SIGNATORY)) return;
866
- if (ID_NUMBER_EXEMPT_COUNTRIES.includes(country)) return REQUIRED;
867
- },
868
- hasChosenIdType: () => {
869
- return data?.manualIdUpload?.idDocumentType ? REQUIRED : void 0;
870
- },
871
- backPageIfRequiredForIdType: () => {
872
- return getLocalizedIdDocumentTypeOptions(country).find(({ id }) => id === data.manualIdUpload?.idDocumentType)?.hasBackPage ? REQUIRED : void 0;
873
- },
874
- isProofOfResidencyRequired: () => {
875
- if (isBafinSignatoryFlow({
876
- taskType,
877
- data,
878
- scenarios: matchingScenario
879
- })) return;
880
- if (data.proofOfResidency?.proofOfResidency?.length) return REQUIRED;
881
- if (!(data?.idVerificationMethod?.idVerificationMethod === "instantVerification")) return;
882
- const documentCountry = data?.idVerificationMethod?.idDocument?.documentCountry;
883
- const residenceCountry = data?.additionalPersonalDetails?.country ?? country;
884
- if (!documentCountry || !residenceCountry) return;
885
- const countriesMismatch = documentCountry !== residenceCountry;
886
- const isEeaLowRiskException = isLowRiskCountry(documentCountry) && isLowRiskCountry(residenceCountry);
887
- if (countriesMismatch && !isEeaLowRiskException) return REQUIRED;
888
- },
889
- isProofOfNationalIdRequired: () => {
890
- if (isBafinSignatoryFlow({
891
- taskType,
892
- data,
893
- scenarios: matchingScenario
894
- })) return;
895
- if (data.proofOfNationalId?.proofOfNationalId?.length) return REQUIRED;
896
- },
897
- isIdVerificationMethodRequired: () => {
898
- if (isBafinSignatoryFlow({
899
- taskType,
900
- data,
901
- scenarios: matchingScenario
902
- })) return;
903
- return REQUIRED;
904
- },
905
- isVerifyByInviteSelected: () => {
906
- return taskType === TaskTypes.DECISION_MAKER && isFeatureEnabled("EnableVerifyByInvite") && data?.idVerificationMethod?.idVerificationMethod === "verifyByInvite" ? REQUIRED : void 0;
907
- },
908
- contactsIfRequiredForRole: () => {
909
- if (taskType === TaskTypes.DECISION_MAKER) {
910
- if (data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY)) return REQUIRED;
911
- return;
912
- }
913
- return REQUIRED;
914
- },
915
- requiredIfPhoneScenarioDisabled: () => !isFeatureEnabled("EnablePhoneFieldScenario") ? REQUIRED : void 0,
916
- jobTitleIfRequiredForRole: () => {
917
- if (taskType !== TaskTypes.DECISION_MAKER) return;
918
- if (data.basicDetails?.role?.some((role) => DECISION_MAKER_TYPES_WITH_JOBTITLE.includes(role)) || JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) return REQUIRED;
919
- },
920
- isPlaceOfBirthRequired: () => {
921
- if (isBafinSignatoryFlow({
922
- taskType,
923
- data,
924
- scenarios: matchingScenario
925
- })) return REQUIRED;
926
- },
927
- nationalityIfRequiredForRole: () => {
928
- if (isBafinSignatoryFlow({
929
- taskType,
930
- data,
931
- scenarios: matchingScenario
932
- })) return REQUIRED;
933
- const enableNationalitySGHK = isFeatureEnabled("EnableNationalitySGHK");
934
- const rootLegalEntityCountry = rootLegalEntity ? getLegalEntityCountry(rootLegalEntity) : void 0;
935
- if (enableNationalitySGHK && rootLegalEntityCountry && NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(rootLegalEntityCountry)) return REQUIRED;
936
- if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || data?.additionalPersonalDetails?.nationality) return REQUIRED;
937
- },
938
- requiredIfCountryUsesMultipleTypesOfIdentity: () => {
939
- if (COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES.includes(country)) return REQUIRED;
940
- },
941
- licenseCardNumberRules: () => {
942
- if (data.additionalPersonalDetails?.typeOfIdentity === "driversLicense" && LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES.includes(country)) return REQUIRED;
943
- },
944
- issuerStateRequired: () => {
945
- if (data.additionalPersonalDetails?.typeOfIdentity === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country)) return REQUIRED;
946
- },
947
- expiryDateRequired: () => {
948
- if (data.additionalPersonalDetails?.typeOfIdentity === "passport" && EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country)) return REQUIRED;
949
- },
950
- legalRepresentativeRelationshipRequired: () => taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS ? REQUIRED : void 0,
951
- isProofOfRelationshipRequired: () => void 0,
952
- addressIfRequiredForCountry: () => {
953
- return getAddressSchemaForCountry(data?.additionalPersonalDetails?.country).includes("street") ? "REQUIRED" : void 0;
954
- },
955
- otherAddressInfoIfRequiredForCountry: () => {
956
- if (isJapanLocalizationEnabled(isFeatureEnabled, country)) return "REQUIRED";
957
- return getAddressSchemaForCountry(data?.additionalPersonalDetails?.country).includes("street2") ? "OPTIONAL" : void 0;
958
- },
959
- postalCodeIfRequiredForCountry: () => {
960
- return getAddressSchemaForCountry(data?.additionalPersonalDetails?.country).includes("postalCode") ? "REQUIRED" : void 0;
961
- },
962
- cityIfRequiredForCountry: () => {
963
- return getAddressSchemaForCountry(data?.additionalPersonalDetails?.country).includes("city") ? "REQUIRED" : void 0;
964
- },
965
- stateOrProvinceIfRequiredForCountry: () => {
966
- return getAddressSchemaForCountry(data?.additionalPersonalDetails?.country).includes("stateOrProvince") && COUNTRIES_WITH_STATES_DATASET.includes(data?.additionalPersonalDetails?.country ?? country) ? "REQUIRED" : void 0;
967
- },
968
- nomineeDirectorRequiredForCountry: () => {
969
- if (allowedCountriesForNominee.includes(data?.additionalPersonalDetails?.country ?? country) && data?.basicDetails?.role?.includes(DecisionMakerTypes.DIRECTOR)) return "REQUIRED";
970
- },
971
- nomineeShareHolderRequiredForCountry: () => {
972
- if (allowedCountriesForNominee.includes(data?.additionalPersonalDetails?.country ?? country) && data?.basicDetails?.role?.includes(DecisionMakerTypes.OWNER)) return "REQUIRED";
973
- },
974
- isUsingInstantVerificationOrHasExistingDocument: () => {
975
- if (isBafinSignatoryFlow({
976
- taskType,
977
- data,
978
- scenarios: matchingScenario
979
- })) return;
980
- const isUsingInstantVerification = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
981
- const existingDocument = data?.idVerificationMethod?.idDocument;
982
- return isUsingInstantVerification || existingDocument ? REQUIRED : void 0;
983
- },
984
- isManualIdFlow: () => {
985
- if (isBafinSignatoryFlow({
986
- taskType,
987
- data,
988
- scenarios: matchingScenario
989
- })) return;
990
- return data?.idVerificationMethod?.idVerificationMethod === "manualVerification" ? "REQUIRED" : void 0;
991
- },
992
- isManualIdFlowAndNotProvidingIdNumber: () => {
993
- if (isBafinSignatoryFlow({
994
- taskType,
995
- data,
996
- scenarios: matchingScenario
997
- })) return;
998
- const hasMissingId = problems?.missingData?.some((error) => error.code === ID_MISSING_DATA_ERROR_CODE);
999
- const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1000
- const idNumberExempt = data?.additionalPersonalDetails?.idNumberExempt;
1001
- const hasIdRemediationAction = Object.keys(problems?.remediationActions ?? {}).some((code) => REMEDIATION_CODES_UPLOAD_ID.includes(code));
1002
- return isManualFlow && (idNumberExempt || hasMissingId || hasIdRemediationAction) ? "REQUIRED" : void 0;
1003
- },
1004
- isManualIdFlowAndHasMissingData: () => {
1005
- if (isBafinSignatoryFlow({
1006
- taskType,
1007
- data,
1008
- scenarios: matchingScenario
1009
- })) return;
1010
- const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1011
- if (matchingScenario?.includes(Scenarios.L1_IDDOC)) return isManualFlow ? "REQUIRED" : void 0;
1012
- const hasMissingId = problems?.missingData?.some((error) => error.code === ID_MISSING_DATA_ERROR_CODE);
1013
- const hasIdRemediationAction = Object.keys(problems?.remediationActions ?? {}).some((code) => REMEDIATION_CODES_UPLOAD_ID.includes(code));
1014
- return isManualFlow && (hasMissingId || hasIdRemediationAction) ? "REQUIRED" : void 0;
1015
- },
1016
- idVerificationRequired: () => {
1017
- return REQUIRED;
1018
- },
1019
- isDirectorRequiredForCountry: () => {
1020
- if (getAvailableDecisionMakerRoleTypes(rootLegalEntity ? getLegalEntityCountry(rootLegalEntity) : country, matchingScenario).some((maker) => maker.roleType === DecisionMakerTypes.DIRECTOR)) return "REQUIRED";
1021
- },
1022
- japanSpecificField: () => {
1023
- if (isJapanLocalizationEnabled(isFeatureEnabled, taskType === TaskTypes.DECISION_MAKER && rootLegalEntity && getLegalEntityCountry(rootLegalEntity) || country)) return "REQUIRED";
1024
- }
1025
- });
1026
- //#endregion
1027
- //#region src/components/Individual/forms/AdditionalPersonalDetails/Identity/TypeOfIdentity/index.tsx
1028
- var TypeOfIdentity = ({ availableIdentityTypesOptions, selectedIdentityType, setSelectedIdentityType, label, errorMessage, isValid }) => {
1029
- const { t } = useTranslation(["common", "individual"]);
1030
- return /* @__PURE__ */ jsx(Field, {
1031
- name: "typeOfIdentity",
1032
- label,
1033
- errorMessage,
1034
- isValid,
1035
- helper: t(($) => $["typeOfIdentitySubtitle"], { ns: "individual" }),
1036
- children: (childProps) => /* @__PURE__ */ jsx(Select, {
1037
- ...childProps,
1038
- name: "typeOfIdentity",
1039
- isInvalid: false,
1040
- items: availableIdentityTypesOptions.map(({ id, name }) => ({
1041
- id,
1042
- name: t(($) => $[name])
1043
- })),
1044
- placeholder: t(($) => $["selectOne"]),
1045
- selected: selectedIdentityType,
1046
- onChange: (event) => setSelectedIdentityType(event.target.value)
1047
- })
1048
- });
1049
- };
1050
- //#endregion
1051
- //#region src/components/Individual/forms/AdditionalPersonalDetails/Identity/validate.ts
1052
- var identityValidationRules = (country) => {
1053
- switch (country) {
1054
- case CountryCodes.Australia: return {
1055
- typeOfIdentity: [isTruthyValidator],
1056
- issuerState: [isTruthyValidator]
1057
- };
1058
- case CountryCodes.HongKong:
1059
- case CountryCodes.NewZealand: return { typeOfIdentity: [isTruthyValidator] };
1060
- default: return {};
1061
- }
1062
- };
1063
- //#endregion
1064
- //#region src/components/Individual/forms/AdditionalPersonalDetails/Identity/Identity.tsx
1065
- function Identity(props) {
1066
- const { additionalPersonalDetails, country, idNumberType, handleFieldChange } = props;
1067
- const { data, errors, fieldValidationErrors, formVerificationErrors, id: dataStoreId, labels, obscuredFields, optionalFields, requiredFields, readOnlyFields, shouldValidate, validators, valid } = additionalPersonalDetails;
1068
- const initialFormUtilProps = useMemo$1(() => {
1069
- return {
1070
- validators: {
1071
- ...identityValidationRules(country),
1072
- ...validators
1073
- },
1074
- labels,
1075
- obscuredFields,
1076
- readOnlyFields,
1077
- optionalFields,
1078
- requiredFields
1079
- };
1080
- }, [
1081
- country,
1082
- validators,
1083
- labels,
1084
- obscuredFields,
1085
- readOnlyFields,
1086
- optionalFields,
1087
- requiredFields
1088
- ]);
1089
- const licenseCardNumberMetaData = useMemo$1(() => {
1090
- return resolveFieldMetadata(licenseCardNumberDefaultConfig[country], {}, licenseCardNumberDefaultMetadata);
1091
- }, [country]);
1092
- const idNumberMetadata = useMemo$1(() => {
1093
- return resolveFieldMetadata(defaultFieldConfig[country], { idNumberType: data?.typeOfIdentity }, defaultFieldMetadata$1);
1094
- }, [country, data?.typeOfIdentity]);
1095
- const mergedProps = useMemo$1(() => {
1096
- return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, mergeFieldMetadataIntoProps("licenseCardNumber", licenseCardNumberMetaData, initialFormUtilProps));
1097
- }, [
1098
- idNumberMetadata,
1099
- initialFormUtilProps,
1100
- licenseCardNumberMetaData
1101
- ]);
1102
- const { t } = useTranslation("common");
1103
- const formUtils = useMemo$1(() => createFormUtils(mergedProps, t), [mergedProps, t]);
1104
- const { form } = useFormContext();
1105
- const defaultIdNumber = form?.defaultData?.additionalPersonalDetails?.idNumber;
1106
- const ssnType = getSSNType(formVerificationErrors, defaultIdNumber);
1107
- const today = /* @__PURE__ */ new Date();
1108
- const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
1109
- const isCountryAustralia = country === CountryCodes.Australia;
1110
- const isCountryNewZealand = country === CountryCodes.NewZealand;
1111
- useEffect$1(() => {
1112
- if (data?.typeOfIdentity === "nationalIdNumber") handleFieldChange("typeOfIdentity")(void 0);
1113
- }, [data?.typeOfIdentity, handleFieldChange]);
1114
- if (!handleFieldChange) return;
1115
- const identityProps = getFieldProps(additionalPersonalDetails, idNumberFields);
1116
- if (country === CountryCodes.UnitedStates || country === CountryCodes.PuertoRico) return /* @__PURE__ */ jsx(IdentityNumber, {
1117
- ...identityProps,
1118
- errors,
1119
- dataStoreId,
1120
- country,
1121
- formVerificationErrors,
1122
- handleFieldChange,
1123
- idNumberType: ssnType
1124
- });
1125
- return COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES.includes(country) ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
1126
- /* @__PURE__ */ jsx(TypeOfIdentity, {
1127
- availableIdentityTypesOptions: additionallIdNumberOptions?.[country],
1128
- selectedIdentityType: data?.typeOfIdentity,
1129
- setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
1130
- label: formUtils.getLabel("typeOfIdentity"),
1131
- isValid: Boolean(valid?.typeOfIdentity),
1132
- errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
1133
- }),
1134
- (isCountryAustralia || isCountryNewZealand) && data?.typeOfIdentity === "passport" && /* @__PURE__ */ jsx(MaskedInput, {
1135
- name: "idNumber",
1136
- type: "text",
1137
- label: formUtils.getLabel("idNumber", "idNumber"),
1138
- formatGuidance: translateTranslatable(t, idNumberMetadata.guidanceText),
1139
- errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1140
- shouldValidate,
1141
- isValid: Boolean(valid?.idNumber),
1142
- "aria-required": formUtils.isRequiredField("idNumber"),
1143
- "aria-invalid": !valid?.idNumber,
1144
- onBlur: handleFieldChange("idNumber", "blur"),
1145
- readonly: formUtils.isReadOnly("idNumber"),
1146
- value: data?.idNumber ?? "",
1147
- onInput: handleFieldChange("idNumber", "input"),
1148
- acceptObscuredValue: formUtils?.isObscured("idNumber"),
1149
- ...formUtils.getMask("idNumber")
1150
- }),
1151
- isCountryNewZealand && data?.typeOfIdentity === "passport" && /* @__PURE__ */ jsx(Field, {
1152
- name: "expiryDate",
1153
- label: formUtils.getLabel("passportExpiryDate"),
1154
- errorMessage: formUtils.getErrorMessage("expiryDate", errors, fieldValidationErrors),
1155
- isValid: valid?.expiryDate,
1156
- children: (childProps) => /* @__PURE__ */ jsx(InputDate, {
1157
- ...childProps,
1158
- name: "expiryDate",
1159
- value: data?.expiryDate,
1160
- placeholder: t(($) => $["datePlaceholder"]),
1161
- readonly: formUtils.isReadOnly("expiryDate"),
1162
- onInput: handleFieldChange("expiryDate", "input"),
1163
- onBlur: handleFieldChange("expiryDate", "blur"),
1164
- "aria-required": true,
1165
- "aria-invalid": !valid?.expiryDate,
1166
- min: formatDateObj(today),
1167
- max: formatDateObj(maxExpiryDateSelection)
1168
- })
1169
- }),
1170
- (isCountryAustralia || isCountryNewZealand) && data?.typeOfIdentity === "driversLicense" && /* @__PURE__ */ jsx(DriversLicense, {
1171
- country,
1172
- driversLicense: data,
1173
- onIssuerStateChange: handleFieldChange("issuerState"),
1174
- onLicenseNumberInput: handleFieldChange("idNumber", "input"),
1175
- onLicenseNumberBlur: handleFieldChange("idNumber", "blur"),
1176
- onCardNumberInput: handleFieldChange("licenseCardNumber", "input"),
1177
- onCardNumberBlur: handleFieldChange("licenseCardNumber", "blur"),
1178
- formUtils,
1179
- isValid: {
1180
- idNumber: Boolean(valid?.idNumber),
1181
- licenseCardNumber: Boolean(valid?.licenseCardNumber),
1182
- issuerState: Boolean(valid?.issuerState)
1183
- },
1184
- guidanceText: {
1185
- idNumber: translateTranslatable(t, idNumberMetadata.guidanceText),
1186
- licenseCardNumber: translateTranslatable(t, licenseCardNumberMetaData.guidanceText)
1187
- },
1188
- errorMessages: {
1189
- idNumber: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1190
- licenseCardNumber: formUtils.getErrorMessage("licenseCardNumber", errors, fieldValidationErrors),
1191
- issuerState: formUtils.getErrorMessage("issuerState", errors, fieldValidationErrors)
1192
- },
1193
- shouldValidate
1194
- }),
1195
- country === CountryCodes.HongKong && /* @__PURE__ */ jsx(MaskedInput, {
1196
- name: "idNumber",
1197
- type: "text",
1198
- label: formUtils.getLabel("idNumber", "idNumber"),
1199
- formatGuidance: translateTranslatable(t, idNumberMetadata.guidanceText),
1200
- errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1201
- shouldValidate,
1202
- isValid: Boolean(valid?.idNumber),
1203
- "aria-required": formUtils.isRequiredField("idNumber"),
1204
- "aria-invalid": Boolean(!valid?.idNumber),
1205
- onBlur: handleFieldChange("idNumber", "blur"),
1206
- readonly: formUtils.isReadOnly("idNumber"),
1207
- value: data?.idNumber ?? "",
1208
- onInput: handleFieldChange("idNumber", "input"),
1209
- acceptObscuredValue: formUtils?.isObscured("idNumber"),
1210
- ...formUtils.getMask("idNumber")
1211
- })
1212
- ] }) : /* @__PURE__ */ jsx(IdentityNumber, {
1213
- ...identityProps,
1214
- errors,
1215
- country,
1216
- dataStoreId,
1217
- idNumberType,
1218
- handleFieldChange
1219
- });
1220
- }
1221
- //#endregion
1222
- //#region src/components/Individual/forms/AdditionalPersonalDetails/Identity/Identity.types.ts
1223
- var additionalIdentityInfoFields = [
1224
- "typeOfIdentity",
1225
- "licenseCardNumber",
1226
- "issuerState",
1227
- "expiryDate"
1228
- ];
1229
- //#endregion
1230
- //#region src/components/Individual/forms/AdditionalPersonalDetails/AdditionalPersonalDetails.tsx
1231
- var LazyJpAddressFields = lazy(async () => (await import("./JpAddressFields-C9MbL5XV.js")).JpAddressFields);
1232
- var additionalPersonalDetailsFields = [
1233
- "birthDate",
1234
- ...idNumberFields,
1235
- ...additionalIdentityInfoFields,
1236
- "country",
1237
- "nationality",
1238
- "placeOfBirth",
1239
- ...addressFields,
1240
- ...JP_ADDRESS_REQUIRED_FIELDS,
1241
- "taxInformation"
1242
- ];
1243
- function AdditionalPersonalDetails(props) {
1244
- const { t } = useTranslation(["common", "individual"]);
1245
- const allowedCountries = useAllowedCountries();
1246
- const [showLegalRepresentativePrompt, setShowLegalRepresentativePrompt] = useState$1(false);
1247
- const { isSettingEnabled } = useSettingsContext();
1248
- const { isFeatureEnabled } = useToggleContext();
1249
- const { form } = useFormContext();
1250
- const isAgeVerificationFeatureEnabled = isFeatureEnabled("EnableAgeVerification");
1251
- const isSettingsEnforceLegalAgeEnabled = isSettingEnabled(SettingNames.EnforceLegalAge);
1252
- const { country: defaultCountry, data, formVerificationErrors, heading, shouldValidate, valid, fieldValidationErrors, errors = {}, taskType, handleFieldChange } = props;
1253
- const country = data?.country ?? defaultCountry;
1254
- const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
1255
- const formUtils = createFormUtils(props, t);
1256
- const birthDateErrorMessage = formUtils.getErrorMessage("birthDate", errors, fieldValidationErrors);
1257
- if (!handleFieldChange) return;
1258
- const handleBirthDateChange = (event) => {
1259
- handleFieldChange("birthDate", "blur")(event);
1260
- if (isAgeVerificationFeatureEnabled && !isSettingsEnforceLegalAgeEnabled && isLegalRepresentativeNeeded(event.currentTarget.value, country, taskType)) setShowLegalRepresentativePrompt(true);
1261
- };
1262
- const isRootIndividual = taskType === TaskTypes.INDIVIDUAL;
1263
- const canEditCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit) || isDecisionMakerTask(taskType);
1264
- const addressProps = {
1265
- ...props,
1266
- fieldValidationErrors,
1267
- handleFieldChange
1268
- };
1269
- const buildJpProps = () => getFieldProps(addressProps, ALL_ADDRESS_FIELDS);
1270
- const buildProps = () => getFieldProps(addressProps, addressFields);
1271
- const addressFieldProps = isJapanLocalizationEnabled(isFeatureEnabled, country) ? {
1272
- showJapanLocalization: true,
1273
- residentialAddress: {
1274
- ...buildJpProps(),
1275
- handleFieldChange
1276
- }
1277
- } : {
1278
- showJapanLocalization: false,
1279
- residentialAddress: {
1280
- ...buildProps(),
1281
- handleFieldChange
1282
- }
1283
- };
1284
- return /* @__PURE__ */ jsxs("form", {
1285
- "aria-describedby": "ariaErrorField",
1286
- children: [
1287
- heading && /* @__PURE__ */ jsx(Header, { title: heading }),
1288
- /* @__PURE__ */ jsx(ErrorPanel, {
1289
- verificationErrors: formVerificationErrors,
1290
- validationErrors: fieldValidationErrors,
1291
- formUtils,
1292
- id: "ariaErrorField"
1293
- }),
1294
- /* @__PURE__ */ jsxs("div", {
1295
- className: AdditionalPersonalDetails_module_default.additionalDetailsSectionHeading,
1296
- children: [/* @__PURE__ */ jsx(Typography, {
1297
- el: "h3",
1298
- variant: "title",
1299
- children: t(($) => $["residentialAddress"])
1300
- }), /* @__PURE__ */ jsx(Typography, {
1301
- el: "p",
1302
- variant: "body",
1303
- children: t(($) => $["thisPersonsPrimaryAddress"], { ns: "individual" })
1304
- })]
1305
- }),
1306
- formUtils.isRequiredField("country") && /* @__PURE__ */ jsx(CountryField, {
1307
- data: { country },
1308
- valid: { country: valid?.country },
1309
- errors: { country: formUtils.getErrorMessage("country", errors, fieldValidationErrors) },
1310
- labels: { country: formUtils.getLabel("country") },
1311
- readonly: formUtils.isReadOnly("country") || !canEditCountry,
1312
- allowedCountries: isRootIndividual ? allowedCountries : void 0,
1313
- handleChangeFor: handleFieldChange
1314
- }),
1315
- addressFieldProps.showJapanLocalization ? /* @__PURE__ */ jsx(Suspense, {
1316
- fallback: /* @__PURE__ */ jsx(Loader, {}),
1317
- children: /* @__PURE__ */ jsx(LazyJpAddressFields, {
1318
- ...addressFieldProps.residentialAddress,
1319
- handleFieldChange,
1320
- addressType: "residentialAddress"
1321
- })
1322
- }) : /* @__PURE__ */ jsx(AddressFields, {
1323
- ...addressFieldProps.residentialAddress,
1324
- handleFieldChange,
1325
- addressType: "residentialAddress",
1326
- hideCountry: true
1327
- }),
1328
- /* @__PURE__ */ jsxs("div", {
1329
- className: AdditionalPersonalDetails_module_default.additionalDetailsSectionHeading,
1330
- children: [/* @__PURE__ */ jsx(Typography, {
1331
- el: "h3",
1332
- variant: "title",
1333
- children: t(($) => $["personalIdentityDetails"], { ns: "individual" })
1334
- }), /* @__PURE__ */ jsxs(Typography, {
1335
- el: "p",
1336
- variant: "body",
1337
- children: [
1338
- t(($) => $["weOnlyUseTheseDetailsForIdentityVerification"], { ns: "individual" }),
1339
- " ",
1340
- /* @__PURE__ */ jsx(Link, {
1341
- href: "https://www.adyen.com/privacy-policy",
1342
- external: true,
1343
- children: t(($) => $["privacyStatement"])
1344
- })
1345
- ]
1346
- })]
1347
- }),
1348
- formUtils.isRequiredField("birthDate") && /* @__PURE__ */ jsx(Field, {
1349
- name: "birthDate",
1350
- label: formUtils.getLabel("birthDate"),
1351
- errorMessage: birthDateErrorMessage,
1352
- isValid: valid?.birthDate,
1353
- children: (childProps) => /* @__PURE__ */ jsx(InputDate, {
1354
- ...childProps,
1355
- name: "birthDate",
1356
- value: data?.birthDate,
1357
- placeholder: t(($) => $["datePlaceholder"]),
1358
- readonly: formUtils.isReadOnly("birthDate"),
1359
- onInput: handleFieldChange("birthDate", "input"),
1360
- onBlur: handleBirthDateChange,
1361
- "aria-required": true,
1362
- "aria-invalid": !valid?.birthDate,
1363
- max: formatDateObj(/* @__PURE__ */ new Date())
1364
- })
1365
- }),
1366
- showLegalRepresentativePrompt && /* @__PURE__ */ jsx(Confirm, {
1367
- title: t(($) => $["legalRepresentativeForMinorIsRequired"], { ns: "individual" }),
1368
- description: t(($) => $["becauseThisPersonIsUnderXYearsOld"], {
1369
- ns: "individual",
1370
- age: getAgeRangeForLegalRepresentative(country)?.max?.toString() ?? ""
1371
- }),
1372
- onCancel: () => {
1373
- setShowLegalRepresentativePrompt(false);
1374
- },
1375
- confirmText: t(($) => $["ok"]),
1376
- cancelText: t(($) => $["editDetails"]),
1377
- onConfirm: () => {
1378
- setShowLegalRepresentativePrompt(false);
1379
- }
1380
- }),
1381
- /* @__PURE__ */ jsx(IndividualIdNumberTypeSelector, {
1382
- country,
1383
- handleFieldChange: handleFieldChange("typeOfIdentity", "input"),
1384
- selected: data?.typeOfIdentity
1385
- }),
1386
- /* @__PURE__ */ jsx(Identity, {
1387
- additionalPersonalDetails: props,
1388
- country,
1389
- errors,
1390
- idNumberType: data?.typeOfIdentity,
1391
- handleFieldChange
1392
- }),
1393
- showField(["taxInformation"]) && /* @__PURE__ */ jsx(TaxInformationField, {
1394
- data: formUtils.getFieldData(form.data?.additionalPersonalDetails ?? {}, ["taxInformation"]),
1395
- valid: formUtils.getFieldValid(form.valid?.additionalPersonalDetails ?? {}, ["taxInformation"]),
1396
- errors: { taxInformation: formUtils.getErrorMessage("taxInformation", errors, fieldValidationErrors) },
1397
- readonly: formUtils.isReadOnly("taxInformation"),
1398
- shouldValidate,
1399
- handleChangeFor: handleFieldChange,
1400
- canExempt: false,
1401
- country,
1402
- entityType: LegalEntityTypes.INDIVIDUAL,
1403
- defaultData: form.defaultData?.additionalPersonalDetails?.taxInformation
1404
- }),
1405
- formUtils.isRequiredField("nationality") && /* @__PURE__ */ jsx(CountryField, {
1406
- data: { country: data?.nationality },
1407
- valid: { country: valid?.nationality },
1408
- name: "nationality",
1409
- errors: { country: formUtils.getErrorMessage("nationality", errors, fieldValidationErrors) },
1410
- labels: { country: formUtils.getLabel("nationality") },
1411
- readonly: formUtils.isReadOnly("nationality"),
1412
- handleChangeFor: () => handleFieldChange("nationality", "input")
1413
- }),
1414
- formUtils.isRequiredField("placeOfBirth") && /* @__PURE__ */ jsx(Field, {
1415
- name: "placeOfBirth",
1416
- label: formUtils.getLabel("placeOfBirth"),
1417
- errorMessage: formUtils.getErrorMessage("placeOfBirth", errors, fieldValidationErrors),
1418
- isValid: valid?.placeOfBirth,
1419
- children: (childProps) => /* @__PURE__ */ jsx(InputText, {
1420
- ...childProps,
1421
- name: "placeOfBirth",
1422
- value: data?.placeOfBirth,
1423
- readonly: formUtils.isReadOnly("placeOfBirth"),
1424
- onInput: handleFieldChange("placeOfBirth", "input"),
1425
- onBlur: handleFieldChange("placeOfBirth", "blur"),
1426
- "aria-required": true,
1427
- "aria-invalid": !valid?.placeOfBirth
1428
- })
1429
- }),
1430
- country === "US" ? /* @__PURE__ */ jsx(PatriotActDisclosure, {}) : void 0
1431
- ]
1432
- });
1433
- }
1434
- //#endregion
1435
- //#region src/components/Individual/fields/NameFields/NameFields.tsx
1436
- function NameFields(props) {
1437
- const { formProps, fieldConfigs } = props;
1438
- const { t } = useTranslation("common");
1439
- const { data, handleFieldChange, errors, fieldValidationErrors } = formProps;
1440
- if (!handleFieldChange) return;
1441
- const formUtils = createFormUtils(formProps, t);
1442
- return /* @__PURE__ */ jsx("div", {
1443
- className: "adyen-kyc-field-wrapper",
1444
- children: fieldConfigs.map(({ name, isValid, label, helper, transformInput, transformMode }) => formUtils.isRequiredField(name) && /* @__PURE__ */ jsx(Field, {
1445
- name,
1446
- label: formUtils.getLabel(label),
1447
- errorMessage: formUtils.getErrorMessage(name, errors, fieldValidationErrors),
1448
- isValid,
1449
- helper: helper && formUtils.getLabel(helper),
1450
- children: (childProps) => /* @__PURE__ */ jsx(InputText, {
1451
- ...childProps,
1452
- name,
1453
- value: data?.[name],
1454
- readonly: formUtils.isReadOnly(name),
1455
- onInput: handleFieldChange(name, "input"),
1456
- onBlur: handleFieldChange(name, "blur"),
1457
- trimOnBlur: true,
1458
- spellCheck: false,
1459
- "aria-required": true,
1460
- "aria-invalid": !isValid,
1461
- transformInput,
1462
- transformMode
1463
- })
1464
- }, name))
1465
- });
1466
- }
1467
- //#endregion
1468
- //#region src/components/Individual/fields/NameFields/types.ts
1469
- var jaHaniNameFields = ["jaHaniFirstName", "jaHaniLastName"];
1470
- var jaKanaNameFields = ["jaKanaFirstName", "jaKanaLastName"];
1471
- //#endregion
1472
- //#region src/components/Shared/fields/LocalizedNameFields/LocalizedNameFields.tsx
1473
- var LocalizedNameFields = (props) => {
1474
- const { errors, id, handleFieldChange, country } = props;
1475
- const jaHaniNameProps = getFieldProps(props, jaHaniNameFields);
1476
- const jaKanaNameProps = getFieldProps(props, jaKanaNameFields);
1477
- const nameProps = getFieldProps(props, nameFields);
1478
- if (country === CountryCodes.Japan) return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1479
- !!jaHaniNameProps?.requiredFields?.length && /* @__PURE__ */ jsx(NameFields, {
1480
- fieldConfigs: [{
1481
- name: "jaHaniLastName",
1482
- label: "jaHaniLastName",
1483
- isValid: jaHaniNameProps.valid?.jaHaniLastName,
1484
- transformInput: toFullWidth,
1485
- transformMode: "blur"
1486
- }, {
1487
- name: "jaHaniFirstName",
1488
- label: "jaHaniFirstName",
1489
- isValid: jaHaniNameProps.valid?.jaHaniFirstName,
1490
- transformInput: toFullWidth,
1491
- transformMode: "blur"
1492
- }],
1493
- formProps: {
1494
- ...jaHaniNameProps,
1495
- dataStoreId: id,
1496
- errors,
1497
- handleFieldChange
1498
- }
1499
- }),
1500
- !!jaKanaNameProps?.requiredFields?.length && /* @__PURE__ */ jsx(NameFields, {
1501
- fieldConfigs: [{
1502
- name: "jaKanaLastName",
1503
- label: "jaKanaLastName",
1504
- isValid: jaKanaNameProps.valid?.jaKanaLastName,
1505
- transformInput: toFullWidth,
1506
- transformMode: "blur"
1507
- }, {
1508
- name: "jaKanaFirstName",
1509
- label: "jaKanaFirstName",
1510
- isValid: jaKanaNameProps.valid?.jaKanaFirstName,
1511
- transformInput: toFullWidth,
1512
- transformMode: "blur"
1513
- }],
1514
- formProps: {
1515
- ...jaKanaNameProps,
1516
- dataStoreId: id,
1517
- errors,
1518
- handleFieldChange
1519
- }
1520
- }),
1521
- !!nameProps?.requiredFields?.length && /* @__PURE__ */ jsx(NameFields, {
1522
- fieldConfigs: [{
1523
- name: "lastName",
1524
- label: "lastName__JP",
1525
- isValid: nameProps.valid?.lastName,
1526
- transformInput: convertFullToHalf,
1527
- transformMode: "blur"
1528
- }, {
1529
- name: "firstName",
1530
- label: "firstName__JP",
1531
- isValid: nameProps.valid?.firstName,
1532
- transformInput: convertFullToHalf,
1533
- transformMode: "blur"
1534
- }],
1535
- formProps: {
1536
- ...nameProps,
1537
- dataStoreId: id,
1538
- errors,
1539
- handleFieldChange
1540
- }
1541
- })
1542
- ] });
1543
- return /* @__PURE__ */ jsx(Name, {
1544
- ...nameProps,
1545
- dataStoreId: id,
1546
- errors,
1547
- handleFieldChange
1548
- });
1549
- };
1550
- //#endregion
1551
- //#region src/components/Individual/forms/BasicDetails/BasicDetails.tsx
1552
- var decisionMakerRoleFields = ["role"];
1553
- var nomineeFields = ["nomineeDirector", "nomineeShareholder"];
1554
- var basicDetailsFields = [
1555
- ...nameFields,
1556
- "jobTitle",
1557
- ...decisionMakerRoleFields,
1558
- ...nomineeFields,
1559
- ...contactDetailFields,
1560
- "relationship",
1561
- "jaHaniFirstName",
1562
- "jaHaniLastName",
1563
- "jaKanaFirstName",
1564
- "jaKanaLastName"
1565
- ];
1566
- function BasicDetails(props) {
1567
- const { t: commonT } = useTranslation("common");
1568
- const { t: individualT } = useTranslation("individual");
1569
- const { form: { triggerValidation } } = useFormContext();
1570
- const { country, data, formVerificationErrors, heading, id: basicDetailsId, parentLegalEntity, readOnlyFields, taskType, trustedFieldsProvider, fieldValidationErrors, errors, handleFieldChange } = props;
1571
- const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
1572
- const formUtils = createFormUtils(props, commonT);
1573
- const localizedNameProps = getFieldProps(props, [
1574
- "jaHaniFirstName",
1575
- "jaHaniLastName",
1576
- "jaKanaFirstName",
1577
- "jaKanaLastName",
1578
- ...nameFields
1579
- ]);
1580
- const contactDetailsFormProps = getFieldProps(props, contactDetailFields);
1581
- if (!handleFieldChange) return;
1582
- return /* @__PURE__ */ jsxs("form", {
1583
- "aria-describedby": "ariaErrorField",
1584
- children: [
1585
- heading && /* @__PURE__ */ jsx(Header, { title: heading }),
1586
- /* @__PURE__ */ jsx(ErrorPanel, {
1587
- verificationErrors: formVerificationErrors,
1588
- validationErrors: fieldValidationErrors,
1589
- formUtils,
1590
- id: "ariaErrorField"
1591
- }),
1592
- isLegalRepresentativeDetailsTask && /* @__PURE__ */ jsx(Alert, {
1593
- variant: "info",
1594
- title: individualT(($) => $["legalRepresentativeFor"], {
1595
- firstName: parentLegalEntity?.individual?.name.firstName || "",
1596
- lastName: parentLegalEntity?.individual?.name.lastName || ""
1597
- })
1598
- }),
1599
- /* @__PURE__ */ jsx("div", {
1600
- className: "u-margin-bottom-32",
1601
- children: /* @__PURE__ */ jsx(ContextGuidance, {
1602
- title: commonT(($) => $["whyDoINeedToFillInThisInformation"]),
1603
- content: individualT(($) => $["reasonForFillingIndividualPersonalDetails"]),
1604
- titleId: "whyDoINeedToFillInThisInformation",
1605
- contentId: "reasonForFillingIndividualPersonalDetails"
1606
- })
1607
- }),
1608
- isDecisionMakerTask(taskType) && trustedFieldsProvider === TrustedFieldsProviders.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, {
1609
- color: "secondary",
1610
- variant: "caption",
1611
- children: individualT(($) => $["weSelectedSomeRolesBasedOnMyinfoBusinessDataAboutYourCompanysAppointmentHoldersAndShareholders"])
1612
- }),
1613
- /* @__PURE__ */ jsx(LocalizedNameFields, {
1614
- ...localizedNameProps,
1615
- country,
1616
- handleFieldChange
1617
- }),
1618
- formUtils.isRequiredField("jobTitle", false) && /* @__PURE__ */ jsx(Field, {
1619
- name: "jobTitle",
1620
- label: formUtils.getLabel("jobTitle"),
1621
- errorMessage: formUtils.getErrorMessage("jobTitle", errors, fieldValidationErrors),
1622
- children: (childProps) => /* @__PURE__ */ jsx(InputText, {
1623
- ...childProps,
1624
- name: "jobTitle",
1625
- value: data?.jobTitle,
1626
- readonly: formUtils.isReadOnly("jobTitle"),
1627
- onInput: handleFieldChange("jobTitle", "input"),
1628
- onBlur: handleFieldChange("jobTitle", "blur"),
1629
- "aria-required": true
1630
- })
1631
- }),
1632
- !!contactDetailsFormProps?.requiredFields?.length && /* @__PURE__ */ jsx(ContactDetails, {
1633
- ...contactDetailsFormProps,
1634
- dataStoreId: basicDetailsId,
1635
- country,
1636
- handleFieldChange,
1637
- triggerValidation: () => triggerValidation("basicDetails")
1638
- })
1639
- ]
1640
- });
1641
- }
1642
- var IdDocumentUpload_module_default = {
1643
- "individual-document-upload": "_individual-document-upload_7mw7n_1",
1644
- individualDocumentUpload: "_individual-document-upload_7mw7n_1",
1645
- "individual-document-upload-subtitle": "_individual-document-upload-subtitle_7mw7n_5",
1646
- individualDocumentUploadSubtitle: "_individual-document-upload-subtitle_7mw7n_5"
1647
- };
1648
- //#endregion
1649
- //#region src/components/Individual/forms/IdDocumentUpload/IdDocumentManualUpload.tsx
1650
- var idDocumentUploadFields = [
1651
- "idDocumentType",
1652
- "idFrontPage",
1653
- "idBackPage",
1654
- "instantIdVerificationData"
1655
- ];
1656
- function IdDocumentManualUpload(props) {
1657
- const { t } = useTranslation(["common", "individual"]);
1658
- const { data, id, name, errors, valid, handleFieldChange, country, formVerificationErrors, fieldValidationErrors } = props;
1659
- if (!handleFieldChange) return;
1660
- const isOptional = !(formVerificationErrors && Object.keys(formVerificationErrors)?.length === 0);
1661
- const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
1662
- const hasBackPage = (documentType) => {
1663
- if (documentType) return idDocumentTypeOptions.find(({ id }) => documentType === id)?.hasBackPage;
1664
- };
1665
- const hasBack = hasBackPage(data?.idDocumentType);
1666
- const formUtils = createFormUtils(props, t);
1667
- return /* @__PURE__ */ jsxs("div", {
1668
- className: IdDocumentUpload_module_default.individualDocumentUpload,
1669
- children: [
1670
- /* @__PURE__ */ jsx(Header, { title: t(($) => $["idDocument"]) }),
1671
- /* @__PURE__ */ jsx(ErrorPanel, {
1672
- verificationErrors: formVerificationErrors,
1673
- validationErrors: fieldValidationErrors,
1674
- formUtils,
1675
- id: "ariaErrorField"
1676
- }),
1677
- /* @__PURE__ */ jsx("div", {
1678
- className: IdDocumentUpload_module_default.individualDocumentUploadSubtitle,
1679
- children: /* @__PURE__ */ jsx(Trans, {
1680
- t,
1681
- i18nKey: ($) => $["idUploadDocumentSubtitle"],
1682
- values: { name }
1683
- })
1684
- }),
1685
- /* @__PURE__ */ jsx(Field, {
1686
- name: "idDocumentType",
1687
- label: t(($) => $["selectDocumentType"]),
1688
- errorMessage: formatValidationError(errors?.idDocumentType?.errorMessage, t),
1689
- isValid: valid?.idDocumentType,
1690
- children: (childProps) => /* @__PURE__ */ jsx(Select, {
1691
- ...childProps,
1692
- onChange: handleFieldChange("idDocumentType", "input"),
1693
- name: "idDocumentType",
1694
- placeholder: t(($) => $["selectDocument"]),
1695
- selected: data?.idDocumentType,
1696
- items: idDocumentTypeOptions.map(({ id, name }) => ({
1697
- id,
1698
- name: t(($) => $[name])
1699
- }))
1700
- })
1701
- }),
1702
- /* @__PURE__ */ jsxs("div", {
1703
- className: IdDocumentUpload_module_default.individualDocumentUploadSubtitle,
1704
- children: [" ", t(($) => $["requirements"])]
1705
- }),
1706
- /* @__PURE__ */ jsxs("ul", { children: [
1707
- /* @__PURE__ */ jsx("li", { children: t(($) => $["documentNotExpiredOrDamaged"], { ns: "individual" }) }),
1708
- /* @__PURE__ */ jsx("li", { children: hasBackPage(data?.idDocumentType) ? t(($) => $["includeFrontAndBack"], { ns: "individual" }) : t(($) => $["providePageWithPhotoAndCode"], { ns: "individual" }) }),
1709
- /* @__PURE__ */ jsx("li", { children: t(($) => $["fullDocumentVisible"], { ns: "individual" }) }),
1710
- /* @__PURE__ */ jsx("li", { children: t(($) => $["imagesInColor"], { ns: "individual" }) })
1711
- ] }),
1712
- data?.idDocumentType && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DocumentGuidance, {
1713
- type: data?.idDocumentType,
1714
- className: "u-margin-y-16"
1715
- }), /* @__PURE__ */ jsx(Dropzone, {
1716
- name: "idFrontPage",
1717
- label: t(($) => $["frontPage"], { ns: "individual" }),
1718
- defaultData: data,
1719
- id,
1720
- isOptional,
1721
- shouldValidate: true,
1722
- handleFieldChange,
1723
- errors,
1724
- valid
1725
- })] }),
1726
- data?.idDocumentType && hasBack && /* @__PURE__ */ jsx("div", {
1727
- className: "u-margin-top-16",
1728
- children: /* @__PURE__ */ jsx(Dropzone, {
1729
- name: "idBackPage",
1730
- label: t(($) => $["backPage"], { ns: "individual" }),
1731
- defaultData: data,
1732
- id,
1733
- isOptional,
1734
- shouldValidate: true,
1735
- handleFieldChange,
1736
- errors,
1737
- valid
1738
- })
1739
- })
1740
- ]
1741
- });
1742
- }
1743
- //#endregion
1744
- //#region src/components/Individual/tasks/IndividualDropin/IndividualStore.tsx
1745
- /**
1746
- * A global signal to control the disabled state of the 'Next' button in the `FormFlow`.
1747
- * This is imported and updated by child components (e.g., `IdVerificationMethod`)
1748
- * to disable navigation from the parent, avoiding the need for prop drilling callbacks.
1749
- */
1750
- var isNextStepDisabled = signal(false);
1751
- //#endregion
1752
- //#region src/components/Individual/forms/IdVerification/IdVerification.tsx
1753
- var containerId = "adyen-kyc-id-verification";
1754
- var getOnfidoLocaleConfig = (locale, t) => {
1755
- const language = locale.substring(0, 2);
1756
- /**
1757
- * We need to do this right now because if we provide language overrides via
1758
- * {@link LocaleConfig.phrases} then {@link LocaleConfig.locale} is ignored. Therefore
1759
- * we can't currently override language within Onfido's SDK for other locales.
1760
- *
1761
- * TODO simplify once Onfido has fixed their SDK to respect the value of `locale`.
1762
- */
1763
- return language === "en" ? {
1764
- locale: language,
1765
- phrases: {
1766
- "country_select.button_primary": t(($) => $["continue"]),
1767
- "doc_submit.title_id_back": t(($) => $["identityCardBack"]),
1768
- "doc_submit.title_id_front": t(($) => $["identityCardFront"]),
1769
- "doc_submit.title_license_back": t(($) => $["drivinglicenseBack"]),
1770
- "doc_submit.title_license_front": t(($) => $["drivinglicenseFront"]),
1771
- "doc_submit.title_passport": t(($) => $["passportPhotoPage"]),
1772
- "doc_submit.title_permit_back": t(($) => $["residencePermitBack"]),
1773
- "doc_submit.title_permit_front": t(($) => $["residencePermitFront"])
1774
- }
1775
- } : language;
1776
- };
1777
- var initOnfido = async ({ containerEl, token, t, locale, onIdVerificationComplete, onIdVerificationError, showMotionCapture }) => {
1778
- const steps = [{
1779
- type: "document",
1780
- options: { documentTypes: {
1781
- passport: true,
1782
- driving_licence: true,
1783
- national_identity_card: true,
1784
- residence_permit: false
1785
- } }
1786
- }, showMotionCapture ? {
1787
- type: "face",
1788
- options: { requestedVariant: "motion" }
1789
- } : void 0].filter(Boolean);
1790
- return Onfido.init({
1791
- token,
1792
- containerEl,
1793
- disableAnalytics: false,
1794
- onComplete: onIdVerificationComplete,
1795
- onError: onIdVerificationError,
1796
- steps,
1797
- language: getOnfidoLocaleConfig(locale, t)
1798
- });
1799
- };
1800
- var logger$3 = createLogger();
1801
- function IdVerification({ minimumApplicantDetails, legalEntityId, onIdVerificationError, onIdVerificationComplete }) {
1802
- const containerRef = useRef$1(null);
1803
- const { t, i18n } = useTranslation("individual");
1804
- const { data: tokenResponse, isLoading, isError } = useIdVerificationToken(minimumApplicantDetails, legalEntityId);
1805
- const onfidoSdk = useRef$1();
1806
- useEffect$1(() => {
1807
- (async () => {
1808
- if (!tokenResponse) return;
1809
- const { sdkToken, id: providerId } = tokenResponse;
1810
- if (!containerRef.current) throw new Error("No container for Onfido found");
1811
- idVerificationProviderId.value = providerId;
1812
- onfidoSdk.current = await initOnfido({
1813
- containerEl: containerRef.current,
1814
- token: sdkToken,
1815
- t,
1816
- locale: i18n.language,
1817
- onIdVerificationError,
1818
- onIdVerificationComplete,
1819
- showMotionCapture: showIndividualMotionCapture.value
1820
- });
1821
- })().catch(logger$3.error);
1822
- return async () => {
1823
- if (onfidoSdk.current) await onfidoSdk.current.tearDown();
1824
- };
1825
- }, [tokenResponse, i18n]);
1826
- return /* @__PURE__ */ jsx(LoaderWrapper, {
1827
- status: tokenResponse ? "success" : isLoading ? "loading" : isError ? "error" : "pending",
1828
- children: /* @__PURE__ */ jsx("div", {
1829
- ref: containerRef,
1830
- className: containerId
1831
- })
1832
- });
1833
- }
1834
- //#endregion
1835
- //#region src/components/Individual/forms/IdVerificationMethod/OnfidoVerificationModal/OnfidoVerificationModal.tsx
1836
- var OnfidoVerificationModal = ({ closeModal, minimumApplicantDetails, legalEntityId, onError, onComplete }) => {
1837
- const { t } = useTranslation("individual");
1838
- return /* @__PURE__ */ jsx(Modal, {
1839
- size: "medium",
1840
- onClose: closeModal,
1841
- ariaLabel: t(($) => $["identityVerification"]),
1842
- children: minimumApplicantDetails && /* @__PURE__ */ jsx(IdVerification, {
1843
- minimumApplicantDetails,
1844
- legalEntityId,
1845
- onIdVerificationComplete: onComplete,
1846
- onIdVerificationError: onError
1847
- })
1848
- });
1849
- };
1850
- //#endregion
1851
- //#region src/components/Individual/forms/IdVerificationMethod/IdVerificationMethod.tsx
1852
- var logger$2 = createLogger();
1853
- var passportFrontGreenImage = lazy(() => import("./passport-front-green-BWuD3-Fs.js"));
1854
- var idVerificationMethodFields = ["idVerificationMethod", "idDocument"];
1855
- function IdVerificationMethod(props) {
1856
- const { legalEntityId, taskType, handlers, formVerificationErrors, fieldValidationErrors, hasLiveSelfieErrorCode, isInvitedEntity } = props;
1857
- const { t: individualT, i18n } = useTranslation("individual");
1858
- const { t: commonT } = useTranslation("common");
1859
- const userEvents = useAnalyticsContext();
1860
- const { isFeatureEnabled } = useToggleContext();
1861
- const extractDocumentInformation = useExtractDocumentInformation();
1862
- const { form: { data, handleChangeFor, setFormData, setValid, valid } } = useFormContext();
1863
- const datasetUtils = datasetUtilities(i18n.language);
1864
- const existingDocument = data.idVerificationMethod?.idDocument;
1865
- const hasExistingDocument = !isEmpty$1(existingDocument);
1866
- const handleFieldChange = useCallback$1((fieldName, mode = "input") => handleChangeFor("idVerificationMethod", fieldName, mode), [handleChangeFor]);
1867
- useDataset(datasetIdentifier.country);
1868
- const [status, setStatus] = useState$1("ready");
1869
- const [error, setError] = useState$1();
1870
- const [showLoadingSpinner, setShowLoadingSpinner] = useState$1(false);
1871
- const clearError = () => setError(void 0);
1872
- const [ocrExtractedData, setOcrExtractedData] = useState$1(void 0);
1873
- const allowedCountries = useAllowedCountries();
1874
- const { isSettingEnabled } = useSettingsContext();
1875
- const canEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
1876
- const restrictCountryOfResidenceTo = useMemo$1(() => {
1877
- if (isDecisionMakerTask(taskType)) return;
1878
- if (!canEditPrefilledCountry) return [data.additionalPersonalDetails.country];
1879
- return allowedCountries;
1880
- }, [
1881
- allowedCountries,
1882
- canEditPrefilledCountry,
1883
- data.additionalPersonalDetails,
1884
- taskType
1885
- ]);
1886
- const extractedData = useMemo$1(() => ocrExtractedData ? mapExtractionResultToSchema(ocrExtractedData, restrictCountryOfResidenceTo) : void 0, [ocrExtractedData, restrictCountryOfResidenceTo]);
1887
- const comparableExistingData = useMemo$1(() => toIndividualConflictSchema(data), [data]);
1888
- const comparableExtractedData = useMemo$1(() => extractedData ? toIndividualConflictSchema(extractedData) : void 0, [extractedData]);
1889
- const conflictRules = useMemo$1(() => ({ address: createAddressConflictRule(datasetUtils) }), [datasetUtils]);
1890
- const onAutoResolve = (resolvedData) => {
1891
- const resolvedSchema = fromIndividualConflictSchema(resolvedData);
1892
- setFormData("basicDetails", {
1893
- ...data.basicDetails,
1894
- ...resolvedSchema.basicDetails
1895
- });
1896
- setFormData("additionalPersonalDetails", resolvedSchema.additionalPersonalDetails);
1897
- setOcrExtractedData(void 0);
1898
- handlers.handleContinueToAdditionalDetails();
1899
- };
1900
- const { hasConflicts, conflictingProperties, resolvedData } = useDataConflicts(comparableExistingData, comparableExtractedData, conflictRules, onAutoResolve);
1901
- const minimumApplicantDetails = {
1902
- firstName: data.basicDetails?.firstName,
1903
- lastName: data.basicDetails?.lastName,
1904
- residencyCountry: data.additionalPersonalDetails?.country
1905
- };
1906
- const { registerFieldAction, unregisterFieldAction } = useFormRouterContext();
1907
- const launchOnfido = useCallback$1(() => {
1908
- clearError();
1909
- userEvents.addPageEvent("Clicked button", {
1910
- actionType: "add",
1911
- label: "instantVerification",
1912
- returnValue: "launchingOnfido"
1913
- });
1914
- setStatus("onfidoModal");
1915
- handleFieldChange("idVerificationMethod")("instantVerification");
1916
- }, [userEvents, handleFieldChange]);
1917
- useEffect$1(() => {
1918
- if (hasLiveSelfieErrorCode) {
1919
- registerFieldAction("idDocument", launchOnfido);
1920
- return () => unregisterFieldAction("idDocument");
1921
- }
1922
- }, [
1923
- registerFieldAction,
1924
- unregisterFieldAction,
1925
- launchOnfido,
1926
- hasLiveSelfieErrorCode
1927
- ]);
1928
- const handleOnfidoComplete = async (onfidoResult) => {
1929
- clearError();
1930
- setShowLoadingSpinner(true);
1931
- setStatus("extractionLoading");
1932
- const documentIds = [onfidoResult.document_front.id];
1933
- if (onfidoResult.document_back) documentIds.push(onfidoResult.document_back.id);
1934
- try {
1935
- const extractionResult = await extractDocumentInformation.mutateAsync({ documents: documentIds.map((documentId) => ({ documentId })) });
1936
- const validationError = validateExtractionResult(extractionResult);
1937
- if (validationError) {
1938
- setError(validationError);
1939
- setStatus("ready");
1940
- return;
1941
- }
1942
- setOcrExtractedData(extractionResult);
1943
- handleFieldChange("idDocument")({
1944
- instantIdVerificationData: onfidoResult,
1945
- idDocumentType: onfidoResult.document_front.type,
1946
- modificationDate: (/* @__PURE__ */ new Date()).toISOString(),
1947
- documentCountry: extractionResult.issuingCountry
1948
- });
1949
- setStatus("ready");
1950
- } catch (err) {
1951
- handleOnfidoExtractionError(err);
1952
- handleFieldChange("idDocument")({
1953
- instantIdVerificationData: onfidoResult,
1954
- idDocumentType: onfidoResult.document_front.type,
1955
- modificationDate: (/* @__PURE__ */ new Date()).toISOString()
1956
- });
1957
- } finally {
1958
- setShowLoadingSpinner(false);
1959
- }
1960
- };
1961
- const handleOnfidoExtractionError = (error) => {
1962
- logger$2.error("Onfido extraction error", error);
1963
- userEvents.addPageEvent("Encountered error", {
1964
- actionType: "submit",
1965
- returnType: "onfido",
1966
- returnValue: "weCouldNotExtractDocumentInformation"
1967
- });
1968
- setStatus("ready");
1969
- };
1970
- const handleOnfidoError = (error) => {
1971
- logger$2.error("Onfido error", error);
1972
- setError({ key: "weCouldNotReachOnfido" });
1973
- userEvents.addPageEvent("Encountered error", {
1974
- actionType: "submit",
1975
- returnType: "onfido",
1976
- returnValue: "weCouldNotReachOnfido"
1977
- });
1978
- setStatus("ready");
1979
- };
1980
- const handleDataConflictsResolved = (resolved) => {
1981
- const resolvedSchema = fromIndividualConflictSchema(resolved);
1982
- setFormData("basicDetails", {
1983
- ...data.basicDetails,
1984
- ...resolvedSchema.basicDetails
1985
- });
1986
- setFormData("additionalPersonalDetails", resolvedSchema.additionalPersonalDetails);
1987
- setOcrExtractedData(void 0);
1988
- setStatus("ready");
1989
- userEvents.addPageEvent("Success", {
1990
- actionType: "submit",
1991
- returnType: "ocrExtraction",
1992
- returnValue: "resolvedConflictsAfterOcrExtraction"
1993
- });
1994
- handlers.handleContinueToAdditionalDetails();
1995
- };
1996
- const handleContinueViaManualEntryFlow = () => {
1997
- handleFieldChange("idVerificationMethod")("manualVerification");
1998
- userEvents.addPageEvent("Clicked button", {
1999
- actionType: "submit",
2000
- label: "addDetailsManually"
2001
- });
2002
- handlers.handleContinueToAdditionalDetails();
2003
- };
2004
- const handleVerifyByInvite = () => {
2005
- handleFieldChange("idVerificationMethod")("verifyByInvite");
2006
- userEvents.addPageEvent("Clicked button", {
2007
- actionType: "add",
2008
- label: "verifyByInvite"
2009
- });
2010
- handlers.handleContinueToInviteDetails?.();
2011
- };
2012
- const handleDeleteDocument = () => {
2013
- setStatus("ready");
2014
- if (hasExistingDocument) {
2015
- handlers.handleDeleteDocument();
2016
- userEvents.addPageEvent("Clicked button", {
2017
- actionType: "remove",
2018
- label: "deleteDocument"
2019
- });
2020
- handleFieldChange("idDocument")(void 0);
2021
- handleFieldChange("idVerificationMethod")(void 0);
2022
- }
2023
- };
2024
- if (hasLiveSelfieErrorCode && (data.idVerificationMethod?.idVerificationMethod !== "instantVerification" || !data.idVerificationMethod?.idDocument?.instantIdVerificationData) && valid.idVerificationMethod?.idVerificationMethod) setValid("idVerificationMethod", "idVerificationMethod", false);
2025
- const doesUserHaveExistingDocument = hasLiveSelfieErrorCode && (data.idVerificationMethod?.idVerificationMethod !== "instantVerification" || !data.idVerificationMethod?.idDocument?.instantIdVerificationData) ? false : hasExistingDocument;
2026
- const handleCancelDeleteDocument = () => {
2027
- setStatus("ready");
2028
- userEvents.addPageEvent("Clicked button", {
2029
- actionType: "cancel",
2030
- label: "cancelDeleteDocument"
2031
- });
2032
- };
2033
- const handleCancelAddDetailsManually = () => {
2034
- setStatus("ready");
2035
- userEvents.addPageEvent("Clicked button", {
2036
- actionType: "cancel",
2037
- label: "cancelAddDetailsManually"
2038
- });
2039
- };
2040
- const handleUpdateExistingDocument = () => {
2041
- userEvents.addPageEvent("Clicked button", {
2042
- actionType: "change",
2043
- label: "updateExistingDocument"
2044
- });
2045
- launchOnfido();
2046
- handlers.handleUpdateDocument();
2047
- };
2048
- const modalProvidedData = resolvedData || comparableExistingData;
2049
- const formUtils = createFormUtils(props, commonT);
2050
- const showInviteOption = isFeatureEnabled("EnableVerifyByInvite") && isDecisionMakerTask(taskType) && !isInvitedEntity;
2051
- const verifyIdentityDescription = showInviteOption ? individualT(($) => $["weNeedToVerifyTheDecisionMakersIdentity"]) : showIndividualMotionCapture?.value ? individualT(($) => $["toHelpProtectAgainstFraudAndKeepOurServices"]) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
2052
- commonT(($) => $["takeOrUploadAPhoto"]),
2053
- " ",
2054
- /* @__PURE__ */ jsx(Link, {
2055
- href: "https://onfido.com",
2056
- external: true,
2057
- inline: true,
2058
- children: commonT(($) => $["onfido"])
2059
- })
2060
- ] });
2061
- isNextStepDisabled.value = showLoadingSpinner;
2062
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
2063
- /* @__PURE__ */ jsx(ErrorPanel, {
2064
- verificationErrors: formVerificationErrors,
2065
- validationErrors: fieldValidationErrors,
2066
- formUtils,
2067
- id: "ariaErrorField"
2068
- }),
2069
- /* @__PURE__ */ jsx(LandingLayout, {
2070
- media: /* @__PURE__ */ jsx(Image, {
2071
- className: IdVerificationMethod_module_default.verificationHeaderImage,
2072
- lazyLoadedImage: passportFrontGreenImage
2073
- }),
2074
- title: individualT(($) => $["verifyIdentity"]),
2075
- description: verifyIdentityDescription,
2076
- error: error ? /* @__PURE__ */ jsx(Alert, {
2077
- variant: "error",
2078
- title: commonT(($) => $[error.key], { ...error.options?.values })
2079
- }) : void 0,
2080
- actions: /* @__PURE__ */ jsx(Fragment$1, { children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : !doesUserHaveExistingDocument && /* @__PURE__ */ jsxs(Fragment$1, { children: [
2081
- /* @__PURE__ */ jsx(Button, {
2082
- fullWidth: true,
2083
- onClick: launchOnfido,
2084
- disabled: status === "extractionLoading",
2085
- loading: status === "extractionLoading",
2086
- children: individualT(($) => $["getVerifiedInstantly"])
2087
- }),
2088
- !showIndividualMotionCapture?.value && /* @__PURE__ */ jsx(Button, {
2089
- onClick: () => setStatus("confirmManualFlowModal"),
2090
- variant: "secondary",
2091
- fullWidth: true,
2092
- children: commonT(($) => $["addDetailsManually"])
2093
- }),
2094
- showInviteOption && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
2095
- className: IdVerificationMethod_module_default.orSeparator,
2096
- children: individualT(($) => $["or"])
2097
- }), /* @__PURE__ */ jsx(Button, {
2098
- onClick: handleVerifyByInvite,
2099
- variant: "secondary",
2100
- fullWidth: true,
2101
- children: individualT(($) => $["inviteDecisionMaker"])
2102
- })] })
2103
- ] }) }),
2104
- content: !showLoadingSpinner && doesUserHaveExistingDocument && /* @__PURE__ */ jsx(UploadedDocument, {
2105
- document: existingDocument,
2106
- onDelete: () => setStatus("confirmDeleteDocumentModal"),
2107
- onUpdate: handleUpdateExistingDocument
2108
- }),
2109
- disclaimer: !doesUserHaveExistingDocument && /* @__PURE__ */ jsx(Trans, {
2110
- t: individualT,
2111
- ns: "individual",
2112
- i18nKey: ($) => $["byContinuingWithInstantVerification"],
2113
- components: {
2114
- facialScanLink: /* @__PURE__ */ jsx(Link, {
2115
- href: "https://onfido.com/facial-scan-policy-and-release/",
2116
- external: true,
2117
- inline: true
2118
- }),
2119
- privacyLink: /* @__PURE__ */ jsx(Link, {
2120
- href: "https://onfido.com/privacy/",
2121
- external: true,
2122
- inline: true
2123
- }),
2124
- termsLink: /* @__PURE__ */ jsx(Link, {
2125
- href: "https://onfido.com/terms-of-service/",
2126
- external: true,
2127
- inline: true
2128
- })
2129
- }
2130
- })
2131
- }),
2132
- status === "onfidoModal" && /* @__PURE__ */ jsx(OnfidoVerificationModal, {
2133
- closeModal: () => setStatus("ready"),
2134
- onError: handleOnfidoError,
2135
- onComplete: handleOnfidoComplete,
2136
- minimumApplicantDetails,
2137
- legalEntityId
2138
- }),
2139
- status === "confirmManualFlowModal" && /* @__PURE__ */ jsx(Confirm, {
2140
- title: individualT(($) => $["addDetailsManuallyQuestion"]),
2141
- description: individualT(($) => $["itCanTakeUpTo"]),
2142
- onCancel: handleCancelAddDetailsManually,
2143
- confirmText: individualT(($) => $["yesAddManually"]),
2144
- onConfirm: handleContinueViaManualEntryFlow
2145
- }),
2146
- status === "confirmDeleteDocumentModal" && /* @__PURE__ */ jsx(Confirm, {
2147
- title: individualT(($) => $["deleteIdDocument"]),
2148
- description: individualT(($) => $["youMayBeAskedToReUpload"]),
2149
- confirmText: commonT(($) => $["deleteDocument"]),
2150
- onCancel: handleCancelDeleteDocument,
2151
- onConfirm: handleDeleteDocument,
2152
- critical: true
2153
- }),
2154
- hasConflicts && comparableExtractedData ? /* @__PURE__ */ jsx(DataConflictsModal, {
2155
- providedData: modalProvidedData,
2156
- detectedData: comparableExtractedData,
2157
- conflictingProperties,
2158
- formatters: { address: (val) => addressToString(val, datasetUtils) },
2159
- title: individualT(($) => $["confirmPersonalDetails"]),
2160
- explanation: individualT(($) => $["theDetailsYouEnteredDontMatch"]),
2161
- cancelConfirmation: {
2162
- title: individualT(($) => $["leaveInstantVerification"]),
2163
- confirmText: individualT(($) => $["leaveVerification"]),
2164
- description: individualT(($) => $["anyInformationFromTheUploadedDocumentWillBeLost"])
2165
- },
2166
- onContinue: handleDataConflictsResolved,
2167
- onCancel: () => {
2168
- handleFieldChange("idDocument")(void 0);
2169
- setOcrExtractedData(void 0);
2170
- handleFieldChange("idVerificationMethod")(void 0);
2171
- }
2172
- }) : void 0
2173
- ] });
2174
- }
2175
- //#endregion
2176
- //#region src/components/Individual/forms/InviteDetails/utils.ts
2177
- var isPhoneNumberMobile = (phoneNumber) => {
2178
- const phoneCountryCode = phoneNumber?.phoneCountryCode ? phoneNumber?.phoneCountryCode : void 0;
2179
- const parsedPhoneNumber = parsePhoneNumber(phoneNumber.number, phoneCountryCode);
2180
- return Boolean(parsedPhoneNumber && (parsedPhoneNumber.getType() === "MOBILE" || parsedPhoneNumber.getType() === "FIXED_LINE_OR_MOBILE"));
2181
- };
2182
- var inviteDetailsFields = [
2183
- "senderName",
2184
- "message",
2185
- "email",
2186
- "phoneNumber"
2187
- ];
2188
- function InviteDetails(props) {
2189
- const { t } = useTranslation("individual");
2190
- const { t: commonT } = useTranslation("common");
2191
- const { form: { data: formData, handleChangeFor: handleBasicDetailsChangeFor } } = useFormContext();
2192
- const { country, data, errors = {}, fieldValidationErrors, handleFieldChange, heading, recipientFirstName, valid = {} } = props;
2193
- const phoneMetadata = resolveFieldMetadata(fieldConfig[data?.phoneNumber?.phoneCountryCode ?? country], {}, defaultFieldMetadata);
2194
- const formUtils = createFormUtils(mergeFieldMetadataIntoProps("phoneNumber", {
2195
- label: phoneMetadata.label,
2196
- mask: phoneMetadata.mask
2197
- }, props), commonT);
2198
- const basicDetails = formData.basicDetails ?? {};
2199
- const handleEmailChange = useCallback$1((mode) => (e) => {
2200
- handleFieldChange?.("email", mode)(e);
2201
- handleBasicDetailsChangeFor("basicDetails", "email", mode)(e);
2202
- }, [handleFieldChange, handleBasicDetailsChangeFor]);
2203
- const handlePhoneChange = useCallback$1((key, mode) => (e) => {
2204
- handleFieldChange?.(key, mode)(e);
2205
- handleBasicDetailsChangeFor("basicDetails", key, mode)(e);
2206
- }, [handleFieldChange, handleBasicDetailsChangeFor]);
2207
- useEffect$1(() => {
2208
- if (!handleFieldChange) return;
2209
- handleFieldChange("email", "input")(data?.email);
2210
- if (!data?.phoneNumber || !isPhoneNumberMobile(data.phoneNumber)) {
2211
- handleFieldChange("phoneNumber", "input")({
2212
- number: "",
2213
- phoneCountryCode: country,
2214
- type: "mobile"
2215
- });
2216
- handleBasicDetailsChangeFor("basicDetails", "phoneNumber", "input")({
2217
- number: "",
2218
- phoneCountryCode: country,
2219
- type: "mobile"
2220
- });
2221
- } else handleFieldChange("phoneNumber", "input")(data?.phoneNumber);
2222
- }, []);
2223
- const emailValue = data?.email ?? basicDetails.email ?? "";
2224
- const phoneValue = data?.phoneNumber ?? basicDetails?.phoneNumber;
2225
- if (!handleFieldChange) return null;
2226
- return /* @__PURE__ */ jsxs("form", { children: [
2227
- /* @__PURE__ */ jsx(Header, {
2228
- title: heading ?? t(($) => $["inviteDetails"]),
2229
- description: t(($) => $["checkThatContactInfoIsCorrect"], { name: recipientFirstName })
2230
- }),
2231
- /* @__PURE__ */ jsx(Field, {
2232
- name: "email",
2233
- label: commonT(($) => $["email"]),
2234
- errorMessage: formUtils.getErrorMessage("email", errors, fieldValidationErrors),
2235
- helper: t(($) => $.wellSendTheInvitationToThisAddress),
2236
- helperPosition: "below",
2237
- isValid: valid.email,
2238
- children: (childProps) => /* @__PURE__ */ jsx(InputEmail, {
2239
- ...childProps,
2240
- name: "email",
2241
- value: emailValue,
2242
- onInput: handleEmailChange("input"),
2243
- onBlur: handleEmailChange("blur"),
2244
- "aria-required": true,
2245
- "aria-invalid": valid.email === false
2246
- })
2247
- }),
2248
- /* @__PURE__ */ jsx(PhoneField, {
2249
- country,
2250
- data: { phoneNumber: phoneValue },
2251
- valid: { phoneNumber: valid.phoneNumber ?? true },
2252
- errors: { phoneNumber: formatValidationError(errors.phoneNumber?.errorMessage, commonT) },
2253
- label: t(($) => $["mobileNumber"]),
2254
- placeholder: getPhonePlaceholder(country),
2255
- optional: false,
2256
- readonly: false,
2257
- handleChangeFor: handlePhoneChange,
2258
- mask: formUtils.getMask("phoneNumber"),
2259
- helper: t(($) => $["wellUseThisNumberToSendAOneTimeVerificationCode"]),
2260
- helperPosition: "below"
2261
- }),
2262
- /* @__PURE__ */ jsx(Field, {
2263
- name: "senderName",
2264
- label: t(($) => $["sender"]),
2265
- errorMessage: formUtils.getErrorMessage("senderName", errors, fieldValidationErrors),
2266
- isValid: valid.senderName,
2267
- children: (childProps) => /* @__PURE__ */ jsx(InputText, {
2268
- ...childProps,
2269
- name: "senderName",
2270
- value: data?.senderName,
2271
- placeholder: t(($) => $["name"]),
2272
- maxLength: 30,
2273
- onInput: handleFieldChange("senderName", "input"),
2274
- onBlur: handleFieldChange("senderName", "blur"),
2275
- "aria-required": true,
2276
- "aria-invalid": !valid.senderName
2277
- })
2278
- }),
2279
- /* @__PURE__ */ jsx(Field, {
2280
- name: "message",
2281
- errorMessage: formUtils.getErrorMessage("message", errors, fieldValidationErrors),
2282
- isValid: valid.message,
2283
- helper: t(($) => $["thisMessageAppearsInTheEmail"]),
2284
- helperPosition: "below",
2285
- children: (childProps) => /* @__PURE__ */ jsx(TextArea, {
2286
- ...childProps,
2287
- name: "message",
2288
- value: data?.message,
2289
- placeholder: t(($) => $["message"]),
2290
- maxLength: 200,
2291
- onInput: handleFieldChange("message", "input"),
2292
- onBlur: handleFieldChange("message", "blur"),
2293
- "aria-required": true,
2294
- "aria-invalid": !valid.message
2295
- })
2296
- })
2297
- ] });
2298
- }
2299
- //#endregion
2300
- //#region src/components/Individual/forms/ManualIdUpload/ManualIdUpload.tsx
2301
- var ManualIdUpload = () => {
2302
- const { form } = useFormContext();
2303
- const { handleChangeFor } = form;
2304
- const data = form.data.manualIdUpload;
2305
- const valid = form.valid.manualIdUpload;
2306
- const errors = form.errors.manualIdUpload;
2307
- const name = `${form.data.basicDetails?.firstName} ${form.data.basicDetails?.lastName}`;
2308
- const country = form.data.additionalPersonalDetails?.country;
2309
- const handleFieldChange = (fieldName, mode) => handleChangeFor("manualIdUpload", fieldName, mode);
2310
- return /* @__PURE__ */ jsx(IdDocumentManualUpload, {
2311
- data,
2312
- valid,
2313
- errors,
2314
- name,
2315
- handleFieldChange,
2316
- country
2317
- });
2318
- };
2319
- //#endregion
2320
- //#region src/components/Individual/forms/ProofOfRelationship/types.ts
2321
- var ProofOfRelationshipDocumentTypes = {
2322
- BIRTH_CERTIFICATE: "birthCertificate",
2323
- GUARDIANSHIP_CERTIFICATE: "guardianshipCertificate",
2324
- ADOPTION_CERTIFICATE: "adoptionCertificate"
2325
- };
2326
- var proofOfRelationshipDocumentOptions = [
2327
- {
2328
- id: ProofOfRelationshipDocumentTypes.BIRTH_CERTIFICATE,
2329
- name: "birthCertificate"
2330
- },
2331
- {
2332
- id: ProofOfRelationshipDocumentTypes.GUARDIANSHIP_CERTIFICATE,
2333
- name: "guardianshipCertificate"
2334
- },
2335
- {
2336
- id: ProofOfRelationshipDocumentTypes.ADOPTION_CERTIFICATE,
2337
- name: "adoptionCertificate"
2338
- }
2339
- ];
2340
- //#endregion
2341
- //#region src/components/Individual/forms/ProofOfRelationship/index.tsx
2342
- function ProofOfRelationship({ id, ...props }) {
2343
- const { t } = useTranslation(["individual", "common"]);
2344
- const [proofOfRelationshipDocumentType, setProofOfRelationshipDocumentType] = useState$1(proofOfRelationshipDocumentOptions[0].id);
2345
- const proofOfResidencyGuidanceContent = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
2346
- className: "adyen-kyc-upload-field__subtitle",
2347
- children: [" ", t(($) => $["requirements"], { ns: "common" })]
2348
- }), /* @__PURE__ */ jsxs("ul", { children: [
2349
- /* @__PURE__ */ jsx("li", { children: t(($) => $["documentAddressedToName"], { name: props.name }) }),
2350
- /* @__PURE__ */ jsx("li", { children: t(($) => $["showAddressStateCountry"]) }),
2351
- /* @__PURE__ */ jsx("li", { children: t(($) => $["fullDocumentVisibleWithReadableText"]) }),
2352
- /* @__PURE__ */ jsx("li", { children: t(($) => $["documentCannotBeDamaged"]) })
2353
- ] })] });
2354
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
2355
- ...props,
2356
- documentField: "proofOfRelationship",
2357
- documentType: "proofOfRelationship",
2358
- heading: t(($) => $["proofOfRelationship"], { ns: "common" }),
2359
- guidanceHeader: /* @__PURE__ */ jsx("div", {
2360
- className: "u-margin-bottom-16",
2361
- children: t(($) => $["proofOfResidenceDocumentTypeLabel"], { name: props.name })
2362
- }),
2363
- documentTypeSelect: {
2364
- selectedType: proofOfRelationshipDocumentType,
2365
- setSelectedType: setProofOfRelationshipDocumentType,
2366
- options: proofOfRelationshipDocumentOptions
2367
- },
2368
- guidanceContent: proofOfResidencyGuidanceContent,
2369
- id
2370
- }) });
2371
- }
2372
- var MemoizedProofOfRelationship = memo(ProofOfRelationship, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.name === nextProps.name);
2373
- //#endregion
2374
- //#region src/components/Individual/forms/ProofOfResidency/types.ts
2375
- var ProofOfResidenceDocumentTypes = {
2376
- BANK_STATEMENT: "bankStatement",
2377
- UTILITY_BILL: "utilityBill",
2378
- GOVERNMENT_ISSUED_CORRESPONDENCE: "governmentIssuedCorrespondence",
2379
- TAXATION_DOCUMENT: "taxationDocument",
2380
- EXTRACT_FROM_MUNICIPAL_PERSONAL_RECORDS_DATABASE: "extractFromMunicipalPersonalRecordsDatabase",
2381
- SALARY_SLIP: "salarySlip",
2382
- MORTGAGE_STATEMENT: "mortgageStatement",
2383
- CERTIFICATE_OF_VOTER_REGISTRATION: "certificateOfVoterRegistration"
2384
- };
2385
- var proofOfResidenceDocumentOptions = [
2386
- {
2387
- id: ProofOfResidenceDocumentTypes.BANK_STATEMENT,
2388
- name: "bankStatementDocument"
2389
- },
2390
- {
2391
- id: ProofOfResidenceDocumentTypes.UTILITY_BILL,
2392
- name: "utilityBill"
2393
- },
2394
- {
2395
- id: ProofOfResidenceDocumentTypes.GOVERNMENT_ISSUED_CORRESPONDENCE,
2396
- name: "governmentIssuedCorrespondence"
2397
- },
2398
- {
2399
- id: ProofOfResidenceDocumentTypes.TAXATION_DOCUMENT,
2400
- name: "taxationDocument"
2401
- },
2402
- {
2403
- id: ProofOfResidenceDocumentTypes.EXTRACT_FROM_MUNICIPAL_PERSONAL_RECORDS_DATABASE,
2404
- name: "extractFromMunicipalPersonalRecordsDatabase"
2405
- },
2406
- {
2407
- id: ProofOfResidenceDocumentTypes.SALARY_SLIP,
2408
- name: "salarySlip"
2409
- },
2410
- {
2411
- id: ProofOfResidenceDocumentTypes.MORTGAGE_STATEMENT,
2412
- name: "mortgageStatement"
2413
- },
2414
- {
2415
- id: ProofOfResidenceDocumentTypes.CERTIFICATE_OF_VOTER_REGISTRATION,
2416
- name: "certificateOfVoterRegistration"
2417
- }
2418
- ];
2419
- //#endregion
2420
- //#region src/components/Individual/forms/ProofOfResidency/ProofOfResidency.tsx
2421
- function ProofOfResidency({ id, ...props }) {
2422
- const { t } = useTranslation(["individual", "common"]);
2423
- const [proofOfResidenceDocumentType, setProofOfResidenceDocumentType] = useState$1(proofOfResidenceDocumentOptions[0].id);
2424
- const isMortgageOrVoterRegistration = proofOfResidenceDocumentType === ProofOfResidenceDocumentTypes.MORTGAGE_STATEMENT || proofOfResidenceDocumentType === ProofOfResidenceDocumentTypes.CERTIFICATE_OF_VOTER_REGISTRATION;
2425
- const proofOfResidencyGuidanceContent = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
2426
- className: "adyen-kyc-upload-field__subtitle",
2427
- children: [" ", t(($) => $["requirements"], { ns: "common" })]
2428
- }), /* @__PURE__ */ jsxs("ul", { children: [
2429
- /* @__PURE__ */ jsx("li", { children: t(($) => $["documentAddressedToName"], { name: props.name }) }),
2430
- /* @__PURE__ */ jsx("li", { children: t(($) => $["showAddressStateCountry"]) }),
2431
- /* @__PURE__ */ jsx("li", { children: isMortgageOrVoterRegistration ? t(($) => $["dateOnDocumentNoOlderThanXMonths"], { numberOfMonths: 12 }) : t(($) => $["dateOnDocumentNoOlderThanXMonths"], { numberOfMonths: 3 }) }),
2432
- /* @__PURE__ */ jsx("li", { children: t(($) => $["fullDocumentVisibleWithReadableText"]) }),
2433
- /* @__PURE__ */ jsx("li", { children: t(($) => $["documentCannotBeDamaged"]) })
2434
- ] })] });
2435
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
2436
- ...props,
2437
- documentField: "proofOfResidency",
2438
- documentType: "proofOfResidency",
2439
- heading: t(($) => $["proofOfResidency"], { ns: "common" }),
2440
- guidanceHeader: /* @__PURE__ */ jsx("div", {
2441
- className: "u-margin-bottom-16",
2442
- children: t(($) => $["proofOfResidenceDocumentTypeLabel"], { name: props.name })
2443
- }),
2444
- documentTypeSelect: {
2445
- selectedType: proofOfResidenceDocumentType,
2446
- setSelectedType: setProofOfResidenceDocumentType,
2447
- options: proofOfResidenceDocumentOptions
2448
- },
2449
- guidanceContent: proofOfResidencyGuidanceContent,
2450
- id
2451
- }) });
2452
- }
2453
- var MemoizedProofOfResidencyUpload = memo(ProofOfResidency, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.name === nextProps.name);
2454
- //#endregion
2455
- //#region src/components/Individual/forms/SignatoryQuestionnaire/SignatoryQuestionnaireModalContent.tsx
2456
- var SignatoryQuestionnaireModalContent = () => {
2457
- const { t } = useTranslation("individual");
2458
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
2459
- /* @__PURE__ */ jsx(Typography, {
2460
- variant: "title-l",
2461
- el: "h3",
2462
- className: "u-margin-bottom-40",
2463
- children: t(($) => $["moreAboutAuthorizedSignatories"])
2464
- }),
2465
- /* @__PURE__ */ jsx(Typography, {
2466
- variant: "body-strongest",
2467
- el: "h4",
2468
- className: "u-margin-bottom-12",
2469
- children: t(($) => $["signatoryDescriptionQ1"])
2470
- }),
2471
- /* @__PURE__ */ jsx(Typography, {
2472
- el: "p",
2473
- className: "u-margin-bottom-32",
2474
- children: t(($) => $["signatoryDescriptionA1"])
2475
- }),
2476
- /* @__PURE__ */ jsx(Typography, {
2477
- variant: "body-strongest",
2478
- el: "h4",
2479
- className: "u-margin-bottom-12",
2480
- children: t(($) => $["signatoryDescriptionQ2"])
2481
- }),
2482
- /* @__PURE__ */ jsx(Typography, {
2483
- el: "p",
2484
- children: t(($) => $["signatoryDescriptionA2"])
2485
- })
2486
- ] });
2487
- };
2488
- //#endregion
2489
- //#region src/components/Individual/forms/SignatoryQuestionnaire/SignatoryQuestionnaire.tsx
2490
- function SignatoryQuestionnaire(props) {
2491
- const { t } = useTranslation(["common", "individual"]);
2492
- const handleModalAction = useModalAction();
2493
- const [isModalOpen, setIsModalOpen] = useState$1(false);
2494
- const { data, errors, formVerificationErrors, heading, fieldValidationErrors, handleFieldChange } = props;
2495
- const formUtils = createFormUtils(props, t);
2496
- if (!handleFieldChange) return;
2497
- const openModal = () => handleModalAction("isSignatoryModal", "open", setIsModalOpen);
2498
- const closeModal = () => handleModalAction("isSignatoryModal", "close", setIsModalOpen);
2499
- const errorMessage = formUtils.getErrorMessage("isSignatory", errors, fieldValidationErrors);
2500
- return /* @__PURE__ */ jsxs("form", {
2501
- "aria-describedby": "ariaErrorField",
2502
- children: [
2503
- heading && /* @__PURE__ */ jsx(Header, { title: heading }),
2504
- /* @__PURE__ */ jsx(ErrorPanel, {
2505
- verificationErrors: formVerificationErrors,
2506
- validationErrors: fieldValidationErrors,
2507
- formUtils,
2508
- id: "ariaErrorField"
2509
- }),
2510
- /* @__PURE__ */ jsx(GuidanceQuestion, {
2511
- name: "isSignatory",
2512
- value: data?.isSignatory,
2513
- onChange: handleFieldChange("isSignatory"),
2514
- onDescriptionLinkClick: openModal,
2515
- question: t(($) => $["doesThisPersonHaveTheAuthority"], { ns: "individual" }),
2516
- descriptionLinkText: t(($) => $["whatDoesThisMean"]),
2517
- errorMessage
2518
- }),
2519
- isModalOpen && /* @__PURE__ */ jsx(Modal, {
2520
- onClose: closeModal,
2521
- ariaLabel: t(($) => $["moreAboutAuthorizedSignatories"], { ns: "individual" }),
2522
- inset: true,
2523
- children: /* @__PURE__ */ jsx(SignatoryQuestionnaireModalContent, {})
2524
- })
2525
- ]
2526
- });
2527
- }
2528
- //#endregion
2529
- //#region src/hooks/useUboQuestionnaire.ts
2530
- var useGuidanceQuestionnaire = ({ data, handleFieldChange, openModal, formUtils, errors, fieldValidationErrors, country }) => {
2531
- const { t } = useTranslation(["individual"]);
2532
- const defaultQuestions = useMemo$1(() => ({
2533
- isDirector: t(($) => {
2534
- return $["isThisPersonListedAsADirector"];
2535
- }),
2536
- isOwner: t(($) => $["doesThisPersonOwn25PercentOrMoreOfBusiness"]),
2537
- isControllingPerson: t(($) => $["doesThisPersonHaveSignificantResponsibility"]),
2538
- isNomineeDirector: t(($) => $["isThisPersonANomineeDirectorAppointed"]),
2539
- isNomineeShareholder: t(($) => $["isThisPersonANomineeShareholderAppointedToHold"])
2540
- }), [t]);
2541
- const defaultDescriptionLinkTextByField = useMemo$1(() => ({
2542
- isDirector: t(($) => $["whatDoesThisMean"]),
2543
- isNomineeDirector: t(($) => $["whatDoesThisMean"]),
2544
- isOwner: t(($) => $["whatDoesThisMean"]),
2545
- isNomineeShareholder: void 0,
2546
- isControllingPerson: t(($) => $["whatDoesThisMean"])
2547
- }), [t]);
2548
- const questionsMap = useMemo$1(() => {
2549
- return { JP: {
2550
- isDirector: t(($) => $["isThisPersonARegisteredRepresentativeDirector"]),
2551
- isOwner: t(($) => $["doesThisPersonOwn25PercentOrMoreOfBusiness"]),
2552
- isControllingPerson: t(($) => $["doesThisPersonHaveSignificantResponsibility"])
2553
- } }[country] ?? {};
2554
- }, [t, country]);
2555
- return { registerGuidanceQuestion: useCallback$1((fieldName) => {
2556
- return {
2557
- name: fieldName,
2558
- value: data?.[fieldName],
2559
- onChange: handleFieldChange ? handleFieldChange(fieldName) : () => {},
2560
- onDescriptionLinkClick: fieldName !== "isNomineeShareholder" ? openModal(fieldName) : void 0,
2561
- question: questionsMap[fieldName] || defaultQuestions[fieldName],
2562
- descriptionLinkText: defaultDescriptionLinkTextByField[fieldName],
2563
- errorMessage: formUtils.getErrorMessage(fieldName, errors, fieldValidationErrors)
2564
- };
2565
- }, [
2566
- data,
2567
- defaultDescriptionLinkTextByField,
2568
- defaultQuestions,
2569
- errors,
2570
- fieldValidationErrors,
2571
- formUtils,
2572
- handleFieldChange,
2573
- openModal,
2574
- questionsMap
2575
- ]) };
2576
- };
2577
- var UboQuestionnaireModalContent_module_default = {
2578
- "questionnaire-modal-content": "_questionnaire-modal-content_8je6c_1",
2579
- questionnaireModalContent: "_questionnaire-modal-content_8je6c_1",
2580
- "questionnaire-list": "_questionnaire-list_8je6c_5",
2581
- questionnaireList: "_questionnaire-list_8je6c_5"
2582
- };
2583
- //#endregion
2584
- //#region src/components/Individual/forms/UboQuestionnaire/UboQuestionnaireModalContent.tsx
2585
- var UboQuestionnaireModalContent = ({ modalType, country }) => {
2586
- const { t } = useTranslation("individual");
2587
- switch (modalType) {
2588
- case "isOwner": return /* @__PURE__ */ jsxs("div", {
2589
- className: UboQuestionnaireModalContent_module_default.questionnaireModalContent,
2590
- children: [
2591
- /* @__PURE__ */ jsx(Typography, {
2592
- variant: "title-l",
2593
- el: "h3",
2594
- className: "u-margin-bottom-40",
2595
- children: t(($) => $["moreAboutOwners"])
2596
- }),
2597
- /* @__PURE__ */ jsx(Typography, {
2598
- variant: "body-strongest",
2599
- el: "h4",
2600
- className: "u-margin-bottom-12",
2601
- children: t(($) => $["ownersDescriptionQ1"])
2602
- }),
2603
- /* @__PURE__ */ jsx(Typography, {
2604
- el: "p",
2605
- children: t(($) => $["ownersDescriptionA1P1"])
2606
- }),
2607
- /* @__PURE__ */ jsx(Typography, {
2608
- el: "p",
2609
- className: "u-margin-bottom-32",
2610
- children: t(($) => $["ownersDescriptionA1P2"])
2611
- }),
2612
- /* @__PURE__ */ jsx(Alert, {
2613
- title: t(($) => $["ownersDescriptionAlertTitle"]),
2614
- icon: false,
2615
- className: "u-margin-bottom-32",
2616
- children: t(($) => $["ownersDescriptionAlertContent"])
2617
- }),
2618
- /* @__PURE__ */ jsx(Typography, {
2619
- variant: "body-strongest",
2620
- el: "h4",
2621
- className: "u-margin-bottom-12",
2622
- children: t(($) => $["ownersDescriptionQ2"])
2623
- }),
2624
- /* @__PURE__ */ jsx(Typography, {
2625
- el: "p",
2626
- children: t(($) => $["ownersDescriptionA2P1"])
2627
- }),
2628
- /* @__PURE__ */ jsx(Typography, {
2629
- el: "p",
2630
- className: "u-margin-bottom-32",
2631
- children: t(($) => $["ownersDescriptionA2P2"])
2632
- }),
2633
- /* @__PURE__ */ jsx(Typography, {
2634
- variant: "body-strongest",
2635
- el: "h4",
2636
- className: "u-margin-bottom-12",
2637
- children: t(($) => $["ownersDescriptionQ3"])
2638
- }),
2639
- /* @__PURE__ */ jsx(Typography, {
2640
- el: "p",
2641
- className: "u-margin-bottom-32",
2642
- children: t(($) => $["ownersDescriptionA3"])
2643
- }),
2644
- /* @__PURE__ */ jsx(Typography, {
2645
- variant: "body-strongest",
2646
- el: "h4",
2647
- className: "u-margin-bottom-12",
2648
- children: t(($) => $["ownersDescriptionQ4"])
2649
- }),
2650
- /* @__PURE__ */ jsx(Typography, {
2651
- el: "p",
2652
- className: "u-margin-bottom-32",
2653
- children: t(($) => $["ownersDescriptionA4"])
2654
- })
2655
- ]
2656
- });
2657
- case "isControllingPerson": return /* @__PURE__ */ jsxs("div", {
2658
- className: UboQuestionnaireModalContent_module_default.questionnaireModalContent,
2659
- children: [
2660
- /* @__PURE__ */ jsx(Typography, {
2661
- variant: "title-l",
2662
- el: "h3",
2663
- className: "u-margin-bottom-40",
2664
- children: t(($) => $["moreAboutOwnershipThroughControl"])
2665
- }),
2666
- /* @__PURE__ */ jsx(Typography, {
2667
- variant: "body-strongest",
2668
- el: "h4",
2669
- className: "u-margin-bottom-12",
2670
- children: t(($) => $["controllingPersonDescriptionQ1"])
2671
- }),
2672
- /* @__PURE__ */ jsx(Typography, {
2673
- el: "p",
2674
- className: "u-margin-bottom-16",
2675
- children: t(($) => $["controllingPersonDescriptionA1P1"])
2676
- }),
2677
- /* @__PURE__ */ jsxs("ul", {
2678
- className: UboQuestionnaireModalContent_module_default.questionnaireList,
2679
- children: [
2680
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, {
2681
- t,
2682
- i18nKey: ($) => $["controllingPersonDescriptionA1L1"]
2683
- }) }),
2684
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, {
2685
- t,
2686
- i18nKey: ($) => $["controllingPersonDescriptionA1L2"]
2687
- }) }),
2688
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, {
2689
- t,
2690
- i18nKey: ($) => $["controllingPersonDescriptionA1L3"]
2691
- }) }),
2692
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, {
2693
- t,
2694
- i18nKey: ($) => $["controllingPersonDescriptionA1L4"]
2695
- }) })
2696
- ]
2697
- }),
2698
- /* @__PURE__ */ jsx(Alert, {
2699
- title: t(($) => $["ownersDescriptionAlertTitle"]),
2700
- icon: false,
2701
- className: "u-margin-bottom-32",
2702
- children: t(($) => $["controllingPersonDescriptionAlertContent"])
2703
- }),
2704
- /* @__PURE__ */ jsx(Typography, {
2705
- variant: "body-strongest",
2706
- el: "h4",
2707
- className: "u-margin-bottom-12",
2708
- children: t(($) => $["ownersDescriptionQ4"])
2709
- }),
2710
- /* @__PURE__ */ jsx(Typography, {
2711
- el: "p",
2712
- children: t(($) => $["ownersDescriptionA4"])
2713
- }),
2714
- /* @__PURE__ */ jsx(Typography, {
2715
- variant: "body-strongest",
2716
- el: "h4",
2717
- className: "u-margin-bottom-12",
2718
- children: t(($) => $["controllingPersonDescriptionQ2"])
2719
- }),
2720
- /* @__PURE__ */ jsx(Typography, {
2721
- el: "p",
2722
- className: "u-margin-bottom-32",
2723
- children: t(($) => $["controllingPersonDescriptionA2"])
2724
- })
2725
- ]
2726
- });
2727
- case "isDirector":
2728
- if (country === "JP") return /* @__PURE__ */ jsxs("div", {
2729
- className: UboQuestionnaireModalContent_module_default.questionnaireModalContent,
2730
- children: [
2731
- /* @__PURE__ */ jsx(Typography, {
2732
- variant: "title-l",
2733
- el: "h3",
2734
- className: "u-margin-bottom-40",
2735
- children: t(($) => $["moreAboutRegisteredRepresentativeDirectors"])
2736
- }),
2737
- /* @__PURE__ */ jsx(Typography, {
2738
- variant: "body-strongest",
2739
- el: "h4",
2740
- className: "u-margin-bottom-12",
2741
- children: t(($) => $["whatIsARegisteredRepresentativeDirector"])
2742
- }),
2743
- /* @__PURE__ */ jsx(Typography, {
2744
- el: "p",
2745
- className: "u-margin-bottom-32",
2746
- children: t(($) => $["directorIsANaturalPerson"])
2747
- }),
2748
- /* @__PURE__ */ jsx(Typography, {
2749
- variant: "body-strongest",
2750
- el: "h4",
2751
- className: "u-margin-bottom-12",
2752
- children: t(($) => $["canABusinessHaveMultipleRegisteredRepresentativeDirectors"])
2753
- }),
2754
- /* @__PURE__ */ jsx(Typography, {
2755
- el: "p",
2756
- children: t(($) => $["aBusinessCanHaveManyDirectors"])
2757
- })
2758
- ]
2759
- });
2760
- return /* @__PURE__ */ jsxs("div", {
2761
- className: UboQuestionnaireModalContent_module_default.questionnaireModalContent,
2762
- children: [
2763
- /* @__PURE__ */ jsx(Typography, {
2764
- variant: "title-l",
2765
- el: "h3",
2766
- className: "u-margin-bottom-40",
2767
- children: t(($) => $["moreAboutDirectors"])
2768
- }),
2769
- /* @__PURE__ */ jsx(Typography, {
2770
- variant: "body-strongest",
2771
- el: "h4",
2772
- className: "u-margin-bottom-12",
2773
- children: t(($) => $["directorDescriptionQ1"])
2774
- }),
2775
- /* @__PURE__ */ jsx(Typography, {
2776
- el: "p",
2777
- className: "u-margin-bottom-32",
2778
- children: t(($) => $["directorDescriptionA1"])
2779
- }),
2780
- /* @__PURE__ */ jsx(Typography, {
2781
- variant: "body-strongest",
2782
- el: "h4",
2783
- className: "u-margin-bottom-12",
2784
- children: t(($) => $["directorDescriptionQ2"])
2785
- }),
2786
- /* @__PURE__ */ jsx(Typography, {
2787
- el: "p",
2788
- children: t(($) => $["directorDescriptionA2"])
2789
- })
2790
- ]
2791
- });
2792
- default: return null;
2793
- }
2794
- };
2795
- //#endregion
2796
- //#region src/components/Individual/forms/UboQuestionnaire/UboQuestionnaire.tsx
2797
- var uboQuestionnaireFields = [
2798
- "isOwner",
2799
- "isControllingPerson",
2800
- "isDirector",
2801
- "isNomineeDirector",
2802
- "isNomineeShareholder"
2803
- ];
2804
- function UboQuestionnaire(props) {
2805
- const { t } = useTranslation(["common"]);
2806
- const { t: individualT } = useTranslation(["individual"]);
2807
- const handleModalAction = useModalAction();
2808
- const { data, description, errors, formVerificationErrors, heading, fieldValidationErrors, handleFieldChange, country } = props;
2809
- const formUtils = createFormUtils(props, t);
2810
- const [activeModal, setActiveModal] = useState$1(null);
2811
- const openModal = (modalType) => () => {
2812
- handleModalAction(`${modalType}Modal`, "open", (isOpen) => setActiveModal(isOpen ? modalType : null));
2813
- };
2814
- const closeModal = () => {
2815
- if (activeModal) handleModalAction(`${activeModal}Modal`, "close", () => setActiveModal(null));
2816
- };
2817
- const { registerGuidanceQuestion } = useGuidanceQuestionnaire({
2818
- data,
2819
- handleFieldChange,
2820
- openModal,
2821
- country,
2822
- formUtils,
2823
- errors,
2824
- fieldValidationErrors
2825
- });
2826
- if (!handleFieldChange) return;
2827
- const modalAriaLabelMap = {
2828
- isOwner: individualT(($) => $["moreAboutOwners"]),
2829
- isControllingPerson: individualT(($) => $["moreAboutOwnershipThroughControl"]),
2830
- isDirector: individualT(($) => $["moreAboutDirectors"]),
2831
- isNomineeDirector: "",
2832
- isNomineeShareholder: ""
2833
- };
2834
- return /* @__PURE__ */ jsxs("form", {
2835
- "aria-describedby": "ariaErrorField",
2836
- children: [
2837
- heading && /* @__PURE__ */ jsx(Header, {
2838
- title: heading,
2839
- description
2840
- }),
2841
- /* @__PURE__ */ jsx(ErrorPanel, {
2842
- verificationErrors: formVerificationErrors,
2843
- validationErrors: fieldValidationErrors,
2844
- formUtils,
2845
- id: "ariaErrorField"
2846
- }),
2847
- formUtils.isRequiredField("isDirector") && /* @__PURE__ */ jsx(GuidanceQuestion, { ...registerGuidanceQuestion("isDirector") }),
2848
- formUtils.isRequiredField("isNomineeDirector") && data?.isDirector === GuidanceQuestionValues.YES && /* @__PURE__ */ jsx(GuidanceQuestion, { ...registerGuidanceQuestion("isNomineeDirector") }),
2849
- formUtils.isRequiredField("isOwner") && /* @__PURE__ */ jsx(GuidanceQuestion, { ...registerGuidanceQuestion("isOwner") }),
2850
- formUtils.isRequiredField("isNomineeShareholder") && data?.isOwner === GuidanceQuestionValues.YES && /* @__PURE__ */ jsx(GuidanceQuestion, { ...registerGuidanceQuestion("isNomineeShareholder") }),
2851
- formUtils.isRequiredField("isControllingPerson") && /* @__PURE__ */ jsx(GuidanceQuestion, { ...registerGuidanceQuestion("isControllingPerson") }),
2852
- activeModal && /* @__PURE__ */ jsx(Modal, {
2853
- onClose: closeModal,
2854
- ariaLabel: modalAriaLabelMap[activeModal],
2855
- inset: true,
2856
- children: /* @__PURE__ */ jsx(UboQuestionnaireModalContent, {
2857
- modalType: activeModal,
2858
- country
2859
- })
2860
- })
2861
- ]
2862
- });
2863
- }
2864
- //#endregion
2865
- //#region src/components/Individual/forms/Individual.tsx
2866
- var logger$1 = createLogger();
2867
- var individualForms = {
2868
- signatoryQuestionnaire: {
2869
- formId: "signatoryQuestionnaire",
2870
- formName: "authorizedSignatory",
2871
- fields: ["isSignatory"]
2872
- },
2873
- uboQuestionnaire: {
2874
- formId: "uboQuestionnaire",
2875
- formName: "beneficialOwnership",
2876
- fields: uboQuestionnaireFields
2877
- },
2878
- basicDetails: {
2879
- formId: "basicDetails",
2880
- formName: "basicInformationFormName",
2881
- fields: basicDetailsFields
2882
- },
2883
- idVerificationMethod: {
2884
- formId: "idVerificationMethod",
2885
- formName: "verificationMethod",
2886
- fields: idVerificationMethodFields
2887
- },
2888
- inviteDetails: {
2889
- formId: "inviteDetails",
2890
- formName: "inviteDetails",
2891
- fields: inviteDetailsFields
2892
- },
2893
- additionalPersonalDetails: {
2894
- formId: "additionalPersonalDetails",
2895
- formName: "additionalPersonalDetails",
2896
- fields: additionalPersonalDetailsFields
2897
- },
2898
- manualIdUpload: {
2899
- formId: "manualIdUpload",
2900
- formName: "idDocument",
2901
- fields: idDocumentUploadFields
2902
- },
2903
- proofOfResidency: {
2904
- formId: "proofOfResidency",
2905
- formName: "proofOfResidency",
2906
- fields: ["proofOfResidency"]
2907
- },
2908
- proofOfNationalId: {
2909
- formId: "proofOfNationalId",
2910
- formName: "proofOfNationalId",
2911
- fields: ["proofOfNationalId"]
2912
- },
2913
- proofOfRelationship: {
2914
- formId: "proofOfRelationship",
2915
- formName: "proofOfRelationship",
2916
- fields: ["proofOfRelationship"]
2917
- }
2918
- };
2919
- var signatoryQuestionnaireFormID = individualForms.signatoryQuestionnaire.formId;
2920
- var uboQuestionnaireFormID = individualForms.uboQuestionnaire.formId;
2921
- var basicDetailsFormID = individualForms.basicDetails.formId;
2922
- var additionalPersonalDetailsFormID = individualForms.additionalPersonalDetails.formId;
2923
- var inviteDetailsFormID = individualForms.inviteDetails.formId;
2924
- var idVerificationMethodFormID = individualForms.idVerificationMethod.formId;
2925
- var manualIdUploadFormID = individualForms.manualIdUpload.formId;
2926
- var proofOfResidencyFormID = individualForms.proofOfResidency.formId;
2927
- var proofOfNationalIdFormID = individualForms.proofOfNationalId.formId;
2928
- var proofOfRelationshipFormID = individualForms.proofOfRelationship.formId;
2929
- var LIVE_SELFIE_ERROR_CODE$1 = "2_8210";
2930
- function Individual(props) {
2931
- const { t: commonT } = useTranslation("common");
2932
- const { t: individualT } = useTranslation("individual");
2933
- const { form: { errors, valid, fieldProblems: fieldValidationErrors, handleChangeFor, setFormData } } = useFormContext();
2934
- const { goToFormByFormId } = useFormRouterContext();
2935
- const [isDecisionMakerNotRequiredModalOpen, setIsDecisionMakerNotRequiredModalOpen] = useState$1(false);
2936
- const [isDuplicateNameModalOpen, setIsDuplicateNameModalOpen] = useState$1(false);
2937
- const { activeForm: propActiveForm, defaultCountry, data, taskType, allowedRoles, parentLegalEntity, trustedFieldsProvider, trustedRoles, legalEntityId, problems, onNext, setNextHandler, handleHomeClick, scenarios, isInvitedEntity, invitedEntityDetails } = props;
2938
- const basicDetailsFormProps = getFormProps(props, basicDetailsFormID);
2939
- const signatoryQuestionnaireFormProps = getFormProps(props, signatoryQuestionnaireFormID);
2940
- const uboQuestionnaireFormProps = getFormProps(props, uboQuestionnaireFormID);
2941
- const additionalPersonalDetailsFormProps = getFormProps(props, additionalPersonalDetailsFormID);
2942
- const proofOfResidencyFormProps = getFormProps(props, proofOfResidencyFormID);
2943
- const proofOfNationalIdFormProps = getFormProps(props, proofOfNationalIdFormID);
2944
- const proofOfRelationshipFormProps = getFormProps(props, proofOfRelationshipFormID);
2945
- const countryOfResidence = data?.additionalPersonalDetails?.country ?? defaultCountry;
2946
- const handleModalAction = useModalAction();
2947
- const handleNextForPersonNotRequired = () => {
2948
- if (!data?.signatoryQuestionnaire && !data?.uboQuestionnaire) return;
2949
- const { signatoryQuestionnaire, uboQuestionnaire } = data;
2950
- const isDirectorApplicable = uboQuestionnaireFormProps?.requiredFields?.includes("isDirector");
2951
- if (signatoryQuestionnaire && uboQuestionnaire && signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.NO && uboQuestionnaire?.isOwner === GuidanceQuestionValues.NO && uboQuestionnaire?.isControllingPerson === GuidanceQuestionValues.NO && (!isDirectorApplicable || uboQuestionnaire?.isDirector === GuidanceQuestionValues.NO)) handleModalAction("personalInfoNotNeeded", "open", setIsDecisionMakerNotRequiredModalOpen);
2952
- else onNext?.();
2953
- };
2954
- const { firstName, lastName } = data?.basicDetails ?? {};
2955
- const enteredFullName = useMemo$1(() => {
2956
- if (firstName && lastName) return `${firstName} ${lastName}`;
2957
- return null;
2958
- }, [firstName, lastName]);
2959
- const existingNames = useMemo$1(() => {
2960
- const associations = parentLegalEntity?.entityAssociations ?? [];
2961
- return new Set(associations.flatMap((entity) => entity.name ? [entity.name.toLowerCase()] : []));
2962
- }, [parentLegalEntity]);
2963
- const handleBasicDetailsNext = useCallback$1(() => {
2964
- if (legalEntityId) {
2965
- onNext?.();
2966
- return;
2967
- }
2968
- if (enteredFullName === null) {
2969
- onNext?.();
2970
- return;
2971
- }
2972
- if (existingNames.has(enteredFullName.toLowerCase())) setIsDuplicateNameModalOpen(true);
2973
- else onNext?.();
2974
- }, [
2975
- enteredFullName,
2976
- existingNames,
2977
- onNext,
2978
- legalEntityId
2979
- ]);
2980
- useEffect$1(() => {
2981
- if (propActiveForm.formId === uboQuestionnaireFormID) setNextHandler?.(() => handleNextForPersonNotRequired);
2982
- else if (propActiveForm.formId === basicDetailsFormID) setNextHandler?.(() => handleBasicDetailsNext);
2983
- else setNextHandler?.(void 0);
2984
- }, [
2985
- propActiveForm,
2986
- setNextHandler,
2987
- data
2988
- ]);
2989
- const handleCloseModalAndGoBack = useCallback$1(() => handleModalAction("personalInfoNotNeeded", "close", setIsDecisionMakerNotRequiredModalOpen, handleHomeClick), [handleModalAction, handleHomeClick]);
2990
- const handleCloseModalAndChangeAnswers = useCallback$1(() => handleModalAction("personalInfoNotNeeded", "cancel", setIsDecisionMakerNotRequiredModalOpen), [handleModalAction]);
2991
- const handleCloseModalAndGoToOverview = useCallback$1(() => handleModalAction("thisPersonAlreadyExists", "close", setIsDuplicateNameModalOpen, handleHomeClick), [handleModalAction, handleHomeClick]);
2992
- const handleCloseModalAndContinue = useCallback$1(() => handleModalAction("thisPersonAlreadyExists", "cancel", setIsDuplicateNameModalOpen, onNext), [handleModalAction, onNext]);
2993
- const handleContinueToAdditionalDetails = () => {
2994
- goToFormByFormId(additionalPersonalDetailsFormID);
2995
- };
2996
- const handleContinueToInviteDetails = () => {
2997
- goToFormByFormId(inviteDetailsFormID);
2998
- };
2999
- const handleDeleteDocument = () => {
3000
- logger$1.info("handle delete document");
3001
- };
3002
- const handleUpdateDocument = () => {
3003
- logger$1.info("handle update document");
3004
- };
3005
- const capabilities = useCapabilities();
3006
- const newRoles = useMemo$1(() => isInvitedEntity ? invitedEntityDetails?.roles : calculateRoles(data), [
3007
- data,
3008
- invitedEntityDetails,
3009
- isInvitedEntity
3010
- ]);
3011
- useEffect$1(() => {
3012
- if (areArraysDifferent(newRoles, data?.basicDetails?.role ?? [])) setFormData("basicDetails", {
3013
- ...data?.basicDetails ?? {},
3014
- role: newRoles
3015
- });
3016
- }, [
3017
- newRoles,
3018
- data?.basicDetails?.role,
3019
- setFormData
3020
- ]);
3021
- const hasLiveSelfieErrorCode = problems?.missingData?.some((problem) => problem.code === LIVE_SELFIE_ERROR_CODE$1 && problem.type === "dataMissing");
3022
- const hasMotionCaptureScenarioValue = hasMotionCaptureScenario?.value;
3023
- useEffect$1(() => {
3024
- setShowIndividualMotionCapture(shouldShowMotionCapture({
3025
- capabilities: isInvitedEntity ? invitedEntityDetails?.rootCapabilities : capabilities,
3026
- userRoles: data?.basicDetails?.role,
3027
- taskType,
3028
- hasLiveSelfieError: hasLiveSelfieErrorCode,
3029
- hasMotionScenario: data?.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && scenarios?.includes(Scenarios.L_BAFIN) ? false : hasMotionCaptureScenarioValue,
3030
- isInvitedEntity
3031
- }));
3032
- }, [
3033
- data?.basicDetails?.role,
3034
- scenarios,
3035
- taskType,
3036
- capabilities,
3037
- hasMotionCaptureScenarioValue,
3038
- hasLiveSelfieErrorCode,
3039
- isInvitedEntity,
3040
- invitedEntityDetails?.rootCapabilities
3041
- ]);
3042
- const fullName = `${data?.basicDetails?.firstName} ${data?.basicDetails?.lastName}`;
3043
- const handleFieldChange = (formName) => (fieldName, mode) => handleChangeFor(formName, fieldName, mode);
3044
- const renderActiveForm = (activeForm) => {
3045
- switch (activeForm.formId) {
3046
- case signatoryQuestionnaireFormID: return /* @__PURE__ */ jsx(SignatoryQuestionnaire, {
3047
- ...signatoryQuestionnaireFormProps,
3048
- heading: individualT(($) => $["signatoryQuestionnaireHeader"]),
3049
- id: signatoryQuestionnaireFormID,
3050
- handleFieldChange: handleFieldChange("signatoryQuestionnaire"),
3051
- errors: errors?.signatoryQuestionnaire,
3052
- fieldValidationErrors: fieldValidationErrors?.signatoryQuestionnaire
3053
- });
3054
- case uboQuestionnaireFormID: return /* @__PURE__ */ jsx(UboQuestionnaire, {
3055
- ...uboQuestionnaireFormProps,
3056
- heading: individualT(($) => $["uboQuestionnaireHeader"]),
3057
- description: individualT(($) => countryOfResidence === CountryCodes.Japan ? $["registeringTheLegalRepresentativeAsRequiredByLaw"] : $["thisIsImportantBecauseItIsARegulatoryRequirement"]),
3058
- id: uboQuestionnaireFormID,
3059
- handleFieldChange: handleFieldChange("uboQuestionnaire"),
3060
- errors: errors?.uboQuestionnaire,
3061
- fieldValidationErrors: fieldValidationErrors?.uboQuestionnaire,
3062
- country: countryOfResidence
3063
- });
3064
- case basicDetailsFormID: return /* @__PURE__ */ jsx(BasicDetails, {
3065
- ...basicDetailsFormProps,
3066
- data: data?.basicDetails ?? {},
3067
- heading: commonT(($) => $["basicInformationFormName"]),
3068
- taskType,
3069
- id: basicDetailsFormID,
3070
- allowedRoles,
3071
- country: countryOfResidence,
3072
- parentLegalEntity,
3073
- trustedFieldsProvider,
3074
- trustedRoles,
3075
- errors: errors?.basicDetails,
3076
- fieldValidationErrors: fieldValidationErrors?.basicDetails,
3077
- valid: valid?.basicDetails,
3078
- handleFieldChange: handleFieldChange("basicDetails")
3079
- });
3080
- case idVerificationMethodFormID: return /* @__PURE__ */ jsx(IdVerificationMethod, {
3081
- legalEntityId,
3082
- taskType,
3083
- handlers: {
3084
- handleContinueToAdditionalDetails,
3085
- handleContinueToInviteDetails,
3086
- handleDeleteDocument,
3087
- handleUpdateDocument
3088
- },
3089
- formVerificationErrors: problems?.verificationErrors?.idVerificationMethod,
3090
- fieldValidationErrors: problems?.validationErrors?.idVerificationMethod,
3091
- hasLiveSelfieErrorCode,
3092
- isInvitedEntity
3093
- });
3094
- case inviteDetailsFormID: return /* @__PURE__ */ jsx(InviteDetails, {
3095
- country: countryOfResidence,
3096
- data: {
3097
- email: data?.basicDetails?.email ?? "",
3098
- phoneNumber: data?.basicDetails?.phoneNumber,
3099
- senderName: data?.inviteDetails?.senderName ?? "",
3100
- message: data?.inviteDetails?.message ?? ""
3101
- },
3102
- errors: errors?.inviteDetails,
3103
- fieldValidationErrors: fieldValidationErrors?.inviteDetails,
3104
- handleFieldChange: handleFieldChange("inviteDetails"),
3105
- heading: individualT(($) => $["inviteDetails"]),
3106
- id: inviteDetailsFormID,
3107
- recipientFirstName: data?.basicDetails?.firstName ?? "",
3108
- valid: valid?.inviteDetails
3109
- });
3110
- case additionalPersonalDetailsFormID: return /* @__PURE__ */ jsx(AdditionalPersonalDetails, {
3111
- ...additionalPersonalDetailsFormProps,
3112
- country: countryOfResidence,
3113
- data: data?.additionalPersonalDetails ?? {},
3114
- heading: individualT(($) => $["additionalPersonalDetails"]),
3115
- id: additionalPersonalDetailsFormID,
3116
- errors: errors?.additionalPersonalDetails,
3117
- fieldValidationErrors: fieldValidationErrors?.additionalPersonalDetails,
3118
- valid: valid?.additionalPersonalDetails,
3119
- taskType,
3120
- handleFieldChange: handleFieldChange("additionalPersonalDetails")
3121
- });
3122
- case manualIdUploadFormID: return /* @__PURE__ */ jsx(ManualIdUpload, {});
3123
- case proofOfResidencyFormID: return /* @__PURE__ */ jsx(MemoizedProofOfResidencyUpload, {
3124
- ...proofOfResidencyFormProps,
3125
- data: data?.proofOfResidency,
3126
- id: proofOfResidencyFormID,
3127
- name: fullName,
3128
- errors: errors.proofOfResidency,
3129
- fieldValidationErrors: fieldValidationErrors.proofOfResidency,
3130
- valid: valid.proofOfResidency,
3131
- handleFieldChange: handleFieldChange("proofOfResidency")
3132
- });
3133
- case proofOfNationalIdFormID: return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
3134
- ...proofOfNationalIdFormProps,
3135
- data: data?.proofOfNationalId,
3136
- documentField: "proofOfNationalId",
3137
- documentType: "registrationDocument",
3138
- heading: commonT(($) => $["proofOfNationalId"]),
3139
- id: proofOfNationalIdFormID,
3140
- errors: errors.proofOfNationalId,
3141
- fieldValidationErrors: fieldValidationErrors.proofOfNationalId,
3142
- valid: valid.proofOfNationalId,
3143
- handleFieldChange: handleFieldChange("proofOfNationalId")
3144
- });
3145
- case proofOfRelationshipFormID: return /* @__PURE__ */ jsx(MemoizedProofOfRelationship, {
3146
- ...proofOfRelationshipFormProps,
3147
- data: data?.proofOfRelationship,
3148
- id: proofOfRelationshipFormID,
3149
- name: fullName,
3150
- errors: errors.proofOfRelationship,
3151
- fieldValidationErrors: fieldValidationErrors.proofOfRelationship,
3152
- valid: valid.proofOfRelationship,
3153
- handleFieldChange: handleFieldChange("proofOfRelationship")
3154
- });
3155
- default: logger$1.warn(`Active form (${activeForm.formId}) is not supported'`);
3156
- }
3157
- };
3158
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
3159
- renderActiveForm(propActiveForm),
3160
- isDecisionMakerNotRequiredModalOpen && /* @__PURE__ */ jsx(Confirm, {
3161
- title: individualT(($) => $["personalInfoNotNeeded"]),
3162
- description: individualT(($) => $["weWontCollectAnyInfoAboutThisPerson"]),
3163
- onConfirm: handleCloseModalAndGoBack,
3164
- confirmText: individualT(($) => $["backToOverview"]),
3165
- onCancel: handleCloseModalAndChangeAnswers,
3166
- cancelText: individualT(($) => $["changeAnswers"])
3167
- }),
3168
- isDuplicateNameModalOpen && /* @__PURE__ */ jsx(Confirm, {
3169
- title: individualT(($) => $["thisPersonAlreadyExists"]),
3170
- description: individualT(($) => $["doYouWantToUpdateTheirExistingDetails"], { name: enteredFullName ?? "" }),
3171
- onConfirm: handleCloseModalAndGoToOverview,
3172
- confirmText: individualT(($) => $["updateExistingDetails"]),
3173
- onCancel: handleCloseModalAndContinue,
3174
- cancelText: commonT(($) => $["continue"])
3175
- })
3176
- ] });
3177
- }
3178
- //#endregion
3179
- //#region src/components/Individual/forms/InviteDetails/validate.ts
3180
- var validateSenderNameNotEmpty = {
3181
- modes: ["blur"],
3182
- validate: (senderName) => !isEmpty(senderName),
3183
- errorMessage: "fieldIsRequired"
3184
- };
3185
- var senderNameRules = () => {
3186
- const v4NameRules = nameValidationRulesV4().firstName ?? [];
3187
- return Array.isArray(v4NameRules) ? v4NameRules : [v4NameRules];
3188
- };
3189
- var validateMessageNotEmpty = {
3190
- modes: ["blur"],
3191
- validate: (message) => !isEmpty(message),
3192
- errorMessage: "fieldIsRequired"
3193
- };
3194
- var validateEmailNotEmpty = {
3195
- modes: ["blur"],
3196
- validate: (email) => !isEmpty(email),
3197
- errorMessage: "fieldIsRequired"
3198
- };
3199
- var validateEmailFormat = {
3200
- modes: ["blur"],
3201
- validate: (email) => email ? emailPattern.test(email) : true,
3202
- errorMessage: "invalidEmail"
3203
- };
3204
- var validateMobilePhoneNumberNotEmpty = {
3205
- modes: ["blur"],
3206
- validate: (phone) => {
3207
- if (phone?.number && phone?.phoneCountryCode) {
3208
- const prefix = phonePrefixes_default[phone?.phoneCountryCode];
3209
- return Boolean(phone.number.replace(prefix, "").trim().length);
3210
- }
3211
- return false;
3212
- },
3213
- errorMessage: "fieldIsRequired"
3214
- };
3215
- var validateMobilePhoneNumber = {
3216
- modes: ["blur"],
3217
- validate: (phone) => Boolean(phone?.number && isPhoneNumberMobile(phone)),
3218
- errorMessage: "invalidPhoneNumber"
3219
- };
3220
- var inviteDetailsValidators = () => ({
3221
- senderName: [validateSenderNameNotEmpty, ...senderNameRules()],
3222
- message: [validateMessageNotEmpty],
3223
- email: [validateEmailNotEmpty, validateEmailFormat],
3224
- phoneNumber: [validateMobilePhoneNumberNotEmpty, validateMobilePhoneNumber]
3225
- });
3226
- //#endregion
3227
- //#region src/components/Individual/helpers/mandateIdVerificationForMotionCapture.ts
3228
- var mandateIdVerificationForMotionCapture = (showMotionCapture, derivedProps) => {
3229
- if (!derivedProps) return;
3230
- const copiedDerivedProps = { ...derivedProps };
3231
- if (showMotionCapture) {
3232
- const idVerificationFields = [...derivedProps.requiredFields.idVerificationMethod ?? [], "idVerificationMethod"];
3233
- copiedDerivedProps.allFields.idVerificationMethod = idVerificationFields;
3234
- copiedDerivedProps.requiredFields.idVerificationMethod = idVerificationFields;
3235
- }
3236
- return copiedDerivedProps;
3237
- };
3238
- //#endregion
3239
- //#region src/components/Individual/mapping/mapApiDocumentToIndividualDocuments.ts
3240
- var mapApiDocumentToIndividualDocuments = (entityId) => {
3241
- const idDocument = getIdDocument(entityId);
3242
- const proofOfResidency = getDocument(entityId, "proofOfResidency");
3243
- const proofOfNationalId = getDocument(entityId, "proofOfNationalIdNumber");
3244
- const proofOfRelationship = getDocument(entityId, "proofOfRelationship");
3245
- return {
3246
- manualIdUpload: idDocument ? mapApiIdDocumentToSchema(idDocument) : void 0,
3247
- proofOfResidency: proofOfResidency ? { proofOfResidency: [mapExistingFile(getPageName(proofOfResidency))] } : void 0,
3248
- proofOfNationalId: proofOfNationalId ? { proofOfNationalId: [mapExistingFile(getPageName(proofOfNationalId))] } : void 0,
3249
- proofOfRelationship: proofOfRelationship ? { proofOfRelationship: [mapExistingFile(getPageName(proofOfRelationship))] } : void 0
3250
- };
3251
- };
3252
- var mapApiIdDocumentToSchema = (idDocument) => {
3253
- const { type, attachments, modificationDate } = idDocument;
3254
- const { hasBackPage } = getLocalizedIdDocumentTypeOptions().find(({ id }) => id === type);
3255
- let frontPage;
3256
- let backPage;
3257
- if (attachments?.length === 1) frontPage = getPage(idDocument);
3258
- else {
3259
- frontPage = hasBackPage ? getPage(idDocument, "front") : getPage(idDocument);
3260
- backPage = hasBackPage ? getPage(idDocument, "back") : void 0;
3261
- }
3262
- return {
3263
- ...frontPage ? { idFrontPage: [mapExistingFile(frontPage.pageName ?? "")] } : {},
3264
- ...backPage ? { idBackPage: [mapExistingFile(backPage.pageName ?? "")] } : {},
3265
- idDocumentType: type,
3266
- modificationDate
3267
- };
3268
- };
3269
- //#endregion
3270
- //#region src/components/Individual/mapping/mapIndividualDocumentToApiDocument.ts
3271
- var mapIndividualDocumentToApiDocument = async (data, entityId) => {
3272
- if (!data) return void 0;
3273
- const { proofOfNationalId, proofOfResidency, proofOfRelationship, manualIdUpload } = data;
3274
- const entityType = "legalEntity";
3275
- return (await Promise.all([
3276
- manualIdUpload?.idFrontPage ? createDocumentRequest({
3277
- entityId,
3278
- entityType,
3279
- documentType: manualIdUpload.idDocumentType,
3280
- page1: manualIdUpload?.idFrontPage?.[0],
3281
- page2: manualIdUpload?.idBackPage?.[0]
3282
- }) : void 0,
3283
- proofOfNationalId?.proofOfNationalId ? createDocumentRequest({
3284
- entityId,
3285
- entityType,
3286
- documentType: "proofOfNationalIdNumber",
3287
- page1: proofOfNationalId.proofOfNationalId[0]
3288
- }) : void 0,
3289
- proofOfResidency?.proofOfResidency ? createDocumentRequest({
3290
- entityId,
3291
- entityType,
3292
- documentType: "proofOfResidency",
3293
- description: proofOfResidency?.description,
3294
- page1: proofOfResidency.proofOfResidency[0]
3295
- }) : void 0,
3296
- proofOfRelationship?.proofOfRelationship ? createDocumentRequest({
3297
- entityId,
3298
- entityType,
3299
- documentType: "proofOfRelationship",
3300
- description: proofOfRelationship?.description,
3301
- page1: proofOfRelationship.proofOfRelationship[0]
3302
- }) : void 0
3303
- ])).filter(Boolean);
3304
- };
3305
- //#endregion
3306
- //#region src/components/Individual/mapping/adjustOnfidoIdentificationData.ts
3307
- var adjustOnfidoIdentificationData = (data, apiData) => {
3308
- const { typeOfIdentity, idNumber, idNumberExempt } = data;
3309
- const type = getOnfidoIdentityTypeToApiIdentityTypeMap(data)[typeOfIdentity] ?? "nationalIdNumber";
3310
- const identificationData = {
3311
- ...apiData,
3312
- number: idNumber,
3313
- type
3314
- };
3315
- switch (typeOfIdentity) {
3316
- case "passport": return {
3317
- ...identificationData,
3318
- cardNumber: ""
3319
- };
3320
- case "driversLicense": return {
3321
- ...identificationData,
3322
- expiryDate: ""
3323
- };
3324
- default: return idNumber === void 0 && idNumberExempt === void 0 ? void 0 : {
3325
- ...identificationData,
3326
- expiryDate: "",
3327
- cardNumber: "",
3328
- nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
3329
- };
3330
- }
3331
- };
3332
- //#endregion
3333
- //#region src/components/Individual/mapping/mapIndividualSchemaToLegalEntity.ts
3334
- var mapIndividualSchemaToLegalEntity = (individual, isFeatureEnabled, matchingScenario) => {
3335
- const legalEntity = {
3336
- ...formatObject(individual, individualApiKeyMapping),
3337
- type: LegalEntityTypes.INDIVIDUAL
3338
- };
3339
- if (individual.additionalPersonalDetails) {
3340
- if (matchingScenario?.includes(Scenarios.L_TAXINFO) && individual.additionalPersonalDetails?.idNumber && (individual.additionalPersonalDetails?.country === CountryCodes.Spain || individual.additionalPersonalDetails?.country === CountryCodes.Italy)) {
3341
- const taxCountry = individual.additionalPersonalDetails?.country;
3342
- const taxType = taxCountry === CountryCodes.Spain && individual.additionalPersonalDetails?.typeOfIdentity ? individual.additionalPersonalDetails?.typeOfIdentity.toUpperCase() : taxIdNumberOptions[taxCountry][0]["id"];
3343
- legalEntity.individual.taxInformation = [{
3344
- country: taxCountry,
3345
- number: individual.additionalPersonalDetails.idNumber,
3346
- type: taxType
3347
- }];
3348
- }
3349
- legalEntity.individual.identificationData = adjustOnfidoIdentificationData(individual.additionalPersonalDetails, legalEntity.individual.identificationData);
3350
- }
3351
- const nameLocalization = [mapSchemaFieldsToApiScriptLocalization(individual.basicDetails ?? {}, "jaHani"), mapSchemaFieldsToApiScriptLocalization(individual.basicDetails ?? {}, "jaKana")].filter(({ fields }) => !isEmpty$1(fields));
3352
- if (nameLocalization.length) legalEntity.individual.name.localization = nameLocalization;
3353
- const addressLocalizations = mapJpAddressSchemaToAddressLocalizations(individual.additionalPersonalDetails);
3354
- if (addressLocalizations.length > 0) legalEntity.individual.residentialAddress.localization = addressLocalizations;
3355
- if (individual.basicDetails?.phoneNumber) {
3356
- const phone = {
3357
- number: individual.basicDetails.phoneNumber.number,
3358
- type: "mobile"
3359
- };
3360
- if (phone.number && legalEntity.individual) legalEntity.individual.phone = phone;
3361
- else delete legalEntity?.individual?.phone;
3362
- }
3363
- return legalEntity;
3364
- };
3365
- //#endregion
3366
- //#region src/components/Individual/tasks/IndividualDropin/individualFormConfig.ts
3367
- var identityOnfidoBase = {
3368
- role: { rule: "requiredIfDecisionMakerTask" },
3369
- firstName: { rule: "REQUIRED" },
3370
- lastName: { rule: "REQUIRED" },
3371
- birthDate: { rule: "REQUIRED" },
3372
- phoneNumber: { rules: ["requiredIfPhoneScenarioDisabled", "contactsIfRequiredForRole"] },
3373
- email: { rule: "contactsIfRequiredForRole" },
3374
- jobTitle: { rule: "jobTitleIfRequiredForRole" },
3375
- placeOfBirth: { rule: "isPlaceOfBirthRequired" },
3376
- nationality: { rule: "nationalityIfRequiredForRole" },
3377
- street: { rule: "addressIfRequiredForCountry" },
3378
- street2: { rule: "otherAddressInfoIfRequiredForCountry" },
3379
- country: { rule: "REQUIRED" },
3380
- postalCode: { rule: "postalCodeIfRequiredForCountry" },
3381
- city: { rule: "cityIfRequiredForCountry" },
3382
- stateOrProvince: { rule: "stateOrProvinceIfRequiredForCountry" },
3383
- proofOfResidency: { rule: "isProofOfResidencyRequired" },
3384
- proofOfNationalId: { rule: "isProofOfNationalIdRequired" },
3385
- relationship: { rule: "legalRepresentativeRelationshipRequired" },
3386
- proofOfRelationship: { rule: "isProofOfRelationshipRequired" },
3387
- idVerificationMethod: { rule: "isIdVerificationMethodRequired" },
3388
- idDocument: { rule: "isUsingInstantVerificationOrHasExistingDocument" },
3389
- idDocumentType: { rule: "isManualIdFlowAndHasMissingData" },
3390
- /**
3391
- * Below fields only relevant if manual ID is needed
3392
- * @see identityNumber
3393
- * @see idDocRequired
3394
- */
3395
- idFrontPage: { rule: "hasChosenIdType" },
3396
- idBackPage: { rule: "backPageIfRequiredForIdType" },
3397
- isSignatory: { rules: ["requiredIfDecisionMakerTask"] },
3398
- isOwner: { rules: ["requiredIfDecisionMakerTask"] },
3399
- isControllingPerson: { rules: ["requiredIfDecisionMakerTask"] },
3400
- isDirector: { rules: ["requiredIfDecisionMakerTask", "isDirectorRequiredForCountry"] },
3401
- isNomineeDirector: { rules: ["requiredIfDecisionMakerTask", "nomineeDirectorRequiredForCountry"] },
3402
- isNomineeShareholder: { rules: ["requiredIfDecisionMakerTask", "nomineeShareHolderRequiredForCountry"] },
3403
- jaHaniFirstName: { rule: "japanSpecificField" },
3404
- jaHaniLastName: { rule: "japanSpecificField" },
3405
- jaKanaFirstName: { rule: "japanSpecificField" },
3406
- jaKanaLastName: { rule: "japanSpecificField" },
3407
- jaHaniStreet: { rule: "japanSpecificField" },
3408
- jaHaniCity: { rule: "japanSpecificField" },
3409
- jaHaniStateOrProvince: { rule: "japanSpecificField" },
3410
- jaKanaCity: { rule: "japanSpecificField" },
3411
- jaKanaStateOrProvince: { rule: "japanSpecificField" }
3412
- };
3413
- var identityNumber = {
3414
- idNumber: {
3415
- rule: "idNumberRules",
3416
- obscured: true
3417
- },
3418
- idNumberExempt: { rules: ["idNumberExemptIfApplicableCountry", "isDirectorIdNumberRequiredForCountry"] },
3419
- idDocumentType: { rule: "isManualIdFlowAndNotProvidingIdNumber" }
3420
- };
3421
- var additionalIdentityInfo = {
3422
- typeOfIdentity: { rules: ["requiredIfCountryUsesMultipleTypesOfIdentity", "isDirectorIdNumberRequiredForCountry"] },
3423
- issuerState: { rule: "issuerStateRequired" },
3424
- licenseCardNumber: { rule: "licenseCardNumberRules" },
3425
- expiryDate: { rule: "expiryDateRequired" }
3426
- };
3427
- var idDocRequired = { idDocumentType: { rule: "isManualIdFlow" } };
3428
- var nationality = { nationality: { rule: "REQUIRED" } };
3429
- var phoneNumberBase = { phoneNumber: { rule: "contactsIfRequiredForRole" } };
3430
- var inviteDetails = {
3431
- senderName: { rule: "isVerifyByInviteSelected" },
3432
- message: { rule: "isVerifyByInviteSelected" }
3433
- };
3434
- var taxInformationBase = { taxInformation: { rule: "countryUsesTaxId" } };
3435
- var individualFieldsPerScenario = {
3436
- L0: {
3437
- ...drop("address", "birthDate").from(identityOnfidoBase),
3438
- ...inviteDetails
3439
- },
3440
- L1: {
3441
- ...identityOnfidoBase,
3442
- ...inviteDetails
3443
- },
3444
- L1_ID: {
3445
- ...identityOnfidoBase,
3446
- ...identityNumber,
3447
- ...additionalIdentityInfo,
3448
- ...inviteDetails
3449
- },
3450
- L1_IDO: {
3451
- ...identityOnfidoBase,
3452
- ...identityNumber,
3453
- ...additionalIdentityInfo,
3454
- ...inviteDetails
3455
- },
3456
- L1_NAT: {
3457
- ...identityOnfidoBase,
3458
- ...identityNumber,
3459
- ...additionalIdentityInfo,
3460
- ...nationality,
3461
- ...inviteDetails
3462
- },
3463
- L_TAXINFO: {
3464
- ...identityOnfidoBase,
3465
- ...taxInformationBase,
3466
- ...inviteDetails
3467
- },
3468
- L1_IDDOC: idDocRequired,
3469
- L_PH: phoneNumberBase
3470
- };
3471
- //#endregion
3472
- //#region src/components/Individual/tasks/IndividualDropin/IndividualDropin.tsx
3473
- var LIVE_SELFIE_ERROR_CODE = "2_8210";
3474
- var parseIndividualScenarios = (scenarios) => composePerScenarioFormConfigurations(scenarios, individualFieldsPerScenario);
3475
- var parseConfiguration = ({ scenarios }) => parseIndividualScenarios(scenarios);
3476
- var logger = createLogger();
3477
- function IndividualDropin({ taskType = TaskTypes.INDIVIDUAL, parentLegalEntity, legalEntityResponse, handleHomeClick, isTargetLegalEntityType, country: parentCountry, problems: propProblems, trustMember, onSubmit: externalOnSubmit, asModal = false, handleBackClick: externalBackClick, trustedFields, trustedFieldsProvider, trustedRoles, isInvitedEntity, invitedEntityDetails }) {
3478
- const { baseUrl, rootLegalEntityId } = useApiContext();
3479
- const { accountHolder, setAccountHolder } = useAccountHolder();
3480
- const { t, i18n } = useTranslation(["common", "individual"]);
3481
- const userEvents = useAnalyticsContext();
3482
- const { showToast, clearToasts } = useToastContext();
3483
- const { isFeatureEnabled } = useToggleContext();
3484
- const { isSettingEnabled } = useSettingsContext();
3485
- const queryClient = useQueryClient();
3486
- const { data: providerStatus } = useProviderStatus({
3487
- providers: ["idDocument"],
3488
- country: legalEntityResponse ? getLegalEntityCountry(legalEntityResponse) : "NL"
3489
- });
3490
- const isInstantVerificationEnabled = providerStatus?.statuses?.idDocument?.enabled ?? true;
3491
- const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
3492
- const isRoleFieldNeeded = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
3493
- const dataFromResponse = useMemo$1(() => {
3494
- const formStateData = individualFormDefaultData.value;
3495
- individualFormDefaultData.value = null;
3496
- if (legalEntityResponse) {
3497
- const mappedData = mapLegalEntityToIndividualSchema(legalEntityResponse, isTargetLegalEntityType, isRoleFieldNeeded, parentLegalEntity);
3498
- return {
3499
- ...mappedData,
3500
- ...isInvitedEntity && invitedEntityDetails?.jobTitle && { basicDetails: {
3501
- ...mappedData.basicDetails,
3502
- jobTitle: invitedEntityDetails.jobTitle
3503
- } },
3504
- ...formStateData
3505
- };
3506
- }
3507
- return {
3508
- additionalPersonalDetails: { country: parentCountry },
3509
- ...formStateData
3510
- };
3511
- }, [
3512
- legalEntityResponse,
3513
- parentCountry,
3514
- isTargetLegalEntityType,
3515
- isRoleFieldNeeded,
3516
- parentLegalEntity,
3517
- isInvitedEntity,
3518
- invitedEntityDetails
3519
- ]);
3520
- const [matchingScenario, setMatchingScenario] = useState$1();
3521
- const [validationErrors, setValidationErrors] = useState$1();
3522
- const [loadingStatus, setLoadingStatus] = useState$1("success");
3523
- const [existingAttachments, setExistingAttachments] = useState$1();
3524
- const [documents, setDocuments] = useState$1();
3525
- const [country, setCountry] = useState$1(dataFromResponse?.additionalPersonalDetails?.country ?? parentCountry);
3526
- const [derivedProps, setDerivedProps] = useState$1();
3527
- const [nextHandler, setNextHandler] = useState$1();
3528
- const [hasBafinNavigated, setHasBafinNavigated] = useState$1(false);
3529
- const problems = useMemo$1(() => ({
3530
- ...propProblems,
3531
- validationErrors
3532
- }), [propProblems, validationErrors]);
3533
- const hasVerificationErrors = propProblems?.verificationErrors && Object.keys(propProblems.verificationErrors).length > 0;
3534
- /**
3535
- * Analytics
3536
- */
3537
- useTaskLandedEvent(taskType);
3538
- const individualFieldValidations = useCallback$1((data) => ({
3539
- basicDetails: basicDetailsValidators({
3540
- isFeatureEnabled,
3541
- country
3542
- }),
3543
- additionalPersonalDetails: additionalPersonalDetailsValidators({
3544
- country: data?.additionalPersonalDetails?.country ?? country,
3545
- isFeatureEnabled,
3546
- isSettingEnabled,
3547
- taskType,
3548
- idNumberType: data?.additionalPersonalDetails?.typeOfIdentity,
3549
- idNumberExempt: data?.additionalPersonalDetails?.idNumberExempt,
3550
- idNumber: data?.additionalPersonalDetails?.idNumber,
3551
- existingIdNumber: dataFromResponse.additionalPersonalDetails?.idNumber,
3552
- formVerificationErrors: problems?.verificationErrors?.additionalPersonalDetails,
3553
- t,
3554
- taxIdNumberType: data?.additionalPersonalDetails?.taxInformation?.length ? data?.additionalPersonalDetails?.taxInformation[0]?.type : void 0
3555
- }),
3556
- inviteDetails: inviteDetailsValidators()
3557
- }), [
3558
- country,
3559
- dataFromResponse.additionalPersonalDetails?.idNumber,
3560
- t,
3561
- isFeatureEnabled,
3562
- isSettingEnabled,
3563
- problems?.verificationErrors?.additionalPersonalDetails,
3564
- taskType
3565
- ]);
3566
- const validatePhoneNumber = useValidatePhoneNumberImperatively();
3567
- const { mutateAsync: verifyIdNumber } = useVerifyIdNumber();
3568
- const individualFieldAsyncValidations = useCallback$1((data) => ({
3569
- basicDetails: { phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber },
3570
- additionalPersonalDetails: { idNumber: getAsyncIdNumberValidationRule(verifyIdNumber, data?.additionalPersonalDetails, data?.basicDetails).idNumber }
3571
- }), [verifyIdNumber, validatePhoneNumber]);
3572
- const defaultData = useMemo$1(() => {
3573
- if (!documents) return dataFromResponse;
3574
- return {
3575
- ...dataFromResponse,
3576
- ...drop("manualIdUpload").from(documents),
3577
- idVerificationMethod: {
3578
- idDocument: documents.manualIdUpload,
3579
- idVerificationMethod: "existingDocument"
3580
- }
3581
- };
3582
- }, [documents, dataFromResponse]);
3583
- const form = useMultiForm({
3584
- requiredFields: derivedProps?.requiredFields,
3585
- defaultData,
3586
- rules: individualFieldValidations,
3587
- asyncRules: individualFieldAsyncValidations,
3588
- optionalFields: derivedProps?.optionalFields,
3589
- obscuredFields: {
3590
- /**takes care of scenario when the 4 digit provided is wrong based on verification errors and
3591
- * we need to show validation error for defaultData which is already saved
3592
- **/
3593
- additionalPersonalDetails: check4DigitSsnFailed(problems?.verificationErrors?.additionalPersonalDetails) ? [] : ["idNumber"] }
3594
- });
3595
- const documentUtils = documentApiUtils({
3596
- baseUrl: baseUrl.value,
3597
- rootLegalEntityId: rootLegalEntityId.value
3598
- });
3599
- const { data, requiredFields } = form;
3600
- useEffect$1(() => {
3601
- setCountry(data?.additionalPersonalDetails?.country ?? parentCountry);
3602
- }, [data?.additionalPersonalDetails?.country, parentCountry]);
3603
- const { data: scenarios } = useScenarios(country, LegalEntityTypes.INDIVIDUAL);
3604
- useEffect$1(() => {
3605
- if (!scenarios) return;
3606
- setHasMotionCaptureScenario(scenarios);
3607
- setMatchingScenario(scenarios);
3608
- }, [scenarios]);
3609
- /**
3610
- * Fetch Configurations
3611
- */
3612
- const { fieldConfigurations } = useScenarioConfiguration({
3613
- parseConfiguration,
3614
- legalEntityType: LegalEntityTypes.INDIVIDUAL,
3615
- setLoadingStatus,
3616
- country
3617
- });
3618
- /**
3619
- * parse configuration and create component props
3620
- */
3621
- const fieldsFromCustomRules = useMemo$1(() => individualRules({
3622
- matchingScenario,
3623
- data,
3624
- country: data?.additionalPersonalDetails?.country ?? country,
3625
- taskType,
3626
- isFeatureEnabled,
3627
- rootLegalEntity: parentLegalEntity,
3628
- problems
3629
- }), [
3630
- country,
3631
- matchingScenario,
3632
- data,
3633
- isFeatureEnabled,
3634
- parentLegalEntity,
3635
- taskType,
3636
- problems
3637
- ]);
3638
- const hasLiveSelfieErrorCode = problems?.missingData?.some((problem) => problem.code === LIVE_SELFIE_ERROR_CODE && problem.type === "dataMissing");
3639
- useEffect$1(() => {
3640
- const derivedProps = getPropsFromConfigurations({
3641
- scenarioConfiguration: fieldConfigurations,
3642
- forms: individualForms,
3643
- remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
3644
- dataMissingErrors: problems?.missingData ?? [],
3645
- fieldsWithExistingData: legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, individualApiKeyMapping, individualDocumentMapping, [
3646
- "additionalPersonalDetails.typeOfIdentity",
3647
- "additionalPersonalDetails.idNumber",
3648
- "additionalPersonalDetails.stateOrProvince",
3649
- "additionalPersonalDetails.issuerState"
3650
- ]) : [],
3651
- customRules: fieldsFromCustomRules,
3652
- legalEntityType: legalEntityResponse?.type,
3653
- legalEntityTrustedFields: [],
3654
- remediationFieldAsOptional: true
3655
- });
3656
- /**
3657
- * For invited entities, if they already have data for certain basic details (jobTitle, email, phoneNumber),
3658
- * we do not want to prompt them to enter or edit these details again.
3659
- * By calculating these 'hidden' fields and removing them from required/optional fields,
3660
- * the BasicDetails form will not render them.
3661
- */
3662
- if (isInvitedEntity && derivedProps && dataFromResponse?.basicDetails) {
3663
- const basicDetailsData = dataFromResponse.basicDetails;
3664
- const hiddenFields = new Set([
3665
- "jobTitle",
3666
- "email",
3667
- "phoneNumber"
3668
- ].filter((field) => Boolean(basicDetailsData[field])));
3669
- if (hiddenFields.size > 0) {
3670
- const filterFields = (fields) => fields?.filter((field) => !hiddenFields.has(field));
3671
- if (derivedProps.requiredFields?.basicDetails) derivedProps.requiredFields.basicDetails = filterFields(derivedProps.requiredFields.basicDetails);
3672
- if (derivedProps.optionalFields?.basicDetails) derivedProps.optionalFields.basicDetails = filterFields(derivedProps.optionalFields.basicDetails);
3673
- }
3674
- }
3675
- const updatedDerivedProps = mandateIdVerificationForMotionCapture(hasLiveSelfieErrorCode || showIndividualMotionCapture?.value, derivedProps);
3676
- if (updatedDerivedProps) setDerivedProps(updatedDerivedProps);
3677
- }, [
3678
- fieldConfigurations,
3679
- legalEntityResponse,
3680
- fieldsFromCustomRules,
3681
- problems?.remediationActions,
3682
- problems?.missingData,
3683
- hasLiveSelfieErrorCode,
3684
- isInvitedEntity,
3685
- dataFromResponse?.basicDetails
3686
- ]);
3687
- /**
3688
- * Fetch the documents of the legal entity
3689
- */
3690
- useEffect$1(() => {
3691
- if (!legalEntityResponse?.documentDetails?.length) return;
3692
- documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then((res) => {
3693
- setExistingAttachments(res[0].attachments);
3694
- setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
3695
- }).catch(() => {
3696
- showToast({
3697
- label: t(($) => $["failedToFetchRelevantDocuments"]),
3698
- variant: "error"
3699
- });
3700
- });
3701
- }, []);
3702
- /**
3703
- * Configure forms based on obtained props
3704
- */
3705
- const forms = useMemo$1(() => {
3706
- return addValidityToForms(getRequiredForms(individualForms, derivedProps?.requiredFields, derivedProps?.optionalFields).filter((form) => {
3707
- const { formId } = form;
3708
- if (!isInstantVerificationEnabled && formId === individualForms.idVerificationMethod.formId) return false;
3709
- if (data.idVerificationMethod?.idVerificationMethod === "verifyByInvite" && ![
3710
- individualForms.uboQuestionnaire.formId,
3711
- individualForms.signatoryQuestionnaire.formId,
3712
- individualForms.basicDetails.formId,
3713
- individualForms.idVerificationMethod.formId,
3714
- individualForms.inviteDetails.formId,
3715
- "summary"
3716
- ].includes(formId)) return false;
3717
- if (isInvitedEntity && (formId === individualForms.signatoryQuestionnaire.formId || formId === individualForms.uboQuestionnaire.formId)) return false;
3718
- if (formId === individualForms.inviteDetails.formId) return data.idVerificationMethod?.idVerificationMethod === "verifyByInvite";
3719
- return true;
3720
- }), form.isValid, problems);
3721
- }, [
3722
- derivedProps,
3723
- form.isValid,
3724
- isInstantVerificationEnabled,
3725
- problems,
3726
- isInvitedEntity,
3727
- data.idVerificationMethod?.idVerificationMethod
3728
- ]);
3729
- const { mutateAsync: getIdVerificationStartCheck } = useIdVerificationStartCheck();
3730
- const handleInstantIdVerificationStartCheck = async (onfidoResponse, legalEntityId) => {
3731
- const providerId = idVerificationProviderId.value;
3732
- if (!providerId) throw Error("idVerificationProviderId not yet set");
3733
- await getIdVerificationStartCheck({
3734
- providerId,
3735
- legalEntityId,
3736
- captureMetadata: onfidoResponse
3737
- });
3738
- };
3739
- const roleTypes = isRoleFieldNeeded && parentLegalEntity ? getAllowedDecisionMakerRoles(parentLegalEntity, taskType, matchingScenario) : [];
3740
- const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
3741
- const { mutateAsync: createInvitationMutation } = useCreateInvitation();
3742
- const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
3743
- const submitLegalEntity = async ({ dataSubmitted, legalEntity, idDocumentType }) => {
3744
- let updatedLegalEntity;
3745
- /**
3746
- * Check whether the individual was already created. Can happen when the individual got created,
3747
- * but a subsequent call (POSTing documents or PATCHing parent LE) failed.
3748
- */
3749
- const existingLeId = legalEntityResponse?.id;
3750
- if (legalEntity.individual && legalEntityResponse?.individual?.support) legalEntity.individual.support = customerSupportPresubmitProcess(legalEntityResponse, legalEntity);
3751
- if (!existingLeId) {
3752
- updatedLegalEntity = await createLegalEntity(legalEntity);
3753
- userEvents.addTaskEvent("Success", {
3754
- actionType: "submit",
3755
- countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country,
3756
- roles: dataSubmitted.basicDetails?.role
3757
- });
3758
- } else {
3759
- updatedLegalEntity = await updateLegalEntity({
3760
- ...drop("type").from(legalEntity),
3761
- id: existingLeId
3762
- });
3763
- userEvents.addTaskEvent("Success", {
3764
- actionType: "submit",
3765
- countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country,
3766
- documentType: idDocumentType
3767
- });
3768
- }
3769
- return updatedLegalEntity;
3770
- };
3771
- const createInvite = async ({ inviteeLegalEntityId, inviteDetails }) => {
3772
- if (!parentLegalEntity?.id || !inviteDetails?.senderName || !inviteDetails?.message) {
3773
- logger.warn("createInvite: Missing required data", {
3774
- hasParentLegalEntity: !!parentLegalEntity?.id,
3775
- hasSenderName: !!inviteDetails?.senderName,
3776
- hasMessage: !!inviteDetails?.message
3777
- });
3778
- showToast({
3779
- label: t(($) => $["provideAllRequiredDetails"]),
3780
- variant: "error"
3781
- });
3782
- throw new Error("createInvite: Missing required data");
3783
- }
3784
- try {
3785
- const { url } = await createInvitationMutation({
3786
- organizationLegalEntityId: parentLegalEntity.id,
3787
- inviteeLegalEntityId,
3788
- data: {
3789
- facilitatorName: inviteDetails.senderName,
3790
- facilitatorMessage: inviteDetails.message,
3791
- sendEmail: true,
3792
- locale: i18n.language
3793
- }
3794
- });
3795
- logger.log("Invitation created successfully", {
3796
- inviteeLegalEntityId,
3797
- inviteLink: url
3798
- });
3799
- showToast({
3800
- label: t(($) => $["invitationSent"], { ns: "individual" }),
3801
- variant: "success"
3802
- });
3803
- } catch (error) {
3804
- logger.error("Failed to create invitation", {
3805
- error,
3806
- inviteeLegalEntityId
3807
- });
3808
- showToast({
3809
- label: t(($) => $["failedToUpdateDetails"]),
3810
- variant: "error"
3811
- });
3812
- throw error;
3813
- }
3814
- };
3815
- const submitDocuments = async ({ legalEntity, dataSubmitted }) => {
3816
- const idDocument = dataSubmitted.idVerificationMethod?.idDocument;
3817
- if (idDocument?.instantIdVerificationData) {
3818
- if (providerStatus?.statuses?.idDocument?.enabled === false) throw new Error("Provider unexpectedly disabled instant verification flow");
3819
- await handleInstantIdVerificationStartCheck(idDocument.instantIdVerificationData, legalEntity.id);
3820
- } else {
3821
- const formattedDocuments = await mapIndividualDocumentToApiDocument(dataSubmitted, legalEntity.id);
3822
- if (!formattedDocuments || formattedDocuments?.length === 0) {
3823
- if (existingAttachments?.length) logger.log("User has already uploaded documents and is not changing them, nothing needs to be done");
3824
- else logger.log("No documents to submit and no existing documents — skipping document upload");
3825
- return;
3826
- }
3827
- formattedDocuments[0].attachments = mergeAttachments(existingAttachments ?? [], formattedDocuments[0]?.attachments ?? []).filter((attachment) => attachment.content);
3828
- (await documentUtils.uploadDocuments(formattedDocuments, legalEntity.id))?.forEach((doc) => {
3829
- userEvents.addTaskEvent("Success", {
3830
- actionType: "upload",
3831
- documentType: doc.type,
3832
- fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? void 0
3833
- });
3834
- });
3835
- }
3836
- };
3837
- /**
3838
- * Compares an entity's existing roles with a new set of roles to see if they have changed.
3839
- * @param legalEntityId - The ID of the legal entity whose roles are being checked.
3840
- * @param existingEntityAssociations - The array of existing legal entity associations.
3841
- * @param newRoles - The array of new roles.
3842
- * @returns `true` if the roles have changed, `false` otherwise.
3843
- */
3844
- const hasRolesChanged = (legalEntityId, existingEntityAssociations, newRoles) => {
3845
- const existingRoles = existingEntityAssociations?.filter((association) => association.legalEntityId === legalEntityId).map(({ type }) => type);
3846
- return !doArraysMatch(existingRoles, newRoles);
3847
- };
3848
- const attachAssociationToParentLegalEntity = async ({ legalEntity, parentLE, dataSubmitted }) => {
3849
- let newRoles = null;
3850
- switch (taskType) {
3851
- case TaskTypes.DECISION_MAKER:
3852
- case TaskTypes.TRUST_MEMBER_COMPANY_OWNER:
3853
- case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER:
3854
- newRoles = dataSubmitted?.basicDetails?.role;
3855
- break;
3856
- case TaskTypes.TRUST_MEMBER_INDIVIDUAL:
3857
- case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL:
3858
- newRoles = trustMember?.roles;
3859
- break;
3860
- }
3861
- const existingEntityAssociations = getOwnEntityAssociations(parentLE);
3862
- if (newRoles && (hasRolesChanged(legalEntity?.id, existingEntityAssociations, newRoles) || dataFromResponse.basicDetails?.jobTitle !== dataSubmitted?.basicDetails?.jobTitle || hasNomineesChanged(dataFromResponse.basicDetails, dataSubmitted.basicDetails))) {
3863
- const updatedParentLegalEntity = { entityAssociations: [...newRoles.map((role) => ({
3864
- type: role,
3865
- legalEntityId: legalEntity.id,
3866
- ...DECISION_MAKER_TYPES_WITH_JOBTITLE.some((type) => type === role) && { jobTitle: dataSubmitted?.basicDetails?.jobTitle }
3867
- })) || [], ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []] };
3868
- const nomineeDataSource = dataSubmitted?.uboQuestionnaire;
3869
- if (nomineeDataSource && updatedParentLegalEntity.entityAssociations) updatedParentLegalEntity.entityAssociations = updatedParentLegalEntity.entityAssociations.map((ea) => attachNomineeToRole(ea, country, nomineeDataSource));
3870
- await updateLegalEntity({
3871
- ...updatedParentLegalEntity,
3872
- id: parentLE.id
3873
- });
3874
- }
3875
- };
3876
- async function rollbackAttachingAssociation(legalEntityId, parentLE) {
3877
- try {
3878
- await updateLegalEntity({
3879
- entityAssociations: (parentLE.entityAssociations ?? []).filter((entityAssociation) => entityAssociation.legalEntityId !== legalEntityId),
3880
- id: parentLE.id
3881
- });
3882
- } catch (err) {
3883
- logger.error(`Could not roll back attaching association ${legalEntityId} to ${parentLE.id}`, err);
3884
- }
3885
- }
3886
- /**
3887
- * OnSubmit will handle the creation and updating of Legal Entities (individuals)
3888
- * 1) Format component data to legal API data
3889
- * 2) Create/Update depending on legalEntity?.id
3890
- */
3891
- const onSubmit = async () => {
3892
- setLoadingStatus("loading");
3893
- const dataSubmitted = omitObscuredFieldsIfUnchanged(individualObscuredFields, data, dataFromResponse);
3894
- if (!dataSubmitted) return;
3895
- try {
3896
- const legalEntity = mapIndividualSchemaToLegalEntity(dataSubmitted, isFeatureEnabled, matchingScenario);
3897
- const idDocumentType = idDocumentTypeOptions.find(({ id }) => dataSubmitted?.idVerificationMethod?.idDocument?.idDocumentType === id)?.id;
3898
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolder || void 0);
3899
- clearToasts();
3900
- const submittedLegalEntity = await submitLegalEntity({
3901
- dataSubmitted,
3902
- legalEntity,
3903
- idDocumentType
3904
- });
3905
- setAccountHolder(accountHolder);
3906
- if (dataSubmitted.idVerificationMethod?.idVerificationMethod && dataSubmitted.idVerificationMethod.idVerificationMethod !== "existingDocument" || hasVerificationErrors) {
3907
- if (!(dataSubmitted?.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN))) await submitDocuments({
3908
- legalEntity: submittedLegalEntity,
3909
- dataSubmitted
3910
- });
3911
- }
3912
- if (parentLegalEntity) {
3913
- await attachAssociationToParentLegalEntity({
3914
- legalEntity: submittedLegalEntity,
3915
- parentLE: parentLegalEntity,
3916
- dataSubmitted
3917
- });
3918
- queryClient.invalidateQueries({
3919
- queryKey: ["legalEntity", parentLegalEntity.id],
3920
- refetchType: "all"
3921
- });
3922
- }
3923
- if (parentLegalEntity && dataSubmitted.idVerificationMethod?.idVerificationMethod === "verifyByInvite") try {
3924
- await createInvite({
3925
- inviteeLegalEntityId: submittedLegalEntity.id,
3926
- inviteDetails: dataSubmitted.inviteDetails
3927
- });
3928
- } catch (err) {
3929
- logger.error("An error occurred when creating invite, rolling back association of this LE");
3930
- await rollbackAttachingAssociation(submittedLegalEntity.id, parentLegalEntity);
3931
- throw err;
3932
- }
3933
- idNowModalChildEntityId.value = submittedLegalEntity;
3934
- setLoadingStatus("success");
3935
- externalOnSubmit?.(dataSubmitted, matchingScenario);
3936
- } catch (e) {
3937
- const eventsAdditionalData = {};
3938
- logger.error("Failed to update individual", e);
3939
- if (isValidationError(e)) {
3940
- const getErrors = processValidationErrors(e, TaskTypes.INDIVIDUAL);
3941
- if (getErrors && !Object.keys(getErrors).length) {
3942
- showToast({
3943
- label: t(($) => $["failedToUpdateDetails"]),
3944
- variant: "error"
3945
- });
3946
- eventsAdditionalData.unmappedErrorNames = e.invalidFields?.map((field) => field.name).filter(Boolean);
3947
- } else setValidationErrors(getErrors);
3948
- } else if (isMaintenanceModeError(e)) showToast({
3949
- label: t(($) => $["maintenanceModeMessage"]),
3950
- variant: "error",
3951
- duration: "indefinite"
3952
- });
3953
- else showToast({
3954
- label: t(($) => $["failedToUpdateDetails"]),
3955
- variant: "error"
3956
- });
3957
- setLoadingStatus("success");
3958
- userEvents.addTaskEvent("Encountered error", {
3959
- actionType: "submit",
3960
- additionalData: eventsAdditionalData,
3961
- returnType: e?.errorCode,
3962
- returnValue: e?.title || "backend"
3963
- });
3964
- }
3965
- };
3966
- const datasetUtils = datasetUtilities(i18n.language);
3967
- const formatIdDocument = (idDocument) => {
3968
- if (!idDocument) return void 0;
3969
- const documentType = idDocument?.instantIdVerificationData ? onfidoDocumentTypeMapping.find((document) => idDocument.instantIdVerificationData?.document_front.type === document.id) : idDocumentTypeOptions.find(({ id }) => idDocument.idDocumentType === id);
3970
- if (!documentType) return void 0;
3971
- const frontPage = idDocument.idFrontPage?.[0];
3972
- const backPage = idDocument.idBackPage?.[0];
3973
- if (!frontPage) return void 0;
3974
- return {
3975
- documentType: t(($) => $[documentType.name]),
3976
- ...backPage && documentType.hasBackPage ? {
3977
- frontPage: frontPage.name,
3978
- backPage: backPage.name
3979
- } : { fileName: frontPage.name }
3980
- };
3981
- };
3982
- const formatFileSummaryData = ({ idVerificationMethod, manualIdUpload, proofOfNationalId, proofOfResidency, proofOfRelationship }) => {
3983
- const proofOfNationalIdFile = proofOfNationalId?.proofOfNationalId?.[0];
3984
- const proofOfResidencyFile = proofOfResidency?.proofOfResidency?.[0];
3985
- const proofOfRelationshipFile = proofOfRelationship?.proofOfRelationship?.[0];
3986
- const idDocument = idVerificationMethod?.idVerificationMethod === "manualVerification" ? manualIdUpload : idVerificationMethod?.idDocument;
3987
- return {
3988
- ...(idDocument?.idDocumentType || idDocument?.instantIdVerificationData) && { idDocument: formatIdDocument(idDocument) },
3989
- ...proofOfNationalIdFile && { proofOfNationalId: { fileName: proofOfNationalIdFile.name } },
3990
- ...proofOfResidencyFile && { proofOfResidency: {
3991
- fileName: proofOfResidencyFile.name,
3992
- description: proofOfResidency?.description
3993
- } },
3994
- ...proofOfRelationshipFile && { proofOfRelationship: {
3995
- fileName: proofOfRelationshipFile.name,
3996
- description: proofOfRelationship?.description
3997
- } }
3998
- };
3999
- };
4000
- const isManualVerificationOrExistingDoc = (idVerificationMethod) => idVerificationMethod === "manualVerification" || idVerificationMethod === "existingDocument";
4001
- const formatDataForSummary = () => {
4002
- let summaryData = cloneObject(data);
4003
- if (summaryData?.basicDetails?.phoneNumber) summaryData.basicDetails.phoneNumber = summaryData.basicDetails.phoneNumber.number;
4004
- if (summaryData.additionalPersonalDetails?.nationality) summaryData.additionalPersonalDetails.nationality = datasetUtils.getCountryName(summaryData.additionalPersonalDetails.nationality);
4005
- if (data.additionalPersonalDetails) if (isJapanLocalizationEnabled(isFeatureEnabled, country)) summaryData.additionalPersonalDetails = {
4006
- ...drop(...JP_ADDRESS_REQUIRED_FIELDS).from(summaryData.additionalPersonalDetails),
4007
- ...mapJpAddressSummary(data.additionalPersonalDetails, datasetUtils)
4008
- };
4009
- else summaryData.additionalPersonalDetails = {
4010
- ...summaryData.additionalPersonalDetails,
4011
- ...mapAddressLabels(data.additionalPersonalDetails, datasetUtils)
4012
- };
4013
- if (summaryData.basicDetails?.accountHolder) summaryData.basicDetails.accountHolder = t(($) => $[summaryData.basicDetails.accountHolder]);
4014
- if (summaryData.additionalPersonalDetails?.birthDate) summaryData.additionalPersonalDetails.birthDate = localizeDateString(summaryData.additionalPersonalDetails.birthDate, i18n.language);
4015
- if (summaryData.idVerificationMethod?.idVerificationMethod === "verifyByInvite") summaryData.idVerificationMethod = {
4016
- idVerificationMethod: preTranslatedSummaryItem(t(($) => $["type"], { ns: "individual" }), t(($) => $["inviteDecisionMaker"], { ns: "individual" })),
4017
- sender: preTranslatedSummaryItem(t(($) => $["sender"], { ns: "individual" }), data?.inviteDetails?.senderName ?? null),
4018
- message: preTranslatedSummaryItem(t(($) => $["message"], { ns: "individual" }), data?.inviteDetails?.message ?? null)
4019
- };
4020
- if (isManualVerificationOrExistingDoc(summaryData.idVerificationMethod?.idVerificationMethod) || summaryData.proofOfResidency) {
4021
- const fileSummaryData = formatFileSummaryData(data);
4022
- summaryData = {
4023
- ...summaryData,
4024
- ...fileSummaryData
4025
- };
4026
- summaryData.manualIdUpload = { ...summaryData.idDocument };
4027
- summaryData.idVerificationMethod.idDocument = { ...summaryData.idDocument };
4028
- }
4029
- if (summaryData.additionalPersonalDetails?.taxInformation) {
4030
- const taxInformationByNationality = summaryData.additionalPersonalDetails.taxInformation.find((taxId) => taxId.country === data.additionalPersonalDetails?.nationality);
4031
- if (taxInformationByNationality) {
4032
- delete summaryData.additionalPersonalDetails.taxInformation;
4033
- summaryData.additionalPersonalDetails[taxInformationByNationality.type] = taxInformationByNationality.number;
4034
- }
4035
- if (!taxInformationByNationality) {
4036
- const taxInformationByCountry = summaryData.additionalPersonalDetails.taxInformation.find((taxId) => taxId.country === data.additionalPersonalDetails?.country);
4037
- if (taxInformationByCountry) {
4038
- delete summaryData.additionalPersonalDetails.taxInformation;
4039
- summaryData.additionalPersonalDetails[taxInformationByCountry.type] = taxInformationByCountry.number;
4040
- }
4041
- }
4042
- }
4043
- if (summaryData?.signatoryQuestionnaire) summaryData.signatoryQuestionnaire = data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES ? [t(($) => $["signatorySummaryLabel"])] : [];
4044
- if (summaryData?.uboQuestionnaire) {
4045
- const roleFieldToLabelMap = {
4046
- isOwner: "ownerSummaryLabel",
4047
- isControllingPerson: "controllingPersonSummaryLabel",
4048
- isDirector: "directorSummaryLabel"
4049
- };
4050
- summaryData.uboQuestionnaire = Object.keys(roleFieldToLabelMap).flatMap((field) => data?.uboQuestionnaire?.[field] === GuidanceQuestionValues.YES ? [t(($) => $[roleFieldToLabelMap[field]], { ns: "individual" })] : []);
4051
- }
4052
- return summaryData;
4053
- };
4054
- const omittedKeysForSummary = [
4055
- ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
4056
- ...data?.additionalPersonalDetails?.idNumberExempt ? ["idNumber"] : [],
4057
- ...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
4058
- ];
4059
- const isUploadEmpty = !data?.manualIdUpload || Object.keys(data?.manualIdUpload).length === 0;
4060
- const omittedFormsForSummary = [...data?.idVerificationMethod?.idVerificationMethod === "instantVerification" || isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) && isUploadEmpty || data?.idVerificationMethod?.idVerificationMethod === "verifyByInvite" ? ["idDocument", "inviteDetails"] : [], ...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod", "inviteDetails"] : []];
4061
- const customLabelsForSummary = { idVerificationMethod: {
4062
- instantVerification: "idVerificationMethod",
4063
- manualVerification: "idDocument",
4064
- existingDocument: "idDocument",
4065
- verifyByInvite: "idVerificationMethod"
4066
- }[data?.idVerificationMethod?.idVerificationMethod ?? ""] ?? "idDocument" };
4067
- const { handleNextClick, handleBackClick, activeForm, shouldValidate, gotoFormByFormIndex, gotoFormByFormId, steps } = useFormComposer({
4068
- problems,
4069
- externalBackClick,
4070
- forms,
4071
- onSubmit,
4072
- triggerValidation: form.triggerValidation
4073
- });
4074
- const isBafinSignatory = data?.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && scenarios?.includes(Scenarios.L_BAFIN);
4075
- const shouldNavigateToAdditionalPersonalDetails = isBafinSignatory && shouldNavigateToAdditionalPersonalDetailsForMissingData.value && Boolean(legalEntityResponse?.id) && (!data?.additionalPersonalDetails?.placeOfBirth || !data?.additionalPersonalDetails?.nationality);
4076
- if (isBafinSignatory && !hasBafinNavigated) {
4077
- setHasBafinNavigated(true);
4078
- shouldNavigateToAdditionalPersonalDetailsForMissingData.value = false;
4079
- gotoFormByFormId(shouldNavigateToAdditionalPersonalDetails ? individualForms.additionalPersonalDetails.formId : individualForms.signatoryQuestionnaire.formId);
4080
- }
4081
- const disableNextButton = activeForm?.formId === "idVerificationMethod" && !activeForm?.isValid || isNextStepDisabled.value;
4082
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Show, {
4083
- when: shouldShowIdNowModal,
4084
- children: /* @__PURE__ */ jsx(IdNowVerificationModal, { handleFinish: handleHomeClick })
4085
- }), /* @__PURE__ */ jsx(FormContextProvider, {
4086
- form,
4087
- children: /* @__PURE__ */ jsx(FormFlow, {
4088
- summary: {
4089
- data: formatDataForSummary(),
4090
- omitted: {
4091
- keys: omittedKeysForSummary,
4092
- forms: omittedFormsForSummary
4093
- },
4094
- problems,
4095
- labels: customLabelsForSummary
4096
- },
4097
- asModal,
4098
- currentStep: steps.current,
4099
- disableNextButton,
4100
- forms,
4101
- activeForm,
4102
- gotoFormByFormIndex,
4103
- gotoFormByFormId,
4104
- handleBackClick,
4105
- handleCancelClick: handleHomeClick,
4106
- handleNextClick: nextHandler || handleNextClick,
4107
- loadingStatus,
4108
- totalSteps: steps.total,
4109
- children: /* @__PURE__ */ jsx(Individual, {
4110
- ...derivedProps,
4111
- requiredFields,
4112
- data,
4113
- defaultCountry: country,
4114
- activeForm,
4115
- forms,
4116
- scenarios,
4117
- taskType,
4118
- problems,
4119
- onNext: handleNextClick,
4120
- onBack: handleBackClick,
4121
- legalEntityId: legalEntityResponse?.id,
4122
- allowedRoles: roleTypes,
4123
- shouldValidate,
4124
- accountHolder,
4125
- parentLegalEntity,
4126
- trustedFields,
4127
- trustedFieldsProvider,
4128
- trustedRoles,
4129
- setNextHandler,
4130
- handleHomeClick,
4131
- isInvitedEntity,
4132
- invitedEntityDetails
4133
- })
4134
- })
4135
- })] });
4136
- }
4137
- //#endregion
4138
- export { individualForms as n, IndividualDropin as t };