import { alert } from "../../../../base/browser/ui/aria/aria.mjs";
import { TabFocus } from "../../../browser/config/tabFocus.mjs";
import { registerEditorAction, EditorAction } from "../../../browser/editorExtensions.mjs";
import { localize } from "../../../../nls.mjs";
class ToggleTabFocusModeAction extends EditorAction {
  constructor() {
    super({
      id: ToggleTabFocusModeAction.ID,
      label: localize({ key: "toggle.tabMovesFocus", comment: ["Turn on/off use of tab key for moving focus around VS Code"] }, "Toggle Tab Key Moves Focus"),
      alias: "Toggle Tab Key Moves Focus",
      precondition: void 0,
      kbOpts: {
        kbExpr: null,
        primary: 2048 | 43,
        mac: {
          primary: 256 | 1024 | 43
          /* KeyM */
        },
        weight: 100
        /* EditorContrib */
      }
    });
  }
  run(accessor, editor) {
    const oldValue = TabFocus.getTabFocusMode();
    const newValue = !oldValue;
    TabFocus.setTabFocusMode(newValue);
    if (newValue) {
      alert(localize("toggle.tabMovesFocus.on", "Pressing Tab will now move focus to the next focusable element"));
    } else {
      alert(localize("toggle.tabMovesFocus.off", "Pressing Tab will now insert the tab character"));
    }
  }
}
ToggleTabFocusModeAction.ID = "editor.action.toggleTabFocusMode";
registerEditorAction(ToggleTabFocusModeAction);
export {
  ToggleTabFocusModeAction
};
