/**
 * Interactive prompts for CLI
 * Provides confirmation and selection utilities
 */
import chalk from 'chalk';
/**
 * Get the prompt text for edit confirmation
 */
export function getEditPromptText(editNumber, totalEdits, fileName) {
    return chalk.yellow(`Apply edit ${editNumber}/${totalEdits} to ${chalk.cyan(fileName)}? ` +
        `[${chalk.bold('y')}]es / [${chalk.bold('n')}]o / [${chalk.bold('a')}]ll / [${chalk.bold('d')}]iff / [${chalk.bold('s')}]kip / [${chalk.bold('q')}]uit: `);
}
/**
 * Parse edit action from user input
 */
export function parseEditAction(input) {
    const char = input.trim().toLowerCase() || 'y'; // Default to 'yes'
    let action;
    switch (char[0]) {
        case 'y':
            action = 'yes';
            break;
        case 'n':
            action = 'no';
            break;
        case 'a':
            action = 'all';
            break;
        case 'd':
            action = 'diff';
            break;
        case 's':
            action = 'skip';
            break;
        case 'q':
            action = 'quit';
            break;
        default:
            action = 'yes'; // Default to yes for unrecognized input
    }
    return {
        action,
        applyRemaining: action === 'all'
    };
}
/**
 * Show a summary of edit actions
 */
export function formatEditSummary(applied, rejected, skipped) {
    const parts = [];
    if (applied > 0) {
        parts.push(chalk.green(`${applied} applied`));
    }
    if (rejected > 0) {
        parts.push(chalk.red(`${rejected} rejected`));
    }
    if (skipped > 0) {
        parts.push(chalk.yellow(`${skipped} skipped`));
    }
    return parts.join(', ') || chalk.gray('no changes');
}
//# sourceMappingURL=prompts.js.map