/**
 * Finite public projection contract for settings readiness.
 * Bounded enums + sanitized labels only.
 */
import { isUnsafePublicString } from "../runs/runProjectionContract.js";
export const SETTINGS_PROJECTION_PUBLIC_SOURCE = "settings";
export const SETTINGS_PROJECTION_AREAS = [
    "providers",
    "policies",
    "permissions",
    "billing",
    "notifications",
];
export const SETTINGS_PROJECTION_STATUSES = [
    "ready",
    "needs-attention",
    "blocked",
    "not-configured",
];
export const SETTINGS_PROJECTION_TONES = [
    "primary",
    "success",
    "warning",
    "destructive",
    "muted",
];
const MAX_LABEL = 120;
export function readSettingsLabel(value) {
    if (value === null || value === undefined)
        return null;
    const trimmed = value.trim();
    if (!trimmed)
        return null;
    if (trimmed.length > MAX_LABEL)
        return null;
    if (isUnsafePublicString(trimmed))
        return null;
    return trimmed;
}
export function toneForSettingsStatus(status) {
    switch (status) {
        case "ready":
            return "success";
        case "needs-attention":
            return "warning";
        case "blocked":
            return "destructive";
        case "not-configured":
            return "muted";
    }
}
