"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 desc = {
    confirm_close: `You can make CoCalc always ask for confirmation before closing a browser tab viewing a project.
Enable this if you have issues with accidentally closing the CoCalc browser tab.
This shouldn't be necessary, since it's unlikely you will loose work if you close
the tab; also when you reopen CoCalc everything should be exactly as you left it.`,
    katex: `
The default is to always attempt to render formulas with KaTeX if possible, but you can
uncheck the box below to use MathJax version 2 by default when possible.  KaTeX is faster than
MathJax v2, but there are edge cases that MathJax supports but KaTeX doesn't,
often only for historical reasons; also, MathJax has a useful context menu.
(Some parts of CoCalc only support KaTeX no matter what you select here.)
`,
    standby_timeout_m: `
If you are not active for several minutes, you may see the gray and blue CoCalc splash screen
and your browser will minimize resource usage.  The time until the splash screen appears is the
standby timeout, which you can adjust below.  We use it to conserve resources, mainly network
bandwidth and browser CPU cycles. Execution of your code is NOT paused during standby.
`,
    show_global_info2: `
Sometimes there are important announcements about CoCalc, e.g., if there is a major
update available.  You can hide these if you do not want to see them at the top of
the screen for some reason.
`,
};
(0, register_1.default)({
    path: "system/behavior",
    title: "Behavior",
    icon: "circle",
    desc: "Configure general behavior of CoCalc, including idle timeout, math rendering, and whether to ask for confirmation before closing the browser window.",
    search: desc,
    Component: () => {
        const { edited, original, Save, EditBoolean, EditNumber } = (0, edit_table_1.default)({
            accounts: { other_settings: null },
        });
        if (original == null || edited == null) {
            return (0, jsx_runtime_1.jsx)(loading_1.default, {});
        }
        return ((0, jsx_runtime_1.jsxs)(antd_1.Space, { direction: "vertical", children: [(0, jsx_runtime_1.jsx)(Save, {}), (0, jsx_runtime_1.jsx)(EditNumber, { icon: "ban", path: "other_settings.standby_timeout_m", title: "Standby Timeout", desc: desc.standby_timeout_m, min: 1, max: 180, units: "minutes" }), (0, jsx_runtime_1.jsx)(EditBoolean, { path: "other_settings.katex", icon: "tex", title: "Math Rendering: KaTeX versus MathJax", desc: desc.katex, label: "Attempt to use KaTeX if at all possible" }), (0, jsx_runtime_1.jsx)(EditBoolean, { icon: "times-circle", path: "other_settings.confirm_close", title: "Confirmation before closing browser tab", desc: desc.confirm_close, label: "Ask for confirmation" })] }));
    },
});
//# sourceMappingURL=behavior.js.map