"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getRatesUrl = void 0;
var _toUrlParams = require("./toUrlParams");
var _Core = require("../../Core.constants");
const getRatesUrl = function () {
  var _rooms$split;
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const applyClubDiscount = params.applyClubDiscount,
    chainSelectorValue = params.chainSelectorValue,
    checkin = params.checkin,
    clientCodeStrictSearch = params.clientCodeStrictSearch,
    contactCenter = params.contactCenter,
    currency = params.currency,
    deviceType = params.device,
    env = params.env,
    fingerprint = params.fingerprint,
    home = params.home,
    hsri = params.hsri,
    idchain = params.idchain,
    idtokenprovider = params.idtokenprovider,
    language = params.language,
    nights = params.nights,
    notification = params.notification,
    parties = params.parties,
    promocode = params.promocode,
    rooms = params.rooms,
    utm_source = params.utm_source,
    variant = params.variant;
  return "".concat(process.env.SERVICE_BOOKING, "/").concat(_Core.REDIRECT_PATH).concat((0, _toUrlParams.toUrlParams)({
    applyClubDiscount,
    cart: rooms === null || rooms === void 0 || (_rooms$split = rooms.split(',')) === null || _rooms$split === void 0 || (_rooms$split = _rooms$split.map(room => room.replace(/\|/g, '--').split(':')[0])) === null || _rooms$split === void 0 ? void 0 : _rooms$split.join(','),
    chainSelectorValue,
    checkin,
    clientCode: promocode,
    clientCodeStrictSearch,
    contactCenter,
    currency,
    deviceType,
    env,
    fingerprint,
    home,
    hsri,
    idchain,
    idtokenprovider,
    lang: language,
    nights,
    notification,
    parties,
    utm_source,
    variant
  }));
};
exports.getRatesUrl = getRatesUrl;
//# sourceMappingURL=getRatesUrl.js.map