@liquidcommercedev/rmn-sdk 1.5.0-beta.41 → 1.5.0-beta.42

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 (20) hide show
  1. package/dist/index.cjs +503 -199
  2. package/dist/index.esm.js +503 -199
  3. package/dist/types/modules/element/component/spot/spot.component.d.ts +4 -0
  4. package/dist/types/modules/element/element.interface.d.ts +6 -1
  5. package/dist/types/modules/selection/selection.interface.d.ts +7 -0
  6. package/dist/types/modules/spot-template/rb-template.interface.d.ts +75 -48
  7. package/dist/types/modules/spot-template/reservebar/homepage-hero-full-image.template.d.ts +2 -0
  8. package/dist/types/modules/spot-template/reservebar/homepage-hero-three-tile.template.d.ts +2 -0
  9. package/dist/types/modules/spot-template/reservebar/homepage-hero-two-tile.template.d.ts +2 -0
  10. package/dist/types/modules/spot-template/reservebar/large-category-image-tout.template.d.ts +2 -0
  11. package/dist/types/modules/spot-template/reservebar/long-tout-short.template.d.ts +2 -0
  12. package/dist/types/modules/spot-template/reservebar/long-tout-tall.template.d.ts +2 -0
  13. package/dist/types/modules/spot-template/reservebar/navigation-banner.template.d.ts +2 -0
  14. package/dist/types/modules/spot-template/reservebar/small-category-image-tout.template.d.ts +2 -0
  15. package/dist/types/modules/spot-template/reservebar/small-discover-tout.template.d.ts +1 -0
  16. package/dist/types/modules/spot-template/spot-template.constant.d.ts +5 -0
  17. package/dist/types/modules/spot-template/spot-template.interface.d.ts +1 -0
  18. package/dist/types/modules/spot-template/utils.d.ts +2 -0
  19. package/package.json +13 -11
  20. package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
package/dist/index.cjs CHANGED
@@ -1951,8 +1951,8 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
1951
1951
  byteOffset = 0;
1952
1952
  } else if (byteOffset > 0x7fffffff) {
1953
1953
  byteOffset = 0x7fffffff;
1954
- } else if (byteOffset < -0x80000000) {
1955
- byteOffset = -0x80000000;
1954
+ } else if (byteOffset < -2147483648) {
1955
+ byteOffset = -2147483648;
1956
1956
  }
1957
1957
  byteOffset = +byteOffset; // Coerce to Number.
1958
1958
  if (isNaN(byteOffset)) {
@@ -2711,7 +2711,7 @@ Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, no
2711
2711
  Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
2712
2712
  value = +value;
2713
2713
  offset = offset | 0;
2714
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
2714
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128);
2715
2715
  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
2716
2716
  if (value < 0) value = 0xff + value + 1;
2717
2717
  this[offset] = (value & 0xff);
@@ -2721,7 +2721,7 @@ Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
2721
2721
  Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
2722
2722
  value = +value;
2723
2723
  offset = offset | 0;
2724
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
2724
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768);
2725
2725
  if (Buffer.TYPED_ARRAY_SUPPORT) {
2726
2726
  this[offset] = (value & 0xff);
2727
2727
  this[offset + 1] = (value >>> 8);
@@ -2734,7 +2734,7 @@ Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert)
2734
2734
  Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
2735
2735
  value = +value;
2736
2736
  offset = offset | 0;
2737
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
2737
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768);
2738
2738
  if (Buffer.TYPED_ARRAY_SUPPORT) {
2739
2739
  this[offset] = (value >>> 8);
2740
2740
  this[offset + 1] = (value & 0xff);
@@ -2747,7 +2747,7 @@ Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert)
2747
2747
  Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
2748
2748
  value = +value;
2749
2749
  offset = offset | 0;
2750
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
2750
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648);
2751
2751
  if (Buffer.TYPED_ARRAY_SUPPORT) {
2752
2752
  this[offset] = (value & 0xff);
2753
2753
  this[offset + 1] = (value >>> 8);
@@ -2762,7 +2762,7 @@ Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert)
2762
2762
  Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
2763
2763
  value = +value;
2764
2764
  offset = offset | 0;
2765
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
2765
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648);
2766
2766
  if (value < 0) value = 0xffffffff + value + 1;
2767
2767
  if (Buffer.TYPED_ARRAY_SUPPORT) {
2768
2768
  this[offset] = (value >>> 24);
@@ -6092,7 +6092,7 @@ function matchesKeywordPattern(words, required, optional) {
6092
6092
  return false;
6093
6093
  }
6094
6094
  // If no optional keywords are specified, return true
6095
- if (!(optional === null || optional === void 0 ? void 0 : optional.length)) {
6095
+ if (!(optional === null || optional === undefined ? undefined : optional.length)) {
6096
6096
  return true;
6097
6097
  }
6098
6098
  // If optional keywords exist, check if at least one matches as a whole word
@@ -6105,7 +6105,7 @@ function matchesKeywordPattern(words, required, optional) {
6105
6105
  * @returns {RMN_SPOT_EVENT | null} - The corresponding RMN_SPOT_EVENT or null if no match
6106
6106
  */
6107
6107
  function getEventTypeFromRawEvent(event) {
6108
- if (!(event === null || event === void 0 ? void 0 : event.trim())) {
6108
+ if (!(event === null || event === undefined ? undefined : event.trim())) {
6109
6109
  return null;
6110
6110
  }
6111
6111
  const words = normalizeEventName(event);
@@ -7592,7 +7592,7 @@ class ObjectHelper {
7592
7592
  else if (typeof value === 'object') {
7593
7593
  return this.mergeObjectValues(targetValue, value);
7594
7594
  }
7595
- return (_a = value !== null && value !== void 0 ? value : targetValue) !== null && _a !== void 0 ? _a : undefined;
7595
+ return (_a = value !== null && value !== undefined ? value : targetValue) !== null && _a !== undefined ? _a : undefined;
7596
7596
  }
7597
7597
  /**
7598
7598
  * Merges the values of an array or object with a given array of objects and returns the merged result as an object.
@@ -7673,7 +7673,7 @@ function xhrFallbackEventFire(url) {
7673
7673
  }
7674
7674
  function beaconEventFire(url) {
7675
7675
  var _a;
7676
- return (_a = navigator === null || navigator === void 0 ? void 0 : navigator.sendBeacon) === null || _a === void 0 ? void 0 : _a.call(navigator, url);
7676
+ return (_a = navigator === null || navigator === undefined ? undefined : navigator.sendBeacon) === null || _a === undefined ? undefined : _a.call(navigator, url);
7677
7677
  }
7678
7678
  /**
7679
7679
  * Helper function to decode base64 string and parse JSON
@@ -7794,7 +7794,7 @@ function calculateScaleFactor(elementScale) {
7794
7794
  * @returns {string} - The query string.
7795
7795
  */
7796
7796
  function objectToQueryParams(obj) {
7797
- return Object.entries(obj !== null && obj !== void 0 ? obj : {})
7797
+ return Object.entries(obj !== null && obj !== undefined ? obj : {})
7798
7798
  .map(([key, value]) => {
7799
7799
  if (value == null) {
7800
7800
  return '';
@@ -12046,7 +12046,7 @@ function requireCipherCore () {
12046
12046
  C_lib.StreamCipher = Cipher.extend({
12047
12047
  _doFinalize: function () {
12048
12048
  // Process partial blocks
12049
- var finalProcessedBlocks = this._process(!!'flush');
12049
+ var finalProcessedBlocks = this._process(true);
12050
12050
 
12051
12051
  return finalProcessedBlocks;
12052
12052
  },
@@ -12327,10 +12327,10 @@ function requireCipherCore () {
12327
12327
  padding.pad(this._data, this.blockSize);
12328
12328
 
12329
12329
  // Process final blocks
12330
- finalProcessedBlocks = this._process(!!'flush');
12330
+ finalProcessedBlocks = this._process(true);
12331
12331
  } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
12332
12332
  // Process final blocks
12333
- finalProcessedBlocks = this._process(!!'flush');
12333
+ finalProcessedBlocks = this._process(true);
12334
12334
 
12335
12335
  // Unpad data
12336
12336
  padding.unpad(finalProcessedBlocks);
@@ -16688,9 +16688,9 @@ class ApiError {
16688
16688
  constructor(error) {
16689
16689
  var _a, _b, _c, _d, _e, _f, _g;
16690
16690
  const e = error;
16691
- this.cause = (_d = (_b = (_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.data.statusCode) !== null && _b !== void 0 ? _b : (_c = e === null || e === void 0 ? void 0 : e.response) === null || _c === void 0 ? void 0 : _c.status) !== null && _d !== void 0 ? _d : 0;
16691
+ this.cause = (_d = (_b = (_a = e === null || e === undefined ? undefined : e.response) === null || _a === undefined ? undefined : _a.data.statusCode) !== null && _b !== undefined ? _b : (_c = e === null || e === undefined ? undefined : e.response) === null || _c === undefined ? undefined : _c.status) !== null && _d !== undefined ? _d : 0;
16692
16692
  this.errorMessage =
16693
- (_g = (_f = (_e = e === null || e === void 0 ? void 0 : e.response) === null || _e === void 0 ? void 0 : _e.data.message) !== null && _f !== void 0 ? _f : e === null || e === void 0 ? void 0 : e.message) !== null && _g !== void 0 ? _g : `There's been an error related to the API request to LiquidCommerce RMN Services.`;
16693
+ (_g = (_f = (_e = e === null || e === undefined ? undefined : e.response) === null || _e === undefined ? undefined : _e.data.message) !== null && _f !== undefined ? _f : e === null || e === undefined ? undefined : e.message) !== null && _g !== undefined ? _g : `There's been an error related to the API request to LiquidCommerce RMN Services.`;
16694
16694
  }
16695
16695
  }
16696
16696
 
@@ -16805,12 +16805,12 @@ class BaseApi extends BaseApiAbstract {
16805
16805
  this.authInfo = auth;
16806
16806
  this.encryptedApi = EncryptedApi.getInstance(this.authInfo.apiKey);
16807
16807
  this.objectHelper = ObjectHelper.getInstance();
16808
- this.baseUrl = (_a = SDK_CONFIG.url[this.authInfo.env]) !== null && _a !== void 0 ? _a : SDK_CONFIG.url.development;
16808
+ this.baseUrl = (_a = SDK_CONFIG.url[this.authInfo.env]) !== null && _a !== undefined ? _a : SDK_CONFIG.url.development;
16809
16809
  const configHeaders = {
16810
16810
  [SDK_CONFIG.accessHeader]: `Bearer ${this.authInfo.token}`,
16811
16811
  };
16812
16812
  const partnerSite = this.getPartnerSite();
16813
- const isPartnerSiteValid = partnerSite === null || partnerSite === void 0 ? void 0 : partnerSite.startsWith('http');
16813
+ const isPartnerSiteValid = partnerSite === null || partnerSite === undefined ? undefined : partnerSite.startsWith('http');
16814
16814
  if (partnerSite && isPartnerSiteValid) {
16815
16815
  configHeaders[REQUEST_CLOUD_PARTNER_SITE] = partnerSite;
16816
16816
  }
@@ -16866,7 +16866,7 @@ class BaseApi extends BaseApiAbstract {
16866
16866
  configOverrides = {
16867
16867
  ...configOverrides,
16868
16868
  headers: {
16869
- ...configOverrides === null || configOverrides === void 0 ? void 0 : configOverrides.headers,
16869
+ ...configOverrides === null || configOverrides === undefined ? undefined : configOverrides.headers,
16870
16870
  [REQUEST_CLOUD_PROTECTED_KEY]: 'true',
16871
16871
  [REQUEST_CLOUD_PROTECTED_TIMESTAMP]: timestamp,
16872
16872
  [SDK_CONFIG.apiHeader]: this.authInfo.apiKey,
@@ -16903,7 +16903,7 @@ class BaseApi extends BaseApiAbstract {
16903
16903
  * @returns {AxiosRequestConfig} - The merged Axios request configuration.
16904
16904
  */
16905
16905
  createFullConfig(configOverrides) {
16906
- return this.objectHelper.merge(this.getConfig(), configOverrides !== null && configOverrides !== void 0 ? configOverrides : {});
16906
+ return this.objectHelper.merge(this.getConfig(), configOverrides !== null && configOverrides !== undefined ? configOverrides : {});
16907
16907
  }
16908
16908
  /**
16909
16909
  * Sends a request to the specified URL with the given configuration.
@@ -16927,17 +16927,17 @@ class BaseApi extends BaseApiAbstract {
16927
16927
  */
16928
16928
  async getResponse(response) {
16929
16929
  var _a, _b, _c, _d, _e, _f, _g;
16930
- let responseData = (response === null || response === void 0 ? void 0 : response.data) ? response.data : null;
16930
+ let responseData = (response === null || response === undefined ? undefined : response.data) ? response.data : null;
16931
16931
  let isEncrypted = false;
16932
16932
  let timestamp = 0;
16933
- if ((response === null || response === void 0 ? void 0 : response.headers) &&
16934
- ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a.has) &&
16935
- ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b.has(REQUEST_CLOUD_PROTECTED_KEY)) &&
16936
- ((_c = response === null || response === void 0 ? void 0 : response.headers) === null || _c === void 0 ? void 0 : _c.has(REQUEST_CLOUD_PROTECTED_TIMESTAMP)) &&
16937
- ((_d = response === null || response === void 0 ? void 0 : response.headers) === null || _d === void 0 ? void 0 : _d.get)) {
16938
- isEncrypted = ((_e = response === null || response === void 0 ? void 0 : response.headers) === null || _e === void 0 ? void 0 : _e.get(REQUEST_CLOUD_PROTECTED_KEY)) === 'true';
16939
- timestamp = ((_f = response === null || response === void 0 ? void 0 : response.headers) === null || _f === void 0 ? void 0 : _f.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
16940
- ? Number((_g = response === null || response === void 0 ? void 0 : response.headers) === null || _g === void 0 ? void 0 : _g.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
16933
+ if ((response === null || response === undefined ? undefined : response.headers) &&
16934
+ ((_a = response === null || response === undefined ? undefined : response.headers) === null || _a === undefined ? undefined : _a.has) &&
16935
+ ((_b = response === null || response === undefined ? undefined : response.headers) === null || _b === undefined ? undefined : _b.has(REQUEST_CLOUD_PROTECTED_KEY)) &&
16936
+ ((_c = response === null || response === undefined ? undefined : response.headers) === null || _c === undefined ? undefined : _c.has(REQUEST_CLOUD_PROTECTED_TIMESTAMP)) &&
16937
+ ((_d = response === null || response === undefined ? undefined : response.headers) === null || _d === undefined ? undefined : _d.get)) {
16938
+ isEncrypted = ((_e = response === null || response === undefined ? undefined : response.headers) === null || _e === undefined ? undefined : _e.get(REQUEST_CLOUD_PROTECTED_KEY)) === 'true';
16939
+ timestamp = ((_f = response === null || response === undefined ? undefined : response.headers) === null || _f === undefined ? undefined : _f.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
16940
+ ? Number((_g = response === null || response === undefined ? undefined : response.headers) === null || _g === undefined ? undefined : _g.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
16941
16941
  : 0;
16942
16942
  }
16943
16943
  if (responseData &&
@@ -16946,7 +16946,7 @@ class BaseApi extends BaseApiAbstract {
16946
16946
  timestamp > 0) {
16947
16947
  const { t: encryptedPayload } = responseData;
16948
16948
  const decryptedData = await this.encryptedApi.handleDecryption(encryptedPayload, timestamp);
16949
- if (decryptedData === null || decryptedData === void 0 ? void 0 : decryptedData.payload) {
16949
+ if (decryptedData === null || decryptedData === undefined ? undefined : decryptedData.payload) {
16950
16950
  delete decryptedData.payload.exp;
16951
16951
  delete decryptedData.payload.iat;
16952
16952
  responseData = decryptedData.payload;
@@ -17000,9 +17000,9 @@ class AuthService extends BaseApi {
17000
17000
  },
17001
17001
  });
17002
17002
  if (isErr) {
17003
- throw new Error(`There was an error during authentication: (${isErr === null || isErr === void 0 ? void 0 : isErr.errorMessage})`);
17003
+ throw new Error(`There was an error during authentication: (${isErr === null || isErr === undefined ? undefined : isErr.errorMessage})`);
17004
17004
  }
17005
- if (isOk && (val === null || val === void 0 ? void 0 : val.data.token)) {
17005
+ if (isOk && (val === null || val === undefined ? undefined : val.data.token)) {
17006
17006
  this.authInfo.token = val.data.token;
17007
17007
  this.authInfo.authenticated = true;
17008
17008
  }
@@ -17081,6 +17081,8 @@ class BaseSpotComponent extends BaseElement {
17081
17081
  super();
17082
17082
  this.initialized = false;
17083
17083
  this.dataInitialized = false;
17084
+ this.reRenderOnDeviceChange = false;
17085
+ this._isMobileDevice = true;
17084
17086
  }
17085
17087
  initializeData(data, config) {
17086
17088
  if (this.dataInitialized) {
@@ -17130,6 +17132,27 @@ class BaseSpotComponent extends BaseElement {
17130
17132
  }
17131
17133
  `;
17132
17134
  }
17135
+ setupDeviceDetection() {
17136
+ if (!isBrowser)
17137
+ return;
17138
+ const mediaQuery = '(max-width: 639.98px)';
17139
+ const containerQuery = window.matchMedia(mediaQuery);
17140
+ const updateDeviceState = (e) => {
17141
+ var _a;
17142
+ const isMobileNewValue = e.matches;
17143
+ if (this._isMobileDevice !== isMobileNewValue) {
17144
+ this._isMobileDevice = isMobileNewValue;
17145
+ (_a = this.onDeviceChange) === null || _a === undefined ? undefined : _a.call(this, this._isMobileDevice);
17146
+ if (this.reRenderOnDeviceChange) {
17147
+ this.render();
17148
+ }
17149
+ }
17150
+ };
17151
+ // Setup listener
17152
+ containerQuery.addEventListener('change', updateDeviceState);
17153
+ // Initial check
17154
+ updateDeviceState(containerQuery);
17155
+ }
17133
17156
  // Lifecycle callbacks
17134
17157
  connectedCallback() {
17135
17158
  var _a;
@@ -17138,14 +17161,15 @@ class BaseSpotComponent extends BaseElement {
17138
17161
  this.initialized = true;
17139
17162
  if (this.dataInitialized) {
17140
17163
  this.render();
17164
+ this.setupDeviceDetection();
17141
17165
  }
17142
- (_a = this.connected) === null || _a === void 0 ? void 0 : _a.call(this);
17166
+ (_a = this.connected) === null || _a === undefined ? undefined : _a.call(this);
17143
17167
  }
17144
17168
  disconnectedCallback() {
17145
17169
  var _a;
17146
17170
  if (!isBrowser)
17147
17171
  return;
17148
- (_a = this.disconnected) === null || _a === void 0 ? void 0 : _a.call(this);
17172
+ (_a = this.disconnected) === null || _a === undefined ? undefined : _a.call(this);
17149
17173
  }
17150
17174
  }
17151
17175
 
@@ -17188,11 +17212,11 @@ class LocalStorageService {
17188
17212
  setSpot(spotId, data) {
17189
17213
  var _a, _b, _c, _d, _e;
17190
17214
  data.createdAt = Date.now();
17191
- const isExistentSpot = (_a = this.spots) === null || _a === void 0 ? void 0 : _a.has(spotId);
17215
+ const isExistentSpot = (_a = this.spots) === null || _a === undefined ? undefined : _a.has(spotId);
17192
17216
  if (isExistentSpot) {
17193
- data.firedEvents = (_d = (_c = (_b = this.spots) === null || _b === void 0 ? void 0 : _b.get(spotId)) === null || _c === void 0 ? void 0 : _c.firedEvents) !== null && _d !== void 0 ? _d : [];
17217
+ data.firedEvents = (_d = (_c = (_b = this.spots) === null || _b === undefined ? undefined : _b.get(spotId)) === null || _c === undefined ? undefined : _c.firedEvents) !== null && _d !== undefined ? _d : [];
17194
17218
  }
17195
- (_e = this.spots) === null || _e === void 0 ? void 0 : _e.set(spotId, data);
17219
+ (_e = this.spots) === null || _e === undefined ? undefined : _e.set(spotId, data);
17196
17220
  this.updateLocalStorage();
17197
17221
  }
17198
17222
  // public removeSpot(spotId: string): void {
@@ -17237,12 +17261,12 @@ class LocalStorageService {
17237
17261
  setUserId() {
17238
17262
  var _a;
17239
17263
  const prefix = LocalStorageService.localStorageKeyPrefix;
17240
- const existingKeys = Object.keys((_a = window.localStorage) !== null && _a !== void 0 ? _a : {}).filter((key) => key.startsWith(prefix));
17264
+ const existingKeys = Object.keys((_a = window.localStorage) !== null && _a !== undefined ? _a : {}).filter((key) => key.startsWith(prefix));
17241
17265
  const setNewKey = () => {
17242
17266
  var _a;
17243
17267
  const uniqueId = UniqueIdGenerator.generate();
17244
17268
  const newLocalStorageKey = `${prefix}_${uniqueId}`;
17245
- (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem(newLocalStorageKey, '');
17269
+ (_a = window.localStorage) === null || _a === undefined ? undefined : _a.setItem(newLocalStorageKey, '');
17246
17270
  LocalStorageService.localStorageKey = newLocalStorageKey;
17247
17271
  };
17248
17272
  if (existingKeys.length === 0) {
@@ -17254,7 +17278,7 @@ class LocalStorageService {
17254
17278
  existingKeys.forEach((key) => {
17255
17279
  var _a;
17256
17280
  if (key !== validKey) {
17257
- (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.removeItem(key);
17281
+ (_a = window.localStorage) === null || _a === undefined ? undefined : _a.removeItem(key);
17258
17282
  }
17259
17283
  });
17260
17284
  if (validKey) {
@@ -17270,7 +17294,7 @@ class LocalStorageService {
17270
17294
  // ======================== Utility functions ======================== //
17271
17295
  syncLocalStorage() {
17272
17296
  var _a;
17273
- const localStorageData = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.getItem(LocalStorageService.localStorageKey);
17297
+ const localStorageData = (_a = window.localStorage) === null || _a === undefined ? undefined : _a.getItem(LocalStorageService.localStorageKey);
17274
17298
  if (localStorageData) {
17275
17299
  try {
17276
17300
  const decryptedData = this.decryptData(localStorageData);
@@ -17309,15 +17333,15 @@ class LocalStorageService {
17309
17333
  }
17310
17334
  clearLocalStorage() {
17311
17335
  var _a;
17312
- (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.removeItem(LocalStorageService.localStorageKey);
17336
+ (_a = window.localStorage) === null || _a === undefined ? undefined : _a.removeItem(LocalStorageService.localStorageKey);
17313
17337
  }
17314
17338
  removeExpiredSpots() {
17315
17339
  var _a;
17316
17340
  const currentTime = Date.now();
17317
- (_a = this.spots) === null || _a === void 0 ? void 0 : _a.forEach((spot, spotId) => {
17341
+ (_a = this.spots) === null || _a === undefined ? undefined : _a.forEach((spot, spotId) => {
17318
17342
  var _a, _b;
17319
- if (currentTime - ((_a = spot.createdAt) !== null && _a !== void 0 ? _a : 0) > LocalStorageService.spotExpirationTime) {
17320
- (_b = this.spots) === null || _b === void 0 ? void 0 : _b.delete(spotId);
17343
+ if (currentTime - ((_a = spot.createdAt) !== null && _a !== undefined ? _a : 0) > LocalStorageService.spotExpirationTime) {
17344
+ (_b = this.spots) === null || _b === undefined ? undefined : _b.delete(spotId);
17321
17345
  }
17322
17346
  });
17323
17347
  this.updateLocalStorage();
@@ -17353,9 +17377,9 @@ class LocalStorageService {
17353
17377
  obj.spotId,
17354
17378
  obj.spotType,
17355
17379
  this.spotEventObjectToArray(obj.events),
17356
- (_b = (_a = obj.firedEvents) === null || _a === void 0 ? void 0 : _a.map((event) => [event.productId, event.event])) !== null && _b !== void 0 ? _b : [],
17380
+ (_b = (_a = obj.firedEvents) === null || _a === undefined ? undefined : _a.map((event) => [event.productId, event.event])) !== null && _b !== undefined ? _b : [],
17357
17381
  obj.productIds,
17358
- (_c = obj.createdAt) !== null && _c !== void 0 ? _c : 0,
17382
+ (_c = obj.createdAt) !== null && _c !== undefined ? _c : 0,
17359
17383
  ];
17360
17384
  }
17361
17385
  /**
@@ -17425,8 +17449,8 @@ class ProximityObserver {
17425
17449
  this.targetIds = new Set(elementIds);
17426
17450
  this.processedIds = new Set();
17427
17451
  this.callback = callback;
17428
- this.proximityThreshold = (_a = options.proximityThreshold) !== null && _a !== void 0 ? _a : 500;
17429
- this.intersectionMargin = (_b = options.intersectionMargin) !== null && _b !== void 0 ? _b : '2000px';
17452
+ this.proximityThreshold = (_a = options.proximityThreshold) !== null && _a !== undefined ? _a : 500;
17453
+ this.intersectionMargin = (_b = options.intersectionMargin) !== null && _b !== undefined ? _b : '2000px';
17430
17454
  this.initializeObservers();
17431
17455
  this.observeExistingElements();
17432
17456
  }
@@ -17467,7 +17491,7 @@ class ProximityObserver {
17467
17491
  });
17468
17492
  // Start observing DOM changes
17469
17493
  if (document.body) {
17470
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(document.body, {
17494
+ (_a = this.mutationObserver) === null || _a === undefined ? undefined : _a.observe(document.body, {
17471
17495
  childList: true,
17472
17496
  subtree: true,
17473
17497
  });
@@ -17477,13 +17501,13 @@ class ProximityObserver {
17477
17501
  var _a;
17478
17502
  if (element.id && this.processedIds.has(element.id)) {
17479
17503
  this.processedIds.delete(element.id);
17480
- (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.unobserve(element);
17504
+ (_a = this.intersectionObserver) === null || _a === undefined ? undefined : _a.unobserve(element);
17481
17505
  }
17482
17506
  }
17483
17507
  checkElement(element) {
17484
17508
  var _a;
17485
17509
  if (element.id && this.targetIds.has(element.id) && !this.processedIds.has(element.id)) {
17486
- (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.observe(element);
17510
+ (_a = this.intersectionObserver) === null || _a === undefined ? undefined : _a.observe(element);
17487
17511
  }
17488
17512
  }
17489
17513
  findNearbyTargetIds(element) {
@@ -17530,7 +17554,7 @@ class ProximityObserver {
17530
17554
  this.processedIds.add(id);
17531
17555
  const el = document.getElementById(id);
17532
17556
  if (el)
17533
- (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.unobserve(el);
17557
+ (_a = this.intersectionObserver) === null || _a === undefined ? undefined : _a.unobserve(el);
17534
17558
  });
17535
17559
  // Trigger callback with the group
17536
17560
  this.callback(groupIdsToProcess);
@@ -17653,7 +17677,7 @@ class ResizeObserverService {
17653
17677
  this.container = element.parentElement;
17654
17678
  this.setDimensions(maxSize, minScale);
17655
17679
  this.resizeObserver = new ResizeObserver(() => this.updateElementSize());
17656
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(this.container);
17680
+ (_a = this.resizeObserver) === null || _a === undefined ? undefined : _a.observe(this.container);
17657
17681
  // Initial size update
17658
17682
  this.updateElementSize();
17659
17683
  }
@@ -17709,7 +17733,7 @@ class ResizeObserverService {
17709
17733
  }
17710
17734
  disconnect() {
17711
17735
  var _a;
17712
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
17736
+ (_a = this.resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
17713
17737
  }
17714
17738
  }
17715
17739
 
@@ -17723,6 +17747,11 @@ const GFONT_SOURCE_SANS_3 = `
17723
17747
  const GFONT_CORMORANT = `
17724
17748
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap">
17725
17749
  `;
17750
+ const FONTS = {
17751
+ preconnect: GFONT_PRECONNECT,
17752
+ sourceSans: GFONT_SOURCE_SANS_3,
17753
+ cormorant: GFONT_CORMORANT,
17754
+ };
17726
17755
 
17727
17756
  function convertHexToRgba(hex, opacity = 1) {
17728
17757
  // Remove # if present
@@ -17756,6 +17785,16 @@ function generateGradientColor(overlay, fallback = '') {
17756
17785
  const gradientColor = convertHexToRgba(color, overlayOpacity);
17757
17786
  return `${fullColor} 0%, ${gradientColor} ${goTo}%, ${transparentColor} 100%`;
17758
17787
  }
17788
+ function importFonts(...fonts) {
17789
+ const fontsToImport = fonts.length === 0 ? ['sourceSans', 'cormorant'] : fonts;
17790
+ return [
17791
+ FONTS.preconnect,
17792
+ ...fontsToImport.map((font) => FONTS[font]),
17793
+ ].join('');
17794
+ }
17795
+ function renderElement(tag, className, content) {
17796
+ return (content === null || content === undefined ? undefined : content.trim()) ? `<${tag} class="${className}">${content}</${tag}>` : '';
17797
+ }
17759
17798
 
17760
17799
  class BillboardV1SE extends BaseSpotComponent {
17761
17800
  constructor() {
@@ -17768,7 +17807,7 @@ class BillboardV1SE extends BaseSpotComponent {
17768
17807
  disconnected() {
17769
17808
  var _a;
17770
17809
  this.removeEventListener('spotSizeChanged', this.handleSpotSizeChanged);
17771
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
17810
+ (_a = this.resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
17772
17811
  }
17773
17812
  setupResizeObserver() {
17774
17813
  if (!this._config.fluid) {
@@ -17791,7 +17830,7 @@ class BillboardV1SE extends BaseSpotComponent {
17791
17830
  var _a;
17792
17831
  // Find all text elements within the shadow root
17793
17832
  const selectors = ['h2', 'p', 'span'].join(', ');
17794
- const elements = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selectors);
17833
+ const elements = (_a = this.shadowRoot) === null || _a === undefined ? undefined : _a.querySelectorAll(selectors);
17795
17834
  if (!elements)
17796
17835
  return;
17797
17836
  const scaleFactor = calculateScaleFactor(elementScale);
@@ -18005,6 +18044,7 @@ class RbCollectionBannerWithoutTextBlockSE extends BaseSpotComponent {
18005
18044
  class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18006
18045
  constructor() {
18007
18046
  super();
18047
+ this.reRenderOnDeviceChange = true;
18008
18048
  }
18009
18049
  getGradientDirection(position) {
18010
18050
  switch (position) {
@@ -18024,17 +18064,34 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18024
18064
  }
18025
18065
  template() {
18026
18066
  const prefix = this._config.prefix;
18027
- const { preHeader, header, description, ctaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.BOTTOM_LEFT, mobileTextBlockPosition = textBlockPosition, } = this._data;
18067
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.BOTTOM_LEFT, mobileTextBlockPosition = textBlockPosition,
18068
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18069
+ enableMobileTexts = false, } = this._data;
18070
+ const content = this._isMobileDevice && enableMobileTexts
18071
+ ? {
18072
+ preHeader: mobilePreHeader,
18073
+ header: mobileHeader,
18074
+ description: mobileDescription,
18075
+ ctaText: mobileCtaText,
18076
+ }
18077
+ : { preHeader, header, description, ctaText };
18078
+ if (!this.hasContent) {
18079
+ return `
18080
+ ${importFonts()}
18081
+ <div class="${prefix}"></div>
18082
+ `;
18083
+ }
18084
+ const elements = [
18085
+ renderElement('h2', `${prefix}__pre-header`, content.preHeader),
18086
+ renderElement('h2', `${prefix}__header`, content.header),
18087
+ renderElement('p', `${prefix}__description`, content.description),
18088
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
18089
+ ];
18028
18090
  return `
18029
- ${GFONT_PRECONNECT}
18030
- ${GFONT_SOURCE_SANS_3}
18031
- ${GFONT_CORMORANT}
18091
+ ${importFonts()}
18032
18092
  <div class="${prefix}">
18033
18093
  <div class="${prefix}__text ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
18034
- ${preHeader ? `<h2 class="${prefix}__pre-header">${preHeader}</h2>` : ''}
18035
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18036
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18037
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
18094
+ ${elements.join('')}
18038
18095
  </div>
18039
18096
  </div>
18040
18097
  `;
@@ -18051,7 +18108,9 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18051
18108
  display: flex;
18052
18109
  width: 100%;
18053
18110
  height: 100%;
18054
- background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");
18111
+ ${this.hasContent
18112
+ ? `background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");`
18113
+ : `background-image: url("${mobilePrimaryImage}");`}
18055
18114
  background-size: cover;
18056
18115
  background-repeat: no-repeat;
18057
18116
  background-position: center;
@@ -18166,7 +18225,9 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18166
18225
 
18167
18226
  @container (min-width: 640px) {
18168
18227
  .${prefix} {
18169
- background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");
18228
+ ${this.hasContent
18229
+ ? `background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");`
18230
+ : `background-image: url("${primaryImage}");`}
18170
18231
  }
18171
18232
 
18172
18233
  .${prefix}__text {
@@ -18257,27 +18318,54 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18257
18318
  }
18258
18319
  `;
18259
18320
  }
18321
+ get hasContent() {
18322
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
18323
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18324
+ enableMobileTexts = false, } = this._data;
18325
+ const content = this._isMobileDevice && enableMobileTexts
18326
+ ? {
18327
+ preHeader: mobilePreHeader,
18328
+ header: mobileHeader,
18329
+ description: mobileDescription,
18330
+ ctaText: mobileCtaText,
18331
+ }
18332
+ : { preHeader, header, description, ctaText };
18333
+ return Object.values(content).some(Boolean);
18334
+ }
18260
18335
  }
18261
18336
 
18262
18337
  class RbHomepageHeroThreeTileSE extends BaseSpotComponent {
18263
18338
  constructor() {
18264
18339
  super();
18340
+ this.reRenderOnDeviceChange = true;
18265
18341
  }
18266
18342
  template() {
18267
18343
  const prefix = this._config.prefix;
18268
- const { header, description, ctaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.LEFT, mobileTextBlockPosition = textBlockPosition, } = this._data;
18344
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.LEFT, mobileTextBlockPosition = textBlockPosition,
18345
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18346
+ enableMobileTexts = false, } = this._data;
18347
+ const content = this._isMobileDevice && enableMobileTexts
18348
+ ? {
18349
+ header: mobileHeader,
18350
+ description: mobileDescription,
18351
+ ctaText: mobileCtaText,
18352
+ }
18353
+ : { header, description, ctaText };
18354
+ const elements = this.hasContent
18355
+ ? [
18356
+ renderElement('h2', `${prefix}__header`, content.header),
18357
+ renderElement('p', `${prefix}__description`, content.description),
18358
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
18359
+ ]
18360
+ : [];
18269
18361
  return `
18270
- ${GFONT_PRECONNECT}
18271
- ${GFONT_SOURCE_SANS_3}
18272
- ${GFONT_CORMORANT}
18362
+ ${importFonts()}
18273
18363
  <div class="${prefix}">
18274
18364
  <div class="${prefix}__content ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
18275
18365
  <div class="${prefix}__main">
18276
18366
  <div class="${prefix}__secondary-image"></div>
18277
18367
  <div class="${prefix}__text">
18278
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18279
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18280
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
18368
+ ${elements.join('')}
18281
18369
  </div>
18282
18370
  </div>
18283
18371
  <div class="${prefix}__primary-image"></div>
@@ -18479,25 +18567,51 @@ class RbHomepageHeroThreeTileSE extends BaseSpotComponent {
18479
18567
  }
18480
18568
  `;
18481
18569
  }
18570
+ get hasContent() {
18571
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
18572
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18573
+ enableMobileTexts = false, } = this._data;
18574
+ const content = this._isMobileDevice && enableMobileTexts
18575
+ ? {
18576
+ header: mobileHeader,
18577
+ description: mobileDescription,
18578
+ ctaText: mobileCtaText,
18579
+ }
18580
+ : { header, description, ctaText };
18581
+ return Object.values(content).some(Boolean);
18582
+ }
18482
18583
  }
18483
18584
 
18484
18585
  class RbHomepageHeroTwoTileSE extends BaseSpotComponent {
18485
18586
  constructor() {
18486
18587
  super();
18588
+ this.reRenderOnDeviceChange = true;
18487
18589
  }
18488
18590
  template() {
18489
18591
  const prefix = this._config.prefix;
18490
- const { header, description, ctaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.LEFT, mobileTextBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.TOP, } = this._data;
18592
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.LEFT, mobileTextBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.TOP,
18593
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18594
+ enableMobileTexts = false, } = this._data;
18595
+ const content = this._isMobileDevice && enableMobileTexts
18596
+ ? {
18597
+ header: mobileHeader,
18598
+ description: mobileDescription,
18599
+ ctaText: mobileCtaText,
18600
+ }
18601
+ : { header, description, ctaText };
18602
+ const elements = this.hasContent
18603
+ ? [
18604
+ renderElement('h2', `${prefix}__header`, content.header),
18605
+ renderElement('p', `${prefix}__description`, content.description),
18606
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
18607
+ ]
18608
+ : [];
18491
18609
  return `
18492
- ${GFONT_PRECONNECT}
18493
- ${GFONT_SOURCE_SANS_3}
18494
- ${GFONT_CORMORANT}
18610
+ ${importFonts()}
18495
18611
  <div class="${prefix}">
18496
18612
  <div class="${prefix}__content ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
18497
18613
  <div class="${prefix}__text">
18498
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18499
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18500
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
18614
+ ${elements.join('')}
18501
18615
  </div>
18502
18616
  <div class="${prefix}__image"></div>
18503
18617
  </div>
@@ -18665,6 +18779,19 @@ class RbHomepageHeroTwoTileSE extends BaseSpotComponent {
18665
18779
  }
18666
18780
  `;
18667
18781
  }
18782
+ get hasContent() {
18783
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
18784
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18785
+ enableMobileTexts = false, } = this._data;
18786
+ const content = this._isMobileDevice && enableMobileTexts
18787
+ ? {
18788
+ header: mobileHeader,
18789
+ description: mobileDescription,
18790
+ ctaText: mobileCtaText,
18791
+ }
18792
+ : { header, description, ctaText };
18793
+ return Object.values(content).some(Boolean);
18794
+ }
18668
18795
  }
18669
18796
 
18670
18797
  class RbInTextSE extends BaseSpotComponent {
@@ -18709,22 +18836,39 @@ class RbInTextSE extends BaseSpotComponent {
18709
18836
  class RbLargeCategoryImageToutSE extends BaseSpotComponent {
18710
18837
  constructor() {
18711
18838
  super();
18839
+ this.reRenderOnDeviceChange = true;
18712
18840
  }
18713
18841
  template() {
18714
18842
  const prefix = this._config.prefix;
18715
- const { header, description, ctaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.LEFT, } = this._data;
18843
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.LEFT,
18844
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18845
+ enableMobileTexts = false, } = this._data;
18846
+ const content = this._isMobileDevice && enableMobileTexts
18847
+ ? {
18848
+ header: mobileHeader,
18849
+ description: mobileDescription,
18850
+ ctaText: mobileCtaText,
18851
+ }
18852
+ : { header, description, ctaText };
18853
+ if (!this.hasContent) {
18854
+ return `
18855
+ ${importFonts()}
18856
+ <div class="${prefix}"></div>
18857
+ `;
18858
+ }
18859
+ const elements = [
18860
+ renderElement('h2', `${prefix}__header`, content.header),
18861
+ renderElement('p', `${prefix}__description`, content.description),
18862
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
18863
+ ];
18716
18864
  return `
18717
- ${GFONT_PRECONNECT}
18718
- ${GFONT_SOURCE_SANS_3}
18719
- ${GFONT_CORMORANT}
18720
- <div class="${prefix}">
18721
- <div class="${prefix}__text ${prefix}__text-block--${textBlockPosition}">
18722
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18723
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18724
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
18865
+ ${importFonts()}
18866
+ <div class="${prefix}">
18867
+ <div class="${prefix}__text ${prefix}__text-block--${textBlockPosition}">
18868
+ ${elements.join('')}
18869
+ </div>
18725
18870
  </div>
18726
- </div>
18727
- `;
18871
+ `;
18728
18872
  }
18729
18873
  styles() {
18730
18874
  const { textColor = '#ffffff', ctaTextColor = textColor, ctaBorderColor = ctaTextColor, primaryImage, mobilePrimaryImage = primaryImage, } = this._data;
@@ -18737,7 +18881,9 @@ class RbLargeCategoryImageToutSE extends BaseSpotComponent {
18737
18881
  display: flex;
18738
18882
  flex-direction: column;
18739
18883
  justify-content: flex-end;
18740
- background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");
18884
+ ${this.hasContent
18885
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");`
18886
+ : `background-image: url("${mobilePrimaryImage}");`}
18741
18887
  background-size: cover;
18742
18888
  background-repeat: no-repeat;
18743
18889
  background-position: center;
@@ -18813,7 +18959,9 @@ class RbLargeCategoryImageToutSE extends BaseSpotComponent {
18813
18959
 
18814
18960
  @container (min-width: 640px) {
18815
18961
  .${prefix} {
18816
- background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
18962
+ ${this.hasContent
18963
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");`
18964
+ : `background-image: url("${primaryImage}");`}
18817
18965
  }
18818
18966
  }
18819
18967
 
@@ -18861,25 +19009,56 @@ class RbLargeCategoryImageToutSE extends BaseSpotComponent {
18861
19009
  }
18862
19010
  `;
18863
19011
  }
19012
+ get hasContent() {
19013
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
19014
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19015
+ enableMobileTexts = false, } = this._data;
19016
+ const content = this._isMobileDevice && enableMobileTexts
19017
+ ? {
19018
+ header: mobileHeader,
19019
+ description: mobileDescription,
19020
+ ctaText: mobileCtaText,
19021
+ }
19022
+ : { header, description, ctaText };
19023
+ return Object.values(content).some(Boolean);
19024
+ }
18864
19025
  }
18865
19026
 
18866
19027
  class RbLongToutShortSE extends BaseSpotComponent {
18867
19028
  constructor() {
18868
19029
  super();
19030
+ this.reRenderOnDeviceChange = true;
18869
19031
  }
18870
19032
  template() {
18871
19033
  const prefix = this._config.prefix;
18872
- const { preHeader, header, description, ctaText } = this._data;
19034
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
19035
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19036
+ enableMobileTexts = false, } = this._data;
19037
+ const content = this._isMobileDevice && enableMobileTexts
19038
+ ? {
19039
+ preHeader: mobilePreHeader,
19040
+ header: mobileHeader,
19041
+ description: mobileDescription,
19042
+ ctaText: mobileCtaText,
19043
+ }
19044
+ : { preHeader, header, description, ctaText };
19045
+ if (!this.hasContent) {
19046
+ return `
19047
+ ${importFonts()}
19048
+ <div class="${prefix}"></div>
19049
+ `;
19050
+ }
19051
+ const elements = [
19052
+ renderElement('h2', `${prefix}__pre-header`, content.preHeader),
19053
+ renderElement('h2', `${prefix}__header`, content.header),
19054
+ renderElement('p', `${prefix}__description`, content.description),
19055
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
19056
+ ];
18873
19057
  return `
18874
- ${GFONT_PRECONNECT}
18875
- ${GFONT_SOURCE_SANS_3}
18876
- ${GFONT_CORMORANT}
19058
+ ${importFonts()}
18877
19059
  <div class="${prefix}">
18878
19060
  <div class="${prefix}__text">
18879
- ${preHeader ? `<h2 class="${prefix}__pre-header">${preHeader}</h2>` : ''}
18880
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18881
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18882
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
19061
+ ${elements.join('')}
18883
19062
  </div>
18884
19063
  </div>
18885
19064
  `;
@@ -19025,11 +19204,26 @@ class RbLongToutShortSE extends BaseSpotComponent {
19025
19204
  }
19026
19205
  `;
19027
19206
  }
19207
+ get hasContent() {
19208
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
19209
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19210
+ enableMobileTexts = false, } = this._data;
19211
+ const content = this._isMobileDevice && enableMobileTexts
19212
+ ? {
19213
+ preHeader: mobilePreHeader,
19214
+ header: mobileHeader,
19215
+ description: mobileDescription,
19216
+ ctaText: mobileCtaText,
19217
+ }
19218
+ : { preHeader, header, description, ctaText };
19219
+ return Object.values(content).some(Boolean);
19220
+ }
19028
19221
  }
19029
19222
 
19030
19223
  class RbLongToutTallSE extends BaseSpotComponent {
19031
19224
  constructor() {
19032
19225
  super();
19226
+ this.reRenderOnDeviceChange = true;
19033
19227
  }
19034
19228
  getGradientDirection(position) {
19035
19229
  switch (position) {
@@ -19049,17 +19243,36 @@ class RbLongToutTallSE extends BaseSpotComponent {
19049
19243
  }
19050
19244
  template() {
19051
19245
  const prefix = this._config.prefix;
19052
- const { preHeader, header, description, ctaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.MIDDLE_LEFT, mobileTextBlockPosition = textBlockPosition, } = this._data;
19246
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = exports.ENUM_TEXT_BLOCK_POSITION.MIDDLE_LEFT, mobileTextBlockPosition = textBlockPosition,
19247
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19248
+ enableMobileTexts = false, } = this._data;
19249
+ const content = this._isMobileDevice && enableMobileTexts
19250
+ ? {
19251
+ preHeader: mobilePreHeader,
19252
+ header: mobileHeader,
19253
+ description: mobileDescription,
19254
+ ctaText: mobileCtaText,
19255
+ }
19256
+ : { preHeader, header, description, ctaText };
19257
+ if (!this.hasContent) {
19258
+ return `
19259
+ ${importFonts()}
19260
+ <div class="${prefix}"></div>
19261
+ `;
19262
+ }
19263
+ const elements = [
19264
+ renderElement('h2', `${prefix}__pre-header`, content.preHeader),
19265
+ renderElement('h2', `${prefix}__header`, content.header),
19266
+ renderElement('p', `${prefix}__description`, content.description),
19267
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
19268
+ ];
19053
19269
  return `
19054
19270
  ${GFONT_PRECONNECT}
19055
19271
  ${GFONT_SOURCE_SANS_3}
19056
19272
  ${GFONT_CORMORANT}
19057
19273
  <div class="${prefix}">
19058
19274
  <div class="${prefix}__text ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
19059
- ${preHeader ? `<h2 class="${prefix}__pre-header">${preHeader}</h2>` : ''}
19060
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
19061
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
19062
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
19275
+ ${elements.join('')}
19063
19276
  </div>
19064
19277
  </div>
19065
19278
  `;
@@ -19076,7 +19289,9 @@ class RbLongToutTallSE extends BaseSpotComponent {
19076
19289
  display: flex;
19077
19290
  width: 100%;
19078
19291
  height: 100%;
19079
- background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");
19292
+ ${this.hasContent
19293
+ ? `background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");`
19294
+ : `background-image: url("${mobilePrimaryImage}");`}
19080
19295
  background-size: cover;
19081
19296
  background-repeat: no-repeat;
19082
19297
  background-position: center;
@@ -19146,7 +19361,9 @@ class RbLongToutTallSE extends BaseSpotComponent {
19146
19361
 
19147
19362
  @container (min-width: 640px) {
19148
19363
  .${prefix} {
19149
- background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");
19364
+ ${this.hasContent
19365
+ ? `background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");`
19366
+ : `background-image: url("${primaryImage}");`}
19150
19367
  }
19151
19368
 
19152
19369
  .${prefix}__text {
@@ -19282,22 +19499,50 @@ class RbLongToutTallSE extends BaseSpotComponent {
19282
19499
  }
19283
19500
  `;
19284
19501
  }
19502
+ get hasContent() {
19503
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
19504
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19505
+ enableMobileTexts = false, } = this._data;
19506
+ const content = this._isMobileDevice && enableMobileTexts
19507
+ ? {
19508
+ preHeader: mobilePreHeader,
19509
+ header: mobileHeader,
19510
+ description: mobileDescription,
19511
+ ctaText: mobileCtaText,
19512
+ }
19513
+ : { preHeader, header, description, ctaText };
19514
+ return Object.values(content).some(Boolean);
19515
+ }
19285
19516
  }
19286
19517
 
19287
19518
  class RbNavigationBannerSE extends BaseSpotComponent {
19288
19519
  constructor() {
19289
19520
  super();
19521
+ this.reRenderOnDeviceChange = true;
19290
19522
  }
19291
19523
  template() {
19292
19524
  const prefix = this._config.prefix;
19293
- const { header } = this._data;
19525
+ const { header, mobileHeader,
19526
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19527
+ enableMobileTexts = false, } = this._data;
19528
+ const content = this._isMobileDevice && enableMobileTexts
19529
+ ? {
19530
+ header: mobileHeader,
19531
+ }
19532
+ : { header };
19533
+ if (!this.hasContent) {
19534
+ return `
19535
+ ${importFonts('sourceSans')}
19536
+ <div class="${prefix}"></div>
19537
+ `;
19538
+ }
19539
+ const elements = [renderElement('h2', `${prefix}__header`, content.header)];
19294
19540
  return `
19295
- ${GFONT_PRECONNECT}
19296
- ${GFONT_SOURCE_SANS_3}
19297
- <div class="${prefix}">
19298
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
19299
- </div>
19300
- `;
19541
+ ${importFonts('sourceSans')}
19542
+ <div class="${prefix}">
19543
+ ${elements.join('')}
19544
+ </div>
19545
+ `;
19301
19546
  }
19302
19547
  styles() {
19303
19548
  const { textColor = '#ffffff', primaryImage, mobilePrimaryImage = primaryImage } = this._data;
@@ -19313,7 +19558,9 @@ class RbNavigationBannerSE extends BaseSpotComponent {
19313
19558
  border-radius: 5px;
19314
19559
  overflow: hidden;
19315
19560
  cursor: pointer;
19316
- background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");
19561
+ ${this.hasContent
19562
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");`
19563
+ : `background-image: url("${mobilePrimaryImage}");`}
19317
19564
  background-size: cover;
19318
19565
  background-position: center;
19319
19566
  background-repeat: no-repeat;
@@ -19333,7 +19580,9 @@ class RbNavigationBannerSE extends BaseSpotComponent {
19333
19580
 
19334
19581
  @container (min-width: 640px) {
19335
19582
  .${prefix} {
19336
- background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
19583
+ ${this.hasContent
19584
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");`
19585
+ : `background-image: url("${primaryImage}");`}
19337
19586
  }
19338
19587
  }
19339
19588
 
@@ -19356,22 +19605,47 @@ class RbNavigationBannerSE extends BaseSpotComponent {
19356
19605
  }
19357
19606
  `;
19358
19607
  }
19608
+ get hasContent() {
19609
+ const { header, mobileHeader,
19610
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19611
+ enableMobileTexts = false, } = this._data;
19612
+ const content = this._isMobileDevice && enableMobileTexts
19613
+ ? {
19614
+ header: mobileHeader,
19615
+ }
19616
+ : { header };
19617
+ return Object.values(content).some(Boolean);
19618
+ }
19359
19619
  }
19360
19620
 
19361
19621
  class RbSmallCategoryImageToutSE extends BaseSpotComponent {
19362
19622
  constructor() {
19363
19623
  super();
19624
+ this.reRenderOnDeviceChange = true;
19364
19625
  }
19365
19626
  template() {
19366
19627
  const prefix = this._config.prefix;
19367
- const { header } = this._data;
19628
+ const { header, mobileHeader,
19629
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19630
+ enableMobileTexts = false, } = this._data;
19631
+ const content = this._isMobileDevice && enableMobileTexts
19632
+ ? {
19633
+ header: mobileHeader,
19634
+ }
19635
+ : { header };
19636
+ if (!this.hasContent) {
19637
+ return `
19638
+ ${importFonts('cormorant')}
19639
+ <div class="${prefix}"></div>
19640
+ `;
19641
+ }
19642
+ const elements = [renderElement('h2', `${prefix}__header`, content.header)];
19368
19643
  return `
19369
- ${GFONT_PRECONNECT}
19370
- ${GFONT_CORMORANT}
19371
- <div class="${prefix}">
19372
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
19373
- </div>
19374
- `;
19644
+ ${importFonts('cormorant')}
19645
+ <div class="${prefix}">
19646
+ ${elements.join('')}
19647
+ </div>
19648
+ `;
19375
19649
  }
19376
19650
  styles() {
19377
19651
  const { textColor = '#ffffff', primaryImage, mobilePrimaryImage = primaryImage } = this._data;
@@ -19384,7 +19658,9 @@ class RbSmallCategoryImageToutSE extends BaseSpotComponent {
19384
19658
  display: flex;
19385
19659
  flex-direction: column;
19386
19660
  justify-content: flex-end;
19387
- background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");
19661
+ ${this.hasContent
19662
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");`
19663
+ : `background-image: url("${mobilePrimaryImage}");`}
19388
19664
  background-size: cover;
19389
19665
  background-repeat: no-repeat;
19390
19666
  background-position: center;
@@ -19407,30 +19683,51 @@ class RbSmallCategoryImageToutSE extends BaseSpotComponent {
19407
19683
 
19408
19684
  @container (min-width: 640px) {
19409
19685
  .${prefix} {
19410
- background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
19686
+ ${this.hasContent
19687
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");`
19688
+ : `background-image: url("${primaryImage}");`}
19411
19689
  }
19412
19690
  }
19413
19691
  `;
19414
19692
  }
19693
+ get hasContent() {
19694
+ const { header, mobileHeader,
19695
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19696
+ enableMobileTexts = false, } = this._data;
19697
+ const content = this._isMobileDevice && enableMobileTexts
19698
+ ? {
19699
+ header: mobileHeader,
19700
+ }
19701
+ : { header };
19702
+ return Object.values(content).some(Boolean);
19703
+ }
19415
19704
  }
19416
19705
 
19417
19706
  class RbSmallDiscoverToutSE extends BaseSpotComponent {
19418
19707
  constructor() {
19419
19708
  super();
19709
+ this.reRenderOnDeviceChange = true;
19420
19710
  }
19421
19711
  template() {
19422
19712
  const prefix = this._config.prefix;
19423
- const { header } = this._data;
19713
+ const { header, mobileHeader,
19714
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19715
+ enableMobileTexts = false, } = this._data;
19716
+ const content = this._isMobileDevice && enableMobileTexts
19717
+ ? {
19718
+ header: mobileHeader,
19719
+ }
19720
+ : { header };
19721
+ const elements = [renderElement('h2', `${prefix}__header`, content.header)];
19424
19722
  return `
19425
- ${GFONT_PRECONNECT}
19426
- ${GFONT_CORMORANT}
19427
- <div class="${prefix}">
19428
- <div class="${prefix}__image"></div>
19429
- <div class="${prefix}__text">
19430
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
19723
+ ${importFonts('sourceSans')}
19724
+ <div class="${prefix}">
19725
+ <div class="${prefix}__image"></div>
19726
+ <div class="${prefix}__text">
19727
+ ${elements.join('')}
19728
+ </div>
19431
19729
  </div>
19432
- </div>
19433
- `;
19730
+ `;
19434
19731
  }
19435
19732
  styles() {
19436
19733
  const { textColor = '#000000', backgroundColor = 'transparent', primaryImage, mobilePrimaryImage = primaryImage, } = this._data;
@@ -19547,13 +19844,13 @@ class RbVideoPlayerSE extends BaseSpotComponent {
19547
19844
  if (!this.video)
19548
19845
  return;
19549
19846
  const muteButton = this._container.querySelector(this.muteButtonSelector());
19550
- muteButton === null || muteButton === void 0 ? void 0 : muteButton.addEventListener('click', this.handleMuteToggle);
19847
+ muteButton === null || muteButton === undefined ? undefined : muteButton.addEventListener('click', this.handleMuteToggle);
19551
19848
  }
19552
19849
  removeEventListeners() {
19553
19850
  if (!this.video)
19554
19851
  return;
19555
19852
  const muteButton = this._container.querySelector(this.muteButtonSelector());
19556
- muteButton === null || muteButton === void 0 ? void 0 : muteButton.removeEventListener('click', this.handleMuteToggle);
19853
+ muteButton === null || muteButton === undefined ? undefined : muteButton.removeEventListener('click', this.handleMuteToggle);
19557
19854
  }
19558
19855
  template() {
19559
19856
  const prefix = this._config.prefix;
@@ -19732,7 +20029,7 @@ class SpotTemplateService {
19732
20029
  const variantClasses = this.isRbSpot(spotType) ? this.rbTemplates : this.iabTemplates;
19733
20030
  if (!variantClasses)
19734
20031
  return null;
19735
- const spotClass = ((_a = variantClasses[spotType]) === null || _a === void 0 ? void 0 : _a[spotVariant]) || null;
20032
+ const spotClass = ((_a = variantClasses[spotType]) === null || _a === undefined ? undefined : _a[spotVariant]) || null;
19736
20033
  if (!spotClass)
19737
20034
  return null;
19738
20035
  return spotClass;
@@ -20066,7 +20363,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
20066
20363
  disconnectedCallback() {
20067
20364
  var _a;
20068
20365
  this.cleanupEventListeners();
20069
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
20366
+ (_a = this.resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
20070
20367
  }
20071
20368
  setupResizeObserver() {
20072
20369
  if (this.data && !this.data.fluid) {
@@ -20087,14 +20384,14 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
20087
20384
  */
20088
20385
  initializeState() {
20089
20386
  var _a, _b, _c, _d, _e, _f, _g, _h;
20090
- this.state.useDots = Boolean((_a = this.data) === null || _a === void 0 ? void 0 : _a.useDots);
20091
- this.state.useButtons = Boolean((_b = this.data) === null || _b === void 0 ? void 0 : _b.useButtons);
20092
- this.state.autoplay = (_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c.autoplay) !== null && _d !== void 0 ? _d : true;
20093
- this.state.interval = (_f = (_e = this.data) === null || _e === void 0 ? void 0 : _e.interval) !== null && _f !== void 0 ? _f : CustomCarouselElement.defaultConfigs.interval;
20094
- if (typeof ((_g = this.data) === null || _g === void 0 ? void 0 : _g.useDots) === 'object') {
20387
+ this.state.useDots = Boolean((_a = this.data) === null || _a === undefined ? undefined : _a.useDots);
20388
+ this.state.useButtons = Boolean((_b = this.data) === null || _b === undefined ? undefined : _b.useButtons);
20389
+ this.state.autoplay = (_d = (_c = this.data) === null || _c === undefined ? undefined : _c.autoplay) !== null && _d !== undefined ? _d : true;
20390
+ this.state.interval = (_f = (_e = this.data) === null || _e === undefined ? undefined : _e.interval) !== null && _f !== undefined ? _f : CustomCarouselElement.defaultConfigs.interval;
20391
+ if (typeof ((_g = this.data) === null || _g === undefined ? undefined : _g.useDots) === 'object') {
20095
20392
  this.state.dots = { ...this.state.dots, ...this.data.useDots };
20096
20393
  }
20097
- if (typeof ((_h = this.data) === null || _h === void 0 ? void 0 : _h.useButtons) === 'object') {
20394
+ if (typeof ((_h = this.data) === null || _h === undefined ? undefined : _h.useButtons) === 'object') {
20098
20395
  this.state.buttons = { ...this.state.buttons, ...this.data.useButtons };
20099
20396
  }
20100
20397
  this.validateConfiguration();
@@ -20558,7 +20855,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
20558
20855
  }
20559
20856
  this.state.isVirtualizing = false;
20560
20857
  // Force reflow to ensure the style change takes effect immediately
20561
- void ((_a = this.elements.slidesContainer) === null || _a === void 0 ? void 0 : _a.offsetHeight);
20858
+ void ((_a = this.elements.slidesContainer) === null || _a === undefined ? undefined : _a.offsetHeight);
20562
20859
  }
20563
20860
  /**
20564
20861
  * Updates dot active states
@@ -20667,8 +20964,8 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
20667
20964
  });
20668
20965
  }
20669
20966
  if (this.state.useButtons) {
20670
- (_a = this.elements.prevButton) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => this.handleNavigation('prev'));
20671
- (_b = this.elements.nextButton) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => this.handleNavigation('next'));
20967
+ (_a = this.elements.prevButton) === null || _a === undefined ? undefined : _a.addEventListener('click', () => this.handleNavigation('prev'));
20968
+ (_b = this.elements.nextButton) === null || _b === undefined ? undefined : _b.addEventListener('click', () => this.handleNavigation('next'));
20672
20969
  }
20673
20970
  }
20674
20971
  /**
@@ -20855,7 +21152,7 @@ class ElementService {
20855
21152
  const dimensions = SPOT_DIMENSIONS[params.spotType];
20856
21153
  skeleton.data = {
20857
21154
  spotType: params.spotType,
20858
- fluid: (params === null || params === void 0 ? void 0 : params.fluid) === undefined ? false : params.fluid,
21155
+ fluid: (params === null || params === undefined ? undefined : params.fluid) === undefined ? false : params.fluid,
20859
21156
  ...dimensions,
20860
21157
  };
20861
21158
  return skeleton;
@@ -20945,16 +21242,16 @@ class DataLayerMonitor {
20945
21242
  }
20946
21243
  extractProductData(event) {
20947
21244
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
20948
- const items = ((_a = event === null || event === void 0 ? void 0 : event.value) === null || _a === void 0 ? void 0 : _a.items) ||
20949
- ((_b = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _b === void 0 ? void 0 : _b.items) ||
20950
- ((_c = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _c === void 0 ? void 0 : _c.products) ||
20951
- ((_e = (_d = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _d === void 0 ? void 0 : _d.detail) === null || _e === void 0 ? void 0 : _e.products) ||
20952
- ((_g = (_f = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _f === void 0 ? void 0 : _f.checkout) === null || _g === void 0 ? void 0 : _g.products) ||
20953
- ((_j = (_h = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _h === void 0 ? void 0 : _h.purchase) === null || _j === void 0 ? void 0 : _j.products) ||
20954
- ((_l = (_k = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _k === void 0 ? void 0 : _k.add) === null || _l === void 0 ? void 0 : _l.products) ||
20955
- ((_o = (_m = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _m === void 0 ? void 0 : _m.remove) === null || _o === void 0 ? void 0 : _o.products) ||
20956
- ((_q = (_p = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _p === void 0 ? void 0 : _p.click) === null || _q === void 0 ? void 0 : _q.products) ||
20957
- (event === null || event === void 0 ? void 0 : event.products) ||
21245
+ const items = ((_a = event === null || event === undefined ? undefined : event.value) === null || _a === undefined ? undefined : _a.items) ||
21246
+ ((_b = event === null || event === undefined ? undefined : event.ecommerce) === null || _b === undefined ? undefined : _b.items) ||
21247
+ ((_c = event === null || event === undefined ? undefined : event.ecommerce) === null || _c === undefined ? undefined : _c.products) ||
21248
+ ((_e = (_d = event === null || event === undefined ? undefined : event.ecommerce) === null || _d === undefined ? undefined : _d.detail) === null || _e === undefined ? undefined : _e.products) ||
21249
+ ((_g = (_f = event === null || event === undefined ? undefined : event.ecommerce) === null || _f === undefined ? undefined : _f.checkout) === null || _g === undefined ? undefined : _g.products) ||
21250
+ ((_j = (_h = event === null || event === undefined ? undefined : event.ecommerce) === null || _h === undefined ? undefined : _h.purchase) === null || _j === undefined ? undefined : _j.products) ||
21251
+ ((_l = (_k = event === null || event === undefined ? undefined : event.ecommerce) === null || _k === undefined ? undefined : _k.add) === null || _l === undefined ? undefined : _l.products) ||
21252
+ ((_o = (_m = event === null || event === undefined ? undefined : event.ecommerce) === null || _m === undefined ? undefined : _m.remove) === null || _o === undefined ? undefined : _o.products) ||
21253
+ ((_q = (_p = event === null || event === undefined ? undefined : event.ecommerce) === null || _p === undefined ? undefined : _p.click) === null || _q === undefined ? undefined : _q.products) ||
21254
+ (event === null || event === undefined ? undefined : event.products) ||
20958
21255
  [];
20959
21256
  return items.map((item) => {
20960
21257
  const data = {
@@ -21010,7 +21307,7 @@ class MonitorService {
21010
21307
  return;
21011
21308
  this.implementedMonitor.setListener(async (eventData) => {
21012
21309
  var _a;
21013
- await this.matchAndFireEvent(eventData, (_a = this.localStorageService) === null || _a === void 0 ? void 0 : _a.getSpots());
21310
+ await this.matchAndFireEvent(eventData, (_a = this.localStorageService) === null || _a === undefined ? undefined : _a.getSpots());
21014
21311
  });
21015
21312
  this.implementedMonitor.start();
21016
21313
  }
@@ -21026,14 +21323,14 @@ class MonitorService {
21026
21323
  continue;
21027
21324
  }
21028
21325
  const firedEvents = spot.firedEvents || [];
21029
- const eventProductId = (_a = this.normalizeStringHelper) === null || _a === void 0 ? void 0 : _a.normalize(String(data.id));
21326
+ const eventProductId = (_a = this.normalizeStringHelper) === null || _a === undefined ? undefined : _a.normalize(String(data.id));
21030
21327
  const isEventAlreadyFired = firedEvents.some((event) => event.productId === eventProductId && event.event === eventData.event);
21031
21328
  if (isEventAlreadyFired) {
21032
21329
  continue;
21033
21330
  }
21034
- const spotRelatedProductIdsSet = new Set(spot.productIds.map((id) => { var _a; return (_a = this.normalizeStringHelper) === null || _a === void 0 ? void 0 : _a.normalize(String(id)); }));
21035
- const eventProductBrand = (_b = this.normalizeStringHelper) === null || _b === void 0 ? void 0 : _b.normalize(String(data.brand));
21036
- const eventVariantBrand = (_c = this.normalizeStringHelper) === null || _c === void 0 ? void 0 : _c.normalize(String(data.variant));
21331
+ const spotRelatedProductIdsSet = new Set(spot.productIds.map((id) => { var _a; return (_a = this.normalizeStringHelper) === null || _a === undefined ? undefined : _a.normalize(String(id)); }));
21332
+ const eventProductBrand = (_b = this.normalizeStringHelper) === null || _b === undefined ? undefined : _b.normalize(String(data.brand));
21333
+ const eventVariantBrand = (_c = this.normalizeStringHelper) === null || _c === undefined ? undefined : _c.normalize(String(data.variant));
21037
21334
  const isProductMatch = [eventProductId, eventProductBrand, eventVariantBrand].some((id) => spotRelatedProductIdsSet.has(id));
21038
21335
  if (!isProductMatch) {
21039
21336
  continue;
@@ -21064,7 +21361,7 @@ class MonitorService {
21064
21361
  event: eventData.event,
21065
21362
  });
21066
21363
  // Update the spots in the local storage
21067
- (_d = this.localStorageService) === null || _d === void 0 ? void 0 : _d.setSpot(spot.spotId, {
21364
+ (_d = this.localStorageService) === null || _d === undefined ? undefined : _d.setSpot(spot.spotId, {
21068
21365
  placementId: spot.placementId,
21069
21366
  spotId: spot.spotId,
21070
21367
  spotType: spot.spotType,
@@ -21128,9 +21425,9 @@ class SelectionService extends BaseApi {
21128
21425
  }
21129
21426
  const { isOk, val, isErr } = await this.post(SELECTION_API_PATH, data, {});
21130
21427
  if (isErr) {
21131
- return { error: `There was an error during spot selection: (${isErr === null || isErr === void 0 ? void 0 : isErr.errorMessage})` };
21428
+ return { error: `There was an error during spot selection: (${isErr === null || isErr === undefined ? undefined : isErr.errorMessage})` };
21132
21429
  }
21133
- if (isOk && val && val.data && (val === null || val === void 0 ? void 0 : val.refresh.token)) {
21430
+ if (isOk && val && val.data && (val === null || val === undefined ? undefined : val.refresh.token)) {
21134
21431
  this.authInfo.authenticated = true;
21135
21432
  this.authInfo.token = val.refresh.token;
21136
21433
  return val.data.spots;
@@ -21245,7 +21542,7 @@ class SpotManagerService {
21245
21542
  spotId: spot.id,
21246
21543
  spotType: spot.spot,
21247
21544
  events: spot.events,
21248
- productIds: (_a = spot.productIds) !== null && _a !== void 0 ? _a : [],
21545
+ productIds: (_a = spot.productIds) !== null && _a !== undefined ? _a : [],
21249
21546
  });
21250
21547
  }
21251
21548
  async handleClickEvent({ placementId, spot }) {
@@ -21258,7 +21555,7 @@ class SpotManagerService {
21258
21555
  await fireEvent({
21259
21556
  spotType: spot.spot,
21260
21557
  event: exports.RMN_SPOT_EVENT.CLICK,
21261
- eventUrl: (_b = (_a = spot.events.find((event) => event.event === exports.RMN_SPOT_EVENT.CLICK)) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : '',
21558
+ eventUrl: (_b = (_a = spot.events.find((event) => event.event === exports.RMN_SPOT_EVENT.CLICK)) === null || _a === undefined ? undefined : _a.url) !== null && _b !== undefined ? _b : '',
21262
21559
  });
21263
21560
  }
21264
21561
  handleImpressionEvent(placementId, spot) {
@@ -21272,7 +21569,7 @@ class SpotManagerService {
21272
21569
  await fireEvent({
21273
21570
  spotType: spot.spot,
21274
21571
  event: exports.RMN_SPOT_EVENT.IMPRESSION,
21275
- eventUrl: (_b = (_a = spot.events.find((event) => event.event === exports.RMN_SPOT_EVENT.IMPRESSION)) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : '',
21572
+ eventUrl: (_b = (_a = spot.events.find((event) => event.event === exports.RMN_SPOT_EVENT.IMPRESSION)) === null || _a === undefined ? undefined : _a.url) !== null && _b !== undefined ? _b : '',
21276
21573
  });
21277
21574
  })();
21278
21575
  }
@@ -21347,7 +21644,7 @@ function validateInjectData(inject) {
21347
21644
  */
21348
21645
  function clearPlacement(placementId) {
21349
21646
  var _a;
21350
- (_a = document.getElementById(placementId)) === null || _a === void 0 ? void 0 : _a.replaceChildren();
21647
+ (_a = document.getElementById(placementId)) === null || _a === undefined ? undefined : _a.replaceChildren();
21351
21648
  }
21352
21649
  /**
21353
21650
  * Prepares the spot placement for rendering by taking care of its styling.
@@ -21381,10 +21678,10 @@ function overrideSpotColors(spot, colors) {
21381
21678
  const { textColor, backgroundColor, ctaTextColor, ctaBorderColor } = colors;
21382
21679
  return {
21383
21680
  ...spot,
21384
- textColor: textColor !== null && textColor !== void 0 ? textColor : spot.textColor,
21385
- backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : spot.backgroundColor,
21386
- ctaTextColor: ctaTextColor !== null && ctaTextColor !== void 0 ? ctaTextColor : spot.ctaTextColor,
21387
- ctaBorderColor: ctaBorderColor !== null && ctaBorderColor !== void 0 ? ctaBorderColor : spot.ctaBorderColor,
21681
+ textColor: textColor !== null && textColor !== undefined ? textColor : spot.textColor,
21682
+ backgroundColor: backgroundColor !== null && backgroundColor !== undefined ? backgroundColor : spot.backgroundColor,
21683
+ ctaTextColor: ctaTextColor !== null && ctaTextColor !== undefined ? ctaTextColor : spot.ctaTextColor,
21684
+ ctaBorderColor: ctaBorderColor !== null && ctaBorderColor !== undefined ? ctaBorderColor : spot.ctaBorderColor,
21388
21685
  };
21389
21686
  }
21390
21687
  // Sets the id for the user who is browsing the website
@@ -21504,7 +21801,7 @@ class BrowserRmnClient {
21504
21801
  }, false);
21505
21802
  prepareSpotPlacement(placement);
21506
21803
  const skeletonElement = this.elementService.createSkeletonElement({
21507
- fluid: (_b = (_a = injectData === null || injectData === void 0 ? void 0 : injectData.config) === null || _a === void 0 ? void 0 : _a.fluid) !== null && _b !== void 0 ? _b : globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.fluid,
21804
+ fluid: (_b = (_a = injectData === null || injectData === undefined ? undefined : injectData.config) === null || _a === undefined ? undefined : _a.fluid) !== null && _b !== undefined ? _b : globalConfig === null || globalConfig === undefined ? undefined : globalConfig.fluid,
21508
21805
  spotType: injectData.spotType,
21509
21806
  });
21510
21807
  if (!skeletonElement) {
@@ -21516,7 +21813,7 @@ class BrowserRmnClient {
21516
21813
  });
21517
21814
  }
21518
21815
  if (skeletonElement) {
21519
- placement === null || placement === void 0 ? void 0 : placement.replaceChildren(skeletonElement);
21816
+ placement === null || placement === undefined ? undefined : placement.replaceChildren(skeletonElement);
21520
21817
  }
21521
21818
  validPlacements.set(placementId, placement);
21522
21819
  this.spotManagerService.updateSpotLifecycleState(injectData.placementId, {
@@ -21531,11 +21828,18 @@ class BrowserRmnClient {
21531
21828
  const validInjectPlacements = Array.from(validPlacements.keys())
21532
21829
  .map((id) => injectMap.get(id))
21533
21830
  .filter(Boolean);
21534
- // Make the spot selection request
21535
- const response = await this.injectSpotSelectionRequest({
21536
- ...params,
21537
- inject: validInjectPlacements,
21538
- });
21831
+ let response;
21832
+ // Use custom spots if provided
21833
+ if (params.customSpots) {
21834
+ response = params.customSpots;
21835
+ }
21836
+ else {
21837
+ // Make the spot selection request
21838
+ response = await this.injectSpotSelectionRequest({
21839
+ ...params,
21840
+ inject: validInjectPlacements,
21841
+ });
21842
+ }
21539
21843
  // Handle request error state
21540
21844
  if (typeof response === 'object' && 'error' in response) {
21541
21845
  this.spotManagerService.updateSpotLifecycleState('all', {
@@ -21552,9 +21856,9 @@ class BrowserRmnClient {
21552
21856
  validPlacements.forEach((placement, placementId) => {
21553
21857
  var _a;
21554
21858
  const injectData = injectMap.get(placementId);
21555
- const itemConfig = (_a = injectData === null || injectData === void 0 ? void 0 : injectData.config) !== null && _a !== void 0 ? _a : globalConfig;
21859
+ const itemConfig = (_a = injectData === null || injectData === undefined ? undefined : injectData.config) !== null && _a !== undefined ? _a : globalConfig;
21556
21860
  const spots = response[placementId];
21557
- if (!(spots === null || spots === void 0 ? void 0 : spots.length)) {
21861
+ if (!(spots === null || spots === undefined ? undefined : spots.length)) {
21558
21862
  this.spotManagerService.updateSpotLifecycleState(injectData.placementId, {
21559
21863
  state: {
21560
21864
  error: `No spots found for type "${injectData.spotType}".`,
@@ -21600,12 +21904,12 @@ class BrowserRmnClient {
21600
21904
  isCarouselItem: false,
21601
21905
  },
21602
21906
  });
21603
- const spotData = overrideSpotColors(spot, config === null || config === void 0 ? void 0 : config.colors);
21907
+ const spotData = overrideSpotColors(spot, config === null || config === undefined ? undefined : config.colors);
21604
21908
  const spotElement = this.elementService.createSpotElement({
21605
21909
  spot: spotData,
21606
21910
  config: {
21607
21911
  prefix: '',
21608
- fluid: spot.spot === exports.RMN_SPOT_TYPE.RB_IN_TEXT ? true : ((_a = config === null || config === void 0 ? void 0 : config.fluid) !== null && _a !== void 0 ? _a : false),
21912
+ fluid: spot.spot === exports.RMN_SPOT_TYPE.RB_IN_TEXT ? true : ((_a = config === null || config === undefined ? undefined : config.fluid) !== null && _a !== undefined ? _a : false),
21609
21913
  useShadowDom: true,
21610
21914
  },
21611
21915
  });
@@ -21625,8 +21929,8 @@ class BrowserRmnClient {
21625
21929
  placementId,
21626
21930
  spotElement,
21627
21931
  });
21628
- placement === null || placement === void 0 ? void 0 : placement.replaceChildren(spotElement);
21629
- if (config === null || config === void 0 ? void 0 : config.listenRenderedSpotData) {
21932
+ placement === null || placement === undefined ? undefined : placement.replaceChildren(spotElement);
21933
+ if (config === null || config === undefined ? undefined : config.listenRenderedSpotData) {
21630
21934
  this.spotManagerService.publish(exports.RMN_EVENT.RENDERED_SPOT_DATA, {
21631
21935
  placementId,
21632
21936
  data: [spotData],
@@ -21670,7 +21974,7 @@ class BrowserRmnClient {
21670
21974
  isCarouselItem: true,
21671
21975
  },
21672
21976
  });
21673
- const spot = overrideSpotColors(spotItem, config === null || config === void 0 ? void 0 : config.colors);
21977
+ const spot = overrideSpotColors(spotItem, config === null || config === undefined ? undefined : config.colors);
21674
21978
  const spotElement = this.elementService.createSpotElement({
21675
21979
  spot,
21676
21980
  config: {
@@ -21706,11 +22010,11 @@ class BrowserRmnClient {
21706
22010
  const carouselElement = this.elementService.createCarouselElement({
21707
22011
  slides: carouselSlides,
21708
22012
  config: {
21709
- fluid: config === null || config === void 0 ? void 0 : config.fluid,
22013
+ fluid: config === null || config === undefined ? undefined : config.fluid,
21710
22014
  width: maxWidth,
21711
22015
  height: maxHeight,
21712
- minScale: (_a = config === null || config === void 0 ? void 0 : config.minScale) !== null && _a !== void 0 ? _a : 0.25, // Scale down to 25% of the original size
21713
- ...config === null || config === void 0 ? void 0 : config.carousel,
22016
+ minScale: (_a = config === null || config === undefined ? undefined : config.minScale) !== null && _a !== undefined ? _a : 0.25, // Scale down to 25% of the original size
22017
+ ...config === null || config === undefined ? undefined : config.carousel,
21714
22018
  },
21715
22019
  });
21716
22020
  if (!carouselElement) {
@@ -21724,8 +22028,8 @@ class BrowserRmnClient {
21724
22028
  clearPlacement(placementId);
21725
22029
  return;
21726
22030
  }
21727
- placement === null || placement === void 0 ? void 0 : placement.replaceChildren(carouselElement);
21728
- if (config === null || config === void 0 ? void 0 : config.listenRenderedSpotData) {
22031
+ placement === null || placement === undefined ? undefined : placement.replaceChildren(carouselElement);
22032
+ if (config === null || config === undefined ? undefined : config.listenRenderedSpotData) {
21729
22033
  this.spotManagerService.publish(exports.RMN_EVENT.RENDERED_SPOT_DATA, {
21730
22034
  placementId,
21731
22035
  data: spots,
@@ -21755,11 +22059,11 @@ class BrowserRmnClient {
21755
22059
  const spots = inject.map((item) => ({
21756
22060
  placementId: item.placementId,
21757
22061
  spot: item.spotType,
21758
- count: item === null || item === void 0 ? void 0 : item.count,
21759
- ...item === null || item === void 0 ? void 0 : item.filter,
22062
+ count: item === null || item === undefined ? undefined : item.count,
22063
+ ...item === null || item === undefined ? undefined : item.filter,
21760
22064
  }));
21761
22065
  const request = {
21762
- url: config === null || config === void 0 ? void 0 : config.url,
22066
+ url: config === null || config === undefined ? undefined : config.url,
21763
22067
  filter,
21764
22068
  spots,
21765
22069
  };