"use strict";

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

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

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

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

var _errorsShowing = require("../../../../actions/errorsShowing");

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

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

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

function mapStateToProps(state, props) {
  // Error Related:
  var workingEntry = props.entry.getWorkingInstance();
  var isValid = props.isValid !== void 0 ? props.isValid : workingEntry.isValid();
  return {
    isValid: isValid
  };
}

var mapDispatchToProps = {
  clearNextQuizEntry: _modifications.clearNextQuizEntry,
  showError: _errorsShowing.showError,
  hideError: _errorsShowing.hideError,
  screenreaderNotification: _alerts.screenreaderNotification
};

var _default = (0, _makeEditable.default)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_presenter.default));

exports.default = _default;