"use strict";var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;exports.__esModule = true;exports.extractAction = exports.commaAliases = exports.CURRENCY_INPUT_ACTIONS = void 0;var Keyboard = _interopRequireWildcard(require("../../lib/events/keyboard/identifiers"));
var _extractKeyboardAction = require("../../lib/extractKeyboardAction");

var commaAliases = exports.commaAliases = [
Keyboard.isCodeComma,
Keyboard.isCodePeriod,
Keyboard.isCodeSlash,
Keyboard.isCodeBackslash,
Keyboard.isCodeIntlBackslash,
Keyboard.isCodeNumpadDivide];


var CURRENCY_INPUT_ACTIONS = exports.CURRENCY_INPUT_ACTIONS = {
  Unknown: 0,
  Ignore: 1,

  MoveCursorLeft: 11,
  MoveCursorRight: 12,
  Home: 13,
  End: 14,

  ExtendSelectionLeft: 21,
  ExtendSelectionRight: 22,
  FullSelection: 23,
  ExtendSelectionToStart: 24,
  ExtendSelectionToEnd: 25,

  Backspace: 31,
  Delete: 32,
  Submit: 33,

  Comma: 34
};

var extractAction = exports.extractAction = new _extractKeyboardAction.KeyboardActionExctracterBuilder().
add(CURRENCY_INPUT_ACTIONS.Submit, Keyboard.isKeyEnter).
add(CURRENCY_INPUT_ACTIONS.ExtendSelectionLeft, Keyboard.isModShift(Keyboard.isKeyArrowLeft)).
add(CURRENCY_INPUT_ACTIONS.ExtendSelectionRight, Keyboard.isModShift(Keyboard.isKeyArrowRight)).
add(CURRENCY_INPUT_ACTIONS.FullSelection, Keyboard.isShortcutSelectAll).
add(CURRENCY_INPUT_ACTIONS.ExtendSelectionToStart, Keyboard.isModShift(Keyboard.isKeyHome)).
add(CURRENCY_INPUT_ACTIONS.ExtendSelectionToEnd, Keyboard.isModShift(Keyboard.isKeyEnd)).
add(CURRENCY_INPUT_ACTIONS.MoveCursorLeft, Keyboard.isKeyArrowLeft).
add(CURRENCY_INPUT_ACTIONS.MoveCursorRight, Keyboard.isKeyArrowRight).
add(CURRENCY_INPUT_ACTIONS.Home, Keyboard.isUnmodified(Keyboard.isKeyHome)).
add(CURRENCY_INPUT_ACTIONS.End, Keyboard.isUnmodified(Keyboard.isKeyEnd)).
add(CURRENCY_INPUT_ACTIONS.Backspace, Keyboard.isKeyBackspace).
add(CURRENCY_INPUT_ACTIONS.Delete, Keyboard.isKeyDelete).
add(CURRENCY_INPUT_ACTIONS.Ignore, function (e) {return Keyboard.isModified()(e) || Keyboard.isKeyTab(e);}).
add(CURRENCY_INPUT_ACTIONS.Comma, Keyboard.someKeys.apply(Keyboard, commaAliases)).
build(CURRENCY_INPUT_ACTIONS.Unknown);