@brndts/brndts-ads 1.14.17 → 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.js +556 -186
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +556 -186
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
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(
|
55204
|
+
applySdkMetadata(opts2, "browser", [
|
55205
55205
|
"browser"
|
55206
55206
|
], sdkSource);
|
55207
55207
|
_this = _call_super(this, BrowserClient, [
|
55208
|
-
|
55208
|
+
opts2
|
55209
55209
|
]);
|
55210
|
-
if (
|
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,
|
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
|
-
},
|
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
|
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,
|
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
|
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,
|
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
|
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,
|
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
|
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:
|
55650
|
+
durationThreshold: opts2.durationThreshold != null ? opts2.durationThreshold : DEFAULT_DURATION_THRESHOLD
|
55651
55651
|
});
|
55652
|
-
report = bindReporter(onReport, metric, INPThresholds,
|
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
|
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 (!
|
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,
|
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
|
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,
|
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(
|
62853
|
-
_capture =
|
62854
|
-
_trace =
|
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(
|
69405
|
+
function RegionBorderPlugin(opts2) {
|
69406
69406
|
_class_call_check(this, RegionBorderPlugin);
|
69407
|
-
this.options =
|
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,7 +72789,10 @@ var PrebidGAM = /*#__PURE__*/ function() {
|
|
72458
72789
|
brndts_zid: unitDefinition.zoneId
|
72459
72790
|
};
|
72460
72791
|
}
|
72461
|
-
GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId),
|
72792
|
+
GPT.defineSlot("/".concat(gamNetworkId, "/").concat(adName), sizes, "".concat(containerId), {
|
72793
|
+
targeting: targeting,
|
72794
|
+
mapping: mapping
|
72795
|
+
});
|
72462
72796
|
if (!((_window_pbjs = window.pbjs) === null || _window_pbjs === void 0 ? void 0 : _window_pbjs.adUnits.some(function(defUnit) {
|
72463
72797
|
return "".concat(containerId) === "".concat(defUnit.code);
|
72464
72798
|
}))) {
|
@@ -72466,15 +72800,51 @@ var PrebidGAM = /*#__PURE__*/ function() {
|
|
72466
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() {
|
72467
72801
|
var _window_pbjs;
|
72468
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
|
+
}
|
72469
72846
|
window.pbjs.addAdUnits([
|
72470
|
-
|
72471
|
-
mediaTypes: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes || {}), {
|
72472
|
-
banner: _object_spread_props(_object_spread({}, unitDefinition.mediaTypes.banner || {}), {
|
72473
|
-
sizes: sizes
|
72474
|
-
})
|
72475
|
-
}),
|
72476
|
-
code: "".concat(containerId)
|
72477
|
-
})
|
72847
|
+
adUnit
|
72478
72848
|
]);
|
72479
72849
|
} else {
|
72480
72850
|
console.error("addAdUnits is not a function.");
|
@@ -80349,7 +80719,7 @@ var CooldownPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
80349
80719
|
},
|
80350
80720
|
{
|
80351
80721
|
key: "startedPresentation",
|
80352
|
-
value: function startedPresentation(
|
80722
|
+
value: function startedPresentation(opts2) {
|
80353
80723
|
this.stopRetry();
|
80354
80724
|
this.emit("pace");
|
80355
80725
|
this.presentationTimer.resume();
|
@@ -80585,11 +80955,11 @@ var DynamicDurationPresentation = /*#__PURE__*/ function(AbstractPresentation) {
|
|
80585
80955
|
},
|
80586
80956
|
{
|
80587
80957
|
key: "startedPresentation",
|
80588
|
-
value: function startedPresentation(
|
80958
|
+
value: function startedPresentation(opts2) {
|
80589
80959
|
this.stopRetry();
|
80590
80960
|
this.startPacing();
|
80591
|
-
if (
|
80592
|
-
this.presentationTimer.setDuration(
|
80961
|
+
if (opts2.expectedDuration && !this.presentationTimer.isPaused) {
|
80962
|
+
this.presentationTimer.setDuration(opts2.expectedDuration * 1e3);
|
80593
80963
|
}
|
80594
80964
|
this.presentationTimer.resume();
|
80595
80965
|
}
|
@@ -86406,8 +86776,8 @@ function pick(obj) {
|
|
86406
86776
|
}
|
86407
86777
|
var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
|
86408
86778
|
var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
|
86409
|
-
function installTimerFunctions(obj,
|
86410
|
-
if (
|
86779
|
+
function installTimerFunctions(obj, opts2) {
|
86780
|
+
if (opts2.useNativeTimers) {
|
86411
86781
|
obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
|
86412
86782
|
obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
|
86413
86783
|
} else {
|
@@ -86482,16 +86852,16 @@ var TransportError = /*#__PURE__*/ function(Error1) {
|
|
86482
86852
|
var Transport = /*#__PURE__*/ function(Emitter) {
|
86483
86853
|
"use strict";
|
86484
86854
|
_inherits(Transport, Emitter);
|
86485
|
-
function Transport(
|
86855
|
+
function Transport(opts2) {
|
86486
86856
|
_class_call_check(this, Transport);
|
86487
86857
|
var _this;
|
86488
86858
|
_this = _call_super(this, Transport);
|
86489
86859
|
_this.writable = false;
|
86490
|
-
installTimerFunctions(_this,
|
86491
|
-
_this.opts =
|
86492
|
-
_this.query =
|
86493
|
-
_this.socket =
|
86494
|
-
_this.supportsBinary = !
|
86860
|
+
installTimerFunctions(_this, opts2);
|
86861
|
+
_this.opts = opts2;
|
86862
|
+
_this.query = opts2.query;
|
86863
|
+
_this.socket = opts2.socket;
|
86864
|
+
_this.supportsBinary = !opts2.forceBase64;
|
86495
86865
|
return _this;
|
86496
86866
|
}
|
86497
86867
|
_create_class(Transport, [
|
@@ -86807,11 +87177,11 @@ function empty() {}
|
|
86807
87177
|
var BaseXHR = /*#__PURE__*/ function(Polling) {
|
86808
87178
|
"use strict";
|
86809
87179
|
_inherits(BaseXHR, Polling);
|
86810
|
-
function BaseXHR(
|
87180
|
+
function BaseXHR(opts2) {
|
86811
87181
|
_class_call_check(this, BaseXHR);
|
86812
87182
|
var _this;
|
86813
87183
|
_this = _call_super(this, BaseXHR, [
|
86814
|
-
|
87184
|
+
opts2
|
86815
87185
|
]);
|
86816
87186
|
if (typeof location !== "undefined") {
|
86817
87187
|
var isSSL = "https:" === location.protocol;
|
@@ -86819,7 +87189,7 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
|
|
86819
87189
|
if (!port) {
|
86820
87190
|
port = isSSL ? "443" : "80";
|
86821
87191
|
}
|
86822
|
-
_this.xd = typeof location !== "undefined" &&
|
87192
|
+
_this.xd = typeof location !== "undefined" && opts2.hostname !== location.hostname || port !== opts2.port;
|
86823
87193
|
}
|
86824
87194
|
return _this;
|
86825
87195
|
}
|
@@ -86866,16 +87236,16 @@ var BaseXHR = /*#__PURE__*/ function(Polling) {
|
|
86866
87236
|
var Request2 = /*#__PURE__*/ function(Emitter) {
|
86867
87237
|
"use strict";
|
86868
87238
|
_inherits(_Request, Emitter);
|
86869
|
-
function _Request(createRequest, uri,
|
87239
|
+
function _Request(createRequest, uri, opts2) {
|
86870
87240
|
_class_call_check(this, _Request);
|
86871
87241
|
var _this;
|
86872
87242
|
_this = _call_super(this, _Request);
|
86873
87243
|
_this.createRequest = createRequest;
|
86874
|
-
installTimerFunctions(_this,
|
86875
|
-
_this._opts =
|
86876
|
-
_this._method =
|
87244
|
+
installTimerFunctions(_this, opts2);
|
87245
|
+
_this._opts = opts2;
|
87246
|
+
_this._method = opts2.method || "GET";
|
86877
87247
|
_this._uri = uri;
|
86878
|
-
_this._data = void 0 !==
|
87248
|
+
_this._data = void 0 !== opts2.data ? opts2.data : null;
|
86879
87249
|
_this._create();
|
86880
87250
|
return _this;
|
86881
87251
|
}
|
@@ -86889,9 +87259,9 @@ var Request2 = /*#__PURE__*/ function(Emitter) {
|
|
86889
87259
|
value: function _create() {
|
86890
87260
|
var _this = this;
|
86891
87261
|
var _a;
|
86892
|
-
var
|
86893
|
-
|
86894
|
-
var xhr = this._xhr = this.createRequest(
|
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);
|
86895
87265
|
try {
|
86896
87266
|
xhr.open(this._method, this._uri, true);
|
86897
87267
|
try {
|
@@ -87034,13 +87404,13 @@ var hasXHR2 = function() {
|
|
87034
87404
|
var XHR = /*#__PURE__*/ function(BaseXHR) {
|
87035
87405
|
"use strict";
|
87036
87406
|
_inherits(XHR, BaseXHR);
|
87037
|
-
function XHR(
|
87407
|
+
function XHR(opts2) {
|
87038
87408
|
_class_call_check(this, XHR);
|
87039
87409
|
var _this;
|
87040
87410
|
_this = _call_super(this, XHR, [
|
87041
|
-
|
87411
|
+
opts2
|
87042
87412
|
]);
|
87043
|
-
var forceBase64 =
|
87413
|
+
var forceBase64 = opts2 && opts2.forceBase64;
|
87044
87414
|
_this.supportsBinary = hasXHR2 && !forceBase64;
|
87045
87415
|
return _this;
|
87046
87416
|
}
|
@@ -87048,18 +87418,18 @@ var XHR = /*#__PURE__*/ function(BaseXHR) {
|
|
87048
87418
|
{
|
87049
87419
|
key: "request",
|
87050
87420
|
value: function request() {
|
87051
|
-
var
|
87052
|
-
Object.assign(
|
87421
|
+
var opts2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
87422
|
+
Object.assign(opts2, {
|
87053
87423
|
xd: this.xd
|
87054
87424
|
}, this.opts);
|
87055
|
-
return new Request2(newRequest, this.uri(),
|
87425
|
+
return new Request2(newRequest, this.uri(), opts2);
|
87056
87426
|
}
|
87057
87427
|
}
|
87058
87428
|
]);
|
87059
87429
|
return XHR;
|
87060
87430
|
}(BaseXHR);
|
87061
|
-
function newRequest(
|
87062
|
-
var xdomain =
|
87431
|
+
function newRequest(opts2) {
|
87432
|
+
var xdomain = opts2.xdomain;
|
87063
87433
|
try {
|
87064
87434
|
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
|
87065
87435
|
return new XMLHttpRequest();
|
@@ -87094,12 +87464,12 @@ var BaseWS = /*#__PURE__*/ function(Transport) {
|
|
87094
87464
|
value: function doOpen() {
|
87095
87465
|
var uri = this.uri();
|
87096
87466
|
var protocols = this.opts.protocols;
|
87097
|
-
var
|
87467
|
+
var opts2 = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
|
87098
87468
|
if (this.opts.extraHeaders) {
|
87099
|
-
|
87469
|
+
opts2.headers = this.opts.extraHeaders;
|
87100
87470
|
}
|
87101
87471
|
try {
|
87102
|
-
this.ws = this.createSocket(uri, protocols,
|
87472
|
+
this.ws = this.createSocket(uri, protocols, opts2);
|
87103
87473
|
} catch (err) {
|
87104
87474
|
return this.emitReserved("error", err);
|
87105
87475
|
}
|
@@ -87200,8 +87570,8 @@ var WS = /*#__PURE__*/ function(BaseWS) {
|
|
87200
87570
|
_create_class(WS, [
|
87201
87571
|
{
|
87202
87572
|
key: "createSocket",
|
87203
|
-
value: function createSocket(uri, protocols,
|
87204
|
-
return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols,
|
87573
|
+
value: function createSocket(uri, protocols, opts2) {
|
87574
|
+
return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts2);
|
87205
87575
|
}
|
87206
87576
|
},
|
87207
87577
|
{
|
@@ -87381,7 +87751,7 @@ if (withEventListeners) {
|
|
87381
87751
|
var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
87382
87752
|
"use strict";
|
87383
87753
|
_inherits(_SocketWithoutUpgrade, Emitter);
|
87384
|
-
function _SocketWithoutUpgrade(uri,
|
87754
|
+
function _SocketWithoutUpgrade(uri, opts2) {
|
87385
87755
|
_class_call_check(this, _SocketWithoutUpgrade);
|
87386
87756
|
var _this;
|
87387
87757
|
_this = _call_super(this, _SocketWithoutUpgrade);
|
@@ -87393,28 +87763,28 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87393
87763
|
_this._maxPayload = -1;
|
87394
87764
|
_this._pingTimeoutTime = Infinity;
|
87395
87765
|
if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
|
87396
|
-
|
87766
|
+
opts2 = uri;
|
87397
87767
|
uri = null;
|
87398
87768
|
}
|
87399
87769
|
if (uri) {
|
87400
87770
|
var parsedUri = parse2(uri);
|
87401
|
-
|
87402
|
-
|
87403
|
-
|
87404
|
-
if (parsedUri.query)
|
87405
|
-
} else if (
|
87406
|
-
|
87407
|
-
}
|
87408
|
-
installTimerFunctions(_this,
|
87409
|
-
_this.secure = null !=
|
87410
|
-
if (
|
87411
|
-
|
87412
|
-
}
|
87413
|
-
_this.hostname =
|
87414
|
-
_this.port =
|
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");
|
87415
87785
|
_this.transports = [];
|
87416
87786
|
_this._transportsByName = {};
|
87417
|
-
|
87787
|
+
opts2.transports.forEach(function(t2) {
|
87418
87788
|
var transportName = t2.prototype.name;
|
87419
87789
|
_this.transports.push(transportName);
|
87420
87790
|
_this._transportsByName[transportName] = t2;
|
@@ -87433,7 +87803,7 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87433
87803
|
},
|
87434
87804
|
transportOptions: {},
|
87435
87805
|
closeOnBeforeunload: false
|
87436
|
-
},
|
87806
|
+
}, opts2);
|
87437
87807
|
_this.opts.path = _this.opts.path.replace(/\/$/, "") + (_this.opts.addTrailingSlash ? "/" : "");
|
87438
87808
|
if (typeof _this.opts.query === "string") {
|
87439
87809
|
_this.opts.query = decode2(_this.opts.query);
|
@@ -87477,14 +87847,14 @@ var SocketWithoutUpgrade = /*#__PURE__*/ function(Emitter) {
|
|
87477
87847
|
query.EIO = protocol;
|
87478
87848
|
query.transport = name;
|
87479
87849
|
if (this.id) query.sid = this.id;
|
87480
|
-
var
|
87850
|
+
var opts2 = Object.assign({}, this.opts, {
|
87481
87851
|
query: query,
|
87482
87852
|
socket: this,
|
87483
87853
|
hostname: this.hostname,
|
87484
87854
|
secure: this.secure,
|
87485
87855
|
port: this.port
|
87486
87856
|
}, this.opts.transportOptions[name]);
|
87487
|
-
return new this._transportsByName[name](
|
87857
|
+
return new this._transportsByName[name](opts2);
|
87488
87858
|
}
|
87489
87859
|
},
|
87490
87860
|
{
|
@@ -87988,9 +88358,9 @@ var Socket = /*#__PURE__*/ function(SocketWithUpgrade) {
|
|
87988
88358
|
"use strict";
|
87989
88359
|
_inherits(Socket, SocketWithUpgrade);
|
87990
88360
|
function Socket(uri) {
|
87991
|
-
var
|
88361
|
+
var opts2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
87992
88362
|
_class_call_check(this, Socket);
|
87993
|
-
var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri :
|
88363
|
+
var o2 = (typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object" ? uri : opts2;
|
87994
88364
|
if (!o2.transports || o2.transports && typeof o2.transports[0] === "string") {
|
87995
88365
|
o2.transports = (o2.transports || [
|
87996
88366
|
"polling",
|
@@ -88468,7 +88838,7 @@ var RESERVED_EVENTS2 = Object.freeze({
|
|
88468
88838
|
var Socket2 = /*#__PURE__*/ function(Emitter) {
|
88469
88839
|
"use strict";
|
88470
88840
|
_inherits(Socket2, Emitter);
|
88471
|
-
function Socket2(io, nsp,
|
88841
|
+
function Socket2(io, nsp, opts2) {
|
88472
88842
|
_class_call_check(this, Socket2);
|
88473
88843
|
var _this;
|
88474
88844
|
_this = _call_super(this, Socket2);
|
@@ -88483,10 +88853,10 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
|
|
88483
88853
|
_this.flags = {};
|
88484
88854
|
_this.io = io;
|
88485
88855
|
_this.nsp = nsp;
|
88486
|
-
if (
|
88487
|
-
_this.auth =
|
88856
|
+
if (opts2 && opts2.auth) {
|
88857
|
+
_this.auth = opts2.auth;
|
88488
88858
|
}
|
88489
|
-
_this._opts = Object.assign({},
|
88859
|
+
_this._opts = Object.assign({}, opts2);
|
88490
88860
|
if (_this.io._autoConnect) _this.open();
|
88491
88861
|
return _this;
|
88492
88862
|
}
|
@@ -89384,12 +89754,12 @@ var Socket2 = /*#__PURE__*/ function(Emitter) {
|
|
89384
89754
|
return Socket2;
|
89385
89755
|
}(Emitter);
|
89386
89756
|
// node_modules/socket.io-client/build/esm/contrib/backo2.js
|
89387
|
-
function Backoff(
|
89388
|
-
|
89389
|
-
this.ms =
|
89390
|
-
this.max =
|
89391
|
-
this.factor =
|
89392
|
-
this.jitter =
|
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;
|
89393
89763
|
this.attempts = 0;
|
89394
89764
|
}
|
89395
89765
|
Backoff.prototype.duration = function() {
|
@@ -89417,7 +89787,7 @@ Backoff.prototype.setJitter = function(jitter) {
|
|
89417
89787
|
var Manager = /*#__PURE__*/ function(Emitter) {
|
89418
89788
|
"use strict";
|
89419
89789
|
_inherits(Manager, Emitter);
|
89420
|
-
function Manager(uri,
|
89790
|
+
function Manager(uri, opts2) {
|
89421
89791
|
_class_call_check(this, Manager);
|
89422
89792
|
var _this;
|
89423
89793
|
var _a;
|
@@ -89425,30 +89795,30 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
89425
89795
|
_this.nsps = {};
|
89426
89796
|
_this.subs = [];
|
89427
89797
|
if (uri && "object" === (typeof uri === "undefined" ? "undefined" : _type_of(uri))) {
|
89428
|
-
|
89798
|
+
opts2 = uri;
|
89429
89799
|
uri = void 0;
|
89430
89800
|
}
|
89431
|
-
|
89432
|
-
|
89433
|
-
_this.opts =
|
89434
|
-
installTimerFunctions(_this,
|
89435
|
-
_this.reconnection(
|
89436
|
-
_this.reconnectionAttempts(
|
89437
|
-
_this.reconnectionDelay(
|
89438
|
-
_this.reconnectionDelayMax(
|
89439
|
-
_this.randomizationFactor((_a =
|
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);
|
89440
89810
|
_this.backoff = new Backoff({
|
89441
89811
|
min: _this.reconnectionDelay(),
|
89442
89812
|
max: _this.reconnectionDelayMax(),
|
89443
89813
|
jitter: _this.randomizationFactor()
|
89444
89814
|
});
|
89445
|
-
_this.timeout(null ==
|
89815
|
+
_this.timeout(null == opts2.timeout ? 2e4 : opts2.timeout);
|
89446
89816
|
_this._readyState = "closed";
|
89447
89817
|
_this.uri = uri;
|
89448
|
-
var _parser =
|
89818
|
+
var _parser = opts2.parser || esm_exports2;
|
89449
89819
|
_this.encoder = new _parser.Encoder();
|
89450
89820
|
_this.decoder = new _parser.Decoder();
|
89451
|
-
_this._autoConnect =
|
89821
|
+
_this._autoConnect = opts2.autoConnect !== false;
|
89452
89822
|
if (_this._autoConnect) _this.open();
|
89453
89823
|
return _this;
|
89454
89824
|
}
|
@@ -89653,10 +90023,10 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
89653
90023
|
* @return {Socket}
|
89654
90024
|
* @public
|
89655
90025
|
*/ key: "socket",
|
89656
|
-
value: function socket(nsp,
|
90026
|
+
value: function socket(nsp, opts2) {
|
89657
90027
|
var socket = this.nsps[nsp];
|
89658
90028
|
if (!socket) {
|
89659
|
-
socket = new Socket2(this, nsp,
|
90029
|
+
socket = new Socket2(this, nsp, opts2);
|
89660
90030
|
this.nsps[nsp] = socket;
|
89661
90031
|
} else if (this._autoConnect && !socket.active) {
|
89662
90032
|
socket.connect();
|
@@ -89829,31 +90199,31 @@ var Manager = /*#__PURE__*/ function(Emitter) {
|
|
89829
90199
|
}(Emitter);
|
89830
90200
|
// node_modules/socket.io-client/build/esm/index.js
|
89831
90201
|
var cache = {};
|
89832
|
-
function lookup2(uri,
|
90202
|
+
function lookup2(uri, opts2) {
|
89833
90203
|
if ((typeof uri === "undefined" ? "undefined" : _type_of(uri)) === "object") {
|
89834
|
-
|
90204
|
+
opts2 = uri;
|
89835
90205
|
uri = void 0;
|
89836
90206
|
}
|
89837
|
-
|
89838
|
-
var parsed = url(uri,
|
90207
|
+
opts2 = opts2 || {};
|
90208
|
+
var parsed = url(uri, opts2.path || "/socket.io");
|
89839
90209
|
var source = parsed.source;
|
89840
90210
|
var id = parsed.id;
|
89841
90211
|
var path = parsed.path;
|
89842
90212
|
var sameNamespace = cache[id] && path in cache[id]["nsps"];
|
89843
|
-
var newConnection =
|
90213
|
+
var newConnection = opts2.forceNew || opts2["force new connection"] || false === opts2.multiplex || sameNamespace;
|
89844
90214
|
var io;
|
89845
90215
|
if (newConnection) {
|
89846
|
-
io = new Manager(source,
|
90216
|
+
io = new Manager(source, opts2);
|
89847
90217
|
} else {
|
89848
90218
|
if (!cache[id]) {
|
89849
|
-
cache[id] = new Manager(source,
|
90219
|
+
cache[id] = new Manager(source, opts2);
|
89850
90220
|
}
|
89851
90221
|
io = cache[id];
|
89852
90222
|
}
|
89853
|
-
if (parsed.query && !
|
89854
|
-
|
90223
|
+
if (parsed.query && !opts2.query) {
|
90224
|
+
opts2.query = parsed.queryKey;
|
89855
90225
|
}
|
89856
|
-
return io.socket(parsed.path,
|
90226
|
+
return io.socket(parsed.path, opts2);
|
89857
90227
|
}
|
89858
90228
|
Object.assign(lookup2, {
|
89859
90229
|
Manager: Manager,
|