"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _immutable = require("immutable");

var _redux = require("redux");

var _reactRedux = require("../../../../common/react-redux");

var _presenter = _interopRequireDefault(require("./presenter"));

var _disableDraggingOverride = _interopRequireDefault(require("../../../../common/components/shared/functionality/disableDraggingOverride"));

var _constants = require("@instructure/quiz-common/lib/constants");

function editingAddContentPopover(state) {
  return state.get('editing', (0, _immutable.Map)()).some(function (isEditing, componentKey) {
    return componentKey.includes(_constants.ADD_CONTENT_POPOVER_KEY) && isEditing;
  });
}

function mapStateToProps(state) {
  return {
    editingAddContentPopover: editingAddContentPopover(state)
  };
}

var _default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps), _disableDraggingOverride.default)(_presenter.default);

exports.default = _default;