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] = "1c506e3c-f107-45eb-9268-e94bd32d8ca9", e._sentryDebugIdIdentifier = "sentry-dbid-1c506e3c-f107-45eb-9268-e94bd32d8ca9");
} catch (e) {}
import { t as getApiTrustedFields } from "./getTrustedFields-BF_CmfLe.js";
//#region src/components/Individual/tasks/DecisionMakers/getTrustedDecisionMakers.ts
function getTrustedDecisionMakers(rootLegalEntity, provider) {
	return parseTrustedDecisionMakersFromApiFields(getApiTrustedFields(rootLegalEntity, provider));
}
function parseTrustedDecisionMakersFromApiFields(trustedApiFields) {
	const rawTrustedEntityAssociations = trustedApiFields.filter((f) => f.startsWith("entityAssociations")) ?? [];
	const leIdMap = {};
	rawTrustedEntityAssociations.forEach((rtea) => {
		const [_, role, leId] = rtea.split(".");
		const trustedRole = role;
		if (!leIdMap[leId]) leIdMap[leId] = { roles: [trustedRole] };
		else leIdMap[leId] = { roles: [...leIdMap[leId].roles, trustedRole] };
	});
	return Object.keys(leIdMap).map((reference) => ({
		reference,
		types: leIdMap[reference].roles
	}));
}
//#endregion
export { getTrustedDecisionMakers as t };
