@adyen/kyc-components 3.6.2 → 3.7.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.
@@ -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, useCallback as useCallback$1 } from "preact/compat";
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";
@@ -621,7 +621,7 @@ const noGlare = "No glare";
621
621
  const selectDocumentType = "Select document type";
622
622
  const registrationDocumentSubTitle = "Upload your company’s business registration document. We need to see this document so we can verify your company.";
623
623
  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";
624
- const uploadTaxationDocument = "Upload a 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.";
624
+ 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.";
625
625
  const containsNameOfCompany = "Contains the name of your company or organization";
626
626
  const documentShowsTaxIdOfCompany = "The document shows the tax ID number of the company";
627
627
  const issuedByTheTaxAuthority = "Issued by the tax authority or government of the country where the company is registered";
@@ -871,14 +871,14 @@ const marketIdentifierCodeMIC = "Market Identifier Code (MIC)";
871
871
  const isin = "ISIN";
872
872
  const companyLookupResultsHeader = "Let's find your company";
873
873
  const companyLookupResultsHeader__searching = "Searching for companies...";
874
- const companyLookupResultsHeader__verifying = "Verifying tax information...";
874
+ const companyLookupResultsHeader__verifying = "Verifying company selection...";
875
875
  const companyLookupResultsHeader__noResults = "We couldn't find your company";
876
876
  const companyLookupResultsHeader__results = "Select your company";
877
877
  const companyLookupResultsHeader__searchFailure = "Sorry, something went wrong";
878
878
  const companyLookupResultsHeaderDescription__noResults = "No problem, let's enter your company details in the next steps.";
879
- const companyLookupResultsHeaderDescription__results = "This helps you to get verified quicker. If you can't find your company, you can always continue by pressing Next.";
879
+ 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.";
880
880
  const companyLookupResultsHeaderDescription__searchFailure = "If that doesn't work, press Next to continue.";
881
- const companyLookupResultsListAlert__title__verified = "Your tax information has been verified";
881
+ const companyLookupResultsListAlert__title__verified = "Your company details will be pre-filled in the relevant sections.";
882
882
  const companyLookupResultsListAlert__title__warning = "This company's TIN doesn't match yours";
883
883
  const companyLookupResultsListAlert__title__error = "Sorry, something went wrong. Try again or continue by pressing Next";
884
884
  const companyLookupResultsListAlert__description__warning = "Check the TIN you've entered, or select a different company.";
@@ -889,9 +889,9 @@ const companyStructureFormName = "Company structure";
889
889
  const companyStructureFormDescription = "What type of company do you have?";
890
890
  const companyOtherDetailsFormName = "Other details";
891
891
  const companyRegistrationDocumentFormName = "Registration document";
892
- const companyRegistrationDocumentFormDescription = "Please upload you companies registration document so we can verify your information.";
892
+ const companyRegistrationDocumentFormDescription = "Please upload your companies registration document so we can verify your information.";
893
893
  const companyTaxDocumentFormName = "Tax document";
894
- const companyTaxDocumentFormDescription = "Please upload you companies tax documents so we can verify your information.";
894
+ const companyTaxDocumentFormDescription = "Please upload your companies tax documents so we can verify your information.";
895
895
  const errorMessage_1_10 = "Information couldn’t be verified";
896
896
  const errorMessage_1_11 = "Document didn’t meet requirements";
897
897
  const errorMessage_1_12 = "Legal entity declined";
@@ -1114,6 +1114,7 @@ const errorMessage_2_8064 = "UBO through ownership was missing.";
1114
1114
  const errorMessage_2_8067 = "Signatory was missing.";
1115
1115
  const errorMessage_2_8141 = "Registration document was missing.";
1116
1116
  const errorMessage_2_8162 = "proofOfOrganizationTaxInfo was missing.";
1117
+ const errorMessage_2_8183 = "'webAddress' was missing.";
1117
1118
  const errorMessage_2_8189 = "UBO through control was missing.";
1118
1119
  const errorMessage_2_8193 = "Director was missing.";
1119
1120
  const errorMessage_3_10 = "Review of data is required";
@@ -1159,6 +1160,7 @@ const remediationMessage_1_705 = "Upload an official bank statement";
1159
1160
  const remediationMessage_2_123 = "You haven't added an owner";
1160
1161
  const remediationMessage_2_124 = "You haven't added a signatory";
1161
1162
  const remediationMessage_2_151 = "You haven't added a controlling person";
1163
+ const remediationMessage_2_178 = "Add 'webAddress' to business line.";
1162
1164
  const remediationMessage_2_185 = "You haven't added your directors";
1163
1165
  const remediationMessage_3_100 = "Check the above information, then click here to confirm.";
1164
1166
  const sameNameAsLegalName = "Same as legal name of the company";
@@ -2365,6 +2367,7 @@ const defaultTrans = {
2365
2367
  errorMessage_2_8067,
2366
2368
  errorMessage_2_8141,
2367
2369
  errorMessage_2_8162,
2370
+ errorMessage_2_8183,
2368
2371
  errorMessage_2_8189,
2369
2372
  errorMessage_2_8193,
2370
2373
  errorMessage_3_10,
@@ -2410,6 +2413,7 @@ const defaultTrans = {
2410
2413
  remediationMessage_2_123,
2411
2414
  remediationMessage_2_124,
2412
2415
  remediationMessage_2_151,
2416
+ remediationMessage_2_178,
2413
2417
  remediationMessage_2_185,
2414
2418
  remediationMessage_3_100,
2415
2419
  sameNameAsLegalName,
@@ -2733,6 +2737,7 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
2733
2737
  SettingNames2["AllowIntraRegionCrossBorderPayout"] = "allowIntraRegionCrossBorderPayout";
2734
2738
  SettingNames2["AllowLegalEntityTypeChange"] = "changeLegalEntityType";
2735
2739
  SettingNames2["AllowPrefilledCountryEdit"] = "editPrefilledCountry";
2740
+ SettingNames2["LimitToOneTransferInstrument"] = "limitToOneTransferInstrument";
2736
2741
  SettingNames2["RequirePciSignEcommerce"] = "requirePciSignEcommerce";
2737
2742
  SettingNames2["RequirePciSignPos"] = "requirePciSignPos";
2738
2743
  SettingNames2["RequirePciSignEcomMoto"] = "requirePciSignEcomMoto";
@@ -8080,7 +8085,7 @@ function BusinessRegistrationNumber(props) {
8080
8085
  ...formUtils.getMask("registrationNumber")
8081
8086
  }), formUtils.isRequiredField("exemptedFromRegistrationNumber") && !showExemptedOption && jsx(Checkbox, {
8082
8087
  name: "exemptedFromRegistrationNumber",
8083
- label: formUtils.getLabel("exemptedFromRegistrationNumber"),
8088
+ label: formUtils.getLabel("iDontHaveARegistrationNumber"),
8084
8089
  value: "exemptedFromRegistrationNumber",
8085
8090
  readonly: formUtils.isReadOnly("exemptedFromRegistrationNumber"),
8086
8091
  classNameModifiers: ["exempted-from-registration"],
@@ -13036,6 +13041,9 @@ const rules$2 = ({
13036
13041
  if (country2 === "DE" && (companyType2 === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION || companyType2 === CompanyTypesValue.NON_PROFIT_OR_CHARITABLE)) {
13037
13042
  return "REQUIRED";
13038
13043
  }
13044
+ if (country2 === "DK" && companyType2 === CompanyTypesValue.NON_PROFIT_OR_CHARITABLE) {
13045
+ return "REQUIRED";
13046
+ }
13039
13047
  },
13040
13048
  countryRequiresRegistrationNumberForSoleProps: () => {
13041
13049
  if (!COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country2)) {
@@ -22010,7 +22018,7 @@ var EntityType = /* @__PURE__ */ ((EntityType2) => {
22010
22018
  EntityType2["LEGAL_ENTITY"] = "LegalEntity";
22011
22019
  return EntityType2;
22012
22020
  })(EntityType || {});
22013
- const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8189"];
22021
+ const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189"];
22014
22022
  const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
22015
22023
  const getComponentMappingFromLEFieldPath = (context, entityType2, isExperimentEnabled) => {
22016
22024
  if (!(context == null ? void 0 : context.key)) {
@@ -24813,11 +24821,15 @@ function TaxInformationField({
24813
24821
  readonly,
24814
24822
  handleChangeFor,
24815
24823
  country: country2,
24816
- canExempt
24824
+ canExempt,
24825
+ companyType: companyType2,
24826
+ taxIdNumberType,
24827
+ setTaxIdNumberType
24817
24828
  }) {
24829
+ var _a;
24818
24830
  const currentCountryTaxInformation = useMemo(() => {
24819
- var _a;
24820
- return (_a = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a.find((taxInfo) => taxInfo.country === country2);
24831
+ var _a2;
24832
+ return (_a2 = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a2.find((taxInfo) => taxInfo.country === country2);
24821
24833
  }, [data, country2]);
24822
24834
  const handleTaxInformationInput = (value) => {
24823
24835
  if (!data.taxInformation) {
@@ -24872,8 +24884,33 @@ function TaxInformationField({
24872
24884
  });
24873
24885
  return handleChangeFor("taxInformation", "blur")(updatedTaxInformation);
24874
24886
  };
24875
- return jsxs(Fragment, {
24876
- children: [jsx(MaskedInputText, {
24887
+ const showTaxIdExemptedOption = canExempt && (((_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a.length) ?? 0) > 1;
24888
+ const handleTaxIdNumberTypeChange = (taxIdType) => {
24889
+ if (taxIdType === "exempted") {
24890
+ if (!canExempt) {
24891
+ throw Error(`${country2} does not allow tax exemptions`);
24892
+ }
24893
+ handleChangeFor("exemptedFromTax")(true);
24894
+ setTaxIdNumberType(void 0);
24895
+ return;
24896
+ }
24897
+ if (canExempt && data.exemptedFromTax === true) {
24898
+ handleChangeFor("exemptedFromTax")(false);
24899
+ }
24900
+ setTaxIdNumberType(taxIdType);
24901
+ };
24902
+ return jsxs("div", {
24903
+ className: "adyen-kyc-field__tax-information",
24904
+ children: [jsx(TaxIdNumberTypeSelector, {
24905
+ country: country2,
24906
+ companyType: companyType2,
24907
+ setSelected: handleTaxIdNumberTypeChange,
24908
+ selected: data.exemptedFromTax ? "exempted" : taxIdNumberType,
24909
+ exemptedOption: showTaxIdExemptedOption ? labels2.exemptedFromTax : false
24910
+ }), jsx(MaskedInputText, {
24911
+ "aria-required": true,
24912
+ "aria-label": labels2.taxInformation,
24913
+ "aria-invalid": !valid.taxInformation,
24877
24914
  name: "taxInformationNumber",
24878
24915
  label: labels2.taxInformation ?? "",
24879
24916
  formatGuidance: (guidanceText == null ? void 0 : guidanceText.taxInformation) ?? "",
@@ -24881,15 +24918,12 @@ function TaxInformationField({
24881
24918
  errorMessage: errors.taxInformation,
24882
24919
  placeholder: placeholders == null ? void 0 : placeholders.taxInformation,
24883
24920
  isValid: Boolean(valid.taxInformation),
24884
- "aria-required": true,
24885
- "aria-label": labels2.taxInformation,
24886
- "aria-invalid": !valid.taxInformation,
24887
24921
  onInput: handleTaxInformationInput,
24888
24922
  onBlur: handleTaxInformationBlur,
24889
24923
  disabled: data.exemptedFromTax,
24890
24924
  readonly,
24891
24925
  ...mask
24892
- }), canExempt && jsx(Checkbox, {
24926
+ }), canExempt && !showTaxIdExemptedOption && jsx(Checkbox, {
24893
24927
  "aria-required": false,
24894
24928
  "aria-label": labels2.exemptedFromTax,
24895
24929
  "aria-invalid": false,
@@ -24956,13 +24990,14 @@ function CompanyBasics({
24956
24990
  handleRefreshCompanyDataset,
24957
24991
  handleVerifyTin,
24958
24992
  country: country2,
24993
+ companyType: companyType2 = CompanyTypesValue.PRIVATE_COMPANY,
24959
24994
  isTopLevelEntity,
24960
24995
  baseTrackingPayload,
24961
24996
  kompanyVerifiedData,
24962
24997
  setKompanyAddress,
24963
24998
  setKompanyVerifiedData
24964
24999
  }) {
24965
- var _a, _b;
25000
+ var _a, _b, _c, _d, _e;
24966
25001
  const {
24967
25002
  i18n
24968
25003
  } = useI18nContext();
@@ -24974,6 +25009,9 @@ function CompanyBasics({
24974
25009
  } = useGlobalDataSlice(COMPANY_BASICS_FORM_ID);
24975
25010
  const [loading2, setLoading] = useState$1(false);
24976
25011
  const allowedCountries = useAllowedCountries();
25012
+ const existingTaxId = (_b = (_a = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _b.number;
25013
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
25014
+ const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
24977
25015
  const initialFormUtilsProps = useMemo$1(() => ({
24978
25016
  labels: labels2,
24979
25017
  placeholders,
@@ -25015,13 +25053,13 @@ function CompanyBasics({
25015
25053
  };
25016
25054
  case "taxInformation":
25017
25055
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
25018
- taxIdNumberType: countryToTaxInfoTypeMap[country2]
25056
+ taxIdNumberType
25019
25057
  }, defaultFieldMetadata), acc);
25020
25058
  default:
25021
25059
  return acc;
25022
25060
  }
25023
25061
  }, initialFormUtilsProps);
25024
- }, [country2, initialFormUtilsProps]);
25062
+ }, [country2, initialFormUtilsProps, taxIdNumberType]);
25025
25063
  const schema = (requiredFields == null ? void 0 : requiredFields.length) ? requiredFields : ["legalCompanyName", "country"];
25026
25064
  const {
25027
25065
  schema: formSchema,
@@ -25043,7 +25081,7 @@ function CompanyBasics({
25043
25081
  const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
25044
25082
  const formUtils = formUtilities(mergedFieldProps ?? initialFormUtilsProps, i18n);
25045
25083
  const hasCompanySearchProvider = formData.country && COUNTRIES_WITH_IN_APP_SEARCH_COMPANY_VERIFICATION.includes(formData.country);
25046
- const currentCountryTaxIdNumber = (_b = (_a = formData.taxInformation) == null ? void 0 : _a.find((taxInfo) => taxInfo.country === formData.country)) == null ? void 0 : _b.number;
25084
+ const currentCountryTaxIdNumber = (_e = (_d = formData.taxInformation) == null ? void 0 : _d.find((taxInfo) => taxInfo.country === formData.country)) == null ? void 0 : _e.number;
25047
25085
  const disabled = (field) => formUtils.isReadOnly(field) || Boolean(kompanyVerifiedData) || loading2;
25048
25086
  useEffect$1(() => {
25049
25087
  updateStateSlice({
@@ -25106,7 +25144,9 @@ function CompanyBasics({
25106
25144
  data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
25107
25145
  valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
25108
25146
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
25109
- labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD),
25147
+ labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
25148
+ exemptedFromTax: "iDontHaveATaxId"
25149
+ }),
25110
25150
  mask: formUtils.getMask("taxInformation"),
25111
25151
  helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
25112
25152
  guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
@@ -25114,7 +25154,10 @@ function CompanyBasics({
25114
25154
  handleChangeFor,
25115
25155
  canExempt: formUtils.isRequiredField("exemptedFromTax"),
25116
25156
  isUen: formUtils.isRequiredField("isUen"),
25117
- country: formData.country
25157
+ country: formData.country,
25158
+ companyType: companyType2 ?? CompanyTypesValue.PRIVATE_COMPANY,
25159
+ taxIdNumberType,
25160
+ setTaxIdNumberType
25118
25161
  })
25119
25162
  }), hasCompanySearchProvider && jsx(CompanyLookupComponent, {
25120
25163
  defaultData: data,
@@ -25137,7 +25180,7 @@ function CompanyBasics({
25137
25180
  })]
25138
25181
  });
25139
25182
  }
25140
- 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));
25183
+ 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));
25141
25184
  const BUSINESS_REGISTRATION_NUMBER_FIELD = ["registrationNumber", "exemptedFromRegistrationNumber"];
25142
25185
  function BusinessRegistrationNumberField({
25143
25186
  data,
@@ -25148,11 +25191,38 @@ function BusinessRegistrationNumberField({
25148
25191
  guidanceText,
25149
25192
  placeholders,
25150
25193
  readonly,
25194
+ handleChangeFor,
25195
+ country: country2,
25151
25196
  canExempt,
25152
- handleChangeFor
25197
+ companyType: companyType2,
25198
+ registrationNumberOptions,
25199
+ registrationNumberType,
25200
+ setRegistrationNumberType
25153
25201
  }) {
25154
- return jsxs(Fragment, {
25155
- children: [jsx(MaskedInputText, {
25202
+ const showExemptedOption = canExempt && !!registrationNumberOptions && registrationNumberOptions.length > 1;
25203
+ const handleCompanyRegistrationNumberTypeChange = (regNumberType) => {
25204
+ if (regNumberType === "exempted") {
25205
+ if (!canExempt) {
25206
+ throw Error(`${country2} does not allow tax exemptions`);
25207
+ }
25208
+ handleChangeFor("exemptedFromRegistrationNumber")(true);
25209
+ setRegistrationNumberType(void 0);
25210
+ return;
25211
+ }
25212
+ if (canExempt && data.exemptedFromRegistrationNumber === true) {
25213
+ handleChangeFor("exemptedFromRegistrationNumber")(false);
25214
+ }
25215
+ setRegistrationNumberType(regNumberType);
25216
+ };
25217
+ return jsxs("div", {
25218
+ className: "adyen-kyc-field__business-registration",
25219
+ children: [jsx(CompanyRegistrationNumberTypeSelector, {
25220
+ companyType: companyType2,
25221
+ country: country2,
25222
+ setSelected: handleCompanyRegistrationNumberTypeChange,
25223
+ selected: data.exemptedFromRegistrationNumber ? "exempted" : registrationNumberType,
25224
+ exemptedOption: showExemptedOption ? labels2.exemptedFromRegistrationNumber : false
25225
+ }), jsx(MaskedInputText, {
25156
25226
  "aria-required": true,
25157
25227
  "aria-label": labels2.registrationNumber,
25158
25228
  "aria-invalid": !valid.registrationNumber,
@@ -25297,13 +25367,38 @@ function VatNumberField({
25297
25367
  placeholders,
25298
25368
  readonly,
25299
25369
  handleChangeFor,
25300
- canExempt
25370
+ canExempt,
25371
+ country: country2,
25372
+ vatNumberType,
25373
+ setVatNumberType
25301
25374
  }) {
25375
+ var _a;
25302
25376
  const {
25303
25377
  i18n
25304
25378
  } = useI18nContext();
25305
- return jsxs(Fragment, {
25306
- children: [jsx(MaskedInputText, {
25379
+ const showVatExemptedOption = canExempt && ((_a = taxIdNumberOptions[country2]) == null ? void 0 : _a.length) > 1;
25380
+ const handleVatNumberTypeChange = (vatType) => {
25381
+ if (vatType === "exempted") {
25382
+ if (!canExempt) {
25383
+ throw Error(`${country2} does not allow VAT exemptions`);
25384
+ }
25385
+ handleChangeFor("exemptedFromVat")(true);
25386
+ setVatNumberType(void 0);
25387
+ return;
25388
+ }
25389
+ if (canExempt && data.exemptedFromVat === true) {
25390
+ handleChangeFor("exemptedFromVat")(false);
25391
+ }
25392
+ setVatNumberType(vatType);
25393
+ };
25394
+ return jsxs("div", {
25395
+ className: "adyen-kyc-field__vat-number",
25396
+ children: [jsx(TaxIdNumberTypeSelector, {
25397
+ country: country2,
25398
+ setSelected: handleVatNumberTypeChange,
25399
+ selected: data.exemptedFromVat ? "exempted" : vatNumberType,
25400
+ exemptedOption: showVatExemptedOption ? labels2.exemptedFromVat : false
25401
+ }), jsx(MaskedInputText, {
25307
25402
  "aria-required": true,
25308
25403
  "aria-label": labels2.vatNumber,
25309
25404
  "aria-invalid": !valid.vatNumber,
@@ -25323,7 +25418,7 @@ function VatNumberField({
25323
25418
  disabled: data.exemptedFromVat,
25324
25419
  readonly,
25325
25420
  ...mask
25326
- }), canExempt && jsx(Checkbox, {
25421
+ }), canExempt && !showVatExemptedOption && jsx(Checkbox, {
25327
25422
  "aria-required": false,
25328
25423
  "aria-label": labels2 == null ? void 0 : labels2.exemptedFromVat,
25329
25424
  "aria-invalid": false,
@@ -25380,14 +25475,17 @@ function CompanyOtherDetails({
25380
25475
  i18n
25381
25476
  } = useI18nContext();
25382
25477
  const {
25383
- sliceData,
25384
25478
  updateStateSlice
25385
25479
  } = useGlobalDataSlice(COMPANY_OTHER_DETAILS_FORM_ID);
25386
- const [registrationNumberType, setRegistrationNumberType] = useState$1((data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country2, companyType2) : (_a = companyRegistrationNumberOptions[country2]) == null ? void 0 : _a[0].id);
25387
- const existingTaxIdentificationNumber = (data == null ? void 0 : data.vatNumber) ?? ((_c = (_b = data == null ? void 0 : data.taxInformation) == null ? void 0 : _b.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _c.number);
25388
- const [taxIdentificationNumberType, setTaxIdentificationNumberType] = useState$1(existingTaxIdentificationNumber ? inferTaxIdNumberType(existingTaxIdentificationNumber, country2) : (_d = taxIdNumberOptions[country2]) == null ? void 0 : _d[0].id);
25480
+ const registrationNumberOptions = useMemo$1(() => getCompanyRegistrationNumberOptions(country2, companyType2), [country2, companyType2]);
25481
+ const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country2, companyType2) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
25482
+ const [registrationNumberType, setRegistrationNumberType] = useState$1(defaultRegistrationNumberType);
25483
+ 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;
25484
+ const [vatNumberType, setVatNumberType] = useState$1(defaultVatNumberType);
25485
+ const existingTaxId = (_c = (_b = data == null ? void 0 : data.taxInformation) == null ? void 0 : _b.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _c.number;
25486
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
25487
+ const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
25389
25488
  const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
25390
- 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]);
25391
25489
  const initialFormUtilsProps = useMemo$1(() => ({
25392
25490
  labels: labels2,
25393
25491
  placeholders,
@@ -25430,27 +25528,26 @@ function CompanyOtherDetails({
25430
25528
  }, defaultFieldMetadata$8), acc);
25431
25529
  case "taxInformation":
25432
25530
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
25433
- taxIdNumberType: taxIdentificationNumberType
25531
+ taxIdNumberType
25434
25532
  }, defaultFieldMetadata), acc);
25435
25533
  case "vatNumber":
25436
25534
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
25437
- vatNumberType: taxIdentificationNumberType
25535
+ vatNumberType
25438
25536
  }, defaultFieldMetadata$6), acc);
25439
25537
  default:
25440
25538
  return acc;
25441
25539
  }
25442
25540
  }, initialFormUtilsProps);
25443
- }, [companyType2, country2, initialFormUtilsProps, registrationNumberType, taxIdentificationNumberType]);
25541
+ }, [companyType2, country2, initialFormUtilsProps, registrationNumberType, taxIdNumberType, vatNumberType]);
25444
25542
  const {
25445
25543
  schema: formSchema,
25446
25544
  data: formData,
25447
25545
  errors: formErrors,
25448
25546
  valid: formValid,
25449
25547
  fieldProblems: formFieldProblems,
25450
- handleChangeFor,
25451
- triggerValidation
25548
+ handleChangeFor
25452
25549
  } = useForm({
25453
- schema,
25550
+ schema: (currentData) => !currentData.exemptedFromVat ? (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatAbsenceReason")) ?? directChildFields : (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatNumber")) ?? directChildFields,
25454
25551
  defaultData: data,
25455
25552
  rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
25456
25553
  optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
@@ -25459,14 +25556,6 @@ function CompanyOtherDetails({
25459
25556
  shouldValidate
25460
25557
  });
25461
25558
  const formUtils = formUtilities(mergedFieldProps ?? initialFormUtilsProps, i18n);
25462
- const handleBusinessRegistrationNumberTypeChange = useCallback$1((type) => {
25463
- setRegistrationNumberType(type);
25464
- triggerValidation(["registrationNumber"]);
25465
- }, [triggerValidation]);
25466
- const handleTaxIdentificationNumberTypeChange = useCallback$1((type) => {
25467
- setTaxIdentificationNumberType(type);
25468
- triggerValidation(["vatNumber", "taxInformation"]);
25469
- }, [triggerValidation]);
25470
25559
  useEffect$1(() => {
25471
25560
  }, [kompanyVerifiedData]);
25472
25561
  useEffect$1(() => {
@@ -25506,44 +25595,46 @@ function CompanyOtherDetails({
25506
25595
  handleChangeFor,
25507
25596
  legalCompanyName: legalCompanyName2
25508
25597
  })
25509
- }), formUtils.isRequiredField("registrationNumber") && jsx(CompanyRegistrationNumberTypeSelector, {
25510
- companyType: companyType2,
25511
- country: country2,
25512
- setSelected: handleBusinessRegistrationNumberTypeChange,
25513
- selected: registrationNumberType
25514
25598
  }), formUtils.isRequiredField("registrationNumber") && jsx("div", {
25515
25599
  className: "adyen-kyc-field-wrapper",
25516
25600
  children: jsx(BusinessRegistrationNumberField, {
25517
25601
  data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
25518
25602
  valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
25519
25603
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
25520
- labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD),
25604
+ labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
25605
+ exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
25606
+ }),
25521
25607
  mask: formUtils.getMask("registrationNumber"),
25522
25608
  guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
25523
25609
  placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
25524
25610
  helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
25525
25611
  readonly: formUtils.isReadOnly("registrationNumber"),
25526
25612
  handleChangeFor,
25527
- canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber")
25613
+ country: country2,
25614
+ canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
25615
+ companyType: companyType2,
25616
+ registrationNumberOptions,
25617
+ registrationNumberType,
25618
+ setRegistrationNumberType
25528
25619
  })
25529
- }), formUtils.isRequiredField("vatNumber") && jsx(TaxIdNumberTypeSelector, {
25530
- country: country2,
25531
- setSelected: handleTaxIdentificationNumberTypeChange,
25532
- selected: taxIdentificationNumberType
25533
25620
  }), formUtils.isRequiredField("vatNumber") && jsx("div", {
25534
25621
  className: "adyen-kyc-field-wrapper",
25535
25622
  children: jsx(VatNumberField, {
25536
25623
  data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
25537
25624
  valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
25538
25625
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
25539
- labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD),
25626
+ labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
25627
+ exemptedFromVat: "iDontHaveAVatNumber"
25628
+ }),
25540
25629
  mask: formUtils.getMask("vatNumber"),
25541
25630
  guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
25542
25631
  placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
25543
25632
  readonly: formUtils.isReadOnly("vatNumber"),
25544
25633
  handleChangeFor,
25545
25634
  country: country2,
25546
- canExempt: formUtils.isRequiredField("exemptedFromVat")
25635
+ canExempt: formUtils.isRequiredField("exemptedFromVat"),
25636
+ vatNumberType,
25637
+ setVatNumberType
25547
25638
  })
25548
25639
  }), formUtils.isRequiredField("taxInformation") && jsx("div", {
25549
25640
  className: "adyen-kyc-field-wrapper",
@@ -25551,7 +25642,9 @@ function CompanyOtherDetails({
25551
25642
  data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
25552
25643
  valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
25553
25644
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
25554
- labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD),
25645
+ labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
25646
+ exemptedFromTax: "iDontHaveATaxId"
25647
+ }),
25555
25648
  mask: formUtils.getMask("taxInformation"),
25556
25649
  helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
25557
25650
  guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
@@ -25559,7 +25652,10 @@ function CompanyOtherDetails({
25559
25652
  handleChangeFor,
25560
25653
  country: country2,
25561
25654
  canExempt: formUtils.isRequiredField("exemptedFromTax"),
25562
- isUen: formUtils.isRequiredField("isUen")
25655
+ isUen: formUtils.isRequiredField("isUen"),
25656
+ companyType: companyType2,
25657
+ taxIdNumberType,
25658
+ setTaxIdNumberType
25563
25659
  })
25564
25660
  }), formUtils.isRequiredField("dateOfIncorporation") && jsx("div", {
25565
25661
  className: "adyen-kyc-field-wrapper",
@@ -25650,11 +25746,16 @@ function CompanyStructure({
25650
25746
  requiredFields
25651
25747
  }, i18n);
25652
25748
  const disabled = Boolean((_a = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _a.entityType) || formUtils.isReadOnly("entityType");
25749
+ const prevVerifiedDataRef = useRef(kompanyVerifiedData);
25653
25750
  useEffect(() => {
25654
- var _a2, _b;
25751
+ var _a2, _b, _c, _d, _e;
25655
25752
  if ((_a2 = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _a2.entityType) {
25656
25753
  handleChangeFor("entityType")((_b = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _b.entityType);
25657
25754
  }
25755
+ 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)) {
25756
+ handleChangeFor("entityType")(void 0);
25757
+ }
25758
+ prevVerifiedDataRef.current = kompanyVerifiedData;
25658
25759
  }, [kompanyVerifiedData]);
25659
25760
  useEffect(() => {
25660
25761
  updateStateSlice({
@@ -26167,7 +26268,7 @@ function useCompanySearchTaskSubmit({
26167
26268
  };
26168
26269
  }
26169
26270
  function CompanySearchComponent(props) {
26170
- var _a, _b;
26271
+ var _a, _b, _c;
26171
26272
  const {
26172
26273
  i18n
26173
26274
  } = useI18nContext();
@@ -26198,6 +26299,7 @@ function CompanySearchComponent(props) {
26198
26299
  id: forms.companyBasics.formId,
26199
26300
  heading: i18n.get(forms.companyBasics.formName),
26200
26301
  country: country2,
26302
+ companyType: (_a = globalData == null ? void 0 : globalData.companyStructure) == null ? void 0 : _a.entityType,
26201
26303
  isTopLevelEntity,
26202
26304
  baseTrackingPayload,
26203
26305
  handleCompanyIndexSearch,
@@ -26240,8 +26342,8 @@ function CompanySearchComponent(props) {
26240
26342
  id: forms.companyOtherDetails.formId,
26241
26343
  heading: i18n.get(forms.companyOtherDetails.formName),
26242
26344
  country: country2,
26243
- legalCompanyName: (_a = globalData == null ? void 0 : globalData.companyBasics) == null ? void 0 : _a.legalCompanyName,
26244
- companyType: (_b = globalData == null ? void 0 : globalData.companyStructure) == null ? void 0 : _b.entityType,
26345
+ legalCompanyName: (_b = globalData == null ? void 0 : globalData.companyBasics) == null ? void 0 : _b.legalCompanyName,
26346
+ companyType: (_c = globalData == null ? void 0 : globalData.companyStructure) == null ? void 0 : _c.entityType,
26245
26347
  kompanyVerifiedData
26246
26348
  })
26247
26349
  }), jsx("div", {
@@ -26599,12 +26701,6 @@ function useAssociatedLegalArrangement({
26599
26701
  associatedLegalArrangement
26600
26702
  };
26601
26703
  }
26602
- const useShouldShowBusinessTypeSelection = (accountHolder2) => {
26603
- const {
26604
- isExperimentEnabled
26605
- } = useExperimentsContext();
26606
- return isExperimentEnabled("EnableNewEntryFlow") && !accountHolder2;
26607
- };
26608
26704
  const logger$c = createLogger("useExemptSettlor");
26609
26705
  const useExemptSettlor = ({
26610
26706
  trust: trust2,
@@ -26623,6 +26719,11 @@ const useExemptSettlor = ({
26623
26719
  }, [trust2, updateExemptSettlor]);
26624
26720
  return exemptSettlor;
26625
26721
  };
26722
+ const leIdStorageKey = "LE_ID";
26723
+ const useLeId = () => {
26724
+ const [leIdFromLocalStorage, setLeIdIntoLocalStorage] = useLocalStorage(leIdStorageKey, null);
26725
+ return [leIdFromLocalStorage, setLeIdIntoLocalStorage];
26726
+ };
26626
26727
  function useSalesChannelsSettings() {
26627
26728
  const {
26628
26729
  isSettingEnabled
@@ -27090,8 +27191,6 @@ const BusinessTypeSelection = ({
27090
27191
  const defaultBusinessType = getBusinessType(businessTypeOptions, accountHolder2, legalEntityResponse == null ? void 0 : legalEntityResponse.type, (_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
27091
27192
  const getDefaultLegalArrangementSelection = () => legalArrangementOptions.find((item) => item.id === getDefaultLegalArrangementOrSuborganizationType(legalEntityResponse, accountHolder2));
27092
27193
  const defaultLegalArrangementType = getDefaultLegalArrangementSelection();
27093
- console.log("defaultBusinessType", defaultBusinessType);
27094
- console.log("defaultLegalArrangementType", defaultLegalArrangementType);
27095
27194
  const defaultTrusteeType = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? trusteeTypeItems[0] : trusteeTypeItems[1];
27096
27195
  const {
27097
27196
  handleChangeFor,
@@ -28128,6 +28227,22 @@ const introductionScreensByLegalEntityType = {
28128
28227
  [LegalEntityType.SOLE_PROPRIETORSHIP]: [IntroductionScreens.PROLOGUE, IntroductionScreens.INDIVIDUAL, IntroductionScreens.SOLE_PROPRIETOR_COMPANY, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
28129
28228
  [LegalEntityType.TRUST]: [IntroductionScreens.PROLOGUE, IntroductionScreens.COMPANY, IntroductionScreens.INDIVIDUAL, IntroductionScreens.DECISION_MAKER, IntroductionScreens.TRUST, IntroductionScreens.TRUST_MEMBER_OVERVIEW, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE]
28130
28229
  };
28230
+ var IntroductionScreenEvent = /* @__PURE__ */ ((IntroductionScreenEvent2) => {
28231
+ IntroductionScreenEvent2["EMPTY"] = "Introduction_Empty";
28232
+ IntroductionScreenEvent2["START_FLOW"] = "Introduction_StartFlow";
28233
+ IntroductionScreenEvent2["START_SCREEN"] = "Introduction_StartScreen";
28234
+ IntroductionScreenEvent2["STOP_SCREEN"] = "Introduction_StopScreen";
28235
+ IntroductionScreenEvent2["STOP_FLOW"] = "Introduction_StopFlow";
28236
+ IntroductionScreenEvent2["NEXT"] = "Introduction_Next";
28237
+ IntroductionScreenEvent2["BACK"] = "Introduction_Back";
28238
+ IntroductionScreenEvent2["SKIP"] = "Introduction_Skip";
28239
+ return IntroductionScreenEvent2;
28240
+ })(IntroductionScreenEvent || {});
28241
+ var IntroductionScreenTiming = /* @__PURE__ */ ((IntroductionScreenTiming2) => {
28242
+ IntroductionScreenTiming2["VIEW_FLOW"] = "Introduction_ViewFlow";
28243
+ IntroductionScreenTiming2["VIEW_SCREEN"] = "Introduction_ViewScreen";
28244
+ return IntroductionScreenTiming2;
28245
+ })(IntroductionScreenTiming || {});
28131
28246
  const useIntroductionScreens = ({
28132
28247
  legalEntity,
28133
28248
  tasks
@@ -28249,10 +28364,30 @@ const Introduction = ({
28249
28364
  tasks
28250
28365
  });
28251
28366
  const [activeIndex, setActiveIndex] = useState(0);
28367
+ const eventSegmentationDefaults = getBaseTrackingPayload({
28368
+ trackingConfig: {
28369
+ topLevelLegalEntity: legalEntity
28370
+ },
28371
+ legalEntity,
28372
+ task: TaskTypes.INTRODUCTION
28373
+ });
28374
+ const eventDetails = {
28375
+ segmentation: {
28376
+ ...eventSegmentationDefaults,
28377
+ page: (introductionScreens == null ? void 0 : introductionScreens.length) ? introductionScreens[activeIndex] : null
28378
+ }
28379
+ };
28252
28380
  useEffect(() => {
28253
- if (!(introductionScreens == null ? void 0 : introductionScreens.length))
28381
+ if (!(introductionScreens == null ? void 0 : introductionScreens.length)) {
28382
+ userEvents.addEvent(IntroductionScreenEvent.EMPTY, {
28383
+ segmentation: eventSegmentationDefaults
28384
+ });
28254
28385
  onExitIntroduction();
28255
- }, [onExitIntroduction, introductionScreens]);
28386
+ } else {
28387
+ userEvents.startEvent(IntroductionScreenTiming.VIEW_FLOW);
28388
+ userEvents.addEvent(IntroductionScreenEvent.START_FLOW, eventDetails);
28389
+ }
28390
+ }, [introductionScreens]);
28256
28391
  return (introductionScreens == null ? void 0 : introductionScreens.length) ? jsxs("div", {
28257
28392
  className: "adyen-kyc-introduction",
28258
28393
  children: [jsx(StepProgressIndicator, {
@@ -28262,7 +28397,10 @@ const Introduction = ({
28262
28397
  className: "adyen-kyc-introduction__skip",
28263
28398
  children: jsx(Button, {
28264
28399
  label: i18n.get("goToOverviewFromIntroduction"),
28265
- onClick: () => onExitIntroduction(),
28400
+ onClick: () => {
28401
+ userEvents.addEvent(IntroductionScreenEvent.SKIP, eventDetails);
28402
+ onExitIntroduction();
28403
+ },
28266
28404
  showAsLink: true,
28267
28405
  type: "button"
28268
28406
  })
@@ -28276,16 +28414,36 @@ const Introduction = ({
28276
28414
  children: [jsx(Button, {
28277
28415
  disabled: activeIndex === 0,
28278
28416
  label: "Back",
28279
- onClick: () => setActiveIndex((currentValue) => currentValue - 1),
28417
+ onClick: () => {
28418
+ userEvents.addEvent(IntroductionScreenEvent.BACK, eventDetails);
28419
+ userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
28420
+ userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
28421
+ setActiveIndex((currentValue) => currentValue - 1);
28422
+ userEvents.startEvent(IntroductionScreenTiming.VIEW_SCREEN);
28423
+ userEvents.addEvent(IntroductionScreenEvent.START_SCREEN, eventDetails);
28424
+ },
28280
28425
  secondary: true,
28281
28426
  type: "button"
28282
28427
  }), activeIndex + 1 === introductionScreens.length ? jsx(Button, {
28283
28428
  label: "Start",
28284
- onClick: () => onExitIntroduction(),
28429
+ onClick: () => {
28430
+ userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
28431
+ userEvents.addEvent(IntroductionScreenEvent.STOP_FLOW, eventDetails);
28432
+ userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
28433
+ userEvents.endEvent(IntroductionScreenTiming.VIEW_FLOW, eventDetails);
28434
+ onExitIntroduction();
28435
+ },
28285
28436
  type: "button"
28286
28437
  }) : jsx(Button, {
28287
28438
  label: "Next",
28288
- onClick: () => setActiveIndex((currentValue) => currentValue + 1),
28439
+ onClick: () => {
28440
+ userEvents.addEvent(IntroductionScreenEvent.NEXT, eventDetails);
28441
+ userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
28442
+ userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
28443
+ setActiveIndex((currentValue) => currentValue + 1);
28444
+ userEvents.startEvent(IntroductionScreenTiming.VIEW_SCREEN);
28445
+ userEvents.addEvent(IntroductionScreenEvent.START_SCREEN, eventDetails);
28446
+ },
28289
28447
  type: "button"
28290
28448
  })]
28291
28449
  })]
@@ -28647,6 +28805,7 @@ function TaskListComponent({
28647
28805
  const {
28648
28806
  isExperimentEnabled
28649
28807
  } = useExperimentsContext();
28808
+ const limitToOneTransferInstrument = useSetting("limitToOneTransferInstrument");
28650
28809
  const isEnableNewEntryFlowEnabled = useEnableNewEntryFlow();
28651
28810
  const canSeeIntroduction = useCanSeeIntroduction({
28652
28811
  legalEntity: legalEntityResponse
@@ -28794,7 +28953,7 @@ function TaskListComponent({
28794
28953
  capabilityProblems,
28795
28954
  onNavigateToTask: () => handleOnNavigateToTaskPayout(transferInstrument.id),
28796
28955
  onTransferInstrumentDelete: () => onTransferInstrumentDelete(transferInstrument.id)
28797
- }, transferInstrument.id)), jsxs(Card, {
28956
+ }, transferInstrument.id)), !limitToOneTransferInstrument || transferInstruments.length < 1 ? jsxs(Card, {
28798
28957
  stateful: true,
28799
28958
  onClick: () => handleOnNavigateToTaskPayout(),
28800
28959
  className: "adyen-task adl-add-payout",
@@ -28805,7 +28964,7 @@ function TaskListComponent({
28805
28964
  }), jsx("span", {
28806
28965
  children: isEnableNewEntryFlowEnabled ? i18n.get("addExtraBankAccount") : i18n.get(hasPayinTaskNotPayout ? "addExtraPayinAccount" : "addExtraPayoutAccount")
28807
28966
  })]
28808
- })]
28967
+ }) : null]
28809
28968
  }) : jsx(TaskListItem, {
28810
28969
  onNavigateToTask: () => handleOnNavigateToTaskPayout(),
28811
28970
  icon: "payout",
@@ -31989,7 +32148,8 @@ function DropinComposerComponent({
31989
32148
  showToast
31990
32149
  } = useToastContext();
31991
32150
  const [isLoadingConfiguration, setIsLoadingConfiguration] = useState(false);
31992
- const showBusinessTypeSelection = useShouldShowBusinessTypeSelection(accountHolder2);
32151
+ const isNewEntryFlowEnabled = isExperimentEnabled("EnableNewEntryFlow");
32152
+ const [leId, setLeId] = useLeId();
31993
32153
  const showIntroduction = useShouldShowIntroduction({
31994
32154
  legalEntity: legalEntityResponse
31995
32155
  });
@@ -32000,12 +32160,13 @@ function DropinComposerComponent({
32000
32160
  });
32001
32161
  const [tasks, setTasks] = useState([]);
32002
32162
  const initialTask = useMemo(() => {
32003
- if (showBusinessTypeSelection)
32163
+ if (isNewEntryFlowEnabled && (!accountHolder2 || legalEntityResponse.id !== leId)) {
32004
32164
  return TaskTypes.BUSINESS_TYPE_SELECTION;
32165
+ }
32005
32166
  if (showIntroduction)
32006
32167
  return TaskTypes.INTRODUCTION;
32007
32168
  return TaskTypes.TASKS_OVERVIEW;
32008
- }, [showBusinessTypeSelection, showIntroduction]);
32169
+ }, [showIntroduction, isNewEntryFlowEnabled, accountHolder2, legalEntityResponse, leId]);
32009
32170
  const [taskHistory, setTaskHistory] = useState([initialTask]);
32010
32171
  const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
32011
32172
  const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
@@ -32529,6 +32690,12 @@ function DropinComposerComponent({
32529
32690
  clearInterval(timeoutId);
32530
32691
  };
32531
32692
  }, [refreshLegalEntity, rootLegalEntity, taskHistory]);
32693
+ useEffect(() => {
32694
+ if (!isNewEntryFlowEnabled || leId !== legalEntityResponse.id) {
32695
+ setLeId(null);
32696
+ setAccountHolder(null);
32697
+ }
32698
+ }, [isNewEntryFlowEnabled, setLeId]);
32532
32699
  if (isLoadingConfiguration) {
32533
32700
  return jsx(Shimmer, {});
32534
32701
  }
@@ -32542,6 +32709,7 @@ function DropinComposerComponent({
32542
32709
  legalEntityResponse: rootLegalEntity,
32543
32710
  accountHolder: accountHolder2,
32544
32711
  onAccountHolderSelect: async (newAccountHolder) => {
32712
+ setLeId(legalEntityResponse.id);
32545
32713
  setAccountHolder(newAccountHolder);
32546
32714
  await refreshLegalEntity();
32547
32715
  onNavigateTo(showIntroduction ? TaskTypes.INTRODUCTION : TaskTypes.TASKS_OVERVIEW);
@@ -34536,7 +34704,8 @@ const settingsDefaults = {
34536
34704
  hideOnboardingIntroductionOrganization: true,
34537
34705
  hideOnboardingIntroductionTrust: true,
34538
34706
  hideOnboardingIntroductionSoleProprietor: true,
34539
- viewOnboardingGuidance: false
34707
+ viewOnboardingGuidance: false,
34708
+ limitToOneTransferInstrument: false
34540
34709
  };
34541
34710
  function SettingsProvider({
34542
34711
  children,