@adyen/kyc-components 2.33.0 → 2.34.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.
- package/dist/es/adyen-kyc-components.es.js +155 -154
- package/dist/style.css +6 -0
- package/dist/types/components/BankVerification/BankVerification.d.ts +1 -1
- package/dist/types/components/BankVerification/types.d.ts +5 -5
- package/dist/types/components/BusinessTypeSelection/utils.d.ts +2 -1
- package/dist/types/components/CompanyBasics/types.d.ts +3 -3
- package/dist/types/components/CompanyLookup/types.d.ts +4 -4
- package/dist/types/components/Individual/types.d.ts +2 -2
- package/dist/types/components/PayoutDetails/types.d.ts +2 -2
- package/dist/types/components/TaskList/component/TaskListComponent.d.ts +1 -1
- package/dist/types/components/TaskList/types.d.ts +3 -2
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/BusinessRegistrationNumberField/types.d.ts +2 -2
- package/dist/types/components/internal/EntityAssociation/types.d.ts +2 -2
- package/dist/types/components/internal/Remove/types.d.ts +3 -3
- package/dist/types/components/internal/TaxInformationField/types.d.ts +2 -2
- package/dist/types/components/internal/VatNumberField/types.d.ts +2 -2
- package/dist/types/core/Context/ExperimentContext/types.d.ts +2 -1
- package/dist/types/core/hooks/introduction/useHasSeenIntroduction.d.ts +1 -1
- package/dist/types/core/hooks/useCompanySearch/types.d.ts +2 -2
- package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +4 -3
- package/dist/types/core/hooks/useForm/types.d.ts +8 -8
- package/dist/types/core/hooks/useFormComposer.d.ts +2 -2
- package/dist/types/core/hooks/useLocalStorage.d.ts +2 -2
- package/dist/types/core/hooks/useTrust.d.ts +11 -0
- package/dist/types/language/config.d.ts +2 -1237
- package/dist/types/language/types.d.ts +1 -1
- package/dist/types/utils/entity-status-util.d.ts +1 -1
- package/dist/types/utils/trust-util.d.ts +2 -1
- package/dist/types/utils/useStateFromProp.d.ts +2 -2
- package/package.json +3 -5
|
@@ -16,6 +16,15 @@ const useConfigurationApi = () => {
|
|
|
16
16
|
}
|
|
17
17
|
return configurationApi;
|
|
18
18
|
};
|
|
19
|
+
const smartling = {
|
|
20
|
+
placeholder_format: "YAML",
|
|
21
|
+
translate_paths: [
|
|
22
|
+
{
|
|
23
|
+
path: "*",
|
|
24
|
+
key: "{*}"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
};
|
|
19
28
|
const close = "Close";
|
|
20
29
|
const individual = "Individual";
|
|
21
30
|
const payoutAccount = "Payout account";
|
|
@@ -1242,6 +1251,7 @@ const onboardingRedirectFinishedCtaButton = "View data";
|
|
|
1242
1251
|
const onboardingRedirectLinkError = "Onboarding link not available at the moment, please try again later.";
|
|
1243
1252
|
const onboardingRedirectOpenError = "Pop-up blocker prevented redirecting, please allow pop-ups for this site.";
|
|
1244
1253
|
const defaultTrans = {
|
|
1254
|
+
smartling,
|
|
1245
1255
|
close,
|
|
1246
1256
|
individual,
|
|
1247
1257
|
payoutAccount,
|
|
@@ -2477,7 +2487,10 @@ const defaultTrans = {
|
|
|
2477
2487
|
onboardingRedirectOpenError
|
|
2478
2488
|
};
|
|
2479
2489
|
const FALLBACK_LOCALE = "en-US";
|
|
2480
|
-
const defaultTranslation = defaultTrans
|
|
2490
|
+
const defaultTranslation = Object.entries(defaultTrans).reduce((acc, [translationKey, translationValue]) => translationKey !== "smartling" ? {
|
|
2491
|
+
...acc,
|
|
2492
|
+
[translationKey]: translationValue
|
|
2493
|
+
} : acc, {});
|
|
2481
2494
|
const determineAllowedAttributes = (allowedTags) => {
|
|
2482
2495
|
const allowedAttributes = [];
|
|
2483
2496
|
if (allowedTags.includes("a")) {
|
|
@@ -2955,7 +2968,7 @@ const icons = {
|
|
|
2955
2968
|
warning: lazy(() => import("./warning-99uFf1WU.js")),
|
|
2956
2969
|
wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
|
|
2957
2970
|
};
|
|
2958
|
-
const logger$
|
|
2971
|
+
const logger$w = createLogger("Icon");
|
|
2959
2972
|
const Icon = ({
|
|
2960
2973
|
className,
|
|
2961
2974
|
name,
|
|
@@ -2963,7 +2976,7 @@ const Icon = ({
|
|
|
2963
2976
|
}) => {
|
|
2964
2977
|
const LazyLoadedIcon = icons[name];
|
|
2965
2978
|
if (!LazyLoadedIcon) {
|
|
2966
|
-
logger$
|
|
2979
|
+
logger$w.error(`No such icon: "${name}"`);
|
|
2967
2980
|
return null;
|
|
2968
2981
|
}
|
|
2969
2982
|
return jsx("span", {
|
|
@@ -3167,7 +3180,7 @@ function useFormRouterContext() {
|
|
|
3167
3180
|
}
|
|
3168
3181
|
return context;
|
|
3169
3182
|
}
|
|
3170
|
-
const logger$
|
|
3183
|
+
const logger$v = createLogger("Link");
|
|
3171
3184
|
const getIconClass = (icon, external) => {
|
|
3172
3185
|
if (external) {
|
|
3173
3186
|
return "adl-link__icon adyen-kyc-icon-external-link";
|
|
@@ -3179,7 +3192,7 @@ const getIconClass = (icon, external) => {
|
|
|
3179
3192
|
};
|
|
3180
3193
|
const isValidLink = (href) => {
|
|
3181
3194
|
if (href === "#") {
|
|
3182
|
-
logger$
|
|
3195
|
+
logger$v.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
3183
3196
|
return false;
|
|
3184
3197
|
}
|
|
3185
3198
|
return true;
|
|
@@ -3467,7 +3480,7 @@ const useSetting = (settingName) => {
|
|
|
3467
3480
|
} = context;
|
|
3468
3481
|
return getSetting(settingName);
|
|
3469
3482
|
};
|
|
3470
|
-
const logger$
|
|
3483
|
+
const logger$u = createLogger("useAllowedCountries");
|
|
3471
3484
|
const useAllowedCountries = () => {
|
|
3472
3485
|
const acceptedCountries = useSetting("acceptedCountries");
|
|
3473
3486
|
const {
|
|
@@ -3477,7 +3490,7 @@ const useAllowedCountries = () => {
|
|
|
3477
3490
|
useEffect(() => {
|
|
3478
3491
|
if (acceptedCountries !== void 0)
|
|
3479
3492
|
return;
|
|
3480
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$
|
|
3493
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$u.error);
|
|
3481
3494
|
}, [acceptedCountries]);
|
|
3482
3495
|
return allowedCountries;
|
|
3483
3496
|
};
|
|
@@ -3816,7 +3829,7 @@ class ValidationResult {
|
|
|
3816
3829
|
return this.validationResults.filter((result) => result.hasError);
|
|
3817
3830
|
}
|
|
3818
3831
|
}
|
|
3819
|
-
const logger$
|
|
3832
|
+
const logger$t = createLogger("useAsyncValidator");
|
|
3820
3833
|
const useAsyncValidator = (asyncRules) => {
|
|
3821
3834
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3822
3835
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -3839,7 +3852,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
3839
3852
|
hasError: !isValid
|
|
3840
3853
|
}])
|
|
3841
3854
|
});
|
|
3842
|
-
}).catch(logger$
|
|
3855
|
+
}).catch(logger$t.error);
|
|
3843
3856
|
}, [asyncRules, clearAsyncValidationResults]);
|
|
3844
3857
|
return {
|
|
3845
3858
|
asyncValidationResults,
|
|
@@ -5270,7 +5283,7 @@ function useIsElementVisible(ref, fallback = true) {
|
|
|
5270
5283
|
}, [ref]);
|
|
5271
5284
|
return isOnScreen;
|
|
5272
5285
|
}
|
|
5273
|
-
const logger$
|
|
5286
|
+
const logger$s = createLogger("Flag");
|
|
5274
5287
|
const flagImports = /* @__PURE__ */ Object.assign({
|
|
5275
5288
|
"../../../../assets/flags/ad.svg": () => import("./ad-DT4vRaBJ.js"),
|
|
5276
5289
|
"../../../../assets/flags/ae.svg": () => import("./ae-BOcuAHGY.js"),
|
|
@@ -5527,7 +5540,7 @@ const flagImports = /* @__PURE__ */ Object.assign({
|
|
|
5527
5540
|
const getLazyLoadedSvgComponent = (country2) => {
|
|
5528
5541
|
const importForCountry = flagImports[`../../../../assets/flags/${country2.toLowerCase()}.svg`];
|
|
5529
5542
|
if (!importForCountry) {
|
|
5530
|
-
logger$
|
|
5543
|
+
logger$s.error(`No flag available for ${country2}`);
|
|
5531
5544
|
return void 0;
|
|
5532
5545
|
}
|
|
5533
5546
|
return lazy(importForCountry);
|
|
@@ -6316,7 +6329,7 @@ const deriveInputState = (isValid, isFocused, hasBlurred, isDisabled, errorMessa
|
|
|
6316
6329
|
};
|
|
6317
6330
|
};
|
|
6318
6331
|
const MISMATCH_ANIMATION_NAME = "mismatchShake";
|
|
6319
|
-
const logger$
|
|
6332
|
+
const logger$r = createLogger("MaskedInputText");
|
|
6320
6333
|
const MaskedInputText = ({
|
|
6321
6334
|
value,
|
|
6322
6335
|
onInput,
|
|
@@ -6358,7 +6371,7 @@ const MaskedInputText = ({
|
|
|
6358
6371
|
};
|
|
6359
6372
|
useEffect(() => {
|
|
6360
6373
|
if (!mask) {
|
|
6361
|
-
logger$
|
|
6374
|
+
logger$r.warn("`mask` is undefined. No masking of input will take place.");
|
|
6362
6375
|
}
|
|
6363
6376
|
}, [mask]);
|
|
6364
6377
|
const getMaskResult = useCallback((pureValue) => {
|
|
@@ -6385,7 +6398,7 @@ const MaskedInputText = ({
|
|
|
6385
6398
|
return;
|
|
6386
6399
|
}
|
|
6387
6400
|
const fallback = displayValueToPure(maskResult.partialDisplayValue);
|
|
6388
|
-
logger$
|
|
6401
|
+
logger$r.warn(`Value received "${value}" does not match mask`, maskResult, `
|
|
6389
6402
|
Falling back to partially valid value "${fallback}"`);
|
|
6390
6403
|
onInput(fallback);
|
|
6391
6404
|
}
|
|
@@ -10486,7 +10499,7 @@ const accountHolderValidationRules = {
|
|
|
10486
10499
|
}
|
|
10487
10500
|
};
|
|
10488
10501
|
const accountHolderFields = ["accountHolder"];
|
|
10489
|
-
const logger$
|
|
10502
|
+
const logger$q = createLogger("AccountHolder");
|
|
10490
10503
|
function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
|
|
10491
10504
|
switch (legalEntityType) {
|
|
10492
10505
|
case LegalEntityType.ORGANIZATION: {
|
|
@@ -10496,7 +10509,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
|
|
|
10496
10509
|
return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
|
|
10497
10510
|
}
|
|
10498
10511
|
default:
|
|
10499
|
-
logger$
|
|
10512
|
+
logger$q.error(`No available account holder options for legal entity type '${legalEntityType}'`);
|
|
10500
10513
|
return [];
|
|
10501
10514
|
}
|
|
10502
10515
|
}
|
|
@@ -11239,7 +11252,7 @@ function Dropzone(props) {
|
|
|
11239
11252
|
})]
|
|
11240
11253
|
});
|
|
11241
11254
|
}
|
|
11242
|
-
const logger$
|
|
11255
|
+
const logger$p = createLogger("TextArea");
|
|
11243
11256
|
function TextArea(props) {
|
|
11244
11257
|
const {
|
|
11245
11258
|
classNameModifiers,
|
|
@@ -11260,7 +11273,7 @@ function TextArea(props) {
|
|
|
11260
11273
|
} = useI18nContext();
|
|
11261
11274
|
const [value, setValue] = useState("");
|
|
11262
11275
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11263
|
-
logger$
|
|
11276
|
+
logger$p.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11264
11277
|
}
|
|
11265
11278
|
const handleInput = (e) => {
|
|
11266
11279
|
var _a;
|
|
@@ -11673,7 +11686,7 @@ function FieldContainer(props) {
|
|
|
11673
11686
|
}
|
|
11674
11687
|
return renderField(fieldName);
|
|
11675
11688
|
}
|
|
11676
|
-
const logger$
|
|
11689
|
+
const logger$o = createLogger("SearchAddress");
|
|
11677
11690
|
const SearchAddress = ({
|
|
11678
11691
|
data,
|
|
11679
11692
|
legalEntityId,
|
|
@@ -11716,7 +11729,7 @@ const SearchAddress = ({
|
|
|
11716
11729
|
const response = await handleFindAddress(selectedAddressId);
|
|
11717
11730
|
autocompleteAddressForm(response);
|
|
11718
11731
|
} catch (e) {
|
|
11719
|
-
logger$
|
|
11732
|
+
logger$o.error(e);
|
|
11720
11733
|
}
|
|
11721
11734
|
};
|
|
11722
11735
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -11728,7 +11741,7 @@ const SearchAddress = ({
|
|
|
11728
11741
|
}, legalEntityId);
|
|
11729
11742
|
setItems((response == null ? void 0 : response.results) || []);
|
|
11730
11743
|
} catch (e) {
|
|
11731
|
-
logger$
|
|
11744
|
+
logger$o.error(e);
|
|
11732
11745
|
}
|
|
11733
11746
|
};
|
|
11734
11747
|
const onChange = (e) => {
|
|
@@ -11783,7 +11796,7 @@ const SearchAddress = ({
|
|
|
11783
11796
|
setItems([]);
|
|
11784
11797
|
}
|
|
11785
11798
|
} catch (e) {
|
|
11786
|
-
logger$
|
|
11799
|
+
logger$o.error(e);
|
|
11787
11800
|
}
|
|
11788
11801
|
setLoading(false);
|
|
11789
11802
|
}
|
|
@@ -14728,7 +14741,7 @@ const initOnfido = async ({
|
|
|
14728
14741
|
language: getOnfidoLocaleConfig(i18n)
|
|
14729
14742
|
});
|
|
14730
14743
|
};
|
|
14731
|
-
const logger$
|
|
14744
|
+
const logger$n = createLogger("IdVerificationComponent");
|
|
14732
14745
|
function IdVerificationComponent({
|
|
14733
14746
|
userDetails,
|
|
14734
14747
|
legalEntityId,
|
|
@@ -14761,7 +14774,7 @@ function IdVerificationComponent({
|
|
|
14761
14774
|
onIdVerificationError,
|
|
14762
14775
|
onIdVerificationComplete
|
|
14763
14776
|
});
|
|
14764
|
-
})().catch(logger$
|
|
14777
|
+
})().catch(logger$n.error);
|
|
14765
14778
|
return () => {
|
|
14766
14779
|
if (onfidoSdk.current)
|
|
14767
14780
|
onfidoSdk.current.tearDown();
|
|
@@ -14813,7 +14826,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
14813
14826
|
})]
|
|
14814
14827
|
});
|
|
14815
14828
|
}
|
|
14816
|
-
const logger$
|
|
14829
|
+
const logger$m = createLogger("IdDocumentInstantVerificationComponent");
|
|
14817
14830
|
const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
|
|
14818
14831
|
const documentTypeValidationRules = {
|
|
14819
14832
|
instantIdVerificationData: {
|
|
@@ -14895,7 +14908,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
14895
14908
|
userDetails: props.userDetails,
|
|
14896
14909
|
legalEntityId: props.legalEntityId,
|
|
14897
14910
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
14898
|
-
onIdVerificationError: logger$
|
|
14911
|
+
onIdVerificationError: logger$m.error
|
|
14899
14912
|
}), jsxs("div", {
|
|
14900
14913
|
className: "adyen-kyc-document-upload__manual-upload",
|
|
14901
14914
|
children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
|
|
@@ -18339,7 +18352,7 @@ class AdyenKycSdkError extends Error {
|
|
|
18339
18352
|
}
|
|
18340
18353
|
let sdkToken;
|
|
18341
18354
|
let fetchSdkToken;
|
|
18342
|
-
const logger$
|
|
18355
|
+
const logger$l = createLogger("Session");
|
|
18343
18356
|
const setSdkToken = (token) => {
|
|
18344
18357
|
sdkToken = token;
|
|
18345
18358
|
};
|
|
@@ -18362,7 +18375,7 @@ const refreshSession = async () => {
|
|
|
18362
18375
|
setSdkToken(token);
|
|
18363
18376
|
isSessionRefreshed = true;
|
|
18364
18377
|
} catch (e) {
|
|
18365
|
-
logger$
|
|
18378
|
+
logger$l.error("Failed to fetch sdk token", e);
|
|
18366
18379
|
}
|
|
18367
18380
|
return isSessionRefreshed;
|
|
18368
18381
|
};
|
|
@@ -18372,7 +18385,7 @@ const addAnimationStartListener = (element, listener) => {
|
|
|
18372
18385
|
const removeAnimationStartListener = (element, listener) => {
|
|
18373
18386
|
element.removeEventListener("animationstart", listener, false);
|
|
18374
18387
|
};
|
|
18375
|
-
const logger$
|
|
18388
|
+
const logger$k = createLogger("Fetch");
|
|
18376
18389
|
const getRequestObject = (options, data) => {
|
|
18377
18390
|
const {
|
|
18378
18391
|
headers = [],
|
|
@@ -18419,10 +18432,10 @@ const logFetchError = (message, level) => {
|
|
|
18419
18432
|
case "info":
|
|
18420
18433
|
case "warn":
|
|
18421
18434
|
case "error":
|
|
18422
|
-
logger$
|
|
18435
|
+
logger$k[level](message);
|
|
18423
18436
|
break;
|
|
18424
18437
|
default:
|
|
18425
|
-
logger$
|
|
18438
|
+
logger$k.error(message);
|
|
18426
18439
|
}
|
|
18427
18440
|
};
|
|
18428
18441
|
const handleFetchResponse = async (response, responseType) => {
|
|
@@ -18515,7 +18528,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
18515
18528
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
18516
18529
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
18517
18530
|
const TINK_VENDOR = "Tink";
|
|
18518
|
-
const logger$
|
|
18531
|
+
const logger$j = createLogger("iframeWidget");
|
|
18519
18532
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
18520
18533
|
const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
18521
18534
|
const parseMessageJson = (message) => {
|
|
@@ -18534,7 +18547,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
18534
18547
|
try {
|
|
18535
18548
|
await response;
|
|
18536
18549
|
} catch (ex) {
|
|
18537
|
-
logger$
|
|
18550
|
+
logger$j.error(ex);
|
|
18538
18551
|
}
|
|
18539
18552
|
return {
|
|
18540
18553
|
error: "UNKNOWN_ERROR",
|
|
@@ -18643,7 +18656,7 @@ class IFrameWidget {
|
|
|
18643
18656
|
message = responseData.errorMessage;
|
|
18644
18657
|
}
|
|
18645
18658
|
} catch (ex) {
|
|
18646
|
-
logger$
|
|
18659
|
+
logger$j.error(ex);
|
|
18647
18660
|
}
|
|
18648
18661
|
throw new AdyenKycSdkError(reason, jsonData.error);
|
|
18649
18662
|
}
|
|
@@ -18831,7 +18844,7 @@ function BankVerificationWidget({
|
|
|
18831
18844
|
ref: widgetContainerRef
|
|
18832
18845
|
});
|
|
18833
18846
|
}
|
|
18834
|
-
const logger$
|
|
18847
|
+
const logger$i = createLogger("BankVerification");
|
|
18835
18848
|
const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
|
|
18836
18849
|
const InstantVerificationErrorContext = createContext(null);
|
|
18837
18850
|
const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
|
|
@@ -18865,7 +18878,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
|
|
|
18865
18878
|
const vendor = vendors[0];
|
|
18866
18879
|
setPreferredVendor(vendor.name ? vendor : void 0);
|
|
18867
18880
|
};
|
|
18868
|
-
getPreferredVendor().catch(logger$
|
|
18881
|
+
getPreferredVendor().catch(logger$i.error);
|
|
18869
18882
|
}, [country2, getBankVerificationVendors]);
|
|
18870
18883
|
return preferredVendor;
|
|
18871
18884
|
};
|
|
@@ -20128,7 +20141,7 @@ const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvi
|
|
|
20128
20141
|
}
|
|
20129
20142
|
});
|
|
20130
20143
|
const payoutVerificationMethods = ["instantVerification", "manualVerification"];
|
|
20131
|
-
const logger$
|
|
20144
|
+
const logger$h = createLogger("useLocalStorage");
|
|
20132
20145
|
const useLocalStorage = (key, defaultValue, options) => {
|
|
20133
20146
|
const {
|
|
20134
20147
|
serializer,
|
|
@@ -20149,7 +20162,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
20149
20162
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
20150
20163
|
return res;
|
|
20151
20164
|
} catch (err) {
|
|
20152
|
-
logger$
|
|
20165
|
+
logger$h.error(err);
|
|
20153
20166
|
return defaultValue;
|
|
20154
20167
|
}
|
|
20155
20168
|
});
|
|
@@ -20181,7 +20194,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
20181
20194
|
try {
|
|
20182
20195
|
updateLocalStorage();
|
|
20183
20196
|
} catch (err) {
|
|
20184
|
-
logger$
|
|
20197
|
+
logger$h.error(err);
|
|
20185
20198
|
}
|
|
20186
20199
|
}, [value]);
|
|
20187
20200
|
useEffect(() => {
|
|
@@ -20196,7 +20209,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
20196
20209
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
20197
20210
|
}
|
|
20198
20211
|
} catch (err) {
|
|
20199
|
-
logger$
|
|
20212
|
+
logger$h.error(err);
|
|
20200
20213
|
}
|
|
20201
20214
|
};
|
|
20202
20215
|
if (typeof window === "undefined")
|
|
@@ -21152,30 +21165,10 @@ const hasMinRequiredDecisionMakerCount = (rootLegalEntity) => {
|
|
|
21152
21165
|
return roleTypes.some((role2) => min ? (existingDecisionMakerCount == null ? void 0 : existingDecisionMakerCount[role2]) ?? min <= 0 : true);
|
|
21153
21166
|
});
|
|
21154
21167
|
};
|
|
21155
|
-
const TRUST_MEMBER_COUNT_RANGE = {
|
|
21156
|
-
[TrustMemberTypes.DEFINED_BENEFICIARY]: {
|
|
21157
|
-
min: 1
|
|
21158
|
-
},
|
|
21159
|
-
[TrustMemberTypes.SETTLOR]: {
|
|
21160
|
-
min: 1
|
|
21161
|
-
}
|
|
21162
|
-
};
|
|
21163
21168
|
const isPartOfTrustFromLegalEntity = (legalEntity) => {
|
|
21164
21169
|
var _a;
|
|
21165
21170
|
return (_a = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.entityType === LegalEntityType.TRUST && ea.associatorId === legalEntity.id);
|
|
21166
21171
|
};
|
|
21167
|
-
const getTrustLegalEntityId = (rootLegalEntity) => {
|
|
21168
|
-
var _a;
|
|
21169
|
-
if (!rootLegalEntity.entityAssociations)
|
|
21170
|
-
return void 0;
|
|
21171
|
-
return (_a = rootLegalEntity.entityAssociations.find((entityAssociation) => entityAssociation.type === LegalEntityType.TRUST)) == null ? void 0 : _a.legalEntityId;
|
|
21172
|
-
};
|
|
21173
|
-
const getOwnTrustMembers = (rootLegalEntity) => {
|
|
21174
|
-
const trustLegalEntityId = getTrustLegalEntityId(rootLegalEntity);
|
|
21175
|
-
if (!trustLegalEntityId || !rootLegalEntity.entityAssociations)
|
|
21176
|
-
return [];
|
|
21177
|
-
return rootLegalEntity.entityAssociations.filter((entityAssociation) => Object.values(TrustMemberTypes).includes(entityAssociation.type) && trustLegalEntityId === entityAssociation.associatorId);
|
|
21178
|
-
};
|
|
21179
21172
|
const getOwnTrustMembersLegalEntityIds = (rootLegalEntity) => {
|
|
21180
21173
|
const trustLegalEntityId = getOwnTrustLegalEntityId(rootLegalEntity);
|
|
21181
21174
|
if (!trustLegalEntityId)
|
|
@@ -21203,17 +21196,23 @@ const getOwnTrustProblems = (legalEntity, capabilityProblems) => {
|
|
|
21203
21196
|
return (_a = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _a[trustLegalEntityId];
|
|
21204
21197
|
}
|
|
21205
21198
|
};
|
|
21206
|
-
const
|
|
21207
|
-
|
|
21208
|
-
|
|
21209
|
-
|
|
21210
|
-
|
|
21211
|
-
|
|
21212
|
-
|
|
21213
|
-
|
|
21214
|
-
|
|
21215
|
-
|
|
21216
|
-
|
|
21199
|
+
const hasRequiredTrustMemberCount = (trustMembers2) => {
|
|
21200
|
+
if (!trustMembers2.length) {
|
|
21201
|
+
return false;
|
|
21202
|
+
}
|
|
21203
|
+
return DEFAULT_TRUST_MEMBER_REQUIREMENTS.every(({
|
|
21204
|
+
roleTypes,
|
|
21205
|
+
min
|
|
21206
|
+
}) => {
|
|
21207
|
+
var _a;
|
|
21208
|
+
if (min === 0) {
|
|
21209
|
+
return true;
|
|
21210
|
+
}
|
|
21211
|
+
const actualCount = ((_a = trustMembers2.filter(({
|
|
21212
|
+
roles
|
|
21213
|
+
}) => roleTypes.some((label) => roles.includes(label)))) == null ? void 0 : _a.length) ?? 0;
|
|
21214
|
+
return actualCount >= min;
|
|
21215
|
+
});
|
|
21217
21216
|
};
|
|
21218
21217
|
const getCountrySpecificTrustTypeOptions = (country2) => {
|
|
21219
21218
|
const countrySpecificTrustTypes = countryToTrustTypes[country2];
|
|
@@ -22485,7 +22484,7 @@ const defaultPayoutAccountFormat = {
|
|
|
22485
22484
|
[CountryCodes.Sweden]: "local",
|
|
22486
22485
|
[CountryCodes.UnitedKingdom]: "local"
|
|
22487
22486
|
};
|
|
22488
|
-
const logger$
|
|
22487
|
+
const logger$g = createLogger("useScenarioConfiguration");
|
|
22489
22488
|
const useScenarioConfiguration = ({
|
|
22490
22489
|
getConfigurationData,
|
|
22491
22490
|
getPayoutAccountFormatData,
|
|
@@ -22508,12 +22507,12 @@ const useScenarioConfiguration = ({
|
|
|
22508
22507
|
const response = await getConfigurationData();
|
|
22509
22508
|
setConfigurationResponse(response);
|
|
22510
22509
|
} catch (err) {
|
|
22511
|
-
logger$
|
|
22510
|
+
logger$g.warn("WARNING: Configuration request failed - error:", err);
|
|
22512
22511
|
} finally {
|
|
22513
22512
|
setLoadingStatus("success");
|
|
22514
22513
|
}
|
|
22515
22514
|
};
|
|
22516
|
-
makeConfigCallAndSave().catch(logger$
|
|
22515
|
+
makeConfigCallAndSave().catch(logger$g.error);
|
|
22517
22516
|
}, [getConfigurationData, setLoadingStatus]);
|
|
22518
22517
|
useEffect(() => {
|
|
22519
22518
|
setLoadingStatus("loading");
|
|
@@ -22532,12 +22531,12 @@ const useScenarioConfiguration = ({
|
|
|
22532
22531
|
const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
|
|
22533
22532
|
setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
|
|
22534
22533
|
} catch (err) {
|
|
22535
|
-
logger$
|
|
22534
|
+
logger$g.warn("WARNING: Payout format request failed - error:", err);
|
|
22536
22535
|
} finally {
|
|
22537
22536
|
setLoadingStatus("success");
|
|
22538
22537
|
}
|
|
22539
22538
|
};
|
|
22540
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
22539
|
+
makePayoutFormatCallAndSave().catch(logger$g.error);
|
|
22541
22540
|
}, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus, existingBankAccountFormat]);
|
|
22542
22541
|
const {
|
|
22543
22542
|
fieldConfigurations,
|
|
@@ -23210,12 +23209,20 @@ const legalArrangementItems = [{
|
|
|
23210
23209
|
name: "associationIncorporated",
|
|
23211
23210
|
description: "groupOfPeopleActingTogetherForNonCommercialPurpose"
|
|
23212
23211
|
}];
|
|
23213
|
-
const getLegalArrangementOptions = (country2) => legalArrangementItems.filter((legalArrangementItem) =>
|
|
23214
|
-
|
|
23212
|
+
const getLegalArrangementOptions = (country2, experiments) => legalArrangementItems.filter((legalArrangementItem) => {
|
|
23213
|
+
if (legalArrangementItem.id !== "aTrust" && legalArrangementItem.id !== "partnershipUnincorporated") {
|
|
23214
|
+
return true;
|
|
23215
|
+
}
|
|
23216
|
+
if (legalArrangementItem.id === "partnershipUnincorporated" && (experiments == null ? void 0 : experiments.ShowUnsupportedEntityType)) {
|
|
23217
|
+
return true;
|
|
23218
|
+
}
|
|
23219
|
+
return country2 && TRUST_COUNTRIES.includes(country2);
|
|
23220
|
+
});
|
|
23221
|
+
const getSelectionOptions = (legalEntityResponse, experiments) => {
|
|
23215
23222
|
var _a, _b, _c, _d;
|
|
23216
23223
|
const country2 = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? (_b = (_a = legalEntityResponse.individual) == null ? void 0 : _a.residentialAddress) == null ? void 0 : _b.country : (_d = (_c = legalEntityResponse.organization) == null ? void 0 : _c.registeredAddress) == null ? void 0 : _d.country;
|
|
23217
23224
|
const businessTypeOptions = getBusinessTypeOptions(country2);
|
|
23218
|
-
const legalArrangementOptions = getLegalArrangementOptions(country2);
|
|
23225
|
+
const legalArrangementOptions = getLegalArrangementOptions(country2, experiments);
|
|
23219
23226
|
return {
|
|
23220
23227
|
businessTypeOptions,
|
|
23221
23228
|
legalArrangementOptions
|
|
@@ -23265,7 +23272,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
|
|
|
23265
23272
|
ToastType2["ERROR"] = "error";
|
|
23266
23273
|
return ToastType2;
|
|
23267
23274
|
})(ToastType || {});
|
|
23268
|
-
const logger$
|
|
23275
|
+
const logger$f = createLogger("FormRouterContextProvider");
|
|
23269
23276
|
function FormRouterContextProvider({
|
|
23270
23277
|
children,
|
|
23271
23278
|
forms: forms2,
|
|
@@ -23285,7 +23292,7 @@ function FormRouterContextProvider({
|
|
|
23285
23292
|
if (formIndex > -1) {
|
|
23286
23293
|
setFormIndex(formIndex);
|
|
23287
23294
|
} else {
|
|
23288
|
-
logger$
|
|
23295
|
+
logger$f.error("No form was found to have that field so form navigation failed.");
|
|
23289
23296
|
}
|
|
23290
23297
|
}
|
|
23291
23298
|
}), [forms2, handleGetIdVerificationToken, setFormIndex]);
|
|
@@ -23898,7 +23905,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
|
|
|
23898
23905
|
CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
|
|
23899
23906
|
return CompanySearchEvents2;
|
|
23900
23907
|
})(CompanySearchEvents || {});
|
|
23901
|
-
const logger$
|
|
23908
|
+
const logger$e = createLogger("useCompanySearch");
|
|
23902
23909
|
const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
|
|
23903
23910
|
function useCompanySearch({
|
|
23904
23911
|
defaultData,
|
|
@@ -23935,30 +23942,19 @@ function useCompanySearch({
|
|
|
23935
23942
|
deepSearch
|
|
23936
23943
|
}) => {
|
|
23937
23944
|
try {
|
|
23938
|
-
if (!
|
|
23945
|
+
if (!deepSearch)
|
|
23939
23946
|
return;
|
|
23940
23947
|
setStatus("loading");
|
|
23941
23948
|
setCompaniesList([]);
|
|
23942
23949
|
const {
|
|
23943
|
-
results:
|
|
23944
|
-
} = await
|
|
23950
|
+
results: deepSearchResults
|
|
23951
|
+
} = await deepSearch({
|
|
23945
23952
|
text: companyName2,
|
|
23946
23953
|
country: companyCountry2,
|
|
23947
23954
|
state: companyState,
|
|
23948
23955
|
limit: resultsLimit
|
|
23949
23956
|
});
|
|
23950
|
-
|
|
23951
|
-
const {
|
|
23952
|
-
results: deepSearchResults
|
|
23953
|
-
} = await deepSearch({
|
|
23954
|
-
text: companyName2,
|
|
23955
|
-
country: companyCountry2,
|
|
23956
|
-
state: companyState,
|
|
23957
|
-
limit: resultsLimit
|
|
23958
|
-
});
|
|
23959
|
-
return setCompaniesList(deepSearchResults);
|
|
23960
|
-
}
|
|
23961
|
-
return setCompaniesList(indexSearchResults);
|
|
23957
|
+
return setCompaniesList(deepSearchResults);
|
|
23962
23958
|
} catch (e) {
|
|
23963
23959
|
setStatus("error");
|
|
23964
23960
|
setError(e);
|
|
@@ -23971,37 +23967,26 @@ function useCompanySearch({
|
|
|
23971
23967
|
return setStatus("idle");
|
|
23972
23968
|
}
|
|
23973
23969
|
try {
|
|
23974
|
-
if (!
|
|
23970
|
+
if (!handleCompanyDeepSearch)
|
|
23975
23971
|
return;
|
|
23976
23972
|
setStatus("loading");
|
|
23977
23973
|
setSelectedCompanyId(void 0);
|
|
23978
23974
|
const {
|
|
23979
|
-
results:
|
|
23980
|
-
} = await
|
|
23975
|
+
results: deepSearchResults
|
|
23976
|
+
} = await handleCompanyDeepSearch({
|
|
23981
23977
|
text: legalCompanyName2,
|
|
23982
23978
|
country: country2,
|
|
23983
23979
|
state: stateOrProvince2,
|
|
23984
23980
|
limit
|
|
23985
23981
|
});
|
|
23986
|
-
|
|
23987
|
-
const {
|
|
23988
|
-
results: deepSearchResults
|
|
23989
|
-
} = await handleCompanyDeepSearch({
|
|
23990
|
-
text: legalCompanyName2,
|
|
23991
|
-
country: country2,
|
|
23992
|
-
state: stateOrProvince2,
|
|
23993
|
-
limit
|
|
23994
|
-
});
|
|
23995
|
-
return setCompaniesList(deepSearchResults);
|
|
23996
|
-
}
|
|
23997
|
-
return setCompaniesList(indexSearchResults);
|
|
23982
|
+
return setCompaniesList(deepSearchResults);
|
|
23998
23983
|
} catch (e) {
|
|
23999
23984
|
setStatus("error");
|
|
24000
23985
|
setError(e);
|
|
24001
23986
|
} finally {
|
|
24002
23987
|
setStatus((prevStatus) => prevStatus !== "error" ? "loaded" : prevStatus);
|
|
24003
23988
|
}
|
|
24004
|
-
}, [
|
|
23989
|
+
}, [handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
|
|
24005
23990
|
const verify2 = useCallback(async (companyTIN, company2) => {
|
|
24006
23991
|
try {
|
|
24007
23992
|
if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
|
|
@@ -24048,7 +24033,7 @@ function useCompanySearch({
|
|
|
24048
24033
|
state: companyData.state ?? stateOrProvince2
|
|
24049
24034
|
});
|
|
24050
24035
|
} catch (e) {
|
|
24051
|
-
logger$
|
|
24036
|
+
logger$e.error(e);
|
|
24052
24037
|
setError(e);
|
|
24053
24038
|
setStatus("error");
|
|
24054
24039
|
} finally {
|
|
@@ -24081,7 +24066,7 @@ function useCompanySearch({
|
|
|
24081
24066
|
indexSearch: handleCompanyIndexSearch,
|
|
24082
24067
|
deepSearch: handleCompanyDeepSearch,
|
|
24083
24068
|
resultsLimit: limit
|
|
24084
|
-
})) == null ? void 0 : _a.catch((e) => logger$
|
|
24069
|
+
})) == null ? void 0 : _a.catch((e) => logger$e.error(e));
|
|
24085
24070
|
}
|
|
24086
24071
|
}, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
|
|
24087
24072
|
useEffect(() => {
|
|
@@ -25858,7 +25843,7 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity) => {
|
|
|
25858
25843
|
}
|
|
25859
25844
|
}, {});
|
|
25860
25845
|
};
|
|
25861
|
-
const logger$
|
|
25846
|
+
const logger$d = createLogger("useFormTaskSubmit");
|
|
25862
25847
|
function useCompanySearchTaskSubmit({
|
|
25863
25848
|
task,
|
|
25864
25849
|
forms: forms2,
|
|
@@ -25904,7 +25889,7 @@ function useCompanySearchTaskSubmit({
|
|
|
25904
25889
|
});
|
|
25905
25890
|
}
|
|
25906
25891
|
} catch (e) {
|
|
25907
|
-
logger$
|
|
25892
|
+
logger$d.error(e);
|
|
25908
25893
|
userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
|
|
25909
25894
|
segmentation: {
|
|
25910
25895
|
...baseTrackingPayload,
|
|
@@ -25956,7 +25941,7 @@ function useCompanySearchTaskSubmit({
|
|
|
25956
25941
|
...trackingPayload
|
|
25957
25942
|
}
|
|
25958
25943
|
});
|
|
25959
|
-
logger$
|
|
25944
|
+
logger$d.log(submittedLegalEntity);
|
|
25960
25945
|
setAccountHolder(entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type]);
|
|
25961
25946
|
clearToasts();
|
|
25962
25947
|
onExternalSubmit == null ? void 0 : onExternalSubmit(data);
|
|
@@ -25981,7 +25966,7 @@ function useCompanySearchTaskSubmit({
|
|
|
25981
25966
|
type: ToastType.ERROR
|
|
25982
25967
|
});
|
|
25983
25968
|
}
|
|
25984
|
-
logger$
|
|
25969
|
+
logger$d.error(e);
|
|
25985
25970
|
userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
|
|
25986
25971
|
segmentation: {
|
|
25987
25972
|
...baseTrackingPayload,
|
|
@@ -26414,7 +26399,7 @@ const useShouldShowIntroduction = ({
|
|
|
26414
26399
|
});
|
|
26415
26400
|
return canSeeIntroduction && !hasSeenIntroduction;
|
|
26416
26401
|
};
|
|
26417
|
-
const logger$
|
|
26402
|
+
const logger$c = createLogger("useAssociatedLegalArrangement");
|
|
26418
26403
|
function useAssociatedLegalArrangement({
|
|
26419
26404
|
rootLegalEntity,
|
|
26420
26405
|
getLegalEntity: getLegalEntity2
|
|
@@ -26425,14 +26410,14 @@ function useAssociatedLegalArrangement({
|
|
|
26425
26410
|
var _a;
|
|
26426
26411
|
const foundEntity = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST);
|
|
26427
26412
|
if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
|
|
26428
|
-
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$
|
|
26413
|
+
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$c.error);
|
|
26429
26414
|
}
|
|
26430
26415
|
}, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
|
|
26431
26416
|
return {
|
|
26432
26417
|
associatedLegalArrangement
|
|
26433
26418
|
};
|
|
26434
26419
|
}
|
|
26435
|
-
const logger$
|
|
26420
|
+
const logger$b = createLogger("useExemptSettlor");
|
|
26436
26421
|
const useExemptSettlor = ({
|
|
26437
26422
|
trust: trust2,
|
|
26438
26423
|
handleGetLegalEntity
|
|
@@ -26446,7 +26431,7 @@ const useExemptSettlor = ({
|
|
|
26446
26431
|
useEffect(() => {
|
|
26447
26432
|
if (!trust2)
|
|
26448
26433
|
return;
|
|
26449
|
-
updateExemptSettlor(trust2).catch(logger$
|
|
26434
|
+
updateExemptSettlor(trust2).catch(logger$b.error);
|
|
26450
26435
|
}, [trust2, updateExemptSettlor]);
|
|
26451
26436
|
return exemptSettlor;
|
|
26452
26437
|
};
|
|
@@ -26476,6 +26461,26 @@ function useSalesChannelsSettings() {
|
|
|
26476
26461
|
return settings;
|
|
26477
26462
|
}, [isSettingEnabled]);
|
|
26478
26463
|
}
|
|
26464
|
+
const logger$a = createLogger("useTrust");
|
|
26465
|
+
const useTrust = ({
|
|
26466
|
+
rootLegalEntity,
|
|
26467
|
+
handleGetLegalEntity
|
|
26468
|
+
}) => {
|
|
26469
|
+
const [trust2, setTrust] = useState();
|
|
26470
|
+
const refreshTrust = useCallback(async () => {
|
|
26471
|
+
var _a, _b;
|
|
26472
|
+
const trustId = (_b = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((association2) => association2.type === LegalEntityType.TRUST)) == null ? void 0 : _b.legalEntityId;
|
|
26473
|
+
const trustLE = trustId ? await handleGetLegalEntity(trustId) : void 0;
|
|
26474
|
+
setTrust(trustLE);
|
|
26475
|
+
return trustLE;
|
|
26476
|
+
}, [handleGetLegalEntity]);
|
|
26477
|
+
useEffect(() => {
|
|
26478
|
+
if (hasOwnEntityAssociationOfType(LegalEntityType.TRUST, rootLegalEntity.entityAssociations, rootLegalEntity.id)) {
|
|
26479
|
+
refreshTrust().catch(logger$a.error);
|
|
26480
|
+
}
|
|
26481
|
+
}, [refreshTrust]);
|
|
26482
|
+
return [trust2, refreshTrust];
|
|
26483
|
+
};
|
|
26479
26484
|
const downloadFile = async (base64, filename) => {
|
|
26480
26485
|
saveBlobAsFile(base64ToBlob(base64), filename);
|
|
26481
26486
|
};
|
|
@@ -26575,7 +26580,7 @@ const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations,
|
|
|
26575
26580
|
};
|
|
26576
26581
|
const mapRootLegalEntityToTrustMember = (rootLegalEntity) => ({
|
|
26577
26582
|
trustMemberType: "rootTrustee",
|
|
26578
|
-
roles: [],
|
|
26583
|
+
roles: [TrustMemberTypes.TRUSTEE],
|
|
26579
26584
|
legalEntityType: rootLegalEntity.type,
|
|
26580
26585
|
legalEntityId: rootLegalEntity.id,
|
|
26581
26586
|
name: getLegalEntityNameBasedOnType(rootLegalEntity)
|
|
@@ -26901,6 +26906,9 @@ const BusinessTypeSelection = ({
|
|
|
26901
26906
|
const {
|
|
26902
26907
|
showToast
|
|
26903
26908
|
} = useToastContext();
|
|
26909
|
+
const {
|
|
26910
|
+
isExperimentEnabled
|
|
26911
|
+
} = useExperimentsContext();
|
|
26904
26912
|
const [loadingStatus, setLoadingStatus] = useState();
|
|
26905
26913
|
const [currentStep, setCurrentStep] = useState(
|
|
26906
26914
|
0
|
|
@@ -26916,7 +26924,9 @@ const BusinessTypeSelection = ({
|
|
|
26916
26924
|
const {
|
|
26917
26925
|
businessTypeOptions,
|
|
26918
26926
|
legalArrangementOptions
|
|
26919
|
-
} = getSelectionOptions(legalEntityResponse
|
|
26927
|
+
} = getSelectionOptions(legalEntityResponse, {
|
|
26928
|
+
ShowUnsupportedEntityType: isExperimentEnabled("ShowUnsupportedEntityType")
|
|
26929
|
+
});
|
|
26920
26930
|
const currentLegalEntityType = legalEntityResponse == null ? void 0 : legalEntityResponse.type;
|
|
26921
26931
|
const currentCompanyTypesValue = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
|
|
26922
26932
|
const defaultBusinessType = getBusinessType(businessTypeOptions, accountHolder2, legalEntityResponse == null ? void 0 : legalEntityResponse.type, (_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
|
|
@@ -28504,6 +28514,7 @@ function TaskListComponent({
|
|
|
28504
28514
|
pciStatus,
|
|
28505
28515
|
serviceAgreementTypes,
|
|
28506
28516
|
serviceAgreementAcceptanceInfos,
|
|
28517
|
+
hasRequiredTrustMemberCount: hasRequiredTrustMemberCount2,
|
|
28507
28518
|
onTransferInstrumentDelete
|
|
28508
28519
|
}) {
|
|
28509
28520
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
@@ -28653,7 +28664,7 @@ function TaskListComponent({
|
|
|
28653
28664
|
onNavigateToTask: handleOnNavigateToTaskTrustMember,
|
|
28654
28665
|
icon: "decision-maker",
|
|
28655
28666
|
title: i18n.get("trustMembers"),
|
|
28656
|
-
status:
|
|
28667
|
+
status: hasRequiredTrustMemberCount2 ? getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntityResponse, getOwnTrustMembersLegalEntityIds(legalEntityResponse)) : TaskStatus.DETAILS_REQUIRED
|
|
28657
28668
|
})]
|
|
28658
28669
|
}), (tasks.includes(TaskTypes.PAYOUT) || tasks.includes(TaskTypes.PAYIN)) && jsx(TaskListGroup, {
|
|
28659
28670
|
title: isEnableNewEntryFlowEnabled ? i18n.get("letUsKnowTheBankAccountToSendReceiveFunds") : i18n.get(hasPayinTaskNotPayout ? "payinAccountsDescription" : payoutTaskDescriptionKey),
|
|
@@ -31821,7 +31832,7 @@ function TrustDropinComponent({
|
|
|
31821
31832
|
...derivedProps,
|
|
31822
31833
|
activeForm,
|
|
31823
31834
|
capabilities,
|
|
31824
|
-
data,
|
|
31835
|
+
data: dataFromResponse,
|
|
31825
31836
|
country: ((_a = data == null ? void 0 : data.trustRegistrationDetails) == null ? void 0 : _a.country) ?? country2,
|
|
31826
31837
|
problems,
|
|
31827
31838
|
handleAddressSearch,
|
|
@@ -31896,7 +31907,10 @@ function DropinComposerComponent({
|
|
|
31896
31907
|
const [associatedLegalEntityParent, setAssociatedLegalEntityParent] = useState(null);
|
|
31897
31908
|
const [legalEntityType, setLegalEntityType] = useState(null);
|
|
31898
31909
|
const [solePropietor, setSolePropietor] = useState(null);
|
|
31899
|
-
const [trust2,
|
|
31910
|
+
const [trust2, refreshTrust] = useTrust({
|
|
31911
|
+
rootLegalEntity,
|
|
31912
|
+
handleGetLegalEntity: args.handleGetLegalEntity
|
|
31913
|
+
});
|
|
31900
31914
|
const exemptSettlor = useExemptSettlor({
|
|
31901
31915
|
trust: trust2,
|
|
31902
31916
|
handleGetLegalEntity: args.handleGetLegalEntity
|
|
@@ -31915,6 +31929,7 @@ function DropinComposerComponent({
|
|
|
31915
31929
|
const additionalSalesChannels = useSalesChannelsSettings();
|
|
31916
31930
|
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), trust2 == null ? void 0 : trust2.trust.countryOfGoverningLaw);
|
|
31917
31931
|
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
31932
|
+
const trustMembers2 = trust2 ? allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust2, rootLegalEntity, exemptSettlor) : getTrustMembers(trust2, rootLegalEntity, exemptSettlor) : [];
|
|
31918
31933
|
const getLegalEntityProblems = (le) => {
|
|
31919
31934
|
var _a2;
|
|
31920
31935
|
if (le == null ? void 0 : le.id) {
|
|
@@ -32024,18 +32039,6 @@ function DropinComposerComponent({
|
|
|
32024
32039
|
}
|
|
32025
32040
|
return void 0;
|
|
32026
32041
|
}, [i18n, rootLegalEntity.id]);
|
|
32027
|
-
const refreshTrust = async () => {
|
|
32028
|
-
if (trust2.id && (args == null ? void 0 : args.handleGetLegalEntity)) {
|
|
32029
|
-
try {
|
|
32030
|
-
const response = await (args == null ? void 0 : args.handleGetLegalEntity(trust2.id));
|
|
32031
|
-
setTrust(response);
|
|
32032
|
-
return response;
|
|
32033
|
-
} catch (e) {
|
|
32034
|
-
logger$8.warn(i18n.get("failedToFetchTrustDetails"));
|
|
32035
|
-
}
|
|
32036
|
-
}
|
|
32037
|
-
return void 0;
|
|
32038
|
-
};
|
|
32039
32042
|
const deleteTransferInstrument = async (id2) => {
|
|
32040
32043
|
if (id2 && (args == null ? void 0 : args.handleDeleteTransferInstrument)) {
|
|
32041
32044
|
try {
|
|
@@ -32227,21 +32230,18 @@ function DropinComposerComponent({
|
|
|
32227
32230
|
}
|
|
32228
32231
|
};
|
|
32229
32232
|
const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
|
|
32230
|
-
|
|
32231
|
-
|
|
32232
|
-
|
|
32233
|
-
try {
|
|
32234
|
-
const currentTrust = await (args == null ? void 0 : args.handleGetLegalEntity(trustId));
|
|
32235
|
-
setTrust(currentTrust);
|
|
32233
|
+
try {
|
|
32234
|
+
const trust22 = await refreshTrust();
|
|
32235
|
+
if (trust22) {
|
|
32236
32236
|
onNavigateTo(task);
|
|
32237
|
-
}
|
|
32238
|
-
|
|
32239
|
-
label: i18n.get("failedToFetchTrustDetails"),
|
|
32240
|
-
type: ToastType.ERROR
|
|
32241
|
-
});
|
|
32237
|
+
} else {
|
|
32238
|
+
onNavigateTo(TaskTypes.TRUST);
|
|
32242
32239
|
}
|
|
32243
|
-
}
|
|
32244
|
-
|
|
32240
|
+
} catch (e) {
|
|
32241
|
+
showToast({
|
|
32242
|
+
label: i18n.get("failedToFetchTrustDetails"),
|
|
32243
|
+
type: ToastType.ERROR
|
|
32244
|
+
});
|
|
32245
32245
|
}
|
|
32246
32246
|
};
|
|
32247
32247
|
const onNavigateToTrustMember = async (tm) => {
|
|
@@ -32465,6 +32465,7 @@ function DropinComposerComponent({
|
|
|
32465
32465
|
serviceAgreementTypes,
|
|
32466
32466
|
serviceAgreementAcceptanceInfos,
|
|
32467
32467
|
isReview: reviewRequired,
|
|
32468
|
+
hasRequiredTrustMemberCount: hasRequiredTrustMemberCount(trustMembers2),
|
|
32468
32469
|
onTransferInstrumentDelete: deleteTransferInstrument
|
|
32469
32470
|
});
|
|
32470
32471
|
case TaskTypes.DECISION_MAKER_OVERVIEW:
|
|
@@ -32733,7 +32734,7 @@ function DropinComposerComponent({
|
|
|
32733
32734
|
});
|
|
32734
32735
|
case TaskTypes.TRUST_MEMBER_OVERVIEW:
|
|
32735
32736
|
return jsx(TrustMembersOverview, {
|
|
32736
|
-
trustMembers:
|
|
32737
|
+
trustMembers: trustMembers2,
|
|
32737
32738
|
getTrustMemberTaskStatus: (member) => getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, rootLegalEntity, member.trustMemberType === "undefinedBeneficiary" ? void 0 : [member.legalEntityId, ...getDirectEntityAssociations(rootLegalEntity, member.legalEntityId).map((association2) => association2.legalEntityId)]),
|
|
32738
32739
|
navigateBackToTaskList: navigateBack,
|
|
32739
32740
|
navigateToEditTrustMember: onNavigateToTrustMemberRoleAndType,
|