UNPKG

@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.

70 lines (69 loc) 4.19 kB
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] = "8b0f2bab-39f2-40ac-be9a-8e868651f231", e._sentryDebugIdIdentifier = "sentry-dbid-8b0f2bab-39f2-40ac-be9a-8e868651f231"); } catch (e) {} import { n as addResourceBundles, r as useTranslation } from "./translation-BFxyJ1c5.js"; import { r as Loader } from "./Button-oj6H8OrC.js"; import { t as getLegalEntityCountry } from "./getLegalEntityCountry-C6bSV6sB.js"; import { t as useToggleContext } from "./useToggleContext-DaQUBF8O.js"; import { t as _rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper-rq_tsyLP.js"; import { C as EntityTypes } from "./processCapabilities-DlZY9-Jc.js"; import { p as TaskTypes } from "./entityAssociationUtil-BEzUdPbm.js"; import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-BLcIg3x_.js"; import { t as filterProblemsByTaskForms } from "./filterProblemsByTaskForms-DwS9T-_E.js"; import { n as BusinessDetailsDropin, r as getForms, t as useBusinessDetailsData } from "./useBusinessDetailsData-DGPg34HR.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 { isFeatureEnabled } = useToggleContext(); 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-CodTfJR6.js"), "../language/cs-CZ.json": () => import("./cs-CZ-BLE9aLKg.js"), "../language/da-DK.json": () => import("./da-DK-DtAW2xZE.js"), "../language/de-DE.json": () => import("./de-DE-DXNTaizu.js"), "../language/el-GR.json": () => import("./el-GR-qH2iIn7-.js"), "../language/en-US.json": () => import("./en-US-DBiYkRmE.js"), "../language/es-ES.json": () => import("./es-ES-yxJhxnWV.js"), "../language/et-EE.json": () => import("./et-EE-C3h50xW-.js"), "../language/fi-FI.json": () => import("./fi-FI-wGXRm-tZ.js"), "../language/fr-FR.json": () => import("./fr-FR-mFwC-nNY.js"), "../language/hr-HR.json": () => import("./hr-HR-BAeB6ZDz.js"), "../language/hu-HU.json": () => import("./hu-HU-Bb1gk4Jr.js"), "../language/it-IT.json": () => import("./it-IT-CmoZrxWa.js"), "../language/ja-JP.json": () => import("./ja-JP-CyP1sKap.js"), "../language/lt-LT.json": () => import("./lt-LT-D0_qhzNo.js"), "../language/lv-LV.json": () => import("./lv-LV-Bfkan_1O.js"), "../language/nl-NL.json": () => import("./nl-NL-DXnNGqSV.js"), "../language/no-NO.json": () => import("./no-NO-B1v42GMO2.js"), "../language/pl-PL.json": () => import("./pl-PL-C5u2-nG22.js"), "../language/pt-BR.json": () => import("./pt-BR-9jLurhS32.js"), "../language/pt-PT.json": () => import("./pt-PT-B6DsKlac2.js"), "../language/ro-RO.json": () => import("./ro-RO-9TjoIVJf2.js"), "../language/sk-SK.json": () => import("./sk-SK-D5_Q4Djr2.js"), "../language/sl-SI.json": () => import("./sl-SI-CuNIMCGx2.js"), "../language/sv-SE.json": () => import("./sv-SE-C11kwGTV2.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, taskType, isFeatureEnabled))), country, onSubmit, handleHomeClick }); }; //#endregion export { RootBusinessDetailsPage };