stormcloud-video-player 0.8.15 → 0.8.17

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.
Files changed (52) hide show
  1. package/dist/stormcloud-vp.min.js +2 -2
  2. package/lib/index.cjs +4476 -4205
  3. package/lib/index.cjs.map +1 -1
  4. package/lib/index.d.cts +18 -190
  5. package/lib/index.d.ts +18 -190
  6. package/lib/index.js +4483 -4204
  7. package/lib/index.js.map +1 -1
  8. package/lib/player/AdBreakOrchestrator.cjs +2275 -0
  9. package/lib/player/AdBreakOrchestrator.cjs.map +1 -0
  10. package/lib/player/AdBreakOrchestrator.d.cts +62 -0
  11. package/lib/player/AdPreloadPool.cjs +673 -0
  12. package/lib/player/AdPreloadPool.cjs.map +1 -0
  13. package/lib/player/AdPreloadPool.d.cts +37 -0
  14. package/lib/player/AdTimingService.cjs +841 -0
  15. package/lib/player/AdTimingService.cjs.map +1 -0
  16. package/lib/player/AdTimingService.d.cts +88 -0
  17. package/lib/player/HlsEngine.cjs +1502 -0
  18. package/lib/player/HlsEngine.cjs.map +1 -0
  19. package/lib/player/HlsEngine.d.cts +38 -0
  20. package/lib/player/PlaceholderLayer.cjs +191 -0
  21. package/lib/player/PlaceholderLayer.cjs.map +1 -0
  22. package/lib/player/PlaceholderLayer.d.cts +12 -0
  23. package/lib/player/PlayerControls.cjs +225 -0
  24. package/lib/player/PlayerControls.cjs.map +1 -0
  25. package/lib/player/PlayerControls.d.cts +13 -0
  26. package/lib/player/Scte35CueManager.cjs +413 -0
  27. package/lib/player/Scte35CueManager.cjs.map +1 -0
  28. package/lib/player/Scte35CueManager.d.cts +43 -0
  29. package/lib/player/Scte35Parser.cjs +945 -0
  30. package/lib/player/Scte35Parser.cjs.map +1 -0
  31. package/lib/player/Scte35Parser.d.cts +23 -0
  32. package/lib/player/StormcloudVideoPlayer.cjs +4449 -4178
  33. package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
  34. package/lib/player/StormcloudVideoPlayer.d.cts +19 -191
  35. package/lib/player/VmapManager.cjs +1706 -0
  36. package/lib/player/VmapManager.cjs.map +1 -0
  37. package/lib/player/VmapManager.d.cts +38 -0
  38. package/lib/player/playerTypes.cjs +49 -0
  39. package/lib/player/playerTypes.cjs.map +1 -0
  40. package/lib/player/playerTypes.d.cts +20 -0
  41. package/lib/players/HlsPlayer.cjs +4449 -4179
  42. package/lib/players/HlsPlayer.cjs.map +1 -1
  43. package/lib/players/HlsPlayer.d.cts +1 -1
  44. package/lib/players/index.cjs +4449 -4179
  45. package/lib/players/index.cjs.map +1 -1
  46. package/lib/sdk/hlsAdPlayer.d.cts +1 -1
  47. package/lib/{types-CWWADkvd.d.cts → types-DNiBmPKK.d.cts} +18 -1
  48. package/lib/ui/StormcloudVideoPlayer.cjs +4478 -4207
  49. package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
  50. package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
  51. package/lib/utils/tracking.d.cts +1 -1
  52. package/package.json +1 -1
@@ -0,0 +1,2275 @@
1
+ "use strict";
2
+ function _array_like_to_array(arr, len) {
3
+ if (len == null || len > arr.length) len = arr.length;
4
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5
+ return arr2;
6
+ }
7
+ function _array_without_holes(arr) {
8
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
9
+ }
10
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
11
+ try {
12
+ var info = gen[key](arg);
13
+ var value = info.value;
14
+ } catch (error) {
15
+ reject(error);
16
+ return;
17
+ }
18
+ if (info.done) {
19
+ resolve(value);
20
+ } else {
21
+ Promise.resolve(value).then(_next, _throw);
22
+ }
23
+ }
24
+ function _async_to_generator(fn) {
25
+ return function() {
26
+ var self = this, args = arguments;
27
+ return new Promise(function(resolve, reject) {
28
+ var gen = fn.apply(self, args);
29
+ function _next(value) {
30
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
31
+ }
32
+ function _throw(err) {
33
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
34
+ }
35
+ _next(undefined);
36
+ });
37
+ };
38
+ }
39
+ function _class_call_check(instance, Constructor) {
40
+ if (!(instance instanceof Constructor)) {
41
+ throw new TypeError("Cannot call a class as a function");
42
+ }
43
+ }
44
+ function _defineProperties(target, props) {
45
+ for(var i = 0; i < props.length; i++){
46
+ var descriptor = props[i];
47
+ descriptor.enumerable = descriptor.enumerable || false;
48
+ descriptor.configurable = true;
49
+ if ("value" in descriptor) descriptor.writable = true;
50
+ Object.defineProperty(target, descriptor.key, descriptor);
51
+ }
52
+ }
53
+ function _create_class(Constructor, protoProps, staticProps) {
54
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
55
+ if (staticProps) _defineProperties(Constructor, staticProps);
56
+ return Constructor;
57
+ }
58
+ function _define_property(obj, key, value) {
59
+ if (key in obj) {
60
+ Object.defineProperty(obj, key, {
61
+ value: value,
62
+ enumerable: true,
63
+ configurable: true,
64
+ writable: true
65
+ });
66
+ } else {
67
+ obj[key] = value;
68
+ }
69
+ return obj;
70
+ }
71
+ function _iterable_to_array(iter) {
72
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
73
+ }
74
+ function _non_iterable_spread() {
75
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
76
+ }
77
+ function _object_spread(target) {
78
+ for(var i = 1; i < arguments.length; i++){
79
+ var source = arguments[i] != null ? arguments[i] : {};
80
+ var ownKeys = Object.keys(source);
81
+ if (typeof Object.getOwnPropertySymbols === "function") {
82
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
83
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
84
+ }));
85
+ }
86
+ ownKeys.forEach(function(key) {
87
+ _define_property(target, key, source[key]);
88
+ });
89
+ }
90
+ return target;
91
+ }
92
+ function _to_consumable_array(arr) {
93
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
94
+ }
95
+ function _type_of(obj) {
96
+ "@swc/helpers - typeof";
97
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
98
+ }
99
+ function _unsupported_iterable_to_array(o, minLen) {
100
+ if (!o) return;
101
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
102
+ var n = Object.prototype.toString.call(o).slice(8, -1);
103
+ if (n === "Object" && o.constructor) n = o.constructor.name;
104
+ if (n === "Map" || n === "Set") return Array.from(n);
105
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
106
+ }
107
+ function _ts_generator(thisArg, body) {
108
+ var f, y, t, _ = {
109
+ label: 0,
110
+ sent: function() {
111
+ if (t[0] & 1) throw t[1];
112
+ return t[1];
113
+ },
114
+ trys: [],
115
+ ops: []
116
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
117
+ return d(g, "next", {
118
+ value: verb(0)
119
+ }), d(g, "throw", {
120
+ value: verb(1)
121
+ }), d(g, "return", {
122
+ value: verb(2)
123
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
124
+ value: function() {
125
+ return this;
126
+ }
127
+ }), g;
128
+ function verb(n) {
129
+ return function(v) {
130
+ return step([
131
+ n,
132
+ v
133
+ ]);
134
+ };
135
+ }
136
+ function step(op) {
137
+ if (f) throw new TypeError("Generator is already executing.");
138
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
139
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
140
+ if (y = 0, t) op = [
141
+ op[0] & 2,
142
+ t.value
143
+ ];
144
+ switch(op[0]){
145
+ case 0:
146
+ case 1:
147
+ t = op;
148
+ break;
149
+ case 4:
150
+ _.label++;
151
+ return {
152
+ value: op[1],
153
+ done: false
154
+ };
155
+ case 5:
156
+ _.label++;
157
+ y = op[1];
158
+ op = [
159
+ 0
160
+ ];
161
+ continue;
162
+ case 7:
163
+ op = _.ops.pop();
164
+ _.trys.pop();
165
+ continue;
166
+ default:
167
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
168
+ _ = 0;
169
+ continue;
170
+ }
171
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
172
+ _.label = op[1];
173
+ break;
174
+ }
175
+ if (op[0] === 6 && _.label < t[1]) {
176
+ _.label = t[1];
177
+ t = op;
178
+ break;
179
+ }
180
+ if (t && _.label < t[2]) {
181
+ _.label = t[2];
182
+ _.ops.push(op);
183
+ break;
184
+ }
185
+ if (t[2]) _.ops.pop();
186
+ _.trys.pop();
187
+ continue;
188
+ }
189
+ op = body.call(thisArg, _);
190
+ } catch (e) {
191
+ op = [
192
+ 6,
193
+ e
194
+ ];
195
+ y = 0;
196
+ } finally{
197
+ f = t = 0;
198
+ }
199
+ if (op[0] & 5) throw op[1];
200
+ return {
201
+ value: op[0] ? op[1] : void 0,
202
+ done: true
203
+ };
204
+ }
205
+ }
206
+ function _ts_values(o) {
207
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
208
+ if (m) return m.call(o);
209
+ if (o && typeof o.length === "number") return {
210
+ next: function() {
211
+ if (o && i >= o.length) o = void 0;
212
+ return {
213
+ value: o && o[i++],
214
+ done: !o
215
+ };
216
+ }
217
+ };
218
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
219
+ }
220
+ var __create = Object.create;
221
+ var __defProp = Object.defineProperty;
222
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
223
+ var __getOwnPropNames = Object.getOwnPropertyNames;
224
+ var __getProtoOf = Object.getPrototypeOf;
225
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
226
+ var __export = function __export(target, all) {
227
+ for(var name in all)__defProp(target, name, {
228
+ get: all[name],
229
+ enumerable: true
230
+ });
231
+ };
232
+ var __copyProps = function __copyProps(to, from, except, desc) {
233
+ if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
234
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
235
+ try {
236
+ var _loop = function() {
237
+ var key = _step.value;
238
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
239
+ get: function get() {
240
+ return from[key];
241
+ },
242
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
243
+ });
244
+ };
245
+ for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
246
+ } catch (err) {
247
+ _didIteratorError = true;
248
+ _iteratorError = err;
249
+ } finally{
250
+ try {
251
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
252
+ _iterator.return();
253
+ }
254
+ } finally{
255
+ if (_didIteratorError) {
256
+ throw _iteratorError;
257
+ }
258
+ }
259
+ }
260
+ }
261
+ return to;
262
+ };
263
+ var __toESM = function __toESM(mod, isNodeMode, target) {
264
+ return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
265
+ // file that has been converted to a CommonJS file using a Babel-
266
+ // compatible transform (i.e. "__esModule" has not been set), then set
267
+ // "default" to the CommonJS "module.exports" for node compatibility.
268
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
269
+ value: mod,
270
+ enumerable: true
271
+ }) : target, mod);
272
+ };
273
+ var __toCommonJS = function __toCommonJS(mod) {
274
+ return __copyProps(__defProp({}, "__esModule", {
275
+ value: true
276
+ }), mod);
277
+ };
278
+ // src/player/AdBreakOrchestrator.ts
279
+ var AdBreakOrchestrator_exports = {};
280
+ __export(AdBreakOrchestrator_exports, {
281
+ AdBreakOrchestrator: function AdBreakOrchestrator1() {
282
+ return AdBreakOrchestrator;
283
+ }
284
+ });
285
+ module.exports = __toCommonJS(AdBreakOrchestrator_exports);
286
+ // src/utils/mqttConfig.ts
287
+ var DEFAULT_MQTT_CONFIG = {
288
+ enabled: true,
289
+ brokerAddress: "vecbae77.ala.us-east-1.emqxsl.com",
290
+ brokerPort: 8883,
291
+ wsPort: 8084,
292
+ username: "for-sonifi",
293
+ password: "sonifi-mqtt",
294
+ topicPrefix: "adstorm/players",
295
+ qos: 1
296
+ };
297
+ var mqttConfig = _object_spread({}, DEFAULT_MQTT_CONFIG);
298
+ function isMQTTEnabled() {
299
+ return mqttConfig.enabled;
300
+ }
301
+ function buildMQTTBrokerUrl() {
302
+ if (mqttConfig.brokerUrl) return mqttConfig.brokerUrl;
303
+ return "wss://".concat(mqttConfig.brokerAddress, ":").concat(mqttConfig.wsPort, "/mqtt");
304
+ }
305
+ function buildPlayerTopic(licenseKey, channel) {
306
+ return "".concat(mqttConfig.topicPrefix, "/").concat(licenseKey, "/").concat(channel);
307
+ }
308
+ // src/utils/mqttClient.ts
309
+ var import_mqtt = __toESM(require("mqtt"), 1);
310
+ var LOG = "[StormcloudVideoPlayer][MQTT]";
311
+ var client = null;
312
+ var status = "disconnected";
313
+ function initMQTTClient() {
314
+ if (client || !isMQTTEnabled()) return;
315
+ var url = buildMQTTBrokerUrl();
316
+ status = "connecting";
317
+ var clientId = "stormcloud-vp-".concat(Math.random().toString(36).slice(2, 9));
318
+ try {
319
+ client = import_mqtt.default.connect(url, {
320
+ clientId: clientId,
321
+ username: mqttConfig.username,
322
+ password: mqttConfig.password,
323
+ keepalive: 60,
324
+ clean: true,
325
+ reconnectPeriod: 5e3,
326
+ connectTimeout: 1e4,
327
+ queueQoSZero: false
328
+ });
329
+ } catch (err) {
330
+ status = "error";
331
+ console.warn("".concat(LOG, " connect() threw:"), err);
332
+ return;
333
+ }
334
+ client.on("connect", function() {
335
+ status = "connected";
336
+ console.info("".concat(LOG, " connected to ").concat(url));
337
+ });
338
+ client.on("reconnect", function() {
339
+ status = "connecting";
340
+ console.info("".concat(LOG, " reconnecting…"));
341
+ });
342
+ client.on("offline", function() {
343
+ status = "disconnected";
344
+ console.warn("".concat(LOG, " offline"));
345
+ });
346
+ client.on("error", function(err) {
347
+ status = "error";
348
+ console.warn("".concat(LOG, " error:"), err.message);
349
+ });
350
+ client.on("close", function() {
351
+ if (status === "connected") {
352
+ status = "disconnected";
353
+ }
354
+ });
355
+ }
356
+ function ensureMQTTClient() {
357
+ if (isMQTTEnabled() && !client) {
358
+ initMQTTClient();
359
+ }
360
+ }
361
+ function publishMQTT(topic, payload) {
362
+ if (!isMQTTEnabled()) {
363
+ return false;
364
+ }
365
+ ensureMQTTClient();
366
+ if (!client) {
367
+ return false;
368
+ }
369
+ try {
370
+ client.publish(topic, JSON.stringify(payload), {
371
+ qos: mqttConfig.qos
372
+ });
373
+ return true;
374
+ } catch (err) {
375
+ console.warn("".concat(LOG, " publish failed on ").concat(topic, ":"), err);
376
+ return false;
377
+ }
378
+ }
379
+ // src/utils/tracking.ts
380
+ var cachedBrowserId = null;
381
+ function getClientInfo() {
382
+ var _screen, _screen1, _screen2, _screen3, _screen_orientation, _screen4, _screen5, _window, _window1, _window_screen_orientation, _window_screen, _navigator_languages;
383
+ var ua = navigator.userAgent;
384
+ var platform = navigator.platform;
385
+ var vendor = navigator.vendor || "";
386
+ var maxTouchPoints = navigator.maxTouchPoints || 0;
387
+ var memory = navigator.deviceMemory || null;
388
+ var hardwareConcurrency = navigator.hardwareConcurrency || 1;
389
+ var screenInfo = {
390
+ width: (_screen = screen) === null || _screen === void 0 ? void 0 : _screen.width,
391
+ height: (_screen1 = screen) === null || _screen1 === void 0 ? void 0 : _screen1.height,
392
+ availWidth: (_screen2 = screen) === null || _screen2 === void 0 ? void 0 : _screen2.availWidth,
393
+ availHeight: (_screen3 = screen) === null || _screen3 === void 0 ? void 0 : _screen3.availHeight,
394
+ orientation: ((_screen4 = screen) === null || _screen4 === void 0 ? void 0 : (_screen_orientation = _screen4.orientation) === null || _screen_orientation === void 0 ? void 0 : _screen_orientation.type) || "",
395
+ pixelDepth: (_screen5 = screen) === null || _screen5 === void 0 ? void 0 : _screen5.pixelDepth
396
+ };
397
+ var deviceType = "desktop";
398
+ var brand = "Unknown";
399
+ var os = "Unknown";
400
+ var model = "";
401
+ var isSmartTV = false;
402
+ var isAndroid = false;
403
+ var isWebView = false;
404
+ var isWebApp = false;
405
+ if (ua.includes("Web0S")) {
406
+ brand = "LG";
407
+ os = "webOS";
408
+ isSmartTV = true;
409
+ deviceType = "tv";
410
+ var webosMatch = ua.match(/Web0S\/([^\s]+)/);
411
+ model = webosMatch ? "webOS ".concat(webosMatch[1]) : "webOS TV";
412
+ } else if (ua.includes("Tizen")) {
413
+ brand = "Samsung";
414
+ os = "Tizen";
415
+ isSmartTV = true;
416
+ deviceType = "tv";
417
+ var tizenMatch = ua.match(/Tizen\/([^\s]+)/);
418
+ var tvMatch = ua.match(/(?:Smart-TV|SMART-TV|TV)/i) ? "Smart TV" : "";
419
+ model = tizenMatch ? "Tizen ".concat(tizenMatch[1], " ").concat(tvMatch).trim() : "Tizen TV";
420
+ } else if (ua.includes("Philips")) {
421
+ brand = "Philips";
422
+ os = "Saphi";
423
+ isSmartTV = true;
424
+ deviceType = "tv";
425
+ } else if (ua.includes("Sharp") || ua.includes("AQUOS")) {
426
+ brand = "Sharp";
427
+ os = "Android TV";
428
+ isSmartTV = true;
429
+ deviceType = "tv";
430
+ } else if (ua.includes("Android") && (ua.includes("Sony") || vendor.includes("Sony"))) {
431
+ brand = "Sony";
432
+ os = "Android TV";
433
+ isSmartTV = true;
434
+ deviceType = "tv";
435
+ } else if (ua.includes("Android") && (ua.includes("NetCast") || ua.includes("LG"))) {
436
+ brand = "LG";
437
+ os = "Android TV";
438
+ isSmartTV = true;
439
+ deviceType = "tv";
440
+ } else if (ua.includes(" Roku") || ua.includes("Roku/")) {
441
+ brand = "Roku";
442
+ os = "Roku OS";
443
+ isSmartTV = true;
444
+ deviceType = "tv";
445
+ } else if (ua.includes("AppleTV")) {
446
+ brand = "Apple";
447
+ os = "tvOS";
448
+ isSmartTV = true;
449
+ deviceType = "tv";
450
+ }
451
+ if (ua.includes("Android")) {
452
+ isAndroid = true;
453
+ os = "Android";
454
+ deviceType = /Mobile/.test(ua) ? "mobile" : "tablet";
455
+ if (ua.includes("Android") && (maxTouchPoints === 0 || ua.includes("Google TV") || ua.includes("XiaoMi"))) {
456
+ deviceType = "tv";
457
+ isSmartTV = true;
458
+ brand = brand === "Unknown" ? "Android TV" : brand;
459
+ }
460
+ var androidModelMatch = ua.match(/\(([^)]*Android[^)]*)\)/);
461
+ if (androidModelMatch && androidModelMatch[1]) {
462
+ model = androidModelMatch[1];
463
+ }
464
+ }
465
+ if (/iPad|iPhone|iPod/.test(ua)) {
466
+ os = "iOS";
467
+ deviceType = "mobile";
468
+ brand = "Apple";
469
+ if (navigator.maxTouchPoints > 1 && /iPad/.test(ua)) {
470
+ deviceType = "tablet";
471
+ }
472
+ }
473
+ if (!isAndroid && !isSmartTV && !/Mobile/.test(ua)) {
474
+ if (ua.includes("Windows")) {
475
+ os = "Windows";
476
+ deviceType = "desktop";
477
+ } else if (ua.includes("Mac") && !/iPhone/.test(ua)) {
478
+ os = "macOS";
479
+ deviceType = "desktop";
480
+ if (maxTouchPoints > 1) deviceType = "tablet";
481
+ } else if (ua.includes("Linux")) {
482
+ os = "Linux";
483
+ deviceType = "desktop";
484
+ }
485
+ }
486
+ if (brand === "Unknown") {
487
+ if (vendor.includes("Google") || ua.includes("Chrome")) brand = "Google";
488
+ if (vendor.includes("Apple")) brand = "Apple";
489
+ if (vendor.includes("Samsung") || ua.includes("SM-")) brand = "Samsung";
490
+ }
491
+ isWebView = /wv|WebView|Linux; U;/.test(ua);
492
+ if (((_window = window) === null || _window === void 0 ? void 0 : _window.outerHeight) === 0 && ((_window1 = window) === null || _window1 === void 0 ? void 0 : _window1.outerWidth) === 0) {
493
+ isWebView = true;
494
+ }
495
+ isWebApp = window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone === true || ((_window_screen = window.screen) === null || _window_screen === void 0 ? void 0 : (_window_screen_orientation = _window_screen.orientation) === null || _window_screen_orientation === void 0 ? void 0 : _window_screen_orientation.angle) !== void 0;
496
+ return {
497
+ brand: brand,
498
+ os: os,
499
+ model: model || ua.substring(0, 50) + "...",
500
+ deviceType: deviceType,
501
+ isSmartTV: isSmartTV,
502
+ isAndroid: isAndroid,
503
+ isWebView: isWebView,
504
+ isWebApp: isWebApp,
505
+ domain: window.location.hostname,
506
+ origin: window.location.origin,
507
+ path: window.location.pathname,
508
+ userAgent: ua,
509
+ vendor: vendor,
510
+ platform: platform,
511
+ screen: screenInfo,
512
+ hardwareConcurrency: hardwareConcurrency,
513
+ deviceMemory: memory,
514
+ maxTouchPoints: maxTouchPoints,
515
+ language: navigator.language,
516
+ languages: ((_navigator_languages = navigator.languages) === null || _navigator_languages === void 0 ? void 0 : _navigator_languages.join(",")) || "",
517
+ cookieEnabled: navigator.cookieEnabled,
518
+ doNotTrack: navigator.doNotTrack || "",
519
+ referrer: document.referrer,
520
+ visibilityState: document.visibilityState
521
+ };
522
+ }
523
+ function getBrowserID(clientInfo) {
524
+ return _async_to_generator(function() {
525
+ var _crypto_subtle, fingerprintString, encodedData, utf8, buffer, i, hashBuffer, hashHex, unused, hash, i1, char, fallbackHash, timestamp, random;
526
+ return _ts_generator(this, function(_state) {
527
+ switch(_state.label){
528
+ case 0:
529
+ if (cachedBrowserId) {
530
+ return [
531
+ 2,
532
+ cachedBrowserId
533
+ ];
534
+ }
535
+ fingerprintString = JSON.stringify(clientInfo);
536
+ if (!(typeof crypto !== "undefined" && ((_crypto_subtle = crypto.subtle) === null || _crypto_subtle === void 0 ? void 0 : _crypto_subtle.digest))) return [
537
+ 3,
538
+ 5
539
+ ];
540
+ _state.label = 1;
541
+ case 1:
542
+ _state.trys.push([
543
+ 1,
544
+ 4,
545
+ ,
546
+ 5
547
+ ]);
548
+ return [
549
+ 4,
550
+ crypto.subtle.digest("SHA-256", new Uint8Array([
551
+ 1,
552
+ 2,
553
+ 3
554
+ ]))
555
+ ];
556
+ case 2:
557
+ _state.sent();
558
+ if (typeof TextEncoder !== "undefined") {
559
+ encodedData = new TextEncoder().encode(fingerprintString);
560
+ } else {
561
+ utf8 = unescape(encodeURIComponent(fingerprintString));
562
+ buffer = new Uint8Array(utf8.length);
563
+ for(i = 0; i < utf8.length; i++){
564
+ buffer[i] = utf8.charCodeAt(i);
565
+ }
566
+ encodedData = buffer;
567
+ }
568
+ return [
569
+ 4,
570
+ crypto.subtle.digest("SHA-256", encodedData)
571
+ ];
572
+ case 3:
573
+ hashBuffer = _state.sent();
574
+ hashHex = Array.from(new Uint8Array(hashBuffer)).map(function(b) {
575
+ return b.toString(16).padStart(2, "0");
576
+ }).join("");
577
+ cachedBrowserId = hashHex;
578
+ return [
579
+ 2,
580
+ hashHex
581
+ ];
582
+ case 4:
583
+ unused = _state.sent();
584
+ console.warn("[StormcloudVideoPlayer] crypto.subtle not supported, using fallback hash");
585
+ return [
586
+ 3,
587
+ 5
588
+ ];
589
+ case 5:
590
+ hash = 0;
591
+ for(i1 = 0; i1 < fingerprintString.length; i1++){
592
+ char = fingerprintString.charCodeAt(i1);
593
+ hash = (hash << 5) - hash + char;
594
+ hash = hash & hash;
595
+ }
596
+ fallbackHash = Math.abs(hash).toString(16).padStart(8, "0");
597
+ timestamp = Date.now().toString(16).padStart(12, "0");
598
+ random = Math.random().toString(16).substring(2, 14).padStart(12, "0");
599
+ cachedBrowserId = (fallbackHash + timestamp + random).padEnd(64, "0");
600
+ return [
601
+ 2,
602
+ cachedBrowserId
603
+ ];
604
+ }
605
+ });
606
+ })();
607
+ }
608
+ function canPublish(licenseKey) {
609
+ return Boolean(isMQTTEnabled() && licenseKey);
610
+ }
611
+ function buildPlayerMetricEvent() {
612
+ return _async_to_generator(function() {
613
+ var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, playerId, captureAt;
614
+ var _arguments = arguments;
615
+ return _ts_generator(this, function(_state) {
616
+ switch(_state.label){
617
+ case 0:
618
+ context = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, flags = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
619
+ clientInfo = getClientInfo();
620
+ return [
621
+ 4,
622
+ getBrowserID(clientInfo)
623
+ ];
624
+ case 1:
625
+ playerId = _state.sent();
626
+ captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
627
+ return [
628
+ 2,
629
+ _object_spread({
630
+ player_id: playerId,
631
+ device_type: clientInfo.deviceType,
632
+ os: clientInfo.os.toLowerCase(),
633
+ ad_loaded: (_flags_adLoaded = flags.adLoaded) !== null && _flags_adLoaded !== void 0 ? _flags_adLoaded : false,
634
+ ad_detect: (_flags_adDetect = flags.adDetect) !== null && _flags_adDetect !== void 0 ? _flags_adDetect : false,
635
+ capture_at: captureAt
636
+ }, context.inputStreamType ? {
637
+ input_stream_type: context.inputStreamType
638
+ } : {})
639
+ ];
640
+ }
641
+ });
642
+ }).apply(this, arguments);
643
+ }
644
+ function publishTracking(licenseKey, channel, body) {
645
+ ensureMQTTClient();
646
+ publishMQTT(buildPlayerTopic(licenseKey, channel), body);
647
+ }
648
+ function sendAdLoadedTracking(_0, _1) {
649
+ return _async_to_generator(function(licenseKey, adLoadedInfo) {
650
+ var context, error;
651
+ var _arguments = arguments;
652
+ return _ts_generator(this, function(_state) {
653
+ switch(_state.label){
654
+ case 0:
655
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
656
+ _state.label = 1;
657
+ case 1:
658
+ _state.trys.push([
659
+ 1,
660
+ 3,
661
+ ,
662
+ 4
663
+ ]);
664
+ return [
665
+ 4,
666
+ sendHeartbeat(licenseKey, context, {
667
+ adLoaded: true,
668
+ captureAt: adLoadedInfo.timestamp
669
+ })
670
+ ];
671
+ case 2:
672
+ _state.sent();
673
+ return [
674
+ 3,
675
+ 4
676
+ ];
677
+ case 3:
678
+ error = _state.sent();
679
+ console.error("[StormcloudVideoPlayer] Error sending ad loaded tracking:", error);
680
+ return [
681
+ 3,
682
+ 4
683
+ ];
684
+ case 4:
685
+ return [
686
+ 2
687
+ ];
688
+ }
689
+ });
690
+ }).apply(this, arguments);
691
+ }
692
+ function sendAdImpressionTracking(_0, _1) {
693
+ return _async_to_generator(function(licenseKey, adImpressionInfo) {
694
+ var context, metricEvent, error;
695
+ var _arguments = arguments;
696
+ return _ts_generator(this, function(_state) {
697
+ switch(_state.label){
698
+ case 0:
699
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
700
+ if (!canPublish(licenseKey)) return [
701
+ 2
702
+ ];
703
+ _state.label = 1;
704
+ case 1:
705
+ _state.trys.push([
706
+ 1,
707
+ 3,
708
+ ,
709
+ 4
710
+ ]);
711
+ return [
712
+ 4,
713
+ buildPlayerMetricEvent(context, {
714
+ captureAt: adImpressionInfo.timestamp
715
+ })
716
+ ];
717
+ case 2:
718
+ metricEvent = _state.sent();
719
+ publishTracking(licenseKey, "heartbeat", metricEvent);
720
+ publishTracking(licenseKey, "impressions", {
721
+ events: [
722
+ {
723
+ player_id: metricEvent.player_id,
724
+ ad_played_count: 1,
725
+ ad_url: adImpressionInfo.adUrl,
726
+ capture_at: adImpressionInfo.timestamp
727
+ }
728
+ ]
729
+ });
730
+ return [
731
+ 3,
732
+ 4
733
+ ];
734
+ case 3:
735
+ error = _state.sent();
736
+ console.error("[StormcloudVideoPlayer] Error sending ad impression tracking:", error);
737
+ return [
738
+ 3,
739
+ 4
740
+ ];
741
+ case 4:
742
+ return [
743
+ 2
744
+ ];
745
+ }
746
+ });
747
+ }).apply(this, arguments);
748
+ }
749
+ function sendHeartbeat(_0) {
750
+ return _async_to_generator(function(licenseKey) {
751
+ var context, flags, heartbeatData, error;
752
+ var _arguments = arguments;
753
+ return _ts_generator(this, function(_state) {
754
+ switch(_state.label){
755
+ case 0:
756
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
757
+ if (!canPublish(licenseKey)) return [
758
+ 2
759
+ ];
760
+ _state.label = 1;
761
+ case 1:
762
+ _state.trys.push([
763
+ 1,
764
+ 3,
765
+ ,
766
+ 4
767
+ ]);
768
+ return [
769
+ 4,
770
+ buildPlayerMetricEvent(context, flags)
771
+ ];
772
+ case 2:
773
+ heartbeatData = _state.sent();
774
+ publishTracking(licenseKey, "heartbeat", heartbeatData);
775
+ return [
776
+ 3,
777
+ 4
778
+ ];
779
+ case 3:
780
+ error = _state.sent();
781
+ console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
782
+ return [
783
+ 3,
784
+ 4
785
+ ];
786
+ case 4:
787
+ return [
788
+ 2
789
+ ];
790
+ }
791
+ });
792
+ }).apply(this, arguments);
793
+ }
794
+ // src/player/PlayerControls.ts
795
+ function getAdAudioVolume(adPlayer) {
796
+ return adPlayer.getOriginalMutedState() ? 0 : adPlayer.getOriginalVolume();
797
+ }
798
+ // src/player/AdBreakOrchestrator.ts
799
+ var AdBreakOrchestrator = /*#__PURE__*/ function() {
800
+ function AdBreakOrchestrator(host, timing, preloadPool, vmap, cueManager, placeholder) {
801
+ _class_call_check(this, AdBreakOrchestrator);
802
+ this.inAdBreak = false;
803
+ this.showAds = false;
804
+ this.isShowingPlaceholder = false;
805
+ this.adDetectSentForCurrentBreak = false;
806
+ this.continuousFetchingActive = false;
807
+ this.continuousFetchLoopRunning = false;
808
+ this.adRequestQueue = [];
809
+ this.adPodQueue = [];
810
+ this.maxPlaceholderDurationMs = 5e3;
811
+ this.pendingAdBreak = null;
812
+ this.host = host;
813
+ this.timing = timing;
814
+ this.preloadPool = preloadPool;
815
+ this.vmap = vmap;
816
+ this.cueManager = cueManager;
817
+ this.placeholder = placeholder;
818
+ }
819
+ _create_class(AdBreakOrchestrator, [
820
+ {
821
+ key: "debug",
822
+ get: function get() {
823
+ return !!this.host.config.debugAdTiming;
824
+ }
825
+ },
826
+ {
827
+ // ───────────────────────────────────────────────────────────────
828
+ // IMA event listeners
829
+ // ───────────────────────────────────────────────────────────────
830
+ key: "attachImaEventListeners",
831
+ value: function attachImaEventListeners() {
832
+ var _this = this;
833
+ var adPlayer = this.host.getAdPlayer();
834
+ adPlayer.on("all_ads_completed", function() {
835
+ sendAdImpressionTracking(_this.host.config.licenseKey, {
836
+ source: "hls",
837
+ adIndex: _this.timing.currentAdIndex,
838
+ timestamp: /* @__PURE__ */ new Date().toISOString()
839
+ }).catch(function() {});
840
+ _this.timing.recordPlayedAdDuration(_this.host.getAdPlayer());
841
+ var remaining = _this.timing.getRemainingAdMs();
842
+ _this.timing.consecutiveFailures = 0;
843
+ if (_this.debug) {
844
+ console.log("[StormcloudVideoPlayer] all_ads_completed event received - remaining=".concat(remaining, "ms, queued ads=").concat(_this.adRequestQueue.length), _this.adRequestQueue.length > 0 ? {
845
+ queuedUrls: _to_consumable_array(_this.adRequestQueue)
846
+ } : {});
847
+ }
848
+ if (_this.inAdBreak) {
849
+ if (_this.timing.hasTimeToStartAnotherAd()) {
850
+ _this.tryNextAvailableAdWithRateLimit();
851
+ } else {
852
+ _this.handleAdPodComplete();
853
+ }
854
+ }
855
+ });
856
+ adPlayer.on("ad_error", function(errorPayload) {
857
+ var errorMessage = "Ad playback failed";
858
+ if (errorPayload) {
859
+ var errorCode = errorPayload.code || errorPayload.errorCode || "unknown";
860
+ var vastErrorCode = errorPayload.vastErrorCode;
861
+ var message = errorPayload.message || errorPayload.errorMessage || "Unknown error";
862
+ var cause = errorPayload.cause || errorPayload.innerError || errorPayload.error;
863
+ errorMessage = "Ad error: AdError ".concat(errorCode, ": ").concat(message);
864
+ if (vastErrorCode && vastErrorCode !== "N/A" && vastErrorCode !== errorCode) {
865
+ errorMessage += " (VAST Error Code: ".concat(vastErrorCode, ")");
866
+ }
867
+ if (cause) {
868
+ var causeMessage = typeof cause === "string" ? cause : cause.message || String(cause);
869
+ errorMessage += ". Caused by: ".concat(causeMessage);
870
+ }
871
+ }
872
+ console.error("[AD-ERROR]", errorMessage, errorPayload || "");
873
+ _this.handleAdFailure();
874
+ });
875
+ adPlayer.on("content_pause", function() {
876
+ _this.timing.clearAdFailsafeTimer();
877
+ _this.timing.clearAdRequestWatchdog();
878
+ _this.timing.activeAdRequestToken = null;
879
+ _this.showAds = true;
880
+ _this.timing.resetGamNoFillCounter();
881
+ if (_this.inAdBreak && _this.timing.expectedAdBreakDurationMs != null && _this.timing.getAdBreakEndWallClockMs() == null) {
882
+ _this.timing.scheduleAdStopAtBreakBoundary();
883
+ if (_this.debug) {
884
+ console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
885
+ }
886
+ }
887
+ _this.host.getAdPlayer().setAdVolume(getAdAudioVolume(_this.host.getAdPlayer()));
888
+ if (_this.isShowingPlaceholder) {
889
+ if (_this.debug) {
890
+ console.log("[StormcloudVideoPlayer] Hiding placeholder - new ads starting");
891
+ }
892
+ _this.host.getAdPlayer().hidePlaceholder();
893
+ _this.isShowingPlaceholder = false;
894
+ }
895
+ });
896
+ adPlayer.on("content_resume", function() {
897
+ sendAdImpressionTracking(_this.host.config.licenseKey, {
898
+ source: "hls",
899
+ adIndex: _this.timing.currentAdIndex,
900
+ timestamp: /* @__PURE__ */ new Date().toISOString()
901
+ }).catch(function() {});
902
+ if (!_this.host.video.muted) {
903
+ _this.host.video.muted = true;
904
+ if (_this.debug) {
905
+ console.log("[StormcloudVideoPlayer] Muted video on content_resume (ad ended, gap between ads)");
906
+ }
907
+ }
908
+ _this.timing.clearAdFailsafeTimer();
909
+ _this.timing.clearAdRequestWatchdog();
910
+ _this.timing.activeAdRequestToken = null;
911
+ _this.showAds = false;
912
+ if (!_this.inAdBreak) {
913
+ return;
914
+ }
915
+ _this.timing.consecutiveFailures = 0;
916
+ _this.timing.recordPlayedAdDuration(_this.host.getAdPlayer());
917
+ var remaining = _this.timing.getRemainingAdMs();
918
+ if (_this.debug) {
919
+ console.log("[CONTINUOUS-FETCH] content_resume event: remaining=".concat(remaining, "ms, queued ads=").concat(_this.adRequestQueue.length), _this.adRequestQueue.length > 0 ? {
920
+ queuedUrls: _to_consumable_array(_this.adRequestQueue)
921
+ } : {});
922
+ }
923
+ if (_this.timing.hasTimeToStartAnotherAd()) {
924
+ _this.tryNextAvailableAdWithRateLimit();
925
+ } else {
926
+ _this.handleAdPodComplete();
927
+ }
928
+ });
929
+ }
930
+ },
931
+ {
932
+ key: "recreateAdController",
933
+ value: function recreateAdController() {
934
+ if (this.debug) {
935
+ console.log("[StormcloudVideoPlayer] Recreating AdController for new ad");
936
+ }
937
+ var shouldShowPlaceholder = this.inAdBreak && this.showAds;
938
+ var adPlayer = this.host.getAdPlayer();
939
+ if (shouldShowPlaceholder && adPlayer) {
940
+ if (this.debug) {
941
+ console.log("[StormcloudVideoPlayer] Showing placeholder before destroying old AdController");
942
+ }
943
+ this.placeholder.show();
944
+ adPlayer.showPlaceholder();
945
+ this.isShowingPlaceholder = true;
946
+ }
947
+ var preservedMutedState = adPlayer.getOriginalMutedState();
948
+ var preservedVolumeState = adPlayer.getOriginalVolume();
949
+ if (adPlayer) {
950
+ try {
951
+ adPlayer.destroy();
952
+ this.host.video.muted = true;
953
+ } catch (error) {
954
+ if (this.debug) {
955
+ console.warn("[StormcloudVideoPlayer] Error destroying old AdController:", error);
956
+ }
957
+ }
958
+ }
959
+ var continueLiveStreamDuringAds = this.host.shouldContinueLiveStreamDuringAds();
960
+ var newAdPlayer = this.host.createAdPlayer(continueLiveStreamDuringAds);
961
+ this.host.setAdPlayer(newAdPlayer);
962
+ newAdPlayer.initialize();
963
+ newAdPlayer.updateOriginalMutedState(preservedMutedState, preservedVolumeState);
964
+ this.attachImaEventListeners();
965
+ if (shouldShowPlaceholder) {
966
+ this.placeholder.show();
967
+ newAdPlayer.showPlaceholder();
968
+ this.isShowingPlaceholder = true;
969
+ }
970
+ }
971
+ },
972
+ {
973
+ key: "clearPendingAdBreak",
974
+ value: function clearPendingAdBreak() {
975
+ if (this.prefetchTimerId != null) {
976
+ clearTimeout(this.prefetchTimerId);
977
+ this.prefetchTimerId = void 0;
978
+ }
979
+ this.pendingAdBreak = null;
980
+ this.cueManager.pendingScte35CueKey = void 0;
981
+ this.vmap.podAssignedByPrefetch = false;
982
+ }
983
+ },
984
+ {
985
+ key: "handleAdStart",
986
+ value: // ───────────────────────────────────────────────────────────────
987
+ // Ad break start
988
+ // ───────────────────────────────────────────────────────────────
989
+ function handleAdStart(_marker) {
990
+ return _async_to_generator(function() {
991
+ var scheduled, tags, baseVastUrl, adBreakDurationMs, mode, currentMuted, currentVolume, firstAdUrl, usePreloadedAd, preloadedController, preloaded, firstAdUrlArray, adPlayer, preservedMuted, preservedVolume, adVolume, adPlayer1, adVolume1, error, fallbackPreloaded, ap, adVolume2, fallbackError;
992
+ return _ts_generator(this, function(_state) {
993
+ switch(_state.label){
994
+ case 0:
995
+ scheduled = this.vmap.findCurrentOrNextBreak(this.host.video.currentTime * 1e3);
996
+ if (scheduled) {
997
+ this.vmap.consumedVmapBreakIds.add(this.vmap.getAdBreakKey(scheduled));
998
+ }
999
+ tags = this.vmap.selectVastTagsForBreak(scheduled);
1000
+ if (tags && tags.length > 0 && tags[0]) {
1001
+ baseVastUrl = tags[0];
1002
+ } else if (this.vmap.apiVastTagUrl) {
1003
+ baseVastUrl = this.vmap.apiVastTagUrl;
1004
+ } else {
1005
+ this.clearPendingAdBreak();
1006
+ return [
1007
+ 2
1008
+ ];
1009
+ }
1010
+ adBreakDurationMs = _marker.durationSeconds != null ? _marker.durationSeconds * 1e3 : scheduled === null || scheduled === void 0 ? void 0 : scheduled.durationMs;
1011
+ if (this.debug) {
1012
+ mode = this.host.config.isLiveStream ? "LIVE" : "VOD";
1013
+ console.log("[CONTINUOUS-FETCH] ".concat(mode, " MODE: Target duration=").concat(adBreakDurationMs, "ms"));
1014
+ }
1015
+ this.timing.failedVastUrls.clear();
1016
+ this.timing.temporaryFailureUrls.clear();
1017
+ this.timing.consecutiveFailures = 0;
1018
+ this.continuousFetchingActive = true;
1019
+ this.isShowingPlaceholder = false;
1020
+ this.timing.totalAdRequestsInBreak = 0;
1021
+ if (this.vmap.podAssignedByPrefetch) {
1022
+ this.vmap.podAssignedByPrefetch = false;
1023
+ } else {
1024
+ this.vmap.beginNewAdPod();
1025
+ }
1026
+ currentMuted = this.host.video.muted;
1027
+ currentVolume = this.host.video.volume;
1028
+ this.host.getAdPlayer().updateOriginalMutedState(currentMuted, currentVolume);
1029
+ this.inAdBreak = true;
1030
+ this.timing.adBreakPlayedDurationMs = 0;
1031
+ this.timing.currentAdIndex = 0;
1032
+ this.timing.totalAdsInBreak = 0;
1033
+ this.adPodQueue = [];
1034
+ this.showAds = false;
1035
+ if (this.timing.expectedAdBreakDurationMs == null && adBreakDurationMs != null) {
1036
+ this.timing.expectedAdBreakDurationMs = adBreakDurationMs;
1037
+ }
1038
+ usePreloadedAd = false;
1039
+ preloaded = this.preloadPool.getPreloadedAd();
1040
+ if (preloaded) {
1041
+ firstAdUrl = preloaded.vastUrl;
1042
+ preloadedController = preloaded.adController;
1043
+ usePreloadedAd = true;
1044
+ sendAdLoadedTracking(this.host.config.licenseKey, {
1045
+ source: "hls",
1046
+ vastUrl: firstAdUrl,
1047
+ timestamp: /* @__PURE__ */ new Date().toISOString()
1048
+ }).catch(function() {});
1049
+ if (this.debug) {
1050
+ console.log("[CONTINUOUS-FETCH] Using preloaded ad from pool (preloaded in advance, ready immediately!)");
1051
+ }
1052
+ } else if (this.pendingAdBreak && this.pendingAdBreak.vastUrls.length > 0) {
1053
+ this.adRequestQueue = _to_consumable_array(this.pendingAdBreak.vastUrls);
1054
+ firstAdUrl = this.adRequestQueue.shift();
1055
+ if (this.debug) {
1056
+ console.log("[CONTINUOUS-FETCH] Pool empty, using prefetched URLs (".concat(this.adRequestQueue.length + 1, " available)"));
1057
+ }
1058
+ this.clearPendingAdBreak();
1059
+ } else {
1060
+ if (this.debug) {
1061
+ console.log("[CONTINUOUS-FETCH] Generating new ad URLs...");
1062
+ }
1063
+ firstAdUrlArray = this.host.generateVastUrls(baseVastUrl, 1);
1064
+ firstAdUrl = firstAdUrlArray[0];
1065
+ this.adRequestQueue = [];
1066
+ }
1067
+ if (!firstAdUrl) {
1068
+ if (this.debug) {
1069
+ console.warn("[CONTINUOUS-FETCH] Failed to get first ad URL");
1070
+ }
1071
+ this.handleAdPodComplete();
1072
+ return [
1073
+ 2
1074
+ ];
1075
+ }
1076
+ if (this.debug) {
1077
+ console.log("[CONTINUOUS-FETCH] First VAST URL:", firstAdUrl);
1078
+ }
1079
+ _state.label = 1;
1080
+ case 1:
1081
+ _state.trys.push([
1082
+ 1,
1083
+ 12,
1084
+ ,
1085
+ 20
1086
+ ]);
1087
+ if (!(usePreloadedAd && preloadedController)) return [
1088
+ 3,
1089
+ 5
1090
+ ];
1091
+ if (!!this.timing.ensureLoadedAdFitsBudget(preloadedController)) return [
1092
+ 3,
1093
+ 3
1094
+ ];
1095
+ this.timing.rejectLoadedAdForDuration(preloadedController);
1096
+ this.startContinuousFetching(baseVastUrl);
1097
+ return [
1098
+ 4,
1099
+ this.tryNextAvailableAdWithRateLimit()
1100
+ ];
1101
+ case 2:
1102
+ _state.sent();
1103
+ return [
1104
+ 2
1105
+ ];
1106
+ case 3:
1107
+ adPlayer = this.host.getAdPlayer();
1108
+ preservedMuted = adPlayer.getOriginalMutedState();
1109
+ preservedVolume = adPlayer.getOriginalVolume();
1110
+ adPlayer.destroy();
1111
+ this.host.video.muted = true;
1112
+ this.host.setAdPlayer(preloadedController);
1113
+ preloadedController.updateOriginalMutedState(preservedMuted, preservedVolume);
1114
+ this.attachImaEventListeners();
1115
+ if (this.debug) {
1116
+ console.log("[CONTINUOUS-FETCH] Using preloaded ad, resuming and starting playback immediately (no request delay!)");
1117
+ }
1118
+ preloadedController.resume();
1119
+ this.timing.consecutiveFailures = 0;
1120
+ this.startContinuousFetching(baseVastUrl);
1121
+ if (!this.preloadPool.active) {
1122
+ this.preloadPool.active = true;
1123
+ }
1124
+ if (!this.preloadPool.isLoopRunning) {
1125
+ this.preloadPool.preloadPoolLoop(baseVastUrl);
1126
+ }
1127
+ return [
1128
+ 4,
1129
+ preloadedController.play()
1130
+ ];
1131
+ case 4:
1132
+ _state.sent();
1133
+ this.timing.markAdStarted();
1134
+ if (this.timing.expectedAdBreakDurationMs != null && this.timing.getAdBreakEndWallClockMs() == null) {
1135
+ this.timing.scheduleAdStopAtBreakBoundary();
1136
+ }
1137
+ adVolume = currentMuted ? 0 : currentVolume;
1138
+ preloadedController.setAdVolume(adVolume);
1139
+ return [
1140
+ 3,
1141
+ 11
1142
+ ];
1143
+ case 5:
1144
+ adPlayer1 = this.host.getAdPlayer();
1145
+ return [
1146
+ 4,
1147
+ this.timing.enforceGlobalRateLimit()
1148
+ ];
1149
+ case 6:
1150
+ _state.sent();
1151
+ this.timing.lastAdRequestTime = Date.now();
1152
+ return [
1153
+ 4,
1154
+ adPlayer1.requestAds(firstAdUrl)
1155
+ ];
1156
+ case 7:
1157
+ _state.sent();
1158
+ sendAdLoadedTracking(this.host.config.licenseKey, {
1159
+ source: "hls",
1160
+ vastUrl: firstAdUrl,
1161
+ timestamp: /* @__PURE__ */ new Date().toISOString()
1162
+ }).catch(function() {});
1163
+ if (this.debug) {
1164
+ console.log("[CONTINUOUS-FETCH] First ad request successful, starting playback");
1165
+ }
1166
+ if (!!this.timing.ensureLoadedAdFitsBudget(adPlayer1)) return [
1167
+ 3,
1168
+ 9
1169
+ ];
1170
+ this.timing.rejectLoadedAdForDuration(adPlayer1);
1171
+ this.recreateAdController();
1172
+ this.startContinuousFetching(baseVastUrl);
1173
+ return [
1174
+ 4,
1175
+ this.tryNextAvailableAdWithRateLimit()
1176
+ ];
1177
+ case 8:
1178
+ _state.sent();
1179
+ return [
1180
+ 2
1181
+ ];
1182
+ case 9:
1183
+ this.timing.consecutiveFailures = 0;
1184
+ this.startContinuousFetching(baseVastUrl);
1185
+ if (!this.preloadPool.active) {
1186
+ this.preloadPool.startPreloadPool(baseVastUrl, []);
1187
+ }
1188
+ return [
1189
+ 4,
1190
+ adPlayer1.play()
1191
+ ];
1192
+ case 10:
1193
+ _state.sent();
1194
+ this.timing.markAdStarted();
1195
+ if (this.timing.expectedAdBreakDurationMs != null && this.timing.getAdBreakEndWallClockMs() == null) {
1196
+ this.timing.scheduleAdStopAtBreakBoundary();
1197
+ }
1198
+ adVolume1 = currentMuted ? 0 : currentVolume;
1199
+ adPlayer1.setAdVolume(adVolume1);
1200
+ _state.label = 11;
1201
+ case 11:
1202
+ return [
1203
+ 3,
1204
+ 20
1205
+ ];
1206
+ case 12:
1207
+ error = _state.sent();
1208
+ if (this.debug) {
1209
+ console.warn("[CONTINUOUS-FETCH] First ad request failed:", error);
1210
+ }
1211
+ if (!!usePreloadedAd) return [
1212
+ 3,
1213
+ 18
1214
+ ];
1215
+ fallbackPreloaded = this.preloadPool.getPreloadedAd();
1216
+ if (!fallbackPreloaded) return [
1217
+ 3,
1218
+ 18
1219
+ ];
1220
+ if (this.debug) {
1221
+ console.log("[CONTINUOUS-FETCH] First ad failed, using preloaded fallback");
1222
+ }
1223
+ _state.label = 13;
1224
+ case 13:
1225
+ _state.trys.push([
1226
+ 13,
1227
+ 17,
1228
+ ,
1229
+ 18
1230
+ ]);
1231
+ if (!!this.timing.ensureLoadedAdFitsBudget(fallbackPreloaded.adController)) return [
1232
+ 3,
1233
+ 15
1234
+ ];
1235
+ this.timing.rejectLoadedAdForDuration(fallbackPreloaded.adController);
1236
+ this.startContinuousFetching(baseVastUrl);
1237
+ return [
1238
+ 4,
1239
+ this.tryNextAvailableAdWithRateLimit()
1240
+ ];
1241
+ case 14:
1242
+ _state.sent();
1243
+ return [
1244
+ 2
1245
+ ];
1246
+ case 15:
1247
+ this.swapToPreloadedAdPlayer(fallbackPreloaded.adController);
1248
+ this.timing.consecutiveFailures = 0;
1249
+ this.startContinuousFetching(baseVastUrl);
1250
+ if (!this.preloadPool.active) {
1251
+ this.preloadPool.active = true;
1252
+ this.preloadPool.preloadPoolLoop(baseVastUrl);
1253
+ }
1254
+ ap = this.host.getAdPlayer();
1255
+ return [
1256
+ 4,
1257
+ ap.play()
1258
+ ];
1259
+ case 16:
1260
+ _state.sent();
1261
+ this.timing.markAdStarted();
1262
+ if (this.timing.expectedAdBreakDurationMs != null && this.timing.getAdBreakEndWallClockMs() == null) {
1263
+ this.timing.scheduleAdStopAtBreakBoundary();
1264
+ }
1265
+ adVolume2 = currentMuted ? 0 : currentVolume;
1266
+ ap.setAdVolume(adVolume2);
1267
+ return [
1268
+ 2
1269
+ ];
1270
+ case 17:
1271
+ fallbackError = _state.sent();
1272
+ if (this.debug) {
1273
+ console.warn("[CONTINUOUS-FETCH] Preloaded fallback also failed:", fallbackError);
1274
+ }
1275
+ return [
1276
+ 3,
1277
+ 18
1278
+ ];
1279
+ case 18:
1280
+ if (this.timing.isTemporaryAdError(error)) {
1281
+ this.timing.temporaryFailureUrls.set(firstAdUrl, Date.now());
1282
+ if (this.debug) {
1283
+ console.log("[CONTINUOUS-FETCH] First ad had temporary error (no-fill) - will try alternatives");
1284
+ }
1285
+ } else {
1286
+ this.timing.failedVastUrls.add(firstAdUrl);
1287
+ if (this.debug) {
1288
+ console.log("[CONTINUOUS-FETCH] First ad had permanent error - URL blacklisted");
1289
+ }
1290
+ }
1291
+ this.timing.consecutiveFailures++;
1292
+ this.startContinuousFetching(baseVastUrl);
1293
+ return [
1294
+ 4,
1295
+ this.tryNextAvailableAdWithRateLimit()
1296
+ ];
1297
+ case 19:
1298
+ _state.sent();
1299
+ return [
1300
+ 3,
1301
+ 20
1302
+ ];
1303
+ case 20:
1304
+ return [
1305
+ 2
1306
+ ];
1307
+ }
1308
+ });
1309
+ }).call(this);
1310
+ }
1311
+ },
1312
+ {
1313
+ key: "swapToPreloadedAdPlayer",
1314
+ value: function swapToPreloadedAdPlayer(preloadedController) {
1315
+ var adPlayer = this.host.getAdPlayer();
1316
+ var preservedMuted = adPlayer.getOriginalMutedState();
1317
+ var preservedVolume = adPlayer.getOriginalVolume();
1318
+ adPlayer.destroy();
1319
+ this.host.video.muted = true;
1320
+ this.host.setAdPlayer(preloadedController);
1321
+ this.attachImaEventListeners();
1322
+ preloadedController.updateOriginalMutedState(preservedMuted, preservedVolume);
1323
+ preloadedController.resume();
1324
+ }
1325
+ },
1326
+ {
1327
+ // ───────────────────────────────────────────────────────────────
1328
+ // Continuous fetching
1329
+ // ───────────────────────────────────────────────────────────────
1330
+ key: "startContinuousFetching",
1331
+ value: function startContinuousFetching(baseVastUrl) {
1332
+ if (!this.continuousFetchingActive) {
1333
+ return;
1334
+ }
1335
+ if (this.continuousFetchLoopRunning) {
1336
+ if (this.debug) {
1337
+ console.log("[CONTINUOUS-FETCH] Fetch loop already running, skipping duplicate start");
1338
+ }
1339
+ return;
1340
+ }
1341
+ if (this.debug) {
1342
+ console.log("[CONTINUOUS-FETCH] Starting continuous ad fetching loop");
1343
+ }
1344
+ this.continuousFetchLoopRunning = true;
1345
+ this.continuousFetchLoop(baseVastUrl);
1346
+ }
1347
+ },
1348
+ {
1349
+ key: "continuousFetchLoop",
1350
+ value: function continuousFetchLoop(baseVastUrl) {
1351
+ return _async_to_generator(function() {
1352
+ var _this, _loop, epoch, _ret;
1353
+ return _ts_generator(this, function(_state) {
1354
+ switch(_state.label){
1355
+ case 0:
1356
+ _loop = function() {
1357
+ var remaining, maxQueueSize, newAdUrl, queuedUrlsPreview, generationDelay;
1358
+ return _ts_generator(this, function(_state) {
1359
+ switch(_state.label){
1360
+ case 0:
1361
+ remaining = Math.min(_this.timing.getWallClockRemainingAdMs(), _this.timing.getDurationBudgetRemainingMs());
1362
+ if (remaining <= _this.timing.getMinRemainingMsToStartAd()) {
1363
+ if (_this.debug) {
1364
+ console.log("[CONTINUOUS-FETCH] Not enough ad break time left (wall=".concat(_this.timing.getWallClockRemainingAdMs(), "ms, budget=").concat(_this.timing.getDurationBudgetRemainingMs(), "ms), stopping URL generation"));
1365
+ }
1366
+ return [
1367
+ 2,
1368
+ "break"
1369
+ ];
1370
+ }
1371
+ if (_this.timing.isGamInCooldown()) {
1372
+ if (_this.debug) {
1373
+ console.log("[CIRCUIT-BREAKER] GAM in cooldown, stopping URL generation");
1374
+ }
1375
+ return [
1376
+ 2,
1377
+ "break"
1378
+ ];
1379
+ }
1380
+ if (_this.timing.consecutiveFailures >= _this.timing.maxConsecutiveFailures) {
1381
+ if (_this.debug) {
1382
+ console.log("[CONTINUOUS-FETCH] Too many consecutive failures (".concat(_this.timing.consecutiveFailures, "), stopping URL generation"));
1383
+ }
1384
+ return [
1385
+ 2,
1386
+ "break"
1387
+ ];
1388
+ }
1389
+ if (_this.timing.totalAdRequestsInBreak >= _this.timing.maxTotalAdRequestsPerBreak) {
1390
+ if (_this.debug) {
1391
+ console.log("[CONTINUOUS-FETCH] Maximum ad requests reached (".concat(_this.timing.maxTotalAdRequestsPerBreak, "), stopping"));
1392
+ }
1393
+ return [
1394
+ 2,
1395
+ "break"
1396
+ ];
1397
+ }
1398
+ maxQueueSize = 5;
1399
+ if (!(_this.adRequestQueue.length >= maxQueueSize)) return [
1400
+ 3,
1401
+ 2
1402
+ ];
1403
+ if (_this.debug) {
1404
+ console.log("[CONTINUOUS-FETCH] URL queue full (".concat(_this.adRequestQueue.length, "), waiting..."));
1405
+ }
1406
+ return [
1407
+ 4,
1408
+ new Promise(function(resolve) {
1409
+ return setTimeout(resolve, 1e3);
1410
+ })
1411
+ ];
1412
+ case 1:
1413
+ _state.sent();
1414
+ return [
1415
+ 2,
1416
+ "continue"
1417
+ ];
1418
+ case 2:
1419
+ newAdUrl = _this.host.generateVastUrls(baseVastUrl, 1)[0];
1420
+ if (!(!newAdUrl || _this.timing.failedVastUrls.has(newAdUrl) || _this.timing.isUrlInCooldown(newAdUrl))) return [
1421
+ 3,
1422
+ 4
1423
+ ];
1424
+ return [
1425
+ 4,
1426
+ new Promise(function(resolve) {
1427
+ return setTimeout(resolve, 500);
1428
+ })
1429
+ ];
1430
+ case 3:
1431
+ _state.sent();
1432
+ return [
1433
+ 2,
1434
+ "continue"
1435
+ ];
1436
+ case 4:
1437
+ if (_this.debug) {
1438
+ queuedUrlsPreview = _to_consumable_array(_this.adRequestQueue).concat([
1439
+ newAdUrl
1440
+ ]);
1441
+ console.log("[CONTINUOUS-FETCH] Queued VAST URL (queue size: ".concat(queuedUrlsPreview.length, ")"), {
1442
+ queuedUrls: queuedUrlsPreview
1443
+ });
1444
+ }
1445
+ _this.adRequestQueue.push(newAdUrl);
1446
+ generationDelay = _this.timing.consecutiveFailures > 0 ? Math.min(1e3 * Math.pow(2, _this.timing.consecutiveFailures), 5e3) : 500;
1447
+ return [
1448
+ 4,
1449
+ new Promise(function(resolve) {
1450
+ return setTimeout(resolve, generationDelay);
1451
+ })
1452
+ ];
1453
+ case 5:
1454
+ _state.sent();
1455
+ return [
1456
+ 2
1457
+ ];
1458
+ }
1459
+ });
1460
+ };
1461
+ epoch = this.timing.adBreakEpoch;
1462
+ _state.label = 1;
1463
+ case 1:
1464
+ if (!(this.continuousFetchingActive && this.inAdBreak && epoch === this.timing.adBreakEpoch)) return [
1465
+ 3,
1466
+ 3
1467
+ ];
1468
+ _this = this;
1469
+ return [
1470
+ 5,
1471
+ _ts_values(_loop())
1472
+ ];
1473
+ case 2:
1474
+ _ret = _state.sent();
1475
+ if (_ret === "break") return [
1476
+ 3,
1477
+ 3
1478
+ ];
1479
+ return [
1480
+ 3,
1481
+ 1
1482
+ ];
1483
+ case 3:
1484
+ this.continuousFetchLoopRunning = false;
1485
+ if (this.debug) {
1486
+ console.log("[CONTINUOUS-FETCH] URL generation loop ended (queued: ".concat(this.adRequestQueue.length, ")"), this.adRequestQueue.length > 0 ? {
1487
+ queuedUrls: _to_consumable_array(this.adRequestQueue)
1488
+ } : {});
1489
+ }
1490
+ return [
1491
+ 2
1492
+ ];
1493
+ }
1494
+ });
1495
+ }).call(this);
1496
+ }
1497
+ },
1498
+ {
1499
+ key: "stopContinuousFetching",
1500
+ value: function stopContinuousFetching() {
1501
+ this.continuousFetchingActive = false;
1502
+ this.continuousFetchLoopRunning = false;
1503
+ this.placeholder.hide();
1504
+ if (this.debug) {
1505
+ console.log("[CONTINUOUS-FETCH] Stopping continuous ad fetching");
1506
+ }
1507
+ }
1508
+ },
1509
+ {
1510
+ key: "tryNextAvailableAdWithRateLimit",
1511
+ value: // ───────────────────────────────────────────────────────────────
1512
+ // Ad iteration
1513
+ // ───────────────────────────────────────────────────────────────
1514
+ function tryNextAvailableAdWithRateLimit() {
1515
+ return _async_to_generator(function() {
1516
+ var epoch, backoffMultiplier, backoffDelay, effectiveMinInterval, timeSinceLastRequest, waitTime;
1517
+ return _ts_generator(this, function(_state) {
1518
+ switch(_state.label){
1519
+ case 0:
1520
+ if (!this.inAdBreak) {
1521
+ return [
1522
+ 2
1523
+ ];
1524
+ }
1525
+ epoch = this.timing.adBreakEpoch;
1526
+ if (this.timing.consecutiveFailures >= this.timing.maxConsecutiveFailures) {
1527
+ if (this.debug) {
1528
+ console.log("[CONTINUOUS-FETCH] Too many consecutive failures (".concat(this.timing.consecutiveFailures, "), ending ad break gracefully"));
1529
+ }
1530
+ this.handleAdPodComplete();
1531
+ return [
1532
+ 2
1533
+ ];
1534
+ }
1535
+ backoffMultiplier = Math.pow(2, this.timing.consecutiveFailures);
1536
+ backoffDelay = Math.min(this.timing.backoffBaseMs * backoffMultiplier, this.timing.maxBackoffMs);
1537
+ effectiveMinInterval = this.timing.minAdRequestIntervalMs + (this.timing.consecutiveFailures > 0 ? backoffDelay : 0);
1538
+ timeSinceLastRequest = Date.now() - this.timing.lastAdRequestTime;
1539
+ if (!(timeSinceLastRequest < effectiveMinInterval)) return [
1540
+ 3,
1541
+ 2
1542
+ ];
1543
+ waitTime = effectiveMinInterval - timeSinceLastRequest;
1544
+ if (this.debug) {
1545
+ console.log("[CONTINUOUS-FETCH] Rate limiting: waiting ".concat(waitTime, "ms before next request (backoff: ").concat(this.timing.consecutiveFailures, " failures)"));
1546
+ }
1547
+ return [
1548
+ 4,
1549
+ new Promise(function(resolve) {
1550
+ return setTimeout(resolve, waitTime);
1551
+ })
1552
+ ];
1553
+ case 1:
1554
+ _state.sent();
1555
+ _state.label = 2;
1556
+ case 2:
1557
+ if (!this.inAdBreak || epoch !== this.timing.adBreakEpoch) {
1558
+ return [
1559
+ 2
1560
+ ];
1561
+ }
1562
+ return [
1563
+ 2,
1564
+ this.tryNextAvailableAd(0)
1565
+ ];
1566
+ }
1567
+ });
1568
+ }).call(this);
1569
+ }
1570
+ },
1571
+ {
1572
+ key: "tryNextAvailableAd",
1573
+ value: function tryNextAvailableAd() {
1574
+ var retryCount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
1575
+ return _async_to_generator(function() {
1576
+ var remaining, preloaded, ap, error, nextAdUrl, error1, errorMessage, maxRetries;
1577
+ return _ts_generator(this, function(_state) {
1578
+ switch(_state.label){
1579
+ case 0:
1580
+ if (!this.inAdBreak) {
1581
+ return [
1582
+ 2
1583
+ ];
1584
+ }
1585
+ remaining = this.timing.getRemainingAdMs();
1586
+ if (!this.timing.hasTimeToStartAnotherAd()) {
1587
+ if (this.debug) {
1588
+ console.log("[CONTINUOUS-FETCH] Not enough time remaining (".concat(remaining, "ms) to start another ad, ending ad break"));
1589
+ }
1590
+ this.handleAdPodComplete();
1591
+ return [
1592
+ 2
1593
+ ];
1594
+ }
1595
+ if (this.timing.isGamInCooldown()) {
1596
+ if (this.debug) {
1597
+ console.log("[CIRCUIT-BREAKER] GAM in cooldown, ending ad break gracefully");
1598
+ }
1599
+ this.handleAdPodComplete();
1600
+ return [
1601
+ 2
1602
+ ];
1603
+ }
1604
+ if (this.timing.consecutiveFailures >= this.timing.maxConsecutiveFailures) {
1605
+ if (this.debug) {
1606
+ console.log("[CONTINUOUS-FETCH] Too many consecutive failures (".concat(this.timing.consecutiveFailures, "), ending ad break"));
1607
+ }
1608
+ this.handleAdPodComplete();
1609
+ return [
1610
+ 2
1611
+ ];
1612
+ }
1613
+ this.timing.cleanupTemporaryFailures();
1614
+ preloaded = this.preloadPool.getPreloadedAd();
1615
+ if (!preloaded) return [
1616
+ 3,
1617
+ 6
1618
+ ];
1619
+ if (this.debug) {
1620
+ console.log("[CONTINUOUS-FETCH] Using preloaded ad from pool");
1621
+ }
1622
+ sendAdLoadedTracking(this.host.config.licenseKey, {
1623
+ source: "hls",
1624
+ vastUrl: preloaded.vastUrl,
1625
+ timestamp: /* @__PURE__ */ new Date().toISOString()
1626
+ }).catch(function() {});
1627
+ _state.label = 1;
1628
+ case 1:
1629
+ _state.trys.push([
1630
+ 1,
1631
+ 5,
1632
+ ,
1633
+ 6
1634
+ ]);
1635
+ if (!!this.timing.ensureLoadedAdFitsBudget(preloaded.adController)) return [
1636
+ 3,
1637
+ 3
1638
+ ];
1639
+ this.timing.rejectLoadedAdForDuration(preloaded.adController);
1640
+ return [
1641
+ 4,
1642
+ this.tryNextAvailableAdWithRateLimit()
1643
+ ];
1644
+ case 2:
1645
+ _state.sent();
1646
+ return [
1647
+ 2
1648
+ ];
1649
+ case 3:
1650
+ this.swapToPreloadedAdPlayer(preloaded.adController);
1651
+ ap = this.host.getAdPlayer();
1652
+ return [
1653
+ 4,
1654
+ ap.play()
1655
+ ];
1656
+ case 4:
1657
+ _state.sent();
1658
+ this.timing.markAdStarted();
1659
+ if (this.timing.expectedAdBreakDurationMs != null && this.timing.getAdBreakEndWallClockMs() == null) {
1660
+ this.timing.scheduleAdStopAtBreakBoundary();
1661
+ }
1662
+ ap.setAdVolume(getAdAudioVolume(ap));
1663
+ this.timing.consecutiveFailures = 0;
1664
+ return [
1665
+ 2
1666
+ ];
1667
+ case 5:
1668
+ error = _state.sent();
1669
+ if (this.debug) {
1670
+ console.warn("[CONTINUOUS-FETCH] Preloaded ad failed to play:", error);
1671
+ }
1672
+ return [
1673
+ 3,
1674
+ 6
1675
+ ];
1676
+ case 6:
1677
+ if (!(this.adRequestQueue.length > 0)) return [
1678
+ 3,
1679
+ 14
1680
+ ];
1681
+ nextAdUrl = this.adRequestQueue.shift();
1682
+ if (!nextAdUrl) return [
1683
+ 3,
1684
+ 6
1685
+ ];
1686
+ if (this.timing.failedVastUrls.has(nextAdUrl)) {
1687
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Skipping permanently-failed URL, trying next...");
1688
+ return [
1689
+ 3,
1690
+ 6
1691
+ ];
1692
+ }
1693
+ if (this.timing.isUrlInCooldown(nextAdUrl)) {
1694
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Skipping URL in cooldown (recent no-fill), trying next...");
1695
+ return [
1696
+ 3,
1697
+ 6
1698
+ ];
1699
+ }
1700
+ if (this.debug) {
1701
+ console.log("[CONTINUOUS-FETCH] Requesting next ad via HLS ad player (".concat(this.timing.currentAdIndex + 1, ", ").concat(this.adRequestQueue.length, " remaining in queue)"));
1702
+ }
1703
+ _state.label = 7;
1704
+ case 7:
1705
+ _state.trys.push([
1706
+ 7,
1707
+ 9,
1708
+ ,
1709
+ 13
1710
+ ]);
1711
+ return [
1712
+ 4,
1713
+ this.playSingleAd(nextAdUrl)
1714
+ ];
1715
+ case 8:
1716
+ _state.sent();
1717
+ this.timing.consecutiveFailures = 0;
1718
+ return [
1719
+ 3,
1720
+ 13
1721
+ ];
1722
+ case 9:
1723
+ error1 = _state.sent();
1724
+ errorMessage = error1.message;
1725
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Ad request failed:", errorMessage);
1726
+ if (!errorMessage.includes("ad_duration_exceeds_budget")) return [
1727
+ 3,
1728
+ 11
1729
+ ];
1730
+ return [
1731
+ 4,
1732
+ this.tryNextAvailableAdWithRateLimit()
1733
+ ];
1734
+ case 10:
1735
+ _state.sent();
1736
+ return [
1737
+ 2
1738
+ ];
1739
+ case 11:
1740
+ if (!errorMessage.includes("permanently failed") && !errorMessage.includes("in cooldown")) {
1741
+ this.timing.consecutiveFailures++;
1742
+ }
1743
+ return [
1744
+ 4,
1745
+ this.tryNextAvailableAdWithRateLimit()
1746
+ ];
1747
+ case 12:
1748
+ _state.sent();
1749
+ return [
1750
+ 3,
1751
+ 13
1752
+ ];
1753
+ case 13:
1754
+ return [
1755
+ 2
1756
+ ];
1757
+ case 14:
1758
+ maxRetries = 3;
1759
+ if (!(this.continuousFetchingActive && retryCount < maxRetries && remaining > 2e3)) return [
1760
+ 3,
1761
+ 17
1762
+ ];
1763
+ if (this.debug) {
1764
+ console.log("[CONTINUOUS-FETCH] Queue empty, waiting for URLs... (".concat(retryCount + 1, "/").concat(maxRetries, ")"));
1765
+ }
1766
+ return [
1767
+ 4,
1768
+ new Promise(function(resolve) {
1769
+ return setTimeout(resolve, 500);
1770
+ })
1771
+ ];
1772
+ case 15:
1773
+ _state.sent();
1774
+ return [
1775
+ 4,
1776
+ this.tryNextAvailableAd(retryCount + 1)
1777
+ ];
1778
+ case 16:
1779
+ _state.sent();
1780
+ return [
1781
+ 2
1782
+ ];
1783
+ case 17:
1784
+ if (!this.isShowingPlaceholder && remaining > 1e3) {
1785
+ this.showPlaceholderAndWaitForAds();
1786
+ } else {
1787
+ if (this.debug) console.log("[CONTINUOUS-FETCH] No more ads available, ending ad break");
1788
+ this.handleAdPodComplete();
1789
+ }
1790
+ return [
1791
+ 2
1792
+ ];
1793
+ }
1794
+ });
1795
+ }).call(this);
1796
+ }
1797
+ },
1798
+ {
1799
+ key: "playSingleAd",
1800
+ value: // ───────────────────────────────────────────────────────────────
1801
+ // Single ad playback
1802
+ // ───────────────────────────────────────────────────────────────
1803
+ function playSingleAd(vastTagUrl) {
1804
+ return _async_to_generator(function() {
1805
+ var adPlayer, requestToken, ap, playError, preloadedFallback, fbAp, fallbackError, error, errorMessage, preloadedFallback1, fbAp1, fallbackError1;
1806
+ return _ts_generator(this, function(_state) {
1807
+ switch(_state.label){
1808
+ case 0:
1809
+ adPlayer = this.host.getAdPlayer();
1810
+ if (adPlayer.isAdPlaying()) return [
1811
+ 2
1812
+ ];
1813
+ if (this.timing.failedVastUrls.has(vastTagUrl)) {
1814
+ if (this.debug) console.warn("[AD-ERROR] Skipping permanently-failed VAST URL:", vastTagUrl);
1815
+ throw new Error("VAST URL permanently failed");
1816
+ }
1817
+ if (this.timing.isUrlInCooldown(vastTagUrl)) {
1818
+ if (this.debug) console.warn("[AD-ERROR] Skipping URL in cooldown (recent no-fill):", vastTagUrl);
1819
+ throw new Error("VAST URL in cooldown after no-fill");
1820
+ }
1821
+ if (this.timing.consecutiveFailures >= this.timing.maxConsecutiveFailures) {
1822
+ if (this.debug) console.warn("[AD-ERROR] Too many consecutive failures, not requesting more ads");
1823
+ throw new Error("Too many consecutive failures");
1824
+ }
1825
+ if (this.timing.isGamInCooldown()) {
1826
+ if (this.debug) console.warn("[CIRCUIT-BREAKER] GAM in cooldown, skipping ad request");
1827
+ throw new Error("GAM in cooldown");
1828
+ }
1829
+ this.recreateAdController();
1830
+ requestToken = ++this.timing.adRequestTokenCounter;
1831
+ this.timing.activeAdRequestToken = requestToken;
1832
+ this.timing.startAdRequestWatchdog(requestToken);
1833
+ _state.label = 1;
1834
+ case 1:
1835
+ _state.trys.push([
1836
+ 1,
1837
+ 12,
1838
+ ,
1839
+ 17
1840
+ ]);
1841
+ return [
1842
+ 4,
1843
+ this.timing.enforceGlobalRateLimit()
1844
+ ];
1845
+ case 2:
1846
+ _state.sent();
1847
+ this.timing.lastAdRequestTime = Date.now();
1848
+ ap = this.host.getAdPlayer();
1849
+ return [
1850
+ 4,
1851
+ ap.requestAds(vastTagUrl)
1852
+ ];
1853
+ case 3:
1854
+ _state.sent();
1855
+ sendAdLoadedTracking(this.host.config.licenseKey, {
1856
+ source: "hls",
1857
+ vastUrl: vastTagUrl,
1858
+ timestamp: /* @__PURE__ */ new Date().toISOString()
1859
+ }).catch(function() {});
1860
+ this.timing.clearAdRequestWatchdog();
1861
+ if (this.timing.activeAdRequestToken !== requestToken) return [
1862
+ 2
1863
+ ];
1864
+ if (!this.timing.ensureLoadedAdFitsBudget(ap)) {
1865
+ this.timing.rejectLoadedAdForDuration(ap);
1866
+ this.recreateAdController();
1867
+ throw new Error("ad_duration_exceeds_budget");
1868
+ }
1869
+ _state.label = 4;
1870
+ case 4:
1871
+ _state.trys.push([
1872
+ 4,
1873
+ 6,
1874
+ ,
1875
+ 11
1876
+ ]);
1877
+ this.timing.startAdFailsafeTimer(requestToken);
1878
+ return [
1879
+ 4,
1880
+ ap.play()
1881
+ ];
1882
+ case 5:
1883
+ _state.sent();
1884
+ this.timing.markAdStarted();
1885
+ if (this.timing.expectedAdBreakDurationMs != null && this.timing.getAdBreakEndWallClockMs() == null) {
1886
+ this.timing.scheduleAdStopAtBreakBoundary();
1887
+ }
1888
+ ap.setAdVolume(getAdAudioVolume(ap));
1889
+ this.timing.consecutiveFailures = 0;
1890
+ this.timing.temporaryFailureUrls.delete(vastTagUrl);
1891
+ return [
1892
+ 3,
1893
+ 11
1894
+ ];
1895
+ case 6:
1896
+ playError = _state.sent();
1897
+ if (this.debug) console.error("[AD-ERROR] Failed to play ad:", playError);
1898
+ preloadedFallback = this.preloadPool.getPreloadedAd();
1899
+ if (!preloadedFallback) return [
1900
+ 3,
1901
+ 10
1902
+ ];
1903
+ if (this.debug) console.log("[AD-ERROR] Play failed, trying preloaded fallback ad");
1904
+ _state.label = 7;
1905
+ case 7:
1906
+ _state.trys.push([
1907
+ 7,
1908
+ 9,
1909
+ ,
1910
+ 10
1911
+ ]);
1912
+ if (!this.timing.ensureLoadedAdFitsBudget(preloadedFallback.adController)) {
1913
+ this.timing.rejectLoadedAdForDuration(preloadedFallback.adController);
1914
+ throw playError;
1915
+ }
1916
+ this.timing.clearAdFailsafeTimer();
1917
+ this.swapToPreloadedAdPlayer(preloadedFallback.adController);
1918
+ this.timing.consecutiveFailures = 0;
1919
+ fbAp = this.host.getAdPlayer();
1920
+ return [
1921
+ 4,
1922
+ fbAp.play()
1923
+ ];
1924
+ case 8:
1925
+ _state.sent();
1926
+ this.timing.markAdStarted();
1927
+ if (this.timing.expectedAdBreakDurationMs != null && this.timing.getAdBreakEndWallClockMs() == null) {
1928
+ this.timing.scheduleAdStopAtBreakBoundary();
1929
+ }
1930
+ fbAp.setAdVolume(getAdAudioVolume(fbAp));
1931
+ return [
1932
+ 2
1933
+ ];
1934
+ case 9:
1935
+ fallbackError = _state.sent();
1936
+ if (this.debug) console.warn("[AD-ERROR] Preloaded fallback also failed:", fallbackError);
1937
+ return [
1938
+ 3,
1939
+ 10
1940
+ ];
1941
+ case 10:
1942
+ if (this.timing.isTemporaryAdError(playError)) {
1943
+ this.timing.temporaryFailureUrls.set(vastTagUrl, Date.now());
1944
+ if (this.debug) console.log("[AD-ERROR] Temporary play error - URL can be retried after cooldown");
1945
+ } else {
1946
+ this.timing.failedVastUrls.add(vastTagUrl);
1947
+ if (this.debug) console.log("[AD-ERROR] Permanent play error - URL blacklisted");
1948
+ }
1949
+ this.timing.clearAdFailsafeTimer();
1950
+ if (this.timing.activeAdRequestToken === requestToken) {
1951
+ this.timing.activeAdRequestToken = null;
1952
+ }
1953
+ throw playError;
1954
+ case 11:
1955
+ return [
1956
+ 3,
1957
+ 17
1958
+ ];
1959
+ case 12:
1960
+ error = _state.sent();
1961
+ errorMessage = (error === null || error === void 0 ? void 0 : error.message) || "";
1962
+ if (this.debug) console.error("[AD-ERROR] Ad request failed:", errorMessage);
1963
+ preloadedFallback1 = this.preloadPool.getPreloadedAd();
1964
+ if (!preloadedFallback1) return [
1965
+ 3,
1966
+ 16
1967
+ ];
1968
+ if (this.debug) console.log("[AD-ERROR] Request failed, trying preloaded fallback ad");
1969
+ _state.label = 13;
1970
+ case 13:
1971
+ _state.trys.push([
1972
+ 13,
1973
+ 15,
1974
+ ,
1975
+ 16
1976
+ ]);
1977
+ if (!this.timing.ensureLoadedAdFitsBudget(preloadedFallback1.adController)) {
1978
+ this.timing.rejectLoadedAdForDuration(preloadedFallback1.adController);
1979
+ throw error;
1980
+ }
1981
+ this.timing.clearAdRequestWatchdog();
1982
+ this.timing.clearAdFailsafeTimer();
1983
+ this.swapToPreloadedAdPlayer(preloadedFallback1.adController);
1984
+ this.timing.consecutiveFailures = 0;
1985
+ fbAp1 = this.host.getAdPlayer();
1986
+ return [
1987
+ 4,
1988
+ fbAp1.play()
1989
+ ];
1990
+ case 14:
1991
+ _state.sent();
1992
+ this.timing.markAdStarted();
1993
+ fbAp1.setAdVolume(getAdAudioVolume(fbAp1));
1994
+ return [
1995
+ 2
1996
+ ];
1997
+ case 15:
1998
+ fallbackError1 = _state.sent();
1999
+ if (this.debug) console.warn("[AD-ERROR] Preloaded fallback also failed:", fallbackError1);
2000
+ return [
2001
+ 3,
2002
+ 16
2003
+ ];
2004
+ case 16:
2005
+ if (this.timing.isTemporaryAdError(error)) {
2006
+ this.timing.temporaryFailureUrls.set(vastTagUrl, Date.now());
2007
+ if (this.debug) console.log("[AD-ERROR] Temporary error (no-fill/timeout) - URL can be retried after cooldown");
2008
+ } else {
2009
+ this.timing.failedVastUrls.add(vastTagUrl);
2010
+ if (this.debug) console.log("[AD-ERROR] Permanent error - URL blacklisted:", errorMessage);
2011
+ }
2012
+ this.timing.clearAdRequestWatchdog();
2013
+ this.timing.clearAdFailsafeTimer();
2014
+ if (this.timing.activeAdRequestToken === requestToken) {
2015
+ this.timing.activeAdRequestToken = null;
2016
+ }
2017
+ throw error;
2018
+ case 17:
2019
+ return [
2020
+ 2
2021
+ ];
2022
+ }
2023
+ });
2024
+ }).call(this);
2025
+ }
2026
+ },
2027
+ {
2028
+ key: "showPlaceholderAndWaitForAds",
2029
+ value: // ───────────────────────────────────────────────────────────────
2030
+ // Placeholder wait
2031
+ // ───────────────────────────────────────────────────────────────
2032
+ function showPlaceholderAndWaitForAds() {
2033
+ return _async_to_generator(function() {
2034
+ var remaining, waitTime, checkInterval, maxChecks, i, nextAdUrl, error, errorMessage;
2035
+ return _ts_generator(this, function(_state) {
2036
+ switch(_state.label){
2037
+ case 0:
2038
+ remaining = this.timing.getRemainingAdMs();
2039
+ waitTime = Math.min(this.maxPlaceholderDurationMs, remaining);
2040
+ if (this.timing.isGamInCooldown()) {
2041
+ if (this.debug) console.log("[CIRCUIT-BREAKER] GAM in cooldown, skipping placeholder wait");
2042
+ this.handleAdPodComplete();
2043
+ return [
2044
+ 2
2045
+ ];
2046
+ }
2047
+ if (this.timing.consecutiveFailures >= this.timing.maxConsecutiveFailures) {
2048
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Skipping placeholder - too many consecutive failures");
2049
+ this.handleAdPodComplete();
2050
+ return [
2051
+ 2
2052
+ ];
2053
+ }
2054
+ if (waitTime < 1e3) {
2055
+ this.handleAdPodComplete();
2056
+ return [
2057
+ 2
2058
+ ];
2059
+ }
2060
+ if (this.debug) {
2061
+ console.log("[CONTINUOUS-FETCH] Showing placeholder for ".concat(waitTime, "ms while waiting for ad URLs"));
2062
+ }
2063
+ this.isShowingPlaceholder = true;
2064
+ this.host.getAdPlayer().showPlaceholder();
2065
+ checkInterval = 300;
2066
+ maxChecks = Math.floor(waitTime / checkInterval);
2067
+ i = 0;
2068
+ _state.label = 1;
2069
+ case 1:
2070
+ if (!(i < maxChecks)) return [
2071
+ 3,
2072
+ 12
2073
+ ];
2074
+ return [
2075
+ 4,
2076
+ new Promise(function(resolve) {
2077
+ return setTimeout(resolve, checkInterval);
2078
+ })
2079
+ ];
2080
+ case 2:
2081
+ _state.sent();
2082
+ if (!this.inAdBreak) return [
2083
+ 2
2084
+ ];
2085
+ if (this.timing.consecutiveFailures >= this.timing.maxConsecutiveFailures) {
2086
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Too many failures during placeholder wait");
2087
+ return [
2088
+ 3,
2089
+ 12
2090
+ ];
2091
+ }
2092
+ if (!this.timing.hasTimeToStartAnotherAd()) {
2093
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Not enough time remaining during placeholder wait, ending ad break");
2094
+ return [
2095
+ 3,
2096
+ 12
2097
+ ];
2098
+ }
2099
+ _state.label = 3;
2100
+ case 3:
2101
+ if (!(this.adRequestQueue.length > 0)) return [
2102
+ 3,
2103
+ 11
2104
+ ];
2105
+ if (!this.timing.hasTimeToStartAnotherAd()) return [
2106
+ 3,
2107
+ 11
2108
+ ];
2109
+ nextAdUrl = this.adRequestQueue.shift();
2110
+ if (!nextAdUrl) return [
2111
+ 3,
2112
+ 3
2113
+ ];
2114
+ if (this.timing.failedVastUrls.has(nextAdUrl)) return [
2115
+ 3,
2116
+ 3
2117
+ ];
2118
+ if (this.timing.isUrlInCooldown(nextAdUrl)) return [
2119
+ 3,
2120
+ 3
2121
+ ];
2122
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Ad URL available, requesting via HLS ad player");
2123
+ this.isShowingPlaceholder = false;
2124
+ this.host.getAdPlayer().hidePlaceholder();
2125
+ _state.label = 4;
2126
+ case 4:
2127
+ _state.trys.push([
2128
+ 4,
2129
+ 6,
2130
+ ,
2131
+ 10
2132
+ ]);
2133
+ return [
2134
+ 4,
2135
+ this.playSingleAd(nextAdUrl)
2136
+ ];
2137
+ case 5:
2138
+ _state.sent();
2139
+ this.timing.consecutiveFailures = 0;
2140
+ return [
2141
+ 3,
2142
+ 10
2143
+ ];
2144
+ case 6:
2145
+ error = _state.sent();
2146
+ errorMessage = error.message;
2147
+ if (!errorMessage.includes("ad_duration_exceeds_budget")) return [
2148
+ 3,
2149
+ 8
2150
+ ];
2151
+ return [
2152
+ 4,
2153
+ this.tryNextAvailableAdWithRateLimit()
2154
+ ];
2155
+ case 7:
2156
+ _state.sent();
2157
+ return [
2158
+ 2
2159
+ ];
2160
+ case 8:
2161
+ if (!errorMessage.includes("permanently failed") && !errorMessage.includes("in cooldown")) {
2162
+ this.timing.consecutiveFailures++;
2163
+ }
2164
+ return [
2165
+ 4,
2166
+ this.tryNextAvailableAdWithRateLimit()
2167
+ ];
2168
+ case 9:
2169
+ _state.sent();
2170
+ return [
2171
+ 3,
2172
+ 10
2173
+ ];
2174
+ case 10:
2175
+ return [
2176
+ 2
2177
+ ];
2178
+ case 11:
2179
+ i++;
2180
+ return [
2181
+ 3,
2182
+ 1
2183
+ ];
2184
+ case 12:
2185
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Placeholder timeout, ending ad break");
2186
+ this.isShowingPlaceholder = false;
2187
+ this.host.getAdPlayer().hidePlaceholder();
2188
+ this.handleAdPodComplete();
2189
+ return [
2190
+ 2
2191
+ ];
2192
+ }
2193
+ });
2194
+ }).call(this);
2195
+ }
2196
+ },
2197
+ {
2198
+ // ───────────────────────────────────────────────────────────────
2199
+ // Ad break completion
2200
+ // ───────────────────────────────────────────────────────────────
2201
+ key: "handleAdPodComplete",
2202
+ value: function handleAdPodComplete() {
2203
+ if (this.debug) {
2204
+ console.log("[StormcloudVideoPlayer] Ad pod complete - cleaning up");
2205
+ }
2206
+ this.timing.resetForBreakEnd();
2207
+ this.stopContinuousFetching();
2208
+ this.preloadPool.stop();
2209
+ this.clearPendingAdBreak();
2210
+ if (this.isShowingPlaceholder) {
2211
+ this.host.getAdPlayer().hidePlaceholder();
2212
+ this.isShowingPlaceholder = false;
2213
+ }
2214
+ this.adRequestQueue = [];
2215
+ this.inAdBreak = false;
2216
+ this.adDetectSentForCurrentBreak = false;
2217
+ this.cueManager.activeScte35BreakKey = void 0;
2218
+ this.cueManager.scheduledScte35BreakKey = void 0;
2219
+ this.adPodQueue = [];
2220
+ this.showAds = false;
2221
+ this.host.getAdPlayer().stop().catch(function() {});
2222
+ var restoredMuted = this.host.getAdPlayer().getOriginalMutedState();
2223
+ var restoredVolume = this.host.getAdPlayer().getOriginalVolume();
2224
+ if (this.host.video.muted !== restoredMuted) {
2225
+ this.host.video.muted = restoredMuted;
2226
+ }
2227
+ if (Math.abs(this.host.video.volume - restoredVolume) > 0.01) {
2228
+ this.host.video.volume = restoredVolume;
2229
+ }
2230
+ if (this.host.shouldContinueLiveStreamDuringAds()) {
2231
+ if (this.host.video.paused) {
2232
+ var _this_host_video_play;
2233
+ if (this.debug) console.log("[StormcloudVideoPlayer] Content video paused in live mode after ads, resuming playback");
2234
+ (_this_host_video_play = this.host.video.play()) === null || _this_host_video_play === void 0 ? void 0 : _this_host_video_play.catch(function() {});
2235
+ } else {
2236
+ if (this.debug) console.log("[StormcloudVideoPlayer] Content video already playing in live mode after ads");
2237
+ }
2238
+ } else if (this.host.video.paused) {
2239
+ var _this_host_video_play1;
2240
+ (_this_host_video_play1 = this.host.video.play()) === null || _this_host_video_play1 === void 0 ? void 0 : _this_host_video_play1.catch(function() {});
2241
+ }
2242
+ }
2243
+ },
2244
+ {
2245
+ key: "handleAdFailure",
2246
+ value: function handleAdFailure() {
2247
+ this.timing.consecutiveFailures++;
2248
+ this.timing.recordGamNoFill();
2249
+ var remaining = this.timing.getRemainingAdMs();
2250
+ if (this.debug) {
2251
+ console.log("[CONTINUOUS-FETCH] Ad failure: remaining=".concat(remaining, "ms, queued ads=").concat(this.adRequestQueue.length, ", consecutiveFailures=").concat(this.timing.consecutiveFailures), this.adRequestQueue.length > 0 ? {
2252
+ queuedUrls: _to_consumable_array(this.adRequestQueue)
2253
+ } : {});
2254
+ }
2255
+ if (this.timing.consecutiveFailures >= this.timing.maxConsecutiveFailures) {
2256
+ if (this.debug) console.log("[CONTINUOUS-FETCH] Max consecutive failures reached (".concat(this.timing.consecutiveFailures, "), ending ad break gracefully"));
2257
+ this.handleAdPodComplete();
2258
+ return;
2259
+ }
2260
+ if (this.timing.hasTimeToStartAnotherAd()) {
2261
+ this.tryNextAvailableAdWithRateLimit();
2262
+ } else {
2263
+ if (this.debug) console.log("[AD-ERROR] Ad failed and not enough time remaining for another ad. Failed URLs:", this.timing.failedVastUrls.size);
2264
+ this.handleAdPodComplete();
2265
+ }
2266
+ }
2267
+ }
2268
+ ]);
2269
+ return AdBreakOrchestrator;
2270
+ }();
2271
+ // Annotate the CommonJS export names for ESM import in node:
2272
+ 0 && (module.exports = {
2273
+ AdBreakOrchestrator: AdBreakOrchestrator
2274
+ });
2275
+ //# sourceMappingURL=AdBreakOrchestrator.cjs.map