;
{
  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] = "8e342218-797e-45c0-b687-47000bf0e920", e._sentryDebugIdIdentifier = "sentry-dbid-8e342218-797e-45c0-b687-47000bf0e920");
  } catch (e) {
  }
}
;
import { ae as getOwnEntityAssociations, o as LegalEntityTypes } from "./StoreProvider-CqQrndhS.js";
const getIndividualLegalEntityName = (legalEntityResponse) => {
  if (!legalEntityResponse || !legalEntityResponse?.individual) return "";
  return `${legalEntityResponse.individual?.name?.firstName ?? ""} ${legalEntityResponse.individual?.name?.lastName ?? ""}`;
};
const getLegalEntityNameBasedOnType = (legalEntityResponse) => {
  if (legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL) {
    return getIndividualLegalEntityName(legalEntityResponse);
  }
  return legalEntityResponse.organization?.legalName ?? "";
};
const getPayoutAccountHolderName = (legalEntity, t) => {
  const ownAssociations = getOwnEntityAssociations(legalEntity);
  const trustAssociation = ownAssociations.find(({ type }) => type === LegalEntityTypes.TRUST);
  if (trustAssociation?.name) {
    const trustName = trustAssociation.name;
    const trusteeName = getLegalEntityNameBasedOnType(legalEntity);
    return t(($) => $["trusteeAsTrusteeForTrust"], { trustName, trusteeName });
  }
  const solePropAssociation = ownAssociations.find(
    ({ type }) => type === LegalEntityTypes.SOLE_PROPRIETORSHIP
  );
  if (solePropAssociation?.name) {
    return solePropAssociation.name;
  }
  return getLegalEntityNameBasedOnType(legalEntity);
};
export {
  getIndividualLegalEntityName as a,
  getPayoutAccountHolderName as b,
  getLegalEntityNameBasedOnType as g
};
