text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = void 0;
  
  var _react = _interopRequireDefault(require("react"));
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  function fillRef(node, ref) {
    if (typeof ref === 'function') {
      ref(node);
    } else if (ref && _typeof(ref) === 'object') {
      ref.current = node;
    }
  }
  
  var Input = function Input(_ref, ref) {
    var prefixCls = _ref.prefixCls,
        id = _ref.id,
        inputElement = _ref.inputElement,
        disabled = _ref.disabled,
        tabIndex = _ref.tabIndex,
        autoFocus = _ref.autoFocus,
        editable = _ref.editable,
        accessibilityIndex = _ref.accessibilityIndex,
        value = _ref.value,
        _onKeyDown = _ref.onKeyDown,
        _onMouseDown = _ref.onMouseDown,
        _onChange = _ref.onChange,
        open = _ref.open;
  
    var inputNode = inputElement || _react.default.createElement("input", null);
  
    var _inputNode = inputNode,
        originRef = _inputNode.ref,
        _inputNode$props = _inputNode.props,
        onOriginKeyDown = _inputNode$props.onKeyDown,
        onOriginChange = _inputNode$props.onChange,
        onOriginMouseDown = _inputNode$props.onMouseDown,
        style = _inputNode$props.style;
  
    function inputRef(node) {
      fillRef(node, ref);
      fillRef(node, originRef);
    }
  
    inputNode = _react.default.cloneElement(inputNode, {
      id: id,
      ref: inputRef,
      disabled: disabled,
      tabIndex: tabIndex,
      autoComplete: 'off',
      autoFocus: autoFocus,
      className: "".concat(prefixCls, "-selection-search-input"),
      style: _objectSpread({}, style, {
        opacity: editable ? null : 0
      }),
      role: 'combobox',
      'aria-expanded': open,
      'aria-haspopup': 'listbox',
      'aria-owns': "".concat(id, "_list"),
      'aria-autocomplete': 'list',
      'aria-controls': "".concat(id, "_list"),
      'aria-activedescendant': "".concat(id, "_list_").concat(accessibilityIndex),
      value: editable ? value : '',
      readOnly: !editable,
      onKeyDown: function onKeyDown(event) {
        _onKeyDown(event);
  
        if (onOriginKeyDown) {
          onOriginKeyDown(event);
        }
      },
      onMouseDown: function onMouseDown(event) {
        _onMouseDown(event);
  
        if (onOriginMouseDown) {
          onOriginMouseDown(event);
        }
      },
      onChange: function onChange(event) {
        _onChange(event);
  
        if (onOriginChange) {
          onOriginChange(event);
        }
      }
    });
    return inputNode;
  };
  
  var RefInput = _react.default.forwardRef(Input);
  
  RefInput.displayName = 'Input';
  var _default = RefInput;
  exports.default = _default;