@adyen/kyc-components 2.59.0 → 2.59.2
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 +245 -316
- package/dist/style.css +3 -0
- package/dist/types/components/Dropins/DropinComposer/components/DropinComposerComponent.d.ts +1 -1
- 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/payoutVerificationMethodMetadata.d.ts +4 -2
- package/dist/types/components/PayoutVerificationMethod/types.d.ts +1 -1
- package/dist/types/components/internal/Address/components/SearchAddress.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/package.json +1 -1
- package/dist/types/core/hooks/useIsElementVisible.d.ts +0 -2
|
@@ -2917,27 +2917,6 @@ function useResetGlobalData(caller) {
|
|
|
2917
2917
|
[dispatch, caller]
|
|
2918
2918
|
);
|
|
2919
2919
|
}
|
|
2920
|
-
const useSetting = (settingName) => {
|
|
2921
|
-
const context = useContext(SettingsContext);
|
|
2922
|
-
if (context === void 0) {
|
|
2923
|
-
throw new Error("useSetting must be used within a SettingsProvider");
|
|
2924
|
-
}
|
|
2925
|
-
const { getSetting } = context;
|
|
2926
|
-
return getSetting(settingName);
|
|
2927
|
-
};
|
|
2928
|
-
const logger$B = createLogger("useAllowedCountries");
|
|
2929
|
-
const useAllowedCountries = () => {
|
|
2930
|
-
const acceptedCountries = useSetting("acceptedCountries");
|
|
2931
|
-
const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
|
|
2932
|
-
const [allowedCountries, setAllowedCountries] = useState(
|
|
2933
|
-
acceptedCountries
|
|
2934
|
-
);
|
|
2935
|
-
useEffect(() => {
|
|
2936
|
-
if (acceptedCountries !== void 0) return;
|
|
2937
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$B.error);
|
|
2938
|
-
}, [acceptedCountries]);
|
|
2939
|
-
return allowedCountries;
|
|
2940
|
-
};
|
|
2941
2920
|
class ValidationResult {
|
|
2942
2921
|
constructor(results) {
|
|
2943
2922
|
this.validationResults = results;
|
|
@@ -2955,7 +2934,7 @@ class ValidationResult {
|
|
|
2955
2934
|
return this.validationResults.find((result) => result.hasError);
|
|
2956
2935
|
}
|
|
2957
2936
|
}
|
|
2958
|
-
const logger$
|
|
2937
|
+
const logger$B = createLogger("useAsyncValidator");
|
|
2959
2938
|
const useAsyncValidator = (asyncRules) => {
|
|
2960
2939
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
2961
2940
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -2975,7 +2954,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
2975
2954
|
}
|
|
2976
2955
|
])
|
|
2977
2956
|
});
|
|
2978
|
-
}).catch(logger$
|
|
2957
|
+
}).catch(logger$B.error);
|
|
2979
2958
|
},
|
|
2980
2959
|
[asyncRules, clearAsyncValidationResults]
|
|
2981
2960
|
);
|
|
@@ -5062,7 +5041,7 @@ const companyNameAndCountryFields = [
|
|
|
5062
5041
|
function CompanyNameAndCountry(props) {
|
|
5063
5042
|
const { i18n } = useI18nContext();
|
|
5064
5043
|
const { isSettingEnabled } = useSettingsContext();
|
|
5065
|
-
const allowedCountries =
|
|
5044
|
+
const { allowedCountries } = useCoreContext();
|
|
5066
5045
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
5067
5046
|
const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(
|
|
5068
5047
|
ExperimentNames.StrictNameAndAddressValidationV4
|
|
@@ -7306,7 +7285,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
|
|
|
7306
7285
|
};
|
|
7307
7286
|
};
|
|
7308
7287
|
const MISMATCH_ANIMATION_NAME = "mismatchShake";
|
|
7309
|
-
const logger$
|
|
7288
|
+
const logger$A = createLogger("MaskedInputText");
|
|
7310
7289
|
const MaskedInputText = ({
|
|
7311
7290
|
value,
|
|
7312
7291
|
onInput,
|
|
@@ -7351,7 +7330,7 @@ const MaskedInputText = ({
|
|
|
7351
7330
|
};
|
|
7352
7331
|
useEffect(() => {
|
|
7353
7332
|
if (!mask) {
|
|
7354
|
-
logger$
|
|
7333
|
+
logger$A.warn("`mask` is undefined. No masking of input will take place.");
|
|
7355
7334
|
}
|
|
7356
7335
|
}, [mask]);
|
|
7357
7336
|
const getMaskResult = useCallback(
|
|
@@ -7395,7 +7374,7 @@ const MaskedInputText = ({
|
|
|
7395
7374
|
return;
|
|
7396
7375
|
}
|
|
7397
7376
|
if (preserveMismatchingInitialValue) {
|
|
7398
|
-
logger$
|
|
7377
|
+
logger$A.warn(
|
|
7399
7378
|
`Value received "${value}" does not match mask`,
|
|
7400
7379
|
maskResult,
|
|
7401
7380
|
`
|
|
@@ -7405,7 +7384,7 @@ Preserving mismatched initial value until user input.`
|
|
|
7405
7384
|
return;
|
|
7406
7385
|
}
|
|
7407
7386
|
const fallback = displayValueToPure(maskResult.partialDisplayValue);
|
|
7408
|
-
logger$
|
|
7387
|
+
logger$A.warn(
|
|
7409
7388
|
`Value received "${value}" does not match mask`,
|
|
7410
7389
|
maskResult,
|
|
7411
7390
|
`
|
|
@@ -11042,7 +11021,7 @@ function Dropzone(props) {
|
|
|
11042
11021
|
isRequired && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: i18n.get("fieldIsRequired") })
|
|
11043
11022
|
] });
|
|
11044
11023
|
}
|
|
11045
|
-
const logger$
|
|
11024
|
+
const logger$z = createLogger("TextArea");
|
|
11046
11025
|
function TextArea(props) {
|
|
11047
11026
|
const { classNameModifiers, uniqueId, ...passedProps } = props;
|
|
11048
11027
|
const {
|
|
@@ -11057,7 +11036,7 @@ function TextArea(props) {
|
|
|
11057
11036
|
const { i18n } = useI18nContext();
|
|
11058
11037
|
const [value, setValue] = useState("");
|
|
11059
11038
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11060
|
-
logger$
|
|
11039
|
+
logger$z.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11061
11040
|
}
|
|
11062
11041
|
const handleInput = (e) => {
|
|
11063
11042
|
var _a;
|
|
@@ -11476,7 +11455,7 @@ const styles$6 = {
|
|
|
11476
11455
|
"financial-information-reported-value-options": "adyen-kyc-financial-information-reported-value-options",
|
|
11477
11456
|
financialInformationReportedValueOptions
|
|
11478
11457
|
};
|
|
11479
|
-
const logger$
|
|
11458
|
+
const logger$y = createLogger("InputCurrency");
|
|
11480
11459
|
const determineDecimalSeparator = (formatter) => formatter.formatToParts(0.1).find((part) => part.type === "decimal").value;
|
|
11481
11460
|
const determineCurrencySymbol = (formatter) => formatter.formatToParts(0).find((part) => part.type === "currency").value;
|
|
11482
11461
|
const getNumberFromFormattedCurrency = (formatted, decimalSeparator) => {
|
|
@@ -11507,7 +11486,7 @@ const InputCurrency = ({
|
|
|
11507
11486
|
const rawValue = e.target.value;
|
|
11508
11487
|
const value = getNumberFromFormattedCurrency(rawValue, decimalSeparator);
|
|
11509
11488
|
if (Number.isNaN(value)) {
|
|
11510
|
-
logger$
|
|
11489
|
+
logger$y.warn(`Unable to get number from formatted currency: "${rawValue}"`);
|
|
11511
11490
|
setText(isUndefinedOrNull(amount) ? currencySymbol : formatter.format(amount));
|
|
11512
11491
|
return;
|
|
11513
11492
|
}
|
|
@@ -11972,28 +11951,7 @@ function FieldContainer(props) {
|
|
|
11972
11951
|
}
|
|
11973
11952
|
return renderField(fieldName);
|
|
11974
11953
|
}
|
|
11975
|
-
const
|
|
11976
|
-
function useIsElementVisible(ref, fallback = true) {
|
|
11977
|
-
const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
|
|
11978
|
-
const observerRef = useRef();
|
|
11979
|
-
useEffect(() => {
|
|
11980
|
-
if (!isIntersectionObserverSupported) return;
|
|
11981
|
-
observerRef.current = new IntersectionObserver(
|
|
11982
|
-
([entry]) => setIsOnScreen(entry.isIntersecting)
|
|
11983
|
-
);
|
|
11984
|
-
}, []);
|
|
11985
|
-
useEffect(() => {
|
|
11986
|
-
var _a;
|
|
11987
|
-
if (!ref.current) return;
|
|
11988
|
-
(_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
|
|
11989
|
-
return () => {
|
|
11990
|
-
var _a2;
|
|
11991
|
-
(_a2 = observerRef.current) == null ? void 0 : _a2.disconnect();
|
|
11992
|
-
};
|
|
11993
|
-
}, [ref]);
|
|
11994
|
-
return isOnScreen;
|
|
11995
|
-
}
|
|
11996
|
-
const logger$w = createLogger("SearchAddress");
|
|
11954
|
+
const logger$x = createLogger("SearchAddress");
|
|
11997
11955
|
const SearchAddress = ({
|
|
11998
11956
|
data,
|
|
11999
11957
|
legalEntityId,
|
|
@@ -12002,8 +11960,7 @@ const SearchAddress = ({
|
|
|
12002
11960
|
handleAddressSearch,
|
|
12003
11961
|
handleFindAddress,
|
|
12004
11962
|
addressType,
|
|
12005
|
-
kompanyAddress
|
|
12006
|
-
kompanyPrefilled = false
|
|
11963
|
+
kompanyAddress
|
|
12007
11964
|
}) => {
|
|
12008
11965
|
const { i18n } = useI18nContext();
|
|
12009
11966
|
const [items, setItems] = useState([]);
|
|
@@ -12011,21 +11968,13 @@ const SearchAddress = ({
|
|
|
12011
11968
|
const [resetSearch, setResetSearch] = useState(false);
|
|
12012
11969
|
const [searchText, setSearchText] = useState(null);
|
|
12013
11970
|
const [showSearchList, setShowSearchList] = useState(false);
|
|
12014
|
-
const searchBoxRef = useRef(null);
|
|
12015
|
-
const isVisible = useIsElementVisible(searchBoxRef);
|
|
12016
11971
|
const canAutoFillKompanyAddress = kompanyAddress && searchText !== kompanyAddress && addressType === "registrationAddress";
|
|
12017
11972
|
useEffect(() => {
|
|
12018
11973
|
setSearchText(kompanyAddress);
|
|
12019
11974
|
if (canAutoFillKompanyAddress) {
|
|
12020
|
-
|
|
12021
|
-
searchForAddress();
|
|
11975
|
+
getSearchItems(kompanyAddress);
|
|
12022
11976
|
}
|
|
12023
11977
|
}, [kompanyAddress]);
|
|
12024
|
-
useEffect(() => {
|
|
12025
|
-
if (isVisible && kompanyAddress && addressType === "registrationAddress" && !kompanyPrefilled) {
|
|
12026
|
-
setShowSearchList(true);
|
|
12027
|
-
}
|
|
12028
|
-
}, [isVisible, kompanyAddress, addressType, kompanyPrefilled]);
|
|
12029
11978
|
useEffect(() => {
|
|
12030
11979
|
setItems([]);
|
|
12031
11980
|
setResetSearch(true);
|
|
@@ -12035,7 +11984,7 @@ const SearchAddress = ({
|
|
|
12035
11984
|
const response = await handleFindAddress(selectedAddressId);
|
|
12036
11985
|
autocompleteAddressForm(response);
|
|
12037
11986
|
} catch (e) {
|
|
12038
|
-
logger$
|
|
11987
|
+
logger$x.error(e);
|
|
12039
11988
|
}
|
|
12040
11989
|
};
|
|
12041
11990
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -12046,7 +11995,7 @@ const SearchAddress = ({
|
|
|
12046
11995
|
);
|
|
12047
11996
|
setItems((response == null ? void 0 : response.results) || []);
|
|
12048
11997
|
} catch (e) {
|
|
12049
|
-
logger$
|
|
11998
|
+
logger$x.error(e);
|
|
12050
11999
|
}
|
|
12051
12000
|
};
|
|
12052
12001
|
const onChange = (e) => {
|
|
@@ -12098,7 +12047,7 @@ const SearchAddress = ({
|
|
|
12098
12047
|
setItems([]);
|
|
12099
12048
|
}
|
|
12100
12049
|
} catch (e) {
|
|
12101
|
-
logger$
|
|
12050
|
+
logger$x.error(e);
|
|
12102
12051
|
}
|
|
12103
12052
|
setLoading(false);
|
|
12104
12053
|
}
|
|
@@ -12166,7 +12115,6 @@ const SearchAddress = ({
|
|
|
12166
12115
|
name: "searchAddress",
|
|
12167
12116
|
className: "adyen-kyc-u-margin-bottom-8",
|
|
12168
12117
|
label: i18n.get("searchAddress"),
|
|
12169
|
-
wrapperRef: searchBoxRef,
|
|
12170
12118
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
12171
12119
|
Select,
|
|
12172
12120
|
{
|
|
@@ -12538,16 +12486,14 @@ function Address(props) {
|
|
|
12538
12486
|
[dataProp == null ? void 0 : dataProp.country, i18n]
|
|
12539
12487
|
);
|
|
12540
12488
|
const {
|
|
12489
|
+
schema,
|
|
12541
12490
|
data,
|
|
12542
12491
|
errors,
|
|
12543
12492
|
valid,
|
|
12544
12493
|
isValid,
|
|
12545
12494
|
fieldProblems,
|
|
12546
12495
|
handleChangeFor,
|
|
12547
|
-
triggerValidation
|
|
12548
|
-
resetToDefaultData,
|
|
12549
|
-
schema,
|
|
12550
|
-
setData
|
|
12496
|
+
triggerValidation
|
|
12551
12497
|
} = useForm({
|
|
12552
12498
|
...props,
|
|
12553
12499
|
schema: requiredFields,
|
|
@@ -12622,26 +12568,6 @@ function Address(props) {
|
|
|
12622
12568
|
setShowAddAddressButton(false);
|
|
12623
12569
|
}
|
|
12624
12570
|
}, [shouldValidate]);
|
|
12625
|
-
const canAutofillVerifiedBusinessAddress = Boolean(
|
|
12626
|
-
(verifiedBusiness == null ? void 0 : verifiedBusiness.street) && (verifiedBusiness == null ? void 0 : verifiedBusiness.city) && (verifiedBusiness == null ? void 0 : verifiedBusiness.state) && verifiedBusiness.zipcode
|
|
12627
|
-
);
|
|
12628
|
-
useEffect(() => {
|
|
12629
|
-
if (!isExperimentEnabled("EnableNewBusinessDetailsFlow")) return;
|
|
12630
|
-
if (verifiedBusiness && canAutofillVerifiedBusinessAddress) {
|
|
12631
|
-
setShowAutocompletedAddressFields(true);
|
|
12632
|
-
setShowAddAddressButton(false);
|
|
12633
|
-
setData("address", verifiedBusiness.street);
|
|
12634
|
-
setData("city", verifiedBusiness.city);
|
|
12635
|
-
setData("stateOrProvince", verifiedBusiness.state);
|
|
12636
|
-
setData("postalCode", verifiedBusiness.zipcode);
|
|
12637
|
-
return triggerValidation();
|
|
12638
|
-
}
|
|
12639
|
-
if (!(dataProp == null ? void 0 : dataProp.address) || !(dataProp == null ? void 0 : dataProp.city) || !(dataProp == null ? void 0 : dataProp.postalCode)) {
|
|
12640
|
-
setShowAutocompletedAddressFields(false);
|
|
12641
|
-
setShowAddAddressButton(true);
|
|
12642
|
-
resetToDefaultData();
|
|
12643
|
-
}
|
|
12644
|
-
}, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
|
|
12645
12571
|
const getComponent = (fieldName) => {
|
|
12646
12572
|
if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
|
|
12647
12573
|
const hideField = fieldName === "country" && hideCountry;
|
|
@@ -12729,8 +12655,7 @@ function Address(props) {
|
|
|
12729
12655
|
legalEntityId,
|
|
12730
12656
|
autocompleteAddressForm,
|
|
12731
12657
|
addressType,
|
|
12732
|
-
kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address
|
|
12733
|
-
kompanyPrefilled: canAutofillVerifiedBusinessAddress
|
|
12658
|
+
kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address
|
|
12734
12659
|
}
|
|
12735
12660
|
),
|
|
12736
12661
|
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-search-address--below", children: [
|
|
@@ -12765,7 +12690,7 @@ Address.defaultProps = {
|
|
|
12765
12690
|
requiredFields: ADDRESS_SCHEMA,
|
|
12766
12691
|
countryCode: null
|
|
12767
12692
|
};
|
|
12768
|
-
const logger$
|
|
12693
|
+
const logger$w = createLogger("AddressFieldContainer");
|
|
12769
12694
|
const formatAddressItem = (item) => {
|
|
12770
12695
|
if (item.description.includes("Addresses")) {
|
|
12771
12696
|
const splittedDescription = item.description.split(" - ");
|
|
@@ -12903,7 +12828,7 @@ function FieldContainerComponent({
|
|
|
12903
12828
|
setItems([]);
|
|
12904
12829
|
}
|
|
12905
12830
|
} catch (e) {
|
|
12906
|
-
logger$
|
|
12831
|
+
logger$w.error(e);
|
|
12907
12832
|
}
|
|
12908
12833
|
setLoading(false);
|
|
12909
12834
|
};
|
|
@@ -12937,7 +12862,7 @@ function FieldContainerComponent({
|
|
|
12937
12862
|
});
|
|
12938
12863
|
}
|
|
12939
12864
|
} catch (e) {
|
|
12940
|
-
logger$
|
|
12865
|
+
logger$w.error(e);
|
|
12941
12866
|
}
|
|
12942
12867
|
};
|
|
12943
12868
|
const onDrilldown = async (address) => {
|
|
@@ -12949,7 +12874,7 @@ function FieldContainerComponent({
|
|
|
12949
12874
|
));
|
|
12950
12875
|
setItems((response == null ? void 0 : response.results) || []);
|
|
12951
12876
|
} catch (e) {
|
|
12952
|
-
logger$
|
|
12877
|
+
logger$w.error(e);
|
|
12953
12878
|
}
|
|
12954
12879
|
};
|
|
12955
12880
|
const handleOnChange = (e) => {
|
|
@@ -15420,7 +15345,7 @@ const initOnfido = async ({
|
|
|
15420
15345
|
language: getOnfidoLocaleConfig(i18n)
|
|
15421
15346
|
});
|
|
15422
15347
|
};
|
|
15423
|
-
const logger$
|
|
15348
|
+
const logger$v = createLogger("IdVerificationComponent");
|
|
15424
15349
|
function IdVerificationComponent({
|
|
15425
15350
|
userDetails,
|
|
15426
15351
|
legalEntityId,
|
|
@@ -15447,7 +15372,7 @@ function IdVerificationComponent({
|
|
|
15447
15372
|
onIdVerificationError,
|
|
15448
15373
|
onIdVerificationComplete
|
|
15449
15374
|
});
|
|
15450
|
-
})().catch(logger$
|
|
15375
|
+
})().catch(logger$v.error);
|
|
15451
15376
|
return () => {
|
|
15452
15377
|
if (onfidoSdk.current) onfidoSdk.current.tearDown();
|
|
15453
15378
|
};
|
|
@@ -15491,7 +15416,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
15491
15416
|
] })
|
|
15492
15417
|
] });
|
|
15493
15418
|
}
|
|
15494
|
-
const logger$
|
|
15419
|
+
const logger$u = createLogger("IdDocumentInstantVerificationComponent");
|
|
15495
15420
|
const idVerificationSchema = [
|
|
15496
15421
|
"instantIdVerificationData",
|
|
15497
15422
|
"idDocumentType"
|
|
@@ -15563,7 +15488,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
15563
15488
|
userDetails: props.userDetails,
|
|
15564
15489
|
legalEntityId: props.legalEntityId,
|
|
15565
15490
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
15566
|
-
onIdVerificationError: logger$
|
|
15491
|
+
onIdVerificationError: logger$u.error
|
|
15567
15492
|
}
|
|
15568
15493
|
),
|
|
15569
15494
|
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
|
|
@@ -15983,7 +15908,7 @@ const phoneFormatters = {
|
|
|
15983
15908
|
};
|
|
15984
15909
|
const phoneFields = ["phoneNumber"];
|
|
15985
15910
|
const DEFAULT_PHONE_PREFIX = "+1";
|
|
15986
|
-
const logger$
|
|
15911
|
+
const logger$t = createLogger("PhoneInput");
|
|
15987
15912
|
const usePhonePrefixes = () => {
|
|
15988
15913
|
const [phonePrefixes, setPhonePrefixes] = useState();
|
|
15989
15914
|
useEffect(() => {
|
|
@@ -15991,7 +15916,7 @@ const usePhonePrefixes = () => {
|
|
|
15991
15916
|
const loaded = (await import("./phonePrefixes-zV4hciyK.js")).default;
|
|
15992
15917
|
setPhonePrefixes(loaded);
|
|
15993
15918
|
};
|
|
15994
|
-
loadPhonePrefixes().catch(logger$
|
|
15919
|
+
loadPhonePrefixes().catch(logger$t.error);
|
|
15995
15920
|
}, []);
|
|
15996
15921
|
return phonePrefixes;
|
|
15997
15922
|
};
|
|
@@ -18028,7 +17953,7 @@ function PersonalDetailsComponent(props) {
|
|
|
18028
17953
|
var _a, _b, _c, _d;
|
|
18029
17954
|
const { i18n } = useI18nContext();
|
|
18030
17955
|
const { isSettingEnabled } = useSettingsContext();
|
|
18031
|
-
const allowedCountries =
|
|
17956
|
+
const { allowedCountries } = useCoreContext();
|
|
18032
17957
|
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
18033
17958
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
18034
17959
|
const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
|
|
@@ -19458,7 +19383,7 @@ class AdyenKycSdkError extends Error {
|
|
|
19458
19383
|
}
|
|
19459
19384
|
let sdkToken;
|
|
19460
19385
|
let fetchSdkToken;
|
|
19461
|
-
const logger$
|
|
19386
|
+
const logger$s = createLogger("Session");
|
|
19462
19387
|
const setSdkToken = (token) => {
|
|
19463
19388
|
sdkToken = token;
|
|
19464
19389
|
};
|
|
@@ -19483,7 +19408,7 @@ const refreshSession = async () => {
|
|
|
19483
19408
|
setSdkToken(token);
|
|
19484
19409
|
isSessionRefreshed = true;
|
|
19485
19410
|
} catch (e) {
|
|
19486
|
-
logger$
|
|
19411
|
+
logger$s.error("Failed to fetch sdk token", e);
|
|
19487
19412
|
}
|
|
19488
19413
|
return isSessionRefreshed;
|
|
19489
19414
|
};
|
|
@@ -19493,7 +19418,7 @@ const addAnimationStartListener = (element, listener) => {
|
|
|
19493
19418
|
const removeAnimationStartListener = (element, listener) => {
|
|
19494
19419
|
element.removeEventListener("animationstart", listener, false);
|
|
19495
19420
|
};
|
|
19496
|
-
const logger$
|
|
19421
|
+
const logger$r = createLogger("Fetch");
|
|
19497
19422
|
const getRequestObject = (options, data) => {
|
|
19498
19423
|
const { headers = [], method = "GET", authentication } = options;
|
|
19499
19424
|
let authHeaders;
|
|
@@ -19534,10 +19459,10 @@ const logFetchError = (message, level) => {
|
|
|
19534
19459
|
case "info":
|
|
19535
19460
|
case "warn":
|
|
19536
19461
|
case "error":
|
|
19537
|
-
logger$
|
|
19462
|
+
logger$r[level](message);
|
|
19538
19463
|
break;
|
|
19539
19464
|
default:
|
|
19540
|
-
logger$
|
|
19465
|
+
logger$r.error(message);
|
|
19541
19466
|
}
|
|
19542
19467
|
};
|
|
19543
19468
|
const handleFetchResponse = async (response, responseType) => {
|
|
@@ -19617,7 +19542,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
19617
19542
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
19618
19543
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
19619
19544
|
const TINK_VENDOR = "Tink";
|
|
19620
|
-
const logger$
|
|
19545
|
+
const logger$q = createLogger("iframeWidget");
|
|
19621
19546
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
19622
19547
|
const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
19623
19548
|
const parseMessageJson = (message) => {
|
|
@@ -19635,7 +19560,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
19635
19560
|
try {
|
|
19636
19561
|
await response;
|
|
19637
19562
|
} catch (ex) {
|
|
19638
|
-
logger$
|
|
19563
|
+
logger$q.error(ex);
|
|
19639
19564
|
}
|
|
19640
19565
|
return {
|
|
19641
19566
|
error: "UNKNOWN_ERROR",
|
|
@@ -19731,7 +19656,7 @@ class IFrameWidget {
|
|
|
19731
19656
|
message = responseData.errorMessage;
|
|
19732
19657
|
}
|
|
19733
19658
|
} catch (ex) {
|
|
19734
|
-
logger$
|
|
19659
|
+
logger$q.error(ex);
|
|
19735
19660
|
}
|
|
19736
19661
|
throw new AdyenKycSdkError(reason, jsonData.error);
|
|
19737
19662
|
}
|
|
@@ -21240,7 +21165,6 @@ const PayoutAccount = memo(
|
|
|
21240
21165
|
PayoutAccountComponent,
|
|
21241
21166
|
(prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate
|
|
21242
21167
|
);
|
|
21243
|
-
const toCapitalized = (s) => `${s[0].toUpperCase()}${s.slice(1).toLowerCase()}`;
|
|
21244
21168
|
const eeaCountries = [
|
|
21245
21169
|
CountryCodes.Austria,
|
|
21246
21170
|
CountryCodes.Belgium,
|
|
@@ -21284,27 +21208,37 @@ const regions = {
|
|
|
21284
21208
|
const getAllowedBankCountries = (country) => Object.values(regions).find((countriesInARegion) => countriesInARegion.includes(country)) ?? [
|
|
21285
21209
|
country
|
|
21286
21210
|
];
|
|
21287
|
-
const
|
|
21288
|
-
|
|
21289
|
-
|
|
21290
|
-
|
|
21291
|
-
|
|
21292
|
-
|
|
21293
|
-
|
|
21294
|
-
|
|
21295
|
-
|
|
21296
|
-
|
|
21297
|
-
|
|
21298
|
-
|
|
21299
|
-
},
|
|
21300
|
-
manualVerification: {
|
|
21301
|
-
name: "uploadABankStatement",
|
|
21302
|
-
subtitle: "mayTakeAFewDays",
|
|
21303
|
-
description: "manualVerificationDescription",
|
|
21304
|
-
svgName: "payout-verification-manual"
|
|
21305
|
-
}
|
|
21306
|
-
};
|
|
21211
|
+
const getProviderName = (providerName) => providerName === "PayWithMyBank" ? "Trustly" : providerName;
|
|
21212
|
+
const getProviderIconName = (providerName) => {
|
|
21213
|
+
switch (providerName == null ? void 0 : providerName.toLowerCase()) {
|
|
21214
|
+
case "tink":
|
|
21215
|
+
return "tink-logo";
|
|
21216
|
+
case "paywithmybank":
|
|
21217
|
+
return "trustly-logo";
|
|
21218
|
+
case "plaid":
|
|
21219
|
+
return "plaid-logo";
|
|
21220
|
+
default:
|
|
21221
|
+
return void 0;
|
|
21222
|
+
}
|
|
21307
21223
|
};
|
|
21224
|
+
const makePayoutVerificationMethodsMetadata = (instantVerificationProviderName) => ({
|
|
21225
|
+
instantVerification: {
|
|
21226
|
+
name: "verifyViaMobileBankingAppOrWebsite",
|
|
21227
|
+
subtitle: "instant",
|
|
21228
|
+
description: "instantVerificationDescription",
|
|
21229
|
+
svgName: "payout-verification-instant",
|
|
21230
|
+
provider: instantVerificationProviderName ? {
|
|
21231
|
+
name: instantVerificationProviderName,
|
|
21232
|
+
svgName: getProviderIconName(instantVerificationProviderName)
|
|
21233
|
+
} : void 0
|
|
21234
|
+
},
|
|
21235
|
+
manualVerification: {
|
|
21236
|
+
name: "uploadABankStatement",
|
|
21237
|
+
subtitle: "mayTakeAFewDays",
|
|
21238
|
+
description: "manualVerificationDescription",
|
|
21239
|
+
svgName: "payout-verification-manual"
|
|
21240
|
+
}
|
|
21241
|
+
});
|
|
21308
21242
|
const payoutVerificationMethods = ["instantVerification", "manualVerification"];
|
|
21309
21243
|
function Card({
|
|
21310
21244
|
className,
|
|
@@ -21389,48 +21323,7 @@ const Skeleton = ({
|
|
|
21389
21323
|
});
|
|
21390
21324
|
return /* @__PURE__ */ jsx("div", { className: classNames, style: { height, width } });
|
|
21391
21325
|
};
|
|
21392
|
-
const isInstantVerificationAvailable = ({
|
|
21393
|
-
verificationVendorsCallback,
|
|
21394
|
-
provider
|
|
21395
|
-
}) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
|
|
21396
21326
|
const isProviderPlaidEmbedded = (redirectUrl) => !!(redirectUrl == null ? void 0 : redirectUrl.includes("/plaid/embedded-search/sdk?"));
|
|
21397
|
-
const rules$2 = ({ data, requiredFields }) => ({
|
|
21398
|
-
whenUsingManualVerification: () => {
|
|
21399
|
-
var _a;
|
|
21400
|
-
if (!data.payoutVerificationMethod) return;
|
|
21401
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
21402
|
-
return "REQUIRED";
|
|
21403
|
-
}
|
|
21404
|
-
},
|
|
21405
|
-
whenUsingInstantVerification: () => {
|
|
21406
|
-
var _a;
|
|
21407
|
-
if (!data.payoutVerificationMethod) {
|
|
21408
|
-
return "REQUIRED";
|
|
21409
|
-
}
|
|
21410
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
21411
|
-
return "REQUIRED";
|
|
21412
|
-
}
|
|
21413
|
-
},
|
|
21414
|
-
verifiedBankAccountNumber: () => {
|
|
21415
|
-
var _a;
|
|
21416
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
21417
|
-
return "REQUIRED";
|
|
21418
|
-
}
|
|
21419
|
-
},
|
|
21420
|
-
bankStatementRequirement: () => {
|
|
21421
|
-
var _a;
|
|
21422
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
21423
|
-
return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
|
|
21424
|
-
}
|
|
21425
|
-
},
|
|
21426
|
-
// "bankStatement description" field is always "optional" and it's coupled with bank statement document.
|
|
21427
|
-
bankStatementDescription: () => {
|
|
21428
|
-
var _a;
|
|
21429
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
|
|
21430
|
-
return "OPTIONAL";
|
|
21431
|
-
}
|
|
21432
|
-
}
|
|
21433
|
-
});
|
|
21434
21327
|
const preferInstantVerificationMethod = "adyen-kyc-prefer-instant-verification-method";
|
|
21435
21328
|
const preferInstantVerificationMethodCard = "adyen-kyc-prefer-instant-verification-method-card";
|
|
21436
21329
|
const preferInstantVerificationMethodImage = "adyen-kyc-prefer-instant-verification-method-image";
|
|
@@ -21451,18 +21344,6 @@ const styles$2 = {
|
|
|
21451
21344
|
"prefer-instant-verification-method-manual-button-darker": "adyen-kyc-prefer-instant-verification-method-manual-button-darker",
|
|
21452
21345
|
preferInstantVerificationMethodManualButtonDarker
|
|
21453
21346
|
};
|
|
21454
|
-
const getProviderIconName = (providerName) => {
|
|
21455
|
-
switch (providerName) {
|
|
21456
|
-
case "tink":
|
|
21457
|
-
return "tink-logo";
|
|
21458
|
-
case "trustly":
|
|
21459
|
-
return "trustly-logo";
|
|
21460
|
-
case "plaid":
|
|
21461
|
-
return "plaid-logo";
|
|
21462
|
-
default:
|
|
21463
|
-
return void 0;
|
|
21464
|
-
}
|
|
21465
|
-
};
|
|
21466
21347
|
const PreferInstantVerificationMethod = ({
|
|
21467
21348
|
loadingStatus,
|
|
21468
21349
|
provider,
|
|
@@ -21477,9 +21358,8 @@ const PreferInstantVerificationMethod = ({
|
|
|
21477
21358
|
handleChangeFor,
|
|
21478
21359
|
triggerValidation
|
|
21479
21360
|
}) => {
|
|
21480
|
-
var _a;
|
|
21481
21361
|
const { i18n } = useI18nContext();
|
|
21482
|
-
const iconName = getProviderIconName(
|
|
21362
|
+
const iconName = getProviderIconName(provider == null ? void 0 : provider.name);
|
|
21483
21363
|
const showVerificationWidget = isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl);
|
|
21484
21364
|
const [verificationComplete, setVerificationComplete] = useState(false);
|
|
21485
21365
|
const retrieveBankAccountInfo = async ({
|
|
@@ -21564,14 +21444,14 @@ const PayoutVerificationMethodOptionFooter = ({
|
|
|
21564
21444
|
const { provider } = methodsMetadata[method];
|
|
21565
21445
|
return provider ? /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "adyen-kyc-field-verification-methods__footer", children: [
|
|
21566
21446
|
i18n.get("poweredBy"),
|
|
21567
|
-
/* @__PURE__ */ jsx(
|
|
21447
|
+
provider.svgName ? /* @__PURE__ */ jsx(
|
|
21568
21448
|
Icon,
|
|
21569
21449
|
{
|
|
21570
21450
|
className: "adyen-kyc-field-verification-methods__logo",
|
|
21571
21451
|
name: provider.svgName,
|
|
21572
21452
|
alt: provider.name
|
|
21573
21453
|
}
|
|
21574
|
-
)
|
|
21454
|
+
) : provider.name
|
|
21575
21455
|
] }) : null;
|
|
21576
21456
|
};
|
|
21577
21457
|
const payoutVerificationMethodFields = ["payoutVerificationMethod", "bankCountry", ...accountVerificationFields];
|
|
@@ -21597,7 +21477,7 @@ function PayoutVerificationMethod(props) {
|
|
|
21597
21477
|
accountHolder,
|
|
21598
21478
|
provider,
|
|
21599
21479
|
bankVendorsLoadingStatus,
|
|
21600
|
-
|
|
21480
|
+
instantVerificationAvailable,
|
|
21601
21481
|
legalEntityResponse,
|
|
21602
21482
|
forms,
|
|
21603
21483
|
validators: validators2,
|
|
@@ -21624,6 +21504,7 @@ function PayoutVerificationMethod(props) {
|
|
|
21624
21504
|
SettingNames.AllowIntraRegionCrossBorderPayout
|
|
21625
21505
|
);
|
|
21626
21506
|
const [hasSelectedMethod, setHasSelectedMethod] = useState(false);
|
|
21507
|
+
const providerName = getProviderName(provider == null ? void 0 : provider.name);
|
|
21627
21508
|
const { handleChangeFor, data, valid, errors, fieldProblems, triggerValidation } = useForm({
|
|
21628
21509
|
...props,
|
|
21629
21510
|
schema: payoutVerificationMethodFields,
|
|
@@ -21644,14 +21525,8 @@ function PayoutVerificationMethod(props) {
|
|
|
21644
21525
|
);
|
|
21645
21526
|
useEffect(() => {
|
|
21646
21527
|
if (!enablePreferInstantVerificationMethodFlow) return;
|
|
21647
|
-
setHideFooter == null ? void 0 : setHideFooter(
|
|
21648
|
-
enablePreferInstantVerificationMethodFlow && isActiveForm && !bankInfoValidated
|
|
21649
|
-
);
|
|
21528
|
+
setHideFooter == null ? void 0 : setHideFooter(isActiveForm && !bankInfoValidated);
|
|
21650
21529
|
}, [enablePreferInstantVerificationMethodFlow, isActiveForm, bankInfoValidated, setHideFooter]);
|
|
21651
|
-
const instantVerificationAvailable = useMemo(
|
|
21652
|
-
() => Boolean(instantVerificationAllowed && (provider == null ? void 0 : provider.redirectUrl)),
|
|
21653
|
-
[instantVerificationAllowed, provider]
|
|
21654
|
-
);
|
|
21655
21530
|
const methodsMetadata = makePayoutVerificationMethodsMetadata(provider == null ? void 0 : provider.name);
|
|
21656
21531
|
const selectVerificationMethod = (method) => {
|
|
21657
21532
|
setHasSelectedMethod(true);
|
|
@@ -21817,18 +21692,18 @@ function PayoutVerificationMethod(props) {
|
|
|
21817
21692
|
id: "ariaErrorField"
|
|
21818
21693
|
}
|
|
21819
21694
|
),
|
|
21820
|
-
!enablePreferInstantVerificationMethodFlow &&
|
|
21695
|
+
!enablePreferInstantVerificationMethodFlow && providerName && bankVendorsLoadingStatus === "success" ? /* @__PURE__ */ jsx(
|
|
21821
21696
|
ContextGuidance,
|
|
21822
21697
|
{
|
|
21823
21698
|
page: "Instant verification with partner",
|
|
21824
21699
|
titleId: "howDoesVerificationWithOurPartnerWorks",
|
|
21825
21700
|
contentId: "bankVerificationWithPartnerSteps",
|
|
21826
21701
|
title: i18n.get("howDoesVerificationWithOurPartnerWorks", {
|
|
21827
|
-
values: { provider:
|
|
21702
|
+
values: { provider: providerName }
|
|
21828
21703
|
}),
|
|
21829
21704
|
content: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21830
21705
|
/* @__PURE__ */ jsx(Typography, { children: i18n.get("isOurTrustedPartnerHelpingSpeedUpSetup", {
|
|
21831
|
-
values: { provider:
|
|
21706
|
+
values: { provider: providerName }
|
|
21832
21707
|
}) }),
|
|
21833
21708
|
/* @__PURE__ */ jsxs(List, { children: [
|
|
21834
21709
|
/* @__PURE__ */ jsx(ListItem, { children: i18n.get("selectTheBankToReceivePayouts") }),
|
|
@@ -21878,8 +21753,7 @@ function PayoutDetailsComponent(props) {
|
|
|
21878
21753
|
associatedLegalArrangement,
|
|
21879
21754
|
provider,
|
|
21880
21755
|
bankVendorsLoadingStatus,
|
|
21881
|
-
|
|
21882
|
-
handleGetBankVerificationVendors,
|
|
21756
|
+
instantVerificationAvailable,
|
|
21883
21757
|
setHideDropinLayout,
|
|
21884
21758
|
setHideOnHomeButton,
|
|
21885
21759
|
setSkipSubmit,
|
|
@@ -21939,9 +21813,7 @@ function PayoutDetailsComponent(props) {
|
|
|
21939
21813
|
bankInfoValidated,
|
|
21940
21814
|
setBankInfoValidated,
|
|
21941
21815
|
handleNextClick,
|
|
21942
|
-
|
|
21943
|
-
instantVerificationEnabled && handleGetBankVerificationVendors
|
|
21944
|
-
),
|
|
21816
|
+
instantVerificationAvailable,
|
|
21945
21817
|
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
21946
21818
|
handleBankVerificationError: handleBankVerificationError2,
|
|
21947
21819
|
setBankVerificationError: setInstantVerificationError,
|
|
@@ -24044,13 +23916,13 @@ const useUnifyLoadingStatus = (setParentLoadingStatus, ...childLoadingStatuses)
|
|
|
24044
23916
|
setParentLoadingStatus(loadingStatus);
|
|
24045
23917
|
}, [...childLoadingStatuses]);
|
|
24046
23918
|
};
|
|
24047
|
-
const logger$
|
|
23919
|
+
const logger$p = createLogger("useScenarioConfiguration");
|
|
24048
23920
|
const useScenarioConfiguration = ({
|
|
24049
23921
|
getConfigurationData,
|
|
24050
23922
|
getPayoutAccountFormatData,
|
|
24051
23923
|
parseConfiguration: parseConfiguration2,
|
|
24052
23924
|
country,
|
|
24053
|
-
|
|
23925
|
+
instantVerificationAvailable,
|
|
24054
23926
|
setLoadingStatus,
|
|
24055
23927
|
existingBankAccountFormat
|
|
24056
23928
|
}) => {
|
|
@@ -24067,12 +23939,12 @@ const useScenarioConfiguration = ({
|
|
|
24067
23939
|
const response = await getConfigurationData();
|
|
24068
23940
|
setConfigurationResponse(response);
|
|
24069
23941
|
} catch (err) {
|
|
24070
|
-
logger$
|
|
23942
|
+
logger$p.warn("WARNING: Configuration request failed - error:", err);
|
|
24071
23943
|
} finally {
|
|
24072
23944
|
setConfigurationLoadingStatus("success");
|
|
24073
23945
|
}
|
|
24074
23946
|
};
|
|
24075
|
-
makeConfigCallAndSave().catch(logger$
|
|
23947
|
+
makeConfigCallAndSave().catch(logger$p.error);
|
|
24076
23948
|
}, [getConfigurationData, setConfigurationLoadingStatus]);
|
|
24077
23949
|
useEffect(() => {
|
|
24078
23950
|
if (!getPayoutAccountFormatData) return;
|
|
@@ -24091,12 +23963,12 @@ const useScenarioConfiguration = ({
|
|
|
24091
23963
|
const defaultAccountFormat = defaultPayoutAccountFormat[country] ?? allowedBankAccountFormats[0];
|
|
24092
23964
|
setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
|
|
24093
23965
|
} catch (err) {
|
|
24094
|
-
logger$
|
|
23966
|
+
logger$p.warn("WARNING: Payout format request failed - error:", err);
|
|
24095
23967
|
} finally {
|
|
24096
23968
|
setpayoutFormatLoadingStatus("success");
|
|
24097
23969
|
}
|
|
24098
23970
|
};
|
|
24099
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
23971
|
+
makePayoutFormatCallAndSave().catch(logger$p.error);
|
|
24100
23972
|
}, [
|
|
24101
23973
|
country,
|
|
24102
23974
|
setAccountFormat,
|
|
@@ -24106,14 +23978,14 @@ const useScenarioConfiguration = ({
|
|
|
24106
23978
|
]);
|
|
24107
23979
|
const { fieldConfigurations, requiredFields } = useMemo(() => {
|
|
24108
23980
|
if (!configurationResponse) return {};
|
|
24109
|
-
const { matchingScenario
|
|
23981
|
+
const { matchingScenario } = configurationResponse;
|
|
24110
23982
|
const payoutRequiredFields = accountFormatResponse && accountFormat ? accountFormatResponse[accountFormat] : void 0;
|
|
24111
23983
|
const scenarioConfig = parseConfiguration2(
|
|
24112
23984
|
payoutRequiredFields ? {
|
|
24113
23985
|
matchingScenario,
|
|
24114
23986
|
country,
|
|
24115
23987
|
requiredFields: payoutRequiredFields,
|
|
24116
|
-
bankVerificationAvailable:
|
|
23988
|
+
bankVerificationAvailable: instantVerificationAvailable
|
|
24117
23989
|
} : {
|
|
24118
23990
|
matchingScenario,
|
|
24119
23991
|
country,
|
|
@@ -24131,7 +24003,7 @@ const useScenarioConfiguration = ({
|
|
|
24131
24003
|
configurationResponse,
|
|
24132
24004
|
country,
|
|
24133
24005
|
parseConfiguration2,
|
|
24134
|
-
|
|
24006
|
+
instantVerificationAvailable
|
|
24135
24007
|
]);
|
|
24136
24008
|
return {
|
|
24137
24009
|
requiredFields,
|
|
@@ -25692,7 +25564,7 @@ function BusinessInformationCard({
|
|
|
25692
25564
|
}
|
|
25693
25565
|
);
|
|
25694
25566
|
}
|
|
25695
|
-
const logger$
|
|
25567
|
+
const logger$o = createLogger("BusinessSelection");
|
|
25696
25568
|
function BusinessSelectionComponent({
|
|
25697
25569
|
showCompanyStructure,
|
|
25698
25570
|
searching,
|
|
@@ -25744,7 +25616,7 @@ function BusinessSelectionComponent({
|
|
|
25744
25616
|
setCurrentBusinessSelection(businessData);
|
|
25745
25617
|
}
|
|
25746
25618
|
} catch (e) {
|
|
25747
|
-
logger$
|
|
25619
|
+
logger$o.error(e);
|
|
25748
25620
|
}
|
|
25749
25621
|
},
|
|
25750
25622
|
[basicInformation == null ? void 0 : basicInformation.stateOrProvince, fetchBusinessData, fetching, selectedBusinessId]
|
|
@@ -25758,7 +25630,7 @@ function BusinessSelectionComponent({
|
|
|
25758
25630
|
handleNextClick == null ? void 0 : handleNextClick();
|
|
25759
25631
|
}
|
|
25760
25632
|
} catch (e) {
|
|
25761
|
-
logger$
|
|
25633
|
+
logger$o.error(e);
|
|
25762
25634
|
}
|
|
25763
25635
|
},
|
|
25764
25636
|
[currentTin, handleNextClick, handleBusinessVerification]
|
|
@@ -25945,7 +25817,7 @@ function BasicInformationComponent({
|
|
|
25945
25817
|
const { i18n } = useI18nContext();
|
|
25946
25818
|
const { isSettingEnabled } = useSettingsContext();
|
|
25947
25819
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
25948
|
-
const allowedCountries =
|
|
25820
|
+
const { allowedCountries } = useCoreContext();
|
|
25949
25821
|
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
25950
25822
|
const formDescription = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-header__description", children: [
|
|
25951
25823
|
description,
|
|
@@ -26868,7 +26740,7 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
|
|
|
26868
26740
|
DecisionMakerType.SIGNATORY,
|
|
26869
26741
|
DecisionMakerType.CONTROLLING_PERSON
|
|
26870
26742
|
];
|
|
26871
|
-
const rules$
|
|
26743
|
+
const rules$2 = ({
|
|
26872
26744
|
data,
|
|
26873
26745
|
country,
|
|
26874
26746
|
taskType,
|
|
@@ -27343,7 +27215,7 @@ const useExpiryThreshold = (expiry) => {
|
|
|
27343
27215
|
return { expiryStatus: "notYetCloseToExpiry", secondsUntilExpiry: void 0 };
|
|
27344
27216
|
};
|
|
27345
27217
|
const ExpiryContext = createContext(false);
|
|
27346
|
-
const logger$
|
|
27218
|
+
const logger$n = createLogger("ExpiryProvider");
|
|
27347
27219
|
const ExpiryProvider = ({
|
|
27348
27220
|
expiry: initialExpiry,
|
|
27349
27221
|
eventEmitter,
|
|
@@ -27372,7 +27244,7 @@ const ExpiryProvider = ({
|
|
|
27372
27244
|
refreshExpiry().then((newExpiry) => {
|
|
27373
27245
|
setExpiry(newExpiry);
|
|
27374
27246
|
setModalDismissed(false);
|
|
27375
|
-
}).catch(logger$
|
|
27247
|
+
}).catch(logger$n.error);
|
|
27376
27248
|
}
|
|
27377
27249
|
}
|
|
27378
27250
|
),
|
|
@@ -27394,7 +27266,7 @@ const ExpiryProvider = ({
|
|
|
27394
27266
|
return /* @__PURE__ */ jsx(ExpiryContext.Provider, { value: expiryStatus === "expired", children });
|
|
27395
27267
|
};
|
|
27396
27268
|
const useHasExpired = () => useContext(ExpiryContext);
|
|
27397
|
-
const logger$
|
|
27269
|
+
const logger$m = createLogger("FormRouterContextProvider");
|
|
27398
27270
|
function FormRouterContextProvider({
|
|
27399
27271
|
children,
|
|
27400
27272
|
forms,
|
|
@@ -27417,7 +27289,7 @@ function FormRouterContextProvider({
|
|
|
27417
27289
|
if (formIndex > -1) {
|
|
27418
27290
|
setFormIndex(formIndex);
|
|
27419
27291
|
} else {
|
|
27420
|
-
logger$
|
|
27292
|
+
logger$m.error("No form was found to have that field so form navigation failed.");
|
|
27421
27293
|
}
|
|
27422
27294
|
}
|
|
27423
27295
|
}),
|
|
@@ -29108,7 +28980,7 @@ function CompanyDropinComponent({
|
|
|
29108
28980
|
}
|
|
29109
28981
|
const IgnoreLocalStorageContext = createContext(false);
|
|
29110
28982
|
const useIgnoreLocalStorage = () => useContext(IgnoreLocalStorageContext);
|
|
29111
|
-
const logger$
|
|
28983
|
+
const logger$l = createLogger("useLocalStorage");
|
|
29112
28984
|
const useLocalStorage = (key, defaultValue, options) => {
|
|
29113
28985
|
const { serializer, parser, syncData } = useMemo(
|
|
29114
28986
|
() => ({
|
|
@@ -29128,7 +29000,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29128
29000
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
29129
29001
|
return res;
|
|
29130
29002
|
} catch (err) {
|
|
29131
|
-
logger$
|
|
29003
|
+
logger$l.error(err);
|
|
29132
29004
|
return defaultValue;
|
|
29133
29005
|
}
|
|
29134
29006
|
});
|
|
@@ -29163,7 +29035,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29163
29035
|
try {
|
|
29164
29036
|
updateLocalStorage();
|
|
29165
29037
|
} catch (err) {
|
|
29166
|
-
logger$
|
|
29038
|
+
logger$l.error(err);
|
|
29167
29039
|
}
|
|
29168
29040
|
}, [value, ignoreLocalStorage]);
|
|
29169
29041
|
useEffect(() => {
|
|
@@ -29176,7 +29048,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29176
29048
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
29177
29049
|
}
|
|
29178
29050
|
} catch (err) {
|
|
29179
|
-
logger$
|
|
29051
|
+
logger$l.error(err);
|
|
29180
29052
|
}
|
|
29181
29053
|
};
|
|
29182
29054
|
if (ignoreLocalStorage) return;
|
|
@@ -29360,7 +29232,7 @@ const useSingpassMyInfoLogin = ({
|
|
|
29360
29232
|
trustedEntityAssociations
|
|
29361
29233
|
};
|
|
29362
29234
|
};
|
|
29363
|
-
const logger$
|
|
29235
|
+
const logger$k = createLogger("useAssociatedLegalArrangement");
|
|
29364
29236
|
function useAssociatedLegalArrangement({
|
|
29365
29237
|
rootLegalEntity,
|
|
29366
29238
|
getLegalEntity: getLegalEntity2
|
|
@@ -29376,7 +29248,7 @@ function useAssociatedLegalArrangement({
|
|
|
29376
29248
|
(entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST
|
|
29377
29249
|
);
|
|
29378
29250
|
if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
|
|
29379
|
-
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$
|
|
29251
|
+
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$k.error);
|
|
29380
29252
|
}
|
|
29381
29253
|
}, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
|
|
29382
29254
|
useEffect(() => {
|
|
@@ -29426,7 +29298,7 @@ const useCanSeeEntitySelection = (legalEntityId) => {
|
|
|
29426
29298
|
setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
|
|
29427
29299
|
};
|
|
29428
29300
|
};
|
|
29429
|
-
const logger$
|
|
29301
|
+
const logger$j = createLogger("useExemptSettlor");
|
|
29430
29302
|
const useExemptSettlor = ({
|
|
29431
29303
|
trust,
|
|
29432
29304
|
handleGetLegalEntity
|
|
@@ -29444,7 +29316,7 @@ const useExemptSettlor = ({
|
|
|
29444
29316
|
);
|
|
29445
29317
|
useEffect(() => {
|
|
29446
29318
|
if (!(trust == null ? void 0 : trust.trust)) return;
|
|
29447
|
-
updateExemptSettlor(trust).catch(logger$
|
|
29319
|
+
updateExemptSettlor(trust).catch(logger$j.error);
|
|
29448
29320
|
}, [trust, updateExemptSettlor]);
|
|
29449
29321
|
return exemptSettlor;
|
|
29450
29322
|
};
|
|
@@ -30958,6 +30830,7 @@ const useIntroductionScreens = ({ legalEntity, tasks }) => {
|
|
|
30958
30830
|
);
|
|
30959
30831
|
return canSeeIntroduction && (introductionScreens == null ? void 0 : introductionScreens.length) > 0 ? [IntroductionScreens.PROLOGUE, ...introductionScreens, IntroductionScreens.EPILOGUE] : void 0;
|
|
30960
30832
|
};
|
|
30833
|
+
const toCapitalized = (s) => `${s[0].toUpperCase()}${s.slice(1).toLowerCase()}`;
|
|
30961
30834
|
const toPascalCase = (s) => s.split(/[^A-Za-z]/).map((word) => toCapitalized(word)).join("");
|
|
30962
30835
|
var IntroductionScreenTranslationKeyElements = /* @__PURE__ */ ((IntroductionScreenTranslationKeyElements2) => {
|
|
30963
30836
|
IntroductionScreenTranslationKeyElements2["ListItem"] = "LI";
|
|
@@ -31468,6 +31341,14 @@ const SingpassSelection = (props) => {
|
|
|
31468
31341
|
)
|
|
31469
31342
|
] }) });
|
|
31470
31343
|
};
|
|
31344
|
+
const useSetting = (settingName) => {
|
|
31345
|
+
const context = useContext(SettingsContext);
|
|
31346
|
+
if (context === void 0) {
|
|
31347
|
+
throw new Error("useSetting must be used within a SettingsProvider");
|
|
31348
|
+
}
|
|
31349
|
+
const { getSetting } = context;
|
|
31350
|
+
return getSetting(settingName);
|
|
31351
|
+
};
|
|
31471
31352
|
const businessTypeMapping = {
|
|
31472
31353
|
myName: {
|
|
31473
31354
|
[LegalEntityType.INDIVIDUAL]: "individual"
|
|
@@ -32510,7 +32391,7 @@ function IndividualDropinComponent({
|
|
|
32510
32391
|
country
|
|
32511
32392
|
});
|
|
32512
32393
|
const fieldsFromCustomRules = useMemo(
|
|
32513
|
-
() => rules$
|
|
32394
|
+
() => rules$2({
|
|
32514
32395
|
data,
|
|
32515
32396
|
country,
|
|
32516
32397
|
taskType,
|
|
@@ -32974,7 +32855,7 @@ function IndividualDropinComponent({
|
|
|
32974
32855
|
}
|
|
32975
32856
|
);
|
|
32976
32857
|
}
|
|
32977
|
-
const logger$
|
|
32858
|
+
const logger$i = createLogger("useBankConfigurationHandler");
|
|
32978
32859
|
const useBankConfigurationHandlers = ({
|
|
32979
32860
|
handleGetBankVerificationVendors,
|
|
32980
32861
|
bankAccountCountry,
|
|
@@ -32992,7 +32873,7 @@ const useBankConfigurationHandlers = ({
|
|
|
32992
32873
|
const bankVerificationVendorsResponse = handleGetBankVerificationVendors ? await handleGetBankVerificationVendors(bankAccountCountry) : [];
|
|
32993
32874
|
setProvider(bankVerificationVendorsResponse == null ? void 0 : bankVerificationVendorsResponse[0]);
|
|
32994
32875
|
})().catch(() => {
|
|
32995
|
-
logger$
|
|
32876
|
+
logger$i.error();
|
|
32996
32877
|
setProvider(void 0);
|
|
32997
32878
|
}).finally(() => {
|
|
32998
32879
|
setLoadingStatus("success");
|
|
@@ -33005,17 +32886,14 @@ const useBankConfigurationHandlers = ({
|
|
|
33005
32886
|
handleGetBankVerificationVendors,
|
|
33006
32887
|
bankAccountCountry
|
|
33007
32888
|
]);
|
|
33008
|
-
const getConfigurationData = useCallback(
|
|
33009
|
-
|
|
32889
|
+
const getConfigurationData = useCallback(
|
|
32890
|
+
() => getConfiguration2({
|
|
33010
32891
|
legalEntityType,
|
|
33011
32892
|
capabilities,
|
|
33012
32893
|
country: bankAccountCountry
|
|
33013
|
-
})
|
|
33014
|
-
|
|
33015
|
-
|
|
33016
|
-
provider
|
|
33017
|
-
};
|
|
33018
|
-
}, [getConfiguration2, legalEntityType, bankAccountCountry, capabilities, provider]);
|
|
32894
|
+
}),
|
|
32895
|
+
[getConfiguration2, legalEntityType, bankAccountCountry, capabilities]
|
|
32896
|
+
);
|
|
33019
32897
|
return {
|
|
33020
32898
|
getConfigurationData,
|
|
33021
32899
|
provider
|
|
@@ -33029,6 +32907,43 @@ const getAccountFormatsForCountry = async (country) => {
|
|
|
33029
32907
|
}
|
|
33030
32908
|
return (await importForCountry()).default;
|
|
33031
32909
|
};
|
|
32910
|
+
const rules$1 = ({ data, requiredFields }) => ({
|
|
32911
|
+
whenUsingManualVerification: () => {
|
|
32912
|
+
var _a;
|
|
32913
|
+
if (!data.payoutVerificationMethod) return;
|
|
32914
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
32915
|
+
return "REQUIRED";
|
|
32916
|
+
}
|
|
32917
|
+
},
|
|
32918
|
+
whenUsingInstantVerification: () => {
|
|
32919
|
+
var _a;
|
|
32920
|
+
if (!data.payoutVerificationMethod) {
|
|
32921
|
+
return "REQUIRED";
|
|
32922
|
+
}
|
|
32923
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
32924
|
+
return "REQUIRED";
|
|
32925
|
+
}
|
|
32926
|
+
},
|
|
32927
|
+
verifiedBankAccountNumber: () => {
|
|
32928
|
+
var _a;
|
|
32929
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
32930
|
+
return "REQUIRED";
|
|
32931
|
+
}
|
|
32932
|
+
},
|
|
32933
|
+
bankStatementRequirement: () => {
|
|
32934
|
+
var _a;
|
|
32935
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
32936
|
+
return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
|
|
32937
|
+
}
|
|
32938
|
+
},
|
|
32939
|
+
// "bankStatement description" field is always "optional" and it's coupled with bank statement document.
|
|
32940
|
+
bankStatementDescription: () => {
|
|
32941
|
+
var _a;
|
|
32942
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
|
|
32943
|
+
return "OPTIONAL";
|
|
32944
|
+
}
|
|
32945
|
+
}
|
|
32946
|
+
});
|
|
33032
32947
|
const labels = () => ({
|
|
33033
32948
|
verifiedAccountHolder: () => "accountHolder",
|
|
33034
32949
|
verifiedBankCountry: () => "bankCountry",
|
|
@@ -33106,7 +33021,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33106
33021
|
const existingPayoutDetails = transferInstrument ? mapTransferInstrumentToPayoutAccount(transferInstrument) : void 0;
|
|
33107
33022
|
const [documents, setDocuments] = useState();
|
|
33108
33023
|
const [newTransferInstrumentId, setNewTransferInstrumentId] = useState();
|
|
33109
|
-
const [useFreshProviderRedirectUrl, setUseFreshProviderRedirectUrl] = useState(
|
|
33024
|
+
const [useFreshProviderRedirectUrl, setUseFreshProviderRedirectUrl] = useState(false);
|
|
33110
33025
|
const fallbackCurrency = (_a = currencyByCountry[defaultPayoutCountry]) == null ? void 0 : _a[0];
|
|
33111
33026
|
const accountHolderName = accountHolder || getLegalEntityNameBasedOnType(legalEntityResponse);
|
|
33112
33027
|
const instantVerificationEnabled = Boolean(
|
|
@@ -33170,6 +33085,10 @@ function PayoutDetailsDropinComponent({
|
|
|
33170
33085
|
useFreshProviderRedirectUrl,
|
|
33171
33086
|
setUseFreshProviderRedirectUrl
|
|
33172
33087
|
});
|
|
33088
|
+
const instantVerificationAvailable = useMemo(
|
|
33089
|
+
() => Boolean(instantVerificationEnabled && (provider == null ? void 0 : provider.redirectUrl)),
|
|
33090
|
+
[instantVerificationEnabled, provider == null ? void 0 : provider.redirectUrl]
|
|
33091
|
+
);
|
|
33173
33092
|
const getPayoutAccountFormatData = useCallback(
|
|
33174
33093
|
async () => getAccountFormatsForCountry(bankAccountCountry ?? defaultPayoutCountry),
|
|
33175
33094
|
[bankAccountCountry]
|
|
@@ -33178,13 +33097,13 @@ function PayoutDetailsDropinComponent({
|
|
|
33178
33097
|
parseConfiguration: parseConfiguration$3,
|
|
33179
33098
|
getConfigurationData,
|
|
33180
33099
|
getPayoutAccountFormatData,
|
|
33181
|
-
|
|
33100
|
+
instantVerificationAvailable,
|
|
33182
33101
|
setLoadingStatus: setConfigurationLoadingStatus,
|
|
33183
33102
|
country: bankAccountCountry ?? defaultPayoutCountry,
|
|
33184
33103
|
existingBankAccountFormat
|
|
33185
33104
|
});
|
|
33186
33105
|
const fieldsFromCustomRules = useMemo(
|
|
33187
|
-
() => rules$
|
|
33106
|
+
() => rules$1({
|
|
33188
33107
|
data,
|
|
33189
33108
|
country: bankAccountCountry ?? defaultPayoutCountry,
|
|
33190
33109
|
taskType,
|
|
@@ -33202,10 +33121,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33202
33121
|
var _a2;
|
|
33203
33122
|
return getAppropriatePayoutDetailsSteps(
|
|
33204
33123
|
Boolean((_a2 = prefilledData == null ? void 0 : prefilledData.payoutAccountDetails) == null ? void 0 : _a2.transferInstrumentId),
|
|
33205
|
-
|
|
33206
|
-
provider,
|
|
33207
|
-
verificationVendorsCallback: handleGetBankVerificationVendors
|
|
33208
|
-
}),
|
|
33124
|
+
instantVerificationAvailable,
|
|
33209
33125
|
isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
|
|
33210
33126
|
showWidgetInVerificationMethodStep
|
|
33211
33127
|
);
|
|
@@ -33510,8 +33426,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33510
33426
|
associatedLegalArrangement,
|
|
33511
33427
|
provider,
|
|
33512
33428
|
bankVendorsLoadingStatus,
|
|
33513
|
-
|
|
33514
|
-
instantVerificationEnabled,
|
|
33429
|
+
instantVerificationAvailable,
|
|
33515
33430
|
refreshLegalEntity,
|
|
33516
33431
|
shouldValidate,
|
|
33517
33432
|
createTrustedTransferInstrument: createTrustedTransferInstrumentHandler,
|
|
@@ -34445,7 +34360,7 @@ const serviceAgreementValidationRules = {
|
|
|
34445
34360
|
errorMessage: "fieldIsRequired"
|
|
34446
34361
|
}
|
|
34447
34362
|
};
|
|
34448
|
-
const logger$
|
|
34363
|
+
const logger$h = createLogger("useServiceAgreement");
|
|
34449
34364
|
const FALLBACK_LANGUAGE_CODE$1 = "en";
|
|
34450
34365
|
const useServiceAgreement = ({
|
|
34451
34366
|
handleGetServiceAgreement,
|
|
@@ -34475,7 +34390,7 @@ const useServiceAgreement = ({
|
|
|
34475
34390
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
34476
34391
|
setServiceAgreement({ id, contract });
|
|
34477
34392
|
};
|
|
34478
|
-
requestAcceptedServiceAgreement().catch(logger$
|
|
34393
|
+
requestAcceptedServiceAgreement().catch(logger$h.error).finally(() => setLoading("success"));
|
|
34479
34394
|
}, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
|
|
34480
34395
|
useEffect(() => {
|
|
34481
34396
|
const requestServiceAgreement = async () => {
|
|
@@ -34490,7 +34405,7 @@ const useServiceAgreement = ({
|
|
|
34490
34405
|
}
|
|
34491
34406
|
);
|
|
34492
34407
|
if (!document2) {
|
|
34493
|
-
logger$
|
|
34408
|
+
logger$h.log('"document" field was missing in response');
|
|
34494
34409
|
return;
|
|
34495
34410
|
}
|
|
34496
34411
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
@@ -34505,7 +34420,7 @@ const useServiceAgreement = ({
|
|
|
34505
34420
|
throw err;
|
|
34506
34421
|
}
|
|
34507
34422
|
};
|
|
34508
|
-
requestServiceAgreement().catch(logger$
|
|
34423
|
+
requestServiceAgreement().catch(logger$h.error);
|
|
34509
34424
|
}, [
|
|
34510
34425
|
handleGetServiceAgreement,
|
|
34511
34426
|
handleServiceAgreementIsNotAvailableInThatLanguage,
|
|
@@ -34529,7 +34444,7 @@ const serviceAgreementTypesTranslationMapping = {
|
|
|
34529
34444
|
adyenPccr: "pccr",
|
|
34530
34445
|
adyenChargeCard: "chargeCardUserAgreement"
|
|
34531
34446
|
};
|
|
34532
|
-
const logger$
|
|
34447
|
+
const logger$g = createLogger("ServiceAgreementDropinComponent");
|
|
34533
34448
|
const FALLBACK_LANGUAGE_CODE = "en";
|
|
34534
34449
|
function ServiceAgreementDropinComponent({
|
|
34535
34450
|
legalEntityResponse,
|
|
@@ -34708,7 +34623,7 @@ function ServiceAgreementDropinComponent({
|
|
|
34708
34623
|
await requestAndDownload(i18n.languageCode);
|
|
34709
34624
|
} catch (e) {
|
|
34710
34625
|
if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
|
|
34711
|
-
await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$
|
|
34626
|
+
await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$g.error);
|
|
34712
34627
|
return;
|
|
34713
34628
|
}
|
|
34714
34629
|
showToast({
|
|
@@ -35654,10 +35569,9 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
|
35654
35569
|
return hasOwnEntityAssocation || !!hasOrganizationType;
|
|
35655
35570
|
};
|
|
35656
35571
|
const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
35657
|
-
const logger$
|
|
35572
|
+
const logger$f = createLogger("DropinComposerComponent");
|
|
35658
35573
|
const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country) => country === CountryCodes.Australia && enabled;
|
|
35659
35574
|
function DropinComposerComponent({
|
|
35660
|
-
capabilities,
|
|
35661
35575
|
legalEntityResponse,
|
|
35662
35576
|
onSubmit,
|
|
35663
35577
|
onChange,
|
|
@@ -35682,6 +35596,7 @@ function DropinComposerComponent({
|
|
|
35682
35596
|
});
|
|
35683
35597
|
const [tasks, setTasks] = useState([]);
|
|
35684
35598
|
const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
|
|
35599
|
+
const capabilities = useMemo(() => getCapabilities(rootLegalEntity), [rootLegalEntity]);
|
|
35685
35600
|
const {
|
|
35686
35601
|
isEligibleForSingpass,
|
|
35687
35602
|
state: singpassLoginState,
|
|
@@ -35761,7 +35676,7 @@ function DropinComposerComponent({
|
|
|
35761
35676
|
setPciStatus(response);
|
|
35762
35677
|
return response;
|
|
35763
35678
|
} catch (e) {
|
|
35764
|
-
logger$
|
|
35679
|
+
logger$f.warn(i18n.get("failedToGetPciStatus"));
|
|
35765
35680
|
}
|
|
35766
35681
|
}
|
|
35767
35682
|
return void 0;
|
|
@@ -35789,7 +35704,7 @@ function DropinComposerComponent({
|
|
|
35789
35704
|
}, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
|
|
35790
35705
|
useEffect(() => {
|
|
35791
35706
|
if (!tasks.includes(TaskTypes.PCI_DSS)) return;
|
|
35792
|
-
getPciTemplate().catch(logger$
|
|
35707
|
+
getPciTemplate().catch(logger$f.error);
|
|
35793
35708
|
}, [getPciTemplate, tasks]);
|
|
35794
35709
|
const addFetchedAcceptedByName = async (acceptanceInfo) => {
|
|
35795
35710
|
try {
|
|
@@ -35799,7 +35714,7 @@ function DropinComposerComponent({
|
|
|
35799
35714
|
acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
|
|
35800
35715
|
};
|
|
35801
35716
|
} catch (e) {
|
|
35802
|
-
logger$
|
|
35717
|
+
logger$f.warn(i18n.get("failedToFetchAcceptedByName"));
|
|
35803
35718
|
return {
|
|
35804
35719
|
...acceptanceInfo,
|
|
35805
35720
|
acceptedByName: null
|
|
@@ -35813,7 +35728,7 @@ function DropinComposerComponent({
|
|
|
35813
35728
|
const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
|
|
35814
35729
|
setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
|
|
35815
35730
|
} catch (e) {
|
|
35816
|
-
logger$
|
|
35731
|
+
logger$f.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
35817
35732
|
}
|
|
35818
35733
|
}
|
|
35819
35734
|
};
|
|
@@ -35823,7 +35738,7 @@ function DropinComposerComponent({
|
|
|
35823
35738
|
const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
|
|
35824
35739
|
setServiceAgreementTypes(response.termsOfServiceTypes);
|
|
35825
35740
|
} catch (e) {
|
|
35826
|
-
logger$
|
|
35741
|
+
logger$f.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
35827
35742
|
}
|
|
35828
35743
|
}
|
|
35829
35744
|
};
|
|
@@ -35853,7 +35768,7 @@ function DropinComposerComponent({
|
|
|
35853
35768
|
try {
|
|
35854
35769
|
return await args.handleGetLegalEntity(rootLegalEntity.id);
|
|
35855
35770
|
} catch (e) {
|
|
35856
|
-
logger$
|
|
35771
|
+
logger$f.warn("Failed to fetch legal entity details", e);
|
|
35857
35772
|
}
|
|
35858
35773
|
}
|
|
35859
35774
|
return void 0;
|
|
@@ -35909,7 +35824,7 @@ function DropinComposerComponent({
|
|
|
35909
35824
|
await refreshAssociatedLegalArrangement();
|
|
35910
35825
|
showToast({ type: "success", label: i18n.get("successFullyRemovedTrustMember") });
|
|
35911
35826
|
} catch (err) {
|
|
35912
|
-
logger$
|
|
35827
|
+
logger$f.error(`Failed to delete trust member`, err);
|
|
35913
35828
|
showToast({ type: "error", label: i18n.get("failedToRemoveTrustMember") });
|
|
35914
35829
|
}
|
|
35915
35830
|
};
|
|
@@ -35976,14 +35891,14 @@ function DropinComposerComponent({
|
|
|
35976
35891
|
}
|
|
35977
35892
|
break;
|
|
35978
35893
|
default:
|
|
35979
|
-
logger$
|
|
35894
|
+
logger$f.warn(
|
|
35980
35895
|
`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`
|
|
35981
35896
|
);
|
|
35982
35897
|
}
|
|
35983
35898
|
showToast({ label: i18n.get("successfullyUpdatedDetails"), type: "success" });
|
|
35984
35899
|
await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
|
|
35985
35900
|
} catch (err) {
|
|
35986
|
-
logger$
|
|
35901
|
+
logger$f.error(err);
|
|
35987
35902
|
showToast({ label: i18n.get("failedToUpdateDetails"), type: "error" });
|
|
35988
35903
|
}
|
|
35989
35904
|
};
|
|
@@ -35995,7 +35910,7 @@ function DropinComposerComponent({
|
|
|
35995
35910
|
singpassTabRef.current = window.open(authUrl, "_blank");
|
|
35996
35911
|
singpassTabRef.current.focus();
|
|
35997
35912
|
} catch (e) {
|
|
35998
|
-
logger$
|
|
35913
|
+
logger$f.error(e);
|
|
35999
35914
|
handleSingpassMyInfoLoginFailure(e);
|
|
36000
35915
|
}
|
|
36001
35916
|
}
|
|
@@ -36173,7 +36088,7 @@ function DropinComposerComponent({
|
|
|
36173
36088
|
const fetchConfiguration = async () => {
|
|
36174
36089
|
const data = await getConfiguration2({
|
|
36175
36090
|
country: contextCountry,
|
|
36176
|
-
capabilities,
|
|
36091
|
+
capabilities: args == null ? void 0 : args.capabilities,
|
|
36177
36092
|
legalEntityType: rootLegalEntity.type
|
|
36178
36093
|
});
|
|
36179
36094
|
if (data == null ? void 0 : data.taskList) {
|
|
@@ -36186,7 +36101,7 @@ function DropinComposerComponent({
|
|
|
36186
36101
|
}
|
|
36187
36102
|
};
|
|
36188
36103
|
setIsLoadingConfiguration(true);
|
|
36189
|
-
fetchConfiguration().catch(logger$
|
|
36104
|
+
fetchConfiguration().catch(logger$f.error).finally(() => {
|
|
36190
36105
|
setIsLoadingConfiguration(false);
|
|
36191
36106
|
onLoad();
|
|
36192
36107
|
});
|
|
@@ -36223,7 +36138,7 @@ function DropinComposerComponent({
|
|
|
36223
36138
|
singpassTabRef.current = window.open(authUrl);
|
|
36224
36139
|
singpassTabRef.current.focus();
|
|
36225
36140
|
} catch (e) {
|
|
36226
|
-
logger$
|
|
36141
|
+
logger$f.error(e);
|
|
36227
36142
|
handleSingpassMyInfoLoginFailure(e);
|
|
36228
36143
|
}
|
|
36229
36144
|
},
|
|
@@ -36334,7 +36249,7 @@ function DropinComposerComponent({
|
|
|
36334
36249
|
legalEntityResponse: rootLegalEntity,
|
|
36335
36250
|
country: rootLegalEntityCountry,
|
|
36336
36251
|
problems: getLegalEntityProblems(rootLegalEntity),
|
|
36337
|
-
capabilities
|
|
36252
|
+
capabilities,
|
|
36338
36253
|
onChange: componentOnChange,
|
|
36339
36254
|
onSubmit: async (data) => {
|
|
36340
36255
|
onSubmit == null ? void 0 : onSubmit(data);
|
|
@@ -36380,7 +36295,7 @@ function DropinComposerComponent({
|
|
|
36380
36295
|
legalEntityResponse: associatedLegalEntity,
|
|
36381
36296
|
country: rootLegalEntityCountry,
|
|
36382
36297
|
problems: getLegalEntityProblems(associatedLegalEntity),
|
|
36383
|
-
capabilities
|
|
36298
|
+
capabilities,
|
|
36384
36299
|
onChange: componentOnChange,
|
|
36385
36300
|
onSubmit: componentOnSubmit,
|
|
36386
36301
|
handleHomeClick: navigateBack,
|
|
@@ -36412,7 +36327,7 @@ function DropinComposerComponent({
|
|
|
36412
36327
|
legalEntityResponse: associatedLegalEntity,
|
|
36413
36328
|
problems: getLegalEntityProblems(associatedLegalEntity),
|
|
36414
36329
|
country: rootLegalEntityCountry,
|
|
36415
|
-
capabilities
|
|
36330
|
+
capabilities,
|
|
36416
36331
|
onChange: componentOnChange,
|
|
36417
36332
|
onSubmit: async (data) => {
|
|
36418
36333
|
await refreshAssociatedLegalArrangement();
|
|
@@ -36443,7 +36358,7 @@ function DropinComposerComponent({
|
|
|
36443
36358
|
legalEntityResponse: associatedLegalEntity,
|
|
36444
36359
|
country: rootLegalEntityCountry,
|
|
36445
36360
|
problems: getLegalEntityProblems(associatedLegalEntity),
|
|
36446
|
-
capabilities
|
|
36361
|
+
capabilities,
|
|
36447
36362
|
onChange: componentOnChange,
|
|
36448
36363
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
|
|
36449
36364
|
handleBackClick: navigateBack,
|
|
@@ -36472,7 +36387,7 @@ function DropinComposerComponent({
|
|
|
36472
36387
|
taskType: TaskTypes.COMPANY,
|
|
36473
36388
|
taskName: hasTrust ? "companyTrusteeDetails" : "companyDetails",
|
|
36474
36389
|
legalEntityResponse: rootLegalEntity,
|
|
36475
|
-
capabilities
|
|
36390
|
+
capabilities,
|
|
36476
36391
|
problems: getLegalEntityProblems(rootLegalEntity),
|
|
36477
36392
|
onChange: componentOnChange,
|
|
36478
36393
|
onSubmit: async (data) => {
|
|
@@ -36501,7 +36416,7 @@ function DropinComposerComponent({
|
|
|
36501
36416
|
taskType: TaskTypes.BUSINESS_DETAILS,
|
|
36502
36417
|
taskName: hasTrust ? "businessTrusteeDetails" : "businessDetails",
|
|
36503
36418
|
legalEntityResponse: rootLegalEntity,
|
|
36504
|
-
capabilities
|
|
36419
|
+
capabilities,
|
|
36505
36420
|
problems: getLegalEntityProblems(rootLegalEntity),
|
|
36506
36421
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
36507
36422
|
country: legalEntityResponse.organization.registeredAddress.country ?? contextCountry,
|
|
@@ -36539,7 +36454,7 @@ function DropinComposerComponent({
|
|
|
36539
36454
|
taskType: TaskTypes.TRUST_MEMBER_COMPANY,
|
|
36540
36455
|
parentLegalEntity: associatedLegalArrangement,
|
|
36541
36456
|
legalEntityResponse: associatedLegalEntity,
|
|
36542
|
-
capabilities
|
|
36457
|
+
capabilities,
|
|
36543
36458
|
problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[rootLegalEntity.id],
|
|
36544
36459
|
onChange: componentOnChange,
|
|
36545
36460
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
|
|
@@ -36566,7 +36481,7 @@ function DropinComposerComponent({
|
|
|
36566
36481
|
associatedLegalArrangement,
|
|
36567
36482
|
refreshLegalEntity,
|
|
36568
36483
|
accountHolder: getPayoutAccountHolderName(rootLegalEntity, i18n),
|
|
36569
|
-
capabilities
|
|
36484
|
+
capabilities,
|
|
36570
36485
|
onChange: componentOnChange,
|
|
36571
36486
|
onSubmit: componentOnSubmit,
|
|
36572
36487
|
handleHomeClick: navigateBack,
|
|
@@ -36592,7 +36507,7 @@ function DropinComposerComponent({
|
|
|
36592
36507
|
problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
|
|
36593
36508
|
parentLegalEntity: rootLegalEntity,
|
|
36594
36509
|
legalEntityResponse: associatedLegalArrangement,
|
|
36595
|
-
capabilities
|
|
36510
|
+
capabilities,
|
|
36596
36511
|
onChange: componentOnChange,
|
|
36597
36512
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
36598
36513
|
handleHomeClick: navigateBack,
|
|
@@ -36667,7 +36582,7 @@ function DropinComposerComponent({
|
|
|
36667
36582
|
taskType: TaskTypes.SOLE_PROPRIETOR_COMPANY,
|
|
36668
36583
|
parentLegalEntity: rootLegalEntity,
|
|
36669
36584
|
legalEntityResponse: associatedLegalArrangement,
|
|
36670
|
-
capabilities
|
|
36585
|
+
capabilities,
|
|
36671
36586
|
problems: (_j = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _j[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
|
|
36672
36587
|
onChange: componentOnChange,
|
|
36673
36588
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
@@ -36730,7 +36645,7 @@ function DropinComposerComponent({
|
|
|
36730
36645
|
legalEntityResponse: associatedLegalRepresentative,
|
|
36731
36646
|
country: rootLegalEntityCountry,
|
|
36732
36647
|
problems: getLegalEntityProblems(associatedLegalRepresentative),
|
|
36733
|
-
capabilities
|
|
36648
|
+
capabilities,
|
|
36734
36649
|
onChange: componentOnChange,
|
|
36735
36650
|
onSubmit: componentOnSubmit,
|
|
36736
36651
|
handleHomeClick: navigateBack,
|
|
@@ -37068,7 +36983,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
37068
36983
|
};
|
|
37069
36984
|
}, [base, rootLegalEntityId]);
|
|
37070
36985
|
};
|
|
37071
|
-
const logger$
|
|
36986
|
+
const logger$e = createLogger("CreateIndividualComponent");
|
|
37072
36987
|
function CreateIndividualComponent({
|
|
37073
36988
|
parentLegalEntityId,
|
|
37074
36989
|
legalEntityId,
|
|
@@ -37115,11 +37030,11 @@ function CreateIndividualComponent({
|
|
|
37115
37030
|
setParentLegalEntity(parentEntity);
|
|
37116
37031
|
setLegalEntity(entity);
|
|
37117
37032
|
} catch (error) {
|
|
37118
|
-
logger$
|
|
37033
|
+
logger$e.error(error);
|
|
37119
37034
|
}
|
|
37120
37035
|
}, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
|
|
37121
37036
|
useEffect(() => {
|
|
37122
|
-
fetchLegalEntity().catch(logger$
|
|
37037
|
+
fetchLegalEntity().catch(logger$e.error);
|
|
37123
37038
|
}, [fetchLegalEntity]);
|
|
37124
37039
|
const country = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
|
|
37125
37040
|
const onSubmit = (d) => {
|
|
@@ -37151,7 +37066,7 @@ function CreateIndividualComponent({
|
|
|
37151
37066
|
}
|
|
37152
37067
|
);
|
|
37153
37068
|
}
|
|
37154
|
-
const logger$
|
|
37069
|
+
const logger$d = createLogger("CreateTransferInstrumentComponent");
|
|
37155
37070
|
function CreateTransferInstrumentComponent({
|
|
37156
37071
|
legalEntityId,
|
|
37157
37072
|
transferInstrumentId,
|
|
@@ -37190,7 +37105,7 @@ function CreateTransferInstrumentComponent({
|
|
|
37190
37105
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
37191
37106
|
setTransferInstrument(ti);
|
|
37192
37107
|
}
|
|
37193
|
-
})().catch(logger$
|
|
37108
|
+
})().catch(logger$d.error);
|
|
37194
37109
|
}, [transferInstrumentId, fetchLegalEntity]);
|
|
37195
37110
|
return legalEntity ? /* @__PURE__ */ jsx(
|
|
37196
37111
|
PayoutDetailsDropinComponent,
|
|
@@ -37688,7 +37603,7 @@ const highExposureUltimateParentCompanyDetailsValidations = {
|
|
|
37688
37603
|
// errorMessage: 'fieldIsRequired',
|
|
37689
37604
|
// },
|
|
37690
37605
|
};
|
|
37691
|
-
const logger$
|
|
37606
|
+
const logger$c = createLogger("LegalFormField");
|
|
37692
37607
|
function LegalFormField({
|
|
37693
37608
|
name = "legalForm",
|
|
37694
37609
|
data,
|
|
@@ -37713,7 +37628,7 @@ function LegalFormField({
|
|
|
37713
37628
|
}));
|
|
37714
37629
|
setLegalForms(legalFormsResponse);
|
|
37715
37630
|
}
|
|
37716
|
-
}).catch(() => logger$
|
|
37631
|
+
}).catch(() => logger$c.error);
|
|
37717
37632
|
}, [countryCode]);
|
|
37718
37633
|
return /* @__PURE__ */ jsx(
|
|
37719
37634
|
Field,
|
|
@@ -37739,7 +37654,7 @@ function LegalFormField({
|
|
|
37739
37654
|
}
|
|
37740
37655
|
);
|
|
37741
37656
|
}
|
|
37742
|
-
const logger$
|
|
37657
|
+
const logger$b = createLogger("NaceCodeField");
|
|
37743
37658
|
function NaceCodeField({
|
|
37744
37659
|
name = "naceCode",
|
|
37745
37660
|
data,
|
|
@@ -37759,7 +37674,7 @@ function NaceCodeField({
|
|
|
37759
37674
|
if (response) {
|
|
37760
37675
|
setNaceCodes(response);
|
|
37761
37676
|
}
|
|
37762
|
-
}).catch(() => logger$
|
|
37677
|
+
}).catch(() => logger$b.error);
|
|
37763
37678
|
}, []);
|
|
37764
37679
|
return /* @__PURE__ */ jsx(
|
|
37765
37680
|
Field,
|
|
@@ -38734,7 +38649,7 @@ function HighExposureDropinComponent(props) {
|
|
|
38734
38649
|
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc", children: renderActiveForm(props.activeForm || highExposureForms.company) });
|
|
38735
38650
|
}
|
|
38736
38651
|
const parseConfiguration = ({ matchingScenario }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
|
|
38737
|
-
const logger$
|
|
38652
|
+
const logger$a = createLogger("UpdateLegalEntityForHighExposure");
|
|
38738
38653
|
const customLabels = {
|
|
38739
38654
|
company: {
|
|
38740
38655
|
legalForm: "businessStructure",
|
|
@@ -38782,7 +38697,7 @@ function UpdateLegalEntityForHighExposure({
|
|
|
38782
38697
|
useEffect(() => {
|
|
38783
38698
|
(async () => {
|
|
38784
38699
|
await fetchLegalEntity();
|
|
38785
|
-
})().catch(logger$
|
|
38700
|
+
})().catch(logger$a.error);
|
|
38786
38701
|
}, [fetchLegalEntity]);
|
|
38787
38702
|
const dataFromResponse = legalEntity ? mapLegalEntityToHighExposure(legalEntity) : {};
|
|
38788
38703
|
const [data, setData] = useState(dataFromResponse);
|
|
@@ -38987,7 +38902,7 @@ function getContentByStatus(status) {
|
|
|
38987
38902
|
return contentMap[status];
|
|
38988
38903
|
}
|
|
38989
38904
|
const FINAL_STATUSES = [OnboardingStatus.VERIFIED, OnboardingStatus.REJECTED];
|
|
38990
|
-
const logger$
|
|
38905
|
+
const logger$9 = createLogger("ViewVerificationStatusComponent");
|
|
38991
38906
|
function ViewVerificationStatusComponent({
|
|
38992
38907
|
legalEntityId,
|
|
38993
38908
|
hideExplanation = false,
|
|
@@ -39006,12 +38921,12 @@ function ViewVerificationStatusComponent({
|
|
|
39006
38921
|
if (!onboardingStatus) return;
|
|
39007
38922
|
const statusContent = getContentByStatus(onboardingStatus);
|
|
39008
38923
|
if (statusContent) return statusContent;
|
|
39009
|
-
logger$
|
|
38924
|
+
logger$9.error(`there is no content for status "${onboardingStatus}"`);
|
|
39010
38925
|
}, [onboardingStatus]);
|
|
39011
38926
|
const handleError = useCallback(
|
|
39012
38927
|
(rawError, userMessage) => {
|
|
39013
38928
|
const error = coerceError(rawError);
|
|
39014
|
-
logger$
|
|
38929
|
+
logger$9.error(error);
|
|
39015
38930
|
setAlertContent(userMessage);
|
|
39016
38931
|
onError == null ? void 0 : onError({
|
|
39017
38932
|
error,
|
|
@@ -39045,7 +38960,7 @@ function ViewVerificationStatusComponent({
|
|
|
39045
38960
|
});
|
|
39046
38961
|
useEffect(() => {
|
|
39047
38962
|
setAlertContent(void 0);
|
|
39048
|
-
fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$
|
|
38963
|
+
fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$9.error);
|
|
39049
38964
|
}, [fetchOnboardingStatus, updateOnboardingStatus]);
|
|
39050
38965
|
const [loadingLinkStatus, setLinkLoadingStatus] = useState("success");
|
|
39051
38966
|
const redirectToAdyen = async () => {
|
|
@@ -39221,22 +39136,22 @@ const useAnalytics = async ({
|
|
|
39221
39136
|
userEvents.subscribe(onUserEvent);
|
|
39222
39137
|
}
|
|
39223
39138
|
};
|
|
39224
|
-
const logger$
|
|
39139
|
+
const logger$8 = createLogger("loadCountries");
|
|
39225
39140
|
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") });
|
|
39226
39141
|
const loadCountriesDataset = async (locale) => {
|
|
39227
39142
|
const importForLocale = countriesImports[`./${locale}.json`];
|
|
39228
39143
|
if (!importForLocale) {
|
|
39229
|
-
logger$
|
|
39144
|
+
logger$8.warn(`No countries dataset for ${locale}, falling back to en-US`);
|
|
39230
39145
|
return (await import("./en-US-CkdCbOCX.js")).default;
|
|
39231
39146
|
}
|
|
39232
39147
|
return (await importForLocale()).default;
|
|
39233
39148
|
};
|
|
39234
|
-
const logger$
|
|
39149
|
+
const logger$7 = createLogger("loadStates");
|
|
39235
39150
|
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") });
|
|
39236
39151
|
const loadStatesDataset = async (country, locale) => {
|
|
39237
39152
|
const importForLocale = statesImports[`./${country}/${locale}.json`];
|
|
39238
39153
|
if (!importForLocale) {
|
|
39239
|
-
logger$
|
|
39154
|
+
logger$7.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
|
|
39240
39155
|
const fallbackImport = statesImports[`./${country}/en-US.json`];
|
|
39241
39156
|
return (await fallbackImport()).default;
|
|
39242
39157
|
}
|
|
@@ -39350,7 +39265,7 @@ const validatePhoneNumber$1 = async (context, phoneNumber) => {
|
|
|
39350
39265
|
{ number: phoneNumber }
|
|
39351
39266
|
);
|
|
39352
39267
|
};
|
|
39353
|
-
const logger$
|
|
39268
|
+
const logger$6 = createLogger("verify-id-number");
|
|
39354
39269
|
const verifyIdNumber$1 = async (context, request) => {
|
|
39355
39270
|
const { loadingContext, legalEntityId } = context;
|
|
39356
39271
|
try {
|
|
@@ -39373,13 +39288,13 @@ const verifyIdNumber$1 = async (context, request) => {
|
|
|
39373
39288
|
if (responseData.status === 500) {
|
|
39374
39289
|
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
39375
39290
|
}
|
|
39376
|
-
return logger$
|
|
39291
|
+
return logger$6.warn(`Unexpected response status ${responseData.status}`);
|
|
39377
39292
|
}
|
|
39378
39293
|
},
|
|
39379
39294
|
request
|
|
39380
39295
|
);
|
|
39381
39296
|
} catch (e) {
|
|
39382
|
-
logger$
|
|
39297
|
+
logger$6.warn("WARNING: idNumber verification failed - error:", e);
|
|
39383
39298
|
}
|
|
39384
39299
|
};
|
|
39385
39300
|
const getEmbeddedApi = ({
|
|
@@ -39460,7 +39375,7 @@ const validatePhoneNumber = async (context, phoneNumber) => {
|
|
|
39460
39375
|
{ number: phoneNumber }
|
|
39461
39376
|
);
|
|
39462
39377
|
};
|
|
39463
|
-
const logger$
|
|
39378
|
+
const logger$5 = createLogger("verify-id-number");
|
|
39464
39379
|
const verifyIdNumber = async (context, request) => {
|
|
39465
39380
|
const { loadingContext, clientKey } = context;
|
|
39466
39381
|
try {
|
|
@@ -39478,7 +39393,7 @@ const verifyIdNumber = async (context, request) => {
|
|
|
39478
39393
|
if (responseData.status === 500) {
|
|
39479
39394
|
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
39480
39395
|
}
|
|
39481
|
-
return logger$
|
|
39396
|
+
return logger$5.warn(`Unexpected response status ${responseData.status}`);
|
|
39482
39397
|
},
|
|
39483
39398
|
path: "v1/verification/idNumber",
|
|
39484
39399
|
clientKey
|
|
@@ -39486,7 +39401,7 @@ const verifyIdNumber = async (context, request) => {
|
|
|
39486
39401
|
request
|
|
39487
39402
|
);
|
|
39488
39403
|
} catch (e) {
|
|
39489
|
-
logger$
|
|
39404
|
+
logger$5.warn("WARNING: idNumber verification failed - error:", e);
|
|
39490
39405
|
}
|
|
39491
39406
|
};
|
|
39492
39407
|
const getKycExternalApi = ({
|
|
@@ -39515,7 +39430,7 @@ const ConfigurationApiProvider = ({
|
|
|
39515
39430
|
}) => {
|
|
39516
39431
|
const authContext = useAuthContext();
|
|
39517
39432
|
const { isEmbeddedDropin, loadingContext } = authContext;
|
|
39518
|
-
const sdkVersion = "2.59.
|
|
39433
|
+
const sdkVersion = "2.59.2";
|
|
39519
39434
|
useAnalytics({
|
|
39520
39435
|
onUserEvent,
|
|
39521
39436
|
legalEntityId: rootLegalEntityId,
|
|
@@ -39545,6 +39460,19 @@ const useAccountHolder = (legalEntityId) => {
|
|
|
39545
39460
|
setAccountHolder: setAccountHolderIntoLocalStorage
|
|
39546
39461
|
};
|
|
39547
39462
|
};
|
|
39463
|
+
const logger$4 = createLogger("useAllowedCountries");
|
|
39464
|
+
const useAllowedCountries = () => {
|
|
39465
|
+
const acceptedCountries = useSetting("acceptedCountries");
|
|
39466
|
+
const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
|
|
39467
|
+
const [allowedCountries, setAllowedCountries] = useState(
|
|
39468
|
+
acceptedCountries
|
|
39469
|
+
);
|
|
39470
|
+
useEffect(() => {
|
|
39471
|
+
if (acceptedCountries !== void 0) return;
|
|
39472
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$4.error);
|
|
39473
|
+
}, [acceptedCountries]);
|
|
39474
|
+
return allowedCountries;
|
|
39475
|
+
};
|
|
39548
39476
|
const logger$3 = createLogger("CoreProvider");
|
|
39549
39477
|
const CoreProvider = ({
|
|
39550
39478
|
contextCountry: initialContextCountry,
|
|
@@ -39577,9 +39505,10 @@ const CoreProvider = ({
|
|
|
39577
39505
|
setAccountFormat,
|
|
39578
39506
|
accountFormat,
|
|
39579
39507
|
setIsModalView,
|
|
39580
|
-
isModalView
|
|
39508
|
+
isModalView,
|
|
39509
|
+
allowedCountries
|
|
39581
39510
|
}),
|
|
39582
|
-
[contextCountry, accountHolder, accountFormat, isModalView]
|
|
39511
|
+
[contextCountry, accountHolder, accountFormat, isModalView, allowedCountries]
|
|
39583
39512
|
);
|
|
39584
39513
|
return /* @__PURE__ */ jsx(CoreContext.Provider, { value: contextValue, children });
|
|
39585
39514
|
};
|
|
@@ -40174,7 +40103,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
40174
40103
|
};
|
|
40175
40104
|
const copyToClipboard = async () => {
|
|
40176
40105
|
const toCopy = {
|
|
40177
|
-
sdkVersion: "2.59.
|
|
40106
|
+
sdkVersion: "2.59.2",
|
|
40178
40107
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
40179
40108
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
40180
40109
|
};
|
|
@@ -40239,7 +40168,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
40239
40168
|
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
|
|
40240
40169
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
40241
40170
|
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
|
|
40242
|
-
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.59.
|
|
40171
|
+
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.59.2" })
|
|
40243
40172
|
] }) }),
|
|
40244
40173
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
40245
40174
|
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
|