@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.esm.js CHANGED
@@ -1949,8 +1949,8 @@ function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
1949
1949
  byteOffset = 0;
1950
1950
  } else if (byteOffset > 0x7fffffff) {
1951
1951
  byteOffset = 0x7fffffff;
1952
- } else if (byteOffset < -0x80000000) {
1953
- byteOffset = -0x80000000;
1952
+ } else if (byteOffset < -2147483648) {
1953
+ byteOffset = -2147483648;
1954
1954
  }
1955
1955
  byteOffset = +byteOffset; // Coerce to Number.
1956
1956
  if (isNaN(byteOffset)) {
@@ -2709,7 +2709,7 @@ Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, no
2709
2709
  Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
2710
2710
  value = +value;
2711
2711
  offset = offset | 0;
2712
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
2712
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128);
2713
2713
  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
2714
2714
  if (value < 0) value = 0xff + value + 1;
2715
2715
  this[offset] = (value & 0xff);
@@ -2719,7 +2719,7 @@ Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
2719
2719
  Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
2720
2720
  value = +value;
2721
2721
  offset = offset | 0;
2722
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
2722
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768);
2723
2723
  if (Buffer.TYPED_ARRAY_SUPPORT) {
2724
2724
  this[offset] = (value & 0xff);
2725
2725
  this[offset + 1] = (value >>> 8);
@@ -2732,7 +2732,7 @@ Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert)
2732
2732
  Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
2733
2733
  value = +value;
2734
2734
  offset = offset | 0;
2735
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
2735
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768);
2736
2736
  if (Buffer.TYPED_ARRAY_SUPPORT) {
2737
2737
  this[offset] = (value >>> 8);
2738
2738
  this[offset + 1] = (value & 0xff);
@@ -2745,7 +2745,7 @@ Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert)
2745
2745
  Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
2746
2746
  value = +value;
2747
2747
  offset = offset | 0;
2748
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
2748
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648);
2749
2749
  if (Buffer.TYPED_ARRAY_SUPPORT) {
2750
2750
  this[offset] = (value & 0xff);
2751
2751
  this[offset + 1] = (value >>> 8);
@@ -2760,7 +2760,7 @@ Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert)
2760
2760
  Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
2761
2761
  value = +value;
2762
2762
  offset = offset | 0;
2763
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
2763
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648);
2764
2764
  if (value < 0) value = 0xffffffff + value + 1;
2765
2765
  if (Buffer.TYPED_ARRAY_SUPPORT) {
2766
2766
  this[offset] = (value >>> 24);
@@ -6090,7 +6090,7 @@ function matchesKeywordPattern(words, required, optional) {
6090
6090
  return false;
6091
6091
  }
6092
6092
  // If no optional keywords are specified, return true
6093
- if (!(optional === null || optional === void 0 ? void 0 : optional.length)) {
6093
+ if (!(optional === null || optional === undefined ? undefined : optional.length)) {
6094
6094
  return true;
6095
6095
  }
6096
6096
  // If optional keywords exist, check if at least one matches as a whole word
@@ -6103,7 +6103,7 @@ function matchesKeywordPattern(words, required, optional) {
6103
6103
  * @returns {RMN_SPOT_EVENT | null} - The corresponding RMN_SPOT_EVENT or null if no match
6104
6104
  */
6105
6105
  function getEventTypeFromRawEvent(event) {
6106
- if (!(event === null || event === void 0 ? void 0 : event.trim())) {
6106
+ if (!(event === null || event === undefined ? undefined : event.trim())) {
6107
6107
  return null;
6108
6108
  }
6109
6109
  const words = normalizeEventName(event);
@@ -7590,7 +7590,7 @@ class ObjectHelper {
7590
7590
  else if (typeof value === 'object') {
7591
7591
  return this.mergeObjectValues(targetValue, value);
7592
7592
  }
7593
- return (_a = value !== null && value !== void 0 ? value : targetValue) !== null && _a !== void 0 ? _a : undefined;
7593
+ return (_a = value !== null && value !== undefined ? value : targetValue) !== null && _a !== undefined ? _a : undefined;
7594
7594
  }
7595
7595
  /**
7596
7596
  * Merges the values of an array or object with a given array of objects and returns the merged result as an object.
@@ -7671,7 +7671,7 @@ function xhrFallbackEventFire(url) {
7671
7671
  }
7672
7672
  function beaconEventFire(url) {
7673
7673
  var _a;
7674
- return (_a = navigator === null || navigator === void 0 ? void 0 : navigator.sendBeacon) === null || _a === void 0 ? void 0 : _a.call(navigator, url);
7674
+ return (_a = navigator === null || navigator === undefined ? undefined : navigator.sendBeacon) === null || _a === undefined ? undefined : _a.call(navigator, url);
7675
7675
  }
7676
7676
  /**
7677
7677
  * Helper function to decode base64 string and parse JSON
@@ -7792,7 +7792,7 @@ function calculateScaleFactor(elementScale) {
7792
7792
  * @returns {string} - The query string.
7793
7793
  */
7794
7794
  function objectToQueryParams(obj) {
7795
- return Object.entries(obj !== null && obj !== void 0 ? obj : {})
7795
+ return Object.entries(obj !== null && obj !== undefined ? obj : {})
7796
7796
  .map(([key, value]) => {
7797
7797
  if (value == null) {
7798
7798
  return '';
@@ -12044,7 +12044,7 @@ function requireCipherCore () {
12044
12044
  C_lib.StreamCipher = Cipher.extend({
12045
12045
  _doFinalize: function () {
12046
12046
  // Process partial blocks
12047
- var finalProcessedBlocks = this._process(!!'flush');
12047
+ var finalProcessedBlocks = this._process(true);
12048
12048
 
12049
12049
  return finalProcessedBlocks;
12050
12050
  },
@@ -12325,10 +12325,10 @@ function requireCipherCore () {
12325
12325
  padding.pad(this._data, this.blockSize);
12326
12326
 
12327
12327
  // Process final blocks
12328
- finalProcessedBlocks = this._process(!!'flush');
12328
+ finalProcessedBlocks = this._process(true);
12329
12329
  } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
12330
12330
  // Process final blocks
12331
- finalProcessedBlocks = this._process(!!'flush');
12331
+ finalProcessedBlocks = this._process(true);
12332
12332
 
12333
12333
  // Unpad data
12334
12334
  padding.unpad(finalProcessedBlocks);
@@ -16686,9 +16686,9 @@ class ApiError {
16686
16686
  constructor(error) {
16687
16687
  var _a, _b, _c, _d, _e, _f, _g;
16688
16688
  const e = error;
16689
- 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;
16689
+ 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;
16690
16690
  this.errorMessage =
16691
- (_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.`;
16691
+ (_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.`;
16692
16692
  }
16693
16693
  }
16694
16694
 
@@ -16803,12 +16803,12 @@ class BaseApi extends BaseApiAbstract {
16803
16803
  this.authInfo = auth;
16804
16804
  this.encryptedApi = EncryptedApi.getInstance(this.authInfo.apiKey);
16805
16805
  this.objectHelper = ObjectHelper.getInstance();
16806
- this.baseUrl = (_a = SDK_CONFIG.url[this.authInfo.env]) !== null && _a !== void 0 ? _a : SDK_CONFIG.url.development;
16806
+ this.baseUrl = (_a = SDK_CONFIG.url[this.authInfo.env]) !== null && _a !== undefined ? _a : SDK_CONFIG.url.development;
16807
16807
  const configHeaders = {
16808
16808
  [SDK_CONFIG.accessHeader]: `Bearer ${this.authInfo.token}`,
16809
16809
  };
16810
16810
  const partnerSite = this.getPartnerSite();
16811
- const isPartnerSiteValid = partnerSite === null || partnerSite === void 0 ? void 0 : partnerSite.startsWith('http');
16811
+ const isPartnerSiteValid = partnerSite === null || partnerSite === undefined ? undefined : partnerSite.startsWith('http');
16812
16812
  if (partnerSite && isPartnerSiteValid) {
16813
16813
  configHeaders[REQUEST_CLOUD_PARTNER_SITE] = partnerSite;
16814
16814
  }
@@ -16864,7 +16864,7 @@ class BaseApi extends BaseApiAbstract {
16864
16864
  configOverrides = {
16865
16865
  ...configOverrides,
16866
16866
  headers: {
16867
- ...configOverrides === null || configOverrides === void 0 ? void 0 : configOverrides.headers,
16867
+ ...configOverrides === null || configOverrides === undefined ? undefined : configOverrides.headers,
16868
16868
  [REQUEST_CLOUD_PROTECTED_KEY]: 'true',
16869
16869
  [REQUEST_CLOUD_PROTECTED_TIMESTAMP]: timestamp,
16870
16870
  [SDK_CONFIG.apiHeader]: this.authInfo.apiKey,
@@ -16901,7 +16901,7 @@ class BaseApi extends BaseApiAbstract {
16901
16901
  * @returns {AxiosRequestConfig} - The merged Axios request configuration.
16902
16902
  */
16903
16903
  createFullConfig(configOverrides) {
16904
- return this.objectHelper.merge(this.getConfig(), configOverrides !== null && configOverrides !== void 0 ? configOverrides : {});
16904
+ return this.objectHelper.merge(this.getConfig(), configOverrides !== null && configOverrides !== undefined ? configOverrides : {});
16905
16905
  }
16906
16906
  /**
16907
16907
  * Sends a request to the specified URL with the given configuration.
@@ -16925,17 +16925,17 @@ class BaseApi extends BaseApiAbstract {
16925
16925
  */
16926
16926
  async getResponse(response) {
16927
16927
  var _a, _b, _c, _d, _e, _f, _g;
16928
- let responseData = (response === null || response === void 0 ? void 0 : response.data) ? response.data : null;
16928
+ let responseData = (response === null || response === undefined ? undefined : response.data) ? response.data : null;
16929
16929
  let isEncrypted = false;
16930
16930
  let timestamp = 0;
16931
- if ((response === null || response === void 0 ? void 0 : response.headers) &&
16932
- ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a.has) &&
16933
- ((_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b.has(REQUEST_CLOUD_PROTECTED_KEY)) &&
16934
- ((_c = response === null || response === void 0 ? void 0 : response.headers) === null || _c === void 0 ? void 0 : _c.has(REQUEST_CLOUD_PROTECTED_TIMESTAMP)) &&
16935
- ((_d = response === null || response === void 0 ? void 0 : response.headers) === null || _d === void 0 ? void 0 : _d.get)) {
16936
- isEncrypted = ((_e = response === null || response === void 0 ? void 0 : response.headers) === null || _e === void 0 ? void 0 : _e.get(REQUEST_CLOUD_PROTECTED_KEY)) === 'true';
16937
- timestamp = ((_f = response === null || response === void 0 ? void 0 : response.headers) === null || _f === void 0 ? void 0 : _f.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
16938
- ? Number((_g = response === null || response === void 0 ? void 0 : response.headers) === null || _g === void 0 ? void 0 : _g.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
16931
+ if ((response === null || response === undefined ? undefined : response.headers) &&
16932
+ ((_a = response === null || response === undefined ? undefined : response.headers) === null || _a === undefined ? undefined : _a.has) &&
16933
+ ((_b = response === null || response === undefined ? undefined : response.headers) === null || _b === undefined ? undefined : _b.has(REQUEST_CLOUD_PROTECTED_KEY)) &&
16934
+ ((_c = response === null || response === undefined ? undefined : response.headers) === null || _c === undefined ? undefined : _c.has(REQUEST_CLOUD_PROTECTED_TIMESTAMP)) &&
16935
+ ((_d = response === null || response === undefined ? undefined : response.headers) === null || _d === undefined ? undefined : _d.get)) {
16936
+ isEncrypted = ((_e = response === null || response === undefined ? undefined : response.headers) === null || _e === undefined ? undefined : _e.get(REQUEST_CLOUD_PROTECTED_KEY)) === 'true';
16937
+ timestamp = ((_f = response === null || response === undefined ? undefined : response.headers) === null || _f === undefined ? undefined : _f.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
16938
+ ? Number((_g = response === null || response === undefined ? undefined : response.headers) === null || _g === undefined ? undefined : _g.get(REQUEST_CLOUD_PROTECTED_TIMESTAMP))
16939
16939
  : 0;
16940
16940
  }
16941
16941
  if (responseData &&
@@ -16944,7 +16944,7 @@ class BaseApi extends BaseApiAbstract {
16944
16944
  timestamp > 0) {
16945
16945
  const { t: encryptedPayload } = responseData;
16946
16946
  const decryptedData = await this.encryptedApi.handleDecryption(encryptedPayload, timestamp);
16947
- if (decryptedData === null || decryptedData === void 0 ? void 0 : decryptedData.payload) {
16947
+ if (decryptedData === null || decryptedData === undefined ? undefined : decryptedData.payload) {
16948
16948
  delete decryptedData.payload.exp;
16949
16949
  delete decryptedData.payload.iat;
16950
16950
  responseData = decryptedData.payload;
@@ -16998,9 +16998,9 @@ class AuthService extends BaseApi {
16998
16998
  },
16999
16999
  });
17000
17000
  if (isErr) {
17001
- throw new Error(`There was an error during authentication: (${isErr === null || isErr === void 0 ? void 0 : isErr.errorMessage})`);
17001
+ throw new Error(`There was an error during authentication: (${isErr === null || isErr === undefined ? undefined : isErr.errorMessage})`);
17002
17002
  }
17003
- if (isOk && (val === null || val === void 0 ? void 0 : val.data.token)) {
17003
+ if (isOk && (val === null || val === undefined ? undefined : val.data.token)) {
17004
17004
  this.authInfo.token = val.data.token;
17005
17005
  this.authInfo.authenticated = true;
17006
17006
  }
@@ -17079,6 +17079,8 @@ class BaseSpotComponent extends BaseElement {
17079
17079
  super();
17080
17080
  this.initialized = false;
17081
17081
  this.dataInitialized = false;
17082
+ this.reRenderOnDeviceChange = false;
17083
+ this._isMobileDevice = true;
17082
17084
  }
17083
17085
  initializeData(data, config) {
17084
17086
  if (this.dataInitialized) {
@@ -17128,6 +17130,27 @@ class BaseSpotComponent extends BaseElement {
17128
17130
  }
17129
17131
  `;
17130
17132
  }
17133
+ setupDeviceDetection() {
17134
+ if (!isBrowser)
17135
+ return;
17136
+ const mediaQuery = '(max-width: 639.98px)';
17137
+ const containerQuery = window.matchMedia(mediaQuery);
17138
+ const updateDeviceState = (e) => {
17139
+ var _a;
17140
+ const isMobileNewValue = e.matches;
17141
+ if (this._isMobileDevice !== isMobileNewValue) {
17142
+ this._isMobileDevice = isMobileNewValue;
17143
+ (_a = this.onDeviceChange) === null || _a === undefined ? undefined : _a.call(this, this._isMobileDevice);
17144
+ if (this.reRenderOnDeviceChange) {
17145
+ this.render();
17146
+ }
17147
+ }
17148
+ };
17149
+ // Setup listener
17150
+ containerQuery.addEventListener('change', updateDeviceState);
17151
+ // Initial check
17152
+ updateDeviceState(containerQuery);
17153
+ }
17131
17154
  // Lifecycle callbacks
17132
17155
  connectedCallback() {
17133
17156
  var _a;
@@ -17136,14 +17159,15 @@ class BaseSpotComponent extends BaseElement {
17136
17159
  this.initialized = true;
17137
17160
  if (this.dataInitialized) {
17138
17161
  this.render();
17162
+ this.setupDeviceDetection();
17139
17163
  }
17140
- (_a = this.connected) === null || _a === void 0 ? void 0 : _a.call(this);
17164
+ (_a = this.connected) === null || _a === undefined ? undefined : _a.call(this);
17141
17165
  }
17142
17166
  disconnectedCallback() {
17143
17167
  var _a;
17144
17168
  if (!isBrowser)
17145
17169
  return;
17146
- (_a = this.disconnected) === null || _a === void 0 ? void 0 : _a.call(this);
17170
+ (_a = this.disconnected) === null || _a === undefined ? undefined : _a.call(this);
17147
17171
  }
17148
17172
  }
17149
17173
 
@@ -17186,11 +17210,11 @@ class LocalStorageService {
17186
17210
  setSpot(spotId, data) {
17187
17211
  var _a, _b, _c, _d, _e;
17188
17212
  data.createdAt = Date.now();
17189
- const isExistentSpot = (_a = this.spots) === null || _a === void 0 ? void 0 : _a.has(spotId);
17213
+ const isExistentSpot = (_a = this.spots) === null || _a === undefined ? undefined : _a.has(spotId);
17190
17214
  if (isExistentSpot) {
17191
- 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 : [];
17215
+ data.firedEvents = (_d = (_c = (_b = this.spots) === null || _b === undefined ? undefined : _b.get(spotId)) === null || _c === undefined ? undefined : _c.firedEvents) !== null && _d !== undefined ? _d : [];
17192
17216
  }
17193
- (_e = this.spots) === null || _e === void 0 ? void 0 : _e.set(spotId, data);
17217
+ (_e = this.spots) === null || _e === undefined ? undefined : _e.set(spotId, data);
17194
17218
  this.updateLocalStorage();
17195
17219
  }
17196
17220
  // public removeSpot(spotId: string): void {
@@ -17235,12 +17259,12 @@ class LocalStorageService {
17235
17259
  setUserId() {
17236
17260
  var _a;
17237
17261
  const prefix = LocalStorageService.localStorageKeyPrefix;
17238
- const existingKeys = Object.keys((_a = window.localStorage) !== null && _a !== void 0 ? _a : {}).filter((key) => key.startsWith(prefix));
17262
+ const existingKeys = Object.keys((_a = window.localStorage) !== null && _a !== undefined ? _a : {}).filter((key) => key.startsWith(prefix));
17239
17263
  const setNewKey = () => {
17240
17264
  var _a;
17241
17265
  const uniqueId = UniqueIdGenerator.generate();
17242
17266
  const newLocalStorageKey = `${prefix}_${uniqueId}`;
17243
- (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem(newLocalStorageKey, '');
17267
+ (_a = window.localStorage) === null || _a === undefined ? undefined : _a.setItem(newLocalStorageKey, '');
17244
17268
  LocalStorageService.localStorageKey = newLocalStorageKey;
17245
17269
  };
17246
17270
  if (existingKeys.length === 0) {
@@ -17252,7 +17276,7 @@ class LocalStorageService {
17252
17276
  existingKeys.forEach((key) => {
17253
17277
  var _a;
17254
17278
  if (key !== validKey) {
17255
- (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.removeItem(key);
17279
+ (_a = window.localStorage) === null || _a === undefined ? undefined : _a.removeItem(key);
17256
17280
  }
17257
17281
  });
17258
17282
  if (validKey) {
@@ -17268,7 +17292,7 @@ class LocalStorageService {
17268
17292
  // ======================== Utility functions ======================== //
17269
17293
  syncLocalStorage() {
17270
17294
  var _a;
17271
- const localStorageData = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.getItem(LocalStorageService.localStorageKey);
17295
+ const localStorageData = (_a = window.localStorage) === null || _a === undefined ? undefined : _a.getItem(LocalStorageService.localStorageKey);
17272
17296
  if (localStorageData) {
17273
17297
  try {
17274
17298
  const decryptedData = this.decryptData(localStorageData);
@@ -17307,15 +17331,15 @@ class LocalStorageService {
17307
17331
  }
17308
17332
  clearLocalStorage() {
17309
17333
  var _a;
17310
- (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.removeItem(LocalStorageService.localStorageKey);
17334
+ (_a = window.localStorage) === null || _a === undefined ? undefined : _a.removeItem(LocalStorageService.localStorageKey);
17311
17335
  }
17312
17336
  removeExpiredSpots() {
17313
17337
  var _a;
17314
17338
  const currentTime = Date.now();
17315
- (_a = this.spots) === null || _a === void 0 ? void 0 : _a.forEach((spot, spotId) => {
17339
+ (_a = this.spots) === null || _a === undefined ? undefined : _a.forEach((spot, spotId) => {
17316
17340
  var _a, _b;
17317
- if (currentTime - ((_a = spot.createdAt) !== null && _a !== void 0 ? _a : 0) > LocalStorageService.spotExpirationTime) {
17318
- (_b = this.spots) === null || _b === void 0 ? void 0 : _b.delete(spotId);
17341
+ if (currentTime - ((_a = spot.createdAt) !== null && _a !== undefined ? _a : 0) > LocalStorageService.spotExpirationTime) {
17342
+ (_b = this.spots) === null || _b === undefined ? undefined : _b.delete(spotId);
17319
17343
  }
17320
17344
  });
17321
17345
  this.updateLocalStorage();
@@ -17351,9 +17375,9 @@ class LocalStorageService {
17351
17375
  obj.spotId,
17352
17376
  obj.spotType,
17353
17377
  this.spotEventObjectToArray(obj.events),
17354
- (_b = (_a = obj.firedEvents) === null || _a === void 0 ? void 0 : _a.map((event) => [event.productId, event.event])) !== null && _b !== void 0 ? _b : [],
17378
+ (_b = (_a = obj.firedEvents) === null || _a === undefined ? undefined : _a.map((event) => [event.productId, event.event])) !== null && _b !== undefined ? _b : [],
17355
17379
  obj.productIds,
17356
- (_c = obj.createdAt) !== null && _c !== void 0 ? _c : 0,
17380
+ (_c = obj.createdAt) !== null && _c !== undefined ? _c : 0,
17357
17381
  ];
17358
17382
  }
17359
17383
  /**
@@ -17423,8 +17447,8 @@ class ProximityObserver {
17423
17447
  this.targetIds = new Set(elementIds);
17424
17448
  this.processedIds = new Set();
17425
17449
  this.callback = callback;
17426
- this.proximityThreshold = (_a = options.proximityThreshold) !== null && _a !== void 0 ? _a : 500;
17427
- this.intersectionMargin = (_b = options.intersectionMargin) !== null && _b !== void 0 ? _b : '2000px';
17450
+ this.proximityThreshold = (_a = options.proximityThreshold) !== null && _a !== undefined ? _a : 500;
17451
+ this.intersectionMargin = (_b = options.intersectionMargin) !== null && _b !== undefined ? _b : '2000px';
17428
17452
  this.initializeObservers();
17429
17453
  this.observeExistingElements();
17430
17454
  }
@@ -17465,7 +17489,7 @@ class ProximityObserver {
17465
17489
  });
17466
17490
  // Start observing DOM changes
17467
17491
  if (document.body) {
17468
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(document.body, {
17492
+ (_a = this.mutationObserver) === null || _a === undefined ? undefined : _a.observe(document.body, {
17469
17493
  childList: true,
17470
17494
  subtree: true,
17471
17495
  });
@@ -17475,13 +17499,13 @@ class ProximityObserver {
17475
17499
  var _a;
17476
17500
  if (element.id && this.processedIds.has(element.id)) {
17477
17501
  this.processedIds.delete(element.id);
17478
- (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.unobserve(element);
17502
+ (_a = this.intersectionObserver) === null || _a === undefined ? undefined : _a.unobserve(element);
17479
17503
  }
17480
17504
  }
17481
17505
  checkElement(element) {
17482
17506
  var _a;
17483
17507
  if (element.id && this.targetIds.has(element.id) && !this.processedIds.has(element.id)) {
17484
- (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.observe(element);
17508
+ (_a = this.intersectionObserver) === null || _a === undefined ? undefined : _a.observe(element);
17485
17509
  }
17486
17510
  }
17487
17511
  findNearbyTargetIds(element) {
@@ -17528,7 +17552,7 @@ class ProximityObserver {
17528
17552
  this.processedIds.add(id);
17529
17553
  const el = document.getElementById(id);
17530
17554
  if (el)
17531
- (_a = this.intersectionObserver) === null || _a === void 0 ? void 0 : _a.unobserve(el);
17555
+ (_a = this.intersectionObserver) === null || _a === undefined ? undefined : _a.unobserve(el);
17532
17556
  });
17533
17557
  // Trigger callback with the group
17534
17558
  this.callback(groupIdsToProcess);
@@ -17651,7 +17675,7 @@ class ResizeObserverService {
17651
17675
  this.container = element.parentElement;
17652
17676
  this.setDimensions(maxSize, minScale);
17653
17677
  this.resizeObserver = new ResizeObserver(() => this.updateElementSize());
17654
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(this.container);
17678
+ (_a = this.resizeObserver) === null || _a === undefined ? undefined : _a.observe(this.container);
17655
17679
  // Initial size update
17656
17680
  this.updateElementSize();
17657
17681
  }
@@ -17707,7 +17731,7 @@ class ResizeObserverService {
17707
17731
  }
17708
17732
  disconnect() {
17709
17733
  var _a;
17710
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
17734
+ (_a = this.resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
17711
17735
  }
17712
17736
  }
17713
17737
 
@@ -17721,6 +17745,11 @@ const GFONT_SOURCE_SANS_3 = `
17721
17745
  const GFONT_CORMORANT = `
17722
17746
  <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">
17723
17747
  `;
17748
+ const FONTS = {
17749
+ preconnect: GFONT_PRECONNECT,
17750
+ sourceSans: GFONT_SOURCE_SANS_3,
17751
+ cormorant: GFONT_CORMORANT,
17752
+ };
17724
17753
 
17725
17754
  function convertHexToRgba(hex, opacity = 1) {
17726
17755
  // Remove # if present
@@ -17754,6 +17783,16 @@ function generateGradientColor(overlay, fallback = '') {
17754
17783
  const gradientColor = convertHexToRgba(color, overlayOpacity);
17755
17784
  return `${fullColor} 0%, ${gradientColor} ${goTo}%, ${transparentColor} 100%`;
17756
17785
  }
17786
+ function importFonts(...fonts) {
17787
+ const fontsToImport = fonts.length === 0 ? ['sourceSans', 'cormorant'] : fonts;
17788
+ return [
17789
+ FONTS.preconnect,
17790
+ ...fontsToImport.map((font) => FONTS[font]),
17791
+ ].join('');
17792
+ }
17793
+ function renderElement(tag, className, content) {
17794
+ return (content === null || content === undefined ? undefined : content.trim()) ? `<${tag} class="${className}">${content}</${tag}>` : '';
17795
+ }
17757
17796
 
17758
17797
  class BillboardV1SE extends BaseSpotComponent {
17759
17798
  constructor() {
@@ -17766,7 +17805,7 @@ class BillboardV1SE extends BaseSpotComponent {
17766
17805
  disconnected() {
17767
17806
  var _a;
17768
17807
  this.removeEventListener('spotSizeChanged', this.handleSpotSizeChanged);
17769
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
17808
+ (_a = this.resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
17770
17809
  }
17771
17810
  setupResizeObserver() {
17772
17811
  if (!this._config.fluid) {
@@ -17789,7 +17828,7 @@ class BillboardV1SE extends BaseSpotComponent {
17789
17828
  var _a;
17790
17829
  // Find all text elements within the shadow root
17791
17830
  const selectors = ['h2', 'p', 'span'].join(', ');
17792
- const elements = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selectors);
17831
+ const elements = (_a = this.shadowRoot) === null || _a === undefined ? undefined : _a.querySelectorAll(selectors);
17793
17832
  if (!elements)
17794
17833
  return;
17795
17834
  const scaleFactor = calculateScaleFactor(elementScale);
@@ -18003,6 +18042,7 @@ class RbCollectionBannerWithoutTextBlockSE extends BaseSpotComponent {
18003
18042
  class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18004
18043
  constructor() {
18005
18044
  super();
18045
+ this.reRenderOnDeviceChange = true;
18006
18046
  }
18007
18047
  getGradientDirection(position) {
18008
18048
  switch (position) {
@@ -18022,17 +18062,34 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18022
18062
  }
18023
18063
  template() {
18024
18064
  const prefix = this._config.prefix;
18025
- const { preHeader, header, description, ctaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.BOTTOM_LEFT, mobileTextBlockPosition = textBlockPosition, } = this._data;
18065
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.BOTTOM_LEFT, mobileTextBlockPosition = textBlockPosition,
18066
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18067
+ enableMobileTexts = false, } = this._data;
18068
+ const content = this._isMobileDevice && enableMobileTexts
18069
+ ? {
18070
+ preHeader: mobilePreHeader,
18071
+ header: mobileHeader,
18072
+ description: mobileDescription,
18073
+ ctaText: mobileCtaText,
18074
+ }
18075
+ : { preHeader, header, description, ctaText };
18076
+ if (!this.hasContent) {
18077
+ return `
18078
+ ${importFonts()}
18079
+ <div class="${prefix}"></div>
18080
+ `;
18081
+ }
18082
+ const elements = [
18083
+ renderElement('h2', `${prefix}__pre-header`, content.preHeader),
18084
+ renderElement('h2', `${prefix}__header`, content.header),
18085
+ renderElement('p', `${prefix}__description`, content.description),
18086
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
18087
+ ];
18026
18088
  return `
18027
- ${GFONT_PRECONNECT}
18028
- ${GFONT_SOURCE_SANS_3}
18029
- ${GFONT_CORMORANT}
18089
+ ${importFonts()}
18030
18090
  <div class="${prefix}">
18031
18091
  <div class="${prefix}__text ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
18032
- ${preHeader ? `<h2 class="${prefix}__pre-header">${preHeader}</h2>` : ''}
18033
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18034
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18035
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
18092
+ ${elements.join('')}
18036
18093
  </div>
18037
18094
  </div>
18038
18095
  `;
@@ -18049,7 +18106,9 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18049
18106
  display: flex;
18050
18107
  width: 100%;
18051
18108
  height: 100%;
18052
- background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");
18109
+ ${this.hasContent
18110
+ ? `background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");`
18111
+ : `background-image: url("${mobilePrimaryImage}");`}
18053
18112
  background-size: cover;
18054
18113
  background-repeat: no-repeat;
18055
18114
  background-position: center;
@@ -18164,7 +18223,9 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18164
18223
 
18165
18224
  @container (min-width: 640px) {
18166
18225
  .${prefix} {
18167
- background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");
18226
+ ${this.hasContent
18227
+ ? `background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");`
18228
+ : `background-image: url("${primaryImage}");`}
18168
18229
  }
18169
18230
 
18170
18231
  .${prefix}__text {
@@ -18255,27 +18316,54 @@ class RbHomepageHeroFullImageSE extends BaseSpotComponent {
18255
18316
  }
18256
18317
  `;
18257
18318
  }
18319
+ get hasContent() {
18320
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
18321
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18322
+ enableMobileTexts = false, } = this._data;
18323
+ const content = this._isMobileDevice && enableMobileTexts
18324
+ ? {
18325
+ preHeader: mobilePreHeader,
18326
+ header: mobileHeader,
18327
+ description: mobileDescription,
18328
+ ctaText: mobileCtaText,
18329
+ }
18330
+ : { preHeader, header, description, ctaText };
18331
+ return Object.values(content).some(Boolean);
18332
+ }
18258
18333
  }
18259
18334
 
18260
18335
  class RbHomepageHeroThreeTileSE extends BaseSpotComponent {
18261
18336
  constructor() {
18262
18337
  super();
18338
+ this.reRenderOnDeviceChange = true;
18263
18339
  }
18264
18340
  template() {
18265
18341
  const prefix = this._config.prefix;
18266
- const { header, description, ctaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.LEFT, mobileTextBlockPosition = textBlockPosition, } = this._data;
18342
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.LEFT, mobileTextBlockPosition = textBlockPosition,
18343
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18344
+ enableMobileTexts = false, } = this._data;
18345
+ const content = this._isMobileDevice && enableMobileTexts
18346
+ ? {
18347
+ header: mobileHeader,
18348
+ description: mobileDescription,
18349
+ ctaText: mobileCtaText,
18350
+ }
18351
+ : { header, description, ctaText };
18352
+ const elements = this.hasContent
18353
+ ? [
18354
+ renderElement('h2', `${prefix}__header`, content.header),
18355
+ renderElement('p', `${prefix}__description`, content.description),
18356
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
18357
+ ]
18358
+ : [];
18267
18359
  return `
18268
- ${GFONT_PRECONNECT}
18269
- ${GFONT_SOURCE_SANS_3}
18270
- ${GFONT_CORMORANT}
18360
+ ${importFonts()}
18271
18361
  <div class="${prefix}">
18272
18362
  <div class="${prefix}__content ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
18273
18363
  <div class="${prefix}__main">
18274
18364
  <div class="${prefix}__secondary-image"></div>
18275
18365
  <div class="${prefix}__text">
18276
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18277
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18278
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
18366
+ ${elements.join('')}
18279
18367
  </div>
18280
18368
  </div>
18281
18369
  <div class="${prefix}__primary-image"></div>
@@ -18477,25 +18565,51 @@ class RbHomepageHeroThreeTileSE extends BaseSpotComponent {
18477
18565
  }
18478
18566
  `;
18479
18567
  }
18568
+ get hasContent() {
18569
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
18570
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18571
+ enableMobileTexts = false, } = this._data;
18572
+ const content = this._isMobileDevice && enableMobileTexts
18573
+ ? {
18574
+ header: mobileHeader,
18575
+ description: mobileDescription,
18576
+ ctaText: mobileCtaText,
18577
+ }
18578
+ : { header, description, ctaText };
18579
+ return Object.values(content).some(Boolean);
18580
+ }
18480
18581
  }
18481
18582
 
18482
18583
  class RbHomepageHeroTwoTileSE extends BaseSpotComponent {
18483
18584
  constructor() {
18484
18585
  super();
18586
+ this.reRenderOnDeviceChange = true;
18485
18587
  }
18486
18588
  template() {
18487
18589
  const prefix = this._config.prefix;
18488
- const { header, description, ctaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.LEFT, mobileTextBlockPosition = ENUM_TEXT_BLOCK_POSITION.TOP, } = this._data;
18590
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.LEFT, mobileTextBlockPosition = ENUM_TEXT_BLOCK_POSITION.TOP,
18591
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18592
+ enableMobileTexts = false, } = this._data;
18593
+ const content = this._isMobileDevice && enableMobileTexts
18594
+ ? {
18595
+ header: mobileHeader,
18596
+ description: mobileDescription,
18597
+ ctaText: mobileCtaText,
18598
+ }
18599
+ : { header, description, ctaText };
18600
+ const elements = this.hasContent
18601
+ ? [
18602
+ renderElement('h2', `${prefix}__header`, content.header),
18603
+ renderElement('p', `${prefix}__description`, content.description),
18604
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
18605
+ ]
18606
+ : [];
18489
18607
  return `
18490
- ${GFONT_PRECONNECT}
18491
- ${GFONT_SOURCE_SANS_3}
18492
- ${GFONT_CORMORANT}
18608
+ ${importFonts()}
18493
18609
  <div class="${prefix}">
18494
18610
  <div class="${prefix}__content ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
18495
18611
  <div class="${prefix}__text">
18496
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18497
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18498
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
18612
+ ${elements.join('')}
18499
18613
  </div>
18500
18614
  <div class="${prefix}__image"></div>
18501
18615
  </div>
@@ -18663,6 +18777,19 @@ class RbHomepageHeroTwoTileSE extends BaseSpotComponent {
18663
18777
  }
18664
18778
  `;
18665
18779
  }
18780
+ get hasContent() {
18781
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
18782
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18783
+ enableMobileTexts = false, } = this._data;
18784
+ const content = this._isMobileDevice && enableMobileTexts
18785
+ ? {
18786
+ header: mobileHeader,
18787
+ description: mobileDescription,
18788
+ ctaText: mobileCtaText,
18789
+ }
18790
+ : { header, description, ctaText };
18791
+ return Object.values(content).some(Boolean);
18792
+ }
18666
18793
  }
18667
18794
 
18668
18795
  class RbInTextSE extends BaseSpotComponent {
@@ -18707,22 +18834,39 @@ class RbInTextSE extends BaseSpotComponent {
18707
18834
  class RbLargeCategoryImageToutSE extends BaseSpotComponent {
18708
18835
  constructor() {
18709
18836
  super();
18837
+ this.reRenderOnDeviceChange = true;
18710
18838
  }
18711
18839
  template() {
18712
18840
  const prefix = this._config.prefix;
18713
- const { header, description, ctaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.LEFT, } = this._data;
18841
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.LEFT,
18842
+ // eslint-disable-next-line @typescript-eslint/naming-convention
18843
+ enableMobileTexts = false, } = this._data;
18844
+ const content = this._isMobileDevice && enableMobileTexts
18845
+ ? {
18846
+ header: mobileHeader,
18847
+ description: mobileDescription,
18848
+ ctaText: mobileCtaText,
18849
+ }
18850
+ : { header, description, ctaText };
18851
+ if (!this.hasContent) {
18852
+ return `
18853
+ ${importFonts()}
18854
+ <div class="${prefix}"></div>
18855
+ `;
18856
+ }
18857
+ const elements = [
18858
+ renderElement('h2', `${prefix}__header`, content.header),
18859
+ renderElement('p', `${prefix}__description`, content.description),
18860
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
18861
+ ];
18714
18862
  return `
18715
- ${GFONT_PRECONNECT}
18716
- ${GFONT_SOURCE_SANS_3}
18717
- ${GFONT_CORMORANT}
18718
- <div class="${prefix}">
18719
- <div class="${prefix}__text ${prefix}__text-block--${textBlockPosition}">
18720
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18721
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18722
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
18863
+ ${importFonts()}
18864
+ <div class="${prefix}">
18865
+ <div class="${prefix}__text ${prefix}__text-block--${textBlockPosition}">
18866
+ ${elements.join('')}
18867
+ </div>
18723
18868
  </div>
18724
- </div>
18725
- `;
18869
+ `;
18726
18870
  }
18727
18871
  styles() {
18728
18872
  const { textColor = '#ffffff', ctaTextColor = textColor, ctaBorderColor = ctaTextColor, primaryImage, mobilePrimaryImage = primaryImage, } = this._data;
@@ -18735,7 +18879,9 @@ class RbLargeCategoryImageToutSE extends BaseSpotComponent {
18735
18879
  display: flex;
18736
18880
  flex-direction: column;
18737
18881
  justify-content: flex-end;
18738
- background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");
18882
+ ${this.hasContent
18883
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");`
18884
+ : `background-image: url("${mobilePrimaryImage}");`}
18739
18885
  background-size: cover;
18740
18886
  background-repeat: no-repeat;
18741
18887
  background-position: center;
@@ -18811,7 +18957,9 @@ class RbLargeCategoryImageToutSE extends BaseSpotComponent {
18811
18957
 
18812
18958
  @container (min-width: 640px) {
18813
18959
  .${prefix} {
18814
- background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
18960
+ ${this.hasContent
18961
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");`
18962
+ : `background-image: url("${primaryImage}");`}
18815
18963
  }
18816
18964
  }
18817
18965
 
@@ -18859,25 +19007,56 @@ class RbLargeCategoryImageToutSE extends BaseSpotComponent {
18859
19007
  }
18860
19008
  `;
18861
19009
  }
19010
+ get hasContent() {
19011
+ const { header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
19012
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19013
+ enableMobileTexts = false, } = this._data;
19014
+ const content = this._isMobileDevice && enableMobileTexts
19015
+ ? {
19016
+ header: mobileHeader,
19017
+ description: mobileDescription,
19018
+ ctaText: mobileCtaText,
19019
+ }
19020
+ : { header, description, ctaText };
19021
+ return Object.values(content).some(Boolean);
19022
+ }
18862
19023
  }
18863
19024
 
18864
19025
  class RbLongToutShortSE extends BaseSpotComponent {
18865
19026
  constructor() {
18866
19027
  super();
19028
+ this.reRenderOnDeviceChange = true;
18867
19029
  }
18868
19030
  template() {
18869
19031
  const prefix = this._config.prefix;
18870
- const { preHeader, header, description, ctaText } = this._data;
19032
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
19033
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19034
+ enableMobileTexts = false, } = this._data;
19035
+ const content = this._isMobileDevice && enableMobileTexts
19036
+ ? {
19037
+ preHeader: mobilePreHeader,
19038
+ header: mobileHeader,
19039
+ description: mobileDescription,
19040
+ ctaText: mobileCtaText,
19041
+ }
19042
+ : { preHeader, header, description, ctaText };
19043
+ if (!this.hasContent) {
19044
+ return `
19045
+ ${importFonts()}
19046
+ <div class="${prefix}"></div>
19047
+ `;
19048
+ }
19049
+ const elements = [
19050
+ renderElement('h2', `${prefix}__pre-header`, content.preHeader),
19051
+ renderElement('h2', `${prefix}__header`, content.header),
19052
+ renderElement('p', `${prefix}__description`, content.description),
19053
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
19054
+ ];
18871
19055
  return `
18872
- ${GFONT_PRECONNECT}
18873
- ${GFONT_SOURCE_SANS_3}
18874
- ${GFONT_CORMORANT}
19056
+ ${importFonts()}
18875
19057
  <div class="${prefix}">
18876
19058
  <div class="${prefix}__text">
18877
- ${preHeader ? `<h2 class="${prefix}__pre-header">${preHeader}</h2>` : ''}
18878
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
18879
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
18880
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
19059
+ ${elements.join('')}
18881
19060
  </div>
18882
19061
  </div>
18883
19062
  `;
@@ -19023,11 +19202,26 @@ class RbLongToutShortSE extends BaseSpotComponent {
19023
19202
  }
19024
19203
  `;
19025
19204
  }
19205
+ get hasContent() {
19206
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
19207
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19208
+ enableMobileTexts = false, } = this._data;
19209
+ const content = this._isMobileDevice && enableMobileTexts
19210
+ ? {
19211
+ preHeader: mobilePreHeader,
19212
+ header: mobileHeader,
19213
+ description: mobileDescription,
19214
+ ctaText: mobileCtaText,
19215
+ }
19216
+ : { preHeader, header, description, ctaText };
19217
+ return Object.values(content).some(Boolean);
19218
+ }
19026
19219
  }
19027
19220
 
19028
19221
  class RbLongToutTallSE extends BaseSpotComponent {
19029
19222
  constructor() {
19030
19223
  super();
19224
+ this.reRenderOnDeviceChange = true;
19031
19225
  }
19032
19226
  getGradientDirection(position) {
19033
19227
  switch (position) {
@@ -19047,17 +19241,36 @@ class RbLongToutTallSE extends BaseSpotComponent {
19047
19241
  }
19048
19242
  template() {
19049
19243
  const prefix = this._config.prefix;
19050
- const { preHeader, header, description, ctaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.MIDDLE_LEFT, mobileTextBlockPosition = textBlockPosition, } = this._data;
19244
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText, textBlockPosition = ENUM_TEXT_BLOCK_POSITION.MIDDLE_LEFT, mobileTextBlockPosition = textBlockPosition,
19245
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19246
+ enableMobileTexts = false, } = this._data;
19247
+ const content = this._isMobileDevice && enableMobileTexts
19248
+ ? {
19249
+ preHeader: mobilePreHeader,
19250
+ header: mobileHeader,
19251
+ description: mobileDescription,
19252
+ ctaText: mobileCtaText,
19253
+ }
19254
+ : { preHeader, header, description, ctaText };
19255
+ if (!this.hasContent) {
19256
+ return `
19257
+ ${importFonts()}
19258
+ <div class="${prefix}"></div>
19259
+ `;
19260
+ }
19261
+ const elements = [
19262
+ renderElement('h2', `${prefix}__pre-header`, content.preHeader),
19263
+ renderElement('h2', `${prefix}__header`, content.header),
19264
+ renderElement('p', `${prefix}__description`, content.description),
19265
+ renderElement('span', `${prefix}__cta-button`, content.ctaText),
19266
+ ];
19051
19267
  return `
19052
19268
  ${GFONT_PRECONNECT}
19053
19269
  ${GFONT_SOURCE_SANS_3}
19054
19270
  ${GFONT_CORMORANT}
19055
19271
  <div class="${prefix}">
19056
19272
  <div class="${prefix}__text ${prefix}__text-block--${textBlockPosition} ${prefix}__text-block-mobile--${mobileTextBlockPosition}">
19057
- ${preHeader ? `<h2 class="${prefix}__pre-header">${preHeader}</h2>` : ''}
19058
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
19059
- ${description ? `<p class="${prefix}__description">${description}</p>` : ''}
19060
- ${ctaText ? `<span class="${prefix}__cta-button">${ctaText}</span>` : ''}
19273
+ ${elements.join('')}
19061
19274
  </div>
19062
19275
  </div>
19063
19276
  `;
@@ -19074,7 +19287,9 @@ class RbLongToutTallSE extends BaseSpotComponent {
19074
19287
  display: flex;
19075
19288
  width: 100%;
19076
19289
  height: 100%;
19077
- background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");
19290
+ ${this.hasContent
19291
+ ? `background-image: linear-gradient(${mobileGradientDirection}, ${linearGradient}), url("${mobilePrimaryImage}");`
19292
+ : `background-image: url("${mobilePrimaryImage}");`}
19078
19293
  background-size: cover;
19079
19294
  background-repeat: no-repeat;
19080
19295
  background-position: center;
@@ -19144,7 +19359,9 @@ class RbLongToutTallSE extends BaseSpotComponent {
19144
19359
 
19145
19360
  @container (min-width: 640px) {
19146
19361
  .${prefix} {
19147
- background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");
19362
+ ${this.hasContent
19363
+ ? `background-image: linear-gradient(${desktopGradientDirection}, ${linearGradient}), url("${primaryImage}");`
19364
+ : `background-image: url("${primaryImage}");`}
19148
19365
  }
19149
19366
 
19150
19367
  .${prefix}__text {
@@ -19280,22 +19497,50 @@ class RbLongToutTallSE extends BaseSpotComponent {
19280
19497
  }
19281
19498
  `;
19282
19499
  }
19500
+ get hasContent() {
19501
+ const { preHeader, mobilePreHeader, header, mobileHeader, description, mobileDescription, ctaText, mobileCtaText,
19502
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19503
+ enableMobileTexts = false, } = this._data;
19504
+ const content = this._isMobileDevice && enableMobileTexts
19505
+ ? {
19506
+ preHeader: mobilePreHeader,
19507
+ header: mobileHeader,
19508
+ description: mobileDescription,
19509
+ ctaText: mobileCtaText,
19510
+ }
19511
+ : { preHeader, header, description, ctaText };
19512
+ return Object.values(content).some(Boolean);
19513
+ }
19283
19514
  }
19284
19515
 
19285
19516
  class RbNavigationBannerSE extends BaseSpotComponent {
19286
19517
  constructor() {
19287
19518
  super();
19519
+ this.reRenderOnDeviceChange = true;
19288
19520
  }
19289
19521
  template() {
19290
19522
  const prefix = this._config.prefix;
19291
- const { header } = this._data;
19523
+ const { header, mobileHeader,
19524
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19525
+ enableMobileTexts = false, } = this._data;
19526
+ const content = this._isMobileDevice && enableMobileTexts
19527
+ ? {
19528
+ header: mobileHeader,
19529
+ }
19530
+ : { header };
19531
+ if (!this.hasContent) {
19532
+ return `
19533
+ ${importFonts('sourceSans')}
19534
+ <div class="${prefix}"></div>
19535
+ `;
19536
+ }
19537
+ const elements = [renderElement('h2', `${prefix}__header`, content.header)];
19292
19538
  return `
19293
- ${GFONT_PRECONNECT}
19294
- ${GFONT_SOURCE_SANS_3}
19295
- <div class="${prefix}">
19296
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
19297
- </div>
19298
- `;
19539
+ ${importFonts('sourceSans')}
19540
+ <div class="${prefix}">
19541
+ ${elements.join('')}
19542
+ </div>
19543
+ `;
19299
19544
  }
19300
19545
  styles() {
19301
19546
  const { textColor = '#ffffff', primaryImage, mobilePrimaryImage = primaryImage } = this._data;
@@ -19311,7 +19556,9 @@ class RbNavigationBannerSE extends BaseSpotComponent {
19311
19556
  border-radius: 5px;
19312
19557
  overflow: hidden;
19313
19558
  cursor: pointer;
19314
- background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");
19559
+ ${this.hasContent
19560
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");`
19561
+ : `background-image: url("${mobilePrimaryImage}");`}
19315
19562
  background-size: cover;
19316
19563
  background-position: center;
19317
19564
  background-repeat: no-repeat;
@@ -19331,7 +19578,9 @@ class RbNavigationBannerSE extends BaseSpotComponent {
19331
19578
 
19332
19579
  @container (min-width: 640px) {
19333
19580
  .${prefix} {
19334
- background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
19581
+ ${this.hasContent
19582
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");`
19583
+ : `background-image: url("${primaryImage}");`}
19335
19584
  }
19336
19585
  }
19337
19586
 
@@ -19354,22 +19603,47 @@ class RbNavigationBannerSE extends BaseSpotComponent {
19354
19603
  }
19355
19604
  `;
19356
19605
  }
19606
+ get hasContent() {
19607
+ const { header, mobileHeader,
19608
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19609
+ enableMobileTexts = false, } = this._data;
19610
+ const content = this._isMobileDevice && enableMobileTexts
19611
+ ? {
19612
+ header: mobileHeader,
19613
+ }
19614
+ : { header };
19615
+ return Object.values(content).some(Boolean);
19616
+ }
19357
19617
  }
19358
19618
 
19359
19619
  class RbSmallCategoryImageToutSE extends BaseSpotComponent {
19360
19620
  constructor() {
19361
19621
  super();
19622
+ this.reRenderOnDeviceChange = true;
19362
19623
  }
19363
19624
  template() {
19364
19625
  const prefix = this._config.prefix;
19365
- const { header } = this._data;
19626
+ const { header, mobileHeader,
19627
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19628
+ enableMobileTexts = false, } = this._data;
19629
+ const content = this._isMobileDevice && enableMobileTexts
19630
+ ? {
19631
+ header: mobileHeader,
19632
+ }
19633
+ : { header };
19634
+ if (!this.hasContent) {
19635
+ return `
19636
+ ${importFonts('cormorant')}
19637
+ <div class="${prefix}"></div>
19638
+ `;
19639
+ }
19640
+ const elements = [renderElement('h2', `${prefix}__header`, content.header)];
19366
19641
  return `
19367
- ${GFONT_PRECONNECT}
19368
- ${GFONT_CORMORANT}
19369
- <div class="${prefix}">
19370
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
19371
- </div>
19372
- `;
19642
+ ${importFonts('cormorant')}
19643
+ <div class="${prefix}">
19644
+ ${elements.join('')}
19645
+ </div>
19646
+ `;
19373
19647
  }
19374
19648
  styles() {
19375
19649
  const { textColor = '#ffffff', primaryImage, mobilePrimaryImage = primaryImage } = this._data;
@@ -19382,7 +19656,9 @@ class RbSmallCategoryImageToutSE extends BaseSpotComponent {
19382
19656
  display: flex;
19383
19657
  flex-direction: column;
19384
19658
  justify-content: flex-end;
19385
- background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");
19659
+ ${this.hasContent
19660
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${mobilePrimaryImage}");`
19661
+ : `background-image: url("${mobilePrimaryImage}");`}
19386
19662
  background-size: cover;
19387
19663
  background-repeat: no-repeat;
19388
19664
  background-position: center;
@@ -19405,30 +19681,51 @@ class RbSmallCategoryImageToutSE extends BaseSpotComponent {
19405
19681
 
19406
19682
  @container (min-width: 640px) {
19407
19683
  .${prefix} {
19408
- background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
19684
+ ${this.hasContent
19685
+ ? `background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");`
19686
+ : `background-image: url("${primaryImage}");`}
19409
19687
  }
19410
19688
  }
19411
19689
  `;
19412
19690
  }
19691
+ get hasContent() {
19692
+ const { header, mobileHeader,
19693
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19694
+ enableMobileTexts = false, } = this._data;
19695
+ const content = this._isMobileDevice && enableMobileTexts
19696
+ ? {
19697
+ header: mobileHeader,
19698
+ }
19699
+ : { header };
19700
+ return Object.values(content).some(Boolean);
19701
+ }
19413
19702
  }
19414
19703
 
19415
19704
  class RbSmallDiscoverToutSE extends BaseSpotComponent {
19416
19705
  constructor() {
19417
19706
  super();
19707
+ this.reRenderOnDeviceChange = true;
19418
19708
  }
19419
19709
  template() {
19420
19710
  const prefix = this._config.prefix;
19421
- const { header } = this._data;
19711
+ const { header, mobileHeader,
19712
+ // eslint-disable-next-line @typescript-eslint/naming-convention
19713
+ enableMobileTexts = false, } = this._data;
19714
+ const content = this._isMobileDevice && enableMobileTexts
19715
+ ? {
19716
+ header: mobileHeader,
19717
+ }
19718
+ : { header };
19719
+ const elements = [renderElement('h2', `${prefix}__header`, content.header)];
19422
19720
  return `
19423
- ${GFONT_PRECONNECT}
19424
- ${GFONT_CORMORANT}
19425
- <div class="${prefix}">
19426
- <div class="${prefix}__image"></div>
19427
- <div class="${prefix}__text">
19428
- ${header ? `<h2 class="${prefix}__header">${header}</h2>` : ''}
19721
+ ${importFonts('sourceSans')}
19722
+ <div class="${prefix}">
19723
+ <div class="${prefix}__image"></div>
19724
+ <div class="${prefix}__text">
19725
+ ${elements.join('')}
19726
+ </div>
19429
19727
  </div>
19430
- </div>
19431
- `;
19728
+ `;
19432
19729
  }
19433
19730
  styles() {
19434
19731
  const { textColor = '#000000', backgroundColor = 'transparent', primaryImage, mobilePrimaryImage = primaryImage, } = this._data;
@@ -19545,13 +19842,13 @@ class RbVideoPlayerSE extends BaseSpotComponent {
19545
19842
  if (!this.video)
19546
19843
  return;
19547
19844
  const muteButton = this._container.querySelector(this.muteButtonSelector());
19548
- muteButton === null || muteButton === void 0 ? void 0 : muteButton.addEventListener('click', this.handleMuteToggle);
19845
+ muteButton === null || muteButton === undefined ? undefined : muteButton.addEventListener('click', this.handleMuteToggle);
19549
19846
  }
19550
19847
  removeEventListeners() {
19551
19848
  if (!this.video)
19552
19849
  return;
19553
19850
  const muteButton = this._container.querySelector(this.muteButtonSelector());
19554
- muteButton === null || muteButton === void 0 ? void 0 : muteButton.removeEventListener('click', this.handleMuteToggle);
19851
+ muteButton === null || muteButton === undefined ? undefined : muteButton.removeEventListener('click', this.handleMuteToggle);
19555
19852
  }
19556
19853
  template() {
19557
19854
  const prefix = this._config.prefix;
@@ -19730,7 +20027,7 @@ class SpotTemplateService {
19730
20027
  const variantClasses = this.isRbSpot(spotType) ? this.rbTemplates : this.iabTemplates;
19731
20028
  if (!variantClasses)
19732
20029
  return null;
19733
- const spotClass = ((_a = variantClasses[spotType]) === null || _a === void 0 ? void 0 : _a[spotVariant]) || null;
20030
+ const spotClass = ((_a = variantClasses[spotType]) === null || _a === undefined ? undefined : _a[spotVariant]) || null;
19734
20031
  if (!spotClass)
19735
20032
  return null;
19736
20033
  return spotClass;
@@ -20064,7 +20361,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
20064
20361
  disconnectedCallback() {
20065
20362
  var _a;
20066
20363
  this.cleanupEventListeners();
20067
- (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
20364
+ (_a = this.resizeObserver) === null || _a === undefined ? undefined : _a.disconnect();
20068
20365
  }
20069
20366
  setupResizeObserver() {
20070
20367
  if (this.data && !this.data.fluid) {
@@ -20085,14 +20382,14 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
20085
20382
  */
20086
20383
  initializeState() {
20087
20384
  var _a, _b, _c, _d, _e, _f, _g, _h;
20088
- this.state.useDots = Boolean((_a = this.data) === null || _a === void 0 ? void 0 : _a.useDots);
20089
- this.state.useButtons = Boolean((_b = this.data) === null || _b === void 0 ? void 0 : _b.useButtons);
20090
- this.state.autoplay = (_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c.autoplay) !== null && _d !== void 0 ? _d : true;
20091
- this.state.interval = (_f = (_e = this.data) === null || _e === void 0 ? void 0 : _e.interval) !== null && _f !== void 0 ? _f : CustomCarouselElement.defaultConfigs.interval;
20092
- if (typeof ((_g = this.data) === null || _g === void 0 ? void 0 : _g.useDots) === 'object') {
20385
+ this.state.useDots = Boolean((_a = this.data) === null || _a === undefined ? undefined : _a.useDots);
20386
+ this.state.useButtons = Boolean((_b = this.data) === null || _b === undefined ? undefined : _b.useButtons);
20387
+ this.state.autoplay = (_d = (_c = this.data) === null || _c === undefined ? undefined : _c.autoplay) !== null && _d !== undefined ? _d : true;
20388
+ this.state.interval = (_f = (_e = this.data) === null || _e === undefined ? undefined : _e.interval) !== null && _f !== undefined ? _f : CustomCarouselElement.defaultConfigs.interval;
20389
+ if (typeof ((_g = this.data) === null || _g === undefined ? undefined : _g.useDots) === 'object') {
20093
20390
  this.state.dots = { ...this.state.dots, ...this.data.useDots };
20094
20391
  }
20095
- if (typeof ((_h = this.data) === null || _h === void 0 ? void 0 : _h.useButtons) === 'object') {
20392
+ if (typeof ((_h = this.data) === null || _h === undefined ? undefined : _h.useButtons) === 'object') {
20096
20393
  this.state.buttons = { ...this.state.buttons, ...this.data.useButtons };
20097
20394
  }
20098
20395
  this.validateConfiguration();
@@ -20556,7 +20853,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
20556
20853
  }
20557
20854
  this.state.isVirtualizing = false;
20558
20855
  // Force reflow to ensure the style change takes effect immediately
20559
- void ((_a = this.elements.slidesContainer) === null || _a === void 0 ? void 0 : _a.offsetHeight);
20856
+ void ((_a = this.elements.slidesContainer) === null || _a === undefined ? undefined : _a.offsetHeight);
20560
20857
  }
20561
20858
  /**
20562
20859
  * Updates dot active states
@@ -20665,8 +20962,8 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
20665
20962
  });
20666
20963
  }
20667
20964
  if (this.state.useButtons) {
20668
- (_a = this.elements.prevButton) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => this.handleNavigation('prev'));
20669
- (_b = this.elements.nextButton) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => this.handleNavigation('next'));
20965
+ (_a = this.elements.prevButton) === null || _a === undefined ? undefined : _a.addEventListener('click', () => this.handleNavigation('prev'));
20966
+ (_b = this.elements.nextButton) === null || _b === undefined ? undefined : _b.addEventListener('click', () => this.handleNavigation('next'));
20670
20967
  }
20671
20968
  }
20672
20969
  /**
@@ -20853,7 +21150,7 @@ class ElementService {
20853
21150
  const dimensions = SPOT_DIMENSIONS[params.spotType];
20854
21151
  skeleton.data = {
20855
21152
  spotType: params.spotType,
20856
- fluid: (params === null || params === void 0 ? void 0 : params.fluid) === undefined ? false : params.fluid,
21153
+ fluid: (params === null || params === undefined ? undefined : params.fluid) === undefined ? false : params.fluid,
20857
21154
  ...dimensions,
20858
21155
  };
20859
21156
  return skeleton;
@@ -20943,16 +21240,16 @@ class DataLayerMonitor {
20943
21240
  }
20944
21241
  extractProductData(event) {
20945
21242
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
20946
- const items = ((_a = event === null || event === void 0 ? void 0 : event.value) === null || _a === void 0 ? void 0 : _a.items) ||
20947
- ((_b = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _b === void 0 ? void 0 : _b.items) ||
20948
- ((_c = event === null || event === void 0 ? void 0 : event.ecommerce) === null || _c === void 0 ? void 0 : _c.products) ||
20949
- ((_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) ||
20950
- ((_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) ||
20951
- ((_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) ||
20952
- ((_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) ||
20953
- ((_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) ||
20954
- ((_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) ||
20955
- (event === null || event === void 0 ? void 0 : event.products) ||
21243
+ const items = ((_a = event === null || event === undefined ? undefined : event.value) === null || _a === undefined ? undefined : _a.items) ||
21244
+ ((_b = event === null || event === undefined ? undefined : event.ecommerce) === null || _b === undefined ? undefined : _b.items) ||
21245
+ ((_c = event === null || event === undefined ? undefined : event.ecommerce) === null || _c === undefined ? undefined : _c.products) ||
21246
+ ((_e = (_d = event === null || event === undefined ? undefined : event.ecommerce) === null || _d === undefined ? undefined : _d.detail) === null || _e === undefined ? undefined : _e.products) ||
21247
+ ((_g = (_f = event === null || event === undefined ? undefined : event.ecommerce) === null || _f === undefined ? undefined : _f.checkout) === null || _g === undefined ? undefined : _g.products) ||
21248
+ ((_j = (_h = event === null || event === undefined ? undefined : event.ecommerce) === null || _h === undefined ? undefined : _h.purchase) === null || _j === undefined ? undefined : _j.products) ||
21249
+ ((_l = (_k = event === null || event === undefined ? undefined : event.ecommerce) === null || _k === undefined ? undefined : _k.add) === null || _l === undefined ? undefined : _l.products) ||
21250
+ ((_o = (_m = event === null || event === undefined ? undefined : event.ecommerce) === null || _m === undefined ? undefined : _m.remove) === null || _o === undefined ? undefined : _o.products) ||
21251
+ ((_q = (_p = event === null || event === undefined ? undefined : event.ecommerce) === null || _p === undefined ? undefined : _p.click) === null || _q === undefined ? undefined : _q.products) ||
21252
+ (event === null || event === undefined ? undefined : event.products) ||
20956
21253
  [];
20957
21254
  return items.map((item) => {
20958
21255
  const data = {
@@ -21008,7 +21305,7 @@ class MonitorService {
21008
21305
  return;
21009
21306
  this.implementedMonitor.setListener(async (eventData) => {
21010
21307
  var _a;
21011
- await this.matchAndFireEvent(eventData, (_a = this.localStorageService) === null || _a === void 0 ? void 0 : _a.getSpots());
21308
+ await this.matchAndFireEvent(eventData, (_a = this.localStorageService) === null || _a === undefined ? undefined : _a.getSpots());
21012
21309
  });
21013
21310
  this.implementedMonitor.start();
21014
21311
  }
@@ -21024,14 +21321,14 @@ class MonitorService {
21024
21321
  continue;
21025
21322
  }
21026
21323
  const firedEvents = spot.firedEvents || [];
21027
- const eventProductId = (_a = this.normalizeStringHelper) === null || _a === void 0 ? void 0 : _a.normalize(String(data.id));
21324
+ const eventProductId = (_a = this.normalizeStringHelper) === null || _a === undefined ? undefined : _a.normalize(String(data.id));
21028
21325
  const isEventAlreadyFired = firedEvents.some((event) => event.productId === eventProductId && event.event === eventData.event);
21029
21326
  if (isEventAlreadyFired) {
21030
21327
  continue;
21031
21328
  }
21032
- const spotRelatedProductIdsSet = new Set(spot.productIds.map((id) => { var _a; return (_a = this.normalizeStringHelper) === null || _a === void 0 ? void 0 : _a.normalize(String(id)); }));
21033
- const eventProductBrand = (_b = this.normalizeStringHelper) === null || _b === void 0 ? void 0 : _b.normalize(String(data.brand));
21034
- const eventVariantBrand = (_c = this.normalizeStringHelper) === null || _c === void 0 ? void 0 : _c.normalize(String(data.variant));
21329
+ const spotRelatedProductIdsSet = new Set(spot.productIds.map((id) => { var _a; return (_a = this.normalizeStringHelper) === null || _a === undefined ? undefined : _a.normalize(String(id)); }));
21330
+ const eventProductBrand = (_b = this.normalizeStringHelper) === null || _b === undefined ? undefined : _b.normalize(String(data.brand));
21331
+ const eventVariantBrand = (_c = this.normalizeStringHelper) === null || _c === undefined ? undefined : _c.normalize(String(data.variant));
21035
21332
  const isProductMatch = [eventProductId, eventProductBrand, eventVariantBrand].some((id) => spotRelatedProductIdsSet.has(id));
21036
21333
  if (!isProductMatch) {
21037
21334
  continue;
@@ -21062,7 +21359,7 @@ class MonitorService {
21062
21359
  event: eventData.event,
21063
21360
  });
21064
21361
  // Update the spots in the local storage
21065
- (_d = this.localStorageService) === null || _d === void 0 ? void 0 : _d.setSpot(spot.spotId, {
21362
+ (_d = this.localStorageService) === null || _d === undefined ? undefined : _d.setSpot(spot.spotId, {
21066
21363
  placementId: spot.placementId,
21067
21364
  spotId: spot.spotId,
21068
21365
  spotType: spot.spotType,
@@ -21126,9 +21423,9 @@ class SelectionService extends BaseApi {
21126
21423
  }
21127
21424
  const { isOk, val, isErr } = await this.post(SELECTION_API_PATH, data, {});
21128
21425
  if (isErr) {
21129
- return { error: `There was an error during spot selection: (${isErr === null || isErr === void 0 ? void 0 : isErr.errorMessage})` };
21426
+ return { error: `There was an error during spot selection: (${isErr === null || isErr === undefined ? undefined : isErr.errorMessage})` };
21130
21427
  }
21131
- if (isOk && val && val.data && (val === null || val === void 0 ? void 0 : val.refresh.token)) {
21428
+ if (isOk && val && val.data && (val === null || val === undefined ? undefined : val.refresh.token)) {
21132
21429
  this.authInfo.authenticated = true;
21133
21430
  this.authInfo.token = val.refresh.token;
21134
21431
  return val.data.spots;
@@ -21243,7 +21540,7 @@ class SpotManagerService {
21243
21540
  spotId: spot.id,
21244
21541
  spotType: spot.spot,
21245
21542
  events: spot.events,
21246
- productIds: (_a = spot.productIds) !== null && _a !== void 0 ? _a : [],
21543
+ productIds: (_a = spot.productIds) !== null && _a !== undefined ? _a : [],
21247
21544
  });
21248
21545
  }
21249
21546
  async handleClickEvent({ placementId, spot }) {
@@ -21256,7 +21553,7 @@ class SpotManagerService {
21256
21553
  await fireEvent({
21257
21554
  spotType: spot.spot,
21258
21555
  event: RMN_SPOT_EVENT.CLICK,
21259
- eventUrl: (_b = (_a = spot.events.find((event) => event.event === RMN_SPOT_EVENT.CLICK)) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : '',
21556
+ eventUrl: (_b = (_a = spot.events.find((event) => event.event === RMN_SPOT_EVENT.CLICK)) === null || _a === undefined ? undefined : _a.url) !== null && _b !== undefined ? _b : '',
21260
21557
  });
21261
21558
  }
21262
21559
  handleImpressionEvent(placementId, spot) {
@@ -21270,7 +21567,7 @@ class SpotManagerService {
21270
21567
  await fireEvent({
21271
21568
  spotType: spot.spot,
21272
21569
  event: RMN_SPOT_EVENT.IMPRESSION,
21273
- eventUrl: (_b = (_a = spot.events.find((event) => event.event === RMN_SPOT_EVENT.IMPRESSION)) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : '',
21570
+ eventUrl: (_b = (_a = spot.events.find((event) => event.event === RMN_SPOT_EVENT.IMPRESSION)) === null || _a === undefined ? undefined : _a.url) !== null && _b !== undefined ? _b : '',
21274
21571
  });
21275
21572
  })();
21276
21573
  }
@@ -21345,7 +21642,7 @@ function validateInjectData(inject) {
21345
21642
  */
21346
21643
  function clearPlacement(placementId) {
21347
21644
  var _a;
21348
- (_a = document.getElementById(placementId)) === null || _a === void 0 ? void 0 : _a.replaceChildren();
21645
+ (_a = document.getElementById(placementId)) === null || _a === undefined ? undefined : _a.replaceChildren();
21349
21646
  }
21350
21647
  /**
21351
21648
  * Prepares the spot placement for rendering by taking care of its styling.
@@ -21379,10 +21676,10 @@ function overrideSpotColors(spot, colors) {
21379
21676
  const { textColor, backgroundColor, ctaTextColor, ctaBorderColor } = colors;
21380
21677
  return {
21381
21678
  ...spot,
21382
- textColor: textColor !== null && textColor !== void 0 ? textColor : spot.textColor,
21383
- backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : spot.backgroundColor,
21384
- ctaTextColor: ctaTextColor !== null && ctaTextColor !== void 0 ? ctaTextColor : spot.ctaTextColor,
21385
- ctaBorderColor: ctaBorderColor !== null && ctaBorderColor !== void 0 ? ctaBorderColor : spot.ctaBorderColor,
21679
+ textColor: textColor !== null && textColor !== undefined ? textColor : spot.textColor,
21680
+ backgroundColor: backgroundColor !== null && backgroundColor !== undefined ? backgroundColor : spot.backgroundColor,
21681
+ ctaTextColor: ctaTextColor !== null && ctaTextColor !== undefined ? ctaTextColor : spot.ctaTextColor,
21682
+ ctaBorderColor: ctaBorderColor !== null && ctaBorderColor !== undefined ? ctaBorderColor : spot.ctaBorderColor,
21386
21683
  };
21387
21684
  }
21388
21685
  // Sets the id for the user who is browsing the website
@@ -21502,7 +21799,7 @@ class BrowserRmnClient {
21502
21799
  }, false);
21503
21800
  prepareSpotPlacement(placement);
21504
21801
  const skeletonElement = this.elementService.createSkeletonElement({
21505
- 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,
21802
+ 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,
21506
21803
  spotType: injectData.spotType,
21507
21804
  });
21508
21805
  if (!skeletonElement) {
@@ -21514,7 +21811,7 @@ class BrowserRmnClient {
21514
21811
  });
21515
21812
  }
21516
21813
  if (skeletonElement) {
21517
- placement === null || placement === void 0 ? void 0 : placement.replaceChildren(skeletonElement);
21814
+ placement === null || placement === undefined ? undefined : placement.replaceChildren(skeletonElement);
21518
21815
  }
21519
21816
  validPlacements.set(placementId, placement);
21520
21817
  this.spotManagerService.updateSpotLifecycleState(injectData.placementId, {
@@ -21529,11 +21826,18 @@ class BrowserRmnClient {
21529
21826
  const validInjectPlacements = Array.from(validPlacements.keys())
21530
21827
  .map((id) => injectMap.get(id))
21531
21828
  .filter(Boolean);
21532
- // Make the spot selection request
21533
- const response = await this.injectSpotSelectionRequest({
21534
- ...params,
21535
- inject: validInjectPlacements,
21536
- });
21829
+ let response;
21830
+ // Use custom spots if provided
21831
+ if (params.customSpots) {
21832
+ response = params.customSpots;
21833
+ }
21834
+ else {
21835
+ // Make the spot selection request
21836
+ response = await this.injectSpotSelectionRequest({
21837
+ ...params,
21838
+ inject: validInjectPlacements,
21839
+ });
21840
+ }
21537
21841
  // Handle request error state
21538
21842
  if (typeof response === 'object' && 'error' in response) {
21539
21843
  this.spotManagerService.updateSpotLifecycleState('all', {
@@ -21550,9 +21854,9 @@ class BrowserRmnClient {
21550
21854
  validPlacements.forEach((placement, placementId) => {
21551
21855
  var _a;
21552
21856
  const injectData = injectMap.get(placementId);
21553
- const itemConfig = (_a = injectData === null || injectData === void 0 ? void 0 : injectData.config) !== null && _a !== void 0 ? _a : globalConfig;
21857
+ const itemConfig = (_a = injectData === null || injectData === undefined ? undefined : injectData.config) !== null && _a !== undefined ? _a : globalConfig;
21554
21858
  const spots = response[placementId];
21555
- if (!(spots === null || spots === void 0 ? void 0 : spots.length)) {
21859
+ if (!(spots === null || spots === undefined ? undefined : spots.length)) {
21556
21860
  this.spotManagerService.updateSpotLifecycleState(injectData.placementId, {
21557
21861
  state: {
21558
21862
  error: `No spots found for type "${injectData.spotType}".`,
@@ -21598,12 +21902,12 @@ class BrowserRmnClient {
21598
21902
  isCarouselItem: false,
21599
21903
  },
21600
21904
  });
21601
- const spotData = overrideSpotColors(spot, config === null || config === void 0 ? void 0 : config.colors);
21905
+ const spotData = overrideSpotColors(spot, config === null || config === undefined ? undefined : config.colors);
21602
21906
  const spotElement = this.elementService.createSpotElement({
21603
21907
  spot: spotData,
21604
21908
  config: {
21605
21909
  prefix: '',
21606
- fluid: spot.spot === RMN_SPOT_TYPE.RB_IN_TEXT ? true : ((_a = config === null || config === void 0 ? void 0 : config.fluid) !== null && _a !== void 0 ? _a : false),
21910
+ fluid: spot.spot === RMN_SPOT_TYPE.RB_IN_TEXT ? true : ((_a = config === null || config === undefined ? undefined : config.fluid) !== null && _a !== undefined ? _a : false),
21607
21911
  useShadowDom: true,
21608
21912
  },
21609
21913
  });
@@ -21623,8 +21927,8 @@ class BrowserRmnClient {
21623
21927
  placementId,
21624
21928
  spotElement,
21625
21929
  });
21626
- placement === null || placement === void 0 ? void 0 : placement.replaceChildren(spotElement);
21627
- if (config === null || config === void 0 ? void 0 : config.listenRenderedSpotData) {
21930
+ placement === null || placement === undefined ? undefined : placement.replaceChildren(spotElement);
21931
+ if (config === null || config === undefined ? undefined : config.listenRenderedSpotData) {
21628
21932
  this.spotManagerService.publish(RMN_EVENT.RENDERED_SPOT_DATA, {
21629
21933
  placementId,
21630
21934
  data: [spotData],
@@ -21668,7 +21972,7 @@ class BrowserRmnClient {
21668
21972
  isCarouselItem: true,
21669
21973
  },
21670
21974
  });
21671
- const spot = overrideSpotColors(spotItem, config === null || config === void 0 ? void 0 : config.colors);
21975
+ const spot = overrideSpotColors(spotItem, config === null || config === undefined ? undefined : config.colors);
21672
21976
  const spotElement = this.elementService.createSpotElement({
21673
21977
  spot,
21674
21978
  config: {
@@ -21704,11 +22008,11 @@ class BrowserRmnClient {
21704
22008
  const carouselElement = this.elementService.createCarouselElement({
21705
22009
  slides: carouselSlides,
21706
22010
  config: {
21707
- fluid: config === null || config === void 0 ? void 0 : config.fluid,
22011
+ fluid: config === null || config === undefined ? undefined : config.fluid,
21708
22012
  width: maxWidth,
21709
22013
  height: maxHeight,
21710
- 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
21711
- ...config === null || config === void 0 ? void 0 : config.carousel,
22014
+ minScale: (_a = config === null || config === undefined ? undefined : config.minScale) !== null && _a !== undefined ? _a : 0.25, // Scale down to 25% of the original size
22015
+ ...config === null || config === undefined ? undefined : config.carousel,
21712
22016
  },
21713
22017
  });
21714
22018
  if (!carouselElement) {
@@ -21722,8 +22026,8 @@ class BrowserRmnClient {
21722
22026
  clearPlacement(placementId);
21723
22027
  return;
21724
22028
  }
21725
- placement === null || placement === void 0 ? void 0 : placement.replaceChildren(carouselElement);
21726
- if (config === null || config === void 0 ? void 0 : config.listenRenderedSpotData) {
22029
+ placement === null || placement === undefined ? undefined : placement.replaceChildren(carouselElement);
22030
+ if (config === null || config === undefined ? undefined : config.listenRenderedSpotData) {
21727
22031
  this.spotManagerService.publish(RMN_EVENT.RENDERED_SPOT_DATA, {
21728
22032
  placementId,
21729
22033
  data: spots,
@@ -21753,11 +22057,11 @@ class BrowserRmnClient {
21753
22057
  const spots = inject.map((item) => ({
21754
22058
  placementId: item.placementId,
21755
22059
  spot: item.spotType,
21756
- count: item === null || item === void 0 ? void 0 : item.count,
21757
- ...item === null || item === void 0 ? void 0 : item.filter,
22060
+ count: item === null || item === undefined ? undefined : item.count,
22061
+ ...item === null || item === undefined ? undefined : item.filter,
21758
22062
  }));
21759
22063
  const request = {
21760
- url: config === null || config === void 0 ? void 0 : config.url,
22064
+ url: config === null || config === undefined ? undefined : config.url,
21761
22065
  filter,
21762
22066
  spots,
21763
22067
  };