fast-simon-sdk 1.6.10 → 1.6.80

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.
Files changed (130) hide show
  1. package/README.md +68 -58
  2. package/lib/config.d.ts +3 -0
  3. package/lib/config.js +4 -1
  4. package/lib/config.js.map +1 -1
  5. package/lib/index.js +19 -8
  6. package/lib/index.js.map +1 -1
  7. package/lib/models/autocomplete.d.ts +11 -0
  8. package/lib/models/common.d.ts +60 -2
  9. package/lib/models/common.js +4 -0
  10. package/lib/models/common.js.map +1 -1
  11. package/lib/models/content.d.ts +2 -0
  12. package/lib/models/events.d.ts +10 -1
  13. package/lib/models/fullTextSearch.d.ts +5 -2
  14. package/lib/models/fullTextSearch.js.map +1 -1
  15. package/lib/models/related.d.ts +3 -0
  16. package/lib/models/smartCollections.d.ts +5 -1
  17. package/lib/models/visualDiscovery.d.ts +19 -2
  18. package/lib/models/visualDiscovery.js.map +1 -1
  19. package/lib/sections/contentSearch/index.js +1 -1
  20. package/lib/sections/contentSearch/index.js.map +1 -1
  21. package/lib/sections/enums/index.d.ts +2 -0
  22. package/lib/sections/enums/index.js +2 -0
  23. package/lib/sections/enums/index.js.map +1 -1
  24. package/lib/sections/eventReporter/index.js +189 -68
  25. package/lib/sections/eventReporter/index.js.map +1 -1
  26. package/lib/sections/eventReporter/utils.d.ts +3 -2
  27. package/lib/sections/eventReporter/utils.js +9 -3
  28. package/lib/sections/eventReporter/utils.js.map +1 -1
  29. package/lib/sections/fullTextSearch/index.js +44 -10
  30. package/lib/sections/fullTextSearch/index.js.map +1 -1
  31. package/lib/sections/fullTextSearch/utils.d.ts +0 -1
  32. package/lib/sections/fullTextSearch/utils.js +11 -5
  33. package/lib/sections/fullTextSearch/utils.js.map +1 -1
  34. package/lib/sections/index.js +57 -7
  35. package/lib/sections/index.js.map +1 -1
  36. package/lib/sections/initialization/index.d.ts +4 -2
  37. package/lib/sections/initialization/index.js +69 -14
  38. package/lib/sections/initialization/index.js.map +1 -1
  39. package/lib/sections/initialization/utils.js +27 -10
  40. package/lib/sections/initialization/utils.js.map +1 -1
  41. package/lib/sections/instantSearch/index.d.ts +1 -1
  42. package/lib/sections/instantSearch/index.js +57 -7
  43. package/lib/sections/instantSearch/index.js.map +1 -1
  44. package/lib/sections/instantSearch/utils.d.ts +2 -1
  45. package/lib/sections/instantSearch/utils.js +4 -4
  46. package/lib/sections/instantSearch/utils.js.map +1 -1
  47. package/lib/sections/landingPage/index.js +15 -5
  48. package/lib/sections/landingPage/index.js.map +1 -1
  49. package/lib/sections/recommendations/index.d.ts +14 -0
  50. package/lib/sections/recommendations/index.js +75 -5
  51. package/lib/sections/recommendations/index.js.map +1 -1
  52. package/lib/sections/recommendations/utils.js +12 -7
  53. package/lib/sections/recommendations/utils.js.map +1 -1
  54. package/lib/sections/smartCollections/index.js +41 -8
  55. package/lib/sections/smartCollections/index.js.map +1 -1
  56. package/lib/sections/smartCollections/utils.d.ts +4 -4
  57. package/lib/sections/smartCollections/utils.js +52 -94
  58. package/lib/sections/smartCollections/utils.js.map +1 -1
  59. package/lib/sections/visualDiscovery/index.d.ts +23 -3
  60. package/lib/sections/visualDiscovery/index.js +194 -33
  61. package/lib/sections/visualDiscovery/index.js.map +1 -1
  62. package/lib/services/ViewportImpressionTracker.d.ts +37 -0
  63. package/lib/services/ViewportImpressionTracker.js +218 -0
  64. package/lib/services/ViewportImpressionTracker.js.map +1 -0
  65. package/lib/services/autocomplete.d.ts +5 -2
  66. package/lib/services/autocomplete.js +6 -4
  67. package/lib/services/autocomplete.js.map +1 -1
  68. package/lib/services/common.d.ts +24 -5
  69. package/lib/services/common.js +57 -11
  70. package/lib/services/common.js.map +1 -1
  71. package/lib/services/content.d.ts +7 -1
  72. package/lib/services/content.js +16 -2
  73. package/lib/services/content.js.map +1 -1
  74. package/lib/services/fullTextSearch.d.ts +1 -1
  75. package/lib/services/fullTextSearch.js +43 -6
  76. package/lib/services/fullTextSearch.js.map +1 -1
  77. package/lib/services/landingPage.d.ts +3 -1
  78. package/lib/services/landingPage.js +3 -2
  79. package/lib/services/landingPage.js.map +1 -1
  80. package/lib/services/lookAlikeProductRecommendation.d.ts +3 -1
  81. package/lib/services/lookAlikeProductRecommendation.js +3 -2
  82. package/lib/services/lookAlikeProductRecommendation.js.map +1 -1
  83. package/lib/services/related.d.ts +27 -3
  84. package/lib/services/related.js +43 -6
  85. package/lib/services/related.js.map +1 -1
  86. package/lib/services/reporting.d.ts +20 -12
  87. package/lib/services/reporting.js +37 -38
  88. package/lib/services/reporting.js.map +1 -1
  89. package/lib/services/smartCollections.d.ts +1 -1
  90. package/lib/services/smartCollections.js +46 -13
  91. package/lib/services/smartCollections.js.map +1 -1
  92. package/lib/services/viewportImpressions.d.ts +12 -0
  93. package/lib/services/viewportImpressions.js +211 -0
  94. package/lib/services/viewportImpressions.js.map +1 -0
  95. package/lib/services/visualDiscovery.d.ts +5 -6
  96. package/lib/services/visualDiscovery.js +10 -29
  97. package/lib/services/visualDiscovery.js.map +1 -1
  98. package/lib/services/visualDiscoveryReporting.d.ts +43 -0
  99. package/lib/services/visualDiscoveryReporting.js +135 -0
  100. package/lib/services/visualDiscoveryReporting.js.map +1 -0
  101. package/lib/utils/API.js +19 -4
  102. package/lib/utils/API.js.map +1 -1
  103. package/lib/utils/attentive.d.ts +1 -0
  104. package/lib/utils/attentive.js +36 -0
  105. package/lib/utils/attentive.js.map +1 -0
  106. package/lib/utils/debug.d.ts +1 -0
  107. package/lib/utils/debug.js +13 -1
  108. package/lib/utils/debug.js.map +1 -1
  109. package/lib/utils/location.d.ts +1 -0
  110. package/lib/utils/location.js +10 -0
  111. package/lib/utils/location.js.map +1 -1
  112. package/lib/utils/logger.d.ts +2 -0
  113. package/lib/utils/logger.js +26 -0
  114. package/lib/utils/logger.js.map +1 -0
  115. package/lib/utils/personalization.d.ts +5 -0
  116. package/lib/utils/personalization.js +18 -3
  117. package/lib/utils/personalization.js.map +1 -1
  118. package/lib/utils/personalizationSegment.d.ts +2 -0
  119. package/lib/utils/personalizationSegment.js +17 -0
  120. package/lib/utils/personalizationSegment.js.map +1 -0
  121. package/lib/utils/siteStateValidator.d.ts +25 -0
  122. package/lib/utils/siteStateValidator.js +45 -0
  123. package/lib/utils/siteStateValidator.js.map +1 -0
  124. package/lib/utils/updateRecentSearches.d.ts +9 -0
  125. package/lib/utils/updateRecentSearches.js +50 -26
  126. package/lib/utils/updateRecentSearches.js.map +1 -1
  127. package/lib/utils/validation.d.ts +1 -0
  128. package/lib/utils/validation.js +13 -1
  129. package/lib/utils/validation.js.map +1 -1
  130. package/package.json +44 -41
@@ -19,15 +19,20 @@ var utils_3 = require("../fullTextSearch/utils");
19
19
  var config_1 = require("../../config");
20
20
  var reporting_1 = require("../../services/reporting");
21
21
  var utils_4 = require("../recommendations/utils");
22
- var updateRecentSearches_1 = require("../../utils/updateRecentSearches");
22
+ var visualDiscovery_1 = require("../visualDiscovery");
23
+ var recommendations_1 = require("../recommendations");
24
+ var logger_1 = require("../../utils/logger");
25
+ var validation_1 = require("../../utils/validation");
23
26
  exports.SPAOnlyReports = new Set([
24
27
  "lookALikeViewSerp",
25
28
  "quickViewSerp",
26
29
  "lookALikeViewCollection",
27
30
  "quickViewCollection",
31
+ "quickViewWidget",
28
32
  "search",
29
33
  "collection",
30
- "cartPerformed"
34
+ "cartPerformed",
35
+ "recommendationsProductsShown"
31
36
  ]);
32
37
  var event = function (_a) {
33
38
  var report = _a.report, self = _a.self;
@@ -36,9 +41,9 @@ var event = function (_a) {
36
41
  if (report.eventName === "productFromCollection" && !report.data.query) {
37
42
  report = __assign(__assign({}, report), { data: __assign(__assign({}, report.data), { query: categoryName !== null && categoryName !== void 0 ? categoryName : "" }) });
38
43
  }
39
- console.log("event-received", type, report);
44
+ console.log("event-data-received", type, report);
40
45
  if (type === "MPA" && !exports.SPAOnlyReports.has(report.eventName)) {
41
- (0, utils_1.saveEvent)(report);
46
+ (0, utils_1.saveEvent)(report, self);
42
47
  }
43
48
  else {
44
49
  reportEvent({ report: report, self: self });
@@ -46,7 +51,9 @@ var event = function (_a) {
46
51
  };
47
52
  exports.event = event;
48
53
  function reportEvent(_a) {
54
+ var _b, _c, _d, _e, _f, _g, _h;
49
55
  var report = _a.report, self = _a.self;
56
+ (0, logger_1.verboseLog)("Event | ".concat(report.eventName), report.data);
50
57
  switch (report.eventName) {
51
58
  case "instantsearch-product": {
52
59
  reportAutocompleteProductSeen({ self: self, report: report });
@@ -96,6 +103,10 @@ function reportEvent(_a) {
96
103
  reportQuickViewCollection({ self: self, report: report, type: "Quick View" });
97
104
  break;
98
105
  }
106
+ case "quickViewWidget": {
107
+ reportQuickViewWidget({ self: self, report: report, type: "Quick View" });
108
+ break;
109
+ }
99
110
  case "quickViewSerp": {
100
111
  reportQuickViewSerp({ self: self, report: report, type: "Quick View" });
101
112
  break;
@@ -124,30 +135,62 @@ function reportEvent(_a) {
124
135
  reportCartVisited({ self: self, report: report });
125
136
  break;
126
137
  }
138
+ case "discoveryOpen": {
139
+ (_b = (0, visualDiscovery_1.discoveryOpen)(__assign({ self: self }, report.data))) === null || _b === void 0 ? void 0 : _b.then((function (result) {
140
+ }));
141
+ break;
142
+ }
143
+ case "discoveryProductVisit": {
144
+ (_c = (0, visualDiscovery_1.discoveryProductVisit)(__assign({ self: self }, report.data))) === null || _c === void 0 ? void 0 : _c.then((function (result) {
145
+ }));
146
+ break;
147
+ }
148
+ case "vsProductAddedToCart": {
149
+ (_d = (0, visualDiscovery_1.productAddedToCart)(__assign({ self: self }, report.data))) === null || _d === void 0 ? void 0 : _d.then((function (result) {
150
+ }));
151
+ break;
152
+ }
153
+ case "galleryImageClicked": {
154
+ (_e = (0, visualDiscovery_1.galleryImageClicked)(__assign({ self: self }, report.data))) === null || _e === void 0 ? void 0 : _e.then((function (result) {
155
+ }));
156
+ break;
157
+ }
158
+ case "recommendationsProductsShown": {
159
+ if (((_g = (_f = report.data) === null || _f === void 0 ? void 0 : _f.products) === null || _g === void 0 ? void 0 : _g.length) === 0) {
160
+ console.log("%c\u274C IS+ SDK Error | Cannot Report Recommendation With Empty Products", 'font-weight: bold; font-size: 12px; color: red');
161
+ return;
162
+ }
163
+ (_h = (0, recommendations_1.reportRecommendationsProductsShown)(__assign({ self: self }, report.data))) === null || _h === void 0 ? void 0 : _h.then((function (result) {
164
+ }));
165
+ break;
166
+ }
127
167
  }
128
168
  localStorage.removeItem(config_1.POST_LOAD_EVENT_KEY);
129
169
  }
130
170
  var reportAutocompleteProductSeen = function (_a) {
131
171
  var self = _a.self, report = _a.report;
132
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
172
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
133
173
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
134
174
  var _c = report.data, productID = _c.productID, query = _c.query, productQuery = _c.productQuery;
175
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "query"], report.data);
135
176
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
136
177
  function reportEvent() {
137
178
  (0, utils_3.setRecentSearchProducts)(self, productID);
138
179
  (0, utils_1.postLoadCallback)({
139
180
  eventName: report.eventName,
140
181
  promise: reporting_1.Reporting.productSeen({
141
- type: "autocomplete", query: productQuery,
182
+ type: "autocomplete",
142
183
  term: query,
143
184
  uuid: uuid,
144
185
  storeID: storeID,
145
186
  userToken: userToken,
146
187
  productId: productID,
147
188
  sessionStart: sessionToken.start,
148
- cartToken: cartToken
189
+ cartToken: cartToken,
190
+ channel: channel
149
191
  }),
150
- callback: callback
192
+ callback: callback,
193
+ UUID: uuid
151
194
  });
152
195
  }
153
196
  if (report.reportAppType && report.reportAppType === "SPA") {
@@ -163,29 +206,33 @@ var reportAutocompleteProductSeen = function (_a) {
163
206
  };
164
207
  var reportAutocompleteCategory = function (_a) {
165
208
  var report = _a.report, self = _a.self;
166
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
209
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
167
210
  var callback = report.callback;
168
211
  var _c = report.data, categoryID = _c.categoryID, query = _c.query;
212
+ (0, validation_1.validateReportData)(report.eventName, ["categoryID", "query"], report.data);
169
213
  (0, utils_1.postLoadCallback)({
170
214
  eventName: report.eventName,
171
215
  promise: reporting_1.Reporting.categorySearchSeen({
172
- query: query,
173
216
  uuid: uuid,
174
217
  storeID: storeID,
175
218
  userToken: userToken,
176
219
  categoryID: categoryID,
220
+ term: query,
177
221
  sessionStart: sessionToken.start,
178
- cartToken: cartToken
222
+ cartToken: cartToken,
223
+ channel: channel
179
224
  }),
180
- callback: callback
225
+ callback: callback,
226
+ UUID: uuid
181
227
  });
182
228
  };
183
229
  var reportDirectProductViewData = function (_a) {
184
230
  var report = _a.report, self = _a.self;
185
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
231
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
186
232
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
187
233
  var productID = report.data.productID;
188
234
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
235
+ (0, validation_1.validateReportData)(report.eventName, ["productID"], report.data);
189
236
  setTimeout(function () {
190
237
  if (!targetURL || targetURL.includes(window.location.pathname)) {
191
238
  (0, utils_1.postLoadCallback)({
@@ -197,18 +244,21 @@ var reportDirectProductViewData = function (_a) {
197
244
  userToken: userToken,
198
245
  productId: productID,
199
246
  sessionStart: sessionToken.start,
200
- cartToken: cartToken
247
+ cartToken: cartToken,
248
+ channel: channel
201
249
  }),
202
- callback: callback
250
+ callback: callback,
251
+ UUID: uuid
203
252
  });
204
253
  }
205
254
  }, waitTime);
206
255
  };
207
256
  var reportAutocompletePopularSearch = function (_a) {
208
257
  var report = _a.report, self = _a.self;
209
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
258
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
210
259
  var callback = report.callback;
211
260
  var _c = report.data, query = _c.query, term = _c.term;
261
+ (0, validation_1.validateReportData)(report.eventName, ["term", "query"], report.data);
212
262
  (0, utils_1.postLoadCallback)({
213
263
  eventName: report.eventName,
214
264
  promise: reporting_1.Reporting.popularSearchSeen({
@@ -218,13 +268,15 @@ var reportAutocompletePopularSearch = function (_a) {
218
268
  userToken: userToken,
219
269
  term: term,
220
270
  sessionStart: sessionToken.start,
221
- cartToken: cartToken
271
+ cartToken: cartToken,
272
+ channel: channel
222
273
  }),
223
- callback: callback
274
+ callback: callback,
275
+ UUID: uuid
224
276
  });
225
277
  };
226
278
  var reportSearchPreformed = function (_a, retryCount, maxRetries) {
227
- var _b, _c, _d, _e, _f;
279
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
228
280
  var self = _a.self, report = _a.report;
229
281
  if (retryCount === void 0) { retryCount = 0; }
230
282
  if (maxRetries === void 0) { maxRetries = 8; }
@@ -239,10 +291,13 @@ var reportSearchPreformed = function (_a, retryCount, maxRetries) {
239
291
  console.error('Max retries reached; data not ready for reporting.');
240
292
  }
241
293
  }
242
- var _g = self.data, userToken = _g.userToken, sessionToken = _g.sessionToken, uuid = _g.uuid, storeID = _g.storeID, cartToken = _g.cartToken;
243
- var _h = report.data, query = _h.query, narrowBy = _h.narrowBy, sortBy = _h.sortBy, products = _h.products, pagenum = _h.pagenum, rescount = _h.rescount, promoTiles = _h.promoTiles;
294
+ var _o = self.data, userToken = _o.userToken, sessionToken = _o.sessionToken, uuid = _o.uuid, storeID = _o.storeID, cartToken = _o.cartToken, channel = _o.channel;
295
+ var _p = report.data, query = _p.query, narrowBy = _p.narrowBy, sortBy = _p.sortBy, products = _p.products, pagenum = _p.pagenum, rescount = _p.rescount, promoTiles = _p.promoTiles;
244
296
  var callback = report.callback;
297
+ (0, validation_1.validateReportData)(report.eventName, ["query"], report.data);
245
298
  var currentResponse = (_c = self.fsGridCurrentResponse) === null || _c === void 0 ? void 0 : _c.data;
299
+ var spv = ((_d = self === null || self === void 0 ? void 0 : self.data) === null || _d === void 0 ? void 0 : _d.spv_post_load) ? (_e = self === null || self === void 0 ? void 0 : self.data) === null || _e === void 0 ? void 0 : _e.spv_post_load : undefined;
300
+ var productsPerPage = ((_g = (_f = self === null || self === void 0 ? void 0 : self.temp) === null || _f === void 0 ? void 0 : _f.customData) === null || _g === void 0 ? void 0 : _g.productsPerPage) || ((_j = (_h = self.data) === null || _h === void 0 ? void 0 : _h.dashboard) === null || _j === void 0 ? void 0 : _j.products_per_page) || undefined;
246
301
  (0, utils_1.postLoadCallback)({
247
302
  eventName: report.eventName,
248
303
  promise: reporting_1.Reporting.searchPerformed({
@@ -254,19 +309,22 @@ var reportSearchPreformed = function (_a, retryCount, maxRetries) {
254
309
  narrow: narrowBy,
255
310
  sortBy: sortBy,
256
311
  cartToken: cartToken,
257
- products: products || ((_d = currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.items) === null || _d === void 0 ? void 0 : _d.map(function (item) { return item === null || item === void 0 ? void 0 : item.id; })) || undefined,
312
+ products: products || ((_k = currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.items) === null || _k === void 0 ? void 0 : _k.map(function (item) { return item === null || item === void 0 ? void 0 : item.id; })) || undefined,
258
313
  pagenum: pagenum || (currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.p) || undefined,
259
314
  rescount: rescount || (currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.total_results) || undefined,
260
315
  promoTiles: promoTiles,
261
- personalizedProducts: ((_e = self === null || self === void 0 ? void 0 : self.data) === null || _e === void 0 ? void 0 : _e.personalizedProducts) ? self.data.personalizedProducts : ((_f = currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.personalized_products) === null || _f === void 0 ? void 0 : _f.toString()) || undefined,
262
- sessionProducts: (0, updateRecentSearches_1.getRecentProducts)().join(",")
316
+ personalizedProducts: ((_l = self === null || self === void 0 ? void 0 : self.data) === null || _l === void 0 ? void 0 : _l.personalizedProducts) ? self.data.personalizedProducts : ((_m = currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.personalized_products) === null || _m === void 0 ? void 0 : _m.toString()) || undefined,
317
+ channel: channel,
318
+ spv: spv,
319
+ productsPerPage: productsPerPage
263
320
  }),
264
- callback: callback
321
+ callback: callback,
322
+ UUID: uuid
265
323
  });
266
324
  self.fsGridCurrentResponse = {};
267
325
  };
268
326
  var reportSmartCollectionPreformed = function (_a, retryCount, maxRetries) {
269
- var _b, _c, _d, _e;
327
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
270
328
  var self = _a.self, report = _a.report;
271
329
  if (retryCount === void 0) { retryCount = 0; }
272
330
  if (maxRetries === void 0) { maxRetries = 8; }
@@ -295,11 +353,14 @@ var reportSmartCollectionPreformed = function (_a, retryCount, maxRetries) {
295
353
  console.error('Max retries reached; data not ready for reporting.');
296
354
  }
297
355
  }
298
- var _f = self.data, userToken = _f.userToken, sessionToken = _f.sessionToken, uuid = _f.uuid, storeID = _f.storeID, cartToken = _f.cartToken;
299
- var _g = report.data, query = _g.query, categoryID = _g.categoryID, narrowBy = _g.narrowBy, sortBy = _g.sortBy, products = _g.products, pagenum = _g.pagenum, rescount = _g.rescount, promoTiles = _g.promoTiles, fromTurboLink = _g.fromTurboLink;
356
+ var _m = self.data, userToken = _m.userToken, sessionToken = _m.sessionToken, uuid = _m.uuid, storeID = _m.storeID, cartToken = _m.cartToken, channel = _m.channel;
357
+ var _o = report.data, query = _o.query, categoryID = _o.categoryID, narrowBy = _o.narrowBy, sortBy = _o.sortBy, products = _o.products, pagenum = _o.pagenum, rescount = _o.rescount, promoTiles = _o.promoTiles, fromTurboLink = _o.fromTurboLink;
300
358
  var callback = report.callback;
301
359
  var categoryName = self.temp.smartCollections.name;
302
360
  var currentResponse = (_b = self.fsGridCurrentResponse) === null || _b === void 0 ? void 0 : _b.data;
361
+ var spv = ((_c = self === null || self === void 0 ? void 0 : self.data) === null || _c === void 0 ? void 0 : _c.spv_post_load) ? (_d = self === null || self === void 0 ? void 0 : self.data) === null || _d === void 0 ? void 0 : _d.spv_post_load : undefined;
362
+ var productsPerPage = ((_f = (_e = self === null || self === void 0 ? void 0 : self.temp) === null || _e === void 0 ? void 0 : _e.customData) === null || _f === void 0 ? void 0 : _f.productsPerPage) || ((_h = (_g = self === null || self === void 0 ? void 0 : self.data) === null || _g === void 0 ? void 0 : _g.dashboard) === null || _h === void 0 ? void 0 : _h.products_per_page) || undefined;
363
+ (0, validation_1.validateReportData)(report.eventName, ["categoryID"], report.data);
303
364
  (0, utils_1.postLoadCallback)({
304
365
  eventName: report.eventName,
305
366
  promise: reporting_1.Reporting.collectionPerformed({
@@ -312,22 +373,26 @@ var reportSmartCollectionPreformed = function (_a, retryCount, maxRetries) {
312
373
  narrow: narrowBy,
313
374
  sortBy: sortBy,
314
375
  cartToken: cartToken,
315
- products: products || ((_c = currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.items) === null || _c === void 0 ? void 0 : _c.map(function (item) { return item === null || item === void 0 ? void 0 : item.id; })) || undefined,
376
+ products: products || ((_j = currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.items) === null || _j === void 0 ? void 0 : _j.map(function (item) { return item === null || item === void 0 ? void 0 : item.id; })) || undefined,
316
377
  pagenum: pagenum || (currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.p) || undefined,
317
378
  rescount: rescount || (currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.total_results) || undefined,
318
379
  promoTiles: promoTiles,
319
- personalizedProducts: ((_d = self === null || self === void 0 ? void 0 : self.data) === null || _d === void 0 ? void 0 : _d.personalizedProducts) ? self.data.personalizedProducts : ((_e = currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.personalized_products) === null || _e === void 0 ? void 0 : _e.toString()) || undefined,
320
- sessionProducts: (0, updateRecentSearches_1.getRecentProducts)().join(",")
380
+ personalizedProducts: ((_k = self === null || self === void 0 ? void 0 : self.data) === null || _k === void 0 ? void 0 : _k.personalizedProducts) ? self.data.personalizedProducts : ((_l = currentResponse === null || currentResponse === void 0 ? void 0 : currentResponse.personalized_products) === null || _l === void 0 ? void 0 : _l.toString()) || undefined,
381
+ channel: channel,
382
+ spv: spv,
383
+ productsPerPage: productsPerPage
321
384
  }, fromTurboLink),
322
- callback: callback
385
+ callback: callback,
386
+ UUID: uuid
323
387
  });
324
388
  self.fsGridCurrentResponse = {};
325
389
  };
326
390
  var reportQuickViewSerp = function (_a) {
327
391
  var self = _a.self, report = _a.report, type = _a.type;
328
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
392
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
329
393
  var _c = report.data, position = _c.position, productID = _c.productID, term = _c.term;
330
394
  var callback = report.callback;
395
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "term", "position"], report.data);
331
396
  (0, utils_1.postLoadCallback)({
332
397
  eventName: report.eventName,
333
398
  promise: reporting_1.Reporting.popUpUsed({
@@ -339,16 +404,19 @@ var reportQuickViewSerp = function (_a) {
339
404
  productId: productID,
340
405
  position: position,
341
406
  sessionStart: sessionToken.start,
342
- type: type
407
+ type: type,
408
+ channel: channel
343
409
  }),
344
- callback: callback
410
+ callback: callback,
411
+ UUID: uuid
345
412
  });
346
413
  };
347
414
  var reportQuickViewCollection = function (_a) {
348
415
  var self = _a.self, report = _a.report, type = _a.type;
349
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
416
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
350
417
  var _c = report.data, position = _c.position, productID = _c.productID, collectionID = _c.collectionID;
351
418
  var callback = report.callback;
419
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "collectionID", "position"], report.data);
352
420
  var categoryName = self.temp.smartCollections.name;
353
421
  (0, utils_1.postLoadCallback)({
354
422
  eventName: report.eventName,
@@ -362,16 +430,43 @@ var reportQuickViewCollection = function (_a) {
362
430
  categoryID: collectionID,
363
431
  categoryName: categoryName || (0, utils_2.getCollectionName)(self, collectionID),
364
432
  sessionStart: sessionToken.start,
365
- type: type
433
+ type: type,
434
+ channel: channel
366
435
  }),
367
- callback: callback
436
+ callback: callback,
437
+ UUID: uuid
438
+ });
439
+ };
440
+ var reportQuickViewWidget = function (_a) {
441
+ var self = _a.self, report = _a.report, type = _a.type;
442
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
443
+ var _c = report.data, position = _c.position, productID = _c.productID, widget_id = _c.widget_id;
444
+ var callback = report.callback;
445
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "widget_id", "position"], report.data);
446
+ (0, utils_1.postLoadCallback)({
447
+ eventName: report.eventName,
448
+ promise: reporting_1.Reporting.popUpUsed({
449
+ uuid: uuid,
450
+ storeID: storeID,
451
+ userToken: userToken,
452
+ cartToken: cartToken,
453
+ productId: productID,
454
+ position: position,
455
+ widget_id: widget_id,
456
+ sessionStart: sessionToken.start,
457
+ type: type,
458
+ channel: channel
459
+ }),
460
+ callback: callback,
461
+ UUID: uuid
368
462
  });
369
463
  };
370
464
  var reportSerpProductSeen = function (_a) {
371
465
  var self = _a.self, report = _a.report;
372
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
466
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
373
467
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
374
468
  var _c = report.data, productID = _c.productID, query = _c.query, _d = _c.position, position = _d === void 0 ? 1 : _d, imageID = _c.imageID;
469
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "query", "position"], report.data);
375
470
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
376
471
  setTimeout(function () {
377
472
  if (!targetURL || targetURL.includes(window.location.pathname)) {
@@ -389,19 +484,22 @@ var reportSerpProductSeen = function (_a) {
389
484
  sessionStart: sessionToken.start,
390
485
  position: position,
391
486
  cartToken: cartToken,
392
- recommended: (0, utils_3.isRecentSearchProduct)(productID, self),
393
- imageID: imageID
487
+ recommended: (0, utils_2.isRecommendedProduct)(productID),
488
+ imageID: imageID,
489
+ channel: channel
394
490
  }),
395
- callback: callback
491
+ callback: callback,
492
+ UUID: uuid
396
493
  });
397
494
  }
398
495
  }, waitTime);
399
496
  };
400
497
  var reportRecommendationsProductSeen = function (_a) {
401
498
  var self = _a.self, report = _a.report;
402
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
499
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
403
500
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
404
- var _c = report.data, productID = _c.productID, _d = _c.position, position = _d === void 0 ? 1 : _d, sourceProductID = _c.sourceProductID;
501
+ var _c = report.data, productID = _c.productID, _d = _c.position, position = _d === void 0 ? 1 : _d, sourceProductID = _c.sourceProductID, widget_id = _c.widget_id;
502
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "position", "widget_id"], report.data);
405
503
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
406
504
  var promotedByPersonalization = (0, utils_4.getPromotedByPersonalization)();
407
505
  setTimeout(function () {
@@ -420,20 +518,23 @@ var reportRecommendationsProductSeen = function (_a) {
420
518
  position: position,
421
519
  reference: 'isp_rel_prd',
422
520
  recommended: (promotedByPersonalization === null || promotedByPersonalization === void 0 ? void 0 : promotedByPersonalization[productID]) ? true : undefined,
423
- rec_src: promotedByPersonalization === null || promotedByPersonalization === void 0 ? void 0 : promotedByPersonalization[productID]
521
+ rec_src: promotedByPersonalization === null || promotedByPersonalization === void 0 ? void 0 : promotedByPersonalization[productID],
522
+ widget_id: widget_id,
523
+ channel: channel
424
524
  }),
425
- callback: callback
525
+ callback: callback,
526
+ UUID: uuid
426
527
  });
427
528
  }
428
529
  }, waitTime);
429
530
  };
430
531
  var reportProductFromCollection = function (_a) {
431
532
  var report = _a.report, self = _a.self;
432
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
533
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
433
534
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
434
535
  var _c = report.data, productID = _c.productID, collectionID = _c.collectionID, _d = _c.position, position = _d === void 0 ? 1 : _d, query = _c.query, imageID = _c.imageID;
435
536
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
436
- var isRecommended = (0, utils_2.isRecommendedProduct)(productID);
537
+ var isRecommended = (0, utils_2.isRecommendedProduct)(productID, self.data.collectionProductIds);
437
538
  /* check if categories were fetched, if not retry in 300ms */
438
539
  if (!query && self.data.categories.length === 0) {
439
540
  setTimeout(function () {
@@ -441,6 +542,7 @@ var reportProductFromCollection = function (_a) {
441
542
  }, 300);
442
543
  return;
443
544
  }
545
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "collectionID", "position"], report.data);
444
546
  setTimeout(function () {
445
547
  if (!targetURL || targetURL.includes(window.location.pathname)) {
446
548
  (0, utils_2.updateRecentCollectionProducts)(productID, collectionID);
@@ -459,16 +561,18 @@ var reportProductFromCollection = function (_a) {
459
561
  position: position,
460
562
  cartToken: cartToken,
461
563
  recommended: isRecommended,
462
- imageID: imageID
564
+ imageID: imageID,
565
+ channel: channel
463
566
  }),
464
- callback: callback
567
+ callback: callback,
568
+ UUID: uuid
465
569
  });
466
570
  }
467
571
  }, waitTime);
468
572
  };
469
573
  var reportPromoTileFromCollection = function (_a) {
470
574
  var report = _a.report, self = _a.self;
471
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
575
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
472
576
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
473
577
  var _c = report.data, productID = _c.productID, collectionID = _c.collectionID, _d = _c.position, position = _d === void 0 ? 1 : _d, query = _c.query, imageID = _c.imageID, thumbnail = _c.thumbnail, link = _c.link;
474
578
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
@@ -480,6 +584,7 @@ var reportPromoTileFromCollection = function (_a) {
480
584
  }, 300);
481
585
  return;
482
586
  }
587
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "collectionID"], report.data);
483
588
  setTimeout(function () {
484
589
  if (!targetURL || targetURL.includes(window.location.pathname)) {
485
590
  //updateRecentCollectionProducts(productID, collectionID);
@@ -500,19 +605,22 @@ var reportPromoTileFromCollection = function (_a) {
500
605
  recommended: isRecommended,
501
606
  imageID: imageID,
502
607
  link: link,
503
- thumbnail: thumbnail
608
+ thumbnail: thumbnail,
609
+ channel: channel
504
610
  }),
505
- callback: callback
611
+ callback: callback,
612
+ UUID: uuid
506
613
  });
507
614
  }
508
615
  }, waitTime);
509
616
  };
510
617
  var reportPromoTileFromSerp = function (_a) {
511
618
  var report = _a.report, self = _a.self;
512
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
619
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
513
620
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
514
621
  var _c = report.data, productID = _c.productID, query = _c.query, _d = _c.position, position = _d === void 0 ? 1 : _d, imageID = _c.imageID, thumbnail = _c.thumbnail, link = _c.link;
515
622
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
623
+ (0, validation_1.validateReportData)(report.eventName, ["productID", "query"], report.data);
516
624
  setTimeout(function () {
517
625
  if (!targetURL || targetURL.includes(window.location.pathname)) {
518
626
  //setRecentSearchProducts(self, productID);
@@ -529,22 +637,25 @@ var reportPromoTileFromSerp = function (_a) {
529
637
  sessionStart: sessionToken.start,
530
638
  position: position,
531
639
  cartToken: cartToken,
532
- recommended: (0, utils_3.isRecentSearchProduct)(productID, self),
640
+ recommended: (0, utils_2.isRecommendedProduct)(productID),
533
641
  imageID: imageID,
534
642
  link: link,
535
- thumbnail: thumbnail
643
+ thumbnail: thumbnail,
644
+ channel: channel
536
645
  }),
537
- callback: callback
646
+ callback: callback,
647
+ UUID: uuid
538
648
  });
539
649
  }
540
650
  }, waitTime);
541
651
  };
542
652
  var reportProductFromLookALike = function (_a) {
543
653
  var report = _a.report, self = _a.self;
544
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
654
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
545
655
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
546
656
  var _c = report.data, productID = _c.productID, _d = _c.position, position = _d === void 0 ? 1 : _d, originalProduct = _c.originalProduct;
547
657
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
658
+ (0, validation_1.validateReportData)(report.eventName, ["productID"], report.data);
548
659
  setTimeout(function () {
549
660
  if (!targetURL || targetURL.includes(window.location.pathname)) {
550
661
  (0, utils_1.postLoadCallback)({
@@ -558,19 +669,22 @@ var reportProductFromLookALike = function (_a) {
558
669
  sessionStart: sessionToken.start,
559
670
  position: position,
560
671
  cartToken: cartToken,
561
- reference: "isp_look_a_like"
672
+ reference: "isp_look_a_like",
673
+ channel: channel
562
674
  }),
563
- callback: callback
675
+ callback: callback,
676
+ UUID: uuid
564
677
  });
565
678
  }
566
679
  }, waitTime);
567
680
  };
568
681
  var reportProductFromQuickView = function (_a) {
569
682
  var report = _a.report, self = _a.self;
570
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
683
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
571
684
  var time = report.time, callback = report.callback, targetURL = report.targetURL;
572
685
  var _c = report.data, productID = _c.productID, _d = _c.position, position = _d === void 0 ? 1 : _d, originalProduct = _c.originalProduct;
573
686
  var waitTime = time ? time : config_1.POST_LOAD_WAIT_TIME;
687
+ (0, validation_1.validateReportData)(report.eventName, ["productID"], report.data);
574
688
  setTimeout(function () {
575
689
  if (!targetURL || targetURL.includes(window.location.pathname)) {
576
690
  (0, utils_1.postLoadCallback)({
@@ -585,18 +699,21 @@ var reportProductFromQuickView = function (_a) {
585
699
  position: position,
586
700
  cartToken: cartToken,
587
701
  type: "quick view",
588
- reference: "isp_look_a_like"
702
+ reference: "isp_look_a_like",
703
+ channel: channel
589
704
  }),
590
- callback: callback
705
+ callback: callback,
706
+ UUID: uuid
591
707
  });
592
708
  }
593
709
  }, waitTime);
594
710
  };
595
711
  var reportAddToCart = function (_a) {
596
712
  var report = _a.report, self = _a.self;
597
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
713
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
598
714
  var callback = report.callback;
599
715
  var productID = report.data.productID;
716
+ (0, validation_1.validateReportData)(report.eventName, ["productID"], report.data);
600
717
  (0, utils_1.postLoadCallback)({
601
718
  eventName: report.eventName,
602
719
  promise: reporting_1.Reporting.addToCart({
@@ -605,14 +722,16 @@ var reportAddToCart = function (_a) {
605
722
  uuid: uuid,
606
723
  storeID: storeID,
607
724
  cartToken: cartToken,
608
- productID: productID
725
+ productID: productID,
726
+ channel: channel
609
727
  }),
610
- callback: callback
728
+ callback: callback,
729
+ UUID: uuid
611
730
  });
612
731
  };
613
732
  var reportCartVisited = function (_a) {
614
733
  var report = _a.report, self = _a.self;
615
- var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken;
734
+ var _b = self.data, userToken = _b.userToken, sessionToken = _b.sessionToken, uuid = _b.uuid, storeID = _b.storeID, cartToken = _b.cartToken, channel = _b.channel;
616
735
  var callback = report.callback;
617
736
  (0, utils_1.postLoadCallback)({
618
737
  eventName: report.eventName,
@@ -622,8 +741,10 @@ var reportCartVisited = function (_a) {
622
741
  uuid: uuid,
623
742
  storeID: storeID,
624
743
  cartToken: cartToken,
744
+ channel: channel
625
745
  }),
626
- callback: callback
746
+ callback: callback,
747
+ UUID: uuid
627
748
  });
628
749
  };
629
750
  //# sourceMappingURL=index.js.map