"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getSuperProps = void 0;
var _Core = require("../Core.constants");
const getSuperProps = function () {
  var _tracking$compareTrac;
  let {
    store = {},
    engineVersion
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const {
    config = {},
    components = {},
    club = {},
    finder: {
      place: {
        id: [placeHotelId] = [],
        isHotel
      } = {}
    } = {},
    hotel = {},
    id,
    type,
    urlParams = {}
  } = store;
  const {
    tracking = {}
  } = config;
  const hotelId = isHotel ? placeHotelId : hotel.id;
  const {
    name,
    showMiraiTwin
  } = (hotel.features || {})[hotel.id] || {};
  const props = {
    chain_id: type === _Core.TYPE.CHAIN ? "".concat(id) : 'independent',
    engine_version: engineVersion,
    feature_3d: showMiraiTwin,
    feature_loyalty: !!(club !== null && club !== void 0 && club.active),
    feature_price_comp: !!(tracking !== null && tracking !== void 0 && (_tracking$compareTrac = tracking.compareTracking) !== null && _tracking$compareTrac !== void 0 && _tracking$compareTrac.length),
    feature_sarai: !!components.chat,
    hotel_id: hotelId,
    hotel_name: name,
    is_internal_user: urlParams.internalUser === 'true'
  };
  return Object.fromEntries(Object.entries(props).filter(_ref => {
    let [, value] = _ref;
    return value !== undefined && value !== '';
  }));
};
exports.getSuperProps = getSuperProps;
//# sourceMappingURL=getSuperProps.js.map