"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _ComponentContainer = require("../../../../../Framework/ComponentContainer");
var _ProductPartsList = _interopRequireDefault(require("../../Components/ProductPartsList"));
var _configuration = require("../../../../configuration");
var _CallToAction = _interopRequireDefault(require("../../../../Shared/Components/CallToAction"));
var _memoize = _interopRequireDefault(require("../../../../../Utils/Function/memoize"));
var _Actions = require("../../../../Reducers/Configurator/Actions");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var removeHiddenComponents = (0, _memoize["default"])(function (components) {
  return components.filter(function (_ref) {
    var hiddenInFrontend = _ref.hiddenInFrontend;
    return !hiddenInFrontend;
  });
});
var mapStateToProps = function mapStateToProps(_ref2) {
  var configurator = _ref2.configurator,
    device = _ref2.device,
    ui = _ref2.ui;
  var dock = (0, _configuration.getConf)('dock');
  return {
    Component: _ProductPartsList["default"],
    CallToActionComponent: (0, _configuration.getComponent)('StartHere') || _CallToAction["default"],
    displaySwitchedOptions: (0, _configuration.getConf)('displaySwitchedOptions'),
    optionclassifications: removeHiddenComponents(configurator.filteredOptionclassifications),
    selectedoptionclassification: configurator.selectedoptionclassification,
    showStartHere: ui.visibilityMap.startHere,
    optionListVisible: ui.visibilityMap.optionlist,
    vertical: dock ? dock === 'left' : device.screen.orientation === 'landscape'
  };
};
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
  return {
    onCloseSelectedPart: function onCloseSelectedPart(optionClassification) {
      return dispatch((0, _Actions.applyOptionInputText)(optionClassification));
    }
  };
};
var _default = exports["default"] = (0, _ComponentContainer.containerConnect)(mapStateToProps, mapDispatchToProps);