@adyen/kyc-components 2.41.4 → 2.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/es/adyen-kyc-components.es.js +387 -613
  2. package/dist/es/{arrow-left-CCxYxfCP.js → arrow-left-CwJQyOFz.js} +1 -1
  3. package/dist/es/{arrow-right-DF4Qe-8E.js → arrow-right-Cs_AKUOH.js} +1 -1
  4. package/dist/es/{bin-CGwewvcn.js → bin-8yaAerXc.js} +1 -1
  5. package/dist/es/{check-CeSLN4_9.js → check-_cOIMziL.js} +1 -1
  6. package/dist/es/{checkmark-DEh9MPYR.js → checkmark-CZpv8i5a.js} +1 -1
  7. package/dist/es/{checkmark-small-D_9HLctx.js → checkmark-small-C4TPve-W.js} +1 -1
  8. package/dist/es/{chevron-down-BzENwYSf.js → chevron-down-CwS2tE_6.js} +1 -1
  9. package/dist/es/{chevron-right-DczMHcvL.js → chevron-right-B8cQLres.js} +1 -1
  10. package/dist/es/{chevron-up-BLtnROd5.js → chevron-up-DccG0tVR.js} +1 -1
  11. package/dist/es/{company-2-JG34IScE.js → company-2-Cof0usfn.js} +1 -1
  12. package/dist/es/{company-D5_F_6SW.js → company-BKO80hWm.js} +1 -1
  13. package/dist/es/{contract-C6wDy9zU.js → contract-DrX5y2Qf.js} +1 -1
  14. package/dist/es/{controlling-person-C4KoSyi2.js → controlling-person-B_dn0b9H.js} +1 -1
  15. package/dist/es/{cross-BadGfrgB.js → cross-aFMJCrLf.js} +1 -1
  16. package/dist/es/{decision-maker-Cef3-OzY.js → decision-maker-28_rW1ah.js} +1 -1
  17. package/dist/es/{document-Cg4kZHpA.js → document-Bn_3PIDG.js} +1 -1
  18. package/dist/es/{download-DGC5_Bxe.js → download-DgAZobJV.js} +1 -1
  19. package/dist/es/{edit--fDhojib.js → edit-Dg19Ah77.js} +1 -1
  20. package/dist/es/{field-error-WElEN1mN.js → field-error-DkFiF_Cv.js} +1 -1
  21. package/dist/es/{info-circle-DkHN1ugA.js → info-circle-CXFfd_nO.js} +1 -1
  22. package/dist/es/{light-bulb-DEUhbRWP.js → light-bulb-CQ29JPA7.js} +1 -1
  23. package/dist/es/{location-B1Til-7Q.js → location-DmmjAv9A.js} +1 -1
  24. package/dist/es/{more-horiz-BieZKfy3.js → more-horiz-dyZQKaOn.js} +1 -1
  25. package/dist/es/{new-document-BEAJnXCG.js → new-document-CeV8zHP8.js} +1 -1
  26. package/dist/es/{owners-D1pksb86.js → owners-C1dyQqRO.js} +1 -1
  27. package/dist/es/{payout-BFiI--HY.js → payout-B-c43MDS.js} +1 -1
  28. package/dist/es/{pci-DMQLRoAn.js → pci-CVqIvwR-.js} +1 -1
  29. package/dist/es/{plus-DAnbeoyS.js → plus-BUH0nzS_.js} +1 -1
  30. package/dist/es/{remove-CEmd9YX7.js → remove-Bor5X8Xu.js} +1 -1
  31. package/dist/es/{review-CeQeKHXH.js → review-DcoDSRJT.js} +1 -1
  32. package/dist/es/{search-hf3HRVbu.js → search-SGLIdnsr.js} +1 -1
  33. package/dist/es/{signatory-BVoLPYPu.js → signatory-BMaWV_18.js} +1 -1
  34. package/dist/es/{store-D2z639xh.js → store-N4c2LHJ_.js} +1 -1
  35. package/dist/es/{trust-CpcaQaV7.js → trust-BcVDhtGL.js} +1 -1
  36. package/dist/es/{user-D6swzlYs.js → user-C8STPF6-.js} +1 -1
  37. package/dist/es/{user-business-CwS5j1qX.js → user-business-Dcvcw8gB.js} +1 -1
  38. package/dist/es/{users-3-BdjQ9rEA.js → users-3-D3QDBEk-.js} +1 -1
  39. package/dist/es/{warning-99uFf1WU.js → warning-Dxxpni4H.js} +1 -1
  40. package/dist/es/{wrong-1wvh7nZe.js → wrong-DNwa4zZR.js} +1 -1
  41. package/dist/style.css +1 -0
  42. package/dist/types/components/BankDocument/types.d.ts +1 -2
  43. package/dist/types/components/BankVerification/BankVerification.d.ts +1 -1
  44. package/dist/types/components/BankVerification/types.d.ts +5 -5
  45. package/dist/types/components/CompanyBasics/types.d.ts +3 -3
  46. package/dist/types/components/CompanyLookup/types.d.ts +4 -4
  47. package/dist/types/components/Individual/types.d.ts +2 -2
  48. package/dist/types/components/PayoutDetails/types.d.ts +2 -2
  49. package/dist/types/components/TaskList/types.d.ts +2 -2
  50. package/dist/types/components/internal/Address/constants.d.ts +1 -0
  51. package/dist/types/components/internal/BusinessRegistrationNumberField/types.d.ts +2 -2
  52. package/dist/types/components/internal/DocumentGuidance/DocumentGuidance.d.ts +1 -1
  53. package/dist/types/components/internal/DocumentGuidance/{type.d.ts → types.d.ts} +5 -0
  54. package/dist/types/components/internal/EntityAssociation/types.d.ts +2 -2
  55. package/dist/types/components/internal/Remove/types.d.ts +3 -3
  56. package/dist/types/components/internal/TaxInformationField/types.d.ts +2 -2
  57. package/dist/types/components/internal/VatNumberField/types.d.ts +2 -2
  58. package/dist/types/core/Context/QueryContext/QueryClient.d.ts +2 -0
  59. package/dist/types/core/Context/QueryContext/QueryClientProvider.d.ts +4 -0
  60. package/dist/types/core/hooks/introduction/useHasSeenIntroduction.d.ts +1 -1
  61. package/dist/types/core/hooks/singpass/useHasSeenSingpassSelection.d.ts +1 -1
  62. package/dist/types/core/hooks/useCompanySearch/types.d.ts +2 -2
  63. package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +3 -3
  64. package/dist/types/core/hooks/useForm/types.d.ts +8 -8
  65. package/dist/types/core/hooks/useFormComposer.d.ts +2 -2
  66. package/dist/types/core/hooks/useLocalStorage.d.ts +2 -2
  67. package/dist/types/utils/useStateFromProp.d.ts +2 -2
  68. package/package.json +8 -2
@@ -7,9 +7,10 @@ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
7
7
  import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
8
8
  import isISIN from "validator/es/lib/isISIN.js";
9
9
  import OpenBankingSDK from "@adyen/openbankingsdk";
10
- import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
10
+ import { jsxs as jsxs$1, jsx as jsx$1 } from "react/jsx-runtime";
11
11
  import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
12
12
  import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
13
+ import { QueryClient as QueryClient$1, QueryClientProvider as QueryClientProvider$1 } from "@tanstack/react-query";
13
14
  const ConfigurationApiContext = createContext(void 0);
14
15
  const useConfigurationApi = () => {
15
16
  const configurationApi = useContext(ConfigurationApiContext);
@@ -459,7 +460,6 @@ const depositSlip = "Deposit slip";
459
460
  const screenshotOfOnlineBankingEnviroment = "Screenshot of online banking environment";
460
461
  const officialEmailOrALetterFromYourBank = "Official email or a letter from your bank";
461
462
  const check = "Check";
462
- const releveDidentiteBancaire = "Relevé d'Identité Bancaire (RIB)";
463
463
  const successFullyRemovedDecisionMaker = "Successfully removed a decision maker";
464
464
  const failedToRemoveDecisionMaker = "Failed to remove a decision maker";
465
465
  const chamberOfCommerceExtract = "Chamber of Commerce extract";
@@ -842,21 +842,21 @@ const getYourBusinessVerifiedDetails = "Get your business's verified details ins
842
842
  const enterTheDetailsYourself = "Enter the details yourself";
843
843
  const youAlsoHaveToUploadSomeSupportingDocuments = "You'll also have to upload some supporting documents.";
844
844
  const verificationMethod = "Verification method";
845
- const verifyViaMobileBankAppOrBankWebsite = "Verify the account via mobile bank app or bank website";
846
- const provideAccountDetailsAndUploadBankStatement = "Provide account details and upload a scan of a bank statement";
847
- const instantVerificationDescription = "To quickly and safely verify the account you need access to the online banking environment associated with this account holder.";
845
+ const verifyViaMobileBankingAppOrWebsite = "Verify via mobile banking app or website";
846
+ const uploadABankStatement = "Upload a bank statement";
847
+ const instantVerificationDescription = "Log in to your bank account and get instantly verified.";
848
848
  const couldNotEstablishBankConnection = "We couldn't establish a connection with your bank";
849
849
  const sorryAnErrorOccurred = "We are sorry, an error has occurred";
850
850
  const ranIntoTechnicalError = "We ran into a technical error";
851
851
  const failedInitializeInstantVerification = "Failed to initialize instant account verification process";
852
852
  const couldNotCompleteAccountCheck = "We couldn't complete the account check";
853
853
  const tryAgainOrManualAccountDetails = "Please try again later or provide account details manually.";
854
- const manualVerificationDescription = "Manually provide your account details and upload a bank statement.";
854
+ const manualVerificationDescription = "You also have to provide the bank account details.";
855
855
  const poweredBy = "Powered by";
856
856
  const youSuccessfullyVerifiedAccount = "You’ve successfully verified your bank account.";
857
857
  const verifyBankAccountAgain = "Verify bank account again";
858
858
  const accountName = "Account name";
859
- const mayTakeAFewHoursOrDays = "May take a few hours or days";
859
+ const mayTakeAFewDays = "May take a few days";
860
860
  const instant = "Instant";
861
861
  const isOurTrustedPartnerHelpingSpeedUpSetup = "%{provider} is our trusted partner helping speed up your account setup by instantly verifying your bank account.";
862
862
  const howDoesVerificationWithOurPartnerWorks = "How does verification with our partner %{provider} work?";
@@ -1722,7 +1722,6 @@ const defaultTrans = {
1722
1722
  screenshotOfOnlineBankingEnviroment,
1723
1723
  officialEmailOrALetterFromYourBank,
1724
1724
  check,
1725
- releveDidentiteBancaire,
1726
1725
  successFullyRemovedDecisionMaker,
1727
1726
  failedToRemoveDecisionMaker,
1728
1727
  chamberOfCommerceExtract,
@@ -2113,8 +2112,8 @@ const defaultTrans = {
2113
2112
  enterTheDetailsYourself,
2114
2113
  youAlsoHaveToUploadSomeSupportingDocuments,
2115
2114
  verificationMethod,
2116
- verifyViaMobileBankAppOrBankWebsite,
2117
- provideAccountDetailsAndUploadBankStatement,
2115
+ verifyViaMobileBankingAppOrWebsite,
2116
+ uploadABankStatement,
2118
2117
  instantVerificationDescription,
2119
2118
  couldNotEstablishBankConnection,
2120
2119
  sorryAnErrorOccurred,
@@ -2127,7 +2126,7 @@ const defaultTrans = {
2127
2126
  youSuccessfullyVerifiedAccount,
2128
2127
  verifyBankAccountAgain,
2129
2128
  accountName,
2130
- mayTakeAFewHoursOrDays,
2129
+ mayTakeAFewDays,
2131
2130
  instant,
2132
2131
  isOurTrustedPartnerHelpingSpeedUpSetup,
2133
2132
  howDoesVerificationWithOurPartnerWorks,
@@ -2591,21 +2590,17 @@ const matchLocale = (locale, supportedLocales) => supportedLocales.find((supLoc)
2591
2590
  function formatLocale(localeParam) {
2592
2591
  const locale = localeParam.replace("_", "-");
2593
2592
  const format = /([a-z]{2})(-)([A-Z]{2})/;
2594
- if (format.test(locale))
2595
- return locale;
2593
+ if (format.test(locale)) return locale;
2596
2594
  const [languageCode, countryCode] = locale.split("-");
2597
- if (!languageCode || !countryCode)
2598
- return null;
2595
+ if (!languageCode || !countryCode) return null;
2599
2596
  const fullLocale = [languageCode.toLowerCase(), countryCode.toUpperCase()].join("-");
2600
2597
  return fullLocale.length === 5 ? fullLocale : null;
2601
2598
  }
2602
2599
  function parseLocale(locale, supportedLocales = []) {
2603
- if (!locale || locale.length < 1 || locale.length > 5)
2604
- return FALLBACK_LOCALE;
2600
+ if (!locale || locale.length < 1 || locale.length > 5) return FALLBACK_LOCALE;
2605
2601
  const formattedLocale = formatLocale(locale);
2606
2602
  const hasMatch = Boolean(formattedLocale && supportedLocales.includes(formattedLocale));
2607
- if (hasMatch)
2608
- return formattedLocale;
2603
+ if (hasMatch) return formattedLocale;
2609
2604
  return matchLocale(formattedLocale || locale, supportedLocales);
2610
2605
  }
2611
2606
  const formatCustomTranslations = (supportedLocales, customTranslations = {}) => Object.keys(customTranslations).reduce((acc, cur) => {
@@ -2965,7 +2960,7 @@ const mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
2965
2960
  const MAX_LENGTH = 30;
2966
2961
  const getMaxLengthByFieldAndCountry = (formattingRules, field, country2, ignoreIfFormatterExists) => {
2967
2962
  var _a, _b, _c, _d;
2968
- if (ignoreIfFormatterExists && ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter)) {
2963
+ if ((_b = (_a = formattingRules[country2]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter) {
2969
2964
  return null;
2970
2965
  }
2971
2966
  const maxLength = (_d = (_c = formattingRules[country2]) == null ? void 0 : _c[field]) == null ? void 0 : _d.maxlength;
@@ -2985,8 +2980,7 @@ const createLogger = (namespace) => {
2985
2980
  const methods = {};
2986
2981
  consoleMethodsPrefixable.forEach((method) => {
2987
2982
  methods[method] = (arg1, ...args) => {
2988
- if (!console[method] || suppressed)
2989
- return;
2983
+ if (!console[method] || suppressed) return;
2990
2984
  if (!namespace) {
2991
2985
  console[method](arg1, ...args);
2992
2986
  } else if (stringSubstitutionRegex.test(arg1)) {
@@ -2999,45 +2993,45 @@ const createLogger = (namespace) => {
2999
2993
  return methods;
3000
2994
  };
3001
2995
  const icons = {
3002
- "arrow-left": lazy(() => import("./arrow-left-CCxYxfCP.js")),
3003
- "arrow-right": lazy(() => import("./arrow-right-DF4Qe-8E.js")),
3004
- bin: lazy(() => import("./bin-CGwewvcn.js")),
3005
- check: lazy(() => import("./check-CeSLN4_9.js")),
3006
- checkmark: lazy(() => import("./checkmark-DEh9MPYR.js")),
3007
- "checkmark-small": lazy(() => import("./checkmark-small-D_9HLctx.js")),
3008
- "chevron-down": lazy(() => import("./chevron-down-BzENwYSf.js")),
3009
- "chevron-right": lazy(() => import("./chevron-right-DczMHcvL.js")),
3010
- "chevron-up": lazy(() => import("./chevron-up-BLtnROd5.js")),
3011
- company: lazy(() => import("./company-D5_F_6SW.js")),
3012
- "company-2": lazy(() => import("./company-2-JG34IScE.js")),
3013
- contract: lazy(() => import("./contract-C6wDy9zU.js")),
3014
- "controlling-person": lazy(() => import("./controlling-person-C4KoSyi2.js")),
3015
- cross: lazy(() => import("./cross-BadGfrgB.js")),
3016
- "decision-maker": lazy(() => import("./decision-maker-Cef3-OzY.js")),
3017
- document: lazy(() => import("./document-Cg4kZHpA.js")),
3018
- download: lazy(() => import("./download-DGC5_Bxe.js")),
3019
- edit: lazy(() => import("./edit--fDhojib.js")),
3020
- "field-error": lazy(() => import("./field-error-WElEN1mN.js")),
3021
- "info-circle": lazy(() => import("./info-circle-DkHN1ugA.js")),
3022
- "light-bulb": lazy(() => import("./light-bulb-DEUhbRWP.js")),
3023
- location: lazy(() => import("./location-B1Til-7Q.js")),
3024
- "more-horiz": lazy(() => import("./more-horiz-BieZKfy3.js")),
3025
- "new-document": lazy(() => import("./new-document-BEAJnXCG.js")),
3026
- owners: lazy(() => import("./owners-D1pksb86.js")),
3027
- payout: lazy(() => import("./payout-BFiI--HY.js")),
3028
- pci: lazy(() => import("./pci-DMQLRoAn.js")),
3029
- plus: lazy(() => import("./plus-DAnbeoyS.js")),
3030
- remove: lazy(() => import("./remove-CEmd9YX7.js")),
3031
- review: lazy(() => import("./review-CeQeKHXH.js")),
3032
- search: lazy(() => import("./search-hf3HRVbu.js")),
3033
- signatory: lazy(() => import("./signatory-BVoLPYPu.js")),
3034
- store: lazy(() => import("./store-D2z639xh.js")),
3035
- trust: lazy(() => import("./trust-CpcaQaV7.js")),
3036
- user: lazy(() => import("./user-D6swzlYs.js")),
3037
- "user-business": lazy(() => import("./user-business-CwS5j1qX.js")),
3038
- "users-3": lazy(() => import("./users-3-BdjQ9rEA.js")),
3039
- warning: lazy(() => import("./warning-99uFf1WU.js")),
3040
- wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
2996
+ "arrow-left": lazy(() => import("./arrow-left-CwJQyOFz.js")),
2997
+ "arrow-right": lazy(() => import("./arrow-right-Cs_AKUOH.js")),
2998
+ bin: lazy(() => import("./bin-8yaAerXc.js")),
2999
+ check: lazy(() => import("./check-_cOIMziL.js")),
3000
+ checkmark: lazy(() => import("./checkmark-CZpv8i5a.js")),
3001
+ "checkmark-small": lazy(() => import("./checkmark-small-C4TPve-W.js")),
3002
+ "chevron-down": lazy(() => import("./chevron-down-CwS2tE_6.js")),
3003
+ "chevron-right": lazy(() => import("./chevron-right-B8cQLres.js")),
3004
+ "chevron-up": lazy(() => import("./chevron-up-DccG0tVR.js")),
3005
+ company: lazy(() => import("./company-BKO80hWm.js")),
3006
+ "company-2": lazy(() => import("./company-2-Cof0usfn.js")),
3007
+ contract: lazy(() => import("./contract-DrX5y2Qf.js")),
3008
+ "controlling-person": lazy(() => import("./controlling-person-B_dn0b9H.js")),
3009
+ cross: lazy(() => import("./cross-aFMJCrLf.js")),
3010
+ "decision-maker": lazy(() => import("./decision-maker-28_rW1ah.js")),
3011
+ document: lazy(() => import("./document-Bn_3PIDG.js")),
3012
+ download: lazy(() => import("./download-DgAZobJV.js")),
3013
+ edit: lazy(() => import("./edit-Dg19Ah77.js")),
3014
+ "field-error": lazy(() => import("./field-error-DkFiF_Cv.js")),
3015
+ "info-circle": lazy(() => import("./info-circle-CXFfd_nO.js")),
3016
+ "light-bulb": lazy(() => import("./light-bulb-CQ29JPA7.js")),
3017
+ location: lazy(() => import("./location-DmmjAv9A.js")),
3018
+ "more-horiz": lazy(() => import("./more-horiz-dyZQKaOn.js")),
3019
+ "new-document": lazy(() => import("./new-document-CeV8zHP8.js")),
3020
+ owners: lazy(() => import("./owners-C1dyQqRO.js")),
3021
+ payout: lazy(() => import("./payout-B-c43MDS.js")),
3022
+ pci: lazy(() => import("./pci-CVqIvwR-.js")),
3023
+ plus: lazy(() => import("./plus-BUH0nzS_.js")),
3024
+ remove: lazy(() => import("./remove-Bor5X8Xu.js")),
3025
+ review: lazy(() => import("./review-DcoDSRJT.js")),
3026
+ search: lazy(() => import("./search-SGLIdnsr.js")),
3027
+ signatory: lazy(() => import("./signatory-BMaWV_18.js")),
3028
+ store: lazy(() => import("./store-N4c2LHJ_.js")),
3029
+ trust: lazy(() => import("./trust-BcVDhtGL.js")),
3030
+ user: lazy(() => import("./user-C8STPF6-.js")),
3031
+ "user-business": lazy(() => import("./user-business-Dcvcw8gB.js")),
3032
+ "users-3": lazy(() => import("./users-3-D3QDBEk-.js")),
3033
+ warning: lazy(() => import("./warning-Dxxpni4H.js")),
3034
+ wrong: lazy(() => import("./wrong-DNwa4zZR.js"))
3041
3035
  };
3042
3036
  const logger$u = createLogger("Icon");
3043
3037
  const Icon = ({
@@ -3177,8 +3171,7 @@ const Alert = ({
3177
3171
  i18n
3178
3172
  } = useI18nContext();
3179
3173
  const [isClosed, setIsClosed] = useState(false);
3180
- if (isClosed)
3181
- return null;
3174
+ if (isClosed) return null;
3182
3175
  const closeAlert = () => setIsClosed(true);
3183
3176
  const classNames = cx("adl-alert", className, {
3184
3177
  "adl-alert--basic": type === AlertTypes.BASIC,
@@ -3290,8 +3283,7 @@ const Link = ({
3290
3283
  iconLeft = false,
3291
3284
  onClick
3292
3285
  }) => {
3293
- if (!isValidLink(href))
3294
- return null;
3286
+ if (!isValidLink(href)) return null;
3295
3287
  const target = external ? "_blank" : "_self";
3296
3288
  const rel = external ? "external noopener noreferrer" : void 0;
3297
3289
  const showIcon = icon || external;
@@ -3569,8 +3561,7 @@ const useAllowedCountries = () => {
3569
3561
  } = useConfigurationApi();
3570
3562
  const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
3571
3563
  useEffect(() => {
3572
- if (acceptedCountries !== void 0)
3573
- return;
3564
+ if (acceptedCountries !== void 0) return;
3574
3565
  getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$s.error);
3575
3566
  }, [acceptedCountries]);
3576
3567
  return allowedCountries;
@@ -3701,8 +3692,7 @@ function reducer({
3701
3692
  const validationSchema = selectedSchema || state2.schema;
3702
3693
  switch (type) {
3703
3694
  case "setData": {
3704
- if (!key)
3705
- return state2;
3695
+ if (!key) return state2;
3706
3696
  return {
3707
3697
  ...state2,
3708
3698
  data: {
@@ -3712,8 +3702,7 @@ function reducer({
3712
3702
  };
3713
3703
  }
3714
3704
  case "setValid": {
3715
- if (!key)
3716
- return state2;
3705
+ if (!key) return state2;
3717
3706
  return {
3718
3707
  ...state2,
3719
3708
  valid: {
@@ -3723,8 +3712,7 @@ function reducer({
3723
3712
  };
3724
3713
  }
3725
3714
  case "setErrors": {
3726
- if (!key)
3727
- return state2;
3715
+ if (!key) return state2;
3728
3716
  return {
3729
3717
  ...state2,
3730
3718
  errors: {
@@ -3750,8 +3738,7 @@ function reducer({
3750
3738
  }, state2);
3751
3739
  }
3752
3740
  case "setSchema": {
3753
- if (!schema)
3754
- return state2;
3741
+ if (!schema) return state2;
3755
3742
  const defaultState = init({
3756
3743
  schema,
3757
3744
  defaultData,
@@ -3786,8 +3773,7 @@ function reducer({
3786
3773
  };
3787
3774
  }
3788
3775
  case "updateField": {
3789
- if (!key || !mode)
3790
- return state2;
3776
+ if (!key || !mode) return state2;
3791
3777
  const [formattedValue, validation] = processField({
3792
3778
  key,
3793
3779
  value,
@@ -3915,11 +3901,9 @@ const useAsyncValidator = (asyncRules) => {
3915
3901
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3916
3902
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
3917
3903
  const triggerAsyncValidation = useCallback((field, formState, mode) => {
3918
- if (!asyncRules)
3919
- return clearAsyncValidationResults();
3904
+ if (!asyncRules) return clearAsyncValidationResults();
3920
3905
  const rule = asyncRules[field];
3921
- if (!rule || !rule.modes.includes(mode))
3922
- return clearAsyncValidationResults();
3906
+ if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
3923
3907
  const value = formState.data[field];
3924
3908
  return rule.asyncValidate(formState.data[field], {
3925
3909
  state: formState
@@ -3972,8 +3956,7 @@ const useStaticValidator = (rules2) => {
3972
3956
  };
3973
3957
  };
3974
3958
  const mergeStaticAndAsyncErrorsState = (staticValidationErrors, asyncValidationErrors, schema) => {
3975
- if (!schema.length)
3976
- return staticValidationErrors;
3959
+ if (!schema.length) return staticValidationErrors;
3977
3960
  return schema.reduce((acc, field) => {
3978
3961
  var _a;
3979
3962
  return {
@@ -4027,8 +4010,7 @@ function useForm({
4027
4010
  return (_a = state2.schema) == null ? void 0 : _a.every((key) => state2.valid[key]);
4028
4011
  }, [state2.schema, state2.valid]);
4029
4012
  const getTargetValue = useCallback((key, e) => {
4030
- if (!(e == null ? void 0 : e.target))
4031
- return e;
4013
+ if (!(e == null ? void 0 : e.target)) return e;
4032
4014
  if (e.target.type === "checkbox") {
4033
4015
  return !state2.data[key];
4034
4016
  }
@@ -4124,8 +4106,7 @@ function useDataset(datasetIdentifier2, skip) {
4124
4106
  const [dataset, setDataset] = useState([]);
4125
4107
  const [loaded, setLoaded] = useState(false);
4126
4108
  useEffect(() => {
4127
- if (skip)
4128
- return;
4109
+ if (skip) return;
4129
4110
  getDataset2(datasetIdentifier2, i18n.locale).then((response) => {
4130
4111
  const result = response && response.length ? response : [];
4131
4112
  setDataset(result);
@@ -4288,15 +4269,12 @@ const Field = ({
4288
4269
  isValid: !!isValid,
4289
4270
  onBlurHandler: (e) => {
4290
4271
  setIsFocused(false);
4291
- if (onBlur)
4292
- onBlur(e);
4293
- if (onFieldBlur)
4294
- onFieldBlur(e);
4272
+ if (onBlur) onBlur(e);
4273
+ if (onFieldBlur) onFieldBlur(e);
4295
4274
  },
4296
4275
  onFocusHandler: (e) => {
4297
4276
  setIsFocused(true);
4298
- if (onFocus)
4299
- onFocus(e);
4277
+ if (onFocus) onFocus(e);
4300
4278
  },
4301
4279
  uniqueId
4302
4280
  }), helper && helperPosition === "below" && jsx("span", {
@@ -4333,13 +4311,11 @@ const Field = ({
4333
4311
  });
4334
4312
  };
4335
4313
  const getScrollParent = (node) => {
4336
- if (!node)
4337
- return null;
4314
+ if (!node) return null;
4338
4315
  const isElement = node instanceof HTMLElement;
4339
4316
  const overflowY = isElement && window.getComputedStyle(node).overflowY;
4340
4317
  const isScrollable = overflowY !== "visible" && overflowY !== "hidden";
4341
- if (isElement && isScrollable)
4342
- return node;
4318
+ if (isElement && isScrollable) return node;
4343
4319
  return getScrollParent(node.parentNode) ?? document.body;
4344
4320
  };
4345
4321
  function uuidv4() {
@@ -4389,11 +4365,10 @@ function SelectButtonElement({
4389
4365
  isSearch,
4390
4366
  ...props
4391
4367
  }) {
4392
- if (filterable || isMulti || isSearch)
4393
- return jsx("div", {
4394
- ...props,
4395
- ref: toggleButtonRef
4396
- });
4368
+ if (filterable || isMulti || isSearch) return jsx("div", {
4369
+ ...props,
4370
+ ref: toggleButtonRef
4371
+ });
4397
4372
  return jsx("button", {
4398
4373
  ...props,
4399
4374
  ref: toggleButtonRef,
@@ -4585,13 +4560,11 @@ const SelectListItem = ({
4585
4560
  "data-disabled": !!item.disabled,
4586
4561
  "data-value": item.id,
4587
4562
  onClick: () => {
4588
- if (item.disabled)
4589
- return;
4563
+ if (item.disabled) return;
4590
4564
  onSelect(!selected);
4591
4565
  },
4592
4566
  onKeyDown: (e) => {
4593
- if (item.disabled)
4594
- return;
4567
+ if (item.disabled) return;
4595
4568
  onKeyDown(e);
4596
4569
  },
4597
4570
  role: "option",
@@ -4723,8 +4696,7 @@ const Select = ({
4723
4696
  const closeList = () => {
4724
4697
  setTextFilter(null);
4725
4698
  setIsShowList(false);
4726
- if (toggleButtonRef.current)
4727
- toggleButtonRef.current.focus();
4699
+ if (toggleButtonRef.current) toggleButtonRef.current.focus();
4728
4700
  };
4729
4701
  const showList = () => {
4730
4702
  let sp = scrollParent;
@@ -4751,8 +4723,7 @@ const Select = ({
4751
4723
  setIsShowList(false);
4752
4724
  };
4753
4725
  const handleSelect = (selectedItem) => {
4754
- if (readonly)
4755
- return;
4726
+ if (readonly) return;
4756
4727
  if (isMulti) {
4757
4728
  const isAlreadySelected = active.find((item) => item.id === selectedItem.id);
4758
4729
  const newActiveItems = isAlreadySelected ? [...active.filter((i) => i.id !== selectedItem.id).map((i) => i.id)] : [...active.map((i) => i.id), selectedItem.id];
@@ -4815,8 +4786,7 @@ const Select = ({
4815
4786
  break;
4816
4787
  case KEYBOARD_KEYS.arrowDown:
4817
4788
  e.preventDefault();
4818
- if (target.nextElementSibling)
4819
- target.nextElementSibling.focus();
4789
+ if (target.nextElementSibling) target.nextElementSibling.focus();
4820
4790
  break;
4821
4791
  case KEYBOARD_KEYS.arrowUp:
4822
4792
  e.preventDefault();
@@ -5615,8 +5585,7 @@ const tryShift = (matchedTokens, remainingTokens, fromIndex, shiftDistance) => {
5615
5585
  }
5616
5586
  return ((_a = token.allow) == null ? void 0 : _a.test(token.potentialValue)) ?? true;
5617
5587
  });
5618
- if (!allValid)
5619
- return "notPossible";
5588
+ if (!allValid) return "notPossible";
5620
5589
  let matchedUpTo = 0;
5621
5590
  for (let i = 0; i < normalizedTokens.length; i += 1) {
5622
5591
  const token = normalizedInputTokens.find((t) => t.originalIndex === i) ?? normalizedTokens[i];
@@ -5651,8 +5620,7 @@ const getAvailableInputTokens = (tokens) => {
5651
5620
  ...token,
5652
5621
  offset: tokens.indexOf(token)
5653
5622
  });
5654
- if (token.type !== "input" || !token.optional)
5655
- break;
5623
+ if (token.type !== "input" || !token.optional) break;
5656
5624
  }
5657
5625
  return availableTokens;
5658
5626
  };
@@ -5661,13 +5629,10 @@ const getEagerSuffix = (tokens) => {
5661
5629
  let suffix = "";
5662
5630
  for (const token of tokens) {
5663
5631
  if (token.type === "input") {
5664
- if (token.optional)
5665
- continue;
5666
- else
5667
- break;
5632
+ if (token.optional) continue;
5633
+ else break;
5668
5634
  }
5669
- if (!token.displayEagerly)
5670
- break;
5635
+ if (!token.displayEagerly) break;
5671
5636
  suffix += token.char;
5672
5637
  }
5673
5638
  return suffix;
@@ -5695,12 +5660,11 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5695
5660
  while (true) {
5696
5661
  const char = charsToProcess[0];
5697
5662
  const token = tokensToProcess[0];
5698
- if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional))
5699
- return {
5700
- outcome: "correct",
5701
- displayValue: displayValue() + getEagerSuffix(tokensToProcess),
5702
- potentialForMoreOptionalInput: getPotentialForMoreOptionalInput(tokensToProcess)
5703
- };
5663
+ if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional)) return {
5664
+ outcome: "correct",
5665
+ displayValue: displayValue() + getEagerSuffix(tokensToProcess),
5666
+ potentialForMoreOptionalInput: getPotentialForMoreOptionalInput(tokensToProcess)
5667
+ };
5704
5668
  if (!char) {
5705
5669
  const output = shiftRight(mask.possibleShifts, matchedTokens, tokensToProcess);
5706
5670
  matchedTokens = output.matchedTokens;
@@ -5710,24 +5674,22 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5710
5674
  displayValue: displayValue() + getEagerSuffix(tokensToProcess)
5711
5675
  };
5712
5676
  }
5713
- if (!token)
5714
- return {
5715
- outcome: "mismatch",
5716
- badChar: char,
5717
- mismatchAtChar: charIndex,
5718
- mismatchedToken: "inputTooLong",
5719
- partialDisplayValue: displayValue()
5720
- };
5677
+ if (!token) return {
5678
+ outcome: "mismatch",
5679
+ badChar: char,
5680
+ mismatchAtChar: charIndex,
5681
+ mismatchedToken: "inputTooLong",
5682
+ partialDisplayValue: displayValue()
5683
+ };
5721
5684
  if (token.type === "nonInput") {
5722
5685
  if (token.includeInValue) {
5723
- if (char !== token.char)
5724
- return {
5725
- outcome: "mismatch",
5726
- badChar: char,
5727
- mismatchAtChar: charIndex,
5728
- mismatchedToken: token,
5729
- partialDisplayValue: displayValue()
5730
- };
5686
+ if (char !== token.char) return {
5687
+ outcome: "mismatch",
5688
+ badChar: char,
5689
+ mismatchAtChar: charIndex,
5690
+ mismatchedToken: token,
5691
+ partialDisplayValue: displayValue()
5692
+ };
5731
5693
  shiftChars(1);
5732
5694
  }
5733
5695
  matchedTokens.push(token);
@@ -5736,14 +5698,13 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5736
5698
  if (token.type === "input") {
5737
5699
  const availableTokens = getAvailableInputTokens(tokensToProcess);
5738
5700
  const matchingToken = findMatchingToken(availableTokens, char);
5739
- if (!matchingToken)
5740
- return {
5741
- outcome: "mismatch",
5742
- badChar: char,
5743
- mismatchAtChar: charIndex,
5744
- mismatchedToken: token,
5745
- partialDisplayValue: displayValue()
5746
- };
5701
+ if (!matchingToken) return {
5702
+ outcome: "mismatch",
5703
+ badChar: char,
5704
+ mismatchAtChar: charIndex,
5705
+ mismatchedToken: token,
5706
+ partialDisplayValue: displayValue()
5707
+ };
5747
5708
  matchedTokens.push({
5748
5709
  ...matchingToken,
5749
5710
  char
@@ -5754,30 +5715,26 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
5754
5715
  }
5755
5716
  };
5756
5717
  const deriveInputState = (isValid, isFocused, hasBlurred, isDisabled, errorMessage, shouldValidate, potentiallyMoreOptionalCharacters, formatGuidance, i18n) => {
5757
- if (isDisabled)
5758
- return {
5759
- isError: false
5760
- };
5761
- if (isValid && (!potentiallyMoreOptionalCharacters || !isFocused))
5762
- return {
5763
- isError: false,
5764
- text: jsxs(Fragment, {
5765
- children: [jsx(Icon, {
5766
- name: "checkmark-small",
5767
- className: "adyen-kyc-helper-text__valid-format-check"
5768
- }), i18n.get("formatIsCorrect")]
5769
- })
5770
- };
5771
- if (isFocused && formatGuidance)
5772
- return {
5773
- isError: false,
5774
- text: formatGuidance
5775
- };
5776
- if (!isValid && (shouldValidate || hasBlurred))
5777
- return {
5778
- isError: true,
5779
- text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
5780
- };
5718
+ if (isDisabled) return {
5719
+ isError: false
5720
+ };
5721
+ if (isValid && (!potentiallyMoreOptionalCharacters || !isFocused)) return {
5722
+ isError: false,
5723
+ text: jsxs(Fragment, {
5724
+ children: [jsx(Icon, {
5725
+ name: "checkmark-small",
5726
+ className: "adyen-kyc-helper-text__valid-format-check"
5727
+ }), i18n.get("formatIsCorrect")]
5728
+ })
5729
+ };
5730
+ if (isFocused && formatGuidance) return {
5731
+ isError: false,
5732
+ text: formatGuidance
5733
+ };
5734
+ if (!isValid && (shouldValidate || hasBlurred)) return {
5735
+ isError: true,
5736
+ text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
5737
+ };
5781
5738
  return {
5782
5739
  isError: false
5783
5740
  };
@@ -5813,12 +5770,10 @@ const MaskedInputText = ({
5813
5770
  i18n
5814
5771
  } = useI18nContext();
5815
5772
  const onMismatch = (mismatch) => {
5816
- if (!inputRef.current)
5817
- return;
5773
+ if (!inputRef.current) return;
5818
5774
  setShowingMismatch(true);
5819
5775
  inputRef.current.addEventListener("animationend", (event) => {
5820
- if (event.animationName !== MISMATCH_ANIMATION_NAME)
5821
- return;
5776
+ if (event.animationName !== MISMATCH_ANIMATION_NAME) return;
5822
5777
  setShowingMismatch(false);
5823
5778
  });
5824
5779
  onMismatchExternal == null ? void 0 : onMismatchExternal(mismatch);
@@ -5829,16 +5784,14 @@ const MaskedInputText = ({
5829
5784
  }
5830
5785
  }, [mask]);
5831
5786
  const getMaskResult = useCallback((pureValue) => {
5832
- if (!mask)
5833
- return {
5834
- outcome: "partialCorrect",
5835
- displayValue: pureValue
5836
- };
5787
+ if (!mask) return {
5788
+ outcome: "partialCorrect",
5789
+ displayValue: pureValue
5790
+ };
5837
5791
  return matchAgainstMask(transformOnType ? transformOnType(pureValue) : pureValue, mask, acceptObscuredValue);
5838
5792
  }, [mask, transformOnType, acceptObscuredValue]);
5839
5793
  const displayValueToPure = useCallback((displayValue2) => {
5840
- if (!mask)
5841
- return displayValue2;
5794
+ if (!mask) return displayValue2;
5842
5795
  return displayValueToPureValue(displayValue2, mask);
5843
5796
  }, [mask]);
5844
5797
  const maskResult = useMemo(() => getMaskResult(value), [getMaskResult, value]);
@@ -5868,8 +5821,7 @@ Falling back to partially valid value "${fallback}"`);
5868
5821
  const newPureValue = displayValueToPure(inputEl.value);
5869
5822
  const newMaskResult = getMaskResult(newPureValue);
5870
5823
  const returnCaretLater = (offset = 0) => {
5871
- if (!inputEl.selectionStart)
5872
- return;
5824
+ if (!inputEl.selectionStart) return;
5873
5825
  setCaretReturnPosition(inputEl.selectionStart + offset);
5874
5826
  };
5875
5827
  const cancelInput = () => {
@@ -5914,8 +5866,7 @@ Falling back to partially valid value "${fallback}"`);
5914
5866
  selectionStart,
5915
5867
  selectionEnd
5916
5868
  } = inputEl;
5917
- if (!pasteValue || !selectionStart || selectionStart !== selectionEnd)
5918
- return;
5869
+ if (!pasteValue || !selectionStart || selectionStart !== selectionEnd) return;
5919
5870
  const pureDisplayValue = displayValueToPure(displayValue);
5920
5871
  const purePasteValue = displayValueToPure(pasteValue);
5921
5872
  const newPureValue = pureDisplayValue.slice(0, selectionStart) + purePasteValue + pureDisplayValue.slice(selectionStart);
@@ -5934,8 +5885,7 @@ Falling back to partially valid value "${fallback}"`);
5934
5885
  onKeyDown: (event) => {
5935
5886
  const inputEl = event.target;
5936
5887
  const isCaretAtEndWithNoSelection = inputEl.selectionStart === inputEl.value.length && inputEl.selectionStart === inputEl.selectionEnd;
5937
- if (event.key !== KEYBOARD_KEYS.backspace || !isCaretAtEndWithNoSelection)
5938
- return;
5888
+ if (event.key !== KEYBOARD_KEYS.backspace || !isCaretAtEndWithNoSelection) return;
5939
5889
  event.preventDefault();
5940
5890
  const withLastCharRemoved = value.slice(0, value.length - 1);
5941
5891
  const newMaskResult = getMaskResult(withLastCharRemoved);
@@ -6072,8 +6022,7 @@ const companyRegistrationNumberOptions = {
6072
6022
  };
6073
6023
  const getCompanyRegistrationNumberOptions = (country2, companyType2) => {
6074
6024
  const optionsForCountry = companyRegistrationNumberOptions[country2];
6075
- if (!companyType2 || !optionsForCountry)
6076
- return optionsForCountry;
6025
+ if (!companyType2 || !optionsForCountry) return optionsForCountry;
6077
6026
  return optionsForCountry.filter((option) => {
6078
6027
  var _a;
6079
6028
  return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
@@ -6139,8 +6088,7 @@ const taxIdNumberOptions = {
6139
6088
  };
6140
6089
  const getTaxIdNumberOptions = (country2, companyType2) => {
6141
6090
  const optionsForCountry = taxIdNumberOptions[country2];
6142
- if (!companyType2 || !optionsForCountry)
6143
- return optionsForCountry;
6091
+ if (!companyType2 || !optionsForCountry) return optionsForCountry;
6144
6092
  return optionsForCountry.filter((option) => {
6145
6093
  var _a;
6146
6094
  return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
@@ -6168,8 +6116,7 @@ function CompanyRegistrationNumberTypeSelector({
6168
6116
  }, [exemptedOption, setSelected]);
6169
6117
  const options = useMemo(() => {
6170
6118
  const availableOptions = getCompanyRegistrationNumberOptions(country2, companyType2) ?? [];
6171
- if (availableOptions.length === 0 || !exemptedOption)
6172
- return availableOptions;
6119
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
6173
6120
  return [...availableOptions, {
6174
6121
  id: "exempted",
6175
6122
  name: exemptedOption
@@ -6180,8 +6127,7 @@ function CompanyRegistrationNumberTypeSelector({
6180
6127
  setSelected(options[0].id);
6181
6128
  }
6182
6129
  }, [options, selected, setSelected]);
6183
- if (options.length <= 1)
6184
- return null;
6130
+ if (options.length <= 1) return null;
6185
6131
  return jsx(Field, {
6186
6132
  name: "companyRegistrationNumberType",
6187
6133
  label: i18n.get("whichTypeOfRegistrationNumberDoYouHave"),
@@ -7392,15 +7338,13 @@ const defaultFieldConfig$8 = {
7392
7338
  const inferCompanyRegistrationNumberType = (registrationNumber2, country2, companyType2) => {
7393
7339
  const optionsForCountry = companyRegistrationNumberOptions[country2];
7394
7340
  const metadataFn = defaultFieldConfig$8[country2];
7395
- if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
7396
- return void 0;
7341
+ if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
7397
7342
  for (const option of optionsForCountry) {
7398
7343
  const fieldMetadata = metadataFn({
7399
7344
  companyType: companyType2,
7400
7345
  registrationNumberType: option.id
7401
7346
  });
7402
- if (!fieldMetadata.validators)
7403
- continue;
7347
+ if (!fieldMetadata.validators) continue;
7404
7348
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
7405
7349
  if (validators.every((validator) => validator.validate(registrationNumber2))) {
7406
7350
  return option.id;
@@ -8692,15 +8636,13 @@ const defaultFieldConfig$6 = {
8692
8636
  const inferTaxIdNumberType = (taxId2, country2) => {
8693
8637
  const optionsForCountry = taxIdNumberOptions[country2];
8694
8638
  const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
8695
- if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
8696
- return void 0;
8639
+ if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
8697
8640
  for (const option of optionsForCountry) {
8698
8641
  const fieldMetadata = metadataFn({
8699
8642
  taxIdNumberType: option.id,
8700
8643
  vatNumberType: option.id
8701
8644
  });
8702
- if (!fieldMetadata.validators)
8703
- continue;
8645
+ if (!fieldMetadata.validators) continue;
8704
8646
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
8705
8647
  if (validators.every((validator) => validator.validate(taxId2))) {
8706
8648
  return option.id;
@@ -8729,8 +8671,7 @@ function TaxIdNumberTypeSelector({
8729
8671
  }, [exemptedOption, setSelected]);
8730
8672
  const options = useMemo(() => {
8731
8673
  const availableOptions = getTaxIdNumberOptions(country2, companyType2) ?? [];
8732
- if (availableOptions.length === 0 || !exemptedOption)
8733
- return availableOptions;
8674
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
8734
8675
  return [...availableOptions, {
8735
8676
  id: "exempted",
8736
8677
  name: exemptedOption
@@ -8741,8 +8682,7 @@ function TaxIdNumberTypeSelector({
8741
8682
  handleSelect(options[0].id);
8742
8683
  }
8743
8684
  }, [options, selected, handleSelect]);
8744
- if (options.length <= 1)
8745
- return null;
8685
+ if (options.length <= 1) return null;
8746
8686
  return jsx(Field, {
8747
8687
  name: "taxIdNumberType",
8748
8688
  label: i18n.get("whichTypeOfTaxIdNumberDoYouHave"),
@@ -8964,8 +8904,7 @@ function VatNumber(props) {
8964
8904
  }
8965
8905
  });
8966
8906
  }, [data, valid, errors, isValid]);
8967
- if (!formUtils.isRequiredField("vatNumber"))
8968
- return null;
8907
+ if (!formUtils.isRequiredField("vatNumber")) return null;
8969
8908
  const exemptionIsPossible = ((_b = mergedProps.requiredFields) == null ? void 0 : _b.includes("exemptedFromVat")) ?? false;
8970
8909
  const showTaxIdExemptedOption = exemptionIsPossible && ((_c = taxIdNumberOptions[country2]) == null ? void 0 : _c.length) > 1;
8971
8910
  const handleTaxIdNumberTypeChange = (taxIdType) => {
@@ -9913,10 +9852,9 @@ const EntityTypeSelectionRadioCardBody = ({
9913
9852
  const {
9914
9853
  i18n
9915
9854
  } = useI18nContext();
9916
- if (!examples)
9917
- return jsx("span", {
9918
- children: i18n.get(description2)
9919
- });
9855
+ if (!examples) return jsx("span", {
9856
+ children: i18n.get(description2)
9857
+ });
9920
9858
  return jsxs(Fragment, {
9921
9859
  children: [jsx("span", {
9922
9860
  className: "adyen-kyc-entity-type-radio-group-card__description",
@@ -9935,8 +9873,7 @@ const EntityTypeSelectionRadioCardBody = ({
9935
9873
  const CoreContext = createContext(void 0);
9936
9874
  const useCoreContext = () => {
9937
9875
  const context = useContext(CoreContext);
9938
- if (!context)
9939
- throw Error("You need a <CoreProvider> to use core context");
9876
+ if (!context) throw Error("You need a <CoreProvider> to use core context");
9940
9877
  return context;
9941
9878
  };
9942
9879
  var TrustMemberTypes = /* @__PURE__ */ ((TrustMemberTypes2) => {
@@ -10149,22 +10086,17 @@ function getNestedPropertyKeys(obj, includeUndefined = false) {
10149
10086
  return fieldNames;
10150
10087
  }
10151
10088
  const getTaskStatus = (type, capabilityProblems, rootLegalEntity, entityIds, skipPendingCapabilitiesCheck = false) => {
10152
- if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity))
10153
- return TaskStatus.EMPTY;
10089
+ if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity)) return TaskStatus.EMPTY;
10154
10090
  const importantCapabilityStatus = checkForImportantCapabilityStatus(type, capabilityProblems, entityIds);
10155
- if (importantCapabilityStatus)
10156
- return importantCapabilityStatus;
10157
- if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity))
10158
- return TaskStatus.PROCESSING;
10091
+ if (importantCapabilityStatus) return importantCapabilityStatus;
10092
+ if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity)) return TaskStatus.PROCESSING;
10159
10093
  return TaskStatus.FINISHED;
10160
10094
  };
10161
10095
  const IMPORTANT_STATUSES = [TaskStatus.DETAILS_REQUIRED, TaskStatus.DOWNLOAD, TaskStatus.ERROR, TaskStatus.PROCESSING];
10162
10096
  function checkForImportantCapabilityStatus(type, capabilityProblems, entityIds) {
10163
- if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds)
10164
- return;
10097
+ if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds) return;
10165
10098
  const importantStatuses = Object.entries(capabilityProblems[type]).filter(([key]) => entityIds.includes(key)).map(([, value]) => value.status).filter((status) => status !== void 0 && IMPORTANT_STATUSES.includes(status));
10166
- if (!importantStatuses.length)
10167
- return;
10099
+ if (!importantStatuses.length) return;
10168
10100
  return importantStatuses.reduce((prev, curr) => curr > prev ? curr : prev);
10169
10101
  }
10170
10102
  const hasPendingCapabilities = (legalEntityResponse) => Object.values(legalEntityResponse.capabilities ?? {}).some((capability) => capability.verificationStatus === "pending");
@@ -10183,14 +10115,11 @@ const emptyFieldsByEntityType = {
10183
10115
  function isEmptyEntity(legalEntity) {
10184
10116
  var _a;
10185
10117
  const type = legalEntity == null ? void 0 : legalEntity.type;
10186
- if (!type)
10187
- return true;
10188
- if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length)
10189
- return false;
10118
+ if (!type) return true;
10119
+ if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length) return false;
10190
10120
  const minimumFields = emptyFieldsByEntityType[type];
10191
10121
  const typeSpecificSection = legalEntity[type];
10192
- if (!typeSpecificSection)
10193
- return true;
10122
+ if (!typeSpecificSection) return true;
10194
10123
  const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
10195
10124
  return !fieldsOnEntity.some((field) => !minimumFields.includes(field));
10196
10125
  }
@@ -10205,8 +10134,7 @@ const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false
10205
10134
  if (accountHolder2) {
10206
10135
  return accountHolder2;
10207
10136
  }
10208
- if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type))
10209
- return void 0;
10137
+ if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type)) return void 0;
10210
10138
  if (hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntityResponse.entityAssociations, legalEntityResponse.id)) {
10211
10139
  return "mySoleProprietorName";
10212
10140
  }
@@ -10577,82 +10505,48 @@ function DocumentGuidance({
10577
10505
  useEffect(() => {
10578
10506
  setGuidancePrefix(getDocumentGuidancePrefix(type));
10579
10507
  }, [type]);
10508
+ const documentGuidanceItems = useMemo(() => [{
10509
+ type: "valid",
10510
+ translationKey: "good"
10511
+ }, {
10512
+ type: "invalid-cut",
10513
+ translationKey: "notCutOff"
10514
+ }, {
10515
+ type: "invalid-blur",
10516
+ translationKey: "notBlurry"
10517
+ }, guidancePrefix === "generic-document" ? {
10518
+ type: "invalid-expired",
10519
+ translationKey: "notExpired"
10520
+ } : {
10521
+ type: "invalid-glare",
10522
+ translationKey: "noGlare"
10523
+ }], [guidancePrefix]);
10580
10524
  return jsx("div", {
10581
10525
  className: cx("adl-document-guidance", className),
10582
- children: jsxs("div", {
10526
+ children: jsx("div", {
10583
10527
  className: "adl-document-guidance__container",
10584
- children: [jsxs("div", {
10585
- className: "adl-document-guidance__item",
10586
- children: [jsx("svg", {
10587
- width: "100%",
10588
- role: "img",
10589
- children: jsx("use", {
10590
- href: `#adl-${guidancePrefix}-valid`
10591
- })
10592
- }), jsx("span", {
10593
- className: "adl-document-guidance__description",
10594
- children: i18n.get("good")
10595
- })]
10596
- }), jsxs("div", {
10597
- className: "adl-document-guidance__item",
10598
- children: [jsx("svg", {
10599
- width: "100%",
10600
- role: "img",
10601
- children: jsx("use", {
10602
- href: `#adl-${guidancePrefix}-invalid-cut`
10603
- })
10604
- }), jsx("span", {
10605
- className: "adl-document-guidance__description",
10606
- children: i18n.get("notCutOff")
10607
- })]
10608
- }), jsxs("div", {
10528
+ children: documentGuidanceItems.map((item) => jsxs("div", {
10609
10529
  className: "adl-document-guidance__item",
10610
10530
  children: [jsx("svg", {
10611
10531
  width: "100%",
10532
+ height: "100%",
10612
10533
  role: "img",
10613
10534
  children: jsx("use", {
10614
- href: `#adl-${guidancePrefix}-invalid-blur`
10535
+ href: `#adl-${guidancePrefix}-${item.type}`
10615
10536
  })
10616
10537
  }), jsx("span", {
10617
10538
  className: "adl-document-guidance__description",
10618
- children: i18n.get("notBlurry")
10539
+ children: i18n.get(item.translationKey)
10619
10540
  })]
10620
- }), jsx("div", {
10621
- className: "adl-document-guidance__item",
10622
- children: guidancePrefix === "generic-document" ? jsxs(Fragment, {
10623
- children: [jsx("svg", {
10624
- width: "100%",
10625
- role: "img",
10626
- children: jsx("use", {
10627
- href: `#adl-${guidancePrefix}-invalid-expired`
10628
- })
10629
- }), jsx("span", {
10630
- className: "adl-document-guidance__description",
10631
- children: i18n.get("notExpired")
10632
- })]
10633
- }) : jsxs(Fragment, {
10634
- children: [jsx("svg", {
10635
- width: "100%",
10636
- role: "img",
10637
- children: jsx("use", {
10638
- href: `#adl-${guidancePrefix}-invalid-glare`
10639
- })
10640
- }), jsx("span", {
10641
- className: "adl-document-guidance__description",
10642
- children: i18n.get("noGlare")
10643
- })]
10644
- })
10645
- })]
10541
+ }, item.type))
10646
10542
  })
10647
10543
  });
10648
10544
  }
10649
10545
  function bytesToSize(bytes) {
10650
10546
  const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
10651
- if (bytes === 0)
10652
- return "n/a";
10547
+ if (bytes === 0) return "n/a";
10653
10548
  const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
10654
- if (i === 0)
10655
- return `${bytes} ${sizes[i]}`;
10549
+ if (i === 0) return `${bytes} ${sizes[i]}`;
10656
10550
  return `${(bytes / 1024 ** i).toFixed()} ${sizes[i]}`;
10657
10551
  }
10658
10552
  const isExistingFile = (file) => "existing" in file && file.existing;
@@ -10669,11 +10563,9 @@ function DropzoneFile(props) {
10669
10563
  } = useI18nContext();
10670
10564
  const formatSize = (bytes) => {
10671
10565
  const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
10672
- if (!bytes || bytes === 0)
10673
- return "n/a";
10566
+ if (!bytes || bytes === 0) return "n/a";
10674
10567
  const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
10675
- if (i === 0)
10676
- return `${bytes} ${sizes[i]}`;
10568
+ if (i === 0) return `${bytes} ${sizes[i]}`;
10677
10569
  return `${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]}`;
10678
10570
  };
10679
10571
  return jsxs("div", {
@@ -10729,40 +10621,35 @@ const fileValidationRules = ({
10729
10621
  isOptional
10730
10622
  }) => [{
10731
10623
  validate: (files) => {
10732
- if (isOptional && (!files || files.length === 0))
10733
- return true;
10624
+ if (isOptional && (!files || files.length === 0)) return true;
10734
10625
  return Boolean(files && files.length > 0);
10735
10626
  },
10736
10627
  errorMessage: "fieldIsRequired",
10737
10628
  modes: ["blur", "input"]
10738
10629
  }, {
10739
10630
  validate: (files) => {
10740
- if (!files)
10741
- return true;
10631
+ if (!files) return true;
10742
10632
  return files.length <= maxNumberOfFiles;
10743
10633
  },
10744
10634
  errorMessage: "tooManyFiles",
10745
10635
  modes: ["blur", "input"]
10746
10636
  }, {
10747
10637
  validate: (files) => {
10748
- if (!files)
10749
- return true;
10638
+ if (!files) return true;
10750
10639
  return !hasDuplicates(files.map((file) => file.name));
10751
10640
  },
10752
10641
  errorMessage: "duplicatedFiles",
10753
10642
  modes: ["blur", "input"]
10754
10643
  }, {
10755
10644
  validate: (files) => {
10756
- if (!files)
10757
- return true;
10645
+ if (!files) return true;
10758
10646
  return filterOnlyNewlyUploadedFiles(files).every((file) => allowedFileTypes.some((filetype) => file.name.toLowerCase().endsWith(filetype.toLowerCase())));
10759
10647
  },
10760
10648
  errorMessage: "unsupportedFiletype",
10761
10649
  modes: ["blur", "input"]
10762
10650
  }, {
10763
10651
  validate: (files) => {
10764
- if (!files)
10765
- return true;
10652
+ if (!files) return true;
10766
10653
  return filterOnlyNewlyUploadedFiles(files).every((file) => !file.size || file.size < maxSize);
10767
10654
  },
10768
10655
  errorMessage: "maximumFileSizeExceeded",
@@ -11084,10 +10971,9 @@ function DocumentUploadComponent({
11084
10971
  }, [data, valid, errors, fieldProblems]);
11085
10972
  useEffect(() => {
11086
10973
  var _a2, _b;
11087
- if (documentField)
11088
- setDocument({
11089
- [documentField]: (_a2 = props == null ? void 0 : props.data) == null ? void 0 : _a2[documentField]
11090
- });
10974
+ if (documentField) setDocument({
10975
+ [documentField]: (_a2 = props == null ? void 0 : props.data) == null ? void 0 : _a2[documentField]
10976
+ });
11091
10977
  setData("description", (_b = props.data) == null ? void 0 : _b.description);
11092
10978
  triggerValidation();
11093
10979
  }, [props.data]);
@@ -11184,7 +11070,8 @@ function ListItem({
11184
11070
  const ADDRESS_SCHEMA = ["address", "otherAddressInformation", "postalCode", "city", "stateOrProvince", "country"];
11185
11071
  const [ADDRESS, OTHER_ADDRESS_INFORMATION, POSTAL_CODE, CITY, STATE, COUNTRY] = ADDRESS_SCHEMA;
11186
11072
  const COUNTRIES_WITH_STATES_DATASET = [CountryCodes.Australia, CountryCodes.Brazil, CountryCodes.Canada, CountryCodes.NewZealand, CountryCodes.UnitedStates];
11187
- const COUNTRIES_WITH_HOUSE_NUMBER_FIRST = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.UnitedStates, CountryCodes.UnitedKingdom];
11073
+ const COUNTRIES_WITH_HOUSE_NUMBER_FIRST = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.UnitedStates, CountryCodes.UnitedKingdom, CountryCodes.France];
11074
+ const COUNTRIES_WITH_COMMA_SEPARATED = [CountryCodes.Spain];
11188
11075
  const ADDRESS_SCHEMAS = {
11189
11076
  [CountryCodes.Australia]: [COUNTRY, ADDRESS, OTHER_ADDRESS_INFORMATION, CITY, STATE, POSTAL_CODE],
11190
11077
  [CountryCodes.Canada]: [COUNTRY, ADDRESS, OTHER_ADDRESS_INFORMATION, CITY, POSTAL_CODE, STATE],
@@ -11292,8 +11179,7 @@ function StateField({
11292
11179
  } = useDataset(datasetIdentifier.state(selectedCountry), !selectedCountry || !COUNTRIES_WITH_STATES_DATASET.includes(selectedCountry));
11293
11180
  const labelKey = getKeyForField("stateOrProvince", selectedCountry);
11294
11181
  const placeholderKey = getKeyForField("stateOrProvincePlaceholder", selectedCountry);
11295
- if (!loaded || !states.length)
11296
- return null;
11182
+ if (!loaded || !states.length) return null;
11297
11183
  return jsx(Field, {
11298
11184
  name: "stateOrProvince",
11299
11185
  label: (labels2 == null ? void 0 : labels2.stateOrProvince) || i18n.get(labelKey),
@@ -11407,14 +11293,12 @@ function useIsElementVisible(ref, fallback = true) {
11407
11293
  const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
11408
11294
  const observerRef = useRef();
11409
11295
  useEffect(() => {
11410
- if (!isIntersectionObserverSupported)
11411
- return;
11296
+ if (!isIntersectionObserverSupported) return;
11412
11297
  observerRef.current = new IntersectionObserver(([entry]) => setIsOnScreen(entry.isIntersecting));
11413
11298
  }, []);
11414
11299
  useEffect(() => {
11415
11300
  var _a;
11416
- if (!ref.current)
11417
- return;
11301
+ if (!ref.current) return;
11418
11302
  (_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
11419
11303
  return () => {
11420
11304
  var _a2;
@@ -11850,8 +11734,7 @@ const countrySpecificFormatters = {
11850
11734
  postalCode: {
11851
11735
  // Formatter - excludes non digits & hyphens and limits to a maxlength that varies depending on whether a hyphen is present or not
11852
11736
  formatter: (val) => {
11853
- if (!val)
11854
- return void 0;
11737
+ if (!val) return void 0;
11855
11738
  const nuVal = val.replace(getFormattingRegEx("^\\d-", "g"), "");
11856
11739
  const maxlength = nuVal.includes("-") ? 6 : 5;
11857
11740
  return nuVal.substring(0, maxlength);
@@ -11863,8 +11746,7 @@ const countrySpecificFormatters = {
11863
11746
  [CountryCodes.Portugal]: {
11864
11747
  postalCode: {
11865
11748
  formatter: (val) => {
11866
- if (!val)
11867
- return void 0;
11749
+ if (!val) return void 0;
11868
11750
  const nuVal = val.replace(getFormattingRegEx("^\\d-", "g"), "");
11869
11751
  return nuVal.substring(0, 8);
11870
11752
  },
@@ -12082,8 +11964,7 @@ function Address(props) {
12082
11964
  }
12083
11965
  }, [shouldValidate]);
12084
11966
  const getComponent = (fieldName) => {
12085
- if (!formUtils.isRequiredField(fieldName))
12086
- return null;
11967
+ if (!formUtils.isRequiredField(fieldName)) return null;
12087
11968
  const hideField = fieldName === "country" && hideCountry;
12088
11969
  return jsx(FieldContainer, {
12089
11970
  classNameModifiers: [fieldName],
@@ -12093,7 +11974,7 @@ function Address(props) {
12093
11974
  fieldProblems,
12094
11975
  fieldName,
12095
11976
  handleChangeFor,
12096
- maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country, true),
11977
+ maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country),
12097
11978
  hideField,
12098
11979
  "aria-label": formUtils.getLabel(fieldName, fieldName),
12099
11980
  trimOnBlur: true
@@ -12104,8 +11985,12 @@ function Address(props) {
12104
11985
  houseNumberOrName,
12105
11986
  street: street2
12106
11987
  }) => {
12107
- const addressOrder = COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country) ? [houseNumberOrName, street2] : [street2, houseNumberOrName];
12108
- const formattedAddress = addressOrder.filter(Boolean).join(" ");
11988
+ const isHouseNumberFirst = COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country);
11989
+ const needsComma = COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country);
11990
+ let formattedAddress = isHouseNumberFirst ? `${houseNumberOrName} ${street2}` : `${street2} ${houseNumberOrName}`;
11991
+ if (needsComma) {
11992
+ formattedAddress = formattedAddress.replace(" ", ", ");
11993
+ }
12109
11994
  handleChangeFor("address", "input")(formattedAddress);
12110
11995
  };
12111
11996
  const setFieldsData = (address2, field) => {
@@ -12841,8 +12726,7 @@ const uploadDocuments = async (documents2, entityId) => {
12841
12726
  return documentStore[entityId];
12842
12727
  };
12843
12728
  const updateEntityDocuments = (uploadedDocuments, entityId) => {
12844
- if (!documentStore[entityId])
12845
- documentStore[entityId] = [];
12729
+ if (!documentStore[entityId]) documentStore[entityId] = [];
12846
12730
  uploadedDocuments.forEach((uploadedDocument) => {
12847
12731
  if (uploadedDocument) {
12848
12732
  const existingDocumentIndex = documentStore[entityId].findIndex((document2) => document2.id === uploadedDocument.id);
@@ -13647,11 +13531,9 @@ const mapSolePropToLegalEntity = (data) => {
13647
13531
  const getPage = ({
13648
13532
  attachments
13649
13533
  }, pageType) => {
13650
- if (!attachments)
13651
- throw Error("Document has no attachments");
13534
+ if (!attachments) throw Error("Document has no attachments");
13652
13535
  const attachment = pageType ? attachments.find((attach) => attach.pageType === pageType) : attachments[0];
13653
- if (!attachment)
13654
- throw Error(`Attachment not found${pageType ? ` with type '${pageType}'` : ""}`);
13536
+ if (!attachment) throw Error(`Attachment not found${pageType ? ` with type '${pageType}'` : ""}`);
13655
13537
  return attachment;
13656
13538
  };
13657
13539
  const getPageName = (document2, pageType) => getPage(document2, pageType).pageName;
@@ -14047,8 +13929,7 @@ const useIdVerificationToken = ({
14047
13929
  const hasAllUserDetails = userDetails && Object.values(userDetails).every(Boolean);
14048
13930
  useEffect(() => {
14049
13931
  (async () => {
14050
- if (!hasAllUserDetails)
14051
- return;
13932
+ if (!hasAllUserDetails) return;
14052
13933
  try {
14053
13934
  setLoadingStatus("loading");
14054
13935
  const data = {
@@ -14209,8 +14090,7 @@ function IdVerificationComponent({
14209
14090
  const onfidoSdk = useRef();
14210
14091
  useEffect(() => {
14211
14092
  (async () => {
14212
- if (!sdkToken2)
14213
- return;
14093
+ if (!sdkToken2) return;
14214
14094
  onfidoSdk.current = await initOnfido({
14215
14095
  token: sdkToken2,
14216
14096
  i18n,
@@ -14220,13 +14100,11 @@ function IdVerificationComponent({
14220
14100
  });
14221
14101
  })().catch(logger$m.error);
14222
14102
  return () => {
14223
- if (onfidoSdk.current)
14224
- onfidoSdk.current.tearDown();
14103
+ if (onfidoSdk.current) onfidoSdk.current.tearDown();
14225
14104
  };
14226
14105
  }, [sdkToken2]);
14227
14106
  useEffect(() => {
14228
- if (!onfidoSdk.current)
14229
- return;
14107
+ if (!onfidoSdk.current) return;
14230
14108
  onfidoSdk.current.setOptions({
14231
14109
  language: getOnfidoLocaleConfig(i18n)
14232
14110
  });
@@ -14392,8 +14270,7 @@ const layoutBreakpointSizes = {
14392
14270
  const getBreakpointClassNames = (containerSize) => {
14393
14271
  const breakPoints = Object.entries(layoutBreakpointSizes);
14394
14272
  const classes = breakPoints.reduce((acc, [bp, size]) => {
14395
- if (size <= containerSize)
14396
- acc.push(layoutBreakpointClassnames[bp]);
14273
+ if (size <= containerSize) acc.push(layoutBreakpointClassnames[bp]);
14397
14274
  return acc;
14398
14275
  }, []);
14399
14276
  return classes.length > 0 ? classes : ["adyen-layout-xs-only"];
@@ -14418,8 +14295,7 @@ const AutoResizer = ({
14418
14295
  const containerRef = useRef(null);
14419
14296
  useEffect(() => {
14420
14297
  const container = containerRef.current;
14421
- if (!container)
14422
- return;
14298
+ if (!container) return;
14423
14299
  const resizeObserver = new ResizeObserver((entries) => assignLayoutClasses(entries, container));
14424
14300
  resizeObserver.observe(container);
14425
14301
  return () => resizeObserver.unobserve(container);
@@ -14664,8 +14540,7 @@ function useVerification(fieldsToVerify, country2) {
14664
14540
  const verificationPromises = [];
14665
14541
  fieldsToVerify.forEach((field) => {
14666
14542
  if (field === "idNumber" && formState.data[field]) {
14667
- if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4)
14668
- return;
14543
+ if (formState.data[field] === savedData[field] || country2 === "US" && formState.data[field].length === 4) return;
14669
14544
  const request = {
14670
14545
  name: {
14671
14546
  firstName: formState.data.firstName,
@@ -14701,10 +14576,8 @@ function InputTelephone(props) {
14701
14576
  const staticPhoneValidationRules = (phonePrefixes, defaultPrefix) => ({
14702
14577
  phoneNumber: {
14703
14578
  validate: (phoneNumber2) => {
14704
- if (!phoneNumber2)
14705
- return false;
14706
- if (!phonePrefixes.length)
14707
- return phoneNumber2.startsWith("+");
14579
+ if (!phoneNumber2) return false;
14580
+ if (!phonePrefixes.length) return phoneNumber2.startsWith("+");
14708
14581
  return phonePrefixes.map((prefix) => prefix.name).some((name) => phoneNumber2.startsWith(name));
14709
14582
  },
14710
14583
  errorMessage: {
@@ -14724,8 +14597,7 @@ const useAsyncPhoneValidationRules = () => {
14724
14597
  phoneNumber: {
14725
14598
  asyncValidate: async (phoneNumber2) => {
14726
14599
  var _a;
14727
- if (!phoneNumber2)
14728
- return false;
14600
+ if (!phoneNumber2) return false;
14729
14601
  return (_a = await validatePhoneNumber2(phoneNumber2)) == null ? void 0 : _a.valid;
14730
14602
  },
14731
14603
  errorMessage: "invalidPhoneNumber",
@@ -15454,8 +15326,7 @@ function IdentityNumberComponent(props) {
15454
15326
  ...data
15455
15327
  };
15456
15328
  adjustedData.idNumber = data.idNumberExempt ? void 0 : data.idNumber;
15457
- if (data.idNumberExempt && formErrors.idNumber !== null)
15458
- setFormErrors("idNumber", null);
15329
+ if (data.idNumberExempt && formErrors.idNumber !== null) setFormErrors("idNumber", null);
15459
15330
  (_b = (_a = stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
15460
15331
  type: "addToState",
15461
15332
  value: {
@@ -15575,8 +15446,7 @@ const getRoleName = (role2) => {
15575
15446
  };
15576
15447
  const makeSelectItemForRole = (role2, i18n) => {
15577
15448
  const metadata = roleMetadata[role2];
15578
- if (!metadata)
15579
- throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
15449
+ if (!metadata) throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
15580
15450
  const {
15581
15451
  name,
15582
15452
  description: description2,
@@ -15590,11 +15460,9 @@ const makeSelectItemForRole = (role2, i18n) => {
15590
15460
  };
15591
15461
  };
15592
15462
  const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event) => {
15593
- if (propagationMode === "stop")
15594
- event.stopPropagation();
15463
+ if (propagationMode === "stop") event.stopPropagation();
15595
15464
  if (keys.includes(event.key)) {
15596
- if (propagationMode === "stopIfMatches")
15597
- event.stopPropagation();
15465
+ if (propagationMode === "stopIfMatches") event.stopPropagation();
15598
15466
  callback();
15599
15467
  }
15600
15468
  };
@@ -15723,8 +15591,7 @@ function IndividualIdNumberTypeSelector({
15723
15591
  setSelected(options[0].id);
15724
15592
  }
15725
15593
  }, [options, selected, setSelected]);
15726
- if (options.length <= 1)
15727
- return null;
15594
+ if (options.length <= 1) return null;
15728
15595
  return jsx(Field, {
15729
15596
  name: "individualIdNumberType",
15730
15597
  label: i18n.get("whichTypeOfIdNumberDoYouHave"),
@@ -17167,14 +17034,12 @@ function FilePicker({
17167
17034
  const handleDrop = (e) => {
17168
17035
  e.preventDefault();
17169
17036
  e.stopPropagation();
17170
- if (e.dataTransfer)
17171
- addFiles(e.dataTransfer.files);
17037
+ if (e.dataTransfer) addFiles(e.dataTransfer.files);
17172
17038
  setDragged(false);
17173
17039
  };
17174
17040
  const handleFilesChosen = (e) => {
17175
17041
  const fileInput2 = e.target;
17176
- if (fileInput2.files)
17177
- addFiles(fileInput2.files);
17042
+ if (fileInput2.files) addFiles(fileInput2.files);
17178
17043
  };
17179
17044
  const addFiles = (newFiles) => {
17180
17045
  setFiles([...newFiles, ...files]);
@@ -17255,7 +17120,6 @@ var BankDocumentTypes = /* @__PURE__ */ ((BankDocumentTypes2) => {
17255
17120
  BankDocumentTypes2["SCREENSHOT_OF_BANK"] = "screenshotOfOnlineBankingEnviroment";
17256
17121
  BankDocumentTypes2["OFFICIAL_EMAIL"] = "officialEmailOrALetterFromYourBank";
17257
17122
  BankDocumentTypes2["CHECK"] = "check";
17258
- BankDocumentTypes2["RELEVE_DIDENTITE"] = "releveDidentiteBancaire";
17259
17123
  return BankDocumentTypes2;
17260
17124
  })(BankDocumentTypes || {});
17261
17125
  const bankDocumentOptions = [{
@@ -17273,9 +17137,6 @@ const bankDocumentOptions = [{
17273
17137
  }, {
17274
17138
  id: "check",
17275
17139
  name: "check"
17276
- }, {
17277
- id: "releveDidentiteBancaire",
17278
- name: "releveDidentiteBancaire"
17279
17140
  }];
17280
17141
  var BankDocumentRequirement = /* @__PURE__ */ ((BankDocumentRequirement2) => {
17281
17142
  BankDocumentRequirement2["ACCOUNT_NAME_INDIVIDUAL"] = "bankAccountNameIndividual";
@@ -17507,8 +17368,7 @@ function BankDocument(props) {
17507
17368
  var _a2;
17508
17369
  if (hasAlreadyUploadedDocuments) {
17509
17370
  setData("bankStatementDocument", alreadyUploadedDocuments);
17510
- if ((_a2 = props.data) == null ? void 0 : _a2.description)
17511
- setData("description", props.data.description);
17371
+ if ((_a2 = props.data) == null ? void 0 : _a2.description) setData("description", props.data.description);
17512
17372
  triggerValidation();
17513
17373
  }
17514
17374
  }, [alreadyUploadedDocuments, hasAlreadyUploadedDocuments, (_b = props.data) == null ? void 0 : _b.description, setData, triggerValidation]);
@@ -17527,19 +17387,13 @@ function BankDocument(props) {
17527
17387
  }
17528
17388
  });
17529
17389
  }, [data, valid, errors, fieldProblems]);
17530
- const getBankDocumentOptions = () => {
17531
- let options = bankDocumentOptions;
17532
- if (country2 !== "FR") {
17533
- options = options.filter((option) => option.id !== BankDocumentTypes.RELEVE_DIDENTITE);
17534
- }
17535
- return options.map(({
17536
- id: id2,
17537
- name
17538
- }) => ({
17539
- id: id2,
17540
- name: i18n.get(name)
17541
- }));
17542
- };
17390
+ const getBankDocumentOptions = () => bankDocumentOptions.map(({
17391
+ id: id2,
17392
+ name
17393
+ }) => ({
17394
+ id: id2,
17395
+ name: i18n.get(name)
17396
+ }));
17543
17397
  const documentsModifiers = useMemo(() => {
17544
17398
  var _a2, _b2;
17545
17399
  return {
@@ -17953,12 +17807,10 @@ const httpPost = async (options, data) => http({
17953
17807
  }, data);
17954
17808
  const removeElementSiblings = (element) => {
17955
17809
  const parent = element.parentNode;
17956
- if (!parent)
17957
- return;
17810
+ if (!parent) return;
17958
17811
  let child = parent.firstChild;
17959
17812
  while (child) {
17960
- if (child !== element)
17961
- parent.removeChild(child);
17813
+ if (child !== element) parent.removeChild(child);
17962
17814
  child = child.nextSibling;
17963
17815
  }
17964
17816
  };
@@ -17972,8 +17824,7 @@ const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(dat
17972
17824
  const parseMessageJson = (message) => {
17973
17825
  try {
17974
17826
  const messageData = JSON.parse(message);
17975
- if (!RELEVANT_MESSAGE_TYPES.includes(messageData.type))
17976
- return "invalid";
17827
+ if (!RELEVANT_MESSAGE_TYPES.includes(messageData.type)) return "invalid";
17977
17828
  return messageData;
17978
17829
  } catch {
17979
17830
  return "invalid";
@@ -18000,8 +17851,7 @@ class IFrameWidget {
18000
17851
  this.listener = async (message) => {
18001
17852
  try {
18002
17853
  const result = await this.handleMessage(message);
18003
- if (!result)
18004
- return;
17854
+ if (!result) return;
18005
17855
  resolve(result);
18006
17856
  } catch (err) {
18007
17857
  reject(err);
@@ -18020,8 +17870,7 @@ class IFrameWidget {
18020
17870
  this.sdkToken = sdkToken2;
18021
17871
  }
18022
17872
  removeMessageEventListener() {
18023
- if (!this.listener)
18024
- return;
17873
+ if (!this.listener) return;
18025
17874
  window.removeEventListener("message", this.listener);
18026
17875
  this.listener = void 0;
18027
17876
  }
@@ -18030,19 +17879,16 @@ class IFrameWidget {
18030
17879
  origin,
18031
17880
  source
18032
17881
  }) {
18033
- if (source !== this.iframeWindow || origin !== this.iframeUrl.origin)
18034
- return;
17882
+ if (source !== this.iframeWindow || origin !== this.iframeUrl.origin) return;
18035
17883
  if (this.vendor !== TINK_VENDOR && isTerminalMessageData(data)) {
18036
17884
  if (Object.getOwnPropertyNames(data).includes("error")) {
18037
17885
  throw data;
18038
17886
  }
18039
17887
  return data;
18040
17888
  }
18041
- if (!isString(data))
18042
- return;
17889
+ if (!isString(data)) return;
18043
17890
  const jsonData = parseMessageJson(data);
18044
- if (jsonData === "invalid")
18045
- return;
17891
+ if (jsonData === "invalid") return;
18046
17892
  const httpOptions = {
18047
17893
  errorHandler: callbackErrorHandler,
18048
17894
  loadingContext: "",
@@ -18064,8 +17910,7 @@ class IFrameWidget {
18064
17910
  ...httpOptions,
18065
17911
  path: redirectUrl.href
18066
17912
  });
18067
- if (isVerifiedAccountsData(responseData))
18068
- return responseData;
17913
+ if (isVerifiedAccountsData(responseData)) return responseData;
18069
17914
  throw responseData;
18070
17915
  } catch (reason) {
18071
17916
  throw new AdyenKycSdkError("WIDGET_ACCOUNT_COMMIT_FAILURE", reason);
@@ -18124,8 +17969,7 @@ class IFrameWidget {
18124
17969
  reject(new AdyenKycSdkError("WIDGET_TIMEOUT"));
18125
17970
  }, MOUNT_TIMEOUT);
18126
17971
  const cancelTimeout = () => {
18127
- if (timeoutId)
18128
- clearTimeout(timeoutId);
17972
+ if (timeoutId) clearTimeout(timeoutId);
18129
17973
  };
18130
17974
  this.iframeElement.addEventListener("load", () => {
18131
17975
  cancelTimeout();
@@ -18297,8 +18141,6 @@ const useInstantVerificationErrorNotification = (notificationVisibilityDuration)
18297
18141
  useEffect(() => {
18298
18142
  clearNotificationTimeout();
18299
18143
  if (errorNotification) {
18300
- if (notificationVisibilityDuration <= 0)
18301
- return;
18302
18144
  dismissNotificationTimeoutRef.current = setTimeout(() => {
18303
18145
  setErrorNotification(null);
18304
18146
  clearNotificationTimeout();
@@ -18364,8 +18206,7 @@ function InstantBankVerification({
18364
18206
  content: errorContent
18365
18207
  });
18366
18208
  }
18367
- if (onBack)
18368
- onBack();
18209
+ if (onBack) onBack();
18369
18210
  break;
18370
18211
  }
18371
18212
  case "retry_verification":
@@ -18373,8 +18214,7 @@ function InstantBankVerification({
18373
18214
  title: i18n.get("failedInitializeInstantVerification"),
18374
18215
  content: errorContent
18375
18216
  });
18376
- if (onBack)
18377
- onBack();
18217
+ if (onBack) onBack();
18378
18218
  break;
18379
18219
  default: {
18380
18220
  const {
@@ -19161,8 +19001,7 @@ const customPrefixByCountry = {
19161
19001
  [CountryCodes.IsleOfMan]: "GB"
19162
19002
  };
19163
19003
  function ibanValidator(input, bankCountry2) {
19164
- if (isEmpty(input))
19165
- return false;
19004
+ if (isEmpty(input)) return false;
19166
19005
  const ibanInput = input.replace(/ /g, "").toUpperCase();
19167
19006
  if (!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(ibanInput)) {
19168
19007
  return false;
@@ -19558,7 +19397,7 @@ const regions = {
19558
19397
  const getAllowedBankCountries = (country2) => Object.values(regions).find((countriesInARegion) => countriesInARegion.includes(country2)) ?? [country2];
19559
19398
  const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvider) => ({
19560
19399
  instantVerification: {
19561
- name: "verifyViaMobileBankAppOrBankWebsite",
19400
+ name: "verifyViaMobileBankingAppOrWebsite",
19562
19401
  subtitle: "instant",
19563
19402
  description: "instantVerificationDescription",
19564
19403
  iconComponentDesktop: `${svgPath}/instant-verification-desktop.svg`,
@@ -19569,8 +19408,8 @@ const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvi
19569
19408
  } : void 0
19570
19409
  },
19571
19410
  manualVerification: {
19572
- name: "provideAccountDetailsAndUploadBankStatement",
19573
- subtitle: "mayTakeAFewHoursOrDays",
19411
+ name: "uploadABankStatement",
19412
+ subtitle: "mayTakeAFewDays",
19574
19413
  description: "manualVerificationDescription",
19575
19414
  iconComponentDesktop: `${svgPath}/manual-verification-desktop.svg`,
19576
19415
  iconComponentMobile: `${svgPath}/manual-verification-mobile.svg`
@@ -19721,11 +19560,9 @@ const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName
19721
19560
  }
19722
19561
  };
19723
19562
  const getInstantVerificationProvider = (bankVerificationProviders, bankCountry2) => {
19724
- if (!bankVerificationProviders)
19725
- return "loading";
19563
+ if (!bankVerificationProviders) return "loading";
19726
19564
  const providerForCountry = bankVerificationProviders[bankCountry2];
19727
- if (!providerForCountry)
19728
- return void 0;
19565
+ if (!providerForCountry) return void 0;
19729
19566
  return providerForCountry.toLowerCase();
19730
19567
  };
19731
19568
  function PayoutVerificationMethod(props) {
@@ -20434,11 +20271,15 @@ const PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES = {
20434
20271
  roleTypes: [DecisionMakerType.DIRECTOR],
20435
20272
  min: 1,
20436
20273
  max: Infinity
20274
+ }],
20275
+ GB: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
20276
+ roleTypes: [DecisionMakerType.DIRECTOR],
20277
+ min: 1,
20278
+ max: Infinity
20437
20279
  }]
20438
20280
  };
20439
20281
  const getDecisionMakerRequirements = (country2) => {
20440
- if (!country2)
20441
- return DEFAULT_DECISION_MAKER_REQUIREMENTS;
20282
+ if (!country2) return DEFAULT_DECISION_MAKER_REQUIREMENTS;
20442
20283
  return PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES[country2] ?? DEFAULT_DECISION_MAKER_REQUIREMENTS;
20443
20284
  };
20444
20285
  function getAvailableDecisionMakerRoleTypes(country2) {
@@ -20468,8 +20309,7 @@ const getDecisionMakerDescriptionMap = (country2) => ({
20468
20309
  ...PER_COUNTRY_DESCRIPTION_OVERRIDES[country2]
20469
20310
  });
20470
20311
  const getOwnDecisionMakers = (rootLegalEntity) => {
20471
- if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations))
20472
- return [];
20312
+ if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations)) return [];
20473
20313
  return rootLegalEntity.entityAssociations.filter((entityAssociation) => Object.values(DecisionMakerType).includes(entityAssociation.type) && entityAssociation.associatorId === rootLegalEntity.id);
20474
20314
  };
20475
20315
  const getDecisionMakers = (rootLegalEntity, companyLegalEntityId) => getDirectEntityAssociations(rootLegalEntity, companyLegalEntityId).filter((association2) => Object.values(DecisionMakerType).includes(association2.type));
@@ -20526,8 +20366,7 @@ const isPartOfTrustFromLegalEntity = (legalEntity) => {
20526
20366
  };
20527
20367
  const getOwnTrustMembersLegalEntityIds = (rootLegalEntity) => {
20528
20368
  const trustLegalEntityId = getOwnTrustLegalEntityId(rootLegalEntity);
20529
- if (!trustLegalEntityId)
20530
- return [];
20369
+ if (!trustLegalEntityId) return [];
20531
20370
  const trustMemberAssociations = getDirectEntityAssociations(rootLegalEntity, trustLegalEntityId);
20532
20371
  const trustMemberIds = trustMemberAssociations.map((association2) => association2.legalEntityId).filter((id2) => id2 !== void 0);
20533
20372
  return [...trustMemberIds, ...trustMemberIds.flatMap((trustMemberId) => getTrustMemberCompanyDecisionMakerIds(rootLegalEntity, trustMemberId))];
@@ -20701,8 +20540,7 @@ function TrustRegistrationDetailsComponent(props) {
20701
20540
  classNameModifiers: ["country"],
20702
20541
  handleChangeFor: () => (e) => {
20703
20542
  handleChangeFor("country", "input")(e);
20704
- if (onCountryChange)
20705
- onCountryChange(e);
20543
+ if (onCountryChange) onCountryChange(e);
20706
20544
  }
20707
20545
  }), formUtils.isRequiredField("legalName") && jsx(Field, {
20708
20546
  name: "legalName",
@@ -21661,8 +21499,7 @@ const getOpeningStep = (forms2, remediationActions) => {
21661
21499
  var _a2;
21662
21500
  return (form2 == null ? void 0 : form2.formId) === ((_a2 = allRemediationActions[0]) == null ? void 0 : _a2.forms[0]);
21663
21501
  });
21664
- if (form)
21665
- return form;
21502
+ if (form) return form;
21666
21503
  }
21667
21504
  return forms2[forms2.length - 1];
21668
21505
  }
@@ -21695,8 +21532,7 @@ const useFormComposer = ({
21695
21532
  }) => formId === activeForm2.formId) ?? activeForm2);
21696
21533
  }, [forms2]);
21697
21534
  useEffect(() => {
21698
- if (hasAlreadyNavigatedForm)
21699
- return;
21535
+ if (hasAlreadyNavigatedForm) return;
21700
21536
  const openingStep = getOpeningStep(forms2, problems == null ? void 0 : problems.remediationActions);
21701
21537
  if (activeForm !== openingStep) {
21702
21538
  setActiveForm(openingStep);
@@ -21875,14 +21711,12 @@ const useScenarioConfiguration = ({
21875
21711
  }, [getConfigurationData, setLoadingStatus]);
21876
21712
  useEffect(() => {
21877
21713
  setLoadingStatus("loading");
21878
- if (!getPayoutAccountFormatData)
21879
- return;
21714
+ if (!getPayoutAccountFormatData) return;
21880
21715
  const makePayoutFormatCallAndSave = async () => {
21881
21716
  try {
21882
21717
  const response = await getPayoutAccountFormatData();
21883
21718
  setAccountFormatResponse(response);
21884
- if (!response)
21885
- return;
21719
+ if (!response) return;
21886
21720
  const allowedBankAccountFormats = Object.keys(response);
21887
21721
  if (existingBankAccountFormat && !allowedBankAccountFormats.includes(existingBankAccountFormat)) {
21888
21722
  throw new AdyenKycSdkError(`Account format, ${existingBankAccountFormat}, of transferInstrument is not in allowed formats for ${country2}`);
@@ -21902,8 +21736,7 @@ const useScenarioConfiguration = ({
21902
21736
  bankVerificationVendors,
21903
21737
  requiredFields
21904
21738
  } = useMemo(() => {
21905
- if (!configurationResponse)
21906
- return {};
21739
+ if (!configurationResponse) return {};
21907
21740
  const {
21908
21741
  matchingScenario,
21909
21742
  bankVerificationProviders
@@ -22199,8 +22032,7 @@ function parsePayoutScenarios({
22199
22032
  country: country2,
22200
22033
  bankVerificationAvailable
22201
22034
  }) {
22202
- if (!requiredFields)
22203
- return;
22035
+ if (!requiredFields) return;
22204
22036
  const fieldConfigurations = {};
22205
22037
  fieldConfigurations.payoutVerificationMethod = {
22206
22038
  rule: "REQUIRED"
@@ -22492,8 +22324,7 @@ const getFieldsWithExistingData = (legalEntity, isExperimentEnabled) => {
22492
22324
  var _a;
22493
22325
  const apiFieldsWithExistingData = getNestedPropertyKeys(legalEntity);
22494
22326
  const legalEntityType = legalEntity.type;
22495
- if (!legalEntityType)
22496
- return [];
22327
+ if (!legalEntityType) return [];
22497
22328
  const nonDocumentFields = apiFieldsWithExistingData.map((field) => convertApiFieldNameToSchemaFieldName(field, legalEntityType, isExperimentEnabled)).filter((field) => field !== void 0).filter((field) => !knownProblematicFields.includes(field));
22498
22329
  if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length) {
22499
22330
  const documentFields = legalEntity.documentDetails.map((document2) => legalEntityDocumentToFieldMapping[legalEntityType][document2.type]).filter((field) => field !== void 0);
@@ -22769,8 +22600,7 @@ function FormNavigation({
22769
22600
  } = useI18nContext();
22770
22601
  const getFormIndex = (form) => forms2.findIndex((f) => f.formId === form.formId);
22771
22602
  const goToForm = (form) => () => {
22772
- if (form.formId === activeForm.formId)
22773
- return;
22603
+ if (form.formId === activeForm.formId) return;
22774
22604
  gotoForm(getFormIndex(form));
22775
22605
  trackNavigation2({
22776
22606
  fromForm: form,
@@ -23065,8 +22895,7 @@ function CompanyDropinComponent({
23065
22895
  legalEntity,
23066
22896
  dataSubmitted
23067
22897
  }) => {
23068
- if (!isDocumentsRequired$2(forms22))
23069
- return;
22898
+ if (!isDocumentsRequired$2(forms22)) return;
23070
22899
  const formattedDocument = await mapCompanyDocumentToApiDocument(dataSubmitted, legalEntity.id);
23071
22900
  if (formattedDocument) {
23072
22901
  await documentUtils.uploadDocuments(formattedDocument, legalEntity.id);
@@ -23346,8 +23175,7 @@ function useCompanySearch({
23346
23175
  deepSearch
23347
23176
  }) => {
23348
23177
  try {
23349
- if (!deepSearch)
23350
- return;
23178
+ if (!deepSearch) return;
23351
23179
  setStatus("loading");
23352
23180
  setCompaniesList([]);
23353
23181
  const {
@@ -23371,8 +23199,7 @@ function useCompanySearch({
23371
23199
  return setStatus("idle");
23372
23200
  }
23373
23201
  try {
23374
- if (!handleCompanyDeepSearch)
23375
- return;
23202
+ if (!handleCompanyDeepSearch) return;
23376
23203
  setStatus("loading");
23377
23204
  setSelectedCompanyId(void 0);
23378
23205
  const {
@@ -23393,8 +23220,7 @@ function useCompanySearch({
23393
23220
  }, [handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
23394
23221
  const verify2 = useCallback(async (companyTIN, company2) => {
23395
23222
  try {
23396
- if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
23397
- return;
23223
+ if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset) return;
23398
23224
  setStatus("loading");
23399
23225
  setSelectedCompanyId(company2.id);
23400
23226
  if (!canVerify || !companyTIN) {
@@ -23560,10 +23386,8 @@ const CompanyLookupResultsHeader = ({
23560
23386
  if (status === "loading") {
23561
23387
  return selectedCompanyId ? i18n.get("companyLookupResultsHeader__verifying") : i18n.get("companyLookupResultsHeader__searching");
23562
23388
  }
23563
- if (numberOfResults === 0 && status === "loaded")
23564
- return i18n.get("companyLookupResultsHeader__noResults");
23565
- if (numberOfResults)
23566
- return i18n.get("companyLookupResultsHeader__results");
23389
+ if (numberOfResults === 0 && status === "loaded") return i18n.get("companyLookupResultsHeader__noResults");
23390
+ if (numberOfResults) return i18n.get("companyLookupResultsHeader__results");
23567
23391
  return i18n.get("companyLookupResultsHeader");
23568
23392
  }, [hasInternalError, status, numberOfResults, i18n, selectedCompanyId]);
23569
23393
  const descriptionText = useMemo(() => {
@@ -23964,8 +23788,7 @@ function TaxInformationField({
23964
23788
  type: countryToTaxInfoTypeMap[country2]
23965
23789
  }];
23966
23790
  const updatedTaxInformation = taxInformation.map((taxInfo) => {
23967
- if (taxInfo.country !== country2)
23968
- return taxInfo;
23791
+ if (taxInfo.country !== country2) return taxInfo;
23969
23792
  return {
23970
23793
  country: country2,
23971
23794
  number: value,
@@ -23992,8 +23815,7 @@ function TaxInformationField({
23992
23815
  type: countryToTaxInfoTypeMap[country2]
23993
23816
  }];
23994
23817
  const updatedTaxInformation = taxInformation.map((taxInfo) => {
23995
- if (taxInfo.country !== country2)
23996
- return taxInfo;
23818
+ if (taxInfo.country !== country2) return taxInfo;
23997
23819
  return {
23998
23820
  country: country2,
23999
23821
  number: value,
@@ -24074,8 +23896,7 @@ const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig,
24074
23896
  errorMessage: (taxInformation) => {
24075
23897
  var _a;
24076
23898
  const taxIdNumber2 = (_a = taxInformation == null ? void 0 : taxInformation.find((taxId2) => country2 === taxId2.country)) == null ? void 0 : _a.number;
24077
- if (!taxIdNumber2)
24078
- return void 0;
23899
+ if (!taxIdNumber2) return void 0;
24079
23900
  return typeof validator.errorMessage === "function" ? validator.errorMessage(taxIdNumber2) : validator.errorMessage;
24080
23901
  }
24081
23902
  }));
@@ -25009,8 +24830,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
25009
24830
  }, defaultFieldMetadata).label;
25010
24831
  return entriesOf(data).reduce((summaryData, [form, formData]) => {
25011
24832
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
25012
- if (!form)
25013
- return summaryData;
24833
+ if (!form) return summaryData;
25014
24834
  switch (form) {
25015
24835
  case "companyBasics":
25016
24836
  return {
@@ -25044,8 +24864,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
25044
24864
  [form]: formatOtherDetails(formData, i18n, (_f = data.companyBasics) == null ? void 0 : _f.country, labels2)
25045
24865
  };
25046
24866
  case "companyRegistrationDocument":
25047
- if (!isDocumentsRequired$1(forms2))
25048
- return summaryData;
24867
+ if (!isDocumentsRequired$1(forms2)) return summaryData;
25049
24868
  return {
25050
24869
  ...summaryData,
25051
24870
  [form]: {
@@ -25055,8 +24874,7 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
25055
24874
  }
25056
24875
  };
25057
24876
  case "companyTaxDocument":
25058
- if (!isDocumentsRequired$1(forms2))
25059
- return summaryData;
24877
+ if (!isDocumentsRequired$1(forms2)) return summaryData;
25060
24878
  return {
25061
24879
  ...summaryData,
25062
24880
  [form]: {
@@ -25299,8 +25117,7 @@ function useCompanySearchTaskSubmit({
25299
25117
  legalEntity,
25300
25118
  currentForms
25301
25119
  }) => {
25302
- if (!isDocumentsRequired$1(currentForms))
25303
- return;
25120
+ if (!isDocumentsRequired$1(currentForms)) return;
25304
25121
  const formattedDocument = await mapCompanySearchDocumentToApiDocument(data, legalEntity.id);
25305
25122
  try {
25306
25123
  if (formattedDocument) {
@@ -25602,8 +25419,7 @@ function CompanySearchDropinComponent({
25602
25419
  var _a2;
25603
25420
  eventEmitter.on("updateLocale", (locale) => setLocale(locale));
25604
25421
  const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
25605
- if (!documentIds.length)
25606
- return;
25422
+ if (!documentIds.length) return;
25607
25423
  documentUtils.fetchDocuments(documentIds, legalEntityResponse.id).then(() => {
25608
25424
  setInitialData({
25609
25425
  ...initialData,
@@ -25762,8 +25578,7 @@ const useLocalStorage = (key, defaultValue, options) => {
25762
25578
  }), [options]);
25763
25579
  const rawValueRef = useRef(null);
25764
25580
  const [value, setValue] = useState(() => {
25765
- if (typeof window === "undefined")
25766
- return defaultValue;
25581
+ if (typeof window === "undefined") return defaultValue;
25767
25582
  try {
25768
25583
  rawValueRef.current = window.localStorage.getItem(key);
25769
25584
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
@@ -25774,8 +25589,7 @@ const useLocalStorage = (key, defaultValue, options) => {
25774
25589
  }
25775
25590
  });
25776
25591
  useEffect(() => {
25777
- if (typeof window === "undefined")
25778
- return;
25592
+ if (typeof window === "undefined") return;
25779
25593
  const updateLocalStorage = () => {
25780
25594
  if (value !== void 0) {
25781
25595
  const newValue = serializer(value);
@@ -25805,11 +25619,9 @@ const useLocalStorage = (key, defaultValue, options) => {
25805
25619
  }
25806
25620
  }, [value]);
25807
25621
  useEffect(() => {
25808
- if (!syncData)
25809
- return;
25622
+ if (!syncData) return;
25810
25623
  const handleStorageChange = (event) => {
25811
- if (event.key !== key || event.storageArea !== window.localStorage)
25812
- return;
25624
+ if (event.key !== key || event.storageArea !== window.localStorage) return;
25813
25625
  try {
25814
25626
  if (event.newValue !== rawValueRef.current) {
25815
25627
  rawValueRef.current = event.newValue;
@@ -25819,8 +25631,7 @@ const useLocalStorage = (key, defaultValue, options) => {
25819
25631
  logger$c.error(err);
25820
25632
  }
25821
25633
  };
25822
- if (typeof window === "undefined")
25823
- return;
25634
+ if (typeof window === "undefined") return;
25824
25635
  window.addEventListener("storage", handleStorageChange);
25825
25636
  return () => window.removeEventListener("storage", handleStorageChange);
25826
25637
  }, [key, syncData]);
@@ -25854,11 +25665,9 @@ const useIsEligibleForSingpass = ({
25854
25665
  const {
25855
25666
  isExperimentEnabled
25856
25667
  } = useExperimentsContext();
25857
- if (!isExperimentEnabled("ShowSingPassButtonForCompanies"))
25858
- return false;
25668
+ if (!isExperimentEnabled("ShowSingPassButtonForCompanies")) return false;
25859
25669
  const isSingpassEnabled = Boolean(handleOpenSingpassAuthorizationLink) && getLegalEntityCountry(legalEntity) === CountryCodes.Singapore;
25860
- if (!isSingpassEnabled)
25861
- return false;
25670
+ if (!isSingpassEnabled) return false;
25862
25671
  if (accountHolder2) {
25863
25672
  return accountHolder2 === "theCompanyIWorkFor";
25864
25673
  }
@@ -25901,8 +25710,7 @@ const useExemptSettlor = ({
25901
25710
  setExemptSettlor(exemptSettlorLE);
25902
25711
  }, [handleGetLegalEntity]);
25903
25712
  useEffect(() => {
25904
- if (!(trust2 == null ? void 0 : trust2.trust))
25905
- return;
25713
+ if (!(trust2 == null ? void 0 : trust2.trust)) return;
25906
25714
  updateExemptSettlor(trust2).catch(logger$a.error);
25907
25715
  }, [trust2, updateExemptSettlor]);
25908
25716
  return exemptSettlor;
@@ -25963,8 +25771,7 @@ const saveBlobAsFile = (fileData, filename) => {
25963
25771
  const isNewEntity = Symbol("isNewEntity");
25964
25772
  const splitAtFirstOccurrence = (str, separator) => {
25965
25773
  const firstOccurrence = str.indexOf(separator);
25966
- if (firstOccurrence === -1)
25967
- return [str];
25774
+ if (firstOccurrence === -1) return [str];
25968
25775
  return [str.slice(0, firstOccurrence), str.slice(firstOccurrence + 1)];
25969
25776
  };
25970
25777
  const getTrustMemberOwnerId = (trustMemberId, entityAssociations) => {
@@ -25991,23 +25798,21 @@ const convertEntityAssociationIntoTrustMember = (association2, associations, exe
25991
25798
  name: association2.name
25992
25799
  };
25993
25800
  }
25994
- if (association2.entityType === LegalEntityType.ORGANIZATION)
25995
- return {
25996
- trustMemberType: "company",
25997
- roles: [],
25998
- legalEntityType: LegalEntityType.ORGANIZATION,
25999
- legalEntityId: association2.legalEntityId,
26000
- name: association2.name,
26001
- ownerId: getTrustMemberOwnerId(association2.legalEntityId, associations)
26002
- };
26003
- if (association2.entityType === LegalEntityType.INDIVIDUAL)
26004
- return {
26005
- trustMemberType: "regular",
26006
- roles: [],
26007
- legalEntityType: LegalEntityType.INDIVIDUAL,
26008
- legalEntityId: association2.legalEntityId,
26009
- name: association2.name
26010
- };
25801
+ if (association2.entityType === LegalEntityType.ORGANIZATION) return {
25802
+ trustMemberType: "company",
25803
+ roles: [],
25804
+ legalEntityType: LegalEntityType.ORGANIZATION,
25805
+ legalEntityId: association2.legalEntityId,
25806
+ name: association2.name,
25807
+ ownerId: getTrustMemberOwnerId(association2.legalEntityId, associations)
25808
+ };
25809
+ if (association2.entityType === LegalEntityType.INDIVIDUAL) return {
25810
+ trustMemberType: "regular",
25811
+ roles: [],
25812
+ legalEntityType: LegalEntityType.INDIVIDUAL,
25813
+ legalEntityId: association2.legalEntityId,
25814
+ name: association2.name
25815
+ };
26011
25816
  throw new Error(`Not a valid trust member: ${JSON.stringify(association2)}`);
26012
25817
  };
26013
25818
  const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations, exemptSettlorLE) => {
@@ -26067,14 +25872,13 @@ const mapTrustMemberToEntityAssociations = (trustMember) => {
26067
25872
  if (trustMember.legalEntityId === isNewEntity) {
26068
25873
  throw Error("Cannot map a new trust member, you must create it first");
26069
25874
  }
26070
- if (trustMember.trustMemberType === "exemptSettlor")
26071
- return [{
26072
- legalEntityId: trustMember.legalEntityId,
26073
- entityType: trustMember.legalEntityType,
26074
- type: TrustMemberTypes.SETTLOR,
26075
- settlorExemptionReason: trustMember.settlorExemptionReason,
26076
- name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
26077
- }];
25875
+ if (trustMember.trustMemberType === "exemptSettlor") return [{
25876
+ legalEntityId: trustMember.legalEntityId,
25877
+ entityType: trustMember.legalEntityType,
25878
+ type: TrustMemberTypes.SETTLOR,
25879
+ settlorExemptionReason: trustMember.settlorExemptionReason,
25880
+ name: trustMember.legalEntityType === LegalEntityType.INDIVIDUAL ? `${(_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName} ${(_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName}` : trustMember.name ?? ""
25881
+ }];
26078
25882
  return trustMember.roles.map((role2) => ({
26079
25883
  legalEntityId: trustMember.legalEntityId,
26080
25884
  type: role2
@@ -26455,8 +26259,7 @@ const BusinessTypeSelection = ({
26455
26259
  }, []);
26456
26260
  const handleNextClick = async () => {
26457
26261
  var _a2;
26458
- if (loadingStatus === "loading")
26459
- return;
26262
+ if (loadingStatus === "loading") return;
26460
26263
  triggerValidation();
26461
26264
  if (isValid) {
26462
26265
  if (((_a2 = data.businessType) == null ? void 0 : _a2.id) === "legalArrangement") {
@@ -27449,12 +27252,9 @@ const useLegalEntityType = ({
27449
27252
  switch (legalEntity.type) {
27450
27253
  case LegalEntityType.INDIVIDUAL:
27451
27254
  case LegalEntityType.ORGANIZATION:
27452
- if (!hasLegalAssociation)
27453
- return legalEntity.type;
27454
- if (isSoleProprietor)
27455
- return LegalEntityType.SOLE_PROPRIETORSHIP;
27456
- if (isTrust)
27457
- return LegalEntityType.TRUST;
27255
+ if (!hasLegalAssociation) return legalEntity.type;
27256
+ if (isSoleProprietor) return LegalEntityType.SOLE_PROPRIETORSHIP;
27257
+ if (isTrust) return LegalEntityType.TRUST;
27458
27258
  break;
27459
27259
  default:
27460
27260
  return void 0;
@@ -27499,12 +27299,9 @@ const useIntroductionScreens = ({
27499
27299
  const isSoleProprietor = legalEntityType === LegalEntityType.SOLE_PROPRIETORSHIP;
27500
27300
  const isTrustScreen = screen === IntroductionScreens.TRUST || screen === IntroductionScreens.TRUST_MEMBER_OVERVIEW;
27501
27301
  const isTrust = legalEntityType === LegalEntityType.TRUST;
27502
- if (isAccountScreen)
27503
- return hasAccountTask;
27504
- if (isSoleProprietorScreen)
27505
- return isSoleProprietor;
27506
- if (isTrustScreen)
27507
- return isTrust;
27302
+ if (isAccountScreen) return hasAccountTask;
27303
+ if (isSoleProprietorScreen) return isSoleProprietor;
27304
+ if (isTrustScreen) return isTrust;
27508
27305
  return tasks.some((task) => screen === task);
27509
27306
  }) : [], [legalEntityType, tasks]);
27510
27307
  return canSeeIntroduction && (introductionScreens == null ? void 0 : introductionScreens.length) > 0 ? [IntroductionScreens.PROLOGUE, ...introductionScreens, IntroductionScreens.EPILOGUE] : void 0;
@@ -28954,8 +28751,7 @@ function IndividualDropinComponent({
28954
28751
  dataSubmitted
28955
28752
  }) => {
28956
28753
  var _a2;
28957
- if (!isDocumentsRequired2(forms22))
28958
- return;
28754
+ if (!isDocumentsRequired2(forms22)) return;
28959
28755
  if ((_a2 = dataSubmitted.idDocument) == null ? void 0 : _a2.instantIdVerificationData) {
28960
28756
  await handleInstantIdVerificationStartCheck(dataSubmitted.idDocument.instantIdVerificationData, legalEntity.id);
28961
28757
  } else {
@@ -29091,20 +28887,17 @@ function IndividualDropinComponent({
29091
28887
  const datasetUtils = datasetUtilities(i18n.locale);
29092
28888
  const formatIdDocument = (idDocument2) => {
29093
28889
  var _a2, _b2;
29094
- if (!idDocument2)
29095
- return void 0;
28890
+ if (!idDocument2) return void 0;
29096
28891
  const documentType2 = (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) ? onfidoDocumentTypeMapping.find((document2) => {
29097
28892
  var _a3;
29098
28893
  return ((_a3 = idDocument2.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document2.id;
29099
28894
  }) : idDocumentTypeOptions.find(({
29100
28895
  id: id2
29101
28896
  }) => idDocument2.idDocumentType === id2);
29102
- if (!documentType2)
29103
- return void 0;
28897
+ if (!documentType2) return void 0;
29104
28898
  const frontPage2 = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
29105
28899
  const backPage2 = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
29106
- if (!frontPage2)
29107
- return void 0;
28900
+ if (!frontPage2) return void 0;
29108
28901
  return {
29109
28902
  documentType: i18n.get(documentType2.name),
29110
28903
  ...backPage2 && documentType2.hasBackPage ? {
@@ -29288,8 +29081,7 @@ const rules$1 = ({
29288
29081
  }) => ({
29289
29082
  whenUsingManualVerification: () => {
29290
29083
  var _a;
29291
- if (!data.payoutVerificationMethod)
29292
- return;
29084
+ if (!data.payoutVerificationMethod) return;
29293
29085
  if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
29294
29086
  return "REQUIRED";
29295
29087
  }
@@ -29849,8 +29641,7 @@ function PciDropinComponent({
29849
29641
  name: `${(_a = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _a.name.firstName} ${(_b = legalEntityResponse.individual) == null ? void 0 : _b.name.lastName}`
29850
29642
  }];
29851
29643
  const handleSignClick = async () => {
29852
- if (loadingStatus === "loading")
29853
- return;
29644
+ if (loadingStatus === "loading") return;
29854
29645
  userEvents.addEvent("Clicked PCI signing", {
29855
29646
  segmentation: {
29856
29647
  ...baseTrackingPayload
@@ -29982,8 +29773,7 @@ function PciDropinComponent({
29982
29773
  });
29983
29774
  }
29984
29775
  const convertExistingSettlorExemptionReasons = (existingReasons) => {
29985
- if (!existingReasons || !existingReasons.length)
29986
- return ["noneOfTheAbove"];
29776
+ if (!existingReasons || !existingReasons.length) return ["noneOfTheAbove"];
29987
29777
  return existingReasons;
29988
29778
  };
29989
29779
  const convertExistingTrustMember = (trustMember) => {
@@ -30098,8 +29888,7 @@ const getAvailableRolesByTrustMemberTypeAndLegalEntityType = (currentRoles, trus
30098
29888
  return roles.filter((r) => r !== "secondaryTrustee");
30099
29889
  };
30100
29890
  const getAvailableRoles = (currentRoles) => {
30101
- if (!(currentRoles == null ? void 0 : currentRoles.length))
30102
- return Object.values(TrustMemberTypes);
29891
+ if (!(currentRoles == null ? void 0 : currentRoles.length)) return Object.values(TrustMemberTypes);
30103
29892
  return currentRoles.map((role2) => [role2, ...allowedCrossoverRolesMatrix[role2]]).reduce((existingAllowed, allowedForRole) => existingAllowed.filter((role2) => allowedForRole.includes(role2)));
30104
29893
  };
30105
29894
  const trustMemberLegalEntityTypes = [LegalEntityType.INDIVIDUAL, LegalEntityType.ORGANIZATION];
@@ -30436,8 +30225,7 @@ const exemptSettlorForms = {
30436
30225
  summary
30437
30226
  };
30438
30227
  const decideForms = (trustMember) => {
30439
- if (trustMember === "incomplete")
30440
- return regularForms;
30228
+ if (trustMember === "incomplete") return regularForms;
30441
30229
  switch (trustMember.trustMemberType) {
30442
30230
  case "undefinedBeneficiary":
30443
30231
  return undefinedBeneficiaryForms;
@@ -30487,13 +30275,12 @@ const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettl
30487
30275
  legalEntityId: existingId ?? isNewEntity
30488
30276
  };
30489
30277
  }
30490
- if (data.role.includes("undefinedBeneficiary"))
30491
- return {
30492
- trustMemberType: "undefinedBeneficiary",
30493
- roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
30494
- description: data.descriptionUndefinedBeneficiary ?? "",
30495
- reference: existingId ?? isNewEntity
30496
- };
30278
+ if (data.role.includes("undefinedBeneficiary")) return {
30279
+ trustMemberType: "undefinedBeneficiary",
30280
+ roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
30281
+ description: data.descriptionUndefinedBeneficiary ?? "",
30282
+ reference: existingId ?? isNewEntity
30283
+ };
30497
30284
  if (data.entityType === LegalEntityType.ORGANIZATION) {
30498
30285
  return {
30499
30286
  trustMemberType: "company",
@@ -30504,14 +30291,13 @@ const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettl
30504
30291
  country: data.country
30505
30292
  };
30506
30293
  }
30507
- if (data.entityType === LegalEntityType.INDIVIDUAL)
30508
- return {
30509
- trustMemberType: "regular",
30510
- roles: data.role,
30511
- legalEntityType: LegalEntityType.INDIVIDUAL,
30512
- legalEntityId: existingId ?? isNewEntity,
30513
- name: ""
30514
- };
30294
+ if (data.entityType === LegalEntityType.INDIVIDUAL) return {
30295
+ trustMemberType: "regular",
30296
+ roles: data.role,
30297
+ legalEntityType: LegalEntityType.INDIVIDUAL,
30298
+ legalEntityId: existingId ?? isNewEntity,
30299
+ name: ""
30300
+ };
30515
30301
  }
30516
30302
  return "incomplete";
30517
30303
  };
@@ -30571,8 +30357,7 @@ function RoleAndTypeDropinComponent({
30571
30357
  setTrustMember(convertDataToTrustMember(data, existingTrustMember, isOrganizationSettlorWithExemptionEnabled));
30572
30358
  };
30573
30359
  const saveRolesAndNavigate = async () => {
30574
- if (trustMember === "incomplete")
30575
- return;
30360
+ if (trustMember === "incomplete") return;
30576
30361
  if (hasRolesChanged(trustMember.roles, existingTrustMember == null ? void 0 : existingTrustMember.roles)) {
30577
30362
  addOrUpdateTrustMember(trustMember);
30578
30363
  }
@@ -30595,8 +30380,7 @@ function RoleAndTypeDropinComponent({
30595
30380
  navigateToFullDropinFor(trustMember);
30596
30381
  return;
30597
30382
  }
30598
- if (targetForm.formId === summaryStep.formId)
30599
- return;
30383
+ if (targetForm.formId === summaryStep.formId) return;
30600
30384
  }
30601
30385
  setActiveForm(targetForm);
30602
30386
  };
@@ -30670,8 +30454,7 @@ const useServiceAgreement = ({
30670
30454
  }, [language]);
30671
30455
  useEffect(() => {
30672
30456
  const requestAcceptedServiceAgreement = async () => {
30673
- if (!handleViewAcceptedTermsOfServiceDocument || !acceptanceId)
30674
- return;
30457
+ if (!handleViewAcceptedTermsOfServiceDocument || !acceptanceId) return;
30675
30458
  setLoading("loading");
30676
30459
  const {
30677
30460
  id: id2,
@@ -30687,8 +30470,7 @@ const useServiceAgreement = ({
30687
30470
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
30688
30471
  useEffect(() => {
30689
30472
  const requestServiceAgreement = async () => {
30690
- if (acceptanceId)
30691
- return;
30473
+ if (acceptanceId) return;
30692
30474
  setLoading("loading");
30693
30475
  try {
30694
30476
  const {
@@ -30824,8 +30606,7 @@ function ServiceAgreementDropinComponent({
30824
30606
  }
30825
30607
  });
30826
30608
  triggerValidation();
30827
- if (loadingStatus === "loading" || !serviceAgreement || !data.signer)
30828
- return;
30609
+ if (loadingStatus === "loading" || !serviceAgreement || !data.signer) return;
30829
30610
  if (isValid) {
30830
30611
  try {
30831
30612
  setLoadingStatus("loading");
@@ -30882,8 +30663,7 @@ function ServiceAgreementDropinComponent({
30882
30663
  });
30883
30664
  };
30884
30665
  useEffect(() => {
30885
- if (!serviceAgreementAcceptanceInfos.length)
30886
- return;
30666
+ if (!serviceAgreementAcceptanceInfos.length) return;
30887
30667
  gotoForm(serviceAgreementAcceptanceInfos.length - 1);
30888
30668
  }, [serviceAgreementAcceptanceInfos]);
30889
30669
  useEffect(() => {
@@ -30902,8 +30682,7 @@ function ServiceAgreementDropinComponent({
30902
30682
  };
30903
30683
  const onDownloadAcceptedTermsOfServiceDocument = async () => {
30904
30684
  try {
30905
- if (!canDownload)
30906
- return;
30685
+ if (!canDownload) return;
30907
30686
  const response = await handleDownloadAcceptedTermsOfServiceDocument(legalEntityResponse.id, activeForm.acceptanceId);
30908
30687
  await downloadFile(response.document, `${i18n.get(activeForm.formName)}.pdf`);
30909
30688
  } catch (e) {
@@ -31671,8 +31450,7 @@ const useNavigation = ({
31671
31450
  }
31672
31451
  }, [onNavigate]);
31673
31452
  const navigateBack = useCallback((stepCount = 1) => {
31674
- if (taskHistory.length <= 1)
31675
- return;
31453
+ if (taskHistory.length <= 1) return;
31676
31454
  const prevTask = taskHistory[taskHistory.length - (stepCount + 1)];
31677
31455
  if (prevTask === "default") {
31678
31456
  throw Error("Cannot navigate back to 'default' task");
@@ -31713,12 +31491,9 @@ const getDefaultTask = ({
31713
31491
  shouldShowSingpassSelection
31714
31492
  }) => {
31715
31493
  const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
31716
- if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection)
31717
- return TaskTypes.BUSINESS_TYPE_SELECTION;
31718
- if (showIntroduction)
31719
- return TaskTypes.INTRODUCTION;
31720
- if (shouldShowSingpassSelection)
31721
- return TaskTypes.SINGPASS_SELECTION;
31494
+ if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
31495
+ if (showIntroduction) return TaskTypes.INTRODUCTION;
31496
+ if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
31722
31497
  return TaskTypes.TASKS_OVERVIEW;
31723
31498
  };
31724
31499
  const hasProgressedBeyondEntitySelection = (legalEntity) => {
@@ -31866,8 +31641,7 @@ function DropinComposerComponent({
31866
31641
  }
31867
31642
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
31868
31643
  useEffect(() => {
31869
- if (!tasks.includes(TaskTypes.PCI_DSS))
31870
- return;
31644
+ if (!tasks.includes(TaskTypes.PCI_DSS)) return;
31871
31645
  getPciTemplate().catch(logger$8.error);
31872
31646
  }, [getPciTemplate, tasks]);
31873
31647
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
@@ -33357,11 +33131,9 @@ function ViewVerificationStatusComponent({
33357
33131
  const [onboardingStatus, setOnboardingStatus] = useState();
33358
33132
  const [alertContent, setAlertContent] = useState();
33359
33133
  const content = useMemo(() => {
33360
- if (!onboardingStatus)
33361
- return;
33134
+ if (!onboardingStatus) return;
33362
33135
  const statusContent = getContentByStatus(onboardingStatus);
33363
- if (statusContent)
33364
- return statusContent;
33136
+ if (statusContent) return statusContent;
33365
33137
  logger$5.error(`there is no content for status "${onboardingStatus}"`);
33366
33138
  }, [onboardingStatus]);
33367
33139
  const handleError = ({
@@ -33615,8 +33387,7 @@ const buildSpriteDOMFromResponse = (responseData) => {
33615
33387
  return iconContainer;
33616
33388
  };
33617
33389
  const loadDocumentGuidance = async (loadingContext) => {
33618
- if (isDocumentGuidanceLoaded)
33619
- return;
33390
+ if (isDocumentGuidanceLoaded) return;
33620
33391
  isDocumentGuidanceLoaded = true;
33621
33392
  const responseData = await http({
33622
33393
  loadingContext,
@@ -33898,7 +33669,7 @@ const ConfigurationApiProvider = ({
33898
33669
  isEmbeddedDropin,
33899
33670
  loadingContext
33900
33671
  } = authContext;
33901
- const sdkVersion = "2.41.4";
33672
+ const sdkVersion = "2.42.0";
33902
33673
  useAnalytics({
33903
33674
  onUserEvent,
33904
33675
  legalEntityId: rootLegalEntityId,
@@ -34001,12 +33772,10 @@ const useTranslations = ({
34001
33772
  getDataset: getDataset2
34002
33773
  } = useConfigurationApi();
34003
33774
  useEffect(() => {
34004
- if (!allowedLocales)
34005
- return;
33775
+ if (!allowedLocales) return;
34006
33776
  const isLocaleAllowed = allowedLocales.includes(locale);
34007
33777
  const localeToUse = isLocaleAllowed ? locale : FALLBACK_LOCALE;
34008
- if (loaded.locale === localeToUse)
34009
- return;
33778
+ if (loaded.locale === localeToUse) return;
34010
33779
  if (!isLocaleAllowed) {
34011
33780
  logger.error(`
34012
33781
  "${locale}" isn't a supported locale. Please use one of the following:
@@ -34057,6 +33826,13 @@ const I18nProvider = ({
34057
33826
  children
34058
33827
  });
34059
33828
  };
33829
+ const QueryClient = new QueryClient$1();
33830
+ const QueryClientProvider = ({
33831
+ children
33832
+ }) => jsx(QueryClientProvider$1, {
33833
+ client: QueryClient,
33834
+ children
33835
+ });
34060
33836
  const settingsDefaults = {
34061
33837
  acceptedCountries: void 0,
34062
33838
  allowBankAccountFormatSelection: false,
@@ -34094,8 +33870,7 @@ function SettingsProvider({
34094
33870
  }
34095
33871
  function removeObjectPropsWithEmptyValues(obj) {
34096
33872
  keysOf(obj).forEach((key) => {
34097
- if (obj[key] === null || isEmpty(obj[key]))
34098
- delete obj[key];
33873
+ if (obj[key] === null || isEmpty(obj[key])) delete obj[key];
34099
33874
  });
34100
33875
  return obj;
34101
33876
  }
@@ -34375,10 +34150,8 @@ class BaseElement {
34375
34150
  }
34376
34151
  }
34377
34152
  const getRootLegalEntityId = (componentProps) => {
34378
- if ("legalEntityId" in componentProps)
34379
- return componentProps.legalEntityId;
34380
- if ("legalEntityResponse" in componentProps)
34381
- return componentProps.legalEntityResponse.id;
34153
+ if ("legalEntityId" in componentProps) return componentProps.legalEntityId;
34154
+ if ("legalEntityResponse" in componentProps) return componentProps.legalEntityResponse.id;
34382
34155
  throw new Error("You must provide either `legalEntityId` or `legalEntityResponse`");
34383
34156
  };
34384
34157
  class UIElement extends BaseElement {
@@ -34411,9 +34184,11 @@ class UIElement extends BaseElement {
34411
34184
  children: jsx(AutoResizer, {
34412
34185
  children: jsx(ToastContextProvider, {
34413
34186
  children: jsx(StateProvider, {
34414
- children: jsx(Component, {
34415
- ...this.props.componentProps,
34416
- eventEmitter: this.eventEmitter
34187
+ children: jsx(QueryClientProvider, {
34188
+ children: jsx(Component, {
34189
+ ...this.props.componentProps,
34190
+ eventEmitter: this.eventEmitter
34191
+ })
34417
34192
  })
34418
34193
  })
34419
34194
  })
@@ -35269,8 +35044,7 @@ class Core {
35269
35044
  };
35270
35045
  validateCoreOptions(newOptions);
35271
35046
  newOptions.loadingContext = normalizeEnvironment(newOptions.environment);
35272
- if (!newOptions.locale)
35273
- newOptions.locale = FALLBACK_LOCALE;
35047
+ if (!newOptions.locale) newOptions.locale = FALLBACK_LOCALE;
35274
35048
  return newOptions;
35275
35049
  };
35276
35050
  this.initializeSession = () => {