
import { isWindows, isWeb } from '../../../../base/common/platform.js';
import { localize } from '../../../../nls.js';

const defaultCommonlyUsedSettings = [
    "editor.fontSize",
    "editor.formatOnSave",
    "files.autoSave",
    "editor.defaultFormatter",
    "editor.fontFamily",
    "chat.agent.maxRequests",
    "editor.wordWrap",
    "files.exclude",
    "workbench.colorTheme",
    "editor.tabSize",
    "editor.mouseWheelZoom",
    "editor.formatOnPaste"
];
function getCommonlyUsedData(settingGroups, commonlyUsed = defaultCommonlyUsedSettings) {
    const allSettings = ( new Map());
    for (const group of settingGroups) {
        for (const section of group.sections) {
            for (const s of section.settings) {
                allSettings.set(s.key, s);
            }
        }
    }
    const settings = [];
    for (const id of commonlyUsed) {
        const setting = allSettings.get(id);
        if (setting) {
            settings.push(setting);
        }
    }
    return {
        id: "commonlyUsed",
        label: ( localize(10529, "Commonly Used")),
        settings
    };
}
const tocData = {
    id: "root",
    label: "root",
    children: [{
        id: "editor",
        label: ( localize(10530, "Text Editor")),
        settings: ["editor.*"],
        children: [{
            id: "editor/cursor",
            label: ( localize(10531, "Cursor")),
            settings: ["editor.cursor*"]
        }, {
            id: "editor/find",
            label: ( localize(10532, "Find")),
            settings: ["editor.find.*"]
        }, {
            id: "editor/font",
            label: ( localize(10533, "Font")),
            settings: ["editor.font*"]
        }, {
            id: "editor/format",
            label: ( localize(10534, "Formatting")),
            settings: ["editor.format*"]
        }, {
            id: "editor/diffEditor",
            label: ( localize(10535, "Diff Editor")),
            settings: ["diffEditor.*"]
        }, {
            id: "editor/multiDiffEditor",
            label: ( localize(10536, "Multi-File Diff Editor")),
            settings: ["multiDiffEditor.*"]
        }, {
            id: "editor/minimap",
            label: ( localize(10537, "Minimap")),
            settings: ["editor.minimap.*"]
        }, {
            id: "editor/suggestions",
            label: ( localize(10538, "Suggestions")),
            settings: ["editor.*suggest*"]
        }, {
            id: "editor/files",
            label: ( localize(10539, "Files")),
            settings: ["files.*"]
        }]
    }, {
        id: "workbench",
        label: ( localize(10540, "Workbench")),
        settings: ["workbench.*"],
        children: [{
            id: "workbench/appearance",
            label: ( localize(10541, "Appearance")),
            settings: [
                "workbench.activityBar.*",
                "workbench.*color*",
                "workbench.fontAliasing",
                "workbench.iconTheme",
                "workbench.sidebar.location",
                "workbench.*.visible",
                "workbench.tips.enabled",
                "workbench.tree.*",
                "workbench.view.*"
            ]
        }, {
            id: "workbench/breadcrumbs",
            label: ( localize(10542, "Breadcrumbs")),
            settings: ["breadcrumbs.*"]
        }, {
            id: "workbench/editor",
            label: ( localize(10543, "Editor Management")),
            settings: ["workbench.editor.*"]
        }, {
            id: "workbench/settings",
            label: ( localize(10544, "Settings Editor")),
            settings: ["workbench.settings.*"]
        }, {
            id: "workbench/zenmode",
            label: ( localize(10545, "Zen Mode")),
            settings: ["zenmode.*"]
        }, {
            id: "workbench/screencastmode",
            label: ( localize(10546, "Screencast Mode")),
            settings: ["screencastMode.*"]
        }]
    }, {
        id: "window",
        label: ( localize(10547, "Window")),
        settings: ["window.*"],
        children: [{
            id: "window/newWindow",
            label: ( localize(10548, "New Window")),
            settings: ["window.*newwindow*"]
        }]
    }, {
        id: "features",
        label: ( localize(10549, "Features")),
        children: [{
            id: "features/accessibilitySignals",
            label: ( localize(10550, "Accessibility Signals")),
            settings: ["accessibility.signal*"]
        }, {
            id: "features/accessibility",
            label: ( localize(10551, "Accessibility")),
            settings: ["accessibility.*"]
        }, {
            id: "features/explorer",
            label: ( localize(10552, "Explorer")),
            settings: ["explorer.*", "outline.*"]
        }, {
            id: "features/search",
            label: ( localize(10553, "Search")),
            settings: ["search.*"]
        }, {
            id: "features/debug",
            label: ( localize(10554, "Debug")),
            settings: ["debug.*", "launch"]
        }, {
            id: "features/testing",
            label: ( localize(10555, "Testing")),
            settings: ["testing.*"]
        }, {
            id: "features/scm",
            label: ( localize(10556, "Source Control")),
            settings: ["scm.*"]
        }, {
            id: "features/extensions",
            label: ( localize(10557, "Extensions")),
            settings: ["extensions.*"]
        }, {
            id: "features/terminal",
            label: ( localize(10558, "Terminal")),
            settings: ["terminal.*"]
        }, {
            id: "features/task",
            label: ( localize(10559, "Task")),
            settings: ["task.*"]
        }, {
            id: "features/problems",
            label: ( localize(10560, "Problems")),
            settings: ["problems.*"]
        }, {
            id: "features/output",
            label: ( localize(10561, "Output")),
            settings: ["output.*"]
        }, {
            id: "features/comments",
            label: ( localize(10562, "Comments")),
            settings: ["comments.*"]
        }, {
            id: "features/remote",
            label: ( localize(10563, "Remote")),
            settings: ["remote.*"]
        }, {
            id: "features/timeline",
            label: ( localize(10564, "Timeline")),
            settings: ["timeline.*"]
        }, {
            id: "features/notebook",
            label: ( localize(10565, "Notebook")),
            settings: ["notebook.*", "interactiveWindow.*"]
        }, {
            id: "features/mergeEditor",
            label: ( localize(10566, "Merge Editor")),
            settings: ["mergeEditor.*"]
        }, {
            id: "features/chat",
            label: ( localize(10567, "Chat")),
            settings: ["chat.*", "inlineChat.*", "mcp"]
        }, {
            id: "features/issueReporter",
            label: ( localize(10568, "Issue Reporter")),
            settings: ["issueReporter.*"],
            hide: !isWeb
        }]
    }, {
        id: "application",
        label: ( localize(10569, "Application")),
        children: [{
            id: "application/http",
            label: ( localize(10570, "Proxy")),
            settings: ["http.*"]
        }, {
            id: "application/keyboard",
            label: ( localize(10571, "Keyboard")),
            settings: ["keyboard.*"]
        }, {
            id: "application/update",
            label: ( localize(10572, "Update")),
            settings: ["update.*"]
        }, {
            id: "application/telemetry",
            label: ( localize(10573, "Telemetry")),
            settings: ["telemetry.*"]
        }, {
            id: "application/settingsSync",
            label: ( localize(10574, "Settings Sync")),
            settings: ["settingsSync.*"]
        }, {
            id: "application/experimental",
            label: ( localize(10575, "Experimental")),
            settings: ["application.experimental.*"]
        }, {
            id: "application/other",
            label: ( localize(10576, "Other")),
            settings: ["application.*"],
            hide: isWindows
        }]
    }, {
        id: "security",
        label: ( localize(10577, "Security")),
        settings: ["security.*"],
        children: [{
            id: "security/workspace",
            label: ( localize(10578, "Workspace")),
            settings: ["security.workspace.*"]
        }]
    }]
};

export { getCommonlyUsedData, tocData };
