@adyen/kyc-components 2.32.2 → 2.33.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 +259 -90
- package/dist/style.css +3 -0
- package/dist/types/components/CompanyBasics/component/CompanyBasicsComponent.d.ts +1 -1
- package/dist/types/components/CompanyBasics/types.d.ts +2 -0
- package/dist/types/components/Introduction/constants.d.ts +14 -0
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
- package/dist/types/components/internal/BusinessRegistrationNumberField/types.d.ts +9 -0
- package/dist/types/components/internal/TaxInformationField/TaxInformationField.d.ts +1 -1
- package/dist/types/components/internal/TaxInformationField/types.d.ts +7 -0
- package/dist/types/components/internal/VatNumberField/VatNumberField.d.ts +1 -1
- package/dist/types/components/internal/VatNumberField/types.d.ts +4 -0
- package/dist/types/core/Context/SettingsContext/types.d.ts +2 -0
- package/dist/types/core/Context/SettingsContext/useSetting.d.ts +1 -1
- package/dist/types/core/hooks/useLeId.d.ts +1 -0
- package/dist/types/language/config.d.ts +2 -0
- package/dist/types/utils/entity-status-util.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/core/hooks/useBusinessTypeSelection.d.ts +0 -2
|
@@ -2,7 +2,7 @@ import { useContext, useState, useCallback, useEffect, useMemo, useReducer, useR
|
|
|
2
2
|
import { createContext, createElement, render } from "preact";
|
|
3
3
|
import { sanitize } from "isomorphic-dompurify";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1
|
|
5
|
+
import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1 } from "preact/compat";
|
|
6
6
|
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
7
7
|
import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
|
|
8
8
|
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
@@ -617,7 +617,7 @@ const noGlare = "No glare";
|
|
|
617
617
|
const selectDocumentType = "Select document type";
|
|
618
618
|
const registrationDocumentSubTitle = "Upload your company’s business registration document. We need to see this document so we can verify your company.";
|
|
619
619
|
const documentIssuedByGovernmentAuthority = "The document has to be issued by a government authority. It’s usually given when a business is created at the local commercial register";
|
|
620
|
-
const uploadTaxationDocument = "Upload a
|
|
620
|
+
const uploadTaxationDocument = "Upload a tax return or taxation registration document. We need to see this document so we can verify that your tax ID number belongs to your company.";
|
|
621
621
|
const containsNameOfCompany = "Contains the name of your company or organization";
|
|
622
622
|
const documentShowsTaxIdOfCompany = "The document shows the tax ID number of the company";
|
|
623
623
|
const issuedByTheTaxAuthority = "Issued by the tax authority or government of the country where the company is registered";
|
|
@@ -865,14 +865,14 @@ const marketIdentifierCodeMIC = "Market Identifier Code (MIC)";
|
|
|
865
865
|
const isin = "ISIN";
|
|
866
866
|
const companyLookupResultsHeader = "Let's find your company";
|
|
867
867
|
const companyLookupResultsHeader__searching = "Searching for companies...";
|
|
868
|
-
const companyLookupResultsHeader__verifying = "Verifying
|
|
868
|
+
const companyLookupResultsHeader__verifying = "Verifying company selection...";
|
|
869
869
|
const companyLookupResultsHeader__noResults = "We couldn't find your company";
|
|
870
870
|
const companyLookupResultsHeader__results = "Select your company";
|
|
871
871
|
const companyLookupResultsHeader__searchFailure = "Sorry, something went wrong";
|
|
872
872
|
const companyLookupResultsHeaderDescription__noResults = "No problem, let's enter your company details in the next steps.";
|
|
873
|
-
const companyLookupResultsHeaderDescription__results = "
|
|
873
|
+
const companyLookupResultsHeaderDescription__results = "We'll find your official company details to help you get verified faster. If your company isn't in this list, you can always continue by pressing Next.";
|
|
874
874
|
const companyLookupResultsHeaderDescription__searchFailure = "If that doesn't work, press Next to continue.";
|
|
875
|
-
const companyLookupResultsListAlert__title__verified = "Your
|
|
875
|
+
const companyLookupResultsListAlert__title__verified = "Your company details will be pre-filled in the relevant sections.";
|
|
876
876
|
const companyLookupResultsListAlert__title__warning = "This company's TIN doesn't match yours";
|
|
877
877
|
const companyLookupResultsListAlert__title__error = "Sorry, something went wrong. Try again or continue by pressing Next";
|
|
878
878
|
const companyLookupResultsListAlert__description__warning = "Check the TIN you've entered, or select a different company.";
|
|
@@ -883,9 +883,9 @@ const companyStructureFormName = "Company structure";
|
|
|
883
883
|
const companyStructureFormDescription = "What type of company do you have?";
|
|
884
884
|
const companyOtherDetailsFormName = "Other details";
|
|
885
885
|
const companyRegistrationDocumentFormName = "Registration document";
|
|
886
|
-
const companyRegistrationDocumentFormDescription = "Please upload
|
|
886
|
+
const companyRegistrationDocumentFormDescription = "Please upload your companies registration document so we can verify your information.";
|
|
887
887
|
const companyTaxDocumentFormName = "Tax document";
|
|
888
|
-
const companyTaxDocumentFormDescription = "Please upload
|
|
888
|
+
const companyTaxDocumentFormDescription = "Please upload your companies tax documents so we can verify your information.";
|
|
889
889
|
const errorMessage_1_10 = "Information couldn’t be verified";
|
|
890
890
|
const errorMessage_1_11 = "Document didn’t meet requirements";
|
|
891
891
|
const errorMessage_1_12 = "Legal entity declined";
|
|
@@ -1108,6 +1108,7 @@ const errorMessage_2_8064 = "UBO through ownership was missing.";
|
|
|
1108
1108
|
const errorMessage_2_8067 = "Signatory was missing.";
|
|
1109
1109
|
const errorMessage_2_8141 = "Registration document was missing.";
|
|
1110
1110
|
const errorMessage_2_8162 = "proofOfOrganizationTaxInfo was missing.";
|
|
1111
|
+
const errorMessage_2_8183 = "'webAddress' was missing.";
|
|
1111
1112
|
const errorMessage_2_8189 = "UBO through control was missing.";
|
|
1112
1113
|
const errorMessage_2_8193 = "Director was missing.";
|
|
1113
1114
|
const errorMessage_3_10 = "Review of data is required";
|
|
@@ -1153,6 +1154,7 @@ const remediationMessage_1_705 = "Upload an official bank statement";
|
|
|
1153
1154
|
const remediationMessage_2_123 = "You haven't added an owner";
|
|
1154
1155
|
const remediationMessage_2_124 = "You haven't added a signatory";
|
|
1155
1156
|
const remediationMessage_2_151 = "You haven't added a controlling person";
|
|
1157
|
+
const remediationMessage_2_178 = "Add 'webAddress' to business line.";
|
|
1156
1158
|
const remediationMessage_2_185 = "You haven't added your directors";
|
|
1157
1159
|
const remediationMessage_3_100 = "Check the above information, then click here to confirm.";
|
|
1158
1160
|
const sameNameAsLegalName = "Same as legal name of the company";
|
|
@@ -2340,6 +2342,7 @@ const defaultTrans = {
|
|
|
2340
2342
|
errorMessage_2_8067,
|
|
2341
2343
|
errorMessage_2_8141,
|
|
2342
2344
|
errorMessage_2_8162,
|
|
2345
|
+
errorMessage_2_8183,
|
|
2343
2346
|
errorMessage_2_8189,
|
|
2344
2347
|
errorMessage_2_8193,
|
|
2345
2348
|
errorMessage_3_10,
|
|
@@ -2385,6 +2388,7 @@ const defaultTrans = {
|
|
|
2385
2388
|
remediationMessage_2_123,
|
|
2386
2389
|
remediationMessage_2_124,
|
|
2387
2390
|
remediationMessage_2_151,
|
|
2391
|
+
remediationMessage_2_178,
|
|
2388
2392
|
remediationMessage_2_185,
|
|
2389
2393
|
remediationMessage_3_100,
|
|
2390
2394
|
sameNameAsLegalName,
|
|
@@ -2695,6 +2699,7 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
|
|
|
2695
2699
|
SettingNames2["AllowIntraRegionCrossBorderPayout"] = "allowIntraRegionCrossBorderPayout";
|
|
2696
2700
|
SettingNames2["AllowLegalEntityTypeChange"] = "changeLegalEntityType";
|
|
2697
2701
|
SettingNames2["AllowPrefilledCountryEdit"] = "editPrefilledCountry";
|
|
2702
|
+
SettingNames2["LimitToOneTransferInstrument"] = "limitToOneTransferInstrument";
|
|
2698
2703
|
SettingNames2["RequirePciSignEcommerce"] = "requirePciSignEcommerce";
|
|
2699
2704
|
SettingNames2["RequirePciSignPos"] = "requirePciSignPos";
|
|
2700
2705
|
SettingNames2["RequirePciSignEcomMoto"] = "requirePciSignEcomMoto";
|
|
@@ -8031,7 +8036,7 @@ function BusinessRegistrationNumber(props) {
|
|
|
8031
8036
|
...formUtils.getMask("registrationNumber")
|
|
8032
8037
|
}), formUtils.isRequiredField("exemptedFromRegistrationNumber") && !showExemptedOption && jsx(Checkbox, {
|
|
8033
8038
|
name: "exemptedFromRegistrationNumber",
|
|
8034
|
-
label: formUtils.getLabel("
|
|
8039
|
+
label: formUtils.getLabel("iDontHaveARegistrationNumber"),
|
|
8035
8040
|
value: "exemptedFromRegistrationNumber",
|
|
8036
8041
|
readonly: formUtils.isReadOnly("exemptedFromRegistrationNumber"),
|
|
8037
8042
|
classNameModifiers: ["exempted-from-registration"],
|
|
@@ -12980,6 +12985,9 @@ const rules$2 = ({
|
|
|
12980
12985
|
if (country2 === "DE" && (companyType2 === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION || companyType2 === CompanyTypesValue.NON_PROFIT_OR_CHARITABLE)) {
|
|
12981
12986
|
return "REQUIRED";
|
|
12982
12987
|
}
|
|
12988
|
+
if (country2 === "DK" && companyType2 === CompanyTypesValue.NON_PROFIT_OR_CHARITABLE) {
|
|
12989
|
+
return "REQUIRED";
|
|
12990
|
+
}
|
|
12983
12991
|
},
|
|
12984
12992
|
countryRequiresRegistrationNumberForSoleProps: () => {
|
|
12985
12993
|
if (!COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country2)) {
|
|
@@ -21806,7 +21814,7 @@ const entityProblemInitialState = {
|
|
|
21806
21814
|
// default status - if the entity is not listed in the problems array
|
|
21807
21815
|
validationErrors: {}
|
|
21808
21816
|
};
|
|
21809
|
-
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8189"];
|
|
21817
|
+
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189"];
|
|
21810
21818
|
const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
|
|
21811
21819
|
function getCapabilityProblems(response, country2, isExperimentEnabled) {
|
|
21812
21820
|
const capabilities = (response == null ? void 0 : response.capabilities) || {};
|
|
@@ -24544,11 +24552,15 @@ function TaxInformationField({
|
|
|
24544
24552
|
readonly,
|
|
24545
24553
|
handleChangeFor,
|
|
24546
24554
|
country: country2,
|
|
24547
|
-
canExempt
|
|
24555
|
+
canExempt,
|
|
24556
|
+
companyType: companyType2,
|
|
24557
|
+
taxIdNumberType,
|
|
24558
|
+
setTaxIdNumberType
|
|
24548
24559
|
}) {
|
|
24560
|
+
var _a;
|
|
24549
24561
|
const currentCountryTaxInformation = useMemo(() => {
|
|
24550
|
-
var
|
|
24551
|
-
return (
|
|
24562
|
+
var _a2;
|
|
24563
|
+
return (_a2 = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a2.find((taxInfo) => taxInfo.country === country2);
|
|
24552
24564
|
}, [data, country2]);
|
|
24553
24565
|
const handleTaxInformationInput = (value) => {
|
|
24554
24566
|
if (!data.taxInformation) {
|
|
@@ -24603,8 +24615,33 @@ function TaxInformationField({
|
|
|
24603
24615
|
});
|
|
24604
24616
|
return handleChangeFor("taxInformation", "blur")(updatedTaxInformation);
|
|
24605
24617
|
};
|
|
24606
|
-
|
|
24607
|
-
|
|
24618
|
+
const showTaxIdExemptedOption = canExempt && (((_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a.length) ?? 0) > 1;
|
|
24619
|
+
const handleTaxIdNumberTypeChange = (taxIdType) => {
|
|
24620
|
+
if (taxIdType === "exempted") {
|
|
24621
|
+
if (!canExempt) {
|
|
24622
|
+
throw Error(`${country2} does not allow tax exemptions`);
|
|
24623
|
+
}
|
|
24624
|
+
handleChangeFor("exemptedFromTax")(true);
|
|
24625
|
+
setTaxIdNumberType(void 0);
|
|
24626
|
+
return;
|
|
24627
|
+
}
|
|
24628
|
+
if (canExempt && data.exemptedFromTax === true) {
|
|
24629
|
+
handleChangeFor("exemptedFromTax")(false);
|
|
24630
|
+
}
|
|
24631
|
+
setTaxIdNumberType(taxIdType);
|
|
24632
|
+
};
|
|
24633
|
+
return jsxs("div", {
|
|
24634
|
+
className: "adyen-kyc-field__tax-information",
|
|
24635
|
+
children: [jsx(TaxIdNumberTypeSelector, {
|
|
24636
|
+
country: country2,
|
|
24637
|
+
companyType: companyType2,
|
|
24638
|
+
setSelected: handleTaxIdNumberTypeChange,
|
|
24639
|
+
selected: data.exemptedFromTax ? "exempted" : taxIdNumberType,
|
|
24640
|
+
exemptedOption: showTaxIdExemptedOption ? labels2.exemptedFromTax : false
|
|
24641
|
+
}), jsx(MaskedInputText, {
|
|
24642
|
+
"aria-required": true,
|
|
24643
|
+
"aria-label": labels2.taxInformation,
|
|
24644
|
+
"aria-invalid": !valid.taxInformation,
|
|
24608
24645
|
name: "taxInformationNumber",
|
|
24609
24646
|
label: labels2.taxInformation ?? "",
|
|
24610
24647
|
formatGuidance: (guidanceText == null ? void 0 : guidanceText.taxInformation) ?? "",
|
|
@@ -24612,15 +24649,12 @@ function TaxInformationField({
|
|
|
24612
24649
|
errorMessage: errors.taxInformation,
|
|
24613
24650
|
placeholder: placeholders == null ? void 0 : placeholders.taxInformation,
|
|
24614
24651
|
isValid: Boolean(valid.taxInformation),
|
|
24615
|
-
"aria-required": true,
|
|
24616
|
-
"aria-label": labels2.taxInformation,
|
|
24617
|
-
"aria-invalid": !valid.taxInformation,
|
|
24618
24652
|
onInput: handleTaxInformationInput,
|
|
24619
24653
|
onBlur: handleTaxInformationBlur,
|
|
24620
24654
|
disabled: data.exemptedFromTax,
|
|
24621
24655
|
readonly,
|
|
24622
24656
|
...mask
|
|
24623
|
-
}), canExempt && jsx(Checkbox, {
|
|
24657
|
+
}), canExempt && !showTaxIdExemptedOption && jsx(Checkbox, {
|
|
24624
24658
|
"aria-required": false,
|
|
24625
24659
|
"aria-label": labels2.exemptedFromTax,
|
|
24626
24660
|
"aria-invalid": false,
|
|
@@ -24687,13 +24721,14 @@ function CompanyBasics({
|
|
|
24687
24721
|
handleRefreshCompanyDataset,
|
|
24688
24722
|
handleVerifyTin,
|
|
24689
24723
|
country: country2,
|
|
24724
|
+
companyType: companyType2 = CompanyTypesValue.PRIVATE_COMPANY,
|
|
24690
24725
|
isTopLevelEntity,
|
|
24691
24726
|
baseTrackingPayload,
|
|
24692
24727
|
kompanyVerifiedData,
|
|
24693
24728
|
setKompanyAddress,
|
|
24694
24729
|
setKompanyVerifiedData
|
|
24695
24730
|
}) {
|
|
24696
|
-
var _a, _b;
|
|
24731
|
+
var _a, _b, _c, _d, _e;
|
|
24697
24732
|
const {
|
|
24698
24733
|
i18n
|
|
24699
24734
|
} = useI18nContext();
|
|
@@ -24705,6 +24740,9 @@ function CompanyBasics({
|
|
|
24705
24740
|
} = useGlobalDataSlice(COMPANY_BASICS_FORM_ID);
|
|
24706
24741
|
const [loading2, setLoading] = useState$1(false);
|
|
24707
24742
|
const allowedCountries = useAllowedCountries();
|
|
24743
|
+
const existingTaxId = (_b = (_a = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _b.number;
|
|
24744
|
+
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
|
|
24745
|
+
const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
|
|
24708
24746
|
const initialFormUtilsProps = useMemo$1(() => ({
|
|
24709
24747
|
labels: labels2,
|
|
24710
24748
|
placeholders,
|
|
@@ -24746,13 +24784,13 @@ function CompanyBasics({
|
|
|
24746
24784
|
};
|
|
24747
24785
|
case "taxInformation":
|
|
24748
24786
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
24749
|
-
taxIdNumberType
|
|
24787
|
+
taxIdNumberType
|
|
24750
24788
|
}, defaultFieldMetadata), acc);
|
|
24751
24789
|
default:
|
|
24752
24790
|
return acc;
|
|
24753
24791
|
}
|
|
24754
24792
|
}, initialFormUtilsProps);
|
|
24755
|
-
}, [country2, initialFormUtilsProps]);
|
|
24793
|
+
}, [country2, initialFormUtilsProps, taxIdNumberType]);
|
|
24756
24794
|
const schema = (requiredFields == null ? void 0 : requiredFields.length) ? requiredFields : ["legalCompanyName", "country"];
|
|
24757
24795
|
const {
|
|
24758
24796
|
schema: formSchema,
|
|
@@ -24774,7 +24812,7 @@ function CompanyBasics({
|
|
|
24774
24812
|
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
24775
24813
|
const formUtils = formUtilities(mergedFieldProps ?? initialFormUtilsProps, i18n);
|
|
24776
24814
|
const hasCompanySearchProvider = formData.country && COUNTRIES_WITH_IN_APP_SEARCH_COMPANY_VERIFICATION.includes(formData.country);
|
|
24777
|
-
const currentCountryTaxIdNumber = (
|
|
24815
|
+
const currentCountryTaxIdNumber = (_e = (_d = formData.taxInformation) == null ? void 0 : _d.find((taxInfo) => taxInfo.country === formData.country)) == null ? void 0 : _e.number;
|
|
24778
24816
|
const disabled = (field) => formUtils.isReadOnly(field) || Boolean(kompanyVerifiedData) || loading2;
|
|
24779
24817
|
useEffect$1(() => {
|
|
24780
24818
|
updateStateSlice({
|
|
@@ -24837,7 +24875,9 @@ function CompanyBasics({
|
|
|
24837
24875
|
data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
|
|
24838
24876
|
valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
|
|
24839
24877
|
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
|
|
24840
|
-
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD
|
|
24878
|
+
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
|
|
24879
|
+
exemptedFromTax: "iDontHaveATaxId"
|
|
24880
|
+
}),
|
|
24841
24881
|
mask: formUtils.getMask("taxInformation"),
|
|
24842
24882
|
helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
|
|
24843
24883
|
guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
|
|
@@ -24845,7 +24885,10 @@ function CompanyBasics({
|
|
|
24845
24885
|
handleChangeFor,
|
|
24846
24886
|
canExempt: formUtils.isRequiredField("exemptedFromTax"),
|
|
24847
24887
|
isUen: formUtils.isRequiredField("isUen"),
|
|
24848
|
-
country: formData.country
|
|
24888
|
+
country: formData.country,
|
|
24889
|
+
companyType: companyType2 ?? CompanyTypesValue.PRIVATE_COMPANY,
|
|
24890
|
+
taxIdNumberType,
|
|
24891
|
+
setTaxIdNumberType
|
|
24849
24892
|
})
|
|
24850
24893
|
}), hasCompanySearchProvider && jsx(CompanyLookupComponent, {
|
|
24851
24894
|
defaultData: data,
|
|
@@ -24868,7 +24911,7 @@ function CompanyBasics({
|
|
|
24868
24911
|
})]
|
|
24869
24912
|
});
|
|
24870
24913
|
}
|
|
24871
|
-
const CompanyBasicsComponent = memo(CompanyBasics, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.readOnly === nextProps.readOnly && prevProps.requiredFields === nextProps.requiredFields && prevProps.obscuredFields === nextProps.obscuredFields && prevProps.optionalFields === nextProps.optionalFields && prevProps.readOnlyFields === nextProps.readOnlyFields && prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.kompanyVerifiedData, nextProps.kompanyVerifiedData));
|
|
24914
|
+
const CompanyBasicsComponent = memo(CompanyBasics, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.readOnly === nextProps.readOnly && prevProps.requiredFields === nextProps.requiredFields && prevProps.obscuredFields === nextProps.obscuredFields && prevProps.optionalFields === nextProps.optionalFields && prevProps.readOnlyFields === nextProps.readOnlyFields && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.companyType === nextProps.companyType && objectsDeepEqual(prevProps.kompanyVerifiedData, nextProps.kompanyVerifiedData));
|
|
24872
24915
|
const BUSINESS_REGISTRATION_NUMBER_FIELD = ["registrationNumber", "exemptedFromRegistrationNumber"];
|
|
24873
24916
|
function BusinessRegistrationNumberField({
|
|
24874
24917
|
data,
|
|
@@ -24879,11 +24922,38 @@ function BusinessRegistrationNumberField({
|
|
|
24879
24922
|
guidanceText,
|
|
24880
24923
|
placeholders,
|
|
24881
24924
|
readonly,
|
|
24925
|
+
handleChangeFor,
|
|
24926
|
+
country: country2,
|
|
24882
24927
|
canExempt,
|
|
24883
|
-
|
|
24928
|
+
companyType: companyType2,
|
|
24929
|
+
registrationNumberOptions,
|
|
24930
|
+
registrationNumberType,
|
|
24931
|
+
setRegistrationNumberType
|
|
24884
24932
|
}) {
|
|
24885
|
-
|
|
24886
|
-
|
|
24933
|
+
const showExemptedOption = canExempt && !!registrationNumberOptions && registrationNumberOptions.length > 1;
|
|
24934
|
+
const handleCompanyRegistrationNumberTypeChange = (regNumberType) => {
|
|
24935
|
+
if (regNumberType === "exempted") {
|
|
24936
|
+
if (!canExempt) {
|
|
24937
|
+
throw Error(`${country2} does not allow tax exemptions`);
|
|
24938
|
+
}
|
|
24939
|
+
handleChangeFor("exemptedFromRegistrationNumber")(true);
|
|
24940
|
+
setRegistrationNumberType(void 0);
|
|
24941
|
+
return;
|
|
24942
|
+
}
|
|
24943
|
+
if (canExempt && data.exemptedFromRegistrationNumber === true) {
|
|
24944
|
+
handleChangeFor("exemptedFromRegistrationNumber")(false);
|
|
24945
|
+
}
|
|
24946
|
+
setRegistrationNumberType(regNumberType);
|
|
24947
|
+
};
|
|
24948
|
+
return jsxs("div", {
|
|
24949
|
+
className: "adyen-kyc-field__business-registration",
|
|
24950
|
+
children: [jsx(CompanyRegistrationNumberTypeSelector, {
|
|
24951
|
+
companyType: companyType2,
|
|
24952
|
+
country: country2,
|
|
24953
|
+
setSelected: handleCompanyRegistrationNumberTypeChange,
|
|
24954
|
+
selected: data.exemptedFromRegistrationNumber ? "exempted" : registrationNumberType,
|
|
24955
|
+
exemptedOption: showExemptedOption ? labels2.exemptedFromRegistrationNumber : false
|
|
24956
|
+
}), jsx(MaskedInputText, {
|
|
24887
24957
|
"aria-required": true,
|
|
24888
24958
|
"aria-label": labels2.registrationNumber,
|
|
24889
24959
|
"aria-invalid": !valid.registrationNumber,
|
|
@@ -25028,13 +25098,38 @@ function VatNumberField({
|
|
|
25028
25098
|
placeholders,
|
|
25029
25099
|
readonly,
|
|
25030
25100
|
handleChangeFor,
|
|
25031
|
-
canExempt
|
|
25101
|
+
canExempt,
|
|
25102
|
+
country: country2,
|
|
25103
|
+
vatNumberType,
|
|
25104
|
+
setVatNumberType
|
|
25032
25105
|
}) {
|
|
25106
|
+
var _a;
|
|
25033
25107
|
const {
|
|
25034
25108
|
i18n
|
|
25035
25109
|
} = useI18nContext();
|
|
25036
|
-
|
|
25037
|
-
|
|
25110
|
+
const showVatExemptedOption = canExempt && ((_a = taxIdNumberOptions[country2]) == null ? void 0 : _a.length) > 1;
|
|
25111
|
+
const handleVatNumberTypeChange = (vatType) => {
|
|
25112
|
+
if (vatType === "exempted") {
|
|
25113
|
+
if (!canExempt) {
|
|
25114
|
+
throw Error(`${country2} does not allow VAT exemptions`);
|
|
25115
|
+
}
|
|
25116
|
+
handleChangeFor("exemptedFromVat")(true);
|
|
25117
|
+
setVatNumberType(void 0);
|
|
25118
|
+
return;
|
|
25119
|
+
}
|
|
25120
|
+
if (canExempt && data.exemptedFromVat === true) {
|
|
25121
|
+
handleChangeFor("exemptedFromVat")(false);
|
|
25122
|
+
}
|
|
25123
|
+
setVatNumberType(vatType);
|
|
25124
|
+
};
|
|
25125
|
+
return jsxs("div", {
|
|
25126
|
+
className: "adyen-kyc-field__vat-number",
|
|
25127
|
+
children: [jsx(TaxIdNumberTypeSelector, {
|
|
25128
|
+
country: country2,
|
|
25129
|
+
setSelected: handleVatNumberTypeChange,
|
|
25130
|
+
selected: data.exemptedFromVat ? "exempted" : vatNumberType,
|
|
25131
|
+
exemptedOption: showVatExemptedOption ? labels2.exemptedFromVat : false
|
|
25132
|
+
}), jsx(MaskedInputText, {
|
|
25038
25133
|
"aria-required": true,
|
|
25039
25134
|
"aria-label": labels2.vatNumber,
|
|
25040
25135
|
"aria-invalid": !valid.vatNumber,
|
|
@@ -25054,7 +25149,7 @@ function VatNumberField({
|
|
|
25054
25149
|
disabled: data.exemptedFromVat,
|
|
25055
25150
|
readonly,
|
|
25056
25151
|
...mask
|
|
25057
|
-
}), canExempt && jsx(Checkbox, {
|
|
25152
|
+
}), canExempt && !showVatExemptedOption && jsx(Checkbox, {
|
|
25058
25153
|
"aria-required": false,
|
|
25059
25154
|
"aria-label": labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
25060
25155
|
"aria-invalid": false,
|
|
@@ -25111,14 +25206,17 @@ function CompanyOtherDetails({
|
|
|
25111
25206
|
i18n
|
|
25112
25207
|
} = useI18nContext();
|
|
25113
25208
|
const {
|
|
25114
|
-
sliceData,
|
|
25115
25209
|
updateStateSlice
|
|
25116
25210
|
} = useGlobalDataSlice(COMPANY_OTHER_DETAILS_FORM_ID);
|
|
25117
|
-
const
|
|
25118
|
-
const
|
|
25119
|
-
const [
|
|
25211
|
+
const registrationNumberOptions = useMemo$1(() => getCompanyRegistrationNumberOptions(country2, companyType2), [country2, companyType2]);
|
|
25212
|
+
const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country2, companyType2) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
|
|
25213
|
+
const [registrationNumberType, setRegistrationNumberType] = useState$1(defaultRegistrationNumberType);
|
|
25214
|
+
const defaultVatNumberType = (data == null ? void 0 : data.vatNumber) ? inferTaxIdNumberType(data == null ? void 0 : data.vatNumber, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
|
|
25215
|
+
const [vatNumberType, setVatNumberType] = useState$1(defaultVatNumberType);
|
|
25216
|
+
const existingTaxId = (_c = (_b = data == null ? void 0 : data.taxInformation) == null ? void 0 : _b.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _c.number;
|
|
25217
|
+
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
|
|
25218
|
+
const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
|
|
25120
25219
|
const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
|
|
25121
|
-
const schema = useMemo$1(() => !(sliceData == null ? void 0 : sliceData.exemptedFromVat) ? (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatAbsenceReason")) ?? directChildFields : (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatNumber")) ?? directChildFields, [requiredFields, directChildFields, sliceData]);
|
|
25122
25220
|
const initialFormUtilsProps = useMemo$1(() => ({
|
|
25123
25221
|
labels: labels2,
|
|
25124
25222
|
placeholders,
|
|
@@ -25161,27 +25259,26 @@ function CompanyOtherDetails({
|
|
|
25161
25259
|
}, defaultFieldMetadata$8), acc);
|
|
25162
25260
|
case "taxInformation":
|
|
25163
25261
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
25164
|
-
taxIdNumberType
|
|
25262
|
+
taxIdNumberType
|
|
25165
25263
|
}, defaultFieldMetadata), acc);
|
|
25166
25264
|
case "vatNumber":
|
|
25167
25265
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
|
|
25168
|
-
vatNumberType
|
|
25266
|
+
vatNumberType
|
|
25169
25267
|
}, defaultFieldMetadata$6), acc);
|
|
25170
25268
|
default:
|
|
25171
25269
|
return acc;
|
|
25172
25270
|
}
|
|
25173
25271
|
}, initialFormUtilsProps);
|
|
25174
|
-
}, [companyType2, country2, initialFormUtilsProps, registrationNumberType,
|
|
25272
|
+
}, [companyType2, country2, initialFormUtilsProps, registrationNumberType, taxIdNumberType, vatNumberType]);
|
|
25175
25273
|
const {
|
|
25176
25274
|
schema: formSchema,
|
|
25177
25275
|
data: formData,
|
|
25178
25276
|
errors: formErrors,
|
|
25179
25277
|
valid: formValid,
|
|
25180
25278
|
fieldProblems: formFieldProblems,
|
|
25181
|
-
handleChangeFor
|
|
25182
|
-
triggerValidation
|
|
25279
|
+
handleChangeFor
|
|
25183
25280
|
} = useForm({
|
|
25184
|
-
schema,
|
|
25281
|
+
schema: (currentData) => !currentData.exemptedFromVat ? (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatAbsenceReason")) ?? directChildFields : (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatNumber")) ?? directChildFields,
|
|
25185
25282
|
defaultData: data,
|
|
25186
25283
|
rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
|
|
25187
25284
|
optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
|
|
@@ -25190,14 +25287,6 @@ function CompanyOtherDetails({
|
|
|
25190
25287
|
shouldValidate
|
|
25191
25288
|
});
|
|
25192
25289
|
const formUtils = formUtilities(mergedFieldProps ?? initialFormUtilsProps, i18n);
|
|
25193
|
-
const handleBusinessRegistrationNumberTypeChange = useCallback$1((type) => {
|
|
25194
|
-
setRegistrationNumberType(type);
|
|
25195
|
-
triggerValidation(["registrationNumber"]);
|
|
25196
|
-
}, [triggerValidation]);
|
|
25197
|
-
const handleTaxIdentificationNumberTypeChange = useCallback$1((type) => {
|
|
25198
|
-
setTaxIdentificationNumberType(type);
|
|
25199
|
-
triggerValidation(["vatNumber", "taxInformation"]);
|
|
25200
|
-
}, [triggerValidation]);
|
|
25201
25290
|
useEffect$1(() => {
|
|
25202
25291
|
}, [kompanyVerifiedData]);
|
|
25203
25292
|
useEffect$1(() => {
|
|
@@ -25237,44 +25326,46 @@ function CompanyOtherDetails({
|
|
|
25237
25326
|
handleChangeFor,
|
|
25238
25327
|
legalCompanyName: legalCompanyName2
|
|
25239
25328
|
})
|
|
25240
|
-
}), formUtils.isRequiredField("registrationNumber") && jsx(CompanyRegistrationNumberTypeSelector, {
|
|
25241
|
-
companyType: companyType2,
|
|
25242
|
-
country: country2,
|
|
25243
|
-
setSelected: handleBusinessRegistrationNumberTypeChange,
|
|
25244
|
-
selected: registrationNumberType
|
|
25245
25329
|
}), formUtils.isRequiredField("registrationNumber") && jsx("div", {
|
|
25246
25330
|
className: "adyen-kyc-field-wrapper",
|
|
25247
25331
|
children: jsx(BusinessRegistrationNumberField, {
|
|
25248
25332
|
data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25249
25333
|
valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25250
25334
|
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25251
|
-
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD
|
|
25335
|
+
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
|
|
25336
|
+
exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
|
|
25337
|
+
}),
|
|
25252
25338
|
mask: formUtils.getMask("registrationNumber"),
|
|
25253
25339
|
guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25254
25340
|
placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25255
25341
|
helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25256
25342
|
readonly: formUtils.isReadOnly("registrationNumber"),
|
|
25257
25343
|
handleChangeFor,
|
|
25258
|
-
|
|
25344
|
+
country: country2,
|
|
25345
|
+
canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
|
|
25346
|
+
companyType: companyType2,
|
|
25347
|
+
registrationNumberOptions,
|
|
25348
|
+
registrationNumberType,
|
|
25349
|
+
setRegistrationNumberType
|
|
25259
25350
|
})
|
|
25260
|
-
}), formUtils.isRequiredField("vatNumber") && jsx(TaxIdNumberTypeSelector, {
|
|
25261
|
-
country: country2,
|
|
25262
|
-
setSelected: handleTaxIdentificationNumberTypeChange,
|
|
25263
|
-
selected: taxIdentificationNumberType
|
|
25264
25351
|
}), formUtils.isRequiredField("vatNumber") && jsx("div", {
|
|
25265
25352
|
className: "adyen-kyc-field-wrapper",
|
|
25266
25353
|
children: jsx(VatNumberField, {
|
|
25267
25354
|
data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
|
|
25268
25355
|
valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
|
|
25269
25356
|
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
|
|
25270
|
-
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD
|
|
25357
|
+
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
|
|
25358
|
+
exemptedFromVat: "iDontHaveAVatNumber"
|
|
25359
|
+
}),
|
|
25271
25360
|
mask: formUtils.getMask("vatNumber"),
|
|
25272
25361
|
guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
|
|
25273
25362
|
placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
|
|
25274
25363
|
readonly: formUtils.isReadOnly("vatNumber"),
|
|
25275
25364
|
handleChangeFor,
|
|
25276
25365
|
country: country2,
|
|
25277
|
-
canExempt: formUtils.isRequiredField("exemptedFromVat")
|
|
25366
|
+
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
25367
|
+
vatNumberType,
|
|
25368
|
+
setVatNumberType
|
|
25278
25369
|
})
|
|
25279
25370
|
}), formUtils.isRequiredField("taxInformation") && jsx("div", {
|
|
25280
25371
|
className: "adyen-kyc-field-wrapper",
|
|
@@ -25282,7 +25373,9 @@ function CompanyOtherDetails({
|
|
|
25282
25373
|
data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
|
|
25283
25374
|
valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
|
|
25284
25375
|
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
|
|
25285
|
-
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD
|
|
25376
|
+
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
|
|
25377
|
+
exemptedFromTax: "iDontHaveATaxId"
|
|
25378
|
+
}),
|
|
25286
25379
|
mask: formUtils.getMask("taxInformation"),
|
|
25287
25380
|
helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
|
|
25288
25381
|
guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
|
|
@@ -25290,7 +25383,10 @@ function CompanyOtherDetails({
|
|
|
25290
25383
|
handleChangeFor,
|
|
25291
25384
|
country: country2,
|
|
25292
25385
|
canExempt: formUtils.isRequiredField("exemptedFromTax"),
|
|
25293
|
-
isUen: formUtils.isRequiredField("isUen")
|
|
25386
|
+
isUen: formUtils.isRequiredField("isUen"),
|
|
25387
|
+
companyType: companyType2,
|
|
25388
|
+
taxIdNumberType,
|
|
25389
|
+
setTaxIdNumberType
|
|
25294
25390
|
})
|
|
25295
25391
|
}), formUtils.isRequiredField("dateOfIncorporation") && jsx("div", {
|
|
25296
25392
|
className: "adyen-kyc-field-wrapper",
|
|
@@ -25381,11 +25477,16 @@ function CompanyStructure({
|
|
|
25381
25477
|
requiredFields
|
|
25382
25478
|
}, i18n);
|
|
25383
25479
|
const disabled = Boolean((_a = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _a.entityType) || formUtils.isReadOnly("entityType");
|
|
25480
|
+
const prevVerifiedDataRef = useRef(kompanyVerifiedData);
|
|
25384
25481
|
useEffect(() => {
|
|
25385
|
-
var _a2, _b;
|
|
25482
|
+
var _a2, _b, _c, _d, _e;
|
|
25386
25483
|
if ((_a2 = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _a2.entityType) {
|
|
25387
25484
|
handleChangeFor("entityType")((_b = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _b.entityType);
|
|
25388
25485
|
}
|
|
25486
|
+
if (((_d = (_c = prevVerifiedDataRef.current) == null ? void 0 : _c.companyStructure) == null ? void 0 : _d.entityType) && !((_e = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _e.entityType)) {
|
|
25487
|
+
handleChangeFor("entityType")(void 0);
|
|
25488
|
+
}
|
|
25489
|
+
prevVerifiedDataRef.current = kompanyVerifiedData;
|
|
25389
25490
|
}, [kompanyVerifiedData]);
|
|
25390
25491
|
useEffect(() => {
|
|
25391
25492
|
updateStateSlice({
|
|
@@ -25898,7 +25999,7 @@ function useCompanySearchTaskSubmit({
|
|
|
25898
25999
|
};
|
|
25899
26000
|
}
|
|
25900
26001
|
function CompanySearchComponent(props) {
|
|
25901
|
-
var _a, _b;
|
|
26002
|
+
var _a, _b, _c;
|
|
25902
26003
|
const {
|
|
25903
26004
|
i18n
|
|
25904
26005
|
} = useI18nContext();
|
|
@@ -25929,6 +26030,7 @@ function CompanySearchComponent(props) {
|
|
|
25929
26030
|
id: forms.companyBasics.formId,
|
|
25930
26031
|
heading: i18n.get(forms.companyBasics.formName),
|
|
25931
26032
|
country: country2,
|
|
26033
|
+
companyType: (_a = globalData == null ? void 0 : globalData.companyStructure) == null ? void 0 : _a.entityType,
|
|
25932
26034
|
isTopLevelEntity,
|
|
25933
26035
|
baseTrackingPayload,
|
|
25934
26036
|
handleCompanyIndexSearch,
|
|
@@ -25971,8 +26073,8 @@ function CompanySearchComponent(props) {
|
|
|
25971
26073
|
id: forms.companyOtherDetails.formId,
|
|
25972
26074
|
heading: i18n.get(forms.companyOtherDetails.formName),
|
|
25973
26075
|
country: country2,
|
|
25974
|
-
legalCompanyName: (
|
|
25975
|
-
companyType: (
|
|
26076
|
+
legalCompanyName: (_b = globalData == null ? void 0 : globalData.companyBasics) == null ? void 0 : _b.legalCompanyName,
|
|
26077
|
+
companyType: (_c = globalData == null ? void 0 : globalData.companyStructure) == null ? void 0 : _c.entityType,
|
|
25976
26078
|
kompanyVerifiedData
|
|
25977
26079
|
})
|
|
25978
26080
|
}), jsx("div", {
|
|
@@ -26330,12 +26432,6 @@ function useAssociatedLegalArrangement({
|
|
|
26330
26432
|
associatedLegalArrangement
|
|
26331
26433
|
};
|
|
26332
26434
|
}
|
|
26333
|
-
const useShouldShowBusinessTypeSelection = (accountHolder2) => {
|
|
26334
|
-
const {
|
|
26335
|
-
isExperimentEnabled
|
|
26336
|
-
} = useExperimentsContext();
|
|
26337
|
-
return isExperimentEnabled("EnableNewEntryFlow") && !accountHolder2;
|
|
26338
|
-
};
|
|
26339
26435
|
const logger$a = createLogger("useExemptSettlor");
|
|
26340
26436
|
const useExemptSettlor = ({
|
|
26341
26437
|
trust: trust2,
|
|
@@ -26354,6 +26450,11 @@ const useExemptSettlor = ({
|
|
|
26354
26450
|
}, [trust2, updateExemptSettlor]);
|
|
26355
26451
|
return exemptSettlor;
|
|
26356
26452
|
};
|
|
26453
|
+
const leIdStorageKey = "LE_ID";
|
|
26454
|
+
const useLeId = () => {
|
|
26455
|
+
const [leIdFromLocalStorage, setLeIdIntoLocalStorage] = useLocalStorage(leIdStorageKey, null);
|
|
26456
|
+
return [leIdFromLocalStorage, setLeIdIntoLocalStorage];
|
|
26457
|
+
};
|
|
26357
26458
|
function useSalesChannelsSettings() {
|
|
26358
26459
|
const {
|
|
26359
26460
|
isSettingEnabled
|
|
@@ -26821,8 +26922,6 @@ const BusinessTypeSelection = ({
|
|
|
26821
26922
|
const defaultBusinessType = getBusinessType(businessTypeOptions, accountHolder2, legalEntityResponse == null ? void 0 : legalEntityResponse.type, (_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
|
|
26822
26923
|
const getDefaultLegalArrangementSelection = () => legalArrangementOptions.find((item) => item.id === getDefaultLegalArrangementOrSuborganizationType(legalEntityResponse, accountHolder2));
|
|
26823
26924
|
const defaultLegalArrangementType = getDefaultLegalArrangementSelection();
|
|
26824
|
-
console.log("defaultBusinessType", defaultBusinessType);
|
|
26825
|
-
console.log("defaultLegalArrangementType", defaultLegalArrangementType);
|
|
26826
26925
|
const defaultTrusteeType = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? trusteeTypeItems[0] : trusteeTypeItems[1];
|
|
26827
26926
|
const {
|
|
26828
26927
|
handleChangeFor,
|
|
@@ -27839,6 +27938,22 @@ const introductionScreensByLegalEntityType = {
|
|
|
27839
27938
|
[LegalEntityType.SOLE_PROPRIETORSHIP]: [IntroductionScreens.PROLOGUE, IntroductionScreens.INDIVIDUAL, IntroductionScreens.SOLE_PROPRIETOR_COMPANY, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
|
|
27840
27939
|
[LegalEntityType.TRUST]: [IntroductionScreens.PROLOGUE, IntroductionScreens.COMPANY, IntroductionScreens.INDIVIDUAL, IntroductionScreens.DECISION_MAKER, IntroductionScreens.TRUST, IntroductionScreens.TRUST_MEMBER_OVERVIEW, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE]
|
|
27841
27940
|
};
|
|
27941
|
+
var IntroductionScreenEvent = /* @__PURE__ */ ((IntroductionScreenEvent2) => {
|
|
27942
|
+
IntroductionScreenEvent2["EMPTY"] = "Introduction_Empty";
|
|
27943
|
+
IntroductionScreenEvent2["START_FLOW"] = "Introduction_StartFlow";
|
|
27944
|
+
IntroductionScreenEvent2["START_SCREEN"] = "Introduction_StartScreen";
|
|
27945
|
+
IntroductionScreenEvent2["STOP_SCREEN"] = "Introduction_StopScreen";
|
|
27946
|
+
IntroductionScreenEvent2["STOP_FLOW"] = "Introduction_StopFlow";
|
|
27947
|
+
IntroductionScreenEvent2["NEXT"] = "Introduction_Next";
|
|
27948
|
+
IntroductionScreenEvent2["BACK"] = "Introduction_Back";
|
|
27949
|
+
IntroductionScreenEvent2["SKIP"] = "Introduction_Skip";
|
|
27950
|
+
return IntroductionScreenEvent2;
|
|
27951
|
+
})(IntroductionScreenEvent || {});
|
|
27952
|
+
var IntroductionScreenTiming = /* @__PURE__ */ ((IntroductionScreenTiming2) => {
|
|
27953
|
+
IntroductionScreenTiming2["VIEW_FLOW"] = "Introduction_ViewFlow";
|
|
27954
|
+
IntroductionScreenTiming2["VIEW_SCREEN"] = "Introduction_ViewScreen";
|
|
27955
|
+
return IntroductionScreenTiming2;
|
|
27956
|
+
})(IntroductionScreenTiming || {});
|
|
27842
27957
|
const useIntroductionScreens = ({
|
|
27843
27958
|
legalEntity,
|
|
27844
27959
|
tasks
|
|
@@ -27960,10 +28075,30 @@ const Introduction = ({
|
|
|
27960
28075
|
tasks
|
|
27961
28076
|
});
|
|
27962
28077
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
28078
|
+
const eventSegmentationDefaults = getBaseTrackingPayload({
|
|
28079
|
+
trackingConfig: {
|
|
28080
|
+
topLevelLegalEntity: legalEntity
|
|
28081
|
+
},
|
|
28082
|
+
legalEntity,
|
|
28083
|
+
task: TaskTypes.INTRODUCTION
|
|
28084
|
+
});
|
|
28085
|
+
const eventDetails = {
|
|
28086
|
+
segmentation: {
|
|
28087
|
+
...eventSegmentationDefaults,
|
|
28088
|
+
page: (introductionScreens == null ? void 0 : introductionScreens.length) ? introductionScreens[activeIndex] : null
|
|
28089
|
+
}
|
|
28090
|
+
};
|
|
27963
28091
|
useEffect(() => {
|
|
27964
|
-
if (!(introductionScreens == null ? void 0 : introductionScreens.length))
|
|
28092
|
+
if (!(introductionScreens == null ? void 0 : introductionScreens.length)) {
|
|
28093
|
+
userEvents.addEvent(IntroductionScreenEvent.EMPTY, {
|
|
28094
|
+
segmentation: eventSegmentationDefaults
|
|
28095
|
+
});
|
|
27965
28096
|
onExitIntroduction();
|
|
27966
|
-
|
|
28097
|
+
} else {
|
|
28098
|
+
userEvents.startEvent(IntroductionScreenTiming.VIEW_FLOW);
|
|
28099
|
+
userEvents.addEvent(IntroductionScreenEvent.START_FLOW, eventDetails);
|
|
28100
|
+
}
|
|
28101
|
+
}, [introductionScreens]);
|
|
27967
28102
|
return (introductionScreens == null ? void 0 : introductionScreens.length) ? jsxs("div", {
|
|
27968
28103
|
className: "adyen-kyc-introduction",
|
|
27969
28104
|
children: [jsx(StepProgressIndicator, {
|
|
@@ -27973,7 +28108,10 @@ const Introduction = ({
|
|
|
27973
28108
|
className: "adyen-kyc-introduction__skip",
|
|
27974
28109
|
children: jsx(Button, {
|
|
27975
28110
|
label: i18n.get("goToOverviewFromIntroduction"),
|
|
27976
|
-
onClick: () =>
|
|
28111
|
+
onClick: () => {
|
|
28112
|
+
userEvents.addEvent(IntroductionScreenEvent.SKIP, eventDetails);
|
|
28113
|
+
onExitIntroduction();
|
|
28114
|
+
},
|
|
27977
28115
|
showAsLink: true,
|
|
27978
28116
|
type: "button"
|
|
27979
28117
|
})
|
|
@@ -27987,16 +28125,36 @@ const Introduction = ({
|
|
|
27987
28125
|
children: [jsx(Button, {
|
|
27988
28126
|
disabled: activeIndex === 0,
|
|
27989
28127
|
label: "Back",
|
|
27990
|
-
onClick: () =>
|
|
28128
|
+
onClick: () => {
|
|
28129
|
+
userEvents.addEvent(IntroductionScreenEvent.BACK, eventDetails);
|
|
28130
|
+
userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
|
|
28131
|
+
userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
|
|
28132
|
+
setActiveIndex((currentValue) => currentValue - 1);
|
|
28133
|
+
userEvents.startEvent(IntroductionScreenTiming.VIEW_SCREEN);
|
|
28134
|
+
userEvents.addEvent(IntroductionScreenEvent.START_SCREEN, eventDetails);
|
|
28135
|
+
},
|
|
27991
28136
|
secondary: true,
|
|
27992
28137
|
type: "button"
|
|
27993
28138
|
}), activeIndex + 1 === introductionScreens.length ? jsx(Button, {
|
|
27994
28139
|
label: "Start",
|
|
27995
|
-
onClick: () =>
|
|
28140
|
+
onClick: () => {
|
|
28141
|
+
userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
|
|
28142
|
+
userEvents.addEvent(IntroductionScreenEvent.STOP_FLOW, eventDetails);
|
|
28143
|
+
userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
|
|
28144
|
+
userEvents.endEvent(IntroductionScreenTiming.VIEW_FLOW, eventDetails);
|
|
28145
|
+
onExitIntroduction();
|
|
28146
|
+
},
|
|
27996
28147
|
type: "button"
|
|
27997
28148
|
}) : jsx(Button, {
|
|
27998
28149
|
label: "Next",
|
|
27999
|
-
onClick: () =>
|
|
28150
|
+
onClick: () => {
|
|
28151
|
+
userEvents.addEvent(IntroductionScreenEvent.NEXT, eventDetails);
|
|
28152
|
+
userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
|
|
28153
|
+
userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
|
|
28154
|
+
setActiveIndex((currentValue) => currentValue + 1);
|
|
28155
|
+
userEvents.startEvent(IntroductionScreenTiming.VIEW_SCREEN);
|
|
28156
|
+
userEvents.addEvent(IntroductionScreenEvent.START_SCREEN, eventDetails);
|
|
28157
|
+
},
|
|
28000
28158
|
type: "button"
|
|
28001
28159
|
})]
|
|
28002
28160
|
})]
|
|
@@ -28358,6 +28516,7 @@ function TaskListComponent({
|
|
|
28358
28516
|
const {
|
|
28359
28517
|
isExperimentEnabled
|
|
28360
28518
|
} = useExperimentsContext();
|
|
28519
|
+
const limitToOneTransferInstrument = useSetting("limitToOneTransferInstrument");
|
|
28361
28520
|
const isEnableNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
28362
28521
|
const canSeeIntroduction = useCanSeeIntroduction({
|
|
28363
28522
|
legalEntity: legalEntityResponse
|
|
@@ -28505,7 +28664,7 @@ function TaskListComponent({
|
|
|
28505
28664
|
capabilityProblems,
|
|
28506
28665
|
onNavigateToTask: () => handleOnNavigateToTaskPayout(transferInstrument.id),
|
|
28507
28666
|
onTransferInstrumentDelete: () => onTransferInstrumentDelete(transferInstrument.id)
|
|
28508
|
-
}, transferInstrument.id)), jsxs(Card, {
|
|
28667
|
+
}, transferInstrument.id)), !limitToOneTransferInstrument || transferInstruments.length < 1 ? jsxs(Card, {
|
|
28509
28668
|
stateful: true,
|
|
28510
28669
|
onClick: () => handleOnNavigateToTaskPayout(),
|
|
28511
28670
|
className: "adyen-task adl-add-payout",
|
|
@@ -28516,7 +28675,7 @@ function TaskListComponent({
|
|
|
28516
28675
|
}), jsx("span", {
|
|
28517
28676
|
children: isEnableNewEntryFlowEnabled ? i18n.get("addExtraBankAccount") : i18n.get(hasPayinTaskNotPayout ? "addExtraPayinAccount" : "addExtraPayoutAccount")
|
|
28518
28677
|
})]
|
|
28519
|
-
})]
|
|
28678
|
+
}) : null]
|
|
28520
28679
|
}) : jsx(TaskListItem, {
|
|
28521
28680
|
onNavigateToTask: () => handleOnNavigateToTaskPayout(),
|
|
28522
28681
|
icon: "payout",
|
|
@@ -31706,7 +31865,8 @@ function DropinComposerComponent({
|
|
|
31706
31865
|
showToast
|
|
31707
31866
|
} = useToastContext();
|
|
31708
31867
|
const [isLoadingConfiguration, setIsLoadingConfiguration] = useState(false);
|
|
31709
|
-
const
|
|
31868
|
+
const isNewEntryFlowEnabled = isExperimentEnabled("EnableNewEntryFlow");
|
|
31869
|
+
const [leId, setLeId] = useLeId();
|
|
31710
31870
|
const showIntroduction = useShouldShowIntroduction({
|
|
31711
31871
|
legalEntity: legalEntityResponse
|
|
31712
31872
|
});
|
|
@@ -31717,12 +31877,13 @@ function DropinComposerComponent({
|
|
|
31717
31877
|
});
|
|
31718
31878
|
const [tasks, setTasks] = useState([]);
|
|
31719
31879
|
const initialTask = useMemo(() => {
|
|
31720
|
-
if (
|
|
31880
|
+
if (isNewEntryFlowEnabled && (!accountHolder2 || legalEntityResponse.id !== leId)) {
|
|
31721
31881
|
return TaskTypes.BUSINESS_TYPE_SELECTION;
|
|
31882
|
+
}
|
|
31722
31883
|
if (showIntroduction)
|
|
31723
31884
|
return TaskTypes.INTRODUCTION;
|
|
31724
31885
|
return TaskTypes.TASKS_OVERVIEW;
|
|
31725
|
-
}, [
|
|
31886
|
+
}, [showIntroduction, isNewEntryFlowEnabled, accountHolder2, legalEntityResponse, leId]);
|
|
31726
31887
|
const [taskHistory, setTaskHistory] = useState([initialTask]);
|
|
31727
31888
|
const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
|
|
31728
31889
|
const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
|
|
@@ -32246,6 +32407,12 @@ function DropinComposerComponent({
|
|
|
32246
32407
|
clearInterval(timeoutId);
|
|
32247
32408
|
};
|
|
32248
32409
|
}, [refreshLegalEntity, rootLegalEntity, taskHistory]);
|
|
32410
|
+
useEffect(() => {
|
|
32411
|
+
if (!isNewEntryFlowEnabled || leId !== legalEntityResponse.id) {
|
|
32412
|
+
setLeId(null);
|
|
32413
|
+
setAccountHolder(null);
|
|
32414
|
+
}
|
|
32415
|
+
}, [isNewEntryFlowEnabled, setLeId]);
|
|
32249
32416
|
if (isLoadingConfiguration) {
|
|
32250
32417
|
return jsx(Shimmer, {});
|
|
32251
32418
|
}
|
|
@@ -32259,6 +32426,7 @@ function DropinComposerComponent({
|
|
|
32259
32426
|
legalEntityResponse: rootLegalEntity,
|
|
32260
32427
|
accountHolder: accountHolder2,
|
|
32261
32428
|
onAccountHolderSelect: async (newAccountHolder) => {
|
|
32429
|
+
setLeId(legalEntityResponse.id);
|
|
32262
32430
|
setAccountHolder(newAccountHolder);
|
|
32263
32431
|
await refreshLegalEntity();
|
|
32264
32432
|
onNavigateTo(showIntroduction ? TaskTypes.INTRODUCTION : TaskTypes.TASKS_OVERVIEW);
|
|
@@ -33885,7 +34053,8 @@ const settingsDefaults = {
|
|
|
33885
34053
|
hideOnboardingIntroductionOrganization: true,
|
|
33886
34054
|
hideOnboardingIntroductionTrust: true,
|
|
33887
34055
|
hideOnboardingIntroductionSoleProprietor: true,
|
|
33888
|
-
viewOnboardingGuidance: false
|
|
34056
|
+
viewOnboardingGuidance: false,
|
|
34057
|
+
limitToOneTransferInstrument: false
|
|
33889
34058
|
};
|
|
33890
34059
|
function SettingsProvider({
|
|
33891
34060
|
children,
|