@signageos/lib-bundler 23.18.0 → 23.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -829,14 +829,14 @@ var AbortControllerShim = (global) => {
829
829
  this.dispatchEvent(new global.Event("abort"));
830
830
  }
831
831
  static abort(reason) {
832
- const controller = new AbortController();
832
+ const controller = new global.AbortController();
833
833
  controller.abort(reason);
834
834
  return controller.signal;
835
835
  }
836
836
  // This methods is not spec complaint, because it requires WeakSet.
837
837
  // https://github.com/zloirock/core-js/issues/445
838
838
  static any(signals) {
839
- const controller = new AbortController();
839
+ const controller = new global.AbortController();
840
840
  for (const s of signals) {
841
841
  const onAbort = () => {
842
842
  controller.abort(s.reason);
@@ -850,7 +850,7 @@ var AbortControllerShim = (global) => {
850
850
  if (timeoutMs < 0 || timeoutMs > Number.MAX_SAFE_INTEGER) {
851
851
  throw new global.TypeError("AbortSignal.timeout: Argument 1 is out of range for unsigned long long.");
852
852
  }
853
- const controller = new AbortController();
853
+ const controller = new global.AbortController();
854
854
  global.setTimeout(() => {
855
855
  controller.abort(new global.DOMException("The operation timed out.", "TimeoutError"));
856
856
  }, timeoutMs);
package/dist/index.mjs CHANGED
@@ -787,14 +787,14 @@ var AbortControllerShim = (global) => {
787
787
  this.dispatchEvent(new global.Event("abort"));
788
788
  }
789
789
  static abort(reason) {
790
- const controller = new AbortController();
790
+ const controller = new global.AbortController();
791
791
  controller.abort(reason);
792
792
  return controller.signal;
793
793
  }
794
794
  // This methods is not spec complaint, because it requires WeakSet.
795
795
  // https://github.com/zloirock/core-js/issues/445
796
796
  static any(signals) {
797
- const controller = new AbortController();
797
+ const controller = new global.AbortController();
798
798
  for (const s of signals) {
799
799
  const onAbort = () => {
800
800
  controller.abort(s.reason);
@@ -808,7 +808,7 @@ var AbortControllerShim = (global) => {
808
808
  if (timeoutMs < 0 || timeoutMs > Number.MAX_SAFE_INTEGER) {
809
809
  throw new global.TypeError("AbortSignal.timeout: Argument 1 is out of range for unsigned long long.");
810
810
  }
811
- const controller = new AbortController();
811
+ const controller = new global.AbortController();
812
812
  global.setTimeout(() => {
813
813
  controller.abort(new global.DOMException("The operation timed out.", "TimeoutError"));
814
814
  }, timeoutMs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signageos/lib-bundler",
3
- "version": "23.18.0",
3
+ "version": "23.18.1",
4
4
  "main": "./dist/index.cjs",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -9,6 +9,7 @@
9
9
  "files": [
10
10
  "tools",
11
11
  "dist",
12
+ "polyfills",
12
13
  "package.json"
13
14
  ],
14
15
  "exports": {
@@ -0,0 +1,379 @@
1
+ "use strict";
2
+ function _assert_this_initialized(self1) {
3
+ if (self1 === void 0) {
4
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5
+ }
6
+ return self1;
7
+ }
8
+ function _class_call_check(instance, Constructor) {
9
+ if (!(instance instanceof Constructor)) {
10
+ throw new TypeError("Cannot call a class as a function");
11
+ }
12
+ }
13
+ function _defineProperties(target, props) {
14
+ for(var i = 0; i < props.length; i++){
15
+ var descriptor = props[i];
16
+ descriptor.enumerable = descriptor.enumerable || false;
17
+ descriptor.configurable = true;
18
+ if ("value" in descriptor) descriptor.writable = true;
19
+ Object.defineProperty(target, descriptor.key, descriptor);
20
+ }
21
+ }
22
+ function _create_class(Constructor, protoProps, staticProps) {
23
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
24
+ if (staticProps) _defineProperties(Constructor, staticProps);
25
+ return Constructor;
26
+ }
27
+ function _define_property(obj, key, value) {
28
+ if (key in obj) {
29
+ Object.defineProperty(obj, key, {
30
+ value: value,
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true
34
+ });
35
+ } else {
36
+ obj[key] = value;
37
+ }
38
+ return obj;
39
+ }
40
+ function _get(target, property, receiver) {
41
+ if (typeof Reflect !== "undefined" && Reflect.get) {
42
+ _get = Reflect.get;
43
+ } else {
44
+ _get = function get(target, property, receiver) {
45
+ var base = _super_prop_base(target, property);
46
+ if (!base) return;
47
+ var desc = Object.getOwnPropertyDescriptor(base, property);
48
+ if (desc.get) {
49
+ return desc.get.call(receiver || target);
50
+ }
51
+ return desc.value;
52
+ };
53
+ }
54
+ return _get(target, property, receiver || target);
55
+ }
56
+ function _get_prototype_of(o) {
57
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
58
+ return o.__proto__ || Object.getPrototypeOf(o);
59
+ };
60
+ return _get_prototype_of(o);
61
+ }
62
+ function _inherits(subClass, superClass) {
63
+ if (typeof superClass !== "function" && superClass !== null) {
64
+ throw new TypeError("Super expression must either be null or a function");
65
+ }
66
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
67
+ constructor: {
68
+ value: subClass,
69
+ writable: true,
70
+ configurable: true
71
+ }
72
+ });
73
+ if (superClass) _set_prototype_of(subClass, superClass);
74
+ }
75
+ function _object_spread(target) {
76
+ for(var i = 1; i < arguments.length; i++){
77
+ var source = arguments[i] != null ? arguments[i] : {};
78
+ var ownKeys = Object.keys(source);
79
+ if (typeof Object.getOwnPropertySymbols === "function") {
80
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
81
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
82
+ }));
83
+ }
84
+ ownKeys.forEach(function(key) {
85
+ _define_property(target, key, source[key]);
86
+ });
87
+ }
88
+ return target;
89
+ }
90
+ function ownKeys(object, enumerableOnly) {
91
+ var keys = Object.keys(object);
92
+ if (Object.getOwnPropertySymbols) {
93
+ var symbols = Object.getOwnPropertySymbols(object);
94
+ if (enumerableOnly) {
95
+ symbols = symbols.filter(function(sym) {
96
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
97
+ });
98
+ }
99
+ keys.push.apply(keys, symbols);
100
+ }
101
+ return keys;
102
+ }
103
+ function _object_spread_props(target, source) {
104
+ source = source != null ? source : {};
105
+ if (Object.getOwnPropertyDescriptors) {
106
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
107
+ } else {
108
+ ownKeys(Object(source)).forEach(function(key) {
109
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
110
+ });
111
+ }
112
+ return target;
113
+ }
114
+ function _possible_constructor_return(self1, call) {
115
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
116
+ return call;
117
+ }
118
+ return _assert_this_initialized(self1);
119
+ }
120
+ function _set_prototype_of(o, p) {
121
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
122
+ o.__proto__ = p;
123
+ return o;
124
+ };
125
+ return _set_prototype_of(o, p);
126
+ }
127
+ function _super_prop_base(object, property) {
128
+ while(!Object.prototype.hasOwnProperty.call(object, property)){
129
+ object = _get_prototype_of(object);
130
+ if (object === null) break;
131
+ }
132
+ return object;
133
+ }
134
+ function _type_of(obj) {
135
+ "@swc/helpers - typeof";
136
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
137
+ }
138
+ function _is_native_reflect_construct() {
139
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
140
+ if (Reflect.construct.sham) return false;
141
+ if (typeof Proxy === "function") return true;
142
+ try {
143
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
144
+ return true;
145
+ } catch (e) {
146
+ return false;
147
+ }
148
+ }
149
+ function _create_super(Derived) {
150
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
151
+ return function _createSuperInternal() {
152
+ var Super = _get_prototype_of(Derived), result;
153
+ if (hasNativeReflectConstruct) {
154
+ var NewTarget = _get_prototype_of(this).constructor;
155
+ result = Reflect.construct(Super, arguments, NewTarget);
156
+ } else {
157
+ result = Super.apply(this, arguments);
158
+ }
159
+ return _possible_constructor_return(this, result);
160
+ };
161
+ }
162
+ (function() {
163
+ var __getOwnPropNames = Object.getOwnPropertyNames;
164
+ var __esm = function(fn, res) {
165
+ return function __init() {
166
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
167
+ };
168
+ };
169
+ var __commonJS = function(cb, mod) {
170
+ return function __require() {
171
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = {
172
+ exports: {}
173
+ }).exports, mod), mod.exports;
174
+ };
175
+ };
176
+ // src/polyfills/utils.ts
177
+ var getGlobal;
178
+ var init_utils = __esm({
179
+ "src/polyfills/utils.ts": function() {
180
+ "use strict";
181
+ getGlobal = function() {
182
+ return typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : new Function("return this")();
183
+ };
184
+ }
185
+ });
186
+ // src/polyfills/AbortController/AbortController.ts
187
+ var AbortControllerShim;
188
+ var init_AbortController = __esm({
189
+ "src/polyfills/AbortController/AbortController.ts": function() {
190
+ "use strict";
191
+ AbortControllerShim = function(global2) {
192
+ var SECRET = {};
193
+ var AbortSignal = /*#__PURE__*/ function(_global2_EventTarget) {
194
+ _inherits(AbortSignal, _global2_EventTarget);
195
+ var _super = _create_super(AbortSignal);
196
+ function AbortSignal(secret) {
197
+ _class_call_check(this, AbortSignal);
198
+ var _this;
199
+ _this = _super.call(this);
200
+ _define_property(_assert_this_initialized(_this), "_reason", void 0);
201
+ _define_property(_assert_this_initialized(_this), "_onabort", null);
202
+ if (secret !== SECRET) {
203
+ throw new global2.TypeError("Illegal constructor.");
204
+ }
205
+ return _this;
206
+ }
207
+ _create_class(AbortSignal, [
208
+ {
209
+ key: "aborted",
210
+ get: function get() {
211
+ return this._reason !== void 0;
212
+ }
213
+ },
214
+ {
215
+ key: "reason",
216
+ get: function get() {
217
+ return this._reason;
218
+ }
219
+ },
220
+ {
221
+ key: "onabort",
222
+ get: function get() {
223
+ return this._onabort;
224
+ },
225
+ set: function set(callback) {
226
+ if (this._onabort) {
227
+ this.removeEventListener("abort", this._onabort);
228
+ }
229
+ this._onabort = callback;
230
+ this.addEventListener("abort", callback, {
231
+ once: true
232
+ });
233
+ }
234
+ },
235
+ {
236
+ key: "addEventListener",
237
+ value: function addEventListener(type, callback, options) {
238
+ return _get(_get_prototype_of(AbortSignal.prototype), "addEventListener", this).call(this, type, callback, typeof options === "boolean" ? {
239
+ capture: options,
240
+ once: true
241
+ } : _object_spread_props(_object_spread({}, options), {
242
+ once: true
243
+ }));
244
+ }
245
+ },
246
+ {
247
+ key: "throwIfAborted",
248
+ value: function throwIfAborted() {
249
+ if (this._reason !== void 0) {
250
+ throw this._reason;
251
+ }
252
+ }
253
+ },
254
+ {
255
+ key: "__dispatchAbort",
256
+ value: function __dispatchAbort(reason) {
257
+ if (this._reason) {
258
+ return;
259
+ }
260
+ if (reason === void 0) {
261
+ reason = new global2.DOMException("The operation was aborted.", "AbortError");
262
+ }
263
+ this._reason = reason;
264
+ this.dispatchEvent(new global2.Event("abort"));
265
+ }
266
+ }
267
+ ], [
268
+ {
269
+ key: "abort",
270
+ value: function abort(reason) {
271
+ var controller = new global2.AbortController();
272
+ controller.abort(reason);
273
+ return controller.signal;
274
+ }
275
+ },
276
+ {
277
+ key: "any",
278
+ value: // This methods is not spec complaint, because it requires WeakSet.
279
+ // https://github.com/zloirock/core-js/issues/445
280
+ function any(signals) {
281
+ var controller = new global2.AbortController();
282
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
283
+ try {
284
+ var _loop = function() {
285
+ var s = _step.value;
286
+ var onAbort = function() {
287
+ controller.abort(s.reason);
288
+ s.removeEventListener("abort", onAbort);
289
+ };
290
+ s.addEventListener("abort", onAbort, {
291
+ once: true
292
+ });
293
+ };
294
+ for(var _iterator = signals[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
295
+ } catch (err) {
296
+ _didIteratorError = true;
297
+ _iteratorError = err;
298
+ } finally{
299
+ try {
300
+ if (!_iteratorNormalCompletion && _iterator["return"] != null) {
301
+ _iterator["return"]();
302
+ }
303
+ } finally{
304
+ if (_didIteratorError) {
305
+ throw _iteratorError;
306
+ }
307
+ }
308
+ }
309
+ return controller.signal;
310
+ }
311
+ },
312
+ {
313
+ key: "timeout",
314
+ value: function timeout(timeoutMs) {
315
+ if (timeoutMs < 0 || timeoutMs > Number.MAX_SAFE_INTEGER) {
316
+ throw new global2.TypeError("AbortSignal.timeout: Argument 1 is out of range for unsigned long long.");
317
+ }
318
+ var controller = new global2.AbortController();
319
+ global2.setTimeout(function() {
320
+ controller.abort(new global2.DOMException("The operation timed out.", "TimeoutError"));
321
+ }, timeoutMs);
322
+ return controller.signal;
323
+ }
324
+ }
325
+ ]);
326
+ return AbortSignal;
327
+ }(global2.EventTarget);
328
+ var AbortController = /*#__PURE__*/ function() {
329
+ function AbortController() {
330
+ _class_call_check(this, AbortController);
331
+ _define_property(this, "signal", void 0);
332
+ this.signal = new AbortSignal(SECRET);
333
+ }
334
+ _create_class(AbortController, [
335
+ {
336
+ key: "abort",
337
+ value: function abort(reason) {
338
+ this.signal.__dispatchAbort(reason);
339
+ }
340
+ }
341
+ ]);
342
+ return AbortController;
343
+ }();
344
+ return {
345
+ AbortController: AbortController,
346
+ AbortSignal: AbortSignal
347
+ };
348
+ };
349
+ }
350
+ });
351
+ // src/polyfills/AbortController/polyfill.ts
352
+ var require_polyfill = __commonJS({
353
+ "src/polyfills/AbortController/polyfill.ts": function() {
354
+ init_utils();
355
+ init_AbortController();
356
+ (function() {
357
+ var g = getGlobal();
358
+ var shim = AbortControllerShim(g);
359
+ if (g.AbortController === void 0) {
360
+ g.AbortController = shim.AbortController;
361
+ g.AbortSignal = shim.AbortSignal;
362
+ }
363
+ if (!g.AbortSignal.abort) {
364
+ g.AbortSignal.abort = shim.AbortSignal.abort;
365
+ }
366
+ if (!g.AbortSignal.timeout) {
367
+ g.AbortSignal.timeout = shim.AbortSignal.timeout;
368
+ }
369
+ if (!g.AbortSignal.any) {
370
+ g.AbortSignal.any = shim.AbortSignal.any;
371
+ }
372
+ if (!g.AbortSignal.prototype.throwIfAborted) {
373
+ g.AbortSignal.prototype.throwIfAborted = shim.AbortSignal.prototype.throwIfAborted;
374
+ }
375
+ })();
376
+ }
377
+ });
378
+ require_polyfill();
379
+ })();