@adyen/kyc-components 3.0.0-beta.25 → 3.0.0-beta.26

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 (23) hide show
  1. package/dist/es/adyen-kyc-components.es.js +333 -143
  2. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  3. package/dist/types/components/internal/ContractViewer/ReferenceContext/ReferenceContext.d.ts +10 -0
  4. package/dist/types/components/internal/ContractViewer/ReferenceContext/ReferenceContextProvider.d.ts +6 -0
  5. package/dist/types/components/internal/ContractViewer/ReferenceContext/useReferenceContext.d.ts +1 -0
  6. package/dist/types/components/internal/ContractViewer/components/InternalReference/InternalReference.d.ts +1 -1
  7. package/dist/types/components/internal/ContractViewer/components/Section/Section.d.ts +1 -1
  8. package/dist/types/components/internal/ContractViewer/components/Table/Table.d.ts +1 -1
  9. package/dist/types/components/internal/ContractViewer/utils/format-id.d.ts +1 -0
  10. package/dist/types/components/internal/Iban/ibanValidator.d.ts +2 -1
  11. package/dist/types/components/internal/Iban/types.d.ts +2 -1
  12. package/dist/types/core/Services/componentApi/get-address.d.ts +3 -0
  13. package/dist/types/core/Services/componentApi/get-idverification-token.d.ts +3 -0
  14. package/dist/types/core/Services/componentApi/idVerification-startcheck.d.ts +3 -0
  15. package/dist/types/core/Services/componentApi/search-address.d.ts +3 -0
  16. package/dist/types/core/Services/componentApi/validate-phone-number.d.ts +3 -0
  17. package/dist/types/core/Services/componentApi/verify-id-number.d.ts +3 -0
  18. package/dist/types/core/hooks/useComponentApi.d.ts +4 -4
  19. package/dist/types/language/config.d.ts +0 -1
  20. package/dist/types/utils/delay.d.ts +1 -0
  21. package/dist/types/utils/entity-status-util.d.ts +1 -1
  22. package/package.json +1 -1
  23. 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";
@@ -745,7 +744,7 @@ const noGoBack = "No, go back";
745
744
  const continueCompany = "Continue as company";
746
745
  const continueIndividual = "Continue as individual";
747
746
  const addManually = "Add manually";
748
- const searchAddress = "Search address";
747
+ const searchAddress$1 = "Search address";
749
748
  const startTypingTheAddress = "Start typing the address";
750
749
  const addresses = "Addresses";
751
750
  const loading = "Loading";
@@ -1235,7 +1234,6 @@ const defaultTrans = {
1235
1234
  invalidFormatForNZDriversLicenseNumber,
1236
1235
  invalidFormatForAuDriversLicenseCardNumber,
1237
1236
  invalidFormatForNZDriversLicenseCardNumber,
1238
- invalidFormatForAuProofOfIdentityCardNumber,
1239
1237
  invalidFormatForHKPassportNumber,
1240
1238
  invalidFormatForHKDriversLicenseNumber,
1241
1239
  invalidFormatForHKIdentityCardNumber,
@@ -1917,7 +1915,7 @@ const defaultTrans = {
1917
1915
  continueCompany,
1918
1916
  continueIndividual,
1919
1917
  addManually,
1920
- searchAddress,
1918
+ searchAddress: searchAddress$1,
1921
1919
  startTypingTheAddress,
1922
1920
  addresses,
1923
1921
  loading,
@@ -3051,7 +3049,7 @@ const createLogger = (namespace) => {
3051
3049
  });
3052
3050
  return methods;
3053
3051
  };
3054
- const logger$q = createLogger("Link");
3052
+ const logger$r = createLogger("Link");
3055
3053
  const getIconClass = (icon, external) => {
3056
3054
  if (external) {
3057
3055
  return "adl-link__icon adyen-kyc-icon-external-link";
@@ -3063,7 +3061,7 @@ const getIconClass = (icon, external) => {
3063
3061
  };
3064
3062
  const isValidLink = (href) => {
3065
3063
  if (href === "#") {
3066
- logger$q.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3064
+ logger$r.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3067
3065
  return false;
3068
3066
  }
3069
3067
  return true;
@@ -3340,14 +3338,14 @@ function useResetGlobalData(caller) {
3340
3338
  }
3341
3339
  }), [dispatch, caller]);
3342
3340
  }
3343
- const logger$p = createLogger("useAllowedCountries");
3341
+ const logger$q = createLogger("useAllowedCountries");
3344
3342
  const useAllowedCountries = () => {
3345
3343
  const {
3346
3344
  getAllowedCountries: getAllowedCountries2
3347
3345
  } = useConfigurationApi();
3348
3346
  const [allowedCountries, setAllowedCountries] = useState();
3349
3347
  useEffect(() => {
3350
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$p.error);
3348
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$q.error);
3351
3349
  }, []);
3352
3350
  return allowedCountries;
3353
3351
  };
@@ -3686,7 +3684,7 @@ class ValidationResult {
3686
3684
  return this.validationResults.filter((result) => result.hasError);
3687
3685
  }
3688
3686
  }
3689
- const logger$o = createLogger("useAsyncValidator");
3687
+ const logger$p = createLogger("useAsyncValidator");
3690
3688
  const useAsyncValidator = (asyncRules) => {
3691
3689
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3692
3690
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3709,7 +3707,7 @@ const useAsyncValidator = (asyncRules) => {
3709
3707
  hasError: !isValid
3710
3708
  }])
3711
3709
  });
3712
- }).catch(logger$o.error);
3710
+ }).catch(logger$p.error);
3713
3711
  }, [asyncRules, clearAsyncValidationResults]);
3714
3712
  return {
3715
3713
  asyncValidationResults,
@@ -5128,7 +5126,7 @@ const Select = ({
5128
5126
  })]
5129
5127
  });
5130
5128
  };
5131
- const logger$n = createLogger("CountryField");
5129
+ const logger$o = createLogger("CountryField");
5132
5130
  const COUNTRY_FIELD = ["country"];
5133
5131
  function CountryField({
5134
5132
  data,
@@ -5151,7 +5149,7 @@ function CountryField({
5151
5149
  dataset: countriesFromApi
5152
5150
  } = useDataset(datasetIdentifier.country);
5153
5151
  useEffect(() => {
5154
- loadFlags2().catch(logger$n.error);
5152
+ loadFlags2().catch(logger$o.error);
5155
5153
  }, [loadFlags2]);
5156
5154
  const countries = countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
5157
5155
  ...item,
@@ -6767,11 +6765,6 @@ function AccordionItem({
6767
6765
  }
6768
6766
  setItems(newItems);
6769
6767
  }
6770
- if (isOpen) {
6771
- onClose();
6772
- } else {
6773
- onOpen();
6774
- }
6775
6768
  };
6776
6769
  useEffect(() => {
6777
6770
  setItems((items2) => [...items2, {
@@ -6791,6 +6784,9 @@ function AccordionItem({
6791
6784
  useEffect(() => {
6792
6785
  if (isOpen) {
6793
6786
  onExpandSection == null ? void 0 : onExpandSection(typeof title === "string" ? title : "");
6787
+ onOpen();
6788
+ } else {
6789
+ onClose();
6794
6790
  }
6795
6791
  }, [isOpen]);
6796
6792
  return jsxs("div", {
@@ -9000,7 +8996,7 @@ const accountHolderValidationRules = {
9000
8996
  }
9001
8997
  };
9002
8998
  const accountHolderFields = ["accountHolder"];
9003
- const logger$m = createLogger("AccountHolder");
8999
+ const logger$n = createLogger("AccountHolder");
9004
9000
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
9005
9001
  switch (legalEntityType) {
9006
9002
  case LegalEntityType.ORGANIZATION: {
@@ -9010,7 +9006,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
9010
9006
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
9011
9007
  }
9012
9008
  default:
9013
- logger$m.error(`No available account holder options for legal entity type '${legalEntityType}'`);
9009
+ logger$n.error(`No available account holder options for legal entity type '${legalEntityType}'`);
9014
9010
  return [];
9015
9011
  }
9016
9012
  }
@@ -9758,7 +9754,7 @@ function Dropzone(props) {
9758
9754
  })]
9759
9755
  });
9760
9756
  }
9761
- const logger$l = createLogger("TextArea");
9757
+ const logger$m = createLogger("TextArea");
9762
9758
  function TextArea(props) {
9763
9759
  const {
9764
9760
  classNameModifiers,
@@ -9779,7 +9775,7 @@ function TextArea(props) {
9779
9775
  } = useI18nContext();
9780
9776
  const [value, setValue] = useState("");
9781
9777
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
9782
- logger$l.error("Error: Form fields that rely on InputBase may not have an onChange property");
9778
+ logger$m.error("Error: Form fields that rely on InputBase may not have an onChange property");
9783
9779
  }
9784
9780
  const handleInput = (e) => {
9785
9781
  var _a;
@@ -10192,7 +10188,7 @@ function FieldContainer(props) {
10192
10188
  }
10193
10189
  return renderField(fieldName);
10194
10190
  }
10195
- const logger$k = createLogger("SearchAddress");
10191
+ const logger$l = createLogger("SearchAddress");
10196
10192
  const SearchAddress = ({
10197
10193
  data,
10198
10194
  legalEntityId,
@@ -10218,7 +10214,7 @@ const SearchAddress = ({
10218
10214
  const response = await handleFindAddress(selectedAddressId);
10219
10215
  autocompleteAddressForm(response);
10220
10216
  } catch (e) {
10221
- logger$k.error(e);
10217
+ logger$l.error(e);
10222
10218
  }
10223
10219
  };
10224
10220
  const onDrilldown = async (selectedAddress) => {
@@ -10230,7 +10226,7 @@ const SearchAddress = ({
10230
10226
  }, legalEntityId);
10231
10227
  setItems((response == null ? void 0 : response.results) || []);
10232
10228
  } catch (e) {
10233
- logger$k.error(e);
10229
+ logger$l.error(e);
10234
10230
  }
10235
10231
  };
10236
10232
  const onChange = (e) => {
@@ -10285,7 +10281,7 @@ const SearchAddress = ({
10285
10281
  setItems([]);
10286
10282
  }
10287
10283
  } catch (e) {
10288
- logger$k.error(e);
10284
+ logger$l.error(e);
10289
10285
  }
10290
10286
  setLoading(false);
10291
10287
  }
@@ -13324,7 +13320,7 @@ const initOnfido = async ({
13324
13320
  language: getOnfidoLocaleConfig(i18n)
13325
13321
  });
13326
13322
  };
13327
- const logger$j = createLogger("IdVerificationComponent");
13323
+ const logger$k = createLogger("IdVerificationComponent");
13328
13324
  function IdVerificationComponent({
13329
13325
  userDetails,
13330
13326
  legalEntityId,
@@ -13357,7 +13353,7 @@ function IdVerificationComponent({
13357
13353
  onIdVerificationError,
13358
13354
  onIdVerificationComplete
13359
13355
  });
13360
- })().catch(logger$j.error);
13356
+ })().catch(logger$k.error);
13361
13357
  return () => {
13362
13358
  if (onfidoSdk.current)
13363
13359
  onfidoSdk.current.tearDown();
@@ -13409,7 +13405,7 @@ function IdDocumentAlreadyUpload(props) {
13409
13405
  })]
13410
13406
  });
13411
13407
  }
13412
- const logger$i = createLogger("IdDocumentInstantVerificationComponent");
13408
+ const logger$j = createLogger("IdDocumentInstantVerificationComponent");
13413
13409
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
13414
13410
  const documentTypeValidationRules = {
13415
13411
  instantIdVerificationData: {
@@ -13491,7 +13487,7 @@ function IdDocumentInstantVerificationComponent(props) {
13491
13487
  userDetails: props.userDetails,
13492
13488
  legalEntityId: props.legalEntityId,
13493
13489
  onIdVerificationComplete: handleIdVerificationComplete,
13494
- onIdVerificationError: logger$i.error
13490
+ onIdVerificationError: logger$j.error
13495
13491
  }), jsxs("div", {
13496
13492
  className: "adyen-kyc-document-upload__manual-upload",
13497
13493
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -14826,8 +14822,6 @@ const auIdentityValidationRules = {
14826
14822
  return PassportNumberPatterns.AU.test(value ?? "");
14827
14823
  case "driversLicense":
14828
14824
  return DriversLicenseNumberPatterns.AU.test(value ?? "");
14829
- case "proofOfIdentityCard":
14830
- return ProofOfIdentityCardPatterns.AU.test(value ?? "");
14831
14825
  default:
14832
14826
  return false;
14833
14827
  }
@@ -14838,8 +14832,6 @@ const auIdentityValidationRules = {
14838
14832
  return "invalidFormatForAuPassportNumber";
14839
14833
  case "driversLicense":
14840
14834
  return "invalidFormatForAuDriversLicenseNumber";
14841
- case "proofOfIdentityCard":
14842
- return "invalidFormatForAuProofOfIdentityCardNumber";
14843
14835
  }
14844
14836
  },
14845
14837
  modes: ["blur"]
@@ -14952,29 +14944,6 @@ const PassportNumber$2 = ({
14952
14944
  placeholder: ""
14953
14945
  })
14954
14946
  });
14955
- const ProofOfIdentityCard$1 = ({
14956
- cardNumber,
14957
- onInput,
14958
- onBlur,
14959
- formUtils: {
14960
- getLabel
14961
- },
14962
- errorMessage,
14963
- isValid
14964
- }) => jsx(Field, {
14965
- name: "cardNumber",
14966
- label: getLabel("idNumber", "proofOfIdentityCardNumber"),
14967
- errorMessage,
14968
- isValid,
14969
- children: (childProps) => jsx(InputText, {
14970
- ...childProps,
14971
- name: "cardNumber",
14972
- value: cardNumber,
14973
- onInput,
14974
- onBlur,
14975
- placeholder: ""
14976
- })
14977
- });
14978
14947
  function IdentityAuComponent(props) {
14979
14948
  var _a;
14980
14949
  if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
@@ -15016,7 +14985,7 @@ function IdentityAuComponent(props) {
15016
14985
  i18n
15017
14986
  } = useI18nContext();
15018
14987
  const formUtils = formUtilities(props, i18n);
15019
- const availableIdentityTypes = ["passport", "driversLicense", "proofOfIdentityCard"];
14988
+ const availableIdentityTypes = ["passport", "driversLicense"];
15020
14989
  const selectedIdentityType = data.typeOfIdentity;
15021
14990
  return jsxs(Fragment, {
15022
14991
  children: [jsx(TypeOfIdentity, {
@@ -15033,13 +15002,6 @@ function IdentityAuComponent(props) {
15033
15002
  formUtils,
15034
15003
  isValid: valid.idNumber,
15035
15004
  errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
15036
- }) : data.typeOfIdentity === "proofOfIdentityCard" ? jsx(ProofOfIdentityCard$1, {
15037
- cardNumber: data.idNumber ?? "",
15038
- onInput: handleChangeFor("idNumber", "input"),
15039
- onBlur: handleChangeFor("idNumber", "blur"),
15040
- formUtils,
15041
- isValid: valid.idNumber,
15042
- errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
15043
15005
  }) : data.typeOfIdentity === "driversLicense" ? jsx(DriversLicense$2, {
15044
15006
  driversLicense: data,
15045
15007
  onIssuerStateChange: handleChangeFor("issuerState"),
@@ -16272,7 +16234,7 @@ class AdyenKycSdkError extends Error {
16272
16234
  }
16273
16235
  let sdkToken;
16274
16236
  let fetchSdkToken;
16275
- const logger$h = createLogger("Session");
16237
+ const logger$i = createLogger("Session");
16276
16238
  const setSdkToken = (token) => {
16277
16239
  sdkToken = token;
16278
16240
  };
@@ -16290,7 +16252,7 @@ const refreshSession = async () => {
16290
16252
  } = await fetchSdkToken();
16291
16253
  setSdkToken(token);
16292
16254
  } catch (e) {
16293
- logger$h.error("Failed to fetch sdk token", e);
16255
+ logger$i.error("Failed to fetch sdk token", e);
16294
16256
  }
16295
16257
  };
16296
16258
  const addAnimationStartListener = (element, listener) => {
@@ -16299,7 +16261,7 @@ const addAnimationStartListener = (element, listener) => {
16299
16261
  const removeAnimationStartListener = (element, listener) => {
16300
16262
  element.removeEventListener("animationstart", listener, false);
16301
16263
  };
16302
- const logger$g = createLogger("Fetch");
16264
+ const logger$h = createLogger("Fetch");
16303
16265
  const getRequestObject = (options, data) => {
16304
16266
  const {
16305
16267
  headers = [],
@@ -16346,10 +16308,10 @@ const logFetchError = (message, level) => {
16346
16308
  case "info":
16347
16309
  case "warn":
16348
16310
  case "error":
16349
- logger$g[level](message);
16311
+ logger$h[level](message);
16350
16312
  break;
16351
16313
  default:
16352
- logger$g.error(message);
16314
+ logger$h.error(message);
16353
16315
  }
16354
16316
  };
16355
16317
  const handleFetchResponse = async (response, responseType) => {
@@ -16447,7 +16409,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
16447
16409
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
16448
16410
  const MOUNT_TIMEOUT = 10 * 1e3;
16449
16411
  const TINK_VENDOR = "Tink";
16450
- const logger$f = createLogger("iframeWidget");
16412
+ const logger$g = createLogger("iframeWidget");
16451
16413
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
16452
16414
  const isTerminalMessageData = (data) => Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
16453
16415
  const parseMessageJson = (message) => {
@@ -16466,7 +16428,7 @@ const callbackErrorHandler = async (response) => {
16466
16428
  try {
16467
16429
  await response;
16468
16430
  } catch (ex) {
16469
- logger$f.error(ex);
16431
+ logger$g.error(ex);
16470
16432
  }
16471
16433
  return {
16472
16434
  error: "UNKNOWN_ERROR",
@@ -16572,7 +16534,7 @@ class IFrameWidget {
16572
16534
  message = responseData.errorMessage;
16573
16535
  }
16574
16536
  } catch (ex) {
16575
- logger$f.error(ex);
16537
+ logger$g.error(ex);
16576
16538
  }
16577
16539
  throw new AdyenKycSdkError(reason, jsonData.error);
16578
16540
  }
@@ -16758,7 +16720,7 @@ function BankVerificationWidget({
16758
16720
  ref: widgetContainerRef
16759
16721
  });
16760
16722
  }
16761
- const logger$e = createLogger("BankVerification");
16723
+ const logger$f = createLogger("BankVerification");
16762
16724
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
16763
16725
  const InstantVerificationErrorContext = createContext(null);
16764
16726
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -16792,7 +16754,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
16792
16754
  const preferredVendor2 = vendors[0];
16793
16755
  setPreferredVendor(preferredVendor2.name ? preferredVendor2 : null);
16794
16756
  };
16795
- getPreferredVendor().catch(logger$e.error);
16757
+ getPreferredVendor().catch(logger$f.error);
16796
16758
  }, [country2, getBankVerificationVendors]);
16797
16759
  return preferredVendor;
16798
16760
  };
@@ -17504,7 +17466,11 @@ const bbanPatternsByCountry = {
17504
17466
  GB: /[A-Z]{4}\d{14}/,
17505
17467
  VG: /[\dA-Z]{4}\d{16}/
17506
17468
  };
17469
+ const regionsWithSharedIbanFormat = {
17470
+ GB: ["GG", "IM", "JE"]
17471
+ };
17507
17472
  function ibanValidator(input, bankCountries) {
17473
+ var _a;
17508
17474
  if (isEmpty(input))
17509
17475
  return "fieldIsRequired";
17510
17476
  const ibanInput = input.replace(/ /g, "").toUpperCase();
@@ -17512,7 +17478,7 @@ function ibanValidator(input, bankCountries) {
17512
17478
  return "validationPleaseEnterAValidIban";
17513
17479
  }
17514
17480
  const countryCode = ibanInput.substring(0, 2);
17515
- if (bankCountries && !bankCountries.includes(countryCode)) {
17481
+ if (bankCountries && !bankCountries.includes(countryCode) && !((_a = regionsWithSharedIbanFormat[countryCode]) == null ? void 0 : _a.includes(bankCountries[0]))) {
17516
17482
  return {
17517
17483
  translationKey: "yourIbanShouldBeginWith_",
17518
17484
  translationObject: {
@@ -18266,7 +18232,7 @@ function PayoutBankStatementComponent(props) {
18266
18232
  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);
18267
18233
  const VerificationMethod = "";
18268
18234
  const hasLoaded = (loadedValue) => loadedValue !== "loading";
18269
- 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];
18235
+ 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];
18270
18236
  const regions = {
18271
18237
  europe: [...eeaCountries, CountryCodes.Switzerland, CountryCodes.UnitedKingdom],
18272
18238
  apac: [CountryCodes.NewZealand, CountryCodes.Australia]
@@ -20528,7 +20494,7 @@ const defaultPayoutAccountFormat = {
20528
20494
  [CountryCodes.Sweden]: "local",
20529
20495
  [CountryCodes.UnitedKingdom]: "local"
20530
20496
  };
20531
- const logger$d = createLogger("useScenarioConfiguration");
20497
+ const logger$e = createLogger("useScenarioConfiguration");
20532
20498
  const useScenarioConfiguration = ({
20533
20499
  getConfigurationData,
20534
20500
  getPayoutAccountFormatData,
@@ -20550,12 +20516,12 @@ const useScenarioConfiguration = ({
20550
20516
  const response = await getConfigurationData();
20551
20517
  setConfigurationResponse(response);
20552
20518
  } catch (err) {
20553
- logger$d.warn("WARNING: Configuration request failed - error:", err);
20519
+ logger$e.warn("WARNING: Configuration request failed - error:", err);
20554
20520
  } finally {
20555
20521
  setLoadingStatus("success");
20556
20522
  }
20557
20523
  };
20558
- makeConfigCallAndSave().catch(logger$d.error);
20524
+ makeConfigCallAndSave().catch(logger$e.error);
20559
20525
  }, [getConfigurationData, setLoadingStatus]);
20560
20526
  useEffect(() => {
20561
20527
  setLoadingStatus("loading");
@@ -20571,12 +20537,12 @@ const useScenarioConfiguration = ({
20571
20537
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
20572
20538
  setAccountFormat(defaultAccountFormat);
20573
20539
  } catch (err) {
20574
- logger$d.warn("WARNING: Payout format request failed - error:", err);
20540
+ logger$e.warn("WARNING: Payout format request failed - error:", err);
20575
20541
  } finally {
20576
20542
  setLoadingStatus("success");
20577
20543
  }
20578
20544
  };
20579
- makePayoutFormatCallAndSave().catch(logger$d.error);
20545
+ makePayoutFormatCallAndSave().catch(logger$e.error);
20580
20546
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus]);
20581
20547
  const {
20582
20548
  fieldConfigurations,
@@ -21238,7 +21204,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
21238
21204
  return ToastType2;
21239
21205
  })(ToastType || {});
21240
21206
  const FormComposer = "";
21241
- const logger$c = createLogger("FormRouterContextProvider");
21207
+ const logger$d = createLogger("FormRouterContextProvider");
21242
21208
  function FormRouterContextProvider({
21243
21209
  children,
21244
21210
  forms,
@@ -21258,7 +21224,7 @@ function FormRouterContextProvider({
21258
21224
  if (formIndex > -1) {
21259
21225
  setFormIndex(formIndex);
21260
21226
  } else {
21261
- logger$c.error("No form was found to have that field so form navigation failed.");
21227
+ logger$d.error("No form was found to have that field so form navigation failed.");
21262
21228
  }
21263
21229
  }
21264
21230
  }), [forms, handleGetIdVerificationToken, setFormIndex]);
@@ -21861,7 +21827,7 @@ function CompanyDropinComponent({
21861
21827
  })
21862
21828
  });
21863
21829
  }
21864
- const logger$b = createLogger("useLocalStorage");
21830
+ const logger$c = createLogger("useLocalStorage");
21865
21831
  const useLocalStorage = (key, defaultValue, options) => {
21866
21832
  const {
21867
21833
  serializer,
@@ -21882,7 +21848,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21882
21848
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
21883
21849
  return res;
21884
21850
  } catch (err) {
21885
- logger$b.error(err);
21851
+ logger$c.error(err);
21886
21852
  return defaultValue;
21887
21853
  }
21888
21854
  });
@@ -21914,7 +21880,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21914
21880
  try {
21915
21881
  updateLocalStorage();
21916
21882
  } catch (err) {
21917
- logger$b.error(err);
21883
+ logger$c.error(err);
21918
21884
  }
21919
21885
  }, [value]);
21920
21886
  useEffect(() => {
@@ -21929,7 +21895,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21929
21895
  setValue(event.newValue ? parser(event.newValue) : void 0);
21930
21896
  }
21931
21897
  } catch (err) {
21932
- logger$b.error(err);
21898
+ logger$c.error(err);
21933
21899
  }
21934
21900
  };
21935
21901
  if (typeof window === "undefined")
@@ -22010,7 +21976,7 @@ const useShouldShowBusinessTypeSelection = (accountHolder2) => {
22010
21976
  } = useExperimentsContext();
22011
21977
  return isExperimentEnabled("EnableNewEntryFlow") && !accountHolder2;
22012
21978
  };
22013
- const logger$a = createLogger("useExemptSettlor");
21979
+ const logger$b = createLogger("useExemptSettlor");
22014
21980
  const useExemptSettlor = ({
22015
21981
  trust: trust2,
22016
21982
  handleGetLegalEntity
@@ -22024,7 +21990,7 @@ const useExemptSettlor = ({
22024
21990
  useEffect(() => {
22025
21991
  if (!trust2)
22026
21992
  return;
22027
- updateExemptSettlor(trust2).catch(logger$a.error);
21993
+ updateExemptSettlor(trust2).catch(logger$b.error);
22028
21994
  }, [trust2, updateExemptSettlor]);
22029
21995
  return exemptSettlor;
22030
21996
  };
@@ -25766,12 +25732,41 @@ function Chapter({
25766
25732
  })]
25767
25733
  });
25768
25734
  }
25735
+ const delay = (time) => new Promise((resolve) => {
25736
+ setTimeout(resolve, time);
25737
+ });
25738
+ const ReferenceContext = createContext({
25739
+ references: {},
25740
+ addReference: () => {
25741
+ }
25742
+ });
25743
+ function useReferenceContext() {
25744
+ const context = useContext(ReferenceContext);
25745
+ if (context === void 0) {
25746
+ throw new Error("useReferenceContext must be used within a ReferenceProvider");
25747
+ }
25748
+ return context;
25749
+ }
25750
+ const formatId = (id2) => {
25751
+ if (!id2)
25752
+ return;
25753
+ const strippedId = id2.replace(/[^\w-]/g, "");
25754
+ return `document-viewer-${strippedId}`;
25755
+ };
25769
25756
  function InternalReference({
25770
- referencedLabel,
25757
+ referencedLabel: originalReferencedLabel,
25771
25758
  displayText
25772
25759
  }) {
25760
+ const referencedLabel = formatId(originalReferencedLabel) ?? "";
25773
25761
  const label = displayText ? displayText.content : referencedLabel;
25774
- const scrollIntoView = () => {
25762
+ const {
25763
+ references
25764
+ } = useReferenceContext();
25765
+ const scrollIntoView = async () => {
25766
+ if (references && referencedLabel && references[referencedLabel]) {
25767
+ references[referencedLabel].openSection();
25768
+ await delay(150);
25769
+ }
25775
25770
  const scrollParent = getScrollParent(document.getElementById(referencedLabel));
25776
25771
  const element = scrollParent == null ? void 0 : scrollParent.querySelector(`#${referencedLabel}`);
25777
25772
  element == null ? void 0 : element.scrollIntoView({
@@ -25821,14 +25816,62 @@ function Paragraph({
25821
25816
  });
25822
25817
  }
25823
25818
  const Section$1 = "";
25819
+ const extractLabels = (contentElements) => {
25820
+ if (!contentElements || !Array.isArray(contentElements))
25821
+ return [];
25822
+ return contentElements.flatMap((element) => {
25823
+ if ("type" in element) {
25824
+ switch (element.type) {
25825
+ case ElementTypes.Section:
25826
+ case ElementTypes.Table:
25827
+ return "label" in element ? [element.label] : [];
25828
+ default:
25829
+ return [];
25830
+ }
25831
+ }
25832
+ if ("contentElements" in element) {
25833
+ return extractLabels(element.contentElements);
25834
+ }
25835
+ return [];
25836
+ });
25837
+ };
25824
25838
  function Section({
25825
25839
  title,
25826
- label,
25840
+ label: originalLabel,
25827
25841
  isTopLevel,
25828
25842
  contentElements
25829
25843
  }) {
25844
+ const [isOpen, setIsOpen] = useState(false);
25845
+ const {
25846
+ addReference
25847
+ } = useReferenceContext();
25848
+ const label = formatId(originalLabel);
25849
+ useEffect(() => {
25850
+ if (isTopLevel) {
25851
+ const references = extractLabels(contentElements).map(formatId);
25852
+ if (label) {
25853
+ references.push(label);
25854
+ }
25855
+ if (references.length) {
25856
+ references.forEach((reference) => {
25857
+ addReference({
25858
+ [reference]: {
25859
+ openSection: () => setIsOpen(true)
25860
+ }
25861
+ });
25862
+ });
25863
+ }
25864
+ }
25865
+ }, []);
25830
25866
  return isTopLevel ? jsx(AccordionItem, {
25831
25867
  title: title.content,
25868
+ open: isOpen,
25869
+ onOpen: () => {
25870
+ setIsOpen(true);
25871
+ },
25872
+ onClose: () => {
25873
+ setIsOpen(false);
25874
+ },
25832
25875
  children: jsx("section", {
25833
25876
  className: "adyen-kyc-section-box",
25834
25877
  id: label,
@@ -25853,12 +25896,13 @@ function Section({
25853
25896
  const _table_component = "";
25854
25897
  function Table({
25855
25898
  rows,
25856
- label,
25899
+ label: originalLabel,
25857
25900
  captions,
25858
25901
  titlePrefix,
25859
25902
  title
25860
25903
  }) {
25861
25904
  const id2 = useId$1();
25905
+ const label = formatId(originalLabel);
25862
25906
  return jsxs("div", {
25863
25907
  id: label,
25864
25908
  children: [jsxs("div", {
@@ -25989,26 +26033,46 @@ function ContentElements({
25989
26033
  children: elements
25990
26034
  });
25991
26035
  }
26036
+ function ReferenceContextProvider({
26037
+ children
26038
+ }) {
26039
+ const [references, setReferences] = useState({});
26040
+ const contextValue = useMemo(() => ({
26041
+ addReference: (reference) => {
26042
+ setReferences((prevReferences) => ({
26043
+ ...prevReferences,
26044
+ ...reference
26045
+ }));
26046
+ },
26047
+ references
26048
+ }), [references, setReferences]);
26049
+ return jsx(ReferenceContext.Provider, {
26050
+ value: contextValue,
26051
+ children
26052
+ });
26053
+ }
25992
26054
  function ContractViewer({
25993
26055
  contract,
25994
26056
  className,
25995
26057
  onExpandSection
25996
26058
  }) {
25997
26059
  const classNames = cx("adyen-contract-viewer", className);
25998
- return jsxs("main", {
25999
- className: classNames,
26000
- children: [jsx(Heading, {
26001
- level: 1,
26002
- className: "adl-u-margin-top-24 adl-u-margin-bottom-16",
26003
- children: jsx(Text, {
26004
- content: contract.title.content,
26005
- styles: contract.title.styles
26006
- })
26007
- }), jsx(ContentElements, {
26008
- contentElements: contract.contentElements,
26009
- onExpandSection,
26010
- isTopLevel: true
26011
- })]
26060
+ return jsx(ReferenceContextProvider, {
26061
+ children: jsxs("main", {
26062
+ className: classNames,
26063
+ children: [jsx(Heading, {
26064
+ level: 1,
26065
+ className: "adl-u-margin-top-24 adl-u-margin-bottom-16",
26066
+ children: jsx(Text, {
26067
+ content: contract.title.content,
26068
+ styles: contract.title.styles
26069
+ })
26070
+ }), jsx(ContentElements, {
26071
+ contentElements: contract.contentElements,
26072
+ onExpandSection,
26073
+ isTopLevel: true
26074
+ })]
26075
+ })
26012
26076
  });
26013
26077
  }
26014
26078
  const pciValidationRules = {
@@ -26874,7 +26938,7 @@ const serviceAgreementValidationRules = {
26874
26938
  errorMessage: "fieldIsRequired"
26875
26939
  }
26876
26940
  };
26877
- const logger$9 = createLogger("useServiceAgreement");
26941
+ const logger$a = createLogger("useServiceAgreement");
26878
26942
  const FALLBACK_LANGUAGE_CODE = "en";
26879
26943
  const useServiceAgreement = ({
26880
26944
  handleGetServiceAgreement,
@@ -26903,7 +26967,7 @@ const useServiceAgreement = ({
26903
26967
  language: agreementLanguage
26904
26968
  });
26905
26969
  if (!document2) {
26906
- logger$9.log('"document" field was missing in response');
26970
+ logger$a.log('"document" field was missing in response');
26907
26971
  return;
26908
26972
  }
26909
26973
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -26921,7 +26985,7 @@ const useServiceAgreement = ({
26921
26985
  throw err;
26922
26986
  }
26923
26987
  };
26924
- requestServiceAgreement().catch(logger$9.error);
26988
+ requestServiceAgreement().catch(logger$a.error);
26925
26989
  }, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
26926
26990
  return {
26927
26991
  loading: loading2,
@@ -28264,7 +28328,7 @@ function TrustDropinComponent(props) {
28264
28328
  }
28265
28329
  const PAGES_WITH_STATUS = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
28266
28330
  const POLLING_INTERVAL = 3e3;
28267
- const logger$8 = createLogger("DropinComposerComponent");
28331
+ const logger$9 = createLogger("DropinComposerComponent");
28268
28332
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
28269
28333
  function DropinComposerComponent({
28270
28334
  capabilities,
@@ -28357,7 +28421,7 @@ function DropinComposerComponent({
28357
28421
  setPciStatus(response);
28358
28422
  return response;
28359
28423
  } catch (e) {
28360
- logger$8.warn(i18n.get("failedToGetPciStatus"));
28424
+ logger$9.warn(i18n.get("failedToGetPciStatus"));
28361
28425
  }
28362
28426
  }
28363
28427
  return void 0;
@@ -28386,7 +28450,7 @@ function DropinComposerComponent({
28386
28450
  useEffect(() => {
28387
28451
  if (!tasks.includes(TaskTypes.PCI_DSS))
28388
28452
  return;
28389
- getPciTemplate().catch(logger$8.error);
28453
+ getPciTemplate().catch(logger$9.error);
28390
28454
  }, [getPciTemplate, tasks]);
28391
28455
  const getServiceAgreementAcceptanceInfos = async () => {
28392
28456
  if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
@@ -28394,7 +28458,7 @@ function DropinComposerComponent({
28394
28458
  const response = await args.handleGetServiceAgreementAcceptanceInfos(rootLegalEntity.id);
28395
28459
  setServiceAgreementAcceptanceInfos(response.data);
28396
28460
  } catch (e) {
28397
- logger$8.warn(i18n.get("failedToGetServiceAgreementStatus"));
28461
+ logger$9.warn(i18n.get("failedToGetServiceAgreementStatus"));
28398
28462
  }
28399
28463
  }
28400
28464
  };
@@ -28404,7 +28468,7 @@ function DropinComposerComponent({
28404
28468
  const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
28405
28469
  setServiceAgreementTypes(response.termsOfServiceTypes);
28406
28470
  } catch (e) {
28407
- logger$8.warn(i18n.get("failedToGetServiceAgreementStatus"));
28471
+ logger$9.warn(i18n.get("failedToGetServiceAgreementStatus"));
28408
28472
  }
28409
28473
  }
28410
28474
  };
@@ -28443,7 +28507,7 @@ function DropinComposerComponent({
28443
28507
  setCapabilityProblems(getCapabilityProblems(response));
28444
28508
  return response;
28445
28509
  } catch (e) {
28446
- logger$8.warn(i18n.get("failedToFetchLegalEntityDetails"));
28510
+ logger$9.warn(i18n.get("failedToFetchLegalEntityDetails"));
28447
28511
  }
28448
28512
  }
28449
28513
  return void 0;
@@ -28455,7 +28519,7 @@ function DropinComposerComponent({
28455
28519
  setTrust(response);
28456
28520
  return response;
28457
28521
  } catch (e) {
28458
- logger$8.warn(i18n.get("failedToFetchTrustDetails"));
28522
+ logger$9.warn(i18n.get("failedToFetchTrustDetails"));
28459
28523
  }
28460
28524
  }
28461
28525
  return void 0;
@@ -28505,7 +28569,7 @@ function DropinComposerComponent({
28505
28569
  label: i18n.get("successFullyRemovedTrustMember")
28506
28570
  });
28507
28571
  } catch (err) {
28508
- logger$8.error(`Failed to delete trust member`, err);
28572
+ logger$9.error(`Failed to delete trust member`, err);
28509
28573
  showToast({
28510
28574
  type: ToastType.ERROR,
28511
28575
  label: i18n.get("failedToRemoveTrustMember")
@@ -28575,7 +28639,7 @@ function DropinComposerComponent({
28575
28639
  }
28576
28640
  break;
28577
28641
  default:
28578
- logger$8.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
28642
+ logger$9.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
28579
28643
  }
28580
28644
  showToast({
28581
28645
  label: i18n.get("successfullyUpdatedDetails"),
@@ -28583,7 +28647,7 @@ function DropinComposerComponent({
28583
28647
  });
28584
28648
  await refreshTrustAndRunOnSubmit(trust2, 1);
28585
28649
  } catch (err) {
28586
- logger$8.error(err);
28650
+ logger$9.error(err);
28587
28651
  showToast({
28588
28652
  label: i18n.get("failedToUpdateDetails"),
28589
28653
  type: ToastType.ERROR
@@ -28806,7 +28870,7 @@ function DropinComposerComponent({
28806
28870
  }
28807
28871
  };
28808
28872
  setIsLoadingConfiguration(true);
28809
- fetchConfiguration().catch(logger$8.error).finally(() => {
28873
+ fetchConfiguration().catch(logger$9.error).finally(() => {
28810
28874
  setIsLoadingConfiguration(false);
28811
28875
  onLoad();
28812
28876
  });
@@ -29445,6 +29509,38 @@ const deleteTransferInstrument = async (context, transferInstrumentId) => {
29445
29509
  }
29446
29510
  });
29447
29511
  };
29512
+ const getAddress = async (context, addressId) => {
29513
+ const {
29514
+ loadingContext,
29515
+ legalEntityId
29516
+ } = context;
29517
+ return httpGet({
29518
+ loadingContext,
29519
+ errorLevel: "warn",
29520
+ errorMessage: `Failed to find address`,
29521
+ path: `${legalEntityId}/addresses/${addressId}`,
29522
+ authentication: "jwt",
29523
+ headers: {
29524
+ "Content-Type": "application/json"
29525
+ }
29526
+ });
29527
+ };
29528
+ const getIdverificationToken = async (context, request) => {
29529
+ const {
29530
+ loadingContext,
29531
+ legalEntityId
29532
+ } = context;
29533
+ return httpPost({
29534
+ loadingContext,
29535
+ errorLevel: "warn",
29536
+ errorMessage: `Failed to find address`,
29537
+ path: `${legalEntityId}/providers/IdVerification/initiate`,
29538
+ authentication: "jwt",
29539
+ headers: {
29540
+ "Content-Type": "application/json"
29541
+ }
29542
+ }, request);
29543
+ };
29448
29544
  const handleBankVerificationError = async (context, errorCode, errorMessage, state2, metadata) => {
29449
29545
  const {
29450
29546
  loadingContext,
@@ -29467,6 +29563,38 @@ const handleBankVerificationError = async (context, errorCode, errorMessage, sta
29467
29563
  metadata
29468
29564
  });
29469
29565
  };
29566
+ const idVerificationStartcheck = async (context, request) => {
29567
+ const {
29568
+ loadingContext,
29569
+ legalEntityId
29570
+ } = context;
29571
+ return httpPost({
29572
+ loadingContext,
29573
+ errorLevel: "warn",
29574
+ errorMessage: `Failed to find address`,
29575
+ path: `${legalEntityId}/providers/IdVerification/process`,
29576
+ authentication: "jwt",
29577
+ headers: {
29578
+ "Content-Type": "application/json"
29579
+ }
29580
+ }, request);
29581
+ };
29582
+ const searchAddress = async (context, address2) => {
29583
+ const {
29584
+ loadingContext,
29585
+ legalEntityId
29586
+ } = context;
29587
+ return httpPost({
29588
+ loadingContext,
29589
+ errorLevel: "warn",
29590
+ errorMessage: `Failed to search address`,
29591
+ path: `${legalEntityId}/addresses`,
29592
+ authentication: "jwt",
29593
+ headers: {
29594
+ "Content-Type": "application/json"
29595
+ }
29596
+ }, address2);
29597
+ };
29470
29598
  const COMPONENTS_API_VERSION = "v1";
29471
29599
  const useComponentApi = (rootLegalEntityId) => {
29472
29600
  const authContext = useAuthContext();
@@ -29506,6 +29634,10 @@ const useComponentApi = (rootLegalEntityId) => {
29506
29634
  createTrustedTransferInstrument: async (code2, state2) => createTrustedTransferInstrument(baseRequestContext, code2, state2),
29507
29635
  deleteTransferInstrument: async (transferInstrumentId) => deleteTransferInstrument(baseRequestContext, transferInstrumentId),
29508
29636
  handleBankVerificationError: async (errorCode, errorMessage, state2, metadata) => handleBankVerificationError(baseRequestContext, errorCode, errorMessage, state2, metadata),
29637
+ searchAddress: async (address2) => searchAddress(baseRequestContext, address2),
29638
+ getAddress: async (address2) => getAddress(baseRequestContext, address2),
29639
+ getIdVerificationToken: async (legalEntityId, data) => getIdverificationToken(baseRequestContext, data),
29640
+ idVerificationStartCheck: async (legalEntityId, data) => idVerificationStartcheck(baseRequestContext, data),
29509
29641
  getTransferInstruments: async () => getTransferInstruments(baseRequestContext)
29510
29642
  };
29511
29643
  }, [base, rootLegalEntityId]);
@@ -29529,7 +29661,7 @@ class EventEmitter {
29529
29661
  };
29530
29662
  }
29531
29663
  }
29532
- const logger$7 = createLogger("CreateIndividualComponent");
29664
+ const logger$8 = createLogger("CreateIndividualComponent");
29533
29665
  function CreateIndividualComponent({
29534
29666
  parentLegalEntityId,
29535
29667
  legalEntityId,
@@ -29547,7 +29679,11 @@ function CreateIndividualComponent({
29547
29679
  updateLegalEntity: updateLegalEntity2,
29548
29680
  getDocument: getDocument2,
29549
29681
  createDocument: createDocument2,
29550
- updateDocument: updateDocument2
29682
+ updateDocument: updateDocument2,
29683
+ searchAddress: searchAddress2,
29684
+ getAddress: getAddress2,
29685
+ getIdVerificationToken,
29686
+ idVerificationStartCheck
29551
29687
  } = useComponentApi(legalEntityId ?? parentLegalEntityId);
29552
29688
  const [legalEntity, setLegalEntity] = useState();
29553
29689
  const [parentLegalEntity, setParentLegalEntity] = useState();
@@ -29558,13 +29694,13 @@ function CreateIndividualComponent({
29558
29694
  setParentLegalEntity(parentEntity);
29559
29695
  setLegalEntity(entity);
29560
29696
  } catch (error) {
29561
- logger$7.error(error);
29697
+ logger$8.error(error);
29562
29698
  } finally {
29563
29699
  setLoadingStatus("success");
29564
29700
  }
29565
29701
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
29566
29702
  useEffect(() => {
29567
- fetchLegalEntity().catch(logger$7.error);
29703
+ fetchLegalEntity().catch(logger$8.error);
29568
29704
  }, [fetchLegalEntity]);
29569
29705
  return loadingStatus === "loading" ? jsx(Loader, {
29570
29706
  size: "medium"
@@ -29577,13 +29713,17 @@ function CreateIndividualComponent({
29577
29713
  handleUpdateDocument: updateDocument2,
29578
29714
  handleUpdateLegalEntity: updateLegalEntity2,
29579
29715
  handleCreateLegalEntity: createLegalEntity2,
29716
+ handleFindAddress: getAddress2,
29717
+ handleAddressSearch: searchAddress2,
29718
+ handleGetIdVerificationToken: getIdVerificationToken,
29719
+ handleGetIdVerificationStartCheck: idVerificationStartCheck,
29580
29720
  handleBackClick,
29581
29721
  hideNavigation: true,
29582
29722
  onSubmit: onSubmitSuccess,
29583
29723
  taskType
29584
29724
  });
29585
29725
  }
29586
- const logger$6 = createLogger("CreateTransferInstrumentComponent");
29726
+ const logger$7 = createLogger("CreateTransferInstrumentComponent");
29587
29727
  function CreateTransferInstrumentComponent({
29588
29728
  legalEntityId,
29589
29729
  transferInstrumentId,
@@ -29619,7 +29759,7 @@ function CreateTransferInstrumentComponent({
29619
29759
  const ti = await getTransferInstrument2(transferInstrumentId);
29620
29760
  setTransferInstrument(ti);
29621
29761
  }
29622
- })().catch(logger$6.error).finally(() => {
29762
+ })().catch(logger$7.error).finally(() => {
29623
29763
  setLoadingStatus("success");
29624
29764
  });
29625
29765
  }, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
@@ -29657,14 +29797,14 @@ function useInterval(callback, initialDelay = DEFAULT_POLLING_INTERVAL) {
29657
29797
  useEffect(() => {
29658
29798
  savedCallback.current = callback;
29659
29799
  const delayGenerator = () => {
29660
- let delay = delayValue;
29800
+ let delay2 = delayValue;
29661
29801
  if (retryCount < DEFAULT_POLLING_INTERVAL_RETRY_COUNT) {
29662
29802
  retryCount += 1;
29663
29803
  } else {
29664
- delay = delayValue >= 9e3 ? delay = initialDelay : delayValue + 1e3;
29665
- setDelayValue(delay);
29804
+ delay2 = delayValue >= 9e3 ? delay2 = initialDelay : delayValue + 1e3;
29805
+ setDelayValue(delay2);
29666
29806
  }
29667
- return delay;
29807
+ return delay2;
29668
29808
  };
29669
29809
  const handleTick = () => {
29670
29810
  if (savedCallback.current !== null) {
@@ -29820,7 +29960,7 @@ function ManageTransferInstrumentOverviewItem({
29820
29960
  })]
29821
29961
  }, transferInstrumentReference.transferInstrument.id);
29822
29962
  }
29823
- const logger$5 = createLogger("ManageTransferInstrumentOverview");
29963
+ const logger$6 = createLogger("ManageTransferInstrumentOverview");
29824
29964
  function ManageTransferInstrumentOverview({
29825
29965
  transferInstrumentReferences,
29826
29966
  onAdd,
@@ -29845,7 +29985,7 @@ function ManageTransferInstrumentOverview({
29845
29985
  ...transferInstrumentsMap
29846
29986
  });
29847
29987
  } catch (e) {
29848
- logger$5.error(e);
29988
+ logger$6.error(e);
29849
29989
  }
29850
29990
  };
29851
29991
  const onRemoveTransferinstrument = async (transferInstrumentId) => {
@@ -29853,7 +29993,7 @@ function ManageTransferInstrumentOverview({
29853
29993
  await deleteTransferInstrument2(transferInstrumentId);
29854
29994
  onRemove(transferInstrumentId);
29855
29995
  } catch (e) {
29856
- logger$5.error(e);
29996
+ logger$6.error(e);
29857
29997
  }
29858
29998
  };
29859
29999
  const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => jsx(ManageTransferInstrumentOverviewItem, {
@@ -29878,7 +30018,7 @@ function ManageTransferInstrumentOverview({
29878
30018
  })]
29879
30019
  });
29880
30020
  }
29881
- const logger$4 = createLogger("ManageTransferInstrumentComponent");
30021
+ const logger$5 = createLogger("ManageTransferInstrumentComponent");
29882
30022
  function ManageTransferInstrumentComponent({
29883
30023
  legalEntityId,
29884
30024
  onAdd,
@@ -29914,7 +30054,7 @@ function ManageTransferInstrumentComponent({
29914
30054
  }, [getTransferInstruments2, getLegalEntity2, i18n, legalEntityId]);
29915
30055
  useEffect(() => {
29916
30056
  eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
29917
- init2().catch(logger$4.error).finally(() => {
30057
+ init2().catch(logger$5.error).finally(() => {
29918
30058
  setLoadingStatus("success");
29919
30059
  });
29920
30060
  }, [init2, setLocale, eventEmitter]);
@@ -29924,7 +30064,7 @@ function ManageTransferInstrumentComponent({
29924
30064
  }
29925
30065
  }, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
29926
30066
  const onRemove = (transferInstrumentId) => {
29927
- refreshTransferInstruments().catch(logger$4.error);
30067
+ refreshTransferInstruments().catch(logger$5.error);
29928
30068
  onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
29929
30069
  };
29930
30070
  const render2 = () => {
@@ -30033,6 +30173,60 @@ const getSupportedCountries = async (context) => {
30033
30173
  }
30034
30174
  });
30035
30175
  };
30176
+ const validatePhoneNumber$1 = async (context, phoneNumber2) => {
30177
+ const {
30178
+ loadingContext,
30179
+ legalEntityId
30180
+ } = context;
30181
+ return httpPost({
30182
+ loadingContext,
30183
+ authentication: "jwt",
30184
+ errorLevel: "warn",
30185
+ errorMessage: "Phone validation is not available",
30186
+ path: `${legalEntityId}/validations/phonenumber`
30187
+ }, {
30188
+ number: phoneNumber2
30189
+ });
30190
+ };
30191
+ const logger$4 = createLogger("verify-id-number");
30192
+ const verifyIdNumber$1 = async (context, request) => {
30193
+ const {
30194
+ loadingContext,
30195
+ legalEntityId
30196
+ } = context;
30197
+ try {
30198
+ return await httpPost({
30199
+ loadingContext,
30200
+ errorLevel: "warn",
30201
+ errorMessage: `Id number verification is not available`,
30202
+ path: `${legalEntityId}/verifications/idNumber`,
30203
+ authentication: "jwt",
30204
+ headers: {
30205
+ "Content-Type": "application/json"
30206
+ },
30207
+ // Handler for unhappy flows, i.e. status != 200, in the idNumber verification process
30208
+ errorHandler: async (response) => {
30209
+ const responseData = await response;
30210
+ if (responseData.status === 422) {
30211
+ return {
30212
+ status: 422,
30213
+ message: responseData.detail,
30214
+ errorCode: responseData.errorCode
30215
+ };
30216
+ }
30217
+ if (responseData.status === 500) {
30218
+ return {
30219
+ status: 500,
30220
+ message: "Service did not respond, do not block verification"
30221
+ };
30222
+ }
30223
+ return logger$4.warn(`Unexpected response status ${responseData.status}`);
30224
+ }
30225
+ }, request);
30226
+ } catch (e) {
30227
+ logger$4.warn("WARNING: idNumber verification failed - error:", e);
30228
+ }
30229
+ };
30036
30230
  const getEmbeddedApi = ({
30037
30231
  base,
30038
30232
  rootLegalEntityId
@@ -30068,12 +30262,8 @@ const getEmbeddedApi = ({
30068
30262
  getImageUrl: () => `${base}static/images/`,
30069
30263
  getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
30070
30264
  getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
30071
- validatePhoneNumber: () => {
30072
- throw new Error("validatePhoneNumber: Not implemented in onboarding component api");
30073
- },
30074
- verifyIdNumber: () => {
30075
- throw new Error("verifyIdNumber: Not implemented in onboarding component api");
30076
- },
30265
+ validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber$1(baseRequestContext, phoneNumber2),
30266
+ verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request),
30077
30267
  companyIndexSearch: () => {
30078
30268
  throw new Error("companyIndexSearch: Not implemented in onboarding component api");
30079
30269
  },