@brndts/brndts-ads 1.13.19 → 1.13.21

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
@@ -68636,6 +68636,13 @@ var regions = [
68636
68636
  h: 300,
68637
68637
  name: "Generic - 250x300",
68638
68638
  type: ""
68639
+ },
68640
+ {
68641
+ id: 1003,
68642
+ w: 300,
68643
+ h: 600,
68644
+ name: "Generic - 300x600",
68645
+ type: "large-rectangle"
68639
68646
  }
68640
68647
  ];
68641
68648
  var ContentProvider = /*#__PURE__*/ function() {
@@ -70393,7 +70400,7 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider1) {
70393
70400
  code: "prebid"
70394
70401
  }
70395
70402
  };
70396
- _this.affiliateManifestUrl = "https://brndts-public.s3.eu-west-2.amazonaws.com/affiliates/manifest.json";
70403
+ _this.affiliateManifestUrl = "https://brndts-public.s3.eu-west-2.amazonaws.com/affiliates/general_manifest.json";
70397
70404
  _this.affiliateProvider = new AffiliateProvider({}, {
70398
70405
  manifest: _this.affiliateManifestUrl
70399
70406
  });
@@ -70461,9 +70468,14 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider1) {
70461
70468
  var _this_affiliateProvider;
70462
70469
  var affiliateContent = (_this_affiliateProvider = _this.affiliateProvider) === null || _this_affiliateProvider === void 0 ? void 0 : _this_affiliateProvider.contents();
70463
70470
  if (affiliateContent && affiliateContent.content.length > 0) {
70471
+ var _affiliateContent_extra;
70464
70472
  _this.content = _object_spread_props(_object_spread({}, _this.content), {
70465
70473
  content: affiliateContent.content,
70466
70474
  extra: _object_spread_props(_object_spread({}, _this.content.extra || {}), {
70475
+ sz: ((_affiliateContent_extra = affiliateContent.extra) === null || _affiliateContent_extra === void 0 ? void 0 : _affiliateContent_extra.sz) || {
70476
+ w: 300,
70477
+ h: 250
70478
+ },
70467
70479
  region: regionId,
70468
70480
  fallback: "affiliate"
70469
70481
  })
@@ -70500,11 +70512,10 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider1) {
70500
70512
  key: "request",
70501
70513
  value: function request(params) {
70502
70514
  return _async_to_generator(function() {
70503
- var _this, adType, regionId, regionInfo, regionInfo1;
70515
+ var adType, adName, regionId, regionInfo;
70504
70516
  return _ts_generator(this, function(_state) {
70505
70517
  switch(_state.label){
70506
70518
  case 0:
70507
- _this = this;
70508
70519
  return [
70509
70520
  4,
70510
70521
  this.ready.promise
@@ -70512,17 +70523,23 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider1) {
70512
70523
  case 1:
70513
70524
  _state.sent();
70514
70525
  adType = params.params.adType;
70526
+ adName = params.params.regionName;
70515
70527
  regionId = params.params.regionId;
70516
70528
  if (params.params.useRatio) {
70517
70529
  regionInfo = ContentProvider.approxRegionByRatio(params.size.width, params.size.height);
70518
70530
  if (regionInfo) {
70519
70531
  regionId = "".concat(regionInfo.id);
70520
70532
  }
70533
+ } else if (adType && adName) {
70534
+ regionInfo = ContentProvider.approxRegionByType(adType);
70535
+ regionId = (regionInfo === null || regionInfo === void 0 ? void 0 : regionInfo.id) ? "".concat(regionInfo.id) : regionId;
70521
70536
  } else if (params.params.useSize) {
70522
- regionInfo1 = ContentProvider.approxRegionBySize(params.size.width, params.size.height);
70523
- if (regionInfo1) {
70524
- regionId = "".concat(regionInfo1.id);
70537
+ regionInfo = ContentProvider.approxRegionBySize(params.size.width, params.size.height);
70538
+ if (regionInfo) {
70539
+ regionId = "".concat(regionInfo.id);
70525
70540
  }
70541
+ } else {
70542
+ regionInfo = ContentProvider.approxRegionById(+regionId);
70526
70543
  }
70527
70544
  params.params.refRegionId = regionId;
70528
70545
  this.content = _object_spread_props(_object_spread({}, this.content), {
@@ -70536,10 +70553,7 @@ var PrebidjsProvider = /*#__PURE__*/ function(ContentProvider1) {
70536
70553
  ];
70537
70554
  case 2:
70538
70555
  _state.sent();
70539
- PrebidJS.defineSlot(this.options, regionId, params.params.regionId, adType);
70540
- PrebidJS.request(regionId, params.params.regionId, function(bids) {
70541
- return _this.processBids(params, bids);
70542
- });
70556
+ this.processBids(params, {});
70543
70557
  return [
70544
70558
  2,
70545
70559
  Promise.resolve()
@@ -70938,7 +70952,7 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70938
70952
  PrebidGAMEventsInstance.onSlotRenderEnd(function(event) {
70939
70953
  var slot = event.slot;
70940
70954
  if ("".concat(_this.workingSlotId) === event.slot.getSlotElementId()) {
70941
- var _this_content_extra_sz, _this_content_extra_sz1;
70955
+ var _event_size, _this_content_extra_sz, _event_size1, _this_content_extra_sz1;
70942
70956
  if (!_this.content.extra) {
70943
70957
  _this.content.extra = {};
70944
70958
  }
@@ -70949,8 +70963,8 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70949
70963
  _this.content.extra.bidder = slot.getTargeting("hb_bidder")[0];
70950
70964
  }
70951
70965
  _this.content.extra.sz = {
70952
- w: event.size[0] || ((_this_content_extra_sz = _this.content.extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) || 0,
70953
- h: event.size[1] || ((_this_content_extra_sz1 = _this.content.extra.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) || 0
70966
+ w: ((_event_size = event.size) === null || _event_size === void 0 ? void 0 : _event_size[0]) || ((_this_content_extra_sz = _this.content.extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) || 0,
70967
+ h: ((_event_size1 = event.size) === null || _event_size1 === void 0 ? void 0 : _event_size1[1]) || ((_this_content_extra_sz1 = _this.content.extra.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) || 0
70954
70968
  };
70955
70969
  _this.content.pending = false;
70956
70970
  _this.fullfill();
@@ -71885,6 +71899,7 @@ var Region = /*#__PURE__*/ function() {
71885
71899
  this.container.style.pointerEvents = "none";
71886
71900
  if ((_this_deps_config = this.deps.config) === null || _this_deps_config === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general = _this_deps_config.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_clickability = _this_deps_config_getAdsConfig_general.clickability) === null || _this_deps_config_getAdsConfig_general_clickability === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_clickability.value) {
71887
71901
  this.container.style.pointerEvents = "all";
71902
+ this.container.style.zIndex = "9999";
71888
71903
  }
71889
71904
  if ((_this_deps_config1 = this.deps.config) === null || _this_deps_config1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general1 = _this_deps_config1.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode = _this_deps_config_getAdsConfig_general1.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value) {
71890
71905
  this.container.style.pointerEvents = "none";