"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactRedux = require("react-redux");
var _AdvancedSearchBuilder = _interopRequireDefault(require("../../components/search/AdvancedSearchBuilder"));
var _configHelpers = require("../../helpers/configHelpers");
var _reducers = require("../../reducers");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const mapStateToProps = (state, ownProps) => {
  const {
    recordType
  } = ownProps;
  const groupOptions = (0, _reducers.getOptionList)(state, (0, _configHelpers.getRecordGroupOptionListName)(recordType));
  return {
    hasChildGroups: groupOptions && groupOptions.length > 0,
    preferredCondition: (0, _reducers.getSearchCondition)(state, recordType)
  };
};
var _default = (0, _reactRedux.connect)(mapStateToProps)(_AdvancedSearchBuilder.default);
exports.default = _default;