@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
110 lines (109 loc) • 7.12 kB
JavaScript
try {
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "1794fdb5-9363-4648-b136-56c5a47fd0e9", e._sentryDebugIdIdentifier = "sentry-dbid-1794fdb5-9363-4648-b136-56c5a47fd0e9");
} catch (e) {}
import { n as addResourceBundles, r as useTranslation } from "./translation-BYvhW5zA.js";
import { A as _rolldown_dynamic_import_helper_default } from "./resolveEnvironment-DNmu53Rr.js";
import { r as Loader } from "./Button-i8I2dHP8.js";
import { r as useLegalEntity } from "./useLegalEntity-CtlUQv_J.js";
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-BHh7Ux8v.js";
import { C as EntityTypes } from "./processCapabilities-fPuXc9gL.js";
import { t as TaskTypes } from "./taskTypes-NawDTp5n.js";
import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-D6XC4DZ2.js";
import { t as useTrustMembers } from "./useTrustMembers-BIdqkIX1.js";
import { r as BusinessDetailsDropin, t as useBusinessDetailsData } from "./useBusinessDetailsData-DJTYbNJ4.js";
import { jsx } from "preact/jsx-runtime";
import { skipToken } from "@tanstack/preact-query";
import { useParams } from "wouter-preact";
//#region src/components/Trust/pages/TrustMemberCompanyPage.tsx
function TrustMemberCompanyPage({ trustId, trustMemberCompanyId: trustMemberCompanyIdProp, newMember, onSubmit, handleHomeClick }) {
const routeParams = useParams();
const trustMemberCompanyId = trustMemberCompanyIdProp ?? routeParams.memberId;
const { i18n } = useTranslation();
const { data: trustLe } = useLegalEntity(trustId ?? skipToken);
const { data: trustMemberCompanyLe } = useLegalEntity(trustMemberCompanyId ?? skipToken);
const trustMembers = useTrustMembers();
const capabilityProblems = useCapabilityProblems();
const { data, isLoading } = useBusinessDetailsData(TaskTypes.TRUST_MEMBER_COMPANY, trustLe, trustMemberCompanyLe);
addResourceBundles(i18n, [{
ns: "business",
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
"../../Business/language/bg-BG.json": () => import("./bg-BG-L5wKtmmz.js"),
"../../Business/language/cs-CZ.json": () => import("./cs-CZ-D4Pt8Gsx.js"),
"../../Business/language/da-DK.json": () => import("./da-DK-C4wRpqMC.js"),
"../../Business/language/de-DE.json": () => import("./de-DE-BOH-YgTt.js"),
"../../Business/language/el-GR.json": () => import("./el-GR-C5NDkWDr.js"),
"../../Business/language/en-US.json": () => import("./en-US-DXMKV9NN.js"),
"../../Business/language/es-ES.json": () => import("./es-ES-CDFWEg9c.js"),
"../../Business/language/es-LA.json": () => import("./es-LA-C7IleXTc.js"),
"../../Business/language/et-EE.json": () => import("./et-EE-P4s_U3BI.js"),
"../../Business/language/fi-FI.json": () => import("./fi-FI-Bed2SzCG.js"),
"../../Business/language/fr-FR.json": () => import("./fr-FR-D_qhjXEC.js"),
"../../Business/language/hr-HR.json": () => import("./hr-HR-DlPm5gxr.js"),
"../../Business/language/hu-HU.json": () => import("./hu-HU-NJaOrfnP.js"),
"../../Business/language/it-IT.json": () => import("./it-IT-BwxzsAX1.js"),
"../../Business/language/ja-JP.json": () => import("./ja-JP-CNCeHdxj.js"),
"../../Business/language/lt-LT.json": () => import("./lt-LT-VP6qtMAw.js"),
"../../Business/language/lv-LV.json": () => import("./lv-LV-CQI0LxVf.js"),
"../../Business/language/nl-NL.json": () => import("./nl-NL-BN5WtqQB.js"),
"../../Business/language/no-NO.json": () => import("./no-NO-Cor-jWuN.js"),
"../../Business/language/pl-PL.json": () => import("./pl-PL-BzOubawD.js"),
"../../Business/language/pt-BR.json": () => import("./pt-BR-n0GcsM-Q.js"),
"../../Business/language/pt-PT.json": () => import("./pt-PT-C-mvV1ZJ.js"),
"../../Business/language/ro-RO.json": () => import("./ro-RO-CuooCG3m.js"),
"../../Business/language/sk-SK.json": () => import("./sk-SK-DSaBObVa.js"),
"../../Business/language/sl-SI.json": () => import("./sl-SI-KEJYXISh.js"),
"../../Business/language/sv-SE.json": () => import("./sv-SE-Bhvd0GDr.js")
}), `../../Business/language/${lang}.json`, 5)
}, {
ns: "trust",
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
"../language/bg-BG.json": () => import("./bg-BG-qQc6pN4K.js"),
"../language/cs-CZ.json": () => import("./cs-CZ-Jsmhr_B3.js"),
"../language/da-DK.json": () => import("./da-DK-CXZXQspY.js"),
"../language/de-DE.json": () => import("./de-DE-BRJ0jBty.js"),
"../language/el-GR.json": () => import("./el-GR-BMGYrO4V.js"),
"../language/en-US.json": () => import("./en-US-CWDI7JKT.js"),
"../language/es-ES.json": () => import("./es-ES-pt4yy_U2.js"),
"../language/es-LA.json": () => import("./es-LA-DU9jNyAv.js"),
"../language/et-EE.json": () => import("./et-EE-dDMeDiTJ.js"),
"../language/fi-FI.json": () => import("./fi-FI-iRb7nS7X.js"),
"../language/fr-FR.json": () => import("./fr-FR-DUrcyeOg.js"),
"../language/hr-HR.json": () => import("./hr-HR-LnDb18bf.js"),
"../language/hu-HU.json": () => import("./hu-HU-Cc7wqn6A.js"),
"../language/it-IT.json": () => import("./it-IT-BPA_Upt_.js"),
"../language/ja-JP.json": () => import("./ja-JP-CYb1SAoz.js"),
"../language/lt-LT.json": () => import("./lt-LT-B9Nm7OZQ.js"),
"../language/lv-LV.json": () => import("./lv-LV-DkjsE74u.js"),
"../language/nl-NL.json": () => import("./nl-NL-BtdPxlFm.js"),
"../language/no-NO.json": () => import("./no-NO-BIhMgC99.js"),
"../language/pl-PL.json": () => import("./pl-PL-BT6NmGgO.js"),
"../language/pt-BR.json": () => import("./pt-BR-B0SUw4uu.js"),
"../language/pt-PT.json": () => import("./pt-PT-KikTTc5A.js"),
"../language/ro-RO.json": () => import("./ro-RO-DajmyI4j.js"),
"../language/sk-SK.json": () => import("./sk-SK-DJWcs0qJ.js"),
"../language/sl-SI.json": () => import("./sl-SI-C_QeUL6t.js"),
"../language/sv-SE.json": () => import("./sv-SE-D3MOTV-T.js")
}), `../language/${lang}.json`, 3)
}]);
if (isLoading || !trustLe || trustMemberCompanyId && !trustMemberCompanyLe) return /* @__PURE__ */ jsx(Loader, {});
const { rootLe, efpBusinessLines, documents } = data;
const problems = capabilityProblems && trustMemberCompanyId ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, trustMemberCompanyId) : void 0;
const country = getLegalEntityCountry(trustMemberCompanyLe ?? trustLe);
const trustMember = newMember ?? trustMembers.find((tm) => tm.trustMemberType !== "undefinedBeneficiary" && tm.legalEntityId === trustMemberCompanyId);
return /* @__PURE__ */ jsx(BusinessDetailsDropin, {
taskType: TaskTypes.TRUST_MEMBER_COMPANY,
legalEntityResponse: rootLe,
efpBusinessLines,
documents,
associatedLegalArrangement: trustLe,
nestedLegalEntity: trustMemberCompanyLe,
nestedLegalEntityDetails: trustMember,
problems,
country,
onSubmit,
handleHomeClick
});
}
//#endregion
export { TrustMemberCompanyPage };