import { alert } from '../../../../base/browser/ui/aria/aria.js';
import { TabFocus } from '../../../browser/config/tabFocus.js';
import { localize2WithPath, localizeWithPath } from '../../../../nls.js';
import { registerAction2, Action2 } from '../../../../platform/actions/common/actions.js';
const _moduleId = "vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode";
class ToggleTabFocusModeAction extends Action2 {
    static { this.ID = 'editor.action.toggleTabFocusMode'; }
    constructor() {
        super({
            id: ToggleTabFocusModeAction.ID,
            title: ( localize2WithPath(_moduleId, 0, 'Toggle Tab Key Moves Focus')),
            precondition: undefined,
            keybinding: {
                primary: 2048  | 43 ,
                mac: { primary: 256  | 1024  | 43  },
                weight: 100
            },
            f1: true
        });
    }
    run() {
        const oldValue = TabFocus.getTabFocusMode();
        const newValue = !oldValue;
        TabFocus.setTabFocusMode(newValue);
        if (newValue) {
            alert(( localizeWithPath(
                _moduleId,
                1,
                "Pressing Tab will now move focus to the next focusable element"
            )));
        }
        else {
            alert(( localizeWithPath(_moduleId, 2, "Pressing Tab will now insert the tab character")));
        }
    }
}
registerAction2(ToggleTabFocusModeAction);
export { ToggleTabFocusModeAction };
