@brndts/brndts-ads 1.12.0 → 1.13.1

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.js CHANGED
@@ -67659,6 +67659,16 @@ var BRNDTSConfig = /*#__PURE__*/ function() {
67659
67659
  }).apply(this, arguments);
67660
67660
  }
67661
67661
  },
67662
+ {
67663
+ key: "refresh",
67664
+ value: function refresh(provided, refetch) {
67665
+ this.provided = provided || this.provided;
67666
+ if ((refetch === null || refetch === void 0 ? void 0 : refetch.host) && (refetch === null || refetch === void 0 ? void 0 : refetch.key)) {
67667
+ this.fetch(refetch);
67668
+ }
67669
+ this.merge();
67670
+ }
67671
+ },
67662
67672
  {
67663
67673
  key: "get",
67664
67674
  value: function get(key) {
@@ -67749,7 +67759,38 @@ var AdsConfigsClass = /*#__PURE__*/ function(BRNDTSConfig) {
67749
67759
  key: "defaults",
67750
67760
  get: function get() {
67751
67761
  return {
67752
- general: {},
67762
+ general: {
67763
+ clickability: {
67764
+ value: true,
67765
+ setting: {
67766
+ code: "clickability",
67767
+ name: "clickability",
67768
+ description: "",
67769
+ type: "boolean",
67770
+ constraints: {}
67771
+ }
67772
+ },
67773
+ visibility_on_pause: {
67774
+ value: true,
67775
+ setting: {
67776
+ code: "visibility_on_pause",
67777
+ name: "visibility_on_pause",
67778
+ description: "",
67779
+ type: "boolean",
67780
+ constraints: {}
67781
+ }
67782
+ },
67783
+ debug_mode: {
67784
+ value: false,
67785
+ setting: {
67786
+ code: "debug_mode",
67787
+ name: "debug_mode",
67788
+ description: "",
67789
+ type: "boolean",
67790
+ constraints: {}
67791
+ }
67792
+ }
67793
+ },
67753
67794
  adStrategies: {}
67754
67795
  };
67755
67796
  }
@@ -67812,7 +67853,6 @@ var AdsConfigsClass = /*#__PURE__*/ function(BRNDTSConfig) {
67812
67853
  general: _object_spread({}, ((_this_remote = _this.remote) === null || _this_remote === void 0 ? void 0 : _this_remote.general) || {}),
67813
67854
  adStrategies: strategies
67814
67855
  };
67815
- console.log("Ads strategies fetched", _this.remote);
67816
67856
  _this.merge();
67817
67857
  })
67818
67858
  ];
@@ -67835,15 +67875,21 @@ var Config = /*#__PURE__*/ function() {
67835
67875
  var _providedConfigs_auth;
67836
67876
  this.genericConfigs = new GenericConfigsClass(providedConfigs);
67837
67877
  this.adsConfigs = new AdsConfigsClass(providedAdsConfigs || {});
67838
- console.log("BRNDTS Config initialized", providedConfigs, providedAdsConfigs);
67839
67878
  if (!((_providedConfigs_auth = providedConfigs.auth) === null || _providedConfigs_auth === void 0 ? void 0 : _providedConfigs_auth.host)) {
67840
67879
  throw new InternalError("No authority configuration provided!");
67841
67880
  }
67842
67881
  if (!providedConfigs.key) {
67843
- throw new InternalError("No host or key provided!");
67882
+ throw new InternalError("No key provided!");
67844
67883
  }
67845
67884
  }
67846
67885
  _create_class(Config, [
67886
+ {
67887
+ key: "refresh",
67888
+ value: function refresh(providedConfigs, providedAdsConfigs) {
67889
+ this.genericConfigs.refresh(providedConfigs);
67890
+ this.adsConfigs.refresh(providedAdsConfigs);
67891
+ }
67892
+ },
67847
67893
  {
67848
67894
  key: "fetch",
67849
67895
  value: function fetch1() {
@@ -69042,6 +69088,22 @@ var RecorderFactory = /*#__PURE__*/ function() {
69042
69088
  }();
69043
69089
  // src/Ads/Providers/BRNDTSDefault/BRNDTSDefaultProvider.ts
69044
69090
  var icon = '\n<?xml version="1.0" encoding="UTF-8"?>\n<svg id="Camada_1" data-name="Camada 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 875 245">\n <defs>\n <style>\n .cls-1 {\n fill: #fff;\n }\n </style>\n </defs>\n <g>\n <path class="cls-1" d="M279.16,182.12v-116.12h48.13c12.5,0,21.49,2.76,26.96,8.28,5.47,5.52,8.2,13.08,8.2,22.66,0,4.48-.6,8.41-1.8,11.8-1.2,3.39-2.97,6.2-5.31,8.44-2.34,2.24-5.29,3.78-8.83,4.61,2.71.73,5.26,1.82,7.66,3.28,2.4,1.46,4.48,3.39,6.25,5.78,1.77,2.4,3.15,5.21,4.14,8.44.99,3.23,1.48,6.88,1.48,10.94,0,7.61-1.36,13.75-4.06,18.44-2.71,4.69-6.77,8.1-12.19,10.24-5.42,2.14-12.14,3.2-20.16,3.2h-50.48ZM309.48,111.64h17.5c2.29,0,3.98-.88,5.08-2.66,1.09-1.77,1.64-3.96,1.64-6.56,0-3.54-.7-5.96-2.11-7.27-1.41-1.3-2.94-1.95-4.61-1.95h-17.5v18.44ZM309.48,154.93h19.22c1.88,0,3.44-.42,4.69-1.25,1.25-.83,2.21-2,2.89-3.52.68-1.51,1.02-3.31,1.02-5.39s-.34-3.88-1.02-5.39c-.68-1.51-1.64-2.68-2.89-3.52-1.25-.83-2.81-1.25-4.69-1.25h-19.22v20.32Z"/>\n <path class="cls-1" d="M379.65,182.12v-116.12h49.54c5.1,0,9.79.63,14.07,1.88,4.27,1.25,7.97,3.36,11.1,6.33,3.13,2.97,5.55,6.95,7.27,11.96s2.58,11.31,2.58,18.91c0,4.79-.42,8.96-1.25,12.5-.84,3.54-1.95,6.54-3.36,8.99-1.41,2.45-3.07,4.51-5,6.17-1.93,1.67-3.99,3.13-6.17,4.38l20.16,45.01h-30.79l-16.25-40.01h-11.57v40.01h-30.32ZM409.97,118.05h13.75c1.67,0,3.13-.23,4.38-.7s2.32-1.22,3.2-2.27c.88-1.04,1.54-2.37,1.95-3.98.41-1.61.62-3.57.62-5.86s-.21-4.22-.62-5.78c-.42-1.56-1.07-2.79-1.95-3.67-.89-.88-1.95-1.54-3.2-1.95-1.25-.42-2.71-.62-4.38-.62h-13.75v24.85Z"/>\n <path class="cls-1" d="M479.67,182.12v-116.12h24.07l40.79,64.7v-64.7h30.32v116.12h-24.07l-40.79-64.7v64.7h-30.32Z"/>\n <path class="cls-1" d="M592.03,182.12v-116.12h51.26c8.44,0,15.37,1.48,20.79,4.45,5.42,2.97,9.69,7.11,12.81,12.42,3.13,5.31,5.31,11.49,6.56,18.52,1.25,7.03,1.88,14.61,1.88,22.74,0,13.65-1.54,24.72-4.61,33.21-3.07,8.49-7.71,14.74-13.91,18.75-6.2,4.01-14.04,6.02-23.52,6.02h-51.26ZM622.35,154.93h17.82c3.85,0,6.85-1.04,8.99-3.13,2.13-2.08,3.65-5.39,4.53-9.92.88-4.53,1.33-10.44,1.33-17.74,0-6.88-.34-12.37-1.02-16.49-.68-4.11-1.67-7.21-2.97-9.3-1.3-2.08-2.87-3.46-4.69-4.14-1.82-.68-3.88-1.02-6.17-1.02h-17.82v61.73Z"/>\n <path class="cls-1" d="M721.9,182.12v-88.92h-29.22v-27.19h88.77v27.19h-29.22v88.92h-30.32Z"/>\n <path class="cls-1" d="M828.95,183.06c-3.44,0-6.8-.11-10.08-.31-3.28-.21-6.51-.52-9.69-.94-3.18-.42-6.23-.88-9.14-1.41-2.92-.52-5.73-1.15-8.44-1.88v-24.07c3.54.31,7.37.57,11.49.78,4.11.21,8.28.37,12.5.47,4.22.1,8.15.16,11.8.16,3.44,0,6.3-.26,8.6-.78,2.29-.52,4.01-1.35,5.16-2.5,1.15-1.15,1.72-2.71,1.72-4.69v-1.88c0-2.29-.81-4.01-2.42-5.16-1.62-1.15-3.52-1.72-5.7-1.72h-8.28c-12.09,0-21.25-2.66-27.51-7.97-6.25-5.31-9.38-14.22-9.38-26.72v-5.16c0-11.46,3.44-20.03,10.31-25.71,6.88-5.68,16.77-8.52,29.69-8.52,4.9,0,9.51.23,13.83.7,4.32.47,8.39,1.04,12.19,1.72,3.8.68,7.21,1.38,10.24,2.11v24.07c-4.79-.42-10.18-.75-16.17-1.02-5.99-.26-11.44-.39-16.33-.39-2.92,0-5.52.21-7.81.63-2.29.42-4.06,1.25-5.31,2.5-1.25,1.25-1.88,3.07-1.88,5.47v1.56c0,2.61.83,4.59,2.5,5.94,1.67,1.36,4.22,2.03,7.66,2.03h10.31c7.29,0,13.36,1.38,18.21,4.14,4.84,2.76,8.49,6.51,10.94,11.25,2.45,4.74,3.67,10.13,3.67,16.17v5.16c0,9.9-1.72,17.45-5.16,22.66-3.44,5.21-8.34,8.73-14.69,10.55-6.36,1.82-13.96,2.74-22.82,2.74Z"/>\n </g>\n <path class="cls-1" d="M193.77,2.19H53.62C25.87,2.19,3.39,24.68,3.39,52.42v140.15c0,27.75,22.49,50.23,50.23,50.23h140.15c27.75,0,50.23-22.49,50.23-50.23V52.42c0-27.74-22.49-50.23-50.23-50.23ZM127.13,65.24c0-9.25,7.5-16.74,16.74-16.74h53.45v53.45c0,9.25-7.5,16.74-16.74,16.74h-53.45v-53.45ZM120.23,179.77c0,9.25-7.5,16.74-16.74,16.74h-36.71c-9.25,0-16.74-7.5-16.74-16.74v-114.53c0-9.25,7.5-16.74,16.74-16.74h36.71c9.25,0,16.74,7.5,16.74,16.74v114.53ZM197.33,162.19c-.55,18.26-16.3,33.95-34.45,34.31-17.61.35-33.5-12.89-35.21-30.88-1.15-12.1-.22-24.4-.22-38.93,14.98,0,27.35-.98,39.49.23,18.36,1.83,30.93,17.24,30.38,35.27Z"/>\n</svg>';
69091
+ function getContentFromTemplate(w2, h) {
69092
+ var container = document.createElement("div");
69093
+ container.classList.add("BRNDTS_default_content");
69094
+ container.style.width = "100%";
69095
+ container.style.height = "100%";
69096
+ var box = document.createElement("div");
69097
+ box.classList.add("box");
69098
+ box.style.width = "".concat(w2, "px");
69099
+ box.style.height = "".concat(h, "px");
69100
+ var iconBox = document.createElement("div");
69101
+ iconBox.classList.add("icon");
69102
+ iconBox.innerHTML = icon;
69103
+ box.appendChild(iconBox);
69104
+ container.appendChild(box);
69105
+ return container;
69106
+ }
69045
69107
  var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69046
69108
  _inherits(BRNDTSDefaultProvider, ContentProvider);
69047
69109
  function BRNDTSDefaultProvider(context) {
@@ -69051,21 +69113,8 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69051
69113
  context,
69052
69114
  void 0
69053
69115
  ]);
69054
- var container = document.createElement("div");
69055
- container.classList.add("BRNDTS_default_content");
69056
- container.style.width = "100%";
69057
- container.style.height = "100%";
69058
- var box = document.createElement("div");
69059
- box.classList.add("box");
69060
- var iconBox = document.createElement("div");
69061
- iconBox.classList.add("icon");
69062
- iconBox.innerHTML = icon;
69063
- box.appendChild(iconBox);
69064
- container.appendChild(box);
69065
69116
  _this.content = {
69066
- content: [
69067
- container
69068
- ],
69117
+ content: [],
69069
69118
  type: "brndts_placeholder"
69070
69119
  };
69071
69120
  return _this;
@@ -69073,14 +69122,26 @@ var BRNDTSDefaultProvider = /*#__PURE__*/ function(ContentProvider) {
69073
69122
  _create_class(BRNDTSDefaultProvider, [
69074
69123
  {
69075
69124
  key: "request",
69076
- value: function request() {
69125
+ value: function request(params) {
69077
69126
  return _async_to_generator(function() {
69078
69127
  return _ts_generator(this, function(_state) {
69128
+ this.content = _object_spread_props(_object_spread({}, this.content), {
69129
+ content: [
69130
+ getContentFromTemplate(params.size.width, params.size.height)
69131
+ ],
69132
+ extra: _object_spread_props(_object_spread({}, this.content.extra || {}), {
69133
+ sz: {
69134
+ w: params.size.width,
69135
+ h: params.size.height
69136
+ }
69137
+ })
69138
+ });
69139
+ this.notify();
69079
69140
  return [
69080
69141
  2
69081
69142
  ];
69082
69143
  });
69083
- })();
69144
+ }).call(this);
69084
69145
  }
69085
69146
  }
69086
69147
  ]);
@@ -69872,7 +69933,7 @@ var PrebidJS = /*#__PURE__*/ function() {
69872
69933
  value: function configure(context, options) {
69873
69934
  var _window_pbjs_que, _window_pbjs;
69874
69935
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
69875
- var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1;
69936
+ var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1, _window_pbjs2;
69876
69937
  var configBuilder = new PrebidConfigBuilder();
69877
69938
  configBuilder.setDebug((_context_config_getAdsConfig_general = context.config.getAdsConfig().general) === null || _context_config_getAdsConfig_general === void 0 ? void 0 : (_context_config_getAdsConfig_general_debug_mode = _context_config_getAdsConfig_general.debug_mode) === null || _context_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _context_config_getAdsConfig_general_debug_mode.value).setGAMConfiguration().setUserConfig({
69878
69939
  userIds: [
@@ -69891,8 +69952,11 @@ var PrebidJS = /*#__PURE__*/ function() {
69891
69952
  ]
69892
69953
  }).addConsent(context.consent);
69893
69954
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setConfig(configBuilder.build());
69955
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.enableAnalytics({
69956
+ provider: "smartyads"
69957
+ });
69894
69958
  context.logger.log("Prebid.js configuration set.");
69895
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.setBidderConfig({
69959
+ (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
69896
69960
  bidders: [
69897
69961
  "bidderA"
69898
69962
  ],
@@ -69908,9 +69972,9 @@ var PrebidJS = /*#__PURE__*/ function() {
69908
69972
  }
69909
69973
  });
69910
69974
  for(var bidderName in options.bidders){
69911
- var _window_pbjs2;
69975
+ var _window_pbjs3;
69912
69976
  var bidderConfig = options.bidders[bidderName];
69913
- (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
69977
+ (_window_pbjs3 = window.pbjs) === null || _window_pbjs3 === void 0 ? void 0 : _window_pbjs3.setBidderConfig({
69914
69978
  bidders: [
69915
69979
  bidderName.toLowerCase()
69916
69980
  ],
@@ -70356,7 +70420,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
70356
70420
  value: function configure(context, options) {
70357
70421
  var _window_pbjs_que, _window_pbjs;
70358
70422
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
70359
- var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1;
70423
+ var _context_config_getAdsConfig_general_debug_mode, _context_config_getAdsConfig_general, _window_pbjs, _window_pbjs1, _window_pbjs2;
70360
70424
  var configBuilder = new PrebidConfigBuilder();
70361
70425
  configBuilder.setDebug((_context_config_getAdsConfig_general = context.config.getAdsConfig().general) === null || _context_config_getAdsConfig_general === void 0 ? void 0 : (_context_config_getAdsConfig_general_debug_mode = _context_config_getAdsConfig_general.debug_mode) === null || _context_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _context_config_getAdsConfig_general_debug_mode.value).setGAMConfiguration().setUserConfig({
70362
70426
  userIds: [
@@ -70375,8 +70439,11 @@ var PrebidGAM = /*#__PURE__*/ function() {
70375
70439
  ]
70376
70440
  }).addConsent(context.consent);
70377
70441
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setConfig(configBuilder.build());
70442
+ (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.enableAnalytics({
70443
+ provider: "smartyads"
70444
+ });
70378
70445
  context.logger.log("Prebid.js configuration set.");
70379
- (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.setBidderConfig({
70446
+ (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
70380
70447
  bidders: [
70381
70448
  "bidderA"
70382
70449
  ],
@@ -70392,9 +70459,9 @@ var PrebidGAM = /*#__PURE__*/ function() {
70392
70459
  }
70393
70460
  });
70394
70461
  for(var bidderName in options.bidders){
70395
- var _window_pbjs2;
70462
+ var _window_pbjs3;
70396
70463
  var bidderConfig = options.bidders[bidderName];
70397
- (_window_pbjs2 = window.pbjs) === null || _window_pbjs2 === void 0 ? void 0 : _window_pbjs2.setBidderConfig({
70464
+ (_window_pbjs3 = window.pbjs) === null || _window_pbjs3 === void 0 ? void 0 : _window_pbjs3.setBidderConfig({
70398
70465
  bidders: [
70399
70466
  bidderName.toLowerCase()
70400
70467
  ],
@@ -70462,7 +70529,9 @@ var PrebidGAM = /*#__PURE__*/ function() {
70462
70529
  var _unitDefinition_mediaTypes_banner;
70463
70530
  sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
70464
70531
  }
70465
- GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId));
70532
+ GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), [
70533
+ sizes[0] || []
70534
+ ], "".concat(containerId));
70466
70535
  if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
70467
70536
  return "".concat(containerId) === "".concat(defUnit.code);
70468
70537
  }))) {
@@ -70634,7 +70703,6 @@ var PrebidGAMProvider = /*#__PURE__*/ function(ContentProvider1) {
70634
70703
  ];
70635
70704
  case 2:
70636
70705
  _state.sent();
70637
- console.log("Requesting ad for region ".concat(regionId, " with size ").concat(params.size.width, "x").concat(params.size.height));
70638
70706
  PrebidGAM.defineSlot(this.options, regionId, this.workingSlotId, adType, adName);
70639
70707
  PrebidGAM.request(regionId, this.workingSlotId, function(content) {
70640
70708
  content.style.width = "".concat(regionInfo === null || regionInfo === void 0 ? void 0 : regionInfo.w, "px");
@@ -71039,7 +71107,6 @@ var RegionBox = /*#__PURE__*/ function(_import_events_default) {
71039
71107
  var RegionContent = /*#__PURE__*/ function() {
71040
71108
  function RegionContent(id, plane, box, ctx) {
71041
71109
  _class_call_check(this, RegionContent);
71042
- var _this_ctx;
71043
71110
  this.scale = null;
71044
71111
  this.id = id;
71045
71112
  this.plane = plane;
@@ -71049,9 +71116,6 @@ var RegionContent = /*#__PURE__*/ function() {
71049
71116
  this.container.id = "BRNDTS_RB_".concat(this.id);
71050
71117
  this.container.classList.add("BRNDTS_RB");
71051
71118
  this.container.dataset.state = "hidden";
71052
- if ((_this_ctx = this.ctx) === null || _this_ctx === void 0 ? void 0 : _this_ctx.color) {
71053
- this.container.style.backgroundColor = "#".concat(this.ctx.color, "73");
71054
- }
71055
71119
  this.render();
71056
71120
  }
71057
71121
  _create_class(RegionContent, [
@@ -71369,7 +71433,6 @@ var RegionDebugPlugin = /*#__PURE__*/ function() {
71369
71433
  region.content.view.classList.toggle("BRNDTS_AUXR_B", true);
71370
71434
  if (region.content.view) {
71371
71435
  region.content.view.style.borderColor = "#".concat(color, "73");
71372
- region.content.view.style.backgroundColor = "#".concat(color, "73");
71373
71436
  region.content.view.style.borderStyle = "solid";
71374
71437
  region.content.view.style.borderWidth = "2px";
71375
71438
  }
@@ -71381,7 +71444,6 @@ var RegionDebugPlugin = /*#__PURE__*/ function() {
71381
71444
  value: function afterShow(region) {
71382
71445
  var _region_regionDescriptor_ctx, _region_regionDescriptor_ctx1, _region_regionDescriptor_ctx2;
71383
71446
  if (!region.regionDescriptor) {
71384
- console.log("No region descriptor", region);
71385
71447
  this.csLabel.remove();
71386
71448
  return Promise.resolve();
71387
71449
  }
@@ -71470,7 +71532,7 @@ var Region = /*#__PURE__*/ function() {
71470
71532
  function Region(id, regionDescriptor, planeDescriptor, options, deps) {
71471
71533
  var _this = this;
71472
71534
  _class_call_check(this, Region);
71473
- var _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general1, _this_deps_config_getAdsConfig_general_debug_mode1, _this_deps_config_getAdsConfig_general2, _this_deps_config1;
71535
+ var _this_deps_config_getAdsConfig_general_clickability, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general1, _this_deps_config1, _this_deps_config_getAdsConfig_general_debug_mode1, _this_deps_config_getAdsConfig_general2, _this_deps_config2;
71474
71536
  this.onScreen = false;
71475
71537
  this.visible = false;
71476
71538
  this.plugins = [];
@@ -71487,12 +71549,13 @@ var Region = /*#__PURE__*/ function() {
71487
71549
  this.container.classList.add("BRNDTS_R");
71488
71550
  this.container.style.position = "absolute";
71489
71551
  this.container.style.display = "none";
71490
- 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_general1 = this.deps.config.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)) {
71491
- this.container.style.pointerEvents = "none";
71492
- } else {
71552
+ 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) {
71493
71553
  this.container.style.pointerEvents = "all";
71494
71554
  }
71495
- this.content = new RegionContent(this.id, this.plane, this.box, ((_this_deps_config1 = this.deps.config) === null || _this_deps_config1 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general2 = _this_deps_config1.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general2 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode1 = _this_deps_config_getAdsConfig_general2.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode1 === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode1.value) ? this.regionDescriptor.ctx : void 0);
71555
+ 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) {
71556
+ this.container.style.pointerEvents = "none";
71557
+ }
71558
+ this.content = new RegionContent(this.id, this.plane, this.box, ((_this_deps_config2 = this.deps.config) === null || _this_deps_config2 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general2 = _this_deps_config2.getAdsConfig().general) === null || _this_deps_config_getAdsConfig_general2 === void 0 ? void 0 : (_this_deps_config_getAdsConfig_general_debug_mode1 = _this_deps_config_getAdsConfig_general2.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode1 === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode1.value) ? this.regionDescriptor.ctx : void 0);
71496
71559
  this.container.appendChild(this.content.view);
71497
71560
  this.handleClick = this.handleClick.bind(this);
71498
71561
  this.handleMouseEnter = this.handleMouseEnter.bind(this);
@@ -71806,7 +71869,7 @@ var Region = /*#__PURE__*/ function() {
71806
71869
  key: "render",
71807
71870
  value: function render(contours, box) {
71808
71871
  return _async_to_generator(function() {
71809
- var newBox, _this_deps_recorder, _this_deps_recorder1;
71872
+ var newBox, _this_deps_recorder, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps_recorder1, debugMode;
71810
71873
  return _ts_generator(this, function(_state) {
71811
71874
  switch(_state.label){
71812
71875
  case 0:
@@ -71833,13 +71896,14 @@ var Region = /*#__PURE__*/ function() {
71833
71896
  (_this_deps_recorder = this.deps.recorder) === null || _this_deps_recorder === void 0 ? void 0 : _this_deps_recorder.presentationStateChanged(this);
71834
71897
  return [
71835
71898
  3,
71836
- 4
71899
+ 5
71837
71900
  ];
71838
71901
  case 1:
71839
71902
  if (!this.shouldHide()) return [
71840
71903
  3,
71841
- 3
71904
+ 4
71842
71905
  ];
71906
+ debugMode = (_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_debug_mode = _this_deps_config_getAdsConfig_general.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value;
71843
71907
  this.content.clear();
71844
71908
  return [
71845
71909
  4,
@@ -71852,15 +71916,20 @@ var Region = /*#__PURE__*/ function() {
71852
71916
  this.container.style.height = "0px";
71853
71917
  this.container.style.left = "0px";
71854
71918
  this.container.style.top = "0px";
71855
- this.applyPlugins("afterHide");
71919
+ return [
71920
+ 4,
71921
+ this.applyPlugins("afterHide")
71922
+ ];
71923
+ case 3:
71924
+ _state.sent();
71856
71925
  this.visible = false;
71857
71926
  this.content.destroy();
71858
71927
  (_this_deps_recorder1 = this.deps.recorder) === null || _this_deps_recorder1 === void 0 ? void 0 : _this_deps_recorder1.presentationStateChanged(this);
71859
71928
  return [
71860
71929
  3,
71861
- 4
71930
+ 5
71862
71931
  ];
71863
- case 3:
71932
+ case 4:
71864
71933
  if (this.visible) {
71865
71934
  this.container.style.width = "".concat(this.box.width(this.plane.size), "px");
71866
71935
  this.container.style.height = "".concat(this.box.height(this.plane.size), "px");
@@ -71869,8 +71938,8 @@ var Region = /*#__PURE__*/ function() {
71869
71938
  this.content.render();
71870
71939
  this.applyPlugins("reRender");
71871
71940
  }
71872
- _state.label = 4;
71873
- case 4:
71941
+ _state.label = 5;
71942
+ case 5:
71874
71943
  this.applyPlugins("afterRender");
71875
71944
  return [
71876
71945
  2
@@ -71960,9 +72029,9 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
71960
72029
  function StaticAdRegion(id, planeDescriptor, options, deps) {
71961
72030
  _class_call_check(this, StaticAdRegion);
71962
72031
  var _this;
71963
- var _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config;
72032
+ var _options_ad, _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config;
71964
72033
  _this = _call_super(this, StaticAdRegion, [
71965
- "".concat(id),
72034
+ "".concat((options === null || options === void 0 ? void 0 : (_options_ad = options.ad) === null || _options_ad === void 0 ? void 0 : _options_ad.name) || id),
71966
72035
  {
71967
72036
  id: id,
71968
72037
  contours: [],
@@ -71981,6 +72050,9 @@ var StaticAdRegion = /*#__PURE__*/ function(Region) {
71981
72050
  _this.content.view.remove();
71982
72051
  _this.content = new StaticRegionContent(_this.id, _this.plane, _this.box, ((_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_debug_mode = _this_deps_config_getAdsConfig_general.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value) ? _this.regionDescriptor.ctx : void 0);
71983
72052
  _this.container.appendChild(_this.content.view);
72053
+ if (_this.deps.provider) {
72054
+ _this.content.addContent(_this.deps.provider.contents());
72055
+ }
71984
72056
  return _this;
71985
72057
  }
71986
72058
  _create_class(StaticAdRegion, [
@@ -72912,6 +72984,12 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
72912
72984
  return this.media;
72913
72985
  }
72914
72986
  },
72987
+ {
72988
+ key: "fullscreenElement",
72989
+ get: function get() {
72990
+ return this.view || void 0;
72991
+ }
72992
+ },
72915
72993
  {
72916
72994
  key: "viewWidth",
72917
72995
  get: function get() {
@@ -73357,6 +73435,12 @@ var NativeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73357
73435
  return this.media;
73358
73436
  }
73359
73437
  },
73438
+ {
73439
+ key: "fullscreenElement",
73440
+ get: function get() {
73441
+ return this.view || void 0;
73442
+ }
73443
+ },
73360
73444
  {
73361
73445
  key: "viewWidth",
73362
73446
  get: function get() {
@@ -73726,6 +73810,13 @@ var BradmaxMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73726
73810
  return this.actualMediaElement;
73727
73811
  }
73728
73812
  },
73813
+ {
73814
+ key: "fullscreenElement",
73815
+ get: function get() {
73816
+ var _this_view;
73817
+ return ((_this_view = this.view) === null || _this_view === void 0 ? void 0 : _this_view.closest(".bsplayer")) || void 0;
73818
+ }
73819
+ },
73729
73820
  {
73730
73821
  key: "viewWidth",
73731
73822
  get: function get() {
@@ -74187,6 +74278,12 @@ var DailymotionMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74187
74278
  return this.rootNode;
74188
74279
  }
74189
74280
  },
74281
+ {
74282
+ key: "fullscreenElement",
74283
+ get: function get() {
74284
+ return this.view || void 0;
74285
+ }
74286
+ },
74190
74287
  {
74191
74288
  key: "viewWidth",
74192
74289
  get: function get() {
@@ -74413,7 +74510,6 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74413
74510
  _this.emit("SEEKED");
74414
74511
  });
74415
74512
  (_this_instance4 = this.instance) === null || _this_instance4 === void 0 ? void 0 : _this_instance4.ready(function() {
74416
- console.log("VideoJS media is ready");
74417
74513
  _this.mediaIsReady();
74418
74514
  });
74419
74515
  }
@@ -74443,7 +74539,6 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74443
74539
  clone.autoplay = false;
74444
74540
  this.context.elements.original = clone;
74445
74541
  this.instance = this.media.player;
74446
- console.log("VideoJS media instance set", this.instance);
74447
74542
  if (this.instance) {
74448
74543
  this.instance.fluid(false);
74449
74544
  }
@@ -74487,6 +74582,12 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74487
74582
  return this.media;
74488
74583
  }
74489
74584
  },
74585
+ {
74586
+ key: "fullscreenElement",
74587
+ get: function get() {
74588
+ return this.view || void 0;
74589
+ }
74590
+ },
74490
74591
  {
74491
74592
  key: "viewWidth",
74492
74593
  get: function get() {
@@ -74530,15 +74631,15 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74530
74631
  {
74531
74632
  key: "currentTime",
74532
74633
  get: function get() {
74533
- var _this_media;
74534
- var _this_media_currentTime;
74535
- return (_this_media_currentTime = (_this_media = this.media) === null || _this_media === void 0 ? void 0 : _this_media.currentTime) !== null && _this_media_currentTime !== void 0 ? _this_media_currentTime : 0;
74634
+ var _this_instance;
74635
+ var _this_instance_currentTime;
74636
+ return (_this_instance_currentTime = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.currentTime()) !== null && _this_instance_currentTime !== void 0 ? _this_instance_currentTime : 0;
74536
74637
  },
74537
74638
  set: function set(value2) {
74538
74639
  if (!this.duration) return;
74539
74640
  var validTime = is_default.number(value2) && value2 > 0 ? Math.min(value2, this.duration) : 0;
74540
- if (this.media) {
74541
- this.media.currentTime = validTime;
74641
+ if (this.instance) {
74642
+ this.instance.currentTime(validTime);
74542
74643
  this.context.logger.log("Seeking to ".concat(this.currentTime, " seconds"));
74543
74644
  }
74544
74645
  }
@@ -74546,10 +74647,10 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74546
74647
  {
74547
74648
  key: "duration",
74548
74649
  get: function get() {
74549
- var _this_media;
74650
+ var _this_instance;
74550
74651
  var fauxDuration = /* this.context.config.duration */ void 0;
74551
- var _this_media_duration;
74552
- var realDuration = (_this_media_duration = (_this_media = this.media) === null || _this_media === void 0 ? void 0 : _this_media.duration) !== null && _this_media_duration !== void 0 ? _this_media_duration : 0;
74652
+ var _this_instance_duration;
74653
+ var realDuration = (_this_instance_duration = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.duration()) !== null && _this_instance_duration !== void 0 ? _this_instance_duration : 0;
74553
74654
  return fauxDuration || realDuration;
74554
74655
  }
74555
74656
  },
@@ -74689,7 +74790,7 @@ var VideoJSMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74689
74790
  key: "forward",
74690
74791
  value: function forward() {
74691
74792
  var seekTime = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_SEEK_INTERVAL5;
74692
- this.currentTime += seekTime;
74793
+ this.currentTime = this.currentTime + seekTime;
74693
74794
  }
74694
74795
  },
74695
74796
  {
@@ -74785,6 +74886,10 @@ var MediaElementFactory = /*#__PURE__*/ function() {
74785
74886
  var _hasBradMaxPID = _sliced_to_array(hasBradMaxPID, 2), el1 = _hasBradMaxPID[0], value21 = _hasBradMaxPID[1];
74786
74887
  return el1;
74787
74888
  }
74889
+ var isVideoJS = element.querySelector("video-js");
74890
+ if (isVideoJS) {
74891
+ return isVideoJS;
74892
+ }
74788
74893
  return null;
74789
74894
  case "IFRAME":
74790
74895
  var url2 = element.getAttribute("src");
@@ -75034,7 +75139,6 @@ var VideoRegionsDataCollection = /*#__PURE__*/ function() {
75034
75139
  if (!to) {
75035
75140
  to = this.totalLengthSeconds;
75036
75141
  }
75037
- console.log("from : ", from, " to : ", to);
75038
75142
  var result = {};
75039
75143
  for(var index = 0; index < this.timestampList.length; index++){
75040
75144
  var element = +this.timestampList[index];
@@ -75197,7 +75301,6 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
75197
75301
  this.service.send("stop");
75198
75302
  this.service.destroy();
75199
75303
  this.regionsData.load(data);
75200
- console.log("loaded data");
75201
75304
  }
75202
75305
  var input = document.createElement("input");
75203
75306
  input.type = "file";
@@ -75217,7 +75320,6 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
75217
75320
  _this.service.send("stop");
75218
75321
  _this.service.destroy();
75219
75322
  _this.regionsData.load(parsedData);
75220
- console.log("loaded data");
75221
75323
  }
75222
75324
  };
75223
75325
  reader.readAsText(file);
@@ -75327,17 +75429,19 @@ var VideoRegionsDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataManag
75327
75429
  if (!regions2 || !regions2.regions) {
75328
75430
  return null;
75329
75431
  }
75330
- var validRegions = regions2.regions.filter(function(reg, _, array) {
75331
- if (!last) {
75332
- last = array.map(function(r3) {
75333
- return r3.id;
75334
- });
75335
- result = _to_consumable_array(array);
75336
- }
75337
- if (last.includes(reg.id)) {
75338
- return true;
75339
- }
75340
- return false;
75432
+ if (!last) {
75433
+ last = regions2.regions.map(function(r3) {
75434
+ return r3.id;
75435
+ });
75436
+ result = _to_consumable_array(regions2.regions);
75437
+ return {
75438
+ timestamp_start: timestamp,
75439
+ timestamp_end: timestamp + totalDuration,
75440
+ regions: result
75441
+ };
75442
+ }
75443
+ var validRegions = regions2.regions.filter(function(reg) {
75444
+ return last === null || last === void 0 ? void 0 : last.includes(reg.id);
75341
75445
  });
75342
75446
  if (validRegions.length <= 0) {
75343
75447
  return null;
@@ -75349,7 +75453,7 @@ var VideoRegionsDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataManag
75349
75453
  duration = regions2.timestamp_end - regions2.timestamp_start;
75350
75454
  }
75351
75455
  totalDuration += duration;
75352
- workingTimestamp = regions2.timestamp_end + 1e-3;
75456
+ workingTimestamp = regions2.timestamp_end + 1e-3 + 1e3;
75353
75457
  last = validRegions.map(function(r3) {
75354
75458
  return r3.id;
75355
75459
  });
@@ -75416,7 +75520,7 @@ var VideoRegionsMaxDurationDecorator = /*#__PURE__*/ function(VideoRegionsDataMa
75416
75520
  duration = regions2.timestamp_end - regions2.timestamp_start;
75417
75521
  }
75418
75522
  totalDuration += duration;
75419
- workingTimestamp = regions2.timestamp_end + 1e-3;
75523
+ workingTimestamp = regions2.timestamp_end + 1e-3 + 1e3;
75420
75524
  last = filteredRegions.map(function(r3) {
75421
75525
  return r3.id;
75422
75526
  });
@@ -75549,6 +75653,8 @@ var Store = /*#__PURE__*/ function() {
75549
75653
  ]);
75550
75654
  return Store;
75551
75655
  }();
75656
+ // src/Ads/VideoAds/PresentationMode/Basic/BasicMode.ts
75657
+ var import_events9 = __toESM(require_events());
75552
75658
  // src/Ads/VideoAds/PresentationStrategy/AbstractPresentation.ts
75553
75659
  var import_events5 = __toESM(require_events());
75554
75660
  var AbstractPresentation = /*#__PURE__*/ function(_import_events5_default) {
@@ -76050,12 +76156,14 @@ var PresentationStrategyFactory = /*#__PURE__*/ function() {
76050
76156
  _create_class(PresentationStrategyFactory, null, [
76051
76157
  {
76052
76158
  key: "get",
76053
- value: function get(settings) {
76054
- if (!settings) {
76159
+ value: function get(config2) {
76160
+ var _config2_getAdsConfig_general_debug_mode, _config2_getAdsConfig_general;
76161
+ if (!config2 || (config2 === null || config2 === void 0 ? void 0 : (_config2_getAdsConfig_general = config2.getAdsConfig().general) === null || _config2_getAdsConfig_general === void 0 ? void 0 : (_config2_getAdsConfig_general_debug_mode = _config2_getAdsConfig_general.debug_mode) === null || _config2_getAdsConfig_general_debug_mode === void 0 ? void 0 : _config2_getAdsConfig_general_debug_mode.value) && (config2 === null || config2 === void 0 ? void 0 : config2.getStrategy().code) !== "basic") {
76055
76162
  return new PacedPresentation({
76056
76163
  paceMS: 10
76057
76164
  });
76058
76165
  }
76166
+ var settings = config2.getStrategySettings();
76059
76167
  if (settings.cooldown_time && settings.minimum_display_time) {
76060
76168
  return new DynamicDurationPresentation({
76061
76169
  cooldownTimeMS: settings.cooldown_time.value * 1e3,
@@ -79537,10 +79645,6 @@ var Controls = /*#__PURE__*/ function() {
79537
79645
  }
79538
79646
  if (this.context.media.is("NATIVE")) {
79539
79647
  this.setTopBar();
79540
- if (this.context.config.get("debug")) {
79541
- this.controlBottomBar = new ControlBottomBar(this.context, this.events);
79542
- this.container.appendChild(this.controlBottomBar.view);
79543
- }
79544
79648
  }
79545
79649
  }
79546
79650
  }
@@ -79633,7 +79737,7 @@ var Fullscreen = /*#__PURE__*/ function() {
79633
79737
  this.context = context;
79634
79738
  this.container = this.context.elements.container;
79635
79739
  document.addEventListener("fullscreenchange", function() {
79636
- if (document.fullscreenElement === _this.context.media.view || document.fullscreenElement === _this.context.elements.container) {
79740
+ if (document.fullscreenElement === _this.context.media.fullscreenElement || document.fullscreenElement === _this.context.elements.container) {
79637
79741
  _this.context.elements.fullscreen = document.fullscreenElement;
79638
79742
  _this.container.dataset.fullscreen = "true";
79639
79743
  _this.container.style.paddingBottom = "0";
@@ -79908,7 +80012,6 @@ var Interface = /*#__PURE__*/ function(_import_events7_default) {
79908
80012
  _this.media = _this.context.media;
79909
80013
  _this.container = document.createElement("div");
79910
80014
  _this.container.id = "BRNDTS";
79911
- _this.setDebug(_this.context.config.get("debug"));
79912
80015
  _this.wrapMedia();
79913
80016
  _this.fullscreen = new Fullscreen(_this.context);
79914
80017
  _this.setupControls();
@@ -80404,6 +80507,9 @@ var BasicAdRegion = /*#__PURE__*/ function(Region) {
80404
80507
  _this.content.view.remove();
80405
80508
  _this.content = new StaticRegionContent2(_this.id, _this.plane, _this.box, ((_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_debug_mode = _this_deps_config_getAdsConfig_general.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value) ? _this.regionDescriptor.ctx : void 0);
80406
80509
  _this.container.appendChild(_this.content.view);
80510
+ if (_this.deps.provider) {
80511
+ _this.content.addContent(_this.deps.provider.contents());
80512
+ }
80407
80513
  return _this;
80408
80514
  }
80409
80515
  _create_class(BasicAdRegion, [
@@ -80417,7 +80523,6 @@ var BasicAdRegion = /*#__PURE__*/ function(Region) {
80417
80523
  key: "requestContent",
80418
80524
  value: function requestContent() {
80419
80525
  var box = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.box;
80420
- console.log("Requesting content for region ".concat(this.id, " with box:"), this.deps.provider);
80421
80526
  if (this.deps.provider) {
80422
80527
  var _this_options_ad, _this_options, _this_options_ad1, _this_options1;
80423
80528
  this.deps.provider.request({
@@ -80620,7 +80725,6 @@ var RegionsContainerView = /*#__PURE__*/ function() {
80620
80725
  this.contentLayer.style.position = "absolute";
80621
80726
  this.contentLayer.style.top = "".concat(this.position.y, "px");
80622
80727
  this.contentLayer.style.left = "".concat(this.position.x, "px");
80623
- this.contentLayer.style.pointerEvents = "none";
80624
80728
  this.contentLayer.style.width = "".concat(this.size.width, "px");
80625
80729
  this.contentLayer.style.height = "".concat(this.size.height, "px");
80626
80730
  }
@@ -80705,6 +80809,7 @@ var AdRegionsCollection = /*#__PURE__*/ function(MappedCollection) {
80705
80809
  var AdRegionsArea = /*#__PURE__*/ function() {
80706
80810
  function AdRegionsArea(context, position, size, id) {
80707
80811
  _class_call_check(this, AdRegionsArea);
80812
+ var _this_context_config_getAdsConfig_general_debug_mode, _this_context_config_getAdsConfig_general;
80708
80813
  this.position = {
80709
80814
  x: 0,
80710
80815
  y: 0
@@ -80715,7 +80820,7 @@ var AdRegionsArea = /*#__PURE__*/ function() {
80715
80820
  };
80716
80821
  this.id = id;
80717
80822
  this.context = context;
80718
- this.maxRegions = MAX_REGIONS;
80823
+ this.maxRegions = ((_this_context_config_getAdsConfig_general = this.context.config.getAdsConfig().general) === null || _this_context_config_getAdsConfig_general === void 0 ? void 0 : (_this_context_config_getAdsConfig_general_debug_mode = _this_context_config_getAdsConfig_general.debug_mode) === null || _this_context_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_context_config_getAdsConfig_general_debug_mode.value) ? Number.MAX_SAFE_INTEGER : MAX_REGIONS;
80719
80824
  this.position = position;
80720
80825
  this.size = size;
80721
80826
  this.handleIntersectionChange = this.handleIntersectionChange.bind(this);
@@ -80852,12 +80957,18 @@ var AdRegionsArea = /*#__PURE__*/ function() {
80852
80957
  var RegionRenderer = /*#__PURE__*/ function() {
80853
80958
  function RegionRenderer(context, size) {
80854
80959
  _class_call_check(this, RegionRenderer);
80960
+ var _this_context_config_getAdsConfig_general_clickability, _this_context_config_getAdsConfig_general, _this_context_config;
80855
80961
  this.regionAreas = {};
80856
80962
  this.context = context;
80857
80963
  this.regionsContainerView = new RegionsContainerView({
80858
80964
  x: 0,
80859
80965
  y: 0
80860
80966
  }, size);
80967
+ if ((_this_context_config = this.context.config) === null || _this_context_config === void 0 ? void 0 : (_this_context_config_getAdsConfig_general = _this_context_config.getAdsConfig().general) === null || _this_context_config_getAdsConfig_general === void 0 ? void 0 : (_this_context_config_getAdsConfig_general_clickability = _this_context_config_getAdsConfig_general.clickability) === null || _this_context_config_getAdsConfig_general_clickability === void 0 ? void 0 : _this_context_config_getAdsConfig_general_clickability.value) {
80968
+ this.regionsContainerView.view.style.pointerEvents = "all";
80969
+ } else {
80970
+ this.regionsContainerView.view.style.pointerEvents = "none";
80971
+ }
80861
80972
  }
80862
80973
  _create_class(RegionRenderer, [
80863
80974
  {
@@ -80938,7 +81049,6 @@ var RegionRenderer = /*#__PURE__*/ function() {
80938
81049
  return RegionRenderer;
80939
81050
  }();
80940
81051
  // src/Ads/VideoAds/PresentationMode/Basic/BasicMode.ts
80941
- var import_events9 = __toESM(require_events());
80942
81052
  function adjustSizeWithAspectRatio(maxWidth, maxHeight, aspectRatio) {
80943
81053
  var width = maxWidth;
80944
81054
  var height = maxHeight;
@@ -81178,9 +81288,14 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81178
81288
  var _this_adPresentationStrategy;
81179
81289
  (_this_adPresentationStrategy = _this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.start();
81180
81290
  } else {
81181
- var _this_adPresentationStrategy1;
81291
+ var _this_adPresentationStrategy1, _adsConfigs_general_visibility_on_pause, _adsConfigs_general;
81182
81292
  var adsConfigs = _this.context.config.getAdsConfig();
81183
81293
  (_this_adPresentationStrategy1 = _this.adPresentationStrategy) === null || _this_adPresentationStrategy1 === void 0 ? void 0 : _this_adPresentationStrategy1.stop();
81294
+ if (!((_adsConfigs_general = adsConfigs.general) === null || _adsConfigs_general === void 0 ? void 0 : (_adsConfigs_general_visibility_on_pause = _adsConfigs_general.visibility_on_pause) === null || _adsConfigs_general_visibility_on_pause === void 0 ? void 0 : _adsConfigs_general_visibility_on_pause.value)) {
81295
+ var _this_mediaElementSizeController, _this_regionsRenderer;
81296
+ (_this_mediaElementSizeController = _this.mediaElementSizeController) === null || _this_mediaElementSizeController === void 0 ? void 0 : _this_mediaElementSizeController.restore();
81297
+ (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
81298
+ }
81184
81299
  }
81185
81300
  }
81186
81301
  if (oldState.fullscreen !== newState.fullscreen) {
@@ -81197,10 +81312,9 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81197
81312
  height: this.context.media.viewHeight
81198
81313
  });
81199
81314
  if (this.context.elements.container) {
81200
- var _this_regionsRenderer;
81201
- (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.attach(this.context.elements.container, this.context.media.view);
81315
+ this.regionsRenderer.attach(this.context.elements.container, this.context.media.view);
81202
81316
  }
81203
- this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config.getStrategySettings());
81317
+ this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config);
81204
81318
  (_this_adPresentationStrategy = this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.on("presentation", function() {
81205
81319
  var _this_mediaElementSizeController;
81206
81320
  var expected = (_this_mediaElementSizeController = _this.mediaElementSizeController) === null || _this_mediaElementSizeController === void 0 ? void 0 : _this_mediaElementSizeController.expectedDimensions(70, _this.context.store.getState().fullscreen ? 10 : 0);
@@ -81220,7 +81334,6 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
81220
81334
  }
81221
81335
  }).on("pace", function() {}).on("cooldown", function() {
81222
81336
  var _this_regionsRenderer;
81223
- console.log("Cooldown");
81224
81337
  (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
81225
81338
  _this.packer.reset();
81226
81339
  setTimeout(function() {
@@ -81388,12 +81501,10 @@ var RegionFactory = /*#__PURE__*/ function() {
81388
81501
  {
81389
81502
  key: "getPluginForStrategy",
81390
81503
  value: function getPluginForStrategy() {
81391
- var _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps, _this_deps1;
81504
+ var _this_deps_config_getAdsConfig_general_debug_mode, _this_deps_config_getAdsConfig_general, _this_deps_config, _this_deps, _this_deps1, _this_deps_config_getAdsConfig_general_debug_mode1, _this_deps_config_getAdsConfig_general1, _this_deps_config1, _this_deps2;
81392
81505
  var plugins2 = [];
81393
81506
  if ((_this_deps = this.deps) === null || _this_deps === void 0 ? void 0 : (_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_debug_mode = _this_deps_config_getAdsConfig_general.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode.value) {
81394
81507
  plugins2.push(new RegionDebugPlugin());
81395
- } else {
81396
- plugins2.push(new RegionBorderPlugin());
81397
81508
  }
81398
81509
  if (!((_this_deps1 = this.deps) === null || _this_deps1 === void 0 ? void 0 : _this_deps1.strategy)) {
81399
81510
  return [
@@ -81413,10 +81524,10 @@ var RegionFactory = /*#__PURE__*/ function() {
81413
81524
  })
81414
81525
  ];
81415
81526
  }
81416
- if (this.deps.strategy === "banner" || this.deps.strategy === "bannerv2" || this.deps.strategy === "bannerv2_ocr" || this.deps.strategy === "test") {
81417
- plugins2.push(new RegionAnimationPlugin());
81418
- return plugins2;
81527
+ if (!((_this_deps2 = this.deps) === null || _this_deps2 === void 0 ? void 0 : (_this_deps_config1 = _this_deps2.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_mode1 = _this_deps_config_getAdsConfig_general1.debug_mode) === null || _this_deps_config_getAdsConfig_general_debug_mode1 === void 0 ? void 0 : _this_deps_config_getAdsConfig_general_debug_mode1.value) && (this.deps.strategy === "banner" || this.deps.strategy === "bannerv2" || this.deps.strategy === "bannerv2_ocr" || this.deps.strategy === "test")) {
81528
+ plugins2.push(new RegionBorderPlugin(), new RegionAnimationPlugin());
81419
81529
  }
81530
+ return plugins2;
81420
81531
  }
81421
81532
  },
81422
81533
  {
@@ -81799,10 +81910,11 @@ var AdRegionsCollection3 = /*#__PURE__*/ function(MappedCollection) {
81799
81910
  var RegionRenderer2 = /*#__PURE__*/ function() {
81800
81911
  function RegionRenderer2(context, width, height) {
81801
81912
  _class_call_check(this, RegionRenderer2);
81913
+ var _this_context_config_getAdsConfig_general_debug_mode, _this_context_config_getAdsConfig_general;
81802
81914
  this.regionsData = [];
81803
81915
  this.context = context;
81804
81916
  this.regionsObjects = new AdRegionsCollection3();
81805
- this.maxRegions = MAX_REGIONS2;
81917
+ this.maxRegions = ((_this_context_config_getAdsConfig_general = this.context.config.getAdsConfig().general) === null || _this_context_config_getAdsConfig_general === void 0 ? void 0 : (_this_context_config_getAdsConfig_general_debug_mode = _this_context_config_getAdsConfig_general.debug_mode) === null || _this_context_config_getAdsConfig_general_debug_mode === void 0 ? void 0 : _this_context_config_getAdsConfig_general_debug_mode.value) ? Number.MAX_SAFE_INTEGER : MAX_REGIONS2;
81806
81918
  this.regionsContainerView = new RegionsContainerView3(width, height);
81807
81919
  this.regionFactory = new RegionFactory({
81808
81920
  recorder: this.context.recorder,
@@ -81962,10 +82074,10 @@ var NotBasicPresentationMode = /*#__PURE__*/ function() {
81962
82074
  var _this_adPresentationStrategy;
81963
82075
  (_this_adPresentationStrategy = _this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.start();
81964
82076
  } else {
81965
- var _this_adPresentationStrategy1, _adsConfigs_general;
82077
+ var _this_adPresentationStrategy1, _adsConfigs_general_visibility_on_pause, _adsConfigs_general;
81966
82078
  var adsConfigs = _this.context.config.getAdsConfig();
81967
82079
  (_this_adPresentationStrategy1 = _this.adPresentationStrategy) === null || _this_adPresentationStrategy1 === void 0 ? void 0 : _this_adPresentationStrategy1.stop();
81968
- if (!((_adsConfigs_general = adsConfigs.general) === null || _adsConfigs_general === void 0 ? void 0 : _adsConfigs_general.visibility_on_pause)) {
82080
+ if (!((_adsConfigs_general = adsConfigs.general) === null || _adsConfigs_general === void 0 ? void 0 : (_adsConfigs_general_visibility_on_pause = _adsConfigs_general.visibility_on_pause) === null || _adsConfigs_general_visibility_on_pause === void 0 ? void 0 : _adsConfigs_general_visibility_on_pause.value)) {
81969
82081
  var _this_regionsRenderer, _this_auxElementsRenderer;
81970
82082
  (_this_regionsRenderer = _this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
81971
82083
  (_this_auxElementsRenderer = _this.auxElementsRenderer) === null || _this_auxElementsRenderer === void 0 ? void 0 : _this_auxElementsRenderer.clear();
@@ -81983,7 +82095,7 @@ var NotBasicPresentationMode = /*#__PURE__*/ function() {
81983
82095
  (_this_auxElementsRenderer = this.auxElementsRenderer) === null || _this_auxElementsRenderer === void 0 ? void 0 : _this_auxElementsRenderer.attach(this.context.elements.container);
81984
82096
  (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.attach(this.context.elements.container);
81985
82097
  }
81986
- this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config.getStrategySettings());
82098
+ this.adPresentationStrategy = PresentationStrategyFactory.get(this.context.config);
81987
82099
  (_this_adPresentationStrategy = this.adPresentationStrategy) === null || _this_adPresentationStrategy === void 0 ? void 0 : _this_adPresentationStrategy.on("presentation", function() {
81988
82100
  var _this_context_data;
81989
82101
  var regions2 = (_this_context_data = _this.context.data) === null || _this_context_data === void 0 ? void 0 : _this_context_data.check(_this.context.media.currentTime);
@@ -82216,6 +82328,12 @@ var VideoAd = /*#__PURE__*/ function() {
82216
82328
  }
82217
82329
  }
82218
82330
  },
82331
+ {
82332
+ key: "media",
82333
+ get: function get() {
82334
+ return this.videoAdContext.media;
82335
+ }
82336
+ },
82219
82337
  {
82220
82338
  key: "updateRegionData",
82221
82339
  value: function updateRegionData() {
@@ -82361,6 +82479,15 @@ var VideoAds = /*#__PURE__*/ function() {
82361
82479
  }
82362
82480
  }
82363
82481
  },
82482
+ {
82483
+ key: "getVideoAd",
82484
+ value: function getVideoAd(index) {
82485
+ if (index === void 0) {
82486
+ return this.videoAdElements[0];
82487
+ }
82488
+ return this.videoAdElements[index];
82489
+ }
82490
+ },
82364
82491
  {
82365
82492
  key: "destroy",
82366
82493
  value: function destroy() {
@@ -82698,7 +82825,7 @@ var User = /*#__PURE__*/ function() {
82698
82825
  if (this.info.buyerUID) {
82699
82826
  return Promise.resolve(this);
82700
82827
  }
82701
- return fetch("".concat(this.config.get("auth").host, "/authority/tp/user-matching?partner_id=").concat(publisherId, "&pub_user_id=").concat(this.info.id, "&gdpr=").concat(this.consent.gdpr().active ? 1 : 0, "&gdpr_consent=").concat(this.consent.gdpr().tcString)).then(function(response) {
82828
+ return fetch("".concat(this.config.get("auth").host, "/authority/tp/user-matching?partner_id=").concat(publisherId, "&pub_user_id=").concat(this.info.id, "&gdpr=").concat(this.consent.gdpr().gdprApplies ? 1 : 0, "&gdpr_consent=").concat(this.consent.gdpr().tcString)).then(function(response) {
82702
82829
  return response.json();
82703
82830
  }).then(function(data) {
82704
82831
  _this.info.buyerUID = data.remote_user_id;
@@ -86704,8 +86831,7 @@ var BrndtsAds = /*#__PURE__*/ function() {
86704
86831
  try {
86705
86832
  var config2 = new Config(options || {}, adsOptions || {});
86706
86833
  config2.fetch().then(function() {
86707
- var _config2_getAdsConfig_general_debug_mode, _config2_getAdsConfig_general;
86708
- var logger3 = new Logger((_config2_getAdsConfig_general = config2.getAdsConfig().general) === null || _config2_getAdsConfig_general === void 0 ? void 0 : (_config2_getAdsConfig_general_debug_mode = _config2_getAdsConfig_general.debug_mode) === null || _config2_getAdsConfig_general_debug_mode === void 0 ? void 0 : _config2_getAdsConfig_general_debug_mode.value);
86834
+ var logger3 = new Logger(true);
86709
86835
  _this.context = {
86710
86836
  config: config2,
86711
86837
  timers: {},
@@ -86825,6 +86951,21 @@ var BrndtsAds = /*#__PURE__*/ function() {
86825
86951
  }
86826
86952
  }
86827
86953
  },
86954
+ {
86955
+ key: "refreshConfigs",
86956
+ value: function refreshConfigs(options, adsOptions) {
86957
+ if (!this.ready.value) {
86958
+ return;
86959
+ }
86960
+ this.context.config.refresh(options, adsOptions);
86961
+ if (this.context.ads) {
86962
+ var _this_context_ads;
86963
+ (_this_context_ads = this.context.ads) === null || _this_context_ads === void 0 ? void 0 : _this_context_ads.destroy();
86964
+ this.context.ads = new Ads_default(this.context);
86965
+ this.context.ads.start();
86966
+ }
86967
+ }
86968
+ },
86828
86969
  {
86829
86970
  key: "restartControls",
86830
86971
  value: function restartControls(controlsConfig) {
@@ -86832,6 +86973,26 @@ var BrndtsAds = /*#__PURE__*/ function() {
86832
86973
  this.context.config.set("controls", controlsConfig);
86833
86974
  }
86834
86975
  },
86976
+ {
86977
+ key: "rewind",
86978
+ value: function rewind(value2) {
86979
+ var _this_context_ads_videoAds_getVideoAd, _this_context_ads_videoAds, _this_context_ads;
86980
+ if (!this.ready.value) {
86981
+ return;
86982
+ }
86983
+ (_this_context_ads = this.context.ads) === null || _this_context_ads === void 0 ? void 0 : (_this_context_ads_videoAds = _this_context_ads.videoAds) === null || _this_context_ads_videoAds === void 0 ? void 0 : (_this_context_ads_videoAds_getVideoAd = _this_context_ads_videoAds.getVideoAd()) === null || _this_context_ads_videoAds_getVideoAd === void 0 ? void 0 : _this_context_ads_videoAds_getVideoAd.media.rewind(value2);
86984
+ }
86985
+ },
86986
+ {
86987
+ key: "forward",
86988
+ value: function forward(value2) {
86989
+ var _this_context_ads_videoAds_getVideoAd, _this_context_ads_videoAds, _this_context_ads;
86990
+ if (!this.ready.value) {
86991
+ return;
86992
+ }
86993
+ (_this_context_ads = this.context.ads) === null || _this_context_ads === void 0 ? void 0 : (_this_context_ads_videoAds = _this_context_ads.videoAds) === null || _this_context_ads_videoAds === void 0 ? void 0 : (_this_context_ads_videoAds_getVideoAd = _this_context_ads_videoAds.getVideoAd()) === null || _this_context_ads_videoAds_getVideoAd === void 0 ? void 0 : _this_context_ads_videoAds_getVideoAd.media.forward(value2);
86994
+ }
86995
+ },
86835
86996
  {
86836
86997
  key: "destroy",
86837
86998
  value: function destroy() {