@adyen/kyc-components 3.27.1 → 3.28.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.
Files changed (46) hide show
  1. package/dist/es/adyen-kyc-components.es.js +846 -590
  2. package/dist/es/circle-F380_Tya.js +8 -0
  3. package/dist/style.css +55 -33
  4. package/dist/types/components/AdditionalInformation/component/AdditionalInformationComponent.d.ts +2 -2
  5. package/dist/types/components/AdditionalInformation/types.d.ts +5 -1
  6. package/dist/types/components/BasicInformation/component/BasicInformationComponent.d.ts +1 -1
  7. package/dist/types/components/BasicInformation/types.d.ts +4 -4
  8. package/dist/types/components/BusinessDetails/forms.d.ts +0 -6
  9. package/dist/types/components/BusinessDetails/types.d.ts +4 -6
  10. package/dist/types/components/BusinessSelection/BusinessInformationCard.d.ts +4 -3
  11. package/dist/types/components/BusinessSelection/component/BusinessSelectionComponent.d.ts +1 -1
  12. package/dist/types/components/BusinessSelection/types.d.ts +4 -4
  13. package/dist/types/components/DecisionMakers/component/DecisionMakersComponent.d.ts +1 -1
  14. package/dist/types/components/DecisionMakers/types.d.ts +2 -2
  15. package/dist/types/components/Dropins/BusinessDetailsDropin/components/BusinessDetailsDropinComponent.d.ts +1 -1
  16. package/dist/types/components/Dropins/BusinessDetailsDropin/types.d.ts +2 -2
  17. package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +2 -3
  18. package/dist/types/components/Dropins/CompanyDropin/types.d.ts +0 -2
  19. package/dist/types/components/Dropins/CompanySearchDropin/components/CompanySearchDropinComponent.d.ts +1 -1
  20. package/dist/types/components/Dropins/CompanySearchDropin/types.d.ts +0 -2
  21. package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +1 -5
  22. package/dist/types/components/Dropins/HighExposureDropin/utils.d.ts +2 -0
  23. package/dist/types/components/Dropins/HighExposureDropin/validate.d.ts +3 -1
  24. package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
  25. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/components/ServiceAgreementDropinComponent.d.ts +1 -1
  26. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/types.d.ts +3 -0
  27. package/dist/types/components/EmbeddedDropins/CreateContractingComponent/CreateContractingComponent.d.ts +2 -1
  28. package/dist/types/components/Individual/types.d.ts +3 -0
  29. package/dist/types/components/PersonalDetails/types.d.ts +2 -1
  30. package/dist/types/components/StepProgressIndicator/StepProgressIndicator.d.ts +2 -1
  31. package/dist/types/components/internal/Address/types.d.ts +4 -0
  32. package/dist/types/components/internal/Address/utils.d.ts +5 -5
  33. package/dist/types/components/internal/DecisionMakerRole/types.d.ts +2 -0
  34. package/dist/types/components/internal/EntityGuidanceStatus/types.d.ts +1 -1
  35. package/dist/types/components/internal/Modal/Modal.d.ts +1 -1
  36. package/dist/types/components/internal/Svg/svgs.d.ts +2 -1
  37. package/dist/types/core/hooks/singpass/useSingpassMyInfoLogin.d.ts +3 -0
  38. package/dist/types/core/hooks/useBusinessData/types.d.ts +4 -4
  39. package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +3 -1
  40. package/dist/types/utils/entity-status-util.d.ts +12 -1
  41. package/dist/types/utils/mapping/componentApiMapping.d.ts +12 -16
  42. package/package.json +1 -1
  43. package/dist/es/cross-circle-fill-BafKD3Av.js +0 -8
  44. package/dist/types/components/Company/trusted-fields.d.ts +0 -7
  45. package/dist/types/components/internal/EntityGuidanceStatus/component/EntityGuidanceLegend.d.ts +0 -3
  46. package/dist/types/components/internal/EntityGuidanceStatus/index.d.ts +0 -3
@@ -132,6 +132,7 @@ const defaultTrans = {
132
132
  annualTurnoverHelper: "The annual sales revenue minus all discounts and sales taxes. Also known as net sales.",
133
133
  annualTurnoverValue: "Annual turnover value",
134
134
  apartmentSuite: "Apartment / Suite",
135
+ apartmentSuiteOther: "Apt, suite, other",
135
136
  apartmentSuiteOptional: "Apartment / Suite (optional)",
136
137
  areYouACompany: "Are you a company?",
137
138
  areYouAnIndividual: "Are you an individual?",
@@ -215,6 +216,7 @@ const defaultTrans = {
215
216
  businessSelection__footerButton: "Add details manually",
216
217
  businessSelection__heading: "Select your business",
217
218
  businessSelection__invalidTin: "This company's TIN doesn't match yours",
219
+ businessSelection__tinVerificationFailure: "Sorry, something went wrong. Try again or continue by pressing Add details manually",
218
220
  businessStructure: "Business structure",
219
221
  businessTrust: "Business trust",
220
222
  businessTrusteeDetails: "Business trustee details",
@@ -320,6 +322,7 @@ const defaultTrans = {
320
322
  currencyCode: "Currency code",
321
323
  currencyPlaceholder: "Select a currency code",
322
324
  cyRegistrationNumber: "Αριθμός Εγγραφής",
325
+ dateCannotBeInTheFuture: "Date cannot be in the future",
323
326
  dateDeedWasSigned: "Date deed was signed",
324
327
  dateOfIncorporation: "Date of incorporation",
325
328
  dateOnDocumentNoOlderThanXMonths: "Date on the document is no older than %{numberOfMonths} months",
@@ -962,6 +965,7 @@ const defaultTrans = {
962
965
  no: "No",
963
966
  noGlare: "No glare",
964
967
  noGoBack: "No, go back",
968
+ noIdontKnow: "No / I don't know",
965
969
  noOptionsFound: "No options found",
966
970
  nonProfitOrCharitableOrgDescription: "Your organization has official non-profit or tax-exempt status.",
967
971
  nonProfitOrCharitableOrgTitle: "Non-profit or charitable organization",
@@ -1005,7 +1009,7 @@ const defaultTrans = {
1005
1009
  orSoleProprietorshipName: "or sole proprietorship's name",
1006
1010
  organisasjonsnummer: "Organisasjonsnummer",
1007
1011
  organisationsnummer: "Organisationsnummer",
1008
- otherAddressInformation: "Other address information (optional)",
1012
+ otherAddressInformation: "Other address information",
1009
1013
  otherBusinessInformation: "Other business information",
1010
1014
  otherInformation: "Other information",
1011
1015
  otherLegalMeasures: "Yes, the company is facing other legal measures",
@@ -1056,12 +1060,16 @@ const defaultTrans = {
1056
1060
  phoneNumber: "Phone number",
1057
1061
  pleaseEnsureTheFollowing: "Please ensure the following section is fulfilled to complete the review of your data.",
1058
1062
  pleaseEnterAPhoneNumberPrefixedWithCountryCode: "Please enter a phone number prefixed with a country code e.g. %{defaultPrefix}.",
1063
+ pleaseEnterAValidNumber: "Please enter a valid number.",
1064
+ pleaseEnterAValidWholeNumber: "Please enter a valid whole number.",
1059
1065
  pleaseNote: "Please note:",
1060
1066
  pleaseProvideThePurposeOfCharitableTrust: "Please provide the purpose of your charitable trust",
1061
1067
  pooledSuperannuationTrust: "Pooled superannuation trust",
1062
1068
  postalCode: "Postal code",
1063
1069
  poweredBy: "Powered by",
1064
1070
  previous: "Previous",
1071
+ principalPlaceOfBusiness: "Principal place of business",
1072
+ principalPlaceOfBusinessDescription: "The physical location where a business's key officers oversee and manage its operations: this is usually the main office or headquarters.",
1065
1073
  privateCompanyDescription: "Your company is owned privately and not traded on a public stock exchange. ",
1066
1074
  privateCompanyTitle: "Private company",
1067
1075
  processing: "Processing",
@@ -1108,6 +1116,8 @@ const defaultTrans = {
1108
1116
  registeredAddressHeaderDescription__PR: "Your address as it appears on your Department of State Registration.",
1109
1117
  registeredAddressHeaderDescription__US: "Your address as it appears on your Secretary of State Registration.",
1110
1118
  registeredAddressTrustHeaderDescription: "The address registered to your trust",
1119
+ registeredBusinessAddress: "Registered business address",
1120
+ registeredBusinessAddressDescription: "Your business's official address used for government and other legal purposes.",
1111
1121
  registrationAddress: "Registration address",
1112
1122
  registrationDetails: "Registration details",
1113
1123
  registrationDocument: "Registration document",
@@ -1191,6 +1201,7 @@ const defaultTrans = {
1191
1201
  routingNumber: "Routing number",
1192
1202
  routingNumberVisible: "Includes your routing number",
1193
1203
  salarySlip: "Salary slip",
1204
+ sameAsRegisteredAddress: "Same as registered business address",
1194
1205
  sameNameAsLegalName: "Same as legal name of the company",
1195
1206
  "save&Leave": "Save & leave",
1196
1207
  saveAndGoToOverview: "Save and go to overview",
@@ -1230,6 +1241,7 @@ const defaultTrans = {
1230
1241
  siRegistrationNumber: "Matična številka",
1231
1242
  siTaxId: "Identifikacijska številka za DDV (ID za DDV)",
1232
1243
  sign: "Sign",
1244
+ signAndContinue: "Sign and continue",
1233
1245
  signServiceAgreement: "Sign services agreement",
1234
1246
  signatory: "Signatory",
1235
1247
  signatoryDescription: "Authorized to sign contracts on behalf of the company",
@@ -1448,6 +1460,7 @@ const defaultTrans = {
1448
1460
  xCharactersLeft: "%{charactersLeft} characters left",
1449
1461
  xMinutes: "%{minutes} minutes",
1450
1462
  xMinutesAndYSeconds: "%{minutes} and %{seconds}",
1463
+ XOfYSteps: "%{currentStep} of %{totalSteps} ",
1451
1464
  xSeconds: "%{seconds} seconds",
1452
1465
  yes: "Yes",
1453
1466
  yesChange: "Yes, change",
@@ -1670,6 +1683,12 @@ function useToastContext() {
1670
1683
  }
1671
1684
  return context;
1672
1685
  }
1686
+ const CoreContext = createContext(void 0);
1687
+ const useCoreContext = () => {
1688
+ const context = useContext(CoreContext);
1689
+ if (!context) throw Error("You need a <CoreProvider> to use core context");
1690
+ return context;
1691
+ };
1673
1692
  let suppressed = false;
1674
1693
  const consoleMethodsPrefixable = Object.freeze(["debug", "info", "log", "warn", "error", "trace"]);
1675
1694
  const stringSubstitutionRegex = /%([soOc]|(\.\d)?[dif])/;
@@ -2024,10 +2043,10 @@ function useBusinessData({
2024
2043
  handleVerifyTin,
2025
2044
  handleClearCompanyData
2026
2045
  }) {
2027
- const [isSearching, setIsSearching] = useState("idle");
2028
- const [isFetching, setIsFetching] = useState("idle");
2029
- const [isVerifying, setIsVerifying] = useState("idle");
2030
- const [isClearingTrustedData, setIsClearingTrustedData] = useState("idle");
2046
+ const [searching, setSearching] = useState("idle");
2047
+ const [fetching, setFetching] = useState("idle");
2048
+ const [verifying, setVerifying] = useState("idle");
2049
+ const [resettingTrustedData, setResettingTrustedData] = useState("idle");
2031
2050
  const [searchResults, setSearchResults] = useState();
2032
2051
  const [cachedSearch, setCachedSearch] = useState();
2033
2052
  const [cachedBusiness, setCachedBusiness] = useState();
@@ -2040,7 +2059,7 @@ function useBusinessData({
2040
2059
  }
2041
2060
  if (searchResults && objectsDeepEqual(cachedSearch, data)) return;
2042
2061
  try {
2043
- setIsSearching("loading");
2062
+ setSearching("loading");
2044
2063
  const {
2045
2064
  results
2046
2065
  } = KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await handleCompanyIndexSearch({
@@ -2053,11 +2072,11 @@ function useBusinessData({
2053
2072
  setSearchResults(results);
2054
2073
  return results;
2055
2074
  } catch (e) {
2056
- setIsSearching("error");
2075
+ setSearching("error");
2057
2076
  logger$I.error(e);
2058
2077
  } finally {
2059
2078
  setCachedSearch(data);
2060
- setIsSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
2079
+ setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
2061
2080
  }
2062
2081
  }, [handleCompanyDeepSearch, handleCompanyIndexSearch, searchResults, cachedSearch]);
2063
2082
  const fetchBusinessData = useCallback(async (company) => {
@@ -2075,7 +2094,8 @@ function useBusinessData({
2075
2094
  const date = (/* @__PURE__ */ new Date()).toDateString();
2076
2095
  const isDataCompliant = company.lastUpdate ? Date.parse(date) - Date.parse(company.lastUpdate) < LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW : false;
2077
2096
  try {
2078
- setIsFetching("loading");
2097
+ setFetching("loading");
2098
+ setVerifying("idle");
2079
2099
  setInvalidTin(false);
2080
2100
  const businessData = isDataCompliant ? await handleGetCompanyDataset({
2081
2101
  companyId: company.id,
@@ -2087,11 +2107,11 @@ function useBusinessData({
2087
2107
  setCachedBusiness(businessData);
2088
2108
  return businessData;
2089
2109
  } catch (e) {
2090
- setIsFetching("error");
2110
+ setFetching("error");
2091
2111
  setCachedBusiness(void 0);
2092
2112
  logger$I.error(e);
2093
2113
  } finally {
2094
- setIsFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
2114
+ setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
2095
2115
  }
2096
2116
  }, [cachedBusiness, handleGetCompanyDataset, handleRefreshCompanyDataset]);
2097
2117
  const verifyBusinessData = useCallback(async (data, tin) => {
@@ -2100,7 +2120,7 @@ function useBusinessData({
2100
2120
  return;
2101
2121
  }
2102
2122
  try {
2103
- setIsVerifying("loading");
2123
+ setVerifying("loading");
2104
2124
  setVerifiedBusiness(void 0);
2105
2125
  setInvalidTin(false);
2106
2126
  const {
@@ -2116,21 +2136,21 @@ function useBusinessData({
2116
2136
  }
2117
2137
  return matched;
2118
2138
  } catch (e) {
2119
- setIsVerifying("error");
2139
+ setVerifying("error");
2120
2140
  logger$I.error(e);
2121
2141
  } finally {
2122
- setIsVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
2142
+ setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
2123
2143
  }
2124
2144
  }, [handleVerifyTin]);
2125
2145
  const clearTrustedBusinessData = useCallback(async () => {
2126
2146
  try {
2127
- setIsClearingTrustedData("loading");
2147
+ setResettingTrustedData("loading");
2128
2148
  await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
2129
2149
  } catch (e) {
2130
- setIsClearingTrustedData("error");
2150
+ setResettingTrustedData("error");
2131
2151
  logger$I.error(e);
2132
2152
  } finally {
2133
- setIsClearingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
2153
+ setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
2134
2154
  }
2135
2155
  }, [handleClearCompanyData]);
2136
2156
  const resetBusinessData = () => {
@@ -2149,10 +2169,10 @@ function useBusinessData({
2149
2169
  resetBusinessData,
2150
2170
  resetTinVerification,
2151
2171
  // Data
2152
- isSearching,
2153
- isFetching,
2154
- isVerifying,
2155
- isClearingTrustedData,
2172
+ searching,
2173
+ fetching,
2174
+ verifying,
2175
+ resettingTrustedData,
2156
2176
  currentSearchName: cachedSearch == null ? void 0 : cachedSearch.text,
2157
2177
  searchResults,
2158
2178
  verifiedBusiness,
@@ -2404,11 +2424,13 @@ const svgs = {
2404
2424
  bin: lazy(() => import("./bin-D7a-dmmy.js")),
2405
2425
  check: lazy(() => import("./checkmark-DS0ypPvH.js")),
2406
2426
  checkmark: lazy(() => import("./checkmark-circle-fill-hZq1T5e9.js")),
2427
+ "checkmark-circle-fill": lazy(() => import("./checkmark-circle-fill-hZq1T5e9.js")),
2407
2428
  "checkmark-small": lazy(() => import("./checkmark-small-4ciES6ZR.js")),
2408
2429
  "chevron-down": lazy(() => import("./chevron-down-CSdvSDZq.js")),
2409
2430
  "chevron-right": lazy(() => import("./chevron-right-B5NJn8is.js")),
2410
2431
  "chevron-left": lazy(() => import("./chevron-left-Ctf1pv5s.js")),
2411
2432
  "chevron-up": lazy(() => import("./chevron-up-CXPd5NYI.js")),
2433
+ circle: lazy(() => import("./circle-F380_Tya.js")),
2412
2434
  company: lazy(() => import("./headquarter-BVHLaPzn.js")),
2413
2435
  "company-2": lazy(() => import("./hotel-DLFFe_Ls.js")),
2414
2436
  contract: lazy(() => import("./contract-DFZ6WwMd.js")),
@@ -2439,7 +2461,6 @@ const svgs = {
2439
2461
  upload: lazy(() => import("./upload-XwV0PfcC.js")),
2440
2462
  "users-3": lazy(() => import("./4-people-BTQ6Okmp.js")),
2441
2463
  warning: lazy(() => import("./warning-filled-Od0v7tGX.js")),
2442
- wrong: lazy(() => import("./cross-circle-fill-BafKD3Av.js")),
2443
2464
  // images
2444
2465
  "document-blurred": lazy(() => import("./document-blurred-gtj03M4x.js")),
2445
2466
  "document-cutoff": lazy(() => import("./document-cut-off-D2vCeeIS.js")),
@@ -2469,7 +2490,7 @@ const svgs = {
2469
2490
  "plaid-logo": lazy(() => import("./plaid-logo-4nYeR9iX.js")),
2470
2491
  "trustly-logo": lazy(() => import("./trustly-logo-YJslAOYF.js"))
2471
2492
  };
2472
- const unscalableIconNames = ["arrow-left", "arrow-right", "bank", "bin", "check", "checkmark", "checkmark-small", "chevron-down", "chevron-right", "chevron-left", "chevron-up", "company", "company-2", "contract", "cross", "decision-maker", "document", "download", "edit", "info-circle", "field-error", "image", "light-bulb", "location", "more-horiz", "new-document", "payout", "pci", "plus", "plus-small", "remove", "save", "search", "store", "trust", "user", "user-business", "upload", "users-3", "warning", "wrong"];
2493
+ const unscalableIconNames = ["bin", "check", "checkmark", "checkmark-small", "chevron-right", "chevron-left", "company", "contract", "cross", "decision-maker", "document", "download", "edit", "info-circle", "image", "location", "payout", "pci", "plus", "remove", "save", "search", "trust", "user", "upload", "warning"];
2473
2494
  const logger$H = createLogger("Icon");
2474
2495
  const Svg = ({
2475
2496
  className,
@@ -2485,7 +2506,7 @@ const Svg = ({
2485
2506
  return null;
2486
2507
  }
2487
2508
  return jsx("span", {
2488
- className: cx(`adyen-kyc-${type} adyen-kyc-${type}-${name}`, className),
2509
+ className: cx(`adyen-kyc-${type}`, className),
2489
2510
  "data-testid": testId,
2490
2511
  children: jsx(Suspense, {
2491
2512
  fallback: null,
@@ -2768,15 +2789,6 @@ function useFormRouterContext() {
2768
2789
  return context;
2769
2790
  }
2770
2791
  const logger$G = createLogger("Link");
2771
- const getIconClass = (icon, external) => {
2772
- if (external) {
2773
- return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
2774
- }
2775
- if (icon) {
2776
- return `adyen-kyc-link__icon`;
2777
- }
2778
- return null;
2779
- };
2780
2792
  const isValidLink = (href) => {
2781
2793
  if (href === "#") {
2782
2794
  logger$G.error('Links must include a valid href. If your href is "#", consider using a Button instead');
@@ -2797,7 +2809,6 @@ const Link = ({
2797
2809
  const target = external ? "_blank" : "_self";
2798
2810
  const rel = external ? "external noopener noreferrer" : void 0;
2799
2811
  const showIcon = icon || external;
2800
- const iconClass = showIcon && getIconClass(icon, external);
2801
2812
  const classNames = showAsButton ? cx("adyen-kyc-button", className, {
2802
2813
  "adyen-kyc-button--icon": showIcon
2803
2814
  }) : cx("adyen-kyc-link", className, {
@@ -2812,9 +2823,9 @@ const Link = ({
2812
2823
  children: [jsx("span", {
2813
2824
  className: "adyen-kyc-link__text adyen-kyc-link--inherit",
2814
2825
  children
2815
- }), showIcon && icon && iconClass && jsx(Icon, {
2826
+ }), showIcon && icon && jsx(Icon, {
2816
2827
  name: icon,
2817
- className: iconClass
2828
+ className: "adyen-kyc-link__icon"
2818
2829
  })]
2819
2830
  });
2820
2831
  };
@@ -2919,7 +2930,7 @@ function getFormProps(props, innerFormId) {
2919
2930
  return null;
2920
2931
  }
2921
2932
  const activeFormId = (_a = props.activeForm) == null ? void 0 : _a.formId;
2922
- const trustedFields2 = ((_b = props.trustedFields) == null ? void 0 : _b[innerFormId]) ?? [];
2933
+ const trustedFields = ((_b = props.trustedFields) == null ? void 0 : _b[innerFormId]) ?? [];
2923
2934
  const readOnlyFields = ((_c = props.readOnlyFields) == null ? void 0 : _c[innerFormId]) ?? [];
2924
2935
  return {
2925
2936
  placeholders: ((_d = props.placeholders) == null ? void 0 : _d[innerFormId]) ?? {},
@@ -2928,12 +2939,12 @@ function getFormProps(props, innerFormId) {
2928
2939
  masks: ((_g = props.masks) == null ? void 0 : _g[innerFormId]) ?? {},
2929
2940
  data: ((_h = props.data) == null ? void 0 : _h[innerFormId]) ?? {},
2930
2941
  allFields: ((_i = props.allFields) == null ? void 0 : _i[innerFormId]) ?? [],
2931
- readOnlyFields: [...readOnlyFields, ...trustedFields2],
2942
+ readOnlyFields: [...readOnlyFields, ...trustedFields],
2932
2943
  requiredFields: ((_j = props.requiredFields) == null ? void 0 : _j[innerFormId]) ?? [],
2933
2944
  optionalFields: ((_k = props.optionalFields) == null ? void 0 : _k[innerFormId]) ?? [],
2934
2945
  obscuredFields: ((_l = props.obscuredFields) == null ? void 0 : _l[innerFormId]) ?? [],
2935
2946
  verifyFields: ((_m = props.verifyFields) == null ? void 0 : _m[innerFormId]) ?? [],
2936
- trustedFields: trustedFields2,
2947
+ trustedFields,
2937
2948
  trustedFieldsProvider: props.trustedFields,
2938
2949
  formVerificationErrors: ((_o = (_n = props.problems) == null ? void 0 : _n.verificationErrors) == null ? void 0 : _o[innerFormId]) ?? {},
2939
2950
  fieldValidationErrors: ((_q = (_p = props.problems) == null ? void 0 : _p.validationErrors) == null ? void 0 : _q[innerFormId]) ?? {},
@@ -2969,7 +2980,7 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
2969
2980
  optionalFields,
2970
2981
  obscuredFields,
2971
2982
  verifyFields,
2972
- trustedFields: trustedFields2,
2983
+ trustedFields,
2973
2984
  problems,
2974
2985
  validators: validators2,
2975
2986
  shouldValidate
@@ -2986,7 +2997,7 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
2986
2997
  optionalFields,
2987
2998
  obscuredFields,
2988
2999
  verifyFields,
2989
- trustedFields: trustedFields2,
3000
+ trustedFields,
2990
3001
  // the rest we just pass along for now, as they will be eventually be processed by getFormProps
2991
3002
  problems,
2992
3003
  validators: validators2,
@@ -3196,7 +3207,7 @@ function init({
3196
3207
  fieldProblems,
3197
3208
  obscuredFields,
3198
3209
  optionalFields,
3199
- trustedFields: trustedFields2,
3210
+ trustedFields,
3200
3211
  formatters,
3201
3212
  staticValidate,
3202
3213
  asyncValidate
@@ -3213,7 +3224,7 @@ function init({
3213
3224
  data: defaultData,
3214
3225
  obscuredFields,
3215
3226
  optionalFields,
3216
- trustedFields: trustedFields2
3227
+ trustedFields
3217
3228
  }
3218
3229
  },
3219
3230
  staticValidate,
@@ -3269,7 +3280,7 @@ function init({
3269
3280
  fieldProblems: {},
3270
3281
  obscuredFields,
3271
3282
  optionalFields,
3272
- trustedFields: trustedFields2
3283
+ trustedFields
3273
3284
  });
3274
3285
  return formData;
3275
3286
  }
@@ -3278,7 +3289,7 @@ function reducer({
3278
3289
  asyncValidate,
3279
3290
  obscuredFields,
3280
3291
  optionalFields,
3281
- trustedFields: trustedFields2,
3292
+ trustedFields,
3282
3293
  formatters
3283
3294
  }) {
3284
3295
  return (state, {
@@ -3350,7 +3361,7 @@ function reducer({
3350
3361
  fieldProblems,
3351
3362
  obscuredFields,
3352
3363
  optionalFields,
3353
- trustedFields: trustedFields2,
3364
+ trustedFields,
3354
3365
  staticValidate,
3355
3366
  asyncValidate
3356
3367
  });
@@ -3384,7 +3395,7 @@ function reducer({
3384
3395
  fieldProblems: updatedFieldProblems,
3385
3396
  obscuredFields,
3386
3397
  optionalFields,
3387
- trustedFields: trustedFields2,
3398
+ trustedFields,
3388
3399
  local
3389
3400
  };
3390
3401
  }
@@ -3578,7 +3589,7 @@ function useForm({
3578
3589
  fieldProblems,
3579
3590
  obscuredFields,
3580
3591
  optionalFields,
3581
- trustedFields: trustedFields2,
3592
+ trustedFields,
3582
3593
  formatters,
3583
3594
  shouldValidate = false
3584
3595
  }) {
@@ -3596,20 +3607,20 @@ function useForm({
3596
3607
  asyncValidate: triggerAsyncValidation,
3597
3608
  obscuredFields,
3598
3609
  optionalFields,
3599
- trustedFields: trustedFields2,
3610
+ trustedFields,
3600
3611
  formatters
3601
- }), [triggerStaticValidation, triggerAsyncValidation, obscuredFields, optionalFields, trustedFields2, formatters]);
3612
+ }), [triggerStaticValidation, triggerAsyncValidation, obscuredFields, optionalFields, trustedFields, formatters]);
3602
3613
  const initialData = useMemo(() => ({
3603
3614
  schema: getSchema,
3604
3615
  defaultData,
3605
3616
  fieldProblems,
3606
3617
  obscuredFields,
3607
3618
  optionalFields,
3608
- trustedFields: trustedFields2,
3619
+ trustedFields,
3609
3620
  formatters,
3610
3621
  staticValidate: triggerStaticValidation,
3611
3622
  asyncValidate: triggerAsyncValidation
3612
- }), [getSchema, defaultData, fieldProblems, obscuredFields, optionalFields, trustedFields2, formatters, triggerStaticValidation, triggerAsyncValidation]);
3623
+ }), [getSchema, defaultData, fieldProblems, obscuredFields, optionalFields, trustedFields, formatters, triggerStaticValidation, triggerAsyncValidation]);
3613
3624
  const [state, dispatch] = useReducer(getReducer(), initialData, init);
3614
3625
  const isValid = useMemo(() => {
3615
3626
  var _a;
@@ -11908,10 +11919,10 @@ const LABELS = {
11908
11919
  },
11909
11920
  otherAddressInformation: {
11910
11921
  default: OTHER_ADDRESS_INFORMATION,
11911
- [CountryCodes.Canada]: "apartmentSuiteOptional",
11912
- [CountryCodes.PuertoRico]: "apartmentSuiteOptional",
11922
+ [CountryCodes.Canada]: "apartmentSuiteOther",
11923
+ [CountryCodes.PuertoRico]: "apartmentSuiteOther",
11913
11924
  // should exactly match CountryCodes.UnitedStates
11914
- [CountryCodes.UnitedStates]: "apartmentSuiteOptional"
11925
+ [CountryCodes.UnitedStates]: "apartmentSuiteOther"
11915
11926
  },
11916
11927
  postalCode: {
11917
11928
  default: POSTAL_CODE,
@@ -11940,13 +11951,17 @@ const LABELS = {
11940
11951
  };
11941
11952
  const getKeyForField = (fieldName, country) => country ? LABELS[fieldName][country] || LABELS[fieldName].default : LABELS[fieldName].default;
11942
11953
  const getAddressSchemaForCountry = (country) => ADDRESS_SCHEMAS[country] || ADDRESS_SCHEMAS.default;
11954
+ const getAddressSchemaLabelsByCountry = (country) => {
11955
+ const schema = getAddressSchemaForCountry(country);
11956
+ return schema.reduce((labels2, field) => ({
11957
+ ...labels2,
11958
+ [field]: getKeyForField(field, country)
11959
+ }), {});
11960
+ };
11943
11961
  const mapAddressLabels = (data, datasetUtils) => {
11944
- const {
11945
- country
11946
- } = data;
11947
- if (country) {
11962
+ if (data == null ? void 0 : data.country) {
11948
11963
  return Object.entries(data).reduce((mappedAddress, [field, value]) => {
11949
- const mappedKey = getKeyForField(field, country);
11964
+ const mappedKey = getKeyForField(field, data.country);
11950
11965
  switch (field) {
11951
11966
  case "country":
11952
11967
  return {
@@ -11956,7 +11971,7 @@ const mapAddressLabels = (data, datasetUtils) => {
11956
11971
  case "stateOrProvince":
11957
11972
  return {
11958
11973
  ...mappedAddress,
11959
- [mappedKey]: datasetUtils.getStateName(value, country)
11974
+ [mappedKey]: datasetUtils.getStateName(value, data.country)
11960
11975
  };
11961
11976
  default:
11962
11977
  return {
@@ -12022,7 +12037,8 @@ function FieldContainer(props) {
12022
12037
  hideField,
12023
12038
  maxlength,
12024
12039
  handleChangeFor,
12025
- readOnly
12040
+ readOnly,
12041
+ optional
12026
12042
  } = props;
12027
12043
  const formUtils = formUtilities(props, i18n);
12028
12044
  const errorMessage = formUtils.getErrorMessage(fieldName, errors, fieldProblems);
@@ -12042,7 +12058,7 @@ function FieldContainer(props) {
12042
12058
  country: errorMessage
12043
12059
  },
12044
12060
  labels: {
12045
- country: formUtils.getLabel(field)
12061
+ country: formUtils.getLabel(field, labelKey)
12046
12062
  },
12047
12063
  readonly: readOnly,
12048
12064
  classNameModifiers,
@@ -12061,7 +12077,7 @@ function FieldContainer(props) {
12061
12077
  stateOrProvince: errorMessage
12062
12078
  },
12063
12079
  labels: {
12064
- stateOrProvince: formUtils.getLabel(field)
12080
+ stateOrProvince: formUtils.getLabel(field, labelKey)
12065
12081
  },
12066
12082
  readonly: readOnly,
12067
12083
  classNameModifiers,
@@ -12075,6 +12091,7 @@ function FieldContainer(props) {
12075
12091
  classNameModifiers,
12076
12092
  errorMessage,
12077
12093
  isValid: valid[field],
12094
+ optional,
12078
12095
  children: (childProps) => jsx(InputText, {
12079
12096
  ...childProps,
12080
12097
  classNameModifiers,
@@ -12656,7 +12673,11 @@ const addressValidationRulesV4 = (country, i18n) => {
12656
12673
  errorMessage: "fieldIsRequired"
12657
12674
  }, {
12658
12675
  modes: ["blur"],
12659
- validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val),
12676
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
12677
+ errorMessage: "nameMustContainLetters"
12678
+ }, {
12679
+ modes: ["blur"],
12680
+ validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
12660
12681
  errorMessage: "checkForTypos"
12661
12682
  }, {
12662
12683
  modes: ["blur"],
@@ -12688,7 +12709,11 @@ const addressValidationRulesV4 = (country, i18n) => {
12688
12709
  errorMessage: "fieldIsRequired"
12689
12710
  }, {
12690
12711
  modes: ["blur"],
12691
- validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
12712
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
12713
+ errorMessage: "nameMustContainLetters"
12714
+ }, {
12715
+ modes: ["blur"],
12716
+ validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
12692
12717
  errorMessage: "checkForTypos"
12693
12718
  }, {
12694
12719
  modes: ["blur"],
@@ -12705,6 +12730,10 @@ const addressValidationRulesV4 = (country, i18n) => {
12705
12730
  modes: ["blur"],
12706
12731
  validate: (val) => !!val,
12707
12732
  errorMessage: "fieldIsRequired"
12733
+ }, {
12734
+ modes: ["blur"],
12735
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
12736
+ errorMessage: "nameMustContainLetters"
12708
12737
  }, {
12709
12738
  modes: ["blur"],
12710
12739
  validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
@@ -12716,7 +12745,11 @@ const addressValidationRulesV4 = (country, i18n) => {
12716
12745
  errorMessage: "fieldIsRequired"
12717
12746
  }, {
12718
12747
  modes: ["blur"],
12719
- validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
12748
+ validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
12749
+ errorMessage: "nameMustContainLetters"
12750
+ }, {
12751
+ modes: ["blur"],
12752
+ validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
12720
12753
  errorMessage: "checkForTypos"
12721
12754
  }]
12722
12755
  };
@@ -12725,6 +12758,7 @@ function Address(props) {
12725
12758
  const {
12726
12759
  data: dataProp,
12727
12760
  requiredFields: requiredFieldsProp,
12761
+ optionalFields: optionalFieldsProp = ["otherAddressInformation"],
12728
12762
  fieldValidationErrors: fieldValidationErrorsProp,
12729
12763
  formVerificationErrors: formVerificationErrorsProp,
12730
12764
  legalEntityId,
@@ -12775,11 +12809,13 @@ function Address(props) {
12775
12809
  formatters: addressFormatters,
12776
12810
  rules: isStrictNameAndAddressValidationEnabled ? rulesV4 : rules2,
12777
12811
  fieldProblems: fieldValidationErrorsProp,
12812
+ optionalFields: optionalFieldsProp,
12778
12813
  obscuredFields: []
12779
12814
  });
12780
12815
  const formUtils = formUtilities({
12781
12816
  ...props,
12782
- requiredFields
12817
+ requiredFields,
12818
+ optionalFields: optionalFieldsProp
12783
12819
  }, i18n);
12784
12820
  useEffect(() => {
12785
12821
  if (dataProp.country !== data.country && dataProp.country) {
@@ -12876,7 +12912,7 @@ function Address(props) {
12876
12912
  }
12877
12913
  }, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
12878
12914
  const getComponent = (fieldName) => {
12879
- if (!formUtils.isRequiredField(fieldName)) return null;
12915
+ if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
12880
12916
  const hideField = fieldName === "country" && hideCountry;
12881
12917
  return jsx(FieldContainer, {
12882
12918
  classNameModifiers: [fieldName],
@@ -12890,6 +12926,7 @@ function Address(props) {
12890
12926
  hideField,
12891
12927
  "aria-label": formUtils.getLabel(fieldName, fieldName),
12892
12928
  readOnly: formUtils.isReadOnly(fieldName),
12929
+ optional: formUtils.isOptionalField(fieldName),
12893
12930
  trimOnBlur: true
12894
12931
  }, fieldName);
12895
12932
  };
@@ -14013,32 +14050,30 @@ const businessDetailsBaseMapping = {
14013
14050
  "basicInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
14014
14051
  "basicInformation.registrationNumber": "organization.registrationNumber",
14015
14052
  "basicInformation.taxInformation": "organization.taxInformation",
14016
- "basicInformation.isUen": "organization.isUen",
14017
14053
  "companyStructure.entityType": "organization.type",
14018
14054
  "additionalInformation.legalCompanyName": "organization.legalName",
14019
14055
  "additionalInformation.legalFormDescription": "organization.legalFormDescription",
14020
14056
  "additionalInformation.dbaName": "organization.doingBusinessAs",
14021
14057
  "additionalInformation.registrationNumber": "organization.registrationNumber",
14022
14058
  "additionalInformation.taxInformation": "organization.taxInformation",
14023
- "additionalInformation.isUen": "organization.isUen",
14024
14059
  "additionalInformation.vatNumber": "organization.vatNumber",
14025
14060
  "additionalInformation.vatAbsenceReason": "organization.vatAbsenceReason",
14026
14061
  "additionalInformation.dateOfIncorporation": "organization.dateOfIncorporation",
14027
14062
  "additionalInformation.stockExchangeMIC": "organization.stockData.marketIdentifier",
14028
14063
  "additionalInformation.stockISIN": "organization.stockData.stockNumber",
14029
14064
  "additionalInformation.stockTickerSymbol": "organization.stockData.tickerSymbol",
14030
- "companyRegistrationAddress.registrationAddress.city": "organization.registeredAddress.city",
14031
- "companyRegistrationAddress.registrationAddress.country": "organization.registeredAddress.country",
14032
- "companyRegistrationAddress.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
14033
- "companyRegistrationAddress.registrationAddress.stateOrProvince": "organization.registeredAddress.stateOrProvince",
14034
- "companyRegistrationAddress.registrationAddress.address": "organization.registeredAddress.street",
14035
- "companyRegistrationAddress.registrationAddress.otherAddressInformation": "organization.registeredAddress.street2",
14036
- "companyRegistrationAddress.operationalAddress.city": "organization.principalPlaceOfBusiness.city",
14037
- "companyRegistrationAddress.operationalAddress.country": "organization.principalPlaceOfBusiness.country",
14038
- "companyRegistrationAddress.operationalAddress.postalCode": "organization.principalPlaceOfBusiness.postalCode",
14039
- "companyRegistrationAddress.operationalAddress.stateOrProvince": "organization.principalPlaceOfBusiness.stateOrProvince",
14040
- "companyRegistrationAddress.operationalAddress.address": "organization.principalPlaceOfBusiness.street",
14041
- "companyRegistrationAddress.operationalAddress.otherAddressInformation": "organization.principalPlaceOfBusiness.street2"
14065
+ "additionalInformation.registrationAddress.city": "organization.registeredAddress.city",
14066
+ "additionalInformation.registrationAddress.country": "organization.registeredAddress.country",
14067
+ "additionalInformation.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
14068
+ "additionalInformation.registrationAddress.stateOrProvince": "organization.registeredAddress.stateOrProvince",
14069
+ "additionalInformation.registrationAddress.address": "organization.registeredAddress.street",
14070
+ "additionalInformation.registrationAddress.otherAddressInformation": "organization.registeredAddress.street2",
14071
+ "additionalInformation.operationalAddress.city": "organization.principalPlaceOfBusiness.city",
14072
+ "additionalInformation.operationalAddress.country": "organization.principalPlaceOfBusiness.country",
14073
+ "additionalInformation.operationalAddress.postalCode": "organization.principalPlaceOfBusiness.postalCode",
14074
+ "additionalInformation.operationalAddress.stateOrProvince": "organization.principalPlaceOfBusiness.stateOrProvince",
14075
+ "additionalInformation.operationalAddress.address": "organization.principalPlaceOfBusiness.street",
14076
+ "additionalInformation.operationalAddress.otherAddressInformation": "organization.principalPlaceOfBusiness.street2"
14042
14077
  };
14043
14078
  const companyBaseMapping = {
14044
14079
  "companyNameAndCountry.country": "organization.registeredAddress.country",
@@ -14051,7 +14086,6 @@ const companyBaseMapping = {
14051
14086
  "companyRegistrationDetails.vatNumber": "organization.vatNumber",
14052
14087
  "companyRegistrationDetails.vatAbsenceReason": "organization.vatAbsenceReason",
14053
14088
  "companyRegistrationDetails.dateOfIncorporation": "organization.dateOfIncorporation",
14054
- "companyRegistrationDetails.isUen": "organization.isUen",
14055
14089
  "companyRegistrationDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
14056
14090
  "companyRegistrationDetails.stockISIN": "organization.stockData.stockNumber",
14057
14091
  "companyRegistrationDetails.stockTickerSymbol": "organization.stockData.tickerSymbol",
@@ -14092,7 +14126,6 @@ const companySearchBaseMapping = {
14092
14126
  "companyOtherDetails.vatNumber": "organization.vatNumber",
14093
14127
  "companyOtherDetails.vatAbsenceReason": "organization.vatAbsenceReason",
14094
14128
  "companyOtherDetails.dateOfIncorporation": "organization.dateOfIncorporation",
14095
- "companyOtherDetails.isUen": "organization.isUen",
14096
14129
  "companyOtherDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
14097
14130
  "companyOtherDetails.stockISIN": "organization.stockData.stockNumber",
14098
14131
  "companyOtherDetails.stockTickerSymbol": "organization.stockData.tickerSymbol"
@@ -14461,23 +14494,23 @@ const mapLegalEntityToCompany = (legalEntity, isChangingType, accountHolder) =>
14461
14494
  return companyCompData;
14462
14495
  };
14463
14496
  const mapCompanyToLegalEntity = (data) => {
14464
- var _a, _b, _c, _d, _e, _f;
14497
+ var _a, _b, _c, _d, _e, _f, _g;
14465
14498
  const requestObj = {
14466
14499
  ...formatObject(data, companyApiKeyMapping)
14467
14500
  };
14468
14501
  if (requestObj.organization.vatAbsenceReason) {
14469
14502
  requestObj.organization.vatNumber = "";
14470
14503
  }
14471
- const taxId = (_a = data.companyRegistrationDetails.taxInformation) == null ? void 0 : _a.find((tax) => {
14504
+ const taxId = (_b = (_a = data.companyRegistrationDetails.taxInformation) == null ? void 0 : _a.find((tax) => {
14472
14505
  var _a2;
14473
14506
  return tax.country === ((_a2 = data.companyNameAndCountry) == null ? void 0 : _a2.country);
14474
- }).number;
14475
- if (taxId || ((_b = data.companyRegistrationDetails) == null ? void 0 : _b.isUen)) {
14507
+ })) == null ? void 0 : _b.number;
14508
+ if (taxId || ((_c = data.companyRegistrationDetails) == null ? void 0 : _c.isUen)) {
14476
14509
  requestObj.organization = updateTaxInformation({
14477
- taxId: ((_c = data.companyRegistrationDetails) == null ? void 0 : _c.isUen) ? data.companyRegistrationDetails.registrationNumber : taxId,
14478
- country: (_d = data.companyNameAndCountry) == null ? void 0 : _d.country,
14479
- exemptedFromTax: (_e = data.companyRegistrationDetails) == null ? void 0 : _e.exemptedFromTax,
14480
- isUen: (_f = data.companyRegistrationDetails) == null ? void 0 : _f.isUen,
14510
+ taxId: ((_d = data.companyRegistrationDetails) == null ? void 0 : _d.isUen) ? data.companyRegistrationDetails.registrationNumber : taxId,
14511
+ country: (_e = data.companyNameAndCountry) == null ? void 0 : _e.country,
14512
+ exemptedFromTax: (_f = data.companyRegistrationDetails) == null ? void 0 : _f.exemptedFromTax,
14513
+ isUen: (_g = data.companyRegistrationDetails) == null ? void 0 : _g.isUen,
14481
14514
  entity: requestObj.organization
14482
14515
  });
14483
14516
  }
@@ -15002,12 +15035,6 @@ function IdDocumentManualUploadComponent(props) {
15002
15035
  });
15003
15036
  }
15004
15037
  const IdDocumentManualUpload = memo(IdDocumentManualUploadComponent, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.name === nextProps.name);
15005
- const CoreContext = createContext(void 0);
15006
- const useCoreContext = () => {
15007
- const context = useContext(CoreContext);
15008
- if (!context) throw Error("You need a <CoreProvider> to use core context");
15009
- return context;
15010
- };
15011
15038
  const useIdVerificationToken = ({
15012
15039
  userDetails,
15013
15040
  legalEntityId,
@@ -16658,7 +16685,8 @@ const DecisionMakerRoleComponent = (props) => {
16658
16685
  validators: validators2,
16659
16686
  fieldValidationErrors,
16660
16687
  requiredFields,
16661
- allowedRoles
16688
+ allowedRoles,
16689
+ trustedRoles
16662
16690
  } = props;
16663
16691
  const {
16664
16692
  i18n
@@ -16716,7 +16744,7 @@ const DecisionMakerRoleComponent = (props) => {
16716
16744
  onSelect: changeRoles,
16717
16745
  mapToSelectItem: (role) => ({
16718
16746
  ...makeSelectItemForRole(role, i18n),
16719
- disabled: !(allowedRoles == null ? void 0 : allowedRoles.includes(role))
16747
+ disabled: allowedRoles ? !(allowedRoles == null ? void 0 : allowedRoles.includes(role)) : trustedRoles.includes(role)
16720
16748
  })
16721
16749
  })
16722
16750
  })]
@@ -17612,10 +17640,13 @@ function PersonalDetailsComponent(props) {
17612
17640
  isExperimentEnabled
17613
17641
  } = useExperimentsContext();
17614
17642
  const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
17615
- const PERSONAL_DETAILS = props.id;
17616
17643
  const {
17617
- residencyCountry
17618
- } = props.data;
17644
+ id: PERSONAL_DETAILS,
17645
+ trustedRoles,
17646
+ data: {
17647
+ residencyCountry
17648
+ }
17649
+ } = props;
17619
17650
  const [externalErrors, setExternalErrors] = useState(null);
17620
17651
  const [status, setStatus] = useState("success");
17621
17652
  const stateRef = useRef({
@@ -17794,7 +17825,8 @@ function PersonalDetailsComponent(props) {
17794
17825
  ...decisionMakerRoleProps,
17795
17826
  taskType: props.taskType,
17796
17827
  dataStoreId: PERSONAL_DETAILS,
17797
- allowedRoles: props == null ? void 0 : props.allowedRoles
17828
+ allowedRoles: props == null ? void 0 : props.allowedRoles,
17829
+ trustedRoles
17798
17830
  }), hasRequiredFields(nameProps) && jsx(Name, {
17799
17831
  ...nameProps,
17800
17832
  dataStoreId: PERSONAL_DETAILS
@@ -18245,7 +18277,8 @@ function IndividualComponent(props) {
18245
18277
  allowedRoles: props == null ? void 0 : props.allowedRoles,
18246
18278
  capabilities: props.capabilities,
18247
18279
  parentLegalEntity: props.parentLegalEntity,
18248
- trustedFieldsProvider: props.trustedFieldsProvider
18280
+ trustedFieldsProvider: props.trustedFieldsProvider,
18281
+ trustedRoles: props.trustedRoles
18249
18282
  })
18250
18283
  }), jsx("div", {
18251
18284
  className: activeForm.formId !== addressFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -19743,12 +19776,9 @@ function BankVerification(props) {
19743
19776
  heading
19744
19777
  }), jsxs("div", {
19745
19778
  className: "adyen-kyc-bank-verification-success",
19746
- children: [jsx("span", {
19747
- children: jsx("i", {
19748
- className: "adyen-kyc-icon adyen-kyc-icon-checkmark-small adyen-kyc-bank-verification-success__checkmark-icon",
19749
- role: "img",
19750
- "aria-hidden": "true"
19751
- })
19779
+ children: [jsx(Icon, {
19780
+ name: "check",
19781
+ className: "adyen-kyc-u-margin-x-24"
19752
19782
  }), jsxs("span", {
19753
19783
  children: [" ", i18n.get("youSuccessfullyVerifiedAccount")]
19754
19784
  })]
@@ -22715,7 +22745,7 @@ var EntityType = /* @__PURE__ */ ((EntityType2) => {
22715
22745
  EntityType2["LEGAL_ENTITY"] = "LegalEntity";
22716
22746
  return EntityType2;
22717
22747
  })(EntityType || {});
22718
- const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189"];
22748
+ const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189", "2_8190", "2_8191", "2_8193"];
22719
22749
  const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
22720
22750
  const getComponentMappingFromLEFieldPath = (context, entityType, isExperimentEnabled) => {
22721
22751
  if (!(context == null ? void 0 : context.key)) {
@@ -23916,7 +23946,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
23916
23946
  const masks = {};
23917
23947
  const validators2 = {};
23918
23948
  const obscuredFields = {};
23919
- const trustedFields2 = {};
23949
+ const trustedFields = {};
23920
23950
  if (!scenarioConfiguration) {
23921
23951
  return;
23922
23952
  }
@@ -23952,7 +23982,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
23952
23982
  }
23953
23983
  const isFieldTrusted = isTrustedField(trustedMappings, formId, field);
23954
23984
  if (isFieldTrusted) {
23955
- trustedFields2[formId] = trustedFields2[formId] ? [...trustedFields2[formId], field] : [field];
23985
+ trustedFields[formId] = trustedFields[formId] ? [...trustedFields[formId], field] : [field];
23956
23986
  }
23957
23987
  if (fieldConfigurations) {
23958
23988
  const customLabel = (_a3 = customLabels2 == null ? void 0 : customLabels2[field]) == null ? void 0 : _a3.call(customLabels2);
@@ -24023,7 +24053,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
24023
24053
  placeholders,
24024
24054
  validators: validators2,
24025
24055
  obscuredFields,
24026
- trustedFields: trustedFields2,
24056
+ trustedFields,
24027
24057
  helperText,
24028
24058
  masks
24029
24059
  };
@@ -24044,7 +24074,7 @@ const isFieldRequiredToRemediateDataMissingError = (formId, field, dataMissingEr
24044
24074
  const missingAndLinkedFields = addLinkedFields(missingFields);
24045
24075
  return missingAndLinkedFields.includes(makeTLDSFieldName(formId, field));
24046
24076
  };
24047
- const isTrustedField = (trustedFields2, formId, field) => trustedFields2 == null ? void 0 : trustedFields2.some((trustedField) => {
24077
+ const isTrustedField = (trustedFields, formId, field) => trustedFields == null ? void 0 : trustedFields.some((trustedField) => {
24048
24078
  const split = trustedField.split(".");
24049
24079
  return split[0] === formId && split[split.length - 1] === field;
24050
24080
  });
@@ -24281,11 +24311,8 @@ function VerifiedBusinessCard({
24281
24311
  })]
24282
24312
  })
24283
24313
  }].filter((item) => !!item.value), [address, addressLink, i18n, verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm]);
24284
- return jsxs("section", {
24285
- children: [jsx(Typography, {
24286
- el: "h3",
24287
- children: i18n.get("verifiedInformation")
24288
- }), jsxs("div", {
24314
+ return jsx("section", {
24315
+ children: jsxs("div", {
24289
24316
  className: "adyen-kyc-verified-business-card",
24290
24317
  children: [jsx(StructuredList, {
24291
24318
  items: baseItems
@@ -24301,11 +24328,11 @@ function VerifiedBusinessCard({
24301
24328
  onClick: () => setExpanded(!expanded)
24302
24329
  })
24303
24330
  })]
24304
- })]
24331
+ })
24305
24332
  });
24306
24333
  }
24307
24334
  const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
24308
- const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription"];
24335
+ const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription", ...registrationAddressFields];
24309
24336
  function AdditionalInformationComponent({
24310
24337
  data,
24311
24338
  labels: labels2,
@@ -24322,11 +24349,13 @@ function AdditionalInformationComponent({
24322
24349
  obscuredFields,
24323
24350
  optionalFields,
24324
24351
  readOnlyFields,
24325
- trustedFields: trustedFields2,
24352
+ trustedFields,
24326
24353
  country,
24327
24354
  companyType = CompanyTypesValue.PRIVATE_COMPANY,
24328
24355
  verifiedBusiness,
24329
- showCompanyStructure
24356
+ showCompanyStructure,
24357
+ handleAddressSearch,
24358
+ handleFindAddress
24330
24359
  }) {
24331
24360
  var _a, _b, _c, _d;
24332
24361
  const {
@@ -24337,6 +24366,12 @@ function AdditionalInformationComponent({
24337
24366
  } = useI18nContext();
24338
24367
  const showVerified = !!verifiedBusiness;
24339
24368
  const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
24369
+ const ADDRESS_SCHEMA2 = getAddressSchemaForCountry(country).filter((field) => {
24370
+ if (!COUNTRIES_WITH_STATES_DATASET.includes(country)) {
24371
+ return field !== "otherAddressInformation" && field !== "stateOrProvince";
24372
+ }
24373
+ return field !== "otherAddressInformation";
24374
+ });
24340
24375
  const initialFormUtilsProps = useMemo(() => ({
24341
24376
  data,
24342
24377
  labels: labels2,
@@ -24348,9 +24383,9 @@ function AdditionalInformationComponent({
24348
24383
  readOnlyFields,
24349
24384
  optionalFields,
24350
24385
  obscuredFields,
24351
- trustedFields: trustedFields2,
24386
+ trustedFields,
24352
24387
  shouldValidate
24353
- }), [data, labels2, placeholders, helperText, readOnly, allFields, requiredFields, readOnlyFields, optionalFields, obscuredFields, trustedFields2, shouldValidate]);
24388
+ }), [data, labels2, placeholders, helperText, readOnly, allFields, requiredFields, readOnlyFields, optionalFields, obscuredFields, trustedFields, shouldValidate]);
24354
24389
  const registrationNumberOptions = useMemo(() => getCompanyRegistrationNumberOptions(country, companyType), [country, companyType]);
24355
24390
  const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country, companyType) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
24356
24391
  const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
@@ -24425,6 +24460,20 @@ function AdditionalInformationComponent({
24425
24460
  }
24426
24461
  }, initialFormUtilsProps);
24427
24462
  }, [companyType, country, initialFormUtilsProps, registrationNumberType, taxIdNumberType, vatNumberType]);
24463
+ const mergedDefaultData = useMemo(() => {
24464
+ if (!verifiedBusiness) return data;
24465
+ return {
24466
+ ...data,
24467
+ legalCompanyName: verifiedBusiness.name,
24468
+ registrationAddress: {
24469
+ address: verifiedBusiness.street,
24470
+ city: verifiedBusiness.city,
24471
+ postalCode: verifiedBusiness.zipcode,
24472
+ stateOrProvince: verifiedBusiness.state,
24473
+ country: verifiedBusiness.country
24474
+ }
24475
+ };
24476
+ }, [data, verifiedBusiness]);
24428
24477
  const {
24429
24478
  schema: formSchema,
24430
24479
  data: formData,
@@ -24433,10 +24482,11 @@ function AdditionalInformationComponent({
24433
24482
  fieldProblems: formFieldProblems,
24434
24483
  handleChangeFor,
24435
24484
  resetToDefaultData,
24436
- setErrors
24485
+ setErrors,
24486
+ setValid
24437
24487
  } = useForm({
24438
24488
  schema: getFormSchema2,
24439
- defaultData: data,
24489
+ defaultData: mergedDefaultData,
24440
24490
  rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
24441
24491
  optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
24442
24492
  obscuredFields: mergedFieldProps == null ? void 0 : mergedFieldProps.obscuredFields,
@@ -24458,9 +24508,7 @@ function AdditionalInformationComponent({
24458
24508
  if (verifiedBusiness && verifiedBusiness.name !== formData.legalCompanyName) return handleChangeFor("legalCompanyName")(verifiedBusiness.name);
24459
24509
  }, [formData.legalCompanyName, verifiedBusiness, showCompanyStructure]);
24460
24510
  useEffect(() => {
24461
- if (!verifiedBusiness && !showCompanyStructure) {
24462
- return resetToDefaultData();
24463
- }
24511
+ if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
24464
24512
  }, [verifiedBusiness]);
24465
24513
  const showField = (fieldKeys) => fieldKeys.some((field) => {
24466
24514
  switch (field) {
@@ -24471,6 +24519,15 @@ function AdditionalInformationComponent({
24471
24519
  return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
24472
24520
  }
24473
24521
  });
24522
+ const handleRegistrationAddressChange = (state) => {
24523
+ handleChangeFor("registrationAddress")(state.data);
24524
+ setValid("registrationAddress", Boolean(state.isValid));
24525
+ };
24526
+ const handleOperationalAddressChange = (state) => {
24527
+ handleChangeFor("operationalAddress")(state.data);
24528
+ setValid("operationalAddress", Boolean(state.isValid));
24529
+ };
24530
+ const handleOperationalAddressIsSameChange = (isChecked) => isChecked ? handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME) : handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
24474
24531
  return jsxs("form", {
24475
24532
  id: ADDITIONAL_INFORMATION_FORM_ID,
24476
24533
  className: "adyen-kyc-additional-information",
@@ -24482,12 +24539,25 @@ function AdditionalInformationComponent({
24482
24539
  verificationErrors: formVerificationErrors,
24483
24540
  validationErrors: fieldValidationErrors,
24484
24541
  formUtils
24485
- }), showVerified && jsx(VerifiedBusinessCard, {
24486
- verifiedBusiness
24542
+ }), showVerified && jsxs("div", {
24543
+ children: [jsx("div", {
24544
+ className: "adyen-kyc-additional-information__section-heading",
24545
+ children: jsx(Typography, {
24546
+ el: "h3",
24547
+ variant: "title",
24548
+ children: i18n.get("verifiedInformation")
24549
+ })
24550
+ }), jsx(VerifiedBusinessCard, {
24551
+ verifiedBusiness
24552
+ })]
24487
24553
  }), jsxs("fieldset", {
24488
- children: [showVerified && jsx(Typography, {
24489
- el: "h3",
24490
- children: i18n.get("otherBusinessInformation")
24554
+ children: [showVerified && jsx("div", {
24555
+ className: "adyen-kyc-additional-information__section-heading",
24556
+ children: jsx(Typography, {
24557
+ el: "h3",
24558
+ variant: "title",
24559
+ children: i18n.get("otherBusinessInformation")
24560
+ })
24491
24561
  }), showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
24492
24562
  className: "adyen-kyc-field-wrapper",
24493
24563
  children: jsx(LegalCompanyNameField, {
@@ -24578,7 +24648,8 @@ function AdditionalInformationComponent({
24578
24648
  country,
24579
24649
  canExempt: formUtils.isRequiredField("exemptedFromVat"),
24580
24650
  vatNumberType,
24581
- setVatNumberType
24651
+ setVatNumberType,
24652
+ shouldValidate
24582
24653
  })
24583
24654
  }), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
24584
24655
  className: "adyen-kyc-field-wrapper",
@@ -24595,9 +24666,13 @@ function AdditionalInformationComponent({
24595
24666
  })
24596
24667
  })]
24597
24668
  }), showStockData && jsxs("fieldset", {
24598
- children: [jsx(Typography, {
24599
- el: "h3",
24600
- children: i18n.get("stockExchangeInformation")
24669
+ children: [jsx("div", {
24670
+ className: "adyen-kyc-additional-information__section-heading",
24671
+ children: jsx(Typography, {
24672
+ el: "h3",
24673
+ variant: "title",
24674
+ children: i18n.get("stockExchangeInformation")
24675
+ })
24601
24676
  }), showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
24602
24677
  className: "adyen-kyc-field-wrapper",
24603
24678
  children: jsx(StockExchangeMICField, {
@@ -24641,6 +24716,79 @@ function AdditionalInformationComponent({
24641
24716
  handleChangeFor
24642
24717
  })
24643
24718
  })]
24719
+ }), jsxs("fieldset", {
24720
+ children: [jsxs("div", {
24721
+ className: "adyen-kyc-additional-information__section-heading",
24722
+ children: [jsx(Typography, {
24723
+ el: "h3",
24724
+ variant: "title",
24725
+ children: i18n.get("registeredBusinessAddress")
24726
+ }), jsx(Typography, {
24727
+ el: "h4",
24728
+ variant: "caption",
24729
+ children: i18n.get("registeredBusinessAddressDescription")
24730
+ })]
24731
+ }), jsx(Address, {
24732
+ id: ADDITIONAL_INFORMATION_FORM_ID,
24733
+ addressType: "registrationAddress",
24734
+ data: {
24735
+ ...mergedDefaultData == null ? void 0 : mergedDefaultData.registrationAddress,
24736
+ country
24737
+ },
24738
+ labels: getAddressSchemaLabelsByCountry(country),
24739
+ countryCode: country,
24740
+ requiredFields: ADDRESS_SCHEMA2,
24741
+ shouldValidate,
24742
+ hideCountry: true,
24743
+ optionalFields: ["otherAddressInformation"],
24744
+ onChange: handleRegistrationAddressChange,
24745
+ handleAddressSearch,
24746
+ handleFindAddress,
24747
+ verifiedBusiness
24748
+ })]
24749
+ }), jsxs("fieldset", {
24750
+ children: [jsxs("div", {
24751
+ className: "adyen-kyc-additional-information__section-heading",
24752
+ children: [jsx(Typography, {
24753
+ el: "h3",
24754
+ variant: "title",
24755
+ children: i18n.get("principalPlaceOfBusiness")
24756
+ }), jsx(Typography, {
24757
+ el: "h4",
24758
+ variant: "caption",
24759
+ children: i18n.get("principalPlaceOfBusinessDescription")
24760
+ })]
24761
+ }), jsx(Field, {
24762
+ name: "operationalAddressIsSame",
24763
+ classNameModifiers: ["operationalAddressIsSame"],
24764
+ errorMessage: formErrors.operationalAddressIsSame,
24765
+ isValid: formValid.operationalAddressIsSame,
24766
+ children: (childProps) => jsx(Checkbox, {
24767
+ ...childProps,
24768
+ "aria-required": formUtils.isRequiredField("operationalAddressIsSame"),
24769
+ "aria-label": formUtils.getLabel("sameAsRegisteredAddress"),
24770
+ "aria-invalid": !formValid.operationalAddressIsSame,
24771
+ name: "operationalAddressIsSame",
24772
+ label: formUtils.getLabel("sameAsRegisteredAddress"),
24773
+ checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
24774
+ onChange: handleOperationalAddressIsSameChange
24775
+ })
24776
+ }), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(Address, {
24777
+ id: ADDITIONAL_INFORMATION_FORM_ID,
24778
+ addressType: "operationalAddress",
24779
+ data: {
24780
+ ...mergedDefaultData == null ? void 0 : mergedDefaultData.operationalAddress,
24781
+ country
24782
+ },
24783
+ labels: getAddressSchemaLabelsByCountry(country),
24784
+ countryCode: country,
24785
+ requiredFields: ADDRESS_SCHEMA2,
24786
+ shouldValidate,
24787
+ optionalFields: ["otherAddressInformation"],
24788
+ onChange: handleOperationalAddressChange,
24789
+ handleAddressSearch,
24790
+ handleFindAddress
24791
+ })]
24644
24792
  })]
24645
24793
  });
24646
24794
  }
@@ -24787,8 +24935,8 @@ function BusinessInformationCard({
24787
24935
  result,
24788
24936
  selectedBusinessId,
24789
24937
  currentBusinessSelection,
24790
- fetching,
24791
- failedToLoad,
24938
+ fetchStatus,
24939
+ verifyStatus,
24792
24940
  invalidTin,
24793
24941
  resetTinVerification,
24794
24942
  setIsBusinessSelection,
@@ -24798,9 +24946,9 @@ function BusinessInformationCard({
24798
24946
  const {
24799
24947
  i18n
24800
24948
  } = useI18nContext();
24801
- const showSelectButton = !fetching && !failedToLoad && currentBusinessSelection;
24949
+ const showSelectButton = fetchStatus !== "loading" && fetchStatus !== "error" && currentBusinessSelection;
24802
24950
  const selectBusiness = (searchResult) => {
24803
- if (failedToLoad && selectedBusinessId === searchResult.id) return;
24951
+ if (fetchStatus === "error" && selectedBusinessId === searchResult.id) return;
24804
24952
  return handleSelectBusiness(searchResult);
24805
24953
  };
24806
24954
  const handleGoBack = () => {
@@ -24813,7 +24961,7 @@ function BusinessInformationCard({
24813
24961
  title: result.name,
24814
24962
  subTitle: result.registrationNumber,
24815
24963
  stateful: true,
24816
- fetching: fetching && selectedBusinessId === result.id,
24964
+ fetching: fetchStatus === "loading" && selectedBusinessId === result.id,
24817
24965
  active: selectedBusinessId === result.id,
24818
24966
  headerButton: selectedBusinessId === result.id && showSelectButton ? jsx(Button, {
24819
24967
  label: i18n.get("thisIsMyBusiness"),
@@ -24835,7 +24983,11 @@ function BusinessInformationCard({
24835
24983
  showAsLink: true
24836
24984
  }),
24837
24985
  testId: "invalidTin"
24838
- }), failedToLoad && jsx(Alert, {
24986
+ }), verifyStatus === "error" && jsx(Alert, {
24987
+ variant: "error",
24988
+ title: i18n.get("businessSelection__tinVerificationFailure"),
24989
+ testId: "tinVerificationFailure"
24990
+ }), fetchStatus === "error" && jsx(Alert, {
24839
24991
  variant: "info",
24840
24992
  type: "callToAction",
24841
24993
  title: i18n.get("businessSelection__failedToLoad"),
@@ -24846,8 +24998,8 @@ function BusinessInformationCard({
24846
24998
  showAsLink: true
24847
24999
  }),
24848
25000
  testId: "failedToLoad"
24849
- }), !failedToLoad && jsx(BusinessInformation, {
24850
- fetching,
25001
+ }), fetchStatus !== "error" && jsx(BusinessInformation, {
25002
+ fetching: fetchStatus === "loading",
24851
25003
  selectedBusiness: currentBusinessSelection
24852
25004
  })]
24853
25005
  })
@@ -24856,10 +25008,10 @@ function BusinessInformationCard({
24856
25008
  const logger$r = createLogger("BusinessSelection");
24857
25009
  function BusinessSelectionComponent({
24858
25010
  showCompanyStructure,
24859
- isSearching,
24860
- isFetching,
24861
- isVerifying,
24862
- isClearingTrustedData,
25011
+ searching,
25012
+ fetching,
25013
+ verifying,
25014
+ resettingTrustedData,
24863
25015
  searchResults,
24864
25016
  invalidTin,
24865
25017
  fetchBusinessData,
@@ -24887,19 +25039,19 @@ function BusinessSelectionComponent({
24887
25039
  }, [setShowCompanyStructure, verifyBusinessData]);
24888
25040
  const handleSelectBusiness = useCallback(async (result) => {
24889
25041
  try {
24890
- if (isFetching === "loading") return;
25042
+ if (fetching === "loading") return;
24891
25043
  if (!selectedBusinessId || selectedBusinessId !== result.id) {
24892
25044
  setSelectedBusinessId(result.id);
24893
25045
  const businessData = await fetchBusinessData(result);
24894
25046
  setCurrentBusinessSelection(businessData);
24895
- } else if (isFetching === "error") {
25047
+ } else if (fetching === "error") {
24896
25048
  const businessData = await fetchBusinessData(result);
24897
25049
  setCurrentBusinessSelection(businessData);
24898
25050
  }
24899
25051
  } catch (e) {
24900
25052
  logger$r.error(e);
24901
25053
  }
24902
- }, [fetchBusinessData, isFetching, selectedBusinessId]);
25054
+ }, [fetchBusinessData, fetching, selectedBusinessId]);
24903
25055
  const handleConfirmSelection = useCallback(async (data) => {
24904
25056
  if (!currentTin) return;
24905
25057
  try {
@@ -24911,7 +25063,7 @@ function BusinessSelectionComponent({
24911
25063
  logger$r.error(e);
24912
25064
  }
24913
25065
  }, [currentTin, handleNextClick, handleBusinessVerification]);
24914
- const showLoader = isSearching === "loading" || isVerifying === "loading" || isClearingTrustedData === "loading" || isFetching === "loading" && (searchResults == null ? void 0 : searchResults.length) === 1;
25066
+ const showLoader = searching === "loading" || verifying === "loading" || resettingTrustedData === "loading" || fetching === "loading" && (searchResults == null ? void 0 : searchResults.length) === 1;
24915
25067
  const businessSelectionClasses = cx("adyen-kyc-business-selection", {
24916
25068
  "adyen-kyc-business-selection--loading": showLoader
24917
25069
  });
@@ -24936,8 +25088,8 @@ function BusinessSelectionComponent({
24936
25088
  result,
24937
25089
  selectedBusinessId,
24938
25090
  currentBusinessSelection,
24939
- fetching: isFetching === "loading",
24940
- failedToLoad: isFetching === "error",
25091
+ fetchStatus: fetching,
25092
+ verifyStatus: verifying,
24941
25093
  invalidTin,
24942
25094
  resetTinVerification,
24943
25095
  handleSelectBusiness,
@@ -25051,7 +25203,7 @@ function BasicInformationComponent({
25051
25203
  obscuredFields,
25052
25204
  optionalFields,
25053
25205
  readOnlyFields,
25054
- trustedFields: trustedFields2,
25206
+ trustedFields,
25055
25207
  country,
25056
25208
  companyType = CompanyTypesValue.PRIVATE_COMPANY,
25057
25209
  isTopLevelEntity,
@@ -25059,10 +25211,10 @@ function BasicInformationComponent({
25059
25211
  showBusinessSelection,
25060
25212
  showCompanyStructure,
25061
25213
  isActiveForm,
25062
- isSearching,
25063
- isFetching,
25064
- isVerifying,
25065
- isClearingTrustedData,
25214
+ searching,
25215
+ fetching,
25216
+ verifying,
25217
+ resettingTrustedData,
25066
25218
  searchResults,
25067
25219
  invalidTin,
25068
25220
  verifiedBusiness,
@@ -25105,9 +25257,9 @@ function BasicInformationComponent({
25105
25257
  readOnlyFields,
25106
25258
  optionalFields,
25107
25259
  obscuredFields,
25108
- trustedFields: trustedFields2,
25260
+ trustedFields,
25109
25261
  shouldValidate
25110
- }), [allFields, helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, trustedFields2, shouldValidate]);
25262
+ }), [allFields, helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, trustedFields, shouldValidate]);
25111
25263
  const registrationNumberOptions = useMemo(() => getCompanyRegistrationNumberOptions(country, companyType), [country, companyType]);
25112
25264
  const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country, companyType) : (_a = registrationNumberOptions == null ? void 0 : registrationNumberOptions[0]) == null ? void 0 : _a.id;
25113
25265
  const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
@@ -25174,6 +25326,9 @@ function BasicInformationComponent({
25174
25326
  fieldProblems: formFieldProblems
25175
25327
  });
25176
25328
  }, [formSchema, formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
25329
+ useEffect(() => {
25330
+ if (!isActiveForm && !(searchResults == null ? void 0 : searchResults.length)) setShowBusinessSelection(false);
25331
+ }, [isActiveForm, searchResults == null ? void 0 : searchResults.length, setShowBusinessSelection]);
25177
25332
  useEffect(() => {
25178
25333
  if (showBusinessSelection && showCompanyStructure && isActiveForm) {
25179
25334
  handleNextClick();
@@ -25184,10 +25339,10 @@ function BasicInformationComponent({
25184
25339
  if (showBusinessSelection) {
25185
25340
  return jsx(BusinessSelectionComponent, {
25186
25341
  showCompanyStructure,
25187
- isSearching,
25188
- isFetching,
25189
- isVerifying,
25190
- isClearingTrustedData,
25342
+ searching,
25343
+ fetching,
25344
+ verifying,
25345
+ resettingTrustedData,
25191
25346
  searchResults,
25192
25347
  invalidTin,
25193
25348
  fetchBusinessData,
@@ -25639,12 +25794,6 @@ const getForms = (country) => ({
25639
25794
  formHeading: "additionalInformationFormHeading",
25640
25795
  fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? ADDITIONAL_INFORMATION_FIELDS.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)) : ADDITIONAL_INFORMATION_FIELDS
25641
25796
  },
25642
- companyRegistrationAddress: {
25643
- formId: "companyRegistrationAddress",
25644
- formName: "companyRegistrationAddressFormName",
25645
- formDescription: "companyRegistrationAddressFormDescription",
25646
- fields: ["registrationAddress", "operationalAddress", "operationalAddressIsSame"]
25647
- },
25648
25797
  companyRegistrationDocument: {
25649
25798
  formId: "companyRegistrationDocument",
25650
25799
  formName: "companyRegistrationDocumentFormName",
@@ -25686,7 +25835,7 @@ const mapBasicInformation = (data) => {
25686
25835
  }, {});
25687
25836
  };
25688
25837
  const mapAdditionalInformation = (data, legalEntity) => {
25689
- var _a, _b, _c, _d;
25838
+ var _a, _b, _c, _d, _e;
25690
25839
  if (!data) return;
25691
25840
  const dbaName = ((_a = legalEntity.organization) == null ? void 0 : _a.doingBusinessAs) ? ((_b = legalEntity.organization) == null ? void 0 : _b.doingBusinessAs) !== ((_c = legalEntity.organization) == null ? void 0 : _c.legalName) ? {
25692
25841
  hasDba: true
@@ -25694,6 +25843,7 @@ const mapAdditionalInformation = (data, legalEntity) => {
25694
25843
  hasDba: false
25695
25844
  } : {};
25696
25845
  const currentCountry = (_d = legalEntity.organization) == null ? void 0 : _d.registeredAddress.country;
25846
+ const operationalAddressIsSame = ((_e = legalEntity.organization) == null ? void 0 : _e.principalPlaceOfBusiness) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME;
25697
25847
  return entriesOf(data).reduce((acc, [field]) => {
25698
25848
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) {
25699
25849
  return {
@@ -25709,7 +25859,8 @@ const mapAdditionalInformation = (data, legalEntity) => {
25709
25859
  }
25710
25860
  return acc;
25711
25861
  }, {
25712
- ...dbaName
25862
+ ...dbaName,
25863
+ operationalAddressIsSame
25713
25864
  });
25714
25865
  };
25715
25866
  const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, accountHolder) => {
@@ -25723,7 +25874,6 @@ const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, acco
25723
25874
  companyTaxDocument
25724
25875
  };
25725
25876
  return entriesOf(businessDetailsSchema).reduce((componentData, [key]) => {
25726
- var _a;
25727
25877
  switch (key) {
25728
25878
  case "basicInformation": {
25729
25879
  return {
@@ -25746,15 +25896,6 @@ const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, acco
25746
25896
  [key]: mapAdditionalInformation(businessDetailsSchema[key], legalEntity)
25747
25897
  };
25748
25898
  }
25749
- case "companyRegistrationAddress": {
25750
- return {
25751
- ...componentData,
25752
- [key]: {
25753
- ...businessDetailsSchema[key],
25754
- operationalAddressIsSame: ((_a = legalEntity.organization) == null ? void 0 : _a.principalPlaceOfBusiness) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME
25755
- }
25756
- };
25757
- }
25758
25899
  case "companyRegistrationDocument": {
25759
25900
  return {
25760
25901
  ...componentData,
@@ -25783,16 +25924,15 @@ function BusinessDetailsComponent(props) {
25783
25924
  country,
25784
25925
  isTopLevelEntity,
25785
25926
  activeForm,
25786
- problems,
25787
25927
  baseTrackingPayload,
25788
25928
  showCompanyStructure,
25789
25929
  showBusinessSelection,
25790
25930
  setShowBusinessSelection,
25791
25931
  setShowCompanyStructure,
25792
- isSearching,
25793
- isFetching,
25794
- isVerifying,
25795
- isClearingTrustedData,
25932
+ searching,
25933
+ fetching,
25934
+ verifying,
25935
+ resettingTrustedData,
25796
25936
  searchResults,
25797
25937
  invalidTin,
25798
25938
  verifiedBusiness,
@@ -25833,10 +25973,10 @@ function BusinessDetailsComponent(props) {
25833
25973
  showBusinessSelection,
25834
25974
  showCompanyStructure,
25835
25975
  isActiveForm: (activeForm == null ? void 0 : activeForm.formId) === forms2.basicInformation.formId,
25836
- isSearching,
25837
- isFetching,
25838
- isVerifying,
25839
- isClearingTrustedData,
25976
+ searching,
25977
+ fetching,
25978
+ verifying,
25979
+ resettingTrustedData,
25840
25980
  fetchBusinessData,
25841
25981
  verifyBusinessData,
25842
25982
  proceedToManualDataEntry,
@@ -25868,22 +26008,9 @@ function BusinessDetailsComponent(props) {
25868
26008
  country,
25869
26009
  companyType: companyStructure == null ? void 0 : companyStructure.entityType,
25870
26010
  verifiedBusiness,
25871
- showCompanyStructure
25872
- })
25873
- }), jsx("div", {
25874
- className: formWrapperClasses(forms2.companyRegistrationAddress.formId),
25875
- children: jsx(RegistrationAddressComponent, {
25876
- ...getNestedOuterFormPropsFromOuterFormProps(props, forms2.companyRegistrationAddress.formId),
25877
- id: forms2.companyRegistrationAddress.formId,
25878
- heading: i18n.get(forms2.companyRegistrationAddress.formName),
25879
- description: i18n.get(forms2.companyRegistrationAddress.formDescription, {
25880
- localizeFor: country
25881
- }),
25882
- country,
25883
- problems,
26011
+ showCompanyStructure,
25884
26012
  handleAddressSearch,
25885
- handleFindAddress,
25886
- verifiedBusiness
26013
+ handleFindAddress
25887
26014
  })
25888
26015
  }), jsx("div", {
25889
26016
  className: formWrapperClasses(forms2.companyRegistrationDocument.formId),
@@ -26137,32 +26264,37 @@ const Modal = ({
26137
26264
  onClose,
26138
26265
  children: jsxs("div", {
26139
26266
  className: "adyen-kyc-modal__wrapper",
26140
- children: [header && jsx("header", {
26141
- className: "adyen-kyc-modal__header",
26142
- children: header
26143
- }), jsx("section", {
26144
- className: "adyen-kyc-modal__content",
26145
- children
26267
+ children: [jsxs("div", {
26268
+ className: "adyen-kyc-modal__main",
26269
+ children: [jsxs("section", {
26270
+ className: "adyen-kyc-modal-top-bar",
26271
+ children: [onBack ? jsx(Button, {
26272
+ tertiary: true,
26273
+ "aria-label": "back",
26274
+ icon: "arrow-left",
26275
+ className: "adyen-kyc-modal-button-blur",
26276
+ onClick: onBack,
26277
+ shaded: true
26278
+ }) : jsx("div", {}), onClose ? jsx(Button, {
26279
+ tertiary: true,
26280
+ "aria-label": "close",
26281
+ icon: "cross",
26282
+ className: "adyen-kyc-modal-button-blur",
26283
+ onClick: onClose,
26284
+ shaded: true
26285
+ }) : jsx("div", {})]
26286
+ }), header && jsx("header", {
26287
+ className: "adyen-kyc-modal__header",
26288
+ children: header
26289
+ }), jsx("section", {
26290
+ className: "adyen-kyc-modal__content",
26291
+ children
26292
+ })]
26146
26293
  }), jsx("div", {
26147
26294
  children: footer && jsx("footer", {
26148
26295
  className: "adyen-kyc-modal__footer",
26149
26296
  children: footer
26150
26297
  })
26151
- }), jsxs("section", {
26152
- className: "adyen-kyc-modal-top-bar",
26153
- children: [onBack ? jsx(Button, {
26154
- tertiary: true,
26155
- "aria-label": "back",
26156
- icon: "arrow-left",
26157
- onClick: onBack,
26158
- shaded: true
26159
- }) : jsx("div", {}), jsx(Button, {
26160
- tertiary: true,
26161
- "aria-label": "close",
26162
- icon: "cross",
26163
- onClick: onClose,
26164
- shaded: true
26165
- })]
26166
26298
  })]
26167
26299
  })
26168
26300
  });
@@ -26399,30 +26531,48 @@ const StepProgressIndicator = ({
26399
26531
  activeStepIndex,
26400
26532
  stepsCount,
26401
26533
  fillBefore,
26402
- thick
26403
- }) => stepsCount > 0 ? jsx("div", {
26404
- "aria-label": `Step ${activeStepIndex} of ${stepsCount}`,
26405
- className: "adyen-kyc-progress",
26406
- role: "group",
26407
- children: jsx("ol", {
26408
- className: cx("adyen-kyc-progress__bar", {
26409
- "adyen-kyc-progress__bar--thick": thick
26410
- }),
26411
- children: range(stepsCount).map((stepNumber) => {
26412
- const isHighlighted = shouldHighlight(activeStepIndex, stepNumber, fillBefore);
26413
- return jsx("li", {
26414
- "aria-current": isHighlighted ? "step" : void 0,
26415
- className: cx("adyen-kyc-progress__step", {
26416
- "adyen-kyc-progress__step--active": isHighlighted
26417
- }),
26418
- children: jsx("span", {
26419
- className: "adyen-kyc-progress__step-label",
26420
- children: `Step ${stepNumber}: ${stepNumber < activeStepIndex ? "completed" : "not completed"}`
26421
- })
26422
- }, stepNumber);
26534
+ thick,
26535
+ circles
26536
+ }) => {
26537
+ const {
26538
+ i18n
26539
+ } = useI18nContext();
26540
+ if (stepsCount === 0 || stepsCount > 10) {
26541
+ return jsx(Typography, {
26542
+ variant: "caption",
26543
+ children: i18n.get("XOfYSteps", {
26544
+ values: {
26545
+ currentStep: activeStepIndex,
26546
+ totalSteps: stepsCount
26547
+ }
26548
+ })
26549
+ });
26550
+ }
26551
+ return jsx("div", {
26552
+ "aria-label": `Step ${activeStepIndex} of ${stepsCount}`,
26553
+ className: "adyen-kyc-progress",
26554
+ role: "group",
26555
+ children: jsx("ol", {
26556
+ className: cx("adyen-kyc-progress__bar", {
26557
+ "adyen-kyc-progress__bar--thick": thick,
26558
+ "adyen-kyc-progress__bar--circles": circles
26559
+ }),
26560
+ children: range(stepsCount).map((stepNumber) => {
26561
+ const isHighlighted = shouldHighlight(activeStepIndex, stepNumber, fillBefore);
26562
+ return jsx("li", {
26563
+ "aria-current": isHighlighted ? "step" : void 0,
26564
+ className: cx("adyen-kyc-progress__step", {
26565
+ "adyen-kyc-progress__step--active": isHighlighted
26566
+ }),
26567
+ children: jsx("span", {
26568
+ className: "adyen-kyc-progress__step-label",
26569
+ children: `Step ${stepNumber}: ${stepNumber < activeStepIndex ? "completed" : "not completed"}`
26570
+ })
26571
+ }, stepNumber);
26572
+ })
26423
26573
  })
26424
- })
26425
- }) : null;
26574
+ });
26575
+ };
26426
26576
  const DropinLayout = ({
26427
26577
  content,
26428
26578
  footer,
@@ -26464,7 +26614,6 @@ const DropinLayout = ({
26464
26614
  children: jsx("div", {
26465
26615
  className: "adyen-kyc-dropin__content",
26466
26616
  children: jsx("div", {
26467
- className: "adyen-kyc-dropin__content-main",
26468
26617
  children: content
26469
26618
  })
26470
26619
  })
@@ -26848,21 +26997,7 @@ const canSubmit$3 = (data) => MANDATORY_API_FIELDS.every((detail) => {
26848
26997
  return !isEmpty(value);
26849
26998
  });
26850
26999
  const isDocumentsRequired$3 = (forms2) => forms2.some((form) => documentFormsIds.includes(form.formId));
26851
- const removeConditionalForms = (forms2, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument) => {
26852
- var _a;
26853
- const filteredForCompanyStructure = isSkippingCompanyStructure ? forms2.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms2;
26854
- switch (problems == null ? void 0 : problems.status) {
26855
- case 6:
26856
- return isSkippingCompanyRegistrationDocument && !Object.keys((problems == null ? void 0 : problems.remediationActions) ?? {}).includes("1_501") ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
26857
- case 3:
26858
- return isSkippingCompanyRegistrationDocument && !((_a = problems == null ? void 0 : problems.missingData) == null ? void 0 : _a.some((missingData) => {
26859
- var _a2;
26860
- return (_a2 = missingData.remediatingActions) == null ? void 0 : _a2.some((remediation) => remediation.code === "1_501");
26861
- })) ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
26862
- default:
26863
- return isSkippingCompanyRegistrationDocument ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
26864
- }
26865
- };
27000
+ const removeConditionalForms = (forms2, isSkippingCompanyStructure) => isSkippingCompanyStructure ? forms2.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms2;
26866
27001
  const formatBasicInformation = (data, labels2, datasetUtils, companyType) => {
26867
27002
  var _a, _b, _c;
26868
27003
  const country = data == null ? void 0 : data.country;
@@ -26929,15 +27064,11 @@ const formatDataForSummary$1 = (data, forms2, labels2, i18n) => {
26929
27064
  }
26930
27065
  };
26931
27066
  case "additionalInformation":
26932
- return {
26933
- ...summaryData,
26934
- [form]: formatAdditionalInformation(data[form], labels2, (_e = data.basicInformation) == null ? void 0 : _e.country, (_f = data.companyStructure) == null ? void 0 : _f.entityType)
26935
- };
26936
- case "companyRegistrationAddress":
26937
27067
  return {
26938
27068
  ...summaryData,
26939
27069
  [form]: {
26940
27070
  hasInnerForms: true,
27071
+ additionalInformationFormName: formatAdditionalInformation(data[form], labels2, (_e = data.basicInformation) == null ? void 0 : _e.country, (_f = data.companyStructure) == null ? void 0 : _f.entityType),
26941
27072
  registrationAddress: mapAddressLabels(data[form].registrationAddress, datasetUtils),
26942
27073
  operationalAddress: data[form].operationalAddress ? mapAddressLabels(data[form].operationalAddress, datasetUtils) : void 0
26943
27074
  }
@@ -27017,22 +27148,23 @@ async function submit({
27017
27148
  showToast,
27018
27149
  clearToasts,
27019
27150
  handleUpdateLegalEntity,
27020
- onExternalSubmit
27151
+ onExternalSubmit,
27152
+ accountHolder
27021
27153
  }) {
27022
- var _a, _b, _c, _d;
27154
+ var _a, _b, _c, _d, _e;
27023
27155
  const logger2 = createLogger("submitBusinessDetails");
27024
27156
  setLoadingStatus("loading");
27025
27157
  const trackingPayload = {
27026
27158
  companyStructure: ((_a = data.companyStructure) == null ? void 0 : _a.entityType) ?? null,
27027
27159
  countryOfRegistration: ((_b = data.basicInformation) == null ? void 0 : _b.country) ?? null,
27028
27160
  legalEntityName: ((_c = data.additionalInformation) == null ? void 0 : _c.legalCompanyName) ?? null,
27029
- usedAdditionalAddress: ((_d = data.companyRegistrationAddress) == null ? void 0 : _d.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
27161
+ usedAdditionalAddress: ((_d = data.additionalInformation) == null ? void 0 : _d.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
27030
27162
  };
27031
27163
  const savedLegalEntityData = mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, isTargetLegalEntityType);
27032
27164
  const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
27033
27165
  const legalEntity = {
27034
27166
  ...mapBusinessDetailsSchemaToLegalEntity(filteredData),
27035
- entityAssociations: filterOutUnwantedAssociationsIfRootLE(TaskTypes.BUSINESS_DETAILS, legalEntityResponse, entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type])
27167
+ entityAssociations: filterOutUnwantedAssociationsIfRootLE(TaskTypes.BUSINESS_DETAILS, legalEntityResponse, ((_e = data.companyStructure) == null ? void 0 : _e.accountHolder) || accountHolder)
27036
27168
  };
27037
27169
  try {
27038
27170
  userEvents.addEvent(BusinessDetailsEvents.TASK_SUBMIT, {
@@ -27104,7 +27236,6 @@ function BusinessDetailsDropinComponent({
27104
27236
  parentLegalEntity,
27105
27237
  trackingConfig,
27106
27238
  capabilities,
27107
- accountHolder,
27108
27239
  taskName,
27109
27240
  hideDropinLayout,
27110
27241
  homeButtonLabel,
@@ -27126,7 +27257,7 @@ function BusinessDetailsDropinComponent({
27126
27257
  handleClearCompanyData,
27127
27258
  onTypeSwitch
27128
27259
  }) {
27129
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
27260
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
27130
27261
  const {
27131
27262
  state: {
27132
27263
  currentState
@@ -27147,6 +27278,10 @@ function BusinessDetailsDropinComponent({
27147
27278
  });
27148
27279
  }, []);
27149
27280
  const formRef = useRef(null);
27281
+ const {
27282
+ accountHolder,
27283
+ setAccountHolder
27284
+ } = useCoreContext();
27150
27285
  const {
27151
27286
  showToast,
27152
27287
  clearToasts
@@ -27165,8 +27300,8 @@ function BusinessDetailsDropinComponent({
27165
27300
  var _a2;
27166
27301
  return ((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.country) ?? country;
27167
27302
  }, [(_a = currentState.data.basicInformation) == null ? void 0 : _a.country, country]);
27168
- const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
27169
- const [trustedFields2, setTrustedFields] = useState(legalEntityResponse.trustedFields);
27303
+ const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled && accountHolder ? accountHolder : void 0));
27304
+ const [trustedFields, setTrustedFields] = useState(legalEntityResponse.trustedFields);
27170
27305
  const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
27171
27306
  useEffect(() => {
27172
27307
  var _a2;
@@ -27211,35 +27346,38 @@ function BusinessDetailsDropinComponent({
27211
27346
  isExperimentEnabled
27212
27347
  }), [currentCountry, currentState.data, isExperimentEnabled, taskType]);
27213
27348
  const initialForms = useMemo(() => getForms(currentCountry), [currentCountry]);
27214
- const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, initialForms, (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [], (currentProblems == null ? void 0 : currentProblems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, isExperimentEnabled) : [], customRules, {}, {}, trustedFields2), [fieldConfigurations, initialForms, currentProblems == null ? void 0 : currentProblems.remediationActions, currentProblems == null ? void 0 : currentProblems.missingData, legalEntityResponse, isExperimentEnabled, customRules, trustedFields2]);
27349
+ const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, initialForms, (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [], (currentProblems == null ? void 0 : currentProblems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, isExperimentEnabled) : [], customRules, {}, {}, trustedFields), [fieldConfigurations, initialForms, currentProblems == null ? void 0 : currentProblems.remediationActions, currentProblems == null ? void 0 : currentProblems.missingData, legalEntityResponse, isExperimentEnabled, customRules, trustedFields]);
27215
27350
  const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_d = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _d.type) && accountHolder !== "aTrust";
27216
- const isSkippingCompanyRegistrationDocument = currentCountry === "CA" && ((_e = currentState.data.additionalInformation) == null ? void 0 : _e.registrationNumber) && ((_f = currentState.valid.additionalInformation) == null ? void 0 : _f.registrationNumber) && !((_g = currentState.data.companyRegistrationDocument) == null ? void 0 : _g.registrationDocument);
27217
27351
  const forms2 = useMemo(() => {
27218
27352
  const requiredForms = getRequiredForms(initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
27219
27353
  const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, currentProblems);
27220
- return removeConditionalForms(validityAddedForms, currentProblems, currentCountry !== "US" ? isSkippingCompanyStructure : !showCompanyStructure, isSkippingCompanyRegistrationDocument);
27221
- }, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure, isSkippingCompanyRegistrationDocument]);
27354
+ return removeConditionalForms(validityAddedForms, currentCountry !== "US" ? isSkippingCompanyStructure : !showCompanyStructure);
27355
+ }, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure]);
27222
27356
  const canSubmitForm = useMemo(() => canSubmit$3(currentState.data) && hasDataChanged(initialData, currentState.data), [initialData, currentState.data]);
27223
27357
  const summaryData = useMemo(() => ({
27224
27358
  data: formatDataForSummary$1(currentState.data, forms2, derivedProps == null ? void 0 : derivedProps.labels, i18n),
27225
27359
  omittedKeys: ["operationalAddressIsSame"]
27226
27360
  }), [currentState.data, derivedProps == null ? void 0 : derivedProps.labels, forms2, i18n]);
27227
- const submitTask = useCallback(() => submit({
27228
- data: currentState.data,
27229
- legalEntityResponse,
27230
- isTargetLegalEntityType: Boolean(isTargetLegalEntityType),
27231
- baseTrackingPayload,
27232
- problems: currentProblems,
27233
- forms: forms2,
27234
- documentUtils,
27235
- i18n,
27236
- setLoadingStatus,
27237
- setProblems: setCurrentProblems,
27238
- showToast,
27239
- clearToasts,
27240
- handleUpdateLegalEntity,
27241
- onExternalSubmit
27242
- }), [baseTrackingPayload, clearToasts, currentState.data, documentUtils, forms2, handleUpdateLegalEntity, i18n, isTargetLegalEntityType, legalEntityResponse, onExternalSubmit, currentProblems, showToast]);
27361
+ const submitTask = useCallback(() => {
27362
+ var _a2;
27363
+ setAccountHolder(((_a2 = currentState.data.companyStructure) == null ? void 0 : _a2.accountHolder) || accountHolder);
27364
+ return submit({
27365
+ data: currentState.data,
27366
+ legalEntityResponse,
27367
+ isTargetLegalEntityType: Boolean(isTargetLegalEntityType),
27368
+ baseTrackingPayload,
27369
+ problems: currentProblems,
27370
+ forms: forms2,
27371
+ documentUtils,
27372
+ i18n,
27373
+ setLoadingStatus,
27374
+ setProblems: setCurrentProblems,
27375
+ showToast,
27376
+ clearToasts,
27377
+ handleUpdateLegalEntity,
27378
+ onExternalSubmit
27379
+ });
27380
+ }, [baseTrackingPayload, clearToasts, currentState.data, documentUtils, forms2, handleUpdateLegalEntity, i18n, isTargetLegalEntityType, legalEntityResponse, onExternalSubmit, currentProblems, showToast]);
27243
27381
  const {
27244
27382
  handleNextClick,
27245
27383
  handleBackClick,
@@ -27264,10 +27402,10 @@ function BusinessDetailsDropinComponent({
27264
27402
  clearTrustedBusinessData,
27265
27403
  resetBusinessData,
27266
27404
  resetTinVerification,
27267
- isSearching,
27268
- isFetching,
27269
- isVerifying,
27270
- isClearingTrustedData,
27405
+ searching,
27406
+ fetching,
27407
+ verifying,
27408
+ resettingTrustedData,
27271
27409
  currentSearchName,
27272
27410
  searchResults,
27273
27411
  invalidTin,
@@ -27296,34 +27434,34 @@ function BusinessDetailsDropinComponent({
27296
27434
  return tinMatch ? handleNextClick() : void 0;
27297
27435
  }
27298
27436
  }
27299
- }, [currentCountry, (_h = currentState.data.basicInformation) == null ? void 0 : _h.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
27437
+ }, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
27300
27438
  useEffect(() => {
27301
- if (searchResults && !searchResults.length || isSearching === "error") {
27439
+ if (searchResults && !searchResults.length || searching === "error") {
27302
27440
  setShowCompanyStructure(true);
27303
27441
  }
27304
- }, [searchResults, isSearching]);
27442
+ }, [searchResults, searching]);
27305
27443
  useEffect(() => {
27306
27444
  var _a2;
27307
27445
  if (((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.businessName) !== currentSearchName) {
27308
27446
  setShowCompanyStructure(false);
27309
27447
  resetBusinessData();
27310
27448
  }
27311
- }, [currentSearchName, (_i = currentState.data.basicInformation) == null ? void 0 : _i.businessName]);
27449
+ }, [currentSearchName, (_f = currentState.data.basicInformation) == null ? void 0 : _f.businessName]);
27312
27450
  const [showBusinessSelection, setShowBusinessSelection] = useState(false);
27313
27451
  const isBusinessSelection = useMemo(() => showBusinessSelection && activeForm.formId === "basicInformation", [activeForm.formId, showBusinessSelection]);
27314
27452
  const hideBack = useMemo(() => {
27315
27453
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return hideBackButton;
27316
27454
  if (isBusinessSelection) {
27317
- return isSearching === "loading" || isFetching === "loading" || isVerifying === "loading" || isClearingTrustedData === "loading" ? hideBackButton : false;
27455
+ return searching === "loading" || fetching === "loading" || verifying === "loading" || resettingTrustedData === "loading" ? hideBackButton : false;
27318
27456
  }
27319
27457
  return hideBackButton;
27320
- }, [currentCountry, hideBackButton, isBusinessSelection, isSearching, isFetching, isVerifying, isClearingTrustedData]);
27458
+ }, [currentCountry, hideBackButton, isBusinessSelection, searching, fetching, verifying, resettingTrustedData]);
27321
27459
  const hideHome = useMemo(() => {
27322
27460
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return hideHomeButton;
27323
27461
  if (isBusinessSelection) {
27324
- return isSearching === "loading" || isFetching === "loading" || isVerifying === "loading" || isClearingTrustedData === "loading" ? true : hideHomeButton;
27462
+ return searching === "loading" || fetching === "loading" || verifying === "loading" || resettingTrustedData === "loading" ? true : hideHomeButton;
27325
27463
  }
27326
- }, [currentCountry, hideHomeButton, isBusinessSelection, isSearching, isFetching, isVerifying, isClearingTrustedData]);
27464
+ }, [currentCountry, hideHomeButton, isBusinessSelection, searching, fetching, verifying, resettingTrustedData]);
27327
27465
  const goToForm = useCallback((index) => {
27328
27466
  var _a2, _b2, _c2, _d2, _e2, _f2;
27329
27467
  const form = forms2[index].formId;
@@ -27339,7 +27477,7 @@ function BusinessDetailsDropinComponent({
27339
27477
  return gotoFormByFormIndex(index);
27340
27478
  }
27341
27479
  case "additionalInformation": {
27342
- if (verifiedBusiness) return gotoFormByFormIndex(index);
27480
+ if (verifiedBusiness || activeForm.formId !== "basicInformation") return gotoFormByFormIndex(index);
27343
27481
  if (!isBusinessSelection) {
27344
27482
  if (!!((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.businessName) && !!((_b2 = currentState.data.basicInformation) == null ? void 0 : _b2.country) && !!((_c2 = currentState.data.basicInformation) == null ? void 0 : _c2.stateOrProvince)) {
27345
27483
  findBusiness({
@@ -27355,7 +27493,7 @@ function BusinessDetailsDropinComponent({
27355
27493
  default:
27356
27494
  return gotoFormByFormIndex(index);
27357
27495
  }
27358
- }, [canSubmitForm, currentCountry, (_j = currentState.data.basicInformation) == null ? void 0 : _j.businessName, (_k = currentState.data.basicInformation) == null ? void 0 : _k.country, (_l = currentState.data.basicInformation) == null ? void 0 : _l.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness]);
27496
+ }, [canSubmitForm, currentCountry, (_g = currentState.data.basicInformation) == null ? void 0 : _g.businessName, (_h = currentState.data.basicInformation) == null ? void 0 : _h.country, (_i = currentState.data.basicInformation) == null ? void 0 : _i.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness, activeForm.formId]);
27359
27497
  const nextClick = useCallback(() => {
27360
27498
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27361
27499
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
@@ -27378,7 +27516,7 @@ function BusinessDetailsDropinComponent({
27378
27516
  default:
27379
27517
  return handleNextClick();
27380
27518
  }
27381
- }, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_m = currentState.validityByForm) == null ? void 0 : _m.basicInformation, (_n = currentState.data.basicInformation) == null ? void 0 : _n.businessName, (_o = currentState.data.basicInformation) == null ? void 0 : _o.country, (_p = currentState.data.basicInformation) == null ? void 0 : _p.stateOrProvince, isBusinessSelection, findBusiness]);
27519
+ }, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_j = currentState.validityByForm) == null ? void 0 : _j.basicInformation, (_k = currentState.data.basicInformation) == null ? void 0 : _k.businessName, (_l = currentState.data.basicInformation) == null ? void 0 : _l.country, (_m = currentState.data.basicInformation) == null ? void 0 : _m.stateOrProvince, isBusinessSelection, findBusiness]);
27382
27520
  const backClick = useCallback(() => {
27383
27521
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleNextClick();
27384
27522
  switch (activeForm.formId) {
@@ -27386,12 +27524,12 @@ function BusinessDetailsDropinComponent({
27386
27524
  return showBusinessSelection ? setShowBusinessSelection(false) : void 0;
27387
27525
  }
27388
27526
  case "companyStructure": {
27389
- if (isSearching === "error") {
27527
+ if (searching === "error") {
27390
27528
  setShowBusinessSelection(false);
27391
27529
  setShowCompanyStructure(false);
27392
27530
  return handleBackClick == null ? void 0 : handleBackClick();
27393
27531
  }
27394
- if (isSearching !== "loading" && searchResults && !searchResults.length) {
27532
+ if (searching !== "loading" && searchResults && !searchResults.length) {
27395
27533
  setShowBusinessSelection(false);
27396
27534
  } else if (!verifiedBusiness) setShowCompanyStructure(false);
27397
27535
  return handleBackClick == null ? void 0 : handleBackClick();
@@ -27405,13 +27543,13 @@ function BusinessDetailsDropinComponent({
27405
27543
  default:
27406
27544
  return handleBackClick == null ? void 0 : handleBackClick();
27407
27545
  }
27408
- }, [activeForm.formId, country, handleBackClick, handleNextClick, isSearching, searchResults, showBusinessSelection, verifiedBusiness]);
27546
+ }, [activeForm.formId, country, handleBackClick, handleNextClick, searching, searchResults, showBusinessSelection, verifiedBusiness]);
27409
27547
  const proceedToManualDataEntry = useCallback(async () => {
27410
27548
  await clearTrustedBusinessData().then(() => setShowCompanyStructure(true));
27411
27549
  }, [clearTrustedBusinessData]);
27412
27550
  useEffect(() => {
27413
27551
  var _a2;
27414
- if ((trustedFields2 == null ? void 0 : trustedFields2.length) && ((_a2 = legalEntityResponse.organization) == null ? void 0 : _a2.registeredAddress.country) !== currentCountry) {
27552
+ if ((trustedFields == null ? void 0 : trustedFields.length) && ((_a2 = legalEntityResponse.organization) == null ? void 0 : _a2.registeredAddress.country) !== currentCountry) {
27415
27553
  setTrustedFields(void 0);
27416
27554
  }
27417
27555
  }, [currentCountry]);
@@ -27456,10 +27594,10 @@ function BusinessDetailsDropinComponent({
27456
27594
  invalidTin,
27457
27595
  resetTinVerification,
27458
27596
  verifiedBusiness,
27459
- isSearching,
27460
- isFetching,
27461
- isVerifying,
27462
- isClearingTrustedData,
27597
+ searching,
27598
+ fetching,
27599
+ verifying,
27600
+ resettingTrustedData,
27463
27601
  searchForBusiness,
27464
27602
  fetchBusinessData,
27465
27603
  verifyBusinessData,
@@ -27520,9 +27658,9 @@ function CompanyDropinComponent({
27520
27658
  handleHomeClick,
27521
27659
  onTypeSwitch,
27522
27660
  onChange,
27523
- trustedFields: trustedFields2
27661
+ trustedFields
27524
27662
  }) {
27525
- var _a, _b, _c, _d, _e;
27663
+ var _a, _b;
27526
27664
  const {
27527
27665
  accountHolder,
27528
27666
  setAccountHolder
@@ -27601,12 +27739,11 @@ function CompanyDropinComponent({
27601
27739
  onChange == null ? void 0 : onChange(currentState);
27602
27740
  }, [currentState]);
27603
27741
  const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type) && accountHolder !== "aTrust";
27604
- const isSkippingCompanyRegistrationDocument = country === "CA" && ((_c = currentState.data.companyRegistrationDetails) == null ? void 0 : _c.registrationNumber) && ((_d = currentState.valid.companyRegistrationDetails) == null ? void 0 : _d.registrationNumber) && !((_e = currentState.data.companyRegistrationDocument) == null ? void 0 : _e.registrationDocument);
27605
27742
  const forms2 = useMemo(() => {
27606
27743
  const requiredForms = getRequiredForms(companyForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
27607
27744
  const validityAddedForms = addValidityToForms(requiredForms, formValidity, problems);
27608
- return removeConditionalForms(validityAddedForms, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument);
27609
- }, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument]);
27745
+ return removeConditionalForms(validityAddedForms, isSkippingCompanyStructure);
27746
+ }, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, problems, isSkippingCompanyStructure]);
27610
27747
  const submitDocuments2 = async ({
27611
27748
  forms: forms22,
27612
27749
  legalEntity,
@@ -27757,7 +27894,7 @@ function CompanyDropinComponent({
27757
27894
  }, []);
27758
27895
  const datasetUtils = datasetUtilities(i18n.locale);
27759
27896
  const formatDataForSummary2 = (data2, forms22) => {
27760
- var _a2, _b2, _c2, _d2, _e2, _f, _g;
27897
+ var _a2, _b2, _c, _d, _e, _f, _g;
27761
27898
  let summaryData = cloneObject(data2);
27762
27899
  if (summaryData.companyNameAndCountry) {
27763
27900
  if (isCountryOfGoverningLawEnabled) {
@@ -27772,14 +27909,14 @@ function CompanyDropinComponent({
27772
27909
  const companyType = (_b2 = companyTypes.find((type) => type.id === summaryData.companyType.entityType)) == null ? void 0 : _b2.name;
27773
27910
  summaryData.companyType.entityType = i18n.get(companyType);
27774
27911
  }
27775
- if ((_c2 = summaryData.companyType) == null ? void 0 : _c2.accountHolder) {
27912
+ if ((_c = summaryData.companyType) == null ? void 0 : _c.accountHolder) {
27776
27913
  summaryData.companyType.accountHolder = i18n.get(summaryData.companyType.accountHolder);
27777
27914
  }
27778
- if ((_d2 = summaryData.companyRegistrationAddress) == null ? void 0 : _d2.registrationAddress) {
27915
+ if ((_d = summaryData.companyRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
27779
27916
  summaryData.companyRegistrationAddress.hasInnerForms = true;
27780
27917
  summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
27781
27918
  }
27782
- if ((_e2 = summaryData.companyRegistrationAddress) == null ? void 0 : _e2.operationalAddress) {
27919
+ if ((_e = summaryData.companyRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
27783
27920
  summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
27784
27921
  }
27785
27922
  if ((_f = summaryData.companyRegistrationDetails) == null ? void 0 : _f.vatAbsenceReason) {
@@ -27861,7 +27998,7 @@ function CompanyDropinComponent({
27861
27998
  ref: formRef,
27862
27999
  shouldValidate,
27863
28000
  isTopLevelEntity: taskType === TaskTypes.COMPANY,
27864
- readOnlyFields: trustedFields2
28001
+ readOnlyFields: trustedFields
27865
28002
  })
27866
28003
  });
27867
28004
  }
@@ -28874,7 +29011,8 @@ function useCompanySearchTaskSubmit({
28874
29011
  setProblems,
28875
29012
  setLoadingStatus,
28876
29013
  onExternalSubmit,
28877
- handleUpdateLegalEntity
29014
+ handleUpdateLegalEntity,
29015
+ accountHolder
28878
29016
  }) {
28879
29017
  const {
28880
29018
  showToast,
@@ -28919,7 +29057,7 @@ function useCompanySearchTaskSubmit({
28919
29057
  const submit2 = useCallback(async ({
28920
29058
  data
28921
29059
  }) => {
28922
- var _a, _b, _c, _d;
29060
+ var _a, _b, _c, _d, _e;
28923
29061
  setLoadingStatus("loading");
28924
29062
  const trackingPayload = {
28925
29063
  companyStructure: ((_a = data.companyStructure) == null ? void 0 : _a.entityType) ?? null,
@@ -28931,7 +29069,7 @@ function useCompanySearchTaskSubmit({
28931
29069
  const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
28932
29070
  const legalEntity = {
28933
29071
  ...mapCompanySearchSchemaToLegalEntity(filteredData),
28934
- entityAssociations: filterOutUnwantedAssociationsIfRootLE(task, legalEntityResponse, entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type])
29072
+ entityAssociations: filterOutUnwantedAssociationsIfRootLE(task, legalEntityResponse, (((_e = data.companyStructure) == null ? void 0 : _e.accountHolder) || accountHolder) ?? void 0)
28935
29073
  };
28936
29074
  try {
28937
29075
  userEvents.addEvent(CompanySearchEvents.TASK_SUBMIT, {
@@ -29138,7 +29276,6 @@ function CompanySearchDropinComponent({
29138
29276
  taskName,
29139
29277
  hideDropinLayout,
29140
29278
  homeButtonLabel,
29141
- accountHolder,
29142
29279
  onChange,
29143
29280
  onSubmit: onExternalSubmit,
29144
29281
  handleHomeClick,
@@ -29154,9 +29291,9 @@ function CompanySearchDropinComponent({
29154
29291
  handleRefreshCompanyDataset,
29155
29292
  handleVerifyTin,
29156
29293
  onTypeSwitch,
29157
- trustedFields: trustedFields2
29294
+ trustedFields
29158
29295
  }) {
29159
- var _a, _b, _c, _d, _e, _f, _g;
29296
+ var _a, _b, _c, _d;
29160
29297
  const {
29161
29298
  state: {
29162
29299
  currentState
@@ -29165,6 +29302,10 @@ function CompanySearchDropinComponent({
29165
29302
  useEffect(() => {
29166
29303
  onChange == null ? void 0 : onChange(currentState);
29167
29304
  }, [currentState, onChange]);
29305
+ const {
29306
+ accountHolder,
29307
+ setAccountHolder
29308
+ } = useCoreContext();
29168
29309
  const formRef = useRef(null);
29169
29310
  const {
29170
29311
  showToast
@@ -29180,7 +29321,7 @@ function CompanySearchDropinComponent({
29180
29321
  } = useExperimentsContext();
29181
29322
  const isNewEntryFlowEnabled = useEnableNewEntryFlow();
29182
29323
  const [loadingStatus, setLoadingStatus] = useState("success");
29183
- const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
29324
+ const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled && accountHolder ? accountHolder : void 0));
29184
29325
  const country = useMemo(() => {
29185
29326
  var _a2;
29186
29327
  return ((_a2 = currentState.data.companyBasics) == null ? void 0 : _a2.country) ?? parentCountry;
@@ -29241,12 +29382,11 @@ function CompanySearchDropinComponent({
29241
29382
  }
29242
29383
  }, [fieldConfigurations, problems == null ? void 0 : problems.remediationActions, problems == null ? void 0 : problems.missingData, legalEntityResponse, isExperimentEnabled, customRules, country]);
29243
29384
  const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_d = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _d.type) && accountHolder !== "aTrust";
29244
- const isSkippingCompanyRegistrationDocument = country === "CA" && ((_e = currentState.data.companyOtherDetails) == null ? void 0 : _e.registrationNumber) && ((_f = currentState.valid.companyOtherDetails) == null ? void 0 : _f.registrationNumber) && !((_g = currentState.data.companyRegistrationDocument) == null ? void 0 : _g.registrationDocument);
29245
29385
  const forms$1 = useMemo(() => {
29246
29386
  const requiredForms = getRequiredForms(forms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
29247
29387
  const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, problems);
29248
- return removeConditionalForms(validityAddedForms, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument);
29249
- }, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, problems, isSkippingCompanyStructure, isSkippingCompanyRegistrationDocument]);
29388
+ return removeConditionalForms(validityAddedForms, isSkippingCompanyStructure);
29389
+ }, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, problems, isSkippingCompanyStructure]);
29250
29390
  const summaryData = useMemo(() => ({
29251
29391
  data: formatDataForSummary(currentState.data, forms$1, derivedProps == null ? void 0 : derivedProps.labels, i18n),
29252
29392
  omittedKeys: ["operationalAddressIsSame"]
@@ -29271,7 +29411,8 @@ function CompanySearchDropinComponent({
29271
29411
  setProblems,
29272
29412
  setLoadingStatus,
29273
29413
  onExternalSubmit,
29274
- handleUpdateLegalEntity
29414
+ handleUpdateLegalEntity,
29415
+ accountHolder
29275
29416
  });
29276
29417
  const {
29277
29418
  handleNextClick,
@@ -29309,9 +29450,13 @@ function CompanySearchDropinComponent({
29309
29450
  activeForm,
29310
29451
  validateForm: () => setShouldValidate(true),
29311
29452
  baseTrackingPayload,
29312
- onSubmit: () => submit2({
29313
- data: currentState.data
29314
- }),
29453
+ onSubmit: () => {
29454
+ var _a2;
29455
+ setAccountHolder(((_a2 = currentState.data.companyStructure) == null ? void 0 : _a2.accountHolder) || accountHolder);
29456
+ return submit2({
29457
+ data: currentState.data
29458
+ });
29459
+ },
29315
29460
  problems,
29316
29461
  canSubmit: canSubmitForm,
29317
29462
  summary: summaryData,
@@ -29338,7 +29483,7 @@ function CompanySearchDropinComponent({
29338
29483
  handleGetCompanyDataset,
29339
29484
  handleRefreshCompanyDataset,
29340
29485
  handleVerifyTin,
29341
- readOnlyFields: trustedFields2
29486
+ readOnlyFields: trustedFields
29342
29487
  })
29343
29488
  });
29344
29489
  }
@@ -29438,10 +29583,9 @@ const useHasSeenSingpassSelection = ({
29438
29583
  setHasSeenSingpassSelection
29439
29584
  };
29440
29585
  };
29441
- const getTrustedFieldsByProvider = (provider, trustedFields2) => trustedFields2.find((tf) => tf.provider === provider);
29442
- const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
29586
+ const parseTrustedFieldsIntoReadOnlyFields = (trustedFields, mapping) => {
29443
29587
  const formFieldsMapped = [];
29444
- trustedFields2.fields.forEach((field) => {
29588
+ trustedFields.forEach((field) => {
29445
29589
  for (const [key, value] of Object.entries(mapping)) {
29446
29590
  if (value === field) {
29447
29591
  formFieldsMapped.push(key);
@@ -29463,17 +29607,6 @@ const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
29463
29607
  });
29464
29608
  return readOnlyFields;
29465
29609
  };
29466
- const trustedFields = ({
29467
- fields,
29468
- trustedFieldsProvider,
29469
- apiMapping
29470
- }) => {
29471
- if (!fields || !trustedFieldsProvider || !apiMapping) {
29472
- return {};
29473
- }
29474
- const trustedFieldsOfProvider = getTrustedFieldsByProvider(trustedFieldsProvider, fields);
29475
- return trustedFieldsOfProvider ? parseTrustedFieldsIntoReadOnlyFields(trustedFieldsOfProvider, apiMapping) : {};
29476
- };
29477
29610
  const defaultSingpassState = {
29478
29611
  isLoading: false,
29479
29612
  isSuccess: false
@@ -29517,6 +29650,27 @@ const getApiMapping = (enableCompanySearchFlow, legalEntity) => {
29517
29650
  return companyComponentsKeyMapping;
29518
29651
  }
29519
29652
  };
29653
+ const getTrustedEntityAssociations = (legalEntityTrustedFields) => {
29654
+ const rawTrustedEntityAssociations = legalEntityTrustedFields.filter((f) => f.startsWith("entityAssociations")) ?? [];
29655
+ const leIdMap = {};
29656
+ rawTrustedEntityAssociations.forEach((rtea) => {
29657
+ const [_, role, leId] = rtea.split(".");
29658
+ const trustedRole = role;
29659
+ if (!leIdMap[leId]) {
29660
+ leIdMap[leId] = {
29661
+ roles: [trustedRole]
29662
+ };
29663
+ } else {
29664
+ leIdMap[leId] = {
29665
+ roles: [...leIdMap[leId].roles, trustedRole]
29666
+ };
29667
+ }
29668
+ });
29669
+ return Object.keys(leIdMap).map((reference) => ({
29670
+ reference,
29671
+ types: leIdMap[reference].roles
29672
+ }));
29673
+ };
29520
29674
  const useSingpassMyInfoLogin = ({
29521
29675
  legalEntity,
29522
29676
  accountHolder,
@@ -29530,6 +29684,7 @@ const useSingpassMyInfoLogin = ({
29530
29684
  const isSingpassForIndividualsEnabled = isExperimentEnabled("ShowSingPassButtonForIndividuals");
29531
29685
  const enableCompanySearchFlow = isExperimentEnabled("EnableCompanySearchFlow");
29532
29686
  const apiMapping = getApiMapping(enableCompanySearchFlow, legalEntity);
29687
+ const legalEntityTrustedFields = legalEntity == null ? void 0 : legalEntity.trustedFields;
29533
29688
  const isEligibleForSingpass = useMemo(() => {
29534
29689
  if (!legalEntity) {
29535
29690
  return false;
@@ -29550,17 +29705,13 @@ const useSingpassMyInfoLogin = ({
29550
29705
  const isVanillaIndividual = legalEntityType === LegalEntityType.INDIVIDUAL && !hasSoleProprietor;
29551
29706
  return isVanillaOrganization && isSingpassForCompaniesEnabled || isVanillaIndividual && isSingpassForIndividualsEnabled;
29552
29707
  }, [legalEntity, accountHolder, handleOpenSingpassAuthorizationLink]);
29553
- const trustedFields$1 = useMemo(() => {
29554
- const legalEntityTrustedFields = legalEntity == null ? void 0 : legalEntity.trustedFields;
29555
- if (!isEligibleForSingpass || !legalEntityTrustedFields) {
29556
- return {};
29557
- }
29558
- return trustedFields({
29559
- fields: legalEntityTrustedFields,
29560
- trustedFieldsProvider: TrustedFieldsProvider.SINGPASS,
29561
- apiMapping
29562
- });
29563
- }, [legalEntity, isEligibleForSingpass, apiMapping]);
29708
+ const singpassTrustedFields = useMemo(() => {
29709
+ var _a;
29710
+ const allTrustedFields = isEligibleForSingpass && legalEntityTrustedFields ? legalEntityTrustedFields : [];
29711
+ return ((_a = allTrustedFields.find((tf) => tf.provider === TrustedFieldsProvider.SINGPASS)) == null ? void 0 : _a.fields) || [];
29712
+ }, [isEligibleForSingpass, legalEntity]);
29713
+ const trustedFields = useMemo(() => apiMapping ? parseTrustedFieldsIntoReadOnlyFields(singpassTrustedFields, apiMapping) : {}, [singpassTrustedFields, apiMapping]);
29714
+ const trustedEntityAssociations = useMemo(() => getTrustedEntityAssociations(singpassTrustedFields), [singpassTrustedFields]);
29564
29715
  const handleInitiateSingpassMyInfoLogin = async () => {
29565
29716
  if (handleOpenSingpassAuthorizationLink) {
29566
29717
  dispatch({
@@ -29605,7 +29756,8 @@ const useSingpassMyInfoLogin = ({
29605
29756
  handleSingpassMyInfoLoginSuccess,
29606
29757
  handleSingpassMyInfoLoginFailure,
29607
29758
  handleSingpassMyInfoLoginReset,
29608
- trustedFields: trustedFields$1
29759
+ trustedFields,
29760
+ trustedEntityAssociations
29609
29761
  };
29610
29762
  };
29611
29763
  const logger$m = createLogger("useAssociatedLegalArrangement");
@@ -30445,17 +30597,9 @@ function useDataMissingRemediations({
30445
30597
  }
30446
30598
  };
30447
30599
  }
30448
- const iconStatus = (current, min, max) => {
30449
- const isEmpty2 = current === 0;
30450
- const isWithinObligatoryRange = current === max || min > 0 && current >= min;
30451
- const isWithinConditionalRange = current >= min;
30452
- if (isEmpty2) {
30453
- return min > 0 ? "obligatoryEmpty" : "conditionalEmpty";
30454
- }
30455
- if (isWithinObligatoryRange) {
30456
- return "obligatoryFinished";
30457
- }
30458
- return isWithinConditionalRange ? "conditionalFinished" : "conditionalEmpty";
30600
+ const iconStatus = (current, min) => {
30601
+ const isSatisfied = current > 0 && current >= min;
30602
+ return isSatisfied ? "satisfied" : "empty";
30459
30603
  };
30460
30604
  const getEntityStatusRuleDescription = (country, currentTask, entityLabel) => currentTask === TaskTypes.TRUST_MEMBER_OVERVIEW ? TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel] : getDecisionMakerDescriptionMap(country)[entityLabel];
30461
30605
  const Status = ({
@@ -30831,67 +30975,26 @@ const EntityStatusIcon = ({
30831
30975
  status
30832
30976
  }) => {
30833
30977
  switch (status) {
30834
- case "obligatoryEmpty":
30978
+ case "empty":
30835
30979
  return jsx(Icon, {
30836
- name: "checkmark-small",
30837
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--obligatory",
30838
- testId: "obligatoryEmpty-icon"
30839
- });
30840
- case "conditionalEmpty":
30841
- return jsx(Icon, {
30842
- name: "checkmark-small",
30843
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--conditional",
30844
- testId: "conditionalEmpty-icon"
30845
- });
30846
- case "obligatoryFinished":
30847
- return jsx(Icon, {
30848
- name: "checkmark-small",
30849
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--obligatory-success",
30850
- testId: "obligatoryFinished-icon"
30980
+ name: "circle",
30981
+ className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
30982
+ testId: "empty-icon"
30851
30983
  });
30852
- case "conditionalFinished":
30984
+ case "satisfied":
30853
30985
  return jsx(Icon, {
30854
- name: "checkmark-small",
30855
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--conditional-success",
30856
- testId: "conditionalFinished-icon"
30986
+ name: "checkmark-circle-fill",
30987
+ className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--satisfied",
30988
+ testId: "satisfied-icon"
30857
30989
  });
30858
30990
  default:
30859
30991
  return jsx(Icon, {
30860
- name: "checkmark-small",
30861
- className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--conditional",
30862
- testId: "conditionalEmpty-icon"
30992
+ name: "circle",
30993
+ className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
30994
+ testId: "empty-icon"
30863
30995
  });
30864
30996
  }
30865
30997
  };
30866
- const EntityGuidanceLegend = () => {
30867
- const {
30868
- i18n
30869
- } = useI18nContext();
30870
- return jsxs("div", {
30871
- className: "adyen-kyc-entity-status__legend",
30872
- children: [jsxs("span", {
30873
- className: "adyen-kyc-entity-status__legend--rule",
30874
- children: [jsx(EntityStatusIcon, {
30875
- status: "obligatoryEmpty"
30876
- }), jsx("span", {
30877
- className: "adyen-kyc-entity-status--text",
30878
- dangerouslySetInnerHTML: {
30879
- __html: i18n.get("obligatory")
30880
- }
30881
- })]
30882
- }), jsxs("span", {
30883
- className: "adyen-kyc-entity-status__legend--rule",
30884
- children: [jsx(EntityStatusIcon, {
30885
- status: "conditionalEmpty"
30886
- }), jsx("span", {
30887
- className: "adyen-kyc-entity-status--text",
30888
- dangerouslySetInnerHTML: {
30889
- __html: i18n.get("requiredIfApplicable")
30890
- }
30891
- })]
30892
- })]
30893
- });
30894
- };
30895
30998
  const EntityGuidanceStatus = ({
30896
30999
  country,
30897
31000
  currentTask,
@@ -30927,8 +31030,7 @@ const DecisionMakersComponent = ({
30927
31030
  handleUpdateLegalEntity,
30928
31031
  navigateBackToTaskList,
30929
31032
  onDecisionMakerDelete,
30930
- disableAddDecisionMakers,
30931
- disableDeleteDecisionMakers
31033
+ trustedEntityAssociations
30932
31034
  }) => {
30933
31035
  var _a, _b;
30934
31036
  const {
@@ -31024,17 +31126,16 @@ const DecisionMakersComponent = ({
31024
31126
  children: [hasExpired && jsx(ExpiredBanner, {}), jsx(FormHeader, {
31025
31127
  heading: i18n.get("decisionMaker"),
31026
31128
  description: i18n.get("decisionMakerDescription")
31027
- }), jsx(EntityGuidanceLegend, {}), jsx("div", {
31129
+ }), jsx("div", {
31028
31130
  className: "adyen-kyc-decision-makers__container",
31029
31131
  children: availableDecisionMakers.map(({
31030
31132
  roleType,
31031
- min,
31032
- max
31133
+ min
31033
31134
  }) => jsx(EntityGuidanceStatus, {
31034
31135
  country: registeredCountry,
31035
31136
  currentTask: TaskTypes.DECISION_MAKER_OVERVIEW,
31036
31137
  entityLabel: roleType,
31037
- status: iconStatus(uniqueDecisionMakersPerType(roleType), min, max)
31138
+ status: iconStatus(uniqueDecisionMakersPerType(roleType), min)
31038
31139
  }, roleType))
31039
31140
  }), jsx(ContextGuidance, {
31040
31141
  page: "Decision makers",
@@ -31068,7 +31169,7 @@ const DecisionMakersComponent = ({
31068
31169
  removeEntity: () => {
31069
31170
  deleteDecisionMaker(decisionMaker);
31070
31171
  },
31071
- isRemoveDisabled: isRemoveDisabled || disableDeleteDecisionMakers,
31172
+ isRemoveDisabled: isRemoveDisabled || trustedEntityAssociations.some((ea) => ea.reference === decisionMaker.reference),
31072
31173
  handleIsRemoveDisabled: setIsRemoveDisabled
31073
31174
  }, decisionMaker.reference))
31074
31175
  }) : null, jsx(Button, {
@@ -31079,7 +31180,7 @@ const DecisionMakersComponent = ({
31079
31180
  icon: "plus",
31080
31181
  onClick: addDecisionMakerOnClick,
31081
31182
  label: i18n.get("addDecisionMaker"),
31082
- disabled: haveMaxDecisionMakers || disableAddDecisionMakers
31183
+ disabled: haveMaxDecisionMakers
31083
31184
  }), jsx(ActionBar, {
31084
31185
  onHome: () => {
31085
31186
  userEvents.addEvent("Saved decision makers list", {
@@ -32457,18 +32558,17 @@ const TrustMembersOverview = ({
32457
32558
  children: [hasExpired && jsx(ExpiredBanner, {}), jsx(FormHeader, {
32458
32559
  heading: i18n.get("trustMembers"),
32459
32560
  description: i18n.get("trustMembersDescription")
32460
- }), jsx(EntityGuidanceLegend, {}), jsx("div", {
32561
+ }), jsx("div", {
32461
32562
  className: "adyen-kyc-trust-members__container",
32462
32563
  children: trustMemberRequirements.map(({
32463
32564
  roleTypes,
32464
32565
  min,
32465
- max,
32466
32566
  label
32467
32567
  }) => jsx(EntityGuidanceStatus, {
32468
32568
  country: CountryCodes.Australia,
32469
32569
  currentTask: TaskTypes.TRUST_MEMBER_OVERVIEW,
32470
32570
  entityLabel: label,
32471
- status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min, max)
32571
+ status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min)
32472
32572
  }, label))
32473
32573
  }), jsx(ContextGuidance, {
32474
32574
  page: "Trust members",
@@ -32658,8 +32758,9 @@ function IndividualDropinComponent({
32658
32758
  hideNavigation = false,
32659
32759
  asModal = false,
32660
32760
  handleBackClick: externalBackClick,
32661
- trustedFields: trustedFields2,
32662
- trustedFieldsProvider
32761
+ trustedFields,
32762
+ trustedFieldsProvider,
32763
+ trustedRoles
32663
32764
  }) {
32664
32765
  var _a, _b, _c, _d;
32665
32766
  const {
@@ -32686,7 +32787,7 @@ function IndividualDropinComponent({
32686
32787
  let dataFromResponse = mapLegalEntityToIndividual(legalEntityResponse, isTargetLegalEntityType);
32687
32788
  const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
32688
32789
  let roleTypes = [];
32689
- const [newDecisionMaker, setNewDecisionMaker] = useState();
32790
+ const [newDecisionMaker] = useState();
32690
32791
  const [problems, setProblems] = useState(propProblems);
32691
32792
  const formRef = useRef(null);
32692
32793
  const [loadingStatus, setLoadingStatus] = useState("success");
@@ -32695,7 +32796,7 @@ function IndividualDropinComponent({
32695
32796
  const [country, setCountry] = useState(((_a = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _a.residencyCountry) ?? parentCountry);
32696
32797
  const [hideFooter, setHideFooter] = useState(false);
32697
32798
  const {
32698
- trustedFields: singpassTrustedFields
32799
+ trustedFields: associatedLegalEntityTrustedFields
32699
32800
  } = useSingpassMyInfoLogin({
32700
32801
  legalEntity: legalEntityResponse,
32701
32802
  accountHolder,
@@ -32820,7 +32921,6 @@ function IndividualDropinComponent({
32820
32921
  throw new Error("Provide handler to create legalEntity");
32821
32922
  }
32822
32923
  updatedLegalEntity = await handleCreateLegalEntity(legalEntity);
32823
- setNewDecisionMaker(legalEntity);
32824
32924
  userEvents.addEvent("Added decision maker", {
32825
32925
  segmentation: {
32826
32926
  ...baseTrackingPayload,
@@ -32944,7 +33044,8 @@ function IndividualDropinComponent({
32944
33044
  }
32945
33045
  });
32946
33046
  const accountHolderToEvaluated = ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder) || accountHolder;
32947
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated ?? void 0);
33047
+ const filteredEntityAssociation = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated || void 0);
33048
+ legalEntity.entityAssociations = filteredEntityAssociation;
32948
33049
  const createdLegalEntity = await submitLegalEntity({
32949
33050
  dataSubmitted,
32950
33051
  legalEntity,
@@ -33155,8 +33256,9 @@ function IndividualDropinComponent({
33155
33256
  shouldValidate,
33156
33257
  accountHolder,
33157
33258
  parentLegalEntity,
33158
- trustedFields: !parentLegalEntity ? trustedFields2 : singpassTrustedFields,
33159
- trustedFieldsProvider
33259
+ trustedFields: !parentLegalEntity ? trustedFields : associatedLegalEntityTrustedFields,
33260
+ trustedFieldsProvider,
33261
+ trustedRoles
33160
33262
  })
33161
33263
  });
33162
33264
  }
@@ -34682,7 +34784,10 @@ function ServiceAgreementDropinComponent({
34682
34784
  taskType,
34683
34785
  serviceAgreementTypes,
34684
34786
  serviceAgreementAcceptanceInfos,
34685
- trackingConfig
34787
+ trackingConfig,
34788
+ asEmbedded = false,
34789
+ asModal = false,
34790
+ handleCloseClick
34686
34791
  }) {
34687
34792
  var _a, _b;
34688
34793
  const {
@@ -34966,7 +35071,7 @@ function ServiceAgreementDropinComponent({
34966
35071
  text: i18n.get("signed")
34967
35072
  })]
34968
35073
  })
34969
- }), jsx(ActionBar, {
35074
+ }), !asEmbedded && jsx(ActionBar, {
34970
35075
  onHome: goHome,
34971
35076
  homeButtonLabel: i18n.get("goToOverview"),
34972
35077
  onNext: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1),
@@ -34977,10 +35082,31 @@ function ServiceAgreementDropinComponent({
34977
35082
  backButtonLabel: i18n.get("previous")
34978
35083
  })]
34979
35084
  });
35085
+ const currentStep = signedForms.length;
35086
+ const totalSteps = forms2.length;
35087
+ const footer = jsx(EmbeddedActionBar, {
35088
+ left: jsx(StepProgressIndicator, {
35089
+ activeStepIndex: currentStep ?? 0,
35090
+ stepsCount: totalSteps ?? 3,
35091
+ circles: true,
35092
+ thick: true
35093
+ }),
35094
+ right: (
35095
+ // The button is either forcing the user to Sign or going Next, never both
35096
+ jsx(Button, {
35097
+ secondary: !canSign,
35098
+ label: i18n.get(canSign ? "signAndContinue" : "next"),
35099
+ onClick: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1)
35100
+ })
35101
+ )
35102
+ });
34980
35103
  return jsx(DropinLayout, {
35104
+ showAsModal: asModal,
35105
+ onClose: handleCloseClick,
34981
35106
  content: jsxs(Fragment, {
34982
- children: [sidebar, content]
34983
- })
35107
+ children: [!asEmbedded && sidebar, content]
35108
+ }),
35109
+ footer: asEmbedded ? footer : void 0
34984
35110
  });
34985
35111
  }
34986
35112
  const parseConfiguration$2 = ({
@@ -35739,7 +35865,7 @@ function DropinComposerComponent({
35739
35865
  onNavigate = noop,
35740
35866
  ...args
35741
35867
  }) {
35742
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
35868
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
35743
35869
  const {
35744
35870
  contextCountry,
35745
35871
  accountHolder,
@@ -35783,13 +35909,14 @@ function DropinComposerComponent({
35783
35909
  handleSingpassMyInfoLoginSuccess,
35784
35910
  handleSingpassMyInfoLoginFailure,
35785
35911
  handleSingpassMyInfoLoginReset,
35786
- trustedFields: singpassTrustedFields
35912
+ trustedFields: singpassTrustedFields,
35913
+ trustedEntityAssociations
35787
35914
  } = useSingpassMyInfoLogin({
35788
35915
  legalEntity: rootLegalEntity,
35789
35916
  accountHolder,
35790
35917
  handleOpenSingpassAuthorizationLink
35791
35918
  });
35792
- const hasUsedSingpass = Boolean(Object.keys(singpassTrustedFields).length);
35919
+ const singpassTabRef = useRef(null);
35793
35920
  const rootLegalEntityCountry = getLegalEntityCountry(rootLegalEntity);
35794
35921
  const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
35795
35922
  const {
@@ -36101,7 +36228,8 @@ function DropinComposerComponent({
36101
36228
  try {
36102
36229
  const authUrl = await handleInitiateSingpassMyInfoLogin();
36103
36230
  setHasSeenSingpassSelection(true);
36104
- window.open(authUrl, "_blank").focus();
36231
+ singpassTabRef.current = window.open(authUrl, "_blank");
36232
+ singpassTabRef.current.focus();
36105
36233
  } catch (e) {
36106
36234
  logger$h.error(e);
36107
36235
  handleSingpassMyInfoLoginFailure(e);
@@ -36339,7 +36467,8 @@ function DropinComposerComponent({
36339
36467
  onClick: async () => {
36340
36468
  try {
36341
36469
  const authUrl = await handleInitiateSingpassMyInfoLogin();
36342
- window.open(authUrl, "_blank").focus();
36470
+ singpassTabRef.current = window.open(authUrl);
36471
+ singpassTabRef.current.focus();
36343
36472
  } catch (e) {
36344
36473
  logger$h.error(e);
36345
36474
  handleSingpassMyInfoLoginFailure(e);
@@ -36353,6 +36482,7 @@ function DropinComposerComponent({
36353
36482
  if (isSuccessful) {
36354
36483
  handleSingpassMyInfoLoginSuccess();
36355
36484
  await refreshLegalEntity();
36485
+ singpassTabRef.current.close();
36356
36486
  } else {
36357
36487
  handleSingpassMyInfoLoginFailure(legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? "weCouldntConnectToMyinfo" : "weCouldntConnectToMyinfoBusiness");
36358
36488
  }
@@ -36429,8 +36559,7 @@ function DropinComposerComponent({
36429
36559
  navigateBackToTaskList: navigateBack,
36430
36560
  onDecisionMakerDelete: refreshLegalEntity,
36431
36561
  capabilityProblems,
36432
- disableAddDecisionMakers: hasUsedSingpass,
36433
- disableDeleteDecisionMakers: hasUsedSingpass
36562
+ trustedEntityAssociations
36434
36563
  });
36435
36564
  case TaskTypes.INDIVIDUAL:
36436
36565
  return jsx(IndividualDropinComponent, {
@@ -36499,7 +36628,8 @@ function DropinComposerComponent({
36499
36628
  handleGetIdVerificationStartCheck: args == null ? void 0 : args.handleGetIdVerificationStartCheck,
36500
36629
  handleOpenSingpassAuthorizationLink: args == null ? void 0 : args.handleOpenSingpassAuthorizationLink,
36501
36630
  trustedFields: singpassTrustedFields,
36502
- trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
36631
+ trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS,
36632
+ trustedRoles: ((_d = trustedEntityAssociations.find((ea) => ea.reference === (associatedLegalEntity == null ? void 0 : associatedLegalEntity.id))) == null ? void 0 : _d.types) || []
36503
36633
  });
36504
36634
  case TaskTypes.TRUST_MEMBER_COMPANY_OWNER:
36505
36635
  return jsx(IndividualDropinComponent, {
@@ -36580,8 +36710,7 @@ function DropinComposerComponent({
36580
36710
  handleFindAddress: args == null ? void 0 : args.handleFindAddress,
36581
36711
  onTypeSwitch: navigateToTypeSwitcher,
36582
36712
  isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
36583
- trustedFields: singpassTrustedFields,
36584
- trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
36713
+ trustedFields: singpassTrustedFields
36585
36714
  });
36586
36715
  case TaskTypes.COMPANY_SEARCH:
36587
36716
  return jsx(CompanySearchDropinComponent, {
@@ -36617,7 +36746,6 @@ function DropinComposerComponent({
36617
36746
  handleVerifyTin: args.handleVerifyTin,
36618
36747
  onTypeSwitch: navigateToTypeSwitcher,
36619
36748
  isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
36620
- accountHolder,
36621
36749
  trustedFields: singpassTrustedFields,
36622
36750
  trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
36623
36751
  });
@@ -36657,8 +36785,7 @@ function DropinComposerComponent({
36657
36785
  handleVerifyTin: args.handleVerifyTin,
36658
36786
  handleClearCompanyData: args.handleClearCompanyData,
36659
36787
  onTypeSwitch: navigateToTypeSwitcher,
36660
- isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
36661
- accountHolder
36788
+ isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
36662
36789
  })
36663
36790
  });
36664
36791
  case TaskTypes.TRUST_MEMBER_COMPANY:
@@ -36671,7 +36798,7 @@ function DropinComposerComponent({
36671
36798
  parentLegalEntity: associatedLegalArrangement,
36672
36799
  legalEntityResponse: associatedLegalEntity,
36673
36800
  capabilities: getCapabilities(legalEntityResponse),
36674
- problems: (_d = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _d[rootLegalEntity.id],
36801
+ problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[rootLegalEntity.id],
36675
36802
  onChange: componentOnChange,
36676
36803
  onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
36677
36804
  handleBackClick: navigateBack,
@@ -36689,7 +36816,7 @@ function DropinComposerComponent({
36689
36816
  },
36690
36817
  taskType: currentTask,
36691
36818
  taskName: currentTask === TaskTypes.PAYIN ? "payinDetails" : "payoutDetails",
36692
- problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _e[transferInstrument == null ? void 0 : transferInstrument.id],
36819
+ problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _f[transferInstrument == null ? void 0 : transferInstrument.id],
36693
36820
  transferInstrument,
36694
36821
  setTransferInstrument,
36695
36822
  legalEntityResponse: rootLegalEntity,
@@ -36718,7 +36845,7 @@ function DropinComposerComponent({
36718
36845
  topLevelLegalEntity: legalEntityResponse
36719
36846
  },
36720
36847
  taskType: TaskTypes.TRUST,
36721
- problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _f[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36848
+ problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36722
36849
  parentLegalEntity: rootLegalEntity,
36723
36850
  legalEntityResponse: associatedLegalArrangement,
36724
36851
  capabilities: getCapabilities(legalEntityResponse),
@@ -36726,7 +36853,7 @@ function DropinComposerComponent({
36726
36853
  onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
36727
36854
  handleHomeClick: navigateBack,
36728
36855
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
36729
- country: (((_g = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _g.countryOfGoverningLaw) || ((_h = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _h.registeredAddress.country)) ?? rootLegalEntityCountry,
36856
+ country: (((_h = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _h.countryOfGoverningLaw) || ((_i = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _i.registeredAddress.country)) ?? rootLegalEntityCountry,
36730
36857
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
36731
36858
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
36732
36859
  });
@@ -36772,12 +36899,12 @@ function DropinComposerComponent({
36772
36899
  parentLegalEntity: rootLegalEntity,
36773
36900
  legalEntityResponse: associatedLegalArrangement,
36774
36901
  capabilities: getCapabilities(legalEntityResponse),
36775
- problems: (_i = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _i[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36902
+ problems: (_j = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _j[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36776
36903
  onChange: componentOnChange,
36777
36904
  onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
36778
36905
  handleHomeClick: navigateBack,
36779
36906
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
36780
- country: (((_j = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _j.countryOfGoverningLaw) || ((_l = (_k = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _k.registeredAddress) == null ? void 0 : _l.country)) ?? rootLegalEntityCountry,
36907
+ country: (((_k = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _k.countryOfGoverningLaw) || ((_m = (_l = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _l.registeredAddress) == null ? void 0 : _m.country)) ?? rootLegalEntityCountry,
36781
36908
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
36782
36909
  handleFindAddress: args == null ? void 0 : args.handleFindAddress
36783
36910
  });
@@ -37520,7 +37647,8 @@ const useComponentApi = (rootLegalEntityId) => {
37520
37647
  const logger$g = createLogger("CreateContractingComponent");
37521
37648
  function CreateContractingComponent({
37522
37649
  legalEntityId,
37523
- modalView
37650
+ modalView,
37651
+ onClose
37524
37652
  }) {
37525
37653
  const {
37526
37654
  isModalView,
@@ -37531,45 +37659,61 @@ function CreateContractingComponent({
37531
37659
  }
37532
37660
  const {
37533
37661
  getLegalEntity: getLegalEntity2,
37534
- createLegalEntity: createLegalEntity2,
37535
- updateLegalEntity: updateLegalEntity2,
37536
- getDocument: getDocument2,
37537
- createDocument: createDocument2,
37538
- updateDocument: updateDocument2
37662
+ getServiceAgreement: getServiceAgreement2,
37663
+ getServiceAgreementStatus: getServiceAgreementStatus2,
37664
+ getServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos2,
37665
+ getAcceptedServiceAgreement: getAcceptedServiceAgreement2,
37666
+ downloadAcceptedServiceAgreement,
37667
+ downloadUnacceptedServiceAgreement
37539
37668
  } = useComponentApi(legalEntityId);
37669
+ const [isLoading, setIsLoading] = useState(true);
37540
37670
  const [legalEntity, setLegalEntity] = useState();
37671
+ const [serviceAgreementTypes, setServiceAgreementTypes] = useState([]);
37672
+ const [serviceAgreementAcceptanceInfos, setServiceAgreementAcceptanceInfos] = useState([]);
37541
37673
  if (modalView) {
37542
37674
  setIsModalView(true);
37543
37675
  }
37544
- useEffect(() => {
37545
- getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$g.error);
37676
+ const fetchLegalEntity = useCallback(async () => {
37677
+ await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$g.error);
37546
37678
  }, [getLegalEntity2, legalEntityId]);
37547
- const serviceAgreementTypes = [];
37548
- const serviceAgreementAcceptanceInfos = [];
37549
- const handleGetServiceAgreement = () => {
37550
- };
37551
- const handleViewAcceptedTermsOfServiceDocument = () => {
37552
- };
37553
- const handleDownloadAcceptedTermsOfServiceDocument = () => {
37554
- };
37555
- const handleDownloadUnacceptedTermsOfServiceDocument = () => {
37556
- };
37679
+ const fetchUnsigned = useCallback(async () => {
37680
+ await getServiceAgreementStatus2(legalEntityId).then(({
37681
+ termsOfServiceTypes
37682
+ }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$g.error);
37683
+ }, [getServiceAgreementStatus2, legalEntityId]);
37684
+ const fetchSigned = useCallback(async () => {
37685
+ await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({
37686
+ data
37687
+ }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$g.error);
37688
+ }, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
37689
+ useEffect(() => {
37690
+ (async () => {
37691
+ setIsLoading(true);
37692
+ await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
37693
+ })().catch(logger$g.error).finally(() => {
37694
+ setIsLoading(false);
37695
+ });
37696
+ }, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
37557
37697
  const handleHomeClick = () => {
37558
37698
  };
37559
37699
  const handleSign = () => {
37560
37700
  };
37561
- return jsx(ServiceAgreementDropinComponent, {
37701
+ return isLoading || !legalEntity ? jsx(Loader, {
37702
+ size: "medium"
37703
+ }) : jsx(ServiceAgreementDropinComponent, {
37562
37704
  taskType: TaskTypes.SERVICE_AGREEMENT,
37563
37705
  legalEntityResponse: legalEntity,
37564
- serviceAgreementTypes,
37706
+ serviceAgreementTypes: serviceAgreementTypes ?? [],
37565
37707
  serviceAgreementAcceptanceInfos,
37566
- handleGetServiceAgreement,
37567
- handleViewAcceptedTermsOfServiceDocument,
37568
- handleDownloadAcceptedTermsOfServiceDocument,
37569
- handleDownloadUnacceptedTermsOfServiceDocument,
37708
+ handleGetServiceAgreement: getServiceAgreement2,
37709
+ handleViewAcceptedTermsOfServiceDocument: getAcceptedServiceAgreement2,
37710
+ handleDownloadAcceptedTermsOfServiceDocument: downloadAcceptedServiceAgreement,
37711
+ handleDownloadUnacceptedTermsOfServiceDocument: downloadUnacceptedServiceAgreement,
37570
37712
  handleHomeClick,
37571
37713
  handleSign,
37572
- asModal: isModalView
37714
+ asEmbedded: true,
37715
+ asModal: isModalView,
37716
+ handleCloseClick: onClose
37573
37717
  });
37574
37718
  }
37575
37719
  const logger$f = createLogger("CreateIndividualComponent");
@@ -38369,12 +38513,15 @@ const highExposureRadioItems = [{
38369
38513
  id: "No",
38370
38514
  name: "no"
38371
38515
  }];
38372
- const highExposureParentRadioItems = [...highExposureRadioItems, {
38373
- id: "I don't know",
38374
- name: "iDontKnow"
38516
+ const highExposureParentRadioItems = [{
38517
+ id: "Yes",
38518
+ name: "yes"
38519
+ }, {
38520
+ id: "No",
38521
+ name: "noIdontKnow"
38375
38522
  }];
38376
38523
  const companySchemaKeys = ["legalForm", "naceCode", "numberOfEmployees", "doesYourCompanyHaveLEI", "legalEntityIdentifier", "country", "isCompanyOwnedByAnotherCompany", "isParentOwnedByAnotherCompany", "financialReportingDate", "totalAssetsCurrency", "totalAssetsValue", "annualTurnoverCurrency", "annualTurnoverValue", "legalInformationInsolvency", "legalProceedingsDate"];
38377
- const parentCompaniesSchemaKeys = ["legalName", "legalForm", "naceCode", "numberOfEmployees", "doesYourCompanyHaveLEI", "legalEntityIdentifier", "doesNotKnowNumberOfEmployees", "isThisAddressTheMainHeadquarters", "address", "otherAddressInformation", "doesNotKnowLegalEntityIdentifier", "postalCode", "city", "stateOrProvince", "country", "financialReportingDate", "totalAssetsCurrency", "totalAssetsValue", "annualTurnoverCurrency", "annualTurnoverValue", "legalInformationInsolvency", "legalProceedingsDate"];
38524
+ const parentCompaniesSchemaKeys = ["legalName", "legalForm", "naceCode", "numberOfEmployees", "doesYourCompanyHaveLEI", "legalEntityIdentifier", "doesNotKnowNumberOfEmployees", "isThisAddressTheMainHeadquarters", "address", "otherAddressInformation", "postalCode", "city", "stateOrProvince", "country", "financialReportingDate", "totalAssetsCurrency", "totalAssetsValue", "annualTurnoverCurrency", "annualTurnoverValue", "legalInformationInsolvency", "legalProceedingsDate"];
38378
38525
  var HighExposureIndex = /* @__PURE__ */ ((HighExposureIndex2) => {
38379
38526
  HighExposureIndex2["COMPANY"] = "company";
38380
38527
  HighExposureIndex2["PARENT_COMPANY"] = "parentCompany";
@@ -38387,53 +38534,76 @@ const setDefaultCurrencies = (dataObject, country) => {
38387
38534
  dataObject.totalAssetsCurrency = countryCurrencies[0];
38388
38535
  dataObject.annualTurnoverCurrency = countryCurrencies[0];
38389
38536
  };
38390
- const validateLegalEntityIdentifier = (legalEntityIdentifier, doesYourCompanyHaveLEI, isDisabled) => {
38391
- if (isDisabled) return true;
38537
+ const validateEmptyLegalEntityIdentifier = (legalEntityIdentifier, doesYourCompanyHaveLEI) => {
38538
+ const isRequired = doesYourCompanyHaveLEI === "Yes";
38539
+ return !isRequired || !isEmpty(legalEntityIdentifier);
38540
+ };
38541
+ const validateLegalEntityIdentifier = (legalEntityIdentifier, doesYourCompanyHaveLEI) => {
38392
38542
  const isRequired = doesYourCompanyHaveLEI === "Yes";
38393
38543
  const isValidLength = legalEntityIdentifier ? legalEntityIdentifier.length === 20 : false;
38394
38544
  const hasLettersAndNumbers = legalEntityIdentifier ? /[a-zA-Z]/.test(legalEntityIdentifier) && /[0-9]/.test(legalEntityIdentifier) : false;
38395
- return !isRequired || !isEmpty(legalEntityIdentifier) && isValidLength && hasLettersAndNumbers;
38545
+ return !isRequired || isValidLength && hasLettersAndNumbers;
38396
38546
  };
38397
38547
  const validateLegalProceedingsDate = (legalProceedingsDate, legalInformationInsolvency) => {
38398
38548
  const isRequired = legalInformationInsolvency && !["noLegalActionsTaken", "iDontKnow"].includes(legalInformationInsolvency);
38399
38549
  return isRequired ? !isEmpty(legalProceedingsDate) : true;
38400
38550
  };
38551
+ const validateDateNotInTheFuture = (legalProceedingsDate) => {
38552
+ if (!legalProceedingsDate) return false;
38553
+ return new Date(legalProceedingsDate) <= /* @__PURE__ */ new Date();
38554
+ };
38401
38555
  const highExposureCompanyDetailsValidations = {
38402
- numberOfEmployees: {
38556
+ numberOfEmployees: [{
38403
38557
  modes: ["blur"],
38404
38558
  validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
38405
38559
  errorMessage: "fieldIsRequired"
38406
- },
38560
+ }, {
38561
+ modes: ["blur"],
38562
+ validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
38563
+ errorMessage: "pleaseEnterAValidWholeNumber"
38564
+ }],
38407
38565
  legalInformationInsolvency: {
38408
38566
  modes: ["blur"],
38409
38567
  validate: (legalInformationInsolvency) => !isEmpty(legalInformationInsolvency),
38410
38568
  errorMessage: "fieldIsRequired"
38411
38569
  },
38412
- totalAssetsValue: {
38570
+ totalAssetsValue: [{
38413
38571
  modes: ["blur"],
38414
38572
  validate: (value) => !isEmpty(value),
38415
38573
  errorMessage: "fieldIsRequired"
38416
- },
38574
+ }, {
38575
+ modes: ["blur"],
38576
+ validate: (value) => !Number.isNaN(Number(value)),
38577
+ errorMessage: "pleaseEnterAValidNumber"
38578
+ }],
38417
38579
  totalAssetsCurrency: {
38418
38580
  modes: ["input"],
38419
38581
  validate: (value) => !isEmpty(value),
38420
38582
  errorMessage: "fieldIsRequired"
38421
38583
  },
38422
- annualTurnoverValue: {
38584
+ annualTurnoverValue: [{
38423
38585
  modes: ["blur"],
38424
38586
  validate: (value) => !isEmpty(value),
38425
38587
  errorMessage: "fieldIsRequired"
38426
- },
38588
+ }, {
38589
+ modes: ["blur"],
38590
+ validate: (value) => !Number.isNaN(Number(value)),
38591
+ errorMessage: "pleaseEnterAValidNumber"
38592
+ }],
38427
38593
  annualTurnoverCurrency: {
38428
38594
  modes: ["blur"],
38429
38595
  validate: (value) => !isEmpty(value),
38430
38596
  errorMessage: "fieldIsRequired"
38431
38597
  },
38432
- financialReportingDate: {
38598
+ financialReportingDate: [{
38433
38599
  modes: ["blur"],
38434
38600
  validate: (value) => !isEmpty(value),
38435
38601
  errorMessage: "fieldIsRequired"
38436
- },
38602
+ }, {
38603
+ modes: ["blur"],
38604
+ validate: (value) => validateDateNotInTheFuture(value),
38605
+ errorMessage: "dateCannotBeInTheFuture"
38606
+ }],
38437
38607
  naceCode: {
38438
38608
  modes: ["blur"],
38439
38609
  validate: (naceCode) => !isEmpty(naceCode),
@@ -38444,14 +38614,21 @@ const highExposureCompanyDetailsValidations = {
38444
38614
  validate: (doesYourCompanyHaveLEI) => !isEmpty(doesYourCompanyHaveLEI),
38445
38615
  errorMessage: "fieldIsRequired"
38446
38616
  },
38447
- legalEntityIdentifier: {
38617
+ legalEntityIdentifier: [{
38448
38618
  modes: ["blur"],
38449
38619
  validate: (legalEntityIdentifier, context) => {
38450
38620
  var _a, _b;
38451
- return validateLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38621
+ return validateEmptyLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38452
38622
  },
38453
38623
  errorMessage: "fieldIsRequired"
38454
- },
38624
+ }, {
38625
+ modes: ["blur"],
38626
+ validate: (legalEntityIdentifier, context) => {
38627
+ var _a, _b;
38628
+ return validateLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38629
+ },
38630
+ errorMessage: "invalidFormat"
38631
+ }],
38455
38632
  isCompanyOwnedByAnotherCompany: {
38456
38633
  modes: ["blur"],
38457
38634
  validate: (isCompanyOwnedByAnotherCompany) => !isEmpty(isCompanyOwnedByAnotherCompany),
@@ -38465,14 +38642,18 @@ const highExposureCompanyDetailsValidations = {
38465
38642
  },
38466
38643
  errorMessage: "fieldIsRequired"
38467
38644
  },
38468
- legalProceedingsDate: {
38645
+ legalProceedingsDate: [{
38469
38646
  modes: ["blur"],
38470
38647
  validate: (legalProceedingsDate, context) => {
38471
38648
  var _a, _b;
38472
38649
  return validateLegalProceedingsDate(legalProceedingsDate, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.legalInformationInsolvency);
38473
38650
  },
38474
38651
  errorMessage: "fieldIsRequired"
38475
- }
38652
+ }, {
38653
+ modes: ["blur"],
38654
+ validate: (value) => validateDateNotInTheFuture(value),
38655
+ errorMessage: "dateCannotBeInTheFuture"
38656
+ }]
38476
38657
  };
38477
38658
  const highExposureParentCompaniesDetailsValidations = {
38478
38659
  country: {
@@ -38485,11 +38666,15 @@ const highExposureParentCompaniesDetailsValidations = {
38485
38666
  validate: (legalName) => !isEmpty(legalName),
38486
38667
  errorMessage: "fieldIsRequired"
38487
38668
  },
38488
- numberOfEmployees: {
38669
+ numberOfEmployees: [{
38489
38670
  modes: ["blur"],
38490
38671
  validate: (numberOfEmployees) => !isEmpty(numberOfEmployees),
38491
38672
  errorMessage: "fieldIsRequired"
38492
- },
38673
+ }, {
38674
+ modes: ["blur"],
38675
+ validate: (numberOfEmployees) => Number.isInteger(Number(numberOfEmployees)),
38676
+ errorMessage: "pleaseEnterAValidWholeNumber"
38677
+ }],
38493
38678
  naceCode: {
38494
38679
  modes: ["blur"],
38495
38680
  validate: (naceCode) => !isEmpty(naceCode),
@@ -38500,14 +38685,21 @@ const highExposureParentCompaniesDetailsValidations = {
38500
38685
  validate: (doesYourCompanyHaveLEI) => !isEmpty(doesYourCompanyHaveLEI),
38501
38686
  errorMessage: "fieldIsRequired"
38502
38687
  },
38503
- legalEntityIdentifier: {
38688
+ legalEntityIdentifier: [{
38504
38689
  modes: ["blur"],
38505
38690
  validate: (legalEntityIdentifier, context) => {
38506
- var _a, _b, _c, _d;
38507
- 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));
38691
+ var _a, _b;
38692
+ return validateEmptyLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38508
38693
  },
38509
38694
  errorMessage: "fieldIsRequired"
38510
- },
38695
+ }, {
38696
+ modes: ["blur"],
38697
+ validate: (legalEntityIdentifier, context) => {
38698
+ var _a, _b;
38699
+ return validateLegalEntityIdentifier(legalEntityIdentifier, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.doesYourCompanyHaveLEI);
38700
+ },
38701
+ errorMessage: "invalidFormat"
38702
+ }],
38511
38703
  isThisAddressTheMainHeadquarters: {
38512
38704
  modes: ["blur"],
38513
38705
  validate: (isThisAddressTheMainHeadquarters) => !isEmpty(isThisAddressTheMainHeadquarters),
@@ -38518,39 +38710,55 @@ const highExposureParentCompaniesDetailsValidations = {
38518
38710
  validate: (value) => !isEmpty(value),
38519
38711
  errorMessage: "fieldIsRequired"
38520
38712
  },
38521
- totalAssetsValue: {
38713
+ totalAssetsValue: [{
38522
38714
  modes: ["blur"],
38523
38715
  validate: (value) => !isEmpty(value),
38524
38716
  errorMessage: "fieldIsRequired"
38525
- },
38717
+ }, {
38718
+ modes: ["blur"],
38719
+ validate: (value) => !Number.isNaN(Number(value)),
38720
+ errorMessage: "pleaseEnterAValidNumber"
38721
+ }],
38526
38722
  totalAssetsCurrency: {
38527
38723
  modes: ["input"],
38528
38724
  validate: (value) => !isEmpty(value),
38529
38725
  errorMessage: "fieldIsRequired"
38530
38726
  },
38531
- annualTurnoverValue: {
38727
+ annualTurnoverValue: [{
38532
38728
  modes: ["blur"],
38533
38729
  validate: (value) => !isEmpty(value),
38534
38730
  errorMessage: "fieldIsRequired"
38535
- },
38731
+ }, {
38732
+ modes: ["blur"],
38733
+ validate: (value) => !Number.isNaN(Number(value)),
38734
+ errorMessage: "pleaseEnterAValidNumber"
38735
+ }],
38536
38736
  annualTurnoverCurrency: {
38537
38737
  modes: ["blur"],
38538
38738
  validate: (value) => !isEmpty(value),
38539
38739
  errorMessage: "fieldIsRequired"
38540
38740
  },
38541
- financialReportingDate: {
38741
+ financialReportingDate: [{
38542
38742
  modes: ["blur"],
38543
38743
  validate: (value) => !isEmpty(value),
38544
38744
  errorMessage: "fieldIsRequired"
38545
- },
38546
- legalProceedingsDate: {
38745
+ }, {
38746
+ modes: ["blur"],
38747
+ validate: (value) => validateDateNotInTheFuture(value),
38748
+ errorMessage: "dateCannotBeInTheFuture"
38749
+ }],
38750
+ legalProceedingsDate: [{
38547
38751
  modes: ["blur"],
38548
38752
  validate: (legalProceedingsDate, context) => {
38549
38753
  var _a, _b;
38550
38754
  return validateLegalProceedingsDate(legalProceedingsDate, (_b = (_a = context == null ? void 0 : context.state) == null ? void 0 : _a.data) == null ? void 0 : _b.legalInformationInsolvency);
38551
38755
  },
38552
38756
  errorMessage: "fieldIsRequired"
38553
- }
38757
+ }, {
38758
+ modes: ["blur"],
38759
+ validate: (legalProceedingsDate) => validateDateNotInTheFuture(legalProceedingsDate),
38760
+ errorMessage: "dateCannotBeInTheFuture"
38761
+ }]
38554
38762
  };
38555
38763
  const logger$a = createLogger("LegalFormField");
38556
38764
  function LegalFormField({
@@ -38736,44 +38944,31 @@ function HighExposureBusinessInformation({
38736
38944
  "aria-label": i18n.get(isMainCompany ? "doesYourCompanyHaveLEI" : "doesThisCompanyHaveLEI"),
38737
38945
  "aria-invalid": !valid.doesYourCompanyHaveLEI
38738
38946
  })
38739
- }), data.doesYourCompanyHaveLEI === "Yes" && jsxs(Fragment, {
38740
- children: [jsx(Field, {
38947
+ }), data.doesYourCompanyHaveLEI === "Yes" && jsx(Field, {
38948
+ name: "legalEntityIdentifier",
38949
+ label: formUtils.getLabel("legalEntityIdentifier", "legalEntityIdentifier"),
38950
+ errorMessage: formUtils.getErrorMessage("legalEntityIdentifier", errors, fieldProblems),
38951
+ isValid: valid.legalEntityIdentifier,
38952
+ helper: i18n.get("enterNCharactersWithAMixForExample", {
38953
+ values: {
38954
+ numChars: 20,
38955
+ example: "529900T8BM49AURSDO55"
38956
+ }
38957
+ }),
38958
+ helperPosition: "above",
38959
+ children: (childProps) => jsx(InputText, {
38960
+ ...childProps,
38741
38961
  name: "legalEntityIdentifier",
38742
- label: formUtils.getLabel("legalEntityIdentifier", "legalEntityIdentifier"),
38743
- errorMessage: formUtils.getErrorMessage("legalEntityIdentifier", errors, fieldProblems),
38744
- isValid: valid.legalEntityIdentifier,
38745
- helper: i18n.get("enterNCharactersWithAMixForExample", {
38746
- values: {
38747
- numChars: 20,
38748
- example: "529900T8BM49AURSDO55"
38749
- }
38750
- }),
38751
- helperPosition: "below",
38752
- children: (childProps) => jsx(InputText, {
38753
- ...childProps,
38754
- name: "legalEntityIdentifier",
38755
- value: data.legalEntityIdentifier,
38756
- readonly: Boolean(data.doesNotKnowLegalEntityIdentifier),
38757
- classNameModifiers: ["legalName"],
38758
- onInput: handleChangeFor("legalEntityIdentifier", "input"),
38759
- onBlur: handleChangeFor("legalEntityIdentifier", "blur"),
38760
- "aria-required": true,
38761
- "aria-label": formUtils.getLabel("legalEntityIdentifier"),
38762
- "aria-invalid": !valid.legalEntityIdentifier,
38763
- isValid: valid.legalEntityIdentifier
38764
- })
38765
- }), !isMainCompany && jsx(Checkbox, {
38766
- name: "doesNotKnowLegalEntityIdentifier",
38767
- label: i18n.get("iDontKnow"),
38768
- value: data.doesNotKnowLegalEntityIdentifier ? data.doesNotKnowLegalEntityIdentifier.toString() : void 0,
38962
+ value: data.legalEntityIdentifier,
38769
38963
  readonly: false,
38770
- classNameModifiers: ["exempted-from-tax"],
38771
- checked: Boolean(data.doesNotKnowLegalEntityIdentifier),
38772
- onChange: handleChangeFor("doesNotKnowLegalEntityIdentifier"),
38773
- "aria-required": false,
38774
- "aria-label": i18n.get("iDontKnow"),
38775
- "aria-invalid": false
38776
- })]
38964
+ classNameModifiers: ["legalName"],
38965
+ onInput: handleChangeFor("legalEntityIdentifier", "input"),
38966
+ onBlur: handleChangeFor("legalEntityIdentifier", "blur"),
38967
+ "aria-required": true,
38968
+ "aria-label": formUtils.getLabel("legalEntityIdentifier"),
38969
+ "aria-invalid": !valid.legalEntityIdentifier,
38970
+ isValid: valid.legalEntityIdentifier
38971
+ })
38777
38972
  })]
38778
38973
  });
38779
38974
  }
@@ -38834,6 +39029,7 @@ function AmountSelector({
38834
39029
  })
38835
39030
  });
38836
39031
  }
39032
+ const TODAY_DATE$1 = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
38837
39033
  function HighExposureFinancialInformation({
38838
39034
  formUtils,
38839
39035
  data,
@@ -38895,11 +39091,13 @@ function HighExposureFinancialInformation({
38895
39091
  onBlur: handleChangeFor("financialReportingDate", "blur"),
38896
39092
  "aria-required": true,
38897
39093
  "aria-label": formUtils.getLabel("financialReportingDate"),
38898
- "aria-invalid": !valid.financialReportingDate
39094
+ "aria-invalid": !valid.financialReportingDate,
39095
+ max: TODAY_DATE$1
38899
39096
  })
38900
39097
  })]
38901
39098
  });
38902
39099
  }
39100
+ const TODAY_DATE = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
38903
39101
  function HighExposureLegalInformation({
38904
39102
  formUtils,
38905
39103
  data,
@@ -38964,7 +39162,8 @@ function HighExposureLegalInformation({
38964
39162
  onBlur: handleChangeFor("legalProceedingsDate", "blur"),
38965
39163
  "aria-required": true,
38966
39164
  "aria-label": formUtils.getLabel("legalProceedingsDate"),
38967
- "aria-invalid": !valid.legalProceedingsDate
39165
+ "aria-invalid": !valid.legalProceedingsDate,
39166
+ max: TODAY_DATE
38968
39167
  })
38969
39168
  })]
38970
39169
  });
@@ -39139,7 +39338,7 @@ function HighExposureBasicCompanyInformation({
39139
39338
  errorMessage: formUtils.getErrorMessage("legalName", errors, fieldProblems),
39140
39339
  isValid: valid.legalName,
39141
39340
  helper: i18n.get("legalNameIsUsedToIdentifyABusinessWithTheGovernment"),
39142
- helperPosition: "below",
39341
+ helperPosition: "above",
39143
39342
  children: (childProps) => jsx(InputText, {
39144
39343
  ...childProps,
39145
39344
  name: "legalName",
@@ -39530,6 +39729,7 @@ const getLegalEntityId = (exposureIndex, rootLegalEntity) => {
39530
39729
  const exposureEntityAssociation = (_a = rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === exposureEntityType);
39531
39730
  return exposureEntityAssociation == null ? void 0 : exposureEntityAssociation.legalEntityId;
39532
39731
  };
39732
+ const USER_LOCALE = navigator.language;
39533
39733
  const entityHasParentCompany = (data) => {
39534
39734
  var _a, _b;
39535
39735
  return ((_a = data.company) == null ? void 0 : _a.isCompanyOwnedByAnotherCompany) && ((_b = data.company) == null ? void 0 : _b.isCompanyOwnedByAnotherCompany) === "Yes";
@@ -39570,7 +39770,7 @@ const prepareExposureSubmitData = (exposureIndex, data, rootLegalEntity) => {
39570
39770
  ...exposureDetails.organization.registeredAddress
39571
39771
  };
39572
39772
  }
39573
- if (exposureData.doesYourCompanyHaveLEI !== "Yes" || exposureData.doesNotKnowLegalEntityIdentifier) {
39773
+ if (exposureData.doesYourCompanyHaveLEI !== "Yes") {
39574
39774
  delete exposureDetails.organization.globalLegalEntityIdentifier;
39575
39775
  }
39576
39776
  const exposureLegalEntityId = getLegalEntityId(exposureIndex, rootLegalEntity);
@@ -39622,6 +39822,7 @@ const handleHighExposureFormSubmission = async (highExposureType, details, creat
39622
39822
  throw highExposureError;
39623
39823
  }
39624
39824
  };
39825
+ const getIntlDate = (date) => date ? new Intl.DateTimeFormat(USER_LOCALE).format(new Date(date)) : void 0;
39625
39826
  const parseConfiguration = ({
39626
39827
  matchingScenario
39627
39828
  }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
@@ -39629,17 +39830,23 @@ const logger$8 = createLogger("UpdateLegalEntityForHighExposure");
39629
39830
  const customLabels = {
39630
39831
  company: {
39631
39832
  legalForm: "businessStructure",
39632
- naceCode: "industryAndNaceCode"
39833
+ naceCode: "industryAndNaceCode",
39834
+ totalAssetsValue: "totalAssets",
39835
+ annualTurnoverValue: "annualTurnover"
39633
39836
  },
39634
39837
  parentCompany: {
39635
39838
  legalForm: "businessStructure",
39636
39839
  naceCode: "industryAndNaceCode",
39637
- doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI"
39840
+ doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI",
39841
+ totalAssetsValue: "totalAssets",
39842
+ annualTurnoverValue: "annualTurnover"
39638
39843
  },
39639
39844
  ultimateParentCompany: {
39640
39845
  legalForm: "businessStructure",
39641
39846
  naceCode: "industryAndNaceCode",
39642
- doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI"
39847
+ doesYourCompanyHaveLEI: "doesThisCompanyHaveLEI",
39848
+ totalAssetsValue: "totalAssets",
39849
+ annualTurnoverValue: "annualTurnover"
39643
39850
  }
39644
39851
  };
39645
39852
  function UpdateLegalEntityForHighExposure({
@@ -39898,8 +40105,57 @@ function UpdateLegalEntityForHighExposure({
39898
40105
  });
39899
40106
  }
39900
40107
  };
40108
+ const getTranslatedLegalInsolvency = (insolvencyData) => {
40109
+ if (!insolvencyData) return void 0;
40110
+ return insolvencyData === "noLegalActionsTaken" ? i18n.get("no") : i18n.get(insolvencyData);
40111
+ };
40112
+ const getFormattedAmount = (value, currency) => {
40113
+ if (!value) return void 0;
40114
+ const formattedValue = Number(value).toLocaleString(USER_LOCALE);
40115
+ return `${currency} ${formattedValue}`;
40116
+ };
39901
40117
  const formatDataForSummary2 = (data2) => {
40118
+ var _a2, _b2, _c2;
39902
40119
  const summaryData = cloneObject(data2) || {};
40120
+ if (summaryData.company) {
40121
+ summaryData.company.legalInformationInsolvency = getTranslatedLegalInsolvency((_a2 = summaryData.company) == null ? void 0 : _a2.legalInformationInsolvency);
40122
+ summaryData.company.annualTurnoverValue = getFormattedAmount(summaryData.company.annualTurnoverValue, summaryData.company.annualTurnoverCurrency);
40123
+ delete summaryData.company.annualTurnoverCurrency;
40124
+ summaryData.company.totalAssetsValue = getFormattedAmount(summaryData.company.totalAssetsValue, summaryData.company.totalAssetsCurrency);
40125
+ delete summaryData.company.totalAssetsCurrency;
40126
+ const {
40127
+ legalProceedingsDate,
40128
+ financialReportingDate
40129
+ } = summaryData.company;
40130
+ summaryData.company.legalProceedingsDate = getIntlDate(legalProceedingsDate);
40131
+ summaryData.company.financialReportingDate = getIntlDate(financialReportingDate);
40132
+ }
40133
+ if (summaryData.parentCompany) {
40134
+ summaryData.parentCompany.legalInformationInsolvency = getTranslatedLegalInsolvency((_b2 = summaryData.parentCompany) == null ? void 0 : _b2.legalInformationInsolvency);
40135
+ summaryData.parentCompany.annualTurnoverValue = getFormattedAmount(summaryData.parentCompany.annualTurnoverValue, summaryData.parentCompany.annualTurnoverCurrency);
40136
+ delete summaryData.parentCompany.annualTurnoverCurrency;
40137
+ summaryData.parentCompany.totalAssetsValue = getFormattedAmount(summaryData.parentCompany.totalAssetsValue, summaryData.parentCompany.totalAssetsCurrency);
40138
+ delete summaryData.parentCompany.totalAssetsCurrency;
40139
+ const {
40140
+ legalProceedingsDate,
40141
+ financialReportingDate
40142
+ } = summaryData.parentCompany;
40143
+ summaryData.parentCompany.legalProceedingsDate = getIntlDate(legalProceedingsDate);
40144
+ summaryData.parentCompany.financialReportingDate = getIntlDate(financialReportingDate);
40145
+ }
40146
+ if (summaryData.ultimateParentCompany) {
40147
+ summaryData.ultimateParentCompany.legalInformationInsolvency = getTranslatedLegalInsolvency((_c2 = summaryData.ultimateParentCompany) == null ? void 0 : _c2.legalInformationInsolvency);
40148
+ summaryData.ultimateParentCompany.annualTurnoverValue = getFormattedAmount(summaryData.ultimateParentCompany.annualTurnoverValue, summaryData.ultimateParentCompany.annualTurnoverCurrency);
40149
+ delete summaryData.ultimateParentCompany.annualTurnoverCurrency;
40150
+ summaryData.ultimateParentCompany.totalAssetsValue = getFormattedAmount(summaryData.ultimateParentCompany.totalAssetsValue, summaryData.ultimateParentCompany.totalAssetsCurrency);
40151
+ delete summaryData.ultimateParentCompany.totalAssetsCurrency;
40152
+ const {
40153
+ legalProceedingsDate,
40154
+ financialReportingDate
40155
+ } = summaryData.ultimateParentCompany;
40156
+ summaryData.ultimateParentCompany.legalProceedingsDate = getIntlDate(legalProceedingsDate);
40157
+ summaryData.ultimateParentCompany.financialReportingDate = getIntlDate(financialReportingDate);
40158
+ }
39903
40159
  return summaryData;
39904
40160
  };
39905
40161
  const canSubmit2 = (data2) => mandatoryApiFields.HIGH_EXPOSURE.every((detail) => {
@@ -40609,7 +40865,7 @@ const ConfigurationApiProvider = ({
40609
40865
  isEmbeddedDropin,
40610
40866
  loadingContext
40611
40867
  } = authContext;
40612
- const sdkVersion = "3.27.1";
40868
+ const sdkVersion = "3.28.1";
40613
40869
  useAnalytics({
40614
40870
  onUserEvent,
40615
40871
  legalEntityId: rootLegalEntityId,
@@ -41291,7 +41547,7 @@ const DebugModal = ({
41291
41547
  };
41292
41548
  const copyToClipboard = async () => {
41293
41549
  const toCopy = {
41294
- sdkVersion: "3.27.1",
41550
+ sdkVersion: "3.28.1",
41295
41551
  experiments: Object.fromEntries(allExperimentsWithValues),
41296
41552
  settings: Object.fromEntries(allSettingsWithValues)
41297
41553
  };
@@ -41330,7 +41586,7 @@ const DebugModal = ({
41330
41586
  children: [jsxs("div", {
41331
41587
  className: "adyen-kyc-debug-modal__meta",
41332
41588
  children: [jsxs("span", {
41333
- children: ["SDK version: ", "3.27.1"]
41589
+ children: ["SDK version: ", "3.28.1"]
41334
41590
  }), jsxs("span", {
41335
41591
  children: ["rootLegalEntityId: ", rootLegalEntityId]
41336
41592
  })]