import { Box, Text } from '../../../tui/index.js';
import { CONTENT_PAD_X, CONTENT_PAD_Y } from '../../layout.js';
const ANSI_TURQUOISE = '\x1b[38;2;96;225;255m';
export class TaskNotificationMessageComponent extends Box {
    /** Build the turquoise task notification message box. */
    constructor(message) {
        super(CONTENT_PAD_X, CONTENT_PAD_Y);
        const text = typeof message.details?.displayText === 'string'
            ? message.details.displayText
            : extractText(message.content);
        this.addChild(new Text(`${ANSI_TURQUOISE}${text}\x1b[39m`, 0, 0));
    }
}
/** Extract joined text from a CustomMessage's string or block content. */
function extractText(content) {
    if (typeof content === 'string')
        return content;
    return content
        .filter((block) => block.type === 'text')
        .map((block) => block.text)
        .join(' ');
}
//# sourceMappingURL=task-notification-message.js.map