@adyen/kyc-components 3.26.0 → 3.26.1

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.
@@ -171,6 +171,7 @@ const defaultTrans = {
171
171
  bankDocumentHeader: "Upload a bank document",
172
172
  bankDocumentHeaderOptional: "Upload a bank document (optional)",
173
173
  bankName: "Bank name",
174
+ bankruptcyInsolvency: "Yes, the company is filing for bankruptcy or insolvency",
174
175
  bankStatementAlreadyUploaded: "Bank statement has already been uploaded, is too large, or the account has already been added; try another",
175
176
  bankStatementDocument: "Bank statement",
176
177
  basedOnTheAboveSignatory: "Based on the above, the signatory above asserts that the information within this attestation form fairly represents the results of the assessment.",
@@ -929,6 +930,7 @@ const defaultTrans = {
929
930
  mcRegistrationNumberSoleProp: "Numéro d'Identification Statistique (NIS)",
930
931
  meetingRecords: "Board of directors' meeting records of decisions",
931
932
  memberDetails: "Member details",
933
+ missingCompanyDetails: "Missing company details or root entity",
932
934
  missingDetailsToPerformPayouts: "We are missing some details in order to perform payouts, please add it.",
933
935
  missingMultipleDecisionMakers: "You haven't added all required decision-makers",
934
936
  mobileApplication: "Mobile Application",
@@ -1005,6 +1007,7 @@ const defaultTrans = {
1005
1007
  otherAddressInformation: "Other address information (optional)",
1006
1008
  otherBusinessInformation: "Other business information",
1007
1009
  otherInformation: "Other information",
1010
+ otherLegalMeasures: "Yes, the company is facing other legal measures",
1008
1011
  otherTrust: "Other trust",
1009
1012
  ourFinancialServicesAreNotAvailableYetForPartnershipsAndAssociations: "Our financial services aren’t available yet for partnerships and associations",
1010
1013
  owner: "Owner",
@@ -1361,6 +1364,7 @@ const defaultTrans = {
1361
1364
  undefinedBeneficiary: "Undefined beneficiary",
1362
1365
  undefinedBeneficiaryDescription: "A class or group of beneficiaries that is not named, but defined in an ascertainable manner in the trust deed.",
1363
1366
  undefinedBeneficiaryGuideDescription: "",
1367
+ underJudicialAdministration: "Yes, the company is under judicial administration, receivership or similar measures",
1364
1368
  undoWithTimer: "Undo... %{secondsLeft}",
1365
1369
  uniqueIdentificationCode: "Unique identification code (ЕИК/UIC)",
1366
1370
  unlistedPublicUnitTrust: "Unlisted public unit trust",
@@ -1443,10 +1447,7 @@ const defaultTrans = {
1443
1447
  xMinutesAndYSeconds: "%{minutes} and %{seconds}",
1444
1448
  xSeconds: "%{seconds} seconds",
1445
1449
  yes: "Yes",
1446
- yesBankruptcyInsolvency: "Yes, the company is filling for bankruptcy or insolvency",
1447
1450
  yesChange: "Yes, change",
1448
- yesJudicialAdministration: "Yes, the company is under judicial administration, receivership or similar measures",
1449
- yesOtherLegalMeasures: "Yes, the company is facing other legal measures",
1450
1451
  youAlsoHaveToUploadSomeSupportingDocuments: "You'll also have to upload some supporting documents.",
1451
1452
  youAreIndividualOrCompanyAndUseBankAccountInNameOfPartnershipOrAssociation: "You’re an individual or company, and you use a bank account in the name of a partnership, or association.",
1452
1453
  youAreIndividualOrCompanyAndUseBankAccountInNameOfTrustPartnershipOrAssociation: "You’re an individual or company, and you use a bank account in the name of a trust, partnership, or association.",
@@ -14126,9 +14127,23 @@ const solePropBaseMapping = {
14126
14127
  "solePropRegistrationAddress.operationalAddress.otherAddressInformation": "soleProprietorship.principalPlaceOfBusiness.street2"
14127
14128
  };
14128
14129
  const highExposureBaseMapping = {
14129
- "company.numberOfEmployees": "company.numberOfEmployees",
14130
- "parentCompany.numberOfEmployees": "parentCompany.numberOfEmployees",
14131
- "ultimateParentCompany.numberOfEmployees": "ultimateParentCompany.numberOfEmployees"
14130
+ numberOfEmployees: "organization.financialReports.employeeCount",
14131
+ annualTurnoverValue: "organization.financialReports.annualTurnover",
14132
+ totalAssetsValue: "organization.financialReports.netAssets",
14133
+ financialReportingDate: "organization.financialReports.dateOfFinancialData",
14134
+ annualTurnoverCurrency: "organization.financialReports.currencyOfFinancialData",
14135
+ legalProceedingsDate: "organization.dateOfInitiationOfLegalProceeding",
14136
+ legalInformationInsolvency: "organization.statusOfLegalProceeding",
14137
+ legalEntityIdentifier: "organization.globalLegalEntityIdentifier",
14138
+ naceCode: "organization.economicSector",
14139
+ legalForm: "organization.legalForm",
14140
+ legalName: "organization.legalName",
14141
+ address: "organization.registeredAddress.street",
14142
+ otherAddressInformation: "organization.registeredAddress.street2",
14143
+ city: "organization.registeredAddress.city",
14144
+ postalCode: "organization.registeredAddress.postalCode",
14145
+ stateOrProvince: "organization.registeredAddress.stateOrProvince",
14146
+ country: "organization.registeredAddress.country"
14132
14147
  };
14133
14148
  const businessDetailsComponentsKeyMapping = {
14134
14149
  "additionalInformation.exemptedFromVat": "organization.vatAbsenceReason",
@@ -26779,9 +26794,7 @@ const processValidationErrors = (validationError, dropinTask, keyMappings) => {
26779
26794
  if (invalidField == null ? void 0 : invalidField.name) {
26780
26795
  let mappedFieldPath = mapField(invalidField == null ? void 0 : invalidField.name, dropinTask);
26781
26796
  if (keyMappings) {
26782
- mappedFieldPath = {
26783
- ...keyMappings
26784
- };
26797
+ mappedFieldPath = keyMappings[invalidField == null ? void 0 : invalidField.name];
26785
26798
  }
26786
26799
  if (mappedFieldPath) {
26787
26800
  assignToProp(mappedFieldPath, acc, true);
@@ -38291,6 +38304,12 @@ const highExposureParentRadioItems = [...highExposureRadioItems, {
38291
38304
  }];
38292
38305
  const companySchemaKeys = ["legalForm", "naceCode", "numberOfEmployees", "doesYourCompanyHaveLEI", "legalEntityIdentifier", "country", "isCompanyOwnedByAnotherCompany", "isParentOwnedByAnotherCompany", "financialReportingDate", "totalAssetsCurrency", "totalAssetsValue", "annualTurnoverCurrency", "annualTurnoverValue", "legalInformationInsolvency", "legalProceedingsDate"];
38293
38306
  const parentCompaniesSchemaKeys = ["legalName", "legalForm", "naceCode", "numberOfEmployees", "doesYourCompanyHaveLEI", "legalEntityIdentifier", "doesNotKnowNumberOfEmployees", "isThisAddressTheMainHeadquarters", "address", "otherAddressInformation", "doesNotKnowLegalEntityIdentifier", "postalCode", "city", "stateOrProvince", "country", "financialReportingDate", "totalAssetsCurrency", "totalAssetsValue", "annualTurnoverCurrency", "annualTurnoverValue", "legalInformationInsolvency", "legalProceedingsDate"];
38307
+ var HighExposureIndex = /* @__PURE__ */ ((HighExposureIndex2) => {
38308
+ HighExposureIndex2["COMPANY"] = "company";
38309
+ HighExposureIndex2["PARENT_COMPANY"] = "parentCompany";
38310
+ HighExposureIndex2["ULTIMATE_PARENT_COMPANY"] = "ultimateParentCompany";
38311
+ return HighExposureIndex2;
38312
+ })(HighExposureIndex || {});
38294
38313
  const setDefaultCurrencies = (dataObject, country) => {
38295
38314
  const countryCurrencies = currencyByCountry[country] || [];
38296
38315
  if (dataObject.totalAssetsCurrency && dataObject.annualTurnoverCurrency) return;
@@ -38304,6 +38323,10 @@ const validateLegalEntityIdentifier = (legalEntityIdentifier, doesYourCompanyHav
38304
38323
  const hasLettersAndNumbers = legalEntityIdentifier ? /[a-zA-Z]/.test(legalEntityIdentifier) && /[0-9]/.test(legalEntityIdentifier) : false;
38305
38324
  return !isRequired || !isEmpty(legalEntityIdentifier) && isValidLength && hasLettersAndNumbers;
38306
38325
  };
38326
+ const validateLegalProceedingsDate = (legalProceedingsDate, legalInformationInsolvency) => {
38327
+ const isRequired = legalInformationInsolvency && !["noLegalActionsTaken", "iDontKnow"].includes(legalInformationInsolvency);
38328
+ return isRequired ? !isEmpty(legalProceedingsDate) : true;
38329
+ };
38307
38330
  const highExposureCompanyDetailsValidations = {
38308
38331
  numberOfEmployees: {
38309
38332
  modes: ["blur"],
@@ -38340,11 +38363,6 @@ const highExposureCompanyDetailsValidations = {
38340
38363
  validate: (value) => !isEmpty(value),
38341
38364
  errorMessage: "fieldIsRequired"
38342
38365
  },
38343
- legalForm: {
38344
- modes: ["blur"],
38345
- validate: (legalForm) => !isEmpty(legalForm),
38346
- errorMessage: "fieldIsRequired"
38347
- },
38348
38366
  naceCode: {
38349
38367
  modes: ["blur"],
38350
38368
  validate: (naceCode) => !isEmpty(naceCode),
@@ -38375,99 +38393,20 @@ const highExposureCompanyDetailsValidations = {
38375
38393
  return ((_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.isCompanyOwnedByAnotherCompany) === "Yes" ? !isEmpty(isParentOwnedByAnotherCompany) : true;
38376
38394
  },
38377
38395
  errorMessage: "fieldIsRequired"
38378
- }
38379
- // TODO: revisit
38380
- // legalProceedingsDate: {
38381
- // modes: ['blur'],
38382
- // validate: (value) => !isEmpty(value),
38383
- // errorMessage: 'fieldIsRequired',
38384
- // },
38385
- };
38386
- const highExposureParentCompanyDetailsValidations = {
38387
- addressCountry: {
38388
- modes: ["blur"],
38389
- validate: (addressCountry) => !isEmpty(addressCountry),
38390
- errorMessage: "fieldIsRequired"
38391
- },
38392
- legalName: {
38393
- modes: ["blur"],
38394
- validate: (legalName) => !isEmpty(legalName),
38395
- errorMessage: "fieldIsRequired"
38396
- },
38397
- numberOfEmployees: {
38398
- modes: ["blur"],
38399
- validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
38400
- errorMessage: "fieldIsRequired"
38401
- },
38402
- legalForm: {
38403
- modes: ["blur"],
38404
- validate: (legalForm) => !isEmpty(legalForm),
38405
- errorMessage: "fieldIsRequired"
38406
- },
38407
- naceCode: {
38408
- modes: ["blur"],
38409
- validate: (naceCode) => !isEmpty(naceCode),
38410
- errorMessage: "fieldIsRequired"
38411
- },
38412
- doesYourCompanyHaveLEI: {
38413
- modes: ["blur"],
38414
- validate: (doesYourCompanyHaveLEI) => !isEmpty(doesYourCompanyHaveLEI),
38415
- errorMessage: "fieldIsRequired"
38416
38396
  },
38417
- legalEntityIdentifier: {
38397
+ legalProceedingsDate: {
38418
38398
  modes: ["blur"],
38419
- validate: (legalEntityIdentifier, context) => {
38420
- var _a, _b, _c, _d;
38421
- return validateLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI, Boolean((_d = (_c = context == null ? void 0 : context.state) == null ? void 0 : _c.data) == null ? void 0 : _d.doesNotKnowLegalEntityIdentifier));
38399
+ validate: (legalProceedingsDate, context) => {
38400
+ var _a, _b;
38401
+ return validateLegalProceedingsDate(legalProceedingsDate, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.legalInformationInsolvency);
38422
38402
  },
38423
38403
  errorMessage: "fieldIsRequired"
38424
- },
38425
- isThisAddressTheMainHeadquarters: {
38426
- modes: ["blur"],
38427
- validate: (isThisAddressTheMainHeadquarters) => !isEmpty(isThisAddressTheMainHeadquarters),
38428
- errorMessage: "fieldIsRequired"
38429
- },
38430
- legalInformationInsolvency: {
38431
- modes: ["blur"],
38432
- validate: (value) => !isEmpty(value),
38433
- errorMessage: "fieldIsRequired"
38434
- },
38435
- totalAssetsValue: {
38436
- modes: ["blur"],
38437
- validate: (value) => !isEmpty(value),
38438
- errorMessage: "fieldIsRequired"
38439
- },
38440
- totalAssetsCurrency: {
38441
- modes: ["input"],
38442
- validate: (value) => !isEmpty(value),
38443
- errorMessage: "fieldIsRequired"
38444
- },
38445
- annualTurnoverValue: {
38446
- modes: ["blur"],
38447
- validate: (value) => !isEmpty(value),
38448
- errorMessage: "fieldIsRequired"
38449
- },
38450
- annualTurnoverCurrency: {
38451
- modes: ["blur"],
38452
- validate: (value) => !isEmpty(value),
38453
- errorMessage: "fieldIsRequired"
38454
- },
38455
- financialReportingDate: {
38456
- modes: ["blur"],
38457
- validate: (value) => !isEmpty(value),
38458
- errorMessage: "fieldIsRequired"
38459
38404
  }
38460
- // TODO: revisit
38461
- // legalProceedingsDate: {
38462
- // modes: ['blur'],
38463
- // validate: (value) => !isEmpty(value),
38464
- // errorMessage: 'fieldIsRequired',
38465
- // },
38466
38405
  };
38467
- const highExposureUltimateParentCompanyDetailsValidations = {
38468
- addressCountry: {
38406
+ const highExposureParentCompaniesDetailsValidations = {
38407
+ country: {
38469
38408
  modes: ["blur"],
38470
- validate: (addressCountry) => !isEmpty(addressCountry),
38409
+ validate: (country) => !isEmpty(country),
38471
38410
  errorMessage: "fieldIsRequired"
38472
38411
  },
38473
38412
  legalName: {
@@ -38480,11 +38419,6 @@ const highExposureUltimateParentCompanyDetailsValidations = {
38480
38419
  validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
38481
38420
  errorMessage: "fieldIsRequired"
38482
38421
  },
38483
- legalForm: {
38484
- modes: ["blur"],
38485
- validate: (legalForm) => !isEmpty(legalForm),
38486
- errorMessage: "fieldIsRequired"
38487
- },
38488
38422
  naceCode: {
38489
38423
  modes: ["blur"],
38490
38424
  validate: (naceCode) => !isEmpty(naceCode),
@@ -38537,13 +38471,15 @@ const highExposureUltimateParentCompanyDetailsValidations = {
38537
38471
  modes: ["blur"],
38538
38472
  validate: (value) => !isEmpty(value),
38539
38473
  errorMessage: "fieldIsRequired"
38474
+ },
38475
+ legalProceedingsDate: {
38476
+ modes: ["blur"],
38477
+ validate: (legalProceedingsDate, context) => {
38478
+ var _a, _b;
38479
+ return validateLegalProceedingsDate(legalProceedingsDate, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.legalInformationInsolvency);
38480
+ },
38481
+ errorMessage: "fieldIsRequired"
38540
38482
  }
38541
- // TODO: revisit
38542
- // legalProceedingsDate: {
38543
- // modes: ['blur'],
38544
- // validate: (value) => !isEmpty(value),
38545
- // errorMessage: 'fieldIsRequired',
38546
- // },
38547
38483
  };
38548
38484
  const logger$a = createLogger("LegalFormField");
38549
38485
  function LegalFormField({
@@ -38653,13 +38589,14 @@ function HighExposureBusinessInformation({
38653
38589
  i18n
38654
38590
  } = useI18nContext();
38655
38591
  const isMainCompany = targetPage === HighExposurePagesEnums.COMPANY_PAGE;
38656
- const companyCountry = targetPage === HighExposurePagesEnums.COMPANY_PAGE ? country : data.addressCountry;
38592
+ const companyCountry = targetPage === HighExposurePagesEnums.COMPANY_PAGE ? country : data.country;
38593
+ const isEuCountry = euCountries.includes(companyCountry);
38657
38594
  return jsxs(Fragment, {
38658
38595
  children: [jsx(Typography, {
38659
38596
  el: "h3",
38660
38597
  variant: "title",
38661
38598
  children: i18n.get(sectionHeading || "yourBusinessInformation")
38662
- }), jsx(LegalFormField, {
38599
+ }), isEuCountry && jsx(LegalFormField, {
38663
38600
  name: "legalForm",
38664
38601
  countryCode: companyCountry,
38665
38602
  data: {
@@ -38905,22 +38842,22 @@ function HighExposureLegalInformation({
38905
38842
  i18n
38906
38843
  } = useI18nContext();
38907
38844
  const legalInformationInsolvencyItems = [{
38908
- id: i18n.get("no"),
38845
+ id: "noLegalActionsTaken",
38909
38846
  name: i18n.get("no")
38910
38847
  }, {
38911
- id: i18n.get("yesJudicialAdministration"),
38912
- name: i18n.get("yesJudicialAdministration")
38848
+ id: "underJudicialAdministration",
38849
+ name: i18n.get("underJudicialAdministration")
38913
38850
  }, {
38914
- id: i18n.get("yesBankruptcyInsolvency"),
38915
- name: i18n.get("yesBankruptcyInsolvency")
38851
+ id: "bankruptcyInsolvency",
38852
+ name: i18n.get("bankruptcyInsolvency")
38916
38853
  }, {
38917
- id: i18n.get("yesOtherLegalMeasures"),
38918
- name: i18n.get("yesOtherLegalMeasures")
38854
+ id: "otherLegalMeasures",
38855
+ name: i18n.get("otherLegalMeasures")
38919
38856
  }, {
38920
- id: i18n.get("iDontKnow"),
38857
+ id: "iDontKnow",
38921
38858
  name: i18n.get("iDontKnow")
38922
38859
  }];
38923
- const showLegalProceedingsDateField = data.legalInformationInsolvency && data.legalInformationInsolvency !== "No";
38860
+ const showLegalProceedingsDateField = data.legalInformationInsolvency && !["noLegalActionsTaken", "iDontKnow"].includes(data.legalInformationInsolvency);
38924
38861
  return jsxs(Fragment, {
38925
38862
  children: [jsx(Typography, {
38926
38863
  el: "h3",
@@ -39032,9 +38969,7 @@ function AdditionalFieldsForHighExposureCompany(props) {
39032
38969
  } = useForm({
39033
38970
  ...props,
39034
38971
  schema: companySchemaKeys,
39035
- defaultData: {
39036
- ...props.data
39037
- },
38972
+ defaultData: props.data,
39038
38973
  rules: props.validators || highExposureCompanyDetailsValidations,
39039
38974
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
39040
38975
  });
@@ -39174,7 +39109,7 @@ function HighExposureRegisteredAddress({
39174
39109
  postalCode: data.postalCode,
39175
39110
  city: data.city,
39176
39111
  stateOrProvince: data.stateOrProvince,
39177
- country: data.addressCountry
39112
+ country: data.country
39178
39113
  };
39179
39114
  const handleChangeForAddress = (state) => {
39180
39115
  Object.entries(state.data).forEach(([key, value]) => {
@@ -39246,7 +39181,7 @@ function AdditionalFieldsForHighExposureParentCompany(props) {
39246
39181
  defaultData: {
39247
39182
  ...props.data
39248
39183
  },
39249
- rules: props.validators || highExposureParentCompanyDetailsValidations,
39184
+ rules: props.validators || highExposureParentCompaniesDetailsValidations,
39250
39185
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
39251
39186
  });
39252
39187
  const formUtils = formUtilities(props, i18n);
@@ -39350,7 +39285,7 @@ function AdditionalFieldsForHighExposureUltimateParentCompany(props) {
39350
39285
  defaultData: {
39351
39286
  ...props.data
39352
39287
  },
39353
- rules: props.validators || highExposureUltimateParentCompanyDetailsValidations,
39288
+ rules: props.validators || highExposureParentCompaniesDetailsValidations,
39354
39289
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
39355
39290
  });
39356
39291
  const formUtils = formUtilities(props, i18n);
@@ -39435,20 +39370,6 @@ function AdditionalFieldsForHighExposureUltimateParentCompany(props) {
39435
39370
  formUtils,
39436
39371
  fieldProblems,
39437
39372
  targetPage: HighExposurePagesEnums.ULTIMATE_PARENT_COMPANY_PAGE
39438
- }), jsx(HighExposureRegisteredAddress, {
39439
- ...props,
39440
- country: props.country,
39441
- handleChangeFor: highExposureHandleChangeFor,
39442
- sectionHeading: "registeredAddress",
39443
- errors,
39444
- data,
39445
- valid,
39446
- formUtils,
39447
- fieldProblems,
39448
- targetPage: HighExposurePagesEnums.ULTIMATE_PARENT_COMPANY_PAGE,
39449
- legalEntityId: props.legalEntityId,
39450
- handleFindAddress: props.handleFindAddress,
39451
- handleAddressSearch: props.handleAddressSearch
39452
39373
  })]
39453
39374
  });
39454
39375
  }
@@ -39484,33 +39405,43 @@ function HighExposureDropinComponent(props) {
39484
39405
  const highExposureCompanyDetailsFormProps = getFormProps(props, companyFormId);
39485
39406
  const highExposureParentCompanyDetailsFormProps = getFormProps(props, parentCompanyFormId);
39486
39407
  const highExposureUltimateParentCompanyDetailsFormProps = getFormProps(props, ultimateParentCompanyFormId);
39408
+ const formWrapperClasses = (activeForm, formId) => (activeForm == null ? void 0 : activeForm.formId) !== formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper";
39487
39409
  const renderActiveForm = (activeForm) => jsx("div", {
39488
39410
  className: "adyen-kyc",
39489
39411
  children: jsxs("div", {
39490
39412
  className: "adyen-kyc-form-wrapper",
39491
- children: [activeForm.formId === companyFormId && jsx(AdditionalFieldsForHighExposureCompany, {
39492
- ...highExposureCompanyDetailsFormProps,
39493
- legalEntityId: props.legalEntityId,
39494
- legalEntity: props.legalEntity,
39495
- heading: i18n.get("additionalInformation"),
39496
- id: companyFormId,
39497
- country: props.country
39498
- }), activeForm.formId === parentCompanyFormId && jsx(AdditionalFieldsForHighExposureParentCompany, {
39499
- ...highExposureParentCompanyDetailsFormProps,
39500
- legalEntityId: props.legalEntityId,
39501
- heading: i18n.get("parentCompanyInformation"),
39502
- id: companyFormId,
39503
- country: props.country,
39504
- handleFindAddress: props.handleFindAddress,
39505
- handleAddressSearch: props.handleAddressSearch
39506
- }), activeForm.formId === ultimateParentCompanyFormId && jsx(AdditionalFieldsForHighExposureUltimateParentCompany, {
39507
- ...highExposureUltimateParentCompanyDetailsFormProps,
39508
- legalEntityId: props.legalEntityId,
39509
- heading: i18n.get("ultimateParentCompanyInformation"),
39510
- id: companyFormId,
39511
- country: props.country,
39512
- handleFindAddress: props.handleFindAddress,
39513
- handleAddressSearch: props.handleAddressSearch
39413
+ children: [jsx("div", {
39414
+ className: formWrapperClasses(activeForm, companyFormId),
39415
+ children: jsx(AdditionalFieldsForHighExposureCompany, {
39416
+ ...highExposureCompanyDetailsFormProps,
39417
+ legalEntityId: props.legalEntityId,
39418
+ legalEntity: props.legalEntity,
39419
+ heading: i18n.get("additionalInformation"),
39420
+ id: companyFormId,
39421
+ country: props.country
39422
+ })
39423
+ }), jsx("div", {
39424
+ className: formWrapperClasses(activeForm, parentCompanyFormId),
39425
+ children: jsx(AdditionalFieldsForHighExposureParentCompany, {
39426
+ ...highExposureParentCompanyDetailsFormProps,
39427
+ legalEntityId: props.legalEntityId,
39428
+ heading: i18n.get("parentCompanyInformation"),
39429
+ id: companyFormId,
39430
+ country: props.country,
39431
+ handleFindAddress: props.handleFindAddress,
39432
+ handleAddressSearch: props.handleAddressSearch
39433
+ })
39434
+ }), jsx("div", {
39435
+ className: formWrapperClasses(activeForm, ultimateParentCompanyFormId),
39436
+ children: jsx(AdditionalFieldsForHighExposureUltimateParentCompany, {
39437
+ ...highExposureUltimateParentCompanyDetailsFormProps,
39438
+ legalEntityId: props.legalEntityId,
39439
+ heading: i18n.get("ultimateParentCompanyInformation"),
39440
+ id: companyFormId,
39441
+ country: props.country,
39442
+ handleFindAddress: props.handleFindAddress,
39443
+ handleAddressSearch: props.handleAddressSearch
39444
+ })
39514
39445
  })]
39515
39446
  })
39516
39447
  });
@@ -39519,6 +39450,107 @@ function HighExposureDropinComponent(props) {
39519
39450
  children: renderActiveForm(props.activeForm || highExposureForms.company)
39520
39451
  });
39521
39452
  }
39453
+ const getLegalEntityId = (exposureIndex, rootLegalEntity) => {
39454
+ var _a;
39455
+ if (!rootLegalEntity) return void 0;
39456
+ if (exposureIndex === HighExposureIndex.COMPANY) return rootLegalEntity.id;
39457
+ if (!(rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations)) return void 0;
39458
+ const exposureEntityType = HighExposureIndex.PARENT_COMPANY ? "immediateParentCompany" : "ultimateParentCompany";
39459
+ const exposureEntityAssociation = (_a = rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === exposureEntityType);
39460
+ return exposureEntityAssociation == null ? void 0 : exposureEntityAssociation.legalEntityId;
39461
+ };
39462
+ const entityHasParentCompany = (data) => {
39463
+ var _a, _b;
39464
+ return ((_a = data.company) == null ? void 0 : _a.isCompanyOwnedByAnotherCompany) && ((_b = data.company) == null ? void 0 : _b.isCompanyOwnedByAnotherCompany) === "Yes";
39465
+ };
39466
+ const entityHasUltimateParentCompany = (data) => {
39467
+ var _a, _b;
39468
+ return ((_a = data.company) == null ? void 0 : _a.isParentOwnedByAnotherCompany) && ((_b = data.company) == null ? void 0 : _b.isParentOwnedByAnotherCompany) === "Yes";
39469
+ };
39470
+ const prepareExposureSubmitData = (exposureIndex, data, rootLegalEntity) => {
39471
+ var _a, _b, _c;
39472
+ const exposureData = data[exposureIndex];
39473
+ if (!exposureData) return null;
39474
+ if (exposureIndex === HighExposureIndex.PARENT_COMPANY && !entityHasParentCompany(data)) {
39475
+ return null;
39476
+ }
39477
+ if (exposureIndex === HighExposureIndex.ULTIMATE_PARENT_COMPANY && (!entityHasUltimateParentCompany(data) || !entityHasParentCompany(data))) {
39478
+ return null;
39479
+ }
39480
+ const exposureDetails = mapHighExposureToLegalEntity(exposureData);
39481
+ if (!exposureDetails.organization) return null;
39482
+ if (exposureDetails.organization.financialReports) {
39483
+ const exposureFinancialReports = {
39484
+ employeeCount: (_a = exposureData.numberOfEmployees) == null ? void 0 : _a.toString(),
39485
+ annualTurnover: (_b = exposureData.annualTurnoverValue) == null ? void 0 : _b.toString(),
39486
+ netAssets: (_c = exposureData.totalAssetsValue) == null ? void 0 : _c.toString(),
39487
+ dateOfFinancialData: exposureData.financialReportingDate,
39488
+ currencyOfFinancialData: exposureData.annualTurnoverCurrency
39489
+ };
39490
+ exposureDetails.organization.financialReports = [{
39491
+ ...exposureFinancialReports
39492
+ }];
39493
+ }
39494
+ if (exposureDetails.organization.statusOfLegalProceeding === "iDontKnow") {
39495
+ exposureDetails.organization.statusOfLegalProceeding = "noLegalActionsTaken";
39496
+ }
39497
+ if (exposureData.isThisAddressTheMainHeadquarters) {
39498
+ exposureDetails.organization.principalPlaceOfBusiness = {
39499
+ ...exposureDetails.organization.registeredAddress
39500
+ };
39501
+ }
39502
+ if (exposureData.doesYourCompanyHaveLEI !== "Yes" || exposureData.doesNotKnowLegalEntityIdentifier) {
39503
+ delete exposureDetails.organization.globalLegalEntityIdentifier;
39504
+ }
39505
+ const exposureLegalEntityId = getLegalEntityId(exposureIndex, rootLegalEntity);
39506
+ if (exposureLegalEntityId) {
39507
+ delete exposureDetails.type;
39508
+ exposureDetails.id = exposureLegalEntityId;
39509
+ } else {
39510
+ delete exposureDetails.id;
39511
+ exposureDetails.type = LegalEntityType.ORGANIZATION;
39512
+ }
39513
+ return exposureDetails;
39514
+ };
39515
+ const getHighExposureFinancialReportData = (financialReport) => {
39516
+ if (!financialReport) return {};
39517
+ return {
39518
+ financialReportingDate: financialReport.dateOfFinancialData,
39519
+ totalAssetsValue: financialReport.netAssets ? Number(financialReport.netAssets) : void 0,
39520
+ annualTurnoverValue: financialReport.annualTurnover ? Number(financialReport.annualTurnover) : void 0,
39521
+ numberOfEmployees: financialReport.employeeCount ? Number(financialReport.employeeCount) : void 0,
39522
+ annualTurnoverCurrency: financialReport.currencyOfFinancialData,
39523
+ totalAssetsCurrency: financialReport.currencyOfFinancialData
39524
+ };
39525
+ };
39526
+ const appendHighExposureData = (legalOrganization, highExposureData) => {
39527
+ var _a;
39528
+ if (!legalOrganization || !highExposureData) return highExposureData;
39529
+ const clonedHighExposureData = {
39530
+ ...highExposureData
39531
+ };
39532
+ const financialReportData = getHighExposureFinancialReportData((_a = legalOrganization.financialReports) == null ? void 0 : _a[0]);
39533
+ return {
39534
+ ...clonedHighExposureData,
39535
+ ...financialReportData,
39536
+ doesYourCompanyHaveLEI: legalOrganization.globalLegalEntityIdentifier ? "Yes" : "No",
39537
+ isThisAddressTheMainHeadquarters: legalOrganization.principalPlaceOfBusiness ? "Yes" : clonedHighExposureData.isThisAddressTheMainHeadquarters
39538
+ };
39539
+ };
39540
+ const handleHighExposureFormSubmission = async (highExposureType, details, createFunction, updateFunction, entityId) => {
39541
+ if (!details) return;
39542
+ try {
39543
+ if (entityId) {
39544
+ return await updateFunction(details, entityId);
39545
+ }
39546
+ return await createFunction(details);
39547
+ } catch (error) {
39548
+ const highExposureError = new Error(`Form submission failed for ${highExposureType}`);
39549
+ highExposureError.actualError = error;
39550
+ highExposureError.highExposureType = highExposureType;
39551
+ throw highExposureError;
39552
+ }
39553
+ };
39522
39554
  const parseConfiguration = ({
39523
39555
  matchingScenario
39524
39556
  }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
@@ -39531,14 +39563,12 @@ const customLabels = {
39531
39563
  parentCompany: {
39532
39564
  legalForm: "businessStructure",
39533
39565
  naceCode: "industryAndNaceCode",
39534
- doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI",
39535
- addressCountry: "country"
39566
+ doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI"
39536
39567
  },
39537
39568
  ultimateParentCompany: {
39538
39569
  legalForm: "businessStructure",
39539
39570
  naceCode: "industryAndNaceCode",
39540
- doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI",
39541
- addressCountry: "country"
39571
+ doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI"
39542
39572
  }
39543
39573
  };
39544
39574
  function UpdateLegalEntityForHighExposure({
@@ -39547,38 +39577,90 @@ function UpdateLegalEntityForHighExposure({
39547
39577
  country,
39548
39578
  trackingConfig,
39549
39579
  problems: problemsProp,
39550
- onSubmit: externalOnSubmit,
39551
39580
  onChange,
39552
39581
  hideDropinLayout,
39553
39582
  handleHomeClick,
39554
39583
  homeButtonLabel,
39555
39584
  legalEntityId,
39556
- legalEntity: legalEntityProps
39585
+ onSubmit: externalOnSubmit
39557
39586
  }) {
39558
39587
  var _a, _b, _c;
39559
39588
  const {
39560
39589
  getLegalEntity: getLegalEntity2,
39561
39590
  getAddress: getAddress2,
39562
- searchAddress: searchAddress2
39591
+ searchAddress: searchAddress2,
39592
+ createLegalEntity: createLegalEntity2,
39593
+ updateLegalEntity: updateLegalEntity2
39563
39594
  } = useComponentApi(legalEntityId);
39564
39595
  const {
39565
39596
  i18n
39566
39597
  } = useI18nContext();
39567
- const [legalEntity, setLegalEntity] = useState(legalEntityProps);
39568
- const fetchLegalEntity = useCallback(async () => {
39569
- const legalEntityResponse = await getLegalEntity2(legalEntityId);
39570
- setLegalEntity(legalEntityResponse);
39571
- if (legalEntityResponse) {
39572
- setData(mapLegalEntityToHighExposure(legalEntityResponse));
39598
+ const [rootLegalEntity, setRootLegalEntity] = useState();
39599
+ const dataFromResponse = {};
39600
+ const [defaultData, setDefaultData] = useState(dataFromResponse);
39601
+ const fetchParentEntity = async (rootEntity, associationType) => {
39602
+ var _a2;
39603
+ const association = (_a2 = rootEntity.entityAssociations) == null ? void 0 : _a2.find(({
39604
+ associatorId,
39605
+ type
39606
+ }) => associatorId === rootEntity.id && type === associationType);
39607
+ if (association == null ? void 0 : association.legalEntityId) {
39608
+ return getLegalEntity2(association.legalEntityId);
39609
+ }
39610
+ return null;
39611
+ };
39612
+ const fetchLegalEntities = useCallback(async () => {
39613
+ var _a2;
39614
+ try {
39615
+ const rootLegalEntityResponse = await getLegalEntity2(legalEntityId);
39616
+ if (!rootLegalEntityResponse) return;
39617
+ dataFromResponse.company = mapLegalEntityToHighExposure(rootLegalEntityResponse);
39618
+ dataFromResponse.company = appendHighExposureData(rootLegalEntityResponse.organization, dataFromResponse.company);
39619
+ if ((_a2 = rootLegalEntityResponse.entityAssociations) == null ? void 0 : _a2.length) {
39620
+ try {
39621
+ const parentEntity = await fetchParentEntity(rootLegalEntityResponse, "immediateParentCompany");
39622
+ if (parentEntity) {
39623
+ dataFromResponse.parentCompany = mapLegalEntityToHighExposure(parentEntity);
39624
+ dataFromResponse.parentCompany = appendHighExposureData(parentEntity.organization, dataFromResponse.parentCompany);
39625
+ if (dataFromResponse.company) {
39626
+ dataFromResponse.company.isCompanyOwnedByAnotherCompany = "Yes";
39627
+ }
39628
+ } else if (dataFromResponse.company) {
39629
+ dataFromResponse.company.isCompanyOwnedByAnotherCompany = "No";
39630
+ }
39631
+ const ultimateParentEntity = await fetchParentEntity(rootLegalEntityResponse, "ultimateParentCompany");
39632
+ if (ultimateParentEntity) {
39633
+ dataFromResponse.ultimateParentCompany = mapLegalEntityToHighExposure(ultimateParentEntity);
39634
+ dataFromResponse.ultimateParentCompany = appendHighExposureData(ultimateParentEntity.organization, dataFromResponse.ultimateParentCompany);
39635
+ if (dataFromResponse.company) {
39636
+ dataFromResponse.company.isParentOwnedByAnotherCompany = "Yes";
39637
+ }
39638
+ } else if (dataFromResponse.company) {
39639
+ dataFromResponse.company.isParentOwnedByAnotherCompany = "No";
39640
+ }
39641
+ } catch (err) {
39642
+ console.error("Error fetching parent/ultimate parent entities", err);
39643
+ }
39644
+ } else if (dataFromResponse.company) {
39645
+ dataFromResponse.company.isCompanyOwnedByAnotherCompany = "No";
39646
+ dataFromResponse.company.isParentOwnedByAnotherCompany = "No";
39647
+ }
39648
+ setRootLegalEntity(rootLegalEntityResponse);
39649
+ setData(dataFromResponse);
39650
+ setDefaultData(dataFromResponse);
39651
+ return rootLegalEntityResponse;
39652
+ } catch (err) {
39653
+ showToast({
39654
+ label: i18n.get("missingCompanyDetails"),
39655
+ type: "error"
39656
+ });
39573
39657
  }
39574
- return legalEntityResponse;
39575
39658
  }, [getLegalEntity2, legalEntityId]);
39576
39659
  useEffect(() => {
39577
39660
  (async () => {
39578
- await fetchLegalEntity();
39661
+ await fetchLegalEntities();
39579
39662
  })().catch(logger$8.error);
39580
- }, [fetchLegalEntity]);
39581
- const dataFromResponse = legalEntity ? mapLegalEntityToHighExposure(legalEntity) : {};
39663
+ }, [fetchLegalEntities]);
39582
39664
  const [data, setData] = useState(dataFromResponse);
39583
39665
  const [problems, setProblems] = useState(problemsProp ?? {});
39584
39666
  const {
@@ -39603,7 +39685,7 @@ function UpdateLegalEntityForHighExposure({
39603
39685
  setLoadingStatus,
39604
39686
  country
39605
39687
  });
39606
- const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, highExposureForms, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], legalEntity ? getFieldsWithExistingData(legalEntity) : []), [fieldConfigurations, problems == null ? void 0 : problems.remediationActions]);
39688
+ const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, highExposureForms, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], rootLegalEntity ? getFieldsWithExistingData(rootLegalEntity) : []), [fieldConfigurations, problems == null ? void 0 : problems.remediationActions]);
39607
39689
  const {
39608
39690
  state: {
39609
39691
  currentState
@@ -39647,37 +39729,102 @@ function UpdateLegalEntityForHighExposure({
39647
39729
  }, [derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, highExposureRequiredForms, problems]);
39648
39730
  const onSubmit = async () => {
39649
39731
  setLoadingStatus("loading");
39650
- const exposureDetails = mapHighExposureToLegalEntity(data);
39732
+ const companyExposureDetails = prepareExposureSubmitData(HighExposureIndex.COMPANY, data, rootLegalEntity);
39733
+ const parentCompanyExposureDetails = prepareExposureSubmitData(HighExposureIndex.PARENT_COMPANY, data, rootLegalEntity);
39734
+ const ultimateParentCompanyExposureDetails = prepareExposureSubmitData(HighExposureIndex.ULTIMATE_PARENT_COMPANY, data, rootLegalEntity);
39735
+ if (!companyExposureDetails || !rootLegalEntity) {
39736
+ showToast({
39737
+ label: i18n.get("missingCompanyDetails"),
39738
+ type: "error"
39739
+ });
39740
+ return;
39741
+ }
39742
+ let parentCompanyFailed = false;
39743
+ let ultimateParentCompanyFailed = false;
39651
39744
  try {
39652
- console.log({
39653
- exposureDetails
39745
+ const promises = [];
39746
+ if (parentCompanyExposureDetails) {
39747
+ const parentCompanyPromise = handleHighExposureFormSubmission(HighExposureIndex.PARENT_COMPANY, parentCompanyExposureDetails, createLegalEntity2, updateLegalEntity2, parentCompanyExposureDetails == null ? void 0 : parentCompanyExposureDetails.id);
39748
+ promises.push(parentCompanyPromise);
39749
+ }
39750
+ if (ultimateParentCompanyExposureDetails) {
39751
+ const ultimateParentCompanyPromise = handleHighExposureFormSubmission(HighExposureIndex.ULTIMATE_PARENT_COMPANY, ultimateParentCompanyExposureDetails, createLegalEntity2, updateLegalEntity2, ultimateParentCompanyExposureDetails == null ? void 0 : ultimateParentCompanyExposureDetails.id);
39752
+ promises.push(ultimateParentCompanyPromise);
39753
+ }
39754
+ const results = await Promise.allSettled(promises);
39755
+ const highExposureEntityAssociations = [];
39756
+ results.forEach((result, index) => {
39757
+ const highExposureType = index === 0 ? HighExposureIndex.PARENT_COMPANY : HighExposureIndex.ULTIMATE_PARENT_COMPANY;
39758
+ if (result.status === "fulfilled") {
39759
+ const response = result.value;
39760
+ if (highExposureType === HighExposureIndex.PARENT_COMPANY) {
39761
+ highExposureEntityAssociations.push({
39762
+ type: "immediateParentCompany",
39763
+ legalEntityId: response.id,
39764
+ associatorId: companyExposureDetails.id
39765
+ });
39766
+ } else if (highExposureType === HighExposureIndex.ULTIMATE_PARENT_COMPANY) {
39767
+ highExposureEntityAssociations.push({
39768
+ type: "ultimateParentCompany",
39769
+ legalEntityId: response.id,
39770
+ associatorId: companyExposureDetails.id
39771
+ });
39772
+ }
39773
+ } else {
39774
+ if (highExposureType === HighExposureIndex.PARENT_COMPANY) {
39775
+ parentCompanyFailed = true;
39776
+ } else if (highExposureType === HighExposureIndex.ULTIMATE_PARENT_COMPANY) {
39777
+ ultimateParentCompanyFailed = true;
39778
+ }
39779
+ handleSubmissionError(result.reason, highExposureType);
39780
+ }
39781
+ });
39782
+ if (!parentCompanyFailed && !ultimateParentCompanyFailed) {
39783
+ companyExposureDetails.entityAssociations = highExposureEntityAssociations;
39784
+ await handleHighExposureFormSubmission(HighExposureIndex.COMPANY, companyExposureDetails, createLegalEntity2, updateLegalEntity2, companyExposureDetails == null ? void 0 : companyExposureDetails.id);
39785
+ showToast({
39786
+ label: i18n.get("successfullyUpdatedDetails"),
39787
+ type: "success"
39788
+ });
39789
+ externalOnSubmit == null ? void 0 : externalOnSubmit({
39790
+ ...data
39791
+ });
39792
+ setProblems({});
39793
+ }
39794
+ } catch (e) {
39795
+ if (!parentCompanyFailed && !ultimateParentCompanyFailed) {
39796
+ handleSubmissionError(e, HighExposureIndex.COMPANY);
39797
+ }
39798
+ showToast({
39799
+ label: i18n.get("failedToUpdateDetails"),
39800
+ type: "error"
39654
39801
  });
39802
+ } finally {
39655
39803
  setLoadingStatus("success");
39804
+ }
39805
+ };
39806
+ const handleSubmissionError = (error, highExposureType) => {
39807
+ if (isValidationError(error.actualError)) {
39808
+ const validationErrors = processValidationErrors(error.actualError, void 0, highExposureApiKeyMapping);
39809
+ setProblems((prevProblems) => ({
39810
+ ...prevProblems,
39811
+ validationErrors: {
39812
+ ...prevProblems.validationErrors,
39813
+ [highExposureType]: validationErrors ?? {}
39814
+ }
39815
+ }));
39816
+ } else if (isMaintenanceModeError(error)) {
39656
39817
  showToast({
39657
- label: i18n.get("successfullyUpdatedDetails"),
39658
- type: "success"
39818
+ label: i18n.get("failedToUpdateDetails"),
39819
+ subLabel: i18n.get("maintenanceModeMessage"),
39820
+ type: "error",
39821
+ duration: "indefinite"
39659
39822
  });
39660
- externalOnSubmit == null ? void 0 : externalOnSubmit(data);
39661
- } catch (e) {
39823
+ } else {
39662
39824
  showToast({
39663
39825
  label: i18n.get("failedToUpdateDetails"),
39664
- type: "success"
39826
+ type: "error"
39665
39827
  });
39666
- if (isValidationError(e)) {
39667
- const validationErrors = processValidationErrors(e, void 0, highExposureApiKeyMapping);
39668
- setProblems({
39669
- ...problems,
39670
- validationErrors
39671
- });
39672
- } else if (isMaintenanceModeError(e)) {
39673
- showToast({
39674
- label: i18n.get("failedToUpdateDetails"),
39675
- subLabel: i18n.get("maintenanceModeMessage"),
39676
- type: "error",
39677
- duration: "indefinite"
39678
- });
39679
- }
39680
- setLoadingStatus("success");
39681
39828
  }
39682
39829
  };
39683
39830
  const formatDataForSummary2 = (data2) => {
@@ -39691,7 +39838,7 @@ function UpdateLegalEntityForHighExposure({
39691
39838
  const baseTrackingPayload = getBaseTrackingPayload({
39692
39839
  trackingConfig,
39693
39840
  parentLegalEntity,
39694
- legalEntity
39841
+ legalEntity: rootLegalEntity
39695
39842
  });
39696
39843
  const {
39697
39844
  handleNextClick,
@@ -39708,6 +39855,11 @@ function UpdateLegalEntityForHighExposure({
39708
39855
  formRef,
39709
39856
  onSubmit
39710
39857
  });
39858
+ if (!rootLegalEntity) {
39859
+ return jsx(Loader, {
39860
+ size: "medium"
39861
+ });
39862
+ }
39711
39863
  return jsx(FormWrapper, {
39712
39864
  taskName: "progress",
39713
39865
  handleNextClick,
@@ -39734,12 +39886,12 @@ function UpdateLegalEntityForHighExposure({
39734
39886
  legalEntityId,
39735
39887
  activeForm,
39736
39888
  capabilities,
39737
- data,
39889
+ data: defaultData,
39738
39890
  country: ((_c = data == null ? void 0 : data.company) == null ? void 0 : _c.country) ?? country,
39739
39891
  problems,
39740
39892
  shouldValidate,
39741
39893
  ref: formRef,
39742
- legalEntity,
39894
+ legalEntity: rootLegalEntity,
39743
39895
  handleFindAddress: getAddress2,
39744
39896
  handleAddressSearch: searchAddress2
39745
39897
  })
@@ -40385,7 +40537,7 @@ const ConfigurationApiProvider = ({
40385
40537
  isEmbeddedDropin,
40386
40538
  loadingContext
40387
40539
  } = authContext;
40388
- const sdkVersion = "3.26.0";
40540
+ const sdkVersion = "3.26.1";
40389
40541
  useAnalytics({
40390
40542
  onUserEvent,
40391
40543
  legalEntityId: rootLegalEntityId,
@@ -41067,7 +41219,7 @@ const DebugModal = ({
41067
41219
  };
41068
41220
  const copyToClipboard = async () => {
41069
41221
  const toCopy = {
41070
- sdkVersion: "3.26.0",
41222
+ sdkVersion: "3.26.1",
41071
41223
  experiments: Object.fromEntries(allExperimentsWithValues),
41072
41224
  settings: Object.fromEntries(allSettingsWithValues)
41073
41225
  };
@@ -41097,7 +41249,7 @@ const DebugModal = ({
41097
41249
  children: [jsxs("div", {
41098
41250
  className: "adyen-kyc-debug-modal__meta",
41099
41251
  children: [jsxs("span", {
41100
- children: ["SDK version: ", "3.26.0"]
41252
+ children: ["SDK version: ", "3.26.1"]
41101
41253
  }), jsxs("span", {
41102
41254
  children: ["rootLegalEntityId: ", rootLegalEntityId]
41103
41255
  })]
@@ -15,6 +15,7 @@ export interface HighExposureCompanySchema {
15
15
  doesYourCompanyHaveLEI?: string;
16
16
  legalEntityIdentifier?: string;
17
17
  isCompanyOwnedByAnotherCompany?: string;
18
+ doesNotKnowLegalEntityIdentifier?: boolean;
18
19
  isParentOwnedByAnotherCompany?: string;
19
20
  totalAssetsValue?: number;
20
21
  totalAssetsCurrency?: string;
@@ -23,6 +24,7 @@ export interface HighExposureCompanySchema {
23
24
  financialReportingDate?: string;
24
25
  legalInformationInsolvency?: string;
25
26
  legalProceedingsDate?: string;
27
+ isThisAddressTheMainHeadquarters?: string;
26
28
  }
27
29
  export type HighExposureParentCompanySchema = {
28
30
  country?: CountryCode;
@@ -40,7 +42,7 @@ export type HighExposureParentCompanySchema = {
40
42
  postalCode?: string;
41
43
  city?: string;
42
44
  stateOrProvince?: string;
43
- addressCountry?: string;
45
+ companyCountry?: string;
44
46
  totalAssetsValue?: number;
45
47
  totalAssetsCurrency?: string;
46
48
  annualTurnoverValue?: number;
@@ -65,7 +67,7 @@ export type HighExposureUltimateParentCompanySchema = {
65
67
  postalCode?: string;
66
68
  city?: string;
67
69
  stateOrProvince?: string;
68
- addressCountry?: string;
70
+ companyCountry?: string;
69
71
  totalAssetsValue?: number;
70
72
  totalAssetsCurrency?: string;
71
73
  annualTurnoverValue?: number;
@@ -204,3 +206,8 @@ export type HighExposureRegisteredAddressProps = {
204
206
  };
205
207
  export declare const companySchemaKeys: (keyof HighExposureCompanySchema)[];
206
208
  export declare const parentCompaniesSchemaKeys: (keyof HighExposureParentCompanySchema & HighExposureParentCompanySchema)[];
209
+ export declare enum HighExposureIndex {
210
+ COMPANY = "company",
211
+ PARENT_COMPANY = "parentCompany",
212
+ ULTIMATE_PARENT_COMPANY = "ultimateParentCompany"
213
+ }
@@ -0,0 +1,11 @@
1
+ import type { ExistingLegalEntity, LegalEntity } from '../../../core/models/api/legal-entity';
2
+ import type { Organization, OrganizationFinancialReports } from '../../../core/models/api/organization';
3
+ import type { HighExposureCompanySchema, HighExposureParentSchemasCombined, HighExposureSchema } from './types';
4
+ import { HighExposureIndex } from './types';
5
+ export declare const getLegalEntityId: (exposureIndex: HighExposureIndex, rootLegalEntity: ExistingLegalEntity | undefined) => undefined | string;
6
+ export declare const entityHasParentCompany: (data: HighExposureSchema) => boolean;
7
+ export declare const entityHasUltimateParentCompany: (data: HighExposureSchema) => boolean;
8
+ export declare const prepareExposureSubmitData: (exposureIndex: HighExposureIndex, data: HighExposureSchema, rootLegalEntity: ExistingLegalEntity | undefined) => LegalEntity;
9
+ export declare const getHighExposureFinancialReportData: (financialReport?: OrganizationFinancialReports) => Partial<HighExposureCompanySchema | HighExposureParentSchemasCombined>;
10
+ export declare const appendHighExposureData: (legalOrganization?: Organization, highExposureData?: HighExposureCompanySchema | HighExposureParentSchemasCombined) => HighExposureCompanySchema | HighExposureParentSchemasCombined | undefined;
11
+ export declare const handleHighExposureFormSubmission: (highExposureType: HighExposureIndex, details: LegalEntity | null, createFunction: (details: LegalEntity) => Promise<ExistingLegalEntity>, updateFunction: (details: LegalEntity, id: string) => Promise<ExistingLegalEntity>, entityId?: string) => Promise<ExistingLegalEntity | void>;
@@ -1,6 +1,6 @@
1
1
  import type { ValidatorRules } from '../../../utils/validation/types';
2
2
  import type { HighExposureCompanySchema, HighExposureParentCompanySchema, HighExposureUltimateParentCompanySchema } from './types';
3
3
  export declare const validateLegalEntityIdentifier: (legalEntityIdentifier: string | null | undefined, doesYourCompanyHaveLEI?: string, isDisabled?: boolean) => boolean;
4
+ export declare const validateLegalProceedingsDate: (legalProceedingsDate: string | null | undefined, legalInformationInsolvency?: string) => boolean;
4
5
  export declare const highExposureCompanyDetailsValidations: ValidatorRules<HighExposureCompanySchema>;
5
- export declare const highExposureParentCompanyDetailsValidations: ValidatorRules<HighExposureParentCompanySchema>;
6
- export declare const highExposureUltimateParentCompanyDetailsValidations: ValidatorRules<HighExposureUltimateParentCompanySchema>;
6
+ export declare const highExposureParentCompaniesDetailsValidations: ValidatorRules<HighExposureParentCompanySchema | HighExposureUltimateParentCompanySchema>;
@@ -1,2 +1,2 @@
1
1
  import type { HighExposureProps } from '../../Dropins/HighExposureDropin/types';
2
- export declare function UpdateLegalEntityForHighExposure({ parentLegalEntity, capabilities, country, trackingConfig, problems: problemsProp, onSubmit: externalOnSubmit, onChange, hideDropinLayout, handleHomeClick, homeButtonLabel, legalEntityId, legalEntity: legalEntityProps, }: HighExposureProps): import("preact").JSX.Element;
2
+ export declare function UpdateLegalEntityForHighExposure({ parentLegalEntity, capabilities, country, trackingConfig, problems: problemsProp, onChange, hideDropinLayout, handleHomeClick, homeButtonLabel, legalEntityId, onSubmit: externalOnSubmit, }: HighExposureProps): import("preact").JSX.Element;
@@ -2,7 +2,7 @@ import type { SettlorExemptionReason } from '../../../components/TrustRoleAndEnt
2
2
  import type { DecisionMakerType } from './decision-maker-type';
3
3
  import type { LegalEntityType } from './legal-entity-type';
4
4
  import type { TrustMemberType } from './trust-member-type';
5
- export type LegalEntityAssociationType = DecisionMakerType | TrustMemberType | LegalEntityType.TRUST | LegalEntityType.SOLE_PROPRIETORSHIP | 'legalRepresentative';
5
+ export type LegalEntityAssociationType = DecisionMakerType | TrustMemberType | LegalEntityType.TRUST | LegalEntityType.SOLE_PROPRIETORSHIP | 'legalRepresentative' | 'immediateParentCompany' | 'ultimateParentCompany';
6
6
  export type LegalRepresentativeRelationshipType = 'parent' | 'guardian';
7
7
  export interface LegalEntityAssociation {
8
8
  jobTitle?: string;
@@ -26,6 +26,12 @@ export interface Organization {
26
26
  vatNumber?: string;
27
27
  vatAbsenceReason?: VatAbsenceReason[];
28
28
  type?: CompanyTypesValue | '';
29
+ financialReports?: OrganizationFinancialReports[];
30
+ statusOfLegalProceeding?: string;
31
+ dateOfInitiationOfLegalProceeding?: string;
32
+ economicSector?: string;
33
+ legalForm?: string;
34
+ globalLegalEntityIdentifier?: string;
29
35
  }
30
36
  export declare enum VatAbsenceReason {
31
37
  IndustryExemption = "industryExemption",
@@ -39,3 +45,10 @@ export type TaxInformation = {
39
45
  type: TaxInformationType;
40
46
  };
41
47
  export type TaxInformationType = 'SSN' | 'EIN' | 'ITIN' | 'ABN' | 'UEN' | 'GST' | 'IRD' | 'BRN';
48
+ export type OrganizationFinancialReports = {
49
+ employeeCount?: string;
50
+ annualTurnover?: string;
51
+ netAssets?: string;
52
+ dateOfFinancialData?: string;
53
+ currencyOfFinancialData?: string;
54
+ };
@@ -689,9 +689,23 @@ export declare const trustComponentsKeyMapping: {
689
689
  };
690
690
  export declare const trustApiKeyMapping: {};
691
691
  export declare const highExposureComponentsKeyMapping: {
692
- 'company.numberOfEmployees': string;
693
- 'parentCompany.numberOfEmployees': string;
694
- 'ultimateParentCompany.numberOfEmployees': string;
692
+ numberOfEmployees: string;
693
+ annualTurnoverValue: string;
694
+ totalAssetsValue: string;
695
+ financialReportingDate: string;
696
+ annualTurnoverCurrency: string;
697
+ legalProceedingsDate: string;
698
+ legalInformationInsolvency: string;
699
+ legalEntityIdentifier: string;
700
+ naceCode: string;
701
+ legalForm: string;
702
+ legalName: string;
703
+ address: string;
704
+ otherAddressInformation: string;
705
+ city: string;
706
+ postalCode: string;
707
+ stateOrProvince: string;
708
+ country: string;
695
709
  };
696
710
  export declare const highExposureApiKeyMapping: {};
697
711
  export declare const solePropComponentsKeyMapping: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.26.0",
3
+ "version": "3.26.1",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",