@depict-ai/dpc 1.0.35 → 1.0.37

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/ES10/index.cjs CHANGED
@@ -17,7 +17,7 @@ function $parcel$interopDefault(a) {
17
17
  $parcel$export(module.exports, "DPC", () => $89ae37e3a26189b4$export$820526014323765f);
18
18
  $parcel$export(module.exports, "version", () => $fcc8287091fb489d$export$83d89fbfd8236492);
19
19
  /*! Depict PerformanceClient */
20
- const $fcc8287091fb489d$export$83d89fbfd8236492 = "1.0.35";
20
+ const $fcc8287091fb489d$export$83d89fbfd8236492 = "1.0.37";
21
21
  let $405164bc961cc106$export$8ae64f3d447c14f7;
22
22
  (function (ProductCardType) {
23
23
  ProductCardType[ProductCardType["Recommendation"] = 0] = "Recommendation";
@@ -155,18 +155,18 @@ class $89ae37e3a26189b4$export$820526014323765f {
155
155
  $89ae37e3a26189b4$var$_classPrivateMethodInitSpec(this, $89ae37e3a26189b4$var$_getContextData);
156
156
  $89ae37e3a26189b4$var$_classPrivateMethodInitSpec(this, $89ae37e3a26189b4$var$_parseOptions);
157
157
  $89ae37e3a26189b4$var$_classPrivateMethodInitSpec(this, $89ae37e3a26189b4$var$_resetSentPageViewForCurrentHref);
158
- (0, $parcel$interopDefault($9AWcE$babelruntimehelpersdefineProperty))(this, "auto_observe", true);
158
+ $parcel$interopDefault($9AWcE$babelruntimehelpersdefineProperty)(this, "auto_observe", true);
159
159
  $89ae37e3a26189b4$var$_classPrivateFieldInitSpec(this, $89ae37e3a26189b4$var$_has_sent_pageview_for_current_href, {
160
160
  writable: true,
161
161
  value: false
162
162
  });
163
- (0, $parcel$interopDefault($9AWcE$babelruntimehelpersdefineProperty))(this, "tracked_elements", new WeakSet());
163
+ $parcel$interopDefault($9AWcE$babelruntimehelpersdefineProperty)(this, "tracked_elements", new WeakSet());
164
164
  // Make sure we do not construct dpc more than once.
165
165
  if (((_window$depict = window.depict) === null || _window$depict === void 0 ? void 0 : _window$depict.dpc) instanceof $89ae37e3a26189b4$export$820526014323765f) {
166
- (0, $9AWcE$depictaiutilishared.dlog)("DPC already initialized. Returning existing instance.");
166
+ $9AWcE$depictaiutilishared.dlog("DPC already initialized. Returning existing instance.");
167
167
  return window.depict.dpc;
168
168
  }
169
- (0, $5323e9ffea4e414a$export$7a1bb429756ced60)(this);
169
+ $5323e9ffea4e414a$export$7a1bb429756ced60(this);
170
170
  this.merchant = merchant;
171
171
  $89ae37e3a26189b4$var$_classPrivateMethodGet(this, $89ae37e3a26189b4$var$_parseOptions, $89ae37e3a26189b4$var$_parseOptions2).call(this, _options);
172
172
  $89ae37e3a26189b4$var$_classPrivateMethodGet(this, $89ae37e3a26189b4$var$_resetSentPageViewForCurrentHref, $89ae37e3a26189b4$var$_resetSentPageViewForCurrentHref2).call(this);
@@ -180,7 +180,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
180
180
  */
181
181
  checkIfTracked(element) {
182
182
  if (this.tracked_elements.has(element)) {
183
- (0, $9AWcE$depictaiutilishared.dlog)("Already tracked", element);
183
+ $9AWcE$depictaiutilishared.dlog("Already tracked", element);
184
184
  return true;
185
185
  }
186
186
  this.tracked_elements.add(element);
@@ -195,7 +195,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
195
195
  case (0, $405164bc961cc106$export$8ae64f3d447c14f7).Recommendation:
196
196
  case (0, $405164bc961cc106$export$8ae64f3d447c14f7).SnakeRecommendation:
197
197
  card.addEventListener("click", () => this.sendRecommendationClickEvent(tracking_id));
198
- (0, $9AWcE$depictaiutilishared.impression_track_element)({
198
+ $9AWcE$depictaiutilishared.impression_track_element({
199
199
  element: card,
200
200
  data: {
201
201
  recommendation_id: tracking_id,
@@ -205,7 +205,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
205
205
  break;
206
206
  case (0, $405164bc961cc106$export$8ae64f3d447c14f7).SearchResult:
207
207
  card.addEventListener("click", () => this.sendSearchResultClickEvent(tracking_id));
208
- (0, $9AWcE$depictaiutilishared.impression_track_element)({
208
+ $9AWcE$depictaiutilishared.impression_track_element({
209
209
  element: card,
210
210
  data: {
211
211
  search_result_id: tracking_id,
@@ -215,7 +215,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
215
215
  break;
216
216
  case (0, $405164bc961cc106$export$8ae64f3d447c14f7).ProductListingResult:
217
217
  card.addEventListener("click", () => this.sendProductListingResultClickEvent(tracking_id));
218
- (0, $9AWcE$depictaiutilishared.impression_track_element)({
218
+ $9AWcE$depictaiutilishared.impression_track_element({
219
219
  element: card,
220
220
  data: {
221
221
  product_listing_result_id: tracking_id,
@@ -238,7 +238,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
238
238
  // If the button is not nested in a product card, it's a PDP button. Product ID set on the page is required.
239
239
  const product_id = $89ae37e3a26189b4$var$_classPrivateMethodGet(this, $89ae37e3a26189b4$var$_getProductId, $89ae37e3a26189b4$var$_getProductId2).call(this);
240
240
  if (!product_id) {
241
- (0, $9AWcE$depictaiutilishared.derror)("No product ID set for add-to-cart click outside of product card", button);
241
+ $9AWcE$depictaiutilishared.derror("No product ID set for add-to-cart click outside of product card", button);
242
242
  return;
243
243
  }
244
244
  this.sendAddToCartEvent({
@@ -256,7 +256,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
256
256
  this.sendAddToCartEvent(tracking_data);
257
257
  return;
258
258
  }
259
- (0, $9AWcE$depictaiutilishared.derror)("Could not find tracking data for add-to-cart click on button", button);
259
+ $9AWcE$depictaiutilishared.derror("Could not find tracking data for add-to-cart click on button", button);
260
260
  });
261
261
  }
262
262
  /**
@@ -302,7 +302,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
302
302
  * Sends a recommendation click event to Depict
303
303
  */
304
304
  sendRecommendationClickEvent(recommendation_id) {
305
- (0, $9AWcE$depictaiutilishared.depict_click)({
305
+ $9AWcE$depictaiutilishared.depict_click({
306
306
  recommendation_id: recommendation_id,
307
307
  ...$89ae37e3a26189b4$var$_classPrivateMethodGet(this, $89ae37e3a26189b4$var$_getContextData, $89ae37e3a26189b4$var$_getContextData2).call(this)
308
308
  });
@@ -311,7 +311,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
311
311
  * Sends a search result click event to Depict
312
312
  */
313
313
  sendSearchResultClickEvent(search_result_id) {
314
- (0, $9AWcE$depictaiutilishared.depict_click)({
314
+ $9AWcE$depictaiutilishared.depict_click({
315
315
  search_result_id: search_result_id,
316
316
  ...$89ae37e3a26189b4$var$_classPrivateMethodGet(this, $89ae37e3a26189b4$var$_getContextData, $89ae37e3a26189b4$var$_getContextData2).call(this)
317
317
  });
@@ -320,7 +320,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
320
320
  * Sends a product listing result click event to Depict
321
321
  */
322
322
  sendProductListingResultClickEvent(product_listing_result_id) {
323
- (0, $9AWcE$depictaiutilishared.depict_click)({
323
+ $9AWcE$depictaiutilishared.depict_click({
324
324
  product_listing_result_id: product_listing_result_id,
325
325
  ...$89ae37e3a26189b4$var$_classPrivateMethodGet(this, $89ae37e3a26189b4$var$_getContextData, $89ae37e3a26189b4$var$_getContextData2).call(this)
326
326
  });
@@ -354,7 +354,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
354
354
  tenant: this.merchant,
355
355
  market: this.market
356
356
  };
357
- (0, $9AWcE$depictaiutilishared.foolproof_send_beacon)((0, $9AWcE$depictaiutilishared.base_url) + "/v2/create-events", request);
357
+ $9AWcE$depictaiutilishared.foolproof_send_beacon((0, $9AWcE$depictaiutilishared.base_url) + "/v2/create-events", request);
358
358
  }
359
359
  /**
360
360
  * Update the market used for tracking events
@@ -366,15 +366,15 @@ class $89ae37e3a26189b4$export$820526014323765f {
366
366
  * Update the product_id used for add-to-cart and pageview events on PDPs.
367
367
  */
368
368
  setProductId(product_id) {
369
- (0, $9AWcE$depictaiutilishared.dlog)("Setting product id", product_id);
369
+ $9AWcE$depictaiutilishared.dlog("Setting product id", product_id);
370
370
  this.latest_product_id = product_id;
371
371
  this.latest_product_id_path = location.pathname;
372
- if (!(0, $parcel$interopDefault($9AWcE$babelruntimehelpersclassPrivateFieldGet))(this, $89ae37e3a26189b4$var$_has_sent_pageview_for_current_href)) {
372
+ if (!$parcel$interopDefault($9AWcE$babelruntimehelpersclassPrivateFieldGet)(this, $89ae37e3a26189b4$var$_has_sent_pageview_for_current_href)) {
373
373
  $89ae37e3a26189b4$var$_classPrivateMethodGet(this, $89ae37e3a26189b4$var$_sendTrackingEvent, $89ae37e3a26189b4$var$_sendTrackingEvent2).call(this, {
374
374
  type: "page_view",
375
375
  product_id: product_id
376
376
  });
377
- (0, $parcel$interopDefault($9AWcE$babelruntimehelpersclassPrivateFieldSet))(this, $89ae37e3a26189b4$var$_has_sent_pageview_for_current_href, true);
377
+ $parcel$interopDefault($9AWcE$babelruntimehelpersclassPrivateFieldSet)(this, $89ae37e3a26189b4$var$_has_sent_pageview_for_current_href, true);
378
378
  }
379
379
  }
380
380
  /**
@@ -383,7 +383,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
383
383
  * https://docs.depict.ai/docs/performance-client#informing-depict-of-logged-in-users
384
384
  */
385
385
  setUserId(user_id) {
386
- (0, $9AWcE$depictaiutilishared.dlog)("Setting user id", user_id);
386
+ $9AWcE$depictaiutilishared.dlog("Setting user id", user_id);
387
387
  this.latest_user_id = user_id || undefined;
388
388
  }
389
389
  /**
@@ -392,7 +392,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
392
392
  * https://docs.depict.ai/docs/performance-client#browser-sessions
393
393
  */
394
394
  setSessionId(session_id) {
395
- (0, $9AWcE$depictaiutilishared.dlog)("Setting session id", session_id);
395
+ $9AWcE$depictaiutilishared.dlog("Setting session id", session_id);
396
396
  this.latest_session_id = session_id || undefined;
397
397
  }
398
398
  /**
@@ -401,14 +401,14 @@ class $89ae37e3a26189b4$export$820526014323765f {
401
401
  observeRecommendations() {
402
402
  for (const [attribute, type] of Object.entries((0, $e0dfb0ca4c8c037f$export$79f7900b4eea40cf))) {
403
403
  const selector = "[".concat(attribute, "]");
404
- (0, $9AWcE$depictaiutilishared.dlog)("Starting to observe product cards with selector", selector);
404
+ $9AWcE$depictaiutilishared.dlog("Starting to observe product cards with selector", selector);
405
405
  (0, $9AWcE$depictaiutilishared.observer).onexists(selector, _ref => {
406
406
  let {
407
407
  element: element
408
408
  } = _ref;
409
409
  const tracking_id = element.getAttribute(attribute);
410
410
  if (!tracking_id) {
411
- (0, $9AWcE$depictaiutilishared.derror)("No tracking id found on element with attribute ".concat(selector), element);
411
+ $9AWcE$depictaiutilishared.derror("No tracking id found on element with attribute ".concat(selector), element);
412
412
  return;
413
413
  }
414
414
  this.trackProductCard(element, tracking_id, type);
@@ -426,7 +426,7 @@ class $89ae37e3a26189b4$export$820526014323765f {
426
426
  const depict_card_selector = Object.keys((0, $e0dfb0ca4c8c037f$export$79f7900b4eea40cf)).map(attribute => "[".concat(attribute, "]")).join(",");
427
427
  // it's an add to cart button on a product card that possibly was added to the product card at a later point, if parent_depict_card is defined
428
428
  const parent_depict_card = element.closest(depict_card_selector) || undefined;
429
- (0, $9AWcE$depictaiutilishared.dlog)("Found ".concat(parent_depict_card ? "product card" : "pdp", " add-to-cart button"), element);
429
+ $9AWcE$depictaiutilishared.dlog("Found ".concat(parent_depict_card ? "product card" : "pdp", " add-to-cart button"), element);
430
430
  this.trackAddToCartButton(element, parent_depict_card);
431
431
  };
432
432
  (0, $9AWcE$depictaiutilishared.observer).onexists((0, $e0dfb0ca4c8c037f$export$6f11e212918dbb31), handler);
@@ -434,12 +434,12 @@ class $89ae37e3a26189b4$export$820526014323765f {
434
434
  }
435
435
  function $89ae37e3a26189b4$var$_resetSentPageViewForCurrentHref2() {
436
436
  let url = location.href;
437
- (0, $9AWcE$depictaiutilishared.instant_exec_on_suspect_history_change).add((0, $9AWcE$depictaiutilishared.catchify)(() => {
437
+ (0, $9AWcE$depictaiutilishared.instant_exec_on_suspect_history_change).add($9AWcE$depictaiutilishared.catchify(() => {
438
438
  const {
439
439
  href: new_href
440
440
  } = location;
441
441
  if (url !== new_href) {
442
- (0, $parcel$interopDefault($9AWcE$babelruntimehelpersclassPrivateFieldSet))(this, $89ae37e3a26189b4$var$_has_sent_pageview_for_current_href, false);
442
+ $parcel$interopDefault($9AWcE$babelruntimehelpersclassPrivateFieldSet)(this, $89ae37e3a26189b4$var$_has_sent_pageview_for_current_href, false);
443
443
  url = new_href;
444
444
  }
445
445
  }));
@@ -458,7 +458,7 @@ function $89ae37e3a26189b4$var$_getContextData2() {
458
458
  session_id: this.latest_session_id
459
459
  };
460
460
  return {
461
- ...(0, $9AWcE$depictaiutilishared.get_tracking_event_context_data)(),
461
+ ...$9AWcE$depictaiutilishared.get_tracking_event_context_data(),
462
462
  ...data
463
463
  };
464
464
  }
@@ -466,7 +466,7 @@ function $89ae37e3a26189b4$var$_sendTrackingEvent2(payload) {
466
466
  // Todo. check consent. For some events, delay until consent decision, with possible timeout.
467
467
  // For others, decide immediately based on current consent. (We shouldn't track a long history of events from before the user consented)
468
468
  // If no consent, don't send at all, or send anonymous? I think the latter is valid, since no ID in cookie or localStorage.
469
- (0, $9AWcE$depictaiutilishared.send_depict_unfiltered)([{
469
+ $9AWcE$depictaiutilishared.send_depict_unfiltered([{
470
470
  ...payload,
471
471
  ...$89ae37e3a26189b4$var$_classPrivateMethodGet(this, $89ae37e3a26189b4$var$_getContextData, $89ae37e3a26189b4$var$_getContextData2).call(this)
472
472
  }], true);
@@ -475,4 +475,4 @@ function $89ae37e3a26189b4$var$_getProductId2() {
475
475
  if (this.latest_product_id_path !== location.pathname) return undefined;
476
476
  return this.latest_product_id;
477
477
  }
478
- (0, $9AWcE$depictaiutilishared.add_to_version_info)("dpc", (0, $fcc8287091fb489d$export$83d89fbfd8236492));
478
+ $9AWcE$depictaiutilishared.add_to_version_info("dpc", (0, $fcc8287091fb489d$export$83d89fbfd8236492));
package/ES10/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "1.0.35";
1
+ export const version = "1.0.37";
2
2
  enum ProductCardType {
3
3
  Recommendation = 0,
4
4
  SnakeRecommendation = 1,
package/ES10/index.js CHANGED
@@ -6,7 +6,7 @@ import $4uUHR$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpe
6
6
  /*! Depict PerformanceClient */
7
7
  import { register_es_version } from "../multi_import_deduplicator.mjs";
8
8
  register_es_version("performance-client", "ES10");
9
- const $3242b911de3d57ad$export$83d89fbfd8236492 = "1.0.35";
9
+ const $3242b911de3d57ad$export$83d89fbfd8236492 = "1.0.37";
10
10
  let $983195e3c4979825$export$8ae64f3d447c14f7;
11
11
  (function (ProductCardType) {
12
12
  ProductCardType[ProductCardType["Recommendation"] = 0] = "Recommendation";
@@ -144,18 +144,18 @@ class $53af71a3700e1e90$export$820526014323765f {
144
144
  $53af71a3700e1e90$var$_classPrivateMethodInitSpec(this, $53af71a3700e1e90$var$_getContextData);
145
145
  $53af71a3700e1e90$var$_classPrivateMethodInitSpec(this, $53af71a3700e1e90$var$_parseOptions);
146
146
  $53af71a3700e1e90$var$_classPrivateMethodInitSpec(this, $53af71a3700e1e90$var$_resetSentPageViewForCurrentHref);
147
- (0, $4uUHR$babelruntimehelpersdefineProperty)(this, "auto_observe", true);
147
+ $4uUHR$babelruntimehelpersdefineProperty(this, "auto_observe", true);
148
148
  $53af71a3700e1e90$var$_classPrivateFieldInitSpec(this, $53af71a3700e1e90$var$_has_sent_pageview_for_current_href, {
149
149
  writable: true,
150
150
  value: false
151
151
  });
152
- (0, $4uUHR$babelruntimehelpersdefineProperty)(this, "tracked_elements", new WeakSet());
152
+ $4uUHR$babelruntimehelpersdefineProperty(this, "tracked_elements", new WeakSet());
153
153
  // Make sure we do not construct dpc more than once.
154
154
  if (((_window$depict = window.depict) === null || _window$depict === void 0 ? void 0 : _window$depict.dpc) instanceof $53af71a3700e1e90$export$820526014323765f) {
155
- (0, $4uUHR$dlog)("DPC already initialized. Returning existing instance.");
155
+ $4uUHR$dlog("DPC already initialized. Returning existing instance.");
156
156
  return window.depict.dpc;
157
157
  }
158
- (0, $f06bf37f1e6136a4$export$7a1bb429756ced60)(this);
158
+ $f06bf37f1e6136a4$export$7a1bb429756ced60(this);
159
159
  this.merchant = merchant;
160
160
  $53af71a3700e1e90$var$_classPrivateMethodGet(this, $53af71a3700e1e90$var$_parseOptions, $53af71a3700e1e90$var$_parseOptions2).call(this, _options);
161
161
  $53af71a3700e1e90$var$_classPrivateMethodGet(this, $53af71a3700e1e90$var$_resetSentPageViewForCurrentHref, $53af71a3700e1e90$var$_resetSentPageViewForCurrentHref2).call(this);
@@ -169,7 +169,7 @@ class $53af71a3700e1e90$export$820526014323765f {
169
169
  */
170
170
  checkIfTracked(element) {
171
171
  if (this.tracked_elements.has(element)) {
172
- (0, $4uUHR$dlog)("Already tracked", element);
172
+ $4uUHR$dlog("Already tracked", element);
173
173
  return true;
174
174
  }
175
175
  this.tracked_elements.add(element);
@@ -184,7 +184,7 @@ class $53af71a3700e1e90$export$820526014323765f {
184
184
  case (0, $983195e3c4979825$export$8ae64f3d447c14f7).Recommendation:
185
185
  case (0, $983195e3c4979825$export$8ae64f3d447c14f7).SnakeRecommendation:
186
186
  card.addEventListener("click", () => this.sendRecommendationClickEvent(tracking_id));
187
- (0, $4uUHR$impression_track_element)({
187
+ $4uUHR$impression_track_element({
188
188
  element: card,
189
189
  data: {
190
190
  recommendation_id: tracking_id,
@@ -194,7 +194,7 @@ class $53af71a3700e1e90$export$820526014323765f {
194
194
  break;
195
195
  case (0, $983195e3c4979825$export$8ae64f3d447c14f7).SearchResult:
196
196
  card.addEventListener("click", () => this.sendSearchResultClickEvent(tracking_id));
197
- (0, $4uUHR$impression_track_element)({
197
+ $4uUHR$impression_track_element({
198
198
  element: card,
199
199
  data: {
200
200
  search_result_id: tracking_id,
@@ -204,7 +204,7 @@ class $53af71a3700e1e90$export$820526014323765f {
204
204
  break;
205
205
  case (0, $983195e3c4979825$export$8ae64f3d447c14f7).ProductListingResult:
206
206
  card.addEventListener("click", () => this.sendProductListingResultClickEvent(tracking_id));
207
- (0, $4uUHR$impression_track_element)({
207
+ $4uUHR$impression_track_element({
208
208
  element: card,
209
209
  data: {
210
210
  product_listing_result_id: tracking_id,
@@ -227,7 +227,7 @@ class $53af71a3700e1e90$export$820526014323765f {
227
227
  // If the button is not nested in a product card, it's a PDP button. Product ID set on the page is required.
228
228
  const product_id = $53af71a3700e1e90$var$_classPrivateMethodGet(this, $53af71a3700e1e90$var$_getProductId, $53af71a3700e1e90$var$_getProductId2).call(this);
229
229
  if (!product_id) {
230
- (0, $4uUHR$derror)("No product ID set for add-to-cart click outside of product card", button);
230
+ $4uUHR$derror("No product ID set for add-to-cart click outside of product card", button);
231
231
  return;
232
232
  }
233
233
  this.sendAddToCartEvent({
@@ -245,7 +245,7 @@ class $53af71a3700e1e90$export$820526014323765f {
245
245
  this.sendAddToCartEvent(tracking_data);
246
246
  return;
247
247
  }
248
- (0, $4uUHR$derror)("Could not find tracking data for add-to-cart click on button", button);
248
+ $4uUHR$derror("Could not find tracking data for add-to-cart click on button", button);
249
249
  });
250
250
  }
251
251
  /**
@@ -291,7 +291,7 @@ class $53af71a3700e1e90$export$820526014323765f {
291
291
  * Sends a recommendation click event to Depict
292
292
  */
293
293
  sendRecommendationClickEvent(recommendation_id) {
294
- (0, $4uUHR$depict_click)({
294
+ $4uUHR$depict_click({
295
295
  recommendation_id: recommendation_id,
296
296
  ...$53af71a3700e1e90$var$_classPrivateMethodGet(this, $53af71a3700e1e90$var$_getContextData, $53af71a3700e1e90$var$_getContextData2).call(this)
297
297
  });
@@ -300,7 +300,7 @@ class $53af71a3700e1e90$export$820526014323765f {
300
300
  * Sends a search result click event to Depict
301
301
  */
302
302
  sendSearchResultClickEvent(search_result_id) {
303
- (0, $4uUHR$depict_click)({
303
+ $4uUHR$depict_click({
304
304
  search_result_id: search_result_id,
305
305
  ...$53af71a3700e1e90$var$_classPrivateMethodGet(this, $53af71a3700e1e90$var$_getContextData, $53af71a3700e1e90$var$_getContextData2).call(this)
306
306
  });
@@ -309,7 +309,7 @@ class $53af71a3700e1e90$export$820526014323765f {
309
309
  * Sends a product listing result click event to Depict
310
310
  */
311
311
  sendProductListingResultClickEvent(product_listing_result_id) {
312
- (0, $4uUHR$depict_click)({
312
+ $4uUHR$depict_click({
313
313
  product_listing_result_id: product_listing_result_id,
314
314
  ...$53af71a3700e1e90$var$_classPrivateMethodGet(this, $53af71a3700e1e90$var$_getContextData, $53af71a3700e1e90$var$_getContextData2).call(this)
315
315
  });
@@ -343,7 +343,7 @@ class $53af71a3700e1e90$export$820526014323765f {
343
343
  tenant: this.merchant,
344
344
  market: this.market
345
345
  };
346
- (0, $4uUHR$foolproof_send_beacon)((0, $4uUHR$base_url) + "/v2/create-events", request);
346
+ $4uUHR$foolproof_send_beacon((0, $4uUHR$base_url) + "/v2/create-events", request);
347
347
  }
348
348
  /**
349
349
  * Update the market used for tracking events
@@ -355,15 +355,15 @@ class $53af71a3700e1e90$export$820526014323765f {
355
355
  * Update the product_id used for add-to-cart and pageview events on PDPs.
356
356
  */
357
357
  setProductId(product_id) {
358
- (0, $4uUHR$dlog)("Setting product id", product_id);
358
+ $4uUHR$dlog("Setting product id", product_id);
359
359
  this.latest_product_id = product_id;
360
360
  this.latest_product_id_path = location.pathname;
361
- if (!(0, $4uUHR$babelruntimehelpersclassPrivateFieldGet)(this, $53af71a3700e1e90$var$_has_sent_pageview_for_current_href)) {
361
+ if (!$4uUHR$babelruntimehelpersclassPrivateFieldGet(this, $53af71a3700e1e90$var$_has_sent_pageview_for_current_href)) {
362
362
  $53af71a3700e1e90$var$_classPrivateMethodGet(this, $53af71a3700e1e90$var$_sendTrackingEvent, $53af71a3700e1e90$var$_sendTrackingEvent2).call(this, {
363
363
  type: "page_view",
364
364
  product_id: product_id
365
365
  });
366
- (0, $4uUHR$babelruntimehelpersclassPrivateFieldSet)(this, $53af71a3700e1e90$var$_has_sent_pageview_for_current_href, true);
366
+ $4uUHR$babelruntimehelpersclassPrivateFieldSet(this, $53af71a3700e1e90$var$_has_sent_pageview_for_current_href, true);
367
367
  }
368
368
  }
369
369
  /**
@@ -372,7 +372,7 @@ class $53af71a3700e1e90$export$820526014323765f {
372
372
  * https://docs.depict.ai/docs/performance-client#informing-depict-of-logged-in-users
373
373
  */
374
374
  setUserId(user_id) {
375
- (0, $4uUHR$dlog)("Setting user id", user_id);
375
+ $4uUHR$dlog("Setting user id", user_id);
376
376
  this.latest_user_id = user_id || undefined;
377
377
  }
378
378
  /**
@@ -381,7 +381,7 @@ class $53af71a3700e1e90$export$820526014323765f {
381
381
  * https://docs.depict.ai/docs/performance-client#browser-sessions
382
382
  */
383
383
  setSessionId(session_id) {
384
- (0, $4uUHR$dlog)("Setting session id", session_id);
384
+ $4uUHR$dlog("Setting session id", session_id);
385
385
  this.latest_session_id = session_id || undefined;
386
386
  }
387
387
  /**
@@ -390,14 +390,14 @@ class $53af71a3700e1e90$export$820526014323765f {
390
390
  observeRecommendations() {
391
391
  for (const [attribute, type] of Object.entries((0, $0cf01531cdd5b1ae$export$79f7900b4eea40cf))) {
392
392
  const selector = "[".concat(attribute, "]");
393
- (0, $4uUHR$dlog)("Starting to observe product cards with selector", selector);
393
+ $4uUHR$dlog("Starting to observe product cards with selector", selector);
394
394
  (0, $4uUHR$observer).onexists(selector, _ref => {
395
395
  let {
396
396
  element: element
397
397
  } = _ref;
398
398
  const tracking_id = element.getAttribute(attribute);
399
399
  if (!tracking_id) {
400
- (0, $4uUHR$derror)("No tracking id found on element with attribute ".concat(selector), element);
400
+ $4uUHR$derror("No tracking id found on element with attribute ".concat(selector), element);
401
401
  return;
402
402
  }
403
403
  this.trackProductCard(element, tracking_id, type);
@@ -415,7 +415,7 @@ class $53af71a3700e1e90$export$820526014323765f {
415
415
  const depict_card_selector = Object.keys((0, $0cf01531cdd5b1ae$export$79f7900b4eea40cf)).map(attribute => "[".concat(attribute, "]")).join(",");
416
416
  // it's an add to cart button on a product card that possibly was added to the product card at a later point, if parent_depict_card is defined
417
417
  const parent_depict_card = element.closest(depict_card_selector) || undefined;
418
- (0, $4uUHR$dlog)("Found ".concat(parent_depict_card ? "product card" : "pdp", " add-to-cart button"), element);
418
+ $4uUHR$dlog("Found ".concat(parent_depict_card ? "product card" : "pdp", " add-to-cart button"), element);
419
419
  this.trackAddToCartButton(element, parent_depict_card);
420
420
  };
421
421
  (0, $4uUHR$observer).onexists((0, $0cf01531cdd5b1ae$export$6f11e212918dbb31), handler);
@@ -423,12 +423,12 @@ class $53af71a3700e1e90$export$820526014323765f {
423
423
  }
424
424
  function $53af71a3700e1e90$var$_resetSentPageViewForCurrentHref2() {
425
425
  let url = location.href;
426
- (0, $4uUHR$instant_exec_on_suspect_history_change).add((0, $4uUHR$catchify)(() => {
426
+ (0, $4uUHR$instant_exec_on_suspect_history_change).add($4uUHR$catchify(() => {
427
427
  const {
428
428
  href: new_href
429
429
  } = location;
430
430
  if (url !== new_href) {
431
- (0, $4uUHR$babelruntimehelpersclassPrivateFieldSet)(this, $53af71a3700e1e90$var$_has_sent_pageview_for_current_href, false);
431
+ $4uUHR$babelruntimehelpersclassPrivateFieldSet(this, $53af71a3700e1e90$var$_has_sent_pageview_for_current_href, false);
432
432
  url = new_href;
433
433
  }
434
434
  }));
@@ -447,7 +447,7 @@ function $53af71a3700e1e90$var$_getContextData2() {
447
447
  session_id: this.latest_session_id
448
448
  };
449
449
  return {
450
- ...(0, $4uUHR$get_tracking_event_context_data)(),
450
+ ...$4uUHR$get_tracking_event_context_data(),
451
451
  ...data
452
452
  };
453
453
  }
@@ -455,7 +455,7 @@ function $53af71a3700e1e90$var$_sendTrackingEvent2(payload) {
455
455
  // Todo. check consent. For some events, delay until consent decision, with possible timeout.
456
456
  // For others, decide immediately based on current consent. (We shouldn't track a long history of events from before the user consented)
457
457
  // If no consent, don't send at all, or send anonymous? I think the latter is valid, since no ID in cookie or localStorage.
458
- (0, $4uUHR$send_depict_unfiltered)([{
458
+ $4uUHR$send_depict_unfiltered([{
459
459
  ...payload,
460
460
  ...$53af71a3700e1e90$var$_classPrivateMethodGet(this, $53af71a3700e1e90$var$_getContextData, $53af71a3700e1e90$var$_getContextData2).call(this)
461
461
  }], true);
@@ -464,5 +464,5 @@ function $53af71a3700e1e90$var$_getProductId2() {
464
464
  if (this.latest_product_id_path !== location.pathname) return undefined;
465
465
  return this.latest_product_id;
466
466
  }
467
- (0, $4uUHR$add_to_version_info)("dpc", (0, $3242b911de3d57ad$export$83d89fbfd8236492));
467
+ $4uUHR$add_to_version_info("dpc", (0, $3242b911de3d57ad$export$83d89fbfd8236492));
468
468
  export { $53af71a3700e1e90$export$820526014323765f as DPC, $3242b911de3d57ad$export$83d89fbfd8236492 as version };