@adyen/kyc-components 3.24.6 → 3.25.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 (136) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1625 -1015
  2. package/dist/es/arrow-left-BLTu7dpi.js +5 -0
  3. package/dist/es/{arrow-right-C4o8oS1C.js → arrow-right-BntH-Qlw.js} +2 -2
  4. package/dist/es/{bin-CGwewvcn.js → bin-Bj6qtSTy.js} +1 -1
  5. package/dist/es/check-ZYTuehgv.js +5 -0
  6. package/dist/es/checkmark-DxCwXAIK.js +5 -0
  7. package/dist/es/{checkmark-small-D_9HLctx.js → checkmark-small-BsdIbd2G.js} +1 -1
  8. package/dist/es/{chevron-down-C8-1xmDI.js → chevron-down-BIOZPblQ.js} +2 -2
  9. package/dist/es/chevron-left-B_GtBez_.js +11 -0
  10. package/dist/es/{chevron-right-BDZzxAre.js → chevron-right-DTyHLnb5.js} +2 -2
  11. package/dist/es/{chevron-up-BLtnROd5.js → chevron-up-0etcs99k.js} +1 -1
  12. package/dist/es/{company-2-JG34IScE.js → company-2-B3NuVpZ7.js} +1 -1
  13. package/dist/es/company-CYi9zTX1.js +5 -0
  14. package/dist/es/contract-Ca5T1p29.js +5 -0
  15. package/dist/es/controlling-person-BQledQz3.js +5 -0
  16. package/dist/es/{cross-D-SQig6J.js → cross-_WDtYXwH.js} +2 -2
  17. package/dist/es/decision-maker-IOjBp4Cn.js +5 -0
  18. package/dist/es/document-Daivbade.js +5 -0
  19. package/dist/es/document-blurred-gtj03M4x.js +28 -0
  20. package/dist/es/document-cut-off-D2vCeeIS.js +23 -0
  21. package/dist/es/document-expired-_4Syh1xW.js +29 -0
  22. package/dist/es/document-front-9Glzn7ZR.js +21 -0
  23. package/dist/es/{download-COfxdarq.js → download-6WUrs5fL.js} +2 -2
  24. package/dist/es/edit-vu4T5TEr.js +5 -0
  25. package/dist/es/field-error-Dc-vt_Ng.js +5 -0
  26. package/dist/es/id-blurred-A45CVnPk.js +50 -0
  27. package/dist/es/id-cut-off-DMoJYcGr.js +46 -0
  28. package/dist/es/id-front-CTIDY7Nu.js +43 -0
  29. package/dist/es/id-glare-DRN1UgPb.js +40 -0
  30. package/dist/es/id-verification-instant-JpZYE7gU.js +49 -0
  31. package/dist/es/id-verification-manual-CnkUMBXD.js +46 -0
  32. package/dist/es/image-C5KqhIDJ.js +8 -0
  33. package/dist/es/{info-circle-DkHN1ugA.js → info-circle-DvvWfz1E.js} +1 -1
  34. package/dist/es/light-bulb-B9fSxkAk.js +5 -0
  35. package/dist/es/{location-B1Til-7Q.js → location-6Th9xn5O.js} +1 -1
  36. package/dist/es/more-horiz-BW6d91R8.js +5 -0
  37. package/dist/es/new-document-Cpqmj9Kl.js +5 -0
  38. package/dist/es/onfido-logo-DWX1GbUz.js +9 -0
  39. package/dist/es/owners-DT55tjrZ.js +5 -0
  40. package/dist/es/passport-blurred-Cw3cn4-0.js +50 -0
  41. package/dist/es/passport-cut-off-B0WAEH9S.js +47 -0
  42. package/dist/es/passport-front-DOkc7OdE.js +43 -0
  43. package/dist/es/passport-glare-DZiLpHLG.js +41 -0
  44. package/dist/es/payout-W95Oslv1.js +5 -0
  45. package/dist/es/payout-verification-instant-D9r3JgYA.js +31 -0
  46. package/dist/es/payout-verification-manual-BVzHrwSY.js +32 -0
  47. package/dist/es/pci-5RzbfIJy.js +5 -0
  48. package/dist/es/plaid-logo-CldAG-6v.js +13 -0
  49. package/dist/es/{plus-DAnbeoyS.js → plus-DUFyqbPe.js} +1 -1
  50. package/dist/es/remove-CR7nAYBO.js +5 -0
  51. package/dist/es/{review-CeQeKHXH.js → review-C4CnZ2XP.js} +1 -1
  52. package/dist/es/save-DsoIf4Q0.js +5 -0
  53. package/dist/es/search-3G14C_IW.js +5 -0
  54. package/dist/es/{signatory-BVoLPYPu.js → signatory-BUpU_luQ.js} +1 -1
  55. package/dist/es/store-CNHDWfwi.js +5 -0
  56. package/dist/es/tink-logo-CPPNzyT1.js +5 -0
  57. package/dist/es/trust-PKlVgWsv.js +5 -0
  58. package/dist/es/trustly-logo-QZ7eqdLL.js +11 -0
  59. package/dist/es/upload-CA264b-V.js +8 -0
  60. package/dist/es/{user-D6swzlYs.js → user-Dt1-0v-v.js} +1 -1
  61. package/dist/es/{user-business-CwS5j1qX.js → user-business-BZ3Ko-Oi.js} +1 -1
  62. package/dist/es/{users-3-BdjQ9rEA.js → users-3-Dshq7JI-.js} +1 -1
  63. package/dist/es/warning-vQPFTjLC.js +5 -0
  64. package/dist/es/wrong-BFDOMiyi.js +5 -0
  65. package/dist/style.css +284 -152
  66. package/dist/types/components/AdditionalInformation/component/AdditionalInformationComponent.d.ts +1 -1
  67. package/dist/types/components/BasicInformation/component/BasicInformationComponent.d.ts +2 -2
  68. package/dist/types/components/BasicInformation/types.d.ts +1 -1
  69. package/dist/types/components/BusinessDetails/forms.d.ts +1 -1
  70. package/dist/types/components/Dropins/DropinLayout/DropinLayout.d.ts +1 -1
  71. package/dist/types/components/Dropins/DropinLayout/EmbeddedActionBar/EmbeddedActionBar.d.ts +7 -0
  72. package/dist/types/components/Dropins/DropinLayout/types.d.ts +3 -0
  73. package/dist/types/components/Dropins/FormWrapper/FormWrapper.d.ts +4 -1
  74. package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
  75. package/dist/types/components/Dropins/types.d.ts +1 -0
  76. package/dist/types/components/EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent.d.ts +4 -1
  77. package/dist/types/components/EmbeddedDropins/ManageIndividualComponent/ManageIndividualComponent.d.ts +6 -0
  78. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/ViewVerificationStatusComponent.d.ts +1 -2
  79. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/types.d.ts +1 -9
  80. package/dist/types/components/IdVerificationMethod/idVerificationMethodMetadata.d.ts +5 -4
  81. package/dist/types/components/Individual/types.d.ts +1 -0
  82. package/dist/types/components/LegalEntityStatus/LegalEntityStatus.d.ts +9 -0
  83. package/dist/types/components/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +4 -4
  84. package/dist/types/components/TrustRegistrationDetails/validate.d.ts +1 -0
  85. package/dist/types/components/index.d.ts +2 -0
  86. package/dist/types/components/internal/Address/validate.d.ts +2 -0
  87. package/dist/types/components/internal/Alert/types.d.ts +1 -1
  88. package/dist/types/components/internal/DocumentGuidance/types.d.ts +3 -1
  89. package/dist/types/components/internal/EmbeddedStatus/EmbeddedStatus.d.ts +16 -0
  90. package/dist/types/components/internal/EmbeddedStatus/statusToTag.d.ts +12 -0
  91. package/dist/types/components/internal/Icon/Icon.d.ts +4 -47
  92. package/dist/types/components/internal/LegalCompanyNameField/fieldConfig.d.ts +2 -0
  93. package/dist/types/components/internal/NewModal/Modal.d.ts +11 -0
  94. package/dist/types/components/internal/Skeleton/Skeleton.d.ts +8 -0
  95. package/dist/types/components/internal/Svg/Svg.d.ts +13 -0
  96. package/dist/types/components/internal/Svg/index.d.ts +1 -0
  97. package/dist/types/components/internal/Svg/svgs.d.ts +68 -0
  98. package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiContext.d.ts +0 -1
  99. package/dist/types/core/Context/CoreContext.d.ts +3 -1
  100. package/dist/types/core/Context/ExperimentContext/types.d.ts +1 -1
  101. package/dist/types/core/hooks/useFormComposer.d.ts +1 -0
  102. package/dist/types/core/hooks/usePolling.d.ts +9 -0
  103. package/dist/types/core/models/api/view-verification-status.d.ts +1 -1
  104. package/dist/types/core/models/file.d.ts +1 -0
  105. package/dist/types/core/models/sole-prop.d.ts +2 -4
  106. package/dist/types/utils/coerceError.d.ts +1 -0
  107. package/dist/types/utils/mapping/documentGuidanceMap.d.ts +1 -1
  108. package/dist/types/utils/regex/patternValidators.d.ts +1 -0
  109. package/dist/types/utils/validatorUtils.d.ts +3 -2
  110. package/package.json +1 -1
  111. package/dist/es/arrow-left-CCxYxfCP.js +0 -5
  112. package/dist/es/check-CeSLN4_9.js +0 -5
  113. package/dist/es/checkmark-DEh9MPYR.js +0 -5
  114. package/dist/es/chevron-left-DSyI3arz.js +0 -11
  115. package/dist/es/company-D5_F_6SW.js +0 -5
  116. package/dist/es/contract-C6wDy9zU.js +0 -5
  117. package/dist/es/controlling-person-C4KoSyi2.js +0 -5
  118. package/dist/es/decision-maker-Cef3-OzY.js +0 -5
  119. package/dist/es/document-Cg4kZHpA.js +0 -5
  120. package/dist/es/edit--fDhojib.js +0 -5
  121. package/dist/es/field-error-WElEN1mN.js +0 -5
  122. package/dist/es/light-bulb-DEUhbRWP.js +0 -5
  123. package/dist/es/more-horiz-BieZKfy3.js +0 -5
  124. package/dist/es/new-document-BEAJnXCG.js +0 -5
  125. package/dist/es/owners-D1pksb86.js +0 -5
  126. package/dist/es/payout-BFiI--HY.js +0 -5
  127. package/dist/es/pci-DMQLRoAn.js +0 -5
  128. package/dist/es/remove-CEmd9YX7.js +0 -5
  129. package/dist/es/save-vVXwP4OB.js +0 -5
  130. package/dist/es/search-hf3HRVbu.js +0 -5
  131. package/dist/es/store-D2z639xh.js +0 -5
  132. package/dist/es/trust-CpcaQaV7.js +0 -5
  133. package/dist/es/warning-99uFf1WU.js +0 -5
  134. package/dist/es/wrong-1wvh7nZe.js +0 -5
  135. package/dist/types/core/Services/agnostic/get-images.d.ts +0 -1
  136. package/dist/types/core/Services/agnostic/index.d.ts +0 -1
@@ -8,8 +8,8 @@ import debounce from "lodash-es/debounce";
8
8
  import isEmpty$1 from "lodash-es/isEmpty";
9
9
  import isISIN from "validator/es/lib/isISIN.js";
10
10
  import OpenBankingSDK from "@adyen/openbankingsdk";
11
- import noop$1 from "lodash-es/noop";
12
11
  import range from "lodash-es/range";
12
+ import noop$1 from "lodash-es/noop";
13
13
  import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
14
14
  import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
15
15
  import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
@@ -78,6 +78,7 @@ const defaultTrans = {
78
78
  invalidFormat: "Invalid format",
79
79
  formatIsCorrect: "Format is correct",
80
80
  checkForTypos: "Check for typos and try again",
81
+ fieldMustContainAtLeast: "%{fieldName} must contain at least %{minLength} characters",
81
82
  nameMustContainLetters: "Name must contain letters. Check for typos and try again.",
82
83
  fieldIsRequired: "Field is required",
83
84
  optional: "(optional)",
@@ -128,9 +129,11 @@ const defaultTrans = {
128
129
  invalidFormatBankStatementDescription: "Please ensure your input contains solely letters, digits, currency codes, and the specified special characters: -._,:;'*!@#%()+?¿/「」",
129
130
  residencyCountry: "Country/region of residence",
130
131
  basicInformation: "Basic information",
131
- dragYourFilesHereOr: "Drag your files here, or",
132
- browse: "Browse",
133
- supports: "Supports: %{fileTypes}. Size up to %{maxSize}. Maximum %{maxFiles} page.",
132
+ dropFileToUpload: "Drop file to upload",
133
+ browseFiles: "Browse files",
134
+ supportedFileTypes: "Supported file types: %{fileTypes}",
135
+ maxFileSize: "Max file size: %{maxSize}. Maximal 1 page.",
136
+ upToFiles: "Up to %{maxFiles} file(s).",
134
137
  complete: "Complete",
135
138
  summary: "Summary",
136
139
  summaryLegalCaption: "By submitting this summary you are confirming the following; I confirm (on behalf of the company that I am authorized to represent), that the information and supporting documentation provided during this KYC process is accurate and up-to-date, and therefore correctly represents the current state of affairs.",
@@ -544,6 +547,7 @@ const defaultTrans = {
544
547
  vatNumber: "VAT number",
545
548
  vatRegistrationNumber: "VAT registration number",
546
549
  regonKrsNumber: "REGON / KRS number",
550
+ rejected: "Rejected",
547
551
  identificationNumber: "Identification number",
548
552
  whichTypeOfRegistrationNumberDoYouHave: "Which type of registration number do you have?",
549
553
  whichTypeOfIdNumberDoYouHave: "Which type of identification number do you have?",
@@ -942,7 +946,7 @@ const defaultTrans = {
942
946
  legalCompanyName__helperText__AU: "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC).",
943
947
  legalCompanyName__helperText__NL: "Enter the name exactly as it is on your Chamber of Commerce registration.",
944
948
  legalCompanyName__helperText__US: "Enter the name exactly as it appears on your Secretary of State Registration.",
945
- legalCompanyName__helperText__US__business: "The legal name is used to identify a business with the government. This information came from a trusted data source and can not be edited.",
949
+ legalCompanyName__helperText__US__business: "The legal name is used to identify a business with the government; enter it exactly as it appears on your government or legal forms.",
946
950
  legalCompanyName__helperText__PR: "Enter the name exactly as it appears on your Department of State Registration.",
947
951
  legalCompanyName__helperText__SG: "Enter the name exactly as it is on your Accounting and Corporate Regulatory Authority (ACRA) BizFile.",
948
952
  legalCompanyName__helperText__HK: "Enter the name exactly as it is on your Hong Kong Companies Registry's Certificate of Incorporation.",
@@ -951,10 +955,10 @@ const defaultTrans = {
951
955
  dbaName: "Doing Business As (DBA) name",
952
956
  country: "Country/region",
953
957
  countryRegionOfEstablishment: "Country/region of establishment",
954
- country__US__business: "Where is your business located?",
958
+ country__US__business: "Where is your business registered?",
955
959
  businessName: "Business name",
956
960
  stateOrProvince: "State or province",
957
- stateOrProvince__US__business: "In which state is your business headquartered?",
961
+ stateOrProvince__US__business: "In which state is your business registered?",
958
962
  stateOrProvince__placeHolder: "Select a state or province",
959
963
  stateOrProvince__placeHolder__US: "Select one...",
960
964
  registrationNumber: "Registration number",
@@ -994,8 +998,6 @@ const defaultTrans = {
994
998
  companyTaxDocumentFormHeading: "Upload a tax document",
995
999
  companyTaxDocumentFormDescription: "We need an official document to verify your organization’s tax details.",
996
1000
  businessSelection__heading: "Select your business",
997
- businessSelection__searching: "We're searching for your business - this can take a few moments",
998
- businessSelection__verifying: "We're processing your business details",
999
1001
  businessSelection__footer: "Can't find your business?",
1000
1002
  businessSelection__footerButton: "Add details manually",
1001
1003
  businessSelection__invalidTin: "This company's TIN doesn't match yours",
@@ -1004,9 +1006,10 @@ const defaultTrans = {
1004
1006
  thisIsMyBusiness: "This is my business",
1005
1007
  basicInformationFormName: "Basic details",
1006
1008
  basicInformationFormHeading: "Basic details about your business",
1009
+ basicInformationFormDescription: "In the next steps, we'll collect and verify details about your business in compliance with financial regulations. Learn about how your data is managed in our",
1010
+ basicInformationFormDescriptionLink: "Privacy Statement.",
1007
1011
  additionalInformationFormName: "Additional details",
1008
1012
  additionalInformationFormHeading: "Additional business details",
1009
- additionalInformationFormDescription: "To continue, we need to know a little bit more about your business and it's operations. ",
1010
1013
  showDetails: "Show details",
1011
1014
  hideDetails: "Hide details",
1012
1015
  showOnMap: "Show on map",
@@ -1890,12 +1893,13 @@ const getFormattingRegEx = (specChars, flags = "g") => new RegExp(`[${specChars}
1890
1893
  const trimValWithOneSpace = (val) => val.trimStart().replace(/\s+/g, " ");
1891
1894
  const EMOJI_REGEX = new RegExp("(\\p{Emoji}\\uFE0F|\\p{Emoji_Presentation}|\\p{Extended_Pictographic})", "gu");
1892
1895
  const NO_ALPHABET_REGEX = /^[^a-zA-Z]*$/;
1893
- const ALLOWED_CHARS_REGEX = /^[\w\s\-—./']*$/;
1896
+ const INDIVIDUAL_VALID_CHAR_REGEX = /^[\w\s\-—./']*$/;
1897
+ const OTHER_ENTITIES_VALID_CHAR_REGEX = /^[\w\s,.;:\-—&!?@()"'/\\+]+$/;
1894
1898
  const matchesRegex = (regex, input) => isString(input) && regex.test(input ?? "");
1895
1899
  const hasRepeatedCharacters = (input) => !isEmpty(input) && new Set(input).size === 1;
1896
- const isValidInputLength = (input) => !isEmpty(input) && input.length > 1;
1900
+ const isValidMinLength = (input, minLength = 1) => !isEmpty(input) && input.length >= minLength;
1897
1901
  const isInvalidName = (input) => {
1898
- const invalidNames = /* @__PURE__ */ new Set(["ABCD", "ABCDE", "ABCDEF", "ABCDEFG", "My Customer", "An other", "not applicable", "not app", "null"]);
1902
+ const invalidNames = /* @__PURE__ */ new Set(["John Doe", "Jane Doe", "ABCD", "ABCDE", "ABCDEF", "ABCDEFG", "My Customer", "An other", "n/a", "not applicable", "n/A", "N/A", "N/a", "N\\ /A", "not app", "null"]);
1899
1903
  return invalidNames.has(input || "");
1900
1904
  };
1901
1905
  let suppressed = false;
@@ -1917,71 +1921,111 @@ const createLogger = (namespace) => {
1917
1921
  });
1918
1922
  return methods;
1919
1923
  };
1920
- const icons = {
1921
- "arrow-left": lazy(() => import("./arrow-left-CCxYxfCP.js")),
1922
- "arrow-right": lazy(() => import("./arrow-right-C4o8oS1C.js")),
1923
- bin: lazy(() => import("./bin-CGwewvcn.js")),
1924
- check: lazy(() => import("./check-CeSLN4_9.js")),
1925
- checkmark: lazy(() => import("./checkmark-DEh9MPYR.js")),
1926
- "checkmark-small": lazy(() => import("./checkmark-small-D_9HLctx.js")),
1927
- "chevron-down": lazy(() => import("./chevron-down-C8-1xmDI.js")),
1928
- "chevron-right": lazy(() => import("./chevron-right-BDZzxAre.js")),
1929
- "chevron-left": lazy(() => import("./chevron-left-DSyI3arz.js")),
1930
- "chevron-up": lazy(() => import("./chevron-up-BLtnROd5.js")),
1931
- company: lazy(() => import("./company-D5_F_6SW.js")),
1932
- "company-2": lazy(() => import("./company-2-JG34IScE.js")),
1933
- contract: lazy(() => import("./contract-C6wDy9zU.js")),
1934
- "controlling-person": lazy(() => import("./controlling-person-C4KoSyi2.js")),
1935
- cross: lazy(() => import("./cross-D-SQig6J.js")),
1936
- "decision-maker": lazy(() => import("./decision-maker-Cef3-OzY.js")),
1937
- document: lazy(() => import("./document-Cg4kZHpA.js")),
1938
- download: lazy(() => import("./download-COfxdarq.js")),
1939
- edit: lazy(() => import("./edit--fDhojib.js")),
1940
- "field-error": lazy(() => import("./field-error-WElEN1mN.js")),
1941
- "info-circle": lazy(() => import("./info-circle-DkHN1ugA.js")),
1942
- "light-bulb": lazy(() => import("./light-bulb-DEUhbRWP.js")),
1943
- location: lazy(() => import("./location-B1Til-7Q.js")),
1944
- "more-horiz": lazy(() => import("./more-horiz-BieZKfy3.js")),
1945
- "new-document": lazy(() => import("./new-document-BEAJnXCG.js")),
1946
- owners: lazy(() => import("./owners-D1pksb86.js")),
1947
- payout: lazy(() => import("./payout-BFiI--HY.js")),
1948
- pci: lazy(() => import("./pci-DMQLRoAn.js")),
1949
- plus: lazy(() => import("./plus-DAnbeoyS.js")),
1950
- remove: lazy(() => import("./remove-CEmd9YX7.js")),
1951
- review: lazy(() => import("./review-CeQeKHXH.js")),
1952
- save: lazy(() => import("./save-vVXwP4OB.js")),
1953
- search: lazy(() => import("./search-hf3HRVbu.js")),
1954
- signatory: lazy(() => import("./signatory-BVoLPYPu.js")),
1955
- store: lazy(() => import("./store-D2z639xh.js")),
1956
- trust: lazy(() => import("./trust-CpcaQaV7.js")),
1957
- user: lazy(() => import("./user-D6swzlYs.js")),
1958
- "user-business": lazy(() => import("./user-business-CwS5j1qX.js")),
1959
- "users-3": lazy(() => import("./users-3-BdjQ9rEA.js")),
1960
- warning: lazy(() => import("./warning-99uFf1WU.js")),
1961
- wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
1962
- };
1963
- const logger$G = createLogger("Icon");
1964
- const Icon = ({
1924
+ const svgs = {
1925
+ // icons
1926
+ "arrow-left": lazy(() => import("./arrow-left-BLTu7dpi.js")),
1927
+ "arrow-right": lazy(() => import("./arrow-right-BntH-Qlw.js")),
1928
+ bin: lazy(() => import("./bin-Bj6qtSTy.js")),
1929
+ check: lazy(() => import("./check-ZYTuehgv.js")),
1930
+ checkmark: lazy(() => import("./checkmark-DxCwXAIK.js")),
1931
+ "checkmark-small": lazy(() => import("./checkmark-small-BsdIbd2G.js")),
1932
+ "chevron-down": lazy(() => import("./chevron-down-BIOZPblQ.js")),
1933
+ "chevron-right": lazy(() => import("./chevron-right-DTyHLnb5.js")),
1934
+ "chevron-left": lazy(() => import("./chevron-left-B_GtBez_.js")),
1935
+ "chevron-up": lazy(() => import("./chevron-up-0etcs99k.js")),
1936
+ company: lazy(() => import("./company-CYi9zTX1.js")),
1937
+ "company-2": lazy(() => import("./company-2-B3NuVpZ7.js")),
1938
+ contract: lazy(() => import("./contract-Ca5T1p29.js")),
1939
+ "controlling-person": lazy(() => import("./controlling-person-BQledQz3.js")),
1940
+ cross: lazy(() => import("./cross-_WDtYXwH.js")),
1941
+ "decision-maker": lazy(() => import("./decision-maker-IOjBp4Cn.js")),
1942
+ document: lazy(() => import("./document-Daivbade.js")),
1943
+ download: lazy(() => import("./download-6WUrs5fL.js")),
1944
+ edit: lazy(() => import("./edit-vu4T5TEr.js")),
1945
+ "field-error": lazy(() => import("./field-error-Dc-vt_Ng.js")),
1946
+ "info-circle": lazy(() => import("./info-circle-DvvWfz1E.js")),
1947
+ image: lazy(() => import("./image-C5KqhIDJ.js")),
1948
+ "light-bulb": lazy(() => import("./light-bulb-B9fSxkAk.js")),
1949
+ location: lazy(() => import("./location-6Th9xn5O.js")),
1950
+ "more-horiz": lazy(() => import("./more-horiz-BW6d91R8.js")),
1951
+ "new-document": lazy(() => import("./new-document-Cpqmj9Kl.js")),
1952
+ owners: lazy(() => import("./owners-DT55tjrZ.js")),
1953
+ payout: lazy(() => import("./payout-W95Oslv1.js")),
1954
+ pci: lazy(() => import("./pci-5RzbfIJy.js")),
1955
+ plus: lazy(() => import("./plus-DUFyqbPe.js")),
1956
+ remove: lazy(() => import("./remove-CR7nAYBO.js")),
1957
+ review: lazy(() => import("./review-C4CnZ2XP.js")),
1958
+ save: lazy(() => import("./save-DsoIf4Q0.js")),
1959
+ search: lazy(() => import("./search-3G14C_IW.js")),
1960
+ signatory: lazy(() => import("./signatory-BUpU_luQ.js")),
1961
+ store: lazy(() => import("./store-CNHDWfwi.js")),
1962
+ trust: lazy(() => import("./trust-PKlVgWsv.js")),
1963
+ user: lazy(() => import("./user-Dt1-0v-v.js")),
1964
+ upload: lazy(() => import("./upload-CA264b-V.js")),
1965
+ "user-business": lazy(() => import("./user-business-BZ3Ko-Oi.js")),
1966
+ "users-3": lazy(() => import("./users-3-Dshq7JI-.js")),
1967
+ warning: lazy(() => import("./warning-vQPFTjLC.js")),
1968
+ wrong: lazy(() => import("./wrong-BFDOMiyi.js")),
1969
+ // images
1970
+ "document-blurred": lazy(() => import("./document-blurred-gtj03M4x.js")),
1971
+ "document-cutoff": lazy(() => import("./document-cut-off-D2vCeeIS.js")),
1972
+ "document-expired": lazy(() => import("./document-expired-_4Syh1xW.js")),
1973
+ "document-front": lazy(() => import("./document-front-9Glzn7ZR.js")),
1974
+ "id-blurred": lazy(() => import("./id-blurred-A45CVnPk.js")),
1975
+ "id-cutoff": lazy(() => import("./id-cut-off-DMoJYcGr.js")),
1976
+ "id-front": lazy(() => import("./id-front-CTIDY7Nu.js")),
1977
+ "id-glare": lazy(() => import("./id-glare-DRN1UgPb.js")),
1978
+ "passport-blurred": lazy(() => import("./passport-blurred-Cw3cn4-0.js")),
1979
+ "passport-cutoff": lazy(() => import("./passport-cut-off-B0WAEH9S.js")),
1980
+ "passport-front": lazy(() => import("./passport-front-DOkc7OdE.js")),
1981
+ "passport-glare": lazy(() => import("./passport-glare-DZiLpHLG.js")),
1982
+ "id-verification-instant": lazy(() => import("./id-verification-instant-JpZYE7gU.js")),
1983
+ "id-verification-manual": lazy(() => import("./id-verification-manual-CnkUMBXD.js")),
1984
+ "payout-verification-instant": lazy(() => import("./payout-verification-instant-D9r3JgYA.js")),
1985
+ "payout-verification-manual": lazy(() => import("./payout-verification-manual-BVzHrwSY.js")),
1986
+ "singpass-verification-instant": lazy(() => Promise.resolve().then(() => singpassVerificationInstant)),
1987
+ "singpass-verification-manual": lazy(() => Promise.resolve().then(() => singpassVerificationManual)),
1988
+ // id verification
1989
+ "onfido-logo": lazy(() => import("./onfido-logo-DWX1GbUz.js")),
1990
+ "tink-logo": lazy(() => import("./tink-logo-CPPNzyT1.js")),
1991
+ "singpass-logo": lazy(() => Promise.resolve().then(() => singpassLogo)),
1992
+ // payout verification
1993
+ "plaid-logo": lazy(() => import("./plaid-logo-CldAG-6v.js")),
1994
+ "trustly-logo": lazy(() => import("./trustly-logo-QZ7eqdLL.js"))
1995
+ };
1996
+ const logger$H = createLogger("Icon");
1997
+ const Svg = ({
1965
1998
  className,
1966
1999
  name,
1967
- testId
2000
+ testId,
2001
+ alt,
2002
+ type
1968
2003
  }) => {
1969
- const LazyLoadedIcon = icons[name];
1970
- if (!LazyLoadedIcon) {
1971
- logger$G.error(`No such icon: "${name}"`);
2004
+ const LazyLoadedSvg = svgs[name];
2005
+ if (!LazyLoadedSvg) {
2006
+ logger$H.error(`No such svg: "${name}"`);
1972
2007
  return null;
1973
2008
  }
1974
2009
  return jsx("span", {
1975
- className: cx("adyen-kyc-icon", `adyen-kyc-icon-${name}`, className),
1976
- role: "img",
1977
- "aria-hidden": true,
2010
+ className: cx(`adyen-kyc-${type} adyen-kyc-${type}-${name}`, className),
1978
2011
  "data-testid": testId,
1979
2012
  children: jsx(Suspense, {
1980
2013
  fallback: null,
1981
- children: jsx(LazyLoadedIcon, {})
2014
+ children: jsx(LazyLoadedSvg, {
2015
+ alt,
2016
+ "aria-hidden": type === "icon"
2017
+ })
1982
2018
  })
1983
2019
  });
1984
2020
  };
2021
+ const Icon = ({
2022
+ name,
2023
+ ...props
2024
+ }) => jsx(Svg, {
2025
+ type: "icon",
2026
+ name,
2027
+ ...props
2028
+ });
1985
2029
  const Loader = ({
1986
2030
  inline = false,
1987
2031
  size = "large",
@@ -2074,7 +2118,7 @@ const Button = ({
2074
2118
  const Divider = () => jsx("hr", {
2075
2119
  className: "adyen-kyc-divider"
2076
2120
  });
2077
- const ChevronDownIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2015%2015'%3e%3cdefs%3e%3cpath%20fill='currentColor'%20id='chevron-down_svg__a'%20d='M2%205a1%201%200%200%201%201.74-.67L7.5%208.51l3.76-4.18a1%201%200%200%201%201.48%201.34l-4.5%205a1%201%200%200%201-1.48%200l-4.5-5A1%201%200%200%201%202%205'/%3e%3c/defs%3e%3cuse%20xlink:href='%23chevron-down_svg__a'%20fill-rule='evenodd'/%3e%3c/svg%3e";
2121
+ const ChevronDownIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2015%2015'%3e%3cdefs%3e%3cpath%20id='chevron-down_svg__a'%20fill='currentColor'%20d='M2%205a1%201%200%200%201%201.74-.67L7.5%208.51l3.76-4.18a1%201%200%200%201%201.48%201.34l-4.5%205a1%201%200%200%201-1.48%200l-4.5-5A1%201%200%200%201%202%205'/%3e%3c/defs%3e%3cuse%20xlink:href='%23chevron-down_svg__a'%20fill-rule='evenodd'/%3e%3c/svg%3e";
2078
2122
  const Accordion = ({
2079
2123
  title,
2080
2124
  children,
@@ -2160,6 +2204,28 @@ const Alert = ({
2160
2204
  })]
2161
2205
  });
2162
2206
  }
2207
+ if (type === "callToAction") {
2208
+ return jsxs("div", {
2209
+ className: cx("adyen-kyc-alert", className, `adyen-kyc-alert--${variant}`, {
2210
+ "adyen-kyc-alert--without-icon": !renderedIcon
2211
+ }),
2212
+ role: "alert",
2213
+ "data-testid": testId,
2214
+ children: [jsxs("div", {
2215
+ className: "adyen-kyc-alert__header",
2216
+ children: [renderedIcon, title && jsx("span", {
2217
+ className: "adyen-kyc-alert__title",
2218
+ children: title
2219
+ }), !!actions && jsx("div", {
2220
+ className: "adyen-kyc-alert__actions",
2221
+ children: actions
2222
+ })]
2223
+ }), !!children && jsx("div", {
2224
+ className: "adyen-kyc-alert__explanation",
2225
+ children
2226
+ })]
2227
+ });
2228
+ }
2163
2229
  return jsxs("div", {
2164
2230
  className: cx("adyen-kyc-alert", className, `adyen-kyc-alert--${variant}`, {
2165
2231
  "adyen-kyc-alert--without-icon": !renderedIcon
@@ -2224,7 +2290,7 @@ function useFormRouterContext() {
2224
2290
  }
2225
2291
  return context;
2226
2292
  }
2227
- const logger$F = createLogger("Link");
2293
+ const logger$G = createLogger("Link");
2228
2294
  const getIconClass = (icon, external) => {
2229
2295
  if (external) {
2230
2296
  return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
@@ -2236,7 +2302,7 @@ const getIconClass = (icon, external) => {
2236
2302
  };
2237
2303
  const isValidLink = (href) => {
2238
2304
  if (href === "#") {
2239
- logger$F.error('Links must include a valid href. If your href is "#", consider using a Button instead');
2305
+ logger$G.error('Links must include a valid href. If your href is "#", consider using a Button instead');
2240
2306
  return false;
2241
2307
  }
2242
2308
  return true;
@@ -2510,6 +2576,24 @@ function getFieldProps(props, innerFormFields) {
2510
2576
  }
2511
2577
  return null;
2512
2578
  }
2579
+ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
2580
+ ExperimentNames2["EnableCompanySearchFlow"] = "EnableCompanySearchFlow";
2581
+ ExperimentNames2["EnableNewBusinessDetailsFlow"] = "EnableNewBusinessDetailsFlow";
2582
+ ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
2583
+ ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
2584
+ ExperimentNames2["AllowMoreRolesForMainRootTrustee"] = "AllowMoreRolesForMainRootTrustee";
2585
+ ExperimentNames2["ShowUnsupportedEntityType"] = "ShowUnsupportedEntityType";
2586
+ ExperimentNames2["ShowSingPassButtonForCompanies"] = "ShowSingPassButtonForCompanies";
2587
+ ExperimentNames2["ShowSingPassButtonForIndividuals"] = "ShowSingPassButtonForIndividuals";
2588
+ ExperimentNames2["ShowExtraTaxExemptionReasons"] = "ShowExtraTaxExemptionReasons";
2589
+ ExperimentNames2["EnableCountryOfGoverningLawForUKCompanies"] = "EnableCountryOfGoverningLawForUKCompanies";
2590
+ ExperimentNames2["HidePayoutAccountTask"] = "HidePayoutAccountTask";
2591
+ ExperimentNames2["HidePciTask"] = "HidePciTask";
2592
+ ExperimentNames2["EnableAgeVerification"] = "EnableAgeVerification";
2593
+ ExperimentNames2["PreserveMismatchedInitialValues"] = "PreserveMismatchedInitialValues";
2594
+ ExperimentNames2["HOStrictNameAndAddressValidationV4"] = "HOStrictNameAndAddressValidationV4";
2595
+ return ExperimentNames2;
2596
+ })(ExperimentNames || {});
2513
2597
  const ON_CHANGE_DEBOUNCE_DURATION = 200;
2514
2598
  const KEYBOARD_KEYS = {
2515
2599
  arrowDown: "ArrowDown",
@@ -2568,7 +2652,7 @@ const useSetting = (settingName) => {
2568
2652
  } = context;
2569
2653
  return getSetting(settingName);
2570
2654
  };
2571
- const logger$E = createLogger("useAllowedCountries");
2655
+ const logger$F = createLogger("useAllowedCountries");
2572
2656
  const useAllowedCountries = () => {
2573
2657
  const acceptedCountries = useSetting("acceptedCountries");
2574
2658
  const {
@@ -2577,7 +2661,7 @@ const useAllowedCountries = () => {
2577
2661
  const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
2578
2662
  useEffect(() => {
2579
2663
  if (acceptedCountries !== void 0) return;
2580
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$E.error);
2664
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$F.error);
2581
2665
  }, [acceptedCountries]);
2582
2666
  return allowedCountries;
2583
2667
  };
@@ -2936,7 +3020,7 @@ function reducer({
2936
3020
  }
2937
3021
  };
2938
3022
  }
2939
- const logger$D = createLogger("useAsyncValidator");
3023
+ const logger$E = createLogger("useAsyncValidator");
2940
3024
  const useAsyncValidator = (asyncRules) => {
2941
3025
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
2942
3026
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -2957,7 +3041,7 @@ const useAsyncValidator = (asyncRules) => {
2957
3041
  hasError: !isValid
2958
3042
  }])
2959
3043
  });
2960
- }).catch(logger$D.error);
3044
+ }).catch(logger$E.error);
2961
3045
  }, [asyncRules, clearAsyncValidationResults]);
2962
3046
  return {
2963
3047
  asyncValidationResults,
@@ -3402,7 +3486,7 @@ const Tag = ({
3402
3486
  children
3403
3487
  });
3404
3488
  };
3405
- const styles$2 = {
3489
+ const styles$3 = {
3406
3490
  "adyen-kyc-dropdown": "adyen-kyc-dropdown",
3407
3491
  "adyen-kyc-dropdown-button": "adyen-kyc-dropdown-button",
3408
3492
  "adyen-kyc-dropdown-button--active": "adyen-kyc-dropdown-button--active",
@@ -3458,10 +3542,10 @@ function SelectButton({
3458
3542
  "aria-haspopup": "listbox",
3459
3543
  className: cx({
3460
3544
  "adyen-kyc-dropdown-button": true,
3461
- [styles$2["adyen-kyc-dropdown-button"]]: true,
3545
+ [styles$3["adyen-kyc-dropdown-button"]]: true,
3462
3546
  "adyen-kyc-dropdown-button--readonly": readonly,
3463
3547
  "adyen-kyc-dropdown-button--active": showList,
3464
- [styles$2["adyen-kyc-dropdown-button--active"]]: showList,
3548
+ [styles$3["adyen-kyc-dropdown-button--active"]]: showList,
3465
3549
  "adyen-kyc-dropdown-button--invalid": isInvalid,
3466
3550
  "adyen-kyc-dropdown-field--valid": isValid,
3467
3551
  "adyen-kyc-dropdown-button-search": isSearch
@@ -3531,7 +3615,7 @@ const SelectButtonContentSingle = ({
3531
3615
  "aria-expanded": showList,
3532
3616
  "aria-owns": selectListId,
3533
3617
  autoComplete: "off",
3534
- className: cx("adyen-kyc-filter-input", [styles$2["adyen-kyc-filter-input"]]),
3618
+ className: cx("adyen-kyc-filter-input", [styles$3["adyen-kyc-filter-input"]]),
3535
3619
  onInput,
3536
3620
  placeholder,
3537
3621
  ref: filterInputRef,
@@ -3619,7 +3703,7 @@ const SelectListItem = ({
3619
3703
  }) => jsx("li", {
3620
3704
  "aria-disabled": !!item.disabled,
3621
3705
  "aria-selected": selected,
3622
- className: cx(["adyen-kyc-dropdown-element", styles$2["adyen-kyc-dropdown-element"], {
3706
+ className: cx(["adyen-kyc-dropdown-element", styles$3["adyen-kyc-dropdown-element"], {
3623
3707
  "adyen-kyc-dropdown-element--active": selected,
3624
3708
  "adyen-kyc-dropdown-element--disabled": !!item.disabled,
3625
3709
  "adyen-kyc-dropdown-multi-element": isMulti,
@@ -3667,6 +3751,8 @@ const SelectListItem = ({
3667
3751
  })]
3668
3752
  })
3669
3753
  });
3754
+ const ITEM_HEIGHT = 35;
3755
+ const VISIBLE_ITEMS = 10;
3670
3756
  function SelectList({
3671
3757
  active,
3672
3758
  items,
@@ -3682,6 +3768,37 @@ function SelectList({
3682
3768
  const {
3683
3769
  i18n
3684
3770
  } = useI18nContext();
3771
+ const listRef = useRef(null);
3772
+ const [startIndex, setStartIndex] = useState(0);
3773
+ const [endIndex, setEndIndex] = useState(VISIBLE_ITEMS);
3774
+ const [listHeight, setListHeight] = useState(0);
3775
+ const filteredItems = items.filter((item) => {
3776
+ var _a;
3777
+ if (isSearch) {
3778
+ return item;
3779
+ }
3780
+ return !textFilter || ((_a = item.name) == null ? void 0 : _a.toLowerCase().includes(textFilter));
3781
+ });
3782
+ const totalItems = filteredItems.length;
3783
+ const visibleItems = filteredItems.slice(startIndex, endIndex);
3784
+ const handleScroll = useCallback(() => {
3785
+ if (listRef.current) {
3786
+ const {
3787
+ scrollTop
3788
+ } = listRef.current;
3789
+ const maxStartIndex = totalItems - VISIBLE_ITEMS;
3790
+ const newStartIndex = Math.min(Math.max(0, Math.floor(scrollTop / ITEM_HEIGHT)), maxStartIndex);
3791
+ const newEndIndex = Math.min(newStartIndex + VISIBLE_ITEMS, totalItems);
3792
+ setStartIndex(newStartIndex);
3793
+ setEndIndex(newEndIndex);
3794
+ }
3795
+ }, [totalItems]);
3796
+ useEffect(() => {
3797
+ if (listRef.current) {
3798
+ const newHeight = totalItems ? Math.min(totalItems, VISIBLE_ITEMS) * ITEM_HEIGHT : ITEM_HEIGHT;
3799
+ setListHeight(newHeight);
3800
+ }
3801
+ }, [totalItems]);
3685
3802
  const getItems = () => {
3686
3803
  if (loading) {
3687
3804
  return jsx("div", {
@@ -3689,46 +3806,58 @@ function SelectList({
3689
3806
  children: i18n.get("loading")
3690
3807
  });
3691
3808
  }
3809
+ if (!filteredItems.length) {
3810
+ return jsx("div", {
3811
+ className: "adyen-kyc-dropdown-element adyen-kyc-dropdown-element--no-options",
3812
+ children: i18n.get("noOptionsFound")
3813
+ });
3814
+ }
3692
3815
  if (isSearch && (!textFilter || textFilter.length < 3)) {
3693
3816
  return null;
3694
3817
  }
3695
- if (mappedFilteredItems.length) {
3696
- return mappedFilteredItems;
3818
+ if (visibleItems.length) {
3819
+ return visibleItems.map((item) => jsx(SelectListItem, {
3820
+ item,
3821
+ onKeyDown: (event) => props.onKeyDown(event, item),
3822
+ onSelect: () => props.onSelect(item),
3823
+ selected: !!active.find((activeItem) => activeItem.id === item.id),
3824
+ isMulti,
3825
+ isSearch,
3826
+ children: getSearchItem && getSearchItem(item)
3827
+ }, item.id));
3697
3828
  }
3698
- return jsx("div", {
3699
- className: "adyen-kyc-dropdown-element adyen-kyc-dropdown-element--no-options",
3700
- children: i18n.get("noOptionsFound")
3701
- });
3829
+ return null;
3702
3830
  };
3703
- const filteredItems = items.filter((item) => {
3704
- var _a;
3705
- if (isSearch) {
3706
- return item;
3707
- }
3708
- return !textFilter || ((_a = item.name) == null ? void 0 : _a.toLowerCase().includes(textFilter));
3709
- });
3710
- const mappedFilteredItems = filteredItems.map((item) => jsx(SelectListItem, {
3711
- item,
3712
- onKeyDown: (event) => props.onKeyDown(event, item),
3713
- onSelect: () => props.onSelect(item),
3714
- selected: !!active.find((activeItem) => activeItem.id === item.id),
3715
- isMulti,
3716
- isSearch,
3717
- children: getSearchItem && getSearchItem(item)
3718
- }, item.id));
3719
3831
  return jsx("ul", {
3720
3832
  className: cx({
3721
3833
  test: true,
3722
3834
  "adyen-kyc-dropdown-list--above": showAbove,
3723
3835
  "adyen-kyc-dropdown-list": true,
3724
- [styles$2["adyen-kyc-dropdown-list"]]: true,
3836
+ [styles$3["adyen-kyc-dropdown-list"]]: true,
3725
3837
  "adyen-kyc-dropdown-list--active": showList,
3726
- [styles$2["adyen-kyc-dropdown-list--active"]]: showList
3838
+ [styles$3["adyen-kyc-dropdown-list--active"]]: showList
3727
3839
  }),
3728
3840
  id: props.selectListId,
3729
- ref: props.selectListRef,
3841
+ ref: listRef,
3730
3842
  role: "listbox",
3731
- children: getItems()
3843
+ onScroll: handleScroll,
3844
+ style: {
3845
+ height: `${listHeight}px`,
3846
+ overflowY: totalItems > VISIBLE_ITEMS ? "auto" : "hidden",
3847
+ position: "relative"
3848
+ },
3849
+ children: jsx("div", {
3850
+ style: {
3851
+ height: `${totalItems * ITEM_HEIGHT}px`,
3852
+ position: "relative"
3853
+ },
3854
+ children: jsx("div", {
3855
+ style: {
3856
+ transform: `translateY(${startIndex * ITEM_HEIGHT}px)`
3857
+ },
3858
+ children: getItems()
3859
+ })
3860
+ })
3732
3861
  });
3733
3862
  }
3734
3863
  const SELECTLIST_MAX_HEIGHT = 145;
@@ -3914,7 +4043,7 @@ const Select = ({
3914
4043
  };
3915
4044
  }, []);
3916
4045
  return jsxs("div", {
3917
- className: cx(["adyen-kyc-dropdown", styles$2["adyen-kyc-dropdown"], className, ...classNameModifiers.map((m) => `adyen-kyc-dropdown--${m}`)]),
4046
+ className: cx(["adyen-kyc-dropdown", styles$3["adyen-kyc-dropdown"], className, ...classNameModifiers.map((m) => `adyen-kyc-dropdown--${m}`)]),
3918
4047
  ref: selectContainerRef,
3919
4048
  onClick: (e) => {
3920
4049
  e.stopPropagation();
@@ -3972,7 +4101,7 @@ function CountryField({
3972
4101
  handleChangeFor,
3973
4102
  helperText,
3974
4103
  allowedCountries,
3975
- classNameModifiers = []
4104
+ classNameModifiers = ["country"]
3976
4105
  }) {
3977
4106
  const {
3978
4107
  i18n
@@ -3988,6 +4117,7 @@ function CountryField({
3988
4117
  classNameModifiers,
3989
4118
  isValid: valid.country,
3990
4119
  helper: helperText == null ? void 0 : helperText.country,
4120
+ "data-testid": "country",
3991
4121
  children: (childProps) => jsx(Select, {
3992
4122
  ...childProps,
3993
4123
  name,
@@ -4498,6 +4628,19 @@ const validateNotEmptyOnBlur = {
4498
4628
  validate: (val) => !isEmpty(val),
4499
4629
  errorMessage: "fieldIsRequired"
4500
4630
  };
4631
+ const validateLegalCompanyName = [{
4632
+ modes: ["blur"],
4633
+ validate: hasText,
4634
+ errorMessage: "fieldIsRequired"
4635
+ }, {
4636
+ modes: ["blur"],
4637
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
4638
+ errorMessage: "nameMustContainLetters"
4639
+ }, {
4640
+ modes: ["blur"],
4641
+ validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidMinLength(input, 3) && !isInvalidName(input) && matchesRegex(OTHER_ENTITIES_VALID_CHAR_REGEX, input),
4642
+ errorMessage: "checkForTypos"
4643
+ }];
4501
4644
  const validatePatternOnBlur = (pattern) => ({
4502
4645
  modes: ["blur"],
4503
4646
  validate: (val) => !!val && pattern.test(val)
@@ -4536,6 +4679,40 @@ const defaultFieldConfig$a = {
4536
4679
  validators: validateNotEmptyOnBlur
4537
4680
  })
4538
4681
  };
4682
+ const defaultFieldMetadataV4 = {
4683
+ label: "legalCompanyName",
4684
+ helperText: "legalCompanyName__helperText",
4685
+ validators: validateLegalCompanyName
4686
+ };
4687
+ const defaultFieldConfigV4 = {
4688
+ [CountryCodes.Australia]: {
4689
+ label: "legalCompanyName",
4690
+ helperText: "legalCompanyName__helperText__AU",
4691
+ validators: validateLegalCompanyName
4692
+ },
4693
+ [CountryCodes.HongKong]: {
4694
+ label: "legalCompanyName",
4695
+ helperText: "legalCompanyName__helperText__HK",
4696
+ validators: validateLegalCompanyName
4697
+ },
4698
+ [CountryCodes.Netherlands]: {
4699
+ label: "legalCompanyName",
4700
+ helperText: "legalCompanyName__helperText__NL",
4701
+ validators: validateLegalCompanyName
4702
+ },
4703
+ [CountryCodes.Singapore]: {
4704
+ label: "legalCompanyName",
4705
+ helperText: "legalCompanyName__helperText__SG",
4706
+ validators: validateLegalCompanyName
4707
+ },
4708
+ [CountryCodes.UnitedStates]: ({
4709
+ isBusiness
4710
+ }) => ({
4711
+ label: "legalCompanyName__US",
4712
+ helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
4713
+ validators: validateLegalCompanyName
4714
+ })
4715
+ };
4539
4716
  const PatriotActDisclosure = () => {
4540
4717
  const {
4541
4718
  i18n
@@ -4562,11 +4739,19 @@ const companyCountryValidationRules = {
4562
4739
  validate: (companyCountry) => !isEmpty(companyCountry),
4563
4740
  errorMessage: "fieldIsRequired"
4564
4741
  },
4565
- legalCompanyName: {
4742
+ legalCompanyName: [{
4566
4743
  modes: ["blur"],
4567
- validate: (legalCompanyName) => !isEmpty(legalCompanyName),
4744
+ validate: hasText,
4568
4745
  errorMessage: "fieldIsRequired"
4569
- },
4746
+ }, {
4747
+ modes: ["blur"],
4748
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
4749
+ errorMessage: "nameMustContainLetters"
4750
+ }, {
4751
+ modes: ["blur"],
4752
+ validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidMinLength(input, 3) && !isInvalidName(input) && matchesRegex(OTHER_ENTITIES_VALID_CHAR_REGEX, input),
4753
+ errorMessage: "checkForTypos"
4754
+ }],
4570
4755
  countryOfGoverningLaw: {
4571
4756
  modes: ["blur"],
4572
4757
  validate: (countryOfGoverningLaw) => !isEmpty(countryOfGoverningLaw),
@@ -4586,14 +4771,17 @@ function CompanyNameAndCountry(props) {
4586
4771
  const {
4587
4772
  isExperimentEnabled
4588
4773
  } = useExperimentsContext();
4774
+ const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(ExperimentNames.HOStrictNameAndAddressValidationV4);
4589
4775
  const {
4590
4776
  sliceData,
4591
4777
  updateStateSlice
4592
4778
  } = useGlobalDataSlice(props.id);
4779
+ const LegalCompanyNameDefaultFieldConfig = isStrictNameAndAddressValidationEnabled ? defaultFieldConfigV4 : defaultFieldConfig$a;
4780
+ const LegalCompanyNameDefaultFieldMetadata = isStrictNameAndAddressValidationEnabled ? defaultFieldMetadataV4 : defaultFieldMetadata$a;
4593
4781
  let mergedProps = props;
4594
- mergedProps = mergeFieldMetadataIntoProps("legalCompanyName", resolveFieldMetadata(defaultFieldConfig$a[sliceData == null ? void 0 : sliceData.country], {
4782
+ mergedProps = mergeFieldMetadataIntoProps("legalCompanyName", resolveFieldMetadata(LegalCompanyNameDefaultFieldConfig[sliceData == null ? void 0 : sliceData.country], {
4595
4783
  isBusiness: false
4596
- }, defaultFieldMetadata$a), mergedProps);
4784
+ }, LegalCompanyNameDefaultFieldMetadata), mergedProps);
4597
4785
  const schemaWithGoverningLaw = (sliceData == null ? void 0 : sliceData.country) === "GB" && (sliceData == null ? void 0 : sliceData.differentCountryOfGoverningLaw) ? countryWithGoverningLawFields : companyNameAndCountryFields;
4598
4786
  const {
4599
4787
  data: formData,
@@ -5144,7 +5332,7 @@ const businessRegistrationNumberMasks = {
5144
5332
  },
5145
5333
  [CountryCodes.Spain]: {
5146
5334
  default: {
5147
- mask: makeMask(...alphaInputs(1), ...numericInputs(8)),
5335
+ mask: makeMask(...alphaInputs(1), ...alphanumericInputs(8)),
5148
5336
  transformOnType: uppercase
5149
5337
  }
5150
5338
  },
@@ -6834,7 +7022,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
6834
7022
  };
6835
7023
  };
6836
7024
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
6837
- const logger$C = createLogger("MaskedInputText");
7025
+ const logger$D = createLogger("MaskedInputText");
6838
7026
  const MaskedInputText = ({
6839
7027
  value,
6840
7028
  onInput,
@@ -6880,7 +7068,7 @@ const MaskedInputText = ({
6880
7068
  };
6881
7069
  useEffect(() => {
6882
7070
  if (!mask) {
6883
- logger$C.warn("`mask` is undefined. No masking of input will take place.");
7071
+ logger$D.warn("`mask` is undefined. No masking of input will take place.");
6884
7072
  }
6885
7073
  }, [mask]);
6886
7074
  const getMaskResult = useCallback((pureValue) => {
@@ -6905,13 +7093,13 @@ const MaskedInputText = ({
6905
7093
  return;
6906
7094
  }
6907
7095
  if (preserveMismatchingInitialValue) {
6908
- logger$C.warn(`Value received "${value}" does not match mask`, maskResult, `
7096
+ logger$D.warn(`Value received "${value}" does not match mask`, maskResult, `
6909
7097
  Preserving mismatched initial value until user input.`);
6910
7098
  setPreservingMismatchedValue(true);
6911
7099
  return;
6912
7100
  }
6913
7101
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
6914
- logger$C.warn(`Value received "${value}" does not match mask`, maskResult, `
7102
+ logger$D.warn(`Value received "${value}" does not match mask`, maskResult, `
6915
7103
  Falling back to partially valid value "${fallback}"`);
6916
7104
  onInput(fallback);
6917
7105
  }
@@ -7075,7 +7263,7 @@ function RadioGroup({
7075
7263
  type: "radio",
7076
7264
  checked: value === item.id,
7077
7265
  "aria-checked": value === item.id,
7078
- name,
7266
+ name: name ?? item.name,
7079
7267
  onChange,
7080
7268
  onClick: onChange,
7081
7269
  value: item.id,
@@ -9045,24 +9233,6 @@ const tradingNameFieldMetadata = {
9045
9233
  label: "tradingName",
9046
9234
  validators: [validateNotEmptyOnBlur]
9047
9235
  };
9048
- var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
9049
- ExperimentNames2["EnableCompanySearchFlow"] = "EnableCompanySearchFlow";
9050
- ExperimentNames2["EnableNewBusinessDetailsFlow"] = "EnableNewBusinessDetailsFlow";
9051
- ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
9052
- ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
9053
- ExperimentNames2["AllowMoreRolesForMainRootTrustee"] = "AllowMoreRolesForMainRootTrustee";
9054
- ExperimentNames2["ShowUnsupportedEntityType"] = "ShowUnsupportedEntityType";
9055
- ExperimentNames2["ShowSingPassButtonForCompanies"] = "ShowSingPassButtonForCompanies";
9056
- ExperimentNames2["ShowSingPassButtonForIndividuals"] = "ShowSingPassButtonForIndividuals";
9057
- ExperimentNames2["ShowExtraTaxExemptionReasons"] = "ShowExtraTaxExemptionReasons";
9058
- ExperimentNames2["EnableCountryOfGoverningLawForUKCompanies"] = "EnableCountryOfGoverningLawForUKCompanies";
9059
- ExperimentNames2["HidePayoutAccountTask"] = "HidePayoutAccountTask";
9060
- ExperimentNames2["HidePciTask"] = "HidePciTask";
9061
- ExperimentNames2["EnableAgeVerification"] = "EnableAgeVerification";
9062
- ExperimentNames2["PreserveMismatchedInitialValues"] = "PreserveMismatchedInitialValues";
9063
- ExperimentNames2["StrictNameAndAddressValidation"] = "StrictNameAndAddressValidation";
9064
- return ExperimentNames2;
9065
- })(ExperimentNames || {});
9066
9236
  var VatAbsenceReason = /* @__PURE__ */ ((VatAbsenceReason2) => {
9067
9237
  VatAbsenceReason2["IndustryExemption"] = "industryExemption";
9068
9238
  VatAbsenceReason2["BelowTaxThreshold"] = "belowTaxThreshold";
@@ -10558,7 +10728,7 @@ const accountHolderValidationRules = {
10558
10728
  }
10559
10729
  };
10560
10730
  const accountHolderFields = ["accountHolder"];
10561
- const logger$B = createLogger("AccountHolder");
10731
+ const logger$C = createLogger("AccountHolder");
10562
10732
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
10563
10733
  switch (legalEntityType) {
10564
10734
  case LegalEntityType.ORGANIZATION: {
@@ -10568,7 +10738,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
10568
10738
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
10569
10739
  }
10570
10740
  default:
10571
- logger$B.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10741
+ logger$C.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10572
10742
  return [];
10573
10743
  }
10574
10744
  }
@@ -10751,20 +10921,20 @@ function CompanyTypeComponent(props) {
10751
10921
  })]
10752
10922
  });
10753
10923
  }
10754
- const getDocumentGuidancePrefix = (documentType, isIcon = false, isFront = true) => {
10924
+ const getDocumentGuidancePrefix = (documentType) => {
10755
10925
  switch (documentType) {
10756
10926
  case DocumentType.PASSPORT:
10757
10927
  return "passport";
10758
10928
  case DocumentType.DRIVERS_LICENSE:
10759
10929
  case DocumentType.IDENTITY_CARD:
10760
- return isIcon ? isFront ? "id-front" : "id-back" : "id";
10930
+ return "id";
10761
10931
  case DocumentType.BANK_STATEMENT:
10762
10932
  case DocumentType.VAT_DOCUMENT:
10763
10933
  case DocumentType.REGISTRATION_DOCUMENT:
10764
10934
  case DocumentType.PROOF_OF_ADDRESS:
10765
10935
  case DocumentType.PROOF_OF_RESIDENCY:
10766
10936
  default:
10767
- return "generic-document";
10937
+ return "document";
10768
10938
  }
10769
10939
  };
10770
10940
  function DocumentGuidance({
@@ -10774,50 +10944,48 @@ function DocumentGuidance({
10774
10944
  const {
10775
10945
  i18n
10776
10946
  } = useI18nContext();
10777
- const {
10778
- loadDocumentGuidance: loadDocumentGuidance2
10779
- } = useConfigurationApi();
10780
- const [guidancePrefix, setGuidancePrefix] = useState(null);
10781
- useEffect(() => {
10782
- loadDocumentGuidance2();
10783
- }, []);
10784
- useEffect(() => {
10785
- setGuidancePrefix(getDocumentGuidancePrefix(type));
10947
+ const documentGuidanceItems = useMemo(() => {
10948
+ const guidancePrefix = getDocumentGuidancePrefix(type);
10949
+ return [{
10950
+ svgName: `${guidancePrefix}-front`,
10951
+ translationKey: "good",
10952
+ valid: true
10953
+ }, {
10954
+ svgName: `${guidancePrefix}-cutoff`,
10955
+ translationKey: "notCutOff"
10956
+ }, {
10957
+ svgName: `${guidancePrefix}-blurred`,
10958
+ translationKey: "notBlurry"
10959
+ }, guidancePrefix === "document" ? {
10960
+ svgName: `document-expired`,
10961
+ translationKey: "notExpired"
10962
+ } : {
10963
+ svgName: `${guidancePrefix}-glare`,
10964
+ translationKey: "noGlare"
10965
+ }];
10786
10966
  }, [type]);
10787
- const documentGuidanceItems = useMemo(() => [{
10788
- type: "valid",
10789
- translationKey: "good"
10790
- }, {
10791
- type: "invalid-cut",
10792
- translationKey: "notCutOff"
10793
- }, {
10794
- type: "invalid-blur",
10795
- translationKey: "notBlurry"
10796
- }, guidancePrefix === "generic-document" ? {
10797
- type: "invalid-expired",
10798
- translationKey: "notExpired"
10799
- } : {
10800
- type: "invalid-glare",
10801
- translationKey: "noGlare"
10802
- }], [guidancePrefix]);
10803
10967
  return jsx("div", {
10804
10968
  className: cx("adyen-kyc-document-guidance", className),
10805
10969
  children: jsx("div", {
10806
10970
  className: "adyen-kyc-document-guidance__container",
10807
10971
  children: documentGuidanceItems.map((item) => jsxs("figure", {
10808
10972
  className: "adyen-kyc-document-guidance__item",
10809
- children: [jsx("svg", {
10810
- width: "100%",
10811
- height: "100%",
10812
- role: "img",
10813
- children: jsx("use", {
10814
- href: `#adyen-kyc-${guidancePrefix}-${item.type}`
10815
- })
10816
- }), jsx("figcaption", {
10973
+ children: [jsx(Svg, {
10974
+ type: "image",
10975
+ name: item.svgName
10976
+ }), jsxs("figcaption", {
10817
10977
  className: "adyen-kyc-document-guidance__description",
10818
- children: i18n.get(item.translationKey)
10978
+ children: [item.valid ? jsx(Svg, {
10979
+ type: "icon",
10980
+ name: "check",
10981
+ className: cx("adyen-kyc-document-guidance__icon", "adyen-kyc-document-guidance__icon--valid")
10982
+ }) : jsx(Svg, {
10983
+ type: "icon",
10984
+ name: "cross",
10985
+ className: cx("adyen-kyc-document-guidance__icon", "adyen-kyc-document-guidance__icon--invalid")
10986
+ }), i18n.get(item.translationKey)]
10819
10987
  })]
10820
- }, item.type))
10988
+ }, item.translationKey))
10821
10989
  })
10822
10990
  });
10823
10991
  }
@@ -10831,15 +10999,16 @@ function bytesToSize(bytes) {
10831
10999
  const isExistingFile = (file) => "existing" in file && file.existing;
10832
11000
  const isNewlyUploadedFile = (file) => !isExistingFile(file);
10833
11001
  function DropzoneFile(props) {
11002
+ var _a;
10834
11003
  const {
10835
11004
  file,
10836
11005
  errorMessage,
10837
- onDelete,
10838
- iconPrefix
11006
+ onDelete
10839
11007
  } = props;
10840
11008
  const {
10841
11009
  i18n
10842
11010
  } = useI18nContext();
11011
+ let documentIcon;
10843
11012
  const formatSize = (bytes) => {
10844
11013
  const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
10845
11014
  if (!bytes || bytes === 0) return "n/a";
@@ -10847,40 +11016,46 @@ function DropzoneFile(props) {
10847
11016
  if (i === 0) return `${bytes} ${sizes[i]}`;
10848
11017
  return `${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]}`;
10849
11018
  };
11019
+ switch ((_a = file.type) == null ? void 0 : _a.split("/")[0]) {
11020
+ case "image":
11021
+ documentIcon = "image";
11022
+ break;
11023
+ default:
11024
+ documentIcon = "document";
11025
+ }
10850
11026
  return jsxs("div", {
10851
- className: "adyen-kyc-dropzone-file",
10852
- children: [jsx("div", {
10853
- className: "adyen-kyc-dropzone-file__icon",
10854
- children: jsx("svg", {
10855
- height: "100%",
10856
- width: "100%",
10857
- children: errorMessage ? jsx("use", {
10858
- "data-testid": "document-invalid",
10859
- href: `#adyen-kyc-${iconPrefix}-icon-invalid`
10860
- }) : jsx("use", {
10861
- "data-testid": "document-valid",
10862
- href: `#adyen-kyc-${iconPrefix}-icon-valid`
10863
- })
10864
- })
10865
- }), jsxs("div", {
10866
- className: "adyen-kyc-dropzone-file__labels",
10867
- children: [jsx("div", {
10868
- className: "adyen-kyc-dropzone-file__name",
10869
- children: file.name
10870
- }), errorMessage ? jsx("div", {
11027
+ className: cx("adyen-kyc-dropzone-file", {
11028
+ "adyen-kyc-dropzone-file--error": errorMessage
11029
+ }),
11030
+ children: [jsxs("div", {
11031
+ className: "adyen-kyc-dropzone-file__details",
11032
+ children: [jsxs("div", {
11033
+ className: "adyen-kyc-dropzone-file__labels",
11034
+ children: [errorMessage ? jsx(Icon, {
11035
+ testId: "document-invalid",
11036
+ name: "warning",
11037
+ className: "adyen-kyc-dropzone-file__icon"
11038
+ }) : jsx(Icon, {
11039
+ testId: "document-valid",
11040
+ name: documentIcon,
11041
+ className: "adyen-kyc-dropzone-file__icon"
11042
+ }), jsx(Typography, {
11043
+ variant: "body-stronger",
11044
+ className: "adyen-kyc-dropzone-file__name",
11045
+ children: file.name
11046
+ }), jsx(Typography, {
11047
+ className: "adyen-kyc-dropzone-file__size",
11048
+ children: isNewlyUploadedFile(file) && formatSize(file.size)
11049
+ })]
11050
+ }), errorMessage && jsx("div", {
10871
11051
  className: "adyen-kyc-dropzone-file__error",
10872
11052
  children: i18n.get(errorMessage)
10873
- }) : jsx("div", {
10874
- className: "adyen-kyc-dropzone-file__size",
10875
- children: isNewlyUploadedFile(file) ? formatSize(file.size) : void 0
10876
11053
  })]
10877
- }), jsx("button", {
10878
- type: "button",
11054
+ }), jsx(Button, {
11055
+ icon: errorMessage ? "cross" : "bin",
10879
11056
  className: "adyen-kyc-dropzone-file__button",
10880
- onClick: onDelete,
10881
- children: jsx(Icon, {
10882
- name: "remove"
10883
- })
11057
+ tertiary: true,
11058
+ onClick: onDelete
10884
11059
  })]
10885
11060
  });
10886
11061
  }
@@ -10938,7 +11113,6 @@ function Dropzone(props) {
10938
11113
  var _a, _b;
10939
11114
  const {
10940
11115
  name,
10941
- iconPrefix = "generic-document",
10942
11116
  label = "",
10943
11117
  multiple = false,
10944
11118
  required = true,
@@ -11061,8 +11235,7 @@ function Dropzone(props) {
11061
11235
  return jsx(DropzoneFile, {
11062
11236
  file,
11063
11237
  onDelete: () => handleFileDelete(file),
11064
- errorMessage: (_a2 = errors == null ? void 0 : errors[name]) == null ? void 0 : _a2.errorMessage,
11065
- iconPrefix
11238
+ errorMessage: (_a2 = errors == null ? void 0 : errors[name]) == null ? void 0 : _a2.errorMessage
11066
11239
  }, file);
11067
11240
  }), showDropzone && jsxs("div", {
11068
11241
  role: "region",
@@ -11076,35 +11249,45 @@ function Dropzone(props) {
11076
11249
  onDragLeave: (e) => handleDragLeave(e),
11077
11250
  children: [jsx("div", {
11078
11251
  className: "adyen-kyc-dropzone__icon",
11079
- children: jsx("svg", {
11080
- height: "100%",
11081
- width: "100%",
11082
- children: jsx("use", {
11083
- href: `#adyen-kyc-${iconPrefix}-icon`
11084
- })
11252
+ children: jsx(Icon, {
11253
+ name: "upload"
11085
11254
  })
11086
11255
  }), jsxs("div", {
11087
11256
  className: "adyen-kyc-dropzone__labels",
11088
- children: [jsxs("div", {
11089
- className: "adyen-kyc-dropzone__drag-text",
11090
- children: [jsxs("span", {
11091
- children: [i18n.get("dragYourFilesHereOr"), " "]
11092
- }), jsx("button", {
11093
- className: "adyen-kyc-dropzone__button",
11094
- type: "button",
11095
- onClick: selectFile,
11096
- children: i18n.get("browse")
11097
- })]
11098
- }), jsx("div", {
11099
- className: "adyen-kyc-dropzone__supports-text",
11100
- children: i18n.get("supports", {
11257
+ children: [jsx(Typography, {
11258
+ el: "h4",
11259
+ variant: "body-strongest",
11260
+ children: i18n.get("dropFileToUpload")
11261
+ }), jsx(Typography, {
11262
+ color: "secondary",
11263
+ children: i18n.get("supportedFileTypes", {
11264
+ values: {
11265
+ fileTypes: allowedFiletypes
11266
+ }
11267
+ })
11268
+ }), jsx(Typography, {
11269
+ color: "secondary",
11270
+ children: i18n.get("maxFileSize", {
11271
+ values: {
11272
+ maxSize: bytesToSize(maxSize)
11273
+ }
11274
+ })
11275
+ }), jsx(Typography, {
11276
+ color: "secondary",
11277
+ children: i18n.get("upToFiles", {
11101
11278
  values: {
11102
- fileTypes: allowedFiletypes,
11103
- maxSize: bytesToSize(maxSize),
11104
11279
  maxFiles: maxNumberOfFiles
11105
11280
  }
11106
11281
  })
11107
11282
  })]
11283
+ }), jsx("div", {
11284
+ className: "adyen-kyc-dropzone__button",
11285
+ children: jsx(Button, {
11286
+ label: i18n.get("browseFiles"),
11287
+ onClick: selectFile,
11288
+ secondary: true,
11289
+ small: true
11290
+ })
11108
11291
  }), jsx("input", {
11109
11292
  className: "adyen-kyc-dropzone__input",
11110
11293
  ref: fileInput,
@@ -11122,7 +11305,7 @@ function Dropzone(props) {
11122
11305
  })]
11123
11306
  });
11124
11307
  }
11125
- const logger$A = createLogger("TextArea");
11308
+ const logger$B = createLogger("TextArea");
11126
11309
  function TextArea(props) {
11127
11310
  const {
11128
11311
  classNameModifiers,
@@ -11143,7 +11326,7 @@ function TextArea(props) {
11143
11326
  } = useI18nContext();
11144
11327
  const [value, setValue] = useState("");
11145
11328
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11146
- logger$A.error("Error: Form fields that rely on InputBase may not have an onChange property");
11329
+ logger$B.error("Error: Form fields that rely on InputBase may not have an onChange property");
11147
11330
  }
11148
11331
  const handleInput = (e) => {
11149
11332
  var _a;
@@ -11295,7 +11478,6 @@ function DocumentUploadComponent({
11295
11478
  }), jsx(Dropzone, {
11296
11479
  defaultData: document2,
11297
11480
  id: props.id,
11298
- iconPrefix: getDocumentGuidancePrefix(documentType, true),
11299
11481
  isOptional: isOptional || formUtils.isOptionalField(documentField),
11300
11482
  maxSize: documentType === DocumentType.CONSTITUTIONAL_DOCUMENT ? 31457280 : void 0,
11301
11483
  name: documentField,
@@ -11448,7 +11630,7 @@ function StateField({
11448
11630
  readonly,
11449
11631
  handleChangeFor,
11450
11632
  selectedCountry,
11451
- classNameModifiers = []
11633
+ classNameModifiers = ["stateOrProvince"]
11452
11634
  }) {
11453
11635
  const {
11454
11636
  i18n
@@ -11589,7 +11771,7 @@ function useIsElementVisible(ref, fallback = true) {
11589
11771
  }, [ref]);
11590
11772
  return isOnScreen;
11591
11773
  }
11592
- const logger$z = createLogger("SearchAddress");
11774
+ const logger$A = createLogger("SearchAddress");
11593
11775
  const SearchAddress = ({
11594
11776
  data,
11595
11777
  legalEntityId,
@@ -11633,7 +11815,7 @@ const SearchAddress = ({
11633
11815
  const response = await handleFindAddress(selectedAddressId);
11634
11816
  autocompleteAddressForm(response);
11635
11817
  } catch (e) {
11636
- logger$z.error(e);
11818
+ logger$A.error(e);
11637
11819
  }
11638
11820
  };
11639
11821
  const onDrilldown = async (selectedAddress) => {
@@ -11645,7 +11827,7 @@ const SearchAddress = ({
11645
11827
  }, legalEntityId);
11646
11828
  setItems((response == null ? void 0 : response.results) || []);
11647
11829
  } catch (e) {
11648
- logger$z.error(e);
11830
+ logger$A.error(e);
11649
11831
  }
11650
11832
  };
11651
11833
  const onChange = (e) => {
@@ -11700,7 +11882,7 @@ const SearchAddress = ({
11700
11882
  setItems([]);
11701
11883
  }
11702
11884
  } catch (e) {
11703
- logger$z.error(e);
11885
+ logger$A.error(e);
11704
11886
  }
11705
11887
  setLoading(false);
11706
11888
  }
@@ -12080,15 +12262,11 @@ const addressValidationRules = (country) => {
12080
12262
  var _a, _b;
12081
12263
  const postalCodeFormat = (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format;
12082
12264
  return {
12083
- address: [{
12265
+ address: {
12084
12266
  modes: ["blur"],
12085
12267
  validate: (val) => hasText(val),
12086
12268
  errorMessage: "fieldIsRequired"
12087
- }, {
12088
- modes: ["blur"],
12089
- validate: (val) => !matchesRegex(EMOJI_REGEX, val),
12090
- errorMessage: "checkForTypos"
12091
- }],
12269
+ },
12092
12270
  postalCode: {
12093
12271
  modes: ["blur"],
12094
12272
  validate: (val) => {
@@ -12119,6 +12297,82 @@ const addressValidationRules = (country) => {
12119
12297
  }
12120
12298
  };
12121
12299
  };
12300
+ const addressValidationRulesV4 = (country, i18n) => {
12301
+ var _a, _b;
12302
+ const postalCodeFormat = (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format;
12303
+ const MIN_LENGTH_3 = 3;
12304
+ return {
12305
+ address: [{
12306
+ modes: ["blur"],
12307
+ validate: (val) => hasText(val),
12308
+ errorMessage: "fieldIsRequired"
12309
+ }, {
12310
+ modes: ["blur"],
12311
+ validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val),
12312
+ errorMessage: "checkForTypos"
12313
+ }, {
12314
+ modes: ["blur"],
12315
+ validate: (val) => isValidMinLength(val, MIN_LENGTH_3),
12316
+ errorMessage: {
12317
+ key: "fieldMustContainAtLeast",
12318
+ values: {
12319
+ fieldName: i18n.get("address"),
12320
+ minLength: String(MIN_LENGTH_3)
12321
+ }
12322
+ }
12323
+ }],
12324
+ postalCode: {
12325
+ modes: ["blur"],
12326
+ validate: (val) => {
12327
+ const pattern = postalCodePatterns[country];
12328
+ return pattern ? !!val && pattern.test(val) : !!val;
12329
+ },
12330
+ errorMessage: postalCodeFormat ? {
12331
+ key: "invalidFormatExpects",
12332
+ values: {
12333
+ format: postalCodeFormat
12334
+ }
12335
+ } : "invalidFormat"
12336
+ },
12337
+ city: [{
12338
+ modes: ["blur"],
12339
+ validate: hasText,
12340
+ errorMessage: "fieldIsRequired"
12341
+ }, {
12342
+ modes: ["blur"],
12343
+ validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
12344
+ errorMessage: "checkForTypos"
12345
+ }, {
12346
+ modes: ["blur"],
12347
+ validate: (val) => isValidMinLength(val, MIN_LENGTH_3),
12348
+ errorMessage: {
12349
+ key: "fieldMustContainAtLeast",
12350
+ values: {
12351
+ fieldName: i18n.get("city"),
12352
+ minLength: String(MIN_LENGTH_3)
12353
+ }
12354
+ }
12355
+ }],
12356
+ stateOrProvince: [{
12357
+ modes: ["blur"],
12358
+ validate: (val) => !!val,
12359
+ errorMessage: "fieldIsRequired"
12360
+ }, {
12361
+ modes: ["blur"],
12362
+ validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
12363
+ errorMessage: "checkForTypos"
12364
+ }],
12365
+ country: [{
12366
+ modes: ["blur"],
12367
+ validate: (val) => !!val,
12368
+ errorMessage: "fieldIsRequired"
12369
+ }, {
12370
+ modes: ["blur"],
12371
+ validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
12372
+ errorMessage: "checkForTypos"
12373
+ }]
12374
+ };
12375
+ };
12122
12376
  function Address(props) {
12123
12377
  const {
12124
12378
  data: dataProp,
@@ -12143,6 +12397,7 @@ function Address(props) {
12143
12397
  const {
12144
12398
  isExperimentEnabled
12145
12399
  } = useExperimentsContext();
12400
+ const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(ExperimentNames.HOStrictNameAndAddressValidationV4);
12146
12401
  const [showAutocompletedAddressFields, setShowAutocompletedAddressFields] = useState(false);
12147
12402
  const [showAddAddressButton, setShowAddAddressButton] = useState(true);
12148
12403
  const [isHandlerPresent, setIsHandlerPresent] = useState(false);
@@ -12153,6 +12408,7 @@ function Address(props) {
12153
12408
  const datasetUtils = datasetUtilities(i18n.locale);
12154
12409
  const requiredFields = (requiredFieldsProp == null ? void 0 : requiredFieldsProp.includes("stateOrProvince")) || dataProp.country && COUNTRIES_WITH_STATES_DATASET.includes(dataProp.country) ? addressFields : addressFields.filter((ad) => ad !== "stateOrProvince");
12155
12410
  const rules2 = useMemo(() => addressValidationRules(dataProp.country), [dataProp.country]);
12411
+ const rulesV4 = useMemo(() => addressValidationRulesV4(dataProp.country, i18n), [dataProp.country, i18n]);
12156
12412
  const {
12157
12413
  data,
12158
12414
  errors,
@@ -12169,7 +12425,7 @@ function Address(props) {
12169
12425
  schema: requiredFields,
12170
12426
  defaultData: dataProp,
12171
12427
  formatters: addressFormatters,
12172
- rules: rules2,
12428
+ rules: isStrictNameAndAddressValidationEnabled ? rulesV4 : rules2,
12173
12429
  fieldProblems: fieldValidationErrorsProp,
12174
12430
  obscuredFields: []
12175
12431
  });
@@ -14365,7 +14621,6 @@ function IdDocumentManualUploadComponent(props) {
14365
14621
  defaultData: idFrontPage,
14366
14622
  id: props.id,
14367
14623
  isOptional,
14368
- iconPrefix: getDocumentGuidancePrefix(data.idDocumentType, true, true),
14369
14624
  shouldValidate: props.shouldValidate
14370
14625
  })]
14371
14626
  }), data.idDocumentType && hasBack && jsx("div", {
@@ -14376,7 +14631,6 @@ function IdDocumentManualUploadComponent(props) {
14376
14631
  defaultData: idBackPage,
14377
14632
  id: props.id,
14378
14633
  isOptional,
14379
- iconPrefix: getDocumentGuidancePrefix(data.idDocumentType, true, false),
14380
14634
  shouldValidate: props.shouldValidate
14381
14635
  })
14382
14636
  })]
@@ -14444,7 +14698,7 @@ const useIdVerificationToken = ({
14444
14698
  loadingStatus
14445
14699
  };
14446
14700
  };
14447
- const styles$1 = {
14701
+ const styles$2 = {
14448
14702
  "adyen-kyc-loading-input__form": "adyen-kyc-loading-input__form",
14449
14703
  "adyen-kyc-loading-input__form--loading-opacity0": "adyen-kyc-loading-input__form--loading-opacity0",
14450
14704
  "adyen-kyc-loading-input__form--loading-opacity0-1": "adyen-kyc-loading-input__form--loading-opacity0-1",
@@ -14472,12 +14726,12 @@ const LoaderWrapper = ({
14472
14726
  const digit = formOpacityStrArr[0];
14473
14727
  const decimal = formOpacityStrArr[1];
14474
14728
  const opacity = decimal ? `${digit}-${decimal}` : `${digit}`;
14475
- const wrapperClass = cx("adyen-kyc-loading-input__form", styles$1["adyen-kyc-loading-input__form"], {
14476
- [styles$1[`adyen-kyc-loading-input__form--loading-opacity${opacity}`]]: status === "loading"
14729
+ const wrapperClass = cx("adyen-kyc-loading-input__form", styles$2["adyen-kyc-loading-input__form"], {
14730
+ [styles$2[`adyen-kyc-loading-input__form--loading-opacity${opacity}`]]: status === "loading"
14477
14731
  });
14478
14732
  const loaderWrapperClass = cx({
14479
- [styles$1["adyen-kyc-loading-input__loader"]]: true,
14480
- [styles$1["adyen-kyc-loading-input__loader--active"]]: status === "loading" && showSpinner
14733
+ [styles$2["adyen-kyc-loading-input__loader"]]: true,
14734
+ [styles$2["adyen-kyc-loading-input__loader--active"]]: status === "loading" && showSpinner
14481
14735
  });
14482
14736
  const overlayClass = cx("adyen-kyc-loading-input", className);
14483
14737
  return jsxs("div", {
@@ -14546,7 +14800,7 @@ const initOnfido = async ({
14546
14800
  language: getOnfidoLocaleConfig(i18n)
14547
14801
  });
14548
14802
  };
14549
- const logger$y = createLogger("IdVerificationComponent");
14803
+ const logger$z = createLogger("IdVerificationComponent");
14550
14804
  function IdVerificationComponent({
14551
14805
  userDetails,
14552
14806
  legalEntityId,
@@ -14583,7 +14837,7 @@ function IdVerificationComponent({
14583
14837
  onIdVerificationError,
14584
14838
  onIdVerificationComplete
14585
14839
  });
14586
- })().catch(logger$y.error);
14840
+ })().catch(logger$z.error);
14587
14841
  return () => {
14588
14842
  if (onfidoSdk.current) onfidoSdk.current.tearDown();
14589
14843
  };
@@ -14633,7 +14887,7 @@ function IdDocumentAlreadyUpload(props) {
14633
14887
  })]
14634
14888
  });
14635
14889
  }
14636
- const logger$x = createLogger("IdDocumentInstantVerificationComponent");
14890
+ const logger$y = createLogger("IdDocumentInstantVerificationComponent");
14637
14891
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
14638
14892
  const documentTypeValidationRules = {
14639
14893
  instantIdVerificationData: {
@@ -14715,7 +14969,7 @@ function IdDocumentInstantVerificationComponent(props) {
14715
14969
  userDetails: props.userDetails,
14716
14970
  legalEntityId: props.legalEntityId,
14717
14971
  onIdVerificationComplete: handleIdVerificationComplete,
14718
- onIdVerificationError: logger$x.error
14972
+ onIdVerificationError: logger$y.error
14719
14973
  }), jsxs("div", {
14720
14974
  className: "adyen-kyc-document-upload__manual-upload",
14721
14975
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -14743,116 +14997,56 @@ function IdDocumentUploadComponent(props) {
14743
14997
  ...props
14744
14998
  });
14745
14999
  }
14746
- const layoutBreakpointClassnames = {
14747
- xsOnly: "adyen-layout-xs-only",
14748
- md: "adyen-layout-md",
14749
- lg: "adyen-layout-lg"
14750
- };
14751
- const layoutBreakpointSizes = {
14752
- md: 680,
14753
- lg: 1024
14754
- };
14755
- const getBreakpointClassNames = (containerSize) => {
14756
- const breakPoints = Object.entries(layoutBreakpointSizes);
14757
- const classes = breakPoints.reduce((acc, [bp, size]) => {
14758
- if (size <= containerSize) acc.push(layoutBreakpointClassnames[bp]);
14759
- return acc;
14760
- }, []);
14761
- return classes.length > 0 ? classes : ["adyen-layout-xs-only"];
14762
- };
14763
- function assignLayoutClasses(entries, container) {
14764
- let newClasses = [];
14765
- entries.forEach((entry) => {
14766
- var _a;
14767
- const parentWidth = (_a = entry.contentBoxSize) == null ? void 0 : _a[0].inlineSize;
14768
- if (parentWidth) {
14769
- newClasses = getBreakpointClassNames(parentWidth);
14770
- } else {
14771
- newClasses.push(layoutBreakpointClassnames.lg);
14772
- }
14773
- container.classList.remove(...Object.values(layoutBreakpointClassnames));
14774
- container.classList.add(...newClasses);
14775
- });
14776
- }
14777
- const AutoResizer = ({
14778
- children
14779
- }) => {
14780
- const containerRef = useRef(null);
14781
- useEffect(() => {
14782
- const container = containerRef.current;
14783
- if (!container) return;
14784
- const resizeObserver = new ResizeObserver((entries) => assignLayoutClasses(entries, container));
14785
- resizeObserver.observe(container);
14786
- return () => resizeObserver.unobserve(container);
14787
- });
14788
- return jsx("div", {
14789
- ref: containerRef,
14790
- children
14791
- });
14792
- };
14793
- const makeIdVerificationMethodsMetadata = (svgPath) => ({
15000
+ const idVerificationMethodsMetadata = {
14794
15001
  instantVerification: {
14795
15002
  name: "instantVerification",
14796
15003
  description: "instantIDVerificationDescription",
14797
- iconComponentDesktop: `${svgPath}/instant-verification-desktop.svg`,
14798
- iconComponentMobile: `${svgPath}/instant-verification-mobile.svg`,
15004
+ svgName: "id-verification-instant",
14799
15005
  provider: {
14800
15006
  name: "Onfido",
14801
- icon: `${svgPath}/provider-logo-onfido.svg`
15007
+ svgName: `onfido-logo`
14802
15008
  }
14803
15009
  },
14804
15010
  manualVerification: {
14805
15011
  name: "manualUpload",
14806
15012
  description: "manualIDVerificationDescription",
14807
- iconComponentDesktop: `${svgPath}/manual-verification-desktop.svg`,
14808
- iconComponentMobile: `${svgPath}/manual-verification-mobile.svg`
15013
+ svgName: "id-verification-manual"
14809
15014
  }
14810
- });
15015
+ };
14811
15016
  const idVerificationMethods = ["instantVerification", "manualVerification"];
14812
15017
  const IdVerificationMethodOptionIcon = ({
14813
- method,
14814
- methodsMetadata
15018
+ method
14815
15019
  }) => {
14816
15020
  const {
14817
15021
  i18n
14818
15022
  } = useI18nContext();
14819
15023
  const {
14820
15024
  description,
14821
- iconComponentDesktop,
14822
- iconComponentMobile
14823
- } = methodsMetadata[method];
15025
+ svgName
15026
+ } = idVerificationMethodsMetadata[method];
14824
15027
  return jsx("div", {
14825
15028
  className: "adyen-kyc-radio-group-card__illustration",
14826
- children: jsxs("picture", {
14827
- children: [jsx("source", {
14828
- type: "image/svg+xml",
14829
- media: `(min-width: ${layoutBreakpointSizes.md}px)`,
14830
- srcSet: methodsMetadata[method].iconComponentDesktop
14831
- }), jsx("source", {
14832
- type: "image/svg+xml",
14833
- media: `(max-width: ${layoutBreakpointSizes.md}px)`,
14834
- srcSet: iconComponentMobile
14835
- }), jsx("img", {
14836
- srcSet: iconComponentDesktop,
14837
- alt: i18n.get(description)
14838
- })]
15029
+ children: jsx(Svg, {
15030
+ type: "image",
15031
+ name: svgName,
15032
+ alt: i18n.get(description)
14839
15033
  })
14840
15034
  });
14841
15035
  };
14842
15036
  const IdVerificationMethodOptionFooter = ({
14843
- method,
14844
- methodsMetadata
15037
+ method
14845
15038
  }) => {
14846
15039
  const {
14847
15040
  i18n
14848
15041
  } = useI18nContext();
14849
15042
  const {
14850
15043
  provider
14851
- } = methodsMetadata[method];
15044
+ } = idVerificationMethodsMetadata[method];
14852
15045
  return provider ? jsxs("div", {
14853
15046
  className: "adyen-kyc-field-verification-methods__footer",
14854
- children: [i18n.get("poweredBy"), jsx("img", {
14855
- src: provider.icon,
15047
+ children: [i18n.get("poweredBy"), jsx(Svg, {
15048
+ type: "image",
15049
+ name: provider.svgName,
14856
15050
  alt: provider.name
14857
15051
  })]
14858
15052
  }) : null;
@@ -14871,16 +15065,11 @@ function IdVerificationMethodComponent(props) {
14871
15065
  const {
14872
15066
  i18n
14873
15067
  } = useI18nContext();
14874
- const {
14875
- getImageUrl
14876
- } = useConfigurationApi();
14877
15068
  const verificationMethodFormId = id;
14878
15069
  const schema = idVerificationMethodFields;
14879
15070
  const stateRef = useRef({
14880
15071
  setState: null
14881
15072
  });
14882
- const svgPath = `${getImageUrl()}id-verification-method`;
14883
- const methodsMetadata = makeIdVerificationMethodsMetadata(svgPath);
14884
15073
  const {
14885
15074
  handleChangeFor,
14886
15075
  data,
@@ -14941,30 +15130,28 @@ function IdVerificationMethodComponent(props) {
14941
15130
  onSelect: handleChangeFor("idVerificationMethod"),
14942
15131
  selected: data.idVerificationMethod,
14943
15132
  optionId: (method) => method,
14944
- optionName: (method) => methodsMetadata[method].name,
14945
- optionDescription: (method) => methodsMetadata[method].description,
15133
+ optionName: (method) => idVerificationMethodsMetadata[method].name,
15134
+ optionDescription: (method) => idVerificationMethodsMetadata[method].description,
14946
15135
  className: "adyen-kyc-field-verification-methods",
14947
15136
  optionClassNames: () => ({
14948
15137
  label: "adyen-kyc-field-verification-methods__card adyen-kyc-radio-group-card--floating-radio"
14949
15138
  }),
14950
15139
  renderOptionIcon: (method) => jsx(IdVerificationMethodOptionIcon, {
14951
- method,
14952
- methodsMetadata
15140
+ method
14953
15141
  }),
14954
15142
  renderOptionFooter: (method) => jsx(IdVerificationMethodOptionFooter, {
14955
- method,
14956
- methodsMetadata
15143
+ method
14957
15144
  })
14958
15145
  })
14959
15146
  }), jsx(ContextGuidance, {
14960
15147
  page: "Instant verification with Onfido",
14961
15148
  title: i18n.get("howVerificationWithOnfidoWork"),
14962
15149
  content: jsxs(Fragment, {
14963
- children: [jsx("div", {
15150
+ children: [jsx(Typography, {
14964
15151
  className: "adyen-kyc-u-margin-bottom-8",
14965
15152
  children: i18n.get("onfidoIsOurTrustedPartner")
14966
15153
  }), jsxs(List, {
14967
- className: "adyen-kyc-id-verification-method__guidance adyen-kyc-u-margin-bottom-8",
15154
+ className: "adyen-kyc-id-verification-method__guidance",
14968
15155
  children: [jsx(ListItem, {
14969
15156
  children: i18n.get("usePhoneToScanId")
14970
15157
  }), jsx(ListItem, {
@@ -14972,7 +15159,7 @@ function IdVerificationMethodComponent(props) {
14972
15159
  }), jsx(ListItem, {
14973
15160
  children: i18n.get("theIdCheckWillBeAutomaticallyValidated")
14974
15161
  })]
14975
- }), jsx("div", {
15162
+ }), jsx(Typography, {
14976
15163
  className: "adyen-kyc-u-margin-bottom-8",
14977
15164
  children: i18n.get("adyenKeepsDataAsLongAsLegallyRequired")
14978
15165
  }), jsx(Link, {
@@ -15207,7 +15394,7 @@ const phoneFormatters = {
15207
15394
  };
15208
15395
  const phoneFields = ["phoneNumber"];
15209
15396
  const DEFAULT_PHONE_PREFIX = "+1";
15210
- const logger$w = createLogger("PhoneInput");
15397
+ const logger$x = createLogger("PhoneInput");
15211
15398
  const usePhonePrefixes = () => {
15212
15399
  const [phonePrefixes, setPhonePrefixes] = useState();
15213
15400
  useEffect(() => {
@@ -15215,7 +15402,7 @@ const usePhonePrefixes = () => {
15215
15402
  const loaded = (await import("./phonePrefixes-zV4hciyK.js")).default;
15216
15403
  setPhonePrefixes(loaded);
15217
15404
  };
15218
- loadPhonePrefixes().catch(logger$w.error);
15405
+ loadPhonePrefixes().catch(logger$x.error);
15219
15406
  }, []);
15220
15407
  return phonePrefixes;
15221
15408
  };
@@ -16059,7 +16246,7 @@ const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event
16059
16246
  callback();
16060
16247
  }
16061
16248
  };
16062
- const styles = {
16249
+ const styles$1 = {
16063
16250
  "adyen-kyc-multi-select-list": "adyen-kyc-multi-select-list",
16064
16251
  "adyen-kyc-multi-select-list-item": "adyen-kyc-multi-select-list-item",
16065
16252
  "adyen-kyc-multi-select-list-item--with-description": "adyen-kyc-multi-select-list-item--with-description",
@@ -16071,7 +16258,7 @@ const MultiSelectList = ({
16071
16258
  onSelect,
16072
16259
  mapToSelectItem
16073
16260
  }) => jsx("ul", {
16074
- className: styles["adyen-kyc-multi-select-list"],
16261
+ className: styles$1["adyen-kyc-multi-select-list"],
16075
16262
  children: options.map((option) => {
16076
16263
  const item = mapToSelectItem(option);
16077
16264
  const isSelected = selected.includes(option);
@@ -16085,8 +16272,8 @@ const MultiSelectList = ({
16085
16272
  onKeyDown: handleKeys(["Enter", " "], handleSelect),
16086
16273
  onSelect: handleSelect,
16087
16274
  isMulti: true,
16088
- className: cx([styles["adyen-kyc-multi-select-list-item"], {
16089
- [styles["adyen-kyc-multi-select-list-item--with-description"]]: !!item.description
16275
+ className: cx([styles$1["adyen-kyc-multi-select-list-item"], {
16276
+ [styles$1["adyen-kyc-multi-select-list-item--with-description"]]: !!item.description
16090
16277
  }])
16091
16278
  }, item.id);
16092
16279
  })
@@ -16217,27 +16404,27 @@ const nameValidationRulesV4 = {
16217
16404
  modes: ["blur"],
16218
16405
  validate: hasText,
16219
16406
  errorMessage: "fieldIsRequired"
16220
- }, {
16221
- modes: ["blur"],
16222
- validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidInputLength(input) && !isInvalidName(input) && matchesRegex(ALLOWED_CHARS_REGEX, input),
16223
- errorMessage: "checkForTypos"
16224
16407
  }, {
16225
16408
  modes: ["blur"],
16226
16409
  validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
16227
16410
  errorMessage: "nameMustContainLetters"
16411
+ }, {
16412
+ modes: ["blur"],
16413
+ validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidMinLength(input, 2) && !isInvalidName(input) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, input),
16414
+ errorMessage: "checkForTypos"
16228
16415
  }],
16229
16416
  lastName: [{
16230
16417
  modes: ["blur"],
16231
16418
  validate: hasText,
16232
16419
  errorMessage: "fieldIsRequired"
16233
- }, {
16234
- modes: ["blur"],
16235
- validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidInputLength(input) && !isInvalidName(input) && matchesRegex(ALLOWED_CHARS_REGEX, input),
16236
- errorMessage: "checkForTypos"
16237
16420
  }, {
16238
16421
  modes: ["blur"],
16239
16422
  validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
16240
16423
  errorMessage: "nameMustContainLetters"
16424
+ }, {
16425
+ modes: ["blur"],
16426
+ validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidMinLength(input, 1) && !isInvalidName(input) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, input),
16427
+ errorMessage: "checkForTypos"
16241
16428
  }]
16242
16429
  };
16243
16430
  const specialCharsRegEx = getFormattingRegEx(SPECIAL_CHARS.replace("-", ""));
@@ -16260,7 +16447,7 @@ function NameComponent(props) {
16260
16447
  const {
16261
16448
  isExperimentEnabled
16262
16449
  } = useExperimentsContext();
16263
- const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(ExperimentNames.StrictNameAndAddressValidation);
16450
+ const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(ExperimentNames.HOStrictNameAndAddressValidationV4);
16264
16451
  const schema = props.requiredFields || ["firstName", "lastName"];
16265
16452
  const {
16266
16453
  handleChangeFor,
@@ -16515,10 +16702,8 @@ const DriversLicense$1 = ({
16515
16702
  page: "Personal details",
16516
16703
  title: i18n.get("whereCanIFindTheseNumbersOnMyDriversLicense"),
16517
16704
  content: jsxs(Fragment, {
16518
- children: [i18n.get("whereToFindNumbersOnDriversLicense"), " ", jsx("a", {
16705
+ children: [i18n.get("whereToFindNumbersOnDriversLicense"), " ", jsx(Link, {
16519
16706
  href: "https://www.usi.gov.au/about/forms-id/drivers-licence",
16520
- target: "_blank",
16521
- rel: "noreferrer",
16522
16707
  children: i18n.get("iStillCantFindIt")
16523
16708
  })]
16524
16709
  }),
@@ -16822,10 +17007,8 @@ const DriversLicense = ({
16822
17007
  page: "Personal details",
16823
17008
  title: i18n.get("whereCanIFindTheseNumbersOnMyDriversLicense"),
16824
17009
  content: jsxs(Fragment, {
16825
- children: [i18n.get("whereToFindNumbersOnDriversLicense__NZ"), " ", jsx("a", {
17010
+ children: [i18n.get("whereToFindNumbersOnDriversLicense__NZ"), " ", jsx(Link, {
16826
17011
  href: "https://www.nzta.govt.nz/driver-licences/getting-a-licence/your-driver-licence-explained/",
16827
- target: "_blank",
16828
- rel: "noreferrer",
16829
17012
  children: i18n.get("iStillCantFindIt")
16830
17013
  })]
16831
17014
  }),
@@ -17909,35 +18092,45 @@ function FilePicker({
17909
18092
  onDragLeave: handleDragLeave,
17910
18093
  children: [jsx("div", {
17911
18094
  className: "adyen-kyc-dropzone__icon",
17912
- children: jsx("svg", {
17913
- height: "100%",
17914
- width: "100%",
17915
- children: jsx("use", {
17916
- href: `#adyen-kyc-${iconPrefix}-icon`
17917
- })
18095
+ children: jsx(Icon, {
18096
+ name: "upload"
17918
18097
  })
17919
18098
  }), jsxs("div", {
17920
18099
  className: "adyen-kyc-dropzone__labels",
17921
- children: [jsxs("div", {
17922
- className: "adyen-kyc-dropzone__drag-text",
17923
- children: [jsxs("span", {
17924
- children: [i18n.get("dragYourFilesHereOr"), " "]
17925
- }), jsx("button", {
17926
- className: "adyen-kyc-dropzone__button",
17927
- type: "button",
17928
- onClick: openFilePicker,
17929
- children: i18n.get("browse")
17930
- })]
17931
- }), jsx("div", {
17932
- className: "adyen-kyc-dropzone__supports-text",
17933
- children: i18n.get("supports", {
18100
+ children: [jsx(Typography, {
18101
+ el: "h4",
18102
+ variant: "body-strongest",
18103
+ children: i18n.get("dropFileToUpload")
18104
+ }), jsx(Typography, {
18105
+ color: "secondary",
18106
+ children: i18n.get("supportedFileTypes", {
18107
+ values: {
18108
+ fileTypes: allowedFileTypesString
18109
+ }
18110
+ })
18111
+ }), jsx(Typography, {
18112
+ color: "secondary",
18113
+ children: i18n.get("maxFileSize", {
18114
+ values: {
18115
+ maxSize: bytesToSize(maxSize)
18116
+ }
18117
+ })
18118
+ }), jsx(Typography, {
18119
+ color: "secondary",
18120
+ children: i18n.get("upToFiles", {
17934
18121
  values: {
17935
- fileTypes: allowedFileTypesString,
17936
- maxSize: bytesToSize(maxSize),
17937
18122
  maxFiles: maxNumberOfFiles
17938
18123
  }
17939
18124
  })
17940
18125
  })]
18126
+ }), jsx("div", {
18127
+ className: "adyen-kyc-dropzone__button",
18128
+ children: jsx(Button, {
18129
+ label: i18n.get("browseFiles"),
18130
+ onClick: openFilePicker,
18131
+ secondary: true,
18132
+ small: true
18133
+ })
17941
18134
  }), jsx("input", {
17942
18135
  className: "adyen-kyc-dropzone__input",
17943
18136
  ref: fileInput,
@@ -18293,7 +18486,6 @@ function BankDocument(props) {
18293
18486
  setFiles: handleChangeFor("bankStatementDocument"),
18294
18487
  isValid: valid.bankStatementDocument ?? isBankStatementOptional,
18295
18488
  errorMessage: (_a2 = errors.bankStatementDocument) == null ? void 0 : _a2.errorMessage,
18296
- iconPrefix: getDocumentGuidancePrefix(DocumentType.BANK_STATEMENT, true),
18297
18489
  ...bankStatementValidationOptions
18298
18490
  });
18299
18491
  }
@@ -18486,7 +18678,7 @@ class AdyenKycSdkError extends Error {
18486
18678
  }
18487
18679
  let sdkToken;
18488
18680
  let fetchSdkToken;
18489
- const logger$v = createLogger("Session");
18681
+ const logger$w = createLogger("Session");
18490
18682
  const setSdkToken = (token) => {
18491
18683
  sdkToken = token;
18492
18684
  };
@@ -18509,7 +18701,7 @@ const refreshSession = async () => {
18509
18701
  setSdkToken(token);
18510
18702
  isSessionRefreshed = true;
18511
18703
  } catch (e) {
18512
- logger$v.error("Failed to fetch sdk token", e);
18704
+ logger$w.error("Failed to fetch sdk token", e);
18513
18705
  }
18514
18706
  return isSessionRefreshed;
18515
18707
  };
@@ -18519,7 +18711,7 @@ const addAnimationStartListener = (element, listener) => {
18519
18711
  const removeAnimationStartListener = (element, listener) => {
18520
18712
  element.removeEventListener("animationstart", listener, false);
18521
18713
  };
18522
- const logger$u = createLogger("Fetch");
18714
+ const logger$v = createLogger("Fetch");
18523
18715
  const getRequestObject = (options, data) => {
18524
18716
  const {
18525
18717
  headers = [],
@@ -18566,10 +18758,10 @@ const logFetchError = (message, level) => {
18566
18758
  case "info":
18567
18759
  case "warn":
18568
18760
  case "error":
18569
- logger$u[level](message);
18761
+ logger$v[level](message);
18570
18762
  break;
18571
18763
  default:
18572
- logger$u.error(message);
18764
+ logger$v.error(message);
18573
18765
  }
18574
18766
  };
18575
18767
  const handleFetchResponse = async (response, responseType) => {
@@ -18667,7 +18859,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
18667
18859
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
18668
18860
  const MOUNT_TIMEOUT = 10 * 1e3;
18669
18861
  const TINK_VENDOR = "Tink";
18670
- const logger$t = createLogger("iframeWidget");
18862
+ const logger$u = createLogger("iframeWidget");
18671
18863
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
18672
18864
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
18673
18865
  const parseMessageJson = (message) => {
@@ -18685,7 +18877,7 @@ const callbackErrorHandler = async (response) => {
18685
18877
  try {
18686
18878
  await response;
18687
18879
  } catch (ex) {
18688
- logger$t.error(ex);
18880
+ logger$u.error(ex);
18689
18881
  }
18690
18882
  return {
18691
18883
  error: "UNKNOWN_ERROR",
@@ -18788,7 +18980,7 @@ class IFrameWidget {
18788
18980
  message = responseData.errorMessage;
18789
18981
  }
18790
18982
  } catch (ex) {
18791
- logger$t.error(ex);
18983
+ logger$u.error(ex);
18792
18984
  }
18793
18985
  throw new AdyenKycSdkError(reason, jsonData.error);
18794
18986
  }
@@ -18975,7 +19167,7 @@ function BankVerificationWidget({
18975
19167
  ref: widgetContainerRef
18976
19168
  });
18977
19169
  }
18978
- const logger$s = createLogger("BankVerification");
19170
+ const logger$t = createLogger("BankVerification");
18979
19171
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
18980
19172
  const InstantVerificationErrorContext = createContext(null);
18981
19173
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -19007,7 +19199,7 @@ const usePreferredVendorForCountry = (country, getBankVerificationVendors) => {
19007
19199
  const vendor = vendors[0];
19008
19200
  setPreferredVendor(vendor.name ? vendor : void 0);
19009
19201
  };
19010
- getPreferredVendor().catch(logger$s.error);
19202
+ getPreferredVendor().catch(logger$t.error);
19011
19203
  }, [country, getBankVerificationVendors]);
19012
19204
  return preferredVendor;
19013
19205
  };
@@ -20238,24 +20430,22 @@ const regions = {
20238
20430
  apac: [CountryCodes.NewZealand, CountryCodes.Australia]
20239
20431
  };
20240
20432
  const getAllowedBankCountries = (country) => Object.values(regions).find((countriesInARegion) => countriesInARegion.includes(country)) ?? [country];
20241
- const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvider) => ({
20433
+ const makePayoutVerificationMethodsMetadata = (instantVerificationProvider) => ({
20242
20434
  instantVerification: {
20243
20435
  name: "verifyViaMobileBankingAppOrWebsite",
20244
20436
  subtitle: "instant",
20245
20437
  description: "instantVerificationDescription",
20246
- iconComponentDesktop: `${svgPath}/instant-verification-desktop.svg`,
20247
- iconComponentMobile: `${svgPath}/instant-verification-mobile.svg`,
20438
+ svgName: "payout-verification-instant",
20248
20439
  provider: instantVerificationProvider ? {
20249
20440
  name: instantVerificationProvider,
20250
- icon: `${svgPath}/provider-logo-${instantVerificationProvider}.svg`
20441
+ svgName: `${instantVerificationProvider}-logo`
20251
20442
  } : void 0
20252
20443
  },
20253
20444
  manualVerification: {
20254
20445
  name: "uploadABankStatement",
20255
20446
  subtitle: "mayTakeAFewDays",
20256
20447
  description: "manualVerificationDescription",
20257
- iconComponentDesktop: `${svgPath}/manual-verification-desktop.svg`,
20258
- iconComponentMobile: `${svgPath}/manual-verification-mobile.svg`
20448
+ svgName: "payout-verification-manual"
20259
20449
  }
20260
20450
  });
20261
20451
  const payoutVerificationMethods = ["instantVerification", "manualVerification"];
@@ -20343,24 +20533,14 @@ const PayoutVerificationMethodOptionIcon = ({
20343
20533
  } = useI18nContext();
20344
20534
  const {
20345
20535
  description,
20346
- iconComponentDesktop,
20347
- iconComponentMobile
20536
+ svgName
20348
20537
  } = methodsMetadata[method];
20349
20538
  return jsx("div", {
20350
20539
  className: "adyen-kyc-radio-group-card__illustration",
20351
- children: jsxs("picture", {
20352
- children: [jsx("source", {
20353
- type: "image/svg+xml",
20354
- media: `(min-width: ${layoutBreakpointSizes.md}px)`,
20355
- srcSet: iconComponentDesktop
20356
- }), jsx("source", {
20357
- type: "image/svg+xml",
20358
- media: `(max-width: ${layoutBreakpointSizes.md}px)`,
20359
- srcSet: iconComponentMobile
20360
- }), jsx("img", {
20361
- srcSet: iconComponentDesktop,
20362
- alt: i18n.get(description)
20363
- })]
20540
+ children: jsx(Svg, {
20541
+ type: "image",
20542
+ name: svgName,
20543
+ alt: i18n.get(description)
20364
20544
  })
20365
20545
  });
20366
20546
  };
@@ -20376,9 +20556,9 @@ const PayoutVerificationMethodOptionFooter = ({
20376
20556
  } = methodsMetadata[method];
20377
20557
  return provider ? jsxs("div", {
20378
20558
  className: "adyen-kyc-field-verification-methods__footer",
20379
- children: [i18n.get("poweredBy"), jsx("img", {
20380
- className: "adyen-kyc-field-verification-methods__icon",
20381
- src: provider.icon,
20559
+ children: [i18n.get("poweredBy"), jsx(Svg, {
20560
+ type: "image",
20561
+ name: provider.svgName,
20382
20562
  alt: provider.name
20383
20563
  })]
20384
20564
  }) : null;
@@ -20419,9 +20599,6 @@ function PayoutVerificationMethod(props) {
20419
20599
  const {
20420
20600
  i18n
20421
20601
  } = useI18nContext();
20422
- const {
20423
- getImageUrl
20424
- } = useConfigurationApi();
20425
20602
  const instantVerificationError = useContext(InstantVerificationErrorContext);
20426
20603
  const {
20427
20604
  isSettingEnabled
@@ -20461,8 +20638,7 @@ function PayoutVerificationMethod(props) {
20461
20638
  }), [data, errors, fieldProblems, valid]);
20462
20639
  const providerName = getInstantVerificationProvider(props.bankVerificationVendors, data.bankCountry);
20463
20640
  const instantVerificationAvailable = Boolean(props.instantVerificationAllowed && providerName && providerName !== "loading");
20464
- const svgPath = `${getImageUrl()}payout-verification-method`;
20465
- const methodsMetadata = makePayoutVerificationMethodsMetadata(svgPath, providerName === "loading" ? void 0 : providerName);
20641
+ const methodsMetadata = makePayoutVerificationMethodsMetadata(providerName === "loading" ? void 0 : providerName);
20466
20642
  useEffect(() => {
20467
20643
  if (!hasSelectedMethod && instantVerificationAvailable && data.payoutVerificationMethod !== "instantVerification") {
20468
20644
  handleChangeFor("payoutVerificationMethod")("instantVerification");
@@ -20574,31 +20750,29 @@ function PayoutVerificationMethod(props) {
20574
20750
  }
20575
20751
  }),
20576
20752
  content: jsxs(Fragment, {
20577
- children: [jsxs("p", {
20578
- children: [" ", i18n.get("isOurTrustedPartnerHelpingSpeedUpSetup", {
20753
+ children: [jsx(Typography, {
20754
+ children: i18n.get("isOurTrustedPartnerHelpingSpeedUpSetup", {
20579
20755
  values: {
20580
20756
  provider: getProviderDisplayName(providerName)
20581
20757
  }
20582
- }), " "]
20583
- }), jsxs("ul", {
20584
- className: "adyen-kyc-guidance-list",
20585
- children: [jsx("li", {
20586
- className: "adyen-kyc-guidance-list__item",
20758
+ })
20759
+ }), jsxs(List, {
20760
+ children: [jsx(ListItem, {
20587
20761
  children: i18n.get("selectTheBankToReceivePayouts")
20588
- }), jsx("li", {
20589
- className: "adyen-kyc-guidance-list__item",
20762
+ }), jsx(ListItem, {
20590
20763
  children: i18n.get("loginIntoYourBankingEnvironment")
20591
- }), jsx("li", {
20592
- className: "adyen-kyc-guidance-list__item",
20764
+ }), jsx(ListItem, {
20593
20765
  children: i18n.get("yourBankWillConfirmYourAccountDetails")
20594
20766
  })]
20595
- }), jsx("p", {
20767
+ }), jsx(Typography, {
20596
20768
  children: i18n.get("adyenWillOnlyGetTemporaryAccess")
20597
20769
  }), jsx(Link, {
20598
- className: "adyen-kyc-guidance-external-link",
20599
20770
  href: "https://www.adyen.com/policies-and-disclaimer/privacy-policy",
20600
20771
  external: true,
20601
- children: i18n.get("learnMore")
20772
+ children: jsx(Typography, {
20773
+ variant: "caption",
20774
+ children: i18n.get("learnMore")
20775
+ })
20602
20776
  })]
20603
20777
  })
20604
20778
  }) : void 0]
@@ -20672,7 +20846,7 @@ function PayoutDetailsComponent(props) {
20672
20846
  data: propData
20673
20847
  } = props;
20674
20848
  const [instantVerificationError, setInstantVerificationError] = useInstantVerificationErrorNotification(1e4);
20675
- const verificationMethodFormProps = getFormProps(props, payoutSteps.payoutVerificationMethod.formId);
20849
+ const verificationMethodFormProps = getFormProps(props, PayoutVerificationMethodFormID);
20676
20850
  const accountVerificationFormProps = getFormProps(props, PayoutAccountVerificationFormID);
20677
20851
  const payoutAccountFormProps = getFormProps(props, payoutSteps.payoutAccountDetails(taskType, isExperimentEnabled("EnableNewEntryFlow")).formId);
20678
20852
  const bankDocumentFormProps = getFormProps(props, PayoutAccountDocumentsFormID);
@@ -21584,6 +21758,36 @@ const trustRegistrationDetailsValidations = {
21584
21758
  errorMessage: "fieldIsRequired"
21585
21759
  }
21586
21760
  };
21761
+ const trustRegistrationDetailsValidationsV4 = {
21762
+ trustType: {
21763
+ modes: ["blur"],
21764
+ validate: (trustType) => !!trustType,
21765
+ errorMessage: "fieldIsRequired"
21766
+ },
21767
+ country: {
21768
+ modes: ["blur"],
21769
+ validate: (country) => !!country,
21770
+ errorMessage: "fieldIsRequired"
21771
+ },
21772
+ legalName: [{
21773
+ modes: ["blur"],
21774
+ validate: hasText,
21775
+ errorMessage: "fieldIsRequired"
21776
+ }, {
21777
+ modes: ["blur"],
21778
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
21779
+ errorMessage: "nameMustContainLetters"
21780
+ }, {
21781
+ modes: ["blur"],
21782
+ validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && isValidMinLength(input, 3) && !isInvalidName(input) && matchesRegex(OTHER_ENTITIES_VALID_CHAR_REGEX, input),
21783
+ errorMessage: "checkForTypos"
21784
+ }],
21785
+ objectOfTrust: {
21786
+ modes: ["blur"],
21787
+ validate: (objectOfTrust) => !!objectOfTrust,
21788
+ errorMessage: "fieldIsRequired"
21789
+ }
21790
+ };
21587
21791
  const trustRegistrationDetailsFields = ["legalName", "country", "trustType", "objectOfTrust", "taxId", "registrationNumber"];
21588
21792
  const ALLOWED_TRUST_COUNTRIES = [CountryCodes.Australia, CountryCodes.NewZealand];
21589
21793
  function TrustRegistrationDetailsComponent(props) {
@@ -21594,6 +21798,10 @@ function TrustRegistrationDetailsComponent(props) {
21594
21798
  const {
21595
21799
  i18n
21596
21800
  } = useI18nContext();
21801
+ const {
21802
+ isExperimentEnabled
21803
+ } = useExperimentsContext();
21804
+ const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(ExperimentNames.HOStrictNameAndAddressValidationV4);
21597
21805
  const TRUST_REGISTRATION_DETAILS = props.id || trustForms.trustRegistrationDetails.formId;
21598
21806
  const stateRef = useRef({
21599
21807
  setState: null
@@ -21615,7 +21823,7 @@ function TrustRegistrationDetailsComponent(props) {
21615
21823
  ...props.data,
21616
21824
  country
21617
21825
  },
21618
- rules: props.validators || trustRegistrationDetailsValidations,
21826
+ rules: props.validators || (isStrictNameAndAddressValidationEnabled ? trustRegistrationDetailsValidationsV4 : trustRegistrationDetailsValidations),
21619
21827
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
21620
21828
  });
21621
21829
  const formUtils = formUtilities(props, i18n);
@@ -22715,8 +22923,9 @@ const useFormComposer = ({
22715
22923
  const isFormSummaryStep = (form) => form.formId === summaryStep.formId;
22716
22924
  const [hasAlreadyNavigatedForm, setHasAlreadyNavigatedForm] = useState(false);
22717
22925
  const getFormIndex = (formId) => forms2.findIndex((form) => form.formId === formId);
22718
- const isFinalStep = getFormIndex(activeForm.formId) === forms2.length - 1;
22719
- const isFirstStep = getFormIndex(activeForm.formId) === 0;
22926
+ const currentStep = getFormIndex(activeForm.formId);
22927
+ const isFinalStep = currentStep === forms2.length - 1;
22928
+ const isFirstStep = currentStep === 0;
22720
22929
  const [hideHomeButton, setHideHomeButton] = useState(false);
22721
22930
  const [hideBackButton, setHideBackButton] = useState(false);
22722
22931
  useHideButton(isFirstStep, setHideBackButton);
@@ -22815,7 +23024,8 @@ const useFormComposer = ({
22815
23024
  gotoFormByFormIndex,
22816
23025
  activeForm,
22817
23026
  shouldValidate,
22818
- setShouldValidate
23027
+ setShouldValidate,
23028
+ currentStep
22819
23029
  };
22820
23030
  };
22821
23031
  const obscuredPayoutFields = ["bankAccountNumber", "iban"];
@@ -22878,7 +23088,7 @@ const useUnifyLoadingStatus = (setParentLoadingStatus, ...childLoadingStatuses)
22878
23088
  setParentLoadingStatus(loadingStatus);
22879
23089
  }, [...childLoadingStatuses]);
22880
23090
  };
22881
- const logger$r = createLogger("useScenarioConfiguration");
23091
+ const logger$s = createLogger("useScenarioConfiguration");
22882
23092
  const useScenarioConfiguration = ({
22883
23093
  getConfigurationData,
22884
23094
  getPayoutAccountFormatData,
@@ -22904,12 +23114,12 @@ const useScenarioConfiguration = ({
22904
23114
  const response = await getConfigurationData();
22905
23115
  setConfigurationResponse(response);
22906
23116
  } catch (err) {
22907
- logger$r.warn("WARNING: Configuration request failed - error:", err);
23117
+ logger$s.warn("WARNING: Configuration request failed - error:", err);
22908
23118
  } finally {
22909
23119
  setConfigurationLoadingStatus("success");
22910
23120
  }
22911
23121
  };
22912
- makeConfigCallAndSave().catch(logger$r.error);
23122
+ makeConfigCallAndSave().catch(logger$s.error);
22913
23123
  }, [getConfigurationData, setConfigurationLoadingStatus]);
22914
23124
  useEffect(() => {
22915
23125
  if (!getPayoutAccountFormatData) return;
@@ -22926,12 +23136,12 @@ const useScenarioConfiguration = ({
22926
23136
  const defaultAccountFormat = defaultPayoutAccountFormat[country] ?? allowedBankAccountFormats[0];
22927
23137
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
22928
23138
  } catch (err) {
22929
- logger$r.warn("WARNING: Payout format request failed - error:", err);
23139
+ logger$s.warn("WARNING: Payout format request failed - error:", err);
22930
23140
  } finally {
22931
23141
  setpayoutFormatLoadingStatus("success");
22932
23142
  }
22933
23143
  };
22934
- makePayoutFormatCallAndSave().catch(logger$r.error);
23144
+ makePayoutFormatCallAndSave().catch(logger$s.error);
22935
23145
  }, [country, setAccountFormat, getPayoutAccountFormatData, setpayoutFormatLoadingStatus, existingBankAccountFormat]);
22936
23146
  const {
22937
23147
  fieldConfigurations,
@@ -23140,7 +23350,6 @@ const taxInformationBase = {
23140
23350
  vatAbsenceReason: {
23141
23351
  rule: "countryUsesVat"
23142
23352
  },
23143
- // it still needs support from the BE: https://youtrack.is.adyen.com/issue/UO-2290
23144
23353
  taxInformation: {
23145
23354
  rule: "countryUsesTaxId"
23146
23355
  },
@@ -23687,10 +23896,8 @@ function VerifiedBusinessCard({
23687
23896
  }), jsx(Typography, {
23688
23897
  children: jsxs("div", {
23689
23898
  className: "adyen-kyc-verified-business-card__address",
23690
- children: [address, jsx("a", {
23899
+ children: [address, addressLink && jsx(Link, {
23691
23900
  href: addressLink,
23692
- target: "_blank",
23693
- rel: "noreferrer",
23694
23901
  children: i18n.get("showOnMap")
23695
23902
  })]
23696
23903
  })
@@ -23709,7 +23916,7 @@ function VerifiedBusinessCard({
23709
23916
  });
23710
23917
  }
23711
23918
  const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
23712
- const additionalInformationFields = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription"];
23919
+ const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription"];
23713
23920
  function AdditionalInformationComponent({
23714
23921
  data,
23715
23922
  labels: labels2,
@@ -23860,10 +24067,12 @@ function AdditionalInformationComponent({
23860
24067
  }, [formSchema, formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
23861
24068
  useEffect(() => {
23862
24069
  if (verifiedBusiness && verifiedBusiness.name !== formData.legalCompanyName) return handleChangeFor("legalCompanyName")(verifiedBusiness.name);
24070
+ }, [formData.legalCompanyName, verifiedBusiness, showCompanyStructure]);
24071
+ useEffect(() => {
23863
24072
  if (!verifiedBusiness && !showCompanyStructure) {
23864
24073
  return resetToDefaultData();
23865
24074
  }
23866
- }, [formData.legalCompanyName, verifiedBusiness, showCompanyStructure]);
24075
+ }, [verifiedBusiness]);
23867
24076
  const showField = (fieldKeys) => fieldKeys.some((field) => {
23868
24077
  switch (field) {
23869
24078
  case "legalCompanyName": {
@@ -23874,6 +24083,8 @@ function AdditionalInformationComponent({
23874
24083
  }
23875
24084
  });
23876
24085
  return jsxs("form", {
24086
+ id: ADDITIONAL_INFORMATION_FORM_ID,
24087
+ className: "adyen-kyc-additional-information",
23877
24088
  children: [jsx(FormHeader, {
23878
24089
  heading,
23879
24090
  description
@@ -23882,167 +24093,164 @@ function AdditionalInformationComponent({
23882
24093
  verificationErrors: formVerificationErrors,
23883
24094
  validationErrors: fieldValidationErrors,
23884
24095
  formUtils
23885
- }), jsxs("div", {
23886
- className: "adyen-kyc-additional-information",
23887
- children: [showVerified && jsx(VerifiedBusinessCard, {
23888
- verifiedBusiness
23889
- }), jsxs("section", {
23890
- children: [showVerified && jsx(Typography, {
23891
- el: "h3",
23892
- children: i18n.get("otherBusinessInformation")
23893
- }), showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
23894
- className: "adyen-kyc-field-wrapper",
23895
- children: jsx(LegalCompanyNameField, {
23896
- data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
23897
- valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
23898
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
23899
- labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
23900
- helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
23901
- legalCompanyName: "legalCompanyName__helperText"
23902
- }),
23903
- readonly: formUtils.isReadOnly("legalCompanyName"),
23904
- handleChangeFor
23905
- })
23906
- }), showField(DBA_NAME_FIELD) && jsx("div", {
23907
- className: "adyen-kyc-field-wrapper",
23908
- children: jsx(DBANameField, {
23909
- data: formUtils.getFieldData(formData, DBA_NAME_FIELD),
23910
- valid: formUtils.getFieldValid(formValid, DBA_NAME_FIELD),
23911
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DBA_NAME_FIELD),
23912
- labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
23913
- hasDba: "hasDba"
23914
- }),
23915
- readonly: formUtils.isReadOnly("dbaName"),
23916
- handleChangeFor,
23917
- setErrors
23918
- })
23919
- }), showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && jsx("div", {
23920
- className: "adyen-kyc-field-wrapper",
23921
- children: jsx(BusinessRegistrationNumberField, {
23922
- data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
23923
- valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
23924
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
23925
- labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
23926
- exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
23927
- }),
23928
- mask: formUtils.getMask("registrationNumber"),
23929
- guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
23930
- placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
23931
- helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
23932
- readonly: formUtils.isReadOnly("registrationNumber"),
23933
- optional: formUtils.isOptionalField("registrationNumber"),
23934
- shouldValidate,
23935
- handleChangeFor,
23936
- country,
23937
- canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
23938
- companyType,
23939
- registrationNumberOptions,
23940
- registrationNumberType,
23941
- setRegistrationNumberType
23942
- })
23943
- }), showField(TAX_INFORMATION_FIELD) && jsx("div", {
23944
- className: "adyen-kyc-field-wrapper",
23945
- children: jsx(TaxInformationField, {
23946
- data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
23947
- valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
23948
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
23949
- labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
23950
- exemptedFromTax: "iDontHaveATaxId"
23951
- }),
23952
- mask: formUtils.getMask("taxInformation"),
23953
- helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
23954
- guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
23955
- readonly: formUtils.isReadOnly("taxInformation"),
23956
- shouldValidate,
23957
- handleChangeFor,
23958
- canExempt: formUtils.isRequiredField("exemptedFromTax"),
23959
- isUen: formUtils.isRequiredField("isUen"),
23960
- country,
23961
- companyType,
23962
- taxIdNumberType,
23963
- setTaxIdNumberType,
23964
- defaultData: data == null ? void 0 : data.taxInformation
23965
- })
23966
- }), showField(VAT_NUMBER_FIELD) && jsx("div", {
23967
- className: "adyen-kyc-field-wrapper",
23968
- children: jsx(VatNumberField, {
23969
- data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
23970
- valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
23971
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
23972
- labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
23973
- exemptedFromVat: "iDontHaveAVatNumber"
23974
- }),
23975
- mask: formUtils.getMask("vatNumber"),
23976
- guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
23977
- placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
23978
- readonly: formUtils.isReadOnly("vatNumber"),
23979
- handleChangeFor,
23980
- country,
23981
- canExempt: formUtils.isRequiredField("exemptedFromVat"),
23982
- vatNumberType,
23983
- setVatNumberType
23984
- })
23985
- }), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
23986
- className: "adyen-kyc-field-wrapper",
23987
- children: jsx(DateOfIncorporationField, {
23988
- data: formUtils.getFieldData(formData, DATE_OF_INCORPORATION_FIELD),
23989
- valid: formUtils.getFieldValid(formValid, DATE_OF_INCORPORATION_FIELD),
23990
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DATE_OF_INCORPORATION_FIELD),
23991
- labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
23992
- placeholders: formUtils.getFieldPlaceholders(DATE_OF_INCORPORATION_FIELD, {
23993
- dateOfIncorporation: "datePlaceholder"
23994
- }),
23995
- readonly: formUtils.isReadOnly("dateOfIncorporation"),
23996
- handleChangeFor
23997
- })
23998
- })]
23999
- }), showStockData && jsxs("section", {
24000
- children: [jsx(Typography, {
24001
- el: "h3",
24002
- children: i18n.get("stockExchangeInformation")
24003
- }), showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
24004
- className: "adyen-kyc-field-wrapper",
24005
- children: jsx(StockExchangeMICField, {
24006
- data: formUtils.getFieldData(formData, STOCK_EXCHANGE_MIC_FIELD),
24007
- valid: formUtils.getFieldValid(formValid, STOCK_EXCHANGE_MIC_FIELD),
24008
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_EXCHANGE_MIC_FIELD),
24009
- labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
24010
- placeholders: formUtils.getFieldPlaceholders(STOCK_EXCHANGE_MIC_FIELD),
24011
- mask: formUtils.getMask("stockExchangeMIC"),
24012
- guidanceText: formUtils.getFieldGuidanceText(STOCK_EXCHANGE_MIC_FIELD),
24013
- readonly: formUtils.isReadOnly("stockExchangeMIC"),
24014
- shouldValidate,
24015
- handleChangeFor
24016
- })
24017
- }), showField(STOCK_ISIN_FIELD) && jsx("div", {
24018
- className: "adyen-kyc-field-wrapper",
24019
- children: jsx(StockISINField, {
24020
- data: formUtils.getFieldData(formData, STOCK_ISIN_FIELD),
24021
- valid: formUtils.getFieldValid(formValid, STOCK_ISIN_FIELD),
24022
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_ISIN_FIELD),
24023
- labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
24024
- placeholders: formUtils.getFieldPlaceholders(STOCK_ISIN_FIELD),
24025
- mask: formUtils.getMask("stockISIN"),
24026
- guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
24027
- readonly: formUtils.isReadOnly("stockISIN"),
24028
- shouldValidate,
24029
- handleChangeFor
24030
- })
24031
- }), showField(STOCK_TICKER_SYMBOL_FIELD) && jsx("div", {
24032
- className: "adyen-kyc-field-wrapper",
24033
- children: jsx(StockTickerSymbolField, {
24034
- data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
24035
- valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
24036
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
24037
- labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
24038
- placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
24039
- mask: formUtils.getMask("stockTickerSymbol"),
24040
- guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
24041
- readonly: formUtils.isReadOnly("stockTickerSymbol"),
24042
- shouldValidate,
24043
- handleChangeFor
24044
- })
24045
- })]
24096
+ }), showVerified && jsx(VerifiedBusinessCard, {
24097
+ verifiedBusiness
24098
+ }), jsxs("fieldset", {
24099
+ children: [showVerified && jsx(Typography, {
24100
+ el: "h3",
24101
+ children: i18n.get("otherBusinessInformation")
24102
+ }), showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
24103
+ className: "adyen-kyc-field-wrapper",
24104
+ children: jsx(LegalCompanyNameField, {
24105
+ data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
24106
+ valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
24107
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
24108
+ labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
24109
+ helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
24110
+ legalCompanyName: "legalCompanyName__helperText"
24111
+ }),
24112
+ readonly: formUtils.isReadOnly("legalCompanyName"),
24113
+ handleChangeFor
24114
+ })
24115
+ }), showField(DBA_NAME_FIELD) && jsx("div", {
24116
+ className: "adyen-kyc-field-wrapper",
24117
+ children: jsx(DBANameField, {
24118
+ data: formUtils.getFieldData(formData, DBA_NAME_FIELD),
24119
+ valid: formUtils.getFieldValid(formValid, DBA_NAME_FIELD),
24120
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DBA_NAME_FIELD),
24121
+ labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
24122
+ hasDba: "hasDba"
24123
+ }),
24124
+ readonly: formUtils.isReadOnly("dbaName"),
24125
+ handleChangeFor,
24126
+ setErrors
24127
+ })
24128
+ }), showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && jsx("div", {
24129
+ className: "adyen-kyc-field-wrapper",
24130
+ children: jsx(BusinessRegistrationNumberField, {
24131
+ data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
24132
+ valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
24133
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
24134
+ labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
24135
+ exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
24136
+ }),
24137
+ mask: formUtils.getMask("registrationNumber"),
24138
+ guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
24139
+ placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
24140
+ helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
24141
+ readonly: formUtils.isReadOnly("registrationNumber"),
24142
+ optional: formUtils.isOptionalField("registrationNumber"),
24143
+ shouldValidate,
24144
+ handleChangeFor,
24145
+ country,
24146
+ canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
24147
+ companyType,
24148
+ registrationNumberOptions,
24149
+ registrationNumberType,
24150
+ setRegistrationNumberType
24151
+ })
24152
+ }), showField(TAX_INFORMATION_FIELD) && jsx("div", {
24153
+ className: "adyen-kyc-field-wrapper",
24154
+ children: jsx(TaxInformationField, {
24155
+ data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
24156
+ valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
24157
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
24158
+ labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
24159
+ exemptedFromTax: "iDontHaveATaxId"
24160
+ }),
24161
+ mask: formUtils.getMask("taxInformation"),
24162
+ helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
24163
+ guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
24164
+ readonly: formUtils.isReadOnly("taxInformation"),
24165
+ shouldValidate,
24166
+ handleChangeFor,
24167
+ canExempt: formUtils.isRequiredField("exemptedFromTax"),
24168
+ isUen: formUtils.isRequiredField("isUen"),
24169
+ country,
24170
+ companyType,
24171
+ taxIdNumberType,
24172
+ setTaxIdNumberType,
24173
+ defaultData: data == null ? void 0 : data.taxInformation
24174
+ })
24175
+ }), showField(VAT_NUMBER_FIELD) && jsx("div", {
24176
+ className: "adyen-kyc-field-wrapper",
24177
+ children: jsx(VatNumberField, {
24178
+ data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
24179
+ valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
24180
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
24181
+ labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
24182
+ exemptedFromVat: "iDontHaveAVatNumber"
24183
+ }),
24184
+ mask: formUtils.getMask("vatNumber"),
24185
+ guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
24186
+ placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
24187
+ readonly: formUtils.isReadOnly("vatNumber"),
24188
+ handleChangeFor,
24189
+ country,
24190
+ canExempt: formUtils.isRequiredField("exemptedFromVat"),
24191
+ vatNumberType,
24192
+ setVatNumberType
24193
+ })
24194
+ }), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
24195
+ className: "adyen-kyc-field-wrapper",
24196
+ children: jsx(DateOfIncorporationField, {
24197
+ data: formUtils.getFieldData(formData, DATE_OF_INCORPORATION_FIELD),
24198
+ valid: formUtils.getFieldValid(formValid, DATE_OF_INCORPORATION_FIELD),
24199
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DATE_OF_INCORPORATION_FIELD),
24200
+ labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
24201
+ placeholders: formUtils.getFieldPlaceholders(DATE_OF_INCORPORATION_FIELD, {
24202
+ dateOfIncorporation: "datePlaceholder"
24203
+ }),
24204
+ readonly: formUtils.isReadOnly("dateOfIncorporation"),
24205
+ handleChangeFor
24206
+ })
24207
+ })]
24208
+ }), showStockData && jsxs("fieldset", {
24209
+ children: [jsx(Typography, {
24210
+ el: "h3",
24211
+ children: i18n.get("stockExchangeInformation")
24212
+ }), showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
24213
+ className: "adyen-kyc-field-wrapper",
24214
+ children: jsx(StockExchangeMICField, {
24215
+ data: formUtils.getFieldData(formData, STOCK_EXCHANGE_MIC_FIELD),
24216
+ valid: formUtils.getFieldValid(formValid, STOCK_EXCHANGE_MIC_FIELD),
24217
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_EXCHANGE_MIC_FIELD),
24218
+ labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
24219
+ placeholders: formUtils.getFieldPlaceholders(STOCK_EXCHANGE_MIC_FIELD),
24220
+ mask: formUtils.getMask("stockExchangeMIC"),
24221
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_EXCHANGE_MIC_FIELD),
24222
+ readonly: formUtils.isReadOnly("stockExchangeMIC"),
24223
+ shouldValidate,
24224
+ handleChangeFor
24225
+ })
24226
+ }), showField(STOCK_ISIN_FIELD) && jsx("div", {
24227
+ className: "adyen-kyc-field-wrapper",
24228
+ children: jsx(StockISINField, {
24229
+ data: formUtils.getFieldData(formData, STOCK_ISIN_FIELD),
24230
+ valid: formUtils.getFieldValid(formValid, STOCK_ISIN_FIELD),
24231
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_ISIN_FIELD),
24232
+ labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
24233
+ placeholders: formUtils.getFieldPlaceholders(STOCK_ISIN_FIELD),
24234
+ mask: formUtils.getMask("stockISIN"),
24235
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
24236
+ readonly: formUtils.isReadOnly("stockISIN"),
24237
+ shouldValidate,
24238
+ handleChangeFor
24239
+ })
24240
+ }), showField(STOCK_TICKER_SYMBOL_FIELD) && jsx("div", {
24241
+ className: "adyen-kyc-field-wrapper",
24242
+ children: jsx(StockTickerSymbolField, {
24243
+ data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
24244
+ valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
24245
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
24246
+ labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
24247
+ placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
24248
+ mask: formUtils.getMask("stockTickerSymbol"),
24249
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
24250
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
24251
+ shouldValidate,
24252
+ handleChangeFor
24253
+ })
24046
24254
  })]
24047
24255
  })]
24048
24256
  });
@@ -24121,7 +24329,7 @@ const defaultFieldConfig = {
24121
24329
  })
24122
24330
  };
24123
24331
  const BASIC_INFORMATION_FORM_ID = "basicInformation";
24124
- const basicInformationFields = [...COUNTRY_FIELD, ...BUSINESS_NAME_FIELD, ...TAX_INFORMATION_FIELD, ...STATE_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
24332
+ const BASIC_INFORMATION_FIELDS = [...COUNTRY_FIELD, ...BUSINESS_NAME_FIELD, ...TAX_INFORMATION_FIELD, ...STATE_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
24125
24333
  function BasicInformationComponent({
24126
24334
  data,
24127
24335
  labels: labels2,
@@ -24142,9 +24350,9 @@ function BasicInformationComponent({
24142
24350
  country,
24143
24351
  companyType = CompanyTypesValue.PRIVATE_COMPANY,
24144
24352
  isTopLevelEntity,
24145
- isBusinessSelection,
24146
24353
  setVerifiedBusiness,
24147
- searchName
24354
+ searchName,
24355
+ className
24148
24356
  }) {
24149
24357
  var _a, _b, _c, _d, _e;
24150
24358
  const {
@@ -24159,6 +24367,14 @@ function BasicInformationComponent({
24159
24367
  } = useSettingsContext();
24160
24368
  const allowedCountries = useAllowedCountries();
24161
24369
  const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
24370
+ const formDescription = jsxs("div", {
24371
+ className: "adyen-kyc-form-header__description",
24372
+ children: [description, " ", jsx(Link, {
24373
+ href: "https://www.adyen.com/privacy-policy",
24374
+ external: true,
24375
+ children: i18n.get("basicInformationFormDescriptionLink")
24376
+ })]
24377
+ });
24162
24378
  const initialFormUtilsProps = useMemo(() => ({
24163
24379
  labels: labels2,
24164
24380
  placeholders,
@@ -24196,16 +24412,16 @@ function BasicInformationComponent({
24196
24412
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country], {
24197
24413
  isBusiness: true
24198
24414
  }, defaultFieldMetadata), acc);
24415
+ case "taxInformation":
24416
+ return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country], {
24417
+ taxIdNumberType
24418
+ }, defaultFieldMetadata$6), acc);
24199
24419
  case "registrationNumber":
24200
24420
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$9[country], {
24201
24421
  companyType,
24202
24422
  registrationNumberType,
24203
24423
  state: sliceData == null ? void 0 : sliceData.stateOrProvince
24204
24424
  }, defaultFieldMetadata$9), acc);
24205
- case "taxInformation":
24206
- return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country], {
24207
- taxIdNumberType
24208
- }, defaultFieldMetadata$6), acc);
24209
24425
  default:
24210
24426
  return acc;
24211
24427
  }
@@ -24243,106 +24459,105 @@ function BasicInformationComponent({
24243
24459
  setVerifiedBusiness(void 0);
24244
24460
  }
24245
24461
  }, [formData.businessName, searchName, setVerifiedBusiness]);
24462
+ const classNames = cx("adyen-kyc-basic-information", className);
24246
24463
  return jsxs("form", {
24247
- className: isBusinessSelection ? "adyen-kyc-hide-form" : void 0,
24464
+ id: BASIC_INFORMATION_FORM_ID,
24465
+ className: classNames,
24248
24466
  children: [jsx(FormHeader, {
24249
24467
  heading,
24250
- description
24468
+ descriptionComponent: formDescription
24251
24469
  }), jsx(ErrorPanel, {
24252
24470
  id: "ariaErrorField",
24253
24471
  verificationErrors: formVerificationErrors,
24254
24472
  validationErrors: fieldValidationErrors,
24255
24473
  formUtils
24256
- }), jsxs("div", {
24257
- className: "adyen-kyc-basic-information",
24258
- children: [jsx("fieldset", {
24259
- children: jsx("div", {
24260
- className: "adyen-kyc-field-wrapper",
24261
- children: jsx(CountryField, {
24262
- data: formUtils.getFieldData(formData, COUNTRY_FIELD),
24263
- valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
24264
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
24265
- labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
24266
- country: "countryRegionOfEstablishment"
24267
- }),
24268
- readonly: formUtils.isReadOnly("country") || !isAllowedEditPrefilledCountry,
24269
- handleChangeFor,
24270
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0
24271
- })
24474
+ }), jsx("fieldset", {
24475
+ children: jsx("div", {
24476
+ className: "adyen-kyc-field-wrapper",
24477
+ children: jsx(CountryField, {
24478
+ data: formUtils.getFieldData(formData, COUNTRY_FIELD),
24479
+ valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
24480
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
24481
+ labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
24482
+ country: "countryRegionOfEstablishment"
24483
+ }),
24484
+ readonly: formUtils.isReadOnly("country") || !isAllowedEditPrefilledCountry,
24485
+ handleChangeFor,
24486
+ allowedCountries: isTopLevelEntity ? allowedCountries : void 0
24487
+ })
24488
+ })
24489
+ }), COUNTRIES_USING_COMPANY_SEARCH.includes(formData.country ?? country) && jsxs("fieldset", {
24490
+ children: [formUtils.isRequiredField("businessName") && jsx("div", {
24491
+ className: "adyen-kyc-field-wrapper",
24492
+ children: jsx(BusinessNameField, {
24493
+ data: formUtils.getFieldData(formData, BUSINESS_NAME_FIELD),
24494
+ valid: formUtils.getFieldValid(formValid, BUSINESS_NAME_FIELD),
24495
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_NAME_FIELD),
24496
+ labels: formUtils.getFieldLabels(BUSINESS_NAME_FIELD),
24497
+ readonly: formUtils.isReadOnly("businessName"),
24498
+ handleChangeFor
24499
+ })
24500
+ }), formUtils.isRequiredField("taxInformation") && jsx("div", {
24501
+ className: "adyen-kyc-field-wrapper",
24502
+ children: jsx(TaxInformationField, {
24503
+ data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
24504
+ valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
24505
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
24506
+ labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
24507
+ exemptedFromTax: "iDontHaveATaxId"
24508
+ }),
24509
+ mask: formUtils.getMask("taxInformation"),
24510
+ helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
24511
+ placeholders: formUtils.getFieldPlaceholders(TAX_INFORMATION_FIELD),
24512
+ guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
24513
+ readonly: formUtils.isReadOnly("taxInformation"),
24514
+ shouldValidate,
24515
+ handleChangeFor,
24516
+ canExempt: formUtils.isRequiredField("exemptedFromTax"),
24517
+ registrationNumber: formData.registrationNumber,
24518
+ isUen: formUtils.isRequiredField("isUen"),
24519
+ country: formData.country ?? country,
24520
+ companyType,
24521
+ taxIdNumberType,
24522
+ setTaxIdNumberType,
24523
+ defaultData: data == null ? void 0 : data.taxInformation
24524
+ })
24525
+ }), formUtils.isRequiredField("stateOrProvince") && jsx("div", {
24526
+ className: "adyen-kyc-field-wrapper",
24527
+ children: jsx(StateField, {
24528
+ data: formUtils.getFieldData(formData, STATE_FIELD),
24529
+ valid: formUtils.getFieldValid(formValid, STATE_FIELD),
24530
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STATE_FIELD),
24531
+ labels: formUtils.getFieldLabels(STATE_FIELD),
24532
+ placeholders: formUtils.getFieldPlaceholders(STATE_FIELD),
24533
+ readonly: formUtils.isReadOnly("stateOrProvince"),
24534
+ handleChangeFor,
24535
+ selectedCountry: formData.country
24536
+ })
24537
+ }), (formUtils.isRequiredField("registrationNumber") || formUtils.isOptionalField("registrationNumber")) && jsx("div", {
24538
+ className: "adyen-kyc-field-wrapper",
24539
+ children: jsx(BusinessRegistrationNumberField, {
24540
+ data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
24541
+ valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
24542
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
24543
+ labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
24544
+ exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
24545
+ }),
24546
+ mask: formUtils.getMask("registrationNumber"),
24547
+ guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
24548
+ placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
24549
+ helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
24550
+ readonly: formUtils.isReadOnly("registrationNumber"),
24551
+ optional: formUtils.isOptionalField("registrationNumber"),
24552
+ shouldValidate,
24553
+ handleChangeFor,
24554
+ country: formData.country ?? country,
24555
+ canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
24556
+ companyType,
24557
+ registrationNumberOptions,
24558
+ registrationNumberType,
24559
+ setRegistrationNumberType
24272
24560
  })
24273
- }), COUNTRIES_USING_COMPANY_SEARCH.includes(formData.country ?? country) && jsxs("fieldset", {
24274
- children: [formUtils.isRequiredField("businessName") && jsx("div", {
24275
- className: "adyen-kyc-field-wrapper",
24276
- children: jsx(BusinessNameField, {
24277
- data: formUtils.getFieldData(formData, BUSINESS_NAME_FIELD),
24278
- valid: formUtils.getFieldValid(formValid, BUSINESS_NAME_FIELD),
24279
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_NAME_FIELD),
24280
- labels: formUtils.getFieldLabels(BUSINESS_NAME_FIELD),
24281
- readonly: formUtils.isReadOnly("businessName"),
24282
- handleChangeFor
24283
- })
24284
- }), formUtils.isRequiredField("taxInformation") && jsx("div", {
24285
- className: "adyen-kyc-field-wrapper",
24286
- children: jsx(TaxInformationField, {
24287
- data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
24288
- valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
24289
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
24290
- labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
24291
- exemptedFromTax: "iDontHaveATaxId"
24292
- }),
24293
- mask: formUtils.getMask("taxInformation"),
24294
- helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
24295
- placeholders: formUtils.getFieldPlaceholders(TAX_INFORMATION_FIELD),
24296
- guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
24297
- readonly: formUtils.isReadOnly("taxInformation"),
24298
- shouldValidate,
24299
- handleChangeFor,
24300
- canExempt: formUtils.isRequiredField("exemptedFromTax"),
24301
- registrationNumber: formData.registrationNumber,
24302
- isUen: formUtils.isRequiredField("isUen"),
24303
- country: formData.country ?? country,
24304
- companyType,
24305
- taxIdNumberType,
24306
- setTaxIdNumberType,
24307
- defaultData: data == null ? void 0 : data.taxInformation
24308
- })
24309
- }), formUtils.isRequiredField("stateOrProvince") && jsx("div", {
24310
- className: "adyen-kyc-field-wrapper",
24311
- children: jsx(StateField, {
24312
- data: formUtils.getFieldData(formData, STATE_FIELD),
24313
- valid: formUtils.getFieldValid(formValid, STATE_FIELD),
24314
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STATE_FIELD),
24315
- labels: formUtils.getFieldLabels(STATE_FIELD),
24316
- placeholders: formUtils.getFieldPlaceholders(STATE_FIELD),
24317
- readonly: formUtils.isReadOnly("stateOrProvince"),
24318
- handleChangeFor,
24319
- selectedCountry: formData.country
24320
- })
24321
- }), (formUtils.isRequiredField("registrationNumber") || formUtils.isOptionalField("registrationNumber")) && jsx("div", {
24322
- className: "adyen-kyc-field-wrapper",
24323
- children: jsx(BusinessRegistrationNumberField, {
24324
- data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
24325
- valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
24326
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
24327
- labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
24328
- exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
24329
- }),
24330
- mask: formUtils.getMask("registrationNumber"),
24331
- guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
24332
- placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
24333
- helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
24334
- readonly: formUtils.isReadOnly("registrationNumber"),
24335
- optional: formUtils.isOptionalField("registrationNumber"),
24336
- shouldValidate,
24337
- handleChangeFor,
24338
- country: formData.country ?? country,
24339
- canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
24340
- companyType,
24341
- registrationNumberOptions,
24342
- registrationNumberType,
24343
- setRegistrationNumberType
24344
- })
24345
- })]
24346
24561
  })]
24347
24562
  })]
24348
24563
  });
@@ -24667,7 +24882,8 @@ const getForms = (country) => ({
24667
24882
  formId: "basicInformation",
24668
24883
  formName: "basicInformationFormName",
24669
24884
  formHeading: "basicInformationFormHeading",
24670
- fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? basicInformationFields : basicInformationFields.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field))
24885
+ formDescription: "basicInformationFormDescription",
24886
+ fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? BASIC_INFORMATION_FIELDS : BASIC_INFORMATION_FIELDS.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field))
24671
24887
  },
24672
24888
  companyStructure: {
24673
24889
  formId: "companyStructure",
@@ -24680,8 +24896,7 @@ const getForms = (country) => ({
24680
24896
  formId: "additionalInformation",
24681
24897
  formName: "additionalInformationFormName",
24682
24898
  formHeading: "additionalInformationFormHeading",
24683
- formDescription: "additionalInformationFormDescription",
24684
- fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? additionalInformationFields.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)) : additionalInformationFields
24899
+ fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? ADDITIONAL_INFORMATION_FIELDS.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)) : ADDITIONAL_INFORMATION_FIELDS
24685
24900
  },
24686
24901
  companyRegistrationAddress: {
24687
24902
  formId: "companyRegistrationAddress",
@@ -24830,7 +25045,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
24830
25045
  CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
24831
25046
  return CompanySearchEvents2;
24832
25047
  })(CompanySearchEvents || {});
24833
- const logger$q = createLogger("useCompanySearch");
25048
+ const logger$r = createLogger("useCompanySearch");
24834
25049
  const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
24835
25050
  function useCompanySearch({
24836
25051
  defaultData,
@@ -24954,7 +25169,7 @@ function useCompanySearch({
24954
25169
  state: companyData.state ?? stateOrProvince
24955
25170
  });
24956
25171
  } catch (e) {
24957
- logger$q.error(e);
25172
+ logger$r.error(e);
24958
25173
  setError(e);
24959
25174
  setStatus("error");
24960
25175
  } finally {
@@ -24987,7 +25202,7 @@ function useCompanySearch({
24987
25202
  indexSearch: handleCompanyIndexSearch,
24988
25203
  deepSearch: handleCompanyDeepSearch,
24989
25204
  resultsLimit: limit
24990
- })) == null ? void 0 : _a.catch((e) => logger$q.error(e));
25205
+ })) == null ? void 0 : _a.catch((e) => logger$r.error(e));
24991
25206
  }
24992
25207
  }, [legalCompanyName, country, stateOrProvince, taxIdentificationNumber, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
24993
25208
  useEffect(() => {
@@ -25094,38 +25309,47 @@ function BusinessInformation({
25094
25309
  const {
25095
25310
  i18n
25096
25311
  } = useI18nContext();
25097
- const businessInformationClass = cx("adyen-kyc-business-information", {
25098
- "adyen-kyc-business-information--loading": fetching
25312
+ const businessInformationClasses = cx("adyen-kyc-business-information", {
25313
+ "adyen-kyc-business-information--fetching": fetching
25099
25314
  });
25315
+ if (fetching) {
25316
+ return jsx("div", {
25317
+ className: businessInformationClasses,
25318
+ children: jsx(Loader, {
25319
+ size: "large"
25320
+ })
25321
+ });
25322
+ }
25100
25323
  return jsx("div", {
25101
- className: businessInformationClass,
25102
- children: fetching ? jsx(Loader, {
25103
- size: "large"
25104
- }) : jsxs("ul", {
25324
+ className: businessInformationClasses,
25325
+ children: jsxs("ul", {
25105
25326
  className: "adyen-kyc-business-information__business-data",
25106
- children: [(selectedBusiness == null ? void 0 : selectedBusiness.legalForm) && jsxs("li", {
25327
+ children: [!!(selectedBusiness == null ? void 0 : selectedBusiness.legalForm) && jsxs("li", {
25328
+ name: "legalForm",
25107
25329
  children: [jsx(Typography, {
25108
25330
  className: "adyen-kyc-business-data__key",
25109
25331
  color: "secondary",
25110
25332
  children: i18n.get("legalForm")
25111
25333
  }), jsx(Typography, {
25112
- children: selectedBusiness == null ? void 0 : selectedBusiness.legalForm
25334
+ children: selectedBusiness.legalForm
25113
25335
  })]
25114
- }), jsxs("li", {
25336
+ }), !!(selectedBusiness == null ? void 0 : selectedBusiness.name) && jsxs("li", {
25337
+ name: "name",
25115
25338
  children: [jsx(Typography, {
25116
25339
  className: "adyen-kyc-business-data__key",
25117
25340
  color: "secondary",
25118
25341
  children: i18n.get("legalCompanyName__US")
25119
25342
  }), jsx(Typography, {
25120
- children: selectedBusiness == null ? void 0 : selectedBusiness.name
25343
+ children: selectedBusiness.name
25121
25344
  })]
25122
- }), (selectedBusiness == null ? void 0 : selectedBusiness.address) && jsxs("li", {
25345
+ }), !!(selectedBusiness == null ? void 0 : selectedBusiness.address) && jsxs("li", {
25346
+ name: "address",
25123
25347
  children: [jsx(Typography, {
25124
25348
  className: "adyen-kyc-business-data__key",
25125
25349
  color: "secondary",
25126
25350
  children: i18n.get("address")
25127
25351
  }), jsx(Typography, {
25128
- children: selectedBusiness == null ? void 0 : selectedBusiness.address
25352
+ children: selectedBusiness.address
25129
25353
  })]
25130
25354
  })]
25131
25355
  })
@@ -25163,7 +25387,7 @@ function BusinessInformationCard({
25163
25387
  children: selectedBusinessId === result.id && jsxs(Fragment, {
25164
25388
  children: [jsx(Divider, {}), invalidTin && jsx(Alert, {
25165
25389
  variant: "warning",
25166
- type: "dismissible",
25390
+ type: "callToAction",
25167
25391
  title: i18n.get("businessSelection__invalidTin"),
25168
25392
  actions: jsx(Button, {
25169
25393
  label: "Go back",
@@ -25174,7 +25398,7 @@ function BusinessInformationCard({
25174
25398
  testId: "invalidTin"
25175
25399
  }), failedToLoad && jsx(Alert, {
25176
25400
  variant: "info",
25177
- type: "dismissible",
25401
+ type: "callToAction",
25178
25402
  title: i18n.get("businessSelection__failedToLoad"),
25179
25403
  actions: jsx(Button, {
25180
25404
  label: "Try again",
@@ -25190,7 +25414,7 @@ function BusinessInformationCard({
25190
25414
  })
25191
25415
  });
25192
25416
  }
25193
- const logger$p = createLogger("BusinessSelection");
25417
+ const logger$q = createLogger("BusinessSelection");
25194
25418
  function BusinessSelectionComponent({
25195
25419
  country,
25196
25420
  state,
@@ -25257,7 +25481,7 @@ function BusinessSelectionComponent({
25257
25481
  setCurrentBusinessSelection(businessData);
25258
25482
  } catch (e) {
25259
25483
  setFailedToLoad(true);
25260
- logger$p.error(e);
25484
+ logger$q.error(e);
25261
25485
  } finally {
25262
25486
  setFetching(false);
25263
25487
  }
@@ -25279,7 +25503,7 @@ function BusinessSelectionComponent({
25279
25503
  setInvalidTin(true);
25280
25504
  }
25281
25505
  } catch (e) {
25282
- logger$p.error(e);
25506
+ logger$q.error(e);
25283
25507
  } finally {
25284
25508
  setIsLoading(false);
25285
25509
  }
@@ -25312,7 +25536,7 @@ function BusinessSelectionComponent({
25312
25536
  }
25313
25537
  }
25314
25538
  } catch (e) {
25315
- logger$p.error(e);
25539
+ logger$q.error(e);
25316
25540
  } finally {
25317
25541
  setIsLoading(false);
25318
25542
  }
@@ -25322,23 +25546,26 @@ function BusinessSelectionComponent({
25322
25546
  setIsLoading(true);
25323
25547
  await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
25324
25548
  } catch (e) {
25325
- logger$p.error(e);
25549
+ logger$q.error(e);
25326
25550
  } finally {
25327
25551
  setShowCompanyStructure(true);
25328
25552
  setIsLoading(false);
25329
25553
  }
25330
25554
  }, [handleClearCompanyData, setIsLoading, setShowCompanyStructure]);
25331
- return jsxs("div", {
25332
- className: "adyen-kyc-business-selection",
25333
- children: [isLoading && jsxs("div", {
25334
- className: "adyen-kyc-business-selection__loader",
25335
- children: [jsx(Loader, {
25555
+ const businessSelectionClasses = cx("adyen-kyc-business-selection", {
25556
+ "adyen-kyc-business-selection--loading": isLoading
25557
+ });
25558
+ if (isLoading) {
25559
+ return jsx("div", {
25560
+ className: businessSelectionClasses,
25561
+ children: jsx(Loader, {
25336
25562
  size: "large"
25337
- }), jsx(Typography, {
25338
- el: "span",
25339
- children: !currentBusinessSelection && (!searchResults || shouldSearch) ? i18n.get("businessSelection__searching") : i18n.get("businessSelection__verifying")
25340
- })]
25341
- }), !isLoading && searchResults && jsxs(Fragment, {
25563
+ })
25564
+ });
25565
+ }
25566
+ return jsx("div", {
25567
+ className: businessSelectionClasses,
25568
+ children: searchResults && jsxs(Fragment, {
25342
25569
  children: [jsx(FormHeader, {
25343
25570
  heading: i18n.get("businessSelection__heading")
25344
25571
  }), jsxs(CardGroup, {
@@ -25365,7 +25592,7 @@ function BusinessSelectionComponent({
25365
25592
  })]
25366
25593
  })]
25367
25594
  })]
25368
- })]
25595
+ })
25369
25596
  });
25370
25597
  }
25371
25598
  function BusinessDetailsComponent(props) {
@@ -25460,6 +25687,7 @@ function BusinessDetailsComponent(props) {
25460
25687
  handleClearCompanyData
25461
25688
  }), jsx(BasicInformationComponent, {
25462
25689
  ...getFormProps(props, forms2.basicInformation.formId),
25690
+ className: isBusinessSelection ? "adyen-kyc-basic-information--hide" : "",
25463
25691
  id: forms2.basicInformation.formId,
25464
25692
  heading: i18n.get((activeForm == null ? void 0 : activeForm.formHeading) ?? forms2.basicInformation.formHeading),
25465
25693
  description: (activeForm == null ? void 0 : activeForm.formDescription) ? i18n.get(activeForm == null ? void 0 : activeForm.formDescription) : void 0,
@@ -25467,7 +25695,6 @@ function BusinessDetailsComponent(props) {
25467
25695
  companyType: companyStructure == null ? void 0 : companyStructure.entityType,
25468
25696
  isTopLevelEntity,
25469
25697
  baseTrackingPayload,
25470
- isBusinessSelection,
25471
25698
  setVerifiedBusiness,
25472
25699
  searchName
25473
25700
  })]
@@ -25488,7 +25715,6 @@ function BusinessDetailsComponent(props) {
25488
25715
  ...getFormProps(props, forms2.additionalInformation.formId),
25489
25716
  id: forms2.additionalInformation.formId,
25490
25717
  heading: i18n.get((activeForm == null ? void 0 : activeForm.formHeading) ?? forms2.additionalInformation.formHeading),
25491
- description: i18n.get((activeForm == null ? void 0 : activeForm.formDescription) ?? forms2.additionalInformation.formDescription),
25492
25718
  country,
25493
25719
  companyType: companyStructure == null ? void 0 : companyStructure.entityType,
25494
25720
  verifiedBusiness,
@@ -25733,7 +25959,7 @@ const ExpiredBanner = () => {
25733
25959
  children: i18n.get("startANewSessionFromTheSamePlaceYouOriginallyAccessed")
25734
25960
  });
25735
25961
  };
25736
- const Modal = ({
25962
+ const Modal$1 = ({
25737
25963
  content,
25738
25964
  footer,
25739
25965
  header,
@@ -25865,7 +26091,7 @@ const ExpiryModal = ({
25865
26091
  leftoverSeconds
25866
26092
  } = getDurationInMinutesAndSeconds(secondsUntilExpiry);
25867
26093
  const hasExpired = secondsUntilExpiry <= 0;
25868
- return jsx(Modal, {
26094
+ return jsx(Modal$1, {
25869
26095
  size: "small",
25870
26096
  header: i18n.get("sessionTimeout"),
25871
26097
  content: hasExpired ? i18n.get("toProtectYourInformationThisSessionHasExpired") : i18n.get({
@@ -25938,7 +26164,7 @@ const useExpiryThreshold = (expiry) => {
25938
26164
  };
25939
26165
  };
25940
26166
  const ExpiryContext = createContext(false);
25941
- const logger$o = createLogger("ExpiryProvider");
26167
+ const logger$p = createLogger("ExpiryProvider");
25942
26168
  const ExpiryProvider = ({
25943
26169
  expiry: initialExpiry,
25944
26170
  eventEmitter,
@@ -25972,7 +26198,7 @@ const ExpiryProvider = ({
25972
26198
  refreshExpiry().then((newExpiry) => {
25973
26199
  setExpiry(newExpiry);
25974
26200
  setModalDismissed(false);
25975
- }).catch(logger$o.error);
26201
+ }).catch(logger$p.error);
25976
26202
  }
25977
26203
  }), children]
25978
26204
  });
@@ -25992,7 +26218,7 @@ const ExpiryProvider = ({
25992
26218
  });
25993
26219
  };
25994
26220
  const useHasExpired = () => useContext(ExpiryContext);
25995
- const logger$n = createLogger("FormRouterContextProvider");
26221
+ const logger$o = createLogger("FormRouterContextProvider");
25996
26222
  function FormRouterContextProvider({
25997
26223
  children,
25998
26224
  forms: forms2,
@@ -26012,7 +26238,7 @@ function FormRouterContextProvider({
26012
26238
  if (formIndex > -1) {
26013
26239
  setFormIndex(formIndex);
26014
26240
  } else {
26015
- logger$n.error("No form was found to have that field so form navigation failed.");
26241
+ logger$o.error("No form was found to have that field so form navigation failed.");
26016
26242
  }
26017
26243
  }
26018
26244
  }), [forms2, handleGetIdVerificationToken, setFormIndex]);
@@ -26021,25 +26247,151 @@ function FormRouterContextProvider({
26021
26247
  children
26022
26248
  });
26023
26249
  }
26024
- const DropinLayout = (props) => {
26025
- const {
26026
- content,
26027
- footer
26028
- } = props;
26029
- return jsxs("div", {
26030
- className: "adyen-kyc-dropin",
26031
- children: [jsx("div", {
26032
- className: "adyen-kyc-dropin__content",
26250
+ const shouldHighlight = (active, current, fillBefore) => !fillBefore ? active === current : active >= current;
26251
+ const StepProgressIndicator = ({
26252
+ activeStepIndex,
26253
+ stepsCount,
26254
+ fillBefore,
26255
+ thick
26256
+ }) => stepsCount > 0 ? jsx("div", {
26257
+ "aria-label": `Step ${activeStepIndex + 1} of ${stepsCount}`,
26258
+ className: "adyen-kyc-progress",
26259
+ role: "group",
26260
+ children: jsx("ol", {
26261
+ className: cx("adyen-kyc-progress__bar", {
26262
+ "adyen-kyc-progress__bar--thick": thick
26263
+ }),
26264
+ children: range(stepsCount).map((stepNumber) => {
26265
+ const isHighlighted = shouldHighlight(activeStepIndex, stepNumber, fillBefore);
26266
+ return jsx("li", {
26267
+ "aria-current": isHighlighted ? "step" : void 0,
26268
+ className: cx("adyen-kyc-progress__step", {
26269
+ "adyen-kyc-progress__step--active": isHighlighted
26270
+ }),
26271
+ children: jsx("span", {
26272
+ className: "adyen-kyc-progress__step-label",
26273
+ children: `Step ${stepNumber + 1}: ${stepNumber < activeStepIndex ? "completed" : "not completed"}`
26274
+ })
26275
+ }, stepNumber);
26276
+ })
26277
+ })
26278
+ }) : null;
26279
+ const Modal = ({
26280
+ title,
26281
+ children,
26282
+ footer,
26283
+ fullscreen = false,
26284
+ onBack,
26285
+ onClose
26286
+ }) => {
26287
+ const modalRef = useRef(null);
26288
+ useLayoutEffect(() => {
26289
+ const modalElement = modalRef.current;
26290
+ if (!modalElement) return;
26291
+ modalElement.showModal();
26292
+ modalElement.focus();
26293
+ modalElement.blur();
26294
+ return () => modalElement.close();
26295
+ }, []);
26296
+ return jsx("dialog", {
26297
+ ref: modalRef,
26298
+ className: cx("adyen-kyc-modal2", {
26299
+ "adyen-kyc-modal2__fullscreen": fullscreen
26300
+ }),
26301
+ onClose,
26302
+ children: jsxs("div", {
26303
+ className: "adyen-kyc-modal2-wrapper",
26304
+ children: [title && jsx("header", {
26305
+ children: jsx(Typography, {
26306
+ el: "h2",
26307
+ variant: "title-l",
26308
+ children: title
26309
+ })
26310
+ }), jsx("section", {
26311
+ className: "adyen-kyc-modal2-content",
26312
+ children
26313
+ }), jsx("div", {
26314
+ children: footer && jsx("footer", {
26315
+ className: "adyen-kyc-modal2-footer",
26316
+ children: footer
26317
+ })
26318
+ }), jsxs("section", {
26319
+ className: "adyen-kyc-modal2-top-bar",
26320
+ children: [onBack ? jsx(Button, {
26321
+ tertiary: true,
26322
+ "aria-label": "back",
26323
+ icon: "arrow-left",
26324
+ onClick: onBack,
26325
+ shaded: true
26326
+ }) : jsx("div", {}), jsx(Button, {
26327
+ tertiary: true,
26328
+ "aria-label": "close",
26329
+ icon: "cross",
26330
+ onClick: onClose,
26331
+ shaded: true
26332
+ })]
26333
+ })]
26334
+ })
26335
+ });
26336
+ };
26337
+ const DropinLayout = ({
26338
+ content,
26339
+ footer,
26340
+ showAsModal,
26341
+ onBack,
26342
+ onClose
26343
+ }) => {
26344
+ const [modalOpen, setModalOpen] = useState(true);
26345
+ const handleClose = () => {
26346
+ setModalOpen(false);
26347
+ onClose == null ? void 0 : onClose();
26348
+ };
26349
+ if (!showAsModal) {
26350
+ return jsxs("div", {
26351
+ className: "adyen-kyc-dropin",
26352
+ children: [jsx("div", {
26353
+ className: "adyen-kyc-dropin__content",
26354
+ children: jsx("div", {
26355
+ className: "adyen-kyc-dropin__content-main",
26356
+ children: content
26357
+ })
26358
+ }), footer && jsx("div", {
26359
+ className: "adyen-kyc-dropin__footer-container",
26360
+ children: footer
26361
+ })]
26362
+ });
26363
+ }
26364
+ if (modalOpen) {
26365
+ return jsx(Modal, {
26366
+ footer,
26367
+ onClose: handleClose,
26368
+ onBack,
26033
26369
  children: jsx("div", {
26034
- className: "adyen-kyc-dropin__content-main",
26035
- children: content
26370
+ className: "adyen-kyc-dropin",
26371
+ children: jsx("div", {
26372
+ className: "adyen-kyc-dropin__content",
26373
+ children: jsx("div", {
26374
+ className: "adyen-kyc-dropin__content-main",
26375
+ children: content
26376
+ })
26377
+ })
26036
26378
  })
26037
- }), footer && jsx("div", {
26038
- className: "adyen-kyc-dropin__footer-container",
26039
- children: footer
26040
- })]
26041
- });
26379
+ });
26380
+ }
26381
+ return null;
26042
26382
  };
26383
+ const EmbeddedActionBar = ({
26384
+ left,
26385
+ right
26386
+ }) => jsxs("footer", {
26387
+ className: "adyen-kyc-embedded-action-bar",
26388
+ children: [jsx("section", {
26389
+ children: left
26390
+ }), jsx("section", {
26391
+ className: "adyen-kyc-embedded-action-bar-right",
26392
+ children: right
26393
+ })]
26394
+ });
26043
26395
  const FormNavigationItem = ({
26044
26396
  form,
26045
26397
  isActive,
@@ -26136,6 +26488,7 @@ const FormWrapper = ({
26136
26488
  handleNextClick,
26137
26489
  handleBackClick,
26138
26490
  handleHomeClick,
26491
+ handleCloseClick,
26139
26492
  nextButtonLabel,
26140
26493
  backButtonLabel,
26141
26494
  homeButtonLabel,
@@ -26152,9 +26505,11 @@ const FormWrapper = ({
26152
26505
  hideBackButton,
26153
26506
  hideNextButton,
26154
26507
  hideNavigation,
26508
+ asModal,
26155
26509
  canSubmit: canSubmit2,
26156
26510
  onSubmit,
26157
- problems
26511
+ problems,
26512
+ currentStep
26158
26513
  }) => {
26159
26514
  var _a;
26160
26515
  const {
@@ -26199,6 +26554,8 @@ const FormWrapper = ({
26199
26554
  showTaxExemptedLegalCaption
26200
26555
  })
26201
26556
  });
26557
+ const handleFinishLater = () => {
26558
+ };
26202
26559
  const formFooter = !hideDropinLayout && !hideFooter && jsx(ActionBar, {
26203
26560
  onNext: handleNextClick,
26204
26561
  onBack: handleBackClick,
@@ -26210,6 +26567,25 @@ const FormWrapper = ({
26210
26567
  hideBackButton,
26211
26568
  hideNextButton
26212
26569
  });
26570
+ const embeddedFooter = jsx(EmbeddedActionBar, {
26571
+ left: jsx(StepProgressIndicator, {
26572
+ activeStepIndex: currentStep ?? 0,
26573
+ stepsCount: 3,
26574
+ fillBefore: true,
26575
+ thick: true
26576
+ }),
26577
+ right: jsxs(Fragment, {
26578
+ children: [!hideBackButton && jsx(Button, {
26579
+ label: "Finish Later",
26580
+ secondary: true,
26581
+ icon: "save",
26582
+ onClick: handleFinishLater
26583
+ }), jsx(Button, {
26584
+ label: nextButtonLabel,
26585
+ onClick: handleNextClick
26586
+ })]
26587
+ })
26588
+ });
26213
26589
  const multiStepForm = jsxs("div", {
26214
26590
  className: "adyen-kyc-form-container",
26215
26591
  children: [hasExpired && jsx(ExpiredBanner, {}), jsx(LoaderWrapper, {
@@ -26220,7 +26596,7 @@ const FormWrapper = ({
26220
26596
  setFormIndex: gotoFormByFormIndex,
26221
26597
  forms: forms2,
26222
26598
  handleGetIdVerificationToken,
26223
- children: [children, activeForm.formId === summaryStep.formId && summaryContent, formFooter]
26599
+ children: [children, activeForm.formId === summaryStep.formId && summaryContent]
26224
26600
  })
26225
26601
  })]
26226
26602
  });
@@ -26249,11 +26625,19 @@ const FormWrapper = ({
26249
26625
  verificationErrors: problems == null ? void 0 : problems.verificationErrors
26250
26626
  })
26251
26627
  });
26252
- return jsx(DropinLayout, {
26253
- content: jsxs(Fragment, {
26254
- children: [sidebar, multiStepForm]
26255
- })
26256
- });
26628
+ const footer = hideNavigation ? embeddedFooter : formFooter;
26629
+ return jsx(
26630
+ DropinLayout,
26631
+ {
26632
+ showAsModal: asModal,
26633
+ onBack: !hideBackButton ? handleBackClick : void 0,
26634
+ onClose: handleCloseClick,
26635
+ content: jsxs(Fragment, {
26636
+ children: [sidebar, multiStepForm]
26637
+ }),
26638
+ footer: footer || void 0
26639
+ }
26640
+ );
26257
26641
  };
26258
26642
  var BusinessDetailsEvents = /* @__PURE__ */ ((BusinessDetailsEvents2) => {
26259
26643
  BusinessDetailsEvents2["TASK_START"] = "BusinessDetails_TaskStarted";
@@ -26382,7 +26766,7 @@ const removeConditionalForms = (forms2, problems, isSkippingCompanyStructure, is
26382
26766
  }
26383
26767
  };
26384
26768
  const formatBasicInformation = (data, labels2, datasetUtils, companyType) => {
26385
- var _a, _b, _c, _d;
26769
+ var _a, _b, _c;
26386
26770
  const country = data == null ? void 0 : data.country;
26387
26771
  const registrationNumberLabel = resolveFieldMetadata(defaultFieldConfig$9[country], {
26388
26772
  companyType,
@@ -26394,9 +26778,9 @@ const formatBasicInformation = (data, labels2, datasetUtils, companyType) => {
26394
26778
  companyType: void 0
26395
26779
  }, defaultFieldMetadata$6).label;
26396
26780
  return {
26397
- [((_b = labels2 == null ? void 0 : labels2.basicInformation) == null ? void 0 : _b.country) ?? "country"]: datasetUtils.getCountryName(data.country),
26781
+ country: datasetUtils.getCountryName(data.country),
26398
26782
  [getKeyForField("stateOrProvince", data.country)]: datasetUtils.getStateName(data.stateOrProvince, data.country),
26399
- [taxIdLabel]: (_d = (_c = data.taxInformation) == null ? void 0 : _c.find((taxId) => data.country === taxId.country)) == null ? void 0 : _d.number,
26783
+ [taxIdLabel]: (_c = (_b = data.taxInformation) == null ? void 0 : _b.find((taxId) => data.country === taxId.country)) == null ? void 0 : _c.number,
26400
26784
  [registrationNumberLabel]: data.registrationNumber
26401
26785
  };
26402
26786
  };
@@ -26644,7 +27028,7 @@ function BusinessDetailsDropinComponent({
26644
27028
  handleClearCompanyData,
26645
27029
  onTypeSwitch
26646
27030
  }) {
26647
- var _a, _b, _c, _d, _e, _f, _g;
27031
+ var _a, _b, _c, _d, _e, _f, _g, _h;
26648
27032
  const {
26649
27033
  state: {
26650
27034
  currentState
@@ -26736,7 +27120,7 @@ function BusinessDetailsDropinComponent({
26736
27120
  const forms2 = useMemo(() => {
26737
27121
  const requiredForms = getRequiredForms(initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
26738
27122
  const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, currentProblems);
26739
- return removeConditionalForms(validityAddedForms, currentProblems, currentCountry !== "US" && isSkippingCompanyStructure || !showCompanyStructure, isSkippingCompanyRegistrationDocument);
27123
+ return removeConditionalForms(validityAddedForms, currentProblems, currentCountry !== "US" ? isSkippingCompanyStructure : !showCompanyStructure, isSkippingCompanyRegistrationDocument);
26740
27124
  }, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure, isSkippingCompanyRegistrationDocument]);
26741
27125
  const canSubmitForm = useMemo(() => canSubmit$3(currentState.data) && hasDataChanged(initialData, currentState.data), [initialData, currentState.data]);
26742
27126
  const summaryData = useMemo(() => ({
@@ -26812,17 +27196,21 @@ function BusinessDetailsDropinComponent({
26812
27196
  }
26813
27197
  }, [canSubmitForm, currentCountry, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, showCompanyStructure, verifiedBusiness]);
26814
27198
  const nextClick = useCallback(() => {
27199
+ var _a2;
26815
27200
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
26816
27201
  switch (activeForm.formId) {
26817
27202
  case "basicInformation":
26818
27203
  if (showCompanyStructure || verifiedBusiness) {
26819
27204
  return handleNextClick();
26820
27205
  }
26821
- return isBusinessSelection ? handleNextClick() : setIsBusinessSelection(true);
27206
+ if (!isBusinessSelection && ((_a2 = currentState.validityByForm) == null ? void 0 : _a2.basicInformation)) {
27207
+ return setIsBusinessSelection(true);
27208
+ }
27209
+ return handleNextClick();
26822
27210
  default:
26823
27211
  return handleNextClick();
26824
27212
  }
26825
- }, [activeForm.formId, currentCountry, handleNextClick, isBusinessSelection, showCompanyStructure, verifiedBusiness]);
27213
+ }, [activeForm.formId, currentCountry, handleNextClick, isBusinessSelection, showCompanyStructure, verifiedBusiness, (_h = currentState.validityByForm) == null ? void 0 : _h.basicInformation]);
26826
27214
  const backClick = useCallback(() => {
26827
27215
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleNextClick();
26828
27216
  switch (activeForm.formId) {
@@ -27567,7 +27955,7 @@ const CompanyLookupResultsList = ({
27567
27955
  }, option.id))
27568
27956
  });
27569
27957
  };
27570
- const Skeleton = ({
27958
+ const Skeleton$1 = ({
27571
27959
  quantity
27572
27960
  }) => {
27573
27961
  const renderBones = () => {
@@ -27691,7 +28079,7 @@ function CompanyLookup({
27691
28079
  verifiedCompany,
27692
28080
  reset: resetSelection,
27693
28081
  retrySearch
27694
- }), displaySkeleton && jsx(Skeleton, {
28082
+ }), displaySkeleton && jsx(Skeleton$1, {
27695
28083
  quantity: 3
27696
28084
  }), displaySearchResults && jsx(CompanyLookupResultsList, {
27697
28085
  results,
@@ -28332,7 +28720,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
28332
28720
  }
28333
28721
  }, {});
28334
28722
  };
28335
- const logger$m = createLogger("useFormTaskSubmit");
28723
+ const logger$n = createLogger("useFormTaskSubmit");
28336
28724
  function useCompanySearchTaskSubmit({
28337
28725
  task,
28338
28726
  forms: forms2,
@@ -28375,7 +28763,7 @@ function useCompanySearchTaskSubmit({
28375
28763
  });
28376
28764
  }
28377
28765
  } catch (e) {
28378
- logger$m.error(e);
28766
+ logger$n.error(e);
28379
28767
  userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
28380
28768
  segmentation: {
28381
28769
  ...baseTrackingPayload,
@@ -28427,7 +28815,7 @@ function useCompanySearchTaskSubmit({
28427
28815
  ...trackingPayload
28428
28816
  }
28429
28817
  });
28430
- logger$m.log(submittedLegalEntity);
28818
+ logger$n.log(submittedLegalEntity);
28431
28819
  clearToasts();
28432
28820
  onExternalSubmit == null ? void 0 : onExternalSubmit(data);
28433
28821
  } catch (e) {
@@ -28451,7 +28839,7 @@ function useCompanySearchTaskSubmit({
28451
28839
  type: "error"
28452
28840
  });
28453
28841
  }
28454
- logger$m.error(e);
28842
+ logger$n.error(e);
28455
28843
  userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
28456
28844
  segmentation: {
28457
28845
  ...baseTrackingPayload,
@@ -28812,7 +29200,7 @@ function CompanySearchDropinComponent({
28812
29200
  }
28813
29201
  const IgnoreLocalStorageContext = createContext(false);
28814
29202
  const useIgnoreLocalStorage = () => useContext(IgnoreLocalStorageContext);
28815
- const logger$l = createLogger("useLocalStorage");
29203
+ const logger$m = createLogger("useLocalStorage");
28816
29204
  const useLocalStorage = (key, defaultValue, options) => {
28817
29205
  const {
28818
29206
  serializer,
@@ -28833,7 +29221,7 @@ const useLocalStorage = (key, defaultValue, options) => {
28833
29221
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
28834
29222
  return res;
28835
29223
  } catch (err) {
28836
- logger$l.error(err);
29224
+ logger$m.error(err);
28837
29225
  return defaultValue;
28838
29226
  }
28839
29227
  });
@@ -28864,7 +29252,7 @@ const useLocalStorage = (key, defaultValue, options) => {
28864
29252
  try {
28865
29253
  updateLocalStorage();
28866
29254
  } catch (err) {
28867
- logger$l.error(err);
29255
+ logger$m.error(err);
28868
29256
  }
28869
29257
  }, [value, ignoreLocalStorage]);
28870
29258
  useEffect(() => {
@@ -28877,7 +29265,7 @@ const useLocalStorage = (key, defaultValue, options) => {
28877
29265
  setValue(event.newValue ? parser(event.newValue) : void 0);
28878
29266
  }
28879
29267
  } catch (err) {
28880
- logger$l.error(err);
29268
+ logger$m.error(err);
28881
29269
  }
28882
29270
  };
28883
29271
  if (ignoreLocalStorage) return;
@@ -29024,7 +29412,7 @@ const useSingpassMyInfoLogin = ({
29024
29412
  trustedFields: trustedFields$1
29025
29413
  };
29026
29414
  };
29027
- const logger$k = createLogger("useAssociatedLegalArrangement");
29415
+ const logger$l = createLogger("useAssociatedLegalArrangement");
29028
29416
  function useAssociatedLegalArrangement({
29029
29417
  rootLegalEntity,
29030
29418
  getLegalEntity: getLegalEntity2
@@ -29035,7 +29423,7 @@ function useAssociatedLegalArrangement({
29035
29423
  var _a;
29036
29424
  const foundEntity = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST);
29037
29425
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
29038
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$k.error);
29426
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$l.error);
29039
29427
  }
29040
29428
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
29041
29429
  useEffect(() => {
@@ -29092,7 +29480,7 @@ const useCanSeeEntitySelection = (legalEntityId) => {
29092
29480
  setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
29093
29481
  };
29094
29482
  };
29095
- const logger$j = createLogger("useExemptSettlor");
29483
+ const logger$k = createLogger("useExemptSettlor");
29096
29484
  const useExemptSettlor = ({
29097
29485
  trust,
29098
29486
  handleGetLegalEntity
@@ -29105,10 +29493,29 @@ const useExemptSettlor = ({
29105
29493
  }, [handleGetLegalEntity]);
29106
29494
  useEffect(() => {
29107
29495
  if (!(trust == null ? void 0 : trust.trust)) return;
29108
- updateExemptSettlor(trust).catch(logger$j.error);
29496
+ updateExemptSettlor(trust).catch(logger$k.error);
29109
29497
  }, [trust, updateExemptSettlor]);
29110
29498
  return exemptSettlor;
29111
29499
  };
29500
+ const usePolling = ({
29501
+ poller,
29502
+ pollingInterval,
29503
+ onNewValueReceived,
29504
+ skip,
29505
+ immediate = false
29506
+ }) => {
29507
+ useEffect(() => {
29508
+ if (skip) return;
29509
+ const pollAndProvideNewValue = () => {
29510
+ poller().then((newValue) => onNewValueReceived(newValue)).catch((err) => console.error(err));
29511
+ };
29512
+ if (immediate) {
29513
+ pollAndProvideNewValue();
29514
+ }
29515
+ const timeoutId = setInterval(pollAndProvideNewValue, pollingInterval);
29516
+ return () => clearInterval(timeoutId);
29517
+ }, [onNewValueReceived, poller, pollingInterval, skip, immediate]);
29518
+ };
29112
29519
  function useSalesChannelsSettings() {
29113
29520
  const {
29114
29521
  isSettingEnabled
@@ -30602,35 +31009,6 @@ const useIntroductionScreens = ({
30602
31009
  }) : [], [legalEntityType, tasks]);
30603
31010
  return canSeeIntroduction && (introductionScreens == null ? void 0 : introductionScreens.length) > 0 ? [IntroductionScreens.PROLOGUE, ...introductionScreens, IntroductionScreens.EPILOGUE] : void 0;
30604
31011
  };
30605
- const shouldHighlight = (active, current, fillBefore) => !fillBefore ? active === current : active >= current;
30606
- const StepProgressIndicator = ({
30607
- activeStepIndex,
30608
- stepsCount,
30609
- fillBefore,
30610
- thick
30611
- }) => stepsCount > 0 ? jsx("div", {
30612
- "aria-label": `Step ${activeStepIndex + 1} of ${stepsCount}`,
30613
- className: "adyen-kyc-progress",
30614
- role: "group",
30615
- children: jsx("ol", {
30616
- className: cx("adyen-kyc-progress__bar", {
30617
- "adyen-kyc-progress__bar--thick": thick
30618
- }),
30619
- children: range(stepsCount).map((stepNumber) => {
30620
- const isHighlighted = shouldHighlight(activeStepIndex, stepNumber, fillBefore);
30621
- return jsx("li", {
30622
- "aria-current": isHighlighted ? "step" : void 0,
30623
- className: cx("adyen-kyc-progress__step", {
30624
- "adyen-kyc-progress__step--active": isHighlighted
30625
- }),
30626
- children: jsx("span", {
30627
- className: "adyen-kyc-progress__step-label",
30628
- children: `Step ${stepNumber + 1}: ${stepNumber < activeStepIndex ? "completed" : "not completed"}`
30629
- })
30630
- }, stepNumber);
30631
- })
30632
- })
30633
- }) : null;
30634
31012
  const toCapitalized = (s) => `${s[0].toUpperCase()}${s.slice(1).toLowerCase()}`;
30635
31013
  const toPascalCase = (s) => s.split(/[^A-Za-z]/).map((word) => toCapitalized(word)).join("");
30636
31014
  var IntroductionScreenTranslationKeyElements = /* @__PURE__ */ ((IntroductionScreenTranslationKeyElements2) => {
@@ -30928,10 +31306,14 @@ function ReviewComponent({
30928
31306
  footer
30929
31307
  });
30930
31308
  }
30931
- const SvgSingpassLogo = (props) => /* @__PURE__ */ jsxs$1("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 93 16", ...props, children: [
31309
+ const SvgSingpassLogo = (props) => /* @__PURE__ */ jsxs$1("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 93 16", role: "img", ...props, children: [
30932
31310
  /* @__PURE__ */ jsx$1("path", { fill: "#F4333D", d: "M5.88 11.8c-2.54 0-4.34-.85-5.13-1.57l1.69-2.48a5.5 5.5 0 0 0 3.44 1.36c.92 0 1.33-.27 1.33-.77 0-.38-.32-.68-1.3-.9l-2-.47c-1.96-.46-2.89-1.65-2.89-3.3C1.02 1.42 2.82.1 5.5.1c2.07 0 3.73.63 4.54 1.35L8.35 3.92A4.5 4.5 0 0 0 5.5 2.75c-.86 0-1.24.3-1.24.74 0 .45.4.7 1.17.88l2 .45c2.05.45 3.04 1.56 3.04 3.18 0 2.32-1.73 3.81-4.59 3.81m12-.22h3.38V5.52c0-1.48.72-2.4 2.12-2.4 1.32 0 2.02.76 2.02 2.4v6.06h3.37V4.67c0-3.02-1.5-4.58-4.09-4.58q-2.2 0-3.42 1.74V1.1c0-.5-.29-.8-.78-.8h-2.59v11.27M42.46.32v9.75c0 4.24-2.75 5.93-6.12 5.93-2.25 0-4.12-.59-5.24-1.6l1.75-2.61a5 5 0 0 0 3.49 1.37c1.73 0 2.74-1.1 2.74-2.64V9.8c-.8 1.02-1.98 1.47-3.41 1.47-2.73 0-5.09-2.39-5.09-5.59S32.93.09 35.66.09a3.9 3.9 0 0 1 3.41 1.7V1.1c0-.5.3-.8.8-.8zM39.2 5.68c0-1.46-1.1-2.61-2.63-2.61A2.57 2.57 0 0 0 34 5.68a2.6 2.6 0 0 0 2.57 2.61 2.56 2.56 0 0 0 2.63-2.61m18 .27c0 3.47-2.35 5.86-5.28 5.86-1.53 0-2.74-.45-3.62-1.46v5.38h-3.37V.32h2.59c.5 0 .78.29.78.79v.67A4.2 4.2 0 0 1 51.91.1c2.93 0 5.29 2.39 5.29 5.86m-3.4 0c0-1.69-1.2-2.88-2.78-2.88a2.77 2.77 0 0 0-2.83 2.88 2.8 2.8 0 0 0 2.83 2.89c1.58 0 2.77-1.2 2.77-2.89M70.91.32v11.26h-3.38v-1.46a4.2 4.2 0 0 1-3.62 1.69c-2.92 0-5.28-2.39-5.28-5.86S61 .09 63.92.09c1.53 0 2.8.54 3.62 1.7V1.1c0-.5.3-.8.79-.8zm-3.26 5.63a2.8 2.8 0 0 0-2.84-2.88c-1.57 0-2.76 1.19-2.76 2.88 0 1.7 1.19 2.89 2.76 2.89 1.6 0 2.84-1.2 2.84-2.89m10.1 5.86c2.85 0 4.58-1.49 4.58-3.8 0-1.63-.99-2.73-3.03-3.19l-2-.45c-.77-.18-1.18-.43-1.18-.88s.39-.74 1.24-.74c1.04 0 2.11.5 2.86 1.17l1.68-2.48C81.11.72 79.44.1 77.37.1 74.7.1 72.9 1.42 72.9 3.68c0 1.64.92 2.83 2.88 3.29l2 .47c.99.22 1.3.52 1.3.9 0 .5-.4.77-1.33.77a5.5 5.5 0 0 1-3.44-1.36l-1.68 2.48c.78.72 2.58 1.58 5.12 1.58m10.65 0C91.27 11.8 93 10.32 93 8c0-1.63-.99-2.73-3.04-3.19l-2-.45c-.76-.18-1.17-.43-1.17-.88s.38-.74 1.24-.74c1.03 0 2.11.5 2.86 1.17l1.68-2.48C91.77.72 90.1.1 88.03.1c-2.68 0-4.47 1.33-4.47 3.59 0 1.64.92 2.83 2.87 3.29l2 .47c1 .22 1.3.52 1.3.9 0 .5-.4.77-1.32.77a5.5 5.5 0 0 1-3.44-1.36l-1.69 2.48c.8.72 2.6 1.58 5.13 1.58" }),
30933
31311
  /* @__PURE__ */ jsx$1("path", { fill: "#000", d: "M13.8 3.92c1.1 0 1.95-.86 1.95-1.96S14.9 0 13.8 0s-1.96.86-1.96 1.96.85 1.96 1.96 1.96m-2.12 7.66h4.23l-.9-7a5 5 0 0 1-2.43 0z" })
30934
31312
  ] });
31313
+ const singpassLogo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31314
+ __proto__: null,
31315
+ default: SvgSingpassLogo
31316
+ }, Symbol.toStringTag, { value: "Module" }));
30935
31317
  const legalEntityTypeToSubtitleTranslationKey = {
30936
31318
  [LegalEntityType.INDIVIDUAL]: "myInfoYouCanGetVerifiedDetails",
30937
31319
  [LegalEntityType.ORGANIZATION]: "myInfoBusinessYouCanGetVerifiedDetails"
@@ -31007,28 +31389,7 @@ const SingpassBanner = (props) => {
31007
31389
  })]
31008
31390
  });
31009
31391
  };
31010
- const SvgSetupManual = (props) => /* @__PURE__ */ jsxs$1("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 102 100", ...props, children: [
31011
- /* @__PURE__ */ jsx$1("path", { fill: "#EEF0F3", stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M66.82 10.09H2.9c-1.19 0-2.15.96-2.15 2.15v84.05c0 1.19.96 2.15 2.15 2.15h63.9c1.2 0 2.15-.96 2.15-2.15V12.24c0-1.19-.96-2.15-2.14-2.15" }),
31012
- /* @__PURE__ */ jsx$1("path", { fill: "#A0BEE6", stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M25.44 35.7H9.02v3.94h16.42z" }),
31013
- /* @__PURE__ */ jsx$1("path", { fill: "#6F7988", stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M24.44 55.91H9.02v1.97h15.42z" }),
31014
- /* @__PURE__ */ jsx$1("path", { fill: "#A0BEE6", stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M55.77 35.7H29.16v3.94h26.61z" }),
31015
- /* @__PURE__ */ jsx$1("path", { stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.02 29.58H20.4m-11.38-3.4h20.14" }),
31016
- /* @__PURE__ */ jsx$1("path", { stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.02 51.75h18.9" }),
31017
- /* @__PURE__ */ jsx$1("path", { fill: "#6F7988", stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M24.44 69.35H9.02v1.97h15.42z" }),
31018
- /* @__PURE__ */ jsx$1("path", { stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.02 65.19h18.9" }),
31019
- /* @__PURE__ */ jsx$1("path", { fill: "#6F7988", stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M48 55.91H32.57v1.97h15.41z" }),
31020
- /* @__PURE__ */ jsx$1("path", { stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M32.58 51.75h18.9" }),
31021
- /* @__PURE__ */ jsx$1("path", { fill: "#6F7988", stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M48 69.35H32.57v1.97h15.41z" }),
31022
- /* @__PURE__ */ jsx$1("path", { stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M32.58 65.19h18.9" }),
31023
- /* @__PURE__ */ jsx$1("path", { stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.02 82.5h9.46M9.02 86h25.8" }),
31024
- /* @__PURE__ */ jsx$1("path", { fill: "#fff", stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M83.1.79H19.17c-1.18 0-2.14.96-2.14 2.15v84.05c0 1.19.96 2.15 2.14 2.15H83.1c1.19 0 2.15-.96 2.15-2.15V2.94c0-1.19-.96-2.15-2.15-2.15" }),
31025
- /* @__PURE__ */ jsx$1("path", { fill: "#A0BEE6", stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M64.64 16.78h-39.1v6.01h39.1zm0 11.71h-39.1v6.01h39.1zm0 11.71h-39.1v6.01h39.1z" }),
31026
- /* @__PURE__ */ jsx$1("path", { stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M25.44 10.14h22.54" }),
31027
- /* @__PURE__ */ jsx$1("path", { stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M25.44 51.9h22.54m-22.54 5.7h32.82M25.44 68.99h26.54m-26.54 5.69H37.4" }),
31028
- /* @__PURE__ */ jsx$1("path", { stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M54.4 10.14h17.28M27.93 41.7v2.84m-.4-2.94h.8m-.8 3.2h.8m-.8-25.02h7.83m3.49 0h9.75M27.7 31.5h14.32m9.96-11.72h2.85" }),
31029
- /* @__PURE__ */ jsx$1("path", { fill: "#00112C", stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "m79.81 76.03 1.96 21.5a1.12 1.12 0 0 0 1.93.68l6.59-6.82q.2-.2.46-.28l9.01-2.96c.9-.3 1.05-1.52.23-2.02L81.51 74.96a1.12 1.12 0 0 0-1.69 1.06z" })
31030
- ] });
31031
- const SvgSetupSingpass = (props) => /* @__PURE__ */ jsxs$1("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 146 95", ...props, children: [
31392
+ const SvgSingpassVerificationInstant = (props) => /* @__PURE__ */ jsxs$1("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 146 95", role: "img", ...props, children: [
31032
31393
  /* @__PURE__ */ jsx$1("path", { fill: "#fff", stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M55.82 76.52a6.1 6.1 0 0 0 6.11 6.11h76.67a6.1 6.1 0 0 0 6.11-6.11V21.46H55.83z" }),
31033
31394
  /* @__PURE__ */ jsx$1("path", { fill: "#A0BEE6", stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M138.6 13.88H61.93a6.1 6.1 0 0 0-6.11 6.11v1.47h88.88V20a6.1 6.1 0 0 0-6.11-6.11z" }),
31034
31395
  /* @__PURE__ */ jsx$1("path", { fill: "#fff", d: "m30.16 94.33 3.47-2.6a41 41 0 0 0 8.1-8.1l2.6-3.48 6.07-2.02 13.53-1.69a3.04 3.04 0 0 0-.71-6.03l-8.6.96.7-3.47 12.66-1.58a3.04 3.04 0 0 0-.71-6.03L56.6 61.48l.8-3.96 10.58-1.32a3.04 3.04 0 0 0-.71-6.03l-8.6.95.8-3.98 8.5-1.06a3.04 3.04 0 0 0-.7-6.03L52.42 41.7l-22.26 2.47V41a4.86 4.86 0 0 0-4.86-4.86c-.68 0-1.22.55-1.22 1.22v2.7c0 1.42-.36 2.8-1.07 4.02L17.2 54.25c-.8 1.4-1.4 2.93-1.75 4.51L11.93 74.6" }),
@@ -31055,6 +31416,35 @@ const SvgSetupSingpass = (props) => /* @__PURE__ */ jsxs$1("svg", { xmlns: "http
31055
31416
  /* @__PURE__ */ jsx$1("path", { stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M86.73 53.7v3.13m1.1-2.68-2.2 2.21m2.2 0-2.2-2.2m2.67 1.1h-3.13m19.61-1.56v3.13m1.1-2.68-2.21 2.21m2.21 0-2.21-2.2m2.67 1.1h-3.13m10.59-1.56v3.13m1.1-2.68-2.2 2.21m2.2 0-2.2-2.2m2.66 1.1h-3.12M95.75 53.7v3.13m1.1-2.68-2.2 2.21m2.2 0-2.2-2.2m2.66 1.1H94.2" }),
31056
31417
  /* @__PURE__ */ jsx$1("path", { stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M80.65 34.88h30.2m-30.2 3.21h13.47" })
31057
31418
  ] });
31419
+ const singpassVerificationInstant = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31420
+ __proto__: null,
31421
+ default: SvgSingpassVerificationInstant
31422
+ }, Symbol.toStringTag, { value: "Module" }));
31423
+ const SvgSingpassVerificationManual = (props) => /* @__PURE__ */ jsxs$1("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 102 100", role: "img", ...props, children: [
31424
+ /* @__PURE__ */ jsx$1("path", { fill: "#EEF0F3", stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M66.82 10.09H2.9c-1.19 0-2.15.96-2.15 2.15v84.05c0 1.19.96 2.15 2.15 2.15h63.9c1.2 0 2.15-.96 2.15-2.15V12.24c0-1.19-.96-2.15-2.14-2.15" }),
31425
+ /* @__PURE__ */ jsx$1("path", { fill: "#A0BEE6", stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M25.44 35.7H9.02v3.94h16.42z" }),
31426
+ /* @__PURE__ */ jsx$1("path", { fill: "#6F7988", stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M24.44 55.91H9.02v1.97h15.42z" }),
31427
+ /* @__PURE__ */ jsx$1("path", { fill: "#A0BEE6", stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M55.77 35.7H29.16v3.94h26.61z" }),
31428
+ /* @__PURE__ */ jsx$1("path", { stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.02 29.58H20.4m-11.38-3.4h20.14" }),
31429
+ /* @__PURE__ */ jsx$1("path", { stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.02 51.75h18.9" }),
31430
+ /* @__PURE__ */ jsx$1("path", { fill: "#6F7988", stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M24.44 69.35H9.02v1.97h15.42z" }),
31431
+ /* @__PURE__ */ jsx$1("path", { stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.02 65.19h18.9" }),
31432
+ /* @__PURE__ */ jsx$1("path", { fill: "#6F7988", stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M48 55.91H32.57v1.97h15.41z" }),
31433
+ /* @__PURE__ */ jsx$1("path", { stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M32.58 51.75h18.9" }),
31434
+ /* @__PURE__ */ jsx$1("path", { fill: "#6F7988", stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M48 69.35H32.57v1.97h15.41z" }),
31435
+ /* @__PURE__ */ jsx$1("path", { stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M32.58 65.19h18.9" }),
31436
+ /* @__PURE__ */ jsx$1("path", { stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.02 82.5h9.46M9.02 86h25.8" }),
31437
+ /* @__PURE__ */ jsx$1("path", { fill: "#fff", stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M83.1.79H19.17c-1.18 0-2.14.96-2.14 2.15v84.05c0 1.19.96 2.15 2.14 2.15H83.1c1.19 0 2.15-.96 2.15-2.15V2.94c0-1.19-.96-2.15-2.15-2.15" }),
31438
+ /* @__PURE__ */ jsx$1("path", { fill: "#A0BEE6", stroke: "#A0BEE6", strokeLinecap: "round", strokeLinejoin: "round", d: "M64.64 16.78h-39.1v6.01h39.1zm0 11.71h-39.1v6.01h39.1zm0 11.71h-39.1v6.01h39.1z" }),
31439
+ /* @__PURE__ */ jsx$1("path", { stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M25.44 10.14h22.54" }),
31440
+ /* @__PURE__ */ jsx$1("path", { stroke: "#6F7988", strokeLinecap: "round", strokeLinejoin: "round", d: "M25.44 51.9h22.54m-22.54 5.7h32.82M25.44 68.99h26.54m-26.54 5.69H37.4" }),
31441
+ /* @__PURE__ */ jsx$1("path", { stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "M54.4 10.14h17.28M27.93 41.7v2.84m-.4-2.94h.8m-.8 3.2h.8m-.8-25.02h7.83m3.49 0h9.75M27.7 31.5h14.32m9.96-11.72h2.85" }),
31442
+ /* @__PURE__ */ jsx$1("path", { fill: "#00112C", stroke: "#00112C", strokeLinecap: "round", strokeLinejoin: "round", d: "m79.81 76.03 1.96 21.5a1.12 1.12 0 0 0 1.93.68l6.59-6.82q.2-.2.46-.28l9.01-2.96c.9-.3 1.05-1.52.23-2.02L81.51 74.96a1.12 1.12 0 0 0-1.69 1.06z" })
31443
+ ] });
31444
+ const singpassVerificationManual = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31445
+ __proto__: null,
31446
+ default: SvgSingpassVerificationManual
31447
+ }, Symbol.toStringTag, { value: "Module" }));
31058
31448
  const setupAccountMethods = ["singpass", "manual"];
31059
31449
  const setupAccountMethodFields = ["setupAccountMethod"];
31060
31450
  const getSingpassSelectionDisabled = (legalEntityType) => {
@@ -31084,7 +31474,7 @@ const getSetupAccountMethodMetadata = (legalEntityType) => {
31084
31474
  description: translationSingpassDescriptionKey,
31085
31475
  icon: jsx("span", {
31086
31476
  className: "adyen-kyc-setup-singpass-container",
31087
- children: jsx(SvgSetupSingpass, {})
31477
+ children: jsx(SvgSingpassVerificationInstant, {})
31088
31478
  }),
31089
31479
  provider: {
31090
31480
  name: "singpass",
@@ -31100,7 +31490,7 @@ const getSetupAccountMethodMetadata = (legalEntityType) => {
31100
31490
  description: "youAlsoHaveToUploadSomeSupportingDocuments",
31101
31491
  icon: jsx("span", {
31102
31492
  className: "adyen-kyc-setup-manual-container",
31103
- children: jsx(SvgSetupManual, {})
31493
+ children: jsx(SvgSingpassVerificationManual, {})
31104
31494
  })
31105
31495
  }
31106
31496
  };
@@ -32047,6 +32437,7 @@ function IndividualDropinComponent({
32047
32437
  legalEntityResponse,
32048
32438
  taskName,
32049
32439
  handleHomeClick,
32440
+ handleCloseClick,
32050
32441
  homeButtonLabel,
32051
32442
  isTargetLegalEntityType,
32052
32443
  country: parentCountry,
@@ -32059,6 +32450,7 @@ function IndividualDropinComponent({
32059
32450
  onSubmit: externalOnSubmit,
32060
32451
  onTypeSwitch,
32061
32452
  hideNavigation = false,
32453
+ asModal = false,
32062
32454
  handleBackClick: externalBackClick,
32063
32455
  trustedFields: trustedFields2,
32064
32456
  trustedFieldsProvider
@@ -32492,7 +32884,8 @@ function IndividualDropinComponent({
32492
32884
  shouldValidate,
32493
32885
  setShouldValidate,
32494
32886
  gotoFormByFormIndex,
32495
- nextButtonLabel
32887
+ nextButtonLabel,
32888
+ currentStep
32496
32889
  } = useFormComposer({
32497
32890
  problems,
32498
32891
  baseTrackingPayload,
@@ -32511,6 +32904,7 @@ function IndividualDropinComponent({
32511
32904
  handleBackClick,
32512
32905
  handleNextClick,
32513
32906
  handleHomeClick,
32907
+ handleCloseClick,
32514
32908
  hideHomeButton,
32515
32909
  hideBackButton,
32516
32910
  hideFooter,
@@ -32526,6 +32920,8 @@ function IndividualDropinComponent({
32526
32920
  canSubmit: canSubmit2() && hasDataChanged(dataFromResponse, data),
32527
32921
  problems,
32528
32922
  hideNavigation,
32923
+ asModal,
32924
+ currentStep,
32529
32925
  children: jsx(IndividualComponent, {
32530
32926
  ...derivedProps,
32531
32927
  capabilities: getCapabilities(legalEntityResponse),
@@ -32557,7 +32953,7 @@ function IndividualDropinComponent({
32557
32953
  })
32558
32954
  });
32559
32955
  }
32560
- const logger$i = createLogger("useBankConfigurationHandler");
32956
+ const logger$j = createLogger("useBankConfigurationHandler");
32561
32957
  const useBankConfigurationHandlers = ({
32562
32958
  isEmbeddedDropin,
32563
32959
  handleGetBankVerificationVendors,
@@ -32574,7 +32970,7 @@ const useBankConfigurationHandlers = ({
32574
32970
  (async () => {
32575
32971
  const bankVerificationVendorsResponse2 = callBankVerificationVendorsUpfront ? await handleGetBankVerificationVendors(bankAccountCountry) : [];
32576
32972
  setBankVerificationVendorsResponse(bankVerificationVendorsResponse2);
32577
- })().catch(logger$i.error).finally(() => {
32973
+ })().catch(logger$j.error).finally(() => {
32578
32974
  setLoadingStatus("success");
32579
32975
  });
32580
32976
  }, [bankAccountCountry]);
@@ -33968,8 +34364,8 @@ const serviceAgreementValidationRules = {
33968
34364
  errorMessage: "fieldIsRequired"
33969
34365
  }
33970
34366
  };
33971
- const logger$h = createLogger("useServiceAgreement");
33972
- const FALLBACK_LANGUAGE_CODE = "en";
34367
+ const logger$i = createLogger("useServiceAgreement");
34368
+ const FALLBACK_LANGUAGE_CODE$1 = "en";
33973
34369
  const useServiceAgreement = ({
33974
34370
  handleGetServiceAgreement,
33975
34371
  handleServiceAgreementIsNotAvailableInThatLanguage,
@@ -34001,7 +34397,7 @@ const useServiceAgreement = ({
34001
34397
  contract
34002
34398
  });
34003
34399
  };
34004
- requestAcceptedServiceAgreement().catch(logger$h.error).finally(() => setLoading("success"));
34400
+ requestAcceptedServiceAgreement().catch(logger$i.error).finally(() => setLoading("success"));
34005
34401
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
34006
34402
  useEffect(() => {
34007
34403
  const requestServiceAgreement = async () => {
@@ -34016,7 +34412,7 @@ const useServiceAgreement = ({
34016
34412
  language: agreementLanguage
34017
34413
  });
34018
34414
  if (!document2) {
34019
- logger$h.log('"document" field was missing in response');
34415
+ logger$i.log('"document" field was missing in response');
34020
34416
  return;
34021
34417
  }
34022
34418
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -34026,15 +34422,15 @@ const useServiceAgreement = ({
34026
34422
  });
34027
34423
  setLoading("success");
34028
34424
  } catch (err) {
34029
- if (agreementLanguage !== FALLBACK_LANGUAGE_CODE) {
34425
+ if (agreementLanguage !== FALLBACK_LANGUAGE_CODE$1) {
34030
34426
  handleServiceAgreementIsNotAvailableInThatLanguage();
34031
- setAgreementLanguage(FALLBACK_LANGUAGE_CODE);
34427
+ setAgreementLanguage(FALLBACK_LANGUAGE_CODE$1);
34032
34428
  return;
34033
34429
  }
34034
34430
  throw err;
34035
34431
  }
34036
34432
  };
34037
- requestServiceAgreement().catch(logger$h.error);
34433
+ requestServiceAgreement().catch(logger$i.error);
34038
34434
  }, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
34039
34435
  return {
34040
34436
  loading,
@@ -34051,6 +34447,8 @@ const serviceAgreementTypesTranslationMapping = {
34051
34447
  adyenFranchisee: "franchiseesTAndCs",
34052
34448
  adyenPccr: "pccr"
34053
34449
  };
34450
+ const logger$h = createLogger("ServiceAgreementDropinComponent");
34451
+ const FALLBACK_LANGUAGE_CODE = "en";
34054
34452
  function ServiceAgreementDropinComponent({
34055
34453
  legalEntityResponse,
34056
34454
  handleGetServiceAgreement,
@@ -34247,16 +34645,23 @@ function ServiceAgreementDropinComponent({
34247
34645
  }
34248
34646
  };
34249
34647
  const onDownloadUnacceptedTermsOfServiceDocument = async () => {
34250
- try {
34251
- if (!handleDownloadUnacceptedTermsOfServiceDocument) return;
34252
- const response = await handleDownloadUnacceptedTermsOfServiceDocument(legalEntityResponse.id, {
34648
+ const requestAndDownload = async (languageCode) => {
34649
+ const response = await (handleDownloadUnacceptedTermsOfServiceDocument == null ? void 0 : handleDownloadUnacceptedTermsOfServiceDocument(legalEntityResponse.id, {
34253
34650
  type: activeForm.serviceAgreementType,
34254
- language: i18n.languageCode,
34651
+ language: languageCode,
34255
34652
  termsOfServiceDocumentFormat: "PDF"
34256
- });
34257
- if (!response.document) throw new Error();
34653
+ }));
34654
+ if (!(response == null ? void 0 : response.document)) throw new Error();
34258
34655
  await downloadFile(response.document, `${i18n.get(activeForm.formName)}.pdf`);
34656
+ };
34657
+ try {
34658
+ if (!handleDownloadUnacceptedTermsOfServiceDocument) return;
34659
+ await requestAndDownload(i18n.languageCode);
34259
34660
  } catch (e) {
34661
+ if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
34662
+ await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$h.error);
34663
+ return;
34664
+ }
34260
34665
  showToast({
34261
34666
  label: i18n.get("failedToDownloadServiceAgreementDocument"),
34262
34667
  type: "error"
@@ -35101,7 +35506,6 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
35101
35506
  return hasOwnEntityAssocation || !!hasOrganizationType;
35102
35507
  };
35103
35508
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
35104
- const POLLING_INTERVAL = 3e3;
35105
35509
  const logger$g = createLogger("DropinComposerComponent");
35106
35510
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country) => country === CountryCodes.Australia && enabled;
35107
35511
  function DropinComposerComponent({
@@ -35321,19 +35725,26 @@ function DropinComposerComponent({
35321
35725
  }
35322
35726
  }
35323
35727
  };
35324
- const refreshLegalEntity = useCallback(async () => {
35728
+ const retrieveLegalEntity = useCallback(async () => {
35325
35729
  if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetLegalEntity)) {
35326
35730
  try {
35327
- const response = await (args == null ? void 0 : args.handleGetLegalEntity(rootLegalEntity.id));
35328
- setRootLegalEntity(response);
35329
- setCapabilityProblems(getCapabilityProblems(response, rootLegalEntityCountry, isExperimentEnabled));
35330
- return response;
35731
+ return await args.handleGetLegalEntity(rootLegalEntity.id);
35331
35732
  } catch (e) {
35332
- logger$g.warn(i18n.get("failedToFetchLegalEntityDetails"));
35733
+ logger$g.warn("Failed to fetch legal entity details", e);
35333
35734
  }
35334
35735
  }
35335
35736
  return void 0;
35336
- }, [i18n, rootLegalEntity.id]);
35737
+ }, [rootLegalEntity.id, args == null ? void 0 : args.handleGetLegalEntity, i18n]);
35738
+ const updateLegalEntityAndCapabilityProblems = useCallback((legalEntity) => {
35739
+ if (!legalEntity) return;
35740
+ setRootLegalEntity(legalEntity);
35741
+ setCapabilityProblems(getCapabilityProblems(legalEntity, getLegalEntityCountry(legalEntity), isExperimentEnabled));
35742
+ }, [isExperimentEnabled]);
35743
+ const refreshLegalEntity = useCallback(async () => {
35744
+ const legalEntity = await retrieveLegalEntity();
35745
+ updateLegalEntityAndCapabilityProblems(legalEntity);
35746
+ return legalEntity;
35747
+ }, [retrieveLegalEntity, updateLegalEntityAndCapabilityProblems]);
35337
35748
  const deleteTransferInstrument2 = async (id) => {
35338
35749
  if (id && (args == null ? void 0 : args.handleDeleteTransferInstrument)) {
35339
35750
  try {
@@ -35685,20 +36096,16 @@ function DropinComposerComponent({
35685
36096
  navigateTo(TaskTypes.CAPABILITY_REJECTED, true);
35686
36097
  }
35687
36098
  }, [rootLegalEntity]);
35688
- useEffect(() => {
35689
- if (!PAGES_WITH_POLLING.includes(currentTask) || hasResolvedCapabilities(rootLegalEntity)) {
35690
- return;
35691
- }
35692
- if (hasRejectedCapabilities(rootLegalEntity)) {
35693
- return;
35694
- }
35695
- const timeoutId = setTimeout(() => {
35696
- refreshLegalEntity().catch(logger$g.error);
35697
- }, POLLING_INTERVAL);
35698
- return () => {
35699
- clearInterval(timeoutId);
35700
- };
35701
- }, [refreshLegalEntity, rootLegalEntity]);
36099
+ usePolling({
36100
+ poller: retrieveLegalEntity,
36101
+ pollingInterval: 3e3,
36102
+ onNewValueReceived: updateLegalEntityAndCapabilityProblems,
36103
+ skip: (
36104
+ // Stop polling when not on an applicable page
36105
+ // or the LE has fully resolved capabilities
36106
+ !PAGES_WITH_POLLING.includes(currentTask) || hasResolvedCapabilities(rootLegalEntity) || hasRejectedCapabilities(rootLegalEntity)
36107
+ )
36108
+ });
35702
36109
  useEffect(() => {
35703
36110
  const newAccountHolder = getDefaultAccountHolderType(rootLegalEntity, false, accountHolder);
35704
36111
  if (newAccountHolder !== accountHolder) setAccountHolder(newAccountHolder);
@@ -36892,11 +37299,16 @@ function CreateIndividualComponent({
36892
37299
  legalEntityId,
36893
37300
  taskType,
36894
37301
  onSubmitSuccess,
36895
- handleBackClick
37302
+ handleBackClick,
37303
+ modalView,
37304
+ open,
37305
+ onClose
36896
37306
  }) {
36897
37307
  var _a;
36898
37308
  const {
36899
- contextCountry
37309
+ contextCountry,
37310
+ isModalView,
37311
+ setIsModalView
36900
37312
  } = useCoreContext();
36901
37313
  if (!legalEntityId && !parentLegalEntityId) {
36902
37314
  throw new Error("Must provide at-least one of parentLegalEntityId or legalEntityId");
@@ -36913,9 +37325,13 @@ function CreateIndividualComponent({
36913
37325
  getIdVerificationToken,
36914
37326
  idVerificationStartCheck
36915
37327
  } = useComponentApi(legalEntityId ?? parentLegalEntityId);
37328
+ const [showForm, setShowForm] = useState(false);
36916
37329
  const [legalEntity, setLegalEntity] = useState();
36917
37330
  const [parentLegalEntity, setParentLegalEntity] = useState();
36918
- const [loadingStatus, setLoadingStatus] = useState("loading");
37331
+ setShowForm(open ?? false);
37332
+ if (modalView) {
37333
+ setIsModalView(true);
37334
+ }
36919
37335
  const fetchLegalEntity = useCallback(async () => {
36920
37336
  try {
36921
37337
  const [parentEntity, entity] = await Promise.all([parentLegalEntityId ? getLegalEntity2(parentLegalEntityId) : Promise.resolve(void 0), legalEntityId ? getLegalEntity2(legalEntityId) : Promise.resolve(void 0)]);
@@ -36923,17 +37339,19 @@ function CreateIndividualComponent({
36923
37339
  setLegalEntity(entity);
36924
37340
  } catch (error) {
36925
37341
  logger$f.error(error);
36926
- } finally {
36927
- setLoadingStatus("success");
36928
37342
  }
36929
37343
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
36930
37344
  useEffect(() => {
36931
37345
  fetchLegalEntity().catch(logger$f.error);
36932
37346
  }, [fetchLegalEntity]);
36933
37347
  const country = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
36934
- return loadingStatus === "loading" ? jsx(Loader, {
36935
- size: "medium"
36936
- }) : jsx(IndividualDropinComponent, {
37348
+ const onSubmit = (d) => {
37349
+ setShowForm(false);
37350
+ if (onSubmitSuccess) {
37351
+ onSubmitSuccess(d);
37352
+ }
37353
+ };
37354
+ return showForm ? jsx(IndividualDropinComponent, {
36937
37355
  parentLegalEntity,
36938
37356
  legalEntityResponse: legalEntity,
36939
37357
  country,
@@ -36948,9 +37366,11 @@ function CreateIndividualComponent({
36948
37366
  handleGetIdVerificationStartCheck: idVerificationStartCheck,
36949
37367
  handleBackClick,
36950
37368
  hideNavigation: true,
36951
- onSubmit: onSubmitSuccess,
37369
+ asModal: isModalView,
37370
+ onSubmit,
37371
+ handleCloseClick: onClose,
36952
37372
  taskType
36953
- });
37373
+ }) : null;
36954
37374
  }
36955
37375
  const logger$e = createLogger("CreateTransferInstrumentComponent");
36956
37376
  function CreateTransferInstrumentComponent({
@@ -37020,6 +37440,183 @@ function CreateTransferInstrumentComponent({
37020
37440
  taskType: TaskTypes.PAYOUT
37021
37441
  });
37022
37442
  }
37443
+ var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
37444
+ OnboardingStatus2["AWAITING_DATA"] = "AWAITING_DATA";
37445
+ OnboardingStatus2["IN_REVIEW"] = "IN_REVIEW";
37446
+ OnboardingStatus2["UNSUCCESSFUL"] = "UNSUCCESSFUL";
37447
+ OnboardingStatus2["REJECTED"] = "REJECTED";
37448
+ OnboardingStatus2["VERIFIED"] = "VERIFIED";
37449
+ return OnboardingStatus2;
37450
+ })(OnboardingStatus || {});
37451
+ const Skeleton = ({
37452
+ circle = false,
37453
+ text = false,
37454
+ height = "1em",
37455
+ width
37456
+ }) => {
37457
+ const classNames = cx("adyen-kyc-skeleton", {
37458
+ "adyen-kyc-skeleton__circle": circle,
37459
+ "adyen-kyc-skeleton__text": text
37460
+ });
37461
+ return jsx("div", {
37462
+ className: classNames,
37463
+ style: {
37464
+ height,
37465
+ width
37466
+ }
37467
+ });
37468
+ };
37469
+ const styles = {
37470
+ "adyen-kyc-embedded-status": "adyen-kyc-embedded-status",
37471
+ "adyen-kyc-embedded-status__avatar": "adyen-kyc-embedded-status__avatar",
37472
+ "adyen-kyc-embedded-status__loading": "adyen-kyc-embedded-status__loading",
37473
+ "adyen-kyc-embedded-status__info": "adyen-kyc-embedded-status__info",
37474
+ "adyen-kyc-embedded-status__title": "adyen-kyc-embedded-status__title"
37475
+ };
37476
+ const statusToTag = (status) => {
37477
+ switch (status) {
37478
+ case OnboardingStatus.IN_REVIEW:
37479
+ return {
37480
+ translationKey: "inReview",
37481
+ variant: "grey"
37482
+ };
37483
+ case OnboardingStatus.VERIFIED:
37484
+ return {
37485
+ translationKey: "verified",
37486
+ variant: "green"
37487
+ };
37488
+ case OnboardingStatus.REJECTED:
37489
+ return {
37490
+ translationKey: "rejected",
37491
+ variant: "red"
37492
+ };
37493
+ case OnboardingStatus.AWAITING_DATA:
37494
+ return {
37495
+ translationKey: "inReview",
37496
+ variant: "grey"
37497
+ };
37498
+ case OnboardingStatus.UNSUCCESSFUL:
37499
+ return {
37500
+ translationKey: "unsuccessful",
37501
+ variant: "red"
37502
+ };
37503
+ default:
37504
+ return {
37505
+ variant: "grey"
37506
+ };
37507
+ }
37508
+ };
37509
+ const EmbeddedStatus = ({
37510
+ title,
37511
+ subtitle,
37512
+ status,
37513
+ loading = false,
37514
+ tagLabel,
37515
+ tagVariant = "green",
37516
+ onClick
37517
+ }) => {
37518
+ const {
37519
+ i18n
37520
+ } = useI18nContext();
37521
+ const statusTag = status ? statusToTag(status) : {
37522
+ translationKey: tagLabel,
37523
+ variant: tagVariant
37524
+ };
37525
+ return jsxs("button", {
37526
+ type: "button",
37527
+ className: styles["adyen-kyc-embedded-status"],
37528
+ onClick,
37529
+ children: [jsx("section", {
37530
+ className: cx(styles["adyen-kyc-embedded-status__avatar"], {
37531
+ "adyen-kyc-embedded-status__loading": loading
37532
+ }),
37533
+ children: loading ? jsx(Skeleton, {
37534
+ height: "100%",
37535
+ width: "100%",
37536
+ circle: true
37537
+ }) : jsx(Icon, {
37538
+ className: styles["adyen-kyc-embedded-status__icon"],
37539
+ name: "user"
37540
+ })
37541
+ }), jsxs("section", {
37542
+ className: styles["adyen-kyc-embedded-status__info"],
37543
+ children: [loading ? jsx(Skeleton, {
37544
+ text: true,
37545
+ width: "20ch",
37546
+ height: "1em"
37547
+ }) : jsx(Typography, {
37548
+ variant: "title",
37549
+ children: title
37550
+ }), loading ? jsx(Skeleton, {
37551
+ text: true,
37552
+ width: "90%",
37553
+ height: "1em"
37554
+ }) : jsx(Typography, {
37555
+ variant: "caption",
37556
+ children: subtitle
37557
+ })]
37558
+ }), jsx("section", {
37559
+ className: styles["adyen-kyc-embedded-status__tag"],
37560
+ children: loading ? jsx(Skeleton, {
37561
+ width: "8ch",
37562
+ height: "1em"
37563
+ }) : jsx(Tag, {
37564
+ variant: statusTag.variant,
37565
+ children: !statusTag.translationKey ? "---" : i18n.get(statusTag.translationKey)
37566
+ })
37567
+ })]
37568
+ });
37569
+ };
37570
+ function LegalEntityStatus({
37571
+ legalEntityId,
37572
+ onClick
37573
+ }) {
37574
+ var _a, _b, _c;
37575
+ const {
37576
+ getLegalEntity: getLegalEntity2,
37577
+ getOnboardingStatus: getOnboardingStatus2
37578
+ } = useComponentApi(legalEntityId);
37579
+ const [legalEntity, setLegalEntity] = useState();
37580
+ const [isLoading, setIsLoading] = useState(!legalEntity);
37581
+ const [onboardingStatus, setOnboardingStatus] = useState();
37582
+ const fetchLegalEntity = useCallback(async () => getLegalEntity2(legalEntityId), [getLegalEntity2, legalEntityId]);
37583
+ const checkStatus = useCallback(async () => getOnboardingStatus2(), [getOnboardingStatus2]);
37584
+ const onNewValueReceived = useCallback(({
37585
+ status
37586
+ }) => {
37587
+ setOnboardingStatus(status);
37588
+ if (status === OnboardingStatus.VERIFIED) {
37589
+ fetchLegalEntity().then((newLegalEntity) => {
37590
+ setLegalEntity(newLegalEntity);
37591
+ setIsLoading(false);
37592
+ }).catch((e) => {
37593
+ console.log(e);
37594
+ });
37595
+ }
37596
+ }, [fetchLegalEntity]);
37597
+ usePolling({
37598
+ poller: checkStatus,
37599
+ pollingInterval: 3e3,
37600
+ onNewValueReceived,
37601
+ immediate: true
37602
+ });
37603
+ return jsx(EmbeddedStatus, {
37604
+ onClick,
37605
+ title: ((_b = (_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.name) == null ? void 0 : _b.firstName) ?? "",
37606
+ subtitle: ((_c = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _c.email) ?? "",
37607
+ status: onboardingStatus,
37608
+ loading: isLoading
37609
+ });
37610
+ }
37611
+ function ManageIndividualComponent({
37612
+ legalEntityId,
37613
+ onClick
37614
+ }) {
37615
+ return jsx(LegalEntityStatus, {
37616
+ legalEntityId,
37617
+ onClick
37618
+ });
37619
+ }
37023
37620
  const DEFAULT_POLLING_INTERVAL = 3e3;
37024
37621
  const DEFAULT_POLLING_INTERVAL_RETRY_COUNT = 3;
37025
37622
  function useInterval(callback, initialDelay = DEFAULT_POLLING_INTERVAL) {
@@ -39053,19 +39650,15 @@ function UpdateLegalEntityForHighExposure({
39053
39650
  })
39054
39651
  });
39055
39652
  }
39056
- var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
39057
- OnboardingUrlTarget2["BLANK"] = "_blank";
39058
- OnboardingUrlTarget2["SELF"] = "_self";
39059
- return OnboardingUrlTarget2;
39060
- })(OnboardingUrlTarget || {});
39061
- var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
39062
- OnboardingStatus2["AWAITING_DATA"] = "AWAITING_DATA";
39063
- OnboardingStatus2["IN_REVIEW"] = "IN_REVIEW";
39064
- OnboardingStatus2["UNSUCCESSFUL"] = "UNSUCCESSFUL";
39065
- OnboardingStatus2["REJECTED"] = "REJECTED";
39066
- OnboardingStatus2["VERIFIED"] = "VERIFIED";
39067
- return OnboardingStatus2;
39068
- })(OnboardingStatus || {});
39653
+ const coerceError = (err) => {
39654
+ if (err instanceof Error) return err;
39655
+ if (typeof err === "object") {
39656
+ if (err !== null && "message" in err && typeof err.message === "string") {
39657
+ return new Error(err.message);
39658
+ }
39659
+ }
39660
+ return new Error("Unknown error");
39661
+ };
39069
39662
  const contentMap = {
39070
39663
  [OnboardingStatus.AWAITING_DATA]: {
39071
39664
  description: ["onboardingRedirectAwaitingDescriptionP1"],
@@ -39089,20 +39682,18 @@ const contentMap = {
39089
39682
  function getContentByStatus(status) {
39090
39683
  return contentMap[status];
39091
39684
  }
39685
+ const FINAL_STATUSES = [OnboardingStatus.VERIFIED, OnboardingStatus.REJECTED];
39092
39686
  const logger$7 = createLogger("ViewVerificationStatusComponent");
39093
39687
  function ViewVerificationStatusComponent({
39094
39688
  legalEntityId,
39095
39689
  hideExplanation = false,
39096
39690
  returnUrl,
39097
- redirectTarget,
39691
+ redirectTarget = "_blank",
39098
39692
  themeId,
39099
39693
  onStatusChange,
39100
39694
  onError,
39101
39695
  onRedirect
39102
39696
  }) {
39103
- if (!legalEntityId) {
39104
- throw new Error("legalEntityId argument is required!");
39105
- }
39106
39697
  const {
39107
39698
  i18n
39108
39699
  } = useI18nContext();
@@ -39118,45 +39709,41 @@ function ViewVerificationStatusComponent({
39118
39709
  if (statusContent) return statusContent;
39119
39710
  logger$7.error(`there is no content for status "${onboardingStatus}"`);
39120
39711
  }, [onboardingStatus]);
39121
- const handleError = ({
39122
- trKey,
39123
- error
39124
- }) => {
39125
- if (trKey) {
39126
- setAlertContent(trKey);
39127
- }
39128
- if (error) {
39129
- logger$7.error(error);
39130
- }
39131
- if (typeof onError === "function") {
39132
- const userMessage = trKey ? i18n.get(trKey) : "";
39133
- onError({
39134
- error: error || {
39135
- message: userMessage
39136
- },
39137
- userMessage
39138
- });
39712
+ const handleError = useCallback((rawError, userMessage) => {
39713
+ const error = coerceError(rawError);
39714
+ logger$7.error(error);
39715
+ setAlertContent(userMessage);
39716
+ onError == null ? void 0 : onError({
39717
+ error,
39718
+ userMessage: i18n.get(userMessage)
39719
+ });
39720
+ }, [i18n, onError]);
39721
+ const fetchOnboardingStatus = useCallback(async () => {
39722
+ try {
39723
+ const {
39724
+ status
39725
+ } = await getOnboardingStatus2();
39726
+ return status;
39727
+ } catch (error) {
39728
+ handleError(error, "onboardingRedirectLinkError");
39729
+ return void 0;
39139
39730
  }
39140
- };
39731
+ }, [getOnboardingStatus2, handleError]);
39732
+ const updateOnboardingStatus = useCallback((newStatus) => {
39733
+ if (!newStatus) return;
39734
+ setOnboardingStatus(newStatus);
39735
+ if (newStatus !== onboardingStatus) onStatusChange == null ? void 0 : onStatusChange(newStatus);
39736
+ }, [onStatusChange]);
39737
+ usePolling({
39738
+ poller: fetchOnboardingStatus,
39739
+ pollingInterval: 1e4,
39740
+ onNewValueReceived: updateOnboardingStatus,
39741
+ skip: onboardingStatus && FINAL_STATUSES.includes(onboardingStatus)
39742
+ });
39141
39743
  useEffect(() => {
39142
- setAlertContent("");
39143
- (async () => {
39144
- try {
39145
- const {
39146
- status
39147
- } = await getOnboardingStatus2();
39148
- setOnboardingStatus(status);
39149
- if (typeof onStatusChange === "function") {
39150
- onStatusChange(status);
39151
- }
39152
- } catch (error) {
39153
- handleError({
39154
- trKey: "onboardingRedirectLinkError",
39155
- error
39156
- });
39157
- }
39158
- })().catch(logger$7.error);
39159
- }, [legalEntityId, getOnboardingStatus2]);
39744
+ setAlertContent(void 0);
39745
+ fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$7.error);
39746
+ }, [fetchOnboardingStatus, updateOnboardingStatus]);
39160
39747
  const [loadingLinkStatus, setLinkLoadingStatus] = useState("success");
39161
39748
  const redirectToAdyen = async () => {
39162
39749
  setLinkLoadingStatus("loading");
@@ -39170,41 +39757,30 @@ function ViewVerificationStatusComponent({
39170
39757
  redirectUrl
39171
39758
  } = await generateOnboardingLink2(config);
39172
39759
  if (!redirectUrl) {
39173
- handleError({
39174
- trKey: "onboardingRedirectLinkError"
39175
- });
39760
+ handleError(new Error("No redirectUrl returned"), "onboardingRedirectLinkError");
39176
39761
  return;
39177
39762
  }
39178
39763
  openUrl(redirectUrl, config);
39179
39764
  } catch (error) {
39180
- handleError({
39181
- trKey: "onboardingRedirectLinkError",
39182
- error
39183
- });
39765
+ handleError(error, "onboardingRedirectLinkError");
39184
39766
  } finally {
39185
39767
  setLinkLoadingStatus("success");
39186
39768
  }
39187
39769
  };
39188
39770
  const openUrl = (url, config) => {
39189
- const target = redirectTarget && Object.values(OnboardingUrlTarget).includes(redirectTarget) ? redirectTarget : OnboardingUrlTarget.BLANK;
39190
- const newTab = window.open("", target);
39191
- if (newTab) {
39192
- newTab.location.href = url;
39193
- if (typeof onRedirect === "function") {
39194
- onRedirect({
39195
- ...config,
39196
- onboardingLink: url
39197
- });
39198
- }
39199
- } else {
39200
- handleError({
39201
- trKey: "onboardingRedirectOpenError"
39202
- });
39771
+ const newTab = window.open(url, redirectTarget);
39772
+ if (!newTab) {
39773
+ handleError(new Error("Could not open redirect in new tab"), "onboardingRedirectOpenError");
39774
+ return;
39203
39775
  }
39776
+ onRedirect == null ? void 0 : onRedirect({
39777
+ ...config,
39778
+ onboardingLink: url
39779
+ });
39204
39780
  };
39205
39781
  const renderFooter = () => {
39206
39782
  const statusesWithoutActions = [OnboardingStatus.REJECTED, OnboardingStatus.VERIFIED];
39207
- if (statusesWithoutActions.includes(onboardingStatus) || !(content == null ? void 0 : content.ctaButton)) {
39783
+ if (onboardingStatus && statusesWithoutActions.includes(onboardingStatus) || !(content == null ? void 0 : content.ctaButton)) {
39208
39784
  return;
39209
39785
  }
39210
39786
  return jsx(Button, {
@@ -39257,6 +39833,7 @@ const componentsMap = {
39257
39833
  createIndividualComponent: CreateIndividualComponent,
39258
39834
  manageTransferInstrumentComponent: ManageTransferInstrumentComponent,
39259
39835
  onboardingDropinComponent: OnboardingDropinComponent,
39836
+ manageIndividualComponent: ManageIndividualComponent,
39260
39837
  viewVerificationStatusComponent: ViewVerificationStatusComponent,
39261
39838
  updateLegalEntityForHighExposureComponent: UpdateLegalEntityForHighExposure
39262
39839
  };
@@ -39358,28 +39935,6 @@ const useAnalytics = async ({
39358
39935
  userEvents.subscribe(onUserEvent);
39359
39936
  }
39360
39937
  };
39361
- let isDocumentGuidanceLoaded = false;
39362
- const getIconContainer = () => {
39363
- const container = document.createElement("div");
39364
- container.setAttribute("aria-hidden", "true");
39365
- container.setAttribute("id", "adyen-kyc-icon-container");
39366
- container.style.height = "0";
39367
- return container;
39368
- };
39369
- const buildSpriteDOMFromResponse = (responseData) => {
39370
- const iconContainer = getIconContainer();
39371
- iconContainer.innerHTML = responseData;
39372
- return iconContainer;
39373
- };
39374
- const loadDocumentGuidance = async (loadingContext) => {
39375
- if (isDocumentGuidanceLoaded) return;
39376
- isDocumentGuidanceLoaded = true;
39377
- const responseData = await http({
39378
- loadingContext,
39379
- path: "static/images/document-guidance.svg"
39380
- }, null, "text");
39381
- document.body.insertBefore(buildSpriteDOMFromResponse(responseData), document.body.firstChild);
39382
- };
39383
39938
  const logger$6 = createLogger("loadCountries");
39384
39939
  const countriesImports = /* @__PURE__ */ Object.assign({ "./de-DE.json": () => import("./de-DE-Cx8Uim1K.js"), "./el-GR.json": () => import("./el-GR-B7_JR3z5.js"), "./en-US.json": () => import("./en-US-CkdCbOCX.js"), "./es-ES.json": () => import("./es-ES-NBv3HHhn.js"), "./fr-FR.json": () => import("./fr-FR-DdSVMVsp.js"), "./it-IT.json": () => import("./it-IT-Bwdk3zuj.js"), "./ja-JP.json": () => import("./ja-JP-Bsvzm8zu.js"), "./nl-NL.json": () => import("./nl-NL-DofKaNkk.js"), "./pt-PT.json": () => import("./pt-PT-DFEvMD1M.js"), "./ru-RU.json": () => import("./ru-RU-PiM0ZI5h.js"), "./sv-SE.json": () => import("./sv-SE-C0GoLwTg.js"), "./zh-CN.json": () => import("./zh-CN-DJs6Hct-.js"), "./zh-TW.json": () => import("./zh-TW-BWhLbns8.js") });
39385
39940
  const loadCountriesDataset = async (locale) => {
@@ -39567,7 +40122,6 @@ const getEmbeddedApi = ({
39567
40122
  };
39568
40123
  },
39569
40124
  getDataset,
39570
- loadDocumentGuidance: async () => loadDocumentGuidance(base),
39571
40125
  getImageUrl: () => `${base}static/images/`,
39572
40126
  getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
39573
40127
  getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
@@ -39712,7 +40266,6 @@ const getKycExternalApi = ({
39712
40266
  clientKey
39713
40267
  }),
39714
40268
  getDataset,
39715
- loadDocumentGuidance: async () => loadDocumentGuidance(loadingContext),
39716
40269
  verifyIdNumber: async (request) => verifyIdNumber({
39717
40270
  loadingContext,
39718
40271
  clientKey
@@ -39737,7 +40290,7 @@ const ConfigurationApiProvider = ({
39737
40290
  isEmbeddedDropin,
39738
40291
  loadingContext
39739
40292
  } = authContext;
39740
- const sdkVersion = "3.24.6";
40293
+ const sdkVersion = "3.25.0";
39741
40294
  useAnalytics({
39742
40295
  onUserEvent,
39743
40296
  legalEntityId: rootLegalEntityId,
@@ -39781,6 +40334,7 @@ const CoreProvider = ({
39781
40334
  } = useAccountHolder(rootLegalEntityId);
39782
40335
  const [accountFormat, setAccountFormat] = useState("local");
39783
40336
  const [idVerificationProviderId, setIdVerificationProviderId] = useState();
40337
+ const [isModalView, setIsModalView] = useState(false);
39784
40338
  const allowedCountries = useAllowedCountries();
39785
40339
  const isCountryAllowed = (allowedCountries == null ? void 0 : allowedCountries.includes(contextCountry)) ?? true;
39786
40340
  useEffect(() => {
@@ -39800,8 +40354,10 @@ const CoreProvider = ({
39800
40354
  setAccountFormat,
39801
40355
  accountFormat,
39802
40356
  idVerificationProviderId,
39803
- setIdVerificationProviderId
39804
- }), [contextCountry, accountHolder, accountFormat, idVerificationProviderId]);
40357
+ setIdVerificationProviderId,
40358
+ setIsModalView,
40359
+ isModalView
40360
+ }), [contextCountry, accountHolder, accountFormat, idVerificationProviderId, isModalView]);
39805
40361
  return jsx(CoreContext.Provider, {
39806
40362
  value: contextValue,
39807
40363
  children
@@ -40226,6 +40782,53 @@ function ToastContextProvider({
40226
40782
  }), children]
40227
40783
  });
40228
40784
  }
40785
+ const layoutBreakpointClassnames = {
40786
+ xsOnly: "adyen-layout-xs-only",
40787
+ md: "adyen-layout-md",
40788
+ lg: "adyen-layout-lg"
40789
+ };
40790
+ const layoutBreakpointSizes = {
40791
+ md: 680,
40792
+ lg: 1024
40793
+ };
40794
+ const getBreakpointClassNames = (containerSize) => {
40795
+ const breakPoints = Object.entries(layoutBreakpointSizes);
40796
+ const classes = breakPoints.reduce((acc, [bp, size]) => {
40797
+ if (size <= containerSize) acc.push(layoutBreakpointClassnames[bp]);
40798
+ return acc;
40799
+ }, []);
40800
+ return classes.length > 0 ? classes : ["adyen-layout-xs-only"];
40801
+ };
40802
+ function assignLayoutClasses(entries, container) {
40803
+ let newClasses = [];
40804
+ entries.forEach((entry) => {
40805
+ var _a;
40806
+ const parentWidth = (_a = entry.contentBoxSize) == null ? void 0 : _a[0].inlineSize;
40807
+ if (parentWidth) {
40808
+ newClasses = getBreakpointClassNames(parentWidth);
40809
+ } else {
40810
+ newClasses.push(layoutBreakpointClassnames.lg);
40811
+ }
40812
+ container.classList.remove(...Object.values(layoutBreakpointClassnames));
40813
+ container.classList.add(...newClasses);
40814
+ });
40815
+ }
40816
+ const AutoResizer = ({
40817
+ children
40818
+ }) => {
40819
+ const containerRef = useRef(null);
40820
+ useEffect(() => {
40821
+ const container = containerRef.current;
40822
+ if (!container) return;
40823
+ const resizeObserver = new ResizeObserver((entries) => assignLayoutClasses(entries, container));
40824
+ resizeObserver.observe(container);
40825
+ return () => resizeObserver.unobserve(container);
40826
+ });
40827
+ return jsx("div", {
40828
+ ref: containerRef,
40829
+ children
40830
+ });
40831
+ };
40229
40832
  class EventEmitter {
40230
40833
  constructor() {
40231
40834
  this.listeners = {
@@ -40369,7 +40972,7 @@ const DebugModal = ({
40369
40972
  };
40370
40973
  const copyToClipboard = async () => {
40371
40974
  const toCopy = {
40372
- sdkVersion: "3.24.6",
40975
+ sdkVersion: "3.25.0",
40373
40976
  experiments: Object.fromEntries(allExperimentsWithValues),
40374
40977
  settings: Object.fromEntries(allSettingsWithValues)
40375
40978
  };
@@ -40382,7 +40985,7 @@ const DebugModal = ({
40382
40985
  setDebugInfoCopied(false);
40383
40986
  }, 5e3);
40384
40987
  };
40385
- return jsx(Modal, {
40988
+ return jsx(Modal$1, {
40386
40989
  size: "large",
40387
40990
  header: jsxs(Fragment, {
40388
40991
  children: ["Debug ", jsx(Button, {
@@ -40399,7 +41002,7 @@ const DebugModal = ({
40399
41002
  children: [jsxs("div", {
40400
41003
  className: "adyen-kyc-debug-modal__meta",
40401
41004
  children: [jsxs("span", {
40402
- children: ["SDK version: ", "3.24.6"]
41005
+ children: ["SDK version: ", "3.25.0"]
40403
41006
  }), jsxs("span", {
40404
41007
  children: ["rootLegalEntityId: ", rootLegalEntityId]
40405
41008
  })]
@@ -41314,6 +41917,11 @@ const createIndividualComponentSchema = {
41314
41917
  type: "function"
41315
41918
  }
41316
41919
  };
41920
+ const manageIndividualComponentSchema = {
41921
+ legalEntityId: {
41922
+ type: "string"
41923
+ }
41924
+ };
41317
41925
  const viewVerificationStatusComponentSchema = {
41318
41926
  legalEntityId: {
41319
41927
  type: "string",
@@ -41323,7 +41931,8 @@ const viewVerificationStatusComponentSchema = {
41323
41931
  type: "boolean"
41324
41932
  },
41325
41933
  redirectTarget: {
41326
- type: "string"
41934
+ type: "string",
41935
+ exactValue: ["_self", "_blank"]
41327
41936
  },
41328
41937
  themeId: {
41329
41938
  type: "string"
@@ -41371,6 +41980,7 @@ const componentsSchemaMap = {
41371
41980
  taskList: taskListSchema,
41372
41981
  manageTransferInstrumentComponent: manageTransferInstrumentComponentSchema,
41373
41982
  createIndividualComponent: createIndividualComponentSchema,
41983
+ manageIndividualComponent: manageIndividualComponentSchema,
41374
41984
  createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
41375
41985
  viewVerificationStatusComponent: viewVerificationStatusComponentSchema,
41376
41986
  updateLegalEntityForHighExposureComponent: updateLegalEntityForHighExposureComponentSchema,