@adyen/kyc-components 3.91.0 → 3.92.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 (337) hide show
  1. package/dist/{4-people-BzyXLUF9.js → 4-people-BtDi7O9A.js} +2 -2
  2. package/dist/{AcceptTermsOfServiceComponent-Bl8Skw0p.js → AcceptTermsOfServiceComponent-T7eWi57Z.js} +17 -14
  3. package/dist/{Accordion-BxBwztLx.js → Accordion-Boa_Vira.js} +2 -2
  4. package/dist/{AccountSetupRejected-DWnI467S.js → AccountSetupRejected-LAVhMMBt.js} +4 -4
  5. package/dist/{ActionBar-BI8EL50o.js → ActionBar-CK8dwgSJ.js} +1 -1
  6. package/dist/{Address-BUrDDnmR.js → Address-ki-bCjUJ.js} +23 -289
  7. package/dist/{Alert-B83aFhFn.js → Alert-TCEgDc2-.js} +3 -3
  8. package/dist/{Avatar-CWGv3_UH.js → Avatar-AC-D1DKh.js} +2 -2
  9. package/dist/{BusinessFinancingComponent-Dp9pkrSs.js → BusinessFinancingComponent-Cf-EEnyR.js} +6 -6
  10. package/dist/{BusinessFinancingDropin-CxDQONVa.js → BusinessFinancingDropin-DeLlYaOF.js} +30 -22
  11. package/dist/{BusinessFinancingPage-CK4iko3V.js → BusinessFinancingPage-DtX8x3Zp.js} +4 -4
  12. package/dist/{BusinessTypeSelectionPage-BbCt3hSM.js → BusinessTypeSelectionPage-6Ltt53Mu.js} +58 -33
  13. package/dist/{Card-CQrP0PXC.js → Card-Det7uTiv.js} +2 -2
  14. package/dist/{debouncedInputEvent-CFFx_oML.js → Checkbox-D8rB6_HN.js} +3 -38
  15. package/dist/Confirm-Ctfqp-1b.js +64 -0
  16. package/dist/ConstitutionalDocument-TJAc9nDQ.js +2358 -0
  17. package/dist/ContextGuidance-CCknw_Y1.js +34 -0
  18. package/dist/CountryField-DzmOWqiE.js +66 -0
  19. package/dist/{CreateIndividualComponent-B6ecxCd8.js → CreateIndividualComponent-_H34wdze.js} +6 -6
  20. package/dist/{CreateTransferInstrumentComponent-Chqddjgy.js → CreateTransferInstrumentComponent-CmnVEFaB.js} +5 -12
  21. package/dist/{Currency-CkQVLmOQ.js → Currency-C2egEHMF.js} +64 -8
  22. package/dist/{CustomerSupport-BDynvVnl.js → CustomerSupport-DLfbNC-J.js} +12 -10
  23. package/dist/{DebugModal-DAu7rz8a.js → DebugModal-C0uG_A8N.js} +8 -7
  24. package/dist/{DecisionMakerDetailsPage-BBqNmh_M.js → DecisionMakerDetailsPage-BTR-hRwO.js} +6 -6
  25. package/dist/{DecisionMakers-Ddvw0N__.js → DecisionMakers-B4qQ3M6Y.js} +27 -21
  26. package/dist/Dropzone-CKT3THCY.js +218 -0
  27. package/dist/{EmbeddedStatus-BSK268B-.js → EmbeddedStatus-Bst5MPzi.js} +3 -3
  28. package/dist/{EndStateLayout-B8KmFejY.js → EndStateLayout-Ck_Lvgng.js} +2 -2
  29. package/dist/{EntityAssociation-DBPiXzNF.js → EntityAssociation-bcF_I_DK.js} +8 -8
  30. package/dist/{EntityGuidanceStatus-QEzHcb28.js → EntityGuidanceStatus-D6VoRE_0.js} +4 -3
  31. package/dist/ErrorPanel-CFN2G9Vz.js +190 -0
  32. package/dist/Field-B3Vy1-QZ.js +142 -0
  33. package/dist/{FormNavigation-DLJbUsy3.js → FormNavigation-Brw-75s0.js} +3 -3
  34. package/dist/{FormWrapper-41qnDF4W.js → FormWrapper-BcNyCMkD.js} +10 -10
  35. package/dist/Header-YafgG5Nz.js +83 -0
  36. package/dist/Image-Cvb4hnru.js +44 -0
  37. package/dist/{IndividualOnfido-pGSPtITh.js → IndividualOnfidoDropin-Dy5obHs1.js} +3833 -5548
  38. package/dist/InputDate-UCHQ3zOB.js +43 -0
  39. package/dist/InputGroup-WBfGDV5F.js +32 -0
  40. package/dist/InputText-DGKAS6ZI.js +134 -0
  41. package/dist/{Introduction-DaRfsN8P.js → Introduction-DOxSVZ6X.js} +4 -4
  42. package/dist/{JpAddress-BrtEV6zM.js → JpAddress-DClXaVjy.js} +22 -10
  43. package/dist/LandingLayout-co7NR2te.js +60 -0
  44. package/dist/{LegalRepresentativeDetailsPage-XcmRRT7P.js → LegalRepresentativeDetailsPage-DOP3L2r9.js} +4 -4
  45. package/dist/Link-DWTJ55UO.js +35 -0
  46. package/dist/List-BAzyC6sw.js +83 -0
  47. package/dist/{ListItem-DlRGqcSA.js → ListItem-B8D-kUHN.js} +3 -3
  48. package/dist/LoaderWrapper-CUz5NRFr.js +42 -0
  49. package/dist/{ManageIndividualComponent-BpzsaZ1O.js → ManageIndividualComponent-DND7vuna.js} +5 -5
  50. package/dist/{ManageTermsOfServiceComponent-D9i2HO5I.js → ManageTermsOfServiceComponent-ylDupO1E.js} +5 -5
  51. package/dist/{ManageTransferInstrumentComponent-C6LYppym.js → ManageTransferInstrumentComponent-CgUfGP5E.js} +16 -13
  52. package/dist/{Spacer-w89ksCbG.js → MaskedInput-Cn0VAuEp.js} +17 -631
  53. package/dist/{MaybeModal-DW5SxNsJ.js → MaybeModal-CWCEHeOg.js} +3 -3
  54. package/dist/{Modal-B4wxf7HK.js → Modal-pyBUluei.js} +2 -2
  55. package/dist/OnboardingDropinComponent-DwKImil4.js +2306 -0
  56. package/dist/{PayoutDetailsDropin-BKXxBApD.js → PayoutDetailsDropin-lYVb5WCQ.js} +105 -76
  57. package/dist/Radio-BMtxBpnn.js +39 -0
  58. package/dist/RadioGroup-DPc8nUuk.js +98 -0
  59. package/dist/RadioGroupCard-Pj9qq4uW.js +150 -0
  60. package/dist/{Review-DSdM3vGX.js → Review-gkTjl3a8.js} +7 -7
  61. package/dist/{RootBusinessDetailsPage-CqpiMFn9.js → RootBusinessDetailsPage-DjwEzuLA.js} +5 -5
  62. package/dist/{RootBusinessLinesPage-DUIp_zfH.js → RootBusinessLinesPage-2-U3mf6i.js} +104 -50
  63. package/dist/{RootIndividualDetailsPage-BpTbnRMJ.js → RootIndividualDetailsPage-BFYP63_i.js} +6 -6
  64. package/dist/{useForm-_Kjd_HFb.js → Select-D1rFT3T8.js} +10 -775
  65. package/dist/{SignPCIComponent-B-nJZ1cD.js → SignPCIComponent-DqElmjjG.js} +13 -11
  66. package/dist/{SingpassSelection-D7wRmaLb.js → SingpassSelection-eruroIiQ.js} +9 -7
  67. package/dist/{SoleProprietorshipPage-DUVjo6fc.js → SoleProprietorshipPage-7YdzA7iH.js} +4 -4
  68. package/dist/{SourceOfFundsPage-CFDBqD8v.js → SourceOfFundsPage-C_wiSoc4.js} +39 -26
  69. package/dist/Spacer-BK3jDget.js +18 -0
  70. package/dist/{StepProgressIndicator-BvU4jA3I.js → StepProgressIndicator-DLoEzGro.js} +1 -1
  71. package/dist/{StoreProvider-CyzNf7KK.js → StoreProvider-D9IR5HNN.js} +331 -222
  72. package/dist/StructuredList-9dnJRdx_.js +61 -0
  73. package/dist/{Summary-QyNHKBjO.js → Summary-Bq94iVfc.js} +10 -5
  74. package/dist/{InputText-DLAmX8CW.js → TaskVerificationStatus-BLCkXEn6.js} +3 -123
  75. package/dist/TaxInformationField-c-ZWfhUk.js +3134 -0
  76. package/dist/{TaxReportingDropin-Bn2xYbVw.js → TaxReportingDropin-ajO0q4eZ.js} +20 -17
  77. package/dist/TextArea-D9eJloeE.js +103 -0
  78. package/dist/TileGroup-CaY3i_T7.js +203 -0
  79. package/dist/{TrustDetailsPage-D0sr6zMt.js → TrustDetailsPage-BWXZX4-u.js} +40 -27
  80. package/dist/{TrustMemberCompanyPage-4sIP-M16.js → TrustMemberCompanyPage-CJj2BpXu.js} +5 -5
  81. package/dist/{TrustMemberIndividualPage-CelIjIAw.js → TrustMemberIndividualPage-BXp9RXDw.js} +4 -4
  82. package/dist/{TrustMemberRoleAndTypePage-C3CRy717.js → TrustMemberRoleAndTypePage-gYJ5U6RH.js} +24 -14
  83. package/dist/{TrustMembersOverview-HrRgAsno.js → TrustMembersOverview-Chmnt5jS.js} +13 -12
  84. package/dist/{UnincorporatedPartnershipIndividualPage-Dre5_Nuk.js → UnincorporatedPartnershipIndividualPage-DckUiPPY.js} +4 -4
  85. package/dist/{UnincorporatedPartnershipMemberCompanyPage-woQiy94h.js → UnincorporatedPartnershipMemberCompanyPage-Bx0A5Bit.js} +5 -5
  86. package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-DrirgJXY.js → UnincorporatedPartnershipMemberRoleAndTypePage-CEE1hzIn.js} +23 -16
  87. package/dist/{UnincorporatedPartnershipMembersOverview-BBiRqJkR.js → UnincorporatedPartnershipMembersOverview-wB8K9r6g.js} +10 -9
  88. package/dist/{VerificationErrorAlert-B_ovSmUS.js → VerificationErrorAlert-DZ5OOTBN.js} +4 -4
  89. package/dist/{ViewVerificationStatusComponent-CDQk4Nxa.js → ViewVerificationStatusComponent-BVY4YUJf.js} +4 -4
  90. package/dist/adyen-business-financing.js +3 -3
  91. package/dist/adyen-individual-configuration.js +3 -3
  92. package/dist/adyen-individual-status.js +3 -3
  93. package/dist/adyen-kyc-components.js +21 -20
  94. package/dist/adyen-onboarding.js +3 -3
  95. package/dist/adyen-terms-of-service-management.js +3 -3
  96. package/dist/adyen-terms-of-service-status.js +3 -3
  97. package/dist/adyen-transfer-instrument-configuration.js +3 -3
  98. package/dist/adyen-transfer-instrument-management.js +3 -3
  99. package/dist/adyen-verification-status.js +3 -3
  100. package/dist/{arrow-right-KxA3SvQj.js → arrow-right-BoqwUH_d.js} +2 -2
  101. package/dist/bafinUtils-Wct4TWLH.js +149 -0
  102. package/dist/{bag-BPumznWh.js → bag-BXVWLrwo.js} +2 -2
  103. package/dist/{bank-D6FiNBhs.js → bank-1GvaHPAZ.js} +2 -2
  104. package/dist/{bin-Bz6KOIeE.js → bin-Ba-3ll8T.js} +2 -2
  105. package/dist/{business-lines-DboUCbXw.js → business-lines-BAqTbnBw.js} +2 -2
  106. package/dist/{capital-GVQ3svwN.js → capital-9TKHySO7.js} +2 -2
  107. package/dist/{cash-stack-D9AoDDwt.js → cash-stack-DwYu4xNy.js} +2 -2
  108. package/dist/{certificate-CdEWgHQf.js → certificate-N2YFedpI.js} +2 -2
  109. package/dist/{checkmark-Q7x6tGhy.js → checkmark-D9dGhGpG.js} +2 -2
  110. package/dist/{checkmark-circle-x7dzbp3I.js → checkmark-circle-CFWClLQ6.js} +2 -2
  111. package/dist/{checkmark-circle-fill-CsvN5_PL.js → checkmark-circle-fill-DEB-tuGl.js} +2 -2
  112. package/dist/{checkmark-small-D35myntq.js → checkmark-small-D3VNx2lo.js} +2 -2
  113. package/dist/{chevron-down-C2iDorpW.js → chevron-down-C7SUSYfl.js} +2 -2
  114. package/dist/{chevron-left-ztPO84q-.js → chevron-left-BXmd-S46.js} +2 -2
  115. package/dist/{chevron-right-C_JN0oDt.js → chevron-right-jE6RwM2B.js} +2 -2
  116. package/dist/{chevron-up-CgG8n25g.js → chevron-up-BdfNcqzq.js} +2 -2
  117. package/dist/{circle-Bt3Nlr3q.js → circle-BJPTMCWB.js} +2 -2
  118. package/dist/{circle-small-filled-YMzP6yQU.js → circle-small-filled-BuO8Vg8j.js} +2 -2
  119. package/dist/{clock-BZHremOA.js → clock-DAzaBRWk.js} +2 -2
  120. package/dist/{coins-fkAk6dCo.js → coins-DYdzG5e_.js} +2 -2
  121. package/dist/commonValidators-DcFd5CHs.js +24 -0
  122. package/dist/{contract-BTa4HltT.js → contract-BfJb1t6M.js} +2 -2
  123. package/dist/{cross-Cn09MtQ_.js → cross-CDS_eot4.js} +2 -2
  124. package/dist/{cross-circle-fill-maan7Z5S.js → cross-circle-fill-C-EJ57Yn.js} +2 -2
  125. package/dist/{cross-circle-fill-small-DCz52AuN.js → cross-circle-fill-small-DkPjsuBH.js} +2 -2
  126. package/dist/currency-CrdnaaDu.js +35 -0
  127. package/dist/datasetUtil-BHQp0-xL.js +58 -0
  128. package/dist/debouncedInputEvent-Cv2S512Y.js +46 -0
  129. package/dist/{decision-makers-group-CgddXgrx.js → decision-makers-group-DrvpnEqj.js} +2 -2
  130. package/dist/{digital-wallet-D_IpxnkN.js → digital-wallet-Bx5YM1LY.js} +2 -2
  131. package/dist/{document-1-C08ut-Dt.js → document-1-qlSTF558.js} +2 -2
  132. package/dist/{document-blurred-2Zpodj3_.js → document-blurred-BiWap0xs.js} +2 -2
  133. package/dist/{document-cut-off-ClS7RiOp.js → document-cut-off-aQezqOif.js} +2 -2
  134. package/dist/{document-expired-CjksBq-N.js → document-expired-BhBXaWWQ.js} +2 -2
  135. package/dist/{document-front-DiAairT3.js → document-front-DYuhZGeQ.js} +2 -2
  136. package/dist/{document-person-vxlA6C5f.js → document-person-CDbnTOdV.js} +2 -2
  137. package/dist/{download-Drhk9k1f.js → download-BZQB1WkZ.js} +2 -2
  138. package/dist/{dropinUtils-DCWhMKpQ.js → dropinUtils-BpJn607e.js} +4 -4
  139. package/dist/{edit-1-CFoDTMvQ.js → edit-1-DAqtnOIx.js} +2 -2
  140. package/dist/{en-US-BzrLvydZ.js → en-US-CjjPhkB5.js} +2 -2
  141. package/dist/{external-link-DCMYUMfW.js → external-link-Cg6pJaSJ.js} +2 -2
  142. package/dist/fieldConfig-BPwb1GHc.js +134 -0
  143. package/dist/fieldConfigurations-BUT9DTUH.js +21 -0
  144. package/dist/form-rules-DhbF2mY4.js +13 -0
  145. package/dist/formUtils-BlVlgetw.js +137 -0
  146. package/dist/{funds-in-D8bj0aoE.js → funds-in-CInoUdmG.js} +2 -2
  147. package/dist/{getName-l7X1ZGKx.js → getName-CzpJ9tV7.js} +2 -2
  148. package/dist/getProps-CLJfvUMb.js +156 -0
  149. package/dist/{gift-CQ_DEma7.js → gift-omNInZeB.js} +2 -2
  150. package/dist/{graph-BJmqglH2.js → graph-DunG_uu1.js} +2 -2
  151. package/dist/{graph-up-Bq6adtlX.js → graph-up-BZze4i6m.js} +2 -2
  152. package/dist/{hasDataChanged-BXawTZla.js → hasDataChanged-8e8x8zjz.js} +2 -2
  153. package/dist/{headquarter-DNYyuuFq.js → headquarter-BhpSibFO.js} +2 -2
  154. package/dist/{hotel-BuNql78Z.js → hotel-Cp7VgGCJ.js} +2 -2
  155. package/dist/{house-B6sNRj-B.js → house-BhyBQdR3.js} +2 -2
  156. package/dist/{id-blurred-9dzBOWCE.js → id-blurred-B5lHEP8M.js} +2 -2
  157. package/dist/{id-cut-off-CohJCI2h.js → id-cut-off-Ba1FRzKO.js} +2 -2
  158. package/dist/{id-front-CSZfvdRg.js → id-front-CpNWN6nG.js} +2 -2
  159. package/dist/{id-glare-Q2JWo5ts.js → id-glare-DgCQON8k.js} +2 -2
  160. package/dist/{id-verification-instant-BUVBO4R3.js → id-verification-instant-Byt4Oul6.js} +2 -2
  161. package/dist/{id-verification-manual-B3YZALYU.js → id-verification-manual-CvcTkOSY.js} +2 -2
  162. package/dist/{iframeWidget-CbtmWmoO.js → iframeWidget-D6BlBF0m.js} +4 -4
  163. package/dist/{image-BSihO8lR.js → image-CmB0ioUM.js} +2 -2
  164. package/dist/{info-vHTZWoJ7.js → info-Bb_-xIEK.js} +2 -2
  165. package/dist/{info-filled-SQotHmT9.js → info-filled-CK8LB339.js} +2 -2
  166. package/dist/{instant-verification-Dvvkyfmp.js → instant-verification-UrnuHTYn.js} +2 -2
  167. package/dist/isEmpty-CsYVgjoD.js +23 -0
  168. package/dist/japanSupportUtils-iATUjnbf.js +17 -0
  169. package/dist/jpAddressSchema-De6ix57p.js +28 -0
  170. package/dist/{localizeDateString-BX5t59Ip.js → localizeDateString-BHDr1NID.js} +2 -2
  171. package/dist/{location-Q4oKvnkl.js → location-itJfxrDQ.js} +2 -2
  172. package/dist/{mail-BOdyoVqB.js → mail-VHTlAusn.js} +2 -2
  173. package/dist/makeSelectItemForRole-Bm2NwBxD.js +133 -0
  174. package/dist/{manual-verification-BvZWqA00.js → manual-verification-BO8zgAYT.js} +2 -2
  175. package/dist/{mapExistingFile-Bd7nsoK8.js → mapExistingFile-DNBa6Ekj.js} +80 -5
  176. package/dist/mapJpAddressSchemaToAddressLocalizations-BNb8d51F.js +147 -0
  177. package/dist/{mapLegalEntityToIndividualOnfidoSchema-CQF6zsO7.js → mapLegalEntityToIndividualOnfidoSchema-DREgz5Ms.js} +63 -3
  178. package/dist/{mapTransferInstrumentToPayoutAccount-CacHlKHM.js → mapTransferInstrumentToPayoutAccount-C5NqOfNW.js} +2 -2
  179. package/dist/{minus-circle-filled-kC2IUvKz.js → minus-circle-filled-ZhtJ0GD3.js} +2 -2
  180. package/dist/{onfido-logo-BWSv__sQ.js → onfido-logo-BSkKPH10.js} +2 -2
  181. package/dist/{options-horizontal-CBmbNv7R.js → options-horizontal-GuXvLvV3.js} +2 -2
  182. package/dist/{partner-CPjsrePY.js → partner-QD27Vy4w.js} +2 -2
  183. package/dist/{passport-blurred-B4UDQfmc.js → passport-blurred-CVG493IJ.js} +2 -2
  184. package/dist/{passport-cut-off-C0N2mgLk.js → passport-cut-off-COzA_TmB.js} +2 -2
  185. package/dist/{passport-front-BwA7wR91.js → passport-front-WJleLixT.js} +2 -2
  186. package/dist/{passport-front-green-BL4HmtsB.js → passport-front-green-CZVkCa1n.js} +2 -2
  187. package/dist/{passport-glare-Mg2ixsYA.js → passport-glare-BP5WnJZj.js} +2 -2
  188. package/dist/patternValidators-BXduwLbz.js +83 -0
  189. package/dist/{pay-by-link-plane-BVZndh67.js → pay-by-link-plane-BpY8Q6-B.js} +2 -2
  190. package/dist/{payout-ChUEoLjt.js → payout-DtB68BcZ.js} +2 -2
  191. package/dist/{payout-verification-instant-5u-wvFKv.js → payout-verification-instant-BzpfOQLD.js} +2 -2
  192. package/dist/{payout-verification-manual-BH2mu0UW.js → payout-verification-manual-gNEoeZkV.js} +2 -2
  193. package/dist/{person-DGjUU4S4.js → person-IVZG3t3_.js} +2 -2
  194. package/dist/{plaid-logo-CtActXTN.js → plaid-logo-FsZ7kfL-.js} +2 -2
  195. package/dist/{plus-CWXA5wdX.js → plus-DiALAL8-.js} +2 -2
  196. package/dist/{plus-circle-filled-CbC0u2Y1.js → plus-circle-filled-BzHtTqEN.js} +2 -2
  197. package/dist/{process-field-configurations-BZQqH4-M.js → process-field-configurations-B26ehyAw.js} +3 -3
  198. package/dist/{recurring-CkL4cCM2.js → recurring-DKNs9K3x.js} +2 -2
  199. package/dist/{reporting-DerosUNm.js → reporting-D5ABpLO_.js} +2 -2
  200. package/dist/{resolveEnvironment-C6JtHmZc.js → resolveEnvironment-B5Yrsa4J.js} +3 -3
  201. package/dist/{revenue-accelerate-Dp4Ns_5c.js → revenue-accelerate-D7Sp0V4a.js} +2 -2
  202. package/dist/{review-CxIN9azU.js → review-D4TUjcWF.js} +2 -2
  203. package/dist/roleMetadata-DmgqzhZJ.js +66 -0
  204. package/dist/{rules-ClDW_ZSK.js → rules-B_6RrE9T.js} +6 -5
  205. package/dist/{save-Fgy7EDid.js → save-BfqO2JBI.js} +2 -2
  206. package/dist/{search-C4GZ-Rc1.js → search-Cmzbf5zI.js} +2 -2
  207. package/dist/{show-yPjPmEf8.js → show-IdbU1C6P.js} +2 -2
  208. package/dist/{singpass-logo-BkMSwiGY.js → singpass-logo-wY4xsmTX.js} +2 -2
  209. package/dist/{singpass-verification-instant-hY4eGFwl.js → singpass-verification-instant-JCqTr7Mv.js} +2 -2
  210. package/dist/{singpass-verification-manual-DwhRpy5Q.js → singpass-verification-manual-DQ7XW6R3.js} +2 -2
  211. package/dist/{solution-payments-CNAat9h7.js → solution-payments-DpyE_sdS.js} +2 -2
  212. package/dist/{store-IuAkDRAp.js → store-Btc4GcmU.js} +2 -2
  213. package/dist/style.css +965 -993
  214. package/dist/styles-CLV89_hH.js +965 -993
  215. package/dist/summaryItem-CAQCQSkt.js +18 -0
  216. package/dist/{tax-reporting-graph-DjzwRgE6.js → tax-reporting-graph-hgoilCHZ.js} +2 -2
  217. package/dist/{terminal-1-_me9J9h0.js → terminal-1-D1pwXCoi.js} +2 -2
  218. package/dist/{tink-logo-BcIv93ND.js → tink-logo-DDyjz5eJ.js} +2 -2
  219. package/dist/types/api/businessLines/useCreateBusinessLine.d.ts +1 -1
  220. package/dist/types/api/businessLines/useDeleteBusinessLine.d.ts +1 -1
  221. package/dist/types/api/businessLines/useUpdateBusinessLines.d.ts +1 -1
  222. package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +1 -1
  223. package/dist/types/api/companyDataSet/useClearCompanyData.d.ts +1 -1
  224. package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +1 -1
  225. package/dist/types/api/documentValidation/useDocumentValidate.d.ts +1 -1
  226. package/dist/types/api/documents/useCreateDocument.d.ts +1 -1
  227. package/dist/types/api/documents/useDeleteDocument.d.ts +1 -1
  228. package/dist/types/api/documents/useDocument.d.ts +1 -1
  229. package/dist/types/api/documents/useUpdateDocument.d.ts +1 -1
  230. package/dist/types/api/entityVerifications/useVerifyIdNumber.d.ts +2 -2
  231. package/dist/types/api/idVerificationProviders/idVerificationStartCheck.d.ts +1 -1
  232. package/dist/types/api/idVerificationProviders/useExtractDocumentInformation.d.ts +1 -1
  233. package/dist/types/api/idVerificationProviders/useIdVerificationToken.d.ts +1 -1
  234. package/dist/types/api/legalEntity/useConfirmReview.d.ts +1 -1
  235. package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +1 -1
  236. package/dist/types/api/onboardingStatus/useGenerateOnboardingLink.d.ts +1 -1
  237. package/dist/types/api/pci/useSignPci.d.ts +1 -2
  238. package/dist/types/api/taskStatus/useTaskStatus.d.ts +2 -2
  239. package/dist/types/api/termsOfService/useAcceptTermsOfService.d.ts +1 -1
  240. package/dist/types/api/types.d.ts +2 -1
  241. package/dist/types/api/uiAnalytics/useAnalyticsSession.d.ts +1 -1
  242. package/dist/types/api/uiAnalytics/usePushAnalyticEvent.d.ts +1 -1
  243. package/dist/types/api/validation/useValidateAccountIdentification.d.ts +1 -1
  244. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +0 -1
  245. package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +1 -0
  246. package/dist/types/components/BankAccount/forms/BankVerification/verification/overlay/BankVerificationOverlay.d.ts +1 -1
  247. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +0 -1
  248. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +439 -439
  249. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -1
  250. package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +1 -1
  251. package/dist/types/components/Business/forms/BusinessDetails/form-ids.d.ts +2 -0
  252. package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +1 -0
  253. package/dist/types/components/Business/forms/CompanyStructure/CompanyStructure.d.ts +0 -1
  254. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -1
  255. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -1
  256. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +1 -1
  257. package/dist/types/components/BusinessLines/tasks/types.d.ts +2 -0
  258. package/dist/types/components/BusinessLines/tasks/utils.d.ts +4 -2
  259. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +475 -475
  260. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +1 -2
  261. package/dist/types/components/EFP/tasks/TaxReportingDropin/utils.d.ts +1 -2
  262. package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +1 -1
  263. package/dist/types/components/Individual/forms/Individual/Individual.d.ts +41 -3
  264. package/dist/types/components/Individual/forms/Individual/form-ids.d.ts +2 -0
  265. package/dist/types/components/Individual/forms/Individual/types.d.ts +1 -2
  266. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +1 -0
  267. package/dist/types/components/Individual/forms/IndividualOnfido/form-ids.d.ts +2 -0
  268. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +1 -1
  269. package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
  270. package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
  271. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  272. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +1 -1
  273. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +1 -1
  274. package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +1 -1
  275. package/dist/types/core/user-events.d.ts +1 -0
  276. package/dist/types/language/types.d.ts +7 -2
  277. package/dist/types/language/utils.d.ts +1 -2
  278. package/dist/types/types/assert.d.ts +1 -0
  279. package/dist/types/utils/analytics/debouncedInputEvent.d.ts +1 -0
  280. package/dist/types/utils/analytics/getPrefilledDetails.d.ts +28 -0
  281. package/dist/types/utils/api/processCapabilitites.d.ts +13 -0
  282. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  283. package/dist/types/utils/formUtils.d.ts +1 -2
  284. package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -2
  285. package/dist/types/utils/getName.d.ts +1 -1
  286. package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
  287. package/dist/types/utils/translation.d.ts +3 -2
  288. package/dist/{types-DDnAZYTj.js → types-C6ntGMCy.js} +3 -26
  289. package/dist/{types-DE1uuPfP.js → types-CpAtsPmJ.js} +1 -1
  290. package/dist/{types-hGeLq0SR.js → types-c9nG7Dev.js} +1 -1
  291. package/dist/unincorporated-partnership-MeN1dp53.js +97 -0
  292. package/dist/{upload-BF65P4KM.js → upload-BmUXjsaU.js} +2 -2
  293. package/dist/{us-check-CYY6Crhr.js → us-check-C1rTBsCY.js} +2 -2
  294. package/dist/{us-check-account-number-C7KE5YzX.js → us-check-account-number-9lI1dXNC.js} +2 -2
  295. package/dist/{us-check-routing-number-DUbhsYAR.js → us-check-routing-number-s_KaAGSM.js} +2 -2
  296. package/dist/{useAssociatedLegalEntity-D_Nk_obe.js → useAssociatedLegalEntity-ahBb64MW.js} +2 -2
  297. package/dist/useBusinessDetailsData-qQ2HRnKK.js +5161 -0
  298. package/dist/{useCreateLegalEntity-DT7ue23d.js → useCreateLegalEntity-Kc8_ZlAe.js} +2 -2
  299. package/dist/useDataset-DfKmlbQd.js +74 -0
  300. package/dist/useForm-9uKM-XKf.js +582 -0
  301. package/dist/{FormFlow-BrgeP70A.js → useFormContext-CvQfKDA3.js} +26 -31
  302. package/dist/{useGlobalData-C7tjZfC0.js → useGlobalData-BVQ2OrIi.js} +3 -3
  303. package/dist/useId-BZ0PA7jP.js +24 -0
  304. package/dist/{useMultiForm-DWozxGN4.js → useMultiForm-pAiPIh7X.js} +4 -4
  305. package/dist/{useOnboardingStatus-DBLS6PUq.js → useOnboardingStatus-BhDBSLB6.js} +1 -1
  306. package/dist/{useScenarios-DD06bWNN.js → useScenarios-DFW21Vhf.js} +2 -2
  307. package/dist/{useTermsOfServiceStatus-D2lYSqHn.js → useTermsOfServiceStatus-BnO0rXiL.js} +1 -1
  308. package/dist/{useToastContext-Cbw29cqc.js → useToastContext-D6Lbxqj9.js} +5 -17
  309. package/dist/{useUnincorporatedPartnershipMembers-Dbb2VjkF.js → useUnincorporatedPartnershipMembers-CIC7xPbD.js} +5 -5
  310. package/dist/useUpdateBusinessLines-WlwUOtSU.js +337 -0
  311. package/dist/{useUpdateLegalEntity-Aubxhgvv.js → useUpdateLegalEntity-CStkUt4I.js} +3 -3
  312. package/dist/utils-7_xBiPO_.js +58 -0
  313. package/dist/utils-BmxzrkCX.js +165 -0
  314. package/dist/{utils-D1-D6fui.js → utils-CB39nVjj.js} +6 -6
  315. package/dist/{utils-DenrGsUh.js → utils-CDAwsXQa.js} +4 -4
  316. package/dist/utils-DOiFhaKn.js +29 -0
  317. package/dist/{documentUtils-Be5wlCwo.js → validate-Bsx2oHT1.js} +170 -6
  318. package/dist/{validate-BxVes1el.js → validate-D-l23QLG.js} +2 -2
  319. package/dist/validate-D4iK6FUk.js +385 -0
  320. package/dist/{validationError-DPP91cM3.js → validationError-DYYlX-5X.js} +2 -2
  321. package/dist/{warning-circle-fill-CEN1WL7A.js → warning-circle-fill-DBvt921B.js} +2 -2
  322. package/dist/{warning-diamond-filled-BfXMlVrG.js → warning-diamond-filled-Lb2od2ry.js} +2 -2
  323. package/dist/{webinar-DqjqrNEv.js → webinar-m9nuFZBt.js} +2 -2
  324. package/dist/{yapily-logo-CZ4ywjwA.js → yapily-logo-BduxhNRA.js} +2 -2
  325. package/package.json +6 -6
  326. package/dist/ConstitutionalDocument-DM6M40MP.js +0 -143
  327. package/dist/CountryField-CsKJAI53.js +0 -843
  328. package/dist/IndividualOnfidoDropin-DZEn2Tf8.js +0 -2575
  329. package/dist/OnboardingDropinComponent-Cx-c_p0i.js +0 -7623
  330. package/dist/getFieldsWithExistingData-CfckMyJ1.js +0 -22
  331. package/dist/mapFinancialReportsToFinancialInformation-Bfvt2G87.js +0 -67
  332. package/dist/mapJpAddressSchemaToAddressLocalizations-CWY2lZGD.js +0 -63
  333. package/dist/types/components/Shared/forms/BusinessTypeSelection/EntityTypeRadioGroupCard.d.ts +0 -11
  334. package/dist/useBusinessDetailsData-DG9EJBH_.js +0 -2441
  335. package/dist/useDataset-DCCxYOjr.js +0 -220
  336. package/dist/useUpdateBusinessLines-8bDYsLav.js +0 -46
  337. package/dist/validate-BgMFLdKI.js +0 -41
@@ -0,0 +1,2306 @@
1
+ ;
2
+ {
3
+ try {
4
+ let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8c61f19c-a17e-4ccf-8e10-dc882c7d3325", e._sentryDebugIdIdentifier = "sentry-dbid-8c61f19c-a17e-4ccf-8e10-dc882c7d3325");
6
+ } catch (e) {
7
+ }
8
+ }
9
+ ;
10
+ import { b as useApiContext, j as useQuery, k as httpPost, m as httpGet, o as useSettingsContext, p as useLocalStorage, g as getLegalEntityCountry, C as CountryCodes, q as isPartOfTrustFromLegalEntity, r as LegalEntityTypes, t as hasSolePropInLegalEntity, v as getLegalRepresentative, c as useLegalEntity, w as skipToken, x as doesLegalEntityRequiresLegalRepresentative, u as useTranslation, B as Button, y as Skeleton, z as translateStringOrObject, G as Typography, H as createLogger, J as TaskStatuses, K as hasOwnEntityAssociationOfType, M as isEmptyEntity, N as useAccountHolder, O as EntityTypes, P as DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING, U as TaskTypes, V as useAnalyticsContext, W as Icon, X as IconButton, Y as noop, Z as useExperimentsContext, $ as isInstantVerifiedAccount, a0 as getObscuredAccountNumber, a1 as useGetTaskStatus, R as ROOT_LE, L as Loader, a2 as useGlobalStore, a3 as isPartOfUnincorporatedPartnership, a4 as getOwnSignatories, a5 as getOwnDecisionMakersLegalEntityIds, a6 as getOwnSolePropProblems, a7 as getOwnTrustProblems, a8 as getOwnUnincorporatedPartnershipProblems, a9 as getOwnEntityAssociations, aa as TrustMemberTypes, ab as hasAllCapabilitiesResolved, ac as hasRejectedCapabilities, ad as objectsDeepEqual, a as addResourceBundles, _ as __variableDynamicImportRuntimeHelper } from "./StoreProvider-D9IR5HNN.js";
11
+ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
12
+ import { lazy, Suspense } from "preact/compat";
13
+ import { useMemo, useReducer, useCallback, useEffect, useState, useRef } from "preact/hooks";
14
+ import { S as SettingNames, T as TaskVerificationStatus } from "./TaskVerificationStatus-BLCkXEn6.js";
15
+ import { T as TrustedFieldsProviders, I as Image, u as useCapabilityProblems } from "./Image-Cvb4hnru.js";
16
+ import { g as getTrustedFieldsProvider, C as CompanyTypesValues, h as handleKeys, u as useSetting, i as isBafinSignatoryFlow, s as showIdNowModal } from "./bafinUtils-Wct4TWLH.js";
17
+ import { u as useAssociatedLegalEntity } from "./useAssociatedLegalEntity-ahBb64MW.js";
18
+ import cx from "classnames";
19
+ import { a as Alert } from "./Alert-TCEgDc2-.js";
20
+ import { signal } from "@preact/signals";
21
+ import { u as useTermsOfServiceStatus, a as useTermsOfServiceAcceptanceInfos } from "./useTermsOfServiceStatus-BnO0rXiL.js";
22
+ import { u as useToastContext } from "./useToastContext-D6Lbxqj9.js";
23
+ import { S as StackLayout, U as UnincorporatedPartnershipMemberTypes } from "./unincorporated-partnership-MeN1dp53.js";
24
+ import { C as Card } from "./Card-Det7uTiv.js";
25
+ import { d as downloadFile } from "./file-CiG1D0zy.js";
26
+ import { V as VerificationErrorAlert, u as useDeleteTransferInstrument } from "./VerificationErrorAlert-DZ5OOTBN.js";
27
+ import { A as Avatar } from "./Avatar-AC-D1DKh.js";
28
+ import { L as LoaderWrapper } from "./LoaderWrapper-CUz5NRFr.js";
29
+ import { C as Confirm } from "./Confirm-Ctfqp-1b.js";
30
+ import { g as getLegalEntityNameBasedOnType } from "./getName-CzpJ9tV7.js";
31
+ const getPciStatus = async (legalEntityId, baseUrl, data) => {
32
+ const filteredData = {
33
+ ...data,
34
+ additionalSalesChannels: data.additionalSalesChannels?.filter(
35
+ (channel) => channel !== "payByLink"
36
+ )
37
+ };
38
+ return httpPost(
39
+ {
40
+ baseUrl,
41
+ path: `legalEntities/${legalEntityId}/pci/signingRequired`
42
+ },
43
+ filteredData
44
+ );
45
+ };
46
+ const usePciStatus = (data, options) => {
47
+ const { rootLegalEntityId, baseUrl } = useApiContext();
48
+ return useQuery({
49
+ queryKey: ["pciStatus", data],
50
+ queryFn: () => getPciStatus(rootLegalEntityId.value, baseUrl.value, data),
51
+ staleTime: 0,
52
+ ...options
53
+ });
54
+ };
55
+ const getBusinessLines = async (legalEntityId, baseUrl) => {
56
+ return httpGet({
57
+ baseUrl,
58
+ path: `legalEntities/${legalEntityId}/businessLines`
59
+ });
60
+ };
61
+ const useBusinessLines = (businessLineType, options) => {
62
+ const { rootLegalEntityId, baseUrl } = useApiContext();
63
+ return useQuery({
64
+ queryKey: ["businessLines"],
65
+ queryFn: () => getBusinessLines(rootLegalEntityId.value, baseUrl.value),
66
+ select: (businessLines) => businessLines.filter((businessLine) => businessLineType.includes(businessLine.service)),
67
+ ...options
68
+ });
69
+ };
70
+ function useSalesChannels() {
71
+ const { isSettingEnabled } = useSettingsContext();
72
+ const { data: existingBusinessLines } = useBusinessLines(["paymentProcessing"]);
73
+ return useMemo(() => {
74
+ const settings = [];
75
+ const businessLinesSalesChannels = [
76
+ ...new Set(existingBusinessLines?.flatMap((item) => item.salesChannels ?? []))
77
+ ];
78
+ if (isSettingEnabled(SettingNames.RequirePciSignEcommerce)) {
79
+ settings.push("eCommerce");
80
+ }
81
+ if (isSettingEnabled(SettingNames.RequirePciSignPos)) {
82
+ settings.push("pos");
83
+ }
84
+ if (isSettingEnabled(SettingNames.RequirePciSignEcomMoto)) {
85
+ settings.push("ecomMoto");
86
+ }
87
+ if (isSettingEnabled(SettingNames.RequirePciSignPosMoto)) {
88
+ settings.push("posMoto");
89
+ }
90
+ return isSettingEnabled("allowBusinessLines") ? businessLinesSalesChannels : settings;
91
+ }, [existingBusinessLines, isSettingEnabled]);
92
+ }
93
+ const getTaskTypes = async (id, baseUrl) => {
94
+ return httpGet({
95
+ baseUrl,
96
+ path: `legalEntities/${id}/configurations/tasks`
97
+ });
98
+ };
99
+ const useTaskTypes = (options) => {
100
+ const { rootLegalEntityId, baseUrl } = useApiContext();
101
+ return useQuery({
102
+ queryKey: ["taskTypes"],
103
+ queryFn: () => getTaskTypes(rootLegalEntityId.value, baseUrl.value),
104
+ ...options
105
+ });
106
+ };
107
+ const getHasSeenIntroductionStorageKey = (legalEntityId) => `COMPLETED_INTRO-${legalEntityId}`;
108
+ const useHasSeenIntroduction = ({ legalEntityId }) => {
109
+ const [hasSeenIntroduction, setHasSeenIntroduction] = useLocalStorage(
110
+ getHasSeenIntroductionStorageKey(legalEntityId),
111
+ false
112
+ );
113
+ return { hasSeenIntroduction, setHasSeenIntroduction };
114
+ };
115
+ const getHasSeenSingpassSelectionStorageKey = (legalEntityId) => `COMPLETED_SINGPASS_SELECTION-${legalEntityId}`;
116
+ const useHasSeenSingpassSelection = ({
117
+ legalEntityId
118
+ }) => {
119
+ const [hasSeenSingpassSelection, setHasSeenSingpassSelection] = useLocalStorage(
120
+ getHasSeenSingpassSelectionStorageKey(legalEntityId),
121
+ false
122
+ );
123
+ return { hasSeenSingpassSelection, setHasSeenSingpassSelection };
124
+ };
125
+ async function convertToSingpassLinkResponse(openIdInitiateResponse) {
126
+ const response = await Promise.resolve(openIdInitiateResponse);
127
+ const item = { authUrl: response.authUrl, success: true };
128
+ return { item };
129
+ }
130
+ const useOpenIdAuthorizationLink = (options) => {
131
+ const { rootLegalEntityId, baseUrl } = useApiContext();
132
+ return useQuery({
133
+ queryKey: ["openIdAuthorizationLink"],
134
+ queryFn: () => getOpenIdAuthorizationLink(rootLegalEntityId.value, baseUrl.value),
135
+ ...options
136
+ });
137
+ };
138
+ const getOpenIdAuthorizationLink = async (legalEntityId, baseUrl) => {
139
+ return convertToSingpassLinkResponse(
140
+ httpPost({
141
+ baseUrl,
142
+ path: `/legalEntities/${legalEntityId}/openid/initiate`
143
+ })
144
+ );
145
+ };
146
+ const SingpassMyInfoLoginActionTypes = {
147
+ LOADING: "LOADING",
148
+ SUCCESS: "SUCCESS",
149
+ FAILURE: "FAILURE",
150
+ RESET: "RESET"
151
+ };
152
+ const defaultSingpassState = { isLoading: false, isSuccess: false };
153
+ const singpassReducer = (state, action) => {
154
+ switch (action.type) {
155
+ case SingpassMyInfoLoginActionTypes.LOADING:
156
+ return { ...state, isLoading: true };
157
+ case SingpassMyInfoLoginActionTypes.SUCCESS:
158
+ return { isLoading: false, isSuccess: true };
159
+ case SingpassMyInfoLoginActionTypes.FAILURE:
160
+ return { isLoading: false, isSuccess: false, errorMessage: action.errorMessage };
161
+ case SingpassMyInfoLoginActionTypes.RESET:
162
+ return defaultSingpassState;
163
+ default:
164
+ return state;
165
+ }
166
+ };
167
+ const useSingpassMyInfoLogin = ({
168
+ legalEntity,
169
+ accountHolder
170
+ }) => {
171
+ const existingProvider = getTrustedFieldsProvider(legalEntity);
172
+ const defaultState = {
173
+ isLoading: false,
174
+ isSuccess: existingProvider === TrustedFieldsProviders.SINGPASS
175
+ };
176
+ const [state, dispatch] = useReducer(
177
+ singpassReducer,
178
+ defaultState
179
+ );
180
+ const { refetch: fetchOpenIdAuthorizationLink } = useOpenIdAuthorizationLink({ enabled: false });
181
+ const isEligibleForSingpass = useMemo(() => {
182
+ if (!legalEntity) {
183
+ return false;
184
+ }
185
+ if (getLegalEntityCountry(legalEntity) !== CountryCodes.Singapore) {
186
+ return false;
187
+ }
188
+ if (accountHolder) {
189
+ return accountHolder === "theCompanyIWorkFor" || accountHolder === "myName";
190
+ }
191
+ const legalEntityType = legalEntity.type;
192
+ const isPartOfTrust = isPartOfTrustFromLegalEntity(legalEntity);
193
+ const isVanillaOrganization = legalEntityType === LegalEntityTypes.ORGANIZATION && !isPartOfTrust;
194
+ const hasSoleProprietor = hasSolePropInLegalEntity(legalEntity);
195
+ const isVanillaIndividual = legalEntityType === LegalEntityTypes.INDIVIDUAL && !hasSoleProprietor;
196
+ return isVanillaOrganization || isVanillaIndividual;
197
+ }, [legalEntity, accountHolder]);
198
+ const handleInitiateSingpassMyInfoLogin = async () => {
199
+ dispatch({ ...state, type: SingpassMyInfoLoginActionTypes.LOADING });
200
+ const { data } = await fetchOpenIdAuthorizationLink();
201
+ return data?.item.authUrl;
202
+ };
203
+ const handleSingpassMyInfoLoginSuccess = () => {
204
+ dispatch({ ...state, type: SingpassMyInfoLoginActionTypes.SUCCESS });
205
+ };
206
+ const handleSingpassMyInfoLoginFailure = (errorMessage) => {
207
+ dispatch({ ...state, errorMessage, type: SingpassMyInfoLoginActionTypes.FAILURE });
208
+ };
209
+ const handleSingpassMyInfoLoginReset = () => {
210
+ dispatch({ ...state, type: SingpassMyInfoLoginActionTypes.RESET });
211
+ };
212
+ return {
213
+ isEligibleForSingpass,
214
+ state,
215
+ handleInitiateSingpassMyInfoLogin,
216
+ handleSingpassMyInfoLoginSuccess,
217
+ handleSingpassMyInfoLoginFailure,
218
+ handleSingpassMyInfoLoginReset
219
+ };
220
+ };
221
+ const useAssociatedLegalRepresentative = (legalEntity) => {
222
+ const matchingAssociation = useMemo(() => {
223
+ if (!legalEntity) return void 0;
224
+ return getLegalRepresentative(legalEntity);
225
+ }, [legalEntity]);
226
+ const { data } = useLegalEntity(
227
+ doesLegalEntityRequiresLegalRepresentative(legalEntity) && matchingAssociation?.legalEntityId ? matchingAssociation.legalEntityId : skipToken
228
+ );
229
+ return data;
230
+ };
231
+ const getCanSeeEntitySelectionStorageKey = (legalEntityId) => `ENTITY_SELECTION_SEEN-${legalEntityId}`;
232
+ const useCanSeeEntitySelection = (legalEntityId) => {
233
+ const [canSeeEntitySelectionFromLocalStorage, setCanSeeEntitySelectionIntoLocalStorage] = useLocalStorage(getCanSeeEntitySelectionStorageKey(legalEntityId), true);
234
+ return {
235
+ canSeeEntitySelection: canSeeEntitySelectionFromLocalStorage,
236
+ setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
237
+ };
238
+ };
239
+ const providerButton = "adyen-kyc-provider-button";
240
+ const providerButtonDisplayName = "adyen-kyc-provider-button-display-name";
241
+ const styles = {
242
+ providerButton,
243
+ providerButtonDisplayName
244
+ };
245
+ const singpassLogo = lazy(
246
+ () => import("./singpass-logo-wY4xsmTX.js")
247
+ );
248
+ const ProviderButton = ({ provider, onClick }) => {
249
+ const { t } = useTranslation("ui");
250
+ const providerDisplayName = {
251
+ singpassMyInfo: "Singpass",
252
+ singpassMyInfoBusiness: "Singpass"
253
+ };
254
+ const buttonLabel = {
255
+ singpassMyInfo: t(($) => $["retrieveMyinfo"]),
256
+ singpassMyInfoBusiness: t(($) => $["retrieveMyinfoBusiness"])
257
+ };
258
+ return /* @__PURE__ */ jsx(Button, { onClick, fullWidth: true, variant: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles.providerButton, children: [
259
+ buttonLabel[provider],
260
+ /* @__PURE__ */ jsx("span", { className: styles.providerButtonDisplayName, children: providerDisplayName[provider] }),
261
+ /* @__PURE__ */ jsx(Image, { lazyLoadedImage: singpassLogo })
262
+ ] }) });
263
+ };
264
+ const legalEntityTypeToSubtitleTranslationKey = {
265
+ [LegalEntityTypes.INDIVIDUAL]: "myInfoYouCanGetVerifiedDetails",
266
+ [LegalEntityTypes.ORGANIZATION]: "myInfoBusinessYouCanGetVerifiedDetails"
267
+ };
268
+ const legalEntityTypeToProviderButtonKey = {
269
+ [LegalEntityTypes.INDIVIDUAL]: "singpassMyInfo",
270
+ [LegalEntityTypes.ORGANIZATION]: "singpassMyInfoBusiness"
271
+ };
272
+ const successAlertTitleText = {
273
+ [LegalEntityTypes.INDIVIDUAL]: "myinfoDetailsRetrieved",
274
+ [LegalEntityTypes.ORGANIZATION]: "myinfoBusinessDetailsRetrieved"
275
+ };
276
+ const successAlertContentText = {
277
+ [LegalEntityTypes.INDIVIDUAL]: "yourDetailsArePreFilledInTheRelevantSections",
278
+ [LegalEntityTypes.ORGANIZATION]: "yourBusinesssDetailsArePreFilledInTheRelevantSections"
279
+ };
280
+ const SingpassBanner = ({
281
+ isLoading,
282
+ isSuccess,
283
+ errorMessage,
284
+ onClick,
285
+ onAlertClose,
286
+ onMessage,
287
+ legalEntityType
288
+ }) => {
289
+ const { t } = useTranslation("common");
290
+ const { baseUrl, rootLegalEntityId } = useApiContext();
291
+ const singpassEventListener = useCallback(
292
+ (event) => {
293
+ if (event.origin !== new URL(baseUrl.value).origin) return;
294
+ if (event.data.legalEntityReference !== rootLegalEntityId.value) return;
295
+ onMessage({ data: { isSuccessful: event.data.isSuccessful } });
296
+ },
297
+ [baseUrl.value, rootLegalEntityId.value, onMessage]
298
+ );
299
+ useEffect(() => {
300
+ window.addEventListener("message", singpassEventListener);
301
+ return () => window.removeEventListener("message", singpassEventListener);
302
+ }, [singpassEventListener]);
303
+ if (isLoading) {
304
+ return /* @__PURE__ */ jsx(Skeleton, {});
305
+ }
306
+ if (isSuccess) {
307
+ const successTitleText = successAlertTitleText[legalEntityType];
308
+ const successContentText = successAlertContentText[legalEntityType];
309
+ return /* @__PURE__ */ jsx(
310
+ Alert,
311
+ {
312
+ variant: "success",
313
+ title: successTitleText && t(($) => $[successTitleText]),
314
+ onClose: onAlertClose,
315
+ children: successContentText && t(($) => $[successContentText])
316
+ }
317
+ );
318
+ }
319
+ const providerName = legalEntityTypeToProviderButtonKey[legalEntityType];
320
+ if (errorMessage) {
321
+ return /* @__PURE__ */ jsx(
322
+ Alert,
323
+ {
324
+ variant: "warning",
325
+ title: translateStringOrObject(t, errorMessage),
326
+ onClose: onAlertClose,
327
+ children: /* @__PURE__ */ jsxs(Typography, { variant: "body", children: [
328
+ t(($) => $["tryAgainOrContinueEnteringTheDetailsYourself"]),
329
+ providerName && /* @__PURE__ */ jsx(ProviderButton, { provider: providerName, onClick })
330
+ ] })
331
+ }
332
+ );
333
+ }
334
+ const subtitleTranslationKey = legalEntityTypeToSubtitleTranslationKey[legalEntityType];
335
+ return /* @__PURE__ */ jsxs(
336
+ Alert,
337
+ {
338
+ className: cx("adyen-task-list-singpass-banner"),
339
+ icon: false,
340
+ title: t(($) => $["getSetUpInstantly"]),
341
+ children: [
342
+ subtitleTranslationKey && /* @__PURE__ */ jsx("div", { className: cx("adyen-task-list-singpass-banner__subtitle"), children: t(($) => $[subtitleTranslationKey]) }),
343
+ providerName && /* @__PURE__ */ jsx(ProviderButton, { provider: providerName, onClick })
344
+ ]
345
+ }
346
+ );
347
+ };
348
+ const getPciQuestionnaire = async (legalEntityId, baseUrl, documentId) => {
349
+ return httpGet({
350
+ baseUrl,
351
+ path: `legalEntities/${legalEntityId}/pci/questionnaires/${documentId}`
352
+ });
353
+ };
354
+ const getPciQuestionnaireList = async (legalEntityId, baseUrl) => {
355
+ return httpGet({
356
+ baseUrl,
357
+ path: `legalEntities/${legalEntityId}/pci/questionnaires`
358
+ });
359
+ };
360
+ const usePciQuestionnaireList = (options) => {
361
+ const { rootLegalEntityId, baseUrl } = useApiContext();
362
+ return useQuery({
363
+ queryKey: ["pciQuestionnaireList"],
364
+ queryFn: () => getPciQuestionnaireList(rootLegalEntityId.value, baseUrl.value),
365
+ ...options
366
+ });
367
+ };
368
+ const logger$1 = createLogger();
369
+ const normalizeTaskStatuses = (taskStatuses) => {
370
+ return taskStatuses?.statuses?.reduce((acc, currentTask) => {
371
+ const status = TaskStatuses[currentTask.status];
372
+ const statusEntries = currentTask.taskStatusEntries;
373
+ acc[currentTask.type] = {
374
+ status: status ?? TaskStatuses.DETAILS_REQUIRED,
375
+ taskStatusEntries: statusEntries
376
+ };
377
+ return acc;
378
+ }, {});
379
+ };
380
+ const TASK_STATUS_POLLING_INTERVAL_MS = 3e3;
381
+ const TASK_STATUS_COMPLETED_POLLING_INTERVAL_MS = 6e3;
382
+ const getAccountTaskStatus = (accountId, payinPayoutTaskStatus) => {
383
+ const taskStatusEntries = payinPayoutTaskStatus?.taskStatusEntries;
384
+ const taskStatusEntry = taskStatusEntries?.find((entry) => entry.id.includes(accountId));
385
+ if (!taskStatusEntry) {
386
+ logger$1.warn(`No task status for this account: ${accountId}`);
387
+ return payinPayoutTaskStatus?.status ?? TaskStatuses.PROCESSING;
388
+ }
389
+ return TaskStatuses[taskStatusEntry.status];
390
+ };
391
+ const normalizedTaskStatusStore = signal(void 0);
392
+ const getTaskStatus = async (legalEntityId, baseUrl) => {
393
+ return httpGet({
394
+ baseUrl,
395
+ path: `legalEntities/${legalEntityId}/taskStatus`
396
+ });
397
+ };
398
+ const useTaskStatus = (options) => {
399
+ const { rootLegalEntityId, baseUrl } = useApiContext();
400
+ return useQuery({
401
+ queryKey: ["taskStatus"],
402
+ queryFn: () => getTaskStatus(rootLegalEntityId.value, baseUrl.value),
403
+ select: (data) => normalizeTaskStatuses(data),
404
+ ...options
405
+ });
406
+ };
407
+ const useLegalEntityType = ({
408
+ legalEntity
409
+ }) => {
410
+ const isTrust = isPartOfTrustFromLegalEntity(legalEntity);
411
+ const isSoleProprietor = hasSolePropInLegalEntity(legalEntity);
412
+ const hasLegalAssociation = isTrust || isSoleProprietor;
413
+ switch (legalEntity.type) {
414
+ case LegalEntityTypes.INDIVIDUAL:
415
+ case LegalEntityTypes.ORGANIZATION:
416
+ if (!hasLegalAssociation) return legalEntity.type;
417
+ if (isSoleProprietor) return LegalEntityTypes.SOLE_PROPRIETORSHIP;
418
+ if (isTrust) return LegalEntityTypes.TRUST;
419
+ break;
420
+ default:
421
+ return void 0;
422
+ }
423
+ };
424
+ const useCanSeeIntroduction = ({ legalEntity }) => {
425
+ const legalEntityType = useLegalEntityType({ legalEntity });
426
+ const { isSettingEnabled } = useSettingsContext();
427
+ switch (legalEntityType) {
428
+ case LegalEntityTypes.INDIVIDUAL:
429
+ return !isSettingEnabled(SettingNames.HideOnboardingIntroductionIndividual);
430
+ case LegalEntityTypes.ORGANIZATION:
431
+ return !isSettingEnabled(SettingNames.HideOnboardingIntroductionOrganization);
432
+ case LegalEntityTypes.SOLE_PROPRIETORSHIP:
433
+ return !isSettingEnabled(SettingNames.HideOnboardingIntroductionSoleProprietor);
434
+ case LegalEntityTypes.TRUST:
435
+ return !isSettingEnabled(SettingNames.HideOnboardingIntroductionTrust);
436
+ default:
437
+ return false;
438
+ }
439
+ };
440
+ const capabilitiesToPreventTypeChange = [
441
+ "receivePayments",
442
+ "issueCard",
443
+ "useCard",
444
+ "withdrawFromAtm",
445
+ "withdrawFromAtmInRestrictedCountries",
446
+ "useCardInRestrictedCountries",
447
+ "useCardInRestrictedIndustries",
448
+ "issueBankAccount",
449
+ "sendToThirdParty",
450
+ "receiveFromThirdParty",
451
+ "getGrantOffers",
452
+ "receiveGrants"
453
+ ];
454
+ const entityTypeToCorrespondingAccountHolderOption = {
455
+ [LegalEntityTypes.INDIVIDUAL]: "myName",
456
+ [LegalEntityTypes.ORGANIZATION]: "theCompanyIWorkFor",
457
+ [LegalEntityTypes.SOLE_PROPRIETORSHIP]: "mySoleProprietorName",
458
+ [LegalEntityTypes.TRUST]: "aTrust",
459
+ [LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: "anUnincorporatedPartnership"
460
+ };
461
+ const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false, accountHolder) => {
462
+ if (!legalEntityResponse?.type) return void 0;
463
+ if (hasOwnEntityAssociationOfType(
464
+ LegalEntityTypes.SOLE_PROPRIETORSHIP,
465
+ legalEntityResponse.entityAssociations,
466
+ legalEntityResponse.id
467
+ )) {
468
+ return "mySoleProprietorName";
469
+ }
470
+ if (hasOwnEntityAssociationOfType(
471
+ LegalEntityTypes.TRUST,
472
+ legalEntityResponse.entityAssociations,
473
+ legalEntityResponse.id
474
+ )) {
475
+ return "aTrust";
476
+ }
477
+ if (hasOwnEntityAssociationOfType(
478
+ LegalEntityTypes.UNINCORPORATED_PARTNERSHIP,
479
+ legalEntityResponse.entityAssociations,
480
+ legalEntityResponse.id
481
+ )) {
482
+ return "anUnincorporatedPartnership";
483
+ }
484
+ if (accountHolder) {
485
+ return accountHolder;
486
+ }
487
+ if (isTypeChanging || !isEmptyEntity(legalEntityResponse)) {
488
+ return entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type];
489
+ }
490
+ };
491
+ const allowIndividualWithoutSoleProp = (capabilities) => !capabilities?.map((c) => c.replace("Commercial", "").replace("Consumer", "")).some((c) => capabilitiesToPreventTypeChange.includes(c));
492
+ const BusinessTypes = {
493
+ INDIVIDUAL: "individual",
494
+ COMPANY: "company",
495
+ INCORPORATED_PARTNERSHIP: "partnershipIncorporated",
496
+ UNINCORPORATED_PARTNERSHIP: "partnershipUnincorporated",
497
+ INDIVIDUAL_TRUSTEE: "individualTrustee",
498
+ COMPANY_TRUSTEE: "companyTrustee",
499
+ SOLE_PROPRIETORSHIP: "soleProprietorship",
500
+ INCORPORATE_ASSOCIATION: "associationIncorporated"
501
+ };
502
+ const businessTypeMapping = {
503
+ myName: {
504
+ [LegalEntityTypes.INDIVIDUAL]: BusinessTypes.INDIVIDUAL
505
+ },
506
+ theCompanyIWorkFor: {
507
+ [LegalEntityTypes.ORGANIZATION]: BusinessTypes.COMPANY
508
+ },
509
+ mySoleProprietorName: {
510
+ [LegalEntityTypes.INDIVIDUAL]: BusinessTypes.SOLE_PROPRIETORSHIP
511
+ },
512
+ aTrust: {
513
+ [LegalEntityTypes.INDIVIDUAL]: BusinessTypes.INDIVIDUAL_TRUSTEE,
514
+ [LegalEntityTypes.ORGANIZATION]: BusinessTypes.COMPANY_TRUSTEE
515
+ },
516
+ anUnincorporatedPartnership: {
517
+ [LegalEntityTypes.INDIVIDUAL]: BusinessTypes.UNINCORPORATED_PARTNERSHIP,
518
+ [LegalEntityTypes.ORGANIZATION]: BusinessTypes.UNINCORPORATED_PARTNERSHIP
519
+ }
520
+ };
521
+ const companyTypesMapping = {
522
+ [CompanyTypesValues.INCORPORATED_PARTNERSHIP]: BusinessTypes.INCORPORATED_PARTNERSHIP,
523
+ [CompanyTypesValues.INCORPORATED_ASSOCIATION]: BusinessTypes.INCORPORATE_ASSOCIATION,
524
+ [CompanyTypesValues.PUBLIC_COMPANY]: BusinessTypes.COMPANY,
525
+ [CompanyTypesValues.PRIVATE_COMPANY]: BusinessTypes.COMPANY,
526
+ [CompanyTypesValues.UNLISTED_PUBLIC_COMPANY]: BusinessTypes.COMPANY,
527
+ [CompanyTypesValues.GOVERNMENTAL_ORGANIZATION]: BusinessTypes.COMPANY,
528
+ [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]: BusinessTypes.COMPANY,
529
+ [CompanyTypesValues.SOLE_PROPRIETORSHIP]: BusinessTypes.SOLE_PROPRIETORSHIP
530
+ };
531
+ const useBusinessSetup = (legalEntityResponse) => {
532
+ const { accountHolder } = useAccountHolder();
533
+ const accountHolderType = accountHolder || getDefaultAccountHolderType(legalEntityResponse);
534
+ const organizationType = legalEntityResponse?.organization?.type;
535
+ const businessSetup = accountHolderType === "theCompanyIWorkFor" && organizationType ? companyTypesMapping[organizationType] : businessTypeMapping[accountHolderType]?.[legalEntityResponse?.type];
536
+ return businessSetup;
537
+ };
538
+ function useDataMissingRemediations({
539
+ legalEntityId,
540
+ problems
541
+ }) {
542
+ const { t } = useTranslation("common");
543
+ const decisionMakersRemediationMessage = useMemo(() => {
544
+ const remediationCodes = problems[EntityTypes.LEGAL_ENTITY]?.[legalEntityId]?.missingData?.reduce((remediations, error) => {
545
+ const remediation = DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING[error.code];
546
+ return remediation ? [...remediations, remediation] : remediations;
547
+ }, []);
548
+ const uniqueRemediations = [...new Set(remediationCodes)];
549
+ switch (uniqueRemediations?.length) {
550
+ case void 0:
551
+ case 0:
552
+ return void 0;
553
+ case 1:
554
+ return uniqueRemediations[0] ? t(($) => $[`remediationMessage_${uniqueRemediations[0]}`]) : t(($) => $["missingMultipleDecisionMakers"]);
555
+ default:
556
+ return t(($) => $["missingMultipleDecisionMakers"]);
557
+ }
558
+ }, [problems, t, legalEntityId]);
559
+ return {
560
+ remediationMessages: {
561
+ [TaskTypes.DECISION_MAKER]: decisionMakersRemediationMessage
562
+ }
563
+ };
564
+ }
565
+ const filterProblemsByTaskForms = (entityProblems, forms) => {
566
+ if (!entityProblems?.verificationErrors) return entityProblems;
567
+ const filteredEntityProblems = Object.entries(entityProblems.verificationErrors).reduce(
568
+ (acc, [formId, verificationErrors]) => {
569
+ if (!forms.includes(formId)) return acc;
570
+ return {
571
+ ...entityProblems,
572
+ verificationErrors: {
573
+ ...acc.verificationErrors,
574
+ [formId]: verificationErrors
575
+ }
576
+ };
577
+ },
578
+ {}
579
+ );
580
+ filteredEntityProblems.verificationErrors = Object.keys(filteredEntityProblems.verificationErrors ?? {}).length > 0 ? filteredEntityProblems.verificationErrors : void 0;
581
+ return filteredEntityProblems;
582
+ };
583
+ const businessFormIds = [
584
+ "basicInformation",
585
+ "businessSelection",
586
+ "companyStructure",
587
+ "additionalInformation",
588
+ "companyRegistrationDocument",
589
+ "companyTaxDocument",
590
+ "companyProofOfDirectorDocument",
591
+ "companyProofOfSignatoryDocument",
592
+ "companyProofOfOwnershipDocument",
593
+ "companyFinancialInformation",
594
+ "companyConstitutionalDocument"
595
+ ];
596
+ const individualFormIds = [
597
+ "personalDetails",
598
+ "address",
599
+ "idVerificationMethod",
600
+ "idDocument",
601
+ "proofOfResidency",
602
+ "proofOfNationalId",
603
+ "proofOfRelationship"
604
+ ];
605
+ const individualOnfidoFormIds = [
606
+ "signatoryQuestionnaire",
607
+ "uboQuestionnaire",
608
+ "basicDetails",
609
+ "idVerificationMethod",
610
+ "additionalPersonalDetails",
611
+ "manualIdUpload",
612
+ "proofOfResidency",
613
+ "proofOfNationalId",
614
+ "proofOfRelationship"
615
+ ];
616
+ const TaskListItem = ({
617
+ titleKey,
618
+ title,
619
+ icon,
620
+ status,
621
+ onNavigateToTask,
622
+ disabled = false,
623
+ problems,
624
+ downloadHandler,
625
+ info,
626
+ loading = false,
627
+ showErrorAlerts = "onErrorStatus",
628
+ warningMessage,
629
+ deleteEntity,
630
+ testId,
631
+ enableTracking = true,
632
+ fallbackErrorMessage
633
+ }) => {
634
+ const { t } = useTranslation("common");
635
+ const userEvents = useAnalyticsContext();
636
+ const [isConfirmShown, setIsConfirmShown] = useState(false);
637
+ const isDeletable = !!deleteEntity;
638
+ const isDownloadable = !!downloadHandler && status === TaskStatuses.DOWNLOAD;
639
+ const shouldShowErrorAlert = showErrorAlerts === "always" || showErrorAlerts === "onErrorStatus" && status === TaskStatuses.ERROR || !!problems?.verificationErrors;
640
+ const handleNavigateToTask = () => {
641
+ if (enableTracking) {
642
+ userEvents.addJourneyEvent("Clicked button", {
643
+ actionType: "open",
644
+ task: void 0,
645
+ label: titleKey
646
+ });
647
+ }
648
+ onNavigateToTask?.();
649
+ };
650
+ const avatarVariant = disabled ? "disabled" : "primary";
651
+ const handleRemoveIntent = (event) => {
652
+ event.stopPropagation();
653
+ setIsConfirmShown(true);
654
+ };
655
+ const dismissConfirm = () => {
656
+ setIsConfirmShown(false);
657
+ };
658
+ const getTaskAccessory = () => {
659
+ switch (status) {
660
+ case TaskStatuses.SIGN:
661
+ return t(($) => $["sign"]);
662
+ case TaskStatuses.DETAILS_REQUIRED:
663
+ case TaskStatuses.EMPTY:
664
+ return t(($) => $["add"]);
665
+ default:
666
+ return /* @__PURE__ */ jsx(TaskVerificationStatus, { status });
667
+ }
668
+ };
669
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
670
+ /* @__PURE__ */ jsx(
671
+ Card,
672
+ {
673
+ stateful: onNavigateToTask && !loading && !disabled,
674
+ warningMessage,
675
+ onClick: loading ? void 0 : handleNavigateToTask,
676
+ onKeyDown: handleKeys(["Enter"], handleNavigateToTask ?? noop),
677
+ className: "adyen-task",
678
+ disabled,
679
+ children: /* @__PURE__ */ jsxs(
680
+ LoaderWrapper,
681
+ {
682
+ status: loading ? "loading" : "success",
683
+ formOpacityWhenLoading: 0.3,
684
+ loaderSize: "medium",
685
+ children: [
686
+ /* @__PURE__ */ jsxs("div", { className: "adyen-task-item", "data-testid": testId, children: [
687
+ /* @__PURE__ */ jsxs("div", { className: "adyen-task-item__header", children: [
688
+ /* @__PURE__ */ jsxs("div", { className: "adyen-task-item__heading", children: [
689
+ /* @__PURE__ */ jsx(Avatar, { variant: avatarVariant, iconName: icon }),
690
+ /* @__PURE__ */ jsx("div", { className: "adyen-task-item__body", children: /* @__PURE__ */ jsx("span", { className: "adyen-task-item__title", children: title || t(($) => $[titleKey]) }) })
691
+ ] }),
692
+ info && /* @__PURE__ */ jsxs("div", { className: "adyen-task-item__info", children: [
693
+ /* @__PURE__ */ jsx(Icon, { name: "info-circle" }),
694
+ /* @__PURE__ */ jsx("span", { children: info })
695
+ ] })
696
+ ] }),
697
+ /* @__PURE__ */ jsxs("aside", { className: "adyen-task-item__status", children: [
698
+ getTaskAccessory(),
699
+ isDownloadable && /* @__PURE__ */ jsx(
700
+ IconButton,
701
+ {
702
+ ariaLabel: t(($) => $["download"]),
703
+ icon: "download",
704
+ onClick: downloadHandler,
705
+ variant: "tertiary"
706
+ }
707
+ ),
708
+ isDeletable && /* @__PURE__ */ jsx(
709
+ IconButton,
710
+ {
711
+ ariaLabel: t(($) => $["delete"]),
712
+ icon: "bin",
713
+ variant: "tertiary",
714
+ onClick: handleRemoveIntent,
715
+ disabled: isConfirmShown
716
+ }
717
+ ),
718
+ !isDownloadable && !isDeletable && /* @__PURE__ */ jsx(Icon, { name: "chevron-right" })
719
+ ] })
720
+ ] }),
721
+ shouldShowErrorAlert && /* @__PURE__ */ jsx(
722
+ VerificationErrorAlert,
723
+ {
724
+ className: "adyen-task-item-alert",
725
+ problems,
726
+ fallbackErrorMessage
727
+ }
728
+ )
729
+ ]
730
+ }
731
+ )
732
+ }
733
+ ),
734
+ isConfirmShown && isDeletable && /* @__PURE__ */ jsx(
735
+ Confirm,
736
+ {
737
+ title: t(($) => $["deleteItem"], { item: title }),
738
+ description: t(($) => $["thisActionIsPermanent"]),
739
+ onConfirm: deleteEntity,
740
+ confirmText: t(($) => $["delete"]),
741
+ onCancel: dismissConfirm,
742
+ critical: true
743
+ }
744
+ )
745
+ ] });
746
+ };
747
+ const PayoutAccountTaskListItem = ({
748
+ account,
749
+ capabilityProblems,
750
+ onNavigateToTask,
751
+ payinPayoutTaskStatus
752
+ }) => {
753
+ const { t } = useTranslation("common");
754
+ const { showToast } = useToastContext();
755
+ const { isExperimentEnabled } = useExperimentsContext();
756
+ const { mutateAsync: deleteTransferInstrument } = useDeleteTransferInstrument();
757
+ const isInstantVerificationAccount = isInstantVerifiedAccount(account);
758
+ const obscuredAccountNumber = getObscuredAccountNumber(account);
759
+ const getTaskStatus2 = useGetTaskStatus();
760
+ const status = isExperimentEnabled("UseTaskStatusApiForPayout") ? getAccountTaskStatus(account.id, payinPayoutTaskStatus) : getTaskStatus2(TaskTypes.PAYOUT, account.id);
761
+ const handleDeleteTransferInstrument = async () => {
762
+ try {
763
+ await deleteTransferInstrument(account.id);
764
+ showToast({ label: t(($) => $["transferInstrumentDeleted"]), variant: "success" });
765
+ } catch {
766
+ showToast({ label: t(($) => $["failedToDeletePayoutAccount"]), variant: "error" });
767
+ }
768
+ };
769
+ return /* @__PURE__ */ jsx(
770
+ TaskListItem,
771
+ {
772
+ disabled: isInstantVerificationAccount && status === TaskStatuses.PROCESSING,
773
+ onNavigateToTask: isInstantVerificationAccount ? void 0 : onNavigateToTask,
774
+ icon: "payout",
775
+ titleKey: "accountNumber",
776
+ title: obscuredAccountNumber,
777
+ status,
778
+ problems: capabilityProblems?.BankAccount?.[account.id],
779
+ fallbackErrorMessage: isInstantVerificationAccount ? t(($) => $["verificationErrorMessageTrustedTransferInstrument"]) : void 0,
780
+ deleteEntity: handleDeleteTransferInstrument
781
+ }
782
+ );
783
+ };
784
+ const TaskListGroup = ({ title, children }) => /* @__PURE__ */ jsxs("article", { className: "adyen-task-list-group", children: [
785
+ title && /* @__PURE__ */ jsx("header", { className: "adyen-task-list-group__header", children: /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "body-stronger", color: "secondary", children: title }) }),
786
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-card__body", children: /* @__PURE__ */ jsx(StackLayout, { gap: "xSmall", children }) })
787
+ ] });
788
+ const LEGAL_ENTITY_BASE_TASKS = [
789
+ TaskTypes.INDIVIDUAL,
790
+ TaskTypes.BUSINESS_DETAILS,
791
+ TaskTypes.DECISION_MAKER_OVERVIEW
792
+ ];
793
+ const CONTRACT_TASKS = [TaskTypes.SERVICE_AGREEMENT, TaskTypes.PCI_DSS];
794
+ function TaskList({ onNavigateToTask, singpassComponent }) {
795
+ const { data: rootLe, isLoading } = useLegalEntity(ROOT_LE);
796
+ const { data: existingBusinessLines, isLoading: isLoadingBl } = useBusinessLines([
797
+ "paymentProcessing"
798
+ ]);
799
+ const capabilityProblems = useCapabilityProblems() ?? {};
800
+ if (isLoading || !rootLe || isLoadingBl) {
801
+ return /* @__PURE__ */ jsx(Loader, { size: "large" });
802
+ }
803
+ return /* @__PURE__ */ jsx(
804
+ TaskListInner,
805
+ {
806
+ onNavigateToTask,
807
+ singpassComponent,
808
+ legalEntityResponse: rootLe,
809
+ capabilityProblems,
810
+ existingBusinessLines
811
+ }
812
+ );
813
+ }
814
+ function TaskListInner({
815
+ onNavigateToTask,
816
+ legalEntityResponse,
817
+ capabilityProblems,
818
+ singpassComponent,
819
+ existingBusinessLines
820
+ }) {
821
+ const userEvents = useAnalyticsContext();
822
+ const { t } = useTranslation("common");
823
+ const { showToast } = useToastContext();
824
+ const { rootLegalEntityId, baseUrl } = useApiContext();
825
+ const { isSettingEnabled } = useSettingsContext();
826
+ const { isExperimentEnabled } = useExperimentsContext();
827
+ const { accountHolder } = useAccountHolder();
828
+ const tasks = useGlobalStore().tasks.value;
829
+ const getTaskStatus2 = useGetTaskStatus();
830
+ const businessSetup = useBusinessSetup(legalEntityResponse);
831
+ const canSeeIntroduction = useCanSeeIntroduction({ legalEntity: legalEntityResponse });
832
+ const additionalSalesChannels = useSalesChannels();
833
+ const { remediationMessages } = useDataMissingRemediations({
834
+ legalEntityId: legalEntityResponse.id,
835
+ problems: capabilityProblems
836
+ });
837
+ const { data: pciStatus } = usePciStatus({ additionalSalesChannels });
838
+ const { data: pciQuestionnaireList } = usePciQuestionnaireList();
839
+ const { data: termsOfServiceStatus } = useTermsOfServiceStatus();
840
+ const { data: termsOfServiceStatusAcceptanceInfos } = useTermsOfServiceAcceptanceInfos();
841
+ const { data: normalizedTasks } = useTaskStatus({
842
+ refetchInterval: (query) => {
843
+ const { data: response } = query.state || {};
844
+ const statuses = response?.statuses;
845
+ const areAllTasksFinishedOrEmpty = statuses?.length === 0 || statuses?.every((task) => task.status === "FINISHED");
846
+ return areAllTasksFinishedOrEmpty ? TASK_STATUS_COMPLETED_POLLING_INTERVAL_MS : TASK_STATUS_POLLING_INTERVAL_MS;
847
+ }
848
+ });
849
+ const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
850
+ const hidePayoutAccountTaskExperiment = isExperimentEnabled("HidePayoutAccountTask");
851
+ const showCustomerSupportV4 = isExperimentEnabled("ShowCustomerSupportV4");
852
+ const transferInstrumentLimit = useSetting("transferInstrumentLimit");
853
+ const payinPayoutTaskStatus = normalizedTasks?.PAYOUT ?? normalizedTasks?.PAYIN;
854
+ const businessDetailsTaskStatus = normalizedTasks?.BUSINESS_DETAILS?.status ?? TaskStatuses.DETAILS_REQUIRED;
855
+ const businessLinesTaskStatus = normalizedTasks?.ACQUIRING_BUSINESS_LINE?.status ?? TaskStatuses.DETAILS_REQUIRED;
856
+ const rootLegalEntityProblems = capabilityProblems?.LegalEntity?.[legalEntityResponse.id];
857
+ const isReview = Boolean(rootLegalEntityProblems?.isReviewRequired);
858
+ const hasTrust = accountHolder === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
859
+ const hasUnincorporatedPartnership = accountHolder === "anUnincorporatedPartnership" || isPartOfUnincorporatedPartnership(legalEntityResponse);
860
+ const hasSoleProprietorship = accountHolder === "mySoleProprietorName" || hasSolePropInLegalEntity(legalEntityResponse);
861
+ const isLegalRepresentativeRequired = isExperimentEnabled("EnableAgeVerification") && doesLegalEntityRequiresLegalRepresentative(legalEntityResponse);
862
+ const legalRepresentative = isLegalRepresentativeRequired && getLegalRepresentative(legalEntityResponse);
863
+ const transferInstruments = legalEntityResponse?.transferInstruments || [];
864
+ const canAddPayoutAccount = legalEntityResponse?.organization?.legalName || legalEntityResponse?.individual?.name;
865
+ const hasPayinTaskNotPayout = tasks.includes(TaskTypes.PAYIN) && !tasks.includes(TaskTypes.PAYOUT);
866
+ const payoutTaskDescriptionKey = isReview ? "payoutAccountsDescriptionReview" : "payoutAccountsDescription";
867
+ const pciHasDocuments = !!pciQuestionnaireList?.data?.length;
868
+ const canDownloadPci = !pciStatus?.signingRequired && pciHasDocuments;
869
+ const hasCreatedBusinessLines = !!existingBusinessLines?.length;
870
+ const hasPciSigners = !!legalEntityResponse?.entityAssociations?.length;
871
+ const pciIsActionable = pciStatus?.signingRequired || canDownloadPci;
872
+ const serviceAgreementTypes = termsOfServiceStatus?.termsOfServiceTypes ?? [];
873
+ const serviceAgreementAcceptanceInfos = termsOfServiceStatusAcceptanceInfos?.data ?? [];
874
+ const hasServiceAgreementSigners = legalEntityResponse.type === LegalEntityTypes.ORGANIZATION && getOwnSignatories(legalEntityResponse).length || Boolean(legalRepresentative) || legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL && !!legalEntityResponse?.individual;
875
+ const hasTaskOfGroupAccountDetails = tasks.some((task) => LEGAL_ENTITY_BASE_TASKS.includes(task));
876
+ const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
877
+ const hasFinancingTasks = tasks.includes(TaskTypes.BUSINESS_FINANCING) || tasks.includes(TaskTypes.SOURCE_OF_FUNDS);
878
+ const showServiceAgreementTask = tasks.includes(TaskTypes.SERVICE_AGREEMENT) && (serviceAgreementTypes.length > 0 || serviceAgreementAcceptanceInfos.length > 0);
879
+ const showPciTask = isSettingEnabled("allowBusinessLines") ? tasks.includes("PCI_DSS") : tasks.includes("PCI_DSS") && pciIsActionable;
880
+ const shouldSignPciFirst = showServiceAgreementTask && showPciTask && !pciHasDocuments;
881
+ const pciTaskState = (() => {
882
+ if (!hasPciSigners) {
883
+ return { disabled: true, infoMessage: t(($) => $["requiresDecisionMakers"]) };
884
+ }
885
+ if (isSettingEnabled("allowBusinessLines") && !hasCreatedBusinessLines) {
886
+ return { disabled: true, infoMessage: t(($) => $["requiresBusinessLine"]) };
887
+ }
888
+ return { disabled: !pciStatus?.signingRequired, infoMessage: void 0 };
889
+ })();
890
+ const serviceAgreementTaskState = (() => {
891
+ if (isSettingEnabled("allowBusinessLines") && shouldSignPciFirst) {
892
+ return { disabled: true, infoMessage: t(($) => $["signPciFirst"]) };
893
+ }
894
+ if (!hasServiceAgreementSigners) {
895
+ return { disabled: true, infoMessage: t(($) => $["requiresSignatory"]) };
896
+ }
897
+ return { disabled: false, infoMessage: void 0 };
898
+ })();
899
+ const getBusinessTaskListTitleKey = () => {
900
+ if (hasUnincorporatedPartnership) {
901
+ return "tellUsMoreAboutPrimaryPartner";
902
+ } else if (tasks.includes(TaskTypes.BUSINESS_DETAILS)) {
903
+ return isReview ? "businessAccountDetailsDescriptionReview" : "businessAccountDetailsDescription";
904
+ } else if (canChangeEntityType) {
905
+ return "provideFewDetailsAboutYourself";
906
+ } else {
907
+ return "accountDetailsDescription";
908
+ }
909
+ };
910
+ const getEmptyBankAccountProblems = () => {
911
+ const transferInstrumentId = legalEntityResponse?.transferInstruments?.[0]?.id;
912
+ return transferInstrumentId ? capabilityProblems?.BankAccount?.[transferInstrumentId] : void 0;
913
+ };
914
+ const onEditBusinessSetupClick = () => {
915
+ userEvents.addTaskEvent("Clicked button", {
916
+ task: TaskTypes.TASKS_OVERVIEW,
917
+ actionType: "edit"
918
+ });
919
+ onNavigateToTask(TaskTypes.BUSINESS_TYPE_SELECTION);
920
+ };
921
+ const onPciDownload = async () => {
922
+ try {
923
+ const response = await getPciQuestionnaireList(rootLegalEntityId.value, baseUrl.value);
924
+ if (!response.data) return;
925
+ await Promise.all(
926
+ response.data.map(async (pciQuestionnaireInfo) => {
927
+ const pciQuestionnaire = await getPciQuestionnaire(
928
+ rootLegalEntityId.value,
929
+ baseUrl.value,
930
+ pciQuestionnaireInfo.id
931
+ );
932
+ await downloadFile(pciQuestionnaire.content, `${pciQuestionnaire.id}.pdf`);
933
+ })
934
+ );
935
+ } catch {
936
+ showToast({ label: t(($) => $["failedToDownloadPci"]), variant: "error" });
937
+ } finally {
938
+ userEvents.addTaskEvent("Clicked button", {
939
+ task: TaskTypes.PCI_DSS,
940
+ actionType: "download"
941
+ });
942
+ }
943
+ };
944
+ const handleOnNavigateToTaskReview = () => onNavigateToTask(TaskTypes.REVIEW);
945
+ const handleOnNavigateToTaskIndividual = () => onNavigateToTask(TaskTypes.INDIVIDUAL);
946
+ const handleOnNavigateToTaskBusinessDetails = () => onNavigateToTask(TaskTypes.BUSINESS_DETAILS);
947
+ const handleOnNavigateToTaskBusinessLines = () => onNavigateToTask(TaskTypes.ACQUIRING_BUSINESS_LINE);
948
+ const handleOnNavigateToTaskCustomerSupport = () => onNavigateToTask(TaskTypes.CUSTOMER_SUPPORT);
949
+ const handleOnNavigateToTaskDecisionMaker = () => onNavigateToTask(TaskTypes.DECISION_MAKER_OVERVIEW);
950
+ const handleOnNavigateToTaskTrust = () => onNavigateToTask(TaskTypes.TRUST);
951
+ const handleOnNavigateToTaskTrustMember = () => onNavigateToTask(TaskTypes.TRUST_MEMBER_OVERVIEW);
952
+ const handleOnNavigateToTaskPayout = (id) => hasPayinTaskNotPayout ? onNavigateToTask(TaskTypes.PAYIN, id) : onNavigateToTask(TaskTypes.PAYOUT, id);
953
+ const handleOnNavigateToPci = () => !canDownloadPci && onNavigateToTask(TaskTypes.PCI_DSS);
954
+ const handleOnNavigateToSoleProp = () => onNavigateToTask(TaskTypes.SOLE_PROPRIETOR_COMPANY);
955
+ const handleOnNavigateToServiceAgreement = () => onNavigateToTask(TaskTypes.SERVICE_AGREEMENT);
956
+ const handleOnNavigateToTaskLegalRepresentative = () => onNavigateToTask(TaskTypes.LEGAL_REPRESENTATIVE_DETAILS);
957
+ const handleOnNavigateToSourceOfFunds = () => onNavigateToTask(TaskTypes.SOURCE_OF_FUNDS);
958
+ const handleOnNavigateToBusinessFinancing = () => onNavigateToTask(TaskTypes.BUSINESS_FINANCING);
959
+ const handleOnNavigateToTaxReporting = () => onNavigateToTask(TaskTypes.TAX_REPORTING);
960
+ const fullIndividualFormIds = [...individualFormIds, ...individualOnfidoFormIds];
961
+ const showDecisionMakersWarning = Boolean(
962
+ getOwnDecisionMakersLegalEntityIds(legalEntityResponse).length && remediationMessages.DECISION_MAKER
963
+ );
964
+ useEffect(() => {
965
+ if (showDecisionMakersWarning) {
966
+ userEvents.addTaskEvent("Encountered error", {
967
+ task: TaskTypes.TASKS_OVERVIEW,
968
+ actionType: "alert",
969
+ returnValue: "missingDecisionMaker"
970
+ });
971
+ }
972
+ }, [showDecisionMakersWarning, userEvents]);
973
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-task-list__container", children: [
974
+ canSeeIntroduction && /* @__PURE__ */ jsx("div", { className: "adyen-task-list__nav", children: /* @__PURE__ */ jsx(Button, { variant: "link", onClick: () => onNavigateToTask(TaskTypes.INTRODUCTION), children: t(($) => $["goToIntroduction"]) }) }),
975
+ canChangeEntityType && /* @__PURE__ */ jsxs("header", { className: "adyen-task-list__heading", children: [
976
+ /* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: t(($) => $["setUpYourAccount"]) }),
977
+ /* @__PURE__ */ jsxs(Typography, { el: "p", variant: "title", className: "adyen-task-list__description", children: [
978
+ /* @__PURE__ */ jsx(Typography, { el: "span", variant: "body-strongest", children: t(($) => $["yourBusinessSetup"], {
979
+ businessSetup: businessSetup ? t(($) => $[businessSetup]) : t(($) => $["unknown"])
980
+ }) }),
981
+ /* @__PURE__ */ jsx(
982
+ IconButton,
983
+ {
984
+ ariaLabel: t(($) => $["editBusinessSetup"]),
985
+ icon: "edit",
986
+ variant: "tertiary",
987
+ onClick: onEditBusinessSetupClick
988
+ }
989
+ )
990
+ ] })
991
+ ] }),
992
+ singpassComponent,
993
+ /* @__PURE__ */ jsxs(StackLayout, { children: [
994
+ hasTaskOfGroupAccountDetails && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $[getBusinessTaskListTitleKey()]), children: [
995
+ tasks.includes(TaskTypes.INDIVIDUAL) && /* @__PURE__ */ jsx(
996
+ TaskListItem,
997
+ {
998
+ onNavigateToTask: handleOnNavigateToTaskIndividual,
999
+ icon: "decision-maker",
1000
+ titleKey: hasTrust ? "trusteePersonalDetails" : hasUnincorporatedPartnership ? "primaryPartnerDetails" : "personalDetails",
1001
+ status: getTaskStatus2(TaskTypes.INDIVIDUAL),
1002
+ problems: filterProblemsByTaskForms(rootLegalEntityProblems, fullIndividualFormIds)
1003
+ }
1004
+ ),
1005
+ tasks.includes(TaskTypes.BUSINESS_DETAILS) && /* @__PURE__ */ jsx(
1006
+ TaskListItem,
1007
+ {
1008
+ testId: TaskTypes.BUSINESS_DETAILS,
1009
+ onNavigateToTask: handleOnNavigateToTaskBusinessDetails,
1010
+ icon: "company",
1011
+ titleKey: hasTrust ? "businessTrusteeDetails" : hasUnincorporatedPartnership ? "primaryPartnerDetails" : "businessDetails",
1012
+ status: businessDetailsTaskStatus,
1013
+ problems: filterProblemsByTaskForms(rootLegalEntityProblems, businessFormIds)
1014
+ }
1015
+ ),
1016
+ hasSoleProprietorship && /* @__PURE__ */ jsx(
1017
+ TaskListItem,
1018
+ {
1019
+ onNavigateToTask: handleOnNavigateToSoleProp,
1020
+ icon: "company",
1021
+ titleKey: canChangeEntityType ? "soleProprietorshipDetails" : "soleProprietorDetails",
1022
+ status: getTaskStatus2(TaskTypes.SOLE_PROPRIETOR_COMPANY),
1023
+ problems: getOwnSolePropProblems(legalEntityResponse, capabilityProblems)
1024
+ }
1025
+ ),
1026
+ isLegalRepresentativeRequired && /* @__PURE__ */ jsx(
1027
+ TaskListItem,
1028
+ {
1029
+ onNavigateToTask: handleOnNavigateToTaskLegalRepresentative,
1030
+ icon: "decision-maker",
1031
+ titleKey: "legalRepresentative",
1032
+ status: getTaskStatus2(TaskTypes.LEGAL_REPRESENTATIVE_DETAILS)
1033
+ }
1034
+ ),
1035
+ tasks.includes(TaskTypes.DECISION_MAKER_OVERVIEW) && /* @__PURE__ */ jsx(
1036
+ TaskListItem,
1037
+ {
1038
+ onNavigateToTask: handleOnNavigateToTaskDecisionMaker,
1039
+ icon: "decision-maker",
1040
+ titleKey: hasUnincorporatedPartnership ? "entityDecisionMakers" : "decisionMakers",
1041
+ status: getTaskStatus2(TaskTypes.DECISION_MAKER_OVERVIEW),
1042
+ warningMessage: showDecisionMakersWarning ? remediationMessages[TaskTypes.DECISION_MAKER] : void 0
1043
+ }
1044
+ ),
1045
+ tasks.includes(TaskTypes.ACQUIRING_BUSINESS_LINE) && /* @__PURE__ */ jsx(
1046
+ TaskListItem,
1047
+ {
1048
+ testId: TaskTypes.ACQUIRING_BUSINESS_LINE,
1049
+ onNavigateToTask: handleOnNavigateToTaskBusinessLines,
1050
+ icon: "solutionPayments",
1051
+ titleKey: "businessLines",
1052
+ status: businessLinesTaskStatus
1053
+ }
1054
+ ),
1055
+ showCustomerSupportV4 && tasks.includes(TaskTypes.CUSTOMER_SUPPORT) && /* @__PURE__ */ jsx(
1056
+ TaskListItem,
1057
+ {
1058
+ onNavigateToTask: handleOnNavigateToTaskCustomerSupport,
1059
+ icon: "webinar",
1060
+ titleKey: "customerSupport",
1061
+ status: normalizedTasks?.CUSTOMER_SUPPORT?.status ?? TaskStatuses.DETAILS_REQUIRED,
1062
+ problems: filterProblemsByTaskForms(rootLegalEntityProblems, ["customerSupport"])
1063
+ }
1064
+ )
1065
+ ] }),
1066
+ hasTrust && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["trustDetailsDescription"]), children: [
1067
+ /* @__PURE__ */ jsx(
1068
+ TaskListItem,
1069
+ {
1070
+ onNavigateToTask: handleOnNavigateToTaskTrust,
1071
+ icon: "trust",
1072
+ titleKey: "trustDetails",
1073
+ status: getTaskStatus2(TaskTypes.TRUST),
1074
+ problems: getOwnTrustProblems(legalEntityResponse, capabilityProblems)
1075
+ }
1076
+ ),
1077
+ /* @__PURE__ */ jsx(
1078
+ TaskListItem,
1079
+ {
1080
+ onNavigateToTask: handleOnNavigateToTaskTrustMember,
1081
+ icon: "decision-maker",
1082
+ titleKey: "trustMembers",
1083
+ status: getTaskStatus2(TaskTypes.TRUST_MEMBER_OVERVIEW)
1084
+ }
1085
+ )
1086
+ ] }),
1087
+ hasUnincorporatedPartnership && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["partnershipUnincorporated"]), children: [
1088
+ /* @__PURE__ */ jsx(
1089
+ TaskListItem,
1090
+ {
1091
+ onNavigateToTask: () => onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP),
1092
+ icon: "trust",
1093
+ titleKey: "unincorporatedDetails",
1094
+ status: getTaskStatus2(TaskTypes.UNINCORPORATED_PARTNERSHIP),
1095
+ problems: getOwnUnincorporatedPartnershipProblems(
1096
+ legalEntityResponse,
1097
+ capabilityProblems
1098
+ )
1099
+ }
1100
+ ),
1101
+ /* @__PURE__ */ jsx(
1102
+ TaskListItem,
1103
+ {
1104
+ onNavigateToTask: () => {
1105
+ if (!isPartOfUnincorporatedPartnership(legalEntityResponse)) {
1106
+ onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP);
1107
+ } else {
1108
+ onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW);
1109
+ }
1110
+ },
1111
+ icon: "decision-maker",
1112
+ titleKey: "unincorporatedPartnershipMembers",
1113
+ status: getTaskStatus2(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW)
1114
+ }
1115
+ )
1116
+ ] }),
1117
+ hasFinancingTasks && /* @__PURE__ */ jsxs(TaskListGroup, { children: [
1118
+ tasks.includes(TaskTypes.SOURCE_OF_FUNDS) && /* @__PURE__ */ jsx(
1119
+ TaskListItem,
1120
+ {
1121
+ onNavigateToTask: handleOnNavigateToSourceOfFunds,
1122
+ icon: "cash-stack",
1123
+ titleKey: "fundingSources",
1124
+ status: normalizedTasks?.SOURCE_OF_FUNDS?.status ?? TaskStatuses.DETAILS_REQUIRED
1125
+ }
1126
+ ),
1127
+ tasks.includes(TaskTypes.BUSINESS_FINANCING) && /* @__PURE__ */ jsx(
1128
+ TaskListItem,
1129
+ {
1130
+ onNavigateToTask: handleOnNavigateToBusinessFinancing,
1131
+ icon: "capital",
1132
+ titleKey: "businessFinancing",
1133
+ status: normalizedTasks?.BUSINESS_FINANCING?.status ?? TaskStatuses.DETAILS_REQUIRED
1134
+ }
1135
+ )
1136
+ ] }),
1137
+ tasks.includes(TaskTypes.TAX_REPORTING) && /* @__PURE__ */ jsx(TaskListGroup, { children: /* @__PURE__ */ jsx(
1138
+ TaskListItem,
1139
+ {
1140
+ onNavigateToTask: handleOnNavigateToTaxReporting,
1141
+ icon: "reporting",
1142
+ titleKey: "taxReporting",
1143
+ status: normalizedTasks?.TAX_REPORTING?.status ?? TaskStatuses.DETAILS_REQUIRED
1144
+ }
1145
+ ) }),
1146
+ (tasks.includes(TaskTypes.PAYOUT) || tasks.includes(TaskTypes.PAYIN)) && !hidePayoutAccountTaskExperiment && /* @__PURE__ */ jsx(
1147
+ TaskListGroup,
1148
+ {
1149
+ title: canChangeEntityType ? t(($) => $["payoutBankAccounts"]) : t(
1150
+ ($) => $[hasPayinTaskNotPayout ? "payinAccountsDescription" : payoutTaskDescriptionKey]
1151
+ ),
1152
+ children: transferInstruments.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
1153
+ transferInstruments.map((transferInstrument) => /* @__PURE__ */ jsx(
1154
+ PayoutAccountTaskListItem,
1155
+ {
1156
+ account: transferInstrument,
1157
+ capabilityProblems,
1158
+ onNavigateToTask: () => handleOnNavigateToTaskPayout(transferInstrument.id),
1159
+ payinPayoutTaskStatus
1160
+ },
1161
+ transferInstrument.id
1162
+ )),
1163
+ !transferInstrumentLimit || transferInstruments.length < transferInstrumentLimit ? /* @__PURE__ */ jsxs(
1164
+ Card,
1165
+ {
1166
+ stateful: true,
1167
+ onClick: () => handleOnNavigateToTaskPayout(),
1168
+ className: "adyen-task adyen-kyc-add-payout",
1169
+ disabled: !canAddPayoutAccount,
1170
+ children: [
1171
+ /* @__PURE__ */ jsx(Icon, { name: "plus", className: "adyen-task-list__card-icon " }),
1172
+ /* @__PURE__ */ jsx("span", { children: canChangeEntityType ? t(($) => $["addExtraBankAccount"]) : t(
1173
+ ($) => $[hasPayinTaskNotPayout ? "addExtraPayinAccount" : "addExtraPayoutAccount"]
1174
+ ) })
1175
+ ]
1176
+ }
1177
+ ) : null
1178
+ ] }) : /* @__PURE__ */ jsx(
1179
+ TaskListItem,
1180
+ {
1181
+ onNavigateToTask: () => handleOnNavigateToTaskPayout(),
1182
+ icon: "payout",
1183
+ titleKey: canChangeEntityType ? "bankAccountDetails" : hasPayinTaskNotPayout ? "payinDetails" : "payoutDetails",
1184
+ status: TaskStatuses.DETAILS_REQUIRED,
1185
+ disabled: !canAddPayoutAccount,
1186
+ problems: getEmptyBankAccountProblems()
1187
+ }
1188
+ )
1189
+ }
1190
+ ),
1191
+ hasContractTasks && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["reviewAndSignLegalDisclosures"]), children: [
1192
+ showPciTask && /* @__PURE__ */ jsx(
1193
+ TaskListItem,
1194
+ {
1195
+ onNavigateToTask: handleOnNavigateToPci,
1196
+ icon: "pci",
1197
+ titleKey: "pciDssQuestionnaire",
1198
+ status: canDownloadPci ? TaskStatuses.DOWNLOAD : TaskStatuses.SIGN,
1199
+ info: pciTaskState.infoMessage,
1200
+ downloadHandler: onPciDownload,
1201
+ disabled: pciTaskState.disabled
1202
+ }
1203
+ ),
1204
+ showServiceAgreementTask && /* @__PURE__ */ jsx(
1205
+ TaskListItem,
1206
+ {
1207
+ onNavigateToTask: handleOnNavigateToServiceAgreement,
1208
+ icon: "contract",
1209
+ titleKey: "signServiceAgreement",
1210
+ disabled: serviceAgreementTaskState.disabled,
1211
+ status: serviceAgreementTypes.length ? TaskStatuses.SIGN : TaskStatuses.SIGNED,
1212
+ info: serviceAgreementTaskState.infoMessage
1213
+ }
1214
+ )
1215
+ ] }),
1216
+ isReview && /* @__PURE__ */ jsx(TaskListGroup, { title: t(($) => $["pleaseEnsureTheFollowing"]), children: /* @__PURE__ */ jsx(
1217
+ TaskListItem,
1218
+ {
1219
+ onNavigateToTask: handleOnNavigateToTaskReview,
1220
+ icon: "review",
1221
+ titleKey: "submitReviewOfYourData",
1222
+ status: TaskStatuses.SUBMIT,
1223
+ problems: rootLegalEntityProblems,
1224
+ showErrorAlerts: "always"
1225
+ }
1226
+ ) })
1227
+ ] })
1228
+ ] });
1229
+ }
1230
+ const isNewEntity = Symbol("isNewEntity");
1231
+ const useExemptSettlor = ({
1232
+ trust
1233
+ }) => {
1234
+ const matchingAssociation = useMemo(() => {
1235
+ if (!trust) return void 0;
1236
+ return getOwnEntityAssociations(trust).find(
1237
+ (association) => association.type === TrustMemberTypes.SETTLOR && Boolean(association.settlorExemptionReason)
1238
+ );
1239
+ }, [trust]);
1240
+ const { data } = useLegalEntity(matchingAssociation?.legalEntityId ?? skipToken);
1241
+ return data;
1242
+ };
1243
+ const splitAtFirstOccurrence = (str, separator) => {
1244
+ const firstOccurrence = str.indexOf(separator);
1245
+ if (firstOccurrence === -1) return [str];
1246
+ return [str.slice(0, firstOccurrence), str.slice(firstOccurrence + 1)];
1247
+ };
1248
+ const getTrustMemberOwnerId = (trustMemberId, entityAssociations) => entityAssociations.find((association) => association.associatorId === trustMemberId)?.legalEntityId;
1249
+ const getFallbackName = (exemptSettlorAssociation) => {
1250
+ const [firstName, lastName] = splitAtFirstOccurrence(exemptSettlorAssociation.name ?? "", " ");
1251
+ return {
1252
+ firstName,
1253
+ lastName
1254
+ };
1255
+ };
1256
+ const convertEntityAssociationIntoTrustMember = (association, associations, exemptSettlorLE) => {
1257
+ if (association.settlorExemptionReason) {
1258
+ return {
1259
+ trustMemberType: "exemptSettlor",
1260
+ roles: [TrustMemberTypes.SETTLOR],
1261
+ legalEntityType: association.entityType,
1262
+ legalEntityId: association.legalEntityId,
1263
+ settlorExemptionReason: association.settlorExemptionReason,
1264
+ exemptSettlorName: association.entityType === LegalEntityTypes.INDIVIDUAL ? exemptSettlorLE?.individual?.name ?? getFallbackName(association) : void 0,
1265
+ name: association.name
1266
+ };
1267
+ }
1268
+ if (association.entityType === LegalEntityTypes.ORGANIZATION)
1269
+ return {
1270
+ trustMemberType: "company",
1271
+ roles: [],
1272
+ legalEntityType: LegalEntityTypes.ORGANIZATION,
1273
+ legalEntityId: association.legalEntityId,
1274
+ name: association.name,
1275
+ ownerId: getTrustMemberOwnerId(association.legalEntityId, associations)
1276
+ };
1277
+ if (association.entityType === LegalEntityTypes.INDIVIDUAL)
1278
+ return {
1279
+ trustMemberType: "regular",
1280
+ roles: [],
1281
+ legalEntityType: LegalEntityTypes.INDIVIDUAL,
1282
+ legalEntityId: association.legalEntityId,
1283
+ name: association.name
1284
+ };
1285
+ throw new Error(`Not a valid trust member: ${JSON.stringify(association)}`);
1286
+ };
1287
+ const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations, exemptSettlorLE) => {
1288
+ const mappedTrustMembers = entityAssociations.reduce(
1289
+ (acc, entityAssociation) => {
1290
+ if (!Object.values(TrustMemberTypes).includes(entityAssociation.type) || entityAssociation.associatorId !== trustEntityId || !entityAssociation.legalEntityId) {
1291
+ return acc;
1292
+ }
1293
+ const trustMember = acc[entityAssociation.legalEntityId] ?? convertEntityAssociationIntoTrustMember(
1294
+ entityAssociation,
1295
+ entityAssociations,
1296
+ exemptSettlorLE
1297
+ );
1298
+ const trustMemberType = entityAssociation.type;
1299
+ acc[entityAssociation.legalEntityId] = {
1300
+ ...trustMember,
1301
+ roles: [.../* @__PURE__ */ new Set([...trustMember.roles, trustMemberType])]
1302
+ };
1303
+ return acc;
1304
+ },
1305
+ {}
1306
+ );
1307
+ return Object.values(mappedTrustMembers);
1308
+ };
1309
+ const mapRootLegalEntityToTrustMember = (rootLegalEntity) => ({
1310
+ trustMemberType: "rootTrustee",
1311
+ roles: [TrustMemberTypes.TRUSTEE],
1312
+ legalEntityType: rootLegalEntity.type,
1313
+ legalEntityId: rootLegalEntity.id,
1314
+ name: getLegalEntityNameBasedOnType(rootLegalEntity)
1315
+ });
1316
+ const mapUndefinedBeneficiaryInfoToTrustMembers = (undefinedBeneficiaryInfo) => undefinedBeneficiaryInfo.map(({ reference, description }) => ({
1317
+ trustMemberType: "undefinedBeneficiary",
1318
+ roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
1319
+ reference,
1320
+ description
1321
+ }));
1322
+ const getTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => [
1323
+ mapRootLegalEntityToTrustMember(rootLegalEntity),
1324
+ ...mapEntityAssociationsToTrustMembers(
1325
+ trustLE.id,
1326
+ trustLE.entityAssociations ?? [],
1327
+ exemptSettlorLE
1328
+ ),
1329
+ ...mapUndefinedBeneficiaryInfoToTrustMembers(trustLE.trust?.undefinedBeneficiaryInfo ?? [])
1330
+ ];
1331
+ const combineRootLegalEntityWithEntityAssociations = (rootLegalEntity, entityAssociations) => {
1332
+ const allowedRolesForRootLegalEntity = [
1333
+ TrustMemberTypes.SETTLOR,
1334
+ TrustMemberTypes.PROTECTOR,
1335
+ TrustMemberTypes.DEFINED_BENEFICIARY
1336
+ ];
1337
+ const roles = entityAssociations.map((entityAssociation) => entityAssociation.type).filter((role) => allowedRolesForRootLegalEntity.includes(role));
1338
+ return {
1339
+ trustMemberType: "rootTrustee",
1340
+ roles: [...roles, TrustMemberTypes.TRUSTEE],
1341
+ legalEntityType: rootLegalEntity.type,
1342
+ legalEntityId: rootLegalEntity.id,
1343
+ name: getLegalEntityNameBasedOnType(rootLegalEntity)
1344
+ };
1345
+ };
1346
+ const getRootTrusteeTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => {
1347
+ const entityAssociations = trustLE.entityAssociations ?? [];
1348
+ const rootLegalEntityAssociations = entityAssociations.filter(
1349
+ (a) => a.legalEntityId === rootLegalEntity.id
1350
+ );
1351
+ const nonRootLegalEntityAssociations = entityAssociations.filter(
1352
+ (a) => a.legalEntityId !== rootLegalEntity.id
1353
+ );
1354
+ return [
1355
+ combineRootLegalEntityWithEntityAssociations(rootLegalEntity, rootLegalEntityAssociations),
1356
+ ...mapEntityAssociationsToTrustMembers(
1357
+ trustLE.id,
1358
+ nonRootLegalEntityAssociations ?? [],
1359
+ exemptSettlorLE
1360
+ ),
1361
+ ...mapUndefinedBeneficiaryInfoToTrustMembers(trustLE.trust?.undefinedBeneficiaryInfo ?? [])
1362
+ ];
1363
+ };
1364
+ function useTrustMembers() {
1365
+ const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
1366
+ const { data: trust } = useAssociatedLegalEntity(rootLegalEntity, LegalEntityTypes.TRUST);
1367
+ const { isExperimentEnabled } = useExperimentsContext();
1368
+ const exemptSettlor = useExemptSettlor({
1369
+ trust
1370
+ });
1371
+ const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
1372
+ return useMemo(() => {
1373
+ if (!rootLegalEntity || !trust?.trust) return [];
1374
+ return allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust, rootLegalEntity, exemptSettlor) : getTrustMembers(trust, rootLegalEntity, exemptSettlor);
1375
+ }, [rootLegalEntity, trust, exemptSettlor, allowMoreRolesForMainRootTrustee]);
1376
+ }
1377
+ const useTrustMemberNavigation = ({ navigateTo, trust }) => {
1378
+ const { t } = useTranslation("trust");
1379
+ const { showToast } = useToastContext();
1380
+ const [trustMember, setTrustMember] = useState();
1381
+ const { setTrustMembers } = useGlobalStore();
1382
+ const trustMembers = useTrustMembers();
1383
+ const memberId = trustMember?.trustMemberType === "undefinedBeneficiary" ? trustMember.reference : trustMember?.legalEntityId;
1384
+ useEffect(() => setTrustMembers(trustMembers), [trustMembers]);
1385
+ const onNavigateToTrustMemberEditDetails = async (tm) => {
1386
+ try {
1387
+ if (tm.legalEntityId === isNewEntity) {
1388
+ setTrustMember(tm);
1389
+ }
1390
+ navigateTo(
1391
+ tm.trustMemberType === "company" ? TaskTypes.TRUST_MEMBER_COMPANY : TaskTypes.TRUST_MEMBER_INDIVIDUAL
1392
+ );
1393
+ } catch {
1394
+ showToast({ label: t(($) => $["failedToFetchTrustMemberDetails"]), variant: "error" });
1395
+ }
1396
+ };
1397
+ const onNavigateToTrustMemberRoleAndType = (tm) => {
1398
+ setTrustMember(tm === "new" ? void 0 : tm);
1399
+ navigateTo(TaskTypes.TRUST_MEMBER_ROLE_AND_TYPE);
1400
+ };
1401
+ const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
1402
+ try {
1403
+ if (trust) {
1404
+ navigateTo(task);
1405
+ } else {
1406
+ navigateTo(TaskTypes.TRUST);
1407
+ }
1408
+ } catch {
1409
+ showToast({ label: t(($) => $["failedToFetchTrustDetails"]), variant: "error" });
1410
+ }
1411
+ };
1412
+ return {
1413
+ trustMember,
1414
+ trustMemberId: memberId === isNewEntity ? void 0 : memberId,
1415
+ // Do not pass Symbol('isNewEntity') as trustMemberId
1416
+ trustMembers,
1417
+ onNavigateToTrust,
1418
+ onNavigateToTrustMemberRoleAndType,
1419
+ onNavigateToTrustMemberEditDetails
1420
+ };
1421
+ };
1422
+ const createDefaultMember = (selectedMember, selectedEntityType, selectedRoles) => {
1423
+ const firstRole = selectedRoles?.[0];
1424
+ return {
1425
+ memberType: selectedMember?.memberType || firstRole,
1426
+ roles: selectedRoles || selectedMember?.roles || [UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER],
1427
+ legalEntityType: selectedEntityType,
1428
+ legalEntityId: selectedMember?.legalEntityId || "",
1429
+ name: selectedMember?.name || ""
1430
+ };
1431
+ };
1432
+ const useUnincorporatedPartnershipNavigation = ({ navigateTo }) => {
1433
+ const [activeMember, setActiveMember] = useState();
1434
+ const { rootLegalEntityId } = useApiContext();
1435
+ const onNavigateToMember = async ({
1436
+ selectedMember,
1437
+ selectedRoles,
1438
+ selectedEntityType,
1439
+ roleAndType
1440
+ }) => {
1441
+ const createdMember = createDefaultMember(selectedMember, selectedEntityType, selectedRoles);
1442
+ setActiveMember(createdMember);
1443
+ if (rootLegalEntityId.value === createdMember?.legalEntityId) {
1444
+ navigateTo(
1445
+ createdMember.legalEntityType === LegalEntityTypes.INDIVIDUAL ? TaskTypes.INDIVIDUAL : TaskTypes.BUSINESS_DETAILS
1446
+ );
1447
+ return;
1448
+ }
1449
+ if (roleAndType) {
1450
+ navigateTo(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_ROLE_AND_TYPE);
1451
+ return;
1452
+ }
1453
+ navigateTo(
1454
+ createdMember?.legalEntityType === LegalEntityTypes.ORGANIZATION ? TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY : TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL
1455
+ );
1456
+ };
1457
+ return {
1458
+ onNavigateToMember,
1459
+ activeMember,
1460
+ setActiveMember
1461
+ };
1462
+ };
1463
+ const useShouldShowIntroduction = ({
1464
+ legalEntity
1465
+ }) => {
1466
+ const canSeeIntroduction = useCanSeeIntroduction({ legalEntity });
1467
+ const { hasSeenIntroduction } = useHasSeenIntroduction({ legalEntityId: legalEntity.id });
1468
+ return canSeeIntroduction && !hasSeenIntroduction;
1469
+ };
1470
+ const useNavigation = ({ legalEntity, onNavigate }) => {
1471
+ const { isSettingEnabled } = useSettingsContext();
1472
+ const userEvents = useAnalyticsContext();
1473
+ const showServiceAgreementsFirst = isSettingEnabled(SettingNames.ShowServiceAgreementsFirst);
1474
+ const showBusinessFinancingFirst = isSettingEnabled(SettingNames.ShowBusinessFinancingFirst);
1475
+ const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
1476
+ const showIntroduction = useShouldShowIntroduction({ legalEntity });
1477
+ const { hasSeenSingpassSelection } = useHasSeenSingpassSelection({
1478
+ legalEntityId: legalEntity.id
1479
+ });
1480
+ const { accountHolder } = useAccountHolder();
1481
+ const { canSeeEntitySelection } = useCanSeeEntitySelection(legalEntity.id);
1482
+ const { isEligibleForSingpass } = useSingpassMyInfoLogin({
1483
+ legalEntity,
1484
+ accountHolder
1485
+ });
1486
+ const shouldShowSingpassSelection = isEligibleForSingpass && !hasSeenSingpassSelection;
1487
+ const [taskHistory, setTaskHistory] = useState(["default"]);
1488
+ const actualTasks = taskHistory.filter((task) => task !== "default");
1489
+ const handleNavigation = useCallback(
1490
+ (task) => {
1491
+ userEvents.updateBaseTrackingPayload({ task });
1492
+ onNavigate?.(task);
1493
+ },
1494
+ [onNavigate]
1495
+ );
1496
+ const navigateTo = useCallback(
1497
+ (task, deletePreviousHistory = false) => {
1498
+ const pushNewTask = () => setTaskHistory((taskHistory2) => deletePreviousHistory ? [task] : [...taskHistory2, task]);
1499
+ if (task === "default") {
1500
+ setTimeout(pushNewTask);
1501
+ } else {
1502
+ pushNewTask();
1503
+ handleNavigation(task);
1504
+ }
1505
+ },
1506
+ [handleNavigation]
1507
+ );
1508
+ const navigateBack = useCallback(
1509
+ (stepCount = 1) => {
1510
+ if (taskHistory.length <= 1) return;
1511
+ const prevTask = taskHistory[taskHistory.length - (stepCount + 1)];
1512
+ if (prevTask === "default") {
1513
+ throw Error("Cannot navigate back to 'default' task");
1514
+ }
1515
+ if (prevTask === TaskTypes.TASKS_OVERVIEW) {
1516
+ setTaskHistory([TaskTypes.TASKS_OVERVIEW]);
1517
+ handleNavigation?.(TaskTypes.TASKS_OVERVIEW);
1518
+ return;
1519
+ }
1520
+ setTaskHistory(taskHistory.slice(0, -1 * stepCount));
1521
+ handleNavigation?.(prevTask);
1522
+ userEvents.updateBaseTrackingPayload({ task: prevTask });
1523
+ },
1524
+ [taskHistory, handleNavigation]
1525
+ );
1526
+ useEffect(() => {
1527
+ if (!window.history.state) window.history.pushState({}, "");
1528
+ const handleBrowserBackButton = () => {
1529
+ if (window.history.state === null) window.history.pushState({}, "");
1530
+ navigateTo(TaskTypes.TASKS_OVERVIEW);
1531
+ };
1532
+ window.addEventListener("popstate", handleBrowserBackButton);
1533
+ return () => {
1534
+ window.removeEventListener("popstate", handleBrowserBackButton);
1535
+ };
1536
+ }, [navigateTo]);
1537
+ useEffect(() => {
1538
+ const pushedTask = taskHistory[taskHistory.length - 1];
1539
+ if (pushedTask === "default") {
1540
+ const defaultTask = getDefaultTask({
1541
+ legalEntity,
1542
+ canSeeEntitySelection,
1543
+ showIntroduction,
1544
+ canChangeEntityType,
1545
+ shouldShowSingpassSelection,
1546
+ showServiceAgreementsFirst,
1547
+ showBusinessFinancingFirst
1548
+ });
1549
+ setTaskHistory([...taskHistory.slice(0, taskHistory.length - 1), defaultTask]);
1550
+ }
1551
+ }, [
1552
+ legalEntity,
1553
+ accountHolder,
1554
+ showIntroduction,
1555
+ canChangeEntityType,
1556
+ shouldShowSingpassSelection,
1557
+ showServiceAgreementsFirst,
1558
+ taskHistory,
1559
+ showBusinessFinancingFirst
1560
+ ]);
1561
+ return {
1562
+ currentTask: actualTasks[actualTasks.length - 1],
1563
+ previousTask: actualTasks[actualTasks.length - 2],
1564
+ navigateBack,
1565
+ navigateTo
1566
+ };
1567
+ };
1568
+ const getDefaultTask = ({
1569
+ legalEntity,
1570
+ canSeeEntitySelection,
1571
+ canChangeEntityType,
1572
+ showIntroduction,
1573
+ shouldShowSingpassSelection,
1574
+ showServiceAgreementsFirst,
1575
+ showBusinessFinancingFirst
1576
+ }) => {
1577
+ const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
1578
+ if (showServiceAgreementsFirst) {
1579
+ return TaskTypes.SERVICE_AGREEMENT;
1580
+ }
1581
+ if (showBusinessFinancingFirst) {
1582
+ return TaskTypes.BUSINESS_FINANCING;
1583
+ }
1584
+ if (canChangeEntityType && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection)
1585
+ return TaskTypes.BUSINESS_TYPE_SELECTION;
1586
+ if (showIntroduction) return TaskTypes.INTRODUCTION;
1587
+ if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
1588
+ return TaskTypes.TASKS_OVERVIEW;
1589
+ };
1590
+ const hasProgressedBeyondEntitySelection = (legalEntity) => {
1591
+ const hasOwnEntityAssocation = legalEntity.entityAssociations?.some(
1592
+ (ea) => ea.associatorId === legalEntity.id
1593
+ );
1594
+ const hasOrganizationType = legalEntity.organization?.type;
1595
+ return hasOwnEntityAssocation || !!hasOrganizationType;
1596
+ };
1597
+ const Introduction = lazy(
1598
+ async () => (await import("./Introduction-DOxSVZ6X.js")).Introduction
1599
+ );
1600
+ const BusinessTypeSelectionPage = lazy(
1601
+ async () => (await import("./BusinessTypeSelectionPage-6Ltt53Mu.js")).BusinessTypeSelectionPage
1602
+ );
1603
+ const SingpassSelection = lazy(
1604
+ async () => (await import("./SingpassSelection-eruroIiQ.js")).SingpassSelection
1605
+ );
1606
+ const AccountSetupRejected = lazy(
1607
+ async () => (await import("./AccountSetupRejected-LAVhMMBt.js")).AccountSetupRejected
1608
+ );
1609
+ const DecisionMakers = lazy(
1610
+ async () => (await import("./DecisionMakers-B4qQ3M6Y.js")).DecisionMakers
1611
+ );
1612
+ const CustomerSupport = lazy(
1613
+ async () => (await import("./CustomerSupport-DLfbNC-J.js")).CustomerSupport
1614
+ );
1615
+ const Review = lazy(async () => (await import("./Review-gkTjl3a8.js")).Review);
1616
+ const SignPCIComponent = lazy(
1617
+ async () => (await import("./SignPCIComponent-DqElmjjG.js")).SignPCIComponent
1618
+ );
1619
+ const AcceptTermsOfService = lazy(
1620
+ async () => (await import("./AcceptTermsOfServiceComponent-T7eWi57Z.js")).AcceptTermsOfServiceComponent
1621
+ );
1622
+ const TaxReportingDropin = lazy(
1623
+ async () => (await import("./TaxReportingDropin-ajO0q4eZ.js")).TaxReportingDropin
1624
+ );
1625
+ const PayoutDetailsPage = lazy(
1626
+ async () => (await import("./PayoutDetailsDropin-lYVb5WCQ.js").then((n) => n.a)).PayoutDetailsPage
1627
+ );
1628
+ const RootBusinessDetailsPage = lazy(
1629
+ async () => (await import("./RootBusinessDetailsPage-DjwEzuLA.js")).RootBusinessDetailsPage
1630
+ );
1631
+ const RootBusinessLinesPage = lazy(
1632
+ async () => (await import("./RootBusinessLinesPage-2-U3mf6i.js")).RootBusinessLinesPage
1633
+ );
1634
+ const SoleProprietorshipPage = lazy(
1635
+ async () => (await import("./SoleProprietorshipPage-7YdzA7iH.js")).SoleProprietorshipPage
1636
+ );
1637
+ const TrustMemberCompanyPage = lazy(
1638
+ async () => (await import("./TrustMemberCompanyPage-CJj2BpXu.js")).TrustMemberCompanyPage
1639
+ );
1640
+ const TrustMemberIndividualPage = lazy(
1641
+ async () => (await import("./TrustMemberIndividualPage-BXp9RXDw.js")).TrustMemberIndividualPage
1642
+ );
1643
+ const TrustMemberRoleAndTypePage = lazy(
1644
+ async () => (await import("./TrustMemberRoleAndTypePage-gYJ5U6RH.js")).TrustMemberRoleAndTypePage
1645
+ );
1646
+ const TrustMembersOverview = lazy(
1647
+ async () => (await import("./TrustMembersOverview-Chmnt5jS.js")).TrustMembersOverview
1648
+ );
1649
+ const UnincorporatedPartnershipMemberCompanyPage = lazy(
1650
+ async () => (await import("./UnincorporatedPartnershipMemberCompanyPage-Bx0A5Bit.js")).UnincorporatedPartnershipMemberCompanyPage
1651
+ );
1652
+ const UnincorporatedPartnershipIndividualPage = lazy(
1653
+ async () => (await import("./UnincorporatedPartnershipIndividualPage-DckUiPPY.js")).UnincorporatedPartnershipIndividualPage
1654
+ );
1655
+ const UnincorporatedPartnershipMemberRoleAndTypePage = lazy(
1656
+ async () => (await import("./UnincorporatedPartnershipMemberRoleAndTypePage-CEE1hzIn.js")).UnincorporatedPartnershipMemberRoleAndTypePage
1657
+ );
1658
+ const UnincorporatedPartnershipMembersOverview = lazy(
1659
+ async () => (await import("./UnincorporatedPartnershipMembersOverview-wB8K9r6g.js")).UnincorporatedPartnershipMembersOverview
1660
+ );
1661
+ const BusinessFinancingPage = lazy(
1662
+ async () => (await import("./BusinessFinancingPage-DtX8x3Zp.js")).BusinessFinancingPage
1663
+ );
1664
+ const TrustDetailsPage = lazy(
1665
+ async () => (await import("./TrustDetailsPage-BWXZX4-u.js")).TrustDetailsPage
1666
+ );
1667
+ const SourceOfFundsPage = lazy(
1668
+ async () => (await import("./SourceOfFundsPage-C_wiSoc4.js")).SourceOfFundsPage
1669
+ );
1670
+ const RootIndividualDetailsPage = lazy(
1671
+ async () => (await import("./RootIndividualDetailsPage-BFYP63_i.js")).RootIndividualDetailsPage
1672
+ );
1673
+ const LegalRepresentativeDetailsPage = lazy(
1674
+ async () => (await import("./LegalRepresentativeDetailsPage-DOP3L2r9.js")).LegalRepresentativeDetailsPage
1675
+ );
1676
+ const DecisionMakerDetailsPage = lazy(
1677
+ async () => (await import("./DecisionMakerDetailsPage-BTR-hRwO.js")).DecisionMakerDetailsPage
1678
+ );
1679
+ function isIn(values, x) {
1680
+ return values.includes(x);
1681
+ }
1682
+ const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
1683
+ const logger = createLogger();
1684
+ function DropinComposer({
1685
+ legalEntityResponse,
1686
+ onSubmit,
1687
+ onNavigate = noop,
1688
+ openBankingPartnerConfigId
1689
+ }) {
1690
+ const { accountHolder, setAccountHolder } = useAccountHolder();
1691
+ const { setCanSeeEntitySelection } = useCanSeeEntitySelection(legalEntityResponse.id);
1692
+ const userEvents = useAnalyticsContext();
1693
+ const { experiments } = useExperimentsContext();
1694
+ const { setHasSeenSingpassSelection } = useHasSeenSingpassSelection({
1695
+ legalEntityId: legalEntityResponse.id
1696
+ });
1697
+ const { setHasSeenIntroduction } = useHasSeenIntroduction({
1698
+ legalEntityId: legalEntityResponse.id
1699
+ });
1700
+ const { currentTask, previousTask, navigateTo, navigateBack } = useNavigation({
1701
+ legalEntity: legalEntityResponse,
1702
+ onNavigate
1703
+ });
1704
+ const {
1705
+ rootLegalEntity: rootLegalEntitySignal,
1706
+ rootLegalEntityCountry: rootLegalEntityCountrySignal,
1707
+ taskTypes: taskTypesSignal,
1708
+ setRootLegalEntity,
1709
+ setTaskTypes,
1710
+ setAccountHolder: setAccountHolderInGlobalStore
1711
+ } = useGlobalStore();
1712
+ const rootLegalEntity = rootLegalEntitySignal.value;
1713
+ const rootLegalEntityCountry = rootLegalEntityCountrySignal.value;
1714
+ const taskTypes = taskTypesSignal.value;
1715
+ const { data: rawTaskTypes, isLoading: isLoadingConfiguration } = useTaskTypes();
1716
+ const { isSettingEnabled } = useSettingsContext();
1717
+ useEffect(() => {
1718
+ if (!rawTaskTypes) {
1719
+ return;
1720
+ }
1721
+ let filteredTasks = rawTaskTypes;
1722
+ if (!isSettingEnabled(SettingNames.AllowBusinessLines)) {
1723
+ filteredTasks = rawTaskTypes?.filter((task) => task !== TaskTypes.ACQUIRING_BUSINESS_LINE);
1724
+ }
1725
+ setTaskTypes(filteredTasks);
1726
+ }, [rawTaskTypes, setTaskTypes]);
1727
+ const { data: legalEntityData, refetch: refetchLegalEntity } = useLegalEntity(
1728
+ legalEntityResponse.id,
1729
+ {
1730
+ refetchInterval: (query) => {
1731
+ const legalEntityData2 = query.state.data;
1732
+ if (legalEntityData2) {
1733
+ return !currentTask || !isIn(PAGES_WITH_POLLING, currentTask) || hasAllCapabilitiesResolved(legalEntityData2) || hasRejectedCapabilities(legalEntityData2) ? false : 3e3;
1734
+ }
1735
+ return 3e3;
1736
+ }
1737
+ }
1738
+ );
1739
+ useEffect(() => {
1740
+ if (legalEntityData && !objectsDeepEqual(legalEntityData, rootLegalEntity)) {
1741
+ setRootLegalEntity(legalEntityData);
1742
+ }
1743
+ }, [legalEntityData]);
1744
+ const [currentTransferInstrumentId, setCurrentTransferInstrumentId] = useState();
1745
+ const {
1746
+ isEligibleForSingpass,
1747
+ state: singpassLoginState,
1748
+ handleInitiateSingpassMyInfoLogin,
1749
+ handleSingpassMyInfoLoginSuccess,
1750
+ handleSingpassMyInfoLoginFailure,
1751
+ handleSingpassMyInfoLoginReset
1752
+ } = useSingpassMyInfoLogin({
1753
+ legalEntity: rootLegalEntity,
1754
+ accountHolder
1755
+ });
1756
+ const singpassTabRef = useRef(null);
1757
+ const { data: trust, refetch: refetchTrust } = useAssociatedLegalEntity(
1758
+ rootLegalEntity,
1759
+ LegalEntityTypes.TRUST
1760
+ );
1761
+ const { data: unincorporatedPartnership, refetch: refetchUnincorporatedPartnership } = useAssociatedLegalEntity(rootLegalEntity, LegalEntityTypes.UNINCORPORATED_PARTNERSHIP);
1762
+ const { data: soleProp } = useAssociatedLegalEntity(
1763
+ rootLegalEntity,
1764
+ LegalEntityTypes.SOLE_PROPRIETORSHIP
1765
+ );
1766
+ const [parentId, setParentId] = useState();
1767
+ const [currentDecisionMakerId, setCurrentDecisionMakerId] = useState();
1768
+ const { data: currentDecisionMaker } = useLegalEntity(currentDecisionMakerId ?? skipToken);
1769
+ const associatedLegalRepresentative = useAssociatedLegalRepresentative(rootLegalEntity);
1770
+ const [targetLegalEntityType, setTargetLegalEntityType] = useState();
1771
+ const {
1772
+ trustMember,
1773
+ trustMemberId,
1774
+ onNavigateToTrust,
1775
+ onNavigateToTrustMemberRoleAndType,
1776
+ onNavigateToTrustMemberEditDetails
1777
+ } = useTrustMemberNavigation({
1778
+ trust,
1779
+ navigateTo
1780
+ });
1781
+ const {
1782
+ onNavigateToMember,
1783
+ activeMember: unincorporatedPartnershipMember,
1784
+ setActiveMember
1785
+ } = useUnincorporatedPartnershipNavigation({
1786
+ navigateTo
1787
+ });
1788
+ const handleSingpassSelectionNextClick = async (method) => {
1789
+ if (method === "singpass") {
1790
+ try {
1791
+ const authUrl = await handleInitiateSingpassMyInfoLogin();
1792
+ if (!authUrl) {
1793
+ throw new Error("OpenId authentication url not");
1794
+ }
1795
+ setHasSeenSingpassSelection(true);
1796
+ singpassTabRef.current = window.open(authUrl, "_blank");
1797
+ singpassTabRef.current?.focus();
1798
+ } catch (e) {
1799
+ logger.error(e);
1800
+ if (typeof e === "string") handleSingpassMyInfoLoginFailure(e);
1801
+ }
1802
+ }
1803
+ if (method === "manual") {
1804
+ setHasSeenSingpassSelection(true);
1805
+ }
1806
+ navigateTo(TaskTypes.TASKS_OVERVIEW);
1807
+ };
1808
+ const onNavigateToDecisionMakerIndividual = async (task, id, parentId2) => {
1809
+ setParentId(parentId2 ?? rootLegalEntity.id);
1810
+ setCurrentDecisionMakerId(id);
1811
+ navigateTo(task);
1812
+ };
1813
+ const onNavigateToPayinOrPayout = async (id, task = TaskTypes.PAYOUT) => {
1814
+ if (id) {
1815
+ try {
1816
+ setCurrentTransferInstrumentId(id);
1817
+ } finally {
1818
+ navigateTo(task);
1819
+ }
1820
+ } else {
1821
+ setCurrentTransferInstrumentId(void 0);
1822
+ navigateTo(task);
1823
+ }
1824
+ };
1825
+ const onNavigateToTask = async (task, id) => {
1826
+ switch (task) {
1827
+ case TaskTypes.PAYOUT:
1828
+ await onNavigateToPayinOrPayout(id, TaskTypes.PAYOUT);
1829
+ break;
1830
+ case TaskTypes.PAYIN:
1831
+ await onNavigateToPayinOrPayout(id, TaskTypes.PAYIN);
1832
+ break;
1833
+ case TaskTypes.TRUST: {
1834
+ await onNavigateToTrust();
1835
+ break;
1836
+ }
1837
+ case TaskTypes.TRUST_MEMBER_OVERVIEW: {
1838
+ await onNavigateToTrust(TaskTypes.TRUST_MEMBER_OVERVIEW);
1839
+ break;
1840
+ }
1841
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
1842
+ await navigateTo(TaskTypes.SOLE_PROPRIETOR_COMPANY);
1843
+ break;
1844
+ }
1845
+ default:
1846
+ navigateTo(task);
1847
+ }
1848
+ };
1849
+ const handleOnSubmit = async (data, backStepCount) => {
1850
+ onSubmit?.(data);
1851
+ await refetchLegalEntity();
1852
+ navigateBack(backStepCount);
1853
+ };
1854
+ useEffect(() => {
1855
+ userEvents.addJourneyEvent("Landed on page", { actionType: "start" });
1856
+ }, []);
1857
+ useEffect(() => {
1858
+ userEvents.updateBaseTrackingPayload({ task: currentTask });
1859
+ }, [currentTask]);
1860
+ useEffect(() => {
1861
+ if (hasRejectedCapabilities(rootLegalEntity)) {
1862
+ navigateTo(TaskTypes.CAPABILITY_REJECTED, true);
1863
+ }
1864
+ }, [rootLegalEntity]);
1865
+ useEffect(() => {
1866
+ const newAccountHolder = getDefaultAccountHolderType(rootLegalEntity, false, accountHolder);
1867
+ if (newAccountHolder !== accountHolder) setAccountHolder(newAccountHolder);
1868
+ }, [accountHolder, rootLegalEntity]);
1869
+ useEffect(() => setAccountHolderInGlobalStore(accountHolder), [accountHolder]);
1870
+ const { rootLegalEntityId } = useApiContext();
1871
+ rootLegalEntityId.value = rootLegalEntity.id;
1872
+ useEffect(() => {
1873
+ const enabledExperimentNames = Object.entries(experiments).filter(([key, value]) => key.includes("_") && value).map(([key]) => key);
1874
+ if (!enabledExperimentNames.length) return;
1875
+ enabledExperimentNames.forEach((experiment) => {
1876
+ const [name, variant] = experiment.split("_");
1877
+ userEvents.trackExperiment({ name, variant });
1878
+ });
1879
+ }, [experiments]);
1880
+ const singpassBanner = isEligibleForSingpass ? /* @__PURE__ */ jsx(
1881
+ SingpassBanner,
1882
+ {
1883
+ ...singpassLoginState,
1884
+ onAlertClose: () => {
1885
+ handleSingpassMyInfoLoginReset();
1886
+ },
1887
+ onClick: async () => {
1888
+ try {
1889
+ const authUrl = await handleInitiateSingpassMyInfoLogin();
1890
+ singpassTabRef.current = window.open(authUrl);
1891
+ singpassTabRef.current?.focus();
1892
+ } catch (e) {
1893
+ logger.error(e);
1894
+ if (typeof e === "string") handleSingpassMyInfoLoginFailure(e);
1895
+ }
1896
+ },
1897
+ onMessage: async ({ data: { isSuccessful } }) => {
1898
+ if (isSuccessful) {
1899
+ handleSingpassMyInfoLoginSuccess();
1900
+ await refetchLegalEntity();
1901
+ singpassTabRef.current?.close();
1902
+ } else {
1903
+ handleSingpassMyInfoLoginFailure(
1904
+ legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL ? "weCouldntConnectToMyinfo" : "weCouldntConnectToMyinfoBusiness"
1905
+ );
1906
+ }
1907
+ },
1908
+ legalEntityType: legalEntityResponse?.type
1909
+ }
1910
+ ) : void 0;
1911
+ if (isLoadingConfiguration) {
1912
+ return /* @__PURE__ */ jsx(Skeleton, {});
1913
+ }
1914
+ switch (currentTask) {
1915
+ case TaskTypes.BUSINESS_TYPE_SELECTION:
1916
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-display-flex adyen-kyc-u-justify-content-center", children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1917
+ BusinessTypeSelectionPage,
1918
+ {
1919
+ onComplete: async (newAccountHolder) => {
1920
+ setAccountHolder(newAccountHolder);
1921
+ setCanSeeEntitySelection(false);
1922
+ await refetchLegalEntity();
1923
+ navigateTo("default");
1924
+ },
1925
+ onBack: previousTask ? navigateBack : void 0
1926
+ }
1927
+ ) }) });
1928
+ case TaskTypes.SINGPASS_SELECTION:
1929
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1930
+ SingpassSelection,
1931
+ {
1932
+ handleNextClick: handleSingpassSelectionNextClick,
1933
+ accountHolder,
1934
+ legalEntityType: rootLegalEntity.type
1935
+ }
1936
+ ) });
1937
+ case TaskTypes.INTRODUCTION:
1938
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1939
+ Introduction,
1940
+ {
1941
+ onExitIntroduction: () => {
1942
+ setHasSeenIntroduction(true);
1943
+ navigateTo("default");
1944
+ },
1945
+ tasks: taskTypes
1946
+ }
1947
+ ) });
1948
+ case TaskTypes.CAPABILITY_REJECTED:
1949
+ return /* @__PURE__ */ jsxs(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: [
1950
+ /* @__PURE__ */ jsx(AccountSetupRejected, {}),
1951
+ ";"
1952
+ ] });
1953
+ case TaskTypes.TASKS_OVERVIEW:
1954
+ return /* @__PURE__ */ jsx(TaskList, { onNavigateToTask, singpassComponent: singpassBanner });
1955
+ case TaskTypes.DECISION_MAKER_OVERVIEW:
1956
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1957
+ DecisionMakers,
1958
+ {
1959
+ onNavigateToIndividual: (legalEntityId) => onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER, legalEntityId),
1960
+ navigateBackToTaskList: navigateBack
1961
+ }
1962
+ ) });
1963
+ case TaskTypes.INDIVIDUAL:
1964
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1965
+ RootIndividualDetailsPage,
1966
+ {
1967
+ onSubmit: async (data) => {
1968
+ onSubmit?.(data);
1969
+ await refetchLegalEntity();
1970
+ navigateTo(TaskTypes.TASKS_OVERVIEW);
1971
+ setTargetLegalEntityType(void 0);
1972
+ },
1973
+ handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW),
1974
+ isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.INDIVIDUAL
1975
+ }
1976
+ ) });
1977
+ case TaskTypes.CUSTOMER_SUPPORT:
1978
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1979
+ CustomerSupport,
1980
+ {
1981
+ country: rootLegalEntityCountry,
1982
+ onSubmit: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
1983
+ }
1984
+ ) });
1985
+ case TaskTypes.REVIEW:
1986
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(Review, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
1987
+ case TaskTypes.DECISION_MAKER:
1988
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
1989
+ DecisionMakerDetailsPage,
1990
+ {
1991
+ decisionMakerId: currentDecisionMaker?.id,
1992
+ parentCompanyId: parentId,
1993
+ onSubmit: async (data, scenario) => {
1994
+ onSubmit?.(data);
1995
+ await refetchLegalEntity();
1996
+ if (isBafinSignatoryFlow({
1997
+ taskType: TaskTypes.DECISION_MAKER,
1998
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1999
+ // @ts-ignore basicDetails will be there when it's IndividualOnfidoSchema
2000
+ data,
2001
+ scenarios: scenario
2002
+ })) {
2003
+ showIdNowModal.value = true;
2004
+ } else {
2005
+ navigateBack();
2006
+ }
2007
+ },
2008
+ handleHomeClick: navigateBack
2009
+ }
2010
+ ) });
2011
+ case TaskTypes.TRUST_MEMBER_COMPANY_OWNER:
2012
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2013
+ DecisionMakerDetailsPage,
2014
+ {
2015
+ taskType: TaskTypes.TRUST_MEMBER_COMPANY_OWNER,
2016
+ parentCompanyId: parentId,
2017
+ decisionMakerId: currentDecisionMakerId,
2018
+ onSubmit: async (data) => {
2019
+ await handleOnSubmit(data);
2020
+ await refetchTrust();
2021
+ },
2022
+ handleHomeClick: navigateBack
2023
+ }
2024
+ ) });
2025
+ case TaskTypes.TRUST_MEMBER_INDIVIDUAL:
2026
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2027
+ TrustMemberIndividualPage,
2028
+ {
2029
+ memberId: trustMemberId,
2030
+ trustId: trust.id,
2031
+ newMember: trustMember?.legalEntityId === isNewEntity ? trustMember : void 0,
2032
+ onSubmit: async (data) => {
2033
+ await handleOnSubmit(data, 2);
2034
+ await refetchTrust();
2035
+ },
2036
+ handleBackClick: navigateBack,
2037
+ handleHomeClick: () => navigateTo(TaskTypes.TRUST_MEMBER_OVERVIEW)
2038
+ }
2039
+ ) });
2040
+ case TaskTypes.TRUST_MEMBER_COMPANY:
2041
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2042
+ TrustMemberCompanyPage,
2043
+ {
2044
+ trustId: trust.id,
2045
+ trustMemberCompanyId: trustMemberId,
2046
+ newMember: trustMember?.legalEntityId === isNewEntity ? trustMember : void 0,
2047
+ onSubmit: async (data) => {
2048
+ await handleOnSubmit(data, 2);
2049
+ await refetchTrust();
2050
+ },
2051
+ handleHomeClick: navigateBack
2052
+ }
2053
+ ) });
2054
+ case TaskTypes.BUSINESS_DETAILS:
2055
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2056
+ RootBusinessDetailsPage,
2057
+ {
2058
+ onSubmit: async (data) => {
2059
+ onSubmit?.(data);
2060
+ await refetchLegalEntity();
2061
+ navigateTo(TaskTypes.TASKS_OVERVIEW);
2062
+ setTargetLegalEntityType(void 0);
2063
+ },
2064
+ handleHomeClick: navigateBack,
2065
+ isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.ORGANIZATION
2066
+ }
2067
+ ) });
2068
+ case TaskTypes.PAYOUT:
2069
+ case TaskTypes.PAYIN:
2070
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2071
+ PayoutDetailsPage,
2072
+ {
2073
+ taskType: currentTask,
2074
+ transferInstrumentId: currentTransferInstrumentId,
2075
+ setTransferInstrumentId: setCurrentTransferInstrumentId,
2076
+ handleHomeClick: navigateBack,
2077
+ openBankingPartnerConfigId,
2078
+ onSubmit: handleOnSubmit
2079
+ }
2080
+ ) });
2081
+ case TaskTypes.TRUST:
2082
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2083
+ TrustDetailsPage,
2084
+ {
2085
+ taskType: TaskTypes.TRUST,
2086
+ trustId: trust?.id,
2087
+ onSubmit: (data) => handleOnSubmit(data, 1),
2088
+ handleHomeClick: navigateBack
2089
+ }
2090
+ ) });
2091
+ case TaskTypes.TRUST_MEMBER_OVERVIEW:
2092
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2093
+ TrustMembersOverview,
2094
+ {
2095
+ navigateBackToTaskList: navigateBack,
2096
+ navigateToEditTrustMember: onNavigateToTrustMemberRoleAndType,
2097
+ navigateToEditTrustMemberOwner: (trustMemberOwnerId, trustMemberId2) => onNavigateToDecisionMakerIndividual(
2098
+ TaskTypes.TRUST_MEMBER_COMPANY_OWNER,
2099
+ trustMemberOwnerId,
2100
+ trustMemberId2
2101
+ )
2102
+ }
2103
+ ) });
2104
+ case TaskTypes.TRUST_MEMBER_ROLE_AND_TYPE:
2105
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2106
+ TrustMemberRoleAndTypePage,
2107
+ {
2108
+ trustId: trust.id,
2109
+ memberId: trustMemberId,
2110
+ navigateToFullDropinFor: onNavigateToTrustMemberEditDetails,
2111
+ navigateBack: async () => {
2112
+ await refetchTrust();
2113
+ navigateBack();
2114
+ }
2115
+ }
2116
+ ) });
2117
+ case TaskTypes.UNINCORPORATED_PARTNERSHIP:
2118
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2119
+ TrustDetailsPage,
2120
+ {
2121
+ taskType: TaskTypes.UNINCORPORATED_PARTNERSHIP,
2122
+ trustId: unincorporatedPartnership?.id,
2123
+ onSubmit: (data) => handleOnSubmit(data, 1),
2124
+ handleHomeClick: navigateBack
2125
+ }
2126
+ ) });
2127
+ case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW:
2128
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2129
+ UnincorporatedPartnershipMembersOverview,
2130
+ {
2131
+ navigateBackToTaskList: navigateBack,
2132
+ navigateToEditMember: (member) => onNavigateToMember({
2133
+ selectedMember: member,
2134
+ selectedEntityType: member?.legalEntityType,
2135
+ selectedRoles: member?.roles,
2136
+ roleAndType: true
2137
+ }),
2138
+ navigateToEditMemberOwner: (memberOwnerId, memberId) => {
2139
+ setActiveMember({ legalEntityId: memberId });
2140
+ onNavigateToDecisionMakerIndividual(
2141
+ TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER,
2142
+ memberOwnerId,
2143
+ memberId
2144
+ );
2145
+ }
2146
+ }
2147
+ ) });
2148
+ case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY:
2149
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2150
+ UnincorporatedPartnershipMemberCompanyPage,
2151
+ {
2152
+ partnershipId: unincorporatedPartnership.id,
2153
+ partnershipMemberCompanyId: unincorporatedPartnershipMember?.legalEntityId,
2154
+ newMember: (
2155
+ // empty string for legalEntityId means it's a new member
2156
+ unincorporatedPartnershipMember?.legalEntityId === "" ? unincorporatedPartnershipMember : void 0
2157
+ ),
2158
+ onSubmit: (data) => handleOnSubmit(data, 2),
2159
+ handleHomeClick: navigateBack
2160
+ }
2161
+ ) });
2162
+ case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER:
2163
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2164
+ DecisionMakerDetailsPage,
2165
+ {
2166
+ taskType: TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER,
2167
+ parentCompanyId: unincorporatedPartnershipMember?.legalEntityId,
2168
+ decisionMakerId: currentDecisionMakerId,
2169
+ onSubmit: async (data) => {
2170
+ await handleOnSubmit(data);
2171
+ await refetchUnincorporatedPartnership();
2172
+ },
2173
+ handleHomeClick: navigateBack
2174
+ }
2175
+ ) });
2176
+ case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL:
2177
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2178
+ UnincorporatedPartnershipIndividualPage,
2179
+ {
2180
+ memberId: unincorporatedPartnershipMember?.legalEntityId,
2181
+ partnershipId: unincorporatedPartnership.id,
2182
+ member: unincorporatedPartnershipMember,
2183
+ onSubmit: (data) => {
2184
+ handleOnSubmit(data, 2);
2185
+ refetchUnincorporatedPartnership();
2186
+ },
2187
+ handleBackClick: navigateBack,
2188
+ handleHomeClick: () => navigateTo(TaskTypes.TRUST_MEMBER_OVERVIEW)
2189
+ }
2190
+ ) });
2191
+ case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_ROLE_AND_TYPE:
2192
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2193
+ UnincorporatedPartnershipMemberRoleAndTypePage,
2194
+ {
2195
+ memberId: unincorporatedPartnershipMember?.legalEntityId,
2196
+ onNavigateToMember,
2197
+ navigateBack: async () => {
2198
+ await refetchUnincorporatedPartnership();
2199
+ navigateBack();
2200
+ }
2201
+ }
2202
+ ) });
2203
+ case TaskTypes.PCI_DSS:
2204
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(SignPCIComponent, { onClose: navigateBack }) });
2205
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY:
2206
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2207
+ SoleProprietorshipPage,
2208
+ {
2209
+ solePropId: soleProp?.id,
2210
+ onSubmit: (data) => handleOnSubmit(data, 1),
2211
+ handleHomeClick: navigateBack
2212
+ }
2213
+ ) });
2214
+ case TaskTypes.SERVICE_AGREEMENT:
2215
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2216
+ AcceptTermsOfService,
2217
+ {
2218
+ legalEntityId: rootLegalEntity.id,
2219
+ onClose: () => {
2220
+ userEvents.addPageEvent("Clicked button", {
2221
+ actionType: "back",
2222
+ label: "back"
2223
+ });
2224
+ navigateBack();
2225
+ },
2226
+ asEmbedded: false,
2227
+ handleAddSigner: () => {
2228
+ onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER);
2229
+ }
2230
+ }
2231
+ ) });
2232
+ case TaskTypes.LEGAL_REPRESENTATIVE_DETAILS:
2233
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2234
+ LegalRepresentativeDetailsPage,
2235
+ {
2236
+ legalRepresentativeId: associatedLegalRepresentative?.id,
2237
+ onSubmit: handleOnSubmit,
2238
+ handleHomeClick: navigateBack
2239
+ }
2240
+ ) });
2241
+ case TaskTypes.SOURCE_OF_FUNDS:
2242
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2243
+ SourceOfFundsPage,
2244
+ {
2245
+ onSubmit: handleOnSubmit,
2246
+ handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
2247
+ }
2248
+ ) });
2249
+ case TaskTypes.BUSINESS_FINANCING:
2250
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
2251
+ BusinessFinancingPage,
2252
+ {
2253
+ onSubmit: async (data) => {
2254
+ onSubmit?.(data);
2255
+ await refetchLegalEntity();
2256
+ navigateTo(TaskTypes.TASKS_OVERVIEW);
2257
+ },
2258
+ handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
2259
+ }
2260
+ ) });
2261
+ case TaskTypes.TAX_REPORTING:
2262
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(TaxReportingDropin, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
2263
+ case TaskTypes.ACQUIRING_BUSINESS_LINE:
2264
+ return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(RootBusinessLinesPage, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
2265
+ default:
2266
+ return null;
2267
+ }
2268
+ }
2269
+ function OnboardingDropinComponent({
2270
+ legalEntityId,
2271
+ openBankingPartnerConfigId
2272
+ }) {
2273
+ if (!legalEntityId) {
2274
+ throw new Error("Must provide at-least legalEntityId");
2275
+ }
2276
+ const { i18n } = useTranslation();
2277
+ addResourceBundles(i18n, [
2278
+ { ns: "common", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../../language/locales/bg-BG.json": () => import("./bg-BG-DVjwfSz4.js"), "../../../language/locales/cs-CZ.json": () => import("./cs-CZ-CLY9qYTs.js"), "../../../language/locales/da-DK.json": () => import("./da-DK-uHPPFvD-.js"), "../../../language/locales/de-DE.json": () => import("./de-DE-SMf6w4NJ.js"), "../../../language/locales/el-GR.json": () => import("./el-GR-wv99Y9Yf.js"), "../../../language/locales/en-US.instructions.json": () => import("./en-US.instructions-Ddr7AO05.js"), "../../../language/locales/en-US.json": () => import("./StoreProvider-D9IR5HNN.js").then((n) => n.bN), "../../../language/locales/es-ES.json": () => import("./es-ES-BqpvBqmR.js"), "../../../language/locales/et-EE.json": () => import("./et-EE-CAuCY0qn.js"), "../../../language/locales/fi-FI.json": () => import("./fi-FI-DPegZzTc.js"), "../../../language/locales/fr-FR.json": () => import("./fr-FR-BPGwsLDa.js"), "../../../language/locales/hr-HR.json": () => import("./hr-HR-DdqNL1pQ.js"), "../../../language/locales/hu-HU.json": () => import("./hu-HU-C1LJENXO.js"), "../../../language/locales/it-IT.json": () => import("./it-IT-B1eJg9RL.js"), "../../../language/locales/ja-JP.json": () => import("./ja-JP-PnqAHl14.js"), "../../../language/locales/lt-LT.json": () => import("./lt-LT-BmRnIfWs.js"), "../../../language/locales/lv-LV.json": () => import("./lv-LV-CX9j9Dtv.js"), "../../../language/locales/nl-NL.json": () => import("./nl-NL-cVVIDG7s.js"), "../../../language/locales/no-NO.json": () => import("./no-NO-C_tmZ39d.js"), "../../../language/locales/pl-PL.json": () => import("./pl-PL-DFZFSKZX.js"), "../../../language/locales/pt-BR.json": () => import("./pt-BR-CMiGlY3k.js"), "../../../language/locales/pt-PT.json": () => import("./pt-PT-DmdQxN_1.js"), "../../../language/locales/ro-RO.json": () => import("./ro-RO-B0slmyWK.js"), "../../../language/locales/sk-SK.json": () => import("./sk-SK-BptPuon4.js"), "../../../language/locales/sl-SI.json": () => import("./sl-SI-C3nGkfNb.js"), "../../../language/locales/sv-SE.json": () => import("./sv-SE-CXn28ybc.js") }), `../../../language/locales/${lang}.json`, 6) },
2279
+ { ns: "ui", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../ui/language/bg-BG.json": () => import("./bg-BG-CCwKQVVV.js"), "../../ui/language/cs-CZ.json": () => import("./cs-CZ-CVvNUABW.js"), "../../ui/language/da-DK.json": () => import("./da-DK-CoTdzXlA.js"), "../../ui/language/de-DE.json": () => import("./de-DE-z0cPgxGN.js"), "../../ui/language/el-GR.json": () => import("./el-GR-B9TRk3Pi.js"), "../../ui/language/en-US.json": () => import("./en-US-CjjPhkB5.js"), "../../ui/language/es-ES.json": () => import("./es-ES-DUn82eVS.js"), "../../ui/language/et-EE.json": () => import("./et-EE-CUXar-DY.js"), "../../ui/language/fi-FI.json": () => import("./fi-FI-C3TTCFBv.js"), "../../ui/language/fr-FR.json": () => import("./fr-FR-BbKadiaZ.js"), "../../ui/language/hr-HR.json": () => import("./hr-HR-D2LmWe5I.js"), "../../ui/language/hu-HU.json": () => import("./hu-HU-CFuBc8VP.js"), "../../ui/language/it-IT.json": () => import("./it-IT-CGhQqmiU.js"), "../../ui/language/ja-JP.json": () => import("./ja-JP-CvREJ56h.js"), "../../ui/language/lt-LT.json": () => import("./lt-LT-CZwu5zZ0.js"), "../../ui/language/lv-LV.json": () => import("./lv-LV-DVFCj1OR.js"), "../../ui/language/nl-NL.json": () => import("./nl-NL-OHlJx2bn.js"), "../../ui/language/no-NO.json": () => import("./no-NO-DEYydng4.js"), "../../ui/language/pl-PL.json": () => import("./pl-PL-DMbe5XnW.js"), "../../ui/language/pt-BR.json": () => import("./pt-BR-DWAziFjb.js"), "../../ui/language/pt-PT.json": () => import("./pt-PT-LP8g5mC9.js"), "../../ui/language/ro-RO.json": () => import("./ro-RO-BQSoJrlf.js"), "../../ui/language/sk-SK.json": () => import("./sk-SK-CwieqNyR.js"), "../../ui/language/sl-SI.json": () => import("./sl-SI-C5vfq7vv.js"), "../../ui/language/sv-SE.json": () => import("./sv-SE-BrO9NKWs.js") }), `../../ui/language/${lang}.json`, 5) }
2280
+ ]);
2281
+ const { data: legalEntityData } = useLegalEntity(ROOT_LE);
2282
+ return !legalEntityData ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsx(
2283
+ DropinComposer,
2284
+ {
2285
+ legalEntityResponse: legalEntityData,
2286
+ openBankingPartnerConfigId
2287
+ }
2288
+ );
2289
+ }
2290
+ export {
2291
+ OnboardingDropinComponent as O,
2292
+ TASK_STATUS_POLLING_INTERVAL_MS as T,
2293
+ usePciStatus as a,
2294
+ useCanSeeIntroduction as b,
2295
+ useLegalEntityType as c,
2296
+ allowIndividualWithoutSoleProp as d,
2297
+ useDataMissingRemediations as e,
2298
+ filterProblemsByTaskForms as f,
2299
+ useBusinessLines as g,
2300
+ useTaskStatus as h,
2301
+ usePciQuestionnaireList as i,
2302
+ useTrustMembers as j,
2303
+ isNewEntity as k,
2304
+ normalizedTaskStatusStore as n,
2305
+ useSalesChannels as u
2306
+ };