@adyen/kyc-components 3.37.1 → 3.38.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 +270 -272
- package/dist/types/components/PayoutDetails/rules.d.ts +0 -9
- package/dist/types/components/PayoutDetails/types.d.ts +3 -3
- package/dist/types/components/PayoutDetails/utils.d.ts +1 -0
- package/dist/types/components/PayoutVerificationMethod/types.d.ts +1 -1
- package/dist/types/components/internal/DBANameField/types.d.ts +1 -1
- package/dist/types/core/Context/CoreContext.d.ts +1 -0
- package/dist/types/core/hooks/useScenarioConfiguration.d.ts +2 -2
- package/dist/types/core/hooks/useVersionConfiguration.d.ts +10 -1
- package/dist/types/core/models/api/company-search.d.ts +1 -1
- package/dist/types/utils/mapping/componentApiMapping.d.ts +4 -4
- package/package.json +2 -2
- package/dist/types/core/hooks/useHideButton.d.ts +0 -2
|
@@ -355,6 +355,7 @@ const defaultTrans = {
|
|
|
355
355
|
doNotHaveYTunnus: "I do not have a Y-TUNNUS",
|
|
356
356
|
doNotHaveAbn: "I do not have an ABN",
|
|
357
357
|
doNotHaveAcn: "I do not have an ACN",
|
|
358
|
+
doNotHaveNZBN: "I do not have a NZBN",
|
|
358
359
|
documentAddressedToName: "The document has to be addressed to %{name}",
|
|
359
360
|
documentCannotBeDamaged: "The document cannot be damaged",
|
|
360
361
|
documentIssuedByGovernmentAuthority: "The document has to be issued by a government authority. It's usually given when a business is created at the local commercial register",
|
|
@@ -2975,27 +2976,6 @@ function useResetGlobalData(caller) {
|
|
|
2975
2976
|
[dispatch, caller]
|
|
2976
2977
|
);
|
|
2977
2978
|
}
|
|
2978
|
-
const useSetting = (settingName) => {
|
|
2979
|
-
const context = useContext(SettingsContext);
|
|
2980
|
-
if (context === void 0) {
|
|
2981
|
-
throw new Error("useSetting must be used within a SettingsProvider");
|
|
2982
|
-
}
|
|
2983
|
-
const { getSetting } = context;
|
|
2984
|
-
return getSetting(settingName);
|
|
2985
|
-
};
|
|
2986
|
-
const logger$I = createLogger("useAllowedCountries");
|
|
2987
|
-
const useAllowedCountries = () => {
|
|
2988
|
-
const acceptedCountries = useSetting("acceptedCountries");
|
|
2989
|
-
const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
|
|
2990
|
-
const [allowedCountries, setAllowedCountries] = useState(
|
|
2991
|
-
acceptedCountries
|
|
2992
|
-
);
|
|
2993
|
-
useEffect(() => {
|
|
2994
|
-
if (acceptedCountries !== void 0) return;
|
|
2995
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$I.error);
|
|
2996
|
-
}, [acceptedCountries]);
|
|
2997
|
-
return allowedCountries;
|
|
2998
|
-
};
|
|
2999
2979
|
class ValidationResult {
|
|
3000
2980
|
constructor(results) {
|
|
3001
2981
|
this.validationResults = results;
|
|
@@ -3013,7 +2993,7 @@ class ValidationResult {
|
|
|
3013
2993
|
return this.validationResults.find((result) => result.hasError);
|
|
3014
2994
|
}
|
|
3015
2995
|
}
|
|
3016
|
-
const logger$
|
|
2996
|
+
const logger$I = createLogger("useAsyncValidator");
|
|
3017
2997
|
const useAsyncValidator = (asyncRules) => {
|
|
3018
2998
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3019
2999
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -3033,7 +3013,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
3033
3013
|
}
|
|
3034
3014
|
])
|
|
3035
3015
|
});
|
|
3036
|
-
}).catch(logger$
|
|
3016
|
+
}).catch(logger$I.error);
|
|
3037
3017
|
},
|
|
3038
3018
|
[asyncRules, clearAsyncValidationResults]
|
|
3039
3019
|
);
|
|
@@ -5120,7 +5100,7 @@ const companyNameAndCountryFields = [
|
|
|
5120
5100
|
function CompanyNameAndCountry(props) {
|
|
5121
5101
|
const { i18n } = useI18nContext();
|
|
5122
5102
|
const { isSettingEnabled } = useSettingsContext();
|
|
5123
|
-
const allowedCountries =
|
|
5103
|
+
const { allowedCountries } = useCoreContext();
|
|
5124
5104
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
5125
5105
|
const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(
|
|
5126
5106
|
ExperimentNames.StrictNameAndAddressValidationV4
|
|
@@ -7364,7 +7344,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
|
|
|
7364
7344
|
};
|
|
7365
7345
|
};
|
|
7366
7346
|
const MISMATCH_ANIMATION_NAME = "mismatchShake";
|
|
7367
|
-
const logger$
|
|
7347
|
+
const logger$H = createLogger("MaskedInputText");
|
|
7368
7348
|
const MaskedInputText = ({
|
|
7369
7349
|
value,
|
|
7370
7350
|
onInput,
|
|
@@ -7409,7 +7389,7 @@ const MaskedInputText = ({
|
|
|
7409
7389
|
};
|
|
7410
7390
|
useEffect(() => {
|
|
7411
7391
|
if (!mask) {
|
|
7412
|
-
logger$
|
|
7392
|
+
logger$H.warn("`mask` is undefined. No masking of input will take place.");
|
|
7413
7393
|
}
|
|
7414
7394
|
}, [mask]);
|
|
7415
7395
|
const getMaskResult = useCallback(
|
|
@@ -7453,7 +7433,7 @@ const MaskedInputText = ({
|
|
|
7453
7433
|
return;
|
|
7454
7434
|
}
|
|
7455
7435
|
if (preserveMismatchingInitialValue) {
|
|
7456
|
-
logger$
|
|
7436
|
+
logger$H.warn(
|
|
7457
7437
|
`Value received "${value}" does not match mask`,
|
|
7458
7438
|
maskResult,
|
|
7459
7439
|
`
|
|
@@ -7463,7 +7443,7 @@ Preserving mismatched initial value until user input.`
|
|
|
7463
7443
|
return;
|
|
7464
7444
|
}
|
|
7465
7445
|
const fallback = displayValueToPure(maskResult.partialDisplayValue);
|
|
7466
|
-
logger$
|
|
7446
|
+
logger$H.warn(
|
|
7467
7447
|
`Value received "${value}" does not match mask`,
|
|
7468
7448
|
maskResult,
|
|
7469
7449
|
`
|
|
@@ -8244,7 +8224,7 @@ function DBANameField({
|
|
|
8244
8224
|
const isNo = selectedValue === "no";
|
|
8245
8225
|
handleChangeFor("hasDba")(isYes);
|
|
8246
8226
|
if (isDoingBusinessAsNameV4Enabled) {
|
|
8247
|
-
handleChangeFor("
|
|
8227
|
+
handleChangeFor("doingBusinessAsAbsent")(isNo);
|
|
8248
8228
|
if (isNo) {
|
|
8249
8229
|
handleChangeFor("dbaName")(legalCompanyName);
|
|
8250
8230
|
}
|
|
@@ -11232,7 +11212,7 @@ function Dropzone(props) {
|
|
|
11232
11212
|
isRequired && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: i18n.get("fieldIsRequired") })
|
|
11233
11213
|
] });
|
|
11234
11214
|
}
|
|
11235
|
-
const logger$
|
|
11215
|
+
const logger$G = createLogger("TextArea");
|
|
11236
11216
|
function TextArea(props) {
|
|
11237
11217
|
const { classNameModifiers, uniqueId, ...passedProps } = props;
|
|
11238
11218
|
const {
|
|
@@ -11247,7 +11227,7 @@ function TextArea(props) {
|
|
|
11247
11227
|
const { i18n } = useI18nContext();
|
|
11248
11228
|
const [value, setValue] = useState("");
|
|
11249
11229
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11250
|
-
logger$
|
|
11230
|
+
logger$G.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11251
11231
|
}
|
|
11252
11232
|
const handleInput = (e) => {
|
|
11253
11233
|
var _a;
|
|
@@ -11666,7 +11646,7 @@ const styles$8 = {
|
|
|
11666
11646
|
"financial-information-reported-value-options": "adyen-kyc-financial-information-reported-value-options",
|
|
11667
11647
|
financialInformationReportedValueOptions
|
|
11668
11648
|
};
|
|
11669
|
-
const logger$
|
|
11649
|
+
const logger$F = createLogger("InputCurrency");
|
|
11670
11650
|
const determineDecimalSeparator = (formatter) => formatter.formatToParts(0.1).find((part) => part.type === "decimal").value;
|
|
11671
11651
|
const determineCurrencySymbol = (formatter) => formatter.formatToParts(0).find((part) => part.type === "currency").value;
|
|
11672
11652
|
const getNumberFromFormattedCurrency = (formatted, decimalSeparator) => {
|
|
@@ -11697,7 +11677,7 @@ const InputCurrency = ({
|
|
|
11697
11677
|
const rawValue = e.target.value;
|
|
11698
11678
|
const value = getNumberFromFormattedCurrency(rawValue, decimalSeparator);
|
|
11699
11679
|
if (Number.isNaN(value)) {
|
|
11700
|
-
logger$
|
|
11680
|
+
logger$F.warn(`Unable to get number from formatted currency: "${rawValue}"`);
|
|
11701
11681
|
setText(isUndefinedOrNull(amount) ? currencySymbol : formatter.format(amount));
|
|
11702
11682
|
return;
|
|
11703
11683
|
}
|
|
@@ -12163,7 +12143,7 @@ function FieldContainer(props) {
|
|
|
12163
12143
|
}
|
|
12164
12144
|
return renderField(fieldName);
|
|
12165
12145
|
}
|
|
12166
|
-
const logger$
|
|
12146
|
+
const logger$E = createLogger("SearchAddress");
|
|
12167
12147
|
const SearchAddress = ({
|
|
12168
12148
|
data,
|
|
12169
12149
|
legalEntityId,
|
|
@@ -12196,7 +12176,7 @@ const SearchAddress = ({
|
|
|
12196
12176
|
const response = await handleFindAddress(selectedAddressId);
|
|
12197
12177
|
autocompleteAddressForm(response);
|
|
12198
12178
|
} catch (e) {
|
|
12199
|
-
logger$
|
|
12179
|
+
logger$E.error(e);
|
|
12200
12180
|
}
|
|
12201
12181
|
};
|
|
12202
12182
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -12207,7 +12187,7 @@ const SearchAddress = ({
|
|
|
12207
12187
|
);
|
|
12208
12188
|
setItems((response == null ? void 0 : response.results) || []);
|
|
12209
12189
|
} catch (e) {
|
|
12210
|
-
logger$
|
|
12190
|
+
logger$E.error(e);
|
|
12211
12191
|
}
|
|
12212
12192
|
};
|
|
12213
12193
|
const onChange = (e) => {
|
|
@@ -12259,7 +12239,7 @@ const SearchAddress = ({
|
|
|
12259
12239
|
setItems([]);
|
|
12260
12240
|
}
|
|
12261
12241
|
} catch (e) {
|
|
12262
|
-
logger$
|
|
12242
|
+
logger$E.error(e);
|
|
12263
12243
|
}
|
|
12264
12244
|
setLoading(false);
|
|
12265
12245
|
}
|
|
@@ -12902,7 +12882,7 @@ Address.defaultProps = {
|
|
|
12902
12882
|
requiredFields: ADDRESS_SCHEMA,
|
|
12903
12883
|
countryCode: null
|
|
12904
12884
|
};
|
|
12905
|
-
const logger$
|
|
12885
|
+
const logger$D = createLogger("AddressFieldContainer");
|
|
12906
12886
|
const formatAddressItem = (item) => {
|
|
12907
12887
|
if (item.description.includes("Addresses")) {
|
|
12908
12888
|
const splittedDescription = item.description.split(" - ");
|
|
@@ -13040,7 +13020,7 @@ function FieldContainerComponent({
|
|
|
13040
13020
|
setItems([]);
|
|
13041
13021
|
}
|
|
13042
13022
|
} catch (e) {
|
|
13043
|
-
logger$
|
|
13023
|
+
logger$D.error(e);
|
|
13044
13024
|
}
|
|
13045
13025
|
setLoading(false);
|
|
13046
13026
|
};
|
|
@@ -13074,7 +13054,7 @@ function FieldContainerComponent({
|
|
|
13074
13054
|
});
|
|
13075
13055
|
}
|
|
13076
13056
|
} catch (e) {
|
|
13077
|
-
logger$
|
|
13057
|
+
logger$D.error(e);
|
|
13078
13058
|
}
|
|
13079
13059
|
};
|
|
13080
13060
|
const onDrilldown = async (address) => {
|
|
@@ -13086,7 +13066,7 @@ function FieldContainerComponent({
|
|
|
13086
13066
|
));
|
|
13087
13067
|
setItems((response == null ? void 0 : response.results) || []);
|
|
13088
13068
|
} catch (e) {
|
|
13089
|
-
logger$
|
|
13069
|
+
logger$D.error(e);
|
|
13090
13070
|
}
|
|
13091
13071
|
};
|
|
13092
13072
|
const handleOnChange = (e) => {
|
|
@@ -14231,6 +14211,7 @@ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
|
|
|
14231
14211
|
CountryCodes.Germany,
|
|
14232
14212
|
CountryCodes.Lithuania,
|
|
14233
14213
|
CountryCodes.Luxembourg,
|
|
14214
|
+
CountryCodes.NewZealand,
|
|
14234
14215
|
CountryCodes.Poland,
|
|
14235
14216
|
CountryCodes.Sweden,
|
|
14236
14217
|
CountryCodes.Switzerland
|
|
@@ -14256,7 +14237,6 @@ const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
|
|
|
14256
14237
|
CountryCodes.IsleOfMan
|
|
14257
14238
|
];
|
|
14258
14239
|
const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [
|
|
14259
|
-
CountryCodes.NewZealand,
|
|
14260
14240
|
CountryCodes.Singapore
|
|
14261
14241
|
];
|
|
14262
14242
|
const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
|
|
@@ -14452,7 +14432,7 @@ const rules$3 = ({
|
|
|
14452
14432
|
}
|
|
14453
14433
|
}
|
|
14454
14434
|
});
|
|
14455
|
-
const logger$
|
|
14435
|
+
const logger$C = createLogger("mapPayoutAccountSchemaToApiBankAccount");
|
|
14456
14436
|
const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCountry) => {
|
|
14457
14437
|
var _a;
|
|
14458
14438
|
if ("iban" in payoutAccount && payoutAccount.iban)
|
|
@@ -14532,7 +14512,7 @@ const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCoun
|
|
|
14532
14512
|
routingNumber: payoutAccount.branchCode
|
|
14533
14513
|
};
|
|
14534
14514
|
default:
|
|
14535
|
-
logger$
|
|
14515
|
+
logger$C.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
|
|
14536
14516
|
return {
|
|
14537
14517
|
type: `${bankCountry.toLowerCase()}Local`,
|
|
14538
14518
|
accountNumber: payoutAccount.bankAccountNumber
|
|
@@ -14658,7 +14638,7 @@ const businessDetailsBaseMapping = {
|
|
|
14658
14638
|
"additionalInformation.legalCompanyName": "organization.legalName",
|
|
14659
14639
|
"additionalInformation.legalFormDescription": "organization.legalFormDescription",
|
|
14660
14640
|
"additionalInformation.dbaName": "organization.doingBusinessAs",
|
|
14661
|
-
"additionalInformation.
|
|
14641
|
+
"additionalInformation.doingBusinessAsAbsent": "organization.doingBusinessAsAbsent",
|
|
14662
14642
|
"additionalInformation.registrationNumber": "organization.registrationNumber",
|
|
14663
14643
|
"additionalInformation.taxInformation": "organization.taxInformation",
|
|
14664
14644
|
"additionalInformation.vatNumber": "organization.vatNumber",
|
|
@@ -14687,7 +14667,7 @@ const companyBaseMapping = {
|
|
|
14687
14667
|
"companyType.entityType": "organization.type",
|
|
14688
14668
|
"companyRegistrationDetails.tradingName": "organization.doingBusinessAs",
|
|
14689
14669
|
"companyRegistrationDetails.dbaName": "organization.doingBusinessAs",
|
|
14690
|
-
"companyRegistrationDetails.
|
|
14670
|
+
"companyRegistrationDetails.doingBusinessAsAbsent": "organization.doingBusinessAsAbsent",
|
|
14691
14671
|
"companyRegistrationDetails.registrationNumber": "organization.registrationNumber",
|
|
14692
14672
|
"companyRegistrationDetails.taxInformation": "organization.taxInformation",
|
|
14693
14673
|
"companyRegistrationDetails.vatNumber": "organization.vatNumber",
|
|
@@ -14713,7 +14693,7 @@ const trustBaseMapping = {
|
|
|
14713
14693
|
"trustRegistrationDetails.trustType": "trust.type",
|
|
14714
14694
|
"trustRegistrationDetails.legalName": "trust.name",
|
|
14715
14695
|
"trustRegistrationDetails.dbaName": "trust.doingBusinessAs",
|
|
14716
|
-
"trustRegistrationDetails.
|
|
14696
|
+
"trustRegistrationDetails.doingBusinessAsAbsent": "trust.doingBusinessAsAbsent",
|
|
14717
14697
|
"trustRegistrationDetails.country": "trust.countryOfGoverningLaw",
|
|
14718
14698
|
"trustRegistrationDetails.registrationNumber": "trust.registrationNumber",
|
|
14719
14699
|
"trustRegistrationAddress.registrationAddress.city": "trust.registeredAddress.city",
|
|
@@ -14734,7 +14714,7 @@ const solePropBaseMapping = {
|
|
|
14734
14714
|
"solePropNameAndCountry.legalCompanyName": "soleProprietorship.name",
|
|
14735
14715
|
"solePropRegistrationDetails.tradingName": "soleProprietorship.doingBusinessAs",
|
|
14736
14716
|
"solePropRegistrationDetails.dbaName": "soleProprietorship.doingBusinessAs",
|
|
14737
|
-
"solePropRegistrationDetails.
|
|
14717
|
+
"solePropRegistrationDetails.doingBusinessAsAbsent": "soleProprietorship.doingBusinessAsAbsent",
|
|
14738
14718
|
"solePropRegistrationDetails.vatNumber": "soleProprietorship.vatNumber",
|
|
14739
14719
|
"solePropRegistrationDetails.vatAbsenceReason": "soleProprietorship.vatAbsenceReason",
|
|
14740
14720
|
"solePropRegistrationDetails.exemptedFromTax": "soleProprietorship.taxAbsent",
|
|
@@ -15745,7 +15725,7 @@ const initOnfido = async ({
|
|
|
15745
15725
|
language: getOnfidoLocaleConfig(i18n)
|
|
15746
15726
|
});
|
|
15747
15727
|
};
|
|
15748
|
-
const logger$
|
|
15728
|
+
const logger$B = createLogger("IdVerificationComponent");
|
|
15749
15729
|
function IdVerificationComponent({
|
|
15750
15730
|
userDetails,
|
|
15751
15731
|
legalEntityId,
|
|
@@ -15774,7 +15754,7 @@ function IdVerificationComponent({
|
|
|
15774
15754
|
onIdVerificationError,
|
|
15775
15755
|
onIdVerificationComplete
|
|
15776
15756
|
});
|
|
15777
|
-
})().catch(logger$
|
|
15757
|
+
})().catch(logger$B.error);
|
|
15778
15758
|
return () => {
|
|
15779
15759
|
if (onfidoSdk.current) onfidoSdk.current.tearDown();
|
|
15780
15760
|
};
|
|
@@ -15818,7 +15798,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
15818
15798
|
] })
|
|
15819
15799
|
] });
|
|
15820
15800
|
}
|
|
15821
|
-
const logger$
|
|
15801
|
+
const logger$A = createLogger("IdDocumentInstantVerificationComponent");
|
|
15822
15802
|
const idVerificationSchema = [
|
|
15823
15803
|
"instantIdVerificationData",
|
|
15824
15804
|
"idDocumentType"
|
|
@@ -15890,7 +15870,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
15890
15870
|
userDetails: props.userDetails,
|
|
15891
15871
|
legalEntityId: props.legalEntityId,
|
|
15892
15872
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
15893
|
-
onIdVerificationError: logger$
|
|
15873
|
+
onIdVerificationError: logger$A.error
|
|
15894
15874
|
}
|
|
15895
15875
|
),
|
|
15896
15876
|
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
|
|
@@ -16310,7 +16290,7 @@ const phoneFormatters = {
|
|
|
16310
16290
|
};
|
|
16311
16291
|
const phoneFields = ["phoneNumber"];
|
|
16312
16292
|
const DEFAULT_PHONE_PREFIX = "+1";
|
|
16313
|
-
const logger$
|
|
16293
|
+
const logger$z = createLogger("PhoneInput");
|
|
16314
16294
|
const usePhonePrefixes = () => {
|
|
16315
16295
|
const [phonePrefixes, setPhonePrefixes] = useState();
|
|
16316
16296
|
useEffect(() => {
|
|
@@ -16318,7 +16298,7 @@ const usePhonePrefixes = () => {
|
|
|
16318
16298
|
const loaded = (await import("./phonePrefixes-zV4hciyK.js")).default;
|
|
16319
16299
|
setPhonePrefixes(loaded);
|
|
16320
16300
|
};
|
|
16321
|
-
loadPhonePrefixes().catch(logger$
|
|
16301
|
+
loadPhonePrefixes().catch(logger$z.error);
|
|
16322
16302
|
}, []);
|
|
16323
16303
|
return phonePrefixes;
|
|
16324
16304
|
};
|
|
@@ -18357,7 +18337,7 @@ function PersonalDetailsComponent(props) {
|
|
|
18357
18337
|
var _a, _b, _c, _d;
|
|
18358
18338
|
const { i18n } = useI18nContext();
|
|
18359
18339
|
const { isSettingEnabled } = useSettingsContext();
|
|
18360
|
-
const allowedCountries =
|
|
18340
|
+
const { allowedCountries } = useCoreContext();
|
|
18361
18341
|
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
18362
18342
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
18363
18343
|
const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
|
|
@@ -19820,7 +19800,7 @@ class AdyenKycSdkError extends Error {
|
|
|
19820
19800
|
}
|
|
19821
19801
|
let sdkToken;
|
|
19822
19802
|
let fetchSdkToken;
|
|
19823
|
-
const logger$
|
|
19803
|
+
const logger$y = createLogger("Session");
|
|
19824
19804
|
const setSdkToken = (token) => {
|
|
19825
19805
|
sdkToken = token;
|
|
19826
19806
|
};
|
|
@@ -19845,7 +19825,7 @@ const refreshSession = async () => {
|
|
|
19845
19825
|
setSdkToken(token);
|
|
19846
19826
|
isSessionRefreshed = true;
|
|
19847
19827
|
} catch (e) {
|
|
19848
|
-
logger$
|
|
19828
|
+
logger$y.error("Failed to fetch sdk token", e);
|
|
19849
19829
|
}
|
|
19850
19830
|
return isSessionRefreshed;
|
|
19851
19831
|
};
|
|
@@ -19855,7 +19835,7 @@ const addAnimationStartListener = (element, listener) => {
|
|
|
19855
19835
|
const removeAnimationStartListener = (element, listener) => {
|
|
19856
19836
|
element.removeEventListener("animationstart", listener, false);
|
|
19857
19837
|
};
|
|
19858
|
-
const logger$
|
|
19838
|
+
const logger$x = createLogger("Fetch");
|
|
19859
19839
|
const getRequestObject = (options, data) => {
|
|
19860
19840
|
const { headers = [], method = "GET", authentication } = options;
|
|
19861
19841
|
let authHeaders;
|
|
@@ -19896,10 +19876,10 @@ const logFetchError = (message, level) => {
|
|
|
19896
19876
|
case "info":
|
|
19897
19877
|
case "warn":
|
|
19898
19878
|
case "error":
|
|
19899
|
-
logger$
|
|
19879
|
+
logger$x[level](message);
|
|
19900
19880
|
break;
|
|
19901
19881
|
default:
|
|
19902
|
-
logger$
|
|
19882
|
+
logger$x.error(message);
|
|
19903
19883
|
}
|
|
19904
19884
|
};
|
|
19905
19885
|
const handleFetchResponse = async (response, responseType) => {
|
|
@@ -19983,7 +19963,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
19983
19963
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
19984
19964
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
19985
19965
|
const TINK_VENDOR = "Tink";
|
|
19986
|
-
const logger$
|
|
19966
|
+
const logger$w = createLogger("iframeWidget");
|
|
19987
19967
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
19988
19968
|
const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
19989
19969
|
const parseMessageJson = (message) => {
|
|
@@ -20001,7 +19981,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
20001
19981
|
try {
|
|
20002
19982
|
await response;
|
|
20003
19983
|
} catch (ex) {
|
|
20004
|
-
logger$
|
|
19984
|
+
logger$w.error(ex);
|
|
20005
19985
|
}
|
|
20006
19986
|
return {
|
|
20007
19987
|
error: "UNKNOWN_ERROR",
|
|
@@ -20097,7 +20077,7 @@ class IFrameWidget {
|
|
|
20097
20077
|
message = responseData.errorMessage;
|
|
20098
20078
|
}
|
|
20099
20079
|
} catch (ex) {
|
|
20100
|
-
logger$
|
|
20080
|
+
logger$w.error(ex);
|
|
20101
20081
|
}
|
|
20102
20082
|
throw new AdyenKycSdkError(reason, jsonData.error);
|
|
20103
20083
|
}
|
|
@@ -21770,48 +21750,7 @@ const Skeleton = ({
|
|
|
21770
21750
|
});
|
|
21771
21751
|
return /* @__PURE__ */ jsx("div", { className: classNames, style: { height, width } });
|
|
21772
21752
|
};
|
|
21773
|
-
const isInstantVerificationAvailable = ({
|
|
21774
|
-
verificationVendorsCallback,
|
|
21775
|
-
provider
|
|
21776
|
-
}) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
|
|
21777
21753
|
const isProviderPlaidEmbedded = (redirectUrl) => !!(redirectUrl == null ? void 0 : redirectUrl.includes("/plaid/embedded-search/sdk?"));
|
|
21778
|
-
const rules$2 = ({ data, requiredFields }) => ({
|
|
21779
|
-
whenUsingManualVerification: () => {
|
|
21780
|
-
var _a;
|
|
21781
|
-
if (!data.payoutVerificationMethod) return;
|
|
21782
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
21783
|
-
return "REQUIRED";
|
|
21784
|
-
}
|
|
21785
|
-
},
|
|
21786
|
-
whenUsingInstantVerification: () => {
|
|
21787
|
-
var _a;
|
|
21788
|
-
if (!data.payoutVerificationMethod) {
|
|
21789
|
-
return "REQUIRED";
|
|
21790
|
-
}
|
|
21791
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
21792
|
-
return "REQUIRED";
|
|
21793
|
-
}
|
|
21794
|
-
},
|
|
21795
|
-
verifiedBankAccountNumber: () => {
|
|
21796
|
-
var _a;
|
|
21797
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
21798
|
-
return "REQUIRED";
|
|
21799
|
-
}
|
|
21800
|
-
},
|
|
21801
|
-
bankStatementRequirement: () => {
|
|
21802
|
-
var _a;
|
|
21803
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
21804
|
-
return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
|
|
21805
|
-
}
|
|
21806
|
-
},
|
|
21807
|
-
// "bankStatement description" field is always "optional" and it's coupled with bank statement document.
|
|
21808
|
-
bankStatementDescription: () => {
|
|
21809
|
-
var _a;
|
|
21810
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
|
|
21811
|
-
return "OPTIONAL";
|
|
21812
|
-
}
|
|
21813
|
-
}
|
|
21814
|
-
});
|
|
21815
21754
|
const preferInstantVerificationMethod = "adyen-kyc-prefer-instant-verification-method";
|
|
21816
21755
|
const preferInstantVerificationMethodCard = "adyen-kyc-prefer-instant-verification-method-card";
|
|
21817
21756
|
const preferInstantVerificationMethodImage = "adyen-kyc-prefer-instant-verification-method-image";
|
|
@@ -21965,7 +21904,7 @@ function PayoutVerificationMethod(props) {
|
|
|
21965
21904
|
accountHolder,
|
|
21966
21905
|
provider,
|
|
21967
21906
|
bankVendorsLoadingStatus,
|
|
21968
|
-
|
|
21907
|
+
instantVerificationAvailable,
|
|
21969
21908
|
legalEntityResponse,
|
|
21970
21909
|
forms,
|
|
21971
21910
|
validators: validators2,
|
|
@@ -22013,14 +21952,8 @@ function PayoutVerificationMethod(props) {
|
|
|
22013
21952
|
);
|
|
22014
21953
|
useEffect(() => {
|
|
22015
21954
|
if (!enablePreferInstantVerificationMethodFlow) return;
|
|
22016
|
-
setHideFooter == null ? void 0 : setHideFooter(
|
|
22017
|
-
enablePreferInstantVerificationMethodFlow && isActiveForm && !bankInfoValidated
|
|
22018
|
-
);
|
|
21955
|
+
setHideFooter == null ? void 0 : setHideFooter(isActiveForm && !bankInfoValidated);
|
|
22019
21956
|
}, [enablePreferInstantVerificationMethodFlow, isActiveForm, bankInfoValidated, setHideFooter]);
|
|
22020
|
-
const instantVerificationAvailable = useMemo(
|
|
22021
|
-
() => Boolean(instantVerificationAllowed && (provider == null ? void 0 : provider.redirectUrl)),
|
|
22022
|
-
[instantVerificationAllowed, provider]
|
|
22023
|
-
);
|
|
22024
21957
|
const methodsMetadata = makePayoutVerificationMethodsMetadata(provider == null ? void 0 : provider.name);
|
|
22025
21958
|
const selectVerificationMethod = (method) => {
|
|
22026
21959
|
setHasSelectedMethod(true);
|
|
@@ -22247,8 +22180,7 @@ function PayoutDetailsComponent(props) {
|
|
|
22247
22180
|
associatedLegalArrangement,
|
|
22248
22181
|
provider,
|
|
22249
22182
|
bankVendorsLoadingStatus,
|
|
22250
|
-
|
|
22251
|
-
handleGetBankVerificationVendors,
|
|
22183
|
+
instantVerificationAvailable,
|
|
22252
22184
|
setHideDropinLayout,
|
|
22253
22185
|
setHideOnHomeButton,
|
|
22254
22186
|
setSkipSubmit,
|
|
@@ -22337,9 +22269,7 @@ function PayoutDetailsComponent(props) {
|
|
|
22337
22269
|
bankInfoValidated,
|
|
22338
22270
|
setBankInfoValidated,
|
|
22339
22271
|
handleNextClick,
|
|
22340
|
-
|
|
22341
|
-
instantVerificationEnabled && handleGetBankVerificationVendors
|
|
22342
|
-
),
|
|
22272
|
+
instantVerificationAvailable,
|
|
22343
22273
|
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
22344
22274
|
handleBankVerificationError: handleBankVerificationError2,
|
|
22345
22275
|
setBankVerificationError: setInstantVerificationError,
|
|
@@ -24416,11 +24346,6 @@ const trackNavigation = ({
|
|
|
24416
24346
|
}
|
|
24417
24347
|
});
|
|
24418
24348
|
};
|
|
24419
|
-
const useHideButton = (condition, setHideState) => {
|
|
24420
|
-
useEffect(() => {
|
|
24421
|
-
setHideState == null ? void 0 : setHideState(condition);
|
|
24422
|
-
}, [condition, setHideState]);
|
|
24423
|
-
};
|
|
24424
24349
|
const getOpeningStep = (forms, remediationActions) => {
|
|
24425
24350
|
var _a;
|
|
24426
24351
|
if (remediationActions && Object.keys(remediationActions).length > 0) {
|
|
@@ -24458,10 +24383,6 @@ const useFormComposer = ({
|
|
|
24458
24383
|
const totalSteps = forms.length;
|
|
24459
24384
|
const isFinalStep = currentStep === totalSteps - 1;
|
|
24460
24385
|
const isFirstStep = currentStep === 0;
|
|
24461
|
-
const [hideHomeButton, setHideHomeButton] = useState(false);
|
|
24462
|
-
const [hideBackButton, setHideBackButton] = useState(false);
|
|
24463
|
-
useHideButton(isFirstStep, setHideBackButton);
|
|
24464
|
-
useHideButton(isFinalStep, setHideHomeButton);
|
|
24465
24386
|
useEffect(() => {
|
|
24466
24387
|
setActiveForm(
|
|
24467
24388
|
(activeForm2) => forms.find(({ formId }) => formId === activeForm2.formId) ?? activeForm2
|
|
@@ -24539,8 +24460,8 @@ const useFormComposer = ({
|
|
|
24539
24460
|
return {
|
|
24540
24461
|
handleBackClick: backClickHandler,
|
|
24541
24462
|
handleNextClick,
|
|
24542
|
-
hideHomeButton,
|
|
24543
|
-
hideBackButton,
|
|
24463
|
+
hideHomeButton: isFirstStep,
|
|
24464
|
+
hideBackButton: isFinalStep,
|
|
24544
24465
|
nextButtonLabel,
|
|
24545
24466
|
gotoFormByFormIndex,
|
|
24546
24467
|
activeForm,
|
|
@@ -24608,13 +24529,13 @@ const useUnifyLoadingStatus = (setParentLoadingStatus, ...childLoadingStatuses)
|
|
|
24608
24529
|
setParentLoadingStatus(loadingStatus);
|
|
24609
24530
|
}, [...childLoadingStatuses]);
|
|
24610
24531
|
};
|
|
24611
|
-
const logger$
|
|
24532
|
+
const logger$v = createLogger("useScenarioConfiguration");
|
|
24612
24533
|
const useScenarioConfiguration = ({
|
|
24613
24534
|
getConfigurationData,
|
|
24614
24535
|
getPayoutAccountFormatData,
|
|
24615
24536
|
parseConfiguration: parseConfiguration2,
|
|
24616
24537
|
country,
|
|
24617
|
-
|
|
24538
|
+
instantVerificationAvailable,
|
|
24618
24539
|
setLoadingStatus,
|
|
24619
24540
|
existingBankAccountFormat
|
|
24620
24541
|
}) => {
|
|
@@ -24631,12 +24552,12 @@ const useScenarioConfiguration = ({
|
|
|
24631
24552
|
const response = await getConfigurationData();
|
|
24632
24553
|
setConfigurationResponse(response);
|
|
24633
24554
|
} catch (err) {
|
|
24634
|
-
logger$
|
|
24555
|
+
logger$v.warn("WARNING: Configuration request failed - error:", err);
|
|
24635
24556
|
} finally {
|
|
24636
24557
|
setConfigurationLoadingStatus("success");
|
|
24637
24558
|
}
|
|
24638
24559
|
};
|
|
24639
|
-
makeConfigCallAndSave().catch(logger$
|
|
24560
|
+
makeConfigCallAndSave().catch(logger$v.error);
|
|
24640
24561
|
}, [getConfigurationData, setConfigurationLoadingStatus]);
|
|
24641
24562
|
useEffect(() => {
|
|
24642
24563
|
if (!getPayoutAccountFormatData) return;
|
|
@@ -24655,12 +24576,12 @@ const useScenarioConfiguration = ({
|
|
|
24655
24576
|
const defaultAccountFormat = defaultPayoutAccountFormat[country] ?? allowedBankAccountFormats[0];
|
|
24656
24577
|
setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
|
|
24657
24578
|
} catch (err) {
|
|
24658
|
-
logger$
|
|
24579
|
+
logger$v.warn("WARNING: Payout format request failed - error:", err);
|
|
24659
24580
|
} finally {
|
|
24660
24581
|
setpayoutFormatLoadingStatus("success");
|
|
24661
24582
|
}
|
|
24662
24583
|
};
|
|
24663
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
24584
|
+
makePayoutFormatCallAndSave().catch(logger$v.error);
|
|
24664
24585
|
}, [
|
|
24665
24586
|
country,
|
|
24666
24587
|
setAccountFormat,
|
|
@@ -24670,14 +24591,14 @@ const useScenarioConfiguration = ({
|
|
|
24670
24591
|
]);
|
|
24671
24592
|
const { fieldConfigurations, requiredFields } = useMemo(() => {
|
|
24672
24593
|
if (!configurationResponse) return {};
|
|
24673
|
-
const { matchingScenario
|
|
24594
|
+
const { matchingScenario } = configurationResponse;
|
|
24674
24595
|
const payoutRequiredFields = accountFormatResponse && accountFormat ? accountFormatResponse[accountFormat] : void 0;
|
|
24675
24596
|
const scenarioConfig = parseConfiguration2(
|
|
24676
24597
|
payoutRequiredFields ? {
|
|
24677
24598
|
matchingScenario,
|
|
24678
24599
|
country,
|
|
24679
24600
|
requiredFields: payoutRequiredFields,
|
|
24680
|
-
bankVerificationAvailable:
|
|
24601
|
+
bankVerificationAvailable: instantVerificationAvailable
|
|
24681
24602
|
} : {
|
|
24682
24603
|
matchingScenario,
|
|
24683
24604
|
country,
|
|
@@ -24695,7 +24616,7 @@ const useScenarioConfiguration = ({
|
|
|
24695
24616
|
configurationResponse,
|
|
24696
24617
|
country,
|
|
24697
24618
|
parseConfiguration2,
|
|
24698
|
-
|
|
24619
|
+
instantVerificationAvailable
|
|
24699
24620
|
]);
|
|
24700
24621
|
return {
|
|
24701
24622
|
requiredFields,
|
|
@@ -24898,7 +24819,8 @@ const countryConfig = {
|
|
|
24898
24819
|
...countryConfig$3,
|
|
24899
24820
|
[CountryCodes.NewZealand]: {
|
|
24900
24821
|
...countryConfig$3[CountryCodes.NewZealand],
|
|
24901
|
-
registrationNumber: { label: "NZBN" }
|
|
24822
|
+
registrationNumber: { label: "NZBN" },
|
|
24823
|
+
exemptedFromRegistrationNumber: { label: "doNotHaveNZBN" }
|
|
24902
24824
|
},
|
|
24903
24825
|
[CountryCodes.Croatia]: {
|
|
24904
24826
|
...countryConfig$3[CountryCodes.Croatia],
|
|
@@ -25321,7 +25243,7 @@ const mapAddressData = (verifiedBusiness) => ({
|
|
|
25321
25243
|
address: verifiedBusiness.street ?? "",
|
|
25322
25244
|
otherAddressInformation: verifiedBusiness.street2 ?? "",
|
|
25323
25245
|
city: verifiedBusiness.city ?? "",
|
|
25324
|
-
postalCode: verifiedBusiness.
|
|
25246
|
+
postalCode: verifiedBusiness.zipCode ?? "",
|
|
25325
25247
|
stateOrProvince: verifiedBusiness.state ?? ""
|
|
25326
25248
|
});
|
|
25327
25249
|
const applyVerifiedBusinessData = (verifiedBusiness, handleChangeFor) => {
|
|
@@ -25467,6 +25389,7 @@ function AdditionalInformationComponent({
|
|
|
25467
25389
|
const { basicInformation } = useGlobalData();
|
|
25468
25390
|
const { updateStateSlice } = useGlobalDataSlice(ADDITIONAL_INFORMATION_FORM_ID);
|
|
25469
25391
|
const { i18n } = useI18nContext();
|
|
25392
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
25470
25393
|
const showVerified = !!verifiedBusiness;
|
|
25471
25394
|
const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
|
|
25472
25395
|
const addressSchema = getAddressSchemaForCountry(country).filter(
|
|
@@ -25574,7 +25497,8 @@ function AdditionalInformationComponent({
|
|
|
25574
25497
|
defaultFieldConfig$9[country],
|
|
25575
25498
|
{
|
|
25576
25499
|
companyType,
|
|
25577
|
-
registrationNumberType
|
|
25500
|
+
registrationNumberType,
|
|
25501
|
+
isExperimentEnabled
|
|
25578
25502
|
},
|
|
25579
25503
|
defaultFieldMetadata$9
|
|
25580
25504
|
),
|
|
@@ -25646,7 +25570,7 @@ function AdditionalInformationComponent({
|
|
|
25646
25570
|
registrationAddress: {
|
|
25647
25571
|
address: verifiedBusiness.street,
|
|
25648
25572
|
city: verifiedBusiness.city,
|
|
25649
|
-
postalCode: verifiedBusiness.
|
|
25573
|
+
postalCode: verifiedBusiness.zipCode,
|
|
25650
25574
|
stateOrProvince: verifiedBusiness.state,
|
|
25651
25575
|
country: verifiedBusiness.country
|
|
25652
25576
|
}
|
|
@@ -26194,7 +26118,7 @@ function BusinessInformationCard({
|
|
|
26194
26118
|
}
|
|
26195
26119
|
);
|
|
26196
26120
|
}
|
|
26197
|
-
const logger$
|
|
26121
|
+
const logger$u = createLogger("BusinessSelection");
|
|
26198
26122
|
function BusinessSelectionComponent({
|
|
26199
26123
|
showCompanyStructure,
|
|
26200
26124
|
searching,
|
|
@@ -26246,7 +26170,7 @@ function BusinessSelectionComponent({
|
|
|
26246
26170
|
setCurrentBusinessSelection(businessData);
|
|
26247
26171
|
}
|
|
26248
26172
|
} catch (e) {
|
|
26249
|
-
logger$
|
|
26173
|
+
logger$u.error(e);
|
|
26250
26174
|
}
|
|
26251
26175
|
},
|
|
26252
26176
|
[basicInformation == null ? void 0 : basicInformation.stateOrProvince, fetchBusinessData, fetching, selectedBusinessId]
|
|
@@ -26260,7 +26184,7 @@ function BusinessSelectionComponent({
|
|
|
26260
26184
|
handleNextClick == null ? void 0 : handleNextClick();
|
|
26261
26185
|
}
|
|
26262
26186
|
} catch (e) {
|
|
26263
|
-
logger$
|
|
26187
|
+
logger$u.error(e);
|
|
26264
26188
|
}
|
|
26265
26189
|
},
|
|
26266
26190
|
[currentTin, handleNextClick, handleBusinessVerification]
|
|
@@ -26447,7 +26371,7 @@ function BasicInformationComponent({
|
|
|
26447
26371
|
const { i18n } = useI18nContext();
|
|
26448
26372
|
const { isSettingEnabled } = useSettingsContext();
|
|
26449
26373
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
26450
|
-
const allowedCountries =
|
|
26374
|
+
const { allowedCountries } = useCoreContext();
|
|
26451
26375
|
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
26452
26376
|
const formDescription = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-header__description", children: [
|
|
26453
26377
|
description,
|
|
@@ -27370,7 +27294,7 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
|
|
|
27370
27294
|
DecisionMakerType.SIGNATORY,
|
|
27371
27295
|
DecisionMakerType.CONTROLLING_PERSON
|
|
27372
27296
|
];
|
|
27373
|
-
const rules$
|
|
27297
|
+
const rules$2 = ({
|
|
27374
27298
|
data,
|
|
27375
27299
|
country,
|
|
27376
27300
|
taskType,
|
|
@@ -27845,7 +27769,7 @@ const useExpiryThreshold = (expiry) => {
|
|
|
27845
27769
|
return { expiryStatus: "notYetCloseToExpiry", secondsUntilExpiry: void 0 };
|
|
27846
27770
|
};
|
|
27847
27771
|
const ExpiryContext = createContext(false);
|
|
27848
|
-
const logger$
|
|
27772
|
+
const logger$t = createLogger("ExpiryProvider");
|
|
27849
27773
|
const ExpiryProvider = ({
|
|
27850
27774
|
expiry: initialExpiry,
|
|
27851
27775
|
eventEmitter,
|
|
@@ -27874,7 +27798,7 @@ const ExpiryProvider = ({
|
|
|
27874
27798
|
refreshExpiry().then((newExpiry) => {
|
|
27875
27799
|
setExpiry(newExpiry);
|
|
27876
27800
|
setModalDismissed(false);
|
|
27877
|
-
}).catch(logger$
|
|
27801
|
+
}).catch(logger$t.error);
|
|
27878
27802
|
}
|
|
27879
27803
|
}
|
|
27880
27804
|
),
|
|
@@ -27896,7 +27820,7 @@ const ExpiryProvider = ({
|
|
|
27896
27820
|
return /* @__PURE__ */ jsx(ExpiryContext.Provider, { value: expiryStatus === "expired", children });
|
|
27897
27821
|
};
|
|
27898
27822
|
const useHasExpired = () => useContext(ExpiryContext);
|
|
27899
|
-
const logger$
|
|
27823
|
+
const logger$s = createLogger("FormRouterContextProvider");
|
|
27900
27824
|
function FormRouterContextProvider({
|
|
27901
27825
|
children,
|
|
27902
27826
|
forms,
|
|
@@ -27919,7 +27843,7 @@ function FormRouterContextProvider({
|
|
|
27919
27843
|
if (formIndex > -1) {
|
|
27920
27844
|
setFormIndex(formIndex);
|
|
27921
27845
|
} else {
|
|
27922
|
-
logger$
|
|
27846
|
+
logger$s.error("No form was found to have that field so form navigation failed.");
|
|
27923
27847
|
}
|
|
27924
27848
|
}
|
|
27925
27849
|
}),
|
|
@@ -29617,7 +29541,7 @@ function CompanyDropinComponent({
|
|
|
29617
29541
|
}
|
|
29618
29542
|
const IgnoreLocalStorageContext = createContext(false);
|
|
29619
29543
|
const useIgnoreLocalStorage = () => useContext(IgnoreLocalStorageContext);
|
|
29620
|
-
const logger$
|
|
29544
|
+
const logger$r = createLogger("useLocalStorage");
|
|
29621
29545
|
const useLocalStorage = (key, defaultValue, options) => {
|
|
29622
29546
|
const { serializer, parser, syncData } = useMemo(
|
|
29623
29547
|
() => ({
|
|
@@ -29637,7 +29561,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29637
29561
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
29638
29562
|
return res;
|
|
29639
29563
|
} catch (err) {
|
|
29640
|
-
logger$
|
|
29564
|
+
logger$r.error(err);
|
|
29641
29565
|
return defaultValue;
|
|
29642
29566
|
}
|
|
29643
29567
|
});
|
|
@@ -29672,7 +29596,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29672
29596
|
try {
|
|
29673
29597
|
updateLocalStorage();
|
|
29674
29598
|
} catch (err) {
|
|
29675
|
-
logger$
|
|
29599
|
+
logger$r.error(err);
|
|
29676
29600
|
}
|
|
29677
29601
|
}, [value, ignoreLocalStorage]);
|
|
29678
29602
|
useEffect(() => {
|
|
@@ -29685,7 +29609,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29685
29609
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
29686
29610
|
}
|
|
29687
29611
|
} catch (err) {
|
|
29688
|
-
logger$
|
|
29612
|
+
logger$r.error(err);
|
|
29689
29613
|
}
|
|
29690
29614
|
};
|
|
29691
29615
|
if (ignoreLocalStorage) return;
|
|
@@ -29869,7 +29793,7 @@ const useSingpassMyInfoLogin = ({
|
|
|
29869
29793
|
trustedEntityAssociations
|
|
29870
29794
|
};
|
|
29871
29795
|
};
|
|
29872
|
-
const logger$
|
|
29796
|
+
const logger$q = createLogger("useAssociatedLegalArrangement");
|
|
29873
29797
|
function useAssociatedLegalArrangement({
|
|
29874
29798
|
rootLegalEntity,
|
|
29875
29799
|
getLegalEntity: getLegalEntity2
|
|
@@ -29885,7 +29809,7 @@ function useAssociatedLegalArrangement({
|
|
|
29885
29809
|
(entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST
|
|
29886
29810
|
);
|
|
29887
29811
|
if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
|
|
29888
|
-
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$
|
|
29812
|
+
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$q.error);
|
|
29889
29813
|
}
|
|
29890
29814
|
}, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
|
|
29891
29815
|
useEffect(() => {
|
|
@@ -29935,7 +29859,7 @@ const useCanSeeEntitySelection = (legalEntityId) => {
|
|
|
29935
29859
|
setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
|
|
29936
29860
|
};
|
|
29937
29861
|
};
|
|
29938
|
-
const logger$
|
|
29862
|
+
const logger$p = createLogger("useExemptSettlor");
|
|
29939
29863
|
const useExemptSettlor = ({
|
|
29940
29864
|
trust,
|
|
29941
29865
|
handleGetLegalEntity
|
|
@@ -29953,7 +29877,7 @@ const useExemptSettlor = ({
|
|
|
29953
29877
|
);
|
|
29954
29878
|
useEffect(() => {
|
|
29955
29879
|
if (!(trust == null ? void 0 : trust.trust)) return;
|
|
29956
|
-
updateExemptSettlor(trust).catch(logger$
|
|
29880
|
+
updateExemptSettlor(trust).catch(logger$p.error);
|
|
29957
29881
|
}, [trust, updateExemptSettlor]);
|
|
29958
29882
|
return exemptSettlor;
|
|
29959
29883
|
};
|
|
@@ -32010,6 +31934,14 @@ const SingpassSelection = (props) => {
|
|
|
32010
31934
|
)
|
|
32011
31935
|
] }) });
|
|
32012
31936
|
};
|
|
31937
|
+
const useSetting = (settingName) => {
|
|
31938
|
+
const context = useContext(SettingsContext);
|
|
31939
|
+
if (context === void 0) {
|
|
31940
|
+
throw new Error("useSetting must be used within a SettingsProvider");
|
|
31941
|
+
}
|
|
31942
|
+
const { getSetting } = context;
|
|
31943
|
+
return getSetting(settingName);
|
|
31944
|
+
};
|
|
32013
31945
|
const businessTypeMapping = {
|
|
32014
31946
|
myName: {
|
|
32015
31947
|
[LegalEntityType.INDIVIDUAL]: "individual"
|
|
@@ -33052,7 +32984,7 @@ function IndividualDropinComponent({
|
|
|
33052
32984
|
country
|
|
33053
32985
|
});
|
|
33054
32986
|
const fieldsFromCustomRules = useMemo(
|
|
33055
|
-
() => rules$
|
|
32987
|
+
() => rules$2({
|
|
33056
32988
|
data,
|
|
33057
32989
|
country,
|
|
33058
32990
|
taskType,
|
|
@@ -33517,7 +33449,7 @@ function IndividualDropinComponent({
|
|
|
33517
33449
|
}
|
|
33518
33450
|
);
|
|
33519
33451
|
}
|
|
33520
|
-
const logger$
|
|
33452
|
+
const logger$o = createLogger("useBankConfigurationHandler");
|
|
33521
33453
|
const useBankConfigurationHandlers = ({
|
|
33522
33454
|
handleGetBankVerificationVendors,
|
|
33523
33455
|
bankAccountCountry,
|
|
@@ -33535,7 +33467,7 @@ const useBankConfigurationHandlers = ({
|
|
|
33535
33467
|
const bankVerificationVendorsResponse = handleGetBankVerificationVendors ? await handleGetBankVerificationVendors(bankAccountCountry) : [];
|
|
33536
33468
|
setProvider(bankVerificationVendorsResponse == null ? void 0 : bankVerificationVendorsResponse[0]);
|
|
33537
33469
|
})().catch(() => {
|
|
33538
|
-
logger$
|
|
33470
|
+
logger$o.error();
|
|
33539
33471
|
setProvider(void 0);
|
|
33540
33472
|
}).finally(() => {
|
|
33541
33473
|
setLoadingStatus("success");
|
|
@@ -33548,17 +33480,14 @@ const useBankConfigurationHandlers = ({
|
|
|
33548
33480
|
handleGetBankVerificationVendors,
|
|
33549
33481
|
bankAccountCountry
|
|
33550
33482
|
]);
|
|
33551
|
-
const getConfigurationData = useCallback(
|
|
33552
|
-
|
|
33483
|
+
const getConfigurationData = useCallback(
|
|
33484
|
+
() => getConfiguration2({
|
|
33553
33485
|
legalEntityType,
|
|
33554
33486
|
capabilities,
|
|
33555
33487
|
country: bankAccountCountry
|
|
33556
|
-
})
|
|
33557
|
-
|
|
33558
|
-
|
|
33559
|
-
provider
|
|
33560
|
-
};
|
|
33561
|
-
}, [getConfiguration2, legalEntityType, bankAccountCountry, capabilities, provider]);
|
|
33488
|
+
}),
|
|
33489
|
+
[getConfiguration2, legalEntityType, bankAccountCountry, capabilities]
|
|
33490
|
+
);
|
|
33562
33491
|
return {
|
|
33563
33492
|
getConfigurationData,
|
|
33564
33493
|
provider
|
|
@@ -33572,6 +33501,43 @@ const getAccountFormatsForCountry = async (country) => {
|
|
|
33572
33501
|
}
|
|
33573
33502
|
return (await importForCountry()).default;
|
|
33574
33503
|
};
|
|
33504
|
+
const rules$1 = ({ data, requiredFields }) => ({
|
|
33505
|
+
whenUsingManualVerification: () => {
|
|
33506
|
+
var _a;
|
|
33507
|
+
if (!data.payoutVerificationMethod) return;
|
|
33508
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
33509
|
+
return "REQUIRED";
|
|
33510
|
+
}
|
|
33511
|
+
},
|
|
33512
|
+
whenUsingInstantVerification: () => {
|
|
33513
|
+
var _a;
|
|
33514
|
+
if (!data.payoutVerificationMethod) {
|
|
33515
|
+
return "REQUIRED";
|
|
33516
|
+
}
|
|
33517
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
33518
|
+
return "REQUIRED";
|
|
33519
|
+
}
|
|
33520
|
+
},
|
|
33521
|
+
verifiedBankAccountNumber: () => {
|
|
33522
|
+
var _a;
|
|
33523
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
33524
|
+
return "REQUIRED";
|
|
33525
|
+
}
|
|
33526
|
+
},
|
|
33527
|
+
bankStatementRequirement: () => {
|
|
33528
|
+
var _a;
|
|
33529
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
33530
|
+
return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
|
|
33531
|
+
}
|
|
33532
|
+
},
|
|
33533
|
+
// "bankStatement description" field is always "optional" and it's coupled with bank statement document.
|
|
33534
|
+
bankStatementDescription: () => {
|
|
33535
|
+
var _a;
|
|
33536
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
|
|
33537
|
+
return "OPTIONAL";
|
|
33538
|
+
}
|
|
33539
|
+
}
|
|
33540
|
+
});
|
|
33575
33541
|
const labels = () => ({
|
|
33576
33542
|
verifiedAccountHolder: () => "accountHolder",
|
|
33577
33543
|
verifiedBankCountry: () => "bankCountry",
|
|
@@ -33719,17 +33685,6 @@ function PayoutDetailsDropinComponent({
|
|
|
33719
33685
|
});
|
|
33720
33686
|
onChange == null ? void 0 : onChange(currentState);
|
|
33721
33687
|
}, [bankAccountCountry, currentState, onChange]);
|
|
33722
|
-
useEffect(() => {
|
|
33723
|
-
var _a2, _b2;
|
|
33724
|
-
setData({
|
|
33725
|
-
...currentState.data,
|
|
33726
|
-
payoutAccountDetails: {
|
|
33727
|
-
...(_a2 = currentState.data) == null ? void 0 : _a2.payoutAccountDetails,
|
|
33728
|
-
currency: (_b2 = currencyByCountry[bankAccountCountry]) == null ? void 0 : _b2[0]
|
|
33729
|
-
}
|
|
33730
|
-
});
|
|
33731
|
-
onChange == null ? void 0 : onChange(currentState);
|
|
33732
|
-
}, [bankAccountCountry, currentState, onChange]);
|
|
33733
33688
|
const { getConfigurationData, provider } = useBankConfigurationHandlers({
|
|
33734
33689
|
isEmbeddedDropin,
|
|
33735
33690
|
handleGetBankVerificationVendors,
|
|
@@ -33741,6 +33696,10 @@ function PayoutDetailsDropinComponent({
|
|
|
33741
33696
|
useFreshProviderRedirectUrl,
|
|
33742
33697
|
setUseFreshProviderRedirectUrl
|
|
33743
33698
|
});
|
|
33699
|
+
const instantVerificationAvailable = useMemo(
|
|
33700
|
+
() => Boolean(instantVerificationEnabled && (provider == null ? void 0 : provider.redirectUrl)),
|
|
33701
|
+
[instantVerificationEnabled, provider == null ? void 0 : provider.redirectUrl]
|
|
33702
|
+
);
|
|
33744
33703
|
const getPayoutAccountFormatData = useCallback(
|
|
33745
33704
|
async () => getAccountFormatsForCountry(bankAccountCountry),
|
|
33746
33705
|
[bankAccountCountry]
|
|
@@ -33749,13 +33708,13 @@ function PayoutDetailsDropinComponent({
|
|
|
33749
33708
|
parseConfiguration: parseConfiguration$3,
|
|
33750
33709
|
getConfigurationData,
|
|
33751
33710
|
getPayoutAccountFormatData,
|
|
33752
|
-
|
|
33711
|
+
instantVerificationAvailable,
|
|
33753
33712
|
setLoadingStatus: setConfigurationLoadingStatus,
|
|
33754
33713
|
country: bankAccountCountry,
|
|
33755
33714
|
existingBankAccountFormat
|
|
33756
33715
|
});
|
|
33757
33716
|
const fieldsFromCustomRules = useMemo(
|
|
33758
|
-
() => rules$
|
|
33717
|
+
() => rules$1({
|
|
33759
33718
|
data,
|
|
33760
33719
|
country: bankAccountCountry,
|
|
33761
33720
|
taskType,
|
|
@@ -33773,10 +33732,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33773
33732
|
var _a2;
|
|
33774
33733
|
return getAppropriatePayoutDetailsSteps(
|
|
33775
33734
|
Boolean((_a2 = prefilledData == null ? void 0 : prefilledData.payoutAccountDetails) == null ? void 0 : _a2.transferInstrumentId),
|
|
33776
|
-
|
|
33777
|
-
provider,
|
|
33778
|
-
verificationVendorsCallback: handleGetBankVerificationVendors
|
|
33779
|
-
}),
|
|
33735
|
+
instantVerificationAvailable,
|
|
33780
33736
|
isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
|
|
33781
33737
|
showWidgetInVerificationMethodStep
|
|
33782
33738
|
);
|
|
@@ -34058,8 +34014,7 @@ function PayoutDetailsDropinComponent({
|
|
|
34058
34014
|
associatedLegalArrangement,
|
|
34059
34015
|
provider,
|
|
34060
34016
|
bankVendorsLoadingStatus,
|
|
34061
|
-
|
|
34062
|
-
instantVerificationEnabled,
|
|
34017
|
+
instantVerificationAvailable,
|
|
34063
34018
|
refreshLegalEntity,
|
|
34064
34019
|
shouldValidate,
|
|
34065
34020
|
createTrustedTransferInstrument: createTrustedTransferInstrumentHandler,
|
|
@@ -35058,7 +35013,7 @@ const serviceAgreementValidationRules = {
|
|
|
35058
35013
|
errorMessage: "fieldIsRequired"
|
|
35059
35014
|
}
|
|
35060
35015
|
};
|
|
35061
|
-
const logger$
|
|
35016
|
+
const logger$n = createLogger("useServiceAgreement");
|
|
35062
35017
|
const FALLBACK_LANGUAGE_CODE$1 = "en";
|
|
35063
35018
|
const useServiceAgreement = ({
|
|
35064
35019
|
handleGetServiceAgreement,
|
|
@@ -35088,7 +35043,7 @@ const useServiceAgreement = ({
|
|
|
35088
35043
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
35089
35044
|
setServiceAgreement({ id, contract });
|
|
35090
35045
|
};
|
|
35091
|
-
requestAcceptedServiceAgreement().catch(logger$
|
|
35046
|
+
requestAcceptedServiceAgreement().catch(logger$n.error).finally(() => setLoading("success"));
|
|
35092
35047
|
}, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
|
|
35093
35048
|
useEffect(() => {
|
|
35094
35049
|
const requestServiceAgreement = async () => {
|
|
@@ -35103,7 +35058,7 @@ const useServiceAgreement = ({
|
|
|
35103
35058
|
}
|
|
35104
35059
|
);
|
|
35105
35060
|
if (!document2) {
|
|
35106
|
-
logger$
|
|
35061
|
+
logger$n.log('"document" field was missing in response');
|
|
35107
35062
|
return;
|
|
35108
35063
|
}
|
|
35109
35064
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
@@ -35118,7 +35073,7 @@ const useServiceAgreement = ({
|
|
|
35118
35073
|
throw err;
|
|
35119
35074
|
}
|
|
35120
35075
|
};
|
|
35121
|
-
requestServiceAgreement().catch(logger$
|
|
35076
|
+
requestServiceAgreement().catch(logger$n.error);
|
|
35122
35077
|
}, [
|
|
35123
35078
|
handleGetServiceAgreement,
|
|
35124
35079
|
handleServiceAgreementIsNotAvailableInThatLanguage,
|
|
@@ -35142,7 +35097,7 @@ const serviceAgreementTypesTranslationMapping = {
|
|
|
35142
35097
|
adyenPccr: "pccr",
|
|
35143
35098
|
adyenChargeCard: "chargeCardUserAgreement"
|
|
35144
35099
|
};
|
|
35145
|
-
const logger$
|
|
35100
|
+
const logger$m = createLogger("ServiceAgreementDropinComponent");
|
|
35146
35101
|
const FALLBACK_LANGUAGE_CODE = "en";
|
|
35147
35102
|
function ServiceAgreementDropinComponent({
|
|
35148
35103
|
legalEntityResponse,
|
|
@@ -35326,7 +35281,7 @@ function ServiceAgreementDropinComponent({
|
|
|
35326
35281
|
await requestAndDownload(i18n.languageCode);
|
|
35327
35282
|
} catch (e) {
|
|
35328
35283
|
if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
|
|
35329
|
-
await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$
|
|
35284
|
+
await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$m.error);
|
|
35330
35285
|
return;
|
|
35331
35286
|
}
|
|
35332
35287
|
showToast({
|
|
@@ -36341,7 +36296,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
|
36341
36296
|
return hasOwnEntityAssocation || !!hasOrganizationType;
|
|
36342
36297
|
};
|
|
36343
36298
|
const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
36344
|
-
const logger$
|
|
36299
|
+
const logger$l = createLogger("DropinComposerComponent");
|
|
36345
36300
|
const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country) => country === CountryCodes.Australia && enabled;
|
|
36346
36301
|
function DropinComposerComponent({
|
|
36347
36302
|
capabilities,
|
|
@@ -36448,7 +36403,7 @@ function DropinComposerComponent({
|
|
|
36448
36403
|
setPciStatus(response);
|
|
36449
36404
|
return response;
|
|
36450
36405
|
} catch (e) {
|
|
36451
|
-
logger$
|
|
36406
|
+
logger$l.warn(i18n.get("failedToGetPciStatus"));
|
|
36452
36407
|
}
|
|
36453
36408
|
}
|
|
36454
36409
|
return void 0;
|
|
@@ -36476,7 +36431,7 @@ function DropinComposerComponent({
|
|
|
36476
36431
|
}, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
|
|
36477
36432
|
useEffect(() => {
|
|
36478
36433
|
if (!tasks.includes(TaskTypes.PCI_DSS)) return;
|
|
36479
|
-
getPciTemplate2().catch(logger$
|
|
36434
|
+
getPciTemplate2().catch(logger$l.error);
|
|
36480
36435
|
}, [getPciTemplate2, tasks]);
|
|
36481
36436
|
const addFetchedAcceptedByName = async (acceptanceInfo) => {
|
|
36482
36437
|
try {
|
|
@@ -36486,7 +36441,7 @@ function DropinComposerComponent({
|
|
|
36486
36441
|
acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
|
|
36487
36442
|
};
|
|
36488
36443
|
} catch (e) {
|
|
36489
|
-
logger$
|
|
36444
|
+
logger$l.warn(i18n.get("failedToFetchAcceptedByName"));
|
|
36490
36445
|
return {
|
|
36491
36446
|
...acceptanceInfo,
|
|
36492
36447
|
acceptedByName: null
|
|
@@ -36500,7 +36455,7 @@ function DropinComposerComponent({
|
|
|
36500
36455
|
const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
|
|
36501
36456
|
setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
|
|
36502
36457
|
} catch (e) {
|
|
36503
|
-
logger$
|
|
36458
|
+
logger$l.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
36504
36459
|
}
|
|
36505
36460
|
}
|
|
36506
36461
|
};
|
|
@@ -36510,7 +36465,7 @@ function DropinComposerComponent({
|
|
|
36510
36465
|
const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
|
|
36511
36466
|
setServiceAgreementTypes(response.termsOfServiceTypes);
|
|
36512
36467
|
} catch (e) {
|
|
36513
|
-
logger$
|
|
36468
|
+
logger$l.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
36514
36469
|
}
|
|
36515
36470
|
}
|
|
36516
36471
|
};
|
|
@@ -36540,7 +36495,7 @@ function DropinComposerComponent({
|
|
|
36540
36495
|
try {
|
|
36541
36496
|
return await args.handleGetLegalEntity(rootLegalEntity.id);
|
|
36542
36497
|
} catch (e) {
|
|
36543
|
-
logger$
|
|
36498
|
+
logger$l.warn("Failed to fetch legal entity details", e);
|
|
36544
36499
|
}
|
|
36545
36500
|
}
|
|
36546
36501
|
return void 0;
|
|
@@ -36596,7 +36551,7 @@ function DropinComposerComponent({
|
|
|
36596
36551
|
await refreshAssociatedLegalArrangement();
|
|
36597
36552
|
showToast({ type: "success", label: i18n.get("successFullyRemovedTrustMember") });
|
|
36598
36553
|
} catch (err) {
|
|
36599
|
-
logger$
|
|
36554
|
+
logger$l.error(`Failed to delete trust member`, err);
|
|
36600
36555
|
showToast({ type: "error", label: i18n.get("failedToRemoveTrustMember") });
|
|
36601
36556
|
}
|
|
36602
36557
|
};
|
|
@@ -36663,14 +36618,14 @@ function DropinComposerComponent({
|
|
|
36663
36618
|
}
|
|
36664
36619
|
break;
|
|
36665
36620
|
default:
|
|
36666
|
-
logger$
|
|
36621
|
+
logger$l.warn(
|
|
36667
36622
|
`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`
|
|
36668
36623
|
);
|
|
36669
36624
|
}
|
|
36670
36625
|
showToast({ label: i18n.get("successfullyUpdatedDetails"), type: "success" });
|
|
36671
36626
|
await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
|
|
36672
36627
|
} catch (err) {
|
|
36673
|
-
logger$
|
|
36628
|
+
logger$l.error(err);
|
|
36674
36629
|
showToast({ label: i18n.get("failedToUpdateDetails"), type: "error" });
|
|
36675
36630
|
}
|
|
36676
36631
|
};
|
|
@@ -36682,7 +36637,7 @@ function DropinComposerComponent({
|
|
|
36682
36637
|
singpassTabRef.current = window.open(authUrl, "_blank");
|
|
36683
36638
|
singpassTabRef.current.focus();
|
|
36684
36639
|
} catch (e) {
|
|
36685
|
-
logger$
|
|
36640
|
+
logger$l.error(e);
|
|
36686
36641
|
handleSingpassMyInfoLoginFailure(e);
|
|
36687
36642
|
}
|
|
36688
36643
|
}
|
|
@@ -36873,7 +36828,7 @@ function DropinComposerComponent({
|
|
|
36873
36828
|
}
|
|
36874
36829
|
};
|
|
36875
36830
|
setIsLoadingConfiguration(true);
|
|
36876
|
-
fetchConfiguration().catch(logger$
|
|
36831
|
+
fetchConfiguration().catch(logger$l.error).finally(() => {
|
|
36877
36832
|
setIsLoadingConfiguration(false);
|
|
36878
36833
|
onLoad();
|
|
36879
36834
|
});
|
|
@@ -36910,7 +36865,7 @@ function DropinComposerComponent({
|
|
|
36910
36865
|
singpassTabRef.current = window.open(authUrl);
|
|
36911
36866
|
singpassTabRef.current.focus();
|
|
36912
36867
|
} catch (e) {
|
|
36913
|
-
logger$
|
|
36868
|
+
logger$l.error(e);
|
|
36914
36869
|
handleSingpassMyInfoLoginFailure(e);
|
|
36915
36870
|
}
|
|
36916
36871
|
},
|
|
@@ -38092,7 +38047,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
38092
38047
|
};
|
|
38093
38048
|
}, [base, rootLegalEntityId]);
|
|
38094
38049
|
};
|
|
38095
|
-
const logger$
|
|
38050
|
+
const logger$k = createLogger("AcceptTermsOfService");
|
|
38096
38051
|
function AcceptTermsOfServiceComponent({
|
|
38097
38052
|
legalEntityId,
|
|
38098
38053
|
modalView,
|
|
@@ -38134,13 +38089,13 @@ function AcceptTermsOfServiceComponent({
|
|
|
38134
38089
|
onClose == null ? void 0 : onClose();
|
|
38135
38090
|
};
|
|
38136
38091
|
const fetchLegalEntity = useCallback(async () => {
|
|
38137
|
-
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$
|
|
38092
|
+
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$k.error);
|
|
38138
38093
|
}, [getLegalEntity2, legalEntityId]);
|
|
38139
38094
|
const fetchUnsigned = useCallback(async () => {
|
|
38140
|
-
await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$
|
|
38095
|
+
await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$k.error);
|
|
38141
38096
|
}, [getServiceAgreementStatus2, legalEntityId]);
|
|
38142
38097
|
const fetchSigned = useCallback(async () => {
|
|
38143
|
-
await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$
|
|
38098
|
+
await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$k.error);
|
|
38144
38099
|
}, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
|
|
38145
38100
|
const handleSign = useCallback(
|
|
38146
38101
|
// @ts-ignore-error:next-line ts does not infer type correctly
|
|
@@ -38174,7 +38129,7 @@ function AcceptTermsOfServiceComponent({
|
|
|
38174
38129
|
(async () => {
|
|
38175
38130
|
setIsLoading(true);
|
|
38176
38131
|
await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
|
|
38177
|
-
})().catch(logger$
|
|
38132
|
+
})().catch(logger$k.error).finally(() => {
|
|
38178
38133
|
setIsLoading(false);
|
|
38179
38134
|
});
|
|
38180
38135
|
}, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
|
|
@@ -38201,7 +38156,7 @@ function AcceptTermsOfServiceComponent({
|
|
|
38201
38156
|
}
|
|
38202
38157
|
);
|
|
38203
38158
|
}
|
|
38204
|
-
const logger$
|
|
38159
|
+
const logger$j = createLogger("CreateIndividualComponent");
|
|
38205
38160
|
function CreateIndividualComponent({
|
|
38206
38161
|
parentLegalEntityId,
|
|
38207
38162
|
legalEntityId,
|
|
@@ -38252,11 +38207,11 @@ function CreateIndividualComponent({
|
|
|
38252
38207
|
setParentLegalEntity(parentEntity);
|
|
38253
38208
|
setLegalEntity(entity);
|
|
38254
38209
|
} catch (error) {
|
|
38255
|
-
logger$
|
|
38210
|
+
logger$j.error(error);
|
|
38256
38211
|
}
|
|
38257
38212
|
}, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
|
|
38258
38213
|
useEffect(() => {
|
|
38259
|
-
fetchLegalEntity().catch(logger$
|
|
38214
|
+
fetchLegalEntity().catch(logger$j.error).finally(() => {
|
|
38260
38215
|
setIsLoading(false);
|
|
38261
38216
|
});
|
|
38262
38217
|
}, [fetchLegalEntity]);
|
|
@@ -38276,7 +38231,7 @@ function CreateIndividualComponent({
|
|
|
38276
38231
|
setIsAddressEnabled(res.statuses.address.enabled);
|
|
38277
38232
|
}, [country, getProviderStatus2]);
|
|
38278
38233
|
useEffect(() => {
|
|
38279
|
-
fetchProviderStatus().catch(logger$
|
|
38234
|
+
fetchProviderStatus().catch(logger$j.error);
|
|
38280
38235
|
}, [fetchProviderStatus]);
|
|
38281
38236
|
return isLoading || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
|
|
38282
38237
|
IndividualDropinComponent,
|
|
@@ -38301,7 +38256,7 @@ function CreateIndividualComponent({
|
|
|
38301
38256
|
}
|
|
38302
38257
|
);
|
|
38303
38258
|
}
|
|
38304
|
-
const logger$
|
|
38259
|
+
const logger$i = createLogger("CreateTransferInstrumentComponent");
|
|
38305
38260
|
function CreateTransferInstrumentComponent({
|
|
38306
38261
|
legalEntityId,
|
|
38307
38262
|
transferInstrumentId,
|
|
@@ -38342,7 +38297,7 @@ function CreateTransferInstrumentComponent({
|
|
|
38342
38297
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
38343
38298
|
setTransferInstrument(ti);
|
|
38344
38299
|
}
|
|
38345
|
-
})().catch(logger$
|
|
38300
|
+
})().catch(logger$i.error).finally(() => {
|
|
38346
38301
|
setLoadingStatus("success");
|
|
38347
38302
|
});
|
|
38348
38303
|
}, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
|
|
@@ -38892,7 +38847,7 @@ function ManageTransferInstrumentOverviewItem({
|
|
|
38892
38847
|
)
|
|
38893
38848
|
] });
|
|
38894
38849
|
}
|
|
38895
|
-
const logger$
|
|
38850
|
+
const logger$h = createLogger("ManageTransferInstrumentOverview");
|
|
38896
38851
|
function ManageTransferInstrumentOverview({
|
|
38897
38852
|
transferInstrumentReferences,
|
|
38898
38853
|
legalEntityId,
|
|
@@ -38911,7 +38866,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38911
38866
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
38912
38867
|
setTransferInstrumentsMap({ [transferInstrumentId]: ti, ...transferInstrumentsMap });
|
|
38913
38868
|
} catch (e) {
|
|
38914
|
-
logger$
|
|
38869
|
+
logger$h.error(e);
|
|
38915
38870
|
}
|
|
38916
38871
|
};
|
|
38917
38872
|
const onRemoveTransferInstrument = async (transferInstrumentId) => {
|
|
@@ -38920,7 +38875,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38920
38875
|
onRemove(transferInstrumentId);
|
|
38921
38876
|
} catch (e) {
|
|
38922
38877
|
showToast({ label: i18n.get("thereWasAnErrorTryAgain"), type: "error" });
|
|
38923
|
-
logger$
|
|
38878
|
+
logger$h.error(e);
|
|
38924
38879
|
}
|
|
38925
38880
|
};
|
|
38926
38881
|
const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => /* @__PURE__ */ jsx(
|
|
@@ -38949,7 +38904,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38949
38904
|
)
|
|
38950
38905
|
] });
|
|
38951
38906
|
}
|
|
38952
|
-
const logger$
|
|
38907
|
+
const logger$g = createLogger("ManageTransferInstrumentComponent");
|
|
38953
38908
|
function ManageTransferInstrumentComponent({
|
|
38954
38909
|
legalEntityId,
|
|
38955
38910
|
onAdd,
|
|
@@ -38977,7 +38932,7 @@ function ManageTransferInstrumentComponent({
|
|
|
38977
38932
|
}, [getTransferInstruments2]);
|
|
38978
38933
|
useEffect(() => {
|
|
38979
38934
|
eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
|
|
38980
|
-
init2().catch(logger$
|
|
38935
|
+
init2().catch(logger$g.error).finally(() => {
|
|
38981
38936
|
setLoadingStatus("success");
|
|
38982
38937
|
});
|
|
38983
38938
|
}, [init2, setLocale, eventEmitter]);
|
|
@@ -38987,7 +38942,7 @@ function ManageTransferInstrumentComponent({
|
|
|
38987
38942
|
}
|
|
38988
38943
|
}, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
|
|
38989
38944
|
const onRemove = (transferInstrumentId) => {
|
|
38990
|
-
refreshTransferInstruments().catch(logger$
|
|
38945
|
+
refreshTransferInstruments().catch(logger$g.error);
|
|
38991
38946
|
onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
|
|
38992
38947
|
};
|
|
38993
38948
|
const render2 = () => {
|
|
@@ -39014,7 +38969,7 @@ function ManageTransferInstrumentComponent({
|
|
|
39014
38969
|
};
|
|
39015
38970
|
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-manage-transfer-instrument", children: render2() });
|
|
39016
38971
|
}
|
|
39017
|
-
const logger$
|
|
38972
|
+
const logger$f = createLogger("OnboardingDropinComponent");
|
|
39018
38973
|
function OnboardingDropinComponent({
|
|
39019
38974
|
legalEntityId,
|
|
39020
38975
|
openBankingPartnerConfigId
|
|
@@ -39075,13 +39030,13 @@ function OnboardingDropinComponent({
|
|
|
39075
39030
|
setLegalEntity(le);
|
|
39076
39031
|
setProviderStatus(providerStatuses);
|
|
39077
39032
|
} catch (error) {
|
|
39078
|
-
logger$
|
|
39033
|
+
logger$f.error(error);
|
|
39079
39034
|
} finally {
|
|
39080
39035
|
setLoadingStatus("success");
|
|
39081
39036
|
}
|
|
39082
39037
|
}, [legalEntityId, getLegalEntity2, getProviderStatus2]);
|
|
39083
39038
|
useEffect(() => {
|
|
39084
|
-
init2().catch(logger$
|
|
39039
|
+
init2().catch(logger$f.error);
|
|
39085
39040
|
}, [init2]);
|
|
39086
39041
|
return loadingStatus === "loading" || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
|
|
39087
39042
|
DropinComposerComponent,
|
|
@@ -39125,7 +39080,7 @@ function OnboardingDropinComponent({
|
|
|
39125
39080
|
}
|
|
39126
39081
|
);
|
|
39127
39082
|
}
|
|
39128
|
-
const logger$
|
|
39083
|
+
const logger$e = createLogger("SignPCIComponent");
|
|
39129
39084
|
function SignPCIComponent({
|
|
39130
39085
|
legalEntityId,
|
|
39131
39086
|
modalView,
|
|
@@ -39155,7 +39110,7 @@ function SignPCIComponent({
|
|
|
39155
39110
|
onClose == null ? void 0 : onClose();
|
|
39156
39111
|
};
|
|
39157
39112
|
const fetchLegalEntity = useCallback(async () => {
|
|
39158
|
-
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$
|
|
39113
|
+
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$e.error);
|
|
39159
39114
|
}, [getLegalEntity2, legalEntityId]);
|
|
39160
39115
|
const fetchStatus = useCallback(async () => {
|
|
39161
39116
|
await getPciStatus2(legalEntityId, { additionalSalesChannels }).then(({ signingRequired }) => {
|
|
@@ -39166,7 +39121,7 @@ function SignPCIComponent({
|
|
|
39166
39121
|
await getPciTemplate2(legalEntityId, {
|
|
39167
39122
|
additionalSalesChannels,
|
|
39168
39123
|
language: i18n.locale.substring(0, 2) ?? "en"
|
|
39169
|
-
}).then((res) => setPciTemplate(res)).catch(logger$
|
|
39124
|
+
}).then((res) => setPciTemplate(res)).catch(logger$e.error);
|
|
39170
39125
|
}, [additionalSalesChannels, getPciTemplate2, i18n.locale, legalEntityId]);
|
|
39171
39126
|
useEffect(() => {
|
|
39172
39127
|
(async () => {
|
|
@@ -39433,6 +39388,9 @@ const getCompanySchemaKeys = (country, currentData, schemaKeys) => {
|
|
|
39433
39388
|
"numberOfEmployees"
|
|
39434
39389
|
);
|
|
39435
39390
|
}
|
|
39391
|
+
if (!euCountries.includes(country)) {
|
|
39392
|
+
fieldsToRemove.push("legalForm");
|
|
39393
|
+
}
|
|
39436
39394
|
if (currentData.isCompanyOwnedByAnotherCompany !== "Yes") {
|
|
39437
39395
|
fieldsToRemove.push("isParentOwnedByAnotherCompany");
|
|
39438
39396
|
}
|
|
@@ -39447,7 +39405,8 @@ const getCompanySchemaKeys = (country, currentData, schemaKeys) => {
|
|
|
39447
39405
|
const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
|
|
39448
39406
|
var _a;
|
|
39449
39407
|
const fieldsToRemove = [];
|
|
39450
|
-
|
|
39408
|
+
const companyCountry = (_a = currentData == null ? void 0 : currentData.registrationAddress) == null ? void 0 : _a.country;
|
|
39409
|
+
if (!isEeaCountry(companyCountry)) {
|
|
39451
39410
|
fieldsToRemove.push(
|
|
39452
39411
|
"financialReportingDate",
|
|
39453
39412
|
"netAssets",
|
|
@@ -39456,6 +39415,9 @@ const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
|
|
|
39456
39415
|
"numberOfEmployees"
|
|
39457
39416
|
);
|
|
39458
39417
|
}
|
|
39418
|
+
if (!companyCountry || !euCountries.includes(companyCountry)) {
|
|
39419
|
+
fieldsToRemove.push("legalForm");
|
|
39420
|
+
}
|
|
39459
39421
|
if (currentData.doesYourCompanyHaveLEI !== "Yes") {
|
|
39460
39422
|
fieldsToRemove.push("legalEntityIdentifier");
|
|
39461
39423
|
}
|
|
@@ -39477,6 +39439,11 @@ const validateDateNotInTheFuture = (selectedDate) => {
|
|
|
39477
39439
|
return new Date(selectedDate) <= /* @__PURE__ */ new Date();
|
|
39478
39440
|
};
|
|
39479
39441
|
const highExposureCompanyDetailsValidations = {
|
|
39442
|
+
legalForm: {
|
|
39443
|
+
modes: ["blur"],
|
|
39444
|
+
validate: (legalName) => !isEmpty$1(legalName),
|
|
39445
|
+
errorMessage: "fieldIsRequired"
|
|
39446
|
+
},
|
|
39480
39447
|
numberOfEmployees: [
|
|
39481
39448
|
{
|
|
39482
39449
|
modes: ["blur"],
|
|
@@ -39581,7 +39548,11 @@ const highExposureCompanyDetailsValidations = {
|
|
|
39581
39548
|
]
|
|
39582
39549
|
};
|
|
39583
39550
|
const highExposureParentCompaniesDetailsValidations = {
|
|
39584
|
-
|
|
39551
|
+
legalForm: {
|
|
39552
|
+
modes: ["blur"],
|
|
39553
|
+
validate: (legalName) => !isEmpty$1(legalName),
|
|
39554
|
+
errorMessage: "fieldIsRequired"
|
|
39555
|
+
},
|
|
39585
39556
|
legalName: {
|
|
39586
39557
|
modes: ["blur"],
|
|
39587
39558
|
validate: (legalName) => !isEmpty$1(legalName),
|
|
@@ -39685,7 +39656,7 @@ const highExposureParentCompaniesDetailsValidations = {
|
|
|
39685
39656
|
}
|
|
39686
39657
|
]
|
|
39687
39658
|
};
|
|
39688
|
-
const logger$
|
|
39659
|
+
const logger$d = createLogger("LegalFormField");
|
|
39689
39660
|
function LegalFormField({
|
|
39690
39661
|
name = "legalForm",
|
|
39691
39662
|
data,
|
|
@@ -39723,7 +39694,7 @@ function LegalFormField({
|
|
|
39723
39694
|
}));
|
|
39724
39695
|
setLegalForms(legalFormsResponse);
|
|
39725
39696
|
}
|
|
39726
|
-
}).catch(() => logger$
|
|
39697
|
+
}).catch(() => logger$d.error);
|
|
39727
39698
|
}, [countryCode]);
|
|
39728
39699
|
return /* @__PURE__ */ jsx(
|
|
39729
39700
|
Field,
|
|
@@ -39749,7 +39720,7 @@ function LegalFormField({
|
|
|
39749
39720
|
}
|
|
39750
39721
|
);
|
|
39751
39722
|
}
|
|
39752
|
-
const logger$
|
|
39723
|
+
const logger$c = createLogger("NaceCodeField");
|
|
39753
39724
|
function NaceCodeField({
|
|
39754
39725
|
name = "naceCode",
|
|
39755
39726
|
data,
|
|
@@ -39769,7 +39740,7 @@ function NaceCodeField({
|
|
|
39769
39740
|
if (response) {
|
|
39770
39741
|
setNaceCodes(response);
|
|
39771
39742
|
}
|
|
39772
|
-
}).catch(() => logger$
|
|
39743
|
+
}).catch(() => logger$c.error);
|
|
39773
39744
|
}, []);
|
|
39774
39745
|
const handleChangeForNaceCode = (e) => {
|
|
39775
39746
|
var _a;
|
|
@@ -40036,6 +40007,7 @@ function HighExposureFinancialInformation({
|
|
|
40036
40007
|
name: "netAssets",
|
|
40037
40008
|
label: formUtils.getLabel("netAssets", "totalAssets"),
|
|
40038
40009
|
helper: i18n.get("totalAssetsHelper"),
|
|
40010
|
+
errorMessage: formUtils.getErrorMessage("netAssets", errors, fieldProblems),
|
|
40039
40011
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
40040
40012
|
InputCurrency,
|
|
40041
40013
|
{
|
|
@@ -40054,6 +40026,7 @@ function HighExposureFinancialInformation({
|
|
|
40054
40026
|
name: "annualTurnover",
|
|
40055
40027
|
label: formUtils.getLabel("annualTurnover", "annualTurnover"),
|
|
40056
40028
|
helper: i18n.get("annualTurnoverHelper"),
|
|
40029
|
+
errorMessage: formUtils.getErrorMessage("annualTurnover", errors, fieldProblems),
|
|
40057
40030
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
40058
40031
|
InputCurrency,
|
|
40059
40032
|
{
|
|
@@ -40777,7 +40750,7 @@ const FormEndState = ({
|
|
|
40777
40750
|
);
|
|
40778
40751
|
};
|
|
40779
40752
|
const parseConfiguration = ({ matchingScenario }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
|
|
40780
|
-
const logger$
|
|
40753
|
+
const logger$b = createLogger("UpdateLegalEntityForHighExposure");
|
|
40781
40754
|
const customLabels = {
|
|
40782
40755
|
company: {
|
|
40783
40756
|
legalForm: "businessStructure",
|
|
@@ -40898,7 +40871,7 @@ function UpdateLegalEntityForHighExposure({
|
|
|
40898
40871
|
useEffect(() => {
|
|
40899
40872
|
(async () => {
|
|
40900
40873
|
await fetchLegalEntities();
|
|
40901
|
-
})().catch(logger$
|
|
40874
|
+
})().catch(logger$b.error);
|
|
40902
40875
|
}, [fetchLegalEntities]);
|
|
40903
40876
|
const [data, setData] = useState(dataFromResponse);
|
|
40904
40877
|
const [problems, setProblems] = useState(problemsProp ?? {});
|
|
@@ -41298,7 +41271,7 @@ function getContentByStatus(status) {
|
|
|
41298
41271
|
return contentMap[status];
|
|
41299
41272
|
}
|
|
41300
41273
|
const FINAL_STATUSES = [OnboardingStatus.VERIFIED, OnboardingStatus.REJECTED];
|
|
41301
|
-
const logger$
|
|
41274
|
+
const logger$a = createLogger("ViewVerificationStatusComponent");
|
|
41302
41275
|
function ViewVerificationStatusComponent({
|
|
41303
41276
|
legalEntityId,
|
|
41304
41277
|
hideExplanation = false,
|
|
@@ -41317,12 +41290,12 @@ function ViewVerificationStatusComponent({
|
|
|
41317
41290
|
if (!onboardingStatus) return;
|
|
41318
41291
|
const statusContent = getContentByStatus(onboardingStatus);
|
|
41319
41292
|
if (statusContent) return statusContent;
|
|
41320
|
-
logger$
|
|
41293
|
+
logger$a.error(`there is no content for status "${onboardingStatus}"`);
|
|
41321
41294
|
}, [onboardingStatus]);
|
|
41322
41295
|
const handleError = useCallback(
|
|
41323
41296
|
(rawError, userMessage) => {
|
|
41324
41297
|
const error = coerceError(rawError);
|
|
41325
|
-
logger$
|
|
41298
|
+
logger$a.error(error);
|
|
41326
41299
|
setAlertContent(userMessage);
|
|
41327
41300
|
onError == null ? void 0 : onError({
|
|
41328
41301
|
error,
|
|
@@ -41356,7 +41329,7 @@ function ViewVerificationStatusComponent({
|
|
|
41356
41329
|
});
|
|
41357
41330
|
useEffect(() => {
|
|
41358
41331
|
setAlertContent(void 0);
|
|
41359
|
-
fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$
|
|
41332
|
+
fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$a.error);
|
|
41360
41333
|
}, [fetchOnboardingStatus, updateOnboardingStatus]);
|
|
41361
41334
|
const [loadingLinkStatus, setLinkLoadingStatus] = useState("success");
|
|
41362
41335
|
const redirectToAdyen = async () => {
|
|
@@ -41551,40 +41524,43 @@ const getVersionConfiguration = async (context) => {
|
|
|
41551
41524
|
}
|
|
41552
41525
|
});
|
|
41553
41526
|
};
|
|
41554
|
-
const logger$
|
|
41555
|
-
const useVersionConfiguration =
|
|
41556
|
-
var _a, _b;
|
|
41527
|
+
const logger$9 = createLogger("UseVersionConfiguration");
|
|
41528
|
+
const useVersionConfiguration = (legalEntityId) => {
|
|
41557
41529
|
const { isEmbeddedDropin, loadingContext: base } = useAuthContext();
|
|
41558
41530
|
const { enableVersionExperiment } = useExperimentsContext();
|
|
41559
|
-
const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/`;
|
|
41560
|
-
|
|
41561
|
-
return;
|
|
41562
|
-
|
|
41563
|
-
|
|
41564
|
-
|
|
41565
|
-
|
|
41566
|
-
|
|
41567
|
-
|
|
41568
|
-
|
|
41569
|
-
|
|
41570
|
-
|
|
41531
|
+
const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/legalEntities/`;
|
|
41532
|
+
useEffect(() => {
|
|
41533
|
+
if (!isEmbeddedDropin) return;
|
|
41534
|
+
(async () => {
|
|
41535
|
+
var _a, _b;
|
|
41536
|
+
try {
|
|
41537
|
+
const versionConfiguration = await getVersionConfiguration({
|
|
41538
|
+
loadingContext,
|
|
41539
|
+
legalEntityId
|
|
41540
|
+
});
|
|
41541
|
+
(_b = (_a = versionConfiguration == null ? void 0 : versionConfiguration.features) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (feature) => enableVersionExperiment(feature));
|
|
41542
|
+
} catch (e) {
|
|
41543
|
+
logger$9.error("Failed to set version configuration", e);
|
|
41544
|
+
}
|
|
41545
|
+
})();
|
|
41546
|
+
}, [enableVersionExperiment, isEmbeddedDropin, legalEntityId, loadingContext]);
|
|
41571
41547
|
};
|
|
41572
|
-
const logger$
|
|
41548
|
+
const logger$8 = createLogger("loadCountries");
|
|
41573
41549
|
const countriesImports = /* @__PURE__ */ Object.assign({ "./de-DE.json": () => import("./de-DE-Cx8Uim1K.js"), "./el-GR.json": () => import("./el-GR-B7_JR3z5.js"), "./en-US.json": () => import("./en-US-CkdCbOCX.js"), "./es-ES.json": () => import("./es-ES-NBv3HHhn.js"), "./fr-FR.json": () => import("./fr-FR-DdSVMVsp.js"), "./it-IT.json": () => import("./it-IT-Bwdk3zuj.js"), "./ja-JP.json": () => import("./ja-JP-Bsvzm8zu.js"), "./nl-NL.json": () => import("./nl-NL-DofKaNkk.js"), "./pt-PT.json": () => import("./pt-PT-DFEvMD1M.js"), "./ru-RU.json": () => import("./ru-RU-PiM0ZI5h.js"), "./sv-SE.json": () => import("./sv-SE-C0GoLwTg.js"), "./zh-CN.json": () => import("./zh-CN-DJs6Hct-.js"), "./zh-TW.json": () => import("./zh-TW-BWhLbns8.js") });
|
|
41574
41550
|
const loadCountriesDataset = async (locale) => {
|
|
41575
41551
|
const importForLocale = countriesImports[`./${locale}.json`];
|
|
41576
41552
|
if (!importForLocale) {
|
|
41577
|
-
logger$
|
|
41553
|
+
logger$8.warn(`No countries dataset for ${locale}, falling back to en-US`);
|
|
41578
41554
|
return (await import("./en-US-CkdCbOCX.js")).default;
|
|
41579
41555
|
}
|
|
41580
41556
|
return (await importForLocale()).default;
|
|
41581
41557
|
};
|
|
41582
|
-
const logger$
|
|
41558
|
+
const logger$7 = createLogger("loadStates");
|
|
41583
41559
|
const statesImports = /* @__PURE__ */ Object.assign({ "./AU/en-US.json": () => import("./en-US-CQv3D6--.js"), "./BR/en-US.json": () => import("./en-US-eaysbh-g.js"), "./BR/pt-BR.json": () => import("./pt-BR-CNtbeGFJ.js"), "./CA/en-US.json": () => import("./en-US-gM26UC0X.js"), "./NZ/en-US.json": () => import("./en-US-CLmaFLwu.js"), "./US/en-US.json": () => import("./en-US-7uBFgKyC.js") });
|
|
41584
41560
|
const loadStatesDataset = async (country, locale) => {
|
|
41585
41561
|
const importForLocale = statesImports[`./${country}/${locale}.json`];
|
|
41586
41562
|
if (!importForLocale) {
|
|
41587
|
-
logger$
|
|
41563
|
+
logger$7.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
|
|
41588
41564
|
const fallbackImport = statesImports[`./${country}/en-US.json`];
|
|
41589
41565
|
return (await fallbackImport()).default;
|
|
41590
41566
|
}
|
|
@@ -41720,7 +41696,7 @@ const validatePhoneNumber$1 = async (context, phoneNumber) => {
|
|
|
41720
41696
|
{ number: phoneNumber }
|
|
41721
41697
|
);
|
|
41722
41698
|
};
|
|
41723
|
-
const logger$
|
|
41699
|
+
const logger$6 = createLogger("verify-id-number");
|
|
41724
41700
|
const verifyIdNumber$1 = async (context, request) => {
|
|
41725
41701
|
const { loadingContext, legalEntityId } = context;
|
|
41726
41702
|
try {
|
|
@@ -41743,13 +41719,13 @@ const verifyIdNumber$1 = async (context, request) => {
|
|
|
41743
41719
|
if (responseData.status === 500) {
|
|
41744
41720
|
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
41745
41721
|
}
|
|
41746
|
-
return logger$
|
|
41722
|
+
return logger$6.warn(`Unexpected response status ${responseData.status}`);
|
|
41747
41723
|
}
|
|
41748
41724
|
},
|
|
41749
41725
|
request
|
|
41750
41726
|
);
|
|
41751
41727
|
} catch (e) {
|
|
41752
|
-
logger$
|
|
41728
|
+
logger$6.warn("WARNING: idNumber verification failed - error:", e);
|
|
41753
41729
|
}
|
|
41754
41730
|
};
|
|
41755
41731
|
const getEmbeddedApi = ({
|
|
@@ -41848,7 +41824,7 @@ const validatePhoneNumber = async (context, phoneNumber) => {
|
|
|
41848
41824
|
{ number: phoneNumber }
|
|
41849
41825
|
);
|
|
41850
41826
|
};
|
|
41851
|
-
const logger$
|
|
41827
|
+
const logger$5 = createLogger("verify-id-number");
|
|
41852
41828
|
const verifyIdNumber = async (context, request) => {
|
|
41853
41829
|
const { loadingContext, clientKey } = context;
|
|
41854
41830
|
try {
|
|
@@ -41866,7 +41842,7 @@ const verifyIdNumber = async (context, request) => {
|
|
|
41866
41842
|
if (responseData.status === 500) {
|
|
41867
41843
|
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
41868
41844
|
}
|
|
41869
|
-
return logger$
|
|
41845
|
+
return logger$5.warn(`Unexpected response status ${responseData.status}`);
|
|
41870
41846
|
},
|
|
41871
41847
|
path: "v1/verification/idNumber",
|
|
41872
41848
|
clientKey
|
|
@@ -41874,7 +41850,7 @@ const verifyIdNumber = async (context, request) => {
|
|
|
41874
41850
|
request
|
|
41875
41851
|
);
|
|
41876
41852
|
} catch (e) {
|
|
41877
|
-
logger$
|
|
41853
|
+
logger$5.warn("WARNING: idNumber verification failed - error:", e);
|
|
41878
41854
|
}
|
|
41879
41855
|
};
|
|
41880
41856
|
const getKycExternalApi = ({
|
|
@@ -41903,7 +41879,7 @@ const ConfigurationApiProvider = ({
|
|
|
41903
41879
|
}) => {
|
|
41904
41880
|
const authContext = useAuthContext();
|
|
41905
41881
|
const { isEmbeddedDropin, loadingContext } = authContext;
|
|
41906
|
-
const sdkVersion = "3.
|
|
41882
|
+
const sdkVersion = "3.38.0";
|
|
41907
41883
|
useAnalytics({
|
|
41908
41884
|
onUserEvent,
|
|
41909
41885
|
legalEntityId: rootLegalEntityId,
|
|
@@ -41934,6 +41910,19 @@ const useAccountHolder = (legalEntityId) => {
|
|
|
41934
41910
|
setAccountHolder: setAccountHolderIntoLocalStorage
|
|
41935
41911
|
};
|
|
41936
41912
|
};
|
|
41913
|
+
const logger$4 = createLogger("useAllowedCountries");
|
|
41914
|
+
const useAllowedCountries = () => {
|
|
41915
|
+
const acceptedCountries = useSetting("acceptedCountries");
|
|
41916
|
+
const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
|
|
41917
|
+
const [allowedCountries, setAllowedCountries] = useState(
|
|
41918
|
+
acceptedCountries
|
|
41919
|
+
);
|
|
41920
|
+
useEffect(() => {
|
|
41921
|
+
if (acceptedCountries !== void 0) return;
|
|
41922
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$4.error);
|
|
41923
|
+
}, [acceptedCountries]);
|
|
41924
|
+
return allowedCountries;
|
|
41925
|
+
};
|
|
41937
41926
|
const logger$3 = createLogger("CoreProvider");
|
|
41938
41927
|
const CoreProvider = ({
|
|
41939
41928
|
contextCountry: initialContextCountry,
|
|
@@ -41969,9 +41958,18 @@ const CoreProvider = ({
|
|
|
41969
41958
|
idVerificationProviderId,
|
|
41970
41959
|
setIdVerificationProviderId,
|
|
41971
41960
|
setIsModalView,
|
|
41972
|
-
isModalView
|
|
41961
|
+
isModalView,
|
|
41962
|
+
allowedCountries
|
|
41973
41963
|
}),
|
|
41974
|
-
[
|
|
41964
|
+
[
|
|
41965
|
+
contextCountry,
|
|
41966
|
+
accountHolder,
|
|
41967
|
+
setAccountHolder,
|
|
41968
|
+
accountFormat,
|
|
41969
|
+
idVerificationProviderId,
|
|
41970
|
+
isModalView,
|
|
41971
|
+
allowedCountries
|
|
41972
|
+
]
|
|
41975
41973
|
);
|
|
41976
41974
|
return /* @__PURE__ */ jsx(CoreContext.Provider, { value: contextValue, children });
|
|
41977
41975
|
};
|
|
@@ -42574,7 +42572,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
42574
42572
|
};
|
|
42575
42573
|
const copyToClipboard = async () => {
|
|
42576
42574
|
const toCopy = {
|
|
42577
|
-
sdkVersion: "3.
|
|
42575
|
+
sdkVersion: "3.38.0",
|
|
42578
42576
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
42579
42577
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
42580
42578
|
};
|
|
@@ -42639,7 +42637,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
42639
42637
|
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
|
|
42640
42638
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
42641
42639
|
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
|
|
42642
|
-
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.
|
|
42640
|
+
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.38.0" })
|
|
42643
42641
|
] }) }),
|
|
42644
42642
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
42645
42643
|
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
|