@adyen/kyc-components 2.54.1 → 2.56.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 +1171 -460
- package/dist/es/us-check-account-number-CHnzmLNd.js +39 -0
- package/dist/es/us-check-o5Ax_0LS.js +37 -0
- package/dist/es/us-check-routing-number-BtVf7GH3.js +40 -0
- package/dist/style.css +158 -702
- package/dist/types/components/AdditionalInformation/VerifiedBusinessCard.d.ts +3 -1
- package/dist/types/components/AdditionalInformation/utils.d.ts +6 -0
- package/dist/types/components/BusinessSelection/types.d.ts +3 -1
- package/dist/types/components/Dropins/ServiceAgreementDropinComponent/components/ServiceAgreementDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/ServiceAgreementDropinComponent/types.d.ts +2 -1
- package/dist/types/components/Dropins/types.d.ts +2 -2
- package/dist/types/components/EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent.d.ts +2 -1
- package/dist/types/components/PayoutAccount/component/CheckGuidance/CheckGuidance.d.ts +7 -0
- package/dist/types/components/RegistrationAddress/component/RegistrationAddressComponent.d.ts +2 -1
- package/dist/types/components/index.d.ts +14 -2
- package/dist/types/components/internal/Address/AddressComponent.d.ts +3 -0
- package/dist/types/components/internal/Address/AddressExperimentWrapper.d.ts +2 -0
- package/dist/types/components/internal/Address/components/FieldContainerComponent.d.ts +9 -0
- package/dist/types/components/internal/Address/types.d.ts +7 -11
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/Address/validate.d.ts +2 -2
- package/dist/types/components/internal/BankAccountNumber/types.d.ts +2 -0
- package/dist/types/components/internal/BranchCode/types.d.ts +2 -0
- package/dist/types/components/internal/Button/Button.d.ts +1 -1
- package/dist/types/components/internal/Button/types.d.ts +1 -0
- package/dist/types/components/internal/DecisionMakerRole/types.d.ts +1 -1
- package/dist/types/components/internal/FormFields/MaskedInputText/MaskedInputText.d.ts +2 -1
- package/dist/types/components/internal/FormFields/MultiSelectList/MultiSelectList.d.ts +1 -0
- package/dist/types/components/internal/FormFields/Select/Select.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectButton.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Select/components/SelectList.d.ts +1 -0
- package/dist/types/components/internal/FormFields/Select/components/SelectListItem.d.ts +1 -0
- package/dist/types/components/internal/FormFields/Select/types.d.ts +4 -1
- package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +1 -1
- package/dist/types/components/internal/Skeleton/Skeleton.d.ts +0 -1
- package/dist/types/components/internal/Svg/svgs.d.ts +3 -0
- package/dist/types/core/Context/ExperimentContext/types.d.ts +4 -1
- package/dist/types/core/Context/SettingsContext/types.d.ts +3 -1
- package/dist/types/core/SDKValidation/types.d.ts +2 -2
- package/dist/types/core/Services/componentApi/get-address.d.ts +2 -2
- package/dist/types/core/hooks/useBusinessData/types.d.ts +3 -1
- package/dist/types/core/hooks/useDebounce.d.ts +1 -0
- package/dist/types/core/models/api/address-search.d.ts +1 -8
- package/dist/types/core/models/api/company-search.d.ts +7 -0
- package/dist/types/core/models/form-rules.d.ts +2 -0
- package/dist/types/utils/datasetUtil.d.ts +1 -1
- package/dist/types/utils/payout-account-util.d.ts +1 -0
- package/dist/types/utils/validatorUtils.d.ts +1 -1
- package/package.json +1 -1
|
@@ -94,7 +94,6 @@ const defaultTrans = {
|
|
|
94
94
|
accountNumberOrIbanVisible: "Includes your account number or IBAN",
|
|
95
95
|
accountNumberVisible: "Includes your account number",
|
|
96
96
|
accountVerification: "Account Verification",
|
|
97
|
-
achRoutingNumber: "ACH routing number",
|
|
98
97
|
acknowledgePciRequirements: "We hereby acknowledge that we must remain compliant with the aforementioned PCI DSS requirements at all times as long as we want to receive payments. Consequently, we must continuously reassess our environment and implement any additional PCI DSS requirements if our environment changes.",
|
|
99
98
|
add: "Add",
|
|
100
99
|
addAndVerifyYourBankDetails: "Add and verify your bank account details",
|
|
@@ -108,6 +107,7 @@ const defaultTrans = {
|
|
|
108
107
|
addPayinAccount: "Add a payin account",
|
|
109
108
|
addPayoutAccount: "Add a payout account",
|
|
110
109
|
addTrustMember: "Add trust member",
|
|
110
|
+
addYourselfAsSigner: "Add yourself as a signer",
|
|
111
111
|
additionalInformation: "Additional information",
|
|
112
112
|
additionalInformationFormHeading: "Additional business details",
|
|
113
113
|
additionalInformationFormName: "Additional details",
|
|
@@ -226,6 +226,7 @@ const defaultTrans = {
|
|
|
226
226
|
chamberOfCommerceExtract: "Chamber of Commerce extract",
|
|
227
227
|
chamberOfCommerceRegistrationNumber: "Chamber of Commerce registration number",
|
|
228
228
|
changeYourBusinessSetup: "Change your business setup?",
|
|
229
|
+
chargeCardUserAgreement: "Charge Card User Agreement",
|
|
229
230
|
charitableTrust: "Charitable trust",
|
|
230
231
|
charityNumber: "Charity number",
|
|
231
232
|
charter: "Charter",
|
|
@@ -388,6 +389,7 @@ const defaultTrans = {
|
|
|
388
389
|
enterAMaximumOfNCharactersWithAMixForExample: "Enter a maximum of %{maxChars} characters, with a mix of letters and numbers. For example, %{example}",
|
|
389
390
|
enterAMaximumOfNDigitsForExample: "Enter a maximum of %{maxDigits} digits. For example, %{example}",
|
|
390
391
|
enterAMaximumOfNMoreDigitsForExample: "Enter a maximum of %{maxDigits} more digits. For example, %{example}",
|
|
392
|
+
enterEnglishLetterFollowedByXtoYDigitsForExample: "Enter an English-equivalent letter (C for HE, O for AE, P for Σ) followed by %{minDigits} - %{maxDigits} digits. For example, %{example}",
|
|
391
393
|
enterLastNDigitsForExample: "Enter the last %{numDigits} digits. For example, %{example}",
|
|
392
394
|
enterLastNameExactlyAsAppearInID: "Enter your last name(s) exactly as it appears on your identity document",
|
|
393
395
|
enterNCharactersForExample: "Enter %{numChars} characters. For example, %{example}",
|
|
@@ -477,6 +479,8 @@ const defaultTrans = {
|
|
|
477
479
|
errorMessage_1_3051: "The proof of national ID number image was of too low quality.",
|
|
478
480
|
errorMessage_1_3052: "An ID document is needed to verify the individual.",
|
|
479
481
|
errorMessage_1_3062: "The name and 4 digit SSN couldn't be verified.",
|
|
482
|
+
errorMessage_1_3072: "We found the following issues:\n- The name and nationality couldn't be verified.\nReview the information below and correct any mistakes, or upload an id document then resubmit.",
|
|
483
|
+
errorMessage_1_3073: "We found the following issues:\n- The ID document didn't show the nationality.\nReview the information below and correct any mistakes, or upload an id document then resubmit.",
|
|
480
484
|
errorMessage_1_31: "ID document is needed",
|
|
481
485
|
errorMessage_1_32: "ID document couldn't be processed",
|
|
482
486
|
errorMessage_1_33: "ID document didn't meet requirements",
|
|
@@ -850,6 +854,7 @@ const defaultTrans = {
|
|
|
850
854
|
isParentOwnedByAnotherCompany: "Is your parent company owned by another company?",
|
|
851
855
|
isThisAddressTheMainHeadquarters: "Is this address the main headquarters?",
|
|
852
856
|
isTrustOperationAddressSame: "Is there a different address for your trust's operations?",
|
|
857
|
+
isYourNameMissingFromSigners: "Is your name missing from the list of signers?",
|
|
853
858
|
issuedByTheTaxAuthority: "Issued by the tax authority or government of the country where the company is registered",
|
|
854
859
|
issuedInTheLastXMonths: "Issued in the last %{number} months",
|
|
855
860
|
issuerState: "Issuing state",
|
|
@@ -948,6 +953,7 @@ const defaultTrans = {
|
|
|
948
953
|
nonProfitOrCharitableOrgDescription: "Your organization has official non-profit or tax-exempt status.",
|
|
949
954
|
nonProfitOrCharitableOrgTitle: "Non-profit or charitable organization",
|
|
950
955
|
noneOfTheAbove: "None of the above",
|
|
956
|
+
nothingNeedsToBeSigned: "Nothing needs to be signed right now.",
|
|
951
957
|
notBlurry: "Not blurry",
|
|
952
958
|
notCutOff: "Not cut off",
|
|
953
959
|
notExpired: "Not expired",
|
|
@@ -1000,6 +1006,7 @@ const defaultTrans = {
|
|
|
1000
1006
|
parentCompany: "Parent company",
|
|
1001
1007
|
parentCompanyInformation: "Parent company information",
|
|
1002
1008
|
partitaIVA: "Partita IVA",
|
|
1009
|
+
codiceFiscalePartitaIVA: "Codice Fiscale / Partita IVA",
|
|
1003
1010
|
partnerShipAgreement: "Partnership agreement",
|
|
1004
1011
|
partnership: "Partnership",
|
|
1005
1012
|
partnershipIncorporated: "Incorporated partnership",
|
|
@@ -1083,7 +1090,7 @@ const defaultTrans = {
|
|
|
1083
1090
|
reasonForFillingIndividualAddressDetails: "We have to make sure that everyone who uses our services is who they say they are. To do that, we'll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.",
|
|
1084
1091
|
reasonForFillingIndividualPersonalDetails: "We have to make sure that everyone who uses our services is who they say they are. To do that, we'll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.",
|
|
1085
1092
|
reasonForFillingPayoutAccountDetails: "We have to make sure the businesses using our services will not be misusing the funds or causing harm. To do that, we'll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.",
|
|
1086
|
-
reasonForFillingPayoutDetails: "
|
|
1093
|
+
reasonForFillingPayoutDetails: "This bank account will be verified to prevent fraud or other misuse of funds in compliance with global regulations.",
|
|
1087
1094
|
region: "Region",
|
|
1088
1095
|
registeredAddress: "Registered address",
|
|
1089
1096
|
registeredAddressHeaderDescription: "The address as it appears on your company's official registration documents.",
|
|
@@ -1172,6 +1179,7 @@ const defaultTrans = {
|
|
|
1172
1179
|
rnaNumber: "RNA number",
|
|
1173
1180
|
role: "Role",
|
|
1174
1181
|
roleAndEntityType: "Role and entity type",
|
|
1182
|
+
routingNumber: "Routing number",
|
|
1175
1183
|
routingNumberVisible: "Includes your routing number",
|
|
1176
1184
|
salarySlip: "Salary slip",
|
|
1177
1185
|
sameAsRegisteredAddress: "Same as registered business address",
|
|
@@ -1300,6 +1308,7 @@ const defaultTrans = {
|
|
|
1300
1308
|
theIdCheckWillBeAutomaticallyValidated: "With the right capture, the ID check will be automatically validated",
|
|
1301
1309
|
theSubmitWasSuccessful: "The submit was successful",
|
|
1302
1310
|
thenResubmit: "then resubmit.",
|
|
1311
|
+
thereAreNoSigners: "There are no signers, please add yourself to make sure you can accept the terms and get the funds.",
|
|
1303
1312
|
thereWasAnErrorTryAgain: "There was an error, please try again",
|
|
1304
1313
|
thisIsMyBusiness: "This is my business",
|
|
1305
1314
|
thisMeansYouHaveAParentCompany: "If yes, this means you have a parent company, such as a global headquarters or a holding company.",
|
|
@@ -1825,7 +1834,7 @@ class UserEvents {
|
|
|
1825
1834
|
}
|
|
1826
1835
|
}
|
|
1827
1836
|
const userEvents = new UserEvents();
|
|
1828
|
-
const logger$
|
|
1837
|
+
const logger$G = createLogger("useCompanySearch");
|
|
1829
1838
|
const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
|
|
1830
1839
|
function useCompanySearch({
|
|
1831
1840
|
defaultData,
|
|
@@ -1949,7 +1958,7 @@ function useCompanySearch({
|
|
|
1949
1958
|
state: companyData.state ?? stateOrProvince
|
|
1950
1959
|
});
|
|
1951
1960
|
} catch (e) {
|
|
1952
|
-
logger$
|
|
1961
|
+
logger$G.error(e);
|
|
1953
1962
|
setError(e);
|
|
1954
1963
|
setStatus("error");
|
|
1955
1964
|
} finally {
|
|
@@ -1982,7 +1991,7 @@ function useCompanySearch({
|
|
|
1982
1991
|
indexSearch: handleCompanyIndexSearch,
|
|
1983
1992
|
deepSearch: handleCompanyDeepSearch,
|
|
1984
1993
|
resultsLimit: limit
|
|
1985
|
-
})) == null ? void 0 : _a.catch((e) => logger$
|
|
1994
|
+
})) == null ? void 0 : _a.catch((e) => logger$G.error(e));
|
|
1986
1995
|
}
|
|
1987
1996
|
}, [legalCompanyName, country, stateOrProvince, taxIdentificationNumber, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
|
|
1988
1997
|
useEffect(() => {
|
|
@@ -2005,8 +2014,8 @@ function useCompanySearch({
|
|
|
2005
2014
|
reset
|
|
2006
2015
|
};
|
|
2007
2016
|
}
|
|
2008
|
-
const logger$
|
|
2009
|
-
const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [StateCodesUS.Arkansas, StateCodesUS.Connecticut, StateCodesUS.Georgia, StateCodesUS.Hawaii, StateCodesUS.Kentucky, StateCodesUS.Maryland, StateCodesUS.Minnesota, StateCodesUS.Missouri, StateCodesUS.Montana, StateCodesUS.NewHampshire, StateCodesUS.NewMexico, StateCodesUS.SouthCarolina, StateCodesUS.Utah, StateCodesUS.Vermont, StateCodesUS.Wisconsin, StateCodesUS.Wyoming];
|
|
2017
|
+
const logger$F = createLogger("useBusinessData");
|
|
2018
|
+
const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [StateCodesUS.Arkansas, StateCodesUS.Connecticut, StateCodesUS.Georgia, StateCodesUS.Hawaii, StateCodesUS.Indiana, StateCodesUS.Kentucky, StateCodesUS.Maryland, StateCodesUS.Minnesota, StateCodesUS.Missouri, StateCodesUS.Montana, StateCodesUS.NewHampshire, StateCodesUS.NewMexico, StateCodesUS.SouthCarolina, StateCodesUS.Utah, StateCodesUS.Vermont, StateCodesUS.Wisconsin, StateCodesUS.Wyoming];
|
|
2010
2019
|
function useBusinessData({
|
|
2011
2020
|
handleCompanyIndexSearch,
|
|
2012
2021
|
handleCompanyDeepSearch,
|
|
@@ -2024,36 +2033,49 @@ function useBusinessData({
|
|
|
2024
2033
|
const [cachedBusiness, setCachedBusiness] = useState();
|
|
2025
2034
|
const [verifiedBusiness, setVerifiedBusiness] = useState();
|
|
2026
2035
|
const [invalidTin, setInvalidTin] = useState(false);
|
|
2036
|
+
const primarySourceSearch = async (data, indexSearch, deepSearch) => {
|
|
2037
|
+
let response;
|
|
2038
|
+
try {
|
|
2039
|
+
response = await deepSearch({
|
|
2040
|
+
...data,
|
|
2041
|
+
limit: data.limit ?? 15
|
|
2042
|
+
});
|
|
2043
|
+
} catch (e) {
|
|
2044
|
+
response = await indexSearch({
|
|
2045
|
+
...data,
|
|
2046
|
+
limit: data.limit ?? 15
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
return response;
|
|
2050
|
+
};
|
|
2027
2051
|
const searchForBusiness = useCallback(async (data) => {
|
|
2028
2052
|
if (!handleCompanyDeepSearch || !handleCompanyIndexSearch) {
|
|
2029
|
-
logger$
|
|
2053
|
+
logger$F.log("Missing handlers for searchForBusiness");
|
|
2030
2054
|
return;
|
|
2031
2055
|
}
|
|
2032
2056
|
if (searchResults && objectsDeepEqual(cachedSearch, data)) return;
|
|
2033
2057
|
try {
|
|
2034
2058
|
setSearching("loading");
|
|
2035
|
-
const {
|
|
2036
|
-
results
|
|
2037
|
-
} = KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await handleCompanyIndexSearch({
|
|
2059
|
+
const response = KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await handleCompanyIndexSearch({
|
|
2038
2060
|
...data,
|
|
2039
2061
|
limit: data.limit ?? 15
|
|
2040
|
-
}) : await
|
|
2062
|
+
}) : await primarySourceSearch({
|
|
2041
2063
|
...data,
|
|
2042
2064
|
limit: data.limit ?? 15
|
|
2043
|
-
});
|
|
2044
|
-
setSearchResults(results);
|
|
2045
|
-
return results;
|
|
2065
|
+
}, handleCompanyIndexSearch, handleCompanyDeepSearch);
|
|
2066
|
+
setSearchResults(response == null ? void 0 : response.results);
|
|
2067
|
+
return response == null ? void 0 : response.results;
|
|
2046
2068
|
} catch (e) {
|
|
2047
2069
|
setSearching("error");
|
|
2048
|
-
logger$
|
|
2070
|
+
logger$F.error(e);
|
|
2049
2071
|
} finally {
|
|
2050
2072
|
setCachedSearch(data);
|
|
2051
2073
|
setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2052
2074
|
}
|
|
2053
2075
|
}, [handleCompanyDeepSearch, handleCompanyIndexSearch, searchResults, cachedSearch]);
|
|
2054
|
-
const fetchBusinessData = useCallback(async (company) => {
|
|
2076
|
+
const fetchBusinessData = useCallback(async (company, state) => {
|
|
2055
2077
|
if (!handleGetCompanyDataset || !handleRefreshCompanyDataset) {
|
|
2056
|
-
logger$
|
|
2078
|
+
logger$F.log("Missing handlers for fetchBusinessData");
|
|
2057
2079
|
return;
|
|
2058
2080
|
}
|
|
2059
2081
|
if (cachedBusiness && objectsDeepEqual({
|
|
@@ -2072,23 +2094,25 @@ function useBusinessData({
|
|
|
2072
2094
|
const businessData = isDataCompliant ? await handleGetCompanyDataset({
|
|
2073
2095
|
companyId: company.id,
|
|
2074
2096
|
country: "US"
|
|
2097
|
+
// state: state as StateCodeUS,
|
|
2075
2098
|
}) : await handleRefreshCompanyDataset({
|
|
2076
2099
|
companyId: company.id,
|
|
2077
2100
|
country: "US"
|
|
2101
|
+
// state: state as StateCodeUS,
|
|
2078
2102
|
});
|
|
2079
2103
|
setCachedBusiness(businessData);
|
|
2080
2104
|
return businessData;
|
|
2081
2105
|
} catch (e) {
|
|
2082
2106
|
setFetching("error");
|
|
2083
2107
|
setCachedBusiness(void 0);
|
|
2084
|
-
logger$
|
|
2108
|
+
logger$F.error(e);
|
|
2085
2109
|
} finally {
|
|
2086
2110
|
setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2087
2111
|
}
|
|
2088
2112
|
}, [cachedBusiness, handleGetCompanyDataset, handleRefreshCompanyDataset]);
|
|
2089
2113
|
const verifyBusinessData = useCallback(async (data, tin) => {
|
|
2090
2114
|
if (!handleVerifyTin) {
|
|
2091
|
-
logger$
|
|
2115
|
+
logger$F.log("Missing handlers for verifyBusinessData");
|
|
2092
2116
|
return;
|
|
2093
2117
|
}
|
|
2094
2118
|
try {
|
|
@@ -2109,7 +2133,7 @@ function useBusinessData({
|
|
|
2109
2133
|
return matched;
|
|
2110
2134
|
} catch (e) {
|
|
2111
2135
|
setVerifying("error");
|
|
2112
|
-
logger$
|
|
2136
|
+
logger$F.error(e);
|
|
2113
2137
|
} finally {
|
|
2114
2138
|
setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2115
2139
|
}
|
|
@@ -2120,7 +2144,7 @@ function useBusinessData({
|
|
|
2120
2144
|
await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
|
|
2121
2145
|
} catch (e) {
|
|
2122
2146
|
setResettingTrustedData("error");
|
|
2123
|
-
logger$
|
|
2147
|
+
logger$F.error(e);
|
|
2124
2148
|
} finally {
|
|
2125
2149
|
setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2126
2150
|
}
|
|
@@ -2168,6 +2192,7 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
|
|
|
2168
2192
|
SettingNames2["HideOnboardingIntroductionSoleProprietor"] = "hideOnboardingIntroductionSoleProprietor";
|
|
2169
2193
|
SettingNames2["TransferInstrumentLimit"] = "transferInstrumentLimit";
|
|
2170
2194
|
SettingNames2["ViewOnboardingGuidance"] = "viewOnboardingGuidance";
|
|
2195
|
+
SettingNames2["ShowServiceAgreementsFirst"] = "showServiceAgreementsFirst";
|
|
2171
2196
|
return SettingNames2;
|
|
2172
2197
|
})(SettingNames || {});
|
|
2173
2198
|
const SettingsContext = createContext(void 0);
|
|
@@ -2352,8 +2377,9 @@ const mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
|
|
|
2352
2377
|
const MAX_LENGTH = 30;
|
|
2353
2378
|
const getMaxLengthByFieldAndCountry = (formattingRules, field, country, ignoreIfFormatterExists) => {
|
|
2354
2379
|
var _a, _b, _c, _d;
|
|
2380
|
+
if (!country) return void 0;
|
|
2355
2381
|
if ((_b = (_a = formattingRules[country]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter) {
|
|
2356
|
-
return
|
|
2382
|
+
return void 0;
|
|
2357
2383
|
}
|
|
2358
2384
|
const maxLength = (_d = (_c = formattingRules[country]) == null ? void 0 : _c[field]) == null ? void 0 : _d.maxlength;
|
|
2359
2385
|
return maxLength || MAX_LENGTH;
|
|
@@ -2426,6 +2452,9 @@ const svgs = {
|
|
|
2426
2452
|
"document-cutoff": lazy(() => import("./document-cut-off-D2vCeeIS.js")),
|
|
2427
2453
|
"document-expired": lazy(() => import("./document-expired-_4Syh1xW.js")),
|
|
2428
2454
|
"document-front": lazy(() => import("./document-front-9Glzn7ZR.js")),
|
|
2455
|
+
"us-check": lazy(() => import("./us-check-o5Ax_0LS.js")),
|
|
2456
|
+
"us-check-routing-number": lazy(() => import("./us-check-routing-number-BtVf7GH3.js")),
|
|
2457
|
+
"us-check-account-number": lazy(() => import("./us-check-account-number-CHnzmLNd.js")),
|
|
2429
2458
|
"id-blurred": lazy(() => import("./id-blurred-A45CVnPk.js")),
|
|
2430
2459
|
"id-cutoff": lazy(() => import("./id-cut-off-DMoJYcGr.js")),
|
|
2431
2460
|
"id-front": lazy(() => import("./id-front-CTIDY7Nu.js")),
|
|
@@ -2451,7 +2480,7 @@ const svgs = {
|
|
|
2451
2480
|
"trustly-logo": lazy(() => import("./trustly-logo-YJslAOYF.js"))
|
|
2452
2481
|
};
|
|
2453
2482
|
const unscalableIconNames = ["bin", "check", "checkmark", "checkmark-small", "chevron-right", "chevron-left", "company", "contract", "cross", "decision-maker", "document", "download", "edit", "info-circle", "image", "location", "payout", "pci", "plus", "remove", "save", "search", "trust", "user", "upload", "warning"];
|
|
2454
|
-
const logger$
|
|
2483
|
+
const logger$E = createLogger("Icon");
|
|
2455
2484
|
const Svg = ({
|
|
2456
2485
|
className,
|
|
2457
2486
|
name,
|
|
@@ -2462,7 +2491,7 @@ const Svg = ({
|
|
|
2462
2491
|
const LazyLoadedSvg = svgs[name];
|
|
2463
2492
|
const viewBox = unscalableIconNames.includes(name) ? "0 0 16 16" : void 0;
|
|
2464
2493
|
if (!LazyLoadedSvg) {
|
|
2465
|
-
logger$
|
|
2494
|
+
logger$E.error(`No such svg: "${name}"`);
|
|
2466
2495
|
return null;
|
|
2467
2496
|
}
|
|
2468
2497
|
return jsx("span", {
|
|
@@ -2512,6 +2541,7 @@ const Button = ({
|
|
|
2512
2541
|
role,
|
|
2513
2542
|
small,
|
|
2514
2543
|
block,
|
|
2544
|
+
critical,
|
|
2515
2545
|
shaded,
|
|
2516
2546
|
label = "",
|
|
2517
2547
|
icon,
|
|
@@ -2558,6 +2588,7 @@ const Button = ({
|
|
|
2558
2588
|
"adyen-kyc-button--secondary": secondary,
|
|
2559
2589
|
"adyen-kyc-button--tertiary": tertiary && !secondary,
|
|
2560
2590
|
"adyen-kyc-button--block": block,
|
|
2591
|
+
"adyen-kyc-button--critical": critical,
|
|
2561
2592
|
"adyen-kyc-button--small": small && label,
|
|
2562
2593
|
"adyen-kyc-button--shaded": shaded && icon && tertiary,
|
|
2563
2594
|
// disallow shaded effect if not just tertiary icon
|
|
@@ -2748,10 +2779,10 @@ function useFormRouterContext() {
|
|
|
2748
2779
|
}
|
|
2749
2780
|
return context;
|
|
2750
2781
|
}
|
|
2751
|
-
const logger$
|
|
2782
|
+
const logger$D = createLogger("Link");
|
|
2752
2783
|
const isValidLink = (href) => {
|
|
2753
2784
|
if (href === "#") {
|
|
2754
|
-
logger$
|
|
2785
|
+
logger$D.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
2755
2786
|
return false;
|
|
2756
2787
|
}
|
|
2757
2788
|
return true;
|
|
@@ -3027,6 +3058,7 @@ function getFieldProps(props, innerFormFields) {
|
|
|
3027
3058
|
var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
3028
3059
|
ExperimentNames2["EnableCompanySearchFlow"] = "EnableCompanySearchFlow";
|
|
3029
3060
|
ExperimentNames2["EnableNewBusinessDetailsFlow"] = "EnableNewBusinessDetailsFlow";
|
|
3061
|
+
ExperimentNames2["EnableNewAddressComponent"] = "EnableNewAddressComponent";
|
|
3030
3062
|
ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
|
|
3031
3063
|
ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
|
|
3032
3064
|
ExperimentNames2["AllowMoreRolesForMainRootTrustee"] = "AllowMoreRolesForMainRootTrustee";
|
|
@@ -3040,6 +3072,8 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
|
3040
3072
|
ExperimentNames2["EnableAgeVerification"] = "EnableAgeVerification";
|
|
3041
3073
|
ExperimentNames2["PreserveMismatchedInitialValues"] = "PreserveMismatchedInitialValues";
|
|
3042
3074
|
ExperimentNames2["StrictNameAndAddressValidationV4"] = "StrictNameAndAddressValidationV4";
|
|
3075
|
+
ExperimentNames2["EnableIdentificationNationalityCrossBorderAssociateCheck"] = "EnableIdentificationNationalityCrossBorderAssociateCheck";
|
|
3076
|
+
ExperimentNames2["EnableAUGovernmentalOrganizationSkipRegistrationNumber"] = "EnableAUGovernmentalOrganizationSkipRegistrationNumber";
|
|
3043
3077
|
return ExperimentNames2;
|
|
3044
3078
|
})(ExperimentNames || {});
|
|
3045
3079
|
const ON_CHANGE_DEBOUNCE_DURATION = 200;
|
|
@@ -3100,7 +3134,7 @@ const useSetting = (settingName) => {
|
|
|
3100
3134
|
} = context;
|
|
3101
3135
|
return getSetting(settingName);
|
|
3102
3136
|
};
|
|
3103
|
-
const logger$
|
|
3137
|
+
const logger$C = createLogger("useAllowedCountries");
|
|
3104
3138
|
const useAllowedCountries = () => {
|
|
3105
3139
|
const acceptedCountries = useSetting("acceptedCountries");
|
|
3106
3140
|
const {
|
|
@@ -3109,7 +3143,7 @@ const useAllowedCountries = () => {
|
|
|
3109
3143
|
const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
|
|
3110
3144
|
useEffect(() => {
|
|
3111
3145
|
if (acceptedCountries !== void 0) return;
|
|
3112
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$
|
|
3146
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$C.error);
|
|
3113
3147
|
}, [acceptedCountries]);
|
|
3114
3148
|
return allowedCountries;
|
|
3115
3149
|
};
|
|
@@ -3468,7 +3502,7 @@ function reducer({
|
|
|
3468
3502
|
}
|
|
3469
3503
|
};
|
|
3470
3504
|
}
|
|
3471
|
-
const logger$
|
|
3505
|
+
const logger$B = createLogger("useAsyncValidator");
|
|
3472
3506
|
const useAsyncValidator = (asyncRules) => {
|
|
3473
3507
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3474
3508
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -3489,7 +3523,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
3489
3523
|
hasError: !isValid
|
|
3490
3524
|
}])
|
|
3491
3525
|
});
|
|
3492
|
-
}).catch(logger$
|
|
3526
|
+
}).catch(logger$B.error);
|
|
3493
3527
|
}, [asyncRules, clearAsyncValidationResults]);
|
|
3494
3528
|
return {
|
|
3495
3529
|
asyncValidationResults,
|
|
@@ -3743,6 +3777,7 @@ const datasetIdentifier = {
|
|
|
3743
3777
|
function datasetUtilities(locale) {
|
|
3744
3778
|
return {
|
|
3745
3779
|
getCountryName: (countryCode) => {
|
|
3780
|
+
if (!countryCode) return null;
|
|
3746
3781
|
const datasetKey = createDatasetKey(datasetIdentifier.country, locale);
|
|
3747
3782
|
return getDataName(datasetKey, countryCode);
|
|
3748
3783
|
},
|
|
@@ -3909,6 +3944,14 @@ const Field = ({
|
|
|
3909
3944
|
})
|
|
3910
3945
|
});
|
|
3911
3946
|
};
|
|
3947
|
+
const useDebounce = (value, delay) => {
|
|
3948
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
3949
|
+
useEffect(() => {
|
|
3950
|
+
const handler = setTimeout(() => setDebouncedValue(value), delay);
|
|
3951
|
+
return () => clearTimeout(handler);
|
|
3952
|
+
}, [value, delay]);
|
|
3953
|
+
return debouncedValue;
|
|
3954
|
+
};
|
|
3912
3955
|
const getScrollParent = (node) => {
|
|
3913
3956
|
if (!node) return null;
|
|
3914
3957
|
const isElement = node instanceof HTMLElement;
|
|
@@ -3934,16 +3977,6 @@ const Tag = ({
|
|
|
3934
3977
|
children
|
|
3935
3978
|
});
|
|
3936
3979
|
};
|
|
3937
|
-
const styles$4 = {
|
|
3938
|
-
"adyen-kyc-dropdown": "adyen-kyc-dropdown",
|
|
3939
|
-
"adyen-kyc-dropdown-button": "adyen-kyc-dropdown-button",
|
|
3940
|
-
"adyen-kyc-dropdown-button--active": "adyen-kyc-dropdown-button--active",
|
|
3941
|
-
"adyen-kyc-filter-input": "adyen-kyc-filter-input",
|
|
3942
|
-
"adyen-kyc-dropdown-list": "adyen-kyc-dropdown-list",
|
|
3943
|
-
"adyen-kyc-dropdown-list__transformer": "adyen-kyc-dropdown-list__transformer",
|
|
3944
|
-
"adyen-kyc-dropdown-list--active": "adyen-kyc-dropdown-list--active",
|
|
3945
|
-
"adyen-kyc-dropdown-element": "adyen-kyc-dropdown-element"
|
|
3946
|
-
};
|
|
3947
3980
|
function SelectButtonElement({
|
|
3948
3981
|
filterable,
|
|
3949
3982
|
isMulti,
|
|
@@ -3979,6 +4012,7 @@ function SelectButton({
|
|
|
3979
4012
|
isMulti,
|
|
3980
4013
|
id,
|
|
3981
4014
|
isSearch,
|
|
4015
|
+
hideSearchIcon = false,
|
|
3982
4016
|
loading,
|
|
3983
4017
|
textFilter
|
|
3984
4018
|
}) {
|
|
@@ -3991,10 +4025,8 @@ function SelectButton({
|
|
|
3991
4025
|
"aria-haspopup": "listbox",
|
|
3992
4026
|
className: cx({
|
|
3993
4027
|
"adyen-kyc-dropdown-button": true,
|
|
3994
|
-
[styles$4["adyen-kyc-dropdown-button"]]: true,
|
|
3995
4028
|
"adyen-kyc-dropdown-button--readonly": readonly,
|
|
3996
4029
|
"adyen-kyc-dropdown-button--active": showList,
|
|
3997
|
-
[styles$4["adyen-kyc-dropdown-button--active"]]: showList,
|
|
3998
4030
|
"adyen-kyc-dropdown-button--invalid": isInvalid,
|
|
3999
4031
|
"adyen-kyc-dropdown-field--valid": isValid,
|
|
4000
4032
|
"adyen-kyc-dropdown-button-search": isSearch
|
|
@@ -4023,6 +4055,7 @@ function SelectButton({
|
|
|
4023
4055
|
filterable,
|
|
4024
4056
|
onInput,
|
|
4025
4057
|
isSearch,
|
|
4058
|
+
hideSearchIcon,
|
|
4026
4059
|
loading,
|
|
4027
4060
|
textFilter
|
|
4028
4061
|
})
|
|
@@ -4037,6 +4070,7 @@ const SelectButtonContentSingle = ({
|
|
|
4037
4070
|
filterable,
|
|
4038
4071
|
onInput,
|
|
4039
4072
|
isSearch,
|
|
4073
|
+
hideSearchIcon = false,
|
|
4040
4074
|
loading,
|
|
4041
4075
|
textFilter
|
|
4042
4076
|
}) => {
|
|
@@ -4045,17 +4079,17 @@ const SelectButtonContentSingle = ({
|
|
|
4045
4079
|
children: [(activeSingle == null ? void 0 : activeSingle.icon) && jsx("span", {
|
|
4046
4080
|
className: "adyen-kyc-dropdown-button__icon",
|
|
4047
4081
|
children: activeSingle.icon
|
|
4048
|
-
}), isSearch && jsx(Icon, {
|
|
4082
|
+
}), isSearch && !hideSearchIcon && jsx(Icon, {
|
|
4049
4083
|
name: "search",
|
|
4050
4084
|
className: "adyen-kyc-dropdown-button-search__icon"
|
|
4051
4085
|
}), jsx("span", {
|
|
4052
4086
|
className: cx("adyen-kyc-dropdown-button__text", {
|
|
4053
|
-
"adyen-kyc-dropdown-button__text--placeholder": !activeSingle
|
|
4087
|
+
"adyen-kyc-dropdown-button__text--placeholder": !activeSingle && placeholder
|
|
4054
4088
|
}),
|
|
4055
4089
|
children: (activeSingle == null ? void 0 : activeSingle.selectedOptionName) || (activeSingle == null ? void 0 : activeSingle.name) || textFilter || placeholder
|
|
4056
4090
|
})]
|
|
4057
4091
|
}) : jsxs(Fragment, {
|
|
4058
|
-
children: [isSearch && jsx(Icon, {
|
|
4092
|
+
children: [isSearch && !hideSearchIcon && jsx(Icon, {
|
|
4059
4093
|
name: "search",
|
|
4060
4094
|
className: "adyen-kyc-dropdown-button-search__icon"
|
|
4061
4095
|
}), jsx("input", {
|
|
@@ -4064,7 +4098,7 @@ const SelectButtonContentSingle = ({
|
|
|
4064
4098
|
"aria-expanded": showList,
|
|
4065
4099
|
"aria-owns": selectListId,
|
|
4066
4100
|
autoComplete: "off",
|
|
4067
|
-
className: cx("adyen-kyc-filter-input"
|
|
4101
|
+
className: cx("adyen-kyc-filter-input"),
|
|
4068
4102
|
onInput,
|
|
4069
4103
|
placeholder,
|
|
4070
4104
|
ref: filterInputRef,
|
|
@@ -4152,7 +4186,7 @@ const SelectListItem = ({
|
|
|
4152
4186
|
}) => jsx("li", {
|
|
4153
4187
|
"aria-disabled": !!item.disabled,
|
|
4154
4188
|
"aria-selected": selected,
|
|
4155
|
-
className: cx(["adyen-kyc-dropdown-element",
|
|
4189
|
+
className: cx(["adyen-kyc-dropdown-element", {
|
|
4156
4190
|
"adyen-kyc-dropdown-element--active": selected,
|
|
4157
4191
|
"adyen-kyc-dropdown-element--disabled": !!item.disabled,
|
|
4158
4192
|
"adyen-kyc-dropdown-multi-element": isMulti,
|
|
@@ -4283,9 +4317,7 @@ function SelectList({
|
|
|
4283
4317
|
test: true,
|
|
4284
4318
|
"adyen-kyc-dropdown-list--above": showAbove,
|
|
4285
4319
|
"adyen-kyc-dropdown-list": true,
|
|
4286
|
-
|
|
4287
|
-
"adyen-kyc-dropdown-list--active": showList,
|
|
4288
|
-
[styles$4["adyen-kyc-dropdown-list--active"]]: showList
|
|
4320
|
+
"adyen-kyc-dropdown-list--active": showList
|
|
4289
4321
|
}),
|
|
4290
4322
|
id: props.selectListId,
|
|
4291
4323
|
role: "listbox",
|
|
@@ -4317,7 +4349,7 @@ const Select = ({
|
|
|
4317
4349
|
name,
|
|
4318
4350
|
isInvalid = false,
|
|
4319
4351
|
isValid,
|
|
4320
|
-
placeholder,
|
|
4352
|
+
placeholder = "",
|
|
4321
4353
|
isMulti,
|
|
4322
4354
|
uniqueId,
|
|
4323
4355
|
showSelectedItemsAsTags = false,
|
|
@@ -4327,21 +4359,21 @@ const Select = ({
|
|
|
4327
4359
|
loading = false,
|
|
4328
4360
|
getSearchItem,
|
|
4329
4361
|
searchText,
|
|
4362
|
+
onSearchTextChange,
|
|
4330
4363
|
showSearchList
|
|
4331
4364
|
}) => {
|
|
4332
4365
|
const filterInputRef = useRef(null);
|
|
4333
4366
|
const selectContainerRef = useRef(null);
|
|
4334
4367
|
const toggleButtonRef = useRef(null);
|
|
4335
4368
|
const selectListRef = useRef(null);
|
|
4336
|
-
const [textFilter, setTextFilter] = useState(
|
|
4369
|
+
const [textFilter, setTextFilter] = useState(searchText);
|
|
4337
4370
|
const [isShowList, setIsShowList] = useState(false);
|
|
4338
4371
|
const selectListId = useMemo(() => `select-${uuidv4()}`, []);
|
|
4339
4372
|
const active = items.filter((i) => !isMulti ? i.id === selected : selected == null ? void 0 : selected.includes(i.id)) || [];
|
|
4340
4373
|
const [isShowListAbove, setIsShowListAbove] = useState(false);
|
|
4341
4374
|
const [scrollParent, setScrollParent] = useState(null);
|
|
4342
|
-
const debouncedOnSearch = useCallback(debounce(onSearch, 500), [onSearch]);
|
|
4343
4375
|
const closeList = () => {
|
|
4344
|
-
setTextFilter(null);
|
|
4376
|
+
if (!onSearchTextChange) setTextFilter(null);
|
|
4345
4377
|
setIsShowList(false);
|
|
4346
4378
|
if (toggleButtonRef.current) toggleButtonRef.current.focus();
|
|
4347
4379
|
};
|
|
@@ -4452,11 +4484,19 @@ const Select = ({
|
|
|
4452
4484
|
const {
|
|
4453
4485
|
value
|
|
4454
4486
|
} = e.target;
|
|
4455
|
-
if (
|
|
4456
|
-
|
|
4487
|
+
if (onSearchTextChange) {
|
|
4488
|
+
onSearchTextChange == null ? void 0 : onSearchTextChange(value);
|
|
4489
|
+
setTextFilter(value);
|
|
4490
|
+
} else {
|
|
4491
|
+
setTextFilter(value.toLowerCase());
|
|
4457
4492
|
}
|
|
4458
|
-
setTextFilter(value.toLowerCase());
|
|
4459
4493
|
};
|
|
4494
|
+
const debouncedTextFilter = useDebounce(textFilter, 500);
|
|
4495
|
+
useEffect(() => {
|
|
4496
|
+
if (isSearch && (debouncedTextFilter == null ? void 0 : debouncedTextFilter.length) > 2) {
|
|
4497
|
+
onSearch(debouncedTextFilter);
|
|
4498
|
+
}
|
|
4499
|
+
}, [debouncedTextFilter]);
|
|
4460
4500
|
const toggleList = (e) => {
|
|
4461
4501
|
e.preventDefault();
|
|
4462
4502
|
if (isShowList) {
|
|
@@ -4466,9 +4506,9 @@ const Select = ({
|
|
|
4466
4506
|
}
|
|
4467
4507
|
};
|
|
4468
4508
|
useEffect(() => {
|
|
4469
|
-
if (
|
|
4470
|
-
setTextFilter("");
|
|
4471
|
-
}
|
|
4509
|
+
if (!onSearchTextChange) {
|
|
4510
|
+
if (resetSearch) setTextFilter("");
|
|
4511
|
+
} else if (resetSearch && !searchText) setTextFilter("");
|
|
4472
4512
|
}, [resetSearch]);
|
|
4473
4513
|
useEffect(() => {
|
|
4474
4514
|
setTextFilter(searchText);
|
|
@@ -4488,7 +4528,7 @@ const Select = ({
|
|
|
4488
4528
|
};
|
|
4489
4529
|
}, []);
|
|
4490
4530
|
return jsxs("div", {
|
|
4491
|
-
className: cx(["adyen-kyc-dropdown",
|
|
4531
|
+
className: cx(["adyen-kyc-dropdown", className, ...classNameModifiers.map((m) => `adyen-kyc-dropdown--${m}`)]),
|
|
4492
4532
|
ref: selectContainerRef,
|
|
4493
4533
|
onClick: (e) => {
|
|
4494
4534
|
e.stopPropagation();
|
|
@@ -4516,6 +4556,7 @@ const Select = ({
|
|
|
4516
4556
|
isMulti,
|
|
4517
4557
|
showSelectedItemsAsTags,
|
|
4518
4558
|
isSearch,
|
|
4559
|
+
hideSearchIcon: !!onSearchTextChange,
|
|
4519
4560
|
loading,
|
|
4520
4561
|
textFilter
|
|
4521
4562
|
}), jsx(SelectList, {
|
|
@@ -5522,7 +5563,7 @@ const businessRegistrationNumberMasks = {
|
|
|
5522
5563
|
},
|
|
5523
5564
|
[CountryCodes.Cyprus]: {
|
|
5524
5565
|
default: {
|
|
5525
|
-
mask: makeMask(...
|
|
5566
|
+
mask: makeMask(...customInputs(1, /^[COP]$/), ...numericInputs(1), ...numericInputs(7, true)),
|
|
5526
5567
|
transformOnType: uppercase
|
|
5527
5568
|
}
|
|
5528
5569
|
},
|
|
@@ -6363,7 +6404,7 @@ const businessRegistrationNumberPatterns = {
|
|
|
6363
6404
|
soleProprietorship: /^\d{8}$/
|
|
6364
6405
|
},
|
|
6365
6406
|
[CountryCodes.Cyprus]: {
|
|
6366
|
-
default: /^[
|
|
6407
|
+
default: /^[COP]{1}\d{1,8}$/
|
|
6367
6408
|
},
|
|
6368
6409
|
[CountryCodes.CzechRepublic]: {
|
|
6369
6410
|
default: /^\d{8,10}$/
|
|
@@ -6710,13 +6751,11 @@ const defaultFieldConfig$9 = {
|
|
|
6710
6751
|
mask: businessRegistrationNumberMasks[CountryCodes.Cyprus].default,
|
|
6711
6752
|
validators: validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.Cyprus].default),
|
|
6712
6753
|
guidanceText: {
|
|
6713
|
-
key: "
|
|
6754
|
+
key: "enterEnglishLetterFollowedByXtoYDigitsForExample",
|
|
6714
6755
|
values: {
|
|
6715
|
-
minLetters: "1",
|
|
6716
|
-
maxLetters: "2",
|
|
6717
6756
|
minDigits: "1",
|
|
6718
6757
|
maxDigits: "8",
|
|
6719
|
-
example: "
|
|
6758
|
+
example: "C12345678"
|
|
6720
6759
|
}
|
|
6721
6760
|
}
|
|
6722
6761
|
},
|
|
@@ -6912,18 +6951,16 @@ const defaultFieldConfig$9 = {
|
|
|
6912
6951
|
case "partitaIVA":
|
|
6913
6952
|
default:
|
|
6914
6953
|
return {
|
|
6915
|
-
label: "
|
|
6954
|
+
label: "codiceFiscalePartitaIVA",
|
|
6916
6955
|
validators: validatePatternOnBlur(/^\d{11}$/),
|
|
6917
6956
|
mask: {
|
|
6918
|
-
mask: makeMask(...
|
|
6919
|
-
includeInValue: false
|
|
6920
|
-
}), spacer, ...numericInputs(11))
|
|
6957
|
+
mask: makeMask(spacer, ...numericInputs(11))
|
|
6921
6958
|
},
|
|
6922
6959
|
guidanceText: {
|
|
6923
6960
|
key: "enterTheRemainingNDigitsForExample",
|
|
6924
6961
|
values: {
|
|
6925
6962
|
numDigits: "11",
|
|
6926
|
-
example: "
|
|
6963
|
+
example: "47040001100"
|
|
6927
6964
|
}
|
|
6928
6965
|
}
|
|
6929
6966
|
};
|
|
@@ -7413,11 +7450,12 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
|
|
|
7413
7450
|
};
|
|
7414
7451
|
};
|
|
7415
7452
|
const MISMATCH_ANIMATION_NAME = "mismatchShake";
|
|
7416
|
-
const logger$
|
|
7453
|
+
const logger$A = createLogger("MaskedInputText");
|
|
7417
7454
|
const MaskedInputText = ({
|
|
7418
7455
|
value,
|
|
7419
7456
|
onInput,
|
|
7420
7457
|
onBlur,
|
|
7458
|
+
onFocus,
|
|
7421
7459
|
onMismatch: onMismatchExternal,
|
|
7422
7460
|
isValid: validationIsValid,
|
|
7423
7461
|
errorMessage,
|
|
@@ -7459,7 +7497,7 @@ const MaskedInputText = ({
|
|
|
7459
7497
|
};
|
|
7460
7498
|
useEffect(() => {
|
|
7461
7499
|
if (!mask) {
|
|
7462
|
-
logger$
|
|
7500
|
+
logger$A.warn("`mask` is undefined. No masking of input will take place.");
|
|
7463
7501
|
}
|
|
7464
7502
|
}, [mask]);
|
|
7465
7503
|
const getMaskResult = useCallback((pureValue) => {
|
|
@@ -7484,13 +7522,13 @@ const MaskedInputText = ({
|
|
|
7484
7522
|
return;
|
|
7485
7523
|
}
|
|
7486
7524
|
if (preserveMismatchingInitialValue) {
|
|
7487
|
-
logger$
|
|
7525
|
+
logger$A.warn(`Value received "${value}" does not match mask`, maskResult, `
|
|
7488
7526
|
Preserving mismatched initial value until user input.`);
|
|
7489
7527
|
setPreservingMismatchedValue(true);
|
|
7490
7528
|
return;
|
|
7491
7529
|
}
|
|
7492
7530
|
const fallback = displayValueToPure(maskResult.partialDisplayValue);
|
|
7493
|
-
logger$
|
|
7531
|
+
logger$A.warn(`Value received "${value}" does not match mask`, maskResult, `
|
|
7494
7532
|
Falling back to partially valid value "${fallback}"`);
|
|
7495
7533
|
onInput(fallback);
|
|
7496
7534
|
}
|
|
@@ -7585,6 +7623,7 @@ Falling back to partially valid value "${fallback}"`);
|
|
|
7585
7623
|
}
|
|
7586
7624
|
},
|
|
7587
7625
|
onFocusHandler: (event) => {
|
|
7626
|
+
onFocus == null ? void 0 : onFocus();
|
|
7588
7627
|
fieldOnFocus(event);
|
|
7589
7628
|
setIsFocused(true);
|
|
7590
7629
|
},
|
|
@@ -7679,7 +7718,7 @@ const companyRegistrationNumberOptions = {
|
|
|
7679
7718
|
}],
|
|
7680
7719
|
[CountryCodes.Italy]: [{
|
|
7681
7720
|
id: "partitaIVA",
|
|
7682
|
-
name: "
|
|
7721
|
+
name: "codiceFiscalePartitaIVA"
|
|
7683
7722
|
}, {
|
|
7684
7723
|
id: "CCIAA",
|
|
7685
7724
|
name: "CCIAA"
|
|
@@ -10930,7 +10969,7 @@ const ID_NUMBER_EXEMPT_COUNTRIES = [CountryCodes.Canada, CountryCodes.PuertoRico
|
|
|
10930
10969
|
const ID_NUMBER_VERIFICATION_COUNTRIES = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
|
|
10931
10970
|
const COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES = [CountryCodes.HongKong, CountryCodes.Australia, CountryCodes.NewZealand];
|
|
10932
10971
|
const ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES = [CountryCodes.Singapore];
|
|
10933
|
-
const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore];
|
|
10972
|
+
const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore, CountryCodes.HongKong];
|
|
10934
10973
|
const CONTACTS_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
|
|
10935
10974
|
const JOB_TITLE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
|
|
10936
10975
|
const ISSUER_REQUIRED_FOR_COUNTRIES = [CountryCodes.Australia];
|
|
@@ -10941,7 +10980,8 @@ const rules$3 = ({
|
|
|
10941
10980
|
country,
|
|
10942
10981
|
taskType,
|
|
10943
10982
|
isEmbeddedDropin,
|
|
10944
|
-
isExperimentEnabled = () => false
|
|
10983
|
+
isExperimentEnabled = () => false,
|
|
10984
|
+
rootLegalEntity
|
|
10945
10985
|
}) => ({
|
|
10946
10986
|
isDirectorIdNumberRequiredForCountry: () => {
|
|
10947
10987
|
var _a, _b, _c, _d, _e;
|
|
@@ -11006,8 +11046,13 @@ const rules$3 = ({
|
|
|
11006
11046
|
}
|
|
11007
11047
|
},
|
|
11008
11048
|
nationalityIfRequiredForRole: () => {
|
|
11009
|
-
var _a;
|
|
11010
|
-
|
|
11049
|
+
var _a, _b;
|
|
11050
|
+
const enableIdentificationNationalityCrossBorderAssociateCheck = isExperimentEnabled("EnableIdentificationNationalityCrossBorderAssociateCheck");
|
|
11051
|
+
const rootLegalEntityCountry = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _a.registeredAddress.country;
|
|
11052
|
+
if (enableIdentificationNationalityCrossBorderAssociateCheck && rootLegalEntityCountry && NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(rootLegalEntityCountry)) {
|
|
11053
|
+
return REQUIRED;
|
|
11054
|
+
}
|
|
11055
|
+
if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || ((_b = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b.nationality)) {
|
|
11011
11056
|
return REQUIRED;
|
|
11012
11057
|
}
|
|
11013
11058
|
},
|
|
@@ -11047,7 +11092,7 @@ const accountHolderValidationRules = {
|
|
|
11047
11092
|
}
|
|
11048
11093
|
};
|
|
11049
11094
|
const accountHolderFields = ["accountHolder"];
|
|
11050
|
-
const logger$
|
|
11095
|
+
const logger$z = createLogger("AccountHolder");
|
|
11051
11096
|
function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
|
|
11052
11097
|
switch (legalEntityType) {
|
|
11053
11098
|
case LegalEntityType.ORGANIZATION: {
|
|
@@ -11057,7 +11102,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
|
|
|
11057
11102
|
return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
|
|
11058
11103
|
}
|
|
11059
11104
|
default:
|
|
11060
|
-
logger$
|
|
11105
|
+
logger$z.error(`No available account holder options for legal entity type '${legalEntityType}'`);
|
|
11061
11106
|
return [];
|
|
11062
11107
|
}
|
|
11063
11108
|
}
|
|
@@ -11625,7 +11670,7 @@ function Dropzone(props) {
|
|
|
11625
11670
|
})]
|
|
11626
11671
|
});
|
|
11627
11672
|
}
|
|
11628
|
-
const logger$
|
|
11673
|
+
const logger$y = createLogger("TextArea");
|
|
11629
11674
|
function TextArea(props) {
|
|
11630
11675
|
const {
|
|
11631
11676
|
classNameModifiers,
|
|
@@ -11646,7 +11691,7 @@ function TextArea(props) {
|
|
|
11646
11691
|
} = useI18nContext();
|
|
11647
11692
|
const [value, setValue] = useState("");
|
|
11648
11693
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11649
|
-
logger$
|
|
11694
|
+
logger$y.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11650
11695
|
}
|
|
11651
11696
|
const handleInput = (e) => {
|
|
11652
11697
|
var _a;
|
|
@@ -11911,7 +11956,7 @@ const LABELS = {
|
|
|
11911
11956
|
}
|
|
11912
11957
|
};
|
|
11913
11958
|
const getKeyForField = (fieldName, country) => country ? LABELS[fieldName][country] || LABELS[fieldName].default : LABELS[fieldName].default;
|
|
11914
|
-
const getAddressSchemaForCountry = (country) => ADDRESS_SCHEMAS[country]
|
|
11959
|
+
const getAddressSchemaForCountry = (country) => country && ADDRESS_SCHEMAS[country] ? ADDRESS_SCHEMAS[country] : ADDRESS_SCHEMAS.default;
|
|
11915
11960
|
const getAddressSchemaLabelsByCountry = (country) => {
|
|
11916
11961
|
const schema = getAddressSchemaForCountry(country);
|
|
11917
11962
|
return schema.reduce((labels2, field) => ({
|
|
@@ -12097,7 +12142,7 @@ function useIsElementVisible(ref, fallback = true) {
|
|
|
12097
12142
|
}, [ref]);
|
|
12098
12143
|
return isOnScreen;
|
|
12099
12144
|
}
|
|
12100
|
-
const logger$
|
|
12145
|
+
const logger$x = createLogger("SearchAddress");
|
|
12101
12146
|
const SearchAddress = ({
|
|
12102
12147
|
data,
|
|
12103
12148
|
legalEntityId,
|
|
@@ -12141,7 +12186,7 @@ const SearchAddress = ({
|
|
|
12141
12186
|
const response = await handleFindAddress(selectedAddressId);
|
|
12142
12187
|
autocompleteAddressForm(response);
|
|
12143
12188
|
} catch (e) {
|
|
12144
|
-
logger$
|
|
12189
|
+
logger$x.error(e);
|
|
12145
12190
|
}
|
|
12146
12191
|
};
|
|
12147
12192
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -12153,7 +12198,7 @@ const SearchAddress = ({
|
|
|
12153
12198
|
}, legalEntityId);
|
|
12154
12199
|
setItems((response == null ? void 0 : response.results) || []);
|
|
12155
12200
|
} catch (e) {
|
|
12156
|
-
logger$
|
|
12201
|
+
logger$x.error(e);
|
|
12157
12202
|
}
|
|
12158
12203
|
};
|
|
12159
12204
|
const onChange = (e) => {
|
|
@@ -12173,7 +12218,7 @@ const SearchAddress = ({
|
|
|
12173
12218
|
}
|
|
12174
12219
|
setLoading(false);
|
|
12175
12220
|
};
|
|
12176
|
-
const
|
|
12221
|
+
const formatAddressItem2 = (item) => {
|
|
12177
12222
|
if (item.description.includes("Addresses")) {
|
|
12178
12223
|
const splittedDescription = item.description.split(" - ");
|
|
12179
12224
|
if (splittedDescription.length === 1) {
|
|
@@ -12202,18 +12247,18 @@ const SearchAddress = ({
|
|
|
12202
12247
|
country: data.country
|
|
12203
12248
|
}, legalEntityId);
|
|
12204
12249
|
if (response == null ? void 0 : response.results) {
|
|
12205
|
-
const modifiedItems = response.results.map(
|
|
12250
|
+
const modifiedItems = response.results.map(formatAddressItem2);
|
|
12206
12251
|
setItems(modifiedItems);
|
|
12207
12252
|
} else {
|
|
12208
12253
|
setItems([]);
|
|
12209
12254
|
}
|
|
12210
12255
|
} catch (e) {
|
|
12211
|
-
logger$
|
|
12256
|
+
logger$x.error(e);
|
|
12212
12257
|
}
|
|
12213
12258
|
setLoading(false);
|
|
12214
12259
|
}
|
|
12215
12260
|
};
|
|
12216
|
-
const
|
|
12261
|
+
const getFormattedText2 = (highlightItems, text) => {
|
|
12217
12262
|
const formattedText = [];
|
|
12218
12263
|
let lastHighlightIndex = 0;
|
|
12219
12264
|
if (highlightItems[0] === "") {
|
|
@@ -12239,7 +12284,7 @@ const SearchAddress = ({
|
|
|
12239
12284
|
}
|
|
12240
12285
|
return formattedText;
|
|
12241
12286
|
};
|
|
12242
|
-
const
|
|
12287
|
+
const getHighlightedText2 = ({
|
|
12243
12288
|
text,
|
|
12244
12289
|
highlight,
|
|
12245
12290
|
description
|
|
@@ -12253,11 +12298,11 @@ const SearchAddress = ({
|
|
|
12253
12298
|
}
|
|
12254
12299
|
} else {
|
|
12255
12300
|
const highlightItems = highlight.split(";");
|
|
12256
|
-
formattedText =
|
|
12301
|
+
formattedText = getFormattedText2(highlightItems[0].split(","), text);
|
|
12257
12302
|
if (highlightItems.length > 1) {
|
|
12258
12303
|
formattedText.push(`, `);
|
|
12259
12304
|
formattedText.push(jsx(Fragment, {
|
|
12260
|
-
children:
|
|
12305
|
+
children: getFormattedText2(highlightItems[1].split(","), description)
|
|
12261
12306
|
}));
|
|
12262
12307
|
} else if (description) {
|
|
12263
12308
|
formattedText.push(`, ${description}`);
|
|
@@ -12265,10 +12310,10 @@ const SearchAddress = ({
|
|
|
12265
12310
|
}
|
|
12266
12311
|
return formattedText;
|
|
12267
12312
|
};
|
|
12268
|
-
const
|
|
12313
|
+
const generateSearchListItem2 = (item) => jsxs(Fragment, {
|
|
12269
12314
|
children: [jsx("span", {
|
|
12270
12315
|
className: "adyen-kyc-dropdown-search-element__description",
|
|
12271
|
-
children:
|
|
12316
|
+
children: getHighlightedText2(item)
|
|
12272
12317
|
}), item.addressAmount && jsxs("div", {
|
|
12273
12318
|
className: "adyen-kyc-dropdown-search-element__addresses",
|
|
12274
12319
|
children: [item.addressAmount, " ", jsxs("span", {
|
|
@@ -12299,7 +12344,7 @@ const SearchAddress = ({
|
|
|
12299
12344
|
resetSearch,
|
|
12300
12345
|
onSearch: getSearchItems,
|
|
12301
12346
|
loading,
|
|
12302
|
-
getSearchItem:
|
|
12347
|
+
getSearchItem: generateSearchListItem2,
|
|
12303
12348
|
isInvalid: false,
|
|
12304
12349
|
searchText,
|
|
12305
12350
|
showSearchList
|
|
@@ -12586,7 +12631,7 @@ const countrySpecificFormatters = {
|
|
|
12586
12631
|
};
|
|
12587
12632
|
const addressValidationRules = (country) => {
|
|
12588
12633
|
var _a, _b;
|
|
12589
|
-
const postalCodeFormat = (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format;
|
|
12634
|
+
const postalCodeFormat = country ? (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format : void 0;
|
|
12590
12635
|
return {
|
|
12591
12636
|
address: {
|
|
12592
12637
|
modes: ["blur"],
|
|
@@ -12596,7 +12641,7 @@ const addressValidationRules = (country) => {
|
|
|
12596
12641
|
postalCode: {
|
|
12597
12642
|
modes: ["blur"],
|
|
12598
12643
|
validate: (val) => {
|
|
12599
|
-
const pattern = postalCodePatterns[country];
|
|
12644
|
+
const pattern = country ? postalCodePatterns[country] : void 0;
|
|
12600
12645
|
return pattern ? !!val && pattern.test(val) : !!val;
|
|
12601
12646
|
},
|
|
12602
12647
|
errorMessage: postalCodeFormat ? {
|
|
@@ -12625,7 +12670,7 @@ const addressValidationRules = (country) => {
|
|
|
12625
12670
|
};
|
|
12626
12671
|
const addressValidationRulesV4 = (country, i18n) => {
|
|
12627
12672
|
var _a, _b;
|
|
12628
|
-
const postalCodeFormat = (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format;
|
|
12673
|
+
const postalCodeFormat = country ? (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format : void 0;
|
|
12629
12674
|
const MIN_LENGTH_3 = 3;
|
|
12630
12675
|
return {
|
|
12631
12676
|
address: [{
|
|
@@ -12654,7 +12699,7 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12654
12699
|
postalCode: {
|
|
12655
12700
|
modes: ["blur"],
|
|
12656
12701
|
validate: (val) => {
|
|
12657
|
-
const pattern = postalCodePatterns[country];
|
|
12702
|
+
const pattern = country ? postalCodePatterns[country] : void 0;
|
|
12658
12703
|
return pattern ? !!val && pattern.test(val) : !!val;
|
|
12659
12704
|
},
|
|
12660
12705
|
errorMessage: postalCodeFormat ? {
|
|
@@ -12747,11 +12792,10 @@ function Address(props) {
|
|
|
12747
12792
|
const stateRef = useRef({
|
|
12748
12793
|
setState: null
|
|
12749
12794
|
});
|
|
12750
|
-
const addressFields = ADDRESS_SCHEMAS[dataProp == null ? void 0 : dataProp.country] ?? ADDRESS_SCHEMAS.default;
|
|
12751
12795
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
12752
|
-
const requiredFields = (requiredFieldsProp == null ? void 0 : requiredFieldsProp.includes("stateOrProvince")) || dataProp.country && COUNTRIES_WITH_STATES_DATASET.includes(dataProp.country) ?
|
|
12753
|
-
const rules2 = useMemo(() => addressValidationRules(dataProp.country), [dataProp.country]);
|
|
12754
|
-
const rulesV4 = useMemo(() => addressValidationRulesV4(dataProp.country, i18n), [dataProp.country, i18n]);
|
|
12796
|
+
const requiredFields = (requiredFieldsProp == null ? void 0 : requiredFieldsProp.includes("stateOrProvince")) || (dataProp == null ? void 0 : dataProp.country) && COUNTRIES_WITH_STATES_DATASET.includes(dataProp == null ? void 0 : dataProp.country) ? getAddressSchemaForCountry(dataProp == null ? void 0 : dataProp.country) : getAddressSchemaForCountry(dataProp == null ? void 0 : dataProp.country).filter((ad) => ad !== "stateOrProvince");
|
|
12797
|
+
const rules2 = useMemo(() => addressValidationRules(dataProp == null ? void 0 : dataProp.country), [dataProp == null ? void 0 : dataProp.country]);
|
|
12798
|
+
const rulesV4 = useMemo(() => addressValidationRulesV4(dataProp == null ? void 0 : dataProp.country, i18n), [dataProp == null ? void 0 : dataProp.country, i18n]);
|
|
12755
12799
|
const {
|
|
12756
12800
|
data,
|
|
12757
12801
|
errors,
|
|
@@ -12779,7 +12823,7 @@ function Address(props) {
|
|
|
12779
12823
|
optionalFields: optionalFieldsProp
|
|
12780
12824
|
}, i18n);
|
|
12781
12825
|
useEffect(() => {
|
|
12782
|
-
if (dataProp.country !== data.country && dataProp.country) {
|
|
12826
|
+
if ((dataProp == null ? void 0 : dataProp.country) !== data.country && (dataProp == null ? void 0 : dataProp.country)) {
|
|
12783
12827
|
requiredFields.forEach((field) => {
|
|
12784
12828
|
handleChangeFor(field, "input")("");
|
|
12785
12829
|
});
|
|
@@ -12787,7 +12831,7 @@ function Address(props) {
|
|
|
12787
12831
|
setShowAutocompletedAddressFields(false);
|
|
12788
12832
|
setShowAddAddressButton(true);
|
|
12789
12833
|
}
|
|
12790
|
-
}, [dataProp.country]);
|
|
12834
|
+
}, [dataProp == null ? void 0 : dataProp.country]);
|
|
12791
12835
|
useEffect(() => {
|
|
12792
12836
|
if (handleAddressSearch && handleFindAddress) {
|
|
12793
12837
|
setIsHandlerPresent(true);
|
|
@@ -12798,12 +12842,13 @@ function Address(props) {
|
|
|
12798
12842
|
}
|
|
12799
12843
|
}, []);
|
|
12800
12844
|
useEffect(() => {
|
|
12845
|
+
var _a, _b;
|
|
12801
12846
|
const processedData = ADDRESS_SCHEMA.reduce((acc, cur) => {
|
|
12802
12847
|
if (!formUtils.isRequiredField(cur)) {
|
|
12803
12848
|
delete acc[cur];
|
|
12804
12849
|
return acc;
|
|
12805
12850
|
}
|
|
12806
|
-
const fallbackValue = !formUtils.isRequiredField(cur) && !data[cur] && dataProp[cur] ? dataProp[cur] : "N/A";
|
|
12851
|
+
const fallbackValue = !formUtils.isRequiredField(cur) && !data[cur] && (dataProp == null ? void 0 : dataProp[cur]) ? dataProp[cur] : "N/A";
|
|
12807
12852
|
return {
|
|
12808
12853
|
...acc,
|
|
12809
12854
|
[cur]: formUtils.isRequiredField(cur) || !!data[cur] ? data[cur] : fallbackValue
|
|
@@ -12838,7 +12883,7 @@ function Address(props) {
|
|
|
12838
12883
|
},
|
|
12839
12884
|
isValid
|
|
12840
12885
|
});
|
|
12841
|
-
stateRef.current.setState({
|
|
12886
|
+
(_b = (_a = stateRef.current).setState) == null ? void 0 : _b.call(_a, {
|
|
12842
12887
|
type: "addToState",
|
|
12843
12888
|
value: {
|
|
12844
12889
|
...addressState,
|
|
@@ -12898,8 +12943,8 @@ function Address(props) {
|
|
|
12898
12943
|
}) => {
|
|
12899
12944
|
const hasHouseNumber = !!houseNumberOrName;
|
|
12900
12945
|
if (hasHouseNumber) {
|
|
12901
|
-
const isHouseNumberFirst = COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country);
|
|
12902
|
-
const needsComma = COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country);
|
|
12946
|
+
const isHouseNumberFirst = data.country ? COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country) : false;
|
|
12947
|
+
const needsComma = data.country ? COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country) : false;
|
|
12903
12948
|
const formattedAddress = isHouseNumberFirst ? `${houseNumberOrName}${needsComma ? ", " : " "}${street}` : `${street}${needsComma ? ", " : " "}${houseNumberOrName}`;
|
|
12904
12949
|
return handleChangeFor("address", "input")(formattedAddress);
|
|
12905
12950
|
}
|
|
@@ -12941,7 +12986,7 @@ function Address(props) {
|
|
|
12941
12986
|
className: "adyen-kyc-search-address",
|
|
12942
12987
|
children: [jsx(SearchAddress, {
|
|
12943
12988
|
handleChangeFor,
|
|
12944
|
-
data: dataProp,
|
|
12989
|
+
data: dataProp ?? {},
|
|
12945
12990
|
handleAddressSearch,
|
|
12946
12991
|
handleFindAddress,
|
|
12947
12992
|
legalEntityId,
|
|
@@ -12955,7 +13000,7 @@ function Address(props) {
|
|
|
12955
13000
|
className: "adyen-kyc-search-address--below-location",
|
|
12956
13001
|
children: [jsx(Icon, {
|
|
12957
13002
|
name: "location"
|
|
12958
|
-
}), datasetUtils.getCountryName(dataProp.country)]
|
|
13003
|
+
}), datasetUtils.getCountryName(dataProp == null ? void 0 : dataProp.country)]
|
|
12959
13004
|
}), showAddAddressButton && jsx(Button, {
|
|
12960
13005
|
showAsLink: true,
|
|
12961
13006
|
testId: "addAddressManuallyBtn",
|
|
@@ -12979,6 +13024,460 @@ Address.defaultProps = {
|
|
|
12979
13024
|
requiredFields: ADDRESS_SCHEMA,
|
|
12980
13025
|
countryCode: null
|
|
12981
13026
|
};
|
|
13027
|
+
const logger$w = createLogger("AddressFieldContainer");
|
|
13028
|
+
const formatAddressItem = (item) => {
|
|
13029
|
+
if (item.description.includes("Addresses")) {
|
|
13030
|
+
const splittedDescription = item.description.split(" - ");
|
|
13031
|
+
if (splittedDescription.length === 1) {
|
|
13032
|
+
return {
|
|
13033
|
+
...item,
|
|
13034
|
+
description: "",
|
|
13035
|
+
addressAmount: splittedDescription[0].replace("Addresses", "")
|
|
13036
|
+
};
|
|
13037
|
+
}
|
|
13038
|
+
return {
|
|
13039
|
+
...item,
|
|
13040
|
+
description: splittedDescription[0],
|
|
13041
|
+
addressAmount: splittedDescription[1].replace("Addresses", "")
|
|
13042
|
+
};
|
|
13043
|
+
}
|
|
13044
|
+
return item;
|
|
13045
|
+
};
|
|
13046
|
+
const getFormattedText = (highlightItems, text) => {
|
|
13047
|
+
const formattedText = [];
|
|
13048
|
+
let lastHighlightIndex = 0;
|
|
13049
|
+
if (highlightItems[0] === "") {
|
|
13050
|
+
return [text];
|
|
13051
|
+
}
|
|
13052
|
+
highlightItems.forEach((highlightValue) => {
|
|
13053
|
+
const highlightRange = highlightValue.split("-");
|
|
13054
|
+
const highlightInit = parseInt(highlightRange[0]);
|
|
13055
|
+
const highlightEnd = parseInt(highlightRange[1]);
|
|
13056
|
+
if (lastHighlightIndex < highlightInit) {
|
|
13057
|
+
const remain = text.substring(lastHighlightIndex, highlightInit);
|
|
13058
|
+
formattedText.push(`${remain}`);
|
|
13059
|
+
}
|
|
13060
|
+
const boldText = text.substring(highlightInit, highlightEnd);
|
|
13061
|
+
formattedText.push(jsx("span", {
|
|
13062
|
+
className: "adyen-kyc-dropdown-search-element__description--highlight",
|
|
13063
|
+
children: boldText
|
|
13064
|
+
}));
|
|
13065
|
+
lastHighlightIndex = highlightEnd;
|
|
13066
|
+
});
|
|
13067
|
+
if (lastHighlightIndex < text.length) {
|
|
13068
|
+
formattedText.push(`${text.substring(lastHighlightIndex)}`);
|
|
13069
|
+
}
|
|
13070
|
+
return formattedText;
|
|
13071
|
+
};
|
|
13072
|
+
const getHighlightedText = ({
|
|
13073
|
+
text = "",
|
|
13074
|
+
highlight = "",
|
|
13075
|
+
description = ""
|
|
13076
|
+
}) => {
|
|
13077
|
+
let formattedText = [];
|
|
13078
|
+
if (highlight === "") {
|
|
13079
|
+
if (description) {
|
|
13080
|
+
formattedText.push(`${text}, ${description}`);
|
|
13081
|
+
} else {
|
|
13082
|
+
formattedText.push(text);
|
|
13083
|
+
}
|
|
13084
|
+
} else {
|
|
13085
|
+
const highlightItems = highlight.split(";");
|
|
13086
|
+
formattedText = getFormattedText(highlightItems[0].split(","), text);
|
|
13087
|
+
if (highlightItems.length > 1) {
|
|
13088
|
+
formattedText.push(`, `);
|
|
13089
|
+
formattedText.push(jsx(Fragment, {
|
|
13090
|
+
children: getFormattedText(highlightItems[1].split(","), description)
|
|
13091
|
+
}));
|
|
13092
|
+
} else if (description) {
|
|
13093
|
+
formattedText.push(`, ${description}`);
|
|
13094
|
+
}
|
|
13095
|
+
}
|
|
13096
|
+
return formattedText;
|
|
13097
|
+
};
|
|
13098
|
+
const generateSearchListItem = (item, i18n) => jsxs(Fragment, {
|
|
13099
|
+
children: [jsx("span", {
|
|
13100
|
+
className: "adyen-kyc-dropdown-search-element__description",
|
|
13101
|
+
children: getHighlightedText(item)
|
|
13102
|
+
}), item.addressAmount && jsxs("div", {
|
|
13103
|
+
className: "adyen-kyc-dropdown-search-element__addresses",
|
|
13104
|
+
children: [item.addressAmount, " ", jsxs("span", {
|
|
13105
|
+
className: "adyen-kyc-dropdown-search-element__addresses--text",
|
|
13106
|
+
children: [" ", i18n.get("addresses")]
|
|
13107
|
+
}), jsx(Icon, {
|
|
13108
|
+
name: "arrow-right",
|
|
13109
|
+
className: "adyen-kyc-dropdown-search-element__addresses--icon"
|
|
13110
|
+
})]
|
|
13111
|
+
})]
|
|
13112
|
+
});
|
|
13113
|
+
function FieldContainerComponent({
|
|
13114
|
+
legalEntityId = "",
|
|
13115
|
+
classNameModifiers = [],
|
|
13116
|
+
schema,
|
|
13117
|
+
data,
|
|
13118
|
+
valid,
|
|
13119
|
+
errors,
|
|
13120
|
+
fieldProblems,
|
|
13121
|
+
fieldName,
|
|
13122
|
+
trimOnBlur,
|
|
13123
|
+
hideField,
|
|
13124
|
+
maxlength,
|
|
13125
|
+
readOnly,
|
|
13126
|
+
optional,
|
|
13127
|
+
handleChangeFor,
|
|
13128
|
+
handleAddressSearch,
|
|
13129
|
+
handleFindAddress
|
|
13130
|
+
}) {
|
|
13131
|
+
const {
|
|
13132
|
+
i18n
|
|
13133
|
+
} = useI18nContext();
|
|
13134
|
+
useEffect(() => {
|
|
13135
|
+
setItems([]);
|
|
13136
|
+
setSearchText("");
|
|
13137
|
+
setResetSearch(true);
|
|
13138
|
+
}, [data.country]);
|
|
13139
|
+
const formUtils = formUtilities({
|
|
13140
|
+
data
|
|
13141
|
+
}, i18n);
|
|
13142
|
+
const errorMessage = formUtils.getErrorMessage(fieldName, errors ?? {}, fieldProblems);
|
|
13143
|
+
const value = data[fieldName];
|
|
13144
|
+
const labelKey = getKeyForField(fieldName, data.country);
|
|
13145
|
+
const [items, setItems] = useState([]);
|
|
13146
|
+
const [loading, setLoading] = useState(false);
|
|
13147
|
+
const [resetSearch, setResetSearch] = useState(false);
|
|
13148
|
+
const [showSearchList, setShowSearchList] = useState(false);
|
|
13149
|
+
const [selectedAddressId, setSelectedAddressId] = useState();
|
|
13150
|
+
const [searchText, setSearchText] = useState(data.address);
|
|
13151
|
+
useEffect(() => {
|
|
13152
|
+
setSearchText(data.address);
|
|
13153
|
+
}, [data.address]);
|
|
13154
|
+
const setAddressField = ({
|
|
13155
|
+
houseNumberOrName,
|
|
13156
|
+
street
|
|
13157
|
+
}) => {
|
|
13158
|
+
const hasHouseNumber = !!houseNumberOrName;
|
|
13159
|
+
if (hasHouseNumber) {
|
|
13160
|
+
const isHouseNumberFirst = data.country ? COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country) : false;
|
|
13161
|
+
const needsComma = data.country ? COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country) : false;
|
|
13162
|
+
const formattedAddress = isHouseNumberFirst ? `${houseNumberOrName}${needsComma ? ", " : " "}${street}` : `${street}${needsComma ? ", " : " "}${houseNumberOrName}`;
|
|
13163
|
+
return handleChangeFor("address", "input")(formattedAddress);
|
|
13164
|
+
}
|
|
13165
|
+
return handleChangeFor("address", "input")(street);
|
|
13166
|
+
};
|
|
13167
|
+
const getSearchItems = async (text) => {
|
|
13168
|
+
if (!text || !data.country) return setItems([]);
|
|
13169
|
+
try {
|
|
13170
|
+
setLoading(true);
|
|
13171
|
+
const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch({
|
|
13172
|
+
text,
|
|
13173
|
+
country: data.country
|
|
13174
|
+
}, legalEntityId));
|
|
13175
|
+
if (response == null ? void 0 : response.results) {
|
|
13176
|
+
setItems(response.results.map(formatAddressItem));
|
|
13177
|
+
} else {
|
|
13178
|
+
setItems([]);
|
|
13179
|
+
}
|
|
13180
|
+
} catch (e) {
|
|
13181
|
+
logger$w.error(e);
|
|
13182
|
+
}
|
|
13183
|
+
setLoading(false);
|
|
13184
|
+
};
|
|
13185
|
+
const onFindAddress = async (addressId) => {
|
|
13186
|
+
try {
|
|
13187
|
+
const response = await (handleFindAddress == null ? void 0 : handleFindAddress(addressId));
|
|
13188
|
+
if (response) {
|
|
13189
|
+
schema == null ? void 0 : schema.forEach((field) => {
|
|
13190
|
+
switch (field) {
|
|
13191
|
+
case "country":
|
|
13192
|
+
handleChangeFor("country", "input")(response.country ?? " ");
|
|
13193
|
+
break;
|
|
13194
|
+
case "address":
|
|
13195
|
+
setAddressField(response);
|
|
13196
|
+
break;
|
|
13197
|
+
case "otherAddressInformation":
|
|
13198
|
+
handleChangeFor("otherAddressInformation", "blur")(response.street2 ?? " ");
|
|
13199
|
+
break;
|
|
13200
|
+
case "city":
|
|
13201
|
+
handleChangeFor("city", "input")(response.city ?? " ");
|
|
13202
|
+
break;
|
|
13203
|
+
case "postalCode":
|
|
13204
|
+
handleChangeFor("postalCode", "input")(response.postalCode ?? " ");
|
|
13205
|
+
break;
|
|
13206
|
+
case "stateOrProvince":
|
|
13207
|
+
handleChangeFor("stateOrProvince", "input")(response.stateOrProvince ?? " ");
|
|
13208
|
+
break;
|
|
13209
|
+
default:
|
|
13210
|
+
break;
|
|
13211
|
+
}
|
|
13212
|
+
});
|
|
13213
|
+
}
|
|
13214
|
+
} catch (e) {
|
|
13215
|
+
logger$w.error(e);
|
|
13216
|
+
}
|
|
13217
|
+
};
|
|
13218
|
+
const onDrilldown = async (address) => {
|
|
13219
|
+
if (!data.country) return;
|
|
13220
|
+
try {
|
|
13221
|
+
const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch({
|
|
13222
|
+
text: address.text,
|
|
13223
|
+
country: data.country,
|
|
13224
|
+
container: address.id
|
|
13225
|
+
}, legalEntityId));
|
|
13226
|
+
setItems((response == null ? void 0 : response.results) || []);
|
|
13227
|
+
} catch (e) {
|
|
13228
|
+
logger$w.error(e);
|
|
13229
|
+
}
|
|
13230
|
+
};
|
|
13231
|
+
const handleOnChange = (e) => {
|
|
13232
|
+
const addressId = e.target.value;
|
|
13233
|
+
setSelectedAddressId(addressId);
|
|
13234
|
+
setLoading(true);
|
|
13235
|
+
const selectedAddress = items.filter((i) => i.id === addressId)[0];
|
|
13236
|
+
if (selectedAddress.type === "Address") {
|
|
13237
|
+
onFindAddress(selectedAddress.id);
|
|
13238
|
+
setShowSearchList(false);
|
|
13239
|
+
} else {
|
|
13240
|
+
onDrilldown(selectedAddress);
|
|
13241
|
+
setShowSearchList(true);
|
|
13242
|
+
}
|
|
13243
|
+
setLoading(false);
|
|
13244
|
+
};
|
|
13245
|
+
const renderField = (field) => {
|
|
13246
|
+
switch (field) {
|
|
13247
|
+
case "address":
|
|
13248
|
+
return handleAddressSearch && handleFindAddress ? jsx(Field, {
|
|
13249
|
+
name: field,
|
|
13250
|
+
label: i18n.get(labelKey),
|
|
13251
|
+
classNameModifiers,
|
|
13252
|
+
errorMessage,
|
|
13253
|
+
isValid: valid == null ? void 0 : valid[field],
|
|
13254
|
+
optional,
|
|
13255
|
+
children: (childProps) => jsx(Select, {
|
|
13256
|
+
...childProps,
|
|
13257
|
+
isSearch: true,
|
|
13258
|
+
name: field,
|
|
13259
|
+
items: items.map((item) => ({
|
|
13260
|
+
...item,
|
|
13261
|
+
name: ""
|
|
13262
|
+
})),
|
|
13263
|
+
selected: selectedAddressId,
|
|
13264
|
+
loading,
|
|
13265
|
+
onChange: handleOnChange,
|
|
13266
|
+
onSearch: getSearchItems,
|
|
13267
|
+
onSearchTextChange: (text) => handleChangeFor("address", "input")(text),
|
|
13268
|
+
getSearchItem: (item) => generateSearchListItem(item, i18n),
|
|
13269
|
+
showSearchList,
|
|
13270
|
+
resetSearch,
|
|
13271
|
+
searchText
|
|
13272
|
+
})
|
|
13273
|
+
}) : jsx(Field, {
|
|
13274
|
+
name: field,
|
|
13275
|
+
label: i18n.get(labelKey),
|
|
13276
|
+
classNameModifiers,
|
|
13277
|
+
errorMessage,
|
|
13278
|
+
isValid: valid == null ? void 0 : valid[field],
|
|
13279
|
+
optional,
|
|
13280
|
+
children: (childProps) => jsx(InputText, {
|
|
13281
|
+
...childProps,
|
|
13282
|
+
classNameModifiers,
|
|
13283
|
+
name: field,
|
|
13284
|
+
value,
|
|
13285
|
+
onInput: handleChangeFor(fieldName, "input"),
|
|
13286
|
+
onBlur: handleChangeFor(fieldName, "blur"),
|
|
13287
|
+
maxLength: maxlength,
|
|
13288
|
+
"aria-required": true,
|
|
13289
|
+
"aria-label": i18n.get(labelKey),
|
|
13290
|
+
"aria-invalid": !(valid == null ? void 0 : valid[field]),
|
|
13291
|
+
trimOnBlur,
|
|
13292
|
+
readonly: readOnly
|
|
13293
|
+
})
|
|
13294
|
+
});
|
|
13295
|
+
case "country":
|
|
13296
|
+
return jsx(CountryField, {
|
|
13297
|
+
data: {
|
|
13298
|
+
country: value
|
|
13299
|
+
},
|
|
13300
|
+
valid: {
|
|
13301
|
+
country: valid == null ? void 0 : valid.country
|
|
13302
|
+
},
|
|
13303
|
+
errors: {
|
|
13304
|
+
country: errorMessage
|
|
13305
|
+
},
|
|
13306
|
+
labels: {
|
|
13307
|
+
country: formUtils.getLabel(field, labelKey)
|
|
13308
|
+
},
|
|
13309
|
+
readonly: Boolean(readOnly),
|
|
13310
|
+
classNameModifiers,
|
|
13311
|
+
className: hideField ? "adyen-kyc-search-fieldcontainer-hide" : "",
|
|
13312
|
+
handleChangeFor
|
|
13313
|
+
});
|
|
13314
|
+
case "stateOrProvince":
|
|
13315
|
+
return jsx(StateField, {
|
|
13316
|
+
data: {
|
|
13317
|
+
stateOrProvince: value
|
|
13318
|
+
},
|
|
13319
|
+
valid: {
|
|
13320
|
+
stateOrProvince: valid == null ? void 0 : valid.stateOrProvince
|
|
13321
|
+
},
|
|
13322
|
+
errors: {
|
|
13323
|
+
stateOrProvince: errorMessage
|
|
13324
|
+
},
|
|
13325
|
+
labels: {
|
|
13326
|
+
stateOrProvince: formUtils.getLabel(field, labelKey)
|
|
13327
|
+
},
|
|
13328
|
+
readonly: Boolean(readOnly),
|
|
13329
|
+
classNameModifiers,
|
|
13330
|
+
selectedCountry: data.country,
|
|
13331
|
+
handleChangeFor
|
|
13332
|
+
});
|
|
13333
|
+
default:
|
|
13334
|
+
return jsx(Field, {
|
|
13335
|
+
name: field,
|
|
13336
|
+
label: i18n.get(labelKey),
|
|
13337
|
+
classNameModifiers,
|
|
13338
|
+
errorMessage,
|
|
13339
|
+
isValid: valid == null ? void 0 : valid[field],
|
|
13340
|
+
optional,
|
|
13341
|
+
children: (childProps) => jsx(InputText, {
|
|
13342
|
+
...childProps,
|
|
13343
|
+
classNameModifiers,
|
|
13344
|
+
name: field,
|
|
13345
|
+
value: field === "postalCode" ? value == null ? void 0 : value.toUpperCase() : value,
|
|
13346
|
+
onInput: handleChangeFor(fieldName, "input"),
|
|
13347
|
+
onBlur: handleChangeFor(fieldName, "blur"),
|
|
13348
|
+
maxLength: maxlength,
|
|
13349
|
+
"aria-required": true,
|
|
13350
|
+
"aria-label": i18n.get(labelKey),
|
|
13351
|
+
"aria-invalid": !(valid == null ? void 0 : valid[field]),
|
|
13352
|
+
trimOnBlur,
|
|
13353
|
+
readonly: readOnly
|
|
13354
|
+
})
|
|
13355
|
+
});
|
|
13356
|
+
}
|
|
13357
|
+
};
|
|
13358
|
+
return hideField ? null : renderField(fieldName);
|
|
13359
|
+
}
|
|
13360
|
+
function AddressComponent({
|
|
13361
|
+
data,
|
|
13362
|
+
labels: labels2,
|
|
13363
|
+
placeholders,
|
|
13364
|
+
helperText,
|
|
13365
|
+
readOnly,
|
|
13366
|
+
hideCountry,
|
|
13367
|
+
fieldValidationErrors,
|
|
13368
|
+
allFields,
|
|
13369
|
+
requiredFields,
|
|
13370
|
+
optionalFields = ["otherAddressInformation"],
|
|
13371
|
+
readOnlyFields,
|
|
13372
|
+
trustedFields,
|
|
13373
|
+
shouldValidate,
|
|
13374
|
+
handleAddressSearch,
|
|
13375
|
+
handleFindAddress,
|
|
13376
|
+
onChange,
|
|
13377
|
+
legalEntityId,
|
|
13378
|
+
verifiedAddress
|
|
13379
|
+
}) {
|
|
13380
|
+
const {
|
|
13381
|
+
i18n
|
|
13382
|
+
} = useI18nContext();
|
|
13383
|
+
const {
|
|
13384
|
+
isExperimentEnabled
|
|
13385
|
+
} = useExperimentsContext();
|
|
13386
|
+
const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(ExperimentNames.StrictNameAndAddressValidationV4);
|
|
13387
|
+
const schema = useMemo(() => {
|
|
13388
|
+
if (requiredFields == null ? void 0 : requiredFields.length) {
|
|
13389
|
+
return (requiredFields == null ? void 0 : requiredFields.includes("stateOrProvince")) || (data == null ? void 0 : data.country) && COUNTRIES_WITH_STATES_DATASET.includes(data == null ? void 0 : data.country) ? requiredFields : requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "stateOrProvince");
|
|
13390
|
+
}
|
|
13391
|
+
return (data == null ? void 0 : data.country) && COUNTRIES_WITH_STATES_DATASET.includes(data == null ? void 0 : data.country) ? getAddressSchemaForCountry(data == null ? void 0 : data.country) : getAddressSchemaForCountry(data == null ? void 0 : data.country).filter((ad) => ad !== "stateOrProvince");
|
|
13392
|
+
}, [data == null ? void 0 : data.country, requiredFields]);
|
|
13393
|
+
const rules2 = useMemo(() => addressValidationRules(data == null ? void 0 : data.country), [data == null ? void 0 : data.country]);
|
|
13394
|
+
const rulesV4 = useMemo(() => addressValidationRulesV4(data == null ? void 0 : data.country, i18n), [data == null ? void 0 : data.country, i18n]);
|
|
13395
|
+
const {
|
|
13396
|
+
schema: formSchema,
|
|
13397
|
+
data: formData,
|
|
13398
|
+
errors: formErrors,
|
|
13399
|
+
valid: formValid,
|
|
13400
|
+
fieldProblems: formFieldProblems,
|
|
13401
|
+
handleChangeFor,
|
|
13402
|
+
isValid
|
|
13403
|
+
} = useForm({
|
|
13404
|
+
schema,
|
|
13405
|
+
defaultData: data,
|
|
13406
|
+
formatters: addressFormatters,
|
|
13407
|
+
rules: isStrictNameAndAddressValidationEnabled ? rulesV4 : rules2,
|
|
13408
|
+
fieldProblems: fieldValidationErrors,
|
|
13409
|
+
optionalFields,
|
|
13410
|
+
obscuredFields: [],
|
|
13411
|
+
trustedFields: [],
|
|
13412
|
+
shouldValidate
|
|
13413
|
+
});
|
|
13414
|
+
useEffect(
|
|
13415
|
+
() => verifiedAddress ? entriesOf(verifiedAddress).forEach(([key, value]) => {
|
|
13416
|
+
if (formData[key] !== value) handleChangeFor(key, "input")(value);
|
|
13417
|
+
}) : formSchema.forEach((field) => handleChangeFor(field, "input")((data == null ? void 0 : data[field]) ?? " ")),
|
|
13418
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13419
|
+
[verifiedAddress]
|
|
13420
|
+
);
|
|
13421
|
+
const formUtils = formUtilities({
|
|
13422
|
+
data,
|
|
13423
|
+
labels: labels2,
|
|
13424
|
+
placeholders,
|
|
13425
|
+
helperText,
|
|
13426
|
+
readOnly,
|
|
13427
|
+
allFields,
|
|
13428
|
+
requiredFields: schema,
|
|
13429
|
+
optionalFields,
|
|
13430
|
+
readOnlyFields,
|
|
13431
|
+
trustedFields
|
|
13432
|
+
}, i18n);
|
|
13433
|
+
useEffect(() => {
|
|
13434
|
+
onChange == null ? void 0 : onChange({
|
|
13435
|
+
schema: formSchema,
|
|
13436
|
+
data: formData,
|
|
13437
|
+
valid: formValid,
|
|
13438
|
+
errors: formErrors,
|
|
13439
|
+
fieldProblems: formFieldProblems,
|
|
13440
|
+
isValid
|
|
13441
|
+
});
|
|
13442
|
+
}, [formData, formErrors, formFieldProblems, formSchema, formValid, isValid]);
|
|
13443
|
+
const createFieldComponent = (fieldName) => {
|
|
13444
|
+
if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
|
|
13445
|
+
const hideField = fieldName === "country" && hideCountry;
|
|
13446
|
+
return jsx(FieldContainerComponent, {
|
|
13447
|
+
classNameModifiers: [fieldName],
|
|
13448
|
+
schema: formSchema,
|
|
13449
|
+
data: formData,
|
|
13450
|
+
valid: formValid,
|
|
13451
|
+
errors: formErrors,
|
|
13452
|
+
fieldProblems: formFieldProblems,
|
|
13453
|
+
fieldName,
|
|
13454
|
+
maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, formData.country),
|
|
13455
|
+
hideField,
|
|
13456
|
+
"aria-label": formUtils.getLabel(fieldName, fieldName),
|
|
13457
|
+
readOnly: formUtils.isReadOnly(fieldName),
|
|
13458
|
+
optional: formUtils.isOptionalField(fieldName),
|
|
13459
|
+
trimOnBlur: true,
|
|
13460
|
+
legalEntityId,
|
|
13461
|
+
handleChangeFor,
|
|
13462
|
+
handleAddressSearch,
|
|
13463
|
+
handleFindAddress
|
|
13464
|
+
}, fieldName);
|
|
13465
|
+
};
|
|
13466
|
+
return jsx("fieldset", {
|
|
13467
|
+
className: "adyen-kyc__address",
|
|
13468
|
+
children: formSchema.map((field) => createFieldComponent(field))
|
|
13469
|
+
});
|
|
13470
|
+
}
|
|
13471
|
+
function AddressExperimentWrapper(props) {
|
|
13472
|
+
const {
|
|
13473
|
+
isExperimentEnabled
|
|
13474
|
+
} = useExperimentsContext();
|
|
13475
|
+
return isExperimentEnabled("EnableNewAddressComponent") ? jsx(AddressComponent, {
|
|
13476
|
+
...props
|
|
13477
|
+
}) : jsx(Address, {
|
|
13478
|
+
...props
|
|
13479
|
+
});
|
|
13480
|
+
}
|
|
12982
13481
|
var operationalAddressIsSameIds = /* @__PURE__ */ ((operationalAddressIsSameIds2) => {
|
|
12983
13482
|
operationalAddressIsSameIds2["OPERATIONAL_ADDRESS_IS_SAME"] = "OperationAddressAnswerYes";
|
|
12984
13483
|
operationalAddressIsSameIds2["OPERATIONAL_ADDRESS_IS_NOT_SAME"] = "OperationAddressAnswerNo";
|
|
@@ -13043,7 +13542,8 @@ function RegistrationAddressComponent(props) {
|
|
|
13043
13542
|
valid: formValid,
|
|
13044
13543
|
errors: formErrors,
|
|
13045
13544
|
fieldProblems: formFieldProblems,
|
|
13046
|
-
handleChangeFor
|
|
13545
|
+
handleChangeFor,
|
|
13546
|
+
setValid
|
|
13047
13547
|
} = useForm({
|
|
13048
13548
|
...props,
|
|
13049
13549
|
schema: ["operationalAddressIsSame"],
|
|
@@ -13080,10 +13580,25 @@ function RegistrationAddressComponent(props) {
|
|
|
13080
13580
|
schema: ["registrationAddress", "operationalAddressIsSame", ...isOperationAddressNotSame() ? ["operationalAddress"] : []]
|
|
13081
13581
|
}
|
|
13082
13582
|
});
|
|
13083
|
-
}, [formData
|
|
13583
|
+
}, [formData, formValid, formErrors, formFieldProblems]);
|
|
13084
13584
|
const isOperationAddressNotSame = () => formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME;
|
|
13085
13585
|
const registrationAddressFormProps = getFormProps(props, registrationAddressFormID);
|
|
13086
13586
|
const operationalAddressFormProps = getFormProps(props, operationalAddressFormID);
|
|
13587
|
+
const handleRegistrationAddressChange = (state) => {
|
|
13588
|
+
handleChangeFor("registrationAddress")(state.data);
|
|
13589
|
+
setValid("registrationAddress", Boolean(state.isValid));
|
|
13590
|
+
};
|
|
13591
|
+
const handleOperationalAddressChange = (state) => {
|
|
13592
|
+
handleChangeFor("operationalAddress")(state.data);
|
|
13593
|
+
setValid("operationalAddress", Boolean(state.isValid));
|
|
13594
|
+
};
|
|
13595
|
+
const handleOperationalAddressIsSameChange = (e) => {
|
|
13596
|
+
const {
|
|
13597
|
+
value
|
|
13598
|
+
} = e.target;
|
|
13599
|
+
handleChangeFor("operationalAddressIsSame")(value);
|
|
13600
|
+
if (value === "OperationAddressAnswerYes") setValid("operationalAddress", true);
|
|
13601
|
+
};
|
|
13087
13602
|
return jsxs(Fragment, {
|
|
13088
13603
|
children: [jsx(StateContextSetter, {
|
|
13089
13604
|
owner: id,
|
|
@@ -13102,7 +13617,7 @@ function RegistrationAddressComponent(props) {
|
|
|
13102
13617
|
contentId: "reasonForFillingCompanyAddressDetails",
|
|
13103
13618
|
title: i18n.get("whyDoINeedToFillInThisInformation"),
|
|
13104
13619
|
content: i18n.get("reasonForFillingCompanyAddressDetails")
|
|
13105
|
-
}), jsx(
|
|
13620
|
+
}), jsx(AddressExperimentWrapper, {
|
|
13106
13621
|
...registrationAddressFormProps,
|
|
13107
13622
|
data: {
|
|
13108
13623
|
...registrationAddressFormProps == null ? void 0 : registrationAddressFormProps.data,
|
|
@@ -13111,10 +13626,12 @@ function RegistrationAddressComponent(props) {
|
|
|
13111
13626
|
hideCountry: true,
|
|
13112
13627
|
id,
|
|
13113
13628
|
addressType: "registrationAddress",
|
|
13629
|
+
optionalFields: ["otherAddressInformation"],
|
|
13114
13630
|
handleAddressSearch,
|
|
13115
13631
|
handleFindAddress,
|
|
13116
13632
|
verifiedBusiness,
|
|
13117
|
-
kompanyAddress
|
|
13633
|
+
kompanyAddress,
|
|
13634
|
+
onChange: handleRegistrationAddressChange
|
|
13118
13635
|
}), jsx(FormHeader, {
|
|
13119
13636
|
classNames: "adyen-kyc-u-margin-top-32",
|
|
13120
13637
|
heading: i18n.get("operationalAddressHeader")
|
|
@@ -13130,12 +13647,12 @@ function RegistrationAddressComponent(props) {
|
|
|
13130
13647
|
items: operationalAddressIsSameItems,
|
|
13131
13648
|
value: formData.operationalAddressIsSame,
|
|
13132
13649
|
disabled: formUtils.isReadOnly("operationalAddressIsSame"),
|
|
13133
|
-
onChange:
|
|
13650
|
+
onChange: handleOperationalAddressIsSameChange,
|
|
13134
13651
|
"aria-required": true,
|
|
13135
13652
|
"aria-label": formUtils.getLabel("operationalAddressIsSame"),
|
|
13136
13653
|
"aria-invalid": !formValid.operationalAddressIsSame
|
|
13137
13654
|
})
|
|
13138
|
-
}), isOperationAddressNotSame() && createElement(
|
|
13655
|
+
}), isOperationAddressNotSame() && createElement(AddressExperimentWrapper, {
|
|
13139
13656
|
...operationalAddressFormProps,
|
|
13140
13657
|
key: "operationalAddress",
|
|
13141
13658
|
data: {
|
|
@@ -13144,9 +13661,11 @@ function RegistrationAddressComponent(props) {
|
|
|
13144
13661
|
},
|
|
13145
13662
|
hideCountry: true,
|
|
13146
13663
|
id,
|
|
13664
|
+
optionalFields: ["otherAddressInformation"],
|
|
13147
13665
|
addressType: "operationalAddress",
|
|
13148
13666
|
handleAddressSearch,
|
|
13149
|
-
handleFindAddress
|
|
13667
|
+
handleFindAddress,
|
|
13668
|
+
onChange: handleOperationalAddressChange
|
|
13150
13669
|
})]
|
|
13151
13670
|
});
|
|
13152
13671
|
}
|
|
@@ -13826,9 +14345,18 @@ const rules$2 = ({
|
|
|
13826
14345
|
}
|
|
13827
14346
|
},
|
|
13828
14347
|
countryRequiresRegistrationNumberForCompanies: () => {
|
|
14348
|
+
var _a, _b;
|
|
13829
14349
|
if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
|
|
13830
14350
|
return "OPTIONAL";
|
|
13831
14351
|
}
|
|
14352
|
+
if (isExperimentEnabled("EnableAUGovernmentalOrganizationSkipRegistrationNumber") && country === CountryCodes.Australia) {
|
|
14353
|
+
if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION) {
|
|
14354
|
+
return;
|
|
14355
|
+
}
|
|
14356
|
+
if ("companyStructure" in data && ((_b = data.companyStructure) == null ? void 0 : _b.entityType) === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION) {
|
|
14357
|
+
return;
|
|
14358
|
+
}
|
|
14359
|
+
}
|
|
13832
14360
|
if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) {
|
|
13833
14361
|
return "REQUIRED";
|
|
13834
14362
|
}
|
|
@@ -14948,21 +15476,13 @@ const useIdVerificationToken = ({
|
|
|
14948
15476
|
loadingStatus
|
|
14949
15477
|
};
|
|
14950
15478
|
};
|
|
15479
|
+
const loaderWrapperLoader = "adyen-kyc-loader-wrapper-loader";
|
|
15480
|
+
const loaderWrapperLoaderActive = "adyen-kyc-loader-wrapper-loader-active";
|
|
14951
15481
|
const styles$3 = {
|
|
14952
|
-
"
|
|
14953
|
-
|
|
14954
|
-
"
|
|
14955
|
-
|
|
14956
|
-
"adyen-kyc-loading-input__form--loading-opacity0-3": "adyen-kyc-loading-input__form--loading-opacity0-3",
|
|
14957
|
-
"adyen-kyc-loading-input__form--loading-opacity0-4": "adyen-kyc-loading-input__form--loading-opacity0-4",
|
|
14958
|
-
"adyen-kyc-loading-input__form--loading-opacity0-5": "adyen-kyc-loading-input__form--loading-opacity0-5",
|
|
14959
|
-
"adyen-kyc-loading-input__form--loading-opacity0-6": "adyen-kyc-loading-input__form--loading-opacity0-6",
|
|
14960
|
-
"adyen-kyc-loading-input__form--loading-opacity0-7": "adyen-kyc-loading-input__form--loading-opacity0-7",
|
|
14961
|
-
"adyen-kyc-loading-input__form--loading-opacity0-8": "adyen-kyc-loading-input__form--loading-opacity0-8",
|
|
14962
|
-
"adyen-kyc-loading-input__form--loading-opacity0-9": "adyen-kyc-loading-input__form--loading-opacity0-9",
|
|
14963
|
-
"adyen-kyc-loading-input__form--loading-opacity1": "adyen-kyc-loading-input__form--loading-opacity1",
|
|
14964
|
-
"adyen-kyc-loading-input__loader": "adyen-kyc-loading-input__loader",
|
|
14965
|
-
"adyen-kyc-loading-input__loader--active": "adyen-kyc-loading-input__loader--active"
|
|
15482
|
+
"loader-wrapper-loader": "adyen-kyc-loader-wrapper-loader",
|
|
15483
|
+
loaderWrapperLoader,
|
|
15484
|
+
"loader-wrapper-loader-active": "adyen-kyc-loader-wrapper-loader-active",
|
|
15485
|
+
loaderWrapperLoaderActive
|
|
14966
15486
|
};
|
|
14967
15487
|
const LoaderWrapper = ({
|
|
14968
15488
|
children,
|
|
@@ -14972,18 +15492,15 @@ const LoaderWrapper = ({
|
|
|
14972
15492
|
showSpinner = true,
|
|
14973
15493
|
className
|
|
14974
15494
|
}) => {
|
|
14975
|
-
const
|
|
14976
|
-
|
|
14977
|
-
|
|
14978
|
-
|
|
14979
|
-
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
|
|
14983
|
-
|
|
14984
|
-
[styles$3["adyen-kyc-loading-input__loader--active"]]: status === "loading" && showSpinner
|
|
14985
|
-
});
|
|
14986
|
-
const overlayClass = cx("adyen-kyc-loading-input", className);
|
|
15495
|
+
const opacitySyle = status === "loading" ? {
|
|
15496
|
+
opacity: formOpacityWhenLoading
|
|
15497
|
+
} : {
|
|
15498
|
+
opacity: 1
|
|
15499
|
+
};
|
|
15500
|
+
const loaderWrapperClass = cx(styles$3.loaderWrapperLoader, {
|
|
15501
|
+
[styles$3.loaderWrapperLoaderActive]: status === "loading" && showSpinner
|
|
15502
|
+
});
|
|
15503
|
+
const overlayClass = cx(styles$3.loaderWrapper, className);
|
|
14987
15504
|
return jsxs("div", {
|
|
14988
15505
|
className: overlayClass,
|
|
14989
15506
|
style: {
|
|
@@ -14995,7 +15512,8 @@ const LoaderWrapper = ({
|
|
|
14995
15512
|
size: loaderSize
|
|
14996
15513
|
})
|
|
14997
15514
|
}), jsx("div", {
|
|
14998
|
-
className:
|
|
15515
|
+
className: styles$3.loaderWrapperForm,
|
|
15516
|
+
style: opacitySyle,
|
|
14999
15517
|
children
|
|
15000
15518
|
})]
|
|
15001
15519
|
});
|
|
@@ -16491,19 +17009,13 @@ const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event
|
|
|
16491
17009
|
callback();
|
|
16492
17010
|
}
|
|
16493
17011
|
};
|
|
16494
|
-
const styles$2 = {
|
|
16495
|
-
"adyen-kyc-multi-select-list": "adyen-kyc-multi-select-list",
|
|
16496
|
-
"adyen-kyc-multi-select-list-item": "adyen-kyc-multi-select-list-item",
|
|
16497
|
-
"adyen-kyc-multi-select-list-item--with-description": "adyen-kyc-multi-select-list-item--with-description",
|
|
16498
|
-
"adyen-kyc-checkbox__label": "adyen-kyc-checkbox__label"
|
|
16499
|
-
};
|
|
16500
17012
|
const MultiSelectList = ({
|
|
16501
17013
|
options,
|
|
16502
17014
|
selected,
|
|
16503
17015
|
onSelect,
|
|
16504
17016
|
mapToSelectItem
|
|
16505
17017
|
}) => jsx("ul", {
|
|
16506
|
-
className:
|
|
17018
|
+
className: "adyen-kyc-multi-select-list",
|
|
16507
17019
|
children: options.map((option) => {
|
|
16508
17020
|
const item = mapToSelectItem(option);
|
|
16509
17021
|
const isSelected = selected.includes(option);
|
|
@@ -16517,8 +17029,8 @@ const MultiSelectList = ({
|
|
|
16517
17029
|
onKeyDown: handleKeys(["Enter", " "], handleSelect),
|
|
16518
17030
|
onSelect: handleSelect,
|
|
16519
17031
|
isMulti: true,
|
|
16520
|
-
className: cx([
|
|
16521
|
-
|
|
17032
|
+
className: cx(["adyen-kyc-multi-select-list-item", {
|
|
17033
|
+
"adyen-kyc-multi-select-list-item--with-description": !!item.description
|
|
16522
17034
|
}])
|
|
16523
17035
|
}, item.id);
|
|
16524
17036
|
})
|
|
@@ -16539,7 +17051,7 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
16539
17051
|
fieldValidationErrors,
|
|
16540
17052
|
requiredFields,
|
|
16541
17053
|
allowedRoles,
|
|
16542
|
-
trustedRoles
|
|
17054
|
+
trustedRoles = []
|
|
16543
17055
|
} = props;
|
|
16544
17056
|
const {
|
|
16545
17057
|
i18n
|
|
@@ -16597,7 +17109,7 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
16597
17109
|
onSelect: changeRoles,
|
|
16598
17110
|
mapToSelectItem: (role) => ({
|
|
16599
17111
|
...makeSelectItemForRole(role, i18n),
|
|
16600
|
-
disabled: allowedRoles
|
|
17112
|
+
disabled: allowedRoles && !allowedRoles.includes(role) || trustedRoles.includes(role)
|
|
16601
17113
|
})
|
|
16602
17114
|
})
|
|
16603
17115
|
})]
|
|
@@ -17479,8 +17991,9 @@ const relationshipOptions = [{
|
|
|
17479
17991
|
id: "guardian",
|
|
17480
17992
|
name: "guardian"
|
|
17481
17993
|
}];
|
|
17994
|
+
const countriesRequiringNationality = [CountryCodes.HongKong, CountryCodes.Singapore];
|
|
17482
17995
|
function PersonalDetailsComponent(props) {
|
|
17483
|
-
var _a;
|
|
17996
|
+
var _a, _b, _c, _d;
|
|
17484
17997
|
const {
|
|
17485
17998
|
i18n
|
|
17486
17999
|
} = useI18nContext();
|
|
@@ -17511,6 +18024,7 @@ function PersonalDetailsComponent(props) {
|
|
|
17511
18024
|
const isDecisionMakerTask = props.taskType === TaskTypes.DECISION_MAKER || props.taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER;
|
|
17512
18025
|
const isTopLevelEntity = props.taskType === TaskTypes.INDIVIDUAL;
|
|
17513
18026
|
const isLegalRepresentativeDetailsTask = props.taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
|
|
18027
|
+
const countryRequiringNationality = ((_c = (_b = props.parentLegalEntity) == null ? void 0 : _b.organization) == null ? void 0 : _c.registeredAddress.country) || ((_d = props.data) == null ? void 0 : _d.residencyCountry);
|
|
17514
18028
|
const requiredFieldsByTask = (props.requiredFields || personalDetailsFields).filter((field) => !isNewEntryFlowEnabled && (field !== "role" || field === "role" && isDecisionMakerTask) || isNewEntryFlowEnabled && (field !== "role" && field !== "accountHolder" || field === "role" && isDecisionMakerTask) || field === "relationship" && isLegalRepresentativeDetailsTask);
|
|
17515
18029
|
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
17516
18030
|
const getDirectChildFields = () => requiredFieldsByTask.filter((field) => ["birthDate", "residencyCountry", "jobTitle", "nationality", "relationship"].includes(field));
|
|
@@ -17602,9 +18116,9 @@ function PersonalDetailsComponent(props) {
|
|
|
17602
18116
|
currentState,
|
|
17603
18117
|
changeInitiatedBy
|
|
17604
18118
|
}) => {
|
|
17605
|
-
var _a2,
|
|
18119
|
+
var _a2, _b2;
|
|
17606
18120
|
if (changeInitiatedBy === PERSONAL_DETAILS) {
|
|
17607
|
-
if (!((
|
|
18121
|
+
if (!((_b2 = (_a2 = currentState.errors) == null ? void 0 : _a2[PERSONAL_DETAILS]) == null ? void 0 : _b2.idNumber) && (externalErrors == null ? void 0 : externalErrors.idNumber)) {
|
|
17608
18122
|
delete externalErrors.idNumber;
|
|
17609
18123
|
}
|
|
17610
18124
|
this.isValid = currentState.validityByForm[PERSONAL_DETAILS];
|
|
@@ -17780,7 +18294,7 @@ function PersonalDetailsComponent(props) {
|
|
|
17780
18294
|
country: data.residencyCountry,
|
|
17781
18295
|
errors: externalErrors,
|
|
17782
18296
|
idNumberType
|
|
17783
|
-
}), (
|
|
18297
|
+
}), countriesRequiringNationality.includes(countryRequiringNationality) && formUtils.isRequiredField("nationality") && jsx(CountryField, {
|
|
17784
18298
|
data: {
|
|
17785
18299
|
country: data.nationality
|
|
17786
18300
|
},
|
|
@@ -18038,7 +18552,7 @@ const proofOfNationalIdFormID = individualForms.proofOfNationalId.formId;
|
|
|
18038
18552
|
const proofOfRelationshipFormID = individualForms.proofOfRelationship.formId;
|
|
18039
18553
|
const individualDocumentForms = [idVerificationMethodFormID, idDocumentFormID, proofOfResidencyFormID, proofOfNationalIdFormID, proofOfRelationshipFormID];
|
|
18040
18554
|
function IndividualComponent(props) {
|
|
18041
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
18555
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
18042
18556
|
const {
|
|
18043
18557
|
i18n
|
|
18044
18558
|
} = useI18nContext();
|
|
@@ -18081,7 +18595,7 @@ function IndividualComponent(props) {
|
|
|
18081
18595
|
currentState,
|
|
18082
18596
|
prevState
|
|
18083
18597
|
}) => {
|
|
18084
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2,
|
|
18598
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j;
|
|
18085
18599
|
const residencyCountryPrev = (_b2 = (_a2 = prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
|
|
18086
18600
|
const residencyCountry = (_d2 = (_c2 = currentState.data) == null ? void 0 : _c2.personalDetails) == null ? void 0 : _d2.residencyCountry;
|
|
18087
18601
|
if (residencyCountry != null && residencyCountry !== residencyCountryPrev) {
|
|
@@ -18092,13 +18606,18 @@ function IndividualComponent(props) {
|
|
|
18092
18606
|
if (idVerificationMethod != null && idVerificationMethod !== idVerificationMethodPrev) {
|
|
18093
18607
|
setIdVerificationMethodSelected(idVerificationMethod);
|
|
18094
18608
|
}
|
|
18095
|
-
const accountHolder = (_j = (
|
|
18609
|
+
const accountHolder = (_j = (_i2 = currentState.data) == null ? void 0 : _i2.personalDetails) == null ? void 0 : _j.accountHolder;
|
|
18096
18610
|
this.customNavigationHandler = accountHolder === "theCompanyIWorkFor" ? () => {
|
|
18097
18611
|
var _a3;
|
|
18098
18612
|
return (_a3 = props.onTypeSwitch) == null ? void 0 : _a3.call(props, LegalEntityType.ORGANIZATION);
|
|
18099
18613
|
} : null;
|
|
18100
18614
|
setData(currentState.data);
|
|
18101
18615
|
};
|
|
18616
|
+
const handleAddressChange = (addressData) => {
|
|
18617
|
+
updateStateSlice({
|
|
18618
|
+
...addressData
|
|
18619
|
+
});
|
|
18620
|
+
};
|
|
18102
18621
|
useEffect(() => {
|
|
18103
18622
|
var _a2, _b2, _c2;
|
|
18104
18623
|
const isIdDocumentFormActive = props.activeForm.formId === idDocumentFormID;
|
|
@@ -18106,8 +18625,18 @@ function IndividualComponent(props) {
|
|
|
18106
18625
|
const isIdAlreadyUploaded = ((_a2 = data == null ? void 0 : data.idDocument) == null ? void 0 : _a2.instantIdVerificationData) || ((_c2 = (_b2 = props.data) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.idDocumentType);
|
|
18107
18626
|
props.setHideFooter(isIdDocumentFormActive && !isIdAlreadyUploaded && isInstantIdVerificationEnabled);
|
|
18108
18627
|
}, [props.activeForm, idVerificationMethodSelected, props.handleGetIdVerificationToken, (_f = data == null ? void 0 : data.idDocument) == null ? void 0 : _f.instantIdVerificationData, (_h = (_g = props.data) == null ? void 0 : _g.idDocument) == null ? void 0 : _h.idDocumentType]);
|
|
18109
|
-
const
|
|
18628
|
+
const addressSchema = getAddressSchemaForCountry((_i = data == null ? void 0 : data.personalDetails) == null ? void 0 : _i.residencyCountry).filter((field) => {
|
|
18110
18629
|
var _a2;
|
|
18630
|
+
if (!COUNTRIES_WITH_STATES_DATASET.includes((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry)) {
|
|
18631
|
+
return field !== "otherAddressInformation" && field !== "stateOrProvince";
|
|
18632
|
+
}
|
|
18633
|
+
return field !== "otherAddressInformation";
|
|
18634
|
+
});
|
|
18635
|
+
const {
|
|
18636
|
+
updateStateSlice
|
|
18637
|
+
} = useGlobalDataSlice("address");
|
|
18638
|
+
const renderActiveForm = (activeForm) => {
|
|
18639
|
+
var _a2, _b2;
|
|
18111
18640
|
return jsxs(Fragment, {
|
|
18112
18641
|
children: [jsx(StateContextWatcher, {
|
|
18113
18642
|
owner: "IndividualComponent",
|
|
@@ -18144,17 +18673,20 @@ function IndividualComponent(props) {
|
|
|
18144
18673
|
content: i18n.get("reasonForFillingIndividualAddressDetails"),
|
|
18145
18674
|
titleId: "whyDoINeedToFillInThisInformation",
|
|
18146
18675
|
contentId: "reasonForFillingIndividualAddressDetails"
|
|
18147
|
-
}), jsx(
|
|
18676
|
+
}), jsx(AddressExperimentWrapper, {
|
|
18148
18677
|
...addressFormProps,
|
|
18678
|
+
id: addressFormID,
|
|
18149
18679
|
data: {
|
|
18150
|
-
...
|
|
18151
|
-
country:
|
|
18680
|
+
...data.address,
|
|
18681
|
+
country: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry
|
|
18152
18682
|
},
|
|
18153
|
-
|
|
18154
|
-
|
|
18683
|
+
requiredFields: addressSchema,
|
|
18684
|
+
optionalFields: ["otherAddressInformation"],
|
|
18155
18685
|
legalEntityId: props.legalEntityId,
|
|
18156
18686
|
handleAddressSearch: props.handleAddressSearch,
|
|
18157
|
-
handleFindAddress: props.handleFindAddress
|
|
18687
|
+
handleFindAddress: props.handleFindAddress,
|
|
18688
|
+
onChange: handleAddressChange,
|
|
18689
|
+
hideCountry: true
|
|
18158
18690
|
})]
|
|
18159
18691
|
})
|
|
18160
18692
|
}), !!props.handleGetIdVerificationToken && jsx("div", {
|
|
@@ -18163,7 +18695,7 @@ function IndividualComponent(props) {
|
|
|
18163
18695
|
...idVerificationMethodFormProps,
|
|
18164
18696
|
name: fullName,
|
|
18165
18697
|
id: idVerificationMethodFormID,
|
|
18166
|
-
countryOfResidence: (
|
|
18698
|
+
countryOfResidence: (_b2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b2.residencyCountry
|
|
18167
18699
|
})
|
|
18168
18700
|
}), jsx("div", {
|
|
18169
18701
|
className: activeForm.formId !== idDocumentFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
@@ -19457,7 +19989,8 @@ function InstantBankVerification({
|
|
|
19457
19989
|
case "GENERIC_ERROR":
|
|
19458
19990
|
errorTitle = i18n.get("ranIntoTechnicalError");
|
|
19459
19991
|
break;
|
|
19460
|
-
case "UNKNOWN_ERROR":
|
|
19992
|
+
case "UNKNOWN_ERROR":
|
|
19993
|
+
default: {
|
|
19461
19994
|
errorTitle = i18n.get("couldNotCompleteAccountCheck");
|
|
19462
19995
|
break;
|
|
19463
19996
|
}
|
|
@@ -19628,6 +20161,7 @@ const payoutCurrencySupport = {
|
|
|
19628
20161
|
iban: [Currencies.CAD, Currencies.USD]
|
|
19629
20162
|
}
|
|
19630
20163
|
};
|
|
20164
|
+
const shouldShowCheckGuidance = (country) => country === "US";
|
|
19631
20165
|
const shouldShowPayoutAccountFormatSelector = (country) => countriesWithLocalFormat.has(country);
|
|
19632
20166
|
const shouldShowPayoutAlert = (country) => shouldShowPayoutAccountFormatSelector(country) || countriesWithMultipleCurrencies.has(country);
|
|
19633
20167
|
const getSupportedCurrencyGuidance = (i18n, country, requiredFields) => {
|
|
@@ -19779,7 +20313,9 @@ function BankAccountNumber(props) {
|
|
|
19779
20313
|
} = useI18nContext();
|
|
19780
20314
|
const {
|
|
19781
20315
|
country,
|
|
19782
|
-
fieldConfig = defaultFieldConfig$4
|
|
20316
|
+
fieldConfig = defaultFieldConfig$4,
|
|
20317
|
+
onFocus,
|
|
20318
|
+
onBlur
|
|
19783
20319
|
} = props;
|
|
19784
20320
|
const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$4);
|
|
19785
20321
|
const mergedProps = mergeFieldMetadataIntoProps("bankAccountNumber", metadata, props);
|
|
@@ -19797,6 +20333,10 @@ function BankAccountNumber(props) {
|
|
|
19797
20333
|
fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors,
|
|
19798
20334
|
obscuredFields: mergedProps.obscuredFields
|
|
19799
20335
|
});
|
|
20336
|
+
const handleBlur = () => {
|
|
20337
|
+
onBlur == null ? void 0 : onBlur();
|
|
20338
|
+
handleChangeFor("bankAccountNumber", "blur");
|
|
20339
|
+
};
|
|
19800
20340
|
const {
|
|
19801
20341
|
updateStateSlice
|
|
19802
20342
|
} = useGlobalDataSlice("payoutAccountDetails", "bankAccountNumber");
|
|
@@ -19823,8 +20363,9 @@ function BankAccountNumber(props) {
|
|
|
19823
20363
|
field: ["bankAccountNumber"],
|
|
19824
20364
|
input: ["bankAccountNumber"]
|
|
19825
20365
|
},
|
|
19826
|
-
onBlur:
|
|
20366
|
+
onBlur: handleBlur,
|
|
19827
20367
|
onInput: handleChangeFor("bankAccountNumber", "input"),
|
|
20368
|
+
onFocus,
|
|
19828
20369
|
readonly: formUtils.isReadOnly("bankAccountNumber"),
|
|
19829
20370
|
value: data.bankAccountNumber ?? "",
|
|
19830
20371
|
acceptObscuredValue: formUtils.isObscured("bankAccountNumber")
|
|
@@ -20095,7 +20636,7 @@ const defaultFieldConfig$2 = {
|
|
|
20095
20636
|
}
|
|
20096
20637
|
},
|
|
20097
20638
|
[CountryCodes.UnitedStates]: {
|
|
20098
|
-
label: "
|
|
20639
|
+
label: "routingNumber",
|
|
20099
20640
|
validators: validatePatternOnBlur(/^\d{9}$/),
|
|
20100
20641
|
mask: {
|
|
20101
20642
|
mask: makeMask(...numericInputs(9))
|
|
@@ -20138,7 +20679,9 @@ function BranchCode(props) {
|
|
|
20138
20679
|
} = useI18nContext();
|
|
20139
20680
|
const {
|
|
20140
20681
|
country,
|
|
20141
|
-
fieldConfig = defaultFieldConfig$2
|
|
20682
|
+
fieldConfig = defaultFieldConfig$2,
|
|
20683
|
+
onFocus,
|
|
20684
|
+
onBlur
|
|
20142
20685
|
} = props;
|
|
20143
20686
|
const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$2);
|
|
20144
20687
|
const mergedProps = mergeFieldMetadataIntoProps("branchCode", metadata, props);
|
|
@@ -20158,6 +20701,10 @@ function BranchCode(props) {
|
|
|
20158
20701
|
const {
|
|
20159
20702
|
updateStateSlice
|
|
20160
20703
|
} = useGlobalDataSlice("payoutAccountDetails", "branchCode");
|
|
20704
|
+
const handleBlur = () => {
|
|
20705
|
+
onBlur == null ? void 0 : onBlur();
|
|
20706
|
+
handleChangeFor("branchCode", "blur");
|
|
20707
|
+
};
|
|
20161
20708
|
useEffect(() => {
|
|
20162
20709
|
updateStateSlice({
|
|
20163
20710
|
data,
|
|
@@ -20181,7 +20728,8 @@ function BranchCode(props) {
|
|
|
20181
20728
|
value: data.branchCode ?? "",
|
|
20182
20729
|
readonly: formUtils.isReadOnly("branchCode"),
|
|
20183
20730
|
onInput: handleChangeFor("branchCode", "input"),
|
|
20184
|
-
onBlur:
|
|
20731
|
+
onBlur: handleBlur,
|
|
20732
|
+
onFocus,
|
|
20185
20733
|
"aria-required": true,
|
|
20186
20734
|
"aria-label": formUtils.getLabel("branchCode"),
|
|
20187
20735
|
"aria-invalid": !valid.branchCode
|
|
@@ -20519,6 +21067,28 @@ function SwiftCode(props) {
|
|
|
20519
21067
|
"aria-invalid": !valid.swiftCode
|
|
20520
21068
|
});
|
|
20521
21069
|
}
|
|
21070
|
+
const CheckGuidance = ({
|
|
21071
|
+
annotated
|
|
21072
|
+
}) => jsxs("div", {
|
|
21073
|
+
className: "adyen-kyc-check-guidance",
|
|
21074
|
+
children: [jsx(Svg, {
|
|
21075
|
+
type: "image",
|
|
21076
|
+
name: "us-check-account-number",
|
|
21077
|
+
className: cx("adyen-kyc-check-guidance__image", "adyen-kyc-check-guidance__image--annotated", {
|
|
21078
|
+
"adyen-kyc-check-guidance__image--inactive": annotated !== "account"
|
|
21079
|
+
})
|
|
21080
|
+
}), jsx(Svg, {
|
|
21081
|
+
type: "image",
|
|
21082
|
+
name: "us-check-routing-number",
|
|
21083
|
+
className: cx("adyen-kyc-check-guidance__image", "adyen-kyc-check-guidance__image--annotated", {
|
|
21084
|
+
"adyen-kyc-check-guidance__image--inactive": annotated !== "routing"
|
|
21085
|
+
})
|
|
21086
|
+
}), jsx(Svg, {
|
|
21087
|
+
name: "us-check",
|
|
21088
|
+
type: "image",
|
|
21089
|
+
className: "adyen-kyc-check-guidance__image"
|
|
21090
|
+
})]
|
|
21091
|
+
});
|
|
20522
21092
|
const payoutAccountFields = ["accountHolder", ...ibanFields, ...branchCodeFields, ...swiftCodeFields, ...currencyFields, ...bankAccountNumberFields, ...bankNameFields, ...bankCodeFields];
|
|
20523
21093
|
function PayoutAccountComponent(props) {
|
|
20524
21094
|
const {
|
|
@@ -20529,16 +21099,19 @@ function PayoutAccountComponent(props) {
|
|
|
20529
21099
|
const {
|
|
20530
21100
|
i18n
|
|
20531
21101
|
} = useI18nContext();
|
|
21102
|
+
const [checkAnnotation, setCheckAnnotation] = useState();
|
|
20532
21103
|
const {
|
|
20533
21104
|
isSettingEnabled
|
|
20534
21105
|
} = useSettingsContext();
|
|
20535
21106
|
const bankAccountFormatSelectionAllowed = isSettingEnabled(SettingNames.AllowBankAccountFormatSelection);
|
|
20536
21107
|
const {
|
|
21108
|
+
heading,
|
|
20537
21109
|
country,
|
|
20538
21110
|
id,
|
|
20539
21111
|
legalEntityResponse,
|
|
20540
21112
|
requiredFields = []
|
|
20541
21113
|
} = props;
|
|
21114
|
+
const showCheckGuidance = shouldShowCheckGuidance(country);
|
|
20542
21115
|
const {
|
|
20543
21116
|
data,
|
|
20544
21117
|
valid,
|
|
@@ -20581,19 +21154,15 @@ function PayoutAccountComponent(props) {
|
|
|
20581
21154
|
className: "adyen-kyc-individual__payout-account",
|
|
20582
21155
|
"aria-describedby": "ariaErrorField",
|
|
20583
21156
|
children: [jsx(FormHeader, {
|
|
20584
|
-
heading
|
|
21157
|
+
heading
|
|
20585
21158
|
}), jsx(ErrorPanel, {
|
|
20586
21159
|
verificationErrors: props == null ? void 0 : props.formVerificationErrors,
|
|
20587
21160
|
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
20588
21161
|
formUtils,
|
|
20589
21162
|
id: "ariaErrorField"
|
|
20590
|
-
}), jsx(
|
|
20591
|
-
|
|
20592
|
-
|
|
20593
|
-
contentId: "reasonForFillingPayoutDetails",
|
|
20594
|
-
title: i18n.get("whyDoINeedToFillInThisInformation"),
|
|
20595
|
-
content: i18n.get("reasonForFillingPayoutDetails")
|
|
20596
|
-
}), formUtils.isRequiredField("accountHolder") && jsx(Field, {
|
|
21163
|
+
}), showCheckGuidance ? jsx(CheckGuidance, {
|
|
21164
|
+
annotated: checkAnnotation
|
|
21165
|
+
}) : void 0, formUtils.isRequiredField("accountHolder") && jsx(Field, {
|
|
20597
21166
|
name: "accountHolder",
|
|
20598
21167
|
label: formUtils.getLabel("accountHolder"),
|
|
20599
21168
|
helper: i18n.get(accountHolderDescriptionKey),
|
|
@@ -20617,7 +21186,9 @@ function PayoutAccountComponent(props) {
|
|
|
20617
21186
|
}), formUtils.isRequiredField("bankAccountNumber") && jsx(BankAccountNumber, {
|
|
20618
21187
|
...bankAccountNumberProps,
|
|
20619
21188
|
country,
|
|
20620
|
-
dataStoreId: id
|
|
21189
|
+
dataStoreId: id,
|
|
21190
|
+
onFocus: showCheckGuidance ? () => setCheckAnnotation("account") : void 0,
|
|
21191
|
+
onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
|
|
20621
21192
|
}), formUtils.isRequiredField("iban") && jsx(Iban, {
|
|
20622
21193
|
...ibanProps,
|
|
20623
21194
|
dataStoreId: id,
|
|
@@ -20635,12 +21206,18 @@ function PayoutAccountComponent(props) {
|
|
|
20635
21206
|
}), formUtils.isRequiredField("branchCode") && jsx(BranchCode, {
|
|
20636
21207
|
...branchCodeProps,
|
|
20637
21208
|
country,
|
|
20638
|
-
dataStoreId: id
|
|
21209
|
+
dataStoreId: id,
|
|
21210
|
+
onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
|
|
21211
|
+
onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
|
|
20639
21212
|
}), formUtils.isRequiredField("bankCity") && jsx(BankCity, {
|
|
20640
21213
|
...bankCityProps,
|
|
20641
21214
|
dataStoreId: id
|
|
20642
21215
|
}), shouldShowPayoutAlert(country) && jsx(Alert, {
|
|
20643
21216
|
title: getSupportedCurrencyGuidance(i18n, country, requiredFields)
|
|
21217
|
+
}), jsx(Typography, {
|
|
21218
|
+
variant: "caption",
|
|
21219
|
+
color: "tertiary",
|
|
21220
|
+
children: i18n.get("reasonForFillingPayoutDetails")
|
|
20644
21221
|
})]
|
|
20645
21222
|
});
|
|
20646
21223
|
}
|
|
@@ -24000,12 +24577,42 @@ const dbaNameFieldMetadata = {
|
|
|
24000
24577
|
label: "dbaName",
|
|
24001
24578
|
validators: [validateNotEmptyOnBlur]
|
|
24002
24579
|
};
|
|
24003
|
-
const
|
|
24004
|
-
|
|
24005
|
-
|
|
24580
|
+
const mapAddressData = (verifiedBusiness) => ({
|
|
24581
|
+
address: verifiedBusiness.street ?? "",
|
|
24582
|
+
otherAddressInformation: verifiedBusiness.street2 ?? "",
|
|
24583
|
+
city: verifiedBusiness.city ?? "",
|
|
24584
|
+
postalCode: verifiedBusiness.zipcode ?? "",
|
|
24585
|
+
stateOrProvince: verifiedBusiness.state ?? ""
|
|
24586
|
+
});
|
|
24587
|
+
const applyVerifiedBusinessData = (verifiedBusiness, handleChangeFor) => {
|
|
24588
|
+
if (!verifiedBusiness) return;
|
|
24589
|
+
entriesOf(verifiedBusiness).forEach(([key, value]) => {
|
|
24590
|
+
switch (key) {
|
|
24591
|
+
case "name":
|
|
24592
|
+
if (value) handleChangeFor("legalCompanyName", "input")(value);
|
|
24593
|
+
break;
|
|
24594
|
+
case "isPrincipalAddress":
|
|
24595
|
+
if (value) handleChangeFor("operationalAddressIsSame", "input")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
|
|
24596
|
+
break;
|
|
24597
|
+
}
|
|
24598
|
+
});
|
|
24599
|
+
};
|
|
24600
|
+
const structuredList = "adyen-kyc-structured-list";
|
|
24601
|
+
const structuredListListItem = "adyen-kyc-structured-list-list-item";
|
|
24602
|
+
const adyenLayoutMd = "adyen-layout-md";
|
|
24603
|
+
const structuredListLabel = "adyen-kyc-structured-list-label";
|
|
24604
|
+
const structuredListValue = "adyen-kyc-structured-list-value";
|
|
24605
|
+
const styles$2 = {
|
|
24606
|
+
"structured-list": "adyen-kyc-structured-list",
|
|
24607
|
+
structuredList,
|
|
24608
|
+
"structured-list-list-item": "adyen-kyc-structured-list-list-item",
|
|
24609
|
+
structuredListListItem,
|
|
24006
24610
|
"adyen-layout-md": "adyen-layout-md",
|
|
24007
|
-
|
|
24008
|
-
"
|
|
24611
|
+
adyenLayoutMd,
|
|
24612
|
+
"structured-list-label": "adyen-kyc-structured-list-label",
|
|
24613
|
+
structuredListLabel,
|
|
24614
|
+
"structured-list-value": "adyen-kyc-structured-list-value",
|
|
24615
|
+
structuredListValue
|
|
24009
24616
|
};
|
|
24010
24617
|
const StructuredList = ({
|
|
24011
24618
|
items
|
|
@@ -24014,28 +24621,29 @@ const StructuredList = ({
|
|
|
24014
24621
|
i18n
|
|
24015
24622
|
} = useI18nContext();
|
|
24016
24623
|
return jsx("dl", {
|
|
24017
|
-
className: styles$
|
|
24624
|
+
className: styles$2.structuredList,
|
|
24018
24625
|
children: items.map((item) => jsxs("div", {
|
|
24019
|
-
className: styles$
|
|
24626
|
+
className: styles$2.structuredListListItem,
|
|
24020
24627
|
children: [jsx("dt", {
|
|
24021
|
-
className: styles$
|
|
24628
|
+
className: styles$2.structuredListLabel,
|
|
24022
24629
|
children: i18n.get(item.labelKey)
|
|
24023
24630
|
}), jsx("dd", {
|
|
24024
|
-
className: styles$
|
|
24631
|
+
className: styles$2.structuredListValue,
|
|
24025
24632
|
children: item.value
|
|
24026
24633
|
})]
|
|
24027
24634
|
}, item.labelKey))
|
|
24028
24635
|
});
|
|
24029
24636
|
};
|
|
24030
24637
|
function VerifiedBusinessCard({
|
|
24031
|
-
verifiedBusiness
|
|
24638
|
+
verifiedBusiness,
|
|
24639
|
+
verifiedAddress
|
|
24032
24640
|
}) {
|
|
24033
24641
|
const {
|
|
24034
24642
|
i18n
|
|
24035
24643
|
} = useI18nContext();
|
|
24036
24644
|
const [expanded, setExpanded] = useState(false);
|
|
24037
|
-
const address = (
|
|
24038
|
-
const addressLink =
|
|
24645
|
+
const address = (verifiedAddress == null ? void 0 : verifiedAddress.address) && (verifiedAddress == null ? void 0 : verifiedAddress.city) && (verifiedAddress == null ? void 0 : verifiedAddress.stateOrProvince) && (verifiedAddress == null ? void 0 : verifiedAddress.postalCode) ? `${verifiedAddress == null ? void 0 : verifiedAddress.address} ${verifiedAddress.city} ${verifiedAddress.stateOrProvince} ${verifiedAddress.postalCode}` : verifiedBusiness == null ? void 0 : verifiedBusiness.address;
|
|
24646
|
+
const addressLink = address ? `https://www.google.com/maps/place/${address.replaceAll(" ", "+")}` : void 0;
|
|
24039
24647
|
const baseItems = useMemo(() => [{
|
|
24040
24648
|
labelKey: "legalCompanyName__US",
|
|
24041
24649
|
value: verifiedBusiness == null ? void 0 : verifiedBusiness.name
|
|
@@ -24048,7 +24656,7 @@ function VerifiedBusinessCard({
|
|
|
24048
24656
|
value: verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm
|
|
24049
24657
|
}, {
|
|
24050
24658
|
labelKey: "address",
|
|
24051
|
-
value: jsxs("
|
|
24659
|
+
value: jsxs("span", {
|
|
24052
24660
|
className: "adyen-kyc-verified-business-card__address",
|
|
24053
24661
|
children: [address, addressLink && jsx(Link, {
|
|
24054
24662
|
external: true,
|
|
@@ -24057,24 +24665,30 @@ function VerifiedBusinessCard({
|
|
|
24057
24665
|
})]
|
|
24058
24666
|
})
|
|
24059
24667
|
}].filter((item) => !!item.value), [address, addressLink, i18n, verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm]);
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
|
|
24668
|
+
const expandedContentClasses = cx("adyen-kyc-verified-business-card__content", {
|
|
24669
|
+
"adyen-kyc-verified-business-card__content--collapsed": !expanded,
|
|
24670
|
+
"adyen-kyc-verified-business-card__content--expanded": expanded
|
|
24671
|
+
});
|
|
24672
|
+
return jsxs("section", {
|
|
24673
|
+
className: "adyen-kyc-verified-business-card",
|
|
24674
|
+
children: [jsxs("div", {
|
|
24675
|
+
className: "adyen-kyc-verified-business-card__content",
|
|
24063
24676
|
children: [jsx(StructuredList, {
|
|
24064
24677
|
items: baseItems
|
|
24065
|
-
}), jsx(Divider, {})
|
|
24066
|
-
|
|
24067
|
-
|
|
24068
|
-
|
|
24069
|
-
|
|
24070
|
-
|
|
24071
|
-
|
|
24072
|
-
|
|
24073
|
-
|
|
24074
|
-
|
|
24075
|
-
|
|
24076
|
-
|
|
24077
|
-
|
|
24678
|
+
}), jsx(Divider, {})]
|
|
24679
|
+
}), jsxs("div", {
|
|
24680
|
+
className: expandedContentClasses,
|
|
24681
|
+
children: [jsx(StructuredList, {
|
|
24682
|
+
items: expandedItems
|
|
24683
|
+
}), jsx(Divider, {})]
|
|
24684
|
+
}), jsx("div", {
|
|
24685
|
+
className: "adyen-kyc-verified-business-card__expand-button",
|
|
24686
|
+
children: jsx(Button, {
|
|
24687
|
+
label: expanded ? i18n.get("hideDetails") : i18n.get("showDetails"),
|
|
24688
|
+
showAsLink: true,
|
|
24689
|
+
onClick: () => setExpanded(!expanded)
|
|
24690
|
+
})
|
|
24691
|
+
})]
|
|
24078
24692
|
});
|
|
24079
24693
|
}
|
|
24080
24694
|
const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
|
|
@@ -24104,20 +24718,21 @@ function AdditionalInformationComponent({
|
|
|
24104
24718
|
handleFindAddress
|
|
24105
24719
|
}) {
|
|
24106
24720
|
var _a, _b, _c, _d;
|
|
24721
|
+
const {
|
|
24722
|
+
basicInformation
|
|
24723
|
+
} = useGlobalData();
|
|
24107
24724
|
const {
|
|
24108
24725
|
updateStateSlice
|
|
24109
24726
|
} = useGlobalDataSlice(ADDITIONAL_INFORMATION_FORM_ID);
|
|
24110
24727
|
const {
|
|
24111
24728
|
i18n
|
|
24112
24729
|
} = useI18nContext();
|
|
24730
|
+
const {
|
|
24731
|
+
isExperimentEnabled
|
|
24732
|
+
} = useExperimentsContext();
|
|
24113
24733
|
const showVerified = !!verifiedBusiness;
|
|
24114
24734
|
const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
|
|
24115
|
-
const
|
|
24116
|
-
if (!COUNTRIES_WITH_STATES_DATASET.includes(country)) {
|
|
24117
|
-
return field !== "otherAddressInformation" && field !== "stateOrProvince";
|
|
24118
|
-
}
|
|
24119
|
-
return field !== "otherAddressInformation";
|
|
24120
|
-
});
|
|
24735
|
+
const addressSchema = getAddressSchemaForCountry(country).filter((field) => !COUNTRIES_WITH_STATES_DATASET.includes(country) ? field !== "stateOrProvince" : true);
|
|
24121
24736
|
const initialFormUtilsProps = useMemo(() => ({
|
|
24122
24737
|
data,
|
|
24123
24738
|
labels: labels2,
|
|
@@ -24249,10 +24864,30 @@ function AdditionalInformationComponent({
|
|
|
24249
24864
|
valid: formValid,
|
|
24250
24865
|
fieldProblems: formFieldProblems
|
|
24251
24866
|
});
|
|
24252
|
-
}, [formSchema, formData, formErrors,
|
|
24253
|
-
|
|
24254
|
-
if (verifiedBusiness
|
|
24255
|
-
|
|
24867
|
+
}, [formSchema, formData, formErrors, formValid, formFieldProblems]);
|
|
24868
|
+
const verifiedAddress = useMemo(() => {
|
|
24869
|
+
if (!verifiedBusiness) return void 0;
|
|
24870
|
+
return verifiedBusiness.isPrincipalAddress || verifiedBusiness.state && (basicInformation == null ? void 0 : basicInformation.stateOrProvince) !== verifiedBusiness.state ? {
|
|
24871
|
+
operationalAddress: {
|
|
24872
|
+
...mapAddressData(verifiedBusiness),
|
|
24873
|
+
country
|
|
24874
|
+
}
|
|
24875
|
+
} : {
|
|
24876
|
+
registrationAddress: {
|
|
24877
|
+
...mapAddressData(verifiedBusiness),
|
|
24878
|
+
country
|
|
24879
|
+
}
|
|
24880
|
+
};
|
|
24881
|
+
}, [verifiedBusiness, basicInformation == null ? void 0 : basicInformation.stateOrProvince, country]);
|
|
24882
|
+
const hideRegistrationAddress = useMemo(() => addressSchema.filter((field) => field !== "otherAddressInformation").every((field) => {
|
|
24883
|
+
var _a2;
|
|
24884
|
+
return !!((_a2 = verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress) == null ? void 0 : _a2[field]);
|
|
24885
|
+
}) && Boolean(verifiedBusiness == null ? void 0 : verifiedBusiness.isTrustedAddress) && isExperimentEnabled("EnableNewAddressComponent"), [addressSchema, verifiedBusiness == null ? void 0 : verifiedBusiness.isTrustedAddress, isExperimentEnabled, verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress]);
|
|
24886
|
+
useEffect(
|
|
24887
|
+
() => applyVerifiedBusinessData(verifiedBusiness, handleChangeFor),
|
|
24888
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24889
|
+
[verifiedBusiness]
|
|
24890
|
+
);
|
|
24256
24891
|
useEffect(() => {
|
|
24257
24892
|
if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
|
|
24258
24893
|
}, [verifiedBusiness]);
|
|
@@ -24273,7 +24908,14 @@ function AdditionalInformationComponent({
|
|
|
24273
24908
|
handleChangeFor("operationalAddress")(state.data);
|
|
24274
24909
|
setValid("operationalAddress", Boolean(state.isValid));
|
|
24275
24910
|
};
|
|
24276
|
-
const handleOperationalAddressIsSameChange = (isChecked) =>
|
|
24911
|
+
const handleOperationalAddressIsSameChange = (isChecked) => {
|
|
24912
|
+
if (isChecked) {
|
|
24913
|
+
handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME);
|
|
24914
|
+
setValid("operationalAddress", true);
|
|
24915
|
+
} else {
|
|
24916
|
+
handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
|
|
24917
|
+
}
|
|
24918
|
+
};
|
|
24277
24919
|
return jsxs("form", {
|
|
24278
24920
|
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24279
24921
|
className: "adyen-kyc-additional-information",
|
|
@@ -24285,7 +24927,7 @@ function AdditionalInformationComponent({
|
|
|
24285
24927
|
verificationErrors: formVerificationErrors,
|
|
24286
24928
|
validationErrors: fieldValidationErrors,
|
|
24287
24929
|
formUtils
|
|
24288
|
-
}), showVerified && jsxs("
|
|
24930
|
+
}), showVerified && jsxs("section", {
|
|
24289
24931
|
children: [jsx("div", {
|
|
24290
24932
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24291
24933
|
children: jsx(Typography, {
|
|
@@ -24294,9 +24936,10 @@ function AdditionalInformationComponent({
|
|
|
24294
24936
|
children: i18n.get("verifiedInformation")
|
|
24295
24937
|
})
|
|
24296
24938
|
}), jsx(VerifiedBusinessCard, {
|
|
24297
|
-
verifiedBusiness
|
|
24939
|
+
verifiedBusiness,
|
|
24940
|
+
verifiedAddress: (verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress) ?? (verifiedAddress == null ? void 0 : verifiedAddress.operationalAddress)
|
|
24298
24941
|
})]
|
|
24299
|
-
}), jsxs("
|
|
24942
|
+
}), jsxs("section", {
|
|
24300
24943
|
children: [showVerified && jsx("div", {
|
|
24301
24944
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24302
24945
|
children: jsx(Typography, {
|
|
@@ -24304,114 +24947,116 @@ function AdditionalInformationComponent({
|
|
|
24304
24947
|
variant: "title",
|
|
24305
24948
|
children: i18n.get("otherBusinessInformation")
|
|
24306
24949
|
})
|
|
24307
|
-
}),
|
|
24308
|
-
|
|
24309
|
-
|
|
24310
|
-
|
|
24311
|
-
|
|
24312
|
-
|
|
24313
|
-
|
|
24314
|
-
|
|
24315
|
-
|
|
24316
|
-
|
|
24317
|
-
|
|
24318
|
-
|
|
24319
|
-
|
|
24320
|
-
|
|
24321
|
-
|
|
24322
|
-
|
|
24323
|
-
|
|
24324
|
-
|
|
24325
|
-
|
|
24326
|
-
|
|
24327
|
-
|
|
24328
|
-
|
|
24329
|
-
|
|
24330
|
-
|
|
24331
|
-
|
|
24332
|
-
|
|
24333
|
-
|
|
24334
|
-
|
|
24335
|
-
|
|
24336
|
-
|
|
24337
|
-
|
|
24338
|
-
|
|
24339
|
-
|
|
24340
|
-
|
|
24341
|
-
|
|
24342
|
-
|
|
24343
|
-
|
|
24344
|
-
|
|
24345
|
-
|
|
24346
|
-
|
|
24347
|
-
|
|
24348
|
-
|
|
24349
|
-
|
|
24350
|
-
|
|
24351
|
-
|
|
24352
|
-
|
|
24353
|
-
|
|
24354
|
-
|
|
24355
|
-
|
|
24356
|
-
|
|
24357
|
-
|
|
24358
|
-
|
|
24359
|
-
|
|
24360
|
-
|
|
24361
|
-
|
|
24362
|
-
|
|
24363
|
-
|
|
24364
|
-
|
|
24365
|
-
|
|
24366
|
-
|
|
24367
|
-
|
|
24368
|
-
|
|
24369
|
-
|
|
24370
|
-
|
|
24371
|
-
|
|
24372
|
-
|
|
24373
|
-
|
|
24374
|
-
|
|
24375
|
-
|
|
24376
|
-
|
|
24377
|
-
|
|
24378
|
-
|
|
24379
|
-
|
|
24380
|
-
|
|
24381
|
-
|
|
24382
|
-
|
|
24383
|
-
|
|
24384
|
-
|
|
24385
|
-
|
|
24386
|
-
|
|
24387
|
-
|
|
24388
|
-
|
|
24389
|
-
|
|
24390
|
-
|
|
24391
|
-
|
|
24392
|
-
|
|
24393
|
-
|
|
24394
|
-
|
|
24395
|
-
|
|
24396
|
-
|
|
24397
|
-
|
|
24398
|
-
|
|
24399
|
-
|
|
24400
|
-
|
|
24401
|
-
|
|
24402
|
-
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24409
|
-
|
|
24410
|
-
|
|
24411
|
-
|
|
24412
|
-
|
|
24950
|
+
}), jsxs("fieldset", {
|
|
24951
|
+
children: [showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
|
|
24952
|
+
className: "adyen-kyc-field-wrapper",
|
|
24953
|
+
children: jsx(LegalCompanyNameField, {
|
|
24954
|
+
data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
|
|
24955
|
+
valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
|
|
24956
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
|
|
24957
|
+
labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
|
|
24958
|
+
helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
|
|
24959
|
+
legalCompanyName: "legalCompanyName__helperText"
|
|
24960
|
+
}),
|
|
24961
|
+
readonly: formUtils.isReadOnly("legalCompanyName"),
|
|
24962
|
+
handleChangeFor
|
|
24963
|
+
})
|
|
24964
|
+
}), showField(DBA_NAME_FIELD) && jsx("div", {
|
|
24965
|
+
className: "adyen-kyc-field-wrapper",
|
|
24966
|
+
children: jsx(DBANameField, {
|
|
24967
|
+
data: formUtils.getFieldData(formData, DBA_NAME_FIELD),
|
|
24968
|
+
valid: formUtils.getFieldValid(formValid, DBA_NAME_FIELD),
|
|
24969
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DBA_NAME_FIELD),
|
|
24970
|
+
labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
|
|
24971
|
+
hasDba: "hasDba"
|
|
24972
|
+
}),
|
|
24973
|
+
readonly: formUtils.isReadOnly("dbaName"),
|
|
24974
|
+
handleChangeFor,
|
|
24975
|
+
setErrors
|
|
24976
|
+
})
|
|
24977
|
+
}), showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && jsx("div", {
|
|
24978
|
+
className: "adyen-kyc-field-wrapper",
|
|
24979
|
+
children: jsx(BusinessRegistrationNumberField, {
|
|
24980
|
+
data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24981
|
+
valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24982
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24983
|
+
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
|
|
24984
|
+
exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
|
|
24985
|
+
}),
|
|
24986
|
+
mask: formUtils.getMask("registrationNumber"),
|
|
24987
|
+
guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24988
|
+
placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24989
|
+
helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
24990
|
+
readonly: formUtils.isReadOnly("registrationNumber"),
|
|
24991
|
+
optional: formUtils.isOptionalField("registrationNumber"),
|
|
24992
|
+
shouldValidate,
|
|
24993
|
+
handleChangeFor,
|
|
24994
|
+
country,
|
|
24995
|
+
canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
|
|
24996
|
+
companyType,
|
|
24997
|
+
registrationNumberOptions,
|
|
24998
|
+
registrationNumberType,
|
|
24999
|
+
setRegistrationNumberType
|
|
25000
|
+
})
|
|
25001
|
+
}), showField(TAX_INFORMATION_FIELD) && jsx("div", {
|
|
25002
|
+
className: "adyen-kyc-field-wrapper",
|
|
25003
|
+
children: jsx(TaxInformationField, {
|
|
25004
|
+
data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
|
|
25005
|
+
valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
|
|
25006
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
|
|
25007
|
+
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
|
|
25008
|
+
exemptedFromTax: "iDontHaveATaxId"
|
|
25009
|
+
}),
|
|
25010
|
+
mask: formUtils.getMask("taxInformation"),
|
|
25011
|
+
helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
|
|
25012
|
+
guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
|
|
25013
|
+
readonly: formUtils.isReadOnly("taxInformation"),
|
|
25014
|
+
shouldValidate,
|
|
25015
|
+
handleChangeFor,
|
|
25016
|
+
canExempt: formUtils.isRequiredField("exemptedFromTax"),
|
|
25017
|
+
isUen: formUtils.isRequiredField("isUen"),
|
|
25018
|
+
country,
|
|
25019
|
+
companyType,
|
|
25020
|
+
taxIdNumberType,
|
|
25021
|
+
setTaxIdNumberType,
|
|
25022
|
+
defaultData: data == null ? void 0 : data.taxInformation
|
|
25023
|
+
})
|
|
25024
|
+
}), showField(VAT_NUMBER_FIELD) && jsx("div", {
|
|
25025
|
+
className: "adyen-kyc-field-wrapper",
|
|
25026
|
+
children: jsx(VatNumberField, {
|
|
25027
|
+
data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
|
|
25028
|
+
valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
|
|
25029
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
|
|
25030
|
+
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
|
|
25031
|
+
exemptedFromVat: "iDontHaveAVatNumber"
|
|
25032
|
+
}),
|
|
25033
|
+
mask: formUtils.getMask("vatNumber"),
|
|
25034
|
+
guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
|
|
25035
|
+
placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
|
|
25036
|
+
readonly: formUtils.isReadOnly("vatNumber"),
|
|
25037
|
+
handleChangeFor,
|
|
25038
|
+
country,
|
|
25039
|
+
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
25040
|
+
vatNumberType,
|
|
25041
|
+
setVatNumberType,
|
|
25042
|
+
shouldValidate
|
|
25043
|
+
})
|
|
25044
|
+
}), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
|
|
25045
|
+
className: "adyen-kyc-field-wrapper",
|
|
25046
|
+
children: jsx(DateOfIncorporationField, {
|
|
25047
|
+
data: formUtils.getFieldData(formData, DATE_OF_INCORPORATION_FIELD),
|
|
25048
|
+
valid: formUtils.getFieldValid(formValid, DATE_OF_INCORPORATION_FIELD),
|
|
25049
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DATE_OF_INCORPORATION_FIELD),
|
|
25050
|
+
labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
|
|
25051
|
+
placeholders: formUtils.getFieldPlaceholders(DATE_OF_INCORPORATION_FIELD, {
|
|
25052
|
+
dateOfIncorporation: "datePlaceholder"
|
|
25053
|
+
}),
|
|
25054
|
+
readonly: formUtils.isReadOnly("dateOfIncorporation"),
|
|
25055
|
+
handleChangeFor
|
|
25056
|
+
})
|
|
25057
|
+
})]
|
|
24413
25058
|
})]
|
|
24414
|
-
}), showStockData && jsxs("
|
|
25059
|
+
}), showStockData && jsxs("section", {
|
|
24415
25060
|
children: [jsx("div", {
|
|
24416
25061
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24417
25062
|
children: jsx(Typography, {
|
|
@@ -24419,50 +25064,55 @@ function AdditionalInformationComponent({
|
|
|
24419
25064
|
variant: "title",
|
|
24420
25065
|
children: i18n.get("stockExchangeInformation")
|
|
24421
25066
|
})
|
|
24422
|
-
}),
|
|
24423
|
-
|
|
24424
|
-
|
|
24425
|
-
|
|
24426
|
-
|
|
24427
|
-
|
|
24428
|
-
|
|
24429
|
-
|
|
24430
|
-
|
|
24431
|
-
|
|
24432
|
-
|
|
24433
|
-
|
|
24434
|
-
|
|
24435
|
-
|
|
24436
|
-
|
|
24437
|
-
|
|
24438
|
-
|
|
24439
|
-
|
|
24440
|
-
|
|
24441
|
-
|
|
24442
|
-
|
|
24443
|
-
|
|
24444
|
-
|
|
24445
|
-
|
|
24446
|
-
|
|
24447
|
-
|
|
24448
|
-
|
|
24449
|
-
|
|
24450
|
-
|
|
24451
|
-
|
|
24452
|
-
|
|
24453
|
-
|
|
24454
|
-
|
|
24455
|
-
|
|
24456
|
-
|
|
24457
|
-
|
|
24458
|
-
|
|
24459
|
-
|
|
24460
|
-
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
|
|
25067
|
+
}), jsxs("fieldset", {
|
|
25068
|
+
children: [showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
|
|
25069
|
+
className: "adyen-kyc-field-wrapper",
|
|
25070
|
+
children: jsx(StockExchangeMICField, {
|
|
25071
|
+
data: formUtils.getFieldData(formData, STOCK_EXCHANGE_MIC_FIELD),
|
|
25072
|
+
valid: formUtils.getFieldValid(formValid, STOCK_EXCHANGE_MIC_FIELD),
|
|
25073
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_EXCHANGE_MIC_FIELD),
|
|
25074
|
+
labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
|
|
25075
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_EXCHANGE_MIC_FIELD),
|
|
25076
|
+
mask: formUtils.getMask("stockExchangeMIC"),
|
|
25077
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_EXCHANGE_MIC_FIELD),
|
|
25078
|
+
readonly: formUtils.isReadOnly("stockExchangeMIC"),
|
|
25079
|
+
shouldValidate,
|
|
25080
|
+
handleChangeFor
|
|
25081
|
+
})
|
|
25082
|
+
}), showField(STOCK_ISIN_FIELD) && jsx("div", {
|
|
25083
|
+
className: "adyen-kyc-field-wrapper",
|
|
25084
|
+
children: jsx(StockISINField, {
|
|
25085
|
+
data: formUtils.getFieldData(formData, STOCK_ISIN_FIELD),
|
|
25086
|
+
valid: formUtils.getFieldValid(formValid, STOCK_ISIN_FIELD),
|
|
25087
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_ISIN_FIELD),
|
|
25088
|
+
labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
|
|
25089
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_ISIN_FIELD),
|
|
25090
|
+
mask: formUtils.getMask("stockISIN"),
|
|
25091
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
|
|
25092
|
+
readonly: formUtils.isReadOnly("stockISIN"),
|
|
25093
|
+
shouldValidate,
|
|
25094
|
+
handleChangeFor
|
|
25095
|
+
})
|
|
25096
|
+
}), showField(STOCK_TICKER_SYMBOL_FIELD) && jsx("div", {
|
|
25097
|
+
className: "adyen-kyc-field-wrapper",
|
|
25098
|
+
children: jsx(StockTickerSymbolField, {
|
|
25099
|
+
data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
|
|
25100
|
+
valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
|
|
25101
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
|
|
25102
|
+
labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
|
|
25103
|
+
placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
|
|
25104
|
+
mask: formUtils.getMask("stockTickerSymbol"),
|
|
25105
|
+
guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
|
|
25106
|
+
readonly: formUtils.isReadOnly("stockTickerSymbol"),
|
|
25107
|
+
shouldValidate,
|
|
25108
|
+
handleChangeFor
|
|
25109
|
+
})
|
|
25110
|
+
})]
|
|
24464
25111
|
})]
|
|
24465
|
-
}), jsxs("
|
|
25112
|
+
}), jsxs("section", {
|
|
25113
|
+
style: {
|
|
25114
|
+
display: hideRegistrationAddress ? "none" : "unset"
|
|
25115
|
+
},
|
|
24466
25116
|
children: [jsxs("div", {
|
|
24467
25117
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24468
25118
|
children: [jsx(Typography, {
|
|
@@ -24470,11 +25120,11 @@ function AdditionalInformationComponent({
|
|
|
24470
25120
|
variant: "title",
|
|
24471
25121
|
children: i18n.get("registeredBusinessAddress")
|
|
24472
25122
|
}), jsx(Typography, {
|
|
24473
|
-
el: "
|
|
24474
|
-
variant: "
|
|
25123
|
+
el: "p",
|
|
25124
|
+
variant: "body",
|
|
24475
25125
|
children: i18n.get("registeredBusinessAddressDescription")
|
|
24476
25126
|
})]
|
|
24477
|
-
}), jsx(
|
|
25127
|
+
}), jsx(AddressExperimentWrapper, {
|
|
24478
25128
|
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24479
25129
|
addressType: "registrationAddress",
|
|
24480
25130
|
data: {
|
|
@@ -24483,16 +25133,18 @@ function AdditionalInformationComponent({
|
|
|
24483
25133
|
},
|
|
24484
25134
|
labels: getAddressSchemaLabelsByCountry(country),
|
|
24485
25135
|
countryCode: country,
|
|
24486
|
-
requiredFields:
|
|
25136
|
+
requiredFields: addressSchema,
|
|
24487
25137
|
shouldValidate,
|
|
24488
25138
|
hideCountry: true,
|
|
24489
25139
|
optionalFields: ["otherAddressInformation"],
|
|
25140
|
+
readOnlyFields: verifiedBusiness ? ["stateOrProvince"] : [],
|
|
24490
25141
|
onChange: handleRegistrationAddressChange,
|
|
24491
25142
|
handleAddressSearch,
|
|
24492
25143
|
handleFindAddress,
|
|
24493
|
-
verifiedBusiness
|
|
25144
|
+
verifiedBusiness,
|
|
25145
|
+
verifiedAddress: verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress
|
|
24494
25146
|
})]
|
|
24495
|
-
}), jsxs("
|
|
25147
|
+
}), jsxs("section", {
|
|
24496
25148
|
children: [jsxs("div", {
|
|
24497
25149
|
className: "adyen-kyc-additional-information__section-heading",
|
|
24498
25150
|
children: [jsx(Typography, {
|
|
@@ -24500,8 +25152,8 @@ function AdditionalInformationComponent({
|
|
|
24500
25152
|
variant: "title",
|
|
24501
25153
|
children: i18n.get("principalPlaceOfBusiness")
|
|
24502
25154
|
}), jsx(Typography, {
|
|
24503
|
-
el: "
|
|
24504
|
-
variant: "
|
|
25155
|
+
el: "p",
|
|
25156
|
+
variant: "body",
|
|
24505
25157
|
children: i18n.get("principalPlaceOfBusinessDescription")
|
|
24506
25158
|
})]
|
|
24507
25159
|
}), jsx(Field, {
|
|
@@ -24519,7 +25171,7 @@ function AdditionalInformationComponent({
|
|
|
24519
25171
|
checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
|
|
24520
25172
|
onChange: handleOperationalAddressIsSameChange
|
|
24521
25173
|
})
|
|
24522
|
-
}), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(
|
|
25174
|
+
}), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(AddressExperimentWrapper, {
|
|
24523
25175
|
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24524
25176
|
addressType: "operationalAddress",
|
|
24525
25177
|
data: {
|
|
@@ -24528,12 +25180,15 @@ function AdditionalInformationComponent({
|
|
|
24528
25180
|
},
|
|
24529
25181
|
labels: getAddressSchemaLabelsByCountry(country),
|
|
24530
25182
|
countryCode: country,
|
|
24531
|
-
requiredFields:
|
|
25183
|
+
requiredFields: addressSchema,
|
|
24532
25184
|
shouldValidate,
|
|
25185
|
+
hideCountry: true,
|
|
24533
25186
|
optionalFields: ["otherAddressInformation"],
|
|
24534
25187
|
onChange: handleOperationalAddressChange,
|
|
24535
25188
|
handleAddressSearch,
|
|
24536
|
-
handleFindAddress
|
|
25189
|
+
handleFindAddress,
|
|
25190
|
+
verifiedBusiness,
|
|
25191
|
+
verifiedAddress: verifiedAddress == null ? void 0 : verifiedAddress.operationalAddress
|
|
24537
25192
|
})]
|
|
24538
25193
|
})]
|
|
24539
25194
|
});
|
|
@@ -24788,10 +25443,10 @@ function BusinessSelectionComponent({
|
|
|
24788
25443
|
if (fetching === "loading") return;
|
|
24789
25444
|
if (!selectedBusinessId || selectedBusinessId !== result.id) {
|
|
24790
25445
|
setSelectedBusinessId(result.id);
|
|
24791
|
-
const businessData = await fetchBusinessData(result);
|
|
25446
|
+
const businessData = await fetchBusinessData(result, basicInformation == null ? void 0 : basicInformation.stateOrProvince);
|
|
24792
25447
|
setCurrentBusinessSelection(businessData);
|
|
24793
25448
|
} else if (fetching === "error") {
|
|
24794
|
-
const businessData = await fetchBusinessData(result);
|
|
25449
|
+
const businessData = await fetchBusinessData(result, basicInformation == null ? void 0 : basicInformation.stateOrProvince);
|
|
24795
25450
|
setCurrentBusinessSelection(businessData);
|
|
24796
25451
|
}
|
|
24797
25452
|
} catch (e) {
|
|
@@ -26018,14 +26673,14 @@ const Modal = ({
|
|
|
26018
26673
|
tertiary: true,
|
|
26019
26674
|
"aria-label": "back",
|
|
26020
26675
|
icon: "arrow-left",
|
|
26021
|
-
className: "adyen-kyc-modal-button
|
|
26676
|
+
className: "adyen-kyc-modal-button",
|
|
26022
26677
|
onClick: onBack,
|
|
26023
26678
|
shaded: true
|
|
26024
26679
|
}) : jsx("div", {}), onClose ? jsx(Button, {
|
|
26025
26680
|
tertiary: true,
|
|
26026
26681
|
"aria-label": "close",
|
|
26027
26682
|
icon: "cross",
|
|
26028
|
-
className: "adyen-kyc-modal-button
|
|
26683
|
+
className: "adyen-kyc-modal-button",
|
|
26029
26684
|
onClick: onClose,
|
|
26030
26685
|
shaded: true
|
|
26031
26686
|
}) : jsx("div", {})]
|
|
@@ -26353,16 +27008,10 @@ const DropinLayout = ({
|
|
|
26353
27008
|
if (modalOpen) {
|
|
26354
27009
|
return jsx(Modal, {
|
|
26355
27010
|
footer,
|
|
26356
|
-
onClose: handleClose,
|
|
27011
|
+
onClose: !onBack ? handleClose : void 0,
|
|
26357
27012
|
onBack,
|
|
26358
27013
|
children: jsx("div", {
|
|
26359
|
-
|
|
26360
|
-
children: jsx("div", {
|
|
26361
|
-
className: "adyen-kyc-dropin__content",
|
|
26362
|
-
children: jsx("div", {
|
|
26363
|
-
children: content
|
|
26364
|
-
})
|
|
26365
|
-
})
|
|
27014
|
+
children: content
|
|
26366
27015
|
})
|
|
26367
27016
|
});
|
|
26368
27017
|
}
|
|
@@ -27005,7 +27654,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27005
27654
|
handleClearCompanyData,
|
|
27006
27655
|
onTypeSwitch
|
|
27007
27656
|
}) {
|
|
27008
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
27657
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
27009
27658
|
const {
|
|
27010
27659
|
state: {
|
|
27011
27660
|
currentState
|
|
@@ -27172,17 +27821,17 @@ function BusinessDetailsDropinComponent({
|
|
|
27172
27821
|
return tinMatch;
|
|
27173
27822
|
}, [verifyBusinessData]);
|
|
27174
27823
|
const findBusiness = useCallback(async (data) => {
|
|
27175
|
-
var _a2, _b2, _c2;
|
|
27824
|
+
var _a2, _b2, _c2, _d2;
|
|
27176
27825
|
const tin = (_c2 = (_b2 = (_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.taxInformation) == null ? void 0 : _b2.find((taxId) => currentCountry === taxId.country)) == null ? void 0 : _c2.number;
|
|
27177
27826
|
const results = await searchForBusiness(data);
|
|
27178
27827
|
if (results && results.length === 1) {
|
|
27179
|
-
const businessData = await fetchBusinessData(results[0]);
|
|
27828
|
+
const businessData = await fetchBusinessData(results[0], (_d2 = currentState.data.basicInformation) == null ? void 0 : _d2.stateOrProvince);
|
|
27180
27829
|
if (businessData && tin) {
|
|
27181
27830
|
const tinMatch = await handleVerifyBusinessData(businessData, tin);
|
|
27182
27831
|
return tinMatch ? handleNextClick() : void 0;
|
|
27183
27832
|
}
|
|
27184
27833
|
}
|
|
27185
|
-
}, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
|
|
27834
|
+
}, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, (_f = currentState.data.basicInformation) == null ? void 0 : _f.stateOrProvince, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
|
|
27186
27835
|
useEffect(() => {
|
|
27187
27836
|
if (searchResults && !searchResults.length || searching === "error") {
|
|
27188
27837
|
setShowCompanyStructure(true);
|
|
@@ -27194,7 +27843,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27194
27843
|
setShowCompanyStructure(false);
|
|
27195
27844
|
resetBusinessData();
|
|
27196
27845
|
}
|
|
27197
|
-
}, [currentSearchName, (
|
|
27846
|
+
}, [currentSearchName, (_g = currentState.data.basicInformation) == null ? void 0 : _g.businessName]);
|
|
27198
27847
|
const [showBusinessSelection, setShowBusinessSelection] = useState(false);
|
|
27199
27848
|
const isBusinessSelection = useMemo(() => showBusinessSelection && activeForm.formId === "basicInformation", [activeForm.formId, showBusinessSelection]);
|
|
27200
27849
|
const hideBack = useMemo(() => {
|
|
@@ -27241,7 +27890,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27241
27890
|
default:
|
|
27242
27891
|
return gotoFormByFormIndex(index);
|
|
27243
27892
|
}
|
|
27244
|
-
}, [canSubmitForm, currentCountry, (
|
|
27893
|
+
}, [canSubmitForm, currentCountry, (_h = currentState.data.basicInformation) == null ? void 0 : _h.businessName, (_i = currentState.data.basicInformation) == null ? void 0 : _i.country, (_j = currentState.data.basicInformation) == null ? void 0 : _j.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness, activeForm.formId]);
|
|
27245
27894
|
const nextClick = useCallback(() => {
|
|
27246
27895
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
27247
27896
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
|
|
@@ -27264,7 +27913,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27264
27913
|
default:
|
|
27265
27914
|
return handleNextClick();
|
|
27266
27915
|
}
|
|
27267
|
-
}, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (
|
|
27916
|
+
}, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_k = currentState.validityByForm) == null ? void 0 : _k.basicInformation, (_l = currentState.data.basicInformation) == null ? void 0 : _l.businessName, (_m = currentState.data.basicInformation) == null ? void 0 : _m.country, (_n = currentState.data.basicInformation) == null ? void 0 : _n.stateOrProvince, isBusinessSelection, findBusiness]);
|
|
27268
27917
|
const backClick = useCallback(() => {
|
|
27269
27918
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleNextClick();
|
|
27270
27919
|
switch (activeForm.formId) {
|
|
@@ -32560,7 +33209,8 @@ function IndividualDropinComponent({
|
|
|
32560
33209
|
country,
|
|
32561
33210
|
taskType,
|
|
32562
33211
|
isEmbeddedDropin,
|
|
32563
|
-
isExperimentEnabled
|
|
33212
|
+
isExperimentEnabled,
|
|
33213
|
+
rootLegalEntity: parentLegalEntity
|
|
32564
33214
|
}), [country, data, taskType]);
|
|
32565
33215
|
const customValidators = useMemo(() => isExperimentEnabled("EnableAgeVerification") ? validators({
|
|
32566
33216
|
country,
|
|
@@ -34499,7 +35149,8 @@ const serviceAgreementTypesTranslationMapping = {
|
|
|
34499
35149
|
adyenAccount: "businessAccountTerms",
|
|
34500
35150
|
adyenCard: "cardUserTerms",
|
|
34501
35151
|
adyenFranchisee: "franchiseesTAndCs",
|
|
34502
|
-
adyenPccr: "pccr"
|
|
35152
|
+
adyenPccr: "pccr",
|
|
35153
|
+
adyenChargeCard: "chargeCardUserAgreement"
|
|
34503
35154
|
};
|
|
34504
35155
|
const logger$e = createLogger("ServiceAgreementDropinComponent");
|
|
34505
35156
|
const FALLBACK_LANGUAGE_CODE = "en";
|
|
@@ -34510,6 +35161,7 @@ function ServiceAgreementDropinComponent({
|
|
|
34510
35161
|
handleDownloadAcceptedTermsOfServiceDocument,
|
|
34511
35162
|
handleDownloadUnacceptedTermsOfServiceDocument,
|
|
34512
35163
|
handleHomeClick,
|
|
35164
|
+
handleAddSigner,
|
|
34513
35165
|
handleSign,
|
|
34514
35166
|
taskType,
|
|
34515
35167
|
serviceAgreementTypes,
|
|
@@ -34550,8 +35202,8 @@ function ServiceAgreementDropinComponent({
|
|
|
34550
35202
|
const forms2 = [...signedForms, ...formsToBeSigned];
|
|
34551
35203
|
const [activeFormIndex, setActiveFormIndex] = useState(0);
|
|
34552
35204
|
const [activeForm, setActiveForm] = useState(forms2[activeFormIndex]);
|
|
34553
|
-
const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm.serviceAgreementType)) && !activeForm.acceptanceId;
|
|
34554
|
-
const showSignerCard = !!activeForm.acceptanceId;
|
|
35205
|
+
const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm == null ? void 0 : activeForm.serviceAgreementType)) && !(activeForm == null ? void 0 : activeForm.acceptanceId);
|
|
35206
|
+
const showSignerCard = !!(activeForm == null ? void 0 : activeForm.acceptanceId);
|
|
34555
35207
|
const handleServiceAgreementIsNotAvailableInThatLanguage = useCallback(() => {
|
|
34556
35208
|
showToast({
|
|
34557
35209
|
label: i18n.get("failedToGetServiceAgreementInSelectedLanguageFallbackToEn"),
|
|
@@ -34564,10 +35216,10 @@ function ServiceAgreementDropinComponent({
|
|
|
34564
35216
|
} = useServiceAgreement({
|
|
34565
35217
|
handleGetServiceAgreement,
|
|
34566
35218
|
handleServiceAgreementIsNotAvailableInThatLanguage,
|
|
34567
|
-
acceptanceId: activeForm.acceptanceId,
|
|
35219
|
+
acceptanceId: activeForm == null ? void 0 : activeForm.acceptanceId,
|
|
34568
35220
|
handleViewAcceptedTermsOfServiceDocument,
|
|
34569
35221
|
legalEntityId: legalEntityResponse.id,
|
|
34570
|
-
serviceAgreementType: activeForm.serviceAgreementType,
|
|
35222
|
+
serviceAgreementType: activeForm == null ? void 0 : activeForm.serviceAgreementType,
|
|
34571
35223
|
language: i18n.languageCode
|
|
34572
35224
|
});
|
|
34573
35225
|
const {
|
|
@@ -34722,12 +35374,24 @@ function ServiceAgreementDropinComponent({
|
|
|
34722
35374
|
});
|
|
34723
35375
|
}
|
|
34724
35376
|
};
|
|
35377
|
+
const addSignerAlert = jsx(Alert, {
|
|
35378
|
+
variant: signers.length ? "info" : "warning",
|
|
35379
|
+
className: "adyen-kyc-u-margin-top-16",
|
|
35380
|
+
title: i18n.get(signers.length ? "isYourNameMissingFromSigners" : "thereAreNoSigners"),
|
|
35381
|
+
children: jsx(Button, {
|
|
35382
|
+
label: i18n.get("addYourselfAsSigner"),
|
|
35383
|
+
onClick: handleAddSigner,
|
|
35384
|
+
showAsLink: true,
|
|
35385
|
+
underline: true,
|
|
35386
|
+
type: "button"
|
|
35387
|
+
})
|
|
35388
|
+
});
|
|
34725
35389
|
const sidebar = jsx(LoaderWrapper, {
|
|
34726
35390
|
status: loadingStatus,
|
|
34727
35391
|
formOpacityWhenLoading: 0.3,
|
|
34728
35392
|
showSpinner: false,
|
|
34729
35393
|
className: "adyen-kyc-dropin__sidebar-wrapper",
|
|
34730
|
-
children:
|
|
35394
|
+
children: jsx(FormNavigation, {
|
|
34731
35395
|
forms: forms2,
|
|
34732
35396
|
activeForm,
|
|
34733
35397
|
gotoForm,
|
|
@@ -34740,11 +35404,11 @@ function ServiceAgreementDropinComponent({
|
|
|
34740
35404
|
formOpacityWhenLoading: 0.3,
|
|
34741
35405
|
showSpinner: false,
|
|
34742
35406
|
className: "adyen-kyc-form-container",
|
|
34743
|
-
children: [
|
|
35407
|
+
children: [jsxs(LoaderWrapper, {
|
|
34744
35408
|
status: contractLoadingStatus,
|
|
34745
35409
|
formOpacityWhenLoading: 0.3,
|
|
34746
35410
|
showSpinner: false,
|
|
34747
|
-
children: serviceAgreement && jsxs(Fragment, {
|
|
35411
|
+
children: [serviceAgreement && jsxs(Fragment, {
|
|
34748
35412
|
children: [jsx(ContractViewer, {
|
|
34749
35413
|
contract: serviceAgreement.contract,
|
|
34750
35414
|
onExpandSection: handleExpandSection
|
|
@@ -34755,13 +35419,16 @@ function ServiceAgreementDropinComponent({
|
|
|
34755
35419
|
label: i18n.get("downloadAsPdf"),
|
|
34756
35420
|
icon: "download"
|
|
34757
35421
|
})]
|
|
34758
|
-
})
|
|
35422
|
+
}), !forms2.length && jsx(Alert, {
|
|
35423
|
+
variant: "info",
|
|
35424
|
+
title: i18n.get("nothingNeedsToBeSigned")
|
|
35425
|
+
})]
|
|
34759
35426
|
}), canSign && jsxs(Fragment, {
|
|
34760
|
-
children: [jsx(Field, {
|
|
35427
|
+
children: [!!signers.length && jsx(Field, {
|
|
34761
35428
|
name: "signer",
|
|
34762
35429
|
label: i18n.get("signer"),
|
|
34763
35430
|
classNameModifiers: ["col-50"],
|
|
34764
|
-
className: "adyen-kyc-u-margin-
|
|
35431
|
+
className: "adyen-kyc-u-margin-top-32",
|
|
34765
35432
|
errorMessage: i18n.get((_a = errors.signer) == null ? void 0 : _a.errorMessage),
|
|
34766
35433
|
isValid: valid.signer,
|
|
34767
35434
|
children: (childProps) => jsx(Select, {
|
|
@@ -34772,8 +35439,9 @@ function ServiceAgreementDropinComponent({
|
|
|
34772
35439
|
selected: data.signer,
|
|
34773
35440
|
items: signers
|
|
34774
35441
|
})
|
|
34775
|
-
}), jsx(Field, {
|
|
35442
|
+
}), addSignerAlert, jsx(Field, {
|
|
34776
35443
|
name: "acceptServiceAgreement",
|
|
35444
|
+
className: "adyen-kyc-u-margin-top-16",
|
|
34777
35445
|
errorMessage: i18n.get((_b = errors.acceptServiceAgreement) == null ? void 0 : _b.errorMessage),
|
|
34778
35446
|
isValid: valid.acceptServiceAgreement,
|
|
34779
35447
|
children: (childProps) => jsx(Checkbox, {
|
|
@@ -34803,7 +35471,7 @@ function ServiceAgreementDropinComponent({
|
|
|
34803
35471
|
homeButtonLabel: i18n.get("goToOverview"),
|
|
34804
35472
|
onNext: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1),
|
|
34805
35473
|
nextButtonLabel: i18n.get(canSign ? "sign" : "next"),
|
|
34806
|
-
nextButtonDisabled: !canSign && activeFormIndex === forms2.length - 1,
|
|
35474
|
+
nextButtonDisabled: forms2.length === 0 || !canSign && activeFormIndex === forms2.length - 1,
|
|
34807
35475
|
onBack: () => gotoForm(activeFormIndex - 1),
|
|
34808
35476
|
hideBackButton: activeFormIndex === 0,
|
|
34809
35477
|
backButtonLabel: i18n.get("previous")
|
|
@@ -35461,6 +36129,10 @@ const useNavigation = ({
|
|
|
35461
36129
|
onNavigate,
|
|
35462
36130
|
handleOpenSingpassAuthorizationLink
|
|
35463
36131
|
}) => {
|
|
36132
|
+
const {
|
|
36133
|
+
isSettingEnabled
|
|
36134
|
+
} = useSettingsContext();
|
|
36135
|
+
const showServiceAgreementsFirst = isSettingEnabled(SettingNames.ShowServiceAgreementsFirst);
|
|
35464
36136
|
const isNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
35465
36137
|
const showIntroduction = useShouldShowIntroduction({
|
|
35466
36138
|
legalEntity
|
|
@@ -35528,11 +36200,12 @@ const useNavigation = ({
|
|
|
35528
36200
|
canSeeEntitySelection,
|
|
35529
36201
|
showIntroduction,
|
|
35530
36202
|
isNewEntryFlowEnabled,
|
|
35531
|
-
shouldShowSingpassSelection
|
|
36203
|
+
shouldShowSingpassSelection,
|
|
36204
|
+
showServiceAgreementsFirst
|
|
35532
36205
|
});
|
|
35533
36206
|
setTaskHistory([...taskHistory.slice(0, taskHistory.length - 1), defaultTask]);
|
|
35534
36207
|
}
|
|
35535
|
-
}, [legalEntity, accountHolder, showIntroduction, isNewEntryFlowEnabled, shouldShowSingpassSelection, taskHistory]);
|
|
36208
|
+
}, [legalEntity, accountHolder, showIntroduction, isNewEntryFlowEnabled, shouldShowSingpassSelection, showServiceAgreementsFirst, taskHistory]);
|
|
35536
36209
|
return {
|
|
35537
36210
|
currentTask: actualTasks.at(-1),
|
|
35538
36211
|
previousTask: actualTasks.at(-2),
|
|
@@ -35545,9 +36218,13 @@ const getDefaultTask = ({
|
|
|
35545
36218
|
canSeeEntitySelection,
|
|
35546
36219
|
isNewEntryFlowEnabled,
|
|
35547
36220
|
showIntroduction,
|
|
35548
|
-
shouldShowSingpassSelection
|
|
36221
|
+
shouldShowSingpassSelection,
|
|
36222
|
+
showServiceAgreementsFirst
|
|
35549
36223
|
}) => {
|
|
35550
36224
|
const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
|
|
36225
|
+
if (showServiceAgreementsFirst) {
|
|
36226
|
+
return TaskTypes.SERVICE_AGREEMENT;
|
|
36227
|
+
}
|
|
35551
36228
|
if (isNewEntryFlowEnabled && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
|
|
35552
36229
|
if (showIntroduction) return TaskTypes.INTRODUCTION;
|
|
35553
36230
|
if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
|
|
@@ -36626,7 +37303,8 @@ function DropinComposerComponent({
|
|
|
36626
37303
|
handleViewAcceptedTermsOfServiceDocument: args.handleViewAcceptedTermsOfServiceDocument,
|
|
36627
37304
|
handleDownloadAcceptedTermsOfServiceDocument: args.handleDownloadAcceptedTermsOfServiceDocument,
|
|
36628
37305
|
handleDownloadUnacceptedTermsOfServiceDocument: args.handleDownloadUnacceptedTermsOfServiceDocument,
|
|
36629
|
-
handleHomeClick:
|
|
37306
|
+
handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW),
|
|
37307
|
+
handleAddSigner: () => navigateTo(TaskTypes.DECISION_MAKER),
|
|
36630
37308
|
handleSign: async (...params) => {
|
|
36631
37309
|
await args.handleSignServiceAgreement(...params);
|
|
36632
37310
|
await getServiceAgreementStatus();
|
|
@@ -37063,7 +37741,8 @@ function CreateIndividualComponent({
|
|
|
37063
37741
|
onSubmitSuccess,
|
|
37064
37742
|
handleBackClick,
|
|
37065
37743
|
modalView,
|
|
37066
|
-
onClose
|
|
37744
|
+
onClose,
|
|
37745
|
+
onUnmount
|
|
37067
37746
|
}) {
|
|
37068
37747
|
var _a;
|
|
37069
37748
|
const {
|
|
@@ -37091,6 +37770,12 @@ function CreateIndividualComponent({
|
|
|
37091
37770
|
if (modalView) {
|
|
37092
37771
|
setIsModalView(true);
|
|
37093
37772
|
}
|
|
37773
|
+
const handleOnClose = () => {
|
|
37774
|
+
if (modalView) {
|
|
37775
|
+
onUnmount == null ? void 0 : onUnmount();
|
|
37776
|
+
}
|
|
37777
|
+
onClose == null ? void 0 : onClose();
|
|
37778
|
+
};
|
|
37094
37779
|
const fetchLegalEntity = useCallback(async () => {
|
|
37095
37780
|
try {
|
|
37096
37781
|
const [parentEntity, entity] = await Promise.all([parentLegalEntityId ? getLegalEntity2(parentLegalEntityId) : Promise.resolve(void 0), legalEntityId ? getLegalEntity2(legalEntityId) : Promise.resolve(void 0)]);
|
|
@@ -37105,9 +37790,10 @@ function CreateIndividualComponent({
|
|
|
37105
37790
|
}, [fetchLegalEntity]);
|
|
37106
37791
|
const country = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
|
|
37107
37792
|
const onSubmit = (d) => {
|
|
37108
|
-
if (
|
|
37109
|
-
|
|
37793
|
+
if (modalView) {
|
|
37794
|
+
onUnmount == null ? void 0 : onUnmount();
|
|
37110
37795
|
}
|
|
37796
|
+
onSubmitSuccess == null ? void 0 : onSubmitSuccess(d);
|
|
37111
37797
|
};
|
|
37112
37798
|
return jsx(IndividualDropinComponent, {
|
|
37113
37799
|
parentLegalEntity,
|
|
@@ -37126,7 +37812,7 @@ function CreateIndividualComponent({
|
|
|
37126
37812
|
hideNavigation: true,
|
|
37127
37813
|
asModal: isModalView,
|
|
37128
37814
|
onSubmit,
|
|
37129
|
-
handleCloseClick:
|
|
37815
|
+
handleCloseClick: handleOnClose,
|
|
37130
37816
|
taskType
|
|
37131
37817
|
});
|
|
37132
37818
|
}
|
|
@@ -37199,15 +37885,25 @@ var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
|
|
|
37199
37885
|
OnboardingStatus2["VERIFIED"] = "VERIFIED";
|
|
37200
37886
|
return OnboardingStatus2;
|
|
37201
37887
|
})(OnboardingStatus || {});
|
|
37888
|
+
const skeleton = "adyen-kyc-skeleton";
|
|
37889
|
+
const skeletonCircle = "adyen-kyc-skeleton-circle";
|
|
37890
|
+
const skeletonText = "adyen-kyc-skeleton-text";
|
|
37891
|
+
const styles$1 = {
|
|
37892
|
+
skeleton,
|
|
37893
|
+
"skeleton-circle": "adyen-kyc-skeleton-circle",
|
|
37894
|
+
skeletonCircle,
|
|
37895
|
+
"skeleton-text": "adyen-kyc-skeleton-text",
|
|
37896
|
+
skeletonText
|
|
37897
|
+
};
|
|
37202
37898
|
const Skeleton = ({
|
|
37203
37899
|
circle = false,
|
|
37204
37900
|
text = false,
|
|
37205
37901
|
height = "1em",
|
|
37206
37902
|
width
|
|
37207
37903
|
}) => {
|
|
37208
|
-
const classNames = cx(
|
|
37209
|
-
|
|
37210
|
-
|
|
37904
|
+
const classNames = cx(styles$1.skeleton, {
|
|
37905
|
+
[styles$1.skeletonCircle]: circle,
|
|
37906
|
+
[styles$1.skeletonText]: text
|
|
37211
37907
|
});
|
|
37212
37908
|
return jsx("div", {
|
|
37213
37909
|
className: classNames,
|
|
@@ -37217,13 +37913,25 @@ const Skeleton = ({
|
|
|
37217
37913
|
}
|
|
37218
37914
|
});
|
|
37219
37915
|
};
|
|
37916
|
+
const embeddedStatus = "adyen-kyc-embedded-status";
|
|
37917
|
+
const embeddedStatusLoading = "adyen-kyc-embedded-status-loading";
|
|
37918
|
+
const embeddedStatusAvatar = "adyen-kyc-embedded-status-avatar";
|
|
37919
|
+
const embeddedStatusLight = "adyen-kyc-embedded-status-light";
|
|
37920
|
+
const embeddedStatusIcon = "adyen-kyc-embedded-status-icon";
|
|
37921
|
+
const embeddedStatusInfo = "adyen-kyc-embedded-status-info";
|
|
37220
37922
|
const styles = {
|
|
37221
|
-
"
|
|
37222
|
-
|
|
37223
|
-
"
|
|
37224
|
-
|
|
37225
|
-
"
|
|
37226
|
-
|
|
37923
|
+
"embedded-status": "adyen-kyc-embedded-status",
|
|
37924
|
+
embeddedStatus,
|
|
37925
|
+
"embedded-status-loading": "adyen-kyc-embedded-status-loading",
|
|
37926
|
+
embeddedStatusLoading,
|
|
37927
|
+
"embedded-status-avatar": "adyen-kyc-embedded-status-avatar",
|
|
37928
|
+
embeddedStatusAvatar,
|
|
37929
|
+
"embedded-status-light": "adyen-kyc-embedded-status-light",
|
|
37930
|
+
embeddedStatusLight,
|
|
37931
|
+
"embedded-status-icon": "adyen-kyc-embedded-status-icon",
|
|
37932
|
+
embeddedStatusIcon,
|
|
37933
|
+
"embedded-status-info": "adyen-kyc-embedded-status-info",
|
|
37934
|
+
embeddedStatusInfo
|
|
37227
37935
|
};
|
|
37228
37936
|
const statusToTag = (status) => {
|
|
37229
37937
|
switch (status) {
|
|
@@ -37288,23 +37996,23 @@ const EmbeddedStatus = ({
|
|
|
37288
37996
|
};
|
|
37289
37997
|
return jsxs("button", {
|
|
37290
37998
|
type: "button",
|
|
37291
|
-
className: cx(className, styles
|
|
37292
|
-
|
|
37293
|
-
|
|
37999
|
+
className: cx(className, styles.embeddedStatus, {
|
|
38000
|
+
[styles.embeddedStatusLoading]: loading,
|
|
38001
|
+
[styles.embeddedStatusLight]: light
|
|
37294
38002
|
}),
|
|
37295
38003
|
onClick,
|
|
37296
38004
|
children: [jsx("section", {
|
|
37297
|
-
className: styles
|
|
38005
|
+
className: styles.embeddedStatusAvatar,
|
|
37298
38006
|
children: loading ? jsx(Skeleton, {
|
|
37299
38007
|
height: "100%",
|
|
37300
38008
|
width: "100%",
|
|
37301
38009
|
circle: true
|
|
37302
38010
|
}) : jsx(Icon, {
|
|
37303
|
-
className: styles
|
|
38011
|
+
className: styles.embeddedStatusIcon,
|
|
37304
38012
|
name: iconName
|
|
37305
38013
|
})
|
|
37306
38014
|
}), jsx("section", {
|
|
37307
|
-
className: styles
|
|
38015
|
+
className: styles.embeddedStatusInfo,
|
|
37308
38016
|
children: loading ? jsxs(Fragment, {
|
|
37309
38017
|
children: [jsx(Skeleton, {
|
|
37310
38018
|
text: true,
|
|
@@ -37326,7 +38034,7 @@ const EmbeddedStatus = ({
|
|
|
37326
38034
|
})]
|
|
37327
38035
|
})
|
|
37328
38036
|
}), actionButton ? jsx("section", {
|
|
37329
|
-
className: styles
|
|
38037
|
+
className: styles.embeddedStatusButton,
|
|
37330
38038
|
children: loading ? jsx(Skeleton, {
|
|
37331
38039
|
width: "5em",
|
|
37332
38040
|
height: "2em"
|
|
@@ -37340,7 +38048,7 @@ const EmbeddedStatus = ({
|
|
|
37340
38048
|
small: true
|
|
37341
38049
|
})
|
|
37342
38050
|
}) : statusTag.translationKey && jsx("section", {
|
|
37343
|
-
className: styles
|
|
38051
|
+
className: styles.embeddedStatusTag,
|
|
37344
38052
|
children: loading ? jsx(Skeleton, {
|
|
37345
38053
|
width: "8ch",
|
|
37346
38054
|
height: "1em"
|
|
@@ -39458,7 +40166,7 @@ const ConfigurationApiProvider = ({
|
|
|
39458
40166
|
isEmbeddedDropin,
|
|
39459
40167
|
loadingContext
|
|
39460
40168
|
} = authContext;
|
|
39461
|
-
const sdkVersion = "2.
|
|
40169
|
+
const sdkVersion = "2.56.0";
|
|
39462
40170
|
useAnalytics({
|
|
39463
40171
|
onUserEvent,
|
|
39464
40172
|
legalEntityId: rootLegalEntityId,
|
|
@@ -39646,7 +40354,8 @@ const settingsDefaults = {
|
|
|
39646
40354
|
hideOnboardingIntroductionTrust: true,
|
|
39647
40355
|
hideOnboardingIntroductionSoleProprietor: true,
|
|
39648
40356
|
viewOnboardingGuidance: false,
|
|
39649
|
-
transferInstrumentLimit: 0
|
|
40357
|
+
transferInstrumentLimit: 0,
|
|
40358
|
+
showServiceAgreementsFirst: false
|
|
39650
40359
|
};
|
|
39651
40360
|
function SettingsProvider({
|
|
39652
40361
|
children,
|
|
@@ -40021,6 +40730,7 @@ class BaseElement {
|
|
|
40021
40730
|
...props
|
|
40022
40731
|
};
|
|
40023
40732
|
this._parentInstance = this.props._parentInstance;
|
|
40733
|
+
this.remove = this.remove.bind(this);
|
|
40024
40734
|
}
|
|
40025
40735
|
/**
|
|
40026
40736
|
* Mounts an element into the dom
|
|
@@ -40080,6 +40790,7 @@ class BaseElement {
|
|
|
40080
40790
|
if (this._node) {
|
|
40081
40791
|
render(null, this._node);
|
|
40082
40792
|
}
|
|
40793
|
+
this._node = void 0;
|
|
40083
40794
|
return this;
|
|
40084
40795
|
}
|
|
40085
40796
|
/**
|
|
@@ -40136,7 +40847,7 @@ const DebugModal = ({
|
|
|
40136
40847
|
};
|
|
40137
40848
|
const copyToClipboard = async () => {
|
|
40138
40849
|
const toCopy = {
|
|
40139
|
-
sdkVersion: "2.
|
|
40850
|
+
sdkVersion: "2.56.0",
|
|
40140
40851
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
40141
40852
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
40142
40853
|
};
|
|
@@ -40175,7 +40886,7 @@ const DebugModal = ({
|
|
|
40175
40886
|
children: [jsxs("div", {
|
|
40176
40887
|
className: "adyen-kyc-debug-modal__meta",
|
|
40177
40888
|
children: [jsxs("span", {
|
|
40178
|
-
children: ["SDK version: ", "2.
|
|
40889
|
+
children: ["SDK version: ", "2.56.0"]
|
|
40179
40890
|
}), jsxs("span", {
|
|
40180
40891
|
children: ["rootLegalEntityId: ", rootLegalEntityId]
|
|
40181
40892
|
})]
|
|
@@ -40323,14 +41034,14 @@ class UIElement extends BaseElement {
|
|
|
40323
41034
|
rootLegalEntityId,
|
|
40324
41035
|
handleGetLegalEntity: "handleGetLegalEntity" in this.props.componentProps ? this.props.componentProps.handleGetLegalEntity : void 0,
|
|
40325
41036
|
children: jsx("div", {
|
|
40326
|
-
className: "adyen-kyc-ui-element-container-wrapper",
|
|
40327
41037
|
children: jsx(AutoResizer, {
|
|
40328
41038
|
children: jsx("div", {
|
|
40329
41039
|
className: "adyen-kyc-ui-element-container",
|
|
40330
41040
|
children: jsx(ToastContextProvider, {
|
|
40331
41041
|
children: jsx(StateProvider, {
|
|
40332
41042
|
children: jsx(Component, {
|
|
40333
|
-
...this.props.componentProps
|
|
41043
|
+
...this.props.componentProps,
|
|
41044
|
+
onUnmount: this.remove
|
|
40334
41045
|
})
|
|
40335
41046
|
})
|
|
40336
41047
|
})
|