"use strict";

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

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

var _SearchResultPage = _interopRequireDefault(require("../../components/pages/SearchResultPage"));

var _searchPage = require("../../actions/searchPage");

var _prefs = require("../../actions/prefs");

var _searchNames = require("../../constants/searchNames");

var _search = require("../../actions/search");

var _reducers = require("../../reducers");

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

const mapStateToProps = state => ({
  isSidebarOpen: (0, _reducers.isSearchResultSidebarOpen)(state),
  perms: (0, _reducers.getUserPerms)(state),
  preferredPageSize: (0, _reducers.getSearchResultPagePageSize)(state),
  selectedItems: (0, _reducers.getSearchSelectedItems)(state, _searchNames.SEARCH_RESULT_PAGE_SEARCH_NAME)
});

const mapDispatchToProps = {
  search: _search.search,
  setSearchPageAdvanced: _searchPage.setSearchPageAdvanced,
  setSearchPageKeyword: _searchPage.setSearchPageKeyword,
  setPreferredPageSize: _prefs.setSearchResultPagePageSize,
  setAllItemsSelected: _search.setAllResultItemsSelected,
  onItemSelectChange: _search.setResultItemSelected
};

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

exports.default = _default;