@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.
69 lines (68 loc) • 4.07 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] = "2def066c-2628-4c33-a8f7-6c44a741bbab", e._sentryDebugIdIdentifier = "sentry-dbid-2def066c-2628-4c33-a8f7-6c44a741bbab");
} 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 { 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 filterProblemsByTaskForms } from "./filterProblemsByTaskForms-CQby20PN.js";
import { n as getForms, r as BusinessDetailsDropin, t as useBusinessDetailsData } from "./useBusinessDetailsData-DJTYbNJ4.js";
import { jsx } from "preact/jsx-runtime";
//#region src/components/Business/pages/RootBusinessDetailsPage.tsx
var RootBusinessDetailsPage = ({ onSubmit, handleHomeClick }) => {
const { i18n } = useTranslation();
const capabilityProblems = useCapabilityProblems();
const taskType = TaskTypes.BUSINESS_DETAILS;
const { data, isLoading } = useBusinessDetailsData(taskType);
addResourceBundles(i18n, [{
ns: "business",
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
"../language/bg-BG.json": () => import("./bg-BG-L5wKtmmz.js"),
"../language/cs-CZ.json": () => import("./cs-CZ-D4Pt8Gsx.js"),
"../language/da-DK.json": () => import("./da-DK-C4wRpqMC.js"),
"../language/de-DE.json": () => import("./de-DE-BOH-YgTt.js"),
"../language/el-GR.json": () => import("./el-GR-C5NDkWDr.js"),
"../language/en-US.json": () => import("./en-US-DXMKV9NN.js"),
"../language/es-ES.json": () => import("./es-ES-CDFWEg9c.js"),
"../language/es-LA.json": () => import("./es-LA-C7IleXTc.js"),
"../language/et-EE.json": () => import("./et-EE-P4s_U3BI.js"),
"../language/fi-FI.json": () => import("./fi-FI-Bed2SzCG.js"),
"../language/fr-FR.json": () => import("./fr-FR-D_qhjXEC.js"),
"../language/hr-HR.json": () => import("./hr-HR-DlPm5gxr.js"),
"../language/hu-HU.json": () => import("./hu-HU-NJaOrfnP.js"),
"../language/it-IT.json": () => import("./it-IT-BwxzsAX1.js"),
"../language/ja-JP.json": () => import("./ja-JP-CNCeHdxj.js"),
"../language/lt-LT.json": () => import("./lt-LT-VP6qtMAw.js"),
"../language/lv-LV.json": () => import("./lv-LV-CQI0LxVf.js"),
"../language/nl-NL.json": () => import("./nl-NL-BN5WtqQB.js"),
"../language/no-NO.json": () => import("./no-NO-Cor-jWuN.js"),
"../language/pl-PL.json": () => import("./pl-PL-BzOubawD.js"),
"../language/pt-BR.json": () => import("./pt-BR-n0GcsM-Q.js"),
"../language/pt-PT.json": () => import("./pt-PT-C-mvV1ZJ.js"),
"../language/ro-RO.json": () => import("./ro-RO-CuooCG3m.js"),
"../language/sk-SK.json": () => import("./sk-SK-DSaBObVa.js"),
"../language/sl-SI.json": () => import("./sl-SI-KEJYXISh.js"),
"../language/sv-SE.json": () => import("./sv-SE-Bhvd0GDr.js")
}), `../language/${lang}.json`, 3)
}]);
if (isLoading) return /* @__PURE__ */ jsx(Loader, {});
const { rootLe, efpBusinessLines, documents } = data;
const entityProblems = capabilityProblems ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, rootLe.id) : void 0;
const country = getLegalEntityCountry(rootLe);
return /* @__PURE__ */ jsx(BusinessDetailsDropin, {
taskType,
legalEntityResponse: rootLe,
efpBusinessLines,
documents,
problems: filterProblemsByTaskForms(entityProblems, Object.keys(getForms(country))),
country,
onSubmit,
handleHomeClick
});
};
//#endregion
export { RootBusinessDetailsPage };