@adyen/kyc-components 4.19.1 → 4.20.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/dist/{Accordion-BnhH5-eC.js → Accordion-BWdAGMRb.js} +1 -1
  2. package/dist/{AccountSetupRejected-BGB8hSYN.js → AccountSetupRejected-N5q1VKpW.js} +2 -2
  3. package/dist/AdaptiveWorkflow-C8N4ayEt.js +5112 -0
  4. package/dist/{AdaptiveWorkflowComponent-BOncR2kZ.js → AdaptiveWorkflowComponent-CEMgH36B.js} +36 -36
  5. package/dist/{Address-B_QN7vdN.js → Address-DQlehM6f.js} +8 -7
  6. package/dist/{AddressField-08w6MaYb.js → AddressField-BnboPpBe.js} +12 -253
  7. package/dist/{Avatar-Y_RdG_YY.js → Avatar-CeZIQS8n.js} +1 -1
  8. package/dist/{BusinessFinancingDropin-ndYk8iAQ.js → BusinessFinancingDropin-CFKrcdPb.js} +33 -32
  9. package/dist/{BusinessFinancingPage-DK_ijiz0.js → BusinessFinancingPage-DIrEOTbn.js} +33 -33
  10. package/dist/{utils-CLsECypA.js → BusinessRegistrationNumberField-DGBqMCwU.js} +301 -53
  11. package/dist/{BusinessTypeSelectionPage-C4CrQQZp.js → BusinessTypeSelectionPage-CyMTri8M.js} +18 -17
  12. package/dist/{Button-BuhgDsyo.js → Button-Cm7cT6BX.js} +1 -1
  13. package/dist/{Checkbox-CFN5ywvv.js → Checkbox-faFUul66.js} +1 -1
  14. package/dist/{CompanyRegistrationNumberTypeSelector-DYJ2XeCC.js → CompanyRegistrationNumberTypeSelector-KkPiHDQk.js} +8 -8
  15. package/dist/{ContactDetails-BBVQtkU_.js → ContactDetails-CQZ7kMSU.js} +7 -7
  16. package/dist/{ContextGuidance-BBQsTVLG.js → ContextGuidance-CpLYhcU8.js} +2 -2
  17. package/dist/{CountryField-uue7DBeg.js → CountryField-DQnWXgAu.js} +26 -21
  18. package/dist/{Currency-Chq-e9bU.js → Currency-DJTE2WJJ.js} +8 -59
  19. package/dist/{CustomerSupport-DEiWGRjz.js → CustomerSupport-BkE-Ej6L.js} +14 -14
  20. package/dist/{DataConflictsModal-BrGRGVYC.js → DataConflictsModal-BhZpZhFP.js} +7 -7
  21. package/dist/{DebugModal-abFf-6Vt.js → DebugModal-C_O14NUN.js} +10 -10
  22. package/dist/{DecisionMakerDetails-DcXca6HU.js → DecisionMakerDetails-BZEv2fPu.js} +17 -17
  23. package/dist/{DecisionMakerDetailsPage-DJ51iD7A.js → DecisionMakerDetailsPage-DhCtiSzf.js} +12 -12
  24. package/dist/{DecisionMakers-k4HO0MWG.js → DecisionMakers-BPLn2iHA.js} +18 -18
  25. package/dist/{Dropzone-CvQDmVPr.js → Dropzone-DAvxNuAu.js} +7 -7
  26. package/dist/{EmbeddedStatus-sHJnhw3K.js → EmbeddedStatus-uz3Ivsyw.js} +4 -4
  27. package/dist/{EndStateLayout-CddZpAGD.js → EndStateLayout-BUK64Vqu.js} +2 -2
  28. package/dist/{EntityAssociation-zFxGuJvi.js → EntityAssociation-CBbcX-5M.js} +7 -7
  29. package/dist/{ErrorPanel-CCn1oJPR.js → ErrorPanel-C2hG0lLe.js} +4 -4
  30. package/dist/GlobalEntryModal-cQF6Bfim.js +353 -0
  31. package/dist/{GlobalEntryPage-DEhiUBgp.js → GlobalEntryPage-C6OnSwBj.js} +10 -10
  32. package/dist/{Image-Dc5Xg1_Y.js → Image-8SOcICah.js} +1 -1
  33. package/dist/{Individual.rules-CC9Eyoct.js → Individual.rules-D1Mmr7tv.js} +7 -11
  34. package/dist/{IndividualDropin-bKaThfzK.js → IndividualDropin-KG_mOjri.js} +64 -67
  35. package/dist/{InputDate-Cp2ga0F5.js → InputDate-DDVX2D-5.js} +2 -2
  36. package/dist/{InputText-CRkApOKK.js → InputText-Cf9ccCaj.js} +5 -5
  37. package/dist/{Introduction-BONXNscX.js → Introduction-Dsy_e4OL.js} +8 -8
  38. package/dist/{InvitedDecisionMakerComponent-DqD7d-N0.js → InvitedDecisionMakerComponent-Bzj7Szw8.js} +41 -41
  39. package/dist/{JpAddress-Bdm7sjAt.js → JpAddress-CMYhw2Zl.js} +19 -17
  40. package/dist/{JpAddress.module-CoDcokRL.js → JpAddress.module-CiY5uzmL.js} +4 -4
  41. package/dist/{JpAddressFields-b817uuhw.js → JpAddressFields-DqJ7Am2I.js} +15 -14
  42. package/dist/{LegalCompanyNameField-1zyIWSU7.js → LegalCompanyNameField-DGdSduXu.js} +5 -5
  43. package/dist/{LegalRepresentativeDetailsPage-75U_fxIM.js → LegalRepresentativeDetailsPage-DODrlxF0.js} +8 -8
  44. package/dist/{Link-PH3F7iTO.js → Link-B7RA2gSt.js} +1 -1
  45. package/dist/{ListItem-B-gDVdRO.js → ListItem-Cy46BXUv.js} +27 -4
  46. package/dist/{MaskedInput-BpgT8ais.js → MaskedInput-BZLm8L47.js} +11 -11
  47. package/dist/{Modal-BYdlsXkf.js → Modal-nylR9F4X.js} +1 -1
  48. package/dist/{Name-B9VfIoGy.js → Name-C0ti1xY6.js} +5 -5
  49. package/dist/{NewSummary-DtUQzQfp.js → NewSummary-DDwQJV7w.js} +6 -6
  50. package/dist/{PatriotActDisclosure-DO1km-aw.js → PatriotActDisclosure-CB0N3iIz.js} +15 -15
  51. package/dist/{PayoutDetailsDropin-DeSQiWmr.js → PayoutDetailsDropin-9LoGCmko.js} +187 -135
  52. package/dist/{PayoutDetailsPage-CdAXxyMl.js → PayoutDetailsPage-DV8fIktn.js} +10 -10
  53. package/dist/{RadioGroup-B9MFxAgn.js → RadioGroup-BUwhfue7.js} +3 -3
  54. package/dist/{Review-Ce8kWuwf.js → Review-C2JLh6M0.js} +8 -8
  55. package/dist/{RootBusinessDetailsPage-W2nhUOOs.js → RootBusinessDetailsPage-D-T5SbYt.js} +9 -9
  56. package/dist/{RootBusinessLinesPage-cZsTzIu_.js → RootBusinessLinesPage-BZNLFGSY.js} +30 -30
  57. package/dist/{RootIndividualDetailsPage-NoOigAbF.js → RootIndividualDetailsPage-wO9DNKWn.js} +9 -9
  58. package/dist/{Select-yOtg-61e.js → Select-B5Mo0Bpw.js} +12 -13
  59. package/dist/{SignPCIComponent-Djf7vjw5.js → SignPCIComponent-CZmCa0AY.js} +56 -54
  60. package/dist/{SingpassSelection-Bf7AnQ_l.js → SingpassSelection-BTZe82Q8.js} +6 -6
  61. package/dist/SoleProprietorshipPage-Dfzyn6Br.js +70 -0
  62. package/dist/{SourceOfFundsPage-4dDzWrhf.js → SourceOfFundsPage-l899LDLv.js} +58 -44
  63. package/dist/{StructuredList-BU29ceSG.js → StructuredList-DR8Fb1tc.js} +4 -4
  64. package/dist/{TaskListItem-BlcJJS_V.js → TaskListItem-1n3vYDAz.js} +11 -11
  65. package/dist/{TaskVerificationStatus-ITLSeoau.js → TaskVerificationStatus-DMj8rsZ_.js} +1 -1
  66. package/dist/{TaxReportingDropin-Cw35lKwa.js → TaxReportingDropin-BYOpjW8V.js} +18 -18
  67. package/dist/{TermsOfServiceManagement-_xrvP8-7.js → TermsOfServiceManagement-BUvv59rD.js} +68 -66
  68. package/dist/{TextArea-BzCbFjRp.js → TextArea-CoS-i-FF.js} +3 -3
  69. package/dist/{TrustDetailsPage-k3accZEy.js → TrustDetailsPage-BQjA8lmD.js} +341 -318
  70. package/dist/TrustMemberCompanyPage-3189PHUn.js +109 -0
  71. package/dist/TrustMemberIndividualPage-DOFGzN7Z.js +110 -0
  72. package/dist/{TrustMemberRoleAndTypePage-BlAptww5.js → TrustMemberRoleAndTypePage-nDSoM_rw.js} +19 -19
  73. package/dist/{TrustMembersOverview-B8H3GF08.js → TrustMembersOverview-CxiKjCLV.js} +14 -14
  74. package/dist/UnincorporatedPartnershipIndividualPage-D-46tLiw.js +79 -0
  75. package/dist/{UnincorporatedPartnershipMemberCompanyPage-CgrnQ800.js → UnincorporatedPartnershipMemberCompanyPage-CCnm-ShL.js} +37 -37
  76. package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-BMNXdGp9.js → UnincorporatedPartnershipMemberRoleAndTypePage-CsECHFgr.js} +11 -11
  77. package/dist/{UnincorporatedPartnershipMembersOverview-r2Dcn7c2.js → UnincorporatedPartnershipMembersOverview-C8fwIn45.js} +9 -9
  78. package/dist/{VerificationErrorAlert-T9cdpMgB.js → VerificationErrorAlert-7hKN39sx.js} +4 -4
  79. package/dist/{accountHolderUtils-B3AFComV.js → accountHolderUtils-Cw7X31mH.js} +1 -1
  80. package/dist/adyen-business-financing.js +34 -34
  81. package/dist/adyen-individual-configuration.js +34 -34
  82. package/dist/adyen-individual-status.js +33 -33
  83. package/dist/adyen-invited-decision-maker.js +3 -3
  84. package/dist/adyen-onboarding.js +59 -59
  85. package/dist/adyen-terms-of-service-management.js +3 -3
  86. package/dist/adyen-terms-of-service-status.js +6 -6
  87. package/dist/adyen-transfer-instrument-configuration.js +33 -33
  88. package/dist/adyen-transfer-instrument-management.js +40 -40
  89. package/dist/adyen-verification-status.js +6 -6
  90. package/dist/{bafinUtils-DEVMdolf.js → bafinUtils-vdTD2Ec5.js} +19 -19
  91. package/dist/bg-BG-Bmveyt6S.js +7 -0
  92. package/dist/{constants-Bmm0unff.js → constants-Bs5FgdWg.js} +4 -4
  93. package/dist/{country-BxigZW1s.js → country-IYuKDSdC.js} +14 -2
  94. package/dist/cs-CZ-D5CQd_YI.js +7 -0
  95. package/dist/da-DK-Bl0-8FN4.js +7 -0
  96. package/dist/de-DE-Hah2EvAY.js +7 -0
  97. package/dist/el-GR-C9KGlGa7.js +7 -0
  98. package/dist/{en-US-CWDI7JKT.js → en-US-BFM81i9K.js} +3 -1
  99. package/dist/{en-US-CeiLSh8o.js → en-US-BorLJXJ4.js} +3 -1
  100. package/dist/en-US-Del1h5SS.js +23 -0
  101. package/dist/en-US-DqhKW1eC.js +7 -0
  102. package/dist/en-US-X8pjkwa3.js +7 -0
  103. package/dist/{omitObscuredFieldsIfUnchanged-DESEEOmD.js → error-BatJzHF5.js} +19 -3
  104. package/dist/es-ES-DSwi-qfd.js +7 -0
  105. package/dist/es-LA-0IrX8yr2.js +7 -0
  106. package/dist/es-LA-1H8dAUVR.js +7 -0
  107. package/dist/es-LA-BjZq9RK_.js +7 -0
  108. package/dist/{es-LA-DU9jNyAv.js → es-LA-CGrMi4rR.js} +2 -2
  109. package/dist/{es-LA-DMpf5gAW.js → es-LA-DBBkFhgU.js} +2 -2
  110. package/dist/et-EE-BGpsJPjk.js +7 -0
  111. package/dist/fi-FI-BdrXeX9d.js +7 -0
  112. package/dist/{form-rules-wh_oE1AN.js → form-rules-DV3hxYqZ.js} +2 -2
  113. package/dist/formatValidationError-CZ5MeYBS.js +23 -0
  114. package/dist/fr-FR-hleHEr-Y.js +7 -0
  115. package/dist/{getProblemsForEntity-set4Krmx.js → getProblemsForEntity-DStlTvE-.js} +2 -2
  116. package/dist/{getTrustedDecisionMakers-B_XpRta-.js → getTrustedDecisionMakers-CAbhvydj.js} +2 -2
  117. package/dist/hr-HR--ti3n_XO.js +7 -0
  118. package/dist/{http-CFac2y4i.js → http-D6AdUBhO.js} +57 -2
  119. package/dist/hu-HU-D9Avt-9f.js +7 -0
  120. package/dist/it-IT-Dq5z7p1-.js +7 -0
  121. package/dist/ja-JP-Dyhw0Ycj.js +7 -0
  122. package/dist/japanSupportUtils-H5Zfox2v.js +11 -0
  123. package/dist/{localizeDateString-BRB4gPDZ.js → localizeDateString-D-MlYN4V.js} +1 -1
  124. package/dist/lt-LT-BMI4JzrS.js +7 -0
  125. package/dist/lv-LV-LkNZQ__4.js +7 -0
  126. package/dist/mapExistingFile-LvvzPjnk.js +55 -0
  127. package/dist/{mapJpAddressSchemaToAddressLocalizations-CoJiTAbL.js → mapJpAddressSchemaToAddressLocalizations-6nfrRniy.js} +3 -51
  128. package/dist/{mapLegalEntityToIndividualSchema-C-vFEBSR.js → mapLegalEntityToIndividualSchema-1JDK92Nc.js} +8 -8
  129. package/dist/{mapTransferInstrumentToPayoutAccount-DAXQcZKf.js → mapTransferInstrumentToPayoutAccount-cKBtK0Qx.js} +2 -2
  130. package/dist/nl-NL-CC2r7Ldv.js +7 -0
  131. package/dist/no-NO-V7_rz3uN.js +7 -0
  132. package/dist/{patternValidators-D8HZxfV2.js → patternValidators-tRq-KPvW.js} +1 -1
  133. package/dist/pl-PL-2QyKX67Y.js +7 -0
  134. package/dist/{processCapabilities-zti_0yUx.js → processCapabilities-BSpmJOEd.js} +13 -13
  135. package/dist/{processValidationErrors-J6ltKXc4.js → processValidationErrors-PJV6CPG2.js} +2 -2
  136. package/dist/pt-BR-D08Fo1qY.js +7 -0
  137. package/dist/pt-PT-BAQWYDe6.js +7 -0
  138. package/dist/{resolveEnvironment-C1htMD-5.js → resolveEnvironment-df20S4SQ.js} +39 -39
  139. package/dist/ro-RO-wG0rfL5w.js +7 -0
  140. package/dist/sk-SK-DJinBnS1.js +7 -0
  141. package/dist/sl-SI-DUaLO_J7.js +7 -0
  142. package/dist/style.css +153 -139
  143. package/dist/styles-DYaAeu4q.js +153 -139
  144. package/dist/sv-SE-5uxyEq2a.js +7 -0
  145. package/dist/toFullWidth-Dgy4X4i8.js +52 -0
  146. package/dist/{translation-CcKrUksA.js → translation-DH4IlMCP.js} +6 -2
  147. package/dist/types/adaptiveWorkflow/component-registry-v2.d.ts +46 -0
  148. package/dist/types/adaptiveWorkflow/components/Fields/IdentityScreening/IdentityScreeningWorkflow.d.ts +1 -2
  149. package/dist/types/adaptiveWorkflow/components/Layout/ComponentGroup/ComponentGroup.d.ts +6 -0
  150. package/dist/types/adaptiveWorkflow/components/Layout/ComponentGroup/contextMap.d.ts +5 -0
  151. package/dist/types/adaptiveWorkflow/components/Layout/DynamicForm/DynamicForm.d.ts +6 -0
  152. package/dist/types/adaptiveWorkflow/components/Layout/DynamicForm/useCustomerDataV2.d.ts +28 -0
  153. package/dist/types/adaptiveWorkflow/components/Layout/Steps/AcceptTermsOfServiceWorkflow.d.ts +2 -0
  154. package/dist/types/adaptiveWorkflow/components/Layout/Steps/IdentityScreeningWorkflow.d.ts +2 -0
  155. package/dist/types/adaptiveWorkflow/components/Layout/Steps/SourceOfFundsWorkflow.d.ts +2 -0
  156. package/dist/types/adaptiveWorkflow/components/Layout/Steps/Step/Step.d.ts +2 -0
  157. package/dist/types/adaptiveWorkflow/components/Layout/Steps/Step/contextMap.d.ts +2 -0
  158. package/dist/types/adaptiveWorkflow/components/Layout/Steps/TaxReportingWorkflow.d.ts +2 -0
  159. package/dist/types/adaptiveWorkflow/components/Layout/Task/Task.d.ts +9 -0
  160. package/dist/types/adaptiveWorkflow/components/Layout/Task/contextMap.d.ts +2 -0
  161. package/dist/types/adaptiveWorkflow/components/Layout/TaskGroup/TaskGroup.d.ts +5 -0
  162. package/dist/types/adaptiveWorkflow/components/Layout/TaskGroup/contextMap.d.ts +2 -0
  163. package/dist/types/adaptiveWorkflow/components/Layout/UboTaskItem/UboTaskItem.d.ts +8 -0
  164. package/dist/types/adaptiveWorkflow/components/Layout/Workflow/Workflow.d.ts +8 -0
  165. package/dist/types/adaptiveWorkflow/components/NodeRenderer/CompoundFieldRenderer.d.ts +6 -0
  166. package/dist/types/adaptiveWorkflow/components/NodeRenderer/LayoutRenderer.d.ts +7 -0
  167. package/dist/types/adaptiveWorkflow/components/NodeRenderer/NodeRenderer.d.ts +20 -0
  168. package/dist/types/adaptiveWorkflow/components/NodeRenderer/SimpleFieldRenderer.d.ts +6 -0
  169. package/dist/types/adaptiveWorkflow/components/NodeRenderer/SpecializedStepRenderer.d.ts +7 -0
  170. package/dist/types/adaptiveWorkflow/components/WorkflowHeading/WorkflowHeading.d.ts +1 -1
  171. package/dist/types/adaptiveWorkflow/components/types.d.ts +31 -0
  172. package/dist/types/adaptiveWorkflow/context/TaskStepperContext/TaskStepperContext.d.ts +19 -0
  173. package/dist/types/adaptiveWorkflow/context/TaskStepperContext/TaskStepperContextProvider.d.ts +22 -0
  174. package/dist/types/adaptiveWorkflow/context/TaskStepperContext/useHideTaskStepper.d.ts +6 -0
  175. package/dist/types/adaptiveWorkflow/context/TaskStepperContext/useTaskStepperContext.d.ts +1 -0
  176. package/dist/types/adaptiveWorkflow/utils/getNodeType.d.ts +11 -0
  177. package/dist/types/adaptiveWorkflow/utils/getProgressSteps.d.ts +4 -0
  178. package/dist/types/api/adaptive/adaptiveWorkflow.types.d.ts +2 -1
  179. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +6 -1
  180. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/usePayoutAccountFormat.d.ts +10 -0
  181. package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +2 -29
  182. package/dist/types/components/Business/forms/AdditionalInformation/utils.d.ts +0 -27
  183. package/dist/types/components/Business/forms/BasicInformation/types.d.ts +2 -2
  184. package/dist/types/components/Business/forms/BusinessDetails/BusinessDetails.d.ts +2 -2
  185. package/dist/types/components/Business/forms/rules.d.ts +7 -3
  186. package/dist/types/components/Business/hooks/useBusinessDetailsData.d.ts +2 -3
  187. package/dist/types/components/Business/hooks/useSubmitBusinessDetails.types.d.ts +3 -3
  188. package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +2 -2
  189. package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +2 -2
  190. package/dist/types/components/Business/pages/RootBusinessDetailsPage.d.ts +1 -1
  191. package/dist/types/components/{SoleProprietorship → Business}/pages/SoleProprietorshipPage.d.ts +2 -2
  192. package/dist/types/components/{Trust → Business}/pages/TrustMemberCompanyPage.d.ts +3 -3
  193. package/dist/types/components/{UnincorporatedPartnership → Business}/pages/UnincorporatedPartnershipMemberCompanyPage.d.ts +3 -3
  194. package/dist/types/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsDropin.d.ts +1 -1
  195. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +5 -5
  196. package/dist/types/components/Business/utils/utils.d.ts +3 -5
  197. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +93 -93
  198. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +5 -5
  199. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +2 -1
  200. package/dist/types/components/GlobalEntry/constants.d.ts +13 -3
  201. package/dist/types/components/GlobalEntry/fields/EntitySetupField/types.d.ts +1 -1
  202. package/dist/types/components/GlobalEntry/fields/PaperworkQuestionnaire/PaperworkQuestionnaire.d.ts +3 -0
  203. package/dist/types/components/GlobalEntry/fields/PaperworkQuestionnaire/types.d.ts +5 -0
  204. package/dist/types/components/GlobalEntry/fields/UnincorporatedOrganizationTypeField/UnincorporatedOrganizationTypeField.d.ts +2 -0
  205. package/dist/types/components/GlobalEntry/fields/UnincorporatedOrganizationTypeField/types.d.ts +5 -0
  206. package/dist/types/components/GlobalEntry/forms/RegistrationInformation/RegistrationInformation.d.ts +5 -0
  207. package/dist/types/components/GlobalEntry/forms/RegistrationInformation/types.d.ts +3 -0
  208. package/dist/types/components/GlobalEntry/tasks/types.d.ts +2 -0
  209. package/dist/types/components/GlobalEntry/validate.d.ts +9 -0
  210. package/dist/types/components/Individual/fields/DriversLicense/DriversLicense.types.d.ts +2 -2
  211. package/dist/types/components/Individual/forms/AdditionalPersonalDetails/Identity/TypeOfIdentity/index.d.ts +2 -2
  212. package/dist/types/components/Individual/forms/GuidanceQuestion/GuidanceQuestion.d.ts +4 -3
  213. package/dist/types/components/{Trust → Individual}/pages/TrustMemberIndividualPage.d.ts +2 -2
  214. package/dist/types/components/{UnincorporatedPartnership → Individual}/pages/UnincorporatedPartnershipIndividualPage.d.ts +2 -2
  215. package/dist/types/components/Shared/fields/RegistrationAndOperationalAddressFields/RegistrationAndOperationalAddressFields.d.ts +3 -0
  216. package/dist/types/components/Shared/fields/RegistrationAndOperationalAddressFields/types.d.ts +53 -0
  217. package/dist/types/components/Shared/fields/RegistrationAndOperationalAddressFields/utils.d.ts +28 -0
  218. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/TaxIdNumberTypeSelector.d.ts +2 -2
  219. package/dist/types/components/Shared/forms/Address/SearchAddress.d.ts +2 -1
  220. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  221. package/dist/types/components/Trust/forms/Trust/rules.d.ts +12 -0
  222. package/dist/types/components/Trust/forms/Trust/types.d.ts +4 -4
  223. package/dist/types/components/Trust/forms/TrustRegistrationAddress/TrustRegistrationAddress.d.ts +2 -0
  224. package/dist/types/components/Trust/forms/TrustRegistrationAddress/types.d.ts +9 -0
  225. package/dist/types/components/Trust/mapping/mapTrustToLegalEntity.d.ts +2 -2
  226. package/dist/types/components/Trust/tasks/TrustDropin/Trust.d.ts +2 -1
  227. package/dist/types/components/Trust/utils/formatDataForSummary.d.ts +6 -0
  228. package/dist/types/components/UnincorporatedPartnership/mapping/mapUnincorporatedPartnershipToLegalEntity.d.ts +2 -2
  229. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRadioGroup.d.ts +2 -2
  230. package/dist/types/components/ui/atoms/Field/Field.types.d.ts +8 -2
  231. package/dist/types/components/ui/atoms/TileGroup/TileGroup.d.ts +3 -3
  232. package/dist/types/context/WorkflowContext/WorkflowContext.d.ts +3 -1
  233. package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +3 -3
  234. package/dist/types/hooks/useForm/types.d.ts +3 -2
  235. package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +1 -1
  236. package/dist/types/hooks/useScenarioConfiguration.d.ts +1 -16
  237. package/dist/types/hooks/useUboQuestionnaire.d.ts +1 -1
  238. package/dist/types/router/routeConfig.d.ts +5 -5
  239. package/dist/types/types/form-rules.d.ts +0 -2
  240. package/dist/types/utils/country.d.ts +6 -0
  241. package/dist/types/utils/decodeJwt.d.ts +13 -0
  242. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  243. package/dist/types/utils/formUtils.d.ts +4 -3
  244. package/dist/types/utils/validation/formatValidationError.d.ts +11 -0
  245. package/dist/types/utils/validation/types.d.ts +4 -4
  246. package/dist/{types-lzI_sUwT.js → types-BLWT7WnU.js} +1 -1
  247. package/dist/{useAssociatedLegalEntity-DB8HCSwp.js → useAssociatedLegalEntity-CzQlHWXy.js} +2 -2
  248. package/dist/{useBusinessDetailsData-DRfmakGt.js → useBusinessDetailsData-CRLRQh0U.js} +129 -310
  249. package/dist/{useBusinessLines-CfQYLNkw.js → useBusinessLines-D-rc-Z6G.js} +1 -1
  250. package/dist/{useCanSeeIntroduction-CL2v20rx.js → useCanSeeIntroduction-BeooAHcX.js} +1 -1
  251. package/dist/{useCreateLegalEntity-CVBjJUw_.js → useCreateLegalEntity-Ctdmk3Ky.js} +1 -1
  252. package/dist/{useDataMissingRemediations-BEdoAjt3.js → useDataMissingRemediations-DNZ_UDbI.js} +2 -2
  253. package/dist/{useForm-DgKB0Jpl.js → useForm-BLP36oqX.js} +3 -3
  254. package/dist/{useId-DpmZnb6I.js → useId-po-YSdTw.js} +3 -3
  255. package/dist/{useLegalEntity-BqO7Fmt0.js → useLegalEntity-DR51Q4mE.js} +1 -1
  256. package/dist/{useNavigate-xV0IroXe.js → useNavigate-CcVYYcg1.js} +33 -33
  257. package/dist/{useOnboardingStatus-Bg1z2ftv.js → useOnboardingStatus-op5TyMUR.js} +1 -1
  258. package/dist/{usePciQuestionnaireList-Dq1w684P.js → usePciQuestionnaireList-BZsgbrTy.js} +1 -1
  259. package/dist/{useSalesChannels-D66W1KV8.js → useSalesChannels-Mi6DmHab.js} +2 -2
  260. package/dist/{useScenarios-BunWDxgO.js → useScenarios-Bne3C0PV.js} +1 -1
  261. package/dist/{useTaskLandedEvent-BTVaABDA.js → useTaskLandedEvent-C7fcguXK.js} +1 -1
  262. package/dist/{useTaskStatus-B_-IRF4H.js → useTaskStatus-Be6XyW54.js} +1 -1
  263. package/dist/{useTermsOfServiceStatus-CGIpBA0U.js → useTermsOfServiceStatus-D0NHUKl_.js} +1 -1
  264. package/dist/{useTrustMembers-Cc_VpJkD.js → useTrustMembers-HJpKc0qR.js} +5 -5
  265. package/dist/{useUnincorporatedPartnershipMembers-DgD91qBf.js → useUnincorporatedPartnershipMembers-C5CNWe_U.js} +2 -2
  266. package/dist/{useUpdateBusinessLines-C2xW-32U.js → useUpdateBusinessLines-D6D9DAn1.js} +1 -1
  267. package/dist/{useUpdateLegalEntity-CsXfjS5u.js → useUpdateLegalEntity-CH4xp654.js} +2 -2
  268. package/dist/{utils-BfxOnNjg.js → utils-BbBPfcNK.js} +7 -7
  269. package/dist/{utils-G00RnEDX.js → utils-C8WDAzsL.js} +1 -1
  270. package/dist/{utils-CGzF-obv.js → utils-Di84CxrF.js} +5 -5
  271. package/dist/{validate-K01plHbc.js → validate-BNu91k9j.js} +4 -4
  272. package/dist/validate-CkuU4MvS.js +250 -0
  273. package/dist/{validate-DvGdGx9J.js → validate-CsYDNrPB.js} +1 -1
  274. package/dist/{validateExtractionResult-CXgPruUU.js → validateExtractionResult-mtXTjYfE.js} +10 -10
  275. package/dist/{validationError-vnqptK-a.js → validationError-1dpZJlAz.js} +1 -1
  276. package/package.json +3 -4
  277. package/dist/AdaptiveWorkflow-CE-7w7l8.js +0 -1896
  278. package/dist/GlobalEntryModal-D9sRA2Ql.js +0 -188
  279. package/dist/SoleProprietorshipPage-f3-ZfjvW.js +0 -70
  280. package/dist/TrustMemberCompanyPage-CVZuhHHm.js +0 -109
  281. package/dist/TrustMemberIndividualPage-Dn4pDHej.js +0 -109
  282. package/dist/UnincorporatedPartnershipIndividualPage-DdOlDSQU.js +0 -79
  283. package/dist/bg-BG-BXAB4Qsj.js +0 -7
  284. package/dist/cs-CZ-DG5rPvy2.js +0 -7
  285. package/dist/da-DK-BnW-O75l.js +0 -7
  286. package/dist/de-DE-DUiPzmSc.js +0 -7
  287. package/dist/el-GR-1n3FJpd3.js +0 -7
  288. package/dist/en-US-B48_sHax.js +0 -13
  289. package/dist/en-US-BV2Gye3t.js +0 -7
  290. package/dist/en-US-CqjOvqxV.js +0 -7
  291. package/dist/es-ES-Cp45mlyV.js +0 -7
  292. package/dist/es-LA-BU32JqC-.js +0 -7
  293. package/dist/es-LA-Cyf48j4P.js +0 -7
  294. package/dist/es-LA-De_gTMKb.js +0 -7
  295. package/dist/et-EE-B4czzgF8.js +0 -7
  296. package/dist/fi-FI-D08MUkuM.js +0 -7
  297. package/dist/fr-FR-BxDpVfWO.js +0 -7
  298. package/dist/getTrustedFields-BJ88GlM-.js +0 -28
  299. package/dist/hr-HR-DGQMquDg.js +0 -7
  300. package/dist/hu-HU-Eofp7khl.js +0 -7
  301. package/dist/it-IT-CD7NJtJa.js +0 -7
  302. package/dist/ja-JP-YvXztswF.js +0 -7
  303. package/dist/lt-LT-Cjx4H-0R.js +0 -7
  304. package/dist/lv-LV-Ckf37gXo.js +0 -7
  305. package/dist/mapExistingFile-BOXehUNN.js +0 -138
  306. package/dist/nl-NL-DFHAkUK3.js +0 -7
  307. package/dist/no-NO-B6frLiko.js +0 -7
  308. package/dist/pl-PL-DnYkTdjO.js +0 -7
  309. package/dist/pt-BR-65dQv8uO.js +0 -7
  310. package/dist/pt-PT-D0fXeW1f.js +0 -7
  311. package/dist/ro-RO-CNj95qQn.js +0 -7
  312. package/dist/sk-SK-C0x9Vs2X.js +0 -7
  313. package/dist/sl-SI-BikBCOJK.js +0 -7
  314. package/dist/sv-SE-BGP9Lmku.js +0 -7
  315. package/dist/types/components/Shared/forms/RegistrationAddress/RegistrationAddress.d.ts +0 -3
  316. package/dist/types/components/Shared/forms/RegistrationAddress/RegistrationAddressMultiform.d.ts +0 -3
  317. package/dist/types/components/Shared/forms/RegistrationAddress/types.d.ts +0 -26
  318. package/dist/types/components/Shared/forms/RegistrationAddress/validate.d.ts +0 -3
  319. package/dist/types/utils/getDisplayErrorMessage.d.ts +0 -2
  320. /package/dist/types/components/{SoleProprietorship → Trust}/hooks/useExemptSettlor.d.ts +0 -0
@@ -1,1896 +0,0 @@
1
- try {
2
- let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0cd2917d-f271-44ad-a37f-3c134cfb23db", e._sentryDebugIdIdentifier = "sentry-dbid-0cd2917d-f271-44ad-a37f-3c134cfb23db");
4
- } catch (e) {}
5
- import { i as Typography, o as createLogger, r as useTranslation, t as Trans } from "./translation-CcKrUksA.js";
6
- import { j as useToggleContext, k as Header, x as Alert } from "./resolveEnvironment-C1htMD-5.js";
7
- import { n as IconButton, r as Loader, t as Button } from "./Button-BuhgDsyo.js";
8
- import { n as httpGet, s as useApiContext } from "./http-CFac2y4i.js";
9
- import { r as useLegalEntity } from "./useLegalEntity-BqO7Fmt0.js";
10
- import { t as StackLayout } from "./StackLayout-IUdNMDgW.js";
11
- import { n as Status } from "./TaskVerificationStatus-ITLSeoau.js";
12
- import { i as TaskStatuses } from "./taskStatus-BtekPA8E.js";
13
- import { a as setNestedValue, i as resolveComponentProps, r as getNestedValue$4, t as TaskListItem } from "./TaskListItem-BlcJJS_V.js";
14
- import { r as KEYBOARD_KEYS, t as Modal } from "./Modal-BYdlsXkf.js";
15
- import { a as LandingLayout } from "./form-rules-wh_oE1AN.js";
16
- import { t as useBusinessLines } from "./useBusinessLines-CfQYLNkw.js";
17
- import { t as Card } from "./Card-BCGLpdw7.js";
18
- import { l as CompanyTypesValues } from "./bafinUtils-DEVMdolf.js";
19
- import { t as EndStateLayout } from "./EndStateLayout-CddZpAGD.js";
20
- import { d as translateTranslatable, f as LoaderWrapper, i as ProgressBar, r as Field, t as Select } from "./Select-yOtg-61e.js";
21
- import { n as Confirm } from "./StructuredList-BU29ceSG.js";
22
- import { s as FormFlow_module_default } from "./CountryField-uue7DBeg.js";
23
- import { t as Image } from "./Image-Dc5Xg1_Y.js";
24
- import { t as List } from "./List-ywoRPg-q.js";
25
- import { t as Checkbox } from "./Checkbox-CFN5ywvv.js";
26
- import { t as useUpdateLegalEntity } from "./useUpdateLegalEntity-CsXfjS5u.js";
27
- import { t as MaskedInput } from "./MaskedInput-BpgT8ais.js";
28
- import { a as fromIndividualConflictSchema, d as useExtractDocumentInformation, f as IdentityNumber, i as mapExtractionResultToSchema, l as useDataConflicts, n as UploadedDocument, o as toIndividualConflictSchema, r as useIdVerificationToken, s as IdVerificationMethod_module_default, t as validateExtractionResult } from "./validateExtractionResult-CXgPruUU.js";
29
- import { A as taxInformationDefaultFieldMetadata, C as getTaxIdNumberOptions, S as getDefaultTaxIdNumberType, k as taxInformationDefaultFieldConfig, n as upsertTaxInfoForCountry, r as TaxIdNumberTypeSelector, t as removeTaxInfoForCountry, v as COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 } from "./utils-BfxOnNjg.js";
30
- import { t as resolveFieldMetadata } from "./fieldConfigurations-CZCFghnK.js";
31
- import { t as Link } from "./Link-PH3F7iTO.js";
32
- import { t as InputText } from "./InputText-CRkApOKK.js";
33
- import { t as DataConflictsModal } from "./DataConflictsModal-BrGRGVYC.js";
34
- import { t as TermsOfServiceManagement } from "./TermsOfServiceManagement-_xrvP8-7.js";
35
- import { t as Divider } from "./Divider-BENvVRnz.js";
36
- import { t as ListItem } from "./ListItem-B-gDVdRO.js";
37
- import { i as getCompanyRegistrationNumberOptions, l as registrationNumberDefaultFieldConfig, n as getDefaultRegistrationNumberType, t as CompanyRegistrationNumberTypeSelector, u as registrationNumberDefaultFieldMetadata } from "./CompanyRegistrationNumberTypeSelector-DYJ2XeCC.js";
38
- import { n as useCreateBusinessLine, r as useIndustryCodes, t as useUpdateBusinessLine } from "./useUpdateBusinessLines-C2xW-32U.js";
39
- import { t as SourceOfFundsPage } from "./SourceOfFundsPage-4dDzWrhf.js";
40
- import { t as TaxReportingDropin } from "./TaxReportingDropin-Cw35lKwa.js";
41
- import { lazy } from "preact/compat";
42
- import { useCallback as useCallback$1, useContext as useContext$1, useEffect as useEffect$1, useMemo as useMemo$1, useRef as useRef$1, useState as useState$1 } from "preact/hooks";
43
- import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime";
44
- import { useComputed } from "@preact/signals";
45
- import { skipToken, useQuery } from "@tanstack/preact-query";
46
- import { createContext as createContext$1 } from "preact";
47
- import { Onfido } from "onfido-sdk-ui";
48
- import { createFormHook, createFormHookContexts, useStore } from "@tanstack/react-form";
49
- //#region src/api/adaptive/useAdaptiveWorkflow.ts
50
- /**
51
- * Retrieves UI manifest used to render an adaptive UI
52
- * determined by the requirements engine based on the
53
- * requested products for a LE
54
- */
55
- var getUiManifest = async (baseUrl, rootLegalEntityId) => {
56
- return await httpGet({
57
- baseUrl,
58
- path: `legalEntities/${rootLegalEntityId}/configurations/workflow`
59
- });
60
- };
61
- var useAdaptiveWorkflow = (options) => {
62
- const { baseUrl, rootLegalEntityId } = useApiContext();
63
- return useQuery({
64
- queryKey: ["adaptive-workflow"],
65
- queryFn: () => getUiManifest(baseUrl.value, rootLegalEntityId.value),
66
- ...options
67
- });
68
- };
69
- //#endregion
70
- //#region src/context/WorkflowContext/WorkflowContext.tsx
71
- var WorkflowContext = createContext$1(void 0);
72
- //#endregion
73
- //#region src/context/WorkflowContext/useWorkflowContext.ts
74
- function useWorkflowContext() {
75
- return useContext$1(WorkflowContext);
76
- }
77
- var AdaptiveProgressBar_module_default = {
78
- "adaptive-progress-bar": "_adaptive-progress-bar_wl3oz_1",
79
- adaptiveProgressBar: "_adaptive-progress-bar_wl3oz_1",
80
- "adaptive-progress-bar-step": "_adaptive-progress-bar-step_wl3oz_7",
81
- adaptiveProgressBarStep: "_adaptive-progress-bar-step_wl3oz_7",
82
- "adaptive-progress-bar-label": "_adaptive-progress-bar-label_wl3oz_13",
83
- adaptiveProgressBarLabel: "_adaptive-progress-bar-label_wl3oz_13"
84
- };
85
- //#endregion
86
- //#region src/components/ui/molecules/AdaptiveProgressBar/AdaptiveProgressBar.tsx
87
- var AdaptiveProgressBar = ({ steps, ariaLabel }) => {
88
- return /* @__PURE__ */ jsx("div", {
89
- className: AdaptiveProgressBar_module_default.adaptiveProgressBar,
90
- role: "group",
91
- "aria-label": ariaLabel,
92
- children: steps.map((step) => /* @__PURE__ */ jsxs("div", {
93
- className: AdaptiveProgressBar_module_default.adaptiveProgressBarStep,
94
- style: { flex: step.flex ?? 1 },
95
- children: [/* @__PURE__ */ jsx(ProgressBar, {
96
- progress: step.progress,
97
- ariaLabel: step.name,
98
- rounded: true
99
- }), /* @__PURE__ */ jsx(Typography, {
100
- color: "tertiary",
101
- el: "span",
102
- variant: "caption",
103
- className: AdaptiveProgressBar_module_default.adaptiveProgressBarLabel,
104
- children: step.name
105
- })]
106
- }, step.name))
107
- });
108
- };
109
- var AdaptiveWorkflow_module_default = {
110
- "adaptive-workflow-header": "_adaptive-workflow-header_1mua9_1",
111
- adaptiveWorkflowHeader: "_adaptive-workflow-header_1mua9_1",
112
- "adaptive-workflow-main": "_adaptive-workflow-main_1mua9_7",
113
- adaptiveWorkflowMain: "_adaptive-workflow-main_1mua9_7",
114
- "adaptive-workflow-heading": "_adaptive-workflow-heading_1mua9_14",
115
- adaptiveWorkflowHeading: "_adaptive-workflow-heading_1mua9_14",
116
- "adaptive-workflow-description": "_adaptive-workflow-description_1mua9_18",
117
- adaptiveWorkflowDescription: "_adaptive-workflow-description_1mua9_18",
118
- "adaptive-workflow-divider": "_adaptive-workflow-divider_1mua9_22",
119
- adaptiveWorkflowDivider: "_adaptive-workflow-divider_1mua9_22",
120
- "adaptive-workflow-actions": "_adaptive-workflow-actions_1mua9_26",
121
- adaptiveWorkflowActions: "_adaptive-workflow-actions_1mua9_26"
122
- };
123
- //#endregion
124
- //#region src/adaptiveWorkflow/components/Fields/AcceptTermsOfServiceWorkflow/AcceptTermsOfServiceWorkflow.tsx
125
- var AcceptTermsOfServiceWorkflow = ({ onComplete, onClose }) => {
126
- const { entity } = useWorkflowContext();
127
- if (!entity.value?.id) return /* @__PURE__ */ jsx(EndStateLayout, {
128
- variant: "error",
129
- title: "Something went wrong",
130
- description: "Please try again later"
131
- });
132
- return /* @__PURE__ */ jsx(TermsOfServiceManagement, {
133
- legalEntityId: entity.value.id,
134
- onComplete,
135
- onClose
136
- });
137
- };
138
- //#endregion
139
- //#region src/adaptiveWorkflow/formHook.ts
140
- var { fieldContext, formContext } = createFormHookContexts();
141
- /**
142
- * Shared form hook for the adaptive workflow.
143
- *
144
- * - `useAppForm` replaces `useForm` and provides context-aware form instances.
145
- * - `withForm` wraps compound components so they receive `form` via context,
146
- * eliminating the need to pass the form instance (and its complex generics) as a prop.
147
- *
148
- * @see https://tanstack.com/form/latest/docs/framework/react/guides/form-composition
149
- */
150
- var { useAppForm, withForm } = createFormHook({
151
- fieldContext,
152
- formContext,
153
- fieldComponents: {},
154
- formComponents: {}
155
- });
156
- //#endregion
157
- //#region src/adaptiveWorkflow/components/Fields/BusinessRegistrationNumber/ExemptedFromRegistrationNumberField.tsx
158
- function ExemptedFromRegistrationNumberField({ field, label, checked, readonly, onChange }) {
159
- return /* @__PURE__ */ jsx(Field, {
160
- name: field.name,
161
- children: (childProps) => /* @__PURE__ */ jsx(Checkbox, {
162
- ...childProps,
163
- "aria-required": false,
164
- "aria-invalid": false,
165
- name: field.name,
166
- label,
167
- value: "exemptedFromRegistrationNumber",
168
- checked,
169
- readonly,
170
- onChange
171
- })
172
- });
173
- }
174
- //#endregion
175
- //#region src/adaptiveWorkflow/components/Fields/BusinessRegistrationNumber/RegistrationNumberInputField.tsx
176
- function RegistrationNumberInputField({ field, fieldMetadata, currentValue, helperText, readonly, optional, shouldValidate, disabled, onInput, onBlur }) {
177
- const { t } = useTranslation("common");
178
- const isTouched = field.state.meta.isTouched;
179
- const isValid = field.state.meta.isValid;
180
- const errorMessage = isTouched && !isValid ? field.state.meta.errors[0] : void 0;
181
- return /* @__PURE__ */ jsx(MaskedInput, {
182
- "aria-required": true,
183
- "aria-invalid": isTouched && !isValid,
184
- name: "registrationNumber",
185
- type: "text",
186
- value: currentValue,
187
- label: fieldMetadata.label ? t(($) => $[fieldMetadata.label]) ?? "" : "",
188
- formatGuidance: fieldMetadata.guidanceText ? translateTranslatable(t, fieldMetadata.guidanceText) : void 0,
189
- errorMessage,
190
- isValid: isTouched && isValid && !!currentValue,
191
- onInput,
192
- onBlur,
193
- disabled,
194
- optional,
195
- readonly,
196
- shouldValidate: !optional && shouldValidate,
197
- helper: helperText,
198
- ...fieldMetadata.mask ?? {}
199
- });
200
- }
201
- //#endregion
202
- //#region src/adaptiveWorkflow/components/Fields/BusinessRegistrationNumber/RegistrationNumberTypeSelectorField.tsx
203
- function RegistrationNumberTypeSelectorField({ country, companyType, selected, onTypeChange, exemptedOptionLabel }) {
204
- return /* @__PURE__ */ jsx(CompanyRegistrationNumberTypeSelector, {
205
- country,
206
- companyType,
207
- selected,
208
- setSelected: onTypeChange,
209
- exemptedOptionLabel
210
- });
211
- }
212
- //#endregion
213
- //#region src/adaptiveWorkflow/components/Fields/BusinessRegistrationNumber/BusinessRegistrationNumberFieldGroup.tsx
214
- function getNestedValue$3(obj, path) {
215
- return path.split(".").reduce((acc, key) => acc?.[key], obj);
216
- }
217
- var BusinessRegistrationNumberFieldGroup = withForm({
218
- defaultValues: {},
219
- props: {},
220
- render: function BusinessRegistrationNumberFieldGroupRender({ form, basePath: registrationNumberPath, country, canExempt, companyType, state, helperText, labels, readonly, optional, shouldValidate }) {
221
- const registrationNumberTypePath = `organization.registrationNumberType`;
222
- const exemptedPath = `organization.exemptedFromRegistrationNumber`;
223
- const registrationNumber = useStore(form.store, (s) => getNestedValue$3(s.values, registrationNumberPath));
224
- const registrationNumberType = useStore(form.store, (s) => getNestedValue$3(s.values, registrationNumberTypePath));
225
- const exemptedFromRegistrationNumber = useStore(form.store, (s) => getNestedValue$3(s.values, exemptedPath));
226
- const registrationNumberOptions = getCompanyRegistrationNumberOptions(country, companyType);
227
- const defaultType = getDefaultRegistrationNumberType(registrationNumber, country, companyType);
228
- const showExemptedOption = canExempt && !!registrationNumberOptions && registrationNumberOptions.length > 1;
229
- const effectiveRegistrationNumberType = exemptedFromRegistrationNumber ? "exempted" : registrationNumberType ?? defaultType;
230
- const fieldMetadata = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
231
- registrationNumberType: effectiveRegistrationNumberType === "exempted" ? void 0 : effectiveRegistrationNumberType,
232
- state
233
- }, registrationNumberDefaultFieldMetadata);
234
- if (effectiveRegistrationNumberType && effectiveRegistrationNumberType !== "exempted" && !registrationNumberOptions?.find((o) => o.id === effectiveRegistrationNumberType)) form.setFieldValue(registrationNumberTypePath, defaultType);
235
- const handleRegistrationNumberChange = useCallback$1((e) => {
236
- const value = typeof e === "string" ? e : e.currentTarget.value;
237
- form.setFieldValue(registrationNumberPath, value);
238
- form.setFieldValue(registrationNumberTypePath, effectiveRegistrationNumberType === "exempted" ? void 0 : effectiveRegistrationNumberType);
239
- }, [
240
- form,
241
- registrationNumberPath,
242
- registrationNumberTypePath,
243
- effectiveRegistrationNumberType
244
- ]);
245
- const handleExemptedFromRegistrationNumber = useCallback$1((exempt) => {
246
- if (exempt) form.setFieldValue(registrationNumberPath, "");
247
- form.setFieldValue(exemptedPath, exempt);
248
- }, [
249
- exemptedPath,
250
- form,
251
- registrationNumberPath
252
- ]);
253
- const handleCompanyRegistrationNumberTypeChange = useCallback$1((regNumberType) => {
254
- if (regNumberType === "exempted") {
255
- if (!canExempt) throw new Error(`${country} does not allow registration number exemptions`);
256
- form.setFieldValue(registrationNumberPath, "");
257
- form.setFieldValue(exemptedPath, true);
258
- form.setFieldValue(registrationNumberTypePath, void 0);
259
- return;
260
- }
261
- if (canExempt && exemptedFromRegistrationNumber) form.setFieldValue(exemptedPath, false);
262
- form.setFieldValue(registrationNumberPath, "");
263
- form.setFieldValue(registrationNumberTypePath, regNumberType);
264
- }, [
265
- canExempt,
266
- country,
267
- exemptedFromRegistrationNumber,
268
- exemptedPath,
269
- form,
270
- registrationNumberPath,
271
- registrationNumberTypePath
272
- ]);
273
- return /* @__PURE__ */ jsxs("div", { children: [
274
- /* @__PURE__ */ jsx(form.Field, {
275
- name: registrationNumberTypePath,
276
- children: (field) => /* @__PURE__ */ jsx(RegistrationNumberTypeSelectorField, {
277
- field,
278
- country,
279
- companyType,
280
- selected: effectiveRegistrationNumberType,
281
- onTypeChange: handleCompanyRegistrationNumberTypeChange,
282
- exemptedOptionLabel: showExemptedOption ? labels.exemptedFromRegistrationNumber : void 0
283
- })
284
- }),
285
- /* @__PURE__ */ jsx(form.Field, {
286
- name: registrationNumberPath,
287
- children: (field) => /* @__PURE__ */ jsx(RegistrationNumberInputField, {
288
- field,
289
- fieldMetadata,
290
- currentValue: registrationNumber ?? "",
291
- helperText,
292
- readonly,
293
- optional,
294
- shouldValidate,
295
- disabled: Boolean(exemptedFromRegistrationNumber),
296
- onInput: (e) => handleRegistrationNumberChange(e),
297
- onBlur: (e) => handleRegistrationNumberChange(e)
298
- })
299
- }),
300
- canExempt && !showExemptedOption && /* @__PURE__ */ jsx(form.Field, {
301
- name: exemptedPath,
302
- children: (field) => /* @__PURE__ */ jsx(ExemptedFromRegistrationNumberField, {
303
- field,
304
- label: labels.exemptedFromRegistrationNumber,
305
- checked: Boolean(exemptedFromRegistrationNumber),
306
- readonly,
307
- onChange: handleExemptedFromRegistrationNumber
308
- })
309
- })
310
- ] });
311
- }
312
- });
313
- //#endregion
314
- //#region src/adaptiveWorkflow/components/Fields/IdentityNumber/IdentityNumberFieldGroup.tsx
315
- function getNestedValue$2(obj, path) {
316
- return path.split(".").reduce((acc, key) => acc?.[key], obj);
317
- }
318
- function getEventValue(value) {
319
- if (value && typeof value === "object" && "currentTarget" in value) {
320
- const currentTarget = value.currentTarget;
321
- if (currentTarget?.type === "checkbox") return currentTarget.checked;
322
- return currentTarget?.value;
323
- }
324
- return value;
325
- }
326
- var IdentityNumberFieldGroup = withForm({
327
- defaultValues: {},
328
- props: {},
329
- render: function IdentityNumberFieldGroupRender({ form, basePath, country, idNumberType, optionalFields, readOnlyFields, obscuredFields }) {
330
- const idNumberPath = `${basePath}.idNumber`;
331
- const idNumberExemptPath = `${basePath}.idNumberExempt`;
332
- return /* @__PURE__ */ jsx(IdentityNumber, {
333
- country,
334
- data: useStore(form.store, (s) => ({
335
- idNumber: getNestedValue$2(s.values, idNumberPath),
336
- idNumberExempt: getNestedValue$2(s.values, idNumberExemptPath)
337
- })),
338
- errors: {},
339
- fieldValidationErrors: {},
340
- handleFieldChange: useCallback$1((fieldName, _mode) => (value) => {
341
- const fieldPath = fieldName === "idNumber" ? idNumberPath : idNumberExemptPath;
342
- form.setFieldValue(fieldPath, getEventValue(value));
343
- }, [
344
- form,
345
- idNumberPath,
346
- idNumberExemptPath
347
- ]),
348
- idNumberType,
349
- obscuredFields,
350
- optionalFields,
351
- readOnlyFields,
352
- requiredFields: ["idNumber"],
353
- valid: {
354
- idNumber: true,
355
- idNumberExempt: true
356
- }
357
- });
358
- }
359
- });
360
- //#endregion
361
- //#region src/adaptiveWorkflow/components/Fields/IdentityScreening/IdentityScreeningWorkflow.tsx
362
- var passportFrontGreenImage = lazy(() => import("./passport-front-green-BWuD3-Fs.js"));
363
- var containerId = "adyen-kyc-id-verification";
364
- var logger = createLogger();
365
- var hasMinimumApplicantDetails = (details) => Boolean(details.firstName && details.lastName && details.residencyCountry);
366
- var getOnfidoLocaleConfig = (locale, t) => {
367
- const language = locale.substring(0, 2);
368
- return language === "en" ? {
369
- locale: language,
370
- phrases: {
371
- "country_select.button_primary": t(($) => $["continue"]),
372
- "doc_submit.title_id_back": t(($) => $["identityCardBack"]),
373
- "doc_submit.title_id_front": t(($) => $["identityCardFront"]),
374
- "doc_submit.title_license_back": t(($) => $["drivinglicenseBack"]),
375
- "doc_submit.title_license_front": t(($) => $["drivinglicenseFront"]),
376
- "doc_submit.title_passport": t(($) => $["passportPhotoPage"]),
377
- "doc_submit.title_permit_back": t(($) => $["residencePermitBack"]),
378
- "doc_submit.title_permit_front": t(($) => $["residencePermitFront"])
379
- }
380
- } : language;
381
- };
382
- var initOnfido = async ({ containerEl, token, t, locale, onComplete, onError, showMotionCapture }) => {
383
- const steps = [{
384
- type: "document",
385
- options: { documentTypes: {
386
- passport: true,
387
- driving_licence: true,
388
- national_identity_card: true,
389
- residence_permit: false
390
- } }
391
- }, showMotionCapture ? {
392
- type: "face",
393
- options: { requestedVariant: "motion" }
394
- } : void 0].filter(Boolean);
395
- return Onfido.init({
396
- token,
397
- containerEl,
398
- disableAnalytics: false,
399
- onComplete,
400
- onError,
401
- steps,
402
- language: getOnfidoLocaleConfig(locale, t)
403
- });
404
- };
405
- function OnfidoCaptureModal({ closeModal, legalEntityId, minimumApplicantDetails, onComplete, onError, showMotionCapture }) {
406
- const containerRef = useRef$1(null);
407
- const onfidoSdk = useRef$1();
408
- const { t, i18n } = useTranslation("individual");
409
- const { data: tokenResponse, isLoading, isError } = useIdVerificationToken(minimumApplicantDetails, legalEntityId);
410
- useEffect$1(() => {
411
- (async () => {
412
- if (!tokenResponse) return;
413
- if (!containerRef.current) throw new Error("No container for Onfido found");
414
- onfidoSdk.current = await initOnfido({
415
- containerEl: containerRef.current,
416
- token: tokenResponse.sdkToken,
417
- t,
418
- locale: i18n.language,
419
- onComplete,
420
- onError,
421
- showMotionCapture
422
- });
423
- })().catch(logger.error);
424
- return async () => {
425
- if (onfidoSdk.current) await onfidoSdk.current.tearDown();
426
- };
427
- }, [
428
- i18n.language,
429
- legalEntityId,
430
- minimumApplicantDetails,
431
- onComplete,
432
- onError,
433
- showMotionCapture,
434
- t,
435
- tokenResponse
436
- ]);
437
- return /* @__PURE__ */ jsx(Modal, {
438
- size: "medium",
439
- onClose: closeModal,
440
- ariaLabel: t(($) => $["identityVerification"]),
441
- children: /* @__PURE__ */ jsx(LoaderWrapper, {
442
- status: tokenResponse ? "success" : isLoading ? "loading" : isError ? "error" : "pending",
443
- children: /* @__PURE__ */ jsx("div", {
444
- ref: containerRef,
445
- className: containerId
446
- })
447
- })
448
- });
449
- }
450
- function IdentityScreeningWorkflow({ resourceId, legalEntityId, minimumApplicantDetails, providedData, extractionResult, onfidoResult, simulateOnfidoCompletion, existingDocument, requiresDocumentExtraction = true, showMotionCapture, onComplete, onClose }) {
451
- const resolvedLegalEntityId = resourceId ?? legalEntityId;
452
- const { data: legalEntity, isLoading: isLegalEntityLoading, isError: isLegalEntityError } = useLegalEntity(Boolean(resolvedLegalEntityId && (!minimumApplicantDetails || !providedData)) && resolvedLegalEntityId ? resolvedLegalEntityId : skipToken);
453
- const { t: commonT } = useTranslation("common");
454
- const { t: individualT } = useTranslation("individual");
455
- const extractDocumentInformation = useExtractDocumentInformation();
456
- const [status, setStatus] = useState$1("ready");
457
- const [document, setDocument] = useState$1(existingDocument);
458
- const [errorKey, setErrorKey] = useState$1();
459
- const [extractedData, setExtractedData] = useState$1();
460
- const resolvedMinimumApplicantDetails = minimumApplicantDetails ?? {
461
- firstName: legalEntity?.individual?.name?.firstName,
462
- lastName: legalEntity?.individual?.name?.lastName,
463
- residencyCountry: legalEntity?.individual?.residentialAddress?.country
464
- };
465
- const resolvedProvidedData = providedData ?? {
466
- firstName: legalEntity?.individual?.name?.firstName,
467
- lastName: legalEntity?.individual?.name?.lastName,
468
- birthDate: legalEntity?.individual?.birthData?.dateOfBirth,
469
- idNumber: legalEntity?.individual?.identificationData?.number
470
- };
471
- const conflictData = useDataConflicts(resolvedProvidedData, extractedData);
472
- const isApplicantDetailsReady = hasMinimumApplicantDetails(resolvedMinimumApplicantDetails);
473
- const getExtractionResult = async (result) => {
474
- if (extractionResult) return extractionResult;
475
- try {
476
- const documentIds = [result.document_front.id];
477
- if (result.document_back) documentIds.push(result.document_back.id);
478
- return await extractDocumentInformation.mutateAsync({ documents: documentIds.map((documentId) => ({ documentId })) });
479
- } catch {
480
- setErrorKey("weCouldNotExtractDocumentInformation");
481
- setStatus("ready");
482
- return;
483
- }
484
- };
485
- const handleOnfidoComplete = async (result) => {
486
- setErrorKey(void 0);
487
- if (!requiresDocumentExtraction) {
488
- onComplete();
489
- return;
490
- }
491
- setStatus("extractionLoading");
492
- const resolvedExtractionResult = await getExtractionResult(result);
493
- if (!resolvedExtractionResult) {
494
- setDocument({
495
- instantIdVerificationData: result,
496
- idDocumentType: result.document_front.type,
497
- modificationDate: (/* @__PURE__ */ new Date()).toISOString()
498
- });
499
- setStatus("ready");
500
- return;
501
- }
502
- const validationError = validateExtractionResult(resolvedExtractionResult);
503
- if (validationError) {
504
- setErrorKey(validationError.key);
505
- setStatus("ready");
506
- return;
507
- }
508
- const mappedExtractionResult = mapExtractionResultToSchema(resolvedExtractionResult);
509
- setDocument({
510
- instantIdVerificationData: result,
511
- idDocumentType: result.document_front.type,
512
- modificationDate: (/* @__PURE__ */ new Date()).toISOString(),
513
- documentCountry: resolvedExtractionResult.issuingCountry
514
- });
515
- setExtractedData(toIndividualConflictSchema(mappedExtractionResult));
516
- setStatus("ready");
517
- };
518
- const launchOnfido = () => {
519
- if (!isApplicantDetailsReady) {
520
- setErrorKey("thereWasAnErrorTryAgain");
521
- return;
522
- }
523
- if (simulateOnfidoCompletion && onfidoResult) {
524
- handleOnfidoComplete(onfidoResult);
525
- return;
526
- }
527
- setStatus("onfidoModal");
528
- };
529
- const handleDataConflictsResolved = (resolved) => {
530
- fromIndividualConflictSchema(resolved);
531
- onComplete();
532
- };
533
- return /* @__PURE__ */ jsxs("div", {
534
- className: FormFlow_module_default.formFlow,
535
- children: [
536
- /* @__PURE__ */ jsx("div", {
537
- className: FormFlow_module_default.formFlowContent,
538
- children: /* @__PURE__ */ jsx(LandingLayout, {
539
- media: /* @__PURE__ */ jsx(Image, {
540
- className: IdVerificationMethod_module_default.verificationHeaderImage,
541
- lazyLoadedImage: passportFrontGreenImage
542
- }),
543
- title: individualT(($) => $["verifyIdentity"]),
544
- description: individualT(($) => $["weNeedToVerifyTheDecisionMakersIdentity"]),
545
- helpAction: /* @__PURE__ */ jsx(Button, {
546
- onClick: onClose,
547
- variant: "tertiary",
548
- children: commonT(($) => $["back"])
549
- }),
550
- error: errorKey || isLegalEntityError ? /* @__PURE__ */ jsx(Alert, {
551
- variant: "error",
552
- title: commonT(($) => $[errorKey ?? "thereWasAnErrorTryAgain"])
553
- }) : void 0,
554
- actions: status === "extractionLoading" ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : document ? /* @__PURE__ */ jsx(Button, {
555
- onClick: onComplete,
556
- fullWidth: true,
557
- children: commonT(($) => $["continue"])
558
- }) : /* @__PURE__ */ jsx(Button, {
559
- fullWidth: true,
560
- onClick: launchOnfido,
561
- loading: isLegalEntityLoading,
562
- disabled: isLegalEntityError || !isApplicantDetailsReady,
563
- children: individualT(($) => $["getVerifiedInstantly"])
564
- }),
565
- content: document && /* @__PURE__ */ jsx(UploadedDocument, {
566
- document,
567
- onDelete: () => setDocument(void 0),
568
- onUpdate: launchOnfido
569
- }),
570
- disclaimer: !document && /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(Trans, {
571
- t: individualT,
572
- ns: "individual",
573
- i18nKey: ($) => $["byContinuingWithInstantVerification"],
574
- components: {
575
- facialScanLink: /* @__PURE__ */ jsx(Link, {
576
- href: "https://onfido.com/facial-scan-policy-and-release/",
577
- external: true,
578
- inline: true
579
- }),
580
- privacyLink: /* @__PURE__ */ jsx(Link, {
581
- href: "https://onfido.com/privacy/",
582
- external: true,
583
- inline: true
584
- }),
585
- termsLink: /* @__PURE__ */ jsx(Link, {
586
- href: "https://onfido.com/terms-of-service/",
587
- external: true,
588
- inline: true
589
- })
590
- }
591
- }) })
592
- })
593
- }),
594
- status === "onfidoModal" && isApplicantDetailsReady && /* @__PURE__ */ jsx(OnfidoCaptureModal, {
595
- closeModal: () => {
596
- setStatus("ready");
597
- },
598
- legalEntityId: resolvedLegalEntityId,
599
- minimumApplicantDetails: resolvedMinimumApplicantDetails,
600
- onComplete: handleOnfidoComplete,
601
- onError: () => {
602
- setErrorKey("weCouldNotReachOnfido");
603
- setStatus("ready");
604
- },
605
- showMotionCapture
606
- }),
607
- conflictData.hasConflicts && extractedData && /* @__PURE__ */ jsx(DataConflictsModal, {
608
- providedData: conflictData.resolvedData ?? resolvedProvidedData,
609
- detectedData: extractedData,
610
- conflictingProperties: conflictData.conflictingProperties,
611
- formatters: {},
612
- title: "confirmPersonalDetails",
613
- explanation: "theDetailsYouEnteredDontMatch",
614
- onContinue: handleDataConflictsResolved,
615
- onCancel: () => {
616
- setExtractedData(void 0);
617
- setStatus("ready");
618
- }
619
- })
620
- ]
621
- });
622
- }
623
- //#endregion
624
- //#region src/adaptiveWorkflow/components/Fields/IndustryCode/IndustryCodeFieldGroup.tsx
625
- function mapSelectedCodes(selectedCodes) {
626
- return selectedCodes && selectedCodes.length > 0 ? selectedCodes.map((i) => ({
627
- value: i,
628
- touched: !!i.id
629
- })) : [{
630
- value: {
631
- id: "",
632
- name: ""
633
- },
634
- touched: false
635
- }];
636
- }
637
- function getNestedValue$1(obj, path) {
638
- return path.split(".").reduce((acc, key) => acc?.[key], obj);
639
- }
640
- var IndustryCodeFieldGroup = withForm({
641
- defaultValues: {},
642
- props: {},
643
- render: function IndustryCodeFieldGroupRender({ form, basePath: industryCodesPath, businessLineTypes = ["banking"], single = true }) {
644
- const { t, i18n } = useTranslation(["common", "ui"]);
645
- const { isFeatureEnabled } = useToggleContext();
646
- const { data: industryCodes, isLoading: industryCodesLoading } = useIndustryCodes(businessLineTypes, i18n.language);
647
- const { data: existingBusinessLines, isLoading: existingBusinessLinesLoading } = useBusinessLines(businessLineTypes);
648
- const selectedCodes = useStore(form.store, (s) => getNestedValue$1(s.values, industryCodesPath));
649
- const [items, setItems] = useState$1(() => mapSelectedCodes(selectedCodes));
650
- const containerRef = useRef$1(null);
651
- const singleIndustryCode = single || isFeatureEnabled("EnableLimitToSingleBusinessLine");
652
- const allIndustryCodeSelectItems = useMemo$1(() => industryCodes?.map((entry) => ({
653
- id: entry.code,
654
- name: `${entry.code} - ${entry.description}`
655
- })) ?? [], [industryCodes]);
656
- const selectableIndustryCodes = useMemo$1(() => {
657
- if (!businessLineTypes.includes("acquiring")) return allIndustryCodeSelectItems;
658
- const selectedIds = selectedCodes?.map((c) => c.id);
659
- const existingIds = (existingBusinessLines ?? []).map((b) => b.industryCode);
660
- return allIndustryCodeSelectItems.filter(({ id }) => {
661
- return !selectedIds?.includes(id) && !existingIds?.includes(id);
662
- });
663
- }, [
664
- allIndustryCodeSelectItems,
665
- businessLineTypes,
666
- selectedCodes,
667
- existingBusinessLines
668
- ]);
669
- const updateFormValues = (newItems) => {
670
- form.setFieldValue(industryCodesPath, newItems.map(({ value }) => value));
671
- };
672
- const handleSelectIndustryCode = (indexToUpdate, selectedItem) => {
673
- setItems((prevItems) => {
674
- const newItems = prevItems.map((item, i) => i === indexToUpdate ? {
675
- value: {
676
- id: selectedItem.id,
677
- name: selectedItem.name
678
- },
679
- touched: true
680
- } : item);
681
- updateFormValues(newItems);
682
- return newItems;
683
- });
684
- };
685
- const addIndustryCodeField = (e) => {
686
- if (items[items.length - 1].value.id === "") {
687
- handleContainerBlur(e, items.length - 1);
688
- return;
689
- }
690
- const newItems = [...items, {
691
- value: {
692
- id: "",
693
- name: ""
694
- },
695
- touched: false
696
- }];
697
- setItems(newItems);
698
- updateFormValues(newItems);
699
- };
700
- const removeField = (indexToRemove) => {
701
- const newItems = items.filter((_, i) => i !== indexToRemove);
702
- setItems(newItems);
703
- updateFormValues(newItems);
704
- };
705
- const handleContainerBlur = (e, index) => {
706
- if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) setItems((prevItems) => {
707
- if (prevItems[index].value.id || prevItems[index].touched) return prevItems;
708
- const newItems = [...prevItems];
709
- newItems[index] = {
710
- ...newItems[index],
711
- touched: true
712
- };
713
- return newItems;
714
- });
715
- };
716
- return /* @__PURE__ */ jsx(form.Field, {
717
- name: industryCodesPath,
718
- validators: { onBlur: ({ value }) => {
719
- const codes = value;
720
- return !codes?.length || codes.some((c) => !c.id) ? "fieldIsRequired" : void 0;
721
- } },
722
- children: (field) => {
723
- if (industryCodesLoading || existingBusinessLinesLoading) return /* @__PURE__ */ jsx(Loader, { size: "large" });
724
- const isTouched = field.state.meta.isTouched;
725
- const isValid = field.state.meta.isValid;
726
- const errorMessage = isTouched && !isValid ? field.state.meta.errors[0] : void 0;
727
- return /* @__PURE__ */ jsx(Field, {
728
- name: "industryCodes",
729
- label: t(($) => $["industry"], { ns: "ui" }),
730
- errorMessage,
731
- isValid: isTouched && isValid,
732
- showErrorIcon: false,
733
- children: (childProps) => {
734
- const content = /* @__PURE__ */ jsx("div", {
735
- ref: containerRef,
736
- "data-testid": "industryCode",
737
- style: {
738
- display: "flex",
739
- flexDirection: "column",
740
- gap: "8px"
741
- },
742
- children: items.map((code, index) => {
743
- const isInvalid = code.touched && code.value.id === "";
744
- return /* @__PURE__ */ jsxs("div", {
745
- style: {
746
- display: "flex",
747
- alignItems: "center",
748
- gap: "8px"
749
- },
750
- children: [/* @__PURE__ */ jsx(Select, {
751
- ...childProps,
752
- id: `industryCodeSelection-${index}`,
753
- name: `industryCodeSelection-${index}`,
754
- selected: code.value,
755
- placeholder: t(($) => $["industryCode__placeholder"], { ns: "ui" }),
756
- items: allIndustryCodeSelectItems,
757
- excludedValues: allIndustryCodeSelectItems.filter((i) => !selectableIndustryCodes.includes(i)),
758
- readonly: !!industryCodes && selectableIndustryCodes.length === 0,
759
- onSelect: (selectedItem) => handleSelectIndustryCode(index, selectedItem),
760
- isInvalid,
761
- onBlur: (e) => {
762
- handleContainerBlur(e, index);
763
- field.handleBlur();
764
- }
765
- }), !singleIndustryCode && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
766
- ariaLabel: t(($) => $["removeIndustryCode"], { ns: "ui" }),
767
- variant: "tertiary",
768
- icon: "minusCircleFilled",
769
- circle: true,
770
- onClick: () => removeField(index),
771
- disabled: items.length === 1
772
- }), /* @__PURE__ */ jsx(IconButton, {
773
- ariaLabel: t(($) => $["addIndustryCode"], { ns: "ui" }),
774
- variant: "tertiary",
775
- icon: "plusCircleFilled",
776
- circle: true,
777
- onClick: addIndustryCodeField,
778
- disabled: code.value.id === "" || code.value.id !== "" && index !== items.length - 1 || selectableIndustryCodes.length === 0
779
- })] })]
780
- }, `${code.value.id}-${index}`);
781
- })
782
- });
783
- return singleIndustryCode ? content : /* @__PURE__ */ jsx(List, {
784
- dividers: false,
785
- variant: "grouped-primary",
786
- children: content
787
- });
788
- }
789
- });
790
- }
791
- });
792
- }
793
- });
794
- //#endregion
795
- //#region src/adaptiveWorkflow/components/Fields/LegalName.tsx
796
- function LegalName({ name, data, valid, errors, labels, helperText, readonly, handleChangeFor }) {
797
- const handleKeyDown = (e) => {
798
- if (e.key === KEYBOARD_KEYS.enter) e.preventDefault();
799
- };
800
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", { children: name }), /* @__PURE__ */ jsx(Field, {
801
- name,
802
- label: labels,
803
- helper: helperText,
804
- errorMessage: errors,
805
- isValid: valid,
806
- children: (_childProps) => /* @__PURE__ */ jsx(InputText, {
807
- "aria-required": true,
808
- "aria-invalid": !valid,
809
- name,
810
- value: data,
811
- readonly,
812
- onInput: handleChangeFor,
813
- onBlur: handleChangeFor,
814
- onKeyDown: handleKeyDown
815
- })
816
- })] });
817
- }
818
- //#endregion
819
- //#region src/adaptiveWorkflow/components/Fields/SourceOfFundsWorkflow/SourceOfFundsWorkflow.tsx
820
- var SourceOfFundsWorkflow = ({ onComplete, onClose, resourceId }) => {
821
- if (!resourceId) return /* @__PURE__ */ jsx(EndStateLayout, {
822
- variant: "error",
823
- title: "Something went wrong",
824
- description: "Please try again later"
825
- });
826
- return /* @__PURE__ */ jsx(SourceOfFundsPage, {
827
- onSubmit: onComplete,
828
- handleHomeClick: onClose,
829
- asAwe: true
830
- });
831
- };
832
- //#endregion
833
- //#region src/adaptiveWorkflow/components/Fields/TaxInformation/ExemptedFromTaxField.tsx
834
- function ExemptedFromTaxField({ field, label, checked, onChange }) {
835
- return /* @__PURE__ */ jsx(Field, {
836
- name: field.name,
837
- children: (childProps) => /* @__PURE__ */ jsx(Checkbox, {
838
- ...childProps,
839
- "aria-required": false,
840
- "aria-invalid": false,
841
- name: field.name,
842
- label,
843
- value: "exemptedFromTax",
844
- checked,
845
- onChange
846
- })
847
- });
848
- }
849
- //#endregion
850
- //#region src/adaptiveWorkflow/components/Fields/TaxInformation/TaxIdNumberInputField.tsx
851
- function TaxIdNumberInputField({ field, fieldMetadata, currentValue, placeholder, readonly, optional, shouldValidate, disabled, onInput, onBlur }) {
852
- const { t } = useTranslation("common");
853
- const isTouched = field.state.meta.isTouched;
854
- const isValid = field.state.meta.isValid;
855
- const errorMessage = isTouched && !isValid ? field.state.meta.errors[0] : void 0;
856
- return /* @__PURE__ */ jsx(MaskedInput, {
857
- type: "text",
858
- "aria-required": true,
859
- "aria-invalid": isTouched && !isValid,
860
- name: "taxInformation",
861
- label: fieldMetadata.label ? t(($) => $[fieldMetadata.label]) ?? "" : "",
862
- formatGuidance: fieldMetadata.guidanceText ? translateTranslatable(t, fieldMetadata.guidanceText) : void 0,
863
- value: currentValue,
864
- errorMessage,
865
- placeholder,
866
- isValid: isValid && !!currentValue,
867
- onInput,
868
- onBlur,
869
- disabled,
870
- readonly,
871
- optional,
872
- shouldValidate,
873
- ...fieldMetadata.mask ?? {}
874
- });
875
- }
876
- //#endregion
877
- //#region src/adaptiveWorkflow/components/Fields/TaxInformation/TaxIdTypeSelectorField.tsx
878
- function TaxIdTypeSelectorField({ field, country, companyType, selected, onTypeChange, exemptedOptionLabel, isUsSoleProp }) {
879
- const errorMessage = field.state.meta.isTouched && !field.state.meta.isValid ? field.state.meta.errors[0] : void 0;
880
- return /* @__PURE__ */ jsx(TaxIdNumberTypeSelector, {
881
- country,
882
- companyType,
883
- selected,
884
- setSelected: onTypeChange,
885
- exemptedOptionLabel,
886
- isUsSoleProp,
887
- errorMessage: isUsSoleProp ? errorMessage : void 0
888
- });
889
- }
890
- //#endregion
891
- //#region src/adaptiveWorkflow/components/Fields/TaxInformation/TaxInformationFieldGroup.tsx
892
- function getNestedValue(obj, path) {
893
- return path.split(".").reduce((acc, key) => acc?.[key], obj);
894
- }
895
- var TaxInformationFieldGroup = withForm({
896
- defaultValues: {},
897
- props: {},
898
- render: function TaxInformationFieldGroupRender({ form, basePath: taxInfoPath, country, canExempt, entityType, registrationNumber, defaultData, labels, placeholder, readonly, optional }) {
899
- const { isFeatureEnabled } = useToggleContext();
900
- const { t } = useTranslation("common");
901
- const taxNumberPath = `${taxInfoPath}.number`;
902
- const taxTypePath = `${taxInfoPath}.type`;
903
- const exemptedPath = `${taxInfoPath}.numberAbsent`;
904
- const isUenPath = `${taxInfoPath}.isUen`;
905
- const taxInformations = useStore(form.store, (s) => getNestedValue(s.values, taxInfoPath));
906
- const exemptedFromTax = useStore(form.store, (s) => getNestedValue(s.values, exemptedPath));
907
- const isUsSoleProp = country === "US" && entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP;
908
- const currentTaxInformation = useMemo$1(() => taxInformations?.find((t) => t.country === country), [taxInformations, country]);
909
- const taxIdNumberType = useMemo$1(() => {
910
- if (currentTaxInformation?.numberAbsent) return "exempted";
911
- if (currentTaxInformation?.type) return currentTaxInformation.type;
912
- if (isUsSoleProp) return void 0;
913
- return getDefaultTaxIdNumberType(taxInformations, country, entityType);
914
- }, [
915
- currentTaxInformation?.type,
916
- currentTaxInformation?.numberAbsent,
917
- taxInformations,
918
- isUsSoleProp,
919
- country,
920
- entityType
921
- ]);
922
- const options = getTaxIdNumberOptions(country, entityType);
923
- const showTaxIdExemptedOptions = canExempt && (options?.length ?? 0) > 1 || isUsSoleProp;
924
- const canSaveAbsentState = isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country);
925
- const fieldMetadata = resolveFieldMetadata(taxInformationDefaultFieldConfig[country], {
926
- taxIdNumberType: currentTaxInformation?.type,
927
- companyType: entityType
928
- }, taxInformationDefaultFieldMetadata);
929
- const exemptionLabel = isUsSoleProp ? t(($) => $["socialSecurityNumber"]) : labels?.exemptedFromTax;
930
- const updateTaxInfo = useCallback$1((mode, newEntry) => {
931
- const updated = upsertTaxInfoForCountry(defaultData, country, canSaveAbsentState ? {
932
- ...newEntry,
933
- numberAbsent: newEntry.numberAbsent ?? false
934
- } : newEntry);
935
- form.setFieldValue(taxInfoPath, updated);
936
- }, [
937
- canSaveAbsentState,
938
- country,
939
- form,
940
- taxInfoPath,
941
- defaultData
942
- ]);
943
- const updateTaxType = useCallback$1((type, mode) => {
944
- updateTaxInfo(mode, {
945
- country,
946
- number: currentTaxInformation?.number,
947
- type
948
- });
949
- }, [
950
- country,
951
- currentTaxInformation?.number,
952
- updateTaxInfo
953
- ]);
954
- const removeCountryTaxInfo = useCallback$1(() => {
955
- form.setFieldValue(taxInfoPath, removeTaxInfoForCountry(taxInformations, country));
956
- }, [
957
- country,
958
- form,
959
- taxInfoPath,
960
- taxInformations
961
- ]);
962
- const addTaxAbsentStatus = useCallback$1((absent) => {
963
- form.setFieldValue(taxInfoPath, upsertTaxInfoForCountry(taxInformations, country, {
964
- country,
965
- numberAbsent: absent
966
- }));
967
- }, [
968
- country,
969
- form,
970
- taxInfoPath,
971
- taxInformations
972
- ]);
973
- const setUenAsTaxId = useCallback$1((uen) => {
974
- updateTaxInfo("blur", {
975
- country,
976
- number: uen ?? "",
977
- type: "UEN"
978
- });
979
- }, [country, updateTaxInfo]);
980
- const resetToDefaultData = useCallback$1(() => {
981
- if (defaultData !== void 0) form.setFieldValue(taxInfoPath, defaultData);
982
- }, [
983
- defaultData,
984
- form,
985
- taxInfoPath
986
- ]);
987
- const handleTaxIdNumberTypeChange = useCallback$1((taxIdType) => {
988
- if (!canExempt && taxIdType === "exempted") throw new Error(`${country} does not allow tax exemptions`);
989
- if (taxIdType === "exempted") {
990
- form.setFieldValue(exemptedPath, true);
991
- updateTaxType(void 0, "input");
992
- return canSaveAbsentState ? addTaxAbsentStatus(true) : removeCountryTaxInfo();
993
- }
994
- form.setFieldValue(exemptedPath, false);
995
- if (country === "SG") if (taxIdType === "UEN") {
996
- form.setFieldValue(isUenPath, true);
997
- setUenAsTaxId(registrationNumber);
998
- } else {
999
- form.setFieldValue(isUenPath, false);
1000
- removeCountryTaxInfo();
1001
- }
1002
- updateTaxType(taxIdType, "input");
1003
- }, [
1004
- addTaxAbsentStatus,
1005
- canExempt,
1006
- canSaveAbsentState,
1007
- country,
1008
- exemptedPath,
1009
- form,
1010
- isUenPath,
1011
- removeCountryTaxInfo,
1012
- registrationNumber,
1013
- setUenAsTaxId,
1014
- updateTaxType
1015
- ]);
1016
- const handleTaxNumberChange = useCallback$1((e, mode) => {
1017
- updateTaxInfo(mode, {
1018
- country,
1019
- number: e ? typeof e === "string" ? e : e.currentTarget.value : void 0,
1020
- type: currentTaxInformation?.type ?? (taxIdNumberType !== "exempted" ? taxIdNumberType : void 0)
1021
- });
1022
- }, [
1023
- country,
1024
- currentTaxInformation?.type,
1025
- taxIdNumberType,
1026
- updateTaxInfo
1027
- ]);
1028
- const handleExemptedFromTaxChange = useCallback$1((exempted) => {
1029
- form.setFieldValue(exemptedPath, exempted);
1030
- if (canSaveAbsentState) addTaxAbsentStatus(exempted);
1031
- else removeCountryTaxInfo();
1032
- }, [
1033
- addTaxAbsentStatus,
1034
- canSaveAbsentState,
1035
- exemptedPath,
1036
- form,
1037
- removeCountryTaxInfo
1038
- ]);
1039
- const prevCountryRef = useRef$1(country);
1040
- useEffect$1(() => {
1041
- if (!country || prevCountryRef.current === country) return;
1042
- prevCountryRef.current = country;
1043
- const hasSavedTaxId = defaultData?.find((t) => t.country === country);
1044
- if (currentTaxInformation && !hasSavedTaxId) return;
1045
- if (entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP) return;
1046
- resetToDefaultData();
1047
- }, [
1048
- country,
1049
- currentTaxInformation,
1050
- defaultData,
1051
- entityType,
1052
- resetToDefaultData
1053
- ]);
1054
- useEffect$1(() => {
1055
- if (country === "SG" && registrationNumber && registrationNumber !== currentTaxInformation?.number) setUenAsTaxId(registrationNumber);
1056
- }, [
1057
- registrationNumber,
1058
- currentTaxInformation?.number,
1059
- country,
1060
- setUenAsTaxId
1061
- ]);
1062
- return /* @__PURE__ */ jsxs("div", { children: [
1063
- /* @__PURE__ */ jsx(form.Field, {
1064
- name: taxTypePath,
1065
- children: (field) => /* @__PURE__ */ jsx(TaxIdTypeSelectorField, {
1066
- field,
1067
- country,
1068
- companyType: entityType,
1069
- selected: taxIdNumberType,
1070
- onTypeChange: handleTaxIdNumberTypeChange,
1071
- exemptedOptionLabel: showTaxIdExemptedOptions ? exemptionLabel : void 0,
1072
- isUsSoleProp
1073
- })
1074
- }),
1075
- /* @__PURE__ */ jsx(form.Field, {
1076
- name: taxNumberPath,
1077
- children: (field) => /* @__PURE__ */ jsx(TaxIdNumberInputField, {
1078
- field,
1079
- fieldMetadata,
1080
- currentValue: currentTaxInformation?.number ?? "",
1081
- placeholder,
1082
- readonly,
1083
- optional,
1084
- shouldValidate: true,
1085
- disabled: Boolean(exemptedFromTax),
1086
- onInput: (e) => handleTaxNumberChange(e, "input"),
1087
- onBlur: (e) => handleTaxNumberChange(e, "blur")
1088
- })
1089
- }),
1090
- canExempt && !showTaxIdExemptedOptions && /* @__PURE__ */ jsx(form.Field, {
1091
- name: exemptedPath,
1092
- children: (field) => /* @__PURE__ */ jsx(ExemptedFromTaxField, {
1093
- field,
1094
- label: labels?.exemptedFromTax,
1095
- checked: Boolean(exemptedFromTax),
1096
- onChange: handleExemptedFromTaxChange
1097
- })
1098
- })
1099
- ] });
1100
- }
1101
- });
1102
- //#endregion
1103
- //#region src/adaptiveWorkflow/components/Fields/TaxReportingWorkflow/TaxReportingWorkflow.tsx
1104
- var TaxReportingWorkflow = ({ onComplete, onClose, resourceId }) => {
1105
- if (!resourceId) return /* @__PURE__ */ jsx(EndStateLayout, {
1106
- variant: "error",
1107
- title: "Something went wrong",
1108
- description: "Please try again later"
1109
- });
1110
- return /* @__PURE__ */ jsx(TaxReportingDropin, {
1111
- onSubmit: onComplete,
1112
- handleHomeClick: onClose,
1113
- asAwe: true
1114
- });
1115
- };
1116
- var UboTaskItem_module_default = {
1117
- "ubo-task-item-actions": "_ubo-task-item-actions_1mthv_1",
1118
- uboTaskItemActions: "_ubo-task-item-actions_1mthv_1"
1119
- };
1120
- //#endregion
1121
- //#region src/adaptiveWorkflow/components/TaskItems/UboTaskItem/UboTaskItem.tsx
1122
- /**
1123
- * Specialized component used for rendering of a task item for UBOs
1124
- * Clicks on the task item will render the associated steps with this
1125
- */
1126
- var UboTaskItem = ({ status, onClick, props: { name } }) => {
1127
- const { t } = useTranslation("common");
1128
- const [isSendingInvite, setIsSendingInvite] = useState$1(false);
1129
- const handleInviteClick = () => {
1130
- try {
1131
- setIsSendingInvite(true);
1132
- } catch {
1133
- console.log("error");
1134
- } finally {
1135
- setIsSendingInvite(false);
1136
- }
1137
- };
1138
- const renderMainAccessory = () => {
1139
- switch (status) {
1140
- case "DETAILS_REQUIRED": return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
1141
- loading: isSendingInvite,
1142
- circle: true,
1143
- variant: "tertiary",
1144
- onClick: handleInviteClick,
1145
- icon: "upload",
1146
- ariaLabel: "send invite"
1147
- }), /* @__PURE__ */ jsx(Button, {
1148
- onClick,
1149
- disabled: isSendingInvite,
1150
- children: t(($) => $["update"])
1151
- })] });
1152
- case "FINISHED": return /* @__PURE__ */ jsx(Status, {
1153
- variant: "success",
1154
- text: "Verified",
1155
- icon: "checkmark"
1156
- });
1157
- }
1158
- };
1159
- return /* @__PURE__ */ jsx(Card, {
1160
- padding: "medium",
1161
- children: /* @__PURE__ */ jsx(ListItem, {
1162
- accessory: /* @__PURE__ */ jsx("div", {
1163
- className: UboTaskItem_module_default.uboTaskItemActions,
1164
- children: renderMainAccessory()
1165
- }),
1166
- avatar: {
1167
- iconName: "user",
1168
- circle: true
1169
- },
1170
- title: name || "Decision maker"
1171
- })
1172
- });
1173
- };
1174
- //#endregion
1175
- //#region src/adaptiveWorkflow/component-registry.ts
1176
- /**
1177
- * Registry for simple (single form.Field) components
1178
- */
1179
- var simpleComponentMap = { LegalNameField: LegalName };
1180
- /**
1181
- * Registry for compound components
1182
- * Compound components receive form + basePath + dynamic server-driven props.
1183
- * The map value must be ComponentType<any> because each compound component has its own unique
1184
- * props interface — there's no single type that covers all of them in a dynamic registry.
1185
- */
1186
- var compoundComponentMap = {
1187
- TaxInformationFieldGroup,
1188
- BusinessRegistrationNumberFieldGroup,
1189
- IndustryCodeFieldGroup,
1190
- IdentityNumberFieldGroup
1191
- };
1192
- /**
1193
- * Registry for specialized components
1194
- * Specialized components are intended to be all encompassing, handling their own
1195
- * field rendering, form steps (if applicable), data submission, etc.
1196
- *
1197
- * Naming convention: `${componentName}Workflow`
1198
- */
1199
- var specializedComponentMap = {
1200
- SourceOfFunds: SourceOfFundsWorkflow,
1201
- TaxReporting: TaxReportingWorkflow,
1202
- IdentityScreening: IdentityScreeningWorkflow,
1203
- AcceptTermsOfService: AcceptTermsOfServiceWorkflow
1204
- };
1205
- /**
1206
- * Registry for specialized components used for rendering tasks in the UI which replace the default component used to represent tasks.
1207
- */
1208
- var specializedTaskComponentMap = { UboTaskItem };
1209
- //#endregion
1210
- //#region src/adaptiveWorkflow/components/SpecializedComponent/SpecializedComponent.tsx
1211
- /**
1212
- * A dynamic component resolver for the Adaptive Workflow Engine (AWE).
1213
- *
1214
- * Specialized components are self-contained units that handle their own field rendering,
1215
- * multi-step forms (if applicable), and data submission. They are looked up from the
1216
- * {@link specializedComponentMap} registry using the `component` provided by the AWE manifest.
1217
- *
1218
- * @param component - name used to resolve the component from the registry
1219
- * @param onComplete - Forwarded to the resolved component; called when its flow finishes
1220
- * @param onClose - Forwarded to the resolved component; called to dismiss the modal
1221
- * @param properties - properties returned from AWE
1222
- * @returns The matched specialized component, or an error end-state if the component
1223
- * is not found in the registry or the `id` is missing
1224
- */
1225
- var SpecializedComponent = ({ component, onComplete, onClose, properties }) => {
1226
- const { globals } = useWorkflowContext();
1227
- const Component = specializedComponentMap[component];
1228
- const mappedProps = useComputed(() => {
1229
- return resolveComponentProps(globals.value, properties);
1230
- });
1231
- if (Component) return /* @__PURE__ */ jsx(Component, {
1232
- onComplete,
1233
- onClose,
1234
- ...mappedProps.value
1235
- });
1236
- return /* @__PURE__ */ jsx(EndStateLayout, {
1237
- title: "Something went wrong",
1238
- description: "Something went wrong on our end, please try again later",
1239
- variant: "error"
1240
- });
1241
- };
1242
- //#endregion
1243
- //#region src/adaptiveWorkflow/components/DynamicForm/contextMap.ts
1244
- var contextMap$3 = {
1245
- businessDetails: {
1246
- heading: "businessInformation",
1247
- description: "placeholder"
1248
- },
1249
- additionalBusinessDetails: {
1250
- heading: "additionalBusinessDetails",
1251
- description: "placeholder"
1252
- },
1253
- identityNumber: {
1254
- heading: "additionalPersonalDetails",
1255
- description: "placeholder"
1256
- },
1257
- identityVerification: {
1258
- heading: "liveFaceDetection",
1259
- description: "placeholder"
1260
- }
1261
- };
1262
- //#endregion
1263
- //#region src/adaptiveWorkflow/components/DynamicForm/useCustomerData.ts
1264
- function mapFormValuesToPayload({ steps, globals, formValues }) {
1265
- const components = steps.flatMap((step) => step.componentGroups.flatMap((group) => group.components));
1266
- const domainPayloads = {};
1267
- for (const component of components) {
1268
- const dotIndex = component.path.indexOf(".");
1269
- const domain = dotIndex !== -1 ? component.path.slice(0, dotIndex) : component.path;
1270
- const subPath = dotIndex !== -1 ? component.path.slice(dotIndex + 1) : "";
1271
- if (!domainPayloads[domain]) domainPayloads[domain] = {
1272
- id: void 0,
1273
- data: {}
1274
- };
1275
- const apiValue = getNestedValue$4(formValues, component.path);
1276
- const resolvedProps = resolveComponentProps(globals.value, component.properties);
1277
- domainPayloads[domain].id = resolvedProps?.resourceId;
1278
- if (subPath) setNestedValue(domainPayloads[domain].data, subPath, apiValue);
1279
- else Object.assign(domainPayloads[domain].data, apiValue);
1280
- }
1281
- return domainPayloads;
1282
- }
1283
- async function doLegalEntityUpdates({ rootLegalEntityId, domainPayloads, updateLegalEntity }) {
1284
- await updateLegalEntity.mutateAsync({
1285
- ...!!domainPayloads.organization?.data && {
1286
- id: domainPayloads.organization.id ?? rootLegalEntityId.value,
1287
- organization: domainPayloads.organization.data
1288
- },
1289
- ...!!domainPayloads.individual?.data && {
1290
- id: domainPayloads.individual.id ?? rootLegalEntityId.value,
1291
- individual: domainPayloads.individual.data
1292
- }
1293
- });
1294
- }
1295
- async function doBusinessLineUpdates({ rootLegalEntityId, domainPayloads, createBusinessLine, updateBusinessLine }) {
1296
- const businessLinePayload = domainPayloads.businessLine;
1297
- if (!businessLinePayload?.data) return;
1298
- const payload = {
1299
- ...businessLinePayload.data,
1300
- id: businessLinePayload.id,
1301
- legalEntityId: rootLegalEntityId.value
1302
- };
1303
- if (payload.id) return await updateBusinessLine.mutateAsync(payload);
1304
- else return await createBusinessLine.mutateAsync(payload);
1305
- }
1306
- /**
1307
- * Routes DynamicForm submission to the correct API mutations based on the data path prefix
1308
- * declared in each `ComponentConfig`:
1309
- *
1310
- * - `organization.*` / `individual.*` → `useUpdateLegalEntity` (PATCH)
1311
- * - `businessLine.*` → `useCreateBusinessLine` (POST, no id) /
1312
- * `useUpdateBusinessLine` (POST, with id)
1313
- *
1314
- * @param steps - step config from the server response; used to enumerate data paths
1315
- * for current task
1316
- * @param legalEntityId - override the legal entity ID for non-root entities (e.g. UBOs).
1317
- * Defaults to `rootLegalEntityId` from `ApiContext`.
1318
- */
1319
- function useCustomerData(steps) {
1320
- const { rootLegalEntityId } = useApiContext();
1321
- const { globals, updateGlobals } = useWorkflowContext();
1322
- const updateLegalEntity = useUpdateLegalEntity();
1323
- const createBusinessLine = useCreateBusinessLine();
1324
- const updateBusinessLine = useUpdateBusinessLine();
1325
- return { submit: useCallback$1(async (formValues) => {
1326
- const domainPayloads = mapFormValuesToPayload({
1327
- steps,
1328
- globals,
1329
- formValues
1330
- });
1331
- await doLegalEntityUpdates({
1332
- rootLegalEntityId,
1333
- domainPayloads,
1334
- updateLegalEntity
1335
- });
1336
- const businessLine = await doBusinessLineUpdates({
1337
- rootLegalEntityId,
1338
- domainPayloads,
1339
- createBusinessLine,
1340
- updateBusinessLine
1341
- });
1342
- updateGlobals({ ...businessLine?.id && { "businessLine.id": {
1343
- type: "string",
1344
- value: businessLine.id
1345
- } } });
1346
- }, [
1347
- steps,
1348
- rootLegalEntityId,
1349
- createBusinessLine,
1350
- globals,
1351
- updateBusinessLine,
1352
- updateGlobals,
1353
- updateLegalEntity
1354
- ]) };
1355
- }
1356
- //#endregion
1357
- //#region src/adaptiveWorkflow/components/DynamicForm/DynamicForm.tsx
1358
- function renderSimpleField(component, field) {
1359
- const FieldComponent = simpleComponentMap[component];
1360
- if (FieldComponent) return /* @__PURE__ */ jsx(FieldComponent, {
1361
- name: component,
1362
- handleChangeFor: field.handleChange
1363
- });
1364
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", { children: component }), /* @__PURE__ */ jsx(InputText, {
1365
- onInput: field.handleChange,
1366
- onBlur: field.handleChange,
1367
- name: component
1368
- })] });
1369
- }
1370
- function renderCompoundField(compoundFieldProps) {
1371
- const { component, form, basePath, props } = compoundFieldProps;
1372
- const CompoundComponent = compoundComponentMap[component];
1373
- if (CompoundComponent) return /* @__PURE__ */ jsx(CompoundComponent, {
1374
- form,
1375
- basePath,
1376
- ...props
1377
- });
1378
- return null;
1379
- }
1380
- function DynamicForm({ onClose, onComplete, steps }) {
1381
- const { t } = useTranslation("adaptive");
1382
- const { t: commonT } = useTranslation(["common"]);
1383
- const { submit: submitCustomerData } = useCustomerData(steps);
1384
- const { globals } = useWorkflowContext();
1385
- const form = useAppForm({
1386
- defaultValues: {},
1387
- onSubmit: async ({ value }) => {
1388
- await submitCustomerData(value);
1389
- onComplete();
1390
- }
1391
- });
1392
- const [currentStep, setCurrentStep] = useState$1(steps[0]);
1393
- const [isConfirmPresented, setIsConfirmPresented] = useState$1(false);
1394
- const currentStepIndex = steps.findIndex((step) => step.id === currentStep.id);
1395
- const isFirstStep = currentStepIndex === 0;
1396
- const isLastStep = currentStepIndex === steps.length - 1;
1397
- const progress = Math.floor((currentStepIndex + 1) / steps.length * 100);
1398
- const hasSpecializedComponent = currentStep.componentGroups.some((componentGroup) => componentGroup.components.some((component) => component.componentType === "SPECIALIZED"));
1399
- const { heading: headingKey, description: descriptionKey } = contextMap$3[currentStep.id] || {};
1400
- const navigateBack = () => {
1401
- setCurrentStep(steps[currentStepIndex - 1]);
1402
- };
1403
- const navigateNext = async () => {
1404
- if ((await form.validateAllFields("change")).length === 0) setCurrentStep(steps[currentStepIndex + 1]);
1405
- };
1406
- const handleSpecializedComplete = () => {
1407
- if (isLastStep) {
1408
- onComplete();
1409
- return;
1410
- }
1411
- setCurrentStep(steps[currentStepIndex + 1]);
1412
- };
1413
- const handleSpecializedClose = () => {
1414
- if (isFirstStep) {
1415
- handleDismiss();
1416
- return;
1417
- }
1418
- navigateBack();
1419
- };
1420
- const renderSpecialized = (component) => {
1421
- return /* @__PURE__ */ jsx(SpecializedComponent, {
1422
- ...component,
1423
- onComplete: handleSpecializedComplete,
1424
- onClose: handleSpecializedClose
1425
- });
1426
- };
1427
- const handleCancelDismiss = () => {
1428
- setIsConfirmPresented(false);
1429
- };
1430
- const handleConfirmDismiss = () => {
1431
- setIsConfirmPresented(false);
1432
- onClose();
1433
- };
1434
- const handleDismiss = () => {
1435
- setIsConfirmPresented(true);
1436
- };
1437
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
1438
- className: FormFlow_module_default.formFlow,
1439
- children: /* @__PURE__ */ jsxs(form.AppForm, { children: [/* @__PURE__ */ jsx("div", {
1440
- className: FormFlow_module_default.formFlowContent,
1441
- children: /* @__PURE__ */ jsx("form", {
1442
- onSubmit: (e) => {
1443
- e.preventDefault();
1444
- form.handleSubmit();
1445
- },
1446
- children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Header, {
1447
- title: headingKey && t(($) => $[headingKey]),
1448
- description: descriptionKey && t(($) => $[descriptionKey])
1449
- }), currentStep.componentGroups.map((componentGroup) => {
1450
- return componentGroup.components.map((component) => {
1451
- const componentProps = resolveComponentProps(globals.value, component.properties);
1452
- if (component.componentType === "COMPOUND") return renderCompoundField({
1453
- component: component.component,
1454
- form,
1455
- basePath: component.path,
1456
- props: componentProps
1457
- });
1458
- if (component.componentType === "FIELD") return /* @__PURE__ */ jsx(form.Field, {
1459
- name: component.path,
1460
- children: (field) => renderSimpleField(component.component, field)
1461
- }, component.path);
1462
- if (component.componentType === "SPECIALIZED") return renderSpecialized(component);
1463
- });
1464
- })] }, currentStep.id)
1465
- })
1466
- }), !hasSpecializedComponent && /* @__PURE__ */ jsxs("div", {
1467
- className: FormFlow_module_default.formFlowFooter,
1468
- children: [steps.length !== 1 && /* @__PURE__ */ jsx(ProgressBar, {
1469
- ariaLabel: commonT(($) => $["progress"]),
1470
- progress
1471
- }), /* @__PURE__ */ jsxs("div", {
1472
- className: FormFlow_module_default.formFlowActions,
1473
- children: [
1474
- isFirstStep && /* @__PURE__ */ jsx(Button, {
1475
- disabled: false,
1476
- onClick: handleDismiss,
1477
- variant: "secondary",
1478
- children: commonT(($) => $["cancel"])
1479
- }),
1480
- !isFirstStep && /* @__PURE__ */ jsx(Button, {
1481
- disabled: false,
1482
- icon: "chevron-left",
1483
- onClick: navigateBack,
1484
- variant: "secondary",
1485
- children: commonT(($) => $["back"])
1486
- }),
1487
- /* @__PURE__ */ jsx("div", {
1488
- className: FormFlow_module_default.formFlowPrimaryActions,
1489
- children: /* @__PURE__ */ jsx(form.Subscribe, {
1490
- selector: (s) => [s.isSubmitting, !s.canSubmit],
1491
- children: ([isSubmitting, isDisabled]) => isLastStep ? /* @__PURE__ */ jsx(Button, {
1492
- type: "submit",
1493
- onClick: () => form.handleSubmit(),
1494
- loading: isSubmitting,
1495
- disabled: isDisabled,
1496
- children: commonT(($) => $["submit"])
1497
- }) : /* @__PURE__ */ jsx(Button, {
1498
- onClick: navigateNext,
1499
- disabled: isDisabled,
1500
- loading: isSubmitting,
1501
- children: commonT(($) => $["continue"])
1502
- })
1503
- })
1504
- })
1505
- ]
1506
- })]
1507
- })] })
1508
- }), isConfirmPresented && /* @__PURE__ */ jsx(Confirm, {
1509
- confirmText: commonT(($) => $["leave"]),
1510
- description: commonT(($) => $["unsavedChangesDescription"]),
1511
- onCancel: handleCancelDismiss,
1512
- onConfirm: handleConfirmDismiss,
1513
- title: commonT(($) => $["unsavedChanges"])
1514
- })] });
1515
- }
1516
- //#endregion
1517
- //#region src/adaptiveWorkflow/components/SubTask/contextMap.ts
1518
- var contextMap$2 = { identityScreening: {
1519
- heading: "enhancedIdentityScreening",
1520
- description: "placeholder"
1521
- } };
1522
- //#endregion
1523
- //#region src/adaptiveWorkflow/components/SubTask/SubTask.tsx
1524
- var SubTask = ({ id, subTasks, handleCloseClick }) => {
1525
- const { t } = useTranslation("adaptive");
1526
- const { t: commonT } = useTranslation("common");
1527
- const { heading, description } = contextMap$2[id] || {};
1528
- return /* @__PURE__ */ jsxs("div", {
1529
- className: FormFlow_module_default.formFlow,
1530
- children: [/* @__PURE__ */ jsxs("div", {
1531
- className: FormFlow_module_default.formFlowContent,
1532
- children: [/* @__PURE__ */ jsx(Header, {
1533
- title: heading ? t(($) => $[heading]) : t(($) => $["additionalDetails"]),
1534
- description: description && t(($) => $[description])
1535
- }), /* @__PURE__ */ jsx(StackLayout, {
1536
- gap: "xSmall",
1537
- children: subTasks.map((subTask) => {
1538
- return /* @__PURE__ */ jsx(Task, { ...subTask }, subTask.id);
1539
- })
1540
- })]
1541
- }), /* @__PURE__ */ jsx("div", {
1542
- className: FormFlow_module_default.formFlowFooter,
1543
- children: /* @__PURE__ */ jsx("div", {
1544
- className: FormFlow_module_default.formFlowActions,
1545
- children: /* @__PURE__ */ jsx(Button, {
1546
- onClick: handleCloseClick,
1547
- variant: "secondary",
1548
- children: commonT(($) => $["cancel"])
1549
- })
1550
- })
1551
- })]
1552
- });
1553
- };
1554
- //#endregion
1555
- //#region src/adaptiveWorkflow/components/TaskParser/TaskParser.tsx
1556
- var TaskParser = ({ id, steps, component, subTasks, handleCloseClick, handleComplete }) => {
1557
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1558
- subTasks && /* @__PURE__ */ jsx(SubTask, {
1559
- id,
1560
- subTasks,
1561
- handleCloseClick
1562
- }),
1563
- steps && /* @__PURE__ */ jsx(DynamicForm, {
1564
- onClose: handleCloseClick,
1565
- onComplete: handleComplete,
1566
- steps
1567
- }),
1568
- component && /* @__PURE__ */ jsx(SpecializedComponent, {
1569
- ...component,
1570
- onComplete: handleComplete,
1571
- onClose: handleCloseClick
1572
- })
1573
- ] });
1574
- };
1575
- //#endregion
1576
- //#region src/adaptiveWorkflow/components/Task/contextMap.ts
1577
- var contextMap$1 = {
1578
- additionalBusinessDetails: {
1579
- title: "additionalBusinessDetails",
1580
- icon: "company"
1581
- },
1582
- identityScreening: {
1583
- title: "enhancedIdentityScreening",
1584
- icon: "user"
1585
- },
1586
- sourceOfFunds: {
1587
- title: "fundingSources",
1588
- icon: "coins"
1589
- },
1590
- taxReporting: {
1591
- title: "taxReporting",
1592
- icon: "document"
1593
- },
1594
- contracting: {
1595
- title: "servicesAgreement",
1596
- icon: "reporting"
1597
- }
1598
- };
1599
- //#endregion
1600
- //#region src/adaptiveWorkflow/components/Task/Task.tsx
1601
- var SpecializedTaskComponent = ({ taskItem, status, onClick }) => {
1602
- const { globals } = useWorkflowContext();
1603
- const TaskComponent = specializedTaskComponentMap[taskItem.component];
1604
- const mappedProps = resolveComponentProps(globals.value, taskItem.properties) ?? {};
1605
- if (TaskComponent) return /* @__PURE__ */ jsx(TaskComponent, {
1606
- id: taskItem.id,
1607
- status,
1608
- onClick,
1609
- props: mappedProps
1610
- });
1611
- return null;
1612
- };
1613
- /**
1614
- * Component which accepts the Task-specific configuration returned from AWE to render
1615
- * a specific task. Each task can render either further sub-tasks, a dynamic form, or one specialized component
1616
- */
1617
- var Task = (props) => {
1618
- const { id, taskItem } = props;
1619
- const { t } = useTranslation("adaptive");
1620
- const { t: commonT } = useTranslation("common");
1621
- const { title, icon } = contextMap$1[id] || {};
1622
- const { taskStatuses, updateTaskStatus } = useWorkflowContext();
1623
- const [showModal, setShowModal] = useState$1(false);
1624
- const taskStatus = useComputed(() => taskStatuses.value[id] ?? TaskStatuses.DETAILS_REQUIRED);
1625
- const handleTaskClick = () => {
1626
- setShowModal(true);
1627
- };
1628
- const handleCloseClick = () => {
1629
- setShowModal(false);
1630
- };
1631
- const handleComplete = () => {
1632
- updateTaskStatus(id, TaskStatuses.FINISHED);
1633
- setShowModal(false);
1634
- };
1635
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [taskItem ? /* @__PURE__ */ jsx(SpecializedTaskComponent, {
1636
- taskItem,
1637
- status: taskStatus.value,
1638
- onClick: handleTaskClick
1639
- }) : /* @__PURE__ */ jsx(TaskListItem, {
1640
- titleKey: "task",
1641
- title: title ? t(($) => $[title]) : commonT(($) => $["additionalInformation"]),
1642
- icon,
1643
- status: taskStatus.value,
1644
- onNavigateToTask: () => handleTaskClick()
1645
- }), showModal && /* @__PURE__ */ jsx(Modal, {
1646
- onClose: handleCloseClick,
1647
- size: "large",
1648
- transition: "slideIn",
1649
- showCloseButton: true,
1650
- ariaLabel: "modal",
1651
- children: /* @__PURE__ */ jsx(TaskParser, {
1652
- ...props,
1653
- handleCloseClick,
1654
- handleComplete
1655
- })
1656
- })] });
1657
- };
1658
- //#endregion
1659
- //#region src/adaptiveWorkflow/components/TaskGroup/contextMap.ts
1660
- var contextMap = {
1661
- businessInformation: {
1662
- heading: "businessInformation",
1663
- description: "placeholder"
1664
- },
1665
- financialProducts: {
1666
- heading: "setUpFinancialProducts",
1667
- description: "placeholder"
1668
- },
1669
- contracting: {
1670
- heading: "reviewAndSignLegalDisclosures",
1671
- description: "placeholder"
1672
- }
1673
- };
1674
- //#endregion
1675
- //#region src/adaptiveWorkflow/components/TaskGroup/TaskGroup.tsx
1676
- /**
1677
- * Uses task group ID and task group context map to render the copy related to a specific task group
1678
- * Also renders the nested tasks associated with a particular task group
1679
- */
1680
- var TaskGroup = ({ id, tasks }) => {
1681
- const { t } = useTranslation("adaptive");
1682
- const { heading: headingKey, description: descriptionKey } = contextMap[id] || {};
1683
- return /* @__PURE__ */ jsx("div", {
1684
- className: "u-margin-bottom-24",
1685
- children: /* @__PURE__ */ jsxs(StackLayout, {
1686
- gap: "xSmall",
1687
- children: [/* @__PURE__ */ jsx(Header, {
1688
- title: headingKey ? t(($) => $[headingKey]) : t(($) => $["additionalDetails"]),
1689
- description: descriptionKey && t(($) => $[descriptionKey]),
1690
- secondary: true
1691
- }), tasks.map((task) => /* @__PURE__ */ jsx(Task, { ...task }, task.id))]
1692
- })
1693
- });
1694
- };
1695
- //#endregion
1696
- //#region src/adaptiveWorkflow/components/TaskGroupParser/TaskGroupParser.tsx
1697
- /**
1698
- * Parses TaskGroupConfig returned from AWE to render task groups
1699
- */
1700
- var TaskGroupParser = ({ taskGroups }) => {
1701
- return /* @__PURE__ */ jsx(StackLayout, { children: taskGroups.map((taskGroup) => /* @__PURE__ */ jsx(TaskGroup, { ...taskGroup }, taskGroup.id)) });
1702
- };
1703
- //#endregion
1704
- //#region src/adaptiveWorkflow/components/WorkflowHeading/WorkflowHeading.tsx
1705
- var getHeadingCopy = (globalStatus, t) => {
1706
- switch (globalStatus) {
1707
- case "ACTION_REQUIRED": return {
1708
- title: t(($) => $["wereAlmostThere"]),
1709
- description: t(($) => $["youreInTheHomeStretch"])
1710
- };
1711
- default: return {
1712
- title: t(($) => $["welcomeBack"]),
1713
- description: t(($) => $["weveReusedYourExistingMerchantProfile"])
1714
- };
1715
- }
1716
- };
1717
- var WorkflowHeading = ({ globalStatus }) => {
1718
- const { t } = useTranslation("adaptive");
1719
- const { title, description } = getHeadingCopy(globalStatus, t);
1720
- return /* @__PURE__ */ jsx(Header, {
1721
- title,
1722
- description
1723
- });
1724
- };
1725
- //#endregion
1726
- //#region src/adaptiveWorkflow/components/WorkflowEndState/WorkflowEndState.tsx
1727
- var STATUSES_WITH_WORKFLOW_END_STATE = new Set(["ACTIVATION", "READY"]);
1728
- var getEndStateConfig = (globalStatus, t) => {
1729
- switch (globalStatus) {
1730
- case "ACTIVATION": return {
1731
- title: t(($) => $["weveGotItFromHere"]),
1732
- description: t(($) => $["yourDetailsHaveBeenSubmitted"]),
1733
- variant: "info"
1734
- };
1735
- case "READY": return {
1736
- title: t(($) => $["ready"]),
1737
- description: t(($) => $["youreAllSet"]),
1738
- variant: "success"
1739
- };
1740
- default: return;
1741
- }
1742
- };
1743
- var WorkflowEndState = ({ status, handleBack }) => {
1744
- const { t } = useTranslation("adaptive");
1745
- const endStateConfig = getEndStateConfig(status, t);
1746
- const action = handleBack ? /* @__PURE__ */ jsx(Button, {
1747
- fullWidth: true,
1748
- onClick: handleBack,
1749
- children: t(($) => $["returnToPlatform"])
1750
- }) : void 0;
1751
- return endStateConfig ? /* @__PURE__ */ jsx(EndStateLayout, {
1752
- title: endStateConfig.title,
1753
- description: endStateConfig.description,
1754
- variant: endStateConfig.variant,
1755
- action
1756
- }) : null;
1757
- };
1758
- //#endregion
1759
- //#region src/adaptiveWorkflow/AdaptiveWorkflow.tsx
1760
- var getTaskIdsFromTasks = (tasks) => tasks.flatMap((task) => [task.id, ...task.subTasks ? getTaskIdsFromTasks(task.subTasks) : []]);
1761
- var getTaskIds = (taskGroups) => taskGroups.flatMap(({ tasks }) => getTaskIdsFromTasks(tasks));
1762
- var getProgressSteps = (globalStatus, t) => {
1763
- const basicDetails = t(($) => $["basicDetails"]);
1764
- const additionalDetails = t(($) => $["additionalDetails"]);
1765
- const activation = t(($) => $["activation"]);
1766
- const ready = t(($) => $["ready"]);
1767
- switch (globalStatus) {
1768
- case "ACTIVATION": return [
1769
- {
1770
- name: basicDetails,
1771
- progress: 100
1772
- },
1773
- {
1774
- name: additionalDetails,
1775
- progress: 100,
1776
- flex: 2
1777
- },
1778
- {
1779
- name: activation,
1780
- progress: 0
1781
- },
1782
- {
1783
- name: ready,
1784
- progress: 0
1785
- }
1786
- ];
1787
- case "READY": return [
1788
- {
1789
- name: basicDetails,
1790
- progress: 100
1791
- },
1792
- {
1793
- name: additionalDetails,
1794
- progress: 100,
1795
- flex: 2
1796
- },
1797
- {
1798
- name: activation,
1799
- progress: 100
1800
- },
1801
- {
1802
- name: ready,
1803
- progress: 100
1804
- }
1805
- ];
1806
- default: return [
1807
- {
1808
- name: basicDetails,
1809
- progress: 100
1810
- },
1811
- {
1812
- name: additionalDetails,
1813
- progress: 0,
1814
- flex: 2
1815
- },
1816
- {
1817
- name: activation,
1818
- progress: 0
1819
- },
1820
- {
1821
- name: ready,
1822
- progress: 0
1823
- }
1824
- ];
1825
- }
1826
- };
1827
- /**
1828
- * Main home page for Adaptive Onboarding Workflow
1829
- */
1830
- var AdaptiveWorkflow = ({ uiManifest, onBack }) => {
1831
- const { refetch: refetchWorkflowManifest } = useAdaptiveWorkflow();
1832
- const { entity, globals, globalStatus, taskGroups } = uiManifest;
1833
- const { t } = useTranslation("adaptive");
1834
- const { t: commonT } = useTranslation("common");
1835
- const { setGlobals, setEntity, taskStatuses, setTaskStatuses } = useWorkflowContext();
1836
- const allTasksCompleted = useComputed(() => {
1837
- return Object.values(taskStatuses.value).every((status) => status === TaskStatuses.FINISHED);
1838
- });
1839
- useEffect$1(() => {
1840
- setGlobals(globals || {});
1841
- setEntity(entity || {});
1842
- if (taskGroups) setTaskStatuses(Object.fromEntries(getTaskIds(taskGroups).map((id) => [id, TaskStatuses.DETAILS_REQUIRED])));
1843
- }, [
1844
- globals,
1845
- entity,
1846
- taskGroups,
1847
- setGlobals,
1848
- setEntity,
1849
- setTaskStatuses
1850
- ]);
1851
- const showWorkflowEndState = STATUSES_WITH_WORKFLOW_END_STATE.has(globalStatus);
1852
- const handleSubmit = () => {
1853
- refetchWorkflowManifest();
1854
- };
1855
- const handleBack = () => {
1856
- onBack?.();
1857
- };
1858
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
1859
- className: AdaptiveWorkflow_module_default.adaptiveWorkflowHeader,
1860
- children: /* @__PURE__ */ jsx(AdaptiveProgressBar, {
1861
- steps: getProgressSteps(globalStatus, t),
1862
- ariaLabel: t(($) => $["onboardingProgress"])
1863
- })
1864
- }), showWorkflowEndState ? /* @__PURE__ */ jsx(WorkflowEndState, {
1865
- status: globalStatus,
1866
- handleBack
1867
- }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
1868
- className: AdaptiveWorkflow_module_default.adaptiveWorkflowMain,
1869
- children: [
1870
- /* @__PURE__ */ jsx(WorkflowHeading, { globalStatus }),
1871
- /* @__PURE__ */ jsx("div", {
1872
- className: AdaptiveWorkflow_module_default.adaptiveWorkflowDivider,
1873
- children: /* @__PURE__ */ jsx(Divider, {})
1874
- }),
1875
- taskGroups && /* @__PURE__ */ jsx(TaskGroupParser, { taskGroups })
1876
- ]
1877
- }), /* @__PURE__ */ jsx("div", {
1878
- className: AdaptiveWorkflow_module_default.adaptiveWorkflowActions,
1879
- children: /* @__PURE__ */ jsxs(StackLayout, {
1880
- gap: "small",
1881
- children: [/* @__PURE__ */ jsx(Button, {
1882
- onClick: handleSubmit,
1883
- fullWidth: true,
1884
- disabled: !allTasksCompleted.value,
1885
- children: commonT(($) => $["submit"])
1886
- }), onBack && /* @__PURE__ */ jsx(Button, {
1887
- variant: "tertiary",
1888
- onClick: handleBack,
1889
- fullWidth: true,
1890
- children: commonT(($) => $["back"])
1891
- })]
1892
- })
1893
- })] })] });
1894
- };
1895
- //#endregion
1896
- export { AdaptiveWorkflow, useAdaptiveWorkflow as n, WorkflowContext as t };