@adyen/kyc-components 2.35.0 → 2.36.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.
@@ -1235,19 +1235,14 @@ const introductionScreenEpilogueTitle = "Why do we need this information?";
1235
1235
  const introductionScreenEpilogueDescriptionP1 = "We check all this information against official records to verify your identity and comply with financial regulations.";
1236
1236
  const introductionScreenEpilogueDescriptionP2 = "Your information will be used only for these purposes.";
1237
1237
  const oib = "OIB";
1238
- const onboardingRedirectInitialHeader = "Reach more customers and accept orders online";
1239
- const onboardingRedirectInitialDescriptionP1 = "Register today and get access to all the features like receiving payments or issuing cards.";
1240
- const onboardingRedirectInitialCtaButton = "Get started";
1241
- const onboardingRedirectInProgressHeader = "We are currently reviewing your information";
1242
- const onboardingRedirectInProgressDescriptionP1 = "We will notify you when your details are verified correctly so you can start doing payments.";
1243
- const onboardingRedirectInProgressCtaButton = "View information";
1244
- const onboardingRedirectErrorsHeader = "Some of your information needs to be corrected";
1245
- const onboardingRedirectErrorsDescriptionP1 = "We reviewed the information you submitted, but we were not able to verify everything.";
1246
- const onboardingRedirectErrorsDescriptionP2 = "You need to correct some information before we can activate your account.";
1247
- const onboardingRedirectErrorsCtaButton = "Correct information";
1248
- const onboardingRedirectFinishedHeader = "You’re all set";
1249
- const onboardingRedirectFinishedDescriptionP1 = "We reviewed the information you submitted and successfully verified your account.";
1250
- const onboardingRedirectFinishedCtaButton = "View data";
1238
+ const onboardingRedirectAwaitingDescriptionP1 = "Verify your business details to start receiving payments.";
1239
+ const onboardingRedirectAwaitingCtaButton = "Continue";
1240
+ const onboardingRedirectInReviewDescriptionP1 = "We’re reviewing your details. It might take up to 2 business days.";
1241
+ const onboardingRedirectInReviewCtaButton = "Go to details";
1242
+ const onboardingRedirectUnsuccessfulDescriptionP1 = "We couldn’t verify some details. Check if they’re correct and make any updates needed.";
1243
+ const onboardingRedirectUnsuccessfulCtaButton = "Update details";
1244
+ const onboardingRedirectRejectedDescriptionP1 = "Your account can’t be set up.";
1245
+ const onboardingRedirectVerifiedDescriptionP1 = "Your details are verified.";
1251
1246
  const onboardingRedirectLinkError = "Onboarding link not available at the moment, please try again later.";
1252
1247
  const onboardingRedirectOpenError = "Pop-up blocker prevented redirecting, please allow pop-ups for this site.";
1253
1248
  const defaultTrans = {
@@ -2470,19 +2465,14 @@ const defaultTrans = {
2470
2465
  introductionScreenEpilogueDescriptionP1,
2471
2466
  introductionScreenEpilogueDescriptionP2,
2472
2467
  oib,
2473
- onboardingRedirectInitialHeader,
2474
- onboardingRedirectInitialDescriptionP1,
2475
- onboardingRedirectInitialCtaButton,
2476
- onboardingRedirectInProgressHeader,
2477
- onboardingRedirectInProgressDescriptionP1,
2478
- onboardingRedirectInProgressCtaButton,
2479
- onboardingRedirectErrorsHeader,
2480
- onboardingRedirectErrorsDescriptionP1,
2481
- onboardingRedirectErrorsDescriptionP2,
2482
- onboardingRedirectErrorsCtaButton,
2483
- onboardingRedirectFinishedHeader,
2484
- onboardingRedirectFinishedDescriptionP1,
2485
- onboardingRedirectFinishedCtaButton,
2468
+ onboardingRedirectAwaitingDescriptionP1,
2469
+ onboardingRedirectAwaitingCtaButton,
2470
+ onboardingRedirectInReviewDescriptionP1,
2471
+ onboardingRedirectInReviewCtaButton,
2472
+ onboardingRedirectUnsuccessfulDescriptionP1,
2473
+ onboardingRedirectUnsuccessfulCtaButton,
2474
+ onboardingRedirectRejectedDescriptionP1,
2475
+ onboardingRedirectVerifiedDescriptionP1,
2486
2476
  onboardingRedirectLinkError,
2487
2477
  onboardingRedirectOpenError
2488
2478
  };
@@ -2968,7 +2958,7 @@ const icons = {
2968
2958
  warning: lazy(() => import("./warning-99uFf1WU.js")),
2969
2959
  wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
2970
2960
  };
2971
- const logger$w = createLogger("Icon");
2961
+ const logger$v = createLogger("Icon");
2972
2962
  const Icon = ({
2973
2963
  className,
2974
2964
  name,
@@ -2976,7 +2966,7 @@ const Icon = ({
2976
2966
  }) => {
2977
2967
  const LazyLoadedIcon = icons[name];
2978
2968
  if (!LazyLoadedIcon) {
2979
- logger$w.error(`No such icon: "${name}"`);
2969
+ logger$v.error(`No such icon: "${name}"`);
2980
2970
  return null;
2981
2971
  }
2982
2972
  return jsx("span", {
@@ -3180,7 +3170,7 @@ function useFormRouterContext() {
3180
3170
  }
3181
3171
  return context;
3182
3172
  }
3183
- const logger$v = createLogger("Link");
3173
+ const logger$u = createLogger("Link");
3184
3174
  const getIconClass = (icon, external) => {
3185
3175
  if (external) {
3186
3176
  return "adl-link__icon adyen-kyc-icon-external-link";
@@ -3192,7 +3182,7 @@ const getIconClass = (icon, external) => {
3192
3182
  };
3193
3183
  const isValidLink = (href) => {
3194
3184
  if (href === "#") {
3195
- logger$v.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3185
+ logger$u.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3196
3186
  return false;
3197
3187
  }
3198
3188
  return true;
@@ -3480,7 +3470,7 @@ const useSetting = (settingName) => {
3480
3470
  } = context;
3481
3471
  return getSetting(settingName);
3482
3472
  };
3483
- const logger$u = createLogger("useAllowedCountries");
3473
+ const logger$t = createLogger("useAllowedCountries");
3484
3474
  const useAllowedCountries = () => {
3485
3475
  const acceptedCountries = useSetting("acceptedCountries");
3486
3476
  const {
@@ -3490,7 +3480,7 @@ const useAllowedCountries = () => {
3490
3480
  useEffect(() => {
3491
3481
  if (acceptedCountries !== void 0)
3492
3482
  return;
3493
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$u.error);
3483
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$t.error);
3494
3484
  }, [acceptedCountries]);
3495
3485
  return allowedCountries;
3496
3486
  };
@@ -3829,7 +3819,7 @@ class ValidationResult {
3829
3819
  return this.validationResults.filter((result) => result.hasError);
3830
3820
  }
3831
3821
  }
3832
- const logger$t = createLogger("useAsyncValidator");
3822
+ const logger$s = createLogger("useAsyncValidator");
3833
3823
  const useAsyncValidator = (asyncRules) => {
3834
3824
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3835
3825
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3852,7 +3842,7 @@ const useAsyncValidator = (asyncRules) => {
3852
3842
  hasError: !isValid
3853
3843
  }])
3854
3844
  });
3855
- }).catch(logger$t.error);
3845
+ }).catch(logger$s.error);
3856
3846
  }, [asyncRules, clearAsyncValidationResults]);
3857
3847
  return {
3858
3848
  asyncValidationResults,
@@ -5283,7 +5273,7 @@ function useIsElementVisible(ref, fallback = true) {
5283
5273
  }, [ref]);
5284
5274
  return isOnScreen;
5285
5275
  }
5286
- const logger$s = createLogger("Flag");
5276
+ const logger$r = createLogger("Flag");
5287
5277
  const flagImports = /* @__PURE__ */ Object.assign({
5288
5278
  "../../../../assets/flags/ad.svg": () => import("./ad-DT4vRaBJ.js"),
5289
5279
  "../../../../assets/flags/ae.svg": () => import("./ae-BOcuAHGY.js"),
@@ -5540,7 +5530,7 @@ const flagImports = /* @__PURE__ */ Object.assign({
5540
5530
  const getLazyLoadedSvgComponent = (country2) => {
5541
5531
  const importForCountry = flagImports[`../../../../assets/flags/${country2.toLowerCase()}.svg`];
5542
5532
  if (!importForCountry) {
5543
- logger$s.error(`No flag available for ${country2}`);
5533
+ logger$r.error(`No flag available for ${country2}`);
5544
5534
  return void 0;
5545
5535
  }
5546
5536
  return lazy(importForCountry);
@@ -6189,6 +6179,102 @@ const isValueObscured = (value) => {
6189
6179
  var _a;
6190
6180
  return typeof value === "string" && !!((_a = value.match(/[*]{1,}/)) == null ? void 0 : _a.length);
6191
6181
  };
6182
+ const shiftRight = (possibleShifts, matchedTokens, remainingTokens) => {
6183
+ let shiftsToTry = [...possibleShifts];
6184
+ let current = {
6185
+ matchedTokens,
6186
+ remainingTokens
6187
+ };
6188
+ while (current.remainingTokens.length > 0 && shiftsToTry.length > 0) {
6189
+ const possibleShift = shiftsToTry[0];
6190
+ const shifted = tryShift(current.matchedTokens, current.remainingTokens, possibleShift.fromIndex, possibleShift.shiftDistance);
6191
+ if (shifted === "notPossible") {
6192
+ shiftsToTry = shiftsToTry.slice(1);
6193
+ } else {
6194
+ current = shifted;
6195
+ shiftsToTry = [...possibleShifts];
6196
+ }
6197
+ }
6198
+ return current;
6199
+ };
6200
+ const findPossibleShifts = (mask) => {
6201
+ const inputOnlyMask = mask.filter((t) => t.type === "input");
6202
+ const optionals = inputOnlyMask.filter((t) => t.optional);
6203
+ const possibleShifts = [];
6204
+ for (const optional of optionals) {
6205
+ const index = inputOnlyMask.indexOf(optional);
6206
+ for (let i = index + 1; i < inputOnlyMask.length; i += 1) {
6207
+ const laterToken = inputOnlyMask[i];
6208
+ if (laterToken.type === "input") {
6209
+ possibleShifts.push({
6210
+ fromIndex: index,
6211
+ shiftDistance: i - index
6212
+ });
6213
+ }
6214
+ }
6215
+ }
6216
+ return possibleShifts.sort((s1, s2) => {
6217
+ if (s1.fromIndex === s2.fromIndex) {
6218
+ return s2.shiftDistance - s1.shiftDistance;
6219
+ }
6220
+ return s1.fromIndex - s2.fromIndex;
6221
+ });
6222
+ };
6223
+ const tryShift = (matchedTokens, remainingTokens, fromIndex, shiftDistance) => {
6224
+ const normalizedTokens = [...matchedTokens.map((token, i) => ({
6225
+ ...token,
6226
+ currentValue: token.char,
6227
+ originalIndex: i
6228
+ })), ...remainingTokens.map((token, i) => ({
6229
+ ...token,
6230
+ currentValue: null,
6231
+ originalIndex: i + matchedTokens.length
6232
+ }))];
6233
+ const normalizedInputTokens = normalizedTokens.filter((token) => token.type === "input");
6234
+ if (normalizedTokens[fromIndex].currentValue === null) {
6235
+ return "notPossible";
6236
+ }
6237
+ const emptyInputsAfter = normalizedInputTokens.slice(fromIndex + 1).filter((t) => !t.currentValue);
6238
+ if (shiftDistance > emptyInputsAfter.length) {
6239
+ return "notPossible";
6240
+ }
6241
+ for (let i = 0; i < normalizedInputTokens.length; i += 1) {
6242
+ const token = normalizedInputTokens[i];
6243
+ if (i < fromIndex) {
6244
+ token.potentialValue = token.currentValue;
6245
+ } else if (i < fromIndex + shiftDistance) {
6246
+ token.potentialValue = null;
6247
+ } else {
6248
+ token.potentialValue = normalizedInputTokens[i - shiftDistance].currentValue;
6249
+ }
6250
+ }
6251
+ const allValid = normalizedInputTokens.every((token) => {
6252
+ var _a;
6253
+ if (!token.potentialValue) {
6254
+ return token.optional;
6255
+ }
6256
+ return ((_a = token.allow) == null ? void 0 : _a.test(token.potentialValue)) ?? true;
6257
+ });
6258
+ if (!allValid)
6259
+ return "notPossible";
6260
+ let matchedUpTo = 0;
6261
+ for (let i = 0; i < normalizedTokens.length; i += 1) {
6262
+ const token = normalizedInputTokens.find((t) => t.originalIndex === i) ?? normalizedTokens[i];
6263
+ if (token.type === "input" && !token.potentialValue && !token.optional) {
6264
+ break;
6265
+ }
6266
+ matchedUpTo = i + 1;
6267
+ }
6268
+ const newMatchedTokens = normalizedTokens.slice(0, matchedUpTo).map((token) => ({
6269
+ ...token,
6270
+ char: token.type === "nonInput" ? token.char : token.potentialValue
6271
+ }));
6272
+ const newRemainingTokens = normalizedTokens.slice(matchedUpTo);
6273
+ return {
6274
+ matchedTokens: newMatchedTokens,
6275
+ remainingTokens: newRemainingTokens
6276
+ };
6277
+ };
6192
6278
  const getAvailableInputTokens = (tokens) => {
6193
6279
  const availableTokens = [];
6194
6280
  for (const token of tokens) {
@@ -6231,7 +6317,7 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
6231
6317
  let tokensToProcess = [...mask.tokens];
6232
6318
  let charsToProcess = pureValue;
6233
6319
  let charIndex = 0;
6234
- let displayValue = "";
6320
+ let matchedTokens = [];
6235
6321
  if (acceptObscuredValue && isValueObscured(pureValue)) {
6236
6322
  return {
6237
6323
  outcome: "obscureCorrect",
@@ -6245,27 +6331,32 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
6245
6331
  const shiftTokens = (increment) => {
6246
6332
  tokensToProcess = tokensToProcess.slice(increment);
6247
6333
  };
6334
+ const displayValue = () => matchedTokens.map((token) => token.char).join("");
6248
6335
  while (true) {
6249
6336
  const char = charsToProcess[0];
6250
6337
  const token = tokensToProcess[0];
6251
6338
  if (!char && !tokensToProcess.some((t) => t.type === "input" && !t.optional))
6252
6339
  return {
6253
6340
  outcome: "correct",
6254
- displayValue: displayValue + getEagerSuffix(tokensToProcess),
6341
+ displayValue: displayValue() + getEagerSuffix(tokensToProcess),
6255
6342
  potentialForMoreOptionalInput: getPotentialForMoreOptionalInput(tokensToProcess)
6256
6343
  };
6257
- if (!char)
6344
+ if (!char) {
6345
+ const output = shiftRight(mask.possibleShifts, matchedTokens, tokensToProcess);
6346
+ matchedTokens = output.matchedTokens;
6347
+ tokensToProcess = output.remainingTokens;
6258
6348
  return {
6259
6349
  outcome: "partialCorrect",
6260
- displayValue: displayValue + getEagerSuffix(tokensToProcess)
6350
+ displayValue: displayValue() + getEagerSuffix(tokensToProcess)
6261
6351
  };
6352
+ }
6262
6353
  if (!token)
6263
6354
  return {
6264
6355
  outcome: "mismatch",
6265
6356
  badChar: char,
6266
6357
  mismatchAtChar: charIndex,
6267
6358
  mismatchedToken: "inputTooLong",
6268
- partialDisplayValue: displayValue
6359
+ partialDisplayValue: displayValue()
6269
6360
  };
6270
6361
  if (token.type === "nonInput") {
6271
6362
  if (token.includeInValue) {
@@ -6275,11 +6366,11 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
6275
6366
  badChar: char,
6276
6367
  mismatchAtChar: charIndex,
6277
6368
  mismatchedToken: token,
6278
- partialDisplayValue: displayValue
6369
+ partialDisplayValue: displayValue()
6279
6370
  };
6280
6371
  shiftChars(1);
6281
6372
  }
6282
- displayValue += token.char;
6373
+ matchedTokens.push(token);
6283
6374
  shiftTokens(1);
6284
6375
  }
6285
6376
  if (token.type === "input") {
@@ -6291,9 +6382,12 @@ const matchAgainstMask = (pureValue, mask, acceptObscuredValue = false) => {
6291
6382
  badChar: char,
6292
6383
  mismatchAtChar: charIndex,
6293
6384
  mismatchedToken: token,
6294
- partialDisplayValue: displayValue
6385
+ partialDisplayValue: displayValue()
6295
6386
  };
6296
- displayValue += char;
6387
+ matchedTokens.push({
6388
+ ...matchingToken,
6389
+ char
6390
+ });
6297
6391
  shiftTokens(matchingToken.offset + 1);
6298
6392
  shiftChars(1);
6299
6393
  }
@@ -6329,7 +6423,7 @@ const deriveInputState = (isValid, isFocused, hasBlurred, isDisabled, errorMessa
6329
6423
  };
6330
6424
  };
6331
6425
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
6332
- const logger$r = createLogger("MaskedInputText");
6426
+ const logger$q = createLogger("MaskedInputText");
6333
6427
  const MaskedInputText = ({
6334
6428
  value,
6335
6429
  onInput,
@@ -6371,7 +6465,7 @@ const MaskedInputText = ({
6371
6465
  };
6372
6466
  useEffect(() => {
6373
6467
  if (!mask) {
6374
- logger$r.warn("`mask` is undefined. No masking of input will take place.");
6468
+ logger$q.warn("`mask` is undefined. No masking of input will take place.");
6375
6469
  }
6376
6470
  }, [mask]);
6377
6471
  const getMaskResult = useCallback((pureValue) => {
@@ -6398,7 +6492,7 @@ const MaskedInputText = ({
6398
6492
  return;
6399
6493
  }
6400
6494
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
6401
- logger$r.warn(`Value received "${value}" does not match mask`, maskResult, `
6495
+ logger$q.warn(`Value received "${value}" does not match mask`, maskResult, `
6402
6496
  Falling back to partially valid value "${fallback}"`);
6403
6497
  onInput(fallback);
6404
6498
  }
@@ -6748,7 +6842,8 @@ const customInputs = (length, regex, optional = false) => makeArrayOfRepeatedObj
6748
6842
  optional
6749
6843
  });
6750
6844
  const makeMask = (...tokens) => ({
6751
- tokens
6845
+ tokens,
6846
+ possibleShifts: findPossibleShifts(tokens)
6752
6847
  });
6753
6848
  const uppercase = (str) => (str == null ? void 0 : str.toUpperCase()) ?? str;
6754
6849
  const businessRegistrationNumberMasks = {
@@ -10502,7 +10597,7 @@ const accountHolderValidationRules = {
10502
10597
  }
10503
10598
  };
10504
10599
  const accountHolderFields = ["accountHolder"];
10505
- const logger$q = createLogger("AccountHolder");
10600
+ const logger$p = createLogger("AccountHolder");
10506
10601
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
10507
10602
  switch (legalEntityType) {
10508
10603
  case LegalEntityType.ORGANIZATION: {
@@ -10512,7 +10607,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
10512
10607
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
10513
10608
  }
10514
10609
  default:
10515
- logger$q.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10610
+ logger$p.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10516
10611
  return [];
10517
10612
  }
10518
10613
  }
@@ -11259,7 +11354,7 @@ function Dropzone(props) {
11259
11354
  })]
11260
11355
  });
11261
11356
  }
11262
- const logger$p = createLogger("TextArea");
11357
+ const logger$o = createLogger("TextArea");
11263
11358
  function TextArea(props) {
11264
11359
  const {
11265
11360
  classNameModifiers,
@@ -11280,7 +11375,7 @@ function TextArea(props) {
11280
11375
  } = useI18nContext();
11281
11376
  const [value, setValue] = useState("");
11282
11377
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11283
- logger$p.error("Error: Form fields that rely on InputBase may not have an onChange property");
11378
+ logger$o.error("Error: Form fields that rely on InputBase may not have an onChange property");
11284
11379
  }
11285
11380
  const handleInput = (e) => {
11286
11381
  var _a;
@@ -11693,7 +11788,7 @@ function FieldContainer(props) {
11693
11788
  }
11694
11789
  return renderField(fieldName);
11695
11790
  }
11696
- const logger$o = createLogger("SearchAddress");
11791
+ const logger$n = createLogger("SearchAddress");
11697
11792
  const SearchAddress = ({
11698
11793
  data,
11699
11794
  legalEntityId,
@@ -11736,7 +11831,7 @@ const SearchAddress = ({
11736
11831
  const response = await handleFindAddress(selectedAddressId);
11737
11832
  autocompleteAddressForm(response);
11738
11833
  } catch (e) {
11739
- logger$o.error(e);
11834
+ logger$n.error(e);
11740
11835
  }
11741
11836
  };
11742
11837
  const onDrilldown = async (selectedAddress) => {
@@ -11748,7 +11843,7 @@ const SearchAddress = ({
11748
11843
  }, legalEntityId);
11749
11844
  setItems((response == null ? void 0 : response.results) || []);
11750
11845
  } catch (e) {
11751
- logger$o.error(e);
11846
+ logger$n.error(e);
11752
11847
  }
11753
11848
  };
11754
11849
  const onChange = (e) => {
@@ -11803,7 +11898,7 @@ const SearchAddress = ({
11803
11898
  setItems([]);
11804
11899
  }
11805
11900
  } catch (e) {
11806
- logger$o.error(e);
11901
+ logger$n.error(e);
11807
11902
  }
11808
11903
  setLoading(false);
11809
11904
  }
@@ -14748,7 +14843,7 @@ const initOnfido = async ({
14748
14843
  language: getOnfidoLocaleConfig(i18n)
14749
14844
  });
14750
14845
  };
14751
- const logger$n = createLogger("IdVerificationComponent");
14846
+ const logger$m = createLogger("IdVerificationComponent");
14752
14847
  function IdVerificationComponent({
14753
14848
  userDetails,
14754
14849
  legalEntityId,
@@ -14781,7 +14876,7 @@ function IdVerificationComponent({
14781
14876
  onIdVerificationError,
14782
14877
  onIdVerificationComplete
14783
14878
  });
14784
- })().catch(logger$n.error);
14879
+ })().catch(logger$m.error);
14785
14880
  return () => {
14786
14881
  if (onfidoSdk.current)
14787
14882
  onfidoSdk.current.tearDown();
@@ -14833,7 +14928,7 @@ function IdDocumentAlreadyUpload(props) {
14833
14928
  })]
14834
14929
  });
14835
14930
  }
14836
- const logger$m = createLogger("IdDocumentInstantVerificationComponent");
14931
+ const logger$l = createLogger("IdDocumentInstantVerificationComponent");
14837
14932
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
14838
14933
  const documentTypeValidationRules = {
14839
14934
  instantIdVerificationData: {
@@ -14915,7 +15010,7 @@ function IdDocumentInstantVerificationComponent(props) {
14915
15010
  userDetails: props.userDetails,
14916
15011
  legalEntityId: props.legalEntityId,
14917
15012
  onIdVerificationComplete: handleIdVerificationComplete,
14918
- onIdVerificationError: logger$m.error
15013
+ onIdVerificationError: logger$l.error
14919
15014
  }), jsxs("div", {
14920
15015
  className: "adyen-kyc-document-upload__manual-upload",
14921
15016
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -18359,7 +18454,7 @@ class AdyenKycSdkError extends Error {
18359
18454
  }
18360
18455
  let sdkToken;
18361
18456
  let fetchSdkToken;
18362
- const logger$l = createLogger("Session");
18457
+ const logger$k = createLogger("Session");
18363
18458
  const setSdkToken = (token) => {
18364
18459
  sdkToken = token;
18365
18460
  };
@@ -18382,7 +18477,7 @@ const refreshSession = async () => {
18382
18477
  setSdkToken(token);
18383
18478
  isSessionRefreshed = true;
18384
18479
  } catch (e) {
18385
- logger$l.error("Failed to fetch sdk token", e);
18480
+ logger$k.error("Failed to fetch sdk token", e);
18386
18481
  }
18387
18482
  return isSessionRefreshed;
18388
18483
  };
@@ -18392,7 +18487,7 @@ const addAnimationStartListener = (element, listener) => {
18392
18487
  const removeAnimationStartListener = (element, listener) => {
18393
18488
  element.removeEventListener("animationstart", listener, false);
18394
18489
  };
18395
- const logger$k = createLogger("Fetch");
18490
+ const logger$j = createLogger("Fetch");
18396
18491
  const getRequestObject = (options, data) => {
18397
18492
  const {
18398
18493
  headers = [],
@@ -18439,10 +18534,10 @@ const logFetchError = (message, level) => {
18439
18534
  case "info":
18440
18535
  case "warn":
18441
18536
  case "error":
18442
- logger$k[level](message);
18537
+ logger$j[level](message);
18443
18538
  break;
18444
18539
  default:
18445
- logger$k.error(message);
18540
+ logger$j.error(message);
18446
18541
  }
18447
18542
  };
18448
18543
  const handleFetchResponse = async (response, responseType) => {
@@ -18535,7 +18630,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
18535
18630
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
18536
18631
  const MOUNT_TIMEOUT = 10 * 1e3;
18537
18632
  const TINK_VENDOR = "Tink";
18538
- const logger$j = createLogger("iframeWidget");
18633
+ const logger$i = createLogger("iframeWidget");
18539
18634
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
18540
18635
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
18541
18636
  const parseMessageJson = (message) => {
@@ -18554,7 +18649,7 @@ const callbackErrorHandler = async (response) => {
18554
18649
  try {
18555
18650
  await response;
18556
18651
  } catch (ex) {
18557
- logger$j.error(ex);
18652
+ logger$i.error(ex);
18558
18653
  }
18559
18654
  return {
18560
18655
  error: "UNKNOWN_ERROR",
@@ -18663,7 +18758,7 @@ class IFrameWidget {
18663
18758
  message = responseData.errorMessage;
18664
18759
  }
18665
18760
  } catch (ex) {
18666
- logger$j.error(ex);
18761
+ logger$i.error(ex);
18667
18762
  }
18668
18763
  throw new AdyenKycSdkError(reason, jsonData.error);
18669
18764
  }
@@ -18851,7 +18946,7 @@ function BankVerificationWidget({
18851
18946
  ref: widgetContainerRef
18852
18947
  });
18853
18948
  }
18854
- const logger$i = createLogger("BankVerification");
18949
+ const logger$h = createLogger("BankVerification");
18855
18950
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
18856
18951
  const InstantVerificationErrorContext = createContext(null);
18857
18952
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -18885,7 +18980,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
18885
18980
  const vendor = vendors[0];
18886
18981
  setPreferredVendor(vendor.name ? vendor : void 0);
18887
18982
  };
18888
- getPreferredVendor().catch(logger$i.error);
18983
+ getPreferredVendor().catch(logger$h.error);
18889
18984
  }, [country2, getBankVerificationVendors]);
18890
18985
  return preferredVendor;
18891
18986
  };
@@ -19797,9 +19892,7 @@ const ibanMask = (country2, inputLength, allowLettersInBban) => {
19797
19892
  tokens.push(spacer, ...inputToken(remainder));
19798
19893
  }
19799
19894
  return {
19800
- mask: {
19801
- tokens
19802
- },
19895
+ mask: makeMask(...tokens),
19803
19896
  transformOnType: allowLettersInBban ? uppercase : void 0
19804
19897
  };
19805
19898
  };
@@ -20148,7 +20241,7 @@ const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvi
20148
20241
  }
20149
20242
  });
20150
20243
  const payoutVerificationMethods = ["instantVerification", "manualVerification"];
20151
- const logger$h = createLogger("useLocalStorage");
20244
+ const logger$g = createLogger("useLocalStorage");
20152
20245
  const useLocalStorage = (key, defaultValue, options) => {
20153
20246
  const {
20154
20247
  serializer,
@@ -20169,7 +20262,7 @@ const useLocalStorage = (key, defaultValue, options) => {
20169
20262
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
20170
20263
  return res;
20171
20264
  } catch (err) {
20172
- logger$h.error(err);
20265
+ logger$g.error(err);
20173
20266
  return defaultValue;
20174
20267
  }
20175
20268
  });
@@ -20201,7 +20294,7 @@ const useLocalStorage = (key, defaultValue, options) => {
20201
20294
  try {
20202
20295
  updateLocalStorage();
20203
20296
  } catch (err) {
20204
- logger$h.error(err);
20297
+ logger$g.error(err);
20205
20298
  }
20206
20299
  }, [value]);
20207
20300
  useEffect(() => {
@@ -20216,7 +20309,7 @@ const useLocalStorage = (key, defaultValue, options) => {
20216
20309
  setValue(event.newValue ? parser(event.newValue) : void 0);
20217
20310
  }
20218
20311
  } catch (err) {
20219
- logger$h.error(err);
20312
+ logger$g.error(err);
20220
20313
  }
20221
20314
  };
20222
20315
  if (typeof window === "undefined")
@@ -22491,7 +22584,7 @@ const defaultPayoutAccountFormat = {
22491
22584
  [CountryCodes.Sweden]: "local",
22492
22585
  [CountryCodes.UnitedKingdom]: "local"
22493
22586
  };
22494
- const logger$g = createLogger("useScenarioConfiguration");
22587
+ const logger$f = createLogger("useScenarioConfiguration");
22495
22588
  const useScenarioConfiguration = ({
22496
22589
  getConfigurationData,
22497
22590
  getPayoutAccountFormatData,
@@ -22514,12 +22607,12 @@ const useScenarioConfiguration = ({
22514
22607
  const response = await getConfigurationData();
22515
22608
  setConfigurationResponse(response);
22516
22609
  } catch (err) {
22517
- logger$g.warn("WARNING: Configuration request failed - error:", err);
22610
+ logger$f.warn("WARNING: Configuration request failed - error:", err);
22518
22611
  } finally {
22519
22612
  setLoadingStatus("success");
22520
22613
  }
22521
22614
  };
22522
- makeConfigCallAndSave().catch(logger$g.error);
22615
+ makeConfigCallAndSave().catch(logger$f.error);
22523
22616
  }, [getConfigurationData, setLoadingStatus]);
22524
22617
  useEffect(() => {
22525
22618
  setLoadingStatus("loading");
@@ -22538,12 +22631,12 @@ const useScenarioConfiguration = ({
22538
22631
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
22539
22632
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
22540
22633
  } catch (err) {
22541
- logger$g.warn("WARNING: Payout format request failed - error:", err);
22634
+ logger$f.warn("WARNING: Payout format request failed - error:", err);
22542
22635
  } finally {
22543
22636
  setLoadingStatus("success");
22544
22637
  }
22545
22638
  };
22546
- makePayoutFormatCallAndSave().catch(logger$g.error);
22639
+ makePayoutFormatCallAndSave().catch(logger$f.error);
22547
22640
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus, existingBankAccountFormat]);
22548
22641
  const {
22549
22642
  fieldConfigurations,
@@ -23279,7 +23372,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
23279
23372
  ToastType2["ERROR"] = "error";
23280
23373
  return ToastType2;
23281
23374
  })(ToastType || {});
23282
- const logger$f = createLogger("FormRouterContextProvider");
23375
+ const logger$e = createLogger("FormRouterContextProvider");
23283
23376
  function FormRouterContextProvider({
23284
23377
  children,
23285
23378
  forms: forms2,
@@ -23299,7 +23392,7 @@ function FormRouterContextProvider({
23299
23392
  if (formIndex > -1) {
23300
23393
  setFormIndex(formIndex);
23301
23394
  } else {
23302
- logger$f.error("No form was found to have that field so form navigation failed.");
23395
+ logger$e.error("No form was found to have that field so form navigation failed.");
23303
23396
  }
23304
23397
  }
23305
23398
  }), [forms2, handleGetIdVerificationToken, setFormIndex]);
@@ -23912,7 +24005,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
23912
24005
  CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
23913
24006
  return CompanySearchEvents2;
23914
24007
  })(CompanySearchEvents || {});
23915
- const logger$e = createLogger("useCompanySearch");
24008
+ const logger$d = createLogger("useCompanySearch");
23916
24009
  const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
23917
24010
  function useCompanySearch({
23918
24011
  defaultData,
@@ -24040,7 +24133,7 @@ function useCompanySearch({
24040
24133
  state: companyData.state ?? stateOrProvince2
24041
24134
  });
24042
24135
  } catch (e) {
24043
- logger$e.error(e);
24136
+ logger$d.error(e);
24044
24137
  setError(e);
24045
24138
  setStatus("error");
24046
24139
  } finally {
@@ -24073,7 +24166,7 @@ function useCompanySearch({
24073
24166
  indexSearch: handleCompanyIndexSearch,
24074
24167
  deepSearch: handleCompanyDeepSearch,
24075
24168
  resultsLimit: limit
24076
- })) == null ? void 0 : _a.catch((e) => logger$e.error(e));
24169
+ })) == null ? void 0 : _a.catch((e) => logger$d.error(e));
24077
24170
  }
24078
24171
  }, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
24079
24172
  useEffect(() => {
@@ -25851,7 +25944,7 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity) => {
25851
25944
  }
25852
25945
  }, {});
25853
25946
  };
25854
- const logger$d = createLogger("useFormTaskSubmit");
25947
+ const logger$c = createLogger("useFormTaskSubmit");
25855
25948
  function useCompanySearchTaskSubmit({
25856
25949
  task,
25857
25950
  forms: forms2,
@@ -25897,7 +25990,7 @@ function useCompanySearchTaskSubmit({
25897
25990
  });
25898
25991
  }
25899
25992
  } catch (e) {
25900
- logger$d.error(e);
25993
+ logger$c.error(e);
25901
25994
  userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
25902
25995
  segmentation: {
25903
25996
  ...baseTrackingPayload,
@@ -25949,7 +26042,7 @@ function useCompanySearchTaskSubmit({
25949
26042
  ...trackingPayload
25950
26043
  }
25951
26044
  });
25952
- logger$d.log(submittedLegalEntity);
26045
+ logger$c.log(submittedLegalEntity);
25953
26046
  setAccountHolder(entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type]);
25954
26047
  clearToasts();
25955
26048
  onExternalSubmit == null ? void 0 : onExternalSubmit(data);
@@ -25974,7 +26067,7 @@ function useCompanySearchTaskSubmit({
25974
26067
  type: ToastType.ERROR
25975
26068
  });
25976
26069
  }
25977
- logger$d.error(e);
26070
+ logger$c.error(e);
25978
26071
  userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
25979
26072
  segmentation: {
25980
26073
  ...baseTrackingPayload,
@@ -26407,25 +26500,32 @@ const useShouldShowIntroduction = ({
26407
26500
  });
26408
26501
  return canSeeIntroduction && !hasSeenIntroduction;
26409
26502
  };
26410
- const logger$c = createLogger("useAssociatedLegalArrangement");
26503
+ const logger$b = createLogger("useAssociatedLegalArrangement");
26411
26504
  function useAssociatedLegalArrangement({
26412
26505
  rootLegalEntity,
26413
26506
  getLegalEntity: getLegalEntity2
26414
26507
  }) {
26415
26508
  const [associatedLegalArrangement, setAssociatedLegalArrangement] = useState();
26416
26509
  const getAssociatedEntity = useCallback(async (entityId) => getLegalEntity2 == null ? void 0 : getLegalEntity2(entityId), [getLegalEntity2]);
26417
- useEffect(() => {
26510
+ const refreshAssociatedLegalArrangement = useCallback(() => {
26418
26511
  var _a;
26419
26512
  const foundEntity = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST);
26420
26513
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
26421
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$c.error);
26514
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$b.error);
26515
+ }
26516
+ }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
26517
+ useEffect(() => {
26518
+ if (!associatedLegalArrangement) {
26519
+ refreshAssociatedLegalArrangement();
26422
26520
  }
26423
26521
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
26424
26522
  return {
26425
- associatedLegalArrangement
26523
+ associatedLegalArrangement,
26524
+ setAssociatedLegalArrangement,
26525
+ refreshAssociatedLegalArrangement
26426
26526
  };
26427
26527
  }
26428
- const logger$b = createLogger("useExemptSettlor");
26528
+ const logger$a = createLogger("useExemptSettlor");
26429
26529
  const useExemptSettlor = ({
26430
26530
  trust: trust2,
26431
26531
  handleGetLegalEntity
@@ -26437,9 +26537,9 @@ const useExemptSettlor = ({
26437
26537
  setExemptSettlor(exemptSettlorLE);
26438
26538
  }, [handleGetLegalEntity]);
26439
26539
  useEffect(() => {
26440
- if (!trust2)
26540
+ if (!(trust2 == null ? void 0 : trust2.trust))
26441
26541
  return;
26442
- updateExemptSettlor(trust2).catch(logger$b.error);
26542
+ updateExemptSettlor(trust2).catch(logger$a.error);
26443
26543
  }, [trust2, updateExemptSettlor]);
26444
26544
  return exemptSettlor;
26445
26545
  };
@@ -26469,26 +26569,6 @@ function useSalesChannelsSettings() {
26469
26569
  return settings;
26470
26570
  }, [isSettingEnabled]);
26471
26571
  }
26472
- const logger$a = createLogger("useTrust");
26473
- const useTrust = ({
26474
- rootLegalEntity,
26475
- handleGetLegalEntity
26476
- }) => {
26477
- const [trust2, setTrust] = useState();
26478
- const refreshTrust = useCallback(async () => {
26479
- var _a, _b;
26480
- const trustId = (_b = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((association2) => association2.type === LegalEntityType.TRUST)) == null ? void 0 : _b.legalEntityId;
26481
- const trustLE = trustId ? await handleGetLegalEntity(trustId) : void 0;
26482
- setTrust(trustLE);
26483
- return trustLE;
26484
- }, [handleGetLegalEntity]);
26485
- useEffect(() => {
26486
- if (hasOwnEntityAssociationOfType(LegalEntityType.TRUST, rootLegalEntity.entityAssociations, rootLegalEntity.id)) {
26487
- refreshTrust().catch(logger$a.error);
26488
- }
26489
- }, [refreshTrust]);
26490
- return [trust2, refreshTrust];
26491
- };
26492
26572
  const downloadFile = async (base64, filename) => {
26493
26573
  saveBlobAsFile(base64ToBlob(base64), filename);
26494
26574
  };
@@ -31889,7 +31969,7 @@ function DropinComposerComponent({
31889
31969
  onNavigate = noop,
31890
31970
  ...args
31891
31971
  }) {
31892
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
31972
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
31893
31973
  const {
31894
31974
  contextCountry,
31895
31975
  accountHolder: accountHolder2,
@@ -31932,20 +32012,17 @@ function DropinComposerComponent({
31932
32012
  const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
31933
32013
  const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
31934
32014
  const {
31935
- associatedLegalArrangement
32015
+ associatedLegalArrangement,
32016
+ setAssociatedLegalArrangement,
32017
+ refreshAssociatedLegalArrangement
31936
32018
  } = useAssociatedLegalArrangement({
31937
32019
  rootLegalEntity,
31938
32020
  getLegalEntity: args == null ? void 0 : args.handleGetLegalEntity
31939
32021
  });
31940
32022
  const [associatedLegalEntityParent, setAssociatedLegalEntityParent] = useState(null);
31941
32023
  const [legalEntityType, setLegalEntityType] = useState(null);
31942
- const [solePropietor, setSolePropietor] = useState(null);
31943
- const [trust2, refreshTrust] = useTrust({
31944
- rootLegalEntity,
31945
- handleGetLegalEntity: args.handleGetLegalEntity
31946
- });
31947
32024
  const exemptSettlor = useExemptSettlor({
31948
- trust: trust2,
32025
+ trust: associatedLegalArrangement,
31949
32026
  handleGetLegalEntity: args.handleGetLegalEntity
31950
32027
  });
31951
32028
  const [trustMember, setTrustMember] = useState(null);
@@ -31960,9 +32037,9 @@ function DropinComposerComponent({
31960
32037
  const hasTrust = accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
31961
32038
  const reviewRequired = (rootLegalEntity == null ? void 0 : rootLegalEntity.id) && ((_b = (_a = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _a[rootLegalEntity.id]) == null ? void 0 : _b.isReviewRequired);
31962
32039
  const additionalSalesChannels = useSalesChannelsSettings();
31963
- const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), trust2 == null ? void 0 : trust2.trust.countryOfGoverningLaw);
32040
+ const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), (_c = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _c.countryOfGoverningLaw);
31964
32041
  const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
31965
- const trustMembers2 = trust2 ? allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust2, rootLegalEntity, exemptSettlor) : getTrustMembers(trust2, rootLegalEntity, exemptSettlor) : [];
32042
+ const trustMembers2 = (associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) ? allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(associatedLegalArrangement, rootLegalEntity, exemptSettlor) : getTrustMembers(associatedLegalArrangement, rootLegalEntity, exemptSettlor) : [];
31966
32043
  const getLegalEntityProblems = (le) => {
31967
32044
  var _a2;
31968
32045
  if (le == null ? void 0 : le.id) {
@@ -32037,7 +32114,7 @@ function DropinComposerComponent({
32037
32114
  if (id2) {
32038
32115
  try {
32039
32116
  const response = await (args == null ? void 0 : args.handleGetLegalEntity(id2));
32040
- setSolePropietor(response);
32117
+ setAssociatedLegalArrangement(response);
32041
32118
  } catch (e) {
32042
32119
  showToast({
32043
32120
  label: i18n.get("failedToFetchSoleProp"),
@@ -32097,21 +32174,21 @@ function DropinComposerComponent({
32097
32174
  case "company":
32098
32175
  await deleteAssociatedTrustMember({
32099
32176
  associatedTrustMember: trustMember2,
32100
- trust: trust2,
32177
+ trust: associatedLegalArrangement,
32101
32178
  handleUpdateLegalEntity: args.handleUpdateLegalEntity
32102
32179
  });
32103
32180
  break;
32104
32181
  case "undefinedBeneficiary":
32105
32182
  await deleteUndefinedBeneficiary({
32106
32183
  undefinedBeneficiary: trustMember2,
32107
- trust: trust2,
32184
+ trust: associatedLegalArrangement,
32108
32185
  handleUpdateLegalEntity: args.handleUpdateLegalEntity
32109
32186
  });
32110
32187
  break;
32111
32188
  case "rootTrustee":
32112
32189
  throw new Error("Cannot delete root trustee");
32113
32190
  }
32114
- await refreshTrust();
32191
+ await refreshAssociatedLegalArrangement();
32115
32192
  showToast({
32116
32193
  type: ToastType.SUCCESS,
32117
32194
  label: i18n.get("successFullyRemovedTrustMember")
@@ -32126,7 +32203,7 @@ function DropinComposerComponent({
32126
32203
  };
32127
32204
  const addOrUpdateTrustMember = async (updated, existing) => {
32128
32205
  if ((existing == null ? void 0 : existing.trustMemberType) === "undefinedBeneficiary" && updated.trustMemberType === "undefinedBeneficiary" && existing.description === updated.description) {
32129
- await refreshTrustAndRunOnSubmit(trust2, 1);
32206
+ await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
32130
32207
  return;
32131
32208
  }
32132
32209
  try {
@@ -32134,7 +32211,7 @@ function DropinComposerComponent({
32134
32211
  case "undefinedBeneficiary":
32135
32212
  await addOrUpdateUndefinedBeneficiary({
32136
32213
  newOrUpdated: updated,
32137
- trust: trust2,
32214
+ trust: associatedLegalArrangement,
32138
32215
  handleUpdateLegalEntity: args.handleUpdateLegalEntity
32139
32216
  });
32140
32217
  break;
@@ -32145,7 +32222,7 @@ function DropinComposerComponent({
32145
32222
  handleCreateLegalEntity: args.handleCreateLegalEntity
32146
32223
  }) : await createExemptSettlor({
32147
32224
  exemptSettlor: updated,
32148
- trust: trust2,
32225
+ trust: associatedLegalArrangement,
32149
32226
  handleCreateLegalEntity: args.handleCreateLegalEntity
32150
32227
  });
32151
32228
  updated.legalEntityId = newSettlorLE.id;
@@ -32164,7 +32241,7 @@ function DropinComposerComponent({
32164
32241
  }
32165
32242
  await addOrUpdateAssociatedTrustMember({
32166
32243
  newOrUpdated: updated,
32167
- trust: trust2,
32244
+ trust: associatedLegalArrangement,
32168
32245
  handleUpdateLegalEntity: args.handleUpdateLegalEntity
32169
32246
  });
32170
32247
  break;
@@ -32172,7 +32249,7 @@ function DropinComposerComponent({
32172
32249
  case "company":
32173
32250
  await addOrUpdateAssociatedTrustMember({
32174
32251
  newOrUpdated: updated,
32175
- trust: trust2,
32252
+ trust: associatedLegalArrangement,
32176
32253
  handleUpdateLegalEntity: args.handleUpdateLegalEntity
32177
32254
  });
32178
32255
  break;
@@ -32181,7 +32258,7 @@ function DropinComposerComponent({
32181
32258
  existing.roles = updated.roles;
32182
32259
  await updateRootTrusteeTrustMember({
32183
32260
  trustMember: existing,
32184
- trust: trust2,
32261
+ trust: associatedLegalArrangement,
32185
32262
  handleUpdateLegalEntity: args.handleUpdateLegalEntity
32186
32263
  });
32187
32264
  }
@@ -32193,7 +32270,7 @@ function DropinComposerComponent({
32193
32270
  label: i18n.get("successfullyUpdatedDetails"),
32194
32271
  type: ToastType.SUCCESS
32195
32272
  });
32196
- await refreshTrustAndRunOnSubmit(trust2, 1);
32273
+ await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
32197
32274
  } catch (err) {
32198
32275
  logger$8.error(err);
32199
32276
  showToast({
@@ -32233,7 +32310,7 @@ function DropinComposerComponent({
32233
32310
  if (id2) {
32234
32311
  try {
32235
32312
  await getTransferInstrument2(id2);
32236
- if (hasSolePropInLegalEntity(rootLegalEntity) && !solePropietor) {
32313
+ if (hasSolePropInLegalEntity(rootLegalEntity) && !associatedLegalArrangement) {
32237
32314
  await getSolePropietor();
32238
32315
  }
32239
32316
  } finally {
@@ -32264,8 +32341,7 @@ function DropinComposerComponent({
32264
32341
  };
32265
32342
  const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
32266
32343
  try {
32267
- const trust22 = await refreshTrust();
32268
- if (trust22) {
32344
+ if (associatedLegalArrangement) {
32269
32345
  onNavigateTo(task);
32270
32346
  } else {
32271
32347
  onNavigateTo(TaskTypes.TRUST);
@@ -32360,8 +32436,8 @@ function DropinComposerComponent({
32360
32436
  await refreshLegalEntity();
32361
32437
  navigateBack(backStepCount);
32362
32438
  };
32363
- const refreshTrustAndRunOnSubmit = async (data, backSteps) => {
32364
- await refreshTrust();
32439
+ const refreshLegalArrangementAndRunOnSubmit = async (data, backSteps) => {
32440
+ await refreshAssociatedLegalArrangement();
32365
32441
  await componentOnSubmit(data, backSteps);
32366
32442
  };
32367
32443
  const onPciDownload = async () => {
@@ -32593,7 +32669,7 @@ function DropinComposerComponent({
32593
32669
  onChange: componentOnChange,
32594
32670
  eventEmitter,
32595
32671
  onSubmit: async (data) => {
32596
- await refreshTrust();
32672
+ await refreshAssociatedLegalArrangement();
32597
32673
  await componentOnSubmit(data);
32598
32674
  },
32599
32675
  handleHomeClick: navigateBack,
@@ -32613,14 +32689,14 @@ function DropinComposerComponent({
32613
32689
  topLevelLegalEntity: legalEntityResponse
32614
32690
  },
32615
32691
  taskType: TaskTypes.TRUST_MEMBER_INDIVIDUAL,
32616
- parentLegalEntity: trust2,
32692
+ parentLegalEntity: associatedLegalArrangement,
32617
32693
  legalEntityResponse: associatedLegalEntity,
32618
32694
  country: rootLegalEntityCountry,
32619
32695
  problems: getLegalEntityProblems(associatedLegalEntity),
32620
32696
  capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
32621
32697
  onChange: componentOnChange,
32622
32698
  eventEmitter,
32623
- onSubmit: (data) => refreshTrustAndRunOnSubmit(data, 2),
32699
+ onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
32624
32700
  handleBackClick: navigateBack,
32625
32701
  handleHomeClick: () => onNavigateTo(TaskTypes.TRUST_MEMBER_OVERVIEW),
32626
32702
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
@@ -32701,13 +32777,13 @@ function DropinComposerComponent({
32701
32777
  topLevelLegalEntity: legalEntityResponse
32702
32778
  },
32703
32779
  taskType: TaskTypes.TRUST_MEMBER_COMPANY,
32704
- parentLegalEntity: trust2,
32780
+ parentLegalEntity: associatedLegalArrangement,
32705
32781
  legalEntityResponse: associatedLegalEntity,
32706
32782
  capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
32707
- problems: (_c = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _c[rootLegalEntity.id],
32783
+ problems: (_d = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _d[rootLegalEntity.id],
32708
32784
  onChange: componentOnChange,
32709
32785
  eventEmitter,
32710
- onSubmit: (data) => refreshTrustAndRunOnSubmit(data, 2),
32786
+ onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
32711
32787
  handleBackClick: navigateBack,
32712
32788
  handleHomeClick: navigateBack,
32713
32789
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
@@ -32723,7 +32799,7 @@ function DropinComposerComponent({
32723
32799
  },
32724
32800
  taskType: currentTask,
32725
32801
  taskName: currentTask === TaskTypes.PAYIN ? "payinDetails" : "payoutDetails",
32726
- problems: (_d = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _d[transferInstrument == null ? void 0 : transferInstrument.id],
32802
+ problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _e[transferInstrument == null ? void 0 : transferInstrument.id],
32727
32803
  transferInstrument,
32728
32804
  setTransferInstrument,
32729
32805
  legalEntityResponse: rootLegalEntity,
@@ -32752,16 +32828,16 @@ function DropinComposerComponent({
32752
32828
  topLevelLegalEntity: legalEntityResponse
32753
32829
  },
32754
32830
  taskType: TaskTypes.TRUST,
32755
- problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[trust2 == null ? void 0 : trust2.id],
32831
+ problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _f[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
32756
32832
  parentLegalEntity: rootLegalEntity,
32757
- legalEntityResponse: trust2,
32833
+ legalEntityResponse: associatedLegalArrangement,
32758
32834
  capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
32759
32835
  onChange: componentOnChange,
32760
32836
  eventEmitter,
32761
- onSubmit: componentOnSubmit,
32837
+ onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
32762
32838
  handleHomeClick: navigateBack,
32763
32839
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
32764
- country: (((_f = trust2 == null ? void 0 : trust2.trust) == null ? void 0 : _f.countryOfGoverningLaw) || ((_g = trust2 == null ? void 0 : trust2.trust) == null ? void 0 : _g.registeredAddress.country)) ?? rootLegalEntityCountry,
32840
+ country: (((_g = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _g.countryOfGoverningLaw) || ((_h = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _h.registeredAddress.country)) ?? rootLegalEntityCountry,
32765
32841
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
32766
32842
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
32767
32843
  });
@@ -32778,7 +32854,7 @@ function DropinComposerComponent({
32778
32854
  return jsx(RoleAndTypeDropinComponent, {
32779
32855
  navigateToFullDropinFor: onNavigateToTrustMember,
32780
32856
  navigateBack: async () => {
32781
- await refreshTrust();
32857
+ await refreshAssociatedLegalArrangement();
32782
32858
  navigateBack();
32783
32859
  },
32784
32860
  existingTrustMember: trustMember,
@@ -32806,15 +32882,15 @@ function DropinComposerComponent({
32806
32882
  ...args,
32807
32883
  taskType: TaskTypes.SOLE_PROPRIETOR_COMPANY,
32808
32884
  parentLegalEntity: rootLegalEntity,
32809
- legalEntityResponse: solePropietor,
32885
+ legalEntityResponse: associatedLegalArrangement,
32810
32886
  capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
32811
- problems: (_h = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _h[solePropietor == null ? void 0 : solePropietor.id],
32887
+ problems: (_i = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _i[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
32812
32888
  onChange: componentOnChange,
32813
32889
  eventEmitter,
32814
- onSubmit: componentOnSubmit,
32890
+ onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
32815
32891
  handleHomeClick: navigateBack,
32816
32892
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
32817
- country: (((_i = solePropietor == null ? void 0 : solePropietor.soleProprietorship) == null ? void 0 : _i.countryOfGoverningLaw) || ((_k = (_j = solePropietor == null ? void 0 : solePropietor.soleProprietorship) == null ? void 0 : _j.registeredAddress) == null ? void 0 : _k.country)) ?? rootLegalEntityCountry,
32893
+ country: (((_j = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _j.countryOfGoverningLaw) || ((_l = (_k = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _k.registeredAddress) == null ? void 0 : _l.country)) ?? rootLegalEntityCountry,
32818
32894
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
32819
32895
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
32820
32896
  });
@@ -33434,46 +33510,46 @@ function CreateTransferInstrumentComponent({
33434
33510
  taskType: TaskTypes.PAYOUT
33435
33511
  }) : null;
33436
33512
  }
33513
+ var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
33514
+ OnboardingUrlTarget2["BLANK"] = "_blank";
33515
+ OnboardingUrlTarget2["SELF"] = "_self";
33516
+ return OnboardingUrlTarget2;
33517
+ })(OnboardingUrlTarget || {});
33437
33518
  var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
33438
- OnboardingStatus2["INCOMPLETE"] = "INCOMPLETE";
33439
- OnboardingStatus2["PROCESSING"] = "PROCESSING";
33440
- OnboardingStatus2["ERROR"] = "ERROR";
33441
- OnboardingStatus2["FINISHED"] = "FINISHED";
33519
+ OnboardingStatus2["AWAITING_DATA"] = "AWAITING_DATA";
33520
+ OnboardingStatus2["IN_REVIEW"] = "IN_REVIEW";
33521
+ OnboardingStatus2["UNSUCCESSFUL"] = "UNSUCCESSFUL";
33522
+ OnboardingStatus2["REJECTED"] = "REJECTED";
33523
+ OnboardingStatus2["VERIFIED"] = "VERIFIED";
33442
33524
  return OnboardingStatus2;
33443
33525
  })(OnboardingStatus || {});
33444
33526
  const contentMap = {
33445
- [OnboardingStatus.INCOMPLETE]: {
33446
- header: "onboardingRedirectInitialHeader",
33447
- description: ["onboardingRedirectInitialDescriptionP1"],
33448
- ctaButton: "onboardingRedirectInitialCtaButton"
33527
+ [OnboardingStatus.AWAITING_DATA]: {
33528
+ description: ["onboardingRedirectAwaitingDescriptionP1"],
33529
+ ctaButton: "onboardingRedirectAwaitingCtaButton"
33449
33530
  },
33450
- [OnboardingStatus.PROCESSING]: {
33451
- header: "onboardingRedirectInProgressHeader",
33452
- description: ["onboardingRedirectInProgressDescriptionP1"],
33453
- ctaButton: "onboardingRedirectInProgressCtaButton"
33531
+ [OnboardingStatus.IN_REVIEW]: {
33532
+ description: ["onboardingRedirectInReviewDescriptionP1"],
33533
+ ctaButton: "onboardingRedirectInReviewCtaButton"
33454
33534
  },
33455
- [OnboardingStatus.ERROR]: {
33456
- header: "onboardingRedirectErrorsHeader",
33457
- description: ["onboardingRedirectErrorsDescriptionP1", "onboardingRedirectErrorsDescriptionP2"],
33458
- ctaButton: "onboardingRedirectErrorsCtaButton"
33535
+ [OnboardingStatus.UNSUCCESSFUL]: {
33536
+ description: ["onboardingRedirectUnsuccessfulDescriptionP1"],
33537
+ ctaButton: "onboardingRedirectUnsuccessfulCtaButton"
33459
33538
  },
33460
- [OnboardingStatus.FINISHED]: {
33461
- header: "onboardingRedirectFinishedHeader",
33462
- description: ["onboardingRedirectFinishedDescriptionP1"],
33463
- ctaButton: "onboardingRedirectFinishedCtaButton"
33539
+ [OnboardingStatus.REJECTED]: {
33540
+ description: ["onboardingRedirectRejectedDescriptionP1"]
33541
+ },
33542
+ [OnboardingStatus.VERIFIED]: {
33543
+ description: ["onboardingRedirectVerifiedDescriptionP1"]
33464
33544
  }
33465
33545
  };
33466
33546
  function getContentByStatus(status) {
33467
33547
  return contentMap[status];
33468
33548
  }
33469
- var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
33470
- OnboardingUrlTarget2["BLANK"] = "_blank";
33471
- OnboardingUrlTarget2["SELF"] = "_self";
33472
- return OnboardingUrlTarget2;
33473
- })(OnboardingUrlTarget || {});
33474
- const logger$5 = createLogger("OnboardingRedirectComponent");
33475
- function OnboardingRedirectComponent({
33549
+ const logger$5 = createLogger("ViewVerificationStatusComponent");
33550
+ function ViewVerificationStatusComponent({
33476
33551
  legalEntityId,
33552
+ hideExplanation = false,
33477
33553
  returnUrl,
33478
33554
  redirectTarget,
33479
33555
  onStatusChange,
@@ -33557,6 +33633,12 @@ function OnboardingRedirectComponent({
33557
33633
  const {
33558
33634
  redirectUrl
33559
33635
  } = await generateOnboardingLink2(config);
33636
+ if (!redirectUrl) {
33637
+ handleError({
33638
+ trKey: "onboardingRedirectLinkError"
33639
+ });
33640
+ return;
33641
+ }
33560
33642
  openUrl(redirectUrl, config);
33561
33643
  } catch (error) {
33562
33644
  handleError({
@@ -33584,6 +33666,20 @@ function OnboardingRedirectComponent({
33584
33666
  });
33585
33667
  }
33586
33668
  };
33669
+ const renderFooter = () => {
33670
+ const statusesWithoutActions = [OnboardingStatus.REJECTED, OnboardingStatus.VERIFIED];
33671
+ if (statusesWithoutActions.includes(onboardingStatus) || !(content == null ? void 0 : content.ctaButton)) {
33672
+ return;
33673
+ }
33674
+ return jsx(Button, {
33675
+ label: i18n.get(content.ctaButton),
33676
+ onClick: redirectToAdyen,
33677
+ type: "button",
33678
+ className: "adyen-view-verification-status__button",
33679
+ role: "link",
33680
+ status: loadingLinkStatus === "loading" ? "loading" : "default"
33681
+ });
33682
+ };
33587
33683
  const renderBody = () => {
33588
33684
  if (alertContent) {
33589
33685
  return jsx(Alert, {
@@ -33594,24 +33690,12 @@ function OnboardingRedirectComponent({
33594
33690
  }
33595
33691
  if (content) {
33596
33692
  return jsxs(Fragment, {
33597
- children: [jsx("h1", {
33598
- className: "adyen-onboarding-redirect__header",
33599
- children: i18n.get(content.header)
33600
- }), content.description.map((key) => jsx("p", {
33601
- className: "adyen-onboarding-redirect__description",
33693
+ children: [hideExplanation ? null : content.description.map((key) => jsx("p", {
33694
+ className: "adyen-view-verification-status__description",
33602
33695
  children: i18n.get(key)
33603
33696
  }, key)), jsx("div", {
33604
- className: "adyen-onboarding-redirect__footer",
33605
- children: jsx(Button, {
33606
- label: i18n.get(content.ctaButton),
33607
- onClick: redirectToAdyen,
33608
- type: "button",
33609
- className: "adyen-onboarding-redirect__button",
33610
- role: "link",
33611
- negative: onboardingStatus !== OnboardingStatus.FINISHED,
33612
- tertiary: onboardingStatus === OnboardingStatus.FINISHED,
33613
- status: loadingLinkStatus === "loading" ? "loading" : "default"
33614
- })
33697
+ className: "adyen-view-verification-status__footer",
33698
+ children: renderFooter()
33615
33699
  })]
33616
33700
  });
33617
33701
  }
@@ -33620,7 +33704,7 @@ function OnboardingRedirectComponent({
33620
33704
  });
33621
33705
  };
33622
33706
  return jsx("section", {
33623
- className: "adyen-onboarding-redirect",
33707
+ className: "adyen-view-verification-status",
33624
33708
  children: renderBody()
33625
33709
  });
33626
33710
  }
@@ -33635,7 +33719,7 @@ const componentsMap = {
33635
33719
  pci: PciDropinComponent,
33636
33720
  createTransferInstrumentComponent: CreateTransferInstrumentComponent,
33637
33721
  createIndividualComponent: CreateIndividualComponent,
33638
- onboardingRedirectComponent: OnboardingRedirectComponent
33722
+ viewVerificationStatusComponent: ViewVerificationStatusComponent
33639
33723
  };
33640
33724
  const AuthProvider = ({
33641
33725
  children,
@@ -34004,7 +34088,7 @@ const ConfigurationApiProvider = ({
34004
34088
  isEmbeddedDropin,
34005
34089
  loadingContext
34006
34090
  } = authContext;
34007
- const sdkVersion = "2.35.0";
34091
+ const sdkVersion = "2.36.0";
34008
34092
  useAnalytics({
34009
34093
  onUserEvent,
34010
34094
  isEmbeddedDropin,
@@ -35166,11 +35250,14 @@ const createIndividualComponentSchema = {
35166
35250
  type: "function"
35167
35251
  }
35168
35252
  };
35169
- const onboardingRedirectComponentSchema = {
35253
+ const viewVerificationStatusComponentSchema = {
35170
35254
  legalEntityId: {
35171
35255
  type: "string",
35172
35256
  required: true
35173
35257
  },
35258
+ hideExplanation: {
35259
+ type: "boolean"
35260
+ },
35174
35261
  redirectTarget: {
35175
35262
  type: "string"
35176
35263
  },
@@ -35198,7 +35285,7 @@ const componentsSchemaMap = {
35198
35285
  taskList: taskListSchema,
35199
35286
  createIndividualComponent: createIndividualComponentSchema,
35200
35287
  createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
35201
- onboardingRedirectComponent: onboardingRedirectComponentSchema
35288
+ viewVerificationStatusComponent: viewVerificationStatusComponentSchema
35202
35289
  };
35203
35290
  const validateComponentName = (componentName) => {
35204
35291
  if (!componentName) {