"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.bookingResponse = void 0;
var _helpers = require("../../../helpers");
var _legacy = require("../../helpers/legacy");
const bookingResponse = function () {
  let {
    checkin,
    checkout,
    hotelCurrency,
    idReservation,
    reservedRooms
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  (0, _helpers.dataLayerPush)({
    'duetto.data': reservedRooms.map(function () {
      let {
        occupation,
        rateName,
        roomTypeName,
        totalPriceWithTaxes
      } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      return {
        b: idReservation,
        r: (0, _legacy.formatPrice)(totalPriceWithTaxes, hotelCurrency),
        cc: hotelCurrency.code,
        rc: rateName,
        rt: roomTypeName,
        na: occupation.numAdults,
        nc: occupation.totalChildren,
        sd: checkin,
        ed: checkout
      };
    }),
    event: 'duetto.Booking'
  });
};
exports.bookingResponse = bookingResponse;
//# sourceMappingURL=bookingResponse.js.map