"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useComponentsWithDefaults = exports.defaultComponentsMultiselect = exports.defaultComponents = void 0;
var _mergeRight2 = _interopRequireDefault(require("ramda/src/mergeRight"));
var _pipe2 = _interopRequireDefault(require("ramda/src/pipe"));
var _react = require("react");
var _ListItem = require("./ListItem");
var _Search = require("./Search");
var _Action = require("./Action");
var _SelectedValue = require("./SelectedValue");
var _ListItemMultiple = require("./ListItemMultiple");
var _SelectedValueMultiple = require("./SelectedValueMultiple");
var _List = require("./List");
var _ListFullScreen = require("./ListFullScreen");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultComponents = exports.defaultComponents = {
  ListItem: _ListItem.ListItem,
  List: _List.List,
  ListFullScreen: _ListFullScreen.ListFullScreen,
  Search: _Search.Search,
  SelectedValue: _SelectedValue.SelectedValue,
  Action: _Action.Action
};
var defaultComponentsMultiselect = exports.defaultComponentsMultiselect = {
  ListItem: _ListItemMultiple.ListItem,
  List: _List.List,
  ListFullScreen: _ListFullScreen.ListFullScreen,
  Search: _Search.Search,
  SelectedValue: _SelectedValueMultiple.SelectedValue,
  Action: _Action.Action
};
var useComponentsWithDefaults = exports.useComponentsWithDefaults = function useComponentsWithDefaults() {
  var components = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
    multiselect: false
  };
  return (0, _react.useMemo)(function () {
    return (0, _pipe2.default)((0, _mergeRight2.default)(options.multiselect ? defaultComponentsMultiselect : defaultComponents))(components);
  }, [components, options.multiselect]);
};