"use strict";

exports.__esModule = true;
exports.command = void 0;
require("core-js/modules/es.array.includes.js");
require("core-js/modules/es.string.includes.js");
var _event = require("../../../helpers/dom/event");
var command = {
  name: 'editorOpen',
  callback: function callback(hot, event, keys) {
    var editorManager = hot._getEditorManager();
    var _hot$getSelectedRange = hot.getSelectedRangeLast(),
      highlight = _hot$getSelectedRange.highlight;
    if (highlight.isHeader()) {
      return;
    }
    if (hot.getSettings().enterBeginsEditing) {
      if (editorManager.cellProperties.readOnly) {
        editorManager.moveSelectionAfterEnter();
      } else {
        editorManager.openEditor(null, event, true);
      }
    } else {
      editorManager.moveSelectionAfterEnter(keys.includes('shift'));
    }
    (0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor
  }
};
exports.command = command;