@brndts/brndts-ads 1.14.16 → 1.14.17

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
@@ -72458,9 +72458,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
72458
72458
  brndts_zid: unitDefinition.zoneId
72459
72459
  };
72460
72460
  }
72461
- GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), [
72462
- sizes[0] || []
72463
- ], "".concat(containerId), targeting);
72461
+ GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId), targeting);
72464
72462
  if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
72465
72463
  return "".concat(containerId) === "".concat(defUnit.code);
72466
72464
  }))) {
@@ -72516,7 +72514,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
72516
72514
  var container = document.createElement("div");
72517
72515
  container.id = containerId;
72518
72516
  var script = document.createElement("script");
72519
- script.innerHTML = '\n window.googletag.cmd.push(function() {\n googletag.pubads().refresh(googletag.pubads().getSlots().filter(slot => slot.getSlotElementId() === "'.concat(containerId, '"), { changeCorrelator: true });\n });');
72517
+ script.innerHTML = '\n window.googletag.cmd.push(function() {\n googletag.pubads().refresh(googletag.pubads().getSlots().filter(slot => slot.getSlotElementId() === "'.concat(containerId, '"), { changeCorrelator: false });\n });');
72520
72518
  container.appendChild(script);
72521
72519
  callback(container);
72522
72520
  });
@@ -78929,6 +78927,7 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
78929
78927
  "use strict";
78930
78928
  function BasicPresentationMode(context) {
78931
78929
  _class_call_check(this, BasicPresentationMode);
78930
+ this.presenting = false;
78932
78931
  this.updatedContainerSize = functions_default.debounce(this.updatedContainerSize.bind(this), 100);
78933
78932
  this.context = context;
78934
78933
  this.mediaElementSizeController = new MediaElementSizeController(context);
@@ -78982,9 +78981,11 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
78982
78981
  x: 0,
78983
78982
  y: 10
78984
78983
  });
78984
+ this.presenting = true;
78985
78985
  return {};
78986
78986
  } else {
78987
78987
  var _this_context_interface_backdrop1, _this_context_interface1;
78988
+ this.presenting = false;
78988
78989
  (_this_context_interface1 = this.context.interface) === null || _this_context_interface1 === void 0 ? void 0 : (_this_context_interface_backdrop1 = _this_context_interface1.backdrop) === null || _this_context_interface_backdrop1 === void 0 ? void 0 : _this_context_interface_backdrop1.hide();
78989
78990
  }
78990
78991
  return;
@@ -79001,6 +79002,7 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
79001
79002
  value: function cooldown() {
79002
79003
  var _this = this;
79003
79004
  var _this_regionsRenderer;
79005
+ this.presenting = false;
79004
79006
  (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
79005
79007
  this.packer.reset();
79006
79008
  requestAnimationFrame(function() {
@@ -79032,6 +79034,20 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
79032
79034
  {
79033
79035
  key: "updateSize",
79034
79036
  value: function updateSize() {
79037
+ if (this.context.media) {
79038
+ var _this_context_interface;
79039
+ var adjustedSize;
79040
+ if (this.presenting) {
79041
+ adjustedSize = adjustSizeWithAspectRatio(this.context.media.viewWidth, this.context.media.viewHeight, this.context.media.aspectRatio);
79042
+ } else {
79043
+ var _this_context_elements_container, _this_context_elements_container1;
79044
+ adjustedSize = {
79045
+ width: ((_this_context_elements_container = this.context.elements.container) === null || _this_context_elements_container === void 0 ? void 0 : _this_context_elements_container.getBoundingClientRect().width) || 0,
79046
+ height: ((_this_context_elements_container1 = this.context.elements.container) === null || _this_context_elements_container1 === void 0 ? void 0 : _this_context_elements_container1.getBoundingClientRect().height) || 0
79047
+ };
79048
+ }
79049
+ (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : _this_context_interface.updateSize(adjustedSize.width, adjustedSize.height, this.context.media.aspectRatio);
79050
+ }
79035
79051
  return void 0;
79036
79052
  }
79037
79053
  },
@@ -79059,11 +79075,13 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
79059
79075
  this.packer.repack();
79060
79076
  if (this.packer.packed.length > 0) {
79061
79077
  var _this_context_interface_backdrop, _this_context_interface, _this_regionsRenderer1, _this_regionsRenderer2;
79078
+ this.presenting = true;
79062
79079
  (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : (_this_context_interface_backdrop = _this_context_interface.backdrop) === null || _this_context_interface_backdrop === void 0 ? void 0 : _this_context_interface_backdrop.show();
79063
79080
  (_this_regionsRenderer1 = this.regionsRenderer) === null || _this_regionsRenderer1 === void 0 ? void 0 : _this_regionsRenderer1.addAreas(this.packer.areas);
79064
79081
  (_this_regionsRenderer2 = this.regionsRenderer) === null || _this_regionsRenderer2 === void 0 ? void 0 : _this_regionsRenderer2.render(this.packer.packed);
79065
79082
  } else {
79066
79083
  var _this_regionsRenderer3, _this_mediaElementSizeController5, _this_context_interface_backdrop1, _this_context_interface1;
79084
+ this.presenting = false;
79067
79085
  (_this_regionsRenderer3 = this.regionsRenderer) === null || _this_regionsRenderer3 === void 0 ? void 0 : _this_regionsRenderer3.clear();
79068
79086
  (_this_mediaElementSizeController5 = this.mediaElementSizeController) === null || _this_mediaElementSizeController5 === void 0 ? void 0 : _this_mediaElementSizeController5.restore();
79069
79087
  (_this_context_interface1 = this.context.interface) === null || _this_context_interface1 === void 0 ? void 0 : (_this_context_interface_backdrop1 = _this_context_interface1.backdrop) === null || _this_context_interface_backdrop1 === void 0 ? void 0 : _this_context_interface_backdrop1.hide();
@@ -84780,22 +84798,6 @@ var Interface = /*#__PURE__*/ function(_import_events9_default) {
84780
84798
  return Interface;
84781
84799
  }(import_events9.default);
84782
84800
  // src/Ads/VideoAds/VideoAd.ts
84783
- function adjustSizeWithAspectRatio2(maxWidth, maxHeight, aspectRatio) {
84784
- var width = maxWidth;
84785
- var height = maxHeight;
84786
- if (aspectRatio > 0) {
84787
- width = Math.min(maxWidth, maxHeight * aspectRatio);
84788
- height = width / aspectRatio;
84789
- if (height > maxHeight) {
84790
- height = maxHeight;
84791
- width = height * aspectRatio;
84792
- }
84793
- }
84794
- return {
84795
- width: width,
84796
- height: height
84797
- };
84798
- }
84799
84801
  var PresentationManager = /*#__PURE__*/ function() {
84800
84802
  "use strict";
84801
84803
  function PresentationManager(context) {
@@ -84950,11 +84952,6 @@ var PresentationManager = /*#__PURE__*/ function() {
84950
84952
  this.modes.forEach(function(mode) {
84951
84953
  mode.updateSize();
84952
84954
  });
84953
- if (this.context.media) {
84954
- var _this_context_interface;
84955
- var adjustedSize = adjustSizeWithAspectRatio2(this.context.media.viewWidth, this.context.media.viewHeight, this.context.media.aspectRatio);
84956
- (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : _this_context_interface.updateSize(adjustedSize.width, adjustedSize.height, this.context.media.aspectRatio);
84957
- }
84958
84955
  }
84959
84956
  },
84960
84957
  {