@adyen/kyc-components 2.18.1 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/es/adyen-kyc-components.es.js +401 -235
  2. package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
  3. package/dist/types/components/EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent.d.ts +16 -0
  4. package/dist/types/components/EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent.d.ts +11 -0
  5. package/dist/types/components/Individual/types.d.ts +2 -1
  6. package/dist/types/components/{TaskIntros → Introduction}/types.d.ts +1 -0
  7. package/dist/types/components/index.d.ts +4 -2
  8. package/dist/types/components/internal/AccountHolder/types.d.ts +1 -1
  9. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  10. package/dist/types/core/SDKValidation/index.d.ts +1 -1
  11. package/dist/types/core/Services/componentApi/create-legal-entity.d.ts +3 -0
  12. package/dist/types/core/Services/componentApi/index.d.ts +2 -0
  13. package/dist/types/core/Services/componentApi/update-legal-entity.d.ts +3 -0
  14. package/dist/types/core/core.d.ts +1 -1
  15. package/dist/types/core/hooks/introduction/useIntroductionScreens.d.ts +1 -1
  16. package/dist/types/core/hooks/useBusinessSetup.d.ts +1 -1
  17. package/dist/types/core/hooks/useComponentApi.d.ts +6 -0
  18. package/dist/types/core/models/api/organization.d.ts +1 -1
  19. package/dist/types/core/models/form-rules.d.ts +1 -0
  20. package/dist/types/language/config.d.ts +9 -0
  21. package/dist/types/utils/decision-maker-roles.d.ts +1 -1
  22. package/dist/types/utils/entity-status-util.d.ts +2 -2
  23. package/dist/types/utils/trust-util.d.ts +1 -1
  24. package/package.json +1 -1
  25. package/dist/types/components/EmbeddedDropins/TransferInstrumentComponent/TransferInstrumentComponent.d.ts +0 -11
  26. /package/dist/types/components/{TaskIntros/TaskIntros.d.ts → Introduction/Introduction.d.ts} +0 -0
  27. /package/dist/types/components/{TaskIntros/TaskIntro.d.ts → Introduction/IntroductionScreen.d.ts} +0 -0
  28. /package/dist/types/components/{TaskIntros → Introduction}/constants.d.ts +0 -0
  29. /package/dist/types/components/{TaskIntros → Introduction}/copy.d.ts +0 -0
@@ -139,8 +139,13 @@ const privateCompanyTitle = "Private company";
139
139
  const privateCompanyDescription = "Owned privately. The shareholders don’t necessarily trade on public exchanges (like the stock market).";
140
140
  const publicCompanyTitle = "Public company";
141
141
  const publicCompanyDescription = "Owned by public shareholders. They’re also required to disclose financial information to the public regularly.";
142
+ const incorporatedPartnership = "Incorporated partnership";
143
+ const unincorporatedPartnership = "Unincorporated partnership";
142
144
  const incorporatedPartnershipTitle = "Incorporated partnership";
143
145
  const incorporatedPartnershipDescription = "An agreement between two or more people who run a business together.";
146
+ const incorporatedPartnershipNewEntryFlowDescription = "You and your partners have limited liability for business debts.";
147
+ const unincorporatedPartnershipDescription = "You or your partners are personally liable for business debts.";
148
+ const unincorporatedPartnershipNewEntryFlowDescription = "You or your partners are personally liable for business debts.";
144
149
  const nonProfitOrCharitableOrgTitle = "Non-profit or charitable organization";
145
150
  const nonProfitOrCharitableOrgDescription = "An organization that has an official status as not for profit or tax exempt, sometimes called an NGO.";
146
151
  const governmentalOrganizationTitle = "Governmental organization";
@@ -1110,6 +1115,10 @@ const introductionScreenDecisionMakerDescriptionP2 = "Where to find this informa
1110
1115
  const introductionScreenDecisionMakerDescriptionLI1 = "Driver’s license";
1111
1116
  const introductionScreenDecisionMakerDescriptionLI2 = "Passport";
1112
1117
  const introductionScreenDecisionMakerDescriptionLI3 = "ID document";
1118
+ const introductionScreenSoleProprietorCompanyTitle = "Sole proprietorship details";
1119
+ const introductionScreenSoleProprietorCompanyDescriptionP1 = "For example, your business name and tax identification number.";
1120
+ const introductionScreenSoleProprietorCompanyDescriptionP2 = "Where to find this information";
1121
+ const introductionScreenSoleProprietorCompanyDescriptionLI1 = "Your sole proprietorship registration document";
1113
1122
  const introductionScreenTrustTitle = "Trust details";
1114
1123
  const introductionScreenTrustDescriptionP1 = "For example, your trust’s name and business number. You’ll also need to upload your trust deed.";
1115
1124
  const introductionScreenTrustDescriptionP2 = "Where to find this information";
@@ -1252,8 +1261,13 @@ const defaultTrans = {
1252
1261
  privateCompanyDescription,
1253
1262
  publicCompanyTitle,
1254
1263
  publicCompanyDescription,
1264
+ incorporatedPartnership,
1265
+ unincorporatedPartnership,
1255
1266
  incorporatedPartnershipTitle,
1256
1267
  incorporatedPartnershipDescription,
1268
+ incorporatedPartnershipNewEntryFlowDescription,
1269
+ unincorporatedPartnershipDescription,
1270
+ unincorporatedPartnershipNewEntryFlowDescription,
1257
1271
  nonProfitOrCharitableOrgTitle,
1258
1272
  nonProfitOrCharitableOrgDescription,
1259
1273
  governmentalOrganizationTitle,
@@ -2240,6 +2254,10 @@ const defaultTrans = {
2240
2254
  introductionScreenDecisionMakerDescriptionLI1,
2241
2255
  introductionScreenDecisionMakerDescriptionLI2,
2242
2256
  introductionScreenDecisionMakerDescriptionLI3,
2257
+ introductionScreenSoleProprietorCompanyTitle,
2258
+ introductionScreenSoleProprietorCompanyDescriptionP1,
2259
+ introductionScreenSoleProprietorCompanyDescriptionP2,
2260
+ introductionScreenSoleProprietorCompanyDescriptionLI1,
2243
2261
  introductionScreenTrustTitle,
2244
2262
  introductionScreenTrustDescriptionP1,
2245
2263
  introductionScreenTrustDescriptionP2,
@@ -2934,7 +2952,7 @@ const createLogger = (namespace) => {
2934
2952
  });
2935
2953
  return methods;
2936
2954
  };
2937
- const logger$n = createLogger("Link");
2955
+ const logger$o = createLogger("Link");
2938
2956
  const getIconClass = (icon, external) => {
2939
2957
  if (external) {
2940
2958
  return "adl-link__icon adyen-kyc-icon-external-link";
@@ -2946,7 +2964,7 @@ const getIconClass = (icon, external) => {
2946
2964
  };
2947
2965
  const isValidLink = (href) => {
2948
2966
  if (href === "#") {
2949
- logger$n.error('Links must include a valid href. If your href is "#", consider using a Button instead');
2967
+ logger$o.error('Links must include a valid href. If your href is "#", consider using a Button instead');
2950
2968
  return false;
2951
2969
  }
2952
2970
  return true;
@@ -3240,14 +3258,14 @@ function useResetGlobalData(caller) {
3240
3258
  }
3241
3259
  }), [dispatch, caller]);
3242
3260
  }
3243
- const logger$m = createLogger("useAllowedCountries");
3261
+ const logger$n = createLogger("useAllowedCountries");
3244
3262
  const useAllowedCountries = () => {
3245
3263
  const {
3246
3264
  getAllowedCountries: getAllowedCountries2
3247
3265
  } = useConfigurationApi();
3248
3266
  const [allowedCountries, setAllowedCountries] = useState();
3249
3267
  useEffect(() => {
3250
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$m.error);
3268
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$n.error);
3251
3269
  }, []);
3252
3270
  return allowedCountries;
3253
3271
  };
@@ -3586,7 +3604,7 @@ class ValidationResult {
3586
3604
  return this.validationResults.filter((result) => result.hasError);
3587
3605
  }
3588
3606
  }
3589
- const logger$l = createLogger("useAsyncValidator");
3607
+ const logger$m = createLogger("useAsyncValidator");
3590
3608
  const useAsyncValidator = (asyncRules) => {
3591
3609
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3592
3610
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3609,7 +3627,7 @@ const useAsyncValidator = (asyncRules) => {
3609
3627
  hasError: !isValid
3610
3628
  }])
3611
3629
  });
3612
- }).catch(logger$l.error);
3630
+ }).catch(logger$m.error);
3613
3631
  }, [asyncRules, clearAsyncValidationResults]);
3614
3632
  return {
3615
3633
  asyncValidationResults,
@@ -5030,7 +5048,7 @@ const Select = ({
5030
5048
  })]
5031
5049
  });
5032
5050
  };
5033
- const logger$k = createLogger("CountryField");
5051
+ const logger$l = createLogger("CountryField");
5034
5052
  const COUNTRY_FIELD = ["country"];
5035
5053
  function CountryField({
5036
5054
  data,
@@ -5053,7 +5071,7 @@ function CountryField({
5053
5071
  dataset: countriesFromApi
5054
5072
  } = useDataset(datasetIdentifier.country);
5055
5073
  useEffect(() => {
5056
- loadFlags2().catch(logger$k.error);
5074
+ loadFlags2().catch(logger$l.error);
5057
5075
  }, [loadFlags2]);
5058
5076
  const countries = countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
5059
5077
  ...item,
@@ -8789,7 +8807,8 @@ const EXPIRY_DATE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
8789
8807
  const rules$3 = ({
8790
8808
  data,
8791
8809
  country: country2,
8792
- taskType
8810
+ taskType,
8811
+ isEmbeddedDropin
8793
8812
  }) => ({
8794
8813
  isDirectorIdNumberRequiredForCountry: () => {
8795
8814
  var _a, _b, _c, _d, _e;
@@ -8854,7 +8873,7 @@ const rules$3 = ({
8854
8873
  }
8855
8874
  },
8856
8875
  accountHolderIfCustomer: () => {
8857
- if (taskType === TaskTypes.INDIVIDUAL) {
8876
+ if (taskType === TaskTypes.INDIVIDUAL && !isEmbeddedDropin) {
8858
8877
  return REQUIRED;
8859
8878
  }
8860
8879
  },
@@ -8886,7 +8905,7 @@ const accountHolderValidationRules = {
8886
8905
  }
8887
8906
  };
8888
8907
  const accountHolderFields = ["accountHolder"];
8889
- const logger$j = createLogger("AccountHolder");
8908
+ const logger$k = createLogger("AccountHolder");
8890
8909
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
8891
8910
  switch (legalEntityType) {
8892
8911
  case LegalEntityType.ORGANIZATION: {
@@ -8896,7 +8915,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
8896
8915
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
8897
8916
  }
8898
8917
  default:
8899
- logger$j.error(`No available account holder options for legal entity type '${legalEntityType}'`);
8918
+ logger$k.error(`No available account holder options for legal entity type '${legalEntityType}'`);
8900
8919
  return [];
8901
8920
  }
8902
8921
  }
@@ -9636,7 +9655,7 @@ function Dropzone(props) {
9636
9655
  })]
9637
9656
  });
9638
9657
  }
9639
- const logger$i = createLogger("TextArea");
9658
+ const logger$j = createLogger("TextArea");
9640
9659
  function TextArea(props) {
9641
9660
  const {
9642
9661
  classNameModifiers,
@@ -9657,7 +9676,7 @@ function TextArea(props) {
9657
9676
  } = useI18nContext();
9658
9677
  const [value, setValue] = useState("");
9659
9678
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
9660
- logger$i.error("Error: Form fields that rely on InputBase may not have an onChange property");
9679
+ logger$j.error("Error: Form fields that rely on InputBase may not have an onChange property");
9661
9680
  }
9662
9681
  const handleInput = (e) => {
9663
9682
  var _a;
@@ -10069,7 +10088,7 @@ function FieldContainer(props) {
10069
10088
  }
10070
10089
  return renderField(fieldName);
10071
10090
  }
10072
- const logger$h = createLogger("SearchAddress");
10091
+ const logger$i = createLogger("SearchAddress");
10073
10092
  const SearchAddress = ({
10074
10093
  data,
10075
10094
  legalEntityId,
@@ -10095,7 +10114,7 @@ const SearchAddress = ({
10095
10114
  const response = await handleFindAddress(selectedAddressId);
10096
10115
  autocompleteAddressForm(response);
10097
10116
  } catch (e) {
10098
- logger$h.error(e);
10117
+ logger$i.error(e);
10099
10118
  }
10100
10119
  };
10101
10120
  const onDrilldown = async (selectedAddress) => {
@@ -10107,7 +10126,7 @@ const SearchAddress = ({
10107
10126
  }, legalEntityId);
10108
10127
  setItems((response == null ? void 0 : response.results) || []);
10109
10128
  } catch (e) {
10110
- logger$h.error(e);
10129
+ logger$i.error(e);
10111
10130
  }
10112
10131
  };
10113
10132
  const onChange = (e) => {
@@ -10162,7 +10181,7 @@ const SearchAddress = ({
10162
10181
  setItems([]);
10163
10182
  }
10164
10183
  } catch (e) {
10165
- logger$h.error(e);
10184
+ logger$i.error(e);
10166
10185
  }
10167
10186
  setLoading(false);
10168
10187
  }
@@ -13534,7 +13553,7 @@ const initOnfido = async ({
13534
13553
  language: getOnfidoLocaleConfig(i18n)
13535
13554
  });
13536
13555
  };
13537
- const logger$g = createLogger("IdVerificationComponent");
13556
+ const logger$h = createLogger("IdVerificationComponent");
13538
13557
  function IdVerificationComponent({
13539
13558
  userDetails,
13540
13559
  legalEntityId,
@@ -13567,7 +13586,7 @@ function IdVerificationComponent({
13567
13586
  onIdVerificationError,
13568
13587
  onIdVerificationComplete
13569
13588
  });
13570
- })().catch(logger$g.error);
13589
+ })().catch(logger$h.error);
13571
13590
  return () => {
13572
13591
  if (onfidoSdk.current)
13573
13592
  onfidoSdk.current.tearDown();
@@ -13619,7 +13638,7 @@ function IdDocumentAlreadyUpload(props) {
13619
13638
  })]
13620
13639
  });
13621
13640
  }
13622
- const logger$f = createLogger("IdDocumentInstantVerificationComponent");
13641
+ const logger$g = createLogger("IdDocumentInstantVerificationComponent");
13623
13642
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
13624
13643
  const documentTypeValidationRules = {
13625
13644
  instantIdVerificationData: {
@@ -13701,7 +13720,7 @@ function IdDocumentInstantVerificationComponent(props) {
13701
13720
  userDetails: props.userDetails,
13702
13721
  legalEntityId: props.legalEntityId,
13703
13722
  onIdVerificationComplete: handleIdVerificationComplete,
13704
- onIdVerificationError: logger$f.error
13723
+ onIdVerificationError: logger$g.error
13705
13724
  }), jsxs("div", {
13706
13725
  className: "adyen-kyc-document-upload__manual-upload",
13707
13726
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -16393,7 +16412,7 @@ class AdyenKycSdkError extends Error {
16393
16412
  }
16394
16413
  let sdkToken;
16395
16414
  let fetchSdkToken;
16396
- const logger$e = createLogger("Session");
16415
+ const logger$f = createLogger("Session");
16397
16416
  const setSdkToken = (token) => {
16398
16417
  sdkToken = token;
16399
16418
  };
@@ -16411,7 +16430,7 @@ const refreshSession = async () => {
16411
16430
  } = await fetchSdkToken();
16412
16431
  setSdkToken(token);
16413
16432
  } catch (e) {
16414
- logger$e.error("Failed to fetch sdk token", e);
16433
+ logger$f.error("Failed to fetch sdk token", e);
16415
16434
  }
16416
16435
  };
16417
16436
  const addAnimationStartListener = (element, listener) => {
@@ -16424,7 +16443,7 @@ const removeAnimationStartListener = (element, listener) => {
16424
16443
  element.removeEventListener("MSAnimationStart", listener, false);
16425
16444
  element.removeEventListener("webkitAnimationStart", listener, false);
16426
16445
  };
16427
- const logger$d = createLogger("Fetch");
16446
+ const logger$e = createLogger("Fetch");
16428
16447
  const getRequestObject = (options, data) => {
16429
16448
  const {
16430
16449
  headers = [],
@@ -16471,10 +16490,10 @@ const logFetchError = (message, level) => {
16471
16490
  case "info":
16472
16491
  case "warn":
16473
16492
  case "error":
16474
- logger$d[level](message);
16493
+ logger$e[level](message);
16475
16494
  break;
16476
16495
  default:
16477
- logger$d.error(message);
16496
+ logger$e.error(message);
16478
16497
  }
16479
16498
  };
16480
16499
  const handleFetchResponse = async (response, responseType) => {
@@ -16563,7 +16582,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
16563
16582
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
16564
16583
  const MOUNT_TIMEOUT = 10 * 1e3;
16565
16584
  const TINK_VENDOR = "Tink";
16566
- const logger$c = createLogger("iframeWidget");
16585
+ const logger$d = createLogger("iframeWidget");
16567
16586
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
16568
16587
  const isTerminalMessageData = (data) => Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
16569
16588
  const parseMessageJson = (message) => {
@@ -16582,7 +16601,7 @@ const callbackErrorHandler = async (response) => {
16582
16601
  try {
16583
16602
  await response;
16584
16603
  } catch (ex) {
16585
- logger$c.error(ex);
16604
+ logger$d.error(ex);
16586
16605
  }
16587
16606
  return {
16588
16607
  error: "UNKNOWN_ERROR",
@@ -16688,7 +16707,7 @@ class IFrameWidget {
16688
16707
  message = responseData.errorMessage;
16689
16708
  }
16690
16709
  } catch (ex) {
16691
- logger$c.error(ex);
16710
+ logger$d.error(ex);
16692
16711
  }
16693
16712
  throw new AdyenKycSdkError(reason, jsonData.error);
16694
16713
  }
@@ -16874,7 +16893,7 @@ function BankVerificationWidget({
16874
16893
  ref: widgetContainerRef
16875
16894
  });
16876
16895
  }
16877
- const logger$b = createLogger("BankVerification");
16896
+ const logger$c = createLogger("BankVerification");
16878
16897
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
16879
16898
  const InstantVerificationErrorContext = createContext(null);
16880
16899
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -16908,7 +16927,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
16908
16927
  const preferredVendor2 = vendors[0];
16909
16928
  setPreferredVendor(preferredVendor2.name ? preferredVendor2 : null);
16910
16929
  };
16911
- getPreferredVendor().catch(logger$b.error);
16930
+ getPreferredVendor().catch(logger$c.error);
16912
16931
  }, [country2, getBankVerificationVendors]);
16913
16932
  return preferredVendor;
16914
16933
  };
@@ -20131,7 +20150,7 @@ const defaultPayoutAccountFormat = {
20131
20150
  [CountryCodes.Sweden]: "local",
20132
20151
  [CountryCodes.UnitedKingdom]: "local"
20133
20152
  };
20134
- const logger$a = createLogger("useScenarioConfiguration");
20153
+ const logger$b = createLogger("useScenarioConfiguration");
20135
20154
  const useScenarioConfiguration = ({
20136
20155
  getConfigurationData,
20137
20156
  getPayoutAccountFormatData,
@@ -20153,12 +20172,12 @@ const useScenarioConfiguration = ({
20153
20172
  const response = await getConfigurationData();
20154
20173
  setConfigurationResponse(response);
20155
20174
  } catch (err) {
20156
- logger$a.warn("WARNING: Configuration request failed - error:", err);
20175
+ logger$b.warn("WARNING: Configuration request failed - error:", err);
20157
20176
  } finally {
20158
20177
  setLoadingStatus("success");
20159
20178
  }
20160
20179
  };
20161
- makeConfigCallAndSave().catch(logger$a.error);
20180
+ makeConfigCallAndSave().catch(logger$b.error);
20162
20181
  }, [getConfigurationData, setLoadingStatus]);
20163
20182
  useEffect(() => {
20164
20183
  setLoadingStatus("loading");
@@ -20174,12 +20193,12 @@ const useScenarioConfiguration = ({
20174
20193
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
20175
20194
  setAccountFormat(defaultAccountFormat);
20176
20195
  } catch (err) {
20177
- logger$a.warn("WARNING: Payout format request failed - error:", err);
20196
+ logger$b.warn("WARNING: Payout format request failed - error:", err);
20178
20197
  } finally {
20179
20198
  setLoadingStatus("success");
20180
20199
  }
20181
20200
  };
20182
- makePayoutFormatCallAndSave().catch(logger$a.error);
20201
+ makePayoutFormatCallAndSave().catch(logger$b.error);
20183
20202
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus]);
20184
20203
  const {
20185
20204
  fieldConfigurations,
@@ -20835,7 +20854,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
20835
20854
  return ToastType2;
20836
20855
  })(ToastType || {});
20837
20856
  const FormComposer = "";
20838
- const logger$9 = createLogger("FormRouterContextProvider");
20857
+ const logger$a = createLogger("FormRouterContextProvider");
20839
20858
  function FormRouterContextProvider({
20840
20859
  children,
20841
20860
  forms,
@@ -20855,7 +20874,7 @@ function FormRouterContextProvider({
20855
20874
  if (formIndex > -1) {
20856
20875
  setFormIndex(formIndex);
20857
20876
  } else {
20858
- logger$9.error("No form was found to have that field so form navigation failed.");
20877
+ logger$a.error("No form was found to have that field so form navigation failed.");
20859
20878
  }
20860
20879
  }
20861
20880
  }), [forms, handleGetIdVerificationToken, setFormIndex]);
@@ -21455,7 +21474,7 @@ function CompanyDropinComponent({
21455
21474
  })
21456
21475
  });
21457
21476
  }
21458
- const logger$8 = createLogger("useLocalStorage");
21477
+ const logger$9 = createLogger("useLocalStorage");
21459
21478
  const useLocalStorage = (key, defaultValue, options) => {
21460
21479
  const {
21461
21480
  serializer,
@@ -21476,7 +21495,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21476
21495
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
21477
21496
  return res;
21478
21497
  } catch (err) {
21479
- logger$8.error(err);
21498
+ logger$9.error(err);
21480
21499
  return defaultValue;
21481
21500
  }
21482
21501
  });
@@ -21508,7 +21527,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21508
21527
  try {
21509
21528
  updateLocalStorage();
21510
21529
  } catch (err) {
21511
- logger$8.error(err);
21530
+ logger$9.error(err);
21512
21531
  }
21513
21532
  }, [value]);
21514
21533
  useEffect(() => {
@@ -21523,7 +21542,7 @@ const useLocalStorage = (key, defaultValue, options) => {
21523
21542
  setValue(event.newValue ? parser(event.newValue) : void 0);
21524
21543
  }
21525
21544
  } catch (err) {
21526
- logger$8.error(err);
21545
+ logger$9.error(err);
21527
21546
  }
21528
21547
  };
21529
21548
  if (typeof window === "undefined")
@@ -21607,7 +21626,7 @@ const useShouldShowBusinessTypeSelection = (accountHolder2) => {
21607
21626
  } = useExperimentsContext();
21608
21627
  return isExperimentEnabled("EnableNewEntryFlow") && !accountHolder2;
21609
21628
  };
21610
- const logger$7 = createLogger("useExemptSettlor");
21629
+ const logger$8 = createLogger("useExemptSettlor");
21611
21630
  const useExemptSettlor = ({
21612
21631
  trust: trust2,
21613
21632
  handleGetLegalEntity
@@ -21619,7 +21638,7 @@ const useExemptSettlor = ({
21619
21638
  setExemptSettlor(exemptSettlorLE);
21620
21639
  }, [handleGetLegalEntity]);
21621
21640
  useEffect(() => {
21622
- updateExemptSettlor(trust2).catch(logger$7.error);
21641
+ updateExemptSettlor(trust2).catch(logger$8.error);
21623
21642
  }, [trust2, updateExemptSettlor]);
21624
21643
  return exemptSettlor;
21625
21644
  };
@@ -22136,14 +22155,19 @@ const legalArrangementItems = [{
22136
22155
  name: "trust",
22137
22156
  description: "youAreTrusteeManagingTheTrustForBeneficiaries"
22138
22157
  }, {
22139
- id: "aPartnership",
22140
- accountHolder: "aPartnership",
22141
- name: "partnership",
22142
- description: "jointlyOwnedBusinessWhereTwoOrMorePeopleOperateAndShareProfits"
22158
+ id: "incorporatedPartnership",
22159
+ accountHolder: "incorporatedPartnership",
22160
+ name: "incorporatedPartnership",
22161
+ description: "incorporatedPartnershipNewEntryFlowDescription"
22162
+ }, {
22163
+ id: "unincorporatedPartnership",
22164
+ accountHolder: "unincorporatedPartnership",
22165
+ name: "unincorporatedPartnership",
22166
+ description: "unincorporatedPartnershipNewEntryFlowDescription"
22143
22167
  }, {
22144
22168
  id: "anAssociation",
22145
22169
  accountHolder: "anAssociation",
22146
- name: "association",
22170
+ name: "associationIncorporatedTitle",
22147
22171
  description: "groupOfPeopleActingTogetherForNonCommercialPurpose"
22148
22172
  }];
22149
22173
  const trusteeTypeItems = [{
@@ -22164,9 +22188,6 @@ const getFormSchema = (isLegalArrangement, isTrust) => {
22164
22188
  return schema;
22165
22189
  };
22166
22190
  const getBusinessTypes = (includeTrust, includeSoleProp) => businessTypes.filter((businessType) => {
22167
- if (businessType.id === "legalArrangement") {
22168
- return includeTrust;
22169
- }
22170
22191
  if (businessType.id === "soleProprietorship") {
22171
22192
  return includeSoleProp;
22172
22193
  }
@@ -22216,6 +22237,9 @@ const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, c
22216
22237
  if (isOrganization && businessType === "legalArrangement" && legalArrangement === "aTrust" && trusteeType === "individual" || businessType === "individual" || businessType === "soleProprietorship") {
22217
22238
  return LegalEntityType.INDIVIDUAL;
22218
22239
  }
22240
+ if (legalArrangement === "incorporatedPartnership") {
22241
+ return LegalEntityType.ORGANIZATION;
22242
+ }
22219
22243
  return currentLegalEntityType;
22220
22244
  };
22221
22245
  const BusinessTypeSelection = ({
@@ -22247,7 +22271,7 @@ const BusinessTypeSelection = ({
22247
22271
  const businessTypeItems = getBusinessTypes(showTrustOption, showSolePropOption);
22248
22272
  const getDefaultBusinessType = () => {
22249
22273
  if (accountHolder2) {
22250
- if (["aTrust", "aPartnership", "anAssociation"].includes(accountHolder2)) {
22274
+ if (["aTrust", "incorporatedPartnership", "unincorporatedPartnership", "anAssociation"].includes(accountHolder2)) {
22251
22275
  return businessTypeItems.find((businessTypeItem) => businessTypeItem.id === "legalArrangement");
22252
22276
  }
22253
22277
  return businessTypeItems.find((businessTypeItem) => businessTypeItem.accountHolder === accountHolder2);
@@ -22284,7 +22308,7 @@ const BusinessTypeSelection = ({
22284
22308
  setFormSchema(getFormSchema(((_a2 = data.businessType) == null ? void 0 : _a2.id) === "legalArrangement" && !!data.legalArrangement || currentStep === 1, ((_b2 = data.legalArrangement) == null ? void 0 : _b2.id) === "aTrust"));
22285
22309
  }, [data.businessType, data.legalArrangement, currentStep]);
22286
22310
  const handleNextClick = async () => {
22287
- var _a2, _b2, _c2;
22311
+ var _a2, _b2;
22288
22312
  if (loadingStatus === "loading")
22289
22313
  return;
22290
22314
  triggerValidation();
@@ -22297,7 +22321,8 @@ const BusinessTypeSelection = ({
22297
22321
  );
22298
22322
  return;
22299
22323
  }
22300
- if (((_b2 = data.legalArrangement) == null ? void 0 : _b2.id) === "aPartnership" || ((_c2 = data.legalArrangement) == null ? void 0 : _c2.id) === "anAssociation") {
22324
+ const legalArrangementId = (_b2 = data.legalArrangement) == null ? void 0 : _b2.id;
22325
+ if (legalArrangementId === "anAssociation" || legalArrangementId === "unincorporatedPartnership") {
22301
22326
  setCurrentStep(
22302
22327
  2
22303
22328
  /* WE_CANNOT_SET_UP_ACCOUNT */
@@ -22320,13 +22345,33 @@ const BusinessTypeSelection = ({
22320
22345
  }
22321
22346
  };
22322
22347
  const updateLegalEntityAndSelectAccountHolder = async () => {
22348
+ var _a2;
22349
+ const selectedLegalArrangement = (_a2 = data.legalArrangement) == null ? void 0 : _a2.id;
22323
22350
  try {
22324
22351
  if (legalEntityResponse.type !== targetLegalEntityType) {
22325
22352
  setLoadingStatus("loading");
22326
- await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
22327
- type: targetLegalEntityType,
22328
- entityAssociations: []
22329
- }, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
22353
+ const updateLegalEntityPayload = {
22354
+ type: targetLegalEntityType
22355
+ };
22356
+ await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity(updateLegalEntityPayload, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
22357
+ if (selectedLegalArrangement === "incorporatedPartnership") {
22358
+ await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
22359
+ type: LegalEntityType.ORGANIZATION
22360
+ }, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
22361
+ await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
22362
+ organization: {
22363
+ type: CompanyTypesValue.INCORPORATED_PARTNERSHIP
22364
+ }
22365
+ }, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
22366
+ }
22367
+ } else if (newAccountHolder !== accountHolder2) {
22368
+ if (newAccountHolder === "theCompanyIWorkFor") {
22369
+ await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity({
22370
+ organization: {
22371
+ type: ""
22372
+ }
22373
+ }, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
22374
+ }
22330
22375
  }
22331
22376
  } catch (e) {
22332
22377
  showToast({
@@ -23218,154 +23263,13 @@ function Shimmer() {
23218
23263
  })]
23219
23264
  });
23220
23265
  }
23221
- function LegalEntityTypeSwitcher({
23222
- targetLegalEntityType,
23223
- handleHomeClick,
23224
- onLegalEntityTypeChange,
23225
- handleUpdateLegalEntity,
23226
- legalEntityResponse
23227
- }) {
23228
- const {
23229
- i18n
23230
- } = useI18nContext();
23231
- const [loadingStatus, setLoadingStatus] = useState(null);
23232
- const {
23233
- showToast
23234
- } = useToastContext();
23235
- const changeLegalEntityType = async () => {
23236
- try {
23237
- setLoadingStatus("loading");
23238
- await handleUpdateLegalEntity({
23239
- type: targetLegalEntityType
23240
- }, legalEntityResponse.id);
23241
- showToast({
23242
- label: i18n.get("successfullyUpdatedDetails"),
23243
- type: ToastType.SUCCESS
23244
- });
23245
- onLegalEntityTypeChange();
23246
- } catch (e) {
23247
- showToast({
23248
- label: i18n.get("failedToUpdateDetails"),
23249
- type: ToastType.ERROR
23250
- });
23251
- } finally {
23252
- setLoadingStatus("success");
23253
- }
23254
- };
23255
- const content = (targetLegalEntityType2) => {
23256
- switch (targetLegalEntityType2) {
23257
- case LegalEntityType.ORGANIZATION:
23258
- return jsxs(Fragment, {
23259
- children: [jsx("h2", {
23260
- className: "adyen-kyc-form-header__heading",
23261
- "data-testid": LegalEntityType.ORGANIZATION,
23262
- children: i18n.get("areYouACompany")
23263
- }), jsx("span", {
23264
- children: i18n.get("singingUpAsIndividualButLooksLikeYouAreACompany")
23265
- }), jsx("p", {
23266
- children: i18n.get("wouldYouLikeToSignUpAsCompanyInstead")
23267
- })]
23268
- });
23269
- case LegalEntityType.INDIVIDUAL:
23270
- return jsxs(Fragment, {
23271
- children: [jsx("h2", {
23272
- className: "adyen-kyc-form-header__heading",
23273
- "data-testid": LegalEntityType.INDIVIDUAL,
23274
- children: i18n.get("areYouAnIndividual")
23275
- }), jsx("span", {
23276
- children: i18n.get("singingUpAsCompanyButLooksLikeYouAreAnIndividual")
23277
- }), jsx("p", {
23278
- children: i18n.get("wouldYouLikeToSignUpAsIndividualInstead")
23279
- })]
23280
- });
23281
- default:
23282
- jsx("p", {
23283
- children: "Change not supported"
23284
- });
23285
- }
23286
- };
23287
- const footer = jsx(ActionBar, {
23288
- onHome: handleHomeClick,
23289
- homeButtonLabel: i18n.get("noGoBack"),
23290
- onNext: changeLegalEntityType,
23291
- nextButtonLabel: targetLegalEntityType === LegalEntityType.ORGANIZATION ? i18n.get("continueCompany") : i18n.get("continueIndividual")
23292
- });
23293
- return jsx(DropinLayout, {
23294
- content: jsxs(LoaderWrapper, {
23295
- status: loadingStatus,
23296
- formOpacityWhenLoading: 0.3,
23297
- showSpinner: false,
23298
- children: [content(targetLegalEntityType), footer]
23299
- })
23300
- });
23301
- }
23302
- function ReviewComponent({
23303
- legalEntityId,
23304
- handleReviewConfirm,
23305
- handleHomeClick
23306
- }) {
23307
- const {
23308
- i18n
23309
- } = useI18nContext();
23310
- const [loadingStatus, setLoadingStatus] = useState();
23311
- const {
23312
- showToast
23313
- } = useToastContext();
23314
- const [hasConfirmed, setHasConfirmed] = useState(false);
23315
- const content = jsx("div", {
23316
- children: jsxs(LoaderWrapper, {
23317
- status: loadingStatus,
23318
- formOpacityWhenLoading: 0.3,
23319
- showSpinner: false,
23320
- children: [jsx(FormHeader, {
23321
- heading: i18n.get("submitReviewOfYourData")
23322
- }), jsx("span", {
23323
- children: i18n.get("pleaseNote")
23324
- }), jsx("br", {}), jsx("br", {}), jsx(Checkbox, {
23325
- checked: hasConfirmed,
23326
- onChange: setHasConfirmed,
23327
- label: i18n.get("byClickingSubmitReview"),
23328
- name: "confirmReviewData"
23329
- })]
23330
- })
23331
- });
23332
- const onConfirmClick = async () => {
23333
- try {
23334
- setLoadingStatus("loading");
23335
- await handleReviewConfirm(legalEntityId);
23336
- setLoadingStatus("success");
23337
- showToast({
23338
- label: i18n.get("submitSuccessful"),
23339
- type: ToastType.SUCCESS
23340
- });
23341
- handleHomeClick();
23342
- } catch {
23343
- showToast({
23344
- label: i18n.get("submitFailed"),
23345
- type: ToastType.ERROR
23346
- });
23347
- } finally {
23348
- setLoadingStatus("success");
23349
- }
23350
- };
23351
- const footer = jsx(ActionBar, {
23352
- onHome: handleHomeClick,
23353
- homeButtonLabel: i18n.get("goToOverview"),
23354
- onNext: onConfirmClick,
23355
- nextButtonLabel: i18n.get("submitReview"),
23356
- nextButtonDisabled: !hasConfirmed
23357
- });
23358
- return jsx(DropinLayout, {
23359
- content,
23360
- footer
23361
- });
23362
- }
23363
23266
  const _introduction_component = "";
23364
23267
  var IntroductionScreens = ((IntroductionScreens2) => {
23365
23268
  IntroductionScreens2["PROLOGUE"] = "PROLOGUE";
23366
23269
  IntroductionScreens2[IntroductionScreens2["COMPANY"] = TaskTypes.COMPANY] = "COMPANY";
23367
23270
  IntroductionScreens2[IntroductionScreens2["INDIVIDUAL"] = TaskTypes.INDIVIDUAL] = "INDIVIDUAL";
23368
23271
  IntroductionScreens2[IntroductionScreens2["DECISION_MAKER"] = TaskTypes.DECISION_MAKER] = "DECISION_MAKER";
23272
+ IntroductionScreens2[IntroductionScreens2["SOLE_PROPRIETOR_COMPANY"] = TaskTypes.SOLE_PROPRIETOR_COMPANY] = "SOLE_PROPRIETOR_COMPANY";
23369
23273
  IntroductionScreens2[IntroductionScreens2["TRUST"] = TaskTypes.TRUST] = "TRUST";
23370
23274
  IntroductionScreens2[IntroductionScreens2["TRUST_MEMBER_OVERVIEW"] = TaskTypes.TRUST_MEMBER_OVERVIEW] = "TRUST_MEMBER_OVERVIEW";
23371
23275
  IntroductionScreens2["ACCOUNT"] = "ACCOUNT";
@@ -23375,7 +23279,7 @@ var IntroductionScreens = ((IntroductionScreens2) => {
23375
23279
  const introductionScreensByLegalEntityType = {
23376
23280
  [LegalEntityType.INDIVIDUAL]: [IntroductionScreens.PROLOGUE, IntroductionScreens.INDIVIDUAL, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
23377
23281
  [LegalEntityType.ORGANIZATION]: [IntroductionScreens.PROLOGUE, IntroductionScreens.COMPANY, IntroductionScreens.DECISION_MAKER, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
23378
- [LegalEntityType.SOLE_PROPRIETORSHIP]: [IntroductionScreens.PROLOGUE, IntroductionScreens.INDIVIDUAL, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
23282
+ [LegalEntityType.SOLE_PROPRIETORSHIP]: [IntroductionScreens.PROLOGUE, IntroductionScreens.INDIVIDUAL, IntroductionScreens.SOLE_PROPRIETOR_COMPANY, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
23379
23283
  [LegalEntityType.TRUST]: [IntroductionScreens.PROLOGUE, IntroductionScreens.COMPANY, IntroductionScreens.INDIVIDUAL, IntroductionScreens.DECISION_MAKER, IntroductionScreens.TRUST, IntroductionScreens.TRUST_MEMBER_OVERVIEW, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE]
23380
23284
  };
23381
23285
  const useIntroductionScreens = ({
@@ -23388,13 +23292,17 @@ const useIntroductionScreens = ({
23388
23292
  const legalEntityType = useLegalEntityType({
23389
23293
  legalEntity
23390
23294
  });
23391
- const introductionScreens = useMemo$1(() => legalEntityType ? introductionScreensByLegalEntityType[legalEntityType].filter((screen) => {
23295
+ const introductionScreens = useMemo$1(() => legalEntityType ? introductionScreensByLegalEntityType[legalEntityType].filter((screen, _i, a) => {
23392
23296
  const isAccountScreen = screen === IntroductionScreens.ACCOUNT;
23393
23297
  const hasAccountTask = tasks.includes(TaskTypes.PAYIN) || tasks.includes(TaskTypes.PAYOUT);
23298
+ const isSoleProprietorScreen = screen === IntroductionScreens.SOLE_PROPRIETOR_COMPANY;
23299
+ const isSoleProprietor = legalEntityType === LegalEntityType.SOLE_PROPRIETORSHIP;
23394
23300
  const isTrustScreen = screen === IntroductionScreens.TRUST || screen === IntroductionScreens.TRUST_MEMBER_OVERVIEW;
23395
23301
  const isTrust = legalEntityType === LegalEntityType.TRUST;
23396
23302
  if (isAccountScreen)
23397
23303
  return hasAccountTask;
23304
+ if (isSoleProprietorScreen)
23305
+ return isSoleProprietor;
23398
23306
  if (isTrustScreen)
23399
23307
  return isTrust;
23400
23308
  return tasks.some((task) => screen === task);
@@ -23538,6 +23446,148 @@ const Introduction = ({
23538
23446
  })]
23539
23447
  }) : null;
23540
23448
  };
23449
+ function LegalEntityTypeSwitcher({
23450
+ targetLegalEntityType,
23451
+ handleHomeClick,
23452
+ onLegalEntityTypeChange,
23453
+ handleUpdateLegalEntity,
23454
+ legalEntityResponse
23455
+ }) {
23456
+ const {
23457
+ i18n
23458
+ } = useI18nContext();
23459
+ const [loadingStatus, setLoadingStatus] = useState(null);
23460
+ const {
23461
+ showToast
23462
+ } = useToastContext();
23463
+ const changeLegalEntityType = async () => {
23464
+ try {
23465
+ setLoadingStatus("loading");
23466
+ await handleUpdateLegalEntity({
23467
+ type: targetLegalEntityType
23468
+ }, legalEntityResponse.id);
23469
+ showToast({
23470
+ label: i18n.get("successfullyUpdatedDetails"),
23471
+ type: ToastType.SUCCESS
23472
+ });
23473
+ onLegalEntityTypeChange();
23474
+ } catch (e) {
23475
+ showToast({
23476
+ label: i18n.get("failedToUpdateDetails"),
23477
+ type: ToastType.ERROR
23478
+ });
23479
+ } finally {
23480
+ setLoadingStatus("success");
23481
+ }
23482
+ };
23483
+ const content = (targetLegalEntityType2) => {
23484
+ switch (targetLegalEntityType2) {
23485
+ case LegalEntityType.ORGANIZATION:
23486
+ return jsxs(Fragment, {
23487
+ children: [jsx("h2", {
23488
+ className: "adyen-kyc-form-header__heading",
23489
+ "data-testid": LegalEntityType.ORGANIZATION,
23490
+ children: i18n.get("areYouACompany")
23491
+ }), jsx("span", {
23492
+ children: i18n.get("singingUpAsIndividualButLooksLikeYouAreACompany")
23493
+ }), jsx("p", {
23494
+ children: i18n.get("wouldYouLikeToSignUpAsCompanyInstead")
23495
+ })]
23496
+ });
23497
+ case LegalEntityType.INDIVIDUAL:
23498
+ return jsxs(Fragment, {
23499
+ children: [jsx("h2", {
23500
+ className: "adyen-kyc-form-header__heading",
23501
+ "data-testid": LegalEntityType.INDIVIDUAL,
23502
+ children: i18n.get("areYouAnIndividual")
23503
+ }), jsx("span", {
23504
+ children: i18n.get("singingUpAsCompanyButLooksLikeYouAreAnIndividual")
23505
+ }), jsx("p", {
23506
+ children: i18n.get("wouldYouLikeToSignUpAsIndividualInstead")
23507
+ })]
23508
+ });
23509
+ default:
23510
+ jsx("p", {
23511
+ children: "Change not supported"
23512
+ });
23513
+ }
23514
+ };
23515
+ const footer = jsx(ActionBar, {
23516
+ onHome: handleHomeClick,
23517
+ homeButtonLabel: i18n.get("noGoBack"),
23518
+ onNext: changeLegalEntityType,
23519
+ nextButtonLabel: targetLegalEntityType === LegalEntityType.ORGANIZATION ? i18n.get("continueCompany") : i18n.get("continueIndividual")
23520
+ });
23521
+ return jsx(DropinLayout, {
23522
+ content: jsxs(LoaderWrapper, {
23523
+ status: loadingStatus,
23524
+ formOpacityWhenLoading: 0.3,
23525
+ showSpinner: false,
23526
+ children: [content(targetLegalEntityType), footer]
23527
+ })
23528
+ });
23529
+ }
23530
+ function ReviewComponent({
23531
+ legalEntityId,
23532
+ handleReviewConfirm,
23533
+ handleHomeClick
23534
+ }) {
23535
+ const {
23536
+ i18n
23537
+ } = useI18nContext();
23538
+ const [loadingStatus, setLoadingStatus] = useState();
23539
+ const {
23540
+ showToast
23541
+ } = useToastContext();
23542
+ const [hasConfirmed, setHasConfirmed] = useState(false);
23543
+ const content = jsx("div", {
23544
+ children: jsxs(LoaderWrapper, {
23545
+ status: loadingStatus,
23546
+ formOpacityWhenLoading: 0.3,
23547
+ showSpinner: false,
23548
+ children: [jsx(FormHeader, {
23549
+ heading: i18n.get("submitReviewOfYourData")
23550
+ }), jsx("span", {
23551
+ children: i18n.get("pleaseNote")
23552
+ }), jsx("br", {}), jsx("br", {}), jsx(Checkbox, {
23553
+ checked: hasConfirmed,
23554
+ onChange: setHasConfirmed,
23555
+ label: i18n.get("byClickingSubmitReview"),
23556
+ name: "confirmReviewData"
23557
+ })]
23558
+ })
23559
+ });
23560
+ const onConfirmClick = async () => {
23561
+ try {
23562
+ setLoadingStatus("loading");
23563
+ await handleReviewConfirm(legalEntityId);
23564
+ setLoadingStatus("success");
23565
+ showToast({
23566
+ label: i18n.get("submitSuccessful"),
23567
+ type: ToastType.SUCCESS
23568
+ });
23569
+ handleHomeClick();
23570
+ } catch {
23571
+ showToast({
23572
+ label: i18n.get("submitFailed"),
23573
+ type: ToastType.ERROR
23574
+ });
23575
+ } finally {
23576
+ setLoadingStatus("success");
23577
+ }
23578
+ };
23579
+ const footer = jsx(ActionBar, {
23580
+ onHome: handleHomeClick,
23581
+ homeButtonLabel: i18n.get("goToOverview"),
23582
+ onNext: onConfirmClick,
23583
+ nextButtonLabel: i18n.get("submitReview"),
23584
+ nextButtonDisabled: !hasConfirmed
23585
+ });
23586
+ return jsx(DropinLayout, {
23587
+ content,
23588
+ footer
23589
+ });
23590
+ }
23541
23591
  const TaskList = "";
23542
23592
  const businessTypeMapping = {
23543
23593
  myName: {
@@ -23566,7 +23616,7 @@ const useBusinessSetup = (legalEntityResponse) => {
23566
23616
  const accountHolderType = accountHolder2 || getDefaultAccountHolderType(legalEntityResponse);
23567
23617
  const businessSetup = (_a = businessTypeMapping[accountHolderType]) == null ? void 0 : _a[legalEntityResponse == null ? void 0 : legalEntityResponse.type];
23568
23618
  return {
23569
- businessSetup
23619
+ businessSetup: businessSetup || accountHolder2
23570
23620
  };
23571
23621
  };
23572
23622
  const useEnableNewEntryFlow = () => {
@@ -24297,7 +24347,9 @@ function IndividualDropinComponent({
24297
24347
  handleUpdateLegalEntity,
24298
24348
  trustMember,
24299
24349
  onSubmit: externalOnSubmit,
24300
- onTypeSwitch
24350
+ onTypeSwitch,
24351
+ hideNavigation = false,
24352
+ handleBackClick: externalBackClick
24301
24353
  }) {
24302
24354
  var _a, _b, _c, _d;
24303
24355
  const {
@@ -24314,6 +24366,9 @@ function IndividualDropinComponent({
24314
24366
  const {
24315
24367
  getConfiguration: getConfiguration2
24316
24368
  } = useConfigurationApi();
24369
+ const {
24370
+ isEmbeddedDropin
24371
+ } = useAuthContext();
24317
24372
  let dataFromResponse = mapLegalEntityToIndividual(legalEntityResponse, isTargetLegalEntityType);
24318
24373
  const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
24319
24374
  let roleTypes = [];
@@ -24355,7 +24410,8 @@ function IndividualDropinComponent({
24355
24410
  const fieldsFromCustomRules = useMemo(() => rules$3({
24356
24411
  data,
24357
24412
  country: country2,
24358
- taskType
24413
+ taskType,
24414
+ isEmbeddedDropin
24359
24415
  }), [country2, data, taskType]);
24360
24416
  const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, individualForms, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse) : [], fieldsFromCustomRules), [fieldConfigurations, fieldsFromCustomRules, problems == null ? void 0 : problems.remediationActions]);
24361
24417
  const {
@@ -24673,6 +24729,7 @@ function IndividualDropinComponent({
24673
24729
  } = useFormComposer({
24674
24730
  problems,
24675
24731
  baseTrackingPayload,
24732
+ externalBackClick,
24676
24733
  forms,
24677
24734
  formRef,
24678
24735
  onSubmit
@@ -24699,6 +24756,7 @@ function IndividualDropinComponent({
24699
24756
  validateForm: () => setShouldValidate(true),
24700
24757
  canSubmit: canSubmit2() && hasDataChanged(dataFromResponse, data),
24701
24758
  problems,
24759
+ hideNavigation,
24702
24760
  children: jsx(IndividualComponent, {
24703
24761
  ...derivedProps,
24704
24762
  capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
@@ -26385,7 +26443,7 @@ const serviceAgreementValidationRules = {
26385
26443
  errorMessage: "fieldIsRequired"
26386
26444
  }
26387
26445
  };
26388
- const logger$6 = createLogger("useServiceAgreement");
26446
+ const logger$7 = createLogger("useServiceAgreement");
26389
26447
  const FALLBACK_LANGUAGE_CODE = "en";
26390
26448
  const useServiceAgreement = ({
26391
26449
  handleGetServiceAgreement,
@@ -26414,7 +26472,7 @@ const useServiceAgreement = ({
26414
26472
  language: agreementLanguage
26415
26473
  });
26416
26474
  if (!document2) {
26417
- logger$6.log('"document" field was missing in response');
26475
+ logger$7.log('"document" field was missing in response');
26418
26476
  return;
26419
26477
  }
26420
26478
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -26432,7 +26490,7 @@ const useServiceAgreement = ({
26432
26490
  throw err;
26433
26491
  }
26434
26492
  };
26435
- requestServiceAgreement().catch(logger$6.error);
26493
+ requestServiceAgreement().catch(logger$7.error);
26436
26494
  }, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
26437
26495
  return {
26438
26496
  loading: loading2,
@@ -27774,7 +27832,7 @@ function TrustDropinComponent(props) {
27774
27832
  }
27775
27833
  const PAGES_WITH_STATUS = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
27776
27834
  const POLLING_INTERVAL = 3e3;
27777
- const logger$5 = createLogger("DropinComposerComponent");
27835
+ const logger$6 = createLogger("DropinComposerComponent");
27778
27836
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
27779
27837
  function DropinComposerComponent({
27780
27838
  capabilities,
@@ -27867,7 +27925,7 @@ function DropinComposerComponent({
27867
27925
  setPciStatus(response);
27868
27926
  return response;
27869
27927
  } catch (e) {
27870
- logger$5.warn(i18n.get("failedToGetPciStatus"));
27928
+ logger$6.warn(i18n.get("failedToGetPciStatus"));
27871
27929
  }
27872
27930
  }
27873
27931
  return void 0;
@@ -27896,7 +27954,7 @@ function DropinComposerComponent({
27896
27954
  useEffect(() => {
27897
27955
  if (!tasks.includes(TaskTypes.PCI_DSS))
27898
27956
  return;
27899
- getPciTemplate().catch(logger$5.error);
27957
+ getPciTemplate().catch(logger$6.error);
27900
27958
  }, [getPciTemplate, tasks]);
27901
27959
  const getServiceAgreementAcceptanceInfos = async () => {
27902
27960
  if (legalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
@@ -27904,7 +27962,7 @@ function DropinComposerComponent({
27904
27962
  const response = await args.handleGetServiceAgreementAcceptanceInfos(legalEntity.id);
27905
27963
  setServiceAgreementAcceptanceInfos(response.data);
27906
27964
  } catch (e) {
27907
- logger$5.warn(i18n.get("failedToGetServiceAgreementStatus"));
27965
+ logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
27908
27966
  }
27909
27967
  }
27910
27968
  };
@@ -27914,7 +27972,7 @@ function DropinComposerComponent({
27914
27972
  const response = await args.handleGetServiceAgreementStatus(legalEntity.id);
27915
27973
  setServiceAgreementTypes(response.termsOfServiceTypes);
27916
27974
  } catch (e) {
27917
- logger$5.warn(i18n.get("failedToGetServiceAgreementStatus"));
27975
+ logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
27918
27976
  }
27919
27977
  }
27920
27978
  };
@@ -27953,7 +28011,7 @@ function DropinComposerComponent({
27953
28011
  setCapabilityProblems(getCapabilityProblems(response));
27954
28012
  return response;
27955
28013
  } catch (e) {
27956
- logger$5.warn(i18n.get("failedToFetchLegalEntityDetails"));
28014
+ logger$6.warn(i18n.get("failedToFetchLegalEntityDetails"));
27957
28015
  }
27958
28016
  }
27959
28017
  return void 0;
@@ -27965,7 +28023,7 @@ function DropinComposerComponent({
27965
28023
  setTrust(response);
27966
28024
  return response;
27967
28025
  } catch (e) {
27968
- logger$5.warn(i18n.get("failedToFetchTrustDetails"));
28026
+ logger$6.warn(i18n.get("failedToFetchTrustDetails"));
27969
28027
  }
27970
28028
  }
27971
28029
  return void 0;
@@ -28015,7 +28073,7 @@ function DropinComposerComponent({
28015
28073
  label: i18n.get("successFullyRemovedTrustMember")
28016
28074
  });
28017
28075
  } catch (err) {
28018
- logger$5.error(`Failed to delete trust member`, err);
28076
+ logger$6.error(`Failed to delete trust member`, err);
28019
28077
  showToast({
28020
28078
  type: ToastType.ERROR,
28021
28079
  label: i18n.get("failedToRemoveTrustMember")
@@ -28085,7 +28143,7 @@ function DropinComposerComponent({
28085
28143
  }
28086
28144
  break;
28087
28145
  default:
28088
- logger$5.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
28146
+ logger$6.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
28089
28147
  }
28090
28148
  showToast({
28091
28149
  label: i18n.get("successfullyUpdatedDetails"),
@@ -28093,7 +28151,7 @@ function DropinComposerComponent({
28093
28151
  });
28094
28152
  await refreshTrustAndRunOnSubmit(trust2, 1);
28095
28153
  } catch (err) {
28096
- logger$5.error(err);
28154
+ logger$6.error(err);
28097
28155
  showToast({
28098
28156
  label: i18n.get("failedToUpdateDetails"),
28099
28157
  type: ToastType.ERROR
@@ -28316,7 +28374,7 @@ function DropinComposerComponent({
28316
28374
  }
28317
28375
  };
28318
28376
  setIsLoadingConfiguration(true);
28319
- fetchConfiguration().catch(logger$5.error).finally(() => {
28377
+ fetchConfiguration().catch(logger$6.error).finally(() => {
28320
28378
  setIsLoadingConfiguration(false);
28321
28379
  onLoad();
28322
28380
  });
@@ -28700,6 +28758,22 @@ const createDocument = async (context, document2, ownerId) => {
28700
28758
  }
28701
28759
  }, document2);
28702
28760
  };
28761
+ const createLegalEntity = async (context, legalEntity) => {
28762
+ const {
28763
+ loadingContext,
28764
+ legalEntityId
28765
+ } = context;
28766
+ return httpPost({
28767
+ loadingContext,
28768
+ errorLevel: "warn",
28769
+ errorMessage: `LegalEntity creation available`,
28770
+ path: `${legalEntityId}`,
28771
+ authentication: "jwt",
28772
+ headers: {
28773
+ "Content-Type": "application/json"
28774
+ }
28775
+ }, legalEntity);
28776
+ };
28703
28777
  const createTransferInstrument = async (context, transferInstrument) => {
28704
28778
  const {
28705
28779
  loadingContext,
@@ -28854,6 +28928,22 @@ const updateDocument = async (context, document2, documentId, ownerId) => {
28854
28928
  }
28855
28929
  }, document2);
28856
28930
  };
28931
+ const updateLegalEntity = async (context, legalEntity) => {
28932
+ const {
28933
+ loadingContext,
28934
+ legalEntityId
28935
+ } = context;
28936
+ return httpPost({
28937
+ loadingContext,
28938
+ errorLevel: "warn",
28939
+ errorMessage: `LegalEntity update failed`,
28940
+ path: `${legalEntityId}`,
28941
+ authentication: "jwt",
28942
+ headers: {
28943
+ "Content-Type": "application/json"
28944
+ }
28945
+ }, legalEntity);
28946
+ };
28857
28947
  const updateTransferInstrument = async (context, transferInstrument, transferInstrumentId) => {
28858
28948
  const {
28859
28949
  loadingContext,
@@ -28933,6 +29023,14 @@ const useComponentApi = (rootLegalEntityId) => {
28933
29023
  ...baseRequestContext,
28934
29024
  legalEntityId
28935
29025
  }),
29026
+ updateLegalEntity: async (legalEntity, legalEntityId) => updateLegalEntity({
29027
+ ...baseRequestContext,
29028
+ legalEntityId
29029
+ }, legalEntity),
29030
+ createLegalEntity: async (legalEntity) => createLegalEntity({
29031
+ ...baseRequestContext,
29032
+ legalEntityId: rootLegalEntityId
29033
+ }, legalEntity),
28936
29034
  getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
28937
29035
  getBankVerificationVendor: async (country2) => getBankVerificationVendor(baseRequestContext, country2),
28938
29036
  getDocument: async (documentId) => getDocument(baseRequestContext, documentId),
@@ -28964,12 +29062,65 @@ class EventEmitter {
28964
29062
  };
28965
29063
  }
28966
29064
  }
28967
- const logger$4 = createLogger("TransferInstrumentComponent");
28968
- function TransferInstrumentComponent({
29065
+ const logger$5 = createLogger("CreateIndividualComponent");
29066
+ function CreateIndividualComponent({
29067
+ parentLegalEntityId,
29068
+ legalEntityId,
29069
+ taskType,
29070
+ onSubmitSuccess,
29071
+ handleBackClick,
29072
+ eventEmitter
29073
+ }) {
29074
+ if (!legalEntityId && !parentLegalEntityId) {
29075
+ throw new Error("Must provide at-least one of parentLegalEntityId or legalEntityId");
29076
+ }
29077
+ const {
29078
+ getLegalEntity: getLegalEntity2,
29079
+ createLegalEntity: createLegalEntity2,
29080
+ updateLegalEntity: updateLegalEntity2,
29081
+ getDocument: getDocument2,
29082
+ createDocument: createDocument2,
29083
+ updateDocument: updateDocument2
29084
+ } = useComponentApi(legalEntityId ?? parentLegalEntityId);
29085
+ const [legalEntity, setLegalEntity] = useState();
29086
+ const [parentLegalEntity, setParentLegalEntity] = useState();
29087
+ const [loadingStatus, setLoadingStatus] = useState("loading");
29088
+ const fetchLegalEntity = useCallback(async () => {
29089
+ try {
29090
+ const [parentEntity, entity] = await Promise.all([parentLegalEntityId ? getLegalEntity2(parentLegalEntityId) : Promise.resolve(void 0), legalEntityId ? getLegalEntity2(legalEntityId) : Promise.resolve(void 0)]);
29091
+ setParentLegalEntity(parentEntity);
29092
+ setLegalEntity(entity);
29093
+ } catch (error) {
29094
+ logger$5.error(error);
29095
+ } finally {
29096
+ setLoadingStatus("success");
29097
+ }
29098
+ }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
29099
+ useEffect(() => {
29100
+ fetchLegalEntity().catch(logger$5.error);
29101
+ }, [fetchLegalEntity]);
29102
+ return loadingStatus === "loading" ? jsx(Loader, {
29103
+ size: "medium"
29104
+ }) : jsx(IndividualDropinComponent, {
29105
+ eventEmitter: eventEmitter ?? new EventEmitter(),
29106
+ parentLegalEntity,
29107
+ legalEntityResponse: legalEntity,
29108
+ handleGetDocument: getDocument2,
29109
+ handleCreateDocument: createDocument2,
29110
+ handleUpdateDocument: updateDocument2,
29111
+ handleUpdateLegalEntity: updateLegalEntity2,
29112
+ handleCreateLegalEntity: createLegalEntity2,
29113
+ handleBackClick,
29114
+ hideNavigation: true,
29115
+ onSubmit: onSubmitSuccess,
29116
+ taskType
29117
+ });
29118
+ }
29119
+ const logger$4 = createLogger("CreateTransferInstrumentComponent");
29120
+ function CreateTransferInstrumentComponent({
28969
29121
  legalEntityId,
28970
29122
  transferInstrumentId,
28971
- onChange,
28972
- onSubmit,
29123
+ onSubmitSuccess,
28973
29124
  handleBackClick,
28974
29125
  eventEmitter
28975
29126
  }) {
@@ -29015,8 +29166,7 @@ function TransferInstrumentComponent({
29015
29166
  handleBackClick,
29016
29167
  hideNavigation: true,
29017
29168
  refreshLegalEntity: fetchLegalEntity,
29018
- onChange,
29019
- onSubmit,
29169
+ onSubmit: onSubmitSuccess,
29020
29170
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
29021
29171
  handleBankVerificationError: handleBankVerificationError2,
29022
29172
  taskType: TaskTypes.PAYOUT
@@ -29030,7 +29180,8 @@ const componentsMap = {
29030
29180
  trustDropin: TrustDropinComponent,
29031
29181
  soleProprietorDropin: SolePropDropinComponent,
29032
29182
  pci: PciDropinComponent,
29033
- transferInstrumentComponent: TransferInstrumentComponent
29183
+ createTransferInstrumentComponent: CreateTransferInstrumentComponent,
29184
+ createIndividualComponent: CreateIndividualComponent
29034
29185
  };
29035
29186
  const AuthProvider = ({
29036
29187
  children,
@@ -29118,7 +29269,7 @@ const getEmbeddedApi = ({
29118
29269
  const [scenarios, tasks] = await Promise.all([getScenarios(baseRequestContext), getTasks(baseRequestContext)]);
29119
29270
  return {
29120
29271
  matchingScenario: {
29121
- [legalEntityType]: scenarios
29272
+ ...scenarios
29122
29273
  },
29123
29274
  taskList: tasks
29124
29275
  };
@@ -30252,11 +30403,8 @@ const pciDropinSchema = {
30252
30403
  }
30253
30404
  }
30254
30405
  };
30255
- const transferInstrumentComponentSchema = {
30256
- onChange: {
30257
- type: "function"
30258
- },
30259
- onSubmit: {
30406
+ const createTransferInstrumentComponentSchema = {
30407
+ onSubmitSuccess: {
30260
30408
  type: "function"
30261
30409
  },
30262
30410
  legalEntityId: {
@@ -30264,6 +30412,23 @@ const transferInstrumentComponentSchema = {
30264
30412
  required: true
30265
30413
  }
30266
30414
  };
30415
+ const createIndividualComponentSchema = {
30416
+ onSubmitSuccess: {
30417
+ type: "function"
30418
+ },
30419
+ legalEntityId: {
30420
+ type: "string"
30421
+ },
30422
+ parentLegalEntityId: {
30423
+ type: "string"
30424
+ },
30425
+ taskType: {
30426
+ type: "string"
30427
+ },
30428
+ handleBackClick: {
30429
+ type: "function"
30430
+ }
30431
+ };
30267
30432
  const componentsSchemaMap = {
30268
30433
  payoutAccount: payoutAccountSchema,
30269
30434
  soleProprietorDropin: solePropDropinSchema,
@@ -30272,7 +30437,8 @@ const componentsSchemaMap = {
30272
30437
  individualDropin: individualDropinSchema,
30273
30438
  trustDropin: trustDropinSchema,
30274
30439
  taskList: taskListSchema,
30275
- transferInstrumentComponent: transferInstrumentComponentSchema
30440
+ createIndividualComponent: createIndividualComponentSchema,
30441
+ createTransferInstrumentComponent: createTransferInstrumentComponentSchema
30276
30442
  };
30277
30443
  const validateComponentName = (componentName) => {
30278
30444
  if (!componentName) {