@adyen/kyc-components 3.20.0 → 3.20.2

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.
@@ -931,7 +931,8 @@ const legalCompanyName__US = "Legal name";
931
931
  const legalCompanyName__helperText = "Enter the name exactly as it is on your company's official registration documents.";
932
932
  const legalCompanyName__helperText__AU = "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC).";
933
933
  const legalCompanyName__helperText__NL = "Enter the name exactly as it is on your Chamber of Commerce registration.";
934
- const legalCompanyName__helperText__US = "The legal name is used to identify a business with the government. This information came from a trusted data source and can not be edited.";
934
+ const legalCompanyName__helperText__US = "Enter the name exactly as it appears on your Secretary of State Registration.";
935
+ const legalCompanyName__helperText__US__business = "The legal name is used to identify a business with the government. This information came from a trusted data source and can not be edited.";
935
936
  const legalCompanyName__helperText__PR = "Enter the name exactly as it appears on your Department of State Registration.";
936
937
  const legalCompanyName__helperText__SG = "Enter the name exactly as it is on your Accounting and Corporate Regulatory Authority (ACRA) BizFile.";
937
938
  const legalCompanyName__helperText__HK = "Enter the name exactly as it is on your Hong Kong Companies Registry's Certificate of Incorporation.";
@@ -2285,6 +2286,7 @@ const defaultTrans = {
2285
2286
  legalCompanyName__helperText__AU,
2286
2287
  legalCompanyName__helperText__NL,
2287
2288
  legalCompanyName__helperText__US,
2289
+ legalCompanyName__helperText__US__business,
2288
2290
  legalCompanyName__helperText__PR,
2289
2291
  legalCompanyName__helperText__SG,
2290
2292
  legalCompanyName__helperText__HK,
@@ -4332,6 +4334,15 @@ function useForm({
4332
4334
  fieldProblems: state2.fieldProblems
4333
4335
  };
4334
4336
  }
4337
+ const resolveFieldMetadata = (countryEntry, params, defaultMetadata) => {
4338
+ if (typeof countryEntry === "object") {
4339
+ return countryEntry;
4340
+ }
4341
+ if (typeof countryEntry === "function") {
4342
+ return countryEntry(params);
4343
+ }
4344
+ return defaultMetadata;
4345
+ };
4335
4346
  function useDataset(datasetIdentifier2, skip) {
4336
4347
  const {
4337
4348
  i18n
@@ -5387,189 +5398,6 @@ function LegalCompanyNameField({
5387
5398
  })
5388
5399
  });
5389
5400
  }
5390
- const Disclaimer = ({
5391
- title,
5392
- children
5393
- }) => jsxs("div", {
5394
- className: "adyen-kyc-disclaimer-container",
5395
- children: [jsx("div", {
5396
- className: "adyen-kyc-disclaimer__title",
5397
- children: title
5398
- }), jsx("div", {
5399
- className: "adyen-kyc-disclaimer__content",
5400
- children
5401
- })]
5402
- });
5403
- const PatriotActDisclosure = () => {
5404
- const {
5405
- i18n
5406
- } = useI18nContext();
5407
- return jsxs(Disclaimer, {
5408
- title: i18n.get("patriotActDisclosureTitle"),
5409
- children: [jsx("p", {
5410
- children: i18n.get("patriotActDisclosureTextParagraph1")
5411
- }), jsx("p", {
5412
- children: i18n.get("patriotActDisclosureTextParagraph2")
5413
- })]
5414
- });
5415
- };
5416
- const companyCountryValidationRules = {
5417
- country: {
5418
- modes: ["blur"],
5419
- validate: (companyCountry) => !isEmpty(companyCountry),
5420
- errorMessage: "fieldIsRequired"
5421
- },
5422
- legalCompanyName: {
5423
- modes: ["blur"],
5424
- validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
5425
- errorMessage: "fieldIsRequired"
5426
- },
5427
- countryOfGoverningLaw: {
5428
- modes: ["blur"],
5429
- validate: (countryOfGoverningLaw2) => !isEmpty(countryOfGoverningLaw2),
5430
- errorMessage: "fieldIsRequired"
5431
- }
5432
- };
5433
- const countryWithGoverningLawFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...COUNTRY_OF_GOVERNING_LAW_FIELD];
5434
- const companyNameAndCountryFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD];
5435
- function CompanyNameAndCountry(props) {
5436
- const {
5437
- i18n
5438
- } = useI18nContext();
5439
- const {
5440
- isSettingEnabled
5441
- } = useSettingsContext();
5442
- const {
5443
- id: id2,
5444
- isTopLevelEntity
5445
- } = props;
5446
- const allowedCountries = useAllowedCountries();
5447
- const {
5448
- isExperimentEnabled
5449
- } = useExperimentsContext();
5450
- const {
5451
- sliceData,
5452
- updateStateSlice
5453
- } = useGlobalDataSlice(id2);
5454
- const schemaWithGoverningLaw = (sliceData == null ? void 0 : sliceData.country) === "GB" && (sliceData == null ? void 0 : sliceData.differentCountryOfGoverningLaw) ? countryWithGoverningLawFields : companyNameAndCountryFields;
5455
- const {
5456
- data: formData,
5457
- valid: formValid,
5458
- errors: formErrors,
5459
- fieldProblems: formFieldProblems,
5460
- handleChangeFor
5461
- } = useForm({
5462
- ...props,
5463
- schema: schemaWithGoverningLaw,
5464
- defaultData: props == null ? void 0 : props.data,
5465
- rules: (props == null ? void 0 : props.validators) || companyCountryValidationRules,
5466
- fieldProblems: props == null ? void 0 : props.fieldValidationErrors
5467
- });
5468
- const formUtils = formUtilities(props, i18n);
5469
- const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
5470
- const isCountryOfGoverningLawEnabled = isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies");
5471
- const isCountryOfGoverningLawAllowed = formData.country === "GB";
5472
- const showCountryOfGoverningLaw = isCountryOfGoverningLawEnabled && isCountryOfGoverningLawAllowed;
5473
- useEffect(() => {
5474
- updateStateSlice == null ? void 0 : updateStateSlice({
5475
- data: {
5476
- ...sliceData,
5477
- ...formData
5478
- },
5479
- errors: formErrors,
5480
- valid: formValid,
5481
- fieldProblems: formFieldProblems
5482
- });
5483
- }, [formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
5484
- const handleChangeForCountries = (key) => (e) => {
5485
- handleChangeFor(key)(e);
5486
- if (!formData.differentCountryOfGoverningLaw && e.target.value === "GB") {
5487
- const countryOfGoverningLawEvent = {
5488
- target: {
5489
- name: "countryOfGoverningLaw",
5490
- value: e.target.value
5491
- }
5492
- };
5493
- handleChangeFor("countryOfGoverningLaw")(countryOfGoverningLawEvent);
5494
- }
5495
- };
5496
- return jsxs("form", {
5497
- children: [jsx(FormHeader, {
5498
- heading: props == null ? void 0 : props.heading
5499
- }), jsx(ErrorPanel, {
5500
- verificationErrors: props == null ? void 0 : props.formVerificationErrors,
5501
- validationErrors: props == null ? void 0 : props.fieldValidationErrors,
5502
- formUtils,
5503
- id: "ariaErrorField"
5504
- }), formData.country === "US" ? jsx(PatriotActDisclosure, {}) : void 0, formUtils.isRequiredField("legalCompanyName") && jsx(LegalCompanyNameField, {
5505
- data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
5506
- valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
5507
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
5508
- labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
5509
- helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
5510
- legalCompanyName: "legalCompanyName__helperText"
5511
- }),
5512
- readonly: formUtils.isReadOnly("legalCompanyName"),
5513
- handleChangeFor
5514
- }), formUtils.isRequiredField("country") && jsx(CountryField, {
5515
- data: formUtils.getFieldData(formData, COUNTRY_FIELD),
5516
- valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
5517
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
5518
- labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
5519
- country: "countryRegionOfEstablishment"
5520
- }),
5521
- readonly: !isAllowedEditPrefilledCountry || Boolean(props == null ? void 0 : props.disableCountry),
5522
- classNameModifiers: ["country"],
5523
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
5524
- handleChangeFor: handleChangeForCountries
5525
- }), showCountryOfGoverningLaw && jsx(CountryOfGoverningLawField, {
5526
- data: formUtils.getFieldData(formData, COUNTRY_OF_GOVERNING_LAW_FIELD),
5527
- valid: formUtils.getFieldValid(formValid, COUNTRY_OF_GOVERNING_LAW_FIELD),
5528
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_OF_GOVERNING_LAW_FIELD),
5529
- labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
5530
- readonly: false,
5531
- classNameModifiers: ["country"],
5532
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
5533
- handleChangeFor
5534
- })]
5535
- });
5536
- }
5537
- const CompanyNameAndCountryComponent = memo(CompanyNameAndCountry, (prevProps, nextProps) => {
5538
- var _a, _b;
5539
- return objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && ((_a = prevProps.data) == null ? void 0 : _a.country) === ((_b = nextProps.data) == null ? void 0 : _b.country) && prevProps.shouldValidate === nextProps.shouldValidate;
5540
- });
5541
- function StateContextSetter({
5542
- stateRef
5543
- }) {
5544
- if (stateRef.current.setState) {
5545
- return null;
5546
- }
5547
- return jsx(StateContext.Consumer, {
5548
- children: (stateContextValue) => {
5549
- if (!stateContextValue) {
5550
- throw new Error("<StateContextSetter> needs to be mounted inside a <StateProvider>");
5551
- }
5552
- const {
5553
- dispatch,
5554
- setActiveForms
5555
- } = stateContextValue;
5556
- stateRef.current.setState = dispatch;
5557
- stateRef.current.setActiveForms = setActiveForms;
5558
- return null;
5559
- }
5560
- });
5561
- }
5562
- var CompanyTypesValue = /* @__PURE__ */ ((CompanyTypesValue2) => {
5563
- CompanyTypesValue2["PRIVATE_COMPANY"] = "privateCompany";
5564
- CompanyTypesValue2["PUBLIC_COMPANY"] = "listedPublicCompany";
5565
- CompanyTypesValue2["UNLISTED_PUBLIC_COMPANY"] = "unlistedPublicCompany";
5566
- CompanyTypesValue2["INCORPORATED_PARTNERSHIP"] = "partnershipIncorporated";
5567
- CompanyTypesValue2["INCORPORATED_ASSOCIATION"] = "associationIncorporated";
5568
- CompanyTypesValue2["GOVERNMENTAL_ORGANIZATION"] = "governmentalOrganization";
5569
- CompanyTypesValue2["NON_PROFIT_OR_CHARITABLE"] = "nonProfit";
5570
- CompanyTypesValue2["SOLE_PROPRIETORSHIP"] = "soleProprietorship";
5571
- return CompanyTypesValue2;
5572
- })(CompanyTypesValue || {});
5573
5401
  var CountryCodes = /* @__PURE__ */ ((CountryCodes2) => {
5574
5402
  CountryCodes2["Afghanistan"] = "AF";
5575
5403
  CountryCodes2["AlandIslands"] = "AX";
@@ -5819,15 +5647,232 @@ var CountryCodes = /* @__PURE__ */ ((CountryCodes2) => {
5819
5647
  CountryCodes2["Zimbabwe"] = "ZW";
5820
5648
  return CountryCodes2;
5821
5649
  })(CountryCodes || {});
5822
- const resolveFieldMetadata = (countryEntry, params, defaultMetadata) => {
5823
- if (typeof countryEntry === "object") {
5824
- return countryEntry;
5825
- }
5826
- if (typeof countryEntry === "function") {
5827
- return countryEntry(params);
5650
+ const validateNotEmptyOnBlur = {
5651
+ modes: ["blur"],
5652
+ validate: (val) => !isEmpty(val),
5653
+ errorMessage: "fieldIsRequired"
5654
+ };
5655
+ const validatePatternOnBlur = (pattern) => ({
5656
+ modes: ["blur"],
5657
+ validate: (val) => !!val && pattern.test(val)
5658
+ });
5659
+ const defaultFieldMetadata$a = {
5660
+ label: "legalCompanyName",
5661
+ helperText: "legalCompanyName__helperText",
5662
+ validators: validateNotEmptyOnBlur
5663
+ };
5664
+ const defaultFieldConfig$a = {
5665
+ [CountryCodes.Australia]: {
5666
+ label: "legalCompanyName",
5667
+ helperText: "legalCompanyName__helperText__AU",
5668
+ validators: validateNotEmptyOnBlur
5669
+ },
5670
+ [CountryCodes.HongKong]: {
5671
+ label: "legalCompanyName",
5672
+ helperText: "legalCompanyName__helperText__HK",
5673
+ validators: validateNotEmptyOnBlur
5674
+ },
5675
+ [CountryCodes.Netherlands]: {
5676
+ label: "legalCompanyName",
5677
+ helperText: "legalCompanyName__helperText__NL",
5678
+ validators: validateNotEmptyOnBlur
5679
+ },
5680
+ [CountryCodes.Singapore]: {
5681
+ label: "legalCompanyName",
5682
+ helperText: "legalCompanyName__helperText__SG",
5683
+ validators: validateNotEmptyOnBlur
5684
+ },
5685
+ [CountryCodes.UnitedStates]: ({
5686
+ isBusiness
5687
+ }) => ({
5688
+ label: "legalCompanyName__US",
5689
+ helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
5690
+ validators: validateNotEmptyOnBlur
5691
+ })
5692
+ };
5693
+ const Disclaimer = ({
5694
+ title,
5695
+ children
5696
+ }) => jsxs("div", {
5697
+ className: "adyen-kyc-disclaimer-container",
5698
+ children: [jsx("div", {
5699
+ className: "adyen-kyc-disclaimer__title",
5700
+ children: title
5701
+ }), jsx("div", {
5702
+ className: "adyen-kyc-disclaimer__content",
5703
+ children
5704
+ })]
5705
+ });
5706
+ const PatriotActDisclosure = () => {
5707
+ const {
5708
+ i18n
5709
+ } = useI18nContext();
5710
+ return jsxs(Disclaimer, {
5711
+ title: i18n.get("patriotActDisclosureTitle"),
5712
+ children: [jsx("p", {
5713
+ children: i18n.get("patriotActDisclosureTextParagraph1")
5714
+ }), jsx("p", {
5715
+ children: i18n.get("patriotActDisclosureTextParagraph2")
5716
+ })]
5717
+ });
5718
+ };
5719
+ const companyCountryValidationRules = {
5720
+ country: {
5721
+ modes: ["blur"],
5722
+ validate: (companyCountry) => !isEmpty(companyCountry),
5723
+ errorMessage: "fieldIsRequired"
5724
+ },
5725
+ legalCompanyName: {
5726
+ modes: ["blur"],
5727
+ validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
5728
+ errorMessage: "fieldIsRequired"
5729
+ },
5730
+ countryOfGoverningLaw: {
5731
+ modes: ["blur"],
5732
+ validate: (countryOfGoverningLaw2) => !isEmpty(countryOfGoverningLaw2),
5733
+ errorMessage: "fieldIsRequired"
5828
5734
  }
5829
- return defaultMetadata;
5830
5735
  };
5736
+ const countryWithGoverningLawFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...COUNTRY_OF_GOVERNING_LAW_FIELD];
5737
+ const companyNameAndCountryFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD];
5738
+ function CompanyNameAndCountry(props) {
5739
+ const {
5740
+ i18n
5741
+ } = useI18nContext();
5742
+ const {
5743
+ isSettingEnabled
5744
+ } = useSettingsContext();
5745
+ const allowedCountries = useAllowedCountries();
5746
+ const {
5747
+ isExperimentEnabled
5748
+ } = useExperimentsContext();
5749
+ const {
5750
+ sliceData,
5751
+ updateStateSlice
5752
+ } = useGlobalDataSlice(props.id);
5753
+ let mergedProps = props;
5754
+ mergedProps = mergeFieldMetadataIntoProps("legalCompanyName", resolveFieldMetadata(defaultFieldConfig$a[sliceData == null ? void 0 : sliceData.country], {
5755
+ isBusiness: false
5756
+ }, defaultFieldMetadata$a), mergedProps);
5757
+ const schemaWithGoverningLaw = (sliceData == null ? void 0 : sliceData.country) === "GB" && (sliceData == null ? void 0 : sliceData.differentCountryOfGoverningLaw) ? countryWithGoverningLawFields : companyNameAndCountryFields;
5758
+ const {
5759
+ data: formData,
5760
+ valid: formValid,
5761
+ errors: formErrors,
5762
+ fieldProblems: formFieldProblems,
5763
+ handleChangeFor
5764
+ } = useForm({
5765
+ ...mergedProps,
5766
+ schema: schemaWithGoverningLaw,
5767
+ defaultData: mergedProps == null ? void 0 : mergedProps.data,
5768
+ rules: (mergedProps == null ? void 0 : mergedProps.validators) || companyCountryValidationRules,
5769
+ fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors
5770
+ });
5771
+ const formUtils = formUtilities(mergedProps, i18n);
5772
+ const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
5773
+ const isCountryOfGoverningLawEnabled = isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies");
5774
+ const isCountryOfGoverningLawAllowed = formData.country === "GB";
5775
+ const showCountryOfGoverningLaw = isCountryOfGoverningLawEnabled && isCountryOfGoverningLawAllowed;
5776
+ useEffect(() => {
5777
+ updateStateSlice == null ? void 0 : updateStateSlice({
5778
+ data: {
5779
+ ...sliceData,
5780
+ ...formData
5781
+ },
5782
+ errors: formErrors,
5783
+ valid: formValid,
5784
+ fieldProblems: formFieldProblems
5785
+ });
5786
+ }, [formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
5787
+ const handleChangeForCountries = (key) => (e) => {
5788
+ handleChangeFor(key)(e);
5789
+ if (!formData.differentCountryOfGoverningLaw && e.target.value === "GB") {
5790
+ const countryOfGoverningLawEvent = {
5791
+ target: {
5792
+ name: "countryOfGoverningLaw",
5793
+ value: e.target.value
5794
+ }
5795
+ };
5796
+ handleChangeFor("countryOfGoverningLaw")(countryOfGoverningLawEvent);
5797
+ }
5798
+ };
5799
+ return jsxs("form", {
5800
+ children: [jsx(FormHeader, {
5801
+ heading: props == null ? void 0 : props.heading
5802
+ }), jsx(ErrorPanel, {
5803
+ verificationErrors: props == null ? void 0 : props.formVerificationErrors,
5804
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
5805
+ formUtils,
5806
+ id: "ariaErrorField"
5807
+ }), formData.country === "US" ? jsx(PatriotActDisclosure, {}) : void 0, formUtils.isRequiredField("legalCompanyName") && jsx(LegalCompanyNameField, {
5808
+ data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
5809
+ valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
5810
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
5811
+ labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
5812
+ helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
5813
+ legalCompanyName: "legalCompanyName__helperText"
5814
+ }),
5815
+ readonly: formUtils.isReadOnly("legalCompanyName"),
5816
+ handleChangeFor
5817
+ }), formUtils.isRequiredField("country") && jsx(CountryField, {
5818
+ data: formUtils.getFieldData(formData, COUNTRY_FIELD),
5819
+ valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
5820
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
5821
+ labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
5822
+ country: "countryRegionOfEstablishment"
5823
+ }),
5824
+ readonly: !isAllowedEditPrefilledCountry || Boolean(props == null ? void 0 : props.disableCountry),
5825
+ classNameModifiers: ["country"],
5826
+ allowedCountries: mergedProps.isTopLevelEntity ? allowedCountries : void 0,
5827
+ handleChangeFor: handleChangeForCountries
5828
+ }), showCountryOfGoverningLaw && jsx(CountryOfGoverningLawField, {
5829
+ data: formUtils.getFieldData(formData, COUNTRY_OF_GOVERNING_LAW_FIELD),
5830
+ valid: formUtils.getFieldValid(formValid, COUNTRY_OF_GOVERNING_LAW_FIELD),
5831
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_OF_GOVERNING_LAW_FIELD),
5832
+ labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
5833
+ readonly: false,
5834
+ classNameModifiers: ["country"],
5835
+ allowedCountries: mergedProps.isTopLevelEntity ? allowedCountries : void 0,
5836
+ handleChangeFor
5837
+ })]
5838
+ });
5839
+ }
5840
+ const CompanyNameAndCountryComponent = memo(CompanyNameAndCountry, (prevProps, nextProps) => {
5841
+ var _a, _b;
5842
+ return objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && ((_a = prevProps.data) == null ? void 0 : _a.country) === ((_b = nextProps.data) == null ? void 0 : _b.country) && prevProps.shouldValidate === nextProps.shouldValidate;
5843
+ });
5844
+ function StateContextSetter({
5845
+ stateRef
5846
+ }) {
5847
+ if (stateRef.current.setState) {
5848
+ return null;
5849
+ }
5850
+ return jsx(StateContext.Consumer, {
5851
+ children: (stateContextValue) => {
5852
+ if (!stateContextValue) {
5853
+ throw new Error("<StateContextSetter> needs to be mounted inside a <StateProvider>");
5854
+ }
5855
+ const {
5856
+ dispatch,
5857
+ setActiveForms
5858
+ } = stateContextValue;
5859
+ stateRef.current.setState = dispatch;
5860
+ stateRef.current.setActiveForms = setActiveForms;
5861
+ return null;
5862
+ }
5863
+ });
5864
+ }
5865
+ var CompanyTypesValue = /* @__PURE__ */ ((CompanyTypesValue2) => {
5866
+ CompanyTypesValue2["PRIVATE_COMPANY"] = "privateCompany";
5867
+ CompanyTypesValue2["PUBLIC_COMPANY"] = "listedPublicCompany";
5868
+ CompanyTypesValue2["UNLISTED_PUBLIC_COMPANY"] = "unlistedPublicCompany";
5869
+ CompanyTypesValue2["INCORPORATED_PARTNERSHIP"] = "partnershipIncorporated";
5870
+ CompanyTypesValue2["INCORPORATED_ASSOCIATION"] = "associationIncorporated";
5871
+ CompanyTypesValue2["GOVERNMENTAL_ORGANIZATION"] = "governmentalOrganization";
5872
+ CompanyTypesValue2["NON_PROFIT_OR_CHARITABLE"] = "nonProfit";
5873
+ CompanyTypesValue2["SOLE_PROPRIETORSHIP"] = "soleProprietorship";
5874
+ return CompanyTypesValue2;
5875
+ })(CompanyTypesValue || {});
5831
5876
  const cachedStripPatterns = /* @__PURE__ */ new Map();
5832
5877
  const makeStripPattern = (mask) => {
5833
5878
  const inputPatterns = mask.tokens.filter((token) => token.type === "input" && !!token.allow).map((token) => token.allow);
@@ -7717,15 +7762,6 @@ const PassportNumberPatterns = {
7717
7762
  const ProofOfIdentityCardPatterns = {
7718
7763
  [CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
7719
7764
  };
7720
- const validateNotEmptyOnBlur = {
7721
- modes: ["blur"],
7722
- validate: (val) => !isEmpty(val),
7723
- errorMessage: "fieldIsRequired"
7724
- };
7725
- const validatePatternOnBlur = (pattern) => ({
7726
- modes: ["blur"],
7727
- validate: (val) => !!val && pattern.test(val)
7728
- });
7729
7765
  const defaultFieldMetadata$9 = {
7730
7766
  label: "registrationNumber"
7731
7767
  };
@@ -10756,9 +10792,6 @@ const businessDetailsFieldsPerScenario = {
10756
10792
  };
10757
10793
  const countryConfig$3 = {
10758
10794
  [CountryCodes.Australia]: {
10759
- legalCompanyName: {
10760
- helperText: "legalCompanyName__helperText__AU"
10761
- },
10762
10795
  legalEntityType: {
10763
10796
  label: "companyType"
10764
10797
  }
@@ -10811,9 +10844,6 @@ const countryConfig$3 = {
10811
10844
  [CountryCodes.Gibraltar]: {},
10812
10845
  [CountryCodes.Guernsey]: {},
10813
10846
  [CountryCodes.HongKong]: {
10814
- legalCompanyName: {
10815
- helperText: "legalCompanyName__helperText__HK"
10816
- },
10817
10847
  legalEntityType: {
10818
10848
  label: "typeOfCompany"
10819
10849
  },
@@ -10867,9 +10897,6 @@ const countryConfig$3 = {
10867
10897
  },
10868
10898
  [CountryCodes.Monaco]: {},
10869
10899
  [CountryCodes.Netherlands]: {
10870
- legalCompanyName: {
10871
- helperText: "legalCompanyName__helperText__NL"
10872
- },
10873
10900
  vatAbsenceReason: {
10874
10901
  label: "vatAbsenceReason"
10875
10902
  }
@@ -10905,9 +10932,6 @@ const countryConfig$3 = {
10905
10932
  country: {
10906
10933
  label: "country__US__business"
10907
10934
  },
10908
- legalCompanyName: {
10909
- helperText: "legalCompanyName__helperText__US"
10910
- },
10911
10935
  tradingName: {
10912
10936
  label: "doingBusinessAs"
10913
10937
  },
@@ -10927,9 +10951,6 @@ const countryConfig$3 = {
10927
10951
  registrationNumber: {
10928
10952
  label: "uen"
10929
10953
  },
10930
- legalCompanyName: {
10931
- helperText: "legalCompanyName__helperText__SG"
10932
- },
10933
10954
  legalEntityType: {
10934
10955
  label: "companyType"
10935
10956
  },
@@ -10958,10 +10979,6 @@ const countryConfig$3 = {
10958
10979
  stateOrProvince: {
10959
10980
  label: "stateOrProvince__US__business"
10960
10981
  },
10961
- legalCompanyName: {
10962
- label: "legalCompanyName__US",
10963
- helperText: "legalCompanyName__helperText__US"
10964
- },
10965
10982
  tradingName: {
10966
10983
  label: "doingBusinessAs"
10967
10984
  },
@@ -11468,7 +11485,6 @@ const rules$3 = ({
11468
11485
  data,
11469
11486
  country: country2,
11470
11487
  taskType,
11471
- isEmbeddedDropin,
11472
11488
  isExperimentEnabled = () => false
11473
11489
  }) => ({
11474
11490
  isDirectorIdNumberRequiredForCountry: () => {
@@ -11540,7 +11556,7 @@ const rules$3 = ({
11540
11556
  }
11541
11557
  },
11542
11558
  accountHolderIfCustomer: () => {
11543
- if (taskType === TaskTypes.INDIVIDUAL && !isEmbeddedDropin && !(isExperimentEnabled == null ? void 0 : isExperimentEnabled("EnableNewEntryFlow"))) {
11559
+ if (taskType === TaskTypes.INDIVIDUAL && !(isExperimentEnabled == null ? void 0 : isExperimentEnabled("EnableNewEntryFlow"))) {
11544
11560
  return REQUIRED;
11545
11561
  }
11546
11562
  },
@@ -24260,13 +24276,6 @@ const dbaNameFieldMetadata = {
24260
24276
  label: "dbaName",
24261
24277
  validators: validateNotEmptyOnBlur
24262
24278
  };
24263
- const LegalCompanyNameFieldValidation = () => ({
24264
- legalCompanyName: {
24265
- modes: ["blur"],
24266
- validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
24267
- errorMessage: "fieldIsRequired"
24268
- }
24269
- });
24270
24279
  const TAX_INFORMATION_FIELD = ["taxInformation", "exemptedFromTax", "isUen"];
24271
24280
  function TaxInformationField({
24272
24281
  data,
@@ -24623,13 +24632,9 @@ function AdditionalInformationComponent({
24623
24632
  return (_a2 = initialFormUtilsProps.allFields) == null ? void 0 : _a2.reduce((acc, field) => {
24624
24633
  switch (field) {
24625
24634
  case "legalCompanyName":
24626
- return {
24627
- ...acc,
24628
- validators: {
24629
- ...acc.validators,
24630
- ...LegalCompanyNameFieldValidation()
24631
- }
24632
- };
24635
+ return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$a[country2], {
24636
+ isBusiness: true
24637
+ }, defaultFieldMetadata$a), acc);
24633
24638
  case "dbaName":
24634
24639
  return mergeFieldMetadataIntoProps("dbaName", dbaNameFieldMetadata, acc);
24635
24640
  case "registrationNumber":
@@ -27791,13 +27796,6 @@ function CompanyLookup({
27791
27796
  });
27792
27797
  }
27793
27798
  const CompanyLookupComponent = memo(CompanyLookup, (prevProps, nextProps) => objectsDeepEqual(prevProps.defaultData, nextProps.defaultData) && prevProps.canVerify === nextProps.canVerify && prevProps.legalCompanyName === nextProps.legalCompanyName && prevProps.country === nextProps.country && prevProps.stateOrProvince === nextProps.stateOrProvince && prevProps.taxInformationNumber === nextProps.taxInformationNumber && prevProps.setLoading === nextProps.setLoading && prevProps.setKompanyAddress === nextProps.setKompanyAddress && prevProps.handleCompanyIndexSearch === nextProps.handleCompanyIndexSearch && prevProps.handleCompanyDeepSearch === nextProps.handleCompanyDeepSearch && prevProps.handleGetCompanyDataset === nextProps.handleGetCompanyDataset && prevProps.handleRefreshCompanyDataset === nextProps.handleRefreshCompanyDataset && prevProps.handleVerifyTin === nextProps.handleVerifyTin);
27794
- const StateFieldValidation = () => ({
27795
- stateOrProvince: {
27796
- modes: ["blur"],
27797
- validate: (stateOrProvince2) => !isEmpty(stateOrProvince2),
27798
- errorMessage: "fieldIsRequired"
27799
- }
27800
- });
27801
27799
  const COMPANY_BASICS_FORM_ID = "companyBasics";
27802
27800
  const companyBasicsFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...STATE_FIELD, ...TAX_INFORMATION_FIELD];
27803
27801
  function CompanyBasics({
@@ -27861,13 +27859,9 @@ function CompanyBasics({
27861
27859
  return (_a2 = initialFormUtilsProps.allFields) == null ? void 0 : _a2.reduce((acc, field) => {
27862
27860
  switch (field) {
27863
27861
  case "legalCompanyName":
27864
- return {
27865
- ...acc,
27866
- validators: {
27867
- ...acc.validators,
27868
- ...LegalCompanyNameFieldValidation()
27869
- }
27870
- };
27862
+ return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$a[country2], {
27863
+ isBusiness: false
27864
+ }, defaultFieldMetadata$a), acc);
27871
27865
  case "country":
27872
27866
  return {
27873
27867
  ...acc,
@@ -27877,13 +27871,9 @@ function CompanyBasics({
27877
27871
  }
27878
27872
  };
27879
27873
  case "stateOrProvince":
27880
- return {
27881
- ...acc,
27882
- validators: {
27883
- ...acc.validators,
27884
- ...StateFieldValidation()
27885
- }
27886
- };
27874
+ return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
27875
+ isBusiness: false
27876
+ }, defaultFieldMetadata), acc);
27887
27877
  case "taxInformation":
27888
27878
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$1[country2], {
27889
27879
  taxIdNumberType,
@@ -27893,7 +27883,7 @@ function CompanyBasics({
27893
27883
  return acc;
27894
27884
  }
27895
27885
  }, initialFormUtilsProps);
27896
- }, [country2, initialFormUtilsProps, taxIdNumberType]);
27886
+ }, [companyType2, country2, initialFormUtilsProps, taxIdNumberType]);
27897
27887
  const schema = (requiredFields == null ? void 0 : requiredFields.length) ? requiredFields : ["legalCompanyName", "country"];
27898
27888
  const {
27899
27889
  schema: formSchema,
@@ -32240,9 +32230,6 @@ function IndividualDropinComponent({
32240
32230
  const {
32241
32231
  getConfiguration: getConfiguration2
32242
32232
  } = useConfigurationApi();
32243
- const {
32244
- isEmbeddedDropin
32245
- } = useAuthContext();
32246
32233
  const {
32247
32234
  isExperimentEnabled
32248
32235
  } = useExperimentsContext();
@@ -32288,7 +32275,6 @@ function IndividualDropinComponent({
32288
32275
  data,
32289
32276
  country: country2,
32290
32277
  taskType,
32291
- isEmbeddedDropin,
32292
32278
  isExperimentEnabled
32293
32279
  }), [country2, data, taskType]);
32294
32280
  const customValidators = useMemo(() => isExperimentEnabled("EnableAgeVerification") ? validators({
@@ -33602,28 +33588,28 @@ const convertExistingTrustMemberToDefaultData = (trustMember, allowMoreRolesForM
33602
33588
  return convertExistingTrustMember(trustMember);
33603
33589
  };
33604
33590
  const TrustRoleAndEntityType = (props) => {
33605
- const {
33606
- existingTrustMember,
33607
- id: id2,
33608
- getLegalEntityHandler,
33609
- isOrganizationSettlorWithExemptionEnabled
33610
- } = props;
33591
+ var _a;
33611
33592
  const {
33612
33593
  i18n
33613
33594
  } = useI18nContext();
33595
+ const country2 = props.country;
33596
+ let mergedProps = props;
33597
+ mergedProps = mergeFieldMetadataIntoProps("legalCompanyName", resolveFieldMetadata(defaultFieldConfig$a[country2], {
33598
+ isBusiness: false
33599
+ }, defaultFieldMetadata$a), mergedProps);
33614
33600
  const {
33615
33601
  isExperimentEnabled
33616
33602
  } = useExperimentsContext();
33617
33603
  const allowMoreRolesForMainRootTrusteeEnabled = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
33618
- const defaultData = convertExistingTrustMemberToDefaultData(existingTrustMember, allowMoreRolesForMainRootTrusteeEnabled);
33619
- const formUtils = formUtilities(props, i18n);
33604
+ const defaultData = convertExistingTrustMemberToDefaultData(props.existingTrustMember, allowMoreRolesForMainRootTrusteeEnabled);
33605
+ const formUtils = formUtilities(mergedProps, i18n);
33620
33606
  const decideFields = (data2) => {
33621
- var _a, _b;
33622
- if ((_a = data2.role) == null ? void 0 : _a.includes("undefinedBeneficiary")) {
33607
+ var _a2, _b;
33608
+ if ((_a2 = data2.role) == null ? void 0 : _a2.includes("undefinedBeneficiary")) {
33623
33609
  return ["role", "descriptionUndefinedBeneficiary"];
33624
33610
  }
33625
33611
  if ((_b = data2.role) == null ? void 0 : _b.length) {
33626
- if (isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
33612
+ if (props.isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
33627
33613
  return ["role", "entityType", "settlorExemptionReason", "country", "legalCompanyName"];
33628
33614
  }
33629
33615
  if (couldBeExemptSettlor(data2)) {
@@ -33651,31 +33637,31 @@ const TrustRoleAndEntityType = (props) => {
33651
33637
  defaultData,
33652
33638
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
33653
33639
  });
33654
- const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && (existingTrustMember == null ? void 0 : existingTrustMember.trustMemberType) === "rootTrustee" ? getAvailableRolesByTrustMemberTypeAndLegalEntityType(data.role, existingTrustMember) : getAvailableRoles(data.role);
33640
+ const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && ((_a = props.existingTrustMember) == null ? void 0 : _a.trustMemberType) === "rootTrustee" ? getAvailableRolesByTrustMemberTypeAndLegalEntityType(data.role, props.existingTrustMember) : getAvailableRoles(data.role);
33655
33641
  useEffect(() => {
33656
33642
  (async () => {
33657
- var _a;
33658
- if (isOrganizationSettlorWithExemptionEnabled && existingTrustMember && existingTrustMember.trustMemberType === "exemptSettlor" && existingTrustMember.legalEntityId !== "isNewEntry" && existingTrustMember.roles !== void 0 && existingTrustMember.roles.length === 1 && existingTrustMember.roles[0] === "settlor" && getLegalEntityHandler) {
33659
- const response = await getLegalEntityHandler(existingTrustMember.legalEntityId);
33660
- const country2 = (_a = response == null ? void 0 : response.organization) == null ? void 0 : _a.registeredAddress.country;
33643
+ var _a2;
33644
+ if (props.isOrganizationSettlorWithExemptionEnabled && props.existingTrustMember && props.existingTrustMember.trustMemberType === "exemptSettlor" && props.existingTrustMember.legalEntityId !== "isNewEntry" && props.existingTrustMember.roles !== void 0 && props.existingTrustMember.roles.length === 1 && props.existingTrustMember.roles[0] === "settlor" && props.getLegalEntityHandler) {
33645
+ const response = await props.getLegalEntityHandler(props.existingTrustMember.legalEntityId);
33646
+ const country22 = (_a2 = response == null ? void 0 : response.organization) == null ? void 0 : _a2.registeredAddress.country;
33661
33647
  if (response && response.organization) {
33662
- handleChangeFor("country")(country2);
33648
+ handleChangeFor("country")(country22);
33663
33649
  }
33664
33650
  }
33665
33651
  })();
33666
33652
  }, []);
33667
33653
  useEffect(() => {
33668
- var _a;
33669
- (_a = props.onChange) == null ? void 0 : _a.call(props, {
33654
+ var _a2;
33655
+ (_a2 = props.onChange) == null ? void 0 : _a2.call(props, {
33670
33656
  schema,
33671
33657
  data,
33672
33658
  errors,
33673
33659
  valid,
33674
33660
  isValid,
33675
- dataStoreId: id2,
33661
+ dataStoreId: props.id,
33676
33662
  fieldProblems
33677
33663
  });
33678
- }, [schema, data, isValid, i18n, errors, valid, id2, fieldProblems]);
33664
+ }, [schema, data, isValid, i18n, errors, valid, props.id, fieldProblems]);
33679
33665
  const onInputDescription = (e) => {
33680
33666
  const {
33681
33667
  value
@@ -33691,9 +33677,9 @@ const TrustRoleAndEntityType = (props) => {
33691
33677
  }
33692
33678
  };
33693
33679
  const changeSettlorExemptionReasons = (exemptionReasons) => {
33694
- var _a;
33680
+ var _a2;
33695
33681
  if (exemptionReasons.includes("noneOfTheAbove")) {
33696
- handleChangeFor("settlorExemptionReason")(((_a = data.settlorExemptionReason) == null ? void 0 : _a.includes("noneOfTheAbove")) ? exemptionReasons.filter((reason) => reason !== "noneOfTheAbove") : ["noneOfTheAbove"]);
33682
+ handleChangeFor("settlorExemptionReason")(((_a2 = data.settlorExemptionReason) == null ? void 0 : _a2.includes("noneOfTheAbove")) ? exemptionReasons.filter((reason) => reason !== "noneOfTheAbove") : ["noneOfTheAbove"]);
33697
33683
  return;
33698
33684
  }
33699
33685
  handleChangeFor("settlorExemptionReason")(exemptionReasons);
@@ -33712,8 +33698,8 @@ const TrustRoleAndEntityType = (props) => {
33712
33698
  setErrors("lastName", errors2.lastName);
33713
33699
  };
33714
33700
  const onEntityTypeChange = (value) => {
33715
- var _a;
33716
- if (isOrganizationSettlorWithExemptionEnabled && value === LegalEntityType.ORGANIZATION && ((_a = data.role) == null ? void 0 : _a.length) === 1 && data.role[0] === "settlor") {
33701
+ var _a2;
33702
+ if (props.isOrganizationSettlorWithExemptionEnabled && value === LegalEntityType.ORGANIZATION && ((_a2 = data.role) == null ? void 0 : _a2.length) === 1 && data.role[0] === "settlor") {
33717
33703
  changeSettlorExemptionReasons(["professionalServiceProvider"]);
33718
33704
  }
33719
33705
  handleChangeFor("entityType")(value);
@@ -33751,7 +33737,7 @@ const TrustRoleAndEntityType = (props) => {
33751
33737
  errorMessage: formUtils.getErrorMessage("entityType", errors, fieldProblems),
33752
33738
  label: formUtils.getLabel("entityType", "whatTypeOfYourMembersEntity"),
33753
33739
  classNameModifiers: ["entityType"],
33754
- disabled: Boolean(existingTrustMember),
33740
+ disabled: Boolean(props.existingTrustMember),
33755
33741
  children: (childProps) => jsx(RadioCardSelect, {
33756
33742
  ...childProps,
33757
33743
  options: trustMemberLegalEntityTypes,
@@ -33811,8 +33797,8 @@ const TrustRoleAndEntityType = (props) => {
33811
33797
  enterLastNameExactlyAsAppearInID: "enterSettlorsLastNameExactlyAsItAppearsInID"
33812
33798
  },
33813
33799
  onChange: onNameChange,
33814
- dataStoreId: id2
33815
- }) : void 0, isOrganizationSettlorWithExemptionEnabled && (schema == null ? void 0 : schema.includes("country")) && (schema == null ? void 0 : schema.includes("legalCompanyName")) ? jsxs(Fragment, {
33800
+ dataStoreId: props.id
33801
+ }) : void 0, props.isOrganizationSettlorWithExemptionEnabled && (schema == null ? void 0 : schema.includes("country")) && (schema == null ? void 0 : schema.includes("legalCompanyName")) ? jsxs(Fragment, {
33816
33802
  children: [jsx(CountryField, {
33817
33803
  data: formUtils.getFieldData(data, COUNTRY_FIELD),
33818
33804
  valid: formUtils.getFieldValid(valid, COUNTRY_FIELD),
@@ -33951,7 +33937,8 @@ function RoleAndTypeDropinComponent({
33951
33937
  navigateBack,
33952
33938
  addOrUpdateTrustMember,
33953
33939
  getLegalEntityHandler,
33954
- isOrganizationSettlorWithExemptionEnabled
33940
+ isOrganizationSettlorWithExemptionEnabled,
33941
+ country: country2
33955
33942
  }) {
33956
33943
  var _a, _b;
33957
33944
  const {
@@ -34044,7 +34031,8 @@ function RoleAndTypeDropinComponent({
34044
34031
  onChange: onTrustMemberChange,
34045
34032
  shouldValidate,
34046
34033
  getLegalEntityHandler,
34047
- isOrganizationSettlorWithExemptionEnabled
34034
+ isOrganizationSettlorWithExemptionEnabled,
34035
+ country: country2
34048
34036
  })
34049
34037
  }), isSummaryStep && jsx("div", {
34050
34038
  className: "adyen-kyc-form-wrapper",
@@ -36237,7 +36225,7 @@ const createLegalEntity = async (context, legalEntity) => {
36237
36225
  loadingContext,
36238
36226
  errorLevel: "warn",
36239
36227
  errorMessage: "LegalEntity create failed",
36240
- path: `${legalEntityId}`,
36228
+ path: `${legalEntityId}/create`,
36241
36229
  authentication: "jwt",
36242
36230
  headers: {
36243
36231
  "Content-Type": "application/json"
@@ -36324,16 +36312,17 @@ const getDocument = async (context, documentId) => {
36324
36312
  }
36325
36313
  });
36326
36314
  };
36327
- const getLegalEntity = async (context) => {
36315
+ const getLegalEntity = async (context, legalEntityId) => {
36328
36316
  const {
36329
36317
  loadingContext,
36330
- legalEntityId
36318
+ legalEntityId: rootLegalEntityId
36331
36319
  } = context;
36320
+ const path = legalEntityId !== rootLegalEntityId ? `${rootLegalEntityId}/${legalEntityId}` : `${rootLegalEntityId}`;
36332
36321
  return httpGet({
36333
36322
  loadingContext,
36334
36323
  errorLevel: "warn",
36335
36324
  errorMessage: `LegalEntity not available`,
36336
- path: `${legalEntityId}`,
36325
+ path,
36337
36326
  authentication: "jwt",
36338
36327
  headers: {
36339
36328
  "Content-Type": "application/json"
@@ -36432,16 +36421,17 @@ const updateDocument = async (context, document2, documentId, ownerId) => {
36432
36421
  }
36433
36422
  }, document2);
36434
36423
  };
36435
- const updateLegalEntity = async (context, legalEntity) => {
36424
+ const updateLegalEntity = async (context, legalEntity, legalEntityId) => {
36436
36425
  const {
36437
36426
  loadingContext,
36438
- legalEntityId
36427
+ legalEntityId: rootLegalEntityId
36439
36428
  } = context;
36429
+ const path = legalEntityId !== rootLegalEntityId ? `${rootLegalEntityId}/${legalEntityId}` : `${rootLegalEntityId}`;
36440
36430
  return httpPost({
36441
36431
  loadingContext,
36442
36432
  errorLevel: "warn",
36443
36433
  errorMessage: `LegalEntity update failed`,
36444
- path: `${legalEntityId}`,
36434
+ path,
36445
36435
  authentication: "jwt",
36446
36436
  headers: {
36447
36437
  "Content-Type": "application/json"
@@ -36783,14 +36773,8 @@ const useComponentApi = (rootLegalEntityId) => {
36783
36773
  legalEntityId: rootLegalEntityId
36784
36774
  };
36785
36775
  return {
36786
- getLegalEntity: async (legalEntityId) => getLegalEntity({
36787
- ...baseRequestContext,
36788
- legalEntityId
36789
- }),
36790
- updateLegalEntity: async (legalEntity, legalEntityId) => updateLegalEntity({
36791
- ...baseRequestContext,
36792
- legalEntityId
36793
- }, legalEntity),
36776
+ getLegalEntity: async (legalEntityId) => getLegalEntity(baseRequestContext, legalEntityId),
36777
+ updateLegalEntity: async (legalEntity, legalEntityId) => updateLegalEntity(baseRequestContext, legalEntity, legalEntityId),
36794
36778
  createLegalEntity: async (legalEntity) => createLegalEntity(baseRequestContext, legalEntity),
36795
36779
  getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
36796
36780
  getBankVerificationVendor: async (country2, openBankingPartnerConfigId) => getBankVerificationVendor(baseRequestContext, country2, openBankingPartnerConfigId),
@@ -38641,7 +38625,7 @@ const ConfigurationApiProvider = ({
38641
38625
  isEmbeddedDropin,
38642
38626
  loadingContext
38643
38627
  } = authContext;
38644
- const sdkVersion = "3.20.0";
38628
+ const sdkVersion = "3.20.2";
38645
38629
  useAnalytics({
38646
38630
  onUserEvent,
38647
38631
  legalEntityId: rootLegalEntityId,
@@ -1,2 +1,2 @@
1
1
  import type { RoleAndTypeDropinProps } from '../types';
2
- export declare function RoleAndTypeDropinComponent({ existingTrustMember, navigateToFullDropinFor, navigateBack, addOrUpdateTrustMember, getLegalEntityHandler, isOrganizationSettlorWithExemptionEnabled, }: RoleAndTypeDropinProps): import("preact").JSX.Element;
2
+ export declare function RoleAndTypeDropinComponent({ existingTrustMember, navigateToFullDropinFor, navigateBack, addOrUpdateTrustMember, getLegalEntityHandler, isOrganizationSettlorWithExemptionEnabled, country, }: RoleAndTypeDropinProps): import("preact").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { ExistingLegalEntity } from '../../../core/models/api/legal-entity';
2
+ import type { CountryCode } from '../../../core/models/country-code';
2
3
  import type { CompanyTrustMember, RegularTrustMember, TrustMember } from '../../TrustMembers/types';
3
4
  import type { TrustRoleAndEntityTypeSchema } from '../../TrustRoleAndEntityType/types';
4
5
  export interface RoleAndTypeDropinProps {
@@ -8,6 +9,7 @@ export interface RoleAndTypeDropinProps {
8
9
  addOrUpdateTrustMember: (newOrUpdated: TrustMember) => void;
9
10
  getLegalEntityHandler?(legalEntityId: string): Promise<ExistingLegalEntity>;
10
11
  isOrganizationSettlorWithExemptionEnabled?: boolean;
12
+ country?: CountryCode;
11
13
  }
12
14
  export interface TrustMemberSchema {
13
15
  roleAndEntityType: TrustRoleAndEntityTypeSchema;
@@ -26,6 +26,7 @@ export interface TrustRoleAndEntityTypeProps extends BaseInnerFormProps<TrustRol
26
26
  existingTrustMember?: TrustMember;
27
27
  getLegalEntityHandler?(legalEntityId: string): Promise<ExistingLegalEntity>;
28
28
  isOrganizationSettlorWithExemptionEnabled?: boolean;
29
+ country?: CountryCode;
29
30
  }
30
31
  export declare const couldBeExemptSettlor: (data: TrustRoleAndEntityTypeSchema) => boolean;
31
32
  export declare const isExemptSettlor: (data: TrustRoleAndEntityTypeSchema) => data is TrustRoleAndEntityTypeSchema & {
@@ -0,0 +1,9 @@
1
+ import type { FieldMetadata } from '../../../core/models/country-config';
2
+ import type { PerCountryFieldConfig } from '../../../core/models/field-configurations';
3
+ import type { LegalCompanyNameFieldSchema } from './types';
4
+ interface FieldConfigParams {
5
+ isBusiness?: boolean;
6
+ }
7
+ export declare const defaultFieldMetadata: FieldMetadata<LegalCompanyNameFieldSchema, 'legalCompanyName'>;
8
+ export declare const defaultFieldConfig: PerCountryFieldConfig<LegalCompanyNameFieldSchema, 'legalCompanyName', FieldConfigParams>;
9
+ export {};
@@ -1,3 +1,3 @@
1
- import type { ExistingLegalEntity } from '../../models/api/legal-entity';
1
+ import type { ExistingLegalEntity, LegalEntity } from '../../models/api/legal-entity';
2
2
  import type { ComponentApiRequestContext } from '../types';
3
- export declare const getLegalEntity: (context: ComponentApiRequestContext) => Promise<ExistingLegalEntity>;
3
+ export declare const getLegalEntity: (context: ComponentApiRequestContext, legalEntityId: LegalEntity["id"]) => Promise<ExistingLegalEntity>;
@@ -1,3 +1,3 @@
1
1
  import type { ExistingLegalEntity, LegalEntity } from '../../models/api/legal-entity';
2
2
  import type { ComponentApiRequestContext } from '../types';
3
- export declare const updateLegalEntity: (context: ComponentApiRequestContext, legalEntity: LegalEntity) => Promise<ExistingLegalEntity>;
3
+ export declare const updateLegalEntity: (context: ComponentApiRequestContext, legalEntity: LegalEntity, legalEntityId: LegalEntity["id"]) => Promise<ExistingLegalEntity>;
@@ -141,4 +141,5 @@ export interface BaseInnerFormProps<FormSchema> extends BaseFormProps<FormSchema
141
141
  id?: string;
142
142
  dataStoreId?: string;
143
143
  capabilities?: CapabilityName[];
144
+ isTopLevelEntity?: boolean;
144
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.20.0",
3
+ "version": "3.20.2",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -1,3 +0,0 @@
1
- import type { ValidatorRules } from '../../../utils/validation/types';
2
- import type { LegalCompanyNameFieldSchema } from './types';
3
- export declare const LegalCompanyNameFieldValidation: () => ValidatorRules<LegalCompanyNameFieldSchema>;
@@ -1,3 +0,0 @@
1
- import type { ValidatorRules } from '../../../utils/validation/types';
2
- import type { StateFieldSchema } from './types';
3
- export declare const StateFieldValidation: () => ValidatorRules<StateFieldSchema>;