"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

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

var _redux = require("redux");

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

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

var modalActions = _interopRequireWildcard(require("../../../common/actions/modal"));

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

var _interactionTypes = require("../../../common/api/interactionTypes");

var _stateHelper = _interopRequireDefault(require("../../../common/util/stateHelper"));

var _modalHelpers = require("../../../common/util/modalHelpers");

var _featureCheck = require("../../../common/util/featureCheck");

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

function mapStateToProps(state, props) {
  return {
    modalOpen: state.getIn(['modal', 'isOpen']) === _constants.ADD_BANK_ENTRY_MODAL,
    modalTrigger: (0, _modalHelpers.getModalTrigger)(state),
    interactionTypes: _stateHelper.default.interactionTypes(),
    stimulusBankingOn: (0, _featureCheck.featureOn)('stimulus_banking')
  };
}

var mapDispatchToProps = function mapDispatchToProps(dispatch) {
  return {
    closeModal: (0, _redux.bindActionCreators)(modalActions.closeModal, dispatch),
    createBankItem: (0, _redux.bindActionCreators)(_modifications.createBankItem, dispatch),
    getInteractionTypes: (0, _redux.bindActionCreators)(_interactionTypes.interactionTypeFetch, dispatch)
  };
};

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

exports.default = _default;