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] = "1b134734-52ce-4ab4-a980-7901b0d3d6f7", e._sentryDebugIdIdentifier = "sentry-dbid-1b134734-52ce-4ab4-a980-7901b0d3d6f7");
} catch (e) {}
import { n as addResourceBundles, r as useTranslation } from "./translation-DYpZlvOH.js";
import { r as Loader } from "./Button-DOLNhJTG.js";
import { r as useLegalEntity } from "./useLegalEntity-DFEptY6O.js";
import { t as LegalEntityTypes } from "./legal-entity-type-VIfNYnJP.js";
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-C6bSV6sB.js";
import { a as noop } from "./AnalyticsContext-zvlAxIPp.js";
import { t as _rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper-CCXvMgfE.js";
import { C as EntityTypes, c as individualBaseMapping } from "./processCapabilities-CI_g2ItO.js";
import { t as TaskTypes } from "./taskTypes-DWaxzvnQ.js";
import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-DWdc4uXg.js";
import { n as getTrustedFields, r as getTrustedFieldsProvider } from "./getTrustedFields-BF_CmfLe.js";
import { n as isBafinSignatoryFlow, r as removeIdVerificationProblemsForBafinSignatory } from "./bafinUtils-AZHgY8qT.js";
import { t as useScenarios } from "./useScenarios-B6O71v1k.js";
import { t as IndividualDropin } from "./IndividualDropin-CEpexYMc.js";
import { t as getTrustedDecisionMakers } from "./getTrustedDecisionMakers-CvCJU0vx.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-DPA8C7cd.js"),
			"../language/cs-CZ.json": () => import("./cs-CZ-7rXXuJIs.js"),
			"../language/da-DK.json": () => import("./da-DK-uqXEDzsX.js"),
			"../language/de-DE.json": () => import("./de-DE-Bx3yWhvM.js"),
			"../language/el-GR.json": () => import("./el-GR-DyDZNY1Y.js"),
			"../language/en-US.instructions.json": () => import("./en-US.instructions-kje2iQeM.js"),
			"../language/en-US.json": () => import("./en-US--qOOYh8v.js"),
			"../language/es-ES.json": () => import("./es-ES-OQQLpoI2.js"),
			"../language/et-EE.json": () => import("./et-EE-Dh2jDTFG.js"),
			"../language/fi-FI.json": () => import("./fi-FI-F0phsC5e.js"),
			"../language/fr-FR.json": () => import("./fr-FR-Bo3Ui9bW.js"),
			"../language/hr-HR.json": () => import("./hr-HR-BtQMffYR.js"),
			"../language/hu-HU.json": () => import("./hu-HU-BJ98-oo4.js"),
			"../language/it-IT.json": () => import("./it-IT-CwwFjn4z.js"),
			"../language/ja-JP.json": () => import("./ja-JP-D6qS54Zm.js"),
			"../language/lt-LT.json": () => import("./lt-LT-D3XnG1Jr.js"),
			"../language/lv-LV.json": () => import("./lv-LV-B_Uypp3t.js"),
			"../language/nl-NL.json": () => import("./nl-NL-DxYcxeQo.js"),
			"../language/no-NO.json": () => import("./no-NO-DMJwgC8y.js"),
			"../language/pl-PL.json": () => import("./pl-PL-DU49RDRD.js"),
			"../language/pt-BR.json": () => import("./pt-BR-DReb0iHZ.js"),
			"../language/pt-PT.json": () => import("./pt-PT-D7H8b_VC.js"),
			"../language/ro-RO.json": () => import("./ro-RO-sc5JtH0w.js"),
			"../language/sk-SK.json": () => import("./sk-SK-BgG5lOt0.js"),
			"../language/sl-SI.json": () => import("./sl-SI-CEVc1txT.js"),
			"../language/sv-SE.json": () => import("./sv-SE-g8sg5z4z.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 };
