@brndts/brndts-ads 1.14.16 → 1.14.18

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
@@ -55196,18 +55196,18 @@ var BrowserClient = /*#__PURE__*/ function(BaseClient) {
55196
55196
  function BrowserClient(options) {
55197
55197
  _class_call_check(this, BrowserClient);
55198
55198
  var _this;
55199
- var opts = _object_spread({
55199
+ var opts2 = _object_spread({
55200
55200
  // We default this to true, as it is the safer scenario
55201
55201
  parentSpanIsAlwaysRootSpan: true
55202
55202
  }, options);
55203
55203
  var sdkSource = WINDOW4.SENTRY_SDK_SOURCE || getSDKSource();
55204
- applySdkMetadata(opts, "browser", [
55204
+ applySdkMetadata(opts2, "browser", [
55205
55205
  "browser"
55206
55206
  ], sdkSource);
55207
55207
  _this = _call_super(this, BrowserClient, [
55208
- opts
55208
+ opts2
55209
55209
  ]);
55210
- if (opts.sendClientReports && WINDOW4.document) {
55210
+ if (opts2.sendClientReports && WINDOW4.document) {
55211
55211
  WINDOW4.document.addEventListener("visibilitychange", function() {
55212
55212
  if (WINDOW4.document.visibilityState === "hidden") {
55213
55213
  _this._flushOutcomes();
@@ -55341,7 +55341,7 @@ var initMetric = function(name, value2) {
55341
55341
  };
55342
55342
  };
55343
55343
  // node_modules/@sentry-internal/browser-utils/build/esm/metrics/web-vitals/lib/observe.js
55344
- var observe = function(type, callback, opts) {
55344
+ var observe = function(type, callback, opts2) {
55345
55345
  try {
55346
55346
  if (PerformanceObserver.supportedEntryTypes.includes(type)) {
55347
55347
  var po2 = new PerformanceObserver(function(list) {
@@ -55352,7 +55352,7 @@ var observe = function(type, callback, opts) {
55352
55352
  po2.observe(Object.assign({
55353
55353
  type: type,
55354
55354
  buffered: true
55355
- }, opts || {}));
55355
+ }, opts2 || {}));
55356
55356
  return po2;
55357
55357
  }
55358
55358
  } catch (e2) {}
@@ -55426,7 +55426,7 @@ var FCPThresholds = [
55426
55426
  3e3
55427
55427
  ];
55428
55428
  var onFCP = function(onReport) {
55429
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55429
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55430
55430
  whenActivated(function() {
55431
55431
  var visibilityWatcher = getVisibilityWatcher();
55432
55432
  var metric = initMetric("FCP");
@@ -55445,7 +55445,7 @@ var onFCP = function(onReport) {
55445
55445
  };
55446
55446
  var po2 = observe("paint", handleEntries);
55447
55447
  if (po2) {
55448
- report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges);
55448
+ report = bindReporter(onReport, metric, FCPThresholds, opts2.reportAllChanges);
55449
55449
  }
55450
55450
  });
55451
55451
  };
@@ -55455,7 +55455,7 @@ var CLSThresholds = [
55455
55455
  0.25
55456
55456
  ];
55457
55457
  var onCLS = function(onReport) {
55458
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55458
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55459
55459
  onFCP(runOnce(function() {
55460
55460
  var metric = initMetric("CLS", 0);
55461
55461
  var report;
@@ -55485,7 +55485,7 @@ var onCLS = function(onReport) {
55485
55485
  };
55486
55486
  var po2 = observe("layout-shift", handleEntries);
55487
55487
  if (po2) {
55488
- report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges);
55488
+ report = bindReporter(onReport, metric, CLSThresholds, opts2.reportAllChanges);
55489
55489
  onHidden(function() {
55490
55490
  handleEntries(po2.takeRecords());
55491
55491
  report(true);
@@ -55500,7 +55500,7 @@ var FIDThresholds = [
55500
55500
  300
55501
55501
  ];
55502
55502
  var onFID = function(onReport) {
55503
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55503
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55504
55504
  whenActivated(function() {
55505
55505
  var visibilityWatcher = getVisibilityWatcher();
55506
55506
  var metric = initMetric("FID");
@@ -55516,7 +55516,7 @@ var onFID = function(onReport) {
55516
55516
  entries.forEach(handleEntry);
55517
55517
  };
55518
55518
  var po2 = observe("first-input", handleEntries);
55519
- report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges);
55519
+ report = bindReporter(onReport, metric, FIDThresholds, opts2.reportAllChanges);
55520
55520
  if (po2) {
55521
55521
  onHidden(runOnce(function() {
55522
55522
  handleEntries(po2.takeRecords());
@@ -55621,7 +55621,7 @@ var INPThresholds = [
55621
55621
  500
55622
55622
  ];
55623
55623
  var onINP = function(onReport) {
55624
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55624
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55625
55625
  if (!("PerformanceEventTiming" in WINDOW5 && "interactionId" in PerformanceEventTiming.prototype)) {
55626
55626
  return;
55627
55627
  }
@@ -55647,9 +55647,9 @@ var onINP = function(onReport) {
55647
55647
  // and performance. Running this callback for any interaction that spans
55648
55648
  // just one or two frames is likely not worth the insight that could be
55649
55649
  // gained.
55650
- durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : DEFAULT_DURATION_THRESHOLD
55650
+ durationThreshold: opts2.durationThreshold != null ? opts2.durationThreshold : DEFAULT_DURATION_THRESHOLD
55651
55651
  });
55652
- report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges);
55652
+ report = bindReporter(onReport, metric, INPThresholds, opts2.reportAllChanges);
55653
55653
  if (po2) {
55654
55654
  po2.observe({
55655
55655
  type: "first-input",
@@ -55669,13 +55669,13 @@ var LCPThresholds = [
55669
55669
  ];
55670
55670
  var reportedMetricIDs = {};
55671
55671
  var onLCP = function(onReport) {
55672
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55672
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55673
55673
  whenActivated(function() {
55674
55674
  var visibilityWatcher = getVisibilityWatcher();
55675
55675
  var metric = initMetric("LCP");
55676
55676
  var report;
55677
55677
  var handleEntries = function(entries) {
55678
- if (!opts.reportAllChanges) {
55678
+ if (!opts2.reportAllChanges) {
55679
55679
  entries = entries.slice(-1);
55680
55680
  }
55681
55681
  entries.forEach(function(entry) {
@@ -55690,7 +55690,7 @@ var onLCP = function(onReport) {
55690
55690
  };
55691
55691
  var po2 = observe("largest-contentful-paint", handleEntries);
55692
55692
  if (po2) {
55693
- report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges);
55693
+ report = bindReporter(onReport, metric, LCPThresholds, opts2.reportAllChanges);
55694
55694
  var stopListening = runOnce(function() {
55695
55695
  if (!reportedMetricIDs[metric.id]) {
55696
55696
  handleEntries(po2.takeRecords());
@@ -55735,9 +55735,9 @@ var whenReady = function(callback) {
55735
55735
  }
55736
55736
  };
55737
55737
  var onTTFB = function(onReport) {
55738
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55738
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
55739
55739
  var metric = initMetric("TTFB");
55740
- var report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges);
55740
+ var report = bindReporter(onReport, metric, TTFBThresholds, opts2.reportAllChanges);
55741
55741
  whenReady(function() {
55742
55742
  var navigationEntry = getNavigationEntry();
55743
55743
  if (navigationEntry) {
@@ -62849,9 +62849,9 @@ function makeReplayLogger() {
62849
62849
  infoTick: function() {
62850
62850
  return void 0;
62851
62851
  },
62852
- setConfig: function(opts) {
62853
- _capture = opts.captureExceptions;
62854
- _trace = opts.traceInternals;
62852
+ setConfig: function(opts2) {
62853
+ _capture = opts2.captureExceptions;
62854
+ _trace = opts2.traceInternals;
62855
62855
  }
62856
62856
  };
62857
62857
  if (DEBUG_BUILD5) {
@@ -69402,9 +69402,9 @@ var RegionMaskPlugin = /*#__PURE__*/ function() {
69402
69402
  // src/Ads/Regions/Plugins/Border/RegionBorderPlugin.ts
69403
69403
  var RegionBorderPlugin = /*#__PURE__*/ function() {
69404
69404
  "use strict";
69405
- function RegionBorderPlugin(opts) {
69405
+ function RegionBorderPlugin(opts2) {
69406
69406
  _class_call_check(this, RegionBorderPlugin);
69407
- this.options = opts;
69407
+ this.options = opts2;
69408
69408
  }
69409
69409
  _create_class(RegionBorderPlugin, [
69410
69410
  {
@@ -69843,6 +69843,254 @@ var TYPE_AND_DIMENSIONS = {
69843
69843
  ]
69844
69844
  ]
69845
69845
  };
69846
+ var BREAKPOINTS = {
69847
+ "large-desktop": 1280,
69848
+ "desktop": 1024,
69849
+ "tablet": 768,
69850
+ "mobile": 0
69851
+ };
69852
+ var RULES = {
69853
+ "billboard": {
69854
+ "large-desktop": [
69855
+ [
69856
+ 970,
69857
+ 250
69858
+ ],
69859
+ [
69860
+ 970,
69861
+ 90
69862
+ ]
69863
+ ],
69864
+ // allow billboard + super lb
69865
+ "desktop": [
69866
+ [
69867
+ 970,
69868
+ 250
69869
+ ],
69870
+ [
69871
+ 970,
69872
+ 90
69873
+ ]
69874
+ ],
69875
+ // drop 970x250, still wide
69876
+ "tablet": [
69877
+ [
69878
+ 728,
69879
+ 90
69880
+ ],
69881
+ [
69882
+ 468,
69883
+ 60
69884
+ ]
69885
+ ]
69886
+ },
69887
+ "leaderboard": {
69888
+ "large-desktop": [
69889
+ [
69890
+ 728,
69891
+ 90
69892
+ ],
69893
+ [
69894
+ 468,
69895
+ 60
69896
+ ]
69897
+ ],
69898
+ "desktop": [
69899
+ [
69900
+ 728,
69901
+ 90
69902
+ ],
69903
+ [
69904
+ 468,
69905
+ 60
69906
+ ]
69907
+ ],
69908
+ "tablet": [
69909
+ [
69910
+ 728,
69911
+ 90
69912
+ ],
69913
+ [
69914
+ 468,
69915
+ 60
69916
+ ]
69917
+ ],
69918
+ "mobile": [
69919
+ [
69920
+ 728,
69921
+ 90
69922
+ ],
69923
+ [
69924
+ 468,
69925
+ 60
69926
+ ],
69927
+ [
69928
+ 320,
69929
+ 50
69930
+ ],
69931
+ [
69932
+ 300,
69933
+ 50
69934
+ ]
69935
+ ]
69936
+ },
69937
+ "large-rectangle": {
69938
+ "large-desktop": [
69939
+ [
69940
+ 300,
69941
+ 600
69942
+ ],
69943
+ [
69944
+ 160,
69945
+ 600
69946
+ ]
69947
+ ],
69948
+ "desktop": [
69949
+ [
69950
+ 300,
69951
+ 600
69952
+ ],
69953
+ [
69954
+ 160,
69955
+ 600
69956
+ ]
69957
+ ],
69958
+ "tablet": [
69959
+ [
69960
+ 160,
69961
+ 600
69962
+ ],
69963
+ [
69964
+ 120,
69965
+ 600
69966
+ ]
69967
+ ]
69968
+ },
69969
+ "medium-rectangle": {
69970
+ "large-desktop": [
69971
+ [
69972
+ 300,
69973
+ 250
69974
+ ],
69975
+ [
69976
+ 250,
69977
+ 250
69978
+ ],
69979
+ [
69980
+ 200,
69981
+ 200
69982
+ ]
69983
+ ],
69984
+ "desktop": [
69985
+ [
69986
+ 300,
69987
+ 250
69988
+ ],
69989
+ [
69990
+ 250,
69991
+ 250
69992
+ ],
69993
+ [
69994
+ 200,
69995
+ 200
69996
+ ]
69997
+ ],
69998
+ "tablet": [
69999
+ [
70000
+ 300,
70001
+ 250
70002
+ ],
70003
+ [
70004
+ 250,
70005
+ 250
70006
+ ],
70007
+ [
70008
+ 200,
70009
+ 200
70010
+ ],
70011
+ [
70012
+ 180,
70013
+ 150
70014
+ ]
70015
+ ],
70016
+ "mobile": [
70017
+ [
70018
+ 300,
70019
+ 250
70020
+ ],
70021
+ [
70022
+ 250,
70023
+ 250
70024
+ ],
70025
+ [
70026
+ 180,
70027
+ 150
70028
+ ],
70029
+ [
70030
+ 150,
70031
+ 150
70032
+ ]
70033
+ ]
70034
+ },
70035
+ "smartphone-banner": {
70036
+ "large-desktop": [
70037
+ [
70038
+ 320,
70039
+ 50
70040
+ ],
70041
+ [
70042
+ 300,
70043
+ 50
70044
+ ],
70045
+ [
70046
+ 320,
70047
+ 100
70048
+ ]
70049
+ ],
70050
+ "desktop": [
70051
+ [
70052
+ 320,
70053
+ 50
70054
+ ],
70055
+ [
70056
+ 300,
70057
+ 50
70058
+ ],
70059
+ [
70060
+ 320,
70061
+ 100
70062
+ ]
70063
+ ],
70064
+ "tablet": [
70065
+ [
70066
+ 320,
70067
+ 50
70068
+ ],
70069
+ [
70070
+ 300,
70071
+ 50
70072
+ ],
70073
+ [
70074
+ 320,
70075
+ 100
70076
+ ]
70077
+ ],
70078
+ "mobile": [
70079
+ [
70080
+ 320,
70081
+ 50
70082
+ ],
70083
+ [
70084
+ 300,
70085
+ 50
70086
+ ],
70087
+ [
70088
+ 320,
70089
+ 100
70090
+ ]
70091
+ ]
70092
+ }
70093
+ };
69846
70094
  var REGIONS = [
69847
70095
  {
69848
70096
  id: 1,
@@ -70178,6 +70426,30 @@ var RegionDefinitions = /*#__PURE__*/ function() {
70178
70426
  return REGIONS;
70179
70427
  }
70180
70428
  },
70429
+ {
70430
+ key: "BREAKPOINTS",
70431
+ get: function get() {
70432
+ return BREAKPOINTS;
70433
+ }
70434
+ },
70435
+ {
70436
+ key: "RULES",
70437
+ get: function get() {
70438
+ return RULES;
70439
+ }
70440
+ },
70441
+ {
70442
+ key: "mapping",
70443
+ value: function mapping(type) {
70444
+ return RULES[type];
70445
+ }
70446
+ },
70447
+ {
70448
+ key: "getBreakpointsSize",
70449
+ value: function getBreakpointsSize(breakpointLabel) {
70450
+ return BREAKPOINTS[breakpointLabel];
70451
+ }
70452
+ },
70181
70453
  {
70182
70454
  key: "approxRegionByRatio",
70183
70455
  value: function approxRegionByRatio(w2, h) {
@@ -71675,6 +71947,13 @@ var PrebidConfigBuilder = /*#__PURE__*/ function() {
71675
71947
  return this;
71676
71948
  }
71677
71949
  },
71950
+ {
71951
+ key: "setSizeConfiguration",
71952
+ value: function setSizeConfiguration(config2) {
71953
+ this.config.sizeConfig = config2;
71954
+ return this;
71955
+ }
71956
+ },
71678
71957
  {
71679
71958
  key: "addConsent",
71680
71959
  value: function addConsent(consent) {
@@ -72195,6 +72474,49 @@ var Prebid = /*#__PURE__*/ function() {
72195
72474
  }();
72196
72475
  // src/Ads/Providers/Prebidjs/PrebidGAMProvider.ts
72197
72476
  var FALLBACK_GAM_NETWORK_ID = "23256716895";
72477
+ function toMediaQuery(minWidth) {
72478
+ return "(min-width: ".concat(minWidth, "px)");
72479
+ }
72480
+ function buildPrebidSizeConfig(rules) {
72481
+ var byBp = {
72482
+ "large-desktop": /* @__PURE__ */ new Set(),
72483
+ "desktop": /* @__PURE__ */ new Set(),
72484
+ "tablet": /* @__PURE__ */ new Set(),
72485
+ "mobile": /* @__PURE__ */ new Set()
72486
+ };
72487
+ Object.values(rules).forEach(function(perType) {
72488
+ Object.keys(perType).forEach(function(bp) {
72489
+ var _perType_bp;
72490
+ (_perType_bp = perType[bp]) === null || _perType_bp === void 0 ? void 0 : _perType_bp.forEach(function(param) {
72491
+ var _param = _sliced_to_array(param, 2), w2 = _param[0], h = _param[1];
72492
+ return byBp[bp].add("".concat(w2, "x").concat(h));
72493
+ });
72494
+ });
72495
+ });
72496
+ var toSizes = function(set) {
72497
+ return Array.from(set).map(function(s2) {
72498
+ return s2.split("x").map(Number);
72499
+ });
72500
+ };
72501
+ var ordered = [
72502
+ "large-desktop",
72503
+ "desktop",
72504
+ "tablet",
72505
+ "mobile"
72506
+ ];
72507
+ return ordered.filter(function(bp) {
72508
+ return byBp[bp].size > 0;
72509
+ }).map(function(bp) {
72510
+ return {
72511
+ // @ts-expect-error
72512
+ mediaQuery: toMediaQuery(RegionDefinitions.BREAKPOINTS[bp]),
72513
+ sizesSupported: toSizes(byBp[bp]),
72514
+ labels: [
72515
+ bp
72516
+ ]
72517
+ };
72518
+ });
72519
+ }
72198
72520
  var PrebidGAMEvents = /*#__PURE__*/ function() {
72199
72521
  "use strict";
72200
72522
  function PrebidGAMEvents() {
@@ -72249,38 +72571,6 @@ var GPT = /*#__PURE__*/ function() {
72249
72571
  });
72250
72572
  }
72251
72573
  },
72252
- {
72253
- key: "defineSlot",
72254
- value: function defineSlot(slotId, size, containerId, targeting) {
72255
- window.googletag.cmd.push(function() {
72256
- if (window.googletag.pubads().getSlots().some(function(slot) {
72257
- return slot.getSlotElementId() === containerId;
72258
- })) {
72259
- return;
72260
- }
72261
- var mrec1 = window.googletag.defineSlot(slotId, size, "".concat(containerId)).addService(window.googletag.pubads());
72262
- var mrecmapping = window.googletag.sizeMapping().addSize([
72263
- 1024,
72264
- 0
72265
- ], size).addSize([
72266
- 728,
72267
- 0
72268
- ], size).addSize([
72269
- 320,
72270
- 0
72271
- ], size).addSize([
72272
- 0,
72273
- 0
72274
- ], []).build();
72275
- mrec1 === null || mrec1 === void 0 ? void 0 : mrec1.defineSizeMapping(mrecmapping);
72276
- if (targeting) {
72277
- mrec1.setConfig({
72278
- targeting: targeting
72279
- });
72280
- }
72281
- });
72282
- }
72283
- },
72284
72574
  {
72285
72575
  key: "start",
72286
72576
  value: function start() {
@@ -72298,6 +72588,70 @@ var GPT = /*#__PURE__*/ function() {
72298
72588
  });
72299
72589
  }
72300
72590
  },
72591
+ {
72592
+ key: "defineSlot",
72593
+ value: function defineSlot(slotId, size, containerId, opts2) {
72594
+ window.googletag.cmd.push(function() {
72595
+ if (window.googletag.pubads().getSlots().some(function(slot) {
72596
+ return slot.getSlotElementId() === containerId;
72597
+ })) {
72598
+ return;
72599
+ }
72600
+ var mrec1 = window.googletag.defineSlot(slotId, size, "".concat(containerId)).addService(window.googletag.pubads());
72601
+ var mrecmapping;
72602
+ if (opts2 === null || opts2 === void 0 ? void 0 : opts2.mapping) {
72603
+ mrecmapping = window.googletag.sizeMapping();
72604
+ var sortedBreakpoints = Object.keys(opts2.mapping).sort(function(a, b) {
72605
+ return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
72606
+ });
72607
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72608
+ try {
72609
+ for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
72610
+ var bp = _step.value;
72611
+ mrecmapping = mrecmapping.addSize([
72612
+ RegionDefinitions.BREAKPOINTS[bp],
72613
+ 0
72614
+ ], opts2.mapping[bp]);
72615
+ }
72616
+ } catch (err) {
72617
+ _didIteratorError = true;
72618
+ _iteratorError = err;
72619
+ } finally{
72620
+ try {
72621
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
72622
+ _iterator.return();
72623
+ }
72624
+ } finally{
72625
+ if (_didIteratorError) {
72626
+ throw _iteratorError;
72627
+ }
72628
+ }
72629
+ }
72630
+ mrecmapping = mrecmapping.build();
72631
+ } else {
72632
+ window.googletag.sizeMapping().addSize([
72633
+ 1024,
72634
+ 0
72635
+ ], size).addSize([
72636
+ 728,
72637
+ 0
72638
+ ], size).addSize([
72639
+ 320,
72640
+ 0
72641
+ ], size).addSize([
72642
+ 0,
72643
+ 0
72644
+ ], []).build();
72645
+ }
72646
+ mrec1 === null || mrec1 === void 0 ? void 0 : mrec1.defineSizeMapping(mrecmapping);
72647
+ if (opts2 === null || opts2 === void 0 ? void 0 : opts2.targeting) {
72648
+ mrec1.setConfig({
72649
+ targeting: opts2 === null || opts2 === void 0 ? void 0 : opts2.targeting
72650
+ });
72651
+ }
72652
+ });
72653
+ }
72654
+ },
72301
72655
  {
72302
72656
  key: "queue",
72303
72657
  value: function queue(callback) {
@@ -72359,7 +72713,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
72359
72713
  params: {}
72360
72714
  }
72361
72715
  ]
72362
- }).addConsent(context.consent);
72716
+ }).setSizeConfiguration(buildPrebidSizeConfig(RegionDefinitions.RULES)).addConsent(context.consent);
72363
72717
  (_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.setConfig(configBuilder.build());
72364
72718
  (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : _window_pbjs1.enableAnalytics({
72365
72719
  provider: "smartyads"
@@ -72406,31 +72760,6 @@ var PrebidGAM = /*#__PURE__*/ function() {
72406
72760
  return gamNetworkId;
72407
72761
  }
72408
72762
  },
72409
- {
72410
- key: "defineSlots",
72411
- value: function defineSlots(options) {
72412
- var _window_pbjs_que, _window_pbjs;
72413
- var gamNetwork = _PrebidGAM.getProperGAMNetworkId(options);
72414
- options.units.forEach(function(unit) {
72415
- var _unit_mediaTypes_banner;
72416
- var sizes = ((_unit_mediaTypes_banner = unit.mediaTypes.banner) === null || _unit_mediaTypes_banner === void 0 ? void 0 : _unit_mediaTypes_banner.sizes) || [];
72417
- GPT.defineSlot("/".concat(gamNetwork, "/banner"), sizes, unit.code);
72418
- });
72419
- (_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() {
72420
- var _window_pbjs;
72421
- if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
72422
- window.pbjs.addAdUnits(options.units.filter(function(unit) {
72423
- var _window_pbjs;
72424
- return !((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
72425
- return "".concat(unit.code) === "".concat(defUnit.code);
72426
- }));
72427
- }));
72428
- } else {
72429
- console.error("addAdUnits is not a function.");
72430
- }
72431
- });
72432
- }
72433
- },
72434
72763
  {
72435
72764
  key: "defineSlot",
72436
72765
  value: function defineSlot(options, slotId, containerId, adType) {
@@ -72441,12 +72770,14 @@ var PrebidGAM = /*#__PURE__*/ function() {
72441
72770
  return unit.code === "".concat(slotId);
72442
72771
  });
72443
72772
  var sizes = [];
72773
+ var mapping = void 0;
72444
72774
  if (!unitDefinition) {
72445
72775
  console.error("No unit definition found for slotId: ".concat(slotId));
72446
72776
  return;
72447
72777
  }
72448
72778
  if (adType) {
72449
72779
  sizes = RegionDefinitions.TYPE_AND_DIMENSIONS[adType];
72780
+ mapping = RegionDefinitions.mapping(adType);
72450
72781
  } else {
72451
72782
  var _unitDefinition_mediaTypes_banner;
72452
72783
  sizes = ((_unitDefinition_mediaTypes_banner = unitDefinition.mediaTypes.banner) === null || _unitDefinition_mediaTypes_banner === void 0 ? void 0 : _unitDefinition_mediaTypes_banner.sizes) || [];
@@ -72458,9 +72789,10 @@ var PrebidGAM = /*#__PURE__*/ function() {
72458
72789
  brndts_zid: unitDefinition.zoneId
72459
72790
  };
72460
72791
  }
72461
- GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), [
72462
- sizes[0] || []
72463
- ], "".concat(containerId), targeting);
72792
+ GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId), {
72793
+ targeting: targeting,
72794
+ mapping: mapping
72795
+ });
72464
72796
  if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
72465
72797
  return "".concat(containerId) === "".concat(defUnit.code);
72466
72798
  }))) {
@@ -72468,15 +72800,51 @@ var PrebidGAM = /*#__PURE__*/ function() {
72468
72800
  (_window_pbjs1 = window.pbjs) === null || _window_pbjs1 === void 0 ? void 0 : (_window_pbjs_que = _window_pbjs1.que) === null || _window_pbjs_que === void 0 ? void 0 : _window_pbjs_que.push(function() {
72469
72801
  var _window_pbjs;
72470
72802
  if ((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.addAdUnits) {
72803
+ var adUnit = _object_spread_props(_object_spread({}, unitDefinition), {
72804
+ mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
72805
+ banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
72806
+ sizes: sizes
72807
+ })
72808
+ }),
72809
+ code: "".concat(containerId)
72810
+ });
72811
+ if (mapping) {
72812
+ var mappedSizes = [];
72813
+ var sortedBreakpoints = Object.keys(mapping).sort(function(a, b) {
72814
+ return parseInt(RegionDefinitions.BREAKPOINTS[b], 10) - parseInt(RegionDefinitions.BREAKPOINTS[a], 10);
72815
+ });
72816
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72817
+ try {
72818
+ for(var _iterator = sortedBreakpoints[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
72819
+ var bp = _step.value;
72820
+ mappedSizes.push({
72821
+ minViewPort: [
72822
+ RegionDefinitions.BREAKPOINTS[bp],
72823
+ 0
72824
+ ],
72825
+ sizes: opts.mapping[bp]
72826
+ });
72827
+ }
72828
+ } catch (err) {
72829
+ _didIteratorError = true;
72830
+ _iteratorError = err;
72831
+ } finally{
72832
+ try {
72833
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
72834
+ _iterator.return();
72835
+ }
72836
+ } finally{
72837
+ if (_didIteratorError) {
72838
+ throw _iteratorError;
72839
+ }
72840
+ }
72841
+ }
72842
+ adUnit.mediaTypes.banner.sizeConfig = mappedSizes;
72843
+ } else {
72844
+ adUnit.mediaTypes.banner.sizes = sizes;
72845
+ }
72471
72846
  window.pbjs.addAdUnits([
72472
- _object_spread_props(_object_spread({}, unitDefinition), {
72473
- mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
72474
- banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
72475
- sizes: sizes
72476
- })
72477
- }),
72478
- code: "".concat(containerId)
72479
- })
72847
+ adUnit
72480
72848
  ]);
72481
72849
  } else {
72482
72850
  console.error("addAdUnits is not a function.");
@@ -72516,7 +72884,7 @@ var PrebidGAM = /*#__PURE__*/ function() {
72516
72884
  var container = document.createElement("div");
72517
72885
  container.id = containerId;
72518
72886
  var script = document.createElement("script");
72519
- script.innerHTML = '\n window.googletag.cmd.push(function() {\n googletag.pubads().refresh(googletag.pubads().getSlots().filter(slot => slot.getSlotElementId() === "'.concat(containerId, '"), { changeCorrelator: true });\n });');
72887
+ script.innerHTML = '\n window.googletag.cmd.push(function() {\n googletag.pubads().refresh(googletag.pubads().getSlots().filter(slot => slot.getSlotElementId() === "'.concat(containerId, '"), { changeCorrelator: false });\n });');
72520
72888
  container.appendChild(script);
72521
72889
  callback(container);
72522
72890
  });
@@ -78929,6 +79297,7 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
78929
79297
  "use strict";
78930
79298
  function BasicPresentationMode(context) {
78931
79299
  _class_call_check(this, BasicPresentationMode);
79300
+ this.presenting = false;
78932
79301
  this.updatedContainerSize = functions_default.debounce(this.updatedContainerSize.bind(this), 100);
78933
79302
  this.context = context;
78934
79303
  this.mediaElementSizeController = new MediaElementSizeController(context);
@@ -78982,9 +79351,11 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
78982
79351
  x: 0,
78983
79352
  y: 10
78984
79353
  });
79354
+ this.presenting = true;
78985
79355
  return {};
78986
79356
  } else {
78987
79357
  var _this_context_interface_backdrop1, _this_context_interface1;
79358
+ this.presenting = false;
78988
79359
  (_this_context_interface1 = this.context.interface) === null || _this_context_interface1 === void 0 ? void 0 : (_this_context_interface_backdrop1 = _this_context_interface1.backdrop) === null || _this_context_interface_backdrop1 === void 0 ? void 0 : _this_context_interface_backdrop1.hide();
78989
79360
  }
78990
79361
  return;
@@ -79001,6 +79372,7 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
79001
79372
  value: function cooldown() {
79002
79373
  var _this = this;
79003
79374
  var _this_regionsRenderer;
79375
+ this.presenting = false;
79004
79376
  (_this_regionsRenderer = this.regionsRenderer) === null || _this_regionsRenderer === void 0 ? void 0 : _this_regionsRenderer.clear();
79005
79377
  this.packer.reset();
79006
79378
  requestAnimationFrame(function() {
@@ -79032,6 +79404,20 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
79032
79404
  {
79033
79405
  key: "updateSize",
79034
79406
  value: function updateSize() {
79407
+ if (this.context.media) {
79408
+ var _this_context_interface;
79409
+ var adjustedSize;
79410
+ if (this.presenting) {
79411
+ adjustedSize = adjustSizeWithAspectRatio(this.context.media.viewWidth, this.context.media.viewHeight, this.context.media.aspectRatio);
79412
+ } else {
79413
+ var _this_context_elements_container, _this_context_elements_container1;
79414
+ adjustedSize = {
79415
+ width: ((_this_context_elements_container = this.context.elements.container) === null || _this_context_elements_container === void 0 ? void 0 : _this_context_elements_container.getBoundingClientRect().width) || 0,
79416
+ height: ((_this_context_elements_container1 = this.context.elements.container) === null || _this_context_elements_container1 === void 0 ? void 0 : _this_context_elements_container1.getBoundingClientRect().height) || 0
79417
+ };
79418
+ }
79419
+ (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : _this_context_interface.updateSize(adjustedSize.width, adjustedSize.height, this.context.media.aspectRatio);
79420
+ }
79035
79421
  return void 0;
79036
79422
  }
79037
79423
  },
@@ -79059,11 +79445,13 @@ var BasicPresentationMode = /*#__PURE__*/ function() {
79059
79445
  this.packer.repack();
79060
79446
  if (this.packer.packed.length > 0) {
79061
79447
  var _this_context_interface_backdrop, _this_context_interface, _this_regionsRenderer1, _this_regionsRenderer2;
79448
+ this.presenting = true;
79062
79449
  (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : (_this_context_interface_backdrop = _this_context_interface.backdrop) === null || _this_context_interface_backdrop === void 0 ? void 0 : _this_context_interface_backdrop.show();
79063
79450
  (_this_regionsRenderer1 = this.regionsRenderer) === null || _this_regionsRenderer1 === void 0 ? void 0 : _this_regionsRenderer1.addAreas(this.packer.areas);
79064
79451
  (_this_regionsRenderer2 = this.regionsRenderer) === null || _this_regionsRenderer2 === void 0 ? void 0 : _this_regionsRenderer2.render(this.packer.packed);
79065
79452
  } else {
79066
79453
  var _this_regionsRenderer3, _this_mediaElementSizeController5, _this_context_interface_backdrop1, _this_context_interface1;
79454
+ this.presenting = false;
79067
79455
  (_this_regionsRenderer3 = this.regionsRenderer) === null || _this_regionsRenderer3 === void 0 ? void 0 : _this_regionsRenderer3.clear();
79068
79456
  (_this_mediaElementSizeController5 = this.mediaElementSizeController) === null || _this_mediaElementSizeController5 === void 0 ? void 0 : _this_mediaElementSizeController5.restore();
79069
79457
  (_this_context_interface1 = this.context.interface) === null || _this_context_interface1 === void 0 ? void 0 : (_this_context_interface_backdrop1 = _this_context_interface1.backdrop) === null || _this_context_interface_backdrop1 === void 0 ? void 0 : _this_context_interface_backdrop1.hide();
@@ -80331,7 +80719,7 @@ var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
80331
80719
  },
80332
80720
  {
80333
80721
  key: "startedPresentation",
80334
- value: function startedPresentation(opts) {
80722
+ value: function startedPresentation(opts2) {
80335
80723
  this.stopRetry();
80336
80724
  this.emit("pace");
80337
80725
  this.presentationTimer.resume();
@@ -80567,11 +80955,11 @@ var DynamicDurationPresentation = /*#__PURE__*/ function(AbstractPresentation) {
80567
80955
  },
80568
80956
  {
80569
80957
  key: "startedPresentation",
80570
- value: function startedPresentation(opts) {
80958
+ value: function startedPresentation(opts2) {
80571
80959
  this.stopRetry();
80572
80960
  this.startPacing();
80573
- if (opts.expectedDuration && !this.presentationTimer.isPaused) {
80574
- this.presentationTimer.setDuration(opts.expectedDuration * 1e3);
80961
+ if (opts2.expectedDuration && !this.presentationTimer.isPaused) {
80962
+ this.presentationTimer.setDuration(opts2.expectedDuration * 1e3);
80575
80963
  }
80576
80964
  this.presentationTimer.resume();
80577
80965
  }
@@ -84780,22 +85168,6 @@ var Interface = /*#__PURE__*/ function(_import_events9_default) {
84780
85168
  return Interface;
84781
85169
  }(import_events9.default);
84782
85170
  // src/Ads/VideoAds/VideoAd.ts
84783
- function adjustSizeWithAspectRatio2(maxWidth, maxHeight, aspectRatio) {
84784
- var width = maxWidth;
84785
- var height = maxHeight;
84786
- if (aspectRatio > 0) {
84787
- width = Math.min(maxWidth, maxHeight * aspectRatio);
84788
- height = width / aspectRatio;
84789
- if (height > maxHeight) {
84790
- height = maxHeight;
84791
- width = height * aspectRatio;
84792
- }
84793
- }
84794
- return {
84795
- width: width,
84796
- height: height
84797
- };
84798
- }
84799
85171
  var PresentationManager = /*#__PURE__*/ function() {
84800
85172
  "use strict";
84801
85173
  function PresentationManager(context) {
@@ -84950,11 +85322,6 @@ var PresentationManager = /*#__PURE__*/ function() {
84950
85322
  this.modes.forEach(function(mode) {
84951
85323
  mode.updateSize();
84952
85324
  });
84953
- if (this.context.media) {
84954
- var _this_context_interface;
84955
- var adjustedSize = adjustSizeWithAspectRatio2(this.context.media.viewWidth, this.context.media.viewHeight, this.context.media.aspectRatio);
84956
- (_this_context_interface = this.context.interface) === null || _this_context_interface === void 0 ? void 0 : _this_context_interface.updateSize(adjustedSize.width, adjustedSize.height, this.context.media.aspectRatio);
84957
- }
84958
85325
  }
84959
85326
  },
84960
85327
  {
@@ -86409,8 +86776,8 @@ function pick(obj) {
86409
86776
  }
86410
86777
  var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
86411
86778
  var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
86412
- function installTimerFunctions(obj, opts) {
86413
- if (opts.useNativeTimers) {
86779
+ function installTimerFunctions(obj, opts2) {
86780
+ if (opts2.useNativeTimers) {
86414
86781
  obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
86415
86782
  obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
86416
86783
  } else {
@@ -86485,16 +86852,16 @@ var TransportError = /*#__PURE__*/ function(Error1) {
86485
86852
  var Transport = /*#__PURE__*/ function(Emitter) {
86486
86853
  "use strict";
86487
86854
  _inherits(Transport, Emitter);
86488
- function Transport(opts) {
86855
+ function Transport(opts2) {
86489
86856
  _class_call_check(this, Transport);
86490
86857
  var _this;
86491
86858
  _this = _call_super(this, Transport);
86492
86859
  _this.writable = false;
86493
- installTimerFunctions(_this, opts);
86494
- _this.opts = opts;
86495
- _this.query = opts.query;
86496
- _this.socket = opts.socket;
86497
- _this.supportsBinary = !opts.forceBase64;
86860
+ installTimerFunctions(_this, opts2);
86861
+ _this.opts = opts2;
86862
+ _this.query = opts2.query;
86863
+ _this.socket = opts2.socket;
86864
+ _this.supportsBinary = !opts2.forceBase64;
86498
86865
  return _this;
86499
86866
  }
86500
86867
  _create_class(Transport, [
@@ -86810,11 +87177,11 @@ function empty() {}
86810
87177
  var BaseXHR = /*#__PURE__*/ function(Polling) {
86811
87178
  "use strict";
86812
87179
  _inherits(BaseXHR, Polling);
86813
- function BaseXHR(opts) {
87180
+ function BaseXHR(opts2) {
86814
87181
  _class_call_check(this, BaseXHR);
86815
87182
  var _this;
86816
87183
  _this = _call_super(this, BaseXHR, [
86817
- opts
87184
+ opts2
86818
87185
  ]);
86819
87186
  if (typeof location !== "undefined") {
86820
87187
  var isSSL = "https:" === location.protocol;
@@ -86822,7 +87189,7 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
86822
87189
  if (!port) {
86823
87190
  port = isSSL ? "443" : "80";
86824
87191
  }
86825
- _this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
87192
+ _this.xd = typeof location !== "undefined" && opts2.hostname !== location.hostname || port !== opts2.port;
86826
87193
  }
86827
87194
  return _this;
86828
87195
  }
@@ -86869,16 +87236,16 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
86869
87236
  var Request2 = /*#__PURE__*/ function(Emitter) {
86870
87237
  "use strict";
86871
87238
  _inherits(_Request, Emitter);
86872
- function _Request(createRequest, uri, opts) {
87239
+ function _Request(createRequest, uri, opts2) {
86873
87240
  _class_call_check(this, _Request);
86874
87241
  var _this;
86875
87242
  _this = _call_super(this, _Request);
86876
87243
  _this.createRequest = createRequest;
86877
- installTimerFunctions(_this, opts);
86878
- _this._opts = opts;
86879
- _this._method = opts.method || "GET";
87244
+ installTimerFunctions(_this, opts2);
87245
+ _this._opts = opts2;
87246
+ _this._method = opts2.method || "GET";
86880
87247
  _this._uri = uri;
86881
- _this._data = void 0 !== opts.data ? opts.data : null;
87248
+ _this._data = void 0 !== opts2.data ? opts2.data : null;
86882
87249
  _this._create();
86883
87250
  return _this;
86884
87251
  }
@@ -86892,9 +87259,9 @@ var Request2 = /*#__PURE__*/ function(Emitter) {
86892
87259
  value: function _create() {
86893
87260
  var _this = this;
86894
87261
  var _a;
86895
- var opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
86896
- opts.xdomain = !!this._opts.xd;
86897
- var xhr = this._xhr = this.createRequest(opts);
87262
+ var opts2 = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
87263
+ opts2.xdomain = !!this._opts.xd;
87264
+ var xhr = this._xhr = this.createRequest(opts2);
86898
87265
  try {
86899
87266
  xhr.open(this._method, this._uri, true);
86900
87267
  try {
@@ -87037,13 +87404,13 @@ var hasXHR2 = function() {
87037
87404
  var XHR = /*#__PURE__*/ function(BaseXHR) {
87038
87405
  "use strict";
87039
87406
  _inherits(XHR, BaseXHR);
87040
- function XHR(opts) {
87407
+ function XHR(opts2) {
87041
87408
  _class_call_check(this, XHR);
87042
87409
  var _this;
87043
87410
  _this = _call_super(this, XHR, [
87044
- opts
87411
+ opts2
87045
87412
  ]);
87046
- var forceBase64 = opts && opts.forceBase64;
87413
+ var forceBase64 = opts2 && opts2.forceBase64;
87047
87414
  _this.supportsBinary = hasXHR2 && !forceBase64;
87048
87415
  return _this;
87049
87416
  }
@@ -87051,18 +87418,18 @@ var XHR = /*#__PURE__*/ function(BaseXHR) {
87051
87418
  {
87052
87419
  key: "request",
87053
87420
  value: function request() {
87054
- var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
87055
- Object.assign(opts, {
87421
+ var opts2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
87422
+ Object.assign(opts2, {
87056
87423
  xd: this.xd
87057
87424
  }, this.opts);
87058
- return new Request2(newRequest, this.uri(), opts);
87425
+ return new Request2(newRequest, this.uri(), opts2);
87059
87426
  }
87060
87427
  }
87061
87428
  ]);
87062
87429
  return XHR;
87063
87430
  }(BaseXHR);
87064
- function newRequest(opts) {
87065
- var xdomain = opts.xdomain;
87431
+ function newRequest(opts2) {
87432
+ var xdomain = opts2.xdomain;
87066
87433
  try {
87067
87434
  if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
87068
87435
  return new XMLHttpRequest();
@@ -87097,12 +87464,12 @@ var BaseWS = /*#__PURE__*/ function(Transport) {
87097
87464
  value: function doOpen() {
87098
87465
  var uri = this.uri();
87099
87466
  var protocols = this.opts.protocols;
87100
- var opts = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
87467
+ var opts2 = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
87101
87468
  if (this.opts.extraHeaders) {
87102
- opts.headers = this.opts.extraHeaders;
87469
+ opts2.headers = this.opts.extraHeaders;
87103
87470
  }
87104
87471
  try {
87105
- this.ws = this.createSocket(uri, protocols, opts);
87472
+ this.ws = this.createSocket(uri, protocols, opts2);
87106
87473
  } catch (err) {
87107
87474
  return this.emitReserved("error", err);
87108
87475
  }
@@ -87203,8 +87570,8 @@ var WS = /*#__PURE__*/ function(BaseWS) {
87203
87570
  _create_class(WS, [
87204
87571
  {
87205
87572
  key: "createSocket",
87206
- value: function createSocket(uri, protocols, opts) {
87207
- return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts);
87573
+ value: function createSocket(uri, protocols, opts2) {
87574
+ return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts2);
87208
87575
  }
87209
87576
  },
87210
87577
  {
@@ -87384,7 +87751,7 @@ if (withEventListeners) {
87384
87751
  var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
87385
87752
  "use strict";
87386
87753
  _inherits(_SocketWithoutUpgrade, Emitter);
87387
- function _SocketWithoutUpgrade(uri, opts) {
87754
+ function _SocketWithoutUpgrade(uri, opts2) {
87388
87755
  _class_call_check(this, _SocketWithoutUpgrade);
87389
87756
  var _this;
87390
87757
  _this = _call_super(this, _SocketWithoutUpgrade);
@@ -87396,28 +87763,28 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
87396
87763
  _this._maxPayload = -1;
87397
87764
  _this._pingTimeoutTime = Infinity;
87398
87765
  if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
87399
- opts = uri;
87766
+ opts2 = uri;
87400
87767
  uri = null;
87401
87768
  }
87402
87769
  if (uri) {
87403
87770
  var parsedUri = parse2(uri);
87404
- opts.hostname = parsedUri.host;
87405
- opts.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss";
87406
- opts.port = parsedUri.port;
87407
- if (parsedUri.query) opts.query = parsedUri.query;
87408
- } else if (opts.host) {
87409
- opts.hostname = parse2(opts.host).host;
87410
- }
87411
- installTimerFunctions(_this, opts);
87412
- _this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol;
87413
- if (opts.hostname && !opts.port) {
87414
- opts.port = _this.secure ? "443" : "80";
87415
- }
87416
- _this.hostname = opts.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
87417
- _this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : _this.secure ? "443" : "80");
87771
+ opts2.hostname = parsedUri.host;
87772
+ opts2.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss";
87773
+ opts2.port = parsedUri.port;
87774
+ if (parsedUri.query) opts2.query = parsedUri.query;
87775
+ } else if (opts2.host) {
87776
+ opts2.hostname = parse2(opts2.host).host;
87777
+ }
87778
+ installTimerFunctions(_this, opts2);
87779
+ _this.secure = null != opts2.secure ? opts2.secure : typeof location !== "undefined" && "https:" === location.protocol;
87780
+ if (opts2.hostname && !opts2.port) {
87781
+ opts2.port = _this.secure ? "443" : "80";
87782
+ }
87783
+ _this.hostname = opts2.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
87784
+ _this.port = opts2.port || (typeof location !== "undefined" && location.port ? location.port : _this.secure ? "443" : "80");
87418
87785
  _this.transports = [];
87419
87786
  _this._transportsByName = {};
87420
- opts.transports.forEach(function(t2) {
87787
+ opts2.transports.forEach(function(t2) {
87421
87788
  var transportName = t2.prototype.name;
87422
87789
  _this.transports.push(transportName);
87423
87790
  _this._transportsByName[transportName] = t2;
@@ -87436,7 +87803,7 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
87436
87803
  },
87437
87804
  transportOptions: {},
87438
87805
  closeOnBeforeunload: false
87439
- }, opts);
87806
+ }, opts2);
87440
87807
  _this.opts.path = _this.opts.path.replace(/\/$/, "") + (_this.opts.addTrailingSlash ? "/" : "");
87441
87808
  if (typeof _this.opts.query === "string") {
87442
87809
  _this.opts.query = decode2(_this.opts.query);
@@ -87480,14 +87847,14 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
87480
87847
  query.EIO = protocol;
87481
87848
  query.transport = name;
87482
87849
  if (this.id) query.sid = this.id;
87483
- var opts = Object.assign({}, this.opts, {
87850
+ var opts2 = Object.assign({}, this.opts, {
87484
87851
  query: query,
87485
87852
  socket: this,
87486
87853
  hostname: this.hostname,
87487
87854
  secure: this.secure,
87488
87855
  port: this.port
87489
87856
  }, this.opts.transportOptions[name]);
87490
- return new this._transportsByName[name](opts);
87857
+ return new this._transportsByName[name](opts2);
87491
87858
  }
87492
87859
  },
87493
87860
  {
@@ -87991,9 +88358,9 @@ var Socket = /*#__PURE__*/ function(SocketWithUpgrade) {
87991
88358
  "use strict";
87992
88359
  _inherits(Socket, SocketWithUpgrade);
87993
88360
  function Socket(uri) {
87994
- var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
88361
+ var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
87995
88362
  _class_call_check(this, Socket);
87996
- var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri : opts;
88363
+ var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri : opts2;
87997
88364
  if (!o2.transports || o2.transports && typeof o2.transports[0] === "string") {
87998
88365
  o2.transports = (o2.transports || [
87999
88366
  "polling",
@@ -88471,7 +88838,7 @@ var RESERVED_EVENTS2 = Object.freeze({
88471
88838
  var Socket2 = /*#__PURE__*/ function(Emitter) {
88472
88839
  "use strict";
88473
88840
  _inherits(Socket2, Emitter);
88474
- function Socket2(io, nsp, opts) {
88841
+ function Socket2(io, nsp, opts2) {
88475
88842
  _class_call_check(this, Socket2);
88476
88843
  var _this;
88477
88844
  _this = _call_super(this, Socket2);
@@ -88486,10 +88853,10 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
88486
88853
  _this.flags = {};
88487
88854
  _this.io = io;
88488
88855
  _this.nsp = nsp;
88489
- if (opts && opts.auth) {
88490
- _this.auth = opts.auth;
88856
+ if (opts2 && opts2.auth) {
88857
+ _this.auth = opts2.auth;
88491
88858
  }
88492
- _this._opts = Object.assign({}, opts);
88859
+ _this._opts = Object.assign({}, opts2);
88493
88860
  if (_this.io._autoConnect) _this.open();
88494
88861
  return _this;
88495
88862
  }
@@ -89387,12 +89754,12 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
89387
89754
  return Socket2;
89388
89755
  }(Emitter);
89389
89756
  // node_modules/socket.io-client/build/esm/contrib/backo2.js
89390
- function Backoff(opts) {
89391
- opts = opts || {};
89392
- this.ms = opts.min || 100;
89393
- this.max = opts.max || 1e4;
89394
- this.factor = opts.factor || 2;
89395
- this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
89757
+ function Backoff(opts2) {
89758
+ opts2 = opts2 || {};
89759
+ this.ms = opts2.min || 100;
89760
+ this.max = opts2.max || 1e4;
89761
+ this.factor = opts2.factor || 2;
89762
+ this.jitter = opts2.jitter > 0 && opts2.jitter <= 1 ? opts2.jitter : 0;
89396
89763
  this.attempts = 0;
89397
89764
  }
89398
89765
  Backoff.prototype.duration = function() {
@@ -89420,7 +89787,7 @@ Backoff.prototype.setJitter = function(jitter) {
89420
89787
  var Manager = /*#__PURE__*/ function(Emitter) {
89421
89788
  "use strict";
89422
89789
  _inherits(Manager, Emitter);
89423
- function Manager(uri, opts) {
89790
+ function Manager(uri, opts2) {
89424
89791
  _class_call_check(this, Manager);
89425
89792
  var _this;
89426
89793
  var _a;
@@ -89428,30 +89795,30 @@ var Manager = /*#__PURE__*/ function(Emitter) {
89428
89795
  _this.nsps = {};
89429
89796
  _this.subs = [];
89430
89797
  if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
89431
- opts = uri;
89798
+ opts2 = uri;
89432
89799
  uri = void 0;
89433
89800
  }
89434
- opts = opts || {};
89435
- opts.path = opts.path || "/socket.io";
89436
- _this.opts = opts;
89437
- installTimerFunctions(_this, opts);
89438
- _this.reconnection(opts.reconnection !== false);
89439
- _this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
89440
- _this.reconnectionDelay(opts.reconnectionDelay || 1e3);
89441
- _this.reconnectionDelayMax(opts.reconnectionDelayMax || 5e3);
89442
- _this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
89801
+ opts2 = opts2 || {};
89802
+ opts2.path = opts2.path || "/socket.io";
89803
+ _this.opts = opts2;
89804
+ installTimerFunctions(_this, opts2);
89805
+ _this.reconnection(opts2.reconnection !== false);
89806
+ _this.reconnectionAttempts(opts2.reconnectionAttempts || Infinity);
89807
+ _this.reconnectionDelay(opts2.reconnectionDelay || 1e3);
89808
+ _this.reconnectionDelayMax(opts2.reconnectionDelayMax || 5e3);
89809
+ _this.randomizationFactor((_a = opts2.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
89443
89810
  _this.backoff = new Backoff({
89444
89811
  min: _this.reconnectionDelay(),
89445
89812
  max: _this.reconnectionDelayMax(),
89446
89813
  jitter: _this.randomizationFactor()
89447
89814
  });
89448
- _this.timeout(null == opts.timeout ? 2e4 : opts.timeout);
89815
+ _this.timeout(null == opts2.timeout ? 2e4 : opts2.timeout);
89449
89816
  _this._readyState = "closed";
89450
89817
  _this.uri = uri;
89451
- var _parser = opts.parser || esm_exports2;
89818
+ var _parser = opts2.parser || esm_exports2;
89452
89819
  _this.encoder = new _parser.Encoder();
89453
89820
  _this.decoder = new _parser.Decoder();
89454
- _this._autoConnect = opts.autoConnect !== false;
89821
+ _this._autoConnect = opts2.autoConnect !== false;
89455
89822
  if (_this._autoConnect) _this.open();
89456
89823
  return _this;
89457
89824
  }
@@ -89656,10 +90023,10 @@ var Manager = /*#__PURE__*/ function(Emitter) {
89656
90023
  * @return {Socket}
89657
90024
  * @public
89658
90025
  */ key: "socket",
89659
- value: function socket(nsp, opts) {
90026
+ value: function socket(nsp, opts2) {
89660
90027
  var socket = this.nsps[nsp];
89661
90028
  if (!socket) {
89662
- socket = new Socket2(this, nsp, opts);
90029
+ socket = new Socket2(this, nsp, opts2);
89663
90030
  this.nsps[nsp] = socket;
89664
90031
  } else if (this._autoConnect && !socket.active) {
89665
90032
  socket.connect();
@@ -89832,31 +90199,31 @@ var Manager = /*#__PURE__*/ function(Emitter) {
89832
90199
  }(Emitter);
89833
90200
  // node_modules/socket.io-client/build/esm/index.js
89834
90201
  var cache = {};
89835
- function lookup2(uri, opts) {
90202
+ function lookup2(uri, opts2) {
89836
90203
  if ((typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object") {
89837
- opts = uri;
90204
+ opts2 = uri;
89838
90205
  uri = void 0;
89839
90206
  }
89840
- opts = opts || {};
89841
- var parsed = url(uri, opts.path || "/socket.io");
90207
+ opts2 = opts2 || {};
90208
+ var parsed = url(uri, opts2.path || "/socket.io");
89842
90209
  var source = parsed.source;
89843
90210
  var id = parsed.id;
89844
90211
  var path = parsed.path;
89845
90212
  var sameNamespace = cache[id] && path in cache[id]["nsps"];
89846
- var newConnection = opts.forceNew || opts["force new connection"] || false === opts.multiplex || sameNamespace;
90213
+ var newConnection = opts2.forceNew || opts2["force new connection"] || false === opts2.multiplex || sameNamespace;
89847
90214
  var io;
89848
90215
  if (newConnection) {
89849
- io = new Manager(source, opts);
90216
+ io = new Manager(source, opts2);
89850
90217
  } else {
89851
90218
  if (!cache[id]) {
89852
- cache[id] = new Manager(source, opts);
90219
+ cache[id] = new Manager(source, opts2);
89853
90220
  }
89854
90221
  io = cache[id];
89855
90222
  }
89856
- if (parsed.query && !opts.query) {
89857
- opts.query = parsed.queryKey;
90223
+ if (parsed.query && !opts2.query) {
90224
+ opts2.query = parsed.queryKey;
89858
90225
  }
89859
- return io.socket(parsed.path, opts);
90226
+ return io.socket(parsed.path, opts2);
89860
90227
  }
89861
90228
  Object.assign(lookup2, {
89862
90229
  Manager: Manager,