"use strict";

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

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

var _redux = require("redux");

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

var _taking = require("../../../../selectors/taking");

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

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

var _taking2 = require("../../../../actions/taking");

var mapDispatchToProps = function mapDispatchToProps(dispatch) {
  return {
    screenreaderNotification: (0, _redux.bindActionCreators)(_alerts.screenreaderNotification, dispatch),
    updateTimerMinimized: (0, _redux.bindActionCreators)(_taking2.updateTimerMinimized, dispatch)
  };
};

var mapStateToProps = function mapStateToProps(state) {
  var timerData = (0, _taking.getTimerData)(state).toJS();
  var isTaking = (0, _taking.getIsTaking)(state);
  return {
    timerRunning: isTaking && timerData.timerRunning,
    timeLeftInSeconds: timerData.timeLeftInSeconds,
    timerMinimized: timerData.timerMinimized
  };
};

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

exports.default = _default;