@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.
588 lines (587 loc) • 24.9 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] = "3b4dd44a-62f4-4ac4-95a0-23367cea2c9b", e._sentryDebugIdIdentifier = "sentry-dbid-3b4dd44a-62f4-4ac4-95a0-23367cea2c9b");
} catch (e) {}
import { i as Typography, n as addResourceBundles, r as useTranslation } from "./translation-BYvhW5zA.js";
import { A as _rolldown_dynamic_import_helper_default, j as useToggleContext, k as Header, r as useGetTaskStatus, x as Alert } from "./resolveEnvironment-DNmu53Rr.js";
import { r as Loader, t as Button } from "./Button-i8I2dHP8.js";
import { r as useLegalEntity, t as ROOT_LE } from "./useLegalEntity-CtlUQv_J.js";
import { t as StackLayout } from "./StackLayout-IUdNMDgW.js";
import { t as TaskVerificationStatus } from "./TaskVerificationStatus-CKHPTEpH.js";
import { i as TaskStatuses } from "./taskStatus-BtekPA8E.js";
import { C as EntityTypes, T as DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING } from "./processCapabilities-fPuXc9gL.js";
import { t as TaskTypes } from "./taskTypes-NawDTp5n.js";
import { t as DecisionMakerTypes } from "./decision-maker-type-NR4GFAeT.js";
import { r as getOwnDecisionMakers } from "./decisionMakerRoles-DIG8zo1C.js";
import { i as useAnalyticsContext, t as Modal } from "./Modal-BLP2aF-u.js";
import { n as useToastContext } from "./invalidateRootLegalEntity-DLpPeD5p.js";
import { t as useDataMissingRemediations } from "./useDataMissingRemediations-QYShC4SG.js";
import { n as useCapabilityProblems } from "./getProblemsForEntity-D6XC4DZ2.js";
import { n as Image } from "./unincorporated-partnership-nnTW3FnG.js";
import { a as individualFormDefaultData, i as GuidanceQuestionValues } from "./mapLegalEntityToIndividualSchema-7sVfeCn9.js";
import { t as useUpdateLegalEntity } from "./useUpdateLegalEntity-B0XYfxbB.js";
import { t as List } from "./List-ywoRPg-q.js";
import { t as useTaskLandedEvent } from "./useTaskLandedEvent-BXtOctC4.js";
import { t as LandingLayout } from "./LandingLayout-CUAkXrpL.js";
import { t as ListItem } from "./ListItem-V4x0raZw.js";
import { i as useInvitationStatuses, n as getDecisionMakerDescription, t as DecisionMakerDetails } from "./DecisionMakerDetails-BQAz3fM_.js";
import { lazy } from "preact/compat";
import { useEffect as useEffect$1, useMemo as useMemo$1, useState as useState$1 } from "preact/hooks";
import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime";
//#region src/utils/not.ts
/**
* Inverts a boolean function. Very useful to use with {@link Array.filter}.
*
* E.g.
* ```typescript
* // this:
* const nonHumans = animals.filter(a => !isHuman(a));
* // becomes:
* const nonHumans = animals.filter(not(isHuman));
* ```
*/
var not = (fn) => (...args) => !fn(...args);
//#endregion
//#region src/components/Individual/tasks/DecisionMakers/DecisionMakerListItem/DecisionMakerListItem.tsx
function DecisionMakerListItem({ decisionMaker, openDecisionMakerModal, invitationStatus }) {
const { t: individualT } = useTranslation("individual");
const description = getDecisionMakerDescription(decisionMaker.types, individualT);
return /* @__PURE__ */ jsx(ListItem, {
accessory: /* @__PURE__ */ jsx(TaskVerificationStatus, { status: invitationBasedStatus(decisionMaker.status, invitationStatus) ?? decisionMaker.status }),
avatar: {
iconName: invitationStatus?.active ? "payByLinkPlane" : "user",
circle: true
},
title: decisionMaker.name,
action: {
onClick: () => openDecisionMakerModal(decisionMaker),
disclosure: true
},
description
});
}
/**
* Use a modified version of the "details required" status when an invitation is active / expired
*/
function invitationBasedStatus(regularStatus, invitationStatus) {
if (regularStatus !== "DETAILS_REQUIRED" || !invitationStatus) return void 0;
const { active, expired } = invitationStatus;
if (expired) return "inviteExpired";
if (active) return "inviteSent";
}
var DecisionMakersGettingStarted_module_default = {
"decision-makers-getting-started": "_decision-makers-getting-started_ojjog_1",
decisionMakersGettingStarted: "_decision-makers-getting-started_ojjog_1"
};
//#endregion
//#region src/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersModalContent.tsx
var DecisionMakersModalContent = () => {
const { t } = useTranslation("individual");
return /* @__PURE__ */ jsxs("div", {
className: DecisionMakersGettingStarted_module_default.decisionMakersGettingStartedModal,
children: [
/* @__PURE__ */ jsx(Typography, {
variant: "title-l",
el: "h3",
className: "u-margin-bottom-40",
children: t(($) => $["moreAboutOwnersAndDecisionMakers"])
}),
/* @__PURE__ */ jsx(Typography, {
variant: "body-strongest",
el: "h4",
className: "u-margin-bottom-12",
children: t(($) => $["ownersAndDecisionMakersDescriptionQ1"])
}),
/* @__PURE__ */ jsx(Typography, {
el: "p",
className: "u-margin-bottom-32",
children: t(($) => $["ownersAndDecisionMakersDescriptionA1"])
}),
/* @__PURE__ */ jsx(Alert, {
title: t(($) => $["ownersDescriptionAlertTitle"]),
icon: false,
className: "u-margin-bottom-32",
children: t(($) => $["ownersAndDecisionMakersDescriptionAlertContent"])
}),
/* @__PURE__ */ jsx(Typography, {
variant: "body-strongest",
el: "h4",
className: "u-margin-bottom-12",
children: t(($) => $["ownersAndDecisionMakersDescriptionQ2"])
}),
/* @__PURE__ */ jsx(Typography, {
el: "p",
children: t(($) => $["ownersAndDecisionMakersDescriptionA2P1"])
}),
/* @__PURE__ */ jsx(Typography, {
el: "p",
className: "u-margin-bottom-32",
children: t(($) => $["ownersAndDecisionMakersDescriptionA2P2"])
}),
/* @__PURE__ */ jsx(Alert, {
title: t(($) => $["ownersDescriptionAlertTitle"]),
icon: false,
className: "u-margin-bottom-32",
children: t(($) => $["ownersDescriptionAlertContent"])
}),
/* @__PURE__ */ jsx(Typography, {
variant: "body-strongest",
el: "h4",
className: "u-margin-bottom-12",
children: t(($) => $["ownersAndDecisionMakersDescriptionQ3"])
}),
/* @__PURE__ */ jsx(Typography, {
el: "p",
className: "u-margin-bottom-32",
children: t(($) => $["ownersAndDecisionMakersDescriptionA3"])
}),
/* @__PURE__ */ jsx(Typography, {
variant: "body-strongest",
el: "h4",
className: "u-margin-bottom-12",
children: t(($) => $["ownersAndDecisionMakersDescriptionQ4"])
}),
/* @__PURE__ */ jsx(Typography, {
el: "p",
className: "u-margin-bottom-32",
children: t(($) => $["ownersAndDecisionMakersDescriptionA4"])
})
]
});
};
//#endregion
//#region src/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersGettingStarted.tsx
var decisionMakerGroup = lazy(() => import("./decision-makers-group-DAoxQRJ3.js"));
var DecisionMakersGettingStarted = ({ addDecisionMakerOnClick, handleCancelClick }) => {
const { t: commonT } = useTranslation("common");
const { t: individualT } = useTranslation("individual");
const userEvents = useAnalyticsContext();
const [isModalOpen, setIsModalOpen] = useState$1(false);
const openModal = () => {
userEvents.addPageEvent("Opened modal", {
actionType: "open",
label: "decisionMakersGettingStartedModal"
});
setIsModalOpen(true);
};
const closeModal = () => {
userEvents.addPageEvent("Closed modal", {
actionType: "close",
label: "decisionMakersGettingStartedModal"
});
setIsModalOpen(false);
};
return /* @__PURE__ */ jsxs("div", {
className: DecisionMakersGettingStarted_module_default.decisionMakersGettingStarted,
children: [/* @__PURE__ */ jsx(LandingLayout, {
media: /* @__PURE__ */ jsx(Image, { lazyLoadedImage: decisionMakerGroup }),
title: individualT(($) => $["ownersAndDecisionMakers"]),
description: individualT(($) => $["ownersAndDecisionMakersDescription"]),
helpAction: /* @__PURE__ */ jsx(Button, {
variant: "link",
onClick: openModal,
fullWidth: true,
children: commonT(($) => $["learnMore"])
}),
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
fullWidth: true,
testId: "decision-makers-getting-started-primary-button",
onClick: addDecisionMakerOnClick,
children: commonT(($) => $["getStarted"])
}), handleCancelClick && /* @__PURE__ */ jsx(Button, {
variant: "tertiary",
fullWidth: true,
testId: "decision-makers-getting-started-cancel-button",
onClick: handleCancelClick,
children: commonT(($) => $["finishLater"])
})] })
}), isModalOpen && /* @__PURE__ */ jsx(Modal, {
onClose: closeModal,
ariaLabel: individualT(($) => $["moreAboutOwnersAndDecisionMakers"]),
inset: true,
children: /* @__PURE__ */ jsx(DecisionMakersModalContent, {})
})]
});
};
var decisionMakerRemediationAlerts = [{
type: "single",
code: "2_124",
titleKey: "authorizedSignatoryMissing",
descriptionKey: "addAtLeastOneAuthorizedSignatory",
actionKey: "addAuthorizedSignatory"
}, {
type: "grouped",
codes: [
"2_123",
"2_151",
"2_185"
],
titleKey: "beneficialOwnersMissing",
actionKey: "addBeneficialOwner",
detailKeys: {
"2_123": "addAllBeneficialOwners",
"2_151": "addAtLeastOneBeneficialOwnerControllingPerson",
"2_185": "addAtLeastOneDirector"
}
}];
//#endregion
//#region src/components/Individual/tasks/DecisionMakers/RemediationAlerts/RemediationAlerts.tsx
var RemediationAlertItem = ({ config, activeCodes, onAction }) => {
const { t } = useTranslation("individual");
const isVisible = useMemo$1(() => {
if (config.type === "single") return activeCodes.includes(config.code);
return config.codes.some((code) => activeCodes.includes(code));
}, [activeCodes, config]);
const activeGroupedDetails = useMemo$1(() => {
if (config.type !== "grouped") return [];
return config.codes.filter((code) => activeCodes.includes(code)).map((code) => config.detailKeys[code]);
}, [activeCodes, config]);
if (!isVisible) return null;
return /* @__PURE__ */ jsxs(Alert, {
className: "adyen-kyc-decision-makers__warning",
title: t(($) => $[config.titleKey]),
variant: "warning",
children: [
config.type === "single" && /* @__PURE__ */ jsx("p", { children: t(($) => $[config.descriptionKey]) }),
config.type === "grouped" && (activeGroupedDetails.length > 1 ? /* @__PURE__ */ jsx("ul", { children: activeGroupedDetails.map((key) => /* @__PURE__ */ jsx("li", { children: t(($) => $[key]) }, key)) }) : /* @__PURE__ */ jsx("p", { children: t(($) => $[activeGroupedDetails[0]]) })),
/* @__PURE__ */ jsx(Button, {
variant: "link",
onClick: onAction,
children: t(($) => $[config.actionKey])
})
]
});
};
var RemediationAlerts = ({ activeCodes, onAction }) => /* @__PURE__ */ jsx(Fragment$1, { children: decisionMakerRemediationAlerts.map((config) => /* @__PURE__ */ jsx(RemediationAlertItem, {
config,
activeCodes,
onAction
}, config.type === "single" ? config.code : config.titleKey)) });
//#endregion
//#region src/components/Individual/tasks/DecisionMakers/DecisionMakers.tsx
/**
* Decision makers are part of the Organization flow, that allow the creation
* of a type of Individual, the decision maker, so a variation of the individual flow
* is used to create a decision maker via this component.
*/
var DecisionMakers = (props) => {
const { data, isLoading } = useLegalEntity(ROOT_LE);
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`, 4)
}]);
if (isLoading || !data) return /* @__PURE__ */ jsx(Loader, {});
return /* @__PURE__ */ jsx(DecisionMakersInner, {
...props,
legalEntity: data
});
};
/** Inner component that has all the data loaded/non-undefined */
var DecisionMakersInner = ({ legalEntity, onNavigateToIndividual, navigateBackToTaskList }) => {
const getTaskStatus = useGetTaskStatus();
const { t: commonT } = useTranslation("common");
const { t: individualT } = useTranslation("individual");
const userEvents = useAnalyticsContext();
const { isFeatureEnabled } = useToggleContext();
const { showToast } = useToastContext();
const [showDecisionMakerModal, setShowDecisionMakerModal] = useState$1(false);
const [selectedDecisionMaker, setSelectedDecisionMaker] = useState$1();
const [isModalOpen, setIsModalOpen] = useState$1(false);
const openModal = () => {
userEvents.addPageEvent("Opened modal", {
actionType: "open",
label: "decisionMakersDescriptionModal"
});
setIsModalOpen(true);
};
const closeModal = () => {
userEvents.addPageEvent("Closed modal", {
actionType: "close",
label: "decisionMakersDescriptionModal"
});
setIsModalOpen(false);
};
const openDecisionMakerModal = (decisionMaker) => {
userEvents.addPageEvent("Opened modal", {
actionType: "open",
label: "viewDecisionMakerModal"
});
setShowDecisionMakerModal(true);
setSelectedDecisionMaker(decisionMaker);
};
const closeDecisionMakerModal = () => {
userEvents.addPageEvent("Closed modal", {
actionType: "close",
label: "viewDecisionMakerModal"
});
setShowDecisionMakerModal(false);
setSelectedDecisionMaker(null);
};
const capabilityProblems = useCapabilityProblems();
const decisionMakerRemediationCodes = useMemo$1(() => {
const remediationCodes = (capabilityProblems?.[EntityTypes.LEGAL_ENTITY]?.[legalEntity.id]?.missingData ?? []).flatMap((error) => {
const remediation = DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING[error.code];
return remediation ? [remediation] : [];
});
return [...new Set(remediationCodes)];
}, [capabilityProblems, legalEntity.id]);
const updateLegalEntity = useUpdateLegalEntity();
const decisionMakers = getOwnDecisionMakers(legalEntity);
const translationKeys = { home: "goBackToTaskList" };
const { remediationMessages } = useDataMissingRemediations({
legalEntityId: legalEntity.id,
problems: capabilityProblems ?? {}
});
const mappedDecisionMakers = decisionMakers?.reduce((mappedDecisionMakers, decisionMaker) => {
if (!decisionMaker.legalEntityId) return mappedDecisionMakers;
const mappedDecisionMaker = mappedDecisionMakers[decisionMaker.legalEntityId];
const decisionMakerType = decisionMaker.type;
mappedDecisionMakers[decisionMaker.legalEntityId] = {
reference: decisionMaker.legalEntityId,
types: mappedDecisionMaker ? [...mappedDecisionMaker.types, decisionMakerType] : [decisionMakerType],
status: getTaskStatus(TaskTypes.DECISION_MAKER, decisionMaker.legalEntityId),
name: decisionMaker.name ?? "",
legalEntityType: decisionMaker.entityType,
problems: capabilityProblems?.LegalEntity?.[decisionMaker.legalEntityId]
};
return mappedDecisionMakers;
}, {});
const uniqueDecisionMakers = mappedDecisionMakers ? Object.values(mappedDecisionMakers) : [];
const isVerifyByInviteEnabled = isFeatureEnabled("EnableVerifyByInvite");
const invitationsStatuses = useInvitationStatuses(uniqueDecisionMakers.map((dm) => dm.reference), { enabled: isVerifyByInviteEnabled });
const getInvitationStatus = (dm) => invitationsStatuses[dm.reference];
const isWaitingForInvitee = (dm) => dm.status === TaskStatuses.DETAILS_REQUIRED && getInvitationStatus(dm).active;
const isActionNeeded = (dm) => (dm.status === TaskStatuses.ERROR || dm.status === TaskStatuses.DETAILS_REQUIRED) && !isWaitingForInvitee(dm);
const isComplete = (dm) => dm.status === TaskStatuses.FINISHED || dm.status === TaskStatuses.PROCESSING || isWaitingForInvitee(dm);
const isSignatory = (dm) => dm.types.includes(DecisionMakerTypes.SIGNATORY);
const actionNeededDecisionMakers = uniqueDecisionMakers.filter(isActionNeeded);
const completeDecisionMakers = uniqueDecisionMakers.filter(isComplete);
const actionNeededSignatories = actionNeededDecisionMakers.filter(isSignatory);
const actionNeededBeneficialOwners = actionNeededDecisionMakers.filter(not(isSignatory));
const completeSignatories = completeDecisionMakers.filter(isSignatory);
const completeBeneficialOwners = completeDecisionMakers.filter(not(isSignatory));
const showWarning = Boolean(remediationMessages.DECISION_MAKER && uniqueDecisionMakers.length);
/**
* Analytics
*/
useTaskLandedEvent("DECISION_MAKER_OVERVIEW");
useEffect$1(() => {
if (showWarning) userEvents.addTaskEvent("Encountered error", {
task: TaskTypes.DECISION_MAKER_OVERVIEW,
actionType: "alert",
returnValue: "missingDecisionMaker"
});
}, [
remediationMessages.DECISION_MAKER,
showWarning,
userEvents
]);
const getDecisionMakerTrackingParams = (decisionMaker) => ({
task: TaskTypes.DECISION_MAKER_OVERVIEW,
associatedLegalEntityId: decisionMaker.reference,
associatedLegalEntityType: decisionMaker.legalEntityType,
roles: decisionMaker.types
});
const addDecisionMakerOnClick = () => {
onNavigateToIndividual();
};
const onRemediationAction = () => {
const SIGNATORY_MISSING_CODE = "2_124";
const DIRECTOR_MISSING_CODE = "2_185";
if (decisionMakerRemediationCodes.length === 1) switch (decisionMakerRemediationCodes[0]) {
case SIGNATORY_MISSING_CODE:
individualFormDefaultData.value = { signatoryQuestionnaire: { isSignatory: GuidanceQuestionValues.YES } };
break;
case DIRECTOR_MISSING_CODE:
individualFormDefaultData.value = { uboQuestionnaire: {
isDirector: GuidanceQuestionValues.YES,
isOwner: null,
isControllingPerson: null
} };
break;
default: break;
}
onNavigateToIndividual();
};
const editDecisionMaker = (decisionMaker) => {
onNavigateToIndividual(decisionMaker.reference);
userEvents.addTaskEvent("Clicked button", {
...getDecisionMakerTrackingParams(decisionMaker),
actionType: "edit"
});
};
const deleteDecisionMaker = async (decisionMaker) => {
try {
const updatedEntityAssociations = { entityAssociations: (legalEntity.entityAssociations ?? []).filter((entityAssociation) => entityAssociation.legalEntityId !== decisionMaker.reference) };
await updateLegalEntity.mutateAsync({
...updatedEntityAssociations,
id: legalEntity.id
});
const remainingDecisionMakers = decisionMakers.filter((curr) => curr.legalEntityId !== decisionMaker.reference);
userEvents.addTaskEvent("Clicked button", {
...getDecisionMakerTrackingParams(decisionMaker),
actionType: "remove",
remainingDecisionMakers
});
showToast({
variant: "success",
label: individualT(($) => $["successFullyRemovedDecisionMaker"])
});
closeDecisionMakerModal();
} catch {
showToast({
variant: "error",
label: individualT(($) => $["failedToRemoveDecisionMaker"])
});
}
};
const renderDecisionMakersList = (decisionMakers) => {
if (decisionMakers.length === 0) return null;
return /* @__PURE__ */ jsx(List, {
variant: "grouped-primary",
padding: "small",
dividers: false,
children: decisionMakers.map((decisionMaker) => /* @__PURE__ */ jsx(DecisionMakerListItem, {
decisionMaker,
openDecisionMakerModal,
invitationStatus: getInvitationStatus(decisionMaker)
}, decisionMaker.reference))
});
};
const decisionMakerSections = useMemo$1(() => [{
key: "actionNeeded",
title: commonT(($) => $["actionNeeded"]),
signatories: actionNeededSignatories,
beneficialOwners: actionNeededBeneficialOwners
}, {
key: "complete",
title: commonT(($) => $["complete"]),
signatories: completeSignatories,
beneficialOwners: completeBeneficialOwners
}], [
commonT,
actionNeededSignatories,
actionNeededBeneficialOwners,
completeSignatories,
completeBeneficialOwners
]);
if (uniqueDecisionMakers.length === 0) return /* @__PURE__ */ jsx(DecisionMakersGettingStarted, {
handleCancelClick: () => navigateBackToTaskList(),
addDecisionMakerOnClick
});
return /* @__PURE__ */ jsx("div", {
className: "u-display-flex u-justify-content-center",
children: /* @__PURE__ */ jsxs("div", {
className: "adyen-kyc-decision-makers u-margin-32",
children: [
/* @__PURE__ */ jsxs(StackLayout, {
gap: "medium",
align: "center",
children: [/* @__PURE__ */ jsx(Header, {
title: individualT(($) => $["ownersAndDecisionMakers"]),
description: individualT(($) => $["ownersAndDecisionMakersDescription"]),
status: getTaskStatus(TaskTypes.DECISION_MAKER_OVERVIEW),
align: "center",
children: /* @__PURE__ */ jsx(Button, {
slot: "actions",
variant: "link",
onClick: openModal,
children: commonT(($) => $["learnMore"])
})
}), showWarning && /* @__PURE__ */ jsx(RemediationAlerts, {
activeCodes: decisionMakerRemediationCodes,
onAction: onRemediationAction
})]
}),
/* @__PURE__ */ jsxs(StackLayout, {
gap: "small",
children: [
decisionMakerSections.map((section) => {
if (section.signatories.length === 0 && section.beneficialOwners.length === 0) return null;
return /* @__PURE__ */ jsx(List, {
padding: "none",
dividers: false,
header: section.title,
children: /* @__PURE__ */ jsxs(StackLayout, {
gap: "small",
children: [renderDecisionMakersList(section.signatories), renderDecisionMakersList(section.beneficialOwners)]
})
}, section.key);
}),
/* @__PURE__ */ jsx(List, {
variant: "grouped-primary",
padding: "small",
dividers: false,
children: /* @__PURE__ */ jsx(ListItem, {
avatar: {
iconName: "plus",
circle: true
},
title: isFeatureEnabled("EnableVerifyByInvite") ? individualT(($) => $["addNewOrInvite"]) : commonT(($) => $["addNew"]),
action: { onClick: addDecisionMakerOnClick }
})
}),
/* @__PURE__ */ jsx(Button, {
variant: "secondary",
onClick: () => {
userEvents.addTaskEvent("Clicked button", {
task: TaskTypes.DECISION_MAKER_OVERVIEW,
actionType: "back",
label: translationKeys.home,
noOfDecisionMakers: decisionMakers.length
});
navigateBackToTaskList();
},
fullWidth: true,
children: commonT(($) => $[translationKeys.home])
})
]
}),
showDecisionMakerModal && selectedDecisionMaker && /* @__PURE__ */ jsx(DecisionMakerDetails, {
handleClose: closeDecisionMakerModal,
handleDelete: () => deleteDecisionMaker(selectedDecisionMaker),
handleEdit: () => editDecisionMaker(selectedDecisionMaker),
decisionMaker: selectedDecisionMaker,
parentLegalEntity: legalEntity
}),
isModalOpen && /* @__PURE__ */ jsx(Modal, {
onClose: closeModal,
ariaLabel: individualT(($) => $["moreAboutOwnersAndDecisionMakers"]),
inset: true,
children: /* @__PURE__ */ jsx(DecisionMakersModalContent, {})
})
]
})
});
};
//#endregion
export { DecisionMakers };