@adyen/kyc-components 2.35.0 → 2.36.1
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 +338 -249
- package/dist/style.css +6 -13
- 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/index.d.ts +2 -2
- 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-onboarding-status.d.ts +1 -1
- package/dist/types/core/core.d.ts +1 -1
- package/dist/types/core/hooks/useAnalytics.d.ts +1 -2
- package/dist/types/core/hooks/useAssociatedLegalArrangement.d.ts +2 -0
- package/dist/types/core/hooks/useComponentApi.d.ts +0 -4
- package/dist/types/core/models/api/{onboarding-redirect.d.ts → view-verification-status.d.ts} +6 -6
- 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
|
};
|
|
@@ -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 = {
|
|
@@ -10502,7 +10597,7 @@ const accountHolderValidationRules = {
|
|
|
10502
10597
|
}
|
|
10503
10598
|
};
|
|
10504
10599
|
const accountHolderFields = ["accountHolder"];
|
|
10505
|
-
const logger$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
18537
|
+
logger$j[level](message);
|
|
18443
18538
|
break;
|
|
18444
18539
|
default:
|
|
18445
|
-
logger$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
-
|
|
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$
|
|
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$
|
|
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$
|
|
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:
|
|
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"),
|
|
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 =
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
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) && !
|
|
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
|
-
|
|
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
|
|
32364
|
-
await
|
|
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
|
|
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:
|
|
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) =>
|
|
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:
|
|
32780
|
+
parentLegalEntity: associatedLegalArrangement,
|
|
32705
32781
|
legalEntityResponse: associatedLegalEntity,
|
|
32706
32782
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
32707
|
-
problems: (
|
|
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) =>
|
|
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: (
|
|
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: (
|
|
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:
|
|
32833
|
+
legalEntityResponse: associatedLegalArrangement,
|
|
32758
32834
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
32759
32835
|
onChange: componentOnChange,
|
|
32760
32836
|
eventEmitter,
|
|
32761
|
-
onSubmit:
|
|
32837
|
+
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
32762
32838
|
handleHomeClick: navigateBack,
|
|
32763
32839
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
32764
|
-
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,
|
|
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
|
|
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:
|
|
32885
|
+
legalEntityResponse: associatedLegalArrangement,
|
|
32810
32886
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
32811
|
-
problems: (
|
|
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:
|
|
32890
|
+
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
32815
32891
|
handleHomeClick: navigateBack,
|
|
32816
32892
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
32817
|
-
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,
|
|
32818
32894
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
32819
32895
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
32820
32896
|
});
|
|
@@ -33129,16 +33205,6 @@ const getAddress = async (context, addressId) => {
|
|
|
33129
33205
|
}
|
|
33130
33206
|
});
|
|
33131
33207
|
};
|
|
33132
|
-
const getAnalyticsSession = async (loadingContext, data) => httpPost({
|
|
33133
|
-
loadingContext,
|
|
33134
|
-
errorLevel: "warn",
|
|
33135
|
-
errorMessage: `Failed to get analytics sessionId`,
|
|
33136
|
-
path: `analytics/ui`,
|
|
33137
|
-
authentication: "jwt",
|
|
33138
|
-
headers: {
|
|
33139
|
-
"Content-Type": "application/json"
|
|
33140
|
-
}
|
|
33141
|
-
}, data);
|
|
33142
33208
|
const getIdverificationToken = async (context, request) => {
|
|
33143
33209
|
const {
|
|
33144
33210
|
loadingContext,
|
|
@@ -33209,16 +33275,6 @@ const idVerificationStartcheck = async (context, request) => {
|
|
|
33209
33275
|
}
|
|
33210
33276
|
}, request);
|
|
33211
33277
|
};
|
|
33212
|
-
const pushEvents = async (loadingContext, sessionId, event) => httpPost({
|
|
33213
|
-
loadingContext,
|
|
33214
|
-
errorLevel: "warn",
|
|
33215
|
-
errorMessage: `Failed to push events`,
|
|
33216
|
-
path: `analytics/ui/${sessionId}`,
|
|
33217
|
-
authentication: "jwt",
|
|
33218
|
-
headers: {
|
|
33219
|
-
"Content-Type": "application/json"
|
|
33220
|
-
}
|
|
33221
|
-
}, event);
|
|
33222
33278
|
const searchAddress = async (context, address2) => {
|
|
33223
33279
|
const {
|
|
33224
33280
|
loadingContext,
|
|
@@ -33278,9 +33334,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
33278
33334
|
getIdVerificationToken: async (legalEntityId, data) => getIdverificationToken(baseRequestContext, data),
|
|
33279
33335
|
idVerificationStartCheck: async (legalEntityId, data) => idVerificationStartcheck(baseRequestContext, data),
|
|
33280
33336
|
getOnboardingStatus: async () => getOnboardingStatus(baseRequestContext),
|
|
33281
|
-
generateOnboardingLink: async (config) => generateOnboardingLink(baseRequestContext, config)
|
|
33282
|
-
getAnalyticsSession: async (data) => getAnalyticsSession(loadingContext, data),
|
|
33283
|
-
pushEvents: async (sessionId, event) => pushEvents(loadingContext, sessionId, event)
|
|
33337
|
+
generateOnboardingLink: async (config) => generateOnboardingLink(baseRequestContext, config)
|
|
33284
33338
|
};
|
|
33285
33339
|
}, [base, rootLegalEntityId]);
|
|
33286
33340
|
};
|
|
@@ -33434,46 +33488,46 @@ function CreateTransferInstrumentComponent({
|
|
|
33434
33488
|
taskType: TaskTypes.PAYOUT
|
|
33435
33489
|
}) : null;
|
|
33436
33490
|
}
|
|
33491
|
+
var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
|
|
33492
|
+
OnboardingUrlTarget2["BLANK"] = "_blank";
|
|
33493
|
+
OnboardingUrlTarget2["SELF"] = "_self";
|
|
33494
|
+
return OnboardingUrlTarget2;
|
|
33495
|
+
})(OnboardingUrlTarget || {});
|
|
33437
33496
|
var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
|
|
33438
|
-
OnboardingStatus2["
|
|
33439
|
-
OnboardingStatus2["
|
|
33440
|
-
OnboardingStatus2["
|
|
33441
|
-
OnboardingStatus2["
|
|
33497
|
+
OnboardingStatus2["AWAITING_DATA"] = "AWAITING_DATA";
|
|
33498
|
+
OnboardingStatus2["IN_REVIEW"] = "IN_REVIEW";
|
|
33499
|
+
OnboardingStatus2["UNSUCCESSFUL"] = "UNSUCCESSFUL";
|
|
33500
|
+
OnboardingStatus2["REJECTED"] = "REJECTED";
|
|
33501
|
+
OnboardingStatus2["VERIFIED"] = "VERIFIED";
|
|
33442
33502
|
return OnboardingStatus2;
|
|
33443
33503
|
})(OnboardingStatus || {});
|
|
33444
33504
|
const contentMap = {
|
|
33445
|
-
[OnboardingStatus.
|
|
33446
|
-
|
|
33447
|
-
|
|
33448
|
-
|
|
33505
|
+
[OnboardingStatus.AWAITING_DATA]: {
|
|
33506
|
+
description: ["onboardingRedirectAwaitingDescriptionP1"],
|
|
33507
|
+
ctaButton: "onboardingRedirectAwaitingCtaButton"
|
|
33508
|
+
},
|
|
33509
|
+
[OnboardingStatus.IN_REVIEW]: {
|
|
33510
|
+
description: ["onboardingRedirectInReviewDescriptionP1"],
|
|
33511
|
+
ctaButton: "onboardingRedirectInReviewCtaButton"
|
|
33449
33512
|
},
|
|
33450
|
-
[OnboardingStatus.
|
|
33451
|
-
|
|
33452
|
-
|
|
33453
|
-
ctaButton: "onboardingRedirectInProgressCtaButton"
|
|
33513
|
+
[OnboardingStatus.UNSUCCESSFUL]: {
|
|
33514
|
+
description: ["onboardingRedirectUnsuccessfulDescriptionP1"],
|
|
33515
|
+
ctaButton: "onboardingRedirectUnsuccessfulCtaButton"
|
|
33454
33516
|
},
|
|
33455
|
-
[OnboardingStatus.
|
|
33456
|
-
|
|
33457
|
-
description: ["onboardingRedirectErrorsDescriptionP1", "onboardingRedirectErrorsDescriptionP2"],
|
|
33458
|
-
ctaButton: "onboardingRedirectErrorsCtaButton"
|
|
33517
|
+
[OnboardingStatus.REJECTED]: {
|
|
33518
|
+
description: ["onboardingRedirectRejectedDescriptionP1"]
|
|
33459
33519
|
},
|
|
33460
|
-
[OnboardingStatus.
|
|
33461
|
-
|
|
33462
|
-
description: ["onboardingRedirectFinishedDescriptionP1"],
|
|
33463
|
-
ctaButton: "onboardingRedirectFinishedCtaButton"
|
|
33520
|
+
[OnboardingStatus.VERIFIED]: {
|
|
33521
|
+
description: ["onboardingRedirectVerifiedDescriptionP1"]
|
|
33464
33522
|
}
|
|
33465
33523
|
};
|
|
33466
33524
|
function getContentByStatus(status) {
|
|
33467
33525
|
return contentMap[status];
|
|
33468
33526
|
}
|
|
33469
|
-
|
|
33470
|
-
|
|
33471
|
-
OnboardingUrlTarget2["SELF"] = "_self";
|
|
33472
|
-
return OnboardingUrlTarget2;
|
|
33473
|
-
})(OnboardingUrlTarget || {});
|
|
33474
|
-
const logger$5 = createLogger("OnboardingRedirectComponent");
|
|
33475
|
-
function OnboardingRedirectComponent({
|
|
33527
|
+
const logger$5 = createLogger("ViewVerificationStatusComponent");
|
|
33528
|
+
function ViewVerificationStatusComponent({
|
|
33476
33529
|
legalEntityId,
|
|
33530
|
+
hideExplanation = false,
|
|
33477
33531
|
returnUrl,
|
|
33478
33532
|
redirectTarget,
|
|
33479
33533
|
onStatusChange,
|
|
@@ -33557,6 +33611,12 @@ function OnboardingRedirectComponent({
|
|
|
33557
33611
|
const {
|
|
33558
33612
|
redirectUrl
|
|
33559
33613
|
} = await generateOnboardingLink2(config);
|
|
33614
|
+
if (!redirectUrl) {
|
|
33615
|
+
handleError({
|
|
33616
|
+
trKey: "onboardingRedirectLinkError"
|
|
33617
|
+
});
|
|
33618
|
+
return;
|
|
33619
|
+
}
|
|
33560
33620
|
openUrl(redirectUrl, config);
|
|
33561
33621
|
} catch (error) {
|
|
33562
33622
|
handleError({
|
|
@@ -33584,6 +33644,20 @@ function OnboardingRedirectComponent({
|
|
|
33584
33644
|
});
|
|
33585
33645
|
}
|
|
33586
33646
|
};
|
|
33647
|
+
const renderFooter = () => {
|
|
33648
|
+
const statusesWithoutActions = [OnboardingStatus.REJECTED, OnboardingStatus.VERIFIED];
|
|
33649
|
+
if (statusesWithoutActions.includes(onboardingStatus) || !(content == null ? void 0 : content.ctaButton)) {
|
|
33650
|
+
return;
|
|
33651
|
+
}
|
|
33652
|
+
return jsx(Button, {
|
|
33653
|
+
label: i18n.get(content.ctaButton),
|
|
33654
|
+
onClick: redirectToAdyen,
|
|
33655
|
+
type: "button",
|
|
33656
|
+
className: "adyen-view-verification-status__button",
|
|
33657
|
+
role: "link",
|
|
33658
|
+
status: loadingLinkStatus === "loading" ? "loading" : "default"
|
|
33659
|
+
});
|
|
33660
|
+
};
|
|
33587
33661
|
const renderBody = () => {
|
|
33588
33662
|
if (alertContent) {
|
|
33589
33663
|
return jsx(Alert, {
|
|
@@ -33594,24 +33668,12 @@ function OnboardingRedirectComponent({
|
|
|
33594
33668
|
}
|
|
33595
33669
|
if (content) {
|
|
33596
33670
|
return jsxs(Fragment, {
|
|
33597
|
-
children: [jsx("
|
|
33598
|
-
className: "adyen-
|
|
33599
|
-
children: i18n.get(content.header)
|
|
33600
|
-
}), content.description.map((key) => jsx("p", {
|
|
33601
|
-
className: "adyen-onboarding-redirect__description",
|
|
33671
|
+
children: [hideExplanation ? null : content.description.map((key) => jsx("p", {
|
|
33672
|
+
className: "adyen-view-verification-status__description",
|
|
33602
33673
|
children: i18n.get(key)
|
|
33603
33674
|
}, key)), jsx("div", {
|
|
33604
|
-
className: "adyen-
|
|
33605
|
-
children:
|
|
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
|
-
})
|
|
33675
|
+
className: "adyen-view-verification-status__footer",
|
|
33676
|
+
children: renderFooter()
|
|
33615
33677
|
})]
|
|
33616
33678
|
});
|
|
33617
33679
|
}
|
|
@@ -33620,7 +33682,7 @@ function OnboardingRedirectComponent({
|
|
|
33620
33682
|
});
|
|
33621
33683
|
};
|
|
33622
33684
|
return jsx("section", {
|
|
33623
|
-
className: "adyen-
|
|
33685
|
+
className: "adyen-view-verification-status",
|
|
33624
33686
|
children: renderBody()
|
|
33625
33687
|
});
|
|
33626
33688
|
}
|
|
@@ -33635,7 +33697,7 @@ const componentsMap = {
|
|
|
33635
33697
|
pci: PciDropinComponent,
|
|
33636
33698
|
createTransferInstrumentComponent: CreateTransferInstrumentComponent,
|
|
33637
33699
|
createIndividualComponent: CreateIndividualComponent,
|
|
33638
|
-
|
|
33700
|
+
viewVerificationStatusComponent: ViewVerificationStatusComponent
|
|
33639
33701
|
};
|
|
33640
33702
|
const AuthProvider = ({
|
|
33641
33703
|
children,
|
|
@@ -33665,6 +33727,26 @@ const AuthProvider = ({
|
|
|
33665
33727
|
children
|
|
33666
33728
|
});
|
|
33667
33729
|
};
|
|
33730
|
+
const getAnalyticsSession = async (loadingContext, data) => httpPost({
|
|
33731
|
+
loadingContext,
|
|
33732
|
+
errorLevel: "warn",
|
|
33733
|
+
errorMessage: `Failed to get analytics sessionId`,
|
|
33734
|
+
path: `analytics/ui`,
|
|
33735
|
+
authentication: "jwt",
|
|
33736
|
+
headers: {
|
|
33737
|
+
"Content-Type": "application/json"
|
|
33738
|
+
}
|
|
33739
|
+
}, data);
|
|
33740
|
+
const pushEvents = async (loadingContext, sessionId, event) => httpPost({
|
|
33741
|
+
loadingContext,
|
|
33742
|
+
errorLevel: "warn",
|
|
33743
|
+
errorMessage: `Failed to push events`,
|
|
33744
|
+
path: `analytics/ui/${sessionId}`,
|
|
33745
|
+
authentication: "jwt",
|
|
33746
|
+
headers: {
|
|
33747
|
+
"Content-Type": "application/json"
|
|
33748
|
+
}
|
|
33749
|
+
}, event);
|
|
33668
33750
|
const convertToEmbeddedEvent = (eventQueueItem) => {
|
|
33669
33751
|
const [eventType, event] = eventQueueItem;
|
|
33670
33752
|
const hasEventData = typeof event === "object";
|
|
@@ -33679,28 +33761,33 @@ const convertToEmbeddedEvent = (eventQueueItem) => {
|
|
|
33679
33761
|
};
|
|
33680
33762
|
const useAnalytics = async ({
|
|
33681
33763
|
onUserEvent,
|
|
33682
|
-
isEmbeddedDropin,
|
|
33683
33764
|
legalEntityId,
|
|
33684
33765
|
sdkVersion,
|
|
33685
33766
|
componentName
|
|
33686
33767
|
}) => {
|
|
33687
33768
|
const {
|
|
33688
|
-
|
|
33689
|
-
|
|
33690
|
-
} =
|
|
33769
|
+
isEmbeddedDropin,
|
|
33770
|
+
loadingContext: base
|
|
33771
|
+
} = useAuthContext();
|
|
33772
|
+
const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/`;
|
|
33691
33773
|
if (isEmbeddedDropin) {
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
33695
|
-
|
|
33696
|
-
|
|
33697
|
-
|
|
33698
|
-
|
|
33699
|
-
|
|
33700
|
-
|
|
33701
|
-
|
|
33702
|
-
|
|
33703
|
-
|
|
33774
|
+
try {
|
|
33775
|
+
const sessionResponse = await getAnalyticsSession(loadingContext, {
|
|
33776
|
+
sdkVersion,
|
|
33777
|
+
componentName,
|
|
33778
|
+
userAgent: navigator.userAgent,
|
|
33779
|
+
legalEntityId
|
|
33780
|
+
});
|
|
33781
|
+
if (!(sessionResponse == null ? void 0 : sessionResponse.id)) {
|
|
33782
|
+
throw Error("Analytics session Id not received");
|
|
33783
|
+
}
|
|
33784
|
+
userEvents.subscribe((data) => {
|
|
33785
|
+
const eventItem = convertToEmbeddedEvent(data);
|
|
33786
|
+
pushEvents(loadingContext, sessionResponse.id, eventItem);
|
|
33787
|
+
});
|
|
33788
|
+
} catch (e) {
|
|
33789
|
+
console.error("Failed to initiate analytics for component", e);
|
|
33790
|
+
}
|
|
33704
33791
|
} else if (onUserEvent) {
|
|
33705
33792
|
userEvents.subscribe(onUserEvent);
|
|
33706
33793
|
}
|
|
@@ -34004,10 +34091,9 @@ const ConfigurationApiProvider = ({
|
|
|
34004
34091
|
isEmbeddedDropin,
|
|
34005
34092
|
loadingContext
|
|
34006
34093
|
} = authContext;
|
|
34007
|
-
const sdkVersion = "2.
|
|
34094
|
+
const sdkVersion = "2.36.1";
|
|
34008
34095
|
useAnalytics({
|
|
34009
34096
|
onUserEvent,
|
|
34010
|
-
isEmbeddedDropin,
|
|
34011
34097
|
legalEntityId: rootLegalEntityId,
|
|
34012
34098
|
sdkVersion,
|
|
34013
34099
|
componentName
|
|
@@ -35166,11 +35252,14 @@ const createIndividualComponentSchema = {
|
|
|
35166
35252
|
type: "function"
|
|
35167
35253
|
}
|
|
35168
35254
|
};
|
|
35169
|
-
const
|
|
35255
|
+
const viewVerificationStatusComponentSchema = {
|
|
35170
35256
|
legalEntityId: {
|
|
35171
35257
|
type: "string",
|
|
35172
35258
|
required: true
|
|
35173
35259
|
},
|
|
35260
|
+
hideExplanation: {
|
|
35261
|
+
type: "boolean"
|
|
35262
|
+
},
|
|
35174
35263
|
redirectTarget: {
|
|
35175
35264
|
type: "string"
|
|
35176
35265
|
},
|
|
@@ -35198,7 +35287,7 @@ const componentsSchemaMap = {
|
|
|
35198
35287
|
taskList: taskListSchema,
|
|
35199
35288
|
createIndividualComponent: createIndividualComponentSchema,
|
|
35200
35289
|
createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
|
|
35201
|
-
|
|
35290
|
+
viewVerificationStatusComponent: viewVerificationStatusComponentSchema
|
|
35202
35291
|
};
|
|
35203
35292
|
const validateComponentName = (componentName) => {
|
|
35204
35293
|
if (!componentName) {
|