@adyen/kyc-components 3.34.1 → 3.35.1

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 (115) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1298 -1093
  2. package/dist/es/hide-CWI5yHxd.js +9 -0
  3. package/dist/es/show-Cm_JGm0K.js +8 -0
  4. package/dist/style.css +46 -28
  5. package/dist/types/components/AdditionalInformation/types.d.ts +1 -1
  6. package/dist/types/components/BankDocument/types.d.ts +1 -1
  7. package/dist/types/components/BankVerification/types.d.ts +1 -9
  8. package/dist/types/components/BankVerification/verification/widget/component/BankVerificationWidget.d.ts +7 -19
  9. package/dist/types/components/BasicInformation/types.d.ts +1 -1
  10. package/dist/types/components/BusinessDetails/types.d.ts +1 -1
  11. package/dist/types/components/Company/types.d.ts +1 -1
  12. package/dist/types/components/CompanyNameAndCountry/types.d.ts +1 -1
  13. package/dist/types/components/CompanyRegistrationDetails/types.d.ts +1 -1
  14. package/dist/types/components/CompanyStructure/types.d.ts +1 -1
  15. package/dist/types/components/CompanyType/types.d.ts +1 -1
  16. package/dist/types/components/ContactDetails/types.d.ts +1 -1
  17. package/dist/types/components/DocumentUpload/types.d.ts +1 -1
  18. package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +1 -1
  19. package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +1 -1
  20. package/dist/types/components/Dropins/RoleAndTypeDropin/components/formatRoleAndEntityTypeSummary.d.ts +5 -0
  21. package/dist/types/components/Dropins/types.d.ts +2 -1
  22. package/dist/types/components/FinancialInformation/formatFinancialInformationSummary.d.ts +4 -0
  23. package/dist/types/components/FinancialInformation/types.d.ts +2 -1
  24. package/dist/types/components/IdDocumentUpload/types.d.ts +3 -3
  25. package/dist/types/components/IdVerification/types.d.ts +3 -3
  26. package/dist/types/components/IdVerificationMethod/types.d.ts +3 -3
  27. package/dist/types/components/IdentityNumber/type.d.ts +1 -1
  28. package/dist/types/components/Individual/component/IndividualComponent.d.ts +1 -2
  29. package/dist/types/components/Individual/types.d.ts +1 -1
  30. package/dist/types/components/PayoutAccount/types.d.ts +4 -3
  31. package/dist/types/components/PayoutDetails/component/PayoutDetailsComponent.d.ts +1 -4
  32. package/dist/types/components/PayoutDetails/rules.d.ts +1 -0
  33. package/dist/types/components/PayoutDetails/types.d.ts +1 -1
  34. package/dist/types/components/PayoutVerificationMethod/component/PayoutVerificationMethod.d.ts +2 -1
  35. package/dist/types/components/PayoutVerificationMethod/component/PreferInstantVerificationMethod/PreferInstantVerificationMethod.d.ts +16 -3
  36. package/dist/types/components/PayoutVerificationMethod/types.d.ts +13 -4
  37. package/dist/types/components/PersonalDetails/component/IdentityComponent/types.d.ts +1 -1
  38. package/dist/types/components/PersonalDetails/types.d.ts +3 -4
  39. package/dist/types/components/RegistrationAddress/types.d.ts +1 -1
  40. package/dist/types/components/SingpassSelection/types.d.ts +1 -1
  41. package/dist/types/components/SoleProp/component/SolePropComponent.d.ts +8 -0
  42. package/dist/types/components/SoleProp/types.d.ts +3 -1
  43. package/dist/types/components/Trust/types.d.ts +1 -1
  44. package/dist/types/components/TrustRegistrationDetails/types.d.ts +1 -1
  45. package/dist/types/components/TrustRoleAndEntityType/types.d.ts +1 -1
  46. package/dist/types/components/embedded-ui/EmbeddedStatus/EmbeddedStatus.d.ts +4 -4
  47. package/dist/types/components/internal/Address/components/SearchAddress.d.ts +1 -1
  48. package/dist/types/components/internal/Address/types.d.ts +1 -1
  49. package/dist/types/components/internal/Alert/components/VerificationErrorAlert.d.ts +0 -1
  50. package/dist/types/components/internal/BankAccountNumber/types.d.ts +1 -1
  51. package/dist/types/components/internal/BankCity/types.d.ts +1 -1
  52. package/dist/types/components/internal/BankCode/types.d.ts +1 -1
  53. package/dist/types/components/internal/BankName/types.d.ts +1 -1
  54. package/dist/types/components/internal/BranchCode/types.d.ts +1 -1
  55. package/dist/types/components/internal/BusinessNameField/types.d.ts +1 -1
  56. package/dist/types/components/internal/BusinessRegistrationNumber/types.d.ts +1 -1
  57. package/dist/types/components/internal/CountryField/types.d.ts +1 -5
  58. package/dist/types/components/internal/CountryOfGoverningLawField/types.d.ts +1 -1
  59. package/dist/types/components/internal/Currency/types.d.ts +1 -1
  60. package/dist/types/components/internal/DBANameField/types.d.ts +1 -1
  61. package/dist/types/components/internal/DecisionMakerRole/types.d.ts +1 -1
  62. package/dist/types/components/internal/FinancialReportingDate/types.d.ts +1 -1
  63. package/dist/types/components/internal/FormFields/InputDate/utils.d.ts +4 -5
  64. package/dist/types/components/internal/FormFields/MaskedInputText/MaskedInputText.d.ts +1 -1
  65. package/dist/types/components/internal/FormFields/Select/types.d.ts +0 -1
  66. package/dist/types/components/internal/FormFields/utils.d.ts +1 -2
  67. package/dist/types/components/internal/Iban/types.d.ts +1 -1
  68. package/dist/types/components/internal/LegalFormField/LegalFormField.d.ts +1 -2
  69. package/dist/types/components/internal/LegalFormField/types.d.ts +3 -2
  70. package/dist/types/components/internal/NaceCodeField/NaceCodeField.d.ts +1 -2
  71. package/dist/types/components/internal/NaceCodeField/types.d.ts +3 -2
  72. package/dist/types/components/internal/Name/types.d.ts +1 -1
  73. package/dist/types/components/internal/NumberOfEmployees/types.d.ts +1 -1
  74. package/dist/types/components/internal/PhoneInput/types.d.ts +1 -1
  75. package/dist/types/components/internal/StateField/types.d.ts +1 -1
  76. package/dist/types/components/internal/StockTickerSymbol/types.d.ts +1 -1
  77. package/dist/types/components/internal/Summary/Summary.d.ts +1 -2
  78. package/dist/types/components/internal/Summary/summaryItem.d.ts +11 -0
  79. package/dist/types/components/internal/Summary/types.d.ts +5 -2
  80. package/dist/types/components/internal/Svg/svgs.d.ts +2 -0
  81. package/dist/types/components/internal/SwiftCode/types.d.ts +1 -1
  82. package/dist/types/components/internal/TaxId/types.d.ts +1 -1
  83. package/dist/types/core/Context/ExperimentContext/types.d.ts +3 -1
  84. package/dist/types/core/Services/componentApi/get-bankVerification-vendor.d.ts +2 -1
  85. package/dist/types/core/hooks/useBusinessData/constants.d.ts +0 -2
  86. package/dist/types/core/models/api/legal-arrangement.d.ts +2 -1
  87. package/dist/types/core/models/company.d.ts +0 -3
  88. package/dist/types/core/models/country-config.d.ts +1 -1
  89. package/dist/types/core/models/errors/error-message.d.ts +0 -5
  90. package/dist/types/core/models/errors/maintenance-mode-error.d.ts +0 -6
  91. package/dist/types/core/models/identity.d.ts +6 -0
  92. package/dist/types/core/models/province-code.d.ts +2 -1
  93. package/dist/types/core/process-field-configurations.d.ts +1 -1
  94. package/dist/types/utils/entity-association-util.d.ts +1 -8
  95. package/dist/types/utils/formUtils.d.ts +1 -1
  96. package/dist/types/utils/get-props.d.ts +1 -1
  97. package/dist/types/utils/logger.d.ts +0 -1
  98. package/dist/types/utils/perState.d.ts +0 -3
  99. package/dist/types/utils/validation/ValidationResult.d.ts +0 -2
  100. package/dist/types/utils/validation/types.d.ts +2 -16
  101. package/package.json +1 -1
  102. package/dist/types/components/internal/BankAccountNumber/index.d.ts +0 -1
  103. package/dist/types/components/internal/BankCity/index.d.ts +0 -1
  104. package/dist/types/components/internal/BankCode/index.d.ts +0 -1
  105. package/dist/types/components/internal/BankName/index.d.ts +0 -1
  106. package/dist/types/components/internal/BranchCode/index.d.ts +0 -1
  107. package/dist/types/components/internal/BusinessRegistrationNumber/index.d.ts +0 -1
  108. package/dist/types/components/internal/Iban/index.d.ts +0 -1
  109. package/dist/types/components/internal/Name/index.d.ts +0 -1
  110. package/dist/types/components/internal/SwiftCode/index.d.ts +0 -1
  111. package/dist/types/core/Services/componentApi/index.d.ts +0 -19
  112. package/dist/types/core/Services/kycExternalApi/index.d.ts +0 -6
  113. package/dist/types/core/hooks/useForm/index.d.ts +0 -3
  114. package/dist/types/core/hooks/useIsElementVisible.d.ts +0 -2
  115. package/dist/types/utils/regex/index.d.ts +0 -7
@@ -85,9 +85,6 @@ const defaultTrans = {
85
85
  accountCantBeSetUp: "Your account can't be set up as your information couldn't be verified. To find out more, reach out to customer support.",
86
86
  accountDetailsDescription: "Provide a few details about you to start accepting live payments.",
87
87
  accountHolder: "Account holder",
88
- accountHolderDescriptionCompany: "The bank account holder has to have the same name as your company.",
89
- accountHolderDescriptionIndividual: "This should be you, since the bank account has to be in your name",
90
- accountHolderDescriptionSoleProp: " The bank account holder has to have the same name as your sole proprietorship",
91
88
  accountHolderTerms: "Account Holder Terms",
92
89
  accountName: "Account name",
93
90
  accountNumber: "Account number",
@@ -1749,7 +1746,7 @@ const useCoreContext = () => {
1749
1746
  if (!context) throw Error("You need a <CoreProvider> to use core context");
1750
1747
  return context;
1751
1748
  };
1752
- let suppressed = false;
1749
+ const suppressed = false;
1753
1750
  const consoleMethodsPrefixable = Object.freeze([
1754
1751
  "debug",
1755
1752
  "info",
@@ -1853,7 +1850,7 @@ const KNOWN_DISALLOWED_INDEX_DATASET_STATES = [
1853
1850
  StateCodesUS.California,
1854
1851
  StateCodesUS.Texas
1855
1852
  ];
1856
- const logger$K = createLogger("useBusinessData");
1853
+ const logger$L = createLogger("useBusinessData");
1857
1854
  function useBusinessData({
1858
1855
  handleCompanyIndexSearch,
1859
1856
  handleCompanyDeepSearch,
@@ -1891,7 +1888,7 @@ function useBusinessData({
1891
1888
  try {
1892
1889
  setSearching("loading");
1893
1890
  if (!handleCompanyDeepSearch || !handleCompanyIndexSearch) {
1894
- logger$K.error("Missing handlers for searchForBusiness");
1891
+ logger$L.error("Missing handlers for searchForBusiness");
1895
1892
  setSearchResults([]);
1896
1893
  return [];
1897
1894
  }
@@ -1914,7 +1911,7 @@ function useBusinessData({
1914
1911
  return response == null ? void 0 : response.results;
1915
1912
  } catch (e) {
1916
1913
  setSearching("error");
1917
- logger$K.error(e);
1914
+ logger$L.error(e);
1918
1915
  } finally {
1919
1916
  setCachedSearch(data);
1920
1917
  setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
@@ -1925,7 +1922,7 @@ function useBusinessData({
1925
1922
  const fetchBusinessData = useCallback(
1926
1923
  async (company, state) => {
1927
1924
  if (!handleGetCompanyDataset || !handleRefreshCompanyDataset) {
1928
- logger$K.error("Missing handlers for fetchBusinessData");
1925
+ logger$L.error("Missing handlers for fetchBusinessData");
1929
1926
  return;
1930
1927
  }
1931
1928
  const date = (/* @__PURE__ */ new Date()).toDateString();
@@ -1935,7 +1932,7 @@ function useBusinessData({
1935
1932
  setVerifying("idle");
1936
1933
  setInvalidTin(false);
1937
1934
  if (state) {
1938
- const businessData2 = isDataCompliant && !KNOWN_DISALLOWED_INDEX_DATASET_STATES.includes(state) ? await handleGetCompanyDataset({
1935
+ return isDataCompliant && !KNOWN_DISALLOWED_INDEX_DATASET_STATES.includes(state) ? await handleGetCompanyDataset({
1939
1936
  companyId: company.id,
1940
1937
  country: "US",
1941
1938
  state
@@ -1944,19 +1941,17 @@ function useBusinessData({
1944
1941
  country: "US",
1945
1942
  state
1946
1943
  });
1947
- return businessData2;
1948
1944
  }
1949
- const businessData = isDataCompliant ? await handleGetCompanyDataset({
1945
+ return isDataCompliant ? await handleGetCompanyDataset({
1950
1946
  companyId: company.id,
1951
1947
  country: "US"
1952
1948
  }) : await handleRefreshCompanyDataset({
1953
1949
  companyId: company.id,
1954
1950
  country: "US"
1955
1951
  });
1956
- return businessData;
1957
1952
  } catch (e) {
1958
1953
  setFetching("error");
1959
- logger$K.error(e);
1954
+ logger$L.error(e);
1960
1955
  } finally {
1961
1956
  setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
1962
1957
  }
@@ -1966,7 +1961,7 @@ function useBusinessData({
1966
1961
  const verifyBusinessData = useCallback(
1967
1962
  async (data, tin) => {
1968
1963
  if (!handleVerifyTin) {
1969
- logger$K.log("Missing handlers for verifyBusinessData");
1964
+ logger$L.log("Missing handlers for verifyBusinessData");
1970
1965
  return;
1971
1966
  }
1972
1967
  try {
@@ -1982,7 +1977,7 @@ function useBusinessData({
1982
1977
  return matched;
1983
1978
  } catch (e) {
1984
1979
  setVerifying("error");
1985
- logger$K.error(e);
1980
+ logger$L.error(e);
1986
1981
  } finally {
1987
1982
  setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
1988
1983
  }
@@ -1995,7 +1990,7 @@ function useBusinessData({
1995
1990
  await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
1996
1991
  } catch (e) {
1997
1992
  setResettingTrustedData("error");
1998
- logger$K.error(e);
1993
+ logger$L.error(e);
1999
1994
  } finally {
2000
1995
  setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
2001
1996
  }
@@ -2265,6 +2260,7 @@ const svgs = {
2265
2260
  "field-error": lazy(
2266
2261
  () => import("./warning-circle-fill-FaaY90uz.js")
2267
2262
  ),
2263
+ hide: lazy(() => import("./hide-CWI5yHxd.js")),
2268
2264
  "info-circle": lazy(() => import("./info-B_8Cr-vS.js")),
2269
2265
  image: lazy(() => import("./image-Ol9hzDvF.js")),
2270
2266
  "light-bulb": lazy(() => import("./idea-CtaTpGVP.js")),
@@ -2280,6 +2276,7 @@ const svgs = {
2280
2276
  remove: lazy(() => import("./cross-circle-fill-small-ChSvrRGZ.js")),
2281
2277
  save: lazy(() => import("./save-BueTh8B0.js")),
2282
2278
  search: lazy(() => import("./search-BvJVZbOV.js")),
2279
+ show: lazy(() => import("./show-Cm_JGm0K.js")),
2283
2280
  store: lazy(() => import("./store-BLl8m644.js")),
2284
2281
  trust: lazy(() => import("./partner-B9xMZpSw.js")),
2285
2282
  user: lazy(() => import("./person-lPJ07vyF.js")),
@@ -2398,12 +2395,12 @@ const unscalableIconNames = [
2398
2395
  "upload",
2399
2396
  "warning"
2400
2397
  ];
2401
- const logger$J = createLogger("Icon");
2398
+ const logger$K = createLogger("Icon");
2402
2399
  const Svg = ({ className, name, testId, alt, type }) => {
2403
2400
  const LazyLoadedSvg = svgs[name];
2404
2401
  const viewBox = unscalableIconNames.includes(name) ? "0 0 16 16" : void 0;
2405
2402
  if (!LazyLoadedSvg) {
2406
- logger$J.error(`No such svg: "${name}"`);
2403
+ logger$K.error(`No such svg: "${name}"`);
2407
2404
  return null;
2408
2405
  }
2409
2406
  return /* @__PURE__ */ jsx("span", { className: cx(`adyen-kyc-${type}`, className), "data-testid": testId, children: /* @__PURE__ */ jsx(Suspense, { fallback: null, children: viewBox ? /* @__PURE__ */ jsx(LazyLoadedSvg, { alt, "aria-hidden": type === "icon", viewBox }) : /* @__PURE__ */ jsx(LazyLoadedSvg, { alt, "aria-hidden": type === "icon" }) }) });
@@ -2641,10 +2638,10 @@ function useFormRouterContext() {
2641
2638
  }
2642
2639
  return context;
2643
2640
  }
2644
- const logger$I = createLogger("Link");
2641
+ const logger$J = createLogger("Link");
2645
2642
  const isValidLink = (href) => {
2646
2643
  if (href === "#") {
2647
- logger$I.error(
2644
+ logger$J.error(
2648
2645
  'Links must include a valid href. If your href is "#", consider using a Button instead'
2649
2646
  );
2650
2647
  return false;
@@ -2912,7 +2909,9 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
2912
2909
  ExperimentNames2["EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation"] = "EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation";
2913
2910
  ExperimentNames2["EnableFinancialInformationComponentV4"] = "EnableFinancialInformationComponentV4";
2914
2911
  ExperimentNames2["EnablePreferInstantVerificationFlow"] = "EnablePreferInstantVerificationFlow";
2912
+ ExperimentNames2["EnablePhoneFieldScenario"] = "EnablePhoneFieldScenario";
2915
2913
  ExperimentNames2["EnableAUIncorporatedPartnershipSkipRegistrationNumber"] = "EnableAUIncorporatedPartnershipSkipRegistrationNumber";
2914
+ ExperimentNames2["EnableCompanyTrusteeSkipABN"] = "EnableCompanyTrusteeSkipABN";
2916
2915
  return ExperimentNames2;
2917
2916
  })(ExperimentNames || {});
2918
2917
  const debounce = (func, delay) => {
@@ -2980,7 +2979,7 @@ const useSetting = (settingName) => {
2980
2979
  const { getSetting } = context;
2981
2980
  return getSetting(settingName);
2982
2981
  };
2983
- const logger$H = createLogger("useAllowedCountries");
2982
+ const logger$I = createLogger("useAllowedCountries");
2984
2983
  const useAllowedCountries = () => {
2985
2984
  const acceptedCountries = useSetting("acceptedCountries");
2986
2985
  const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
@@ -2989,7 +2988,7 @@ const useAllowedCountries = () => {
2989
2988
  );
2990
2989
  useEffect(() => {
2991
2990
  if (acceptedCountries !== void 0) return;
2992
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$H.error);
2991
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$I.error);
2993
2992
  }, [acceptedCountries]);
2994
2993
  return allowedCountries;
2995
2994
  };
@@ -3009,11 +3008,72 @@ class ValidationResult {
3009
3008
  getError() {
3010
3009
  return this.validationResults.find((result) => result.hasError);
3011
3010
  }
3012
- /** Returns all validation results that returned an error */
3013
- getAllErrors() {
3014
- return this.validationResults.filter((result) => result.hasError);
3015
- }
3016
3011
  }
3012
+ const logger$H = createLogger("useAsyncValidator");
3013
+ const useAsyncValidator = (asyncRules) => {
3014
+ const [asyncValidationResults, setAsyncValidationResults] = useState({});
3015
+ const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
3016
+ const triggerAsyncValidation = useCallback(
3017
+ (field, formState, mode) => {
3018
+ if (!asyncRules) return clearAsyncValidationResults();
3019
+ const rule = asyncRules[field];
3020
+ if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
3021
+ const value = formState.data[field];
3022
+ return rule.asyncValidate(formState.data[field], { state: formState }).then((isValid) => {
3023
+ setAsyncValidationResults({
3024
+ [field]: new ValidationResult([
3025
+ {
3026
+ isValid,
3027
+ errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, { state: formState }) : rule.errorMessage,
3028
+ hasError: !isValid
3029
+ }
3030
+ ])
3031
+ });
3032
+ }).catch(logger$H.error);
3033
+ },
3034
+ [asyncRules, clearAsyncValidationResults]
3035
+ );
3036
+ return {
3037
+ asyncValidationResults,
3038
+ triggerAsyncValidation,
3039
+ clearAsyncValidationResults
3040
+ };
3041
+ };
3042
+ const useStaticValidator = (rules2) => {
3043
+ const getRulesForField = useCallback(
3044
+ (field) => {
3045
+ const fallbackRule = {
3046
+ validate: () => true,
3047
+ modes: ["blur", "input"]
3048
+ };
3049
+ const fieldRules = (rules2 == null ? void 0 : rules2[field]) ?? [fallbackRule];
3050
+ return Array.isArray(fieldRules) ? fieldRules : [fieldRules];
3051
+ },
3052
+ [rules2]
3053
+ );
3054
+ const triggerStaticValidation = useCallback(
3055
+ ({ key, value, mode = "blur" }, context) => {
3056
+ var _a, _b;
3057
+ const fieldRules = getRulesForField(key);
3058
+ const isFieldOptional = !!((_a = context == null ? void 0 : context.state.optionalFields) == null ? void 0 : _a.includes(key));
3059
+ const isFieldObscured = !!((_b = context == null ? void 0 : context.state.obscuredFields) == null ? void 0 : _b.includes(key));
3060
+ const validationRulesResult = fieldRules.map((rule) => {
3061
+ const shouldValidate = rule.modes.includes(mode) && !isFieldObscured;
3062
+ const isValid = isFieldOptional && isEmpty$1(value) ? true : rule.validate(value, context);
3063
+ return {
3064
+ isValid,
3065
+ errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, context) : rule.errorMessage,
3066
+ hasError: shouldValidate && !isValid
3067
+ };
3068
+ });
3069
+ return new ValidationResult(validationRulesResult);
3070
+ },
3071
+ [getRulesForField]
3072
+ );
3073
+ return {
3074
+ triggerStaticValidation
3075
+ };
3076
+ };
3017
3077
  const processField = ({
3018
3078
  key,
3019
3079
  value = null,
@@ -3329,71 +3389,6 @@ function reducer({
3329
3389
  }
3330
3390
  };
3331
3391
  }
3332
- const logger$G = createLogger("useAsyncValidator");
3333
- const useAsyncValidator = (asyncRules) => {
3334
- const [asyncValidationResults, setAsyncValidationResults] = useState({});
3335
- const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
3336
- const triggerAsyncValidation = useCallback(
3337
- (field, formState, mode) => {
3338
- if (!asyncRules) return clearAsyncValidationResults();
3339
- const rule = asyncRules[field];
3340
- if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
3341
- const value = formState.data[field];
3342
- return rule.asyncValidate(formState.data[field], { state: formState }).then((isValid) => {
3343
- setAsyncValidationResults({
3344
- [field]: new ValidationResult([
3345
- {
3346
- isValid,
3347
- errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, { state: formState }) : rule.errorMessage,
3348
- hasError: !isValid
3349
- }
3350
- ])
3351
- });
3352
- }).catch(logger$G.error);
3353
- },
3354
- [asyncRules, clearAsyncValidationResults]
3355
- );
3356
- return {
3357
- asyncValidationResults,
3358
- triggerAsyncValidation,
3359
- clearAsyncValidationResults
3360
- };
3361
- };
3362
- const useStaticValidator = (rules2) => {
3363
- const getRulesForField = useCallback(
3364
- (field) => {
3365
- const fallbackRule = {
3366
- validate: () => true,
3367
- modes: ["blur", "input"]
3368
- };
3369
- const fieldRules = (rules2 == null ? void 0 : rules2[field]) ?? [fallbackRule];
3370
- return Array.isArray(fieldRules) ? fieldRules : [fieldRules];
3371
- },
3372
- [rules2]
3373
- );
3374
- const triggerStaticValidation = useCallback(
3375
- ({ key, value, mode = "blur" }, context) => {
3376
- var _a, _b;
3377
- const fieldRules = getRulesForField(key);
3378
- const isFieldOptional = !!((_a = context == null ? void 0 : context.state.optionalFields) == null ? void 0 : _a.includes(key));
3379
- const isFieldObscured = !!((_b = context == null ? void 0 : context.state.obscuredFields) == null ? void 0 : _b.includes(key));
3380
- const validationRulesResult = fieldRules.map((rule) => {
3381
- const shouldValidate = rule.modes.includes(mode) && !isFieldObscured;
3382
- const isValid = isFieldOptional && isEmpty$1(value) ? true : rule.validate(value, context);
3383
- return {
3384
- isValid,
3385
- errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, context) : rule.errorMessage,
3386
- hasError: shouldValidate && !isValid
3387
- };
3388
- });
3389
- return new ValidationResult(validationRulesResult);
3390
- },
3391
- [getRulesForField]
3392
- );
3393
- return {
3394
- triggerStaticValidation
3395
- };
3396
- };
3397
3392
  const mergeStaticAndAsyncErrorsState = (staticValidationErrors, asyncValidationErrors, schema, optionalFields) => {
3398
3393
  const fields = optionalFields ? [...schema, ...optionalFields] : schema;
3399
3394
  if (!fields.length) return staticValidationErrors;
@@ -6315,8 +6310,6 @@ const stateFormatGuidanceText = {
6315
6310
  }
6316
6311
  }
6317
6312
  };
6318
- const emailPattern = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
6319
- const bankStatementDescriptionPattern = /^[\s+$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6a-zA-Z0-9-."_,:;'*!@#%()+?¿/&「」]*$/;
6320
6313
  const businessRegistrationNumberPatterns = {
6321
6314
  [CountryCodes.Australia]: { default: /^\d{9}$/, associationIncorporated: /^[a-zA-Z0-9]{3,20}$/ },
6322
6315
  [CountryCodes.Austria]: {
@@ -6430,43 +6423,6 @@ const businessRegistrationNumberPatterns = {
6430
6423
  default: /^\d{9}$/
6431
6424
  }
6432
6425
  };
6433
- const CountryIdNumberPatterns = {
6434
- [CountryCodes.Brazil]: /^\d{11}$/,
6435
- [CountryCodes.Canada]: /^\d{9}$/,
6436
- [CountryCodes.Croatia]: /^\d{11}$/,
6437
- [CountryCodes.Denmark]: /^\d{10}$/,
6438
- [CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
6439
- [CountryCodes.Poland]: /^\d{11}$/,
6440
- [CountryCodes.Romania]: /^\d{13}$/,
6441
- [CountryCodes.Singapore]: /^[A-Z][0-9]{7}[A-Z]$/,
6442
- [CountryCodes.Spain]: {
6443
- dni: /(^[KL]?\d{8}[A-Z]$)/,
6444
- nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
6445
- },
6446
- [CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
6447
- [CountryCodes.UnitedStates]: {
6448
- // used by CountryCodes.PuertoRico
6449
- ssn: /^\d{9}$/,
6450
- ssnLastFour: /^\d{4}$/
6451
- }
6452
- };
6453
- const DriversLicenseCardNumberPatterns = {
6454
- [CountryCodes.NewZealand]: /^[\d]{3}$/,
6455
- [CountryCodes.Australia]: /^[A-Z0-9]{5,11}$/
6456
- };
6457
- const DriversLicenseNumberPatterns = {
6458
- [CountryCodes.Australia]: /^[A-Za-z0-9]{5,11}$/,
6459
- [CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
6460
- [CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
6461
- };
6462
- const PassportNumberPatterns = {
6463
- [CountryCodes.Australia]: /^[A-Z]{1,2}\d{7}$/,
6464
- [CountryCodes.HongKong]: /^[A-Z]{1,2}\d{6}[A-Z0-9]{1,2}$/,
6465
- [CountryCodes.NewZealand]: /[A-Z]{2}[0-9]{6,7}/
6466
- };
6467
- const ProofOfIdentityCardPatterns = {
6468
- [CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
6469
- };
6470
6426
  const defaultFieldMetadata$9 = {
6471
6427
  label: "registrationNumber"
6472
6428
  };
@@ -7404,7 +7360,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
7404
7360
  };
7405
7361
  };
7406
7362
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
7407
- const logger$F = createLogger("MaskedInputText");
7363
+ const logger$G = createLogger("MaskedInputText");
7408
7364
  const MaskedInputText = ({
7409
7365
  value,
7410
7366
  onInput,
@@ -7449,7 +7405,7 @@ const MaskedInputText = ({
7449
7405
  };
7450
7406
  useEffect(() => {
7451
7407
  if (!mask) {
7452
- logger$F.warn("`mask` is undefined. No masking of input will take place.");
7408
+ logger$G.warn("`mask` is undefined. No masking of input will take place.");
7453
7409
  }
7454
7410
  }, [mask]);
7455
7411
  const getMaskResult = useCallback(
@@ -7493,7 +7449,7 @@ const MaskedInputText = ({
7493
7449
  return;
7494
7450
  }
7495
7451
  if (preserveMismatchingInitialValue) {
7496
- logger$F.warn(
7452
+ logger$G.warn(
7497
7453
  `Value received "${value}" does not match mask`,
7498
7454
  maskResult,
7499
7455
  `
@@ -7503,7 +7459,7 @@ Preserving mismatched initial value until user input.`
7503
7459
  return;
7504
7460
  }
7505
7461
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
7506
- logger$F.warn(
7462
+ logger$G.warn(
7507
7463
  `Value received "${value}" does not match mask`,
7508
7464
  maskResult,
7509
7465
  `
@@ -10343,8 +10299,7 @@ const companyBase = {
10343
10299
  dateOfIncorporation: { rule: "countryRequiresDateOfIncorporationForCompanies" },
10344
10300
  exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
10345
10301
  registrationNumber: { rule: "countryRequiresRegistrationNumberForCompanies" },
10346
- countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" },
10347
- numberOfEmployees: { rule: "countryRequiringFinancialInformation" }
10302
+ countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" }
10348
10303
  };
10349
10304
  const businessDetailsBase = {
10350
10305
  /* Base required fields */
@@ -10374,6 +10329,10 @@ const taxInformationBase$1 = {
10374
10329
  exemptedFromTax: { rule: "countryHasTaxExemptionsForSomeCompanies" },
10375
10330
  isUen: { rule: "countryUsesUenOrGst" }
10376
10331
  };
10332
+ const financialInformationBase$1 = {
10333
+ numberOfEmployees: { rule: "countryRequiringFinancialInformation" },
10334
+ financialReportingDate: { rule: "countryRequiringFinancialInformation" }
10335
+ };
10377
10336
  const companyTypes = [
10378
10337
  {
10379
10338
  id: CompanyTypesValue.PRIVATE_COMPANY,
@@ -10410,12 +10369,14 @@ const fieldsPerScenario$3 = {
10410
10369
  L0: {
10411
10370
  country: { rule: "REQUIRED" },
10412
10371
  legalCompanyName: { rule: "REQUIRED" },
10413
- stateOrProvince: { rule: "countryRequiresStateOrProvince" }
10372
+ stateOrProvince: { rule: "countryRequiresStateOrProvince" },
10373
+ ...financialInformationBase$1
10414
10374
  },
10415
- L1: { ...companyBase },
10375
+ L1: { ...companyBase, ...financialInformationBase$1 },
10416
10376
  L: {
10417
10377
  ...companyBase,
10418
- ...taxInformationBase$1
10378
+ ...taxInformationBase$1,
10379
+ ...financialInformationBase$1
10419
10380
  },
10420
10381
  L_PROOFOFADDRESS: {
10421
10382
  proofOfAddressDocument: { rule: "REQUIRED" }
@@ -11141,7 +11102,7 @@ function Dropzone(props) {
11141
11102
  isRequired && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: i18n.get("fieldIsRequired") })
11142
11103
  ] });
11143
11104
  }
11144
- const logger$E = createLogger("TextArea");
11105
+ const logger$F = createLogger("TextArea");
11145
11106
  function TextArea(props) {
11146
11107
  const { classNameModifiers, uniqueId, ...passedProps } = props;
11147
11108
  const {
@@ -11156,7 +11117,7 @@ function TextArea(props) {
11156
11117
  const { i18n } = useI18nContext();
11157
11118
  const [value, setValue] = useState("");
11158
11119
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11159
- logger$E.error("Error: Form fields that rely on InputBase may not have an onChange property");
11120
+ logger$F.error("Error: Form fields that rely on InputBase may not have an onChange property");
11160
11121
  }
11161
11122
  const handleInput = (e) => {
11162
11123
  var _a;
@@ -11571,11 +11532,11 @@ const financialInfoValidationRules = {
11571
11532
  }
11572
11533
  };
11573
11534
  const financialInformationReportedValueOptions = "adyen-kyc-financial-information-reported-value-options";
11574
- const styles$7 = {
11535
+ const styles$8 = {
11575
11536
  "financial-information-reported-value-options": "adyen-kyc-financial-information-reported-value-options",
11576
11537
  financialInformationReportedValueOptions
11577
11538
  };
11578
- const logger$D = createLogger("InputCurrency");
11539
+ const logger$E = createLogger("InputCurrency");
11579
11540
  const determineDecimalSeparator = (formatter) => formatter.formatToParts(0.1).find((part) => part.type === "decimal").value;
11580
11541
  const determineCurrencySymbol = (formatter) => formatter.formatToParts(0).find((part) => part.type === "currency").value;
11581
11542
  const getNumberFromFormattedCurrency = (formatted, decimalSeparator) => {
@@ -11606,7 +11567,7 @@ const InputCurrency = ({
11606
11567
  const rawValue = e.target.value;
11607
11568
  const value = getNumberFromFormattedCurrency(rawValue, decimalSeparator);
11608
11569
  if (Number.isNaN(value)) {
11609
- logger$D.warn(`Unable to get number from formatted currency: "${rawValue}"`);
11570
+ logger$E.warn(`Unable to get number from formatted currency: "${rawValue}"`);
11610
11571
  setText(isUndefinedOrNull(amount) ? currencySymbol : formatter.format(amount));
11611
11572
  return;
11612
11573
  }
@@ -11619,7 +11580,7 @@ const InputCurrency = ({
11619
11580
  };
11620
11581
  const reportedValue = "adyen-kyc-reported-value";
11621
11582
  const reportedValueInput = "adyen-kyc-reported-value-input";
11622
- const styles$6 = {
11583
+ const styles$7 = {
11623
11584
  "reported-value": "adyen-kyc-reported-value",
11624
11585
  reportedValue,
11625
11586
  "reported-value-input": "adyen-kyc-reported-value-input",
@@ -11635,7 +11596,7 @@ const ReportedValue = ({
11635
11596
  isValid
11636
11597
  }) => {
11637
11598
  const { i18n } = useI18nContext();
11638
- return /* @__PURE__ */ jsx("div", { className: styles$6.reportedValue, children: /* @__PURE__ */ jsx(Field, { name: fieldName, errorMessage, isValid, helper, children: (childProps) => /* @__PURE__ */ jsx(
11599
+ return /* @__PURE__ */ jsx("div", { className: styles$7.reportedValue, children: /* @__PURE__ */ jsx(Field, { name: fieldName, errorMessage, isValid, helper, children: (childProps) => /* @__PURE__ */ jsx(
11639
11600
  InputCurrency,
11640
11601
  {
11641
11602
  ...childProps,
@@ -11643,7 +11604,7 @@ const ReportedValue = ({
11643
11604
  currency,
11644
11605
  amount,
11645
11606
  onAmountChanged,
11646
- className: styles$6.reportedValueInput
11607
+ className: styles$7.reportedValueInput
11647
11608
  }
11648
11609
  ) }) });
11649
11610
  };
@@ -11660,6 +11621,7 @@ const getSchema = (data) => [
11660
11621
  function FinancialInformation(props) {
11661
11622
  var _a;
11662
11623
  const { i18n } = useI18nContext();
11624
+ const { id } = props;
11663
11625
  const defaultCurrency = ((_a = currencyByCountry[props.country]) == null ? void 0 : _a[0]) ?? "EUR";
11664
11626
  const { handleChangeFor, data, valid, errors, fieldProblems, schema } = useForm({
11665
11627
  ...props,
@@ -11669,7 +11631,7 @@ function FinancialInformation(props) {
11669
11631
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
11670
11632
  });
11671
11633
  const { updateStateSlice } = useGlobalDataSlice(
11672
- "companyFinancialInformation"
11634
+ id
11673
11635
  );
11674
11636
  useEffect(() => {
11675
11637
  updateStateSlice({
@@ -11776,7 +11738,7 @@ function FinancialInformation(props) {
11776
11738
  ],
11777
11739
  onChange: updateReportedValueOption,
11778
11740
  showContentOnlyOnSelected: true,
11779
- className: styles$7.financialInformationReportedValueOptions
11741
+ className: styles$8.financialInformationReportedValueOptions
11780
11742
  }
11781
11743
  )
11782
11744
  }
@@ -12071,28 +12033,7 @@ function FieldContainer(props) {
12071
12033
  }
12072
12034
  return renderField(fieldName);
12073
12035
  }
12074
- const isIntersectionObserverSupported = typeof IntersectionObserver === "function";
12075
- function useIsElementVisible(ref, fallback = true) {
12076
- const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
12077
- const observerRef = useRef();
12078
- useEffect(() => {
12079
- if (!isIntersectionObserverSupported) return;
12080
- observerRef.current = new IntersectionObserver(
12081
- ([entry]) => setIsOnScreen(entry.isIntersecting)
12082
- );
12083
- }, []);
12084
- useEffect(() => {
12085
- var _a;
12086
- if (!ref.current) return;
12087
- (_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
12088
- return () => {
12089
- var _a2;
12090
- (_a2 = observerRef.current) == null ? void 0 : _a2.disconnect();
12091
- };
12092
- }, [ref]);
12093
- return isOnScreen;
12094
- }
12095
- const logger$C = createLogger("SearchAddress");
12036
+ const logger$D = createLogger("SearchAddress");
12096
12037
  const SearchAddress = ({
12097
12038
  data,
12098
12039
  legalEntityId,
@@ -12101,8 +12042,7 @@ const SearchAddress = ({
12101
12042
  handleAddressSearch,
12102
12043
  handleFindAddress,
12103
12044
  addressType,
12104
- kompanyAddress,
12105
- kompanyPrefilled = false
12045
+ kompanyAddress
12106
12046
  }) => {
12107
12047
  const { i18n } = useI18nContext();
12108
12048
  const [items, setItems] = useState([]);
@@ -12110,21 +12050,13 @@ const SearchAddress = ({
12110
12050
  const [resetSearch, setResetSearch] = useState(false);
12111
12051
  const [searchText, setSearchText] = useState(null);
12112
12052
  const [showSearchList, setShowSearchList] = useState(false);
12113
- const searchBoxRef = useRef(null);
12114
- const isVisible = useIsElementVisible(searchBoxRef);
12115
12053
  const canAutoFillKompanyAddress = kompanyAddress && searchText !== kompanyAddress && addressType === "registrationAddress";
12116
12054
  useEffect(() => {
12117
12055
  setSearchText(kompanyAddress);
12118
12056
  if (canAutoFillKompanyAddress) {
12119
- const searchForAddress = () => getSearchItems(kompanyAddress);
12120
- searchForAddress();
12057
+ getSearchItems(kompanyAddress);
12121
12058
  }
12122
12059
  }, [kompanyAddress]);
12123
- useEffect(() => {
12124
- if (isVisible && kompanyAddress && addressType === "registrationAddress" && !kompanyPrefilled) {
12125
- setShowSearchList(true);
12126
- }
12127
- }, [isVisible, kompanyAddress, addressType, kompanyPrefilled]);
12128
12060
  useEffect(() => {
12129
12061
  setItems([]);
12130
12062
  setResetSearch(true);
@@ -12134,7 +12066,7 @@ const SearchAddress = ({
12134
12066
  const response = await handleFindAddress(selectedAddressId);
12135
12067
  autocompleteAddressForm(response);
12136
12068
  } catch (e) {
12137
- logger$C.error(e);
12069
+ logger$D.error(e);
12138
12070
  }
12139
12071
  };
12140
12072
  const onDrilldown = async (selectedAddress) => {
@@ -12145,7 +12077,7 @@ const SearchAddress = ({
12145
12077
  );
12146
12078
  setItems((response == null ? void 0 : response.results) || []);
12147
12079
  } catch (e) {
12148
- logger$C.error(e);
12080
+ logger$D.error(e);
12149
12081
  }
12150
12082
  };
12151
12083
  const onChange = (e) => {
@@ -12197,7 +12129,7 @@ const SearchAddress = ({
12197
12129
  setItems([]);
12198
12130
  }
12199
12131
  } catch (e) {
12200
- logger$C.error(e);
12132
+ logger$D.error(e);
12201
12133
  }
12202
12134
  setLoading(false);
12203
12135
  }
@@ -12265,7 +12197,6 @@ const SearchAddress = ({
12265
12197
  name: "searchAddress",
12266
12198
  className: "adyen-kyc-u-margin-bottom-8",
12267
12199
  label: i18n.get("searchAddress"),
12268
- wrapperRef: searchBoxRef,
12269
12200
  children: (childProps) => /* @__PURE__ */ jsx(
12270
12201
  Select,
12271
12202
  {
@@ -12637,16 +12568,14 @@ function Address(props) {
12637
12568
  [dataProp == null ? void 0 : dataProp.country, i18n]
12638
12569
  );
12639
12570
  const {
12571
+ schema,
12640
12572
  data,
12641
12573
  errors,
12642
12574
  valid,
12643
12575
  isValid,
12644
12576
  fieldProblems,
12645
12577
  handleChangeFor,
12646
- triggerValidation,
12647
- resetToDefaultData,
12648
- schema,
12649
- setData
12578
+ triggerValidation
12650
12579
  } = useForm({
12651
12580
  ...props,
12652
12581
  schema: requiredFields,
@@ -12721,26 +12650,6 @@ function Address(props) {
12721
12650
  setShowAddAddressButton(false);
12722
12651
  }
12723
12652
  }, [shouldValidate]);
12724
- const canAutofillVerifiedBusinessAddress = Boolean(
12725
- (verifiedBusiness == null ? void 0 : verifiedBusiness.street) && (verifiedBusiness == null ? void 0 : verifiedBusiness.city) && (verifiedBusiness == null ? void 0 : verifiedBusiness.state) && verifiedBusiness.zipcode
12726
- );
12727
- useEffect(() => {
12728
- if (!isExperimentEnabled("EnableNewBusinessDetailsFlow")) return;
12729
- if (verifiedBusiness && canAutofillVerifiedBusinessAddress) {
12730
- setShowAutocompletedAddressFields(true);
12731
- setShowAddAddressButton(false);
12732
- setData("address", verifiedBusiness.street);
12733
- setData("city", verifiedBusiness.city);
12734
- setData("stateOrProvince", verifiedBusiness.state);
12735
- setData("postalCode", verifiedBusiness.zipcode);
12736
- return triggerValidation();
12737
- }
12738
- if (!(dataProp == null ? void 0 : dataProp.address) || !(dataProp == null ? void 0 : dataProp.city) || !(dataProp == null ? void 0 : dataProp.postalCode)) {
12739
- setShowAutocompletedAddressFields(false);
12740
- setShowAddAddressButton(true);
12741
- resetToDefaultData();
12742
- }
12743
- }, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
12744
12653
  const getComponent = (fieldName) => {
12745
12654
  if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
12746
12655
  const hideField = fieldName === "country" && hideCountry;
@@ -12828,8 +12737,7 @@ function Address(props) {
12828
12737
  legalEntityId,
12829
12738
  autocompleteAddressForm,
12830
12739
  addressType,
12831
- kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address,
12832
- kompanyPrefilled: canAutofillVerifiedBusinessAddress
12740
+ kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address
12833
12741
  }
12834
12742
  ),
12835
12743
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-search-address--below", children: [
@@ -12864,7 +12772,7 @@ Address.defaultProps = {
12864
12772
  requiredFields: ADDRESS_SCHEMA,
12865
12773
  countryCode: null
12866
12774
  };
12867
- const logger$B = createLogger("AddressFieldContainer");
12775
+ const logger$C = createLogger("AddressFieldContainer");
12868
12776
  const formatAddressItem = (item) => {
12869
12777
  if (item.description.includes("Addresses")) {
12870
12778
  const splittedDescription = item.description.split(" - ");
@@ -13002,7 +12910,7 @@ function FieldContainerComponent({
13002
12910
  setItems([]);
13003
12911
  }
13004
12912
  } catch (e) {
13005
- logger$B.error(e);
12913
+ logger$C.error(e);
13006
12914
  }
13007
12915
  setLoading(false);
13008
12916
  };
@@ -13036,7 +12944,7 @@ function FieldContainerComponent({
13036
12944
  });
13037
12945
  }
13038
12946
  } catch (e) {
13039
- logger$B.error(e);
12947
+ logger$C.error(e);
13040
12948
  }
13041
12949
  };
13042
12950
  const onDrilldown = async (address) => {
@@ -13048,7 +12956,7 @@ function FieldContainerComponent({
13048
12956
  ));
13049
12957
  setItems((response == null ? void 0 : response.results) || []);
13050
12958
  } catch (e) {
13051
- logger$B.error(e);
12959
+ logger$C.error(e);
13052
12960
  }
13053
12961
  };
13054
12962
  const handleOnChange = (e) => {
@@ -14242,12 +14150,36 @@ const COUNTRIES_USING_COMPANY_SEARCH = [
14242
14150
  const COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
14243
14151
  CountryCodes.UnitedKingdom
14244
14152
  ];
14153
+ const EFP_CAPABILITIES = [
14154
+ // Issuing
14155
+ "useCardInRestrictedCountriesCommercial",
14156
+ "useCardInRestrictedCountriesConsumer",
14157
+ "useCardInRestrictedIndustriesCommercial",
14158
+ "useCardInRestrictedIndustriesConsumer",
14159
+ "withdrawFromAtmCommercial",
14160
+ "withdrawFromAtmConsumer",
14161
+ "withdrawFromAtmInRestrictedCountriesCommercial",
14162
+ "withdrawFromAtmInRestrictedCountriesConsumer",
14163
+ "issueCardCommercial",
14164
+ "issueCardConsumer",
14165
+ "useCardConsumer",
14166
+ "useCardCommercial",
14167
+ "authorisedPaymentInstrumentUser",
14168
+ // Banking
14169
+ "issueBankAccount",
14170
+ "sendToThirdParty",
14171
+ "receiveFromThirdParty",
14172
+ // Capital
14173
+ "getGrantOffers",
14174
+ "receiveGrants"
14175
+ ];
14245
14176
  const rules$3 = ({
14246
14177
  data,
14247
14178
  country,
14248
14179
  taskType,
14249
14180
  isExperimentEnabled = () => false,
14250
- accountHolder
14181
+ accountHolder,
14182
+ rootLegalEntity
14251
14183
  }) => ({
14252
14184
  countryRequiresStateOrProvince: () => {
14253
14185
  if (COUNTRIES_WITH_STATES_DATASET.includes(country)) {
@@ -14350,7 +14282,7 @@ const rules$3 = ({
14350
14282
  }
14351
14283
  },
14352
14284
  countryHasTaxExemptionsForSomeCompanies: () => {
14353
- if (taskType === TaskTypes.COMPANY && country === CountryCodes.Australia && accountHolder === "aTrust") {
14285
+ if (taskType === TaskTypes.COMPANY && country === CountryCodes.Australia && accountHolder === "aTrust" && isExperimentEnabled("EnableCompanyTrusteeSkipABN")) {
14354
14286
  return "REQUIRED";
14355
14287
  }
14356
14288
  if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) {
@@ -14371,9 +14303,16 @@ const rules$3 = ({
14371
14303
  if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
14372
14304
  return "REQUIRED";
14373
14305
  }
14306
+ },
14307
+ countryRequiresFinancialInformationForSoleProps: () => {
14308
+ if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country) && country === CountryCodes.UnitedKingdom && keysOf((rootLegalEntity == null ? void 0 : rootLegalEntity.capabilities) ?? {}).some(
14309
+ (capability) => EFP_CAPABILITIES.includes(capability)
14310
+ )) {
14311
+ return "REQUIRED";
14312
+ }
14374
14313
  }
14375
14314
  });
14376
- const logger$A = createLogger("mapPayoutAccountSchemaToApiBankAccount");
14315
+ const logger$B = createLogger("mapPayoutAccountSchemaToApiBankAccount");
14377
14316
  const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCountry) => {
14378
14317
  var _a;
14379
14318
  if ("iban" in payoutAccount && payoutAccount.iban)
@@ -14453,7 +14392,7 @@ const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCoun
14453
14392
  routingNumber: payoutAccount.branchCode
14454
14393
  };
14455
14394
  default:
14456
- logger$A.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
14395
+ logger$B.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
14457
14396
  return {
14458
14397
  type: `${bankCountry.toLowerCase()}Local`,
14459
14398
  accountNumber: payoutAccount.bankAccountNumber
@@ -15102,7 +15041,7 @@ const mapHighExposureToLegalEntity = (data) => ({
15102
15041
  ...formatObject(data, highExposureApiKeyMapping)
15103
15042
  });
15104
15043
  const mapLegalEntityToSoleProp = (legalEntity) => {
15105
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
15044
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
15106
15045
  let solePropCompData;
15107
15046
  if (legalEntity == null ? void 0 : legalEntity.soleProprietorship) {
15108
15047
  solePropCompData = formatObject(legalEntity, solePropComponentsKeyMapping);
@@ -15135,6 +15074,11 @@ const mapLegalEntityToSoleProp = (legalEntity) => {
15135
15074
  ...mapApiDocumentToSolePropDocuments(legalEntity == null ? void 0 : legalEntity.id)
15136
15075
  };
15137
15076
  }
15077
+ if ((_k = legalEntity == null ? void 0 : legalEntity.soleProprietorship) == null ? void 0 : _k.financialReports) {
15078
+ solePropCompData.solePropFinancialInformation = mapFinancialReportsToFinancialInformation(
15079
+ legalEntity.soleProprietorship.financialReports
15080
+ );
15081
+ }
15138
15082
  }
15139
15083
  return solePropCompData;
15140
15084
  };
@@ -15160,6 +15104,14 @@ const mapSolePropToLegalEntity = (data) => {
15160
15104
  delete requestObj.soleProprietorship.vatNumber;
15161
15105
  delete requestObj.soleProprietorship.registrationNumber;
15162
15106
  }
15107
+ if (data.solePropFinancialInformation) {
15108
+ requestObj.soleProprietorship.financialReports = [
15109
+ formatObject(
15110
+ data.solePropFinancialInformation,
15111
+ financialInformationApiKeyMapping
15112
+ )
15113
+ ];
15114
+ }
15163
15115
  requestObj.type = LegalEntityType.SOLE_PROPRIETORSHIP;
15164
15116
  return requestObj;
15165
15117
  };
@@ -15318,7 +15270,7 @@ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
15318
15270
  const { bankStatementDocument, description } = payoutAccountDocuments;
15319
15271
  const entityType = TransferInstrumentType.BANK_ACCOUNT;
15320
15272
  const existingDocument = getDocument$1(entityId, DocumentType.BANK_STATEMENT);
15321
- const document2 = await createDocumentRequest({
15273
+ return createDocumentRequest({
15322
15274
  entityId,
15323
15275
  entityType,
15324
15276
  documentType: DocumentType.BANK_STATEMENT,
@@ -15326,7 +15278,6 @@ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
15326
15278
  description,
15327
15279
  existingDocument
15328
15280
  });
15329
- return document2;
15330
15281
  };
15331
15282
  const mapApiDocumentToPayoutDocuments = (entityId) => {
15332
15283
  const bankStatement = getDocument$1(entityId, DocumentType.BANK_STATEMENT) || null;
@@ -15535,10 +15486,9 @@ const useIdVerificationToken = ({
15535
15486
  const [sdkToken2, setSdkToken2] = useState();
15536
15487
  const [providerId, setProviderId] = useState();
15537
15488
  const [loadingStatus, setLoadingStatus] = useState();
15538
- const hasAllUserDetails = userDetails && Object.values(userDetails).every(Boolean);
15539
15489
  useEffect(() => {
15540
15490
  (async () => {
15541
- if (!hasAllUserDetails) return;
15491
+ if (!firstName || !lastName || !residencyCountry) return;
15542
15492
  try {
15543
15493
  setLoadingStatus("loading");
15544
15494
  const data = {
@@ -15563,7 +15513,7 @@ const useIdVerificationToken = ({
15563
15513
  setLoadingStatus("success");
15564
15514
  }
15565
15515
  })().catch(console.error);
15566
- }, [firstName, lastName, residencyCountry, hasAllUserDetails]);
15516
+ }, [firstName, lastName, residencyCountry]);
15567
15517
  return {
15568
15518
  providerId,
15569
15519
  sdkToken: sdkToken2,
@@ -15572,7 +15522,7 @@ const useIdVerificationToken = ({
15572
15522
  };
15573
15523
  const loaderWrapperLoader = "adyen-kyc-loader-wrapper-loader";
15574
15524
  const loaderWrapperLoaderActive = "adyen-kyc-loader-wrapper-loader-active";
15575
- const styles$5 = {
15525
+ const styles$6 = {
15576
15526
  "loader-wrapper-loader": "adyen-kyc-loader-wrapper-loader",
15577
15527
  loaderWrapperLoader,
15578
15528
  "loader-wrapper-loader-active": "adyen-kyc-loader-wrapper-loader-active",
@@ -15589,13 +15539,13 @@ const LoaderWrapper = ({
15589
15539
  const opacitySyle = status === "loading" ? {
15590
15540
  opacity: formOpacityWhenLoading
15591
15541
  } : { opacity: 1 };
15592
- const loaderWrapperClass = cx(styles$5.loaderWrapperLoader, {
15593
- [styles$5.loaderWrapperLoaderActive]: status === "loading" && showSpinner
15542
+ const loaderWrapperClass = cx(styles$6.loaderWrapperLoader, {
15543
+ [styles$6.loaderWrapperLoaderActive]: status === "loading" && showSpinner
15594
15544
  });
15595
- const overlayClass = cx(styles$5.loaderWrapper, className);
15545
+ const overlayClass = cx(styles$6.loaderWrapper, className);
15596
15546
  return /* @__PURE__ */ jsxs("div", { className: overlayClass, style: { position: "relative" }, children: [
15597
15547
  /* @__PURE__ */ jsx("div", { className: loaderWrapperClass, children: /* @__PURE__ */ jsx(Loader, { size: loaderSize }) }),
15598
- /* @__PURE__ */ jsx("div", { className: styles$5.loaderWrapperForm, style: opacitySyle, children })
15548
+ /* @__PURE__ */ jsx("div", { className: styles$6.loaderWrapperForm, style: opacitySyle, children })
15599
15549
  ] });
15600
15550
  };
15601
15551
  const containerId = "adyen-kyc-id-verification";
@@ -15648,7 +15598,7 @@ const initOnfido = async ({
15648
15598
  language: getOnfidoLocaleConfig(i18n)
15649
15599
  });
15650
15600
  };
15651
- const logger$z = createLogger("IdVerificationComponent");
15601
+ const logger$A = createLogger("IdVerificationComponent");
15652
15602
  function IdVerificationComponent({
15653
15603
  userDetails,
15654
15604
  legalEntityId,
@@ -15677,7 +15627,7 @@ function IdVerificationComponent({
15677
15627
  onIdVerificationError,
15678
15628
  onIdVerificationComplete
15679
15629
  });
15680
- })().catch(logger$z.error);
15630
+ })().catch(logger$A.error);
15681
15631
  return () => {
15682
15632
  if (onfidoSdk.current) onfidoSdk.current.tearDown();
15683
15633
  };
@@ -15721,7 +15671,7 @@ function IdDocumentAlreadyUpload(props) {
15721
15671
  ] })
15722
15672
  ] });
15723
15673
  }
15724
- const logger$y = createLogger("IdDocumentInstantVerificationComponent");
15674
+ const logger$z = createLogger("IdDocumentInstantVerificationComponent");
15725
15675
  const idVerificationSchema = [
15726
15676
  "instantIdVerificationData",
15727
15677
  "idDocumentType"
@@ -15793,7 +15743,7 @@ function IdDocumentInstantVerificationComponent(props) {
15793
15743
  userDetails: props.userDetails,
15794
15744
  legalEntityId: props.legalEntityId,
15795
15745
  onIdVerificationComplete: handleIdVerificationComplete,
15796
- onIdVerificationError: logger$y.error
15746
+ onIdVerificationError: logger$z.error
15797
15747
  }
15798
15748
  ),
15799
15749
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
@@ -16141,8 +16091,7 @@ function useVerification(fieldsToVerify, country) {
16141
16091
  if (!isDirty) return false;
16142
16092
  if (typeof field !== "string") return false;
16143
16093
  const hasVerification = FIELDS_WITH_EXTERNAL_VERIFICATION.includes(field);
16144
- if (hasVerification) return true;
16145
- return false;
16094
+ return hasVerification;
16146
16095
  }).map(async (field) => {
16147
16096
  switch (field) {
16148
16097
  case "idNumber":
@@ -16214,7 +16163,7 @@ const phoneFormatters = {
16214
16163
  };
16215
16164
  const phoneFields = ["phoneNumber"];
16216
16165
  const DEFAULT_PHONE_PREFIX = "+1";
16217
- const logger$x = createLogger("PhoneInput");
16166
+ const logger$y = createLogger("PhoneInput");
16218
16167
  const usePhonePrefixes = () => {
16219
16168
  const [phonePrefixes, setPhonePrefixes] = useState();
16220
16169
  useEffect(() => {
@@ -16222,7 +16171,7 @@ const usePhonePrefixes = () => {
16222
16171
  const loaded = (await import("./phonePrefixes-zV4hciyK.js")).default;
16223
16172
  setPhonePrefixes(loaded);
16224
16173
  };
16225
- loadPhonePrefixes().catch(logger$x.error);
16174
+ loadPhonePrefixes().catch(logger$y.error);
16226
16175
  }, []);
16227
16176
  return phonePrefixes;
16228
16177
  };
@@ -16306,6 +16255,8 @@ const PhoneInput = memo(
16306
16255
  PhoneInputComponent,
16307
16256
  (prevProps, nextProps) => prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate
16308
16257
  );
16258
+ const emailPattern = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
16259
+ const bankStatementDescriptionPattern = /^[\s+$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6a-zA-Z0-9-."_,:;'*!@#%()+?¿/&「」]*$/;
16309
16260
  const contactDetailsValidationRules = {
16310
16261
  email: {
16311
16262
  modes: ["blur"],
@@ -16373,6 +16324,43 @@ const ContactDetailsComp = memo(
16373
16324
  ContactDetailsComponent.defaultProps = {
16374
16325
  data: {}
16375
16326
  };
16327
+ const CountryIdNumberPatterns = {
16328
+ [CountryCodes.Brazil]: /^\d{11}$/,
16329
+ [CountryCodes.Canada]: /^\d{9}$/,
16330
+ [CountryCodes.Croatia]: /^\d{11}$/,
16331
+ [CountryCodes.Denmark]: /^\d{10}$/,
16332
+ [CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
16333
+ [CountryCodes.Poland]: /^\d{11}$/,
16334
+ [CountryCodes.Romania]: /^\d{13}$/,
16335
+ [CountryCodes.Singapore]: /^[A-Z][0-9]{7}[A-Z]$/,
16336
+ [CountryCodes.Spain]: {
16337
+ dni: /(^[KL]?\d{8}[A-Z]$)/,
16338
+ nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
16339
+ },
16340
+ [CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
16341
+ [CountryCodes.UnitedStates]: {
16342
+ // used by CountryCodes.PuertoRico
16343
+ ssn: /^\d{9}$/,
16344
+ ssnLastFour: /^\d{4}$/
16345
+ }
16346
+ };
16347
+ const DriversLicenseCardNumberPatterns = {
16348
+ [CountryCodes.NewZealand]: /^[\d]{3}$/,
16349
+ [CountryCodes.Australia]: /^[A-Z0-9]{5,11}$/
16350
+ };
16351
+ const DriversLicenseNumberPatterns = {
16352
+ [CountryCodes.Australia]: /^[A-Za-z0-9]{5,11}$/,
16353
+ [CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
16354
+ [CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
16355
+ };
16356
+ const PassportNumberPatterns = {
16357
+ [CountryCodes.Australia]: /^[A-Z]{1,2}\d{7}$/,
16358
+ [CountryCodes.HongKong]: /^[A-Z]{1,2}\d{6}[A-Z0-9]{1,2}$/,
16359
+ [CountryCodes.NewZealand]: /[A-Z]{2}[0-9]{6,7}/
16360
+ };
16361
+ const ProofOfIdentityCardPatterns = {
16362
+ [CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
16363
+ };
16376
16364
  const defaultFieldMetadata$5 = {
16377
16365
  label: "idNumber"
16378
16366
  };
@@ -17159,7 +17147,7 @@ const roleMetadata = {
17159
17147
  name: TrustMemberGuidanceLabel.TRUSTEE
17160
17148
  }
17161
17149
  };
17162
- const getRoleTagVariant = (role) => {
17150
+ const getRoleTagVariant$1 = (role) => {
17163
17151
  var _a;
17164
17152
  return ((_a = roleMetadata[role]) == null ? void 0 : _a.variant) ?? "blue";
17165
17153
  };
@@ -18741,21 +18729,47 @@ const individualDocumentForms = [
18741
18729
  proofOfRelationshipFormID
18742
18730
  ];
18743
18731
  function IndividualComponent(props) {
18744
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
18732
+ var _a, _b, _c, _d, _e, _f, _g, _h;
18745
18733
  const { i18n } = useI18nContext();
18746
- const [data, setData] = useState(props.data);
18734
+ const {
18735
+ activeForm: propActiveForm,
18736
+ allowedRoles,
18737
+ capabilities,
18738
+ country,
18739
+ data: propData,
18740
+ forms,
18741
+ handleGetIdVerificationToken,
18742
+ onCountryChange,
18743
+ onBack,
18744
+ onNext,
18745
+ parentLegalEntity,
18746
+ setHideFooter,
18747
+ taskType,
18748
+ trustedFields,
18749
+ trustedFieldsProvider,
18750
+ trustedRoles,
18751
+ legalEntityId,
18752
+ handleAddressSearch,
18753
+ handleFindAddress
18754
+ } = props;
18755
+ const [data, setData] = useState(propData);
18747
18756
  const [idVerificationMethodSelected, setIdVerificationMethodSelected] = useState("instantVerification");
18748
18757
  const stateRef = useRef({ setState: null });
18749
18758
  useEffect(() => {
18750
- const forms = Object.values(props.forms).reduce(
18759
+ var _a2, _b2;
18760
+ if (!forms) {
18761
+ return;
18762
+ }
18763
+ const activeFormsWithoutSummary = Object.values(forms).reduce(
18751
18764
  (acc, item) => [...acc, ...item.formId !== "summary" ? [item.formId] : []],
18752
18765
  []
18753
18766
  );
18754
- stateRef.current.setActiveForms(forms);
18755
- }, [props.forms.toString()]);
18767
+ (_b2 = (_a2 = stateRef.current).setActiveForms) == null ? void 0 : _b2.call(_a2, activeFormsWithoutSummary);
18768
+ }, [forms == null ? void 0 : forms.toString()]);
18756
18769
  useEffect(
18757
18770
  () => () => {
18758
- stateRef.current.setState({ type: "resetState" });
18771
+ var _a2, _b2;
18772
+ (_b2 = (_a2 = stateRef.current).setState) == null ? void 0 : _b2.call(_a2, { type: "resetState" });
18759
18773
  },
18760
18774
  []
18761
18775
  );
@@ -18779,18 +18793,18 @@ function IndividualComponent(props) {
18779
18793
  lastName: (_d = data == null ? void 0 : data.personalDetails) == null ? void 0 : _d.lastName,
18780
18794
  residencyCountry: (_e = data == null ? void 0 : data.personalDetails) == null ? void 0 : _e.residencyCountry
18781
18795
  };
18782
- const isLegalRepresentativeDetailsTask = props.taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
18796
+ const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
18783
18797
  const handleStateChange = ({
18784
18798
  currentState,
18785
18799
  prevState
18786
18800
  }) => {
18787
18801
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
18788
- const residencyCountryPrev = (_b2 = (_a2 = prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
18802
+ const residencyCountryPrev = (_b2 = (_a2 = prevState == null ? void 0 : prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
18789
18803
  const residencyCountry = (_d2 = (_c2 = currentState.data) == null ? void 0 : _c2.personalDetails) == null ? void 0 : _d2.residencyCountry;
18790
18804
  if (residencyCountry != null && residencyCountry !== residencyCountryPrev) {
18791
- props.onCountryChange(residencyCountry);
18805
+ onCountryChange == null ? void 0 : onCountryChange(residencyCountry);
18792
18806
  }
18793
- const idVerificationMethodPrev = (_f2 = (_e2 = prevState.data) == null ? void 0 : _e2.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod;
18807
+ const idVerificationMethodPrev = (_f2 = (_e2 = prevState == null ? void 0 : prevState.data) == null ? void 0 : _e2.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod;
18794
18808
  const idVerificationMethod = (_h2 = (_g2 = currentState.data) == null ? void 0 : _g2.idVerificationMethod) == null ? void 0 : _h2.idVerificationMethod;
18795
18809
  if (idVerificationMethod != null && idVerificationMethod !== idVerificationMethodPrev) {
18796
18810
  setIdVerificationMethodSelected(idVerificationMethod);
@@ -18803,31 +18817,31 @@ function IndividualComponent(props) {
18803
18817
  });
18804
18818
  };
18805
18819
  useEffect(() => {
18806
- var _a2, _b2, _c2;
18807
- const isIdDocumentFormActive = props.activeForm.formId === idDocumentFormID;
18808
- const isInstantIdVerificationEnabled = idVerificationMethodSelected === "instantVerification" && !!props.handleGetIdVerificationToken;
18809
- const isIdAlreadyUploaded = ((_a2 = data == null ? void 0 : data.idDocument) == null ? void 0 : _a2.instantIdVerificationData) || ((_c2 = (_b2 = props.data) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.idDocumentType);
18810
- props.setHideFooter(
18820
+ var _a2, _b2;
18821
+ const isIdDocumentFormActive = (propActiveForm == null ? void 0 : propActiveForm.formId) === idDocumentFormID;
18822
+ const isInstantIdVerificationEnabled = idVerificationMethodSelected === "instantVerification" && !!handleGetIdVerificationToken;
18823
+ const isIdAlreadyUploaded = ((_a2 = data == null ? void 0 : data.idDocument) == null ? void 0 : _a2.instantIdVerificationData) || ((_b2 = propData == null ? void 0 : propData.idDocument) == null ? void 0 : _b2.idDocumentType);
18824
+ setHideFooter == null ? void 0 : setHideFooter(
18811
18825
  isIdDocumentFormActive && !isIdAlreadyUploaded && isInstantIdVerificationEnabled
18812
18826
  );
18813
18827
  }, [
18814
- props.activeForm,
18828
+ propActiveForm,
18815
18829
  idVerificationMethodSelected,
18816
- props.handleGetIdVerificationToken,
18830
+ handleGetIdVerificationToken,
18817
18831
  (_f = data == null ? void 0 : data.idDocument) == null ? void 0 : _f.instantIdVerificationData,
18818
- (_h = (_g = props.data) == null ? void 0 : _g.idDocument) == null ? void 0 : _h.idDocumentType
18832
+ (_g = propData == null ? void 0 : propData.idDocument) == null ? void 0 : _g.idDocumentType
18819
18833
  ]);
18820
- const addressSchema = getAddressSchemaForCountry((_i = data == null ? void 0 : data.personalDetails) == null ? void 0 : _i.residencyCountry).filter(
18834
+ const addressSchema = getAddressSchemaForCountry((_h = data == null ? void 0 : data.personalDetails) == null ? void 0 : _h.residencyCountry).filter(
18821
18835
  (field) => {
18822
18836
  var _a2;
18823
- return !COUNTRIES_WITH_STATES_DATASET.includes((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) ? field !== "stateOrProvince" : true;
18837
+ return !!((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) && !COUNTRIES_WITH_STATES_DATASET.includes(data.personalDetails.residencyCountry) ? field !== "stateOrProvince" : true;
18824
18838
  }
18825
18839
  );
18826
18840
  const { updateStateSlice } = useGlobalDataSlice(
18827
18841
  "address"
18828
18842
  );
18829
18843
  const renderActiveForm = (activeForm) => {
18830
- var _a2, _b2, _c2;
18844
+ var _a2, _b2;
18831
18845
  return /* @__PURE__ */ jsxs(Fragment, { children: [
18832
18846
  /* @__PURE__ */ jsx(StateContextWatcher, { owner: "IndividualComponent", onChange: handleStateChange }),
18833
18847
  /* @__PURE__ */ jsx(StateContextSetter, { owner: "IndividualComponent", stateRef }),
@@ -18841,17 +18855,17 @@ function IndividualComponent(props) {
18841
18855
  ...personalFormProps,
18842
18856
  data: {
18843
18857
  ...personalFormProps == null ? void 0 : personalFormProps.data,
18844
- residencyCountry: props.country
18858
+ residencyCountry: country
18845
18859
  },
18846
18860
  ref: formsRef[personalDetailsFormID],
18847
18861
  heading: isLegalRepresentativeDetailsTask ? i18n.get("legalRepresentativeDetails") : i18n.get("personalDetails"),
18848
- taskType: props.taskType,
18862
+ taskType,
18849
18863
  id: personalDetailsFormID,
18850
- allowedRoles: props == null ? void 0 : props.allowedRoles,
18851
- capabilities: props.capabilities,
18852
- parentLegalEntity: props.parentLegalEntity,
18853
- trustedFieldsProvider: props.trustedFieldsProvider,
18854
- trustedRoles: props.trustedRoles
18864
+ allowedRoles,
18865
+ capabilities,
18866
+ parentLegalEntity,
18867
+ trustedFieldsProvider,
18868
+ trustedRoles
18855
18869
  }
18856
18870
  )
18857
18871
  }
@@ -18877,13 +18891,13 @@ function IndividualComponent(props) {
18877
18891
  {
18878
18892
  ...addressFormProps,
18879
18893
  id: addressFormID,
18880
- data: { ...data.address, country: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry },
18894
+ data: { ...addressFormProps == null ? void 0 : addressFormProps.data, country: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry },
18881
18895
  requiredFields: addressSchema,
18882
18896
  optionalFields: ["otherAddressInformation"],
18883
- trustedFields: (_b2 = props.trustedFields) == null ? void 0 : _b2.address,
18884
- legalEntityId: props.legalEntityId,
18885
- handleAddressSearch: props.handleAddressSearch,
18886
- handleFindAddress: props.handleFindAddress,
18897
+ trustedFields: trustedFields == null ? void 0 : trustedFields.address,
18898
+ legalEntityId,
18899
+ handleAddressSearch,
18900
+ handleFindAddress,
18887
18901
  onChange: handleAddressChange,
18888
18902
  hideCountry: true
18889
18903
  }
@@ -18891,7 +18905,7 @@ function IndividualComponent(props) {
18891
18905
  ] })
18892
18906
  }
18893
18907
  ),
18894
- !!props.handleGetIdVerificationToken && /* @__PURE__ */ jsx(
18908
+ !!handleGetIdVerificationToken && /* @__PURE__ */ jsx(
18895
18909
  "div",
18896
18910
  {
18897
18911
  className: activeForm.formId !== idVerificationMethodFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -18901,7 +18915,7 @@ function IndividualComponent(props) {
18901
18915
  ...idVerificationMethodFormProps,
18902
18916
  name: fullName,
18903
18917
  id: idVerificationMethodFormID,
18904
- countryOfResidence: (_c2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _c2.residencyCountry
18918
+ countryOfResidence: (_b2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b2.residencyCountry
18905
18919
  }
18906
18920
  )
18907
18921
  }
@@ -18917,10 +18931,10 @@ function IndividualComponent(props) {
18917
18931
  name: fullName,
18918
18932
  userDetails: activeForm.formId === idDocumentFormID ? userDetails : void 0,
18919
18933
  id: idDocumentFormID,
18920
- legalEntityId: props.legalEntityId,
18921
- handleGetIdVerificationToken: props.handleGetIdVerificationToken,
18922
- handleOnBack: props.onBack,
18923
- handleOnNext: props.onNext,
18934
+ legalEntityId,
18935
+ handleGetIdVerificationToken,
18936
+ handleOnBack: onBack,
18937
+ handleOnNext: onNext,
18924
18938
  idVerificationMethodSelected
18925
18939
  }
18926
18940
  )
@@ -18972,7 +18986,7 @@ function IndividualComponent(props) {
18972
18986
  )
18973
18987
  ] });
18974
18988
  };
18975
- return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual", children: renderActiveForm(props.activeForm) });
18989
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual", children: renderActiveForm(propActiveForm) });
18976
18990
  }
18977
18991
  const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccountNumberMasked) => {
18978
18992
  const [timeoutId, setTimeoutId] = useState(null);
@@ -19656,7 +19670,7 @@ class AdyenKycSdkError extends Error {
19656
19670
  }
19657
19671
  let sdkToken;
19658
19672
  let fetchSdkToken;
19659
- const logger$w = createLogger("Session");
19673
+ const logger$x = createLogger("Session");
19660
19674
  const setSdkToken = (token) => {
19661
19675
  sdkToken = token;
19662
19676
  };
@@ -19681,7 +19695,7 @@ const refreshSession = async () => {
19681
19695
  setSdkToken(token);
19682
19696
  isSessionRefreshed = true;
19683
19697
  } catch (e) {
19684
- logger$w.error("Failed to fetch sdk token", e);
19698
+ logger$x.error("Failed to fetch sdk token", e);
19685
19699
  }
19686
19700
  return isSessionRefreshed;
19687
19701
  };
@@ -19691,7 +19705,7 @@ const addAnimationStartListener = (element, listener) => {
19691
19705
  const removeAnimationStartListener = (element, listener) => {
19692
19706
  element.removeEventListener("animationstart", listener, false);
19693
19707
  };
19694
- const logger$v = createLogger("Fetch");
19708
+ const logger$w = createLogger("Fetch");
19695
19709
  const getRequestObject = (options, data) => {
19696
19710
  const { headers = [], method = "GET", authentication } = options;
19697
19711
  let authHeaders;
@@ -19732,10 +19746,10 @@ const logFetchError = (message, level) => {
19732
19746
  case "info":
19733
19747
  case "warn":
19734
19748
  case "error":
19735
- logger$v[level](message);
19749
+ logger$w[level](message);
19736
19750
  break;
19737
19751
  default:
19738
- logger$v.error(message);
19752
+ logger$w.error(message);
19739
19753
  }
19740
19754
  };
19741
19755
  const handleFetchResponse = async (response, responseType) => {
@@ -19819,7 +19833,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
19819
19833
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
19820
19834
  const MOUNT_TIMEOUT = 10 * 1e3;
19821
19835
  const TINK_VENDOR = "Tink";
19822
- const logger$u = createLogger("iframeWidget");
19836
+ const logger$v = createLogger("iframeWidget");
19823
19837
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
19824
19838
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
19825
19839
  const parseMessageJson = (message) => {
@@ -19837,7 +19851,7 @@ const callbackErrorHandler = async (response) => {
19837
19851
  try {
19838
19852
  await response;
19839
19853
  } catch (ex) {
19840
- logger$u.error(ex);
19854
+ logger$v.error(ex);
19841
19855
  }
19842
19856
  return {
19843
19857
  error: "UNKNOWN_ERROR",
@@ -19933,7 +19947,7 @@ class IFrameWidget {
19933
19947
  message = responseData.errorMessage;
19934
19948
  }
19935
19949
  } catch (ex) {
19936
- logger$u.error(ex);
19950
+ logger$v.error(ex);
19937
19951
  }
19938
19952
  throw new AdyenKycSdkError(reason, jsonData.error);
19939
19953
  }
@@ -20012,14 +20026,67 @@ const DEFAULT_ERROR = {
20012
20026
  function BankVerificationWidget({
20013
20027
  url,
20014
20028
  vendor,
20015
- widgetCallback,
20029
+ setBankVerificationError,
20030
+ setVerificationComplete,
20031
+ onBack,
20032
+ retrieveBankAccountInfo,
20016
20033
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
20017
20034
  handleBankVerificationError: handleBankVerificationError2
20018
20035
  }) {
20036
+ const { i18n } = useI18nContext();
20019
20037
  const widgetContainerRef = useRef(null);
20020
20038
  const context = useAuthContext();
20021
20039
  const { isEmbeddedDropin } = context;
20022
20040
  const sdkToken2 = isEmbeddedDropin ? getSdkToken() : void 0;
20041
+ setBankVerificationError(null);
20042
+ const widgetCallback = useCallback(
20043
+ (payload) => {
20044
+ setVerificationComplete(true);
20045
+ const errorContent = i18n.get("tryAgainOrManualAccountDetails");
20046
+ switch (payload.action) {
20047
+ case "handle_exception": {
20048
+ let errorTitle = i18n.get("sorryAnErrorOccurred");
20049
+ const { err } = payload;
20050
+ switch (!(err instanceof Error) && (err == null ? void 0 : err.error)) {
20051
+ case "USER_CANCELLED":
20052
+ errorTitle = "";
20053
+ break;
20054
+ case "CONNECTION_ERROR":
20055
+ errorTitle = i18n.get("couldNotEstablishBankConnection");
20056
+ break;
20057
+ case "GENERIC_ERROR":
20058
+ errorTitle = i18n.get("ranIntoTechnicalError");
20059
+ break;
20060
+ case "UNKNOWN_ERROR":
20061
+ default: {
20062
+ errorTitle = i18n.get("couldNotCompleteAccountCheck");
20063
+ break;
20064
+ }
20065
+ }
20066
+ if (errorTitle) {
20067
+ setBankVerificationError({
20068
+ title: errorTitle,
20069
+ content: errorContent
20070
+ });
20071
+ }
20072
+ onBack == null ? void 0 : onBack();
20073
+ break;
20074
+ }
20075
+ case "retry_verification":
20076
+ setBankVerificationError({
20077
+ title: i18n.get("failedInitializeInstantVerification"),
20078
+ content: errorContent
20079
+ });
20080
+ onBack == null ? void 0 : onBack();
20081
+ break;
20082
+ default: {
20083
+ const { accounts } = payload.result;
20084
+ retrieveBankAccountInfo(accounts[0]);
20085
+ }
20086
+ }
20087
+ },
20088
+ [i18n, retrieveBankAccountInfo, onBack, setBankVerificationError, setVerificationComplete]
20089
+ );
20023
20090
  useEffect(
20024
20091
  () => {
20025
20092
  const container = widgetContainerRef.current;
@@ -20037,16 +20104,16 @@ function BankVerificationWidget({
20037
20104
  divElement: container,
20038
20105
  link: url,
20039
20106
  successHandler: (code, state) => {
20040
- createTrustedTransferInstrument2(code, state).then((accounts) => {
20041
- if (accounts) {
20107
+ createTrustedTransferInstrument2(code, state).then((res) => {
20108
+ if (res) {
20042
20109
  widgetCallback({
20043
20110
  action: "verification_success",
20044
- result: accounts
20111
+ result: res
20045
20112
  });
20046
20113
  }
20047
20114
  }).catch(
20048
20115
  () => widgetCallback({
20049
- action: "handle_verification_exception",
20116
+ action: "handle_exception",
20050
20117
  err: DEFAULT_ERROR
20051
20118
  })
20052
20119
  );
@@ -20054,12 +20121,12 @@ function BankVerificationWidget({
20054
20121
  errorHandler: (errorCode, errorMessage, state, metadata) => {
20055
20122
  handleBankVerificationError2 == null ? void 0 : handleBankVerificationError2(errorCode, errorMessage, state, metadata).then(
20056
20123
  (error) => widgetCallback({
20057
- action: "handle_verification_exception",
20124
+ action: "handle_exception",
20058
20125
  err: error
20059
20126
  })
20060
20127
  ).catch(
20061
20128
  () => widgetCallback({
20062
- action: "handle_verification_exception",
20129
+ action: "handle_exception",
20063
20130
  err: DEFAULT_ERROR
20064
20131
  })
20065
20132
  );
@@ -20077,30 +20144,40 @@ function BankVerificationWidget({
20077
20144
  try {
20078
20145
  iFrameWidget = new IFrameWidget(iFrame, url, vendor, sdkToken2);
20079
20146
  const result = await iFrameWidget.mountAndWaitForResponse();
20080
- widgetCallback({ action: "verification_success", result });
20147
+ widgetCallback({
20148
+ action: "verification_success",
20149
+ result
20150
+ });
20081
20151
  } catch (err) {
20082
20152
  if (err instanceof AdyenKycSdkError) {
20083
20153
  switch (err.message) {
20084
20154
  case "WIDGET_ACCOUNT_COMMIT_FAILURE":
20085
20155
  return widgetCallback({
20086
- action: "handle_verification_exception",
20156
+ action: "handle_exception",
20087
20157
  err: err.sourceError
20088
20158
  });
20089
20159
  case "WIDGET_LAUNCH_FAILED":
20090
20160
  case "WIDGET_URL_MALFORMED":
20091
20161
  case "WIDGET_TIMEOUT":
20092
- return widgetCallback({ action: "retry_verification" });
20162
+ return widgetCallback({
20163
+ action: "retry_verification"
20164
+ /* RETRY_VERIFICATION */
20165
+ });
20093
20166
  default:
20094
20167
  return widgetCallback({
20095
- action: "handle_verification_exception",
20168
+ action: "handle_exception",
20096
20169
  err: {
20097
- error: (err == null ? void 0 : err.name) ?? "handle_verification_exception",
20098
- message: ((_a = err.sourceError) == null ? void 0 : _a.message) ?? "handle_verification_exception"
20170
+ error: (err == null ? void 0 : err.name) ?? "handle_exception",
20171
+ message: ((_a = err.sourceError) == null ? void 0 : _a.message) ?? "handle_exception"
20172
+ /* HANDLE_EXCEPTION */
20099
20173
  }
20100
20174
  });
20101
20175
  }
20102
20176
  }
20103
- return widgetCallback({ action: "handle_verification_exception", err });
20177
+ return widgetCallback({
20178
+ action: "handle_exception",
20179
+ err
20180
+ });
20104
20181
  }
20105
20182
  });
20106
20183
  }
@@ -20151,79 +20228,6 @@ const useInstantVerificationErrorNotification = (notificationVisibilityDuration)
20151
20228
  }, [errorNotification, clearNotificationTimeout, notificationVisibilityDuration]);
20152
20229
  return [errorNotification, setErrorNotification];
20153
20230
  };
20154
- function InstantBankVerification({
20155
- provider,
20156
- retrieveBankAccountInfo,
20157
- setBankVerificationError,
20158
- onBack,
20159
- createTrustedTransferInstrument: createTrustedTransferInstrument2,
20160
- handleBankVerificationError: handleBankVerificationError2
20161
- }) {
20162
- const { i18n } = useI18nContext();
20163
- const [verificationComplete, setVerificationComplete] = useState(false);
20164
- const widgetCallback = useCallback(
20165
- (payload) => {
20166
- setVerificationComplete(true);
20167
- const errorContent = i18n.get("tryAgainOrManualAccountDetails");
20168
- switch (payload.action) {
20169
- case "handle_verification_exception": {
20170
- let errorTitle = i18n.get("sorryAnErrorOccurred");
20171
- const { err } = payload;
20172
- switch (!(err instanceof Error) && (err == null ? void 0 : err.error)) {
20173
- case "USER_CANCELLED":
20174
- errorTitle = "";
20175
- break;
20176
- case "CONNECTION_ERROR":
20177
- errorTitle = i18n.get("couldNotEstablishBankConnection");
20178
- break;
20179
- case "GENERIC_ERROR":
20180
- errorTitle = i18n.get("ranIntoTechnicalError");
20181
- break;
20182
- case "UNKNOWN_ERROR":
20183
- default: {
20184
- errorTitle = i18n.get("couldNotCompleteAccountCheck");
20185
- break;
20186
- }
20187
- }
20188
- if (errorTitle) {
20189
- setBankVerificationError({
20190
- title: errorTitle,
20191
- content: errorContent
20192
- });
20193
- }
20194
- if (onBack) onBack();
20195
- break;
20196
- }
20197
- case "retry_verification":
20198
- setBankVerificationError({
20199
- title: i18n.get("failedInitializeInstantVerification"),
20200
- content: errorContent
20201
- });
20202
- if (onBack) onBack();
20203
- break;
20204
- default: {
20205
- const { accounts } = payload.result;
20206
- retrieveBankAccountInfo(accounts[0]);
20207
- }
20208
- }
20209
- },
20210
- [i18n, retrieveBankAccountInfo, onBack, setBankVerificationError]
20211
- );
20212
- setBankVerificationError(null);
20213
- return /* @__PURE__ */ jsx("form", { className: "adyen-kyc-bank-verification", children: !verificationComplete ? /* @__PURE__ */ jsxs(Fragment, { children: [
20214
- /* @__PURE__ */ jsx(
20215
- BankVerificationWidget,
20216
- {
20217
- widgetCallback,
20218
- url: provider.redirectUrl,
20219
- vendor: provider.name,
20220
- createTrustedTransferInstrument: createTrustedTransferInstrument2,
20221
- handleBankVerificationError: handleBankVerificationError2
20222
- }
20223
- ),
20224
- /* @__PURE__ */ jsx(ActionBar, { onBack: () => onBack == null ? void 0 : onBack(), backButtonLabel: i18n.get("goBack") })
20225
- ] }) : void 0 });
20226
- }
20227
20231
  function BankVerification(props) {
20228
20232
  const {
20229
20233
  heading,
@@ -20246,7 +20250,7 @@ function BankVerification(props) {
20246
20250
  const ACCOUNT_VERIFICATION = props.id;
20247
20251
  const schema = accountVerificationFields;
20248
20252
  const stateRef = useRef({ setState: null });
20249
- const requiredFieldsByFlow = accountVerificationFields;
20253
+ const [verificationComplete, setVerificationComplete] = useState(false);
20250
20254
  const { handleChangeFor, data, valid, errors, isValid, triggerValidation, fieldProblems } = useForm({
20251
20255
  ...props,
20252
20256
  schema,
@@ -20284,7 +20288,7 @@ function BankVerification(props) {
20284
20288
  fieldProblems,
20285
20289
  caller: ACCOUNT_VERIFICATION,
20286
20290
  dataStoreId: ACCOUNT_VERIFICATION,
20287
- schema: requiredFieldsByFlow
20291
+ schema
20288
20292
  }
20289
20293
  });
20290
20294
  }, [data, valid, errors, isValid]);
@@ -20296,13 +20300,7 @@ function BankVerification(props) {
20296
20300
  /* @__PURE__ */ jsx(StateContextSetter, { owner: ACCOUNT_VERIFICATION, stateRef }),
20297
20301
  bankInfoValidated && /* @__PURE__ */ jsxs(Fragment, { children: [
20298
20302
  /* @__PURE__ */ jsx(FormHeader, { heading }),
20299
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-bank-verification-success", children: [
20300
- /* @__PURE__ */ jsx(Icon, { name: "check", className: "adyen-kyc-u-margin-x-24" }),
20301
- /* @__PURE__ */ jsxs("span", { children: [
20302
- " ",
20303
- i18n.get("youSuccessfullyVerifiedAccount")
20304
- ] })
20305
- ] })
20303
+ /* @__PURE__ */ jsx(Alert, { title: i18n.get("youSuccessfullyVerifiedAccount"), variant: "success" })
20306
20304
  ] }),
20307
20305
  (provider == null ? void 0 : provider.redirectUrl) && (provider == null ? void 0 : provider.name) && formIsActive && !bankInfoValidated && /* @__PURE__ */ jsx(
20308
20306
  "div",
@@ -20310,17 +20308,22 @@ function BankVerification(props) {
20310
20308
  className: cx("adyen-kyc-bank-verification-container", {
20311
20309
  "adyen-kyc-bank-verification-container__fixed": !isEmbeddedDropin
20312
20310
  }),
20313
- children: /* @__PURE__ */ jsx(
20314
- InstantBankVerification,
20315
- {
20316
- provider,
20317
- retrieveBankAccountInfo,
20318
- setBankVerificationError,
20319
- onBack,
20320
- createTrustedTransferInstrument: createTrustedTransferInstrument2,
20321
- handleBankVerificationError: handleBankVerificationError2
20322
- }
20323
- )
20311
+ children: /* @__PURE__ */ jsx("form", { className: "adyen-kyc-bank-verification", children: !verificationComplete ? /* @__PURE__ */ jsxs(Fragment, { children: [
20312
+ /* @__PURE__ */ jsx(
20313
+ BankVerificationWidget,
20314
+ {
20315
+ url: provider.redirectUrl,
20316
+ vendor: provider.name,
20317
+ setBankVerificationError,
20318
+ setVerificationComplete,
20319
+ onBack,
20320
+ retrieveBankAccountInfo,
20321
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
20322
+ handleBankVerificationError: handleBankVerificationError2
20323
+ }
20324
+ ),
20325
+ /* @__PURE__ */ jsx(ActionBar, { onBack: () => onBack == null ? void 0 : onBack(), backButtonLabel: i18n.get("goBack") })
20326
+ ] }) : void 0 })
20324
20327
  }
20325
20328
  )
20326
20329
  ] });
@@ -21232,6 +21235,77 @@ function SwiftCode(props) {
21232
21235
  }
21233
21236
  );
21234
21237
  }
21238
+ const AccountHolderDescriptionFragment = ({
21239
+ legalEntityResponse
21240
+ }) => {
21241
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
21242
+ const { i18n } = useI18nContext();
21243
+ const hasSolePropEntityAssociations = hasOwnEntityAssociationOfType(
21244
+ LegalEntityType.SOLE_PROPRIETORSHIP,
21245
+ legalEntityResponse.entityAssociations,
21246
+ legalEntityResponse.id
21247
+ );
21248
+ const { accountHolder } = useCoreContext();
21249
+ if (accountHolder === "mySoleProprietorName" || hasSolePropEntityAssociations) {
21250
+ const soleProp = (_a = legalEntityResponse.entityAssociations) == null ? void 0 : _a.find(
21251
+ (ea) => ea.entityType === "soleProprietorship"
21252
+ );
21253
+ const { individual: individual2 } = legalEntityResponse;
21254
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21255
+ `${i18n.get("bankAccountHasToBeInYourName")} `,
21256
+ /* @__PURE__ */ jsx("b", { children: `${individual2 == null ? void 0 : individual2.name.firstName} ${individual2 == null ? void 0 : individual2.name.lastName}` }),
21257
+ ` ${i18n.get("orSoleProprietorshipName")} `,
21258
+ " ",
21259
+ /* @__PURE__ */ jsx("b", { children: `${(soleProp == null ? void 0 : soleProp.name) ?? ""}` })
21260
+ ] });
21261
+ }
21262
+ const hasTrustsEntityAssociations = hasOwnEntityAssociationOfType(
21263
+ LegalEntityType.TRUST,
21264
+ legalEntityResponse.entityAssociations,
21265
+ legalEntityResponse.id
21266
+ );
21267
+ if (accountHolder === "aTrust" || hasTrustsEntityAssociations) {
21268
+ const trust = (_b = legalEntityResponse.entityAssociations) == null ? void 0 : _b.find((ea) => ea.entityType === "trust");
21269
+ if (legalEntityResponse.type === LegalEntityType.INDIVIDUAL) {
21270
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21271
+ `${i18n.get("bankAccountToHaveSameNameAsTrust")} `,
21272
+ /* @__PURE__ */ jsx("b", { children: i18n.get("trusteeAsTrusteeForTrust", {
21273
+ values: {
21274
+ trusteeName: `${(_c = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _c.name.firstName} ${(_d = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _d.name.lastName}`,
21275
+ trustName: (trust == null ? void 0 : trust.name) ?? ""
21276
+ }
21277
+ }) })
21278
+ ] });
21279
+ }
21280
+ const companyTrusteeBankAccountName = ((_e = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _e.legalName) !== ((_f = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _f.doingBusinessAs) ? i18n.get("trusteeAsTrusteeForTrustDoingBusinessAs", {
21281
+ values: {
21282
+ trusteeName: ((_g = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _g.legalName) ?? "",
21283
+ trustName: (trust == null ? void 0 : trust.name) ?? "",
21284
+ tradingName: (_h = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _h.doingBusinessAs
21285
+ }
21286
+ }) : i18n.get("trusteeAsTrusteeForTrust", {
21287
+ values: {
21288
+ trusteeName: ((_i = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _i.legalName) ?? "",
21289
+ trustName: (trust == null ? void 0 : trust.name) ?? ""
21290
+ }
21291
+ });
21292
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21293
+ /* @__PURE__ */ jsx("div", { children: `${i18n.get("bankAccountToHaveSameNameAsTrust")} ` }),
21294
+ /* @__PURE__ */ jsx("b", { children: companyTrusteeBankAccountName })
21295
+ ] });
21296
+ }
21297
+ if (legalEntityResponse.type === LegalEntityType.ORGANIZATION) {
21298
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21299
+ `${i18n.get("bankAccountHasToBeInYourCompanyName")} `,
21300
+ /* @__PURE__ */ jsx("b", { children: (_j = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _j.legalName })
21301
+ ] });
21302
+ }
21303
+ const { individual } = legalEntityResponse;
21304
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21305
+ `${i18n.get("bankAccountHasToBeInYourName")} `,
21306
+ /* @__PURE__ */ jsx("b", { children: `${individual == null ? void 0 : individual.name.firstName} ${individual == null ? void 0 : individual.name.lastName}` })
21307
+ ] });
21308
+ };
21235
21309
  const CheckGuidance = ({ annotated }) => /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-check-guidance", children: [
21236
21310
  /* @__PURE__ */ jsx(
21237
21311
  Svg,
@@ -21273,7 +21347,7 @@ const payoutAccountFields = [
21273
21347
  ...bankCodeFields
21274
21348
  ];
21275
21349
  function PayoutAccountComponent(props) {
21276
- const { accountHolder, accountFormat, setAccountFormat } = useCoreContext();
21350
+ const { accountFormat, setAccountFormat } = useCoreContext();
21277
21351
  const { i18n } = useI18nContext();
21278
21352
  const [checkAnnotation, setCheckAnnotation] = useState();
21279
21353
  const { isSettingEnabled } = useSettingsContext();
@@ -21290,7 +21364,7 @@ function PayoutAccountComponent(props) {
21290
21364
  invalidFieldNames
21291
21365
  } = props;
21292
21366
  const showCheckGuidance = shouldShowCheckGuidance(country);
21293
- const { data, valid, errors, handleChangeFor, schema } = useForm({
21367
+ const { data, valid, errors, schema } = useForm({
21294
21368
  ...props,
21295
21369
  defaultData: props.data,
21296
21370
  schema: requiredFields,
@@ -21314,19 +21388,14 @@ function PayoutAccountComponent(props) {
21314
21388
  const bankNameProps = getFieldProps(props, bankNameFields);
21315
21389
  const bankCodeProps = getFieldProps(props, bankCodeFields);
21316
21390
  const bankCityProps = getFieldProps(props, bankCityFields);
21317
- const hasSoleProprietorship = accountHolder === "mySoleProprietorName" || hasOwnEntityAssociationOfType(
21318
- LegalEntityType.SOLE_PROPRIETORSHIP,
21319
- legalEntityResponse.entityAssociations,
21320
- legalEntityResponse.id
21321
- );
21322
- const hasTrusts = accountHolder === "aTrust" || hasOwnEntityAssociationOfType(
21323
- LegalEntityType.TRUST,
21324
- legalEntityResponse.entityAssociations,
21325
- legalEntityResponse.id
21326
- );
21327
- const accountHolderDescriptionKey = hasSoleProprietorship ? "accountHolderDescriptionSoleProp" : hasTrusts ? "bankAccountToHaveSameNameAsTrust" : legalEntityResponse.type === LegalEntityType.ORGANIZATION ? "accountHolderDescriptionCompany" : "accountHolderDescriptionIndividual";
21328
21391
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__payout-account", "aria-describedby": "ariaErrorField", children: [
21329
- /* @__PURE__ */ jsx(FormHeader, { heading }),
21392
+ /* @__PURE__ */ jsx(
21393
+ FormHeader,
21394
+ {
21395
+ heading,
21396
+ descriptionComponent: /* @__PURE__ */ jsx(AccountHolderDescriptionFragment, { legalEntityResponse })
21397
+ }
21398
+ ),
21330
21399
  /* @__PURE__ */ jsx(
21331
21400
  ErrorPanel,
21332
21401
  {
@@ -21337,31 +21406,6 @@ function PayoutAccountComponent(props) {
21337
21406
  }
21338
21407
  ),
21339
21408
  showCheckGuidance ? /* @__PURE__ */ jsx(CheckGuidance, { annotated: checkAnnotation }) : void 0,
21340
- formUtils.isRequiredField("accountHolder") && /* @__PURE__ */ jsx(
21341
- Field,
21342
- {
21343
- name: "accountHolder",
21344
- label: formUtils.getLabel("accountHolder"),
21345
- helper: i18n.get(accountHolderDescriptionKey),
21346
- classNameModifiers: ["accountHolder"],
21347
- isValid: valid.accountHolder,
21348
- children: (childProps) => /* @__PURE__ */ jsx(
21349
- InputText,
21350
- {
21351
- ...childProps,
21352
- name: "accountHolder",
21353
- value: data.accountHolder,
21354
- placeholder: formUtils.getPlaceholder("accountHolder"),
21355
- readonly: true,
21356
- onInput: handleChangeFor("accountHolder", "input"),
21357
- onBlur: handleChangeFor("accountHolder", "blur"),
21358
- "aria-required": true,
21359
- "aria-label": formUtils.getLabel("accountHolder"),
21360
- "aria-invalid": !valid.accountHolder
21361
- }
21362
- )
21363
- }
21364
- ),
21365
21409
  bankAccountFormatSelectionAllowed && shouldShowPayoutAccountFormatSelector(country) && accountFormat && /* @__PURE__ */ jsx(
21366
21410
  BankAccountFormat,
21367
21411
  {
@@ -21369,6 +21413,16 @@ function PayoutAccountComponent(props) {
21369
21413
  handleAccountFormatChange: setAccountFormat
21370
21414
  }
21371
21415
  ),
21416
+ formUtils.isRequiredField("branchCode") && /* @__PURE__ */ jsx(
21417
+ BranchCode,
21418
+ {
21419
+ ...branchCodeProps,
21420
+ country,
21421
+ dataStoreId: id,
21422
+ onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
21423
+ onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
21424
+ }
21425
+ ),
21372
21426
  formUtils.isRequiredField("bankAccountNumber") && /* @__PURE__ */ jsx(
21373
21427
  BankAccountNumber,
21374
21428
  {
@@ -21383,16 +21437,6 @@ function PayoutAccountComponent(props) {
21383
21437
  formUtils.isRequiredField("swiftCode") && /* @__PURE__ */ jsx(SwiftCode, { ...swiftCodeProps, dataStoreId: id }),
21384
21438
  formUtils.isRequiredField("bankName") && /* @__PURE__ */ jsx(BankName, { ...bankNameProps, dataStoreId: id }),
21385
21439
  formUtils.isRequiredField("bankCode") && /* @__PURE__ */ jsx(BankCode, { ...bankCodeProps, country, dataStoreId: id }),
21386
- formUtils.isRequiredField("branchCode") && /* @__PURE__ */ jsx(
21387
- BranchCode,
21388
- {
21389
- ...branchCodeProps,
21390
- country,
21391
- dataStoreId: id,
21392
- onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
21393
- onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
21394
- }
21395
- ),
21396
21440
  formUtils.isRequiredField("bankCity") && /* @__PURE__ */ jsx(BankCity, { ...bankCityProps, dataStoreId: id }),
21397
21441
  shouldShowPayoutAlert(country) && /* @__PURE__ */ jsx(
21398
21442
  Alert,
@@ -21484,77 +21528,6 @@ const makePayoutVerificationMethodsMetadata = (instantVerificationProvider) => {
21484
21528
  };
21485
21529
  };
21486
21530
  const payoutVerificationMethods = ["instantVerification", "manualVerification"];
21487
- const AccountHolderDescriptionFragment = ({
21488
- legalEntityResponse
21489
- }) => {
21490
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
21491
- const { i18n } = useI18nContext();
21492
- const hasSolePropEntityAssociations = hasOwnEntityAssociationOfType(
21493
- LegalEntityType.SOLE_PROPRIETORSHIP,
21494
- legalEntityResponse.entityAssociations,
21495
- legalEntityResponse.id
21496
- );
21497
- const { accountHolder } = useCoreContext();
21498
- if (accountHolder === "mySoleProprietorName" || hasSolePropEntityAssociations) {
21499
- const soleProp = (_a = legalEntityResponse.entityAssociations) == null ? void 0 : _a.find(
21500
- (ea) => ea.entityType === "soleProprietorship"
21501
- );
21502
- const { individual: individual2 } = legalEntityResponse;
21503
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21504
- `${i18n.get("bankAccountHasToBeInYourName")} `,
21505
- /* @__PURE__ */ jsx("b", { children: `${individual2 == null ? void 0 : individual2.name.firstName} ${individual2 == null ? void 0 : individual2.name.lastName}` }),
21506
- ` ${i18n.get("orSoleProprietorshipName")} `,
21507
- " ",
21508
- /* @__PURE__ */ jsx("b", { children: `${(soleProp == null ? void 0 : soleProp.name) ?? ""}` })
21509
- ] });
21510
- }
21511
- const hasTrustsEntityAssociations = hasOwnEntityAssociationOfType(
21512
- LegalEntityType.TRUST,
21513
- legalEntityResponse.entityAssociations,
21514
- legalEntityResponse.id
21515
- );
21516
- if (accountHolder === "aTrust" || hasTrustsEntityAssociations) {
21517
- const trust = (_b = legalEntityResponse.entityAssociations) == null ? void 0 : _b.find((ea) => ea.entityType === "trust");
21518
- if (legalEntityResponse.type === LegalEntityType.INDIVIDUAL) {
21519
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21520
- `${i18n.get("bankAccountToHaveSameNameAsTrust")} `,
21521
- /* @__PURE__ */ jsx("b", { children: i18n.get("trusteeAsTrusteeForTrust", {
21522
- values: {
21523
- trusteeName: `${(_c = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _c.name.firstName} ${(_d = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _d.name.lastName}`,
21524
- trustName: (trust == null ? void 0 : trust.name) ?? ""
21525
- }
21526
- }) })
21527
- ] });
21528
- }
21529
- const companyTrusteeBankAccountName = ((_e = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _e.legalName) !== ((_f = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _f.doingBusinessAs) ? i18n.get("trusteeAsTrusteeForTrustDoingBusinessAs", {
21530
- values: {
21531
- trusteeName: ((_g = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _g.legalName) ?? "",
21532
- trustName: (trust == null ? void 0 : trust.name) ?? "",
21533
- tradingName: (_h = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _h.doingBusinessAs
21534
- }
21535
- }) : i18n.get("trusteeAsTrusteeForTrust", {
21536
- values: {
21537
- trusteeName: ((_i = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _i.legalName) ?? "",
21538
- trustName: (trust == null ? void 0 : trust.name) ?? ""
21539
- }
21540
- });
21541
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21542
- /* @__PURE__ */ jsx("div", { children: `${i18n.get("bankAccountToHaveSameNameAsTrust")} ` }),
21543
- /* @__PURE__ */ jsx("b", { children: companyTrusteeBankAccountName })
21544
- ] });
21545
- }
21546
- if (legalEntityResponse.type === LegalEntityType.ORGANIZATION) {
21547
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21548
- `${i18n.get("bankAccountHasToBeInYourCompanyName")} `,
21549
- /* @__PURE__ */ jsx("b", { children: (_j = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _j.legalName })
21550
- ] });
21551
- }
21552
- const { individual } = legalEntityResponse;
21553
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21554
- `${i18n.get("bankAccountHasToBeInYourName")} `,
21555
- /* @__PURE__ */ jsx("b", { children: `${individual == null ? void 0 : individual.name.firstName} ${individual == null ? void 0 : individual.name.lastName}` })
21556
- ] });
21557
- };
21558
21531
  function Card({
21559
21532
  className,
21560
21533
  children,
@@ -21619,7 +21592,7 @@ function Card({
21619
21592
  const skeleton = "adyen-kyc-skeleton";
21620
21593
  const skeletonCircle = "adyen-kyc-skeleton-circle";
21621
21594
  const skeletonText = "adyen-kyc-skeleton-text";
21622
- const styles$4 = {
21595
+ const styles$5 = {
21623
21596
  skeleton,
21624
21597
  "skeleton-circle": "adyen-kyc-skeleton-circle",
21625
21598
  skeletonCircle,
@@ -21632,19 +21605,61 @@ const Skeleton = ({
21632
21605
  height = "1em",
21633
21606
  width
21634
21607
  }) => {
21635
- const classNames = cx(styles$4.skeleton, {
21636
- [styles$4.skeletonCircle]: circle,
21637
- [styles$4.skeletonText]: text
21608
+ const classNames = cx(styles$5.skeleton, {
21609
+ [styles$5.skeletonCircle]: circle,
21610
+ [styles$5.skeletonText]: text
21638
21611
  });
21639
21612
  return /* @__PURE__ */ jsx("div", { className: classNames, style: { height, width } });
21640
21613
  };
21614
+ const isInstantVerificationAvailable = ({
21615
+ verificationVendorsCallback,
21616
+ provider
21617
+ }) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
21618
+ const isProviderPlaidEmbedded = (redirectUrl) => !!(redirectUrl == null ? void 0 : redirectUrl.includes("/plaid/embedded-search/sdk?"));
21619
+ const rules$2 = ({ data, requiredFields }) => ({
21620
+ whenUsingManualVerification: () => {
21621
+ var _a;
21622
+ if (!data.payoutVerificationMethod) return;
21623
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
21624
+ return "REQUIRED";
21625
+ }
21626
+ },
21627
+ whenUsingInstantVerification: () => {
21628
+ var _a;
21629
+ if (!data.payoutVerificationMethod) {
21630
+ return "REQUIRED";
21631
+ }
21632
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
21633
+ return "REQUIRED";
21634
+ }
21635
+ },
21636
+ verifiedBankAccountNumber: () => {
21637
+ var _a;
21638
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
21639
+ return "REQUIRED";
21640
+ }
21641
+ },
21642
+ bankStatementRequirement: () => {
21643
+ var _a;
21644
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
21645
+ return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
21646
+ }
21647
+ },
21648
+ // "bankStatement description" field is always "optional" and it's coupled with bank statement document.
21649
+ bankStatementDescription: () => {
21650
+ var _a;
21651
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
21652
+ return "OPTIONAL";
21653
+ }
21654
+ }
21655
+ });
21641
21656
  const preferInstantVerificationMethod = "adyen-kyc-prefer-instant-verification-method";
21642
21657
  const preferInstantVerificationMethodCard = "adyen-kyc-prefer-instant-verification-method-card";
21643
21658
  const preferInstantVerificationMethodImage = "adyen-kyc-prefer-instant-verification-method-image";
21644
21659
  const preferInstantVerificationMethodInstantButton = "adyen-kyc-prefer-instant-verification-method-instant-button";
21645
- const preferInstantVerificationMethodManualButton = "adyen-kyc-prefer-instant-verification-method-manual-button";
21646
- const preferInstantVerificationMethodManualButtonDark = "adyen-kyc-prefer-instant-verification-method-manual-button-dark";
21647
- const styles$3 = {
21660
+ const preferInstantVerificationMethodActions = "adyen-kyc-prefer-instant-verification-method-actions";
21661
+ const preferInstantVerificationMethodManualButtonDarker = "adyen-kyc-prefer-instant-verification-method-manual-button-darker";
21662
+ const styles$4 = {
21648
21663
  "prefer-instant-verification-method": "adyen-kyc-prefer-instant-verification-method",
21649
21664
  preferInstantVerificationMethod,
21650
21665
  "prefer-instant-verification-method-card": "adyen-kyc-prefer-instant-verification-method-card",
@@ -21653,10 +21668,10 @@ const styles$3 = {
21653
21668
  preferInstantVerificationMethodImage,
21654
21669
  "prefer-instant-verification-method-instant-button": "adyen-kyc-prefer-instant-verification-method-instant-button",
21655
21670
  preferInstantVerificationMethodInstantButton,
21656
- "prefer-instant-verification-method-manual-button": "adyen-kyc-prefer-instant-verification-method-manual-button",
21657
- preferInstantVerificationMethodManualButton,
21658
- "prefer-instant-verification-method-manual-button-dark": "adyen-kyc-prefer-instant-verification-method-manual-button-dark",
21659
- preferInstantVerificationMethodManualButtonDark
21671
+ "prefer-instant-verification-method-actions": "adyen-kyc-prefer-instant-verification-method-actions",
21672
+ preferInstantVerificationMethodActions,
21673
+ "prefer-instant-verification-method-manual-button-darker": "adyen-kyc-prefer-instant-verification-method-manual-button-darker",
21674
+ preferInstantVerificationMethodManualButtonDarker
21660
21675
  };
21661
21676
  const getProviderIconName = (providerName) => {
21662
21677
  switch (providerName) {
@@ -21672,52 +21687,87 @@ const getProviderIconName = (providerName) => {
21672
21687
  };
21673
21688
  const PreferInstantVerificationMethod = ({
21674
21689
  loadingStatus,
21675
- providerName,
21690
+ provider,
21676
21691
  bankInfoValidated,
21677
21692
  instantVerificationAvailable,
21678
- selectVerificationMethod
21693
+ selectVerificationMethod,
21694
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
21695
+ setBankInfoValidated,
21696
+ handleBankVerificationError: handleBankVerificationError2,
21697
+ setBankVerificationError,
21698
+ refreshLegalEntity,
21699
+ handleChangeFor,
21700
+ triggerValidation
21679
21701
  }) => {
21702
+ var _a;
21680
21703
  const { i18n } = useI18nContext();
21681
- const iconName = getProviderIconName(providerName == null ? void 0 : providerName.toLocaleLowerCase());
21682
- return /* @__PURE__ */ jsxs("div", { className: styles$3.preferInstantVerificationMethod, children: [
21683
- loadingStatus === "loading" ? /* @__PURE__ */ jsx(Skeleton, { height: "21rem" }) : instantVerificationAvailable && /* @__PURE__ */ jsx(Card, { background: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$3.preferInstantVerificationMethodCard, children: [
21684
- /* @__PURE__ */ jsx(
21685
- Svg,
21686
- {
21687
- type: "image",
21688
- name: "instant-verification-method",
21689
- className: styles$3.preferInstantVerificationMethodImage
21690
- }
21691
- ),
21692
- /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body-stronger", children: i18n.get("instantlyConnectAndVerifyYourBankAccount") }),
21693
- /* @__PURE__ */ jsx(
21694
- Button,
21695
- {
21696
- type: "button",
21697
- label: i18n.get("connectWith", {
21698
- values: { providerName: iconName ? "" : providerName }
21699
- }),
21700
- className: styles$3.preferInstantVerificationMethodInstantButton,
21701
- onClick: () => selectVerificationMethod("instantVerification"),
21702
- disabled: bankInfoValidated,
21703
- icon: iconName,
21704
- iconPosition: "right"
21705
- }
21706
- )
21707
- ] }) }),
21704
+ const iconName = getProviderIconName((_a = provider == null ? void 0 : provider.name) == null ? void 0 : _a.toLocaleLowerCase());
21705
+ const showVerificationWidget = isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl);
21706
+ const [verificationComplete, setVerificationComplete] = useState(false);
21707
+ const retrieveBankAccountInfo = async ({
21708
+ realLastFour,
21709
+ number,
21710
+ bankName
21711
+ }) => {
21712
+ handleChangeFor("payoutVerificationMethod")("instantVerification");
21713
+ handleChangeFor("verifiedBankAccountNumber")(realLastFour ? `*******${realLastFour}` : number);
21714
+ handleChangeFor("verifiedBankName")(bankName);
21715
+ setBankInfoValidated == null ? void 0 : setBankInfoValidated(true);
21716
+ triggerValidation();
21717
+ await (refreshLegalEntity == null ? void 0 : refreshLegalEntity());
21718
+ };
21719
+ const bankVerificationWidget = verificationComplete ? bankInfoValidated && /* @__PURE__ */ jsx(Alert, { title: i18n.get("youSuccessfullyVerifiedAccount"), variant: "success" }) : provider && /* @__PURE__ */ jsx(
21720
+ BankVerificationWidget,
21721
+ {
21722
+ url: provider.redirectUrl,
21723
+ vendor: provider.name,
21724
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
21725
+ handleBankVerificationError: handleBankVerificationError2,
21726
+ setBankVerificationError,
21727
+ setVerificationComplete,
21728
+ retrieveBankAccountInfo
21729
+ }
21730
+ );
21731
+ const providerBanner = provider && /* @__PURE__ */ jsx(Card, { background: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$4.preferInstantVerificationMethodCard, children: [
21732
+ /* @__PURE__ */ jsx(
21733
+ Svg,
21734
+ {
21735
+ type: "image",
21736
+ name: "instant-verification-method",
21737
+ className: styles$4.preferInstantVerificationMethodImage
21738
+ }
21739
+ ),
21740
+ /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body-stronger", children: i18n.get("instantlyConnectAndVerifyYourBankAccount") }),
21708
21741
  /* @__PURE__ */ jsx(
21742
+ Button,
21743
+ {
21744
+ type: "button",
21745
+ label: i18n.get("connectWith", {
21746
+ values: { providerName: iconName ? "" : provider.name }
21747
+ }),
21748
+ className: styles$4.preferInstantVerificationMethodInstantButton,
21749
+ onClick: () => selectVerificationMethod("instantVerification"),
21750
+ disabled: bankInfoValidated,
21751
+ icon: iconName,
21752
+ iconPosition: "right"
21753
+ }
21754
+ )
21755
+ ] }) });
21756
+ return /* @__PURE__ */ jsxs("div", { className: styles$4.preferInstantVerificationMethod, children: [
21757
+ loadingStatus === "loading" ? /* @__PURE__ */ jsx(Skeleton, { height: "21rem" }) : instantVerificationAvailable && (showVerificationWidget ? bankVerificationWidget : providerBanner),
21758
+ /* @__PURE__ */ jsx("div", { className: styles$4.preferInstantVerificationMethodActions, children: /* @__PURE__ */ jsx(
21709
21759
  Button,
21710
21760
  {
21711
21761
  type: "button",
21712
21762
  label: i18n.get("addAccountManually"),
21713
21763
  tertiary: instantVerificationAvailable,
21714
- className: cx(styles$3.preferInstantVerificationMethodManualButton, {
21715
- [styles$3.preferInstantVerificationMethodManualButtonDark]: instantVerificationAvailable
21764
+ className: cx({
21765
+ [styles$4.preferInstantVerificationMethodManualButtonDarker]: instantVerificationAvailable
21716
21766
  }),
21717
21767
  onClick: () => selectVerificationMethod("manualVerification"),
21718
21768
  disabled: bankInfoValidated
21719
21769
  }
21720
- )
21770
+ ) })
21721
21771
  ] });
21722
21772
  };
21723
21773
  const PayoutVerificationMethodOptionIcon = ({
@@ -21746,10 +21796,7 @@ const PayoutVerificationMethodOptionFooter = ({
21746
21796
  )
21747
21797
  ] }) : null;
21748
21798
  };
21749
- const payoutVerificationMethodFields = [
21750
- "payoutVerificationMethod",
21751
- "bankCountry"
21752
- ];
21799
+ const payoutVerificationMethodFields = ["payoutVerificationMethod", "bankCountry", ...accountVerificationFields];
21753
21800
  const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName, i18n) => {
21754
21801
  switch (legalEntityType) {
21755
21802
  case LegalEntityType.INDIVIDUAL:
@@ -21765,20 +21812,26 @@ const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName
21765
21812
  }
21766
21813
  };
21767
21814
  function PayoutVerificationMethod(props) {
21768
- var _a;
21815
+ var _a, _b;
21769
21816
  const {
21817
+ heading,
21818
+ country,
21770
21819
  accountHolder,
21771
- legalEntityResponse,
21772
21820
  provider,
21773
- heading,
21821
+ bankVendorsLoadingStatus,
21822
+ instantVerificationAllowed,
21823
+ legalEntityResponse,
21774
21824
  forms,
21775
- country,
21776
21825
  validators: validators2,
21826
+ isActiveForm,
21777
21827
  bankInfoValidated,
21778
- instantVerificationAllowed,
21779
- bankVendorsLoadingStatus,
21828
+ setBankInfoValidated,
21780
21829
  handleNextClick,
21781
- isActiveForm
21830
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
21831
+ refreshLegalEntity,
21832
+ handleBankVerificationError: handleBankVerificationError2,
21833
+ setBankVerificationError,
21834
+ setHideFooter
21782
21835
  } = props;
21783
21836
  const { type: legalEntityType } = legalEntityResponse;
21784
21837
  const { i18n } = useI18nContext();
@@ -21793,10 +21846,15 @@ function PayoutVerificationMethod(props) {
21793
21846
  SettingNames.AllowIntraRegionCrossBorderPayout
21794
21847
  );
21795
21848
  const [hasSelectedMethod, setHasSelectedMethod] = useState(false);
21796
- const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
21849
+ const { handleChangeFor, data, valid, errors, fieldProblems, triggerValidation } = useForm({
21797
21850
  ...props,
21798
21851
  schema: payoutVerificationMethodFields,
21799
- defaultData: { bankCountry: country, ...props.data },
21852
+ defaultData: {
21853
+ verifiedAccountHolder: accountHolder,
21854
+ verifiedCurrencyCode: (_a = currencyByCountry[country]) == null ? void 0 : _a[0],
21855
+ bankCountry: country,
21856
+ ...props.data
21857
+ },
21800
21858
  rules: validators2,
21801
21859
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
21802
21860
  });
@@ -21806,6 +21864,12 @@ function PayoutVerificationMethod(props) {
21806
21864
  () => updateStateSlice({ data: { ...sliceData, ...data }, errors, valid, fieldProblems }),
21807
21865
  [data, errors, fieldProblems, valid]
21808
21866
  );
21867
+ useEffect(() => {
21868
+ if (!enablePreferInstantVerificationMethodFlow) return;
21869
+ setHideFooter == null ? void 0 : setHideFooter(
21870
+ enablePreferInstantVerificationMethodFlow && isActiveForm && !bankInfoValidated
21871
+ );
21872
+ }, [enablePreferInstantVerificationMethodFlow, isActiveForm, bankInfoValidated, setHideFooter]);
21809
21873
  const instantVerificationAvailable = useMemo(
21810
21874
  () => Boolean(instantVerificationAllowed && (provider == null ? void 0 : provider.redirectUrl)),
21811
21875
  [instantVerificationAllowed, provider]
@@ -21855,7 +21919,7 @@ function PayoutVerificationMethod(props) {
21855
21919
  }
21856
21920
  }, [provider, bankVendorsLoadingStatus, enablePreferInstantVerificationMethodFlow]);
21857
21921
  const { dataset: countries } = useDataset(datasetIdentifier.country);
21858
- const bankCountryName = ((_a = countries.find((country2) => country2.id === data.bankCountry)) == null ? void 0 : _a.name) ?? data.bankCountry;
21922
+ const bankCountryName = ((_b = countries.find((country2) => country2.id === data.bankCountry)) == null ? void 0 : _b.name) ?? data.bankCountry;
21859
21923
  const allowedBankCountries = getAllowedBankCountries(country);
21860
21924
  const countryField = /* @__PURE__ */ jsx(
21861
21925
  CountryField,
@@ -21903,10 +21967,17 @@ function PayoutVerificationMethod(props) {
21903
21967
  PreferInstantVerificationMethod,
21904
21968
  {
21905
21969
  loadingStatus: bankVendorsLoadingStatus,
21906
- providerName: provider == null ? void 0 : provider.name,
21970
+ provider,
21907
21971
  instantVerificationAvailable,
21908
21972
  bankInfoValidated,
21909
- selectVerificationMethod
21973
+ selectVerificationMethod,
21974
+ handleChangeFor,
21975
+ setBankInfoValidated,
21976
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
21977
+ handleBankVerificationError: handleBankVerificationError2,
21978
+ setBankVerificationError,
21979
+ triggerValidation,
21980
+ refreshLegalEntity
21910
21981
  }
21911
21982
  ) : /* @__PURE__ */ jsx(
21912
21983
  Field,
@@ -22020,17 +22091,6 @@ const payoutSteps = {
22020
22091
  const PayoutVerificationMethodFormID = payoutSteps.payoutVerificationMethod.formId;
22021
22092
  const PayoutAccountDocumentsFormID = payoutSteps.payoutAccountDocuments.formId;
22022
22093
  const PayoutAccountVerificationFormID = payoutSteps.payoutAccountVerification.formId;
22023
- const getAppropriatePayoutDetailsSteps = (isEditing, instantVerificationAvailable, canChangeCountry) => {
22024
- const dependentSteps = {
22025
- payoutAccountDetails: payoutSteps.payoutAccountDetails,
22026
- payoutAccountDocuments: payoutSteps.payoutAccountDocuments,
22027
- payoutAccountVerification: payoutSteps.payoutAccountVerification
22028
- };
22029
- return !isEditing && (instantVerificationAvailable || canChangeCountry) ? {
22030
- payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
22031
- ...dependentSteps
22032
- } : dependentSteps;
22033
- };
22034
22094
  function PayoutDetailsComponent(props) {
22035
22095
  var _a, _b;
22036
22096
  const { i18n } = useI18nContext();
@@ -22045,6 +22105,7 @@ function PayoutDetailsComponent(props) {
22045
22105
  setHideDropinLayout,
22046
22106
  setHideOnHomeButton,
22047
22107
  setSkipSubmit,
22108
+ setHideFooter,
22048
22109
  setSubmitButtonLabel,
22049
22110
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
22050
22111
  handleBankVerificationError: handleBankVerificationError2,
@@ -22070,7 +22131,9 @@ function PayoutDetailsComponent(props) {
22070
22131
  const globalData = useGlobalData();
22071
22132
  const data = isEmpty$1(globalData) ? propData : globalData;
22072
22133
  const resetData = useResetGlobalData();
22134
+ const { isExperimentEnabled } = useExperimentsContext();
22073
22135
  const verifyInstantly = ((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification";
22136
+ const showBankVerification = !(isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl) && isExperimentEnabled("EnablePreferInstantVerificationFlow"));
22074
22137
  const bankCountry = ((_b = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _b.bankCountry) ?? country;
22075
22138
  useEffect(() => resetData(), [resetData]);
22076
22139
  useEffect(() => {
@@ -22115,8 +22178,8 @@ function PayoutDetailsComponent(props) {
22115
22178
  PayoutVerificationMethod,
22116
22179
  {
22117
22180
  ...verificationMethodFormProps,
22118
- heading: taskHeading,
22119
22181
  id: PayoutVerificationMethodFormID,
22182
+ heading: taskHeading,
22120
22183
  country,
22121
22184
  forms,
22122
22185
  isActiveForm: (activeForm == null ? void 0 : activeForm.formId) === PayoutVerificationMethodFormID,
@@ -22125,15 +22188,21 @@ function PayoutDetailsComponent(props) {
22125
22188
  provider,
22126
22189
  bankVendorsLoadingStatus,
22127
22190
  bankInfoValidated,
22191
+ setBankInfoValidated,
22128
22192
  handleNextClick,
22129
22193
  instantVerificationAllowed: Boolean(
22130
22194
  instantVerificationEnabled && handleGetBankVerificationVendors
22131
- )
22195
+ ),
22196
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
22197
+ handleBankVerificationError: handleBankVerificationError2,
22198
+ setBankVerificationError: setInstantVerificationError,
22199
+ refreshLegalEntity: props.refreshLegalEntity,
22200
+ setHideFooter
22132
22201
  }
22133
22202
  ) })
22134
22203
  }
22135
22204
  ),
22136
- verifyInstantly ? /* @__PURE__ */ jsx(
22205
+ verifyInstantly ? showBankVerification && /* @__PURE__ */ jsx(
22137
22206
  "div",
22138
22207
  {
22139
22208
  className: (activeForm == null ? void 0 : activeForm.formId) !== PayoutAccountVerificationFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -22307,12 +22376,20 @@ const solePropForms = {
22307
22376
  formId: "solePropConstitutionalDocument",
22308
22377
  formName: "constitutionalDocument",
22309
22378
  fields: ["constitutionalDocument"]
22379
+ },
22380
+ solePropFinancialInformation: {
22381
+ formId: "solePropFinancialInformation",
22382
+ formName: "financialInformation",
22383
+ formHeading: "companyFinancialInformationFormHeading",
22384
+ formDescription: "companyFinancialInformationFormDescription",
22385
+ fields: financialInformationFields
22310
22386
  }
22311
22387
  };
22312
22388
  const solePropNameAndCountryFormId = solePropForms.solePropNameAndCountry.formId;
22313
22389
  const solePropRegistrationAddressFormId = solePropForms.solePropRegistrationAddress.formId;
22314
22390
  const solePropRegistrationDetailsFormId = solePropForms.solePropRegistrationDetails.formId;
22315
22391
  const solePropDocumentFormId = solePropForms.solePropConstitutionalDocument.formId;
22392
+ const solePropFinancialInformationFormId = solePropForms.solePropFinancialInformation.formId;
22316
22393
  function SolePropComponent(props) {
22317
22394
  const { i18n } = useI18nContext();
22318
22395
  const [currentCountry, setCurrentCountry] = useState(props.country);
@@ -22321,6 +22398,7 @@ function SolePropComponent(props) {
22321
22398
  const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
22322
22399
  const solePropRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, solePropRegistrationAddressFormId);
22323
22400
  const solePropDocumentsFormProps = getFormProps(props, solePropDocumentFormId);
22401
+ const solePropFinancialInformationFormProps = getFormProps(props, solePropFinancialInformationFormId);
22324
22402
  const handleStateChange = ({
22325
22403
  currentState,
22326
22404
  prevState
@@ -22413,6 +22491,21 @@ function SolePropComponent(props) {
22413
22491
  }
22414
22492
  )
22415
22493
  }
22494
+ ),
22495
+ /* @__PURE__ */ jsx(
22496
+ "div",
22497
+ {
22498
+ className: activeForm.formId !== solePropFinancialInformationFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
22499
+ children: /* @__PURE__ */ jsx(
22500
+ FinancialInformation,
22501
+ {
22502
+ ...solePropFinancialInformationFormProps,
22503
+ heading: i18n.get("financialInformation"),
22504
+ id: solePropFinancialInformationFormId,
22505
+ country: props.country
22506
+ }
22507
+ )
22508
+ }
22416
22509
  )
22417
22510
  ] });
22418
22511
  };
@@ -22671,8 +22764,7 @@ const getAllowedDecisionMakerRoles = (rootLegalEntity, taskType) => {
22671
22764
  }
22672
22765
  return acc;
22673
22766
  }, []);
22674
- const uniqueAllowedRoles = [...new Set(allowedRoles)];
22675
- return uniqueAllowedRoles;
22767
+ return [...new Set(allowedRoles)];
22676
22768
  };
22677
22769
  const hasMinRequiredDecisionMakerCount = (rootLegalEntity) => {
22678
22770
  var _a, _b;
@@ -23962,6 +24054,11 @@ function ErrorPanel({
23962
24054
  isValidationError2 && /* @__PURE__ */ jsx(ServerValidationErrors, { formUtils, validationErrors })
23963
24055
  ] });
23964
24056
  }
24057
+ const isSummaryItem = (val) => typeof val === "object" && val !== null && "summaryLabel" in val && "summaryValue" in val;
24058
+ const summaryItem = (summaryLabel, summaryValue) => ({
24059
+ summaryLabel,
24060
+ summaryValue
24061
+ });
23965
24062
  const summaryStep = {
23966
24063
  formId: "summary",
23967
24064
  formName: "summary"
@@ -24057,7 +24154,14 @@ function Summary({
24057
24154
  Object.entries(formData).forEach(([field, fieldData]) => {
24058
24155
  if ((omittedKeys == null ? void 0 : omittedKeys.includes(field)) || !fieldData) return;
24059
24156
  const fieldName = i18n.get(labelData[field]) || i18n.get(field);
24060
- if (typeof fieldData === "object") {
24157
+ if (isSummaryItem(fieldData)) {
24158
+ dataList.push(
24159
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-summary-section__field", children: [
24160
+ /* @__PURE__ */ jsx("dt", { className: "adyen-kyc-summary-section__label", children: i18n.get(fieldData.summaryLabel) }),
24161
+ /* @__PURE__ */ jsx("dd", { className: "adyen-kyc-summary-section__data", children: fieldData.summaryValue })
24162
+ ] })
24163
+ );
24164
+ } else if (typeof fieldData === "object") {
24061
24165
  dataList.push(renderSummaryItems(fieldData, labelData));
24062
24166
  } else if (["string", "number"].includes(typeof fieldData)) {
24063
24167
  dataList.push(
@@ -24303,7 +24407,7 @@ const useUnifyLoadingStatus = (setParentLoadingStatus, ...childLoadingStatuses)
24303
24407
  setParentLoadingStatus(loadingStatus);
24304
24408
  }, [...childLoadingStatuses]);
24305
24409
  };
24306
- const logger$t = createLogger("useScenarioConfiguration");
24410
+ const logger$u = createLogger("useScenarioConfiguration");
24307
24411
  const useScenarioConfiguration = ({
24308
24412
  getConfigurationData,
24309
24413
  getPayoutAccountFormatData,
@@ -24326,12 +24430,12 @@ const useScenarioConfiguration = ({
24326
24430
  const response = await getConfigurationData();
24327
24431
  setConfigurationResponse(response);
24328
24432
  } catch (err) {
24329
- logger$t.warn("WARNING: Configuration request failed - error:", err);
24433
+ logger$u.warn("WARNING: Configuration request failed - error:", err);
24330
24434
  } finally {
24331
24435
  setConfigurationLoadingStatus("success");
24332
24436
  }
24333
24437
  };
24334
- makeConfigCallAndSave().catch(logger$t.error);
24438
+ makeConfigCallAndSave().catch(logger$u.error);
24335
24439
  }, [getConfigurationData, setConfigurationLoadingStatus]);
24336
24440
  useEffect(() => {
24337
24441
  if (!getPayoutAccountFormatData) return;
@@ -24350,12 +24454,12 @@ const useScenarioConfiguration = ({
24350
24454
  const defaultAccountFormat = defaultPayoutAccountFormat[country] ?? allowedBankAccountFormats[0];
24351
24455
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
24352
24456
  } catch (err) {
24353
- logger$t.warn("WARNING: Payout format request failed - error:", err);
24457
+ logger$u.warn("WARNING: Payout format request failed - error:", err);
24354
24458
  } finally {
24355
24459
  setpayoutFormatLoadingStatus("success");
24356
24460
  }
24357
24461
  };
24358
- makePayoutFormatCallAndSave().catch(logger$t.error);
24462
+ makePayoutFormatCallAndSave().catch(logger$u.error);
24359
24463
  }, [
24360
24464
  country,
24361
24465
  setAccountFormat,
@@ -24445,7 +24549,7 @@ const identityBase = {
24445
24549
  rule: "REQUIRED"
24446
24550
  },
24447
24551
  phoneNumber: {
24448
- rule: "contactsIfRequiredForRole"
24552
+ rules: ["requiredIfPhoneScenarioDisabled", "contactsIfRequiredForRole"]
24449
24553
  },
24450
24554
  email: {
24451
24555
  rule: "contactsIfRequiredForRole"
@@ -24518,6 +24622,11 @@ const nationality = {
24518
24622
  rule: "REQUIRED"
24519
24623
  }
24520
24624
  };
24625
+ const phoneNumberBase = {
24626
+ phoneNumber: {
24627
+ rule: "contactsIfRequiredForRole"
24628
+ }
24629
+ };
24521
24630
  const fieldsPerScenario$1 = {
24522
24631
  L0: drop("address", "birthDate").from(identityBase),
24523
24632
  L1: identityBase,
@@ -24538,7 +24647,8 @@ const fieldsPerScenario$1 = {
24538
24647
  ...additionalIdentityInfo,
24539
24648
  ...nationality
24540
24649
  },
24541
- L1_IDDOC: idDocument
24650
+ L1_IDDOC: idDocument,
24651
+ L_PH: phoneNumberBase
24542
24652
  };
24543
24653
  const solePropBase = {
24544
24654
  companyCountry: { rule: "REQUIRED" },
@@ -24560,16 +24670,22 @@ const taxInformationBase = {
24560
24670
  taxInformation: { rule: "countryUsesTaxId" },
24561
24671
  exemptedFromTax: { rule: "countryHasTaxExemptionsForSomeSoleProps" }
24562
24672
  };
24673
+ const financialInformationBase = {
24674
+ numberOfEmployees: { rule: "countryRequiresFinancialInformationForSoleProps" },
24675
+ financialReportingDate: { rule: "countryRequiresFinancialInformationForSoleProps" }
24676
+ };
24563
24677
  const fieldsPerScenario = {
24564
24678
  L0: {
24565
24679
  legalCompanyName: { rule: "REQUIRED" },
24566
- companyCountry: { rule: "REQUIRED" }
24680
+ companyCountry: { rule: "REQUIRED" },
24681
+ ...financialInformationBase
24567
24682
  },
24568
- L1: { ...solePropBase },
24569
- L2: { ...solePropBase },
24683
+ L1: { ...solePropBase, ...financialInformationBase },
24684
+ L2: { ...solePropBase, ...financialInformationBase },
24570
24685
  L: {
24571
24686
  ...solePropBase,
24572
- ...taxInformationBase
24687
+ ...taxInformationBase,
24688
+ ...financialInformationBase
24573
24689
  },
24574
24690
  L_ConstDoc: {
24575
24691
  constitutionalDocument: { rule: "REQUIRED" }
@@ -25103,7 +25219,7 @@ const structuredListListItem = "adyen-kyc-structured-list-list-item";
25103
25219
  const adyenLayoutMd = "adyen-layout-md";
25104
25220
  const structuredListLabel = "adyen-kyc-structured-list-label";
25105
25221
  const structuredListValue = "adyen-kyc-structured-list-value";
25106
- const styles$2 = {
25222
+ const styles$3 = {
25107
25223
  "structured-list": "adyen-kyc-structured-list",
25108
25224
  structuredList,
25109
25225
  "structured-list-list-item": "adyen-kyc-structured-list-list-item",
@@ -25117,9 +25233,9 @@ const styles$2 = {
25117
25233
  };
25118
25234
  const StructuredList = ({ items }) => {
25119
25235
  const { i18n } = useI18nContext();
25120
- return /* @__PURE__ */ jsx("dl", { className: styles$2.structuredList, children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: styles$2.structuredListListItem, children: [
25121
- /* @__PURE__ */ jsx("dt", { className: styles$2.structuredListLabel, children: i18n.get(item.labelKey) }),
25122
- /* @__PURE__ */ jsx("dd", { className: styles$2.structuredListValue, children: item.value })
25236
+ return /* @__PURE__ */ jsx("dl", { className: styles$3.structuredList, children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: styles$3.structuredListListItem, children: [
25237
+ /* @__PURE__ */ jsx("dt", { className: styles$3.structuredListLabel, children: i18n.get(item.labelKey) }),
25238
+ /* @__PURE__ */ jsx("dd", { className: styles$3.structuredListValue, children: item.value })
25123
25239
  ] }, item.labelKey)) });
25124
25240
  };
25125
25241
  function VerifiedBusinessCard({
@@ -25951,7 +26067,7 @@ function BusinessInformationCard({
25951
26067
  }
25952
26068
  );
25953
26069
  }
25954
- const logger$s = createLogger("BusinessSelection");
26070
+ const logger$t = createLogger("BusinessSelection");
25955
26071
  function BusinessSelectionComponent({
25956
26072
  showCompanyStructure,
25957
26073
  searching,
@@ -26003,7 +26119,7 @@ function BusinessSelectionComponent({
26003
26119
  setCurrentBusinessSelection(businessData);
26004
26120
  }
26005
26121
  } catch (e) {
26006
- logger$s.error(e);
26122
+ logger$t.error(e);
26007
26123
  }
26008
26124
  },
26009
26125
  [basicInformation == null ? void 0 : basicInformation.stateOrProvince, fetchBusinessData, fetching, selectedBusinessId]
@@ -26017,7 +26133,7 @@ function BusinessSelectionComponent({
26017
26133
  handleNextClick == null ? void 0 : handleNextClick();
26018
26134
  }
26019
26135
  } catch (e) {
26020
- logger$s.error(e);
26136
+ logger$t.error(e);
26021
26137
  }
26022
26138
  },
26023
26139
  [currentTin, handleNextClick, handleBusinessVerification]
@@ -27127,7 +27243,7 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
27127
27243
  DecisionMakerType.SIGNATORY,
27128
27244
  DecisionMakerType.CONTROLLING_PERSON
27129
27245
  ];
27130
- const rules$2 = ({
27246
+ const rules$1 = ({
27131
27247
  data,
27132
27248
  country,
27133
27249
  taskType,
@@ -27186,6 +27302,7 @@ const rules$2 = ({
27186
27302
  return REQUIRED;
27187
27303
  }
27188
27304
  },
27305
+ requiredIfPhoneScenarioDisabled: () => !isExperimentEnabled("EnablePhoneFieldScenario") ? REQUIRED : void 0,
27189
27306
  jobTitleIfRequiredForRole: () => {
27190
27307
  var _a, _b;
27191
27308
  if (taskType === TaskTypes.DECISION_MAKER) {
@@ -27601,7 +27718,7 @@ const useExpiryThreshold = (expiry) => {
27601
27718
  return { expiryStatus: "notYetCloseToExpiry", secondsUntilExpiry: void 0 };
27602
27719
  };
27603
27720
  const ExpiryContext = createContext(false);
27604
- const logger$r = createLogger("ExpiryProvider");
27721
+ const logger$s = createLogger("ExpiryProvider");
27605
27722
  const ExpiryProvider = ({
27606
27723
  expiry: initialExpiry,
27607
27724
  eventEmitter,
@@ -27630,7 +27747,7 @@ const ExpiryProvider = ({
27630
27747
  refreshExpiry().then((newExpiry) => {
27631
27748
  setExpiry(newExpiry);
27632
27749
  setModalDismissed(false);
27633
- }).catch(logger$r.error);
27750
+ }).catch(logger$s.error);
27634
27751
  }
27635
27752
  }
27636
27753
  ),
@@ -27652,7 +27769,7 @@ const ExpiryProvider = ({
27652
27769
  return /* @__PURE__ */ jsx(ExpiryContext.Provider, { value: expiryStatus === "expired", children });
27653
27770
  };
27654
27771
  const useHasExpired = () => useContext(ExpiryContext);
27655
- const logger$q = createLogger("FormRouterContextProvider");
27772
+ const logger$r = createLogger("FormRouterContextProvider");
27656
27773
  function FormRouterContextProvider({
27657
27774
  children,
27658
27775
  forms,
@@ -27675,7 +27792,7 @@ function FormRouterContextProvider({
27675
27792
  if (formIndex > -1) {
27676
27793
  setFormIndex(formIndex);
27677
27794
  } else {
27678
- logger$q.error("No form was found to have that field so form navigation failed.");
27795
+ logger$r.error("No form was found to have that field so form navigation failed.");
27679
27796
  }
27680
27797
  }
27681
27798
  }),
@@ -28925,6 +29042,24 @@ const formatCurrency = (amount, currency, locale) => {
28925
29042
  );
28926
29043
  return format(amount);
28927
29044
  };
29045
+ const formatFinancialInformationSummary = (data, i18n) => {
29046
+ if (!data) return {};
29047
+ const summary2 = {
29048
+ numberOfEmployees: `${data.numberOfEmployees}`,
29049
+ currency: data.currency,
29050
+ financialReportingDate: data.financialReportingDate
29051
+ };
29052
+ if (data.netAssets) {
29053
+ summary2.netAssets = summaryItem(
29054
+ "totalAssets",
29055
+ formatCurrency(data.netAssets, data.currency, i18n.locale)
29056
+ );
29057
+ }
29058
+ if (data.annualTurnover) {
29059
+ summary2.annualTurnover = formatCurrency(data.annualTurnover, data.currency, i18n.locale);
29060
+ }
29061
+ return summary2;
29062
+ };
28928
29063
  const parseConfiguration$5 = ({ country, matchingScenario }) => parseCompanyScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country);
28929
29064
  const canSubmit$1 = (data) => mandatoryApiFields.ORGANIZATION.every((detail) => {
28930
29065
  const value = getProp(data, detail);
@@ -29273,25 +29408,10 @@ function CompanyDropinComponent({
29273
29408
  }
29274
29409
  delete summaryData.companyRegistrationDetails.taxInformation;
29275
29410
  }
29276
- const financialInfoSummary = summaryData.companyFinancialInformation;
29277
- if (financialInfoSummary) {
29278
- delete financialInfoSummary.reportedValueOption;
29279
- if (financialInfoSummary.netAssets) {
29280
- financialInfoSummary.totalAssets = formatCurrency(
29281
- financialInfoSummary.netAssets,
29282
- financialInfoSummary.currency,
29283
- i18n.locale
29284
- );
29285
- delete financialInfoSummary.netAssets;
29286
- }
29287
- if (financialInfoSummary.annualTurnover) {
29288
- financialInfoSummary.annualTurnover = formatCurrency(
29289
- financialInfoSummary.annualTurnover,
29290
- financialInfoSummary.currency,
29291
- i18n.locale
29292
- );
29293
- }
29294
- }
29411
+ summaryData.companyFinancialInformation = formatFinancialInformationSummary(
29412
+ summaryData.companyFinancialInformation,
29413
+ i18n
29414
+ );
29295
29415
  if (isDocumentsRequired$1(forms2)) {
29296
29416
  companyDocumentForms.forEach((formId) => delete summaryData[formId]);
29297
29417
  summaryData = {
@@ -29367,7 +29487,7 @@ function CompanyDropinComponent({
29367
29487
  }
29368
29488
  const IgnoreLocalStorageContext = createContext(false);
29369
29489
  const useIgnoreLocalStorage = () => useContext(IgnoreLocalStorageContext);
29370
- const logger$p = createLogger("useLocalStorage");
29490
+ const logger$q = createLogger("useLocalStorage");
29371
29491
  const useLocalStorage = (key, defaultValue, options) => {
29372
29492
  const { serializer, parser, syncData } = useMemo(
29373
29493
  () => ({
@@ -29387,7 +29507,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29387
29507
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
29388
29508
  return res;
29389
29509
  } catch (err) {
29390
- logger$p.error(err);
29510
+ logger$q.error(err);
29391
29511
  return defaultValue;
29392
29512
  }
29393
29513
  });
@@ -29422,7 +29542,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29422
29542
  try {
29423
29543
  updateLocalStorage();
29424
29544
  } catch (err) {
29425
- logger$p.error(err);
29545
+ logger$q.error(err);
29426
29546
  }
29427
29547
  }, [value, ignoreLocalStorage]);
29428
29548
  useEffect(() => {
@@ -29435,7 +29555,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29435
29555
  setValue(event.newValue ? parser(event.newValue) : void 0);
29436
29556
  }
29437
29557
  } catch (err) {
29438
- logger$p.error(err);
29558
+ logger$q.error(err);
29439
29559
  }
29440
29560
  };
29441
29561
  if (ignoreLocalStorage) return;
@@ -29619,7 +29739,7 @@ const useSingpassMyInfoLogin = ({
29619
29739
  trustedEntityAssociations
29620
29740
  };
29621
29741
  };
29622
- const logger$o = createLogger("useAssociatedLegalArrangement");
29742
+ const logger$p = createLogger("useAssociatedLegalArrangement");
29623
29743
  function useAssociatedLegalArrangement({
29624
29744
  rootLegalEntity,
29625
29745
  getLegalEntity: getLegalEntity2
@@ -29635,7 +29755,7 @@ function useAssociatedLegalArrangement({
29635
29755
  (entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST
29636
29756
  );
29637
29757
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
29638
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$o.error);
29758
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$p.error);
29639
29759
  }
29640
29760
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
29641
29761
  useEffect(() => {
@@ -29685,7 +29805,7 @@ const useCanSeeEntitySelection = (legalEntityId) => {
29685
29805
  setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
29686
29806
  };
29687
29807
  };
29688
- const logger$n = createLogger("useExemptSettlor");
29808
+ const logger$o = createLogger("useExemptSettlor");
29689
29809
  const useExemptSettlor = ({
29690
29810
  trust,
29691
29811
  handleGetLegalEntity
@@ -29703,7 +29823,7 @@ const useExemptSettlor = ({
29703
29823
  );
29704
29824
  useEffect(() => {
29705
29825
  if (!(trust == null ? void 0 : trust.trust)) return;
29706
- updateExemptSettlor(trust).catch(logger$n.error);
29826
+ updateExemptSettlor(trust).catch(logger$o.error);
29707
29827
  }, [trust, updateExemptSettlor]);
29708
29828
  return exemptSettlor;
29709
29829
  };
@@ -30857,7 +30977,7 @@ const EntityAssociation = ({
30857
30977
  Tag,
30858
30978
  {
30859
30979
  className: "adyen-kyc-entity-association__tag",
30860
- variant: getRoleTagVariant(type),
30980
+ variant: getRoleTagVariant$1(type),
30861
30981
  children: i18n.get(getRoleName(type))
30862
30982
  },
30863
30983
  type
@@ -30918,7 +31038,7 @@ const EntityGuidanceStatus = ({
30918
31038
  Tag,
30919
31039
  {
30920
31040
  className: "adyen-kyc-entity-status__tag",
30921
- variant: getRoleTagVariant(entityLabel),
31041
+ variant: getRoleTagVariant$1(entityLabel),
30922
31042
  children: i18n.get(getRoleName(entityLabel))
30923
31043
  },
30924
31044
  entityLabel
@@ -32801,7 +32921,7 @@ function IndividualDropinComponent({
32801
32921
  country
32802
32922
  });
32803
32923
  const fieldsFromCustomRules = useMemo(
32804
- () => rules$2({
32924
+ () => rules$1({
32805
32925
  data,
32806
32926
  country,
32807
32927
  taskType,
@@ -33046,12 +33166,11 @@ function IndividualDropinComponent({
33046
33166
  idDocumentType: idDocumentType || null
33047
33167
  }
33048
33168
  });
33049
- const filteredEntityAssociation = filterOutUnwantedAssociationsIfRootLE(
33169
+ legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
33050
33170
  taskType,
33051
33171
  legalEntityResponse,
33052
33172
  accountHolder || void 0
33053
33173
  );
33054
- legalEntity.entityAssociations = filteredEntityAssociation;
33055
33174
  const createdLegalEntity = await submitLegalEntity({
33056
33175
  dataSubmitted,
33057
33176
  legalEntity,
@@ -33267,7 +33386,7 @@ function IndividualDropinComponent({
33267
33386
  }
33268
33387
  );
33269
33388
  }
33270
- const logger$m = createLogger("useBankConfigurationHandler");
33389
+ const logger$n = createLogger("useBankConfigurationHandler");
33271
33390
  const useBankConfigurationHandlers = ({
33272
33391
  handleGetBankVerificationVendors,
33273
33392
  bankAccountCountry,
@@ -33285,7 +33404,7 @@ const useBankConfigurationHandlers = ({
33285
33404
  const bankVerificationVendorsResponse = handleGetBankVerificationVendors ? await handleGetBankVerificationVendors(bankAccountCountry) : [];
33286
33405
  setProvider(bankVerificationVendorsResponse == null ? void 0 : bankVerificationVendorsResponse[0]);
33287
33406
  })().catch(() => {
33288
- logger$m.error();
33407
+ logger$n.error();
33289
33408
  setProvider(void 0);
33290
33409
  }).finally(() => {
33291
33410
  setLoadingStatus("success");
@@ -33322,47 +33441,6 @@ const getAccountFormatsForCountry = async (country) => {
33322
33441
  }
33323
33442
  return (await importForCountry()).default;
33324
33443
  };
33325
- const isInstantVerificationAvailable = ({
33326
- verificationVendorsCallback,
33327
- provider
33328
- }) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
33329
- const rules$1 = ({ data, requiredFields }) => ({
33330
- whenUsingManualVerification: () => {
33331
- var _a;
33332
- if (!data.payoutVerificationMethod) return;
33333
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
33334
- return "REQUIRED";
33335
- }
33336
- },
33337
- whenUsingInstantVerification: () => {
33338
- var _a;
33339
- if (!data.payoutVerificationMethod) {
33340
- return "REQUIRED";
33341
- }
33342
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
33343
- return "REQUIRED";
33344
- }
33345
- },
33346
- verifiedBankAccountNumber: () => {
33347
- var _a;
33348
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
33349
- return "REQUIRED";
33350
- }
33351
- },
33352
- bankStatementRequirement: () => {
33353
- var _a;
33354
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
33355
- return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
33356
- }
33357
- },
33358
- // "bankStatement description" field is always "optional" and it's coupled with bank statement document.
33359
- bankStatementDescription: () => {
33360
- var _a;
33361
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
33362
- return "OPTIONAL";
33363
- }
33364
- }
33365
- });
33366
33444
  const labels = () => ({
33367
33445
  verifiedAccountHolder: () => "accountHolder",
33368
33446
  verifiedBankCountry: () => "bankCountry",
@@ -33379,6 +33457,27 @@ const parseConfiguration$3 = ({
33379
33457
  country,
33380
33458
  bankVerificationAvailable
33381
33459
  });
33460
+ const getAppropriatePayoutDetailsSteps = (isEditing, instantVerificationAvailable, canChangeCountry, showWidgetInVerificationMethodStep) => {
33461
+ const dependentSteps = {
33462
+ payoutAccountDetails: payoutSteps.payoutAccountDetails,
33463
+ payoutAccountDocuments: payoutSteps.payoutAccountDocuments,
33464
+ payoutAccountVerification: payoutSteps.payoutAccountVerification
33465
+ };
33466
+ if (!isEditing) {
33467
+ if (showWidgetInVerificationMethodStep)
33468
+ return {
33469
+ payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
33470
+ payoutAccountDetails: payoutSteps.payoutAccountDetails,
33471
+ payoutAccountDocuments: payoutSteps.payoutAccountDocuments
33472
+ };
33473
+ if (instantVerificationAvailable || canChangeCountry)
33474
+ return {
33475
+ payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
33476
+ ...dependentSteps
33477
+ };
33478
+ }
33479
+ return dependentSteps;
33480
+ };
33382
33481
  function PayoutDetailsDropinComponent({
33383
33482
  transferInstrument,
33384
33483
  setTransferInstrument,
@@ -33407,7 +33506,7 @@ function PayoutDetailsDropinComponent({
33407
33506
  handleBankVerificationError: handleBankVerificationError2,
33408
33507
  handleBackClick: externalBackClick
33409
33508
  }) {
33410
- var _a, _b, _c, _d, _e, _f;
33509
+ var _a, _b, _c, _d, _e, _f, _g;
33411
33510
  const { isEmbeddedDropin } = useAuthContext();
33412
33511
  const { i18n } = useI18nContext();
33413
33512
  const { showToast, clearToasts } = useToastContext();
@@ -33453,12 +33552,13 @@ function PayoutDetailsDropinComponent({
33453
33552
  const formValidity = currentState.validityByForm;
33454
33553
  const bankAccountCountry = ((_c = (_b = currentState == null ? void 0 : currentState.data) == null ? void 0 : _b.payoutVerificationMethod) == null ? void 0 : _c.bankCountry) ?? defaultPayoutCountry;
33455
33554
  const [hideDropinLayout, setHideDropinLayout] = useState(false);
33555
+ const [hideFooter, setHideFooter] = useState(false);
33456
33556
  const [submitButtonLabel, setSubmitButtonLabel] = useState("submit");
33457
33557
  const [skipSubmit, setSkipSubmit] = useState(false);
33458
33558
  const [hideOnHomeButton, setHideHomeButton] = useState(false);
33459
- const [loadingStatus, setLoadingStatus] = useState("success");
33460
- const [configurationLoadingStatus, setConfigurationLoadingStatus] = useState("success");
33461
- const [bankVendorsLoadingStatus, setBankVendorsLoadingStatus] = useState("success");
33559
+ const [loadingStatus, setLoadingStatus] = useState("loading");
33560
+ const [bankVendorsLoadingStatus, setBankVendorsLoadingStatus] = useState("loading");
33561
+ const [configurationLoadingStatus, setConfigurationLoadingStatus] = useState("loading");
33462
33562
  const [data, setData] = useState(prefilledData);
33463
33563
  const [problems, setProblems] = useState(
33464
33564
  propProblems || ((transferInstrument == null ? void 0 : transferInstrument.id) ? (_e = (_d = getCapabilityProblems(legalEntityResponse, bankAccountCountry)) == null ? void 0 : _d.BankAccount) == null ? void 0 : _e[transferInstrument.id] : void 0)
@@ -33506,7 +33606,7 @@ function PayoutDetailsDropinComponent({
33506
33606
  getConfiguration: getConfiguration2,
33507
33607
  legalEntityType: legalEntityResponse.type,
33508
33608
  capabilities,
33509
- setLoadingStatus: setConfigurationLoadingStatus,
33609
+ setLoadingStatus: setBankVendorsLoadingStatus,
33510
33610
  useFreshProviderRedirectUrl,
33511
33611
  setUseFreshProviderRedirectUrl
33512
33612
  });
@@ -33519,12 +33619,12 @@ function PayoutDetailsDropinComponent({
33519
33619
  getConfigurationData,
33520
33620
  getPayoutAccountFormatData,
33521
33621
  instantVerificationEnabled,
33522
- setLoadingStatus: setBankVendorsLoadingStatus,
33622
+ setLoadingStatus: setConfigurationLoadingStatus,
33523
33623
  country: bankAccountCountry,
33524
33624
  existingBankAccountFormat
33525
33625
  });
33526
33626
  const fieldsFromCustomRules = useMemo(
33527
- () => rules$1({
33627
+ () => rules$2({
33528
33628
  data,
33529
33629
  country: bankAccountCountry,
33530
33630
  taskType,
@@ -33532,10 +33632,11 @@ function PayoutDetailsDropinComponent({
33532
33632
  }),
33533
33633
  [bankAccountCountry, data, taskType]
33534
33634
  );
33535
- const fieldsFormCustomLabels = useMemo(
33635
+ const fieldsFromCustomLabels = useMemo(
33536
33636
  () => labels ? labels() : {},
33537
33637
  [data, bankAccountCountry]
33538
33638
  );
33639
+ const showWidgetInVerificationMethodStep = isExperimentEnabled("EnablePreferInstantVerificationFlow") && isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl);
33539
33640
  const payoutDetailsSteps = useMemo(
33540
33641
  () => {
33541
33642
  var _a2;
@@ -33545,7 +33646,8 @@ function PayoutDetailsDropinComponent({
33545
33646
  provider,
33546
33647
  verificationVendorsCallback: handleGetBankVerificationVendors
33547
33648
  }),
33548
- isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout)
33649
+ isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
33650
+ showWidgetInVerificationMethodStep
33549
33651
  );
33550
33652
  },
33551
33653
  [provider]
@@ -33558,7 +33660,7 @@ function PayoutDetailsDropinComponent({
33558
33660
  (problems == null ? void 0 : problems.missingData) ?? [],
33559
33661
  [],
33560
33662
  fieldsFromCustomRules,
33561
- fieldsFormCustomLabels,
33663
+ fieldsFromCustomLabels,
33562
33664
  {},
33563
33665
  legalEntityResponse.type
33564
33666
  ),
@@ -33766,12 +33868,12 @@ function PayoutDetailsDropinComponent({
33766
33868
  navigateBackToTaskList == null ? void 0 : navigateBackToTaskList();
33767
33869
  } : onSubmit
33768
33870
  });
33769
- const hideFooter = isExperimentEnabled("EnablePreferInstantVerificationFlow") && activeForm.formId === payoutSteps.payoutVerificationMethod.formId;
33770
33871
  const currentStep = useMemo(
33771
33872
  () => Object.values(forms).findIndex((step) => step.formId === activeForm.formId),
33772
33873
  [forms, activeForm.formId]
33773
33874
  );
33774
33875
  const totalSteps = useMemo(() => Object.keys(forms).length, [forms]);
33876
+ const omittedForms = showWidgetInVerificationMethodStep && ((_g = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _g.payoutVerificationMethod) === "instantVerification" ? [] : [payoutSteps.payoutVerificationMethod.formId];
33775
33877
  return /* @__PURE__ */ jsx(
33776
33878
  FormWrapper,
33777
33879
  {
@@ -33779,8 +33881,8 @@ function PayoutDetailsDropinComponent({
33779
33881
  activeForm,
33780
33882
  summary: {
33781
33883
  data: formatDataForSummary2(),
33782
- omittedKeys: ["transferInstrumentId"],
33783
- omittedForms: [payoutSteps.payoutVerificationMethod.formId],
33884
+ omittedKeys: ["transferInstrumentId", "payoutVerificationMethod"],
33885
+ omittedForms,
33784
33886
  labels: derivedProps == null ? void 0 : derivedProps.labels
33785
33887
  },
33786
33888
  handleBackClick,
@@ -33819,6 +33921,7 @@ function PayoutDetailsDropinComponent({
33819
33921
  setSubmitButtonLabel,
33820
33922
  setHideOnHomeButton: setHideHomeButton,
33821
33923
  setSkipSubmit,
33924
+ setHideFooter,
33822
33925
  onChange,
33823
33926
  legalEntityResponse,
33824
33927
  associatedLegalArrangement,
@@ -33838,11 +33941,11 @@ function PayoutDetailsDropinComponent({
33838
33941
  );
33839
33942
  }
33840
33943
  const outlinedIcon = "adyen-kyc-outlined-icon";
33841
- const styles$1 = {
33944
+ const styles$2 = {
33842
33945
  "outlined-icon": "adyen-kyc-outlined-icon",
33843
33946
  outlinedIcon
33844
33947
  };
33845
- const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles$1.outlinedIcon, children: /* @__PURE__ */ jsx(Icon, { name }) });
33948
+ const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles$2.outlinedIcon, children: /* @__PURE__ */ jsx(Icon, { name }) });
33846
33949
  const Splashscreen = ({ title, subtitle, icon, buttonText, onClick }) => {
33847
33950
  const { i18n } = useI18nContext();
33848
33951
  return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-splashscreen", children: [
@@ -34538,6 +34641,42 @@ const TrustRoleAndEntityType = (props) => {
34538
34641
  ] }) : void 0
34539
34642
  ] });
34540
34643
  };
34644
+ const settlorExemptionReasonsList = "adyen-kyc-settlor-exemption-reasons-list";
34645
+ const styles$1 = {
34646
+ "settlor-exemption-reasons-list": "adyen-kyc-settlor-exemption-reasons-list",
34647
+ settlorExemptionReasonsList
34648
+ };
34649
+ const formatRolesForSummary = (roles, i18n) => roles.map((role) => i18n.get(getRoleName(role))).join(", ");
34650
+ const formatSettlorExemptionReasonsForSummary = (reasons, i18n) => /* @__PURE__ */ jsx("ul", { className: styles$1.settlorExemptionReasonsList, children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: i18n.get(reason) }, reason)) });
34651
+ const formatRoleAndEntityTypeSummary = (data, i18n, isOrganizationSettlorWithExemptionEnabled) => {
34652
+ var _a, _b;
34653
+ const { trustMemberType, roles } = data;
34654
+ const role = formatRolesForSummary(roles, i18n);
34655
+ switch (trustMemberType) {
34656
+ case "undefinedBeneficiary":
34657
+ return {
34658
+ role,
34659
+ descriptionUndefinedBeneficiary: data.description
34660
+ };
34661
+ case "exemptSettlor":
34662
+ return {
34663
+ role,
34664
+ entityType: i18n.get(data.legalEntityType),
34665
+ firstName: (_a = data.exemptSettlorName) == null ? void 0 : _a.firstName,
34666
+ lastName: (_b = data.exemptSettlorName) == null ? void 0 : _b.lastName,
34667
+ country: isOrganizationSettlorWithExemptionEnabled ? data.country : void 0,
34668
+ legalCompanyName: isOrganizationSettlorWithExemptionEnabled ? data.name : void 0,
34669
+ settlorExemptionReason: summaryItem(
34670
+ "otherInformation",
34671
+ formatSettlorExemptionReasonsForSummary(data.settlorExemptionReason ?? [], i18n)
34672
+ )
34673
+ };
34674
+ case "company":
34675
+ case "rootTrustee":
34676
+ case "regular":
34677
+ return {};
34678
+ }
34679
+ };
34541
34680
  const summary = {
34542
34681
  formId: "summary",
34543
34682
  formName: "summary"
@@ -34660,7 +34799,6 @@ function RoleAndTypeDropinComponent({
34660
34799
  isOrganizationSettlorWithExemptionEnabled,
34661
34800
  country
34662
34801
  }) {
34663
- var _a, _b;
34664
34802
  const { i18n } = useI18nContext();
34665
34803
  const [trustMember, setTrustMember] = useState(
34666
34804
  existingTrustMember ?? "incomplete"
@@ -34673,19 +34811,12 @@ function RoleAndTypeDropinComponent({
34673
34811
  });
34674
34812
  const [activeForm, setActiveForm] = useState(regularForms.roleAndEntityType);
34675
34813
  const isSummaryStep = activeForm.formId === summaryStep.formId;
34676
- const formatRolesForSummary = (roles) => roles.map((role) => i18n.get(getRoleName(role))).join(", ");
34677
- const formatSettlorExemptionReasonsForSummary = (reasons) => reasons.map((reason) => i18n.get(reason)).join(", ");
34678
34814
  const summaryData = trustMember === "incomplete" ? {} : {
34679
- roleAndEntityType: {
34680
- role: formatRolesForSummary(trustMember.roles),
34681
- entityType: trustMember.trustMemberType !== "undefinedBeneficiary" ? i18n.get(trustMember.legalEntityType) : void 0,
34682
- descriptionUndefinedBeneficiary: trustMember.trustMemberType === "undefinedBeneficiary" ? trustMember.description : void 0,
34683
- otherInformation: trustMember.trustMemberType === "exemptSettlor" ? formatSettlorExemptionReasonsForSummary(trustMember.settlorExemptionReason ?? []) : void 0,
34684
- firstName: trustMember.trustMemberType === "exemptSettlor" ? (_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName : void 0,
34685
- lastName: trustMember.trustMemberType === "exemptSettlor" ? (_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName : void 0,
34686
- country: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.country : void 0,
34687
- legalCompanyName: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.name : void 0
34688
- }
34815
+ roleAndEntityType: formatRoleAndEntityTypeSummary(
34816
+ trustMember,
34817
+ i18n,
34818
+ isOrganizationSettlorWithExemptionEnabled
34819
+ )
34689
34820
  };
34690
34821
  const onNavigateToNextStep = () => {
34691
34822
  if (isSummaryStep && trustMember !== "incomplete") {
@@ -34796,7 +34927,7 @@ const serviceAgreementValidationRules = {
34796
34927
  errorMessage: "fieldIsRequired"
34797
34928
  }
34798
34929
  };
34799
- const logger$l = createLogger("useServiceAgreement");
34930
+ const logger$m = createLogger("useServiceAgreement");
34800
34931
  const FALLBACK_LANGUAGE_CODE$1 = "en";
34801
34932
  const useServiceAgreement = ({
34802
34933
  handleGetServiceAgreement,
@@ -34826,7 +34957,7 @@ const useServiceAgreement = ({
34826
34957
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
34827
34958
  setServiceAgreement({ id, contract });
34828
34959
  };
34829
- requestAcceptedServiceAgreement().catch(logger$l.error).finally(() => setLoading("success"));
34960
+ requestAcceptedServiceAgreement().catch(logger$m.error).finally(() => setLoading("success"));
34830
34961
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
34831
34962
  useEffect(() => {
34832
34963
  const requestServiceAgreement = async () => {
@@ -34841,7 +34972,7 @@ const useServiceAgreement = ({
34841
34972
  }
34842
34973
  );
34843
34974
  if (!document2) {
34844
- logger$l.log('"document" field was missing in response');
34975
+ logger$m.log('"document" field was missing in response');
34845
34976
  return;
34846
34977
  }
34847
34978
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -34856,7 +34987,7 @@ const useServiceAgreement = ({
34856
34987
  throw err;
34857
34988
  }
34858
34989
  };
34859
- requestServiceAgreement().catch(logger$l.error);
34990
+ requestServiceAgreement().catch(logger$m.error);
34860
34991
  }, [
34861
34992
  handleGetServiceAgreement,
34862
34993
  handleServiceAgreementIsNotAvailableInThatLanguage,
@@ -34880,7 +35011,7 @@ const serviceAgreementTypesTranslationMapping = {
34880
35011
  adyenPccr: "pccr",
34881
35012
  adyenChargeCard: "chargeCardUserAgreement"
34882
35013
  };
34883
- const logger$k = createLogger("ServiceAgreementDropinComponent");
35014
+ const logger$l = createLogger("ServiceAgreementDropinComponent");
34884
35015
  const FALLBACK_LANGUAGE_CODE = "en";
34885
35016
  function ServiceAgreementDropinComponent({
34886
35017
  legalEntityResponse,
@@ -35064,7 +35195,7 @@ function ServiceAgreementDropinComponent({
35064
35195
  await requestAndDownload(i18n.languageCode);
35065
35196
  } catch (e) {
35066
35197
  if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
35067
- await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$k.error);
35198
+ await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$l.error);
35068
35199
  return;
35069
35200
  }
35070
35201
  showToast({
@@ -35396,9 +35527,11 @@ function SolePropDropinComponent({
35396
35527
  country,
35397
35528
  taskType,
35398
35529
  requiredFields,
35399
- isSettingEnabled
35530
+ isSettingEnabled,
35531
+ isExperimentEnabled,
35532
+ rootLegalEntity: parentLegalEntity ?? legalEntityResponse
35400
35533
  }),
35401
- [country, data, taskType, requiredFields, isSettingEnabled]
35534
+ [country, data, taskType, requiredFields, isSettingEnabled, isExperimentEnabled]
35402
35535
  );
35403
35536
  const derivedProps = useMemo(
35404
35537
  () => getPropsFromConfigurations(
@@ -35476,11 +35609,10 @@ function SolePropDropinComponent({
35476
35609
  setNewSoleProp(createdLegalEntity);
35477
35610
  return createdLegalEntity;
35478
35611
  }
35479
- const updatedLegalEntity = await handleUpdateLegalEntity(
35612
+ return handleUpdateLegalEntity(
35480
35613
  drop("type").from(mappedLegalEntity),
35481
35614
  (legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newSoleProp == null ? void 0 : newSoleProp.id)
35482
35615
  );
35483
- return updatedLegalEntity;
35484
35616
  };
35485
35617
  const handleOnSubmit = async () => {
35486
35618
  const dataSubmitted = data;
@@ -35550,6 +35682,10 @@ function SolePropDropinComponent({
35550
35682
  datasetUtils
35551
35683
  );
35552
35684
  }
35685
+ summaryData.solePropFinancialInformation = formatFinancialInformationSummary(
35686
+ summaryData.solePropFinancialInformation,
35687
+ i18n
35688
+ );
35553
35689
  if (isDocumentsRequired(forms2)) {
35554
35690
  delete summaryData[solePropDocumentFormId];
35555
35691
  summaryData = {
@@ -36058,7 +36194,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
36058
36194
  return hasOwnEntityAssocation || !!hasOrganizationType;
36059
36195
  };
36060
36196
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
36061
- const logger$j = createLogger("DropinComposerComponent");
36197
+ const logger$k = createLogger("DropinComposerComponent");
36062
36198
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country) => country === CountryCodes.Australia && enabled;
36063
36199
  function DropinComposerComponent({
36064
36200
  capabilities,
@@ -36165,7 +36301,7 @@ function DropinComposerComponent({
36165
36301
  setPciStatus(response);
36166
36302
  return response;
36167
36303
  } catch (e) {
36168
- logger$j.warn(i18n.get("failedToGetPciStatus"));
36304
+ logger$k.warn(i18n.get("failedToGetPciStatus"));
36169
36305
  }
36170
36306
  }
36171
36307
  return void 0;
@@ -36193,7 +36329,7 @@ function DropinComposerComponent({
36193
36329
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
36194
36330
  useEffect(() => {
36195
36331
  if (!tasks.includes(TaskTypes.PCI_DSS)) return;
36196
- getPciTemplate2().catch(logger$j.error);
36332
+ getPciTemplate2().catch(logger$k.error);
36197
36333
  }, [getPciTemplate2, tasks]);
36198
36334
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
36199
36335
  try {
@@ -36203,7 +36339,7 @@ function DropinComposerComponent({
36203
36339
  acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
36204
36340
  };
36205
36341
  } catch (e) {
36206
- logger$j.warn(i18n.get("failedToFetchAcceptedByName"));
36342
+ logger$k.warn(i18n.get("failedToFetchAcceptedByName"));
36207
36343
  return {
36208
36344
  ...acceptanceInfo,
36209
36345
  acceptedByName: null
@@ -36217,7 +36353,7 @@ function DropinComposerComponent({
36217
36353
  const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
36218
36354
  setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
36219
36355
  } catch (e) {
36220
- logger$j.warn(i18n.get("failedToGetServiceAgreementStatus"));
36356
+ logger$k.warn(i18n.get("failedToGetServiceAgreementStatus"));
36221
36357
  }
36222
36358
  }
36223
36359
  };
@@ -36227,7 +36363,7 @@ function DropinComposerComponent({
36227
36363
  const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
36228
36364
  setServiceAgreementTypes(response.termsOfServiceTypes);
36229
36365
  } catch (e) {
36230
- logger$j.warn(i18n.get("failedToGetServiceAgreementStatus"));
36366
+ logger$k.warn(i18n.get("failedToGetServiceAgreementStatus"));
36231
36367
  }
36232
36368
  }
36233
36369
  };
@@ -36257,7 +36393,7 @@ function DropinComposerComponent({
36257
36393
  try {
36258
36394
  return await args.handleGetLegalEntity(rootLegalEntity.id);
36259
36395
  } catch (e) {
36260
- logger$j.warn("Failed to fetch legal entity details", e);
36396
+ logger$k.warn("Failed to fetch legal entity details", e);
36261
36397
  }
36262
36398
  }
36263
36399
  return void 0;
@@ -36313,7 +36449,7 @@ function DropinComposerComponent({
36313
36449
  await refreshAssociatedLegalArrangement();
36314
36450
  showToast({ type: "success", label: i18n.get("successFullyRemovedTrustMember") });
36315
36451
  } catch (err) {
36316
- logger$j.error(`Failed to delete trust member`, err);
36452
+ logger$k.error(`Failed to delete trust member`, err);
36317
36453
  showToast({ type: "error", label: i18n.get("failedToRemoveTrustMember") });
36318
36454
  }
36319
36455
  };
@@ -36380,14 +36516,14 @@ function DropinComposerComponent({
36380
36516
  }
36381
36517
  break;
36382
36518
  default:
36383
- logger$j.warn(
36519
+ logger$k.warn(
36384
36520
  `Updating trust member type "${trustMember.trustMemberType}" is not implemented.`
36385
36521
  );
36386
36522
  }
36387
36523
  showToast({ label: i18n.get("successfullyUpdatedDetails"), type: "success" });
36388
36524
  await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
36389
36525
  } catch (err) {
36390
- logger$j.error(err);
36526
+ logger$k.error(err);
36391
36527
  showToast({ label: i18n.get("failedToUpdateDetails"), type: "error" });
36392
36528
  }
36393
36529
  };
@@ -36399,7 +36535,7 @@ function DropinComposerComponent({
36399
36535
  singpassTabRef.current = window.open(authUrl, "_blank");
36400
36536
  singpassTabRef.current.focus();
36401
36537
  } catch (e) {
36402
- logger$j.error(e);
36538
+ logger$k.error(e);
36403
36539
  handleSingpassMyInfoLoginFailure(e);
36404
36540
  }
36405
36541
  }
@@ -36590,7 +36726,7 @@ function DropinComposerComponent({
36590
36726
  }
36591
36727
  };
36592
36728
  setIsLoadingConfiguration(true);
36593
- fetchConfiguration().catch(logger$j.error).finally(() => {
36729
+ fetchConfiguration().catch(logger$k.error).finally(() => {
36594
36730
  setIsLoadingConfiguration(false);
36595
36731
  onLoad();
36596
36732
  });
@@ -36627,7 +36763,7 @@ function DropinComposerComponent({
36627
36763
  singpassTabRef.current = window.open(authUrl);
36628
36764
  singpassTabRef.current.focus();
36629
36765
  } catch (e) {
36630
- logger$j.error(e);
36766
+ logger$k.error(e);
36631
36767
  handleSingpassMyInfoLoginFailure(e);
36632
36768
  }
36633
36769
  },
@@ -37155,6 +37291,26 @@ function DropinComposerComponent({
37155
37291
  return null;
37156
37292
  }
37157
37293
  }
37294
+ const acceptServiceAgreement = async (context, termsOfServiceDocumentId, data) => {
37295
+ const { loadingContext, legalEntityId } = context;
37296
+ return httpPost(
37297
+ {
37298
+ loadingContext,
37299
+ errorLevel: "warn",
37300
+ errorMessage: `Failed to get service agreement status`,
37301
+ path: `${legalEntityId}/termsOfService/accept`,
37302
+ authentication: "jwt",
37303
+ headers: {
37304
+ "Content-Type": "application/json"
37305
+ }
37306
+ },
37307
+ {
37308
+ ...data,
37309
+ legalEntityReference: legalEntityId,
37310
+ termsOfServiceDocumentId
37311
+ }
37312
+ );
37313
+ };
37158
37314
  const clearCompanyData = async (context) => {
37159
37315
  const { loadingContext, legalEntityId } = context;
37160
37316
  return httpPost({
@@ -37200,6 +37356,19 @@ const companyIndexSearch = async (context, data) => {
37200
37356
  data
37201
37357
  );
37202
37358
  };
37359
+ const confirmDataReview = async (context) => {
37360
+ const { loadingContext, legalEntityId } = context;
37361
+ return httpPost({
37362
+ loadingContext,
37363
+ errorLevel: "warn",
37364
+ errorMessage: `Failed to confirm data review`,
37365
+ path: `${legalEntityId}/confirmDataReview`,
37366
+ authentication: "jwt",
37367
+ headers: {
37368
+ "Content-Type": "application/json"
37369
+ }
37370
+ });
37371
+ };
37203
37372
  const createDocument = async (context, document2, ownerId) => {
37204
37373
  const { loadingContext, legalEntityId } = context;
37205
37374
  return httpPost(
@@ -37248,240 +37417,6 @@ const createTransferInstrument = async (context, transferInstrument) => {
37248
37417
  transferInstrument
37249
37418
  );
37250
37419
  };
37251
- const getBankVerificationVendor = async (context, country, openBankingPartnerConfigId) => {
37252
- const { loadingContext, legalEntityId } = context;
37253
- const providerParams = new URLSearchParams({
37254
- country,
37255
- ...openBankingPartnerConfigId && { configId: openBankingPartnerConfigId }
37256
- });
37257
- return httpGet({
37258
- loadingContext,
37259
- errorLevel: "warn",
37260
- errorMessage: `Bank verification vendor not available`,
37261
- path: `${legalEntityId}/transferInstruments/trusted/providers?${providerParams}`,
37262
- authentication: "jwt",
37263
- headers: {
37264
- "Content-Type": "application/json"
37265
- }
37266
- });
37267
- };
37268
- const getCompanyDataset = async (context, data) => {
37269
- const { loadingContext, legalEntityId } = context;
37270
- return httpPost(
37271
- {
37272
- loadingContext,
37273
- errorLevel: "warn",
37274
- errorMessage: `Failed to get company dataset`,
37275
- path: `${legalEntityId}/companyDataset`,
37276
- authentication: "jwt",
37277
- headers: {
37278
- "Content-Type": "application/json"
37279
- }
37280
- },
37281
- data
37282
- );
37283
- };
37284
- const getDocument = async (context, documentId) => {
37285
- const { loadingContext, legalEntityId } = context;
37286
- return httpGet({
37287
- loadingContext,
37288
- errorLevel: "warn",
37289
- errorMessage: `Failed to fetch document`,
37290
- path: `${legalEntityId}/documents/${documentId}`,
37291
- authentication: "jwt",
37292
- headers: {
37293
- "Content-Type": "application/json"
37294
- }
37295
- });
37296
- };
37297
- const getLegalEntity = async (context, legalEntityId) => {
37298
- const { loadingContext, legalEntityId: rootLegalEntityId } = context;
37299
- const path = legalEntityId !== rootLegalEntityId ? `${rootLegalEntityId}/child/${legalEntityId}` : `${rootLegalEntityId}`;
37300
- return httpGet({
37301
- loadingContext,
37302
- errorLevel: "warn",
37303
- errorMessage: `LegalEntity not available`,
37304
- path,
37305
- authentication: "jwt",
37306
- headers: {
37307
- "Content-Type": "application/json"
37308
- }
37309
- });
37310
- };
37311
- const getScenarios = async (request, context) => {
37312
- const { loadingContext, legalEntityId } = context;
37313
- const { country: countryCode, legalEntityType } = request;
37314
- const scenarioParams = new URLSearchParams({
37315
- ...countryCode && { countryCode },
37316
- ...legalEntityType && { legalEntityType }
37317
- });
37318
- return httpGet({
37319
- loadingContext,
37320
- errorLevel: "warn",
37321
- errorMessage: `Scenarios not available`,
37322
- path: `${legalEntityId}/configurations/scenarios?${scenarioParams}`,
37323
- authentication: "jwt",
37324
- headers: {
37325
- "Content-Type": "application/json"
37326
- }
37327
- });
37328
- };
37329
- const getTasks = async (context) => {
37330
- const { loadingContext, legalEntityId } = context;
37331
- return httpGet({
37332
- loadingContext,
37333
- errorLevel: "warn",
37334
- errorMessage: `Tasks not available`,
37335
- path: `${legalEntityId}/configurations/tasks`,
37336
- authentication: "jwt",
37337
- headers: {
37338
- "Content-Type": "application/json"
37339
- }
37340
- });
37341
- };
37342
- const getTransferInstrument = async (context, transferInstrumentId) => {
37343
- const { loadingContext, legalEntityId } = context;
37344
- return httpGet({
37345
- loadingContext,
37346
- errorLevel: "warn",
37347
- errorMessage: `TransferInstrument not available`,
37348
- path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
37349
- authentication: "jwt",
37350
- headers: {
37351
- "Content-Type": "application/json"
37352
- }
37353
- });
37354
- };
37355
- const getTransferInstruments = async (context) => {
37356
- const { loadingContext, legalEntityId } = context;
37357
- return httpGet({
37358
- loadingContext,
37359
- errorLevel: "warn",
37360
- errorMessage: `TransferInstrument not available`,
37361
- path: `${legalEntityId}/transferInstruments`,
37362
- authentication: "jwt",
37363
- headers: {
37364
- "Content-Type": "application/json"
37365
- }
37366
- });
37367
- };
37368
- const refreshCompanyDataset = async (context, data) => {
37369
- const { loadingContext, legalEntityId } = context;
37370
- return httpPost(
37371
- {
37372
- loadingContext,
37373
- errorLevel: "warn",
37374
- errorMessage: `Failed to refresh company dataset`,
37375
- path: `${legalEntityId}/companyDataset/refreshed`,
37376
- authentication: "jwt",
37377
- headers: {
37378
- "Content-Type": "application/json"
37379
- }
37380
- },
37381
- data
37382
- );
37383
- };
37384
- const updateDocument = async (context, document2, documentId, ownerId) => {
37385
- const { loadingContext, legalEntityId } = context;
37386
- return httpPost(
37387
- {
37388
- loadingContext,
37389
- errorLevel: "warn",
37390
- errorMessage: `Failed to update document`,
37391
- path: `${legalEntityId}/documents/${documentId}/${ownerId}`,
37392
- authentication: "jwt",
37393
- headers: {
37394
- "Content-Type": "application/json"
37395
- }
37396
- },
37397
- document2
37398
- );
37399
- };
37400
- const updateLegalEntity = async (context, legalEntity, legalEntityId) => {
37401
- const { loadingContext, legalEntityId: rootLegalEntityId } = context;
37402
- const patchLegalEntity = {
37403
- ...legalEntity,
37404
- id: legalEntityId
37405
- };
37406
- return httpPost(
37407
- {
37408
- loadingContext,
37409
- errorLevel: "warn",
37410
- errorMessage: `LegalEntity update failed`,
37411
- path: `${rootLegalEntityId}`,
37412
- authentication: "jwt",
37413
- headers: {
37414
- "Content-Type": "application/json"
37415
- }
37416
- },
37417
- patchLegalEntity
37418
- );
37419
- };
37420
- const updateTransferInstrument = async (context, transferInstrument, transferInstrumentId) => {
37421
- const { loadingContext, legalEntityId } = context;
37422
- return httpPost(
37423
- {
37424
- loadingContext,
37425
- errorLevel: "warn",
37426
- errorMessage: `Failed to update transferInstrument`,
37427
- path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
37428
- authentication: "jwt",
37429
- headers: {
37430
- "Content-Type": "application/json"
37431
- }
37432
- },
37433
- transferInstrument
37434
- );
37435
- };
37436
- const verifyTin = async (context, data) => {
37437
- const { loadingContext, legalEntityId } = context;
37438
- return httpPost(
37439
- {
37440
- loadingContext,
37441
- errorLevel: "warn",
37442
- errorMessage: `Failed to verify tin`,
37443
- path: `${legalEntityId}/verifyTin`,
37444
- authentication: "jwt",
37445
- headers: {
37446
- "Content-Type": "application/json"
37447
- }
37448
- },
37449
- data
37450
- );
37451
- };
37452
- const acceptServiceAgreement = async (context, termsOfServiceDocumentId, data) => {
37453
- const { loadingContext, legalEntityId } = context;
37454
- return httpPost(
37455
- {
37456
- loadingContext,
37457
- errorLevel: "warn",
37458
- errorMessage: `Failed to get service agreement status`,
37459
- path: `${legalEntityId}/termsOfService/accept`,
37460
- authentication: "jwt",
37461
- headers: {
37462
- "Content-Type": "application/json"
37463
- }
37464
- },
37465
- {
37466
- ...data,
37467
- legalEntityReference: legalEntityId,
37468
- termsOfServiceDocumentId
37469
- }
37470
- );
37471
- };
37472
- const confirmDataReview = async (context) => {
37473
- const { loadingContext, legalEntityId } = context;
37474
- return httpPost({
37475
- loadingContext,
37476
- errorLevel: "warn",
37477
- errorMessage: `Failed to confirm data review`,
37478
- path: `${legalEntityId}/confirmDataReview`,
37479
- authentication: "jwt",
37480
- headers: {
37481
- "Content-Type": "application/json"
37482
- }
37483
- });
37484
- };
37485
37420
  const createTrustedTransferInstrument = async (context, code, state) => {
37486
37421
  const { loadingContext, legalEntityId } = context;
37487
37422
  const path = `${legalEntityId}/transferInstruments/trusted`;
@@ -37567,6 +37502,53 @@ const getAddress = async (context, addressId) => {
37567
37502
  }
37568
37503
  });
37569
37504
  };
37505
+ const getBankVerificationVendor = async (context, country, openBankingPartnerConfigId, locale) => {
37506
+ const { loadingContext, legalEntityId } = context;
37507
+ const providerParams = new URLSearchParams({
37508
+ country,
37509
+ ...openBankingPartnerConfigId && { configId: openBankingPartnerConfigId },
37510
+ locale
37511
+ });
37512
+ return httpGet({
37513
+ loadingContext,
37514
+ errorLevel: "warn",
37515
+ errorMessage: `Bank verification vendor not available`,
37516
+ path: `${legalEntityId}/transferInstruments/trusted/providers?${providerParams}`,
37517
+ authentication: "jwt",
37518
+ headers: {
37519
+ "Content-Type": "application/json"
37520
+ }
37521
+ });
37522
+ };
37523
+ const getCompanyDataset = async (context, data) => {
37524
+ const { loadingContext, legalEntityId } = context;
37525
+ return httpPost(
37526
+ {
37527
+ loadingContext,
37528
+ errorLevel: "warn",
37529
+ errorMessage: `Failed to get company dataset`,
37530
+ path: `${legalEntityId}/companyDataset`,
37531
+ authentication: "jwt",
37532
+ headers: {
37533
+ "Content-Type": "application/json"
37534
+ }
37535
+ },
37536
+ data
37537
+ );
37538
+ };
37539
+ const getDocument = async (context, documentId) => {
37540
+ const { loadingContext, legalEntityId } = context;
37541
+ return httpGet({
37542
+ loadingContext,
37543
+ errorLevel: "warn",
37544
+ errorMessage: `Failed to fetch document`,
37545
+ path: `${legalEntityId}/documents/${documentId}`,
37546
+ authentication: "jwt",
37547
+ headers: {
37548
+ "Content-Type": "application/json"
37549
+ }
37550
+ });
37551
+ };
37570
37552
  const getIdverificationToken = async (context, request) => {
37571
37553
  const { loadingContext, legalEntityId } = context;
37572
37554
  return httpPost(
@@ -37583,6 +37565,20 @@ const getIdverificationToken = async (context, request) => {
37583
37565
  request
37584
37566
  );
37585
37567
  };
37568
+ const getLegalEntity = async (context, legalEntityId) => {
37569
+ const { loadingContext, legalEntityId: rootLegalEntityId } = context;
37570
+ const path = legalEntityId !== rootLegalEntityId ? `${rootLegalEntityId}/child/${legalEntityId}` : `${rootLegalEntityId}`;
37571
+ return httpGet({
37572
+ loadingContext,
37573
+ errorLevel: "warn",
37574
+ errorMessage: `LegalEntity not available`,
37575
+ path,
37576
+ authentication: "jwt",
37577
+ headers: {
37578
+ "Content-Type": "application/json"
37579
+ }
37580
+ });
37581
+ };
37586
37582
  const getOnboardingStatus = async (context) => {
37587
37583
  const { loadingContext, legalEntityId } = context;
37588
37584
  return httpGet({
@@ -37699,6 +37695,32 @@ const getServiceAgreementStatus = async (context) => {
37699
37695
  }
37700
37696
  });
37701
37697
  };
37698
+ const getTransferInstrument = async (context, transferInstrumentId) => {
37699
+ const { loadingContext, legalEntityId } = context;
37700
+ return httpGet({
37701
+ loadingContext,
37702
+ errorLevel: "warn",
37703
+ errorMessage: `TransferInstrument not available`,
37704
+ path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
37705
+ authentication: "jwt",
37706
+ headers: {
37707
+ "Content-Type": "application/json"
37708
+ }
37709
+ });
37710
+ };
37711
+ const getTransferInstruments = async (context) => {
37712
+ const { loadingContext, legalEntityId } = context;
37713
+ return httpGet({
37714
+ loadingContext,
37715
+ errorLevel: "warn",
37716
+ errorMessage: `TransferInstrument not available`,
37717
+ path: `${legalEntityId}/transferInstruments`,
37718
+ authentication: "jwt",
37719
+ headers: {
37720
+ "Content-Type": "application/json"
37721
+ }
37722
+ });
37723
+ };
37702
37724
  const handleBankVerificationError = async (context, errorCode, errorMessage, state, metadata) => {
37703
37725
  const { loadingContext, legalEntityId } = context;
37704
37726
  const path = `${legalEntityId}/transferInstruments/trusted/error`;
@@ -37737,6 +37759,22 @@ const idVerificationStartcheck = async (context, request) => {
37737
37759
  request
37738
37760
  );
37739
37761
  };
37762
+ const refreshCompanyDataset = async (context, data) => {
37763
+ const { loadingContext, legalEntityId } = context;
37764
+ return httpPost(
37765
+ {
37766
+ loadingContext,
37767
+ errorLevel: "warn",
37768
+ errorMessage: `Failed to refresh company dataset`,
37769
+ path: `${legalEntityId}/companyDataset/refreshed`,
37770
+ authentication: "jwt",
37771
+ headers: {
37772
+ "Content-Type": "application/json"
37773
+ }
37774
+ },
37775
+ data
37776
+ );
37777
+ };
37740
37778
  const searchAddress = async (context, address) => {
37741
37779
  const { loadingContext, legalEntityId } = context;
37742
37780
  return httpPost(
@@ -37769,6 +37807,74 @@ const signPci = async (context, data) => {
37769
37807
  data
37770
37808
  );
37771
37809
  };
37810
+ const updateDocument = async (context, document2, documentId, ownerId) => {
37811
+ const { loadingContext, legalEntityId } = context;
37812
+ return httpPost(
37813
+ {
37814
+ loadingContext,
37815
+ errorLevel: "warn",
37816
+ errorMessage: `Failed to update document`,
37817
+ path: `${legalEntityId}/documents/${documentId}/${ownerId}`,
37818
+ authentication: "jwt",
37819
+ headers: {
37820
+ "Content-Type": "application/json"
37821
+ }
37822
+ },
37823
+ document2
37824
+ );
37825
+ };
37826
+ const updateLegalEntity = async (context, legalEntity, legalEntityId) => {
37827
+ const { loadingContext, legalEntityId: rootLegalEntityId } = context;
37828
+ const patchLegalEntity = {
37829
+ ...legalEntity,
37830
+ id: legalEntityId
37831
+ };
37832
+ return httpPost(
37833
+ {
37834
+ loadingContext,
37835
+ errorLevel: "warn",
37836
+ errorMessage: `LegalEntity update failed`,
37837
+ path: `${rootLegalEntityId}`,
37838
+ authentication: "jwt",
37839
+ headers: {
37840
+ "Content-Type": "application/json"
37841
+ }
37842
+ },
37843
+ patchLegalEntity
37844
+ );
37845
+ };
37846
+ const updateTransferInstrument = async (context, transferInstrument, transferInstrumentId) => {
37847
+ const { loadingContext, legalEntityId } = context;
37848
+ return httpPost(
37849
+ {
37850
+ loadingContext,
37851
+ errorLevel: "warn",
37852
+ errorMessage: `Failed to update transferInstrument`,
37853
+ path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
37854
+ authentication: "jwt",
37855
+ headers: {
37856
+ "Content-Type": "application/json"
37857
+ }
37858
+ },
37859
+ transferInstrument
37860
+ );
37861
+ };
37862
+ const verifyTin = async (context, data) => {
37863
+ const { loadingContext, legalEntityId } = context;
37864
+ return httpPost(
37865
+ {
37866
+ loadingContext,
37867
+ errorLevel: "warn",
37868
+ errorMessage: `Failed to verify tin`,
37869
+ path: `${legalEntityId}/verifyTin`,
37870
+ authentication: "jwt",
37871
+ headers: {
37872
+ "Content-Type": "application/json"
37873
+ }
37874
+ },
37875
+ data
37876
+ );
37877
+ };
37772
37878
  const COMPONENTS_API_VERSION = "v1";
37773
37879
  const useComponentApi = (rootLegalEntityId) => {
37774
37880
  const authContext = useAuthContext();
@@ -37788,7 +37894,7 @@ const useComponentApi = (rootLegalEntityId) => {
37788
37894
  updateLegalEntity: async (legalEntity, legalEntityId) => updateLegalEntity(baseRequestContext, legalEntity, legalEntityId),
37789
37895
  createLegalEntity: async (legalEntity) => createLegalEntity(baseRequestContext, legalEntity),
37790
37896
  getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
37791
- getBankVerificationVendor: async (country, openBankingPartnerConfigId) => getBankVerificationVendor(baseRequestContext, country, openBankingPartnerConfigId),
37897
+ getBankVerificationVendor: async (country, openBankingPartnerConfigId, locale) => getBankVerificationVendor(baseRequestContext, country, openBankingPartnerConfigId, locale),
37792
37898
  getDocument: async (documentId) => getDocument(baseRequestContext, documentId),
37793
37899
  createDocument: async (document2, ownerId) => createDocument(baseRequestContext, document2, ownerId),
37794
37900
  updateDocument: async (document2, documentId, ownerId) => updateDocument(baseRequestContext, document2, documentId, ownerId),
@@ -37839,7 +37945,7 @@ const useComponentApi = (rootLegalEntityId) => {
37839
37945
  };
37840
37946
  }, [base, rootLegalEntityId]);
37841
37947
  };
37842
- const logger$i = createLogger("AcceptTermsOfService");
37948
+ const logger$j = createLogger("AcceptTermsOfService");
37843
37949
  function AcceptTermsOfServiceComponent({
37844
37950
  legalEntityId,
37845
37951
  modalView,
@@ -37881,13 +37987,13 @@ function AcceptTermsOfServiceComponent({
37881
37987
  onClose == null ? void 0 : onClose();
37882
37988
  };
37883
37989
  const fetchLegalEntity = useCallback(async () => {
37884
- await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$i.error);
37990
+ await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$j.error);
37885
37991
  }, [getLegalEntity2, legalEntityId]);
37886
37992
  const fetchUnsigned = useCallback(async () => {
37887
- await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$i.error);
37993
+ await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$j.error);
37888
37994
  }, [getServiceAgreementStatus2, legalEntityId]);
37889
37995
  const fetchSigned = useCallback(async () => {
37890
- await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$i.error);
37996
+ await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$j.error);
37891
37997
  }, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
37892
37998
  const handleSign = useCallback(
37893
37999
  // @ts-ignore-error:next-line ts does not infer type correctly
@@ -37921,7 +38027,7 @@ function AcceptTermsOfServiceComponent({
37921
38027
  (async () => {
37922
38028
  setIsLoading(true);
37923
38029
  await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
37924
- })().catch(logger$i.error).finally(() => {
38030
+ })().catch(logger$j.error).finally(() => {
37925
38031
  setIsLoading(false);
37926
38032
  });
37927
38033
  }, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
@@ -37948,7 +38054,7 @@ function AcceptTermsOfServiceComponent({
37948
38054
  }
37949
38055
  );
37950
38056
  }
37951
- const logger$h = createLogger("CreateIndividualComponent");
38057
+ const logger$i = createLogger("CreateIndividualComponent");
37952
38058
  function CreateIndividualComponent({
37953
38059
  parentLegalEntityId,
37954
38060
  legalEntityId,
@@ -37998,11 +38104,11 @@ function CreateIndividualComponent({
37998
38104
  setParentLegalEntity(parentEntity);
37999
38105
  setLegalEntity(entity);
38000
38106
  } catch (error) {
38001
- logger$h.error(error);
38107
+ logger$i.error(error);
38002
38108
  }
38003
38109
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
38004
38110
  useEffect(() => {
38005
- fetchLegalEntity().catch(logger$h.error);
38111
+ fetchLegalEntity().catch(logger$i.error);
38006
38112
  }, [fetchLegalEntity]);
38007
38113
  const country = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
38008
38114
  const onSubmit = (d) => {
@@ -38020,7 +38126,7 @@ function CreateIndividualComponent({
38020
38126
  setIsAddressEnabled(res.statuses.address.enabled);
38021
38127
  }, [country, getProviderStatus2]);
38022
38128
  useEffect(() => {
38023
- fetchProviderStatus().catch(logger$h.error);
38129
+ fetchProviderStatus().catch(logger$i.error);
38024
38130
  }, [fetchProviderStatus]);
38025
38131
  return /* @__PURE__ */ jsx(
38026
38132
  IndividualDropinComponent,
@@ -38045,7 +38151,7 @@ function CreateIndividualComponent({
38045
38151
  }
38046
38152
  );
38047
38153
  }
38048
- const logger$g = createLogger("CreateTransferInstrumentComponent");
38154
+ const logger$h = createLogger("CreateTransferInstrumentComponent");
38049
38155
  function CreateTransferInstrumentComponent({
38050
38156
  legalEntityId,
38051
38157
  transferInstrumentId,
@@ -38072,6 +38178,7 @@ function CreateTransferInstrumentComponent({
38072
38178
  rootLegalEntity: legalEntity,
38073
38179
  getLegalEntity: getLegalEntity2
38074
38180
  });
38181
+ const { i18n } = useI18nContext();
38075
38182
  const fetchLegalEntity = useCallback(async () => {
38076
38183
  const le = await getLegalEntity2(legalEntityId);
38077
38184
  setLegalEntity(le);
@@ -38085,7 +38192,7 @@ function CreateTransferInstrumentComponent({
38085
38192
  const ti = await getTransferInstrument2(transferInstrumentId);
38086
38193
  setTransferInstrument(ti);
38087
38194
  }
38088
- })().catch(logger$g.error).finally(() => {
38195
+ })().catch(logger$h.error).finally(() => {
38089
38196
  setLoadingStatus("success");
38090
38197
  });
38091
38198
  }, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
@@ -38096,7 +38203,7 @@ function CreateTransferInstrumentComponent({
38096
38203
  setTransferInstrument,
38097
38204
  legalEntityResponse: legalEntity,
38098
38205
  associatedLegalArrangement,
38099
- handleGetBankVerificationVendors: (country) => getBankVerificationVendor2(country, openBankingPartnerConfigId),
38206
+ handleGetBankVerificationVendors: (country) => getBankVerificationVendor2(country, openBankingPartnerConfigId, i18n.locale),
38100
38207
  handleGetDocument: getDocument2,
38101
38208
  handleCreateDocument: createDocument2,
38102
38209
  handleUpdateDocument: updateDocument2,
@@ -38124,6 +38231,7 @@ const embeddedStatus = "adyen-kyc-embedded-status";
38124
38231
  const embeddedStatusLoading = "adyen-kyc-embedded-status-loading";
38125
38232
  const embeddedStatusAvatar = "adyen-kyc-embedded-status-avatar";
38126
38233
  const embeddedStatusLight = "adyen-kyc-embedded-status-light";
38234
+ const embeddedStatusActionIndicator = "adyen-kyc-embedded-status-action-indicator";
38127
38235
  const embeddedStatusInfo = "adyen-kyc-embedded-status-info";
38128
38236
  const styles = {
38129
38237
  "embedded-status": "adyen-kyc-embedded-status",
@@ -38134,6 +38242,8 @@ const styles = {
38134
38242
  embeddedStatusAvatar,
38135
38243
  "embedded-status-light": "adyen-kyc-embedded-status-light",
38136
38244
  embeddedStatusLight,
38245
+ "embedded-status-action-indicator": "adyen-kyc-embedded-status-action-indicator",
38246
+ embeddedStatusActionIndicator,
38137
38247
  "embedded-status-info": "adyen-kyc-embedded-status-info",
38138
38248
  embeddedStatusInfo
38139
38249
  };
@@ -38170,7 +38280,7 @@ const EmbeddedStatus = ({
38170
38280
  onClick,
38171
38281
  light,
38172
38282
  className,
38173
- actionButton,
38283
+ actionIndicator,
38174
38284
  ...props
38175
38285
  }) => {
38176
38286
  const { i18n } = useI18nContext();
@@ -38194,18 +38304,7 @@ const EmbeddedStatus = ({
38194
38304
  /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", children: title }),
38195
38305
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: subtitle })
38196
38306
  ] }) }),
38197
- actionButton ? /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusButton, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "5em", height: "2em" }) : /* @__PURE__ */ jsx(
38198
- Button,
38199
- {
38200
- label: i18n.get(actionButton.labelKey),
38201
- onClick: (e) => {
38202
- e.stopPropagation();
38203
- actionButton.onClick();
38204
- },
38205
- secondary: true,
38206
- small: true
38207
- }
38208
- ) }) : (statusTag == null ? void 0 : statusTag.translationKey) && /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusTag, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "8ch", height: "1em" }) : /* @__PURE__ */ jsx(Tag, { variant: statusTag.variant, children: i18n.get(statusTag.translationKey) }) })
38307
+ actionIndicator ? /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusButton, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "5em", height: "2em" }) : /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", className: styles.embeddedStatusActionIndicator, children: i18n.get(actionIndicator.labelKey) }) }) : (statusTag == null ? void 0 : statusTag.translationKey) && /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusTag, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "8ch", height: "1em" }) : /* @__PURE__ */ jsx(Tag, { variant: statusTag.variant, children: i18n.get(statusTag.translationKey) }) })
38209
38308
  ]
38210
38309
  }
38211
38310
  );
@@ -38278,9 +38377,6 @@ function PCIStatus({ legalEntityId, onClick, title, subtitle = "" }) {
38278
38377
  }).catch(() => {
38279
38378
  });
38280
38379
  }, [fetchStatus]);
38281
- const handleClick = () => {
38282
- onClick == null ? void 0 : onClick();
38283
- };
38284
38380
  return hasSigned ? /* @__PURE__ */ jsx(
38285
38381
  EmbeddedStatus,
38286
38382
  {
@@ -38294,7 +38390,7 @@ function PCIStatus({ legalEntityId, onClick, title, subtitle = "" }) {
38294
38390
  EmbeddedStatus,
38295
38391
  {
38296
38392
  onClick,
38297
- actionButton: { labelKey: "sign", onClick: handleClick },
38393
+ actionIndicator: { labelKey: "sign" },
38298
38394
  title,
38299
38395
  subtitle,
38300
38396
  loading: isLoading
@@ -38329,22 +38425,19 @@ function TermsOfServiceStatus({
38329
38425
  async () => getServiceAgreementAcceptanceInfos2(legalEntityId),
38330
38426
  [getServiceAgreementAcceptanceInfos2, legalEntityId]
38331
38427
  );
38332
- const getStatus = useCallback(async () => {
38428
+ const getStatus2 = useCallback(async () => {
38333
38429
  const [signedRes, unsignedRes] = await Promise.all([getSigned(), getUnsigned()]);
38334
38430
  const signed = signedRes.data.map((d) => d.type);
38335
38431
  const unsigned = unsignedRes.termsOfServiceTypes;
38336
38432
  return signed.length !== 0 && unsigned.length === 0;
38337
38433
  }, [getUnsigned, getSigned]);
38338
38434
  useEffect(() => {
38339
- getStatus().then((allSigned) => {
38435
+ getStatus2().then((allSigned) => {
38340
38436
  setIsLoading(false);
38341
38437
  setHasSignedAll(allSigned);
38342
38438
  }).catch(() => {
38343
38439
  });
38344
38440
  });
38345
- const handleClick = () => {
38346
- onClick == null ? void 0 : onClick();
38347
- };
38348
38441
  return hasSignedAll ? /* @__PURE__ */ jsx(
38349
38442
  EmbeddedStatus,
38350
38443
  {
@@ -38358,7 +38451,7 @@ function TermsOfServiceStatus({
38358
38451
  EmbeddedStatus,
38359
38452
  {
38360
38453
  onClick,
38361
- actionButton: { labelKey: "accept", onClick: handleClick },
38454
+ actionIndicator: { labelKey: "accept" },
38362
38455
  title,
38363
38456
  subtitle,
38364
38457
  loading: isLoading
@@ -38607,14 +38700,13 @@ function ManageTransferInstrumentOverviewItem({
38607
38700
  const [modalOpen, setModalOpen] = useState(false);
38608
38701
  const isDetailsRequired = transferInstrumentReference.status === "DETAILS_REQUIRED";
38609
38702
  const onClick = (transferInstrumentId) => {
38610
- if (isDetailsRequired) return;
38703
+ if (isDetailsRequired) {
38704
+ onEdit(transferInstrumentReference.transferInstrument.id);
38705
+ return;
38706
+ }
38611
38707
  onOpen(transferInstrumentId);
38612
38708
  setModalOpen(true);
38613
38709
  };
38614
- const actionButton = {
38615
- labelKey: "continue",
38616
- onClick: () => onEdit(transferInstrumentReference.transferInstrument.id)
38617
- };
38618
38710
  return /* @__PURE__ */ jsxs(Fragment, { children: [
38619
38711
  /* @__PURE__ */ jsx(
38620
38712
  EmbeddedStatus,
@@ -38628,7 +38720,7 @@ function ManageTransferInstrumentOverviewItem({
38628
38720
  ),
38629
38721
  subtitle: i18n.get("bankAccount"),
38630
38722
  onClick: () => onClick(transferInstrumentReference.transferInstrument.id),
38631
- actionButton: isDetailsRequired ? actionButton : void 0,
38723
+ actionIndicator: isDetailsRequired ? { labelKey: "continue" } : void 0,
38632
38724
  "aria-label": i18n.get("bankAccount")
38633
38725
  },
38634
38726
  transferInstrumentReference.transferInstrument.id
@@ -38646,7 +38738,7 @@ function ManageTransferInstrumentOverviewItem({
38646
38738
  )
38647
38739
  ] });
38648
38740
  }
38649
- const logger$f = createLogger("ManageTransferInstrumentOverview");
38741
+ const logger$g = createLogger("ManageTransferInstrumentOverview");
38650
38742
  function ManageTransferInstrumentOverview({
38651
38743
  transferInstrumentReferences,
38652
38744
  legalEntityId,
@@ -38665,7 +38757,7 @@ function ManageTransferInstrumentOverview({
38665
38757
  const ti = await getTransferInstrument2(transferInstrumentId);
38666
38758
  setTransferInstrumentsMap({ [transferInstrumentId]: ti, ...transferInstrumentsMap });
38667
38759
  } catch (e) {
38668
- logger$f.error(e);
38760
+ logger$g.error(e);
38669
38761
  }
38670
38762
  };
38671
38763
  const onRemoveTransferInstrument = async (transferInstrumentId) => {
@@ -38674,7 +38766,7 @@ function ManageTransferInstrumentOverview({
38674
38766
  onRemove(transferInstrumentId);
38675
38767
  } catch (e) {
38676
38768
  showToast({ label: i18n.get("thereWasAnErrorTryAgain"), type: "error" });
38677
- logger$f.error(e);
38769
+ logger$g.error(e);
38678
38770
  }
38679
38771
  };
38680
38772
  const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => /* @__PURE__ */ jsx(
@@ -38703,7 +38795,7 @@ function ManageTransferInstrumentOverview({
38703
38795
  )
38704
38796
  ] });
38705
38797
  }
38706
- const logger$e = createLogger("ManageTransferInstrumentComponent");
38798
+ const logger$f = createLogger("ManageTransferInstrumentComponent");
38707
38799
  function ManageTransferInstrumentComponent({
38708
38800
  legalEntityId,
38709
38801
  onAdd,
@@ -38731,7 +38823,7 @@ function ManageTransferInstrumentComponent({
38731
38823
  }, [getTransferInstruments2]);
38732
38824
  useEffect(() => {
38733
38825
  eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
38734
- init2().catch(logger$e.error).finally(() => {
38826
+ init2().catch(logger$f.error).finally(() => {
38735
38827
  setLoadingStatus("success");
38736
38828
  });
38737
38829
  }, [init2, setLocale, eventEmitter]);
@@ -38741,7 +38833,7 @@ function ManageTransferInstrumentComponent({
38741
38833
  }
38742
38834
  }, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
38743
38835
  const onRemove = (transferInstrumentId) => {
38744
- refreshTransferInstruments().catch(logger$e.error);
38836
+ refreshTransferInstruments().catch(logger$f.error);
38745
38837
  onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
38746
38838
  };
38747
38839
  const render2 = () => {
@@ -38768,7 +38860,7 @@ function ManageTransferInstrumentComponent({
38768
38860
  };
38769
38861
  return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-manage-transfer-instrument", children: render2() });
38770
38862
  }
38771
- const logger$d = createLogger("OnboardingDropinComponent");
38863
+ const logger$e = createLogger("OnboardingDropinComponent");
38772
38864
  function OnboardingDropinComponent({
38773
38865
  legalEntityId,
38774
38866
  openBankingPartnerConfigId
@@ -38828,13 +38920,13 @@ function OnboardingDropinComponent({
38828
38920
  setLegalEntity(le);
38829
38921
  setProviderStatus(providerStatuses);
38830
38922
  } catch (error) {
38831
- logger$d.error(error);
38923
+ logger$e.error(error);
38832
38924
  } finally {
38833
38925
  setLoadingStatus("success");
38834
38926
  }
38835
38927
  }, [legalEntityId, getLegalEntity2, getProviderStatus2]);
38836
38928
  useEffect(() => {
38837
- init2().catch(logger$d.error);
38929
+ init2().catch(logger$e.error);
38838
38930
  }, [init2]);
38839
38931
  return loadingStatus === "loading" || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
38840
38932
  DropinComposerComponent,
@@ -38878,7 +38970,7 @@ function OnboardingDropinComponent({
38878
38970
  }
38879
38971
  );
38880
38972
  }
38881
- const logger$c = createLogger("SignPCIComponent");
38973
+ const logger$d = createLogger("SignPCIComponent");
38882
38974
  function SignPCIComponent({
38883
38975
  legalEntityId,
38884
38976
  modalView,
@@ -38908,7 +39000,7 @@ function SignPCIComponent({
38908
39000
  onClose == null ? void 0 : onClose();
38909
39001
  };
38910
39002
  const fetchLegalEntity = useCallback(async () => {
38911
- await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$c.error);
39003
+ await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$d.error);
38912
39004
  }, [getLegalEntity2, legalEntityId]);
38913
39005
  const fetchStatus = useCallback(async () => {
38914
39006
  await getPciStatus2(legalEntityId, { additionalSalesChannels }).then(({ signingRequired }) => {
@@ -38919,7 +39011,7 @@ function SignPCIComponent({
38919
39011
  await getPciTemplate2(legalEntityId, {
38920
39012
  additionalSalesChannels,
38921
39013
  language: i18n.locale.substring(0, 2) ?? "en"
38922
- }).then((res) => setPciTemplate(res)).catch(logger$c.error);
39014
+ }).then((res) => setPciTemplate(res)).catch(logger$d.error);
38923
39015
  }, [additionalSalesChannels, getPciTemplate2, i18n.locale, legalEntityId]);
38924
39016
  useEffect(() => {
38925
39017
  (async () => {
@@ -39438,7 +39530,7 @@ const highExposureParentCompaniesDetailsValidations = {
39438
39530
  }
39439
39531
  ]
39440
39532
  };
39441
- const logger$b = createLogger("LegalFormField");
39533
+ const logger$c = createLogger("LegalFormField");
39442
39534
  function LegalFormField({
39443
39535
  name = "legalForm",
39444
39536
  data,
@@ -39476,7 +39568,7 @@ function LegalFormField({
39476
39568
  }));
39477
39569
  setLegalForms(legalFormsResponse);
39478
39570
  }
39479
- }).catch(() => logger$b.error);
39571
+ }).catch(() => logger$c.error);
39480
39572
  }, [countryCode]);
39481
39573
  return /* @__PURE__ */ jsx(
39482
39574
  Field,
@@ -39502,7 +39594,7 @@ function LegalFormField({
39502
39594
  }
39503
39595
  );
39504
39596
  }
39505
- const logger$a = createLogger("NaceCodeField");
39597
+ const logger$b = createLogger("NaceCodeField");
39506
39598
  function NaceCodeField({
39507
39599
  name = "naceCode",
39508
39600
  data,
@@ -39522,7 +39614,7 @@ function NaceCodeField({
39522
39614
  if (response) {
39523
39615
  setNaceCodes(response);
39524
39616
  }
39525
- }).catch(() => logger$a.error);
39617
+ }).catch(() => logger$b.error);
39526
39618
  }, []);
39527
39619
  const handleChangeForNaceCode = (e) => {
39528
39620
  var _a;
@@ -40525,7 +40617,7 @@ const FormEndState = ({
40525
40617
  );
40526
40618
  };
40527
40619
  const parseConfiguration = ({ matchingScenario }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
40528
- const logger$9 = createLogger("UpdateLegalEntityForHighExposure");
40620
+ const logger$a = createLogger("UpdateLegalEntityForHighExposure");
40529
40621
  const customLabels = {
40530
40622
  company: {
40531
40623
  legalForm: "businessStructure",
@@ -40646,7 +40738,7 @@ function UpdateLegalEntityForHighExposure({
40646
40738
  useEffect(() => {
40647
40739
  (async () => {
40648
40740
  await fetchLegalEntities();
40649
- })().catch(logger$9.error);
40741
+ })().catch(logger$a.error);
40650
40742
  }, [fetchLegalEntities]);
40651
40743
  const [data, setData] = useState(dataFromResponse);
40652
40744
  const [problems, setProblems] = useState(problemsProp ?? {});
@@ -41046,7 +41138,7 @@ function getContentByStatus(status) {
41046
41138
  return contentMap[status];
41047
41139
  }
41048
41140
  const FINAL_STATUSES = [OnboardingStatus.VERIFIED, OnboardingStatus.REJECTED];
41049
- const logger$8 = createLogger("ViewVerificationStatusComponent");
41141
+ const logger$9 = createLogger("ViewVerificationStatusComponent");
41050
41142
  function ViewVerificationStatusComponent({
41051
41143
  legalEntityId,
41052
41144
  hideExplanation = false,
@@ -41065,12 +41157,12 @@ function ViewVerificationStatusComponent({
41065
41157
  if (!onboardingStatus) return;
41066
41158
  const statusContent = getContentByStatus(onboardingStatus);
41067
41159
  if (statusContent) return statusContent;
41068
- logger$8.error(`there is no content for status "${onboardingStatus}"`);
41160
+ logger$9.error(`there is no content for status "${onboardingStatus}"`);
41069
41161
  }, [onboardingStatus]);
41070
41162
  const handleError = useCallback(
41071
41163
  (rawError, userMessage) => {
41072
41164
  const error = coerceError(rawError);
41073
- logger$8.error(error);
41165
+ logger$9.error(error);
41074
41166
  setAlertContent(userMessage);
41075
41167
  onError == null ? void 0 : onError({
41076
41168
  error,
@@ -41104,7 +41196,7 @@ function ViewVerificationStatusComponent({
41104
41196
  });
41105
41197
  useEffect(() => {
41106
41198
  setAlertContent(void 0);
41107
- fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$8.error);
41199
+ fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$9.error);
41108
41200
  }, [fetchOnboardingStatus, updateOnboardingStatus]);
41109
41201
  const [loadingLinkStatus, setLinkLoadingStatus] = useState("success");
41110
41202
  const redirectToAdyen = async () => {
@@ -41299,7 +41391,7 @@ const getVersionConfiguration = async (context) => {
41299
41391
  }
41300
41392
  });
41301
41393
  };
41302
- const logger$7 = createLogger("UseVersionConfiguration");
41394
+ const logger$8 = createLogger("UseVersionConfiguration");
41303
41395
  const useVersionConfiguration = async (legalEntityId) => {
41304
41396
  var _a, _b;
41305
41397
  const { isEmbeddedDropin, loadingContext: base } = useAuthContext();
@@ -41314,25 +41406,25 @@ const useVersionConfiguration = async (legalEntityId) => {
41314
41406
  enableVersionExperiment(feature);
41315
41407
  });
41316
41408
  } catch (e) {
41317
- logger$7.error("Failed to set version configuration", e);
41409
+ logger$8.error("Failed to set version configuration", e);
41318
41410
  }
41319
41411
  };
41320
- const logger$6 = createLogger("loadCountries");
41412
+ const logger$7 = createLogger("loadCountries");
41321
41413
  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") });
41322
41414
  const loadCountriesDataset = async (locale) => {
41323
41415
  const importForLocale = countriesImports[`./${locale}.json`];
41324
41416
  if (!importForLocale) {
41325
- logger$6.warn(`No countries dataset for ${locale}, falling back to en-US`);
41417
+ logger$7.warn(`No countries dataset for ${locale}, falling back to en-US`);
41326
41418
  return (await import("./en-US-CkdCbOCX.js")).default;
41327
41419
  }
41328
41420
  return (await importForLocale()).default;
41329
41421
  };
41330
- const logger$5 = createLogger("loadStates");
41422
+ const logger$6 = createLogger("loadStates");
41331
41423
  const statesImports = /* @__PURE__ */ Object.assign({ "./AU/en-US.json": () => import("./en-US-CQv3D6--.js"), "./BR/en-US.json": () => import("./en-US-eaysbh-g.js"), "./BR/pt-BR.json": () => import("./pt-BR-CNtbeGFJ.js"), "./CA/en-US.json": () => import("./en-US-gM26UC0X.js"), "./NZ/en-US.json": () => import("./en-US-CLmaFLwu.js"), "./US/en-US.json": () => import("./en-US-7uBFgKyC.js") });
41332
41424
  const loadStatesDataset = async (country, locale) => {
41333
41425
  const importForLocale = statesImports[`./${country}/${locale}.json`];
41334
41426
  if (!importForLocale) {
41335
- logger$5.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
41427
+ logger$6.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
41336
41428
  const fallbackImport = statesImports[`./${country}/en-US.json`];
41337
41429
  return (await fallbackImport()).default;
41338
41430
  }
@@ -41394,6 +41486,24 @@ const getNaceCodes = async (base) => httpGet({
41394
41486
  "Content-Type": "application/json"
41395
41487
  }
41396
41488
  });
41489
+ const getScenarios = async (request, context) => {
41490
+ const { loadingContext, legalEntityId } = context;
41491
+ const { country: countryCode, legalEntityType } = request;
41492
+ const scenarioParams = new URLSearchParams({
41493
+ ...countryCode && { countryCode },
41494
+ ...legalEntityType && { legalEntityType }
41495
+ });
41496
+ return httpGet({
41497
+ loadingContext,
41498
+ errorLevel: "warn",
41499
+ errorMessage: `Scenarios not available`,
41500
+ path: `${legalEntityId}/configurations/scenarios?${scenarioParams}`,
41501
+ authentication: "jwt",
41502
+ headers: {
41503
+ "Content-Type": "application/json"
41504
+ }
41505
+ });
41506
+ };
41397
41507
  const getSupportedCountries = async (context) => {
41398
41508
  const { loadingContext, legalEntityId } = context;
41399
41509
  return httpGet({
@@ -41407,6 +41517,19 @@ const getSupportedCountries = async (context) => {
41407
41517
  }
41408
41518
  });
41409
41519
  };
41520
+ const getTasks = async (context) => {
41521
+ const { loadingContext, legalEntityId } = context;
41522
+ return httpGet({
41523
+ loadingContext,
41524
+ errorLevel: "warn",
41525
+ errorMessage: `Tasks not available`,
41526
+ path: `${legalEntityId}/configurations/tasks`,
41527
+ authentication: "jwt",
41528
+ headers: {
41529
+ "Content-Type": "application/json"
41530
+ }
41531
+ });
41532
+ };
41410
41533
  const validateAccountIdentification$1 = async (context, payoutAccountDetails) => {
41411
41534
  const { loadingContext } = context;
41412
41535
  return httpPost(
@@ -41437,7 +41560,7 @@ const validatePhoneNumber$1 = async (context, phoneNumber) => {
41437
41560
  { number: phoneNumber }
41438
41561
  );
41439
41562
  };
41440
- const logger$4 = createLogger("verify-id-number");
41563
+ const logger$5 = createLogger("verify-id-number");
41441
41564
  const verifyIdNumber$1 = async (context, request) => {
41442
41565
  const { loadingContext, legalEntityId } = context;
41443
41566
  try {
@@ -41460,13 +41583,13 @@ const verifyIdNumber$1 = async (context, request) => {
41460
41583
  if (responseData.status === 500) {
41461
41584
  return { status: 500, message: "Service did not respond, do not block verification" };
41462
41585
  }
41463
- return logger$4.warn(`Unexpected response status ${responseData.status}`);
41586
+ return logger$5.warn(`Unexpected response status ${responseData.status}`);
41464
41587
  }
41465
41588
  },
41466
41589
  request
41467
41590
  );
41468
41591
  } catch (e) {
41469
- logger$4.warn("WARNING: idNumber verification failed - error:", e);
41592
+ logger$5.warn("WARNING: idNumber verification failed - error:", e);
41470
41593
  }
41471
41594
  };
41472
41595
  const getEmbeddedApi = ({
@@ -41565,7 +41688,7 @@ const validatePhoneNumber = async (context, phoneNumber) => {
41565
41688
  { number: phoneNumber }
41566
41689
  );
41567
41690
  };
41568
- const logger$3 = createLogger("verify-id-number");
41691
+ const logger$4 = createLogger("verify-id-number");
41569
41692
  const verifyIdNumber = async (context, request) => {
41570
41693
  const { loadingContext, clientKey } = context;
41571
41694
  try {
@@ -41583,7 +41706,7 @@ const verifyIdNumber = async (context, request) => {
41583
41706
  if (responseData.status === 500) {
41584
41707
  return { status: 500, message: "Service did not respond, do not block verification" };
41585
41708
  }
41586
- return logger$3.warn(`Unexpected response status ${responseData.status}`);
41709
+ return logger$4.warn(`Unexpected response status ${responseData.status}`);
41587
41710
  },
41588
41711
  path: "v1/verification/idNumber",
41589
41712
  clientKey
@@ -41591,7 +41714,7 @@ const verifyIdNumber = async (context, request) => {
41591
41714
  request
41592
41715
  );
41593
41716
  } catch (e) {
41594
- logger$3.warn("WARNING: idNumber verification failed - error:", e);
41717
+ logger$4.warn("WARNING: idNumber verification failed - error:", e);
41595
41718
  }
41596
41719
  };
41597
41720
  const getKycExternalApi = ({
@@ -41620,7 +41743,7 @@ const ConfigurationApiProvider = ({
41620
41743
  }) => {
41621
41744
  const authContext = useAuthContext();
41622
41745
  const { isEmbeddedDropin, loadingContext } = authContext;
41623
- const sdkVersion = "3.34.1";
41746
+ const sdkVersion = "3.35.1";
41624
41747
  useAnalytics({
41625
41748
  onUserEvent,
41626
41749
  legalEntityId: rootLegalEntityId,
@@ -41651,7 +41774,7 @@ const useAccountHolder = (legalEntityId) => {
41651
41774
  setAccountHolder: setAccountHolderIntoLocalStorage
41652
41775
  };
41653
41776
  };
41654
- const logger$2 = createLogger("CoreProvider");
41777
+ const logger$3 = createLogger("CoreProvider");
41655
41778
  const CoreProvider = ({
41656
41779
  contextCountry: initialContextCountry,
41657
41780
  rootLegalEntityId,
@@ -41666,7 +41789,7 @@ const CoreProvider = ({
41666
41789
  const isCountryAllowed = (allowedCountries == null ? void 0 : allowedCountries.includes(contextCountry)) ?? true;
41667
41790
  useEffect(() => {
41668
41791
  if (allowedCountries && !isCountryAllowed) {
41669
- logger$2.warn(`
41792
+ logger$3.warn(`
41670
41793
 
41671
41794
  "${contextCountry}" isn't a supported country. Please use one of the following:
41672
41795
  - ${listify(
@@ -41708,12 +41831,12 @@ function ExperimentsContextProvider({
41708
41831
  );
41709
41832
  return /* @__PURE__ */ jsx(ExperimentsContext.Provider, { value: contextValue, children });
41710
41833
  }
41711
- const logger$1 = createLogger("useAllowedLocales");
41834
+ const logger$2 = createLogger("useAllowedLocales");
41712
41835
  const useAllowedLocales = () => {
41713
41836
  const { getAllowedLocales: getAllowedLocales2 } = useConfigurationApi();
41714
41837
  const [allowedLocales, setAllowedLocales] = useState();
41715
41838
  useEffect(() => {
41716
- getAllowedLocales2().then((response) => setAllowedLocales(response.locales)).catch(logger$1.error);
41839
+ getAllowedLocales2().then((response) => setAllowedLocales(response.locales)).catch(logger$2.error);
41717
41840
  }, []);
41718
41841
  return allowedLocales;
41719
41842
  };
@@ -41725,7 +41848,7 @@ const loadLocale = async (locale) => {
41725
41848
  }
41726
41849
  return (await importForLocale()).default;
41727
41850
  };
41728
- const logger = createLogger("useTranslations");
41851
+ const logger$1 = createLogger("useTranslations");
41729
41852
  const useTranslations = ({
41730
41853
  locale,
41731
41854
  allowedLocales
@@ -41740,7 +41863,7 @@ const useTranslations = ({
41740
41863
  const localeToUse = isLocaleAllowed ? locale : FALLBACK_LOCALE;
41741
41864
  if (loaded.locale === localeToUse) return;
41742
41865
  if (!isLocaleAllowed) {
41743
- logger.error(
41866
+ logger$1.error(
41744
41867
  `
41745
41868
  "${locale}" isn't a supported locale. Please use one of the following:
41746
41869
  - ${listify(
@@ -41760,7 +41883,7 @@ const useTranslations = ({
41760
41883
  translations: dataset,
41761
41884
  locale: localeToUse
41762
41885
  });
41763
- }).catch((err) => logger.error("Error while loading translations", err));
41886
+ }).catch((err) => logger$1.error("Error while loading translations", err));
41764
41887
  }, [locale, allowedLocales, loaded.locale]);
41765
41888
  return loaded;
41766
41889
  };
@@ -42220,25 +42343,57 @@ class BaseElement {
42220
42343
  }
42221
42344
  }
42222
42345
  }
42346
+ const logger = createLogger("DebugModal");
42347
+ const getRoleTagVariant = (value) => {
42348
+ switch (value) {
42349
+ case void 0:
42350
+ return "orange";
42351
+ case true:
42352
+ return "green";
42353
+ case false:
42354
+ return "red";
42355
+ default:
42356
+ return "blue";
42357
+ }
42358
+ };
42359
+ const getStatus = (value) => {
42360
+ switch (value) {
42361
+ case void 0:
42362
+ return "undefined";
42363
+ case true:
42364
+ return "Enabled";
42365
+ case false:
42366
+ return "Disabled";
42367
+ default:
42368
+ return String(value);
42369
+ }
42370
+ };
42223
42371
  const DebugTable = ({
42224
42372
  data,
42225
42373
  keyHeading,
42226
- valueHeading
42227
- }) => /* @__PURE__ */ jsxs("table", { children: [
42228
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
42229
- /* @__PURE__ */ jsx("th", { children: keyHeading }),
42230
- /* @__PURE__ */ jsx("th", { children: valueHeading })
42231
- ] }) }),
42232
- /* @__PURE__ */ jsx("tbody", { children: data.map(([experimentName, value]) => /* @__PURE__ */ jsxs("tr", { children: [
42233
- /* @__PURE__ */ jsx("td", { children: experimentName }),
42234
- /* @__PURE__ */ jsx("td", { children: value === void 0 ? "undefined" : JSON.stringify(value) })
42235
- ] }, experimentName)) })
42236
- ] });
42374
+ searchTerm
42375
+ }) => {
42376
+ const filteredData = data.filter(([key]) => key.toLowerCase().includes(searchTerm.toLowerCase()));
42377
+ const sortedData = [...filteredData].sort(([keyA], [keyB]) => keyA.localeCompare(keyB));
42378
+ return /* @__PURE__ */ jsxs("div", { children: [
42379
+ /* @__PURE__ */ jsx("h2", { children: keyHeading }),
42380
+ sortedData.length === 0 ? /* @__PURE__ */ jsxs("p", { children: [
42381
+ "No results found for ",
42382
+ /* @__PURE__ */ jsx("strong", { children: searchTerm })
42383
+ ] }) : null,
42384
+ /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsx("tbody", { children: sortedData.map(([experimentName, value]) => /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42385
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: experimentName }),
42386
+ /* @__PURE__ */ jsx(Tag, { variant: getRoleTagVariant(value), className: "adyen-kyc-tag--large", children: getStatus(value) })
42387
+ ] }) }, experimentName)) }) })
42388
+ ] });
42389
+ };
42237
42390
  const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42238
42391
  const { isExperimentEnabled } = useExperimentsContext();
42239
42392
  const { getSetting } = useSettingsContext();
42240
42393
  const [rootLeData, setRootLeData] = useState();
42241
42394
  const [debugInfoCopied, setDebugInfoCopied] = useState(false);
42395
+ const [isRootLeDataEnabled, setIsRootLeDataEnabled] = useState(false);
42396
+ const [searchTerm, setSearchTerm] = useState("");
42242
42397
  const allExperimentsWithValues = valuesOf(ExperimentNames).map(
42243
42398
  (experimentName) => [experimentName, isExperimentEnabled(experimentName)]
42244
42399
  );
@@ -42247,11 +42402,19 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42247
42402
  );
42248
42403
  const fetchRootLeData = () => {
42249
42404
  if (!getRootLegalEntity) return;
42250
- getRootLegalEntity().then(setRootLeData).catch(console.error);
42405
+ getRootLegalEntity().then(setRootLeData).catch(logger.error);
42406
+ };
42407
+ const handleToggleRootLeData = () => {
42408
+ if (!isRootLeDataEnabled) {
42409
+ fetchRootLeData();
42410
+ } else {
42411
+ setRootLeData(void 0);
42412
+ }
42413
+ setIsRootLeDataEnabled(!isRootLeDataEnabled);
42251
42414
  };
42252
42415
  const copyToClipboard = async () => {
42253
42416
  const toCopy = {
42254
- sdkVersion: "3.34.1",
42417
+ sdkVersion: "3.35.1",
42255
42418
  experiments: Object.fromEntries(allExperimentsWithValues),
42256
42419
  settings: Object.fromEntries(allSettingsWithValues)
42257
42420
  };
@@ -42265,37 +42428,79 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42265
42428
  }, 5e3);
42266
42429
  };
42267
42430
  const header = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__header", children: [
42268
- "Debug ",
42269
- /* @__PURE__ */ jsx(Button, { label: "Copy debug info", icon: "document", onClick: copyToClipboard }),
42270
- debugInfoCopied ? /* @__PURE__ */ jsxs("span", { children: [
42271
- /* @__PURE__ */ jsx(Icon, { name: "check" }),
42272
- " Copied!"
42273
- ] }) : void 0
42431
+ /* @__PURE__ */ jsx("h1", { children: "Debug" }),
42432
+ /* @__PURE__ */ jsx(
42433
+ InputText,
42434
+ {
42435
+ name: "search",
42436
+ value: searchTerm,
42437
+ classNameModifiers: ["search"],
42438
+ onInput: (e) => setSearchTerm(e.target.value),
42439
+ placeholder: "Search for Experiments/Settings 🔎",
42440
+ trimOnBlur: true,
42441
+ spellCheck: false,
42442
+ "aria-label": "Search experiments or settings",
42443
+ "aria-invalid": false
42444
+ }
42445
+ )
42274
42446
  ] });
42275
- const footer = /* @__PURE__ */ jsx(Button, { label: "Get LE data", onClick: () => fetchRootLeData(), disabled: !getRootLegalEntity });
42276
- return /* @__PURE__ */ jsx(Modal, { size: "large", header, footer, onClose: onExit, children: /* @__PURE__ */ jsxs(Fragment, { children: [
42277
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__meta", children: [
42278
- /* @__PURE__ */ jsxs("span", { children: [
42279
- "SDK version: ",
42280
- "3.34.1"
42281
- ] }),
42282
- /* @__PURE__ */ jsxs("span", { children: [
42283
- "rootLegalEntityId: ",
42284
- rootLegalEntityId
42285
- ] })
42447
+ const footer = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__footer", children: [
42448
+ /* @__PURE__ */ jsxs("div", { children: [
42449
+ /* @__PURE__ */ jsx(
42450
+ Button,
42451
+ {
42452
+ label: "Copy debug info",
42453
+ "aria-label": "Copy debug info",
42454
+ icon: "document",
42455
+ onClick: () => {
42456
+ copyToClipboard().catch((error) => {
42457
+ logger.error("Error copying to clipboard:", error);
42458
+ });
42459
+ }
42460
+ }
42461
+ ),
42462
+ debugInfoCopied ? /* @__PURE__ */ jsxs("span", { className: "adyen-kyc-debug-modal__footer--copy-status", children: [
42463
+ /* @__PURE__ */ jsx(Icon, { name: "check" }),
42464
+ " Copied!"
42465
+ ] }) : void 0
42286
42466
  ] }),
42467
+ /* @__PURE__ */ jsx(
42468
+ Button,
42469
+ {
42470
+ icon: isRootLeDataEnabled ? "show" : "hide",
42471
+ iconPosition: "left",
42472
+ "aria-label": isRootLeDataEnabled ? "Hide LegalEntity Data" : "Show LegalEntity Data",
42473
+ label: isRootLeDataEnabled ? "Hide LegalEntity Data" : "Show LegalEntity Data",
42474
+ onClick: handleToggleRootLeData
42475
+ }
42476
+ )
42477
+ ] });
42478
+ return /* @__PURE__ */ jsx(Modal, { size: "fullscreen", header, footer, onClose: onExit, children: /* @__PURE__ */ jsxs(Fragment, { children: [
42479
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
42480
+ /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42481
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
42482
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.35.1" })
42483
+ ] }) }),
42484
+ /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42485
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
42486
+ /* @__PURE__ */ jsx(Tag, { variant: "blue", className: "adyen-kyc-tag--large", children: rootLegalEntityId })
42487
+ ] }) })
42488
+ ] }) }) }),
42287
42489
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__content", children: [
42490
+ rootLeData ? /* @__PURE__ */ jsxs(Fragment, { children: [
42491
+ /* @__PURE__ */ jsx("h2", { children: "Legal Entity Data" }),
42492
+ /* @__PURE__ */ jsx("pre", { children: JSON.stringify(rootLeData, null, 2) })
42493
+ ] }) : void 0,
42288
42494
  /* @__PURE__ */ jsx(
42289
42495
  DebugTable,
42290
42496
  {
42291
42497
  data: allExperimentsWithValues,
42292
- keyHeading: "Experiment",
42293
- valueHeading: "Value"
42498
+ keyHeading: "Experiments",
42499
+ searchTerm
42294
42500
  }
42295
42501
  ),
42296
- /* @__PURE__ */ jsx(DebugTable, { data: allSettingsWithValues, keyHeading: "Setting", valueHeading: "Value" })
42297
- ] }),
42298
- rootLeData ? /* @__PURE__ */ jsx("pre", { children: JSON.stringify(rootLeData, null, 2) }) : void 0
42502
+ /* @__PURE__ */ jsx(DebugTable, { data: allSettingsWithValues, keyHeading: "Settings", searchTerm })
42503
+ ] })
42299
42504
  ] }) });
42300
42505
  };
42301
42506
  const DebugWrapper = ({