"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = colorize;
exports.colorizeForStdout = colorizeForStdout;
exports.colorizeForStderr = colorizeForStderr;
const ansi_escape_sequences_1 = __importDefault(require("ansi-escape-sequences"));
function colorize(text, style, options) {
    if (options.colors) {
        switch (style) {
            case 'mongosh:section-header':
            case 'mongosh:warning':
                style = ['bold', 'yellow'];
                break;
            case 'mongosh:error':
                style = ['bold', 'red'];
                break;
            case 'mongosh:filename':
                style = ['bold', 'blue'];
                break;
            case 'mongosh:uri':
                style = ['bold', 'green'];
                break;
            case 'mongosh:additional-error-info':
                style = ['yellow'];
                break;
            default:
                break;
        }
        return ansi_escape_sequences_1.default.format(text, style);
    }
    return text;
}
function colorizeForStdout(text, style) {
    return colorize(text, style, {
        colors: process.stdout.isTTY && process.stdout.getColorDepth() > 1,
    });
}
function colorizeForStderr(text, style) {
    return colorize(text, style, {
        colors: process.stderr.isTTY && process.stderr.getColorDepth() > 1,
    });
}
//# sourceMappingURL=clr.js.map