'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _immutable = require('immutable');

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

var _presenter = require('./presenter');

var _presenter2 = _interopRequireDefault(_presenter);

var _makeEditable = require('../../../shared/functionality/makeEditable');

var _makeEditable2 = _interopRequireDefault(_makeEditable);

var _modifications = require('../../../../actions/modifications');

var modificationActions = _interopRequireWildcard(_modifications);

var _ui = require('../../../../actions/ui');

var _alerts = require('../../../../actions/alerts');

var _quizzes = require('../../../../../building/api/quizzes');

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function mapStateToProps(state, props) {
  var errorsShowing = state.get('errorsShowing', (0, _immutable.Map)());
  var errorsAreShowing = errorsShowing.get(props.guid);
  return {
    errorsAreShowing: errorsAreShowing
  };
}

var mapDispatchToProps = {
  addError: _alerts.addError,
  changeQuizEntryProperties: modificationActions.changeQuizEntryProperties,
  interactionFileUpload: _quizzes.interactionFileUpload,
  occludeQuizEntries: _ui.occludeQuizEntries,
  screenreaderNotification: _alerts.screenreaderNotification
};

exports.default = (0, _makeEditable2.default)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_presenter2.default));