"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var src_exports = {}; __export(src_exports, { backgroundColors: () => backgroundColors, bgBlack: () => bgBlack, bgBlue: () => bgBlue, bgBlueBright: () => bgBlueBright, bgCyan: () => bgCyan, bgCyanBright: () => bgCyanBright, bgGray: () => bgGray, bgGreen: () => bgGreen, bgGreenBright: () => bgGreenBright, bgMagenta: () => bgMagenta, bgMagentaBright: () => bgMagentaBright, bgRed: () => bgRed, bgRedBright: () => bgRedBright, bgWhite: () => bgWhite, bgWhiteBright: () => bgWhiteBright, bgYellow: () => bgYellow, bgYellowBright: () => bgYellowBright, black: () => black, blackBright: () => blackBright, blue: () => blue, blueBright: () => blueBright, bold: () => bold, colors: () => colors, createColors: () => createColors, cyan: () => cyan, cyanBright: () => cyanBright, dim: () => dim, foregroundColors: () => foregroundColors, gray: () => gray, green: () => green, greenBright: () => greenBright, hidden: () => hidden, inverse: () => inverse, italic: () => italic, magenta: () => magenta, magentaBright: () => magentaBright, red: () => red, redBright: () => redBright, reset: () => reset, strikethrough: () => strikethrough, underline: () => underline, utilities: () => utilities, white: () => white, whiteBright: () => whiteBright, yellow: () => yellow, yellowBright: () => yellowBright }); module.exports = __toCommonJS(src_exports); // src/supports.ts var import_supports = require("termenv/supports"); // src/index.ts var isColorSupported = (0, import_supports.isColorsSupported)(); function createWrap(enabled) { return function wrap(start, end) { if (!enabled) { return chain((text) => text); } return chain((text) => `\x1B[${start}m${text}\x1B[${end}m`); }; } function createColors(enabled = isColorSupported) { const wrap = createWrap(enabled); return { reset: wrap(0, 0), bold: wrap(1, 22), dim: wrap(2, 22), italic: wrap(3, 23), underline: wrap(4, 24), overline: wrap(53, 55), inverse: wrap(7, 27), hidden: wrap(8, 28), strikethrough: wrap(9, 29), black: wrap(30, 39), red: wrap(31, 39), green: wrap(32, 39), yellow: wrap(33, 39), blue: wrap(34, 39), magenta: wrap(35, 39), cyan: wrap(36, 39), white: wrap(37, 39), gray: wrap(90, 39), blackBright: wrap(90, 39), redBright: wrap(91, 39), greenBright: wrap(92, 39), yellowBright: wrap(93, 39), blueBright: wrap(94, 39), magentaBright: wrap(95, 39), cyanBright: wrap(96, 39), whiteBright: wrap(97, 39), bgBlack: wrap(40, 49), bgRed: wrap(41, 49), bgGreen: wrap(42, 49), bgYellow: wrap(43, 49), bgBlue: wrap(44, 49), bgMagenta: wrap(45, 49), bgCyan: wrap(46, 49), bgWhite: wrap(47, 49), bgGray: wrap(100, 49), bgBlackBright: wrap(100, 49), bgRedBright: wrap(101, 49), bgGreenBright: wrap(102, 49), bgYellowBright: wrap(103, 49), bgBlueBright: wrap(104, 49), bgMagentaBright: wrap(105, 49), bgCyanBright: wrap(106, 49), bgWhiteBright: wrap(107, 49) }; } var colors = createColors(); function chain(farve) { return new Proxy(farve, { get(target, prop) { if (prop in colors) { return chain((text) => farve(colors[prop](text))); } return target[prop]; } }); } var { reset, bold, dim, italic, underline, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = colors; var foregroundColors = { black, red, green, yellow, blue, magenta, cyan, white, gray, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright }; var backgroundColors = { bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright }; var utilities = { reset, bold, dim, italic, underline, inverse, hidden, strikethrough }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { backgroundColors, bgBlack, bgBlue, bgBlueBright, bgCyan, bgCyanBright, bgGray, bgGreen, bgGreenBright, bgMagenta, bgMagentaBright, bgRed, bgRedBright, bgWhite, bgWhiteBright, bgYellow, bgYellowBright, black, blackBright, blue, blueBright, bold, colors, createColors, cyan, cyanBright, dim, foregroundColors, gray, green, greenBright, hidden, inverse, italic, magenta, magentaBright, red, redBright, reset, strikethrough, underline, utilities, white, whiteBright, yellow, yellowBright });