import { jsx as _jsx } from "react/jsx-runtime";
import { Text } from "ink";
/** Orange base + white crest, used for normal run-status verbs. */
const WAVE_BASE = "#f6a13d";
const WAVE_CREST = "#ffffff";
const WAVE_GLOW = "#ffd9a0";
/** Rainbow palette for the ultramaxx power mode. */
export const rainbowPalette = ["#ff5f7e", "#ff9d3c", "#ffe14a", "#5fe08a", "#4fc6ff", "#9d8bff", "#ff7ad9"];
/**
 * Per-ultra-mode colour gradients. Each mode flows its own palette so the
 * keyword reads at a glance: maxx = hot rainbow, cheap = frugal green,
 * focus = laser cyan, loop = cycling violet.
 */
export const ultraGradients = {
    maxx: rainbowPalette,
    cheap: ["#3fae6a", "#5fe08a", "#9fe8b8", "#5fe08a", "#3fae6a"],
    fast: ["#ff8a3d", "#ffd54a", "#fff1a8", "#ffd54a", "#ff8a3d"],
    focus: ["#2f8fd0", "#4fc6ff", "#bdeaff", "#4fc6ff", "#2f8fd0"],
    loop: ["#7a5fff", "#9d8bff", "#c77dff", "#9d8bff", "#7a5fff"],
};
/** Flowing-gradient text for any palette — generalises RainbowText. */
export function GradientText(props) {
    const chars = [...props.text];
    const palette = props.palette.length > 0 ? props.palette : rainbowPalette;
    return (_jsx(Text, { bold: props.bold, children: chars.map((char, index) => (_jsx(Text, { color: palette[(index + props.frame) % palette.length], children: char }, `grad-${index}`))) }));
}
/**
 * Text with a highlight "wave" travelling through it: the verb stays in its
 * base color while a bright crest sweeps across the characters.
 */
export function WaveText(props) {
    const chars = [...props.text];
    const base = props.base ?? WAVE_BASE;
    const crest = props.crest ?? WAVE_CREST;
    const glow = props.glow ?? WAVE_GLOW;
    const span = chars.length + 6;
    const head = ((props.frame % span) + span) % span;
    return (_jsx(Text, { bold: props.bold, children: chars.map((char, index) => {
            const distance = head - index;
            const color = distance === 0 ? crest : distance === 1 || distance === -1 ? glow : base;
            return (_jsx(Text, { color: color, children: char }, `wave-${index}`));
        }) }));
}
/**
 * Rainbow text with the colors flowing through it — used to render the
 * `ultramaxx` keyword and the spinner verb while ultramaxx mode is active.
 */
export function RainbowText(props) {
    const chars = [...props.text];
    return (_jsx(Text, { bold: props.bold, children: chars.map((char, index) => {
            const color = rainbowPalette[(index + props.frame) % rainbowPalette.length];
            return (_jsx(Text, { color: color, children: char }, `rainbow-${index}`));
        }) }));
}
//# sourceMappingURL=AnimatedText.js.map