@vindral/web-sdk 4.0.0-103-gf1770916 → 4.0.0-105-g107caaa1
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/{B-vVOk9N.js → BMbR87FC.js} +1061 -1054
- package/{w4l9GN2Z.js → BaUeuutp.js} +1 -1
- package/{CLh-e-53.js → DqcFFMob.js} +4 -4
- package/{C9X9NCHZ.js → Dz5gbrn2.js} +1 -1
- package/core.js +1 -1
- package/legacy.es.js +1192 -1185
- package/legacy.umd.js +7 -7
- package/package.json +1 -1
- package/player.js +3 -3
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
var Sc = Object.create;
|
|
2
2
|
var _n = Object.defineProperty, Uc = Object.defineProperties, Ec = Object.getOwnPropertyDescriptor, Tc = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var $r = Object.getOwnPropertySymbols;
|
|
4
4
|
var Za = Object.prototype.hasOwnProperty, Ka = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var vt = (r, t) => (t = Symbol[r]) ? t : Symbol.for("Symbol." + r), xt = (r) => {
|
|
6
6
|
throw TypeError(r);
|
|
7
7
|
};
|
|
8
|
-
var
|
|
8
|
+
var Mr = (r, t, e) => t in r ? _n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, zt = (r, t) => {
|
|
9
9
|
for (var e in t || (t = {}))
|
|
10
|
-
Za.call(t, e) &&
|
|
11
|
-
if (
|
|
12
|
-
for (var e of
|
|
13
|
-
Ka.call(t, e) &&
|
|
10
|
+
Za.call(t, e) && Mr(r, e, t[e]);
|
|
11
|
+
if ($r)
|
|
12
|
+
for (var e of $r(t))
|
|
13
|
+
Ka.call(t, e) && Mr(r, e, t[e]);
|
|
14
14
|
return r;
|
|
15
|
-
},
|
|
15
|
+
}, zr = (r, t) => Uc(r, Tc(t)), Ya = (r, t) => _n(r, "name", { value: t, configurable: !0 });
|
|
16
16
|
var Ja = (r, t) => {
|
|
17
17
|
var e = {};
|
|
18
18
|
for (var i in r)
|
|
19
19
|
Za.call(r, i) && t.indexOf(i) < 0 && (e[i] = r[i]);
|
|
20
|
-
if (r != null &&
|
|
21
|
-
for (var i of
|
|
20
|
+
if (r != null && $r)
|
|
21
|
+
for (var i of $r(r))
|
|
22
22
|
t.indexOf(i) < 0 && Ka.call(r, i) && (e[i] = r[i]);
|
|
23
23
|
return e;
|
|
24
24
|
};
|
|
25
25
|
var ue = (r) => {
|
|
26
26
|
var t;
|
|
27
|
-
return [, , , Sc((t = r == null ? void 0 : r[
|
|
28
|
-
}, Qa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"],
|
|
27
|
+
return [, , , Sc((t = r == null ? void 0 : r[vt("metadata")]) != null ? t : null)];
|
|
28
|
+
}, Qa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], ai = (r) => r !== void 0 && typeof r != "function" ? xt("Function expected") : r, Ac = (r, t, e, i, n) => ({ kind: Qa[r], name: t, metadata: i, addInitializer: (a) => e._ ? xt("Already initialized") : n.push(ai(a || null)) }), Ht = (r, t) => Mr(t, vt("metadata"), r[3]), he = (r, t, e, i) => {
|
|
29
29
|
for (var n = 0, a = r[t >> 1], c = a && a.length; n < c; n++) t & 1 ? a[n].call(e) : i = a[n].call(e, i);
|
|
30
30
|
return i;
|
|
31
31
|
}, H = (r, t, e, i, n, a) => {
|
|
32
|
-
var c,
|
|
32
|
+
var c, l, w, p, m, b = t & 7, I = !!(t & 8), g = !!(t & 16), E = b > 3 ? r.length + 1 : b ? I ? 1 : 2 : 0, z = Qa[b + 5], _ = b > 3 && (r[E - 1] = []), D = r[E] || (r[E] = []), S = b && (!g && !I && (n = n.prototype), b < 5 && (b > 3 || !g) && Ec(b < 4 ? n : { get [e]() {
|
|
33
33
|
return s(this, a);
|
|
34
34
|
}, set [e](v) {
|
|
35
35
|
return u(this, a, v);
|
|
36
36
|
} }, e));
|
|
37
37
|
b ? g && b < 4 && Ya(a, (b > 2 ? "set " : b > 1 ? "get " : "") + e) : Ya(n, e);
|
|
38
38
|
for (var W = i.length - 1; W >= 0; W--)
|
|
39
|
-
p = Ac(b, e, w = {}, r[3], D), b && (p.static = I, p.private = g, m = p.access = { has: g ? (v) => Dc(n, v) : (v) => e in v }, b ^ 3 && (m.get = g ? (v) => (b ^ 1 ? s : f)(v, n, b ^ 4 ? a : S.get) : (v) => v[e]), b > 2 && (m.set = g ? (v, R) => u(v, n, R, b ^ 4 ? a : S.set) : (v, R) => v[e] = R)),
|
|
40
|
-
return b ||
|
|
41
|
-
},
|
|
39
|
+
p = Ac(b, e, w = {}, r[3], D), b && (p.static = I, p.private = g, m = p.access = { has: g ? (v) => Dc(n, v) : (v) => e in v }, b ^ 3 && (m.get = g ? (v) => (b ^ 1 ? s : f)(v, n, b ^ 4 ? a : S.get) : (v) => v[e]), b > 2 && (m.set = g ? (v, R) => u(v, n, R, b ^ 4 ? a : S.set) : (v, R) => v[e] = R)), l = (0, i[W])(b ? b < 4 ? g ? a : S[z] : b > 4 ? void 0 : { get: S.get, set: S.set } : n, p), w._ = 1, b ^ 4 || l === void 0 ? ai(l) && (b > 4 ? _.unshift(l) : b ? g ? a = l : S[z] = l : n = l) : typeof l != "object" || l === null ? xt("Object expected") : (ai(c = l.get) && (S.get = c), ai(c = l.set) && (S.set = c), ai(c = l.init) && _.unshift(c));
|
|
40
|
+
return b || Ht(r, n), S && _n(n, e, S), g ? b ^ 4 ? a : S : n;
|
|
41
|
+
}, d = (r, t, e) => Mr(r, typeof t != "symbol" ? t + "" : t, e), ta = (r, t, e) => t.has(r) || xt("Cannot " + e), Dc = (r, t) => Object(t) !== t ? xt('Cannot use the "in" operator on this value') : r.has(t), s = (r, t, e) => (ta(r, t, "read from private field"), e ? e.call(r) : t.get(r)), o = (r, t, e) => t.has(r) ? xt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), u = (r, t, e, i) => (ta(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e), f = (r, t, e) => (ta(r, t, "access private method"), e);
|
|
42
42
|
var ea = (r, t, e, i) => ({
|
|
43
43
|
set _(n) {
|
|
44
44
|
u(r, t, n, e);
|
|
@@ -50,63 +50,63 @@ var ea = (r, t, e, i) => ({
|
|
|
50
50
|
var h = (r, t, e) => new Promise((i, n) => {
|
|
51
51
|
var a = (w) => {
|
|
52
52
|
try {
|
|
53
|
-
|
|
53
|
+
l(e.next(w));
|
|
54
54
|
} catch (p) {
|
|
55
55
|
n(p);
|
|
56
56
|
}
|
|
57
57
|
}, c = (w) => {
|
|
58
58
|
try {
|
|
59
|
-
|
|
59
|
+
l(e.throw(w));
|
|
60
60
|
} catch (p) {
|
|
61
61
|
n(p);
|
|
62
62
|
}
|
|
63
|
-
},
|
|
64
|
-
|
|
63
|
+
}, l = (w) => w.done ? i(w.value) : Promise.resolve(w.value).then(a, c);
|
|
64
|
+
l((e = e.apply(r, t)).next());
|
|
65
65
|
}), O = function(r, t) {
|
|
66
66
|
this[0] = r, this[1] = t;
|
|
67
|
-
},
|
|
68
|
-
var i = (c,
|
|
67
|
+
}, Pt = (r, t, e) => {
|
|
68
|
+
var i = (c, l, w, p) => {
|
|
69
69
|
try {
|
|
70
|
-
var m = e[c](
|
|
71
|
-
Promise.resolve(b ?
|
|
70
|
+
var m = e[c](l), b = (l = m.value) instanceof O, I = m.done;
|
|
71
|
+
Promise.resolve(b ? l[0] : l).then((g) => b ? i(c === "return" ? c : "next", l[1] ? { done: g.done, value: g.value } : g, w, p) : w({ value: g, done: I })).catch((g) => i("throw", g, w, p));
|
|
72
72
|
} catch (g) {
|
|
73
73
|
p(g);
|
|
74
74
|
}
|
|
75
|
-
}, n = (c) => a[c] = (
|
|
76
|
-
return e = e.apply(r, t), a[
|
|
75
|
+
}, n = (c) => a[c] = (l) => new Promise((w, p) => i(c, l, w, p)), a = {};
|
|
76
|
+
return e = e.apply(r, t), a[vt("asyncIterator")] = () => a, n("next"), n("throw"), n("return"), a;
|
|
77
77
|
}, sa = (r) => {
|
|
78
|
-
var t = r[
|
|
79
|
-
return t == null ? (t = r[
|
|
78
|
+
var t = r[vt("asyncIterator")], e = !1, i, n = {};
|
|
79
|
+
return t == null ? (t = r[vt("iterator")](), i = (a) => n[a] = (c) => t[a](c)) : (t = t.call(r), i = (a) => n[a] = (c) => {
|
|
80
80
|
if (e) {
|
|
81
81
|
if (e = !1, a === "throw") throw c;
|
|
82
82
|
return c;
|
|
83
83
|
}
|
|
84
84
|
return e = !0, {
|
|
85
85
|
done: !1,
|
|
86
|
-
value: new O(new Promise((
|
|
86
|
+
value: new O(new Promise((l) => {
|
|
87
87
|
var w = t[a](c);
|
|
88
|
-
w instanceof Object ||
|
|
88
|
+
w instanceof Object || xt("Object expected"), l(w);
|
|
89
89
|
}), 1)
|
|
90
90
|
};
|
|
91
|
-
}), n[
|
|
91
|
+
}), n[vt("iterator")] = () => n, i("next"), "throw" in t ? i("throw") : n.throw = (a) => {
|
|
92
92
|
throw a;
|
|
93
93
|
}, "return" in t && i("return"), n;
|
|
94
|
-
}, C = (r, t, e) => (t = r[
|
|
94
|
+
}, C = (r, t, e) => (t = r[vt("asyncIterator")]) ? t.call(r) : (r = r[vt("iterator")](), t = {}, e = (i, n) => (n = r[i]) && (t[i] = (a) => new Promise((c, l, w) => (a = n.call(r, a), w = a.done, Promise.resolve(a.value).then((p) => c({ value: p, done: w }), l)))), e("next"), e("return"), t);
|
|
95
95
|
var nt = (r, t, e) => {
|
|
96
96
|
if (t != null) {
|
|
97
|
-
typeof t != "object" && typeof t != "function" &&
|
|
97
|
+
typeof t != "object" && typeof t != "function" && xt("Object expected");
|
|
98
98
|
var i;
|
|
99
|
-
e && (i = t[
|
|
99
|
+
e && (i = t[vt("asyncDispose")]), i === void 0 && (i = t[vt("dispose")]), typeof i != "function" && xt("Object not disposable"), r.push([e, i, t]);
|
|
100
100
|
} else e && r.push([e]);
|
|
101
101
|
return t;
|
|
102
102
|
}, at = (r, t, e) => {
|
|
103
|
-
var i = typeof SuppressedError == "function" ? SuppressedError : function(c,
|
|
104
|
-
return p = Error(w), p.name = "SuppressedError", p.error = c, p.suppressed =
|
|
103
|
+
var i = typeof SuppressedError == "function" ? SuppressedError : function(c, l, w, p) {
|
|
104
|
+
return p = Error(w), p.name = "SuppressedError", p.error = c, p.suppressed = l, p;
|
|
105
105
|
}, n = (c) => t = e ? new i(c, t, "An error was suppressed during disposal") : (e = !0, c), a = (c) => {
|
|
106
106
|
for (; c = r.pop(); )
|
|
107
107
|
try {
|
|
108
|
-
var
|
|
109
|
-
if (c[0]) return Promise.resolve(
|
|
108
|
+
var l = c[1] && c[1].call(c[2]);
|
|
109
|
+
if (c[0]) return Promise.resolve(l).then(a, (w) => (n(w), a()));
|
|
110
110
|
} catch (w) {
|
|
111
111
|
n(w);
|
|
112
112
|
}
|
|
@@ -114,31 +114,31 @@ var nt = (r, t, e) => {
|
|
|
114
114
|
};
|
|
115
115
|
return a();
|
|
116
116
|
};
|
|
117
|
-
import { D as V, F as Ba, n as A, B as Zn, L as rt, b as Oc, w as Kn, i as q, a as Vc, W as Cc, t as ko, m as Bc, c as xc, e as Pc } from "./
|
|
118
|
-
import { a as Io, p as Rc, i as jc, c as
|
|
117
|
+
import { D as V, F as Ba, n as A, B as Zn, L as rt, b as Oc, w as Kn, i as q, a as Vc, W as Cc, t as ko, m as Bc, c as xc, e as Pc } from "./DqcFFMob.js";
|
|
118
|
+
import { a as Io, p as Rc, i as jc, c as Gc } from "./C80BN8Qb.js";
|
|
119
119
|
function xa(r) {
|
|
120
120
|
const t = new Jn(r);
|
|
121
121
|
return [t, t];
|
|
122
122
|
}
|
|
123
|
-
var
|
|
123
|
+
var Rt, os, dt, Bi;
|
|
124
124
|
class Jn {
|
|
125
125
|
constructor(t) {
|
|
126
126
|
/// The internal queue
|
|
127
|
-
o(this,
|
|
127
|
+
o(this, Rt);
|
|
128
128
|
/// Slows down push when the queue is full
|
|
129
|
-
o(this,
|
|
129
|
+
o(this, os, new V());
|
|
130
130
|
/// Slows down pop when the queue is empty
|
|
131
131
|
o(this, dt);
|
|
132
132
|
/// The channel is closed
|
|
133
|
-
o(this,
|
|
134
|
-
u(this,
|
|
133
|
+
o(this, Bi, !1);
|
|
134
|
+
u(this, Rt, new Ba(t));
|
|
135
135
|
}
|
|
136
136
|
isFull() {
|
|
137
|
-
return s(this,
|
|
137
|
+
return s(this, Rt).isFull();
|
|
138
138
|
}
|
|
139
139
|
close() {
|
|
140
140
|
var t;
|
|
141
|
-
(t = s(this, dt)) == null || t.resolve(), u(this,
|
|
141
|
+
(t = s(this, dt)) == null || t.resolve(), u(this, Bi, !0);
|
|
142
142
|
}
|
|
143
143
|
abort(t) {
|
|
144
144
|
var e, i;
|
|
@@ -147,16 +147,16 @@ class Jn {
|
|
|
147
147
|
push(t) {
|
|
148
148
|
return h(this, null, function* () {
|
|
149
149
|
var e;
|
|
150
|
-
s(this,
|
|
150
|
+
s(this, Rt).isFull() && (yield s(this, os).promise), s(this, Rt).push(t), (e = s(this, dt)) == null || e.resolve(), u(this, dt, new V());
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
pop() {
|
|
154
154
|
return h(this, null, function* () {
|
|
155
155
|
var t;
|
|
156
|
-
for (; !(s(this,
|
|
157
|
-
const e = s(this,
|
|
156
|
+
for (; !(s(this, Bi) && s(this, Rt).isEmpty()); ) {
|
|
157
|
+
const e = s(this, Rt).pop();
|
|
158
158
|
if (e)
|
|
159
|
-
return s(this,
|
|
159
|
+
return s(this, os).resolve(), u(this, os, new V()), e;
|
|
160
160
|
s(this, dt) || u(this, dt, new V()), yield (t = s(this, dt)) == null ? void 0 : t.promise;
|
|
161
161
|
}
|
|
162
162
|
});
|
|
@@ -186,7 +186,7 @@ class Jn {
|
|
|
186
186
|
return this;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
Rt = new WeakMap(), os = new WeakMap(), dt = new WeakMap(), Bi = new WeakMap();
|
|
190
190
|
function vo(r) {
|
|
191
191
|
const t = atob(r), e = new Uint8Array(t.length);
|
|
192
192
|
for (let i = 0; i < t.length; i++)
|
|
@@ -196,18 +196,18 @@ function vo(r) {
|
|
|
196
196
|
function k(r) {
|
|
197
197
|
return typeof BigInt == "function" ? BigInt(r) : r;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Bt() {
|
|
200
200
|
return typeof Symbol.asyncDispose != "symbol" && Object.defineProperty(Symbol, "asyncDispose", { value: Symbol.for("asyncDispose") }), Symbol.asyncDispose;
|
|
201
201
|
}
|
|
202
202
|
function So() {
|
|
203
203
|
return typeof Symbol.dispose != "symbol" && Object.defineProperty(Symbol, "dispose", { value: Symbol.for("dispose") }), Symbol.dispose;
|
|
204
204
|
}
|
|
205
|
-
var
|
|
206
|
-
class
|
|
205
|
+
var xi, ha;
|
|
206
|
+
class Nc {
|
|
207
207
|
constructor(t, e) {
|
|
208
|
-
o(this,
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
o(this, xi);
|
|
209
|
+
d(this, "value");
|
|
210
|
+
d(this, "unlocker");
|
|
211
211
|
this.value = t, this.unlocker = e;
|
|
212
212
|
}
|
|
213
213
|
unlocked() {
|
|
@@ -215,13 +215,13 @@ class Gc {
|
|
|
215
215
|
return (t = this.unlocker) == null ? void 0 : t.promise;
|
|
216
216
|
}
|
|
217
217
|
[So()]() {
|
|
218
|
-
f(this,
|
|
218
|
+
f(this, xi, ha).call(this);
|
|
219
219
|
}
|
|
220
220
|
[Symbol.dispose]() {
|
|
221
|
-
f(this,
|
|
221
|
+
f(this, xi, ha).call(this);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
|
|
224
|
+
xi = new WeakSet(), ha = function() {
|
|
225
225
|
this.unlocker.resolve(this.value);
|
|
226
226
|
};
|
|
227
227
|
var pe, be;
|
|
@@ -244,7 +244,7 @@ class Lc {
|
|
|
244
244
|
u(this, pe, i);
|
|
245
245
|
}).catch(A);
|
|
246
246
|
const e = s(this, be).promise.then(() => t);
|
|
247
|
-
return u(this, be, t), yield e, new
|
|
247
|
+
return u(this, be, t), yield e, new Nc(s(this, pe), t);
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
}
|
|
@@ -298,7 +298,7 @@ class Y {
|
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
300
|
[Symbol.asyncIterator]() {
|
|
301
|
-
return
|
|
301
|
+
return Pt(this, null, function* () {
|
|
302
302
|
for (; ; ) {
|
|
303
303
|
const [t, e] = this.value();
|
|
304
304
|
if (yield t, !e)
|
|
@@ -347,88 +347,88 @@ const _e = class _e {
|
|
|
347
347
|
schemeIdUri: n,
|
|
348
348
|
value: a,
|
|
349
349
|
eventDuration: c,
|
|
350
|
-
id:
|
|
350
|
+
id: l,
|
|
351
351
|
data: w
|
|
352
352
|
}) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
this.timescale = t, this.presentationTime = e, this.presentationTimeDelta = i, this.schemeIdUri = n, this.value = a, this.eventDuration = c, this.id =
|
|
353
|
+
d(this, "type", _e.type);
|
|
354
|
+
d(this, "timescale");
|
|
355
|
+
d(this, "presentationTime");
|
|
356
|
+
d(this, "presentationTimeDelta");
|
|
357
|
+
d(this, "schemeIdUri");
|
|
358
|
+
d(this, "value");
|
|
359
|
+
d(this, "eventDuration");
|
|
360
|
+
d(this, "id");
|
|
361
|
+
d(this, "data");
|
|
362
|
+
this.timescale = t, this.presentationTime = e, this.presentationTimeDelta = i, this.schemeIdUri = n, this.value = a, this.eventDuration = c, this.id = l, this.data = w;
|
|
363
363
|
}
|
|
364
364
|
static decodeData(t) {
|
|
365
365
|
const { version: e } = ce(t);
|
|
366
366
|
switch (e) {
|
|
367
367
|
case 1: {
|
|
368
|
-
const i = t.readUint32(), n = t.readUint64(), a = t.readUint32(), c = t.readUint32(),
|
|
368
|
+
const i = t.readUint32(), n = t.readUint64(), a = t.readUint32(), c = t.readUint32(), l = t.readUtf8String(), w = t.readUtf8String(), p = t.remaining(), m = t.readBytes(p);
|
|
369
369
|
return new _e({
|
|
370
370
|
timescale: i,
|
|
371
371
|
presentationTime: n,
|
|
372
372
|
eventDuration: a,
|
|
373
373
|
id: c,
|
|
374
|
-
schemeIdUri:
|
|
374
|
+
schemeIdUri: l,
|
|
375
375
|
value: w,
|
|
376
376
|
data: m
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
case 0: {
|
|
380
|
-
const i = t.readUtf8String(), n = t.readUtf8String(), a = t.readUint32(), c = t.readUint32(),
|
|
381
|
-
return new _e({ timescale: a, presentationTimeDelta: c, schemeIdUri: i, value: n, eventDuration:
|
|
380
|
+
const i = t.readUtf8String(), n = t.readUtf8String(), a = t.readUint32(), c = t.readUint32(), l = t.readUint32(), w = t.readUint32(), p = t.remaining(), m = t.readBytes(p);
|
|
381
|
+
return new _e({ timescale: a, presentationTimeDelta: c, schemeIdUri: i, value: n, eventDuration: l, id: w, data: m });
|
|
382
382
|
}
|
|
383
383
|
default:
|
|
384
384
|
throw new Error(`unsupported version ${e}`);
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
|
-
|
|
389
|
-
let
|
|
390
|
-
const
|
|
388
|
+
d(_e, "type", "emsg");
|
|
389
|
+
let en = _e;
|
|
390
|
+
const li = class li {
|
|
391
391
|
constructor(t) {
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
d(this, "type", li.type);
|
|
393
|
+
d(this, "data");
|
|
394
394
|
this.data = t;
|
|
395
395
|
}
|
|
396
396
|
static decodeData(t) {
|
|
397
397
|
const e = t.readRemaining();
|
|
398
|
-
return new
|
|
398
|
+
return new li(e);
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
|
|
402
|
-
let
|
|
403
|
-
const
|
|
401
|
+
d(li, "type", "mdat");
|
|
402
|
+
let sn = li;
|
|
403
|
+
const wi = class wi {
|
|
404
404
|
constructor(t, e, i) {
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
d(this, "type", wi.type);
|
|
406
|
+
d(this, "extra");
|
|
407
407
|
/**
|
|
408
408
|
* The byte offset of the baseMediaDecodeTime field
|
|
409
409
|
*/
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
d(this, "byteOffset");
|
|
411
|
+
d(this, "baseMediaDecodeTime");
|
|
412
412
|
this.extra = t, this.byteOffset = e, this.baseMediaDecodeTime = i;
|
|
413
413
|
}
|
|
414
414
|
static decodeData(t) {
|
|
415
415
|
const e = ce(t), i = t.byteOffset();
|
|
416
416
|
let n = 0;
|
|
417
|
-
return e.version === 1 ? n = t.readUint64() : n = t.readUint32(), new
|
|
417
|
+
return e.version === 1 ? n = t.readUint64() : n = t.readUint32(), new wi(e, i, n);
|
|
418
418
|
}
|
|
419
419
|
};
|
|
420
|
-
|
|
421
|
-
let
|
|
420
|
+
d(wi, "type", "tfdt");
|
|
421
|
+
let rn = wi;
|
|
422
422
|
const x = class x {
|
|
423
423
|
constructor(t, e, i) {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
424
|
+
d(this, "type", x.type);
|
|
425
|
+
d(this, "dataOffset");
|
|
426
|
+
d(this, "firstSampleFlags");
|
|
427
|
+
d(this, "samplesCount");
|
|
428
|
+
d(this, "sampleDurations", []);
|
|
429
|
+
d(this, "sampleSizes", []);
|
|
430
|
+
d(this, "sampleFlags", []);
|
|
431
|
+
d(this, "sampleCts", []);
|
|
432
432
|
this.dataOffset = e, this.firstSampleFlags = i, this.samplesCount = t;
|
|
433
433
|
}
|
|
434
434
|
is_sync_sample(t) {
|
|
@@ -443,64 +443,64 @@ const x = class x {
|
|
|
443
443
|
let n, a;
|
|
444
444
|
e & x.TRUN_DATA_OFFSET && (n = t.readUint32()), e & x.TRUN_FIRST_SAMPLE_FLAGS && (a = t.readUint32());
|
|
445
445
|
const c = new x(i, n, a);
|
|
446
|
-
for (let
|
|
446
|
+
for (let l = 0; l < i; l++)
|
|
447
447
|
e & x.SAMPLE_DURATION && c.sampleDurations.push(t.readUint32()), e & x.SAMPLE_SIZE && c.sampleSizes.push(t.readUint32()), e & x.SAMPLE_FLAGS && c.sampleFlags.push(t.readUint32()), e & x.SAMPLE_CTS && c.sampleCts.push(t.readUint32());
|
|
448
448
|
return c;
|
|
449
449
|
}
|
|
450
450
|
};
|
|
451
|
-
|
|
452
|
-
let
|
|
453
|
-
const
|
|
451
|
+
d(x, "TRUN_DATA_OFFSET", 1), d(x, "TRUN_FIRST_SAMPLE_FLAGS", 4), d(x, "SAMPLE_DURATION", 256), d(x, "SAMPLE_SIZE", 512), d(x, "SAMPLE_FLAGS", 1024), d(x, "SAMPLE_CTS", 2048), d(x, "FLAG_SAMPLE_FLAG_IS_NON_SYNC", 65536), d(x, "FLAG_SAMPLE_DEPENDS_NO", 33554432), d(x, "FLAG_SAMPLE_DEPENDS_YES", 16777216), d(x, "type", "trun");
|
|
452
|
+
let Vi = x;
|
|
453
|
+
const fi = class fi {
|
|
454
454
|
constructor(t, e) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
455
|
+
d(this, "type", fi.type);
|
|
456
|
+
d(this, "tfdt");
|
|
457
|
+
d(this, "trun");
|
|
458
458
|
this.tfdt = t, this.trun = e;
|
|
459
459
|
}
|
|
460
460
|
static decodeData(t) {
|
|
461
461
|
let e, i;
|
|
462
462
|
for (; t.remaining() > 0; ) {
|
|
463
|
-
const n =
|
|
464
|
-
n instanceof
|
|
463
|
+
const n = It(t);
|
|
464
|
+
n instanceof rn && (e = n), n instanceof Vi && (i = n);
|
|
465
465
|
}
|
|
466
|
-
return new
|
|
466
|
+
return new fi(e, i);
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
|
-
|
|
470
|
-
let
|
|
471
|
-
const
|
|
469
|
+
d(fi, "type", "traf");
|
|
470
|
+
let nn = fi;
|
|
471
|
+
const pi = class pi {
|
|
472
472
|
constructor(t) {
|
|
473
|
-
|
|
474
|
-
|
|
473
|
+
d(this, "type", pi.type);
|
|
474
|
+
d(this, "traf");
|
|
475
475
|
this.traf = t;
|
|
476
476
|
}
|
|
477
477
|
static decodeData(t) {
|
|
478
478
|
let e;
|
|
479
479
|
for (; t.remaining() > 0; ) {
|
|
480
|
-
const i =
|
|
481
|
-
i instanceof
|
|
480
|
+
const i = It(t);
|
|
481
|
+
i instanceof nn && (e = i);
|
|
482
482
|
}
|
|
483
483
|
if (!e)
|
|
484
484
|
throw new Error("No traf found");
|
|
485
|
-
return new
|
|
485
|
+
return new pi(e);
|
|
486
486
|
}
|
|
487
487
|
};
|
|
488
|
-
|
|
489
|
-
let
|
|
490
|
-
const
|
|
488
|
+
d(pi, "type", "moof");
|
|
489
|
+
let an = pi;
|
|
490
|
+
const bi = class bi {
|
|
491
491
|
constructor() {
|
|
492
|
-
|
|
492
|
+
d(this, "type", bi.type);
|
|
493
493
|
}
|
|
494
494
|
static decodeData(t) {
|
|
495
|
-
return new
|
|
495
|
+
return new bi();
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
|
-
|
|
499
|
-
let
|
|
500
|
-
const
|
|
498
|
+
d(bi, "type", "mvhd");
|
|
499
|
+
let on = bi;
|
|
500
|
+
const mi = class mi {
|
|
501
501
|
constructor(t) {
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
d(this, "type", mi.type);
|
|
503
|
+
d(this, "fourCC");
|
|
504
504
|
this.fourCC = t;
|
|
505
505
|
}
|
|
506
506
|
mediaType() {
|
|
@@ -518,39 +518,39 @@ const bi = class bi {
|
|
|
518
518
|
static decodeData(t) {
|
|
519
519
|
ce(t), t.readUint32();
|
|
520
520
|
const e = String.fromCharCode(...t.readBytes(4));
|
|
521
|
-
return new
|
|
521
|
+
return new mi(e);
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
|
-
|
|
525
|
-
let
|
|
524
|
+
d(mi, "type", "hdlr");
|
|
525
|
+
let cn = mi;
|
|
526
526
|
const ts = class ts {
|
|
527
527
|
constructor(t, e, i, n) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
528
|
+
d(this, "type", ts.type);
|
|
529
|
+
d(this, "creationTime");
|
|
530
|
+
d(this, "modificationTime");
|
|
531
|
+
d(this, "timescale");
|
|
532
|
+
d(this, "duration");
|
|
533
533
|
this.creationTime = t, this.modificationTime = e, this.timescale = i, this.duration = n;
|
|
534
534
|
}
|
|
535
535
|
static decodeData(t) {
|
|
536
536
|
const { version: e } = ce(t);
|
|
537
537
|
if (e === 1) {
|
|
538
|
-
const
|
|
539
|
-
return new ts(
|
|
538
|
+
const l = t.readUint64(), w = t.readUint64(), p = t.readUint32(), m = t.readUint64();
|
|
539
|
+
return new ts(l, w, p, m);
|
|
540
540
|
}
|
|
541
541
|
const i = t.readUint32(), n = t.readUint32(), a = t.readUint32(), c = t.readUint32();
|
|
542
542
|
return new ts(i, n, a, c);
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
|
-
|
|
546
|
-
let
|
|
547
|
-
const
|
|
545
|
+
d(ts, "type", "mdhd");
|
|
546
|
+
let un = ts;
|
|
547
|
+
const yi = class yi {
|
|
548
548
|
constructor(t, e, i, n) {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
549
|
+
d(this, "type", yi.type);
|
|
550
|
+
d(this, "av01");
|
|
551
|
+
d(this, "avc1");
|
|
552
|
+
d(this, "opus");
|
|
553
|
+
d(this, "codec");
|
|
554
554
|
this.avc1 = t, this.av01 = e, this.opus = i, this.codec = n;
|
|
555
555
|
}
|
|
556
556
|
mediaType() {
|
|
@@ -568,9 +568,9 @@ const mi = class mi {
|
|
|
568
568
|
ce(t);
|
|
569
569
|
const e = t.readUint32();
|
|
570
570
|
let i, n, a, c;
|
|
571
|
-
for (let
|
|
571
|
+
for (let l = 0; l < e; l++)
|
|
572
572
|
for (; t.remaining() > 0; ) {
|
|
573
|
-
const w =
|
|
573
|
+
const w = It(t);
|
|
574
574
|
switch (w.type) {
|
|
575
575
|
case "avc1":
|
|
576
576
|
i = "h264", n = w;
|
|
@@ -586,62 +586,62 @@ const mi = class mi {
|
|
|
586
586
|
break;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
return new
|
|
589
|
+
return new yi(n, c, a, i);
|
|
590
590
|
}
|
|
591
591
|
};
|
|
592
|
-
|
|
593
|
-
let
|
|
594
|
-
const
|
|
592
|
+
d(yi, "type", "stsd");
|
|
593
|
+
let hn = yi;
|
|
594
|
+
const gi = class gi {
|
|
595
595
|
constructor(t) {
|
|
596
|
-
|
|
597
|
-
|
|
596
|
+
d(this, "type", gi.type);
|
|
597
|
+
d(this, "stsd");
|
|
598
598
|
this.stsd = t;
|
|
599
599
|
}
|
|
600
600
|
static decodeData(t) {
|
|
601
601
|
let e;
|
|
602
602
|
for (; t.remaining() > 0; ) {
|
|
603
|
-
const i =
|
|
604
|
-
i instanceof
|
|
603
|
+
const i = It(t);
|
|
604
|
+
i instanceof hn && (e = i);
|
|
605
605
|
}
|
|
606
606
|
if (!e)
|
|
607
607
|
throw new Error("No stsd found");
|
|
608
|
-
return new
|
|
608
|
+
return new gi(e);
|
|
609
609
|
}
|
|
610
610
|
};
|
|
611
|
-
|
|
612
|
-
let
|
|
613
|
-
const
|
|
611
|
+
d(gi, "type", "stbl");
|
|
612
|
+
let dn = gi;
|
|
613
|
+
const ki = class ki {
|
|
614
614
|
constructor(t) {
|
|
615
|
-
|
|
616
|
-
|
|
615
|
+
d(this, "type", ki.type);
|
|
616
|
+
d(this, "stbl");
|
|
617
617
|
this.stbl = t;
|
|
618
618
|
}
|
|
619
619
|
static decodeData(t) {
|
|
620
620
|
let e;
|
|
621
621
|
for (; t.remaining() > 0; ) {
|
|
622
|
-
const i =
|
|
623
|
-
i instanceof
|
|
622
|
+
const i = It(t);
|
|
623
|
+
i instanceof dn && (e = i);
|
|
624
624
|
}
|
|
625
625
|
if (!e)
|
|
626
626
|
throw new Error("No stbl found");
|
|
627
|
-
return new
|
|
627
|
+
return new ki(e);
|
|
628
628
|
}
|
|
629
629
|
};
|
|
630
|
-
|
|
631
|
-
let
|
|
632
|
-
const
|
|
630
|
+
d(ki, "type", "minf");
|
|
631
|
+
let ln = ki;
|
|
632
|
+
const Ii = class Ii {
|
|
633
633
|
constructor(t, e, i) {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
634
|
+
d(this, "type", Ii.type);
|
|
635
|
+
d(this, "hdlr");
|
|
636
|
+
d(this, "minf");
|
|
637
|
+
d(this, "mdhd");
|
|
638
638
|
this.hdlr = t, this.minf = e, this.mdhd = i;
|
|
639
639
|
}
|
|
640
640
|
static decodeData(t) {
|
|
641
641
|
let e, i, n;
|
|
642
642
|
for (; t.remaining() > 0; ) {
|
|
643
|
-
const a =
|
|
644
|
-
a instanceof
|
|
643
|
+
const a = It(t);
|
|
644
|
+
a instanceof cn && (e = a), a instanceof ln && (i = a), a instanceof un && (n = a);
|
|
645
645
|
}
|
|
646
646
|
if (!e)
|
|
647
647
|
throw new Error("No hdlr found");
|
|
@@ -649,23 +649,23 @@ const ki = class ki {
|
|
|
649
649
|
throw new Error("No minf found");
|
|
650
650
|
if (!n)
|
|
651
651
|
throw new Error("No mdhd found");
|
|
652
|
-
return new
|
|
652
|
+
return new Ii(e, i, n);
|
|
653
653
|
}
|
|
654
654
|
};
|
|
655
|
-
|
|
656
|
-
let
|
|
657
|
-
const
|
|
658
|
-
constructor(t, e, i, n, a, c,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
this.modificationTime = t, this.creationTime = e, this.trackId = i, this.duration = n, this.alternateGroup = a, this.volume = c, this.width =
|
|
655
|
+
d(Ii, "type", "mdia");
|
|
656
|
+
let wn = Ii;
|
|
657
|
+
const vi = class vi {
|
|
658
|
+
constructor(t, e, i, n, a, c, l, w) {
|
|
659
|
+
d(this, "type", vi.type);
|
|
660
|
+
d(this, "modificationTime");
|
|
661
|
+
d(this, "creationTime");
|
|
662
|
+
d(this, "trackId");
|
|
663
|
+
d(this, "duration");
|
|
664
|
+
d(this, "alternateGroup");
|
|
665
|
+
d(this, "volume");
|
|
666
|
+
d(this, "width");
|
|
667
|
+
d(this, "height");
|
|
668
|
+
this.modificationTime = t, this.creationTime = e, this.trackId = i, this.duration = n, this.alternateGroup = a, this.volume = c, this.width = l, this.height = w;
|
|
669
669
|
}
|
|
670
670
|
static decodeData(t) {
|
|
671
671
|
const e = ce(t);
|
|
@@ -675,74 +675,74 @@ const Ii = class Ii {
|
|
|
675
675
|
t.readUint32();
|
|
676
676
|
const c = t.readUint32();
|
|
677
677
|
t.readUint32(), t.readUint32(), t.readUint16();
|
|
678
|
-
const
|
|
678
|
+
const l = t.readUint16(), w = t.readUint16();
|
|
679
679
|
t.readUint16(), new Array(9).fill(0).map(() => t.readUint32());
|
|
680
680
|
const p = t.readUint16();
|
|
681
681
|
t.readUint16();
|
|
682
682
|
const m = t.readUint16();
|
|
683
|
-
return t.readUint16(), new
|
|
683
|
+
return t.readUint16(), new vi(i, n, a, c, l, w, p, m);
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
|
-
|
|
687
|
-
let
|
|
688
|
-
const
|
|
686
|
+
d(vi, "type", "tkhd");
|
|
687
|
+
let fn = vi;
|
|
688
|
+
const Si = class Si {
|
|
689
689
|
constructor(t, e) {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
690
|
+
d(this, "type", Si.type);
|
|
691
|
+
d(this, "tkhd");
|
|
692
|
+
d(this, "mdia");
|
|
693
693
|
this.tkhd = t, this.mdia = e;
|
|
694
694
|
}
|
|
695
695
|
static decodeData(t) {
|
|
696
696
|
let e, i;
|
|
697
697
|
for (; t.remaining() > 0; ) {
|
|
698
|
-
const n =
|
|
699
|
-
n instanceof
|
|
698
|
+
const n = It(t);
|
|
699
|
+
n instanceof fn && (e = n), n instanceof wn && (i = n);
|
|
700
700
|
}
|
|
701
701
|
if (!e)
|
|
702
702
|
throw new Error("No tkhd found");
|
|
703
703
|
if (!i)
|
|
704
704
|
throw new Error("No mdia found");
|
|
705
|
-
return new
|
|
705
|
+
return new Si(e, i);
|
|
706
706
|
}
|
|
707
707
|
};
|
|
708
|
-
|
|
709
|
-
let
|
|
710
|
-
const
|
|
708
|
+
d(Si, "type", "trak");
|
|
709
|
+
let pn = Si;
|
|
710
|
+
const Ui = class Ui {
|
|
711
711
|
constructor(t, e) {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
712
|
+
d(this, "type", Ui.type);
|
|
713
|
+
d(this, "mvhd");
|
|
714
|
+
d(this, "traks");
|
|
715
715
|
this.mvhd = t, this.traks = e;
|
|
716
716
|
}
|
|
717
717
|
static decodeData(t) {
|
|
718
718
|
let e;
|
|
719
719
|
const i = [];
|
|
720
720
|
for (; t.remaining() > 0; ) {
|
|
721
|
-
const n =
|
|
722
|
-
n instanceof
|
|
721
|
+
const n = It(t);
|
|
722
|
+
n instanceof pn && i.push(n), n instanceof on && (e = n);
|
|
723
723
|
}
|
|
724
724
|
if (!e)
|
|
725
725
|
throw new Error("No mvhd found");
|
|
726
|
-
return new
|
|
726
|
+
return new Ui(e, i);
|
|
727
727
|
}
|
|
728
728
|
};
|
|
729
|
-
|
|
730
|
-
let
|
|
731
|
-
const
|
|
732
|
-
constructor(t, e, i, n, a, c,
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
this.configurationVersion = t, this.avcProfileIndication = e, this.profileCompatibility = i, this.avcLevelIndication = n, this.lengthSizeMinusOne = a, this.sequenceParameterSets = c, this.pictureParameterSets =
|
|
729
|
+
d(Ui, "type", "moov");
|
|
730
|
+
let bn = Ui;
|
|
731
|
+
const Ei = class Ei {
|
|
732
|
+
constructor(t, e, i, n, a, c, l, w) {
|
|
733
|
+
d(this, "type", Ei.type);
|
|
734
|
+
d(this, "configurationVersion");
|
|
735
|
+
d(this, "avcProfileIndication");
|
|
736
|
+
d(this, "profileCompatibility");
|
|
737
|
+
d(this, "avcLevelIndication");
|
|
738
|
+
d(this, "lengthSizeMinusOne");
|
|
739
|
+
d(this, "sequenceParameterSets");
|
|
740
|
+
d(this, "pictureParameterSets");
|
|
741
|
+
d(this, "bytes");
|
|
742
|
+
this.configurationVersion = t, this.avcProfileIndication = e, this.profileCompatibility = i, this.avcLevelIndication = n, this.lengthSizeMinusOne = a, this.sequenceParameterSets = c, this.pictureParameterSets = l, this.bytes = w;
|
|
743
743
|
}
|
|
744
744
|
static decodeData(t) {
|
|
745
|
-
const e = t.buffer(), i = t.readUint8(), n = t.readUint8(), a = t.readUint8(), c = t.readUint8(),
|
|
745
|
+
const e = t.buffer(), i = t.readUint8(), n = t.readUint8(), a = t.readUint8(), c = t.readUint8(), l = t.readUint8() & 3, w = t.readUint8() & 31, p = [];
|
|
746
746
|
for (let I = 0; I < w; I++) {
|
|
747
747
|
const g = t.readBytes(t.readUint16());
|
|
748
748
|
p.push(g);
|
|
@@ -752,28 +752,28 @@ const Ui = class Ui {
|
|
|
752
752
|
const g = t.readBytes(t.readUint16());
|
|
753
753
|
b.push(g);
|
|
754
754
|
}
|
|
755
|
-
return new
|
|
755
|
+
return new Ei(
|
|
756
756
|
i,
|
|
757
757
|
n,
|
|
758
758
|
a,
|
|
759
759
|
c,
|
|
760
|
-
|
|
760
|
+
l,
|
|
761
761
|
p,
|
|
762
762
|
b,
|
|
763
763
|
e
|
|
764
764
|
);
|
|
765
765
|
}
|
|
766
766
|
};
|
|
767
|
-
|
|
768
|
-
let da =
|
|
769
|
-
const
|
|
767
|
+
d(Ei, "type", "avcC");
|
|
768
|
+
let da = Ei;
|
|
769
|
+
const Ti = class Ti {
|
|
770
770
|
constructor(t, e, i, n, a) {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
771
|
+
d(this, "type", Ti.type);
|
|
772
|
+
d(this, "avcC");
|
|
773
|
+
d(this, "width");
|
|
774
|
+
d(this, "height");
|
|
775
|
+
d(this, "horizontalResolution");
|
|
776
|
+
d(this, "verticalResolution");
|
|
777
777
|
this.avcC = t, this.width = e, this.height = i, this.horizontalResolution = n, this.verticalResolution = a;
|
|
778
778
|
}
|
|
779
779
|
static decodeData(t) {
|
|
@@ -782,36 +782,36 @@ const Ei = class Ei {
|
|
|
782
782
|
t.readUint32(), t.readUint16(), t.readBytes(32), t.readUint16(), t.readUint16();
|
|
783
783
|
let c;
|
|
784
784
|
for (; t.remaining() > 0; ) {
|
|
785
|
-
const
|
|
786
|
-
switch (
|
|
785
|
+
const l = It(t);
|
|
786
|
+
switch (l.type) {
|
|
787
787
|
case "avcC":
|
|
788
|
-
c =
|
|
788
|
+
c = l;
|
|
789
789
|
break;
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
792
|
if (!c)
|
|
793
793
|
throw new Error("no avcC");
|
|
794
|
-
return new
|
|
794
|
+
return new Ti(c, e, i, n, a);
|
|
795
795
|
}
|
|
796
796
|
};
|
|
797
|
-
|
|
798
|
-
let la =
|
|
799
|
-
const
|
|
797
|
+
d(Ti, "type", "avc1");
|
|
798
|
+
let la = Ti;
|
|
799
|
+
const Ai = class Ai {
|
|
800
800
|
constructor() {
|
|
801
|
-
|
|
801
|
+
d(this, "type", Ai.type);
|
|
802
802
|
}
|
|
803
803
|
static decodeData(t) {
|
|
804
|
-
return new
|
|
804
|
+
return new Ai();
|
|
805
805
|
}
|
|
806
806
|
};
|
|
807
|
-
|
|
808
|
-
let wa =
|
|
809
|
-
const
|
|
807
|
+
d(Ai, "type", "dOps");
|
|
808
|
+
let wa = Ai;
|
|
809
|
+
const Di = class Di {
|
|
810
810
|
constructor(t, e, i) {
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
811
|
+
d(this, "type", Di.type);
|
|
812
|
+
d(this, "dops");
|
|
813
|
+
d(this, "channelCount");
|
|
814
|
+
d(this, "sampleRate");
|
|
815
815
|
this.dops = t, this.channelCount = e, this.sampleRate = i;
|
|
816
816
|
}
|
|
817
817
|
static decodeData(t) {
|
|
@@ -823,16 +823,16 @@ const Ai = class Ai {
|
|
|
823
823
|
const n = t.readUint16();
|
|
824
824
|
t.readUint16(), e === 1 && (t.readUint64(), t.readUint64());
|
|
825
825
|
const a = Fc(wa, t);
|
|
826
|
-
return new
|
|
826
|
+
return new Di(a, i, n);
|
|
827
827
|
}
|
|
828
828
|
};
|
|
829
|
-
|
|
830
|
-
let fa =
|
|
829
|
+
d(Di, "type", "Opus");
|
|
830
|
+
let fa = Di;
|
|
831
831
|
const es = class es {
|
|
832
832
|
constructor(t, e) {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
833
|
+
d(this, "type", es.type);
|
|
834
|
+
d(this, "ntpTimestamp");
|
|
835
|
+
d(this, "mediaTime");
|
|
836
836
|
this.ntpTimestamp = t, this.mediaTime = e;
|
|
837
837
|
}
|
|
838
838
|
static decodeData(t) {
|
|
@@ -847,46 +847,46 @@ const es = class es {
|
|
|
847
847
|
return new es([i, n], a);
|
|
848
848
|
}
|
|
849
849
|
};
|
|
850
|
-
|
|
851
|
-
let
|
|
852
|
-
var
|
|
850
|
+
d(es, "type", "prft");
|
|
851
|
+
let mn = es;
|
|
852
|
+
var Pi, Ri;
|
|
853
853
|
class Wc {
|
|
854
854
|
constructor(t, e) {
|
|
855
|
-
o(this, xi);
|
|
856
855
|
o(this, Pi);
|
|
857
|
-
|
|
856
|
+
o(this, Ri);
|
|
857
|
+
u(this, Pi, t), u(this, Ri, e.readBytes(t.size));
|
|
858
858
|
}
|
|
859
859
|
data() {
|
|
860
|
-
return s(this,
|
|
860
|
+
return s(this, Ri);
|
|
861
861
|
}
|
|
862
862
|
get type() {
|
|
863
|
-
return s(this,
|
|
863
|
+
return s(this, Pi).type;
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
|
-
|
|
866
|
+
Pi = new WeakMap(), Ri = new WeakMap();
|
|
867
867
|
const $c = {
|
|
868
|
-
moov:
|
|
869
|
-
trak:
|
|
870
|
-
tkhd:
|
|
871
|
-
mvhd:
|
|
872
|
-
moof:
|
|
873
|
-
traf:
|
|
874
|
-
tfdt:
|
|
875
|
-
trun:
|
|
876
|
-
mdat:
|
|
877
|
-
mdia:
|
|
878
|
-
hdlr:
|
|
879
|
-
minf:
|
|
880
|
-
stbl:
|
|
881
|
-
mdhd:
|
|
882
|
-
stsd:
|
|
883
|
-
prft:
|
|
868
|
+
moov: bn,
|
|
869
|
+
trak: pn,
|
|
870
|
+
tkhd: fn,
|
|
871
|
+
mvhd: on,
|
|
872
|
+
moof: an,
|
|
873
|
+
traf: nn,
|
|
874
|
+
tfdt: rn,
|
|
875
|
+
trun: Vi,
|
|
876
|
+
mdat: sn,
|
|
877
|
+
mdia: wn,
|
|
878
|
+
hdlr: cn,
|
|
879
|
+
minf: ln,
|
|
880
|
+
stbl: dn,
|
|
881
|
+
mdhd: un,
|
|
882
|
+
stsd: hn,
|
|
883
|
+
prft: mn,
|
|
884
884
|
avc1: la,
|
|
885
885
|
avcC: da,
|
|
886
886
|
Opus: fa,
|
|
887
|
-
emsg:
|
|
887
|
+
emsg: en
|
|
888
888
|
};
|
|
889
|
-
function
|
|
889
|
+
function It(r) {
|
|
890
890
|
const t = Eo(r), e = $c[t.type], i = new Zn(r.readBytes(t.size));
|
|
891
891
|
if (!e) {
|
|
892
892
|
const a = new Wc(t, i);
|
|
@@ -900,13 +900,13 @@ function Mc(r) {
|
|
|
900
900
|
throw new Error("Buffer too small");
|
|
901
901
|
const t = new Zn(r), e = /* @__PURE__ */ new Map();
|
|
902
902
|
for (; t.remaining() > 0; ) {
|
|
903
|
-
const a =
|
|
903
|
+
const a = It(t);
|
|
904
904
|
e.set(a.type, a);
|
|
905
905
|
}
|
|
906
906
|
const i = e.get("ftyp"), n = e.get("moov");
|
|
907
907
|
if (!i)
|
|
908
908
|
throw new Error("ftyp atom not found");
|
|
909
|
-
if (!n || !(n instanceof
|
|
909
|
+
if (!n || !(n instanceof bn))
|
|
910
910
|
throw new Error("moov atom not found");
|
|
911
911
|
return {
|
|
912
912
|
ftyp: i,
|
|
@@ -918,15 +918,15 @@ function zc(r) {
|
|
|
918
918
|
throw new Error("Buffer too small");
|
|
919
919
|
const t = new Zn(r), e = /* @__PURE__ */ new Map(), i = [];
|
|
920
920
|
for (; t.remaining() > 0; ) {
|
|
921
|
-
const
|
|
922
|
-
|
|
921
|
+
const l = It(t);
|
|
922
|
+
l instanceof en && i.push(l), e.set(l.type, l);
|
|
923
923
|
}
|
|
924
924
|
const n = e.get("moof"), a = e.get("mdat"), c = e.get("prft");
|
|
925
|
-
if (!n || !(n instanceof
|
|
925
|
+
if (!n || !(n instanceof an))
|
|
926
926
|
throw new Error("moof atom not found");
|
|
927
|
-
if (!a || !(a instanceof
|
|
927
|
+
if (!a || !(a instanceof sn))
|
|
928
928
|
throw new Error("mdat atom not found");
|
|
929
|
-
if (c && !(c instanceof
|
|
929
|
+
if (c && !(c instanceof mn))
|
|
930
930
|
throw new Error("invalid prft found");
|
|
931
931
|
return {
|
|
932
932
|
moof: n,
|
|
@@ -935,21 +935,21 @@ function zc(r) {
|
|
|
935
935
|
emsgs: i
|
|
936
936
|
};
|
|
937
937
|
}
|
|
938
|
-
var
|
|
938
|
+
var ji, Gi;
|
|
939
939
|
class Hc {
|
|
940
940
|
constructor(t) {
|
|
941
|
-
o(this, Ri);
|
|
942
941
|
o(this, ji);
|
|
943
|
-
|
|
942
|
+
o(this, Gi);
|
|
943
|
+
u(this, ji, t), u(this, Gi, Mc(t));
|
|
944
944
|
}
|
|
945
945
|
rawBytes() {
|
|
946
|
-
return s(this,
|
|
946
|
+
return s(this, ji);
|
|
947
947
|
}
|
|
948
948
|
init() {
|
|
949
|
-
return s(this,
|
|
949
|
+
return s(this, Gi);
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
|
-
|
|
952
|
+
ji = new WeakMap(), Gi = new WeakMap();
|
|
953
953
|
var wt, tt, T;
|
|
954
954
|
class Xc {
|
|
955
955
|
constructor(t, e) {
|
|
@@ -990,7 +990,7 @@ class Xc {
|
|
|
990
990
|
}
|
|
991
991
|
startsWithKeyframe() {
|
|
992
992
|
const t = s(this, T).moof.traf.trun, e = (t == null ? void 0 : t.firstSampleFlags) || (t == null ? void 0 : t.sampleFlags[0]);
|
|
993
|
-
return e ? (e &
|
|
993
|
+
return e ? (e & Vi.FLAG_SAMPLE_DEPENDS_NO) !== 0 : !1;
|
|
994
994
|
}
|
|
995
995
|
timescale() {
|
|
996
996
|
const t = s(this, tt).init().moov.traks[0];
|
|
@@ -1016,33 +1016,33 @@ class Xc {
|
|
|
1016
1016
|
return ((t = s(this, T).moof.traf.trun) == null ? void 0 : t.samplesCount) || 0;
|
|
1017
1017
|
}
|
|
1018
1018
|
sample(t) {
|
|
1019
|
-
var g, E, z, _, D, S, W, v, R,
|
|
1019
|
+
var g, E, z, _, D, S, W, v, R, ii, Fr, Wr, za, Ha, Xa;
|
|
1020
1020
|
const e = (g = s(this, tt).init().moov.traks[0]) == null ? void 0 : g.mdia.minf.stbl.stsd.codec, i = ((E = s(this, T).moof.traf.trun) == null ? void 0 : E.samplesCount) || 0, n = (z = s(this, T).moof.traf.tfdt) == null ? void 0 : z.baseMediaDecodeTime;
|
|
1021
1021
|
if (t >= i || typeof n == "undefined" || !e)
|
|
1022
1022
|
return;
|
|
1023
|
-
const a = ((_ = s(this, T).moof.traf.trun) == null ? void 0 : _.sampleDurations[t]) || 0, c = ((D = s(this, T).moof.traf.trun) == null ? void 0 : D.sampleDurations.slice(0, t).reduce((
|
|
1023
|
+
const a = ((_ = s(this, T).moof.traf.trun) == null ? void 0 : _.sampleDurations[t]) || 0, c = ((D = s(this, T).moof.traf.trun) == null ? void 0 : D.sampleDurations.slice(0, t).reduce((ri, ni) => ri + ni, 0)) || 0, l = n + c, w = ((S = s(this, tt).init().moov.traks[0]) == null ? void 0 : S.mdia.mdhd.timescale) || 1e3, p = ((W = s(this, T).moof.traf.trun) == null ? void 0 : W.sampleSizes[t]) || s(this, T).mdat.data.byteLength, m = ((v = s(this, T).moof.traf.trun) == null ? void 0 : v.sampleSizes.slice(0, t).reduce((ri, ni) => ri + ni, 0)) || 0, b = s(this, T).mdat.data.subarray(m, m + p), I = ((R = s(this, T).moof.traf.trun) == null ? void 0 : R.is_sync_sample(t)) || !1;
|
|
1024
1024
|
if (this.mediaType() === "video") {
|
|
1025
|
-
const
|
|
1025
|
+
const ri = ((ii = s(this, tt).init().moov.traks[0]) == null ? void 0 : ii.tkhd.width) || 0, ni = ((Fr = s(this, tt).init().moov.traks[0]) == null ? void 0 : Fr.tkhd.height) || 0;
|
|
1026
1026
|
return {
|
|
1027
1027
|
type: "video",
|
|
1028
1028
|
codec: e,
|
|
1029
|
-
width:
|
|
1030
|
-
height:
|
|
1029
|
+
width: ri,
|
|
1030
|
+
height: ni,
|
|
1031
1031
|
duration: a,
|
|
1032
1032
|
isSync: I,
|
|
1033
1033
|
timescale: w,
|
|
1034
|
-
timestamp:
|
|
1034
|
+
timestamp: l,
|
|
1035
1035
|
data: b
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
1038
|
return {
|
|
1039
1039
|
type: "audio",
|
|
1040
1040
|
codec: e,
|
|
1041
|
-
channels: ((za = (
|
|
1041
|
+
channels: ((za = (Wr = s(this, tt).init().moov.traks[0]) == null ? void 0 : Wr.mdia.minf.stbl.stsd.opus) == null ? void 0 : za.channelCount) || 0,
|
|
1042
1042
|
sampleRate: ((Xa = (Ha = s(this, tt).init().moov.traks[0]) == null ? void 0 : Ha.mdia.minf.stbl.stsd.opus) == null ? void 0 : Xa.sampleRate) || 0,
|
|
1043
1043
|
duration: a,
|
|
1044
1044
|
isSync: I,
|
|
1045
|
-
timestamp:
|
|
1045
|
+
timestamp: l,
|
|
1046
1046
|
data: b,
|
|
1047
1047
|
timescale: w
|
|
1048
1048
|
};
|
|
@@ -1055,21 +1055,21 @@ class Xc {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
1057
|
wt = new WeakMap(), tt = new WeakMap(), T = new WeakMap();
|
|
1058
|
-
var
|
|
1058
|
+
var cs;
|
|
1059
1059
|
class qa {
|
|
1060
1060
|
constructor(t) {
|
|
1061
|
-
o(this,
|
|
1062
|
-
u(this,
|
|
1061
|
+
o(this, cs);
|
|
1062
|
+
u(this, cs, new Hc(t));
|
|
1063
1063
|
}
|
|
1064
1064
|
header() {
|
|
1065
|
-
return s(this,
|
|
1065
|
+
return s(this, cs);
|
|
1066
1066
|
}
|
|
1067
1067
|
createFragment(t) {
|
|
1068
|
-
return new Xc(s(this,
|
|
1068
|
+
return new Xc(s(this, cs), t);
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
|
|
1072
|
-
var
|
|
1071
|
+
cs = new WeakMap();
|
|
1072
|
+
var yn = /* @__PURE__ */ ((r) => (r[r.StreamHeaderGroup = 4] = "StreamHeaderGroup", r[r.FetchHeader = 5] = "FetchHeader", r[r.StreamHeaderTrack = 60] = "StreamHeaderTrack", r))(yn || {});
|
|
1073
1073
|
const X = {
|
|
1074
1074
|
Normal: 0,
|
|
1075
1075
|
ObjectDoesNotExist: 1,
|
|
@@ -1088,46 +1088,46 @@ function To(r) {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
throw new Error("Unknown object status " + r);
|
|
1090
1090
|
}
|
|
1091
|
-
var
|
|
1091
|
+
var St, us, hs, Ni, Li, ds, Fi, Wi;
|
|
1092
1092
|
class Yc {
|
|
1093
1093
|
constructor(t, e, i, n, a, c) {
|
|
1094
|
-
o(this,
|
|
1095
|
-
o(this, cs);
|
|
1094
|
+
o(this, St);
|
|
1096
1095
|
o(this, us);
|
|
1096
|
+
o(this, hs);
|
|
1097
1097
|
o(this, Ni);
|
|
1098
|
-
o(this,
|
|
1099
|
-
o(this,
|
|
1100
|
-
o(this,
|
|
1101
|
-
o(this,
|
|
1102
|
-
u(this,
|
|
1098
|
+
o(this, Li);
|
|
1099
|
+
o(this, ds, new V());
|
|
1100
|
+
o(this, Fi, 0);
|
|
1101
|
+
o(this, Wi);
|
|
1102
|
+
u(this, St, t), u(this, us, e), u(this, hs, i), u(this, Ni, n), u(this, Li, a), u(this, Wi, c);
|
|
1103
1103
|
}
|
|
1104
1104
|
endStatus() {
|
|
1105
|
-
return s(this,
|
|
1105
|
+
return s(this, ds).promise;
|
|
1106
1106
|
}
|
|
1107
1107
|
groupId() {
|
|
1108
|
-
return s(this,
|
|
1108
|
+
return s(this, us);
|
|
1109
1109
|
}
|
|
1110
1110
|
subscribeId() {
|
|
1111
|
-
return s(this,
|
|
1111
|
+
return s(this, hs);
|
|
1112
1112
|
}
|
|
1113
1113
|
next() {
|
|
1114
1114
|
return h(this, null, function* () {
|
|
1115
|
-
if (!s(this,
|
|
1115
|
+
if (!s(this, ds).pending)
|
|
1116
1116
|
return { done: !0, value: void 0 };
|
|
1117
|
-
if (yield s(this,
|
|
1117
|
+
if (yield s(this, St).isDone())
|
|
1118
1118
|
return { done: !0, value: void 0 };
|
|
1119
|
-
const t = s(this,
|
|
1119
|
+
const t = s(this, Fi) === 0 ? s(this, us) : yield s(this, St).readBigVarInt(), e = yield s(this, St).readBigVarInt(), i = yield s(this, St).readVarInt();
|
|
1120
1120
|
let n = 0, a = new Uint8Array();
|
|
1121
|
-
return i > 0 ? a = yield s(this,
|
|
1121
|
+
return i > 0 ? a = yield s(this, St).read(i) : n = yield s(this, St).readVarInt(), To(n), (n === X.EndOfTrackAndGroup || n === X.EndOfGroup) && s(this, ds).resolve(n), ea(this, Fi)._++, {
|
|
1122
1122
|
done: !1,
|
|
1123
1123
|
value: {
|
|
1124
|
-
subscribeId: s(this,
|
|
1124
|
+
subscribeId: s(this, hs),
|
|
1125
1125
|
trackAlias: s(this, Ni),
|
|
1126
1126
|
groupId: t,
|
|
1127
1127
|
subGroupId: k(0),
|
|
1128
1128
|
objectId: e,
|
|
1129
|
-
subscriberPriority: s(this,
|
|
1130
|
-
streamId: s(this,
|
|
1129
|
+
subscriberPriority: s(this, Li),
|
|
1130
|
+
streamId: s(this, Wi),
|
|
1131
1131
|
objectStatus: n,
|
|
1132
1132
|
payload: a
|
|
1133
1133
|
}
|
|
@@ -1144,121 +1144,121 @@ class Yc {
|
|
|
1144
1144
|
[Symbol.asyncIterator]() {
|
|
1145
1145
|
return this;
|
|
1146
1146
|
}
|
|
1147
|
-
[
|
|
1147
|
+
[Bt()]() {
|
|
1148
1148
|
return Promise.resolve();
|
|
1149
1149
|
}
|
|
1150
1150
|
[Symbol.asyncDispose]() {
|
|
1151
1151
|
return Promise.resolve();
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
|
-
|
|
1155
|
-
var
|
|
1154
|
+
St = new WeakMap(), us = new WeakMap(), hs = new WeakMap(), Ni = new WeakMap(), Li = new WeakMap(), ds = new WeakMap(), Fi = new WeakMap(), Wi = new WeakMap();
|
|
1155
|
+
var Ut, ls, $i, Mi, ws, Xe, Ao, pa;
|
|
1156
1156
|
class Zc {
|
|
1157
1157
|
constructor(t, e, i, n, a) {
|
|
1158
1158
|
o(this, Xe);
|
|
1159
|
-
o(this,
|
|
1160
|
-
o(this, ds);
|
|
1161
|
-
o(this, Wi);
|
|
1162
|
-
o(this, $i);
|
|
1159
|
+
o(this, Ut);
|
|
1163
1160
|
o(this, ls);
|
|
1164
|
-
|
|
1161
|
+
o(this, $i);
|
|
1162
|
+
o(this, Mi);
|
|
1163
|
+
o(this, ws);
|
|
1164
|
+
u(this, Ut, t), u(this, ls, e), u(this, $i, i), u(this, Mi, n), u(this, ws, a);
|
|
1165
1165
|
}
|
|
1166
1166
|
/**
|
|
1167
1167
|
* @returns The underlying stream id that provided this object group
|
|
1168
1168
|
*/
|
|
1169
1169
|
streamId() {
|
|
1170
|
-
return s(this,
|
|
1170
|
+
return s(this, ws);
|
|
1171
1171
|
}
|
|
1172
1172
|
groups() {
|
|
1173
1173
|
return f(this, Xe, Ao).call(this);
|
|
1174
1174
|
}
|
|
1175
1175
|
subscribeId() {
|
|
1176
|
-
return s(this,
|
|
1176
|
+
return s(this, ls);
|
|
1177
1177
|
}
|
|
1178
1178
|
return() {
|
|
1179
1179
|
return h(this, null, function* () {
|
|
1180
|
-
return yield s(this,
|
|
1180
|
+
return yield s(this, Ut).close(), { done: !0, value: void 0 };
|
|
1181
1181
|
});
|
|
1182
1182
|
}
|
|
1183
1183
|
[Symbol.asyncIterator]() {
|
|
1184
1184
|
return this;
|
|
1185
1185
|
}
|
|
1186
|
-
[
|
|
1186
|
+
[Bt()]() {
|
|
1187
1187
|
return f(this, Xe, pa).call(this);
|
|
1188
1188
|
}
|
|
1189
1189
|
[Symbol.asyncDispose]() {
|
|
1190
1190
|
return f(this, Xe, pa).call(this);
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
|
-
|
|
1194
|
-
return
|
|
1195
|
-
for (; !(yield new O(s(this,
|
|
1196
|
-
const t = yield new O(s(this,
|
|
1197
|
-
s(this,
|
|
1193
|
+
Ut = new WeakMap(), ls = new WeakMap(), $i = new WeakMap(), Mi = new WeakMap(), ws = new WeakMap(), Xe = new WeakSet(), Ao = function() {
|
|
1194
|
+
return Pt(this, null, function* () {
|
|
1195
|
+
for (; !(yield new O(s(this, Ut).isDone())); ) {
|
|
1196
|
+
const t = yield new O(s(this, Ut).readBigVarInt()), e = new Yc(
|
|
1197
|
+
s(this, Ut),
|
|
1198
1198
|
t,
|
|
1199
|
-
s(this,
|
|
1200
|
-
s(this, Wi),
|
|
1199
|
+
s(this, ls),
|
|
1201
1200
|
s(this, $i),
|
|
1202
|
-
s(this,
|
|
1201
|
+
s(this, Mi),
|
|
1202
|
+
s(this, ws)
|
|
1203
1203
|
);
|
|
1204
|
-
if (yield e, (yield new O(Promise.race([e.endStatus(), s(this,
|
|
1204
|
+
if (yield e, (yield new O(Promise.race([e.endStatus(), s(this, Ut).closed()]))) === X.EndOfTrackAndGroup)
|
|
1205
1205
|
return;
|
|
1206
1206
|
}
|
|
1207
1207
|
});
|
|
1208
1208
|
}, pa = function() {
|
|
1209
|
-
return s(this,
|
|
1209
|
+
return s(this, Ut).close().catch(() => {
|
|
1210
1210
|
});
|
|
1211
1211
|
};
|
|
1212
|
-
var ft,
|
|
1212
|
+
var ft, fs, zi, ps, Hi, Xi, Yi, bs, Tn, Ye, Do, ba;
|
|
1213
1213
|
class Kc {
|
|
1214
|
-
constructor(t, e, i, n, a, c,
|
|
1214
|
+
constructor(t, e, i, n, a, c, l) {
|
|
1215
1215
|
o(this, Ye);
|
|
1216
1216
|
o(this, ft);
|
|
1217
|
-
o(this, ws);
|
|
1218
|
-
o(this, Mi);
|
|
1219
1217
|
o(this, fs);
|
|
1220
1218
|
o(this, zi);
|
|
1221
|
-
o(this, Hi);
|
|
1222
|
-
o(this, Xi, !1);
|
|
1223
1219
|
o(this, ps);
|
|
1224
|
-
o(this,
|
|
1225
|
-
|
|
1220
|
+
o(this, Hi);
|
|
1221
|
+
o(this, Xi);
|
|
1222
|
+
o(this, Yi, !1);
|
|
1223
|
+
o(this, bs);
|
|
1224
|
+
o(this, Tn, rt.get().createContext("GroupReader"));
|
|
1225
|
+
u(this, ft, t), u(this, fs, e), u(this, zi, i), u(this, ps, n), u(this, Hi, a), u(this, Xi, c), u(this, bs, l);
|
|
1226
1226
|
}
|
|
1227
1227
|
/**
|
|
1228
1228
|
* @returns The underlying stream id that provided this object group
|
|
1229
1229
|
*/
|
|
1230
1230
|
streamId() {
|
|
1231
|
-
return s(this,
|
|
1231
|
+
return s(this, bs);
|
|
1232
1232
|
}
|
|
1233
1233
|
groupId() {
|
|
1234
|
-
return s(this,
|
|
1234
|
+
return s(this, ps);
|
|
1235
1235
|
}
|
|
1236
1236
|
subscribeId() {
|
|
1237
|
-
return s(this,
|
|
1237
|
+
return s(this, fs);
|
|
1238
1238
|
}
|
|
1239
1239
|
next() {
|
|
1240
1240
|
return h(this, null, function* () {
|
|
1241
1241
|
try {
|
|
1242
|
-
if ((yield s(this, ft).isDone()) || s(this,
|
|
1242
|
+
if ((yield s(this, ft).isDone()) || s(this, Yi))
|
|
1243
1243
|
return { done: !0, value: void 0 };
|
|
1244
1244
|
const t = yield s(this, ft).readBigVarInt(), e = yield s(this, ft).readVarInt();
|
|
1245
1245
|
let i = 0, n = new Uint8Array();
|
|
1246
|
-
return e > 0 ? n = yield s(this, ft).read(e) : i = yield s(this, ft).readVarInt(), To(i), i === X.EndOfGroup && u(this,
|
|
1246
|
+
return e > 0 ? n = yield s(this, ft).read(e) : i = yield s(this, ft).readVarInt(), To(i), i === X.EndOfGroup && u(this, Yi, !0), {
|
|
1247
1247
|
done: !1,
|
|
1248
1248
|
value: {
|
|
1249
|
-
subscribeId: s(this,
|
|
1250
|
-
trackAlias: s(this,
|
|
1251
|
-
groupId: s(this,
|
|
1252
|
-
subGroupId: s(this,
|
|
1253
|
-
subscriberPriority: s(this,
|
|
1254
|
-
streamId: s(this,
|
|
1249
|
+
subscribeId: s(this, fs),
|
|
1250
|
+
trackAlias: s(this, zi),
|
|
1251
|
+
groupId: s(this, ps),
|
|
1252
|
+
subGroupId: s(this, Hi),
|
|
1253
|
+
subscriberPriority: s(this, Xi),
|
|
1254
|
+
streamId: s(this, bs),
|
|
1255
1255
|
objectId: t,
|
|
1256
1256
|
objectStatus: i,
|
|
1257
1257
|
payload: n
|
|
1258
1258
|
}
|
|
1259
1259
|
};
|
|
1260
1260
|
} catch (t) {
|
|
1261
|
-
return s(this,
|
|
1261
|
+
return s(this, Tn).info("Error reading object", { error: t }), { done: !0, value: void 0 };
|
|
1262
1262
|
}
|
|
1263
1263
|
});
|
|
1264
1264
|
}
|
|
@@ -1274,15 +1274,15 @@ class Kc {
|
|
|
1274
1274
|
[Symbol.asyncIterator]() {
|
|
1275
1275
|
return this;
|
|
1276
1276
|
}
|
|
1277
|
-
[
|
|
1277
|
+
[Bt()]() {
|
|
1278
1278
|
return f(this, Ye, ba).call(this);
|
|
1279
1279
|
}
|
|
1280
1280
|
[Symbol.asyncDispose]() {
|
|
1281
1281
|
return f(this, Ye, ba).call(this);
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
ft = new WeakMap(),
|
|
1285
|
-
return
|
|
1284
|
+
ft = new WeakMap(), fs = new WeakMap(), zi = new WeakMap(), ps = new WeakMap(), Hi = new WeakMap(), Xi = new WeakMap(), Yi = new WeakMap(), bs = new WeakMap(), Tn = new WeakMap(), Ye = new WeakSet(), Do = function() {
|
|
1285
|
+
return Pt(this, null, function* () {
|
|
1286
1286
|
yield this;
|
|
1287
1287
|
});
|
|
1288
1288
|
}, ba = function() {
|
|
@@ -1293,11 +1293,11 @@ function Oo(r, t) {
|
|
|
1293
1293
|
return h(this, null, function* () {
|
|
1294
1294
|
const e = yield r.readVarInt();
|
|
1295
1295
|
switch (e) {
|
|
1296
|
-
case
|
|
1297
|
-
const i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readBigVarInt(), c = yield r.readBigVarInt(),
|
|
1298
|
-
return new Kc(r, i, n, a, c,
|
|
1296
|
+
case yn.StreamHeaderGroup: {
|
|
1297
|
+
const i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readBigVarInt(), c = yield r.readBigVarInt(), l = yield r.readUnsigned8();
|
|
1298
|
+
return new Kc(r, i, n, a, c, l, t);
|
|
1299
1299
|
}
|
|
1300
|
-
case
|
|
1300
|
+
case yn.StreamHeaderTrack: {
|
|
1301
1301
|
const i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readUnsigned8();
|
|
1302
1302
|
return new Zc(r, i, n, a, t);
|
|
1303
1303
|
}
|
|
@@ -1306,71 +1306,71 @@ function Oo(r, t) {
|
|
|
1306
1306
|
}
|
|
1307
1307
|
});
|
|
1308
1308
|
}
|
|
1309
|
-
var
|
|
1309
|
+
var Yt, Zi;
|
|
1310
1310
|
class Jc {
|
|
1311
1311
|
constructor(t, e) {
|
|
1312
|
-
o(this,
|
|
1313
|
-
o(this,
|
|
1314
|
-
u(this,
|
|
1312
|
+
o(this, Yt);
|
|
1313
|
+
o(this, Zi);
|
|
1314
|
+
u(this, Yt, t), u(this, Zi, e);
|
|
1315
1315
|
}
|
|
1316
1316
|
start(t) {
|
|
1317
|
-
s(this,
|
|
1317
|
+
s(this, Yt).addEventListener("message", (e) => {
|
|
1318
1318
|
if (typeof e.data == "object" && e.data instanceof ArrayBuffer) {
|
|
1319
1319
|
const i = new Uint8Array(e.data);
|
|
1320
|
-
i[0] == s(this,
|
|
1320
|
+
i[0] == s(this, Zi) && t.enqueue(i.subarray(1));
|
|
1321
1321
|
}
|
|
1322
|
-
}), s(this,
|
|
1322
|
+
}), s(this, Yt).addEventListener("error", (e) => t.error(e)), s(this, Yt).addEventListener("close", () => Uo(() => t.close()));
|
|
1323
1323
|
}
|
|
1324
1324
|
cancel(t) {
|
|
1325
|
-
s(this,
|
|
1325
|
+
s(this, Yt).close(void 0, t);
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
|
-
|
|
1329
|
-
var
|
|
1328
|
+
Yt = new WeakMap(), Zi = new WeakMap();
|
|
1329
|
+
var Et, me, ye, ge;
|
|
1330
1330
|
class Qc {
|
|
1331
1331
|
constructor(t) {
|
|
1332
|
-
o(this,
|
|
1332
|
+
o(this, Et);
|
|
1333
1333
|
o(this, me, null);
|
|
1334
1334
|
o(this, ye, null);
|
|
1335
1335
|
o(this, ge, null);
|
|
1336
|
-
u(this,
|
|
1336
|
+
u(this, Et, t);
|
|
1337
1337
|
}
|
|
1338
1338
|
start(t) {
|
|
1339
1339
|
u(this, me, (e) => {
|
|
1340
1340
|
if (typeof e.data == "object" && e.data instanceof ArrayBuffer) {
|
|
1341
1341
|
const i = new Uint8Array(e.data), n = i[0] || 0, a = n & 127, c = (n >> 7 & 1) > 0;
|
|
1342
1342
|
if (a && a !== 0) {
|
|
1343
|
-
const
|
|
1344
|
-
t.enqueue([c, a,
|
|
1343
|
+
const l = i.subarray(1);
|
|
1344
|
+
t.enqueue([c, a, l]);
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
|
-
}), u(this, ye, () => Uo(() => t.close())), u(this, ge, (e) => t.error(e)), s(this,
|
|
1347
|
+
}), u(this, ye, () => Uo(() => t.close())), u(this, ge, (e) => t.error(e)), s(this, Et).addEventListener("message", s(this, me)), s(this, Et).addEventListener("error", s(this, ge)), s(this, Et).addEventListener("close", s(this, ye));
|
|
1348
1348
|
}
|
|
1349
1349
|
cancel(t) {
|
|
1350
|
-
s(this, me) && s(this,
|
|
1350
|
+
s(this, me) && s(this, Et).removeEventListener("message", s(this, me)), s(this, ge) && s(this, Et).removeEventListener("error", s(this, ge)), s(this, ye) && s(this, Et).removeEventListener("close", s(this, ye));
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
|
-
|
|
1354
|
-
var
|
|
1355
|
-
class
|
|
1353
|
+
Et = new WeakMap(), me = new WeakMap(), ye = new WeakMap(), ge = new WeakMap();
|
|
1354
|
+
var Tt, Ki, ke, At, An, U, ci, Xr, le, Yr, Xt;
|
|
1355
|
+
class gn {
|
|
1356
1356
|
constructor(t, e) {
|
|
1357
1357
|
o(this, U);
|
|
1358
|
-
o(this,
|
|
1359
|
-
o(this,
|
|
1358
|
+
o(this, Tt);
|
|
1359
|
+
o(this, Ki);
|
|
1360
1360
|
o(this, ke);
|
|
1361
|
-
o(this,
|
|
1362
|
-
o(this,
|
|
1363
|
-
u(this,
|
|
1361
|
+
o(this, At, 0);
|
|
1362
|
+
o(this, An, new TextDecoder());
|
|
1363
|
+
u(this, Tt, t), u(this, Ki, e), u(this, ke, e.getReader());
|
|
1364
1364
|
}
|
|
1365
1365
|
readUnsigned8() {
|
|
1366
1366
|
return h(this, null, function* () {
|
|
1367
|
-
return yield f(this, U, le).call(this, 1), f(this, U,
|
|
1367
|
+
return yield f(this, U, le).call(this, 1), f(this, U, Xt).call(this, 1)[0];
|
|
1368
1368
|
});
|
|
1369
1369
|
}
|
|
1370
1370
|
readString() {
|
|
1371
1371
|
return h(this, null, function* () {
|
|
1372
1372
|
const t = yield this.readVarInt(), e = yield this.read(t);
|
|
1373
|
-
return s(this,
|
|
1373
|
+
return s(this, An).decode(e);
|
|
1374
1374
|
});
|
|
1375
1375
|
}
|
|
1376
1376
|
readVarInt() {
|
|
@@ -1384,23 +1384,23 @@ class yn {
|
|
|
1384
1384
|
readBigVarInt() {
|
|
1385
1385
|
return h(this, null, function* () {
|
|
1386
1386
|
yield f(this, U, le).call(this, 1);
|
|
1387
|
-
const t = (f(this, U,
|
|
1388
|
-
switch (s(this,
|
|
1387
|
+
const t = (f(this, U, Yr).call(this, 1)[0] & 192) >> 6;
|
|
1388
|
+
switch (s(this, Tt)[s(this, At)] = f(this, U, Yr).call(this, 1)[0] & 63, t) {
|
|
1389
1389
|
case 0:
|
|
1390
|
-
return k(f(this, U,
|
|
1390
|
+
return k(f(this, U, Xt).call(this, 1)[0]);
|
|
1391
1391
|
case 1: {
|
|
1392
1392
|
yield f(this, U, le).call(this, 2);
|
|
1393
|
-
const e = f(this, U,
|
|
1393
|
+
const e = f(this, U, Xt).call(this, 2), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
1394
1394
|
return k(i.getUint16(0));
|
|
1395
1395
|
}
|
|
1396
1396
|
case 2: {
|
|
1397
1397
|
yield f(this, U, le).call(this, 4);
|
|
1398
|
-
const e = f(this, U,
|
|
1398
|
+
const e = f(this, U, Xt).call(this, 4), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
1399
1399
|
return k(i.getUint32(0));
|
|
1400
1400
|
}
|
|
1401
1401
|
case 3: {
|
|
1402
1402
|
yield f(this, U, le).call(this, 8);
|
|
1403
|
-
const e = f(this, U,
|
|
1403
|
+
const e = f(this, U, Xt).call(this, 8), i = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
1404
1404
|
if (typeof i.getBigUint64 != "undefined")
|
|
1405
1405
|
return k(i.getBigUint64(0));
|
|
1406
1406
|
const n = Oc(e, 0, 7);
|
|
@@ -1413,19 +1413,19 @@ class yn {
|
|
|
1413
1413
|
}
|
|
1414
1414
|
read(t) {
|
|
1415
1415
|
return h(this, null, function* () {
|
|
1416
|
-
return yield f(this, U, le).call(this, t), f(this, U,
|
|
1416
|
+
return yield f(this, U, le).call(this, t), f(this, U, Xt).call(this, t);
|
|
1417
1417
|
});
|
|
1418
1418
|
}
|
|
1419
1419
|
readAll() {
|
|
1420
1420
|
return h(this, null, function* () {
|
|
1421
|
-
for (; yield f(this, U,
|
|
1421
|
+
for (; yield f(this, U, Xr).call(this); )
|
|
1422
1422
|
;
|
|
1423
|
-
return f(this, U,
|
|
1423
|
+
return f(this, U, Xt).call(this, f(this, U, ci).call(this));
|
|
1424
1424
|
});
|
|
1425
1425
|
}
|
|
1426
1426
|
isDone() {
|
|
1427
1427
|
return h(this, null, function* () {
|
|
1428
|
-
return f(this, U,
|
|
1428
|
+
return f(this, U, ci).call(this) > 0 ? !1 : (yield f(this, U, Xr).call(this)) == 0;
|
|
1429
1429
|
});
|
|
1430
1430
|
}
|
|
1431
1431
|
closed() {
|
|
@@ -1435,63 +1435,63 @@ class yn {
|
|
|
1435
1435
|
}
|
|
1436
1436
|
close() {
|
|
1437
1437
|
return h(this, null, function* () {
|
|
1438
|
-
return s(this, ke).releaseLock(), s(this,
|
|
1438
|
+
return s(this, ke).releaseLock(), s(this, Ki).cancel();
|
|
1439
1439
|
});
|
|
1440
1440
|
}
|
|
1441
1441
|
}
|
|
1442
|
-
|
|
1443
|
-
return s(this,
|
|
1444
|
-
},
|
|
1442
|
+
Tt = new WeakMap(), Ki = new WeakMap(), ke = new WeakMap(), At = new WeakMap(), An = new WeakMap(), U = new WeakSet(), ci = function() {
|
|
1443
|
+
return s(this, Tt).length - s(this, At);
|
|
1444
|
+
}, Xr = function() {
|
|
1445
1445
|
return h(this, null, function* () {
|
|
1446
1446
|
const { value: t, done: e } = yield s(this, ke).read();
|
|
1447
1447
|
if (e)
|
|
1448
1448
|
return Promise.resolve(0);
|
|
1449
|
-
if (f(this, U,
|
|
1450
|
-
u(this,
|
|
1449
|
+
if (f(this, U, ci).call(this) === 0)
|
|
1450
|
+
u(this, Tt, t);
|
|
1451
1451
|
else {
|
|
1452
|
-
const n = s(this,
|
|
1453
|
-
a.set(n), a.set(t, n.byteLength), u(this,
|
|
1452
|
+
const n = s(this, Tt).subarray(s(this, At)), a = new Uint8Array(n.length + t.length);
|
|
1453
|
+
a.set(n), a.set(t, n.byteLength), u(this, Tt, a);
|
|
1454
1454
|
}
|
|
1455
|
-
return u(this,
|
|
1455
|
+
return u(this, At, 0), Promise.resolve(t.length);
|
|
1456
1456
|
});
|
|
1457
1457
|
}, le = function(t) {
|
|
1458
1458
|
return h(this, null, function* () {
|
|
1459
|
-
for (; f(this, U,
|
|
1460
|
-
if ((yield f(this, U,
|
|
1459
|
+
for (; f(this, U, ci).call(this) < t; )
|
|
1460
|
+
if ((yield f(this, U, Xr).call(this)) === 0)
|
|
1461
1461
|
throw new Error("Read failed");
|
|
1462
1462
|
});
|
|
1463
|
-
},
|
|
1464
|
-
return s(this,
|
|
1465
|
-
},
|
|
1466
|
-
const e = f(this, U,
|
|
1467
|
-
return u(this,
|
|
1463
|
+
}, Yr = function(t) {
|
|
1464
|
+
return s(this, Tt).subarray(s(this, At), s(this, At) + t);
|
|
1465
|
+
}, Xt = function(t) {
|
|
1466
|
+
const e = f(this, U, Yr).call(this, t);
|
|
1467
|
+
return u(this, At, s(this, At) + e.length), e;
|
|
1468
1468
|
};
|
|
1469
|
-
var
|
|
1469
|
+
var ms, ys, jt, Dn;
|
|
1470
1470
|
class Vo {
|
|
1471
1471
|
constructor(t) {
|
|
1472
|
-
o(this,
|
|
1473
|
-
o(this,
|
|
1474
|
-
o(this,
|
|
1475
|
-
o(this,
|
|
1476
|
-
u(this,
|
|
1472
|
+
o(this, ms, new Uint8Array(8));
|
|
1473
|
+
o(this, ys);
|
|
1474
|
+
o(this, jt);
|
|
1475
|
+
o(this, Dn, new TextEncoder());
|
|
1476
|
+
u(this, ys, t), u(this, jt, s(this, ys).getWriter());
|
|
1477
1477
|
}
|
|
1478
1478
|
writeString(t) {
|
|
1479
1479
|
return h(this, null, function* () {
|
|
1480
|
-
const e = s(this,
|
|
1480
|
+
const e = s(this, Dn).encode(t);
|
|
1481
1481
|
return yield this.writeVarInt(e.length), this.write(e);
|
|
1482
1482
|
});
|
|
1483
1483
|
}
|
|
1484
1484
|
write(t) {
|
|
1485
|
-
return s(this,
|
|
1485
|
+
return s(this, jt).write(t);
|
|
1486
1486
|
}
|
|
1487
1487
|
writeUnsigned8(t) {
|
|
1488
|
-
return s(this,
|
|
1488
|
+
return s(this, jt).write(Qn(t, s(this, ms)));
|
|
1489
1489
|
}
|
|
1490
1490
|
writeVarInt(t) {
|
|
1491
|
-
return s(this,
|
|
1491
|
+
return s(this, jt).write(Lo(t, s(this, ms)));
|
|
1492
1492
|
}
|
|
1493
1493
|
writeBigVarInt(t) {
|
|
1494
|
-
return s(this,
|
|
1494
|
+
return s(this, jt).write(Fo(t, s(this, ms)));
|
|
1495
1495
|
}
|
|
1496
1496
|
flush() {
|
|
1497
1497
|
return h(this, null, function* () {
|
|
@@ -1499,29 +1499,29 @@ class Vo {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
close() {
|
|
1501
1501
|
return h(this, null, function* () {
|
|
1502
|
-
s(this,
|
|
1502
|
+
s(this, jt).releaseLock(), yield s(this, ys).close();
|
|
1503
1503
|
});
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
|
-
|
|
1506
|
+
ms = new WeakMap(), ys = new WeakMap(), jt = new WeakMap(), Dn = new WeakMap();
|
|
1507
1507
|
const Co = {
|
|
1508
1508
|
CONNECTING: 0,
|
|
1509
1509
|
OPEN: 1,
|
|
1510
1510
|
CLOSING: 2,
|
|
1511
1511
|
CLOSED: 3
|
|
1512
1512
|
};
|
|
1513
|
-
var J, et, Ie,
|
|
1514
|
-
const
|
|
1513
|
+
var J, et, Ie, On;
|
|
1514
|
+
const Oi = class Oi {
|
|
1515
1515
|
constructor(t) {
|
|
1516
1516
|
o(this, J, 0);
|
|
1517
|
-
o(this, et, new Uint8Array(
|
|
1517
|
+
o(this, et, new Uint8Array(Oi.DEFAULT_BUFFER_SIZE));
|
|
1518
1518
|
o(this, Ie);
|
|
1519
|
-
o(this,
|
|
1519
|
+
o(this, On, new TextEncoder());
|
|
1520
1520
|
u(this, Ie, t);
|
|
1521
1521
|
}
|
|
1522
1522
|
writeString(t) {
|
|
1523
1523
|
return h(this, null, function* () {
|
|
1524
|
-
const e = s(this,
|
|
1524
|
+
const e = s(this, On).encode(t);
|
|
1525
1525
|
return yield this.writeVarInt(e.length), this.write(e);
|
|
1526
1526
|
});
|
|
1527
1527
|
}
|
|
@@ -1550,14 +1550,14 @@ const Di = class Di {
|
|
|
1550
1550
|
flush() {
|
|
1551
1551
|
if (s(this, Ie).readyState !== Co.OPEN)
|
|
1552
1552
|
throw new Error("Writer is not open");
|
|
1553
|
-
return s(this, Ie).send(s(this, et).subarray(0, s(this, J))), u(this, J, 0), u(this, et, new Uint8Array(
|
|
1553
|
+
return s(this, Ie).send(s(this, et).subarray(0, s(this, J))), u(this, J, 0), u(this, et, new Uint8Array(Oi.DEFAULT_BUFFER_SIZE)), Promise.resolve();
|
|
1554
1554
|
}
|
|
1555
1555
|
close() {
|
|
1556
1556
|
return s(this, Ie).close(), Promise.resolve();
|
|
1557
1557
|
}
|
|
1558
1558
|
};
|
|
1559
|
-
J = new WeakMap(), et = new WeakMap(), Ie = new WeakMap(),
|
|
1560
|
-
let
|
|
1559
|
+
J = new WeakMap(), et = new WeakMap(), Ie = new WeakMap(), On = new WeakMap(), d(Oi, "DEFAULT_BUFFER_SIZE", 1024);
|
|
1560
|
+
let Ci = Oi;
|
|
1561
1561
|
const Bo = Math.pow(2, 6) - 1, xo = Math.pow(2, 14) - 1, Po = Math.pow(2, 30) - 1, qc = Number.MAX_SAFE_INTEGER, _c = typeof BigInt == "function" ? k(2) ** k(62) - k(1) : k(Number.MAX_SAFE_INTEGER);
|
|
1562
1562
|
function Qn(r, t) {
|
|
1563
1563
|
return t[0] = r, t.subarray(0, 1);
|
|
@@ -1570,11 +1570,11 @@ function jo(r, t) {
|
|
|
1570
1570
|
const e = new DataView(t.buffer, t.byteOffset, 4);
|
|
1571
1571
|
return e.setUint32(0, r), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1573
|
+
function Go(r, t) {
|
|
1574
1574
|
const e = new DataView(t.buffer, t.byteOffset, 8);
|
|
1575
1575
|
return e.setBigUint64(0, r), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function No(r, t) {
|
|
1578
1578
|
const e = new DataView(t.buffer, t.byteOffset, 8);
|
|
1579
1579
|
return e.setUint32(0, r / 4294967296), e.setUint32(4, r & 4294967295), t.set([192], 0), new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
1580
1580
|
}
|
|
@@ -1586,7 +1586,7 @@ function Lo(r, t) {
|
|
|
1586
1586
|
if (r <= Po)
|
|
1587
1587
|
return jo(r | 2147483648, t);
|
|
1588
1588
|
if (r <= qc)
|
|
1589
|
-
return typeof BigInt == "function" ?
|
|
1589
|
+
return typeof BigInt == "function" ? Go(BigInt(r) | BigInt(3221225472) << BigInt(32), t) : No(Number(r), t);
|
|
1590
1590
|
throw new Error(`overflow, value larger than 53-bits: ${r}`);
|
|
1591
1591
|
}
|
|
1592
1592
|
function Fo(r, t) {
|
|
@@ -1597,7 +1597,7 @@ function Fo(r, t) {
|
|
|
1597
1597
|
if (r <= Po)
|
|
1598
1598
|
return jo(Number(r) | 2147483648, t);
|
|
1599
1599
|
if (r <= _c)
|
|
1600
|
-
return typeof BigInt == "function" ?
|
|
1600
|
+
return typeof BigInt == "function" ? Go(BigInt(r) | BigInt(3221225472) << BigInt(32), t) : No(Number(r), t);
|
|
1601
1601
|
throw new Error(`overflow, value larger than 62-bits: ${r}`);
|
|
1602
1602
|
}
|
|
1603
1603
|
var y = /* @__PURE__ */ ((r) => (r[r.SubscribeUpdate = 2] = "SubscribeUpdate", r[r.Subscribe = 3] = "Subscribe", r[r.SubscribeOk = 4] = "SubscribeOk", r[r.SubscribeError = 5] = "SubscribeError", r[r.Announce = 6] = "Announce", r[r.AnnounceOk = 7] = "AnnounceOk", r[r.AnnounceError = 8] = "AnnounceError", r[r.Unannounce = 9] = "Unannounce", r[r.Unsubscribe = 10] = "Unsubscribe", r[r.SubscribeDone = 11] = "SubscribeDone", r[r.AnnounceCancel = 12] = "AnnounceCancel", r[r.TrackStatusRequest = 13] = "TrackStatusRequest", r[r.TrackStatus = 14] = "TrackStatus", r[r.Goaway = 16] = "Goaway", r[r.ClientSetup = 64] = "ClientSetup", r[r.ServerSetup = 65] = "ServerSetup", r[r.Unknown = 255] = "Unknown", r))(y || {});
|
|
@@ -1619,8 +1619,8 @@ function Pa(r, t) {
|
|
|
1619
1619
|
yield r.writeString(e);
|
|
1620
1620
|
});
|
|
1621
1621
|
}
|
|
1622
|
-
const
|
|
1623
|
-
function
|
|
1622
|
+
const kn = k(2);
|
|
1623
|
+
function ei(r) {
|
|
1624
1624
|
return h(this, null, function* () {
|
|
1625
1625
|
const t = yield r.readVarInt(), e = /* @__PURE__ */ new Map();
|
|
1626
1626
|
for (let i = 0; i < t; i++) {
|
|
@@ -1630,7 +1630,7 @@ function ti(r) {
|
|
|
1630
1630
|
return e;
|
|
1631
1631
|
});
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1633
|
+
function si(r, t) {
|
|
1634
1634
|
return h(this, null, function* () {
|
|
1635
1635
|
yield r.writeVarInt(t.size);
|
|
1636
1636
|
for (const [e, i] of t)
|
|
@@ -1642,13 +1642,13 @@ function tu(r) {
|
|
|
1642
1642
|
return {
|
|
1643
1643
|
type: y.Announce,
|
|
1644
1644
|
namespace: yield qn(r),
|
|
1645
|
-
params: yield
|
|
1645
|
+
params: yield ei(r)
|
|
1646
1646
|
};
|
|
1647
1647
|
});
|
|
1648
1648
|
}
|
|
1649
1649
|
function eu(r, t) {
|
|
1650
1650
|
return h(this, null, function* () {
|
|
1651
|
-
yield Pa(r, t.namespace), yield
|
|
1651
|
+
yield Pa(r, t.namespace), yield si(r, t.params);
|
|
1652
1652
|
});
|
|
1653
1653
|
}
|
|
1654
1654
|
function su(r) {
|
|
@@ -1668,7 +1668,7 @@ const ru = {
|
|
|
1668
1668
|
Publisher: 1,
|
|
1669
1669
|
Subscriber: 2,
|
|
1670
1670
|
Both: 3
|
|
1671
|
-
},
|
|
1671
|
+
}, In = {
|
|
1672
1672
|
Role: k(0)
|
|
1673
1673
|
}, Wo = {
|
|
1674
1674
|
Draft07: 4278190087
|
|
@@ -1689,7 +1689,7 @@ function nu(r, t) {
|
|
|
1689
1689
|
yield r.writeVarInt(t.supportedVersions.length);
|
|
1690
1690
|
for (const e of t.supportedVersions)
|
|
1691
1691
|
yield r.writeVarInt(e.value);
|
|
1692
|
-
yield
|
|
1692
|
+
yield si(r, t.parameters);
|
|
1693
1693
|
});
|
|
1694
1694
|
}
|
|
1695
1695
|
function au(r) {
|
|
@@ -1697,8 +1697,8 @@ function au(r) {
|
|
|
1697
1697
|
const t = [], e = yield r.readVarInt();
|
|
1698
1698
|
for (let n = 0; n < e; n++)
|
|
1699
1699
|
t.push(yield $o(r));
|
|
1700
|
-
const i = yield
|
|
1701
|
-
if (!i.has(
|
|
1700
|
+
const i = yield ei(r);
|
|
1701
|
+
if (!i.has(In.Role))
|
|
1702
1702
|
throw new Error("Role parameter is required");
|
|
1703
1703
|
return {
|
|
1704
1704
|
type: y.ClientSetup,
|
|
@@ -1709,7 +1709,7 @@ function au(r) {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
function ou(r, t) {
|
|
1711
1711
|
return h(this, null, function* () {
|
|
1712
|
-
yield r.writeVarInt(t.selectedVersion.value), yield
|
|
1712
|
+
yield r.writeVarInt(t.selectedVersion.value), yield si(r, t.parameters);
|
|
1713
1713
|
});
|
|
1714
1714
|
}
|
|
1715
1715
|
function cu(r) {
|
|
@@ -1717,8 +1717,8 @@ function cu(r) {
|
|
|
1717
1717
|
const t = yield $o(r);
|
|
1718
1718
|
if (t.type !== "known")
|
|
1719
1719
|
throw new Error("Expected known version");
|
|
1720
|
-
const e = yield
|
|
1721
|
-
if (!e.has(
|
|
1720
|
+
const e = yield ei(r);
|
|
1721
|
+
if (!e.has(In.Role))
|
|
1722
1722
|
throw new Error("Role parameter is required");
|
|
1723
1723
|
return {
|
|
1724
1724
|
type: y.ServerSetup,
|
|
@@ -1816,9 +1816,9 @@ function zo(r, t) {
|
|
|
1816
1816
|
}
|
|
1817
1817
|
function lu(r) {
|
|
1818
1818
|
return h(this, null, function* () {
|
|
1819
|
-
const t = yield r.readBigVarInt(), e = yield r.readBigVarInt(), i = yield qn(r), n = yield r.readString(), a = yield r.readUnsigned8(), c = yield Mo(r),
|
|
1820
|
-
if (
|
|
1821
|
-
const p =
|
|
1819
|
+
const t = yield r.readBigVarInt(), e = yield r.readBigVarInt(), i = yield qn(r), n = yield r.readString(), a = yield r.readUnsigned8(), c = yield Mo(r), l = yield hu(r), w = yield ei(r);
|
|
1820
|
+
if (l.type === "absolute-range") {
|
|
1821
|
+
const p = l.start.group > l.end.group, m = l.start.group === l.end.group && l.start.object > l.end.object;
|
|
1822
1822
|
if (p || m)
|
|
1823
1823
|
throw new Error("Invalid filter range");
|
|
1824
1824
|
}
|
|
@@ -1830,14 +1830,14 @@ function lu(r) {
|
|
|
1830
1830
|
name: n,
|
|
1831
1831
|
subscriberPriority: a,
|
|
1832
1832
|
groupOrder: c,
|
|
1833
|
-
filterType:
|
|
1833
|
+
filterType: l,
|
|
1834
1834
|
params: w
|
|
1835
1835
|
};
|
|
1836
1836
|
});
|
|
1837
1837
|
}
|
|
1838
1838
|
function wu(r, t) {
|
|
1839
1839
|
return h(this, null, function* () {
|
|
1840
|
-
yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.trackAlias), yield Pa(r, t.namespace), yield r.writeString(t.name), yield r.writeUnsigned8(t.subscriberPriority), yield zo(r, t.groupOrder), yield du(r, t.filterType), yield
|
|
1840
|
+
yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.trackAlias), yield Pa(r, t.namespace), yield r.writeString(t.name), yield r.writeUnsigned8(t.subscriberPriority), yield zo(r, t.groupOrder), yield du(r, t.filterType), yield si(r, t.params);
|
|
1841
1841
|
});
|
|
1842
1842
|
}
|
|
1843
1843
|
const ma = {
|
|
@@ -1896,7 +1896,7 @@ function yu(r) {
|
|
|
1896
1896
|
group: yield r.readBigVarInt(),
|
|
1897
1897
|
object: yield r.readBigVarInt()
|
|
1898
1898
|
});
|
|
1899
|
-
const c = yield
|
|
1899
|
+
const c = yield ei(r);
|
|
1900
1900
|
return {
|
|
1901
1901
|
type: y.SubscribeOk,
|
|
1902
1902
|
id: t,
|
|
@@ -1909,12 +1909,12 @@ function yu(r) {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
function gu(r, t) {
|
|
1911
1911
|
return h(this, null, function* () {
|
|
1912
|
-
yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.expires), yield zo(r, t.groupOrder), yield r.writeUnsigned8(t.largestInfo ? 1 : 0), t.largestInfo && (yield r.writeBigVarInt(t.largestInfo.group), yield r.writeBigVarInt(t.largestInfo.object)), yield
|
|
1912
|
+
yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.expires), yield zo(r, t.groupOrder), yield r.writeUnsigned8(t.largestInfo ? 1 : 0), t.largestInfo && (yield r.writeBigVarInt(t.largestInfo.group), yield r.writeBigVarInt(t.largestInfo.object)), yield si(r, t.params);
|
|
1913
1913
|
});
|
|
1914
1914
|
}
|
|
1915
1915
|
function ku(r) {
|
|
1916
1916
|
return h(this, null, function* () {
|
|
1917
|
-
const t = yield r.readBigVarInt(), e = yield r.readBigVarInt(), i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readBigVarInt(), c = yield r.readUnsigned8(),
|
|
1917
|
+
const t = yield r.readBigVarInt(), e = yield r.readBigVarInt(), i = yield r.readBigVarInt(), n = yield r.readBigVarInt(), a = yield r.readBigVarInt(), c = yield r.readUnsigned8(), l = yield ei(r), w = e > n, p = e === n && i > a;
|
|
1918
1918
|
if (w || p)
|
|
1919
1919
|
throw new Error("Invalid filter range");
|
|
1920
1920
|
return {
|
|
@@ -1923,13 +1923,13 @@ function ku(r) {
|
|
|
1923
1923
|
start: { group: e, object: i },
|
|
1924
1924
|
end: { group: n, object: a },
|
|
1925
1925
|
subscriberPriority: c,
|
|
1926
|
-
params:
|
|
1926
|
+
params: l
|
|
1927
1927
|
};
|
|
1928
1928
|
});
|
|
1929
1929
|
}
|
|
1930
1930
|
function Iu(r, t) {
|
|
1931
1931
|
return h(this, null, function* () {
|
|
1932
|
-
yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.start.group), yield r.writeBigVarInt(t.start.object), yield r.writeBigVarInt(t.end.group), yield r.writeBigVarInt(t.end.object), yield r.writeUnsigned8(t.subscriberPriority), yield
|
|
1932
|
+
yield r.writeBigVarInt(t.id), yield r.writeBigVarInt(t.start.group), yield r.writeBigVarInt(t.start.object), yield r.writeBigVarInt(t.end.group), yield r.writeBigVarInt(t.end.object), yield r.writeUnsigned8(t.subscriberPriority), yield si(r, t.params);
|
|
1933
1933
|
});
|
|
1934
1934
|
}
|
|
1935
1935
|
function vu(r) {
|
|
@@ -1945,25 +1945,25 @@ function Su(r, t) {
|
|
|
1945
1945
|
yield r.writeBigVarInt(t.id);
|
|
1946
1946
|
});
|
|
1947
1947
|
}
|
|
1948
|
-
var
|
|
1948
|
+
var Gt, gs, P, Xo, Yo, Zo, Ko, Jo, Qo, qo, _o, tc, ec;
|
|
1949
1949
|
class Ho {
|
|
1950
1950
|
constructor(t) {
|
|
1951
1951
|
o(this, P);
|
|
1952
|
-
o(this,
|
|
1952
|
+
o(this, Gt);
|
|
1953
1953
|
// Temporary buffer that holds the message before it is written to the stream
|
|
1954
1954
|
// This way we can calculate the byte length of the message before writing it
|
|
1955
|
-
o(this,
|
|
1956
|
-
u(this,
|
|
1955
|
+
o(this, gs, new Uint8Array());
|
|
1956
|
+
u(this, Gt, t);
|
|
1957
1957
|
}
|
|
1958
1958
|
write(t) {
|
|
1959
1959
|
return h(this, null, function* () {
|
|
1960
|
-
yield s(this,
|
|
1961
|
-
const e = new
|
|
1960
|
+
yield s(this, Gt).writeVarInt(t.type);
|
|
1961
|
+
const e = new Ci({
|
|
1962
1962
|
close: () => {
|
|
1963
1963
|
},
|
|
1964
1964
|
readyState: Co.OPEN,
|
|
1965
1965
|
send: (i) => {
|
|
1966
|
-
u(this,
|
|
1966
|
+
u(this, gs, new Uint8Array(i));
|
|
1967
1967
|
}
|
|
1968
1968
|
});
|
|
1969
1969
|
switch (t.type) {
|
|
@@ -2000,16 +2000,16 @@ class Ho {
|
|
|
2000
2000
|
default:
|
|
2001
2001
|
throw new Error(`Unknown message type: ${t.type}`);
|
|
2002
2002
|
}
|
|
2003
|
-
yield e.flush(), yield s(this,
|
|
2003
|
+
yield e.flush(), yield s(this, Gt).writeVarInt(s(this, gs).byteLength), yield s(this, Gt).write(s(this, gs)), yield s(this, Gt).flush();
|
|
2004
2004
|
});
|
|
2005
2005
|
}
|
|
2006
2006
|
close() {
|
|
2007
2007
|
return h(this, null, function* () {
|
|
2008
|
-
return s(this,
|
|
2008
|
+
return s(this, Gt).close();
|
|
2009
2009
|
});
|
|
2010
2010
|
}
|
|
2011
2011
|
}
|
|
2012
|
-
|
|
2012
|
+
Gt = new WeakMap(), gs = new WeakMap(), P = new WeakSet(), Xo = function(t, e) {
|
|
2013
2013
|
return h(this, null, function* () {
|
|
2014
2014
|
yield nu(t, e);
|
|
2015
2015
|
});
|
|
@@ -2050,24 +2050,24 @@ jt = new WeakMap(), ys = new WeakMap(), P = new WeakSet(), Xo = function(t, e) {
|
|
|
2050
2050
|
yield iu(t, e);
|
|
2051
2051
|
});
|
|
2052
2052
|
};
|
|
2053
|
-
var
|
|
2053
|
+
var ks, Ji, Qi;
|
|
2054
2054
|
class Uu {
|
|
2055
2055
|
constructor(t, e) {
|
|
2056
|
-
o(this,
|
|
2057
|
-
o(this, Ki);
|
|
2056
|
+
o(this, ks);
|
|
2058
2057
|
o(this, Ji);
|
|
2059
|
-
|
|
2058
|
+
o(this, Qi);
|
|
2059
|
+
u(this, ks, t), u(this, Ji, new Ho(t)), u(this, Qi, e);
|
|
2060
2060
|
}
|
|
2061
2061
|
write(t) {
|
|
2062
2062
|
return h(this, null, function* () {
|
|
2063
|
-
yield s(this,
|
|
2063
|
+
yield s(this, ks).write(s(this, Qi)), yield s(this, Ji).write(t);
|
|
2064
2064
|
});
|
|
2065
2065
|
}
|
|
2066
2066
|
close() {
|
|
2067
|
-
return s(this,
|
|
2067
|
+
return s(this, ks).close();
|
|
2068
2068
|
}
|
|
2069
2069
|
}
|
|
2070
|
-
|
|
2070
|
+
ks = new WeakMap(), Ji = new WeakMap(), Qi = new WeakMap();
|
|
2071
2071
|
function Eu(r) {
|
|
2072
2072
|
return h(this, null, function* () {
|
|
2073
2073
|
return {
|
|
@@ -2128,64 +2128,64 @@ class _a {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
}
|
|
2130
2130
|
j = new WeakMap();
|
|
2131
|
-
var
|
|
2131
|
+
var qi, Is, vs, _i, Vn, sc, Cn;
|
|
2132
2132
|
const ss = class ss {
|
|
2133
2133
|
constructor(t, e) {
|
|
2134
|
-
o(this,
|
|
2135
|
-
o(this,
|
|
2136
|
-
o(this,
|
|
2137
|
-
o(this,
|
|
2138
|
-
o(this,
|
|
2139
|
-
u(this,
|
|
2134
|
+
o(this, Vn);
|
|
2135
|
+
o(this, qi);
|
|
2136
|
+
o(this, Is);
|
|
2137
|
+
o(this, vs, new V());
|
|
2138
|
+
o(this, _i, new V());
|
|
2139
|
+
u(this, qi, t), u(this, Is, e), s(this, vs).resolve();
|
|
2140
2140
|
}
|
|
2141
2141
|
write(t) {
|
|
2142
2142
|
return h(this, null, function* () {
|
|
2143
|
-
const e = yield f(this,
|
|
2143
|
+
const e = yield f(this, Vn, sc).call(this);
|
|
2144
2144
|
try {
|
|
2145
|
-
yield s(this,
|
|
2145
|
+
yield s(this, qi).write(t);
|
|
2146
2146
|
} finally {
|
|
2147
2147
|
e.resolve();
|
|
2148
2148
|
}
|
|
2149
2149
|
});
|
|
2150
2150
|
}
|
|
2151
2151
|
markPostHandshake() {
|
|
2152
|
-
s(this,
|
|
2152
|
+
s(this, _i).resolve();
|
|
2153
2153
|
}
|
|
2154
2154
|
postHandshake() {
|
|
2155
|
-
return s(this,
|
|
2155
|
+
return s(this, _i).promise;
|
|
2156
2156
|
}
|
|
2157
2157
|
// Not "thread" safe (:
|
|
2158
2158
|
read() {
|
|
2159
2159
|
return h(this, null, function* () {
|
|
2160
|
-
return s(this,
|
|
2160
|
+
return s(this, Is).read();
|
|
2161
2161
|
});
|
|
2162
2162
|
}
|
|
2163
2163
|
cancel() {
|
|
2164
|
-
return s(this,
|
|
2164
|
+
return s(this, Is).cancel();
|
|
2165
2165
|
}
|
|
2166
2166
|
static wrapWebsocket(t) {
|
|
2167
|
-
const e = new ReadableStream(new Jc(t, s(ss,
|
|
2167
|
+
const e = new ReadableStream(new Jc(t, s(ss, Cn))), i = new _a(new gn(new Uint8Array([]), e)), n = new Uu(new Ci(t), new Uint8Array([0]));
|
|
2168
2168
|
return new ss(n, i);
|
|
2169
2169
|
}
|
|
2170
2170
|
static wrapWebTransport(t) {
|
|
2171
2171
|
const e = t.writable, i = t.readable;
|
|
2172
2172
|
return new ss(
|
|
2173
2173
|
new Ho(new Vo(e)),
|
|
2174
|
-
new _a(new
|
|
2174
|
+
new _a(new gn(new Uint8Array(), i))
|
|
2175
2175
|
);
|
|
2176
2176
|
}
|
|
2177
2177
|
};
|
|
2178
|
-
|
|
2179
|
-
const t = new V(), e = s(this,
|
|
2180
|
-
return u(this,
|
|
2181
|
-
},
|
|
2182
|
-
let
|
|
2178
|
+
qi = new WeakMap(), Is = new WeakMap(), vs = new WeakMap(), _i = new WeakMap(), Vn = new WeakSet(), sc = function() {
|
|
2179
|
+
const t = new V(), e = s(this, vs).promise.then(() => t);
|
|
2180
|
+
return u(this, vs, t), e;
|
|
2181
|
+
}, Cn = new WeakMap(), o(ss, Cn, 0);
|
|
2182
|
+
let vn = ss;
|
|
2183
2183
|
function ic(r, t) {
|
|
2184
2184
|
return h(this, null, function* () {
|
|
2185
2185
|
yield r.write({
|
|
2186
2186
|
type: y.ClientSetup,
|
|
2187
2187
|
supportedVersions: [{ type: "known", value: Wo.Draft07 }],
|
|
2188
|
-
parameters: /* @__PURE__ */ new Map([[
|
|
2188
|
+
parameters: /* @__PURE__ */ new Map([[In.Role, { type: In.Role, payload: new Uint8Array([t]) }]])
|
|
2189
2189
|
});
|
|
2190
2190
|
const e = yield r.read();
|
|
2191
2191
|
if (r.markPostHandshake(), e.type !== y.ServerSetup)
|
|
@@ -2194,43 +2194,43 @@ function ic(r, t) {
|
|
|
2194
2194
|
throw new Error("Expected known version");
|
|
2195
2195
|
});
|
|
2196
2196
|
}
|
|
2197
|
-
var
|
|
2197
|
+
var Ss;
|
|
2198
2198
|
class Au {
|
|
2199
2199
|
constructor(t) {
|
|
2200
|
-
|
|
2201
|
-
o(this,
|
|
2200
|
+
d(this, "announce");
|
|
2201
|
+
o(this, Ss, new V());
|
|
2202
2202
|
this.announce = t;
|
|
2203
2203
|
}
|
|
2204
2204
|
onOk(t) {
|
|
2205
|
-
s(this,
|
|
2205
|
+
s(this, Ss).resolve(t);
|
|
2206
2206
|
}
|
|
2207
2207
|
onError(t) {
|
|
2208
2208
|
const e = new Error(t.reason);
|
|
2209
|
-
return s(this,
|
|
2209
|
+
return s(this, Ss).reject(e), e;
|
|
2210
2210
|
}
|
|
2211
2211
|
ok() {
|
|
2212
|
-
return s(this,
|
|
2212
|
+
return s(this, Ss).promise;
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
2215
|
-
|
|
2215
|
+
Ss = new WeakMap();
|
|
2216
2216
|
function Du(r) {
|
|
2217
2217
|
const t = new Au(r);
|
|
2218
2218
|
return new Ou(t);
|
|
2219
2219
|
}
|
|
2220
2220
|
class Ou {
|
|
2221
2221
|
constructor(t) {
|
|
2222
|
-
|
|
2222
|
+
d(this, "state");
|
|
2223
2223
|
this.state = t;
|
|
2224
2224
|
}
|
|
2225
2225
|
}
|
|
2226
|
-
var
|
|
2227
|
-
const
|
|
2226
|
+
var Us, Zt, ve, Bn, Se, pt;
|
|
2227
|
+
const is = class is {
|
|
2228
2228
|
constructor(t) {
|
|
2229
|
-
|
|
2230
|
-
o(this,
|
|
2231
|
-
o(this,
|
|
2229
|
+
d(this, "subscribe");
|
|
2230
|
+
o(this, Us, new V());
|
|
2231
|
+
o(this, Zt, new V());
|
|
2232
2232
|
o(this, ve, new V());
|
|
2233
|
-
o(this,
|
|
2233
|
+
o(this, Bn, Date.now());
|
|
2234
2234
|
o(this, Se, new V());
|
|
2235
2235
|
o(this, pt);
|
|
2236
2236
|
switch (this.subscribe = t, t.filterType.type) {
|
|
@@ -2247,27 +2247,27 @@ const Bn = class Bn {
|
|
|
2247
2247
|
}
|
|
2248
2248
|
onError(t) {
|
|
2249
2249
|
const e = new Error(t.reason);
|
|
2250
|
-
return s(this,
|
|
2250
|
+
return s(this, Us).reject(e), s(this, Zt).reject(e), e;
|
|
2251
2251
|
}
|
|
2252
2252
|
onDone(t) {
|
|
2253
|
-
t.finalInfo && (s(this, pt) || u(this, pt, { startGroup: k(0) }), s(this, pt).endGroup = t.finalInfo.group), s(this,
|
|
2253
|
+
t.finalInfo && (s(this, pt) || u(this, pt, { startGroup: k(0) }), s(this, pt).endGroup = t.finalInfo.group), s(this, Zt).resolve(t);
|
|
2254
2254
|
}
|
|
2255
2255
|
onUnsubscribe(t) {
|
|
2256
2256
|
s(this, ve).resolve(t);
|
|
2257
2257
|
}
|
|
2258
2258
|
onOk(t) {
|
|
2259
|
-
const e = Math.max(0, Date.now() - s(this,
|
|
2259
|
+
const e = Math.max(0, Date.now() - s(this, Bn)), i = Number(t.expires);
|
|
2260
2260
|
if (i > 0) {
|
|
2261
|
-
const n = Math.min(i / 10,
|
|
2261
|
+
const n = Math.max(is.minGraceTime, Math.min(i / 10, is.maxGraceTime));
|
|
2262
2262
|
Promise.race([Kn(i - n - e), this.done().catch(A)]).then(() => s(this, Se).resolve(this.expiryState())).catch(A);
|
|
2263
2263
|
}
|
|
2264
|
-
s(this,
|
|
2264
|
+
s(this, Us).resolve(t);
|
|
2265
2265
|
}
|
|
2266
2266
|
done() {
|
|
2267
|
-
return s(this,
|
|
2267
|
+
return s(this, Zt).promise;
|
|
2268
2268
|
}
|
|
2269
2269
|
ok() {
|
|
2270
|
-
return s(this,
|
|
2270
|
+
return s(this, Us).promise;
|
|
2271
2271
|
}
|
|
2272
2272
|
range() {
|
|
2273
2273
|
return s(this, pt);
|
|
@@ -2277,7 +2277,7 @@ const Bn = class Bn {
|
|
|
2277
2277
|
}
|
|
2278
2278
|
// Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
|
|
2279
2279
|
expiryState() {
|
|
2280
|
-
return s(this,
|
|
2280
|
+
return s(this, Zt).resolved && s(this, Zt).resolved.errorCode !== ma.Expired ? "done" : s(this, ve).pending ? "active" : "unsubscribed";
|
|
2281
2281
|
}
|
|
2282
2282
|
unsubscribed() {
|
|
2283
2283
|
return s(this, ve).promise;
|
|
@@ -2293,18 +2293,18 @@ const Bn = class Bn {
|
|
|
2293
2293
|
return s(this, Se).promise;
|
|
2294
2294
|
}
|
|
2295
2295
|
};
|
|
2296
|
-
|
|
2297
|
-
let
|
|
2298
|
-
var $,
|
|
2296
|
+
Us = new WeakMap(), Zt = new WeakMap(), ve = new WeakMap(), Bn = new WeakMap(), Se = new WeakMap(), pt = new WeakMap(), d(is, "maxGraceTime", 15e3), d(is, "minGraceTime", 3e3);
|
|
2297
|
+
let Sn = is;
|
|
2298
|
+
var $, tr;
|
|
2299
2299
|
class Vu {
|
|
2300
2300
|
constructor(t) {
|
|
2301
2301
|
o(this, $);
|
|
2302
|
-
o(this,
|
|
2302
|
+
o(this, tr, !1);
|
|
2303
2303
|
u(this, $, t);
|
|
2304
2304
|
}
|
|
2305
2305
|
write(t) {
|
|
2306
2306
|
return h(this, null, function* () {
|
|
2307
|
-
s(this,
|
|
2307
|
+
s(this, tr) || (yield s(this, $).writeVarInt(yn.StreamHeaderGroup), yield s(this, $).writeBigVarInt(t.subscribeId), yield s(this, $).writeBigVarInt(t.trackAlias), yield s(this, $).writeBigVarInt(t.groupId), yield s(this, $).writeBigVarInt(t.subGroupId), yield s(this, $).writeUnsigned8(t.subscriberPriority), u(this, tr, !0)), yield s(this, $).writeBigVarInt(t.objectId), yield s(this, $).writeVarInt(t.payload.length), t.payload.length > 0 ? yield s(this, $).write(t.payload) : yield s(this, $).writeVarInt(t.objectStatus), yield s(this, $).flush();
|
|
2308
2308
|
});
|
|
2309
2309
|
}
|
|
2310
2310
|
close() {
|
|
@@ -2313,26 +2313,26 @@ class Vu {
|
|
|
2313
2313
|
});
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
|
-
$ = new WeakMap(),
|
|
2317
|
-
var
|
|
2316
|
+
$ = new WeakMap(), tr = new WeakMap();
|
|
2317
|
+
var er, ct, sr, ir, Es, rr, xn, rc;
|
|
2318
2318
|
class Cu {
|
|
2319
2319
|
constructor(t, e, i, n) {
|
|
2320
2320
|
o(this, xn);
|
|
2321
|
-
o(this, tr);
|
|
2322
|
-
o(this, ct);
|
|
2323
2321
|
o(this, er);
|
|
2322
|
+
o(this, ct);
|
|
2324
2323
|
o(this, sr);
|
|
2325
|
-
o(this, Us);
|
|
2326
2324
|
o(this, ir);
|
|
2327
|
-
|
|
2325
|
+
o(this, Es);
|
|
2326
|
+
o(this, rr);
|
|
2327
|
+
u(this, er, e), u(this, ct, t), u(this, sr, i), u(this, ir, n), u(this, rr, rt.get().createContext(`SubscriptionWriter:${t.subscribe.name}`));
|
|
2328
2328
|
}
|
|
2329
2329
|
finalInfo() {
|
|
2330
|
-
return s(this,
|
|
2330
|
+
return s(this, Es);
|
|
2331
2331
|
}
|
|
2332
2332
|
run() {
|
|
2333
2333
|
return h(this, null, function* () {
|
|
2334
2334
|
yield Promise.race([
|
|
2335
|
-
f(this, xn, rc).call(this).catch((t) => s(this,
|
|
2335
|
+
f(this, xn, rc).call(this).catch((t) => s(this, rr).error("error writing subscription", t)),
|
|
2336
2336
|
s(this, ct).unsubscribed(),
|
|
2337
2337
|
s(this, ct).done(),
|
|
2338
2338
|
s(this, ct).expiryNotification().catch(A)
|
|
@@ -2348,33 +2348,33 @@ class Cu {
|
|
|
2348
2348
|
id: s(this, ct).subscribe.id,
|
|
2349
2349
|
errorCode: t,
|
|
2350
2350
|
reason: e,
|
|
2351
|
-
finalInfo: s(this,
|
|
2351
|
+
finalInfo: s(this, Es)
|
|
2352
2352
|
};
|
|
2353
|
-
s(this, ct).onDone(i), yield s(this,
|
|
2353
|
+
s(this, ct).onDone(i), yield s(this, ir).push(i);
|
|
2354
2354
|
});
|
|
2355
2355
|
}
|
|
2356
|
-
[
|
|
2356
|
+
[Bt()]() {
|
|
2357
2357
|
return this.done(ma.TrackEnded, "Track ended");
|
|
2358
2358
|
}
|
|
2359
2359
|
[Symbol.asyncDispose]() {
|
|
2360
2360
|
return this.done(ma.TrackEnded, "Track ended");
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
|
-
|
|
2363
|
+
er = new WeakMap(), ct = new WeakMap(), sr = new WeakMap(), ir = new WeakMap(), Es = new WeakMap(), rr = new WeakMap(), xn = new WeakSet(), rc = function() {
|
|
2364
2364
|
return h(this, null, function* () {
|
|
2365
2365
|
try {
|
|
2366
|
-
for (var c = C(s(this,
|
|
2366
|
+
for (var c = C(s(this, er)), l, w, p; l = !(w = yield c.next()).done; l = !1) {
|
|
2367
2367
|
const m = w.value;
|
|
2368
2368
|
var t = [];
|
|
2369
2369
|
try {
|
|
2370
2370
|
const b = s(this, ct).range();
|
|
2371
2371
|
if (b && (b.startGroup > m.id || b.endGroup && b.endGroup < m.id))
|
|
2372
2372
|
break;
|
|
2373
|
-
const I = yield s(this,
|
|
2373
|
+
const I = yield s(this, sr).openSendStream();
|
|
2374
2374
|
const g = new Vu(I);
|
|
2375
2375
|
const E = nt(t, new Bu(g, m.consume(), s(this, ct)), !0);
|
|
2376
2376
|
yield E.run();
|
|
2377
|
-
u(this,
|
|
2377
|
+
u(this, Es, E.finalGroup());
|
|
2378
2378
|
} catch (e) {
|
|
2379
2379
|
var i = e, n = !0;
|
|
2380
2380
|
} finally {
|
|
@@ -2386,7 +2386,7 @@ tr = new WeakMap(), ct = new WeakMap(), er = new WeakMap(), sr = new WeakMap(),
|
|
|
2386
2386
|
p = [w];
|
|
2387
2387
|
} finally {
|
|
2388
2388
|
try {
|
|
2389
|
-
|
|
2389
|
+
l && (w = c.return) && (yield w.call(c));
|
|
2390
2390
|
} finally {
|
|
2391
2391
|
if (p)
|
|
2392
2392
|
throw p[0];
|
|
@@ -2394,35 +2394,35 @@ tr = new WeakMap(), ct = new WeakMap(), er = new WeakMap(), sr = new WeakMap(),
|
|
|
2394
2394
|
}
|
|
2395
2395
|
});
|
|
2396
2396
|
};
|
|
2397
|
-
var Ue,
|
|
2397
|
+
var Ue, nr, Ts, ar, As;
|
|
2398
2398
|
class Bu {
|
|
2399
2399
|
constructor(t, e, i) {
|
|
2400
2400
|
o(this, Ue);
|
|
2401
|
-
o(this, rr);
|
|
2402
|
-
o(this, Es);
|
|
2403
2401
|
o(this, nr);
|
|
2404
2402
|
o(this, Ts);
|
|
2405
|
-
|
|
2403
|
+
o(this, ar);
|
|
2404
|
+
o(this, As);
|
|
2405
|
+
u(this, Ue, t), u(this, nr, e), u(this, Ts, i), u(this, As, rt.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
|
|
2406
2406
|
}
|
|
2407
2407
|
finalGroup() {
|
|
2408
|
-
return s(this,
|
|
2408
|
+
return s(this, ar);
|
|
2409
2409
|
}
|
|
2410
2410
|
run() {
|
|
2411
2411
|
return h(this, null, function* () {
|
|
2412
|
-
s(this,
|
|
2412
|
+
s(this, As).debug("write group");
|
|
2413
2413
|
try {
|
|
2414
|
-
for (var t = C(s(this,
|
|
2414
|
+
for (var t = C(s(this, nr)), e, i, n; e = !(i = yield t.next()).done; e = !1) {
|
|
2415
2415
|
const a = i.value;
|
|
2416
2416
|
yield s(this, Ue).write({
|
|
2417
|
-
subscribeId: s(this,
|
|
2418
|
-
trackAlias: s(this,
|
|
2417
|
+
subscribeId: s(this, Ts).subscribe.id,
|
|
2418
|
+
trackAlias: s(this, Ts).subscribe.trackAlias,
|
|
2419
2419
|
subGroupId: k(0),
|
|
2420
2420
|
subscriberPriority: 0,
|
|
2421
2421
|
groupId: a.groupId,
|
|
2422
2422
|
objectId: a.objectId,
|
|
2423
2423
|
objectStatus: a.objectStatus,
|
|
2424
2424
|
payload: a.payload
|
|
2425
|
-
}), u(this,
|
|
2425
|
+
}), u(this, ar, { group: a.groupId, object: a.objectId });
|
|
2426
2426
|
}
|
|
2427
2427
|
} catch (i) {
|
|
2428
2428
|
n = [i];
|
|
@@ -2434,25 +2434,25 @@ class Bu {
|
|
|
2434
2434
|
throw n[0];
|
|
2435
2435
|
}
|
|
2436
2436
|
}
|
|
2437
|
-
s(this,
|
|
2437
|
+
s(this, As).debug("write group done");
|
|
2438
2438
|
});
|
|
2439
2439
|
}
|
|
2440
|
-
[
|
|
2440
|
+
[Bt()]() {
|
|
2441
2441
|
return s(this, Ue).close().catch(A);
|
|
2442
2442
|
}
|
|
2443
2443
|
[Symbol.asyncDispose]() {
|
|
2444
2444
|
return s(this, Ue).close().catch(A);
|
|
2445
2445
|
}
|
|
2446
2446
|
}
|
|
2447
|
-
Ue = new WeakMap(),
|
|
2448
|
-
var
|
|
2447
|
+
Ue = new WeakMap(), nr = new WeakMap(), Ts = new WeakMap(), ar = new WeakMap(), As = new WeakMap();
|
|
2448
|
+
var or, Ee, Kt, Qe;
|
|
2449
2449
|
class xu {
|
|
2450
2450
|
constructor(t, e, i) {
|
|
2451
|
-
o(this,
|
|
2452
|
-
|
|
2453
|
-
o(this,
|
|
2451
|
+
o(this, Kt);
|
|
2452
|
+
d(this, "state");
|
|
2453
|
+
o(this, or);
|
|
2454
2454
|
o(this, Ee);
|
|
2455
|
-
this.state = t, u(this,
|
|
2455
|
+
this.state = t, u(this, or, e), u(this, Ee, i);
|
|
2456
2456
|
}
|
|
2457
2457
|
/**
|
|
2458
2458
|
* Accept the subscription and provide a track cache for the subscription
|
|
@@ -2462,7 +2462,7 @@ class xu {
|
|
|
2462
2462
|
ok(t) {
|
|
2463
2463
|
return h(this, null, function* () {
|
|
2464
2464
|
var w, p, m;
|
|
2465
|
-
const e = (w = this.state.range()) == null ? void 0 : w.startGroup, i = t.latest(), n = i == null ? void 0 : i.id, a = (m = (p = i == null ? void 0 : i.latest()) == null ? void 0 : p.objectId) != null ? m : k(0), c = t.consume(e != null ? e : n),
|
|
2465
|
+
const e = (w = this.state.range()) == null ? void 0 : w.startGroup, i = t.latest(), n = i == null ? void 0 : i.id, a = (m = (p = i == null ? void 0 : i.latest()) == null ? void 0 : p.objectId) != null ? m : k(0), c = t.consume(e != null ? e : n), l = {
|
|
2466
2466
|
type: y.SubscribeOk,
|
|
2467
2467
|
id: this.state.subscribe.id,
|
|
2468
2468
|
expires: k(0),
|
|
@@ -2470,32 +2470,32 @@ class xu {
|
|
|
2470
2470
|
params: /* @__PURE__ */ new Map(),
|
|
2471
2471
|
largestInfo: n ? { group: n, object: a } : void 0
|
|
2472
2472
|
};
|
|
2473
|
-
return yield s(this, Ee).push(
|
|
2473
|
+
return yield s(this, Ee).push(l), new Cu(this.state, c, s(this, or), s(this, Ee));
|
|
2474
2474
|
});
|
|
2475
2475
|
}
|
|
2476
2476
|
invalidRange() {
|
|
2477
|
-
return f(this,
|
|
2477
|
+
return f(this, Kt, Qe).call(this, k(1), "Invalid range");
|
|
2478
2478
|
}
|
|
2479
2479
|
retryTrackAlias() {
|
|
2480
|
-
return f(this,
|
|
2480
|
+
return f(this, Kt, Qe).call(this, k(2), "Retry track alias");
|
|
2481
2481
|
}
|
|
2482
2482
|
trackDoesNotExist() {
|
|
2483
|
-
return f(this,
|
|
2483
|
+
return f(this, Kt, Qe).call(this, k(3), "Track does not exist");
|
|
2484
2484
|
}
|
|
2485
2485
|
unauthorized() {
|
|
2486
|
-
return f(this,
|
|
2486
|
+
return f(this, Kt, Qe).call(this, k(4), "Unauthorized");
|
|
2487
2487
|
}
|
|
2488
2488
|
timeout() {
|
|
2489
|
-
return f(this,
|
|
2489
|
+
return f(this, Kt, Qe).call(this, k(5), "Timeout");
|
|
2490
2490
|
}
|
|
2491
|
-
[
|
|
2491
|
+
[Bt()]() {
|
|
2492
2492
|
return this.trackDoesNotExist();
|
|
2493
2493
|
}
|
|
2494
2494
|
[Symbol.asyncDispose]() {
|
|
2495
2495
|
return this.trackDoesNotExist();
|
|
2496
2496
|
}
|
|
2497
2497
|
}
|
|
2498
|
-
|
|
2498
|
+
or = new WeakMap(), Ee = new WeakMap(), Kt = new WeakSet(), Qe = function(t, e) {
|
|
2499
2499
|
const i = {
|
|
2500
2500
|
type: y.SubscribeError,
|
|
2501
2501
|
id: this.state.subscribe.id,
|
|
@@ -2505,77 +2505,77 @@ ar = new WeakMap(), Ee = new WeakMap(), Zt = new WeakSet(), Qe = function(t, e)
|
|
|
2505
2505
|
};
|
|
2506
2506
|
return s(this, Ee).push(i);
|
|
2507
2507
|
};
|
|
2508
|
-
var no,
|
|
2508
|
+
var no, Ds, cr, Os, Te, Jt, Qt, qt, oa;
|
|
2509
2509
|
no = [q({ context: "Session", enter: "info", error: "error" })];
|
|
2510
2510
|
class ya {
|
|
2511
2511
|
constructor(t, e, i) {
|
|
2512
2512
|
he(oa, 5, this);
|
|
2513
|
-
o(this, As);
|
|
2514
|
-
o(this, or);
|
|
2515
2513
|
o(this, Ds);
|
|
2514
|
+
o(this, cr);
|
|
2515
|
+
o(this, Os);
|
|
2516
2516
|
o(this, Te, rt.get().createContext("Publisher"));
|
|
2517
|
-
o(this, Kt, new Y(/* @__PURE__ */ new Map()));
|
|
2518
2517
|
o(this, Jt, new Y(/* @__PURE__ */ new Map()));
|
|
2519
|
-
o(this, Qt, new
|
|
2520
|
-
|
|
2518
|
+
o(this, Qt, new Y(/* @__PURE__ */ new Map()));
|
|
2519
|
+
o(this, qt, new Jn(10));
|
|
2520
|
+
u(this, Ds, t), u(this, cr, e), u(this, Os, i);
|
|
2521
2521
|
}
|
|
2522
2522
|
announce(t) {
|
|
2523
2523
|
return h(this, null, function* () {
|
|
2524
|
-
if (s(this,
|
|
2524
|
+
if (s(this, Jt).current().has(t.join("/")))
|
|
2525
2525
|
throw new Error("Duplicate announcement");
|
|
2526
|
-
const e = /* @__PURE__ */ new Map(), i = s(this,
|
|
2527
|
-
i && e.set(
|
|
2526
|
+
const e = /* @__PURE__ */ new Map(), i = s(this, Ds).authToken();
|
|
2527
|
+
i && e.set(kn, { type: kn, payload: new TextEncoder().encode(i) });
|
|
2528
2528
|
const n = {
|
|
2529
2529
|
type: y.Announce,
|
|
2530
2530
|
namespace: t,
|
|
2531
2531
|
params: e
|
|
2532
2532
|
}, a = Du(n);
|
|
2533
|
-
if (s(this,
|
|
2533
|
+
if (s(this, Jt).update((l) => l.set(n.namespace.join("/"), a)), yield s(this, Os).push(n), !(yield Promise.race([a.state.ok(), s(this, Ds).closed()])))
|
|
2534
2534
|
throw new Error("Session closed");
|
|
2535
2535
|
});
|
|
2536
2536
|
}
|
|
2537
2537
|
close() {
|
|
2538
|
-
s(this,
|
|
2538
|
+
s(this, Qt).current().forEach((t) => t.close()), s(this, Qt).close(), s(this, Jt).close(), s(this, qt).close();
|
|
2539
2539
|
}
|
|
2540
2540
|
incomingSubscriptions() {
|
|
2541
|
-
return s(this,
|
|
2541
|
+
return s(this, qt);
|
|
2542
2542
|
}
|
|
2543
2543
|
onMessage(t) {
|
|
2544
2544
|
return h(this, null, function* () {
|
|
2545
2545
|
switch (t.type) {
|
|
2546
2546
|
case y.Subscribe:
|
|
2547
2547
|
{
|
|
2548
|
-
const e = new
|
|
2549
|
-
if (s(this,
|
|
2550
|
-
const i = yield s(this,
|
|
2548
|
+
const e = new Sn(t);
|
|
2549
|
+
if (s(this, Qt).update((i) => (i.set(t.id, e), i)), s(this, qt).isFull()) {
|
|
2550
|
+
const i = yield s(this, qt).pop();
|
|
2551
2551
|
yield i == null ? void 0 : i.timeout();
|
|
2552
2552
|
}
|
|
2553
|
-
yield s(this,
|
|
2554
|
-
new xu(e, s(this,
|
|
2553
|
+
yield s(this, qt).push(
|
|
2554
|
+
new xu(e, s(this, cr), s(this, Os))
|
|
2555
2555
|
);
|
|
2556
2556
|
}
|
|
2557
2557
|
break;
|
|
2558
2558
|
case y.SubscribeUpdate:
|
|
2559
2559
|
{
|
|
2560
|
-
const e = s(this,
|
|
2560
|
+
const e = s(this, Qt).current().get(t.id);
|
|
2561
2561
|
e || s(this, Te).debug("No subscription found", t), e == null || e.onUpdate(t);
|
|
2562
2562
|
}
|
|
2563
2563
|
break;
|
|
2564
2564
|
case y.Unsubscribe:
|
|
2565
2565
|
{
|
|
2566
|
-
const e = s(this,
|
|
2566
|
+
const e = s(this, Qt).current().get(t.id);
|
|
2567
2567
|
e || s(this, Te).debug("No subscription found", t), e == null || e.onUnsubscribe(t);
|
|
2568
2568
|
}
|
|
2569
2569
|
break;
|
|
2570
2570
|
case y.AnnounceOk:
|
|
2571
2571
|
{
|
|
2572
|
-
const e = s(this,
|
|
2572
|
+
const e = s(this, Jt).current().get(t.namespace.join("/"));
|
|
2573
2573
|
e || s(this, Te).debug("No announcement found", t), e == null || e.state.onOk(t);
|
|
2574
2574
|
}
|
|
2575
2575
|
break;
|
|
2576
2576
|
case y.AnnounceError:
|
|
2577
2577
|
{
|
|
2578
|
-
const e = s(this,
|
|
2578
|
+
const e = s(this, Jt).current().get(t.namespace.join("/"));
|
|
2579
2579
|
e || s(this, Te).debug("No announcement found", t), e == null || e.state.onError(t);
|
|
2580
2580
|
}
|
|
2581
2581
|
break;
|
|
@@ -2583,15 +2583,15 @@ class ya {
|
|
|
2583
2583
|
});
|
|
2584
2584
|
}
|
|
2585
2585
|
}
|
|
2586
|
-
oa = ue(null),
|
|
2586
|
+
oa = ue(null), Ds = new WeakMap(), cr = new WeakMap(), Os = new WeakMap(), Te = new WeakMap(), Jt = new WeakMap(), Qt = new WeakMap(), qt = new WeakMap(), H(oa, 1, "announce", no, ya), Ht(oa, ya);
|
|
2587
2587
|
function Pu(r, t) {
|
|
2588
|
-
const e = new
|
|
2588
|
+
const e = new Sn(t), [i, n] = xa(100), a = new Ru(e, i), c = new nc(r, e, n);
|
|
2589
2589
|
return [a, c];
|
|
2590
2590
|
}
|
|
2591
2591
|
var Ae;
|
|
2592
2592
|
class Ru {
|
|
2593
2593
|
constructor(t, e) {
|
|
2594
|
-
|
|
2594
|
+
d(this, "state");
|
|
2595
2595
|
o(this, Ae);
|
|
2596
2596
|
this.state = t, u(this, Ae, e);
|
|
2597
2597
|
}
|
|
@@ -2613,31 +2613,31 @@ class Ru {
|
|
|
2613
2613
|
}
|
|
2614
2614
|
}
|
|
2615
2615
|
Ae = new WeakMap();
|
|
2616
|
-
var ao,
|
|
2616
|
+
var ao, Vs, N, Cs, Bs, ca, xs, ui;
|
|
2617
2617
|
class nc {
|
|
2618
2618
|
constructor(t, e, i) {
|
|
2619
2619
|
he(ca, 5, this);
|
|
2620
|
-
o(this,
|
|
2621
|
-
o(this, Os);
|
|
2622
|
-
o(this, G);
|
|
2620
|
+
o(this, xs);
|
|
2623
2621
|
o(this, Vs);
|
|
2624
|
-
o(this,
|
|
2625
|
-
|
|
2622
|
+
o(this, N);
|
|
2623
|
+
o(this, Cs);
|
|
2624
|
+
o(this, Bs, new V());
|
|
2625
|
+
u(this, Vs, t), u(this, N, e), u(this, Cs, i);
|
|
2626
2626
|
}
|
|
2627
2627
|
get id() {
|
|
2628
|
-
return s(this,
|
|
2628
|
+
return s(this, N).subscribe.id;
|
|
2629
2629
|
}
|
|
2630
2630
|
get trackAlias() {
|
|
2631
|
-
return s(this,
|
|
2631
|
+
return s(this, N).subscribe.trackAlias;
|
|
2632
2632
|
}
|
|
2633
2633
|
get name() {
|
|
2634
|
-
return s(this,
|
|
2634
|
+
return s(this, N).subscribe.name;
|
|
2635
2635
|
}
|
|
2636
2636
|
range() {
|
|
2637
|
-
return s(this,
|
|
2637
|
+
return s(this, N).range();
|
|
2638
2638
|
}
|
|
2639
2639
|
expiryNotification() {
|
|
2640
|
-
return s(this,
|
|
2640
|
+
return s(this, N).expiryNotification();
|
|
2641
2641
|
}
|
|
2642
2642
|
/**
|
|
2643
2643
|
* Update the subscription range
|
|
@@ -2648,60 +2648,60 @@ class nc {
|
|
|
2648
2648
|
return h(this, null, function* () {
|
|
2649
2649
|
const i = {
|
|
2650
2650
|
type: y.SubscribeUpdate,
|
|
2651
|
-
id: s(this,
|
|
2651
|
+
id: s(this, N).subscribe.id,
|
|
2652
2652
|
start: { group: t, object: k(0) },
|
|
2653
2653
|
end: { group: e + k(1), object: k(0) },
|
|
2654
2654
|
params: /* @__PURE__ */ new Map(),
|
|
2655
2655
|
subscriberPriority: 0
|
|
2656
2656
|
};
|
|
2657
|
-
s(this,
|
|
2657
|
+
s(this, N).onUpdate(i), yield s(this, Vs).push(i);
|
|
2658
2658
|
});
|
|
2659
2659
|
}
|
|
2660
2660
|
unsubscribe() {
|
|
2661
2661
|
return h(this, null, function* () {
|
|
2662
|
-
const t = { type: y.Unsubscribe, id: s(this,
|
|
2663
|
-
s(this,
|
|
2662
|
+
const t = { type: y.Unsubscribe, id: s(this, N).subscribe.id };
|
|
2663
|
+
s(this, N).onUnsubscribe(t), yield s(this, Vs).push(t);
|
|
2664
2664
|
});
|
|
2665
2665
|
}
|
|
2666
2666
|
/// Closes the object reader so any pending readData calls are resolved
|
|
2667
2667
|
close() {
|
|
2668
2668
|
var t, e;
|
|
2669
|
-
return s(this,
|
|
2669
|
+
return s(this, Bs).resolve(), (e = (t = s(this, Cs)).return) == null ? void 0 : e.call(t);
|
|
2670
2670
|
}
|
|
2671
2671
|
/// Closed is resolved when the subscription has been fully consumed which means no more objects will be available
|
|
2672
2672
|
closed() {
|
|
2673
|
-
return s(this,
|
|
2673
|
+
return s(this, Bs).promise;
|
|
2674
2674
|
}
|
|
2675
2675
|
/// Await this subscription to become done
|
|
2676
2676
|
/// Done does not mean that the subscription is closed,
|
|
2677
2677
|
/// it means that the server has confirmed our unsubscribe request
|
|
2678
2678
|
done() {
|
|
2679
|
-
return s(this,
|
|
2679
|
+
return s(this, N).done();
|
|
2680
2680
|
}
|
|
2681
2681
|
expiryState() {
|
|
2682
|
-
return s(this,
|
|
2682
|
+
return s(this, N).expiryState();
|
|
2683
2683
|
}
|
|
2684
2684
|
unsubscribed() {
|
|
2685
|
-
return s(this,
|
|
2685
|
+
return s(this, N).isUnsubscribed();
|
|
2686
2686
|
}
|
|
2687
2687
|
return() {
|
|
2688
2688
|
return h(this, null, function* () {
|
|
2689
|
-
return s(this,
|
|
2689
|
+
return s(this, Bs).resolve(), yield this.unsubscribe(), { done: !0, value: void 0 };
|
|
2690
2690
|
});
|
|
2691
2691
|
}
|
|
2692
2692
|
groups() {
|
|
2693
|
-
return
|
|
2693
|
+
return Pt(this, null, function* () {
|
|
2694
2694
|
var t, e;
|
|
2695
2695
|
try {
|
|
2696
|
-
for (var g = C(s(this,
|
|
2697
|
-
var
|
|
2696
|
+
for (var g = C(s(this, Cs)), E, z, _; E = !(z = yield new O(g.next())).done; E = !1) {
|
|
2697
|
+
var l = z.value;
|
|
2698
2698
|
var w = [];
|
|
2699
2699
|
try {
|
|
2700
|
-
const D = nt(w,
|
|
2700
|
+
const D = nt(w, l, !0);
|
|
2701
2701
|
try {
|
|
2702
2702
|
for (var i = C(D.groups()), n, a, c; n = !(a = yield new O(i.next())).done; n = !1) {
|
|
2703
2703
|
const S = a.value;
|
|
2704
|
-
const W = (t = s(this,
|
|
2704
|
+
const W = (t = s(this, N).range()) == null ? void 0 : t.startGroup, v = (e = s(this, N).range()) == null ? void 0 : e.endGroup;
|
|
2705
2705
|
if (W && S.groupId() < W)
|
|
2706
2706
|
return { done: !0, value: void 0 };
|
|
2707
2707
|
if (v && S.groupId() > v)
|
|
@@ -2744,10 +2744,10 @@ class nc {
|
|
|
2744
2744
|
* @returns the next object from the subscription
|
|
2745
2745
|
*/
|
|
2746
2746
|
objects() {
|
|
2747
|
-
return
|
|
2747
|
+
return Pt(this, null, function* () {
|
|
2748
2748
|
try {
|
|
2749
|
-
for (var a = C(this.groups()), c,
|
|
2750
|
-
const p =
|
|
2749
|
+
for (var a = C(this.groups()), c, l, w; c = !(l = yield new O(a.next())).done; c = !1) {
|
|
2750
|
+
const p = l.value;
|
|
2751
2751
|
try {
|
|
2752
2752
|
for (var t = C(p), e, i, n; e = !(i = yield new O(t.next())).done; e = !1) {
|
|
2753
2753
|
const m = i.value;
|
|
@@ -2764,11 +2764,11 @@ class nc {
|
|
|
2764
2764
|
}
|
|
2765
2765
|
}
|
|
2766
2766
|
}
|
|
2767
|
-
} catch (
|
|
2768
|
-
w = [
|
|
2767
|
+
} catch (l) {
|
|
2768
|
+
w = [l];
|
|
2769
2769
|
} finally {
|
|
2770
2770
|
try {
|
|
2771
|
-
c && (
|
|
2771
|
+
c && (l = a.return) && (yield new O(l.call(a)));
|
|
2772
2772
|
} finally {
|
|
2773
2773
|
if (w)
|
|
2774
2774
|
throw w[0];
|
|
@@ -2776,39 +2776,39 @@ class nc {
|
|
|
2776
2776
|
}
|
|
2777
2777
|
});
|
|
2778
2778
|
}
|
|
2779
|
-
[(ao = [q({ context: "SubscriptionConsumer", enter: "info" })],
|
|
2780
|
-
return f(this,
|
|
2779
|
+
[(ao = [q({ context: "SubscriptionConsumer", enter: "info" })], Bt())]() {
|
|
2780
|
+
return f(this, xs, ui).call(this);
|
|
2781
2781
|
}
|
|
2782
2782
|
[Symbol.asyncDispose]() {
|
|
2783
|
-
return f(this,
|
|
2783
|
+
return f(this, xs, ui).call(this);
|
|
2784
2784
|
}
|
|
2785
2785
|
}
|
|
2786
|
-
ca = ue(null),
|
|
2786
|
+
ca = ue(null), Vs = new WeakMap(), N = new WeakMap(), Cs = new WeakMap(), Bs = new WeakMap(), xs = new WeakSet(), ui = function() {
|
|
2787
2787
|
return h(this, null, function* () {
|
|
2788
2788
|
return yield this.close(), this.unsubscribe();
|
|
2789
2789
|
});
|
|
2790
|
-
},
|
|
2790
|
+
}, ui = H(ca, 17, "#dispose", ao, xs, ui), Ht(ca, nc);
|
|
2791
2791
|
const ju = 2e3;
|
|
2792
|
-
var oo, co, uo, ho, Nt, st, De, Oe, Ke,
|
|
2792
|
+
var oo, co, uo, ho, Nt, st, De, Oe, Ke, Ct, Kr, qe;
|
|
2793
2793
|
ho = [q({ context: "Session", return: "debug" })], uo = [q({ context: "Session", enter: "info", error: "error" })], co = [q({ context: "Session", enter: "debug" })], oo = [q({ context: "Session", enter: "debug" })];
|
|
2794
|
-
class
|
|
2794
|
+
class Zr {
|
|
2795
2795
|
constructor(t, e) {
|
|
2796
2796
|
he(Ke, 5, this);
|
|
2797
|
-
o(this,
|
|
2797
|
+
o(this, Ct);
|
|
2798
2798
|
// The owner session of the subscriber
|
|
2799
2799
|
o(this, Nt);
|
|
2800
2800
|
// The next subscribe id
|
|
2801
|
-
|
|
2801
|
+
d(this, "nextSubscribeId", k(0));
|
|
2802
2802
|
// The active subscriptions
|
|
2803
2803
|
o(this, st, new Y(/* @__PURE__ */ new Map()));
|
|
2804
2804
|
o(this, De);
|
|
2805
2805
|
o(this, Oe, rt.get().createContext("Subscriber"));
|
|
2806
|
-
u(this, Nt, t), u(this, De, e), f(this,
|
|
2806
|
+
u(this, Nt, t), u(this, De, e), f(this, Ct, Kr).call(this).catch(A);
|
|
2807
2807
|
}
|
|
2808
2808
|
subscribe(t, e) {
|
|
2809
2809
|
return h(this, null, function* () {
|
|
2810
2810
|
const i = this.nextSubscribeId++, n = /* @__PURE__ */ new Map(), a = s(this, Nt).authToken();
|
|
2811
|
-
a && n.set(
|
|
2811
|
+
a && n.set(kn, { type: kn, payload: new TextEncoder().encode(a) });
|
|
2812
2812
|
const c = {
|
|
2813
2813
|
type: y.Subscribe,
|
|
2814
2814
|
namespace: t,
|
|
@@ -2819,10 +2819,10 @@ class Yr {
|
|
|
2819
2819
|
subscriberPriority: e.priority,
|
|
2820
2820
|
filterType: e.filterType,
|
|
2821
2821
|
params: n
|
|
2822
|
-
}, [
|
|
2823
|
-
if (s(this, st).update((m) => m.set(i,
|
|
2822
|
+
}, [l, w] = Pu(s(this, De), c);
|
|
2823
|
+
if (s(this, st).update((m) => m.set(i, l)), yield s(this, De).push(c), !(yield Promise.race([l.state.ok(), s(this, Nt).closed()])))
|
|
2824
2824
|
throw new Error("Session closed");
|
|
2825
|
-
return w.closed().then(() => Promise.race([Kn(ju), this.closed()])).then(() => f(this,
|
|
2825
|
+
return w.closed().then(() => Promise.race([Kn(ju), this.closed()])).then(() => f(this, Ct, qe).call(this, w.id)).catch(() => f(this, Ct, qe).call(this, w.id)), w;
|
|
2826
2826
|
});
|
|
2827
2827
|
}
|
|
2828
2828
|
closed() {
|
|
@@ -2852,7 +2852,7 @@ class Yr {
|
|
|
2852
2852
|
case y.SubscribeError:
|
|
2853
2853
|
{
|
|
2854
2854
|
const e = s(this, st).current().get(t.id);
|
|
2855
|
-
e || s(this, Oe).debug("No subscription found", t), e == null || e.onError(t), f(this,
|
|
2855
|
+
e || s(this, Oe).debug("No subscription found", t), e == null || e.onError(t), f(this, Ct, qe).call(this, t.id);
|
|
2856
2856
|
}
|
|
2857
2857
|
break;
|
|
2858
2858
|
case y.SubscribeDone:
|
|
@@ -2878,12 +2878,12 @@ class Yr {
|
|
|
2878
2878
|
s(this, st).current().forEach((t) => t.close()), s(this, st).close();
|
|
2879
2879
|
}
|
|
2880
2880
|
}
|
|
2881
|
-
Ke = ue(null), Nt = new WeakMap(), st = new WeakMap(), De = new WeakMap(), Oe = new WeakMap(),
|
|
2881
|
+
Ke = ue(null), Nt = new WeakMap(), st = new WeakMap(), De = new WeakMap(), Oe = new WeakMap(), Ct = new WeakSet(), Kr = function() {
|
|
2882
2882
|
return h(this, null, function* () {
|
|
2883
2883
|
try {
|
|
2884
2884
|
for (var t = C(s(this, st)), e, i, n; e = !(i = yield t.next()).done; e = !1) {
|
|
2885
2885
|
const a = i.value;
|
|
2886
|
-
const c = [...a.values()].map((
|
|
2886
|
+
const c = [...a.values()].map((l) => l.state.subscribe);
|
|
2887
2887
|
s(this, Oe).debug("current subscriptions", c);
|
|
2888
2888
|
}
|
|
2889
2889
|
} catch (i) {
|
|
@@ -2899,30 +2899,30 @@ Ke = ue(null), Nt = new WeakMap(), st = new WeakMap(), De = new WeakMap(), Oe =
|
|
|
2899
2899
|
});
|
|
2900
2900
|
}, qe = function(t) {
|
|
2901
2901
|
s(this, st).isClosed() || s(this, st).update((e) => (e.delete(t), e));
|
|
2902
|
-
},
|
|
2903
|
-
var lo, wo, fo, po, bt,
|
|
2902
|
+
}, Kr = H(Ke, 17, "#observeChanges", ho, Ct, Kr), H(Ke, 1, "subscribe", uo, Zr), H(Ke, 1, "close", co, Zr), qe = H(Ke, 17, "#deleteSubscription", oo, Ct, qe), Ht(Ke, Zr);
|
|
2903
|
+
var lo, wo, fo, po, bt, ur, Ve, Ps, Rs, G, ac, oc, Je, Jr, Qr, qr, hi;
|
|
2904
2904
|
class Ra {
|
|
2905
2905
|
constructor(t, e) {
|
|
2906
2906
|
he(Je, 5, this);
|
|
2907
|
-
o(this,
|
|
2907
|
+
o(this, G);
|
|
2908
2908
|
// The underlying transport implementation
|
|
2909
2909
|
o(this, bt);
|
|
2910
2910
|
// The background "thread" running the background tasks
|
|
2911
|
-
o(this,
|
|
2911
|
+
o(this, ur);
|
|
2912
2912
|
// Outgoing messages
|
|
2913
2913
|
o(this, Ve);
|
|
2914
|
-
o(this,
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
o(this,
|
|
2914
|
+
o(this, Ps, rt.get().createContext("Session"));
|
|
2915
|
+
d(this, "subscriber");
|
|
2916
|
+
d(this, "publisher");
|
|
2917
|
+
o(this, Rs);
|
|
2918
2918
|
const [i, n] = xa(100);
|
|
2919
|
-
u(this, bt, t), u(this, Ve, n), this.subscriber = new
|
|
2919
|
+
u(this, bt, t), u(this, Ve, n), this.subscriber = new Zr(this, i), this.publisher = new ya(this, t, i), u(this, ur, f(this, G, oc).call(this)), u(this, Rs, new Y(e)), this.closed().then(() => this.close()).catch(A);
|
|
2920
2920
|
}
|
|
2921
2921
|
updateAuthToken(t) {
|
|
2922
|
-
s(this,
|
|
2922
|
+
s(this, Rs).update(t);
|
|
2923
2923
|
}
|
|
2924
2924
|
authToken() {
|
|
2925
|
-
return s(this,
|
|
2925
|
+
return s(this, Rs).current();
|
|
2926
2926
|
}
|
|
2927
2927
|
transportType() {
|
|
2928
2928
|
return s(this, bt).transportType();
|
|
@@ -2931,41 +2931,41 @@ class Ra {
|
|
|
2931
2931
|
return s(this, bt).url();
|
|
2932
2932
|
}
|
|
2933
2933
|
closed() {
|
|
2934
|
-
return s(this,
|
|
2934
|
+
return s(this, ur);
|
|
2935
2935
|
}
|
|
2936
2936
|
close() {
|
|
2937
2937
|
try {
|
|
2938
2938
|
this.subscriber.close(), this.publisher.close(), s(this, Ve).cancel("closing"), s(this, bt).close();
|
|
2939
2939
|
} catch (t) {
|
|
2940
|
-
s(this,
|
|
2940
|
+
s(this, Ps).warn("Error closing session", t);
|
|
2941
2941
|
}
|
|
2942
2942
|
}
|
|
2943
2943
|
[(po = [q({ context: "Session", return: "info", error: "error" })], fo = [q({ context: "Session", return: "info", error: "error" })], wo = [q({ context: "Session", return: "info", error: "error" })], lo = [q({ context: "Session", enter: "debug" })], So())]() {
|
|
2944
|
-
f(this,
|
|
2944
|
+
f(this, G, hi).call(this);
|
|
2945
2945
|
}
|
|
2946
2946
|
[Symbol.dispose]() {
|
|
2947
|
-
f(this,
|
|
2947
|
+
f(this, G, hi).call(this);
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
|
-
Je = ue(null), bt = new WeakMap(),
|
|
2950
|
+
Je = ue(null), bt = new WeakMap(), ur = new WeakMap(), Ve = new WeakMap(), Ps = new WeakMap(), Rs = new WeakMap(), G = new WeakSet(), ac = function(t) {
|
|
2951
2951
|
return h(this, null, function* () {
|
|
2952
2952
|
var e, i;
|
|
2953
|
-
switch (s(this,
|
|
2953
|
+
switch (s(this, Ps).debug("received message", t), yield (e = this.subscriber) == null ? void 0 : e.onMessage(t), yield (i = this.publisher) == null ? void 0 : i.onMessage(t), t.type) {
|
|
2954
2954
|
case y.Goaway:
|
|
2955
2955
|
break;
|
|
2956
2956
|
}
|
|
2957
2957
|
});
|
|
2958
2958
|
}, oc = function() {
|
|
2959
2959
|
return h(this, null, function* () {
|
|
2960
|
-
return (yield Promise.all([f(this,
|
|
2960
|
+
return (yield Promise.all([f(this, G, Qr).call(this), f(this, G, qr).call(this), f(this, G, Jr).call(this)])).find((e) => e instanceof Error);
|
|
2961
2961
|
});
|
|
2962
|
-
},
|
|
2962
|
+
}, Jr = function() {
|
|
2963
2963
|
return h(this, null, function* () {
|
|
2964
2964
|
try {
|
|
2965
2965
|
try {
|
|
2966
2966
|
for (var t = C(s(this, Ve)), e, i, n; e = !(i = yield t.next()).done; e = !1) {
|
|
2967
2967
|
const a = i.value;
|
|
2968
|
-
s(this,
|
|
2968
|
+
s(this, Ps).debug("sending message", a), yield s(this, bt).writeMessage(a);
|
|
2969
2969
|
}
|
|
2970
2970
|
} catch (i) {
|
|
2971
2971
|
n = [i];
|
|
@@ -2981,7 +2981,7 @@ Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs =
|
|
|
2981
2981
|
return a;
|
|
2982
2982
|
}
|
|
2983
2983
|
});
|
|
2984
|
-
},
|
|
2984
|
+
}, Qr = function() {
|
|
2985
2985
|
return h(this, null, function* () {
|
|
2986
2986
|
yield s(this, bt).afterHandshake();
|
|
2987
2987
|
try {
|
|
@@ -2990,7 +2990,7 @@ Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs =
|
|
|
2990
2990
|
});
|
|
2991
2991
|
if (!t)
|
|
2992
2992
|
break;
|
|
2993
|
-
yield f(this,
|
|
2993
|
+
yield f(this, G, ac).call(this, t);
|
|
2994
2994
|
}
|
|
2995
2995
|
} catch (t) {
|
|
2996
2996
|
return t;
|
|
@@ -2998,7 +2998,7 @@ Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs =
|
|
|
2998
2998
|
s(this, Ve).cancel("closing");
|
|
2999
2999
|
}
|
|
3000
3000
|
});
|
|
3001
|
-
},
|
|
3001
|
+
}, qr = function() {
|
|
3002
3002
|
return h(this, null, function* () {
|
|
3003
3003
|
var t;
|
|
3004
3004
|
try {
|
|
@@ -3012,20 +3012,20 @@ Je = ue(null), bt = new WeakMap(), cr = new WeakMap(), Ve = new WeakMap(), xs =
|
|
|
3012
3012
|
return e;
|
|
3013
3013
|
}
|
|
3014
3014
|
});
|
|
3015
|
-
},
|
|
3015
|
+
}, hi = function() {
|
|
3016
3016
|
this.close();
|
|
3017
|
-
},
|
|
3018
|
-
const
|
|
3019
|
-
var ut,
|
|
3020
|
-
class
|
|
3017
|
+
}, Jr = H(Je, 17, "#runOutgoingMessages", po, G, Jr), Qr = H(Je, 17, "#runControl", fo, G, Qr), qr = H(Je, 17, "#runObjects", wo, G, qr), hi = H(Je, 17, "#dispose", lo, G, hi), Ht(Je, Ra);
|
|
3018
|
+
const Gu = 128;
|
|
3019
|
+
var ut, hr, Ce, js, dr, M, we, fe;
|
|
3020
|
+
class Nu {
|
|
3021
3021
|
constructor(t, e, i) {
|
|
3022
3022
|
o(this, M);
|
|
3023
3023
|
o(this, ut);
|
|
3024
|
-
o(this, ur);
|
|
3025
|
-
o(this, Ce, !0);
|
|
3026
|
-
o(this, Rs, !1);
|
|
3027
3024
|
o(this, hr);
|
|
3028
|
-
|
|
3025
|
+
o(this, Ce, !0);
|
|
3026
|
+
o(this, js, !1);
|
|
3027
|
+
o(this, dr);
|
|
3028
|
+
u(this, ut, t), u(this, hr, e), u(this, dr, i);
|
|
3029
3029
|
}
|
|
3030
3030
|
writeUnsigned8(t) {
|
|
3031
3031
|
return h(this, null, function* () {
|
|
@@ -3059,68 +3059,68 @@ class Gu {
|
|
|
3059
3059
|
}
|
|
3060
3060
|
close() {
|
|
3061
3061
|
return h(this, null, function* () {
|
|
3062
|
-
s(this,
|
|
3062
|
+
s(this, js) || (u(this, Ce, !0), yield f(this, M, fe).call(this, !1), yield s(this, ut).flush(), u(this, js, !0), s(this, dr).call(this));
|
|
3063
3063
|
});
|
|
3064
3064
|
}
|
|
3065
3065
|
}
|
|
3066
|
-
ut = new WeakMap(),
|
|
3067
|
-
if (s(this,
|
|
3066
|
+
ut = new WeakMap(), hr = new WeakMap(), Ce = new WeakMap(), js = new WeakMap(), dr = new WeakMap(), M = new WeakSet(), we = function() {
|
|
3067
|
+
if (s(this, js))
|
|
3068
3068
|
throw new Error("Stream is closed");
|
|
3069
3069
|
}, fe = function(t = !0) {
|
|
3070
3070
|
if (s(this, Ce))
|
|
3071
|
-
return u(this, Ce, !1), s(this, ut).writeUnsigned8(s(this,
|
|
3071
|
+
return u(this, Ce, !1), s(this, ut).writeUnsigned8(s(this, hr) | (t ? Gu : 0));
|
|
3072
3072
|
};
|
|
3073
|
-
var
|
|
3073
|
+
var _t, te, Gs, Be, Lt, Ns, Ls, Pn, cc;
|
|
3074
3074
|
class Lu {
|
|
3075
3075
|
constructor(t, e) {
|
|
3076
3076
|
o(this, Pn);
|
|
3077
|
-
o(this, qt);
|
|
3078
3077
|
o(this, _t);
|
|
3079
|
-
o(this,
|
|
3078
|
+
o(this, te);
|
|
3079
|
+
o(this, Gs);
|
|
3080
3080
|
o(this, Be);
|
|
3081
|
-
o(this,
|
|
3081
|
+
o(this, Lt, /* @__PURE__ */ new Map());
|
|
3082
3082
|
o(this, Ns, rt.get().createContext("WebSocketConnection"));
|
|
3083
|
-
o(this,
|
|
3084
|
-
u(this,
|
|
3085
|
-
s(this,
|
|
3083
|
+
o(this, Ls, new Set(new Array(128).fill(0).map((t, e) => e + 1)));
|
|
3084
|
+
u(this, _t, t), u(this, te, e), u(this, Gs, new ReadableStream(new Qc(t))), s(this, _t).addEventListener("close", () => {
|
|
3085
|
+
s(this, Lt).forEach((i) => i.close());
|
|
3086
3086
|
});
|
|
3087
3087
|
}
|
|
3088
3088
|
openSendStream() {
|
|
3089
|
-
const t = s(this,
|
|
3089
|
+
const t = s(this, Ls).values().next().value;
|
|
3090
3090
|
if (!t)
|
|
3091
3091
|
throw new Error("No stream IDs available");
|
|
3092
|
-
return s(this,
|
|
3093
|
-
new
|
|
3092
|
+
return s(this, Ls).delete(t), Promise.resolve(
|
|
3093
|
+
new Nu(new Ci(s(this, _t)), t, () => f(this, Pn, cc).call(this, t))
|
|
3094
3094
|
);
|
|
3095
3095
|
}
|
|
3096
3096
|
transportType() {
|
|
3097
3097
|
return "websocket";
|
|
3098
3098
|
}
|
|
3099
3099
|
url() {
|
|
3100
|
-
return s(this,
|
|
3100
|
+
return s(this, _t).url;
|
|
3101
3101
|
}
|
|
3102
3102
|
afterHandshake() {
|
|
3103
|
-
return s(this,
|
|
3103
|
+
return s(this, te).postHandshake();
|
|
3104
3104
|
}
|
|
3105
3105
|
objectStream() {
|
|
3106
3106
|
return h(this, null, function* () {
|
|
3107
3107
|
var t;
|
|
3108
3108
|
for (; ; ) {
|
|
3109
|
-
u(this, Be, s(this,
|
|
3109
|
+
u(this, Be, s(this, Gs).getReader());
|
|
3110
3110
|
try {
|
|
3111
3111
|
const { value: e, done: i } = yield s(this, Be).read();
|
|
3112
3112
|
if (i)
|
|
3113
3113
|
return;
|
|
3114
3114
|
const [n, a, c] = e;
|
|
3115
|
-
if (s(this,
|
|
3116
|
-
const
|
|
3117
|
-
if (!
|
|
3115
|
+
if (s(this, Lt).has(k(a))) {
|
|
3116
|
+
const l = s(this, Lt).get(k(a));
|
|
3117
|
+
if (!l)
|
|
3118
3118
|
throw new Error("Stream not found");
|
|
3119
|
-
c.length > 0 && (yield
|
|
3119
|
+
c.length > 0 && (yield l.push(c)), n || (s(this, Ns).debug("Closing stream", { streamId: a }), l.close(), s(this, Lt).delete(k(a)));
|
|
3120
3120
|
} else {
|
|
3121
3121
|
let m;
|
|
3122
3122
|
s(this, Ns).debug("Creating new stream", { streamId: a });
|
|
3123
|
-
const [
|
|
3123
|
+
const [l, w] = xa(1e3), p = new ReadableStream({
|
|
3124
3124
|
pull(b) {
|
|
3125
3125
|
return h(this, null, function* () {
|
|
3126
3126
|
const I = yield w.pop();
|
|
@@ -3128,8 +3128,8 @@ class Lu {
|
|
|
3128
3128
|
});
|
|
3129
3129
|
}
|
|
3130
3130
|
});
|
|
3131
|
-
if (s(this,
|
|
3132
|
-
return yield Oo(new
|
|
3131
|
+
if (s(this, Lt).set(k(a), l), n || (s(this, Ns).debug("Closing new stream", { streamId: a }), yield p.cancel(), s(this, Lt).delete(k(a))), c.length > 0)
|
|
3132
|
+
return yield Oo(new gn(c, p), a);
|
|
3133
3133
|
}
|
|
3134
3134
|
} finally {
|
|
3135
3135
|
(t = s(this, Be)) == null || t.releaseLock();
|
|
@@ -3139,46 +3139,46 @@ class Lu {
|
|
|
3139
3139
|
}
|
|
3140
3140
|
close() {
|
|
3141
3141
|
var t;
|
|
3142
|
-
return s(this,
|
|
3142
|
+
return s(this, te).cancel().catch(A), s(this, Gs).cancel("closing").catch(A), (t = s(this, Be)) == null || t.cancel("closing").catch(A), s(this, _t).close();
|
|
3143
3143
|
}
|
|
3144
3144
|
closed() {
|
|
3145
3145
|
return Promise.resolve();
|
|
3146
3146
|
}
|
|
3147
3147
|
writeMessage(t) {
|
|
3148
3148
|
return h(this, null, function* () {
|
|
3149
|
-
yield s(this,
|
|
3149
|
+
yield s(this, te).write(t);
|
|
3150
3150
|
});
|
|
3151
3151
|
}
|
|
3152
3152
|
readMessage() {
|
|
3153
3153
|
return h(this, null, function* () {
|
|
3154
|
-
return s(this,
|
|
3154
|
+
return s(this, te).read();
|
|
3155
3155
|
});
|
|
3156
3156
|
}
|
|
3157
3157
|
}
|
|
3158
|
-
|
|
3158
|
+
_t = new WeakMap(), te = new WeakMap(), Gs = new WeakMap(), Be = new WeakMap(), Lt = new WeakMap(), Ns = new WeakMap(), Ls = new WeakMap(), Pn = new WeakSet(), /**
|
|
3159
3159
|
* Return a stream ID to the pool of available stream IDs
|
|
3160
3160
|
* @param streamId - The stream ID to return
|
|
3161
3161
|
*/
|
|
3162
3162
|
cc = function(t) {
|
|
3163
|
-
s(this,
|
|
3163
|
+
s(this, Ls).add(t);
|
|
3164
3164
|
};
|
|
3165
|
-
var
|
|
3165
|
+
var ee, xe, Pe, lr, wr, Rn, jn, uc;
|
|
3166
3166
|
class Fu {
|
|
3167
3167
|
constructor(t, e, i) {
|
|
3168
3168
|
o(this, jn);
|
|
3169
|
-
o(this,
|
|
3169
|
+
o(this, ee);
|
|
3170
3170
|
o(this, xe);
|
|
3171
3171
|
o(this, Pe, new Jn(100));
|
|
3172
|
-
o(this,
|
|
3173
|
-
o(this,
|
|
3172
|
+
o(this, lr);
|
|
3173
|
+
o(this, wr, 0);
|
|
3174
3174
|
o(this, Rn, rt.get().createContext("WebTransportConnection"));
|
|
3175
|
-
u(this,
|
|
3175
|
+
u(this, lr, i), u(this, ee, t), u(this, xe, e), f(this, jn, uc).call(this).catch((n) => {
|
|
3176
3176
|
s(this, Rn).debug("Incoming streams handling ended with error", n), s(this, Pe).close();
|
|
3177
3177
|
});
|
|
3178
3178
|
}
|
|
3179
3179
|
openSendStream() {
|
|
3180
3180
|
return h(this, null, function* () {
|
|
3181
|
-
const t = yield s(this,
|
|
3181
|
+
const t = yield s(this, ee).createUnidirectionalStream();
|
|
3182
3182
|
return new Vo(t);
|
|
3183
3183
|
});
|
|
3184
3184
|
}
|
|
@@ -3186,18 +3186,18 @@ class Fu {
|
|
|
3186
3186
|
return "webtransport";
|
|
3187
3187
|
}
|
|
3188
3188
|
url() {
|
|
3189
|
-
return s(this,
|
|
3189
|
+
return s(this, lr);
|
|
3190
3190
|
}
|
|
3191
3191
|
afterHandshake() {
|
|
3192
3192
|
return s(this, xe).postHandshake();
|
|
3193
3193
|
}
|
|
3194
3194
|
closed() {
|
|
3195
3195
|
return h(this, null, function* () {
|
|
3196
|
-
yield s(this,
|
|
3196
|
+
yield s(this, ee).closed;
|
|
3197
3197
|
});
|
|
3198
3198
|
}
|
|
3199
3199
|
close() {
|
|
3200
|
-
s(this,
|
|
3200
|
+
s(this, ee).close();
|
|
3201
3201
|
}
|
|
3202
3202
|
writeMessage(t) {
|
|
3203
3203
|
return h(this, null, function* () {
|
|
@@ -3215,17 +3215,17 @@ class Fu {
|
|
|
3215
3215
|
});
|
|
3216
3216
|
}
|
|
3217
3217
|
}
|
|
3218
|
-
|
|
3218
|
+
ee = new WeakMap(), xe = new WeakMap(), Pe = new WeakMap(), lr = new WeakMap(), wr = new WeakMap(), Rn = new WeakMap(), jn = new WeakSet(), uc = function() {
|
|
3219
3219
|
return h(this, null, function* () {
|
|
3220
|
-
const t = s(this,
|
|
3220
|
+
const t = s(this, ee).incomingUnidirectionalStreams.getReader();
|
|
3221
3221
|
for (; ; ) {
|
|
3222
3222
|
const { value: e, done: i } = yield t.read();
|
|
3223
3223
|
if (i) {
|
|
3224
3224
|
s(this, Pe).close();
|
|
3225
3225
|
return;
|
|
3226
3226
|
}
|
|
3227
|
-
const n = new
|
|
3228
|
-
yield s(this, Pe).push(Oo(n, s(this,
|
|
3227
|
+
const n = new gn(new Uint8Array(), e);
|
|
3228
|
+
yield s(this, Pe).push(Oo(n, s(this, wr))), ea(this, wr)._++;
|
|
3229
3229
|
}
|
|
3230
3230
|
});
|
|
3231
3231
|
};
|
|
@@ -3235,7 +3235,7 @@ function ia(r) {
|
|
|
3235
3235
|
t.binaryType = "arraybuffer", yield new Promise((a, c) => {
|
|
3236
3236
|
t.addEventListener("error", c, { once: !0 }), t.addEventListener("open", a, { once: !0 });
|
|
3237
3237
|
});
|
|
3238
|
-
const e =
|
|
3238
|
+
const e = vn.wrapWebsocket(t);
|
|
3239
3239
|
ic(e, r.role).catch(() => {
|
|
3240
3240
|
t.close();
|
|
3241
3241
|
});
|
|
@@ -3253,7 +3253,7 @@ function to(r) {
|
|
|
3253
3253
|
// serverCertificateHashes: [{ algorithm: "sha-256", value: hexBytes }],
|
|
3254
3254
|
});
|
|
3255
3255
|
yield Promise.race([i.ready, i.closed.then(() => Promise.reject(new Error("WebTransport closed")))]);
|
|
3256
|
-
const n = yield i.createBidirectionalStream(), a =
|
|
3256
|
+
const n = yield i.createBidirectionalStream(), a = vn.wrapWebTransport(n);
|
|
3257
3257
|
ic(a, r.role).catch(() => {
|
|
3258
3258
|
i.close();
|
|
3259
3259
|
});
|
|
@@ -3272,10 +3272,10 @@ function Wu(r) {
|
|
|
3272
3272
|
return ia(r);
|
|
3273
3273
|
});
|
|
3274
3274
|
}
|
|
3275
|
-
var
|
|
3276
|
-
class
|
|
3275
|
+
var Ft;
|
|
3276
|
+
class Mt {
|
|
3277
3277
|
constructor() {
|
|
3278
|
-
o(this,
|
|
3278
|
+
o(this, Ft, {
|
|
3279
3279
|
name: "",
|
|
3280
3280
|
priority: 0,
|
|
3281
3281
|
groupOrder: "descending",
|
|
@@ -3283,54 +3283,54 @@ class $t {
|
|
|
3283
3283
|
});
|
|
3284
3284
|
}
|
|
3285
3285
|
name(t) {
|
|
3286
|
-
return s(this,
|
|
3286
|
+
return s(this, Ft).name = t, this;
|
|
3287
3287
|
}
|
|
3288
3288
|
priority(t) {
|
|
3289
|
-
return s(this,
|
|
3289
|
+
return s(this, Ft).priority = t, this;
|
|
3290
3290
|
}
|
|
3291
3291
|
groupOrder(t) {
|
|
3292
|
-
return s(this,
|
|
3292
|
+
return s(this, Ft).groupOrder = t, this;
|
|
3293
3293
|
}
|
|
3294
3294
|
/**
|
|
3295
3295
|
* @param startGroup the group to start the subscription at
|
|
3296
3296
|
* @returns the builder
|
|
3297
3297
|
*/
|
|
3298
3298
|
startGroup(t) {
|
|
3299
|
-
return s(this,
|
|
3299
|
+
return s(this, Ft).filterType = {
|
|
3300
3300
|
type: "absolute-start",
|
|
3301
3301
|
start: { group: t, object: k(0) }
|
|
3302
3302
|
}, this;
|
|
3303
3303
|
}
|
|
3304
3304
|
range(t, e) {
|
|
3305
|
-
return s(this,
|
|
3305
|
+
return s(this, Ft).filterType = {
|
|
3306
3306
|
type: "absolute-range",
|
|
3307
3307
|
start: { group: t, object: k(0) },
|
|
3308
3308
|
end: { group: e, object: k(0) }
|
|
3309
3309
|
}, this;
|
|
3310
3310
|
}
|
|
3311
3311
|
build() {
|
|
3312
|
-
return s(this,
|
|
3312
|
+
return s(this, Ft);
|
|
3313
3313
|
}
|
|
3314
3314
|
}
|
|
3315
|
-
|
|
3316
|
-
var
|
|
3315
|
+
Ft = new WeakMap();
|
|
3316
|
+
var Fs, fr;
|
|
3317
3317
|
class hc {
|
|
3318
3318
|
constructor(t, e) {
|
|
3319
|
-
o(this,
|
|
3320
|
-
o(this,
|
|
3321
|
-
u(this,
|
|
3319
|
+
o(this, Fs);
|
|
3320
|
+
o(this, fr);
|
|
3321
|
+
u(this, Fs, t), u(this, fr, e);
|
|
3322
3322
|
}
|
|
3323
3323
|
subscribe(t) {
|
|
3324
|
-
return s(this,
|
|
3324
|
+
return s(this, Fs).subscribe(this.namespace(), t);
|
|
3325
3325
|
}
|
|
3326
3326
|
closed() {
|
|
3327
|
-
return s(this,
|
|
3327
|
+
return s(this, Fs).closed();
|
|
3328
3328
|
}
|
|
3329
3329
|
namespace() {
|
|
3330
|
-
return s(this,
|
|
3330
|
+
return s(this, fr).namespace;
|
|
3331
3331
|
}
|
|
3332
3332
|
}
|
|
3333
|
-
|
|
3333
|
+
Fs = new WeakMap(), fr = new WeakMap();
|
|
3334
3334
|
function $u(r, t) {
|
|
3335
3335
|
return ["com.vindral.moq", r];
|
|
3336
3336
|
}
|
|
@@ -3347,35 +3347,35 @@ function zu(r) {
|
|
|
3347
3347
|
const t = new TextDecoder().decode(r);
|
|
3348
3348
|
return JSON.parse(t);
|
|
3349
3349
|
}
|
|
3350
|
-
var it,
|
|
3351
|
-
const
|
|
3350
|
+
var it, Dt, Re, ht, pr, Gn, br, ga;
|
|
3351
|
+
const Ga = class Ga {
|
|
3352
3352
|
constructor(t, e) {
|
|
3353
|
-
o(this,
|
|
3353
|
+
o(this, br);
|
|
3354
3354
|
o(this, it);
|
|
3355
3355
|
// The largest group id seen so far - used to switch seamlessly between tracks
|
|
3356
|
-
o(this,
|
|
3356
|
+
o(this, Dt);
|
|
3357
3357
|
// We keep track of the most recent groups to ensure we haven't missed any due to re-ordering before we close subscriptions
|
|
3358
3358
|
o(this, Re, new Ba(100));
|
|
3359
3359
|
// This contains the unconsumed groups if this track has an absolute range
|
|
3360
3360
|
o(this, ht);
|
|
3361
|
-
o(this,
|
|
3362
|
-
o(this,
|
|
3361
|
+
o(this, pr);
|
|
3362
|
+
o(this, Gn, (t) => h(this, null, function* () {
|
|
3363
3363
|
if (!t)
|
|
3364
3364
|
return s(this, it).close();
|
|
3365
3365
|
if (s(this, ht))
|
|
3366
3366
|
return;
|
|
3367
3367
|
const e = s(this, Re).items().reduce((i, n) => i < n ? i : n, t);
|
|
3368
|
-
u(this, ht, f(this,
|
|
3368
|
+
u(this, ht, f(this, br, ga).call(this, e, t)), s(this, ht).size === 0 && (yield s(this, it).close());
|
|
3369
3369
|
}));
|
|
3370
|
-
u(this, it, t), u(this,
|
|
3370
|
+
u(this, it, t), u(this, Dt, e), t.done().then((i) => h(this, null, function* () {
|
|
3371
3371
|
var n;
|
|
3372
|
-
return s(this,
|
|
3373
|
-
})).catch(A), u(this,
|
|
3372
|
+
return s(this, Gn).call(this, (n = i.finalInfo) == null ? void 0 : n.group);
|
|
3373
|
+
})).catch(A), u(this, pr, t.groups());
|
|
3374
3374
|
}
|
|
3375
3375
|
static subscribe(t, e) {
|
|
3376
3376
|
return h(this, null, function* () {
|
|
3377
3377
|
const i = yield t.subscribe(e);
|
|
3378
|
-
return new
|
|
3378
|
+
return new Ga(i, void 0);
|
|
3379
3379
|
});
|
|
3380
3380
|
}
|
|
3381
3381
|
subscribeId() {
|
|
@@ -3385,7 +3385,7 @@ const Na = class Na {
|
|
|
3385
3385
|
return s(this, it).name;
|
|
3386
3386
|
}
|
|
3387
3387
|
largestGroupId() {
|
|
3388
|
-
return s(this,
|
|
3388
|
+
return s(this, Dt);
|
|
3389
3389
|
}
|
|
3390
3390
|
// The subscription needs renewal if it is still active and aren't finishing up the unconsumed group IDs.
|
|
3391
3391
|
// If we are just finishing up the unconsumed group IDs we assume we'll finish up before the expiry.
|
|
@@ -3401,7 +3401,7 @@ const Na = class Na {
|
|
|
3401
3401
|
}
|
|
3402
3402
|
update(t, e) {
|
|
3403
3403
|
return h(this, null, function* () {
|
|
3404
|
-
return u(this, ht, f(this,
|
|
3404
|
+
return u(this, ht, f(this, br, ga).call(this, t, e)), s(this, ht).size === 0 && (yield s(this, it).close()), s(this, it).update(t, e);
|
|
3405
3405
|
});
|
|
3406
3406
|
}
|
|
3407
3407
|
unsubscribe() {
|
|
@@ -3412,11 +3412,11 @@ const Na = class Na {
|
|
|
3412
3412
|
var i;
|
|
3413
3413
|
if (s(this, ht) && s(this, ht).size === 0)
|
|
3414
3414
|
return { done: !0, value: void 0 };
|
|
3415
|
-
const t = yield s(this,
|
|
3415
|
+
const t = yield s(this, pr).next();
|
|
3416
3416
|
if (t.done)
|
|
3417
3417
|
return t;
|
|
3418
3418
|
const e = t.value.groupId();
|
|
3419
|
-
return (i = s(this, ht)) == null || i.delete(e), s(this, Re).push(e), s(this,
|
|
3419
|
+
return (i = s(this, ht)) == null || i.delete(e), s(this, Re).push(e), s(this, Dt) || u(this, Dt, e), u(this, Dt, s(this, Dt) < e ? e : s(this, Dt)), t;
|
|
3420
3420
|
});
|
|
3421
3421
|
}
|
|
3422
3422
|
return() {
|
|
@@ -3426,7 +3426,7 @@ const Na = class Na {
|
|
|
3426
3426
|
return this;
|
|
3427
3427
|
}
|
|
3428
3428
|
};
|
|
3429
|
-
it = new WeakMap(),
|
|
3429
|
+
it = new WeakMap(), Dt = new WeakMap(), Re = new WeakMap(), ht = new WeakMap(), pr = new WeakMap(), Gn = new WeakMap(), br = new WeakSet(), ga = function(t, e) {
|
|
3430
3430
|
const i = /* @__PURE__ */ new Set();
|
|
3431
3431
|
for (let n = t; n <= e; n++)
|
|
3432
3432
|
i == null || i.add(n);
|
|
@@ -3434,88 +3434,88 @@ it = new WeakMap(), At = new WeakMap(), Re = new WeakMap(), ht = new WeakMap(),
|
|
|
3434
3434
|
i == null || i.delete(n);
|
|
3435
3435
|
}), i;
|
|
3436
3436
|
};
|
|
3437
|
-
let
|
|
3438
|
-
var
|
|
3439
|
-
const
|
|
3437
|
+
let Un = Ga;
|
|
3438
|
+
var mt, je, Wt, Ot, mr, ka, yr;
|
|
3439
|
+
const Na = class Na {
|
|
3440
3440
|
constructor(t) {
|
|
3441
|
-
o(this,
|
|
3441
|
+
o(this, mr);
|
|
3442
3442
|
// The current active subscription
|
|
3443
|
-
o(this,
|
|
3443
|
+
o(this, mt);
|
|
3444
3444
|
// The current group iterator - gets replaced by the next in #groups when it runs out
|
|
3445
3445
|
o(this, je);
|
|
3446
3446
|
// The next group iterators to switch to when the current one runs out
|
|
3447
|
-
o(this,
|
|
3448
|
-
o(this,
|
|
3449
|
-
o(this,
|
|
3447
|
+
o(this, Wt, new Jn(10));
|
|
3448
|
+
o(this, Ot);
|
|
3449
|
+
o(this, yr, (t, e) => h(this, null, function* () {
|
|
3450
3450
|
var b = [];
|
|
3451
3451
|
try {
|
|
3452
|
-
const i = nt(b, yield s(this,
|
|
3452
|
+
const i = nt(b, yield s(this, mt).lock());
|
|
3453
3453
|
const n = { subscribeId: i.value.subscribeId() };
|
|
3454
3454
|
if (!i.value.needsRenewal()) {
|
|
3455
|
-
s(this,
|
|
3455
|
+
s(this, Ot).debug("Subscription does not need renewal", n);
|
|
3456
3456
|
return;
|
|
3457
3457
|
}
|
|
3458
3458
|
const a = i.value.largestGroupId();
|
|
3459
3459
|
const c = a !== void 0;
|
|
3460
|
-
const
|
|
3460
|
+
const l = new Mt().name(e.name).priority(e.priority).groupOrder(e.groupOrder);
|
|
3461
3461
|
n.largestGroupId = a;
|
|
3462
|
-
s(this,
|
|
3462
|
+
s(this, Ot).debug("Renewing subscription", n);
|
|
3463
3463
|
switch (e.filterType.type) {
|
|
3464
3464
|
case "absolute-range":
|
|
3465
|
-
s(this,
|
|
3465
|
+
s(this, Ot).debug("Absolute range is not renewed", n);
|
|
3466
3466
|
return;
|
|
3467
3467
|
case "absolute-start":
|
|
3468
3468
|
case "latest-group":
|
|
3469
3469
|
case "latest-object":
|
|
3470
|
-
c &&
|
|
3470
|
+
c && l.startGroup(a + k(1));
|
|
3471
3471
|
break;
|
|
3472
3472
|
}
|
|
3473
|
-
const w =
|
|
3473
|
+
const w = l.build();
|
|
3474
3474
|
n.newTrack = w;
|
|
3475
3475
|
const [p] = yield Promise.all([
|
|
3476
3476
|
t.subscribe(w),
|
|
3477
3477
|
c ? i.value.update(a, a) : i.value.unsubscribe()
|
|
3478
3478
|
]);
|
|
3479
|
-
p.done().then(() => f(this,
|
|
3480
|
-
p.expiryNotification().then(() => s(this,
|
|
3481
|
-
const m = new
|
|
3479
|
+
p.done().then(() => f(this, mr, ka).call(this, p)).catch(A);
|
|
3480
|
+
p.expiryNotification().then(() => s(this, yr).call(this, t, w)).catch(A);
|
|
3481
|
+
const m = new Un(p, a);
|
|
3482
3482
|
i.value = m;
|
|
3483
|
-
yield s(this,
|
|
3484
|
-
s(this,
|
|
3483
|
+
yield s(this, Wt).push(m);
|
|
3484
|
+
s(this, Ot).info("Subscription renewed", n);
|
|
3485
3485
|
} catch (I) {
|
|
3486
3486
|
var g = I, E = !0;
|
|
3487
3487
|
} finally {
|
|
3488
3488
|
at(b, g, E);
|
|
3489
3489
|
}
|
|
3490
3490
|
}));
|
|
3491
|
-
u(this,
|
|
3491
|
+
u(this, mt, new Lc(t)), u(this, je, t), u(this, Ot, rt.get().createContext(`Renewable '${t.name()}'`));
|
|
3492
3492
|
}
|
|
3493
3493
|
static subscribe(t, e, i) {
|
|
3494
3494
|
return h(this, null, function* () {
|
|
3495
|
-
const n = yield t.subscribe(e), a = new
|
|
3495
|
+
const n = yield t.subscribe(e), a = new Na(new Un(n, i));
|
|
3496
3496
|
return n.done().then(() => {
|
|
3497
3497
|
var c;
|
|
3498
|
-
return f(c = a,
|
|
3498
|
+
return f(c = a, mr, ka).call(c, n);
|
|
3499
3499
|
}).catch(A), n.expiryNotification().then(() => {
|
|
3500
3500
|
var c;
|
|
3501
|
-
return s(c = a,
|
|
3501
|
+
return s(c = a, yr).call(c, t, e);
|
|
3502
3502
|
}).catch(A), a;
|
|
3503
3503
|
});
|
|
3504
3504
|
}
|
|
3505
3505
|
largestGroupId() {
|
|
3506
|
-
return s(this,
|
|
3506
|
+
return s(this, mt).unsafeValue().largestGroupId();
|
|
3507
3507
|
}
|
|
3508
3508
|
update(t, e) {
|
|
3509
3509
|
return h(this, null, function* () {
|
|
3510
3510
|
var n = [];
|
|
3511
3511
|
try {
|
|
3512
|
-
const i = nt(n, yield s(this,
|
|
3513
|
-
s(this,
|
|
3512
|
+
const i = nt(n, yield s(this, mt).lock());
|
|
3513
|
+
s(this, Wt).close();
|
|
3514
3514
|
return i.value.update(t, e);
|
|
3515
3515
|
} catch (a) {
|
|
3516
|
-
var c = a,
|
|
3516
|
+
var c = a, l = !0;
|
|
3517
3517
|
} finally {
|
|
3518
|
-
at(n, c,
|
|
3518
|
+
at(n, c, l);
|
|
3519
3519
|
}
|
|
3520
3520
|
});
|
|
3521
3521
|
}
|
|
@@ -3523,8 +3523,8 @@ const Ga = class Ga {
|
|
|
3523
3523
|
return h(this, null, function* () {
|
|
3524
3524
|
var i = [];
|
|
3525
3525
|
try {
|
|
3526
|
-
const e = nt(i, yield s(this,
|
|
3527
|
-
s(this,
|
|
3526
|
+
const e = nt(i, yield s(this, mt).lock());
|
|
3527
|
+
s(this, Wt).close();
|
|
3528
3528
|
return e.value.endOfTrack(t);
|
|
3529
3529
|
} catch (n) {
|
|
3530
3530
|
var a = n, c = !0;
|
|
@@ -3537,8 +3537,8 @@ const Ga = class Ga {
|
|
|
3537
3537
|
return h(this, null, function* () {
|
|
3538
3538
|
var e = [];
|
|
3539
3539
|
try {
|
|
3540
|
-
const t = nt(e, yield s(this,
|
|
3541
|
-
s(this,
|
|
3540
|
+
const t = nt(e, yield s(this, mt).lock());
|
|
3541
|
+
s(this, Wt).close();
|
|
3542
3542
|
return t.value.unsubscribe();
|
|
3543
3543
|
} catch (i) {
|
|
3544
3544
|
var n = i, a = !0;
|
|
@@ -3551,8 +3551,8 @@ const Ga = class Ga {
|
|
|
3551
3551
|
return h(this, null, function* () {
|
|
3552
3552
|
var e = [];
|
|
3553
3553
|
try {
|
|
3554
|
-
const t = nt(e, yield s(this,
|
|
3555
|
-
s(this,
|
|
3554
|
+
const t = nt(e, yield s(this, mt).lock());
|
|
3555
|
+
s(this, Wt).close();
|
|
3556
3556
|
return t.value.return();
|
|
3557
3557
|
} catch (i) {
|
|
3558
3558
|
var n = i, a = !0;
|
|
@@ -3567,7 +3567,7 @@ const Ga = class Ga {
|
|
|
3567
3567
|
const t = yield s(this, je).next();
|
|
3568
3568
|
if (t.done) {
|
|
3569
3569
|
yield (i = (e = s(this, je)).return) == null ? void 0 : i.call(e);
|
|
3570
|
-
const n = yield s(this,
|
|
3570
|
+
const n = yield s(this, Wt).pop();
|
|
3571
3571
|
if (n)
|
|
3572
3572
|
return u(this, je, n), this.next();
|
|
3573
3573
|
}
|
|
@@ -3578,9 +3578,9 @@ const Ga = class Ga {
|
|
|
3578
3578
|
return this;
|
|
3579
3579
|
}
|
|
3580
3580
|
objects() {
|
|
3581
|
-
return
|
|
3581
|
+
return Pt(this, null, function* () {
|
|
3582
3582
|
try {
|
|
3583
|
-
for (var
|
|
3583
|
+
for (var l = C(this), w, p, m; w = !(p = yield new O(l.next())).done; w = !1) {
|
|
3584
3584
|
var t = p.value;
|
|
3585
3585
|
var e = [];
|
|
3586
3586
|
try {
|
|
@@ -3597,7 +3597,7 @@ const Ga = class Ga {
|
|
|
3597
3597
|
m = [p];
|
|
3598
3598
|
} finally {
|
|
3599
3599
|
try {
|
|
3600
|
-
w && (p =
|
|
3600
|
+
w && (p = l.return) && (yield new O(p.call(l)));
|
|
3601
3601
|
} finally {
|
|
3602
3602
|
if (m)
|
|
3603
3603
|
throw m[0];
|
|
@@ -3606,14 +3606,21 @@ const Ga = class Ga {
|
|
|
3606
3606
|
});
|
|
3607
3607
|
}
|
|
3608
3608
|
};
|
|
3609
|
-
|
|
3609
|
+
mt = new WeakMap(), je = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), mr = new WeakSet(), ka = function(t) {
|
|
3610
3610
|
return h(this, null, function* () {
|
|
3611
3611
|
var e;
|
|
3612
|
-
if (
|
|
3613
|
-
|
|
3612
|
+
if (t.unsubscribed() || (e = t.range()) != null && e.endGroup) {
|
|
3613
|
+
s(this, Ot).info("Server initiated subscribe done but the subscription is already closing");
|
|
3614
|
+
return;
|
|
3615
|
+
}
|
|
3616
|
+
if (s(this, mt).unsafeValue().subscribeId() !== t.id) {
|
|
3617
|
+
s(this, Ot).info("subscribeId mismatch - the subscription already has been renewed");
|
|
3618
|
+
return;
|
|
3619
|
+
}
|
|
3620
|
+
return this.return();
|
|
3614
3621
|
});
|
|
3615
|
-
},
|
|
3616
|
-
let oe =
|
|
3622
|
+
}, yr = new WeakMap();
|
|
3623
|
+
let oe = Na;
|
|
3617
3624
|
const Hu = "catalog";
|
|
3618
3625
|
function eo(r) {
|
|
3619
3626
|
const t = zu(r.payload);
|
|
@@ -3621,25 +3628,25 @@ function eo(r) {
|
|
|
3621
3628
|
throw new Error("unexpected catalog type");
|
|
3622
3629
|
return t;
|
|
3623
3630
|
}
|
|
3624
|
-
var
|
|
3631
|
+
var Ge, gr, kr, Ir, Nn, dc;
|
|
3625
3632
|
const Ln = class Ln {
|
|
3626
3633
|
constructor(t, e, i) {
|
|
3627
|
-
o(this,
|
|
3628
|
-
o(this,
|
|
3629
|
-
o(this, yr);
|
|
3634
|
+
o(this, Nn);
|
|
3635
|
+
o(this, Ge);
|
|
3630
3636
|
o(this, gr);
|
|
3631
3637
|
o(this, kr);
|
|
3632
|
-
|
|
3638
|
+
o(this, Ir);
|
|
3639
|
+
u(this, gr, t), u(this, Ge, e), u(this, kr, i), u(this, Ir, f(this, Nn, dc).call(this));
|
|
3633
3640
|
}
|
|
3634
3641
|
catalog() {
|
|
3635
|
-
return s(this,
|
|
3642
|
+
return s(this, Ge);
|
|
3636
3643
|
}
|
|
3637
3644
|
closed() {
|
|
3638
|
-
return s(this,
|
|
3645
|
+
return s(this, Ir);
|
|
3639
3646
|
}
|
|
3640
3647
|
close() {
|
|
3641
3648
|
return h(this, null, function* () {
|
|
3642
|
-
return s(this,
|
|
3649
|
+
return s(this, Ge).close(), (yield s(this, gr).promise).unsubscribe();
|
|
3643
3650
|
});
|
|
3644
3651
|
}
|
|
3645
3652
|
static start(t, e) {
|
|
@@ -3647,7 +3654,7 @@ const Ln = class Ln {
|
|
|
3647
3654
|
const i = V.fromPromise(
|
|
3648
3655
|
oe.subscribe(
|
|
3649
3656
|
t,
|
|
3650
|
-
new
|
|
3657
|
+
new Mt().name(e.catalogName || Hu).groupOrder("ascending").build()
|
|
3651
3658
|
)
|
|
3652
3659
|
), n = V.fromPromise(i.promise.then((w) => w.objects()));
|
|
3653
3660
|
if (e.catalog)
|
|
@@ -3655,21 +3662,21 @@ const Ln = class Ln {
|
|
|
3655
3662
|
const c = yield (yield n.promise).next();
|
|
3656
3663
|
if (!c.value)
|
|
3657
3664
|
throw new Error("No catalog found");
|
|
3658
|
-
const
|
|
3659
|
-
return new Ln(i, new Y(
|
|
3665
|
+
const l = eo(c.value);
|
|
3666
|
+
return new Ln(i, new Y(l), n);
|
|
3660
3667
|
});
|
|
3661
3668
|
}
|
|
3662
3669
|
};
|
|
3663
|
-
|
|
3670
|
+
Ge = new WeakMap(), gr = new WeakMap(), kr = new WeakMap(), Ir = new WeakMap(), Nn = new WeakSet(), dc = function() {
|
|
3664
3671
|
return h(this, null, function* () {
|
|
3665
|
-
const t = yield s(this,
|
|
3672
|
+
const t = yield s(this, kr).promise;
|
|
3666
3673
|
try {
|
|
3667
3674
|
for (var e = C(t), i, n, a; i = !(n = yield e.next()).done; i = !1) {
|
|
3668
3675
|
const c = n.value;
|
|
3669
3676
|
if (c.objectStatus !== X.Normal)
|
|
3670
3677
|
continue;
|
|
3671
|
-
const
|
|
3672
|
-
s(this,
|
|
3678
|
+
const l = eo(c);
|
|
3679
|
+
s(this, Ge).update(l);
|
|
3673
3680
|
}
|
|
3674
3681
|
} catch (n) {
|
|
3675
3682
|
a = [n];
|
|
@@ -3684,39 +3691,39 @@ Ne = new WeakMap(), yr = new WeakMap(), gr = new WeakMap(), kr = new WeakMap(),
|
|
|
3684
3691
|
});
|
|
3685
3692
|
};
|
|
3686
3693
|
let Ia = Ln;
|
|
3687
|
-
var
|
|
3694
|
+
var vr, Ws, Sr, $s, Ur, va;
|
|
3688
3695
|
class Xu {
|
|
3689
3696
|
constructor(t, e, i, n) {
|
|
3690
|
-
o(this,
|
|
3691
|
-
o(this, Ir);
|
|
3692
|
-
o(this, Fs);
|
|
3697
|
+
o(this, Ur);
|
|
3693
3698
|
o(this, vr);
|
|
3694
|
-
|
|
3695
|
-
o(this,
|
|
3696
|
-
|
|
3699
|
+
o(this, Ws);
|
|
3700
|
+
o(this, Sr);
|
|
3701
|
+
d(this, "track");
|
|
3702
|
+
o(this, $s, rt.get().createContext("CmafGroup"));
|
|
3703
|
+
this.track = n, u(this, vr, i), u(this, Ws, t), u(this, Sr, e);
|
|
3697
3704
|
}
|
|
3698
3705
|
[Symbol.asyncIterator]() {
|
|
3699
|
-
return
|
|
3706
|
+
return Pt(this, null, function* () {
|
|
3700
3707
|
const t = { name: this.track.trackObject.name, namespace: this.track.namespace };
|
|
3701
|
-
s(this,
|
|
3708
|
+
s(this, $s).debug("start", zt({}, t));
|
|
3702
3709
|
try {
|
|
3703
|
-
for (var e = C(s(this,
|
|
3710
|
+
for (var e = C(s(this, Ws)), i, n, a; i = !(n = yield new O(e.next())).done; i = !1) {
|
|
3704
3711
|
const c = n.value;
|
|
3705
3712
|
if (c.objectStatus === X.EndOfTrackAndGroup && (yield new O(this.track.endOfTrack(c.groupId))), c.objectStatus !== X.Normal)
|
|
3706
3713
|
continue;
|
|
3707
|
-
const
|
|
3708
|
-
|
|
3714
|
+
const l = s(this, Sr).createFragment(c.payload), w = l.timescale(), p = l.baseMediaDecodeTime() / w * 1e3, m = l.duration() / w * 1e3, b = p + m, I = s(this, vr) / 1e3 * w;
|
|
3715
|
+
l.updateBaseMediaDecodeTime(l.baseMediaDecodeTime() - I);
|
|
3709
3716
|
const g = this.track.timestampRange();
|
|
3710
3717
|
if (g && p >= g[1])
|
|
3711
3718
|
break;
|
|
3712
|
-
s(this,
|
|
3719
|
+
s(this, $s).debug("fragment", zr(zt({}, t), {
|
|
3713
3720
|
startTime: p,
|
|
3714
3721
|
endTime: b,
|
|
3715
3722
|
subscribeId: c.subscribeId,
|
|
3716
3723
|
groupId: c.groupId,
|
|
3717
3724
|
objectId: c.objectId,
|
|
3718
3725
|
streamId: c.streamId
|
|
3719
|
-
})), yield [c.groupId,
|
|
3726
|
+
})), yield [c.groupId, l];
|
|
3720
3727
|
}
|
|
3721
3728
|
} catch (n) {
|
|
3722
3729
|
a = [n];
|
|
@@ -3728,93 +3735,93 @@ class Xu {
|
|
|
3728
3735
|
throw a[0];
|
|
3729
3736
|
}
|
|
3730
3737
|
}
|
|
3731
|
-
s(this,
|
|
3738
|
+
s(this, $s).debug("end", zt({}, t));
|
|
3732
3739
|
});
|
|
3733
3740
|
}
|
|
3734
|
-
[
|
|
3735
|
-
return f(this,
|
|
3741
|
+
[Bt()]() {
|
|
3742
|
+
return f(this, Ur, va).call(this);
|
|
3736
3743
|
}
|
|
3737
3744
|
[Symbol.asyncDispose]() {
|
|
3738
|
-
return f(this,
|
|
3745
|
+
return f(this, Ur, va).call(this);
|
|
3739
3746
|
}
|
|
3740
3747
|
}
|
|
3741
|
-
|
|
3748
|
+
vr = new WeakMap(), Ws = new WeakMap(), Sr = new WeakMap(), $s = new WeakMap(), Ur = new WeakSet(), va = function() {
|
|
3742
3749
|
return h(this, null, function* () {
|
|
3743
3750
|
var t, e;
|
|
3744
|
-
return yield (e = (t = s(this,
|
|
3751
|
+
return yield (e = (t = s(this, Ws)).return) == null ? void 0 : e.call(t), Promise.resolve();
|
|
3745
3752
|
});
|
|
3746
3753
|
};
|
|
3747
|
-
var
|
|
3748
|
-
const
|
|
3754
|
+
var Er, Vt, Tr, Ar, Fn, lc;
|
|
3755
|
+
const rs = class rs {
|
|
3749
3756
|
constructor(t, e, i, n, a) {
|
|
3750
|
-
o(this, Ur);
|
|
3751
|
-
o(this, Ot);
|
|
3752
|
-
// A static offset that will be applied to all fragments
|
|
3753
3757
|
o(this, Er);
|
|
3754
|
-
|
|
3758
|
+
o(this, Vt);
|
|
3759
|
+
// A static offset that will be applied to all fragments
|
|
3755
3760
|
o(this, Tr);
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3761
|
+
// Stop consuming the track after we have passed thig timestamp
|
|
3762
|
+
o(this, Ar);
|
|
3763
|
+
d(this, "trackObject");
|
|
3764
|
+
d(this, "namespace");
|
|
3765
|
+
this.trackObject = t, this.namespace = e, u(this, Vt, i), u(this, Er, n), u(this, Tr, a);
|
|
3759
3766
|
}
|
|
3760
3767
|
static subscribe(t, e, i, n) {
|
|
3761
3768
|
return h(this, null, function* () {
|
|
3762
3769
|
var m;
|
|
3763
3770
|
if (e.format !== "cmaf")
|
|
3764
3771
|
throw new Error("format must be cmaf");
|
|
3765
|
-
const a = new
|
|
3772
|
+
const a = new Mt().name(e.name);
|
|
3766
3773
|
n && a.startGroup(n);
|
|
3767
3774
|
const c = a.build();
|
|
3768
3775
|
if (e.initTrack) {
|
|
3769
|
-
const b = new
|
|
3770
|
-
f(m =
|
|
3776
|
+
const b = new Mt().name(e.initTrack).build(), [I, g] = yield Promise.all([
|
|
3777
|
+
f(m = rs, Fn, lc).call(m, t, b),
|
|
3771
3778
|
oe.subscribe(t, c, n ? n - k(1) : void 0)
|
|
3772
3779
|
]), E = new qa(I);
|
|
3773
|
-
return new
|
|
3780
|
+
return new rs(e, t.namespace(), g, E, i);
|
|
3774
3781
|
}
|
|
3775
3782
|
Io(e.initData, "no init data found on track");
|
|
3776
|
-
const
|
|
3777
|
-
return new
|
|
3783
|
+
const l = vo(e.initData), w = new qa(new Uint8Array(l)), p = yield oe.subscribe(t, c, n ? n - k(1) : void 0);
|
|
3784
|
+
return new rs(e, t.namespace(), p, w, i);
|
|
3778
3785
|
});
|
|
3779
3786
|
}
|
|
3780
3787
|
largestGroupId() {
|
|
3781
|
-
return s(this,
|
|
3788
|
+
return s(this, Vt).largestGroupId();
|
|
3782
3789
|
}
|
|
3783
3790
|
stopAfterTimestampReached(t) {
|
|
3784
|
-
u(this,
|
|
3791
|
+
u(this, Ar, [0, t]);
|
|
3785
3792
|
}
|
|
3786
3793
|
timestampRange() {
|
|
3787
|
-
return s(this,
|
|
3794
|
+
return s(this, Ar);
|
|
3788
3795
|
}
|
|
3789
3796
|
endOfTrack(t) {
|
|
3790
|
-
return s(this,
|
|
3797
|
+
return s(this, Vt).endOfTrack(t);
|
|
3791
3798
|
}
|
|
3792
3799
|
update(t, e) {
|
|
3793
|
-
return s(this,
|
|
3800
|
+
return s(this, Vt).update(t, e);
|
|
3794
3801
|
}
|
|
3795
3802
|
unsubscribe() {
|
|
3796
3803
|
return h(this, null, function* () {
|
|
3797
|
-
return s(this,
|
|
3804
|
+
return s(this, Vt).unsubscribe();
|
|
3798
3805
|
});
|
|
3799
3806
|
}
|
|
3800
3807
|
next() {
|
|
3801
3808
|
return h(this, null, function* () {
|
|
3802
|
-
const t = yield s(this,
|
|
3809
|
+
const t = yield s(this, Vt).next();
|
|
3803
3810
|
return t.done ? t : {
|
|
3804
3811
|
done: !1,
|
|
3805
|
-
value: new Xu(t.value, s(this,
|
|
3812
|
+
value: new Xu(t.value, s(this, Er), s(this, Tr), this)
|
|
3806
3813
|
};
|
|
3807
3814
|
});
|
|
3808
3815
|
}
|
|
3809
3816
|
return() {
|
|
3810
3817
|
return h(this, null, function* () {
|
|
3811
|
-
return yield s(this,
|
|
3818
|
+
return yield s(this, Vt).return(), { done: !0, value: void 0 };
|
|
3812
3819
|
});
|
|
3813
3820
|
}
|
|
3814
3821
|
[Symbol.asyncIterator]() {
|
|
3815
3822
|
return this;
|
|
3816
3823
|
}
|
|
3817
|
-
[
|
|
3824
|
+
[Bt()]() {
|
|
3818
3825
|
return this.unsubscribe();
|
|
3819
3826
|
}
|
|
3820
3827
|
[Symbol.asyncDispose]() {
|
|
@@ -3823,7 +3830,7 @@ const is = class is {
|
|
|
3823
3830
|
});
|
|
3824
3831
|
}
|
|
3825
3832
|
};
|
|
3826
|
-
|
|
3833
|
+
Er = new WeakMap(), Vt = new WeakMap(), Tr = new WeakMap(), Ar = new WeakMap(), Fn = new WeakSet(), lc = function(t, e) {
|
|
3827
3834
|
return h(this, null, function* () {
|
|
3828
3835
|
var a = [];
|
|
3829
3836
|
try {
|
|
@@ -3834,33 +3841,33 @@ Ur = new WeakMap(), Ot = new WeakMap(), Er = new WeakMap(), Tr = new WeakMap(),
|
|
|
3834
3841
|
yield i.close();
|
|
3835
3842
|
return n.value.payload;
|
|
3836
3843
|
} catch (c) {
|
|
3837
|
-
var
|
|
3844
|
+
var l = c, w = !0;
|
|
3838
3845
|
} finally {
|
|
3839
|
-
var p = at(a,
|
|
3846
|
+
var p = at(a, l, w);
|
|
3840
3847
|
p && (yield p);
|
|
3841
3848
|
}
|
|
3842
3849
|
});
|
|
3843
|
-
}, o(
|
|
3844
|
-
let Sa =
|
|
3850
|
+
}, o(rs, Fn);
|
|
3851
|
+
let Sa = rs;
|
|
3845
3852
|
const so = 1e4, Yu = 3e4;
|
|
3846
|
-
var Wn, se,
|
|
3853
|
+
var Wn, se, Ne, Dr, Or, Vr, Ze, Ea, wc;
|
|
3847
3854
|
const La = class La {
|
|
3848
3855
|
constructor(t, e, i) {
|
|
3849
3856
|
o(this, Ze);
|
|
3850
3857
|
o(this, Wn, rt.get().createContext("Timeline"));
|
|
3851
3858
|
o(this, se, new Y([]));
|
|
3852
|
-
o(this,
|
|
3853
|
-
o(this, Ar);
|
|
3859
|
+
o(this, Ne);
|
|
3854
3860
|
o(this, Dr);
|
|
3855
3861
|
o(this, Or);
|
|
3856
|
-
|
|
3862
|
+
o(this, Vr);
|
|
3863
|
+
u(this, Dr, t), u(this, Or, i), u(this, Ne, e), u(this, Vr, f(this, Ze, Ea).call(this, s(this, Ne))), this.closed().finally(() => s(this, se).close()).catch(A);
|
|
3857
3864
|
}
|
|
3858
3865
|
closed() {
|
|
3859
|
-
return s(this,
|
|
3866
|
+
return s(this, Vr);
|
|
3860
3867
|
}
|
|
3861
3868
|
close() {
|
|
3862
3869
|
return h(this, null, function* () {
|
|
3863
|
-
return (yield s(this,
|
|
3870
|
+
return (yield s(this, Ne).promise).unsubscribe();
|
|
3864
3871
|
});
|
|
3865
3872
|
}
|
|
3866
3873
|
timeline() {
|
|
@@ -3876,7 +3883,7 @@ const La = class La {
|
|
|
3876
3883
|
}
|
|
3877
3884
|
static start(t, e) {
|
|
3878
3885
|
const i = V.fromPromise(
|
|
3879
|
-
oe.subscribe(t, new
|
|
3886
|
+
oe.subscribe(t, new Mt().name(e).groupOrder("ascending").build())
|
|
3880
3887
|
);
|
|
3881
3888
|
return new La(t, i, e);
|
|
3882
3889
|
}
|
|
@@ -3894,15 +3901,15 @@ const La = class La {
|
|
|
3894
3901
|
});
|
|
3895
3902
|
}
|
|
3896
3903
|
};
|
|
3897
|
-
Wn = new WeakMap(), se = new WeakMap(),
|
|
3904
|
+
Wn = new WeakMap(), se = new WeakMap(), Ne = new WeakMap(), Dr = new WeakMap(), Or = new WeakMap(), Vr = new WeakMap(), Ze = new WeakSet(), Ea = function(t) {
|
|
3898
3905
|
return h(this, null, function* () {
|
|
3899
3906
|
const e = yield t.promise;
|
|
3900
3907
|
try {
|
|
3901
3908
|
for (var g = C(e), E, z, _; E = !(z = yield g.next()).done; E = !1) {
|
|
3902
|
-
var
|
|
3909
|
+
var l = z.value;
|
|
3903
3910
|
var w = [];
|
|
3904
3911
|
try {
|
|
3905
|
-
const D = nt(w,
|
|
3912
|
+
const D = nt(w, l, !0);
|
|
3906
3913
|
try {
|
|
3907
3914
|
for (var i = C(D), n, a, c; n = !(a = yield i.next()).done; n = !1) {
|
|
3908
3915
|
const S = a.value;
|
|
@@ -3910,11 +3917,11 @@ Wn = new WeakMap(), se = new WeakMap(), Ge = new WeakMap(), Ar = new WeakMap(),
|
|
|
3910
3917
|
continue;
|
|
3911
3918
|
const W = Zu(S.payload);
|
|
3912
3919
|
s(this, se).update((v) => {
|
|
3913
|
-
var R,
|
|
3914
|
-
for (v.push(...W), v.sort((
|
|
3920
|
+
var R, ii;
|
|
3921
|
+
for (v.push(...W), v.sort((Fr, Wr) => Fr.wallclock - Wr.wallclock); v[0] && ((ii = (R = v[v.length - 1]) == null ? void 0 : R.wallclock) != null ? ii : 0) - v[0].wallclock > Yu; )
|
|
3915
3922
|
v.shift();
|
|
3916
3923
|
return v;
|
|
3917
|
-
}), e === s(this,
|
|
3924
|
+
}), e === s(this, Ne).resolved && S.groupId > k(0) && S.objectId == k(0) && f(this, Ze, wc).call(this, S.groupId).catch((v) => {
|
|
3918
3925
|
s(this, Wn).warn("backfill failed", v);
|
|
3919
3926
|
});
|
|
3920
3927
|
}
|
|
@@ -3953,8 +3960,8 @@ Wn = new WeakMap(), se = new WeakMap(), Ge = new WeakMap(), Ar = new WeakMap(),
|
|
|
3953
3960
|
return;
|
|
3954
3961
|
const c = V.fromPromise(
|
|
3955
3962
|
oe.subscribe(
|
|
3956
|
-
s(this,
|
|
3957
|
-
new
|
|
3963
|
+
s(this, Dr),
|
|
3964
|
+
new Mt().name(s(this, Or)).groupOrder("ascending").range(e, e).build()
|
|
3958
3965
|
)
|
|
3959
3966
|
);
|
|
3960
3967
|
return f(this, Ze, Ea).call(this, c);
|
|
@@ -3966,14 +3973,14 @@ function Zu(r) {
|
|
|
3966
3973
|
const t = new TextDecoder("utf-8").decode(r).split(`
|
|
3967
3974
|
`);
|
|
3968
3975
|
return (e = t[0]) != null && e.startsWith("MEDIA_PTS") && t.shift(), t.filter((i) => i.length > 0).map((i) => {
|
|
3969
|
-
const [n, a, c,
|
|
3970
|
-
if (!n || !
|
|
3976
|
+
const [n, a, c, l, w] = i.split(",");
|
|
3977
|
+
if (!n || !l)
|
|
3971
3978
|
throw new Error(`invalid timeline row: ${i}`);
|
|
3972
3979
|
return {
|
|
3973
3980
|
mediaPts: parseInt(n),
|
|
3974
3981
|
groupId: a ? parseInt(a) : void 0,
|
|
3975
3982
|
objectId: c ? parseInt(c) : void 0,
|
|
3976
|
-
wallclock: parseInt(
|
|
3983
|
+
wallclock: parseInt(l),
|
|
3977
3984
|
metadata: w
|
|
3978
3985
|
};
|
|
3979
3986
|
});
|
|
@@ -3981,22 +3988,22 @@ function Zu(r) {
|
|
|
3981
3988
|
function Ku(r) {
|
|
3982
3989
|
return typeof r.language == "string";
|
|
3983
3990
|
}
|
|
3984
|
-
var $n,
|
|
3991
|
+
var $n, Cr, ie, Ms;
|
|
3985
3992
|
const Fa = class Fa {
|
|
3986
3993
|
constructor(t, e, i, n, a) {
|
|
3987
3994
|
o(this, $n, new Cc());
|
|
3988
|
-
o(this,
|
|
3995
|
+
o(this, Cr);
|
|
3989
3996
|
o(this, ie);
|
|
3990
|
-
o(this,
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
u(this, ie, t), u(this,
|
|
3997
|
+
o(this, Ms, 0);
|
|
3998
|
+
d(this, "trackObject");
|
|
3999
|
+
d(this, "namespace");
|
|
4000
|
+
u(this, ie, t), u(this, Cr, e), this.trackObject = i, this.namespace = n, u(this, Ms, a);
|
|
3994
4001
|
}
|
|
3995
4002
|
static subscribe(t, e, i) {
|
|
3996
4003
|
return h(this, null, function* () {
|
|
3997
4004
|
if (!Ku(e))
|
|
3998
4005
|
throw new Error("track object language is required");
|
|
3999
|
-
const n = new
|
|
4006
|
+
const n = new Mt().name(e.name).build(), a = yield oe.subscribe(t, n), c = a.objects();
|
|
4000
4007
|
return new Fa(a, c, e, t.namespace(), i);
|
|
4001
4008
|
});
|
|
4002
4009
|
}
|
|
@@ -4012,12 +4019,12 @@ const Fa = class Fa {
|
|
|
4012
4019
|
next() {
|
|
4013
4020
|
return h(this, null, function* () {
|
|
4014
4021
|
for (; ; ) {
|
|
4015
|
-
const t = yield s(this,
|
|
4022
|
+
const t = yield s(this, Cr).next();
|
|
4016
4023
|
if (t.done)
|
|
4017
4024
|
return t;
|
|
4018
4025
|
if (t.value.objectStatus !== X.Normal)
|
|
4019
4026
|
continue;
|
|
4020
|
-
const e = new TextDecoder().decode(t.value.payload), i = s(this, $n).parse(e).map((a) => (a.startTime -= s(this,
|
|
4027
|
+
const e = new TextDecoder().decode(t.value.payload), i = s(this, $n).parse(e).map((a) => (a.startTime -= s(this, Ms) / 1e3, a.endTime -= s(this, Ms) / 1e3, a));
|
|
4021
4028
|
return {
|
|
4022
4029
|
done: !1,
|
|
4023
4030
|
value: { language: this.trackObject.language, cues: i }
|
|
@@ -4033,21 +4040,21 @@ const Fa = class Fa {
|
|
|
4033
4040
|
[Symbol.asyncIterator]() {
|
|
4034
4041
|
return this;
|
|
4035
4042
|
}
|
|
4036
|
-
[
|
|
4043
|
+
[Bt()]() {
|
|
4037
4044
|
return this.unsubscribe();
|
|
4038
4045
|
}
|
|
4039
4046
|
[Symbol.asyncDispose]() {
|
|
4040
4047
|
return this.unsubscribe();
|
|
4041
4048
|
}
|
|
4042
4049
|
};
|
|
4043
|
-
$n = new WeakMap(),
|
|
4050
|
+
$n = new WeakMap(), Cr = new WeakMap(), ie = new WeakMap(), Ms = new WeakMap();
|
|
4044
4051
|
let Ta = Fa;
|
|
4045
|
-
var bo, Le, Fe, We, re, ua,
|
|
4052
|
+
var bo, Le, Fe, We, re, ua, zs, _r;
|
|
4046
4053
|
bo = [q({ context: "Channel", enter: "info" })];
|
|
4047
|
-
const
|
|
4054
|
+
const ns = class ns {
|
|
4048
4055
|
constructor(t, e, i, n, a) {
|
|
4049
|
-
o(this,
|
|
4050
|
-
|
|
4056
|
+
o(this, zs);
|
|
4057
|
+
d(this, "namespace");
|
|
4051
4058
|
o(this, Le);
|
|
4052
4059
|
o(this, Fe);
|
|
4053
4060
|
o(this, We);
|
|
@@ -4060,7 +4067,7 @@ const rs = class rs {
|
|
|
4060
4067
|
Ua.start(i, "timeline"),
|
|
4061
4068
|
Ia.start(i, { catalog: e.catalog, namespace: e.namespace })
|
|
4062
4069
|
]);
|
|
4063
|
-
return new
|
|
4070
|
+
return new ns(i, n, a, e.namespace, 0);
|
|
4064
4071
|
});
|
|
4065
4072
|
}
|
|
4066
4073
|
closed() {
|
|
@@ -4085,13 +4092,13 @@ const rs = class rs {
|
|
|
4085
4092
|
const n = this.catalog().current().tracks.find(
|
|
4086
4093
|
(a) => a["com.vindral.variant_uid"] === t["com.vindral.variant_uid"]
|
|
4087
4094
|
);
|
|
4088
|
-
return f(this,
|
|
4095
|
+
return f(this, zs, _r).call(this, () => Sa.subscribe(s(this, Le), n != null ? n : t, s(this, re), e));
|
|
4089
4096
|
}
|
|
4090
4097
|
subscribeWebVttTrack(t) {
|
|
4091
|
-
return f(this,
|
|
4098
|
+
return f(this, zs, _r).call(this, () => Ta.subscribe(s(this, Le), t, s(this, re)));
|
|
4092
4099
|
}
|
|
4093
4100
|
subscribeTrack(t) {
|
|
4094
|
-
return f(this,
|
|
4101
|
+
return f(this, zs, _r).call(this, () => s(this, Le).subscribe(t));
|
|
4095
4102
|
}
|
|
4096
4103
|
/**
|
|
4097
4104
|
* Closes the channel subscriptions
|
|
@@ -4100,7 +4107,7 @@ const rs = class rs {
|
|
|
4100
4107
|
return Promise.all([s(this, We).close(), s(this, Fe).close()]);
|
|
4101
4108
|
}
|
|
4102
4109
|
};
|
|
4103
|
-
ua = ue(null), Le = new WeakMap(), Fe = new WeakMap(), We = new WeakMap(), re = new WeakMap(),
|
|
4110
|
+
ua = ue(null), Le = new WeakMap(), Fe = new WeakMap(), We = new WeakMap(), re = new WeakMap(), zs = new WeakSet(), _r = function(t) {
|
|
4104
4111
|
return h(this, null, function* () {
|
|
4105
4112
|
const [e, i] = this.catalog().value();
|
|
4106
4113
|
try {
|
|
@@ -4111,20 +4118,20 @@ ua = ue(null), Le = new WeakMap(), Fe = new WeakMap(), We = new WeakMap(), re =
|
|
|
4111
4118
|
throw n;
|
|
4112
4119
|
}
|
|
4113
4120
|
});
|
|
4114
|
-
}, H(ua, 9, "start", bo,
|
|
4115
|
-
let
|
|
4116
|
-
var $e,
|
|
4121
|
+
}, H(ua, 9, "start", bo, ns), Ht(ua, ns), he(ua, 3, ns);
|
|
4122
|
+
let En = ns;
|
|
4123
|
+
var $e, Br, Mn, fc;
|
|
4117
4124
|
const Wa = class Wa {
|
|
4118
4125
|
constructor(t) {
|
|
4119
4126
|
o(this, Mn);
|
|
4120
4127
|
o(this, $e);
|
|
4121
|
-
o(this,
|
|
4128
|
+
o(this, Br);
|
|
4122
4129
|
const [e, i] = t.value.value();
|
|
4123
4130
|
u(this, $e, {
|
|
4124
4131
|
createdAt: /* @__PURE__ */ new Date(),
|
|
4125
4132
|
wallclock: new Date(e.ntpTimestamp),
|
|
4126
4133
|
rtt: e.rtt
|
|
4127
|
-
}), u(this,
|
|
4134
|
+
}), u(this, Br, f(this, Mn, fc).call(this, t));
|
|
4128
4135
|
}
|
|
4129
4136
|
/**
|
|
4130
4137
|
* @returns returns the current wallclock time in milliseconds based on the ntp timestamp of the stats track + the elapsed time since the last stats track.
|
|
@@ -4134,13 +4141,13 @@ const Wa = class Wa {
|
|
|
4134
4141
|
return s(this, $e).wallclock.getTime() + e;
|
|
4135
4142
|
}
|
|
4136
4143
|
closed() {
|
|
4137
|
-
return s(this,
|
|
4144
|
+
return s(this, Br);
|
|
4138
4145
|
}
|
|
4139
4146
|
static start(t) {
|
|
4140
4147
|
return new Wa(t);
|
|
4141
4148
|
}
|
|
4142
4149
|
};
|
|
4143
|
-
$e = new WeakMap(),
|
|
4150
|
+
$e = new WeakMap(), Br = new WeakMap(), Mn = new WeakSet(), fc = function(t) {
|
|
4144
4151
|
return h(this, null, function* () {
|
|
4145
4152
|
try {
|
|
4146
4153
|
for (var e = C(t.value), i, n, a; i = !(n = yield e.next()).done; i = !1) {
|
|
@@ -4164,11 +4171,11 @@ $e = new WeakMap(), Cr = new WeakMap(), Mn = new WeakSet(), fc = function(t) {
|
|
|
4164
4171
|
});
|
|
4165
4172
|
};
|
|
4166
4173
|
let Aa = Wa;
|
|
4167
|
-
function
|
|
4174
|
+
function Hr(r) {
|
|
4168
4175
|
return typeof r == "string" || r === null || r === void 0;
|
|
4169
4176
|
}
|
|
4170
4177
|
function Ju(r) {
|
|
4171
|
-
return "provider" in r && typeof r.provider == "string" && (!("widevineLicenseUrl" in r) ||
|
|
4178
|
+
return "provider" in r && typeof r.provider == "string" && (!("widevineLicenseUrl" in r) || Hr(r.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in r) || Hr(r.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in r) || Hr(r.fairplayLicenseUrl)) && (!("fairplayCertificate" in r) || Hr(r.fairplayCertificate));
|
|
4172
4179
|
}
|
|
4173
4180
|
function Qu(r) {
|
|
4174
4181
|
try {
|
|
@@ -4182,26 +4189,26 @@ function qu(r) {
|
|
|
4182
4189
|
if (!Ju(e))
|
|
4183
4190
|
throw new Error("Invalid drm object");
|
|
4184
4191
|
const a = e, { fairplayCertificate: i } = a, n = Ja(a, ["fairplayCertificate"]);
|
|
4185
|
-
return
|
|
4192
|
+
return zr(zt({}, n), {
|
|
4186
4193
|
fairplayCertificate: i ? Qu(i) : void 0
|
|
4187
4194
|
});
|
|
4188
4195
|
}
|
|
4189
4196
|
class ja {
|
|
4190
4197
|
constructor(t) {
|
|
4191
|
-
|
|
4198
|
+
d(this, "value");
|
|
4192
4199
|
this.value = t;
|
|
4193
4200
|
}
|
|
4194
4201
|
static create(t, e, i) {
|
|
4195
4202
|
return h(this, null, function* () {
|
|
4196
4203
|
var w = [];
|
|
4197
4204
|
try {
|
|
4198
|
-
const n = nt(w, yield t.subscribeTrack(new
|
|
4205
|
+
const n = nt(w, yield t.subscribeTrack(new Mt().name("drm").build()), !0);
|
|
4199
4206
|
const a = n.objects();
|
|
4200
4207
|
const c = yield a.next();
|
|
4201
4208
|
if (c.done)
|
|
4202
4209
|
throw new Error("No drm object received");
|
|
4203
|
-
const
|
|
4204
|
-
return new ja(
|
|
4210
|
+
const l = qu(c.value.payload);
|
|
4211
|
+
return new ja(zr(zt({}, l), { videoCodec: e, audioCodec: i }));
|
|
4205
4212
|
} catch (p) {
|
|
4206
4213
|
var m = p, b = !0;
|
|
4207
4214
|
} finally {
|
|
@@ -4221,17 +4228,17 @@ function io(r) {
|
|
|
4221
4228
|
return e;
|
|
4222
4229
|
}
|
|
4223
4230
|
const th = 1e4;
|
|
4224
|
-
var
|
|
4231
|
+
var xr, zn, pc;
|
|
4225
4232
|
const $a = class $a {
|
|
4226
4233
|
constructor(t, e, i) {
|
|
4227
4234
|
o(this, zn);
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
o(this,
|
|
4231
|
-
this.ip = i, this.value = new Y(e), u(this,
|
|
4235
|
+
d(this, "ip");
|
|
4236
|
+
d(this, "value");
|
|
4237
|
+
o(this, xr);
|
|
4238
|
+
this.ip = i, this.value = new Y(e), u(this, xr, f(this, zn, pc).call(this, t));
|
|
4232
4239
|
}
|
|
4233
4240
|
closed() {
|
|
4234
|
-
return s(this,
|
|
4241
|
+
return s(this, xr);
|
|
4235
4242
|
}
|
|
4236
4243
|
idleTimeout() {
|
|
4237
4244
|
return h(this, null, function* () {
|
|
@@ -4247,7 +4254,7 @@ const $a = class $a {
|
|
|
4247
4254
|
}
|
|
4248
4255
|
static start(t) {
|
|
4249
4256
|
return h(this, null, function* () {
|
|
4250
|
-
const i = (yield t.subscribe(new
|
|
4257
|
+
const i = (yield t.subscribe(new Mt().name("stats").groupOrder("ascending").build())).objects(), n = yield i.next();
|
|
4251
4258
|
if (n.done)
|
|
4252
4259
|
throw new Error("No stats object received");
|
|
4253
4260
|
const a = io(n.value.payload);
|
|
@@ -4257,15 +4264,15 @@ const $a = class $a {
|
|
|
4257
4264
|
});
|
|
4258
4265
|
}
|
|
4259
4266
|
};
|
|
4260
|
-
|
|
4267
|
+
xr = new WeakMap(), zn = new WeakSet(), pc = function(t) {
|
|
4261
4268
|
return h(this, null, function* () {
|
|
4262
4269
|
try {
|
|
4263
4270
|
for (var e = C(t), i, n, a; i = !(n = yield e.next()).done; i = !1) {
|
|
4264
4271
|
const c = n.value;
|
|
4265
4272
|
if (c.objectStatus !== X.Normal)
|
|
4266
4273
|
continue;
|
|
4267
|
-
const
|
|
4268
|
-
this.value.update(
|
|
4274
|
+
const l = io(c.payload);
|
|
4275
|
+
this.value.update(l);
|
|
4269
4276
|
}
|
|
4270
4277
|
} catch (n) {
|
|
4271
4278
|
a = [n];
|
|
@@ -4280,21 +4287,21 @@ Br = new WeakMap(), zn = new WeakSet(), pc = function(t) {
|
|
|
4280
4287
|
});
|
|
4281
4288
|
};
|
|
4282
4289
|
let Da = $a;
|
|
4283
|
-
var Hn,
|
|
4290
|
+
var Hn, Hs;
|
|
4284
4291
|
class eh {
|
|
4285
4292
|
constructor(t) {
|
|
4286
4293
|
o(this, Hn, rt.get().createContext("UpstreamWatcher"));
|
|
4287
|
-
o(this,
|
|
4288
|
-
u(this,
|
|
4294
|
+
o(this, Hs);
|
|
4295
|
+
u(this, Hs, new Y(V.fromPromise(t.closed())));
|
|
4289
4296
|
}
|
|
4290
4297
|
update(t) {
|
|
4291
|
-
s(this,
|
|
4298
|
+
s(this, Hs).update(V.fromPromise(t.closed()));
|
|
4292
4299
|
}
|
|
4293
4300
|
closed() {
|
|
4294
4301
|
return h(this, null, function* () {
|
|
4295
4302
|
try {
|
|
4296
4303
|
for (; ; ) {
|
|
4297
|
-
const [t, e] = s(this,
|
|
4304
|
+
const [t, e] = s(this, Hs).value();
|
|
4298
4305
|
let i = !1;
|
|
4299
4306
|
yield Promise.race([
|
|
4300
4307
|
e == null ? void 0 : e.then(() => i = !0),
|
|
@@ -4310,28 +4317,28 @@ class eh {
|
|
|
4310
4317
|
});
|
|
4311
4318
|
}
|
|
4312
4319
|
}
|
|
4313
|
-
Hn = new WeakMap(),
|
|
4314
|
-
var
|
|
4320
|
+
Hn = new WeakMap(), Hs = new WeakMap();
|
|
4321
|
+
var Xs, Pr, Rr;
|
|
4315
4322
|
class ra {
|
|
4316
4323
|
constructor(t, e) {
|
|
4317
|
-
o(this,
|
|
4318
|
-
o(this, xr);
|
|
4324
|
+
o(this, Xs, rt.get().createContext("TracksIterator"));
|
|
4319
4325
|
o(this, Pr);
|
|
4320
|
-
|
|
4326
|
+
o(this, Rr);
|
|
4327
|
+
u(this, Pr, t), u(this, Rr, e);
|
|
4321
4328
|
}
|
|
4322
4329
|
[Symbol.asyncIterator]() {
|
|
4323
|
-
return
|
|
4324
|
-
const t = s(this,
|
|
4330
|
+
return Pt(this, null, function* () {
|
|
4331
|
+
const t = s(this, Rr);
|
|
4325
4332
|
try {
|
|
4326
|
-
for (var e = C(s(this,
|
|
4333
|
+
for (var e = C(s(this, Pr)), i, n, a; i = !(n = yield new O(e.next())).done; i = !1) {
|
|
4327
4334
|
const c = n.value;
|
|
4328
4335
|
if (!c)
|
|
4329
4336
|
continue;
|
|
4330
|
-
const
|
|
4337
|
+
const l = {
|
|
4331
4338
|
name: c.trackObject.name,
|
|
4332
4339
|
namespace: c.namespace
|
|
4333
4340
|
};
|
|
4334
|
-
s(this,
|
|
4341
|
+
s(this, Xs).debug("track start", zt({ mediaType: t }, l)), yield* sa(c), s(this, Xs).debug("track end", zt({ mediaType: t }, l));
|
|
4335
4342
|
}
|
|
4336
4343
|
} catch (n) {
|
|
4337
4344
|
a = [n];
|
|
@@ -4343,45 +4350,45 @@ class ra {
|
|
|
4343
4350
|
throw a[0];
|
|
4344
4351
|
}
|
|
4345
4352
|
}
|
|
4346
|
-
s(this,
|
|
4353
|
+
s(this, Xs).debug("tracks ended", { mediaType: t });
|
|
4347
4354
|
});
|
|
4348
4355
|
}
|
|
4349
4356
|
}
|
|
4350
|
-
|
|
4351
|
-
var mo, yo, go,
|
|
4357
|
+
Xs = new WeakMap(), Pr = new WeakMap(), Rr = new WeakMap();
|
|
4358
|
+
var mo, yo, go, Ys, Zs, Me, F, yt, gt, ne, Ks, jr, oi, Z, tn, di, bc, Va;
|
|
4352
4359
|
go = [q({ context: "Player", enter: "info" })], yo = [q({ context: "Player", enter: "info", return: "info" })], mo = [q({ context: "Player", enter: "info" })];
|
|
4353
|
-
const
|
|
4360
|
+
const as = class as {
|
|
4354
4361
|
constructor(t, e, i) {
|
|
4355
|
-
he(
|
|
4362
|
+
he(oi, 5, this);
|
|
4356
4363
|
o(this, Z);
|
|
4357
|
-
o(this, Xs);
|
|
4358
4364
|
o(this, Ys);
|
|
4365
|
+
o(this, Zs);
|
|
4359
4366
|
o(this, Me);
|
|
4360
4367
|
o(this, F);
|
|
4361
|
-
o(this, mt, new Y(void 0));
|
|
4362
4368
|
o(this, yt, new Y(void 0));
|
|
4369
|
+
o(this, gt, new Y(void 0));
|
|
4363
4370
|
o(this, ne, new Y(void 0));
|
|
4364
|
-
o(this,
|
|
4365
|
-
o(this,
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
u(this,
|
|
4371
|
+
o(this, Ks);
|
|
4372
|
+
o(this, jr);
|
|
4373
|
+
d(this, "subtitles", new ra(s(this, ne), "subtitles"));
|
|
4374
|
+
d(this, "video", new ra(s(this, gt), "video"));
|
|
4375
|
+
d(this, "audio", new ra(s(this, yt), "audio"));
|
|
4376
|
+
u(this, Ys, t), u(this, Zs, Aa.start(i)), u(this, Me, i), u(this, F, new Y(e)), u(this, Ks, new eh(e)), u(this, jr, Promise.race([i.idleTimeout(), f(this, Z, bc).call(this), s(this, Ks).closed()])), s(this, Ys).closed().then(() => this.close()).catch(A);
|
|
4370
4377
|
}
|
|
4371
4378
|
closed() {
|
|
4372
|
-
return s(this,
|
|
4379
|
+
return s(this, jr);
|
|
4373
4380
|
}
|
|
4374
4381
|
static start(t, e) {
|
|
4375
4382
|
return h(this, null, function* () {
|
|
4376
|
-
const i = new hc(t, { namespace: $u("auxiliary") }), [[n, a, c],
|
|
4377
|
-
|
|
4383
|
+
const i = new hc(t, { namespace: $u("auxiliary") }), [[n, a, c], l] = yield Promise.all([
|
|
4384
|
+
En.start(t, e).then((p) => Promise.all([
|
|
4378
4385
|
Promise.resolve(p),
|
|
4379
4386
|
e.videoTrack ? p.subscribeCmafTrack(e.videoTrack) : void 0,
|
|
4380
4387
|
e.audioTrack ? p.subscribeCmafTrack(e.audioTrack) : void 0
|
|
4381
4388
|
])),
|
|
4382
4389
|
Da.start(i)
|
|
4383
|
-
]), w = new
|
|
4384
|
-
return c && s(w,
|
|
4390
|
+
]), w = new as(t, n, l);
|
|
4391
|
+
return c && s(w, yt).update(c), a && s(w, gt).update(a), w;
|
|
4385
4392
|
});
|
|
4386
4393
|
}
|
|
4387
4394
|
connectionInfo() {
|
|
@@ -4403,14 +4410,14 @@ const ns = class ns {
|
|
|
4403
4410
|
}
|
|
4404
4411
|
videoTrack() {
|
|
4405
4412
|
var t;
|
|
4406
|
-
return (t = s(this,
|
|
4413
|
+
return (t = s(this, gt).current()) == null ? void 0 : t.trackObject;
|
|
4407
4414
|
}
|
|
4408
4415
|
audioTrack() {
|
|
4409
4416
|
var t;
|
|
4410
|
-
return (t = s(this,
|
|
4417
|
+
return (t = s(this, yt).current()) == null ? void 0 : t.trackObject;
|
|
4411
4418
|
}
|
|
4412
4419
|
referenceClock() {
|
|
4413
|
-
return s(this,
|
|
4420
|
+
return s(this, Zs);
|
|
4414
4421
|
}
|
|
4415
4422
|
drm() {
|
|
4416
4423
|
return h(this, null, function* () {
|
|
@@ -4426,20 +4433,20 @@ const ns = class ns {
|
|
|
4426
4433
|
// Close the channel ObservableValue
|
|
4427
4434
|
s(this, F).close(),
|
|
4428
4435
|
// Close the consumers so that the iterators will stop
|
|
4429
|
-
f(this, Z,
|
|
4430
|
-
f(this, Z,
|
|
4431
|
-
f(this, Z,
|
|
4436
|
+
f(this, Z, tn).call(this, s(this, yt)),
|
|
4437
|
+
f(this, Z, tn).call(this, s(this, gt)),
|
|
4438
|
+
f(this, Z, tn).call(this, s(this, ne))
|
|
4432
4439
|
]);
|
|
4433
4440
|
}
|
|
4434
4441
|
zap(t, e) {
|
|
4435
4442
|
return h(this, null, function* () {
|
|
4436
4443
|
var E, z;
|
|
4437
|
-
const i = yield
|
|
4438
|
-
s(this,
|
|
4439
|
-
const w =
|
|
4444
|
+
const i = yield En.start(s(this, Ys), t), n = s(this, Zs).wallclock() - e, a = s(this, F).current(), c = a.timestampWallclockOffset(), l = yield i.waitForWallclockTime(n);
|
|
4445
|
+
s(this, Ks).update(i), yield s(this, F).current().close();
|
|
4446
|
+
const w = l.toReversed().find((_) => _.wallclock <= n), p = w != null && w.mediaPts ? w.mediaPts - a.timestampOffsetMs() : void 0, I = i.timestampWallclockOffset() - c + a.timestampOffsetMs();
|
|
4440
4447
|
i.setTimestampOffsetMs(I);
|
|
4441
4448
|
const g = w != null && w.groupId ? k(w.groupId) : void 0;
|
|
4442
|
-
p && ((E = s(this,
|
|
4449
|
+
p && ((E = s(this, gt).current()) == null || E.stopAfterTimestampReached(p), (z = s(this, yt).current()) == null || z.stopAfterTimestampReached(p)), s(this, F).update(i), yield Promise.all([
|
|
4443
4450
|
t.videoTrack ? this.setVideoTrack(t.videoTrack, g) : void 0,
|
|
4444
4451
|
t.audioTrack ? this.setAudioTrack(t.audioTrack, g) : void 0
|
|
4445
4452
|
]);
|
|
@@ -4461,23 +4468,23 @@ const ns = class ns {
|
|
|
4461
4468
|
}
|
|
4462
4469
|
setVideoTrack(t, e) {
|
|
4463
4470
|
return h(this, null, function* () {
|
|
4464
|
-
const i = yield f(this, Z,
|
|
4465
|
-
s(this,
|
|
4471
|
+
const i = yield f(this, Z, di).call(this, s(this, F).current(), t, s(this, gt).current(), e);
|
|
4472
|
+
s(this, gt).update(i);
|
|
4466
4473
|
});
|
|
4467
4474
|
}
|
|
4468
4475
|
setAudioTrack(t, e) {
|
|
4469
4476
|
return h(this, null, function* () {
|
|
4470
|
-
const i = yield f(this, Z,
|
|
4471
|
-
s(this,
|
|
4477
|
+
const i = yield f(this, Z, di).call(this, s(this, F).current(), t, s(this, yt).current(), e);
|
|
4478
|
+
s(this, yt).update(i);
|
|
4472
4479
|
});
|
|
4473
4480
|
}
|
|
4474
4481
|
};
|
|
4475
|
-
|
|
4482
|
+
oi = ue(null), Ys = new WeakMap(), Zs = new WeakMap(), Me = new WeakMap(), F = new WeakMap(), yt = new WeakMap(), gt = new WeakMap(), ne = new WeakMap(), Ks = new WeakMap(), jr = new WeakMap(), Z = new WeakSet(), tn = function(t) {
|
|
4476
4483
|
const e = t.current(), i = e == null ? void 0 : e.largestGroupId();
|
|
4477
4484
|
return t.isClosed() || t.update(void 0), t.close(), i ? e == null ? void 0 : e.update(i, i) : e == null ? void 0 : e.unsubscribe();
|
|
4478
|
-
},
|
|
4485
|
+
}, di = function(t, e, i, n) {
|
|
4479
4486
|
return h(this, null, function* () {
|
|
4480
|
-
const a = i == null ? void 0 : i.largestGroupId(), [c,
|
|
4487
|
+
const a = i == null ? void 0 : i.largestGroupId(), [c, l] = yield Promise.all([
|
|
4481
4488
|
t.subscribeCmafTrack(
|
|
4482
4489
|
e,
|
|
4483
4490
|
n || (a ? a + k(1) : void 0)
|
|
@@ -4489,14 +4496,14 @@ ai = ue(null), Xs = new WeakMap(), Ys = new WeakMap(), Me = new WeakMap(), F = n
|
|
|
4489
4496
|
}, bc = function() {
|
|
4490
4497
|
return h(this, null, function* () {
|
|
4491
4498
|
try {
|
|
4492
|
-
for (var a = C(s(this, F)), c,
|
|
4493
|
-
const p =
|
|
4499
|
+
for (var a = C(s(this, F)), c, l, w; c = !(l = yield a.next()).done; c = !1) {
|
|
4500
|
+
const p = l.value;
|
|
4494
4501
|
try {
|
|
4495
4502
|
for (var t = C(p.catalog()), e, i, n; e = !(i = yield t.next()).done; e = !1) {
|
|
4496
4503
|
const m = i.value;
|
|
4497
4504
|
yield Promise.all([
|
|
4498
|
-
f(this, Z, Va).call(this, m, s(this,
|
|
4499
|
-
f(this, Z, Va).call(this, m, s(this,
|
|
4505
|
+
f(this, Z, Va).call(this, m, s(this, gt)),
|
|
4506
|
+
f(this, Z, Va).call(this, m, s(this, yt))
|
|
4500
4507
|
]);
|
|
4501
4508
|
}
|
|
4502
4509
|
} catch (i) {
|
|
@@ -4510,11 +4517,11 @@ ai = ue(null), Xs = new WeakMap(), Ys = new WeakMap(), Me = new WeakMap(), F = n
|
|
|
4510
4517
|
}
|
|
4511
4518
|
}
|
|
4512
4519
|
}
|
|
4513
|
-
} catch (
|
|
4514
|
-
w = [
|
|
4520
|
+
} catch (l) {
|
|
4521
|
+
w = [l];
|
|
4515
4522
|
} finally {
|
|
4516
4523
|
try {
|
|
4517
|
-
c && (
|
|
4524
|
+
c && (l = a.return) && (yield l.call(a));
|
|
4518
4525
|
} finally {
|
|
4519
4526
|
if (w)
|
|
4520
4527
|
throw w[0];
|
|
@@ -4526,39 +4533,39 @@ ai = ue(null), Xs = new WeakMap(), Ys = new WeakMap(), Me = new WeakMap(), F = n
|
|
|
4526
4533
|
const i = e.current();
|
|
4527
4534
|
if (!i)
|
|
4528
4535
|
return;
|
|
4529
|
-
const n = i.trackObject.name, a = i.trackObject["com.vindral.variant_uid"], c = t.tracks.find((w) => w.name === n),
|
|
4536
|
+
const n = i.trackObject.name, a = i.trackObject["com.vindral.variant_uid"], c = t.tracks.find((w) => w.name === n), l = t.tracks.find((w) => w["com.vindral.variant_uid"] === a);
|
|
4530
4537
|
if (!c) {
|
|
4531
|
-
if (!
|
|
4538
|
+
if (!l) {
|
|
4532
4539
|
e.update(void 0);
|
|
4533
4540
|
return;
|
|
4534
4541
|
}
|
|
4535
|
-
e.update(yield s(this, F).current().subscribeCmafTrack(
|
|
4542
|
+
e.update(yield s(this, F).current().subscribeCmafTrack(l));
|
|
4536
4543
|
}
|
|
4537
4544
|
});
|
|
4538
|
-
}, H(
|
|
4539
|
-
let Oa =
|
|
4545
|
+
}, H(oi, 1, "close", go, as), H(oi, 1, "zap", yo, as), di = H(oi, 17, "#replaceTrack", mo, Z, di), Ht(oi, as);
|
|
4546
|
+
let Oa = as;
|
|
4540
4547
|
function na(r, t, e) {
|
|
4541
4548
|
const i = new URL("/voq/subscribe", r);
|
|
4542
4549
|
return i.searchParams.set("sessionId", t.sessionId), i.searchParams.set("clientId", t.clientId), i.searchParams.set("channelId", t.channelId), e && i.searchParams.set("authToken", e), i;
|
|
4543
4550
|
}
|
|
4544
4551
|
const sh = 1e4;
|
|
4545
|
-
var L, Q,
|
|
4552
|
+
var L, Q, kt, ze, Js, Qs, B, ae, Gr, Nr, Xn, qs, K, mc, _s, Lr, ti, yc, gc, kc, Ic, Ca;
|
|
4546
4553
|
const Ma = class Ma {
|
|
4547
4554
|
constructor(t, e, i, n, a, c) {
|
|
4548
4555
|
o(this, K);
|
|
4549
4556
|
o(this, L);
|
|
4550
4557
|
o(this, Q);
|
|
4551
|
-
o(this,
|
|
4558
|
+
o(this, kt);
|
|
4552
4559
|
o(this, ze, "disconnected");
|
|
4553
|
-
o(this, Ks);
|
|
4554
4560
|
o(this, Js);
|
|
4561
|
+
o(this, Qs);
|
|
4555
4562
|
o(this, B);
|
|
4556
4563
|
o(this, ae, /* @__PURE__ */ new Map());
|
|
4557
|
-
o(this,
|
|
4564
|
+
o(this, Gr);
|
|
4558
4565
|
o(this, Nr, new Ba(10));
|
|
4559
4566
|
o(this, Xn, Number.MAX_SAFE_INTEGER);
|
|
4560
|
-
o(this,
|
|
4561
|
-
o(this,
|
|
4567
|
+
o(this, qs, /* @__PURE__ */ new Map());
|
|
4568
|
+
o(this, _s, (t) => {
|
|
4562
4569
|
if (!t) {
|
|
4563
4570
|
s(this, B).setSubtitleTrack(void 0).catch(A);
|
|
4564
4571
|
return;
|
|
@@ -4566,51 +4573,51 @@ const Ma = class Ma {
|
|
|
4566
4573
|
const e = s(this, ae).get(de(s(this, B).namespace())), i = e == null ? void 0 : e.getTextTrack(t);
|
|
4567
4574
|
i && s(this, B).setSubtitleTrack(i).catch(A);
|
|
4568
4575
|
});
|
|
4569
|
-
o(this,
|
|
4576
|
+
o(this, Lr, (t) => {
|
|
4570
4577
|
switch (t.type) {
|
|
4571
4578
|
case "subscribe":
|
|
4572
4579
|
{
|
|
4573
|
-
if (s(this,
|
|
4580
|
+
if (s(this, ti)) {
|
|
4574
4581
|
s(this, Q).info("Ignoring - we are already switching");
|
|
4575
4582
|
return;
|
|
4576
4583
|
}
|
|
4577
|
-
u(this,
|
|
4584
|
+
u(this, ti, !0), f(this, K, gc).call(this, t.subscription).catch((e) => {
|
|
4578
4585
|
s(this, Q).error("error handling subscription", e), s(this, L).emit("received signal", {
|
|
4579
4586
|
type: "subscription changed",
|
|
4580
4587
|
subscription: t.subscription,
|
|
4581
4588
|
reset: !0
|
|
4582
4589
|
});
|
|
4583
|
-
}).finally(() => u(this,
|
|
4590
|
+
}).finally(() => u(this, ti, !1));
|
|
4584
4591
|
}
|
|
4585
4592
|
break;
|
|
4586
4593
|
case "telemetry":
|
|
4587
|
-
Rc(new URL("/api/telemetry", s(this,
|
|
4594
|
+
Rc(new URL("/api/telemetry", s(this, kt).url().replace("wss://", "https://")), {
|
|
4588
4595
|
body: t.body,
|
|
4589
4596
|
headers: { "Content-Type": "text/plain" }
|
|
4590
4597
|
}).catch(A);
|
|
4591
4598
|
break;
|
|
4592
4599
|
case "refresh auth":
|
|
4593
|
-
s(this,
|
|
4600
|
+
s(this, kt).updateAuthToken(t.token);
|
|
4594
4601
|
break;
|
|
4595
4602
|
}
|
|
4596
4603
|
});
|
|
4597
|
-
o(this,
|
|
4598
|
-
|
|
4599
|
-
s(this, Q).info("Disconnecting", t), s(this,
|
|
4604
|
+
o(this, ti, !1);
|
|
4605
|
+
d(this, "disconnect", (t = "Disconnect Requested") => {
|
|
4606
|
+
s(this, Q).info("Disconnecting", t), s(this, kt).close(), s(this, B).close().catch(A), u(this, qs, /* @__PURE__ */ new Map()), u(this, ze, "disconnected");
|
|
4600
4607
|
});
|
|
4601
|
-
u(this, L, t), u(this, Q, e), u(this,
|
|
4608
|
+
u(this, L, t), u(this, Q, e), u(this, kt, i), u(this, B, n), u(this, ae, a), u(this, Gr, c), s(this, L).on("send signal", s(this, Lr)), s(this, L).on("disconnect", this.disconnect), s(this, L).on("text track", s(this, _s)), f(this, K, mc).call(this).catch(A), f(this, K, kc).call(this).catch(A);
|
|
4602
4609
|
}
|
|
4603
4610
|
get estimatedBandwidth() {
|
|
4604
4611
|
return s(this, Xn);
|
|
4605
4612
|
}
|
|
4606
4613
|
get firstConnectionTime() {
|
|
4607
|
-
return s(this,
|
|
4614
|
+
return s(this, Js);
|
|
4608
4615
|
}
|
|
4609
4616
|
get lastConnectionTime() {
|
|
4610
|
-
return s(this,
|
|
4617
|
+
return s(this, Qs);
|
|
4611
4618
|
}
|
|
4612
4619
|
unload() {
|
|
4613
|
-
s(this, L).off("send signal", s(this,
|
|
4620
|
+
s(this, L).off("send signal", s(this, Lr)), s(this, L).off("disconnect", this.disconnect), s(this, L).off("text track", s(this, _s)), this.disconnect();
|
|
4614
4621
|
}
|
|
4615
4622
|
suspend() {
|
|
4616
4623
|
}
|
|
@@ -4623,7 +4630,7 @@ const Ma = class Ma {
|
|
|
4623
4630
|
estimatedBandwidth: e,
|
|
4624
4631
|
connectCount: 0,
|
|
4625
4632
|
connectionAttemptCount: 0,
|
|
4626
|
-
edgeUrl: s(this,
|
|
4633
|
+
edgeUrl: s(this, kt).url(),
|
|
4627
4634
|
connectionProtocol: "moq"
|
|
4628
4635
|
};
|
|
4629
4636
|
}
|
|
@@ -4635,15 +4642,15 @@ const Ma = class Ma {
|
|
|
4635
4642
|
de(R.catalog.namespace),
|
|
4636
4643
|
new aa(new Y(R.catalog))
|
|
4637
4644
|
])
|
|
4638
|
-
), c = yield n.onConnectInfo(n.connectInfo),
|
|
4645
|
+
), c = yield n.onConnectInfo(n.connectInfo), l = n.options.get("authenticationToken");
|
|
4639
4646
|
let w, p;
|
|
4640
4647
|
switch (typeof n.edgeUrl) {
|
|
4641
4648
|
case "string": {
|
|
4642
|
-
w = na(n.edgeUrl, c,
|
|
4649
|
+
w = na(n.edgeUrl, c, l);
|
|
4643
4650
|
break;
|
|
4644
4651
|
}
|
|
4645
4652
|
default:
|
|
4646
|
-
w = na(n.edgeUrl.moqUrl || n.edgeUrl.moqWsUrl, c,
|
|
4653
|
+
w = na(n.edgeUrl.moqUrl || n.edgeUrl.moqWsUrl, c, l), p = na(n.edgeUrl.moqWsUrl, c, l);
|
|
4647
4654
|
break;
|
|
4648
4655
|
}
|
|
4649
4656
|
const m = (D = n.connectInfo.channels.find((R) => R.channelId === c.channelId)) == null ? void 0 : D.catalog;
|
|
@@ -4673,7 +4680,7 @@ const Ma = class Ma {
|
|
|
4673
4680
|
e.error("Error getting DRM data", R);
|
|
4674
4681
|
});
|
|
4675
4682
|
const _ = new Ma(t, e, g, E, a, i);
|
|
4676
|
-
return c.textTrack && s(v = _,
|
|
4683
|
+
return c.textTrack && s(v = _, _s).call(v, c.textTrack), _;
|
|
4677
4684
|
});
|
|
4678
4685
|
}
|
|
4679
4686
|
getState() {
|
|
@@ -4683,13 +4690,13 @@ const Ma = class Ma {
|
|
|
4683
4690
|
return s(this, B).connectionInfo().rtt;
|
|
4684
4691
|
}
|
|
4685
4692
|
close() {
|
|
4686
|
-
s(this,
|
|
4693
|
+
s(this, kt).close();
|
|
4687
4694
|
}
|
|
4688
4695
|
closed() {
|
|
4689
|
-
return Promise.race([s(this,
|
|
4696
|
+
return Promise.race([s(this, kt).closed(), s(this, B).closed()]);
|
|
4690
4697
|
}
|
|
4691
4698
|
};
|
|
4692
|
-
L = new WeakMap(), Q = new WeakMap(),
|
|
4699
|
+
L = new WeakMap(), Q = new WeakMap(), kt = new WeakMap(), ze = new WeakMap(), Js = new WeakMap(), Qs = new WeakMap(), B = new WeakMap(), ae = new WeakMap(), Gr = new WeakMap(), Nr = new WeakMap(), Xn = new WeakMap(), qs = new WeakMap(), K = new WeakSet(), mc = function() {
|
|
4693
4700
|
return h(this, null, function* () {
|
|
4694
4701
|
try {
|
|
4695
4702
|
for (var t = C(s(this, B).stats()), e, i, n; e = !(i = yield t.next()).done; e = !1) {
|
|
@@ -4707,10 +4714,10 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
|
|
|
4707
4714
|
}
|
|
4708
4715
|
}
|
|
4709
4716
|
});
|
|
4710
|
-
},
|
|
4717
|
+
}, _s = new WeakMap(), Lr = new WeakMap(), ti = new WeakMap(), yc = function(t) {
|
|
4711
4718
|
return h(this, null, function* () {
|
|
4712
4719
|
var n;
|
|
4713
|
-
const e = yield s(this,
|
|
4720
|
+
const e = yield s(this, Gr).connect({ channelId: t });
|
|
4714
4721
|
if (!jc(e))
|
|
4715
4722
|
throw new Error("no moq connect info found");
|
|
4716
4723
|
const i = (n = e.channels.find((a) => a.channelId === t)) == null ? void 0 : n.catalog;
|
|
@@ -4720,7 +4727,7 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
|
|
|
4720
4727
|
});
|
|
4721
4728
|
}, gc = function(t) {
|
|
4722
4729
|
return h(this, null, function* () {
|
|
4723
|
-
var c,
|
|
4730
|
+
var c, l, w;
|
|
4724
4731
|
s(this, Q).info("handle subscription", t);
|
|
4725
4732
|
const e = s(this, B);
|
|
4726
4733
|
let i = s(this, ae).get(t.channelId);
|
|
@@ -4743,7 +4750,7 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
|
|
|
4743
4750
|
}
|
|
4744
4751
|
const n = i.getVideoTrack(t.video), a = i.getAudioTrack(t.audio);
|
|
4745
4752
|
yield Promise.all([
|
|
4746
|
-
n && n.track.name !== ((
|
|
4753
|
+
n && n.track.name !== ((l = s(this, B).videoTrack()) == null ? void 0 : l.name) ? s(this, B).setVideoTrack(n.track) : void 0,
|
|
4747
4754
|
a && a.track.name !== ((w = s(this, B).audioTrack()) == null ? void 0 : w.name) ? s(this, B).setAudioTrack(a.track) : void 0
|
|
4748
4755
|
]), s(this, L).emit("received signal", {
|
|
4749
4756
|
type: "subscription changed",
|
|
@@ -4753,11 +4760,11 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
|
|
|
4753
4760
|
}, kc = function() {
|
|
4754
4761
|
return h(this, null, function* () {
|
|
4755
4762
|
try {
|
|
4756
|
-
u(this, ze, "connecting"), s(this, Q).info("Connecting..."), u(this,
|
|
4763
|
+
u(this, ze, "connecting"), s(this, Q).info("Connecting..."), u(this, Qs, Date.now()), s(this, Js) || u(this, Js, s(this, Qs)), u(this, ze, "connected"), yield Promise.all([
|
|
4757
4764
|
f(this, K, Ca).call(this, s(this, B).referenceClock(), s(this, B).audio),
|
|
4758
4765
|
f(this, K, Ca).call(this, s(this, B).referenceClock(), s(this, B).video),
|
|
4759
4766
|
f(this, K, Ic).call(this, s(this, B).subtitles)
|
|
4760
|
-
]), yield s(this, B).closed(), s(this,
|
|
4767
|
+
]), yield s(this, B).closed(), s(this, kt).close(), s(this, Q).info("Session closed");
|
|
4761
4768
|
} catch (t) {
|
|
4762
4769
|
s(this, Q).warn("Session error", t);
|
|
4763
4770
|
}
|
|
@@ -4788,8 +4795,8 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
|
|
|
4788
4795
|
const g = b.value;
|
|
4789
4796
|
const E = de(g.track.namespace), z = g.track.trackObject.language;
|
|
4790
4797
|
try {
|
|
4791
|
-
for (var a = C(g), c,
|
|
4792
|
-
const [_, D] =
|
|
4798
|
+
for (var a = C(g), c, l, w; c = !(l = yield a.next()).done; c = !1) {
|
|
4799
|
+
const [_, D] = l.value;
|
|
4793
4800
|
i !== "" && i !== E && D.mediaType() === "video" && s(this, L).emit("add event", {
|
|
4794
4801
|
type: "channel switch",
|
|
4795
4802
|
channelId: E,
|
|
@@ -4799,9 +4806,9 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
|
|
|
4799
4806
|
language: z,
|
|
4800
4807
|
timestamp: D.baseMediaDecodeTime() / D.timescale() * 1e3
|
|
4801
4808
|
}), n = z;
|
|
4802
|
-
const S = D.producerReferenceTime(), W = s(this,
|
|
4809
|
+
const S = D.producerReferenceTime(), W = s(this, qs).get(g.track.namespace) || 0;
|
|
4803
4810
|
if (S && Date.now() - W > 1e3) {
|
|
4804
|
-
s(this,
|
|
4811
|
+
s(this, qs).set(g.track.namespace, Date.now());
|
|
4805
4812
|
const v = t.wallclock() - S.getTime();
|
|
4806
4813
|
s(this, Q).info("ti", {
|
|
4807
4814
|
medaiType: D.mediaType(),
|
|
@@ -4827,11 +4834,11 @@ L = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), ze = new WeakMap(), Ks
|
|
|
4827
4834
|
renditionId: ih(g.track.trackObject.name)
|
|
4828
4835
|
});
|
|
4829
4836
|
}
|
|
4830
|
-
} catch (
|
|
4831
|
-
w = [
|
|
4837
|
+
} catch (l) {
|
|
4838
|
+
w = [l];
|
|
4832
4839
|
} finally {
|
|
4833
4840
|
try {
|
|
4834
|
-
c && (
|
|
4841
|
+
c && (l = a.return) && (yield l.call(a));
|
|
4835
4842
|
} finally {
|
|
4836
4843
|
if (w)
|
|
4837
4844
|
throw w[0];
|
|
@@ -4857,25 +4864,25 @@ function ih(r) {
|
|
|
4857
4864
|
0
|
|
4858
4865
|
);
|
|
4859
4866
|
}
|
|
4860
|
-
var
|
|
4867
|
+
var $t, He, Yn, vc;
|
|
4861
4868
|
class aa {
|
|
4862
4869
|
constructor(t) {
|
|
4863
4870
|
o(this, Yn);
|
|
4864
|
-
o(this,
|
|
4871
|
+
o(this, $t);
|
|
4865
4872
|
o(this, He);
|
|
4866
|
-
u(this,
|
|
4873
|
+
u(this, $t, t), u(this, He, f(this, Yn, vc).call(this));
|
|
4867
4874
|
}
|
|
4868
4875
|
catalog() {
|
|
4869
|
-
return s(this,
|
|
4876
|
+
return s(this, $t).current();
|
|
4870
4877
|
}
|
|
4871
4878
|
namespace() {
|
|
4872
|
-
return s(this,
|
|
4879
|
+
return s(this, $t).current().namespace;
|
|
4873
4880
|
}
|
|
4874
4881
|
updateCatalog(t) {
|
|
4875
|
-
u(this,
|
|
4882
|
+
u(this, $t, t);
|
|
4876
4883
|
}
|
|
4877
4884
|
getTextTrack(t) {
|
|
4878
|
-
return s(this,
|
|
4885
|
+
return s(this, $t).current().tracks.find((e) => e.label === t);
|
|
4879
4886
|
}
|
|
4880
4887
|
getAudioTrack(t) {
|
|
4881
4888
|
return t.codec ? s(this, He).filter((i) => !(!xc(i) || i.bitRate > t.bitRate || t.codec && i.codec !== t.codec || t.language && i.language !== t.language)).at(-1) : void 0;
|
|
@@ -4887,9 +4894,9 @@ class aa {
|
|
|
4887
4894
|
return s(this, He);
|
|
4888
4895
|
}
|
|
4889
4896
|
}
|
|
4890
|
-
|
|
4891
|
-
const [t, e] = s(this,
|
|
4892
|
-
return
|
|
4897
|
+
$t = new WeakMap(), He = new WeakMap(), Yn = new WeakSet(), vc = function() {
|
|
4898
|
+
const [t, e] = s(this, $t).value();
|
|
4899
|
+
return Gc(t);
|
|
4893
4900
|
};
|
|
4894
4901
|
export {
|
|
4895
4902
|
aa as CatalogObserver,
|