import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
import React, { PureComponent } from "react";
import Operator from "./Operator";
import { Col } from "../utils";
var OperatorWrapper = /*#__PURE__*/function (_PureComponent) {
  function OperatorWrapper() {
    _classCallCheck(this, OperatorWrapper);
    return _callSuper(this, OperatorWrapper, arguments);
  }
  _inherits(OperatorWrapper, _PureComponent);
  return _createClass(OperatorWrapper, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
        config = _this$props.config,
        selectedField = _this$props.selectedField,
        selectedFieldSrc = _this$props.selectedFieldSrc,
        selectedFieldType = _this$props.selectedFieldType,
        selectedOperator = _this$props.selectedOperator,
        setOperator = _this$props.setOperator,
        selectedFieldId = _this$props.selectedFieldId,
        showOperator = _this$props.showOperator,
        showOperatorLabel = _this$props.showOperatorLabel,
        selectedFieldWidgetConfig = _this$props.selectedFieldWidgetConfig,
        readonly = _this$props.readonly,
        id = _this$props.id,
        groupId = _this$props.groupId;
      var operator = showOperator && /*#__PURE__*/React.createElement(Col, {
        key: "operators-for-" + selectedFieldId,
        className: "rule--operator"
      }, config.settings.showLabels && /*#__PURE__*/React.createElement("label", {
        className: "rule--label"
      }, config.settings.operatorLabel), /*#__PURE__*/React.createElement(Operator, {
        key: "operator",
        config: config,
        selectedField: selectedField,
        selectedFieldSrc: selectedFieldSrc,
        selectedFieldType: selectedFieldType,
        selectedFieldId: selectedFieldId,
        selectedOperator: selectedOperator,
        setOperator: setOperator,
        customProps: config.settings.customOperatorSelectProps,
        readonly: readonly,
        id: id,
        groupId: groupId
      }));
      var hiddenOperator = showOperatorLabel && /*#__PURE__*/React.createElement(Col, {
        key: "operators-for-" + selectedFieldId,
        className: "rule--operator"
      }, /*#__PURE__*/React.createElement("div", {
        className: "rule--operator-wrapper"
      }, config.settings.showLabels ? /*#__PURE__*/React.createElement("label", {
        className: "rule--label"
      }, "\xA0") : null, /*#__PURE__*/React.createElement("div", {
        className: "rule--operator-text-wrapper"
      }, /*#__PURE__*/React.createElement("span", {
        className: "rule--operator-text"
      }, selectedFieldWidgetConfig.operatorInlineLabel))));
      return [operator, hiddenOperator];
    }
  }]);
}(PureComponent);
export { OperatorWrapper as default };