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.

105 lines (104 loc) 6.38 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] = "d5df2513-4197-440c-924d-790712725984", e._sentryDebugIdIdentifier = "sentry-dbid-d5df2513-4197-440c-924d-790712725984"); } 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 LegalEntityTypes } from "./legal-entity-type-0MfCGzUf.js"; import { t as getLegalEntityCountry } from "./getLegalEntityCountry-BHh7Ux8v.js"; import { a as noop } from "./AnalyticsContext-BFrJmsp0.js"; import { C as EntityTypes, c as individualBaseMapping } from "./processCapabilities-fPuXc9gL.js"; import { t as TaskTypes } from "./taskTypes-NawDTp5n.js"; import { n as isBafinSignatoryFlow, r as removeIdVerificationProblemsForBafinSignatory } from "./bafinUtils-BKq-s1Ka.js"; import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-D6XC4DZ2.js"; import { n as getTrustedFields, r as getTrustedFieldsProvider } from "./getTrustedFields-BJ88GlM-.js"; import { t as useScenarios } from "./useScenarios-DciPyzQ-.js"; import { t as IndividualDropin } from "./IndividualDropin-DHrcFHNx.js"; import { t as getTrustedDecisionMakers } from "./getTrustedDecisionMakers-DUpv5ug2.js"; import { jsx } from "preact/jsx-runtime"; import { skipToken } from "@tanstack/preact-query"; import { useParams } from "wouter-preact"; //#region src/components/Individual/pages/DecisionMakerDetailsPage.tsx function DecisionMakerDetailsPage({ decisionMakerId: decisionMakerIdProp, parentCompanyId: parentCompanyIdProp, taskType = TaskTypes.DECISION_MAKER, asModal, hideSidebar, isTargetLegalEntityType, onSubmit, handleBackClick, handleCloseClick, handleHomeClick = noop }) { const routeParams = useParams(); const parentCompanyId = parentCompanyIdProp ?? routeParams.parentId; const decisionMakerId = decisionMakerIdProp ?? routeParams.decisionMakerId; const { data: decisionMakerLe } = useLegalEntity(decisionMakerId ?? skipToken); const { data: parentCompanyLe } = useLegalEntity(parentCompanyId ?? skipToken); const capabilityProblems = useCapabilityProblems(); const { data: scenarios } = useScenarios((parentCompanyLe && getLegalEntityCountry(parentCompanyLe)) ?? skipToken, LegalEntityTypes.INDIVIDUAL); const { i18n } = useTranslation(); addResourceBundles(i18n, [{ ns: "individual", importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-VIyyeYUh.js"), "../language/cs-CZ.json": () => import("./cs-CZ-D8nnXFEh.js"), "../language/da-DK.json": () => import("./da-DK-Cq-1LB6T.js"), "../language/de-DE.json": () => import("./de-DE-Bc55gBv4.js"), "../language/el-GR.json": () => import("./el-GR-Cr-3NgPk.js"), "../language/en-US.instructions.json": () => import("./en-US.instructions-DfgivDPI.js"), "../language/en-US.json": () => import("./en-US-C1J9jcVI.js"), "../language/es-ES.json": () => import("./es-ES-uVSZu-EQ.js"), "../language/es-LA.json": () => import("./es-LA-BU5Op1kh.js"), "../language/et-EE.json": () => import("./et-EE-BFb0MPqf.js"), "../language/fi-FI.json": () => import("./fi-FI-BI9sCCEP.js"), "../language/fr-FR.json": () => import("./fr-FR-_TkFnevF.js"), "../language/hr-HR.json": () => import("./hr-HR-DubR_a2h.js"), "../language/hu-HU.json": () => import("./hu-HU-CK6lbZ-D.js"), "../language/it-IT.json": () => import("./it-IT-CVVOlFfY.js"), "../language/ja-JP.json": () => import("./ja-JP-B8sNFjt_.js"), "../language/lt-LT.json": () => import("./lt-LT-C9lXLzZA.js"), "../language/lv-LV.json": () => import("./lv-LV-2Q8G1u4p.js"), "../language/nl-NL.json": () => import("./nl-NL-DMdoFepr.js"), "../language/no-NO.json": () => import("./no-NO-CwgewQst.js"), "../language/pl-PL.json": () => import("./pl-PL-D-TVYshE.js"), "../language/pt-BR.json": () => import("./pt-BR-DwHag_mp.js"), "../language/pt-PT.json": () => import("./pt-PT-BVcFY8gr.js"), "../language/ro-RO.json": () => import("./ro-RO-D3Yk1KoW.js"), "../language/sk-SK.json": () => import("./sk-SK-D3UYKttr.js"), "../language/sl-SI.json": () => import("./sl-SI-BkcElOhl.js"), "../language/sv-SE.json": () => import("./sv-SE-DkZ2LyW5.js") }), `../language/${lang}.json`, 3) }]); if (!parentCompanyLe || decisionMakerId && !decisionMakerLe) return /* @__PURE__ */ jsx(Loader, {}); const country = getLegalEntityCountry(decisionMakerLe ?? parentCompanyLe); let problems = capabilityProblems && decisionMakerId ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, decisionMakerId) : void 0; if (problems && parentCompanyLe && decisionMakerLe && scenarios) { if ((parentCompanyLe.entityAssociations?.filter((association) => association.legalEntityId === decisionMakerLe.id))?.some((association) => isBafinSignatoryFlow({ taskType, data: association, scenarios }))) problems = removeIdVerificationProblemsForBafinSignatory(problems, decisionMakerLe); } const trustedFieldsProvider = getTrustedFieldsProvider(parentCompanyLe); const trustedFields = decisionMakerLe ? getTrustedFields(decisionMakerLe, individualBaseMapping) : {}; const trustedRoles = getTrustedDecisionMakers(parentCompanyLe).find((ea) => ea.reference === decisionMakerId)?.types ?? []; return /* @__PURE__ */ jsx(IndividualDropin, { taskType, taskName: TASK_NAMES[taskType], legalEntityResponse: decisionMakerLe, parentLegalEntity: parentCompanyLe, problems, country, asModal, hideSidebar, isTargetLegalEntityType, onSubmit, trustedFieldsProvider, trustedRoles, handleBackClick, handleCloseClick, handleHomeClick, asModal: true, trustedFields }); } var TASK_NAMES = { [TaskTypes.DECISION_MAKER]: "decisionMakerDetails", [TaskTypes.TRUST_MEMBER_COMPANY_OWNER]: "companyOwnerDetails", [TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER]: "companyOwnerDetails" }; //#endregion export { DecisionMakerDetailsPage };