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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1012) hide show
  1. package/dist/4-people-DKuivE0m.js +35 -0
  2. package/dist/AcceptTermsOfServiceWorkflow-C3JrMbt5.js +28 -0
  3. package/dist/Accordion-Dgdxfe-d.js +112 -0
  4. package/dist/AccountSetupRejected-D63dyojj.js +19 -0
  5. package/dist/AdaptiveWorkflow-XhWdnJv-.js +33 -0
  6. package/dist/AdaptiveWorkflowComponent-pMWy1Vig.js +166 -0
  7. package/dist/AddressFields-BC3QHs2u.js +468 -0
  8. package/dist/Alert-Cc7p0N5h.js +172 -0
  9. package/dist/AnalyticsContext-CpimDlw4.js +21 -0
  10. package/dist/Avatar-oTPu6Ejy.js +54 -0
  11. package/dist/BusinessFinancingDropin-CxHK6KY3.js +1870 -0
  12. package/dist/BusinessFinancingPage-teAAjQl8.js +89 -0
  13. package/dist/BusinessRegistrationNumberField-DKka8aVU.js +103 -0
  14. package/dist/BusinessRegistrationNumberFieldGroup-Df6_sDA0.js +173 -0
  15. package/dist/BusinessTypeSelectionPage-BETJH6LZ.js +457 -0
  16. package/dist/Button-DPJ1k02w.js +108 -0
  17. package/dist/Checkbox-qfdF12cF.js +60 -0
  18. package/dist/ComponentGroup-SozxzKWw.js +32 -0
  19. package/dist/Confirm-DoN9R9Z3.js +77 -0
  20. package/dist/ConstitutionalDocument-Bxsr1hQb.js +1229 -0
  21. package/dist/ContactDetails-CiWftLi4.js +516 -0
  22. package/dist/ContextGuidance-BQPwRscq.js +29 -0
  23. package/dist/ContractViewer-CG9UNGz1.js +1030 -0
  24. package/dist/CountryField-DT6-Jr_b.js +38 -0
  25. package/dist/Currency-oeXHRWzy.js +211 -0
  26. package/dist/CustomerSupport-D0bE0zga.js +141 -0
  27. package/dist/DataConflictsModal-CCaMgguu.js +238 -0
  28. package/dist/DebugModal-Cvp7_Z-i.js +456 -0
  29. package/dist/DecisionMakerDetails-Bbb_8up2.js +569 -0
  30. package/dist/DecisionMakerDetailsPage-BDTMzs1X.js +121 -0
  31. package/dist/DecisionMakers-maoFXpGe.js +594 -0
  32. package/dist/Dropzone-ttbRg2LI.js +250 -0
  33. package/dist/EmbeddedStatus-CYd2p4sP.js +129 -0
  34. package/dist/EndStateLayout-zZPm8S5M.js +83 -0
  35. package/dist/EntityAssociation-C2_Xuvf5.js +163 -0
  36. package/dist/ErrorPanel-D4JNFkvi.js +205 -0
  37. package/dist/Field-DwDJQVSS.js +154 -0
  38. package/dist/FormFlow.module-DqMxjYHl.js +20 -0
  39. package/dist/GlobalEntryModal-CLoPJXFE.js +1203 -0
  40. package/dist/GlobalEntryPage-DNPSSZ3M.js +78 -0
  41. package/dist/Header-DVLlJ6we.js +93 -0
  42. package/dist/Icon-4XR6gZzk.js +175 -0
  43. package/dist/IdentityNumber-3V6ZqvHB.js +540 -0
  44. package/dist/IdentityNumberFieldGroup-CAjlgTWn.js +57 -0
  45. package/dist/IdentityScreeningWorkflow-CBStT1hs.js +307 -0
  46. package/dist/Image-Bn_Yyuof.js +33 -0
  47. package/dist/IndividualDropin-0t7Oj71F.js +4175 -0
  48. package/dist/IndustryCodeFieldGroup-C3Zro2ds.js +189 -0
  49. package/dist/InputDate-Bq3Sb-ZW.js +211 -0
  50. package/dist/InputText-CFDEmEtp.js +119 -0
  51. package/dist/Introduction-z2SqIq1W.js +326 -0
  52. package/dist/InvitedDecisionMakerComponent-CZOVc-t9.js +481 -0
  53. package/dist/JpAddressFields-F1YCOcbO.js +288 -0
  54. package/dist/LandingLayout-BsIoIFzs.js +76 -0
  55. package/dist/LegalCompanyNameField-Cosyjk52.js +108 -0
  56. package/dist/LegalName-CtqIpsfy.js +33 -0
  57. package/dist/LegalRepresentativeDetailsPage-DwIARCpj.js +73 -0
  58. package/dist/Link-CvYhseSD.js +32 -0
  59. package/dist/ListItem-CYTpdOMa.js +70 -0
  60. package/dist/Loader-BVtlpTeo.js +92 -0
  61. package/dist/LoaderWrapper-Dc88hY-P.js +34 -0
  62. package/dist/MaybeModal-C4ySaA8A.js +24 -0
  63. package/dist/Modal-CHES6970.js +109 -0
  64. package/dist/Name-CdCsijr5.js +61 -0
  65. package/dist/NewSummary-D55f70wB.js +73 -0
  66. package/dist/NodeRenderer-B3G7pvjG.js +185 -0
  67. package/dist/PatriotActDisclosure-DqUZeLms.js +266 -0
  68. package/dist/PayoutDetailsDropin-LKMpfono.js +4104 -0
  69. package/dist/PayoutDetailsPage-KNHCeXgk.js +69 -0
  70. package/dist/ProgressBar-DWFxLMUA.js +38 -0
  71. package/dist/RadioGroup-Bf3DlQnZ.js +47 -0
  72. package/dist/RadioWithLabel-DQIOEYpF.js +45 -0
  73. package/dist/Review-CS_-zAlg.js +99 -0
  74. package/dist/RootBusinessDetailsPage-1z2_FAb6.js +67 -0
  75. package/dist/RootBusinessLinesPage-BgbkJaW8.js +1464 -0
  76. package/dist/RootIndividualDetailsPage-DA4hh_gc.js +82 -0
  77. package/dist/Select-phAxjMBQ.js +782 -0
  78. package/dist/SignPCIComponent-tBnZMn1u.js +373 -0
  79. package/dist/SingpassSelection-B6_DsZtn.js +156 -0
  80. package/dist/SoleProprietorshipPage-2s1kA9ZV.js +69 -0
  81. package/dist/SourceOfFundsPage-CTjUdOWK.js +2800 -0
  82. package/dist/SourceOfFundsWorkflow-BZabOpi_.js +28 -0
  83. package/dist/StateContext-B2_Pqd_y.js +9 -0
  84. package/dist/StateField-BpMwetvd.js +55 -0
  85. package/dist/Step-C6XxGAda.js +191 -0
  86. package/dist/StructuredList-nPasiuLi.js +56 -0
  87. package/dist/Summary-DM31WxLr.js +235 -0
  88. package/dist/Task-DwGA1eXE.js +129 -0
  89. package/dist/TaskGroup-T594JSYM.js +46 -0
  90. package/dist/TaskListItem-Dx3hKOqG.js +123 -0
  91. package/dist/TaskStepperContextProvider-DdcsqXT7.js +26 -0
  92. package/dist/TaskVerificationStatus-DEXk_ndE.js +125 -0
  93. package/dist/TaxInformationField-CV7SpMH1.js +242 -0
  94. package/dist/TaxInformationFieldGroup-DI2LzuNr.js +290 -0
  95. package/dist/TaxReportingDropin-xYwJ-ju7.js +480 -0
  96. package/dist/TaxReportingWorkflow-BHyHgiI-.js +28 -0
  97. package/dist/TermsOfServiceManagement-CNQ4J5Gn.js +644 -0
  98. package/dist/TextArea-qGEo3PFG.js +81 -0
  99. package/dist/TileGroup-D1-M64Ul.js +172 -0
  100. package/dist/ToastContext-B_wd2IY2.js +13 -0
  101. package/dist/ToastContextProvider-DjYKMflX.js +103 -0
  102. package/dist/TrustDetailsPage-Byj68n3F.js +1172 -0
  103. package/dist/TrustMemberCompanyPage-Bcz4Ql7s.js +108 -0
  104. package/dist/TrustMemberIndividualPage-D6CgWF88.js +108 -0
  105. package/dist/TrustMemberRoleAndTypePage-IUp5FVRW.js +937 -0
  106. package/dist/TrustMembersOverview-7EoKoSMg.js +453 -0
  107. package/dist/UboTaskItem-BmcGj5_U.js +115 -0
  108. package/dist/UnincorporatedPartnershipIndividualPage-BKpJDhhU.js +78 -0
  109. package/dist/UnincorporatedPartnershipMemberCompanyPage-D8VliL0i.js +78 -0
  110. package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-D00bHhyf.js +256 -0
  111. package/dist/UnincorporatedPartnershipMembersOverview-Dw5IMSkd.js +160 -0
  112. package/dist/VerificationErrorAlert-CixajVtq.js +38 -0
  113. package/dist/Workflow-CWzMRGHX.js +228 -0
  114. package/dist/_rolldown_dynamic_import_helper-sGNwd-kR.js +14 -0
  115. package/dist/accountHolderUtils-CAu4V0ed.js +43 -0
  116. package/dist/adyen-business-financing.js +38 -37
  117. package/dist/adyen-individual-configuration.js +65 -65
  118. package/dist/adyen-individual-status.js +35 -34
  119. package/dist/adyen-invited-decision-maker.js +3 -3
  120. package/dist/adyen-onboarding.js +109 -101
  121. package/dist/adyen-terms-of-service-management.js +3 -3
  122. package/dist/adyen-terms-of-service-status.js +9 -8
  123. package/dist/adyen-transfer-instrument-configuration.js +62 -61
  124. package/dist/adyen-transfer-instrument-management.js +76 -70
  125. package/dist/adyen-verification-status.js +10 -8
  126. package/dist/arrow-right-D2hul7WG.js +20 -0
  127. package/dist/bafinUtils-DDrD6bfK.js +96 -0
  128. package/dist/bag-CRRS1aow.js +20 -0
  129. package/dist/bank-BoirCLLW.js +20 -0
  130. package/dist/bg-BG-B0Ia8sQm.js +7 -0
  131. package/dist/bg-BG-B2xaZ3wB.js +7 -0
  132. package/dist/bg-BG-DAR7_x2a.js +7 -0
  133. package/dist/bg-BG-DqfAUTUt.js +7 -0
  134. package/dist/bg-BG-ivZjQNJZ.js +7 -0
  135. package/dist/bin-BOmfqfrr.js +30 -0
  136. package/dist/birthDateUtils-D6uk7zwm.js +84 -0
  137. package/dist/businessRegistrationNumberPatterns-A08SLm03.js +982 -0
  138. package/dist/capital-DTjbiurV.js +23 -0
  139. package/dist/cash-stack-7KpYpBek.js +33 -0
  140. package/dist/certificate-BPuoJ6Ip.js +23 -0
  141. package/dist/checkmark-BiSLf8M1.js +20 -0
  142. package/dist/checkmark-circle-Ams7bSve.js +28 -0
  143. package/dist/checkmark-circle-fill-_p4ss4ac.js +30 -0
  144. package/dist/checkmark-small-3bw4ftPV.js +20 -0
  145. package/dist/chevron-down-GgZawvoy.js +20 -0
  146. package/dist/chevron-left-TeZTTvo5.js +20 -0
  147. package/dist/chevron-right-Cg8XlTxx.js +20 -0
  148. package/dist/chevron-up-COQUTli0.js +20 -0
  149. package/dist/circle-CypWzg83.js +30 -0
  150. package/dist/circle-small-filled-DfdK2A35.js +20 -0
  151. package/dist/clock-DmfGJ2r9.js +28 -0
  152. package/dist/coins-CBvbB8_X.js +30 -0
  153. package/dist/constants-C8yo0_RA.js +233 -0
  154. package/dist/contract-D1_RJ_xh.js +20 -0
  155. package/dist/countries-BGMTpyJv.js +41 -0
  156. package/dist/country-BEZkohEO.js +25 -0
  157. package/dist/cross-BORHADVQ.js +20 -0
  158. package/dist/cross-circle-fill-CUXdo1x-.js +30 -0
  159. package/dist/cross-circle-fill-small-DdoPZZeo.js +20 -0
  160. package/dist/cs-CZ-BwO4yrI4.js +7 -0
  161. package/dist/cs-CZ-CHMQYoMF.js +7 -0
  162. package/dist/cs-CZ-DsKlW7_D.js +7 -0
  163. package/dist/cs-CZ-NVntX32n.js +7 -0
  164. package/dist/cs-CZ-ywYpJk1F.js +7 -0
  165. package/dist/da-DK-BvT8Ob4A.js +7 -0
  166. package/dist/da-DK-BzBfkSME.js +7 -0
  167. package/dist/da-DK-CE7jnGea.js +7 -0
  168. package/dist/da-DK-DH5YNYFM.js +7 -0
  169. package/dist/da-DK-LPtdP8h0.js +7 -0
  170. package/dist/datasetUtil-BdHPWsxZ.js +45 -0
  171. package/dist/de-DE-C9cUCFOi.js +7 -0
  172. package/dist/de-DE-Cn866nnd.js +7 -0
  173. package/dist/de-DE-DA4LpyZI.js +7 -0
  174. package/dist/de-DE-DKkoZQ0X.js +7 -0
  175. package/dist/de-DE-DY_EJohI.js +7 -0
  176. package/dist/de-DE-vdy64knk.js +7 -0
  177. package/dist/debouncedInputEvent-Fwwp_K_-.js +54 -0
  178. package/dist/debugStore-Dwn1FXrh.js +9 -0
  179. package/dist/decision-makers-group-iEF9oKPp.js +2673 -0
  180. package/dist/decisionMakerRoles-C6LMC4mh.js +185 -0
  181. package/dist/document-1-qvV57JdS.js +20 -0
  182. package/dist/document-person-DiJ7M8-D.js +28 -0
  183. package/dist/download-Ca4w0Yfr.js +23 -0
  184. package/dist/dropinUtils-DTBezwYT.js +491 -0
  185. package/dist/edit-1-D8VhDchs.js +20 -0
  186. package/dist/el-GR-ChapyKa7.js +7 -0
  187. package/dist/el-GR-Cvms0L4K.js +7 -0
  188. package/dist/el-GR-D9PjIB9j.js +7 -0
  189. package/dist/el-GR-Ov9hqMNe.js +7 -0
  190. package/dist/el-GR-aelq5Q0a.js +7 -0
  191. package/dist/el-GR-zFv0QxMR.js +7 -0
  192. package/dist/en-US-B7HQdrn_.js +7 -0
  193. package/dist/en-US-CI7y0UEH.js +7 -0
  194. package/dist/en-US-C_VjFvk_.js +7 -0
  195. package/dist/en-US-Cz4JoU20.js +41 -0
  196. package/dist/en-US-DPr5RN3e.js +7 -0
  197. package/dist/en-US-U0d3NI20.js +7 -0
  198. package/dist/en-US-tFsDZf7y.js +7 -0
  199. package/dist/entityAssociationUtil-CY0grcyH.js +58 -0
  200. package/dist/error-BvgoQFEI.js +36 -0
  201. package/dist/es-ES-BQrdtEfn.js +7 -0
  202. package/dist/es-ES-BdByhG4y.js +7 -0
  203. package/dist/es-ES-BzlHKYJK.js +7 -0
  204. package/dist/es-ES-DCUvAmKI.js +7 -0
  205. package/dist/es-ES-DdrA8McY.js +7 -0
  206. package/dist/es-ES-DhkTbihW.js +7 -0
  207. package/dist/es-LA-3WgncmHx.js +7 -0
  208. package/dist/es-LA-BxtxM3Ty.js +7 -0
  209. package/dist/es-LA-ChRHGYJP.js +7 -0
  210. package/dist/es-LA-JRuDva0n.js +7 -0
  211. package/dist/es-LA-i7tKJmA8.js +7 -0
  212. package/dist/et-EE-BXY66vAz.js +7 -0
  213. package/dist/et-EE-D8TSvkoE.js +7 -0
  214. package/dist/et-EE-DOgb4q9o.js +7 -0
  215. package/dist/et-EE-HHgM0CfO.js +7 -0
  216. package/dist/et-EE-V-YOCgoh.js +7 -0
  217. package/dist/external-link-Dy4le-8Q.js +20 -0
  218. package/dist/fi-FI-B-eTv4bG.js +7 -0
  219. package/dist/fi-FI-CClpbvJJ.js +7 -0
  220. package/dist/fi-FI-CVBmM-U1.js +7 -0
  221. package/dist/fi-FI-DCYPQ6vS.js +7 -0
  222. package/dist/fi-FI-DCbhu29J.js +7 -0
  223. package/dist/fieldConfigurations-CZCFghnK.js +11 -0
  224. package/dist/form-rules-B0RwhsVw.js +284 -0
  225. package/dist/formFieldsUtils-CnDkgahc.js +7 -0
  226. package/dist/formUtils-BHgG8yQZ.js +52 -0
  227. package/dist/formUtils-DVDcdZsP.js +84 -0
  228. package/dist/formatCurrency-BetgkQKi.js +23 -0
  229. package/dist/formatValidationError-q_w9DTrl.js +23 -0
  230. package/dist/fr-FR-B-jA_cbo.js +7 -0
  231. package/dist/fr-FR-BIyJL6Jj.js +7 -0
  232. package/dist/fr-FR-BzyefnBh.js +7 -0
  233. package/dist/fr-FR-C1xYwHeC.js +7 -0
  234. package/dist/fr-FR-D0hY9V44.js +7 -0
  235. package/dist/fr-FR-Doo1FVx-.js +7 -0
  236. package/dist/genUtils-nphCwt1A.js +60 -0
  237. package/dist/getDefaultRegistrationNumberType-CIu4WMln.js +1056 -0
  238. package/dist/getFormSlice-C1ma6Xd4.js +21 -0
  239. package/dist/getLegalEntityCountry-BK-HHa65.js +15 -0
  240. package/dist/getName-DgxRqagk.js +34 -0
  241. package/dist/getProblemsForEntity-Bn6dXidE.js +16 -0
  242. package/dist/getTrustedDecisionMakers-Ta-pURcL.js +25 -0
  243. package/dist/getTrustedFields-BJ88GlM-.js +28 -0
  244. package/dist/gift-Bs_mAgul.js +20 -0
  245. package/dist/globalStore-WASei98w.js +418 -0
  246. package/dist/graph-Co0JhGiY.js +32 -0
  247. package/dist/graph-up-DIvH9haf.js +38 -0
  248. package/dist/headquarter-BESfDGKh.js +42 -0
  249. package/dist/hotel-Vne7G5M6.js +33 -0
  250. package/dist/hr-HR-6Wj5Tf60.js +7 -0
  251. package/dist/hr-HR-B4FRVzrd.js +7 -0
  252. package/dist/hr-HR-B6z7-PYE.js +7 -0
  253. package/dist/hr-HR-BOYktLQ2.js +7 -0
  254. package/dist/hr-HR-Ct_41fWV.js +7 -0
  255. package/dist/http-fdIO--pH.js +204 -0
  256. package/dist/hu-HU-B7ofWKn_.js +7 -0
  257. package/dist/hu-HU-Bwm4UqZz.js +7 -0
  258. package/dist/hu-HU-CO_7jvk9.js +7 -0
  259. package/dist/hu-HU-CgJ_F3l2.js +7 -0
  260. package/dist/hu-HU-DXK7B0r_.js +7 -0
  261. package/dist/image-BQM21XCk.js +23 -0
  262. package/dist/info-DExoPRH5.js +32 -0
  263. package/dist/info-filled-11KMeUso.js +32 -0
  264. package/dist/invalidateRootLegalEntity-BHaVREw-.js +45 -0
  265. package/dist/isEmpty-Uewyl-r6.js +14 -0
  266. package/dist/isEmptyEntity-3OHnhXqG.js +43 -0
  267. package/dist/it-IT-BFIW0DCO.js +7 -0
  268. package/dist/it-IT-CNr6PIu3.js +7 -0
  269. package/dist/it-IT-CQVFYSVx.js +7 -0
  270. package/dist/it-IT-DfGdOsTs.js +7 -0
  271. package/dist/it-IT-DgRuEpeD.js +7 -0
  272. package/dist/it-IT-tZ7dP-Ia.js +7 -0
  273. package/dist/ja-JP--tMJF7eu.js +7 -0
  274. package/dist/ja-JP-BjMyxZiN.js +7 -0
  275. package/dist/ja-JP-Ct54-uwM.js +7 -0
  276. package/dist/ja-JP-CtX9NZKD.js +7 -0
  277. package/dist/ja-JP-DAClbueM.js +7 -0
  278. package/dist/ja-JP-DOuEAOlh.js +7 -0
  279. package/dist/keys-Ce8YnRP2.js +20 -0
  280. package/dist/legalArrangementUtils-C68JdH6I.js +114 -0
  281. package/dist/listToRecord-DumSkYDz.js +10 -0
  282. package/dist/location-zRH5zJ8c.js +23 -0
  283. package/dist/lt-LT-BUuouq_-.js +7 -0
  284. package/dist/lt-LT-Cs3cvyKf.js +7 -0
  285. package/dist/lt-LT-DQp7UGdC.js +7 -0
  286. package/dist/lt-LT-DoYCfhZU.js +7 -0
  287. package/dist/lt-LT-DqtpAjOg.js +7 -0
  288. package/dist/lv-LV-BCXqSzkk.js +7 -0
  289. package/dist/lv-LV-BW0BscAd.js +7 -0
  290. package/dist/lv-LV-C3p57pZV.js +7 -0
  291. package/dist/lv-LV-ZmyUvPst.js +7 -0
  292. package/dist/lv-LV-cKvnQI3j.js +7 -0
  293. package/dist/mail-i1-zg-cv.js +20 -0
  294. package/dist/mapAddressLocalizationToJpAddressSchema-DpOIaxj6.js +26 -0
  295. package/dist/mapExistingFile-BkwRTTRm.js +55 -0
  296. package/dist/mapJpAddressSchemaToAddressLocalizations-D3VO2nhc.js +74 -0
  297. package/dist/mapLegalEntityToIndividualSchema-CBKR-InO.js +251 -0
  298. package/dist/mapScriptLocalization-BCfkZo1y.js +46 -0
  299. package/dist/mapTransferInstrumentToPayoutAccount-ROfaTly6.js +44 -0
  300. package/dist/maskHelpers-C0wnCoJl.js +719 -0
  301. package/dist/minus-circle-filled-CxUdRO8J.js +30 -0
  302. package/dist/nl-NL-B77Xr99l.js +7 -0
  303. package/dist/nl-NL-BUwMAW5C.js +7 -0
  304. package/dist/nl-NL-B_MaTF5h.js +7 -0
  305. package/dist/nl-NL-CePL3t7P.js +7 -0
  306. package/dist/nl-NL-DR5SCDAF.js +7 -0
  307. package/dist/nl-NL-DqGE4Nz5.js +7 -0
  308. package/dist/no-NO-BePxpMbr.js +7 -0
  309. package/dist/no-NO-DGCfRiU8.js +7 -0
  310. package/dist/no-NO-DdI2BI_e.js +7 -0
  311. package/dist/no-NO-P8SZ1t-h.js +7 -0
  312. package/dist/no-NO-oL1v_O9N.js +7 -0
  313. package/dist/options-horizontal-D86T_xAF.js +30 -0
  314. package/dist/partner-Dje0ykF6.js +30 -0
  315. package/dist/patternValidators-DsrZkuOO.js +73 -0
  316. package/dist/pay-by-link-plane-DAiddPu6.js +33 -0
  317. package/dist/payout-DKiGv3F9.js +38 -0
  318. package/dist/pdf-CC8vqpTo.js +22320 -0
  319. package/dist/pdf.worker.min-CdKJICZZ.js +75124 -0
  320. package/dist/person-DgALGIIz.js +23 -0
  321. package/dist/pl-PL-6Q3Ue3F5.js +7 -0
  322. package/dist/pl-PL-B5PBixAB.js +7 -0
  323. package/dist/pl-PL-BCkw9R28.js +7 -0
  324. package/dist/pl-PL-BY6KUTBO.js +7 -0
  325. package/dist/pl-PL-D-s-JI6X.js +7 -0
  326. package/dist/plus-DlQKP2C9.js +20 -0
  327. package/dist/plus-circle-filled-BntUOVIJ.js +30 -0
  328. package/dist/processCapabilities-CWE5UFt8.js +870 -0
  329. package/dist/processValidationErrors-CjsNfiRK.js +62 -0
  330. package/dist/pt-BR-B_XHiDCU.js +7 -0
  331. package/dist/pt-BR-BvNR77Ru.js +7 -0
  332. package/dist/pt-BR-CrLCMcSz2.js +7 -0
  333. package/dist/pt-BR-MrUfWW4a.js +7 -0
  334. package/dist/pt-BR-vwt2tE7H.js +7 -0
  335. package/dist/pt-PT-B17is9TY.js +7 -0
  336. package/dist/pt-PT-BZNPd_Tb.js +7 -0
  337. package/dist/pt-PT-DDYnXawl.js +7 -0
  338. package/dist/pt-PT-DhF8wwYH.js +7 -0
  339. package/dist/pt-PT-Du2K44jh.js +7 -0
  340. package/dist/pt-PT-qAzFgjvF.js +7 -0
  341. package/dist/recurring-DZgT_ekJ.js +23 -0
  342. package/dist/resolveEnvironment-B3aGkYuN.js +1000 -0
  343. package/dist/revenue-accelerate-aMLYFVW6.js +30 -0
  344. package/dist/ro-RO-B3Fcn95o.js +7 -0
  345. package/dist/ro-RO-BA5GhaCE.js +7 -0
  346. package/dist/ro-RO-BmHe4pZ-.js +7 -0
  347. package/dist/ro-RO-DChAv29z.js +7 -0
  348. package/dist/ro-RO-W1t7Mnbn.js +7 -0
  349. package/dist/roleMetadata-Dm1FVuPT.js +56 -0
  350. package/dist/save-uDNye08N.js +20 -0
  351. package/dist/search-0OS6oe8N.js +30 -0
  352. package/dist/show-BWoS9-Y1.js +23 -0
  353. package/dist/sk-SK-BeNF_m_j.js +7 -0
  354. package/dist/sk-SK-C9CiQLgt.js +7 -0
  355. package/dist/sk-SK-CISCMQ2G.js +7 -0
  356. package/dist/sk-SK-CcoUWnJ4.js +7 -0
  357. package/dist/sk-SK-D10Kpths.js +7 -0
  358. package/dist/sl-SI-Bxu4m_5e.js +7 -0
  359. package/dist/sl-SI-DCMml0lX.js +7 -0
  360. package/dist/sl-SI-DmYiMn91.js +7 -0
  361. package/dist/sl-SI-DxomO9JQ.js +7 -0
  362. package/dist/sl-SI-Qe4hzx5a.js +7 -0
  363. package/dist/solution-payments-BMal7uJZ.js +20 -0
  364. package/dist/store-N7ZA4FKy.js +20 -0
  365. package/dist/style.css +2341 -2252
  366. package/dist/styles-DYaAeu4q.js +2337 -2248
  367. package/dist/summaryItem-uDWmtYtt.js +16 -0
  368. package/dist/sv-SE-B-CXDaXM.js +7 -0
  369. package/dist/sv-SE-BzPNBHOj.js +7 -0
  370. package/dist/sv-SE-C9SgeFv6.js +7 -0
  371. package/dist/sv-SE-DESDUMyu.js +7 -0
  372. package/dist/sv-SE-Dq6oK7B5.js +7 -0
  373. package/dist/sv-SE-issaSBHd.js +7 -0
  374. package/dist/terminal-1-0RlQpbUC.js +30 -0
  375. package/dist/toFullWidth-Dgy4X4i8.js +52 -0
  376. package/dist/translation-DbATp_35.js +684 -0
  377. package/dist/trustUtil-5cyXiJnX.js +98 -0
  378. package/dist/types/adaptiveWorkflow/components/Fields/TaxInformation/TaxIdTypeSelectorField.d.ts +1 -2
  379. package/dist/types/adaptiveWorkflow/components/Fields/TaxInformation/TaxInformationFieldGroup.d.ts +1 -2
  380. package/dist/types/adaptiveWorkflow/utils/utils.d.ts +1 -1
  381. package/dist/types/api/configurations/useScenarios.d.ts +1 -1
  382. package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +12 -12
  383. package/dist/types/api/documentValidation/useDocumentValidate.d.ts +2 -2
  384. package/dist/types/api/documents/documents.types.d.ts +9 -0
  385. package/dist/types/api/documents/useCreateDocument.d.ts +10 -3
  386. package/dist/types/api/documents/useDeleteDocument.d.ts +1 -1
  387. package/dist/types/api/documents/useDocument.d.ts +1 -1
  388. package/dist/types/api/documents/useDocuments.d.ts +10 -2
  389. package/dist/types/api/documents/useUpdateDocument.d.ts +3 -3
  390. package/dist/types/api/invitedEntity/getInvitedEntityProblems.d.ts +1 -1
  391. package/dist/types/api/legalEntity/legalEntity.types.d.ts +32 -0
  392. package/dist/types/api/legalEntity/useLegalEntity.d.ts +92 -92
  393. package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +14 -14
  394. package/dist/types/api/taskStatus/useTaskStatuses.d.ts +1 -1
  395. package/dist/types/api/transferInstruments/transferInstruments.types.d.ts +18 -0
  396. package/dist/types/api/transferInstruments/useCreateTransferInstrument.d.ts +2 -2
  397. package/dist/types/api/transferInstruments/useTransferInstrument.d.ts +1 -1
  398. package/dist/types/api/transferInstruments/useUpdateTransferInstrument.d.ts +2 -2
  399. package/dist/types/api/transferInstruments/useUpdateTrustedTransferInstrument.d.ts +1 -1
  400. package/dist/types/components/Apps/tasks/TaskList/TaskList.d.ts +1 -1
  401. package/dist/types/components/BankAccount/fields/BankAccountNumber/fieldConfig.d.ts +2 -0
  402. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +1 -1
  403. package/dist/types/components/BankAccount/forms/PayoutAccount/types.d.ts +1 -1
  404. package/dist/types/components/BankAccount/forms/PayoutCountryDetails/types.d.ts +1 -1
  405. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +1 -1
  406. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +1 -1
  407. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/AccountHolderDescriptionFragment.d.ts +1 -1
  408. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/types.d.ts +1 -1
  409. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/utils.d.ts +1 -1
  410. package/dist/types/components/BankAccount/mapping/mapPayoutAccountSchemaToApiBankAccount.d.ts +2 -2
  411. package/dist/types/components/BankAccount/mapping/mapPayoutDetailsToTransferInstrument.d.ts +3 -3
  412. package/dist/types/components/BankAccount/mapping/mapPayoutDocumentsToApiDocuments.d.ts +2 -2
  413. package/dist/types/components/BankAccount/mapping/mapTransferInstrumentToPayoutAccount.d.ts +1 -1
  414. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +8 -4
  415. package/dist/types/components/BankAccount/tasks/PayoutAccount/PayoutAccountTaskListItem.d.ts +2 -2
  416. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +1 -1
  417. package/dist/types/components/Business/hooks/useBusinessDetailsData.d.ts +1 -1
  418. package/dist/types/components/Business/hooks/useSubmitBusinessDetails.types.d.ts +1 -1
  419. package/dist/types/components/Business/mapping/businessDetails/businessDetailsKeyMappings.d.ts +4 -4
  420. package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +4 -4
  421. package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +1 -1
  422. package/dist/types/components/Business/mapping/businessDetails/solePropBusinessDetailsKeyMappings.d.ts +4 -4
  423. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -1
  424. package/dist/types/components/Business/utils/buildRequiredForms.d.ts +1 -1
  425. package/dist/types/components/Business/utils/getAvailableCompanyStructures.d.ts +1 -2
  426. package/dist/types/components/Business/utils/utils.d.ts +2 -15
  427. package/dist/types/components/BusinessLines/tasks/types.d.ts +1 -1
  428. package/dist/types/components/Contract/tasks/PciDropin/types.d.ts +1 -1
  429. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -1
  430. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +33 -33
  431. package/dist/types/components/EFP/mapping/mapBusinessFinancingToLegalEntity.d.ts +2 -2
  432. package/dist/types/components/EFP/mapping/mapLegalEntityToBusinessFinancing.d.ts +2 -2
  433. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +3 -3
  434. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +3 -4
  435. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsGettingStarted/SourceOfFundsGettingStarted.d.ts +2 -3
  436. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsUploader/SourceOfFundsUpload.d.ts +1 -1
  437. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +1 -3
  438. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +13 -5
  439. package/dist/types/components/EFP/tasks/TaxReportingDropin/TaxReportingGettingStarted.d.ts +2 -2
  440. package/dist/types/components/EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent.d.ts +1 -1
  441. package/dist/types/components/EmbeddedDropins/ManageIndividualComponent/ManageIndividualComponent.d.ts +1 -1
  442. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentComponent.d.ts +1 -1
  443. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverview/ManageTransferInstrumentOverview.d.ts +1 -2
  444. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItem/ManageTransferInstrumentOverviewItem.d.ts +1 -2
  445. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +1 -2
  446. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/types.d.ts +1 -1
  447. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/ViewVerificationStatusComponent.d.ts +1 -1
  448. package/dist/types/components/GlobalEntry/companyTypeMetadata.d.ts +10 -0
  449. package/dist/types/components/GlobalEntry/forms/CompanyStructure/CompanyStructure.d.ts +3 -0
  450. package/dist/types/components/GlobalEntry/forms/CompanyStructure/types.d.ts +10 -0
  451. package/dist/types/components/GlobalEntry/forms/RegistrationInformation/RegistrationInformation.d.ts +1 -1
  452. package/dist/types/components/GlobalEntry/mapping/globalEntryKeyMapping.d.ts +15 -0
  453. package/dist/types/components/GlobalEntry/mapping/mapGlobalEntrySchemaToLegalEntity.d.ts +6 -0
  454. package/dist/types/components/GlobalEntry/mapping/mapLegalEntityToGlobalEntrySchema.d.ts +9 -0
  455. package/dist/types/components/GlobalEntry/rules.d.ts +1 -0
  456. package/dist/types/components/GlobalEntry/tasks/GlobalEntry.d.ts +1 -1
  457. package/dist/types/components/GlobalEntry/tasks/GlobalEntryModal.d.ts +1 -1
  458. package/dist/types/components/GlobalEntry/tasks/types.d.ts +2 -0
  459. package/dist/types/components/GlobalEntry/utils/buildRequiredForms.d.ts +16 -0
  460. package/dist/types/components/GlobalEntry/utils/getAvailableCompanyStructures.d.ts +12 -0
  461. package/dist/types/components/GlobalEntry/utils/submitGlobalEntry.d.ts +20 -0
  462. package/dist/types/components/GlobalEntry/utils/utils.d.ts +18 -0
  463. package/dist/types/components/GlobalEntry/validate.d.ts +3 -1
  464. package/dist/types/components/Individual/forms/BasicDetails/BasicDetails.types.d.ts +3 -3
  465. package/dist/types/components/Individual/forms/IdDocumentUpload/types.d.ts +1 -1
  466. package/dist/types/components/Individual/forms/IdNowVerificationModal/isIdNowModalOpen.d.ts +8 -8
  467. package/dist/types/components/Individual/forms/Individual.types.d.ts +2 -3
  468. package/dist/types/components/Individual/helpers/bafinUtils.d.ts +3 -4
  469. package/dist/types/components/Individual/helpers/findRelevantTaxInformation.d.ts +28 -0
  470. package/dist/types/components/Individual/helpers/hasLiveSelfieError.d.ts +11 -0
  471. package/dist/types/components/Individual/helpers/isManualVerificationOrExistingDoc.d.ts +13 -0
  472. package/dist/types/components/Individual/mapping/individualKeyMappings.d.ts +4 -4
  473. package/dist/types/components/Individual/mapping/mapIndividualDocumentToApiDocument.d.ts +2 -2
  474. package/dist/types/components/Individual/mapping/mapIndividualSchemaToLegalEntity.d.ts +2 -2
  475. package/dist/types/components/Individual/mapping/mapLegalEntityToIndividualSchema.d.ts +1 -1
  476. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +1 -1
  477. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +34 -10
  478. package/dist/types/components/Individual/tasks/DecisionMakers/getTrustedDecisionMakers.d.ts +2 -3
  479. package/dist/types/components/Individual/tasks/DecisionMakers/hooks/useTaskStatusWithTimeout.d.ts +1 -0
  480. package/dist/types/components/Individual/tasks/DecisionMakers/types.d.ts +2 -3
  481. package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
  482. package/dist/types/components/Shared/EntityAssociation/types.d.ts +2 -2
  483. package/dist/types/components/Shared/Introduction/Introduction.d.ts +1 -1
  484. package/dist/types/components/Shared/Introduction/IntroductionScreen.d.ts +1 -1
  485. package/dist/types/components/Shared/Introduction/constants.d.ts +1 -1
  486. package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
  487. package/dist/types/components/Shared/SingpassBanner/SingpassBanner.d.ts +1 -1
  488. package/dist/types/components/Shared/SingpassSelection/types.d.ts +1 -1
  489. package/dist/types/components/Shared/devex/DebugListener/debugInfo.d.ts +1 -2
  490. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/RegistrationNumberTypeSelector/getDefaultRegistrationNumberType.d.ts +1 -2
  491. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/TaxIdNumberTypeSelector.d.ts +1 -2
  492. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/findExistingTaxInformation.d.ts +10 -0
  493. package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +3 -4
  494. package/dist/types/components/Shared/fields/TaxInformationField/taxIdNumberTypes.d.ts +107 -8
  495. package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +7 -6
  496. package/dist/types/components/Shared/fields/VatNumberField/VatNumberTypeSelector/VatNumberTypeSelector.d.ts +1 -2
  497. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  498. package/dist/types/components/Shared/forms/BusinessTypeSelection/types.d.ts +1 -1
  499. package/dist/types/components/Shared/forms/BusinessTypeSelection/useUpdateLegalEntityAndSelectAccountHolder.d.ts +1 -2
  500. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +2 -4
  501. package/dist/types/components/Shared/forms/ConstitutionalDocument/types.d.ts +1 -1
  502. package/dist/types/components/Shared/forms/DocumentUpload/types.d.ts +1 -1
  503. package/dist/types/components/Shared/tasks/CustomerSupport/mapping/customerSupportKeyMapping.d.ts +2 -2
  504. package/dist/types/components/Trust/hooks/useExemptSettlor.d.ts +1 -1
  505. package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +1 -1
  506. package/dist/types/components/Trust/mapping/mapLegalEntityToTrust.d.ts +1 -1
  507. package/dist/types/components/Trust/mapping/mapTrustDocumentToApiDocument.d.ts +2 -2
  508. package/dist/types/components/Trust/mapping/mapTrustToLegalEntity.d.ts +2 -2
  509. package/dist/types/components/Trust/mapping/trustKeyMappings.d.ts +4 -4
  510. package/dist/types/components/Trust/mapping/trustMembers/getTrustMembers.d.ts +1 -1
  511. package/dist/types/components/Trust/mapping/trustMembers/mapEntityAssociationsToTrustMembers.d.ts +3 -4
  512. package/dist/types/components/Trust/mapping/trustMembers/mapRootLegalEntityToTrustMember.d.ts +1 -1
  513. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/types.d.ts +1 -1
  514. package/dist/types/components/Trust/tasks/TrustDropin/types.d.ts +1 -1
  515. package/dist/types/components/Trust/tasks/TrustMembers/types.d.ts +3 -4
  516. package/dist/types/components/Trust/utils/addOrUpdateAssociatedTrustMember.d.ts +1 -1
  517. package/dist/types/components/Trust/utils/addOrUpdateUndefinedBeneficiary.d.ts +1 -1
  518. package/dist/types/components/Trust/utils/createExemptSettlor.d.ts +1 -1
  519. package/dist/types/components/Trust/utils/deleteAssociatedTrustMember.d.ts +1 -1
  520. package/dist/types/components/Trust/utils/deleteUndefinedBeneficiary.d.ts +1 -1
  521. package/dist/types/components/Trust/utils/trustUtil.d.ts +5 -6
  522. package/dist/types/components/Trust/utils/updateExemptSettlorName.d.ts +1 -1
  523. package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +1 -2
  524. package/dist/types/components/UnincorporatedPartnership/mapping/mapLegalEntityToUnincorporatedPartnership.d.ts +1 -1
  525. package/dist/types/components/UnincorporatedPartnership/mapping/mapUnincorporatedPartnershipToLegalEntity.d.ts +2 -2
  526. package/dist/types/components/UnincorporatedPartnership/mapping/unincorporatedPartnershipKeyMappings.d.ts +3 -3
  527. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipMembers/types.d.ts +1 -2
  528. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/types.d.ts +1 -2
  529. package/dist/types/components/UnincorporatedPartnership/utils/unincorporatedPartnershipMembers.d.ts +3 -4
  530. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +1 -1
  531. package/dist/types/context/ToggleContext/types.d.ts +0 -4
  532. package/dist/types/core/errorMapping.d.ts +3 -4
  533. package/dist/types/core/models/api/accountIdentification.d.ts +5 -1
  534. package/dist/types/core/models/api/legal-entity-association.d.ts +0 -19
  535. package/dist/types/core/process-field-configurations.d.ts +4 -6
  536. package/dist/types/core/user-events.d.ts +2 -4
  537. package/dist/types/hooks/introduction/useCanSeeIntroduction.d.ts +1 -1
  538. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +1 -1
  539. package/dist/types/hooks/introduction/useShouldShowIntroduction.d.ts +1 -1
  540. package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +1 -1
  541. package/dist/types/hooks/useAssociatedLegalEntity.d.ts +1 -2
  542. package/dist/types/hooks/useAssociatedLegalRepresentative.d.ts +1 -1
  543. package/dist/types/hooks/useBusinessSetup.d.ts +1 -1
  544. package/dist/types/hooks/useForm/types.d.ts +1 -2
  545. package/dist/types/hooks/useLegalEntityType.d.ts +1 -2
  546. package/dist/types/hooks/useScenarioConfiguration.d.ts +1 -1
  547. package/dist/types/router/DefaultRouteRedirect.d.ts +1 -1
  548. package/dist/types/router/OnboardingRouter.d.ts +1 -2
  549. package/dist/types/router/getDefaultTask.d.ts +1 -1
  550. package/dist/types/stores/globalStore/calculateTaskStatus.d.ts +3 -5
  551. package/dist/types/stores/globalStore/determineTaskIdentifiers.d.ts +3 -5
  552. package/dist/types/stores/globalStore/get-task-status.d.ts +4 -4
  553. package/dist/types/stores/globalStore/globalStore.d.ts +3 -5
  554. package/dist/types/stores/globalStore/isEmptyEntity.d.ts +1 -1
  555. package/dist/types/types/businessEntityType.d.ts +1 -2
  556. package/dist/types/types/errors/capability-problems.d.ts +5 -1
  557. package/dist/types/types/errors/entity-problems.d.ts +8 -5
  558. package/dist/types/types/form-rules.d.ts +1 -1
  559. package/dist/types/utils/accountHolderUtils.d.ts +1 -1
  560. package/dist/types/utils/addLinkedFields.d.ts +2 -2
  561. package/dist/types/utils/analytics/debouncedInputEvent.d.ts +4 -4
  562. package/dist/types/utils/analytics/getAnalyticsAssociatedEntityDetails.d.ts +2 -3
  563. package/dist/types/utils/analytics/getPrefilledDetails.d.ts +2 -2
  564. package/dist/types/utils/api/documentUtils.d.ts +21 -10
  565. package/dist/types/utils/api/getProblemsForEntity.d.ts +1 -1
  566. package/dist/types/utils/api/processCapabilities.d.ts +11 -4
  567. package/dist/types/utils/bankUtils.d.ts +5 -0
  568. package/dist/types/utils/birthDateUtils.d.ts +6 -1
  569. package/dist/types/utils/businessUtils.d.ts +21 -6
  570. package/dist/types/utils/customerSupportUtils.d.ts +2 -3
  571. package/dist/types/utils/decisionMakerRoles.d.ts +4 -5
  572. package/dist/types/utils/entityAssociationUtil.d.ts +21 -12
  573. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  574. package/dist/types/utils/getFieldsWithExistingData.d.ts +2 -2
  575. package/dist/types/utils/getLegalEntityCountry.d.ts +1 -1
  576. package/dist/types/utils/getName.d.ts +3 -3
  577. package/dist/types/utils/getTrustedFields.d.ts +4 -5
  578. package/dist/types/utils/mapping/documentGuidanceMap.d.ts +2 -2
  579. package/dist/types/utils/mapping/getPage.d.ts +3 -4
  580. package/dist/types/utils/mapping/mappingRecord.d.ts +1 -1
  581. package/dist/types/utils/roleMetadata.d.ts +1 -1
  582. package/dist/types/utils/unincorporatedParnershipUtils.d.ts +4 -4
  583. package/dist/types-B9zXzag-.js +18 -0
  584. package/dist/types-BA3bcGAv.js +58 -0
  585. package/dist/types-CZAHRt31.js +147 -0
  586. package/dist/types-Cwq1JAWT.js +31 -0
  587. package/dist/upload-C5NC1E4N.js +23 -0
  588. package/dist/uppercase-DvjwUM0n.js +7 -0
  589. package/dist/useAccountHolder-DDto9d9n.js +102 -0
  590. package/dist/useAdaptiveWorkflow-DryNv0zI.js +28 -0
  591. package/dist/useAllowedCountries-C-nqVePW.js +80 -0
  592. package/dist/useAnalyticsContext-gSnRnYgV.js +12 -0
  593. package/dist/useAssociatedLegalEntity-DtZtKlls.js +35 -0
  594. package/dist/useBusinessDetailsData-DFU0dLxw.js +4732 -0
  595. package/dist/useBusinessLines-BZfFqvS_.js +27 -0
  596. package/dist/useCanSeeIntroduction-DQbanJNE.js +38 -0
  597. package/dist/useCreateLegalEntity-qP7MeAmi.js +24 -0
  598. package/dist/useDataMissingRemediations-ttUrk09_.js +39 -0
  599. package/dist/useDataset-CdLBLq98.js +98 -0
  600. package/dist/useDeleteTransferInstrument-Dtv14H9I.js +31 -0
  601. package/dist/useForm-CWrbJG44.js +504 -0
  602. package/dist/useHideTaskStepper-Dk7ZQ3U8.js +26 -0
  603. package/dist/useId-BkDhUta2.js +28 -0
  604. package/dist/useIndustryCodes-BMK6IMiW.js +32 -0
  605. package/dist/useLegalEntity-DHA8TJeV.js +48 -0
  606. package/dist/useMultiForm-BxASst0O.js +790 -0
  607. package/dist/useNavigate-CO1Mcekp.js +246 -0
  608. package/dist/useOnboardingStatus-Cz6-hSX4.js +23 -0
  609. package/dist/usePciQuestionnaireList-CWz7Ngs6.js +26 -0
  610. package/dist/useSalesChannels-bV9DgyLW.js +47 -0
  611. package/dist/useScenarios-Bn93htbx.js +55 -0
  612. package/dist/useSettingsContext-9O3Aqpfq.js +12 -0
  613. package/dist/useTaskLandedEvent-DwZHcMEQ.js +26 -0
  614. package/dist/useTaskStatus-DJxOWvuN.js +23 -0
  615. package/dist/useTermsOfServiceStatus-CyVxYqpg.js +39 -0
  616. package/dist/useToastContext-B6Mqc2HY.js +12 -0
  617. package/dist/useToggleContext-B_YexrbT.js +21 -0
  618. package/dist/useTrustMembers-DWo3WU8M.js +151 -0
  619. package/dist/useUnincorporatedPartnershipMembers-DwFPW09D.js +69 -0
  620. package/dist/useUpdateBusinessLines-JRPjqoe9.js +43 -0
  621. package/dist/useUpdateLegalEntity-CqmqXsbR.js +29 -0
  622. package/dist/utils-BWumuCvl.js +210 -0
  623. package/dist/utils-CJcGZvj1.js +178 -0
  624. package/dist/utils-CYUYe54m.js +24 -0
  625. package/dist/utils-Ck_mZapQ.js +1755 -0
  626. package/dist/utils-DdHbAadK.js +80 -0
  627. package/dist/utils-SKYT7xU4.js +52 -0
  628. package/dist/validate-BZ1-ZeKr.js +430 -0
  629. package/dist/validate-DTz70AWN.js +224 -0
  630. package/dist/validate-DUcT-JGF.js +178 -0
  631. package/dist/validate-Dr8UKZCX.js +126 -0
  632. package/dist/validateExtractionResult-CntKbt8c.js +343 -0
  633. package/dist/validationError-DV6t8Ubb.js +55 -0
  634. package/dist/validationResult-bjYBDjbU.js +29 -0
  635. package/dist/validatorUtils-D2O6AAZn.js +106 -0
  636. package/dist/warning-circle-fill-C2lMYPJW.js +30 -0
  637. package/dist/warning-diamond-filled-CQ2DdW5g.js +30 -0
  638. package/dist/webinar-BpZWqd-g.js +33 -0
  639. package/package.json +26 -26
  640. package/dist/4-people-Dxu4nHSX.js +0 -35
  641. package/dist/AcceptTermsOfServiceWorkflow-CvKbU2WY.js +0 -28
  642. package/dist/Accordion-Sjyj7C_t.js +0 -112
  643. package/dist/AccountSetupRejected-Cq_nlmLn.js +0 -18
  644. package/dist/AdaptiveWorkflow-CM7ZVGXv.js +0 -210
  645. package/dist/AdaptiveWorkflowComponent-tM1hJ1zF.js +0 -165
  646. package/dist/AddressFields-BsxEdBvQ.js +0 -464
  647. package/dist/Avatar-Zp1T9qAL.js +0 -54
  648. package/dist/BusinessFinancingDropin-vugW4Vvi.js +0 -1857
  649. package/dist/BusinessFinancingPage-0J_LImeN.js +0 -89
  650. package/dist/BusinessRegistrationNumberField-qdC_srMn.js +0 -101
  651. package/dist/BusinessRegistrationNumberFieldGroup-BvC9n4ou.js +0 -171
  652. package/dist/BusinessTypeSelectionPage-WCEqP4G2.js +0 -457
  653. package/dist/Button-DfRmINzF.js +0 -108
  654. package/dist/Checkbox-B730k3Yy.js +0 -108
  655. package/dist/ComponentGroup-CsnkYMbT.js +0 -32
  656. package/dist/ConstitutionalDocument-D92EPGmG.js +0 -1224
  657. package/dist/ContactDetails-DDSd6X0z.js +0 -511
  658. package/dist/ContextGuidance-B2ew1lzC.js +0 -29
  659. package/dist/ContractViewer-JtnAXSDa.js +0 -979
  660. package/dist/Currency-BKTf95Wp.js +0 -210
  661. package/dist/CustomerSupport-CCFayyJG.js +0 -140
  662. package/dist/DataConflictsModal-D-fP_eNs.js +0 -237
  663. package/dist/DebugModal-CG6CvUnj.js +0 -450
  664. package/dist/DecisionMakerDetails-DWC1nORL.js +0 -565
  665. package/dist/DecisionMakerDetailsPage-BVXA74FO.js +0 -122
  666. package/dist/DecisionMakers-Cvm_i6Uf.js +0 -589
  667. package/dist/Dropzone-CNHxDEc3.js +0 -250
  668. package/dist/EmbeddedStatus-tbJfdxm8.js +0 -129
  669. package/dist/EndStateLayout-BK1Hh02g.js +0 -83
  670. package/dist/EntityAssociation-i903L9Dh.js +0 -163
  671. package/dist/ErrorPanel-tnFOlOZU.js +0 -205
  672. package/dist/GlobalEntryModal-DQoIIvGS.js +0 -975
  673. package/dist/GlobalEntryPage-DLRGPpAu.js +0 -78
  674. package/dist/Icon-C3S5_kkS.js +0 -175
  675. package/dist/IdentityNumber-B8MXzXsO.js +0 -536
  676. package/dist/IdentityNumberFieldGroup-D7xb2TY7.js +0 -57
  677. package/dist/IdentityScreeningWorkflow-BdGXtdns.js +0 -307
  678. package/dist/Image-D82terx4.js +0 -33
  679. package/dist/IndividualDropin-C0vTSDYU.js +0 -4138
  680. package/dist/IndustryCodeFieldGroup-CGcE5yYR.js +0 -188
  681. package/dist/InputDate-Ci60MBrH.js +0 -211
  682. package/dist/InputText-CTpVF0Mu.js +0 -154
  683. package/dist/Introduction-Dx6DDaL7.js +0 -327
  684. package/dist/InvitedDecisionMakerComponent-Ckd26d6Y.js +0 -481
  685. package/dist/JpAddressFields-C9MbL5XV.js +0 -287
  686. package/dist/LegalCompanyNameField-D0jM5LDT.js +0 -108
  687. package/dist/LegalName-TjhII9_p.js +0 -33
  688. package/dist/LegalRepresentativeDetailsPage-CvGtANu3.js +0 -74
  689. package/dist/Link-c2jAgGgc.js +0 -32
  690. package/dist/ListItem-C35r8558.js +0 -93
  691. package/dist/Loader-BEpMlKm2.js +0 -92
  692. package/dist/Modal-BsivDPTd.js +0 -129
  693. package/dist/Name-DMf8Uyof.js +0 -61
  694. package/dist/NewSummary-DxWLTnJy.js +0 -73
  695. package/dist/PatriotActDisclosure-ChZ_ePr2.js +0 -265
  696. package/dist/PayoutDetailsDropin-BhtJSFAS.js +0 -4073
  697. package/dist/PayoutDetailsPage-MW5Pygp2.js +0 -70
  698. package/dist/RadioGroup-D8DRUJ2o.js +0 -1806
  699. package/dist/Review-DImhCvoG.js +0 -99
  700. package/dist/RootBusinessDetailsPage-Cmh9Z_4g.js +0 -68
  701. package/dist/RootBusinessLinesPage-C_p-CtCH.js +0 -1455
  702. package/dist/RootIndividualDetailsPage-04cJ6C15.js +0 -80
  703. package/dist/Select-ByVcS_J2.js +0 -1093
  704. package/dist/SignPCIComponent-CAwp2xCC.js +0 -370
  705. package/dist/SingpassSelection-Txx3gp_g.js +0 -157
  706. package/dist/SoleProprietorshipPage-CWegllTo.js +0 -70
  707. package/dist/SourceOfFundsPage-B22iW1ow.js +0 -2781
  708. package/dist/SourceOfFundsWorkflow-BKHZbLR_.js +0 -28
  709. package/dist/StateField-CsO_28Co.js +0 -296
  710. package/dist/Step-BUMarnLL.js +0 -191
  711. package/dist/Task-Bj_CjiHG.js +0 -129
  712. package/dist/TaskGroup-BMXhoq1Y.js +0 -46
  713. package/dist/TaskListItem-BIKdDEzU.js +0 -123
  714. package/dist/TaskStepperContextProvider-D0tKJplv.js +0 -26
  715. package/dist/TaskVerificationStatus-DPA4ZEPa.js +0 -125
  716. package/dist/TaxInformationFieldGroup-D_6IRGj9.js +0 -287
  717. package/dist/TaxReportingDropin-DA475crP.js +0 -475
  718. package/dist/TaxReportingWorkflow-kcto0Ysw.js +0 -28
  719. package/dist/TermsOfServiceManagement-HDnaIeWZ.js +0 -635
  720. package/dist/TextArea-qbFhi8Az.js +0 -81
  721. package/dist/TrustDetailsPage-BqVS0xOU.js +0 -1155
  722. package/dist/TrustMemberCompanyPage-DTe7xWpj.js +0 -109
  723. package/dist/TrustMemberIndividualPage-C1BDs9Rm.js +0 -110
  724. package/dist/TrustMemberRoleAndTypePage-GXWuitmt.js +0 -927
  725. package/dist/TrustMembersOverview-BjJ5fPcC.js +0 -449
  726. package/dist/UboTaskItem-Aq3iNKX0.js +0 -115
  727. package/dist/UnincorporatedPartnershipIndividualPage-DdPh2_sa.js +0 -79
  728. package/dist/UnincorporatedPartnershipMemberCompanyPage-h3OTr_91.js +0 -79
  729. package/dist/UnincorporatedPartnershipMemberRoleAndTypePage-CwemN4fL.js +0 -254
  730. package/dist/UnincorporatedPartnershipMembersOverview-CUczPfUl.js +0 -158
  731. package/dist/VerificationErrorAlert-BBfoLMwb.js +0 -64
  732. package/dist/Workflow-Do7P-qDn.js +0 -228
  733. package/dist/accountHolderUtils-DMi_DHCU.js +0 -44
  734. package/dist/arrow-right-Bk-ewsex.js +0 -20
  735. package/dist/bafinUtils-M2AASP_e.js +0 -1963
  736. package/dist/bag-9BNq_QQO.js +0 -20
  737. package/dist/bank-BRbxxVK5.js +0 -20
  738. package/dist/bg-BG-BtgA44Ui.js +0 -7
  739. package/dist/bg-BG-DX5QKxJz.js +0 -7
  740. package/dist/bg-BG-DYkxVgeJ.js +0 -7
  741. package/dist/bg-BG-K6LIkCdf.js +0 -7
  742. package/dist/bg-BG-uuNDTOoN.js +0 -7
  743. package/dist/bin-DE1613_5.js +0 -30
  744. package/dist/businessRegistrationNumberPatterns-C_MSKHlF.js +0 -981
  745. package/dist/capital-aNk7ragc.js +0 -23
  746. package/dist/cash-stack-DuKKc4Qj.js +0 -33
  747. package/dist/certificate-9gDKvXCm.js +0 -23
  748. package/dist/checkmark-BuqDN4WO.js +0 -20
  749. package/dist/checkmark-circle-OqcwA6N6.js +0 -28
  750. package/dist/checkmark-circle-fill-BfcUovCf.js +0 -30
  751. package/dist/checkmark-small-CBORXg_J.js +0 -20
  752. package/dist/chevron-down-CjRta08O.js +0 -20
  753. package/dist/chevron-left-BEm04mIh.js +0 -20
  754. package/dist/chevron-right-B2GkHG0J.js +0 -20
  755. package/dist/chevron-up-BKfe5Btb.js +0 -20
  756. package/dist/circle-C-uuRI8F.js +0 -30
  757. package/dist/circle-small-filled-Bkh5_ZEu.js +0 -20
  758. package/dist/clock-BWfWiMxz.js +0 -28
  759. package/dist/coins-Cw-jDTUz.js +0 -30
  760. package/dist/constants-BSBlqXY7.js +0 -231
  761. package/dist/contract-PFVBW8xa.js +0 -20
  762. package/dist/countries-BE4iGVAo.js +0 -41
  763. package/dist/country-zZC2TAQB.js +0 -25
  764. package/dist/cross-B37j1-r4.js +0 -20
  765. package/dist/cross-circle-fill-CcjwpLj2.js +0 -30
  766. package/dist/cross-circle-fill-small-CJ4fddNo.js +0 -20
  767. package/dist/cs-CZ-BJSrh3Vp.js +0 -7
  768. package/dist/cs-CZ-CMXGY6Ep.js +0 -7
  769. package/dist/cs-CZ-Ci8c58xJ.js +0 -7
  770. package/dist/cs-CZ-Cu1v5FA8.js +0 -7
  771. package/dist/cs-CZ-lJQmuyHq.js +0 -7
  772. package/dist/da-DK-B9O3xbY6.js +0 -7
  773. package/dist/da-DK-BNwXg4DX.js +0 -7
  774. package/dist/da-DK-C1kmOHvo.js +0 -7
  775. package/dist/da-DK-D53M_d04.js +0 -7
  776. package/dist/da-DK-DjAV5d9A.js +0 -7
  777. package/dist/de-DE-B3sSNcDv.js +0 -7
  778. package/dist/de-DE-C9N6F5oM.js +0 -7
  779. package/dist/de-DE-CjMOQMqQ.js +0 -7
  780. package/dist/de-DE-qJPTCQlG.js +0 -7
  781. package/dist/de-DE-qSBQE-6M.js +0 -7
  782. package/dist/de-DE-w4l6boYT.js +0 -7
  783. package/dist/decision-makers-group-DAoxQRJ3.js +0 -4169
  784. package/dist/decisionMakerRoles-APTR-Ah_.js +0 -185
  785. package/dist/document-1-B3vw8uuK.js +0 -20
  786. package/dist/document-person-CERdIfH0.js +0 -28
  787. package/dist/download-CthdK4dV.js +0 -23
  788. package/dist/edit-1-BW7NwWP7.js +0 -20
  789. package/dist/el-GR-BLNCX9mm.js +0 -7
  790. package/dist/el-GR-Bx996PXx.js +0 -7
  791. package/dist/el-GR-CgoxpC-Q.js +0 -7
  792. package/dist/el-GR-DaAMIpOR.js +0 -7
  793. package/dist/el-GR-DqTetsjB.js +0 -7
  794. package/dist/el-GR-pGsVWsOm.js +0 -7
  795. package/dist/en-US-B82BbZaB.js +0 -7
  796. package/dist/en-US-BUmtG-Wj.js +0 -27
  797. package/dist/en-US-C3i5Oge2.js +0 -7
  798. package/dist/en-US-C8karqc5.js +0 -7
  799. package/dist/en-US-CJPD8qHc.js +0 -7
  800. package/dist/en-US-D0fscfsz.js +0 -7
  801. package/dist/en-US-DapC--Cs.js +0 -7
  802. package/dist/entityAssociationUtil-CLBR9osP.js +0 -59
  803. package/dist/error-CpJV-CLa.js +0 -36
  804. package/dist/es-ES-C14ZT-97.js +0 -7
  805. package/dist/es-ES-DeT4zIDW.js +0 -7
  806. package/dist/es-ES-DyB2KXfT.js +0 -7
  807. package/dist/es-ES-U4-lDfZq.js +0 -7
  808. package/dist/es-ES-tVQDUTJN.js +0 -7
  809. package/dist/es-ES-wvcyuTNN.js +0 -7
  810. package/dist/es-LA-B5IRDCf_.js +0 -7
  811. package/dist/es-LA-B_hzWiiE.js +0 -7
  812. package/dist/es-LA-CG_cu1hM.js +0 -7
  813. package/dist/es-LA-ChLRkx-r.js +0 -7
  814. package/dist/es-LA-mFT_9PL_.js +0 -7
  815. package/dist/et-EE-4_ZUNt3W.js +0 -7
  816. package/dist/et-EE-BCWBT8XN.js +0 -7
  817. package/dist/et-EE-BQEyJFZb.js +0 -7
  818. package/dist/et-EE-DSK7kb3n.js +0 -7
  819. package/dist/et-EE-DWVzz1wR.js +0 -7
  820. package/dist/external-link-CFgynH5A.js +0 -20
  821. package/dist/fi-FI-B-7uBAf5.js +0 -7
  822. package/dist/fi-FI-BeJtSWIh.js +0 -7
  823. package/dist/fi-FI-Caa9ydMd.js +0 -7
  824. package/dist/fi-FI-D06EzKrW.js +0 -7
  825. package/dist/fi-FI-DgMsQBRO.js +0 -7
  826. package/dist/form-rules-zzbZ2bV6.js +0 -1089
  827. package/dist/formatCurrency-Cq3WFpdZ.js +0 -23
  828. package/dist/formatValidationError-BHvKLMYZ.js +0 -23
  829. package/dist/fr-FR-8a-RK9xd.js +0 -7
  830. package/dist/fr-FR-BCfqr4jm.js +0 -7
  831. package/dist/fr-FR-BTJoQq71.js +0 -7
  832. package/dist/fr-FR-CDv300-8.js +0 -7
  833. package/dist/fr-FR-D7DTFYe4.js +0 -7
  834. package/dist/fr-FR-Dl4NL-Nc.js +0 -7
  835. package/dist/genUtils-Ce61IJs8.js +0 -60
  836. package/dist/getDefaultRegistrationNumberType-CI1NVzJR.js +0 -1055
  837. package/dist/getFormSlice-DzRO0UUx.js +0 -52
  838. package/dist/getLegalEntityCountry-CNE5uei8.js +0 -17
  839. package/dist/getName-s7qmFean.js +0 -35
  840. package/dist/getProblemsForEntity-Bh9nSdOW.js +0 -16
  841. package/dist/getTrustedDecisionMakers-DX3nImM5.js +0 -25
  842. package/dist/gift-0jLCte2h.js +0 -20
  843. package/dist/graph-DrxuzQF7.js +0 -32
  844. package/dist/graph-up-4qLbS2Ds.js +0 -38
  845. package/dist/headquarter-3o2GHW5H.js +0 -42
  846. package/dist/hotel-pZlrEAK8.js +0 -33
  847. package/dist/hr-HR-B11sggmG.js +0 -7
  848. package/dist/hr-HR-BjxPRJ1o.js +0 -7
  849. package/dist/hr-HR-COdiWKoq.js +0 -7
  850. package/dist/hr-HR-CXH5M5JZ.js +0 -7
  851. package/dist/hr-HR-me1zsMas.js +0 -7
  852. package/dist/http-DsJtugN1.js +0 -204
  853. package/dist/hu-HU-BNlsrO-l.js +0 -7
  854. package/dist/hu-HU-BQ5310Yi.js +0 -7
  855. package/dist/hu-HU-D1ZZwcl0.js +0 -7
  856. package/dist/hu-HU-DkSsL94T.js +0 -7
  857. package/dist/hu-HU-Dp6xOBN_.js +0 -7
  858. package/dist/image-tfgNnE3G.js +0 -23
  859. package/dist/info-DJW5JooY.js +0 -32
  860. package/dist/info-filled-C5mP6T4Z.js +0 -32
  861. package/dist/it-IT-BORQC-7u.js +0 -7
  862. package/dist/it-IT-BlaVymCj.js +0 -7
  863. package/dist/it-IT-CawjvBDX.js +0 -7
  864. package/dist/it-IT-Cnk7j_gC.js +0 -7
  865. package/dist/it-IT-DIIRAF4_.js +0 -7
  866. package/dist/it-IT-x4LV31GV.js +0 -7
  867. package/dist/ja-JP-CyXnoIu3.js +0 -7
  868. package/dist/ja-JP-DBne3dbI.js +0 -7
  869. package/dist/ja-JP-DS8zN3mY.js +0 -7
  870. package/dist/ja-JP-Dpe9Odla.js +0 -7
  871. package/dist/ja-JP-DrHQO_Se.js +0 -7
  872. package/dist/ja-JP-h3E8hgLv.js +0 -7
  873. package/dist/legal-entity-type-0MfCGzUf.js +0 -13
  874. package/dist/legalArrangementUtils-xvCxpgzJ.js +0 -113
  875. package/dist/location-Dk0rAiaT.js +0 -23
  876. package/dist/lt-LT-8kOI6QVq.js +0 -7
  877. package/dist/lt-LT-B18sQY9g.js +0 -7
  878. package/dist/lt-LT-Byl8QeWO.js +0 -7
  879. package/dist/lt-LT-D3ZUJfjr.js +0 -7
  880. package/dist/lt-LT-Fc1lOUlz.js +0 -7
  881. package/dist/lv-LV-C70c94CI.js +0 -7
  882. package/dist/lv-LV-CXifQKfG.js +0 -7
  883. package/dist/lv-LV-DctYQmfH.js +0 -7
  884. package/dist/lv-LV-Mj_iV56f.js +0 -7
  885. package/dist/lv-LV-adiXoKhv.js +0 -7
  886. package/dist/mail-DG7MBDNE.js +0 -20
  887. package/dist/mapAddressLocalizationToJpAddressSchema-TUaHGQh6.js +0 -26
  888. package/dist/mapExistingFile-CwGW1ru4.js +0 -55
  889. package/dist/mapJpAddressSchemaToAddressLocalizations-CdP6PRAO.js +0 -73
  890. package/dist/mapLegalEntityToIndividualSchema-ByhXwZqs.js +0 -214
  891. package/dist/mapTransferInstrumentToPayoutAccount-6eLKhumO.js +0 -44
  892. package/dist/minus-circle-filled-DglqAgJW.js +0 -30
  893. package/dist/nl-NL-BIpptPn4.js +0 -7
  894. package/dist/nl-NL-BWGCqpWp.js +0 -7
  895. package/dist/nl-NL-Bv8Zk-6e.js +0 -7
  896. package/dist/nl-NL-DOB0b0m4.js +0 -7
  897. package/dist/nl-NL-ehxkZFQd.js +0 -7
  898. package/dist/nl-NL-jt4eYGEY.js +0 -7
  899. package/dist/no-NO-BG1sYkpp.js +0 -7
  900. package/dist/no-NO-CeZQnyyD.js +0 -7
  901. package/dist/no-NO-Chwg5Roi.js +0 -7
  902. package/dist/no-NO-Dx_Z3uoZ.js +0 -7
  903. package/dist/no-NO-P5tRWhV9.js +0 -7
  904. package/dist/options-horizontal-CTUn7IEx.js +0 -30
  905. package/dist/partner-1StoI4_W.js +0 -30
  906. package/dist/pay-by-link-plane-Sa_qkL8C.js +0 -33
  907. package/dist/payout-BAYSxSqU.js +0 -38
  908. package/dist/pdf-uNYg4Mqz.js +0 -22315
  909. package/dist/pdf.worker.min-gK7UJW5a.js +0 -74644
  910. package/dist/person-Da15_s3G.js +0 -23
  911. package/dist/pl-PL-BsXtscoI.js +0 -7
  912. package/dist/pl-PL-CWFdZf24.js +0 -7
  913. package/dist/pl-PL-DSbuyzBx.js +0 -7
  914. package/dist/pl-PL-J9S3_lCf.js +0 -7
  915. package/dist/pl-PL-_KG-ZD1N.js +0 -7
  916. package/dist/plus-BQccvKkd.js +0 -20
  917. package/dist/plus-circle-filled-CqC30FRL.js +0 -30
  918. package/dist/processCapabilities-DRD0Aq2i.js +0 -874
  919. package/dist/processValidationErrors-oxuCOsth.js +0 -62
  920. package/dist/pt-BR-B2q9Nl16.js +0 -7
  921. package/dist/pt-BR-BYbyk6xS.js +0 -7
  922. package/dist/pt-BR-Cph-P8oH.js +0 -7
  923. package/dist/pt-BR-D1yTuXWd2.js +0 -7
  924. package/dist/pt-BR-fKlNUybd.js +0 -7
  925. package/dist/pt-PT-C1gtp2_N.js +0 -7
  926. package/dist/pt-PT-CQQkh5PS.js +0 -7
  927. package/dist/pt-PT-D8ldyR-j.js +0 -7
  928. package/dist/pt-PT-DAvsI-Tr.js +0 -7
  929. package/dist/pt-PT-DhokEMPi.js +0 -7
  930. package/dist/pt-PT-IPhkbQvT.js +0 -7
  931. package/dist/recurring-DSR1fNMh.js +0 -23
  932. package/dist/resolveEnvironment-BYEL10Nc.js +0 -2524
  933. package/dist/revenue-accelerate-CPhAVpPK.js +0 -30
  934. package/dist/ro-RO-C6xoaASq.js +0 -7
  935. package/dist/ro-RO-CP_IrOlX.js +0 -7
  936. package/dist/ro-RO-CQJk7Cpo.js +0 -7
  937. package/dist/ro-RO-CnMe6Mfw.js +0 -7
  938. package/dist/ro-RO-_BLhsnIB.js +0 -7
  939. package/dist/save-DQ-mJX8e.js +0 -20
  940. package/dist/search-DWqWTW_K.js +0 -30
  941. package/dist/show-BbhlD3IY.js +0 -23
  942. package/dist/sk-SK-BOc9IqyW.js +0 -7
  943. package/dist/sk-SK-Bb1CdAzD.js +0 -7
  944. package/dist/sk-SK-Br1Y4_CN.js +0 -7
  945. package/dist/sk-SK-Bx2_85dW.js +0 -7
  946. package/dist/sk-SK-C889qQFo.js +0 -7
  947. package/dist/sl-SI-B-Xa0hlk.js +0 -7
  948. package/dist/sl-SI-BQc61Sz2.js +0 -7
  949. package/dist/sl-SI-DHPadSTy.js +0 -7
  950. package/dist/sl-SI-DO9c7geI.js +0 -7
  951. package/dist/sl-SI-bkhhInrg.js +0 -7
  952. package/dist/solution-payments-D4BORMsX.js +0 -20
  953. package/dist/store-DWaq3ZiC.js +0 -20
  954. package/dist/sv-SE-BXrlr0X5.js +0 -7
  955. package/dist/sv-SE-Dk81lopg.js +0 -7
  956. package/dist/sv-SE-DzsWB30f.js +0 -7
  957. package/dist/sv-SE-IBYnJfbW.js +0 -7
  958. package/dist/sv-SE-X89Q6ZAq.js +0 -7
  959. package/dist/sv-SE-l_UVgmVu.js +0 -7
  960. package/dist/terminal-1-crR-pS_R.js +0 -30
  961. package/dist/translation-BOm4lmPx.js +0 -657
  962. package/dist/types/components/GlobalEntry/globalEntryKeyMapping.d.ts +0 -15
  963. package/dist/types/components/GlobalEntry/utils.d.ts +0 -30
  964. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/getDefaultTaxIdNumberType.d.ts +0 -30
  965. package/dist/types/components/Shared/fields/TaxInformationField/TaxIdNumberTypeSelector/inferTaxIdNumberType.d.ts +0 -13
  966. package/dist/types/core/models/api/attachment.d.ts +0 -7
  967. package/dist/types/core/models/api/document.d.ts +0 -25
  968. package/dist/types/core/models/api/entity-type.d.ts +0 -5
  969. package/dist/types/core/models/api/legal-arrangement.d.ts +0 -24
  970. package/dist/types/core/models/api/legal-entity-type.d.ts +0 -8
  971. package/dist/types/core/models/api/legal-entity.d.ts +0 -36
  972. package/dist/types/core/models/api/problem.d.ts +0 -12
  973. package/dist/types/core/models/api/remediating-action.d.ts +0 -5
  974. package/dist/types/core/models/api/transfer-instrument.d.ts +0 -33
  975. package/dist/types/core/models/api/trusted-fields-provider.d.ts +0 -5
  976. package/dist/types/core/models/api/verification-error.d.ts +0 -19
  977. package/dist/types-BeveNAZK.js +0 -19
  978. package/dist/types-wRlt8bxb.js +0 -58
  979. package/dist/upload-D85xAAAm.js +0 -23
  980. package/dist/useAdaptiveWorkflow-DsQESk9f.js +0 -28
  981. package/dist/useBusinessDetailsData-Bja80UYy.js +0 -4722
  982. package/dist/useBusinessLines-BhSN6qCH.js +0 -27
  983. package/dist/useCanSeeIntroduction-BcfQC4IP.js +0 -38
  984. package/dist/useDataMissingRemediations-msU1AJvo.js +0 -39
  985. package/dist/useForm-DbDFfb2S.js +0 -502
  986. package/dist/useHideTaskStepper-CbMcV9mk.js +0 -26
  987. package/dist/useId-oOIS1nsj.js +0 -73
  988. package/dist/useIndustryCodes-uAj90IyS.js +0 -32
  989. package/dist/useLegalEntity-QQXN6YOm.js +0 -48
  990. package/dist/useNavigate-CiKOI5QV.js +0 -246
  991. package/dist/useOnboardingStatus-CsGUjkm-.js +0 -23
  992. package/dist/usePciQuestionnaireList-CFNJD8pS.js +0 -26
  993. package/dist/useSalesChannels-BvGJ9PT6.js +0 -47
  994. package/dist/useScenarios-CGcmXgJv.js +0 -55
  995. package/dist/useTaskLandedEvent-pmN03gtI.js +0 -26
  996. package/dist/useTaskStatus-CgrhdaE_.js +0 -23
  997. package/dist/useTermsOfServiceStatus-DbJDklA2.js +0 -39
  998. package/dist/useTrustMembers-f13Kf1Zk.js +0 -152
  999. package/dist/useUnincorporatedPartnershipMembers-K5jkCKfJ.js +0 -70
  1000. package/dist/useUpdateBusinessLines-DCKYTzxd.js +0 -43
  1001. package/dist/utils-2tir5QtF.js +0 -52
  1002. package/dist/utils-BUOt0VrX.js +0 -179
  1003. package/dist/utils-DBIDcVUN.js +0 -214
  1004. package/dist/validate-BpZBKknS.js +0 -224
  1005. package/dist/validate-CPTQceEQ.js +0 -151
  1006. package/dist/validate-YBDlgvjy.js +0 -429
  1007. package/dist/validate-u6nDNwf1.js +0 -126
  1008. package/dist/validateExtractionResult-dH4TewHf.js +0 -343
  1009. package/dist/validationError-B-B3GC86.js +0 -55
  1010. package/dist/warning-circle-fill-BDTmKU1s.js +0 -30
  1011. package/dist/warning-diamond-filled-BjDL-xa8.js +0 -30
  1012. package/dist/webinar-YMbPoCx3.js +0 -33
@@ -0,0 +1,4732 @@
1
+ try {
2
+ let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "1476366e-0cd3-4898-bbf7-900223d2bb8d", e._sentryDebugIdIdentifier = "sentry-dbid-1476366e-0cd3-4898-bbf7-900223d2bb8d");
4
+ } catch (e) {}
5
+ import { r as useTranslation } from "./translation-DbATp_35.js";
6
+ import { t as createLogger } from "./logger-Z8AeTE4x.js";
7
+ import { t as Typography } from "./Typography-CAc_f5Iq.js";
8
+ import { t as Loader } from "./Loader-BVtlpTeo.js";
9
+ import { t as Button } from "./Button-DPJ1k02w.js";
10
+ import { r as httpPost, s as useApiContext } from "./http-fdIO--pH.js";
11
+ import { r as useLegalEntity, t as ROOT_LE } from "./useLegalEntity-DHA8TJeV.js";
12
+ import { t as useAccountHolder } from "./useAccountHolder-DDto9d9n.js";
13
+ import { t as useSettingsContext } from "./useSettingsContext-9O3Aqpfq.js";
14
+ import { a as objectsDeepEqual, n as doArraysMatch, o as entriesOf, s as keysOf } from "./genUtils-nphCwt1A.js";
15
+ import { S as isUndefinedOrNull, b as isISIN, y as isEmpty } from "./validatorUtils-D2O6AAZn.js";
16
+ import { t as useToggleContext } from "./useToggleContext-B_YexrbT.js";
17
+ import { t as StackLayout } from "./StackLayout-IUdNMDgW.js";
18
+ import { t as TaskVerificationStatus } from "./TaskVerificationStatus-DEXk_ndE.js";
19
+ import { n as TASK_STATUS_POLLING_INTERVAL_MS } from "./taskStatus-BtekPA8E.js";
20
+ import { t as Header } from "./Header-DVLlJ6we.js";
21
+ import { t as useAllowedCountries } from "./useAllowedCountries-C-nqVePW.js";
22
+ import { t as CountryCodes } from "./country-code-CJk2hdPu.js";
23
+ import { n as datasetUtilities } from "./datasetUtil-BdHPWsxZ.js";
24
+ import { t as Alert } from "./Alert-Cc7p0N5h.js";
25
+ import { _ as businessDetailsKeyMapping, f as solePropBusinessDetailsApiKeyMapping, g as businessDetailsDocumentMapping, h as businessDetailsApiKeyMapping, m as solePropBusinessDetailsKeyMapping, p as solePropBusinessDetailsDocumentMapping } from "./processCapabilities-CWE5UFt8.js";
26
+ import { t as TaskTypes } from "./taskTypes-3vSkMBDm.js";
27
+ import { r as filterOutUnwantedAssociationsIfRootLE, s as getOwnEntityAssociations } from "./entityAssociationUtil-CY0grcyH.js";
28
+ import { t as Scenarios } from "./get-scenarios-Bb-paHmJ.js";
29
+ import { t as useAnalyticsContext } from "./useAnalyticsContext-gSnRnYgV.js";
30
+ import { t as HandlerContext } from "./HandlerContext-DeMa68z0.js";
31
+ import { t as SettingNames } from "./types-Cwq1JAWT.js";
32
+ import { t as useBusinessLines } from "./useBusinessLines-BZfFqvS_.js";
33
+ import { t as Card } from "./Card-BCGLpdw7.js";
34
+ import { t as useToastContext } from "./useToastContext-B6Mqc2HY.js";
35
+ import { t as LandingLayout } from "./LandingLayout-BsIoIFzs.js";
36
+ import { t as useInvalidateRootLegalEntity } from "./invalidateRootLegalEntity-BHaVREw-.js";
37
+ import { t as LoaderWrapper } from "./LoaderWrapper-Dc88hY-P.js";
38
+ import { n as ModalContent, t as Modal } from "./Modal-CHES6970.js";
39
+ import { t as Confirm } from "./Confirm-DoN9R9Z3.js";
40
+ import { t as useCreateLegalEntity } from "./useCreateLegalEntity-qP7MeAmi.js";
41
+ import { t as useUpdateLegalEntity } from "./useUpdateLegalEntity-CqmqXsbR.js";
42
+ import { a as useFormComposer, i as FormFlow, o as FormContextProvider, r as useFormContext, t as addValidityToForms } from "./dropinUtils-DTBezwYT.js";
43
+ import { i as getPropsFromConfigurations, r as composePerScenarioFormConfigurations, t as createFormRules } from "./form-rules-B0RwhsVw.js";
44
+ import { t as Image } from "./Image-Bn_Yyuof.js";
45
+ import { t as StructuredList } from "./StructuredList-nPasiuLi.js";
46
+ import { t as ErrorPanel } from "./ErrorPanel-D4JNFkvi.js";
47
+ import { n as summaryStep, r as Summary_module_default } from "./Summary-DM31WxLr.js";
48
+ import { n as mergeFieldMetadataIntoProps, t as createFormUtils } from "./formUtils-DVDcdZsP.js";
49
+ import { t as useMultiForm } from "./useMultiForm-BxASst0O.js";
50
+ import { t as Field } from "./Field-DwDJQVSS.js";
51
+ import { t as TileGroup } from "./TileGroup-D1-M64Ul.js";
52
+ import { a as useLegalCompanyNameField, i as CountryOfGoverningLawField, n as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, o as localizedLegalCompanyNameFieldConfig, r as COUNTRY_OF_GOVERNING_LAW_FIELD, s as useCompanyTypeExamples, t as CountryOfGoverningLawFieldValidation } from "./validate-DUcT-JGF.js";
53
+ import { t as getFormSlice } from "./getFormSlice-C1ma6Xd4.js";
54
+ import { a as exemptFromRegistrationNumberDefaultFieldMetadata, c as registrationNumberDefaultFieldMetadata, l as getCompanyRegistrationNumberOptions, n as inferCompanyRegistrationNumberType, s as registrationNumberDefaultFieldConfig, t as getDefaultRegistrationNumberType, u as getValidCompanyTypesForRegistrationNumberType } from "./getDefaultRegistrationNumberType-CIu4WMln.js";
55
+ import { A as taxIdNumberOptions, C as isRegistrationNumberAbsentStateV4Scenario, D as getTaxIdNumberOptions, E as mapLocalizationToJapaneseLegalNames, S as isRegistrationExemptionAllowed, T as mapJapaneseLegalNamesToLocalization, _ as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES, b as REGISTRATION_NUMBER_EXEMPTION_RULES, c as taxInformationDefaultFieldConfig, d as COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION, f as COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION, g as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS, h as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER, k as getValidCompanyTypesForTaxIdNumberType, l as taxInformationDefaultFieldMetadata, m as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, p as COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP, s as getTaxInformationPlaceholderText, u as COUNTRIES_REQUIRING_FINANCIAL_INFORMATION, v as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS, w as isUsingCompanySearch, x as TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION, y as COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 } from "./utils-Ck_mZapQ.js";
56
+ import { t as isEmpty$1 } from "./isEmpty-Uewyl-r6.js";
57
+ import { n as useDebouncedCallback } from "./debouncedInputEvent-Fwwp_K_-.js";
58
+ import { t as Checkbox } from "./Checkbox-qfdF12cF.js";
59
+ import { n as CountryField, t as COUNTRY_FIELD } from "./CountryField-DT6-Jr_b.js";
60
+ import { a as mapAddressLabelsNewSummary, c as COUNTRIES_WITH_STATES_DATASET, r as getKeyForField, t as getAddressSchemaForCountry } from "./utils-BWumuCvl.js";
61
+ import { a as validateNotEmptyOnBlur, o as validatePatternOnBlur } from "./patternValidators-DsrZkuOO.js";
62
+ import { n as StateField, r as stateFieldMetadata, t as STATE_FIELD } from "./StateField-BpMwetvd.js";
63
+ import { t as ListItem } from "./ListItem-CYTpdOMa.js";
64
+ import { a as defaultFieldMetadata, i as defaultFieldConfigV4, o as defaultFieldMetadataV4, r as defaultFieldConfig, t as LEGAL_COMPANY_NAME_FIELD } from "./LegalCompanyNameField-Cosyjk52.js";
65
+ import { t as InputText } from "./InputText-CFDEmEtp.js";
66
+ import { t as resolveFieldMetadata } from "./fieldConfigurations-CZCFghnK.js";
67
+ import { n as TaxInformationField, r as isJapanLocalizationEnabled, t as TAX_INFORMATION_FIELD } from "./TaxInformationField-CV7SpMH1.js";
68
+ import { c as MaskedInput, i as makeMask, n as alphanumericInputs, o as numericInputs, t as alphaInputs } from "./maskHelpers-C0wnCoJl.js";
69
+ import { t as uppercase } from "./uppercase-DvjwUM0n.js";
70
+ import { t as RadioGroup } from "./RadioGroup-Bf3DlQnZ.js";
71
+ import { n as BusinessRegistrationNumberField, t as BUSINESS_REGISTRATION_NUMBER_FIELD } from "./BusinessRegistrationNumberField-DKka8aVU.js";
72
+ import { n as LEGAL_ARRANGEMENT_COUNTRIES_REQUIRING_DATE_OF_INCORPORATION } from "./legalArrangementUtils-C68JdH6I.js";
73
+ import { r as formatObject } from "./utils-DdHbAadK.js";
74
+ import { t as useScenarios } from "./useScenarios-Bn93htbx.js";
75
+ import { o as nestAddressSchema, r as flattenAddressSchema } from "./AddressFields-BC3QHs2u.js";
76
+ import { i as useScenarioConfiguration, r as getPageName, t as mapExistingFile } from "./mapExistingFile-BkwRTTRm.js";
77
+ import { t as useTaskLandedEvent } from "./useTaskLandedEvent-DwZHcMEQ.js";
78
+ import { i as JP_ADDRESS_REQUIRED_FIELDS, r as mapJpAddressSummaryNewSummary, t as mapJpAddressSchemaToAddressLocalizations } from "./mapJpAddressSchemaToAddressLocalizations-D3VO2nhc.js";
79
+ import { n as isMaintenanceModeError, t as processValidationErrors } from "./processValidationErrors-CjsNfiRK.js";
80
+ import { a as createDocumentRequest, c as getDocuments, f as mergeProofOfOwnershipAttachments, l as getFileExtention, o as documentApiUtils, s as getDocument } from "./validate-BZ1-ZeKr.js";
81
+ import { i as getFieldsWithExistingData, n as MemoizedDocumentUpload, t as PatriotActDisclosure } from "./PatriotActDisclosure-DqUZeLms.js";
82
+ import { a as isValidationError, r as isBusinessSelectionLegalArrangementError } from "./validationError-DV6t8Ubb.js";
83
+ import { i as formatAddressForCleanse, n as formatDateObj, o as useAddressCleanseImperatively, t as InputDate } from "./InputDate-Bq3Sb-ZW.js";
84
+ import { t as addressValidators } from "./validate-DTz70AWN.js";
85
+ import { t as capitalize } from "./getProps-DVqK7eRw.js";
86
+ import { t as Link } from "./Link-CvYhseSD.js";
87
+ import { t as formatValidationError } from "./formatValidationError-q_w9DTrl.js";
88
+ import { t as DataConflictsModal } from "./DataConflictsModal-CCaMgguu.js";
89
+ import { t as mapAddressLocalizationToJpAddressSchema } from "./mapAddressLocalizationToJpAddressSchema-DpOIaxj6.js";
90
+ import { t as currencyByCountry } from "./types-BA3bcGAv.js";
91
+ import { t as Divider } from "./Divider-BENvVRnz.js";
92
+ import { n as SummarySection, t as NewSummary } from "./NewSummary-D55f70wB.js";
93
+ import { t as DetailViewLayout } from "./DetailViewLayout-DNCGEd7b.js";
94
+ import { a as LegalFormField, c as isDateOlderThanAYear, i as InputCurrency, l as mapAddressData, n as Currency, o as mapFinancialReportsToFinancialInformation, r as InputNumber, s as mapFinancialInformationToFinancialReport, t as CURRENCY_FIELD } from "./Currency-oeXHRWzy.js";
95
+ import { t as useTaskStatus } from "./useTaskStatus-DJxOWvuN.js";
96
+ import { t as useIndustryCodes } from "./useIndustryCodes-BMK6IMiW.js";
97
+ import { n as formatCurrency } from "./formatCurrency-BetgkQKi.js";
98
+ import { n as useCreateBusinessLine, t as useUpdateBusinessLine } from "./useUpdateBusinessLines-JRPjqoe9.js";
99
+ import { _ as dateOfIncorporationFieldMetadata, a as defaultFieldConfig$1, c as REGISTRATION_AND_OPERATIONAL_ADDRESS_FIELDS, d as doingBusinessAsFieldMetadata, f as DBANameField, h as DateOfIncorporationField, i as getDefaultVatNumberType, l as RegistrationAndOperationalAddressFields, m as DATE_OF_INCORPORATION_FIELD, n as VAT_NUMBER_FIELD, o as defaultFieldMetadata$1, p as DBA_NAME_FIELD, r as VatNumberField, s as vatAbsenceReasonMetadata, t as MemoizedConstitutionalDocument, u as doingBusinessAsAbsentFieldMetadata } from "./ConstitutionalDocument-Bxsr1hQb.js";
100
+ import { f as industryCodeFieldMetadata, l as IndustryCodeField, t as INDUSTRY_CODE_FIELD } from "./constants-C8yo0_RA.js";
101
+ import { s as organizationTypesToSkipCompanyStructureForm } from "./utils-CJcGZvj1.js";
102
+ import { lazy } from "preact/compat";
103
+ import { useCallback as useCallback$1, useContext as useContext$1, useEffect as useEffect$1, useMemo as useMemo$1, useRef as useRef$1, useState as useState$1 } from "preact/hooks";
104
+ import cx from "classnames";
105
+ import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime";
106
+ import { createModel, signal, useModel, useSignal } from "@preact/signals";
107
+ import { queryOptions, skipToken, useMutation, useQuery, useQueryClient } from "@tanstack/preact-query";
108
+ import { createContext as createContext$1 } from "preact";
109
+ import { Show } from "@preact/signals/utils";
110
+ //#region src/components/Shared/fields/EInvoicingCodeField/EInvoicingCodeField.tsx
111
+ var EINVOICING_CODE_FIELD = ["eInvoicingCode"];
112
+ function EInvoicingCodeField({ data, valid, errors, labels, readonly, mask, shouldValidate, handleChangeFor }) {
113
+ const { t } = useTranslation("common");
114
+ const [noInvoicingCode, setNoInvoicingCode] = useState$1(false);
115
+ const handleNoInvoicingCode = () => {
116
+ setNoInvoicingCode(!noInvoicingCode);
117
+ handleChangeFor("eInvoicingCode")("0000000");
118
+ };
119
+ return /* @__PURE__ */ jsxs("div", {
120
+ className: "adyen-kyc-field",
121
+ children: [/* @__PURE__ */ jsx(MaskedInput, {
122
+ name: "eInvoicingCode",
123
+ type: "text",
124
+ label: labels.eInvoicingCode ?? "",
125
+ formatGuidance: t(($) => $["the7CharacterIdentifierAssignedToThis"], { example: "MP10YNU" }),
126
+ errorMessage: errors.eInvoicingCode,
127
+ isValid: valid.eInvoicingCode ?? false,
128
+ value: data.eInvoicingCode ?? "",
129
+ readonly: readonly || noInvoicingCode,
130
+ shouldValidate,
131
+ onInput: handleChangeFor("eInvoicingCode", "input"),
132
+ onBlur: handleChangeFor("eInvoicingCode", "blur"),
133
+ disabled: noInvoicingCode,
134
+ "aria-required": true,
135
+ "aria-invalid": !valid.eInvoicingCode,
136
+ ...mask
137
+ }), /* @__PURE__ */ jsx(Field, {
138
+ name: "noEInvoicingCode",
139
+ children: (childProps) => /* @__PURE__ */ jsx(Checkbox, {
140
+ ...childProps,
141
+ name: "noEInvoicingCode",
142
+ "aria-required": false,
143
+ "aria-invalid": false,
144
+ label: t(($) => $["thisCompanyDoesntHaveAnSDI"]),
145
+ checked: noInvoicingCode,
146
+ onChange: handleNoInvoicingCode
147
+ })
148
+ })]
149
+ });
150
+ }
151
+ //#endregion
152
+ //#region src/components/Shared/fields/EInvoicingCodeField/fieldConfig.ts
153
+ var eInvoicingCodeFieldMetadata = {
154
+ validators: validatePatternOnBlur(/^[A-Z0-9]{7}$/),
155
+ mask: {
156
+ mask: makeMask(...alphanumericInputs(16)),
157
+ transformOnType: uppercase
158
+ }
159
+ };
160
+ var legalEntityIdentifierFieldMetadata = {
161
+ validators: [{
162
+ modes: ["blur"],
163
+ validate: (val) => {
164
+ const isValidLength = val ? val.length === 20 : false;
165
+ const hasLettersAndNumbers = val ? /[a-zA-Z]/.test(val) && /[0-9]/.test(val) : false;
166
+ return isValidLength && hasLettersAndNumbers;
167
+ },
168
+ errorMessage: {
169
+ key: "enterNCharactersWithAMixForExample",
170
+ values: {
171
+ numChars: "20",
172
+ example: "529900T8BM49AURSDO55"
173
+ }
174
+ }
175
+ }],
176
+ mask: {
177
+ mask: makeMask(...alphanumericInputs(20)),
178
+ transformOnType: uppercase
179
+ }
180
+ };
181
+ //#endregion
182
+ //#region src/components/Shared/fields/LegalEntityIdentifierField/LegalEntityIdentifierField.tsx
183
+ var LEGAL_ENTITY_IDENTIFIER_FIELD = ["legalEntityIdentifier", "exemptedFromLegalEntityIdentifier"];
184
+ function LegalEntityIdentifierField({ data, valid, errors, handleChangeFor, shouldValidate, canExempt = true }) {
185
+ const { t } = useTranslation("common");
186
+ const isExempted = Boolean(data.exemptedFromLegalEntityIdentifier);
187
+ const handleExemptedChange = (isChecked) => {
188
+ handleChangeFor("exemptedFromLegalEntityIdentifier", "blur")(isChecked);
189
+ if (isChecked) handleChangeFor("legalEntityIdentifier", "input")("");
190
+ };
191
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MaskedInput, {
192
+ type: "text",
193
+ name: "legalEntityIdentifier",
194
+ label: t(($) => $["legalEntityIdentifier"]),
195
+ onInput: handleChangeFor("legalEntityIdentifier", "input"),
196
+ onBlur: handleChangeFor("legalEntityIdentifier", "blur"),
197
+ value: data.legalEntityIdentifier ?? "",
198
+ isValid: Boolean(valid?.legalEntityIdentifier),
199
+ errorMessage: errors.legalEntityIdentifier,
200
+ disabled: isExempted,
201
+ helper: /* @__PURE__ */ jsxs(Typography, {
202
+ variant: "caption",
203
+ color: "secondary",
204
+ children: [
205
+ t(($) => $["aUniqueIdentifierForGlobalFinancialReporting"]),
206
+ " ",
207
+ /* @__PURE__ */ jsx(Link, {
208
+ href: "https://search.gleif.org/#/search/",
209
+ external: true,
210
+ inline: true,
211
+ children: t(($) => $["lookUpYourLEI"])
212
+ })
213
+ ]
214
+ }),
215
+ helperPosition: "below",
216
+ persistHelper: true,
217
+ shouldValidate,
218
+ mask: legalEntityIdentifierFieldMetadata.mask?.mask,
219
+ transformOnType: legalEntityIdentifierFieldMetadata.mask?.transformOnType
220
+ }), canExempt && /* @__PURE__ */ jsx(Field, {
221
+ name: "exemptedFromLegalEntityIdentifier",
222
+ children: (childProps) => /* @__PURE__ */ jsx(Checkbox, {
223
+ ...childProps,
224
+ name: "exemptedFromLegalEntityIdentifier",
225
+ value: "exemptedFromLegalEntityIdentifier",
226
+ checked: isExempted,
227
+ label: t(($) => $["iDontHaveAnLEI"]),
228
+ onChange: handleExemptedChange
229
+ })
230
+ })] });
231
+ }
232
+ //#endregion
233
+ //#region src/components/Shared/fields/StockExchangeMICField/fieldConfig.ts
234
+ var stockExchangeMICFieldMetadata = {
235
+ validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
236
+ mask: {
237
+ mask: makeMask(...alphanumericInputs(4)),
238
+ transformOnType: uppercase
239
+ }
240
+ };
241
+ //#endregion
242
+ //#region src/components/Shared/fields/StockExchangeMICField/StockExchangeMICField.tsx
243
+ var STOCK_EXCHANGE_MIC_FIELD = ["stockExchangeMIC"];
244
+ function StockExchangeMICField({ data, valid, errors, readonly, mask, shouldValidate, handleChangeFor }) {
245
+ const { t } = useTranslation("common");
246
+ return /* @__PURE__ */ jsx(MaskedInput, {
247
+ name: "stockExchangeMIC",
248
+ type: "text",
249
+ label: t(($) => $["stockExchangeMIC"]),
250
+ formatGuidance: t(($) => $["enterNCharactersForExample"], {
251
+ numChars: "4",
252
+ example: "XNAS"
253
+ }),
254
+ ...mask,
255
+ errorMessage: errors.stockExchangeMIC,
256
+ isValid: valid.stockExchangeMIC ?? false,
257
+ value: data.stockExchangeMIC ?? "",
258
+ readonly,
259
+ shouldValidate,
260
+ onInput: handleChangeFor("stockExchangeMIC", "input"),
261
+ onBlur: handleChangeFor("stockExchangeMIC", "blur"),
262
+ "aria-required": true,
263
+ "aria-invalid": !valid.stockExchangeMIC
264
+ });
265
+ }
266
+ //#endregion
267
+ //#region src/components/Shared/fields/StockISINField/fieldConfig.ts
268
+ var stockISINFieldMetadata = {
269
+ validators: [validateNotEmptyOnBlur, {
270
+ modes: ["blur"],
271
+ validate: (value) => !!value && isISIN(value)
272
+ }],
273
+ mask: {
274
+ mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
275
+ transformOnType: uppercase
276
+ }
277
+ };
278
+ //#endregion
279
+ //#region src/components/Shared/fields/StockISINField/StockISINField.tsx
280
+ var STOCK_ISIN_FIELD = ["stockISIN"];
281
+ function StockISINField({ data, valid, errors, readonly, mask, shouldValidate, handleChangeFor }) {
282
+ const { t } = useTranslation("common");
283
+ return /* @__PURE__ */ jsx(MaskedInput, {
284
+ name: "stockISIN",
285
+ type: "text",
286
+ label: t(($) => $["stockISIN"]),
287
+ formatGuidance: t(($) => $["validationPleaseEnterAValidStockISIN"], { example: "NL0012969182" }),
288
+ ...mask,
289
+ errorMessage: errors.stockISIN,
290
+ isValid: valid.stockISIN ?? false,
291
+ value: data.stockISIN ?? "",
292
+ readonly,
293
+ shouldValidate,
294
+ onInput: handleChangeFor("stockISIN", "input"),
295
+ onBlur: handleChangeFor("stockISIN", "blur"),
296
+ "aria-required": true,
297
+ "aria-invalid": !valid.stockISIN
298
+ });
299
+ }
300
+ //#endregion
301
+ //#region src/components/Shared/fields/StockTickerSymbol/fieldConfig.ts
302
+ var stockTickerSymbolFieldMetadata = {
303
+ validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
304
+ mask: {
305
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
306
+ transformOnType: uppercase
307
+ }
308
+ };
309
+ //#endregion
310
+ //#region src/components/Shared/fields/StockTickerSymbol/StockTickerSymbolField.tsx
311
+ var STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
312
+ function StockTickerSymbolField({ data, valid, errors, readonly, mask, shouldValidate, handleChangeFor }) {
313
+ const { t } = useTranslation("common");
314
+ return /* @__PURE__ */ jsx(MaskedInput, {
315
+ name: "stockTickerSymbol",
316
+ type: "text",
317
+ label: t(($) => $["stockTickerSymbol"]),
318
+ formatGuidance: t(($) => $["enterAMaximumOfNCharactersForExample"], {
319
+ maxChars: "5",
320
+ example: "ADYEN"
321
+ }),
322
+ ...mask,
323
+ errorMessage: errors.stockTickerSymbol,
324
+ isValid: valid.stockTickerSymbol ?? false,
325
+ value: data.stockTickerSymbol ?? "",
326
+ readonly,
327
+ shouldValidate,
328
+ onInput: handleChangeFor("stockTickerSymbol", "input"),
329
+ onBlur: handleChangeFor("stockTickerSymbol", "blur"),
330
+ "aria-required": true,
331
+ "aria-invalid": !valid.stockTickerSymbol
332
+ });
333
+ }
334
+ //#endregion
335
+ //#region src/components/EFP/fields/LegalFormField/types.ts
336
+ var LEGAL_FORM_FIELDS = ["legalForm", "legalFormLabel"];
337
+ var legalFormFieldMetadata = {
338
+ label: "legalForm",
339
+ validators: [validateNotEmptyOnBlur]
340
+ };
341
+ //#endregion
342
+ //#region src/api/companyDataSet/useClearCompanyData.ts
343
+ var clearCompanyData = async (legalEntityId, baseUrl) => {
344
+ return httpPost({
345
+ baseUrl,
346
+ path: `legalEntities/${legalEntityId}/companyDataset/clearCompanyData`
347
+ });
348
+ };
349
+ var useClearCompanyData = (options) => {
350
+ const { rootLegalEntityId, baseUrl } = useApiContext();
351
+ const logger = createLogger();
352
+ return useMutation({
353
+ mutationFn: () => {
354
+ return clearCompanyData(rootLegalEntityId.value, baseUrl.value);
355
+ },
356
+ retry: 0,
357
+ onError: (e) => logger.error(e),
358
+ ...options
359
+ });
360
+ };
361
+ var BasicInformation_module_default = {
362
+ "basic-information": "_basic-information_1rbd4_1",
363
+ basicInformation: "_basic-information_1rbd4_1"
364
+ };
365
+ //#endregion
366
+ //#region src/components/Business/forms/BasicInformation/BasicInformation.tsx
367
+ var BASIC_INFORMATION_FIELDS = [
368
+ ...COUNTRY_FIELD,
369
+ ...LEGAL_COMPANY_NAME_FIELD,
370
+ "jaHaniLegalCompanyName",
371
+ "jaKanaLegalCompanyName",
372
+ ...TAX_INFORMATION_FIELD,
373
+ ...STATE_FIELD,
374
+ ...BUSINESS_REGISTRATION_NUMBER_FIELD,
375
+ ...COUNTRY_OF_GOVERNING_LAW_FIELD
376
+ ];
377
+ var FormDescription = ({ description, t }) => {
378
+ return /* @__PURE__ */ jsxs("div", { children: [
379
+ description,
380
+ " ",
381
+ /* @__PURE__ */ jsx(Link, {
382
+ href: "https://www.adyen.com/privacy-policy",
383
+ external: true,
384
+ children: t(($) => $["privacyStatement"])
385
+ })
386
+ ] });
387
+ };
388
+ var EMPTY_OBJ$5 = {};
389
+ function BasicInformation({ id, country, shouldValidate, fieldValidationErrors = EMPTY_OBJ$5, formVerificationErrors = EMPTY_OBJ$5, isTopLevelEntity, disableCountry, companyType, taskType }) {
390
+ const { t } = useTranslation(["common", "business"]);
391
+ const { t: businessT } = useTranslation("business");
392
+ const { isSettingEnabled } = useSettingsContext();
393
+ const { form } = useFormContext();
394
+ const allowedCountries = useAllowedCountries();
395
+ const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
396
+ const { data, defaultData, valid, errors, requiredFields, optionalFields, obscuredFields, trustedFields, fieldProblems, handleChange: handleChangeFor } = getFormSlice(form, "basicInformation");
397
+ const state = data?.stateOrProvince;
398
+ const currentCountryTaxInformation = data?.taxInformation?.find((tax) => tax.country === country);
399
+ const formUtils = useMemo$1(() => createFormUtils({
400
+ requiredFields,
401
+ optionalFields,
402
+ trustedFields,
403
+ obscuredFields
404
+ }, t), [
405
+ requiredFields,
406
+ optionalFields,
407
+ trustedFields,
408
+ obscuredFields,
409
+ t
410
+ ]);
411
+ const showField = (fieldKeys) => fieldKeys.some((field) => {
412
+ switch (field) {
413
+ case "registrationNumberType":
414
+ case "registrationNumber":
415
+ if (isUsingCompanySearch(country, taskType)) return data?.country === "US" ? (formUtils.isRequiredField(field) || formUtils.isOptionalField(field)) && data?.stateOrProvince : formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
416
+ return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
417
+ default: return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
418
+ }
419
+ });
420
+ const legalCompanyNameFields = useLegalCompanyNameField({
421
+ data: data ?? {},
422
+ valid: valid ?? {},
423
+ errors: errors ?? {},
424
+ fieldProblems: fieldProblems ?? {},
425
+ country,
426
+ formUtils,
427
+ handleChange: handleChangeFor,
428
+ t: businessT
429
+ });
430
+ return /* @__PURE__ */ jsxs("form", {
431
+ id,
432
+ className: BasicInformation_module_default.basicInformation,
433
+ children: [
434
+ /* @__PURE__ */ jsx(Header, {
435
+ title: t(($) => $["basicInformationFormHeading"], { ns: "business" }),
436
+ children: /* @__PURE__ */ jsx(FormDescription, {
437
+ slot: "description",
438
+ description: t(($) => $["basicInformationFormDescription"], { ns: "business" }),
439
+ t
440
+ })
441
+ }),
442
+ /* @__PURE__ */ jsx(ErrorPanel, {
443
+ id: "ariaErrorField",
444
+ verificationErrors: formVerificationErrors,
445
+ validationErrors: fieldValidationErrors,
446
+ formUtils
447
+ }),
448
+ legalCompanyNameFields.map((field) => /* @__PURE__ */ jsx(Field, {
449
+ name: field?.name ?? "",
450
+ label: field?.label,
451
+ formatGuidance: field?.guidance,
452
+ errorMessage: field?.errorMessage,
453
+ isValid: Boolean(field?.isValid),
454
+ children: (childProps) => /* @__PURE__ */ jsx(InputText, {
455
+ ...childProps,
456
+ "aria-required": true,
457
+ "aria-invalid": !field?.isValid,
458
+ name: field?.name,
459
+ value: field?.value,
460
+ readonly: field?.readonly,
461
+ onInput: field ? field.onInput : () => {},
462
+ transformInput: field?.transformInput,
463
+ transformMode: field?.transformMode,
464
+ onBlur: field?.onBlur,
465
+ onKeyDown: field?.onKeyDown
466
+ })
467
+ }, field?.name)),
468
+ /* @__PURE__ */ jsxs("fieldset", { children: [
469
+ /* @__PURE__ */ jsx(CountryField, {
470
+ data: formUtils.getFieldData(data ?? {}, COUNTRY_FIELD),
471
+ valid: formUtils.getFieldValid(valid ?? {}, COUNTRY_FIELD),
472
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, COUNTRY_FIELD),
473
+ labels: formUtils.getFieldLabels(COUNTRY_FIELD, { country: "countryRegionOfEstablishment" }),
474
+ readonly: formUtils.isReadOnly("country") || !isAllowedEditPrefilledCountry || Boolean(disableCountry),
475
+ handleChangeFor,
476
+ allowedCountries: isTopLevelEntity ? allowedCountries : void 0
477
+ }),
478
+ showField(COUNTRY_OF_GOVERNING_LAW_FIELD) && /* @__PURE__ */ jsx(CountryOfGoverningLawField, {
479
+ data: formUtils.getFieldData(data ?? {}, COUNTRY_OF_GOVERNING_LAW_FIELD),
480
+ country,
481
+ valid: formUtils.getFieldValid(valid ?? {}, COUNTRY_OF_GOVERNING_LAW_FIELD),
482
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, COUNTRY_OF_GOVERNING_LAW_FIELD),
483
+ allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
484
+ handleChangeFor
485
+ }),
486
+ showField(STATE_FIELD) && /* @__PURE__ */ jsx(StateField, {
487
+ data: formUtils.getFieldData(data ?? {}, STATE_FIELD),
488
+ valid: formUtils.getFieldValid(valid ?? {}, STATE_FIELD),
489
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, STATE_FIELD),
490
+ labelOverride: t(($) => $["whereIsYourBusinessRegistered"]),
491
+ readonly: formUtils.isReadOnly("stateOrProvince"),
492
+ handleChangeFor,
493
+ selectedCountry: country
494
+ }),
495
+ showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx(TaxInformationField, {
496
+ data: formUtils.getFieldData(data ?? {}, TAX_INFORMATION_FIELD),
497
+ valid: formUtils.getFieldValid(valid ?? {}, TAX_INFORMATION_FIELD),
498
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, TAX_INFORMATION_FIELD),
499
+ placeholder: getTaxInformationPlaceholderText({
500
+ country,
501
+ companyType,
502
+ taxIdNumberType: currentCountryTaxInformation?.type
503
+ }),
504
+ readonly: formUtils.isReadOnly("taxInformation"),
505
+ shouldValidate,
506
+ handleChangeFor,
507
+ canExempt: showField(["exemptedFromTax"]),
508
+ registrationNumber: data?.registrationNumber,
509
+ country,
510
+ entityType: companyType,
511
+ defaultData: defaultData?.taxInformation
512
+ }),
513
+ showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx(BusinessRegistrationNumberField, {
514
+ data: formUtils.getFieldData(data ?? {}, BUSINESS_REGISTRATION_NUMBER_FIELD),
515
+ valid: formUtils.getFieldValid(valid ?? {}, BUSINESS_REGISTRATION_NUMBER_FIELD),
516
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, BUSINESS_REGISTRATION_NUMBER_FIELD),
517
+ readonly: formUtils.isReadOnly("registrationNumber"),
518
+ optional: formUtils.isOptionalField("registrationNumber"),
519
+ shouldValidate,
520
+ handleChangeFor,
521
+ country,
522
+ state,
523
+ canExempt: showField(["exemptedFromRegistrationNumber"]),
524
+ companyType
525
+ })
526
+ ] }),
527
+ country === "US" && /* @__PURE__ */ jsx(PatriotActDisclosure, {})
528
+ ]
529
+ });
530
+ }
531
+ //#endregion
532
+ //#region src/utils/performance.ts
533
+ /**
534
+ * Start timing an operation
535
+ * @param key - Unique identifier for the operation
536
+ * @param timings - Map to store timing information
537
+ * @returns The start timestamp
538
+ */
539
+ var startTiming = (key, timings = /* @__PURE__ */ new Map()) => {
540
+ const startTime = Date.now();
541
+ timings.set(key, { startTime });
542
+ return startTime;
543
+ };
544
+ /**
545
+ * End timing an operation and calculate duration
546
+ * @param key - Unique identifier for the operation
547
+ * @param timings - Map containing timing information
548
+ * @returns The duration in milliseconds, or undefined if timing wasn't started
549
+ */
550
+ var endTiming = (key, timings) => {
551
+ const timing = timings.get(key);
552
+ if (!timing || timing.endTime) return;
553
+ const endTime = Date.now();
554
+ const duration = endTime - timing.startTime;
555
+ const updatedTiming = {
556
+ ...timing,
557
+ endTime,
558
+ duration
559
+ };
560
+ timings.set(key, updatedTiming);
561
+ return duration;
562
+ };
563
+ /**
564
+ * Execute a function with automatic timing
565
+ * @param key - Unique identifier for the operation
566
+ * @param fn - Function to execute
567
+ * @param analytics - UserEvents instance for logging
568
+ * @param timings - Optional map to store timing information
569
+ * @returns Promise that resolves with the function result and timing duration
570
+ */
571
+ var withTiming = async (key, fn, analytics, timings = /* @__PURE__ */ new Map()) => {
572
+ startTiming(key, timings);
573
+ try {
574
+ const result = await fn();
575
+ const duration = endTiming(key, timings) || 0;
576
+ analytics.addEvent("Performance", {
577
+ actionType: "resolve",
578
+ actionLevel: "page",
579
+ label: key,
580
+ additionalData: { duration }
581
+ });
582
+ return {
583
+ result,
584
+ duration
585
+ };
586
+ } catch (error) {
587
+ const duration = endTiming(key, timings) || 0;
588
+ analytics.addEvent("Performance", {
589
+ actionType: "reject",
590
+ actionLevel: "page",
591
+ label: key,
592
+ additionalData: { duration }
593
+ });
594
+ throw error;
595
+ }
596
+ };
597
+ /**
598
+ * Convenience function to track async operation timing
599
+ * @param key - Unique identifier for the operation
600
+ * @param fn - Function to execute
601
+ * @param analytics - UserEvents instance for logging
602
+ * @returns Promise that resolves with the function result
603
+ */
604
+ var trackPerformance = async (key, fn, analytics) => {
605
+ const { result } = await withTiming(key, fn, analytics);
606
+ return result;
607
+ };
608
+ //#endregion
609
+ //#region src/api/companySearch/useCompanySearch.ts
610
+ /**
611
+ * Supports querying declaratively (`useCompanySearch` hook) and imperatively
612
+ * (`queryClient.fetchQuery()`) with the same config, ensuring no deviation occurs
613
+ * between the two types.
614
+ */
615
+ var companySearchQueryOptions = (rootLegalEntityId, baseUrl, data, userEvents, options) => {
616
+ return queryOptions({
617
+ queryKey: ["companySearch", data],
618
+ queryFn: () => trackPerformance("companySearchNetworkTime", () => handleCompanySearch(rootLegalEntityId, baseUrl, data), userEvents),
619
+ retry: 0,
620
+ meta: {
621
+ onSuccess: (data) => {
622
+ userEvents.addPageEvent("Success", {
623
+ actionType: "resolve",
624
+ returnValue: "companySearch",
625
+ additionalData: {
626
+ numberOfResults: data.results.length,
627
+ ..."provider" in data && { provider: data.provider }
628
+ }
629
+ });
630
+ },
631
+ onError: () => {
632
+ userEvents.addPageEvent("Encountered error", {
633
+ actionType: "resolve",
634
+ returnValue: "companySearch",
635
+ returnType: "backend"
636
+ });
637
+ }
638
+ },
639
+ ...options
640
+ });
641
+ };
642
+ var useCompanySearch = (data, options) => {
643
+ const { rootLegalEntityId, baseUrl } = useApiContext();
644
+ const userEvents = useAnalyticsContext();
645
+ return useQuery(companySearchQueryOptions(rootLegalEntityId.value, baseUrl.value, data, userEvents, options));
646
+ };
647
+ var handleCompanySearch = async (rootLegalEntityId, baseUrl, data) => {
648
+ return httpPost({
649
+ baseUrl,
650
+ path: `legalEntities/${rootLegalEntityId}/companySearch/search`
651
+ }, {
652
+ name: data.name,
653
+ country: data.country,
654
+ stateOrProvince: data.state,
655
+ ...data.registrationNumber ? { registrationNumber: data.registrationNumber } : {},
656
+ resultSizeLimit: data.resultSizeLimit ?? 15
657
+ });
658
+ };
659
+ //#endregion
660
+ //#region src/api/companyDataSet/handleCompanyDataset.ts
661
+ var handleCompanyDataset = async (rootLegalEntityId, baseUrl, data) => {
662
+ return httpPost({
663
+ baseUrl,
664
+ path: `legalEntities/${rootLegalEntityId}/companyDataset/select`
665
+ }, data);
666
+ };
667
+ //#endregion
668
+ //#region src/api/tinVerification/useVerifyTin.ts
669
+ /**
670
+ * Supports querying declaratively (`useVerifyTin` hook) and imperatively
671
+ * (`queryClient.fetchQuery()`) with the same config, ensuring no deviation occurs
672
+ * between the two types.
673
+ */
674
+ var verifyTinQueryOptions = (rootLegalEntityId, baseUrl, data, userEvents, options) => {
675
+ return queryOptions({
676
+ queryKey: ["verifyTin", data],
677
+ queryFn: data ? () => trackPerformance("verifyTinNetworkTime", () => verifyTin(rootLegalEntityId, baseUrl, data), userEvents) : skipToken,
678
+ retry: 0,
679
+ meta: {
680
+ onSuccess: (data) => {
681
+ if (data.matched === true) userEvents.addPageEvent("Success", {
682
+ actionType: "verify",
683
+ returnValue: "verifyTin",
684
+ returnType: "validation"
685
+ });
686
+ else userEvents.addPageEvent("Encountered error", {
687
+ actionType: "verify",
688
+ returnValue: "verifyTin",
689
+ returnType: "validation"
690
+ });
691
+ },
692
+ onError: () => {
693
+ userEvents.addPageEvent("Encountered error", {
694
+ actionType: "verify",
695
+ returnValue: "verifyTin",
696
+ returnType: "backend"
697
+ });
698
+ }
699
+ },
700
+ ...options
701
+ });
702
+ };
703
+ var verifyTin = async (legalEntityId, baseUrl, data) => {
704
+ return httpPost({
705
+ baseUrl,
706
+ path: `legalEntities/${legalEntityId}/verifyTin`
707
+ }, data);
708
+ };
709
+ //#endregion
710
+ //#region src/api/companySelection/useCompanySelection.ts
711
+ var useCompanySelection = (options) => {
712
+ const { rootLegalEntityId, baseUrl } = useApiContext();
713
+ const userEvents = useAnalyticsContext();
714
+ const queryClient = useQueryClient();
715
+ return useMutation({
716
+ mutationFn: async (data) => trackPerformance("companySelectionNetworkTime", () => handleCompanySelection(rootLegalEntityId.value, baseUrl.value, queryClient, data, userEvents), userEvents),
717
+ onSuccess: (data) => {
718
+ userEvents.addPageEvent("Success", {
719
+ actionType: "select",
720
+ returnValue: "companySelection",
721
+ returnType: "validation",
722
+ additionalData: { tinMatched: data.tinMatched === true }
723
+ });
724
+ },
725
+ onError: () => {
726
+ userEvents.addPageEvent("Encountered error", {
727
+ actionType: "select",
728
+ returnValue: "companySelection",
729
+ returnType: "backend"
730
+ });
731
+ },
732
+ retry: (count, error) => {
733
+ if ("errorCode" in error && typeof error.errorCode == "string") {
734
+ if (error.errorCode === "00_422") return false;
735
+ }
736
+ return count === 0;
737
+ },
738
+ ...options
739
+ });
740
+ };
741
+ var handleCompanySelection = async (rootLegalEntityId, baseUrl, queryClient, data, userEvents) => {
742
+ switch (data.country) {
743
+ case CountryCodes.UnitedStates: {
744
+ const verifyTinQueryInput = {
745
+ name: data.name,
746
+ tin: data.tin
747
+ };
748
+ const [companyDatasetResult, tinMatchResult] = await Promise.allSettled([handleCompanyDataset(rootLegalEntityId, baseUrl, { id: data.id }), queryClient.fetchQuery(verifyTinQueryOptions(rootLegalEntityId, baseUrl, verifyTinQueryInput, userEvents))]);
749
+ if (companyDatasetResult.status === "rejected") throw companyDatasetResult;
750
+ return {
751
+ ...companyDatasetResult.value,
752
+ tinMatched: tinMatchResult.status === "fulfilled" ? tinMatchResult.value.matched : false
753
+ };
754
+ }
755
+ default: {
756
+ const companyDatasetResult = await handleCompanyDataset(rootLegalEntityId, baseUrl, { id: data.id });
757
+ return {
758
+ ...companyDatasetResult,
759
+ registrationNumberMatched: companyDatasetResult.registrationNumber && data.registrationNumber ? data.registrationNumber === companyDatasetResult.registrationNumber : void 0
760
+ };
761
+ }
762
+ }
763
+ };
764
+ //#endregion
765
+ //#region src/components/Business/forms/BusinessSelection/BusinessInformationCard/BusinessInformationCard.tsx
766
+ function BusinessInformation({ fetching, selectedBusiness }) {
767
+ const { t } = useTranslation(["common", "business"]);
768
+ const items = useMemo$1(() => selectedBusiness ? entriesOf(selectedBusiness).reduce((acc, [key, value]) => {
769
+ switch (key) {
770
+ case "legalForm":
771
+ if (value) acc[0].details = value;
772
+ break;
773
+ case "name":
774
+ if (value) acc[1].details = value;
775
+ break;
776
+ case "registeredAddress":
777
+ case "principalPlaceOfBusinessAddress":
778
+ if (value && typeof value !== "string" && "fullAddress" in value) acc[2].details = value.fullAddress;
779
+ break;
780
+ default: break;
781
+ }
782
+ return acc;
783
+ }, [
784
+ {
785
+ term: t(($) => $["legalForm"], { ns: "common" }),
786
+ details: ""
787
+ },
788
+ {
789
+ term: t(($) => $["legalCompanyName"], { ns: "common" }),
790
+ details: ""
791
+ },
792
+ {
793
+ term: t(($) => $["address"], { ns: "common" }),
794
+ details: ""
795
+ }
796
+ ]).filter((item) => !!item.details) : [], [selectedBusiness, t]);
797
+ if (fetching) return /* @__PURE__ */ jsx(Loader, { size: "large" });
798
+ return /* @__PURE__ */ jsx(StructuredList, { items });
799
+ }
800
+ function BusinessInformationCard({ result, isSelected, currentBusinessSelection, fetching, error, handleSelectBusiness, retryCompanySelection }) {
801
+ const { t } = useTranslation(["common", "business"]);
802
+ const isLegalArrangementError = error && isBusinessSelectionLegalArrangementError(error);
803
+ return /* @__PURE__ */ jsx(Card, {
804
+ selected: isSelected,
805
+ onClick: isSelected ? void 0 : handleSelectBusiness,
806
+ children: /* @__PURE__ */ jsxs(StackLayout, { children: [/* @__PURE__ */ jsx(ListItem, {
807
+ avatar: {
808
+ iconName: "company",
809
+ circle: true
810
+ },
811
+ title: result.name,
812
+ description: result.registrationNumber,
813
+ accessory: fetching && isSelected ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : null
814
+ }), isSelected && !fetching && !isLegalArrangementError && /* @__PURE__ */ jsx(StackLayout, { children: error ? /* @__PURE__ */ jsx(Alert, {
815
+ variant: "info",
816
+ type: "callToAction",
817
+ title: t(($) => $["businessDetailsFailedToLoad"], { ns: "business" }),
818
+ actions: /* @__PURE__ */ jsx(Button, {
819
+ testId: "reloadBusiness",
820
+ onClick: retryCompanySelection,
821
+ variant: "link",
822
+ children: t(($) => $["tryAgain"], { ns: "common" })
823
+ }),
824
+ testId: "failedToLoad"
825
+ }) : /* @__PURE__ */ jsx(Card, {
826
+ variant: "secondary",
827
+ padding: "large",
828
+ children: /* @__PURE__ */ jsx(BusinessInformation, {
829
+ fetching,
830
+ selectedBusiness: currentBusinessSelection
831
+ })
832
+ }) })] })
833
+ });
834
+ }
835
+ function CompanyNotListedCard({ isSelected, handleSelectBusiness, fetching }) {
836
+ const { t } = useTranslation(["business"]);
837
+ return /* @__PURE__ */ jsx(Card, {
838
+ selected: isSelected,
839
+ onClick: isSelected ? void 0 : handleSelectBusiness,
840
+ children: /* @__PURE__ */ jsx(ListItem, {
841
+ title: t(($) => $["myBusinessIsntHere"], { ns: "business" }),
842
+ accessory: fetching && isSelected ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : null
843
+ })
844
+ });
845
+ }
846
+ //#endregion
847
+ //#region src/components/Business/forms/BusinessSelection/BusinessSelection.tsx
848
+ var BUSINESS_SELECTION_FIELDS = ["selectedBusinessId"];
849
+ var EMPTY_OBJ$4 = {};
850
+ function BusinessSelection({ id, country, fieldValidationErrors = EMPTY_OBJ$4, formVerificationErrors = EMPTY_OBJ$4 }) {
851
+ const { t } = useTranslation(["common", "business"]);
852
+ const { baseUrl, rootLegalEntityId } = useApiContext();
853
+ const { form } = useFormContext();
854
+ const queryClient = useQueryClient();
855
+ const userEvents = useAnalyticsContext();
856
+ const logger = createLogger();
857
+ const companySearchStateModel = useContext$1(CompanySearchStateContext);
858
+ const { data, valid, errors, allFields, requiredFields, optionalFields, obscuredFields, trustedFields, handleChange: handleChangeFor } = getFormSlice(form, "businessSelection");
859
+ const { data: companySearchResponse, isLoading: searching } = useCompanySearch({
860
+ name: companySearchStateModel.companySearchName.value ?? "",
861
+ country,
862
+ state: form.data.basicInformation?.stateOrProvince,
863
+ registrationNumber: form.data.basicInformation?.registrationNumber
864
+ });
865
+ const { data: selectData, error: selectError, mutateAsync: selectCompany, reset: resetSelectMutationState } = useCompanySelection();
866
+ const { mutateAsync: clearCompanyData } = useClearCompanyData();
867
+ const currentTin = form.data.basicInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number;
868
+ const currentRegistrationNumber = form.data.basicInformation?.registrationNumber;
869
+ /**
870
+ * This ID is internal to this form, controlling selection for UI & data flow purposes. The
871
+ * multiform state is used to determine whether the form is set & valid, ready for the user to progress.
872
+ */
873
+ const selectedId = useSignal("");
874
+ const isSelectPending = useSignal(false);
875
+ const selectedCompanyIdx = companySearchResponse?.results.findIndex((searchResult) => searchResult.resultId === selectedId.value);
876
+ /**
877
+ * Reset company selection when re-entering form.
878
+ *
879
+ * The mutation makes this a bit awkward, as we won't have any data when re-entering. Whilst we
880
+ * could perhaps auto-select the result, without caching, we'd have another spinner & wait time for
881
+ * the user. Better to force a manual re-selection to work around our rough implementation details.
882
+ */
883
+ const isInitializedRef = useRef$1(false);
884
+ if (!isInitializedRef.current) {
885
+ if (data?.selectedBusinessId) {
886
+ handleChangeFor("selectedBusinessId", "blur")("");
887
+ form.setErrors("businessSelection", "selectedBusinessId", null);
888
+ }
889
+ isInitializedRef.current = true;
890
+ }
891
+ const fetchCompanyData = async (result) => {
892
+ isSelectPending.value = true;
893
+ resetSelectMutationState();
894
+ try {
895
+ const companySelectionParams = {
896
+ id: result.resultId,
897
+ name: result.name,
898
+ tin: currentTin ?? "",
899
+ registrationNumber: currentRegistrationNumber ?? "",
900
+ country
901
+ };
902
+ const companySelectionResponse = await selectCompany(companySelectionParams);
903
+ handleChangeFor("selectedBusinessId", "blur")(result.resultId);
904
+ companySearchStateModel.selectCompany(companySelectionResponse, selectedCompanyIdx, country);
905
+ } catch (e) {
906
+ if (isBusinessSelectionLegalArrangementError(e)) {
907
+ companySearchStateModel.disallowSelection("LEGAL_ARRANGEMENT");
908
+ handleChangeFor("selectedBusinessId", "blur")("LEGAL_ARRANGEMENT_ERR");
909
+ } else logger.error(e);
910
+ } finally {
911
+ isSelectPending.value = false;
912
+ }
913
+ };
914
+ const handleSelectBusiness = (result) => {
915
+ selectedId.value = result.resultId;
916
+ companySearchStateModel.resetCompanySearchData();
917
+ fetchCompanyData(result);
918
+ };
919
+ const handleSelectNotListed = async () => {
920
+ selectedId.value = "notListed";
921
+ companySearchStateModel.resetCompanySearchData();
922
+ await clearCompanyData();
923
+ if (country !== CountryCodes.UnitedStates) return handleChangeFor("selectedBusinessId", "blur")("notListed");
924
+ try {
925
+ isSelectPending.value = true;
926
+ const tinVerificationParams = {
927
+ name: form.data.basicInformation?.legalCompanyName ?? "",
928
+ tin: currentTin ?? ""
929
+ };
930
+ const { matched } = await queryClient.fetchQuery(verifyTinQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), tinVerificationParams, userEvents));
931
+ companySearchStateModel.setVerificationMatched(!!matched);
932
+ handleChangeFor("selectedBusinessId", "blur")("notListed");
933
+ } catch (e) {
934
+ logger.error(e);
935
+ companySearchStateModel.setVerificationMatched(false);
936
+ handleChangeFor("selectedBusinessId", "blur")("notListed");
937
+ } finally {
938
+ isSelectPending.value = false;
939
+ }
940
+ };
941
+ const formUtils = useMemo$1(() => {
942
+ return createFormUtils({
943
+ data: data ?? {},
944
+ fieldValidationErrors,
945
+ formVerificationErrors,
946
+ allFields: allFields ?? [],
947
+ requiredFields: requiredFields ?? [],
948
+ optionalFields: optionalFields ?? [],
949
+ trustedFields: trustedFields ?? [],
950
+ obscuredFields: obscuredFields ?? [],
951
+ errors: errors ?? {},
952
+ valid: valid ?? {}
953
+ }, t);
954
+ }, [
955
+ allFields,
956
+ data,
957
+ errors,
958
+ obscuredFields,
959
+ optionalFields,
960
+ requiredFields,
961
+ trustedFields,
962
+ valid,
963
+ t,
964
+ fieldValidationErrors,
965
+ formVerificationErrors
966
+ ]);
967
+ return /* @__PURE__ */ jsx("form", {
968
+ id,
969
+ children: /* @__PURE__ */ jsxs(LoaderWrapper, {
970
+ loaderSize: "large",
971
+ status: searching ? "loading" : "success",
972
+ children: [
973
+ /* @__PURE__ */ jsx(Header, { title: t(($) => $["businessSelectionFormHeading"], { ns: "business" }) }),
974
+ /* @__PURE__ */ jsx(ErrorPanel, {
975
+ id: "ariaErrorField",
976
+ verificationErrors: formVerificationErrors,
977
+ validationErrors: fieldValidationErrors,
978
+ formUtils
979
+ }),
980
+ /* @__PURE__ */ jsx(Field, {
981
+ el: "fieldset",
982
+ name: "selectedBusinessId",
983
+ errorMessage: formUtils.getErrorMessage("selectedBusinessId", errors, fieldValidationErrors),
984
+ isValid: valid?.selectedBusinessId,
985
+ children: () => /* @__PURE__ */ jsxs(StackLayout, { children: [companySearchResponse?.results.map((result) => /* @__PURE__ */ jsx(BusinessInformationCard, {
986
+ result,
987
+ isSelected: selectedId.value === result.resultId,
988
+ currentBusinessSelection: selectData,
989
+ fetching: isSelectPending.value,
990
+ error: selectError,
991
+ handleSelectBusiness: () => handleSelectBusiness(result),
992
+ retryCompanySelection: () => fetchCompanyData(result)
993
+ }, result.resultId)), /* @__PURE__ */ jsx(CompanyNotListedCard, {
994
+ isSelected: selectedId.value === "notListed",
995
+ handleSelectBusiness: handleSelectNotListed,
996
+ fetching: isSelectPending.value
997
+ })] })
998
+ })
999
+ ]
1000
+ })
1001
+ });
1002
+ }
1003
+ //#endregion
1004
+ //#region src/components/Business/utils/companyTypeMetadata.ts
1005
+ var companyTypeMetadata = {
1006
+ privateCompany: {
1007
+ id: "privateCompany",
1008
+ name: "privateCompanyTitle",
1009
+ description: "privateCompanyDescription"
1010
+ },
1011
+ listedPublicCompany: {
1012
+ id: "listedPublicCompany",
1013
+ name: "publicCompanyTitle",
1014
+ description: "publicCompanyDescription"
1015
+ },
1016
+ partnershipIncorporated: {
1017
+ id: "partnershipIncorporated",
1018
+ name: "partnershipIncorporated",
1019
+ description: "partnershipIncorporatedDescription"
1020
+ },
1021
+ nonProfit: {
1022
+ id: "nonProfit",
1023
+ name: "nonProfitOrCharitableOrgTitle",
1024
+ description: "nonProfitOrCharitableOrgDescription"
1025
+ },
1026
+ governmentalOrganization: {
1027
+ id: "governmentalOrganization",
1028
+ name: "governmentalOrganizationTitle",
1029
+ description: "governmentalOrganizationDescription"
1030
+ },
1031
+ associationIncorporated: {
1032
+ id: "associationIncorporated",
1033
+ name: "associationIncorporated",
1034
+ description: "associationIncorporatedDescription"
1035
+ }
1036
+ };
1037
+ var companyTypeOptions = Object.keys(companyTypeMetadata);
1038
+ //#endregion
1039
+ //#region src/components/Business/utils/getAvailableCompanyStructures.ts
1040
+ function getAvailableCompanyStructures({ country, registrationNumberType, registrationNumberExempt, taxIdNumberType, legalEntity, accountHolder, isSettingEnabled }) {
1041
+ const isRootOrganization = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange) && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership";
1042
+ const excludedTypes = !!legalEntity.capabilities?.issueBankAccount?.requested ? [
1043
+ "partnershipIncorporated",
1044
+ "associationIncorporated",
1045
+ "governmentalOrganization"
1046
+ ] : ["partnershipIncorporated", "associationIncorporated"];
1047
+ const companyTypeRadioOptions = isRootOrganization ? companyTypeOptions.filter((companyType) => !excludedTypes.includes(companyType)) : companyTypeOptions;
1048
+ const validCompanyTypesByRegistrationNumber = registrationNumberExempt && isRegistrationExemptionAllowed({ country }) ? REGISTRATION_NUMBER_EXEMPTION_RULES[country] ?? [] : getValidCompanyTypesForRegistrationNumberType(country, registrationNumberType);
1049
+ const validCompanyTypesForRegistrationNumber = new Set(validCompanyTypesByRegistrationNumber);
1050
+ const validCompanyTypesForTaxId = new Set(getValidCompanyTypesForTaxIdNumberType(country, taxIdNumberType));
1051
+ const constrainedCompanyTypeRadioOptions = companyTypeRadioOptions.filter((companyType) => (!validCompanyTypesForRegistrationNumber.size || validCompanyTypesForRegistrationNumber.has(companyType)) && (!validCompanyTypesForTaxId.size || validCompanyTypesForTaxId.has(companyType)));
1052
+ return constrainedCompanyTypeRadioOptions.length > 0 ? constrainedCompanyTypeRadioOptions : companyTypeRadioOptions;
1053
+ }
1054
+ //#endregion
1055
+ //#region src/components/Business/forms/CompanyStructure/CompanyStructure.tsx
1056
+ var COMPANY_STRUCTURE_FIELDS = ["entityType"];
1057
+ var EMPTY_OBJ$3 = {};
1058
+ function CompanyStructure({ id, country, fieldValidationErrors = EMPTY_OBJ$3, formVerificationErrors = EMPTY_OBJ$3 }) {
1059
+ const { t } = useTranslation([
1060
+ "common",
1061
+ "business",
1062
+ "ui"
1063
+ ]);
1064
+ const { form } = useFormContext();
1065
+ const { accountHolder } = useAccountHolder();
1066
+ const { rootLegalEntityId } = useApiContext();
1067
+ const { data: legalEntity } = useLegalEntity(rootLegalEntityId.value);
1068
+ const { isSettingEnabled } = useSettingsContext();
1069
+ const { data, valid, errors, requiredFields, handleChange: handleChangeFor } = getFormSlice(form, "companyStructure");
1070
+ const formUtils = createFormUtils({ requiredFields: requiredFields ?? [] }, t);
1071
+ const registrationNumberType = form.data.basicInformation?.registrationNumberType;
1072
+ const taxIdNumberType = form.data.basicInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type;
1073
+ const registrationNumberExempt = form.data.basicInformation?.exemptedFromRegistrationNumber;
1074
+ const availableCompanyTypeRadioOptions = getAvailableCompanyStructures({
1075
+ country,
1076
+ registrationNumberType,
1077
+ registrationNumberExempt,
1078
+ taxIdNumberType,
1079
+ legalEntity: legalEntity || {},
1080
+ accountHolder,
1081
+ isSettingEnabled
1082
+ });
1083
+ const companyTypeExamples = useCompanyTypeExamples(country);
1084
+ const companyTiles = availableCompanyTypeRadioOptions.map((option) => {
1085
+ const description = t(($) => $[companyTypeMetadata[option].description], { ns: "business" });
1086
+ const examples = companyTypeExamples?.[option];
1087
+ const subTitle = examples ? `${description} ${t(($) => $["forExample_"], {
1088
+ examples: examples.join(", "),
1089
+ interpolation: { escapeValue: false },
1090
+ ns: "ui"
1091
+ })}` : description;
1092
+ return {
1093
+ value: option,
1094
+ label: t(($) => $[companyTypeMetadata[option].name], { ns: "business" }),
1095
+ subTitle
1096
+ };
1097
+ });
1098
+ return /* @__PURE__ */ jsxs("form", {
1099
+ id,
1100
+ children: [
1101
+ /* @__PURE__ */ jsx(Header, {
1102
+ title: t(($) => $["companyStructureFormHeading"], { ns: "business" }),
1103
+ description: t(($) => $["companyStructureFormDescription"], { ns: "business" })
1104
+ }),
1105
+ /* @__PURE__ */ jsx(ErrorPanel, {
1106
+ id: "ariaErrorField",
1107
+ verificationErrors: formVerificationErrors,
1108
+ validationErrors: fieldValidationErrors,
1109
+ formUtils
1110
+ }),
1111
+ /* @__PURE__ */ jsx(Field, {
1112
+ el: "fieldset",
1113
+ name: "entityType",
1114
+ errorMessage: formUtils.getErrorMessage("entityType", errors, fieldValidationErrors),
1115
+ isValid: valid?.entityType,
1116
+ children: (childProps) => /* @__PURE__ */ jsx(TileGroup, {
1117
+ ...childProps,
1118
+ name: "entityType",
1119
+ tiles: companyTiles,
1120
+ selected: data?.entityType ?? "",
1121
+ onChange: (value) => handleChangeFor("entityType")(value),
1122
+ isHorizontal: true,
1123
+ "aria-required": true,
1124
+ "aria-invalid": !valid?.entityType
1125
+ })
1126
+ })
1127
+ ]
1128
+ });
1129
+ }
1130
+ //#endregion
1131
+ //#region src/components/Shared/fields/FinancialReportingDate/FinancialReportingDate.tsx
1132
+ var FINANCIAL_REPORTING_DATE_FIELD = ["financialReportingDate"];
1133
+ function FinancialReportingDate({ data, valid, errors, labels, readonly, handleChangeFor }) {
1134
+ const { t } = useTranslation("common");
1135
+ return /* @__PURE__ */ jsx(Field, {
1136
+ name: "financialReportingDate",
1137
+ label: labels.financialReportingDate,
1138
+ helper: t(($) => $["dateOfTotalAssetsCalculation"]),
1139
+ helperPosition: "below",
1140
+ errorMessage: errors.financialReportingDate,
1141
+ isValid: valid.financialReportingDate,
1142
+ children: (childProps) => /* @__PURE__ */ jsx(InputDate, {
1143
+ ...childProps,
1144
+ name: "financialReportingDate",
1145
+ value: data.financialReportingDate,
1146
+ onInput: handleChangeFor("financialReportingDate", "input"),
1147
+ onBlur: handleChangeFor("financialReportingDate", "blur"),
1148
+ "aria-required": true,
1149
+ "aria-invalid": !valid.financialReportingDate,
1150
+ readonly,
1151
+ max: formatDateObj(/* @__PURE__ */ new Date())
1152
+ })
1153
+ });
1154
+ }
1155
+ //#endregion
1156
+ //#region src/components/Shared/fields/NumberOfEmployees/NumberOfEmployees.tsx
1157
+ var NUMBER_OF_EMPLOYEES_FIELD = ["numberOfEmployees"];
1158
+ function NumberOfEmployees({ data, valid, errors, labels, readonly, handleChangeFor }) {
1159
+ return /* @__PURE__ */ jsx(Field, {
1160
+ name: "numberOfEmployees",
1161
+ label: labels.numberOfEmployees,
1162
+ errorMessage: errors.numberOfEmployees,
1163
+ isValid: valid.numberOfEmployees,
1164
+ children: (childProps) => /* @__PURE__ */ jsx(InputNumber, {
1165
+ ...childProps,
1166
+ "aria-required": true,
1167
+ "aria-invalid": !valid.numberOfEmployees,
1168
+ name: "numberOfEmployees",
1169
+ min: "1",
1170
+ step: "1",
1171
+ value: data.numberOfEmployees,
1172
+ readonly,
1173
+ onInput: handleChangeFor("numberOfEmployees", "input"),
1174
+ onBlur: handleChangeFor("numberOfEmployees", "blur")
1175
+ })
1176
+ });
1177
+ }
1178
+ var ReportedValueOptionField_module_default = {
1179
+ "reported-value-options": "_reported-value-options_tqpoa_1",
1180
+ reportedValueOptions: "_reported-value-options_tqpoa_1",
1181
+ "reported-value": "_reported-value_tqpoa_1",
1182
+ reportedValue: "_reported-value_tqpoa_1",
1183
+ "reported-value-input": "_reported-value-input_tqpoa_11",
1184
+ reportedValueInput: "_reported-value-input_tqpoa_11",
1185
+ "reported-value-field": "_reported-value-field_tqpoa_15",
1186
+ reportedValueField: "_reported-value-field_tqpoa_15"
1187
+ };
1188
+ //#endregion
1189
+ //#region src/components/Shared/fields/ReportedValueOptionField/ReportedValue.tsx
1190
+ var ReportedValue = ({ currency, amount, onAmountChanged, label, helper, fieldName, errorMessage, isValid }) => {
1191
+ const { i18n } = useTranslation();
1192
+ return /* @__PURE__ */ jsx("div", {
1193
+ className: ReportedValueOptionField_module_default.reportedValue,
1194
+ children: /* @__PURE__ */ jsx(Field, {
1195
+ name: fieldName,
1196
+ errorMessage,
1197
+ isValid,
1198
+ helper,
1199
+ className: ReportedValueOptionField_module_default.reportedValueField,
1200
+ children: (childProps) => /* @__PURE__ */ jsx(InputCurrency, {
1201
+ ...childProps,
1202
+ locale: i18n.language,
1203
+ currency,
1204
+ amount,
1205
+ onAmountChanged,
1206
+ className: ReportedValueOptionField_module_default.reportedValueInput,
1207
+ "aria-label": label
1208
+ })
1209
+ })
1210
+ });
1211
+ };
1212
+ //#endregion
1213
+ //#region src/components/Shared/fields/ReportedValueOptionField/ReportedValueOptionField.tsx
1214
+ var REPORTED_VALUE_OPTION_FIELD = [
1215
+ "reportedValueOption",
1216
+ "balanceSheetTotal",
1217
+ "annualTurnover"
1218
+ ];
1219
+ function ReportedValueOptionField({ data, valid, errors, handleChangeFor, currency }) {
1220
+ const { t } = useTranslation("common");
1221
+ const updateReportedValueOption = (option) => {
1222
+ if (data.reportedValueOption) handleChangeFor(data.reportedValueOption)(null);
1223
+ const newReportedValue = option;
1224
+ handleChangeFor("reportedValueOption")(newReportedValue);
1225
+ };
1226
+ return /* @__PURE__ */ jsx(Field, {
1227
+ el: "fieldset",
1228
+ name: "reportedValueOption",
1229
+ label: t(($) => $["reportedValue"]),
1230
+ errorMessage: errors.reportedValueOption,
1231
+ helper: t(($) => $["useFiguresFromTheMostRecentYearAvailable"]),
1232
+ isValid: Boolean(valid.reportedValueOption),
1233
+ children: (childProps) => /* @__PURE__ */ jsx(RadioGroup, {
1234
+ name: "reportedValueOption",
1235
+ ...childProps,
1236
+ value: data.reportedValueOption,
1237
+ items: [{
1238
+ id: "balanceSheetTotal",
1239
+ name: "balanceSheetTotal",
1240
+ content: /* @__PURE__ */ jsx(ReportedValue, {
1241
+ label: t(($) => $["balanceSheetTotal"]),
1242
+ currency,
1243
+ amount: data.balanceSheetTotal,
1244
+ onAmountChanged: handleChangeFor("balanceSheetTotal"),
1245
+ fieldName: "balanceSheetTotal",
1246
+ isValid: valid.balanceSheetTotal,
1247
+ errorMessage: errors.balanceSheetTotal
1248
+ })
1249
+ }, {
1250
+ id: "annualTurnover",
1251
+ name: "annualTurnover",
1252
+ content: /* @__PURE__ */ jsx(ReportedValue, {
1253
+ label: t(($) => $["annualTurnover"]),
1254
+ currency,
1255
+ amount: data.annualTurnover,
1256
+ onAmountChanged: handleChangeFor("annualTurnover"),
1257
+ fieldName: "annualTurnover",
1258
+ isValid: valid.annualTurnover,
1259
+ errorMessage: errors.annualTurnover
1260
+ })
1261
+ }],
1262
+ onChange: updateReportedValueOption,
1263
+ showContentOnlyOnSelected: true,
1264
+ className: ReportedValueOptionField_module_default.reportedValueOptions
1265
+ })
1266
+ });
1267
+ }
1268
+ //#endregion
1269
+ //#region src/components/Business/forms/FinancialInformation/FinancialInformation.tsx
1270
+ var financialInformationFieldsForEu = [
1271
+ ...FINANCIAL_REPORTING_DATE_FIELD,
1272
+ ...CURRENCY_FIELD,
1273
+ ...REPORTED_VALUE_OPTION_FIELD
1274
+ ];
1275
+ var financialInformationFields = [
1276
+ ...NUMBER_OF_EMPLOYEES_FIELD,
1277
+ ...FINANCIAL_REPORTING_DATE_FIELD,
1278
+ ...CURRENCY_FIELD,
1279
+ ...REPORTED_VALUE_OPTION_FIELD
1280
+ ];
1281
+ var EMPTY_OBJ$2 = {};
1282
+ function FinancialInformation({ id, country, fieldValidationErrors = EMPTY_OBJ$2, formVerificationErrors = EMPTY_OBJ$2 }) {
1283
+ const { t } = useTranslation("common");
1284
+ const { form } = useFormContext();
1285
+ const defaultCurrency = currencyByCountry[country]?.[0] ?? "EUR";
1286
+ const { data, valid, errors, allFields, requiredFields, optionalFields, obscuredFields, trustedFields, fieldProblems, handleChange: handleChangeFor } = getFormSlice(form, "companyFinancialInformation");
1287
+ const formUtils = useMemo$1(() => createFormUtils({
1288
+ data: data ?? {},
1289
+ fieldValidationErrors,
1290
+ formVerificationErrors,
1291
+ allFields: allFields ?? [],
1292
+ requiredFields: requiredFields ?? [],
1293
+ optionalFields: optionalFields ?? [],
1294
+ trustedFields: trustedFields ?? [],
1295
+ obscuredFields: obscuredFields ?? [],
1296
+ errors: errors ?? {},
1297
+ valid: valid ?? {},
1298
+ handleFieldChange: handleChangeFor
1299
+ }, t), [
1300
+ data,
1301
+ fieldValidationErrors,
1302
+ formVerificationErrors,
1303
+ allFields,
1304
+ requiredFields,
1305
+ optionalFields,
1306
+ trustedFields,
1307
+ obscuredFields,
1308
+ errors,
1309
+ valid,
1310
+ handleChangeFor,
1311
+ t
1312
+ ]);
1313
+ const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
1314
+ return /* @__PURE__ */ jsxs("form", {
1315
+ id,
1316
+ children: [
1317
+ /* @__PURE__ */ jsx(Header, { title: t(($) => $["companyFinancialInformationFormHeading"], { ns: "business" }) }),
1318
+ /* @__PURE__ */ jsx(ErrorPanel, {
1319
+ id: "ariaErrorField",
1320
+ verificationErrors: formVerificationErrors,
1321
+ validationErrors: fieldValidationErrors,
1322
+ formUtils
1323
+ }),
1324
+ country === CountryCodes.UnitedKingdom && /* @__PURE__ */ jsx(NumberOfEmployees, {
1325
+ data: formUtils.getFieldData(data ?? {}, NUMBER_OF_EMPLOYEES_FIELD),
1326
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldProblems, NUMBER_OF_EMPLOYEES_FIELD),
1327
+ handleChangeFor,
1328
+ labels: formUtils.getFieldLabels(NUMBER_OF_EMPLOYEES_FIELD),
1329
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
1330
+ valid: formUtils.getFieldValid(valid ?? {}, NUMBER_OF_EMPLOYEES_FIELD)
1331
+ }),
1332
+ showField(FINANCIAL_REPORTING_DATE_FIELD) && /* @__PURE__ */ jsx(FinancialReportingDate, {
1333
+ data: formUtils.getFieldData(data ?? {}, FINANCIAL_REPORTING_DATE_FIELD),
1334
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldProblems, FINANCIAL_REPORTING_DATE_FIELD),
1335
+ handleChangeFor,
1336
+ labels: formUtils.getFieldLabels(FINANCIAL_REPORTING_DATE_FIELD),
1337
+ readonly: formUtils.isReadOnly("financialReportingDate"),
1338
+ valid: formUtils.getFieldValid(valid ?? {}, FINANCIAL_REPORTING_DATE_FIELD)
1339
+ }),
1340
+ showField(CURRENCY_FIELD) && /* @__PURE__ */ jsx(Currency, {
1341
+ country,
1342
+ labels: { currency: t(($) => $["reportingCurrency"]) },
1343
+ data: formUtils.getFieldData(data ?? {}, CURRENCY_FIELD),
1344
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldProblems, CURRENCY_FIELD),
1345
+ handleChangeFor,
1346
+ readonly: formUtils.isReadOnly("currency"),
1347
+ valid: formUtils.getFieldValid(valid ?? {}, CURRENCY_FIELD)
1348
+ }),
1349
+ showField(REPORTED_VALUE_OPTION_FIELD) && /* @__PURE__ */ jsx(ReportedValueOptionField, {
1350
+ data: formUtils.getFieldData(data ?? {}, REPORTED_VALUE_OPTION_FIELD),
1351
+ valid: formUtils.getFieldValid(valid ?? {}, REPORTED_VALUE_OPTION_FIELD),
1352
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldProblems, REPORTED_VALUE_OPTION_FIELD),
1353
+ handleChangeFor,
1354
+ currency: data?.currency ?? defaultCurrency
1355
+ })
1356
+ ]
1357
+ });
1358
+ }
1359
+ //#endregion
1360
+ //#region src/components/Business/forms/ProofOfAddressDocument/ProofOfAddressDocument.tsx
1361
+ var GuidanceContent$5 = ({ t }) => {
1362
+ return /* @__PURE__ */ jsx("div", {
1363
+ className: "adyen-kyc-upload-field__guidance",
1364
+ children: /* @__PURE__ */ jsxs("div", {
1365
+ className: "u-margin-bottom-24",
1366
+ children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsxs("ul", { children: [
1367
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["yourBusinesssLegalName"], { ns: "business" }) }),
1368
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["theCompleteAddress"], { ns: "business" }) }),
1369
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["anIssueDateWithinTheLast12Months"], { ns: "business" }) }),
1370
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["clearReadableText"], { ns: "business" }) })
1371
+ ] })]
1372
+ })
1373
+ });
1374
+ };
1375
+ function ProofOfAddressDocument({ id, country, ...props }) {
1376
+ const { t } = useTranslation(["common", "business"]);
1377
+ return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1378
+ ...props,
1379
+ id,
1380
+ heading: t(($) => $["uploadProofOfAddress"], { ns: "business" }),
1381
+ description: t(($) => $["toFinishVerifyingYourBusinessWeNeedAnOfficialDocumentThatConfirmsItsAddress"], { ns: "business" }),
1382
+ documentField: "proofOfAddress",
1383
+ documentType: "proofOfAddress",
1384
+ guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$5, { t }),
1385
+ country,
1386
+ hidePageCount: true
1387
+ });
1388
+ }
1389
+ //#endregion
1390
+ //#region src/components/Business/forms/ProofOfDirectorDocument/ProofOfDirectorDocument.tsx
1391
+ var documentTypes$2 = [{
1392
+ id: "Internal company document",
1393
+ name: "internalCompanyDocument"
1394
+ }, {
1395
+ id: "Business registry statement",
1396
+ name: "businessRegistryStatement"
1397
+ }];
1398
+ var GuidanceContent$4 = ({ t }) => {
1399
+ return /* @__PURE__ */ jsx("div", {
1400
+ className: "adyen-kyc-upload-field__guidance",
1401
+ children: /* @__PURE__ */ jsxs("div", {
1402
+ className: "u-margin-bottom-24",
1403
+ children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsxs("ul", { children: [
1404
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["includesTheDirectorsFullName"], { ns: "business" }) }),
1405
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["includesEvidenceOfTheIndividualsRole"], { ns: "business" }) }),
1406
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["issuedOrSignedByALegalRepresentative"], { ns: "business" }) })
1407
+ ] })]
1408
+ })
1409
+ });
1410
+ };
1411
+ function ProofOfDirectorDocument({ id, country, ...props }) {
1412
+ const { t } = useTranslation(["common", "business"]);
1413
+ const [selectedDocumentName, setSelectedDocumentName] = useState$1(documentTypes$2[0].id);
1414
+ return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1415
+ ...props,
1416
+ id,
1417
+ heading: t(($) => $["uploadYourOrganizationProofOfDirector"], { ns: "business" }),
1418
+ description: t(($) => $["weNeedAnOfficialDocument"], { ns: "business" }),
1419
+ documentField: "proofOfDirector",
1420
+ documentType: "proofOfDirector",
1421
+ guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$4, { t }),
1422
+ country,
1423
+ hidePageCount: true,
1424
+ documentTypeSelect: {
1425
+ selectedType: selectedDocumentName,
1426
+ setSelectedType: setSelectedDocumentName,
1427
+ options: documentTypes$2
1428
+ }
1429
+ });
1430
+ }
1431
+ //#endregion
1432
+ //#region src/components/Business/forms/ProofOfOwnershipDocument/ProofOfOwnershipDocument.tsx
1433
+ var DOC_TYPE_FOR_MULTI_UPLOAD = "Organizational chart and supporting document";
1434
+ var documentTypes$1 = [{
1435
+ id: "Certified Organizational chart",
1436
+ name: "certifiedOrganizationalChart"
1437
+ }, {
1438
+ id: "Organizational chart and supporting document",
1439
+ name: "organizationalChartAndSupportingDocument"
1440
+ }];
1441
+ var GuidanceContent$3 = ({ selectedDocumentName, t }) => {
1442
+ const [showGuidanceModal, setShowGuidanceModal] = useState$1(false);
1443
+ return /* @__PURE__ */ jsx("div", {
1444
+ className: "adyen-kyc-upload-field__guidance",
1445
+ children: /* @__PURE__ */ jsxs("div", {
1446
+ className: "u-margin-bottom-24",
1447
+ children: [
1448
+ /* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }),
1449
+ selectedDocumentName === "Certified Organizational chart" ? /* @__PURE__ */ jsxs("ul", { children: [
1450
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["showsOwnershipAndControllingRelations"], { ns: "business" }) }),
1451
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["entitiesMustIncludeANameLegalStructureAndCountryRegionOfRegistration"], { ns: "business" }) }),
1452
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["signedByALawyerAccountantAuditorWithinTheLast6Months"], { ns: "business" }) })
1453
+ ] }) : /* @__PURE__ */ jsxs("ul", { children: [/* @__PURE__ */ jsx("li", { children: t(($) => $["oneOrganizationalChartShowingOwnershipAndControllingRelations"], { ns: "business" }) }), /* @__PURE__ */ jsxs("ul", { children: [/* @__PURE__ */ jsx("li", { children: t(($) => $["entitiesMustIncludeANameLegalStructureAndCountryRegionOfRegistration"], { ns: "business" }) }), /* @__PURE__ */ jsxs("li", { children: [
1454
+ /* @__PURE__ */ jsxs("span", { children: [t(($) => $["one"], { ns: "common" }), " "] }),
1455
+ /* @__PURE__ */ jsx(Button, {
1456
+ onClick: () => setShowGuidanceModal(true),
1457
+ variant: "link",
1458
+ children: t(($) => $["supportingDocument"], { ns: "common" })
1459
+ }),
1460
+ /* @__PURE__ */ jsxs("span", { children: [" ", t(($) => $["describingTheOrganizationAndItsUBOSignedWithinTheLast6Months"], { ns: "business" })] })
1461
+ ] })] })] }),
1462
+ showGuidanceModal && /* @__PURE__ */ jsx(Modal, {
1463
+ size: "small",
1464
+ onClose: () => setShowGuidanceModal(false),
1465
+ ariaLabel: t(($) => $["whichDocumentsQualifyToProveOwnership"], { ns: "business" }),
1466
+ children: /* @__PURE__ */ jsxs(ModalContent, { children: [
1467
+ /* @__PURE__ */ jsx(Typography, {
1468
+ el: "h1",
1469
+ variant: "title-l",
1470
+ className: "u-margin-bottom-32 u-margin-top-32",
1471
+ children: t(($) => $["whichDocumentsQualifyToProveOwnership"], { ns: "business" })
1472
+ }),
1473
+ /* @__PURE__ */ jsx(Typography, {
1474
+ el: "p",
1475
+ variant: "body",
1476
+ children: t(($) => $["theDocumentsWeCanAcceptToProveOwnershipAre"], { ns: "business" })
1477
+ }),
1478
+ /* @__PURE__ */ jsxs("ul", { children: [
1479
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["securitiesRegister"], { ns: "business" }) }),
1480
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["shareholderRegister"], { ns: "business" }) }),
1481
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["ultimateBeneficialOwnerRegister"], { ns: "business" }) }),
1482
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["articlesOfIncorporation"], { ns: "business" }) }),
1483
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["annualReports"], { ns: "business" }) }),
1484
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["annualReturns"], { ns: "business" }) }),
1485
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["certificateOfCorporateStatus"], { ns: "business" }) }),
1486
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["shareholderAgreements"], { ns: "business" }) }),
1487
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["assignmentAgreements"], { ns: "business" }) }),
1488
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["partnershipAgreements"], { ns: "business" }) }),
1489
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["boardOfDirectorsMeetingRecords"], { ns: "business" }) }),
1490
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["registrationDocument"], { ns: "business" }) }),
1491
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["certificateOfIncumbency"], { ns: "business" }) })
1492
+ ] })
1493
+ ] })
1494
+ })
1495
+ ]
1496
+ })
1497
+ });
1498
+ };
1499
+ function ProofOfOwnershipDocument({ id, country, ...props }) {
1500
+ const { t } = useTranslation(["common", "business"]);
1501
+ const [selectedDocumentName, setSelectedDocumentName] = useState$1(documentTypes$1[0].id);
1502
+ const supportsMultiple = selectedDocumentName === DOC_TYPE_FOR_MULTI_UPLOAD;
1503
+ useEffect$1(() => {
1504
+ if (props.data?.proofOfOwnership?.length === 2) setSelectedDocumentName(DOC_TYPE_FOR_MULTI_UPLOAD);
1505
+ }, [props.data?.proofOfOwnership]);
1506
+ return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1507
+ ...props,
1508
+ id,
1509
+ heading: t(($) => $["uploadYourOrganizationProofOfOwnership"], { ns: "business" }),
1510
+ description: t(($) => $["weNeedAnOfficialDocumentForOwnership"], { ns: "business" }),
1511
+ documentField: "proofOfOwnership",
1512
+ documentType: "proofOfOwnership",
1513
+ guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$3, {
1514
+ selectedDocumentName,
1515
+ t
1516
+ }),
1517
+ country,
1518
+ label: t(($) => $["uploadYourDocuments"], { ns: "business" }),
1519
+ documentTypeSelect: {
1520
+ selectedType: selectedDocumentName,
1521
+ setSelectedType: setSelectedDocumentName,
1522
+ options: documentTypes$1
1523
+ },
1524
+ hidePageCount: true,
1525
+ supportsMultipleUploads: supportsMultiple,
1526
+ maxNumberOfFiles: supportsMultiple ? 2 : 1,
1527
+ extraDropzoneDescription: supportsMultiple ? t(($) => $["oneOrganizationalChartAndOneSupportingDocument"], { ns: "business" }) : void 0
1528
+ });
1529
+ }
1530
+ //#endregion
1531
+ //#region src/components/Business/forms/ProofOfSignatoryDocument/ProofOfSignatoryDocument.tsx
1532
+ var documentTypes = [{
1533
+ id: "Trade registry document",
1534
+ name: "tradeRegistryDocument"
1535
+ }, {
1536
+ id: "Internal company document",
1537
+ name: "internalCompanyDocument"
1538
+ }];
1539
+ var GuidanceContent$2 = ({ t }) => {
1540
+ return /* @__PURE__ */ jsx("div", {
1541
+ className: "adyen-kyc-upload-field__guidance",
1542
+ children: /* @__PURE__ */ jsxs("div", {
1543
+ className: "u-margin-bottom-24",
1544
+ children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsxs("ul", { children: [
1545
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["includesTheSignatorysFullName"], { ns: "business" }) }),
1546
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["includesEvidenceOfTheIndividualsRoleSignatory"], { ns: "business" }) }),
1547
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["issuedOrSignedByALegalRepresentative"], { ns: "business" }) })
1548
+ ] })]
1549
+ })
1550
+ });
1551
+ };
1552
+ function ProofOfSignatoryDocument({ id, country, ...props }) {
1553
+ const { t } = useTranslation(["common", "business"]);
1554
+ const [selectedDocumentName, setSelectedDocumentName] = useState$1(documentTypes[0].id);
1555
+ return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1556
+ ...props,
1557
+ id,
1558
+ heading: t(($) => $["uploadYourOrganizationProofOfSignatory"], { ns: "business" }),
1559
+ description: t(($) => $["weNeedAnOfficialDocumentSignatory"], { ns: "business" }),
1560
+ documentField: "proofOfSignatory",
1561
+ documentType: "proofOfSignatory",
1562
+ guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$2, { t }),
1563
+ country,
1564
+ hidePageCount: true,
1565
+ documentTypeSelect: {
1566
+ selectedType: selectedDocumentName,
1567
+ setSelectedType: setSelectedDocumentName,
1568
+ options: documentTypes
1569
+ }
1570
+ });
1571
+ }
1572
+ //#endregion
1573
+ //#region src/components/Business/forms/RegistrationDocument/config.ts
1574
+ var ACCEPTED_DOCUMENTS_MAP$1 = {
1575
+ [CountryCodes.PuertoRico]: {
1576
+ privateCompany: {
1577
+ header: "acceptedDocumentsForPrivateCompanies",
1578
+ documents: [
1579
+ "certificateOfIncorporation",
1580
+ "certificateOfFormation",
1581
+ "secretaryOfStateFiling__PR"
1582
+ ]
1583
+ },
1584
+ listedPublicCompany: {
1585
+ header: "acceptedDocumentsForPublicCompanies",
1586
+ documents: ["certificateOfIncorporation", "certificateOfFormation"]
1587
+ },
1588
+ unlistedPublicCompany: {
1589
+ header: "acceptedDocumentsForPublicCompanies",
1590
+ documents: ["certificateOfIncorporation", "certificateOfFormation"]
1591
+ },
1592
+ governmentalOrganization: {
1593
+ header: "acceptedDocumentsForGovernment",
1594
+ documents: ["charter"]
1595
+ },
1596
+ nonProfit: {
1597
+ header: "acceptedDocumentsForNonProfit",
1598
+ documents: [
1599
+ "articlesOfIncorporation",
1600
+ "meetingRecords",
1601
+ "secretaryOfStateRegDoc__PR",
1602
+ "certificateOfIncumbency"
1603
+ ]
1604
+ },
1605
+ partnershipIncorporated: {
1606
+ header: "acceptedDocumentsForPartnerships",
1607
+ documents: ["partnerShipAgreement", "secretaryOfStateFiling__PR"]
1608
+ }
1609
+ },
1610
+ [CountryCodes.UnitedStates]: {
1611
+ privateCompany: {
1612
+ header: "acceptedDocumentsForPrivateCompanies",
1613
+ documents: [
1614
+ "certificateOfIncorporation",
1615
+ "certificateOfFormation",
1616
+ "secretaryOfStateFiling"
1617
+ ]
1618
+ },
1619
+ listedPublicCompany: {
1620
+ header: "acceptedDocumentsForPublicCompanies",
1621
+ documents: ["certificateOfIncorporation", "certificateOfFormation"]
1622
+ },
1623
+ unlistedPublicCompany: {
1624
+ header: "acceptedDocumentsForPublicCompanies",
1625
+ documents: ["certificateOfIncorporation", "certificateOfFormation"]
1626
+ },
1627
+ governmentalOrganization: {
1628
+ header: "acceptedDocumentsForGovernment",
1629
+ documents: ["charter"]
1630
+ },
1631
+ nonProfit: {
1632
+ header: "acceptedDocumentsForNonProfit",
1633
+ documents: [
1634
+ "articlesOfIncorporation",
1635
+ "meetingRecords",
1636
+ "secretaryOfStateRegDoc",
1637
+ "certificateOfIncumbency"
1638
+ ]
1639
+ },
1640
+ partnershipIncorporated: {
1641
+ header: "acceptedDocumentsForPartnerships",
1642
+ documents: ["partnerShipAgreement", "secretaryOfStateFiling"]
1643
+ }
1644
+ }
1645
+ };
1646
+ //#endregion
1647
+ //#region src/components/Business/forms/RegistrationDocument/RegistrationDocument.tsx
1648
+ var GuidanceContent$1 = ({ country, companyType, t }) => {
1649
+ const acceptedDocGuidance = ACCEPTED_DOCUMENTS_MAP$1[country]?.[companyType];
1650
+ return /* @__PURE__ */ jsx("div", {
1651
+ className: "adyen-kyc-upload-field__guidance",
1652
+ children: country === "US" || country === "MX" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [acceptedDocGuidance && /* @__PURE__ */ jsxs("div", {
1653
+ className: "u-margin-bottom-24",
1654
+ children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $[acceptedDocGuidance.header], { ns: "business" }) }), /* @__PURE__ */ jsx("ul", { children: acceptedDocGuidance.documents.map((document, i) => /* @__PURE__ */ jsx("li", { children: t(($) => $[document], { ns: "business" }) }, i)) })]
1655
+ }), /* @__PURE__ */ jsxs("div", {
1656
+ className: "u-margin-bottom-24",
1657
+ children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsx("ul", { children: /* @__PURE__ */ jsx("li", { children: t(($) => $["includesLegalCompanyName"], { ns: "business" }) }) })]
1658
+ })] }) : /* @__PURE__ */ jsxs("div", {
1659
+ className: "u-margin-bottom-24",
1660
+ children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsx("ul", { children: /* @__PURE__ */ jsx("li", { children: t(($) => $["documentIssuedByGovernmentAuthority"], { ns: "business" }) }) })]
1661
+ })
1662
+ });
1663
+ };
1664
+ function RegistrationDocument({ id, country, companyType = "privateCompany", ...props }) {
1665
+ const { t } = useTranslation(["common", "business"]);
1666
+ const config = getLabelConfig(country);
1667
+ return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1668
+ ...props,
1669
+ id,
1670
+ heading: t(($) => $[config.heading], { ns: "business" }),
1671
+ description: t(($) => $["companyRegistrationDocumentFormDescription"], { ns: "business" }),
1672
+ documentField: "registrationDocument",
1673
+ documentType: "registrationDocument",
1674
+ guidanceContent: /* @__PURE__ */ jsx(GuidanceContent$1, {
1675
+ country,
1676
+ companyType,
1677
+ t
1678
+ }),
1679
+ companyType,
1680
+ country,
1681
+ hidePageCount: true
1682
+ });
1683
+ }
1684
+ function getLabelConfig(country) {
1685
+ switch (country) {
1686
+ case "MX": return { heading: "uploadAConstanciaDeSituacionFiscalDocument" };
1687
+ default: return { heading: "companyRegistrationDocumentFormHeading" };
1688
+ }
1689
+ }
1690
+ //#endregion
1691
+ //#region src/components/Business/forms/TaxDocument/config.ts
1692
+ var ACCEPTED_DOCUMENTS_MAP = {
1693
+ [CountryCodes.PuertoRico]: {
1694
+ privateCompany: {
1695
+ header: "acceptedDocumentsForPrivateCompanies",
1696
+ documents: ["irsCP575"]
1697
+ },
1698
+ listedPublicCompany: {
1699
+ header: "acceptedDocumentsForPublicCompanies",
1700
+ documents: ["annualReport", "secForm10k"]
1701
+ },
1702
+ unlistedPublicCompany: {
1703
+ header: "acceptedDocumentsForPublicCompanies",
1704
+ documents: ["annualReport", "secForm10k"]
1705
+ },
1706
+ nonProfit: {
1707
+ header: "acceptedDocumentsForNonProfit",
1708
+ documents: ["annualReport"]
1709
+ },
1710
+ partnershipIncorporated: {
1711
+ header: "acceptedDocumentsForPartnerships",
1712
+ documents: ["irsScheduleK1"]
1713
+ }
1714
+ },
1715
+ [CountryCodes.UnitedStates]: {
1716
+ privateCompany: {
1717
+ header: "acceptedDocumentsForPrivateCompanies",
1718
+ documents: ["irsCP575"]
1719
+ },
1720
+ listedPublicCompany: {
1721
+ header: "acceptedDocumentsForPublicCompanies",
1722
+ documents: ["annualReport", "secForm10k"]
1723
+ },
1724
+ unlistedPublicCompany: {
1725
+ header: "acceptedDocumentsForPublicCompanies",
1726
+ documents: ["annualReport", "secForm10k"]
1727
+ },
1728
+ nonProfit: {
1729
+ header: "acceptedDocumentsForNonProfit",
1730
+ documents: ["annualReport"]
1731
+ },
1732
+ partnershipIncorporated: {
1733
+ header: "acceptedDocumentsForPartnerships",
1734
+ documents: ["irsScheduleK1"]
1735
+ }
1736
+ }
1737
+ };
1738
+ //#endregion
1739
+ //#region src/components/Business/forms/TaxDocument/TaxDocument.tsx
1740
+ var GuidanceContent = ({ country, companyType }) => {
1741
+ const { t } = useTranslation(["common", "business"]);
1742
+ const acceptedDocGuidance = ACCEPTED_DOCUMENTS_MAP[country]?.[companyType];
1743
+ return /* @__PURE__ */ jsx("div", {
1744
+ className: "adyen-kyc-upload-field__guidance",
1745
+ children: country === "US" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [acceptedDocGuidance && /* @__PURE__ */ jsxs("div", {
1746
+ className: "u-margin-bottom-24",
1747
+ children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $[acceptedDocGuidance.header], { ns: "business" }) }), /* @__PURE__ */ jsx("ul", { children: acceptedDocGuidance.documents.map((document, i) => /* @__PURE__ */ jsx("li", { children: t(($) => $[document], { ns: "business" }) }, i)) })]
1748
+ }), /* @__PURE__ */ jsxs("div", {
1749
+ className: "u-margin-bottom-24",
1750
+ children: [/* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"], { ns: "common" }) }), /* @__PURE__ */ jsxs("ul", { children: [/* @__PURE__ */ jsx("li", { children: t(($) => $["includesLegalCompanyName"], { ns: "business" }) }), /* @__PURE__ */ jsx("li", { children: t(($) => $["includesEIN"], { ns: "business" }) })] })]
1751
+ })] }) : /* @__PURE__ */ jsxs("div", {
1752
+ className: "u-margin-bottom-24",
1753
+ children: [/* @__PURE__ */ jsx("div", {
1754
+ className: "adyen-kyc-upload-field__subtitle",
1755
+ children: t(($) => $["documentRequirements"], { ns: "common" })
1756
+ }), /* @__PURE__ */ jsxs("ul", { children: [
1757
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["containsNameOfCompany"], { ns: "business" }) }),
1758
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["documentShowsTaxIdOfCompany"], { ns: "business" }) }),
1759
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["issuedByTheTaxAuthority"], { ns: "business" }) })
1760
+ ] })]
1761
+ })
1762
+ });
1763
+ };
1764
+ function TaxDocument({ id, country, companyType = "privateCompany", ...props }) {
1765
+ const { t } = useTranslation("business");
1766
+ return /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1767
+ ...props,
1768
+ id,
1769
+ heading: t(($) => $["companyTaxDocumentFormHeading"]),
1770
+ description: t(($) => $["companyTaxDocumentFormDescription"]),
1771
+ documentField: "taxDocument",
1772
+ documentType: "proofOfOrganizationTaxInfo",
1773
+ guidanceContent: /* @__PURE__ */ jsx(GuidanceContent, {
1774
+ country,
1775
+ companyType
1776
+ }),
1777
+ companyType,
1778
+ country,
1779
+ hidePageCount: true
1780
+ });
1781
+ }
1782
+ //#endregion
1783
+ //#region src/components/Business/forms/BusinessDetails/BusinessDetails.tsx
1784
+ var VatDocument = ({ children }) => {
1785
+ return children;
1786
+ };
1787
+ var EMPTY_OBJ$1 = {};
1788
+ function BusinessDetails({ taskType, country, activeForm, shouldValidate, problems = EMPTY_OBJ$1, isTopLevelEntity }) {
1789
+ const { t } = useTranslation(["common", "business"]);
1790
+ const { form } = useFormContext();
1791
+ const companyType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? "soleProprietorship" : form.data.companyStructure?.entityType;
1792
+ function handleChange(formName, fieldName, mode) {
1793
+ return form.handleChangeFor(formName, fieldName, mode);
1794
+ }
1795
+ const renderActiveForm = (activeForm) => {
1796
+ switch (activeForm.formId) {
1797
+ case "basicInformation": return /* @__PURE__ */ jsx(BasicInformation, {
1798
+ id: activeForm.formId,
1799
+ country,
1800
+ shouldValidate,
1801
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId],
1802
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId],
1803
+ companyType,
1804
+ isTopLevelEntity,
1805
+ disableCountry: taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY,
1806
+ taskType
1807
+ });
1808
+ case "businessSelection": return /* @__PURE__ */ jsx(BusinessSelection, {
1809
+ id: activeForm.formId,
1810
+ country,
1811
+ shouldValidate,
1812
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId],
1813
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId]
1814
+ });
1815
+ case "companyStructure": return /* @__PURE__ */ jsx(CompanyStructure, {
1816
+ id: activeForm.formId,
1817
+ country,
1818
+ shouldValidate,
1819
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId],
1820
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId]
1821
+ });
1822
+ case "additionalInformation": return /* @__PURE__ */ jsx(AdditionalInformation, {
1823
+ id: activeForm.formId,
1824
+ country,
1825
+ companyType,
1826
+ shouldValidate,
1827
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId],
1828
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId]
1829
+ });
1830
+ case "companyTaxDocument": return country === "US" ? /* @__PURE__ */ jsx(TaxDocument, {
1831
+ id: activeForm.formId,
1832
+ country,
1833
+ companyType,
1834
+ shouldValidate,
1835
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1836
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {},
1837
+ data: form.data.companyTaxDocument,
1838
+ errors: form.errors.companyTaxDocument,
1839
+ valid: form.valid.companyTaxDocument,
1840
+ allFields: form.allFields?.companyTaxDocument,
1841
+ requiredFields: form.requiredFields?.companyTaxDocument,
1842
+ optionalFields: form.optionalFields?.companyTaxDocument,
1843
+ trustedFields: form.trustedFields?.companyTaxDocument,
1844
+ handleFieldChange: (fieldName) => handleChange("companyTaxDocument", fieldName)
1845
+ }) : /* @__PURE__ */ jsx(VatDocument, { children: /* @__PURE__ */ jsx(MemoizedDocumentUpload, {
1846
+ id: activeForm.formId,
1847
+ country,
1848
+ companyType,
1849
+ shouldValidate,
1850
+ heading: t(($) => $["companyTaxDocumentFormHeading"], { ns: "business" }),
1851
+ description: t(($) => $["companyTaxDocumentFormDescription"], { ns: "business" }),
1852
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1853
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {},
1854
+ data: form.data.companyTaxDocument,
1855
+ errors: form.errors.companyTaxDocument,
1856
+ valid: form.valid.companyTaxDocument,
1857
+ allFields: form.allFields?.companyTaxDocument,
1858
+ requiredFields: form.requiredFields?.companyTaxDocument,
1859
+ optionalFields: form.optionalFields?.companyTaxDocument,
1860
+ trustedFields: form.trustedFields?.companyTaxDocument,
1861
+ handleFieldChange: (fieldName) => handleChange("companyTaxDocument", fieldName),
1862
+ documentField: "taxDocument",
1863
+ documentType: "vatDocument",
1864
+ hidePageCount: true,
1865
+ guidanceContent: /* @__PURE__ */ jsxs("div", {
1866
+ className: "u-margin-bottom-24",
1867
+ children: [/* @__PURE__ */ jsxs("div", {
1868
+ className: "adyen-kyc-upload-field__subtitle",
1869
+ children: [" ", t(($) => $["requirements"], { ns: "common" })]
1870
+ }), /* @__PURE__ */ jsxs("ul", { children: [
1871
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["containsNameOfCompany"], { ns: "business" }) }),
1872
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["documentShowsTaxIdOfCompany"], { ns: "business" }) }),
1873
+ /* @__PURE__ */ jsx("li", { children: t(($) => $["issuedByTheTaxAuthority"], { ns: "business" }) })
1874
+ ] })]
1875
+ })
1876
+ }) });
1877
+ case "companyRegistrationDocument": return /* @__PURE__ */ jsx(RegistrationDocument, {
1878
+ id: activeForm.formId,
1879
+ country,
1880
+ companyType,
1881
+ data: form.data.companyRegistrationDocument,
1882
+ errors: form.errors.companyRegistrationDocument,
1883
+ valid: form.valid.companyRegistrationDocument,
1884
+ allFields: form.allFields?.companyRegistrationDocument,
1885
+ requiredFields: form.requiredFields?.companyRegistrationDocument,
1886
+ optionalFields: form.optionalFields?.companyRegistrationDocument,
1887
+ trustedFields: form.trustedFields?.companyRegistrationDocument,
1888
+ handleFieldChange: (fieldName) => handleChange("companyRegistrationDocument", fieldName),
1889
+ shouldValidate,
1890
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1891
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1892
+ });
1893
+ case "companyProofOfDirectorDocument": return /* @__PURE__ */ jsx(ProofOfDirectorDocument, {
1894
+ id: activeForm.formId,
1895
+ country,
1896
+ data: form.data.companyProofOfDirectorDocument,
1897
+ errors: form.errors.companyProofOfDirectorDocument,
1898
+ valid: form.valid.companyProofOfDirectorDocument,
1899
+ allFields: form.allFields?.companyProofOfDirectorDocument,
1900
+ requiredFields: form.requiredFields?.companyProofOfDirectorDocument,
1901
+ optionalFields: form.optionalFields?.companyProofOfDirectorDocument,
1902
+ trustedFields: form.trustedFields?.companyProofOfDirectorDocument,
1903
+ handleFieldChange: (fieldName) => handleChange("companyProofOfDirectorDocument", fieldName),
1904
+ shouldValidate,
1905
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1906
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1907
+ });
1908
+ case "companyProofOfSignatoryDocument": return /* @__PURE__ */ jsx(ProofOfSignatoryDocument, {
1909
+ id: activeForm.formId,
1910
+ country,
1911
+ data: form.data.companyProofOfSignatoryDocument,
1912
+ errors: form.errors.companyProofOfSignatoryDocument,
1913
+ valid: form.valid.companyProofOfSignatoryDocument,
1914
+ allFields: form.allFields?.companyProofOfSignatoryDocument,
1915
+ requiredFields: form.requiredFields?.companyProofOfSignatoryDocument,
1916
+ optionalFields: form.optionalFields?.companyProofOfSignatoryDocument,
1917
+ trustedFields: form.trustedFields?.companyProofOfSignatoryDocument,
1918
+ handleFieldChange: (fieldName) => handleChange("companyProofOfSignatoryDocument", fieldName),
1919
+ shouldValidate,
1920
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1921
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1922
+ });
1923
+ case "companyProofOfAddressDocument": return /* @__PURE__ */ jsx(ProofOfAddressDocument, {
1924
+ id: activeForm.formId,
1925
+ country,
1926
+ data: form.data.companyProofOfAddressDocument,
1927
+ errors: form.errors.companyProofOfAddressDocument,
1928
+ valid: form.valid.companyProofOfAddressDocument,
1929
+ allFields: form.allFields?.companyProofOfAddressDocument,
1930
+ requiredFields: form.requiredFields?.companyProofOfAddressDocument,
1931
+ optionalFields: form.optionalFields?.companyProofOfAddressDocument,
1932
+ trustedFields: form.trustedFields?.companyProofOfAddressDocument,
1933
+ handleFieldChange: (fieldName) => handleChange("companyProofOfAddressDocument", fieldName),
1934
+ shouldValidate,
1935
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1936
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1937
+ });
1938
+ case "companyProofOfOwnershipDocument": return /* @__PURE__ */ jsx(ProofOfOwnershipDocument, {
1939
+ id: activeForm.formId,
1940
+ country,
1941
+ data: form.data.companyProofOfOwnershipDocument,
1942
+ errors: form.errors.companyProofOfOwnershipDocument,
1943
+ valid: form.valid.companyProofOfOwnershipDocument,
1944
+ allFields: form.allFields?.companyProofOfOwnershipDocument,
1945
+ requiredFields: form.requiredFields?.companyProofOfOwnershipDocument,
1946
+ optionalFields: form.optionalFields?.companyProofOfOwnershipDocument,
1947
+ trustedFields: form.trustedFields?.companyProofOfOwnershipDocument,
1948
+ handleFieldChange: (fieldName) => handleChange("companyProofOfOwnershipDocument", fieldName),
1949
+ shouldValidate,
1950
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1951
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1952
+ });
1953
+ case "companyConstitutionalDocument": return /* @__PURE__ */ jsx(MemoizedConstitutionalDocument, {
1954
+ id: activeForm.formId,
1955
+ legalEntityType: "soleProprietorship",
1956
+ country,
1957
+ data: form.data.companyConstitutionalDocument,
1958
+ errors: form.errors.companyConstitutionalDocument,
1959
+ valid: form.valid.companyConstitutionalDocument,
1960
+ allFields: form.allFields?.companyConstitutionalDocument,
1961
+ requiredFields: form.requiredFields?.companyConstitutionalDocument,
1962
+ optionalFields: form.optionalFields?.companyConstitutionalDocument,
1963
+ trustedFields: form.trustedFields?.companyConstitutionalDocument,
1964
+ handleFieldChange: (fieldName) => handleChange("companyConstitutionalDocument", fieldName),
1965
+ shouldValidate,
1966
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1967
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1968
+ });
1969
+ case "companyFinancialInformation": return /* @__PURE__ */ jsx(FinancialInformation, {
1970
+ id: activeForm.formId,
1971
+ country,
1972
+ shouldValidate,
1973
+ fieldValidationErrors: problems.validationErrors?.[activeForm.formId] ?? {},
1974
+ formVerificationErrors: problems.verificationErrors?.[activeForm.formId] ?? {}
1975
+ });
1976
+ default: return null;
1977
+ }
1978
+ };
1979
+ return /* @__PURE__ */ jsx("div", { children: renderActiveForm(activeForm) });
1980
+ }
1981
+ //#endregion
1982
+ //#region src/components/Business/forms/CompanyStructure/validate.ts
1983
+ var CompanyStructureValidation = { entityType: {
1984
+ modes: ["blur"],
1985
+ validate: (entityType) => !isEmpty(entityType),
1986
+ errorMessage: "fieldIsRequired"
1987
+ } };
1988
+ //#endregion
1989
+ //#region src/components/Shared/fields/Currency/fieldConfig.ts
1990
+ var currencyMetadata = { validators: {
1991
+ modes: ["blur"],
1992
+ validate: (currency) => !isEmpty(currency),
1993
+ errorMessage: "fieldIsRequired"
1994
+ } };
1995
+ //#endregion
1996
+ //#region src/components/Shared/fields/FinancialReportingDate/fieldConfig.ts
1997
+ var financialReportingDateMetadata = { validators: [{
1998
+ modes: ["blur"],
1999
+ validate: (date) => !isEmpty(date),
2000
+ errorMessage: "fieldIsRequired"
2001
+ }, {
2002
+ modes: ["blur"],
2003
+ validate: (date) => date ? new Date(date) < /* @__PURE__ */ new Date() : false,
2004
+ errorMessage: "invalidFinancialReportingDate"
2005
+ }] };
2006
+ //#endregion
2007
+ //#region src/components/Shared/fields/NumberOfEmployees/fieldConfig.ts
2008
+ var numberOfEmployeesMetadata = { validators: [{
2009
+ modes: ["blur"],
2010
+ validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
2011
+ errorMessage: "fieldIsRequired"
2012
+ }, {
2013
+ modes: ["blur"],
2014
+ validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)) && Number(numberOfEmployees) > 0,
2015
+ errorMessage: "pleaseEnterAValidWholeNumber"
2016
+ }] };
2017
+ //#endregion
2018
+ //#region src/components/Business/forms/FinancialInformation/validate.ts
2019
+ var financialInfoValidationRules = {
2020
+ financialReportingDate: financialReportingDateMetadata.validators,
2021
+ currency: currencyMetadata.validators,
2022
+ reportedValueOption: { validators: {
2023
+ modes: ["blur"],
2024
+ validate: (option) => !isEmpty(option),
2025
+ errorMessage: "fieldIsRequired"
2026
+ } }.validators,
2027
+ balanceSheetTotal: { validators: {
2028
+ modes: ["blur"],
2029
+ validate: (amount) => !isUndefinedOrNull(amount),
2030
+ errorMessage: "fieldIsRequired"
2031
+ } }.validators,
2032
+ annualTurnover: { validators: {
2033
+ modes: ["blur"],
2034
+ validate: (amount) => !isUndefinedOrNull(amount),
2035
+ errorMessage: "fieldIsRequired"
2036
+ } }.validators
2037
+ };
2038
+ var financialInfoValidationEmployeesOnlyRules = { numberOfEmployees: numberOfEmployeesMetadata.validators };
2039
+ var financialInfoValidationWithEmployeesRules = {
2040
+ ...financialInfoValidationRules,
2041
+ ...financialInfoValidationEmployeesOnlyRules
2042
+ };
2043
+ //#endregion
2044
+ //#region src/components/Business/utils/utils.ts
2045
+ var isFinancialInformationRequired = (isFinancialInformationFeatureEnabled, taskType, country, capabilities, rootLegalEntityType) => {
2046
+ const isOrganization = rootLegalEntityType === "organization";
2047
+ if (!isFinancialInformationFeatureEnabled || !COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) return;
2048
+ if (country === CountryCodes.UnitedKingdom && (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY || taskType === TaskTypes.BUSINESS_DETAILS)) return "REQUIRED";
2049
+ if (taskType === TaskTypes.BUSINESS_DETAILS && isOrganization) {
2050
+ if (keysOf(capabilities ?? {}).some((capability) => capability === "issueBankAccount")) return "REQUIRED";
2051
+ }
2052
+ };
2053
+ var getCountryOfGoverningLaw = (isCountryOfGoverningLawEnabled, basicData) => {
2054
+ if (!isCountryOfGoverningLawEnabled || basicData?.country !== CountryCodes.UnitedKingdom) return;
2055
+ return !basicData.countryOfGoverningLaw ? CountryCodes.UnitedKingdom : basicData.countryOfGoverningLaw;
2056
+ };
2057
+ //#endregion
2058
+ //#region src/components/Business/forms/rules.constants.ts
2059
+ var COUNTRIES_REQUIRING_E_INVOICING_CODE = [CountryCodes.Italy];
2060
+ var ORGANIZATION_COUNTRIES_REQUIRING_DATE_OF_INCORPORATION = [
2061
+ CountryCodes.HongKong,
2062
+ CountryCodes.Singapore,
2063
+ CountryCodes.India,
2064
+ CountryCodes.Japan,
2065
+ CountryCodes.UnitedArabEmirates
2066
+ ];
2067
+ var COUNTRIES_THAT_USES_UEN_OR_GST = [CountryCodes.Singapore];
2068
+ //#endregion
2069
+ //#region src/components/Business/forms/rules.ts
2070
+ var rules = ({ data, defaultData, verifiedBusiness, country, taskType, isFeatureEnabled = () => false, isSettingEnabled = () => false, getSetting = () => void 0, accountHolder, rootLegalEntity, tinMatched }) => {
2071
+ const countryRequiresDateOfIncorporationForCompanies = () => {
2072
+ switch (taskType) {
2073
+ case "SOLE_PROPRIETOR_COMPANY": return LEGAL_ARRANGEMENT_COUNTRIES_REQUIRING_DATE_OF_INCORPORATION.includes(country) ? "REQUIRED" : void 0;
2074
+ default: return ORGANIZATION_COUNTRIES_REQUIRING_DATE_OF_INCORPORATION.includes(country) ? "REQUIRED" : void 0;
2075
+ }
2076
+ };
2077
+ const countryRequiresFinancialInformation = () => {
2078
+ const isFinancialInformationFeatureEnabled = isFeatureEnabled("EnableFinancialInformationComponentV4");
2079
+ const leType = rootLegalEntity?.type;
2080
+ return isFinancialInformationRequired(isFinancialInformationFeatureEnabled, taskType, country, rootLegalEntity?.capabilities, leType);
2081
+ };
2082
+ const hasFinancialInformation = (financialInformation) => {
2083
+ if (!financialInformation) return false;
2084
+ return financialInformation.numberOfEmployees != null || Boolean(financialInformation.financialReportingDate) || Boolean(financialInformation.currency) || financialInformation.balanceSheetTotal != null || financialInformation.annualTurnover != null;
2085
+ };
2086
+ const addressFieldRule = (field, isOperational) => {
2087
+ if (isOperational && data.additionalInformation?.operationalAddressIsSame) return void 0;
2088
+ if (field === "country") return "REQUIRED";
2089
+ if (isJapanLocalizationEnabled(isFeatureEnabled, country)) {
2090
+ if (field === "street") return "OPTIONAL";
2091
+ return JP_ADDRESS_REQUIRED_FIELDS.includes(field) ? "REQUIRED" : "OPTIONAL";
2092
+ }
2093
+ if (!getAddressSchemaForCountry(country).includes(field)) return void 0;
2094
+ if (field === "street2") return "OPTIONAL";
2095
+ if (field === "stateOrProvince") return COUNTRIES_WITH_STATES_DATASET.includes(country) ? "REQUIRED" : void 0;
2096
+ return "REQUIRED";
2097
+ };
2098
+ return createFormRules({
2099
+ requireDoingBusinessAsName: () => {
2100
+ return data.additionalInformation?.hasDoingBusinessAs ? "REQUIRED" : void 0;
2101
+ },
2102
+ countryRequiresStateOrProvince: () => {
2103
+ if (COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
2104
+ },
2105
+ ifPubliclyTradedCompany: () => {
2106
+ if (data.companyStructure?.entityType === "listedPublicCompany") return "REQUIRED";
2107
+ },
2108
+ countryUsesVat: () => {
2109
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return data.additionalInformation?.exemptedFromVat ? "OPTIONAL" : "REQUIRED";
2110
+ },
2111
+ vatNumberType: () => {
2112
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return "OPTIONAL";
2113
+ },
2114
+ isVatExempt: () => {
2115
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) return data.additionalInformation?.exemptedFromVat ? "REQUIRED" : "OPTIONAL";
2116
+ },
2117
+ countryUsesTaxId: () => {
2118
+ const requiredUnlessExempt = Boolean(data.basicInformation?.exemptedFromTax) ? "OPTIONAL" : "REQUIRED";
2119
+ const usesTaxIdInsteadOfVat = COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country);
2120
+ if (rootLegalEntity?.type === "organization" && keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount")) {
2121
+ if (TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country)) return requiredUnlessExempt;
2122
+ if (country === CountryCodes.Italy && data.basicInformation?.registrationNumberType === "CCIAA") return requiredUnlessExempt;
2123
+ }
2124
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country)) return;
2125
+ return usesTaxIdInsteadOfVat ? requiredUnlessExempt : void 0;
2126
+ },
2127
+ companyRegistrationNumberExemptionAllowed: () => {
2128
+ const isExemptFromRegistrationNumber = Boolean(data.basicInformation?.exemptedFromRegistrationNumber);
2129
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2130
+ if (!isRegistrationExemptionAllowed({
2131
+ country,
2132
+ companyType: "soleProprietorship"
2133
+ })) return;
2134
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2135
+ }
2136
+ if (!isRegistrationExemptionAllowed({ country })) return;
2137
+ /**
2138
+ * Country-specific guard checks before applying the shared exemption rule result.
2139
+ *
2140
+ * - HK first enforces the legacy registration-number presence guard for existing entities.
2141
+ * - AU/NZ then enforce the absent-state V4 feature flag gate.
2142
+ */
2143
+ switch (country) {
2144
+ case CountryCodes.HongKong:
2145
+ if (!defaultData?.basicInformation?.registrationNumber) return;
2146
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2147
+ case CountryCodes.Australia:
2148
+ case CountryCodes.NewZealand:
2149
+ if (!isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4")) return;
2150
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2151
+ default: return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2152
+ }
2153
+ },
2154
+ countryOfGoverningLawRequired: () => {
2155
+ if (isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(data.basicInformation?.country)) return "REQUIRED";
2156
+ },
2157
+ countryRequiresRegistrationNumber: () => {
2158
+ const isExemptFromRegistrationNumber = Boolean(data.basicInformation?.exemptedFromRegistrationNumber);
2159
+ switch (taskType) {
2160
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY:
2161
+ if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2162
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS.includes(country)) return "OPTIONAL";
2163
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2164
+ default:
2165
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
2166
+ if (country === CountryCodes.HongKong) {
2167
+ if (!defaultData?.basicInformation?.registrationNumber) return;
2168
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2169
+ }
2170
+ if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return isExemptFromRegistrationNumber ? void 0 : "REQUIRED";
2171
+ }
2172
+ },
2173
+ registrationNumberType: () => {
2174
+ switch (taskType) {
2175
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY:
2176
+ if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2177
+ return "OPTIONAL";
2178
+ default:
2179
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
2180
+ if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
2181
+ return "OPTIONAL";
2182
+ }
2183
+ },
2184
+ countryUsesUenOrGst: () => {
2185
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) return;
2186
+ if (COUNTRIES_THAT_USES_UEN_OR_GST.includes(country)) return "REQUIRED";
2187
+ },
2188
+ countryHasTaxExemptions: () => {
2189
+ const isExemptFromTax = Boolean(data.basicInformation?.exemptedFromTax);
2190
+ switch (taskType) {
2191
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY:
2192
+ if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
2193
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2194
+ default:
2195
+ if (isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2196
+ if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2197
+ }
2198
+ },
2199
+ usingCompanySearch: () => {
2200
+ if (isUsingCompanySearch(country, taskType)) return "REQUIRED";
2201
+ },
2202
+ requireStateOrProvinceForCompanySearch: () => {
2203
+ if (isUsingCompanySearch(country, taskType) && COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
2204
+ },
2205
+ countryRequiresFinancialInformation,
2206
+ isDateOfIncorporationRequired: () => {
2207
+ return countryRequiresDateOfIncorporationForCompanies() || countryRequiresFinancialInformation();
2208
+ },
2209
+ isFinancialReportingFieldsRequired: () => {
2210
+ if (countryRequiresFinancialInformation() !== "REQUIRED") return;
2211
+ if (isDateOlderThanAYear(data.additionalInformation?.dateOfIncorporation)) return "REQUIRED";
2212
+ /**
2213
+ * MultiForm recalculates required/optional schemas when rules change and reindexes form state
2214
+ * against those schemas. If these financial fields are not included, provider-applied values can
2215
+ * be pruned and appear to reset. Keeping them OPTIONAL by default when the feature is enabled
2216
+ * (instead of undefined) preserves existing values in the form while still avoiding hard validation
2217
+ * requirements when provider data is partial.
2218
+ */
2219
+ if (hasFinancialInformation(verifiedBusiness?.financialInformation) || hasFinancialInformation(data.companyFinancialInformation)) return "OPTIONAL";
2220
+ },
2221
+ isIndustryCodeRequired: () => {
2222
+ return isSettingEnabled(SettingNames.AllowBusinessLines) ? "REQUIRED" : void 0;
2223
+ },
2224
+ annualTurnoverRequired: () => {
2225
+ if (data.companyFinancialInformation?.reportedValueOption === "annualTurnover") return "REQUIRED";
2226
+ },
2227
+ balanceSheetTotalRequired: () => {
2228
+ if (data.companyFinancialInformation?.reportedValueOption === "balanceSheetTotal") return "REQUIRED";
2229
+ },
2230
+ isResidentialAddressIndicatorEnabled: () => {
2231
+ if (isFeatureEnabled("EnableResidentialAddressIndicator")) return "OPTIONAL";
2232
+ },
2233
+ isEInvoicingCodeEnabled: () => {
2234
+ if (isFeatureEnabled("EnableEInvoicingCodeField") && COUNTRIES_REQUIRING_E_INVOICING_CODE.includes(country)) return "REQUIRED";
2235
+ },
2236
+ isTaxDocumentRequired: () => {
2237
+ if (tinMatched === false && country === CountryCodes.UnitedStates) return "REQUIRED";
2238
+ },
2239
+ isRegistrationDocumentRequired: () => {
2240
+ if (getSetting("merchantType") === "direct" && country === CountryCodes.Mexico) return "REQUIRED";
2241
+ },
2242
+ businessRequiresCompanyType: () => {
2243
+ if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY) return "REQUIRED";
2244
+ },
2245
+ japaneseLegalCompanyName: () => {
2246
+ if (isJapanLocalizationEnabled(isFeatureEnabled, country)) return "REQUIRED";
2247
+ },
2248
+ requireLEI: () => {
2249
+ if (!isFeatureEnabled("EnableLegalEntityIdentifierField") || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) return;
2250
+ return data.additionalInformation?.exemptedFromLegalEntityIdentifier ? "OPTIONAL" : "REQUIRED";
2251
+ },
2252
+ requireLEIExemption: () => {
2253
+ if (!isFeatureEnabled("EnableLegalEntityIdentifierField") || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) return;
2254
+ return data.additionalInformation?.exemptedFromLegalEntityIdentifier ? "REQUIRED" : "OPTIONAL";
2255
+ },
2256
+ registrationAddressStreetRequired: () => addressFieldRule("street", false),
2257
+ registrationAddressStreet2Required: () => addressFieldRule("street2", false),
2258
+ registrationAddressCityRequired: () => addressFieldRule("city", false),
2259
+ registrationAddressPostalCodeRequired: () => addressFieldRule("postalCode", false),
2260
+ registrationAddressStateOrProvinceRequired: () => addressFieldRule("stateOrProvince", false),
2261
+ registrationAddressCountryRequired: () => addressFieldRule("country", false),
2262
+ operationalAddressStreetRequired: () => addressFieldRule("street", true),
2263
+ operationalAddressStreet2Required: () => addressFieldRule("street2", true),
2264
+ operationalAddressCityRequired: () => addressFieldRule("city", true),
2265
+ operationalAddressPostalCodeRequired: () => addressFieldRule("postalCode", true),
2266
+ operationalAddressStateOrProvinceRequired: () => addressFieldRule("stateOrProvince", true),
2267
+ operationalAddressCountryRequired: () => addressFieldRule("country", true),
2268
+ /** Localized */
2269
+ /** JP */
2270
+ registrationAddressJaHaniStateOrProvinceRequired: () => addressFieldRule("jaHaniStateOrProvince", false),
2271
+ registrationAddressJaHaniCityRequired: () => addressFieldRule("jaHaniCity", false),
2272
+ registrationAddressJaHaniStreetRequired: () => addressFieldRule("jaHaniStreet", false),
2273
+ registrationAddressJaKanaStateOrProvinceRequired: () => addressFieldRule("jaKanaStateOrProvince", false),
2274
+ registrationAddressJaKanaCityRequired: () => addressFieldRule("jaKanaCity", false),
2275
+ registrationAddressStreet2FullWidthRequired: () => addressFieldRule("street2FullWidth", false),
2276
+ operationalAddressJaHaniStateOrProvinceRequired: () => addressFieldRule("jaHaniStateOrProvince", true),
2277
+ operationalAddressJaHaniCityRequired: () => addressFieldRule("jaHaniCity", true),
2278
+ operationalAddressJaHaniStreetRequired: () => addressFieldRule("jaHaniStreet", true),
2279
+ operationalAddressJaKanaStateOrProvinceRequired: () => addressFieldRule("jaKanaStateOrProvince", true),
2280
+ operationalAddressJaKanaCityRequired: () => addressFieldRule("jaKanaCity", true),
2281
+ operationalAddressStreet2FullWidthRequired: () => addressFieldRule("street2FullWidth", true)
2282
+ });
2283
+ };
2284
+ //#endregion
2285
+ //#region src/utils/stripWhitespace.ts
2286
+ var stripWhitespace = (str) => str.replace(/\s/g, "");
2287
+ //#endregion
2288
+ //#region src/utils/toNormalizedString.ts
2289
+ var toNormalizedString = (s) => stripWhitespace(s.toLowerCase());
2290
+ //#endregion
2291
+ //#region src/utils/isNormalizedStringMatch.ts
2292
+ var isNormalizedStringMatch = (s1, s2) => toNormalizedString(s1) === toNormalizedString(s2);
2293
+ //#endregion
2294
+ //#region src/components/Business/hooks/useCompanySearchNextClickOverrides.ts
2295
+ function useCompanySearchNextClickOverrides({ country, multiForm, companySearchStateModel, getRequiredForms, skipBusinessSelection, setLoadingStatus, isTinMatched, tinMismatchModalOpen, legalArrangementModalOpen, registrationNumberMismatchModalOpen }) {
2296
+ const { baseUrl, rootLegalEntityId } = useApiContext();
2297
+ const userEvents = useAnalyticsContext();
2298
+ const queryClient = useQueryClient();
2299
+ const { mutateAsync: selectCompany } = useCompanySelection();
2300
+ const { mutateAsync: clearCompanyData } = useClearCompanyData();
2301
+ const logger = createLogger();
2302
+ const getInferredRegistrationNumberType = () => {
2303
+ const selectedCompany = companySearchStateModel.selectedCompany.peek();
2304
+ if (country === CountryCodes.UnitedStates || !selectedCompany?.registrationNumber) return;
2305
+ return inferCompanyRegistrationNumberType(selectedCompany.registrationNumber, country, selectedCompany.companyType);
2306
+ };
2307
+ const isVerificationFailed = () => country === CountryCodes.UnitedStates ? !companySearchStateModel.verificationMatched.value : companySearchStateModel.verificationMatched.value === false;
2308
+ /**
2309
+ * Returns `null` for non-navs, such as showing the TIN mismatch model for 0 or 1 results
2310
+ */
2311
+ const attemptBusinessSearch = async () => {
2312
+ const formsWithoutSearchResults = getRequiredForms({ skipBusinessSelection: true });
2313
+ if (!multiForm.data.basicInformation?.legalCompanyName) return formsWithoutSearchResults;
2314
+ setLoadingStatus("loading");
2315
+ companySearchStateModel.resetCompanySearchData();
2316
+ let searchResponse = {
2317
+ results: [],
2318
+ provider: "NO_PROVIDER"
2319
+ };
2320
+ try {
2321
+ companySearchStateModel.companySearchName.value = multiForm.data.basicInformation?.legalCompanyName;
2322
+ const companySearchInput = {
2323
+ name: multiForm.data.basicInformation?.legalCompanyName,
2324
+ country: multiForm.data.basicInformation?.country,
2325
+ state: multiForm.data.basicInformation?.stateOrProvince,
2326
+ registrationNumber: multiForm.data.basicInformation?.registrationNumber
2327
+ };
2328
+ searchResponse = await trackPerformance("companySearch", () => queryClient.fetchQuery(companySearchQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), companySearchInput, userEvents)), userEvents);
2329
+ } catch (e) {
2330
+ logger.error(e);
2331
+ setLoadingStatus("error");
2332
+ return formsWithoutSearchResults;
2333
+ }
2334
+ const tin = multiForm.data.basicInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number ?? "";
2335
+ const registrationNumber = multiForm.data.basicInformation?.registrationNumber ?? "";
2336
+ skipBusinessSelection.value = searchResponse.results.length === 0;
2337
+ const currentForms = getRequiredForms({ skipBusinessSelection: skipBusinessSelection.peek() });
2338
+ switch (searchResponse.results.length) {
2339
+ case 0:
2340
+ if (country === CountryCodes.UnitedStates) try {
2341
+ const verifyTinQueryInput = {
2342
+ name: multiForm.data.basicInformation?.legalCompanyName,
2343
+ tin
2344
+ };
2345
+ const tinVerificationResponse = await queryClient.fetchQuery(verifyTinQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), verifyTinQueryInput, userEvents));
2346
+ setLoadingStatus("success");
2347
+ const tinMatched = !!tinVerificationResponse.matched;
2348
+ companySearchStateModel.setVerificationMatched(tinMatched);
2349
+ if (companySearchStateModel.verificationMatched.value) return currentForms;
2350
+ tinMismatchModalOpen.value = true;
2351
+ return null;
2352
+ } catch (e) {
2353
+ logger.error(e);
2354
+ setLoadingStatus("error");
2355
+ return currentForms;
2356
+ }
2357
+ setLoadingStatus("success");
2358
+ return currentForms;
2359
+ case 1:
2360
+ if (!isNormalizedStringMatch(multiForm.data.basicInformation?.legalCompanyName, searchResponse.results[0].name)) {
2361
+ setLoadingStatus("success");
2362
+ return currentForms;
2363
+ }
2364
+ try {
2365
+ const companySelectionInput = {
2366
+ state: multiForm.data.basicInformation?.stateOrProvince,
2367
+ name: multiForm.data.basicInformation?.legalCompanyName,
2368
+ tin,
2369
+ registrationNumber,
2370
+ id: searchResponse.results[0].resultId,
2371
+ country
2372
+ };
2373
+ const companySelectionResponse = await selectCompany(companySelectionInput);
2374
+ companySearchStateModel.selectCompany(companySelectionResponse, -1, country);
2375
+ setLoadingStatus("success");
2376
+ if (isVerificationFailed()) {
2377
+ await clearCompanyData();
2378
+ return currentForms;
2379
+ } else {
2380
+ companySearchStateModel.confirmCompany(multiForm, country);
2381
+ skipBusinessSelection.value = true;
2382
+ return getRequiredForms({
2383
+ skipBusinessSelection: skipBusinessSelection.peek(),
2384
+ skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!getInferredRegistrationNumberType()
2385
+ });
2386
+ }
2387
+ } catch (e) {
2388
+ logger.error(e);
2389
+ setLoadingStatus("error");
2390
+ await clearCompanyData();
2391
+ return formsWithoutSearchResults;
2392
+ }
2393
+ default:
2394
+ setLoadingStatus("success");
2395
+ return currentForms;
2396
+ }
2397
+ };
2398
+ const confirmBusinessSelection = async () => {
2399
+ const selectedBusinessId = multiForm.data.businessSelection.selectedBusinessId;
2400
+ if (companySearchStateModel.disallowedSelectionReason.value) {
2401
+ switch (companySearchStateModel.disallowedSelectionReason.value) {
2402
+ case "LEGAL_ARRANGEMENT":
2403
+ legalArrangementModalOpen.value = true;
2404
+ break;
2405
+ default:
2406
+ logger.error("Unhandled disallowed selection reason");
2407
+ break;
2408
+ }
2409
+ return null;
2410
+ }
2411
+ switch (selectedBusinessId) {
2412
+ case "notListed":
2413
+ if (country === CountryCodes.UnitedStates && isVerificationFailed()) isTinMatched.value = false;
2414
+ return getRequiredForms({});
2415
+ default:
2416
+ switch (country) {
2417
+ case CountryCodes.UnitedStates:
2418
+ if (isVerificationFailed()) {
2419
+ tinMismatchModalOpen.value = true;
2420
+ return null;
2421
+ }
2422
+ break;
2423
+ default:
2424
+ if (isVerificationFailed()) {
2425
+ registrationNumberMismatchModalOpen.value = true;
2426
+ return null;
2427
+ }
2428
+ break;
2429
+ }
2430
+ companySearchStateModel.confirmCompany(multiForm, country);
2431
+ return getRequiredForms({ skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!getInferredRegistrationNumberType() });
2432
+ }
2433
+ };
2434
+ return {
2435
+ attemptBusinessSearch,
2436
+ confirmBusinessSelection
2437
+ };
2438
+ }
2439
+ //#endregion
2440
+ //#region src/components/Business/hooks/usePrefetchCompanySearch.ts
2441
+ var getRootElement = () => {
2442
+ const onboardingWC = document.querySelector("adyen-onboarding");
2443
+ return (onboardingWC && onboardingWC?.shadowRoot) ?? document;
2444
+ };
2445
+ var getRelatedFields = (country) => {
2446
+ const baseFields = [
2447
+ "legalCompanyName",
2448
+ "country",
2449
+ "registrationNumber"
2450
+ ];
2451
+ switch (country) {
2452
+ case "US": return baseFields.concat(["stateOrProvince"]);
2453
+ default: return baseFields;
2454
+ }
2455
+ };
2456
+ function usePrefetchCompanySearch({ country, multiForm, activeFormId, isUsingCompanySearch }) {
2457
+ const queryClient = useQueryClient();
2458
+ const { baseUrl, rootLegalEntityId } = useApiContext();
2459
+ const userEvents = useAnalyticsContext();
2460
+ const debouncedCompanySearchPrefetch = useDebouncedCallback(useCallback$1(async () => {
2461
+ const root = getRootElement(), activeElementName = (root.activeElement && root.activeElement.getAttribute("name")) ?? "";
2462
+ const fieldNames = getRelatedFields(country);
2463
+ let allRelatedFieldsAreValid = true, noRelatedFieldsAreFocused = true;
2464
+ for (const fieldName of fieldNames) {
2465
+ if (multiForm.valid.basicInformation?.[fieldName] === false) allRelatedFieldsAreValid = false;
2466
+ if (activeElementName && activeElementName === fieldName) noRelatedFieldsAreFocused = false;
2467
+ }
2468
+ if (!allRelatedFieldsAreValid || !noRelatedFieldsAreFocused) return;
2469
+ const companySearchInput = {
2470
+ name: multiForm.data.basicInformation?.legalCompanyName ?? "",
2471
+ country: multiForm.data.basicInformation?.country,
2472
+ state: multiForm.data.basicInformation?.stateOrProvince,
2473
+ registrationNumber: multiForm.data.basicInformation?.registrationNumber
2474
+ };
2475
+ await queryClient.prefetchQuery(companySearchQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), companySearchInput, userEvents));
2476
+ }, [
2477
+ baseUrl,
2478
+ country,
2479
+ multiForm.data.basicInformation?.country,
2480
+ multiForm.data.basicInformation?.legalCompanyName,
2481
+ multiForm.data.basicInformation?.registrationNumber,
2482
+ multiForm.data.basicInformation?.stateOrProvince,
2483
+ multiForm.valid.basicInformation,
2484
+ queryClient,
2485
+ rootLegalEntityId,
2486
+ userEvents
2487
+ ]), 500);
2488
+ /**
2489
+ * Re-fires prefetch when fields lose focus, with extra filtering within
2490
+ * the handler to determine whether the search should continue after being debounced.
2491
+ */
2492
+ useEffect$1(() => {
2493
+ const prefetch = () => {
2494
+ if (activeFormId !== "basicInformation" || !isUsingCompanySearch) return;
2495
+ debouncedCompanySearchPrefetch();
2496
+ };
2497
+ const root = getRootElement();
2498
+ root.addEventListener("focusout", prefetch);
2499
+ return () => root.removeEventListener("focusout", prefetch);
2500
+ }, [
2501
+ activeFormId,
2502
+ debouncedCompanySearchPrefetch,
2503
+ isUsingCompanySearch
2504
+ ]);
2505
+ }
2506
+ //#endregion
2507
+ //#region src/core/utils.ts
2508
+ var adjustFormData = (oldFormData, newFormData) => {
2509
+ return Array.from((/* @__PURE__ */ new Set([...keysOf(oldFormData), ...keysOf(newFormData)])).keys()).reduce((acc, key) => {
2510
+ const oldValue = oldFormData[key];
2511
+ const newValue = newFormData[key];
2512
+ if (!isUndefinedOrNull(newValue)) return {
2513
+ ...acc,
2514
+ [key]: newValue
2515
+ };
2516
+ if (Array.isArray(oldValue)) return {
2517
+ ...acc,
2518
+ [key]: []
2519
+ };
2520
+ if (typeof oldValue === "number") return {
2521
+ ...acc,
2522
+ [key]: null
2523
+ };
2524
+ if (typeof oldValue === "string") return {
2525
+ ...acc,
2526
+ [key]: ""
2527
+ };
2528
+ return {
2529
+ ...acc,
2530
+ [key]: ""
2531
+ };
2532
+ }, {});
2533
+ };
2534
+ /**
2535
+ * Set fields on the schema which have been removed to the appropriate "deleted" value.
2536
+ *
2537
+ * E.g. removed `string` fields are set to `""`, removed `number`s to `null`.
2538
+ *
2539
+ * Doesn't mutate the original object.
2540
+ *
2541
+ * @param newData - actual form data submitted from the frontend
2542
+ * @param existingData - `Schema`-fied version of the existing LE data we got from the BE
2543
+ * @returns filtered data
2544
+ */
2545
+ var setRemovedFieldsOnSchemaToDeletedValue = (newData, existingData) => {
2546
+ return Array.from((/* @__PURE__ */ new Set([...keysOf(existingData), ...keysOf(newData)])).keys()).reduce((adjusted, formId) => {
2547
+ const oldFormData = existingData[formId];
2548
+ const newFormData = newData[formId];
2549
+ if (isUndefinedOrNull(oldFormData)) return {
2550
+ ...adjusted,
2551
+ [formId]: newFormData
2552
+ };
2553
+ if (isUndefinedOrNull(newFormData)) return adjusted;
2554
+ return {
2555
+ ...adjusted,
2556
+ [formId]: adjustFormData(oldFormData, newFormData)
2557
+ };
2558
+ }, {});
2559
+ };
2560
+ //#endregion
2561
+ //#region src/components/Business/mapping/businessDetails/businessBankAccountTaxIdUtils.ts
2562
+ var BUSINESS_BANK_ACCOUNT_TAX_ID_COUNTRIES = [
2563
+ CountryCodes.Estonia,
2564
+ CountryCodes.Finland,
2565
+ CountryCodes.France,
2566
+ CountryCodes.Italy,
2567
+ CountryCodes.Latvia,
2568
+ CountryCodes.Lithuania,
2569
+ CountryCodes.Portugal,
2570
+ CountryCodes.Spain
2571
+ ];
2572
+ /**
2573
+ * Italian registration number subtypes that are NOT valid Codice Fiscale and therefore
2574
+ * cannot be reused as `taxInformation`. Users who select these must provide a Tax ID
2575
+ * (Codice Fiscale) separately.
2576
+ */
2577
+ var IT_REGISTRATION_TYPES_WITHOUT_TAX_ID_REUSE = ["CCIAA"];
2578
+ /**
2579
+ * Checks if a country requires business bank account tax ID validation
2580
+ * @param country - The country code to check
2581
+ * @returns true if the country requires business bank account tax ID, false otherwise
2582
+ */
2583
+ var isBusinessBankAccountTaxIdCountry = (country) => {
2584
+ return country ? BUSINESS_BANK_ACCOUNT_TAX_ID_COUNTRIES.includes(country) : false;
2585
+ };
2586
+ /**
2587
+ * Whether the entered `registrationNumber` should be reused as `taxInformation`
2588
+ * for a business bank account (see `isBusinessBankAccountTaxIdCountry`).
2589
+ *
2590
+ * For most countries this is equivalent to {@link isBusinessBankAccountTaxIdCountry}.
2591
+ * Italy has an additional constraint: the CCIAA number is not a valid Codice Fiscale,
2592
+ * so it must not be reused as `taxInformation`.
2593
+ */
2594
+ var shouldReuseRegistrationNumberAsTaxId = (country, registrationNumberType) => {
2595
+ if (!isBusinessBankAccountTaxIdCountry(country)) return false;
2596
+ if (country === CountryCodes.Italy && registrationNumberType) return !IT_REGISTRATION_TYPES_WITHOUT_TAX_ID_REUSE.includes(registrationNumberType);
2597
+ return true;
2598
+ };
2599
+ //#endregion
2600
+ //#region src/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.ts
2601
+ var mapBusinessDetailsDocumentToApiDocument = async (data, entityId) => {
2602
+ const { companyRegistrationDocument, companyTaxDocument, companyProofOfDirectorDocument, companyConstitutionalDocument, companyProofOfSignatoryDocument, companyProofOfAddressDocument, companyProofOfOwnershipDocument, basicInformation } = data;
2603
+ const taxDocumentType = COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(basicInformation?.country) ? "proofOfOrganizationTaxInfo" : "vatDocument";
2604
+ return (await Promise.all([
2605
+ createDocumentRequest({
2606
+ entityId,
2607
+ entityType: "legalEntity",
2608
+ documentType: "registrationDocument",
2609
+ description: companyRegistrationDocument?.description,
2610
+ page1: companyRegistrationDocument?.registrationDocument?.[0]
2611
+ }),
2612
+ createDocumentRequest({
2613
+ entityId,
2614
+ entityType: "legalEntity",
2615
+ documentType: taxDocumentType,
2616
+ description: companyTaxDocument?.description,
2617
+ page1: companyTaxDocument?.taxDocument?.[0]
2618
+ }),
2619
+ createDocumentRequest({
2620
+ entityId,
2621
+ entityType: "legalEntity",
2622
+ documentType: "proofOfDirector",
2623
+ description: companyProofOfDirectorDocument?.description,
2624
+ page1: companyProofOfDirectorDocument?.proofOfDirector?.[0]
2625
+ }),
2626
+ createDocumentRequest({
2627
+ entityId,
2628
+ entityType: "legalEntity",
2629
+ documentType: "constitutionalDocument",
2630
+ description: companyConstitutionalDocument?.description,
2631
+ page1: companyConstitutionalDocument?.constitutionalDocument?.[0]
2632
+ }),
2633
+ createDocumentRequest({
2634
+ entityId,
2635
+ entityType: "legalEntity",
2636
+ documentType: "proofOfSignatory",
2637
+ description: companyProofOfSignatoryDocument?.description,
2638
+ page1: companyProofOfSignatoryDocument?.proofOfSignatory?.[0]
2639
+ }),
2640
+ createDocumentRequest({
2641
+ entityId,
2642
+ entityType: "legalEntity",
2643
+ documentType: "proofOfOwnership",
2644
+ description: companyProofOfOwnershipDocument?.description,
2645
+ page1: companyProofOfOwnershipDocument?.proofOfOwnership?.[0],
2646
+ page2: companyProofOfOwnershipDocument?.proofOfOwnership?.[1]
2647
+ }),
2648
+ createDocumentRequest({
2649
+ entityId,
2650
+ entityType: "legalEntity",
2651
+ documentType: "proofOfAddress",
2652
+ description: companyProofOfAddressDocument?.description,
2653
+ page1: companyProofOfAddressDocument?.proofOfAddress?.[0]
2654
+ })
2655
+ ])).filter(Boolean);
2656
+ };
2657
+ var mapBusinessDetailsSchemaToLegalEntity = (data, accountHolder, isFeatureEnabled, taskType, matchingScenario, rootLegalEntity) => {
2658
+ const isSoleProp = accountHolder === "mySoleProprietorName";
2659
+ const requestObj = { ...formatObject(data, isSoleProp ? solePropBusinessDetailsApiKeyMapping : businessDetailsApiKeyMapping) };
2660
+ delete requestObj.organization?.legalFormDescription;
2661
+ const canSaveRegNumberAbsentState = isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && isRegistrationNumberAbsentStateV4Scenario(data.basicInformation?.country, data.companyStructure?.entityType);
2662
+ const [taxData, registrationNumber, registrationNumberType] = [
2663
+ data.basicInformation?.taxInformation,
2664
+ data.basicInformation?.registrationNumber,
2665
+ data.basicInformation?.registrationNumberType
2666
+ ];
2667
+ const localization = mapJapaneseLegalNamesToLocalization(data.basicInformation ?? {});
2668
+ const doingBusinessAs = data.additionalInformation?.doingBusinessAs ?? "";
2669
+ const entityObject = isSoleProp ? requestObj.soleProprietorship : requestObj.organization;
2670
+ if (entityObject) {
2671
+ if (taxData) entityObject.taxInformation = taxData;
2672
+ if (rootLegalEntity?.type === "organization" && keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount") && matchingScenario?.includes(Scenarios.L) && registrationNumber && data.basicInformation?.country && shouldReuseRegistrationNumberAsTaxId(data.basicInformation?.country, registrationNumberType)) {
2673
+ const taxCountry = data.basicInformation.country;
2674
+ const privateCompanyTaxOptions = getTaxIdNumberOptions(taxCountry, "privateCompany");
2675
+ entityObject.taxInformation = [{
2676
+ country: taxCountry,
2677
+ number: registrationNumber,
2678
+ type: privateCompanyTaxOptions && privateCompanyTaxOptions.length > 0 ? privateCompanyTaxOptions[0]["id"] : ""
2679
+ }];
2680
+ }
2681
+ if (isSoleProp && !!data.basicInformation?.country) entityObject.countryOfGoverningLaw = data.basicInformation.country;
2682
+ if (taskType !== TaskTypes.BUSINESS_DETAILS && entityObject.vatAbsenceReason === "") entityObject.vatAbsenceReason = null;
2683
+ if (registrationNumber) {
2684
+ entityObject.registrationNumber = registrationNumber;
2685
+ if (canSaveRegNumberAbsentState && !isSoleProp) entityObject.registrationNumberAbsent = false;
2686
+ }
2687
+ if (!isSoleProp && localization.length > 0) entityObject.localization = localization;
2688
+ if (data.basicInformation?.exemptedFromRegistrationNumber && canSaveRegNumberAbsentState && !isSoleProp) entityObject.registrationNumberAbsent = data.basicInformation.exemptedFromRegistrationNumber;
2689
+ if (data.additionalInformation?.vatAbsenceReason) entityObject.vatNumber = "";
2690
+ if (isFeatureEnabled("EnableDoingBusinessAsNameV4")) {
2691
+ if (typeof data.additionalInformation?.hasDoingBusinessAs !== "undefined") entityObject.doingBusinessAsAbsent = !data.additionalInformation.hasDoingBusinessAs;
2692
+ } else {
2693
+ entityObject.doingBusinessAs = doingBusinessAs || data.basicInformation?.legalCompanyName;
2694
+ delete entityObject.doingBusinessAsAbsent;
2695
+ }
2696
+ if (!isFeatureEnabled("EnableResidentialAddressIndicator")) delete entityObject.residentialAddressIndicator;
2697
+ if (data.additionalInformation?.operationalAddressIsSame && entityObject.principalPlaceOfBusiness) entityObject.principalPlaceOfBusiness = structuredClone(entityObject.registeredAddress);
2698
+ const addressLocalizations = mapJpAddressSchemaToAddressLocalizations(nestAddressSchema("registrationAddress", data.additionalInformation));
2699
+ if (addressLocalizations.length > 0) entityObject.registeredAddress.localization = addressLocalizations;
2700
+ if (entityObject.principalPlaceOfBusiness?.localization) delete entityObject.principalPlaceOfBusiness?.localization;
2701
+ if (entityObject.registeredAddress?.country && entityObject.registeredAddress?.stateOrProvince && !COUNTRIES_WITH_STATES_DATASET.includes(entityObject.registeredAddress?.country)) entityObject.registeredAddress.stateOrProvince = "";
2702
+ if (!isEmpty$1(data.companyFinancialInformation)) entityObject.financialReports = [mapFinancialInformationToFinancialReport(data.companyFinancialInformation, data.additionalInformation?.dateOfIncorporation)];
2703
+ }
2704
+ requestObj.type = isSoleProp ? "soleProprietorship" : "organization";
2705
+ if (entityObject?.registeredAddress.country === "US") delete entityObject.registrationNumber;
2706
+ if (!canSaveRegNumberAbsentState && !isSoleProp) delete requestObj.organization?.registrationNumberAbsent;
2707
+ return requestObj;
2708
+ };
2709
+ //#endregion
2710
+ //#region src/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.ts
2711
+ var mapApiDocumentToBusinessDetailsDocuments = (entityId) => {
2712
+ const registrationDocument = getDocument(entityId, "registrationDocument");
2713
+ const taxDocument = getDocument(entityId, "vatDocument") ?? getDocument(entityId, "proofOfOrganizationTaxInfo");
2714
+ const proofOfDirector = getDocument(entityId, "proofOfDirector");
2715
+ const proofOfSignatory = getDocument(entityId, "proofOfSignatory");
2716
+ const proofOfOwnership = getDocuments(entityId, "proofOfOwnership");
2717
+ const constitutionalDocument = getDocument(entityId, "constitutionalDocument");
2718
+ const mergedProofOfOwnershipAttachments = proofOfOwnership.flatMap((doc) => doc.attachments);
2719
+ return {
2720
+ companyRegistrationDocument: registrationDocument ? { registrationDocument: [mapExistingFile(getPageName(registrationDocument))] } : void 0,
2721
+ companyTaxDocument: taxDocument ? { taxDocument: [mapExistingFile(getPageName(taxDocument))] } : void 0,
2722
+ companyProofOfDirectorDocument: proofOfDirector ? { proofOfDirector: [mapExistingFile(getPageName(proofOfDirector))] } : void 0,
2723
+ companyProofOfSignatoryDocument: proofOfSignatory ? { proofOfSignatory: [mapExistingFile(getPageName(proofOfSignatory))] } : void 0,
2724
+ companyProofOfOwnershipDocument: mergedProofOfOwnershipAttachments.length > 0 ? { proofOfOwnership: mergedProofOfOwnershipAttachments.map((attachment) => mapExistingFile(attachment.pageName ?? "")) } : void 0,
2725
+ companyConstitutionalDocument: constitutionalDocument ? { constitutionalDocument: [mapExistingFile(getPageName(constitutionalDocument))] } : void 0
2726
+ };
2727
+ };
2728
+ var mapBasicInformation = ({ data, legalEntity, taskType }) => {
2729
+ if (!data || !data.country) return;
2730
+ const companyType = legalEntity?.type === "organization" ? legalEntity.organization?.type : "soleProprietorship";
2731
+ const isUen = mapIsUen(data.taxInformation, data.registrationNumber, data.country);
2732
+ const registrationNumberType = getDefaultRegistrationNumberType(data.registrationNumber, data.country, void 0);
2733
+ const registrationNumberExemption = !data.registrationNumber && !!companyType && isRegistrationExemptionAllowed({
2734
+ country: data.country,
2735
+ companyType
2736
+ }) ? { exemptedFromRegistrationNumber: true } : {};
2737
+ return isUsingCompanySearch(data.country, taskType) ? {
2738
+ ...data,
2739
+ registrationNumberType,
2740
+ ...registrationNumberExemption,
2741
+ ...isUen
2742
+ } : entriesOf(data).reduce((acc, [field]) => {
2743
+ if (!["stateOrProvince"].includes(field)) return {
2744
+ ...acc,
2745
+ [field]: data[field]
2746
+ };
2747
+ return acc;
2748
+ }, {
2749
+ registrationNumberType,
2750
+ ...registrationNumberExemption,
2751
+ ...isUen
2752
+ });
2753
+ };
2754
+ var mapDbaName = (legalEntity) => {
2755
+ const entity = legalEntity.type === "organization" ? legalEntity.organization : legalEntity.soleProprietorship;
2756
+ const dbaName = {};
2757
+ if (typeof entity?.doingBusinessAsAbsent !== "undefined") dbaName.hasDoingBusinessAs = !entity.doingBusinessAsAbsent;
2758
+ else if (entity?.doingBusinessAs) dbaName.hasDoingBusinessAs = entity.doingBusinessAs !== (legalEntity.type === "organization" ? legalEntity.organization?.legalName : legalEntity.soleProprietorship?.name);
2759
+ else dbaName.hasDoingBusinessAs = void 0;
2760
+ if (legalEntity.organization?.doingBusinessAs) dbaName.doingBusinessAs = legalEntity.organization.doingBusinessAs;
2761
+ return dbaName;
2762
+ };
2763
+ var mapIsUen = (taxInformation, registrationNumber, country) => {
2764
+ const currentCountryTaxInfo = taxInformation?.find((taxInfo) => taxInfo.country === country);
2765
+ if (!currentCountryTaxInfo || country !== "SG") return {};
2766
+ return {
2767
+ registrationNumber: currentCountryTaxInfo.type === "UEN" ? currentCountryTaxInfo.number : registrationNumber,
2768
+ isUen: currentCountryTaxInfo.type === "UEN"
2769
+ };
2770
+ };
2771
+ var applyLocalizedAddressFields = (data, prefix, localization) => {
2772
+ const flatAddress = flattenAddressSchema(prefix, localization);
2773
+ for (const field in flatAddress) {
2774
+ if (flatAddress[field] === void 0) continue;
2775
+ data[field] = flatAddress[field];
2776
+ }
2777
+ };
2778
+ var mapAdditionalInformation = ({ data, legalEntity }) => {
2779
+ if (!data) return;
2780
+ const entity = legalEntity.type === "organization" ? legalEntity.organization : legalEntity.soleProprietorship;
2781
+ const currentCountry = entity?.registeredAddress.country;
2782
+ const dbaNameFields = mapDbaName(legalEntity);
2783
+ const vatNumberType = getDefaultVatNumberType(entity?.vatNumber, currentCountry);
2784
+ const operationalAddressIsSame = !(entity?.principalPlaceOfBusiness && !objectsDeepEqual(entity.principalPlaceOfBusiness, entity.registeredAddress));
2785
+ if (entity?.registeredAddress.localization) applyLocalizedAddressFields(data, "registrationAddress", mapAddressLocalizationToJpAddressSchema(entity.registeredAddress.localization));
2786
+ if (entity?.principalPlaceOfBusiness?.localization) applyLocalizedAddressFields(data, "operationalAddress", mapAddressLocalizationToJpAddressSchema(entity.principalPlaceOfBusiness.localization));
2787
+ return {
2788
+ ...entriesOf(data).reduce((acc, [field]) => ({
2789
+ ...acc,
2790
+ [field]: data[field]
2791
+ }), {
2792
+ operationalAddressIsSame,
2793
+ vatNumberType
2794
+ }),
2795
+ ...dbaNameFields
2796
+ };
2797
+ };
2798
+ var mapLegalEntityToBusinessDetailsSchema = ({ legalEntity, parentEntity, taskType, isFeatureEnabled }) => {
2799
+ if (!legalEntity) return {};
2800
+ const { companyRegistrationDocument, companyTaxDocument, companyProofOfDirectorDocument, companyProofOfSignatoryDocument, companyProofOfOwnershipDocument, companyConstitutionalDocument } = mapApiDocumentToBusinessDetailsDocuments(legalEntity.id);
2801
+ const buildSolePropSchema = () => {
2802
+ const solePropData = formatObject(legalEntity, solePropBusinessDetailsKeyMapping);
2803
+ const country = solePropData.additionalInformation?.registrationAddressCountry ?? parentEntity?.individual?.residentialAddress.country;
2804
+ if (legalEntity.soleProprietorship?.financialReports) solePropData.companyFinancialInformation = mapFinancialReportsToFinancialInformation(legalEntity.soleProprietorship.financialReports);
2805
+ return {
2806
+ ...solePropData,
2807
+ basicInformation: {
2808
+ ...solePropData.basicInformation,
2809
+ country
2810
+ },
2811
+ companyConstitutionalDocument
2812
+ };
2813
+ };
2814
+ const orgSchema = {
2815
+ ...formatObject(legalEntity, businessDetailsKeyMapping),
2816
+ businessSelection: {},
2817
+ companyRegistrationDocument,
2818
+ companyTaxDocument,
2819
+ companyProofOfDirectorDocument,
2820
+ companyProofOfSignatoryDocument,
2821
+ companyProofOfOwnershipDocument,
2822
+ companyFinancialInformation: {}
2823
+ };
2824
+ const businessDetailsSchema = legalEntity.type === "organization" ? orgSchema : buildSolePropSchema();
2825
+ return entriesOf(businessDetailsSchema).reduce((componentData, [key]) => {
2826
+ switch (key) {
2827
+ case "basicInformation": return {
2828
+ ...componentData,
2829
+ [key]: {
2830
+ ...mapBasicInformation({
2831
+ data: businessDetailsSchema[key],
2832
+ legalEntity,
2833
+ taskType,
2834
+ isFeatureEnabled
2835
+ }),
2836
+ ...mapLocalizationToJapaneseLegalNames(legalEntity?.organization?.localization)
2837
+ }
2838
+ };
2839
+ case "businessSelection": return {
2840
+ ...componentData,
2841
+ [key]: { selectedBusinessId: "" }
2842
+ };
2843
+ case "companyStructure": return {
2844
+ ...componentData,
2845
+ [key]: { ...businessDetailsSchema[key] }
2846
+ };
2847
+ case "additionalInformation": return {
2848
+ ...componentData,
2849
+ [key]: mapAdditionalInformation({
2850
+ data: businessDetailsSchema[key],
2851
+ legalEntity
2852
+ })
2853
+ };
2854
+ case "companyRegistrationDocument": return {
2855
+ ...componentData,
2856
+ [key]: businessDetailsSchema[key]
2857
+ };
2858
+ case "companyTaxDocument": return {
2859
+ ...componentData,
2860
+ [key]: businessDetailsSchema[key]
2861
+ };
2862
+ case "companyProofOfDirectorDocument": return {
2863
+ ...componentData,
2864
+ [key]: businessDetailsSchema[key]
2865
+ };
2866
+ case "companyProofOfSignatoryDocument": return {
2867
+ ...componentData,
2868
+ [key]: businessDetailsSchema[key]
2869
+ };
2870
+ case "companyProofOfOwnershipDocument": return {
2871
+ ...componentData,
2872
+ [key]: businessDetailsSchema[key]
2873
+ };
2874
+ case "companyConstitutionalDocument": return {
2875
+ ...componentData,
2876
+ [key]: businessDetailsSchema[key]
2877
+ };
2878
+ case "companyFinancialInformation": {
2879
+ const financialReports = legalEntity.type === "organization" ? legalEntity.organization?.financialReports : legalEntity.soleProprietorship?.financialReports;
2880
+ return financialReports?.length ? {
2881
+ ...componentData,
2882
+ [key]: mapFinancialReportsToFinancialInformation(financialReports)
2883
+ } : componentData;
2884
+ }
2885
+ default: return componentData;
2886
+ }
2887
+ }, {});
2888
+ };
2889
+ //#endregion
2890
+ //#region src/components/Business/hooks/useSubmitBusinessDetails.ts
2891
+ function useSubmitBusinessDetails({ country, data, forms, legalEntityResponse, associatedLegalArrangement, nestedLegalEntity, nestedLegalEntityDetails, efpBusinessLines, taskType, problems, setProblems, setLoadingStatus, onExternalSubmit }) {
2892
+ const { t } = useTranslation(["common", "business"]);
2893
+ const { baseUrl, rootLegalEntityId } = useApiContext();
2894
+ const userEvents = useAnalyticsContext();
2895
+ const { accountHolder: accountHolderMaybe } = useAccountHolder();
2896
+ const { showToast } = useToastContext();
2897
+ const { isFeatureEnabled } = useToggleContext();
2898
+ const { data: matchingScenario } = useScenarios(country, "organization");
2899
+ const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
2900
+ const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
2901
+ const { mutateAsync: createBusinessLine } = useCreateBusinessLine();
2902
+ const { mutateAsync: updateBusinessLine } = useUpdateBusinessLine();
2903
+ const invalidateRootLegalEntity = useInvalidateRootLegalEntity();
2904
+ const documentUtils = documentApiUtils({
2905
+ baseUrl: baseUrl.value,
2906
+ rootLegalEntityId: rootLegalEntityId.value
2907
+ });
2908
+ return useCallback$1(async () => {
2909
+ const accountHolder = accountHolderMaybe ?? "theCompanyIWorkFor";
2910
+ const logger = createLogger();
2911
+ setLoadingStatus("loading");
2912
+ let trackingPayload = {
2913
+ actionType: "submit",
2914
+ companyStructure: data.companyStructure?.entityType,
2915
+ countryOfRegistration: data.basicInformation?.country,
2916
+ legalEntityName: accountHolder === "theCompanyIWorkFor" ? data.basicInformation?.legalCompanyName : void 0,
2917
+ usedAdditionalAddress: !data.additionalInformation?.operationalAddressIsSame
2918
+ };
2919
+ /**
2920
+ * Root entity is legalEntityResponse,
2921
+ * Sole prop is associatedLegalArrangment and is undefined on initial creation
2922
+ * Trust Member Company is nestedLegalEntity and is undefined on initial creation
2923
+ */
2924
+ const entityToUpdate = (() => {
2925
+ switch (taskType) {
2926
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: return associatedLegalArrangement;
2927
+ case TaskTypes.TRUST_MEMBER_COMPANY:
2928
+ case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY: return nestedLegalEntity;
2929
+ case TaskTypes.BUSINESS_DETAILS:
2930
+ default: return legalEntityResponse;
2931
+ }
2932
+ })();
2933
+ const handleSubmitLegalEntity = async (legalEntity) => {
2934
+ if (taskType === TaskTypes.TRUST_MEMBER_COMPANY && !nestedLegalEntity?.id || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY && !nestedLegalEntity?.id || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && !associatedLegalArrangement?.id) return await createLegalEntity(legalEntity);
2935
+ else {
2936
+ const { type: _type, ...rest } = legalEntity;
2937
+ return updateLegalEntity({
2938
+ ...rest,
2939
+ id: entityToUpdate?.id ?? legalEntityResponse.id
2940
+ });
2941
+ }
2942
+ };
2943
+ const associateLegalEntityWithParent = async ({ legalEntity, associatedLegalArrangement, nestedLegalEntityDetails }) => {
2944
+ if (nestedLegalEntityDetails && associatedLegalArrangement) {
2945
+ const existingEntityAssociations = getOwnEntityAssociations(associatedLegalArrangement);
2946
+ const existingRoles = existingEntityAssociations.filter((ea) => ea.legalEntityId === associatedLegalArrangement.id).map(({ type }) => type);
2947
+ const newRoles = nestedLegalEntityDetails.roles;
2948
+ if (!doArraysMatch(existingRoles, newRoles)) await updateLegalEntity({
2949
+ id: associatedLegalArrangement.id,
2950
+ entityAssociations: [...newRoles.map((role) => ({
2951
+ type: role,
2952
+ legalEntityId: legalEntity.id
2953
+ })), ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id)]
2954
+ });
2955
+ return;
2956
+ } else {
2957
+ const updatedAssociations = { entityAssociations: [{
2958
+ type: "soleProprietorship",
2959
+ legalEntityId: legalEntity.id
2960
+ }] };
2961
+ await updateLegalEntity({
2962
+ ...updatedAssociations,
2963
+ id: legalEntityResponse.id
2964
+ });
2965
+ }
2966
+ };
2967
+ const filteredData = setRemovedFieldsOnSchemaToDeletedValue(data, mapLegalEntityToBusinessDetailsSchema({
2968
+ legalEntity: entityToUpdate,
2969
+ parentEntity: void 0,
2970
+ taskType,
2971
+ isFeatureEnabled
2972
+ }));
2973
+ if (filteredData.basicInformation && !filteredData.basicInformation.taxInformation) filteredData.basicInformation.taxInformation = void 0;
2974
+ const countryOfGoverningLaw = getCountryOfGoverningLaw(isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies"), filteredData.basicInformation);
2975
+ if (filteredData.basicInformation) if (countryOfGoverningLaw) filteredData.basicInformation.countryOfGoverningLaw = countryOfGoverningLaw;
2976
+ else delete filteredData.basicInformation.countryOfGoverningLaw;
2977
+ try {
2978
+ const mappedLegalEntity = {
2979
+ ...mapBusinessDetailsSchemaToLegalEntity(filteredData, accountHolder, isFeatureEnabled, taskType, matchingScenario, legalEntityResponse),
2980
+ entityAssociations: filterOutUnwantedAssociationsIfRootLE(taskType, entityToUpdate, accountHolder)
2981
+ };
2982
+ if (mappedLegalEntity.type === "organization" && (legalEntityResponse.organization?.registeredAddress.country !== mappedLegalEntity.organization?.registeredAddress.country || legalEntityResponse.organization?.countryOfGoverningLaw !== mappedLegalEntity.organization?.countryOfGoverningLaw) && legalEntityResponse.organization?.support) mappedLegalEntity.organization.support = determineCustomerSupport(legalEntityResponse.organization.support, mappedLegalEntity.organization?.registeredAddress.country);
2983
+ const legalEntity = await handleSubmitLegalEntity(mappedLegalEntity);
2984
+ /**
2985
+ * Sole prop only associated during initial creation but for
2986
+ * trust member company, association can also be updated with changed roles
2987
+ */
2988
+ if (taskType === TaskTypes.TRUST_MEMBER_COMPANY || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY || taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && !associatedLegalArrangement?.id) await associateLegalEntityWithParent({
2989
+ legalEntity,
2990
+ associatedLegalArrangement,
2991
+ nestedLegalEntityDetails
2992
+ });
2993
+ if (forms.some((form) => documentFormsIds.includes(form.formId))) await submitDocuments({
2994
+ data,
2995
+ legalEntity,
2996
+ documentUtils,
2997
+ userEvents
2998
+ });
2999
+ await submitBusinessLines({
3000
+ data,
3001
+ legalEntity: legalEntityResponse,
3002
+ efpBusinessLines,
3003
+ createBusinessLine,
3004
+ updateBusinessLine,
3005
+ matchingScenario,
3006
+ t,
3007
+ showToast
3008
+ });
3009
+ userEvents.addTaskEvent("Success", trackingPayload);
3010
+ showToast({
3011
+ label: t(($) => $["successfullyUpdatedDetails"], { ns: "common" }),
3012
+ variant: "success"
3013
+ });
3014
+ await invalidateRootLegalEntity();
3015
+ onExternalSubmit(data);
3016
+ } catch (err) {
3017
+ if (isValidationError(err)) {
3018
+ const getErrors = processValidationErrors(err, TaskTypes.BUSINESS_DETAILS);
3019
+ if (getErrors && !Object.keys(getErrors).length) {
3020
+ showToast({
3021
+ label: t(($) => $["failedToUpdateDetails"], { ns: "common" }),
3022
+ variant: "error"
3023
+ });
3024
+ const unmappedErrorNames = err.invalidFields.map((field) => field.name).filter(Boolean);
3025
+ if (unmappedErrorNames.length) trackingPayload = {
3026
+ ...trackingPayload,
3027
+ additionalData: { unmappedErrorNames }
3028
+ };
3029
+ } else setProblems({
3030
+ ...problems,
3031
+ validationErrors: getErrors
3032
+ });
3033
+ }
3034
+ if (isMaintenanceModeError(err)) showToast({
3035
+ label: t(($) => $["maintenanceModeMessage"], { ns: "common" }),
3036
+ variant: "error",
3037
+ duration: "indefinite"
3038
+ });
3039
+ if (!isValidationError(err) && !isMaintenanceModeError(err)) showToast({
3040
+ label: t(($) => $["failedToUpdateDetails"], { ns: "common" }),
3041
+ variant: "error"
3042
+ });
3043
+ logger.error(err);
3044
+ userEvents.addTaskEvent("Encountered error", {
3045
+ ...trackingPayload,
3046
+ returnType: err?.errorCode,
3047
+ returnValue: err?.title || "backend"
3048
+ });
3049
+ throw err;
3050
+ } finally {
3051
+ setLoadingStatus("success");
3052
+ }
3053
+ }, [
3054
+ accountHolderMaybe,
3055
+ associatedLegalArrangement,
3056
+ createBusinessLine,
3057
+ createLegalEntity,
3058
+ data,
3059
+ documentUtils,
3060
+ efpBusinessLines,
3061
+ forms,
3062
+ invalidateRootLegalEntity,
3063
+ isFeatureEnabled,
3064
+ legalEntityResponse,
3065
+ matchingScenario,
3066
+ nestedLegalEntity,
3067
+ nestedLegalEntityDetails,
3068
+ onExternalSubmit,
3069
+ problems,
3070
+ setLoadingStatus,
3071
+ setProblems,
3072
+ showToast,
3073
+ t,
3074
+ taskType,
3075
+ updateBusinessLine,
3076
+ updateLegalEntity,
3077
+ userEvents
3078
+ ]);
3079
+ }
3080
+ async function submitDocuments({ data, legalEntity, documentUtils, userEvents }) {
3081
+ const logger = createLogger();
3082
+ const formattedDocument = await mapBusinessDetailsDocumentToApiDocument(data, legalEntity.id);
3083
+ formattedDocument.forEach((doc) => {
3084
+ const existingDoc = getDocument(legalEntity.id, doc.type);
3085
+ if (doc.type === "proofOfOwnership" && existingDoc && doc.attachments?.length) doc.attachments = mergeProofOfOwnershipAttachments(existingDoc.attachments, doc.attachments).filter((attachment) => attachment.pageName);
3086
+ });
3087
+ try {
3088
+ await documentUtils.uploadDocuments(formattedDocument, legalEntity.id);
3089
+ formattedDocument.forEach((doc) => {
3090
+ userEvents.addTaskEvent("Success", {
3091
+ actionType: "upload",
3092
+ documentType: doc.type,
3093
+ fileExtention: doc.attachments?.map((item) => getFileExtention(item.pageName)).filter((item) => item !== void 0) ?? []
3094
+ });
3095
+ });
3096
+ } catch (err) {
3097
+ logger.error(err);
3098
+ userEvents.addTaskEvent("Encountered error", {
3099
+ actionType: "upload",
3100
+ returnType: err.errorCode,
3101
+ returnValue: err.title ?? err.message
3102
+ });
3103
+ }
3104
+ }
3105
+ async function submitBusinessLines({ data, legalEntity, efpBusinessLines, createBusinessLine, updateBusinessLine, matchingScenario, t, showToast }) {
3106
+ const primaryIndustryCode = data.additionalInformation?.industryCodes && data.additionalInformation.industryCodes[0].id;
3107
+ if (!primaryIndustryCode) return;
3108
+ const logger = createLogger();
3109
+ const bankingBusinessLines = [];
3110
+ const issuingBusinessLines = [];
3111
+ if (efpBusinessLines) for (const bl of efpBusinessLines) if (bl.service === "banking") bankingBusinessLines.push(bl);
3112
+ else issuingBusinessLines.push(bl);
3113
+ const promises = [];
3114
+ const operations = [];
3115
+ const updateOrCreateBusinessLinesIfNeeded = (businessLines, requestedCapability, service) => {
3116
+ if (businessLines.length) for (const bl of businessLines) {
3117
+ if (bl.industryCode === primaryIndustryCode) continue;
3118
+ const payload = {
3119
+ id: bl.id,
3120
+ legalEntityId: legalEntity.id,
3121
+ industryCode: primaryIndustryCode,
3122
+ service
3123
+ };
3124
+ promises.push(updateBusinessLine(payload));
3125
+ operations.push(payload);
3126
+ }
3127
+ else if (requestedCapability) {
3128
+ const payload = {
3129
+ legalEntityId: legalEntity.id,
3130
+ industryCode: primaryIndustryCode,
3131
+ service
3132
+ };
3133
+ promises.push(createBusinessLine(payload));
3134
+ operations.push(payload);
3135
+ }
3136
+ };
3137
+ updateOrCreateBusinessLinesIfNeeded(bankingBusinessLines, !!matchingScenario?.includes("L_BANKING"), "banking");
3138
+ updateOrCreateBusinessLinesIfNeeded(issuingBusinessLines, !!matchingScenario?.includes("L_ISSUING"), "issuing");
3139
+ let hadRejection = false;
3140
+ (await Promise.allSettled(promises)).forEach((result, idx) => {
3141
+ if (result.status !== "rejected") return;
3142
+ const op = operations[idx];
3143
+ logger.log(`Failed to ${op.id ? "update" : "create"} business line with payload: ${JSON.stringify(op)}`);
3144
+ hadRejection = true;
3145
+ });
3146
+ if (hadRejection) showToast({
3147
+ label: t(($) => $["failedToUpdateEfpBusinessLines"], { ns: "business" }),
3148
+ variant: "error"
3149
+ });
3150
+ }
3151
+ var determineCustomerSupport = (customerSupport, country) => {
3152
+ switch (country) {
3153
+ case CountryCodes.Japan: return unsetCustomerSupportNumber(customerSupport);
3154
+ default: return;
3155
+ }
3156
+ };
3157
+ var unsetCustomerSupportNumber = (customerSupport) => {
3158
+ return customerSupport ? {
3159
+ email: customerSupport.email,
3160
+ phone: {
3161
+ number: "",
3162
+ type: "mobile"
3163
+ }
3164
+ } : void 0;
3165
+ };
3166
+ //#endregion
3167
+ //#region src/context/handlerContext/useHandlerContext.ts
3168
+ function useHandlerContext() {
3169
+ return useContext$1(HandlerContext);
3170
+ }
3171
+ //#endregion
3172
+ //#region src/components/Business/modals/LegalArrangementModal.tsx
3173
+ function LegalArrangementModal({ onCancel }) {
3174
+ const { t } = useTranslation(["common", "business"]);
3175
+ const { onNavigateToTask } = useHandlerContext();
3176
+ return /* @__PURE__ */ jsx(Confirm, {
3177
+ title: t(($) => $["thisBusinessIsntRegisteredAsACompany"], { ns: "business" }),
3178
+ description: t(($) => $["ifThisIsYourBusinessGoBackAndChooseADifferentSetup"], { ns: "business" }),
3179
+ cancelText: t(($) => $["close"], { ns: "common" }),
3180
+ confirmText: t(($) => $["continue"], { ns: "common" }),
3181
+ onCancel,
3182
+ onConfirm: () => onNavigateToTask?.(TaskTypes.BUSINESS_TYPE_SELECTION),
3183
+ analyticsEventLabel: "legalArrangementModal"
3184
+ });
3185
+ }
3186
+ //#endregion
3187
+ //#region src/components/Business/modals/RegistrationNumberMismatchModal.tsx
3188
+ function RegistrationNumberMismatchModal({ companySearchStateModel, registrationNumberMismatchModalOpen, confirmDataSelection }) {
3189
+ const { t } = useTranslation(["common", "business"]);
3190
+ const { form } = useFormContext();
3191
+ const { data } = getFormSlice(form, "basicInformation");
3192
+ const country = data?.country;
3193
+ const providedData = {
3194
+ registrationNumber: data?.registrationNumber,
3195
+ registrationNumberType: data?.registrationNumberType
3196
+ };
3197
+ const detectedData = {
3198
+ registrationNumber: companySearchStateModel.selectedCompany.value?.registrationNumber,
3199
+ registrationNumberType: void 0
3200
+ };
3201
+ const registrationNumberType = data?.exemptedFromRegistrationNumber ? "exempted" : data?.registrationNumberType;
3202
+ const { label: registrationNumberLabel } = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
3203
+ registrationNumberType: registrationNumberType === "exempted" ? void 0 : registrationNumberType,
3204
+ state: data?.stateOrProvince || void 0
3205
+ }, registrationNumberDefaultFieldMetadata);
3206
+ return /* @__PURE__ */ jsx(DataConflictsModal, {
3207
+ providedData,
3208
+ detectedData,
3209
+ conflictingProperties: ["registrationNumber"],
3210
+ formatters: {},
3211
+ labels: { registrationNumber: providedData.registrationNumberType === detectedData.registrationNumberType ? registrationNumberLabel : "registrationNumber" },
3212
+ title: t(($) => $["verifyYourBusinesssDetails"], { ns: "business" }),
3213
+ explanation: t(($) => $["selectTheOptionWithTheMostCorrectDetailsToContinue"], { ns: "business" }),
3214
+ onCancel: () => registrationNumberMismatchModalOpen.value = false,
3215
+ onContinue: confirmDataSelection,
3216
+ listOnly: true
3217
+ });
3218
+ }
3219
+ //#endregion
3220
+ //#region src/components/Business/modals/TinMismatchModal.tsx
3221
+ function TinMismatchModal({ onCancel, onConfirm }) {
3222
+ const { t } = useTranslation(["common", "business"]);
3223
+ const modalDescriptionKey = typeof useContext$1(CompanySearchStateContext).selectedCompany.value === "undefined" ? "theEinDidntMatchLegalBusinessName" : "itLooksLikeThisBusinessUsesADifferentEIN";
3224
+ return /* @__PURE__ */ jsx(Confirm, {
3225
+ title: t(($) => $["employerIdentificationNumberDoesntMatch"], { ns: "business" }),
3226
+ description: t(($) => $[modalDescriptionKey], { ns: "business" }),
3227
+ cancelText: t(($) => $["close"], { ns: "common" }),
3228
+ confirmText: t(($) => $["continue"], { ns: "common" }),
3229
+ onCancel,
3230
+ onConfirm,
3231
+ analyticsEventLabel: "tinVerificationFailureModal"
3232
+ });
3233
+ }
3234
+ //#endregion
3235
+ //#region src/components/Business/utils/buildRequiredForms.ts
3236
+ function buildRequiredForms({ config: { forms, requiredFields, optionalFields, isValid, problems, isSettingEnabled, accountHolder, legalEntityResponse }, options }) {
3237
+ /**
3238
+ * Skip company structure if:
3239
+ * - Only a single company structure is available
3240
+ * - The legal form is already provided from a 3rd party provider
3241
+ * - The legal entity type is allowed to skip company structure
3242
+ * - The account holder is not a trust or unincorporated partnership
3243
+ *
3244
+ * This needs to be done here and not the rules because when selecting incorporated association or incorporated partnership, we set the entityType value in the
3245
+ * multiform data. This means that even if the rules say we don't need this value, because the data is present we show add that field to required fields.
3246
+ */
3247
+ const skipCompanyStructure = options?.skipCompanyStructure || isSettingEnabled(SettingNames.AllowLegalEntityTypeChange) && organizationTypesToSkipCompanyStructureForm.includes(legalEntityResponse.organization?.type ?? "") && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership";
3248
+ const filteredForms = Object.values(forms).filter(({ formId }) => {
3249
+ if (formId === "businessSelection") {
3250
+ if (options?.skipBusinessSelection) return false;
3251
+ }
3252
+ if (formId === "companyStructure") {
3253
+ if (skipCompanyStructure) return false;
3254
+ }
3255
+ if (requiredFields || optionalFields) return Boolean(requiredFields?.[formId]) || Boolean(optionalFields?.[formId]);
3256
+ return true;
3257
+ });
3258
+ return addValidityToForms(options?.skipSummary ? filteredForms : [...filteredForms, summaryStep], isValid, problems);
3259
+ }
3260
+ //#endregion
3261
+ //#region src/components/Business/utils/formatDataForSummary.ts
3262
+ function createStructuredListItem(term, details, t) {
3263
+ if (!details) return;
3264
+ return {
3265
+ term: t(($) => $[term], { ns: "common" }),
3266
+ details
3267
+ };
3268
+ }
3269
+ var formatBasicInformation = (data, datasetUtils, companyType, isCountryOfGoverningLawEnabled) => {
3270
+ const country = data.country;
3271
+ const taxInfoForCountry = data.taxInformation?.find((taxInfo) => taxInfo.country === country);
3272
+ let taxIdLabel = "taxInformationNumber";
3273
+ if (country in taxIdNumberOptions) {
3274
+ const numberOption = taxIdNumberOptions[country]?.find((taxOption) => taxOption.id === taxInfoForCountry?.type);
3275
+ if (numberOption) taxIdLabel = numberOption.name;
3276
+ }
3277
+ const registrationNumberLabel = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
3278
+ companyType,
3279
+ registrationNumberType: data.registrationNumber ? inferCompanyRegistrationNumberType(data.registrationNumber, country, companyType) : getCompanyRegistrationNumberOptions(country, companyType)?.[0]?.id
3280
+ }, registrationNumberDefaultFieldMetadata).label ?? "";
3281
+ return {
3282
+ legalCompanyName: data.legalCompanyName,
3283
+ country: datasetUtils.getCountryName(data.country),
3284
+ [getKeyForField("stateOrProvince", data.country)]: datasetUtils.getStateName(data.stateOrProvince, data.country),
3285
+ [taxIdLabel]: taxInfoForCountry?.number,
3286
+ [registrationNumberLabel]: data.registrationNumber,
3287
+ countryOfGoverningLaw: datasetUtils.getCountryName(getCountryOfGoverningLaw(isCountryOfGoverningLawEnabled, data))
3288
+ };
3289
+ };
3290
+ var formatAdditionalInformation = (data, t) => {
3291
+ const vatAbsenceReason = data.vatAbsenceReason;
3292
+ return {
3293
+ businessStructure: data.legalFormLabel,
3294
+ doingBusinessAs: data.doingBusinessAs,
3295
+ industry: data.industryCodes?.[0].name,
3296
+ vatNumber: data.vatNumber,
3297
+ vatAbsenceReason: vatAbsenceReason ? t(($) => $[vatAbsenceReason], { ns: "common" }) : "",
3298
+ legalEntityIdentifier: data.legalEntityIdentifier,
3299
+ dateOfIncorporation: data.dateOfIncorporation,
3300
+ stockExchangeMIC: data.stockExchangeMIC,
3301
+ stockISIN: data.stockISIN,
3302
+ stockTickerSymbol: data.stockTickerSymbol,
3303
+ eInvoicingCode: data.eInvoicingCode
3304
+ };
3305
+ };
3306
+ var formatAddress = (data, datasetUtils, country, version) => {
3307
+ return country === CountryCodes.Japan && version === 4 ? mapJpAddressSummaryNewSummary(data, datasetUtils) : mapAddressLabelsNewSummary(data, datasetUtils);
3308
+ };
3309
+ var formatFinancialInformationSummary = (data, language, country, dateOfIncorporation) => {
3310
+ if (!data) return {};
3311
+ if (dateOfIncorporation && !isDateOlderThanAYear(dateOfIncorporation)) return country === CountryCodes.UnitedKingdom ? { numberOfEmployees: data.numberOfEmployees } : {};
3312
+ return {
3313
+ currency: data.currency,
3314
+ financialReportingDate: data.financialReportingDate,
3315
+ ...country === CountryCodes.UnitedKingdom ? { numberOfEmployees: data.numberOfEmployees } : {},
3316
+ ...data.balanceSheetTotal ? { balanceSheetTotal: formatCurrency(data.balanceSheetTotal, data.currency, language) } : {},
3317
+ ...data.annualTurnover ? { annualTurnover: formatCurrency(data.annualTurnover, data.currency, language) } : {}
3318
+ };
3319
+ };
3320
+ var formatDataForSummary = (data, forms, t, language, isFeatureEnabled, version) => {
3321
+ const OMITTED_FORMS = ["businessSelection", "summary"];
3322
+ const datasetUtils = datasetUtilities(language);
3323
+ const isCountryOfGoverningLawEnabled = isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies");
3324
+ const getSummaryItemsForForm = (formId) => {
3325
+ if (!data[formId]) return {};
3326
+ switch (formId) {
3327
+ case "basicInformation": return formatBasicInformation(data[formId], datasetUtils, data.companyStructure?.entityType, isCountryOfGoverningLawEnabled);
3328
+ case "companyStructure": return { entityType: t(($) => $[companyTypeMetadata[data[formId]?.entityType]?.name], { ns: "business" }) };
3329
+ case "additionalInformation": return formatAdditionalInformation(data[formId], t);
3330
+ case "companyRegistrationDocument": return {
3331
+ fileName: data[formId].registrationDocument?.[0]?.name,
3332
+ description: data[formId].description
3333
+ };
3334
+ case "companyTaxDocument": return {
3335
+ fileName: data[formId]?.taxDocument?.[0]?.name,
3336
+ description: data[formId].description
3337
+ };
3338
+ case "companyProofOfAddressDocument": return {
3339
+ fileName: data[formId]?.proofOfAddress?.[0]?.name,
3340
+ description: data[formId].description
3341
+ };
3342
+ case "companyConstitutionalDocument": return {
3343
+ fileName: data[formId]?.constitutionalDocument?.[0]?.name,
3344
+ description: data[formId].description
3345
+ };
3346
+ case "companyProofOfDirectorDocument": return {
3347
+ fileName: data[formId]?.proofOfDirector?.[0]?.name,
3348
+ description: data[formId].description
3349
+ };
3350
+ case "companyProofOfSignatoryDocument": return {
3351
+ fileName: data[formId]?.proofOfSignatory?.[0]?.name,
3352
+ description: data[formId].description
3353
+ };
3354
+ case "companyProofOfOwnershipDocument": return {
3355
+ fileName: data[formId].proofOfOwnership?.map((doc) => doc.name).join("\n"),
3356
+ description: data[formId].description
3357
+ };
3358
+ case "companyFinancialInformation": return formatFinancialInformationSummary(data[formId], language, data.basicInformation?.country, data.additionalInformation?.dateOfIncorporation);
3359
+ default: return {};
3360
+ }
3361
+ };
3362
+ const translateAndFilterMappedSummary = (data) => {
3363
+ const tmp = [];
3364
+ for (const summaryItem in data) {
3365
+ const item = createStructuredListItem(summaryItem, data[summaryItem], t);
3366
+ if (item) tmp.push(item);
3367
+ }
3368
+ return tmp;
3369
+ };
3370
+ const summarySectionData = [];
3371
+ for (const form of forms) {
3372
+ if (OMITTED_FORMS.includes(form.formId)) continue;
3373
+ const summaryItems = translateAndFilterMappedSummary(getSummaryItemsForForm(form.formId));
3374
+ if (summaryItems.length > 0) summarySectionData.push({
3375
+ formId: form.formId,
3376
+ label: t(($) => $[form.formName], { ns: "common" }),
3377
+ items: summaryItems
3378
+ });
3379
+ if (form.formId === "additionalInformation") {
3380
+ const registrationAddressSummaryItems = translateAndFilterMappedSummary(formatAddress(nestAddressSchema("registrationAddress", data.additionalInformation), datasetUtils, data.basicInformation?.country, version));
3381
+ if (registrationAddressSummaryItems.length > 0) summarySectionData.push({
3382
+ formId: "registrationAddress",
3383
+ label: t(($) => $["registrationAddress"], { ns: "common" }),
3384
+ items: registrationAddressSummaryItems
3385
+ });
3386
+ if (!data[form.formId]?.operationalAddressIsSame) {
3387
+ const operationalAddressSummaryItems = translateAndFilterMappedSummary(formatAddress(nestAddressSchema("operationalAddress", data.additionalInformation), datasetUtils, data.basicInformation?.country, version));
3388
+ if (operationalAddressSummaryItems.length > 0) summarySectionData.push({
3389
+ formId: "operationalAddress",
3390
+ label: t(($) => $["operationalAddress"], { ns: "common" }),
3391
+ items: operationalAddressSummaryItems
3392
+ });
3393
+ }
3394
+ }
3395
+ }
3396
+ return summarySectionData;
3397
+ };
3398
+ //#endregion
3399
+ //#region src/components/Business/tasks/BusinessDetailsDropin/businessDetailsFormConfig.ts
3400
+ var businessDetailsBase = {
3401
+ country: { rule: "REQUIRED" },
3402
+ entityType: { rule: "businessRequiresCompanyType" },
3403
+ legalCompanyName: { rule: "REQUIRED" },
3404
+ jaHaniLegalCompanyName: { rule: "japaneseLegalCompanyName" },
3405
+ jaKanaLegalCompanyName: { rule: "japaneseLegalCompanyName" },
3406
+ hasDoingBusinessAs: { rule: "REQUIRED" },
3407
+ doingBusinessAs: { rule: "requireDoingBusinessAsName" },
3408
+ residentialAddressIndicator: { rule: "isResidentialAddressIndicatorEnabled" },
3409
+ operationalAddressIsSame: { rule: "REQUIRED" },
3410
+ legalEntityIdentifier: { rule: "requireLEI" },
3411
+ exemptedFromLegalEntityIdentifier: { rule: "requireLEIExemption" },
3412
+ selectedBusinessId: { rule: "usingCompanySearch" },
3413
+ stateOrProvince: { rule: "requireStateOrProvinceForCompanySearch" },
3414
+ stockExchangeMIC: { rule: "ifPubliclyTradedCompany" },
3415
+ stockISIN: { rule: "ifPubliclyTradedCompany" },
3416
+ stockTickerSymbol: { rule: "ifPubliclyTradedCompany" },
3417
+ dateOfIncorporation: { rule: "isDateOfIncorporationRequired" },
3418
+ registrationNumber: { rule: "countryRequiresRegistrationNumber" },
3419
+ registrationNumberType: { rule: "registrationNumberType" },
3420
+ exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
3421
+ eInvoicingCode: { rule: "isEInvoicingCodeEnabled" },
3422
+ countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" },
3423
+ taxDocument: { rule: "isTaxDocumentRequired" },
3424
+ registrationDocument: { rule: "isRegistrationDocumentRequired" },
3425
+ registrationAddressStreet: { rule: "registrationAddressStreetRequired" },
3426
+ registrationAddressStreet2: { rule: "registrationAddressStreet2Required" },
3427
+ registrationAddressCity: { rule: "registrationAddressCityRequired" },
3428
+ registrationAddressPostalCode: { rule: "registrationAddressPostalCodeRequired" },
3429
+ registrationAddressStateOrProvince: { rule: "registrationAddressStateOrProvinceRequired" },
3430
+ registrationAddressCountry: { rule: "registrationAddressCountryRequired" },
3431
+ operationalAddressStreet: { rule: "operationalAddressStreetRequired" },
3432
+ operationalAddressStreet2: { rule: "operationalAddressStreet2Required" },
3433
+ operationalAddressCity: { rule: "operationalAddressCityRequired" },
3434
+ operationalAddressPostalCode: { rule: "operationalAddressPostalCodeRequired" },
3435
+ operationalAddressStateOrProvince: { rule: "operationalAddressStateOrProvinceRequired" },
3436
+ operationalAddressCountry: { rule: "operationalAddressCountryRequired" },
3437
+ registrationAddressJaHaniStateOrProvince: { rule: "registrationAddressJaHaniStateOrProvinceRequired" },
3438
+ registrationAddressJaHaniCity: { rule: "registrationAddressJaHaniCityRequired" },
3439
+ registrationAddressJaHaniStreet: { rule: "registrationAddressJaHaniStreetRequired" },
3440
+ registrationAddressJaKanaStateOrProvince: { rule: "registrationAddressJaKanaStateOrProvinceRequired" },
3441
+ registrationAddressJaKanaCity: { rule: "registrationAddressJaKanaCityRequired" },
3442
+ registrationAddressStreet2FullWidth: { rule: "registrationAddressStreet2FullWidthRequired" },
3443
+ operationalAddressJaHaniStateOrProvince: { rule: "operationalAddressJaHaniStateOrProvinceRequired" },
3444
+ operationalAddressJaHaniCity: { rule: "operationalAddressJaHaniCityRequired" },
3445
+ operationalAddressJaHaniStreet: { rule: "operationalAddressJaHaniStreetRequired" },
3446
+ operationalAddressJaKanaStateOrProvince: { rule: "operationalAddressJaKanaStateOrProvinceRequired" },
3447
+ operationalAddressJaKanaCity: { rule: "operationalAddressJaKanaCityRequired" },
3448
+ operationalAddressStreet2FullWidth: { rule: "operationalAddressStreet2FullWidthRequired" }
3449
+ };
3450
+ var taxInformationBase = {
3451
+ vatNumber: { rule: "countryUsesVat" },
3452
+ vatNumberType: { rule: "vatNumberType" },
3453
+ exemptedFromVat: { rule: "isVatExempt" },
3454
+ vatAbsenceReason: { rule: "isVatExempt" },
3455
+ taxInformation: { rule: "countryUsesTaxId" },
3456
+ exemptedFromTax: { rule: "countryHasTaxExemptions" },
3457
+ isUen: { rule: "countryUsesUenOrGst" }
3458
+ };
3459
+ var financialInformationBase = {
3460
+ numberOfEmployees: { rule: "countryRequiresFinancialInformation" },
3461
+ financialReportingDate: { rule: "isFinancialReportingFieldsRequired" },
3462
+ currency: { rule: "isFinancialReportingFieldsRequired" },
3463
+ reportedValueOption: { rule: "isFinancialReportingFieldsRequired" },
3464
+ annualTurnover: { rule: "annualTurnoverRequired" },
3465
+ balanceSheetTotal: { rule: "balanceSheetTotalRequired" }
3466
+ };
3467
+ var businessDetailsFieldsPerScenario = {
3468
+ L0: {
3469
+ country: { rule: "REQUIRED" },
3470
+ legalCompanyName: { rule: "REQUIRED" },
3471
+ stateOrProvince: { rule: "usingCompanySearch" },
3472
+ ...financialInformationBase
3473
+ },
3474
+ L1: {
3475
+ ...businessDetailsBase,
3476
+ ...financialInformationBase
3477
+ },
3478
+ L: {
3479
+ ...businessDetailsBase,
3480
+ ...taxInformationBase,
3481
+ ...financialInformationBase
3482
+ },
3483
+ L_PROOFOFADDRESS: { proofOfAddress: { rule: "REQUIRED" } },
3484
+ L_REGDOC: { registrationDocument: { rule: "REQUIRED" } },
3485
+ L_TAXDOC: { taxDocument: { rule: "REQUIRED" } },
3486
+ L_BAFIN: { legalForm: { rule: "REQUIRED" } },
3487
+ L_ISSUING: { industryCodes: { rule: "isIndustryCodeRequired" } },
3488
+ L_BANKING: { industryCodes: { rule: "isIndustryCodeRequired" } }
3489
+ };
3490
+ //#endregion
3491
+ //#region src/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsGettingStarted.tsx
3492
+ var businessDetailsImage = lazy(() => import("./business-details-CPkvjYXG.js"));
3493
+ var BusinessDetailsGettingStarted = ({ openModal, handleCancelClick, t, data: summaryData }) => {
3494
+ const { data: taskStatus } = useTaskStatus(TaskTypes.BUSINESS_DETAILS, { refetchInterval: TASK_STATUS_POLLING_INTERVAL_MS });
3495
+ return /* @__PURE__ */ jsx("div", {
3496
+ style: {
3497
+ maxWidth: 450,
3498
+ margin: "0 auto"
3499
+ },
3500
+ children: (taskStatus?.status ?? "DETAILS_REQUIRED") === "DETAILS_REQUIRED" ? /* @__PURE__ */ jsx(LandingLayout, {
3501
+ title: t(($) => $["businessDetails"], { ns: "common" }),
3502
+ description: t(($) => $["businessDetailsGettingStarted"], { ns: "business" }),
3503
+ media: /* @__PURE__ */ jsx(Image, { lazyLoadedImage: businessDetailsImage }),
3504
+ actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
3505
+ fullWidth: true,
3506
+ onClick: openModal,
3507
+ children: t(($) => $["getStarted"], { ns: "common" })
3508
+ }), /* @__PURE__ */ jsx(Button, {
3509
+ variant: "tertiary",
3510
+ fullWidth: true,
3511
+ onClick: handleCancelClick,
3512
+ children: t(($) => $["finishLater"], { ns: "common" })
3513
+ })] })
3514
+ }) : /* @__PURE__ */ jsxs(StackLayout, {
3515
+ align: "center",
3516
+ children: [/* @__PURE__ */ jsx(TaskVerificationStatus, { status: taskStatus?.status ?? "FINISHED" }), /* @__PURE__ */ jsx(DetailViewLayout, {
3517
+ title: t(($) => $["businessDetails"], { ns: "common" }),
3518
+ align: "center",
3519
+ description: t(($) => $["theDetailsWeCollected"], { ns: "business" }),
3520
+ actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
3521
+ onClick: openModal,
3522
+ children: t(($) => $["edit"], { ns: "common" })
3523
+ }), /* @__PURE__ */ jsx(Button, {
3524
+ variant: "secondary",
3525
+ onClick: handleCancelClick,
3526
+ fullWidth: true,
3527
+ children: t(($) => $["goBackToTaskList"], { ns: "common" })
3528
+ })] }),
3529
+ children: summaryData?.map(({ formId, label, items }) => /* @__PURE__ */ jsx(SummarySection, {
3530
+ formId,
3531
+ label,
3532
+ items
3533
+ }, formId))
3534
+ })]
3535
+ })
3536
+ });
3537
+ };
3538
+ //#endregion
3539
+ //#region src/components/Business/utils/applyVerifiedBusinessData.ts
3540
+ var applyFinancialInformation = (form, verifiedData) => {
3541
+ const financialInformation = verifiedData?.financialInformation;
3542
+ if (!financialInformation) return;
3543
+ const verifiedFinancialReportingDate = financialInformation.financialReportingDate;
3544
+ const currentFinancialReportingDate = form.data.companyFinancialInformation?.financialReportingDate;
3545
+ if (!currentFinancialReportingDate || verifiedFinancialReportingDate && verifiedFinancialReportingDate >= currentFinancialReportingDate) {
3546
+ if (financialInformation.numberOfEmployees != null) form.handleChangeFor("companyFinancialInformation", "numberOfEmployees")(financialInformation.numberOfEmployees);
3547
+ if (financialInformation.financialReportingDate) form.handleChangeFor("companyFinancialInformation", "financialReportingDate")(financialInformation.financialReportingDate);
3548
+ if (financialInformation.currency) form.handleChangeFor("companyFinancialInformation", "currency")(financialInformation.currency);
3549
+ /**
3550
+ * Determine which reported value option to select based on available data
3551
+ * Priority: balanceSheetTotal > annualTurnover
3552
+ */
3553
+ const selectedReportedValueOption = financialInformation.balanceSheetTotal != null ? "balanceSheetTotal" : financialInformation.annualTurnover != null ? "annualTurnover" : null;
3554
+ if (selectedReportedValueOption) {
3555
+ const selectedReportedValue = selectedReportedValueOption === "balanceSheetTotal" ? financialInformation.balanceSheetTotal : financialInformation.annualTurnover;
3556
+ const nonSelectedReportedValueOption = selectedReportedValueOption === "balanceSheetTotal" ? "annualTurnover" : "balanceSheetTotal";
3557
+ form.handleChangeFor("companyFinancialInformation", "reportedValueOption")(selectedReportedValueOption);
3558
+ form.handleChangeFor("companyFinancialInformation", selectedReportedValueOption)(selectedReportedValue);
3559
+ form.handleChangeFor("companyFinancialInformation", nonSelectedReportedValueOption)(void 0);
3560
+ }
3561
+ }
3562
+ };
3563
+ var applyVerifiedBusinessData = (form, country, verifiedData, options) => {
3564
+ if (!verifiedData) return;
3565
+ form.handleChangeFor("basicInformation", "legalCompanyName")(verifiedData.name);
3566
+ if (!options?.preserveRegistrationNumber && country !== CountryCodes.UnitedStates && verifiedData.registrationNumber) {
3567
+ form.handleChangeFor("basicInformation", "registrationNumber")(verifiedData.registrationNumber);
3568
+ const inferredRegistrationNumberType = inferCompanyRegistrationNumberType(verifiedData.registrationNumber, country, verifiedData.companyType);
3569
+ form.handleChangeFor("basicInformation", "registrationNumberType")(inferredRegistrationNumberType);
3570
+ }
3571
+ const companyType = options?.companyTypeOverride ?? verifiedData.companyType;
3572
+ if (companyType) form.handleChangeFor("companyStructure", "entityType")(companyType);
3573
+ if (!(form.defaultData?.additionalInformation?.registrationAddressStreet || form.defaultData?.additionalInformation?.operationalAddressStreet)) {
3574
+ if (verifiedData.principalPlaceOfBusinessAddress) form.handleChangeFor("additionalInformation", "operationalAddressIsSame", "input")(false);
3575
+ const addressFields = [...form.requiredFields?.additionalInformation ?? [], ...form.optionalFields?.additionalInformation ?? []];
3576
+ const applyVerifiedAddress = (prefix, address) => {
3577
+ const flatVerifiedAddress = flattenAddressSchema(prefix, {
3578
+ ...address,
3579
+ country
3580
+ });
3581
+ for (const field in flatVerifiedAddress) {
3582
+ const fieldValue = flatVerifiedAddress[field];
3583
+ if (fieldValue === void 0 || !addressFields.includes(field)) continue;
3584
+ form.handleChangeFor("additionalInformation", field)(fieldValue);
3585
+ }
3586
+ };
3587
+ if (verifiedData.registeredAddress) applyVerifiedAddress("registrationAddress", mapAddressData(verifiedData.registeredAddress));
3588
+ if (verifiedData.principalPlaceOfBusinessAddress) applyVerifiedAddress("operationalAddress", mapAddressData(verifiedData.principalPlaceOfBusinessAddress));
3589
+ }
3590
+ applyFinancialInformation(form, verifiedData);
3591
+ };
3592
+ //#endregion
3593
+ //#region src/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.ts
3594
+ var CompanySearchStateModel = createModel((userEvents) => {
3595
+ const companySearchName = signal();
3596
+ const selectedCompany = signal(void 0);
3597
+ const verifiedBusiness = signal(void 0);
3598
+ const verificationMatched = signal(void 0);
3599
+ /** We cannot allow selections in a few situations, this is used to track them */
3600
+ const disallowedSelectionReason = signal(void 0);
3601
+ /** Only used for MixPanel tracking, not meant to be exposed */
3602
+ const selectedCompanyIdx = signal(-1);
3603
+ const resetCompanySearchData = () => {
3604
+ selectedCompany.value = void 0;
3605
+ verifiedBusiness.value = void 0;
3606
+ verificationMatched.value = void 0;
3607
+ disallowedSelectionReason.value = void 0;
3608
+ selectedCompanyIdx.value = -1;
3609
+ };
3610
+ return {
3611
+ companySearchName,
3612
+ selectedCompany,
3613
+ verifiedBusiness,
3614
+ verificationMatched,
3615
+ disallowedSelectionReason,
3616
+ resetCompanySearchData,
3617
+ disallowSelection: (reason) => {
3618
+ resetCompanySearchData();
3619
+ disallowedSelectionReason.value = reason;
3620
+ },
3621
+ setVerificationMatched: (value) => {
3622
+ resetCompanySearchData();
3623
+ verificationMatched.value = value;
3624
+ },
3625
+ selectCompany: (selected, idx, country) => {
3626
+ resetCompanySearchData();
3627
+ selectedCompany.value = selected;
3628
+ verificationMatched.value = country === CountryCodes.UnitedStates ? selected.tinMatched : selected.registrationNumberMatched;
3629
+ /** `-1` indicates auto-selection, not a manual user interaction */
3630
+ if (idx > -1) {
3631
+ selectedCompanyIdx.value = idx;
3632
+ selectBusinessAnalytics(userEvents, idx);
3633
+ }
3634
+ },
3635
+ confirmCompany: (multiform, country, options) => {
3636
+ verifiedBusiness.value = selectedCompany.value;
3637
+ applyVerifiedBusinessData(multiform, country, selectedCompany.value, options);
3638
+ if (selectedCompanyIdx.value > -1) confirmBusinessAnalytics(userEvents, selectedCompanyIdx.value);
3639
+ }
3640
+ };
3641
+ });
3642
+ function selectBusinessAnalytics(userEvents, idx) {
3643
+ userEvents.addPageEvent("Clicked button", {
3644
+ actionType: "select",
3645
+ label: "selectBusiness",
3646
+ additionalData: { companyIdx: idx }
3647
+ });
3648
+ }
3649
+ function confirmBusinessAnalytics(userEvents, idx) {
3650
+ userEvents.addPageEvent("Clicked button", {
3651
+ actionType: "select",
3652
+ label: "confirmBusiness",
3653
+ additionalData: { companyIdx: idx }
3654
+ });
3655
+ }
3656
+ //#endregion
3657
+ //#region src/components/Shared/fields/CountryField/validate.ts
3658
+ var CountryFieldValidation = () => ({ country: {
3659
+ modes: ["blur"],
3660
+ validate: (country) => !isEmpty(country),
3661
+ errorMessage: "fieldIsRequired"
3662
+ } });
3663
+ //#endregion
3664
+ //#region src/components/Business/tasks/BusinessDetailsDropin/validate.ts
3665
+ var logger = createLogger();
3666
+ function basicInformationValidators({ country, taxIdNumberType, companyType, registrationNumberType, state, isFeatureEnabled }) {
3667
+ return {
3668
+ country: CountryFieldValidation().country,
3669
+ countryOfGoverningLaw: CountryOfGoverningLawFieldValidation().countryOfGoverningLaw,
3670
+ legalCompanyName: resolveFieldMetadata(isFeatureEnabled("StrictNameAndAddressValidationV4") ? defaultFieldConfigV4[country] : defaultFieldConfig[country], {}, isFeatureEnabled("StrictNameAndAddressValidationV4") ? defaultFieldMetadataV4 : defaultFieldMetadata).validators,
3671
+ taxInformation: resolveFieldMetadata(taxInformationDefaultFieldConfig[country], {
3672
+ taxIdNumberType,
3673
+ companyType
3674
+ }, taxInformationDefaultFieldMetadata).validators,
3675
+ stateOrProvince: stateFieldMetadata.validators,
3676
+ registrationNumber: resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
3677
+ companyType,
3678
+ registrationNumberType,
3679
+ state,
3680
+ isFeatureEnabled
3681
+ }, registrationNumberDefaultFieldMetadata).validators,
3682
+ exemptedFromRegistrationNumber: exemptFromRegistrationNumberDefaultFieldMetadata.validators,
3683
+ jaHaniLegalCompanyName: resolveFieldMetadata(localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.config, {}, localizedLegalCompanyNameFieldConfig.jaHaniLegalCompanyName.metadata).validators,
3684
+ jaKanaLegalCompanyName: resolveFieldMetadata(localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.config, {}, localizedLegalCompanyNameFieldConfig.jaKanaLegalCompanyName.metadata).validators
3685
+ };
3686
+ }
3687
+ function businessSelectionValidators() {
3688
+ return { selectedBusinessId: {
3689
+ modes: ["blur", "input"],
3690
+ validate: (val) => !isEmpty(val),
3691
+ errorMessage: "fieldIsRequired"
3692
+ } };
3693
+ }
3694
+ function prefixAddressValidators(prefix, rules) {
3695
+ const validators = {};
3696
+ for (const field in rules) validators[`${prefix}${capitalize(field)}`] = rules[field];
3697
+ return validators;
3698
+ }
3699
+ function additionalInformationValidators({ country, vatNumberType, isFeatureEnabled, t }) {
3700
+ const addressRules = addressValidators({
3701
+ isFeatureEnabled,
3702
+ country,
3703
+ t
3704
+ });
3705
+ return {
3706
+ hasDoingBusinessAs: doingBusinessAsAbsentFieldMetadata.validators,
3707
+ doingBusinessAs: doingBusinessAsFieldMetadata.validators,
3708
+ legalEntityIdentifier: legalEntityIdentifierFieldMetadata.validators,
3709
+ vatNumber: resolveFieldMetadata(defaultFieldConfig$1[country], { vatNumberType }, defaultFieldMetadata$1).validators,
3710
+ vatAbsenceReason: vatAbsenceReasonMetadata.validators,
3711
+ eInvoicingCode: eInvoicingCodeFieldMetadata.validators,
3712
+ industryCodes: industryCodeFieldMetadata.validators,
3713
+ dateOfIncorporation: dateOfIncorporationFieldMetadata.validators,
3714
+ stockExchangeMIC: stockExchangeMICFieldMetadata.validators,
3715
+ stockISIN: stockISINFieldMetadata.validators,
3716
+ stockTickerSymbol: stockTickerSymbolFieldMetadata.validators,
3717
+ ...prefixAddressValidators("registrationAddress", addressRules),
3718
+ ...prefixAddressValidators("operationalAddress", addressRules)
3719
+ };
3720
+ }
3721
+ var preventPoBoxValidation = (cleanseAddress, formData) => ({ operationalAddressStreet: {
3722
+ modes: [],
3723
+ errorMessage: "addressPoBoxError",
3724
+ asyncValidate: async (street) => {
3725
+ const country = formData?.basicInformation?.country;
3726
+ if (!street || !country) return true;
3727
+ const text = formatAddressForCleanse({
3728
+ ...nestAddressSchema("operationalAddress", formData.additionalInformation),
3729
+ street
3730
+ });
3731
+ if (!text) return true;
3732
+ try {
3733
+ const { poBox } = await cleanseAddress({
3734
+ text,
3735
+ country
3736
+ });
3737
+ return !poBox;
3738
+ } catch (error) {
3739
+ logger.error("Error while checking if address is PO box", error);
3740
+ return true;
3741
+ }
3742
+ }
3743
+ } });
3744
+ //#endregion
3745
+ //#region src/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsDropin.tsx
3746
+ var CompanySearchStateContext = createContext$1({});
3747
+ function BusinessDetailsDropin({ taskType, country: propCountry, problems: propProblems, legalEntityResponse, efpBusinessLines, documents, associatedLegalArrangement, nestedLegalEntity, nestedLegalEntityDetails, onSubmit: onExternalSubmit, handleHomeClick }) {
3748
+ const { t, i18n } = useTranslation(["common", "business"]);
3749
+ const userEvents = useAnalyticsContext();
3750
+ const { isFeatureEnabled } = useToggleContext();
3751
+ const isBusinessDetailsModalEnabled = taskType === TaskTypes.BUSINESS_DETAILS;
3752
+ const { isSettingEnabled } = useSettingsContext();
3753
+ const { accountHolder } = useAccountHolder();
3754
+ const logger = createLogger();
3755
+ const { mutateAsync: clearCompanyData } = useClearCompanyData();
3756
+ /**
3757
+ * Analytics
3758
+ */
3759
+ useTaskLandedEvent(taskType);
3760
+ const isAssociationTaskType = taskType !== TaskTypes.BUSINESS_DETAILS;
3761
+ const legalEntityType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? "soleProprietorship" : "organization";
3762
+ /**
3763
+ * Business Details is used for updating root entities of type 'Organization'
3764
+ * and for both creating/updating associated arrangements of types 'Sole
3765
+ * Proprietorship' and 'Trust Member Company' so must determine the subject entity
3766
+ *
3767
+ * Sole Props are associated to legalEntityResponse (root legal entity)
3768
+ * Trust Member company are a nested association to associatedLegalArrangement
3769
+ */
3770
+ const subjectEntity = !isAssociationTaskType ? legalEntityResponse : taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? associatedLegalArrangement : nestedLegalEntity;
3771
+ const [country, setCountry] = useState$1(propCountry);
3772
+ const [problems, setProblems] = useState$1(propProblems ?? {});
3773
+ const [loadingStatus, setLoadingStatus] = useState$1("success");
3774
+ const [derivedProps, setDerivedProps] = useState$1();
3775
+ const [trustedFields, setTrustedFields] = useState$1(subjectEntity?.trustedFields ?? void 0);
3776
+ const [isAddingBusinessDetails, setIsAddingBusinessDetails] = useState$1(false);
3777
+ const [hasEnteredFormFlowBefore, setHasEnteredFormFlowBefore] = useState$1(false);
3778
+ const companySearchStateModel = useModel(() => new CompanySearchStateModel(userEvents));
3779
+ const tinMismatchModalOpen = useSignal(false);
3780
+ const legalArrangementModalOpen = useSignal(false);
3781
+ const registrationNumberMismatchModalOpen = useSignal(false);
3782
+ const defaultForms = useMemo$1(() => getForms(country), [country]);
3783
+ const { fieldConfigurations } = useScenarioConfiguration({
3784
+ legalEntityType,
3785
+ parseConfiguration: useCallback$1(({ scenarios }) => composePerScenarioFormConfigurations(scenarios, businessDetailsFieldsPerScenario), []),
3786
+ setLoadingStatus,
3787
+ country
3788
+ });
3789
+ const defaultData = useMemo$1(() => {
3790
+ const mapped = mapLegalEntityToBusinessDetailsSchema({
3791
+ legalEntity: !isAssociationTaskType ? legalEntityResponse : taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? associatedLegalArrangement ?? legalEntityResponse : nestedLegalEntity,
3792
+ parentEntity: taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? legalEntityResponse : void 0,
3793
+ taskType,
3794
+ isFeatureEnabled
3795
+ });
3796
+ const initialEfpBusinessLineData = isSettingEnabled("allowBusinessLines") && efpBusinessLines && efpBusinessLines.length > 0 ? { additionalInformation: {
3797
+ ...mapped.additionalInformation,
3798
+ industryCodes: [{
3799
+ id: efpBusinessLines[0].industryCode,
3800
+ name: `${efpBusinessLines[0].industryCode} - ${efpBusinessLines[0].industryCodeDescription}`
3801
+ }]
3802
+ } } : {};
3803
+ return {
3804
+ ...mapped,
3805
+ ...documents,
3806
+ ...initialEfpBusinessLineData
3807
+ };
3808
+ }, [
3809
+ isAssociationTaskType,
3810
+ legalEntityResponse,
3811
+ taskType,
3812
+ associatedLegalArrangement,
3813
+ nestedLegalEntity,
3814
+ isFeatureEnabled,
3815
+ isSettingEnabled,
3816
+ efpBusinessLines,
3817
+ documents
3818
+ ]);
3819
+ const buildFieldValidations = useCallback$1((data) => {
3820
+ const taxInfo = data?.basicInformation?.taxInformation;
3821
+ const taxIdType = taxInfo?.length ? taxInfo.find((taxId) => taxId.country === country)?.type : void 0;
3822
+ const regNumberType = data?.basicInformation?.registrationNumberType;
3823
+ const companyType = taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY ? "soleProprietorship" : data?.companyStructure?.entityType;
3824
+ return {
3825
+ basicInformation: basicInformationValidators({
3826
+ country,
3827
+ state: data?.basicInformation?.stateOrProvince,
3828
+ companyType,
3829
+ taxIdNumberType: taxIdType,
3830
+ registrationNumberType: regNumberType,
3831
+ isFeatureEnabled,
3832
+ t
3833
+ }),
3834
+ businessSelection: businessSelectionValidators(),
3835
+ companyStructure: CompanyStructureValidation,
3836
+ additionalInformation: additionalInformationValidators({
3837
+ country,
3838
+ taxIdNumberType: taxIdType,
3839
+ companyType,
3840
+ registrationNumberType: regNumberType,
3841
+ vatNumberType: data?.additionalInformation?.vatNumberType,
3842
+ isFeatureEnabled,
3843
+ t
3844
+ }),
3845
+ companyFinancialInformation: financialInfoValidationWithEmployeesRules
3846
+ };
3847
+ }, [
3848
+ country,
3849
+ isFeatureEnabled,
3850
+ t,
3851
+ taskType
3852
+ ]);
3853
+ const cleanseAddress = useAddressCleanseImperatively();
3854
+ const buildAsyncFieldValidations = useCallback$1((data) => ({ additionalInformation: { operationalAddressStreet: preventPoBoxValidation(cleanseAddress, data).operationalAddressStreet } }), [cleanseAddress]);
3855
+ const multiForm = useMultiForm({
3856
+ defaultData,
3857
+ allFields: derivedProps?.allFields,
3858
+ requiredFields: derivedProps?.requiredFields,
3859
+ optionalFields: derivedProps?.optionalFields,
3860
+ obscuredFields: derivedProps?.obscuredFields,
3861
+ trustedFields: derivedProps?.trustedFields,
3862
+ rules: buildFieldValidations,
3863
+ asyncRules: buildAsyncFieldValidations
3864
+ });
3865
+ /**
3866
+ * Whilst this value _could_ be easily derived from existing values, it's intentionally distinct.
3867
+ * `tinMatched`, from the company search model, updates immediately from the API response but we only
3868
+ * want to insert the tax doc once the user actually navigates forward, hence, another state value set on nav.
3869
+ */
3870
+ const isTinMatched = useSignal(void 0);
3871
+ const customRules = useMemo$1(() => rules({
3872
+ data: multiForm.data,
3873
+ defaultData,
3874
+ verifiedBusiness: companySearchStateModel.verifiedBusiness.value,
3875
+ country,
3876
+ taskType,
3877
+ isFeatureEnabled,
3878
+ isSettingEnabled,
3879
+ accountHolder,
3880
+ tinMatched: isTinMatched.value,
3881
+ rootLegalEntity: legalEntityResponse
3882
+ }), [
3883
+ multiForm.data,
3884
+ defaultData,
3885
+ companySearchStateModel.verifiedBusiness.value,
3886
+ country,
3887
+ taskType,
3888
+ isFeatureEnabled,
3889
+ isSettingEnabled,
3890
+ accountHolder,
3891
+ isTinMatched.value,
3892
+ legalEntityResponse
3893
+ ]);
3894
+ useEffect$1(() => {
3895
+ const props = getPropsFromConfigurations({
3896
+ scenarioConfiguration: fieldConfigurations,
3897
+ forms: defaultForms,
3898
+ remediationActions: problems.remediationActions ? Object.values(problems.remediationActions) : [],
3899
+ dataMissingErrors: problems.missingData ?? [],
3900
+ fieldsWithExistingData: subjectEntity ? subjectEntity.type === "soleProprietorship" ? getFieldsWithExistingData(subjectEntity, solePropBusinessDetailsApiKeyMapping, solePropBusinessDetailsDocumentMapping) : getFieldsWithExistingData(subjectEntity, businessDetailsApiKeyMapping, businessDetailsDocumentMapping) : [],
3901
+ customRules,
3902
+ legalEntityType: subjectEntity?.type,
3903
+ legalEntityTrustedFields: trustedFields
3904
+ });
3905
+ setDerivedProps(props);
3906
+ }, [
3907
+ customRules,
3908
+ defaultForms,
3909
+ subjectEntity,
3910
+ problems.missingData,
3911
+ problems.remediationActions,
3912
+ trustedFields,
3913
+ fieldConfigurations
3914
+ ]);
3915
+ /**
3916
+ * Current country value must be kept in sync with what is selected in basicInformation form
3917
+ */
3918
+ const [prevCountry, setPrevCountry] = useState$1(multiForm.data.basicInformation?.country);
3919
+ if (multiForm.data.basicInformation?.country && prevCountry !== multiForm.data.basicInformation.country) {
3920
+ setCountry(multiForm.data.basicInformation.country);
3921
+ setPrevCountry(multiForm.data.basicInformation.country);
3922
+ setTrustedFields(void 0);
3923
+ companySearchStateModel.resetCompanySearchData();
3924
+ multiForm.handleChangeFor("companyStructure", "entityType")(void 0);
3925
+ }
3926
+ /**
3927
+ * The company structures that are still valid given the registration number type and tax ID
3928
+ * number type currently in the form.
3929
+ */
3930
+ const availableCompanyStructures = useMemo$1(() => getAvailableCompanyStructures({
3931
+ country,
3932
+ registrationNumberType: multiForm.data.basicInformation?.registrationNumberType,
3933
+ registrationNumberExempt: multiForm.data.basicInformation?.exemptedFromRegistrationNumber,
3934
+ taxIdNumberType: multiForm.data.basicInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type,
3935
+ legalEntity: legalEntityResponse,
3936
+ accountHolder,
3937
+ isSettingEnabled
3938
+ }), [
3939
+ accountHolder,
3940
+ country,
3941
+ isSettingEnabled,
3942
+ legalEntityResponse,
3943
+ multiForm.data.basicInformation?.exemptedFromRegistrationNumber,
3944
+ multiForm.data.basicInformation?.registrationNumberType,
3945
+ multiForm.data.basicInformation?.taxInformation
3946
+ ]);
3947
+ /**
3948
+ * Infer the company structure based on the registration number type and tax ID number type
3949
+ * This is used to automatically select the company structure when the user has already provided
3950
+ * the necessary information to uniquely identify the company structure
3951
+ */
3952
+ const inferredCompanyStructure = useMemo$1(() => {
3953
+ if (taskType !== "BUSINESS_DETAILS") return void 0;
3954
+ if (multiForm.data.companyStructure?.entityType && multiForm.data.companyStructure?.entityType === "associationIncorporated" || multiForm.data.companyStructure?.entityType === "partnershipIncorporated") return;
3955
+ return availableCompanyStructures.length === 1 ? availableCompanyStructures[0] : void 0;
3956
+ }, [
3957
+ availableCompanyStructures,
3958
+ multiForm.data.companyStructure?.entityType,
3959
+ taskType
3960
+ ]);
3961
+ const applyInferredCompanyStructure = () => {
3962
+ if (!inferredCompanyStructure) return;
3963
+ if (multiForm.data.companyStructure?.entityType === inferredCompanyStructure) return;
3964
+ multiForm.handleChangeFor("companyStructure", "entityType")(inferredCompanyStructure);
3965
+ };
3966
+ const getRequiredForms = useCallback$1((options) => {
3967
+ return buildRequiredForms({
3968
+ config: {
3969
+ forms: defaultForms,
3970
+ requiredFields: derivedProps?.requiredFields,
3971
+ optionalFields: derivedProps?.optionalFields,
3972
+ isValid: multiForm.isValid ?? {},
3973
+ problems,
3974
+ isSettingEnabled,
3975
+ accountHolder,
3976
+ legalEntityResponse
3977
+ },
3978
+ options: {
3979
+ skipCompanyStructure: !!inferredCompanyStructure,
3980
+ ...options
3981
+ }
3982
+ });
3983
+ }, [
3984
+ inferredCompanyStructure,
3985
+ accountHolder,
3986
+ defaultForms,
3987
+ derivedProps?.optionalFields,
3988
+ derivedProps?.requiredFields,
3989
+ isSettingEnabled,
3990
+ legalEntityResponse,
3991
+ multiForm.isValid,
3992
+ problems
3993
+ ]);
3994
+ const skipBusinessSelection = useSignal(true);
3995
+ const forms = useMemo$1(() => getRequiredForms({
3996
+ skipBusinessSelection: skipBusinessSelection.value,
3997
+ skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!inferredCompanyStructure
3998
+ }), [
3999
+ getRequiredForms,
4000
+ skipBusinessSelection.value,
4001
+ companySearchStateModel.verifiedBusiness.value,
4002
+ inferredCompanyStructure
4003
+ ]);
4004
+ const submit = useSubmitBusinessDetails({
4005
+ country,
4006
+ data: multiForm.data,
4007
+ forms,
4008
+ legalEntityResponse,
4009
+ associatedLegalArrangement,
4010
+ nestedLegalEntity,
4011
+ nestedLegalEntityDetails,
4012
+ efpBusinessLines,
4013
+ taskType,
4014
+ problems,
4015
+ setProblems,
4016
+ setLoadingStatus,
4017
+ onExternalSubmit
4018
+ });
4019
+ const { handleNextClick, handleBackClick, activeForm, shouldValidate, gotoFormByFormIndex, gotoFormByFormId, steps } = useFormComposer({
4020
+ problems,
4021
+ forms,
4022
+ onSubmit: useCallback$1(async () => {
4023
+ try {
4024
+ await submit();
4025
+ setIsAddingBusinessDetails(false);
4026
+ } catch (error) {
4027
+ logger.error(error);
4028
+ } finally {
4029
+ setHasEnteredFormFlowBefore(true);
4030
+ }
4031
+ }, [logger, submit]),
4032
+ triggerValidation: multiForm.triggerValidation
4033
+ });
4034
+ const tinMismatchConfirm = () => {
4035
+ setTrustedFields([]);
4036
+ tinMismatchModalOpen.value = false;
4037
+ /**
4038
+ * Only true when there are no search results.
4039
+ *
4040
+ * If the user is on 'Business Selection', we don't want to remove the page out from under them as
4041
+ * nav can get a bit weird when doing so. Instead, we'll only remove it from the flow if the user is
4042
+ * still on 'Basic Information', the only other place this modal is accessible from.
4043
+ */
4044
+ skipBusinessSelection.value = activeForm.formId !== "businessSelection";
4045
+ companySearchStateModel.confirmCompany(multiForm, country);
4046
+ if (country === CountryCodes.UnitedStates && companySearchStateModel.verificationMatched.value === false) isTinMatched.value = false;
4047
+ const currentForms = getRequiredForms({
4048
+ skipBusinessSelection: skipBusinessSelection.value,
4049
+ skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm
4050
+ });
4051
+ handleNextClick(currentForms);
4052
+ };
4053
+ usePrefetchCompanySearch({
4054
+ country,
4055
+ multiForm,
4056
+ activeFormId: activeForm.formId,
4057
+ isUsingCompanySearch: isUsingCompanySearch(country, taskType)
4058
+ });
4059
+ const { attemptBusinessSearch, confirmBusinessSelection } = useCompanySearchNextClickOverrides({
4060
+ country,
4061
+ multiForm,
4062
+ companySearchStateModel,
4063
+ getRequiredForms,
4064
+ skipBusinessSelection,
4065
+ setLoadingStatus,
4066
+ isTinMatched,
4067
+ tinMismatchModalOpen,
4068
+ legalArrangementModalOpen,
4069
+ registrationNumberMismatchModalOpen
4070
+ });
4071
+ const overrideNextClick = async () => {
4072
+ if (!activeForm.isValid) return handleNextClick();
4073
+ if (activeForm.formId === "basicInformation") applyInferredCompanyStructure();
4074
+ if (!isUsingCompanySearch(country, taskType)) return handleNextClick();
4075
+ switch (activeForm.formId) {
4076
+ case "basicInformation": {
4077
+ const currentForms = await attemptBusinessSearch();
4078
+ if (currentForms === null) return;
4079
+ return handleNextClick(currentForms);
4080
+ }
4081
+ case "businessSelection": {
4082
+ const currentForms = await confirmBusinessSelection();
4083
+ if (currentForms === null) return;
4084
+ return handleNextClick(currentForms);
4085
+ }
4086
+ default: return handleNextClick();
4087
+ }
4088
+ };
4089
+ const handleCancelClick = () => {
4090
+ setIsAddingBusinessDetails(false);
4091
+ setHasEnteredFormFlowBefore(true);
4092
+ };
4093
+ const handleEditForm = (formId) => {
4094
+ if (formId === "registrationAddress" || formId === "operationalAddress") {
4095
+ const addressFormIdx = forms.findIndex((form) => form.formId === "additionalInformation");
4096
+ if (addressFormIdx > -1) gotoFormByFormIndex(addressFormIdx);
4097
+ return;
4098
+ }
4099
+ const formIdx = forms.findIndex((form) => form.formId === formId);
4100
+ if (formIdx > -1) gotoFormByFormIndex(formIdx);
4101
+ };
4102
+ const allValidationErrors = {};
4103
+ for (const form in problems.validationErrors) for (const validationError in problems.validationErrors[form]) allValidationErrors[validationError] = problems.validationErrors[form][validationError];
4104
+ const allVerificationErrors = {};
4105
+ for (const form in problems.verificationErrors) for (const verificationError in problems.verificationErrors[form]) allVerificationErrors[verificationError] = problems.verificationErrors[form][verificationError];
4106
+ const shouldAutoOpenFormForErrors = (Object.keys(allValidationErrors).length > 0 || Object.keys(allVerificationErrors).length > 0) && !hasEnteredFormFlowBefore;
4107
+ const shouldRenderFormFlow = !isBusinessDetailsModalEnabled || isAddingBusinessDetails || shouldAutoOpenFormForErrors;
4108
+ const summarySections = useMemo$1(() => {
4109
+ if (activeForm.formId !== "summary") return [];
4110
+ return formatDataForSummary(multiForm.data, forms, t, i18n.language, isFeatureEnabled);
4111
+ }, [
4112
+ multiForm.data,
4113
+ forms,
4114
+ t,
4115
+ i18n.language,
4116
+ isFeatureEnabled,
4117
+ activeForm
4118
+ ]);
4119
+ const prevDefaultSummarySections = useRef$1([]);
4120
+ const defaultDataSummarySections = useMemo$1(() => {
4121
+ if (shouldRenderFormFlow) return prevDefaultSummarySections.current;
4122
+ const formattedData = formatDataForSummary(multiForm.defaultData ?? {}, forms, t, i18n.language, isFeatureEnabled);
4123
+ prevDefaultSummarySections.current = formattedData;
4124
+ return formattedData;
4125
+ }, [
4126
+ multiForm.defaultData,
4127
+ forms,
4128
+ t,
4129
+ i18n.language,
4130
+ isFeatureEnabled,
4131
+ shouldRenderFormFlow
4132
+ ]);
4133
+ const confirmDataSelection = async (resolvedData) => {
4134
+ const userProvided = resolvedData.registrationNumber !== companySearchStateModel.selectedCompany.value?.registrationNumber;
4135
+ userEvents.addPageEvent("Clicked button", {
4136
+ actionType: "select",
4137
+ label: "confirmCompanyConflictResolution",
4138
+ additionalData: { selection: userProvided ? "manual" : "recommended" }
4139
+ });
4140
+ /**
4141
+ * If the user is on 'Business Selection', we don't want to remove the page out from under them as
4142
+ * nav can get a bit weird when doing so. Instead, we'll only remove it from the flow if the user is
4143
+ * still on 'Basic Information', the only other place this modal is accessible from.
4144
+ */
4145
+ skipBusinessSelection.value = activeForm.formId !== "businessSelection";
4146
+ if (userProvided) {
4147
+ registrationNumberMismatchModalOpen.value = false;
4148
+ /**
4149
+ * The user keeps their own registration number, but the rest of the provider's data
4150
+ * (legal name, addresses, financial information) is still worth applying.
4151
+ *
4152
+ * The provider's company type can only be applied if it's compatible with the user's
4153
+ * registration number — a GB charity number, for example, cannot belong to a
4154
+ * `privateCompany`. When it isn't compatible we discard it and fall back to the company
4155
+ * types the registration number allows: exactly one means we can infer it, otherwise the
4156
+ * user picks it on the company structure step.
4157
+ */
4158
+ const providerCompanyType = companySearchStateModel.selectedCompany.value?.companyType;
4159
+ const resolvedCompanyType = !!providerCompanyType && availableCompanyStructures.includes(providerCompanyType) ? providerCompanyType : inferredCompanyStructure;
4160
+ companySearchStateModel.confirmCompany(multiForm, country, {
4161
+ preserveRegistrationNumber: true,
4162
+ companyTypeOverride: resolvedCompanyType
4163
+ });
4164
+ await clearCompanyData();
4165
+ const currentForms = getRequiredForms({
4166
+ skipBusinessSelection: skipBusinessSelection.peek(),
4167
+ skipCompanyStructure: !!resolvedCompanyType
4168
+ });
4169
+ handleNextClick(currentForms);
4170
+ } else {
4171
+ companySearchStateModel.confirmCompany(multiForm, country);
4172
+ registrationNumberMismatchModalOpen.value = false;
4173
+ const inferredRegistrationNumberType = resolvedData.registrationNumber ? inferCompanyRegistrationNumberType(resolvedData.registrationNumber, country, companySearchStateModel.verifiedBusiness.value?.companyType) : void 0;
4174
+ const currentForms = getRequiredForms({
4175
+ skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!inferredRegistrationNumberType,
4176
+ skipBusinessSelection: skipBusinessSelection.peek()
4177
+ });
4178
+ handleNextClick(currentForms);
4179
+ }
4180
+ };
4181
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [isBusinessDetailsModalEnabled && /* @__PURE__ */ jsx(BusinessDetailsGettingStarted, {
4182
+ openModal: () => {
4183
+ setIsAddingBusinessDetails(true);
4184
+ setHasEnteredFormFlowBefore(true);
4185
+ },
4186
+ handleCancelClick: () => handleHomeClick?.(),
4187
+ data: defaultDataSummarySections,
4188
+ t
4189
+ }), shouldRenderFormFlow && /* @__PURE__ */ jsx(FormContextProvider, {
4190
+ form: multiForm,
4191
+ children: /* @__PURE__ */ jsx(FormFlow, {
4192
+ summaryComponent: /* @__PURE__ */ jsxs(NewSummary, {
4193
+ sections: summarySections,
4194
+ handleEditForm,
4195
+ children: [/* @__PURE__ */ jsx(ErrorPanel, {
4196
+ validationErrors: allValidationErrors,
4197
+ verificationErrors: allVerificationErrors,
4198
+ formUtils: createFormUtils({ labels: {} }, t),
4199
+ id: "ariaErrorField",
4200
+ slot: "errorPanel"
4201
+ }), /* @__PURE__ */ jsx("div", {
4202
+ className: Summary_module_default.summaryContentLegalCaption,
4203
+ slot: "extraContent",
4204
+ children: t(($) => $["summaryLegalCaption"])
4205
+ })]
4206
+ }),
4207
+ asModal: isBusinessDetailsModalEnabled,
4208
+ currentStep: steps.current,
4209
+ totalSteps: steps.total,
4210
+ forms,
4211
+ activeForm,
4212
+ gotoFormByFormIndex,
4213
+ gotoFormByFormId,
4214
+ handleNextClick: overrideNextClick,
4215
+ handleBackClick,
4216
+ handleCancelClick: isBusinessDetailsModalEnabled ? handleCancelClick : handleHomeClick,
4217
+ loadingStatus,
4218
+ children: /* @__PURE__ */ jsxs(CompanySearchStateContext.Provider, {
4219
+ value: companySearchStateModel,
4220
+ children: [
4221
+ /* @__PURE__ */ jsx(BusinessDetails, {
4222
+ taskType,
4223
+ activeForm,
4224
+ country,
4225
+ shouldValidate,
4226
+ problems,
4227
+ isTopLevelEntity: taskType === TaskTypes.BUSINESS_DETAILS
4228
+ }),
4229
+ /* @__PURE__ */ jsx(Show, {
4230
+ when: tinMismatchModalOpen,
4231
+ children: /* @__PURE__ */ jsx(TinMismatchModal, {
4232
+ onCancel: () => tinMismatchModalOpen.value = false,
4233
+ onConfirm: tinMismatchConfirm
4234
+ })
4235
+ }),
4236
+ /* @__PURE__ */ jsx(Show, {
4237
+ when: legalArrangementModalOpen,
4238
+ children: /* @__PURE__ */ jsx(LegalArrangementModal, { onCancel: () => legalArrangementModalOpen.value = false })
4239
+ }),
4240
+ /* @__PURE__ */ jsx(Show, {
4241
+ when: registrationNumberMismatchModalOpen,
4242
+ children: /* @__PURE__ */ jsx(RegistrationNumberMismatchModal, {
4243
+ companySearchStateModel,
4244
+ registrationNumberMismatchModalOpen,
4245
+ confirmDataSelection
4246
+ })
4247
+ })
4248
+ ]
4249
+ })
4250
+ })
4251
+ })] });
4252
+ }
4253
+ var AdditionalInformation_module_default = {
4254
+ "additional-information-content": "_additional-information-content_1oltc_1",
4255
+ additionalInformationContent: "_additional-information-content_1oltc_1",
4256
+ "additional-information-section-heading": "_additional-information-section-heading_1oltc_7",
4257
+ additionalInformationSectionHeading: "_additional-information-section-heading_1oltc_7"
4258
+ };
4259
+ var VerifiedBusinessCard_module_default = {
4260
+ "verified-business-card": "_verified-business-card_wxp4s_1",
4261
+ verifiedBusinessCard: "_verified-business-card_wxp4s_1",
4262
+ "verified-business-card-content": "_verified-business-card-content_wxp4s_9",
4263
+ verifiedBusinessCardContent: "_verified-business-card-content_wxp4s_9",
4264
+ "verified-business-card-content-collapsed": "_verified-business-card-content-collapsed_wxp4s_20",
4265
+ verifiedBusinessCardContentCollapsed: "_verified-business-card-content-collapsed_wxp4s_20",
4266
+ "verified-business-card-content-expanded": "_verified-business-card-content-expanded_wxp4s_28",
4267
+ verifiedBusinessCardContentExpanded: "_verified-business-card-content-expanded_wxp4s_28",
4268
+ "verified-business-card-expand-button": "_verified-business-card-expand-button_wxp4s_32",
4269
+ verifiedBusinessCardExpandButton: "_verified-business-card-expand-button_wxp4s_32"
4270
+ };
4271
+ //#endregion
4272
+ //#region src/components/Business/forms/AdditionalInformation/VerifiedBusinessCard/VerifiedBusinessCard.tsx
4273
+ function VerifiedBusinessCard({ verifiedBusiness, verifiedAddress }) {
4274
+ const { t } = useTranslation(["common"]);
4275
+ const [expanded, setExpanded] = useState$1(false);
4276
+ const address = verifiedAddress?.street && verifiedAddress.city && verifiedAddress.stateOrProvince && verifiedAddress.postalCode ? `${verifiedAddress.street} ${verifiedAddress.city} ${verifiedAddress.stateOrProvince} ${verifiedAddress.postalCode}` : verifiedAddress?.street;
4277
+ const addressLink = `https://www.google.com/maps/place/${address?.replaceAll(" ", "+")}`;
4278
+ const baseItems = useMemo$1(() => [{
4279
+ term: t(($) => $["legalCompanyName"], { ns: "common" }),
4280
+ details: verifiedBusiness?.name
4281
+ }, {
4282
+ term: t(($) => $["registrationNumber"], { ns: "common" }),
4283
+ details: verifiedBusiness?.registrationNumber
4284
+ }].filter((item) => !!item.details), [
4285
+ verifiedBusiness?.name,
4286
+ verifiedBusiness?.registrationNumber,
4287
+ t
4288
+ ]);
4289
+ const expandedItems = useMemo$1(() => [{
4290
+ term: t(($) => $["legalForm"], { ns: "common" }),
4291
+ details: verifiedBusiness?.legalForm
4292
+ }, {
4293
+ term: t(($) => $["address"], { ns: "common" }),
4294
+ details: address && /* @__PURE__ */ jsxs(Fragment$1, { children: [
4295
+ address,
4296
+ /* @__PURE__ */ jsx("br", {}),
4297
+ /* @__PURE__ */ jsx(Link, {
4298
+ href: addressLink,
4299
+ external: true,
4300
+ children: t(($) => $["showOnMap"], { ns: "common" })
4301
+ })
4302
+ ] })
4303
+ }].filter((item) => !!item.details), [
4304
+ address,
4305
+ addressLink,
4306
+ t,
4307
+ verifiedBusiness?.legalForm
4308
+ ]);
4309
+ const expandedContentClasses = cx(VerifiedBusinessCard_module_default.verifiedBusinessCardContent, {
4310
+ [VerifiedBusinessCard_module_default.verifiedBusinessCardContentCollapsed]: !expanded,
4311
+ [VerifiedBusinessCard_module_default.verifiedBusinessCardContentExpanded]: expanded
4312
+ });
4313
+ return /* @__PURE__ */ jsxs("section", {
4314
+ className: VerifiedBusinessCard_module_default.verifiedBusinessCard,
4315
+ children: [
4316
+ /* @__PURE__ */ jsxs("div", {
4317
+ className: VerifiedBusinessCard_module_default.verifiedBusinessCardContent,
4318
+ children: [/* @__PURE__ */ jsx(StructuredList, { items: baseItems }), /* @__PURE__ */ jsx(Divider, {})]
4319
+ }),
4320
+ /* @__PURE__ */ jsxs("div", {
4321
+ className: expandedContentClasses,
4322
+ children: [/* @__PURE__ */ jsx(StructuredList, { items: expandedItems }), /* @__PURE__ */ jsx(Divider, {})]
4323
+ }),
4324
+ /* @__PURE__ */ jsx("div", {
4325
+ className: VerifiedBusinessCard_module_default.verifiedBusinessCardExpandButton,
4326
+ children: /* @__PURE__ */ jsx(Button, {
4327
+ variant: "link",
4328
+ onClick: () => setExpanded(!expanded),
4329
+ children: expanded ? t(($) => $["hideDetails"], { ns: "common" }) : t(($) => $["showDetails"], { ns: "common" })
4330
+ })
4331
+ })
4332
+ ]
4333
+ });
4334
+ }
4335
+ //#endregion
4336
+ //#region src/components/Business/forms/AdditionalInformation/AdditionalInformation.tsx
4337
+ var ADDITIONAL_INFORMATION_FIELDS = [
4338
+ ...DBA_NAME_FIELD,
4339
+ ...VAT_NUMBER_FIELD,
4340
+ ...LEGAL_ENTITY_IDENTIFIER_FIELD,
4341
+ ...INDUSTRY_CODE_FIELD,
4342
+ ...DATE_OF_INCORPORATION_FIELD,
4343
+ ...STOCK_EXCHANGE_MIC_FIELD,
4344
+ ...STOCK_ISIN_FIELD,
4345
+ ...STOCK_TICKER_SYMBOL_FIELD,
4346
+ ...EINVOICING_CODE_FIELD,
4347
+ "legalFormDescription",
4348
+ "residentialAddressIndicator",
4349
+ ...LEGAL_FORM_FIELDS,
4350
+ ...REGISTRATION_AND_OPERATIONAL_ADDRESS_FIELDS
4351
+ ];
4352
+ var EMPTY_OBJ = {};
4353
+ function AdditionalInformation({ id, country, companyType, shouldValidate, fieldValidationErrors = EMPTY_OBJ, formVerificationErrors = EMPTY_OBJ }) {
4354
+ const { t, i18n } = useTranslation(["common", "business"]);
4355
+ const { form } = useFormContext();
4356
+ const verifiedBusiness = useContext$1(CompanySearchStateContext).verifiedBusiness.value;
4357
+ const showVerified = !!verifiedBusiness;
4358
+ const showStockData = companyType === "listedPublicCompany";
4359
+ const { data: matchingScenario } = useScenarios(country, "organization");
4360
+ const businessLineTypes = [];
4361
+ if (matchingScenario?.includes("L_BANKING")) businessLineTypes.push("banking");
4362
+ if (matchingScenario?.includes("L_ISSUING")) businessLineTypes.push("issuing");
4363
+ const { data, defaultData, valid, errors, allFields, requiredFields, optionalFields, obscuredFields, trustedFields, handleChange: handleChangeFor } = getFormSlice(form, "additionalInformation");
4364
+ /**
4365
+ * Map the existing verified address data returned from the business data provider to our local address schema.
4366
+ * This must be done differently than the other verified data as the address
4367
+ * component maintains its own local form state.
4368
+ */
4369
+ const verifiedAddress = useMemo$1(() => {
4370
+ if (!verifiedBusiness) return void 0;
4371
+ if (defaultData?.registrationAddressStreet || defaultData?.operationalAddressStreet) return { override: { street: "" } };
4372
+ return {
4373
+ ...verifiedBusiness.registeredAddress && { registrationAddress: mapAddressData(verifiedBusiness.registeredAddress) },
4374
+ ...verifiedBusiness.principalPlaceOfBusinessAddress && { operationalAddress: mapAddressData(verifiedBusiness.principalPlaceOfBusinessAddress) }
4375
+ };
4376
+ }, [
4377
+ verifiedBusiness,
4378
+ defaultData?.registrationAddressStreet,
4379
+ defaultData?.operationalAddressStreet
4380
+ ]);
4381
+ const formUtils = useMemo$1(() => {
4382
+ const initialProps = {
4383
+ data: data ?? {},
4384
+ fieldValidationErrors,
4385
+ formVerificationErrors,
4386
+ allFields: allFields ?? [],
4387
+ requiredFields: requiredFields ?? [],
4388
+ optionalFields: optionalFields ?? [],
4389
+ trustedFields: trustedFields ?? [],
4390
+ obscuredFields: obscuredFields ?? [],
4391
+ errors: errors ?? {},
4392
+ valid: valid ?? {},
4393
+ handleFieldChange: handleChangeFor
4394
+ };
4395
+ const formUtilProps = initialProps.allFields?.reduce((acc, field) => {
4396
+ switch (field) {
4397
+ case "hasDoingBusinessAs": return mergeFieldMetadataIntoProps("hasDoingBusinessAs", doingBusinessAsAbsentFieldMetadata, acc);
4398
+ case "doingBusinessAs": return mergeFieldMetadataIntoProps("doingBusinessAs", doingBusinessAsFieldMetadata, acc);
4399
+ case "vatNumber": return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$1[country], { vatNumberType: data?.vatNumberType }, defaultFieldMetadata$1), acc);
4400
+ case "vatAbsenceReason": return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
4401
+ case "eInvoicingCode": return mergeFieldMetadataIntoProps("eInvoicingCode", eInvoicingCodeFieldMetadata, acc);
4402
+ case "industryCodes": return mergeFieldMetadataIntoProps("industryCodes", industryCodeFieldMetadata, acc);
4403
+ case "dateOfIncorporation": return mergeFieldMetadataIntoProps("dateOfIncorporation", dateOfIncorporationFieldMetadata, acc);
4404
+ case "stockExchangeMIC": return mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, acc);
4405
+ case "stockISIN": return mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, acc);
4406
+ case "stockTickerSymbol": return mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, acc);
4407
+ case "legalForm": return mergeFieldMetadataIntoProps("legalForm", legalFormFieldMetadata, acc);
4408
+ default: return acc;
4409
+ }
4410
+ }, initialProps);
4411
+ return createFormUtils(formUtilProps ?? initialProps, t);
4412
+ }, [
4413
+ country,
4414
+ allFields,
4415
+ data,
4416
+ errors,
4417
+ obscuredFields,
4418
+ optionalFields,
4419
+ requiredFields,
4420
+ trustedFields,
4421
+ valid,
4422
+ handleChangeFor,
4423
+ t,
4424
+ fieldValidationErrors,
4425
+ formVerificationErrors
4426
+ ]);
4427
+ const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
4428
+ const { data: industryCodes } = useIndustryCodes(businessLineTypes, i18n.language, { enabled: showField(INDUSTRY_CODE_FIELD) });
4429
+ return /* @__PURE__ */ jsxs("form", {
4430
+ id,
4431
+ children: [
4432
+ /* @__PURE__ */ jsx(Header, { title: t(($) => $["additionalInformationFormHeading"], { ns: "business" }) }),
4433
+ /* @__PURE__ */ jsx(ErrorPanel, {
4434
+ id: "ariaErrorField",
4435
+ verificationErrors: formVerificationErrors,
4436
+ validationErrors: fieldValidationErrors,
4437
+ formUtils
4438
+ }),
4439
+ /* @__PURE__ */ jsxs("div", {
4440
+ className: AdditionalInformation_module_default.additionalInformationContent,
4441
+ children: [
4442
+ showVerified && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("div", {
4443
+ className: AdditionalInformation_module_default.additionalInformationSectionHeading,
4444
+ children: /* @__PURE__ */ jsx(Typography, {
4445
+ el: "h3",
4446
+ variant: "title",
4447
+ children: t(($) => $["verifiedInformation"], { ns: "business" })
4448
+ })
4449
+ }), /* @__PURE__ */ jsx(VerifiedBusinessCard, {
4450
+ verifiedBusiness,
4451
+ verifiedAddress: verifiedAddress?.override ?? verifiedAddress?.registrationAddress ?? verifiedAddress?.operationalAddress
4452
+ })] }),
4453
+ /* @__PURE__ */ jsxs("section", { children: [showVerified && /* @__PURE__ */ jsx("div", {
4454
+ className: AdditionalInformation_module_default.additionalInformationSectionHeading,
4455
+ children: /* @__PURE__ */ jsx(Typography, {
4456
+ el: "h3",
4457
+ variant: "title",
4458
+ children: t(($) => $["otherBusinessInformation"], { ns: "business" })
4459
+ })
4460
+ }), /* @__PURE__ */ jsxs("fieldset", { children: [
4461
+ showField(LEGAL_FORM_FIELDS) && /* @__PURE__ */ jsx(LegalFormField, {
4462
+ name: "legalForm",
4463
+ countryCode: country,
4464
+ data: { legalForm: formUtils.getFieldData(data ?? {}, LEGAL_FORM_FIELDS).legalForm },
4465
+ valid: formUtils.getFieldValid(valid ?? {}, LEGAL_FORM_FIELDS),
4466
+ errorMessage: formatValidationError(errors?.legalForm?.errorMessage, t),
4467
+ handleChangeFor,
4468
+ readonly: false,
4469
+ label: formUtils.getLabel("legalForm", "businessStructure")
4470
+ }),
4471
+ showField(DBA_NAME_FIELD) && /* @__PURE__ */ jsx(DBANameField, {
4472
+ data: formUtils.getFieldData(data ?? {}, DBA_NAME_FIELD),
4473
+ valid: formUtils.getFieldValid(valid ?? {}, DBA_NAME_FIELD),
4474
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, DBA_NAME_FIELD),
4475
+ readonly: formUtils.isReadOnly("doingBusinessAs"),
4476
+ handleChangeFor
4477
+ }),
4478
+ showField(VAT_NUMBER_FIELD) && /* @__PURE__ */ jsx(VatNumberField, {
4479
+ data: formUtils.getFieldData(data ?? {}, VAT_NUMBER_FIELD),
4480
+ valid: formUtils.getFieldValid(valid ?? {}, VAT_NUMBER_FIELD),
4481
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, VAT_NUMBER_FIELD),
4482
+ labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, { exemptedFromVat: "iDontHaveAVatNumber" }),
4483
+ mask: formUtils.getMask("vatNumber"),
4484
+ readonly: formUtils.isReadOnly("vatNumber"),
4485
+ handleChangeFor,
4486
+ country,
4487
+ canExempt: showField(["exemptedFromVat"]),
4488
+ shouldValidate
4489
+ }),
4490
+ showField(LEGAL_ENTITY_IDENTIFIER_FIELD) && /* @__PURE__ */ jsx(LegalEntityIdentifierField, {
4491
+ data: formUtils.getFieldData(data ?? {}, LEGAL_ENTITY_IDENTIFIER_FIELD),
4492
+ valid: formUtils.getFieldValid(valid ?? {}, LEGAL_ENTITY_IDENTIFIER_FIELD),
4493
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, LEGAL_ENTITY_IDENTIFIER_FIELD),
4494
+ handleChangeFor,
4495
+ shouldValidate
4496
+ }),
4497
+ formUtils.isRequiredField("eInvoicingCode", false) && /* @__PURE__ */ jsx(EInvoicingCodeField, {
4498
+ data: formUtils.getFieldData(data ?? {}, EINVOICING_CODE_FIELD),
4499
+ valid: formUtils.getFieldValid(valid ?? {}, EINVOICING_CODE_FIELD),
4500
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, EINVOICING_CODE_FIELD),
4501
+ labels: formUtils.getFieldLabels(EINVOICING_CODE_FIELD),
4502
+ mask: formUtils.getMask("eInvoicingCode"),
4503
+ readonly: formUtils.isReadOnly("eInvoicingCode"),
4504
+ handleChangeFor
4505
+ }),
4506
+ showField(INDUSTRY_CODE_FIELD) && /* @__PURE__ */ jsx(IndustryCodeField, {
4507
+ data: formUtils.getFieldData(data ?? {}, INDUSTRY_CODE_FIELD),
4508
+ valid: formUtils.getFieldValid(valid ?? {}, INDUSTRY_CODE_FIELD),
4509
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, INDUSTRY_CODE_FIELD),
4510
+ guidanceText: t(($) => $["primaryIndustryCodeGuidance"], { ns: "business" }),
4511
+ readonly: formUtils.isReadOnly("industryCodes"),
4512
+ handleChangeFor,
4513
+ businessLineTypes,
4514
+ single: true,
4515
+ industryCodes: industryCodes ?? []
4516
+ }),
4517
+ showField(DATE_OF_INCORPORATION_FIELD) && /* @__PURE__ */ jsx(DateOfIncorporationField, {
4518
+ data: formUtils.getFieldData(data ?? {}, DATE_OF_INCORPORATION_FIELD),
4519
+ valid: formUtils.getFieldValid(valid ?? {}, DATE_OF_INCORPORATION_FIELD),
4520
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, DATE_OF_INCORPORATION_FIELD),
4521
+ placeholder: t(($) => $["datePlaceholder"]),
4522
+ readonly: formUtils.isReadOnly("dateOfIncorporation"),
4523
+ handleChangeFor,
4524
+ country
4525
+ })
4526
+ ] })] }),
4527
+ showStockData && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("div", {
4528
+ className: AdditionalInformation_module_default.additionalInformationSectionHeading,
4529
+ children: /* @__PURE__ */ jsx(Typography, {
4530
+ el: "h3",
4531
+ variant: "title",
4532
+ children: t(($) => $["stockExchangeInformation"], { ns: "business" })
4533
+ })
4534
+ }), /* @__PURE__ */ jsxs("fieldset", { children: [
4535
+ showField(STOCK_EXCHANGE_MIC_FIELD) && /* @__PURE__ */ jsx(StockExchangeMICField, {
4536
+ data: formUtils.getFieldData(data ?? {}, STOCK_EXCHANGE_MIC_FIELD),
4537
+ valid: formUtils.getFieldValid(valid ?? {}, STOCK_EXCHANGE_MIC_FIELD),
4538
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, STOCK_EXCHANGE_MIC_FIELD),
4539
+ mask: formUtils.getMask("stockExchangeMIC"),
4540
+ readonly: formUtils.isReadOnly("stockExchangeMIC"),
4541
+ shouldValidate,
4542
+ handleChangeFor
4543
+ }),
4544
+ showField(STOCK_ISIN_FIELD) && /* @__PURE__ */ jsx(StockISINField, {
4545
+ data: formUtils.getFieldData(data ?? {}, STOCK_ISIN_FIELD),
4546
+ valid: formUtils.getFieldValid(valid ?? {}, STOCK_ISIN_FIELD),
4547
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, STOCK_ISIN_FIELD),
4548
+ mask: formUtils.getMask("stockISIN"),
4549
+ readonly: formUtils.isReadOnly("stockISIN"),
4550
+ shouldValidate,
4551
+ handleChangeFor
4552
+ }),
4553
+ showField(STOCK_TICKER_SYMBOL_FIELD) && /* @__PURE__ */ jsx(StockTickerSymbolField, {
4554
+ data: formUtils.getFieldData(data ?? {}, STOCK_TICKER_SYMBOL_FIELD),
4555
+ valid: formUtils.getFieldValid(valid ?? {}, STOCK_TICKER_SYMBOL_FIELD),
4556
+ errors: formUtils.getFieldErrors(errors ?? {}, fieldValidationErrors, STOCK_TICKER_SYMBOL_FIELD),
4557
+ mask: formUtils.getMask("stockTickerSymbol"),
4558
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
4559
+ shouldValidate,
4560
+ handleChangeFor
4561
+ })
4562
+ ] })] }),
4563
+ /* @__PURE__ */ jsx(RegistrationAndOperationalAddressFields, {
4564
+ country,
4565
+ readOnlyAddressFields: verifiedBusiness?.registeredAddress?.state && verifiedBusiness.registeredAddress.state === form.data.basicInformation?.stateOrProvince ? ["stateOrProvince"] : [],
4566
+ entityType: "business",
4567
+ data,
4568
+ valid,
4569
+ errors,
4570
+ requiredFields,
4571
+ optionalFields,
4572
+ trustedFields,
4573
+ fieldValidationErrors,
4574
+ handleChangeFor,
4575
+ formUtils
4576
+ })
4577
+ ]
4578
+ })
4579
+ ]
4580
+ });
4581
+ }
4582
+ //#endregion
4583
+ //#region src/components/Business/forms/BusinessDetails/forms.ts
4584
+ var getFinancialInformationFields = (country) => {
4585
+ return country === CountryCodes.UnitedKingdom ? financialInformationFields : financialInformationFieldsForEu;
4586
+ };
4587
+ var staticBusinessDetailsForms = {
4588
+ basicInformation: {
4589
+ formId: "basicInformation",
4590
+ formName: "basicInformationFormName",
4591
+ fields: BASIC_INFORMATION_FIELDS
4592
+ },
4593
+ businessSelection: {
4594
+ formId: "businessSelection",
4595
+ formName: "businessSelectionFormName",
4596
+ fields: BUSINESS_SELECTION_FIELDS
4597
+ },
4598
+ companyStructure: {
4599
+ formId: "companyStructure",
4600
+ formName: "companyStructureFormName",
4601
+ fields: COMPANY_STRUCTURE_FIELDS
4602
+ },
4603
+ additionalInformation: {
4604
+ formId: "additionalInformation",
4605
+ formName: "additionalInformationFormName",
4606
+ fields: ADDITIONAL_INFORMATION_FIELDS
4607
+ },
4608
+ companyRegistrationDocument: {
4609
+ formId: "companyRegistrationDocument",
4610
+ formName: "companyRegistrationDocumentFormName",
4611
+ fields: ["registrationDocument"]
4612
+ },
4613
+ companyTaxDocument: {
4614
+ formId: "companyTaxDocument",
4615
+ formName: "companyTaxDocumentFormName",
4616
+ fields: ["taxDocument"]
4617
+ },
4618
+ companyProofOfDirectorDocument: {
4619
+ formId: "companyProofOfDirectorDocument",
4620
+ formName: "proofOfDirectorFormName",
4621
+ fields: ["proofOfDirector"]
4622
+ },
4623
+ companyProofOfSignatoryDocument: {
4624
+ formId: "companyProofOfSignatoryDocument",
4625
+ formName: "proofOfSignatoryFormName",
4626
+ fields: ["proofOfSignatory"]
4627
+ },
4628
+ companyProofOfAddressDocument: {
4629
+ formId: "companyProofOfAddressDocument",
4630
+ formName: "proofOfAddressFormName",
4631
+ fields: ["proofOfAddress"]
4632
+ },
4633
+ companyProofOfOwnershipDocument: {
4634
+ formId: "companyProofOfOwnershipDocument",
4635
+ formName: "proofOfOwnershipFormName",
4636
+ fields: ["proofOfOwnership"]
4637
+ },
4638
+ companyConstitutionalDocument: {
4639
+ formId: "companyConstitutionalDocument",
4640
+ formName: "constitutionalDocumentFormName",
4641
+ fields: ["constitutionalDocument"]
4642
+ }
4643
+ };
4644
+ var getForms = (country) => ({
4645
+ basicInformation: staticBusinessDetailsForms.basicInformation,
4646
+ businessSelection: staticBusinessDetailsForms.businessSelection,
4647
+ companyStructure: staticBusinessDetailsForms.companyStructure,
4648
+ additionalInformation: staticBusinessDetailsForms.additionalInformation,
4649
+ companyRegistrationDocument: staticBusinessDetailsForms.companyRegistrationDocument,
4650
+ companyTaxDocument: staticBusinessDetailsForms.companyTaxDocument,
4651
+ companyProofOfDirectorDocument: staticBusinessDetailsForms.companyProofOfDirectorDocument,
4652
+ companyProofOfSignatoryDocument: staticBusinessDetailsForms.companyProofOfSignatoryDocument,
4653
+ companyProofOfAddressDocument: staticBusinessDetailsForms.companyProofOfAddressDocument,
4654
+ companyProofOfOwnershipDocument: staticBusinessDetailsForms.companyProofOfOwnershipDocument,
4655
+ companyFinancialInformation: {
4656
+ formId: "companyFinancialInformation",
4657
+ formName: "financialInformation",
4658
+ fields: getFinancialInformationFields(country)
4659
+ },
4660
+ companyConstitutionalDocument: staticBusinessDetailsForms.companyConstitutionalDocument
4661
+ });
4662
+ var documentFormsIds = [
4663
+ "companyRegistrationDocument",
4664
+ "companyTaxDocument",
4665
+ "companyProofOfDirectorDocument",
4666
+ "companyProofOfSignatoryDocument",
4667
+ "companyProofOfAddressDocument",
4668
+ "companyConstitutionalDocument",
4669
+ "companyProofOfOwnershipDocument"
4670
+ ];
4671
+ //#endregion
4672
+ //#region src/api/documents/useDocuments.ts
4673
+ var useDocuments = (documentDetails, entityId, options) => {
4674
+ const { rootLegalEntityId, baseUrl } = useApiContext();
4675
+ const documentUtils = documentApiUtils({
4676
+ baseUrl: baseUrl.value,
4677
+ rootLegalEntityId: rootLegalEntityId.value
4678
+ });
4679
+ return useQuery({
4680
+ queryKey: [
4681
+ "documents",
4682
+ documentDetails.map((details) => details.id).filter((id) => id !== void 0).sort((a, b) => a.localeCompare(b)).join(","),
4683
+ entityId
4684
+ ],
4685
+ queryFn: () => documentUtils.fetchDocuments(documentDetails, entityId),
4686
+ retry: 0,
4687
+ ...options
4688
+ });
4689
+ };
4690
+ //#endregion
4691
+ //#region src/components/Business/hooks/useBusinessDetailsData.ts
4692
+ var ALLOWED_SOF_SERVICES = ["issuing", "banking"];
4693
+ function useBusinessDetailsData(taskType, associatedLegalArrangement, nestedLegalEntity) {
4694
+ const { t } = useTranslation(["common"]);
4695
+ const { data: rootLe } = useLegalEntity(ROOT_LE);
4696
+ const { accountHolder } = useAccountHolder();
4697
+ const { showToast } = useToastContext();
4698
+ const { isSettingEnabled } = useSettingsContext();
4699
+ const { data: efpBusinessLines, isLoading: fetchingEfpBusinessLines } = useBusinessLines(ALLOWED_SOF_SERVICES, { enabled: isSettingEnabled("allowBusinessLines") });
4700
+ const isSoleProp = accountHolder === "mySoleProprietorName";
4701
+ const subjectEntity = !(taskType !== TaskTypes.BUSINESS_DETAILS) ? rootLe : isSoleProp ? associatedLegalArrangement : nestedLegalEntity;
4702
+ const { isLoading: fetchingDocuments, isError } = useDocuments(subjectEntity?.documentDetails || [], subjectEntity?.id || "", { enabled: subjectEntity?.documentDetails && subjectEntity.documentDetails.length > 0 });
4703
+ useEffect$1(() => {
4704
+ if (isError) showToast({
4705
+ label: t(($) => $["failedToFetchRelevantDocuments"], { ns: "common" }),
4706
+ variant: "error"
4707
+ });
4708
+ }, [
4709
+ isError,
4710
+ showToast,
4711
+ t
4712
+ ]);
4713
+ let mappedDocs;
4714
+ if (subjectEntity?.id) mappedDocs = mapApiDocumentToBusinessDetailsDocuments(subjectEntity.id);
4715
+ return rootLe && !fetchingEfpBusinessLines && !fetchingDocuments ? {
4716
+ data: {
4717
+ rootLe,
4718
+ efpBusinessLines,
4719
+ documents: mappedDocs
4720
+ },
4721
+ isLoading: false
4722
+ } : {
4723
+ data: {
4724
+ rootLe,
4725
+ efpBusinessLines,
4726
+ documents: mappedDocs
4727
+ },
4728
+ isLoading: true
4729
+ };
4730
+ }
4731
+ //#endregion
4732
+ export { getForms as n, BusinessDetailsDropin as r, useBusinessDetailsData as t };