@mirai/core 0.3.427 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Core.constants.js +12 -12
- package/build/Core.constants.js.map +1 -1
- package/build/components/Booking/Booking.js +8 -6
- package/build/components/Booking/Booking.js.map +1 -1
- package/build/components/Booking/partials/Booking.Information.js +1 -1
- package/build/components/Booking/partials/Booking.Information.js.map +1 -1
- package/build/components/Booking/partials/Booking.Modal.js +1 -1
- package/build/components/Booking/partials/Booking.Modal.js.map +1 -1
- package/build/components/Checkout/Checkout.js +3 -3
- package/build/components/Checkout/Checkout.js.map +1 -1
- package/build/components/Checkout/helpers/index.js +0 -11
- package/build/components/Checkout/helpers/index.js.map +1 -1
- package/build/components/Checkout/partials/Checkout.Form.js +5 -3
- package/build/components/Checkout/partials/Checkout.Form.js.map +1 -1
- package/build/components/Finder/Finder.js +15 -11
- package/build/components/Finder/Finder.js.map +1 -1
- package/build/components/Finder/helpers/index.js +0 -11
- package/build/components/Finder/helpers/index.js.map +1 -1
- package/build/components/Rates/Rates.js +12 -13
- package/build/components/Rates/Rates.js.map +1 -1
- package/build/components/Rates/components/Item/components/ModalUrl/ModalUrl.js +1 -0
- package/build/components/Rates/components/Item/components/ModalUrl/ModalUrl.js.map +1 -1
- package/build/components/Rates/helpers/index.js +0 -22
- package/build/components/Rates/helpers/index.js.map +1 -1
- package/build/components/Session/Session.Login.Modal.js +4 -1
- package/build/components/Session/Session.Login.Modal.js.map +1 -1
- package/build/components/Session/helpers/index.js +0 -11
- package/build/components/Session/helpers/index.js.map +1 -1
- package/build/components/__shared__/BookingTerms/BookingTerms.js +1 -1
- package/build/components/__shared__/BookingTerms/BookingTerms.js.map +1 -1
- package/build/components/helpers/constants.js +1 -0
- package/build/components/helpers/constants.js.map +1 -1
- package/build/contexts/PerformanceManager/PerformanceManager.constants.js +10 -0
- package/build/contexts/PerformanceManager/PerformanceManager.constants.js.map +1 -0
- package/build/contexts/PerformanceManager/PerformanceManager.events.js +55 -0
- package/build/contexts/PerformanceManager/PerformanceManager.events.js.map +1 -0
- package/build/contexts/PerformanceManager/PerformanceManager.js +201 -0
- package/build/contexts/PerformanceManager/PerformanceManager.js.map +1 -0
- package/build/contexts/PerformanceManager/PerformanceManager.scripts.js +139 -0
- package/build/contexts/PerformanceManager/PerformanceManager.scripts.js.map +1 -0
- package/build/contexts/PerformanceManager/helpers/dataLayerPush.js.map +1 -0
- package/build/contexts/PerformanceManager/helpers/getConsentMode.js +39 -0
- package/build/contexts/PerformanceManager/helpers/getConsentMode.js.map +1 -0
- package/build/contexts/{PerfomanceManager/helpers/getPerfomanceLabel.js → PerformanceManager/helpers/getPerformanceLabel.js} +5 -5
- package/build/contexts/PerformanceManager/helpers/getPerformanceLabel.js.map +1 -0
- package/build/contexts/{PerfomanceManager → PerformanceManager}/helpers/index.js +8 -8
- package/build/contexts/PerformanceManager/helpers/index.js.map +1 -0
- package/build/contexts/PerformanceManager/index.js +17 -0
- package/build/contexts/PerformanceManager/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/affilired/bookingResponse.js +44 -0
- package/build/contexts/PerformanceManager/providers/affilired/bookingResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/affilired/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/bookingCancel.js +51 -0
- package/build/contexts/PerformanceManager/providers/analytics/bookingCancel.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/bookingResponse.js +121 -0
- package/build/contexts/PerformanceManager/providers/analytics/bookingResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/checkoutForm.js +46 -0
- package/build/contexts/PerformanceManager/providers/analytics/checkoutForm.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/checkoutResponse.js +56 -0
- package/build/contexts/PerformanceManager/providers/analytics/checkoutResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/finderReady.js +41 -0
- package/build/contexts/PerformanceManager/providers/analytics/finderReady.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/helpers/index.js +39 -0
- package/build/contexts/PerformanceManager/providers/analytics/helpers/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/helpers/parseCommon.js +38 -0
- package/build/contexts/PerformanceManager/providers/analytics/helpers/parseCommon.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/helpers/parseItems.js +72 -0
- package/build/contexts/PerformanceManager/providers/analytics/helpers/parseItems.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/helpers/parseRate.js +40 -0
- package/build/contexts/PerformanceManager/providers/analytics/helpers/parseRate.js.map +1 -0
- package/build/contexts/{PerfomanceManager → PerformanceManager}/providers/analytics/index.js +2 -2
- package/build/contexts/PerformanceManager/providers/analytics/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/logged.js +36 -0
- package/build/contexts/PerformanceManager/providers/analytics/logged.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/ratesAddToCart.js +90 -0
- package/build/contexts/PerformanceManager/providers/analytics/ratesAddToCart.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/analytics/ratesResponse.js +115 -0
- package/build/contexts/PerformanceManager/providers/analytics/ratesResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/bing/bookingResponse.js +30 -0
- package/build/contexts/PerformanceManager/providers/bing/bookingResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/bing/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/bookingResponse.js +73 -0
- package/build/contexts/PerformanceManager/providers/facebook/bookingResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/checkoutResponse.js +78 -0
- package/build/contexts/PerformanceManager/providers/facebook/checkoutResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/getCookies.js +13 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/getCookies.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/index.js +39 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/parseCustomData.js +30 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/parseCustomData.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/parseUserData.js +29 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/parseUserData.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/sendData.js +15 -0
- package/build/contexts/PerformanceManager/providers/facebook/helpers/sendData.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/ratesAddToCart.js +67 -0
- package/build/contexts/PerformanceManager/providers/facebook/ratesAddToCart.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/facebook/ratesResponse.js +77 -0
- package/build/contexts/PerformanceManager/providers/facebook/ratesResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/googleAds/bookingResponse.js +62 -0
- package/build/contexts/PerformanceManager/providers/googleAds/bookingResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/googleAds/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/gtm/bookingCancel.js +88 -0
- package/build/contexts/PerformanceManager/providers/gtm/bookingCancel.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/gtm/bookingResponse.js +190 -0
- package/build/contexts/PerformanceManager/providers/gtm/bookingResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/gtm/checkoutResponse.js +180 -0
- package/build/contexts/PerformanceManager/providers/gtm/checkoutResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/gtm/finderReady.js +39 -0
- package/build/contexts/PerformanceManager/providers/gtm/finderReady.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/gtm/helpers/index.js +17 -0
- package/build/contexts/PerformanceManager/providers/gtm/helpers/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/gtm/helpers/parseRate.js +29 -0
- package/build/contexts/PerformanceManager/providers/gtm/helpers/parseRate.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/gtm/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/gtm/ratesResponse.js +203 -0
- package/build/contexts/PerformanceManager/providers/gtm/ratesResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/helpers/SHA256.js +90 -0
- package/build/contexts/PerformanceManager/providers/helpers/SHA256.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/helpers/getFirstOccupationOption.js +22 -0
- package/build/contexts/PerformanceManager/providers/helpers/getFirstOccupationOption.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/helpers/getRatesPriceRange.js +27 -0
- package/build/contexts/PerformanceManager/providers/helpers/getRatesPriceRange.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/helpers/getRoomPriceRange.js +64 -0
- package/build/contexts/PerformanceManager/providers/helpers/getRoomPriceRange.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/helpers/getRoomsPriceRange.js +13 -0
- package/build/contexts/PerformanceManager/providers/helpers/getRoomsPriceRange.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/helpers/index.js +61 -0
- package/build/contexts/PerformanceManager/providers/helpers/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/helpers/legacy.js +15 -0
- package/build/contexts/PerformanceManager/providers/helpers/legacy.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/index.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/mirai/bookingResponse.js +71 -0
- package/build/contexts/PerformanceManager/providers/mirai/bookingResponse.js.map +1 -0
- package/build/contexts/PerformanceManager/providers/mirai/index.js +11 -0
- package/build/contexts/PerformanceManager/providers/mirai/index.js.map +1 -0
- package/build/contexts/index.js +4 -4
- package/build/contexts/index.js.map +1 -1
- package/build/helpers/consolidateStore.js +4 -25
- package/build/helpers/consolidateStore.js.map +1 -1
- package/build/helpers/getLocale.js +1 -0
- package/build/helpers/getLocale.js.map +1 -1
- package/build/helpers/getPerformance.js +50 -0
- package/build/helpers/getPerformance.js.map +1 -0
- package/build/helpers/index.js +11 -0
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/loadScript.js +3 -2
- package/build/helpers/loadScript.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/public/index.html +1 -1
- package/build/components/Checkout/helpers/trackForm.js +0 -29
- package/build/components/Checkout/helpers/trackForm.js.map +0 -1
- package/build/components/Finder/helpers/track.js +0 -25
- package/build/components/Finder/helpers/track.js.map +0 -1
- package/build/components/Rates/helpers/trackDataSource.js +0 -56
- package/build/components/Rates/helpers/trackDataSource.js.map +0 -1
- package/build/components/Rates/helpers/trackSelectItem.js +0 -103
- package/build/components/Rates/helpers/trackSelectItem.js.map +0 -1
- package/build/components/Session/helpers/trackLogin.js +0 -26
- package/build/components/Session/helpers/trackLogin.js.map +0 -1
- package/build/contexts/PerfomanceManager/PerfomanceManager.events.js +0 -57
- package/build/contexts/PerfomanceManager/PerfomanceManager.events.js.map +0 -1
- package/build/contexts/PerfomanceManager/PerfomanceManager.js +0 -125
- package/build/contexts/PerfomanceManager/PerfomanceManager.js.map +0 -1
- package/build/contexts/PerfomanceManager/PerfomanceManager.scripts.js +0 -111
- package/build/contexts/PerfomanceManager/PerfomanceManager.scripts.js.map +0 -1
- package/build/contexts/PerfomanceManager/helpers/dataLayerPush.js.map +0 -1
- package/build/contexts/PerfomanceManager/helpers/getPerfomanceLabel.js.map +0 -1
- package/build/contexts/PerfomanceManager/helpers/googleTagManager.js +0 -23
- package/build/contexts/PerfomanceManager/helpers/googleTagManager.js.map +0 -1
- package/build/contexts/PerfomanceManager/helpers/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/index.js +0 -17
- package/build/contexts/PerfomanceManager/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/affilired/bookingResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/affilired/bookingResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/affilired/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/bookingCancel.js +0 -14
- package/build/contexts/PerfomanceManager/providers/analytics/bookingCancel.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/bookingResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/analytics/bookingResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/checkoutForm.js +0 -14
- package/build/contexts/PerfomanceManager/providers/analytics/checkoutForm.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/checkoutResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/analytics/checkoutResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/finderReady.js +0 -14
- package/build/contexts/PerfomanceManager/providers/analytics/finderReady.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/login.js +0 -14
- package/build/contexts/PerfomanceManager/providers/analytics/login.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/ratesAddToCart.js +0 -14
- package/build/contexts/PerfomanceManager/providers/analytics/ratesAddToCart.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/analytics/ratesResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/analytics/ratesResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/bing/bookingResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/bing/bookingResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/bing/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/facebook/bookingResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/facebook/bookingResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/facebook/checkoutResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/facebook/checkoutResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/facebook/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/facebook/ratesAddToCart.js +0 -14
- package/build/contexts/PerfomanceManager/providers/facebook/ratesAddToCart.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/facebook/ratesResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/facebook/ratesResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/googleAds/bookingResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/googleAds/bookingResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/googleAds/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/gtm/bookingCancel.js +0 -14
- package/build/contexts/PerfomanceManager/providers/gtm/bookingCancel.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/gtm/bookingResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/gtm/bookingResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/gtm/checkoutResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/gtm/checkoutResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/gtm/finderReady.js +0 -14
- package/build/contexts/PerfomanceManager/providers/gtm/finderReady.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/gtm/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/gtm/ratesResponse.js +0 -205
- package/build/contexts/PerfomanceManager/providers/gtm/ratesResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/mirai/bookingResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/mirai/bookingResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/mirai/checkoutResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/mirai/checkoutResponse.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/mirai/finderReady.js +0 -14
- package/build/contexts/PerfomanceManager/providers/mirai/finderReady.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/mirai/index.js +0 -17
- package/build/contexts/PerfomanceManager/providers/mirai/index.js.map +0 -1
- package/build/contexts/PerfomanceManager/providers/mirai/ratesResponse.js +0 -14
- package/build/contexts/PerfomanceManager/providers/mirai/ratesResponse.js.map +0 -1
- /package/build/contexts/{PerfomanceManager → PerformanceManager}/helpers/dataLayerPush.js +0 -0
- /package/build/contexts/{PerfomanceManager → PerformanceManager}/providers/affilired/index.js +0 -0
- /package/build/contexts/{PerfomanceManager → PerformanceManager}/providers/bing/index.js +0 -0
- /package/build/contexts/{PerfomanceManager → PerformanceManager}/providers/facebook/index.js +0 -0
- /package/build/contexts/{PerfomanceManager → PerformanceManager}/providers/googleAds/index.js +0 -0
- /package/build/contexts/{PerfomanceManager → PerformanceManager}/providers/gtm/index.js +0 -0
- /package/build/contexts/{PerfomanceManager → PerformanceManager}/providers/index.js +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bookingResponse = void 0;
|
|
7
|
+
var _legacy = require("../helpers/legacy");
|
|
8
|
+
const bookingResponse = function () {
|
|
9
|
+
var _window$uetq;
|
|
10
|
+
let {
|
|
11
|
+
response: {
|
|
12
|
+
tracking = {}
|
|
13
|
+
} = {}
|
|
14
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
|
+
// ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------
|
|
16
|
+
const {
|
|
17
|
+
hotelInfo: {
|
|
18
|
+
currency: hotelCurrency = {}
|
|
19
|
+
} = {},
|
|
20
|
+
totalPriceWithoutTaxes
|
|
21
|
+
} = tracking;
|
|
22
|
+
const value = {
|
|
23
|
+
gv: (0, _legacy.formatPrice)(totalPriceWithoutTaxes, hotelCurrency),
|
|
24
|
+
gc: hotelCurrency.currency
|
|
25
|
+
};
|
|
26
|
+
(_window$uetq = window.uetq) === null || _window$uetq === void 0 ? void 0 : _window$uetq.push(value);
|
|
27
|
+
return value;
|
|
28
|
+
};
|
|
29
|
+
exports.bookingResponse = bookingResponse;
|
|
30
|
+
//# sourceMappingURL=bookingResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookingResponse.js","names":["_legacy","require","bookingResponse","_window$uetq","response","tracking","arguments","length","undefined","hotelInfo","currency","hotelCurrency","totalPriceWithoutTaxes","value","gv","formatPrice","gc","window","uetq","push","exports"],"sources":["../../../../../src/contexts/PerformanceManager/providers/bing/bookingResponse.js"],"sourcesContent":["import { formatPrice } from '../helpers/legacy';\n\nexport const bookingResponse = ({ response: { tracking = {} } = {} } = {}) => {\n // ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------\n const { hotelInfo: { currency: hotelCurrency = {} } = {}, totalPriceWithoutTaxes } = tracking;\n\n const value = { gv: formatPrice(totalPriceWithoutTaxes, hotelCurrency), gc: hotelCurrency.currency };\n window.uetq?.push(value);\n\n return value;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,eAAe,GAAG,SAAAA,CAAA,EAA+C;EAAA,IAAAC,YAAA;EAAA,IAA9C;IAAEC,QAAQ,EAAE;MAAEC,QAAQ,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC;EAAE,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACvE;EACA,MAAM;IAAEG,SAAS,EAAE;MAAEC,QAAQ,EAAEC,aAAa,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC;IAAEC;EAAuB,CAAC,GAAGP,QAAQ;EAE7F,MAAMQ,KAAK,GAAG;IAAEC,EAAE,EAAE,IAAAC,mBAAW,EAACH,sBAAsB,EAAED,aAAa,CAAC;IAAEK,EAAE,EAAEL,aAAa,CAACD;EAAS,CAAC;EACpG,CAAAP,YAAA,GAAAc,MAAM,CAACC,IAAI,cAAAf,YAAA,uBAAXA,YAAA,CAAagB,IAAI,CAACN,KAAK,CAAC;EAExB,OAAOA,KAAK;AACd,CAAC;AAACO,OAAA,CAAAlB,eAAA,GAAAA,eAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_bookingResponse","require","ProviderBing","exports","bookingResponse"],"sources":["../../../../../src/contexts/PerformanceManager/providers/bing/index.js"],"sourcesContent":["import { bookingResponse } from './bookingResponse';\n\nexport const ProviderBing = {\n bookingResponse,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1BE,eAAe,EAAfA;AACF,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bookingResponse = void 0;
|
|
7
|
+
var _helpers = require("./helpers");
|
|
8
|
+
var _legacy = require("../helpers/legacy");
|
|
9
|
+
const bookingResponse = async function () {
|
|
10
|
+
let {
|
|
11
|
+
instances = [],
|
|
12
|
+
response: {
|
|
13
|
+
tracking = {}
|
|
14
|
+
} = {}
|
|
15
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
|
+
// ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------
|
|
17
|
+
const {
|
|
18
|
+
bookingValues: {
|
|
19
|
+
nights = 0
|
|
20
|
+
} = {},
|
|
21
|
+
guestData = {},
|
|
22
|
+
hotelInfo: {
|
|
23
|
+
currency: hotelCurrency = {},
|
|
24
|
+
propertyName
|
|
25
|
+
} = {},
|
|
26
|
+
idReservation,
|
|
27
|
+
pendingPayment,
|
|
28
|
+
reservedRooms = [],
|
|
29
|
+
totalPriceWithTaxes
|
|
30
|
+
} = tracking;
|
|
31
|
+
let contents = [];
|
|
32
|
+
let numItems = 0;
|
|
33
|
+
reservedRooms.forEach(function () {
|
|
34
|
+
let {
|
|
35
|
+
averagePriceWithoutTaxes = 0,
|
|
36
|
+
numRoomsToReserve = 1,
|
|
37
|
+
rateId
|
|
38
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
39
|
+
const quantity = nights * numRoomsToReserve;
|
|
40
|
+
contents.push({
|
|
41
|
+
id: rateId,
|
|
42
|
+
itemPrice: (0, _legacy.formatPrice)(averagePriceWithoutTaxes, hotelCurrency),
|
|
43
|
+
quantity
|
|
44
|
+
});
|
|
45
|
+
numItems += quantity;
|
|
46
|
+
});
|
|
47
|
+
const commonData = {
|
|
48
|
+
eventName: pendingPayment ? 'BTP' : 'Purchase',
|
|
49
|
+
userData: (0, _helpers.parseUserData)(guestData),
|
|
50
|
+
customData: (0, _helpers.parseCustomData)({
|
|
51
|
+
contents,
|
|
52
|
+
hotelCurrency,
|
|
53
|
+
numItems,
|
|
54
|
+
orderId: idReservation,
|
|
55
|
+
propertyName,
|
|
56
|
+
value: (0, _legacy.formatPrice)(totalPriceWithTaxes, hotelCurrency)
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
const responses = await Promise.all(instances.map(_ref => {
|
|
60
|
+
let {
|
|
61
|
+
id,
|
|
62
|
+
pixelId
|
|
63
|
+
} = _ref;
|
|
64
|
+
return (0, _helpers.sendData)({
|
|
65
|
+
...commonData,
|
|
66
|
+
idTracking: id,
|
|
67
|
+
pixelId
|
|
68
|
+
});
|
|
69
|
+
})).catch(() => {});
|
|
70
|
+
return responses;
|
|
71
|
+
};
|
|
72
|
+
exports.bookingResponse = bookingResponse;
|
|
73
|
+
//# sourceMappingURL=bookingResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookingResponse.js","names":["_helpers","require","_legacy","bookingResponse","instances","response","tracking","arguments","length","undefined","bookingValues","nights","guestData","hotelInfo","currency","hotelCurrency","propertyName","idReservation","pendingPayment","reservedRooms","totalPriceWithTaxes","contents","numItems","forEach","averagePriceWithoutTaxes","numRoomsToReserve","rateId","quantity","push","id","itemPrice","formatPrice","commonData","eventName","userData","parseUserData","customData","parseCustomData","orderId","value","responses","Promise","all","map","_ref","pixelId","sendData","idTracking","catch","exports"],"sources":["../../../../../src/contexts/PerformanceManager/providers/facebook/bookingResponse.js"],"sourcesContent":["import { parseCustomData, parseUserData, sendData } from './helpers';\nimport { formatPrice } from '../helpers/legacy';\n\nexport const bookingResponse = async ({ instances = [], response: { tracking = {} } = {} } = {}) => {\n // ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------\n const {\n bookingValues: { nights = 0 } = {},\n guestData = {},\n hotelInfo: { currency: hotelCurrency = {}, propertyName } = {},\n idReservation,\n pendingPayment,\n reservedRooms = [],\n totalPriceWithTaxes,\n } = tracking;\n\n let contents = [];\n let numItems = 0;\n reservedRooms.forEach(({ averagePriceWithoutTaxes = 0, numRoomsToReserve = 1, rateId } = {}) => {\n const quantity = nights * numRoomsToReserve;\n\n contents.push({ id: rateId, itemPrice: formatPrice(averagePriceWithoutTaxes, hotelCurrency), quantity });\n numItems += quantity;\n });\n\n const commonData = {\n eventName: pendingPayment ? 'BTP' : 'Purchase',\n userData: parseUserData(guestData),\n customData: parseCustomData({\n contents,\n hotelCurrency,\n numItems,\n orderId: idReservation,\n propertyName,\n value: formatPrice(totalPriceWithTaxes, hotelCurrency),\n }),\n };\n\n const responses = await Promise.all(\n instances.map(({ id, pixelId }) => sendData({ ...commonData, idTracking: id, pixelId })),\n ).catch(() => {});\n\n return responses;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEO,MAAME,eAAe,GAAG,eAAAA,CAAA,EAAqE;EAAA,IAA9D;IAAEC,SAAS,GAAG,EAAE;IAAEC,QAAQ,EAAE;MAAEC,QAAQ,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC;EAAE,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC7F;EACA,MAAM;IACJG,aAAa,EAAE;MAAEC,MAAM,GAAG;IAAE,CAAC,GAAG,CAAC,CAAC;IAClCC,SAAS,GAAG,CAAC,CAAC;IACdC,SAAS,EAAE;MAAEC,QAAQ,EAAEC,aAAa,GAAG,CAAC,CAAC;MAAEC;IAAa,CAAC,GAAG,CAAC,CAAC;IAC9DC,aAAa;IACbC,cAAc;IACdC,aAAa,GAAG,EAAE;IAClBC;EACF,CAAC,GAAGd,QAAQ;EAEZ,IAAIe,QAAQ,GAAG,EAAE;EACjB,IAAIC,QAAQ,GAAG,CAAC;EAChBH,aAAa,CAACI,OAAO,CAAC,YAA0E;IAAA,IAAzE;MAAEC,wBAAwB,GAAG,CAAC;MAAEC,iBAAiB,GAAG,CAAC;MAAEC;IAAO,CAAC,GAAAnB,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IACzF,MAAMoB,QAAQ,GAAGhB,MAAM,GAAGc,iBAAiB;IAE3CJ,QAAQ,CAACO,IAAI,CAAC;MAAEC,EAAE,EAAEH,MAAM;MAAEI,SAAS,EAAE,IAAAC,mBAAW,EAACP,wBAAwB,EAAET,aAAa,CAAC;MAAEY;IAAS,CAAC,CAAC;IACxGL,QAAQ,IAAIK,QAAQ;EACtB,CAAC,CAAC;EAEF,MAAMK,UAAU,GAAG;IACjBC,SAAS,EAAEf,cAAc,GAAG,KAAK,GAAG,UAAU;IAC9CgB,QAAQ,EAAE,IAAAC,sBAAa,EAACvB,SAAS,CAAC;IAClCwB,UAAU,EAAE,IAAAC,wBAAe,EAAC;MAC1BhB,QAAQ;MACRN,aAAa;MACbO,QAAQ;MACRgB,OAAO,EAAErB,aAAa;MACtBD,YAAY;MACZuB,KAAK,EAAE,IAAAR,mBAAW,EAACX,mBAAmB,EAAEL,aAAa;IACvD,CAAC;EACH,CAAC;EAED,MAAMyB,SAAS,GAAG,MAAMC,OAAO,CAACC,GAAG,CACjCtC,SAAS,CAACuC,GAAG,CAACC,IAAA;IAAA,IAAC;MAAEf,EAAE;MAAEgB;IAAQ,CAAC,GAAAD,IAAA;IAAA,OAAK,IAAAE,iBAAQ,EAAC;MAAE,GAAGd,UAAU;MAAEe,UAAU,EAAElB,EAAE;MAAEgB;IAAQ,CAAC,CAAC;EAAA,EACzF,CAAC,CAACG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;EAEjB,OAAOR,SAAS;AAClB,CAAC;AAACS,OAAA,CAAA9C,eAAA,GAAAA,eAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.checkoutResponse = void 0;
|
|
7
|
+
var _locale = require("@mirai/locale");
|
|
8
|
+
var _helpers = require("./helpers");
|
|
9
|
+
var _legacy = require("../helpers/legacy");
|
|
10
|
+
const checkoutResponse = async function () {
|
|
11
|
+
let {
|
|
12
|
+
instances = [],
|
|
13
|
+
response: {
|
|
14
|
+
tracking = {}
|
|
15
|
+
} = {},
|
|
16
|
+
store: {
|
|
17
|
+
finder: {
|
|
18
|
+
calendar = []
|
|
19
|
+
} = {}
|
|
20
|
+
} = {}
|
|
21
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
22
|
+
// ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------
|
|
23
|
+
const {
|
|
24
|
+
bookingValues: {
|
|
25
|
+
country
|
|
26
|
+
} = {},
|
|
27
|
+
hotelInfo: {
|
|
28
|
+
currency: hotelCurrency = {},
|
|
29
|
+
propertyName
|
|
30
|
+
} = {},
|
|
31
|
+
reservedRooms = [],
|
|
32
|
+
totalPriceWithTaxes
|
|
33
|
+
} = tracking;
|
|
34
|
+
const {
|
|
35
|
+
days
|
|
36
|
+
} = (0, _locale.dateDiff)(...calendar);
|
|
37
|
+
let contents = [];
|
|
38
|
+
let numItems = 0;
|
|
39
|
+
reservedRooms.forEach(function () {
|
|
40
|
+
let {
|
|
41
|
+
averagePriceWithoutTaxes = 0,
|
|
42
|
+
numRoomsToReserve = 1,
|
|
43
|
+
rateId
|
|
44
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
45
|
+
const quantity = days * numRoomsToReserve;
|
|
46
|
+
contents.push({
|
|
47
|
+
id: rateId,
|
|
48
|
+
itemPrice: (0, _legacy.formatPrice)(averagePriceWithoutTaxes, hotelCurrency),
|
|
49
|
+
quantity
|
|
50
|
+
});
|
|
51
|
+
numItems += quantity;
|
|
52
|
+
});
|
|
53
|
+
const commonData = {
|
|
54
|
+
customData: (0, _helpers.parseCustomData)({
|
|
55
|
+
contents,
|
|
56
|
+
country,
|
|
57
|
+
hotelCurrency,
|
|
58
|
+
numItems,
|
|
59
|
+
propertyName,
|
|
60
|
+
value: (0, _legacy.formatPrice)(totalPriceWithTaxes, hotelCurrency)
|
|
61
|
+
}),
|
|
62
|
+
eventName: 'InitiateCheckout'
|
|
63
|
+
};
|
|
64
|
+
const responses = await Promise.all(instances.map(_ref => {
|
|
65
|
+
let {
|
|
66
|
+
id,
|
|
67
|
+
pixelId
|
|
68
|
+
} = _ref;
|
|
69
|
+
return (0, _helpers.sendData)({
|
|
70
|
+
...commonData,
|
|
71
|
+
idTracking: id,
|
|
72
|
+
pixelId
|
|
73
|
+
});
|
|
74
|
+
})).catch(() => {});
|
|
75
|
+
return responses;
|
|
76
|
+
};
|
|
77
|
+
exports.checkoutResponse = checkoutResponse;
|
|
78
|
+
//# sourceMappingURL=checkoutResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkoutResponse.js","names":["_locale","require","_helpers","_legacy","checkoutResponse","instances","response","tracking","store","finder","calendar","arguments","length","undefined","bookingValues","country","hotelInfo","currency","hotelCurrency","propertyName","reservedRooms","totalPriceWithTaxes","days","dateDiff","contents","numItems","forEach","averagePriceWithoutTaxes","numRoomsToReserve","rateId","quantity","push","id","itemPrice","formatPrice","commonData","customData","parseCustomData","value","eventName","responses","Promise","all","map","_ref","pixelId","sendData","idTracking","catch","exports"],"sources":["../../../../../src/contexts/PerformanceManager/providers/facebook/checkoutResponse.js"],"sourcesContent":["import { dateDiff } from '@mirai/locale';\n\nimport { parseCustomData, sendData } from './helpers';\nimport { formatPrice } from '../helpers/legacy';\n\nexport const checkoutResponse = async ({\n instances = [],\n response: { tracking = {} } = {},\n store: { finder: { calendar = [] } = {} } = {},\n} = {}) => {\n // ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------\n const {\n bookingValues: { country } = {},\n hotelInfo: { currency: hotelCurrency = {}, propertyName } = {},\n reservedRooms = [],\n totalPriceWithTaxes,\n } = tracking;\n\n const { days } = dateDiff(...calendar);\n let contents = [];\n let numItems = 0;\n reservedRooms.forEach(({ averagePriceWithoutTaxes = 0, numRoomsToReserve = 1, rateId } = {}) => {\n const quantity = days * numRoomsToReserve;\n\n contents.push({ id: rateId, itemPrice: formatPrice(averagePriceWithoutTaxes, hotelCurrency), quantity });\n numItems += quantity;\n });\n\n const commonData = {\n customData: parseCustomData({\n contents,\n country,\n hotelCurrency,\n numItems,\n propertyName,\n value: formatPrice(totalPriceWithTaxes, hotelCurrency),\n }),\n eventName: 'InitiateCheckout',\n };\n\n const responses = await Promise.all(\n instances.map(({ id, pixelId }) => sendData({ ...commonData, idTracking: id, pixelId })),\n ).catch(() => {});\n\n return responses;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEO,MAAMG,gBAAgB,GAAG,eAAAA,CAAA,EAIrB;EAAA,IAJ4B;IACrCC,SAAS,GAAG,EAAE;IACdC,QAAQ,EAAE;MAAEC,QAAQ,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC;IAChCC,KAAK,EAAE;MAAEC,MAAM,EAAE;QAAEC,QAAQ,GAAG;MAAG,CAAC,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC;EAC/C,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACJ;EACA,MAAM;IACJG,aAAa,EAAE;MAAEC;IAAQ,CAAC,GAAG,CAAC,CAAC;IAC/BC,SAAS,EAAE;MAAEC,QAAQ,EAAEC,aAAa,GAAG,CAAC,CAAC;MAAEC;IAAa,CAAC,GAAG,CAAC,CAAC;IAC9DC,aAAa,GAAG,EAAE;IAClBC;EACF,CAAC,GAAGd,QAAQ;EAEZ,MAAM;IAAEe;EAAK,CAAC,GAAG,IAAAC,gBAAQ,EAAC,GAAGb,QAAQ,CAAC;EACtC,IAAIc,QAAQ,GAAG,EAAE;EACjB,IAAIC,QAAQ,GAAG,CAAC;EAChBL,aAAa,CAACM,OAAO,CAAC,YAA0E;IAAA,IAAzE;MAAEC,wBAAwB,GAAG,CAAC;MAAEC,iBAAiB,GAAG,CAAC;MAAEC;IAAO,CAAC,GAAAlB,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IACzF,MAAMmB,QAAQ,GAAGR,IAAI,GAAGM,iBAAiB;IAEzCJ,QAAQ,CAACO,IAAI,CAAC;MAAEC,EAAE,EAAEH,MAAM;MAAEI,SAAS,EAAE,IAAAC,mBAAW,EAACP,wBAAwB,EAAET,aAAa,CAAC;MAAEY;IAAS,CAAC,CAAC;IACxGL,QAAQ,IAAIK,QAAQ;EACtB,CAAC,CAAC;EAEF,MAAMK,UAAU,GAAG;IACjBC,UAAU,EAAE,IAAAC,wBAAe,EAAC;MAC1Bb,QAAQ;MACRT,OAAO;MACPG,aAAa;MACbO,QAAQ;MACRN,YAAY;MACZmB,KAAK,EAAE,IAAAJ,mBAAW,EAACb,mBAAmB,EAAEH,aAAa;IACvD,CAAC,CAAC;IACFqB,SAAS,EAAE;EACb,CAAC;EAED,MAAMC,SAAS,GAAG,MAAMC,OAAO,CAACC,GAAG,CACjCrC,SAAS,CAACsC,GAAG,CAACC,IAAA;IAAA,IAAC;MAAEZ,EAAE;MAAEa;IAAQ,CAAC,GAAAD,IAAA;IAAA,OAAK,IAAAE,iBAAQ,EAAC;MAAE,GAAGX,UAAU;MAAEY,UAAU,EAAEf,EAAE;MAAEa;IAAQ,CAAC,CAAC;EAAA,EACzF,CAAC,CAACG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;EAEjB,OAAOR,SAAS;AAClB,CAAC;AAACS,OAAA,CAAA7C,gBAAA,GAAAA,gBAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCookies = void 0;
|
|
7
|
+
var _dataSources = require("@mirai/data-sources");
|
|
8
|
+
const getCookies = () => ({
|
|
9
|
+
fbc: (0, _dataSources.getCookie)('_fbc') || null,
|
|
10
|
+
fbp: (0, _dataSources.getCookie)('_fbp') || null
|
|
11
|
+
});
|
|
12
|
+
exports.getCookies = getCookies;
|
|
13
|
+
//# sourceMappingURL=getCookies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCookies.js","names":["_dataSources","require","getCookies","fbc","getCookie","fbp","exports"],"sources":["../../../../../../src/contexts/PerformanceManager/providers/facebook/helpers/getCookies.js"],"sourcesContent":["import { getCookie } from '@mirai/data-sources';\n\nexport const getCookies = () => ({\n fbc: getCookie('_fbc') || null,\n fbp: getCookie('_fbp') || null,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,UAAU,GAAGA,CAAA,MAAO;EAC/BC,GAAG,EAAE,IAAAC,sBAAS,EAAC,MAAM,CAAC,IAAI,IAAI;EAC9BC,GAAG,EAAE,IAAAD,sBAAS,EAAC,MAAM,CAAC,IAAI;AAC5B,CAAC,CAAC;AAACE,OAAA,CAAAJ,UAAA,GAAAA,UAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _parseCustomData = require("./parseCustomData");
|
|
7
|
+
Object.keys(_parseCustomData).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _parseCustomData[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _parseCustomData[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _parseUserData = require("./parseUserData");
|
|
18
|
+
Object.keys(_parseUserData).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _parseUserData[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _parseUserData[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _sendData = require("./sendData");
|
|
29
|
+
Object.keys(_sendData).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _sendData[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _sendData[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_parseCustomData","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_parseUserData","_sendData"],"sources":["../../../../../../src/contexts/PerformanceManager/providers/facebook/helpers/index.js"],"sourcesContent":["export * from './parseCustomData';\nexport * from './parseUserData';\nexport * from './sendData';\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,cAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,cAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,cAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,cAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,SAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,SAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,SAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,SAAA,CAAAN,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseCustomData = void 0;
|
|
7
|
+
var _getCookies = require("./getCookies");
|
|
8
|
+
const parseCustomData = function () {
|
|
9
|
+
let {
|
|
10
|
+
contents = [],
|
|
11
|
+
hotelCurrency = {},
|
|
12
|
+
propertyName,
|
|
13
|
+
...others
|
|
14
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
|
+
return {
|
|
16
|
+
contentIds: contents.map(_ref => {
|
|
17
|
+
let {
|
|
18
|
+
id
|
|
19
|
+
} = _ref;
|
|
20
|
+
return id;
|
|
21
|
+
}),
|
|
22
|
+
contentName: propertyName,
|
|
23
|
+
contents,
|
|
24
|
+
currency: hotelCurrency.code,
|
|
25
|
+
...(0, _getCookies.getCookies)(),
|
|
26
|
+
...others
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.parseCustomData = parseCustomData;
|
|
30
|
+
//# sourceMappingURL=parseCustomData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCustomData.js","names":["_getCookies","require","parseCustomData","contents","hotelCurrency","propertyName","others","arguments","length","undefined","contentIds","map","_ref","id","contentName","currency","code","getCookies","exports"],"sources":["../../../../../../src/contexts/PerformanceManager/providers/facebook/helpers/parseCustomData.js"],"sourcesContent":["import { getCookies } from './getCookies';\n\nexport const parseCustomData = ({ contents = [], hotelCurrency = {}, propertyName, ...others } = {}) => ({\n contentIds: contents.map(({ id }) => id),\n contentName: propertyName,\n contents,\n currency: hotelCurrency.code,\n ...getCookies(),\n ...others,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,eAAe,GAAG,SAAAA,CAAA;EAAA,IAAC;IAAEC,QAAQ,GAAG,EAAE;IAAEC,aAAa,GAAG,CAAC,CAAC;IAAEC,YAAY;IAAE,GAAGC;EAAO,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OAAM;IACvGG,UAAU,EAAEP,QAAQ,CAACQ,GAAG,CAACC,IAAA;MAAA,IAAC;QAAEC;MAAG,CAAC,GAAAD,IAAA;MAAA,OAAKC,EAAE;IAAA,EAAC;IACxCC,WAAW,EAAET,YAAY;IACzBF,QAAQ;IACRY,QAAQ,EAAEX,aAAa,CAACY,IAAI;IAC5B,GAAG,IAAAC,sBAAU,EAAC,CAAC;IACf,GAAGX;EACL,CAAC;AAAA,CAAC;AAACY,OAAA,CAAAhB,eAAA,GAAAA,eAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseUserData = void 0;
|
|
7
|
+
var _getCookies = require("./getCookies");
|
|
8
|
+
var _helpers = require("../../helpers");
|
|
9
|
+
const parseUserData = function () {
|
|
10
|
+
let {
|
|
11
|
+
country,
|
|
12
|
+
email,
|
|
13
|
+
firstName,
|
|
14
|
+
lastName,
|
|
15
|
+
phone,
|
|
16
|
+
...others
|
|
17
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
+
return {
|
|
19
|
+
firstName: (0, _helpers.SHA256)(firstName),
|
|
20
|
+
lastName: (0, _helpers.SHA256)(lastName),
|
|
21
|
+
country,
|
|
22
|
+
email: (0, _helpers.SHA256)(email),
|
|
23
|
+
phone: (0, _helpers.SHA256)(phone),
|
|
24
|
+
...(0, _getCookies.getCookies)(),
|
|
25
|
+
...others
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
exports.parseUserData = parseUserData;
|
|
29
|
+
//# sourceMappingURL=parseUserData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseUserData.js","names":["_getCookies","require","_helpers","parseUserData","country","email","firstName","lastName","phone","others","arguments","length","undefined","SHA256","getCookies","exports"],"sources":["../../../../../../src/contexts/PerformanceManager/providers/facebook/helpers/parseUserData.js"],"sourcesContent":["import { getCookies } from './getCookies';\nimport { SHA256 } from '../../helpers';\n\nexport const parseUserData = ({ country, email, firstName, lastName, phone, ...others } = {}) => ({\n firstName: SHA256(firstName),\n lastName: SHA256(lastName),\n country,\n email: SHA256(email),\n phone: SHA256(phone),\n ...getCookies(),\n ...others,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,aAAa,GAAG,SAAAA,CAAA;EAAA,IAAC;IAAEC,OAAO;IAAEC,KAAK;IAAEC,SAAS;IAAEC,QAAQ;IAAEC,KAAK;IAAE,GAAGC;EAAO,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OAAM;IAChGJ,SAAS,EAAE,IAAAO,eAAM,EAACP,SAAS,CAAC;IAC5BC,QAAQ,EAAE,IAAAM,eAAM,EAACN,QAAQ,CAAC;IAC1BH,OAAO;IACPC,KAAK,EAAE,IAAAQ,eAAM,EAACR,KAAK,CAAC;IACpBG,KAAK,EAAE,IAAAK,eAAM,EAACL,KAAK,CAAC;IACpB,GAAG,IAAAM,sBAAU,EAAC,CAAC;IACf,GAAGL;EACL,CAAC;AAAA,CAAC;AAACM,OAAA,CAAAZ,aAAA,GAAAA,aAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sendData = void 0;
|
|
7
|
+
var _dataSources = require("@mirai/data-sources");
|
|
8
|
+
const sendData = async data => (0, _dataSources.request)({
|
|
9
|
+
endpoint: '/tracking/facebook/track',
|
|
10
|
+
hostname: process.env.SERVICE_CURRENCY,
|
|
11
|
+
method: 'POST',
|
|
12
|
+
...data
|
|
13
|
+
});
|
|
14
|
+
exports.sendData = sendData;
|
|
15
|
+
//# sourceMappingURL=sendData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendData.js","names":["_dataSources","require","sendData","data","request","endpoint","hostname","process","env","SERVICE_CURRENCY","method","exports"],"sources":["../../../../../../src/contexts/PerformanceManager/providers/facebook/helpers/sendData.js"],"sourcesContent":["import { request } from '@mirai/data-sources';\n\nexport const sendData = async (data) =>\n request({\n endpoint: '/tracking/facebook/track',\n hostname: process.env.SERVICE_CURRENCY,\n method: 'POST',\n ...data,\n });\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,QAAQ,GAAG,MAAOC,IAAI,IACjC,IAAAC,oBAAO,EAAC;EACNC,QAAQ,EAAE,0BAA0B;EACpCC,QAAQ,EAAEC,OAAO,CAACC,GAAG,CAACC,gBAAgB;EACtCC,MAAM,EAAE,MAAM;EACd,GAAGP;AACL,CAAC,CAAC;AAACQ,OAAA,CAAAT,QAAA,GAAAA,QAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_bookingResponse","require","_checkoutResponse","_ratesAddToCart","_ratesResponse","ProviderFacebook","exports","bookingResponse","checkoutResponse","ratesAddToCart","ratesResponse"],"sources":["../../../../../src/contexts/PerformanceManager/providers/facebook/index.js"],"sourcesContent":["import { bookingResponse } from './bookingResponse';\nimport { checkoutResponse } from './checkoutResponse';\nimport { ratesAddToCart } from './ratesAddToCart';\nimport { ratesResponse } from './ratesResponse';\n\nexport const ProviderFacebook = {\n bookingResponse,\n checkoutResponse,\n ratesAddToCart,\n ratesResponse,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAEO,MAAMI,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC9BE,eAAe,EAAfA,gCAAe;EACfC,gBAAgB,EAAhBA,kCAAgB;EAChBC,cAAc,EAAdA,8BAAc;EACdC,aAAa,EAAbA;AACF,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ratesAddToCart = void 0;
|
|
7
|
+
var _helpers = require("./helpers");
|
|
8
|
+
var _helpers2 = require("../helpers");
|
|
9
|
+
var _legacy = require("../helpers/legacy");
|
|
10
|
+
const ratesAddToCart = async function () {
|
|
11
|
+
var _getFirstOccupationOp, _getFirstOccupationOp2;
|
|
12
|
+
let {
|
|
13
|
+
instances = [],
|
|
14
|
+
response: {
|
|
15
|
+
board: {
|
|
16
|
+
id,
|
|
17
|
+
rateId,
|
|
18
|
+
roomId
|
|
19
|
+
} = {},
|
|
20
|
+
tracking = {}
|
|
21
|
+
} = {}
|
|
22
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
23
|
+
// ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------
|
|
24
|
+
const {
|
|
25
|
+
country,
|
|
26
|
+
hotelInfo: {
|
|
27
|
+
currency: hotelCurrency = {},
|
|
28
|
+
propertyName
|
|
29
|
+
} = {},
|
|
30
|
+
rates = []
|
|
31
|
+
} = tracking;
|
|
32
|
+
const {
|
|
33
|
+
totalPrice
|
|
34
|
+
} = ((_getFirstOccupationOp = (0, _helpers2.getFirstOccupationOption)({
|
|
35
|
+
rates,
|
|
36
|
+
roomId
|
|
37
|
+
})) === null || _getFirstOccupationOp === void 0 ? void 0 : (_getFirstOccupationOp2 = _getFirstOccupationOp.rates[rateId]) === null || _getFirstOccupationOp2 === void 0 ? void 0 : _getFirstOccupationOp2.boardOptions[id]) || {};
|
|
38
|
+
const contents = [{
|
|
39
|
+
id,
|
|
40
|
+
itemPrice: (0, _legacy.formatPrice)(totalPrice, hotelCurrency),
|
|
41
|
+
quantity: 1
|
|
42
|
+
}];
|
|
43
|
+
const commonData = {
|
|
44
|
+
customData: (0, _helpers.parseCustomData)({
|
|
45
|
+
contents,
|
|
46
|
+
country,
|
|
47
|
+
hotelCurrency,
|
|
48
|
+
numItems: 1,
|
|
49
|
+
propertyName
|
|
50
|
+
}),
|
|
51
|
+
eventName: 'AddToCart'
|
|
52
|
+
};
|
|
53
|
+
const responses = await Promise.all(instances.map(_ref => {
|
|
54
|
+
let {
|
|
55
|
+
id,
|
|
56
|
+
pixelId
|
|
57
|
+
} = _ref;
|
|
58
|
+
return (0, _helpers.sendData)({
|
|
59
|
+
...commonData,
|
|
60
|
+
idTracking: id,
|
|
61
|
+
pixelId
|
|
62
|
+
});
|
|
63
|
+
})).catch(() => {});
|
|
64
|
+
return responses;
|
|
65
|
+
};
|
|
66
|
+
exports.ratesAddToCart = ratesAddToCart;
|
|
67
|
+
//# sourceMappingURL=ratesAddToCart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ratesAddToCart.js","names":["_helpers","require","_helpers2","_legacy","ratesAddToCart","_getFirstOccupationOp","_getFirstOccupationOp2","instances","response","board","id","rateId","roomId","tracking","arguments","length","undefined","country","hotelInfo","currency","hotelCurrency","propertyName","rates","totalPrice","getFirstOccupationOption","boardOptions","contents","itemPrice","formatPrice","quantity","commonData","customData","parseCustomData","numItems","eventName","responses","Promise","all","map","_ref","pixelId","sendData","idTracking","catch","exports"],"sources":["../../../../../src/contexts/PerformanceManager/providers/facebook/ratesAddToCart.js"],"sourcesContent":["import { parseCustomData, sendData } from './helpers';\nimport { getFirstOccupationOption } from '../helpers';\nimport { formatPrice } from '../helpers/legacy';\n\nexport const ratesAddToCart = async ({\n instances = [],\n response: { board: { id, rateId, roomId } = {}, tracking = {} } = {},\n} = {}) => {\n // ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------\n const { country, hotelInfo: { currency: hotelCurrency = {}, propertyName } = {}, rates = [] } = tracking;\n\n const { totalPrice } = getFirstOccupationOption({ rates, roomId })?.rates[rateId]?.boardOptions[id] || {};\n const contents = [{ id, itemPrice: formatPrice(totalPrice, hotelCurrency), quantity: 1 }];\n\n const commonData = {\n customData: parseCustomData({\n contents,\n country,\n hotelCurrency,\n numItems: 1,\n propertyName,\n }),\n eventName: 'AddToCart',\n };\n\n const responses = await Promise.all(\n instances.map(({ id, pixelId }) => sendData({ ...commonData, idTracking: id, pixelId })),\n ).catch(() => {});\n\n return responses;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEO,MAAMG,cAAc,GAAG,eAAAA,CAAA,EAGnB;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAAA,IAH0B;IACnCC,SAAS,GAAG,EAAE;IACdC,QAAQ,EAAE;MAAEC,KAAK,EAAE;QAAEC,EAAE;QAAEC,MAAM;QAAEC;MAAO,CAAC,GAAG,CAAC,CAAC;MAAEC,QAAQ,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC;EACrE,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACJ;EACA,MAAM;IAAEG,OAAO;IAAEC,SAAS,EAAE;MAAEC,QAAQ,EAAEC,aAAa,GAAG,CAAC,CAAC;MAAEC;IAAa,CAAC,GAAG,CAAC,CAAC;IAAEC,KAAK,GAAG;EAAG,CAAC,GAAGT,QAAQ;EAExG,MAAM;IAAEU;EAAW,CAAC,GAAG,EAAAlB,qBAAA,OAAAmB,kCAAwB,EAAC;IAAEF,KAAK;IAAEV;EAAO,CAAC,CAAC,cAAAP,qBAAA,wBAAAC,sBAAA,GAA3CD,qBAAA,CAA6CiB,KAAK,CAACX,MAAM,CAAC,cAAAL,sBAAA,uBAA1DA,sBAAA,CAA4DmB,YAAY,CAACf,EAAE,CAAC,KAAI,CAAC,CAAC;EACzG,MAAMgB,QAAQ,GAAG,CAAC;IAAEhB,EAAE;IAAEiB,SAAS,EAAE,IAAAC,mBAAW,EAACL,UAAU,EAAEH,aAAa,CAAC;IAAES,QAAQ,EAAE;EAAE,CAAC,CAAC;EAEzF,MAAMC,UAAU,GAAG;IACjBC,UAAU,EAAE,IAAAC,wBAAe,EAAC;MAC1BN,QAAQ;MACRT,OAAO;MACPG,aAAa;MACba,QAAQ,EAAE,CAAC;MACXZ;IACF,CAAC,CAAC;IACFa,SAAS,EAAE;EACb,CAAC;EAED,MAAMC,SAAS,GAAG,MAAMC,OAAO,CAACC,GAAG,CACjC9B,SAAS,CAAC+B,GAAG,CAACC,IAAA;IAAA,IAAC;MAAE7B,EAAE;MAAE8B;IAAQ,CAAC,GAAAD,IAAA;IAAA,OAAK,IAAAE,iBAAQ,EAAC;MAAE,GAAGX,UAAU;MAAEY,UAAU,EAAEhC,EAAE;MAAE8B;IAAQ,CAAC,CAAC;EAAA,EACzF,CAAC,CAACG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;EAEjB,OAAOR,SAAS;AAClB,CAAC;AAACS,OAAA,CAAAxC,cAAA,GAAAA,cAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ratesResponse = void 0;
|
|
7
|
+
var _helpers = require("./helpers");
|
|
8
|
+
var _helpers2 = require("../../../../helpers");
|
|
9
|
+
var _helpers3 = require("../helpers");
|
|
10
|
+
var _legacy = require("../helpers/legacy");
|
|
11
|
+
const ratesResponse = async function () {
|
|
12
|
+
let {
|
|
13
|
+
instances = [],
|
|
14
|
+
response: {
|
|
15
|
+
tracking = {}
|
|
16
|
+
} = {}
|
|
17
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
+
// ! -- TODO: Try to get all data from store -------------------------------------------------------------------------
|
|
19
|
+
const {
|
|
20
|
+
idchain,
|
|
21
|
+
idtokenprovider: hotelId
|
|
22
|
+
} = (0, _helpers2.fetchUrlParams)(location.search);
|
|
23
|
+
|
|
24
|
+
// ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------
|
|
25
|
+
const {
|
|
26
|
+
country,
|
|
27
|
+
hotelInfo: {
|
|
28
|
+
currency: hotelCurrency = {},
|
|
29
|
+
propertyName
|
|
30
|
+
} = {},
|
|
31
|
+
rates = {}
|
|
32
|
+
} = tracking;
|
|
33
|
+
let contents = [];
|
|
34
|
+
let numItems = 0;
|
|
35
|
+
Object.entries((0, _helpers3.getRoomsPriceRange)(rates, hotelCurrency)).forEach(_ref => {
|
|
36
|
+
let [key, {
|
|
37
|
+
minRate = {},
|
|
38
|
+
maxRate = {}
|
|
39
|
+
} = {}] = _ref;
|
|
40
|
+
const quantity = rates[key].amountAvailable;
|
|
41
|
+
contents = [...contents, {
|
|
42
|
+
id: minRate.id,
|
|
43
|
+
quantity,
|
|
44
|
+
itemPrice: (0, _legacy.formatPrice)(minRate.totalPriceWithTaxes, hotelCurrency)
|
|
45
|
+
}, {
|
|
46
|
+
id: maxRate.id,
|
|
47
|
+
quantity,
|
|
48
|
+
itemPrice: (0, _legacy.formatPrice)(maxRate.totalPriceWithTaxes, hotelCurrency)
|
|
49
|
+
}];
|
|
50
|
+
numItems += 2 * quantity;
|
|
51
|
+
});
|
|
52
|
+
const commonData = {
|
|
53
|
+
customData: (0, _helpers.parseCustomData)({
|
|
54
|
+
contents,
|
|
55
|
+
country,
|
|
56
|
+
hotelCurrency,
|
|
57
|
+
numItems,
|
|
58
|
+
propertyName
|
|
59
|
+
})
|
|
60
|
+
};
|
|
61
|
+
const events = ['Search', ...(idchain ? ["Search_".concat(hotelId)] : [])];
|
|
62
|
+
const responses = await Promise.all(events.flatMap(eventName => instances.map(_ref2 => {
|
|
63
|
+
let {
|
|
64
|
+
id,
|
|
65
|
+
pixelId
|
|
66
|
+
} = _ref2;
|
|
67
|
+
return (0, _helpers.sendData)({
|
|
68
|
+
...commonData,
|
|
69
|
+
eventName,
|
|
70
|
+
idTracking: id,
|
|
71
|
+
pixelId
|
|
72
|
+
});
|
|
73
|
+
}))).catch(() => {});
|
|
74
|
+
return responses;
|
|
75
|
+
};
|
|
76
|
+
exports.ratesResponse = ratesResponse;
|
|
77
|
+
//# sourceMappingURL=ratesResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ratesResponse.js","names":["_helpers","require","_helpers2","_helpers3","_legacy","ratesResponse","instances","response","tracking","arguments","length","undefined","idchain","idtokenprovider","hotelId","fetchUrlParams","location","search","country","hotelInfo","currency","hotelCurrency","propertyName","rates","contents","numItems","Object","entries","getRoomsPriceRange","forEach","_ref","key","minRate","maxRate","quantity","amountAvailable","id","itemPrice","formatPrice","totalPriceWithTaxes","commonData","customData","parseCustomData","events","concat","responses","Promise","all","flatMap","eventName","map","_ref2","pixelId","sendData","idTracking","catch","exports"],"sources":["../../../../../src/contexts/PerformanceManager/providers/facebook/ratesResponse.js"],"sourcesContent":["import { parseCustomData, sendData } from './helpers';\nimport { fetchUrlParams } from '../../../../helpers';\nimport { getRoomsPriceRange } from '../helpers';\nimport { formatPrice } from '../helpers/legacy';\n\nexport const ratesResponse = async ({ instances = [], response: { tracking = {} } = {} } = {}) => {\n // ! -- TODO: Try to get all data from store -------------------------------------------------------------------------\n const { idchain, idtokenprovider: hotelId } = fetchUrlParams(location.search);\n\n // ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------\n const { country, hotelInfo: { currency: hotelCurrency = {}, propertyName } = {}, rates = {} } = tracking;\n\n let contents = [];\n let numItems = 0;\n Object.entries(getRoomsPriceRange(rates, hotelCurrency)).forEach(([key, { minRate = {}, maxRate = {} } = {}]) => {\n const quantity = rates[key].amountAvailable;\n\n contents = [\n ...contents,\n {\n id: minRate.id,\n quantity,\n itemPrice: formatPrice(minRate.totalPriceWithTaxes, hotelCurrency),\n },\n {\n id: maxRate.id,\n quantity,\n itemPrice: formatPrice(maxRate.totalPriceWithTaxes, hotelCurrency),\n },\n ];\n\n numItems += 2 * quantity;\n });\n\n const commonData = {\n customData: parseCustomData({\n contents,\n country,\n hotelCurrency,\n numItems,\n propertyName,\n }),\n };\n\n const events = ['Search', ...(idchain ? [`Search_${hotelId}`] : [])];\n\n const responses = await Promise.all(\n events.flatMap((eventName) =>\n instances.map(({ id, pixelId }) => sendData({ ...commonData, eventName, idTracking: id, pixelId })),\n ),\n ).catch(() => {});\n\n return responses;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEO,MAAMI,aAAa,GAAG,eAAAA,CAAA,EAAqE;EAAA,IAA9D;IAAEC,SAAS,GAAG,EAAE;IAAEC,QAAQ,EAAE;MAAEC,QAAQ,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC;EAAE,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAC3F;EACA,MAAM;IAAEG,OAAO;IAAEC,eAAe,EAAEC;EAAQ,CAAC,GAAG,IAAAC,wBAAc,EAACC,QAAQ,CAACC,MAAM,CAAC;;EAE7E;EACA,MAAM;IAAEC,OAAO;IAAEC,SAAS,EAAE;MAAEC,QAAQ,EAAEC,aAAa,GAAG,CAAC,CAAC;MAAEC;IAAa,CAAC,GAAG,CAAC,CAAC;IAAEC,KAAK,GAAG,CAAC;EAAE,CAAC,GAAGf,QAAQ;EAExG,IAAIgB,QAAQ,GAAG,EAAE;EACjB,IAAIC,QAAQ,GAAG,CAAC;EAChBC,MAAM,CAACC,OAAO,CAAC,IAAAC,4BAAkB,EAACL,KAAK,EAAEF,aAAa,CAAC,CAAC,CAACQ,OAAO,CAACC,IAAA,IAAgD;IAAA,IAA/C,CAACC,GAAG,EAAE;MAAEC,OAAO,GAAG,CAAC,CAAC;MAAEC,OAAO,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAAH,IAAA;IAC1G,MAAMI,QAAQ,GAAGX,KAAK,CAACQ,GAAG,CAAC,CAACI,eAAe;IAE3CX,QAAQ,GAAG,CACT,GAAGA,QAAQ,EACX;MACEY,EAAE,EAAEJ,OAAO,CAACI,EAAE;MACdF,QAAQ;MACRG,SAAS,EAAE,IAAAC,mBAAW,EAACN,OAAO,CAACO,mBAAmB,EAAElB,aAAa;IACnE,CAAC,EACD;MACEe,EAAE,EAAEH,OAAO,CAACG,EAAE;MACdF,QAAQ;MACRG,SAAS,EAAE,IAAAC,mBAAW,EAACL,OAAO,CAACM,mBAAmB,EAAElB,aAAa;IACnE,CAAC,CACF;IAEDI,QAAQ,IAAI,CAAC,GAAGS,QAAQ;EAC1B,CAAC,CAAC;EAEF,MAAMM,UAAU,GAAG;IACjBC,UAAU,EAAE,IAAAC,wBAAe,EAAC;MAC1BlB,QAAQ;MACRN,OAAO;MACPG,aAAa;MACbI,QAAQ;MACRH;IACF,CAAC;EACH,CAAC;EAED,MAAMqB,MAAM,GAAG,CAAC,QAAQ,EAAE,IAAI/B,OAAO,GAAG,WAAAgC,MAAA,CAAW9B,OAAO,EAAG,GAAG,EAAE,CAAC,CAAC;EAEpE,MAAM+B,SAAS,GAAG,MAAMC,OAAO,CAACC,GAAG,CACjCJ,MAAM,CAACK,OAAO,CAAEC,SAAS,IACvB3C,SAAS,CAAC4C,GAAG,CAACC,KAAA;IAAA,IAAC;MAAEf,EAAE;MAAEgB;IAAQ,CAAC,GAAAD,KAAA;IAAA,OAAK,IAAAE,iBAAQ,EAAC;MAAE,GAAGb,UAAU;MAAES,SAAS;MAAEK,UAAU,EAAElB,EAAE;MAAEgB;IAAQ,CAAC,CAAC;EAAA,EACpG,CACF,CAAC,CAACG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;EAEjB,OAAOV,SAAS;AAClB,CAAC;AAACW,OAAA,CAAAnD,aAAA,GAAAA,aAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bookingResponse = void 0;
|
|
7
|
+
var _legacy = require("../helpers/legacy");
|
|
8
|
+
const bookingResponse = function () {
|
|
9
|
+
let {
|
|
10
|
+
instances = [],
|
|
11
|
+
response: {
|
|
12
|
+
tracking = {}
|
|
13
|
+
} = {},
|
|
14
|
+
store: {
|
|
15
|
+
hotel: {
|
|
16
|
+
id: hotelId
|
|
17
|
+
} = {}
|
|
18
|
+
} = {}
|
|
19
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
|
+
// ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------
|
|
21
|
+
const {
|
|
22
|
+
bookingValues: {
|
|
23
|
+
checkin,
|
|
24
|
+
checkout
|
|
25
|
+
} = {},
|
|
26
|
+
guestData: {
|
|
27
|
+
email
|
|
28
|
+
} = {},
|
|
29
|
+
hotelInfo = {},
|
|
30
|
+
idReservation,
|
|
31
|
+
pendingPayment,
|
|
32
|
+
totalPriceWithoutTaxes
|
|
33
|
+
} = tracking;
|
|
34
|
+
window.gtag('set', 'user_data', {
|
|
35
|
+
email
|
|
36
|
+
});
|
|
37
|
+
if (pendingPayment) return;
|
|
38
|
+
const {
|
|
39
|
+
currency: hotelCurrency = {}
|
|
40
|
+
} = hotelInfo;
|
|
41
|
+
const value = {
|
|
42
|
+
currency: hotelCurrency.code,
|
|
43
|
+
items: [{
|
|
44
|
+
id: hotelId,
|
|
45
|
+
start_date: checkin,
|
|
46
|
+
end_date: checkout
|
|
47
|
+
}],
|
|
48
|
+
send_to: instances.map(function () {
|
|
49
|
+
let {
|
|
50
|
+
conversionLabel,
|
|
51
|
+
idAdwords
|
|
52
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
53
|
+
return "AW-".concat(idAdwords, "/").concat(conversionLabel);
|
|
54
|
+
}),
|
|
55
|
+
transaction_id: idReservation,
|
|
56
|
+
value: (0, _legacy.formatPrice)(totalPriceWithoutTaxes, hotelCurrency)
|
|
57
|
+
};
|
|
58
|
+
window.gtag('event', 'purchase', value);
|
|
59
|
+
return value;
|
|
60
|
+
};
|
|
61
|
+
exports.bookingResponse = bookingResponse;
|
|
62
|
+
//# sourceMappingURL=bookingResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookingResponse.js","names":["_legacy","require","bookingResponse","instances","response","tracking","store","hotel","id","hotelId","arguments","length","undefined","bookingValues","checkin","checkout","guestData","email","hotelInfo","idReservation","pendingPayment","totalPriceWithoutTaxes","window","gtag","currency","hotelCurrency","value","code","items","start_date","end_date","send_to","map","conversionLabel","idAdwords","concat","transaction_id","formatPrice","exports"],"sources":["../../../../../src/contexts/PerformanceManager/providers/googleAds/bookingResponse.js"],"sourcesContent":["import { formatPrice } from '../helpers/legacy';\n\nexport const bookingResponse = ({\n instances = [],\n response: { tracking = {} } = {},\n store: { hotel: { id: hotelId } = {} } = {},\n} = {}) => {\n // ! -- TODO: use of tracking should be a temporary approach ---------------------------------------------------------\n const {\n bookingValues: { checkin, checkout } = {},\n guestData: { email } = {},\n hotelInfo = {},\n idReservation,\n pendingPayment,\n totalPriceWithoutTaxes,\n } = tracking;\n\n window.gtag('set', 'user_data', { email });\n\n if (pendingPayment) return;\n\n const { currency: hotelCurrency = {} } = hotelInfo;\n\n const value = {\n currency: hotelCurrency.code,\n items: [{ id: hotelId, start_date: checkin, end_date: checkout }],\n send_to: instances.map(({ conversionLabel, idAdwords } = {}) => `AW-${idAdwords}/${conversionLabel}`),\n transaction_id: idReservation,\n value: formatPrice(totalPriceWithoutTaxes, hotelCurrency),\n };\n\n window.gtag('event', 'purchase', value);\n\n return value;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,eAAe,GAAG,SAAAA,CAAA,EAIpB;EAAA,IAJqB;IAC9BC,SAAS,GAAG,EAAE;IACdC,QAAQ,EAAE;MAAEC,QAAQ,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC;IAChCC,KAAK,EAAE;MAAEC,KAAK,EAAE;QAAEC,EAAE,EAAEC;MAAQ,CAAC,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC;EAC5C,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACJ;EACA,MAAM;IACJG,aAAa,EAAE;MAAEC,OAAO;MAAEC;IAAS,CAAC,GAAG,CAAC,CAAC;IACzCC,SAAS,EAAE;MAAEC;IAAM,CAAC,GAAG,CAAC,CAAC;IACzBC,SAAS,GAAG,CAAC,CAAC;IACdC,aAAa;IACbC,cAAc;IACdC;EACF,CAAC,GAAGhB,QAAQ;EAEZiB,MAAM,CAACC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE;IAAEN;EAAM,CAAC,CAAC;EAE1C,IAAIG,cAAc,EAAE;EAEpB,MAAM;IAAEI,QAAQ,EAAEC,aAAa,GAAG,CAAC;EAAE,CAAC,GAAGP,SAAS;EAElD,MAAMQ,KAAK,GAAG;IACZF,QAAQ,EAAEC,aAAa,CAACE,IAAI;IAC5BC,KAAK,EAAE,CAAC;MAAEpB,EAAE,EAAEC,OAAO;MAAEoB,UAAU,EAAEf,OAAO;MAAEgB,QAAQ,EAAEf;IAAS,CAAC,CAAC;IACjEgB,OAAO,EAAE5B,SAAS,CAAC6B,GAAG,CAAC;MAAA,IAAC;QAAEC,eAAe;QAAEC;MAAU,CAAC,GAAAxB,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;MAAA,aAAAyB,MAAA,CAAWD,SAAS,OAAAC,MAAA,CAAIF,eAAe;IAAA,CAAE,CAAC;IACrGG,cAAc,EAAEjB,aAAa;IAC7BO,KAAK,EAAE,IAAAW,mBAAW,EAAChB,sBAAsB,EAAEI,aAAa;EAC1D,CAAC;EAEDH,MAAM,CAACC,IAAI,CAAC,OAAO,EAAE,UAAU,EAAEG,KAAK,CAAC;EAEvC,OAAOA,KAAK;AACd,CAAC;AAACY,OAAA,CAAApC,eAAA,GAAAA,eAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_bookingResponse","require","ProviderGoogleAds","exports","bookingResponse"],"sources":["../../../../../src/contexts/PerformanceManager/providers/googleAds/index.js"],"sourcesContent":["import { bookingResponse } from './bookingResponse';\n\nexport const ProviderGoogleAds = {\n bookingResponse,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BE,eAAe,EAAfA;AACF,CAAC"}
|