{"version":3,"sources":["webpack:////build/source/node_modules/mousetrap/plugins/pause/mousetrap-pause.js","webpack:///./behaviors/shortcuts/keybindings.js","webpack:///./behaviors/shortcuts/shortcuts.js","webpack:///./behaviors/shortcuts/shortcuts_toggle.js"],"names":["Mousetrap","_originalStopCallback","prototype","stopCallback","e","element","combo","this","paused","call","pause","unpause","init","getCustomizations","_memoize","parsedCustomizations","AccessorUtilities","canUseLocalStorage","JSON","parse","localStorage","getItem","TOGGLE_KEYBOARD_SHORTCUTS_DIALOG","id","description","__","defaultKeys","GO_TO_YOUR_PROJECTS","GO_TO_YOUR_GROUPS","GO_TO_ACTIVITY_FEED","GO_TO_MILESTONE_LIST","GO_TO_YOUR_SNIPPETS","START_SEARCH","FOCUS_FILTER_BAR","GO_TO_YOUR_ISSUES","GO_TO_YOUR_MERGE_REQUESTS","GO_TO_YOUR_REVIEW_REQUESTS","GO_TO_YOUR_TODO_LIST","TOGGLE_PERFORMANCE_BAR","HIDE_APPEARING_CONTENT","TOGGLE_SUPER_SIDEBAR","TOGGLE_CANARY","BOLD_TEXT","customizable","ITALIC_TEXT","STRIKETHROUGH_TEXT","LINK_TEXT","INDENT_LINE","OUTDENT_LINE","FIND_AND_REPLACE","s__","TOGGLE_MARKDOWN_PREVIEW","EDIT_RECENT_COMMENT","SAVE_CHANGES","EDIT_WIKI_PAGE","REPO_GRAPH_SCROLL_LEFT","REPO_GRAPH_SCROLL_RIGHT","REPO_GRAPH_SCROLL_UP","REPO_GRAPH_SCROLL_DOWN","REPO_GRAPH_SCROLL_TOP","REPO_GRAPH_SCROLL_BOTTOM","GO_TO_PROJECT_OVERVIEW","GO_TO_PROJECT_ACTIVITY_FEED","GO_TO_PROJECT_RELEASES","GO_TO_PROJECT_FILES","START_SEARCH_PROJECT_FILE","GO_TO_PROJECT_COMMITS","GO_TO_PROJECT_REPO_GRAPH","GO_TO_PROJECT_REPO_CHARTS","GO_TO_PROJECT_ISSUES","NEW_ISSUE","GO_TO_PROJECT_ISSUE_BOARDS","GO_TO_PROJECT_MERGE_REQUESTS","GO_TO_PROJECT_PIPELINES","GO_TO_PROJECT_JOBS","GO_TO_PROJECT_ENVIRONMENTS","GO_TO_PROJECT_KUBERNETES","GO_TO_PROJECT_SNIPPETS","GO_TO_PROJECT_WIKI","GO_TO_PROJECT_WEBIDE","PROJECT_FILES_MOVE_SELECTION_UP","PROJECT_FILES_MOVE_SELECTION_DOWN","PROJECT_FILES_OPEN_SELECTION","PROJECT_FILES_GO_BACK","PROJECT_FILES_GO_TO_PERMALINK","PROJECT_FILES_GO_TO_COMPARE","ISSUABLE_COMMENT_OR_REPLY","ISSUABLE_EDIT_DESCRIPTION","ISSUABLE_CHANGE_LABEL","ISSUABLE_COPY_REF","ISSUE_MR_CHANGE_ASSIGNEE","ISSUE_MR_CHANGE_MILESTONE","MR_NEXT_FILE_IN_DIFF","MR_PREVIOUS_FILE_IN_DIFF","MR_GO_TO_FILE","MR_TOGGLE_FILE_BROWSER","MR_ADD_TO_REVIEW","MR_ADD_COMMENT_NOW","MR_NEXT_UNRESOLVED_DISCUSSION","MR_PREVIOUS_UNRESOLVED_DISCUSSION","MR_COPY_SOURCE_BRANCH_NAME","MR_EXPAND_ALL_FILES","MR_COLLAPSE_ALL_FILES","MR_COMMITS_NEXT_COMMIT","MR_COMMITS_PREVIOUS_COMMIT","ISSUE_NEXT_DESIGN","ISSUE_PREVIOUS_DESIGN","ISSUE_CLOSE_DESIGN","SIDEBAR_CLOSE_WIDGET","WEB_IDE_GO_TO_FILE","WEB_IDE_COMMIT","keybindingGroups","name","keybindings","keysFor","command","Boolean","isCustomizable","LOCAL_MOUSETRAP_DATA_KEY","getToolbarBtnToShortcutsMap","$textarea","$allToolbarBtns","closest","find","map","Map","each","$toolbarBtn","$","keyboardShortcuts","data","length","set","Shortcuts","constructor","_gon","extensions","onToggleHelp","bind","helpModalElement","helpModalVueInstance","addAll","focusSearchFile","focusSearch","focusFilter","onTogglePerfBar","hideAppearingContent","onToggleCanary","findAndFollowLink","toggleMarkdownPreview","addStopCallback","includes","undefined","gon","features","findAndReplace","add","toggleFindAndReplaceBar","document","on","shouldDisableShortcuts","disableShortcuts","addExtension","Extension","args","extensionsCurrentlyLoading","Set","instance","get","Dep","_Extension$dependenci","dependencies","has","delete","callback","commandsAndCallbacks","_this","forEach","commandAndCallback","_this2","preventDefault","$destroy","remove","createElement","body","append","Vue","el","components","ShortcutsHelp","render","hidden","parseBoolean","getCookie","setCookie","path","refreshCurrentPage","currentValue","toString","expires","triggerHandler","filterInput","focus","_document$querySelect","querySelector","click","InternalEvents","trackEvent","_document$querySelect2","_document$querySelect3","key","FIND_FILE_SHORTCUT_CLICK","searchInput","waitForElement","currentPath","dataset","value","dispatchEvent","Event","querySelectorAll","style","display","handler","toolbarBtnToShortcutsMap","localMousetrap","allShortcuts","_flatten","values","originalStopCallback","unbind","window","keyboard_shortcuts_enabled","setItem"],"mappings":"iFAMA,SAAUA,GACN,IAAIC,EAAwBD,EAAUE,UAAUC,aAEhDH,EAAUE,UAAUC,aAAe,SAASC,EAAGC,EAASC,GAGpD,QAFWC,KAEFC,QAIFP,EAAsBQ,KANlBF,KAM6BH,EAAGC,EAASC,IAGxDN,EAAUE,UAAUQ,MAAQ,WACbH,KACNC,QAAS,GAGlBR,EAAUE,UAAUS,QAAU,WACfJ,KACNC,QAAS,GAGlBR,EAAUY,OAvBd,CAwBIZ,Y,2xFCtBJ,MAcaa,EAAoBC,KAAQ,WACvC,IAAIC,EAAuB,GAG3B,GAF2BC,IAAkBC,qBAG3C,IACEF,EAAuBG,KAAKC,MAAMC,aAAaC,QAlBpB,yCAkBkD,MAC7E,MAAOjB,IAKX,OAAOW,KAIIO,EAAmC,CAC9CC,GAAI,gDACJC,YAAaC,aAAG,yCAChBC,YAAa,CAAC,MAGHC,EAAsB,CACjCJ,GAAI,mCACJC,YAAaC,aAAG,uBAChBC,YAAa,CAAC,YAGHE,EAAoB,CAC/BL,GAAI,iCACJC,YAAaC,aAAG,qBAChBC,YAAa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EgL,iBAYN,mCAAmC5D,EAAWsG,GAC5C,MAAMC,EAA2BxG,EAA4BC,GAEvDwG,EAAiB,IAAIhO,IAAUwH,EAAU,IAI/CA,EAAUU,KAAKZ,EAA0B0G,GAEzCD,EAAyB9C,SAAQ,SAAChD,EAAmBF,GACnDiG,EAAetF,KAAKT,GAAmB,SAAC7H,GACtCA,EAAEgL,iBAEF0C,EAAQ/F,SAKZ,MAAMkG,EAAeC,IAAQ,IAAIH,EAAyBI,WAEpDC,EAAuBpO,IAAUE,UAAUC,aACjD6N,EAAe7N,aAAe,SAAyBC,EAAGC,EAASC,GACjE,OAAI2N,EAAa1E,SAASjJ,IAInB8N,EAAqB3N,KAAKF,KAAMH,EAAGC,EAASC,IAcvD,qCAAqCkH,GACnC,MAAMwG,EAAiBxG,EAAUU,KAAKZ,GAElC0G,GACFzG,EAA4BC,GAAWyD,SAAQ,SAAChD,GAC9C+F,EAAeK,OAAOpG,S,kCChX9B,8FAGA,MAEa+B,EAAyB,kBAAOsE,OAAO7E,IAAI8E,4BAOjD,SAAStE,IACd7I,aAAaoN,QAVa,qBAUgB,GAC1CxO,IAAUU","file":"shortcutsBundle.b73487c4.chunk.js","sourcesContent":["/**\n * adds a pause and unpause method to Mousetrap\n * this allows you to enable or disable keyboard shortcuts\n * without having to reset Mousetrap and rebind everything\n */\n/* global Mousetrap:true */\n(function(Mousetrap) {\n    var _originalStopCallback = Mousetrap.prototype.stopCallback;\n\n    Mousetrap.prototype.stopCallback = function(e, element, combo) {\n        var self = this;\n\n        if (self.paused) {\n            return true;\n        }\n\n        return _originalStopCallback.call(self, e, element, combo);\n    };\n\n    Mousetrap.prototype.pause = function() {\n        var self = this;\n        self.paused = true;\n    };\n\n    Mousetrap.prototype.unpause = function() {\n        var self = this;\n        self.paused = false;\n    };\n\n    Mousetrap.init();\n}) (Mousetrap);\n","import { memoize } from 'lodash';\nimport AccessorUtilities from '~/lib/utils/accessor';\nimport { __, s__ } from '~/locale';\n\n/**\n * @param {object} command\n * @param {boolean} [command.customizable]\n */\nconst isCustomizable = ({ customizable }) => Boolean(customizable ?? true);\n\nexport const LOCAL_STORAGE_KEY = 'gl-keyboard-shortcuts-customizations';\n\n/**\n * @returns { Object.<string, string[]> } A map of command ID => keys of all\n * keyboard shortcuts that have been customized by the user. These\n * customizations are fetched from `localStorage`. This function is memoized,\n * so its return value will not reflect changes made to the `localStorage` data\n * after it has been called once.\n *\n * @example\n * { \"globalShortcuts.togglePerformanceBar\": [\"p e r f\"] }\n */\nexport const getCustomizations = memoize(() => {\n  let parsedCustomizations = {};\n  const localStorageIsSafe = AccessorUtilities.canUseLocalStorage();\n\n  if (localStorageIsSafe) {\n    try {\n      parsedCustomizations = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY) || '{}');\n    } catch (e) {\n      /* do nothing */\n    }\n  }\n\n  return parsedCustomizations;\n});\n\n// All available commands\nexport const TOGGLE_KEYBOARD_SHORTCUTS_DIALOG = {\n  id: 'globalShortcuts.toggleKeyboardShortcutsDialog',\n  description: __('Toggle keyboard shortcuts help dialog'),\n  defaultKeys: ['?'],\n};\n\nexport const GO_TO_YOUR_PROJECTS = {\n  id: 'globalShortcuts.goToYourProjects',\n  description: __('Go to your projects'),\n  defaultKeys: ['shift+p'],\n};\n\nexport const GO_TO_YOUR_GROUPS = {\n  id: 'globalShortcuts.goToYourGroups',\n  description: __('Go to your groups'),\n  defaultKeys: ['shift+g'],\n};\n\nexport const GO_TO_ACTIVITY_FEED = {\n  id: 'globalShortcuts.goToActivityFeed',\n  description: __('Go to the activity feed'),\n  defaultKeys: ['shift+a'],\n};\n\nexport const GO_TO_MILESTONE_LIST = {\n  id: 'globalShortcuts.goToMilestoneList',\n  description: __('Go to the milestone list'),\n  defaultKeys: ['shift+l'],\n};\n\nexport const GO_TO_YOUR_SNIPPETS = {\n  id: 'globalShortcuts.goToYourSnippets',\n  description: __('Go to your snippets'),\n  defaultKeys: ['shift+s'],\n};\n\nexport const START_SEARCH = {\n  id: 'globalShortcuts.startSearch',\n  description: __('Start search'),\n  defaultKeys: ['s', '/'],\n};\n\nexport const FOCUS_FILTER_BAR = {\n  id: 'globalShortcuts.focusFilterBar',\n  description: __('Focus filter bar'),\n  defaultKeys: ['f'],\n};\n\nexport const GO_TO_YOUR_ISSUES = {\n  id: 'globalShortcuts.goToYourIssues',\n  description: __('Go to your issues'),\n  defaultKeys: ['shift+i'],\n};\n\nexport const GO_TO_YOUR_MERGE_REQUESTS = {\n  id: 'globalShortcuts.goToYourMergeRequests',\n  description: __('Go to your merge requests'),\n  defaultKeys: ['shift+m'],\n};\n\nexport const GO_TO_YOUR_REVIEW_REQUESTS = {\n  id: 'globalShortcuts.goToYourReviewRequests',\n  description: __('Go to your review requests'),\n  defaultKeys: ['shift+r'],\n};\n\nexport const GO_TO_YOUR_TODO_LIST = {\n  id: 'globalShortcuts.goToYourTodoList',\n  description: __('Go to your To-Do List'),\n  defaultKeys: ['shift+t'],\n};\n\nexport const TOGGLE_PERFORMANCE_BAR = {\n  id: 'globalShortcuts.togglePerformanceBar',\n  description: __('Toggle the Performance Bar'),\n  defaultKeys: ['p b'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const HIDE_APPEARING_CONTENT = {\n  id: 'globalShortcuts.hideAppearingContent',\n  description: __('Hide tooltips or popovers'),\n  defaultKeys: ['esc'],\n};\n\nexport const TOGGLE_SUPER_SIDEBAR = {\n  id: 'globalShortcuts.toggleSuperSidebar',\n  description: __('Toggle the navigation sidebar'),\n  defaultKeys: ['mod+\\\\'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const TOGGLE_CANARY = {\n  id: 'globalShortcuts.toggleCanary',\n  description: __('Toggle GitLab Next'),\n  defaultKeys: ['g x'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const BOLD_TEXT = {\n  id: 'editing.boldText',\n  description: __('Bold text'),\n  defaultKeys: ['mod+b'],\n  customizable: false,\n};\n\nexport const ITALIC_TEXT = {\n  id: 'editing.italicText',\n  description: __('Italic text'),\n  defaultKeys: ['mod+i'],\n  customizable: false,\n};\n\nexport const STRIKETHROUGH_TEXT = {\n  id: 'editing.strikethroughText',\n  description: __('Strikethrough text'),\n  defaultKeys: ['mod+shift+x'],\n  customizable: false,\n};\n\nexport const LINK_TEXT = {\n  id: 'editing.linkText',\n  description: __('Link text'),\n  defaultKeys: ['mod+k'],\n  customizable: false,\n};\n\nexport const INDENT_LINE = {\n  id: 'editing.indentLine',\n  description: __('Indent line'),\n  defaultKeys: ['mod+]'], // eslint-disable-line @gitlab/require-i18n-strings\n  customizable: false,\n};\n\nexport const OUTDENT_LINE = {\n  id: 'editing.outdentLine',\n  description: __('Outdent line'),\n  defaultKeys: ['mod+['], // eslint-disable-line @gitlab/require-i18n-strings\n  customizable: false,\n};\n\nexport const FIND_AND_REPLACE = {\n  id: 'editing.findAndReplace',\n  description: s__('MarkdownEditor|Find and replace'),\n  defaultKeys: ['mod+f'],\n  customizable: false,\n};\n\nexport const TOGGLE_MARKDOWN_PREVIEW = {\n  id: 'editing.toggleMarkdownPreview',\n  description: __('Toggle Markdown preview'),\n  // Note: Ideally, keyboard shortcuts should be made cross-platform by using the special `mod` key\n  // instead of binding both `ctrl` and `command` versions of the shortcut.\n  // See https://docs.gitlab.com/ee/development/fe_guide/keyboard_shortcuts.html#make-cross-platform-shortcuts.\n  // However, this particular shortcut has been in place since before the `mod` key was available.\n  // We've chosen to leave this implemented as-is for the time being to avoid breaking people's workflows.\n  // See discussion in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45308#note_527490548.\n  defaultKeys: ['ctrl+shift+p', 'command+shift+p'],\n};\n\n/**\n * @keydown.up event is handled here: https://gitlab.com/gitlab-org/gitlab/-/blob/f3e807cdff5cf25765894163b4e92f8b2bcf8a68/app/assets/javascripts/notes/components/comment_form.vue#L379\n */\nconst EDIT_RECENT_COMMENT = {\n  id: 'editing.editRecentComment',\n  description: __('Edit your most recent comment in a thread (from an empty textarea)'),\n  defaultKeys: ['up'],\n};\n\nexport const SAVE_CHANGES = {\n  id: 'globalShortcuts.saveChanges',\n  description: __('Submit/save changes'),\n  defaultKeys: ['mod+enter'],\n};\n\nexport const EDIT_WIKI_PAGE = {\n  id: 'wiki.editWikiPage',\n  description: __('Edit wiki page'),\n  defaultKeys: ['e'],\n};\n\nexport const REPO_GRAPH_SCROLL_LEFT = {\n  id: 'repositoryGraph.scrollLeft',\n  description: __('Scroll left'),\n  defaultKeys: ['left', 'h'],\n};\n\nexport const REPO_GRAPH_SCROLL_RIGHT = {\n  id: 'repositoryGraph.scrollRight',\n  description: __('Scroll right'),\n  defaultKeys: ['right', 'l'],\n};\n\nexport const REPO_GRAPH_SCROLL_UP = {\n  id: 'repositoryGraph.scrollUp',\n  description: __('Scroll up'),\n  defaultKeys: ['up', 'k'],\n};\n\nexport const REPO_GRAPH_SCROLL_DOWN = {\n  id: 'repositoryGraph.scrollDown',\n  description: __('Scroll down'),\n  defaultKeys: ['down', 'j'],\n};\n\nexport const REPO_GRAPH_SCROLL_TOP = {\n  id: 'repositoryGraph.scrollToTop',\n  description: __('Scroll to top'),\n  defaultKeys: ['shift+up', 'shift+k'],\n};\n\nexport const REPO_GRAPH_SCROLL_BOTTOM = {\n  id: 'repositoryGraph.scrollToBottom',\n  description: __('Scroll to bottom'),\n  defaultKeys: ['shift+down', 'shift+j'],\n};\n\nexport const GO_TO_PROJECT_OVERVIEW = {\n  id: 'project.goToOverview',\n  description: __(\"Go to the project's overview page\"),\n  defaultKeys: ['g o'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_ACTIVITY_FEED = {\n  id: 'project.goToActivityFeed',\n  description: __(\"Go to the project's activity feed\"),\n  defaultKeys: ['g v'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_RELEASES = {\n  id: 'project.goToReleases',\n  description: __('Go to releases'),\n  defaultKeys: ['g r'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_FILES = {\n  id: 'project.goToFiles',\n  description: __('Go to files'),\n  defaultKeys: ['g f'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const START_SEARCH_PROJECT_FILE = {\n  id: 'project.startSearchFile',\n  description: __('Go to find file'),\n  defaultKeys: ['t'],\n};\n\nexport const GO_TO_PROJECT_COMMITS = {\n  id: 'project.goToCommits',\n  description: __('Go to commits'),\n  defaultKeys: ['g c'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_REPO_GRAPH = {\n  id: 'project.goToRepoGraph',\n  description: __('Go to repository graph'),\n  defaultKeys: ['g n'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_REPO_CHARTS = {\n  id: 'project.goToRepoCharts',\n  description: __('Go to repository charts'),\n  defaultKeys: ['g d'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_ISSUES = {\n  id: 'project.goToIssues',\n  description: __('Go to issues'),\n  defaultKeys: ['g i'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const NEW_ISSUE = {\n  id: 'project.newIssue',\n  description: __('New issue'),\n  defaultKeys: ['i'],\n};\n\nexport const GO_TO_PROJECT_ISSUE_BOARDS = {\n  id: 'project.goToIssueBoards',\n  description: __('Go to issue boards'),\n  defaultKeys: ['g b'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_MERGE_REQUESTS = {\n  id: 'project.goToMergeRequests',\n  description: __('Go to merge requests'),\n  defaultKeys: ['g m'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_PIPELINES = {\n  id: 'project.goToPipelines',\n  description: __('Go to pipelines'),\n  defaultKeys: ['g p'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_JOBS = {\n  id: 'project.goToJobs',\n  description: __('Go to jobs'),\n  defaultKeys: ['g j'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_ENVIRONMENTS = {\n  id: 'project.goToEnvironments',\n  description: __('Go to environments'),\n  defaultKeys: ['g e'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_KUBERNETES = {\n  id: 'project.goToKubernetes',\n  description: __('Go to kubernetes'),\n  defaultKeys: ['g k'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_SNIPPETS = {\n  id: 'project.goToSnippets',\n  description: __('Go to snippets'),\n  defaultKeys: ['g s'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_WIKI = {\n  id: 'project.goToWiki',\n  description: __('Go to wiki'),\n  defaultKeys: ['g w'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const GO_TO_PROJECT_WEBIDE = {\n  id: 'project.goToWebIDE',\n  description: __('Open in Web IDE'),\n  defaultKeys: ['.'],\n};\n\nexport const PROJECT_FILES_MOVE_SELECTION_UP = {\n  id: 'projectFiles.moveSelectionUp',\n  description: __('Move selection up'),\n  defaultKeys: ['up'],\n};\n\nexport const PROJECT_FILES_MOVE_SELECTION_DOWN = {\n  id: 'projectFiles.moveSelectionDown',\n  description: __('Move selection down'),\n  defaultKeys: ['down'],\n};\n\nexport const PROJECT_FILES_OPEN_SELECTION = {\n  id: 'projectFiles.openSelection',\n  description: __('Open Selection'),\n  defaultKeys: ['enter'],\n};\n\nexport const PROJECT_FILES_GO_BACK = {\n  id: 'projectFiles.goBack',\n  description: __('Go back (while searching for files)'),\n  defaultKeys: ['esc'],\n};\n\nexport const PROJECT_FILES_GO_TO_PERMALINK = {\n  id: 'projectFiles.goToFilePermalink',\n  description: __('Go to file permalink (while viewing a file)'),\n  defaultKeys: ['y'],\n};\n\nexport const PROJECT_FILES_GO_TO_COMPARE = {\n  id: 'projectFiles.goToCompare',\n  description: __('Compare Branches'),\n  defaultKeys: ['shift+c'],\n};\n\nexport const ISSUABLE_COMMENT_OR_REPLY = {\n  id: 'issuables.commentReply',\n  description: __('Comment/Reply (quoting selected text)'),\n  defaultKeys: ['r'],\n};\n\nexport const ISSUABLE_EDIT_DESCRIPTION = {\n  id: 'issuables.editDescription',\n  description: __('Edit description'),\n  defaultKeys: ['e'],\n};\n\nexport const ISSUABLE_CHANGE_LABEL = {\n  id: 'issuables.changeLabel',\n  description: __('Change label'),\n  defaultKeys: ['l'],\n};\n\nexport const ISSUABLE_COPY_REF = {\n  id: 'issuables.copyIssuableRef',\n  description: __('Copy reference'),\n  defaultKeys: ['c r'], // eslint-disable-line @gitlab/require-i18n-strings\n};\n\nexport const ISSUE_MR_CHANGE_ASSIGNEE = {\n  id: 'issuesMRs.changeAssignee',\n  description: __('Change assignee'),\n  defaultKeys: ['a'],\n};\n\nexport const ISSUE_MR_CHANGE_MILESTONE = {\n  id: 'issuesMRs.changeMilestone',\n  description: __('Change milestone'),\n  defaultKeys: ['m'],\n};\n\nexport const MR_NEXT_FILE_IN_DIFF = {\n  id: 'mergeRequests.nextFileInDiff',\n  description: __('Next file in diff'),\n  defaultKeys: [']', 'j'],\n};\n\nexport const MR_PREVIOUS_FILE_IN_DIFF = {\n  id: 'mergeRequests.previousFileInDiff',\n  description: __('Previous file in diff'),\n  defaultKeys: ['[', 'k'],\n};\n\nexport const MR_GO_TO_FILE = {\n  id: 'mergeRequests.goToFile',\n  description: __('Go to file'),\n  defaultKeys: ['mod+p', 't'],\n  customizable: false,\n};\n\nexport const MR_TOGGLE_FILE_BROWSER = {\n  id: 'mergeRequests.toggleFileBrowser',\n  description: __('Toggle file browser'),\n  defaultKeys: ['f'],\n  customizable: false,\n};\n\nexport const MR_ADD_TO_REVIEW = {\n  id: 'mergeRequests.addToReview',\n  description: __('Add your comment to a review'),\n  defaultKeys: ['mod+enter'],\n  customizable: false,\n};\n\nexport const MR_ADD_COMMENT_NOW = {\n  id: 'mergeRequests.addCommentNow',\n  description: __('Publish your comment immediately'),\n  defaultKeys: ['shift+mod+enter'],\n  customizable: false,\n};\n\nexport const MR_NEXT_UNRESOLVED_DISCUSSION = {\n  id: 'mergeRequests.nextUnresolvedDiscussion',\n  description: __('Next unresolved thread'),\n  defaultKeys: ['n'],\n};\n\nexport const MR_PREVIOUS_UNRESOLVED_DISCUSSION = {\n  id: 'mergeRequests.previousUnresolvedDiscussion',\n  description: __('Previous unresolved thread'),\n  defaultKeys: ['p'],\n};\n\nexport const MR_COPY_SOURCE_BRANCH_NAME = {\n  id: 'mergeRequests.copySourceBranchName',\n  description: __('Copy source branch name'),\n  defaultKeys: ['b'],\n};\n\nexport const MR_EXPAND_ALL_FILES = {\n  id: 'mergeRequests.expandAllFiles',\n  description: __('Expand all files'),\n  defaultKeys: [';'],\n};\n\nexport const MR_COLLAPSE_ALL_FILES = {\n  id: 'mergeRequests.collapseAllFiles',\n  description: __('Collapse all files'),\n  // eslint-disable-next-line @gitlab/require-i18n-strings\n  defaultKeys: ['shift+;'],\n};\n\nexport const MR_COMMITS_NEXT_COMMIT = {\n  id: 'mergeRequestCommits.nextCommit',\n  description: __('Next commit'),\n  defaultKeys: ['c'],\n};\n\nexport const MR_COMMITS_PREVIOUS_COMMIT = {\n  id: 'mergeRequestCommits.previousCommit',\n  description: __('Previous commit'),\n  defaultKeys: ['x'],\n};\n\nexport const ISSUE_NEXT_DESIGN = {\n  id: 'issues.nextDesign',\n  description: __('Next design'),\n  defaultKeys: ['right'],\n};\n\nexport const ISSUE_PREVIOUS_DESIGN = {\n  id: 'issues.previousDesign',\n  description: __('Previous design'),\n  defaultKeys: ['left'],\n};\n\nexport const ISSUE_CLOSE_DESIGN = {\n  id: 'issues.closeDesign',\n  description: __('Close design'),\n  defaultKeys: ['esc'],\n};\n\nexport const SIDEBAR_CLOSE_WIDGET = {\n  id: 'sidebar.closeWidget',\n  description: __('Close sidebar widget'),\n  defaultKeys: ['esc'],\n};\n\n/**\n * Legacy Web IDE uses the same shortcuts as MR_GO_TO_FILE, from this shared component:\n * https://gitlab.com/gitlab-org/gitlab/-/blob/f3e807cdff5cf25765894163b4e92f8b2bcf8a68/app/assets/javascripts/vue_shared/components/file_finder/index.vue#L6\n */\nconst WEB_IDE_GO_TO_FILE = {\n  id: 'webIDE.goToFile',\n  description: __('Go to file'),\n  defaultKeys: ['mod+p', 't'],\n  customizable: false /* customize MR_GO_TO_FILE instead */,\n};\n\n/**\n * Legacy Web IDE uses @keydown.ctrl.enter and @keydown.meta.enter events here:\n * https://gitlab.com/gitlab-org/gitlab/-/blob/f3e807cdff5cf25765894163b4e92f8b2bcf8a68/app/assets/javascripts/ide/components/commit_sidebar/message_field.vue#L122-123\n */\nconst WEB_IDE_COMMIT = {\n  id: 'webIDE.commit',\n  description: __('Commit (when editing commit message)'),\n  defaultKeys: ['mod+enter'],\n  customizable: false,\n};\n// All keybinding groups\nconst GLOBAL_SHORTCUTS_GROUP = {\n  id: 'globalShortcuts',\n  name: __('Global Shortcuts'),\n  keybindings: [\n    TOGGLE_KEYBOARD_SHORTCUTS_DIALOG,\n    GO_TO_YOUR_PROJECTS,\n    GO_TO_YOUR_GROUPS,\n    GO_TO_ACTIVITY_FEED,\n    GO_TO_MILESTONE_LIST,\n    GO_TO_YOUR_SNIPPETS,\n    START_SEARCH,\n    FOCUS_FILTER_BAR,\n    GO_TO_YOUR_ISSUES,\n    GO_TO_YOUR_MERGE_REQUESTS,\n    GO_TO_YOUR_REVIEW_REQUESTS,\n    GO_TO_YOUR_TODO_LIST,\n    TOGGLE_PERFORMANCE_BAR,\n    HIDE_APPEARING_CONTENT,\n    TOGGLE_SUPER_SIDEBAR,\n  ],\n};\n\nexport const EDITING_SHORTCUTS_GROUP = {\n  id: 'editing',\n  name: __('Editing'),\n  keybindings: [\n    BOLD_TEXT,\n    ITALIC_TEXT,\n    STRIKETHROUGH_TEXT,\n    LINK_TEXT,\n    TOGGLE_MARKDOWN_PREVIEW,\n    FIND_AND_REPLACE,\n    EDIT_RECENT_COMMENT,\n    SAVE_CHANGES,\n  ],\n};\n\nconst WIKI_SHORTCUTS_GROUP = {\n  id: 'wiki',\n  name: __('Wiki'),\n  keybindings: [EDIT_WIKI_PAGE],\n};\n\nconst REPOSITORY_GRAPH_SHORTCUTS_GROUP = {\n  id: 'repositoryGraph',\n  name: __('Repository Graph'),\n  keybindings: [\n    REPO_GRAPH_SCROLL_LEFT,\n    REPO_GRAPH_SCROLL_RIGHT,\n    REPO_GRAPH_SCROLL_UP,\n    REPO_GRAPH_SCROLL_DOWN,\n    REPO_GRAPH_SCROLL_TOP,\n    REPO_GRAPH_SCROLL_BOTTOM,\n  ],\n};\n\nconst PROJECT_SHORTCUTS_GROUP = {\n  id: 'project',\n  name: __('Project'),\n  keybindings: [\n    GO_TO_PROJECT_OVERVIEW,\n    GO_TO_PROJECT_ACTIVITY_FEED,\n    GO_TO_PROJECT_RELEASES,\n    GO_TO_PROJECT_FILES,\n    START_SEARCH_PROJECT_FILE,\n    GO_TO_PROJECT_COMMITS,\n    GO_TO_PROJECT_REPO_GRAPH,\n    GO_TO_PROJECT_REPO_CHARTS,\n    GO_TO_PROJECT_ISSUES,\n    NEW_ISSUE,\n    GO_TO_PROJECT_ISSUE_BOARDS,\n    GO_TO_PROJECT_MERGE_REQUESTS,\n    GO_TO_PROJECT_PIPELINES,\n    GO_TO_PROJECT_JOBS,\n    GO_TO_PROJECT_ENVIRONMENTS,\n    GO_TO_PROJECT_KUBERNETES,\n    GO_TO_PROJECT_SNIPPETS,\n    GO_TO_PROJECT_WIKI,\n    GO_TO_PROJECT_WEBIDE,\n  ],\n};\n\nconst PROJECT_FILES_SHORTCUTS_GROUP = {\n  id: 'projectFiles',\n  name: __('Project Files'),\n  keybindings: [\n    PROJECT_FILES_MOVE_SELECTION_UP,\n    PROJECT_FILES_MOVE_SELECTION_DOWN,\n    PROJECT_FILES_OPEN_SELECTION,\n    PROJECT_FILES_GO_BACK,\n    PROJECT_FILES_GO_TO_PERMALINK,\n    PROJECT_FILES_GO_TO_COMPARE,\n  ],\n};\n\nconst ISSUABLE_SHORTCUTS_GROUP = {\n  id: 'issuables',\n  name: __('Epics, issues, and merge requests'),\n  keybindings: [\n    ISSUABLE_COMMENT_OR_REPLY,\n    ISSUABLE_EDIT_DESCRIPTION,\n    ISSUABLE_CHANGE_LABEL,\n    ISSUABLE_COPY_REF,\n  ],\n};\n\nconst ISSUE_MR_SHORTCUTS_GROUP = {\n  id: 'issuesMRs',\n  name: __('Issues and merge requests'),\n  keybindings: [ISSUE_MR_CHANGE_ASSIGNEE, ISSUE_MR_CHANGE_MILESTONE],\n};\n\nconst MR_SHORTCUTS_GROUP = {\n  id: 'mergeRequests',\n  name: __('Merge requests'),\n  keybindings: [\n    MR_NEXT_FILE_IN_DIFF,\n    MR_PREVIOUS_FILE_IN_DIFF,\n    MR_GO_TO_FILE,\n    MR_NEXT_UNRESOLVED_DISCUSSION,\n    MR_PREVIOUS_UNRESOLVED_DISCUSSION,\n    MR_COPY_SOURCE_BRANCH_NAME,\n    MR_TOGGLE_FILE_BROWSER,\n    MR_ADD_TO_REVIEW,\n    MR_ADD_COMMENT_NOW,\n  ],\n};\n\nconst MR_COMMITS_SHORTCUTS_GROUP = {\n  id: 'mergeRequestCommits',\n  name: __('Merge request commits'),\n  keybindings: [MR_COMMITS_NEXT_COMMIT, MR_COMMITS_PREVIOUS_COMMIT],\n};\n\nconst ISSUES_SHORTCUTS_GROUP = {\n  id: 'issues',\n  name: __('Issues'),\n  keybindings: [ISSUE_NEXT_DESIGN, ISSUE_PREVIOUS_DESIGN, ISSUE_CLOSE_DESIGN],\n};\n\nconst WEB_IDE_SHORTCUTS_GROUP = {\n  id: 'webIDE',\n  name: __('Legacy Web IDE'),\n  keybindings: [WEB_IDE_GO_TO_FILE, WEB_IDE_COMMIT],\n};\n\nexport const MISC_SHORTCUTS_GROUP = {\n  id: 'misc',\n  name: __('Miscellaneous'),\n  keybindings: [TOGGLE_CANARY],\n};\n\n/** All keybindings, grouped and ordered with descriptions */\nexport const keybindingGroups = [\n  GLOBAL_SHORTCUTS_GROUP,\n  EDITING_SHORTCUTS_GROUP,\n  WIKI_SHORTCUTS_GROUP,\n  REPOSITORY_GRAPH_SHORTCUTS_GROUP,\n  PROJECT_SHORTCUTS_GROUP,\n  PROJECT_FILES_SHORTCUTS_GROUP,\n  ISSUABLE_SHORTCUTS_GROUP,\n  ISSUE_MR_SHORTCUTS_GROUP,\n  MR_SHORTCUTS_GROUP,\n  MR_COMMITS_SHORTCUTS_GROUP,\n  ISSUES_SHORTCUTS_GROUP,\n  WEB_IDE_SHORTCUTS_GROUP,\n  MISC_SHORTCUTS_GROUP,\n];\n\n/**\n * Gets keyboard shortcuts associated with a command\n *\n * @param {Object} command The command object. All command objects are\n *     available as imports from this file.\n * @param {string} command.id\n * @param {string[]} command.defaultKeys\n * @param {boolean} [command.customizable]\n *\n * @returns {string[]} An array of keyboard shortcut strings bound to the command\n *\n * @example\n * import { keysFor, TOGGLE_PERFORMANCE_BAR } from '~/behaviors/shortcuts/keybindings'\n *\n * Mousetrap.bind(keysFor(TOGGLE_PERFORMANCE_BAR), handler);\n */\nexport const keysFor = (command) => {\n  if (!isCustomizable(command)) {\n    // if the command is defined with `customizable: false`,\n    // don't allow this command to be customized.\n    return command.defaultKeys;\n  }\n\n  return getCustomizations()[command.id] || command.defaultKeys;\n};\n","import $ from 'jquery';\nimport { flatten } from 'lodash';\nimport Vue from 'vue';\nimport { InternalEvents } from '~/tracking';\nimport { FIND_FILE_SHORTCUT_CLICK } from '~/tracking/constants';\nimport { Mousetrap, addStopCallback } from '~/lib/mousetrap';\nimport { getCookie, setCookie, parseBoolean } from '~/lib/utils/common_utils';\nimport { waitForElement } from '~/lib/utils/dom_utils';\nimport findAndFollowLink from '~/lib/utils/navigation_utility';\nimport { refreshCurrentPage } from '~/lib/utils/url_utility';\nimport {\n  keysFor,\n  TOGGLE_KEYBOARD_SHORTCUTS_DIALOG,\n  START_SEARCH,\n  START_SEARCH_PROJECT_FILE,\n  FOCUS_FILTER_BAR,\n  TOGGLE_PERFORMANCE_BAR,\n  HIDE_APPEARING_CONTENT,\n  TOGGLE_CANARY,\n  TOGGLE_MARKDOWN_PREVIEW,\n  FIND_AND_REPLACE,\n  GO_TO_YOUR_TODO_LIST,\n  GO_TO_ACTIVITY_FEED,\n  GO_TO_YOUR_ISSUES,\n  GO_TO_YOUR_MERGE_REQUESTS,\n  GO_TO_YOUR_PROJECTS,\n  GO_TO_YOUR_GROUPS,\n  GO_TO_MILESTONE_LIST,\n  GO_TO_YOUR_SNIPPETS,\n  GO_TO_YOUR_REVIEW_REQUESTS,\n} from './keybindings';\nimport { disableShortcuts, shouldDisableShortcuts } from './shortcuts_toggle';\n\n/**\n * The key used to save and fetch the local Mousetrap instance\n * attached to a `<textarea>` element using `jQuery.data`\n */\nexport const LOCAL_MOUSETRAP_DATA_KEY = 'local-mousetrap-instance';\n\n/**\n * Gets a mapping of toolbar button => keyboard shortcuts\n * associated to the given markdown editor `<textarea>` element\n *\n * @param {HTMLTextAreaElement} $textarea The jQuery-wrapped `<textarea>`\n * element to extract keyboard shortcuts from\n *\n * @returns A Map with keys that are jQuery-wrapped toolbar buttons\n * (i.e. `$toolbarBtn`) and values that are arrays of string\n * keyboard shortcuts (e.g. `['command+k', 'ctrl+k]`).\n */\nfunction getToolbarBtnToShortcutsMap($textarea) {\n  const $allToolbarBtns = $textarea.closest('.md-area').find('.js-md');\n  const map = new Map();\n\n  $allToolbarBtns.each(function attachToolbarBtnHandler() {\n    const $toolbarBtn = $(this);\n    const keyboardShortcuts = $toolbarBtn.data('md-shortcuts');\n\n    if (keyboardShortcuts?.length) {\n      map.set($toolbarBtn, keyboardShortcuts);\n    }\n  });\n\n  return map;\n}\n\nexport default class Shortcuts {\n  constructor() {\n    if (process.env.NODE_ENV !== 'production' && this.constructor !== Shortcuts) {\n      // eslint-disable-next-line @gitlab/require-i18n-strings\n      throw new Error('Shortcuts cannot be subclassed.');\n    }\n\n    this.extensions = new Map();\n    this.onToggleHelp = this.onToggleHelp.bind(this);\n    this.helpModalElement = null;\n    this.helpModalVueInstance = null;\n\n    this.addAll([\n      [TOGGLE_KEYBOARD_SHORTCUTS_DIALOG, this.onToggleHelp],\n      [START_SEARCH_PROJECT_FILE, Shortcuts.focusSearchFile],\n      [START_SEARCH, Shortcuts.focusSearch],\n      [FOCUS_FILTER_BAR, this.focusFilter.bind(this)],\n      [TOGGLE_PERFORMANCE_BAR, Shortcuts.onTogglePerfBar],\n      [HIDE_APPEARING_CONTENT, Shortcuts.hideAppearingContent],\n      [TOGGLE_CANARY, Shortcuts.onToggleCanary],\n\n      [GO_TO_YOUR_TODO_LIST, () => findAndFollowLink('.shortcuts-todos')],\n      [GO_TO_ACTIVITY_FEED, () => findAndFollowLink('.dashboard-shortcuts-activity')],\n      [GO_TO_YOUR_ISSUES, () => findAndFollowLink('.dashboard-shortcuts-issues')],\n      [\n        GO_TO_YOUR_MERGE_REQUESTS,\n        () =>\n          findAndFollowLink(\n            '.dashboard-shortcuts-merge_requests, .js-merge-request-dashboard-shortcut',\n          ),\n      ],\n      [\n        GO_TO_YOUR_REVIEW_REQUESTS,\n        () =>\n          findAndFollowLink(\n            '.dashboard-shortcuts-review_requests, .js-merge-request-dashboard-shortcut',\n          ),\n      ],\n      [GO_TO_YOUR_PROJECTS, () => findAndFollowLink('.dashboard-shortcuts-projects')],\n      [GO_TO_YOUR_GROUPS, () => findAndFollowLink('.dashboard-shortcuts-groups')],\n      [GO_TO_MILESTONE_LIST, () => findAndFollowLink('.dashboard-shortcuts-milestones')],\n      [GO_TO_YOUR_SNIPPETS, () => findAndFollowLink('.dashboard-shortcuts-snippets')],\n\n      [TOGGLE_MARKDOWN_PREVIEW, Shortcuts.toggleMarkdownPreview],\n    ]);\n\n    addStopCallback((e, element, combo) =>\n      keysFor(TOGGLE_MARKDOWN_PREVIEW).includes(combo) ? false : undefined,\n    );\n\n    if (gon?.features?.findAndReplace) {\n      this.add(FIND_AND_REPLACE, Shortcuts.toggleFindAndReplaceBar);\n\n      addStopCallback((e, element, combo) =>\n        keysFor(FIND_AND_REPLACE).includes(combo) ? false : undefined,\n      );\n    }\n\n    $(document).on('click', '.js-shortcuts-modal-trigger', this.onToggleHelp);\n\n    if (shouldDisableShortcuts()) {\n      disableShortcuts();\n    }\n  }\n\n  /**\n   * Instantiate a legacy shortcut extension class.\n   *\n   * NOTE: The preferred approach for adding shortcuts is described in\n   * https://docs.gitlab.com/ee/development/fe_guide/keyboard_shortcuts.html.\n   * This method is only for existing legacy shortcut classes.\n   *\n   * A shortcut extension class packages up several shortcuts and behaviors for\n   * a page or set of pages. They are considered legacy because they usually do\n   * not follow modern best practices. For instance, they may hook into the UI\n   * in brittle ways, e.g.. querySelectors.\n   *\n   * Extension classes can declare dependencies on other shortcut extension\n   * classes by listing them in a static `dependencies` property. This is\n   * essentially a reimplementation of the previous subclassing approach, but\n   * with idempotency: a shortcut extension class can now only be added at most\n   * one time.\n   *\n   * Extension classes are instantiated and given the Shortcuts singleton\n   * instance as their first argument. If the class constructor needs\n   * additional arguments, pass them via the second argument as an array.\n   *\n   * See https://gitlab.com/gitlab-org/gitlab/-/issues/392845 for more context.\n   *\n   * @param {Function} Extension The extension class to add/instantiate.\n   * @param {Array} [args] A list of additional args to pass to the extension\n   *     class constructor.\n   * @param {Set} [extensionsCurrentlyLoading] For internal use only. Do not\n   *     use.\n   * @returns The instantiated shortcut extension class.\n   */\n  addExtension(Extension, args = [], extensionsCurrentlyLoading = new Set()) {\n    extensionsCurrentlyLoading.add(Extension);\n\n    let instance = this.extensions.get(Extension);\n    if (!instance) {\n      for (const Dep of Extension.dependencies ?? []) {\n        if (extensionsCurrentlyLoading.has(Dep) || Dep === Shortcuts) {\n          // We've encountered a circular dependency, so stop recursing.\n          // eslint-disable-next-line no-continue\n          continue;\n        }\n\n        extensionsCurrentlyLoading.add(Dep);\n\n        this.addExtension(Dep, [], extensionsCurrentlyLoading);\n      }\n\n      instance = new Extension(this, ...args);\n      this.extensions.set(Extension, instance);\n    }\n\n    extensionsCurrentlyLoading.delete(Extension);\n    return instance;\n  }\n\n  /**\n   * Bind the keyboard shortcut(s) defined by the given command to the given\n   * callback.\n   *\n   * @param {Object} command A command object.\n   * @param {Function} callback The callback to call when the command's key\n   *     combo has been pressed.\n   * @returns {void}\n   */\n  // eslint-disable-next-line class-methods-use-this\n  add(command, callback) {\n    Mousetrap.bind(keysFor(command), callback);\n  }\n\n  /**\n   * Bind the keyboard shortcut(s) defined by the given commands to the given\n   * callbacks.\n   *\n   * @param {Array<[Object, Function]>} commandsAndCallbacks An array of\n   *     command/callback pairs.\n   * @returns {void}\n   */\n  addAll(commandsAndCallbacks) {\n    commandsAndCallbacks.forEach((commandAndCallback) => this.add(...commandAndCallback));\n  }\n\n  onToggleHelp(e) {\n    if (e?.preventDefault) {\n      e.preventDefault();\n    }\n\n    if (this.helpModalElement && this.helpModalVueInstance) {\n      this.helpModalVueInstance.$destroy();\n      this.helpModalElement.remove();\n      this.helpModalElement = null;\n      this.helpModalVueInstance = null;\n    } else {\n      this.helpModalElement = document.createElement('div');\n      document.body.append(this.helpModalElement);\n\n      this.helpModalVueInstance = new Vue({\n        el: this.helpModalElement,\n        components: {\n          ShortcutsHelp: () => import('./shortcuts_help.vue'),\n        },\n        render: (createElement) => {\n          return createElement('shortcuts-help', {\n            on: {\n              hidden: this.onToggleHelp,\n            },\n          });\n        },\n      });\n    }\n  }\n\n  static onTogglePerfBar(e) {\n    e.preventDefault();\n    const performanceBarCookieName = 'perf_bar_enabled';\n    if (parseBoolean(getCookie(performanceBarCookieName))) {\n      setCookie(performanceBarCookieName, 'false', { path: '/' });\n    } else {\n      setCookie(performanceBarCookieName, 'true', { path: '/' });\n    }\n    refreshCurrentPage();\n  }\n\n  static onToggleCanary(e) {\n    e.preventDefault();\n    const canaryCookieName = 'gitlab_canary';\n    const currentValue = parseBoolean(getCookie(canaryCookieName));\n    setCookie(canaryCookieName, (!currentValue).toString(), { expires: 365, path: '/' });\n    refreshCurrentPage();\n  }\n\n  static toggleMarkdownPreview(e) {\n    $(document).triggerHandler('markdown-preview:toggle', [e]);\n  }\n\n  static toggleFindAndReplaceBar(e) {\n    $(document).triggerHandler('markdown-editor:find-and-replace', [e]);\n  }\n\n  focusFilter(e) {\n    if (!this.filterInput) {\n      this.filterInput = $('input[type=search]', '.nav-controls');\n    }\n    this.filterInput.focus();\n    e.preventDefault();\n  }\n\n  static focusSearch(e) {\n    document.querySelector('#super-sidebar-search')?.click();\n    InternalEvents.trackEvent('press_keyboard_shortcut_to_activate_command_palette');\n\n    if (e.preventDefault) {\n      e.preventDefault();\n    }\n  }\n\n  static async focusSearchFile(e) {\n    if (e?.key) {\n      InternalEvents.trackEvent(FIND_FILE_SHORTCUT_CLICK);\n    }\n    e?.preventDefault();\n    document.querySelector('#super-sidebar-search')?.click();\n\n    const searchInput = await waitForElement('#super-sidebar-search-modal #search');\n    if (!searchInput) return;\n\n    const currentPath = document.querySelector('.js-repo-breadcrumbs')?.dataset.currentPath;\n\n    searchInput.value = `~${currentPath ? `${currentPath}/` : ''}`;\n    searchInput.dispatchEvent(new Event('input'));\n  }\n\n  static hideAppearingContent(e) {\n    const elements = document.querySelectorAll('.tooltip, .popover');\n\n    elements.forEach((element) => {\n      element.style.display = 'none';\n    });\n\n    if (e.preventDefault) {\n      e.preventDefault();\n    }\n  }\n\n  /**\n   * Initializes markdown editor shortcuts on the provided `<textarea>` element\n   *\n   * @param {JQuery} $textarea The jQuery-wrapped `<textarea>` element\n   * where markdown shortcuts should be enabled\n   * @param {Function} handler The handler to call when a\n   * keyboard shortcut is pressed inside the markdown `<textarea>`\n   */\n  static initMarkdownEditorShortcuts($textarea, handler) {\n    const toolbarBtnToShortcutsMap = getToolbarBtnToShortcutsMap($textarea);\n\n    const localMousetrap = new Mousetrap($textarea[0]);\n\n    // Save a reference to the local mousetrap instance on the <textarea>\n    // so that it can be retrieved when unbinding shortcut handlers\n    $textarea.data(LOCAL_MOUSETRAP_DATA_KEY, localMousetrap);\n\n    toolbarBtnToShortcutsMap.forEach((keyboardShortcuts, $toolbarBtn) => {\n      localMousetrap.bind(keyboardShortcuts, (e) => {\n        e.preventDefault();\n\n        handler($toolbarBtn);\n      });\n    });\n\n    // Get an array of all shortcut strings that have been added above\n    const allShortcuts = flatten([...toolbarBtnToShortcutsMap.values()]);\n\n    const originalStopCallback = Mousetrap.prototype.stopCallback;\n    localMousetrap.stopCallback = function newStopCallback(e, element, combo) {\n      if (allShortcuts.includes(combo)) {\n        return false;\n      }\n\n      return originalStopCallback.call(this, e, element, combo);\n    };\n  }\n\n  /**\n   * Removes markdown editor shortcut handlers originally attached\n   * with `initMarkdownEditorShortcuts`.\n   *\n   * Note: it is safe to call this function even if `initMarkdownEditorShortcuts`\n   * has _not_ yet been called on the given `<textarea>`.\n   *\n   * @param {JQuery} $textarea The jQuery-wrapped `<textarea>`\n   * to remove shortcut handlers from\n   */\n  static removeMarkdownEditorShortcuts($textarea) {\n    const localMousetrap = $textarea.data(LOCAL_MOUSETRAP_DATA_KEY);\n\n    if (localMousetrap) {\n      getToolbarBtnToShortcutsMap($textarea).forEach((keyboardShortcuts) => {\n        localMousetrap.unbind(keyboardShortcuts);\n      });\n    }\n  }\n}\n","import { Mousetrap } from '~/lib/mousetrap';\nimport 'mousetrap/plugins/pause/mousetrap-pause';\n\nconst shorcutsDisabledKey = 'shortcutsDisabled';\n\nexport const shouldDisableShortcuts = () => !window.gon.keyboard_shortcuts_enabled;\n\nexport function enableShortcuts() {\n  localStorage.setItem(shorcutsDisabledKey, false);\n  Mousetrap.unpause();\n}\n\nexport function disableShortcuts() {\n  localStorage.setItem(shorcutsDisabledKey, true);\n  Mousetrap.pause();\n}\n"],"sourceRoot":""}