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