@brndts/brndts-ads 1.14.4 → 1.14.6

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
@@ -462,13 +462,13 @@ var __toESM = function(mod, isNodeMode, target) {
462
462
  var require_events = __commonJS({
463
463
  "node_modules/events/events.js": function(exports, module2) {
464
464
  "use strict";
465
- var R = (typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" ? Reflect : null;
466
- var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
465
+ var R2 = (typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" ? Reflect : null;
466
+ var ReflectApply = R2 && typeof R2.apply === "function" ? R2.apply : function ReflectApply2(target, receiver, args) {
467
467
  return Function.prototype.apply.call(target, receiver, args);
468
468
  };
469
469
  var ReflectOwnKeys;
470
- if (R && typeof R.ownKeys === "function") {
471
- ReflectOwnKeys = R.ownKeys;
470
+ if (R2 && typeof R2.ownKeys === "function") {
471
+ ReflectOwnKeys = R2.ownKeys;
472
472
  } else if (Object.getOwnPropertySymbols) {
473
473
  ReflectOwnKeys = function ReflectOwnKeys2(target) {
474
474
  return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
@@ -68541,7 +68541,7 @@ var RegionContent = /*#__PURE__*/ function() {
68541
68541
  {
68542
68542
  key: "renderSandboxedContent",
68543
68543
  value: function renderSandboxedContent() {
68544
- var _iframe_contentWindow, _this_content_extra_sz, _this_content_extra, _this_content, _this_content_extra_sz1, _this_content_extra1, _this_content1;
68544
+ var _this_content_extra_sz, _this_content_extra, _this_content, _this_content_extra_sz1, _this_content_extra1, _this_content1, _this_content_extra_sz2, _this_content_extra2, _this_content2, _this_content_extra_sz3, _this_content_extra3, _this_content3, _iframe_contentWindow;
68545
68545
  var iframe = document.createElement("iframe");
68546
68546
  iframe.name = "prebid_ads_iframe_".concat(this.id);
68547
68547
  iframe.title = "3rd party ad content";
@@ -68558,15 +68558,19 @@ var RegionContent = /*#__PURE__*/ function() {
68558
68558
  iframe.style.border = "0";
68559
68559
  iframe.style.margin = "0";
68560
68560
  iframe.style.overflow = "hidden";
68561
- iframe.style.width = "100%";
68562
- iframe.style.height = "100%";
68561
+ iframe.style.width = "".concat(((_this_content = this.content) === null || _this_content === void 0 ? void 0 : (_this_content_extra = _this_content.extra) === null || _this_content_extra === void 0 ? void 0 : (_this_content_extra_sz = _this_content_extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) ? this.content.extra.sz.w + "px" : "100%", ";");
68562
+ iframe.style.height = "".concat(((_this_content1 = this.content) === null || _this_content1 === void 0 ? void 0 : (_this_content_extra1 = _this_content1.extra) === null || _this_content_extra1 === void 0 ? void 0 : (_this_content_extra_sz1 = _this_content_extra1.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) ? this.content.extra.sz.h + "px" : "100%", ";");
68563
+ iframe.width = "".concat(((_this_content2 = this.content) === null || _this_content2 === void 0 ? void 0 : (_this_content_extra2 = _this_content2.extra) === null || _this_content_extra2 === void 0 ? void 0 : (_this_content_extra_sz2 = _this_content_extra2.sz) === null || _this_content_extra_sz2 === void 0 ? void 0 : _this_content_extra_sz2.w) ? this.content.extra.sz.w : "100%", ";");
68564
+ iframe.height = "".concat(((_this_content3 = this.content) === null || _this_content3 === void 0 ? void 0 : (_this_content_extra3 = _this_content3.extra) === null || _this_content_extra3 === void 0 ? void 0 : (_this_content_extra_sz3 = _this_content_extra3.sz) === null || _this_content_extra_sz3 === void 0 ? void 0 : _this_content_extra_sz3.h) ? this.content.extra.sz.h : "100%", ";");
68565
+ var scale = this.getScaleValue();
68566
+ iframe.style.transform = "scale(".concat(scale.x, ", ").concat(scale.y, ")");
68567
+ iframe.style.transformOrigin = "top left";
68563
68568
  this.container.appendChild(iframe);
68564
68569
  var iframeDoc = (_iframe_contentWindow = iframe.contentWindow) === null || _iframe_contentWindow === void 0 ? void 0 : _iframe_contentWindow.document;
68565
68570
  if (!iframeDoc) return;
68566
68571
  var stringContent = this.content.asStr;
68567
- var scale = this.getScaleValue();
68568
68572
  iframeDoc.open();
68569
- iframeDoc.write('\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n\n html, body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n .ad-container {\n width: '.concat(((_this_content = this.content) === null || _this_content === void 0 ? void 0 : (_this_content_extra = _this_content.extra) === null || _this_content_extra === void 0 ? void 0 : (_this_content_extra_sz = _this_content_extra.sz) === null || _this_content_extra_sz === void 0 ? void 0 : _this_content_extra_sz.w) ? this.content.extra.sz.w + "px" : "100%", ";\n height: ").concat(((_this_content1 = this.content) === null || _this_content1 === void 0 ? void 0 : (_this_content_extra1 = _this_content1.extra) === null || _this_content_extra1 === void 0 ? void 0 : (_this_content_extra_sz1 = _this_content_extra1.sz) === null || _this_content_extra_sz1 === void 0 ? void 0 : _this_content_extra_sz1.h) ? this.content.extra.sz.h + "px" : "100%", ";\n transform: scale(").concat(scale.x, ", ").concat(scale.y, ');\n transform-origin: top left;\n }\n .ad-container > * {\n padding: 0 !important;\n }\n </style>\n </head>\n <body>\n <div class="ad-container">').concat(stringContent, "</div>\n </body>\n </html>\n "));
68573
+ iframeDoc.write('\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n\n html, body {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n .ad-container > * {\n padding: 0 !important;\n }\n </style>\n </head>\n <body>\n <div class="ad-container">'.concat(stringContent, "</div>\n </body>\n </html>\n "));
68570
68574
  iframeDoc.close();
68571
68575
  }
68572
68576
  },
@@ -71634,29 +71638,125 @@ var PrebidConfigBuilder = /*#__PURE__*/ function() {
71634
71638
  {
71635
71639
  key: "addConsent",
71636
71640
  value: function addConsent(consent) {
71637
- if (// @ts-expect-error
71638
- window.__tcfapi !== void 0 && // @ts-expect-error
71639
- typeof window.__tcfapi === "function") {
71640
- this.config.consentManagement = {
71641
+ var hasTcfCmp = typeof window.__tcfapi === "function";
71642
+ var hasGppCmp = typeof window.__gpp === "function";
71643
+ var cm = {};
71644
+ if (hasTcfCmp) {
71645
+ cm.gdpr = {
71641
71646
  cmpApi: "iab",
71642
71647
  timeout: 8e3,
71643
- allowAuctionWithoutConsent: true,
71644
- defaultGdprScope: true
71648
+ defaultGdprScope: true,
71649
+ rules: [
71650
+ {
71651
+ purpose: "basicAds",
71652
+ enforcePurpose: true,
71653
+ enforceVendor: true,
71654
+ softVendorExceptions: [
71655
+ "valuad",
71656
+ "improvedigital"
71657
+ ]
71658
+ },
71659
+ {
71660
+ purpose: "storage",
71661
+ enforcePurpose: true,
71662
+ enforceVendor: true,
71663
+ softVendorExceptions: [
71664
+ "valuad",
71665
+ "improvedigital"
71666
+ ]
71667
+ },
71668
+ // add P4 so UFPD can flow when CMP gives consent
71669
+ {
71670
+ purpose: "personalizedAds",
71671
+ enforcePurpose: true,
71672
+ enforceVendor: true
71673
+ },
71674
+ {
71675
+ purpose: "measurement",
71676
+ enforcePurpose: true,
71677
+ enforceVendor: true
71678
+ }
71679
+ ]
71645
71680
  };
71646
71681
  } else {
71647
- this.config.consentManagement = {
71682
+ var _gdpr_purpose_consents, _gdpr_purpose, _gdpr_purpose_consents1, _gdpr_purpose1, _gdpr_purpose_consents2, _gdpr_purpose2, _gdpr_purpose_consents3, _gdpr_purpose3;
71683
+ var gdpr = typeof consent.gdpr === "function" ? consent.gdpr() : void 0;
71684
+ var _gdpr_gdprApplies, _gdpr_purpose_consents_1, _gdpr_purpose_consents_2, _gdpr_purpose_consents_4, _gdpr_purpose_consents_7;
71685
+ cm.gdpr = {
71648
71686
  cmpApi: "static",
71649
71687
  timeout: 8e3,
71650
- allowAuctionWithoutConsent: true,
71651
71688
  defaultGdprScope: true,
71652
71689
  consentData: {
71653
71690
  getTCData: {
71654
- tcString: consent.gdpr().tcString || "",
71655
- gdprApplies: consent.gdpr().gdprApplies || false
71691
+ tcString: (gdpr === null || gdpr === void 0 ? void 0 : gdpr.tcString) || "",
71692
+ gdprApplies: (_gdpr_gdprApplies = gdpr === null || gdpr === void 0 ? void 0 : gdpr.gdprApplies) !== null && _gdpr_gdprApplies !== void 0 ? _gdpr_gdprApplies : true,
71693
+ // Grant P1, P2, P4, P7 so modules won't be denied in static mode
71694
+ purpose: {
71695
+ consents: {
71696
+ "1": (_gdpr_purpose_consents_1 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose = gdpr.purpose) === null || _gdpr_purpose === void 0 ? void 0 : (_gdpr_purpose_consents = _gdpr_purpose.consents) === null || _gdpr_purpose_consents === void 0 ? void 0 : _gdpr_purpose_consents["1"]) !== null && _gdpr_purpose_consents_1 !== void 0 ? _gdpr_purpose_consents_1 : true,
71697
+ // storage (accessDevice)
71698
+ "2": (_gdpr_purpose_consents_2 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose1 = gdpr.purpose) === null || _gdpr_purpose1 === void 0 ? void 0 : (_gdpr_purpose_consents1 = _gdpr_purpose1.consents) === null || _gdpr_purpose_consents1 === void 0 ? void 0 : _gdpr_purpose_consents1["2"]) !== null && _gdpr_purpose_consents_2 !== void 0 ? _gdpr_purpose_consents_2 : true,
71699
+ // basic ads (fetchBids)
71700
+ "4": (_gdpr_purpose_consents_4 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose2 = gdpr.purpose) === null || _gdpr_purpose2 === void 0 ? void 0 : (_gdpr_purpose_consents2 = _gdpr_purpose2.consents) === null || _gdpr_purpose_consents2 === void 0 ? void 0 : _gdpr_purpose_consents2["4"]) !== null && _gdpr_purpose_consents_4 !== void 0 ? _gdpr_purpose_consents_4 : true,
71701
+ // personalized ads (transmitUfpd)
71702
+ "7": (_gdpr_purpose_consents_7 = gdpr === null || gdpr === void 0 ? void 0 : (_gdpr_purpose3 = gdpr.purpose) === null || _gdpr_purpose3 === void 0 ? void 0 : (_gdpr_purpose_consents3 = _gdpr_purpose3.consents) === null || _gdpr_purpose_consents3 === void 0 ? void 0 : _gdpr_purpose_consents3["7"]) !== null && _gdpr_purpose_consents_7 !== void 0 ? _gdpr_purpose_consents_7 : true
71703
+ }
71704
+ }
71705
+ }
71706
+ },
71707
+ rules: [
71708
+ // In static mode: enforce purpose, skip vendor checks
71709
+ {
71710
+ purpose: "basicAds",
71711
+ enforcePurpose: true,
71712
+ enforceVendor: false
71713
+ },
71714
+ {
71715
+ purpose: "storage",
71716
+ enforcePurpose: true,
71717
+ enforceVendor: false
71718
+ },
71719
+ {
71720
+ purpose: "personalizedAds",
71721
+ enforcePurpose: true,
71722
+ enforceVendor: false
71723
+ },
71724
+ // <-- allows transmitUfpd
71725
+ {
71726
+ purpose: "measurement",
71727
+ enforcePurpose: true,
71728
+ enforceVendor: false
71656
71729
  }
71730
+ ]
71731
+ };
71732
+ this.config.allowActivities = _object_spread_props(_object_spread({}, this.config.allowActivities), {
71733
+ accessDevice: {
71734
+ rules: [
71735
+ {
71736
+ allow: true
71737
+ }
71738
+ ]
71739
+ }
71740
+ });
71741
+ }
71742
+ if (hasGppCmp) {
71743
+ cm.gpp = {
71744
+ cmpApi: "iab",
71745
+ timeout: 8e3
71746
+ };
71747
+ } else {
71748
+ var gpp = typeof consent.gpp === "function" ? consent.gpp() : void 0;
71749
+ cm.gpp = {
71750
+ cmpApi: "static",
71751
+ timeout: 8e3,
71752
+ consentData: {
71753
+ gppString: (gpp === null || gpp === void 0 ? void 0 : gpp.gppString) || "",
71754
+ applicableSections: /* gpp?.applicableSections ?? gpp?.sectionList ?? */ [],
71755
+ sectionList: /* gpp?.sectionList ?? gpp?.applicableSections ?? */ []
71657
71756
  }
71658
71757
  };
71659
71758
  }
71759
+ this.config.consentManagement = cm;
71660
71760
  return this;
71661
71761
  }
71662
71762
  },
@@ -73940,25 +74040,15 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73940
74040
  }
73941
74041
  },
73942
74042
  {
73943
- key: "assurePlaybackState",
73944
- value: function assurePlaybackState(play) {
73945
- if (this.media && this.media.hasPlayed) {
73946
- var _this_instance;
73947
- var newVideoIndex = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.getPlaylistIndex();
73948
- if (newVideoIndex !== this.currentVideoIndex) {
73949
- this.currentVideoIndex = newVideoIndex;
73950
- if (this._source && this._source.type === "playlist") {
73951
- var _this__source;
73952
- this._source.videoId = this.videoId;
73953
- this.emit("UPDATED_SOURCE", (_this__source = this._source) === null || _this__source === void 0 ? void 0 : _this__source.videoId);
73954
- }
73955
- }
74043
+ key: "checkForVideoIdChanges",
74044
+ value: function checkForVideoIdChanges() {
74045
+ if (!this._source || this._source.type !== "playlist") {
74046
+ return;
73956
74047
  }
73957
- if (this.media && play && !this.media.hasPlayed) {
73958
- this.media.hasPlayed = true;
73959
- if (this._source) {
73960
- this._source.videoId = this.videoId;
73961
- }
74048
+ var currentVideoId = this.videoId;
74049
+ if (currentVideoId && currentVideoId.trim() !== "" && currentVideoId !== this._source.videoId) {
74050
+ this._source.videoId = currentVideoId;
74051
+ this.emit("UPDATED_SOURCE", this._source.videoId);
73962
74052
  }
73963
74053
  }
73964
74054
  },
@@ -73987,15 +74077,16 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
73987
74077
  key: "handleYTPlayerReady",
73988
74078
  value: function handleYTPlayerReady(event) {
73989
74079
  var _this = this;
73990
- var _this_instance;
73991
74080
  if (this.instance) {
73992
74081
  this.context.logger.warn("Instance already found!");
73993
74082
  return;
73994
74083
  }
73995
74084
  this.instance = event.target;
73996
- this.currentVideoIndex = (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.getPlaylistIndex();
73997
74085
  this.ready = true;
73998
74086
  this.observeResize();
74087
+ if (this._source && this._source.type === "playlist") {
74088
+ this._source.videoId = this.videoId;
74089
+ }
73999
74090
  this.context.store.dispatch({
74000
74091
  type: "READY"
74001
74092
  });
@@ -74008,6 +74099,7 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74008
74099
  if (newState !== _this.state) {
74009
74100
  _this.handlePlayerStateChange(newState);
74010
74101
  }
74102
+ _this.checkForVideoIdChanges();
74011
74103
  }, 10);
74012
74104
  }
74013
74105
  },
@@ -74029,19 +74121,16 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74029
74121
  case -1:
74030
74122
  break;
74031
74123
  case 0:
74032
- this.assurePlaybackState(false);
74033
74124
  this.context.store.dispatch({
74034
74125
  type: "PAUSE"
74035
74126
  });
74036
74127
  break;
74037
74128
  case 1:
74038
- this.assurePlaybackState(true);
74039
74129
  this.context.store.dispatch({
74040
74130
  type: "PLAY"
74041
74131
  });
74042
74132
  break;
74043
74133
  case 2:
74044
- this.assurePlaybackState(false);
74045
74134
  this.context.store.dispatch({
74046
74135
  type: "PAUSE"
74047
74136
  });
@@ -74298,7 +74387,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74298
74387
  key: "play",
74299
74388
  value: function play() {
74300
74389
  var _this_instance;
74301
- this.assurePlaybackState(true);
74302
74390
  (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.playVideo();
74303
74391
  return Promise.resolve();
74304
74392
  }
@@ -74307,7 +74395,6 @@ var YoutubeMediaElement = /*#__PURE__*/ function(GenericMediaElement) {
74307
74395
  key: "pause",
74308
74396
  value: function pause() {
74309
74397
  var _this_instance;
74310
- this.assurePlaybackState(false);
74311
74398
  (_this_instance = this.instance) === null || _this_instance === void 0 ? void 0 : _this_instance.pauseVideo();
74312
74399
  return Promise.resolve();
74313
74400
  }
@@ -76921,6 +77008,22 @@ var VideoRegionsDataCollection = /*#__PURE__*/ function() {
76921
77008
  }
76922
77009
  return this.missingInfo[keys[keys.length - 1]];
76923
77010
  }
77011
+ },
77012
+ {
77013
+ key: "getLoadedPercentage",
77014
+ value: function getLoadedPercentage() {
77015
+ if (this.isComplete) {
77016
+ return 100;
77017
+ }
77018
+ if (this.timestampList.length === 0) {
77019
+ return 0;
77020
+ }
77021
+ ;
77022
+ var firstMissingTimestamp = Object.keys(this.missingInfo).sort(function(a, b) {
77023
+ return parseFloat(a) - parseFloat(b);
77024
+ })[0];
77025
+ return parseFloat(firstMissingTimestamp) / this.totalLengthSeconds * 100;
77026
+ }
76924
77027
  }
76925
77028
  ]);
76926
77029
  return VideoRegionsDataCollection;
@@ -76952,6 +77055,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76952
77055
  value: function handlePredictionResult(data) {
76953
77056
  var _this_cache;
76954
77057
  this.regionsData.append(data);
77058
+ this.emit("UPDATE");
76955
77059
  (_this_cache = this.cache) === null || _this_cache === void 0 ? void 0 : _this_cache.update(data);
76956
77060
  }
76957
77061
  },
@@ -76960,6 +77064,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
76960
77064
  value: function handlePredictionCompleted() {
76961
77065
  var _this_logger;
76962
77066
  (_this_logger = this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.log("Prediction completed!");
77067
+ this.emit("UPDATE");
76963
77068
  }
76964
77069
  },
76965
77070
  {
@@ -77027,6 +77132,12 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
77027
77132
  return this.regionsData.get(timestamp);
77028
77133
  }
77029
77134
  },
77135
+ {
77136
+ key: "progress",
77137
+ value: function progress() {
77138
+ return this.regionsData.getLoadedPercentage();
77139
+ }
77140
+ },
77030
77141
  {
77031
77142
  key: "dumps",
77032
77143
  value: function dumps(from, to) {
@@ -77052,6 +77163,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
77052
77163
  this.service.send("stop");
77053
77164
  this.service.destroy();
77054
77165
  this.regionsData.load(data);
77166
+ this.emit("UPDATE");
77055
77167
  return;
77056
77168
  }
77057
77169
  if (typeof window === "undefined") {
@@ -77081,6 +77193,7 @@ var VideoRegionsDataManager = /*#__PURE__*/ function(_import_events4_EventEmitte
77081
77193
  _this.service.send("stop");
77082
77194
  _this.service.destroy();
77083
77195
  _this.regionsData.load(parsed);
77196
+ _this.emit("UPDATE");
77084
77197
  } catch (err) {
77085
77198
  var _this_logger;
77086
77199
  (_this_logger = _this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.error("Failed to load data:", err);
@@ -81076,6 +81189,60 @@ var ProgressBar = /*#__PURE__*/ function() {
81076
81189
  ]);
81077
81190
  return ProgressBar;
81078
81191
  }();
81192
+ // src/Ads/VideoAds/UI/Controls/Components/ProgressIndicator.ts
81193
+ var NS = "http://www.w3.org/2000/svg";
81194
+ var BOX_S = 16;
81195
+ var R = 6;
81196
+ var CIRC = 2 * Math.PI * R;
81197
+ var ProgressBanner = /*#__PURE__*/ function() {
81198
+ "use strict";
81199
+ function ProgressBanner() {
81200
+ _class_call_check(this, ProgressBanner);
81201
+ this.view = document.createElement("div");
81202
+ this.view.classList.add("progress-banner");
81203
+ var circleWrap = document.createElement("div");
81204
+ circleWrap.classList.add("progress-circle");
81205
+ circleWrap.style.width = "".concat(BOX_S, "px");
81206
+ circleWrap.style.height = "".concat(BOX_S, "px");
81207
+ var svg = document.createElementNS(NS, "svg");
81208
+ svg.setAttribute("viewBox", "0 0 ".concat(BOX_S, " ").concat(BOX_S));
81209
+ var bg = document.createElementNS(NS, "circle");
81210
+ bg.setAttribute("cx", "".concat(BOX_S / 2));
81211
+ bg.setAttribute("cy", "".concat(BOX_S / 2));
81212
+ bg.setAttribute("r", R.toString());
81213
+ bg.classList.add("bg");
81214
+ svg.appendChild(bg);
81215
+ this.fg = document.createElementNS(NS, "circle");
81216
+ this.fg.setAttribute("cx", "".concat(BOX_S / 2));
81217
+ this.fg.setAttribute("cy", "".concat(BOX_S / 2));
81218
+ this.fg.setAttribute("r", R.toString());
81219
+ this.fg.classList.add("fg");
81220
+ this.fg.setAttribute("stroke-dasharray", "".concat(CIRC));
81221
+ this.fg.setAttribute("stroke-dashoffset", "".concat(CIRC));
81222
+ svg.setAttribute("tabindex", "0");
81223
+ svg.appendChild(this.fg);
81224
+ circleWrap.appendChild(svg);
81225
+ this.view.appendChild(circleWrap);
81226
+ this.view.setAttribute("aria-label", "Video processing is 0% complete.");
81227
+ this.label = document.createElement("span");
81228
+ this.label.classList.add("progress-label");
81229
+ this.view.appendChild(this.label);
81230
+ this.setValue(0);
81231
+ }
81232
+ _create_class(ProgressBanner, [
81233
+ {
81234
+ /** Update the banner (0 – 100) */ key: "setValue",
81235
+ value: function setValue(value2) {
81236
+ var offset = CIRC - value2 / 100 * CIRC;
81237
+ this.fg.setAttribute("stroke-dashoffset", "".concat(offset));
81238
+ var text2 = "Video processing is ".concat(Math.ceil(value2), "% complete.");
81239
+ this.label.textContent = text2;
81240
+ this.view.setAttribute("aria-label", text2);
81241
+ }
81242
+ }
81243
+ ]);
81244
+ return ProgressBanner;
81245
+ }();
81079
81246
  // src/Ads/VideoAds/UI/Controls/Components/BottomBar/ControlBottomBar.ts
81080
81247
  var ControlBottomBar = /*#__PURE__*/ function() {
81081
81248
  "use strict";
@@ -81215,6 +81382,47 @@ var DailymotionBottomBar = /*#__PURE__*/ function() {
81215
81382
  ]);
81216
81383
  return DailymotionBottomBar;
81217
81384
  }();
81385
+ var NativeBottomBar = /*#__PURE__*/ function() {
81386
+ "use strict";
81387
+ function NativeBottomBar(context, events) {
81388
+ var _this = this;
81389
+ _class_call_check(this, NativeBottomBar);
81390
+ this.buttons = {};
81391
+ this.context = context;
81392
+ this.events = events;
81393
+ this.controlsContainer = document.createElement("div");
81394
+ this.controlsContainer.id = "BRNDTS_CTLBB";
81395
+ this.controlsContainer.dataset.type = "N_CTLBB";
81396
+ var topElement = document.createElement("div");
81397
+ topElement.classList.add("BRNDTS_CTLBB_TOP");
81398
+ this.controlsContainer.appendChild(topElement);
81399
+ var ind = new ProgressBanner();
81400
+ this.context.store.subscribe(this.handleStateChange.bind(this));
81401
+ this.context.data.on("UPDATE", function() {
81402
+ ind.setValue(_this.context.data.progress());
81403
+ });
81404
+ topElement.appendChild(ind.view);
81405
+ }
81406
+ _create_class(NativeBottomBar, [
81407
+ {
81408
+ key: "handleStateChange",
81409
+ value: function handleStateChange(state) {}
81410
+ },
81411
+ {
81412
+ key: "view",
81413
+ get: function get() {
81414
+ return this.controlsContainer;
81415
+ }
81416
+ },
81417
+ {
81418
+ key: "destroy",
81419
+ value: function destroy() {
81420
+ this.view.remove();
81421
+ }
81422
+ }
81423
+ ]);
81424
+ return NativeBottomBar;
81425
+ }();
81218
81426
  // src/Ads/VideoAds/UI/Controls/Controls.ts
81219
81427
  var Controls = /*#__PURE__*/ function() {
81220
81428
  "use strict";
@@ -81257,7 +81465,12 @@ var Controls = /*#__PURE__*/ function() {
81257
81465
  this.container.appendChild(this.controlBottomBar.view);
81258
81466
  }
81259
81467
  if (this.context.media.is("NATIVE")) {
81468
+ var _this_context_config_get_elements, _this_context_config_get1;
81260
81469
  this.setTopBar();
81470
+ if ((_this_context_config_get1 = this.context.config.get("controls")) === null || _this_context_config_get1 === void 0 ? void 0 : (_this_context_config_get_elements = _this_context_config_get1.elements) === null || _this_context_config_get_elements === void 0 ? void 0 : _this_context_config_get_elements.progress_ind) {
81471
+ this.controlBottomBar = new NativeBottomBar(this.context, this.events);
81472
+ this.container.appendChild(this.controlBottomBar.view);
81473
+ }
81261
81474
  }
81262
81475
  }
81263
81476
  }
@@ -83913,6 +84126,12 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83913
84126
  return this.component.on(event, handler);
83914
84127
  }
83915
84128
  },
84129
+ {
84130
+ key: "off",
84131
+ value: function off(event, handler) {
84132
+ return this.component.off(event, handler);
84133
+ }
84134
+ },
83916
84135
  {
83917
84136
  key: "fetch",
83918
84137
  value: function fetch1() {
@@ -83931,6 +84150,12 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83931
84150
  return this.component.check(timestamp);
83932
84151
  }
83933
84152
  },
84153
+ {
84154
+ key: "progress",
84155
+ value: function progress() {
84156
+ return this.component.progress();
84157
+ }
84158
+ },
83934
84159
  {
83935
84160
  key: "get",
83936
84161
  value: function get(timestamp) {
@@ -83951,8 +84176,8 @@ var VideoRegionsDataManagerDecorator = /*#__PURE__*/ function() {
83951
84176
  },
83952
84177
  {
83953
84178
  key: "loads",
83954
- value: function loads() {
83955
- return this.component.loads();
84179
+ value: function loads(data) {
84180
+ return this.component.loads(data);
83956
84181
  }
83957
84182
  }
83958
84183
  ]);
@@ -84191,7 +84416,7 @@ var VideoRegionsDecoratorFactory = /*#__PURE__*/ function() {
84191
84416
  minDuration: params.minimum_display_time.value
84192
84417
  });
84193
84418
  }
84194
- if ((_params_ad_placements_and_sizes = params.ad_placements_and_sizes) === null || _params_ad_placements_and_sizes === void 0 ? void 0 : _params_ad_placements_and_sizes.value) {
84419
+ if (((_params_ad_placements_and_sizes = params.ad_placements_and_sizes) === null || _params_ad_placements_and_sizes === void 0 ? void 0 : _params_ad_placements_and_sizes.value) !== void 0) {
84195
84420
  target = new VideoRegionsTypeFilterDecorator(target, params.ad_placements_and_sizes);
84196
84421
  }
84197
84422
  return target;
@@ -84271,7 +84496,7 @@ var VideoAd = /*#__PURE__*/ function() {
84271
84496
  {
84272
84497
  key: "handleInfo",
84273
84498
  value: function handleInfo(data) {
84274
- var _this_presentation;
84499
+ var _this_presentation, _this_presentation1;
84275
84500
  if (!data.video) {
84276
84501
  ErrorHandler.handle(new InternalError("Setup failed: no video identifier"));
84277
84502
  return;
@@ -84306,6 +84531,7 @@ var VideoAd = /*#__PURE__*/ function() {
84306
84531
  ts: 0
84307
84532
  });
84308
84533
  (_this_presentation = this.presentation) === null || _this_presentation === void 0 ? void 0 : _this_presentation.setup();
84534
+ (_this_presentation1 = this.presentation) === null || _this_presentation1 === void 0 ? void 0 : _this_presentation1.start();
84309
84535
  }
84310
84536
  },
84311
84537
  {