"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const antd_1 = require("antd");
const loading_1 = __importDefault(require("components/share/loading"));
const register_1 = __importDefault(require("../register"));
const edit_table_1 = __importDefault(require("lib/hooks/edit-table"));
const theme_data_1 = require("@cocalc/frontend/frame-editors/terminal-editor/theme-data");
const desc = {
    font_size: `New terminals will use this font size by default. You can change this
for a particular terminal at any time.`,
    color_scheme: `The color scheme used for terminals.`,
    font: `The CoCalc terminal uses your browser's fixed-width font, which you can change in your browser's preferences.`,
};
(0, register_1.default)({
    path: "editor/terminal",
    title: "Terminals",
    icon: "terminal",
    desc: "Terminal default font size, color theme, etc.",
    search: desc,
    Component: () => {
        const { edited, original, Save, EditNumber, EditSelect } = (0, edit_table_1.default)({
            accounts: { terminal: null },
        });
        if (original == null || edited == null) {
            return (0, jsx_runtime_1.jsx)(loading_1.default, {});
        }
        return ((0, jsx_runtime_1.jsx)(antd_1.Space, { direction: "vertical", style: { width: "100%" }, children: (0, jsx_runtime_1.jsxs)(antd_1.Row, { children: [(0, jsx_runtime_1.jsxs)(antd_1.Col, { md: 14, sm: 24, style: { paddingRight: '15px' }, children: [(0, jsx_runtime_1.jsx)(Save, {}), (0, jsx_runtime_1.jsx)(EditNumber, { path: "terminal.font_size", title: "Terminal Font Size", icon: "text-height", desc: desc.font_size, min: 5, max: 32, units: "px" }), (0, jsx_runtime_1.jsx)(EditSelect, { path: "terminal.color_scheme", icon: "colors", desc: desc.color_scheme, options: theme_data_1.theme_desc, style: { width: "30ex" } }), (0, jsx_runtime_1.jsx)("h3", { style: { marginTop: "15px" }, children: "Font" }), desc.font] }), (0, jsx_runtime_1.jsxs)(antd_1.Col, { md: 10, sm: 24, children: [(0, jsx_runtime_1.jsx)("h3", { style: { marginTop: "10px" }, children: "Preview" }), (0, jsx_runtime_1.jsx)("div", { style: {
                                    fontSize: `${edited.terminal.font_size}px`,
                                    overflow: "hidden",
                                }, dangerouslySetInnerHTML: {
                                    __html: (0, theme_data_1.example)(edited.terminal.color_scheme),
                                } })] })] }) }));
    },
});
//# sourceMappingURL=terminal.js.map