function isRecord(value) {
  return !!value && typeof value === "object" && !Array.isArray(value);
}
function readString(record, ...keys) {
  for (const key of keys) {
    const value = record[key];
    if (typeof value === "string" && value.trim().length > 0) {
      return value.trim();
    }
  }
  return null;
}
function formatObjectSummary(record) {
  const personName = [readString(record, "firstName"), readString(record, "lastName")].filter(Boolean).join(" ").trim();
  const label = readString(record, "displayName", "label", "name", "title", "fullName") ?? (personName || null) ?? readString(record, "email");
  if (!label) return null;
  return record.isPrimary === true ? `${label} (primary)` : label;
}
function formatChangelogValue(value) {
  if (value == null) return "";
  if (value instanceof Date) return value.toISOString();
  if (Array.isArray(value)) {
    return value.map((entry) => formatChangelogValue(entry)).filter(Boolean).join(", ");
  }
  if (isRecord(value)) {
    const summary = formatObjectSummary(value);
    if (summary) return summary;
    return JSON.stringify(value);
  }
  return String(value);
}
export {
  formatChangelogValue
};
//# sourceMappingURL=changelogValues.js.map
