@adyen/kyc-components 3.45.0 → 3.46.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 +1500 -558
- package/dist/es/{bg-BG-Q7jr61oX.js → bg-BG-Ihgju3Pi.js} +49 -26
- package/dist/es/{cs-CZ-DWt-8d0a.js → cs-CZ-BwFstFmQ.js} +49 -26
- package/dist/es/{da-DK-DzKDKodb.js → da-DK-8v1CN9Kj.js} +49 -26
- package/dist/es/{de-DE-CTrlEFB7.js → de-DE-DtR-ZoAt.js} +49 -26
- package/dist/es/{el-GR-BEyHixTO.js → el-GR-CBnu_V96.js} +49 -26
- package/dist/es/{es-ES-C5YKWCME.js → es-ES-kb2BRKrK.js} +49 -26
- package/dist/es/{et-EE-UTwEA7KT.js → et-EE-UdwhQ1tL.js} +49 -26
- package/dist/es/{fi-FI-Dlg3u-HY.js → fi-FI-DX8-uQWW.js} +49 -26
- package/dist/es/{fr-FR-BrL2V-lF.js → fr-FR-Dflt81Kj.js} +49 -26
- package/dist/es/{hr-HR-CR1NpsoY.js → hr-HR-DDW3mkAM.js} +49 -26
- package/dist/es/{hu-HU-BkmzV8oZ.js → hu-HU-B7KDp-GT.js} +49 -26
- package/dist/es/{it-IT-BR75YMjD.js → it-IT-Q6-mT16i.js} +49 -26
- package/dist/es/{lt-LT-Cm17tGP4.js → lt-LT-DKLjCNW_.js} +49 -26
- package/dist/es/{lv-LV-Bj0D7n67.js → lv-LV-Cj-obzFe.js} +49 -26
- package/dist/es/{nl-NL-bhqLkBQz.js → nl-NL-C0DfxtrT.js} +49 -26
- package/dist/es/{no-NO-CrzRhfMh.js → no-NO-DRJeRltS.js} +49 -26
- package/dist/es/{pl-PL-BcncZK0S.js → pl-PL-DPYok5sp.js} +49 -26
- package/dist/es/{pt-PT-Bwx0xHGg.js → pt-PT-C5GFc3jY.js} +49 -26
- package/dist/es/{ro-RO-Bj9nLST9.js → ro-RO-BhsqkN_s.js} +49 -26
- package/dist/es/{sk-SK-CI2V7naC.js → sk-SK-HaK9kYN-.js} +49 -26
- package/dist/es/{sl-SI-Dg4cE1ea.js → sl-SI-VeIDFOxi.js} +49 -26
- package/dist/es/{sv-SE-DPB5qLHu.js → sv-SE-DEhZRTDK.js} +49 -26
- package/dist/style.css +107 -56
- package/dist/types/components/Address/utils.d.ts +1 -1
- package/dist/types/components/CustomerSupport/CustomerSupport.d.ts +1 -1
- package/dist/types/components/Dropins/DropinLayout/types.d.ts +0 -1
- package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForAssetSale.d.ts +2 -0
- package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForBusiness.d.ts +2 -0
- package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForCryptocurrency.d.ts +2 -0
- package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForGambling.d.ts +2 -0
- package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/AdditionalDataForThirdParty.d.ts +2 -0
- package/dist/types/components/Dropins/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +18 -0
- package/dist/types/components/Dropins/SourceOfFundsDropin/SourceOfFundsAdditionalData.d.ts +2 -0
- package/dist/types/components/Dropins/SourceOfFundsDropin/SourceOfFundsDropin.d.ts +0 -3
- package/dist/types/components/Dropins/SourceOfFundsDropin/types.d.ts +27 -16
- package/dist/types/components/Dropins/SourceOfFundsDropin/utils.d.ts +41 -0
- package/dist/types/components/Dropins/SourceOfFundsDropin/validate.d.ts +2 -2
- package/dist/types/components/ui/atoms/InputGroupAddon/InputGroupAddon.d.ts +7 -0
- package/dist/types/core/errorMapping.d.ts +1 -0
- package/dist/types/core/models/api/analytics.d.ts +1 -0
- package/dist/types/core/models/api/source-of-funds.d.ts +4 -4
- package/dist/types/core/models/form.d.ts +0 -1
- package/dist/types/stores/globalStore/get-task-status.d.ts +1 -0
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/formatCurrency.d.ts +1 -0
- package/dist/types/utils/mapping/componentApiMapping.d.ts +11 -14
- package/package.json +1 -1
- package/dist/types/components/Dropins/DropinLayout/EmbeddedActionBar/EmbeddedActionBar.d.ts +0 -7
- package/dist/types/components/Dropins/SourceOfFundsDropin/SourceOfFundsTellUsMore.d.ts +0 -3
|
@@ -10,6 +10,7 @@ import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
|
10
10
|
import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
|
|
11
11
|
import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
|
|
12
12
|
import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
|
|
13
|
+
import isURL from "validator/es/lib/isURL.js";
|
|
13
14
|
const ConfigurationApiContext = createContext(void 0);
|
|
14
15
|
const useConfigurationApi = () => {
|
|
15
16
|
const configurationApi = useContext(ConfigurationApiContext);
|
|
@@ -97,6 +98,7 @@ const defaultLocaleTranslations = {
|
|
|
97
98
|
addExtraBankAccount: "Add extra bank account",
|
|
98
99
|
addExtraPayinAccount: "Add extra payin account",
|
|
99
100
|
addExtraPayoutAccount: "Add extra payout account",
|
|
101
|
+
addInvestor: "Add investor",
|
|
100
102
|
addManually: "Add manually",
|
|
101
103
|
addMissingBankDetails: "We are missing your bank details in order to perform payouts, please add your bank account.",
|
|
102
104
|
addOwnerToTrustMember: "Add owner of %{trustMember}",
|
|
@@ -115,12 +117,13 @@ const defaultLocaleTranslations = {
|
|
|
115
117
|
adyenKeepsDataAsLongAsLegallyRequired: "Adyen only keeps your data for as long as we're legally required to. It won't be used for any other purposes or by other third parties than those stated.",
|
|
116
118
|
adyenWillOnlyGetTemporaryAccess: "Adyen will only gain temporary access to your bank details, and your data is never shared with third parties.",
|
|
117
119
|
allCapabilitiesValid: "All capabilities are valid",
|
|
120
|
+
amountIsRequired: "Amount is required",
|
|
121
|
+
amountWon: "Amount won",
|
|
118
122
|
anAssociation: "An association",
|
|
119
123
|
anLEIIsAUniqueCode: "An LEI is a unique code that identifies legal entities, including companies, who engage in financial transactions.",
|
|
120
124
|
andResubmit: "and submit again.",
|
|
121
125
|
annualReport: "Annual Report",
|
|
122
126
|
annualTurnover: "Annual turnover",
|
|
123
|
-
annualTurnoverCurrency: "Annual turnover currency",
|
|
124
127
|
annualTurnoverHelper: "The annual sales revenue minus all discounts and sales taxes. Also known as net sales.",
|
|
125
128
|
annualTurnoverValue: "Annual turnover value",
|
|
126
129
|
apartmentSuite: "Apartment / Suite",
|
|
@@ -129,6 +132,7 @@ const defaultLocaleTranslations = {
|
|
|
129
132
|
areYouACompany: "Are you a company?",
|
|
130
133
|
areYouAnIndividual: "Are you an individual?",
|
|
131
134
|
areYouSureYouWantToDeleteThisBankAccount: "Are you sure you want to delete this bank account?",
|
|
135
|
+
areYouSureYouWantToDeleteThisInvestorDetails: "Are you sure you want to delete this investor details?",
|
|
132
136
|
arithmosEngraphes: "Αριθμός Εγγραφής Φ.Π.Α.",
|
|
133
137
|
articlesOfIncorporation: "Articles of incorporation",
|
|
134
138
|
arvonlisaveronumeroMervardesskattenummer: "Arvonlisäveronumero Mervärdesskattenummer",
|
|
@@ -197,10 +201,13 @@ const defaultLocaleTranslations = {
|
|
|
197
201
|
businessAccountDetailsDescriptionReview: "In order to ensure your data is up-to-date, please verify the following details. If necessary, please adjust any data that is no longer accurate.",
|
|
198
202
|
businessAccountTerms: "Business Account Terms",
|
|
199
203
|
businessDetails: "Business details",
|
|
204
|
+
businessDescription: "Business description",
|
|
205
|
+
businessEarningDetails: "Business earning details",
|
|
200
206
|
businessEntityDescription: "This is usually a sole proprietor, private company, public corporation, partnership, or non profit.",
|
|
201
207
|
businessEntityTitle: "Business entity",
|
|
202
208
|
businessIncorporationNumber: "Business incorporation number",
|
|
203
209
|
businessInformation: "Business information",
|
|
210
|
+
businessInvestorDetails: "Business investor details",
|
|
204
211
|
businessName: "Business name",
|
|
205
212
|
businessNumber: "Business number",
|
|
206
213
|
businessRegistrationDocument__FR: "Business registration document, such as a KBIS extract or situation au répertoire sirene",
|
|
@@ -300,8 +307,11 @@ const defaultLocaleTranslations = {
|
|
|
300
307
|
countryRegionOfEstablishment: "Country/region of establishment",
|
|
301
308
|
countryWithoutVatOrGstSystem: "There is no indirect tax in this country/region of establishment",
|
|
302
309
|
country__US__business: "Where is your business registered?",
|
|
310
|
+
cryptocurrencyExchange: "Cryptocurrency exchange",
|
|
311
|
+
cryptocurrencyProceedDetails: "Cryptocurrency proceed details",
|
|
303
312
|
currency: "Currency",
|
|
304
313
|
currencyCode: "Currency code",
|
|
314
|
+
currencyIsRequired: "Currency is required",
|
|
305
315
|
currencyPlaceholder: "Select a currency code",
|
|
306
316
|
customerSupport: "Customer support",
|
|
307
317
|
cyRegistrationNumber: "Αριθμός Εγγραφής",
|
|
@@ -309,6 +319,8 @@ const defaultLocaleTranslations = {
|
|
|
309
319
|
dataReviewNeeded: "A data review is neeced.",
|
|
310
320
|
dateCannotBeInTheFuture: "Date cannot be in the future",
|
|
311
321
|
dateOfIncorporation: "Date of incorporation",
|
|
322
|
+
dateOfSale: "Date of sale",
|
|
323
|
+
dateOfSourceEvent: "Date of source event",
|
|
312
324
|
dateOfTotalAssetsCalculation: "The date on which total assets and annual turnover were calculated is often the balance sheet date.",
|
|
313
325
|
dateOnDocumentNoOlderThanXMonths: "Date on the document is no older than %{numberOfMonths} months",
|
|
314
326
|
datePlaceholder: "dd/mm/yyyy",
|
|
@@ -322,6 +334,7 @@ const defaultLocaleTranslations = {
|
|
|
322
334
|
definedBeneficiary: "Defined beneficiary",
|
|
323
335
|
definedBeneficiaryDescription: "A natural person, corporate entity, or member of a class in whose interest the trust is principally constituted or operates.",
|
|
324
336
|
"delete": "Delete",
|
|
337
|
+
deleteInvestorDetails: "Delete investor details",
|
|
325
338
|
depositSlip: "Deposit slip",
|
|
326
339
|
describeWhoIsABeneficiaryInYourTrust: "Describe in open format who is set to be a beneficiary in your trust deed",
|
|
327
340
|
description: "Description",
|
|
@@ -667,6 +680,10 @@ const defaultLocaleTranslations = {
|
|
|
667
680
|
errorMessage_2_8196: "proofOfOwnership document to perform verification was missing.",
|
|
668
681
|
errorMessage_2_8234: "'organization.countryOfGoverningLaw' was missing.",
|
|
669
682
|
errorMessage_2_8236: "Proof of director was missing.",
|
|
683
|
+
errorMessage_2_8247: "'organization.support.email' was missing",
|
|
684
|
+
errorMessage_2_8248: "'individual.support.email' was missing",
|
|
685
|
+
errorMessage_2_8249: "'organization.support.phone.number' was missing",
|
|
686
|
+
errorMessage_2_8250: "'individual.support.phone.number' was missing",
|
|
670
687
|
errorMessage_3_10: "Review of data is required",
|
|
671
688
|
euVatNumber: "EU VAT number",
|
|
672
689
|
exemptedFromTax: "Exempted from tax",
|
|
@@ -717,6 +734,7 @@ const defaultLocaleTranslations = {
|
|
|
717
734
|
fullDocumentVisible: "The full document needs to be visible, with all text readable",
|
|
718
735
|
fullDocumentVisibleWithReadableText: "The full document needs to be visible, with all text readable",
|
|
719
736
|
fundingSources: "Funding sources",
|
|
737
|
+
gamblingWebsite: "Gambling website",
|
|
720
738
|
getSetUpInstantly: "Get set up instantly",
|
|
721
739
|
getYourBusinessVerifiedDetails: "Get your business's verified details instantly and skip uploading documents.",
|
|
722
740
|
getYourVerifiedDetailsInstantly: "Get your verified details instantly and skip uploading documents.",
|
|
@@ -875,6 +893,9 @@ const defaultLocaleTranslations = {
|
|
|
875
893
|
invalidInputError: "There was an invalid input error:",
|
|
876
894
|
invalidNumberOfEmployees: "Please enter a valid number",
|
|
877
895
|
invalidPhoneNumber: "Please enter a valid phone number",
|
|
896
|
+
investmentAmount: "Investment amount",
|
|
897
|
+
investorInformation: "Investor information",
|
|
898
|
+
investorLocation: "Investor's location",
|
|
878
899
|
irdDocument: "IRD document",
|
|
879
900
|
irdNumber: "IRD number",
|
|
880
901
|
irsCP575: "IRS CP 575 letter",
|
|
@@ -1081,8 +1102,10 @@ const defaultLocaleTranslations = {
|
|
|
1081
1102
|
phoneNumber__placeholder__US: "(000) 000-0000",
|
|
1082
1103
|
pleaseEnsureTheFollowing: "Please ensure the following section is fulfilled to complete the review of your data.",
|
|
1083
1104
|
pleaseEnterAPhoneNumberPrefixedWithCountryCode: "Please enter a phone number prefixed with a country code e.g. %{defaultPrefix}.",
|
|
1105
|
+
pleaseEnterAValidAmount: "Please enter a valid amount.",
|
|
1084
1106
|
pleaseEnterAValidNumber: "Please enter a valid number.",
|
|
1085
1107
|
pleaseEnterAValidWholeNumber: "Please enter a valid whole number.",
|
|
1108
|
+
pleaseFillInAllFields: "Please fill in all fields.",
|
|
1086
1109
|
pleaseNote: "Please note:",
|
|
1087
1110
|
pleaseProvideThePurposeOfCharitableTrust: "Please provide the purpose of your charitable trust",
|
|
1088
1111
|
pooledSuperannuationTrust: "Pooled superannuation trust",
|
|
@@ -1202,6 +1225,10 @@ const defaultLocaleTranslations = {
|
|
|
1202
1225
|
remediationMessage_2_188: "Add proofOfOwnership document document for verification to legal entity",
|
|
1203
1226
|
remediationMessage_2_222: "Upload a proof of relationship to individual",
|
|
1204
1227
|
remediationMessage_2_223: "Add 'organization.countryOfGoverningLaw' to legal entity",
|
|
1228
|
+
remediationMessage_2_234: "Add 'organization.support.email' to legal entity",
|
|
1229
|
+
remediationMessage_2_235: "Add 'individual.support.email' to legal entity",
|
|
1230
|
+
remediationMessage_2_236: "Add 'organization.support.phone.number' to legal entity",
|
|
1231
|
+
remediationMessage_2_237: "Add 'individual.support.email' to legal entity",
|
|
1205
1232
|
remediationMessage_3_100: "Check the above information, then click here to confirm.",
|
|
1206
1233
|
remove: "Remove",
|
|
1207
1234
|
removeDecisionMaker: "remove %{decisionMaker}",
|
|
@@ -1228,8 +1255,10 @@ const defaultLocaleTranslations = {
|
|
|
1228
1255
|
routingNumber: "Routing number",
|
|
1229
1256
|
routingNumberVisible: "Includes your routing number",
|
|
1230
1257
|
salarySlip: "Salary slip",
|
|
1258
|
+
saleAmount: "Sale amount",
|
|
1231
1259
|
sameAsRegisteredAddress: "Same as registered business address",
|
|
1232
1260
|
sameNameAsLegalName: "Same as legal name of the company",
|
|
1261
|
+
save: "Save",
|
|
1233
1262
|
saveAndGoToOverview: "Save and go to overview",
|
|
1234
1263
|
screenshotOfOnlineBankingEnviroment: "Screenshot of online banking environment",
|
|
1235
1264
|
search: "Search",
|
|
@@ -1346,6 +1375,9 @@ const defaultLocaleTranslations = {
|
|
|
1346
1375
|
taxReferenceNumber: "Tax reference number",
|
|
1347
1376
|
taxationDocument: "Taxation document",
|
|
1348
1377
|
taxpayerReferenceNumber: "Taxpayer reference number",
|
|
1378
|
+
tellUsMoreAboutTheCryptocurrency: "Tell us more about the cryptocurrency earnings that will be used with our financial products.",
|
|
1379
|
+
tellUsMoreAboutThePreviousBusinessEarnings: "Tell us more about the previous business earnings that will be used with our financial products. Upload supporting documents in the next step. ",
|
|
1380
|
+
tellUsMoreAboutTheInvestors: "Tell us more about the investors whose funds will be used with our financial products. Upload supporting documentation in the next step. ",
|
|
1349
1381
|
tellUsMoreAboutThisSource: "Tell us more about this source",
|
|
1350
1382
|
textToVerifyAccount: "For you to receive your payouts, we need a verified bank account.",
|
|
1351
1383
|
the7CharacterIdentifierAssignedToThis: "The 7-character identifier assigned to this company by the Sistema di Interscambio (SDI) for electronic invoicing in Italy. For example, %{example}",
|
|
@@ -1434,6 +1466,7 @@ const defaultLocaleTranslations = {
|
|
|
1434
1466
|
validationPleaseEnterAValidTaxIdNumber: "Please enter a valid Tax id number.",
|
|
1435
1467
|
validationPleaseEnterAValidTaxIdNumberWithFormat: "Please enter a valid Tax id number. Expected format: %{format}",
|
|
1436
1468
|
validationPleaseEnterAValidUen: "Please enter a valid UEN",
|
|
1469
|
+
validationPleaseEnterAValidUrl: "Please enter a valid URL",
|
|
1437
1470
|
validationPleaseEnterAValidVatNumber: "Please enter a valid Tax id number",
|
|
1438
1471
|
validationPleaseEnterAValidVatNumberWithFormat: "Please enter a valid VAT number. Expected format: %{format}",
|
|
1439
1472
|
vatAbsenceReason: "VAT number absence reason",
|
|
@@ -2232,7 +2265,7 @@ const NO_ALPHABET_REGEX = /^[^a-zA-Z]*$/;
|
|
|
2232
2265
|
const INDIVIDUAL_VALID_CHAR_REGEX = /^[\p{L}\p{M}\d\s\-—./']*$/u;
|
|
2233
2266
|
const OTHER_ENTITIES_VALID_CHAR_REGEX = /^[\w\s,.;:\-—&!?@()"'/\\+\p{L}\p{M}]+$/u;
|
|
2234
2267
|
const matchesRegex = (regex, input) => isString(input) && regex.test(input ?? "");
|
|
2235
|
-
const hasRepeatedCharacters = (input) => !isEmpty$1(input) && input.length > 1 && new Set(input).size === 1;
|
|
2268
|
+
const hasRepeatedCharacters = (input) => !isEmpty$1(input) && input.length > 1 && new Set(input.toLowerCase()).size === 1;
|
|
2236
2269
|
const isValidMinLength = (input, minLength = 1) => !isEmpty$1(input) && input.length >= minLength;
|
|
2237
2270
|
const isInvalidName = (input) => {
|
|
2238
2271
|
const invalidNames = /* @__PURE__ */ new Set([
|
|
@@ -15630,20 +15663,17 @@ const highExposureBaseMapping = {
|
|
|
15630
15663
|
};
|
|
15631
15664
|
const sourceOfFundsBaseMapping = {
|
|
15632
15665
|
"sourceOfFundsType.type": "sourceOfFunds.type",
|
|
15633
|
-
"
|
|
15634
|
-
"
|
|
15635
|
-
"
|
|
15636
|
-
|
|
15637
|
-
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
dateOfSourceEvent: "sourceOfFunds.dateOfSourceEvent",
|
|
15645
|
-
website: "sourceOfFunds.website",
|
|
15646
|
-
financiers: "sourceOfFunds.financiers"
|
|
15666
|
+
"additionalData.description": "sourceOfFunds.description",
|
|
15667
|
+
"additionalData.amount": "sourceOfFunds.amount",
|
|
15668
|
+
"additionalData.dateOfFundsReceived": "sourceOfFunds.dateOfFundsReceived",
|
|
15669
|
+
"additionalData.purpose": "sourceOfFunds.purpose",
|
|
15670
|
+
"additionalData.relationship": "sourceOfFunds.relationship",
|
|
15671
|
+
"additionalData.originatorSourceOfFundsType": "sourceOfFunds.originatorSourceOfFundsType",
|
|
15672
|
+
"additionalData.originatorLegalEntityId": "sourceOfFunds.originatorLegalEntityId",
|
|
15673
|
+
"additionalData.financiers": "sourceOfFunds.financiers",
|
|
15674
|
+
"additionalData.cryptocurrencyExchange": "sourceOfFunds.cryptocurrencyExchange",
|
|
15675
|
+
"additionalData.dateOfSourceEvent": "sourceOfFunds.dateOfSourceEvent",
|
|
15676
|
+
"additionalData.website": "sourceOfFunds.website"
|
|
15647
15677
|
};
|
|
15648
15678
|
const businessDetailsComponentsKeyMapping = {
|
|
15649
15679
|
"additionalInformation.exemptedFromVat": "organization.vatAbsenceReason",
|
|
@@ -19748,7 +19778,7 @@ function PersonalDetails(props) {
|
|
|
19748
19778
|
const isDecisionMakerTask = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER;
|
|
19749
19779
|
const isTopLevelEntity = taskType === TaskTypes.INDIVIDUAL;
|
|
19750
19780
|
const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
|
|
19751
|
-
const countryRequiringNationality = (
|
|
19781
|
+
const countryRequiringNationality = (detailsData == null ? void 0 : detailsData.residencyCountry) || ((_b = parentLegalEntity == null ? void 0 : parentLegalEntity.organization) == null ? void 0 : _b.registeredAddress.country);
|
|
19752
19782
|
const requiredFieldsByTask = (requiredFields || personalDetailsFields).filter(
|
|
19753
19783
|
(field) => !canChangeEntityType && (field !== "role" || field === "role" && isDecisionMakerTask) || canChangeEntityType && (field !== "role" || field === "role" && isDecisionMakerTask) || field === "relationship" && isLegalRepresentativeDetailsTask
|
|
19754
19784
|
);
|
|
@@ -25136,6 +25166,7 @@ const dataMissingRemediationsToFieldsMap = {
|
|
|
25136
25166
|
"2_158": ["vatNumber", "exemptedFromVat", "vatAbsenceReason"],
|
|
25137
25167
|
"2_222": [DocumentType.PROOF_OF_RELATIONSHIP]
|
|
25138
25168
|
};
|
|
25169
|
+
const CUSTOMER_SUPPORT_DATA_MISSING_ERROR_CODES = ["2_8247", "2_8248", "2_8249", "2_8250"];
|
|
25139
25170
|
const DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING = {
|
|
25140
25171
|
"2_8064": "2_123",
|
|
25141
25172
|
// Owner
|
|
@@ -29811,6 +29842,15 @@ const formatCurrency = (amount, currency, locale) => {
|
|
|
29811
29842
|
);
|
|
29812
29843
|
return format(amount);
|
|
29813
29844
|
};
|
|
29845
|
+
const formatAmountWithCurrency = (amount, currency) => {
|
|
29846
|
+
const commaDecimalCurrencies = ["EUR", "BRL", "ARS", "CHF"];
|
|
29847
|
+
const locale = commaDecimalCurrencies.includes(currency.toUpperCase()) ? "de-DE" : "en-US";
|
|
29848
|
+
const formattedAmount = formatCurrency(amount, currency, locale);
|
|
29849
|
+
if (!formattedAmount) {
|
|
29850
|
+
return void 0;
|
|
29851
|
+
}
|
|
29852
|
+
return `${formattedAmount} ${currency}`;
|
|
29853
|
+
};
|
|
29814
29854
|
const formatFinancialInformationSummary = (data, i18n) => {
|
|
29815
29855
|
if (!data) return {};
|
|
29816
29856
|
const summary2 = {
|
|
@@ -32253,7 +32293,13 @@ const mapCustomerSupportSchemaToCustomerSupportType = (customerSupport) => {
|
|
|
32253
32293
|
};
|
|
32254
32294
|
};
|
|
32255
32295
|
const logger$t = createLogger("CustomerSupport");
|
|
32256
|
-
function CustomerSupport(
|
|
32296
|
+
function CustomerSupport({
|
|
32297
|
+
country,
|
|
32298
|
+
onNavigateBack,
|
|
32299
|
+
onSubmit,
|
|
32300
|
+
legalEntityResponse,
|
|
32301
|
+
handleUpdateLegalEntity
|
|
32302
|
+
}) {
|
|
32257
32303
|
var _a, _b, _c, _d, _e, _f;
|
|
32258
32304
|
const { i18n } = useI18nContext();
|
|
32259
32305
|
const { showToast } = useToastContext();
|
|
@@ -32262,7 +32308,6 @@ function CustomerSupport(props) {
|
|
|
32262
32308
|
const {
|
|
32263
32309
|
state: { currentState }
|
|
32264
32310
|
} = useStateContext();
|
|
32265
|
-
const { country, onNavigateBack, onSubmit, legalEntityResponse, handleUpdateLegalEntity } = props;
|
|
32266
32311
|
const legalEntityType = legalEntityResponse.type;
|
|
32267
32312
|
const contactDetailsData = {
|
|
32268
32313
|
phone: (_b = (_a = legalEntityResponse[legalEntityType]) == null ? void 0 : _a.support) == null ? void 0 : _b.phone,
|
|
@@ -33098,6 +33143,46 @@ var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
|
|
|
33098
33143
|
VerificationStatus2["REJECTED"] = "rejected";
|
|
33099
33144
|
return VerificationStatus2;
|
|
33100
33145
|
})(VerificationStatus || {});
|
|
33146
|
+
const calculateCustomerSupportTask = (capabilityProblems, rootLegalEntity) => {
|
|
33147
|
+
var _a, _b, _c, _d, _e, _f;
|
|
33148
|
+
const supportData = ((_a = rootLegalEntity.individual) == null ? void 0 : _a.support) ?? ((_b = rootLegalEntity.organization) == null ? void 0 : _b.support);
|
|
33149
|
+
const hasMissingDataErrors = (_d = (_c = capabilityProblems.LegalEntity) == null ? void 0 : _c[rootLegalEntity.id].missingData) == null ? void 0 : _d.some((error) => CUSTOMER_SUPPORT_DATA_MISSING_ERROR_CODES.includes(error.code));
|
|
33150
|
+
if (!supportData) {
|
|
33151
|
+
return {
|
|
33152
|
+
status: TaskStatus.DETAILS_REQUIRED,
|
|
33153
|
+
reason: "rootLegalEntityIsEmpty"
|
|
33154
|
+
};
|
|
33155
|
+
}
|
|
33156
|
+
if (hasMissingDataErrors) {
|
|
33157
|
+
return {
|
|
33158
|
+
status: TaskStatus.DETAILS_REQUIRED,
|
|
33159
|
+
reason: "dataMissingError",
|
|
33160
|
+
details: {
|
|
33161
|
+
missingData: (_f = (_e = capabilityProblems.LegalEntity) == null ? void 0 : _e[rootLegalEntity.id].missingData) == null ? void 0 : _f.filter(
|
|
33162
|
+
(error) => CUSTOMER_SUPPORT_DATA_MISSING_ERROR_CODES.includes(error.code)
|
|
33163
|
+
)
|
|
33164
|
+
}
|
|
33165
|
+
};
|
|
33166
|
+
}
|
|
33167
|
+
const pendingCapabilities = getPendingCapabilities(rootLegalEntity);
|
|
33168
|
+
if (pendingCapabilities.length > 0) {
|
|
33169
|
+
return {
|
|
33170
|
+
status: TaskStatus.PROCESSING,
|
|
33171
|
+
reason: "pendingCapabilities",
|
|
33172
|
+
details: { pendingCapabilities }
|
|
33173
|
+
};
|
|
33174
|
+
}
|
|
33175
|
+
if (hasAllCapabilitiesValid(rootLegalEntity)) {
|
|
33176
|
+
return {
|
|
33177
|
+
status: TaskStatus.FINISHED,
|
|
33178
|
+
reason: "allCapabilitiesValid"
|
|
33179
|
+
};
|
|
33180
|
+
}
|
|
33181
|
+
return {
|
|
33182
|
+
status: TaskStatus.FINISHED,
|
|
33183
|
+
reason: "noIssuesFound"
|
|
33184
|
+
};
|
|
33185
|
+
};
|
|
33101
33186
|
const getRegularTaskStatus = ({
|
|
33102
33187
|
taskType,
|
|
33103
33188
|
capabilityProblems,
|
|
@@ -33115,7 +33200,8 @@ const getRegularTaskStatus = ({
|
|
|
33115
33200
|
const importantProblems = findImportantProblems(
|
|
33116
33201
|
entityType,
|
|
33117
33202
|
capabilityProblems,
|
|
33118
|
-
relevantEntityIds
|
|
33203
|
+
relevantEntityIds,
|
|
33204
|
+
taskType
|
|
33119
33205
|
);
|
|
33120
33206
|
if (importantProblems.length > 0) {
|
|
33121
33207
|
return importantProblems[0].statusWithReason;
|
|
@@ -33142,10 +33228,21 @@ const IMPORTANT_STATUSES = [
|
|
|
33142
33228
|
TaskStatus.ERROR,
|
|
33143
33229
|
TaskStatus.PROCESSING
|
|
33144
33230
|
];
|
|
33145
|
-
function findImportantProblems(type, capabilityProblems, entityIds) {
|
|
33231
|
+
function findImportantProblems(type, capabilityProblems, entityIds, taskType) {
|
|
33146
33232
|
if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds.length) return [];
|
|
33147
|
-
const
|
|
33148
|
-
|
|
33233
|
+
const problems = cloneObject(capabilityProblems);
|
|
33234
|
+
if (taskType !== TaskTypes.CUSTOMER_SUPPORT) {
|
|
33235
|
+
entityIds.forEach((id) => {
|
|
33236
|
+
var _a, _b, _c, _d, _e;
|
|
33237
|
+
if ((_b = (_a = problems.LegalEntity) == null ? void 0 : _a[id]) == null ? void 0 : _b.missingData) {
|
|
33238
|
+
problems.LegalEntity[id].missingData = (_e = (_d = (_c = problems.LegalEntity) == null ? void 0 : _c[id]) == null ? void 0 : _d.missingData) == null ? void 0 : _e.filter(
|
|
33239
|
+
(missingDataErrors) => !CUSTOMER_SUPPORT_DATA_MISSING_ERROR_CODES.includes(missingDataErrors.code)
|
|
33240
|
+
);
|
|
33241
|
+
}
|
|
33242
|
+
});
|
|
33243
|
+
}
|
|
33244
|
+
const importantStatuses = Object.entries(problems[type] ?? {}).filter(([key]) => entityIds.includes(key)).map(([, value]) => value).filter(
|
|
33245
|
+
(problems2) => problems2.statusWithReason !== void 0 && IMPORTANT_STATUSES.includes(problems2.statusWithReason.status)
|
|
33149
33246
|
);
|
|
33150
33247
|
return importantStatuses.sort(
|
|
33151
33248
|
(prev, curr) => curr.statusWithReason.status - prev.statusWithReason.status
|
|
@@ -33249,8 +33346,7 @@ const calculateTaskStatus = ({
|
|
|
33249
33346
|
break;
|
|
33250
33347
|
}
|
|
33251
33348
|
case TaskTypes.CUSTOMER_SUPPORT:
|
|
33252
|
-
|
|
33253
|
-
break;
|
|
33349
|
+
return calculateCustomerSupportTask(capabilityProblems, rootLegalEntity);
|
|
33254
33350
|
}
|
|
33255
33351
|
return getRegularTaskStatus({
|
|
33256
33352
|
taskType,
|
|
@@ -37266,10 +37362,6 @@ function RoleAndTypeDropin({
|
|
|
37266
37362
|
] });
|
|
37267
37363
|
return /* @__PURE__ */ jsx(DropinLayout, { content });
|
|
37268
37364
|
}
|
|
37269
|
-
const EmbeddedActionBar = ({ left, right }) => /* @__PURE__ */ jsxs("footer", { className: "adyen-kyc-embedded-action-bar", children: [
|
|
37270
|
-
/* @__PURE__ */ jsx("section", { children: left }),
|
|
37271
|
-
/* @__PURE__ */ jsx("section", { className: "adyen-kyc-embedded-action-bar-right", children: right })
|
|
37272
|
-
] });
|
|
37273
37365
|
const serviceAgreementValidationRules = {
|
|
37274
37366
|
signer: { modes: ["blur"], validate: (signer) => !!signer, errorMessage: "fieldIsRequired" },
|
|
37275
37367
|
acceptServiceAgreement: {
|
|
@@ -37729,10 +37821,19 @@ function ServiceAgreementDropin({
|
|
|
37729
37821
|
setHasFinished(true);
|
|
37730
37822
|
}
|
|
37731
37823
|
};
|
|
37732
|
-
const
|
|
37733
|
-
|
|
37824
|
+
const endScreen = hasFinished && /* @__PURE__ */ jsx(
|
|
37825
|
+
Splashscreen,
|
|
37734
37826
|
{
|
|
37735
|
-
|
|
37827
|
+
icon: "check",
|
|
37828
|
+
title: i18n.get("serviceAgreementSignedAndDated"),
|
|
37829
|
+
onClick: handleCloseClick
|
|
37830
|
+
}
|
|
37831
|
+
);
|
|
37832
|
+
return /* @__PURE__ */ jsx(MaybeModal, { inline: !asModal, onClose: handleCloseClick, children: /* @__PURE__ */ jsxs(ModalContent, { children: [
|
|
37833
|
+
!asEmbedded && sidebar,
|
|
37834
|
+
endScreen || content,
|
|
37835
|
+
asEmbedded && /* @__PURE__ */ jsxs(ModalFooter, { children: [
|
|
37836
|
+
/* @__PURE__ */ jsx(
|
|
37736
37837
|
StepProgressIndicator,
|
|
37737
37838
|
{
|
|
37738
37839
|
activeStepIndex: currentStep ?? 0,
|
|
@@ -37741,46 +37842,25 @@ function ServiceAgreementDropin({
|
|
|
37741
37842
|
thick: true
|
|
37742
37843
|
}
|
|
37743
37844
|
),
|
|
37744
|
-
|
|
37745
|
-
|
|
37746
|
-
|
|
37747
|
-
|
|
37748
|
-
|
|
37749
|
-
|
|
37750
|
-
|
|
37751
|
-
|
|
37752
|
-
|
|
37753
|
-
|
|
37754
|
-
|
|
37755
|
-
|
|
37756
|
-
|
|
37757
|
-
|
|
37758
|
-
|
|
37759
|
-
|
|
37760
|
-
|
|
37761
|
-
|
|
37762
|
-
|
|
37763
|
-
);
|
|
37764
|
-
const endScreen = hasFinished && /* @__PURE__ */ jsx(
|
|
37765
|
-
Splashscreen,
|
|
37766
|
-
{
|
|
37767
|
-
icon: "check",
|
|
37768
|
-
title: i18n.get("serviceAgreementSignedAndDated"),
|
|
37769
|
-
onClick: handleCloseClick
|
|
37770
|
-
}
|
|
37771
|
-
);
|
|
37772
|
-
return /* @__PURE__ */ jsx(
|
|
37773
|
-
DropinLayout,
|
|
37774
|
-
{
|
|
37775
|
-
showAsModal: asModal,
|
|
37776
|
-
onClose: handleCloseClick,
|
|
37777
|
-
content: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37778
|
-
!asEmbedded && sidebar,
|
|
37779
|
-
endScreen || content
|
|
37780
|
-
] }),
|
|
37781
|
-
footer: asEmbedded ? footer : void 0
|
|
37782
|
-
}
|
|
37783
|
-
);
|
|
37845
|
+
/* @__PURE__ */ jsx("div", { style: { flex: "1" } }),
|
|
37846
|
+
!asModal && /* @__PURE__ */ jsx(
|
|
37847
|
+
Button,
|
|
37848
|
+
{
|
|
37849
|
+
label: i18n.get("back"),
|
|
37850
|
+
onClick: () => gotoForm(activeFormIndex - 1),
|
|
37851
|
+
secondary: true
|
|
37852
|
+
}
|
|
37853
|
+
),
|
|
37854
|
+
/* @__PURE__ */ jsx(
|
|
37855
|
+
Button,
|
|
37856
|
+
{
|
|
37857
|
+
secondary: !canSign,
|
|
37858
|
+
label: i18n.get(canSign ? "signAndContinue" : "next"),
|
|
37859
|
+
onClick: handleClick
|
|
37860
|
+
}
|
|
37861
|
+
)
|
|
37862
|
+
] })
|
|
37863
|
+
] }) });
|
|
37784
37864
|
}
|
|
37785
37865
|
const parseConfiguration$2 = ({ matchingScenario, country }) => parseSolePropScenarios(matchingScenario[LegalEntityType.SOLE_PROPRIETORSHIP], country);
|
|
37786
37866
|
const isDocumentsRequired = (forms) => forms.some(
|
|
@@ -38569,30 +38649,294 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
|
38569
38649
|
const hasOrganizationType = (_b = legalEntity.organization) == null ? void 0 : _b.type;
|
|
38570
38650
|
return hasOwnEntityAssocation || !!hasOrganizationType;
|
|
38571
38651
|
};
|
|
38572
|
-
const
|
|
38573
|
-
|
|
38652
|
+
const validateLegalEntityIdentifier = (legalEntityIdentifier) => {
|
|
38653
|
+
if (!legalEntityIdentifier) {
|
|
38654
|
+
return true;
|
|
38655
|
+
}
|
|
38656
|
+
const isValidLength = legalEntityIdentifier ? legalEntityIdentifier.length === 20 : false;
|
|
38657
|
+
const hasLettersAndNumbers = legalEntityIdentifier ? /[a-zA-Z]/.test(legalEntityIdentifier) && /[0-9]/.test(legalEntityIdentifier) : false;
|
|
38658
|
+
return isValidLength && hasLettersAndNumbers;
|
|
38659
|
+
};
|
|
38660
|
+
const validateDateNotInTheFuture = (selectedDate) => {
|
|
38661
|
+
if (!selectedDate) return true;
|
|
38662
|
+
return new Date(selectedDate) <= /* @__PURE__ */ new Date();
|
|
38663
|
+
};
|
|
38664
|
+
const highExposureCompanyDetailsValidations = {
|
|
38665
|
+
legalForm: {
|
|
38574
38666
|
modes: ["blur"],
|
|
38575
|
-
validate: (
|
|
38667
|
+
validate: (legalName) => !isEmpty$1(legalName),
|
|
38576
38668
|
errorMessage: "fieldIsRequired"
|
|
38577
|
-
}
|
|
38669
|
+
},
|
|
38670
|
+
numberOfEmployees: [
|
|
38671
|
+
{
|
|
38672
|
+
modes: ["blur"],
|
|
38673
|
+
validate: (numberOfEmployees) => !isEmpty$1(numberOfEmployees),
|
|
38674
|
+
errorMessage: "fieldIsRequired"
|
|
38675
|
+
},
|
|
38676
|
+
{
|
|
38677
|
+
modes: ["blur"],
|
|
38678
|
+
validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
|
|
38679
|
+
errorMessage: "pleaseEnterAValidWholeNumber"
|
|
38680
|
+
}
|
|
38681
|
+
],
|
|
38682
|
+
legalInformationInsolvency: {
|
|
38683
|
+
modes: ["blur"],
|
|
38684
|
+
validate: (legalInformationInsolvency) => !isEmpty$1(legalInformationInsolvency),
|
|
38685
|
+
errorMessage: "fieldIsRequired"
|
|
38686
|
+
},
|
|
38687
|
+
netAssets: [
|
|
38688
|
+
{
|
|
38689
|
+
modes: ["blur"],
|
|
38690
|
+
validate: (value) => !isEmpty$1(value),
|
|
38691
|
+
errorMessage: "fieldIsRequired"
|
|
38692
|
+
},
|
|
38693
|
+
{
|
|
38694
|
+
modes: ["blur"],
|
|
38695
|
+
validate: (value) => !Number.isNaN(Number(value)),
|
|
38696
|
+
errorMessage: "pleaseEnterAValidNumber"
|
|
38697
|
+
}
|
|
38698
|
+
],
|
|
38699
|
+
currency: {
|
|
38700
|
+
modes: ["input"],
|
|
38701
|
+
validate: (value) => !isEmpty$1(value),
|
|
38702
|
+
errorMessage: "fieldIsRequired"
|
|
38703
|
+
},
|
|
38704
|
+
annualTurnover: [
|
|
38705
|
+
{
|
|
38706
|
+
modes: ["blur"],
|
|
38707
|
+
validate: (value) => !isEmpty$1(value),
|
|
38708
|
+
errorMessage: "fieldIsRequired"
|
|
38709
|
+
},
|
|
38710
|
+
{
|
|
38711
|
+
modes: ["blur"],
|
|
38712
|
+
validate: (value) => !Number.isNaN(Number(value)),
|
|
38713
|
+
errorMessage: "pleaseEnterAValidNumber"
|
|
38714
|
+
}
|
|
38715
|
+
],
|
|
38716
|
+
financialReportingDate: [
|
|
38717
|
+
{
|
|
38718
|
+
modes: ["blur"],
|
|
38719
|
+
validate: (value) => !isEmpty$1(value),
|
|
38720
|
+
errorMessage: "fieldIsRequired"
|
|
38721
|
+
},
|
|
38722
|
+
{
|
|
38723
|
+
modes: ["blur"],
|
|
38724
|
+
validate: (value) => validateDateNotInTheFuture(value),
|
|
38725
|
+
errorMessage: "dateCannotBeInTheFuture"
|
|
38726
|
+
}
|
|
38727
|
+
],
|
|
38728
|
+
naceCode: {
|
|
38729
|
+
modes: ["blur"],
|
|
38730
|
+
validate: (naceCode) => !isEmpty$1(naceCode),
|
|
38731
|
+
errorMessage: "fieldIsRequired"
|
|
38732
|
+
},
|
|
38733
|
+
doesYourCompanyHaveLEI: {
|
|
38734
|
+
modes: ["blur"],
|
|
38735
|
+
validate: (doesYourCompanyHaveLEI) => !isEmpty$1(doesYourCompanyHaveLEI),
|
|
38736
|
+
errorMessage: "fieldIsRequired"
|
|
38737
|
+
},
|
|
38738
|
+
legalEntityIdentifier: [
|
|
38739
|
+
{
|
|
38740
|
+
modes: ["blur"],
|
|
38741
|
+
validate: (legalEntityIdentifier) => !isEmpty$1(legalEntityIdentifier),
|
|
38742
|
+
errorMessage: "fieldIsRequired"
|
|
38743
|
+
},
|
|
38744
|
+
{
|
|
38745
|
+
modes: ["blur"],
|
|
38746
|
+
validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
|
|
38747
|
+
errorMessage: "invalidFormat"
|
|
38748
|
+
}
|
|
38749
|
+
],
|
|
38750
|
+
isCompanyOwnedByAnotherCompany: {
|
|
38751
|
+
modes: ["blur"],
|
|
38752
|
+
validate: (isCompanyOwnedByAnotherCompany) => !isEmpty$1(isCompanyOwnedByAnotherCompany),
|
|
38753
|
+
errorMessage: "fieldIsRequired"
|
|
38754
|
+
},
|
|
38755
|
+
isParentOwnedByAnotherCompany: {
|
|
38756
|
+
modes: ["blur"],
|
|
38757
|
+
validate: (isParentOwnedByAnotherCompany) => !isEmpty$1(isParentOwnedByAnotherCompany),
|
|
38758
|
+
errorMessage: "fieldIsRequired"
|
|
38759
|
+
},
|
|
38760
|
+
legalProceedingsDate: [
|
|
38761
|
+
{
|
|
38762
|
+
modes: ["blur"],
|
|
38763
|
+
validate: (legalProceedingsDate) => !isEmpty$1(legalProceedingsDate),
|
|
38764
|
+
errorMessage: "fieldIsRequired"
|
|
38765
|
+
},
|
|
38766
|
+
{
|
|
38767
|
+
modes: ["blur"],
|
|
38768
|
+
validate: (value) => validateDateNotInTheFuture(value),
|
|
38769
|
+
errorMessage: "dateCannotBeInTheFuture"
|
|
38770
|
+
}
|
|
38771
|
+
]
|
|
38578
38772
|
};
|
|
38579
|
-
const
|
|
38773
|
+
const highExposureParentCompaniesDetailsValidations = {
|
|
38774
|
+
legalForm: {
|
|
38775
|
+
modes: ["blur"],
|
|
38776
|
+
validate: (legalName) => !isEmpty$1(legalName),
|
|
38777
|
+
errorMessage: "fieldIsRequired"
|
|
38778
|
+
},
|
|
38779
|
+
legalName: {
|
|
38780
|
+
modes: ["blur"],
|
|
38781
|
+
validate: (legalName) => !isEmpty$1(legalName),
|
|
38782
|
+
errorMessage: "fieldIsRequired"
|
|
38783
|
+
},
|
|
38784
|
+
numberOfEmployees: [
|
|
38785
|
+
{
|
|
38786
|
+
modes: ["blur"],
|
|
38787
|
+
validate: (numberOfEmployees) => !isEmpty$1(numberOfEmployees),
|
|
38788
|
+
errorMessage: "fieldIsRequired"
|
|
38789
|
+
},
|
|
38790
|
+
{
|
|
38791
|
+
modes: ["blur"],
|
|
38792
|
+
validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
|
|
38793
|
+
errorMessage: "pleaseEnterAValidWholeNumber"
|
|
38794
|
+
}
|
|
38795
|
+
],
|
|
38796
|
+
naceCode: {
|
|
38797
|
+
modes: ["blur"],
|
|
38798
|
+
validate: (naceCode) => !isEmpty$1(naceCode),
|
|
38799
|
+
errorMessage: "fieldIsRequired"
|
|
38800
|
+
},
|
|
38801
|
+
doesYourCompanyHaveLEI: {
|
|
38802
|
+
modes: ["blur"],
|
|
38803
|
+
validate: (doesYourCompanyHaveLEI) => !isEmpty$1(doesYourCompanyHaveLEI),
|
|
38804
|
+
errorMessage: "fieldIsRequired"
|
|
38805
|
+
},
|
|
38806
|
+
legalEntityIdentifier: [
|
|
38807
|
+
{
|
|
38808
|
+
modes: ["blur"],
|
|
38809
|
+
validate: (legalEntityIdentifier) => !isEmpty$1(legalEntityIdentifier),
|
|
38810
|
+
errorMessage: "fieldIsRequired"
|
|
38811
|
+
},
|
|
38812
|
+
{
|
|
38813
|
+
modes: ["blur"],
|
|
38814
|
+
validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
|
|
38815
|
+
errorMessage: "invalidFormat"
|
|
38816
|
+
}
|
|
38817
|
+
],
|
|
38818
|
+
isThisAddressTheMainHeadquarters: {
|
|
38819
|
+
modes: ["blur"],
|
|
38820
|
+
validate: (isThisAddressTheMainHeadquarters) => !isEmpty$1(isThisAddressTheMainHeadquarters),
|
|
38821
|
+
errorMessage: "fieldIsRequired"
|
|
38822
|
+
},
|
|
38823
|
+
legalInformationInsolvency: {
|
|
38824
|
+
modes: ["blur"],
|
|
38825
|
+
validate: (value) => !isEmpty$1(value),
|
|
38826
|
+
errorMessage: "fieldIsRequired"
|
|
38827
|
+
},
|
|
38828
|
+
netAssets: [
|
|
38829
|
+
{
|
|
38830
|
+
modes: ["blur"],
|
|
38831
|
+
validate: (value) => !isEmpty$1(value),
|
|
38832
|
+
errorMessage: "fieldIsRequired"
|
|
38833
|
+
},
|
|
38834
|
+
{
|
|
38835
|
+
modes: ["blur"],
|
|
38836
|
+
validate: (value) => !Number.isNaN(Number(value)),
|
|
38837
|
+
errorMessage: "pleaseEnterAValidNumber"
|
|
38838
|
+
}
|
|
38839
|
+
],
|
|
38840
|
+
currency: {
|
|
38841
|
+
modes: ["input"],
|
|
38842
|
+
validate: (value) => !isEmpty$1(value),
|
|
38843
|
+
errorMessage: "fieldIsRequired"
|
|
38844
|
+
},
|
|
38580
38845
|
annualTurnover: [
|
|
38581
38846
|
{
|
|
38582
38847
|
modes: ["blur"],
|
|
38583
|
-
validate: (
|
|
38848
|
+
validate: (value) => !isEmpty$1(value),
|
|
38584
38849
|
errorMessage: "fieldIsRequired"
|
|
38585
38850
|
},
|
|
38586
38851
|
{
|
|
38587
38852
|
modes: ["blur"],
|
|
38588
|
-
validate: (
|
|
38853
|
+
validate: (value) => !Number.isNaN(Number(value)),
|
|
38589
38854
|
errorMessage: "pleaseEnterAValidNumber"
|
|
38590
38855
|
}
|
|
38591
38856
|
],
|
|
38857
|
+
financialReportingDate: [
|
|
38858
|
+
{
|
|
38859
|
+
modes: ["blur"],
|
|
38860
|
+
validate: (value) => !isEmpty$1(value),
|
|
38861
|
+
errorMessage: "fieldIsRequired"
|
|
38862
|
+
},
|
|
38863
|
+
{
|
|
38864
|
+
modes: ["blur"],
|
|
38865
|
+
validate: (value) => validateDateNotInTheFuture(value),
|
|
38866
|
+
errorMessage: "dateCannotBeInTheFuture"
|
|
38867
|
+
}
|
|
38868
|
+
],
|
|
38869
|
+
legalProceedingsDate: [
|
|
38870
|
+
{
|
|
38871
|
+
modes: ["blur"],
|
|
38872
|
+
validate: (legalProceedingsDate) => !isEmpty$1(legalProceedingsDate),
|
|
38873
|
+
errorMessage: "fieldIsRequired"
|
|
38874
|
+
},
|
|
38875
|
+
{
|
|
38876
|
+
modes: ["blur"],
|
|
38877
|
+
validate: (legalProceedingsDate) => validateDateNotInTheFuture(legalProceedingsDate),
|
|
38878
|
+
errorMessage: "dateCannotBeInTheFuture"
|
|
38879
|
+
}
|
|
38880
|
+
]
|
|
38881
|
+
};
|
|
38882
|
+
const sourceOfFundsTypeValidations = {
|
|
38883
|
+
type: {
|
|
38884
|
+
modes: ["blur"],
|
|
38885
|
+
validate: (type) => !isEmpty$1(type),
|
|
38886
|
+
errorMessage: "fieldIsRequired"
|
|
38887
|
+
}
|
|
38888
|
+
};
|
|
38889
|
+
const sourceOfFundsAdditionalDataValidations = {
|
|
38592
38890
|
description: {
|
|
38593
38891
|
modes: ["blur"],
|
|
38594
38892
|
validate: (description2) => !isEmpty$1(description2),
|
|
38595
38893
|
errorMessage: "fieldIsRequired"
|
|
38894
|
+
},
|
|
38895
|
+
website: [
|
|
38896
|
+
{
|
|
38897
|
+
modes: ["blur"],
|
|
38898
|
+
validate: (website) => !isEmpty$1(website),
|
|
38899
|
+
errorMessage: "fieldIsRequired"
|
|
38900
|
+
},
|
|
38901
|
+
{
|
|
38902
|
+
modes: ["blur"],
|
|
38903
|
+
validate: (website) => website ? isURL(website) : false,
|
|
38904
|
+
errorMessage: "validationPleaseEnterAValidUrl"
|
|
38905
|
+
}
|
|
38906
|
+
],
|
|
38907
|
+
amount: [
|
|
38908
|
+
{
|
|
38909
|
+
modes: ["blur"],
|
|
38910
|
+
validate: (amount) => !isEmpty$1(amount == null ? void 0 : amount.currency),
|
|
38911
|
+
errorMessage: "currencyIsRequired"
|
|
38912
|
+
},
|
|
38913
|
+
{
|
|
38914
|
+
modes: ["blur"],
|
|
38915
|
+
validate: (amount) => !isEmpty$1(amount == null ? void 0 : amount.value),
|
|
38916
|
+
errorMessage: "amountIsRequired"
|
|
38917
|
+
},
|
|
38918
|
+
{
|
|
38919
|
+
modes: ["blur"],
|
|
38920
|
+
validate: (amount) => !Number.isNaN(Number(amount == null ? void 0 : amount.value)),
|
|
38921
|
+
errorMessage: "pleaseEnterAValidAmount"
|
|
38922
|
+
}
|
|
38923
|
+
],
|
|
38924
|
+
dateOfSourceEvent: [
|
|
38925
|
+
{
|
|
38926
|
+
modes: ["blur"],
|
|
38927
|
+
validate: (dateOfSourceEvent) => !isEmpty$1(dateOfSourceEvent),
|
|
38928
|
+
errorMessage: "fieldIsRequired"
|
|
38929
|
+
},
|
|
38930
|
+
{
|
|
38931
|
+
modes: ["blur"],
|
|
38932
|
+
validate: (dateOfSourceEvent) => validateDateNotInTheFuture(dateOfSourceEvent),
|
|
38933
|
+
errorMessage: "dateCannotBeInTheFuture"
|
|
38934
|
+
}
|
|
38935
|
+
],
|
|
38936
|
+
cryptocurrencyExchange: {
|
|
38937
|
+
modes: ["blur"],
|
|
38938
|
+
validate: (cryptocurrencyExchange) => !isEmpty$1(cryptocurrencyExchange),
|
|
38939
|
+
errorMessage: "fieldIsRequired"
|
|
38596
38940
|
}
|
|
38597
38941
|
};
|
|
38598
38942
|
const sourceOfFundsTypeFields = ["type"];
|
|
@@ -38668,142 +39012,1081 @@ function SourceOfFundsType(props) {
|
|
|
38668
39012
|
)
|
|
38669
39013
|
] });
|
|
38670
39014
|
}
|
|
38671
|
-
const
|
|
38672
|
-
"annualTurnover",
|
|
39015
|
+
const additionalDataSchemaKeys = [
|
|
38673
39016
|
"description",
|
|
38674
|
-
"
|
|
39017
|
+
"dateOfFundsReceived",
|
|
39018
|
+
"purpose",
|
|
39019
|
+
"relationship",
|
|
39020
|
+
"originatorSourceOfFundsType",
|
|
39021
|
+
"originatorLegalEntityId",
|
|
39022
|
+
"amount",
|
|
39023
|
+
"financiers",
|
|
39024
|
+
"cryptocurrencyExchange",
|
|
39025
|
+
"dateOfSourceEvent",
|
|
39026
|
+
"website"
|
|
38675
39027
|
];
|
|
38676
|
-
const allowedCurrencies = [
|
|
38677
|
-
|
|
38678
|
-
|
|
38679
|
-
|
|
38680
|
-
|
|
38681
|
-
|
|
38682
|
-
|
|
38683
|
-
|
|
39028
|
+
const allowedCurrencies = Object.entries(Currencies).map(([key]) => ({
|
|
39029
|
+
name: key,
|
|
39030
|
+
id: key
|
|
39031
|
+
}));
|
|
39032
|
+
const SOF_CHARACTERS_LIMIT = 200;
|
|
39033
|
+
const TODAY_DATE$2 = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
39034
|
+
const getAdditionalDataSchemaKeys = (sourceOfFundsType) => {
|
|
39035
|
+
switch (sourceOfFundsType) {
|
|
39036
|
+
case "business":
|
|
39037
|
+
return ["amount", "description"];
|
|
39038
|
+
case "donations":
|
|
39039
|
+
return [
|
|
39040
|
+
"dateOfFundsReceived",
|
|
39041
|
+
"purpose",
|
|
39042
|
+
"relationship",
|
|
39043
|
+
"originatorSourceOfFundsType",
|
|
39044
|
+
"originatorLegalEntityId"
|
|
39045
|
+
];
|
|
39046
|
+
case "inheritance":
|
|
39047
|
+
return [
|
|
39048
|
+
"dateOfFundsReceived",
|
|
39049
|
+
"amount",
|
|
39050
|
+
"relationship",
|
|
39051
|
+
"originatorSourceOfFundsType",
|
|
39052
|
+
"originatorLegalEntityId"
|
|
39053
|
+
];
|
|
39054
|
+
case "thirdPartyFunding":
|
|
39055
|
+
return ["amount", "financiers"];
|
|
39056
|
+
case "cryptocurrencyIncome":
|
|
39057
|
+
return ["cryptocurrencyExchange"];
|
|
39058
|
+
case "assetSale":
|
|
39059
|
+
return ["dateOfSourceEvent", "description", "amount"];
|
|
39060
|
+
case "gamblingWinnings":
|
|
39061
|
+
return ["dateOfSourceEvent", "website", "amount"];
|
|
39062
|
+
default:
|
|
39063
|
+
return [];
|
|
39064
|
+
}
|
|
39065
|
+
};
|
|
39066
|
+
const sourceOfFundsForms = {
|
|
39067
|
+
sourceOfFundsType: {
|
|
39068
|
+
formId: "sourceOfFundsType",
|
|
39069
|
+
formName: "chooseAFundingCategory",
|
|
39070
|
+
fields: ["type"]
|
|
38684
39071
|
},
|
|
38685
|
-
{
|
|
38686
|
-
|
|
38687
|
-
|
|
39072
|
+
additionalData: {
|
|
39073
|
+
formId: "additionalData",
|
|
39074
|
+
formName: "tellUsMoreAboutThisSource",
|
|
39075
|
+
fields: [...additionalDataSchemaKeys]
|
|
38688
39076
|
}
|
|
39077
|
+
};
|
|
39078
|
+
const sourceOfFundsRequiredFields = {
|
|
39079
|
+
sourceOfFundsType: sourceOfFundsForms.sourceOfFundsType.fields,
|
|
39080
|
+
additionalData: sourceOfFundsForms.additionalData.fields
|
|
39081
|
+
};
|
|
39082
|
+
const typesRequiringAdditionalData = [
|
|
39083
|
+
"business",
|
|
39084
|
+
"donations",
|
|
39085
|
+
"inheritance",
|
|
39086
|
+
"thirdPartyFunding",
|
|
39087
|
+
"cryptocurrencyIncome",
|
|
39088
|
+
"assetSale",
|
|
39089
|
+
"gamblingWinnings"
|
|
38689
39090
|
];
|
|
38690
|
-
|
|
39091
|
+
const getSourceOfFundsRequiredForms = (data) => {
|
|
39092
|
+
return Object.fromEntries(
|
|
39093
|
+
Object.entries(sourceOfFundsForms).filter(([form]) => {
|
|
39094
|
+
if (!(data == null ? void 0 : data.type) || !typesRequiringAdditionalData.includes(data == null ? void 0 : data.type))
|
|
39095
|
+
return form !== sourceOfFundsForms.additionalData.formId;
|
|
39096
|
+
return form;
|
|
39097
|
+
})
|
|
39098
|
+
);
|
|
39099
|
+
};
|
|
39100
|
+
const getInputErrors = ({
|
|
39101
|
+
formErrors,
|
|
39102
|
+
data,
|
|
39103
|
+
key,
|
|
39104
|
+
value,
|
|
39105
|
+
i18n
|
|
39106
|
+
}) => {
|
|
39107
|
+
var _a, _b, _c, _d;
|
|
39108
|
+
const isEmpty2 = value === "" || value === null || value === void 0;
|
|
39109
|
+
let errors = { ...formErrors };
|
|
39110
|
+
if (isEmpty2) {
|
|
39111
|
+
errors = { ...formErrors, [key]: i18n.get("fieldIsRequired") };
|
|
39112
|
+
} else {
|
|
39113
|
+
errors = { ...formErrors, [key]: void 0 };
|
|
39114
|
+
}
|
|
39115
|
+
if (["amount", "currency"].includes(key)) {
|
|
39116
|
+
if (((_a = data == null ? void 0 : data.amount) == null ? void 0 : _a.value) && ((_b = data == null ? void 0 : data.amount) == null ? void 0 : _b.currency)) {
|
|
39117
|
+
errors = { ...formErrors, amount: void 0 };
|
|
39118
|
+
}
|
|
39119
|
+
if (!((_c = data == null ? void 0 : data.amount) == null ? void 0 : _c.currency)) {
|
|
39120
|
+
errors = { ...formErrors, amount: i18n.get("currencyIsRequired") };
|
|
39121
|
+
}
|
|
39122
|
+
if (!((_d = data == null ? void 0 : data.amount) == null ? void 0 : _d.value)) {
|
|
39123
|
+
errors = { ...formErrors, amount: i18n.get("amountIsRequired") };
|
|
39124
|
+
} else if (isNaN(data == null ? void 0 : data.amount.value)) {
|
|
39125
|
+
errors = { ...formErrors, amount: i18n.get("pleaseEnterAValidAmount") };
|
|
39126
|
+
}
|
|
39127
|
+
}
|
|
39128
|
+
return errors;
|
|
39129
|
+
};
|
|
39130
|
+
const sourceOfFunds = "adyen-kyc-source-of-funds";
|
|
39131
|
+
const sourceOfFundsGettingStarted = "adyen-kyc-source-of-funds-getting-started";
|
|
39132
|
+
const sourceOfFundsGettingStartedIcon = "adyen-kyc-source-of-funds-getting-started-icon";
|
|
39133
|
+
const sourceOfFundsGettingStartedHeading = "adyen-kyc-source-of-funds-getting-started-heading";
|
|
39134
|
+
const sourceOfFundsGettingStartedBody = "adyen-kyc-source-of-funds-getting-started-body";
|
|
39135
|
+
const sourceOfFundsGettingStartedHelpHeader = "adyen-kyc-source-of-funds-getting-started-help-header";
|
|
39136
|
+
const sourceOfFundsGettingStartedHelpBody = "adyen-kyc-source-of-funds-getting-started-help-body";
|
|
39137
|
+
const sourceOfFundsGettingStartedCards = "adyen-kyc-source-of-funds-getting-started-cards";
|
|
39138
|
+
const sourceOfFundsGettingStartedCardsCard = "adyen-kyc-source-of-funds-getting-started-cards-card";
|
|
39139
|
+
const sourceOfFundsGettingStartedCardsCardHeader = "adyen-kyc-source-of-funds-getting-started-cards-card-header";
|
|
39140
|
+
const sourceOfFundsGettingStartedCardsCardBody = "adyen-kyc-source-of-funds-getting-started-cards-card-body";
|
|
39141
|
+
const sourceOfFundsGettingStartedCardsCardDescription = "adyen-kyc-source-of-funds-getting-started-cards-card-description";
|
|
39142
|
+
const sourceOfFundsGettingStartedActions = "adyen-kyc-source-of-funds-getting-started-actions";
|
|
39143
|
+
const sourceOfFundsGettingStartedHelpButton = "adyen-kyc-source-of-funds-getting-started-help-button";
|
|
39144
|
+
const sourceOfFundsGettingStartedPrimaryButton = "adyen-kyc-source-of-funds-getting-started-primary-button";
|
|
39145
|
+
const sourceOfFundsAdditionalDataForm = "adyen-kyc-source-of-funds-additional-data-form";
|
|
39146
|
+
const sourceOfFundsAdditonalDataMutedPlaceholder = "adyen-kyc-source-of-funds-additonal-data-muted-placeholder";
|
|
39147
|
+
const sourceOfFundsAdditonalDataSofHeadings = "adyen-kyc-source-of-funds-additonal-data-sof-headings";
|
|
39148
|
+
const sourceOfFundsAdditonalDataSofHeadingsDescription = "adyen-kyc-source-of-funds-additonal-data-sof-headings-description";
|
|
39149
|
+
const sourceOfFundsAdditonalDataSofAssetsContainer = "adyen-kyc-source-of-funds-additonal-data-sof-assets-container";
|
|
39150
|
+
const sourceOfFundsThirdPartyFundingFinancierGroup = "adyen-kyc-source-of-funds-third-party-funding-financier-group";
|
|
39151
|
+
const sourceOfFundsThirdPartyFundingNameAvatarGroup = "adyen-kyc-source-of-funds-third-party-funding-name-avatar-group";
|
|
39152
|
+
const sourceOfFundsThirdPartyFundingAvatar = "adyen-kyc-source-of-funds-third-party-funding-avatar";
|
|
39153
|
+
const sourceOfFundsThirdPartyFundingNameAddressGroup = "adyen-kyc-source-of-funds-third-party-funding-name-address-group";
|
|
39154
|
+
const sourceOfFundsSofFinancierFormNameGroup = "adyen-kyc-source-of-funds-sof-financier-form-name-group";
|
|
39155
|
+
const sourceOfFundsSofFinancierFooter = "adyen-kyc-source-of-funds-sof-financier-footer";
|
|
39156
|
+
const styles$4 = {
|
|
39157
|
+
"source-of-funds": "adyen-kyc-source-of-funds",
|
|
39158
|
+
sourceOfFunds,
|
|
39159
|
+
"source-of-funds-getting-started": "adyen-kyc-source-of-funds-getting-started",
|
|
39160
|
+
sourceOfFundsGettingStarted,
|
|
39161
|
+
"source-of-funds-getting-started-icon": "adyen-kyc-source-of-funds-getting-started-icon",
|
|
39162
|
+
sourceOfFundsGettingStartedIcon,
|
|
39163
|
+
"source-of-funds-getting-started-heading": "adyen-kyc-source-of-funds-getting-started-heading",
|
|
39164
|
+
sourceOfFundsGettingStartedHeading,
|
|
39165
|
+
"source-of-funds-getting-started-body": "adyen-kyc-source-of-funds-getting-started-body",
|
|
39166
|
+
sourceOfFundsGettingStartedBody,
|
|
39167
|
+
"source-of-funds-getting-started-help-header": "adyen-kyc-source-of-funds-getting-started-help-header",
|
|
39168
|
+
sourceOfFundsGettingStartedHelpHeader,
|
|
39169
|
+
"source-of-funds-getting-started-help-body": "adyen-kyc-source-of-funds-getting-started-help-body",
|
|
39170
|
+
sourceOfFundsGettingStartedHelpBody,
|
|
39171
|
+
"source-of-funds-getting-started-cards": "adyen-kyc-source-of-funds-getting-started-cards",
|
|
39172
|
+
sourceOfFundsGettingStartedCards,
|
|
39173
|
+
"source-of-funds-getting-started-cards-card": "adyen-kyc-source-of-funds-getting-started-cards-card",
|
|
39174
|
+
sourceOfFundsGettingStartedCardsCard,
|
|
39175
|
+
"source-of-funds-getting-started-cards-card-header": "adyen-kyc-source-of-funds-getting-started-cards-card-header",
|
|
39176
|
+
sourceOfFundsGettingStartedCardsCardHeader,
|
|
39177
|
+
"source-of-funds-getting-started-cards-card-body": "adyen-kyc-source-of-funds-getting-started-cards-card-body",
|
|
39178
|
+
sourceOfFundsGettingStartedCardsCardBody,
|
|
39179
|
+
"source-of-funds-getting-started-cards-card-description": "adyen-kyc-source-of-funds-getting-started-cards-card-description",
|
|
39180
|
+
sourceOfFundsGettingStartedCardsCardDescription,
|
|
39181
|
+
"source-of-funds-getting-started-actions": "adyen-kyc-source-of-funds-getting-started-actions",
|
|
39182
|
+
sourceOfFundsGettingStartedActions,
|
|
39183
|
+
"source-of-funds-getting-started-help-button": "adyen-kyc-source-of-funds-getting-started-help-button",
|
|
39184
|
+
sourceOfFundsGettingStartedHelpButton,
|
|
39185
|
+
"source-of-funds-getting-started-primary-button": "adyen-kyc-source-of-funds-getting-started-primary-button",
|
|
39186
|
+
sourceOfFundsGettingStartedPrimaryButton,
|
|
39187
|
+
"source-of-funds-additional-data-form": "adyen-kyc-source-of-funds-additional-data-form",
|
|
39188
|
+
sourceOfFundsAdditionalDataForm,
|
|
39189
|
+
"source-of-funds-additonal-data-muted-placeholder": "adyen-kyc-source-of-funds-additonal-data-muted-placeholder",
|
|
39190
|
+
sourceOfFundsAdditonalDataMutedPlaceholder,
|
|
39191
|
+
"source-of-funds-additonal-data-sof-headings": "adyen-kyc-source-of-funds-additonal-data-sof-headings",
|
|
39192
|
+
sourceOfFundsAdditonalDataSofHeadings,
|
|
39193
|
+
"source-of-funds-additonal-data-sof-headings-description": "adyen-kyc-source-of-funds-additonal-data-sof-headings-description",
|
|
39194
|
+
sourceOfFundsAdditonalDataSofHeadingsDescription,
|
|
39195
|
+
"source-of-funds-additonal-data-sof-assets-container": "adyen-kyc-source-of-funds-additonal-data-sof-assets-container",
|
|
39196
|
+
sourceOfFundsAdditonalDataSofAssetsContainer,
|
|
39197
|
+
"source-of-funds-third-party-funding-financier-group": "adyen-kyc-source-of-funds-third-party-funding-financier-group",
|
|
39198
|
+
sourceOfFundsThirdPartyFundingFinancierGroup,
|
|
39199
|
+
"source-of-funds-third-party-funding-name-avatar-group": "adyen-kyc-source-of-funds-third-party-funding-name-avatar-group",
|
|
39200
|
+
sourceOfFundsThirdPartyFundingNameAvatarGroup,
|
|
39201
|
+
"source-of-funds-third-party-funding-avatar": "adyen-kyc-source-of-funds-third-party-funding-avatar",
|
|
39202
|
+
sourceOfFundsThirdPartyFundingAvatar,
|
|
39203
|
+
"source-of-funds-third-party-funding-name-address-group": "adyen-kyc-source-of-funds-third-party-funding-name-address-group",
|
|
39204
|
+
sourceOfFundsThirdPartyFundingNameAddressGroup,
|
|
39205
|
+
"source-of-funds-sof-financier-form-name-group": "adyen-kyc-source-of-funds-sof-financier-form-name-group",
|
|
39206
|
+
sourceOfFundsSofFinancierFormNameGroup,
|
|
39207
|
+
"source-of-funds-sof-financier-footer": "adyen-kyc-source-of-funds-sof-financier-footer",
|
|
39208
|
+
sourceOfFundsSofFinancierFooter
|
|
39209
|
+
};
|
|
39210
|
+
const InputGroupAddon = ({ className, children }) => {
|
|
39211
|
+
const classNames = cx("adyen-kyc-input-group-addon", className);
|
|
39212
|
+
return /* @__PURE__ */ jsx("div", { className: classNames, children });
|
|
39213
|
+
};
|
|
39214
|
+
function AdditionalDataForGambling(props) {
|
|
38691
39215
|
const { i18n } = useI18nContext();
|
|
38692
|
-
const
|
|
38693
|
-
|
|
38694
|
-
|
|
38695
|
-
|
|
38696
|
-
|
|
38697
|
-
|
|
38698
|
-
|
|
38699
|
-
|
|
38700
|
-
handleChangeFor,
|
|
38701
|
-
|
|
38702
|
-
|
|
38703
|
-
valid: formValid,
|
|
38704
|
-
errors: formErrors,
|
|
38705
|
-
fieldProblems: formFieldProblems
|
|
38706
|
-
} = useForm({
|
|
38707
|
-
...props,
|
|
38708
|
-
schema: sourceOfFundsTellUsMoreFields,
|
|
38709
|
-
defaultData,
|
|
38710
|
-
rules: validators2 || sourceOfFundsTellUsMoreValidations,
|
|
38711
|
-
fieldProblems: fieldValidationErrors,
|
|
38712
|
-
shouldValidate
|
|
38713
|
-
});
|
|
38714
|
-
const formUtils = createFormUtils(props, i18n);
|
|
38715
|
-
const { updateStateSlice } = useGlobalDataSlice("tellUsMore");
|
|
38716
|
-
useEffect(() => {
|
|
38717
|
-
updateStateSlice({
|
|
38718
|
-
data: formData,
|
|
38719
|
-
valid: formValid,
|
|
38720
|
-
errors: formErrors,
|
|
38721
|
-
fieldProblems: formFieldProblems,
|
|
38722
|
-
schema: formSchema
|
|
38723
|
-
});
|
|
38724
|
-
}, [formData, formValid, formErrors, formSchema, formFieldProblems]);
|
|
38725
|
-
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc__high-exposure-company", children: [
|
|
38726
|
-
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("tellUsMoreAboutThisSource") }),
|
|
39216
|
+
const [focusedInput, setFocusedInput] = useState();
|
|
39217
|
+
const { formUtils, data, errors, valid, fieldProblems, handleChangeFor, handleAmountChange } = props;
|
|
39218
|
+
const handleOnAmountBlur = () => {
|
|
39219
|
+
setFocusedInput(void 0);
|
|
39220
|
+
handleAmountChange("amount");
|
|
39221
|
+
};
|
|
39222
|
+
const handleWebsiteBlur = () => {
|
|
39223
|
+
setFocusedInput(void 0);
|
|
39224
|
+
handleChangeFor("website", "blur");
|
|
39225
|
+
};
|
|
39226
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38727
39227
|
/* @__PURE__ */ jsx(
|
|
38728
|
-
|
|
39228
|
+
Field,
|
|
38729
39229
|
{
|
|
38730
|
-
|
|
38731
|
-
|
|
38732
|
-
formUtils,
|
|
38733
|
-
|
|
39230
|
+
name: "amount",
|
|
39231
|
+
label: formUtils.getLabel("amount", "amountWon"),
|
|
39232
|
+
errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
|
|
39233
|
+
children: (childProps) => {
|
|
39234
|
+
var _a, _b;
|
|
39235
|
+
return /* @__PURE__ */ jsxs(
|
|
39236
|
+
InputGroup,
|
|
39237
|
+
{
|
|
39238
|
+
...childProps,
|
|
39239
|
+
id: "currencyGroup",
|
|
39240
|
+
isFocused: focusedInput === "amount",
|
|
39241
|
+
isInvalid: Boolean(!valid.amount && errors.amount),
|
|
39242
|
+
children: [
|
|
39243
|
+
/* @__PURE__ */ jsx(
|
|
39244
|
+
Select,
|
|
39245
|
+
{
|
|
39246
|
+
name: "currency",
|
|
39247
|
+
isMulti: false,
|
|
39248
|
+
items: allowedCurrencies,
|
|
39249
|
+
selected: (_a = data.amount) == null ? void 0 : _a.currency,
|
|
39250
|
+
placeholder: i18n.get("select"),
|
|
39251
|
+
onChange: handleAmountChange("currency")
|
|
39252
|
+
}
|
|
39253
|
+
),
|
|
39254
|
+
/* @__PURE__ */ jsx(
|
|
39255
|
+
InputText,
|
|
39256
|
+
{
|
|
39257
|
+
...childProps,
|
|
39258
|
+
name: "amount",
|
|
39259
|
+
value: (_b = data.amount) == null ? void 0 : _b.value,
|
|
39260
|
+
readonly: formUtils.isReadOnly("amount"),
|
|
39261
|
+
onInput: handleAmountChange("amount"),
|
|
39262
|
+
onBlur: handleOnAmountBlur,
|
|
39263
|
+
"aria-required": true,
|
|
39264
|
+
"aria-label": formUtils.getLabel("amount", "amountWon"),
|
|
39265
|
+
"aria-invalid": !valid.amount,
|
|
39266
|
+
isValid: valid.amount,
|
|
39267
|
+
onFocusHandler: () => setFocusedInput("amount")
|
|
39268
|
+
}
|
|
39269
|
+
)
|
|
39270
|
+
]
|
|
39271
|
+
}
|
|
39272
|
+
);
|
|
39273
|
+
}
|
|
38734
39274
|
}
|
|
38735
39275
|
),
|
|
38736
39276
|
/* @__PURE__ */ jsx(
|
|
38737
39277
|
Field,
|
|
38738
39278
|
{
|
|
38739
|
-
name: "
|
|
38740
|
-
label: formUtils.getLabel("
|
|
38741
|
-
errorMessage: formUtils.getErrorMessage("
|
|
39279
|
+
name: "dateOfSourceEvent",
|
|
39280
|
+
label: formUtils.getLabel("dateOfSourceEvent", "dateOfSourceEvent"),
|
|
39281
|
+
errorMessage: formUtils.getErrorMessage("dateOfSourceEvent", errors, fieldProblems),
|
|
39282
|
+
isValid: valid.dateOfSourceEvent,
|
|
39283
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
39284
|
+
InputDate,
|
|
39285
|
+
{
|
|
39286
|
+
...childProps,
|
|
39287
|
+
name: "dateOfSourceEvent",
|
|
39288
|
+
value: data.dateOfSourceEvent,
|
|
39289
|
+
onInput: handleChangeFor("dateOfSourceEvent", "input"),
|
|
39290
|
+
onBlur: handleChangeFor("dateOfSourceEvent", "blur"),
|
|
39291
|
+
"aria-required": true,
|
|
39292
|
+
"aria-label": formUtils.getLabel("dateOfSourceEvent", "dateOfSourceEvent"),
|
|
39293
|
+
"aria-invalid": !valid.dateOfSourceEvent,
|
|
39294
|
+
max: TODAY_DATE$2
|
|
39295
|
+
}
|
|
39296
|
+
)
|
|
39297
|
+
}
|
|
39298
|
+
),
|
|
39299
|
+
/* @__PURE__ */ jsx(
|
|
39300
|
+
Field,
|
|
39301
|
+
{
|
|
39302
|
+
name: "website",
|
|
39303
|
+
label: formUtils.getLabel("website", "gamblingWebsite"),
|
|
39304
|
+
errorMessage: formUtils.getErrorMessage("website", errors, fieldProblems),
|
|
38742
39305
|
children: (childProps) => /* @__PURE__ */ jsxs(
|
|
38743
39306
|
InputGroup,
|
|
38744
39307
|
{
|
|
38745
39308
|
...childProps,
|
|
38746
|
-
id: "
|
|
38747
|
-
isFocused:
|
|
38748
|
-
isInvalid: Boolean(!
|
|
39309
|
+
id: "websiteGroup",
|
|
39310
|
+
isFocused: focusedInput === "website",
|
|
39311
|
+
isInvalid: Boolean(!valid.website && errors.website),
|
|
38749
39312
|
children: [
|
|
38750
|
-
/* @__PURE__ */ jsx(
|
|
38751
|
-
Select,
|
|
38752
|
-
{
|
|
38753
|
-
name: "currency",
|
|
38754
|
-
isMulti: false,
|
|
38755
|
-
items: allowedCurrencies,
|
|
38756
|
-
selected: formData.annualTurnoverCurrency,
|
|
38757
|
-
placeholder: i18n.get("select"),
|
|
38758
|
-
onChange: handleChangeFor("annualTurnoverCurrency")
|
|
38759
|
-
}
|
|
38760
|
-
),
|
|
39313
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { className: styles$4.sourceOfFundsAdditonalDataMutedPlaceholder, children: "https://" }),
|
|
38761
39314
|
/* @__PURE__ */ jsx(
|
|
38762
39315
|
InputText,
|
|
38763
39316
|
{
|
|
38764
39317
|
...childProps,
|
|
38765
|
-
name: "
|
|
38766
|
-
value:
|
|
38767
|
-
readonly:
|
|
38768
|
-
onInput: handleChangeFor("
|
|
38769
|
-
onBlur:
|
|
39318
|
+
name: "website",
|
|
39319
|
+
value: data.website,
|
|
39320
|
+
readonly: formUtils.isReadOnly("website"),
|
|
39321
|
+
onInput: handleChangeFor("website", "input"),
|
|
39322
|
+
onBlur: handleWebsiteBlur,
|
|
38770
39323
|
"aria-required": true,
|
|
38771
|
-
"aria-label": formUtils.getLabel("
|
|
38772
|
-
"aria-invalid": !
|
|
38773
|
-
isValid:
|
|
39324
|
+
"aria-label": formUtils.getLabel("website"),
|
|
39325
|
+
"aria-invalid": !valid.website,
|
|
39326
|
+
isValid: valid.website,
|
|
39327
|
+
onFocusHandler: () => setFocusedInput("website")
|
|
38774
39328
|
}
|
|
38775
39329
|
)
|
|
38776
39330
|
]
|
|
38777
39331
|
}
|
|
38778
39332
|
)
|
|
38779
39333
|
}
|
|
39334
|
+
)
|
|
39335
|
+
] });
|
|
39336
|
+
}
|
|
39337
|
+
function AdditionalDataForCryptocurrency(props) {
|
|
39338
|
+
const { formUtils, data, errors, valid, fieldProblems, handleChangeFor } = props;
|
|
39339
|
+
return /* @__PURE__ */ jsx(
|
|
39340
|
+
Field,
|
|
39341
|
+
{
|
|
39342
|
+
name: "cryptocurrencyExchange",
|
|
39343
|
+
label: formUtils.getLabel("cryptocurrencyExchange", "cryptocurrencyExchange"),
|
|
39344
|
+
errorMessage: formUtils.getErrorMessage("cryptocurrencyExchange", errors, fieldProblems),
|
|
39345
|
+
isValid: valid.cryptocurrencyExchange,
|
|
39346
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
39347
|
+
InputText,
|
|
39348
|
+
{
|
|
39349
|
+
...childProps,
|
|
39350
|
+
name: "cryptocurrencyExchange",
|
|
39351
|
+
value: data.cryptocurrencyExchange,
|
|
39352
|
+
readonly: formUtils.isReadOnly("cryptocurrencyExchange"),
|
|
39353
|
+
onInput: handleChangeFor("cryptocurrencyExchange", "input"),
|
|
39354
|
+
onBlur: handleChangeFor("cryptocurrencyExchange", "blur"),
|
|
39355
|
+
"aria-required": true,
|
|
39356
|
+
"aria-label": formUtils.getLabel("cryptocurrencyExchange"),
|
|
39357
|
+
"aria-invalid": !valid.cryptocurrencyExchange,
|
|
39358
|
+
isValid: valid.cryptocurrencyExchange
|
|
39359
|
+
}
|
|
39360
|
+
)
|
|
39361
|
+
}
|
|
39362
|
+
);
|
|
39363
|
+
}
|
|
39364
|
+
function AdditionalDataForBusiness(props) {
|
|
39365
|
+
const { i18n } = useI18nContext();
|
|
39366
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
39367
|
+
const { formUtils, data, errors, valid, fieldProblems, handleChangeFor, handleAmountChange } = props;
|
|
39368
|
+
const handleOnAmountBlur = () => {
|
|
39369
|
+
setIsFocused(false);
|
|
39370
|
+
handleAmountChange("amount");
|
|
39371
|
+
};
|
|
39372
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39373
|
+
/* @__PURE__ */ jsx(
|
|
39374
|
+
Field,
|
|
39375
|
+
{
|
|
39376
|
+
name: "amount",
|
|
39377
|
+
label: formUtils.getLabel("amount", "annualTurnoverValue"),
|
|
39378
|
+
errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
|
|
39379
|
+
children: (childProps) => {
|
|
39380
|
+
var _a, _b;
|
|
39381
|
+
return /* @__PURE__ */ jsxs(
|
|
39382
|
+
InputGroup,
|
|
39383
|
+
{
|
|
39384
|
+
...childProps,
|
|
39385
|
+
id: "currencyGroup",
|
|
39386
|
+
isFocused,
|
|
39387
|
+
isInvalid: Boolean(!valid.amount && errors.amount),
|
|
39388
|
+
children: [
|
|
39389
|
+
/* @__PURE__ */ jsx(
|
|
39390
|
+
Select,
|
|
39391
|
+
{
|
|
39392
|
+
name: "currency",
|
|
39393
|
+
isMulti: false,
|
|
39394
|
+
items: allowedCurrencies,
|
|
39395
|
+
selected: (_a = data.amount) == null ? void 0 : _a.currency,
|
|
39396
|
+
placeholder: i18n.get("select"),
|
|
39397
|
+
onChange: handleAmountChange("currency")
|
|
39398
|
+
}
|
|
39399
|
+
),
|
|
39400
|
+
/* @__PURE__ */ jsx(
|
|
39401
|
+
InputText,
|
|
39402
|
+
{
|
|
39403
|
+
...childProps,
|
|
39404
|
+
name: "amount",
|
|
39405
|
+
value: (_b = data.amount) == null ? void 0 : _b.value,
|
|
39406
|
+
readonly: formUtils.isReadOnly("amount"),
|
|
39407
|
+
onInput: handleAmountChange("amount"),
|
|
39408
|
+
onBlur: handleOnAmountBlur,
|
|
39409
|
+
"aria-required": true,
|
|
39410
|
+
"aria-label": formUtils.getLabel("amount", "annualTurnoverValue"),
|
|
39411
|
+
"aria-invalid": !valid.amount,
|
|
39412
|
+
isValid: valid.amount,
|
|
39413
|
+
onFocusHandler: () => setIsFocused(true)
|
|
39414
|
+
}
|
|
39415
|
+
)
|
|
39416
|
+
]
|
|
39417
|
+
}
|
|
39418
|
+
);
|
|
39419
|
+
}
|
|
39420
|
+
}
|
|
38780
39421
|
),
|
|
38781
39422
|
/* @__PURE__ */ jsx(
|
|
38782
39423
|
Field,
|
|
38783
39424
|
{
|
|
38784
39425
|
name: "description",
|
|
38785
|
-
label: formUtils.getLabel("description"),
|
|
38786
|
-
errorMessage: formUtils.getErrorMessage("description",
|
|
38787
|
-
isValid:
|
|
39426
|
+
label: formUtils.getLabel("description", "businessDescription"),
|
|
39427
|
+
errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
|
|
39428
|
+
isValid: valid.description,
|
|
38788
39429
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
38789
39430
|
TextArea,
|
|
38790
39431
|
{
|
|
38791
39432
|
...childProps,
|
|
38792
39433
|
name: "description",
|
|
38793
|
-
value: formData.description,
|
|
38794
39434
|
classNameModifiers: ["description"],
|
|
39435
|
+
value: data.description,
|
|
39436
|
+
maxLength: SOF_CHARACTERS_LIMIT,
|
|
38795
39437
|
onInput: handleChangeFor("description"),
|
|
38796
|
-
|
|
38797
|
-
"aria-
|
|
39438
|
+
onBlur: handleChangeFor("description"),
|
|
39439
|
+
"aria-label": formUtils.getLabel("description", "businessDescription"),
|
|
39440
|
+
"aria-invalid": !valid.description
|
|
38798
39441
|
}
|
|
38799
39442
|
)
|
|
38800
39443
|
}
|
|
38801
39444
|
)
|
|
38802
39445
|
] });
|
|
38803
39446
|
}
|
|
39447
|
+
function AdditionalDataForAssetSale(props) {
|
|
39448
|
+
const { i18n } = useI18nContext();
|
|
39449
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
39450
|
+
const { formUtils, data, errors, valid, fieldProblems, handleChangeFor, handleAmountChange } = props;
|
|
39451
|
+
const handleOnAmountBlur = () => {
|
|
39452
|
+
setIsFocused(false);
|
|
39453
|
+
handleAmountChange("amount");
|
|
39454
|
+
};
|
|
39455
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39456
|
+
/* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsAdditonalDataSofAssetsContainer, children: [
|
|
39457
|
+
/* @__PURE__ */ jsx(
|
|
39458
|
+
Field,
|
|
39459
|
+
{
|
|
39460
|
+
name: "amount",
|
|
39461
|
+
label: formUtils.getLabel("amount", "saleAmount"),
|
|
39462
|
+
errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
|
|
39463
|
+
children: (childProps) => {
|
|
39464
|
+
var _a, _b;
|
|
39465
|
+
return /* @__PURE__ */ jsxs(
|
|
39466
|
+
InputGroup,
|
|
39467
|
+
{
|
|
39468
|
+
...childProps,
|
|
39469
|
+
id: "currencyGroup",
|
|
39470
|
+
isFocused,
|
|
39471
|
+
isInvalid: Boolean(!valid.amount && errors.amount),
|
|
39472
|
+
children: [
|
|
39473
|
+
/* @__PURE__ */ jsx(
|
|
39474
|
+
Select,
|
|
39475
|
+
{
|
|
39476
|
+
name: "currency",
|
|
39477
|
+
isMulti: false,
|
|
39478
|
+
items: allowedCurrencies,
|
|
39479
|
+
selected: (_a = data.amount) == null ? void 0 : _a.currency,
|
|
39480
|
+
placeholder: i18n.get("select"),
|
|
39481
|
+
onChange: handleAmountChange("currency")
|
|
39482
|
+
}
|
|
39483
|
+
),
|
|
39484
|
+
/* @__PURE__ */ jsx(
|
|
39485
|
+
InputText,
|
|
39486
|
+
{
|
|
39487
|
+
...childProps,
|
|
39488
|
+
name: "amount",
|
|
39489
|
+
value: (_b = data.amount) == null ? void 0 : _b.value,
|
|
39490
|
+
readonly: formUtils.isReadOnly("amount"),
|
|
39491
|
+
onInput: handleAmountChange("amount"),
|
|
39492
|
+
onBlur: handleOnAmountBlur,
|
|
39493
|
+
"aria-required": true,
|
|
39494
|
+
"aria-label": formUtils.getLabel("amount", "saleAmount"),
|
|
39495
|
+
"aria-invalid": !valid.amount,
|
|
39496
|
+
isValid: valid.amount,
|
|
39497
|
+
onFocusHandler: () => setIsFocused(true)
|
|
39498
|
+
}
|
|
39499
|
+
)
|
|
39500
|
+
]
|
|
39501
|
+
}
|
|
39502
|
+
);
|
|
39503
|
+
}
|
|
39504
|
+
}
|
|
39505
|
+
),
|
|
39506
|
+
/* @__PURE__ */ jsx(
|
|
39507
|
+
Field,
|
|
39508
|
+
{
|
|
39509
|
+
name: "dateOfSourceEvent",
|
|
39510
|
+
label: formUtils.getLabel("dateOfSourceEvent", "dateOfSale"),
|
|
39511
|
+
errorMessage: formUtils.getErrorMessage("dateOfSourceEvent", errors, fieldProblems),
|
|
39512
|
+
isValid: valid.dateOfSourceEvent,
|
|
39513
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
39514
|
+
InputDate,
|
|
39515
|
+
{
|
|
39516
|
+
...childProps,
|
|
39517
|
+
name: "dateOfSourceEvent",
|
|
39518
|
+
value: data.dateOfSourceEvent,
|
|
39519
|
+
onInput: handleChangeFor("dateOfSourceEvent", "input"),
|
|
39520
|
+
onBlur: handleChangeFor("dateOfSourceEvent", "blur"),
|
|
39521
|
+
"aria-required": true,
|
|
39522
|
+
"aria-label": formUtils.getLabel("dateOfSourceEvent", "dateOfSale"),
|
|
39523
|
+
"aria-invalid": !valid.dateOfSourceEvent,
|
|
39524
|
+
max: TODAY_DATE$2
|
|
39525
|
+
}
|
|
39526
|
+
)
|
|
39527
|
+
}
|
|
39528
|
+
)
|
|
39529
|
+
] }),
|
|
39530
|
+
/* @__PURE__ */ jsx(
|
|
39531
|
+
Field,
|
|
39532
|
+
{
|
|
39533
|
+
name: "description",
|
|
39534
|
+
label: formUtils.getLabel("description", "businessDescription"),
|
|
39535
|
+
errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
|
|
39536
|
+
isValid: valid.description,
|
|
39537
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
39538
|
+
TextArea,
|
|
39539
|
+
{
|
|
39540
|
+
...childProps,
|
|
39541
|
+
name: "description",
|
|
39542
|
+
classNameModifiers: ["description"],
|
|
39543
|
+
value: data.description,
|
|
39544
|
+
maxLength: SOF_CHARACTERS_LIMIT,
|
|
39545
|
+
onInput: handleChangeFor("description"),
|
|
39546
|
+
onBlur: handleChangeFor("description"),
|
|
39547
|
+
"aria-label": formUtils.getLabel("description", "businessDescription"),
|
|
39548
|
+
"aria-invalid": !valid.description
|
|
39549
|
+
}
|
|
39550
|
+
)
|
|
39551
|
+
}
|
|
39552
|
+
)
|
|
39553
|
+
] });
|
|
39554
|
+
}
|
|
39555
|
+
const Confirm = ({ onConfirm, title, confirmBtnLabel, onClose }) => {
|
|
39556
|
+
const { i18n } = useI18nContext();
|
|
39557
|
+
const [isInFlight, setIsInFlight] = useState(false);
|
|
39558
|
+
const handleConfirm = async () => {
|
|
39559
|
+
setIsInFlight(true);
|
|
39560
|
+
try {
|
|
39561
|
+
await onConfirm();
|
|
39562
|
+
} finally {
|
|
39563
|
+
setIsInFlight(false);
|
|
39564
|
+
onClose();
|
|
39565
|
+
}
|
|
39566
|
+
};
|
|
39567
|
+
return /* @__PURE__ */ jsxs(Modal, { size: "small", onClose, children: [
|
|
39568
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(
|
|
39569
|
+
Typography,
|
|
39570
|
+
{
|
|
39571
|
+
variant: "title",
|
|
39572
|
+
el: "h3",
|
|
39573
|
+
className: "adyen-kyc-u-margin-top-8 adyen-kyc-u-margin-left-8",
|
|
39574
|
+
children: title
|
|
39575
|
+
}
|
|
39576
|
+
) }),
|
|
39577
|
+
/* @__PURE__ */ jsxs(ModalFooter, { children: [
|
|
39578
|
+
/* @__PURE__ */ jsx("div", { style: { flex: "1" } }),
|
|
39579
|
+
/* @__PURE__ */ jsx(Button, { label: i18n.get("cancel"), onClick: onClose, secondary: true }),
|
|
39580
|
+
/* @__PURE__ */ jsx(
|
|
39581
|
+
Button,
|
|
39582
|
+
{
|
|
39583
|
+
label: confirmBtnLabel || i18n.get("confirm"),
|
|
39584
|
+
onClick: handleConfirm,
|
|
39585
|
+
critical: true,
|
|
39586
|
+
disabled: isInFlight
|
|
39587
|
+
}
|
|
39588
|
+
)
|
|
39589
|
+
] })
|
|
39590
|
+
] });
|
|
39591
|
+
};
|
|
39592
|
+
const SOFFinancierModal = (props) => {
|
|
39593
|
+
const { i18n } = useI18nContext();
|
|
39594
|
+
const { financier, handleModalClose, indexNumber, handleFinancierUpdate } = props;
|
|
39595
|
+
const [formData, setFormData] = useState(financier);
|
|
39596
|
+
const [formErrors, setFormErrors] = useState({});
|
|
39597
|
+
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
39598
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
39599
|
+
const [errorMessage, setErrorMessage] = useState("");
|
|
39600
|
+
const handleInputUpdate = (key, e) => {
|
|
39601
|
+
var _a, _b;
|
|
39602
|
+
const inputEl = e.target;
|
|
39603
|
+
setErrorMessage("");
|
|
39604
|
+
const value = inputEl == null ? void 0 : inputEl.value;
|
|
39605
|
+
let inputData = {
|
|
39606
|
+
[key]: value
|
|
39607
|
+
};
|
|
39608
|
+
if (["amount", "currency"].includes(key)) {
|
|
39609
|
+
const amountValue = {
|
|
39610
|
+
currency: key === "currency" ? value : (_a = formData == null ? void 0 : formData.amount) == null ? void 0 : _a.currency,
|
|
39611
|
+
value: key === "currency" ? (_b = formData == null ? void 0 : formData.amount) == null ? void 0 : _b.value : value
|
|
39612
|
+
};
|
|
39613
|
+
inputData = { amount: amountValue };
|
|
39614
|
+
}
|
|
39615
|
+
const data = {
|
|
39616
|
+
...formData,
|
|
39617
|
+
...inputData
|
|
39618
|
+
};
|
|
39619
|
+
setFormData(data);
|
|
39620
|
+
const errors = getInputErrors({ formErrors, data, key, value, i18n });
|
|
39621
|
+
setFormErrors(errors);
|
|
39622
|
+
};
|
|
39623
|
+
const handleOnAmountBlur = () => {
|
|
39624
|
+
var _a;
|
|
39625
|
+
setIsFocused(false);
|
|
39626
|
+
const errors = getInputErrors({
|
|
39627
|
+
formErrors,
|
|
39628
|
+
data: formData,
|
|
39629
|
+
key: "amount",
|
|
39630
|
+
value: (_a = formData == null ? void 0 : formData.amount) == null ? void 0 : _a.value,
|
|
39631
|
+
i18n
|
|
39632
|
+
});
|
|
39633
|
+
setFormErrors(errors);
|
|
39634
|
+
};
|
|
39635
|
+
const allFieldsFilled = (data) => {
|
|
39636
|
+
var _a, _b;
|
|
39637
|
+
return (data == null ? void 0 : data.firstName) && (data == null ? void 0 : data.lastName) && (data == null ? void 0 : data.location) && ((_a = data == null ? void 0 : data.amount) == null ? void 0 : _a.currency) && !Number.isNaN(Number((_b = data == null ? void 0 : data.amount) == null ? void 0 : _b.value));
|
|
39638
|
+
};
|
|
39639
|
+
const handleFinancierSave = () => {
|
|
39640
|
+
if (formData && allFieldsFilled(formData)) {
|
|
39641
|
+
handleFinancierUpdate({ formData, indexNumber });
|
|
39642
|
+
handleModalClose();
|
|
39643
|
+
} else {
|
|
39644
|
+
setErrorMessage(i18n.get("pleaseFillInAllFields"));
|
|
39645
|
+
}
|
|
39646
|
+
};
|
|
39647
|
+
const handleFinancierDelete = async () => {
|
|
39648
|
+
handleFinancierUpdate({ indexNumber });
|
|
39649
|
+
handleModalClose();
|
|
39650
|
+
};
|
|
39651
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39652
|
+
/* @__PURE__ */ jsxs(Modal, { onClose: handleModalClose, children: [
|
|
39653
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(
|
|
39654
|
+
Typography,
|
|
39655
|
+
{
|
|
39656
|
+
variant: "title-l",
|
|
39657
|
+
el: "h3",
|
|
39658
|
+
className: styles$4.sourceOfFundsGettingStartedHelpHeader,
|
|
39659
|
+
children: i18n.get("investorInformation")
|
|
39660
|
+
}
|
|
39661
|
+
) }),
|
|
39662
|
+
/* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsSofFinancierForm, children: [
|
|
39663
|
+
errorMessage && /* @__PURE__ */ jsx(Alert, { title: "Error submitting data", variant: "error", children: errorMessage }),
|
|
39664
|
+
/* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsSofFinancierFormNameGroup, children: [
|
|
39665
|
+
/* @__PURE__ */ jsx(
|
|
39666
|
+
Field,
|
|
39667
|
+
{
|
|
39668
|
+
name: "firstName",
|
|
39669
|
+
label: i18n.get("firstName"),
|
|
39670
|
+
errorMessage: formErrors.firstName,
|
|
39671
|
+
isValid: !formErrors.firstName,
|
|
39672
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
39673
|
+
InputText,
|
|
39674
|
+
{
|
|
39675
|
+
...childProps,
|
|
39676
|
+
name: "firstName",
|
|
39677
|
+
value: formData == null ? void 0 : formData.firstName,
|
|
39678
|
+
onInput: (e) => handleInputUpdate("firstName", e),
|
|
39679
|
+
onBlur: (e) => handleInputUpdate("firstName", e),
|
|
39680
|
+
"aria-required": true,
|
|
39681
|
+
"aria-label": i18n.get("firstName"),
|
|
39682
|
+
"aria-invalid": Boolean(formErrors.firstName),
|
|
39683
|
+
isValid: !formErrors.firstName
|
|
39684
|
+
}
|
|
39685
|
+
)
|
|
39686
|
+
}
|
|
39687
|
+
),
|
|
39688
|
+
/* @__PURE__ */ jsx(
|
|
39689
|
+
Field,
|
|
39690
|
+
{
|
|
39691
|
+
name: "lastName",
|
|
39692
|
+
label: i18n.get("lastName"),
|
|
39693
|
+
errorMessage: formErrors.lastName,
|
|
39694
|
+
isValid: !formErrors.lastName,
|
|
39695
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
39696
|
+
InputText,
|
|
39697
|
+
{
|
|
39698
|
+
...childProps,
|
|
39699
|
+
name: "lastName",
|
|
39700
|
+
value: formData == null ? void 0 : formData.lastName,
|
|
39701
|
+
onInput: (e) => handleInputUpdate("lastName", e),
|
|
39702
|
+
onBlur: (e) => handleInputUpdate("lastName", e),
|
|
39703
|
+
"aria-required": true,
|
|
39704
|
+
"aria-label": i18n.get("lastName"),
|
|
39705
|
+
"aria-invalid": Boolean(formErrors.lastName),
|
|
39706
|
+
isValid: !formErrors.lastName
|
|
39707
|
+
}
|
|
39708
|
+
)
|
|
39709
|
+
}
|
|
39710
|
+
)
|
|
39711
|
+
] }),
|
|
39712
|
+
/* @__PURE__ */ jsx(
|
|
39713
|
+
Field,
|
|
39714
|
+
{
|
|
39715
|
+
name: "location",
|
|
39716
|
+
label: i18n.get("investorLocation"),
|
|
39717
|
+
errorMessage: formErrors.location,
|
|
39718
|
+
isValid: !formErrors.location,
|
|
39719
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
39720
|
+
InputText,
|
|
39721
|
+
{
|
|
39722
|
+
...childProps,
|
|
39723
|
+
name: "location",
|
|
39724
|
+
value: formData == null ? void 0 : formData.location,
|
|
39725
|
+
onInput: (e) => handleInputUpdate("location", e),
|
|
39726
|
+
onBlur: (e) => handleInputUpdate("location", e),
|
|
39727
|
+
"aria-required": true,
|
|
39728
|
+
"aria-label": i18n.get("investorLocation"),
|
|
39729
|
+
"aria-invalid": Boolean(formErrors.location),
|
|
39730
|
+
isValid: !formErrors.location
|
|
39731
|
+
}
|
|
39732
|
+
)
|
|
39733
|
+
}
|
|
39734
|
+
),
|
|
39735
|
+
/* @__PURE__ */ jsx(
|
|
39736
|
+
Field,
|
|
39737
|
+
{
|
|
39738
|
+
name: "amount",
|
|
39739
|
+
label: i18n.get("investmentAmount"),
|
|
39740
|
+
errorMessage: formErrors.amount,
|
|
39741
|
+
isValid: !formErrors.amount,
|
|
39742
|
+
children: (childProps) => {
|
|
39743
|
+
var _a, _b;
|
|
39744
|
+
return /* @__PURE__ */ jsxs(InputGroup, { ...childProps, id: "currencyGroup", isFocused, children: [
|
|
39745
|
+
/* @__PURE__ */ jsx(
|
|
39746
|
+
Select,
|
|
39747
|
+
{
|
|
39748
|
+
name: "currency",
|
|
39749
|
+
isMulti: false,
|
|
39750
|
+
items: allowedCurrencies,
|
|
39751
|
+
selected: (_a = formData == null ? void 0 : formData.amount) == null ? void 0 : _a.currency,
|
|
39752
|
+
placeholder: i18n.get("select"),
|
|
39753
|
+
onChange: (e) => handleInputUpdate("currency", e)
|
|
39754
|
+
}
|
|
39755
|
+
),
|
|
39756
|
+
/* @__PURE__ */ jsx(
|
|
39757
|
+
InputText,
|
|
39758
|
+
{
|
|
39759
|
+
...childProps,
|
|
39760
|
+
name: "amount",
|
|
39761
|
+
value: (_b = formData == null ? void 0 : formData.amount) == null ? void 0 : _b.value,
|
|
39762
|
+
onInput: (e) => handleInputUpdate("amount", e),
|
|
39763
|
+
onBlur: handleOnAmountBlur,
|
|
39764
|
+
"aria-required": true,
|
|
39765
|
+
"aria-label": i18n.get("investmentAmount"),
|
|
39766
|
+
onFocusHandler: () => setIsFocused(true)
|
|
39767
|
+
}
|
|
39768
|
+
)
|
|
39769
|
+
] });
|
|
39770
|
+
}
|
|
39771
|
+
}
|
|
39772
|
+
)
|
|
39773
|
+
] }) }),
|
|
39774
|
+
/* @__PURE__ */ jsx(ModalFooter, { children: /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsSofFinancierFooter, children: [
|
|
39775
|
+
Number.isFinite(indexNumber) && /* @__PURE__ */ jsx(
|
|
39776
|
+
Button,
|
|
39777
|
+
{
|
|
39778
|
+
ariaLabel: i18n.get("deleteInvestorDetails"),
|
|
39779
|
+
icon: "bin",
|
|
39780
|
+
secondary: true,
|
|
39781
|
+
large: true,
|
|
39782
|
+
onClick: () => setConfirmOpen(true)
|
|
39783
|
+
}
|
|
39784
|
+
),
|
|
39785
|
+
/* @__PURE__ */ jsx(
|
|
39786
|
+
Button,
|
|
39787
|
+
{
|
|
39788
|
+
large: true,
|
|
39789
|
+
label: i18n.get("save"),
|
|
39790
|
+
className: "adyen-kyc-button",
|
|
39791
|
+
onClick: handleFinancierSave
|
|
39792
|
+
}
|
|
39793
|
+
)
|
|
39794
|
+
] }) })
|
|
39795
|
+
] }),
|
|
39796
|
+
confirmOpen && /* @__PURE__ */ jsx(
|
|
39797
|
+
Confirm,
|
|
39798
|
+
{
|
|
39799
|
+
title: i18n.get("areYouSureYouWantToDeleteThisInvestorDetails"),
|
|
39800
|
+
confirmBtnLabel: i18n.get("delete"),
|
|
39801
|
+
onConfirm: handleFinancierDelete,
|
|
39802
|
+
onClose: () => setConfirmOpen(false)
|
|
39803
|
+
}
|
|
39804
|
+
)
|
|
39805
|
+
] });
|
|
39806
|
+
};
|
|
39807
|
+
function AdditionalDataForThirdParty(props) {
|
|
39808
|
+
var _a;
|
|
39809
|
+
const [showFinancierModal, setShowFinancierModal] = useState(false);
|
|
39810
|
+
const [activeFinancier, setActiveFinancier] = useState();
|
|
39811
|
+
const [activeIndex, setActiveIndex] = useState();
|
|
39812
|
+
const { data, handleChangeFor } = props;
|
|
39813
|
+
const { i18n } = useI18nContext();
|
|
39814
|
+
const handleToggleFinancierModal = () => {
|
|
39815
|
+
setActiveFinancier(void 0);
|
|
39816
|
+
setActiveIndex(void 0);
|
|
39817
|
+
setShowFinancierModal(!showFinancierModal);
|
|
39818
|
+
};
|
|
39819
|
+
const handleShowUpdateFinancierModal = (index) => {
|
|
39820
|
+
if (!data.financiers) {
|
|
39821
|
+
return;
|
|
39822
|
+
}
|
|
39823
|
+
const financier = data.financiers[index];
|
|
39824
|
+
setActiveFinancier(financier);
|
|
39825
|
+
setActiveIndex(index);
|
|
39826
|
+
setShowFinancierModal(true);
|
|
39827
|
+
};
|
|
39828
|
+
const handleFinancierUpdate = ({
|
|
39829
|
+
formData,
|
|
39830
|
+
indexNumber
|
|
39831
|
+
}) => {
|
|
39832
|
+
const existingFinanciers = data.financiers || [];
|
|
39833
|
+
let newFinanciers = [];
|
|
39834
|
+
if (!formData) {
|
|
39835
|
+
if (indexNumber) {
|
|
39836
|
+
newFinanciers = existingFinanciers.filter((_, index) => index !== indexNumber);
|
|
39837
|
+
}
|
|
39838
|
+
} else {
|
|
39839
|
+
newFinanciers = [...existingFinanciers, formData];
|
|
39840
|
+
if (Number.isFinite(indexNumber)) {
|
|
39841
|
+
newFinanciers = existingFinanciers.map(
|
|
39842
|
+
(existingFinancier, i) => i === indexNumber ? formData : existingFinancier
|
|
39843
|
+
);
|
|
39844
|
+
}
|
|
39845
|
+
}
|
|
39846
|
+
const financierEvent = {
|
|
39847
|
+
target: {
|
|
39848
|
+
name: "financiers",
|
|
39849
|
+
value: newFinanciers
|
|
39850
|
+
}
|
|
39851
|
+
};
|
|
39852
|
+
handleChangeFor("financiers")(financierEvent);
|
|
39853
|
+
};
|
|
39854
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39855
|
+
(_a = data.financiers) == null ? void 0 : _a.map((financier, index) => {
|
|
39856
|
+
var _a2, _b, _c;
|
|
39857
|
+
return /* @__PURE__ */ jsxs(
|
|
39858
|
+
"button",
|
|
39859
|
+
{
|
|
39860
|
+
type: "button",
|
|
39861
|
+
onClick: () => handleShowUpdateFinancierModal(index),
|
|
39862
|
+
className: styles$4.sourceOfFundsThirdPartyFundingFinancierGroup,
|
|
39863
|
+
children: [
|
|
39864
|
+
/* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsThirdPartyFundingNameAvatarGroup, children: [
|
|
39865
|
+
/* @__PURE__ */ jsx(
|
|
39866
|
+
Button,
|
|
39867
|
+
{
|
|
39868
|
+
tertiary: true,
|
|
39869
|
+
icon: "user",
|
|
39870
|
+
onClick: () => handleShowUpdateFinancierModal(index),
|
|
39871
|
+
className: styles$4.sourceOfFundsThirdPartyFundingAvatar
|
|
39872
|
+
}
|
|
39873
|
+
),
|
|
39874
|
+
/* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsThirdPartyFundingNameAddressGroup, children: [
|
|
39875
|
+
/* @__PURE__ */ jsxs(Typography, { el: "div", variant: "body-strongest", children: [
|
|
39876
|
+
financier.firstName,
|
|
39877
|
+
" ",
|
|
39878
|
+
financier.lastName
|
|
39879
|
+
] }),
|
|
39880
|
+
/* @__PURE__ */ jsx(Typography, { el: "div", variant: "caption", children: financier.location })
|
|
39881
|
+
] })
|
|
39882
|
+
] }),
|
|
39883
|
+
/* @__PURE__ */ jsx("div", { children: ((_a2 = financier.amount) == null ? void 0 : _a2.currency) && ((_b = financier.amount) == null ? void 0 : _b.value) ? formatAmountWithCurrency(financier.amount.value, (_c = financier.amount) == null ? void 0 : _c.currency) : "" })
|
|
39884
|
+
]
|
|
39885
|
+
},
|
|
39886
|
+
index
|
|
39887
|
+
);
|
|
39888
|
+
}),
|
|
39889
|
+
/* @__PURE__ */ jsx(
|
|
39890
|
+
"button",
|
|
39891
|
+
{
|
|
39892
|
+
type: "button",
|
|
39893
|
+
className: styles$4.sourceOfFundsThirdPartyFundingFinancierGroup,
|
|
39894
|
+
onClick: handleToggleFinancierModal,
|
|
39895
|
+
children: /* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsThirdPartyFundingNameAvatarGroup, children: [
|
|
39896
|
+
/* @__PURE__ */ jsx(
|
|
39897
|
+
Button,
|
|
39898
|
+
{
|
|
39899
|
+
tertiary: true,
|
|
39900
|
+
icon: "plus",
|
|
39901
|
+
onClick: handleToggleFinancierModal,
|
|
39902
|
+
className: styles$4.sourceOfFundsThirdPartyFundingAvatar
|
|
39903
|
+
}
|
|
39904
|
+
),
|
|
39905
|
+
/* @__PURE__ */ jsx(Typography, { el: "div", variant: "body-strongest", children: i18n.get("addInvestor") })
|
|
39906
|
+
] })
|
|
39907
|
+
}
|
|
39908
|
+
),
|
|
39909
|
+
showFinancierModal && /* @__PURE__ */ jsx(
|
|
39910
|
+
SOFFinancierModal,
|
|
39911
|
+
{
|
|
39912
|
+
financier: activeFinancier,
|
|
39913
|
+
indexNumber: activeIndex,
|
|
39914
|
+
handleModalClose: handleToggleFinancierModal,
|
|
39915
|
+
handleFinancierUpdate
|
|
39916
|
+
}
|
|
39917
|
+
)
|
|
39918
|
+
] });
|
|
39919
|
+
}
|
|
39920
|
+
function SourceOfFundsAdditionalData(props) {
|
|
39921
|
+
const { i18n } = useI18nContext();
|
|
39922
|
+
const {
|
|
39923
|
+
data: defaultData,
|
|
39924
|
+
validators: validators2,
|
|
39925
|
+
formVerificationErrors,
|
|
39926
|
+
fieldValidationErrors,
|
|
39927
|
+
shouldValidate,
|
|
39928
|
+
sourceOfFundsType
|
|
39929
|
+
} = props;
|
|
39930
|
+
const getFormSchema2 = useMemo(
|
|
39931
|
+
() => getAdditionalDataSchemaKeys(sourceOfFundsType),
|
|
39932
|
+
[sourceOfFundsType]
|
|
39933
|
+
);
|
|
39934
|
+
const {
|
|
39935
|
+
handleChangeFor,
|
|
39936
|
+
data: formData,
|
|
39937
|
+
schema: formSchema,
|
|
39938
|
+
valid: formValid,
|
|
39939
|
+
errors: formErrors,
|
|
39940
|
+
fieldProblems: formFieldProblems
|
|
39941
|
+
} = useForm({
|
|
39942
|
+
...props,
|
|
39943
|
+
schema: getFormSchema2,
|
|
39944
|
+
defaultData,
|
|
39945
|
+
rules: validators2 || sourceOfFundsAdditionalDataValidations,
|
|
39946
|
+
fieldProblems: fieldValidationErrors,
|
|
39947
|
+
shouldValidate
|
|
39948
|
+
});
|
|
39949
|
+
const handleAmountChange = (key) => (e) => {
|
|
39950
|
+
var _a, _b;
|
|
39951
|
+
const isCurrencyKey = key === "currency";
|
|
39952
|
+
const amountValue = {
|
|
39953
|
+
currency: isCurrencyKey ? e.target.value : (_a = formData.amount) == null ? void 0 : _a.currency,
|
|
39954
|
+
value: isCurrencyKey ? (_b = formData.amount) == null ? void 0 : _b.value : e.target.value
|
|
39955
|
+
};
|
|
39956
|
+
const fieldEvent = {
|
|
39957
|
+
target: {
|
|
39958
|
+
name: "amount",
|
|
39959
|
+
value: amountValue
|
|
39960
|
+
}
|
|
39961
|
+
};
|
|
39962
|
+
handleChangeFor("amount")(fieldEvent);
|
|
39963
|
+
};
|
|
39964
|
+
const formUtils = createFormUtils(props, i18n);
|
|
39965
|
+
const { updateStateSlice } = useGlobalDataSlice("additionalData");
|
|
39966
|
+
const getPageHeadings = useMemo(() => {
|
|
39967
|
+
let pageHeadings = {
|
|
39968
|
+
heading: "tellUsMoreAboutThisSource"
|
|
39969
|
+
};
|
|
39970
|
+
if (sourceOfFundsType === "cryptocurrencyIncome") {
|
|
39971
|
+
pageHeadings = {
|
|
39972
|
+
heading: "cryptocurrencyProceedDetails",
|
|
39973
|
+
description: "tellUsMoreAboutTheCryptocurrency"
|
|
39974
|
+
};
|
|
39975
|
+
}
|
|
39976
|
+
if (sourceOfFundsType === "business") {
|
|
39977
|
+
pageHeadings = {
|
|
39978
|
+
heading: "businessEarningDetails",
|
|
39979
|
+
description: "tellUsMoreAboutThePreviousBusinessEarnings"
|
|
39980
|
+
};
|
|
39981
|
+
}
|
|
39982
|
+
if (sourceOfFundsType === "thirdPartyFunding") {
|
|
39983
|
+
pageHeadings = {
|
|
39984
|
+
heading: "businessInvestorDetails",
|
|
39985
|
+
description: "tellUsMoreAboutTheInvestors"
|
|
39986
|
+
};
|
|
39987
|
+
}
|
|
39988
|
+
return pageHeadings;
|
|
39989
|
+
}, [sourceOfFundsType]);
|
|
39990
|
+
useEffect(() => {
|
|
39991
|
+
updateStateSlice({
|
|
39992
|
+
data: formData,
|
|
39993
|
+
valid: formValid,
|
|
39994
|
+
errors: formErrors,
|
|
39995
|
+
fieldProblems: formFieldProblems,
|
|
39996
|
+
schema: formSchema
|
|
39997
|
+
});
|
|
39998
|
+
}, [formData, formValid, formErrors, formSchema, formFieldProblems]);
|
|
39999
|
+
const renderSubForms = () => {
|
|
40000
|
+
switch (sourceOfFundsType) {
|
|
40001
|
+
case "gamblingWinnings":
|
|
40002
|
+
return /* @__PURE__ */ jsx(
|
|
40003
|
+
AdditionalDataForGambling,
|
|
40004
|
+
{
|
|
40005
|
+
formUtils,
|
|
40006
|
+
handleChangeFor,
|
|
40007
|
+
data: formData,
|
|
40008
|
+
errors: formErrors,
|
|
40009
|
+
valid: formValid,
|
|
40010
|
+
fieldProblems: formFieldProblems,
|
|
40011
|
+
handleAmountChange
|
|
40012
|
+
}
|
|
40013
|
+
);
|
|
40014
|
+
case "cryptocurrencyIncome":
|
|
40015
|
+
return /* @__PURE__ */ jsx(
|
|
40016
|
+
AdditionalDataForCryptocurrency,
|
|
40017
|
+
{
|
|
40018
|
+
formUtils,
|
|
40019
|
+
handleChangeFor,
|
|
40020
|
+
data: formData,
|
|
40021
|
+
errors: formErrors,
|
|
40022
|
+
valid: formValid,
|
|
40023
|
+
fieldProblems: formFieldProblems,
|
|
40024
|
+
handleAmountChange
|
|
40025
|
+
}
|
|
40026
|
+
);
|
|
40027
|
+
case "business":
|
|
40028
|
+
return /* @__PURE__ */ jsx(
|
|
40029
|
+
AdditionalDataForBusiness,
|
|
40030
|
+
{
|
|
40031
|
+
formUtils,
|
|
40032
|
+
handleChangeFor,
|
|
40033
|
+
data: formData,
|
|
40034
|
+
errors: formErrors,
|
|
40035
|
+
valid: formValid,
|
|
40036
|
+
fieldProblems: formFieldProblems,
|
|
40037
|
+
handleAmountChange
|
|
40038
|
+
}
|
|
40039
|
+
);
|
|
40040
|
+
case "assetSale":
|
|
40041
|
+
return /* @__PURE__ */ jsx(
|
|
40042
|
+
AdditionalDataForAssetSale,
|
|
40043
|
+
{
|
|
40044
|
+
formUtils,
|
|
40045
|
+
handleChangeFor,
|
|
40046
|
+
data: formData,
|
|
40047
|
+
errors: formErrors,
|
|
40048
|
+
valid: formValid,
|
|
40049
|
+
fieldProblems: formFieldProblems,
|
|
40050
|
+
handleAmountChange
|
|
40051
|
+
}
|
|
40052
|
+
);
|
|
40053
|
+
case "thirdPartyFunding":
|
|
40054
|
+
return /* @__PURE__ */ jsx(
|
|
40055
|
+
AdditionalDataForThirdParty,
|
|
40056
|
+
{
|
|
40057
|
+
formUtils,
|
|
40058
|
+
handleChangeFor,
|
|
40059
|
+
data: formData,
|
|
40060
|
+
errors: formErrors,
|
|
40061
|
+
valid: formValid,
|
|
40062
|
+
fieldProblems: formFieldProblems,
|
|
40063
|
+
handleAmountChange
|
|
40064
|
+
}
|
|
40065
|
+
);
|
|
40066
|
+
default:
|
|
40067
|
+
return null;
|
|
40068
|
+
}
|
|
40069
|
+
};
|
|
40070
|
+
return /* @__PURE__ */ jsxs("form", { className: styles$4.sourceOfFundsAdditionalDataForm, children: [
|
|
40071
|
+
/* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsAdditonalDataSofHeadings, children: [
|
|
40072
|
+
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get(getPageHeadings.heading) }),
|
|
40073
|
+
getPageHeadings.description && /* @__PURE__ */ jsx("div", { className: styles$4.sourceOfFundsAdditonalDataSofHeadingsDescription, children: i18n.get(getPageHeadings.description) })
|
|
40074
|
+
] }),
|
|
40075
|
+
/* @__PURE__ */ jsx(
|
|
40076
|
+
ErrorPanel,
|
|
40077
|
+
{
|
|
40078
|
+
verificationErrors: formVerificationErrors,
|
|
40079
|
+
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
40080
|
+
formUtils,
|
|
40081
|
+
id: "ariaErrorField"
|
|
40082
|
+
}
|
|
40083
|
+
),
|
|
40084
|
+
renderSubForms()
|
|
40085
|
+
] });
|
|
40086
|
+
}
|
|
38804
40087
|
function SourceOfFunds(props) {
|
|
38805
40088
|
const { i18n } = useI18nContext();
|
|
38806
|
-
const { activeForm } = props;
|
|
40089
|
+
const { activeForm, sourceOfFundsType } = props;
|
|
38807
40090
|
const formWrapperClasses = (formId) => (activeForm == null ? void 0 : activeForm.formId) !== formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper";
|
|
38808
40091
|
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-wrapper", children: [
|
|
38809
40092
|
/* @__PURE__ */ jsx("div", { className: formWrapperClasses("sourceOfFundsType"), children: /* @__PURE__ */ jsx(
|
|
@@ -38812,10 +40095,11 @@ function SourceOfFunds(props) {
|
|
|
38812
40095
|
...getFormProps(props, sourceOfFundsForms.sourceOfFundsType.formId)
|
|
38813
40096
|
}
|
|
38814
40097
|
) }),
|
|
38815
|
-
/* @__PURE__ */ jsx("div", { className: formWrapperClasses("
|
|
38816
|
-
|
|
40098
|
+
/* @__PURE__ */ jsx("div", { className: formWrapperClasses("additionalData"), children: /* @__PURE__ */ jsx(
|
|
40099
|
+
SourceOfFundsAdditionalData,
|
|
38817
40100
|
{
|
|
38818
|
-
...getFormProps(props, sourceOfFundsForms.
|
|
40101
|
+
...getFormProps(props, sourceOfFundsForms.additionalData.formId),
|
|
40102
|
+
sourceOfFundsType
|
|
38819
40103
|
}
|
|
38820
40104
|
) }),
|
|
38821
40105
|
/* @__PURE__ */ jsx("div", { className: formWrapperClasses("companySourceOfFunds"), children: /* @__PURE__ */ jsx("div", { children: i18n.get("uploadADocument") }) })
|
|
@@ -38826,7 +40110,7 @@ const descriptionSectionField = "adyen-kyc-description-section-field";
|
|
|
38826
40110
|
const adyenLayoutXsOnly = "adyen-layout-xs-only";
|
|
38827
40111
|
const descriptionSectionLabel = "adyen-kyc-description-section-label";
|
|
38828
40112
|
const descriptionSectionData = "adyen-kyc-description-section-data";
|
|
38829
|
-
const styles$
|
|
40113
|
+
const styles$3 = {
|
|
38830
40114
|
description,
|
|
38831
40115
|
"description-section-field": "adyen-kyc-description-section-field",
|
|
38832
40116
|
descriptionSectionField,
|
|
@@ -38838,59 +40122,12 @@ const styles$4 = {
|
|
|
38838
40122
|
descriptionSectionData
|
|
38839
40123
|
};
|
|
38840
40124
|
const Description = ({ className, list }) => {
|
|
38841
|
-
const descriptionClassNames = cx(styles$
|
|
38842
|
-
return /* @__PURE__ */ jsx("dl", { className: descriptionClassNames, children: list.map(({ term, details }, index) => /* @__PURE__ */ jsxs("div", { className: styles$
|
|
38843
|
-
/* @__PURE__ */ jsx("dt", { className: styles$
|
|
38844
|
-
/* @__PURE__ */ jsx("dd", { className: styles$
|
|
40125
|
+
const descriptionClassNames = cx(styles$3.description, className);
|
|
40126
|
+
return /* @__PURE__ */ jsx("dl", { className: descriptionClassNames, children: list.map(({ term, details }, index) => /* @__PURE__ */ jsxs("div", { className: styles$3.descriptionSectionField, children: [
|
|
40127
|
+
/* @__PURE__ */ jsx("dt", { className: styles$3.descriptionSectionLabel, children: term }),
|
|
40128
|
+
/* @__PURE__ */ jsx("dd", { className: styles$3.descriptionSectionData, children: details })
|
|
38845
40129
|
] }, index)) });
|
|
38846
40130
|
};
|
|
38847
|
-
const sourceOfFunds = "adyen-kyc-source-of-funds";
|
|
38848
|
-
const sourceOfFundsGettingStarted = "adyen-kyc-source-of-funds-getting-started";
|
|
38849
|
-
const sourceOfFundsGettingStartedIcon = "adyen-kyc-source-of-funds-getting-started-icon";
|
|
38850
|
-
const sourceOfFundsGettingStartedHeading = "adyen-kyc-source-of-funds-getting-started-heading";
|
|
38851
|
-
const sourceOfFundsGettingStartedBody = "adyen-kyc-source-of-funds-getting-started-body";
|
|
38852
|
-
const sourceOfFundsGettingStartedHelpHeader = "adyen-kyc-source-of-funds-getting-started-help-header";
|
|
38853
|
-
const sourceOfFundsGettingStartedHelpBody = "adyen-kyc-source-of-funds-getting-started-help-body";
|
|
38854
|
-
const sourceOfFundsGettingStartedCards = "adyen-kyc-source-of-funds-getting-started-cards";
|
|
38855
|
-
const sourceOfFundsGettingStartedCardsCard = "adyen-kyc-source-of-funds-getting-started-cards-card";
|
|
38856
|
-
const sourceOfFundsGettingStartedCardsCardHeader = "adyen-kyc-source-of-funds-getting-started-cards-card-header";
|
|
38857
|
-
const sourceOfFundsGettingStartedCardsCardBody = "adyen-kyc-source-of-funds-getting-started-cards-card-body";
|
|
38858
|
-
const sourceOfFundsGettingStartedCardsCardDescription = "adyen-kyc-source-of-funds-getting-started-cards-card-description";
|
|
38859
|
-
const sourceOfFundsGettingStartedActions = "adyen-kyc-source-of-funds-getting-started-actions";
|
|
38860
|
-
const sourceOfFundsGettingStartedHelpButton = "adyen-kyc-source-of-funds-getting-started-help-button";
|
|
38861
|
-
const sourceOfFundsGettingStartedPrimaryButton = "adyen-kyc-source-of-funds-getting-started-primary-button";
|
|
38862
|
-
const styles$3 = {
|
|
38863
|
-
"source-of-funds": "adyen-kyc-source-of-funds",
|
|
38864
|
-
sourceOfFunds,
|
|
38865
|
-
"source-of-funds-getting-started": "adyen-kyc-source-of-funds-getting-started",
|
|
38866
|
-
sourceOfFundsGettingStarted,
|
|
38867
|
-
"source-of-funds-getting-started-icon": "adyen-kyc-source-of-funds-getting-started-icon",
|
|
38868
|
-
sourceOfFundsGettingStartedIcon,
|
|
38869
|
-
"source-of-funds-getting-started-heading": "adyen-kyc-source-of-funds-getting-started-heading",
|
|
38870
|
-
sourceOfFundsGettingStartedHeading,
|
|
38871
|
-
"source-of-funds-getting-started-body": "adyen-kyc-source-of-funds-getting-started-body",
|
|
38872
|
-
sourceOfFundsGettingStartedBody,
|
|
38873
|
-
"source-of-funds-getting-started-help-header": "adyen-kyc-source-of-funds-getting-started-help-header",
|
|
38874
|
-
sourceOfFundsGettingStartedHelpHeader,
|
|
38875
|
-
"source-of-funds-getting-started-help-body": "adyen-kyc-source-of-funds-getting-started-help-body",
|
|
38876
|
-
sourceOfFundsGettingStartedHelpBody,
|
|
38877
|
-
"source-of-funds-getting-started-cards": "adyen-kyc-source-of-funds-getting-started-cards",
|
|
38878
|
-
sourceOfFundsGettingStartedCards,
|
|
38879
|
-
"source-of-funds-getting-started-cards-card": "adyen-kyc-source-of-funds-getting-started-cards-card",
|
|
38880
|
-
sourceOfFundsGettingStartedCardsCard,
|
|
38881
|
-
"source-of-funds-getting-started-cards-card-header": "adyen-kyc-source-of-funds-getting-started-cards-card-header",
|
|
38882
|
-
sourceOfFundsGettingStartedCardsCardHeader,
|
|
38883
|
-
"source-of-funds-getting-started-cards-card-body": "adyen-kyc-source-of-funds-getting-started-cards-card-body",
|
|
38884
|
-
sourceOfFundsGettingStartedCardsCardBody,
|
|
38885
|
-
"source-of-funds-getting-started-cards-card-description": "adyen-kyc-source-of-funds-getting-started-cards-card-description",
|
|
38886
|
-
sourceOfFundsGettingStartedCardsCardDescription,
|
|
38887
|
-
"source-of-funds-getting-started-actions": "adyen-kyc-source-of-funds-getting-started-actions",
|
|
38888
|
-
sourceOfFundsGettingStartedActions,
|
|
38889
|
-
"source-of-funds-getting-started-help-button": "adyen-kyc-source-of-funds-getting-started-help-button",
|
|
38890
|
-
sourceOfFundsGettingStartedHelpButton,
|
|
38891
|
-
"source-of-funds-getting-started-primary-button": "adyen-kyc-source-of-funds-getting-started-primary-button",
|
|
38892
|
-
sourceOfFundsGettingStartedPrimaryButton
|
|
38893
|
-
};
|
|
38894
40131
|
const SourceOfFundsGettingStarted = ({
|
|
38895
40132
|
handleGettingStartedClick,
|
|
38896
40133
|
handleCancelClick,
|
|
@@ -38922,9 +40159,9 @@ const SourceOfFundsGettingStarted = ({
|
|
|
38922
40159
|
return /* @__PURE__ */ jsx(
|
|
38923
40160
|
Card,
|
|
38924
40161
|
{
|
|
38925
|
-
className: styles$
|
|
38926
|
-
headerClassName: styles$
|
|
38927
|
-
bodyClassName: styles$
|
|
40162
|
+
className: styles$4.sourceOfFundsGettingStartedCardsCard,
|
|
40163
|
+
headerClassName: styles$4.sourceOfFundsGettingStartedCardsCardHeader,
|
|
40164
|
+
bodyClassName: styles$4.sourceOfFundsGettingStartedCardsCardBody,
|
|
38928
40165
|
title: line == null ? void 0 : line.service,
|
|
38929
40166
|
stateful: true,
|
|
38930
40167
|
onClick: () => handleSourceOfFundsClick(SoF),
|
|
@@ -38940,7 +40177,7 @@ const SourceOfFundsGettingStarted = ({
|
|
|
38940
40177
|
children: editOrStart && /* @__PURE__ */ jsx(
|
|
38941
40178
|
Description,
|
|
38942
40179
|
{
|
|
38943
|
-
className: styles$
|
|
40180
|
+
className: styles$4.sourceOfFundsGettingStartedCardsCardDescription,
|
|
38944
40181
|
list: mappedSourceOfFunds
|
|
38945
40182
|
}
|
|
38946
40183
|
)
|
|
@@ -38953,7 +40190,7 @@ const SourceOfFundsGettingStarted = ({
|
|
|
38953
40190
|
return /* @__PURE__ */ jsxs(
|
|
38954
40191
|
"div",
|
|
38955
40192
|
{
|
|
38956
|
-
className: styles$
|
|
40193
|
+
className: styles$4.sourceOfFundsGettingStarted,
|
|
38957
40194
|
"data-testid": "source-of-funds-getting-started",
|
|
38958
40195
|
children: [
|
|
38959
40196
|
!hasSourceOfFunds && /* @__PURE__ */ jsx(
|
|
@@ -38962,13 +40199,13 @@ const SourceOfFundsGettingStarted = ({
|
|
|
38962
40199
|
type: "image",
|
|
38963
40200
|
testId: "source-of-funds-getting-started-icon",
|
|
38964
40201
|
name: "source-of-funds",
|
|
38965
|
-
className: styles$
|
|
40202
|
+
className: styles$4.sourceOfFundsGettingStartedIcon
|
|
38966
40203
|
}
|
|
38967
40204
|
),
|
|
38968
|
-
/* @__PURE__ */ jsx(Typography, { className: styles$
|
|
38969
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
40205
|
+
/* @__PURE__ */ jsx(Typography, { className: styles$4.sourceOfFundsGettingStartedHeading, el: "h2", variant: "title-l", children: i18n.get("gettingStartedHeading") }),
|
|
40206
|
+
/* @__PURE__ */ jsx("div", { className: styles$4.sourceOfFundsGettingStartedBody, children: /* @__PURE__ */ jsx(Typography, { children: i18n.get("gettingStartedBody") }) }),
|
|
38970
40207
|
hasSourceOfFunds && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38971
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
40208
|
+
/* @__PURE__ */ jsx("div", { className: styles$4.sourceOfFundsGettingStartedCards, children: mapBusinessLines(businessLines) }),
|
|
38972
40209
|
handleCancelClick && /* @__PURE__ */ jsx(
|
|
38973
40210
|
Button,
|
|
38974
40211
|
{
|
|
@@ -38976,7 +40213,7 @@ const SourceOfFundsGettingStarted = ({
|
|
|
38976
40213
|
block: true,
|
|
38977
40214
|
large: true,
|
|
38978
40215
|
testId: "source-of-funds-getting-return-button",
|
|
38979
|
-
className: styles$
|
|
40216
|
+
className: styles$4.sourceOfFundsGettingStartedCancelButton,
|
|
38980
40217
|
onClick: handleCancelClick,
|
|
38981
40218
|
label: i18n.get("returnToTaskList")
|
|
38982
40219
|
}
|
|
@@ -38988,18 +40225,18 @@ const SourceOfFundsGettingStarted = ({
|
|
|
38988
40225
|
{
|
|
38989
40226
|
tertiary: true,
|
|
38990
40227
|
block: true,
|
|
38991
|
-
className: styles$
|
|
40228
|
+
className: styles$4.sourceOfFundsGettingStartedHelpButton,
|
|
38992
40229
|
onClick: handleHelpClick,
|
|
38993
40230
|
testId: "source-of-funds-getting-help-button",
|
|
38994
40231
|
label: i18n.get("gettingStartedHelp")
|
|
38995
40232
|
}
|
|
38996
40233
|
),
|
|
38997
|
-
/* @__PURE__ */ jsxs("div", { className: styles$
|
|
40234
|
+
/* @__PURE__ */ jsxs("div", { className: styles$4.sourceOfFundsGettingStartedActions, children: [
|
|
38998
40235
|
/* @__PURE__ */ jsx(
|
|
38999
40236
|
Button,
|
|
39000
40237
|
{
|
|
39001
40238
|
large: true,
|
|
39002
|
-
className: styles$
|
|
40239
|
+
className: styles$4.sourceOfFundsGettingStartedPrimaryButton,
|
|
39003
40240
|
label: i18n.get("gettingStarted"),
|
|
39004
40241
|
block: true,
|
|
39005
40242
|
testId: "source-of-funds-getting-primary-button",
|
|
@@ -39031,36 +40268,14 @@ const SourceOfFundsHelpModal = ({ handleModalClose }) => {
|
|
|
39031
40268
|
{
|
|
39032
40269
|
variant: "title-l",
|
|
39033
40270
|
el: "h3",
|
|
39034
|
-
className: styles$
|
|
40271
|
+
className: styles$4.sourceOfFundsGettingStartedHelpHeader,
|
|
39035
40272
|
children: i18n.get("gettingStartedHelpModalTitle")
|
|
39036
40273
|
}
|
|
39037
40274
|
) }),
|
|
39038
|
-
/* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsx(Typography, { className: styles$
|
|
40275
|
+
/* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsx(Typography, { className: styles$4.sourceOfFundsGettingStartedHelpBody, children: i18n.get("gettingStartedHelpModalDescription") }) })
|
|
39039
40276
|
] });
|
|
39040
40277
|
};
|
|
39041
40278
|
const logger$n = createLogger("SourceOfFundsDropin");
|
|
39042
|
-
const sourceOfFundsForms = {
|
|
39043
|
-
sourceOfFundsType: {
|
|
39044
|
-
formId: "sourceOfFundsType",
|
|
39045
|
-
formName: "chooseAFundingCategory",
|
|
39046
|
-
fields: ["type"]
|
|
39047
|
-
},
|
|
39048
|
-
tellUsMore: {
|
|
39049
|
-
formId: "tellUsMore",
|
|
39050
|
-
formName: "tellUsMoreAboutThisSource",
|
|
39051
|
-
fields: ["annualTurnover", "description", "annualTurnoverCurrency"]
|
|
39052
|
-
},
|
|
39053
|
-
companySourceOfFunds: {
|
|
39054
|
-
formId: "companySourceOfFunds",
|
|
39055
|
-
formName: "uploadADocument",
|
|
39056
|
-
fields: ["sourceOfFundsDocument"]
|
|
39057
|
-
}
|
|
39058
|
-
};
|
|
39059
|
-
const sourceOfFundsRequiredFields = {
|
|
39060
|
-
sourceOfFundsType: sourceOfFundsForms.sourceOfFundsType.fields,
|
|
39061
|
-
tellUsMore: sourceOfFundsForms.tellUsMore.fields,
|
|
39062
|
-
companySourceOfFunds: sourceOfFundsForms.companySourceOfFunds.fields
|
|
39063
|
-
};
|
|
39064
40279
|
function SourceOfFundsDropin({
|
|
39065
40280
|
legalEntityResponse,
|
|
39066
40281
|
country,
|
|
@@ -39068,7 +40283,7 @@ function SourceOfFundsDropin({
|
|
|
39068
40283
|
trackingConfig,
|
|
39069
40284
|
handleHomeClick
|
|
39070
40285
|
}) {
|
|
39071
|
-
var _a;
|
|
40286
|
+
var _a, _b, _c;
|
|
39072
40287
|
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
39073
40288
|
const [activeBusinessLine, setActiveBusinessLine] = useState();
|
|
39074
40289
|
const [activeSourceOfFund, setActiveSourceOfFund] = useState({});
|
|
@@ -39106,7 +40321,7 @@ function SourceOfFundsDropin({
|
|
|
39106
40321
|
trackingConfig,
|
|
39107
40322
|
task: TaskTypes.SOURCE_OF_FUNDS
|
|
39108
40323
|
});
|
|
39109
|
-
const allFormsFilled = (data) => ["sourceOfFundsType", "
|
|
40324
|
+
const allFormsFilled = (data) => ["sourceOfFundsType", "amount"].every((detail) => {
|
|
39110
40325
|
const value = getProp(data, detail);
|
|
39111
40326
|
return !isEmpty$1(value);
|
|
39112
40327
|
});
|
|
@@ -39128,17 +40343,13 @@ function SourceOfFundsDropin({
|
|
|
39128
40343
|
),
|
|
39129
40344
|
[problems == null ? void 0 : problems.remediationActions, legalEntityResponse]
|
|
39130
40345
|
);
|
|
39131
|
-
const sourceOfFundsRequiredForms = useMemo(
|
|
39132
|
-
|
|
39133
|
-
|
|
39134
|
-
|
|
39135
|
-
|
|
39136
|
-
|
|
39137
|
-
|
|
39138
|
-
return form;
|
|
39139
|
-
})
|
|
39140
|
-
);
|
|
39141
|
-
}, [(_a = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a.sourceOfFundsType]);
|
|
40346
|
+
const sourceOfFundsRequiredForms = useMemo(
|
|
40347
|
+
() => {
|
|
40348
|
+
var _a2;
|
|
40349
|
+
return getSourceOfFundsRequiredForms((_a2 = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a2.sourceOfFundsType);
|
|
40350
|
+
},
|
|
40351
|
+
[(_a = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a.sourceOfFundsType]
|
|
40352
|
+
);
|
|
39142
40353
|
const forms = useMemo(() => {
|
|
39143
40354
|
const requiredForms = getRequiredForms(
|
|
39144
40355
|
sourceOfFundsRequiredForms,
|
|
@@ -39178,7 +40389,7 @@ function SourceOfFundsDropin({
|
|
|
39178
40389
|
forms,
|
|
39179
40390
|
onSubmit: handleSubmit
|
|
39180
40391
|
});
|
|
39181
|
-
return /* @__PURE__ */ jsx("div", { className: styles$
|
|
40392
|
+
return /* @__PURE__ */ jsx("div", { className: styles$4.sourceOfFunds, children: loading ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39182
40393
|
gettingStarted && /* @__PURE__ */ jsx(
|
|
39183
40394
|
SourceOfFundsGettingStarted,
|
|
39184
40395
|
{
|
|
@@ -39215,6 +40426,7 @@ function SourceOfFundsDropin({
|
|
|
39215
40426
|
activeForm,
|
|
39216
40427
|
shouldValidate,
|
|
39217
40428
|
activeBusinessLine,
|
|
40429
|
+
sourceOfFundsType: (_c = (_b = currentState == null ? void 0 : currentState.data) == null ? void 0 : _b.sourceOfFundsType) == null ? void 0 : _c.type,
|
|
39218
40430
|
ref: formRef,
|
|
39219
40431
|
data: activeSourceOfFund
|
|
39220
40432
|
}
|
|
@@ -39899,10 +41111,13 @@ function DropinComposer({
|
|
|
39899
41111
|
return /* @__PURE__ */ jsx(
|
|
39900
41112
|
CustomerSupport,
|
|
39901
41113
|
{
|
|
39902
|
-
legalEntityResponse,
|
|
41114
|
+
legalEntityResponse: rootLegalEntity,
|
|
39903
41115
|
country: rootLegalEntityCountry,
|
|
39904
41116
|
onNavigateBack: navigateBack,
|
|
39905
|
-
onSubmit:
|
|
41117
|
+
onSubmit: async () => {
|
|
41118
|
+
await refreshLegalEntity();
|
|
41119
|
+
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
41120
|
+
},
|
|
39906
41121
|
handleUpdateLegalEntity: args == null ? void 0 : args.handleUpdateLegalEntity
|
|
39907
41122
|
}
|
|
39908
41123
|
);
|
|
@@ -41553,43 +42768,6 @@ function useInterval(callback, initialDelay = DEFAULT_POLLING_INTERVAL) {
|
|
|
41553
42768
|
);
|
|
41554
42769
|
return timeoutId;
|
|
41555
42770
|
}
|
|
41556
|
-
const Confirm = ({ onConfirm, title, confirmBtnLabel, onClose }) => {
|
|
41557
|
-
const { i18n } = useI18nContext();
|
|
41558
|
-
const [isInFlight, setIsInFlight] = useState(false);
|
|
41559
|
-
const handleConfirm = async () => {
|
|
41560
|
-
setIsInFlight(true);
|
|
41561
|
-
try {
|
|
41562
|
-
await onConfirm();
|
|
41563
|
-
} finally {
|
|
41564
|
-
setIsInFlight(false);
|
|
41565
|
-
onClose();
|
|
41566
|
-
}
|
|
41567
|
-
};
|
|
41568
|
-
return /* @__PURE__ */ jsxs(Modal, { size: "small", onClose, children: [
|
|
41569
|
-
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(
|
|
41570
|
-
Typography,
|
|
41571
|
-
{
|
|
41572
|
-
variant: "title",
|
|
41573
|
-
el: "h3",
|
|
41574
|
-
className: "adyen-kyc-u-margin-top-8 adyen-kyc-u-margin-left-8",
|
|
41575
|
-
children: title
|
|
41576
|
-
}
|
|
41577
|
-
) }),
|
|
41578
|
-
/* @__PURE__ */ jsxs(ModalFooter, { children: [
|
|
41579
|
-
/* @__PURE__ */ jsx("div", { style: { flex: "1" } }),
|
|
41580
|
-
/* @__PURE__ */ jsx(Button, { label: i18n.get("cancel"), onClick: onClose, secondary: true }),
|
|
41581
|
-
/* @__PURE__ */ jsx(
|
|
41582
|
-
Button,
|
|
41583
|
-
{
|
|
41584
|
-
label: confirmBtnLabel || i18n.get("confirm"),
|
|
41585
|
-
onClick: handleConfirm,
|
|
41586
|
-
critical: true,
|
|
41587
|
-
disabled: isInFlight
|
|
41588
|
-
}
|
|
41589
|
-
)
|
|
41590
|
-
] })
|
|
41591
|
-
] });
|
|
41592
|
-
};
|
|
41593
42771
|
function ManageTransferInstrumentOverviewItemModal({
|
|
41594
42772
|
status,
|
|
41595
42773
|
transferInstrument,
|
|
@@ -42082,21 +43260,14 @@ function SignPCIComponent({
|
|
|
42082
43260
|
return /* @__PURE__ */ jsx(Loader, { size: "medium" });
|
|
42083
43261
|
}
|
|
42084
43262
|
if (!hasGenericError) {
|
|
42085
|
-
return /* @__PURE__ */ jsx(
|
|
42086
|
-
|
|
43263
|
+
return /* @__PURE__ */ jsx(MaybeModal, { inline: !modalView, onClose: handleOnClose, children: /* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsx(
|
|
43264
|
+
Splashscreen,
|
|
42087
43265
|
{
|
|
42088
|
-
|
|
42089
|
-
|
|
42090
|
-
|
|
42091
|
-
Splashscreen,
|
|
42092
|
-
{
|
|
42093
|
-
icon: "check",
|
|
42094
|
-
title: i18n.get("pciDoesNotNeedSigningOrHasBeenSigned"),
|
|
42095
|
-
onClick: handleOnClose
|
|
42096
|
-
}
|
|
42097
|
-
)
|
|
43266
|
+
icon: "check",
|
|
43267
|
+
title: i18n.get("pciDoesNotNeedSigningOrHasBeenSigned"),
|
|
43268
|
+
onClick: handleOnClose
|
|
42098
43269
|
}
|
|
42099
|
-
);
|
|
43270
|
+
) }) });
|
|
42100
43271
|
}
|
|
42101
43272
|
return pciTemplate ? /* @__PURE__ */ jsx(
|
|
42102
43273
|
PciDropin,
|
|
@@ -42338,236 +43509,6 @@ const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
|
|
|
42338
43509
|
}
|
|
42339
43510
|
return schemaKeys.filter((field) => !fieldsToRemove.includes(field));
|
|
42340
43511
|
};
|
|
42341
|
-
const validateLegalEntityIdentifier = (legalEntityIdentifier) => {
|
|
42342
|
-
if (!legalEntityIdentifier) {
|
|
42343
|
-
return true;
|
|
42344
|
-
}
|
|
42345
|
-
const isValidLength = legalEntityIdentifier ? legalEntityIdentifier.length === 20 : false;
|
|
42346
|
-
const hasLettersAndNumbers = legalEntityIdentifier ? /[a-zA-Z]/.test(legalEntityIdentifier) && /[0-9]/.test(legalEntityIdentifier) : false;
|
|
42347
|
-
return isValidLength && hasLettersAndNumbers;
|
|
42348
|
-
};
|
|
42349
|
-
const validateDateNotInTheFuture = (selectedDate) => {
|
|
42350
|
-
if (!selectedDate) return true;
|
|
42351
|
-
return new Date(selectedDate) <= /* @__PURE__ */ new Date();
|
|
42352
|
-
};
|
|
42353
|
-
const highExposureCompanyDetailsValidations = {
|
|
42354
|
-
legalForm: {
|
|
42355
|
-
modes: ["blur"],
|
|
42356
|
-
validate: (legalName) => !isEmpty$1(legalName),
|
|
42357
|
-
errorMessage: "fieldIsRequired"
|
|
42358
|
-
},
|
|
42359
|
-
numberOfEmployees: [
|
|
42360
|
-
{
|
|
42361
|
-
modes: ["blur"],
|
|
42362
|
-
validate: (numberOfEmployees) => !isEmpty$1(numberOfEmployees),
|
|
42363
|
-
errorMessage: "fieldIsRequired"
|
|
42364
|
-
},
|
|
42365
|
-
{
|
|
42366
|
-
modes: ["blur"],
|
|
42367
|
-
validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
|
|
42368
|
-
errorMessage: "pleaseEnterAValidWholeNumber"
|
|
42369
|
-
}
|
|
42370
|
-
],
|
|
42371
|
-
legalInformationInsolvency: {
|
|
42372
|
-
modes: ["blur"],
|
|
42373
|
-
validate: (legalInformationInsolvency) => !isEmpty$1(legalInformationInsolvency),
|
|
42374
|
-
errorMessage: "fieldIsRequired"
|
|
42375
|
-
},
|
|
42376
|
-
netAssets: [
|
|
42377
|
-
{
|
|
42378
|
-
modes: ["blur"],
|
|
42379
|
-
validate: (value) => !isEmpty$1(value),
|
|
42380
|
-
errorMessage: "fieldIsRequired"
|
|
42381
|
-
},
|
|
42382
|
-
{
|
|
42383
|
-
modes: ["blur"],
|
|
42384
|
-
validate: (value) => !Number.isNaN(Number(value)),
|
|
42385
|
-
errorMessage: "pleaseEnterAValidNumber"
|
|
42386
|
-
}
|
|
42387
|
-
],
|
|
42388
|
-
currency: {
|
|
42389
|
-
modes: ["input"],
|
|
42390
|
-
validate: (value) => !isEmpty$1(value),
|
|
42391
|
-
errorMessage: "fieldIsRequired"
|
|
42392
|
-
},
|
|
42393
|
-
annualTurnover: [
|
|
42394
|
-
{
|
|
42395
|
-
modes: ["blur"],
|
|
42396
|
-
validate: (value) => !isEmpty$1(value),
|
|
42397
|
-
errorMessage: "fieldIsRequired"
|
|
42398
|
-
},
|
|
42399
|
-
{
|
|
42400
|
-
modes: ["blur"],
|
|
42401
|
-
validate: (value) => !Number.isNaN(Number(value)),
|
|
42402
|
-
errorMessage: "pleaseEnterAValidNumber"
|
|
42403
|
-
}
|
|
42404
|
-
],
|
|
42405
|
-
financialReportingDate: [
|
|
42406
|
-
{
|
|
42407
|
-
modes: ["blur"],
|
|
42408
|
-
validate: (value) => !isEmpty$1(value),
|
|
42409
|
-
errorMessage: "fieldIsRequired"
|
|
42410
|
-
},
|
|
42411
|
-
{
|
|
42412
|
-
modes: ["blur"],
|
|
42413
|
-
validate: (value) => validateDateNotInTheFuture(value),
|
|
42414
|
-
errorMessage: "dateCannotBeInTheFuture"
|
|
42415
|
-
}
|
|
42416
|
-
],
|
|
42417
|
-
naceCode: {
|
|
42418
|
-
modes: ["blur"],
|
|
42419
|
-
validate: (naceCode) => !isEmpty$1(naceCode),
|
|
42420
|
-
errorMessage: "fieldIsRequired"
|
|
42421
|
-
},
|
|
42422
|
-
doesYourCompanyHaveLEI: {
|
|
42423
|
-
modes: ["blur"],
|
|
42424
|
-
validate: (doesYourCompanyHaveLEI) => !isEmpty$1(doesYourCompanyHaveLEI),
|
|
42425
|
-
errorMessage: "fieldIsRequired"
|
|
42426
|
-
},
|
|
42427
|
-
legalEntityIdentifier: [
|
|
42428
|
-
{
|
|
42429
|
-
modes: ["blur"],
|
|
42430
|
-
validate: (legalEntityIdentifier) => !isEmpty$1(legalEntityIdentifier),
|
|
42431
|
-
errorMessage: "fieldIsRequired"
|
|
42432
|
-
},
|
|
42433
|
-
{
|
|
42434
|
-
modes: ["blur"],
|
|
42435
|
-
validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
|
|
42436
|
-
errorMessage: "invalidFormat"
|
|
42437
|
-
}
|
|
42438
|
-
],
|
|
42439
|
-
isCompanyOwnedByAnotherCompany: {
|
|
42440
|
-
modes: ["blur"],
|
|
42441
|
-
validate: (isCompanyOwnedByAnotherCompany) => !isEmpty$1(isCompanyOwnedByAnotherCompany),
|
|
42442
|
-
errorMessage: "fieldIsRequired"
|
|
42443
|
-
},
|
|
42444
|
-
isParentOwnedByAnotherCompany: {
|
|
42445
|
-
modes: ["blur"],
|
|
42446
|
-
validate: (isParentOwnedByAnotherCompany) => !isEmpty$1(isParentOwnedByAnotherCompany),
|
|
42447
|
-
errorMessage: "fieldIsRequired"
|
|
42448
|
-
},
|
|
42449
|
-
legalProceedingsDate: [
|
|
42450
|
-
{
|
|
42451
|
-
modes: ["blur"],
|
|
42452
|
-
validate: (legalProceedingsDate) => !isEmpty$1(legalProceedingsDate),
|
|
42453
|
-
errorMessage: "fieldIsRequired"
|
|
42454
|
-
},
|
|
42455
|
-
{
|
|
42456
|
-
modes: ["blur"],
|
|
42457
|
-
validate: (value) => validateDateNotInTheFuture(value),
|
|
42458
|
-
errorMessage: "dateCannotBeInTheFuture"
|
|
42459
|
-
}
|
|
42460
|
-
]
|
|
42461
|
-
};
|
|
42462
|
-
const highExposureParentCompaniesDetailsValidations = {
|
|
42463
|
-
legalForm: {
|
|
42464
|
-
modes: ["blur"],
|
|
42465
|
-
validate: (legalName) => !isEmpty$1(legalName),
|
|
42466
|
-
errorMessage: "fieldIsRequired"
|
|
42467
|
-
},
|
|
42468
|
-
legalName: {
|
|
42469
|
-
modes: ["blur"],
|
|
42470
|
-
validate: (legalName) => !isEmpty$1(legalName),
|
|
42471
|
-
errorMessage: "fieldIsRequired"
|
|
42472
|
-
},
|
|
42473
|
-
numberOfEmployees: [
|
|
42474
|
-
{
|
|
42475
|
-
modes: ["blur"],
|
|
42476
|
-
validate: (numberOfEmployees) => !isEmpty$1(numberOfEmployees),
|
|
42477
|
-
errorMessage: "fieldIsRequired"
|
|
42478
|
-
},
|
|
42479
|
-
{
|
|
42480
|
-
modes: ["blur"],
|
|
42481
|
-
validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
|
|
42482
|
-
errorMessage: "pleaseEnterAValidWholeNumber"
|
|
42483
|
-
}
|
|
42484
|
-
],
|
|
42485
|
-
naceCode: {
|
|
42486
|
-
modes: ["blur"],
|
|
42487
|
-
validate: (naceCode) => !isEmpty$1(naceCode),
|
|
42488
|
-
errorMessage: "fieldIsRequired"
|
|
42489
|
-
},
|
|
42490
|
-
doesYourCompanyHaveLEI: {
|
|
42491
|
-
modes: ["blur"],
|
|
42492
|
-
validate: (doesYourCompanyHaveLEI) => !isEmpty$1(doesYourCompanyHaveLEI),
|
|
42493
|
-
errorMessage: "fieldIsRequired"
|
|
42494
|
-
},
|
|
42495
|
-
legalEntityIdentifier: [
|
|
42496
|
-
{
|
|
42497
|
-
modes: ["blur"],
|
|
42498
|
-
validate: (legalEntityIdentifier) => !isEmpty$1(legalEntityIdentifier),
|
|
42499
|
-
errorMessage: "fieldIsRequired"
|
|
42500
|
-
},
|
|
42501
|
-
{
|
|
42502
|
-
modes: ["blur"],
|
|
42503
|
-
validate: (legalEntityIdentifier) => validateLegalEntityIdentifier(legalEntityIdentifier),
|
|
42504
|
-
errorMessage: "invalidFormat"
|
|
42505
|
-
}
|
|
42506
|
-
],
|
|
42507
|
-
isThisAddressTheMainHeadquarters: {
|
|
42508
|
-
modes: ["blur"],
|
|
42509
|
-
validate: (isThisAddressTheMainHeadquarters) => !isEmpty$1(isThisAddressTheMainHeadquarters),
|
|
42510
|
-
errorMessage: "fieldIsRequired"
|
|
42511
|
-
},
|
|
42512
|
-
legalInformationInsolvency: {
|
|
42513
|
-
modes: ["blur"],
|
|
42514
|
-
validate: (value) => !isEmpty$1(value),
|
|
42515
|
-
errorMessage: "fieldIsRequired"
|
|
42516
|
-
},
|
|
42517
|
-
netAssets: [
|
|
42518
|
-
{
|
|
42519
|
-
modes: ["blur"],
|
|
42520
|
-
validate: (value) => !isEmpty$1(value),
|
|
42521
|
-
errorMessage: "fieldIsRequired"
|
|
42522
|
-
},
|
|
42523
|
-
{
|
|
42524
|
-
modes: ["blur"],
|
|
42525
|
-
validate: (value) => !Number.isNaN(Number(value)),
|
|
42526
|
-
errorMessage: "pleaseEnterAValidNumber"
|
|
42527
|
-
}
|
|
42528
|
-
],
|
|
42529
|
-
currency: {
|
|
42530
|
-
modes: ["input"],
|
|
42531
|
-
validate: (value) => !isEmpty$1(value),
|
|
42532
|
-
errorMessage: "fieldIsRequired"
|
|
42533
|
-
},
|
|
42534
|
-
annualTurnover: [
|
|
42535
|
-
{
|
|
42536
|
-
modes: ["blur"],
|
|
42537
|
-
validate: (value) => !isEmpty$1(value),
|
|
42538
|
-
errorMessage: "fieldIsRequired"
|
|
42539
|
-
},
|
|
42540
|
-
{
|
|
42541
|
-
modes: ["blur"],
|
|
42542
|
-
validate: (value) => !Number.isNaN(Number(value)),
|
|
42543
|
-
errorMessage: "pleaseEnterAValidNumber"
|
|
42544
|
-
}
|
|
42545
|
-
],
|
|
42546
|
-
financialReportingDate: [
|
|
42547
|
-
{
|
|
42548
|
-
modes: ["blur"],
|
|
42549
|
-
validate: (value) => !isEmpty$1(value),
|
|
42550
|
-
errorMessage: "fieldIsRequired"
|
|
42551
|
-
},
|
|
42552
|
-
{
|
|
42553
|
-
modes: ["blur"],
|
|
42554
|
-
validate: (value) => validateDateNotInTheFuture(value),
|
|
42555
|
-
errorMessage: "dateCannotBeInTheFuture"
|
|
42556
|
-
}
|
|
42557
|
-
],
|
|
42558
|
-
legalProceedingsDate: [
|
|
42559
|
-
{
|
|
42560
|
-
modes: ["blur"],
|
|
42561
|
-
validate: (legalProceedingsDate) => !isEmpty$1(legalProceedingsDate),
|
|
42562
|
-
errorMessage: "fieldIsRequired"
|
|
42563
|
-
},
|
|
42564
|
-
{
|
|
42565
|
-
modes: ["blur"],
|
|
42566
|
-
validate: (legalProceedingsDate) => validateDateNotInTheFuture(legalProceedingsDate),
|
|
42567
|
-
errorMessage: "dateCannotBeInTheFuture"
|
|
42568
|
-
}
|
|
42569
|
-
]
|
|
42570
|
-
};
|
|
42571
43512
|
const logger$d = createLogger("LegalFormField");
|
|
42572
43513
|
function LegalFormField({
|
|
42573
43514
|
name = "legalForm",
|
|
@@ -44442,7 +45383,8 @@ const useAnalytics = ({ onUserEvent, sdkVersion, componentName }) => {
|
|
|
44442
45383
|
const sessionData = {
|
|
44443
45384
|
sdkVersion,
|
|
44444
45385
|
componentName,
|
|
44445
|
-
userAgent: navigator.userAgent
|
|
45386
|
+
userAgent: navigator.userAgent,
|
|
45387
|
+
legalEntityId: rootLegalEntity.id
|
|
44446
45388
|
};
|
|
44447
45389
|
const sessionResponse = await getAnalyticsSession(loadingContext, sessionData);
|
|
44448
45390
|
if (!(sessionResponse == null ? void 0 : sessionResponse.id)) {
|
|
@@ -44843,7 +45785,7 @@ const ConfigurationApiProvider = ({
|
|
|
44843
45785
|
}) => {
|
|
44844
45786
|
const authContext = useAuthContext();
|
|
44845
45787
|
const { isEmbeddedDropin, loadingContext } = authContext;
|
|
44846
|
-
const sdkVersion = "3.
|
|
45788
|
+
const sdkVersion = "3.46.0";
|
|
44847
45789
|
const rootLegalEntityId = useGlobalStore((store) => store.rootLegalEntity.id);
|
|
44848
45790
|
useAnalytics({
|
|
44849
45791
|
onUserEvent,
|
|
@@ -44964,7 +45906,7 @@ const useAllowedLocales = () => {
|
|
|
44964
45906
|
}, []);
|
|
44965
45907
|
return allowedLocales;
|
|
44966
45908
|
};
|
|
44967
|
-
const localeImports = /* @__PURE__ */ Object.assign({ "./locales/bg-BG.json": () => import("./bg-BG-
|
|
45909
|
+
const localeImports = /* @__PURE__ */ Object.assign({ "./locales/bg-BG.json": () => import("./bg-BG-Ihgju3Pi.js"), "./locales/cs-CZ.json": () => import("./cs-CZ-BwFstFmQ.js"), "./locales/da-DK.json": () => import("./da-DK-8v1CN9Kj.js"), "./locales/de-DE.json": () => import("./de-DE-DtR-ZoAt.js"), "./locales/el-GR.json": () => import("./el-GR-CBnu_V96.js"), "./locales/en-US.instructions.json": () => import("./en-US.instructions-DLPEHGI-.js"), "./locales/en-US.json": () => Promise.resolve().then(() => enUS), "./locales/es-ES.json": () => import("./es-ES-kb2BRKrK.js"), "./locales/et-EE.json": () => import("./et-EE-UdwhQ1tL.js"), "./locales/fi-FI.json": () => import("./fi-FI-DX8-uQWW.js"), "./locales/fr-FR.json": () => import("./fr-FR-Dflt81Kj.js"), "./locales/hr-HR.json": () => import("./hr-HR-DDW3mkAM.js"), "./locales/hu-HU.json": () => import("./hu-HU-B7KDp-GT.js"), "./locales/it-IT.json": () => import("./it-IT-Q6-mT16i.js"), "./locales/lt-LT.json": () => import("./lt-LT-DKLjCNW_.js"), "./locales/lv-LV.json": () => import("./lv-LV-Cj-obzFe.js"), "./locales/nl-NL.json": () => import("./nl-NL-C0DfxtrT.js"), "./locales/no-NO.json": () => import("./no-NO-DRJeRltS.js"), "./locales/pl-PL.json": () => import("./pl-PL-DPYok5sp.js"), "./locales/pt-PT.json": () => import("./pt-PT-C5GFc3jY.js"), "./locales/ro-RO.json": () => import("./ro-RO-BhsqkN_s.js"), "./locales/sk-SK.json": () => import("./sk-SK-HaK9kYN-.js"), "./locales/sl-SI.json": () => import("./sl-SI-VeIDFOxi.js"), "./locales/sv-SE.json": () => import("./sv-SE-DEhZRTDK.js") });
|
|
44968
45910
|
const loadLocale = async (locale) => {
|
|
44969
45911
|
const importForLocale = localeImports[`./locales/${locale}.json`];
|
|
44970
45912
|
if (!importForLocale) {
|
|
@@ -45690,7 +46632,7 @@ const DebugModal = ({ onExit }) => {
|
|
|
45690
46632
|
const [tab, setTab] = useState("metadata");
|
|
45691
46633
|
const rootLegalEntity = useGlobalStore((store) => store.rootLegalEntity);
|
|
45692
46634
|
const metadata = {
|
|
45693
|
-
sdkVersion: "3.
|
|
46635
|
+
sdkVersion: "3.46.0",
|
|
45694
46636
|
locale: i18n.locale,
|
|
45695
46637
|
rootLegalEntityId: rootLegalEntity.id
|
|
45696
46638
|
};
|