@adyen/kyc-components 2.9.2 → 2.10.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 +365 -250
- package/dist/style.css +36 -8
- package/dist/types/components/AccountSetupRejected/component/AccountSetupRejected.d.ts +2 -0
- package/dist/types/components/Dropins/PayoutDetailsDropin/components/PayoutDetailsDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/PciDropin/components/PciDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/PciDropin/types.d.ts +0 -1
- package/dist/types/components/PayoutDetails/types.d.ts +1 -0
- package/dist/types/components/TaskList/types.d.ts +2 -1
- package/dist/types/components/Trust/rules.d.ts +3 -0
- package/dist/types/components/TrustRegistrationDetails/types.d.ts +7 -4
- package/dist/types/components/internal/AccountHolder/types.d.ts +1 -1
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/Alert/Alert.d.ts +1 -1
- package/dist/types/components/internal/Alert/types.d.ts +1 -0
- package/dist/types/components/internal/BusinessRegistrationNumber/types.d.ts +2 -0
- package/dist/types/components/internal/BusinessRegistrationNumber/validate.d.ts +5 -4
- package/dist/types/core/Services/componentApi/get-allowed-locales.d.ts +3 -0
- package/dist/types/core/models/api/legal-arrangement.d.ts +0 -1
- package/dist/types/core/models/api/organization.d.ts +1 -2
- package/dist/types/language/config.d.ts +4 -2
- package/dist/types/utils/decision-maker-roles.d.ts +1 -1
- package/dist/types/utils/entity-status-util.d.ts +2 -2
- package/dist/types/utils/get-task-status.d.ts +1 -0
- package/dist/types/utils/mapping/componentApiMapping.d.ts +2 -1
- package/dist/types/utils/regex/index.d.ts +1 -0
- package/dist/types/utils/regex/trustRegistrationNumberPatterns.d.ts +2 -0
- package/dist/types/utils/regex/types.d.ts +5 -0
- package/dist/types/utils/trust-util.d.ts +4 -1
- package/package.json +2 -2
|
@@ -218,6 +218,8 @@ const completeReview = "Complete review";
|
|
|
218
218
|
const submitReview = "Submit review";
|
|
219
219
|
const undoWithTimer = "Undo %{secondsLeft}";
|
|
220
220
|
const removing = "Removing...";
|
|
221
|
+
const cantSetUpAcccount = "You can’t set up an account";
|
|
222
|
+
const accountCantBeSetUp = "Your account can’t be set up as your information couldn’t be verified. To find out more, reach out to customer support.";
|
|
221
223
|
const pleaseNote = "Please note:";
|
|
222
224
|
const byClickingSubmitReview = "By clicking 'Submit review', you confirm that all of your information has been reviewed, and that all newly provided or already existing data is accurate and up-to-date.";
|
|
223
225
|
const nameAndCountry = "Name and country";
|
|
@@ -587,8 +589,8 @@ const selectAccountHolder = "Select account holder";
|
|
|
587
589
|
const nameOfBankAccountHolder = "We need to know about the bank account where you want to receive your payouts. What is the name of the account holder of that bank account?";
|
|
588
590
|
const myName = "My name";
|
|
589
591
|
const myNameDescription = "It’s a personal bank account held in my own name";
|
|
590
|
-
const
|
|
591
|
-
const
|
|
592
|
+
const mySoleProprietorName = "My sole proprietor name";
|
|
593
|
+
const mySoleProprietorNameDescription = "The account is in my name, but I am registered as a sole proprietor, sole trader, or freelancer";
|
|
592
594
|
const theCompanyIWorkFor = "The company I work for";
|
|
593
595
|
const theCompanyIWorkForDescription = "It is a company bank account for a private, public, or non-profit organization";
|
|
594
596
|
const aTrust = "A trust";
|
|
@@ -1273,6 +1275,8 @@ const defaultTrans = {
|
|
|
1273
1275
|
submitReview,
|
|
1274
1276
|
undoWithTimer,
|
|
1275
1277
|
removing,
|
|
1278
|
+
cantSetUpAcccount,
|
|
1279
|
+
accountCantBeSetUp,
|
|
1276
1280
|
pleaseNote,
|
|
1277
1281
|
byClickingSubmitReview,
|
|
1278
1282
|
nameAndCountry,
|
|
@@ -1647,8 +1651,8 @@ const defaultTrans = {
|
|
|
1647
1651
|
nameOfBankAccountHolder,
|
|
1648
1652
|
myName,
|
|
1649
1653
|
myNameDescription,
|
|
1650
|
-
|
|
1651
|
-
|
|
1654
|
+
mySoleProprietorName,
|
|
1655
|
+
mySoleProprietorNameDescription,
|
|
1652
1656
|
theCompanyIWorkFor,
|
|
1653
1657
|
theCompanyIWorkForDescription,
|
|
1654
1658
|
aTrust,
|
|
@@ -2576,6 +2580,7 @@ const Alert = ({
|
|
|
2576
2580
|
});
|
|
2577
2581
|
};
|
|
2578
2582
|
const AlertIcon = ({
|
|
2583
|
+
className,
|
|
2579
2584
|
type
|
|
2580
2585
|
}) => {
|
|
2581
2586
|
switch (type) {
|
|
@@ -2585,7 +2590,8 @@ const AlertIcon = ({
|
|
|
2585
2590
|
});
|
|
2586
2591
|
case AlertTypes.ERROR:
|
|
2587
2592
|
return jsx(Icon, {
|
|
2588
|
-
name: "warning"
|
|
2593
|
+
name: "warning",
|
|
2594
|
+
className
|
|
2589
2595
|
});
|
|
2590
2596
|
case AlertTypes.WARNING:
|
|
2591
2597
|
return jsx(Icon, {
|
|
@@ -2747,7 +2753,7 @@ const createLogger = (namespace) => {
|
|
|
2747
2753
|
});
|
|
2748
2754
|
return methods;
|
|
2749
2755
|
};
|
|
2750
|
-
const logger$
|
|
2756
|
+
const logger$m = createLogger("Link");
|
|
2751
2757
|
const getIconClass = (icon, external) => {
|
|
2752
2758
|
if (external) {
|
|
2753
2759
|
return "adl-link__icon adyen-kyc-icon-external-link";
|
|
@@ -2759,7 +2765,7 @@ const getIconClass = (icon, external) => {
|
|
|
2759
2765
|
};
|
|
2760
2766
|
const isValidLink = (href) => {
|
|
2761
2767
|
if (href === "#") {
|
|
2762
|
-
logger$
|
|
2768
|
+
logger$m.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
2763
2769
|
return false;
|
|
2764
2770
|
}
|
|
2765
2771
|
return true;
|
|
@@ -3352,7 +3358,7 @@ class ValidationResult {
|
|
|
3352
3358
|
return this.validationResults.filter((result) => result.hasError);
|
|
3353
3359
|
}
|
|
3354
3360
|
}
|
|
3355
|
-
const logger$
|
|
3361
|
+
const logger$l = createLogger("useAsyncValidator");
|
|
3356
3362
|
const useAsyncValidator = (asyncRules) => {
|
|
3357
3363
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3358
3364
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -3375,7 +3381,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
3375
3381
|
hasError: !isValid
|
|
3376
3382
|
}])
|
|
3377
3383
|
});
|
|
3378
|
-
}).catch(logger$
|
|
3384
|
+
}).catch(logger$l.error);
|
|
3379
3385
|
}, [asyncRules, clearAsyncValidationResults]);
|
|
3380
3386
|
return {
|
|
3381
3387
|
asyncValidationResults,
|
|
@@ -4612,6 +4618,17 @@ const ProofOfIdentityCardPatterns = {
|
|
|
4612
4618
|
[CountryCodes.Australia]: /^[A-Za-z\d]{6,10}$/,
|
|
4613
4619
|
[CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
|
|
4614
4620
|
};
|
|
4621
|
+
const trustRegistrationNumberPatterns = {
|
|
4622
|
+
[CountryCodes.NewZealand]: {
|
|
4623
|
+
default: {
|
|
4624
|
+
regex: /^\d{13}$/,
|
|
4625
|
+
format: "Xdigits",
|
|
4626
|
+
values: {
|
|
4627
|
+
digits: 13
|
|
4628
|
+
}
|
|
4629
|
+
}
|
|
4630
|
+
}
|
|
4631
|
+
};
|
|
4615
4632
|
const vatSpecsPerCountry = {
|
|
4616
4633
|
/* EUROPE: EU */
|
|
4617
4634
|
[CountryCodes.Austria]: {
|
|
@@ -4721,29 +4738,8 @@ const nonVatSpecsPerCountry = {
|
|
|
4721
4738
|
regex: /^\d{9}MVA$/
|
|
4722
4739
|
}
|
|
4723
4740
|
};
|
|
4724
|
-
const
|
|
4725
|
-
|
|
4726
|
-
return {
|
|
4727
|
-
isValid: CHARACTER_PATTERNS.noHtml.test(input),
|
|
4728
|
-
translationMessage: {
|
|
4729
|
-
translationKey: "validationPleaseEnterAValidRegistrationNumber",
|
|
4730
|
-
format: null,
|
|
4731
|
-
values: null
|
|
4732
|
-
}
|
|
4733
|
-
};
|
|
4734
|
-
}
|
|
4735
|
-
const patternForCountry = businessRegistrationNumberPatterns[fallbackCountry];
|
|
4736
|
-
if (!patternForCountry) {
|
|
4737
|
-
return {
|
|
4738
|
-
isValid: CHARACTER_PATTERNS.noHtml.test(input),
|
|
4739
|
-
translationMessage: {
|
|
4740
|
-
translationKey: "validationPleaseEnterAValidRegistrationNumber",
|
|
4741
|
-
format: null,
|
|
4742
|
-
values: null
|
|
4743
|
-
}
|
|
4744
|
-
};
|
|
4745
|
-
}
|
|
4746
|
-
const patterns = patternForCountry[companyType2] ?? patternForCountry.default;
|
|
4741
|
+
const testInputWithPatterns = (input, patterns) => {
|
|
4742
|
+
var _a, _b;
|
|
4747
4743
|
const patternArray = Array.isArray(patterns) ? [...patterns] : [patterns];
|
|
4748
4744
|
const validPatternMatch = patternArray.find((pattern) => pattern.regex.test(pattern.replaceChars ? input.replaceAll(pattern.replaceChars, "") : input));
|
|
4749
4745
|
return validPatternMatch ? {
|
|
@@ -4757,12 +4753,41 @@ const validateBusinessRegistrationNumber = (input, fallbackCountry = null, compa
|
|
|
4757
4753
|
isValid: false,
|
|
4758
4754
|
translationMessage: {
|
|
4759
4755
|
translationKey: "validationPleaseEnterAValidRegistrationNumberWithFormat",
|
|
4760
|
-
format: patternArray[0].format,
|
|
4761
|
-
values: patternArray[0].values
|
|
4756
|
+
format: (_a = patternArray[0]) == null ? void 0 : _a.format,
|
|
4757
|
+
values: (_b = patternArray[0]) == null ? void 0 : _b.values
|
|
4758
|
+
}
|
|
4759
|
+
};
|
|
4760
|
+
};
|
|
4761
|
+
const validateBusinessRegistrationNumber = (input, fallbackCountry = null, companyType2 = "default", trustType2) => {
|
|
4762
|
+
if (!fallbackCountry) {
|
|
4763
|
+
return {
|
|
4764
|
+
isValid: CHARACTER_PATTERNS.noHtml.test(input),
|
|
4765
|
+
translationMessage: {
|
|
4766
|
+
translationKey: "validationPleaseEnterAValidRegistrationNumber",
|
|
4767
|
+
format: null,
|
|
4768
|
+
values: null
|
|
4769
|
+
}
|
|
4770
|
+
};
|
|
4771
|
+
}
|
|
4772
|
+
const trustPatternForCountry = trustRegistrationNumberPatterns[fallbackCountry];
|
|
4773
|
+
const companyPatternForCountry = businessRegistrationNumberPatterns[fallbackCountry];
|
|
4774
|
+
if (trustType2 && trustPatternForCountry) {
|
|
4775
|
+
return testInputWithPatterns(input, trustPatternForCountry[trustType2] ?? trustPatternForCountry.default);
|
|
4776
|
+
}
|
|
4777
|
+
if (companyPatternForCountry) {
|
|
4778
|
+
const patterns = companyPatternForCountry[companyType2] ?? companyPatternForCountry.default;
|
|
4779
|
+
return testInputWithPatterns(input, patterns);
|
|
4780
|
+
}
|
|
4781
|
+
return {
|
|
4782
|
+
isValid: CHARACTER_PATTERNS.noHtml.test(input),
|
|
4783
|
+
translationMessage: {
|
|
4784
|
+
translationKey: "validationPleaseEnterAValidRegistrationNumber",
|
|
4785
|
+
format: null,
|
|
4786
|
+
values: null
|
|
4762
4787
|
}
|
|
4763
4788
|
};
|
|
4764
4789
|
};
|
|
4765
|
-
const getValidationRulesPerCountryAndType = (country2, companyType2, i18n) => ({
|
|
4790
|
+
const getValidationRulesPerCountryAndType = (country2, companyType2, trustType2, i18n) => ({
|
|
4766
4791
|
modes: ["blur"],
|
|
4767
4792
|
validate(registrationNumber2) {
|
|
4768
4793
|
if (!registrationNumber2)
|
|
@@ -4770,7 +4795,7 @@ const getValidationRulesPerCountryAndType = (country2, companyType2, i18n) => ({
|
|
|
4770
4795
|
const {
|
|
4771
4796
|
isValid,
|
|
4772
4797
|
translationMessage
|
|
4773
|
-
} = validateBusinessRegistrationNumber(registrationNumber2, country2, companyType2);
|
|
4798
|
+
} = validateBusinessRegistrationNumber(registrationNumber2, country2, companyType2, trustType2);
|
|
4774
4799
|
this.errorMessage = {
|
|
4775
4800
|
translationKey: translationMessage.translationKey,
|
|
4776
4801
|
translationObject: {
|
|
@@ -4789,9 +4814,9 @@ const defaultValidationRules = {
|
|
|
4789
4814
|
validate: (registrationNumber2) => !isEmpty(registrationNumber2),
|
|
4790
4815
|
errorMessage: "fieldIsRequired"
|
|
4791
4816
|
};
|
|
4792
|
-
const getRegistrationNumberValidationRules = (country2, companyType2, i18n) => {
|
|
4817
|
+
const getRegistrationNumberValidationRules = (country2, companyType2, trustType2, i18n) => {
|
|
4793
4818
|
const validationRules = [defaultValidationRules];
|
|
4794
|
-
const countryValidationRules = getValidationRulesPerCountryAndType(country2, companyType2, i18n);
|
|
4819
|
+
const countryValidationRules = getValidationRulesPerCountryAndType(country2, companyType2, trustType2, i18n);
|
|
4795
4820
|
if (countryValidationRules) {
|
|
4796
4821
|
validationRules.push(countryValidationRules);
|
|
4797
4822
|
}
|
|
@@ -4810,9 +4835,10 @@ function BusinessRegistrationNumber(props) {
|
|
|
4810
4835
|
const schema = props.requiredFields || ["registrationNumber"];
|
|
4811
4836
|
const {
|
|
4812
4837
|
companyType: companyType2,
|
|
4813
|
-
country: country2
|
|
4838
|
+
country: country2,
|
|
4839
|
+
trustType: trustType2
|
|
4814
4840
|
} = props;
|
|
4815
|
-
const validationRules = useMemo(() => getRegistrationNumberValidationRules(country2, companyType2, i18n), [country2, companyType2, i18n]);
|
|
4841
|
+
const validationRules = useMemo(() => getRegistrationNumberValidationRules(country2, companyType2, trustType2, i18n), [country2, companyType2, i18n]);
|
|
4816
4842
|
const registrationNumberFormatters = getRegistrationNumberFormatters(props.country);
|
|
4817
4843
|
const {
|
|
4818
4844
|
handleChangeFor,
|
|
@@ -7505,7 +7531,7 @@ function datasetUtilities(locale) {
|
|
|
7505
7531
|
getDatasetKey: (identifier) => createDatasetKey(identifier, locale)
|
|
7506
7532
|
};
|
|
7507
7533
|
}
|
|
7508
|
-
const logger$
|
|
7534
|
+
const logger$k = createLogger("CountryField");
|
|
7509
7535
|
const COUNTRY_FIELD = "country";
|
|
7510
7536
|
function CountryField({
|
|
7511
7537
|
data,
|
|
@@ -7528,7 +7554,7 @@ function CountryField({
|
|
|
7528
7554
|
dataset: countriesFromApi
|
|
7529
7555
|
} = useDataset(datasetIdentifier.country);
|
|
7530
7556
|
useEffect(() => {
|
|
7531
|
-
loadFlags2().catch(logger$
|
|
7557
|
+
loadFlags2().catch(logger$k.error);
|
|
7532
7558
|
}, [loadFlags2]);
|
|
7533
7559
|
const countries = countriesFromApi.filter((country2) => allowedCountries.length ? allowedCountries.includes(country2.id) : true).map((item) => ({
|
|
7534
7560
|
...item,
|
|
@@ -8420,7 +8446,7 @@ var TrustMemberGuidanceLabel = /* @__PURE__ */ ((TrustMemberGuidanceLabel2) => {
|
|
|
8420
8446
|
TrustMemberGuidanceLabel2["SETTLOR"] = "settlor";
|
|
8421
8447
|
return TrustMemberGuidanceLabel2;
|
|
8422
8448
|
})(TrustMemberGuidanceLabel || {});
|
|
8423
|
-
const TRUST_COUNTRIES = ["AU"];
|
|
8449
|
+
const TRUST_COUNTRIES = ["AU", "NZ"];
|
|
8424
8450
|
const trustBase = {
|
|
8425
8451
|
trustType: {
|
|
8426
8452
|
rule: "REQUIRED"
|
|
@@ -8432,7 +8458,7 @@ const trustBase = {
|
|
|
8432
8458
|
rule: "REQUIRED"
|
|
8433
8459
|
},
|
|
8434
8460
|
taxId: {
|
|
8435
|
-
rule: "
|
|
8461
|
+
rule: "countryUsesTaxId"
|
|
8436
8462
|
},
|
|
8437
8463
|
registrationAddress: {
|
|
8438
8464
|
rule: "REQUIRED"
|
|
@@ -8442,6 +8468,9 @@ const trustBase = {
|
|
|
8442
8468
|
},
|
|
8443
8469
|
constitutionalDocument: {
|
|
8444
8470
|
rule: "REQUIRED"
|
|
8471
|
+
},
|
|
8472
|
+
registrationNumber: {
|
|
8473
|
+
rule: "countryRequiresRegistrationNumberForTrust"
|
|
8445
8474
|
}
|
|
8446
8475
|
};
|
|
8447
8476
|
const fieldsPerScenario$2 = {
|
|
@@ -8460,6 +8489,11 @@ const countryConfig$3 = {
|
|
|
8460
8489
|
taxId: {
|
|
8461
8490
|
label: "australianBusinessNumberAbn"
|
|
8462
8491
|
}
|
|
8492
|
+
},
|
|
8493
|
+
NZ: {
|
|
8494
|
+
registrationNumber: {
|
|
8495
|
+
label: "NZBN"
|
|
8496
|
+
}
|
|
8463
8497
|
}
|
|
8464
8498
|
};
|
|
8465
8499
|
const DEFAULT_TRUST_MEMBER_REQUIREMENTS = [{
|
|
@@ -8532,6 +8566,7 @@ var TaskTypes = /* @__PURE__ */ ((TaskTypes2) => {
|
|
|
8532
8566
|
TaskTypes2["TRUST_MEMBER_COMPANY_OWNER"] = "TRUST_MEMBER_COMPANY_OWNER";
|
|
8533
8567
|
TaskTypes2["SOLE_PROPRIETOR_COMPANY"] = "SOLE_PROPRIETOR_COMPANY";
|
|
8534
8568
|
TaskTypes2["LEGAL_ENTITY_TYPE_SWITCHER"] = "LEGAL_ENTITY_TYPE_SWITCHER";
|
|
8569
|
+
TaskTypes2["CAPABILITY_REJECTED"] = "CAPABILITY_REJECTED";
|
|
8535
8570
|
return TaskTypes2;
|
|
8536
8571
|
})(TaskTypes || {});
|
|
8537
8572
|
var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
|
|
@@ -8550,13 +8585,13 @@ var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
|
|
|
8550
8585
|
const SOLE_PROP_COUNTRIES = [CountryCodes.Austria, CountryCodes.Australia, CountryCodes.Belgium, CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.Cyprus, CountryCodes.CzechRepublic, CountryCodes.Denmark, CountryCodes.Estonia, CountryCodes.Finland, CountryCodes.France, CountryCodes.Germany, CountryCodes.Gibraltar, CountryCodes.Greece, CountryCodes.Guernsey, CountryCodes.HongKong, CountryCodes.Hungary, CountryCodes.Ireland, CountryCodes.IsleOfMan, CountryCodes.Italy, CountryCodes.Jersey, CountryCodes.Latvia, CountryCodes.Liechtenstein, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Malta, CountryCodes.Monaco, CountryCodes.Netherlands, CountryCodes.NewZealand, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Portugal, CountryCodes.PuertoRico, CountryCodes.Romania, CountryCodes.Singapore, CountryCodes.Slovakia, CountryCodes.Slovenia, CountryCodes.Spain, CountryCodes.Sweden, CountryCodes.Switzerland, CountryCodes.UnitedKingdom, CountryCodes.UnitedStates];
|
|
8551
8586
|
const ID_NUMBER_EXEMPT_COUNTRIES = [CountryCodes.Canada, CountryCodes.UnitedStates];
|
|
8552
8587
|
const ID_NUMBER_VERIFICATION_COUNTRIES = [CountryCodes.UnitedStates];
|
|
8553
|
-
const COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES = [CountryCodes.HongKong, CountryCodes.Australia];
|
|
8588
|
+
const COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES = [CountryCodes.HongKong, CountryCodes.Australia, CountryCodes.NewZealand];
|
|
8554
8589
|
const ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES = [CountryCodes.Singapore, CountryCodes.NewZealand];
|
|
8555
8590
|
const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore];
|
|
8556
8591
|
const CONTACTS_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
|
|
8557
8592
|
const JOB_TITLE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
|
|
8558
8593
|
const ISSUER_REQUIRED_FOR_COUNTRIES = [CountryCodes.Australia];
|
|
8559
|
-
const rules$
|
|
8594
|
+
const rules$3 = ({
|
|
8560
8595
|
data,
|
|
8561
8596
|
country: country2,
|
|
8562
8597
|
taskType
|
|
@@ -8655,17 +8690,17 @@ const accountHolderValidationRules = {
|
|
|
8655
8690
|
}
|
|
8656
8691
|
};
|
|
8657
8692
|
const accountHolderFields = ["accountHolder"];
|
|
8658
|
-
const logger$
|
|
8693
|
+
const logger$j = createLogger("AccountHolder");
|
|
8659
8694
|
function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
|
|
8660
8695
|
switch (legalEntityType) {
|
|
8661
8696
|
case LegalEntityType.ORGANIZATION: {
|
|
8662
8697
|
return ["theCompanyIWorkFor", ...isChangeOfLegalEntityTypeAllowed ? ["myName"] : [], ...isTrustFlowEnabled ? ["aTrust"] : []];
|
|
8663
8698
|
}
|
|
8664
8699
|
case LegalEntityType.INDIVIDUAL: {
|
|
8665
|
-
return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["
|
|
8700
|
+
return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
|
|
8666
8701
|
}
|
|
8667
8702
|
default:
|
|
8668
|
-
logger$
|
|
8703
|
+
logger$j.error(`No available account holder options for legal entity type '${legalEntityType}'`);
|
|
8669
8704
|
return [];
|
|
8670
8705
|
}
|
|
8671
8706
|
}
|
|
@@ -9395,7 +9430,7 @@ function Dropzone(props) {
|
|
|
9395
9430
|
})]
|
|
9396
9431
|
});
|
|
9397
9432
|
}
|
|
9398
|
-
const logger$
|
|
9433
|
+
const logger$i = createLogger("TextArea");
|
|
9399
9434
|
function TextArea(props) {
|
|
9400
9435
|
const {
|
|
9401
9436
|
classNameModifiers,
|
|
@@ -9416,7 +9451,7 @@ function TextArea(props) {
|
|
|
9416
9451
|
} = useI18nContext();
|
|
9417
9452
|
const [value, setValue] = useState("");
|
|
9418
9453
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
9419
|
-
logger$
|
|
9454
|
+
logger$i.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
9420
9455
|
}
|
|
9421
9456
|
const handleInput = (e) => {
|
|
9422
9457
|
var _a;
|
|
@@ -9825,7 +9860,7 @@ function FieldContainer(props) {
|
|
|
9825
9860
|
}
|
|
9826
9861
|
return renderField(fieldName);
|
|
9827
9862
|
}
|
|
9828
|
-
const logger$
|
|
9863
|
+
const logger$h = createLogger("SearchAddress");
|
|
9829
9864
|
const SearchAddress = ({
|
|
9830
9865
|
data,
|
|
9831
9866
|
legalEntityId,
|
|
@@ -9851,7 +9886,7 @@ const SearchAddress = ({
|
|
|
9851
9886
|
const response = await handleFindAddress(selectedAddressId);
|
|
9852
9887
|
autocompleteAddressForm(response);
|
|
9853
9888
|
} catch (e) {
|
|
9854
|
-
logger$
|
|
9889
|
+
logger$h.error(e);
|
|
9855
9890
|
}
|
|
9856
9891
|
};
|
|
9857
9892
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -9863,7 +9898,7 @@ const SearchAddress = ({
|
|
|
9863
9898
|
}, legalEntityId);
|
|
9864
9899
|
setItems((response == null ? void 0 : response.results) || []);
|
|
9865
9900
|
} catch (e) {
|
|
9866
|
-
logger$
|
|
9901
|
+
logger$h.error(e);
|
|
9867
9902
|
}
|
|
9868
9903
|
};
|
|
9869
9904
|
const onChange = (e) => {
|
|
@@ -9918,7 +9953,7 @@ const SearchAddress = ({
|
|
|
9918
9953
|
setItems([]);
|
|
9919
9954
|
}
|
|
9920
9955
|
} catch (e) {
|
|
9921
|
-
logger$
|
|
9956
|
+
logger$h.error(e);
|
|
9922
9957
|
}
|
|
9923
9958
|
setLoading(false);
|
|
9924
9959
|
}
|
|
@@ -11132,7 +11167,7 @@ const fileToBase64 = (file) => new Promise((resolve, reject) => {
|
|
|
11132
11167
|
reader.onerror = (error) => reject(error);
|
|
11133
11168
|
});
|
|
11134
11169
|
const getFileExtention = (fileName2) => fileName2.split(".").pop();
|
|
11135
|
-
const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [CountryCodes.Australia, CountryCodes.Gibraltar, CountryCodes.Guernsey, CountryCodes.Ireland, CountryCodes.IsleOfMan, CountryCodes.Jersey, CountryCodes.Malta, CountryCodes.PuertoRico, CountryCodes.Spain, CountryCodes.UnitedKingdom, CountryCodes.UnitedStates];
|
|
11170
|
+
const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [CountryCodes.Australia, CountryCodes.Gibraltar, CountryCodes.Guernsey, CountryCodes.HongKong, CountryCodes.Ireland, CountryCodes.IsleOfMan, CountryCodes.Jersey, CountryCodes.Malta, CountryCodes.PuertoRico, CountryCodes.Spain, CountryCodes.UnitedKingdom, CountryCodes.UnitedStates];
|
|
11136
11171
|
const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [CountryCodes.UnitedStates];
|
|
11137
11172
|
const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [CountryCodes.Austria, CountryCodes.Canada, CountryCodes.Finland, CountryCodes.Germany, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.Switzerland];
|
|
11138
11173
|
const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.Gibraltar, CountryCodes.HongKong, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.Singapore, CountryCodes.UnitedStates];
|
|
@@ -11148,7 +11183,7 @@ const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS = [
|
|
|
11148
11183
|
];
|
|
11149
11184
|
const COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION = [CountryCodes.HongKong, CountryCodes.Singapore];
|
|
11150
11185
|
const COUNTRIES_THAT_USES_UEN_OR_GST = [CountryCodes.Singapore];
|
|
11151
|
-
const rules$
|
|
11186
|
+
const rules$2 = ({
|
|
11152
11187
|
data,
|
|
11153
11188
|
country: country2,
|
|
11154
11189
|
taskType
|
|
@@ -11427,6 +11462,92 @@ const hasMinRequiredDecisionMakerCount = (legalEntityResponse) => {
|
|
|
11427
11462
|
return roleTypes.some((role2) => min ? (existingDecisionMakerCount == null ? void 0 : existingDecisionMakerCount[role2]) ?? min <= 0 : true);
|
|
11428
11463
|
});
|
|
11429
11464
|
};
|
|
11465
|
+
var TrustTypes = /* @__PURE__ */ ((TrustTypes2) => {
|
|
11466
|
+
TrustTypes2["BUSINESS_TRUST"] = "businessTrust";
|
|
11467
|
+
TrustTypes2["CASH_MANAGEMENT_TRUST"] = "cashManagementTrust";
|
|
11468
|
+
TrustTypes2["CHARTIABLE_TRUST"] = "charitableTrust";
|
|
11469
|
+
TrustTypes2["CORPORATE_UNIT_TRUST"] = "corporateUnitTrust";
|
|
11470
|
+
TrustTypes2["DECEASED_ESTATE"] = "deceasedEstate";
|
|
11471
|
+
TrustTypes2["DISCRETIONARY_INVESTMENT_TRUST"] = "discretionaryInvestmentTrust";
|
|
11472
|
+
TrustTypes2["DISCRETIONARY_SERVICES_MANAGEMENT_TRUST"] = "discretionaryServicesManagementTrust";
|
|
11473
|
+
TrustTypes2["DISCRETIONARY_TRADING_TRUST"] = "discretionaryTradingTrust";
|
|
11474
|
+
TrustTypes2["DISCRETIONARY_TRUST"] = "discretionaryTrust";
|
|
11475
|
+
TrustTypes2["FAMILY_TRUST"] = "familyTrust";
|
|
11476
|
+
TrustTypes2["FIRST_HOME_SAVER_ACCOUNTS_TRUST"] = "firstHomeSaverAccountsTrust";
|
|
11477
|
+
TrustTypes2["FIXED_TRUST"] = "fixedTrust";
|
|
11478
|
+
TrustTypes2["FIXED_UNIT_TRUST"] = "fixedUnitTrust";
|
|
11479
|
+
TrustTypes2["HYBRID_TRUST"] = "hybridTrust";
|
|
11480
|
+
TrustTypes2["LISTED_PUBLIC_UNIT_TRUST"] = "listedPublicUnitTrust";
|
|
11481
|
+
TrustTypes2["OTHER_TRUST"] = "otherTrust";
|
|
11482
|
+
TrustTypes2["POOLED_SUPERANNUATION_TRUST"] = "pooledSuperannuationTrust";
|
|
11483
|
+
TrustTypes2["PUBLIC_TRADING_TRUST"] = "publicTradingTrust";
|
|
11484
|
+
TrustTypes2["UNLISTED_PUBLIC_UNIT_TRUST"] = "unlistedPublicUnitTrust";
|
|
11485
|
+
return TrustTypes2;
|
|
11486
|
+
})(TrustTypes || {});
|
|
11487
|
+
const trustTypeOptions = [{
|
|
11488
|
+
id: TrustTypes.BUSINESS_TRUST,
|
|
11489
|
+
name: "businessTrust"
|
|
11490
|
+
}, {
|
|
11491
|
+
id: TrustTypes.CASH_MANAGEMENT_TRUST,
|
|
11492
|
+
name: "cashManagementTrust"
|
|
11493
|
+
}, {
|
|
11494
|
+
id: TrustTypes.CHARTIABLE_TRUST,
|
|
11495
|
+
name: "charitableTrust"
|
|
11496
|
+
}, {
|
|
11497
|
+
id: TrustTypes.CORPORATE_UNIT_TRUST,
|
|
11498
|
+
name: "corporateUnitTrust"
|
|
11499
|
+
}, {
|
|
11500
|
+
id: TrustTypes.DECEASED_ESTATE,
|
|
11501
|
+
name: "deceasedEstate"
|
|
11502
|
+
}, {
|
|
11503
|
+
id: TrustTypes.DISCRETIONARY_INVESTMENT_TRUST,
|
|
11504
|
+
name: "discretionaryInvestmentTrust"
|
|
11505
|
+
}, {
|
|
11506
|
+
id: TrustTypes.DISCRETIONARY_SERVICES_MANAGEMENT_TRUST,
|
|
11507
|
+
name: "discretionaryServicesManagementTrust"
|
|
11508
|
+
}, {
|
|
11509
|
+
id: TrustTypes.DISCRETIONARY_TRADING_TRUST,
|
|
11510
|
+
name: "discretionaryTradingTrust"
|
|
11511
|
+
}, {
|
|
11512
|
+
id: TrustTypes.DISCRETIONARY_TRUST,
|
|
11513
|
+
name: "discretionaryTrust"
|
|
11514
|
+
}, {
|
|
11515
|
+
id: TrustTypes.FAMILY_TRUST,
|
|
11516
|
+
name: "familyTrust"
|
|
11517
|
+
}, {
|
|
11518
|
+
id: TrustTypes.FIRST_HOME_SAVER_ACCOUNTS_TRUST,
|
|
11519
|
+
name: "firstHomeSaverAccountsTrust"
|
|
11520
|
+
}, {
|
|
11521
|
+
id: TrustTypes.FIXED_TRUST,
|
|
11522
|
+
name: "fixedTrust"
|
|
11523
|
+
}, {
|
|
11524
|
+
id: TrustTypes.FIXED_UNIT_TRUST,
|
|
11525
|
+
name: "fixedUnitTrust"
|
|
11526
|
+
}, {
|
|
11527
|
+
id: TrustTypes.HYBRID_TRUST,
|
|
11528
|
+
name: "hybridTrust"
|
|
11529
|
+
}, {
|
|
11530
|
+
id: TrustTypes.LISTED_PUBLIC_UNIT_TRUST,
|
|
11531
|
+
name: "listedPublicUnitTrust"
|
|
11532
|
+
}, {
|
|
11533
|
+
id: TrustTypes.OTHER_TRUST,
|
|
11534
|
+
name: "otherTrust"
|
|
11535
|
+
}, {
|
|
11536
|
+
id: TrustTypes.POOLED_SUPERANNUATION_TRUST,
|
|
11537
|
+
name: "pooledSuperannuationTrust"
|
|
11538
|
+
}, {
|
|
11539
|
+
id: TrustTypes.PUBLIC_TRADING_TRUST,
|
|
11540
|
+
name: "publicTradingTrust"
|
|
11541
|
+
}, {
|
|
11542
|
+
id: TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST,
|
|
11543
|
+
name: "unlistedPublicUnitTrust"
|
|
11544
|
+
}];
|
|
11545
|
+
const nzSpecificTrustTypes = [TrustTypes.DISCRETIONARY_TRUST, TrustTypes.FAMILY_TRUST, TrustTypes.CHARTIABLE_TRUST, TrustTypes.BUSINESS_TRUST, TrustTypes.OTHER_TRUST];
|
|
11546
|
+
const auSpecificTrustTypes = [TrustTypes.CASH_MANAGEMENT_TRUST, TrustTypes.CORPORATE_UNIT_TRUST, TrustTypes.DECEASED_ESTATE, TrustTypes.DISCRETIONARY_INVESTMENT_TRUST, TrustTypes.DISCRETIONARY_SERVICES_MANAGEMENT_TRUST, TrustTypes.DISCRETIONARY_TRADING_TRUST, TrustTypes.FIRST_HOME_SAVER_ACCOUNTS_TRUST, TrustTypes.FIXED_TRUST, TrustTypes.FIXED_UNIT_TRUST, TrustTypes.HYBRID_TRUST, TrustTypes.LISTED_PUBLIC_UNIT_TRUST, TrustTypes.OTHER_TRUST, TrustTypes.POOLED_SUPERANNUATION_TRUST, TrustTypes.PUBLIC_TRADING_TRUST, TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST];
|
|
11547
|
+
const countryToTrustTypes = {
|
|
11548
|
+
[CountryCodes.Australia]: auSpecificTrustTypes,
|
|
11549
|
+
[CountryCodes.NewZealand]: nzSpecificTrustTypes
|
|
11550
|
+
};
|
|
11430
11551
|
const TRUST_MEMBER_COUNT_RANGE = {
|
|
11431
11552
|
[TrustMemberTypes.DEFINED_BENEFICIARY]: {
|
|
11432
11553
|
min: 1
|
|
@@ -11532,6 +11653,20 @@ const trustMemberGuidanceRoles = {
|
|
|
11532
11653
|
className: "adl-tag--orange"
|
|
11533
11654
|
}
|
|
11534
11655
|
};
|
|
11656
|
+
const getCountrySpecificTrustTypeOptions = (country2) => {
|
|
11657
|
+
const countrySpecificTrustTypes = countryToTrustTypes[country2];
|
|
11658
|
+
if (!countrySpecificTrustTypes) {
|
|
11659
|
+
return [];
|
|
11660
|
+
}
|
|
11661
|
+
const countrySpecificTrustTypeOptions = countrySpecificTrustTypes.map((countrySpecificTrustType) => {
|
|
11662
|
+
const countrySpecificTrustTypeOption = trustTypeOptions.find((trustTypeOption) => trustTypeOption.id === countrySpecificTrustType);
|
|
11663
|
+
if (!countrySpecificTrustTypeOption) {
|
|
11664
|
+
throw new Error("getCountrySpecificTrustTypeOptions(): unknown trust type");
|
|
11665
|
+
}
|
|
11666
|
+
return countrySpecificTrustTypeOption;
|
|
11667
|
+
});
|
|
11668
|
+
return countrySpecificTrustTypeOptions;
|
|
11669
|
+
};
|
|
11535
11670
|
const entityAssociationRoles = {
|
|
11536
11671
|
...trustMemberRoles,
|
|
11537
11672
|
...decisionMakerRoles
|
|
@@ -11576,7 +11711,7 @@ const filterOutUnwantedAssociationsIfRootLE = (taskType, legalEntity, accountHol
|
|
|
11576
11711
|
if (!isRootLegalEntity(legalEntity, taskType)) {
|
|
11577
11712
|
return entityAssociations;
|
|
11578
11713
|
}
|
|
11579
|
-
if (accountHolder2 !== "
|
|
11714
|
+
if (accountHolder2 !== "mySoleProprietorName" && hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, entityAssociations, legalEntity.id)) {
|
|
11580
11715
|
entityAssociations = removeEntityAssociationByType(LegalEntityType.SOLE_PROPRIETORSHIP, entityAssociations, legalEntity.id);
|
|
11581
11716
|
}
|
|
11582
11717
|
if (accountHolder2 !== "aTrust" && hasOwnEntityAssociationOfType(LegalEntityType.TRUST, entityAssociations, legalEntity.id)) {
|
|
@@ -11625,7 +11760,8 @@ function checkForImportantCapabilityStatus(type, capabilityProblems, entityIds)
|
|
|
11625
11760
|
return importantStatuses.reduce((prev, curr) => curr > prev ? curr : prev);
|
|
11626
11761
|
}
|
|
11627
11762
|
const hasPendingCapabilities = (legalEntityResponse) => Object.values(legalEntityResponse.capabilities ?? {}).some((capability) => capability.verificationStatus === "pending");
|
|
11628
|
-
const hasResolvedCapabilities = (legalEntityResponse) => Object.values((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}).every((capability) => capability.verificationStatus === VerificationStatus.VALID
|
|
11763
|
+
const hasResolvedCapabilities = (legalEntityResponse) => Object.values((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}).every((capability) => capability.verificationStatus === VerificationStatus.VALID);
|
|
11764
|
+
const hasRejectedCapabilities = (legalEntityResponse) => Object.values((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}).some((capability) => capability.verificationStatus === VerificationStatus.REJECTED);
|
|
11629
11765
|
const emptyFieldsForIndividual = ["name.firstName", "name.lastName", "residentialAddress.country"];
|
|
11630
11766
|
const emptyFieldsForOrganization = ["legalName", "registeredAddress.country"];
|
|
11631
11767
|
const emptyFieldsForTrust = ["name", "registeredAddress.country"];
|
|
@@ -11650,14 +11786,14 @@ function isEmptyEntity(legalEntity) {
|
|
|
11650
11786
|
const entityTypeToCorrespondingAccountHolderOption = {
|
|
11651
11787
|
[LegalEntityType.INDIVIDUAL]: "myName",
|
|
11652
11788
|
[LegalEntityType.ORGANIZATION]: "theCompanyIWorkFor",
|
|
11653
|
-
[LegalEntityType.SOLE_PROPRIETORSHIP]: "
|
|
11789
|
+
[LegalEntityType.SOLE_PROPRIETORSHIP]: "mySoleProprietorName",
|
|
11654
11790
|
[LegalEntityType.TRUST]: "aTrust"
|
|
11655
11791
|
};
|
|
11656
11792
|
const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false) => {
|
|
11657
11793
|
if (!(legalEntityResponse == null ? void 0 : legalEntityResponse.type))
|
|
11658
11794
|
return void 0;
|
|
11659
11795
|
if (hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntityResponse.entityAssociations, legalEntityResponse.id)) {
|
|
11660
|
-
return "
|
|
11796
|
+
return "mySoleProprietorName";
|
|
11661
11797
|
}
|
|
11662
11798
|
if (hasOwnEntityAssociationOfType(LegalEntityType.TRUST, legalEntityResponse.entityAssociations, legalEntityResponse.id)) {
|
|
11663
11799
|
return "aTrust";
|
|
@@ -11669,7 +11805,8 @@ const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false
|
|
|
11669
11805
|
const countryToTaxInfoTypeMap = {
|
|
11670
11806
|
US: "EIN",
|
|
11671
11807
|
AU: "ABN",
|
|
11672
|
-
NZ: "IRD"
|
|
11808
|
+
NZ: "IRD",
|
|
11809
|
+
HK: "BRN"
|
|
11673
11810
|
};
|
|
11674
11811
|
const updateTaxInformation = ({
|
|
11675
11812
|
taxId: taxId2,
|
|
@@ -11824,6 +11961,7 @@ const trustBaseMapping = {
|
|
|
11824
11961
|
"trustRegistrationDetails.trustType": "trust.type",
|
|
11825
11962
|
"trustRegistrationDetails.legalName": "trust.name",
|
|
11826
11963
|
"trustRegistrationDetails.country": "trust.countryOfGoverningLaw",
|
|
11964
|
+
"trustRegistrationDetails.registrationNumber": "trust.registrationNumber",
|
|
11827
11965
|
"trustRegistrationAddress.registrationAddress.city": "trust.registeredAddress.city",
|
|
11828
11966
|
"trustRegistrationAddress.registrationAddress.country": "trust.registeredAddress.country",
|
|
11829
11967
|
"trustRegistrationAddress.registrationAddress.postalCode": "trust.registeredAddress.postalCode",
|
|
@@ -13155,7 +13293,7 @@ const initOnfido = async ({
|
|
|
13155
13293
|
language: getOnfidoLocaleConfig(i18n)
|
|
13156
13294
|
});
|
|
13157
13295
|
};
|
|
13158
|
-
const logger$
|
|
13296
|
+
const logger$g = createLogger("IdVerificationComponent");
|
|
13159
13297
|
function IdVerificationComponent({
|
|
13160
13298
|
userDetails,
|
|
13161
13299
|
handleGetIdVerificationToken,
|
|
@@ -13186,7 +13324,7 @@ function IdVerificationComponent({
|
|
|
13186
13324
|
onIdVerificationError,
|
|
13187
13325
|
onIdVerificationComplete
|
|
13188
13326
|
});
|
|
13189
|
-
})().catch(logger$
|
|
13327
|
+
})().catch(logger$g.error);
|
|
13190
13328
|
return () => {
|
|
13191
13329
|
if (onfidoSdk.current)
|
|
13192
13330
|
onfidoSdk.current.tearDown();
|
|
@@ -13238,7 +13376,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
13238
13376
|
})]
|
|
13239
13377
|
});
|
|
13240
13378
|
}
|
|
13241
|
-
const logger$
|
|
13379
|
+
const logger$f = createLogger("IdDocumentInstantVerificationComponent");
|
|
13242
13380
|
const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
|
|
13243
13381
|
const documentTypeValidationRules = {
|
|
13244
13382
|
instantIdVerificationData: {
|
|
@@ -13319,7 +13457,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
13319
13457
|
handleGetIdVerificationToken: props.handleGetIdVerificationToken,
|
|
13320
13458
|
userDetails: props.userDetails,
|
|
13321
13459
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
13322
|
-
onIdVerificationError: logger$
|
|
13460
|
+
onIdVerificationError: logger$f.error
|
|
13323
13461
|
}), jsxs("div", {
|
|
13324
13462
|
className: "adyen-kyc-document-upload__manual-upload",
|
|
13325
13463
|
children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
|
|
@@ -16108,7 +16246,7 @@ const removeAnimationStartListener = (element, listener) => {
|
|
|
16108
16246
|
element.removeEventListener("MSAnimationStart", listener, false);
|
|
16109
16247
|
element.removeEventListener("webkitAnimationStart", listener, false);
|
|
16110
16248
|
};
|
|
16111
|
-
const logger$
|
|
16249
|
+
const logger$e = createLogger("Fetch");
|
|
16112
16250
|
const getRequestObject = (options, data) => {
|
|
16113
16251
|
const {
|
|
16114
16252
|
headers = [],
|
|
@@ -16154,7 +16292,7 @@ const handleFetchError = (message, level) => {
|
|
|
16154
16292
|
case "info":
|
|
16155
16293
|
case "warn":
|
|
16156
16294
|
case "error":
|
|
16157
|
-
return logger$
|
|
16295
|
+
return logger$e[level](message);
|
|
16158
16296
|
default:
|
|
16159
16297
|
throw new Error(message);
|
|
16160
16298
|
}
|
|
@@ -16214,7 +16352,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
16214
16352
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
16215
16353
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
16216
16354
|
const TINK_VENDOR = "Tink";
|
|
16217
|
-
const logger$
|
|
16355
|
+
const logger$d = createLogger("iframeWidget");
|
|
16218
16356
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
16219
16357
|
const isTerminalMessageData = (data) => Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
16220
16358
|
const parseMessageJson = (message) => {
|
|
@@ -16233,7 +16371,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
16233
16371
|
try {
|
|
16234
16372
|
await response;
|
|
16235
16373
|
} catch (ex) {
|
|
16236
|
-
logger$
|
|
16374
|
+
logger$d.error(ex);
|
|
16237
16375
|
}
|
|
16238
16376
|
return {
|
|
16239
16377
|
error: "UNKNOWN_ERROR",
|
|
@@ -16339,7 +16477,7 @@ class IFrameWidget {
|
|
|
16339
16477
|
message = responseData.errorMessage;
|
|
16340
16478
|
}
|
|
16341
16479
|
} catch (ex) {
|
|
16342
|
-
logger$
|
|
16480
|
+
logger$d.error(ex);
|
|
16343
16481
|
}
|
|
16344
16482
|
throw new AdyenKycSdkError(message);
|
|
16345
16483
|
}
|
|
@@ -16518,7 +16656,7 @@ function BankVerificationWidget({
|
|
|
16518
16656
|
ref: widgetContainerRef
|
|
16519
16657
|
});
|
|
16520
16658
|
}
|
|
16521
|
-
const logger$
|
|
16659
|
+
const logger$c = createLogger("BankVerification");
|
|
16522
16660
|
const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
|
|
16523
16661
|
const InstantVerificationErrorContext = createContext(null);
|
|
16524
16662
|
const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
|
|
@@ -16552,7 +16690,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
|
|
|
16552
16690
|
const preferredVendor2 = vendors[0];
|
|
16553
16691
|
setPreferredVendor(preferredVendor2.name ? preferredVendor2 : null);
|
|
16554
16692
|
};
|
|
16555
|
-
getPreferredVendor().catch(logger$
|
|
16693
|
+
getPreferredVendor().catch(logger$c.error);
|
|
16556
16694
|
}, [country2, getBankVerificationVendors]);
|
|
16557
16695
|
return preferredVendor;
|
|
16558
16696
|
};
|
|
@@ -17458,7 +17596,7 @@ function PayoutAccountComponent(props) {
|
|
|
17458
17596
|
const bankNameProps = getFieldProps(props, bankNameFields);
|
|
17459
17597
|
const bankCodeProps = getFieldProps(props, bankCodeFields);
|
|
17460
17598
|
const bankCityProps = getFieldProps(props, bankCityFields);
|
|
17461
|
-
const hasSoleProprietorship = accountHolder2 === "
|
|
17599
|
+
const hasSoleProprietorship = accountHolder2 === "mySoleProprietorName" || hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntityResponse.entityAssociations, legalEntityResponse.id);
|
|
17462
17600
|
const hasTrusts = accountHolder2 === "aTrust" || hasOwnEntityAssociationOfType(LegalEntityType.TRUST, legalEntityResponse.entityAssociations, legalEntityResponse.id);
|
|
17463
17601
|
const accountHolderDescriptionKey = hasSoleProprietorship ? "accountHolderDescriptionSoleProp" : hasTrusts ? "bankAccountToHaveSameNameAsTrust" : legalEntityResponse.type === LegalEntityType.ORGANIZATION ? "accountHolderDescriptionCompany" : "accountHolderDescriptionIndividual";
|
|
17464
17602
|
return jsxs("form", {
|
|
@@ -18504,28 +18642,6 @@ function SolePropComponent(props) {
|
|
|
18504
18642
|
});
|
|
18505
18643
|
}
|
|
18506
18644
|
const Trust = "";
|
|
18507
|
-
var TrustTypes = /* @__PURE__ */ ((TrustTypes2) => {
|
|
18508
|
-
TrustTypes2["BUSINESS_TRUST"] = "businessTrust";
|
|
18509
|
-
TrustTypes2["CASH_MANAGEMENT_TRUST"] = "cashManagementTrust";
|
|
18510
|
-
TrustTypes2["CHARTIABLE_TRUST"] = "charitableTrust";
|
|
18511
|
-
TrustTypes2["CORPORATE_UNIT_TRUST"] = "corporateUnitTrust";
|
|
18512
|
-
TrustTypes2["DECEASED_ESTATE"] = "deceasedEstate";
|
|
18513
|
-
TrustTypes2["DISCRETIONARY_INVESTMENT_TRUST"] = "discretionaryInvestmentTrust";
|
|
18514
|
-
TrustTypes2["DISCRETIONARY_SERVICES_MANAGEMENT_TRUST"] = "discretionaryServicesManagementTrust";
|
|
18515
|
-
TrustTypes2["DISCRETIONARY_TRADING_TRUST"] = "discretionaryTradingTrust";
|
|
18516
|
-
TrustTypes2["DISCRETIONARY_TRUST"] = "discretionaryTrust";
|
|
18517
|
-
TrustTypes2["FAMILY_TRUST"] = "familyTrust";
|
|
18518
|
-
TrustTypes2["FIRST_HOME_SAVER_ACCOUNTS_TRUST"] = "firstHomeSaverAccountsTrust";
|
|
18519
|
-
TrustTypes2["FIXED_TRUST"] = "fixedTrust";
|
|
18520
|
-
TrustTypes2["FIXED_UNIT_TRUST"] = "fixedUnitTrust";
|
|
18521
|
-
TrustTypes2["HYBRID_TRUST"] = "hybridTrust";
|
|
18522
|
-
TrustTypes2["LISTED_PUBLIC_UNIT_TRUST"] = "listedPublicUnitTrust";
|
|
18523
|
-
TrustTypes2["OTHER_TRUST"] = "otherTrust";
|
|
18524
|
-
TrustTypes2["POOLED_SUPERANNUATION_TRUST"] = "pooledSuperannuationTrust";
|
|
18525
|
-
TrustTypes2["PUBLIC_TRADING_TRUST"] = "publicTradingTrust";
|
|
18526
|
-
TrustTypes2["UNLISTED_PUBLIC_UNIT_TRUST"] = "unlistedPublicUnitTrust";
|
|
18527
|
-
return TrustTypes2;
|
|
18528
|
-
})(TrustTypes || {});
|
|
18529
18645
|
const ContextHelper$1 = "";
|
|
18530
18646
|
const ContextHelper = ({
|
|
18531
18647
|
content
|
|
@@ -18538,64 +18654,6 @@ const ContextHelper = ({
|
|
|
18538
18654
|
}), content]
|
|
18539
18655
|
})
|
|
18540
18656
|
});
|
|
18541
|
-
const trustTypeOptions = [{
|
|
18542
|
-
id: TrustTypes.BUSINESS_TRUST,
|
|
18543
|
-
name: "businessTrust"
|
|
18544
|
-
}, {
|
|
18545
|
-
id: TrustTypes.CASH_MANAGEMENT_TRUST,
|
|
18546
|
-
name: "cashManagementTrust"
|
|
18547
|
-
}, {
|
|
18548
|
-
id: TrustTypes.CHARTIABLE_TRUST,
|
|
18549
|
-
name: "charitableTrust"
|
|
18550
|
-
}, {
|
|
18551
|
-
id: TrustTypes.CORPORATE_UNIT_TRUST,
|
|
18552
|
-
name: "corporateUnitTrust"
|
|
18553
|
-
}, {
|
|
18554
|
-
id: TrustTypes.DECEASED_ESTATE,
|
|
18555
|
-
name: "deceasedEstate"
|
|
18556
|
-
}, {
|
|
18557
|
-
id: TrustTypes.DISCRETIONARY_INVESTMENT_TRUST,
|
|
18558
|
-
name: "discretionaryInvestmentTrust"
|
|
18559
|
-
}, {
|
|
18560
|
-
id: TrustTypes.DISCRETIONARY_SERVICES_MANAGEMENT_TRUST,
|
|
18561
|
-
name: "discretionaryServicesManagementTrust"
|
|
18562
|
-
}, {
|
|
18563
|
-
id: TrustTypes.DISCRETIONARY_TRADING_TRUST,
|
|
18564
|
-
name: "discretionaryTradingTrust"
|
|
18565
|
-
}, {
|
|
18566
|
-
id: TrustTypes.DISCRETIONARY_TRUST,
|
|
18567
|
-
name: "discretionaryTrust"
|
|
18568
|
-
}, {
|
|
18569
|
-
id: TrustTypes.FAMILY_TRUST,
|
|
18570
|
-
name: "familyTrust"
|
|
18571
|
-
}, {
|
|
18572
|
-
id: TrustTypes.FIRST_HOME_SAVER_ACCOUNTS_TRUST,
|
|
18573
|
-
name: "firstHomeSaverAccountsTrust"
|
|
18574
|
-
}, {
|
|
18575
|
-
id: TrustTypes.FIXED_TRUST,
|
|
18576
|
-
name: "fixedTrust"
|
|
18577
|
-
}, {
|
|
18578
|
-
id: TrustTypes.FIXED_UNIT_TRUST,
|
|
18579
|
-
name: "fixedUnitTrust"
|
|
18580
|
-
}, {
|
|
18581
|
-
id: TrustTypes.HYBRID_TRUST,
|
|
18582
|
-
name: "hybridTrust"
|
|
18583
|
-
}, {
|
|
18584
|
-
id: TrustTypes.LISTED_PUBLIC_UNIT_TRUST,
|
|
18585
|
-
name: "listedPublicUnitTrust"
|
|
18586
|
-
}, {
|
|
18587
|
-
id: TrustTypes.OTHER_TRUST,
|
|
18588
|
-
name: "otherTrust"
|
|
18589
|
-
}, {
|
|
18590
|
-
id: TrustTypes.POOLED_SUPERANNUATION_TRUST,
|
|
18591
|
-
name: "pooledSuperannuationTrust"
|
|
18592
|
-
}, {
|
|
18593
|
-
id: TrustTypes.PUBLIC_TRADING_TRUST,
|
|
18594
|
-
name: "publicTradingTrust"
|
|
18595
|
-
}, {
|
|
18596
|
-
id: TrustTypes.UNLISTED_PUBLIC_UNIT_TRUST,
|
|
18597
|
-
name: "unlistedPublicUnitTrust"
|
|
18598
|
-
}];
|
|
18599
18657
|
const trustRegistrationDetailsValidations = {
|
|
18600
18658
|
trustType: {
|
|
18601
18659
|
modes: ["blur"],
|
|
@@ -18613,10 +18671,10 @@ const trustRegistrationDetailsValidations = {
|
|
|
18613
18671
|
errorMessage: "fieldIsRequired"
|
|
18614
18672
|
}
|
|
18615
18673
|
};
|
|
18616
|
-
const trustRegistrationDetailsFields = ["legalName", "country", "trustType", "taxId"];
|
|
18617
|
-
const ALLOWED_TRUST_COUNTRIES = [CountryCodes.Australia];
|
|
18674
|
+
const trustRegistrationDetailsFields = ["legalName", "country", "trustType", "taxId", "registrationNumber"];
|
|
18675
|
+
const ALLOWED_TRUST_COUNTRIES = [CountryCodes.Australia, CountryCodes.NewZealand];
|
|
18618
18676
|
function TrustRegistrationDetailsComponent(props) {
|
|
18619
|
-
var _a;
|
|
18677
|
+
var _a, _b;
|
|
18620
18678
|
const {
|
|
18621
18679
|
i18n
|
|
18622
18680
|
} = useI18nContext();
|
|
@@ -18625,7 +18683,7 @@ function TrustRegistrationDetailsComponent(props) {
|
|
|
18625
18683
|
setState: null
|
|
18626
18684
|
});
|
|
18627
18685
|
const requiredFieldsByTask = trustRegistrationDetailsFields;
|
|
18628
|
-
const directChildFields = requiredFieldsByTask.filter((field) => ["trustType", "legalName", "country"].includes(field));
|
|
18686
|
+
const directChildFields = requiredFieldsByTask.filter((field) => ["trustType", "legalName", "country", "taxId", "registrationNumber"].includes(field));
|
|
18629
18687
|
const {
|
|
18630
18688
|
handleChangeFor,
|
|
18631
18689
|
data,
|
|
@@ -18643,8 +18701,8 @@ function TrustRegistrationDetailsComponent(props) {
|
|
|
18643
18701
|
});
|
|
18644
18702
|
const formUtils = formUtilities(props, i18n);
|
|
18645
18703
|
useEffect(() => {
|
|
18646
|
-
var _a2,
|
|
18647
|
-
(
|
|
18704
|
+
var _a2, _b2;
|
|
18705
|
+
(_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b2.call(_a2, {
|
|
18648
18706
|
type: "addToState",
|
|
18649
18707
|
value: {
|
|
18650
18708
|
data,
|
|
@@ -18659,13 +18717,13 @@ function TrustRegistrationDetailsComponent(props) {
|
|
|
18659
18717
|
}, [data, valid, errors]);
|
|
18660
18718
|
const taxIdProps = getFieldProps(props, taxIdFields);
|
|
18661
18719
|
useEffect(() => {
|
|
18662
|
-
if (
|
|
18663
|
-
setData("country",
|
|
18720
|
+
if (!data.country) {
|
|
18721
|
+
setData("country", props.country);
|
|
18664
18722
|
triggerValidation(["country"]);
|
|
18665
18723
|
}
|
|
18666
18724
|
}, [(_a = props.data) == null ? void 0 : _a.country]);
|
|
18667
|
-
const
|
|
18668
|
-
const
|
|
18725
|
+
const trustTypeOptions2 = getCountrySpecificTrustTypeOptions(props.country) ?? [];
|
|
18726
|
+
const registrationNumberProps = getFieldProps(props, businessRegistrationNumberFields);
|
|
18669
18727
|
return jsxs(Fragment, {
|
|
18670
18728
|
children: [jsx(StateContextSetter, {
|
|
18671
18729
|
owner: TRUST_REGISTRATION_DETAILS,
|
|
@@ -18719,7 +18777,7 @@ function TrustRegistrationDetailsComponent(props) {
|
|
|
18719
18777
|
name: "trustType",
|
|
18720
18778
|
onChange: handleChangeFor("trustType", "blur"),
|
|
18721
18779
|
selected: data.trustType,
|
|
18722
|
-
items:
|
|
18780
|
+
items: trustTypeOptions2.map(({
|
|
18723
18781
|
id: id2,
|
|
18724
18782
|
name
|
|
18725
18783
|
}) => ({
|
|
@@ -18732,6 +18790,11 @@ function TrustRegistrationDetailsComponent(props) {
|
|
|
18732
18790
|
...taxIdProps,
|
|
18733
18791
|
dataStoreId: TRUST_REGISTRATION_DETAILS,
|
|
18734
18792
|
country: props.country
|
|
18793
|
+
}), formUtils.isRequiredField("registrationNumber") && jsx(BusinessRegistrationNumber, {
|
|
18794
|
+
...registrationNumberProps,
|
|
18795
|
+
dataStoreId: TRUST_REGISTRATION_DETAILS,
|
|
18796
|
+
country: props.country,
|
|
18797
|
+
trustType: (_b = props.data) == null ? void 0 : _b.trustType
|
|
18735
18798
|
})]
|
|
18736
18799
|
})]
|
|
18737
18800
|
});
|
|
@@ -19759,7 +19822,7 @@ const defaultPayoutAccountFormat = {
|
|
|
19759
19822
|
[CountryCodes.Sweden]: "local",
|
|
19760
19823
|
[CountryCodes.UnitedKingdom]: "local"
|
|
19761
19824
|
};
|
|
19762
|
-
const logger$
|
|
19825
|
+
const logger$b = createLogger("useScenarioConfiguration");
|
|
19763
19826
|
const useScenarioConfiguration = ({
|
|
19764
19827
|
getConfigurationData,
|
|
19765
19828
|
getPayoutAccountFormatData,
|
|
@@ -19781,12 +19844,12 @@ const useScenarioConfiguration = ({
|
|
|
19781
19844
|
const response = await getConfigurationData();
|
|
19782
19845
|
setConfigurationResponse(response);
|
|
19783
19846
|
} catch (err) {
|
|
19784
|
-
logger$
|
|
19847
|
+
logger$b.warn("WARNING: Configuration request failed - error:", err);
|
|
19785
19848
|
} finally {
|
|
19786
19849
|
setLoadingStatus("success");
|
|
19787
19850
|
}
|
|
19788
19851
|
};
|
|
19789
|
-
makeConfigCallAndSave().catch(logger$
|
|
19852
|
+
makeConfigCallAndSave().catch(logger$b.error);
|
|
19790
19853
|
}, [getConfigurationData, setLoadingStatus]);
|
|
19791
19854
|
useEffect(() => {
|
|
19792
19855
|
setLoadingStatus("loading");
|
|
@@ -19802,12 +19865,12 @@ const useScenarioConfiguration = ({
|
|
|
19802
19865
|
const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
|
|
19803
19866
|
setAccountFormat(defaultAccountFormat);
|
|
19804
19867
|
} catch (err) {
|
|
19805
|
-
logger$
|
|
19868
|
+
logger$b.warn("WARNING: Payout format request failed - error:", err);
|
|
19806
19869
|
} finally {
|
|
19807
19870
|
setLoadingStatus("success");
|
|
19808
19871
|
}
|
|
19809
19872
|
};
|
|
19810
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
19873
|
+
makePayoutFormatCallAndSave().catch(logger$b.error);
|
|
19811
19874
|
}, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus]);
|
|
19812
19875
|
const {
|
|
19813
19876
|
fieldConfigurations,
|
|
@@ -20452,7 +20515,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
|
|
|
20452
20515
|
return ToastType2;
|
|
20453
20516
|
})(ToastType || {});
|
|
20454
20517
|
const FormComposer = "";
|
|
20455
|
-
const logger$
|
|
20518
|
+
const logger$a = createLogger("FormRouterContextProvider");
|
|
20456
20519
|
function FormRouterContextProvider({
|
|
20457
20520
|
children,
|
|
20458
20521
|
forms,
|
|
@@ -20472,7 +20535,7 @@ function FormRouterContextProvider({
|
|
|
20472
20535
|
if (formIndex > -1) {
|
|
20473
20536
|
setFormIndex(formIndex);
|
|
20474
20537
|
} else {
|
|
20475
|
-
logger$
|
|
20538
|
+
logger$a.error("No form was found to have that field so form navigation failed.");
|
|
20476
20539
|
}
|
|
20477
20540
|
}
|
|
20478
20541
|
}), [forms, handleGetIdVerificationToken, setFormIndex]);
|
|
@@ -20806,7 +20869,7 @@ function CompanyDropinComponent({
|
|
|
20806
20869
|
setLoadingStatus,
|
|
20807
20870
|
country: country2
|
|
20808
20871
|
});
|
|
20809
|
-
const fieldsFromCustomRules = useMemo(() => rules$
|
|
20872
|
+
const fieldsFromCustomRules = useMemo(() => rules$2({
|
|
20810
20873
|
data,
|
|
20811
20874
|
country: country2,
|
|
20812
20875
|
taskType,
|
|
@@ -21069,7 +21132,7 @@ function CompanyDropinComponent({
|
|
|
21069
21132
|
})
|
|
21070
21133
|
});
|
|
21071
21134
|
}
|
|
21072
|
-
const logger$
|
|
21135
|
+
const logger$9 = createLogger("useExemptSettlor");
|
|
21073
21136
|
const useExemptSettlor = ({
|
|
21074
21137
|
trust,
|
|
21075
21138
|
handleGetLegalEntity
|
|
@@ -21081,7 +21144,7 @@ const useExemptSettlor = ({
|
|
|
21081
21144
|
setExemptSettlor(exemptSettlorLE);
|
|
21082
21145
|
}, [handleGetLegalEntity]);
|
|
21083
21146
|
useEffect(() => {
|
|
21084
|
-
updateExemptSettlor(trust).catch(logger$
|
|
21147
|
+
updateExemptSettlor(trust).catch(logger$9.error);
|
|
21085
21148
|
}, [trust, updateExemptSettlor]);
|
|
21086
21149
|
return exemptSettlor;
|
|
21087
21150
|
};
|
|
@@ -21089,22 +21152,24 @@ function useSalesChannelsSettings() {
|
|
|
21089
21152
|
const {
|
|
21090
21153
|
isSettingEnabled
|
|
21091
21154
|
} = useSettingsContext();
|
|
21092
|
-
|
|
21093
|
-
|
|
21094
|
-
|
|
21095
|
-
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21155
|
+
return useMemo(() => {
|
|
21156
|
+
const settings = [];
|
|
21157
|
+
if (isSettingEnabled(SettingNames.RequirePciSignEcommerce)) {
|
|
21158
|
+
settings.push("eCommerce");
|
|
21159
|
+
}
|
|
21160
|
+
if (isSettingEnabled(SettingNames.RequirePciSignPos)) {
|
|
21161
|
+
settings.push("pos");
|
|
21162
|
+
}
|
|
21163
|
+
if (isSettingEnabled(SettingNames.RequirePciSignEcomMoto)) {
|
|
21164
|
+
settings.push("ecomMoto");
|
|
21165
|
+
}
|
|
21166
|
+
if (isSettingEnabled(SettingNames.RequirePciSignPosMoto)) {
|
|
21167
|
+
settings.push("posMoto");
|
|
21168
|
+
}
|
|
21169
|
+
return settings;
|
|
21170
|
+
}, [isSettingEnabled]);
|
|
21106
21171
|
}
|
|
21107
|
-
const logger$
|
|
21172
|
+
const logger$8 = createLogger("useLocalStorage");
|
|
21108
21173
|
function useLocalStorage(key, defaultValue, options) {
|
|
21109
21174
|
const {
|
|
21110
21175
|
serializer,
|
|
@@ -21125,7 +21190,7 @@ function useLocalStorage(key, defaultValue, options) {
|
|
|
21125
21190
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
21126
21191
|
return res;
|
|
21127
21192
|
} catch (err) {
|
|
21128
|
-
logger$
|
|
21193
|
+
logger$8.error(err);
|
|
21129
21194
|
return defaultValue;
|
|
21130
21195
|
}
|
|
21131
21196
|
});
|
|
@@ -21157,7 +21222,7 @@ function useLocalStorage(key, defaultValue, options) {
|
|
|
21157
21222
|
try {
|
|
21158
21223
|
updateLocalStorage();
|
|
21159
21224
|
} catch (err) {
|
|
21160
|
-
logger$
|
|
21225
|
+
logger$8.error(err);
|
|
21161
21226
|
}
|
|
21162
21227
|
}, [value]);
|
|
21163
21228
|
useEffect(() => {
|
|
@@ -21172,7 +21237,7 @@ function useLocalStorage(key, defaultValue, options) {
|
|
|
21172
21237
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
21173
21238
|
}
|
|
21174
21239
|
} catch (err) {
|
|
21175
|
-
logger$
|
|
21240
|
+
logger$8.error(err);
|
|
21176
21241
|
}
|
|
21177
21242
|
};
|
|
21178
21243
|
if (typeof window === "undefined")
|
|
@@ -21452,6 +21517,24 @@ const updateExemptSettlorName = async ({
|
|
|
21452
21517
|
};
|
|
21453
21518
|
return handleUpdateLegalEntity(exemptSettlorPatch, exemptSettlor.legalEntityId);
|
|
21454
21519
|
};
|
|
21520
|
+
function AccountSetupRejected() {
|
|
21521
|
+
const {
|
|
21522
|
+
i18n
|
|
21523
|
+
} = useI18nContext();
|
|
21524
|
+
const content = jsxs("div", {
|
|
21525
|
+
children: [jsx(AlertIcon, {
|
|
21526
|
+
className: "adl-alert-error-icon",
|
|
21527
|
+
type: AlertTypes.ERROR
|
|
21528
|
+
}), jsx(FormHeader, {
|
|
21529
|
+
heading: i18n.get("cantSetUpAcccount")
|
|
21530
|
+
}), jsx("span", {
|
|
21531
|
+
children: i18n.get("accountCantBeSetUp")
|
|
21532
|
+
})]
|
|
21533
|
+
});
|
|
21534
|
+
return jsx(DropinLayout, {
|
|
21535
|
+
content
|
|
21536
|
+
});
|
|
21537
|
+
}
|
|
21455
21538
|
const DecisionMakers = "";
|
|
21456
21539
|
const iconStatus = (current, min, max) => {
|
|
21457
21540
|
const isEmpty2 = current === 0;
|
|
@@ -22655,7 +22738,7 @@ function TaskListComponent({
|
|
|
22655
22738
|
const hasTrust = isExperimentEnabled("EnableTrustFlow") && (accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse));
|
|
22656
22739
|
const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
|
|
22657
22740
|
const isCompany = tasks.some((task) => task === TaskTypes.COMPANY);
|
|
22658
|
-
const hasSoleProprietorship = accountHolder2 === "
|
|
22741
|
+
const hasSoleProprietorship = accountHolder2 === "mySoleProprietorName" || hasSolePropInLegalEntity(legalEntityResponse);
|
|
22659
22742
|
const transferInstruments = (legalEntityResponse == null ? void 0 : legalEntityResponse.transferInstruments) || [];
|
|
22660
22743
|
const canAddPayoutAccount = ((_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.legalName) || ((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _b.name);
|
|
22661
22744
|
const hasPayinTaskNotPayout = tasks.includes(TaskTypes.PAYIN) && !tasks.includes(TaskTypes.PAYOUT);
|
|
@@ -23250,7 +23333,7 @@ function IndividualDropinComponent({
|
|
|
23250
23333
|
setLoadingStatus,
|
|
23251
23334
|
country: country2
|
|
23252
23335
|
});
|
|
23253
|
-
const fieldsFromCustomRules = useMemo(() => rules$
|
|
23336
|
+
const fieldsFromCustomRules = useMemo(() => rules$3({
|
|
23254
23337
|
data,
|
|
23255
23338
|
country: country2,
|
|
23256
23339
|
taskType
|
|
@@ -23668,7 +23751,7 @@ const isInstantVerificationAvailable = ({
|
|
|
23668
23751
|
verificationVendorsCallback,
|
|
23669
23752
|
bankVerificationVendors
|
|
23670
23753
|
}) => Boolean(verificationVendorsCallback && (bankVerificationVendors == null ? void 0 : bankVerificationVendors[country2]));
|
|
23671
|
-
const rules = ({
|
|
23754
|
+
const rules$1 = ({
|
|
23672
23755
|
data,
|
|
23673
23756
|
requiredFields
|
|
23674
23757
|
}) => ({
|
|
@@ -23756,6 +23839,7 @@ function PayoutDetailsDropinComponent({
|
|
|
23756
23839
|
capabilities,
|
|
23757
23840
|
handleHomeClick,
|
|
23758
23841
|
homeButtonLabel,
|
|
23842
|
+
hideNavigation,
|
|
23759
23843
|
refreshLegalEntity,
|
|
23760
23844
|
navigateBackToTaskList,
|
|
23761
23845
|
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
@@ -23850,7 +23934,7 @@ function PayoutDetailsDropinComponent({
|
|
|
23850
23934
|
setLoadingStatus,
|
|
23851
23935
|
country: bankAccountCountry2 ?? defaultPayoutCountry
|
|
23852
23936
|
});
|
|
23853
|
-
const fieldsFromCustomRules = useMemo(() => rules({
|
|
23937
|
+
const fieldsFromCustomRules = useMemo(() => rules$1({
|
|
23854
23938
|
data,
|
|
23855
23939
|
country: bankAccountCountry2 ?? defaultPayoutCountry,
|
|
23856
23940
|
taskType,
|
|
@@ -24085,6 +24169,7 @@ function PayoutDetailsDropinComponent({
|
|
|
24085
24169
|
hideDropinLayout,
|
|
24086
24170
|
hideHomeButton,
|
|
24087
24171
|
hideBackButton,
|
|
24172
|
+
hideNavigation,
|
|
24088
24173
|
loadingStatus,
|
|
24089
24174
|
forms,
|
|
24090
24175
|
onSubmit,
|
|
@@ -24434,14 +24519,15 @@ function PciDropinComponent({
|
|
|
24434
24519
|
legalEntityResponse,
|
|
24435
24520
|
pciTemplateResponse,
|
|
24436
24521
|
handleHomeClick,
|
|
24437
|
-
handleLanguageChange,
|
|
24438
24522
|
handleSign,
|
|
24439
24523
|
taskType,
|
|
24524
|
+
eventEmitter,
|
|
24440
24525
|
trackingConfig
|
|
24441
24526
|
}) {
|
|
24442
24527
|
var _a, _b, _c, _d;
|
|
24443
24528
|
const {
|
|
24444
|
-
i18n
|
|
24529
|
+
i18n,
|
|
24530
|
+
setLocale
|
|
24445
24531
|
} = useI18nContext();
|
|
24446
24532
|
const {
|
|
24447
24533
|
showToast
|
|
@@ -24543,8 +24629,8 @@ function PciDropinComponent({
|
|
|
24543
24629
|
});
|
|
24544
24630
|
};
|
|
24545
24631
|
useEffect(() => {
|
|
24546
|
-
|
|
24547
|
-
}, [
|
|
24632
|
+
eventEmitter.on("updateLocale", (locale) => setLocale(locale));
|
|
24633
|
+
}, []);
|
|
24548
24634
|
useEffect(() => {
|
|
24549
24635
|
userEvents.addPageView("PCI dropin");
|
|
24550
24636
|
userEvents.addEvent("Started PCI task", {
|
|
@@ -25098,7 +25184,7 @@ const serviceAgreementValidationRules = {
|
|
|
25098
25184
|
errorMessage: "fieldIsRequired"
|
|
25099
25185
|
}
|
|
25100
25186
|
};
|
|
25101
|
-
const logger$
|
|
25187
|
+
const logger$7 = createLogger("useServiceAgreement");
|
|
25102
25188
|
const FALLBACK_LANGUAGE_CODE = "en";
|
|
25103
25189
|
const useServiceAgreement = ({
|
|
25104
25190
|
handleGetServiceAgreement,
|
|
@@ -25127,7 +25213,7 @@ const useServiceAgreement = ({
|
|
|
25127
25213
|
language: agreementLanguage
|
|
25128
25214
|
});
|
|
25129
25215
|
if (!document2) {
|
|
25130
|
-
logger$
|
|
25216
|
+
logger$7.log('"document" field was missing in response');
|
|
25131
25217
|
return;
|
|
25132
25218
|
}
|
|
25133
25219
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
@@ -25145,7 +25231,7 @@ const useServiceAgreement = ({
|
|
|
25145
25231
|
throw err;
|
|
25146
25232
|
}
|
|
25147
25233
|
};
|
|
25148
|
-
requestServiceAgreement().catch(logger$
|
|
25234
|
+
requestServiceAgreement().catch(logger$7.error);
|
|
25149
25235
|
}, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
|
|
25150
25236
|
return {
|
|
25151
25237
|
loading: loading2,
|
|
@@ -26034,7 +26120,7 @@ const SolePropWithFormComposer = withFormComposer(SolePropComponent, {
|
|
|
26034
26120
|
matchingScenario,
|
|
26035
26121
|
country: country2
|
|
26036
26122
|
}) => parseSolePropScenarios([matchingScenario[LegalEntityType.TRUST]], country2),
|
|
26037
|
-
rules: rules$
|
|
26123
|
+
rules: rules$2,
|
|
26038
26124
|
labels,
|
|
26039
26125
|
defaultTaskName: "solePropDetails"
|
|
26040
26126
|
});
|
|
@@ -26266,6 +26352,23 @@ function SolePropDropinComponent({
|
|
|
26266
26352
|
})
|
|
26267
26353
|
});
|
|
26268
26354
|
}
|
|
26355
|
+
const COUNTRIES_THAT_USE_REGISTRATION_NUMBER = [CountryCodes.NewZealand];
|
|
26356
|
+
const rules = ({
|
|
26357
|
+
data,
|
|
26358
|
+
country: country2,
|
|
26359
|
+
taskType
|
|
26360
|
+
}) => ({
|
|
26361
|
+
countryUsesTaxId: () => {
|
|
26362
|
+
if (country2 !== CountryCodes.NewZealand && COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country2)) {
|
|
26363
|
+
return "REQUIRED";
|
|
26364
|
+
}
|
|
26365
|
+
},
|
|
26366
|
+
countryRequiresRegistrationNumberForTrust: () => {
|
|
26367
|
+
if (COUNTRIES_THAT_USE_REGISTRATION_NUMBER.includes(country2)) {
|
|
26368
|
+
return "REQUIRED";
|
|
26369
|
+
}
|
|
26370
|
+
}
|
|
26371
|
+
});
|
|
26269
26372
|
const TrustWithFormComposer = withFormComposer(TrustComponent, {
|
|
26270
26373
|
getComponentForms: () => trustForms,
|
|
26271
26374
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -26273,6 +26376,7 @@ const TrustWithFormComposer = withFormComposer(TrustComponent, {
|
|
|
26273
26376
|
matchingScenario,
|
|
26274
26377
|
country: country2
|
|
26275
26378
|
}) => parseTrustScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.TRUST], country2),
|
|
26379
|
+
rules,
|
|
26276
26380
|
defaultTaskName: "trustDetails"
|
|
26277
26381
|
});
|
|
26278
26382
|
function TrustDropinComponent(props) {
|
|
@@ -26457,7 +26561,7 @@ function TrustDropinComponent(props) {
|
|
|
26457
26561
|
}
|
|
26458
26562
|
const PAGES_WITH_STATUS = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
26459
26563
|
const POLLING_INTERVAL = 3e3;
|
|
26460
|
-
const logger$
|
|
26564
|
+
const logger$6 = createLogger("DropinComposerComponent");
|
|
26461
26565
|
function DropinComposerComponent({
|
|
26462
26566
|
capabilities,
|
|
26463
26567
|
legalEntityResponse,
|
|
@@ -26534,12 +26638,12 @@ function DropinComposerComponent({
|
|
|
26534
26638
|
setPciStatus(response);
|
|
26535
26639
|
return response;
|
|
26536
26640
|
} catch (e) {
|
|
26537
|
-
logger$
|
|
26641
|
+
logger$6.warn(i18n.get("failedToGetPciStatus"));
|
|
26538
26642
|
}
|
|
26539
26643
|
}
|
|
26540
26644
|
return void 0;
|
|
26541
26645
|
};
|
|
26542
|
-
const getPciTemplate = async () => {
|
|
26646
|
+
const getPciTemplate = useCallback(async () => {
|
|
26543
26647
|
const requestPciTemplate = async (language) => {
|
|
26544
26648
|
const response = await args.handleGetPciTemplate(legalEntity.id, {
|
|
26545
26649
|
language,
|
|
@@ -26559,14 +26663,19 @@ function DropinComposerComponent({
|
|
|
26559
26663
|
await requestPciTemplate(fallbackLanguageCode);
|
|
26560
26664
|
}
|
|
26561
26665
|
}
|
|
26562
|
-
};
|
|
26666
|
+
}, [additionalSalesChannels, i18n, legalEntity.id, args.handleGetPciTemplate]);
|
|
26667
|
+
useEffect(() => {
|
|
26668
|
+
if (!tasks.includes(TaskTypes.PCI_DSS))
|
|
26669
|
+
return;
|
|
26670
|
+
getPciTemplate().catch(logger$6.error);
|
|
26671
|
+
}, [getPciTemplate, tasks]);
|
|
26563
26672
|
const getServiceAgreementAcceptanceInfos = async () => {
|
|
26564
26673
|
if (legalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
|
|
26565
26674
|
try {
|
|
26566
26675
|
const response = await args.handleGetServiceAgreementAcceptanceInfos(legalEntity.id);
|
|
26567
26676
|
setServiceAgreementAcceptanceInfos(response.data);
|
|
26568
26677
|
} catch (e) {
|
|
26569
|
-
logger$
|
|
26678
|
+
logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
26570
26679
|
}
|
|
26571
26680
|
}
|
|
26572
26681
|
};
|
|
@@ -26576,7 +26685,7 @@ function DropinComposerComponent({
|
|
|
26576
26685
|
const response = await args.handleGetServiceAgreementStatus(legalEntity.id);
|
|
26577
26686
|
setServiceAgreementTypes(response.termsOfServiceTypes);
|
|
26578
26687
|
} catch (e) {
|
|
26579
|
-
logger$
|
|
26688
|
+
logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
26580
26689
|
}
|
|
26581
26690
|
}
|
|
26582
26691
|
};
|
|
@@ -26615,7 +26724,7 @@ function DropinComposerComponent({
|
|
|
26615
26724
|
setCapabilityProblems(getCapabilityProblems(response));
|
|
26616
26725
|
return response;
|
|
26617
26726
|
} catch (e) {
|
|
26618
|
-
logger$
|
|
26727
|
+
logger$6.warn(i18n.get("failedToFetchLegalEntityDetails"));
|
|
26619
26728
|
}
|
|
26620
26729
|
}
|
|
26621
26730
|
return void 0;
|
|
@@ -26627,7 +26736,7 @@ function DropinComposerComponent({
|
|
|
26627
26736
|
setTrust(response);
|
|
26628
26737
|
return response;
|
|
26629
26738
|
} catch (e) {
|
|
26630
|
-
logger$
|
|
26739
|
+
logger$6.warn(i18n.get("failedToFetchTrustDetails"));
|
|
26631
26740
|
}
|
|
26632
26741
|
}
|
|
26633
26742
|
return void 0;
|
|
@@ -26677,7 +26786,7 @@ function DropinComposerComponent({
|
|
|
26677
26786
|
label: i18n.get("successFullyRemovedTrustMember")
|
|
26678
26787
|
});
|
|
26679
26788
|
} catch (err) {
|
|
26680
|
-
logger$
|
|
26789
|
+
logger$6.error(`Failed to delete trust member`, err);
|
|
26681
26790
|
showToast({
|
|
26682
26791
|
type: ToastType.ERROR,
|
|
26683
26792
|
label: i18n.get("failedToRemoveTrustMember")
|
|
@@ -26729,7 +26838,7 @@ function DropinComposerComponent({
|
|
|
26729
26838
|
break;
|
|
26730
26839
|
case "rootTrustee":
|
|
26731
26840
|
default:
|
|
26732
|
-
logger$
|
|
26841
|
+
logger$6.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
|
|
26733
26842
|
}
|
|
26734
26843
|
showToast({
|
|
26735
26844
|
label: i18n.get("successfullyUpdatedDetails"),
|
|
@@ -26737,7 +26846,7 @@ function DropinComposerComponent({
|
|
|
26737
26846
|
});
|
|
26738
26847
|
await refreshTrustAndRunOnSubmit(trust, 1);
|
|
26739
26848
|
} catch (err) {
|
|
26740
|
-
logger$
|
|
26849
|
+
logger$6.error(err);
|
|
26741
26850
|
showToast({
|
|
26742
26851
|
label: i18n.get("failedToUpdateDetails"),
|
|
26743
26852
|
type: ToastType.ERROR
|
|
@@ -26960,16 +27069,25 @@ function DropinComposerComponent({
|
|
|
26960
27069
|
}
|
|
26961
27070
|
};
|
|
26962
27071
|
setIsLoadingConfiguration(true);
|
|
26963
|
-
fetchConfiguration().catch(logger$
|
|
27072
|
+
fetchConfiguration().catch(logger$6.error).finally(() => {
|
|
26964
27073
|
setIsLoadingConfiguration(false);
|
|
26965
27074
|
onLoad();
|
|
26966
27075
|
});
|
|
26967
27076
|
}, [legalEntity.type, contextCountry]);
|
|
27077
|
+
useEffect(() => {
|
|
27078
|
+
if (hasRejectedCapabilities(legalEntity)) {
|
|
27079
|
+
setTaskHistory([TaskTypes.CAPABILITY_REJECTED]);
|
|
27080
|
+
}
|
|
27081
|
+
}, [legalEntity]);
|
|
26968
27082
|
useEffect(() => {
|
|
26969
27083
|
if (PAGES_WITH_STATUS.includes(taskHistory[taskHistory.length - 1])) {
|
|
26970
27084
|
if (!pollingId) {
|
|
26971
27085
|
const pollingInterval = setInterval(async () => {
|
|
26972
|
-
if (
|
|
27086
|
+
if (hasRejectedCapabilities(legalEntity)) {
|
|
27087
|
+
setTaskHistory([TaskTypes.CAPABILITY_REJECTED]);
|
|
27088
|
+
clearInterval(pollingId);
|
|
27089
|
+
setPollingId(null);
|
|
27090
|
+
} else if (hasResolvedCapabilities(legalEntity)) {
|
|
26973
27091
|
clearInterval(pollingId);
|
|
26974
27092
|
setPollingId(null);
|
|
26975
27093
|
} else {
|
|
@@ -27000,6 +27118,8 @@ function DropinComposerComponent({
|
|
|
27000
27118
|
},
|
|
27001
27119
|
tasks
|
|
27002
27120
|
});
|
|
27121
|
+
case TaskTypes.CAPABILITY_REJECTED:
|
|
27122
|
+
return jsx(AccountSetupRejected, {});
|
|
27003
27123
|
case TaskTypes.TASKS_OVERVIEW:
|
|
27004
27124
|
return jsx(TaskListComponent, {
|
|
27005
27125
|
onNavigateToTask: navigateTo,
|
|
@@ -27245,7 +27365,6 @@ function DropinComposerComponent({
|
|
|
27245
27365
|
},
|
|
27246
27366
|
taskType: TaskTypes.PCI_DSS,
|
|
27247
27367
|
handleHomeClick: navigateBack,
|
|
27248
|
-
handleLanguageChange: getPciTemplate,
|
|
27249
27368
|
handleSign: async (...params) => {
|
|
27250
27369
|
await args.handleSignPci(...params);
|
|
27251
27370
|
await getPciStatus();
|
|
@@ -27337,23 +27456,6 @@ const createTransferInstrument = async (context, transferInstrument) => {
|
|
|
27337
27456
|
}
|
|
27338
27457
|
}, transferInstrument);
|
|
27339
27458
|
};
|
|
27340
|
-
const getBankVerificationProviders = async (context) => {
|
|
27341
|
-
const {
|
|
27342
|
-
loadingContext,
|
|
27343
|
-
sdkToken,
|
|
27344
|
-
legalEntityId
|
|
27345
|
-
} = context;
|
|
27346
|
-
return httpGet({
|
|
27347
|
-
loadingContext,
|
|
27348
|
-
errorLevel: "warn",
|
|
27349
|
-
errorMessage: `Bank Verification providers not available`,
|
|
27350
|
-
path: `${legalEntityId}/configurations/bankVerificationProviders`,
|
|
27351
|
-
sdkToken,
|
|
27352
|
-
headers: {
|
|
27353
|
-
"Content-Type": "application/json"
|
|
27354
|
-
}
|
|
27355
|
-
});
|
|
27356
|
-
};
|
|
27357
27459
|
const getBankVerificationVendor = async (context, country2) => {
|
|
27358
27460
|
const {
|
|
27359
27461
|
loadingContext,
|
|
@@ -27615,6 +27717,7 @@ class EventEmitter {
|
|
|
27615
27717
|
};
|
|
27616
27718
|
}
|
|
27617
27719
|
}
|
|
27720
|
+
const logger$5 = createLogger("PayoutEmbeddedDropin");
|
|
27618
27721
|
function PayoutEmbeddedDropin({
|
|
27619
27722
|
legalEntityId,
|
|
27620
27723
|
transferInstrumentId,
|
|
@@ -27648,8 +27751,8 @@ function PayoutEmbeddedDropin({
|
|
|
27648
27751
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
27649
27752
|
setTransferInstrument(ti);
|
|
27650
27753
|
}
|
|
27651
|
-
})();
|
|
27652
|
-
}, [
|
|
27754
|
+
})().catch(logger$5.error);
|
|
27755
|
+
}, [transferInstrumentId]);
|
|
27653
27756
|
return legalEntity ? jsx(PayoutDetailsDropinComponent, {
|
|
27654
27757
|
eventEmitter: eventEmitter ?? new EventEmitter(),
|
|
27655
27758
|
transferInstrument,
|
|
@@ -27661,6 +27764,7 @@ function PayoutEmbeddedDropin({
|
|
|
27661
27764
|
handleUpdateDocument: updateDocument2,
|
|
27662
27765
|
handleCreateTransferInstrument: createTransferInstrument2,
|
|
27663
27766
|
handleUpdateTransferInstrument: updateTransferInstrument2,
|
|
27767
|
+
hideNavigation: true,
|
|
27664
27768
|
refreshLegalEntity: fetchLegalEntity,
|
|
27665
27769
|
onChange,
|
|
27666
27770
|
onSubmit,
|
|
@@ -27783,6 +27887,23 @@ const getAccountFormatsForCountry = async (country2) => {
|
|
|
27783
27887
|
return (await importForCountry()).default;
|
|
27784
27888
|
};
|
|
27785
27889
|
const getPayoutAccountFormat = async (country2) => getAccountFormatsForCountry(country2);
|
|
27890
|
+
const getAllowedLocales$1 = async (context) => {
|
|
27891
|
+
const {
|
|
27892
|
+
loadingContext,
|
|
27893
|
+
sdkToken,
|
|
27894
|
+
legalEntityId
|
|
27895
|
+
} = context;
|
|
27896
|
+
return httpGet({
|
|
27897
|
+
loadingContext,
|
|
27898
|
+
errorLevel: "warn",
|
|
27899
|
+
errorMessage: `Supported locales not available`,
|
|
27900
|
+
path: `${legalEntityId}/configurations/supportedLocales`,
|
|
27901
|
+
sdkToken,
|
|
27902
|
+
headers: {
|
|
27903
|
+
"Content-Type": "application/json"
|
|
27904
|
+
}
|
|
27905
|
+
});
|
|
27906
|
+
};
|
|
27786
27907
|
const getEmbeddedApi = ({
|
|
27787
27908
|
base,
|
|
27788
27909
|
sdkToken,
|
|
@@ -27799,9 +27920,8 @@ const getEmbeddedApi = ({
|
|
|
27799
27920
|
getConfiguration: async ({
|
|
27800
27921
|
legalEntityType
|
|
27801
27922
|
}) => {
|
|
27802
|
-
const [
|
|
27923
|
+
const [scenarios, tasks] = await Promise.all([getScenarios(baseRequestContext), getTasks(baseRequestContext)]);
|
|
27803
27924
|
return {
|
|
27804
|
-
bankVerificationProviders,
|
|
27805
27925
|
matchingScenario: {
|
|
27806
27926
|
[legalEntityType]: scenarios
|
|
27807
27927
|
},
|
|
@@ -27819,9 +27939,7 @@ const getEmbeddedApi = ({
|
|
|
27819
27939
|
getAllowedCountries: () => {
|
|
27820
27940
|
throw new Error("getAllowedCountries: Not implemented in onboarding component api");
|
|
27821
27941
|
},
|
|
27822
|
-
getAllowedLocales: () =>
|
|
27823
|
-
throw new Error("getAllowedLocales: Not implemented in onboarding component api");
|
|
27824
|
-
},
|
|
27942
|
+
getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
|
|
27825
27943
|
validatePhoneNumber: () => {
|
|
27826
27944
|
throw new Error("validatePhoneNumber: Not implemented in onboarding component api");
|
|
27827
27945
|
},
|
|
@@ -28175,7 +28293,7 @@ const useAllowedLocales = () => {
|
|
|
28175
28293
|
const [allowedLocales, setAllowedLocales] = useState();
|
|
28176
28294
|
useEffect(() => {
|
|
28177
28295
|
getAllowedLocales2().then((response) => setAllowedLocales(response.locales)).catch(logger$1.error);
|
|
28178
|
-
}, [
|
|
28296
|
+
}, []);
|
|
28179
28297
|
return allowedLocales;
|
|
28180
28298
|
};
|
|
28181
28299
|
const logger = createLogger("useTranslations");
|
|
@@ -28235,8 +28353,9 @@ const I18nProvider = ({
|
|
|
28235
28353
|
const i18n = useMemo(() => new Language({
|
|
28236
28354
|
locale: loadedLocale,
|
|
28237
28355
|
translations,
|
|
28238
|
-
customTranslations
|
|
28239
|
-
|
|
28356
|
+
customTranslations,
|
|
28357
|
+
allowedLocales
|
|
28358
|
+
}), [loadedLocale, translations, customTranslations, allowedLocales]);
|
|
28240
28359
|
const contextValue = useMemo(() => ({
|
|
28241
28360
|
i18n,
|
|
28242
28361
|
setLocale
|
|
@@ -28872,10 +28991,6 @@ const pciDropinSchema = {
|
|
|
28872
28991
|
type: "object",
|
|
28873
28992
|
required: true
|
|
28874
28993
|
},
|
|
28875
|
-
handleLanguageChange: {
|
|
28876
|
-
type: "function",
|
|
28877
|
-
required: true
|
|
28878
|
-
},
|
|
28879
28994
|
handleHomeClick: {
|
|
28880
28995
|
type: "function",
|
|
28881
28996
|
required: true
|