@brndts/brndts-ads 1.13.9 → 1.13.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -80138,6 +80138,10 @@ var Interface = /*#__PURE__*/ function(_import_events7_default) {
80138
80138
  this.container = this.context.elements.container;
80139
80139
  }
80140
80140
  var backdrop = new Backdrop(this.context);
80141
+ var existingBackdrop = this.container.querySelector("#".concat(backdrop.view.id));
80142
+ if (existingBackdrop) {
80143
+ this.container.removeChild(existingBackdrop);
80144
+ }
80141
80145
  this.container.firstChild ? this.container.insertBefore(backdrop.view, this.container.firstChild) : this.container.appendChild(backdrop.view);
80142
80146
  this.migrateStyles();
80143
80147
  if (this.media.view) {
@@ -80219,6 +80223,8 @@ var Interface = /*#__PURE__*/ function(_import_events7_default) {
80219
80223
  value: function destroy() {
80220
80224
  var _this_container_parentElement;
80221
80225
  if (!this.context.elements.original) {
80226
+ var _this_context_elements_container;
80227
+ (_this_context_elements_container = this.context.elements.container) === null || _this_context_elements_container === void 0 ? void 0 : _this_context_elements_container.remove();
80222
80228
  return;
80223
80229
  }
80224
80230
  (_this_container_parentElement = this.container.parentElement) === null || _this_container_parentElement === void 0 ? void 0 : _this_container_parentElement.replaceChild(this.context.elements.original, this.container);
@@ -81211,6 +81217,13 @@ var RegionRenderer = /*#__PURE__*/ function() {
81211
81217
  {
81212
81218
  key: "attach",
81213
81219
  value: function attach(container, before) {
81220
+ if (!container) {
81221
+ this.context.logger.error("No container provided for regions");
81222
+ return;
81223
+ }
81224
+ if (container.querySelector("#BRNDTS_ARW")) {
81225
+ container.removeChild(container.querySelector("#BRNDTS_ARW"));
81226
+ }
81214
81227
  if (before) {
81215
81228
  container.insertBefore(this.regionsContainerView.view, before);
81216
81229
  } else {
@@ -82652,9 +82665,10 @@ var VideoAds = /*#__PURE__*/ function() {
82652
82665
  try {
82653
82666
  for(var _iterator = medias[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
82654
82667
  var media = _step.value;
82655
- if (!media || media.closest("#BRNDTS_R") || media.querySelector("#BRNDTS_R")) {
82668
+ if (!media || media.closest("#BRNDTS_R") || media.querySelector("#BRNDTS_R") || media.dataset.b_I !== void 0) {
82656
82669
  continue;
82657
82670
  }
82671
+ media.dataset.b_I = "".concat(this.videoAdElements.length);
82658
82672
  var videoAd = new VideoAd(this.context, media);
82659
82673
  this.videoAdElements.push(videoAd);
82660
82674
  videoAd.start();