"use strict";
/**
 * Text Formatting
 *
 * Headers, subheaders, and text utilities
 * @module utils/ui/text
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.sectionHeader = exports.hr = exports.subheader = exports.header = void 0;
const types_1 = require("./types");
const init_1 = require("./init");
const colors_1 = require("./colors");
/**
 * Print section header with optional gradient
 */
function header(text, useGradient = true) {
    if (useGradient && (0, init_1.useColors)()) {
        return (0, colors_1.gradientText)(text);
    }
    return (0, colors_1.bold)(text);
}
exports.header = header;
/**
 * Print subsection header
 */
function subheader(text) {
    if (!types_1.moduleCache.chalk || !(0, init_1.useColors)())
        return text;
    return types_1.moduleCache.chalk.hex(types_1.COLORS.primary)(text);
}
exports.subheader = subheader;
/**
 * Print horizontal rule
 */
function hr(char = '─', width = 60) {
    if (!(0, init_1.useColors)()) {
        return '-'.repeat(width);
    }
    return (0, colors_1.dim)(char.repeat(width));
}
exports.hr = hr;
/**
 * Print section header with ═══ borders
 * Format: ═══ Title ═══
 */
function sectionHeader(title) {
    const border = '═══';
    const headerText = `${border} ${title} ${border}`;
    // Use gradient + bold for visual appeal
    if (types_1.moduleCache.gradient && types_1.moduleCache.chalk && (0, init_1.useColors)()) {
        return types_1.moduleCache.chalk.bold(types_1.moduleCache.gradient([types_1.COLORS.primary, types_1.COLORS.secondary])(headerText));
    }
    // Fallback to bold primary color
    if ((0, init_1.useColors)() && types_1.moduleCache.chalk) {
        return types_1.moduleCache.chalk.hex(types_1.COLORS.primary).bold(headerText);
    }
    return headerText;
}
exports.sectionHeader = sectionHeader;
//# sourceMappingURL=text.js.map