"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Screen = void 0;
const blessed_1 = __importDefault(require("blessed"));
const figlet_1 = __importDefault(require("figlet"));
class Screen {
    constructor() {
        this.createScreen = (title) => {
            const screen = blessed_1.default.screen({
                smartCSR: true,
            });
            screen.title = title;
            return screen;
        };
        this.createLog = (top, left) => {
            return blessed_1.default.log({
                top,
                left,
                parent: this.screen,
                width: '50%',
                height: '50%',
                border: {
                    type: 'line',
                },
                style: {
                    fg: 'white',
                    border: {
                        fg: '#f0f0f0',
                    },
                    hover: {
                        bg: 'green',
                    },
                },
                tags: true,
                mouse: true,
                keys: true,
                vi: true,
                alwaysScroll: true,
                scrollable: true,
                scrollbar: {
                    style: {
                        bg: 'yellow',
                    },
                },
            });
        };
        this.createBox = (top, left) => {
            return blessed_1.default.box({
                top,
                left,
                parent: this.screen,
                width: '50%',
                height: '50%',
                border: {
                    type: 'line',
                },
                style: {
                    fg: 'white',
                    border: {
                        fg: '#f0f0f0',
                    },
                    hover: {
                        bg: 'green',
                    },
                },
                tags: true,
                mouse: true,
                keys: true,
                vi: true,
                alwaysScroll: true,
                scrollable: true,
                scrollbar: {
                    style: {
                        bg: 'yellow',
                    },
                },
            });
        };
        this.screen = this.createScreen('UI Studio');
        this.topLeft = this.createBox('0%', '0%');
        this.topRight = this.createLog('0%', '50%');
        this.bottomLeft = this.createLog('50%', '0%');
        this.bottomRight = this.createLog('50%', '50%');
        (0, figlet_1.default)('\n UI Studio', { font: 'ANSI Regular' }, (err, data) => {
            if (!err)
                this.topLeft.setContent(data);
            this.screen.render();
        });
    }
}
exports.Screen = Screen;
//# sourceMappingURL=screen.js.map