@adyen/kyc-components 2.34.2 → 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.
- package/dist/es/adyen-kyc-components.es.js +409 -233
- package/dist/style.css +6 -13
- package/dist/types/components/BaseElement.d.ts +1 -1
- package/dist/types/components/CompanyStructure/component/CompanyStructureComponent.d.ts +1 -3
- package/dist/types/components/Dropins/types.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/{OnboardingRedirect/OnboardingRedirectComponent.d.ts → ViewVerificationStatus/ViewVerificationStatusComponent.d.ts} +6 -5
- package/dist/types/components/EmbeddedDropins/{OnboardingRedirect → ViewVerificationStatus}/content.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/index.d.ts +2 -0
- package/dist/types/components/EmbeddedDropins/{OnboardingRedirect → ViewVerificationStatus}/types.d.ts +1 -1
- package/dist/types/components/UIElement.d.ts +2 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/internal/CollapsibleContainer/types.d.ts +1 -1
- package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiProvider.d.ts +5 -1
- package/dist/types/core/Context/SettingsContext/types.d.ts +2 -2
- package/dist/types/core/Context/SettingsContext/useSetting.d.ts +1 -1
- package/dist/types/core/SDKValidation/index.d.ts +1 -1
- package/dist/types/core/Services/componentApi/generate-onboarding-link.d.ts +1 -1
- package/dist/types/core/Services/componentApi/get-analytics-session.d.ts +2 -0
- package/dist/types/core/Services/componentApi/get-onboarding-status.d.ts +1 -1
- package/dist/types/core/Services/componentApi/push-events.d.ts +2 -0
- package/dist/types/core/core.d.ts +1 -1
- package/dist/types/core/hooks/useAnalytics.d.ts +11 -0
- package/dist/types/core/hooks/useAssociatedLegalArrangement.d.ts +2 -0
- package/dist/types/core/hooks/useComponentApi.d.ts +4 -0
- package/dist/types/core/models/api/analytics.d.ts +9 -0
- package/dist/types/core/models/api/{onboarding-redirect.d.ts → view-verification-status.d.ts} +6 -6
- package/dist/types/core/user-events.d.ts +7 -8
- package/dist/types/utils/masking/maskTypes.d.ts +5 -0
- package/dist/types/utils/masking/matchAgainstMask.d.ts +3 -0
- package/dist/types/utils/masking/shiftRight.d.ts +15 -0
- package/package.json +1 -1
- package/dist/types/components/EmbeddedDropins/OnboardingRedirect/index.d.ts +0 -2
- package/dist/types/core/hooks/useTrust.d.ts +0 -11
|
@@ -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
|
|
1239
|
-
const
|
|
1240
|
-
const
|
|
1241
|
-
const
|
|
1242
|
-
const
|
|
1243
|
-
const
|
|
1244
|
-
const
|
|
1245
|
-
const
|
|
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
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
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
|
};
|
|
@@ -2712,7 +2702,6 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
|
|
|
2712
2702
|
SettingNames2["AllowIntraRegionCrossBorderPayout"] = "allowIntraRegionCrossBorderPayout";
|
|
2713
2703
|
SettingNames2["AllowLegalEntityTypeChange"] = "changeLegalEntityType";
|
|
2714
2704
|
SettingNames2["AllowPrefilledCountryEdit"] = "editPrefilledCountry";
|
|
2715
|
-
SettingNames2["LimitToOneTransferInstrument"] = "limitToOneTransferInstrument";
|
|
2716
2705
|
SettingNames2["RequirePciSignEcommerce"] = "requirePciSignEcommerce";
|
|
2717
2706
|
SettingNames2["RequirePciSignPos"] = "requirePciSignPos";
|
|
2718
2707
|
SettingNames2["RequirePciSignEcomMoto"] = "requirePciSignEcomMoto";
|
|
@@ -2721,6 +2710,7 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
|
|
|
2721
2710
|
SettingNames2["HideOnboardingIntroductionOrganization"] = "hideOnboardingIntroductionOrganization";
|
|
2722
2711
|
SettingNames2["HideOnboardingIntroductionTrust"] = "hideOnboardingIntroductionTrust";
|
|
2723
2712
|
SettingNames2["HideOnboardingIntroductionSoleProprietor"] = "hideOnboardingIntroductionSoleProprietor";
|
|
2713
|
+
SettingNames2["TransferInstrumentLimit"] = "transferInstrumentLimit";
|
|
2724
2714
|
SettingNames2["ViewOnboardingGuidance"] = "viewOnboardingGuidance";
|
|
2725
2715
|
return SettingNames2;
|
|
2726
2716
|
})(SettingNames || {});
|
|
@@ -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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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$
|
|
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$
|
|
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$
|
|
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 = {
|
|
@@ -8173,13 +8268,16 @@ var Placement = /* @__PURE__ */ ((Placement2) => {
|
|
|
8173
8268
|
function CollapsibleContainer({
|
|
8174
8269
|
children,
|
|
8175
8270
|
collapsed = false,
|
|
8176
|
-
animationDuration
|
|
8271
|
+
animationDuration = 0
|
|
8177
8272
|
}) {
|
|
8178
8273
|
const collapsibleContainerEl = useRef(null);
|
|
8179
8274
|
const [height, setHeight] = useState(collapsed ? 0 : void 0);
|
|
8180
8275
|
useEffect(() => {
|
|
8181
8276
|
var _a;
|
|
8182
8277
|
setHeight(collapsed ? 0 : (_a = collapsibleContainerEl.current) == null ? void 0 : _a.scrollHeight);
|
|
8278
|
+
setTimeout(() => {
|
|
8279
|
+
setHeight(collapsed ? 0 : "auto");
|
|
8280
|
+
}, animationDuration * 1e3);
|
|
8183
8281
|
}, [collapsed]);
|
|
8184
8282
|
return jsx("div", {
|
|
8185
8283
|
className: "adyen-collapsible-container",
|
|
@@ -8187,7 +8285,7 @@ function CollapsibleContainer({
|
|
|
8187
8285
|
ref: collapsibleContainerEl,
|
|
8188
8286
|
style: {
|
|
8189
8287
|
height,
|
|
8190
|
-
transitionDuration: animationDuration
|
|
8288
|
+
transitionDuration: `${animationDuration}s`
|
|
8191
8289
|
},
|
|
8192
8290
|
children
|
|
8193
8291
|
});
|
|
@@ -8279,7 +8377,7 @@ function AccordionItem({
|
|
|
8279
8377
|
}) : null]
|
|
8280
8378
|
}), jsx(CollapsibleContainer, {
|
|
8281
8379
|
collapsed: !isOpen,
|
|
8282
|
-
animationDuration:
|
|
8380
|
+
animationDuration: 0.1,
|
|
8283
8381
|
children: jsx("div", {
|
|
8284
8382
|
className: "adl-accordion__content",
|
|
8285
8383
|
children
|
|
@@ -10499,7 +10597,7 @@ const accountHolderValidationRules = {
|
|
|
10499
10597
|
}
|
|
10500
10598
|
};
|
|
10501
10599
|
const accountHolderFields = ["accountHolder"];
|
|
10502
|
-
const logger$
|
|
10600
|
+
const logger$p = createLogger("AccountHolder");
|
|
10503
10601
|
function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
|
|
10504
10602
|
switch (legalEntityType) {
|
|
10505
10603
|
case LegalEntityType.ORGANIZATION: {
|
|
@@ -10509,7 +10607,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
|
|
|
10509
10607
|
return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
|
|
10510
10608
|
}
|
|
10511
10609
|
default:
|
|
10512
|
-
logger$
|
|
10610
|
+
logger$p.error(`No available account holder options for legal entity type '${legalEntityType}'`);
|
|
10513
10611
|
return [];
|
|
10514
10612
|
}
|
|
10515
10613
|
}
|
|
@@ -10550,7 +10648,8 @@ function AccountHolder(props) {
|
|
|
10550
10648
|
const defaultData = {
|
|
10551
10649
|
accountHolder: isDefaultOptionAvailable ? (_a = props.data) == null ? void 0 : _a.accountHolder : void 0
|
|
10552
10650
|
};
|
|
10553
|
-
|
|
10651
|
+
const isNewEntryFlowEnabled = isExperimentEnabled("EnableNewEntryFlow");
|
|
10652
|
+
if (isNewEntryFlowEnabled && defaultData) {
|
|
10554
10653
|
defaultData.accountHolder = accountHolder2 || defaultData.accountHolder;
|
|
10555
10654
|
}
|
|
10556
10655
|
const {
|
|
@@ -10589,6 +10688,9 @@ function AccountHolder(props) {
|
|
|
10589
10688
|
label: questionLabel,
|
|
10590
10689
|
errorMessage: formUtils.getErrorMessage("accountHolder", errors, fieldProblems),
|
|
10591
10690
|
isValid: valid.accountHolder,
|
|
10691
|
+
className: cx({
|
|
10692
|
+
"adl-u-display-none": isNewEntryFlowEnabled
|
|
10693
|
+
}),
|
|
10592
10694
|
classNameModifiers: ["account-holder"],
|
|
10593
10695
|
children: (childProps) => jsx(Select, {
|
|
10594
10696
|
...childProps,
|
|
@@ -11252,7 +11354,7 @@ function Dropzone(props) {
|
|
|
11252
11354
|
})]
|
|
11253
11355
|
});
|
|
11254
11356
|
}
|
|
11255
|
-
const logger$
|
|
11357
|
+
const logger$o = createLogger("TextArea");
|
|
11256
11358
|
function TextArea(props) {
|
|
11257
11359
|
const {
|
|
11258
11360
|
classNameModifiers,
|
|
@@ -11273,7 +11375,7 @@ function TextArea(props) {
|
|
|
11273
11375
|
} = useI18nContext();
|
|
11274
11376
|
const [value, setValue] = useState("");
|
|
11275
11377
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11276
|
-
logger$
|
|
11378
|
+
logger$o.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11277
11379
|
}
|
|
11278
11380
|
const handleInput = (e) => {
|
|
11279
11381
|
var _a;
|
|
@@ -11686,7 +11788,7 @@ function FieldContainer(props) {
|
|
|
11686
11788
|
}
|
|
11687
11789
|
return renderField(fieldName);
|
|
11688
11790
|
}
|
|
11689
|
-
const logger$
|
|
11791
|
+
const logger$n = createLogger("SearchAddress");
|
|
11690
11792
|
const SearchAddress = ({
|
|
11691
11793
|
data,
|
|
11692
11794
|
legalEntityId,
|
|
@@ -11729,7 +11831,7 @@ const SearchAddress = ({
|
|
|
11729
11831
|
const response = await handleFindAddress(selectedAddressId);
|
|
11730
11832
|
autocompleteAddressForm(response);
|
|
11731
11833
|
} catch (e) {
|
|
11732
|
-
logger$
|
|
11834
|
+
logger$n.error(e);
|
|
11733
11835
|
}
|
|
11734
11836
|
};
|
|
11735
11837
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -11741,7 +11843,7 @@ const SearchAddress = ({
|
|
|
11741
11843
|
}, legalEntityId);
|
|
11742
11844
|
setItems((response == null ? void 0 : response.results) || []);
|
|
11743
11845
|
} catch (e) {
|
|
11744
|
-
logger$
|
|
11846
|
+
logger$n.error(e);
|
|
11745
11847
|
}
|
|
11746
11848
|
};
|
|
11747
11849
|
const onChange = (e) => {
|
|
@@ -11796,7 +11898,7 @@ const SearchAddress = ({
|
|
|
11796
11898
|
setItems([]);
|
|
11797
11899
|
}
|
|
11798
11900
|
} catch (e) {
|
|
11799
|
-
logger$
|
|
11901
|
+
logger$n.error(e);
|
|
11800
11902
|
}
|
|
11801
11903
|
setLoading(false);
|
|
11802
11904
|
}
|
|
@@ -14741,7 +14843,7 @@ const initOnfido = async ({
|
|
|
14741
14843
|
language: getOnfidoLocaleConfig(i18n)
|
|
14742
14844
|
});
|
|
14743
14845
|
};
|
|
14744
|
-
const logger$
|
|
14846
|
+
const logger$m = createLogger("IdVerificationComponent");
|
|
14745
14847
|
function IdVerificationComponent({
|
|
14746
14848
|
userDetails,
|
|
14747
14849
|
legalEntityId,
|
|
@@ -14774,7 +14876,7 @@ function IdVerificationComponent({
|
|
|
14774
14876
|
onIdVerificationError,
|
|
14775
14877
|
onIdVerificationComplete
|
|
14776
14878
|
});
|
|
14777
|
-
})().catch(logger$
|
|
14879
|
+
})().catch(logger$m.error);
|
|
14778
14880
|
return () => {
|
|
14779
14881
|
if (onfidoSdk.current)
|
|
14780
14882
|
onfidoSdk.current.tearDown();
|
|
@@ -14826,7 +14928,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
14826
14928
|
})]
|
|
14827
14929
|
});
|
|
14828
14930
|
}
|
|
14829
|
-
const logger$
|
|
14931
|
+
const logger$l = createLogger("IdDocumentInstantVerificationComponent");
|
|
14830
14932
|
const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
|
|
14831
14933
|
const documentTypeValidationRules = {
|
|
14832
14934
|
instantIdVerificationData: {
|
|
@@ -14908,7 +15010,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
14908
15010
|
userDetails: props.userDetails,
|
|
14909
15011
|
legalEntityId: props.legalEntityId,
|
|
14910
15012
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
14911
|
-
onIdVerificationError: logger$
|
|
15013
|
+
onIdVerificationError: logger$l.error
|
|
14912
15014
|
}), jsxs("div", {
|
|
14913
15015
|
className: "adyen-kyc-document-upload__manual-upload",
|
|
14914
15016
|
children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
|
|
@@ -17350,7 +17452,7 @@ function PersonalDetailsComponent(props) {
|
|
|
17350
17452
|
"aria-label": formUtils.getLabel("jobTitle"),
|
|
17351
17453
|
"aria-invalid": !valid.birthDate
|
|
17352
17454
|
})
|
|
17353
|
-
}),
|
|
17455
|
+
}), formUtils.isRequiredField("accountHolder") && data.residencyCountry && jsx(AccountHolder, {
|
|
17354
17456
|
...accountHolderProps,
|
|
17355
17457
|
country: data.residencyCountry,
|
|
17356
17458
|
dataStoreId: PERSONAL_DETAILS,
|
|
@@ -18352,7 +18454,7 @@ class AdyenKycSdkError extends Error {
|
|
|
18352
18454
|
}
|
|
18353
18455
|
let sdkToken;
|
|
18354
18456
|
let fetchSdkToken;
|
|
18355
|
-
const logger$
|
|
18457
|
+
const logger$k = createLogger("Session");
|
|
18356
18458
|
const setSdkToken = (token) => {
|
|
18357
18459
|
sdkToken = token;
|
|
18358
18460
|
};
|
|
@@ -18375,7 +18477,7 @@ const refreshSession = async () => {
|
|
|
18375
18477
|
setSdkToken(token);
|
|
18376
18478
|
isSessionRefreshed = true;
|
|
18377
18479
|
} catch (e) {
|
|
18378
|
-
logger$
|
|
18480
|
+
logger$k.error("Failed to fetch sdk token", e);
|
|
18379
18481
|
}
|
|
18380
18482
|
return isSessionRefreshed;
|
|
18381
18483
|
};
|
|
@@ -18385,7 +18487,7 @@ const addAnimationStartListener = (element, listener) => {
|
|
|
18385
18487
|
const removeAnimationStartListener = (element, listener) => {
|
|
18386
18488
|
element.removeEventListener("animationstart", listener, false);
|
|
18387
18489
|
};
|
|
18388
|
-
const logger$
|
|
18490
|
+
const logger$j = createLogger("Fetch");
|
|
18389
18491
|
const getRequestObject = (options, data) => {
|
|
18390
18492
|
const {
|
|
18391
18493
|
headers = [],
|
|
@@ -18432,10 +18534,10 @@ const logFetchError = (message, level) => {
|
|
|
18432
18534
|
case "info":
|
|
18433
18535
|
case "warn":
|
|
18434
18536
|
case "error":
|
|
18435
|
-
logger$
|
|
18537
|
+
logger$j[level](message);
|
|
18436
18538
|
break;
|
|
18437
18539
|
default:
|
|
18438
|
-
logger$
|
|
18540
|
+
logger$j.error(message);
|
|
18439
18541
|
}
|
|
18440
18542
|
};
|
|
18441
18543
|
const handleFetchResponse = async (response, responseType) => {
|
|
@@ -18528,7 +18630,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
18528
18630
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
18529
18631
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
18530
18632
|
const TINK_VENDOR = "Tink";
|
|
18531
|
-
const logger$
|
|
18633
|
+
const logger$i = createLogger("iframeWidget");
|
|
18532
18634
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
18533
18635
|
const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
18534
18636
|
const parseMessageJson = (message) => {
|
|
@@ -18547,7 +18649,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
18547
18649
|
try {
|
|
18548
18650
|
await response;
|
|
18549
18651
|
} catch (ex) {
|
|
18550
|
-
logger$
|
|
18652
|
+
logger$i.error(ex);
|
|
18551
18653
|
}
|
|
18552
18654
|
return {
|
|
18553
18655
|
error: "UNKNOWN_ERROR",
|
|
@@ -18656,7 +18758,7 @@ class IFrameWidget {
|
|
|
18656
18758
|
message = responseData.errorMessage;
|
|
18657
18759
|
}
|
|
18658
18760
|
} catch (ex) {
|
|
18659
|
-
logger$
|
|
18761
|
+
logger$i.error(ex);
|
|
18660
18762
|
}
|
|
18661
18763
|
throw new AdyenKycSdkError(reason, jsonData.error);
|
|
18662
18764
|
}
|
|
@@ -18844,7 +18946,7 @@ function BankVerificationWidget({
|
|
|
18844
18946
|
ref: widgetContainerRef
|
|
18845
18947
|
});
|
|
18846
18948
|
}
|
|
18847
|
-
const logger$
|
|
18949
|
+
const logger$h = createLogger("BankVerification");
|
|
18848
18950
|
const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
|
|
18849
18951
|
const InstantVerificationErrorContext = createContext(null);
|
|
18850
18952
|
const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
|
|
@@ -18878,7 +18980,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
|
|
|
18878
18980
|
const vendor = vendors[0];
|
|
18879
18981
|
setPreferredVendor(vendor.name ? vendor : void 0);
|
|
18880
18982
|
};
|
|
18881
|
-
getPreferredVendor().catch(logger$
|
|
18983
|
+
getPreferredVendor().catch(logger$h.error);
|
|
18882
18984
|
}, [country2, getBankVerificationVendors]);
|
|
18883
18985
|
return preferredVendor;
|
|
18884
18986
|
};
|
|
@@ -19790,9 +19892,7 @@ const ibanMask = (country2, inputLength, allowLettersInBban) => {
|
|
|
19790
19892
|
tokens.push(spacer, ...inputToken(remainder));
|
|
19791
19893
|
}
|
|
19792
19894
|
return {
|
|
19793
|
-
mask:
|
|
19794
|
-
tokens
|
|
19795
|
-
},
|
|
19895
|
+
mask: makeMask(...tokens),
|
|
19796
19896
|
transformOnType: allowLettersInBban ? uppercase : void 0
|
|
19797
19897
|
};
|
|
19798
19898
|
};
|
|
@@ -20141,7 +20241,7 @@ const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvi
|
|
|
20141
20241
|
}
|
|
20142
20242
|
});
|
|
20143
20243
|
const payoutVerificationMethods = ["instantVerification", "manualVerification"];
|
|
20144
|
-
const logger$
|
|
20244
|
+
const logger$g = createLogger("useLocalStorage");
|
|
20145
20245
|
const useLocalStorage = (key, defaultValue, options) => {
|
|
20146
20246
|
const {
|
|
20147
20247
|
serializer,
|
|
@@ -20162,7 +20262,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
20162
20262
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
20163
20263
|
return res;
|
|
20164
20264
|
} catch (err) {
|
|
20165
|
-
logger$
|
|
20265
|
+
logger$g.error(err);
|
|
20166
20266
|
return defaultValue;
|
|
20167
20267
|
}
|
|
20168
20268
|
});
|
|
@@ -20194,7 +20294,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
20194
20294
|
try {
|
|
20195
20295
|
updateLocalStorage();
|
|
20196
20296
|
} catch (err) {
|
|
20197
|
-
logger$
|
|
20297
|
+
logger$g.error(err);
|
|
20198
20298
|
}
|
|
20199
20299
|
}, [value]);
|
|
20200
20300
|
useEffect(() => {
|
|
@@ -20209,7 +20309,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
20209
20309
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
20210
20310
|
}
|
|
20211
20311
|
} catch (err) {
|
|
20212
|
-
logger$
|
|
20312
|
+
logger$g.error(err);
|
|
20213
20313
|
}
|
|
20214
20314
|
};
|
|
20215
20315
|
if (typeof window === "undefined")
|
|
@@ -22484,7 +22584,7 @@ const defaultPayoutAccountFormat = {
|
|
|
22484
22584
|
[CountryCodes.Sweden]: "local",
|
|
22485
22585
|
[CountryCodes.UnitedKingdom]: "local"
|
|
22486
22586
|
};
|
|
22487
|
-
const logger$
|
|
22587
|
+
const logger$f = createLogger("useScenarioConfiguration");
|
|
22488
22588
|
const useScenarioConfiguration = ({
|
|
22489
22589
|
getConfigurationData,
|
|
22490
22590
|
getPayoutAccountFormatData,
|
|
@@ -22507,12 +22607,12 @@ const useScenarioConfiguration = ({
|
|
|
22507
22607
|
const response = await getConfigurationData();
|
|
22508
22608
|
setConfigurationResponse(response);
|
|
22509
22609
|
} catch (err) {
|
|
22510
|
-
logger$
|
|
22610
|
+
logger$f.warn("WARNING: Configuration request failed - error:", err);
|
|
22511
22611
|
} finally {
|
|
22512
22612
|
setLoadingStatus("success");
|
|
22513
22613
|
}
|
|
22514
22614
|
};
|
|
22515
|
-
makeConfigCallAndSave().catch(logger$
|
|
22615
|
+
makeConfigCallAndSave().catch(logger$f.error);
|
|
22516
22616
|
}, [getConfigurationData, setLoadingStatus]);
|
|
22517
22617
|
useEffect(() => {
|
|
22518
22618
|
setLoadingStatus("loading");
|
|
@@ -22531,12 +22631,12 @@ const useScenarioConfiguration = ({
|
|
|
22531
22631
|
const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
|
|
22532
22632
|
setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
|
|
22533
22633
|
} catch (err) {
|
|
22534
|
-
logger$
|
|
22634
|
+
logger$f.warn("WARNING: Payout format request failed - error:", err);
|
|
22535
22635
|
} finally {
|
|
22536
22636
|
setLoadingStatus("success");
|
|
22537
22637
|
}
|
|
22538
22638
|
};
|
|
22539
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
22639
|
+
makePayoutFormatCallAndSave().catch(logger$f.error);
|
|
22540
22640
|
}, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus, existingBankAccountFormat]);
|
|
22541
22641
|
const {
|
|
22542
22642
|
fieldConfigurations,
|
|
@@ -23272,7 +23372,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
|
|
|
23272
23372
|
ToastType2["ERROR"] = "error";
|
|
23273
23373
|
return ToastType2;
|
|
23274
23374
|
})(ToastType || {});
|
|
23275
|
-
const logger$
|
|
23375
|
+
const logger$e = createLogger("FormRouterContextProvider");
|
|
23276
23376
|
function FormRouterContextProvider({
|
|
23277
23377
|
children,
|
|
23278
23378
|
forms: forms2,
|
|
@@ -23292,7 +23392,7 @@ function FormRouterContextProvider({
|
|
|
23292
23392
|
if (formIndex > -1) {
|
|
23293
23393
|
setFormIndex(formIndex);
|
|
23294
23394
|
} else {
|
|
23295
|
-
logger$
|
|
23395
|
+
logger$e.error("No form was found to have that field so form navigation failed.");
|
|
23296
23396
|
}
|
|
23297
23397
|
}
|
|
23298
23398
|
}), [forms2, handleGetIdVerificationToken, setFormIndex]);
|
|
@@ -23905,7 +24005,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
|
|
|
23905
24005
|
CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
|
|
23906
24006
|
return CompanySearchEvents2;
|
|
23907
24007
|
})(CompanySearchEvents || {});
|
|
23908
|
-
const logger$
|
|
24008
|
+
const logger$d = createLogger("useCompanySearch");
|
|
23909
24009
|
const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
|
|
23910
24010
|
function useCompanySearch({
|
|
23911
24011
|
defaultData,
|
|
@@ -24033,7 +24133,7 @@ function useCompanySearch({
|
|
|
24033
24133
|
state: companyData.state ?? stateOrProvince2
|
|
24034
24134
|
});
|
|
24035
24135
|
} catch (e) {
|
|
24036
|
-
logger$
|
|
24136
|
+
logger$d.error(e);
|
|
24037
24137
|
setError(e);
|
|
24038
24138
|
setStatus("error");
|
|
24039
24139
|
} finally {
|
|
@@ -24066,7 +24166,7 @@ function useCompanySearch({
|
|
|
24066
24166
|
indexSearch: handleCompanyIndexSearch,
|
|
24067
24167
|
deepSearch: handleCompanyDeepSearch,
|
|
24068
24168
|
resultsLimit: limit
|
|
24069
|
-
})) == null ? void 0 : _a.catch((e) => logger$
|
|
24169
|
+
})) == null ? void 0 : _a.catch((e) => logger$d.error(e));
|
|
24070
24170
|
}
|
|
24071
24171
|
}, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
|
|
24072
24172
|
useEffect(() => {
|
|
@@ -25426,7 +25526,7 @@ const CompanyStructureValidation = {
|
|
|
25426
25526
|
};
|
|
25427
25527
|
const COMPANY_STRUCTURE_FORM_ID = "companyStructure";
|
|
25428
25528
|
const companyStructureFields = ["entityType"];
|
|
25429
|
-
function
|
|
25529
|
+
function CompanyStructureComponent({
|
|
25430
25530
|
data,
|
|
25431
25531
|
labels: labels2,
|
|
25432
25532
|
heading,
|
|
@@ -25440,6 +25540,7 @@ function CompanyStructure({
|
|
|
25440
25540
|
const {
|
|
25441
25541
|
i18n
|
|
25442
25542
|
} = useI18nContext();
|
|
25543
|
+
const isNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
25443
25544
|
const {
|
|
25444
25545
|
updateStateSlice
|
|
25445
25546
|
} = useGlobalDataSlice(COMPANY_STRUCTURE_FORM_ID);
|
|
@@ -25482,6 +25583,7 @@ function CompanyStructure({
|
|
|
25482
25583
|
fieldProblems: formFieldProblems
|
|
25483
25584
|
});
|
|
25484
25585
|
}, [formSchema, formData, formErrors, formValid, formFieldProblems, updateStateSlice]);
|
|
25586
|
+
const companyTypeOptions = isNewEntryFlowEnabled ? companyTypes.filter((companyType2) => companyType2.id !== CompanyTypesValue.INCORPORATED_PARTNERSHIP && companyType2.id !== CompanyTypesValue.INCORPORATED_ASSOCIATION) : companyTypes;
|
|
25485
25587
|
return jsxs("form", {
|
|
25486
25588
|
children: [jsx(FormHeader, {
|
|
25487
25589
|
heading,
|
|
@@ -25502,8 +25604,8 @@ function CompanyStructure({
|
|
|
25502
25604
|
"aria-label": formUtils.getLabel("entityType", "whatTypeOfCompanyDoYouHave"),
|
|
25503
25605
|
"aria-invalid": !formValid.entityType,
|
|
25504
25606
|
name: "entityType",
|
|
25505
|
-
items:
|
|
25506
|
-
selected:
|
|
25607
|
+
items: companyTypeOptions,
|
|
25608
|
+
selected: companyTypeOptions.find((type) => type.id === (formData == null ? void 0 : formData.entityType)),
|
|
25507
25609
|
readonly: disabled,
|
|
25508
25610
|
isItemDisabled: () => disabled,
|
|
25509
25611
|
onSelect: (item) => handleChangeFor("entityType")(item.id)
|
|
@@ -25511,7 +25613,6 @@ function CompanyStructure({
|
|
|
25511
25613
|
})]
|
|
25512
25614
|
});
|
|
25513
25615
|
}
|
|
25514
|
-
const CompanyStructureComponent = memo(CompanyStructure, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.heading, nextProps.heading) && objectsDeepEqual(prevProps.description, nextProps.description) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && prevProps.kompanyVerifiedData === nextProps.kompanyVerifiedData);
|
|
25515
25616
|
const forms = {
|
|
25516
25617
|
companyBasics: {
|
|
25517
25618
|
formId: "companyBasics",
|
|
@@ -25843,7 +25944,7 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity) => {
|
|
|
25843
25944
|
}
|
|
25844
25945
|
}, {});
|
|
25845
25946
|
};
|
|
25846
|
-
const logger$
|
|
25947
|
+
const logger$c = createLogger("useFormTaskSubmit");
|
|
25847
25948
|
function useCompanySearchTaskSubmit({
|
|
25848
25949
|
task,
|
|
25849
25950
|
forms: forms2,
|
|
@@ -25889,7 +25990,7 @@ function useCompanySearchTaskSubmit({
|
|
|
25889
25990
|
});
|
|
25890
25991
|
}
|
|
25891
25992
|
} catch (e) {
|
|
25892
|
-
logger$
|
|
25993
|
+
logger$c.error(e);
|
|
25893
25994
|
userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
|
|
25894
25995
|
segmentation: {
|
|
25895
25996
|
...baseTrackingPayload,
|
|
@@ -25941,7 +26042,7 @@ function useCompanySearchTaskSubmit({
|
|
|
25941
26042
|
...trackingPayload
|
|
25942
26043
|
}
|
|
25943
26044
|
});
|
|
25944
|
-
logger$
|
|
26045
|
+
logger$c.log(submittedLegalEntity);
|
|
25945
26046
|
setAccountHolder(entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type]);
|
|
25946
26047
|
clearToasts();
|
|
25947
26048
|
onExternalSubmit == null ? void 0 : onExternalSubmit(data);
|
|
@@ -25966,7 +26067,7 @@ function useCompanySearchTaskSubmit({
|
|
|
25966
26067
|
type: ToastType.ERROR
|
|
25967
26068
|
});
|
|
25968
26069
|
}
|
|
25969
|
-
logger$
|
|
26070
|
+
logger$c.error(e);
|
|
25970
26071
|
userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
|
|
25971
26072
|
segmentation: {
|
|
25972
26073
|
...baseTrackingPayload,
|
|
@@ -26399,25 +26500,32 @@ const useShouldShowIntroduction = ({
|
|
|
26399
26500
|
});
|
|
26400
26501
|
return canSeeIntroduction && !hasSeenIntroduction;
|
|
26401
26502
|
};
|
|
26402
|
-
const logger$
|
|
26503
|
+
const logger$b = createLogger("useAssociatedLegalArrangement");
|
|
26403
26504
|
function useAssociatedLegalArrangement({
|
|
26404
26505
|
rootLegalEntity,
|
|
26405
26506
|
getLegalEntity: getLegalEntity2
|
|
26406
26507
|
}) {
|
|
26407
26508
|
const [associatedLegalArrangement, setAssociatedLegalArrangement] = useState();
|
|
26408
26509
|
const getAssociatedEntity = useCallback(async (entityId) => getLegalEntity2 == null ? void 0 : getLegalEntity2(entityId), [getLegalEntity2]);
|
|
26409
|
-
|
|
26510
|
+
const refreshAssociatedLegalArrangement = useCallback(() => {
|
|
26410
26511
|
var _a;
|
|
26411
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);
|
|
26412
26513
|
if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
|
|
26413
|
-
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$
|
|
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();
|
|
26414
26520
|
}
|
|
26415
26521
|
}, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
|
|
26416
26522
|
return {
|
|
26417
|
-
associatedLegalArrangement
|
|
26523
|
+
associatedLegalArrangement,
|
|
26524
|
+
setAssociatedLegalArrangement,
|
|
26525
|
+
refreshAssociatedLegalArrangement
|
|
26418
26526
|
};
|
|
26419
26527
|
}
|
|
26420
|
-
const logger$
|
|
26528
|
+
const logger$a = createLogger("useExemptSettlor");
|
|
26421
26529
|
const useExemptSettlor = ({
|
|
26422
26530
|
trust: trust2,
|
|
26423
26531
|
handleGetLegalEntity
|
|
@@ -26429,9 +26537,9 @@ const useExemptSettlor = ({
|
|
|
26429
26537
|
setExemptSettlor(exemptSettlorLE);
|
|
26430
26538
|
}, [handleGetLegalEntity]);
|
|
26431
26539
|
useEffect(() => {
|
|
26432
|
-
if (!trust2)
|
|
26540
|
+
if (!(trust2 == null ? void 0 : trust2.trust))
|
|
26433
26541
|
return;
|
|
26434
|
-
updateExemptSettlor(trust2).catch(logger$
|
|
26542
|
+
updateExemptSettlor(trust2).catch(logger$a.error);
|
|
26435
26543
|
}, [trust2, updateExemptSettlor]);
|
|
26436
26544
|
return exemptSettlor;
|
|
26437
26545
|
};
|
|
@@ -26461,26 +26569,6 @@ function useSalesChannelsSettings() {
|
|
|
26461
26569
|
return settings;
|
|
26462
26570
|
}, [isSettingEnabled]);
|
|
26463
26571
|
}
|
|
26464
|
-
const logger$a = createLogger("useTrust");
|
|
26465
|
-
const useTrust = ({
|
|
26466
|
-
rootLegalEntity,
|
|
26467
|
-
handleGetLegalEntity
|
|
26468
|
-
}) => {
|
|
26469
|
-
const [trust2, setTrust] = useState();
|
|
26470
|
-
const refreshTrust = useCallback(async () => {
|
|
26471
|
-
var _a, _b;
|
|
26472
|
-
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;
|
|
26473
|
-
const trustLE = trustId ? await handleGetLegalEntity(trustId) : void 0;
|
|
26474
|
-
setTrust(trustLE);
|
|
26475
|
-
return trustLE;
|
|
26476
|
-
}, [handleGetLegalEntity]);
|
|
26477
|
-
useEffect(() => {
|
|
26478
|
-
if (hasOwnEntityAssociationOfType(LegalEntityType.TRUST, rootLegalEntity.entityAssociations, rootLegalEntity.id)) {
|
|
26479
|
-
refreshTrust().catch(logger$a.error);
|
|
26480
|
-
}
|
|
26481
|
-
}, [refreshTrust]);
|
|
26482
|
-
return [trust2, refreshTrust];
|
|
26483
|
-
};
|
|
26484
26572
|
const downloadFile = async (base64, filename) => {
|
|
26485
26573
|
saveBlobAsFile(base64ToBlob(base64), filename);
|
|
26486
26574
|
};
|
|
@@ -28527,7 +28615,7 @@ function TaskListComponent({
|
|
|
28527
28615
|
const {
|
|
28528
28616
|
isExperimentEnabled
|
|
28529
28617
|
} = useExperimentsContext();
|
|
28530
|
-
const
|
|
28618
|
+
const transferInstrumentLimit = useSetting("transferInstrumentLimit");
|
|
28531
28619
|
const isEnableNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
28532
28620
|
const canSeeIntroduction = useCanSeeIntroduction({
|
|
28533
28621
|
legalEntity: legalEntityResponse
|
|
@@ -28675,7 +28763,7 @@ function TaskListComponent({
|
|
|
28675
28763
|
capabilityProblems,
|
|
28676
28764
|
onNavigateToTask: () => handleOnNavigateToTaskPayout(transferInstrument.id),
|
|
28677
28765
|
onTransferInstrumentDelete: () => onTransferInstrumentDelete(transferInstrument.id)
|
|
28678
|
-
}, transferInstrument.id)), !
|
|
28766
|
+
}, transferInstrument.id)), !transferInstrumentLimit || transferInstruments.length < transferInstrumentLimit ? jsxs(Card, {
|
|
28679
28767
|
stateful: true,
|
|
28680
28768
|
onClick: () => handleOnNavigateToTaskPayout(),
|
|
28681
28769
|
className: "adyen-task adl-add-payout",
|
|
@@ -31881,7 +31969,7 @@ function DropinComposerComponent({
|
|
|
31881
31969
|
onNavigate = noop,
|
|
31882
31970
|
...args
|
|
31883
31971
|
}) {
|
|
31884
|
-
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;
|
|
31885
31973
|
const {
|
|
31886
31974
|
contextCountry,
|
|
31887
31975
|
accountHolder: accountHolder2,
|
|
@@ -31924,20 +32012,17 @@ function DropinComposerComponent({
|
|
|
31924
32012
|
const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
|
|
31925
32013
|
const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
|
|
31926
32014
|
const {
|
|
31927
|
-
associatedLegalArrangement
|
|
32015
|
+
associatedLegalArrangement,
|
|
32016
|
+
setAssociatedLegalArrangement,
|
|
32017
|
+
refreshAssociatedLegalArrangement
|
|
31928
32018
|
} = useAssociatedLegalArrangement({
|
|
31929
32019
|
rootLegalEntity,
|
|
31930
32020
|
getLegalEntity: args == null ? void 0 : args.handleGetLegalEntity
|
|
31931
32021
|
});
|
|
31932
32022
|
const [associatedLegalEntityParent, setAssociatedLegalEntityParent] = useState(null);
|
|
31933
32023
|
const [legalEntityType, setLegalEntityType] = useState(null);
|
|
31934
|
-
const [solePropietor, setSolePropietor] = useState(null);
|
|
31935
|
-
const [trust2, refreshTrust] = useTrust({
|
|
31936
|
-
rootLegalEntity,
|
|
31937
|
-
handleGetLegalEntity: args.handleGetLegalEntity
|
|
31938
|
-
});
|
|
31939
32024
|
const exemptSettlor = useExemptSettlor({
|
|
31940
|
-
trust:
|
|
32025
|
+
trust: associatedLegalArrangement,
|
|
31941
32026
|
handleGetLegalEntity: args.handleGetLegalEntity
|
|
31942
32027
|
});
|
|
31943
32028
|
const [trustMember, setTrustMember] = useState(null);
|
|
@@ -31952,9 +32037,9 @@ function DropinComposerComponent({
|
|
|
31952
32037
|
const hasTrust = accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
|
|
31953
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);
|
|
31954
32039
|
const additionalSalesChannels = useSalesChannelsSettings();
|
|
31955
|
-
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"),
|
|
32040
|
+
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), (_c = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _c.countryOfGoverningLaw);
|
|
31956
32041
|
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
31957
|
-
const trustMembers2 =
|
|
32042
|
+
const trustMembers2 = (associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) ? allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(associatedLegalArrangement, rootLegalEntity, exemptSettlor) : getTrustMembers(associatedLegalArrangement, rootLegalEntity, exemptSettlor) : [];
|
|
31958
32043
|
const getLegalEntityProblems = (le) => {
|
|
31959
32044
|
var _a2;
|
|
31960
32045
|
if (le == null ? void 0 : le.id) {
|
|
@@ -32029,7 +32114,7 @@ function DropinComposerComponent({
|
|
|
32029
32114
|
if (id2) {
|
|
32030
32115
|
try {
|
|
32031
32116
|
const response = await (args == null ? void 0 : args.handleGetLegalEntity(id2));
|
|
32032
|
-
|
|
32117
|
+
setAssociatedLegalArrangement(response);
|
|
32033
32118
|
} catch (e) {
|
|
32034
32119
|
showToast({
|
|
32035
32120
|
label: i18n.get("failedToFetchSoleProp"),
|
|
@@ -32089,21 +32174,21 @@ function DropinComposerComponent({
|
|
|
32089
32174
|
case "company":
|
|
32090
32175
|
await deleteAssociatedTrustMember({
|
|
32091
32176
|
associatedTrustMember: trustMember2,
|
|
32092
|
-
trust:
|
|
32177
|
+
trust: associatedLegalArrangement,
|
|
32093
32178
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
32094
32179
|
});
|
|
32095
32180
|
break;
|
|
32096
32181
|
case "undefinedBeneficiary":
|
|
32097
32182
|
await deleteUndefinedBeneficiary({
|
|
32098
32183
|
undefinedBeneficiary: trustMember2,
|
|
32099
|
-
trust:
|
|
32184
|
+
trust: associatedLegalArrangement,
|
|
32100
32185
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
32101
32186
|
});
|
|
32102
32187
|
break;
|
|
32103
32188
|
case "rootTrustee":
|
|
32104
32189
|
throw new Error("Cannot delete root trustee");
|
|
32105
32190
|
}
|
|
32106
|
-
await
|
|
32191
|
+
await refreshAssociatedLegalArrangement();
|
|
32107
32192
|
showToast({
|
|
32108
32193
|
type: ToastType.SUCCESS,
|
|
32109
32194
|
label: i18n.get("successFullyRemovedTrustMember")
|
|
@@ -32118,7 +32203,7 @@ function DropinComposerComponent({
|
|
|
32118
32203
|
};
|
|
32119
32204
|
const addOrUpdateTrustMember = async (updated, existing) => {
|
|
32120
32205
|
if ((existing == null ? void 0 : existing.trustMemberType) === "undefinedBeneficiary" && updated.trustMemberType === "undefinedBeneficiary" && existing.description === updated.description) {
|
|
32121
|
-
await
|
|
32206
|
+
await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
|
|
32122
32207
|
return;
|
|
32123
32208
|
}
|
|
32124
32209
|
try {
|
|
@@ -32126,7 +32211,7 @@ function DropinComposerComponent({
|
|
|
32126
32211
|
case "undefinedBeneficiary":
|
|
32127
32212
|
await addOrUpdateUndefinedBeneficiary({
|
|
32128
32213
|
newOrUpdated: updated,
|
|
32129
|
-
trust:
|
|
32214
|
+
trust: associatedLegalArrangement,
|
|
32130
32215
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
32131
32216
|
});
|
|
32132
32217
|
break;
|
|
@@ -32137,7 +32222,7 @@ function DropinComposerComponent({
|
|
|
32137
32222
|
handleCreateLegalEntity: args.handleCreateLegalEntity
|
|
32138
32223
|
}) : await createExemptSettlor({
|
|
32139
32224
|
exemptSettlor: updated,
|
|
32140
|
-
trust:
|
|
32225
|
+
trust: associatedLegalArrangement,
|
|
32141
32226
|
handleCreateLegalEntity: args.handleCreateLegalEntity
|
|
32142
32227
|
});
|
|
32143
32228
|
updated.legalEntityId = newSettlorLE.id;
|
|
@@ -32156,7 +32241,7 @@ function DropinComposerComponent({
|
|
|
32156
32241
|
}
|
|
32157
32242
|
await addOrUpdateAssociatedTrustMember({
|
|
32158
32243
|
newOrUpdated: updated,
|
|
32159
|
-
trust:
|
|
32244
|
+
trust: associatedLegalArrangement,
|
|
32160
32245
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
32161
32246
|
});
|
|
32162
32247
|
break;
|
|
@@ -32164,7 +32249,7 @@ function DropinComposerComponent({
|
|
|
32164
32249
|
case "company":
|
|
32165
32250
|
await addOrUpdateAssociatedTrustMember({
|
|
32166
32251
|
newOrUpdated: updated,
|
|
32167
|
-
trust:
|
|
32252
|
+
trust: associatedLegalArrangement,
|
|
32168
32253
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
32169
32254
|
});
|
|
32170
32255
|
break;
|
|
@@ -32173,7 +32258,7 @@ function DropinComposerComponent({
|
|
|
32173
32258
|
existing.roles = updated.roles;
|
|
32174
32259
|
await updateRootTrusteeTrustMember({
|
|
32175
32260
|
trustMember: existing,
|
|
32176
|
-
trust:
|
|
32261
|
+
trust: associatedLegalArrangement,
|
|
32177
32262
|
handleUpdateLegalEntity: args.handleUpdateLegalEntity
|
|
32178
32263
|
});
|
|
32179
32264
|
}
|
|
@@ -32185,7 +32270,7 @@ function DropinComposerComponent({
|
|
|
32185
32270
|
label: i18n.get("successfullyUpdatedDetails"),
|
|
32186
32271
|
type: ToastType.SUCCESS
|
|
32187
32272
|
});
|
|
32188
|
-
await
|
|
32273
|
+
await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
|
|
32189
32274
|
} catch (err) {
|
|
32190
32275
|
logger$8.error(err);
|
|
32191
32276
|
showToast({
|
|
@@ -32225,7 +32310,7 @@ function DropinComposerComponent({
|
|
|
32225
32310
|
if (id2) {
|
|
32226
32311
|
try {
|
|
32227
32312
|
await getTransferInstrument2(id2);
|
|
32228
|
-
if (hasSolePropInLegalEntity(rootLegalEntity) && !
|
|
32313
|
+
if (hasSolePropInLegalEntity(rootLegalEntity) && !associatedLegalArrangement) {
|
|
32229
32314
|
await getSolePropietor();
|
|
32230
32315
|
}
|
|
32231
32316
|
} finally {
|
|
@@ -32256,8 +32341,7 @@ function DropinComposerComponent({
|
|
|
32256
32341
|
};
|
|
32257
32342
|
const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
|
|
32258
32343
|
try {
|
|
32259
|
-
|
|
32260
|
-
if (trust22) {
|
|
32344
|
+
if (associatedLegalArrangement) {
|
|
32261
32345
|
onNavigateTo(task);
|
|
32262
32346
|
} else {
|
|
32263
32347
|
onNavigateTo(TaskTypes.TRUST);
|
|
@@ -32352,8 +32436,8 @@ function DropinComposerComponent({
|
|
|
32352
32436
|
await refreshLegalEntity();
|
|
32353
32437
|
navigateBack(backStepCount);
|
|
32354
32438
|
};
|
|
32355
|
-
const
|
|
32356
|
-
await
|
|
32439
|
+
const refreshLegalArrangementAndRunOnSubmit = async (data, backSteps) => {
|
|
32440
|
+
await refreshAssociatedLegalArrangement();
|
|
32357
32441
|
await componentOnSubmit(data, backSteps);
|
|
32358
32442
|
};
|
|
32359
32443
|
const onPciDownload = async () => {
|
|
@@ -32585,7 +32669,7 @@ function DropinComposerComponent({
|
|
|
32585
32669
|
onChange: componentOnChange,
|
|
32586
32670
|
eventEmitter,
|
|
32587
32671
|
onSubmit: async (data) => {
|
|
32588
|
-
await
|
|
32672
|
+
await refreshAssociatedLegalArrangement();
|
|
32589
32673
|
await componentOnSubmit(data);
|
|
32590
32674
|
},
|
|
32591
32675
|
handleHomeClick: navigateBack,
|
|
@@ -32605,14 +32689,14 @@ function DropinComposerComponent({
|
|
|
32605
32689
|
topLevelLegalEntity: legalEntityResponse
|
|
32606
32690
|
},
|
|
32607
32691
|
taskType: TaskTypes.TRUST_MEMBER_INDIVIDUAL,
|
|
32608
|
-
parentLegalEntity:
|
|
32692
|
+
parentLegalEntity: associatedLegalArrangement,
|
|
32609
32693
|
legalEntityResponse: associatedLegalEntity,
|
|
32610
32694
|
country: rootLegalEntityCountry,
|
|
32611
32695
|
problems: getLegalEntityProblems(associatedLegalEntity),
|
|
32612
32696
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
32613
32697
|
onChange: componentOnChange,
|
|
32614
32698
|
eventEmitter,
|
|
32615
|
-
onSubmit: (data) =>
|
|
32699
|
+
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
|
|
32616
32700
|
handleBackClick: navigateBack,
|
|
32617
32701
|
handleHomeClick: () => onNavigateTo(TaskTypes.TRUST_MEMBER_OVERVIEW),
|
|
32618
32702
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
@@ -32693,13 +32777,13 @@ function DropinComposerComponent({
|
|
|
32693
32777
|
topLevelLegalEntity: legalEntityResponse
|
|
32694
32778
|
},
|
|
32695
32779
|
taskType: TaskTypes.TRUST_MEMBER_COMPANY,
|
|
32696
|
-
parentLegalEntity:
|
|
32780
|
+
parentLegalEntity: associatedLegalArrangement,
|
|
32697
32781
|
legalEntityResponse: associatedLegalEntity,
|
|
32698
32782
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
32699
|
-
problems: (
|
|
32783
|
+
problems: (_d = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _d[rootLegalEntity.id],
|
|
32700
32784
|
onChange: componentOnChange,
|
|
32701
32785
|
eventEmitter,
|
|
32702
|
-
onSubmit: (data) =>
|
|
32786
|
+
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
|
|
32703
32787
|
handleBackClick: navigateBack,
|
|
32704
32788
|
handleHomeClick: navigateBack,
|
|
32705
32789
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
@@ -32715,7 +32799,7 @@ function DropinComposerComponent({
|
|
|
32715
32799
|
},
|
|
32716
32800
|
taskType: currentTask,
|
|
32717
32801
|
taskName: currentTask === TaskTypes.PAYIN ? "payinDetails" : "payoutDetails",
|
|
32718
|
-
problems: (
|
|
32802
|
+
problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _e[transferInstrument == null ? void 0 : transferInstrument.id],
|
|
32719
32803
|
transferInstrument,
|
|
32720
32804
|
setTransferInstrument,
|
|
32721
32805
|
legalEntityResponse: rootLegalEntity,
|
|
@@ -32744,16 +32828,16 @@ function DropinComposerComponent({
|
|
|
32744
32828
|
topLevelLegalEntity: legalEntityResponse
|
|
32745
32829
|
},
|
|
32746
32830
|
taskType: TaskTypes.TRUST,
|
|
32747
|
-
problems: (
|
|
32831
|
+
problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _f[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
|
|
32748
32832
|
parentLegalEntity: rootLegalEntity,
|
|
32749
|
-
legalEntityResponse:
|
|
32833
|
+
legalEntityResponse: associatedLegalArrangement,
|
|
32750
32834
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
32751
32835
|
onChange: componentOnChange,
|
|
32752
32836
|
eventEmitter,
|
|
32753
|
-
onSubmit:
|
|
32837
|
+
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
32754
32838
|
handleHomeClick: navigateBack,
|
|
32755
32839
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
32756
|
-
country: (((
|
|
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,
|
|
32757
32841
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
32758
32842
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
32759
32843
|
});
|
|
@@ -32770,7 +32854,7 @@ function DropinComposerComponent({
|
|
|
32770
32854
|
return jsx(RoleAndTypeDropinComponent, {
|
|
32771
32855
|
navigateToFullDropinFor: onNavigateToTrustMember,
|
|
32772
32856
|
navigateBack: async () => {
|
|
32773
|
-
await
|
|
32857
|
+
await refreshAssociatedLegalArrangement();
|
|
32774
32858
|
navigateBack();
|
|
32775
32859
|
},
|
|
32776
32860
|
existingTrustMember: trustMember,
|
|
@@ -32798,15 +32882,15 @@ function DropinComposerComponent({
|
|
|
32798
32882
|
...args,
|
|
32799
32883
|
taskType: TaskTypes.SOLE_PROPRIETOR_COMPANY,
|
|
32800
32884
|
parentLegalEntity: rootLegalEntity,
|
|
32801
|
-
legalEntityResponse:
|
|
32885
|
+
legalEntityResponse: associatedLegalArrangement,
|
|
32802
32886
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
32803
|
-
problems: (
|
|
32887
|
+
problems: (_i = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _i[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
|
|
32804
32888
|
onChange: componentOnChange,
|
|
32805
32889
|
eventEmitter,
|
|
32806
|
-
onSubmit:
|
|
32890
|
+
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
32807
32891
|
handleHomeClick: navigateBack,
|
|
32808
32892
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
32809
|
-
country: (((
|
|
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,
|
|
32810
32894
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
32811
32895
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
32812
32896
|
});
|
|
@@ -33121,6 +33205,16 @@ const getAddress = async (context, addressId) => {
|
|
|
33121
33205
|
}
|
|
33122
33206
|
});
|
|
33123
33207
|
};
|
|
33208
|
+
const getAnalyticsSession = async (loadingContext, data) => httpPost({
|
|
33209
|
+
loadingContext,
|
|
33210
|
+
errorLevel: "warn",
|
|
33211
|
+
errorMessage: `Failed to get analytics sessionId`,
|
|
33212
|
+
path: `analytics/ui`,
|
|
33213
|
+
authentication: "jwt",
|
|
33214
|
+
headers: {
|
|
33215
|
+
"Content-Type": "application/json"
|
|
33216
|
+
}
|
|
33217
|
+
}, data);
|
|
33124
33218
|
const getIdverificationToken = async (context, request) => {
|
|
33125
33219
|
const {
|
|
33126
33220
|
loadingContext,
|
|
@@ -33191,6 +33285,16 @@ const idVerificationStartcheck = async (context, request) => {
|
|
|
33191
33285
|
}
|
|
33192
33286
|
}, request);
|
|
33193
33287
|
};
|
|
33288
|
+
const pushEvents = async (loadingContext, sessionId, event) => httpPost({
|
|
33289
|
+
loadingContext,
|
|
33290
|
+
errorLevel: "warn",
|
|
33291
|
+
errorMessage: `Failed to push events`,
|
|
33292
|
+
path: `analytics/ui/${sessionId}`,
|
|
33293
|
+
authentication: "jwt",
|
|
33294
|
+
headers: {
|
|
33295
|
+
"Content-Type": "application/json"
|
|
33296
|
+
}
|
|
33297
|
+
}, event);
|
|
33194
33298
|
const searchAddress = async (context, address2) => {
|
|
33195
33299
|
const {
|
|
33196
33300
|
loadingContext,
|
|
@@ -33250,7 +33354,9 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
33250
33354
|
getIdVerificationToken: async (legalEntityId, data) => getIdverificationToken(baseRequestContext, data),
|
|
33251
33355
|
idVerificationStartCheck: async (legalEntityId, data) => idVerificationStartcheck(baseRequestContext, data),
|
|
33252
33356
|
getOnboardingStatus: async () => getOnboardingStatus(baseRequestContext),
|
|
33253
|
-
generateOnboardingLink: async (config) => generateOnboardingLink(baseRequestContext, config)
|
|
33357
|
+
generateOnboardingLink: async (config) => generateOnboardingLink(baseRequestContext, config),
|
|
33358
|
+
getAnalyticsSession: async (data) => getAnalyticsSession(loadingContext, data),
|
|
33359
|
+
pushEvents: async (sessionId, event) => pushEvents(loadingContext, sessionId, event)
|
|
33254
33360
|
};
|
|
33255
33361
|
}, [base, rootLegalEntityId]);
|
|
33256
33362
|
};
|
|
@@ -33404,46 +33510,46 @@ function CreateTransferInstrumentComponent({
|
|
|
33404
33510
|
taskType: TaskTypes.PAYOUT
|
|
33405
33511
|
}) : null;
|
|
33406
33512
|
}
|
|
33513
|
+
var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
|
|
33514
|
+
OnboardingUrlTarget2["BLANK"] = "_blank";
|
|
33515
|
+
OnboardingUrlTarget2["SELF"] = "_self";
|
|
33516
|
+
return OnboardingUrlTarget2;
|
|
33517
|
+
})(OnboardingUrlTarget || {});
|
|
33407
33518
|
var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
|
|
33408
|
-
OnboardingStatus2["
|
|
33409
|
-
OnboardingStatus2["
|
|
33410
|
-
OnboardingStatus2["
|
|
33411
|
-
OnboardingStatus2["
|
|
33519
|
+
OnboardingStatus2["AWAITING_DATA"] = "AWAITING_DATA";
|
|
33520
|
+
OnboardingStatus2["IN_REVIEW"] = "IN_REVIEW";
|
|
33521
|
+
OnboardingStatus2["UNSUCCESSFUL"] = "UNSUCCESSFUL";
|
|
33522
|
+
OnboardingStatus2["REJECTED"] = "REJECTED";
|
|
33523
|
+
OnboardingStatus2["VERIFIED"] = "VERIFIED";
|
|
33412
33524
|
return OnboardingStatus2;
|
|
33413
33525
|
})(OnboardingStatus || {});
|
|
33414
33526
|
const contentMap = {
|
|
33415
|
-
[OnboardingStatus.
|
|
33416
|
-
|
|
33417
|
-
|
|
33418
|
-
ctaButton: "onboardingRedirectInitialCtaButton"
|
|
33527
|
+
[OnboardingStatus.AWAITING_DATA]: {
|
|
33528
|
+
description: ["onboardingRedirectAwaitingDescriptionP1"],
|
|
33529
|
+
ctaButton: "onboardingRedirectAwaitingCtaButton"
|
|
33419
33530
|
},
|
|
33420
|
-
[OnboardingStatus.
|
|
33421
|
-
|
|
33422
|
-
|
|
33423
|
-
ctaButton: "onboardingRedirectInProgressCtaButton"
|
|
33531
|
+
[OnboardingStatus.IN_REVIEW]: {
|
|
33532
|
+
description: ["onboardingRedirectInReviewDescriptionP1"],
|
|
33533
|
+
ctaButton: "onboardingRedirectInReviewCtaButton"
|
|
33424
33534
|
},
|
|
33425
|
-
[OnboardingStatus.
|
|
33426
|
-
|
|
33427
|
-
|
|
33428
|
-
ctaButton: "onboardingRedirectErrorsCtaButton"
|
|
33535
|
+
[OnboardingStatus.UNSUCCESSFUL]: {
|
|
33536
|
+
description: ["onboardingRedirectUnsuccessfulDescriptionP1"],
|
|
33537
|
+
ctaButton: "onboardingRedirectUnsuccessfulCtaButton"
|
|
33429
33538
|
},
|
|
33430
|
-
[OnboardingStatus.
|
|
33431
|
-
|
|
33432
|
-
|
|
33433
|
-
|
|
33539
|
+
[OnboardingStatus.REJECTED]: {
|
|
33540
|
+
description: ["onboardingRedirectRejectedDescriptionP1"]
|
|
33541
|
+
},
|
|
33542
|
+
[OnboardingStatus.VERIFIED]: {
|
|
33543
|
+
description: ["onboardingRedirectVerifiedDescriptionP1"]
|
|
33434
33544
|
}
|
|
33435
33545
|
};
|
|
33436
33546
|
function getContentByStatus(status) {
|
|
33437
33547
|
return contentMap[status];
|
|
33438
33548
|
}
|
|
33439
|
-
|
|
33440
|
-
|
|
33441
|
-
OnboardingUrlTarget2["SELF"] = "_self";
|
|
33442
|
-
return OnboardingUrlTarget2;
|
|
33443
|
-
})(OnboardingUrlTarget || {});
|
|
33444
|
-
const logger$5 = createLogger("OnboardingRedirectComponent");
|
|
33445
|
-
function OnboardingRedirectComponent({
|
|
33549
|
+
const logger$5 = createLogger("ViewVerificationStatusComponent");
|
|
33550
|
+
function ViewVerificationStatusComponent({
|
|
33446
33551
|
legalEntityId,
|
|
33552
|
+
hideExplanation = false,
|
|
33447
33553
|
returnUrl,
|
|
33448
33554
|
redirectTarget,
|
|
33449
33555
|
onStatusChange,
|
|
@@ -33527,6 +33633,12 @@ function OnboardingRedirectComponent({
|
|
|
33527
33633
|
const {
|
|
33528
33634
|
redirectUrl
|
|
33529
33635
|
} = await generateOnboardingLink2(config);
|
|
33636
|
+
if (!redirectUrl) {
|
|
33637
|
+
handleError({
|
|
33638
|
+
trKey: "onboardingRedirectLinkError"
|
|
33639
|
+
});
|
|
33640
|
+
return;
|
|
33641
|
+
}
|
|
33530
33642
|
openUrl(redirectUrl, config);
|
|
33531
33643
|
} catch (error) {
|
|
33532
33644
|
handleError({
|
|
@@ -33554,6 +33666,20 @@ function OnboardingRedirectComponent({
|
|
|
33554
33666
|
});
|
|
33555
33667
|
}
|
|
33556
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
|
+
};
|
|
33557
33683
|
const renderBody = () => {
|
|
33558
33684
|
if (alertContent) {
|
|
33559
33685
|
return jsx(Alert, {
|
|
@@ -33564,24 +33690,12 @@ function OnboardingRedirectComponent({
|
|
|
33564
33690
|
}
|
|
33565
33691
|
if (content) {
|
|
33566
33692
|
return jsxs(Fragment, {
|
|
33567
|
-
children: [jsx("
|
|
33568
|
-
className: "adyen-
|
|
33569
|
-
children: i18n.get(content.header)
|
|
33570
|
-
}), content.description.map((key) => jsx("p", {
|
|
33571
|
-
className: "adyen-onboarding-redirect__description",
|
|
33693
|
+
children: [hideExplanation ? null : content.description.map((key) => jsx("p", {
|
|
33694
|
+
className: "adyen-view-verification-status__description",
|
|
33572
33695
|
children: i18n.get(key)
|
|
33573
33696
|
}, key)), jsx("div", {
|
|
33574
|
-
className: "adyen-
|
|
33575
|
-
children:
|
|
33576
|
-
label: i18n.get(content.ctaButton),
|
|
33577
|
-
onClick: redirectToAdyen,
|
|
33578
|
-
type: "button",
|
|
33579
|
-
className: "adyen-onboarding-redirect__button",
|
|
33580
|
-
role: "link",
|
|
33581
|
-
negative: onboardingStatus !== OnboardingStatus.FINISHED,
|
|
33582
|
-
tertiary: onboardingStatus === OnboardingStatus.FINISHED,
|
|
33583
|
-
status: loadingLinkStatus === "loading" ? "loading" : "default"
|
|
33584
|
-
})
|
|
33697
|
+
className: "adyen-view-verification-status__footer",
|
|
33698
|
+
children: renderFooter()
|
|
33585
33699
|
})]
|
|
33586
33700
|
});
|
|
33587
33701
|
}
|
|
@@ -33590,7 +33704,7 @@ function OnboardingRedirectComponent({
|
|
|
33590
33704
|
});
|
|
33591
33705
|
};
|
|
33592
33706
|
return jsx("section", {
|
|
33593
|
-
className: "adyen-
|
|
33707
|
+
className: "adyen-view-verification-status",
|
|
33594
33708
|
children: renderBody()
|
|
33595
33709
|
});
|
|
33596
33710
|
}
|
|
@@ -33605,7 +33719,7 @@ const componentsMap = {
|
|
|
33605
33719
|
pci: PciDropinComponent,
|
|
33606
33720
|
createTransferInstrumentComponent: CreateTransferInstrumentComponent,
|
|
33607
33721
|
createIndividualComponent: CreateIndividualComponent,
|
|
33608
|
-
|
|
33722
|
+
viewVerificationStatusComponent: ViewVerificationStatusComponent
|
|
33609
33723
|
};
|
|
33610
33724
|
const AuthProvider = ({
|
|
33611
33725
|
children,
|
|
@@ -33635,6 +33749,46 @@ const AuthProvider = ({
|
|
|
33635
33749
|
children
|
|
33636
33750
|
});
|
|
33637
33751
|
};
|
|
33752
|
+
const convertToEmbeddedEvent = (eventQueueItem) => {
|
|
33753
|
+
const [eventType, event] = eventQueueItem;
|
|
33754
|
+
const hasEventData = typeof event === "object";
|
|
33755
|
+
const eventName = hasEventData ? event.key : event;
|
|
33756
|
+
return {
|
|
33757
|
+
eventType,
|
|
33758
|
+
eventName,
|
|
33759
|
+
...hasEventData && {
|
|
33760
|
+
eventData: event.segmentation
|
|
33761
|
+
}
|
|
33762
|
+
};
|
|
33763
|
+
};
|
|
33764
|
+
const useAnalytics = async ({
|
|
33765
|
+
onUserEvent,
|
|
33766
|
+
isEmbeddedDropin,
|
|
33767
|
+
legalEntityId,
|
|
33768
|
+
sdkVersion,
|
|
33769
|
+
componentName
|
|
33770
|
+
}) => {
|
|
33771
|
+
const {
|
|
33772
|
+
getAnalyticsSession: getAnalyticsSession2,
|
|
33773
|
+
pushEvents: pushEvents2
|
|
33774
|
+
} = useComponentApi(legalEntityId);
|
|
33775
|
+
if (isEmbeddedDropin) {
|
|
33776
|
+
const {
|
|
33777
|
+
id: sessionId
|
|
33778
|
+
} = await getAnalyticsSession2({
|
|
33779
|
+
sdkVersion,
|
|
33780
|
+
componentName,
|
|
33781
|
+
userAgent: navigator.userAgent,
|
|
33782
|
+
legalEntityId
|
|
33783
|
+
});
|
|
33784
|
+
userEvents.subscribe((data) => {
|
|
33785
|
+
const eventItem = convertToEmbeddedEvent(data);
|
|
33786
|
+
pushEvents2(sessionId, eventItem);
|
|
33787
|
+
});
|
|
33788
|
+
} else if (onUserEvent) {
|
|
33789
|
+
userEvents.subscribe(onUserEvent);
|
|
33790
|
+
}
|
|
33791
|
+
};
|
|
33638
33792
|
let isDocumentGuidanceLoaded = false;
|
|
33639
33793
|
const getIconContainer = () => {
|
|
33640
33794
|
const container = document.createElement("div");
|
|
@@ -33925,19 +34079,37 @@ const getKycExternalApi = ({
|
|
|
33925
34079
|
});
|
|
33926
34080
|
const ConfigurationApiProvider = ({
|
|
33927
34081
|
children,
|
|
33928
|
-
|
|
34082
|
+
onUserEvent,
|
|
34083
|
+
rootLegalEntityId,
|
|
34084
|
+
componentName
|
|
33929
34085
|
}) => {
|
|
33930
34086
|
const authContext = useAuthContext();
|
|
33931
|
-
const
|
|
33932
|
-
|
|
34087
|
+
const {
|
|
34088
|
+
isEmbeddedDropin,
|
|
34089
|
+
loadingContext
|
|
34090
|
+
} = authContext;
|
|
34091
|
+
const sdkVersion = "2.36.0";
|
|
34092
|
+
useAnalytics({
|
|
34093
|
+
onUserEvent,
|
|
34094
|
+
isEmbeddedDropin,
|
|
34095
|
+
legalEntityId: rootLegalEntityId,
|
|
34096
|
+
sdkVersion,
|
|
34097
|
+
componentName
|
|
34098
|
+
});
|
|
34099
|
+
const contextValue = useMemo(() => isEmbeddedDropin ? getEmbeddedApi({
|
|
34100
|
+
base: loadingContext,
|
|
33933
34101
|
rootLegalEntityId
|
|
33934
34102
|
}) : getKycExternalApi({
|
|
33935
|
-
loadingContext
|
|
34103
|
+
loadingContext,
|
|
33936
34104
|
clientKey: authContext.clientKey
|
|
33937
34105
|
}), [authContext, rootLegalEntityId]);
|
|
33938
|
-
return
|
|
34106
|
+
return jsxs(ConfigurationApiContext.Provider, {
|
|
33939
34107
|
value: contextValue,
|
|
33940
|
-
children
|
|
34108
|
+
children: [jsx("span", {
|
|
34109
|
+
className: "adyen-kyc__sdk-version",
|
|
34110
|
+
hidden: true,
|
|
34111
|
+
children: sdkVersion
|
|
34112
|
+
}), children]
|
|
33941
34113
|
});
|
|
33942
34114
|
};
|
|
33943
34115
|
const logger$2 = createLogger("CoreProvider");
|
|
@@ -34080,7 +34252,7 @@ const settingsDefaults = {
|
|
|
34080
34252
|
hideOnboardingIntroductionTrust: true,
|
|
34081
34253
|
hideOnboardingIntroductionSoleProprietor: true,
|
|
34082
34254
|
viewOnboardingGuidance: false,
|
|
34083
|
-
|
|
34255
|
+
transferInstrumentLimit: 0
|
|
34084
34256
|
};
|
|
34085
34257
|
function SettingsProvider({
|
|
34086
34258
|
children,
|
|
@@ -34390,8 +34562,8 @@ const getRootLegalEntityId = (componentProps) => {
|
|
|
34390
34562
|
throw new Error("You must provide either `legalEntityId` or `legalEntityResponse`");
|
|
34391
34563
|
};
|
|
34392
34564
|
class UIElement extends BaseElement {
|
|
34393
|
-
constructor(
|
|
34394
|
-
super(
|
|
34565
|
+
constructor() {
|
|
34566
|
+
super(...arguments);
|
|
34395
34567
|
this.render = () => {
|
|
34396
34568
|
var _a;
|
|
34397
34569
|
const Component = this.props.component;
|
|
@@ -34404,6 +34576,8 @@ class UIElement extends BaseElement {
|
|
|
34404
34576
|
loadingContext: this.props.loadingContext,
|
|
34405
34577
|
children: jsx(ConfigurationApiProvider, {
|
|
34406
34578
|
rootLegalEntityId: getRootLegalEntityId(this.props.componentProps),
|
|
34579
|
+
onUserEvent: this.props.onUserEvent,
|
|
34580
|
+
componentName: this.props.componentName,
|
|
34407
34581
|
children: jsx(CoreProvider, {
|
|
34408
34582
|
contextCountry: this.props.contextCountry,
|
|
34409
34583
|
enableNewEntryFlowExperiment: (_a = this.props.experiments) == null ? void 0 : _a.EnableNewEntryFlow,
|
|
@@ -34432,8 +34606,6 @@ class UIElement extends BaseElement {
|
|
|
34432
34606
|
})
|
|
34433
34607
|
});
|
|
34434
34608
|
};
|
|
34435
|
-
if (props.onUserEvent)
|
|
34436
|
-
userEvents.subscribe(props.onUserEvent);
|
|
34437
34609
|
}
|
|
34438
34610
|
}
|
|
34439
34611
|
const normalizeEnvironment = (env) => env.endsWith("/") ? env : `${env}/`;
|
|
@@ -35078,11 +35250,14 @@ const createIndividualComponentSchema = {
|
|
|
35078
35250
|
type: "function"
|
|
35079
35251
|
}
|
|
35080
35252
|
};
|
|
35081
|
-
const
|
|
35253
|
+
const viewVerificationStatusComponentSchema = {
|
|
35082
35254
|
legalEntityId: {
|
|
35083
35255
|
type: "string",
|
|
35084
35256
|
required: true
|
|
35085
35257
|
},
|
|
35258
|
+
hideExplanation: {
|
|
35259
|
+
type: "boolean"
|
|
35260
|
+
},
|
|
35086
35261
|
redirectTarget: {
|
|
35087
35262
|
type: "string"
|
|
35088
35263
|
},
|
|
@@ -35110,7 +35285,7 @@ const componentsSchemaMap = {
|
|
|
35110
35285
|
taskList: taskListSchema,
|
|
35111
35286
|
createIndividualComponent: createIndividualComponentSchema,
|
|
35112
35287
|
createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
|
|
35113
|
-
|
|
35288
|
+
viewVerificationStatusComponent: viewVerificationStatusComponentSchema
|
|
35114
35289
|
};
|
|
35115
35290
|
const validateComponentName = (componentName) => {
|
|
35116
35291
|
if (!componentName) {
|
|
@@ -35239,7 +35414,8 @@ class Core {
|
|
|
35239
35414
|
const uiElement = new UIElement({
|
|
35240
35415
|
...mergedOptions,
|
|
35241
35416
|
component,
|
|
35242
|
-
componentProps: mergedOptions
|
|
35417
|
+
componentProps: mergedOptions,
|
|
35418
|
+
componentName
|
|
35243
35419
|
});
|
|
35244
35420
|
this.components.push(uiElement);
|
|
35245
35421
|
return uiElement;
|