@adyen/kyc-components 2.21.0 → 2.23.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 (33) hide show
  1. package/dist/es/adyen-kyc-components.es.js +545 -253
  2. package/dist/style.css +11 -2
  3. package/dist/types/components/BusinessTypeSelection/utils.d.ts +2 -1
  4. package/dist/types/components/ConstitutionalDocument/ConstitutionalDocumentComponent.d.ts +4 -10
  5. package/dist/types/components/ConstitutionalDocument/types.d.ts +4 -0
  6. package/dist/types/components/PayoutBankStatement/component/BankDocumentRequirements.d.ts +3 -1
  7. package/dist/types/components/PayoutBankStatement/types.d.ts +2 -1
  8. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  9. package/dist/types/components/internal/ContractViewer/ReferenceContext/ReferenceContext.d.ts +10 -0
  10. package/dist/types/components/internal/ContractViewer/ReferenceContext/ReferenceContextProvider.d.ts +6 -0
  11. package/dist/types/components/internal/ContractViewer/ReferenceContext/useReferenceContext.d.ts +1 -0
  12. package/dist/types/components/internal/ContractViewer/components/InternalReference/InternalReference.d.ts +1 -1
  13. package/dist/types/components/internal/ContractViewer/components/Section/Section.d.ts +1 -1
  14. package/dist/types/components/internal/ContractViewer/components/Table/Table.d.ts +1 -1
  15. package/dist/types/components/internal/ContractViewer/utils/format-id.d.ts +1 -0
  16. package/dist/types/components/internal/Iban/ibanValidator.d.ts +2 -1
  17. package/dist/types/components/internal/Iban/types.d.ts +2 -1
  18. package/dist/types/core/Context/ExperimentContext/types.d.ts +0 -1
  19. package/dist/types/core/Services/componentApi/get-address.d.ts +3 -0
  20. package/dist/types/core/Services/componentApi/get-idverification-token.d.ts +3 -0
  21. package/dist/types/core/Services/componentApi/idVerification-startcheck.d.ts +3 -0
  22. package/dist/types/core/Services/componentApi/search-address.d.ts +3 -0
  23. package/dist/types/core/Services/componentApi/validate-phone-number.d.ts +3 -0
  24. package/dist/types/core/Services/componentApi/verify-id-number.d.ts +3 -0
  25. package/dist/types/core/hooks/useComponentApi.d.ts +4 -4
  26. package/dist/types/core/models/currency.d.ts +6 -3
  27. package/dist/types/language/config.d.ts +9 -1
  28. package/dist/types/utils/delay.d.ts +1 -0
  29. package/dist/types/utils/entity-status-util.d.ts +1 -1
  30. package/dist/types/utils/mapping/componentApiMapping.d.ts +2 -1
  31. package/dist/types/utils/payout-account-util.d.ts +3 -0
  32. package/package.json +1 -1
  33. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/ProofOfIdentityCard.d.ts +0 -15
@@ -78,7 +78,6 @@ const invalidFormatForAuDriversLicenseNumber = "This isn't a valid Australian dr
78
78
  const invalidFormatForNZDriversLicenseNumber = "Expected format should be: 2 characters, followed by 6 digits";
79
79
  const invalidFormatForAuDriversLicenseCardNumber = "This isn't a valid Australian driver's license card number. Expected format: 6-10 alphanumeric characters.";
80
80
  const invalidFormatForNZDriversLicenseCardNumber = "Expected format should be: 3 digits";
81
- const invalidFormatForAuProofOfIdentityCardNumber = "This isn't a valid Australian proof of identity card number. Expected format: 6-10 alphanumeric characters.";
82
81
  const invalidFormatForHKPassportNumber = "Not valid for HK. Format should be: 9-character alphanumeric. For example: K12345599";
83
82
  const invalidFormatForHKDriversLicenseNumber = "Not valid for HK. Format should be: 8-character alphanumeric. For example: A1234567";
84
83
  const invalidFormatForHKIdentityCardNumber = "Not valid for HK. Format should be: 8 or 9-character alphanumeric. For example: C668668A";
@@ -230,7 +229,7 @@ const submitFailed = "Submit failed";
230
229
  const submitReviewOfYourData = "Submit review of your data";
231
230
  const completeReview = "Complete review";
232
231
  const submitReview = "Submit review";
233
- const undoWithTimer = "Undo %{secondsLeft}";
232
+ const undoWithTimer = "Undo... %{secondsLeft}";
234
233
  const removing = "Removing...";
235
234
  const cantSetUpAcccount = "You can’t set up an account";
236
235
  const accountCantBeSetUp = "Your account can’t be set up as your information couldn’t be verified. To find out more, reach out to customer support.";
@@ -360,7 +359,7 @@ const businessAccountDetailsDescription = "To prepare your account, we need info
360
359
  const businessAccountDetailsDescriptionReview = "In order to ensure your data is up-to-date, please verify the following details. If necessary, please adjust any data that is no longer accurate.";
361
360
  const documentAddressedToName = "The document has to be addressed to %{name}";
362
361
  const showAddressStateCountry = "Shows address, state, and country of residence";
363
- const dateOnDocumentNoOlderThanXMonths = "The date on the document is no older than %{numberOfMonths} months";
362
+ const dateOnDocumentNoOlderThanXMonths = "Date on the document is no older than %{numberOfMonths} months";
364
363
  const fullDocumentVisibleWithReadableText = "The full document needs to be visible, with all text readable";
365
364
  const documentCannotBeDamaged = "The document cannot be damaged";
366
365
  const verify = "Verify";
@@ -392,12 +391,13 @@ const bankAccountVerification = "Bank account verification";
392
391
  const bankStatementDocument = "Bank statement";
393
392
  const bankStatementDocumentTypeLabel = "Upload a document to confirm your bank account information. We need to see this document so we can set up your payouts.";
394
393
  const requirements = "Requirements:";
395
- const accountHolderNameMatchesWithBusinessOrTradingName = "The account holder name on the document has to match the legal business or trading name of your company";
396
- const accountNumberOrIbanVisible = "The account number or IBAN needs to be visible";
394
+ const accountHolderNameMatchesWithBusinessOrTradingName = "Account holder name on the document has to match the legal business or trading name of your company";
395
+ const accountNumberOrIbanVisible = "Visible account number or IBAN";
397
396
  const accountNumberVisible = "The account number needs to be visible";
398
397
  const routingNumberVisible = "The routing number should be visible";
399
398
  const showsCountryOfBankAccount = "Shows the country where the bank account is located (for banks in the EU, the country is included in the IBAN)";
400
- const hasToBeOfficialDocumentFromBank = "It has to be official document from a bank, demonstrated by a bank logo, the bank name, or a bank-specific font";
399
+ const hasToBeOfficialDocumentFromBank = "Must be an official bank document that shows the bank logo, the bank name, or a bank-specific font";
400
+ const hasBankStampOrBankSignature = "Must have a bank stamp or bank signature";
401
401
  const ifDocumentMoreThan12months = "If your document is older than 12 months, then it should contain a statement with the company’s assets and liabilities. You will need to have it signed and dated by someone with decision-making or signing power within the company. Make sure the date, title, and legal entity name are included.";
402
402
  const whyDoINeedToFillInThisInformation = "Why do I need to fill in this information?";
403
403
  const reasonForFillingCompanyRegistrationDetails = "We have to make sure the businesses using our services will not be misusing the funds or causing harm. To do that, we’ll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.";
@@ -597,6 +597,8 @@ const documentShowsTaxIdOfCompany = "The document shows the tax ID number of the
597
597
  const issuedByTheTaxAuthority = "Issued by the tax authority or government of the country where the company is registered";
598
598
  const providePageWithPhotoAndCode = "Provide the page with the photo, including the code on the bottom";
599
599
  const constitutionalDocument = "Constitutional document";
600
+ const constitutionalDocument__header = "Upload a constitutional document";
601
+ const constitutionalDocument__headerDescription = "This helps to verify your sole proprietorship details.";
600
602
  const solePropDetails = "Sole proprietor details";
601
603
  const soleProprietorDetails = "Sole proprietor details";
602
604
  const soleProprietorshipDetails = "Sole proprietorship details";
@@ -716,10 +718,16 @@ const canNotCompleteInstantVerification = "Can not complete instant verification
716
718
  const goBackAndProvideDocumentScans = "Go back and provide document scans";
717
719
  const identityCard = "Identity card";
718
720
  const uploadOneOfTheFollowing = "Upload one of the following so we can verify your information:";
719
- const documentIssuedWithinLastYear = "Note! The document needs to be issued within the last year. If it is older, make sure it contains a signature and a state of affair not older than a year.";
721
+ const uploadOneOfTheseDocuments = "Upload one of these documents:";
722
+ const documentIssuedWithinLastYear = "The document must be issued in the last 12 months. If it is older, make sure it contains a signature and a statement of affairs from the last 12 months.";
720
723
  const learnMore = "Learn more";
721
- const doingBusinessAsNameFiling = "Doing business as-name filling";
722
- const taxFiling = "Tax-filling";
724
+ const doingBusinessAsNameFiling = "Doing business as (DBA) filing";
725
+ const doingBusinessAsNameFiling__FR = "Trading name filing";
726
+ const doingBusinessAsNameFiling__US = "Doing business as (DBA) filing, such as your articles of incorporation";
727
+ const businessRegistrationDocument__FR = "Business registration document, such as a KBIS extract or situation au répertoire sirene";
728
+ const taxFiling = "Tax filing";
729
+ const taxFiling__US = "Tax filing, such as a Form W-9 or Schedule SE (Form 1040)";
730
+ const einVerificationLetter = "Employer identification number (EIN) verification letter, also known as a CP 575 or 147c letter";
723
731
  const areYouACompany = "Are you a company?";
724
732
  const singingUpAsIndividualButLooksLikeYouAreACompany = "You’re now signing up as an individual. But it looks like you’re a company that uses a company bank account to receive payouts.";
725
733
  const wouldYouLikeToSignUpAsCompanyInstead = "Would you like to sign up as a company instead? (You’ll have to re-enter some information from before.)";
@@ -730,7 +738,7 @@ const noGoBack = "No, go back";
730
738
  const continueCompany = "Continue as company";
731
739
  const continueIndividual = "Continue as individual";
732
740
  const addManually = "Add manually";
733
- const searchAddress = "Search address";
741
+ const searchAddress$1 = "Search address";
734
742
  const startTypingTheAddress = "Start typing the address";
735
743
  const addresses = "Addresses";
736
744
  const loading = "Loading";
@@ -1207,7 +1215,6 @@ const defaultTrans = {
1207
1215
  invalidFormatForNZDriversLicenseNumber,
1208
1216
  invalidFormatForAuDriversLicenseCardNumber,
1209
1217
  invalidFormatForNZDriversLicenseCardNumber,
1210
- invalidFormatForAuProofOfIdentityCardNumber,
1211
1218
  invalidFormatForHKPassportNumber,
1212
1219
  invalidFormatForHKDriversLicenseNumber,
1213
1220
  invalidFormatForHKIdentityCardNumber,
@@ -1527,6 +1534,7 @@ const defaultTrans = {
1527
1534
  routingNumberVisible,
1528
1535
  showsCountryOfBankAccount,
1529
1536
  hasToBeOfficialDocumentFromBank,
1537
+ hasBankStampOrBankSignature,
1530
1538
  ifDocumentMoreThan12months,
1531
1539
  whyDoINeedToFillInThisInformation,
1532
1540
  reasonForFillingCompanyRegistrationDetails,
@@ -1731,6 +1739,8 @@ const defaultTrans = {
1731
1739
  issuedByTheTaxAuthority,
1732
1740
  providePageWithPhotoAndCode,
1733
1741
  constitutionalDocument,
1742
+ constitutionalDocument__header,
1743
+ constitutionalDocument__headerDescription,
1734
1744
  solePropDetails,
1735
1745
  soleProprietorDetails,
1736
1746
  soleProprietorshipDetails,
@@ -1859,10 +1869,16 @@ const defaultTrans = {
1859
1869
  goBackAndProvideDocumentScans,
1860
1870
  identityCard,
1861
1871
  uploadOneOfTheFollowing,
1872
+ uploadOneOfTheseDocuments,
1862
1873
  documentIssuedWithinLastYear,
1863
1874
  learnMore,
1864
1875
  doingBusinessAsNameFiling,
1876
+ doingBusinessAsNameFiling__FR,
1877
+ doingBusinessAsNameFiling__US,
1878
+ businessRegistrationDocument__FR,
1865
1879
  taxFiling,
1880
+ taxFiling__US,
1881
+ einVerificationLetter,
1866
1882
  areYouACompany,
1867
1883
  singingUpAsIndividualButLooksLikeYouAreACompany,
1868
1884
  wouldYouLikeToSignUpAsCompanyInstead,
@@ -1874,7 +1890,7 @@ const defaultTrans = {
1874
1890
  continueCompany,
1875
1891
  continueIndividual,
1876
1892
  addManually,
1877
- searchAddress,
1893
+ searchAddress: searchAddress$1,
1878
1894
  startTypingTheAddress,
1879
1895
  addresses,
1880
1896
  loading,
@@ -2987,7 +3003,7 @@ const createLogger = (namespace) => {
2987
3003
  });
2988
3004
  return methods;
2989
3005
  };
2990
- const logger$o = createLogger("Link");
3006
+ const logger$p = createLogger("Link");
2991
3007
  const getIconClass = (icon, external) => {
2992
3008
  if (external) {
2993
3009
  return "adl-link__icon adyen-kyc-icon-external-link";
@@ -2999,7 +3015,7 @@ const getIconClass = (icon, external) => {
2999
3015
  };
3000
3016
  const isValidLink = (href) => {
3001
3017
  if (href === "#") {
3002
- logger$o.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3018
+ logger$p.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3003
3019
  return false;
3004
3020
  }
3005
3021
  return true;
@@ -3276,14 +3292,14 @@ function useResetGlobalData(caller) {
3276
3292
  }
3277
3293
  }), [dispatch, caller]);
3278
3294
  }
3279
- const logger$n = createLogger("useAllowedCountries");
3295
+ const logger$o = createLogger("useAllowedCountries");
3280
3296
  const useAllowedCountries = () => {
3281
3297
  const {
3282
3298
  getAllowedCountries: getAllowedCountries2
3283
3299
  } = useConfigurationApi();
3284
3300
  const [allowedCountries, setAllowedCountries] = useState();
3285
3301
  useEffect(() => {
3286
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$n.error);
3302
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$o.error);
3287
3303
  }, []);
3288
3304
  return allowedCountries;
3289
3305
  };
@@ -3622,7 +3638,7 @@ class ValidationResult {
3622
3638
  return this.validationResults.filter((result) => result.hasError);
3623
3639
  }
3624
3640
  }
3625
- const logger$m = createLogger("useAsyncValidator");
3641
+ const logger$n = createLogger("useAsyncValidator");
3626
3642
  const useAsyncValidator = (asyncRules) => {
3627
3643
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3628
3644
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3645,7 +3661,7 @@ const useAsyncValidator = (asyncRules) => {
3645
3661
  hasError: !isValid
3646
3662
  }])
3647
3663
  });
3648
- }).catch(logger$m.error);
3664
+ }).catch(logger$n.error);
3649
3665
  }, [asyncRules, clearAsyncValidationResults]);
3650
3666
  return {
3651
3667
  asyncValidationResults,
@@ -5064,7 +5080,7 @@ const Select = ({
5064
5080
  })]
5065
5081
  });
5066
5082
  };
5067
- const logger$l = createLogger("CountryField");
5083
+ const logger$m = createLogger("CountryField");
5068
5084
  const COUNTRY_FIELD = ["country"];
5069
5085
  function CountryField({
5070
5086
  data,
@@ -5087,7 +5103,7 @@ function CountryField({
5087
5103
  dataset: countriesFromApi
5088
5104
  } = useDataset(datasetIdentifier.country);
5089
5105
  useEffect(() => {
5090
- loadFlags2().catch(logger$l.error);
5106
+ loadFlags2().catch(logger$m.error);
5091
5107
  }, [loadFlags2]);
5092
5108
  const countries = countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
5093
5109
  ...item,
@@ -6699,11 +6715,6 @@ function AccordionItem({
6699
6715
  newItems.find((item) => item.id === id2).isOpen = newValue;
6700
6716
  setItems(newItems);
6701
6717
  }
6702
- if (isOpen) {
6703
- onClose();
6704
- } else {
6705
- onOpen();
6706
- }
6707
6718
  };
6708
6719
  useEffect(() => {
6709
6720
  setItems((items2) => [...items2, {
@@ -6719,8 +6730,12 @@ function AccordionItem({
6719
6730
  setIsOpen((_a = items.find((item) => item.id === id2)) == null ? void 0 : _a.isOpen);
6720
6731
  }, [items]);
6721
6732
  useEffect(() => {
6722
- if (isOpen)
6733
+ if (isOpen) {
6723
6734
  onExpandSection == null ? void 0 : onExpandSection(title);
6735
+ onOpen();
6736
+ } else {
6737
+ onClose();
6738
+ }
6724
6739
  }, [isOpen]);
6725
6740
  return jsxs("div", {
6726
6741
  className: "adl-accordion__item",
@@ -8928,7 +8943,7 @@ const accountHolderValidationRules = {
8928
8943
  }
8929
8944
  };
8930
8945
  const accountHolderFields = ["accountHolder"];
8931
- const logger$k = createLogger("AccountHolder");
8946
+ const logger$l = createLogger("AccountHolder");
8932
8947
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
8933
8948
  switch (legalEntityType) {
8934
8949
  case LegalEntityType.ORGANIZATION: {
@@ -8938,7 +8953,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
8938
8953
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
8939
8954
  }
8940
8955
  default:
8941
- logger$k.error(`No available account holder options for legal entity type '${legalEntityType}'`);
8956
+ logger$l.error(`No available account holder options for legal entity type '${legalEntityType}'`);
8942
8957
  return [];
8943
8958
  }
8944
8959
  }
@@ -8965,7 +8980,7 @@ function AccountHolder(props) {
8965
8980
  isExperimentEnabled
8966
8981
  } = useExperimentsContext();
8967
8982
  const isChangeToMyNameAllowed = !(capabilities == null ? void 0 : capabilities.map((c) => c.replace("Commercial", "").replace("Consumer", "")).some((c) => capabilitiesToPreventTypeChange.includes(c)));
8968
- const accountHolderOptions = getAvailableAccountHolderOptions(props.legalEntityType, isSettingEnabled(SettingNames.AllowLegalEntityTypeChange), isExperimentEnabled("EnableTrustFlow") && TRUST_COUNTRIES.includes(props.country), SOLE_PROP_COUNTRIES.includes(props.country), isChangeToMyNameAllowed).map((accountHolderOption) => ({
8983
+ const accountHolderOptions = getAvailableAccountHolderOptions(props.legalEntityType, isSettingEnabled(SettingNames.AllowLegalEntityTypeChange), TRUST_COUNTRIES.includes(props.country), SOLE_PROP_COUNTRIES.includes(props.country), isChangeToMyNameAllowed).map((accountHolderOption) => ({
8969
8984
  id: accountHolderOption,
8970
8985
  name: i18n.get(accountHolderOption),
8971
8986
  description: i18n.get(`${accountHolderOption}Description`)
@@ -9189,12 +9204,14 @@ function CompanyTypeComponent(props) {
9189
9204
  const {
9190
9205
  i18n
9191
9206
  } = useI18nContext();
9207
+ const isNewEntryFlowEnabled = useEnableNewEntryFlow();
9192
9208
  const stateRef = useRef({
9193
9209
  setState: null
9194
9210
  });
9195
9211
  const {
9196
9212
  id: COMPANY_TYPE_ID,
9197
- requiredFields
9213
+ requiredFields,
9214
+ country: country2
9198
9215
  } = props;
9199
9216
  const requiredFieldsForForm = requiredFields || companyTypeFields;
9200
9217
  const {
@@ -9258,11 +9275,11 @@ function CompanyTypeComponent(props) {
9258
9275
  "aria-label": formUtils.getLabel("entityType", "whatTypeOfCompanyDoYouHave"),
9259
9276
  "aria-invalid": !valid.entityType
9260
9277
  })
9261
- }), formUtils.isRequiredField("accountHolder") && props.country && jsx(AccountHolder, {
9278
+ }), !isNewEntryFlowEnabled && formUtils.isRequiredField("accountHolder") && country2 && jsx(AccountHolder, {
9262
9279
  ...accountHolderProps,
9263
9280
  dataStoreId: COMPANY_TYPE_ID,
9264
9281
  legalEntityType: LegalEntityType.ORGANIZATION,
9265
- country: props.country
9282
+ country: country2
9266
9283
  })]
9267
9284
  })]
9268
9285
  });
@@ -9684,7 +9701,7 @@ function Dropzone(props) {
9684
9701
  })]
9685
9702
  });
9686
9703
  }
9687
- const logger$j = createLogger("TextArea");
9704
+ const logger$k = createLogger("TextArea");
9688
9705
  function TextArea(props) {
9689
9706
  const {
9690
9707
  classNameModifiers,
@@ -9705,7 +9722,7 @@ function TextArea(props) {
9705
9722
  } = useI18nContext();
9706
9723
  const [value, setValue] = useState("");
9707
9724
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
9708
- logger$j.error("Error: Form fields that rely on InputBase may not have an onChange property");
9725
+ logger$k.error("Error: Form fields that rely on InputBase may not have an onChange property");
9709
9726
  }
9710
9727
  const handleInput = (e) => {
9711
9728
  var _a;
@@ -9825,7 +9842,8 @@ function DocumentUploadComponent({
9825
9842
  owner: props.id,
9826
9843
  stateRef
9827
9844
  }), jsx(FormHeader, {
9828
- heading: props.heading
9845
+ heading: props.heading,
9846
+ description: props.description
9829
9847
  }), jsx(ErrorPanel, {
9830
9848
  verificationErrors: props == null ? void 0 : props.formVerificationErrors,
9831
9849
  validationErrors: props == null ? void 0 : props.fieldValidationErrors,
@@ -10117,7 +10135,7 @@ function FieldContainer(props) {
10117
10135
  }
10118
10136
  return renderField(fieldName);
10119
10137
  }
10120
- const logger$i = createLogger("SearchAddress");
10138
+ const logger$j = createLogger("SearchAddress");
10121
10139
  const SearchAddress = ({
10122
10140
  data,
10123
10141
  legalEntityId,
@@ -10143,7 +10161,7 @@ const SearchAddress = ({
10143
10161
  const response = await handleFindAddress(selectedAddressId);
10144
10162
  autocompleteAddressForm(response);
10145
10163
  } catch (e) {
10146
- logger$i.error(e);
10164
+ logger$j.error(e);
10147
10165
  }
10148
10166
  };
10149
10167
  const onDrilldown = async (selectedAddress) => {
@@ -10155,7 +10173,7 @@ const SearchAddress = ({
10155
10173
  }, legalEntityId);
10156
10174
  setItems((response == null ? void 0 : response.results) || []);
10157
10175
  } catch (e) {
10158
- logger$i.error(e);
10176
+ logger$j.error(e);
10159
10177
  }
10160
10178
  };
10161
10179
  const onChange = (e) => {
@@ -10210,7 +10228,7 @@ const SearchAddress = ({
10210
10228
  setItems([]);
10211
10229
  }
10212
10230
  } catch (e) {
10213
- logger$i.error(e);
10231
+ logger$j.error(e);
10214
10232
  }
10215
10233
  setLoading(false);
10216
10234
  }
@@ -11798,6 +11816,7 @@ const solePropBaseMapping = {
11798
11816
  "solePropRegistrationDetails.vatAbsenceReason": "soleProprietorship.vatAbsenceReason",
11799
11817
  "solePropRegistrationDetails.exemptedFromTax": "soleProprietorship.taxAbsent",
11800
11818
  "solePropRegistrationDetails.registrationNumber": "soleProprietorship.registrationNumber",
11819
+ "solePropRegistrationDetails.dateOfIncorporation": "soleProprietorship.dateOfIncorporation",
11801
11820
  "solePropRegistrationAddress.registrationAddress.city": "soleProprietorship.registeredAddress.city",
11802
11821
  "solePropRegistrationAddress.registrationAddress.country": "soleProprietorship.registeredAddress.country",
11803
11822
  "solePropRegistrationAddress.registrationAddress.postalCode": "soleProprietorship.registeredAddress.postalCode",
@@ -13163,7 +13182,7 @@ const initOnfido = async ({
13163
13182
  language: getOnfidoLocaleConfig(i18n)
13164
13183
  });
13165
13184
  };
13166
- const logger$h = createLogger("IdVerificationComponent");
13185
+ const logger$i = createLogger("IdVerificationComponent");
13167
13186
  function IdVerificationComponent({
13168
13187
  userDetails,
13169
13188
  legalEntityId,
@@ -13196,7 +13215,7 @@ function IdVerificationComponent({
13196
13215
  onIdVerificationError,
13197
13216
  onIdVerificationComplete
13198
13217
  });
13199
- })().catch(logger$h.error);
13218
+ })().catch(logger$i.error);
13200
13219
  return () => {
13201
13220
  if (onfidoSdk.current)
13202
13221
  onfidoSdk.current.tearDown();
@@ -13248,7 +13267,7 @@ function IdDocumentAlreadyUpload(props) {
13248
13267
  })]
13249
13268
  });
13250
13269
  }
13251
- const logger$g = createLogger("IdDocumentInstantVerificationComponent");
13270
+ const logger$h = createLogger("IdDocumentInstantVerificationComponent");
13252
13271
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
13253
13272
  const documentTypeValidationRules = {
13254
13273
  instantIdVerificationData: {
@@ -13330,7 +13349,7 @@ function IdDocumentInstantVerificationComponent(props) {
13330
13349
  userDetails: props.userDetails,
13331
13350
  legalEntityId: props.legalEntityId,
13332
13351
  onIdVerificationComplete: handleIdVerificationComplete,
13333
- onIdVerificationError: logger$g.error
13352
+ onIdVerificationError: logger$h.error
13334
13353
  }), jsxs("div", {
13335
13354
  className: "adyen-kyc-document-upload__manual-upload",
13336
13355
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -14665,8 +14684,6 @@ const auIdentityValidationRules = {
14665
14684
  return PassportNumberPatterns.AU.test(value ?? "");
14666
14685
  case "driversLicense":
14667
14686
  return DriversLicenseNumberPatterns.AU.test(value ?? "");
14668
- case "proofOfIdentityCard":
14669
- return ProofOfIdentityCardPatterns.AU.test(value ?? "");
14670
14687
  default:
14671
14688
  return false;
14672
14689
  }
@@ -14677,8 +14694,6 @@ const auIdentityValidationRules = {
14677
14694
  return "invalidFormatForAuPassportNumber";
14678
14695
  case "driversLicense":
14679
14696
  return "invalidFormatForAuDriversLicenseNumber";
14680
- case "proofOfIdentityCard":
14681
- return "invalidFormatForAuProofOfIdentityCardNumber";
14682
14697
  }
14683
14698
  },
14684
14699
  modes: ["blur"]
@@ -14791,29 +14806,6 @@ const PassportNumber$2 = ({
14791
14806
  placeholder: ""
14792
14807
  })
14793
14808
  });
14794
- const ProofOfIdentityCard$1 = ({
14795
- cardNumber,
14796
- onInput,
14797
- onBlur,
14798
- formUtils: {
14799
- getLabel
14800
- },
14801
- errorMessage,
14802
- isValid
14803
- }) => jsx(Field, {
14804
- name: "cardNumber",
14805
- label: getLabel("idNumber", "proofOfIdentityCardNumber"),
14806
- errorMessage,
14807
- isValid,
14808
- children: (childProps) => jsx(InputText, {
14809
- ...childProps,
14810
- name: "cardNumber",
14811
- value: cardNumber,
14812
- onInput,
14813
- onBlur,
14814
- placeholder: ""
14815
- })
14816
- });
14817
14809
  function IdentityAuComponent(props) {
14818
14810
  var _a;
14819
14811
  if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
@@ -14855,7 +14847,7 @@ function IdentityAuComponent(props) {
14855
14847
  i18n
14856
14848
  } = useI18nContext();
14857
14849
  const formUtils = formUtilities(props, i18n);
14858
- const availableIdentityTypes = ["passport", "driversLicense", "proofOfIdentityCard"];
14850
+ const availableIdentityTypes = ["passport", "driversLicense"];
14859
14851
  const selectedIdentityType = data.typeOfIdentity;
14860
14852
  return jsxs(Fragment, {
14861
14853
  children: [jsx(TypeOfIdentity, {
@@ -14872,13 +14864,6 @@ function IdentityAuComponent(props) {
14872
14864
  formUtils,
14873
14865
  isValid: valid.idNumber,
14874
14866
  errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
14875
- }) : data.typeOfIdentity === "proofOfIdentityCard" ? jsx(ProofOfIdentityCard$1, {
14876
- cardNumber: data.idNumber ?? "",
14877
- onInput: handleChangeFor("idNumber", "input"),
14878
- onBlur: handleChangeFor("idNumber", "blur"),
14879
- formUtils,
14880
- isValid: valid.idNumber,
14881
- errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
14882
14867
  }) : data.typeOfIdentity === "driversLicense" ? jsx(DriversLicense$2, {
14883
14868
  driversLicense: data,
14884
14869
  onIssuerStateChange: handleChangeFor("issuerState"),
@@ -15920,6 +15905,14 @@ function IndividualComponent(props) {
15920
15905
  }
15921
15906
  const PayoutDetails = "";
15922
15907
  const BankVerification$2 = "";
15908
+ const AuthContext = createContext(void 0);
15909
+ const useAuthContext = () => {
15910
+ const authContext = useContext(AuthContext);
15911
+ if (!authContext) {
15912
+ throw new Error("Cannot use authContext without <AuthProvider>");
15913
+ }
15914
+ return authContext;
15915
+ };
15923
15916
  const _actionBar_component = "";
15924
15917
  const ActionBar = ({
15925
15918
  onNext,
@@ -15960,6 +15953,7 @@ const ActionBar = ({
15960
15953
  })]
15961
15954
  });
15962
15955
  var Currency = /* @__PURE__ */ ((Currency2) => {
15956
+ Currency2["AED"] = "AED";
15963
15957
  Currency2["AUD"] = "AUD";
15964
15958
  Currency2["BGN"] = "BGN";
15965
15959
  Currency2["BRL"] = "BRL";
@@ -15970,14 +15964,16 @@ var Currency = /* @__PURE__ */ ((Currency2) => {
15970
15964
  Currency2["EUR"] = "EUR";
15971
15965
  Currency2["GBP"] = "GBP";
15972
15966
  Currency2["HKD"] = "HKD";
15973
- Currency2["HUF"] = "HUF";
15974
15967
  Currency2["HRK"] = "HRK";
15975
- Currency2["PLN"] = "PLN";
15968
+ Currency2["HUF"] = "HUF";
15969
+ Currency2["MXN"] = "MXN";
15970
+ Currency2["MYR"] = "MYR";
15976
15971
  Currency2["NOK"] = "NOK";
15977
15972
  Currency2["NZD"] = "NZD";
15973
+ Currency2["PLN"] = "PLN";
15978
15974
  Currency2["RON"] = "RON";
15979
- Currency2["SGD"] = "SGD";
15980
15975
  Currency2["SEK"] = "SEK";
15976
+ Currency2["SGD"] = "SGD";
15981
15977
  Currency2["USD"] = "USD";
15982
15978
  return Currency2;
15983
15979
  })(Currency || {});
@@ -16009,7 +16005,9 @@ const currencyByCountry = {
16009
16005
  [CountryCodes.Liechtenstein]: [Currency.CHF, Currency.EUR],
16010
16006
  [CountryCodes.Lithuania]: [Currency.EUR],
16011
16007
  [CountryCodes.Luxembourg]: [Currency.EUR],
16008
+ [CountryCodes.Malaysia]: [Currency.MYR],
16012
16009
  [CountryCodes.Malta]: [Currency.EUR],
16010
+ [CountryCodes.Mexico]: [Currency.MXN],
16013
16011
  [CountryCodes.Monaco]: [Currency.EUR],
16014
16012
  [CountryCodes.Netherlands]: [Currency.EUR],
16015
16013
  [CountryCodes.NewZealand]: [Currency.NZD],
@@ -16024,6 +16022,7 @@ const currencyByCountry = {
16024
16022
  [CountryCodes.Spain]: [Currency.EUR],
16025
16023
  [CountryCodes.Sweden]: [Currency.SEK, Currency.EUR],
16026
16024
  [CountryCodes.Switzerland]: [Currency.CHF, Currency.EUR],
16025
+ [CountryCodes.UnitedArabEmirates]: [Currency.AED],
16027
16026
  [CountryCodes.UnitedKingdom]: [Currency.GBP, Currency.EUR],
16028
16027
  [CountryCodes.UnitedStates]: [Currency.USD]
16029
16028
  };
@@ -16055,14 +16054,6 @@ const bankVerificationValidationRules = {
16055
16054
  }
16056
16055
  };
16057
16056
  const BankVerificationWidget$1 = "";
16058
- const AuthContext = createContext(void 0);
16059
- const useAuthContext = () => {
16060
- const authContext = useContext(AuthContext);
16061
- if (!authContext) {
16062
- throw new Error("Cannot use authContext without <AuthProvider>");
16063
- }
16064
- return authContext;
16065
- };
16066
16057
  class AdyenKycSdkError extends Error {
16067
16058
  constructor(message, sourceError) {
16068
16059
  super(message);
@@ -16082,7 +16073,7 @@ class AdyenKycSdkError extends Error {
16082
16073
  }
16083
16074
  let sdkToken;
16084
16075
  let fetchSdkToken;
16085
- const logger$f = createLogger("Session");
16076
+ const logger$g = createLogger("Session");
16086
16077
  const setSdkToken = (token) => {
16087
16078
  sdkToken = token;
16088
16079
  };
@@ -16100,7 +16091,7 @@ const refreshSession = async () => {
16100
16091
  } = await fetchSdkToken();
16101
16092
  setSdkToken(token);
16102
16093
  } catch (e) {
16103
- logger$f.error("Failed to fetch sdk token", e);
16094
+ logger$g.error("Failed to fetch sdk token", e);
16104
16095
  }
16105
16096
  };
16106
16097
  const addAnimationStartListener = (element, listener) => {
@@ -16109,7 +16100,7 @@ const addAnimationStartListener = (element, listener) => {
16109
16100
  const removeAnimationStartListener = (element, listener) => {
16110
16101
  element.removeEventListener("animationstart", listener, false);
16111
16102
  };
16112
- const logger$e = createLogger("Fetch");
16103
+ const logger$f = createLogger("Fetch");
16113
16104
  const getRequestObject = (options, data) => {
16114
16105
  const {
16115
16106
  headers = [],
@@ -16156,10 +16147,10 @@ const logFetchError = (message, level) => {
16156
16147
  case "info":
16157
16148
  case "warn":
16158
16149
  case "error":
16159
- logger$e[level](message);
16150
+ logger$f[level](message);
16160
16151
  break;
16161
16152
  default:
16162
- logger$e.error(message);
16153
+ logger$f.error(message);
16163
16154
  }
16164
16155
  };
16165
16156
  const handleFetchResponse = async (response, responseType) => {
@@ -16250,7 +16241,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
16250
16241
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
16251
16242
  const MOUNT_TIMEOUT = 10 * 1e3;
16252
16243
  const TINK_VENDOR = "Tink";
16253
- const logger$d = createLogger("iframeWidget");
16244
+ const logger$e = createLogger("iframeWidget");
16254
16245
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
16255
16246
  const isTerminalMessageData = (data) => Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
16256
16247
  const parseMessageJson = (message) => {
@@ -16269,7 +16260,7 @@ const callbackErrorHandler = async (response) => {
16269
16260
  try {
16270
16261
  await response;
16271
16262
  } catch (ex) {
16272
- logger$d.error(ex);
16263
+ logger$e.error(ex);
16273
16264
  }
16274
16265
  return {
16275
16266
  error: "UNKNOWN_ERROR",
@@ -16375,7 +16366,7 @@ class IFrameWidget {
16375
16366
  message = responseData.errorMessage;
16376
16367
  }
16377
16368
  } catch (ex) {
16378
- logger$d.error(ex);
16369
+ logger$e.error(ex);
16379
16370
  }
16380
16371
  throw new AdyenKycSdkError(reason, jsonData.error);
16381
16372
  }
@@ -16561,7 +16552,7 @@ function BankVerificationWidget({
16561
16552
  ref: widgetContainerRef
16562
16553
  });
16563
16554
  }
16564
- const logger$c = createLogger("BankVerification");
16555
+ const logger$d = createLogger("BankVerification");
16565
16556
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
16566
16557
  const InstantVerificationErrorContext = createContext(null);
16567
16558
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -16595,7 +16586,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
16595
16586
  const preferredVendor2 = vendors[0];
16596
16587
  setPreferredVendor(preferredVendor2.name ? preferredVendor2 : null);
16597
16588
  };
16598
- getPreferredVendor().catch(logger$c.error);
16589
+ getPreferredVendor().catch(logger$d.error);
16599
16590
  }, [country2, getBankVerificationVendors]);
16600
16591
  return preferredVendor;
16601
16592
  };
@@ -16696,6 +16687,9 @@ function BankVerification(props) {
16696
16687
  const {
16697
16688
  i18n
16698
16689
  } = useI18nContext();
16690
+ const {
16691
+ isEmbeddedDropin
16692
+ } = useAuthContext();
16699
16693
  const ACCOUNT_VERIFICATION = props.id;
16700
16694
  const schema = accountVerificationFields;
16701
16695
  const stateRef = useRef({
@@ -16772,7 +16766,9 @@ function BankVerification(props) {
16772
16766
  })]
16773
16767
  })]
16774
16768
  }), typeof getBankVerificationVendors === "function" && formIsActive && !bankInfoValidated && jsx("div", {
16775
- className: "adyen-kyc-bank-verification-container",
16769
+ className: cx("adyen-kyc-bank-verification-container", {
16770
+ "adyen-kyc-bank-verification-container__fixed": !isEmbeddedDropin
16771
+ }),
16776
16772
  children: jsx(InstantBankVerification, {
16777
16773
  getBankVerificationVendors,
16778
16774
  retrieveBankAccountInfo,
@@ -16789,51 +16785,49 @@ const BankVerification$1 = memo(BankVerification);
16789
16785
  const PayoutAccount$1 = "";
16790
16786
  const countriesWithMultipleCurrencies = /* @__PURE__ */ new Set([CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.CzechRepublic, CountryCodes.Hungary, CountryCodes.Romania, CountryCodes.Switzerland]);
16791
16787
  const countriesWithLocalFormat = /* @__PURE__ */ new Set([CountryCodes.Denmark, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.UnitedKingdom]);
16788
+ const payoutCurrencySupport = {
16789
+ [CountryCodes.Sweden]: {
16790
+ local: [Currency.SEK],
16791
+ iban: [Currency.EUR]
16792
+ },
16793
+ [CountryCodes.Canada]: {
16794
+ local: [Currency.CAD, Currency.USD],
16795
+ iban: [Currency.CAD, Currency.USD]
16796
+ }
16797
+ };
16792
16798
  const shouldShowPayoutAccountFormatSelector = (country2) => countriesWithLocalFormat.has(country2);
16793
16799
  const shouldShowPayoutAlert = (country2) => shouldShowPayoutAccountFormatSelector(country2) || countriesWithMultipleCurrencies.has(country2);
16794
16800
  const getSupportedCurrencyGuidance = (i18n, country2, requiredFields) => {
16795
- var _a;
16796
- if (shouldShowPayoutAlert(country2)) {
16797
- if (country2 === CountryCodes.Sweden) {
16798
- if (requiredFields.includes("iban")) {
16799
- return i18n.get("payoutInOnly_", {
16800
- values: {
16801
- currency: Currency.EUR
16802
- }
16803
- });
16804
- }
16805
- return i18n.get("payoutInOnly_", {
16806
- values: {
16807
- currency: Currency.SEK
16808
- }
16809
- });
16801
+ const format = requiredFields.includes("iban") ? "iban" : "local";
16802
+ if (!shouldShowPayoutAlert(country2)) {
16803
+ return;
16804
+ }
16805
+ const supportedCurrencies = getSupportedCurrenciesPerFormat(country2, format);
16806
+ if (!supportedCurrencies) {
16807
+ return;
16808
+ }
16809
+ return supportedCurrencies.length > 1 ? i18n.get("payoutIn_Or_", {
16810
+ values: {
16811
+ currencyOne: supportedCurrencies[0],
16812
+ currencyTwo: supportedCurrencies[1]
16810
16813
  }
16811
- if (country2 === CountryCodes.Canada) {
16812
- return i18n.get("payoutIn_Or_", {
16813
- values: {
16814
- currencyOne: Currency.CAD,
16815
- currencyTwo: Currency.USD
16816
- }
16817
- });
16814
+ }) : i18n.get("payoutInOnly_", {
16815
+ values: {
16816
+ currency: supportedCurrencies[0]
16818
16817
  }
16818
+ });
16819
+ };
16820
+ const getSupportedCurrenciesPerFormat = (country2, format) => {
16821
+ var _a;
16822
+ const supportedCurrencies = payoutCurrencySupport[country2];
16823
+ if (!supportedCurrencies) {
16819
16824
  const defaultCurrency = (_a = currencyByCountry[country2]) == null ? void 0 : _a[0];
16820
16825
  if (!defaultCurrency) {
16821
16826
  return;
16822
16827
  }
16823
- if (requiredFields.includes("iban")) {
16824
- return i18n.get("payoutIn_Or_", {
16825
- values: {
16826
- currencyOne: Currency.EUR,
16827
- currencyTwo: defaultCurrency
16828
- }
16829
- });
16830
- }
16831
- return i18n.get("payoutInOnly_", {
16832
- values: {
16833
- currency: defaultCurrency
16834
- }
16835
- });
16828
+ return format === "iban" ? [Currency.EUR, defaultCurrency] : [defaultCurrency];
16836
16829
  }
16830
+ return supportedCurrencies[format];
16837
16831
  };
16838
16832
  function BankAccountFormat(props) {
16839
16833
  const {
@@ -16869,7 +16863,6 @@ function BankAccountFormat(props) {
16869
16863
  });
16870
16864
  }
16871
16865
  var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
16872
- ExperimentNames2["EnableTrustFlow"] = "EnableTrustFlow";
16873
16866
  ExperimentNames2["OnlyAllowAlphanumericBankAccountNumbers"] = "OnlyAllowAlphanumericBankAccountNumbers";
16874
16867
  ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
16875
16868
  ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
@@ -17278,7 +17271,11 @@ const bbanPatternsByCountry = {
17278
17271
  GB: /[A-Z]{4}\d{14}/,
17279
17272
  VG: /[\dA-Z]{4}\d{16}/
17280
17273
  };
17274
+ const regionsWithSharedIbanFormat = {
17275
+ GB: ["GG", "IM", "JE"]
17276
+ };
17281
17277
  function ibanValidator(input, bankCountries) {
17278
+ var _a;
17282
17279
  if (isEmpty(input))
17283
17280
  return "fieldIsRequired";
17284
17281
  const ibanInput = input.replace(/ /g, "").toUpperCase();
@@ -17286,7 +17283,7 @@ function ibanValidator(input, bankCountries) {
17286
17283
  return "validationPleaseEnterAValidIban";
17287
17284
  }
17288
17285
  const countryCode = ibanInput.substring(0, 2);
17289
- if (bankCountries && !bankCountries.includes(countryCode)) {
17286
+ if (bankCountries && !bankCountries.includes(countryCode) && !((_a = regionsWithSharedIbanFormat[countryCode]) == null ? void 0 : _a.includes(bankCountries[0]))) {
17290
17287
  return {
17291
17288
  translationKey: "yourIbanShouldBeginWith_",
17292
17289
  translationObject: {
@@ -17763,12 +17760,31 @@ var BankDocumentRequirement = /* @__PURE__ */ ((BankDocumentRequirement2) => {
17763
17760
  BankDocumentRequirement2["DATE_ON_DOCUMENT"] = "dateOnDocumentNoOlderThanXMonths";
17764
17761
  BankDocumentRequirement2["COUNTRY_OF_BANK"] = "showsCountryOfBankAccount";
17765
17762
  BankDocumentRequirement2["OFFICIAL_DOCUMENT"] = "hasToBeOfficialDocumentFromBank";
17763
+ BankDocumentRequirement2["STAMP_OR_SIGNATURE"] = "hasBankStampOrBankSignature";
17766
17764
  return BankDocumentRequirement2;
17767
17765
  })(BankDocumentRequirement || {});
17768
- const getBankDocumentRequirements = (country2) => {
17766
+ const getBankDocumentRequirements = (country2, documentType2) => {
17767
+ const requireStampOrSignature = documentType2 === BankDocumentTypes.DEPOSIT_TICKET || documentType2 === BankDocumentTypes.OFFICIAL_EMAIL;
17769
17768
  switch (country2) {
17770
17769
  case CountryCodes.UnitedStates:
17771
- return [{
17770
+ return requireStampOrSignature ? [{
17771
+ key: BankDocumentRequirement.ACCOUNT_HOLDER
17772
+ }, {
17773
+ key: BankDocumentRequirement.ACCOUNT_NUMBER
17774
+ }, {
17775
+ key: BankDocumentRequirement.ROUTING_NUMBER
17776
+ }, {
17777
+ key: BankDocumentRequirement.DATE_ON_DOCUMENT,
17778
+ options: {
17779
+ values: {
17780
+ numberOfMonths: 12
17781
+ }
17782
+ }
17783
+ }, {
17784
+ key: BankDocumentRequirement.OFFICIAL_DOCUMENT
17785
+ }, {
17786
+ key: BankDocumentRequirement.STAMP_OR_SIGNATURE
17787
+ }] : [{
17772
17788
  key: BankDocumentRequirement.ACCOUNT_HOLDER
17773
17789
  }, {
17774
17790
  key: BankDocumentRequirement.ACCOUNT_NUMBER
@@ -17785,7 +17801,24 @@ const getBankDocumentRequirements = (country2) => {
17785
17801
  key: BankDocumentRequirement.OFFICIAL_DOCUMENT
17786
17802
  }];
17787
17803
  default:
17788
- return [{
17804
+ return requireStampOrSignature ? [{
17805
+ key: BankDocumentRequirement.ACCOUNT_HOLDER
17806
+ }, {
17807
+ key: BankDocumentRequirement.ACCOUNT_NUMBER_OR_IBAN
17808
+ }, {
17809
+ key: BankDocumentRequirement.DATE_ON_DOCUMENT,
17810
+ options: {
17811
+ values: {
17812
+ numberOfMonths: 12
17813
+ }
17814
+ }
17815
+ }, {
17816
+ key: BankDocumentRequirement.COUNTRY_OF_BANK
17817
+ }, {
17818
+ key: BankDocumentRequirement.OFFICIAL_DOCUMENT
17819
+ }, {
17820
+ key: BankDocumentRequirement.STAMP_OR_SIGNATURE
17821
+ }] : [{
17789
17822
  key: BankDocumentRequirement.ACCOUNT_HOLDER
17790
17823
  }, {
17791
17824
  key: BankDocumentRequirement.ACCOUNT_NUMBER_OR_IBAN
@@ -17804,7 +17837,8 @@ const getBankDocumentRequirements = (country2) => {
17804
17837
  }
17805
17838
  };
17806
17839
  const BankDocumentRequirements = ({
17807
- country: country2
17840
+ country: country2,
17841
+ documentType: documentType2
17808
17842
  }) => {
17809
17843
  const {
17810
17844
  i18n
@@ -17815,7 +17849,7 @@ const BankDocumentRequirements = ({
17815
17849
  children: [" ", i18n.get("requirements")]
17816
17850
  }), jsx(List, {
17817
17851
  className: "adyen-kyc-upload-field__requirements",
17818
- children: getBankDocumentRequirements(country2).map(({
17852
+ children: getBankDocumentRequirements(country2, documentType2).map(({
17819
17853
  key,
17820
17854
  options
17821
17855
  }) => jsx(ListItem, {
@@ -17946,7 +17980,8 @@ function PayoutBankStatementComponent(props) {
17946
17980
  })
17947
17981
  }), documentType2 ? jsxs(Fragment, {
17948
17982
  children: [country2 ? jsx(BankDocumentRequirements, {
17949
- country: country2
17983
+ country: country2,
17984
+ documentType: documentType2
17950
17985
  }) : void 0, jsx(DocumentGuidance, {
17951
17986
  type: DocumentType.BANK_STATEMENT,
17952
17987
  className: "adl-u-margin-y-24"
@@ -17990,7 +18025,7 @@ function PayoutBankStatementComponent(props) {
17990
18025
  const PayoutBankStatement = memo(PayoutBankStatementComponent, (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.heading === nextProps.heading);
17991
18026
  const VerificationMethod = "";
17992
18027
  const hasLoaded = (loadedValue) => loadedValue !== "loading";
17993
- const eeaCountries = [CountryCodes.Austria, CountryCodes.Belgium, CountryCodes.Bulgaria, CountryCodes.Croatia, CountryCodes.Cyprus, CountryCodes.CzechRepublic, CountryCodes.Denmark, CountryCodes.Estonia, CountryCodes.Finland, CountryCodes.France, CountryCodes.Germany, CountryCodes.Greece, CountryCodes.HongKong, CountryCodes.Hungary, CountryCodes.Ireland, CountryCodes.Italy, CountryCodes.Latvia, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Netherlands, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Portugal, CountryCodes.Romania, CountryCodes.Slovakia, CountryCodes.Slovenia, CountryCodes.Spain, CountryCodes.Sweden];
18028
+ const eeaCountries = [CountryCodes.Austria, CountryCodes.Belgium, CountryCodes.Bulgaria, CountryCodes.Croatia, CountryCodes.Cyprus, CountryCodes.CzechRepublic, CountryCodes.Denmark, CountryCodes.Estonia, CountryCodes.Finland, CountryCodes.France, CountryCodes.Germany, CountryCodes.Greece, CountryCodes.Hungary, CountryCodes.Ireland, CountryCodes.Italy, CountryCodes.Latvia, CountryCodes.Liechtenstein, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Malta, CountryCodes.Netherlands, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Portugal, CountryCodes.Romania, CountryCodes.Slovakia, CountryCodes.Slovenia, CountryCodes.Spain, CountryCodes.Sweden];
17994
18029
  const regions = {
17995
18030
  europe: [...eeaCountries, CountryCodes.Switzerland, CountryCodes.UnitedKingdom],
17996
18031
  apac: [CountryCodes.NewZealand, CountryCodes.Australia]
@@ -18421,27 +18456,58 @@ function PayoutDetailsComponent(props) {
18421
18456
  var ConstitutionalDocumentTypes = /* @__PURE__ */ ((ConstitutionalDocumentTypes2) => {
18422
18457
  ConstitutionalDocumentTypes2["BUSINESS_NAME_FILING"] = "doingBusinessAsNameFiling";
18423
18458
  ConstitutionalDocumentTypes2["TAX_FILING"] = "taxFiling";
18459
+ ConstitutionalDocumentTypes2["EMPLOYER_IDENTIFICATION_NUMBER_VERIFICATION_LETTER"] = "einVerificationLetter";
18460
+ ConstitutionalDocumentTypes2["BUSINESS_REGISTRATION_DOCUMENT"] = "businessRegistrationDocument";
18424
18461
  ConstitutionalDocumentTypes2["TRUST_DEED"] = "trustDeed";
18425
18462
  ConstitutionalDocumentTypes2["TRUST_INSTRUMENT"] = "trustInstrument";
18426
18463
  return ConstitutionalDocumentTypes2;
18427
18464
  })(ConstitutionalDocumentTypes || {});
18428
- const ConstitutionDocumentTypeOptionsMapping = {
18429
- [LegalEntityType.SOLE_PROPRIETORSHIP]: [{
18430
- id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
18431
- name: "doingBusinessAsNameFiling"
18432
- }, {
18433
- id: ConstitutionalDocumentTypes.TAX_FILING,
18434
- name: "taxFiling"
18435
- }],
18436
- [LegalEntityType.TRUST]: [{
18437
- id: ConstitutionalDocumentTypes.TRUST_DEED,
18438
- name: "trustDeed"
18439
- }, {
18440
- id: ConstitutionalDocumentTypes.TRUST_INSTRUMENT,
18441
- name: "trustInstrument"
18442
- }]
18465
+ const getConstitutionDocumentTypeOptionsMapping = (legalEntityType, country2) => {
18466
+ switch (legalEntityType) {
18467
+ case LegalEntityType.SOLE_PROPRIETORSHIP:
18468
+ switch (country2) {
18469
+ case "FR":
18470
+ return [{
18471
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
18472
+ name: "doingBusinessAsNameFiling__FR"
18473
+ }, {
18474
+ id: ConstitutionalDocumentTypes.TAX_FILING,
18475
+ name: "taxFiling"
18476
+ }, {
18477
+ id: ConstitutionalDocumentTypes.BUSINESS_REGISTRATION_DOCUMENT,
18478
+ name: "businessRegistrationDocument__FR"
18479
+ }];
18480
+ case "US":
18481
+ return [{
18482
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
18483
+ name: "doingBusinessAsNameFiling__US"
18484
+ }, {
18485
+ id: ConstitutionalDocumentTypes.TAX_FILING,
18486
+ name: "taxFiling__US"
18487
+ }, {
18488
+ id: ConstitutionalDocumentTypes.EMPLOYER_IDENTIFICATION_NUMBER_VERIFICATION_LETTER,
18489
+ name: "einVerificationLetter"
18490
+ }];
18491
+ default:
18492
+ return [{
18493
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
18494
+ name: "doingBusinessAsNameFiling"
18495
+ }, {
18496
+ id: ConstitutionalDocumentTypes.TAX_FILING,
18497
+ name: "taxFiling"
18498
+ }];
18499
+ }
18500
+ default:
18501
+ return [{
18502
+ id: ConstitutionalDocumentTypes.TRUST_DEED,
18503
+ name: "trustDeed"
18504
+ }, {
18505
+ id: ConstitutionalDocumentTypes.TRUST_INSTRUMENT,
18506
+ name: "trustInstrument"
18507
+ }];
18508
+ }
18443
18509
  };
18444
- function ConstitutionalDocumentComponent({
18510
+ function ConstitutionalDocumentUpload({
18445
18511
  id: id2,
18446
18512
  legalEntityType,
18447
18513
  ...props
@@ -18450,27 +18516,24 @@ function ConstitutionalDocumentComponent({
18450
18516
  const {
18451
18517
  i18n
18452
18518
  } = useI18nContext();
18453
- const guidanceContent = jsxs(Fragment, {
18454
- children: [jsx("div", {
18519
+ const guidanceContent = jsxs("div", {
18520
+ className: "adyen-kyc-upload-field__guidance",
18521
+ children: [jsx("strong", {
18455
18522
  className: "adyen-kyc-upload-field__subtitle",
18456
- children: i18n.get("uploadOneOfTheFollowing")
18523
+ children: i18n.get("uploadOneOfTheseDocuments")
18457
18524
  }), jsx(List, {
18458
18525
  className: "adl-u-margin-left-8",
18459
- children: (_a = ConstitutionDocumentTypeOptionsMapping[legalEntityType]) == null ? void 0 : _a.map(({
18526
+ children: (_a = getConstitutionDocumentTypeOptionsMapping(legalEntityType, props.country)) == null ? void 0 : _a.map(({
18460
18527
  id: id22,
18461
18528
  name
18462
18529
  }) => jsx(ListItem, {
18463
18530
  children: i18n.get(name)
18464
18531
  }, id22))
18465
- }), jsxs("div", {
18532
+ }), jsx("div", {
18466
18533
  className: "adl-u-margin-y-16",
18467
- children: [jsxs("span", {
18534
+ children: jsxs("span", {
18468
18535
  children: [i18n.get("documentIssuedWithinLastYear"), " "]
18469
- }), jsx(Link, {
18470
- href: "https://docs.adyen.com/marketplaces-and-platforms/required-kyc-information/document-requirements#constitutional-doc",
18471
- external: true,
18472
- children: i18n.get("learnMore")
18473
- })]
18536
+ })
18474
18537
  })]
18475
18538
  });
18476
18539
  return jsx("div", {
@@ -18478,13 +18541,14 @@ function ConstitutionalDocumentComponent({
18478
18541
  ...props,
18479
18542
  documentType: DocumentType.CONSTITUTIONAL_DOCUMENT,
18480
18543
  documentField: "constitutionalDocument",
18481
- heading: i18n.get("constitutionalDocument"),
18544
+ heading: i18n.get("constitutionalDocument__header"),
18545
+ description: i18n.get("constitutionalDocument__headerDescription"),
18482
18546
  guidanceContent,
18483
18547
  id: id2
18484
18548
  })
18485
18549
  });
18486
18550
  }
18487
- const ConstitutionalDocumentUpload = memo(ConstitutionalDocumentComponent, (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.shouldValidate === nextProps.shouldValidate);
18551
+ const ConstitutionalDocumentComponent = memo(ConstitutionalDocumentUpload, (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.shouldValidate === nextProps.shouldValidate);
18488
18552
  const solePropForms = {
18489
18553
  solePropNameAndCountry: {
18490
18554
  formId: "solePropNameAndCountry",
@@ -18580,10 +18644,11 @@ function SolePropComponent(props) {
18580
18644
  })
18581
18645
  }), jsx("div", {
18582
18646
  className: activeForm.formId !== solePropDocumentFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
18583
- children: jsx(ConstitutionalDocumentUpload, {
18647
+ children: jsx(ConstitutionalDocumentComponent, {
18584
18648
  ...solePropDocumentsFormProps,
18585
18649
  id: solePropDocumentFormId,
18586
- legalEntityType: LegalEntityType.SOLE_PROPRIETORSHIP
18650
+ legalEntityType: LegalEntityType.SOLE_PROPRIETORSHIP,
18651
+ country: props.country
18587
18652
  })
18588
18653
  })]
18589
18654
  });
@@ -19168,10 +19233,11 @@ function TrustComponent(props) {
19168
19233
  })
19169
19234
  }), jsx("div", {
19170
19235
  className: activeForm.formId !== trustConstitutionalDocumentFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
19171
- children: jsx(ConstitutionalDocumentUpload, {
19236
+ children: jsx(ConstitutionalDocumentComponent, {
19172
19237
  ...trustDocumentFormProps,
19173
19238
  id: trustConstitutionalDocumentFormId,
19174
- legalEntityType: LegalEntityType.TRUST
19239
+ legalEntityType: LegalEntityType.TRUST,
19240
+ country: props.country
19175
19241
  })
19176
19242
  })]
19177
19243
  });
@@ -20146,7 +20212,7 @@ const defaultPayoutAccountFormat = {
20146
20212
  [CountryCodes.Sweden]: "local",
20147
20213
  [CountryCodes.UnitedKingdom]: "local"
20148
20214
  };
20149
- const logger$b = createLogger("useScenarioConfiguration");
20215
+ const logger$c = createLogger("useScenarioConfiguration");
20150
20216
  const useScenarioConfiguration = ({
20151
20217
  getConfigurationData,
20152
20218
  getPayoutAccountFormatData,
@@ -20168,12 +20234,12 @@ const useScenarioConfiguration = ({
20168
20234
  const response = await getConfigurationData();
20169
20235
  setConfigurationResponse(response);
20170
20236
  } catch (err) {
20171
- logger$b.warn("WARNING: Configuration request failed - error:", err);
20237
+ logger$c.warn("WARNING: Configuration request failed - error:", err);
20172
20238
  } finally {
20173
20239
  setLoadingStatus("success");
20174
20240
  }
20175
20241
  };
20176
- makeConfigCallAndSave().catch(logger$b.error);
20242
+ makeConfigCallAndSave().catch(logger$c.error);
20177
20243
  }, [getConfigurationData, setLoadingStatus]);
20178
20244
  useEffect(() => {
20179
20245
  setLoadingStatus("loading");
@@ -20189,12 +20255,12 @@ const useScenarioConfiguration = ({
20189
20255
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
20190
20256
  setAccountFormat(defaultAccountFormat);
20191
20257
  } catch (err) {
20192
- logger$b.warn("WARNING: Payout format request failed - error:", err);
20258
+ logger$c.warn("WARNING: Payout format request failed - error:", err);
20193
20259
  } finally {
20194
20260
  setLoadingStatus("success");
20195
20261
  }
20196
20262
  };
20197
- makePayoutFormatCallAndSave().catch(logger$b.error);
20263
+ makePayoutFormatCallAndSave().catch(logger$c.error);
20198
20264
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus]);
20199
20265
  const {
20200
20266
  fieldConfigurations,
@@ -20856,7 +20922,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
20856
20922
  return ToastType2;
20857
20923
  })(ToastType || {});
20858
20924
  const FormComposer = "";
20859
- const logger$a = createLogger("FormRouterContextProvider");
20925
+ const logger$b = createLogger("FormRouterContextProvider");
20860
20926
  function FormRouterContextProvider({
20861
20927
  children,
20862
20928
  forms,
@@ -20876,7 +20942,7 @@ function FormRouterContextProvider({
20876
20942
  if (formIndex > -1) {
20877
20943
  setFormIndex(formIndex);
20878
20944
  } else {
20879
- logger$a.error("No form was found to have that field so form navigation failed.");
20945
+ logger$b.error("No form was found to have that field so form navigation failed.");
20880
20946
  }
20881
20947
  }
20882
20948
  }), [forms, handleGetIdVerificationToken, setFormIndex]);
@@ -21479,7 +21545,7 @@ function CompanyDropinComponent({
21479
21545
  })
21480
21546
  });
21481
21547
  }
21482
- const logger$9 = createLogger("useLocalStorage");
21548
+ const logger$a = createLogger("useLocalStorage");
21483
21549
  const useLocalStorage = (key, defaultValue, options) => {
21484
21550
  const {
21485
21551
  serializer,
@@ -21500,7 +21566,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21500
21566
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
21501
21567
  return res;
21502
21568
  } catch (err) {
21503
- logger$9.error(err);
21569
+ logger$a.error(err);
21504
21570
  return defaultValue;
21505
21571
  }
21506
21572
  });
@@ -21532,7 +21598,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21532
21598
  try {
21533
21599
  updateLocalStorage();
21534
21600
  } catch (err) {
21535
- logger$9.error(err);
21601
+ logger$a.error(err);
21536
21602
  }
21537
21603
  }, [value]);
21538
21604
  useEffect(() => {
@@ -21547,7 +21613,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21547
21613
  setValue(event.newValue ? parser(event.newValue) : void 0);
21548
21614
  }
21549
21615
  } catch (err) {
21550
- logger$9.error(err);
21616
+ logger$a.error(err);
21551
21617
  }
21552
21618
  };
21553
21619
  if (typeof window === "undefined")
@@ -21570,9 +21636,6 @@ const useHasSeenIntroduction = ({
21570
21636
  const useLegalEntityType = ({
21571
21637
  legalEntity
21572
21638
  }) => {
21573
- const {
21574
- isExperimentEnabled
21575
- } = useExperimentsContext();
21576
21639
  const isTrust = isPartOfTrustFromLegalEntity(legalEntity);
21577
21640
  const isSoleProprietor = hasSolePropInLegalEntity(legalEntity);
21578
21641
  const hasLegalAssociation = isTrust || isSoleProprietor;
@@ -21584,7 +21647,7 @@ const useLegalEntityType = ({
21584
21647
  if (isSoleProprietor)
21585
21648
  return LegalEntityType.SOLE_PROPRIETORSHIP;
21586
21649
  if (isTrust)
21587
- return isExperimentEnabled(ExperimentNames.EnableTrustFlow) ? LegalEntityType.TRUST : legalEntity.type;
21650
+ return LegalEntityType.TRUST;
21588
21651
  break;
21589
21652
  default:
21590
21653
  return void 0;
@@ -21631,7 +21694,7 @@ const useShouldShowBusinessTypeSelection = (accountHolder2) => {
21631
21694
  } = useExperimentsContext();
21632
21695
  return isExperimentEnabled("EnableNewEntryFlow") && !accountHolder2;
21633
21696
  };
21634
- const logger$8 = createLogger("useExemptSettlor");
21697
+ const logger$9 = createLogger("useExemptSettlor");
21635
21698
  const useExemptSettlor = ({
21636
21699
  trust: trust2,
21637
21700
  handleGetLegalEntity
@@ -21645,7 +21708,7 @@ const useExemptSettlor = ({
21645
21708
  useEffect(() => {
21646
21709
  if (!trust2)
21647
21710
  return;
21648
- updateExemptSettlor(trust2).catch(logger$8.error);
21711
+ updateExemptSettlor(trust2).catch(logger$9.error);
21649
21712
  }, [trust2, updateExemptSettlor]);
21650
21713
  return exemptSettlor;
21651
21714
  };
@@ -22163,13 +22226,21 @@ const mapLegalArrangementOptionToCompanyTypesValue = (legalArrangement) => {
22163
22226
  return "";
22164
22227
  }
22165
22228
  };
22166
- const mapCompanyTypesValueToLegalArrangementOption = (companyTypesValue) => {
22167
- switch (companyTypesValue) {
22168
- case CompanyTypesValue.INCORPORATED_PARTNERSHIP:
22169
- return "partnershipIncorporated";
22170
- default:
22171
- return void 0;
22229
+ const getDefaultLegalArrangementOrSuborganizationType = (legalEntityResponse) => {
22230
+ var _a;
22231
+ const entityAssociations = legalEntityResponse == null ? void 0 : legalEntityResponse.entityAssociations;
22232
+ const suborganizationType = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
22233
+ if (suborganizationType === CompanyTypesValue.INCORPORATED_PARTNERSHIP) {
22234
+ return "partnershipIncorporated";
22235
+ }
22236
+ if (!entityAssociations || entityAssociations.length === 0) {
22237
+ return void 0;
22238
+ }
22239
+ const trust2 = entityAssociations.find((ea) => ea.entityType === LegalEntityType.TRUST);
22240
+ if (trust2) {
22241
+ return "aTrust";
22172
22242
  }
22243
+ return void 0;
22173
22244
  };
22174
22245
  const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, currentLegalEntityType) => {
22175
22246
  if (businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "company" || businessType === "company") {
@@ -22312,8 +22383,8 @@ const BusinessTypeSelection = ({
22312
22383
  const currentLegalEntityType = legalEntityResponse == null ? void 0 : legalEntityResponse.type;
22313
22384
  const currentCompanyTypesValue = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
22314
22385
  const defaultBusinessType = getBusinessType(businessTypeItems, accountHolder2, legalEntityResponse == null ? void 0 : legalEntityResponse.type, (_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
22315
- const getDefaultLegalArrangementType = () => legalArrangementItems.find((item) => item.id === mapCompanyTypesValueToLegalArrangementOption(currentCompanyTypesValue));
22316
- const defaultLegalArrangementType = getDefaultLegalArrangementType();
22386
+ const getDefaultLegalArrangementSelection = () => legalArrangementItems.find((item) => item.id === getDefaultLegalArrangementOrSuborganizationType(legalEntityResponse));
22387
+ const defaultLegalArrangementType = getDefaultLegalArrangementSelection();
22317
22388
  const defaultTrusteeType = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? trusteeTypeItems[0] : trusteeTypeItems[1];
22318
22389
  const {
22319
22390
  handleChangeFor,
@@ -23818,9 +23889,6 @@ function TaskListComponent({
23818
23889
  i18n
23819
23890
  } = useI18nContext();
23820
23891
  const isEnableNewEntryFlowEnabled = useEnableNewEntryFlow();
23821
- const {
23822
- isExperimentEnabled
23823
- } = useExperimentsContext();
23824
23892
  const canSeeIntroduction = useCanSeeIntroduction({
23825
23893
  legalEntity: legalEntityResponse
23826
23894
  });
@@ -23834,7 +23902,7 @@ function TaskListComponent({
23834
23902
  businessSetup
23835
23903
  } = useBusinessSetup(legalEntityResponse);
23836
23904
  const hasTaskOfGroupAccountDetails = tasks.some((task) => LEGAL_ENTITY_BASE_TASKS.includes(task));
23837
- const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
23905
+ const hasTrust = accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
23838
23906
  const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
23839
23907
  const isCompany = tasks.some((task) => task === TaskTypes.COMPANY);
23840
23908
  const hasSoleProprietorship = accountHolder2 === "mySoleProprietorName" || hasSolePropInLegalEntity(legalEntityResponse);
@@ -25362,12 +25430,41 @@ function Chapter({
25362
25430
  })]
25363
25431
  });
25364
25432
  }
25433
+ const delay = (time) => new Promise((resolve) => {
25434
+ setTimeout(resolve, time);
25435
+ });
25436
+ const ReferenceContext = createContext({
25437
+ references: {},
25438
+ addReference: () => {
25439
+ }
25440
+ });
25441
+ function useReferenceContext() {
25442
+ const context = useContext(ReferenceContext);
25443
+ if (context === void 0) {
25444
+ throw new Error("useReferenceContext must be used within a ReferenceProvider");
25445
+ }
25446
+ return context;
25447
+ }
25448
+ const formatId = (id2) => {
25449
+ if (!id2)
25450
+ return;
25451
+ const strippedId = id2.replace(/[^\w-]/g, "");
25452
+ return `document-viewer-${strippedId}`;
25453
+ };
25365
25454
  function InternalReference({
25366
- referencedLabel,
25455
+ referencedLabel: originalReferencedLabel,
25367
25456
  displayText
25368
25457
  }) {
25458
+ const referencedLabel = formatId(originalReferencedLabel) ?? "";
25369
25459
  const label = displayText ? displayText.content : referencedLabel;
25370
- const scrollIntoView = () => {
25460
+ const {
25461
+ references
25462
+ } = useReferenceContext();
25463
+ const scrollIntoView = async () => {
25464
+ if (references && referencedLabel && references[referencedLabel]) {
25465
+ references[referencedLabel].openSection();
25466
+ await delay(150);
25467
+ }
25371
25468
  const scrollParent = getScrollParent(document.getElementById(referencedLabel));
25372
25469
  const element = scrollParent == null ? void 0 : scrollParent.querySelector(`#${referencedLabel}`);
25373
25470
  element == null ? void 0 : element.scrollIntoView({
@@ -25417,14 +25514,62 @@ function Paragraph({
25417
25514
  });
25418
25515
  }
25419
25516
  const Section$1 = "";
25517
+ const extractLabels = (contentElements) => {
25518
+ if (!contentElements || !Array.isArray(contentElements))
25519
+ return [];
25520
+ return contentElements.flatMap((element) => {
25521
+ if ("type" in element) {
25522
+ switch (element.type) {
25523
+ case ElementTypes.Section:
25524
+ case ElementTypes.Table:
25525
+ return "label" in element ? [element.label] : [];
25526
+ default:
25527
+ return [];
25528
+ }
25529
+ }
25530
+ if ("contentElements" in element) {
25531
+ return extractLabels(element.contentElements);
25532
+ }
25533
+ return [];
25534
+ });
25535
+ };
25420
25536
  function Section({
25421
25537
  title,
25422
- label,
25538
+ label: originalLabel,
25423
25539
  isTopLevel,
25424
25540
  contentElements
25425
25541
  }) {
25542
+ const [isOpen, setIsOpen] = useState(false);
25543
+ const {
25544
+ addReference
25545
+ } = useReferenceContext();
25546
+ const label = formatId(originalLabel);
25547
+ useEffect(() => {
25548
+ if (isTopLevel) {
25549
+ const references = extractLabels(contentElements).map(formatId);
25550
+ if (label) {
25551
+ references.push(label);
25552
+ }
25553
+ if (references.length) {
25554
+ references.forEach((reference) => {
25555
+ addReference({
25556
+ [reference]: {
25557
+ openSection: () => setIsOpen(true)
25558
+ }
25559
+ });
25560
+ });
25561
+ }
25562
+ }
25563
+ }, []);
25426
25564
  return isTopLevel ? jsx(AccordionItem, {
25427
25565
  title: title.content,
25566
+ open: isOpen,
25567
+ onOpen: () => {
25568
+ setIsOpen(true);
25569
+ },
25570
+ onClose: () => {
25571
+ setIsOpen(false);
25572
+ },
25428
25573
  children: jsx("section", {
25429
25574
  className: "adyen-kyc-section-box",
25430
25575
  id: label,
@@ -25449,12 +25594,13 @@ function Section({
25449
25594
  const _table_component = "";
25450
25595
  function Table({
25451
25596
  rows,
25452
- label,
25597
+ label: originalLabel,
25453
25598
  captions,
25454
25599
  titlePrefix,
25455
25600
  title
25456
25601
  }) {
25457
25602
  const id2 = useId$1();
25603
+ const label = formatId(originalLabel);
25458
25604
  return jsxs("div", {
25459
25605
  id: label,
25460
25606
  children: [jsxs("div", {
@@ -25585,26 +25731,46 @@ function ContentElements({
25585
25731
  children: elements
25586
25732
  });
25587
25733
  }
25734
+ function ReferenceContextProvider({
25735
+ children
25736
+ }) {
25737
+ const [references, setReferences] = useState({});
25738
+ const contextValue = useMemo(() => ({
25739
+ addReference: (reference) => {
25740
+ setReferences((prevReferences) => ({
25741
+ ...prevReferences,
25742
+ ...reference
25743
+ }));
25744
+ },
25745
+ references
25746
+ }), [references, setReferences]);
25747
+ return jsx(ReferenceContext.Provider, {
25748
+ value: contextValue,
25749
+ children
25750
+ });
25751
+ }
25588
25752
  function ContractViewer({
25589
25753
  contract,
25590
25754
  className,
25591
25755
  onExpandSection
25592
25756
  }) {
25593
25757
  const classNames = cx("adyen-contract-viewer", className);
25594
- return jsxs("main", {
25595
- className: classNames,
25596
- children: [jsx(Heading, {
25597
- level: 1,
25598
- className: "adl-u-margin-top-24 adl-u-margin-bottom-16",
25599
- children: jsx(Text, {
25600
- content: contract.title.content,
25601
- styles: contract.title.styles
25602
- })
25603
- }), jsx(ContentElements, {
25604
- contentElements: contract.contentElements,
25605
- onExpandSection,
25606
- isTopLevel: true
25607
- })]
25758
+ return jsx(ReferenceContextProvider, {
25759
+ children: jsxs("main", {
25760
+ className: classNames,
25761
+ children: [jsx(Heading, {
25762
+ level: 1,
25763
+ className: "adl-u-margin-top-24 adl-u-margin-bottom-16",
25764
+ children: jsx(Text, {
25765
+ content: contract.title.content,
25766
+ styles: contract.title.styles
25767
+ })
25768
+ }), jsx(ContentElements, {
25769
+ contentElements: contract.contentElements,
25770
+ onExpandSection,
25771
+ isTopLevel: true
25772
+ })]
25773
+ })
25608
25774
  });
25609
25775
  }
25610
25776
  const pciValidationRules = {
@@ -26470,7 +26636,7 @@ const serviceAgreementValidationRules = {
26470
26636
  errorMessage: "fieldIsRequired"
26471
26637
  }
26472
26638
  };
26473
- const logger$7 = createLogger("useServiceAgreement");
26639
+ const logger$8 = createLogger("useServiceAgreement");
26474
26640
  const FALLBACK_LANGUAGE_CODE = "en";
26475
26641
  const useServiceAgreement = ({
26476
26642
  handleGetServiceAgreement,
@@ -26499,7 +26665,7 @@ const useServiceAgreement = ({
26499
26665
  language: agreementLanguage
26500
26666
  });
26501
26667
  if (!document2) {
26502
- logger$7.log('"document" field was missing in response');
26668
+ logger$8.log('"document" field was missing in response');
26503
26669
  return;
26504
26670
  }
26505
26671
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -26517,7 +26683,7 @@ const useServiceAgreement = ({
26517
26683
  throw err;
26518
26684
  }
26519
26685
  };
26520
- requestServiceAgreement().catch(logger$7.error);
26686
+ requestServiceAgreement().catch(logger$8.error);
26521
26687
  }, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
26522
26688
  return {
26523
26689
  loading: loading2,
@@ -27860,7 +28026,7 @@ function TrustDropinComponent(props) {
27860
28026
  }
27861
28027
  const PAGES_WITH_STATUS = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
27862
28028
  const POLLING_INTERVAL = 3e3;
27863
- const logger$6 = createLogger("DropinComposerComponent");
28029
+ const logger$7 = createLogger("DropinComposerComponent");
27864
28030
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
27865
28031
  function DropinComposerComponent({
27866
28032
  capabilities,
@@ -27930,7 +28096,7 @@ function DropinComposerComponent({
27930
28096
  const [capabilityProblems, setCapabilityProblems] = useState(getCapabilityProblems(legalEntityResponse));
27931
28097
  const [bankVerificationVendors, setBankVerificationVendors] = useState();
27932
28098
  const rootLegalEntityCountry = rootLegalEntity.type === LegalEntityType.INDIVIDUAL ? (_a = rootLegalEntity.individual.residentialAddress) == null ? void 0 : _a.country : (_b = rootLegalEntity.organization.registeredAddress) == null ? void 0 : _b.country;
27933
- const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
28099
+ const hasTrust = accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
27934
28100
  const reviewRequired = (rootLegalEntity == null ? void 0 : rootLegalEntity.id) && ((_d = (_c = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _c[rootLegalEntity.id]) == null ? void 0 : _d.isReviewRequired);
27935
28101
  const additionalSalesChannels = useSalesChannelsSettings();
27936
28102
  const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), trust2 == null ? void 0 : trust2.trust.countryOfGoverningLaw);
@@ -27953,7 +28119,7 @@ function DropinComposerComponent({
27953
28119
  setPciStatus(response);
27954
28120
  return response;
27955
28121
  } catch (e) {
27956
- logger$6.warn(i18n.get("failedToGetPciStatus"));
28122
+ logger$7.warn(i18n.get("failedToGetPciStatus"));
27957
28123
  }
27958
28124
  }
27959
28125
  return void 0;
@@ -27982,7 +28148,7 @@ function DropinComposerComponent({
27982
28148
  useEffect(() => {
27983
28149
  if (!tasks.includes(TaskTypes.PCI_DSS))
27984
28150
  return;
27985
- getPciTemplate().catch(logger$6.error);
28151
+ getPciTemplate().catch(logger$7.error);
27986
28152
  }, [getPciTemplate, tasks]);
27987
28153
  const getServiceAgreementAcceptanceInfos = async () => {
27988
28154
  if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
@@ -27990,7 +28156,7 @@ function DropinComposerComponent({
27990
28156
  const response = await args.handleGetServiceAgreementAcceptanceInfos(rootLegalEntity.id);
27991
28157
  setServiceAgreementAcceptanceInfos(response.data);
27992
28158
  } catch (e) {
27993
- logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
28159
+ logger$7.warn(i18n.get("failedToGetServiceAgreementStatus"));
27994
28160
  }
27995
28161
  }
27996
28162
  };
@@ -28000,7 +28166,7 @@ function DropinComposerComponent({
28000
28166
  const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
28001
28167
  setServiceAgreementTypes(response.termsOfServiceTypes);
28002
28168
  } catch (e) {
28003
- logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
28169
+ logger$7.warn(i18n.get("failedToGetServiceAgreementStatus"));
28004
28170
  }
28005
28171
  }
28006
28172
  };
@@ -28039,7 +28205,7 @@ function DropinComposerComponent({
28039
28205
  setCapabilityProblems(getCapabilityProblems(response));
28040
28206
  return response;
28041
28207
  } catch (e) {
28042
- logger$6.warn(i18n.get("failedToFetchLegalEntityDetails"));
28208
+ logger$7.warn(i18n.get("failedToFetchLegalEntityDetails"));
28043
28209
  }
28044
28210
  }
28045
28211
  return void 0;
@@ -28051,7 +28217,7 @@ function DropinComposerComponent({
28051
28217
  setTrust(response);
28052
28218
  return response;
28053
28219
  } catch (e) {
28054
- logger$6.warn(i18n.get("failedToFetchTrustDetails"));
28220
+ logger$7.warn(i18n.get("failedToFetchTrustDetails"));
28055
28221
  }
28056
28222
  }
28057
28223
  return void 0;
@@ -28101,7 +28267,7 @@ function DropinComposerComponent({
28101
28267
  label: i18n.get("successFullyRemovedTrustMember")
28102
28268
  });
28103
28269
  } catch (err) {
28104
- logger$6.error(`Failed to delete trust member`, err);
28270
+ logger$7.error(`Failed to delete trust member`, err);
28105
28271
  showToast({
28106
28272
  type: ToastType.ERROR,
28107
28273
  label: i18n.get("failedToRemoveTrustMember")
@@ -28171,7 +28337,7 @@ function DropinComposerComponent({
28171
28337
  }
28172
28338
  break;
28173
28339
  default:
28174
- logger$6.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
28340
+ logger$7.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
28175
28341
  }
28176
28342
  showToast({
28177
28343
  label: i18n.get("successfullyUpdatedDetails"),
@@ -28179,7 +28345,7 @@ function DropinComposerComponent({
28179
28345
  });
28180
28346
  await refreshTrustAndRunOnSubmit(trust2, 1);
28181
28347
  } catch (err) {
28182
- logger$6.error(err);
28348
+ logger$7.error(err);
28183
28349
  showToast({
28184
28350
  label: i18n.get("failedToUpdateDetails"),
28185
28351
  type: ToastType.ERROR
@@ -28402,7 +28568,7 @@ function DropinComposerComponent({
28402
28568
  }
28403
28569
  };
28404
28570
  setIsLoadingConfiguration(true);
28405
- fetchConfiguration().catch(logger$6.error).finally(() => {
28571
+ fetchConfiguration().catch(logger$7.error).finally(() => {
28406
28572
  setIsLoadingConfiguration(false);
28407
28573
  onLoad();
28408
28574
  });
@@ -28447,7 +28613,7 @@ function DropinComposerComponent({
28447
28613
  ...args,
28448
28614
  legalEntityResponse: rootLegalEntity,
28449
28615
  accountHolder: accountHolder2,
28450
- showTrustOption: isExperimentEnabled("EnableTrustFlow") && TRUST_COUNTRIES.includes(rootLegalEntityCountry),
28616
+ showTrustOption: TRUST_COUNTRIES.includes(rootLegalEntityCountry),
28451
28617
  showSolePropOption: SOLE_PROP_COUNTRIES.includes(rootLegalEntityCountry),
28452
28618
  onAccountHolderSelect: async (newAccountHolder) => {
28453
28619
  setAccountHolder(newAccountHolder);
@@ -29009,6 +29175,38 @@ const createTrustedTransferInstrument = async (context, code2, state2) => {
29009
29175
  state: state2
29010
29176
  });
29011
29177
  };
29178
+ const getAddress = async (context, addressId) => {
29179
+ const {
29180
+ loadingContext,
29181
+ legalEntityId
29182
+ } = context;
29183
+ return httpGet({
29184
+ loadingContext,
29185
+ errorLevel: "warn",
29186
+ errorMessage: `Failed to find address`,
29187
+ path: `${legalEntityId}/addresses/${addressId}`,
29188
+ authentication: "jwt",
29189
+ headers: {
29190
+ "Content-Type": "application/json"
29191
+ }
29192
+ });
29193
+ };
29194
+ const getIdverificationToken = async (context, request) => {
29195
+ const {
29196
+ loadingContext,
29197
+ legalEntityId
29198
+ } = context;
29199
+ return httpPost({
29200
+ loadingContext,
29201
+ errorLevel: "warn",
29202
+ errorMessage: `Failed to find address`,
29203
+ path: `${legalEntityId}/providers/IdVerification/initiate`,
29204
+ authentication: "jwt",
29205
+ headers: {
29206
+ "Content-Type": "application/json"
29207
+ }
29208
+ }, request);
29209
+ };
29012
29210
  const handleBankVerificationError = async (context, errorCode, errorMessage, state2, metadata) => {
29013
29211
  const {
29014
29212
  loadingContext,
@@ -29031,6 +29229,38 @@ const handleBankVerificationError = async (context, errorCode, errorMessage, sta
29031
29229
  metadata
29032
29230
  });
29033
29231
  };
29232
+ const idVerificationStartcheck = async (context, request) => {
29233
+ const {
29234
+ loadingContext,
29235
+ legalEntityId
29236
+ } = context;
29237
+ return httpPost({
29238
+ loadingContext,
29239
+ errorLevel: "warn",
29240
+ errorMessage: `Failed to find address`,
29241
+ path: `${legalEntityId}/providers/IdVerification/process`,
29242
+ authentication: "jwt",
29243
+ headers: {
29244
+ "Content-Type": "application/json"
29245
+ }
29246
+ }, request);
29247
+ };
29248
+ const searchAddress = async (context, address2) => {
29249
+ const {
29250
+ loadingContext,
29251
+ legalEntityId
29252
+ } = context;
29253
+ return httpPost({
29254
+ loadingContext,
29255
+ errorLevel: "warn",
29256
+ errorMessage: `Failed to search address`,
29257
+ path: `${legalEntityId}/addresses`,
29258
+ authentication: "jwt",
29259
+ headers: {
29260
+ "Content-Type": "application/json"
29261
+ }
29262
+ }, address2);
29263
+ };
29034
29264
  const COMPONENTS_API_VERSION = "v1";
29035
29265
  const useComponentApi = (rootLegalEntityId) => {
29036
29266
  const authContext = useAuthContext();
@@ -29068,7 +29298,11 @@ const useComponentApi = (rootLegalEntityId) => {
29068
29298
  createTransferInstrument: async (transferInstrument) => createTransferInstrument(baseRequestContext, transferInstrument),
29069
29299
  updateTransferInstrument: async (transferInstrument, transferInstrumentId) => updateTransferInstrument(baseRequestContext, transferInstrument, transferInstrumentId),
29070
29300
  createTrustedTransferInstrument: async (code2, state2) => createTrustedTransferInstrument(baseRequestContext, code2, state2),
29071
- handleBankVerificationError: async (errorCode, errorMessage, state2, metadata) => handleBankVerificationError(baseRequestContext, errorCode, errorMessage, state2, metadata)
29301
+ handleBankVerificationError: async (errorCode, errorMessage, state2, metadata) => handleBankVerificationError(baseRequestContext, errorCode, errorMessage, state2, metadata),
29302
+ searchAddress: async (address2) => searchAddress(baseRequestContext, address2),
29303
+ getAddress: async (address2) => getAddress(baseRequestContext, address2),
29304
+ getIdVerificationToken: async (legalEntityId, data) => getIdverificationToken(baseRequestContext, data),
29305
+ idVerificationStartCheck: async (legalEntityId, data) => idVerificationStartcheck(baseRequestContext, data)
29072
29306
  };
29073
29307
  }, [base, rootLegalEntityId]);
29074
29308
  };
@@ -29091,7 +29325,7 @@ class EventEmitter {
29091
29325
  };
29092
29326
  }
29093
29327
  }
29094
- const logger$5 = createLogger("CreateIndividualComponent");
29328
+ const logger$6 = createLogger("CreateIndividualComponent");
29095
29329
  function CreateIndividualComponent({
29096
29330
  parentLegalEntityId,
29097
29331
  legalEntityId,
@@ -29109,7 +29343,11 @@ function CreateIndividualComponent({
29109
29343
  updateLegalEntity: updateLegalEntity2,
29110
29344
  getDocument: getDocument2,
29111
29345
  createDocument: createDocument2,
29112
- updateDocument: updateDocument2
29346
+ updateDocument: updateDocument2,
29347
+ searchAddress: searchAddress2,
29348
+ getAddress: getAddress2,
29349
+ getIdVerificationToken,
29350
+ idVerificationStartCheck
29113
29351
  } = useComponentApi(legalEntityId ?? parentLegalEntityId);
29114
29352
  const [legalEntity, setLegalEntity] = useState();
29115
29353
  const [parentLegalEntity, setParentLegalEntity] = useState();
@@ -29120,13 +29358,13 @@ function CreateIndividualComponent({
29120
29358
  setParentLegalEntity(parentEntity);
29121
29359
  setLegalEntity(entity);
29122
29360
  } catch (error) {
29123
- logger$5.error(error);
29361
+ logger$6.error(error);
29124
29362
  } finally {
29125
29363
  setLoadingStatus("success");
29126
29364
  }
29127
29365
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
29128
29366
  useEffect(() => {
29129
- fetchLegalEntity().catch(logger$5.error);
29367
+ fetchLegalEntity().catch(logger$6.error);
29130
29368
  }, [fetchLegalEntity]);
29131
29369
  return loadingStatus === "loading" ? jsx(Loader, {
29132
29370
  size: "medium"
@@ -29139,13 +29377,17 @@ function CreateIndividualComponent({
29139
29377
  handleUpdateDocument: updateDocument2,
29140
29378
  handleUpdateLegalEntity: updateLegalEntity2,
29141
29379
  handleCreateLegalEntity: createLegalEntity2,
29380
+ handleFindAddress: getAddress2,
29381
+ handleAddressSearch: searchAddress2,
29382
+ handleGetIdVerificationToken: getIdVerificationToken,
29383
+ handleGetIdVerificationStartCheck: idVerificationStartCheck,
29142
29384
  handleBackClick,
29143
29385
  hideNavigation: true,
29144
29386
  onSubmit: onSubmitSuccess,
29145
29387
  taskType
29146
29388
  });
29147
29389
  }
29148
- const logger$4 = createLogger("CreateTransferInstrumentComponent");
29390
+ const logger$5 = createLogger("CreateTransferInstrumentComponent");
29149
29391
  function CreateTransferInstrumentComponent({
29150
29392
  legalEntityId,
29151
29393
  transferInstrumentId,
@@ -29179,7 +29421,7 @@ function CreateTransferInstrumentComponent({
29179
29421
  const ti = await getTransferInstrument2(transferInstrumentId);
29180
29422
  setTransferInstrument(ti);
29181
29423
  }
29182
- })().catch(logger$4.error);
29424
+ })().catch(logger$5.error);
29183
29425
  }, [transferInstrumentId, fetchLegalEntity]);
29184
29426
  return legalEntity ? jsx(PayoutDetailsDropinComponent, {
29185
29427
  eventEmitter: eventEmitter ?? new EventEmitter(),
@@ -29281,6 +29523,60 @@ const getSupportedCountries = async (context) => {
29281
29523
  }
29282
29524
  });
29283
29525
  };
29526
+ const validatePhoneNumber$1 = async (context, phoneNumber2) => {
29527
+ const {
29528
+ loadingContext,
29529
+ legalEntityId
29530
+ } = context;
29531
+ return httpPost({
29532
+ loadingContext,
29533
+ authentication: "jwt",
29534
+ errorLevel: "warn",
29535
+ errorMessage: "Phone validation is not available",
29536
+ path: `${legalEntityId}/validations/phonenumber`
29537
+ }, {
29538
+ number: phoneNumber2
29539
+ });
29540
+ };
29541
+ const logger$4 = createLogger("verify-id-number");
29542
+ const verifyIdNumber$1 = async (context, request) => {
29543
+ const {
29544
+ loadingContext,
29545
+ legalEntityId
29546
+ } = context;
29547
+ try {
29548
+ return await httpPost({
29549
+ loadingContext,
29550
+ errorLevel: "warn",
29551
+ errorMessage: `Id number verification is not available`,
29552
+ path: `${legalEntityId}/verifications/idNumber`,
29553
+ authentication: "jwt",
29554
+ headers: {
29555
+ "Content-Type": "application/json"
29556
+ },
29557
+ // Handler for unhappy flows, i.e. status != 200, in the idNumber verification process
29558
+ errorHandler: async (response) => {
29559
+ const responseData = await response;
29560
+ if (responseData.status === 422) {
29561
+ return {
29562
+ status: 422,
29563
+ message: responseData.detail,
29564
+ errorCode: responseData.errorCode
29565
+ };
29566
+ }
29567
+ if (responseData.status === 500) {
29568
+ return {
29569
+ status: 500,
29570
+ message: "Service did not respond, do not block verification"
29571
+ };
29572
+ }
29573
+ return logger$4.warn(`Unexpected response status ${responseData.status}`);
29574
+ }
29575
+ }, request);
29576
+ } catch (e) {
29577
+ logger$4.warn("WARNING: idNumber verification failed - error:", e);
29578
+ }
29579
+ };
29284
29580
  const getEmbeddedApi = ({
29285
29581
  base,
29286
29582
  rootLegalEntityId
@@ -29313,12 +29609,8 @@ const getEmbeddedApi = ({
29313
29609
  getImageUrl: () => `${base}static/images/`,
29314
29610
  getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
29315
29611
  getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
29316
- validatePhoneNumber: () => {
29317
- throw new Error("validatePhoneNumber: Not implemented in onboarding component api");
29318
- },
29319
- verifyIdNumber: () => {
29320
- throw new Error("verifyIdNumber: Not implemented in onboarding component api");
29321
- },
29612
+ validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber$1(baseRequestContext, phoneNumber2),
29613
+ verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request),
29322
29614
  companyIndexSearch: () => {
29323
29615
  throw new Error("companyIndexSearch: Not implemented in onboarding component api");
29324
29616
  },