"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _react = _interopRequireDefault(require("react"));
var _TestBackend = _interopRequireDefault(require("../../../DragDropContextProvider/TestBackend"));
var _DragDropContextProvider = _interopRequireDefault(require("../../../DragDropContextProvider"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/DragAndDrop/Draggable/components/DraggableManager.jsx";
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(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; })(); }
// Apply TestBackend for drag and drop on test environment
var isTestEnv = process.env.NODE_ENV === 'test';
var DraggableManager = /*#__PURE__*/function (_React$Component) {
  function DraggableManager() {
    (0, _classCallCheck2["default"])(this, DraggableManager);
    return _callSuper(this, DraggableManager, arguments);
  }
  (0, _inherits2["default"])(DraggableManager, _React$Component);
  return (0, _createClass2["default"])(DraggableManager, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
        dataHook = _this$props.dataHook,
        children = _this$props.children,
        backendOptions = _this$props.backendOptions;
      return /*#__PURE__*/_react["default"].createElement("div", {
        "data-hook": dataHook,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 13,
          columnNumber: 7
        }
      }, /*#__PURE__*/_react["default"].createElement(_DragDropContextProvider["default"], {
        backend: isTestEnv ? _TestBackend["default"] : undefined,
        backendOptions: backendOptions,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 14,
          columnNumber: 9
        }
      }, children));
    }
  }]);
}(_react["default"].Component);
var _default = exports["default"] = DraggableManager;