@adyen/kyc-components 2.20.0 → 2.22.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 +1261 -1150
- package/dist/style.css +21 -2
- package/dist/types/components/BusinessTypeSelection/types.d.ts +1 -1
- package/dist/types/components/BusinessTypeSelection/utils.d.ts +25 -0
- package/dist/types/components/ConstitutionalDocument/ConstitutionalDocumentComponent.d.ts +4 -10
- package/dist/types/components/ConstitutionalDocument/types.d.ts +4 -0
- package/dist/types/components/ContactDetails/component/ContactDetailsComponent.d.ts +7 -1
- package/dist/types/components/Dropins/CompanyDropin/types.d.ts +2 -2
- package/dist/types/components/Dropins/PciDropin/types.d.ts +1 -1
- package/dist/types/components/Dropins/ServiceAgreementDropinComponent/types.d.ts +1 -1
- package/dist/types/components/IdentityNumber/component/IdentityNumberComponent.d.ts +3 -1
- package/dist/types/components/IdentityNumber/validate.helper.d.ts +1 -5
- package/dist/types/components/Individual/types.d.ts +2 -2
- package/dist/types/components/LegalEntityTypeSwitcher/type.d.ts +5 -2
- package/dist/types/components/PayoutAccount/types.d.ts +3 -2
- package/dist/types/components/PayoutBankStatement/component/BankDocumentRequirements.d.ts +3 -1
- package/dist/types/components/PayoutBankStatement/types.d.ts +2 -1
- package/dist/types/components/TaskList/component/PayoutAccountTaskListItem.d.ts +2 -2
- package/dist/types/components/Trust/types.d.ts +2 -2
- package/dist/types/components/internal/Accordion/types.d.ts +1 -1
- package/dist/types/components/internal/AccountHolder/types.d.ts +1 -1
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/BusinessRegistrationNumber/validate.d.ts +5 -4
- package/dist/types/components/internal/ContractViewer/types.d.ts +24 -17
- package/dist/types/components/internal/ErrorPanel/components/NavigateToFieldLink.d.ts +5 -4
- package/dist/types/components/internal/FormFields/Dropzone/types.d.ts +1 -1
- package/dist/types/components/internal/FormFields/InputDate/utils.d.ts +1 -1
- package/dist/types/components/internal/FormFields/InputEmail.d.ts +2 -1
- package/dist/types/components/internal/FormFields/InputTelephone.d.ts +2 -1
- package/dist/types/components/internal/FormFields/RadioGroup/RadioGroup.d.ts +1 -8
- package/dist/types/components/internal/FormFields/RadioGroup/types.d.ts +2 -1
- package/dist/types/components/internal/FormFields/utils.d.ts +6 -1
- package/dist/types/components/internal/Name/Name.d.ts +13 -1
- package/dist/types/core/Context/ExperimentContext/types.d.ts +0 -1
- package/dist/types/core/Context/StateContext/StateProvider.d.ts +8 -4
- package/dist/types/core/errorMapping.d.ts +1 -1
- package/dist/types/core/hooks/useBusinessSetup.d.ts +6 -0
- package/dist/types/core/hooks/useExemptSettlor.d.ts +1 -1
- package/dist/types/core/models/currency.d.ts +6 -3
- package/dist/types/core/models/decision-maker.d.ts +1 -1
- package/dist/types/core/models/identity.d.ts +3 -1
- package/dist/types/core/user-events.d.ts +7 -6
- package/dist/types/language/config.d.ts +18 -2
- package/dist/types/utils/decision-maker-roles.d.ts +10 -19
- package/dist/types/utils/entity-association-util.d.ts +23 -17
- package/dist/types/utils/entity-status-util.d.ts +1 -3
- package/dist/types/utils/entriesOf.d.ts +1 -0
- package/dist/types/utils/file.d.ts +3 -3
- package/dist/types/utils/genUtils.d.ts +11 -9
- package/dist/types/utils/get-name.d.ts +2 -2
- package/dist/types/utils/get-task-status.d.ts +2 -2
- package/dist/types/utils/makeSelectItemForRole.d.ts +4 -0
- package/dist/types/utils/mapping/componentApiMapping.d.ts +2 -1
- package/dist/types/utils/payout-account-util.d.ts +3 -0
- package/dist/types/utils/regex/types.d.ts +1 -1
- package/dist/types/utils/remove-object-empty-values.d.ts +1 -1
- package/dist/types/utils/roleMetadata.d.ts +13 -0
- package/dist/types/utils/scroll.d.ts +1 -1
- package/dist/types/utils/trust-util.d.ts +4 -25
- package/package.json +1 -1
|
@@ -139,13 +139,18 @@ const privateCompanyTitle = "Private company";
|
|
|
139
139
|
const privateCompanyDescription = "Owned privately. The shareholders don’t necessarily trade on public exchanges (like the stock market).";
|
|
140
140
|
const publicCompanyTitle = "Public company";
|
|
141
141
|
const publicCompanyDescription = "Owned by public shareholders. They’re also required to disclose financial information to the public regularly.";
|
|
142
|
+
const partnershipIncorporated = "Incorporated partnership";
|
|
143
|
+
const partnershipUnincorporated = "Unincorporated partnership";
|
|
144
|
+
const associationIncorporated = "Incorporated association";
|
|
142
145
|
const incorporatedPartnership = "Incorporated partnership";
|
|
143
146
|
const unincorporatedPartnership = "Unincorporated partnership";
|
|
144
147
|
const incorporatedPartnershipTitle = "Incorporated partnership";
|
|
148
|
+
const partnershipIncorporatedDescription = "An agreement between two or more people who run a business together.";
|
|
149
|
+
const partnershipUnincorporatedDescription = "You or your partners are personally liable for business debts.";
|
|
150
|
+
const partnershipIncorporatedNewEntryFlowDescription = "You and your partners have limited liability for business debts.";
|
|
151
|
+
const partnershipUnincorporatedNewEntryFlowDescription = "You or your partners are personally liable for business debts.";
|
|
145
152
|
const incorporatedPartnershipDescription = "An agreement between two or more people who run a business together.";
|
|
146
|
-
const incorporatedPartnershipNewEntryFlowDescription = "You and your partners have limited liability for business debts.";
|
|
147
153
|
const unincorporatedPartnershipDescription = "You or your partners are personally liable for business debts.";
|
|
148
|
-
const unincorporatedPartnershipNewEntryFlowDescription = "You or your partners are personally liable for business debts.";
|
|
149
154
|
const nonProfitOrCharitableOrgTitle = "Non-profit or charitable organization";
|
|
150
155
|
const nonProfitOrCharitableOrgDescription = "An organization that has an official status as not for profit or tax exempt, sometimes called an NGO.";
|
|
151
156
|
const governmentalOrganizationTitle = "Governmental organization";
|
|
@@ -225,7 +230,7 @@ const submitFailed = "Submit failed";
|
|
|
225
230
|
const submitReviewOfYourData = "Submit review of your data";
|
|
226
231
|
const completeReview = "Complete review";
|
|
227
232
|
const submitReview = "Submit review";
|
|
228
|
-
const undoWithTimer = "Undo %{secondsLeft}";
|
|
233
|
+
const undoWithTimer = "Undo... %{secondsLeft}";
|
|
229
234
|
const removing = "Removing...";
|
|
230
235
|
const cantSetUpAcccount = "You can’t set up an account";
|
|
231
236
|
const accountCantBeSetUp = "Your account can’t be set up as your information couldn’t be verified. To find out more, reach out to customer support.";
|
|
@@ -266,6 +271,7 @@ const signedDocuments = "Signed documents";
|
|
|
266
271
|
const paymentProcessingTerms = "Payment Processing Terms";
|
|
267
272
|
const accountHolderTerms = "Account Holder Terms";
|
|
268
273
|
const capitalUserTerms = "Capital User Terms";
|
|
274
|
+
const pccr = "PCCR";
|
|
269
275
|
const businessAccountTerms = "Business Account Terms";
|
|
270
276
|
const cardUserTerms = "Card User Terms";
|
|
271
277
|
const franchiseesTAndCs = "Franchisees T&C's";
|
|
@@ -354,7 +360,7 @@ const businessAccountDetailsDescription = "To prepare your account, we need info
|
|
|
354
360
|
const 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.";
|
|
355
361
|
const documentAddressedToName = "The document has to be addressed to %{name}";
|
|
356
362
|
const showAddressStateCountry = "Shows address, state, and country of residence";
|
|
357
|
-
const dateOnDocumentNoOlderThanXMonths = "
|
|
363
|
+
const dateOnDocumentNoOlderThanXMonths = "Date on the document is no older than %{numberOfMonths} months";
|
|
358
364
|
const fullDocumentVisibleWithReadableText = "The full document needs to be visible, with all text readable";
|
|
359
365
|
const documentCannotBeDamaged = "The document cannot be damaged";
|
|
360
366
|
const verify = "Verify";
|
|
@@ -386,12 +392,13 @@ const bankAccountVerification = "Bank account verification";
|
|
|
386
392
|
const bankStatementDocument = "Bank statement";
|
|
387
393
|
const bankStatementDocumentTypeLabel = "Upload a document to confirm your bank account information. We need to see this document so we can set up your payouts.";
|
|
388
394
|
const requirements = "Requirements:";
|
|
389
|
-
const accountHolderNameMatchesWithBusinessOrTradingName = "
|
|
390
|
-
const accountNumberOrIbanVisible = "
|
|
395
|
+
const accountHolderNameMatchesWithBusinessOrTradingName = "Account holder name on the document has to match the legal business or trading name of your company";
|
|
396
|
+
const accountNumberOrIbanVisible = "Visible account number or IBAN";
|
|
391
397
|
const accountNumberVisible = "The account number needs to be visible";
|
|
392
398
|
const routingNumberVisible = "The routing number should be visible";
|
|
393
399
|
const showsCountryOfBankAccount = "Shows the country where the bank account is located (for banks in the EU, the country is included in the IBAN)";
|
|
394
|
-
const hasToBeOfficialDocumentFromBank = "
|
|
400
|
+
const hasToBeOfficialDocumentFromBank = "Must be an official bank document that shows the bank logo, the bank name, or a bank-specific font";
|
|
401
|
+
const hasBankStampOrBankSignature = "Must have a bank stamp or bank signature";
|
|
395
402
|
const ifDocumentMoreThan12months = "If your document is older than 12 months, then it should contain a statement with the company’s assets and liabilities. You will need to have it signed and dated by someone with decision-making or signing power within the company. Make sure the date, title, and legal entity name are included.";
|
|
396
403
|
const whyDoINeedToFillInThisInformation = "Why do I need to fill in this information?";
|
|
397
404
|
const reasonForFillingCompanyRegistrationDetails = "We have to make sure the businesses using our services will not be misusing the funds or causing harm. To do that, we’ll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.";
|
|
@@ -591,6 +598,8 @@ const documentShowsTaxIdOfCompany = "The document shows the tax ID number of the
|
|
|
591
598
|
const issuedByTheTaxAuthority = "Issued by the tax authority or government of the country where the company is registered";
|
|
592
599
|
const providePageWithPhotoAndCode = "Provide the page with the photo, including the code on the bottom";
|
|
593
600
|
const constitutionalDocument = "Constitutional document";
|
|
601
|
+
const constitutionalDocument__header = "Upload a constitutional document";
|
|
602
|
+
const constitutionalDocument__headerDescription = "This helps to verify your sole proprietorship details.";
|
|
594
603
|
const solePropDetails = "Sole proprietor details";
|
|
595
604
|
const soleProprietorDetails = "Sole proprietor details";
|
|
596
605
|
const soleProprietorshipDetails = "Sole proprietorship details";
|
|
@@ -644,7 +653,8 @@ const addAndVerifyYourBankDetails = "Add and verify your bank account details";
|
|
|
644
653
|
const failedToFetchSoleProp = "Failed to fetch the sole propietor";
|
|
645
654
|
const uniqueIdentificationCode = "Unique identification code (ЕИК/UIC)";
|
|
646
655
|
const identifikacionenNomerDDS = "VAT number (ДДС)";
|
|
647
|
-
const
|
|
656
|
+
const MBS = "Matični broj subjekta trgovačkog suda (MBS)";
|
|
657
|
+
const MBO = "MBO";
|
|
648
658
|
const PDVIdBrojOIB = "PDV Id. Broj OIB";
|
|
649
659
|
const cyRegistrationNumber = "Αριθμός Εγγραφής";
|
|
650
660
|
const arithmosEngraphes = "Αριθμός Εγγραφής Φ.Π.Α.";
|
|
@@ -709,10 +719,16 @@ const canNotCompleteInstantVerification = "Can not complete instant verification
|
|
|
709
719
|
const goBackAndProvideDocumentScans = "Go back and provide document scans";
|
|
710
720
|
const identityCard = "Identity card";
|
|
711
721
|
const uploadOneOfTheFollowing = "Upload one of the following so we can verify your information:";
|
|
712
|
-
const
|
|
722
|
+
const uploadOneOfTheseDocuments = "Upload one of these documents:";
|
|
723
|
+
const documentIssuedWithinLastYear = "The document must be issued in the last 12 months. If it is older, make sure it contains a signature and a statement of affairs from the last 12 months.";
|
|
713
724
|
const learnMore = "Learn more";
|
|
714
|
-
const doingBusinessAsNameFiling = "Doing business as
|
|
715
|
-
const
|
|
725
|
+
const doingBusinessAsNameFiling = "Doing business as (DBA) filing";
|
|
726
|
+
const doingBusinessAsNameFiling__FR = "Trading name filing";
|
|
727
|
+
const doingBusinessAsNameFiling__US = "Doing business as (DBA) filing, such as your articles of incorporation";
|
|
728
|
+
const businessRegistrationDocument__FR = "Business registration document, such as a KBIS extract or situation au répertoire sirene";
|
|
729
|
+
const taxFiling = "Tax filing";
|
|
730
|
+
const taxFiling__US = "Tax filing, such as a Form W-9 or Schedule SE (Form 1040)";
|
|
731
|
+
const einVerificationLetter = "Employer identification number (EIN) verification letter, also known as a CP 575 or 147c letter";
|
|
716
732
|
const areYouACompany = "Are you a company?";
|
|
717
733
|
const singingUpAsIndividualButLooksLikeYouAreACompany = "You’re now signing up as an individual. But it looks like you’re a company that uses a company bank account to receive payouts.";
|
|
718
734
|
const wouldYouLikeToSignUpAsCompanyInstead = "Would you like to sign up as a company instead? (You’ll have to re-enter some information from before.)";
|
|
@@ -1261,13 +1277,18 @@ const defaultTrans = {
|
|
|
1261
1277
|
privateCompanyDescription,
|
|
1262
1278
|
publicCompanyTitle,
|
|
1263
1279
|
publicCompanyDescription,
|
|
1280
|
+
partnershipIncorporated,
|
|
1281
|
+
partnershipUnincorporated,
|
|
1282
|
+
associationIncorporated,
|
|
1264
1283
|
incorporatedPartnership,
|
|
1265
1284
|
unincorporatedPartnership,
|
|
1266
1285
|
incorporatedPartnershipTitle,
|
|
1286
|
+
partnershipIncorporatedDescription,
|
|
1287
|
+
partnershipUnincorporatedDescription,
|
|
1288
|
+
partnershipIncorporatedNewEntryFlowDescription,
|
|
1289
|
+
partnershipUnincorporatedNewEntryFlowDescription,
|
|
1267
1290
|
incorporatedPartnershipDescription,
|
|
1268
|
-
incorporatedPartnershipNewEntryFlowDescription,
|
|
1269
1291
|
unincorporatedPartnershipDescription,
|
|
1270
|
-
unincorporatedPartnershipNewEntryFlowDescription,
|
|
1271
1292
|
nonProfitOrCharitableOrgTitle,
|
|
1272
1293
|
nonProfitOrCharitableOrgDescription,
|
|
1273
1294
|
governmentalOrganizationTitle,
|
|
@@ -1388,6 +1409,7 @@ const defaultTrans = {
|
|
|
1388
1409
|
paymentProcessingTerms,
|
|
1389
1410
|
accountHolderTerms,
|
|
1390
1411
|
capitalUserTerms,
|
|
1412
|
+
pccr,
|
|
1391
1413
|
businessAccountTerms,
|
|
1392
1414
|
cardUserTerms,
|
|
1393
1415
|
franchiseesTAndCs,
|
|
@@ -1514,6 +1536,7 @@ const defaultTrans = {
|
|
|
1514
1536
|
routingNumberVisible,
|
|
1515
1537
|
showsCountryOfBankAccount,
|
|
1516
1538
|
hasToBeOfficialDocumentFromBank,
|
|
1539
|
+
hasBankStampOrBankSignature,
|
|
1517
1540
|
ifDocumentMoreThan12months,
|
|
1518
1541
|
whyDoINeedToFillInThisInformation,
|
|
1519
1542
|
reasonForFillingCompanyRegistrationDetails,
|
|
@@ -1718,6 +1741,8 @@ const defaultTrans = {
|
|
|
1718
1741
|
issuedByTheTaxAuthority,
|
|
1719
1742
|
providePageWithPhotoAndCode,
|
|
1720
1743
|
constitutionalDocument,
|
|
1744
|
+
constitutionalDocument__header,
|
|
1745
|
+
constitutionalDocument__headerDescription,
|
|
1721
1746
|
solePropDetails,
|
|
1722
1747
|
soleProprietorDetails,
|
|
1723
1748
|
soleProprietorshipDetails,
|
|
@@ -1771,6 +1796,7 @@ const defaultTrans = {
|
|
|
1771
1796
|
failedToFetchSoleProp,
|
|
1772
1797
|
uniqueIdentificationCode,
|
|
1773
1798
|
identifikacionenNomerDDS,
|
|
1799
|
+
MBS,
|
|
1774
1800
|
MBO,
|
|
1775
1801
|
PDVIdBrojOIB,
|
|
1776
1802
|
cyRegistrationNumber,
|
|
@@ -1845,10 +1871,16 @@ const defaultTrans = {
|
|
|
1845
1871
|
goBackAndProvideDocumentScans,
|
|
1846
1872
|
identityCard,
|
|
1847
1873
|
uploadOneOfTheFollowing,
|
|
1874
|
+
uploadOneOfTheseDocuments,
|
|
1848
1875
|
documentIssuedWithinLastYear,
|
|
1849
1876
|
learnMore,
|
|
1850
1877
|
doingBusinessAsNameFiling,
|
|
1878
|
+
doingBusinessAsNameFiling__FR,
|
|
1879
|
+
doingBusinessAsNameFiling__US,
|
|
1880
|
+
businessRegistrationDocument__FR,
|
|
1851
1881
|
taxFiling,
|
|
1882
|
+
taxFiling__US,
|
|
1883
|
+
einVerificationLetter,
|
|
1852
1884
|
areYouACompany,
|
|
1853
1885
|
singingUpAsIndividualButLooksLikeYouAreACompany,
|
|
1854
1886
|
wouldYouLikeToSignUpAsCompanyInstead,
|
|
@@ -2386,43 +2418,30 @@ class Language {
|
|
|
2386
2418
|
});
|
|
2387
2419
|
}
|
|
2388
2420
|
}
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
)
|
|
2404
|
-
}
|
|
2405
|
-
}
|
|
2406
|
-
|
|
2407
|
-
const myArgs = isArray(args[0]) ? args[0] : args;
|
|
2408
|
-
return {
|
|
2409
|
-
from: (obj) => {
|
|
2410
|
-
const vkeys = Object.keys(obj).filter((k) => !myArgs.includes(k));
|
|
2411
|
-
return pick(...vkeys).from(obj);
|
|
2412
|
-
}
|
|
2413
|
-
};
|
|
2414
|
-
}
|
|
2415
|
-
function doArraysMatch(arr1, arr2) {
|
|
2416
|
-
return arr1.length === arr2.length && arr1.every((element) => arr2.includes(element));
|
|
2417
|
-
}
|
|
2421
|
+
const entriesOf = (object) => Object.entries(object);
|
|
2422
|
+
const keysOf = (object) => Object.keys(object);
|
|
2423
|
+
const keyIsInObject = (key, obj) => key in obj;
|
|
2424
|
+
const pick = (...propertiesToKeep) => ({
|
|
2425
|
+
from: (obj) => propertiesToKeep.map((k) => keyIsInObject(k, obj) ? {
|
|
2426
|
+
[k]: obj[k]
|
|
2427
|
+
} : {}).reduce((res, o) => ({
|
|
2428
|
+
...res,
|
|
2429
|
+
...o
|
|
2430
|
+
}), {})
|
|
2431
|
+
});
|
|
2432
|
+
const drop = (...propertiesToDrop) => ({
|
|
2433
|
+
from: (obj) => {
|
|
2434
|
+
const remainingProperties = keysOf(obj).filter((k) => !propertiesToDrop.includes(k));
|
|
2435
|
+
return pick(...remainingProperties).from(obj);
|
|
2436
|
+
}
|
|
2437
|
+
});
|
|
2438
|
+
const doArraysMatch = (arr1, arr2) => arr1.length === arr2.length && arr1.every((element) => arr2.includes(element));
|
|
2418
2439
|
const objectsDeepEqual = (x, y) => {
|
|
2419
|
-
|
|
2420
|
-
const yType = typeof y;
|
|
2421
|
-
if (x && y && xType === "object" && xType === yType) {
|
|
2440
|
+
if (x && y && typeof x === "object" && typeof y === "object") {
|
|
2422
2441
|
if (Object.keys(x).length !== Object.keys(y).length) {
|
|
2423
2442
|
return false;
|
|
2424
2443
|
}
|
|
2425
|
-
return
|
|
2444
|
+
return keysOf(x).every((key) => objectsDeepEqual(x[key], y[key]));
|
|
2426
2445
|
}
|
|
2427
2446
|
return x === y;
|
|
2428
2447
|
};
|
|
@@ -2463,7 +2482,6 @@ function useSettingsContext() {
|
|
|
2463
2482
|
}
|
|
2464
2483
|
return context;
|
|
2465
2484
|
}
|
|
2466
|
-
const entriesOf = (object) => Object.entries(object);
|
|
2467
2485
|
const hasDataChanged = (initialData, currentData) => entriesOf(currentData ?? {}).some(([key, value]) => {
|
|
2468
2486
|
if (typeof value === "object") {
|
|
2469
2487
|
return !objectsDeepEqual(value, initialData == null ? void 0 : initialData[key]);
|
|
@@ -3053,12 +3071,11 @@ const NavigateToFieldLink = ({
|
|
|
3053
3071
|
const {
|
|
3054
3072
|
goToFormByFieldName
|
|
3055
3073
|
} = useFormRouterContext();
|
|
3056
|
-
const onClick = (e) => {
|
|
3057
|
-
e.preventDefault();
|
|
3058
|
-
goToFormByFieldName(fieldName);
|
|
3059
|
-
};
|
|
3060
3074
|
return jsx(Link, {
|
|
3061
|
-
onClick
|
|
3075
|
+
onClick: (e) => {
|
|
3076
|
+
e.preventDefault();
|
|
3077
|
+
goToFormByFieldName(fieldName);
|
|
3078
|
+
},
|
|
3062
3079
|
href: "to-field-link",
|
|
3063
3080
|
children: label
|
|
3064
3081
|
});
|
|
@@ -3944,7 +3961,7 @@ const Field = ({
|
|
|
3944
3961
|
errorMessage,
|
|
3945
3962
|
filled,
|
|
3946
3963
|
focused,
|
|
3947
|
-
helper
|
|
3964
|
+
helper,
|
|
3948
3965
|
inputWrapperModifiers = [],
|
|
3949
3966
|
isLoading,
|
|
3950
3967
|
isValid,
|
|
@@ -3989,9 +4006,9 @@ const Field = ({
|
|
|
3989
4006
|
"adyen-kyc-label__text--error": !!errorMessage
|
|
3990
4007
|
}),
|
|
3991
4008
|
children: label
|
|
3992
|
-
}),
|
|
4009
|
+
}), helper && jsx("span", {
|
|
3993
4010
|
className: "adyen-kyc-helper-text",
|
|
3994
|
-
children:
|
|
4011
|
+
children: helper
|
|
3995
4012
|
}), jsxs("div", {
|
|
3996
4013
|
className: cx("adyen-kyc-input-wrapper", ...inputWrapperModifiers.map((m) => `adyen-kyc-input-wrapper--${m}`)),
|
|
3997
4014
|
children: [children({
|
|
@@ -4042,16 +4059,14 @@ const Field = ({
|
|
|
4042
4059
|
};
|
|
4043
4060
|
const Select$1 = "";
|
|
4044
4061
|
const getScrollParent = (node) => {
|
|
4062
|
+
if (!node)
|
|
4063
|
+
return null;
|
|
4045
4064
|
const isElement = node instanceof HTMLElement;
|
|
4046
4065
|
const overflowY = isElement && window.getComputedStyle(node).overflowY;
|
|
4047
4066
|
const isScrollable = overflowY !== "visible" && overflowY !== "hidden";
|
|
4048
|
-
if (
|
|
4049
|
-
return -1;
|
|
4050
|
-
}
|
|
4051
|
-
if (isScrollable) {
|
|
4067
|
+
if (isElement && isScrollable)
|
|
4052
4068
|
return node;
|
|
4053
|
-
|
|
4054
|
-
return getScrollParent(node.parentNode) || document.body;
|
|
4069
|
+
return getScrollParent(node.parentNode) ?? document.body;
|
|
4055
4070
|
};
|
|
4056
4071
|
function uuidv4() {
|
|
4057
4072
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
@@ -4577,13 +4592,13 @@ function SelectButton({
|
|
|
4577
4592
|
"adyen-kyc-dropdown-button-search": isSearch
|
|
4578
4593
|
}),
|
|
4579
4594
|
filterable,
|
|
4580
|
-
onClick: !readonly ? toggleList :
|
|
4581
|
-
onKeyDown: !readonly ? onButtonKeyDown :
|
|
4582
|
-
role: filterable || isMulti ? "button" :
|
|
4583
|
-
tabIndex:
|
|
4595
|
+
onClick: !readonly ? toggleList : void 0,
|
|
4596
|
+
onKeyDown: !readonly ? onButtonKeyDown : void 0,
|
|
4597
|
+
role: filterable || isMulti ? "button" : void 0,
|
|
4598
|
+
tabIndex: 0,
|
|
4584
4599
|
title,
|
|
4585
4600
|
toggleButtonRef,
|
|
4586
|
-
type: !filterable && !isMulti ? "button" :
|
|
4601
|
+
type: !filterable && !isMulti ? "button" : void 0,
|
|
4587
4602
|
"aria-describedby": ariaDescribedBy,
|
|
4588
4603
|
isMulti,
|
|
4589
4604
|
id: id2,
|
|
@@ -4677,7 +4692,7 @@ function Checkbox({
|
|
|
4677
4692
|
label,
|
|
4678
4693
|
isInvalid,
|
|
4679
4694
|
onChange,
|
|
4680
|
-
helper
|
|
4695
|
+
helper,
|
|
4681
4696
|
checked,
|
|
4682
4697
|
disabled,
|
|
4683
4698
|
...props
|
|
@@ -4699,9 +4714,9 @@ function Checkbox({
|
|
|
4699
4714
|
}), jsx("span", {
|
|
4700
4715
|
className: "adyen-kyc-checkbox__label",
|
|
4701
4716
|
children: label
|
|
4702
|
-
}),
|
|
4717
|
+
}), helper && jsx("span", {
|
|
4703
4718
|
className: "adyen-kyc-checkbox__helper-text",
|
|
4704
|
-
children:
|
|
4719
|
+
children: helper
|
|
4705
4720
|
})]
|
|
4706
4721
|
});
|
|
4707
4722
|
}
|
|
@@ -6364,9 +6379,7 @@ const validateBusinessRegistrationNumber = (input, fallbackCountry = null, compa
|
|
|
6364
6379
|
return {
|
|
6365
6380
|
isValid: CHARACTER_PATTERNS.noHtml.test(input),
|
|
6366
6381
|
translationMessage: {
|
|
6367
|
-
translationKey: "validationPleaseEnterAValidRegistrationNumber"
|
|
6368
|
-
format: null,
|
|
6369
|
-
values: null
|
|
6382
|
+
translationKey: "validationPleaseEnterAValidRegistrationNumber"
|
|
6370
6383
|
}
|
|
6371
6384
|
};
|
|
6372
6385
|
}
|
|
@@ -6382,9 +6395,7 @@ const validateBusinessRegistrationNumber = (input, fallbackCountry = null, compa
|
|
|
6382
6395
|
return {
|
|
6383
6396
|
isValid: CHARACTER_PATTERNS.noHtml.test(input),
|
|
6384
6397
|
translationMessage: {
|
|
6385
|
-
translationKey: "validationPleaseEnterAValidRegistrationNumber"
|
|
6386
|
-
format: null,
|
|
6387
|
-
values: null
|
|
6398
|
+
translationKey: "validationPleaseEnterAValidRegistrationNumber"
|
|
6388
6399
|
}
|
|
6389
6400
|
};
|
|
6390
6401
|
};
|
|
@@ -6394,20 +6405,32 @@ const getValidationRulesPerCountryAndType = (country2, companyType2, trustType2,
|
|
|
6394
6405
|
if (!registrationNumber2)
|
|
6395
6406
|
return false;
|
|
6396
6407
|
const {
|
|
6397
|
-
isValid
|
|
6398
|
-
|
|
6408
|
+
isValid
|
|
6409
|
+
} = validateBusinessRegistrationNumber(registrationNumber2, country2, companyType2, trustType2);
|
|
6410
|
+
return isValid;
|
|
6411
|
+
},
|
|
6412
|
+
errorMessage: (registrationNumber2) => {
|
|
6413
|
+
if (!registrationNumber2)
|
|
6414
|
+
return;
|
|
6415
|
+
const {
|
|
6416
|
+
translationMessage: {
|
|
6417
|
+
translationKey,
|
|
6418
|
+
format,
|
|
6419
|
+
values
|
|
6420
|
+
}
|
|
6399
6421
|
} = validateBusinessRegistrationNumber(registrationNumber2, country2, companyType2, trustType2);
|
|
6400
|
-
|
|
6401
|
-
|
|
6422
|
+
if (!format)
|
|
6423
|
+
return translationKey;
|
|
6424
|
+
return {
|
|
6425
|
+
translationKey,
|
|
6402
6426
|
translationObject: {
|
|
6403
6427
|
values: {
|
|
6404
|
-
format:
|
|
6405
|
-
values
|
|
6406
|
-
}) : i18n.get(
|
|
6428
|
+
format: values ? i18n.get(format, {
|
|
6429
|
+
values
|
|
6430
|
+
}) : i18n.get(format)
|
|
6407
6431
|
}
|
|
6408
6432
|
}
|
|
6409
6433
|
};
|
|
6410
|
-
return isValid;
|
|
6411
6434
|
}
|
|
6412
6435
|
});
|
|
6413
6436
|
const defaultValidationRules = {
|
|
@@ -6427,6 +6450,7 @@ const getRegistrationNumberValidationRules = (country2, companyType2, trustType2
|
|
|
6427
6450
|
};
|
|
6428
6451
|
const businessRegistrationNumberFields = ["registrationNumber", "exemptedFromRegistrationNumber"];
|
|
6429
6452
|
function BusinessRegistrationNumber(props) {
|
|
6453
|
+
var _a;
|
|
6430
6454
|
const {
|
|
6431
6455
|
i18n
|
|
6432
6456
|
} = useI18nContext();
|
|
@@ -6439,7 +6463,7 @@ function BusinessRegistrationNumber(props) {
|
|
|
6439
6463
|
country: country2,
|
|
6440
6464
|
trustType: trustType2
|
|
6441
6465
|
} = props;
|
|
6442
|
-
const validationRules = useMemo(() => getRegistrationNumberValidationRules(country2, companyType2, trustType2, i18n), [country2, companyType2, i18n]);
|
|
6466
|
+
const validationRules = useMemo(() => getRegistrationNumberValidationRules(country2, companyType2, trustType2, i18n), [country2, companyType2, trustType2, i18n]);
|
|
6443
6467
|
const registrationNumberFormatters = getRegistrationNumberFormatters(props.country);
|
|
6444
6468
|
const {
|
|
6445
6469
|
handleChangeFor,
|
|
@@ -6455,13 +6479,14 @@ function BusinessRegistrationNumber(props) {
|
|
|
6455
6479
|
formatters: registrationNumberFormatters,
|
|
6456
6480
|
defaultData: {
|
|
6457
6481
|
...props.data,
|
|
6458
|
-
exemptedFromRegistrationNumber: !!props.data.exemptedFromRegistrationNumber
|
|
6482
|
+
exemptedFromRegistrationNumber: !!((_a = props.data) == null ? void 0 : _a.exemptedFromRegistrationNumber)
|
|
6459
6483
|
},
|
|
6460
6484
|
// exemptedFromRegistrationNumber should be a boolean
|
|
6461
6485
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
6462
6486
|
});
|
|
6463
6487
|
useEffect(() => {
|
|
6464
|
-
|
|
6488
|
+
var _a2, _b;
|
|
6489
|
+
(_b = (_a2 = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b.call(_a2, {
|
|
6465
6490
|
type: "addToState",
|
|
6466
6491
|
value: {
|
|
6467
6492
|
data,
|
|
@@ -6511,7 +6536,7 @@ function BusinessRegistrationNumber(props) {
|
|
|
6511
6536
|
value: "exemptedFromRegistrationNumber",
|
|
6512
6537
|
readonly: formUtils.isReadOnly("exemptedFromRegistrationNumber"),
|
|
6513
6538
|
classNameModifiers: ["exempted-from-registration"],
|
|
6514
|
-
checked: data.exemptedFromRegistrationNumber,
|
|
6539
|
+
checked: data.exemptedFromRegistrationNumber ?? false,
|
|
6515
6540
|
onChange: handleChangeFor("exemptedFromRegistrationNumber"),
|
|
6516
6541
|
"aria-required": formUtils.isRequiredField("exemptedFromRegistrationNumber"),
|
|
6517
6542
|
"aria-label": formUtils.getLabel("exemptedFromRegistrationNumber"),
|
|
@@ -7701,7 +7726,7 @@ const companyRegistrationDetailsValidationRules = {
|
|
|
7701
7726
|
},
|
|
7702
7727
|
stockExchangeMIC: {
|
|
7703
7728
|
modes: ["blur"],
|
|
7704
|
-
validate: (input) => /^[A-Z0-9]{4}$/.test(input),
|
|
7729
|
+
validate: (input) => !isEmpty(input) && /^[A-Z0-9]{4}$/.test(input),
|
|
7705
7730
|
errorMessage: "validationPleaseEnterAValidMarketIdentifier"
|
|
7706
7731
|
},
|
|
7707
7732
|
stockISIN: [{
|
|
@@ -7719,7 +7744,7 @@ const companyRegistrationDetailsValidationRules = {
|
|
|
7719
7744
|
errorMessage: "fieldIsRequired"
|
|
7720
7745
|
}, {
|
|
7721
7746
|
modes: ["blur"],
|
|
7722
|
-
validate: (dateOfIncorporation2) => dateOfIncorporation2 && new Date(dateOfIncorporation2) < /* @__PURE__ */ new Date(),
|
|
7747
|
+
validate: (dateOfIncorporation2) => !isEmpty(dateOfIncorporation2) && new Date(dateOfIncorporation2) < /* @__PURE__ */ new Date(),
|
|
7723
7748
|
errorMessage: "invalidDateOfIncorporation"
|
|
7724
7749
|
}]
|
|
7725
7750
|
};
|
|
@@ -8177,7 +8202,7 @@ const countryConfig$4 = {
|
|
|
8177
8202
|
},
|
|
8178
8203
|
[CountryCodes.Croatia]: {
|
|
8179
8204
|
registrationNumber: {
|
|
8180
|
-
label: "
|
|
8205
|
+
label: "MBS"
|
|
8181
8206
|
},
|
|
8182
8207
|
exemptedFromVat: {
|
|
8183
8208
|
label: "vatNumberExempted"
|
|
@@ -8958,7 +8983,7 @@ function AccountHolder(props) {
|
|
|
8958
8983
|
isExperimentEnabled
|
|
8959
8984
|
} = useExperimentsContext();
|
|
8960
8985
|
const isChangeToMyNameAllowed = !(capabilities == null ? void 0 : capabilities.map((c) => c.replace("Commercial", "").replace("Consumer", "")).some((c) => capabilitiesToPreventTypeChange.includes(c)));
|
|
8961
|
-
const accountHolderOptions = getAvailableAccountHolderOptions(props.legalEntityType, isSettingEnabled(SettingNames.AllowLegalEntityTypeChange),
|
|
8986
|
+
const accountHolderOptions = getAvailableAccountHolderOptions(props.legalEntityType, isSettingEnabled(SettingNames.AllowLegalEntityTypeChange), TRUST_COUNTRIES.includes(props.country), SOLE_PROP_COUNTRIES.includes(props.country), isChangeToMyNameAllowed).map((accountHolderOption) => ({
|
|
8962
8987
|
id: accountHolderOption,
|
|
8963
8988
|
name: i18n.get(accountHolderOption),
|
|
8964
8989
|
description: i18n.get(`${accountHolderOption}Description`)
|
|
@@ -9182,12 +9207,14 @@ function CompanyTypeComponent(props) {
|
|
|
9182
9207
|
const {
|
|
9183
9208
|
i18n
|
|
9184
9209
|
} = useI18nContext();
|
|
9210
|
+
const isNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
9185
9211
|
const stateRef = useRef({
|
|
9186
9212
|
setState: null
|
|
9187
9213
|
});
|
|
9188
9214
|
const {
|
|
9189
9215
|
id: COMPANY_TYPE_ID,
|
|
9190
|
-
requiredFields
|
|
9216
|
+
requiredFields,
|
|
9217
|
+
country: country2
|
|
9191
9218
|
} = props;
|
|
9192
9219
|
const requiredFieldsForForm = requiredFields || companyTypeFields;
|
|
9193
9220
|
const {
|
|
@@ -9251,11 +9278,11 @@ function CompanyTypeComponent(props) {
|
|
|
9251
9278
|
"aria-label": formUtils.getLabel("entityType", "whatTypeOfCompanyDoYouHave"),
|
|
9252
9279
|
"aria-invalid": !valid.entityType
|
|
9253
9280
|
})
|
|
9254
|
-
}), formUtils.isRequiredField("accountHolder") &&
|
|
9281
|
+
}), !isNewEntryFlowEnabled && formUtils.isRequiredField("accountHolder") && country2 && jsx(AccountHolder, {
|
|
9255
9282
|
...accountHolderProps,
|
|
9256
9283
|
dataStoreId: COMPANY_TYPE_ID,
|
|
9257
9284
|
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
9258
|
-
country:
|
|
9285
|
+
country: country2
|
|
9259
9286
|
})]
|
|
9260
9287
|
})]
|
|
9261
9288
|
});
|
|
@@ -9387,16 +9414,13 @@ function DropzoneFile(props) {
|
|
|
9387
9414
|
i18n
|
|
9388
9415
|
} = useI18nContext();
|
|
9389
9416
|
const formatSize = (bytes) => {
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
return `(${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]})`;
|
|
9398
|
-
}
|
|
9399
|
-
return null;
|
|
9417
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
9418
|
+
if (!bytes || bytes === 0)
|
|
9419
|
+
return "n/a";
|
|
9420
|
+
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
|
|
9421
|
+
if (i === 0)
|
|
9422
|
+
return `${bytes} ${sizes[i]}`;
|
|
9423
|
+
return `(${(bytes / 1024 ** i).toFixed(1)} ${sizes[i]})`;
|
|
9400
9424
|
};
|
|
9401
9425
|
return jsxs("div", {
|
|
9402
9426
|
className: "adyen-kyc-dropzone-file",
|
|
@@ -9543,10 +9567,10 @@ function Dropzone(props) {
|
|
|
9543
9567
|
const isRequired = ((_a = errors == null ? void 0 : errors[name]) == null ? void 0 : _a.errorMessage) === "fieldIsRequired";
|
|
9544
9568
|
const allowedFiletypes = allowedFileTypes.join(", ");
|
|
9545
9569
|
useEffect(() => {
|
|
9546
|
-
var _a2;
|
|
9570
|
+
var _a2, _b2, _c;
|
|
9547
9571
|
const hasMaxNumberOfFiles = ((_a2 = data == null ? void 0 : data[name]) == null ? void 0 : _a2.length) >= maxNumberOfFiles;
|
|
9548
9572
|
setShowDropzone(!hasMaxNumberOfFiles);
|
|
9549
|
-
stateRef.current.setState({
|
|
9573
|
+
(_c = (_b2 = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _b2.setState) == null ? void 0 : _c.call(_b2, {
|
|
9550
9574
|
type: "addToState",
|
|
9551
9575
|
value: {
|
|
9552
9576
|
data,
|
|
@@ -9821,7 +9845,8 @@ function DocumentUploadComponent({
|
|
|
9821
9845
|
owner: props.id,
|
|
9822
9846
|
stateRef
|
|
9823
9847
|
}), jsx(FormHeader, {
|
|
9824
|
-
heading: props.heading
|
|
9848
|
+
heading: props.heading,
|
|
9849
|
+
description: props.description
|
|
9825
9850
|
}), jsx(ErrorPanel, {
|
|
9826
9851
|
verificationErrors: props == null ? void 0 : props.formVerificationErrors,
|
|
9827
9852
|
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
@@ -10854,10 +10879,10 @@ Address.defaultProps = {
|
|
|
10854
10879
|
};
|
|
10855
10880
|
const RadioGroup$1 = "";
|
|
10856
10881
|
function RadioGroup({
|
|
10857
|
-
items,
|
|
10882
|
+
items = [],
|
|
10858
10883
|
i18n,
|
|
10859
10884
|
name,
|
|
10860
|
-
onChange,
|
|
10885
|
+
onChange = noop,
|
|
10861
10886
|
value,
|
|
10862
10887
|
isInvalid,
|
|
10863
10888
|
uniqueId: uniqueId2,
|
|
@@ -10892,11 +10917,6 @@ function RadioGroup({
|
|
|
10892
10917
|
})
|
|
10893
10918
|
});
|
|
10894
10919
|
}
|
|
10895
|
-
RadioGroup.defaultProps = {
|
|
10896
|
-
onChange: () => {
|
|
10897
|
-
},
|
|
10898
|
-
items: []
|
|
10899
|
-
};
|
|
10900
10920
|
var operationalAddressIsSameIds = /* @__PURE__ */ ((operationalAddressIsSameIds2) => {
|
|
10901
10921
|
operationalAddressIsSameIds2["OPERATIONAL_ADDRESS_IS_SAME"] = "OperationAddressAnswerYes";
|
|
10902
10922
|
operationalAddressIsSameIds2["OPERATIONAL_ADDRESS_IS_NOT_SAME"] = "OperationAddressAnswerNo";
|
|
@@ -11494,494 +11514,77 @@ const getMaskedAccountNumber = ({
|
|
|
11494
11514
|
accountIdentifier,
|
|
11495
11515
|
realLastFour
|
|
11496
11516
|
}) => realLastFour ? `*******${realLastFour}` : accountIdentifier;
|
|
11497
|
-
const
|
|
11498
|
-
|
|
11499
|
-
|
|
11500
|
-
max: Infinity
|
|
11501
|
-
}, {
|
|
11502
|
-
roleTypes: [DecisionMakerType.OWNER],
|
|
11503
|
-
min: 0,
|
|
11504
|
-
max: 4
|
|
11505
|
-
}, {
|
|
11506
|
-
roleTypes: [DecisionMakerType.CONTROLLING_PERSON],
|
|
11507
|
-
min: 0,
|
|
11508
|
-
max: Infinity
|
|
11509
|
-
}, {
|
|
11510
|
-
roleTypes: [DecisionMakerType.SIGNATORY],
|
|
11511
|
-
min: 1,
|
|
11512
|
-
max: Infinity
|
|
11513
|
-
}];
|
|
11514
|
-
const PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES = {
|
|
11515
|
-
US: [{
|
|
11516
|
-
roleTypes: [DecisionMakerType.CONTROLLING_PERSON],
|
|
11517
|
-
min: 1,
|
|
11518
|
-
max: Infinity
|
|
11519
|
-
}, {
|
|
11520
|
-
roleTypes: [DecisionMakerType.OWNER],
|
|
11521
|
-
min: 0,
|
|
11522
|
-
max: 4
|
|
11523
|
-
}, {
|
|
11524
|
-
roleTypes: [DecisionMakerType.SIGNATORY],
|
|
11525
|
-
min: 1,
|
|
11526
|
-
max: Infinity
|
|
11527
|
-
}],
|
|
11528
|
-
BR: [{
|
|
11529
|
-
roleTypes: [DecisionMakerType.CONTROLLING_PERSON],
|
|
11530
|
-
min: 1,
|
|
11531
|
-
max: Infinity
|
|
11532
|
-
}, {
|
|
11533
|
-
roleTypes: [DecisionMakerType.OWNER],
|
|
11534
|
-
min: 0,
|
|
11535
|
-
max: 4
|
|
11536
|
-
}, {
|
|
11537
|
-
roleTypes: [DecisionMakerType.SIGNATORY],
|
|
11538
|
-
min: 1,
|
|
11539
|
-
max: Infinity
|
|
11540
|
-
}],
|
|
11541
|
-
AU: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
11542
|
-
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
11543
|
-
min: 3,
|
|
11544
|
-
max: Infinity
|
|
11545
|
-
}],
|
|
11546
|
-
CA: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
11547
|
-
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
11548
|
-
min: 1,
|
|
11549
|
-
max: Infinity
|
|
11550
|
-
}],
|
|
11551
|
-
HK: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
11552
|
-
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
11553
|
-
min: 1,
|
|
11554
|
-
max: Infinity
|
|
11555
|
-
}],
|
|
11556
|
-
IN: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
11557
|
-
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
11558
|
-
min: 3,
|
|
11559
|
-
max: 15
|
|
11560
|
-
}],
|
|
11561
|
-
NZ: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
11562
|
-
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
11563
|
-
min: 1,
|
|
11564
|
-
max: Infinity
|
|
11565
|
-
}],
|
|
11566
|
-
SG: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
11567
|
-
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
11568
|
-
min: 1,
|
|
11569
|
-
max: Infinity
|
|
11570
|
-
}]
|
|
11571
|
-
};
|
|
11572
|
-
const getDecisionMakerRequirements = (country2) => PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES[country2] || DEFAULT_DECISION_MAKER_REQUIREMENTS;
|
|
11573
|
-
function getAvailableDecisionMakerRoleTypes(country2) {
|
|
11574
|
-
const requirements2 = getDecisionMakerRequirements(country2);
|
|
11575
|
-
return requirements2.filter((req) => req.roleTypes.length === 1).map((req) => ({
|
|
11576
|
-
roleType: req.roleTypes[0],
|
|
11577
|
-
min: req.min,
|
|
11578
|
-
max: req.max
|
|
11579
|
-
}));
|
|
11580
|
-
}
|
|
11581
|
-
const DEFAULT_DESCRIPTIONS_MAP = {
|
|
11582
|
-
[DecisionMakerType.OWNER]: "provideAllOwners",
|
|
11583
|
-
[DecisionMakerType.CONTROLLING_PERSON]: "ifNoOwnersSpecifyControllingPersons",
|
|
11584
|
-
[DecisionMakerType.DIRECTOR]: "provideAllDirectors",
|
|
11585
|
-
[DecisionMakerType.SIGNATORY]: "provideAtLeastOneSignatory"
|
|
11586
|
-
};
|
|
11587
|
-
const PER_COUNTRY_DESCRIPTION_OVERRIDES = {
|
|
11588
|
-
US: {
|
|
11589
|
-
[DecisionMakerType.CONTROLLING_PERSON]: "provideOneControllingPerson"
|
|
11590
|
-
},
|
|
11591
|
-
BR: {
|
|
11592
|
-
[DecisionMakerType.CONTROLLING_PERSON]: "provideOneControllingPerson"
|
|
11593
|
-
}
|
|
11594
|
-
};
|
|
11595
|
-
const getDecisionMakerDescriptionMap = (country2) => ({
|
|
11596
|
-
...DEFAULT_DESCRIPTIONS_MAP,
|
|
11597
|
-
...PER_COUNTRY_DESCRIPTION_OVERRIDES[country2]
|
|
11598
|
-
});
|
|
11599
|
-
const decisionMakerRoles = {
|
|
11600
|
-
[DecisionMakerType.CONTROLLING_PERSON]: {
|
|
11601
|
-
id: DecisionMakerType.CONTROLLING_PERSON,
|
|
11602
|
-
name: "controllingPerson",
|
|
11603
|
-
description: "controllingPersonDescription",
|
|
11604
|
-
className: "adl-tag--teal"
|
|
11605
|
-
},
|
|
11606
|
-
[DecisionMakerType.OWNER]: {
|
|
11607
|
-
id: DecisionMakerType.OWNER,
|
|
11608
|
-
name: "owner",
|
|
11609
|
-
description: "ownerDescription",
|
|
11610
|
-
className: "adl-tag--purple"
|
|
11611
|
-
},
|
|
11612
|
-
[DecisionMakerType.SIGNATORY]: {
|
|
11613
|
-
id: DecisionMakerType.SIGNATORY,
|
|
11614
|
-
name: "signatory",
|
|
11615
|
-
description: "signatoryDescription",
|
|
11616
|
-
className: "adl-tag--light-blue"
|
|
11617
|
-
},
|
|
11618
|
-
[DecisionMakerType.DIRECTOR]: {
|
|
11619
|
-
id: DecisionMakerType.DIRECTOR,
|
|
11620
|
-
name: "director",
|
|
11621
|
-
description: "directorDescription",
|
|
11622
|
-
className: "adl-tag--orange"
|
|
11623
|
-
}
|
|
11517
|
+
const getDirectEntityAssociations = (rootLE, legalEntityId) => {
|
|
11518
|
+
var _a;
|
|
11519
|
+
return ((_a = rootLE == null ? void 0 : rootLE.entityAssociations) == null ? void 0 : _a.filter((association2) => association2.associatorId === legalEntityId)) ?? [];
|
|
11624
11520
|
};
|
|
11625
|
-
const
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
11629
|
-
description: i18n.get(decisionMakerRole.description)
|
|
11630
|
-
}));
|
|
11631
|
-
const getOwnDecisionMakers = (legalEntity) => {
|
|
11632
|
-
if (legalEntity == null ? void 0 : legalEntity.entityAssociations) {
|
|
11633
|
-
const decisionMakerTypes = Object.values(DecisionMakerType);
|
|
11634
|
-
return legalEntity.entityAssociations.filter((entityAssociation) => decisionMakerTypes.includes(entityAssociation.type) && entityAssociation.associatorId === legalEntity.id);
|
|
11635
|
-
}
|
|
11636
|
-
return [];
|
|
11521
|
+
const getOwnEntityAssociations = (legalEntity) => getDirectEntityAssociations(legalEntity, legalEntity.id);
|
|
11522
|
+
const getOwnSoleProprietorshipIdArray = (legalEntity) => {
|
|
11523
|
+
const ownAssociations = getOwnEntityAssociations(legalEntity);
|
|
11524
|
+
return ownAssociations.filter((ea) => ea.entityType === LegalEntityType.SOLE_PROPRIETORSHIP).map((ea) => ea.legalEntityId).filter((id2) => id2 !== void 0);
|
|
11637
11525
|
};
|
|
11638
|
-
const
|
|
11639
|
-
const getOwnDecisionMakersLegalEntityIds = (legalEntity) => {
|
|
11526
|
+
const hasSolePropInLegalEntity = (rootLegalEntity) => {
|
|
11640
11527
|
var _a;
|
|
11641
|
-
return (_a =
|
|
11528
|
+
return ((_a = rootLegalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.entityType === LegalEntityType.SOLE_PROPRIETORSHIP && ea.associatorId === rootLegalEntity.id)) ?? false;
|
|
11642
11529
|
};
|
|
11643
|
-
const
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
return decisionMakerCount;
|
|
11648
|
-
}, {});
|
|
11530
|
+
const getOwnSolePropProblems = (rootLegalEntity, capabilityProblems) => {
|
|
11531
|
+
var _a;
|
|
11532
|
+
const solePropLegalEntityId = getOwnSoleProprietorshipIdArray(rootLegalEntity)[0];
|
|
11533
|
+
return (_a = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _a[solePropLegalEntityId];
|
|
11649
11534
|
};
|
|
11650
|
-
const
|
|
11651
|
-
|
|
11652
|
-
|
|
11653
|
-
|
|
11535
|
+
const hasOwnEntityAssociationOfType = (type, entityAssociations, legalEntityId) => (entityAssociations == null ? void 0 : entityAssociations.some((ea) => ea.type === type && ea.associatorId === legalEntityId)) ?? false;
|
|
11536
|
+
const removeEntityAssociationByType = (type, entityAssociations, legalEntityId) => entityAssociations.filter((ea) => ea.type !== type || ea.associatorId !== legalEntityId);
|
|
11537
|
+
const isRootLegalEntity = (legalEntity, taskType) => legalEntity.type === LegalEntityType.INDIVIDUAL && taskType === TaskTypes.INDIVIDUAL || legalEntity.type === LegalEntityType.ORGANIZATION && taskType === TaskTypes.COMPANY;
|
|
11538
|
+
const filterOutUnwantedAssociationsIfRootLE = (taskType, legalEntity, accountHolder2) => {
|
|
11539
|
+
if (!(legalEntity == null ? void 0 : legalEntity.entityAssociations)) {
|
|
11540
|
+
return void 0;
|
|
11654
11541
|
}
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
|
|
11665
|
-
|
|
11666
|
-
if (isBelowMaxRange) {
|
|
11667
|
-
acc.push(role2);
|
|
11668
|
-
}
|
|
11669
|
-
}
|
|
11670
|
-
return acc;
|
|
11671
|
-
}, []);
|
|
11672
|
-
const uniqueAllowedRoles = [...new Set(allowedRoles)];
|
|
11673
|
-
return uniqueAllowedRoles;
|
|
11542
|
+
let entityAssociations = getOwnEntityAssociations(legalEntity);
|
|
11543
|
+
if (!isRootLegalEntity(legalEntity, taskType)) {
|
|
11544
|
+
return entityAssociations;
|
|
11545
|
+
}
|
|
11546
|
+
if (accountHolder2 !== "mySoleProprietorName" && hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, entityAssociations, legalEntity.id)) {
|
|
11547
|
+
entityAssociations = removeEntityAssociationByType(LegalEntityType.SOLE_PROPRIETORSHIP, entityAssociations, legalEntity.id);
|
|
11548
|
+
}
|
|
11549
|
+
if (accountHolder2 !== "aTrust" && hasOwnEntityAssociationOfType(LegalEntityType.TRUST, entityAssociations, legalEntity.id)) {
|
|
11550
|
+
entityAssociations = removeEntityAssociationByType(LegalEntityType.TRUST, entityAssociations, legalEntity.id);
|
|
11551
|
+
}
|
|
11552
|
+
return entityAssociations;
|
|
11674
11553
|
};
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
return
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
TrustTypes2["DECEASED_ESTATE"] = "deceasedEstate";
|
|
11694
|
-
TrustTypes2["DISCRETIONARY_INVESTMENT_TRUST"] = "discretionaryInvestmentTrust";
|
|
11695
|
-
TrustTypes2["DISCRETIONARY_SERVICES_MANAGEMENT_TRUST"] = "discretionaryServicesManagementTrust";
|
|
11696
|
-
TrustTypes2["DISCRETIONARY_TRADING_TRUST"] = "discretionaryTradingTrust";
|
|
11697
|
-
TrustTypes2["DISCRETIONARY_TRUST"] = "discretionaryTrust";
|
|
11698
|
-
TrustTypes2["FAMILY_TRUST"] = "familyTrust";
|
|
11699
|
-
TrustTypes2["FIRST_HOME_SAVER_ACCOUNTS_TRUST"] = "firstHomeSaverAccountsTrust";
|
|
11700
|
-
TrustTypes2["FIXED_TRUST"] = "fixedTrust";
|
|
11701
|
-
TrustTypes2["FIXED_UNIT_TRUST"] = "fixedUnitTrust";
|
|
11702
|
-
TrustTypes2["HYBRID_TRUST"] = "hybridTrust";
|
|
11703
|
-
TrustTypes2["LISTED_PUBLIC_UNIT_TRUST"] = "listedPublicUnitTrust";
|
|
11704
|
-
TrustTypes2["OTHER_TRUST"] = "otherTrust";
|
|
11705
|
-
TrustTypes2["POOLED_SUPERANNUATION_TRUST"] = "pooledSuperannuationTrust";
|
|
11706
|
-
TrustTypes2["PUBLIC_TRADING_TRUST"] = "publicTradingTrust";
|
|
11707
|
-
TrustTypes2["UNLISTED_PUBLIC_UNIT_TRUST"] = "unlistedPublicUnitTrust";
|
|
11708
|
-
return TrustTypes2;
|
|
11709
|
-
})(TrustTypes || {});
|
|
11710
|
-
const trustTypeOptions = [{
|
|
11711
|
-
id: TrustTypes.BUSINESS_TRUST,
|
|
11712
|
-
name: "businessTrust"
|
|
11713
|
-
}, {
|
|
11714
|
-
id: TrustTypes.CASH_MANAGEMENT_TRUST,
|
|
11715
|
-
name: "cashManagementTrust"
|
|
11716
|
-
}, {
|
|
11717
|
-
id: TrustTypes.CHARITABLE_TRUST,
|
|
11718
|
-
name: "charitableTrust"
|
|
11719
|
-
}, {
|
|
11720
|
-
id: TrustTypes.CORPORATE_UNIT_TRUST,
|
|
11721
|
-
name: "corporateUnitTrust"
|
|
11722
|
-
}, {
|
|
11723
|
-
id: TrustTypes.DECEASED_ESTATE,
|
|
11724
|
-
name: "deceasedEstate"
|
|
11725
|
-
}, {
|
|
11726
|
-
id: TrustTypes.DISCRETIONARY_INVESTMENT_TRUST,
|
|
11727
|
-
name: "discretionaryInvestmentTrust"
|
|
11728
|
-
}, {
|
|
11729
|
-
id: TrustTypes.DISCRETIONARY_SERVICES_MANAGEMENT_TRUST,
|
|
11730
|
-
name: "discretionaryServicesManagementTrust"
|
|
11731
|
-
}, {
|
|
11732
|
-
id: TrustTypes.DISCRETIONARY_TRADING_TRUST,
|
|
11733
|
-
name: "discretionaryTradingTrust"
|
|
11734
|
-
}, {
|
|
11735
|
-
id: TrustTypes.DISCRETIONARY_TRUST,
|
|
11736
|
-
name: "discretionaryTrust"
|
|
11737
|
-
}, {
|
|
11738
|
-
id: TrustTypes.FAMILY_TRUST,
|
|
11739
|
-
name: "familyTrust"
|
|
11740
|
-
}, {
|
|
11741
|
-
id: TrustTypes.FIRST_HOME_SAVER_ACCOUNTS_TRUST,
|
|
11742
|
-
name: "firstHomeSaverAccountsTrust"
|
|
11743
|
-
}, {
|
|
11744
|
-
id: TrustTypes.FIXED_TRUST,
|
|
11745
|
-
name: "fixedTrust"
|
|
11746
|
-
}, {
|
|
11747
|
-
id: TrustTypes.FIXED_UNIT_TRUST,
|
|
11748
|
-
name: "fixedUnitTrust"
|
|
11749
|
-
}, {
|
|
11750
|
-
id: TrustTypes.HYBRID_TRUST,
|
|
11751
|
-
name: "hybridTrust"
|
|
11752
|
-
}, {
|
|
11753
|
-
id: TrustTypes.LISTED_PUBLIC_UNIT_TRUST,
|
|
11754
|
-
name: "listedPublicUnitTrust"
|
|
11755
|
-
}, {
|
|
11756
|
-
id: TrustTypes.OTHER_TRUST,
|
|
11757
|
-
name: "otherTrust"
|
|
11758
|
-
}, {
|
|
11759
|
-
id: TrustTypes.POOLED_SUPERANNUATION_TRUST,
|
|
11760
|
-
name: "pooledSuperannuationTrust"
|
|
11761
|
-
}, {
|
|
11762
|
-
id: TrustTypes.PUBLIC_TRADING_TRUST,
|
|
11763
|
-
name: "publicTradingTrust"
|
|
11764
|
-
}, {
|
|
11765
|
-
id: TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST,
|
|
11766
|
-
name: "unlistedPublicUnitTrust"
|
|
11767
|
-
}];
|
|
11768
|
-
const nzSpecificTrustTypes = [TrustTypes.DISCRETIONARY_TRUST, TrustTypes.FAMILY_TRUST, TrustTypes.CHARITABLE_TRUST, TrustTypes.BUSINESS_TRUST, TrustTypes.OTHER_TRUST];
|
|
11769
|
-
const auSpecificTrustTypes = [TrustTypes.CASH_MANAGEMENT_TRUST, TrustTypes.CORPORATE_UNIT_TRUST, TrustTypes.DECEASED_ESTATE, TrustTypes.DISCRETIONARY_INVESTMENT_TRUST, TrustTypes.DISCRETIONARY_SERVICES_MANAGEMENT_TRUST, TrustTypes.DISCRETIONARY_TRADING_TRUST, TrustTypes.FIRST_HOME_SAVER_ACCOUNTS_TRUST, TrustTypes.FIXED_TRUST, TrustTypes.FIXED_UNIT_TRUST, TrustTypes.HYBRID_TRUST, TrustTypes.LISTED_PUBLIC_UNIT_TRUST, TrustTypes.OTHER_TRUST, TrustTypes.POOLED_SUPERANNUATION_TRUST, TrustTypes.PUBLIC_TRADING_TRUST, TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST];
|
|
11770
|
-
const countryToTrustTypes = {
|
|
11771
|
-
[CountryCodes.Australia]: auSpecificTrustTypes,
|
|
11772
|
-
[CountryCodes.NewZealand]: nzSpecificTrustTypes
|
|
11773
|
-
};
|
|
11774
|
-
const TRUST_MEMBER_COUNT_RANGE = {
|
|
11775
|
-
[TrustMemberTypes.DEFINED_BENEFICIARY]: {
|
|
11776
|
-
min: 1
|
|
11777
|
-
},
|
|
11778
|
-
[TrustMemberTypes.SETTLOR]: {
|
|
11779
|
-
min: 1
|
|
11780
|
-
}
|
|
11781
|
-
};
|
|
11782
|
-
const isPartOfTrustFromLegalEntity = (legalEntity) => {
|
|
11783
|
-
var _a;
|
|
11784
|
-
return (_a = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.entityType === LegalEntityType.TRUST && ea.associatorId === legalEntity.id);
|
|
11785
|
-
};
|
|
11786
|
-
const getRootTrusteeLegalEntityId = (trustEntity) => {
|
|
11787
|
-
var _a;
|
|
11788
|
-
if (!trustEntity.entityAssociations)
|
|
11789
|
-
return "";
|
|
11790
|
-
return (_a = trustEntity.entityAssociations.filter((entityAssociation) => entityAssociation.type === LegalEntityType.TRUST)[0]) == null ? void 0 : _a.legalEntityId;
|
|
11791
|
-
};
|
|
11792
|
-
const getOwnTrustMembers = (trustEntity) => {
|
|
11793
|
-
if (!trustEntity.entityAssociations)
|
|
11794
|
-
return [];
|
|
11795
|
-
const rootTrusteeLegalEntityId = getRootTrusteeLegalEntityId(trustEntity);
|
|
11796
|
-
return trustEntity.entityAssociations.filter((entityAssociation) => Object.values(TrustMemberTypes).includes(entityAssociation.type) && rootTrusteeLegalEntityId === (entityAssociation == null ? void 0 : entityAssociation.associatorId));
|
|
11797
|
-
};
|
|
11798
|
-
const getOwnTrustMembersLegalEntityIds = (legalEntity) => getOwnTrustMembers(legalEntity).map((ea) => ea.legalEntityId).filter((id2) => id2 !== void 0);
|
|
11799
|
-
const getOwnTrustLegalEntityId = (legalEntity) => {
|
|
11800
|
-
var _a, _b;
|
|
11801
|
-
return (_b = (_a = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a.find((ea) => ea.entityType === LegalEntityType.TRUST && ea.associatorId === legalEntity.id)) == null ? void 0 : _b.legalEntityId;
|
|
11802
|
-
};
|
|
11803
|
-
const getOwnTrustLegalEntityIdAsArray = (legalEntity) => {
|
|
11804
|
-
const trustLegalEntityId = getOwnTrustLegalEntityId(legalEntity);
|
|
11805
|
-
return trustLegalEntityId ? [trustLegalEntityId] : [];
|
|
11806
|
-
};
|
|
11807
|
-
const getOwnTrustProblems = (legalEntity, capabilityProblems) => {
|
|
11808
|
-
var _a;
|
|
11809
|
-
const trustLegalEntityId = getOwnTrustLegalEntityId(legalEntity);
|
|
11810
|
-
if (trustLegalEntityId) {
|
|
11811
|
-
return (_a = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _a[trustLegalEntityId];
|
|
11812
|
-
}
|
|
11813
|
-
};
|
|
11814
|
-
const getTrustMemberCount = (legalEntity) => {
|
|
11815
|
-
const trustMembers2 = getOwnTrustMembers(legalEntity);
|
|
11816
|
-
return trustMembers2.reduce((trustMemberCount, trustMember) => {
|
|
11817
|
-
trustMemberCount[trustMember.type] = (trustMemberCount[trustMember.type] ?? 0) + 1;
|
|
11818
|
-
return trustMemberCount;
|
|
11819
|
-
}, {});
|
|
11820
|
-
};
|
|
11821
|
-
const hasMinRequiredTrustMemberCount = (legalEntity) => {
|
|
11822
|
-
const existingTrustMemberCount = getTrustMemberCount(legalEntity);
|
|
11823
|
-
const countRangeEntries = Object.entries(TRUST_MEMBER_COUNT_RANGE);
|
|
11824
|
-
return countRangeEntries.every(([trustMemberType, requiredRange]) => requiredRange.min ? (existingTrustMemberCount == null ? void 0 : existingTrustMemberCount[trustMemberType]) ?? requiredRange.min <= 0 : true);
|
|
11825
|
-
};
|
|
11826
|
-
const makeSelectItemForTrustRole = (role2, i18n) => ({
|
|
11827
|
-
...trustMemberRoles[role2],
|
|
11828
|
-
name: i18n.get(trustMemberRoles[role2].name),
|
|
11829
|
-
description: i18n.get(trustMemberRoles[role2].description)
|
|
11830
|
-
});
|
|
11831
|
-
const getTrustMemberName = (trustMemberType) => trustMemberRoles[trustMemberType].name;
|
|
11832
|
-
const trustMemberRoles = {
|
|
11833
|
-
[TrustMemberTypes.DEFINED_BENEFICIARY]: {
|
|
11834
|
-
id: TrustMemberTypes.DEFINED_BENEFICIARY,
|
|
11835
|
-
name: "definedBeneficiary",
|
|
11836
|
-
description: "definedBeneficiaryDescription",
|
|
11837
|
-
className: "adl-tag--orange"
|
|
11838
|
-
},
|
|
11839
|
-
[TrustMemberTypes.UNDEFINED_BENEFICIARY]: {
|
|
11840
|
-
id: TrustMemberTypes.UNDEFINED_BENEFICIARY,
|
|
11841
|
-
name: "undefinedBeneficiary",
|
|
11842
|
-
description: "undefinedBeneficiaryDescription",
|
|
11843
|
-
className: "adl-tag--orange"
|
|
11844
|
-
},
|
|
11845
|
-
[TrustMemberTypes.PROTECTOR]: {
|
|
11846
|
-
id: TrustMemberTypes.PROTECTOR,
|
|
11847
|
-
name: "protector",
|
|
11848
|
-
description: "personAppointmentUnderTrustInstrument",
|
|
11849
|
-
className: "adl-tag--orange"
|
|
11850
|
-
},
|
|
11851
|
-
[TrustMemberTypes.TRUSTEE]: {
|
|
11852
|
-
id: TrustMemberTypes.TRUSTEE,
|
|
11853
|
-
name: "trustee",
|
|
11854
|
-
description: "legalOwnerOfProperty",
|
|
11855
|
-
className: "adl-tag--light-blue"
|
|
11856
|
-
},
|
|
11857
|
-
[TrustMemberTypes.SETTLOR]: {
|
|
11858
|
-
id: TrustMemberTypes.SETTLOR,
|
|
11859
|
-
name: "settlor",
|
|
11860
|
-
description: "entityEstablishingTrust",
|
|
11861
|
-
className: "adl-tag--orange"
|
|
11862
|
-
}
|
|
11863
|
-
};
|
|
11864
|
-
const trustMemberGuidanceRoles = {
|
|
11865
|
-
[TrustMemberGuidanceLabel.BENEFICIARY]: {
|
|
11866
|
-
id: TrustMemberGuidanceLabel.BENEFICIARY,
|
|
11867
|
-
name: TrustMemberGuidanceLabel.BENEFICIARY,
|
|
11868
|
-
className: "adl-tag--orange"
|
|
11869
|
-
},
|
|
11870
|
-
[TrustMemberGuidanceLabel.PROTECTOR]: {
|
|
11871
|
-
id: TrustMemberGuidanceLabel.PROTECTOR,
|
|
11872
|
-
name: TrustMemberGuidanceLabel.PROTECTOR,
|
|
11873
|
-
className: "adl-tag--orange"
|
|
11874
|
-
},
|
|
11875
|
-
[TrustMemberGuidanceLabel.TRUSTEE]: {
|
|
11876
|
-
id: TrustMemberGuidanceLabel.TRUSTEE,
|
|
11877
|
-
name: TrustMemberGuidanceLabel.TRUSTEE,
|
|
11878
|
-
className: "adl-tag--light-blue"
|
|
11879
|
-
},
|
|
11880
|
-
[TrustMemberGuidanceLabel.SETTLOR]: {
|
|
11881
|
-
id: TrustMemberGuidanceLabel.SETTLOR,
|
|
11882
|
-
name: TrustMemberGuidanceLabel.SETTLOR,
|
|
11883
|
-
className: "adl-tag--orange"
|
|
11884
|
-
}
|
|
11885
|
-
};
|
|
11886
|
-
const getCountrySpecificTrustTypeOptions = (country2) => {
|
|
11887
|
-
const countrySpecificTrustTypes = countryToTrustTypes[country2];
|
|
11888
|
-
if (!countrySpecificTrustTypes) {
|
|
11889
|
-
return [];
|
|
11890
|
-
}
|
|
11891
|
-
return countrySpecificTrustTypes.map((countrySpecificTrustType) => {
|
|
11892
|
-
const countrySpecificTrustTypeOption = trustTypeOptions.find((trustTypeOption) => trustTypeOption.id === countrySpecificTrustType);
|
|
11893
|
-
if (!countrySpecificTrustTypeOption) {
|
|
11894
|
-
throw new Error("getCountrySpecificTrustTypeOptions(): unknown trust type");
|
|
11895
|
-
}
|
|
11896
|
-
return countrySpecificTrustTypeOption;
|
|
11897
|
-
});
|
|
11898
|
-
};
|
|
11899
|
-
const entityAssociationRoles = {
|
|
11900
|
-
...trustMemberRoles,
|
|
11901
|
-
...decisionMakerRoles
|
|
11902
|
-
};
|
|
11903
|
-
const getEntityAssociationTagColor = (entityAssociationType) => {
|
|
11904
|
-
var _a;
|
|
11905
|
-
return (_a = entityAssociationRoles[entityAssociationType]) == null ? void 0 : _a.className;
|
|
11906
|
-
};
|
|
11907
|
-
const getEntityAssociationName = (entityAssociationType) => {
|
|
11908
|
-
var _a;
|
|
11909
|
-
return (_a = entityAssociationRoles[entityAssociationType]) == null ? void 0 : _a.name;
|
|
11910
|
-
};
|
|
11911
|
-
const getOwnEntityAssociations = (legalEntity) => {
|
|
11912
|
-
if (legalEntity == null ? void 0 : legalEntity.entityAssociations) {
|
|
11913
|
-
return legalEntity.entityAssociations.filter((entityAssociation) => entityAssociation.associatorId === legalEntity.id);
|
|
11914
|
-
}
|
|
11915
|
-
return [];
|
|
11916
|
-
};
|
|
11917
|
-
const getOwnSoleProprietorshipIdArray = (legalEntity) => {
|
|
11918
|
-
const ownAssociations = getOwnEntityAssociations(legalEntity);
|
|
11919
|
-
return ownAssociations.filter((ea) => ea.entityType === LegalEntityType.SOLE_PROPRIETORSHIP).map((ea) => ea.legalEntityId);
|
|
11920
|
-
};
|
|
11921
|
-
const hasSolePropInLegalEntity = (legalEntity) => {
|
|
11922
|
-
var _a;
|
|
11923
|
-
return (_a = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.entityType === LegalEntityType.SOLE_PROPRIETORSHIP && ea.associatorId === legalEntity.id);
|
|
11924
|
-
};
|
|
11925
|
-
const getOwnSolePropProblems = (legalEntity, capabilityProblems) => {
|
|
11926
|
-
var _a;
|
|
11927
|
-
const solePropLegalEntityId = getOwnSoleProprietorshipIdArray(legalEntity)[0];
|
|
11928
|
-
if (solePropLegalEntityId) {
|
|
11929
|
-
return (_a = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _a[solePropLegalEntityId];
|
|
11930
|
-
}
|
|
11931
|
-
};
|
|
11932
|
-
const hasOwnEntityAssociationOfType = (type, entityAssociations, legalEntityId) => entityAssociations == null ? void 0 : entityAssociations.some((ea) => ea.type === type && ea.associatorId === legalEntityId);
|
|
11933
|
-
const removeEntityAssociationByType = (type, entityAssociations, legalEntityId) => entityAssociations == null ? void 0 : entityAssociations.filter((ea) => ea.type !== type || ea.associatorId !== legalEntityId);
|
|
11934
|
-
const isRootLegalEntity = (legalEntity, taskType) => legalEntity.type === LegalEntityType.INDIVIDUAL && taskType === TaskTypes.INDIVIDUAL || legalEntity.type === LegalEntityType.ORGANIZATION && taskType === TaskTypes.COMPANY;
|
|
11935
|
-
const filterOutUnwantedAssociationsIfRootLE = (taskType, legalEntity, accountHolder2) => {
|
|
11936
|
-
if (!(legalEntity == null ? void 0 : legalEntity.entityAssociations)) {
|
|
11937
|
-
return void 0;
|
|
11938
|
-
}
|
|
11939
|
-
let entityAssociations = getOwnEntityAssociations(legalEntity);
|
|
11940
|
-
if (!isRootLegalEntity(legalEntity, taskType)) {
|
|
11941
|
-
return entityAssociations;
|
|
11942
|
-
}
|
|
11943
|
-
if (accountHolder2 !== "mySoleProprietorName" && hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, entityAssociations, legalEntity.id)) {
|
|
11944
|
-
entityAssociations = removeEntityAssociationByType(LegalEntityType.SOLE_PROPRIETORSHIP, entityAssociations, legalEntity.id);
|
|
11945
|
-
}
|
|
11946
|
-
if (accountHolder2 !== "aTrust" && hasOwnEntityAssociationOfType(LegalEntityType.TRUST, entityAssociations, legalEntity.id)) {
|
|
11947
|
-
entityAssociations = removeEntityAssociationByType(LegalEntityType.TRUST, entityAssociations, legalEntity.id);
|
|
11948
|
-
}
|
|
11949
|
-
return entityAssociations;
|
|
11950
|
-
};
|
|
11951
|
-
var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
|
|
11952
|
-
VerificationStatus2["VALID"] = "valid";
|
|
11953
|
-
VerificationStatus2["PENDING"] = "pending";
|
|
11954
|
-
VerificationStatus2["INVALID"] = "invalid";
|
|
11955
|
-
VerificationStatus2["REJECTED"] = "rejected";
|
|
11956
|
-
return VerificationStatus2;
|
|
11957
|
-
})(VerificationStatus || {});
|
|
11958
|
-
function getNestedPropertyKeys(obj, includeUndefined = false) {
|
|
11959
|
-
const fieldNames = [];
|
|
11960
|
-
Object.entries(obj).forEach(([key, value]) => {
|
|
11961
|
-
if (typeof value === "object" && value !== null) {
|
|
11962
|
-
const nested = getNestedPropertyKeys(value).map((name) => `${key}.${name}`);
|
|
11963
|
-
fieldNames.push(...nested);
|
|
11964
|
-
return;
|
|
11965
|
-
}
|
|
11966
|
-
if (value !== void 0 || includeUndefined) {
|
|
11967
|
-
fieldNames.push(key);
|
|
11968
|
-
}
|
|
11554
|
+
var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
|
|
11555
|
+
VerificationStatus2["VALID"] = "valid";
|
|
11556
|
+
VerificationStatus2["PENDING"] = "pending";
|
|
11557
|
+
VerificationStatus2["INVALID"] = "invalid";
|
|
11558
|
+
VerificationStatus2["REJECTED"] = "rejected";
|
|
11559
|
+
return VerificationStatus2;
|
|
11560
|
+
})(VerificationStatus || {});
|
|
11561
|
+
function getNestedPropertyKeys(obj, includeUndefined = false) {
|
|
11562
|
+
const fieldNames = [];
|
|
11563
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
11564
|
+
if (typeof value === "object" && value !== null) {
|
|
11565
|
+
const nested = getNestedPropertyKeys(value).map((name) => `${key}.${name}`);
|
|
11566
|
+
fieldNames.push(...nested);
|
|
11567
|
+
return;
|
|
11568
|
+
}
|
|
11569
|
+
if (value !== void 0 || includeUndefined) {
|
|
11570
|
+
fieldNames.push(key);
|
|
11571
|
+
}
|
|
11969
11572
|
});
|
|
11970
11573
|
return fieldNames;
|
|
11971
11574
|
}
|
|
11972
|
-
const getTaskStatus = (type, capabilityProblems,
|
|
11973
|
-
if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(
|
|
11575
|
+
const getTaskStatus = (type, capabilityProblems, rootLegalEntity, entityIds, skipPendingCapabilitiesCheck = false) => {
|
|
11576
|
+
if (!(entityIds == null ? void 0 : entityIds.length) || entityIds.includes(rootLegalEntity.id) && isEmptyEntity(rootLegalEntity))
|
|
11974
11577
|
return TaskStatus.EMPTY;
|
|
11975
11578
|
const importantCapabilityStatus = checkForImportantCapabilityStatus(type, capabilityProblems, entityIds);
|
|
11976
11579
|
if (importantCapabilityStatus)
|
|
11977
11580
|
return importantCapabilityStatus;
|
|
11978
|
-
if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(
|
|
11581
|
+
if (!skipPendingCapabilitiesCheck && hasPendingCapabilities(rootLegalEntity))
|
|
11979
11582
|
return TaskStatus.PROCESSING;
|
|
11980
11583
|
return TaskStatus.FINISHED;
|
|
11981
11584
|
};
|
|
11982
11585
|
const IMPORTANT_STATUSES = [TaskStatus.DETAILS_REQUIRED, TaskStatus.DOWNLOAD, TaskStatus.ERROR, TaskStatus.PROCESSING];
|
|
11983
11586
|
function checkForImportantCapabilityStatus(type, capabilityProblems, entityIds) {
|
|
11984
|
-
if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]))
|
|
11587
|
+
if (!(capabilityProblems == null ? void 0 : capabilityProblems[type]) || !entityIds)
|
|
11985
11588
|
return;
|
|
11986
11589
|
const importantStatuses = Object.entries(capabilityProblems[type]).filter(([key]) => entityIds.includes(key)).map(([, value]) => value.status).filter((status) => IMPORTANT_STATUSES.includes(status));
|
|
11987
11590
|
if (!importantStatuses.length)
|
|
@@ -12009,7 +11612,10 @@ function isEmptyEntity(legalEntity) {
|
|
|
12009
11612
|
if ((_a = legalEntity.documentDetails) == null ? void 0 : _a.length)
|
|
12010
11613
|
return false;
|
|
12011
11614
|
const minimumFields = emptyFieldsByEntityType[type];
|
|
12012
|
-
const
|
|
11615
|
+
const typeSpecificSection = legalEntity[type];
|
|
11616
|
+
if (!typeSpecificSection)
|
|
11617
|
+
return true;
|
|
11618
|
+
const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
|
|
12013
11619
|
return !fieldsOnEntity.some((field) => !minimumFields.includes(field));
|
|
12014
11620
|
}
|
|
12015
11621
|
const entityTypeToCorrespondingAccountHolderOption = {
|
|
@@ -12213,6 +11819,7 @@ const solePropBaseMapping = {
|
|
|
12213
11819
|
"solePropRegistrationDetails.vatAbsenceReason": "soleProprietorship.vatAbsenceReason",
|
|
12214
11820
|
"solePropRegistrationDetails.exemptedFromTax": "soleProprietorship.taxAbsent",
|
|
12215
11821
|
"solePropRegistrationDetails.registrationNumber": "soleProprietorship.registrationNumber",
|
|
11822
|
+
"solePropRegistrationDetails.dateOfIncorporation": "soleProprietorship.dateOfIncorporation",
|
|
12216
11823
|
"solePropRegistrationAddress.registrationAddress.city": "soleProprietorship.registeredAddress.city",
|
|
12217
11824
|
"solePropRegistrationAddress.registrationAddress.country": "soleProprietorship.registeredAddress.country",
|
|
12218
11825
|
"solePropRegistrationAddress.registrationAddress.postalCode": "soleProprietorship.registeredAddress.postalCode",
|
|
@@ -14264,7 +13871,8 @@ function ContactDetailsComponent(props) {
|
|
|
14264
13871
|
setState: null
|
|
14265
13872
|
});
|
|
14266
13873
|
useEffect(() => {
|
|
14267
|
-
|
|
13874
|
+
var _a, _b;
|
|
13875
|
+
(_b = (_a = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
|
|
14268
13876
|
type: "addToState",
|
|
14269
13877
|
value: {
|
|
14270
13878
|
data,
|
|
@@ -14322,86 +13930,86 @@ ContactDetailsComponent.defaultProps = {
|
|
|
14322
13930
|
data: {}
|
|
14323
13931
|
};
|
|
14324
13932
|
const IdentityNumber$1 = "";
|
|
13933
|
+
const CHECKCHARACTER_ODD_VALUE = {
|
|
13934
|
+
0: 1,
|
|
13935
|
+
1: 0,
|
|
13936
|
+
2: 5,
|
|
13937
|
+
3: 7,
|
|
13938
|
+
4: 9,
|
|
13939
|
+
5: 13,
|
|
13940
|
+
6: 15,
|
|
13941
|
+
7: 17,
|
|
13942
|
+
8: 19,
|
|
13943
|
+
9: 21,
|
|
13944
|
+
A: 1,
|
|
13945
|
+
B: 0,
|
|
13946
|
+
C: 5,
|
|
13947
|
+
D: 7,
|
|
13948
|
+
E: 9,
|
|
13949
|
+
F: 13,
|
|
13950
|
+
G: 15,
|
|
13951
|
+
H: 17,
|
|
13952
|
+
I: 19,
|
|
13953
|
+
J: 21,
|
|
13954
|
+
K: 2,
|
|
13955
|
+
L: 4,
|
|
13956
|
+
M: 18,
|
|
13957
|
+
N: 20,
|
|
13958
|
+
O: 11,
|
|
13959
|
+
P: 3,
|
|
13960
|
+
Q: 6,
|
|
13961
|
+
R: 8,
|
|
13962
|
+
S: 12,
|
|
13963
|
+
T: 14,
|
|
13964
|
+
U: 16,
|
|
13965
|
+
V: 10,
|
|
13966
|
+
W: 22,
|
|
13967
|
+
X: 25,
|
|
13968
|
+
Y: 24,
|
|
13969
|
+
Z: 23
|
|
13970
|
+
};
|
|
13971
|
+
const CHECKCHARACTER_EVEN_VALUE = {
|
|
13972
|
+
0: 0,
|
|
13973
|
+
1: 1,
|
|
13974
|
+
2: 2,
|
|
13975
|
+
3: 3,
|
|
13976
|
+
4: 4,
|
|
13977
|
+
5: 5,
|
|
13978
|
+
6: 6,
|
|
13979
|
+
7: 7,
|
|
13980
|
+
8: 8,
|
|
13981
|
+
9: 9,
|
|
13982
|
+
A: 0,
|
|
13983
|
+
B: 1,
|
|
13984
|
+
C: 2,
|
|
13985
|
+
D: 3,
|
|
13986
|
+
E: 4,
|
|
13987
|
+
F: 5,
|
|
13988
|
+
G: 6,
|
|
13989
|
+
H: 7,
|
|
13990
|
+
I: 8,
|
|
13991
|
+
J: 9,
|
|
13992
|
+
K: 10,
|
|
13993
|
+
L: 11,
|
|
13994
|
+
M: 12,
|
|
13995
|
+
N: 13,
|
|
13996
|
+
O: 14,
|
|
13997
|
+
P: 15,
|
|
13998
|
+
Q: 16,
|
|
13999
|
+
R: 17,
|
|
14000
|
+
S: 18,
|
|
14001
|
+
T: 19,
|
|
14002
|
+
U: 20,
|
|
14003
|
+
V: 21,
|
|
14004
|
+
W: 22,
|
|
14005
|
+
X: 23,
|
|
14006
|
+
Y: 24,
|
|
14007
|
+
Z: 25
|
|
14008
|
+
};
|
|
14325
14009
|
function validCheckCharacter(input, calculationInput) {
|
|
14326
14010
|
if (!/^[A-Z]$/.test(input)) {
|
|
14327
14011
|
return false;
|
|
14328
14012
|
}
|
|
14329
|
-
const CHECKCHARACTER_ODD_VALUE = {
|
|
14330
|
-
0: 1,
|
|
14331
|
-
9: 21,
|
|
14332
|
-
I: 19,
|
|
14333
|
-
R: 8,
|
|
14334
|
-
1: 0,
|
|
14335
|
-
A: 1,
|
|
14336
|
-
J: 21,
|
|
14337
|
-
S: 12,
|
|
14338
|
-
2: 5,
|
|
14339
|
-
B: 0,
|
|
14340
|
-
K: 2,
|
|
14341
|
-
T: 14,
|
|
14342
|
-
3: 7,
|
|
14343
|
-
C: 5,
|
|
14344
|
-
L: 4,
|
|
14345
|
-
U: 16,
|
|
14346
|
-
4: 9,
|
|
14347
|
-
D: 7,
|
|
14348
|
-
M: 18,
|
|
14349
|
-
V: 10,
|
|
14350
|
-
5: 13,
|
|
14351
|
-
E: 9,
|
|
14352
|
-
N: 20,
|
|
14353
|
-
W: 22,
|
|
14354
|
-
6: 15,
|
|
14355
|
-
F: 13,
|
|
14356
|
-
O: 11,
|
|
14357
|
-
X: 25,
|
|
14358
|
-
7: 17,
|
|
14359
|
-
G: 15,
|
|
14360
|
-
P: 3,
|
|
14361
|
-
Y: 24,
|
|
14362
|
-
8: 19,
|
|
14363
|
-
H: 17,
|
|
14364
|
-
Q: 6,
|
|
14365
|
-
Z: 23
|
|
14366
|
-
};
|
|
14367
|
-
const CHECKCHARACTER_EVEN_VALUE = {
|
|
14368
|
-
0: 0,
|
|
14369
|
-
9: 9,
|
|
14370
|
-
I: 8,
|
|
14371
|
-
R: 17,
|
|
14372
|
-
1: 1,
|
|
14373
|
-
A: 0,
|
|
14374
|
-
J: 9,
|
|
14375
|
-
S: 18,
|
|
14376
|
-
2: 2,
|
|
14377
|
-
B: 1,
|
|
14378
|
-
K: 10,
|
|
14379
|
-
T: 19,
|
|
14380
|
-
3: 3,
|
|
14381
|
-
C: 2,
|
|
14382
|
-
L: 11,
|
|
14383
|
-
U: 20,
|
|
14384
|
-
4: 4,
|
|
14385
|
-
D: 3,
|
|
14386
|
-
M: 12,
|
|
14387
|
-
V: 21,
|
|
14388
|
-
5: 5,
|
|
14389
|
-
E: 4,
|
|
14390
|
-
N: 13,
|
|
14391
|
-
W: 22,
|
|
14392
|
-
6: 6,
|
|
14393
|
-
F: 5,
|
|
14394
|
-
O: 14,
|
|
14395
|
-
X: 23,
|
|
14396
|
-
7: 7,
|
|
14397
|
-
G: 6,
|
|
14398
|
-
P: 15,
|
|
14399
|
-
Y: 24,
|
|
14400
|
-
8: 8,
|
|
14401
|
-
H: 7,
|
|
14402
|
-
Q: 16,
|
|
14403
|
-
Z: 25
|
|
14404
|
-
};
|
|
14405
14013
|
let total = 0;
|
|
14406
14014
|
for (let i = 0; i < 15; i += 1) {
|
|
14407
14015
|
const set = i % 2 === 1 ? CHECKCHARACTER_EVEN_VALUE : CHECKCHARACTER_ODD_VALUE;
|
|
@@ -14412,14 +14020,8 @@ function validCheckCharacter(input, calculationInput) {
|
|
|
14412
14020
|
}
|
|
14413
14021
|
total = (total + value) % 26;
|
|
14414
14022
|
}
|
|
14415
|
-
|
|
14416
|
-
return true;
|
|
14417
|
-
}
|
|
14418
|
-
return false;
|
|
14023
|
+
return total >= 0 && total <= 26 && "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(total) === input;
|
|
14419
14024
|
}
|
|
14420
|
-
const helper = {
|
|
14421
|
-
validCheckCharacter
|
|
14422
|
-
};
|
|
14423
14025
|
const countryIdNumberFormatters = {
|
|
14424
14026
|
[CountryCodes.Brazil]: {
|
|
14425
14027
|
idNumber: {
|
|
@@ -14481,7 +14083,7 @@ const countryIdNumberValidationRules = {
|
|
|
14481
14083
|
},
|
|
14482
14084
|
[CountryCodes.Italy]: {
|
|
14483
14085
|
idNumber: [{
|
|
14484
|
-
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.IT.test(idNumber2) &&
|
|
14086
|
+
validate: (idNumber2) => idNumber2 ? CountryIdNumberPatterns.IT.test(idNumber2) && validCheckCharacter(idNumber2.substring(15, 16), idNumber2.substring(0, 15)) : false,
|
|
14485
14087
|
modes: ["blur"],
|
|
14486
14088
|
errorMessage: "invalidFormatIdentityNumberIT"
|
|
14487
14089
|
}]
|
|
@@ -14545,7 +14147,7 @@ function IdentityNumber(props) {
|
|
|
14545
14147
|
dataStoreId,
|
|
14546
14148
|
country: country2,
|
|
14547
14149
|
errors: propErrors,
|
|
14548
|
-
data: propData,
|
|
14150
|
+
data: propData = {},
|
|
14549
14151
|
requiredFields,
|
|
14550
14152
|
fieldValidationErrors,
|
|
14551
14153
|
maskedFields,
|
|
@@ -14689,27 +14291,101 @@ function IdentityNumber(props) {
|
|
|
14689
14291
|
});
|
|
14690
14292
|
}
|
|
14691
14293
|
const IdentityNumberComponent = memo(IdentityNumber, (prevProps, nextProps) => prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.errors, nextProps.errors) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors));
|
|
14692
|
-
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14294
|
+
const roleMetadata = {
|
|
14295
|
+
[DecisionMakerType.CONTROLLING_PERSON]: {
|
|
14296
|
+
name: "controllingPerson",
|
|
14297
|
+
description: "controllingPersonDescription",
|
|
14298
|
+
className: "adl-tag--teal"
|
|
14299
|
+
},
|
|
14300
|
+
[DecisionMakerType.OWNER]: {
|
|
14301
|
+
name: "owner",
|
|
14302
|
+
description: "ownerDescription",
|
|
14303
|
+
className: "adl-tag--purple"
|
|
14304
|
+
},
|
|
14305
|
+
[DecisionMakerType.SIGNATORY]: {
|
|
14306
|
+
name: "signatory",
|
|
14307
|
+
description: "signatoryDescription",
|
|
14308
|
+
className: "adl-tag--light-blue"
|
|
14309
|
+
},
|
|
14310
|
+
[DecisionMakerType.DIRECTOR]: {
|
|
14311
|
+
name: "director",
|
|
14312
|
+
description: "directorDescription",
|
|
14313
|
+
className: "adl-tag--orange"
|
|
14314
|
+
},
|
|
14315
|
+
[TrustMemberTypes.DEFINED_BENEFICIARY]: {
|
|
14316
|
+
name: "definedBeneficiary",
|
|
14317
|
+
description: "definedBeneficiaryDescription",
|
|
14318
|
+
className: "adl-tag--orange"
|
|
14319
|
+
},
|
|
14320
|
+
[TrustMemberTypes.UNDEFINED_BENEFICIARY]: {
|
|
14321
|
+
name: "undefinedBeneficiary",
|
|
14322
|
+
description: "undefinedBeneficiaryDescription",
|
|
14323
|
+
className: "adl-tag--orange"
|
|
14324
|
+
},
|
|
14325
|
+
[TrustMemberTypes.PROTECTOR]: {
|
|
14326
|
+
name: "protector",
|
|
14327
|
+
description: "personAppointmentUnderTrustInstrument",
|
|
14328
|
+
className: "adl-tag--orange"
|
|
14329
|
+
},
|
|
14330
|
+
[TrustMemberTypes.TRUSTEE]: {
|
|
14331
|
+
name: "trustee",
|
|
14332
|
+
description: "legalOwnerOfProperty",
|
|
14333
|
+
className: "adl-tag--light-blue"
|
|
14334
|
+
},
|
|
14335
|
+
[TrustMemberTypes.SETTLOR]: {
|
|
14336
|
+
name: "settlor",
|
|
14337
|
+
description: "entityEstablishingTrust",
|
|
14338
|
+
className: "adl-tag--orange"
|
|
14339
|
+
},
|
|
14340
|
+
[TrustMemberGuidanceLabel.BENEFICIARY]: {
|
|
14341
|
+
name: TrustMemberGuidanceLabel.BENEFICIARY,
|
|
14342
|
+
className: "adl-tag--orange"
|
|
14343
|
+
},
|
|
14344
|
+
[TrustMemberGuidanceLabel.TRUSTEE]: {
|
|
14345
|
+
name: TrustMemberGuidanceLabel.TRUSTEE,
|
|
14346
|
+
className: "adl-tag--light-blue"
|
|
14347
|
+
}
|
|
14348
|
+
};
|
|
14349
|
+
const getRoleTagColor = (role2) => {
|
|
14350
|
+
var _a;
|
|
14351
|
+
return ((_a = roleMetadata[role2]) == null ? void 0 : _a.className) ?? "adl-tag--blue";
|
|
14352
|
+
};
|
|
14353
|
+
const getRoleName = (role2) => {
|
|
14354
|
+
var _a;
|
|
14355
|
+
return ((_a = roleMetadata[role2]) == null ? void 0 : _a.name) ?? role2;
|
|
14356
|
+
};
|
|
14357
|
+
const makeSelectItemForRole = (role2, i18n) => {
|
|
14358
|
+
const metadata = roleMetadata[role2];
|
|
14359
|
+
if (!metadata)
|
|
14360
|
+
throw Error(`Cannot make select item for role "${role2}"; no metadata found. Valid roles include: ${Object.keys(roleMetadata).join("\n")}`);
|
|
14361
|
+
const {
|
|
14362
|
+
name,
|
|
14363
|
+
description: description2,
|
|
14364
|
+
className
|
|
14365
|
+
} = metadata;
|
|
14366
|
+
return {
|
|
14367
|
+
id: role2,
|
|
14368
|
+
name: i18n.get(name),
|
|
14369
|
+
description: description2 ? i18n.get(description2) : void 0,
|
|
14370
|
+
className
|
|
14371
|
+
};
|
|
14372
|
+
};
|
|
14373
|
+
const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event) => {
|
|
14374
|
+
if (propagationMode === "stop")
|
|
14375
|
+
event.stopPropagation();
|
|
14376
|
+
if (keys.includes(event.key)) {
|
|
14377
|
+
if (propagationMode === "stopIfMatches")
|
|
14378
|
+
event.stopPropagation();
|
|
14379
|
+
callback();
|
|
14380
|
+
}
|
|
14381
|
+
};
|
|
14382
|
+
const styles = {
|
|
14383
|
+
"adyen-kyc-multi-select-list": "adyen-kyc-multi-select-list",
|
|
14384
|
+
"adyen-kyc-multi-select-list-item": "adyen-kyc-multi-select-list-item",
|
|
14385
|
+
"adyen-kyc-multi-select-list-item--with-description": "adyen-kyc-multi-select-list-item--with-description",
|
|
14386
|
+
"adyen-kyc-checkbox__label": "adyen-kyc-checkbox__label"
|
|
14387
|
+
};
|
|
14388
|
+
const MultiSelectList = ({
|
|
14713
14389
|
options,
|
|
14714
14390
|
selected,
|
|
14715
14391
|
onSelect,
|
|
@@ -14769,19 +14445,10 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
14769
14445
|
defaultData: dataProp,
|
|
14770
14446
|
fieldProblems: fieldValidationErrors
|
|
14771
14447
|
});
|
|
14772
|
-
const [decisionMakerRoles2, setDecisionMakerRoles] = useState([]);
|
|
14773
14448
|
const stateRef = useRef({
|
|
14774
14449
|
setState: null
|
|
14775
14450
|
});
|
|
14776
14451
|
const formUtils = formUtilities(props, i18n);
|
|
14777
|
-
const allowedRolesString = allowedRoles == null ? void 0 : allowedRoles.toString();
|
|
14778
|
-
const makeSelectItemForDecisionMakerRole = (role2) => {
|
|
14779
|
-
const validRole = decisionMakerRoles2.find((item) => item.id === role2);
|
|
14780
|
-
return {
|
|
14781
|
-
...validRole,
|
|
14782
|
-
disabled: !(allowedRoles == null ? void 0 : allowedRoles.includes(validRole == null ? void 0 : validRole.id))
|
|
14783
|
-
};
|
|
14784
|
-
};
|
|
14785
14452
|
const changeRoles = (roles) => {
|
|
14786
14453
|
handleChangeFor("role", "input")(roles);
|
|
14787
14454
|
};
|
|
@@ -14799,9 +14466,6 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
14799
14466
|
}
|
|
14800
14467
|
});
|
|
14801
14468
|
}, [data, valid, errors, isValid, dataStoreId, fieldProblems]);
|
|
14802
|
-
useEffect(() => {
|
|
14803
|
-
setDecisionMakerRoles(getTranslatedDecisionMakerRoles(i18n, allowedRoles));
|
|
14804
|
-
}, [allowedRoles, allowedRolesString, i18n, i18n.languageCode, i18n.locale]);
|
|
14805
14469
|
return jsxs("div", {
|
|
14806
14470
|
className: "adyen-kyc-field__role",
|
|
14807
14471
|
children: [jsx(StateContextSetter, {
|
|
@@ -14818,7 +14482,10 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
14818
14482
|
options: allowedRoles ?? [],
|
|
14819
14483
|
selected: data.role ?? [],
|
|
14820
14484
|
onSelect: changeRoles,
|
|
14821
|
-
mapToSelectItem:
|
|
14485
|
+
mapToSelectItem: (role2) => ({
|
|
14486
|
+
...makeSelectItemForRole(role2, i18n),
|
|
14487
|
+
disabled: !(allowedRoles == null ? void 0 : allowedRoles.includes(role2))
|
|
14488
|
+
})
|
|
14822
14489
|
})
|
|
14823
14490
|
})]
|
|
14824
14491
|
});
|
|
@@ -14961,7 +14628,7 @@ const personalDetailsValidationRules = {
|
|
|
14961
14628
|
errorMessage: "fieldIsRequired"
|
|
14962
14629
|
}, {
|
|
14963
14630
|
modes: ["blur"],
|
|
14964
|
-
validate: (birthDate2) => birthDate2 && new Date(birthDate2) < /* @__PURE__ */ new Date(),
|
|
14631
|
+
validate: (birthDate2) => !isEmpty(birthDate2) && new Date(birthDate2) < /* @__PURE__ */ new Date(),
|
|
14965
14632
|
errorMessage: "invalidDateOfBirth"
|
|
14966
14633
|
}],
|
|
14967
14634
|
residencyCountry: {
|
|
@@ -16275,6 +15942,14 @@ function IndividualComponent(props) {
|
|
|
16275
15942
|
}
|
|
16276
15943
|
const PayoutDetails = "";
|
|
16277
15944
|
const BankVerification$2 = "";
|
|
15945
|
+
const AuthContext = createContext(void 0);
|
|
15946
|
+
const useAuthContext = () => {
|
|
15947
|
+
const authContext = useContext(AuthContext);
|
|
15948
|
+
if (!authContext) {
|
|
15949
|
+
throw new Error("Cannot use authContext without <AuthProvider>");
|
|
15950
|
+
}
|
|
15951
|
+
return authContext;
|
|
15952
|
+
};
|
|
16278
15953
|
const _actionBar_component = "";
|
|
16279
15954
|
const ActionBar = ({
|
|
16280
15955
|
onNext,
|
|
@@ -16315,6 +15990,7 @@ const ActionBar = ({
|
|
|
16315
15990
|
})]
|
|
16316
15991
|
});
|
|
16317
15992
|
var Currency = /* @__PURE__ */ ((Currency2) => {
|
|
15993
|
+
Currency2["AED"] = "AED";
|
|
16318
15994
|
Currency2["AUD"] = "AUD";
|
|
16319
15995
|
Currency2["BGN"] = "BGN";
|
|
16320
15996
|
Currency2["BRL"] = "BRL";
|
|
@@ -16325,14 +16001,16 @@ var Currency = /* @__PURE__ */ ((Currency2) => {
|
|
|
16325
16001
|
Currency2["EUR"] = "EUR";
|
|
16326
16002
|
Currency2["GBP"] = "GBP";
|
|
16327
16003
|
Currency2["HKD"] = "HKD";
|
|
16328
|
-
Currency2["HUF"] = "HUF";
|
|
16329
16004
|
Currency2["HRK"] = "HRK";
|
|
16330
|
-
Currency2["
|
|
16005
|
+
Currency2["HUF"] = "HUF";
|
|
16006
|
+
Currency2["MXN"] = "MXN";
|
|
16007
|
+
Currency2["MYR"] = "MYR";
|
|
16331
16008
|
Currency2["NOK"] = "NOK";
|
|
16332
16009
|
Currency2["NZD"] = "NZD";
|
|
16010
|
+
Currency2["PLN"] = "PLN";
|
|
16333
16011
|
Currency2["RON"] = "RON";
|
|
16334
|
-
Currency2["SGD"] = "SGD";
|
|
16335
16012
|
Currency2["SEK"] = "SEK";
|
|
16013
|
+
Currency2["SGD"] = "SGD";
|
|
16336
16014
|
Currency2["USD"] = "USD";
|
|
16337
16015
|
return Currency2;
|
|
16338
16016
|
})(Currency || {});
|
|
@@ -16364,7 +16042,9 @@ const currencyByCountry = {
|
|
|
16364
16042
|
[CountryCodes.Liechtenstein]: [Currency.CHF, Currency.EUR],
|
|
16365
16043
|
[CountryCodes.Lithuania]: [Currency.EUR],
|
|
16366
16044
|
[CountryCodes.Luxembourg]: [Currency.EUR],
|
|
16045
|
+
[CountryCodes.Malaysia]: [Currency.MYR],
|
|
16367
16046
|
[CountryCodes.Malta]: [Currency.EUR],
|
|
16047
|
+
[CountryCodes.Mexico]: [Currency.MXN],
|
|
16368
16048
|
[CountryCodes.Monaco]: [Currency.EUR],
|
|
16369
16049
|
[CountryCodes.Netherlands]: [Currency.EUR],
|
|
16370
16050
|
[CountryCodes.NewZealand]: [Currency.NZD],
|
|
@@ -16379,6 +16059,7 @@ const currencyByCountry = {
|
|
|
16379
16059
|
[CountryCodes.Spain]: [Currency.EUR],
|
|
16380
16060
|
[CountryCodes.Sweden]: [Currency.SEK, Currency.EUR],
|
|
16381
16061
|
[CountryCodes.Switzerland]: [Currency.CHF, Currency.EUR],
|
|
16062
|
+
[CountryCodes.UnitedArabEmirates]: [Currency.AED],
|
|
16382
16063
|
[CountryCodes.UnitedKingdom]: [Currency.GBP, Currency.EUR],
|
|
16383
16064
|
[CountryCodes.UnitedStates]: [Currency.USD]
|
|
16384
16065
|
};
|
|
@@ -16410,14 +16091,6 @@ const bankVerificationValidationRules = {
|
|
|
16410
16091
|
}
|
|
16411
16092
|
};
|
|
16412
16093
|
const BankVerificationWidget$1 = "";
|
|
16413
|
-
const AuthContext = createContext(void 0);
|
|
16414
|
-
const useAuthContext = () => {
|
|
16415
|
-
const authContext = useContext(AuthContext);
|
|
16416
|
-
if (!authContext) {
|
|
16417
|
-
throw new Error("Cannot use authContext without <AuthProvider>");
|
|
16418
|
-
}
|
|
16419
|
-
return authContext;
|
|
16420
|
-
};
|
|
16421
16094
|
class AdyenKycSdkError extends Error {
|
|
16422
16095
|
constructor(message, sourceError) {
|
|
16423
16096
|
super(message);
|
|
@@ -16460,13 +16133,9 @@ const refreshSession = async () => {
|
|
|
16460
16133
|
};
|
|
16461
16134
|
const addAnimationStartListener = (element, listener) => {
|
|
16462
16135
|
element.addEventListener("animationstart", listener, false);
|
|
16463
|
-
element.addEventListener("MSAnimationStart", listener, false);
|
|
16464
|
-
element.addEventListener("webkitAnimationStart", listener, false);
|
|
16465
16136
|
};
|
|
16466
16137
|
const removeAnimationStartListener = (element, listener) => {
|
|
16467
16138
|
element.removeEventListener("animationstart", listener, false);
|
|
16468
|
-
element.removeEventListener("MSAnimationStart", listener, false);
|
|
16469
|
-
element.removeEventListener("webkitAnimationStart", listener, false);
|
|
16470
16139
|
};
|
|
16471
16140
|
const logger$e = createLogger("Fetch");
|
|
16472
16141
|
const getRequestObject = (options, data) => {
|
|
@@ -16596,6 +16265,8 @@ const httpPost = async (options, data) => http({
|
|
|
16596
16265
|
}, data);
|
|
16597
16266
|
const removeElementSiblings = (element) => {
|
|
16598
16267
|
const parent = element.parentNode;
|
|
16268
|
+
if (!parent)
|
|
16269
|
+
return;
|
|
16599
16270
|
let child = parent.firstChild;
|
|
16600
16271
|
while (child) {
|
|
16601
16272
|
if (child !== element)
|
|
@@ -17053,6 +16724,9 @@ function BankVerification(props) {
|
|
|
17053
16724
|
const {
|
|
17054
16725
|
i18n
|
|
17055
16726
|
} = useI18nContext();
|
|
16727
|
+
const {
|
|
16728
|
+
isEmbeddedDropin
|
|
16729
|
+
} = useAuthContext();
|
|
17056
16730
|
const ACCOUNT_VERIFICATION = props.id;
|
|
17057
16731
|
const schema = accountVerificationFields;
|
|
17058
16732
|
const stateRef = useRef({
|
|
@@ -17129,7 +16803,9 @@ function BankVerification(props) {
|
|
|
17129
16803
|
})]
|
|
17130
16804
|
})]
|
|
17131
16805
|
}), typeof getBankVerificationVendors === "function" && formIsActive && !bankInfoValidated && jsx("div", {
|
|
17132
|
-
className: "adyen-kyc-bank-verification-container",
|
|
16806
|
+
className: cx("adyen-kyc-bank-verification-container", {
|
|
16807
|
+
"adyen-kyc-bank-verification-container__fixed": !isEmbeddedDropin
|
|
16808
|
+
}),
|
|
17133
16809
|
children: jsx(InstantBankVerification, {
|
|
17134
16810
|
getBankVerificationVendors,
|
|
17135
16811
|
retrieveBankAccountInfo,
|
|
@@ -17146,51 +16822,49 @@ const BankVerification$1 = memo(BankVerification);
|
|
|
17146
16822
|
const PayoutAccount$1 = "";
|
|
17147
16823
|
const countriesWithMultipleCurrencies = /* @__PURE__ */ new Set([CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.CzechRepublic, CountryCodes.Hungary, CountryCodes.Romania, CountryCodes.Switzerland]);
|
|
17148
16824
|
const countriesWithLocalFormat = /* @__PURE__ */ new Set([CountryCodes.Denmark, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.UnitedKingdom]);
|
|
16825
|
+
const payoutCurrencySupport = {
|
|
16826
|
+
[CountryCodes.Sweden]: {
|
|
16827
|
+
local: [Currency.SEK],
|
|
16828
|
+
iban: [Currency.EUR]
|
|
16829
|
+
},
|
|
16830
|
+
[CountryCodes.Canada]: {
|
|
16831
|
+
local: [Currency.CAD, Currency.USD],
|
|
16832
|
+
iban: [Currency.CAD, Currency.USD]
|
|
16833
|
+
}
|
|
16834
|
+
};
|
|
17149
16835
|
const shouldShowPayoutAccountFormatSelector = (country2) => countriesWithLocalFormat.has(country2);
|
|
17150
16836
|
const shouldShowPayoutAlert = (country2) => shouldShowPayoutAccountFormatSelector(country2) || countriesWithMultipleCurrencies.has(country2);
|
|
17151
16837
|
const getSupportedCurrencyGuidance = (i18n, country2, requiredFields) => {
|
|
17152
|
-
|
|
17153
|
-
if (shouldShowPayoutAlert(country2)) {
|
|
17154
|
-
|
|
17155
|
-
|
|
17156
|
-
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17160
|
-
|
|
17161
|
-
|
|
17162
|
-
|
|
17163
|
-
|
|
17164
|
-
currency: Currency.SEK
|
|
17165
|
-
}
|
|
17166
|
-
});
|
|
16838
|
+
const format = requiredFields.includes("iban") ? "iban" : "local";
|
|
16839
|
+
if (!shouldShowPayoutAlert(country2)) {
|
|
16840
|
+
return;
|
|
16841
|
+
}
|
|
16842
|
+
const supportedCurrencies = getSupportedCurrenciesPerFormat(country2, format);
|
|
16843
|
+
if (!supportedCurrencies) {
|
|
16844
|
+
return;
|
|
16845
|
+
}
|
|
16846
|
+
return supportedCurrencies.length > 1 ? i18n.get("payoutIn_Or_", {
|
|
16847
|
+
values: {
|
|
16848
|
+
currencyOne: supportedCurrencies[0],
|
|
16849
|
+
currencyTwo: supportedCurrencies[1]
|
|
17167
16850
|
}
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
currencyOne: Currency.CAD,
|
|
17172
|
-
currencyTwo: Currency.USD
|
|
17173
|
-
}
|
|
17174
|
-
});
|
|
16851
|
+
}) : i18n.get("payoutInOnly_", {
|
|
16852
|
+
values: {
|
|
16853
|
+
currency: supportedCurrencies[0]
|
|
17175
16854
|
}
|
|
16855
|
+
});
|
|
16856
|
+
};
|
|
16857
|
+
const getSupportedCurrenciesPerFormat = (country2, format) => {
|
|
16858
|
+
var _a;
|
|
16859
|
+
const supportedCurrencies = payoutCurrencySupport[country2];
|
|
16860
|
+
if (!supportedCurrencies) {
|
|
17176
16861
|
const defaultCurrency = (_a = currencyByCountry[country2]) == null ? void 0 : _a[0];
|
|
17177
16862
|
if (!defaultCurrency) {
|
|
17178
16863
|
return;
|
|
17179
16864
|
}
|
|
17180
|
-
|
|
17181
|
-
return i18n.get("payoutIn_Or_", {
|
|
17182
|
-
values: {
|
|
17183
|
-
currencyOne: Currency.EUR,
|
|
17184
|
-
currencyTwo: defaultCurrency
|
|
17185
|
-
}
|
|
17186
|
-
});
|
|
17187
|
-
}
|
|
17188
|
-
return i18n.get("payoutInOnly_", {
|
|
17189
|
-
values: {
|
|
17190
|
-
currency: defaultCurrency
|
|
17191
|
-
}
|
|
17192
|
-
});
|
|
16865
|
+
return format === "iban" ? [Currency.EUR, defaultCurrency] : [defaultCurrency];
|
|
17193
16866
|
}
|
|
16867
|
+
return supportedCurrencies[format];
|
|
17194
16868
|
};
|
|
17195
16869
|
function BankAccountFormat(props) {
|
|
17196
16870
|
const {
|
|
@@ -17226,7 +16900,6 @@ function BankAccountFormat(props) {
|
|
|
17226
16900
|
});
|
|
17227
16901
|
}
|
|
17228
16902
|
var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
17229
|
-
ExperimentNames2["EnableTrustFlow"] = "EnableTrustFlow";
|
|
17230
16903
|
ExperimentNames2["OnlyAllowAlphanumericBankAccountNumbers"] = "OnlyAllowAlphanumericBankAccountNumbers";
|
|
17231
16904
|
ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
|
|
17232
16905
|
ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
|
|
@@ -17274,7 +16947,8 @@ function BankAccountNumber(props) {
|
|
|
17274
16947
|
maskedFields: props.maskedFields
|
|
17275
16948
|
});
|
|
17276
16949
|
useEffect(() => {
|
|
17277
|
-
|
|
16950
|
+
var _a, _b;
|
|
16951
|
+
(_b = (_a = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
|
|
17278
16952
|
type: "addToState",
|
|
17279
16953
|
value: {
|
|
17280
16954
|
data,
|
|
@@ -17338,7 +17012,8 @@ function BankCity(props) {
|
|
|
17338
17012
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
17339
17013
|
});
|
|
17340
17014
|
useEffect(() => {
|
|
17341
|
-
|
|
17015
|
+
var _a, _b;
|
|
17016
|
+
(_b = (_a = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
|
|
17342
17017
|
type: "addToState",
|
|
17343
17018
|
value: {
|
|
17344
17019
|
data,
|
|
@@ -17401,7 +17076,8 @@ function BankCode(props) {
|
|
|
17401
17076
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
17402
17077
|
});
|
|
17403
17078
|
useEffect(() => {
|
|
17404
|
-
|
|
17079
|
+
var _a, _b;
|
|
17080
|
+
(_b = (_a = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
|
|
17405
17081
|
type: "addToState",
|
|
17406
17082
|
value: {
|
|
17407
17083
|
data,
|
|
@@ -17464,7 +17140,8 @@ function BankName(props) {
|
|
|
17464
17140
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
17465
17141
|
});
|
|
17466
17142
|
useEffect(() => {
|
|
17467
|
-
|
|
17143
|
+
var _a, _b;
|
|
17144
|
+
(_b = (_a = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
|
|
17468
17145
|
type: "addToState",
|
|
17469
17146
|
value: {
|
|
17470
17147
|
data,
|
|
@@ -17527,7 +17204,8 @@ function BranchCode(props) {
|
|
|
17527
17204
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
17528
17205
|
});
|
|
17529
17206
|
useEffect(() => {
|
|
17530
|
-
|
|
17207
|
+
var _a, _b;
|
|
17208
|
+
(_b = (_a = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
|
|
17531
17209
|
type: "addToState",
|
|
17532
17210
|
value: {
|
|
17533
17211
|
data,
|
|
@@ -17781,7 +17459,8 @@ function SwiftCode(props) {
|
|
|
17781
17459
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
17782
17460
|
});
|
|
17783
17461
|
useEffect(() => {
|
|
17784
|
-
|
|
17462
|
+
var _a, _b;
|
|
17463
|
+
(_b = (_a = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a.setState) == null ? void 0 : _b.call(_a, {
|
|
17785
17464
|
type: "addToState",
|
|
17786
17465
|
value: {
|
|
17787
17466
|
data,
|
|
@@ -18114,12 +17793,31 @@ var BankDocumentRequirement = /* @__PURE__ */ ((BankDocumentRequirement2) => {
|
|
|
18114
17793
|
BankDocumentRequirement2["DATE_ON_DOCUMENT"] = "dateOnDocumentNoOlderThanXMonths";
|
|
18115
17794
|
BankDocumentRequirement2["COUNTRY_OF_BANK"] = "showsCountryOfBankAccount";
|
|
18116
17795
|
BankDocumentRequirement2["OFFICIAL_DOCUMENT"] = "hasToBeOfficialDocumentFromBank";
|
|
17796
|
+
BankDocumentRequirement2["STAMP_OR_SIGNATURE"] = "hasBankStampOrBankSignature";
|
|
18117
17797
|
return BankDocumentRequirement2;
|
|
18118
17798
|
})(BankDocumentRequirement || {});
|
|
18119
|
-
const getBankDocumentRequirements = (country2) => {
|
|
17799
|
+
const getBankDocumentRequirements = (country2, documentType2) => {
|
|
17800
|
+
const requireStampOrSignature = documentType2 === BankDocumentTypes.DEPOSIT_TICKET || documentType2 === BankDocumentTypes.OFFICIAL_EMAIL;
|
|
18120
17801
|
switch (country2) {
|
|
18121
17802
|
case CountryCodes.UnitedStates:
|
|
18122
|
-
return [{
|
|
17803
|
+
return requireStampOrSignature ? [{
|
|
17804
|
+
key: BankDocumentRequirement.ACCOUNT_HOLDER
|
|
17805
|
+
}, {
|
|
17806
|
+
key: BankDocumentRequirement.ACCOUNT_NUMBER
|
|
17807
|
+
}, {
|
|
17808
|
+
key: BankDocumentRequirement.ROUTING_NUMBER
|
|
17809
|
+
}, {
|
|
17810
|
+
key: BankDocumentRequirement.DATE_ON_DOCUMENT,
|
|
17811
|
+
options: {
|
|
17812
|
+
values: {
|
|
17813
|
+
numberOfMonths: 12
|
|
17814
|
+
}
|
|
17815
|
+
}
|
|
17816
|
+
}, {
|
|
17817
|
+
key: BankDocumentRequirement.OFFICIAL_DOCUMENT
|
|
17818
|
+
}, {
|
|
17819
|
+
key: BankDocumentRequirement.STAMP_OR_SIGNATURE
|
|
17820
|
+
}] : [{
|
|
18123
17821
|
key: BankDocumentRequirement.ACCOUNT_HOLDER
|
|
18124
17822
|
}, {
|
|
18125
17823
|
key: BankDocumentRequirement.ACCOUNT_NUMBER
|
|
@@ -18136,7 +17834,24 @@ const getBankDocumentRequirements = (country2) => {
|
|
|
18136
17834
|
key: BankDocumentRequirement.OFFICIAL_DOCUMENT
|
|
18137
17835
|
}];
|
|
18138
17836
|
default:
|
|
18139
|
-
return [{
|
|
17837
|
+
return requireStampOrSignature ? [{
|
|
17838
|
+
key: BankDocumentRequirement.ACCOUNT_HOLDER
|
|
17839
|
+
}, {
|
|
17840
|
+
key: BankDocumentRequirement.ACCOUNT_NUMBER_OR_IBAN
|
|
17841
|
+
}, {
|
|
17842
|
+
key: BankDocumentRequirement.DATE_ON_DOCUMENT,
|
|
17843
|
+
options: {
|
|
17844
|
+
values: {
|
|
17845
|
+
numberOfMonths: 12
|
|
17846
|
+
}
|
|
17847
|
+
}
|
|
17848
|
+
}, {
|
|
17849
|
+
key: BankDocumentRequirement.COUNTRY_OF_BANK
|
|
17850
|
+
}, {
|
|
17851
|
+
key: BankDocumentRequirement.OFFICIAL_DOCUMENT
|
|
17852
|
+
}, {
|
|
17853
|
+
key: BankDocumentRequirement.STAMP_OR_SIGNATURE
|
|
17854
|
+
}] : [{
|
|
18140
17855
|
key: BankDocumentRequirement.ACCOUNT_HOLDER
|
|
18141
17856
|
}, {
|
|
18142
17857
|
key: BankDocumentRequirement.ACCOUNT_NUMBER_OR_IBAN
|
|
@@ -18155,7 +17870,8 @@ const getBankDocumentRequirements = (country2) => {
|
|
|
18155
17870
|
}
|
|
18156
17871
|
};
|
|
18157
17872
|
const BankDocumentRequirements = ({
|
|
18158
|
-
country: country2
|
|
17873
|
+
country: country2,
|
|
17874
|
+
documentType: documentType2
|
|
18159
17875
|
}) => {
|
|
18160
17876
|
const {
|
|
18161
17877
|
i18n
|
|
@@ -18166,7 +17882,7 @@ const BankDocumentRequirements = ({
|
|
|
18166
17882
|
children: [" ", i18n.get("requirements")]
|
|
18167
17883
|
}), jsx(List, {
|
|
18168
17884
|
className: "adyen-kyc-upload-field__requirements",
|
|
18169
|
-
children: getBankDocumentRequirements(country2).map(({
|
|
17885
|
+
children: getBankDocumentRequirements(country2, documentType2).map(({
|
|
18170
17886
|
key,
|
|
18171
17887
|
options
|
|
18172
17888
|
}) => jsx(ListItem, {
|
|
@@ -18297,7 +18013,8 @@ function PayoutBankStatementComponent(props) {
|
|
|
18297
18013
|
})
|
|
18298
18014
|
}), documentType2 ? jsxs(Fragment, {
|
|
18299
18015
|
children: [country2 ? jsx(BankDocumentRequirements, {
|
|
18300
|
-
country: country2
|
|
18016
|
+
country: country2,
|
|
18017
|
+
documentType: documentType2
|
|
18301
18018
|
}) : void 0, jsx(DocumentGuidance, {
|
|
18302
18019
|
type: DocumentType.BANK_STATEMENT,
|
|
18303
18020
|
className: "adl-u-margin-y-24"
|
|
@@ -18772,27 +18489,58 @@ function PayoutDetailsComponent(props) {
|
|
|
18772
18489
|
var ConstitutionalDocumentTypes = /* @__PURE__ */ ((ConstitutionalDocumentTypes2) => {
|
|
18773
18490
|
ConstitutionalDocumentTypes2["BUSINESS_NAME_FILING"] = "doingBusinessAsNameFiling";
|
|
18774
18491
|
ConstitutionalDocumentTypes2["TAX_FILING"] = "taxFiling";
|
|
18492
|
+
ConstitutionalDocumentTypes2["EMPLOYER_IDENTIFICATION_NUMBER_VERIFICATION_LETTER"] = "einVerificationLetter";
|
|
18493
|
+
ConstitutionalDocumentTypes2["BUSINESS_REGISTRATION_DOCUMENT"] = "businessRegistrationDocument";
|
|
18775
18494
|
ConstitutionalDocumentTypes2["TRUST_DEED"] = "trustDeed";
|
|
18776
18495
|
ConstitutionalDocumentTypes2["TRUST_INSTRUMENT"] = "trustInstrument";
|
|
18777
18496
|
return ConstitutionalDocumentTypes2;
|
|
18778
18497
|
})(ConstitutionalDocumentTypes || {});
|
|
18779
|
-
const
|
|
18780
|
-
|
|
18781
|
-
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
18793
|
-
|
|
18498
|
+
const getConstitutionDocumentTypeOptionsMapping = (legalEntityType, country2) => {
|
|
18499
|
+
switch (legalEntityType) {
|
|
18500
|
+
case LegalEntityType.SOLE_PROPRIETORSHIP:
|
|
18501
|
+
switch (country2) {
|
|
18502
|
+
case "FR":
|
|
18503
|
+
return [{
|
|
18504
|
+
id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
|
|
18505
|
+
name: "doingBusinessAsNameFiling__FR"
|
|
18506
|
+
}, {
|
|
18507
|
+
id: ConstitutionalDocumentTypes.TAX_FILING,
|
|
18508
|
+
name: "taxFiling"
|
|
18509
|
+
}, {
|
|
18510
|
+
id: ConstitutionalDocumentTypes.BUSINESS_REGISTRATION_DOCUMENT,
|
|
18511
|
+
name: "businessRegistrationDocument__FR"
|
|
18512
|
+
}];
|
|
18513
|
+
case "US":
|
|
18514
|
+
return [{
|
|
18515
|
+
id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
|
|
18516
|
+
name: "doingBusinessAsNameFiling__US"
|
|
18517
|
+
}, {
|
|
18518
|
+
id: ConstitutionalDocumentTypes.TAX_FILING,
|
|
18519
|
+
name: "taxFiling__US"
|
|
18520
|
+
}, {
|
|
18521
|
+
id: ConstitutionalDocumentTypes.EMPLOYER_IDENTIFICATION_NUMBER_VERIFICATION_LETTER,
|
|
18522
|
+
name: "einVerificationLetter"
|
|
18523
|
+
}];
|
|
18524
|
+
default:
|
|
18525
|
+
return [{
|
|
18526
|
+
id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
|
|
18527
|
+
name: "doingBusinessAsNameFiling"
|
|
18528
|
+
}, {
|
|
18529
|
+
id: ConstitutionalDocumentTypes.TAX_FILING,
|
|
18530
|
+
name: "taxFiling"
|
|
18531
|
+
}];
|
|
18532
|
+
}
|
|
18533
|
+
default:
|
|
18534
|
+
return [{
|
|
18535
|
+
id: ConstitutionalDocumentTypes.TRUST_DEED,
|
|
18536
|
+
name: "trustDeed"
|
|
18537
|
+
}, {
|
|
18538
|
+
id: ConstitutionalDocumentTypes.TRUST_INSTRUMENT,
|
|
18539
|
+
name: "trustInstrument"
|
|
18540
|
+
}];
|
|
18541
|
+
}
|
|
18794
18542
|
};
|
|
18795
|
-
function
|
|
18543
|
+
function ConstitutionalDocumentUpload({
|
|
18796
18544
|
id: id2,
|
|
18797
18545
|
legalEntityType,
|
|
18798
18546
|
...props
|
|
@@ -18801,27 +18549,24 @@ function ConstitutionalDocumentComponent({
|
|
|
18801
18549
|
const {
|
|
18802
18550
|
i18n
|
|
18803
18551
|
} = useI18nContext();
|
|
18804
|
-
const guidanceContent = jsxs(
|
|
18805
|
-
|
|
18552
|
+
const guidanceContent = jsxs("div", {
|
|
18553
|
+
className: "adyen-kyc-upload-field__guidance",
|
|
18554
|
+
children: [jsx("strong", {
|
|
18806
18555
|
className: "adyen-kyc-upload-field__subtitle",
|
|
18807
|
-
children: i18n.get("
|
|
18556
|
+
children: i18n.get("uploadOneOfTheseDocuments")
|
|
18808
18557
|
}), jsx(List, {
|
|
18809
18558
|
className: "adl-u-margin-left-8",
|
|
18810
|
-
children: (_a =
|
|
18559
|
+
children: (_a = getConstitutionDocumentTypeOptionsMapping(legalEntityType, props.country)) == null ? void 0 : _a.map(({
|
|
18811
18560
|
id: id22,
|
|
18812
18561
|
name
|
|
18813
18562
|
}) => jsx(ListItem, {
|
|
18814
18563
|
children: i18n.get(name)
|
|
18815
18564
|
}, id22))
|
|
18816
|
-
}),
|
|
18565
|
+
}), jsx("div", {
|
|
18817
18566
|
className: "adl-u-margin-y-16",
|
|
18818
|
-
children:
|
|
18567
|
+
children: jsxs("span", {
|
|
18819
18568
|
children: [i18n.get("documentIssuedWithinLastYear"), " "]
|
|
18820
|
-
})
|
|
18821
|
-
href: "https://docs.adyen.com/marketplaces-and-platforms/required-kyc-information/document-requirements#constitutional-doc",
|
|
18822
|
-
external: true,
|
|
18823
|
-
children: i18n.get("learnMore")
|
|
18824
|
-
})]
|
|
18569
|
+
})
|
|
18825
18570
|
})]
|
|
18826
18571
|
});
|
|
18827
18572
|
return jsx("div", {
|
|
@@ -18829,13 +18574,14 @@ function ConstitutionalDocumentComponent({
|
|
|
18829
18574
|
...props,
|
|
18830
18575
|
documentType: DocumentType.CONSTITUTIONAL_DOCUMENT,
|
|
18831
18576
|
documentField: "constitutionalDocument",
|
|
18832
|
-
heading: i18n.get("
|
|
18577
|
+
heading: i18n.get("constitutionalDocument__header"),
|
|
18578
|
+
description: i18n.get("constitutionalDocument__headerDescription"),
|
|
18833
18579
|
guidanceContent,
|
|
18834
18580
|
id: id2
|
|
18835
18581
|
})
|
|
18836
18582
|
});
|
|
18837
18583
|
}
|
|
18838
|
-
const
|
|
18584
|
+
const ConstitutionalDocumentComponent = memo(ConstitutionalDocumentUpload, (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.shouldValidate === nextProps.shouldValidate);
|
|
18839
18585
|
const solePropForms = {
|
|
18840
18586
|
solePropNameAndCountry: {
|
|
18841
18587
|
formId: "solePropNameAndCountry",
|
|
@@ -18858,93 +18604,415 @@ const solePropForms = {
|
|
|
18858
18604
|
fields: ["constitutionalDocument"]
|
|
18859
18605
|
}
|
|
18860
18606
|
};
|
|
18861
|
-
const solePropNameAndCountryFormId = solePropForms.solePropNameAndCountry.formId;
|
|
18862
|
-
const solePropRegistrationAddressFormId = solePropForms.solePropRegistrationAddress.formId;
|
|
18863
|
-
const solePropRegistrationDetailsFormId = solePropForms.solePropRegistrationDetails.formId;
|
|
18864
|
-
const solePropDocumentFormId = solePropForms.solePropConstitutionalDocument.formId;
|
|
18865
|
-
function SolePropComponent(props) {
|
|
18866
|
-
const {
|
|
18867
|
-
i18n
|
|
18868
|
-
} = useI18nContext();
|
|
18869
|
-
const {
|
|
18870
|
-
isExperimentEnabled
|
|
18871
|
-
} = useExperimentsContext();
|
|
18872
|
-
const [tradingName2, setTradingName] = useState();
|
|
18873
|
-
const solePropNameAndCountryFormProps = getFormProps(props, solePropNameAndCountryFormId);
|
|
18874
|
-
const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
|
|
18875
|
-
const solePropRegistrationAddressFormProps = getFormProps(props, solePropRegistrationAddressFormId);
|
|
18876
|
-
const solePropDocumentsFormProps = getFormProps(props, solePropDocumentFormId);
|
|
18877
|
-
const handleStateChange = ({
|
|
18878
|
-
currentState
|
|
18879
|
-
}) => {
|
|
18880
|
-
var _a, _b, _c;
|
|
18881
|
-
const legalCompanyName2 = (_b = (_a = currentState.data) == null ? void 0 : _a.solePropNameAndCountry) == null ? void 0 : _b.legalCompanyName;
|
|
18882
|
-
setTradingName(((_c = solePropsRegistrationDetailsFormProps == null ? void 0 : solePropsRegistrationDetailsFormProps.data) == null ? void 0 : _c.tradingName) || legalCompanyName2);
|
|
18883
|
-
};
|
|
18884
|
-
const renderActiveForm = (activeForm) => {
|
|
18885
|
-
var _a;
|
|
18886
|
-
return jsxs(Fragment, {
|
|
18887
|
-
children: [jsx(StateContextWatcher, {
|
|
18888
|
-
owner: "SolePropComponent",
|
|
18889
|
-
onChange: handleStateChange
|
|
18890
|
-
}), jsx("div", {
|
|
18891
|
-
className: activeForm.formId !== solePropNameAndCountryFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18892
|
-
children: jsx(CompanyNameAndCountryComponent, {
|
|
18893
|
-
...solePropNameAndCountryFormProps,
|
|
18894
|
-
data: {
|
|
18895
|
-
...solePropNameAndCountryFormProps == null ? void 0 : solePropNameAndCountryFormProps.data,
|
|
18896
|
-
country: props == null ? void 0 : props.country,
|
|
18897
|
-
legalCompanyName: (_a = solePropNameAndCountryFormProps == null ? void 0 : solePropNameAndCountryFormProps.data) == null ? void 0 : _a.legalCompanyName
|
|
18898
|
-
},
|
|
18899
|
-
labels: {
|
|
18900
|
-
country: "countryOfEstablishment",
|
|
18901
|
-
legalCompanyName: isExperimentEnabled("EnableNewEntryFlow") ? "legalNameOfSoleProprietorship" : "legalNameOfSoleProprietor"
|
|
18902
|
-
},
|
|
18903
|
-
heading: i18n.get("nameAndCountry"),
|
|
18904
|
-
id: solePropNameAndCountryFormId,
|
|
18905
|
-
disableCountry: true,
|
|
18906
|
-
isTopLevelEntity: false
|
|
18907
|
-
})
|
|
18908
|
-
}), jsx("div", {
|
|
18909
|
-
className: activeForm.formId !== solePropRegistrationDetailsFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18910
|
-
children: jsx(CompanyRegistrationDetailsComponent, {
|
|
18911
|
-
...solePropsRegistrationDetailsFormProps,
|
|
18912
|
-
data: {
|
|
18913
|
-
...solePropsRegistrationDetailsFormProps == null ? void 0 : solePropsRegistrationDetailsFormProps.data,
|
|
18914
|
-
tradingName: tradingName2
|
|
18915
|
-
},
|
|
18916
|
-
heading: i18n.get("registrationDetails"),
|
|
18917
|
-
id: solePropRegistrationDetailsFormId,
|
|
18918
|
-
companyType: CompanyTypesValue.SOLE_PROPRIETORSHIP,
|
|
18919
|
-
country: props.country
|
|
18920
|
-
})
|
|
18921
|
-
}), jsx("div", {
|
|
18922
|
-
className: activeForm.formId !== solePropRegistrationAddressFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18923
|
-
children: jsx(RegistrationAddressComponent, {
|
|
18924
|
-
...solePropRegistrationAddressFormProps,
|
|
18925
|
-
heading: i18n.get("registeredAddress"),
|
|
18926
|
-
id: solePropRegistrationAddressFormId,
|
|
18927
|
-
country: props.country,
|
|
18928
|
-
problems: props == null ? void 0 : props.problems,
|
|
18929
|
-
handleAddressSearch: props.handleAddressSearch,
|
|
18930
|
-
handleFindAddress: props.handleFindAddress
|
|
18931
|
-
})
|
|
18932
|
-
}), jsx("div", {
|
|
18933
|
-
className: activeForm.formId !== solePropDocumentFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18934
|
-
children: jsx(
|
|
18935
|
-
...solePropDocumentsFormProps,
|
|
18936
|
-
id: solePropDocumentFormId,
|
|
18937
|
-
legalEntityType: LegalEntityType.SOLE_PROPRIETORSHIP
|
|
18938
|
-
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18942
|
-
|
|
18943
|
-
|
|
18944
|
-
|
|
18607
|
+
const solePropNameAndCountryFormId = solePropForms.solePropNameAndCountry.formId;
|
|
18608
|
+
const solePropRegistrationAddressFormId = solePropForms.solePropRegistrationAddress.formId;
|
|
18609
|
+
const solePropRegistrationDetailsFormId = solePropForms.solePropRegistrationDetails.formId;
|
|
18610
|
+
const solePropDocumentFormId = solePropForms.solePropConstitutionalDocument.formId;
|
|
18611
|
+
function SolePropComponent(props) {
|
|
18612
|
+
const {
|
|
18613
|
+
i18n
|
|
18614
|
+
} = useI18nContext();
|
|
18615
|
+
const {
|
|
18616
|
+
isExperimentEnabled
|
|
18617
|
+
} = useExperimentsContext();
|
|
18618
|
+
const [tradingName2, setTradingName] = useState();
|
|
18619
|
+
const solePropNameAndCountryFormProps = getFormProps(props, solePropNameAndCountryFormId);
|
|
18620
|
+
const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
|
|
18621
|
+
const solePropRegistrationAddressFormProps = getFormProps(props, solePropRegistrationAddressFormId);
|
|
18622
|
+
const solePropDocumentsFormProps = getFormProps(props, solePropDocumentFormId);
|
|
18623
|
+
const handleStateChange = ({
|
|
18624
|
+
currentState
|
|
18625
|
+
}) => {
|
|
18626
|
+
var _a, _b, _c;
|
|
18627
|
+
const legalCompanyName2 = (_b = (_a = currentState.data) == null ? void 0 : _a.solePropNameAndCountry) == null ? void 0 : _b.legalCompanyName;
|
|
18628
|
+
setTradingName(((_c = solePropsRegistrationDetailsFormProps == null ? void 0 : solePropsRegistrationDetailsFormProps.data) == null ? void 0 : _c.tradingName) || legalCompanyName2);
|
|
18629
|
+
};
|
|
18630
|
+
const renderActiveForm = (activeForm) => {
|
|
18631
|
+
var _a;
|
|
18632
|
+
return jsxs(Fragment, {
|
|
18633
|
+
children: [jsx(StateContextWatcher, {
|
|
18634
|
+
owner: "SolePropComponent",
|
|
18635
|
+
onChange: handleStateChange
|
|
18636
|
+
}), jsx("div", {
|
|
18637
|
+
className: activeForm.formId !== solePropNameAndCountryFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18638
|
+
children: jsx(CompanyNameAndCountryComponent, {
|
|
18639
|
+
...solePropNameAndCountryFormProps,
|
|
18640
|
+
data: {
|
|
18641
|
+
...solePropNameAndCountryFormProps == null ? void 0 : solePropNameAndCountryFormProps.data,
|
|
18642
|
+
country: props == null ? void 0 : props.country,
|
|
18643
|
+
legalCompanyName: (_a = solePropNameAndCountryFormProps == null ? void 0 : solePropNameAndCountryFormProps.data) == null ? void 0 : _a.legalCompanyName
|
|
18644
|
+
},
|
|
18645
|
+
labels: {
|
|
18646
|
+
country: "countryOfEstablishment",
|
|
18647
|
+
legalCompanyName: isExperimentEnabled("EnableNewEntryFlow") ? "legalNameOfSoleProprietorship" : "legalNameOfSoleProprietor"
|
|
18648
|
+
},
|
|
18649
|
+
heading: i18n.get("nameAndCountry"),
|
|
18650
|
+
id: solePropNameAndCountryFormId,
|
|
18651
|
+
disableCountry: true,
|
|
18652
|
+
isTopLevelEntity: false
|
|
18653
|
+
})
|
|
18654
|
+
}), jsx("div", {
|
|
18655
|
+
className: activeForm.formId !== solePropRegistrationDetailsFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18656
|
+
children: jsx(CompanyRegistrationDetailsComponent, {
|
|
18657
|
+
...solePropsRegistrationDetailsFormProps,
|
|
18658
|
+
data: {
|
|
18659
|
+
...solePropsRegistrationDetailsFormProps == null ? void 0 : solePropsRegistrationDetailsFormProps.data,
|
|
18660
|
+
tradingName: tradingName2
|
|
18661
|
+
},
|
|
18662
|
+
heading: i18n.get("registrationDetails"),
|
|
18663
|
+
id: solePropRegistrationDetailsFormId,
|
|
18664
|
+
companyType: CompanyTypesValue.SOLE_PROPRIETORSHIP,
|
|
18665
|
+
country: props.country
|
|
18666
|
+
})
|
|
18667
|
+
}), jsx("div", {
|
|
18668
|
+
className: activeForm.formId !== solePropRegistrationAddressFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18669
|
+
children: jsx(RegistrationAddressComponent, {
|
|
18670
|
+
...solePropRegistrationAddressFormProps,
|
|
18671
|
+
heading: i18n.get("registeredAddress"),
|
|
18672
|
+
id: solePropRegistrationAddressFormId,
|
|
18673
|
+
country: props.country,
|
|
18674
|
+
problems: props == null ? void 0 : props.problems,
|
|
18675
|
+
handleAddressSearch: props.handleAddressSearch,
|
|
18676
|
+
handleFindAddress: props.handleFindAddress
|
|
18677
|
+
})
|
|
18678
|
+
}), jsx("div", {
|
|
18679
|
+
className: activeForm.formId !== solePropDocumentFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
18680
|
+
children: jsx(ConstitutionalDocumentComponent, {
|
|
18681
|
+
...solePropDocumentsFormProps,
|
|
18682
|
+
id: solePropDocumentFormId,
|
|
18683
|
+
legalEntityType: LegalEntityType.SOLE_PROPRIETORSHIP,
|
|
18684
|
+
country: props.country
|
|
18685
|
+
})
|
|
18686
|
+
})]
|
|
18687
|
+
});
|
|
18688
|
+
};
|
|
18689
|
+
return jsx("div", {
|
|
18690
|
+
className: "adyen-kyc-sol-prop",
|
|
18691
|
+
children: renderActiveForm(props.activeForm || solePropForms.solePropNameAndCountry)
|
|
18692
|
+
});
|
|
18693
|
+
}
|
|
18694
|
+
const Trust = "";
|
|
18695
|
+
var TrustTypes = /* @__PURE__ */ ((TrustTypes2) => {
|
|
18696
|
+
TrustTypes2["BUSINESS_TRUST"] = "businessTrust";
|
|
18697
|
+
TrustTypes2["CASH_MANAGEMENT_TRUST"] = "cashManagementTrust";
|
|
18698
|
+
TrustTypes2["CHARITABLE_TRUST"] = "charitableTrust";
|
|
18699
|
+
TrustTypes2["CORPORATE_UNIT_TRUST"] = "corporateUnitTrust";
|
|
18700
|
+
TrustTypes2["DECEASED_ESTATE"] = "deceasedEstate";
|
|
18701
|
+
TrustTypes2["DISCRETIONARY_INVESTMENT_TRUST"] = "discretionaryInvestmentTrust";
|
|
18702
|
+
TrustTypes2["DISCRETIONARY_SERVICES_MANAGEMENT_TRUST"] = "discretionaryServicesManagementTrust";
|
|
18703
|
+
TrustTypes2["DISCRETIONARY_TRADING_TRUST"] = "discretionaryTradingTrust";
|
|
18704
|
+
TrustTypes2["DISCRETIONARY_TRUST"] = "discretionaryTrust";
|
|
18705
|
+
TrustTypes2["FAMILY_TRUST"] = "familyTrust";
|
|
18706
|
+
TrustTypes2["FIRST_HOME_SAVER_ACCOUNTS_TRUST"] = "firstHomeSaverAccountsTrust";
|
|
18707
|
+
TrustTypes2["FIXED_TRUST"] = "fixedTrust";
|
|
18708
|
+
TrustTypes2["FIXED_UNIT_TRUST"] = "fixedUnitTrust";
|
|
18709
|
+
TrustTypes2["HYBRID_TRUST"] = "hybridTrust";
|
|
18710
|
+
TrustTypes2["LISTED_PUBLIC_UNIT_TRUST"] = "listedPublicUnitTrust";
|
|
18711
|
+
TrustTypes2["OTHER_TRUST"] = "otherTrust";
|
|
18712
|
+
TrustTypes2["POOLED_SUPERANNUATION_TRUST"] = "pooledSuperannuationTrust";
|
|
18713
|
+
TrustTypes2["PUBLIC_TRADING_TRUST"] = "publicTradingTrust";
|
|
18714
|
+
TrustTypes2["UNLISTED_PUBLIC_UNIT_TRUST"] = "unlistedPublicUnitTrust";
|
|
18715
|
+
return TrustTypes2;
|
|
18716
|
+
})(TrustTypes || {});
|
|
18717
|
+
const trustTypeOptions = [{
|
|
18718
|
+
id: TrustTypes.BUSINESS_TRUST,
|
|
18719
|
+
name: "businessTrust"
|
|
18720
|
+
}, {
|
|
18721
|
+
id: TrustTypes.CASH_MANAGEMENT_TRUST,
|
|
18722
|
+
name: "cashManagementTrust"
|
|
18723
|
+
}, {
|
|
18724
|
+
id: TrustTypes.CHARITABLE_TRUST,
|
|
18725
|
+
name: "charitableTrust"
|
|
18726
|
+
}, {
|
|
18727
|
+
id: TrustTypes.CORPORATE_UNIT_TRUST,
|
|
18728
|
+
name: "corporateUnitTrust"
|
|
18729
|
+
}, {
|
|
18730
|
+
id: TrustTypes.DECEASED_ESTATE,
|
|
18731
|
+
name: "deceasedEstate"
|
|
18732
|
+
}, {
|
|
18733
|
+
id: TrustTypes.DISCRETIONARY_INVESTMENT_TRUST,
|
|
18734
|
+
name: "discretionaryInvestmentTrust"
|
|
18735
|
+
}, {
|
|
18736
|
+
id: TrustTypes.DISCRETIONARY_SERVICES_MANAGEMENT_TRUST,
|
|
18737
|
+
name: "discretionaryServicesManagementTrust"
|
|
18738
|
+
}, {
|
|
18739
|
+
id: TrustTypes.DISCRETIONARY_TRADING_TRUST,
|
|
18740
|
+
name: "discretionaryTradingTrust"
|
|
18741
|
+
}, {
|
|
18742
|
+
id: TrustTypes.DISCRETIONARY_TRUST,
|
|
18743
|
+
name: "discretionaryTrust"
|
|
18744
|
+
}, {
|
|
18745
|
+
id: TrustTypes.FAMILY_TRUST,
|
|
18746
|
+
name: "familyTrust"
|
|
18747
|
+
}, {
|
|
18748
|
+
id: TrustTypes.FIRST_HOME_SAVER_ACCOUNTS_TRUST,
|
|
18749
|
+
name: "firstHomeSaverAccountsTrust"
|
|
18750
|
+
}, {
|
|
18751
|
+
id: TrustTypes.FIXED_TRUST,
|
|
18752
|
+
name: "fixedTrust"
|
|
18753
|
+
}, {
|
|
18754
|
+
id: TrustTypes.FIXED_UNIT_TRUST,
|
|
18755
|
+
name: "fixedUnitTrust"
|
|
18756
|
+
}, {
|
|
18757
|
+
id: TrustTypes.HYBRID_TRUST,
|
|
18758
|
+
name: "hybridTrust"
|
|
18759
|
+
}, {
|
|
18760
|
+
id: TrustTypes.LISTED_PUBLIC_UNIT_TRUST,
|
|
18761
|
+
name: "listedPublicUnitTrust"
|
|
18762
|
+
}, {
|
|
18763
|
+
id: TrustTypes.OTHER_TRUST,
|
|
18764
|
+
name: "otherTrust"
|
|
18765
|
+
}, {
|
|
18766
|
+
id: TrustTypes.POOLED_SUPERANNUATION_TRUST,
|
|
18767
|
+
name: "pooledSuperannuationTrust"
|
|
18768
|
+
}, {
|
|
18769
|
+
id: TrustTypes.PUBLIC_TRADING_TRUST,
|
|
18770
|
+
name: "publicTradingTrust"
|
|
18771
|
+
}, {
|
|
18772
|
+
id: TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST,
|
|
18773
|
+
name: "unlistedPublicUnitTrust"
|
|
18774
|
+
}];
|
|
18775
|
+
const nzSpecificTrustTypes = [TrustTypes.DISCRETIONARY_TRUST, TrustTypes.FAMILY_TRUST, TrustTypes.CHARITABLE_TRUST, TrustTypes.BUSINESS_TRUST, TrustTypes.OTHER_TRUST];
|
|
18776
|
+
const auSpecificTrustTypes = [TrustTypes.CASH_MANAGEMENT_TRUST, TrustTypes.CORPORATE_UNIT_TRUST, TrustTypes.DECEASED_ESTATE, TrustTypes.DISCRETIONARY_INVESTMENT_TRUST, TrustTypes.DISCRETIONARY_SERVICES_MANAGEMENT_TRUST, TrustTypes.DISCRETIONARY_TRADING_TRUST, TrustTypes.FIRST_HOME_SAVER_ACCOUNTS_TRUST, TrustTypes.FIXED_TRUST, TrustTypes.FIXED_UNIT_TRUST, TrustTypes.HYBRID_TRUST, TrustTypes.LISTED_PUBLIC_UNIT_TRUST, TrustTypes.OTHER_TRUST, TrustTypes.POOLED_SUPERANNUATION_TRUST, TrustTypes.PUBLIC_TRADING_TRUST, TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST];
|
|
18777
|
+
const countryToTrustTypes = {
|
|
18778
|
+
[CountryCodes.Australia]: auSpecificTrustTypes,
|
|
18779
|
+
[CountryCodes.NewZealand]: nzSpecificTrustTypes
|
|
18780
|
+
};
|
|
18781
|
+
const DEFAULT_DECISION_MAKER_REQUIREMENTS = [{
|
|
18782
|
+
roleTypes: [DecisionMakerType.OWNER, DecisionMakerType.CONTROLLING_PERSON],
|
|
18783
|
+
min: 1,
|
|
18784
|
+
max: Infinity
|
|
18785
|
+
}, {
|
|
18786
|
+
roleTypes: [DecisionMakerType.OWNER],
|
|
18787
|
+
min: 0,
|
|
18788
|
+
max: 4
|
|
18789
|
+
}, {
|
|
18790
|
+
roleTypes: [DecisionMakerType.CONTROLLING_PERSON],
|
|
18791
|
+
min: 0,
|
|
18792
|
+
max: Infinity
|
|
18793
|
+
}, {
|
|
18794
|
+
roleTypes: [DecisionMakerType.SIGNATORY],
|
|
18795
|
+
min: 1,
|
|
18796
|
+
max: Infinity
|
|
18797
|
+
}];
|
|
18798
|
+
const PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES = {
|
|
18799
|
+
US: [{
|
|
18800
|
+
roleTypes: [DecisionMakerType.CONTROLLING_PERSON],
|
|
18801
|
+
min: 1,
|
|
18802
|
+
max: Infinity
|
|
18803
|
+
}, {
|
|
18804
|
+
roleTypes: [DecisionMakerType.OWNER],
|
|
18805
|
+
min: 0,
|
|
18806
|
+
max: 4
|
|
18807
|
+
}, {
|
|
18808
|
+
roleTypes: [DecisionMakerType.SIGNATORY],
|
|
18809
|
+
min: 1,
|
|
18810
|
+
max: Infinity
|
|
18811
|
+
}],
|
|
18812
|
+
BR: [{
|
|
18813
|
+
roleTypes: [DecisionMakerType.CONTROLLING_PERSON],
|
|
18814
|
+
min: 1,
|
|
18815
|
+
max: Infinity
|
|
18816
|
+
}, {
|
|
18817
|
+
roleTypes: [DecisionMakerType.OWNER],
|
|
18818
|
+
min: 0,
|
|
18819
|
+
max: 4
|
|
18820
|
+
}, {
|
|
18821
|
+
roleTypes: [DecisionMakerType.SIGNATORY],
|
|
18822
|
+
min: 1,
|
|
18823
|
+
max: Infinity
|
|
18824
|
+
}],
|
|
18825
|
+
AU: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
18826
|
+
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
18827
|
+
min: 3,
|
|
18828
|
+
max: Infinity
|
|
18829
|
+
}],
|
|
18830
|
+
CA: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
18831
|
+
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
18832
|
+
min: 1,
|
|
18833
|
+
max: Infinity
|
|
18834
|
+
}],
|
|
18835
|
+
HK: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
18836
|
+
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
18837
|
+
min: 1,
|
|
18838
|
+
max: Infinity
|
|
18839
|
+
}],
|
|
18840
|
+
IN: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
18841
|
+
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
18842
|
+
min: 3,
|
|
18843
|
+
max: 15
|
|
18844
|
+
}],
|
|
18845
|
+
NZ: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
18846
|
+
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
18847
|
+
min: 1,
|
|
18848
|
+
max: Infinity
|
|
18849
|
+
}],
|
|
18850
|
+
SG: [...DEFAULT_DECISION_MAKER_REQUIREMENTS, {
|
|
18851
|
+
roleTypes: [DecisionMakerType.DIRECTOR],
|
|
18852
|
+
min: 1,
|
|
18853
|
+
max: Infinity
|
|
18854
|
+
}]
|
|
18855
|
+
};
|
|
18856
|
+
const getDecisionMakerRequirements = (country2) => {
|
|
18857
|
+
if (!country2)
|
|
18858
|
+
return DEFAULT_DECISION_MAKER_REQUIREMENTS;
|
|
18859
|
+
return PER_COUNTRY_DECISION_MAKER_REQUIREMENTS_OVERRIDES[country2] ?? DEFAULT_DECISION_MAKER_REQUIREMENTS;
|
|
18860
|
+
};
|
|
18861
|
+
function getAvailableDecisionMakerRoleTypes(country2) {
|
|
18862
|
+
const requirements2 = getDecisionMakerRequirements(country2);
|
|
18863
|
+
return requirements2.filter((req) => req.roleTypes.length === 1).map((req) => ({
|
|
18864
|
+
roleType: req.roleTypes[0],
|
|
18865
|
+
min: req.min,
|
|
18866
|
+
max: req.max
|
|
18867
|
+
}));
|
|
18868
|
+
}
|
|
18869
|
+
const DEFAULT_DESCRIPTIONS_MAP = {
|
|
18870
|
+
[DecisionMakerType.OWNER]: "provideAllOwners",
|
|
18871
|
+
[DecisionMakerType.CONTROLLING_PERSON]: "ifNoOwnersSpecifyControllingPersons",
|
|
18872
|
+
[DecisionMakerType.DIRECTOR]: "provideAllDirectors",
|
|
18873
|
+
[DecisionMakerType.SIGNATORY]: "provideAtLeastOneSignatory"
|
|
18874
|
+
};
|
|
18875
|
+
const PER_COUNTRY_DESCRIPTION_OVERRIDES = {
|
|
18876
|
+
US: {
|
|
18877
|
+
[DecisionMakerType.CONTROLLING_PERSON]: "provideOneControllingPerson"
|
|
18878
|
+
},
|
|
18879
|
+
BR: {
|
|
18880
|
+
[DecisionMakerType.CONTROLLING_PERSON]: "provideOneControllingPerson"
|
|
18881
|
+
}
|
|
18882
|
+
};
|
|
18883
|
+
const getDecisionMakerDescriptionMap = (country2) => ({
|
|
18884
|
+
...DEFAULT_DESCRIPTIONS_MAP,
|
|
18885
|
+
...PER_COUNTRY_DESCRIPTION_OVERRIDES[country2]
|
|
18886
|
+
});
|
|
18887
|
+
const getOwnDecisionMakers = (rootLegalEntity) => {
|
|
18888
|
+
if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations))
|
|
18889
|
+
return [];
|
|
18890
|
+
return rootLegalEntity.entityAssociations.filter((entityAssociation) => Object.values(DecisionMakerType).includes(entityAssociation.type) && entityAssociation.associatorId === rootLegalEntity.id);
|
|
18891
|
+
};
|
|
18892
|
+
const getDecisionMakers = (rootLegalEntity, companyLegalEntityId) => getDirectEntityAssociations(rootLegalEntity, companyLegalEntityId).filter((association2) => Object.values(DecisionMakerType).includes(association2.type));
|
|
18893
|
+
const getOwnSignatories = (rootLegalEntity) => getOwnDecisionMakers(rootLegalEntity).filter((decisionMaker2) => decisionMaker2.type === DecisionMakerType.SIGNATORY);
|
|
18894
|
+
const getOwnDecisionMakersLegalEntityIds = (rootLegalEntity) => getOwnDecisionMakers(rootLegalEntity).map((ea) => ea.legalEntityId).filter((id2) => id2 !== void 0);
|
|
18895
|
+
const getDecisionMakerCount = (rootLegalEntity) => {
|
|
18896
|
+
const decisionMakers2 = getOwnDecisionMakers(rootLegalEntity);
|
|
18897
|
+
return decisionMakers2.reduce((decisionMakerCount, decisionMaker2) => {
|
|
18898
|
+
decisionMakerCount[decisionMaker2.type] = (decisionMakerCount[decisionMaker2.type] ?? 0) + 1;
|
|
18899
|
+
return decisionMakerCount;
|
|
18900
|
+
}, {});
|
|
18901
|
+
};
|
|
18902
|
+
const getAllowedDecisionMakerRoles = (rootLegalEntity, taskType) => {
|
|
18903
|
+
var _a, _b;
|
|
18904
|
+
if (taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER) {
|
|
18905
|
+
return [DecisionMakerType.OWNER];
|
|
18906
|
+
}
|
|
18907
|
+
const existingDecisionMakerCount = getDecisionMakerCount(rootLegalEntity);
|
|
18908
|
+
const registeredCountry = (_b = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _a.registeredAddress) == null ? void 0 : _b.country;
|
|
18909
|
+
const decisionMakerCountRange = getDecisionMakerRequirements(registeredCountry);
|
|
18910
|
+
const allowedRoles = decisionMakerCountRange.reduce((acc, requirements2) => {
|
|
18911
|
+
const {
|
|
18912
|
+
roleTypes,
|
|
18913
|
+
max
|
|
18914
|
+
} = requirements2;
|
|
18915
|
+
if (roleTypes.length === 1) {
|
|
18916
|
+
const role2 = roleTypes[0];
|
|
18917
|
+
const isBelowMaxRange = ((existingDecisionMakerCount == null ? void 0 : existingDecisionMakerCount[role2]) ?? 0) < max;
|
|
18918
|
+
if (isBelowMaxRange) {
|
|
18919
|
+
acc.push(role2);
|
|
18920
|
+
}
|
|
18921
|
+
}
|
|
18922
|
+
return acc;
|
|
18923
|
+
}, []);
|
|
18924
|
+
const uniqueAllowedRoles = [...new Set(allowedRoles)];
|
|
18925
|
+
return uniqueAllowedRoles;
|
|
18926
|
+
};
|
|
18927
|
+
const hasMinRequiredDecisionMakerCount = (rootLegalEntity) => {
|
|
18928
|
+
var _a, _b;
|
|
18929
|
+
const existingDecisionMakerCount = getDecisionMakerCount(rootLegalEntity);
|
|
18930
|
+
const registeredCountry = (_b = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _a.registeredAddress) == null ? void 0 : _b.country;
|
|
18931
|
+
const decisionMakerCountRange = getDecisionMakerRequirements(registeredCountry);
|
|
18932
|
+
return decisionMakerCountRange.every((requirements2) => {
|
|
18933
|
+
const {
|
|
18934
|
+
roleTypes,
|
|
18935
|
+
min
|
|
18936
|
+
} = requirements2;
|
|
18937
|
+
return roleTypes.some((role2) => min ? (existingDecisionMakerCount == null ? void 0 : existingDecisionMakerCount[role2]) ?? min <= 0 : true);
|
|
18938
|
+
});
|
|
18939
|
+
};
|
|
18940
|
+
const TRUST_MEMBER_COUNT_RANGE = {
|
|
18941
|
+
[TrustMemberTypes.DEFINED_BENEFICIARY]: {
|
|
18942
|
+
min: 1
|
|
18943
|
+
},
|
|
18944
|
+
[TrustMemberTypes.SETTLOR]: {
|
|
18945
|
+
min: 1
|
|
18946
|
+
}
|
|
18947
|
+
};
|
|
18948
|
+
const isPartOfTrustFromLegalEntity = (legalEntity) => {
|
|
18949
|
+
var _a;
|
|
18950
|
+
return (_a = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.entityType === LegalEntityType.TRUST && ea.associatorId === legalEntity.id);
|
|
18951
|
+
};
|
|
18952
|
+
const getTrustLegalEntityId = (rootLegalEntity) => {
|
|
18953
|
+
var _a;
|
|
18954
|
+
if (!rootLegalEntity.entityAssociations)
|
|
18955
|
+
return void 0;
|
|
18956
|
+
return (_a = rootLegalEntity.entityAssociations.find((entityAssociation) => entityAssociation.type === LegalEntityType.TRUST)) == null ? void 0 : _a.legalEntityId;
|
|
18957
|
+
};
|
|
18958
|
+
const getOwnTrustMembers = (rootLegalEntity) => {
|
|
18959
|
+
const trustLegalEntityId = getTrustLegalEntityId(rootLegalEntity);
|
|
18960
|
+
if (!trustLegalEntityId || !rootLegalEntity.entityAssociations)
|
|
18961
|
+
return [];
|
|
18962
|
+
return rootLegalEntity.entityAssociations.filter((entityAssociation) => Object.values(TrustMemberTypes).includes(entityAssociation.type) && trustLegalEntityId === entityAssociation.associatorId);
|
|
18963
|
+
};
|
|
18964
|
+
const getOwnTrustMembersLegalEntityIds = (rootLegalEntity) => {
|
|
18965
|
+
const trustLegalEntityId = getOwnTrustLegalEntityId(rootLegalEntity);
|
|
18966
|
+
if (!trustLegalEntityId)
|
|
18967
|
+
return [];
|
|
18968
|
+
const trustMemberAssociations = getDirectEntityAssociations(rootLegalEntity, trustLegalEntityId);
|
|
18969
|
+
const trustMemberIds = trustMemberAssociations.map((association2) => association2.legalEntityId).filter((id2) => id2 !== void 0);
|
|
18970
|
+
return [...trustMemberIds, ...trustMemberIds.flatMap((trustMemberId) => getTrustMemberCompanyDecisionMakerIds(rootLegalEntity, trustMemberId))];
|
|
18971
|
+
};
|
|
18972
|
+
const getTrustMemberCompanyDecisionMakerIds = (rootLegalEntity, trustMemberCompanyId) => {
|
|
18973
|
+
const decisionMakerAssociations = getDecisionMakers(rootLegalEntity, trustMemberCompanyId);
|
|
18974
|
+
return decisionMakerAssociations.map((association2) => association2.legalEntityId).filter((id2) => id2 !== void 0);
|
|
18975
|
+
};
|
|
18976
|
+
const getOwnTrustLegalEntityId = (legalEntity) => {
|
|
18977
|
+
var _a, _b;
|
|
18978
|
+
return (_b = (_a = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a.find((ea) => ea.entityType === LegalEntityType.TRUST && ea.associatorId === legalEntity.id)) == null ? void 0 : _b.legalEntityId;
|
|
18979
|
+
};
|
|
18980
|
+
const getOwnTrustLegalEntityIdAsArray = (legalEntity) => {
|
|
18981
|
+
const trustLegalEntityId = getOwnTrustLegalEntityId(legalEntity);
|
|
18982
|
+
return trustLegalEntityId ? [trustLegalEntityId] : [];
|
|
18983
|
+
};
|
|
18984
|
+
const getOwnTrustProblems = (legalEntity, capabilityProblems) => {
|
|
18985
|
+
var _a;
|
|
18986
|
+
const trustLegalEntityId = getOwnTrustLegalEntityId(legalEntity);
|
|
18987
|
+
if (trustLegalEntityId) {
|
|
18988
|
+
return (_a = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _a[trustLegalEntityId];
|
|
18989
|
+
}
|
|
18990
|
+
};
|
|
18991
|
+
const getTrustMemberCount = (rootLegalEntity) => {
|
|
18992
|
+
const trustMembers2 = getOwnTrustMembers(rootLegalEntity);
|
|
18993
|
+
return trustMembers2.reduce((trustMemberCount, trustMember) => {
|
|
18994
|
+
trustMemberCount[trustMember.type] = (trustMemberCount[trustMember.type] ?? 0) + 1;
|
|
18995
|
+
return trustMemberCount;
|
|
18996
|
+
}, {});
|
|
18997
|
+
};
|
|
18998
|
+
const hasMinRequiredTrustMemberCount = (rootLegalEntity) => {
|
|
18999
|
+
const existingTrustMemberCount = getTrustMemberCount(rootLegalEntity);
|
|
19000
|
+
const countRangeEntries = Object.entries(TRUST_MEMBER_COUNT_RANGE);
|
|
19001
|
+
return countRangeEntries.every(([trustMemberType, requiredRange]) => requiredRange.min ? (existingTrustMemberCount == null ? void 0 : existingTrustMemberCount[trustMemberType]) ?? requiredRange.min <= 0 : true);
|
|
19002
|
+
};
|
|
19003
|
+
const getCountrySpecificTrustTypeOptions = (country2) => {
|
|
19004
|
+
const countrySpecificTrustTypes = countryToTrustTypes[country2];
|
|
19005
|
+
if (!countrySpecificTrustTypes) {
|
|
19006
|
+
return [];
|
|
19007
|
+
}
|
|
19008
|
+
return countrySpecificTrustTypes.map((countrySpecificTrustType) => {
|
|
19009
|
+
const countrySpecificTrustTypeOption = trustTypeOptions.find((trustTypeOption) => trustTypeOption.id === countrySpecificTrustType);
|
|
19010
|
+
if (!countrySpecificTrustTypeOption) {
|
|
19011
|
+
throw new Error("getCountrySpecificTrustTypeOptions(): unknown trust type");
|
|
19012
|
+
}
|
|
19013
|
+
return countrySpecificTrustTypeOption;
|
|
18945
19014
|
});
|
|
18946
|
-
}
|
|
18947
|
-
const Trust = "";
|
|
19015
|
+
};
|
|
18948
19016
|
const ContextHelper$1 = "";
|
|
18949
19017
|
const ContextHelper = ({
|
|
18950
19018
|
content
|
|
@@ -19198,10 +19266,11 @@ function TrustComponent(props) {
|
|
|
19198
19266
|
})
|
|
19199
19267
|
}), jsx("div", {
|
|
19200
19268
|
className: activeForm.formId !== trustConstitutionalDocumentFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
19201
|
-
children: jsx(
|
|
19269
|
+
children: jsx(ConstitutionalDocumentComponent, {
|
|
19202
19270
|
...trustDocumentFormProps,
|
|
19203
19271
|
id: trustConstitutionalDocumentFormId,
|
|
19204
|
-
legalEntityType: LegalEntityType.TRUST
|
|
19272
|
+
legalEntityType: LegalEntityType.TRUST,
|
|
19273
|
+
country: props.country
|
|
19205
19274
|
})
|
|
19206
19275
|
})]
|
|
19207
19276
|
});
|
|
@@ -19210,7 +19279,7 @@ function TrustComponent(props) {
|
|
|
19210
19279
|
children: renderActiveForm(props.activeForm || trustForms.trustRegistrationDetails)
|
|
19211
19280
|
});
|
|
19212
19281
|
}
|
|
19213
|
-
const
|
|
19282
|
+
const invalidInputRemediationActionMappings = {
|
|
19214
19283
|
"1_100": [],
|
|
19215
19284
|
"1_101": [],
|
|
19216
19285
|
"1_102": [{
|
|
@@ -19347,6 +19416,7 @@ const remediationActionMappings = {
|
|
|
19347
19416
|
}]
|
|
19348
19417
|
};
|
|
19349
19418
|
const dataMissingRemediationsToFieldsMap = {
|
|
19419
|
+
"1_501": [DocumentType.REGISTRATION_DOCUMENT],
|
|
19350
19420
|
"2_158": ["vatNumber", "exemptedFromVat", "vatAbsenceReason"]
|
|
19351
19421
|
};
|
|
19352
19422
|
const DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING = {
|
|
@@ -19453,7 +19523,7 @@ function setInvalidInputError(parentVerificationError, entityProblems) {
|
|
|
19453
19523
|
remediatingActions
|
|
19454
19524
|
}) => {
|
|
19455
19525
|
const mappedRemActions = remediatingActions == null ? void 0 : remediatingActions.reduce((acc2, remediatingAction) => {
|
|
19456
|
-
const remMapping =
|
|
19526
|
+
const remMapping = invalidInputRemediationActionMappings[remediatingAction.code];
|
|
19457
19527
|
if (remMapping) {
|
|
19458
19528
|
const {
|
|
19459
19529
|
entityType: entityType2
|
|
@@ -20362,7 +20432,7 @@ const nationality = {
|
|
|
20362
20432
|
}
|
|
20363
20433
|
};
|
|
20364
20434
|
const fieldsPerScenario$1 = {
|
|
20365
|
-
L0: drop(
|
|
20435
|
+
L0: drop("address", "birthDate").from(identityBase),
|
|
20366
20436
|
L1: identityBase,
|
|
20367
20437
|
L1_ID: {
|
|
20368
20438
|
...identityBase,
|
|
@@ -20525,6 +20595,12 @@ const countryConfig = {
|
|
|
20525
20595
|
registrationNumber: {
|
|
20526
20596
|
label: "NZBN"
|
|
20527
20597
|
}
|
|
20598
|
+
},
|
|
20599
|
+
[CountryCodes.Croatia]: {
|
|
20600
|
+
...countryConfig$4[CountryCodes.Croatia],
|
|
20601
|
+
registrationNumber: {
|
|
20602
|
+
label: "MBO"
|
|
20603
|
+
}
|
|
20528
20604
|
}
|
|
20529
20605
|
};
|
|
20530
20606
|
function parseIndividualScenarios(scenario, country2) {
|
|
@@ -21256,7 +21332,7 @@ function CompanyDropinComponent({
|
|
|
21256
21332
|
});
|
|
21257
21333
|
onChange == null ? void 0 : onChange(currentState);
|
|
21258
21334
|
}, [currentState]);
|
|
21259
|
-
const isSkippingCompanyStructure = useEnableNewEntryFlow() && accountHolder2 === "
|
|
21335
|
+
const isSkippingCompanyStructure = useEnableNewEntryFlow() && accountHolder2 === "partnershipIncorporated";
|
|
21260
21336
|
const forms = useMemo(() => {
|
|
21261
21337
|
const requiredForms = getRequiredForms(companyForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
21262
21338
|
const validityAddedForms = addValidityToForms(requiredForms, formValidity, problems);
|
|
@@ -21593,9 +21669,6 @@ const useHasSeenIntroduction = ({
|
|
|
21593
21669
|
const useLegalEntityType = ({
|
|
21594
21670
|
legalEntity
|
|
21595
21671
|
}) => {
|
|
21596
|
-
const {
|
|
21597
|
-
isExperimentEnabled
|
|
21598
|
-
} = useExperimentsContext();
|
|
21599
21672
|
const isTrust = isPartOfTrustFromLegalEntity(legalEntity);
|
|
21600
21673
|
const isSoleProprietor = hasSolePropInLegalEntity(legalEntity);
|
|
21601
21674
|
const hasLegalAssociation = isTrust || isSoleProprietor;
|
|
@@ -21607,7 +21680,7 @@ const useLegalEntityType = ({
|
|
|
21607
21680
|
if (isSoleProprietor)
|
|
21608
21681
|
return LegalEntityType.SOLE_PROPRIETORSHIP;
|
|
21609
21682
|
if (isTrust)
|
|
21610
|
-
return
|
|
21683
|
+
return LegalEntityType.TRUST;
|
|
21611
21684
|
break;
|
|
21612
21685
|
default:
|
|
21613
21686
|
return void 0;
|
|
@@ -21666,6 +21739,8 @@ const useExemptSettlor = ({
|
|
|
21666
21739
|
setExemptSettlor(exemptSettlorLE);
|
|
21667
21740
|
}, [handleGetLegalEntity]);
|
|
21668
21741
|
useEffect(() => {
|
|
21742
|
+
if (!trust2)
|
|
21743
|
+
return;
|
|
21669
21744
|
updateExemptSettlor(trust2).catch(logger$8.error);
|
|
21670
21745
|
}, [trust2, updateExemptSettlor]);
|
|
21671
21746
|
return exemptSettlor;
|
|
@@ -21706,7 +21781,7 @@ const base64ToBlob = (base64, mimeType = "application/octet-stream") => {
|
|
|
21706
21781
|
});
|
|
21707
21782
|
};
|
|
21708
21783
|
const saveBlobAsFile = (fileData, filename) => {
|
|
21709
|
-
if (typeof window.navigator.msSaveBlob
|
|
21784
|
+
if ("msSaveBlob" in window.navigator && typeof window.navigator.msSaveBlob === "function") {
|
|
21710
21785
|
window.navigator.msSaveBlob(fileData, filename);
|
|
21711
21786
|
} else {
|
|
21712
21787
|
const blobUrl = window.URL.createObjectURL(fileData);
|
|
@@ -22157,6 +22232,61 @@ function Toast({
|
|
|
22157
22232
|
})]
|
|
22158
22233
|
});
|
|
22159
22234
|
}
|
|
22235
|
+
const getBusinessType = (businessTypeItems, accountHolder2, legalEntityType, companyTypesValue) => {
|
|
22236
|
+
const legalArrangementSuboptions = ["partnershipIncorporated"];
|
|
22237
|
+
const findBusinessType = (id2) => businessTypes.find((bt) => bt.id === id2);
|
|
22238
|
+
if (legalArrangementSuboptions.includes(companyTypesValue ?? "")) {
|
|
22239
|
+
return findBusinessType("legalArrangement");
|
|
22240
|
+
}
|
|
22241
|
+
if (accountHolder2) {
|
|
22242
|
+
if (["aTrust", "partnershipUnincorporated", "anAssociation"].includes(accountHolder2)) {
|
|
22243
|
+
return findBusinessType("legalArrangement");
|
|
22244
|
+
}
|
|
22245
|
+
return businessTypeItems.find((businessTypeItem) => businessTypeItem.accountHolder === accountHolder2);
|
|
22246
|
+
}
|
|
22247
|
+
switch (legalEntityType) {
|
|
22248
|
+
case LegalEntityType.ORGANIZATION:
|
|
22249
|
+
return findBusinessType("company");
|
|
22250
|
+
case LegalEntityType.INDIVIDUAL:
|
|
22251
|
+
return findBusinessType("individual");
|
|
22252
|
+
}
|
|
22253
|
+
};
|
|
22254
|
+
const mapLegalArrangementOptionToCompanyTypesValue = (legalArrangement) => {
|
|
22255
|
+
switch (legalArrangement) {
|
|
22256
|
+
case "partnershipIncorporated":
|
|
22257
|
+
return CompanyTypesValue.INCORPORATED_PARTNERSHIP;
|
|
22258
|
+
default:
|
|
22259
|
+
return "";
|
|
22260
|
+
}
|
|
22261
|
+
};
|
|
22262
|
+
const getDefaultLegalArrangementOrSuborganizationType = (legalEntityResponse) => {
|
|
22263
|
+
var _a;
|
|
22264
|
+
const entityAssociations = legalEntityResponse == null ? void 0 : legalEntityResponse.entityAssociations;
|
|
22265
|
+
const suborganizationType = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
|
|
22266
|
+
if (suborganizationType === CompanyTypesValue.INCORPORATED_PARTNERSHIP) {
|
|
22267
|
+
return "partnershipIncorporated";
|
|
22268
|
+
}
|
|
22269
|
+
if (!entityAssociations || entityAssociations.length === 0) {
|
|
22270
|
+
return void 0;
|
|
22271
|
+
}
|
|
22272
|
+
const trust2 = entityAssociations.find((ea) => ea.entityType === LegalEntityType.TRUST);
|
|
22273
|
+
if (trust2) {
|
|
22274
|
+
return "aTrust";
|
|
22275
|
+
}
|
|
22276
|
+
return void 0;
|
|
22277
|
+
};
|
|
22278
|
+
const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, currentLegalEntityType) => {
|
|
22279
|
+
if (businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "company" || businessType === "company") {
|
|
22280
|
+
return LegalEntityType.ORGANIZATION;
|
|
22281
|
+
}
|
|
22282
|
+
if (businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "individual" || businessType === "individual" || businessType === "soleProprietorship") {
|
|
22283
|
+
return LegalEntityType.INDIVIDUAL;
|
|
22284
|
+
}
|
|
22285
|
+
if (legalArrangement === "partnershipIncorporated") {
|
|
22286
|
+
return LegalEntityType.ORGANIZATION;
|
|
22287
|
+
}
|
|
22288
|
+
return currentLegalEntityType;
|
|
22289
|
+
};
|
|
22160
22290
|
const businessTypes = [{
|
|
22161
22291
|
id: "individual",
|
|
22162
22292
|
accountHolder: "myName",
|
|
@@ -22183,18 +22313,18 @@ const legalArrangementItems = [{
|
|
|
22183
22313
|
name: "trust",
|
|
22184
22314
|
description: "youAreTrusteeManagingTheTrustForBeneficiaries"
|
|
22185
22315
|
}, {
|
|
22186
|
-
id: "
|
|
22187
|
-
accountHolder: "
|
|
22316
|
+
id: "partnershipIncorporated",
|
|
22317
|
+
accountHolder: "theCompanyIWorkFor",
|
|
22188
22318
|
name: "incorporatedPartnership",
|
|
22189
|
-
description: "
|
|
22319
|
+
description: "partnershipIncorporatedNewEntryFlowDescription"
|
|
22190
22320
|
}, {
|
|
22191
|
-
id: "
|
|
22192
|
-
accountHolder: "
|
|
22321
|
+
id: "partnershipUnincorporated",
|
|
22322
|
+
accountHolder: "theCompanyIWorkFor",
|
|
22193
22323
|
name: "unincorporatedPartnership",
|
|
22194
|
-
description: "
|
|
22324
|
+
description: "partnershipUnincorporatedNewEntryFlowDescription"
|
|
22195
22325
|
}, {
|
|
22196
|
-
id: "
|
|
22197
|
-
accountHolder: "
|
|
22326
|
+
id: "associationIncorporated",
|
|
22327
|
+
accountHolder: "associationIncorporated",
|
|
22198
22328
|
name: "associationIncorporatedTitle",
|
|
22199
22329
|
description: "groupOfPeopleActingTogetherForNonCommercialPurpose"
|
|
22200
22330
|
}];
|
|
@@ -22256,20 +22386,6 @@ const businessTypeSelectionStepTitles = {
|
|
|
22256
22386
|
/* CONFIRM_BUSINESS_SETUP_CHANGE */
|
|
22257
22387
|
]: "changeYourBusinessSetup"
|
|
22258
22388
|
};
|
|
22259
|
-
const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, currentLegalEntityType) => {
|
|
22260
|
-
const isIndividual = currentLegalEntityType === LegalEntityType.INDIVIDUAL;
|
|
22261
|
-
const isOrganization = currentLegalEntityType === LegalEntityType.ORGANIZATION;
|
|
22262
|
-
if (isIndividual && businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "company" || businessType === "company") {
|
|
22263
|
-
return LegalEntityType.ORGANIZATION;
|
|
22264
|
-
}
|
|
22265
|
-
if (isOrganization && businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "individual" || businessType === "individual" || businessType === "soleProprietorship") {
|
|
22266
|
-
return LegalEntityType.INDIVIDUAL;
|
|
22267
|
-
}
|
|
22268
|
-
if (legalArrangement === "incorporatedPartnership") {
|
|
22269
|
-
return LegalEntityType.ORGANIZATION;
|
|
22270
|
-
}
|
|
22271
|
-
return currentLegalEntityType;
|
|
22272
|
-
};
|
|
22273
22389
|
const BusinessTypeSelection = ({
|
|
22274
22390
|
legalEntityResponse,
|
|
22275
22391
|
accountHolder: accountHolder2,
|
|
@@ -22278,7 +22394,7 @@ const BusinessTypeSelection = ({
|
|
|
22278
22394
|
onAccountHolderSelect,
|
|
22279
22395
|
handleUpdateLegalEntity
|
|
22280
22396
|
}) => {
|
|
22281
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
22397
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
22282
22398
|
const {
|
|
22283
22399
|
i18n
|
|
22284
22400
|
} = useI18nContext();
|
|
@@ -22297,21 +22413,11 @@ const BusinessTypeSelection = ({
|
|
|
22297
22413
|
/* WE_CANNOT_SET_UP_ACCOUNT */
|
|
22298
22414
|
].includes(currentStep);
|
|
22299
22415
|
const businessTypeItems = getBusinessTypes(showTrustOption, showSolePropOption);
|
|
22300
|
-
const
|
|
22301
|
-
|
|
22302
|
-
|
|
22303
|
-
|
|
22304
|
-
|
|
22305
|
-
return businessTypeItems.find((businessTypeItem) => businessTypeItem.accountHolder === accountHolder2);
|
|
22306
|
-
}
|
|
22307
|
-
switch (legalEntityResponse.type) {
|
|
22308
|
-
case LegalEntityType.ORGANIZATION:
|
|
22309
|
-
return businessTypeItems.find((businessTypeItem) => businessTypeItem.id === "company");
|
|
22310
|
-
case LegalEntityType.INDIVIDUAL:
|
|
22311
|
-
return businessTypeItems.find((businessTypeItem) => businessTypeItem.id === "individual");
|
|
22312
|
-
}
|
|
22313
|
-
};
|
|
22314
|
-
const getDefaultLegalArrangementType = () => accountHolder2 && legalArrangementItems.find((item) => item.accountHolder === accountHolder2);
|
|
22416
|
+
const currentLegalEntityType = legalEntityResponse == null ? void 0 : legalEntityResponse.type;
|
|
22417
|
+
const currentCompanyTypesValue = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
|
|
22418
|
+
const defaultBusinessType = getBusinessType(businessTypeItems, accountHolder2, legalEntityResponse == null ? void 0 : legalEntityResponse.type, (_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
|
|
22419
|
+
const getDefaultLegalArrangementSelection = () => legalArrangementItems.find((item) => item.id === getDefaultLegalArrangementOrSuborganizationType(legalEntityResponse));
|
|
22420
|
+
const defaultLegalArrangementType = getDefaultLegalArrangementSelection();
|
|
22315
22421
|
const defaultTrusteeType = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? trusteeTypeItems[0] : trusteeTypeItems[1];
|
|
22316
22422
|
const {
|
|
22317
22423
|
handleChangeFor,
|
|
@@ -22323,20 +22429,23 @@ const BusinessTypeSelection = ({
|
|
|
22323
22429
|
} = useForm({
|
|
22324
22430
|
schema: formSchema,
|
|
22325
22431
|
defaultData: {
|
|
22326
|
-
businessType:
|
|
22327
|
-
legalArrangement:
|
|
22432
|
+
businessType: defaultBusinessType,
|
|
22433
|
+
legalArrangement: defaultLegalArrangementType,
|
|
22328
22434
|
trusteeType: defaultTrusteeType
|
|
22329
22435
|
},
|
|
22330
22436
|
rules: businessTypeSelectionValidationRules
|
|
22331
22437
|
});
|
|
22332
|
-
const newAccountHolder = ((
|
|
22333
|
-
const
|
|
22438
|
+
const newAccountHolder = ((_c = data.businessType) == null ? void 0 : _c.accountHolder) || ((_d = data.legalArrangement) == null ? void 0 : _d.accountHolder);
|
|
22439
|
+
const targetLegalArrangement = (_e = data.legalArrangement) == null ? void 0 : _e.id;
|
|
22440
|
+
const targetLegalEntityType = getTargetLegalEntityType((_f = data.businessType) == null ? void 0 : _f.id, (_g = data.legalArrangement) == null ? void 0 : _g.id, (_h = data.trusteeType) == null ? void 0 : _h.id, legalEntityResponse == null ? void 0 : legalEntityResponse.type);
|
|
22441
|
+
const isLegalEntityTypeChanging = currentLegalEntityType !== targetLegalEntityType;
|
|
22442
|
+
const isLegalArrangementChanging = currentCompanyTypesValue !== targetLegalArrangement;
|
|
22334
22443
|
useEffect(() => {
|
|
22335
22444
|
var _a2, _b2;
|
|
22336
22445
|
setFormSchema(getFormSchema(((_a2 = data.businessType) == null ? void 0 : _a2.id) === "legalArrangement" && !!data.legalArrangement || currentStep === 1, ((_b2 = data.legalArrangement) == null ? void 0 : _b2.id) === "aTrust"));
|
|
22337
22446
|
}, [data.businessType, data.legalArrangement, currentStep]);
|
|
22338
22447
|
const handleNextClick = async () => {
|
|
22339
|
-
var _a2
|
|
22448
|
+
var _a2;
|
|
22340
22449
|
if (loadingStatus === "loading")
|
|
22341
22450
|
return;
|
|
22342
22451
|
triggerValidation();
|
|
@@ -22349,8 +22458,7 @@ const BusinessTypeSelection = ({
|
|
|
22349
22458
|
);
|
|
22350
22459
|
return;
|
|
22351
22460
|
}
|
|
22352
|
-
|
|
22353
|
-
if (legalArrangementId === "anAssociation" || legalArrangementId === "unincorporatedPartnership") {
|
|
22461
|
+
if (targetLegalArrangement === "associationIncorporated" || targetLegalArrangement === "partnershipUnincorporated") {
|
|
22354
22462
|
setCurrentStep(
|
|
22355
22463
|
2
|
|
22356
22464
|
/* WE_CANNOT_SET_UP_ACCOUNT */
|
|
@@ -22358,49 +22466,46 @@ const BusinessTypeSelection = ({
|
|
|
22358
22466
|
return;
|
|
22359
22467
|
}
|
|
22360
22468
|
}
|
|
22361
|
-
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22469
|
+
if (newAccountHolder !== accountHolder2 || isLegalEntityTypeChanging) {
|
|
22470
|
+
if (accountHolder2) {
|
|
22471
|
+
setCurrentStep(
|
|
22472
|
+
3
|
|
22473
|
+
/* CONFIRM_BUSINESS_SETUP_CHANGE */
|
|
22474
|
+
);
|
|
22475
|
+
return;
|
|
22476
|
+
}
|
|
22477
|
+
await updateLegalEntityAndSelectAccountHolder();
|
|
22368
22478
|
} else {
|
|
22479
|
+
onAccountHolderSelect(newAccountHolder);
|
|
22480
|
+
}
|
|
22481
|
+
if (isLegalArrangementChanging) {
|
|
22369
22482
|
await updateLegalEntityAndSelectAccountHolder();
|
|
22370
22483
|
}
|
|
22371
|
-
} else {
|
|
22372
|
-
onAccountHolderSelect(newAccountHolder);
|
|
22373
22484
|
}
|
|
22374
22485
|
};
|
|
22375
22486
|
const updateLegalEntityAndSelectAccountHolder = async () => {
|
|
22376
|
-
var _a2;
|
|
22377
|
-
const selectedLegalArrangement = (_a2 = data.legalArrangement) == null ? void 0 : _a2.id;
|
|
22378
22487
|
try {
|
|
22379
|
-
if (
|
|
22488
|
+
if (isLegalEntityTypeChanging) {
|
|
22380
22489
|
setLoadingStatus("loading");
|
|
22381
22490
|
const updateLegalEntityPayload = {
|
|
22382
22491
|
type: targetLegalEntityType
|
|
22383
22492
|
};
|
|
22384
22493
|
await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity(updateLegalEntityPayload, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
|
|
22385
|
-
if (
|
|
22386
|
-
await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
|
|
22387
|
-
type: LegalEntityType.ORGANIZATION
|
|
22388
|
-
}, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
|
|
22389
|
-
await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
|
|
22390
|
-
organization: {
|
|
22391
|
-
type: CompanyTypesValue.INCORPORATED_PARTNERSHIP
|
|
22392
|
-
}
|
|
22393
|
-
}, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
|
|
22394
|
-
}
|
|
22395
|
-
} else if (newAccountHolder !== accountHolder2) {
|
|
22396
|
-
if (newAccountHolder === "theCompanyIWorkFor") {
|
|
22494
|
+
if (targetLegalEntityType === LegalEntityType.ORGANIZATION && targetLegalEntityType) {
|
|
22397
22495
|
await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
|
|
22398
22496
|
organization: {
|
|
22399
|
-
type:
|
|
22497
|
+
type: mapLegalArrangementOptionToCompanyTypesValue(targetLegalArrangement)
|
|
22400
22498
|
}
|
|
22401
22499
|
}, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
|
|
22402
22500
|
}
|
|
22403
22501
|
}
|
|
22502
|
+
if (isLegalArrangementChanging) {
|
|
22503
|
+
await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
|
|
22504
|
+
organization: {
|
|
22505
|
+
type: mapLegalArrangementOptionToCompanyTypesValue(targetLegalArrangement)
|
|
22506
|
+
}
|
|
22507
|
+
}, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
|
|
22508
|
+
}
|
|
22404
22509
|
} catch (e) {
|
|
22405
22510
|
showToast({
|
|
22406
22511
|
label: i18n.get("failedToUpdateDetails"),
|
|
@@ -22432,15 +22537,19 @@ const BusinessTypeSelection = ({
|
|
|
22432
22537
|
showSpinner: false,
|
|
22433
22538
|
children: jsxs("div", {
|
|
22434
22539
|
className: "adyen-kyc-business-type-selection",
|
|
22435
|
-
children: [
|
|
22436
|
-
|
|
22540
|
+
children: [jsxs("header", {
|
|
22541
|
+
className: "adl-u-margin-bottom-32",
|
|
22542
|
+
children: [jsx(Heading, {
|
|
22437
22543
|
level: 1,
|
|
22438
22544
|
children: i18n.get(businessTypeSelectionStepTitles[currentStep])
|
|
22439
|
-
})
|
|
22545
|
+
}), currentStep === 3 && jsx(Heading, {
|
|
22546
|
+
level: "sub",
|
|
22547
|
+
children: i18n.get("someInformationWillNotBeSaved")
|
|
22548
|
+
})]
|
|
22440
22549
|
}), currentStep === 0 && jsx(Field, {
|
|
22441
22550
|
name: "businessType",
|
|
22442
22551
|
useLabelElement: false,
|
|
22443
|
-
errorMessage: i18n.get((
|
|
22552
|
+
errorMessage: i18n.get((_i = errors.businessType) == null ? void 0 : _i.errorMessage),
|
|
22444
22553
|
showErrorIconBottom: true,
|
|
22445
22554
|
isValid: valid.businessType,
|
|
22446
22555
|
children: (childProps) => jsx(RadioGroupCard, {
|
|
@@ -22457,7 +22566,7 @@ const BusinessTypeSelection = ({
|
|
|
22457
22566
|
children: [jsx(Field, {
|
|
22458
22567
|
name: "legalArrangement",
|
|
22459
22568
|
useLabelElement: false,
|
|
22460
|
-
errorMessage: i18n.get((
|
|
22569
|
+
errorMessage: i18n.get((_j = errors.legalArrangement) == null ? void 0 : _j.errorMessage),
|
|
22461
22570
|
showErrorIconBottom: true,
|
|
22462
22571
|
isValid: valid.legalArrangement,
|
|
22463
22572
|
children: (childProps) => jsx(RadioGroupCard, {
|
|
@@ -22470,18 +22579,17 @@ const BusinessTypeSelection = ({
|
|
|
22470
22579
|
}),
|
|
22471
22580
|
onSelect: (item) => handleChangeFor("legalArrangement")(item)
|
|
22472
22581
|
})
|
|
22473
|
-
}), ((
|
|
22582
|
+
}), ((_k = data.legalArrangement) == null ? void 0 : _k.id) === "aTrust" && jsx(Field, {
|
|
22474
22583
|
name: "trusteeType",
|
|
22475
22584
|
label: i18n.get("whatTypeOfTrusteeAreYou"),
|
|
22476
22585
|
className: "adl-u-margin-top-32",
|
|
22477
22586
|
useLabelElement: false,
|
|
22478
|
-
errorMessage: i18n.get((
|
|
22587
|
+
errorMessage: i18n.get((_l = errors.trusteeType) == null ? void 0 : _l.errorMessage),
|
|
22479
22588
|
showErrorIconBottom: true,
|
|
22480
22589
|
isValid: valid.trusteeType,
|
|
22481
22590
|
children: (childProps) => jsx(RadioGroupCard, {
|
|
22482
|
-
className: "adyen-kyc-trustee-type-radio-group-card",
|
|
22483
|
-
itemLabelClassName: () => "adl-u-width-full",
|
|
22484
22591
|
...childProps,
|
|
22592
|
+
className: "adyen-kyc-trustee-type-radio-group-card",
|
|
22485
22593
|
name: "trusteeType",
|
|
22486
22594
|
items: trusteeTypeItems,
|
|
22487
22595
|
selected: trusteeTypeItems.find((type) => {
|
|
@@ -22498,24 +22606,20 @@ const BusinessTypeSelection = ({
|
|
|
22498
22606
|
className: "u-margin-top-32",
|
|
22499
22607
|
children: i18n.get("needHelpYouCanAlwaysReachOutToCustomerSupport")
|
|
22500
22608
|
})]
|
|
22501
|
-
}), currentStep === 3 ? jsxs(
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
|
|
22511
|
-
|
|
22512
|
-
|
|
22513
|
-
|
|
22514
|
-
|
|
22515
|
-
label: i18n.get("yesChange"),
|
|
22516
|
-
onClick: () => updateLegalEntityAndSelectAccountHolder(),
|
|
22517
|
-
type: "button"
|
|
22518
|
-
})]
|
|
22609
|
+
}), currentStep === 3 ? jsxs("div", {
|
|
22610
|
+
className: "adyen-kyc-business-type-selection__confirm",
|
|
22611
|
+
children: [jsx(Button, {
|
|
22612
|
+
label: i18n.get("cancel"),
|
|
22613
|
+
secondary: true,
|
|
22614
|
+
onClick: () => setCurrentStep(
|
|
22615
|
+
0
|
|
22616
|
+
/* BUSINESS_TYPE_SELECTION */
|
|
22617
|
+
),
|
|
22618
|
+
type: "button"
|
|
22619
|
+
}), jsx(Button, {
|
|
22620
|
+
label: i18n.get("yesChange"),
|
|
22621
|
+
onClick: () => updateLegalEntityAndSelectAccountHolder(),
|
|
22622
|
+
type: "button"
|
|
22519
22623
|
})]
|
|
22520
22624
|
}) : jsxs("div", {
|
|
22521
22625
|
className: "adyen-kyc-business-type-selection__nav",
|
|
@@ -22580,18 +22684,6 @@ const iconStatus = (current, min, max) => {
|
|
|
22580
22684
|
}
|
|
22581
22685
|
return isWithinConditionalRange ? "conditionalFinished" : "conditionalEmpty";
|
|
22582
22686
|
};
|
|
22583
|
-
const entityStatusRoles = {
|
|
22584
|
-
...decisionMakerRoles,
|
|
22585
|
-
...trustMemberGuidanceRoles
|
|
22586
|
-
};
|
|
22587
|
-
const getEntityStatusTagColor = (entityLabel) => {
|
|
22588
|
-
var _a;
|
|
22589
|
-
return (_a = entityStatusRoles[entityLabel]) == null ? void 0 : _a.className;
|
|
22590
|
-
};
|
|
22591
|
-
const getEntityStatusName = (entityLabel) => {
|
|
22592
|
-
var _a;
|
|
22593
|
-
return (_a = entityStatusRoles[entityLabel]) == null ? void 0 : _a.name;
|
|
22594
|
-
};
|
|
22595
22687
|
const getEntityStatusRuleDescription = (country2, currentTask, entityLabel) => currentTask === TaskTypes.TRUST_MEMBER_OVERVIEW ? TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel] : getDecisionMakerDescriptionMap(country2)[entityLabel];
|
|
22596
22688
|
const _cardGroup_component = "";
|
|
22597
22689
|
function CardGroup({
|
|
@@ -23000,9 +23092,9 @@ const EntityAssociation = ({
|
|
|
23000
23092
|
})]
|
|
23001
23093
|
}), jsx("div", {
|
|
23002
23094
|
children: types.map((type) => jsx(Tag, {
|
|
23003
|
-
className: `adl-entity-association__tag ${
|
|
23095
|
+
className: `adl-entity-association__tag ${getRoleTagColor(type)}`,
|
|
23004
23096
|
isBasic: true,
|
|
23005
|
-
children: i18n.get(
|
|
23097
|
+
children: i18n.get(getRoleName(type))
|
|
23006
23098
|
}, type))
|
|
23007
23099
|
}), status === TaskStatus.ERROR && jsx(VerificationErrorAlert, {
|
|
23008
23100
|
className: "adl-entity-association-alert",
|
|
@@ -23090,9 +23182,9 @@ const EntityGuidanceStatus = ({
|
|
|
23090
23182
|
children: [jsx(EntityStatusIcon, {
|
|
23091
23183
|
status
|
|
23092
23184
|
}), jsx(Tag, {
|
|
23093
|
-
className: `adl-entity-status__tag ${
|
|
23185
|
+
className: `adl-entity-status__tag ${getRoleTagColor(entityLabel)}`,
|
|
23094
23186
|
isBasic: true,
|
|
23095
|
-
children: i18n.get(
|
|
23187
|
+
children: i18n.get(getRoleName(entityLabel))
|
|
23096
23188
|
}, entityLabel), jsx("span", {
|
|
23097
23189
|
className: "adl-entity-status--text",
|
|
23098
23190
|
"data-testid": `${entityLabel}-rule--description`,
|
|
@@ -23484,7 +23576,7 @@ function LegalEntityTypeSwitcher({
|
|
|
23484
23576
|
const {
|
|
23485
23577
|
i18n
|
|
23486
23578
|
} = useI18nContext();
|
|
23487
|
-
const [loadingStatus, setLoadingStatus] = useState(
|
|
23579
|
+
const [loadingStatus, setLoadingStatus] = useState();
|
|
23488
23580
|
const {
|
|
23489
23581
|
showToast
|
|
23490
23582
|
} = useToastContext();
|
|
@@ -23535,7 +23627,7 @@ function LegalEntityTypeSwitcher({
|
|
|
23535
23627
|
})]
|
|
23536
23628
|
});
|
|
23537
23629
|
default:
|
|
23538
|
-
jsx("p", {
|
|
23630
|
+
return jsx("p", {
|
|
23539
23631
|
children: "Change not supported"
|
|
23540
23632
|
});
|
|
23541
23633
|
}
|
|
@@ -23636,15 +23728,27 @@ const businessTypeMapping = {
|
|
|
23636
23728
|
/* COMPANY_TRUSTEE */
|
|
23637
23729
|
}
|
|
23638
23730
|
};
|
|
23731
|
+
const companyTypesMapping = {
|
|
23732
|
+
[CompanyTypesValue.INCORPORATED_PARTNERSHIP]: "incorporatedPartnership",
|
|
23733
|
+
[CompanyTypesValue.PUBLIC_COMPANY]: "company",
|
|
23734
|
+
[CompanyTypesValue.PRIVATE_COMPANY]: "company",
|
|
23735
|
+
[CompanyTypesValue.UNLISTED_PUBLIC_COMPANY]: "company",
|
|
23736
|
+
[CompanyTypesValue.INCORPORATED_ASSOCIATION]: "company",
|
|
23737
|
+
[CompanyTypesValue.GOVERNMENTAL_ORGANIZATION]: "company",
|
|
23738
|
+
[CompanyTypesValue.NON_PROFIT_OR_CHARITABLE]: "company",
|
|
23739
|
+
[CompanyTypesValue.SOLE_PROPRIETORSHIP]: "soleProprietorship"
|
|
23740
|
+
/* SOLE_PROPRIETORSHIP */
|
|
23741
|
+
};
|
|
23639
23742
|
const useBusinessSetup = (legalEntityResponse) => {
|
|
23640
|
-
var _a;
|
|
23743
|
+
var _a, _b;
|
|
23641
23744
|
const {
|
|
23642
23745
|
accountHolder: accountHolder2
|
|
23643
23746
|
} = useCoreContext();
|
|
23644
23747
|
const accountHolderType = accountHolder2 || getDefaultAccountHolderType(legalEntityResponse);
|
|
23645
|
-
const
|
|
23748
|
+
const organizationType = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
|
|
23749
|
+
const businessSetup = accountHolderType === "theCompanyIWorkFor" && organizationType ? companyTypesMapping[organizationType] : (_b = businessTypeMapping[accountHolderType]) == null ? void 0 : _b[legalEntityResponse == null ? void 0 : legalEntityResponse.type];
|
|
23646
23750
|
return {
|
|
23647
|
-
businessSetup
|
|
23751
|
+
businessSetup
|
|
23648
23752
|
};
|
|
23649
23753
|
};
|
|
23650
23754
|
const hasPayoutAccount = (legalEntityResponse) => {
|
|
@@ -23818,9 +23922,6 @@ function TaskListComponent({
|
|
|
23818
23922
|
i18n
|
|
23819
23923
|
} = useI18nContext();
|
|
23820
23924
|
const isEnableNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
23821
|
-
const {
|
|
23822
|
-
isExperimentEnabled
|
|
23823
|
-
} = useExperimentsContext();
|
|
23824
23925
|
const canSeeIntroduction = useCanSeeIntroduction({
|
|
23825
23926
|
legalEntity: legalEntityResponse
|
|
23826
23927
|
});
|
|
@@ -23834,7 +23935,7 @@ function TaskListComponent({
|
|
|
23834
23935
|
businessSetup
|
|
23835
23936
|
} = useBusinessSetup(legalEntityResponse);
|
|
23836
23937
|
const hasTaskOfGroupAccountDetails = tasks.some((task) => LEGAL_ENTITY_BASE_TASKS.includes(task));
|
|
23837
|
-
const hasTrust =
|
|
23938
|
+
const hasTrust = accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
|
|
23838
23939
|
const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
|
|
23839
23940
|
const isCompany = tasks.some((task) => task === TaskTypes.COMPANY);
|
|
23840
23941
|
const hasSoleProprietorship = accountHolder2 === "mySoleProprietorName" || hasSolePropInLegalEntity(legalEntityResponse);
|
|
@@ -24562,11 +24663,12 @@ function IndividualDropinComponent({
|
|
|
24562
24663
|
};
|
|
24563
24664
|
const attachAssociationToParentLegalEntity = async ({
|
|
24564
24665
|
legalEntity,
|
|
24666
|
+
parentLE,
|
|
24565
24667
|
dataSubmitted
|
|
24566
24668
|
}) => {
|
|
24567
24669
|
var _a2;
|
|
24568
24670
|
const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER ? (_a2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _a2.role : taskType === TaskTypes.TRUST_MEMBER_INDIVIDUAL ? trustMember == null ? void 0 : trustMember.roles : null;
|
|
24569
|
-
const existingEntityAssociations = getOwnEntityAssociations(
|
|
24671
|
+
const existingEntityAssociations = getOwnEntityAssociations(parentLE);
|
|
24570
24672
|
if (newRoles && hasRolesChanged(legalEntity, existingEntityAssociations, newRoles)) {
|
|
24571
24673
|
const updatedParentLegalEntity = {
|
|
24572
24674
|
entityAssociations: [...newRoles.map((role2) => {
|
|
@@ -24578,7 +24680,7 @@ function IndividualDropinComponent({
|
|
|
24578
24680
|
};
|
|
24579
24681
|
}) || [], ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []]
|
|
24580
24682
|
};
|
|
24581
|
-
await handleUpdateLegalEntity(updatedParentLegalEntity,
|
|
24683
|
+
await handleUpdateLegalEntity(updatedParentLegalEntity, parentLE.id);
|
|
24582
24684
|
}
|
|
24583
24685
|
};
|
|
24584
24686
|
const onSubmit = async () => {
|
|
@@ -24611,10 +24713,13 @@ function IndividualDropinComponent({
|
|
|
24611
24713
|
legalEntity: createdLegalEntity,
|
|
24612
24714
|
dataSubmitted
|
|
24613
24715
|
});
|
|
24614
|
-
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24716
|
+
if (parentLegalEntity) {
|
|
24717
|
+
await attachAssociationToParentLegalEntity({
|
|
24718
|
+
legalEntity: createdLegalEntity,
|
|
24719
|
+
parentLE: parentLegalEntity,
|
|
24720
|
+
dataSubmitted
|
|
24721
|
+
});
|
|
24722
|
+
}
|
|
24618
24723
|
if (taskType === TaskTypes.INDIVIDUAL) {
|
|
24619
24724
|
setAccountHolder((_b2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _b2.accountHolder);
|
|
24620
24725
|
}
|
|
@@ -25365,7 +25470,7 @@ function InternalReference({
|
|
|
25365
25470
|
const label = displayText ? displayText.content : referencedLabel;
|
|
25366
25471
|
const scrollIntoView = () => {
|
|
25367
25472
|
const scrollParent = getScrollParent(document.getElementById(referencedLabel));
|
|
25368
|
-
const element = scrollParent
|
|
25473
|
+
const element = scrollParent == null ? void 0 : scrollParent.querySelector(`#${referencedLabel}`);
|
|
25369
25474
|
element == null ? void 0 : element.scrollIntoView({
|
|
25370
25475
|
behavior: "smooth"
|
|
25371
25476
|
});
|
|
@@ -25496,78 +25601,82 @@ const Weblink = ({
|
|
|
25496
25601
|
...displayText
|
|
25497
25602
|
}) : url
|
|
25498
25603
|
});
|
|
25604
|
+
const components = {
|
|
25605
|
+
chapter: Chapter,
|
|
25606
|
+
section: Section,
|
|
25607
|
+
paragraph: Paragraph,
|
|
25608
|
+
text: Text,
|
|
25609
|
+
weblink: Weblink,
|
|
25610
|
+
list: ListElement,
|
|
25611
|
+
table: Table,
|
|
25612
|
+
internalReference: InternalReference,
|
|
25613
|
+
breakline: "br"
|
|
25614
|
+
};
|
|
25615
|
+
const getKey = (type) => `key-${type}-${getUniqueId()}`;
|
|
25616
|
+
const getProps = (element, isTopLevel) => {
|
|
25617
|
+
if (!("type" in element))
|
|
25618
|
+
return null;
|
|
25619
|
+
switch (element.type) {
|
|
25620
|
+
case ElementTypes.Chapter:
|
|
25621
|
+
return {
|
|
25622
|
+
title: element.title,
|
|
25623
|
+
contentElements: element.contentElements
|
|
25624
|
+
};
|
|
25625
|
+
case ElementTypes.Section:
|
|
25626
|
+
return {
|
|
25627
|
+
isTopLevel,
|
|
25628
|
+
title: element.title,
|
|
25629
|
+
label: element.label,
|
|
25630
|
+
contentElements: element.contentElements
|
|
25631
|
+
};
|
|
25632
|
+
case ElementTypes.Paragraph:
|
|
25633
|
+
return {
|
|
25634
|
+
isTopLevel,
|
|
25635
|
+
contentElements: element.contentElements
|
|
25636
|
+
};
|
|
25637
|
+
case ElementTypes.Text:
|
|
25638
|
+
return {
|
|
25639
|
+
content: element.content,
|
|
25640
|
+
styles: element.styles
|
|
25641
|
+
};
|
|
25642
|
+
case ElementTypes.Weblink:
|
|
25643
|
+
return {
|
|
25644
|
+
url: element.url,
|
|
25645
|
+
displayText: element.displayText
|
|
25646
|
+
};
|
|
25647
|
+
case ElementTypes.List:
|
|
25648
|
+
return {
|
|
25649
|
+
items: element.items,
|
|
25650
|
+
style: element.style
|
|
25651
|
+
};
|
|
25652
|
+
case ElementTypes.Table:
|
|
25653
|
+
return {
|
|
25654
|
+
rows: element.rows,
|
|
25655
|
+
label: element.label,
|
|
25656
|
+
captions: element.captions,
|
|
25657
|
+
titlePrefix: element.titlePrefix,
|
|
25658
|
+
title: element.title
|
|
25659
|
+
};
|
|
25660
|
+
case ElementTypes.InternalReference:
|
|
25661
|
+
return {
|
|
25662
|
+
referencedLabel: element.referencedLabel,
|
|
25663
|
+
displayText: element.displayText
|
|
25664
|
+
};
|
|
25665
|
+
default:
|
|
25666
|
+
return null;
|
|
25667
|
+
}
|
|
25668
|
+
};
|
|
25499
25669
|
function ContentElements({
|
|
25500
25670
|
contentElements,
|
|
25501
25671
|
isTopLevel = false,
|
|
25502
25672
|
onExpandSection
|
|
25503
25673
|
}) {
|
|
25504
|
-
const components = {
|
|
25505
|
-
chapter: Chapter,
|
|
25506
|
-
section: Section,
|
|
25507
|
-
paragraph: Paragraph,
|
|
25508
|
-
text: Text,
|
|
25509
|
-
weblink: Weblink,
|
|
25510
|
-
list: ListElement,
|
|
25511
|
-
table: Table,
|
|
25512
|
-
internalReference: InternalReference,
|
|
25513
|
-
breakline: "br"
|
|
25514
|
-
};
|
|
25515
|
-
const getKey = (type) => `key-${type}-${getUniqueId()}`;
|
|
25516
|
-
const getProps = (element) => {
|
|
25517
|
-
switch (element.type) {
|
|
25518
|
-
case ElementTypes.Chapter:
|
|
25519
|
-
return {
|
|
25520
|
-
title: element.title,
|
|
25521
|
-
contentElements: element.contentElements
|
|
25522
|
-
};
|
|
25523
|
-
case ElementTypes.Section:
|
|
25524
|
-
return {
|
|
25525
|
-
isTopLevel,
|
|
25526
|
-
title: element.title,
|
|
25527
|
-
label: element.label,
|
|
25528
|
-
contentElements: element.contentElements
|
|
25529
|
-
};
|
|
25530
|
-
case ElementTypes.Paragraph:
|
|
25531
|
-
return {
|
|
25532
|
-
isTopLevel,
|
|
25533
|
-
contentElements: element.contentElements
|
|
25534
|
-
};
|
|
25535
|
-
case ElementTypes.Text:
|
|
25536
|
-
return {
|
|
25537
|
-
content: element.content,
|
|
25538
|
-
styles: element.styles
|
|
25539
|
-
};
|
|
25540
|
-
case ElementTypes.Weblink:
|
|
25541
|
-
return {
|
|
25542
|
-
url: element.url,
|
|
25543
|
-
displayText: element.displayText
|
|
25544
|
-
};
|
|
25545
|
-
case ElementTypes.List:
|
|
25546
|
-
return {
|
|
25547
|
-
items: element.items,
|
|
25548
|
-
style: element.style
|
|
25549
|
-
};
|
|
25550
|
-
case ElementTypes.Table:
|
|
25551
|
-
return {
|
|
25552
|
-
rows: element.rows,
|
|
25553
|
-
label: element.label,
|
|
25554
|
-
captions: element.captions,
|
|
25555
|
-
titlePrefix: element.titlePrefix,
|
|
25556
|
-
title: element.title
|
|
25557
|
-
};
|
|
25558
|
-
case ElementTypes.InternalReference:
|
|
25559
|
-
return {
|
|
25560
|
-
referencedLabel: element.referencedLabel,
|
|
25561
|
-
displayText: element.displayText
|
|
25562
|
-
};
|
|
25563
|
-
default:
|
|
25564
|
-
return null;
|
|
25565
|
-
}
|
|
25566
|
-
};
|
|
25567
25674
|
const elements = contentElements.map((contentElement) => {
|
|
25675
|
+
if (!("type" in contentElement))
|
|
25676
|
+
return null;
|
|
25568
25677
|
const Component = components[contentElement.type];
|
|
25569
25678
|
return jsx(Component, {
|
|
25570
|
-
...getProps(contentElement)
|
|
25679
|
+
...getProps(contentElement, isTopLevel)
|
|
25571
25680
|
}, getKey(contentElement.type));
|
|
25572
25681
|
});
|
|
25573
25682
|
return isTopLevel ? jsx(Accordion, {
|
|
@@ -25602,7 +25711,7 @@ function ContractViewer({
|
|
|
25602
25711
|
const pciValidationRules = {
|
|
25603
25712
|
signer: {
|
|
25604
25713
|
modes: ["blur"],
|
|
25605
|
-
validate: (signer2) =>
|
|
25714
|
+
validate: (signer2) => !isEmpty(signer2),
|
|
25606
25715
|
errorMessage: "fieldIsRequired"
|
|
25607
25716
|
},
|
|
25608
25717
|
acceptPci: {
|
|
@@ -25617,7 +25726,7 @@ function PciDropinComponent({
|
|
|
25617
25726
|
pciTemplateResponse,
|
|
25618
25727
|
handleHomeClick,
|
|
25619
25728
|
handleSign,
|
|
25620
|
-
taskType,
|
|
25729
|
+
taskType = TaskTypes.PCI_DSS,
|
|
25621
25730
|
eventEmitter,
|
|
25622
25731
|
trackingConfig
|
|
25623
25732
|
}) {
|
|
@@ -25634,7 +25743,7 @@ function PciDropinComponent({
|
|
|
25634
25743
|
legalEntity: legalEntityResponse,
|
|
25635
25744
|
task: taskType
|
|
25636
25745
|
});
|
|
25637
|
-
const [loadingStatus, setLoadingStatus] = useState(
|
|
25746
|
+
const [loadingStatus, setLoadingStatus] = useState();
|
|
25638
25747
|
const {
|
|
25639
25748
|
handleChangeFor,
|
|
25640
25749
|
triggerValidation,
|
|
@@ -25651,15 +25760,15 @@ function PciDropinComponent({
|
|
|
25651
25760
|
} = pciTemplateResponse;
|
|
25652
25761
|
const pciQuestionnaire = JSON.parse(decodeURIComponent(escape(window.atob(pciTemplateResponse.content))));
|
|
25653
25762
|
const uniqueEntityAssociations = [...new Map(getOwnDecisionMakers(legalEntityResponse).map((entityAssociation) => [entityAssociation.legalEntityId, entityAssociation])).values()];
|
|
25654
|
-
const signers = legalEntityResponse.type === LegalEntityType.ORGANIZATION ? uniqueEntityAssociations.map(({
|
|
25763
|
+
const signers = legalEntityResponse.type === LegalEntityType.ORGANIZATION ? uniqueEntityAssociations.filter((ea) => Boolean(ea.legalEntityId && ea.name)).map(({
|
|
25655
25764
|
legalEntityId: id2,
|
|
25656
25765
|
name
|
|
25657
25766
|
}) => ({
|
|
25658
25767
|
id: id2,
|
|
25659
25768
|
name
|
|
25660
25769
|
})) : [{
|
|
25661
|
-
id: legalEntityResponse
|
|
25662
|
-
name: `${(_a = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _a.name.firstName} ${(_b = legalEntityResponse
|
|
25770
|
+
id: legalEntityResponse.id,
|
|
25771
|
+
name: `${(_a = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _a.name.firstName} ${(_b = legalEntityResponse.individual) == null ? void 0 : _b.name.lastName}`
|
|
25663
25772
|
}];
|
|
25664
25773
|
const handleSignClick = async () => {
|
|
25665
25774
|
if (loadingStatus === "loading")
|
|
@@ -25777,7 +25886,7 @@ function PciDropinComponent({
|
|
|
25777
25886
|
children: (childProps) => jsx(Checkbox, {
|
|
25778
25887
|
...childProps,
|
|
25779
25888
|
label: acceptPciLabel,
|
|
25780
|
-
checked: data.acceptPci,
|
|
25889
|
+
checked: data.acceptPci ?? false,
|
|
25781
25890
|
name: "acceptPci",
|
|
25782
25891
|
onChange: handleChangeFor("acceptPci")
|
|
25783
25892
|
})
|
|
@@ -26121,7 +26230,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
26121
26230
|
selected: data.role ?? [],
|
|
26122
26231
|
onSelect: changeRoles,
|
|
26123
26232
|
mapToSelectItem: (role2) => ({
|
|
26124
|
-
...
|
|
26233
|
+
...makeSelectItemForRole(role2, i18n),
|
|
26125
26234
|
disabled: !availableRoles.includes(role2)
|
|
26126
26235
|
})
|
|
26127
26236
|
})
|
|
@@ -26200,7 +26309,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
26200
26309
|
labels: formUtils.getFieldLabels(COUNTRY_FIELD),
|
|
26201
26310
|
readonly: false,
|
|
26202
26311
|
classNameModifiers: COUNTRY_FIELD,
|
|
26203
|
-
allowedCountries:
|
|
26312
|
+
allowedCountries: void 0,
|
|
26204
26313
|
handleChangeFor
|
|
26205
26314
|
}), jsx(LegalCompanyNameField, {
|
|
26206
26315
|
data: formUtils.getFieldData(data, LEGAL_COMPANY_NAME_FIELD),
|
|
@@ -26349,7 +26458,7 @@ function RoleAndTypeDropinComponent({
|
|
|
26349
26458
|
});
|
|
26350
26459
|
const [activeForm, setActiveForm] = useState(regularForms.roleAndEntityType);
|
|
26351
26460
|
const isSummaryStep = activeForm.formId === summaryStep.formId;
|
|
26352
|
-
const formatRolesForSummary = (roles) => roles.map((role2) => i18n.get(
|
|
26461
|
+
const formatRolesForSummary = (roles) => roles.map((role2) => i18n.get(getRoleName(role2))).join(", ");
|
|
26353
26462
|
const formatSettlorExemptionReasonsForSummary = (reasons) => reasons.map((reason) => i18n.get(reason)).join(", ");
|
|
26354
26463
|
const summaryData = trustMember === "incomplete" ? {} : {
|
|
26355
26464
|
roleAndEntityType: {
|
|
@@ -26523,7 +26632,8 @@ const serviceAgreementTypesTranslationMapping = {
|
|
|
26523
26632
|
adyenCapital: "capitalUserTerms",
|
|
26524
26633
|
adyenAccount: "businessAccountTerms",
|
|
26525
26634
|
adyenCard: "cardUserTerms",
|
|
26526
|
-
adyenFranchisee: "franchiseesTAndCs"
|
|
26635
|
+
adyenFranchisee: "franchiseesTAndCs",
|
|
26636
|
+
adyenPccr: "pccr"
|
|
26527
26637
|
};
|
|
26528
26638
|
function ServiceAgreementDropinComponent({
|
|
26529
26639
|
legalEntityResponse,
|
|
@@ -26751,7 +26861,7 @@ function ServiceAgreementDropinComponent({
|
|
|
26751
26861
|
});
|
|
26752
26862
|
}
|
|
26753
26863
|
function removeObjectPropsWithEmptyValues(obj) {
|
|
26754
|
-
|
|
26864
|
+
keysOf(obj).forEach((key) => {
|
|
26755
26865
|
if (obj[key] === null || isEmpty(obj[key]))
|
|
26756
26866
|
delete obj[key];
|
|
26757
26867
|
});
|
|
@@ -27902,7 +28012,7 @@ function DropinComposerComponent({
|
|
|
27902
28012
|
return TaskTypes.TASKS_OVERVIEW;
|
|
27903
28013
|
}, [showBusinessTypeSelection, showIntroduction]);
|
|
27904
28014
|
const [taskHistory, setTaskHistory] = useState([initialTask]);
|
|
27905
|
-
const [
|
|
28015
|
+
const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
|
|
27906
28016
|
const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
|
|
27907
28017
|
const [associatedLegalEntityParent, setAssociatedLegalEntityParent] = useState(null);
|
|
27908
28018
|
const [legalEntityType, setLegalEntityType] = useState(null);
|
|
@@ -27920,9 +28030,9 @@ function DropinComposerComponent({
|
|
|
27920
28030
|
const [transferInstrument, setTransferInstrument] = useState(null);
|
|
27921
28031
|
const [capabilityProblems, setCapabilityProblems] = useState(getCapabilityProblems(legalEntityResponse));
|
|
27922
28032
|
const [bankVerificationVendors, setBankVerificationVendors] = useState();
|
|
27923
|
-
const rootLegalEntityCountry =
|
|
27924
|
-
const hasTrust =
|
|
27925
|
-
const reviewRequired = (
|
|
28033
|
+
const rootLegalEntityCountry = rootLegalEntity.type === LegalEntityType.INDIVIDUAL ? (_a = rootLegalEntity.individual.residentialAddress) == null ? void 0 : _a.country : (_b = rootLegalEntity.organization.registeredAddress) == null ? void 0 : _b.country;
|
|
28034
|
+
const hasTrust = accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
|
|
28035
|
+
const reviewRequired = (rootLegalEntity == null ? void 0 : rootLegalEntity.id) && ((_d = (_c = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _c[rootLegalEntity.id]) == null ? void 0 : _d.isReviewRequired);
|
|
27926
28036
|
const additionalSalesChannels = useSalesChannelsSettings();
|
|
27927
28037
|
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), trust2 == null ? void 0 : trust2.trust.countryOfGoverningLaw);
|
|
27928
28038
|
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
@@ -27935,12 +28045,12 @@ function DropinComposerComponent({
|
|
|
27935
28045
|
};
|
|
27936
28046
|
const getPciStatus = async () => {
|
|
27937
28047
|
var _a2, _b2;
|
|
27938
|
-
if (
|
|
28048
|
+
if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetPciStatus)) {
|
|
27939
28049
|
try {
|
|
27940
|
-
const response = await args.handleGetPciStatus(
|
|
28050
|
+
const response = await args.handleGetPciStatus(rootLegalEntity.id, {
|
|
27941
28051
|
additionalSalesChannels
|
|
27942
28052
|
});
|
|
27943
|
-
response.hasDocuments = ((_b2 = (_a2 = await (args == null ? void 0 : args.handleGetPciQuestionnaires(
|
|
28053
|
+
response.hasDocuments = ((_b2 = (_a2 = await (args == null ? void 0 : args.handleGetPciQuestionnaires(rootLegalEntity.id))) == null ? void 0 : _a2.data) == null ? void 0 : _b2.length) > 0;
|
|
27944
28054
|
setPciStatus(response);
|
|
27945
28055
|
return response;
|
|
27946
28056
|
} catch (e) {
|
|
@@ -27951,7 +28061,7 @@ function DropinComposerComponent({
|
|
|
27951
28061
|
};
|
|
27952
28062
|
const getPciTemplate = useCallback(async () => {
|
|
27953
28063
|
const requestPciTemplate = async (language) => {
|
|
27954
|
-
const response = await args.handleGetPciTemplate(
|
|
28064
|
+
const response = await args.handleGetPciTemplate(rootLegalEntity.id, {
|
|
27955
28065
|
language,
|
|
27956
28066
|
additionalSalesChannels
|
|
27957
28067
|
});
|
|
@@ -27969,16 +28079,16 @@ function DropinComposerComponent({
|
|
|
27969
28079
|
await requestPciTemplate(fallbackLanguageCode);
|
|
27970
28080
|
}
|
|
27971
28081
|
}
|
|
27972
|
-
}, [additionalSalesChannels, i18n,
|
|
28082
|
+
}, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
|
|
27973
28083
|
useEffect(() => {
|
|
27974
28084
|
if (!tasks.includes(TaskTypes.PCI_DSS))
|
|
27975
28085
|
return;
|
|
27976
28086
|
getPciTemplate().catch(logger$6.error);
|
|
27977
28087
|
}, [getPciTemplate, tasks]);
|
|
27978
28088
|
const getServiceAgreementAcceptanceInfos = async () => {
|
|
27979
|
-
if (
|
|
28089
|
+
if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
|
|
27980
28090
|
try {
|
|
27981
|
-
const response = await args.handleGetServiceAgreementAcceptanceInfos(
|
|
28091
|
+
const response = await args.handleGetServiceAgreementAcceptanceInfos(rootLegalEntity.id);
|
|
27982
28092
|
setServiceAgreementAcceptanceInfos(response.data);
|
|
27983
28093
|
} catch (e) {
|
|
27984
28094
|
logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
@@ -27986,9 +28096,9 @@ function DropinComposerComponent({
|
|
|
27986
28096
|
}
|
|
27987
28097
|
};
|
|
27988
28098
|
const getServiceAgreementStatus = async () => {
|
|
27989
|
-
if (
|
|
28099
|
+
if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementStatus)) {
|
|
27990
28100
|
try {
|
|
27991
|
-
const response = await args.handleGetServiceAgreementStatus(
|
|
28101
|
+
const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
|
|
27992
28102
|
setServiceAgreementTypes(response.termsOfServiceTypes);
|
|
27993
28103
|
} catch (e) {
|
|
27994
28104
|
logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
@@ -27996,7 +28106,7 @@ function DropinComposerComponent({
|
|
|
27996
28106
|
}
|
|
27997
28107
|
};
|
|
27998
28108
|
const getSolePropietor = async () => {
|
|
27999
|
-
const id2 = getOwnSoleProprietorshipIdArray(
|
|
28109
|
+
const id2 = getOwnSoleProprietorshipIdArray(rootLegalEntity)[0];
|
|
28000
28110
|
if (id2) {
|
|
28001
28111
|
try {
|
|
28002
28112
|
const response = await (args == null ? void 0 : args.handleGetLegalEntity(id2));
|
|
@@ -28023,10 +28133,10 @@ function DropinComposerComponent({
|
|
|
28023
28133
|
}
|
|
28024
28134
|
};
|
|
28025
28135
|
const refreshLegalEntity = async () => {
|
|
28026
|
-
if (
|
|
28136
|
+
if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetLegalEntity)) {
|
|
28027
28137
|
try {
|
|
28028
|
-
const response = await (args == null ? void 0 : args.handleGetLegalEntity(
|
|
28029
|
-
|
|
28138
|
+
const response = await (args == null ? void 0 : args.handleGetLegalEntity(rootLegalEntity.id));
|
|
28139
|
+
setRootLegalEntity(response);
|
|
28030
28140
|
setCapabilityProblems(getCapabilityProblems(response));
|
|
28031
28141
|
return response;
|
|
28032
28142
|
} catch (e) {
|
|
@@ -28182,11 +28292,11 @@ function DropinComposerComponent({
|
|
|
28182
28292
|
onNavigate(task);
|
|
28183
28293
|
};
|
|
28184
28294
|
const onNavigateToDecisionMakerIndividual = async (task, id2, parentId) => {
|
|
28185
|
-
if (parentId && parentId !==
|
|
28295
|
+
if (parentId && parentId !== rootLegalEntity.id) {
|
|
28186
28296
|
const parentLegalEntity = await (args == null ? void 0 : args.handleGetLegalEntity(parentId));
|
|
28187
28297
|
setAssociatedLegalEntityParent(parentLegalEntity);
|
|
28188
28298
|
} else {
|
|
28189
|
-
setAssociatedLegalEntityParent(
|
|
28299
|
+
setAssociatedLegalEntityParent(rootLegalEntity);
|
|
28190
28300
|
}
|
|
28191
28301
|
if (id2 && (args == null ? void 0 : args.handleGetLegalEntity)) {
|
|
28192
28302
|
try {
|
|
@@ -28208,7 +28318,7 @@ function DropinComposerComponent({
|
|
|
28208
28318
|
if (id2) {
|
|
28209
28319
|
try {
|
|
28210
28320
|
await getTransferInstrument2(id2);
|
|
28211
|
-
if (hasSolePropInLegalEntity(
|
|
28321
|
+
if (hasSolePropInLegalEntity(rootLegalEntity) && !solePropietor) {
|
|
28212
28322
|
await getSolePropietor();
|
|
28213
28323
|
}
|
|
28214
28324
|
} finally {
|
|
@@ -28239,7 +28349,7 @@ function DropinComposerComponent({
|
|
|
28239
28349
|
};
|
|
28240
28350
|
const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
|
|
28241
28351
|
var _a2, _b2;
|
|
28242
|
-
const trustId = (_b2 = (_a2 =
|
|
28352
|
+
const trustId = (_b2 = (_a2 = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a2.find((association2) => association2.type === LegalEntityType.TRUST)) == null ? void 0 : _b2.legalEntityId;
|
|
28243
28353
|
if (trustId) {
|
|
28244
28354
|
try {
|
|
28245
28355
|
const currentTrust = await (args == null ? void 0 : args.handleGetLegalEntity(trustId));
|
|
@@ -28347,13 +28457,13 @@ function DropinComposerComponent({
|
|
|
28347
28457
|
trackingConfig: {
|
|
28348
28458
|
topLevelLegalEntity: legalEntityResponse
|
|
28349
28459
|
},
|
|
28350
|
-
legalEntity,
|
|
28460
|
+
legalEntity: rootLegalEntity,
|
|
28351
28461
|
task: TaskTypes.PCI_DSS
|
|
28352
28462
|
});
|
|
28353
28463
|
try {
|
|
28354
|
-
const response = await (args == null ? void 0 : args.handleGetPciQuestionnaires(
|
|
28464
|
+
const response = await (args == null ? void 0 : args.handleGetPciQuestionnaires(rootLegalEntity.id));
|
|
28355
28465
|
await Promise.all(response.data.map(async (pciQuestionnaireInfo) => {
|
|
28356
|
-
const pciQuestionnaire = await (args == null ? void 0 : args.handleDownloadPci(
|
|
28466
|
+
const pciQuestionnaire = await (args == null ? void 0 : args.handleDownloadPci(rootLegalEntity.id, pciQuestionnaireInfo.id));
|
|
28357
28467
|
await downloadFile(pciQuestionnaire.content, `${pciQuestionnaire.id}.pdf`);
|
|
28358
28468
|
}));
|
|
28359
28469
|
} catch (e) {
|
|
@@ -28378,7 +28488,7 @@ function DropinComposerComponent({
|
|
|
28378
28488
|
const data = await getConfiguration2({
|
|
28379
28489
|
country: contextCountry,
|
|
28380
28490
|
capabilities,
|
|
28381
|
-
legalEntityType:
|
|
28491
|
+
legalEntityType: rootLegalEntity.type
|
|
28382
28492
|
});
|
|
28383
28493
|
if (data == null ? void 0 : data.bankVerificationProviders) {
|
|
28384
28494
|
setBankVerificationVendors(data.bankVerificationProviders);
|
|
@@ -28397,21 +28507,21 @@ function DropinComposerComponent({
|
|
|
28397
28507
|
setIsLoadingConfiguration(false);
|
|
28398
28508
|
onLoad();
|
|
28399
28509
|
});
|
|
28400
|
-
}, [
|
|
28510
|
+
}, [rootLegalEntity.type, contextCountry]);
|
|
28401
28511
|
useEffect(() => {
|
|
28402
|
-
if (hasRejectedCapabilities(
|
|
28512
|
+
if (hasRejectedCapabilities(rootLegalEntity)) {
|
|
28403
28513
|
setTaskHistory([TaskTypes.CAPABILITY_REJECTED]);
|
|
28404
28514
|
}
|
|
28405
|
-
}, [
|
|
28515
|
+
}, [rootLegalEntity]);
|
|
28406
28516
|
useEffect(() => {
|
|
28407
28517
|
if (PAGES_WITH_STATUS.includes(taskHistory[taskHistory.length - 1])) {
|
|
28408
28518
|
if (!pollingId) {
|
|
28409
28519
|
const pollingInterval = setInterval(async () => {
|
|
28410
|
-
if (hasRejectedCapabilities(
|
|
28520
|
+
if (hasRejectedCapabilities(rootLegalEntity)) {
|
|
28411
28521
|
setTaskHistory([TaskTypes.CAPABILITY_REJECTED]);
|
|
28412
28522
|
clearInterval(pollingId);
|
|
28413
28523
|
setPollingId(null);
|
|
28414
|
-
} else if (hasResolvedCapabilities(
|
|
28524
|
+
} else if (hasResolvedCapabilities(rootLegalEntity)) {
|
|
28415
28525
|
clearInterval(pollingId);
|
|
28416
28526
|
setPollingId(null);
|
|
28417
28527
|
} else {
|
|
@@ -28436,9 +28546,9 @@ function DropinComposerComponent({
|
|
|
28436
28546
|
case TaskTypes.BUSINESS_TYPE_SELECTION:
|
|
28437
28547
|
return jsx(BusinessTypeSelection, {
|
|
28438
28548
|
...args,
|
|
28439
|
-
legalEntityResponse:
|
|
28549
|
+
legalEntityResponse: rootLegalEntity,
|
|
28440
28550
|
accountHolder: accountHolder2,
|
|
28441
|
-
showTrustOption:
|
|
28551
|
+
showTrustOption: TRUST_COUNTRIES.includes(rootLegalEntityCountry),
|
|
28442
28552
|
showSolePropOption: SOLE_PROP_COUNTRIES.includes(rootLegalEntityCountry),
|
|
28443
28553
|
onAccountHolderSelect: async (newAccountHolder) => {
|
|
28444
28554
|
setAccountHolder(newAccountHolder);
|
|
@@ -28448,7 +28558,7 @@ function DropinComposerComponent({
|
|
|
28448
28558
|
});
|
|
28449
28559
|
case TaskTypes.INTRODUCTION:
|
|
28450
28560
|
return jsx(Introduction, {
|
|
28451
|
-
legalEntity,
|
|
28561
|
+
legalEntity: rootLegalEntity,
|
|
28452
28562
|
onExitIntroduction: () => {
|
|
28453
28563
|
setHasSeenIntroduction(true);
|
|
28454
28564
|
onNavigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
@@ -28461,7 +28571,7 @@ function DropinComposerComponent({
|
|
|
28461
28571
|
return jsx(TaskListComponent, {
|
|
28462
28572
|
onNavigateToTask: navigateTo,
|
|
28463
28573
|
tasks,
|
|
28464
|
-
legalEntityResponse:
|
|
28574
|
+
legalEntityResponse: rootLegalEntity,
|
|
28465
28575
|
capabilityProblems,
|
|
28466
28576
|
onPciDownload,
|
|
28467
28577
|
pciStatus,
|
|
@@ -28477,7 +28587,7 @@ function DropinComposerComponent({
|
|
|
28477
28587
|
topLevelLegalEntity: legalEntityResponse
|
|
28478
28588
|
},
|
|
28479
28589
|
parentLegalEntity: associatedLegalEntityParent,
|
|
28480
|
-
legalEntityResponse:
|
|
28590
|
+
legalEntityResponse: rootLegalEntity,
|
|
28481
28591
|
onNavigateToIndividual: (legalEntityId) => onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER, legalEntityId),
|
|
28482
28592
|
handleUpdateLegalEntity: args == null ? void 0 : args.handleUpdateLegalEntity,
|
|
28483
28593
|
navigateBackToTaskList: navigateBack,
|
|
@@ -28493,8 +28603,8 @@ function DropinComposerComponent({
|
|
|
28493
28603
|
taskType: TaskTypes.INDIVIDUAL,
|
|
28494
28604
|
taskName: hasTrust ? "individualTrusteeDetails" : "individualDetails",
|
|
28495
28605
|
parentLegalEntity: null,
|
|
28496
|
-
legalEntityResponse:
|
|
28497
|
-
problems: getLegalEntityProblems(
|
|
28606
|
+
legalEntityResponse: rootLegalEntity,
|
|
28607
|
+
problems: getLegalEntityProblems(rootLegalEntity),
|
|
28498
28608
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
28499
28609
|
onChange: componentOnChange,
|
|
28500
28610
|
eventEmitter,
|
|
@@ -28514,7 +28624,7 @@ function DropinComposerComponent({
|
|
|
28514
28624
|
});
|
|
28515
28625
|
case TaskTypes.REVIEW:
|
|
28516
28626
|
return jsx(ReviewComponent, {
|
|
28517
|
-
legalEntityId:
|
|
28627
|
+
legalEntityId: rootLegalEntity.id,
|
|
28518
28628
|
handleReviewConfirm: args.handleReviewConfirm,
|
|
28519
28629
|
handleHomeClick: () => onNavigateTo(TaskTypes.TASKS_OVERVIEW)
|
|
28520
28630
|
});
|
|
@@ -28591,9 +28701,9 @@ function DropinComposerComponent({
|
|
|
28591
28701
|
},
|
|
28592
28702
|
taskType: TaskTypes.COMPANY,
|
|
28593
28703
|
taskName: hasTrust ? "companyTrusteeDetails" : "companyDetails",
|
|
28594
|
-
legalEntityResponse:
|
|
28704
|
+
legalEntityResponse: rootLegalEntity,
|
|
28595
28705
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
28596
|
-
problems: getLegalEntityProblems(
|
|
28706
|
+
problems: getLegalEntityProblems(rootLegalEntity),
|
|
28597
28707
|
onChange: componentOnChange,
|
|
28598
28708
|
eventEmitter,
|
|
28599
28709
|
onSubmit: async (data) => {
|
|
@@ -28619,7 +28729,7 @@ function DropinComposerComponent({
|
|
|
28619
28729
|
parentLegalEntity: trust2,
|
|
28620
28730
|
legalEntityResponse: associatedLegalEntity,
|
|
28621
28731
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
28622
|
-
problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[
|
|
28732
|
+
problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[rootLegalEntity.id],
|
|
28623
28733
|
onChange: componentOnChange,
|
|
28624
28734
|
eventEmitter,
|
|
28625
28735
|
onSubmit: (data) => refreshTrustAndRunOnSubmit(data, 2),
|
|
@@ -28642,9 +28752,9 @@ function DropinComposerComponent({
|
|
|
28642
28752
|
problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _f[transferInstrument == null ? void 0 : transferInstrument.id],
|
|
28643
28753
|
transferInstrument,
|
|
28644
28754
|
setTransferInstrument,
|
|
28645
|
-
legalEntityResponse:
|
|
28755
|
+
legalEntityResponse: rootLegalEntity,
|
|
28646
28756
|
refreshLegalEntity,
|
|
28647
|
-
accountHolder: getPayoutAccountHolderName(
|
|
28757
|
+
accountHolder: getPayoutAccountHolderName(rootLegalEntity, i18n),
|
|
28648
28758
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
28649
28759
|
onChange: componentOnChange,
|
|
28650
28760
|
eventEmitter,
|
|
@@ -28662,7 +28772,7 @@ function DropinComposerComponent({
|
|
|
28662
28772
|
},
|
|
28663
28773
|
taskType: TaskTypes.TRUST,
|
|
28664
28774
|
problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[trust2 == null ? void 0 : trust2.id],
|
|
28665
|
-
parentLegalEntity:
|
|
28775
|
+
parentLegalEntity: rootLegalEntity,
|
|
28666
28776
|
legalEntityResponse: trust2,
|
|
28667
28777
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
28668
28778
|
onChange: componentOnChange,
|
|
@@ -28676,8 +28786,8 @@ function DropinComposerComponent({
|
|
|
28676
28786
|
});
|
|
28677
28787
|
case TaskTypes.TRUST_MEMBER_OVERVIEW:
|
|
28678
28788
|
return jsx(TrustMembersOverview, {
|
|
28679
|
-
trustMembers: allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust2,
|
|
28680
|
-
getTrustMemberTaskStatus: (member) => getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems,
|
|
28789
|
+
trustMembers: allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust2, rootLegalEntity, exemptSettlor) : getTrustMembers(trust2, rootLegalEntity, exemptSettlor),
|
|
28790
|
+
getTrustMemberTaskStatus: (member) => getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, rootLegalEntity, member.trustMemberType === "undefinedBeneficiary" ? void 0 : [member.legalEntityId, ...getDirectEntityAssociations(rootLegalEntity, member.legalEntityId).map((association2) => association2.legalEntityId)]),
|
|
28681
28791
|
navigateBackToTaskList: navigateBack,
|
|
28682
28792
|
navigateToEditTrustMember: onNavigateToTrustMemberRoleAndType,
|
|
28683
28793
|
navigateToEditTrustMemberOwner: (trustMemberOwnerId, trustMemberId) => onNavigateToDecisionMakerIndividual(TaskTypes.TRUST_MEMBER_COMPANY_OWNER, trustMemberOwnerId, trustMemberId),
|
|
@@ -28697,7 +28807,7 @@ function DropinComposerComponent({
|
|
|
28697
28807
|
});
|
|
28698
28808
|
case TaskTypes.PCI_DSS:
|
|
28699
28809
|
return jsx(PciDropinComponent, {
|
|
28700
|
-
legalEntityResponse:
|
|
28810
|
+
legalEntityResponse: rootLegalEntity,
|
|
28701
28811
|
pciTemplateResponse,
|
|
28702
28812
|
trackingConfig: {
|
|
28703
28813
|
topLevelLegalEntity: legalEntityResponse
|
|
@@ -28714,7 +28824,7 @@ function DropinComposerComponent({
|
|
|
28714
28824
|
return jsx(SolePropDropinComponent, {
|
|
28715
28825
|
...args,
|
|
28716
28826
|
taskType: TaskTypes.SOLE_PROPRIETOR_COMPANY,
|
|
28717
|
-
parentLegalEntity:
|
|
28827
|
+
parentLegalEntity: rootLegalEntity,
|
|
28718
28828
|
legalEntityResponse: solePropietor,
|
|
28719
28829
|
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
28720
28830
|
problems: (_j = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _j[solePropietor == null ? void 0 : solePropietor.id],
|
|
@@ -28723,13 +28833,13 @@ function DropinComposerComponent({
|
|
|
28723
28833
|
onSubmit: componentOnSubmit,
|
|
28724
28834
|
handleHomeClick: navigateBack,
|
|
28725
28835
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
28726
|
-
country: (_l = (_k =
|
|
28836
|
+
country: (_l = (_k = rootLegalEntity == null ? void 0 : rootLegalEntity.individual) == null ? void 0 : _k.residentialAddress) == null ? void 0 : _l.country,
|
|
28727
28837
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
28728
28838
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
28729
28839
|
});
|
|
28730
28840
|
case TaskTypes.SERVICE_AGREEMENT:
|
|
28731
28841
|
return jsx(ServiceAgreementDropinComponent, {
|
|
28732
|
-
legalEntityResponse:
|
|
28842
|
+
legalEntityResponse: rootLegalEntity,
|
|
28733
28843
|
trackingConfig: {
|
|
28734
28844
|
topLevelLegalEntity: legalEntityResponse
|
|
28735
28845
|
},
|
|
@@ -28748,6 +28858,7 @@ function DropinComposerComponent({
|
|
|
28748
28858
|
case TaskTypes.LEGAL_ENTITY_TYPE_SWITCHER:
|
|
28749
28859
|
return jsx(LegalEntityTypeSwitcher, {
|
|
28750
28860
|
...args,
|
|
28861
|
+
handleUpdateLegalEntity: args.handleUpdateLegalEntity,
|
|
28751
28862
|
targetLegalEntityType: legalEntityType,
|
|
28752
28863
|
legalEntityResponse,
|
|
28753
28864
|
handleHomeClick: navigateBack,
|