export const LOGS_ATTRIBUTE_COLUMN_PREFIX = "attribute:";
export const DEFAULT_LOGS_TABLE_COLUMNS = [
    "time",
    "service",
    "severity",
    "message",
];
export const CORE_LOGS_TABLE_COLUMN_OPTIONS = [
    {
        id: "time",
        label: "Time",
    },
    {
        id: "service",
        label: "Service",
    },
    {
        id: "severity",
        label: "Severity",
    },
    {
        id: "message",
        label: "Message",
    },
    {
        id: "traceId",
        label: "Trace ID",
    },
    {
        id: "spanId",
        label: "Span ID",
    },
];
export const getLogsAttributeColumnId = (attributeKey) => {
    return `${LOGS_ATTRIBUTE_COLUMN_PREFIX}${attributeKey}`;
};
export const isLogsAttributeColumnId = (columnId) => {
    return columnId.startsWith(LOGS_ATTRIBUTE_COLUMN_PREFIX);
};
export const getLogsAttributeKeyFromColumnId = (columnId) => {
    if (!isLogsAttributeColumnId(columnId)) {
        return null;
    }
    return columnId.slice(LOGS_ATTRIBUTE_COLUMN_PREFIX.length) || null;
};
export const normalizeLogsTableColumns = (columns) => {
    const sanitizedColumns = [];
    const seen = new Set();
    for (const columnId of columns || []) {
        if (!columnId || seen.has(columnId)) {
            continue;
        }
        seen.add(columnId);
        sanitizedColumns.push(columnId);
    }
    if (sanitizedColumns.length === 0) {
        return [...DEFAULT_LOGS_TABLE_COLUMNS];
    }
    return sanitizedColumns;
};
//# sourceMappingURL=types.js.map