"use strict";
/**
 * CLI output helpers — colors, symbols, formatters.
 * Zero deps — raw ANSI escapes. Respects NO_COLOR env var.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.sym = exports.c = void 0;
exports.header = header;
exports.kv = kv;
exports.tip = tip;
const useColor = !process.env.NO_COLOR && process.stdout.isTTY !== false;
function ansi(code) {
    return (s) => (useColor ? `\x1b[${code}m${s}\x1b[0m` : s);
}
exports.c = {
    bold: ansi('1'),
    dim: ansi('2'),
    red: ansi('31'),
    green: ansi('32'),
    yellow: ansi('33'),
    blue: ansi('34'),
    magenta: ansi('35'),
    cyan: ansi('36'),
    gray: ansi('90'),
};
exports.sym = {
    ok: exports.c.green('✓'),
    err: exports.c.red('✗'),
    bullet: exports.c.cyan('●'),
    arrow: exports.c.gray('→'),
    pointer: exports.c.cyan('▶'),
    rocket: '🚀',
    info: exports.c.blue('ⓘ'),
};
/**
 * Header line with bold title, optional dim subtitle.
 *   header(sym.ok, 'Chorus started')  →  ✓ Chorus started
 *   header(sym.ok, 'Started', 'PID 1234')  →  ✓ Started  (PID 1234)
 */
function header(icon, title, sub) {
    const main = `${icon} ${exports.c.bold(title)}`;
    return sub ? `${main}  ${exports.c.dim(sub)}` : main;
}
/**
 * Aligned key/value rows. Pads keys to the longest key width.
 *   kv([['Cockpit', 'http://...'], ['Daemon', 'http://...']])
 */
function kv(rows, indent = '   ') {
    const width = Math.max(...rows.map(([k]) => k.length));
    return rows
        .map(([k, v]) => `${indent}${exports.c.gray(k.padEnd(width))}  ${v}`)
        .join('\n');
}
/**
 * A boxed tip line. Used for one-time hints/footnotes.
 */
function tip(text, indent = '   ') {
    return `${indent}${exports.sym.info} ${exports.c.dim(text)}`;
}
//# sourceMappingURL=ui.js.map