@ikonai/sdk 1.0.71 → 1.0.73
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/assets/{audio-playback-worker-CC2FKp8X.js → audio-playback-worker-DLkTvKgj.js} +394 -511
- package/assets/{protocol-worker-DCLZvHGe.js → protocol-worker-BfR3vj38.js} +52 -52
- package/assets/{video-capture-worker-CzOnKSIv.js → video-capture-worker-ZDlmU6Ta.js} +153 -153
- package/assets/{video-playback-worker-BTMuFG90.js → video-playback-worker-BMnMLk3U.js} +203 -203
- package/assets/viseme-worker-BOyyqInI.js +831 -0
- package/client/ikon-client-config.d.ts +6 -0
- package/client/ikon-client.d.ts +22 -0
- package/index.d.ts +2 -1
- package/index.js +2771 -2540
- package/media/ikon-audio-playback.d.ts +0 -57
- package/media/index.d.ts +1 -0
- package/media/viseme-tracker.d.ts +53 -0
- package/package.json +1 -1
- package/utils/connect-timeline.d.ts +4 -0
- package/utils/log-sender.d.ts +1 -0
- package/utils/query-params.d.ts +9 -0
- package/webrtc/index.d.ts +1 -1
- package/webrtc/webrtc-config.d.ts +2 -0
- package/webrtc/webrtc-connection.d.ts +1 -0
- package/webrtc/webrtc-signaling.d.ts +16 -0
- package/worker/audio-playback-worker.d.ts +0 -10
- package/worker/viseme-worker.d.ts +24 -0
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ht = {
|
|
2
2
|
Compressed: 8
|
|
3
3
|
};
|
|
4
|
-
function
|
|
4
|
+
function Nt(t) {
|
|
5
5
|
if (t.length < 8)
|
|
6
6
|
throw new Error("Protocol message too short");
|
|
7
7
|
return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const e =
|
|
9
|
+
function et(t) {
|
|
10
|
+
const e = d(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
11
11
|
if (e.length < 27)
|
|
12
12
|
throw new Error("Protocol payload too short");
|
|
13
|
-
const s = r.getUint32(0, !0), n = r.getUint32(4, !0),
|
|
13
|
+
const s = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), i = r.getUint32(12, !0), _ = r.getUint32(16, !0), E = r.getUint32(20, !0), I = r.getUint8(24), o = r.getUint8(25), A = r.getUint8(26);
|
|
14
14
|
if (27 + E * 4 > e.length)
|
|
15
15
|
throw new Error("Protocol header exceeds payload length");
|
|
16
|
-
const
|
|
17
|
-
let
|
|
16
|
+
const C = [];
|
|
17
|
+
let w = 27;
|
|
18
18
|
for (let L = 0; L < E; L++)
|
|
19
|
-
|
|
19
|
+
C.push(r.getUint32(w, !0)), w += 4;
|
|
20
20
|
return {
|
|
21
21
|
length: s,
|
|
22
22
|
opcode: n,
|
|
23
|
-
senderId:
|
|
24
|
-
trackId:
|
|
23
|
+
senderId: a,
|
|
24
|
+
trackId: i,
|
|
25
25
|
sequenceId: _,
|
|
26
|
-
targetIds:
|
|
27
|
-
payloadVersion:
|
|
28
|
-
payloadType:
|
|
26
|
+
targetIds: C,
|
|
27
|
+
payloadVersion: I,
|
|
28
|
+
payloadType: o,
|
|
29
29
|
flags: A
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
33
|
-
const s =
|
|
32
|
+
async function rt(t, e, r) {
|
|
33
|
+
const s = d(t), n = et(s);
|
|
34
34
|
if (e !== void 0 && n.opcode !== e)
|
|
35
35
|
throw new Error(`Unexpected opcode ${n.opcode}`);
|
|
36
36
|
if (n.payloadType !== 8)
|
|
37
37
|
throw new Error(`Unexpected payload type ${n.payloadType}`);
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
return (n.flags &
|
|
38
|
+
const a = 27 + n.targetIds.length * 4;
|
|
39
|
+
let i = s.subarray(a, n.length);
|
|
40
|
+
return (n.flags & ht.Compressed) !== 0 && (i = await Ct(i)), i;
|
|
41
41
|
}
|
|
42
|
-
async function
|
|
42
|
+
async function Ct(t) {
|
|
43
43
|
if (typeof DecompressionStream > "u")
|
|
44
44
|
throw new Error("DecompressionStream not supported");
|
|
45
45
|
const e = new DecompressionStream("gzip"), r = e.writable.getWriter(), s = new Uint8Array(t);
|
|
46
46
|
r.write(s), r.close();
|
|
47
|
-
const n = e.readable.getReader(),
|
|
48
|
-
let
|
|
47
|
+
const n = e.readable.getReader(), a = [];
|
|
48
|
+
let i = 0;
|
|
49
49
|
for (; ; ) {
|
|
50
|
-
const { done:
|
|
51
|
-
if (
|
|
52
|
-
|
|
50
|
+
const { done: I, value: o } = await n.read();
|
|
51
|
+
if (I) break;
|
|
52
|
+
a.push(o), i += o.length;
|
|
53
53
|
}
|
|
54
|
-
const _ = new Uint8Array(
|
|
54
|
+
const _ = new Uint8Array(i);
|
|
55
55
|
let E = 0;
|
|
56
|
-
for (let
|
|
57
|
-
_.set(
|
|
56
|
+
for (let I = 0; I < a.length; I++)
|
|
57
|
+
_.set(a[I], E), E += a[I].length;
|
|
58
58
|
return _;
|
|
59
59
|
}
|
|
60
|
-
var
|
|
61
|
-
const
|
|
60
|
+
var P = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(P || {});
|
|
61
|
+
const Rt = 161, St = 162;
|
|
62
62
|
new TextEncoder();
|
|
63
|
-
const
|
|
64
|
-
class
|
|
63
|
+
const ct = new TextDecoder("utf-8", { fatal: !0 });
|
|
64
|
+
class M {
|
|
65
65
|
constructor(e, r, s) {
|
|
66
66
|
this.buffer = e, this.version = r, this.offset = s, this.end = e.length - 1;
|
|
67
67
|
}
|
|
68
68
|
offset;
|
|
69
69
|
end;
|
|
70
70
|
static create(e) {
|
|
71
|
-
const r =
|
|
71
|
+
const r = d(e);
|
|
72
72
|
if (r.length < 2)
|
|
73
73
|
throw new Error("Teleport payload too short");
|
|
74
|
-
if (r[0] !==
|
|
74
|
+
if (r[0] !== Rt || r[r.length - 1] !== St)
|
|
75
75
|
throw new Error("Teleport object missing markers");
|
|
76
|
-
const s = { offset: 1 }, n =
|
|
77
|
-
return new
|
|
76
|
+
const s = { offset: 1 }, n = f(r, s, "InvalidLength");
|
|
77
|
+
return new M(r, n, s.offset);
|
|
78
78
|
}
|
|
79
79
|
next() {
|
|
80
80
|
if (this.offset >= this.end)
|
|
81
81
|
return null;
|
|
82
82
|
if (this.offset + 5 > this.buffer.length)
|
|
83
83
|
throw new Error("Teleport object truncated");
|
|
84
|
-
const e =
|
|
84
|
+
const e = Dt(this.buffer, this.offset);
|
|
85
85
|
this.offset += 4;
|
|
86
86
|
const r = this.buffer[this.offset++], s = r >> 4 & 15;
|
|
87
87
|
if ((r & 15) !== 0)
|
|
88
88
|
throw new Error("Teleport field flags must be zero");
|
|
89
|
-
const n =
|
|
90
|
-
let
|
|
89
|
+
const n = O(s);
|
|
90
|
+
let a;
|
|
91
91
|
if (n >= 0)
|
|
92
|
-
|
|
92
|
+
u(this.buffer, this.offset, n), a = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
|
|
93
93
|
else {
|
|
94
|
-
const
|
|
95
|
-
|
|
94
|
+
const i = { offset: this.offset }, _ = f(this.buffer, i, "InvalidLength");
|
|
95
|
+
u(this.buffer, i.offset, _), a = this.buffer.subarray(i.offset, i.offset + _), this.offset = i.offset + _;
|
|
96
96
|
}
|
|
97
|
-
return new
|
|
97
|
+
return new Ut(e, s, a);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
class R {
|
|
@@ -159,7 +159,7 @@ class R {
|
|
|
159
159
|
return this.ensureType(
|
|
160
160
|
12
|
|
161
161
|
/* String */
|
|
162
|
-
),
|
|
162
|
+
), ct.decode(this.payload);
|
|
163
163
|
}
|
|
164
164
|
asGuid() {
|
|
165
165
|
return this.ensureType(
|
|
@@ -171,26 +171,26 @@ class R {
|
|
|
171
171
|
return this.ensureType(
|
|
172
172
|
11
|
|
173
173
|
/* Object */
|
|
174
|
-
),
|
|
174
|
+
), M.create(this.payload);
|
|
175
175
|
}
|
|
176
176
|
asArray() {
|
|
177
177
|
return this.ensureType(
|
|
178
178
|
9
|
|
179
179
|
/* Array */
|
|
180
|
-
),
|
|
180
|
+
), x.create(this.payload);
|
|
181
181
|
}
|
|
182
182
|
asDictionary() {
|
|
183
183
|
return this.ensureType(
|
|
184
184
|
10
|
|
185
185
|
/* Dict */
|
|
186
|
-
),
|
|
186
|
+
), W.create(this.payload);
|
|
187
187
|
}
|
|
188
188
|
ensureType(e) {
|
|
189
189
|
if (this.type !== e)
|
|
190
|
-
throw new Error(`Teleport value has type ${
|
|
190
|
+
throw new Error(`Teleport value has type ${P[this.type]}, expected ${P[e]}`);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
class
|
|
193
|
+
class Ut extends R {
|
|
194
194
|
constructor(e, r, s) {
|
|
195
195
|
super(r, s), this.fieldId = e;
|
|
196
196
|
}
|
|
@@ -198,7 +198,7 @@ class Lt extends R {
|
|
|
198
198
|
return this.type === 1;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
class
|
|
201
|
+
class x {
|
|
202
202
|
payload;
|
|
203
203
|
elementType;
|
|
204
204
|
count;
|
|
@@ -211,10 +211,10 @@ class p {
|
|
|
211
211
|
if (this.elementType = r >> 4 & 15, (r & 15) !== 0)
|
|
212
212
|
throw new Error("Array flags must be zero");
|
|
213
213
|
const s = { offset: 1 };
|
|
214
|
-
this.count =
|
|
214
|
+
this.count = f(e, s, "ArrayMalformed"), this.offset = s.offset;
|
|
215
215
|
}
|
|
216
216
|
static create(e) {
|
|
217
|
-
return new
|
|
217
|
+
return new x(d(e));
|
|
218
218
|
}
|
|
219
219
|
next() {
|
|
220
220
|
if (this.index >= this.count) {
|
|
@@ -235,43 +235,43 @@ class p {
|
|
|
235
235
|
case 4:
|
|
236
236
|
case 6:
|
|
237
237
|
case 14: {
|
|
238
|
-
const e =
|
|
239
|
-
|
|
238
|
+
const e = O(this.elementType);
|
|
239
|
+
u(this.payload, this.offset, e);
|
|
240
240
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
241
|
-
return this.offset += e, new
|
|
241
|
+
return this.offset += e, new g(this.elementType, r);
|
|
242
242
|
}
|
|
243
243
|
case 12:
|
|
244
244
|
case 13: {
|
|
245
|
-
const e = { offset: this.offset }, r =
|
|
246
|
-
|
|
245
|
+
const e = { offset: this.offset }, r = f(this.payload, e, "ArrayMalformed");
|
|
246
|
+
u(this.payload, e.offset, r);
|
|
247
247
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
248
|
-
return this.offset = e.offset + r, new
|
|
248
|
+
return this.offset = e.offset + r, new g(this.elementType, s);
|
|
249
249
|
}
|
|
250
250
|
case 11: {
|
|
251
|
-
const e = { offset: this.offset }, r =
|
|
252
|
-
|
|
251
|
+
const e = { offset: this.offset }, r = f(this.payload, e, "ArrayMalformed");
|
|
252
|
+
u(this.payload, e.offset, r);
|
|
253
253
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
254
|
-
return this.offset = e.offset + r, new
|
|
254
|
+
return this.offset = e.offset + r, new g(11, s);
|
|
255
255
|
}
|
|
256
256
|
case 9: {
|
|
257
|
-
const e =
|
|
258
|
-
return this.offset += e, new
|
|
257
|
+
const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
258
|
+
return this.offset += e, new g(9, r);
|
|
259
259
|
}
|
|
260
260
|
case 10: {
|
|
261
261
|
const e = X(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
262
|
-
return this.offset += e, new
|
|
262
|
+
return this.offset += e, new g(10, r);
|
|
263
263
|
}
|
|
264
264
|
default:
|
|
265
|
-
throw new Error(`Unsupported array element type ${
|
|
265
|
+
throw new Error(`Unsupported array element type ${P[this.elementType]}`);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
class
|
|
269
|
+
class g extends R {
|
|
270
270
|
constructor(e, r) {
|
|
271
271
|
super(e, r);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
class
|
|
274
|
+
class W {
|
|
275
275
|
payload;
|
|
276
276
|
keyType;
|
|
277
277
|
valueType;
|
|
@@ -285,10 +285,10 @@ class K {
|
|
|
285
285
|
throw new Error("Dictionary key/value flags must be zero");
|
|
286
286
|
st(this.keyType);
|
|
287
287
|
const r = { offset: 2 };
|
|
288
|
-
this.count =
|
|
288
|
+
this.count = f(e, r, "DictMalformed"), this.offset = r.offset;
|
|
289
289
|
}
|
|
290
290
|
static create(e) {
|
|
291
|
-
return new
|
|
291
|
+
return new W(d(e));
|
|
292
292
|
}
|
|
293
293
|
next() {
|
|
294
294
|
if (this.index >= this.count) {
|
|
@@ -297,18 +297,18 @@ class K {
|
|
|
297
297
|
return null;
|
|
298
298
|
}
|
|
299
299
|
const e = this.readKey(), r = this.readValue();
|
|
300
|
-
return this.index++, new
|
|
300
|
+
return this.index++, new Lt(e, r);
|
|
301
301
|
}
|
|
302
302
|
readKey() {
|
|
303
|
-
const e =
|
|
303
|
+
const e = O(this.keyType);
|
|
304
304
|
if (e >= 0) {
|
|
305
|
-
|
|
305
|
+
u(this.payload, this.offset, e);
|
|
306
306
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
307
307
|
return this.offset += e, new R(this.keyType, r);
|
|
308
308
|
}
|
|
309
309
|
if (this.keyType === 12 || this.keyType === 13) {
|
|
310
|
-
const r = { offset: this.offset }, s =
|
|
311
|
-
|
|
310
|
+
const r = { offset: this.offset }, s = f(this.payload, r, "DictMalformed");
|
|
311
|
+
u(this.payload, r.offset, s);
|
|
312
312
|
const n = this.payload.subarray(r.offset, r.offset + s);
|
|
313
313
|
return this.offset = r.offset + s, new R(this.keyType, n);
|
|
314
314
|
}
|
|
@@ -318,19 +318,19 @@ class K {
|
|
|
318
318
|
switch (this.valueType) {
|
|
319
319
|
case 12:
|
|
320
320
|
case 13: {
|
|
321
|
-
const e = { offset: this.offset }, r =
|
|
322
|
-
|
|
321
|
+
const e = { offset: this.offset }, r = f(this.payload, e, "DictMalformed");
|
|
322
|
+
u(this.payload, e.offset, r);
|
|
323
323
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
324
324
|
return this.offset = e.offset + r, new R(this.valueType, s);
|
|
325
325
|
}
|
|
326
326
|
case 11: {
|
|
327
|
-
const e = { offset: this.offset }, r =
|
|
328
|
-
|
|
327
|
+
const e = { offset: this.offset }, r = f(this.payload, e, "DictMalformed");
|
|
328
|
+
u(this.payload, e.offset, r);
|
|
329
329
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
330
330
|
return this.offset = e.offset + r, new R(11, s);
|
|
331
331
|
}
|
|
332
332
|
case 9: {
|
|
333
|
-
const e =
|
|
333
|
+
const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
334
334
|
return this.offset += e, new R(9, r);
|
|
335
335
|
}
|
|
336
336
|
case 10: {
|
|
@@ -346,17 +346,17 @@ class K {
|
|
|
346
346
|
case 6:
|
|
347
347
|
case 14:
|
|
348
348
|
case 1: {
|
|
349
|
-
const e =
|
|
350
|
-
|
|
349
|
+
const e = O(this.valueType);
|
|
350
|
+
u(this.payload, this.offset, e);
|
|
351
351
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
352
352
|
return this.offset += e, new R(this.valueType, r);
|
|
353
353
|
}
|
|
354
354
|
default:
|
|
355
|
-
throw new Error(`Unsupported dictionary value type ${
|
|
355
|
+
throw new Error(`Unsupported dictionary value type ${P[this.valueType]}`);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
class
|
|
359
|
+
class Lt {
|
|
360
360
|
constructor(e, r) {
|
|
361
361
|
this.key = e, this.value = r;
|
|
362
362
|
}
|
|
@@ -371,8 +371,8 @@ class l {
|
|
|
371
371
|
const r = e.replace(/-/g, "");
|
|
372
372
|
if (r.length !== 32)
|
|
373
373
|
throw new Error("Guid string must be 32 hex characters");
|
|
374
|
-
const s = new Uint8Array(16), n = l.parseHexSlice(r, 0, 8),
|
|
375
|
-
l.writeUInt32LE(s, 0, n), l.writeUInt16LE(s, 4,
|
|
374
|
+
const s = new Uint8Array(16), n = l.parseHexSlice(r, 0, 8), a = l.parseHexSlice(r, 8, 4), i = l.parseHexSlice(r, 12, 4);
|
|
375
|
+
l.writeUInt32LE(s, 0, n), l.writeUInt16LE(s, 4, a), l.writeUInt16LE(s, 6, i);
|
|
376
376
|
for (let _ = 0; _ < 8; _++)
|
|
377
377
|
s[8 + _] = l.parseHexSlice(r, 16 + _ * 2, 2);
|
|
378
378
|
return new l(s);
|
|
@@ -408,10 +408,10 @@ class l {
|
|
|
408
408
|
return this.bytes.slice();
|
|
409
409
|
}
|
|
410
410
|
static parseHexSlice(e, r, s) {
|
|
411
|
-
const n = e.substr(r, s),
|
|
412
|
-
if (Number.isNaN(
|
|
411
|
+
const n = e.substr(r, s), a = Number.parseInt(n, 16);
|
|
412
|
+
if (Number.isNaN(a))
|
|
413
413
|
throw new Error("Guid string contains invalid characters");
|
|
414
|
-
return
|
|
414
|
+
return a >>> 0;
|
|
415
415
|
}
|
|
416
416
|
static writeUInt32LE(e, r, s) {
|
|
417
417
|
const n = s >>> 0;
|
|
@@ -431,14 +431,14 @@ class l {
|
|
|
431
431
|
return (e >>> 0).toString(16).padStart(r, "0");
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function f(t, e, r) {
|
|
435
435
|
if (e.offset >= t.length)
|
|
436
436
|
throw new Error(r);
|
|
437
|
-
let s = 0, n = 0,
|
|
437
|
+
let s = 0, n = 0, a = 0;
|
|
438
438
|
for (; e.offset < t.length; ) {
|
|
439
|
-
const
|
|
440
|
-
if (
|
|
441
|
-
if (
|
|
439
|
+
const i = t[e.offset++];
|
|
440
|
+
if (a++, s |= (i & 127) << n, (i & 128) === 0) {
|
|
441
|
+
if (a !== mt(s))
|
|
442
442
|
throw new Error("Teleport VarUInt is not canonical");
|
|
443
443
|
return s >>> 0;
|
|
444
444
|
}
|
|
@@ -447,10 +447,10 @@ function h(t, e, r) {
|
|
|
447
447
|
}
|
|
448
448
|
throw new Error(r);
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function mt(t) {
|
|
451
451
|
return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function O(t) {
|
|
454
454
|
switch (t) {
|
|
455
455
|
case 3:
|
|
456
456
|
case 5:
|
|
@@ -474,27 +474,27 @@ function st(t) {
|
|
|
474
474
|
if (t === 9 || t === 11 || t === 10 || t === 1)
|
|
475
475
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function u(t, e, r) {
|
|
478
478
|
if (e < 0 || r < 0 || e + r > t.length)
|
|
479
479
|
throw new Error("Teleport payload exceeds bounds");
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function Dt(t, e) {
|
|
482
482
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function K(t, e) {
|
|
485
485
|
if (e >= t.length)
|
|
486
486
|
throw new Error("Array payload exceeds bounds");
|
|
487
487
|
const r = t[e], s = r >> 4 & 15;
|
|
488
488
|
if ((r & 15) !== 0)
|
|
489
489
|
throw new Error("Array flags must be zero");
|
|
490
|
-
const n = { offset: e + 1 },
|
|
491
|
-
if (
|
|
492
|
-
const E =
|
|
493
|
-
return
|
|
490
|
+
const n = { offset: e + 1 }, a = f(t, n, "ArrayMalformed"), i = O(s);
|
|
491
|
+
if (i >= 0) {
|
|
492
|
+
const E = i * a;
|
|
493
|
+
return u(t, n.offset, E), n.offset + E - e;
|
|
494
494
|
}
|
|
495
495
|
let _ = n.offset;
|
|
496
|
-
for (let E = 0; E <
|
|
497
|
-
_ =
|
|
496
|
+
for (let E = 0; E < a; E++)
|
|
497
|
+
_ = H(s, t, _, "ArrayMalformed");
|
|
498
498
|
return _ - e;
|
|
499
499
|
}
|
|
500
500
|
function X(t, e) {
|
|
@@ -504,249 +504,156 @@ function X(t, e) {
|
|
|
504
504
|
if ((t[e] & 15) !== 0 || (t[e + 1] & 15) !== 0)
|
|
505
505
|
throw new Error("Dictionary key/value flags must be zero");
|
|
506
506
|
st(r);
|
|
507
|
-
const n = { offset: e + 2 },
|
|
508
|
-
let
|
|
509
|
-
for (let _ = 0; _ <
|
|
510
|
-
|
|
511
|
-
return
|
|
512
|
-
}
|
|
513
|
-
function
|
|
514
|
-
const n =
|
|
507
|
+
const n = { offset: e + 2 }, a = f(t, n, "DictMalformed");
|
|
508
|
+
let i = n.offset;
|
|
509
|
+
for (let _ = 0; _ < a; _++)
|
|
510
|
+
i = H(r, t, i, "DictMalformed"), i = H(s, t, i, "DictMalformed");
|
|
511
|
+
return i - e;
|
|
512
|
+
}
|
|
513
|
+
function H(t, e, r, s) {
|
|
514
|
+
const n = O(t);
|
|
515
515
|
if (n >= 0)
|
|
516
|
-
return
|
|
516
|
+
return u(e, r, n), r + n;
|
|
517
517
|
switch (t) {
|
|
518
518
|
case 12:
|
|
519
519
|
case 13: {
|
|
520
|
-
const
|
|
521
|
-
return
|
|
520
|
+
const a = { offset: r }, i = f(e, a, s);
|
|
521
|
+
return u(e, a.offset, i), a.offset + i;
|
|
522
522
|
}
|
|
523
523
|
case 11: {
|
|
524
|
-
const
|
|
525
|
-
return
|
|
524
|
+
const a = { offset: r }, i = f(e, a, s);
|
|
525
|
+
return u(e, a.offset, i), a.offset + i;
|
|
526
526
|
}
|
|
527
527
|
case 9:
|
|
528
|
-
return r +
|
|
528
|
+
return r + K(e, r);
|
|
529
529
|
case 10:
|
|
530
530
|
return r + X(e, r);
|
|
531
531
|
default:
|
|
532
|
-
throw new Error(`Unsupported Teleport type ${
|
|
532
|
+
throw new Error(`Unsupported Teleport type ${P[t]}`);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
function Q(t) {
|
|
536
536
|
return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function d(t) {
|
|
539
539
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
540
540
|
}
|
|
541
|
-
var N = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(N || {}), g = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_RESET_IDLE = 65560] = "CORE_RESET_IDLE", t[t.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", t[t.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", t[t.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", t[t.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", t[t.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", t[t.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", t[t.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", t[t.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", t[t.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(g || {});
|
|
542
|
-
const
|
|
543
|
-
function
|
|
541
|
+
var h = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(h || {}), V = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_RESET_IDLE = 65560] = "CORE_RESET_IDLE", t[t.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", t[t.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", t[t.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_WEBRTC_ICE_SERVERS_REQUEST = 65573] = "CORE_WEBRTC_ICE_SERVERS_REQUEST", t[t.CORE_WEBRTC_ICE_SERVERS_RESPONSE = 65574] = "CORE_WEBRTC_ICE_SERVERS_RESPONSE", t[t.CORE_WEBRTC_CLOSE = 65575] = "CORE_WEBRTC_CLOSE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", t[t.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", t[t.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", t[t.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", t[t.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", t[t.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", t[t.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(V || {});
|
|
542
|
+
const Pt = 4194309, Ot = 205938238, yt = 1594075008, wt = 2026534360, gt = 3409001585, Ft = 3466650495, Mt = 4007456593, dt = 4017217601, Bt = 4065417427, bt = 4086360332;
|
|
543
|
+
function Gt(t) {
|
|
544
544
|
const e = {};
|
|
545
545
|
return nt(e), e;
|
|
546
546
|
}
|
|
547
547
|
function nt(t) {
|
|
548
548
|
return t.Samples = new Uint8Array(0), t.Epoch = 0, t.Sequence = 0, t.FrameSizeInInterleavedSamples = 0, t.TimeStampInInterleavedSamples = 0n, t.IsFirst = !1, t.IsLast = !1, t.AverageVolume = 0, t.AudioEventEstimatedDuration = 0, t;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
551
|
-
const r =
|
|
552
|
-
return
|
|
550
|
+
function Vt(t, e) {
|
|
551
|
+
const r = M.create(t);
|
|
552
|
+
return vt(r, e);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
555
|
-
const r = e ??
|
|
556
|
-
return nt(r),
|
|
554
|
+
function vt(t, e) {
|
|
555
|
+
const r = e ?? Gt();
|
|
556
|
+
return nt(r), kt(t, r), r;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function kt(t, e) {
|
|
559
559
|
let r;
|
|
560
560
|
for (; (r = t.next()) !== null; )
|
|
561
561
|
switch (r.fieldId) {
|
|
562
|
-
case
|
|
562
|
+
case Ot: {
|
|
563
563
|
if (r.isNull) throw new Error();
|
|
564
564
|
e.AverageVolume = r.asFloat32();
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
|
-
case
|
|
567
|
+
case yt: {
|
|
568
568
|
if (r.isNull) throw new Error();
|
|
569
569
|
e.IsFirst = r.asBool();
|
|
570
570
|
break;
|
|
571
571
|
}
|
|
572
|
-
case
|
|
572
|
+
case wt: {
|
|
573
573
|
if (r.isNull) throw new Error();
|
|
574
574
|
e.TimeStampInInterleavedSamples = r.asUInt64();
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
|
-
case
|
|
577
|
+
case gt: {
|
|
578
578
|
if (r.isNull) throw new Error();
|
|
579
579
|
e.Samples = r.asBinary();
|
|
580
580
|
break;
|
|
581
581
|
}
|
|
582
|
-
case
|
|
582
|
+
case Ft: {
|
|
583
583
|
if (r.isNull) throw new Error();
|
|
584
584
|
e.AudioEventEstimatedDuration = r.asFloat32();
|
|
585
585
|
break;
|
|
586
586
|
}
|
|
587
|
-
case
|
|
587
|
+
case Mt: {
|
|
588
588
|
if (r.isNull) throw new Error();
|
|
589
589
|
e.FrameSizeInInterleavedSamples = r.asUInt32();
|
|
590
590
|
break;
|
|
591
591
|
}
|
|
592
|
-
case
|
|
592
|
+
case dt: {
|
|
593
593
|
if (r.isNull) throw new Error();
|
|
594
594
|
e.IsLast = r.asBool();
|
|
595
595
|
break;
|
|
596
596
|
}
|
|
597
|
-
case
|
|
598
|
-
if (r.isNull) throw new Error();
|
|
599
|
-
e.Sequence = r.asUInt32();
|
|
600
|
-
break;
|
|
601
|
-
}
|
|
602
|
-
case Vt: {
|
|
603
|
-
if (r.isNull) throw new Error();
|
|
604
|
-
e.Epoch = r.asUInt32();
|
|
605
|
-
break;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
async function xt(t, e) {
|
|
610
|
-
const r = await W(t, yt);
|
|
611
|
-
return kt(r, e);
|
|
612
|
-
}
|
|
613
|
-
const Wt = 4194310, pt = 717315017, Kt = 2026534360, zt = 4007456593, Xt = 4065417427, $t = 4086360332;
|
|
614
|
-
function jt(t) {
|
|
615
|
-
const e = {};
|
|
616
|
-
return at(e), e;
|
|
617
|
-
}
|
|
618
|
-
function at(t) {
|
|
619
|
-
return t.Epoch = 0, t.Sequence = 0, t.FrameSizeInInterleavedSamples = 0, t.TimeStampInInterleavedSamples = 0n, t.ShapeSetValues = [], t;
|
|
620
|
-
}
|
|
621
|
-
function Qt(t, e) {
|
|
622
|
-
const r = w.create(t);
|
|
623
|
-
return Zt(r, e);
|
|
624
|
-
}
|
|
625
|
-
function Zt(t, e) {
|
|
626
|
-
const r = e ?? jt();
|
|
627
|
-
return at(r), qt(t, r), r;
|
|
628
|
-
}
|
|
629
|
-
function qt(t, e) {
|
|
630
|
-
let r;
|
|
631
|
-
for (; (r = t.next()) !== null; )
|
|
632
|
-
switch (r.fieldId) {
|
|
633
|
-
case pt: {
|
|
634
|
-
if (r.isNull) throw new Error();
|
|
635
|
-
e.ShapeSetValues = te(r.asArray());
|
|
636
|
-
break;
|
|
637
|
-
}
|
|
638
|
-
case Kt: {
|
|
639
|
-
if (r.isNull) throw new Error();
|
|
640
|
-
e.TimeStampInInterleavedSamples = r.asUInt64();
|
|
641
|
-
break;
|
|
642
|
-
}
|
|
643
|
-
case zt: {
|
|
644
|
-
if (r.isNull) throw new Error();
|
|
645
|
-
e.FrameSizeInInterleavedSamples = r.asUInt32();
|
|
646
|
-
break;
|
|
647
|
-
}
|
|
648
|
-
case Xt: {
|
|
597
|
+
case Bt: {
|
|
649
598
|
if (r.isNull) throw new Error();
|
|
650
599
|
e.Sequence = r.asUInt32();
|
|
651
600
|
break;
|
|
652
601
|
}
|
|
653
|
-
case
|
|
602
|
+
case bt: {
|
|
654
603
|
if (r.isNull) throw new Error();
|
|
655
604
|
e.Epoch = r.asUInt32();
|
|
656
605
|
break;
|
|
657
606
|
}
|
|
658
607
|
}
|
|
659
608
|
}
|
|
660
|
-
async function
|
|
661
|
-
const r = await
|
|
662
|
-
return
|
|
609
|
+
async function Yt(t, e) {
|
|
610
|
+
const r = await rt(t, Pt);
|
|
611
|
+
return Vt(r, e);
|
|
663
612
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
let r;
|
|
667
|
-
for (; (r = t.next()) !== null; )
|
|
668
|
-
e.push(ne(r.asObject()));
|
|
669
|
-
return e;
|
|
670
|
-
}
|
|
671
|
-
const ee = 1154362099, re = 3974819915;
|
|
672
|
-
function se(t) {
|
|
613
|
+
const Ht = 4194305, xt = 161083277, Wt = 265814330, Kt = 1368629611, Xt = 2431514951, zt = 2514959030, $t = 2745379226, jt = 3282782683, Qt = 3284746250, Zt = 4101844078;
|
|
614
|
+
function Jt(t) {
|
|
673
615
|
const e = {};
|
|
674
616
|
return it(e), e;
|
|
675
617
|
}
|
|
676
618
|
function it(t) {
|
|
677
|
-
return t.
|
|
678
|
-
}
|
|
679
|
-
function ne(t, e) {
|
|
680
|
-
const r = e ?? se();
|
|
681
|
-
return it(r), ae(t, r), r;
|
|
682
|
-
}
|
|
683
|
-
function ae(t, e) {
|
|
684
|
-
let r;
|
|
685
|
-
for (; (r = t.next()) !== null; )
|
|
686
|
-
switch (r.fieldId) {
|
|
687
|
-
case ee: {
|
|
688
|
-
if (r.isNull) throw new Error();
|
|
689
|
-
e.SetId = r.asUInt32();
|
|
690
|
-
break;
|
|
691
|
-
}
|
|
692
|
-
case re: {
|
|
693
|
-
if (r.isNull) throw new Error();
|
|
694
|
-
e.Values = ie(r.asArray());
|
|
695
|
-
break;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
619
|
+
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = h.Unknown, t.CodecDetails = "", t.SampleRate = 0, t.Channels = 0, t.ShapeSets = void 0, t.CorrelationId = void 0, t;
|
|
698
620
|
}
|
|
699
|
-
function
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
for (; (r = t.next()) !== null; )
|
|
703
|
-
e.push(r.asFloat32());
|
|
704
|
-
return e;
|
|
705
|
-
}
|
|
706
|
-
const _e = 4194305, Ee = 161083277, oe = 265814330, Ie = 1368629611, Ae = 2431514951, le = 2514959030, ue = 2745379226, Te = 3282782683, he = 3284746250, fe = 4101844078;
|
|
707
|
-
function Ne(t) {
|
|
708
|
-
const e = {};
|
|
709
|
-
return _t(e), e;
|
|
710
|
-
}
|
|
711
|
-
function _t(t) {
|
|
712
|
-
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = N.Unknown, t.CodecDetails = "", t.SampleRate = 0, t.Channels = 0, t.ShapeSets = void 0, t.CorrelationId = void 0, t;
|
|
713
|
-
}
|
|
714
|
-
function Ce(t, e) {
|
|
715
|
-
const r = w.create(t);
|
|
716
|
-
return Se(r, e);
|
|
621
|
+
function qt(t, e) {
|
|
622
|
+
const r = M.create(t);
|
|
623
|
+
return pt(r, e);
|
|
717
624
|
}
|
|
718
|
-
function
|
|
719
|
-
const r = e ??
|
|
720
|
-
return
|
|
625
|
+
function pt(t, e) {
|
|
626
|
+
const r = e ?? Jt();
|
|
627
|
+
return it(r), te(t, r), r;
|
|
721
628
|
}
|
|
722
|
-
function
|
|
629
|
+
function te(t, e) {
|
|
723
630
|
let r;
|
|
724
631
|
for (; (r = t.next()) !== null; )
|
|
725
632
|
switch (r.fieldId) {
|
|
726
|
-
case
|
|
633
|
+
case xt: {
|
|
727
634
|
if (r.isNull) throw new Error();
|
|
728
635
|
e.StreamId = r.asString();
|
|
729
636
|
break;
|
|
730
637
|
}
|
|
731
|
-
case
|
|
638
|
+
case Wt: {
|
|
732
639
|
if (r.isNull) {
|
|
733
640
|
e.ShapeSets = void 0;
|
|
734
641
|
break;
|
|
735
642
|
}
|
|
736
|
-
e.ShapeSets =
|
|
643
|
+
e.ShapeSets = re(r.asArray());
|
|
737
644
|
break;
|
|
738
645
|
}
|
|
739
|
-
case
|
|
646
|
+
case Kt: {
|
|
740
647
|
if (r.isNull) throw new Error();
|
|
741
648
|
e.Description = r.asString();
|
|
742
649
|
break;
|
|
743
650
|
}
|
|
744
|
-
case
|
|
651
|
+
case Xt: {
|
|
745
652
|
if (r.isNull) throw new Error();
|
|
746
653
|
e.Channels = r.asInt32();
|
|
747
654
|
break;
|
|
748
655
|
}
|
|
749
|
-
case
|
|
656
|
+
case zt: {
|
|
750
657
|
if (r.isNull) {
|
|
751
658
|
e.CorrelationId = void 0;
|
|
752
659
|
break;
|
|
@@ -754,73 +661,73 @@ function Re(t, e) {
|
|
|
754
661
|
e.CorrelationId = r.asString();
|
|
755
662
|
break;
|
|
756
663
|
}
|
|
757
|
-
case
|
|
664
|
+
case $t: {
|
|
758
665
|
if (r.isNull) throw new Error();
|
|
759
666
|
e.CodecDetails = r.asString();
|
|
760
667
|
break;
|
|
761
668
|
}
|
|
762
|
-
case
|
|
669
|
+
case jt: {
|
|
763
670
|
if (r.isNull) throw new Error();
|
|
764
671
|
e.SourceType = r.asString();
|
|
765
672
|
break;
|
|
766
673
|
}
|
|
767
|
-
case
|
|
674
|
+
case Qt: {
|
|
768
675
|
if (r.isNull) throw new Error();
|
|
769
676
|
e.Codec = r.asInt32();
|
|
770
677
|
break;
|
|
771
678
|
}
|
|
772
|
-
case
|
|
679
|
+
case Zt: {
|
|
773
680
|
if (r.isNull) throw new Error();
|
|
774
681
|
e.SampleRate = r.asInt32();
|
|
775
682
|
break;
|
|
776
683
|
}
|
|
777
684
|
}
|
|
778
685
|
}
|
|
779
|
-
async function
|
|
780
|
-
const r = await
|
|
781
|
-
return
|
|
686
|
+
async function ee(t, e) {
|
|
687
|
+
const r = await rt(t, Ht);
|
|
688
|
+
return qt(r, e);
|
|
782
689
|
}
|
|
783
|
-
function
|
|
690
|
+
function re(t) {
|
|
784
691
|
const e = [];
|
|
785
692
|
let r;
|
|
786
693
|
for (; (r = t.next()) !== null; )
|
|
787
|
-
e.push(
|
|
694
|
+
e.push(_e(r.asObject()));
|
|
788
695
|
return e;
|
|
789
696
|
}
|
|
790
|
-
const
|
|
791
|
-
function
|
|
697
|
+
const se = 1107713536, ne = 1154362099, ie = 1185721362;
|
|
698
|
+
function ae(t) {
|
|
792
699
|
const e = {};
|
|
793
|
-
return
|
|
700
|
+
return at(e), e;
|
|
794
701
|
}
|
|
795
|
-
function
|
|
702
|
+
function at(t) {
|
|
796
703
|
return t.SetId = 0, t.Name = "", t.ShapeNames = [], t;
|
|
797
704
|
}
|
|
798
|
-
function
|
|
799
|
-
const r = e ??
|
|
800
|
-
return
|
|
705
|
+
function _e(t, e) {
|
|
706
|
+
const r = e ?? ae();
|
|
707
|
+
return at(r), Ee(t, r), r;
|
|
801
708
|
}
|
|
802
|
-
function
|
|
709
|
+
function Ee(t, e) {
|
|
803
710
|
let r;
|
|
804
711
|
for (; (r = t.next()) !== null; )
|
|
805
712
|
switch (r.fieldId) {
|
|
806
|
-
case
|
|
713
|
+
case se: {
|
|
807
714
|
if (r.isNull) throw new Error();
|
|
808
715
|
e.Name = r.asString();
|
|
809
716
|
break;
|
|
810
717
|
}
|
|
811
|
-
case
|
|
718
|
+
case ne: {
|
|
812
719
|
if (r.isNull) throw new Error();
|
|
813
720
|
e.SetId = r.asUInt32();
|
|
814
721
|
break;
|
|
815
722
|
}
|
|
816
|
-
case
|
|
723
|
+
case ie: {
|
|
817
724
|
if (r.isNull) throw new Error();
|
|
818
|
-
e.ShapeNames =
|
|
725
|
+
e.ShapeNames = Ie(r.asArray());
|
|
819
726
|
break;
|
|
820
727
|
}
|
|
821
728
|
}
|
|
822
729
|
}
|
|
823
|
-
function
|
|
730
|
+
function Ie(t) {
|
|
824
731
|
const e = [];
|
|
825
732
|
let r;
|
|
826
733
|
for (; (r = t.next()) !== null; )
|
|
@@ -860,8 +767,8 @@ class Z {
|
|
|
860
767
|
let s = Atomics.load(this.readWrite, 1);
|
|
861
768
|
const n = Math.min(r, this.capacity - s);
|
|
862
769
|
this.storage.set(e.subarray(0, n), s);
|
|
863
|
-
const
|
|
864
|
-
return
|
|
770
|
+
const a = r - n;
|
|
771
|
+
return a > 0 && this.storage.set(e.subarray(n, n + a), 0), s = (s + r) % this.capacity, Atomics.store(this.readWrite, 1, s), Atomics.notify(this.readWrite, 1), r;
|
|
865
772
|
}
|
|
866
773
|
pop(e) {
|
|
867
774
|
const r = Math.min(this.availableRead(), e.length);
|
|
@@ -870,8 +777,8 @@ class Z {
|
|
|
870
777
|
let s = Atomics.load(this.readWrite, 0);
|
|
871
778
|
const n = Math.min(r, this.capacity - s);
|
|
872
779
|
e.set(this.storage.subarray(s, s + n), 0);
|
|
873
|
-
const
|
|
874
|
-
return
|
|
780
|
+
const a = r - n;
|
|
781
|
+
return a > 0 && e.set(this.storage.subarray(0, a), n), s = (s + r) % this.capacity, Atomics.store(this.readWrite, 0, s), r;
|
|
875
782
|
}
|
|
876
783
|
skip(e) {
|
|
877
784
|
const r = Math.min(this.availableRead(), e);
|
|
@@ -881,36 +788,36 @@ class Z {
|
|
|
881
788
|
return s = (s + r) % this.capacity, Atomics.store(this.readWrite, 0, s), r;
|
|
882
789
|
}
|
|
883
790
|
}
|
|
884
|
-
let
|
|
885
|
-
const
|
|
791
|
+
let oe = 1;
|
|
792
|
+
const Ae = /* @__PURE__ */ new Map(), le = {
|
|
886
793
|
0: "DEBUG",
|
|
887
794
|
1: "INFO",
|
|
888
795
|
2: "WARN",
|
|
889
796
|
3: "ERROR",
|
|
890
797
|
4: "NONE"
|
|
891
798
|
};
|
|
892
|
-
function
|
|
799
|
+
function Te(t, e) {
|
|
893
800
|
return `[${t}] ${e}`;
|
|
894
801
|
}
|
|
895
|
-
function
|
|
896
|
-
const n = (/* @__PURE__ */ new Date()).toISOString(),
|
|
802
|
+
function b(t, e, r, s) {
|
|
803
|
+
const n = (/* @__PURE__ */ new Date()).toISOString(), a = le[t], i = {
|
|
897
804
|
timestamp: n,
|
|
898
805
|
level: t,
|
|
899
|
-
levelName:
|
|
806
|
+
levelName: a,
|
|
900
807
|
component: e,
|
|
901
808
|
message: r,
|
|
902
809
|
args: s
|
|
903
810
|
};
|
|
904
|
-
for (const [_, E] of
|
|
905
|
-
const
|
|
906
|
-
if (t >=
|
|
811
|
+
for (const [_, E] of Ae) {
|
|
812
|
+
const I = E?.minLevel ?? 2;
|
|
813
|
+
if (t >= I)
|
|
907
814
|
try {
|
|
908
|
-
_(
|
|
815
|
+
_(i);
|
|
909
816
|
} catch {
|
|
910
817
|
}
|
|
911
818
|
}
|
|
912
|
-
if (
|
|
913
|
-
const _ =
|
|
819
|
+
if (oe <= t) {
|
|
820
|
+
const _ = Te(e, r);
|
|
914
821
|
switch (t) {
|
|
915
822
|
case 0:
|
|
916
823
|
console.debug(_, ...s);
|
|
@@ -927,50 +834,50 @@ function G(t, e, r, s) {
|
|
|
927
834
|
}
|
|
928
835
|
}
|
|
929
836
|
}
|
|
930
|
-
function
|
|
837
|
+
function _t(t) {
|
|
931
838
|
return {
|
|
932
839
|
debug(e, ...r) {
|
|
933
|
-
|
|
840
|
+
b(0, t, e, r);
|
|
934
841
|
},
|
|
935
842
|
info(e, ...r) {
|
|
936
|
-
|
|
843
|
+
b(1, t, e, r);
|
|
937
844
|
},
|
|
938
845
|
warn(e, ...r) {
|
|
939
|
-
|
|
846
|
+
b(2, t, e, r);
|
|
940
847
|
},
|
|
941
848
|
error(e, ...r) {
|
|
942
|
-
|
|
849
|
+
b(3, t, e, r);
|
|
943
850
|
}
|
|
944
851
|
};
|
|
945
852
|
}
|
|
946
|
-
const
|
|
947
|
-
function
|
|
853
|
+
const G = _t("Capabilities"), ue = globalThis;
|
|
854
|
+
function fe() {
|
|
948
855
|
if (typeof SharedArrayBuffer > "u")
|
|
949
|
-
return
|
|
856
|
+
return G.debug("SharedArrayBuffer not supported: SharedArrayBuffer is undefined"), !1;
|
|
950
857
|
if (typeof Atomics > "u")
|
|
951
|
-
return
|
|
952
|
-
if (
|
|
953
|
-
return
|
|
858
|
+
return G.debug("SharedArrayBuffer not supported: Atomics is undefined"), !1;
|
|
859
|
+
if (ue.crossOriginIsolated === !1)
|
|
860
|
+
return G.debug("SharedArrayBuffer not supported: crossOriginIsolated is false (missing COOP/COEP headers)"), !1;
|
|
954
861
|
try {
|
|
955
862
|
new SharedArrayBuffer(1);
|
|
956
863
|
} catch (t) {
|
|
957
|
-
return
|
|
864
|
+
return G.debug(`SharedArrayBuffer not supported: construction failed - ${t instanceof Error ? t.message : String(t)}`), !1;
|
|
958
865
|
}
|
|
959
866
|
return !0;
|
|
960
867
|
}
|
|
961
|
-
const
|
|
868
|
+
const Et = 48e3, It = 2, he = 1500, Ne = 10, J = 80, Ce = 50, q = 64, z = _t("AudioPlaybackWorker"), y = (t, e) => {
|
|
962
869
|
self.postMessage(t, e ?? []);
|
|
963
|
-
},
|
|
964
|
-
let v = "pcm",
|
|
965
|
-
function
|
|
870
|
+
}, Re = fe();
|
|
871
|
+
let v = "pcm", ot = !0, At = !1, c = Et, S = It, D = null;
|
|
872
|
+
function m(t, e) {
|
|
966
873
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
967
|
-
|
|
874
|
+
y({ type: "error", error: { name: r.name, message: r.message, stack: r.stack }, streamId: e });
|
|
968
875
|
}
|
|
969
|
-
function
|
|
970
|
-
const e =
|
|
876
|
+
function $(t) {
|
|
877
|
+
const e = et(t);
|
|
971
878
|
return `${e.senderId}_${e.trackId}`;
|
|
972
879
|
}
|
|
973
|
-
class
|
|
880
|
+
class Se {
|
|
974
881
|
mode;
|
|
975
882
|
ring = null;
|
|
976
883
|
sab = void 0;
|
|
@@ -983,7 +890,7 @@ class He {
|
|
|
983
890
|
pcmBatchOffset = 0;
|
|
984
891
|
lastPcmFlushTimeMs = 0;
|
|
985
892
|
constructor(e) {
|
|
986
|
-
this.streamId = e, this.mode = "pcm", this.outputSampleRate = c, this.outputChannels =
|
|
893
|
+
this.streamId = e, this.mode = "pcm", this.outputSampleRate = c, this.outputChannels = S, this.rebind(v);
|
|
987
894
|
}
|
|
988
895
|
close() {
|
|
989
896
|
this.closed = !0, this.pcmBatchBuffer = null, this.pcmBatchOffset = 0, this.ring = null, this.sab = void 0;
|
|
@@ -993,8 +900,8 @@ class He {
|
|
|
993
900
|
}
|
|
994
901
|
rebind(e) {
|
|
995
902
|
if (!this.closed) {
|
|
996
|
-
if (this.mode = e, e === "sab" &&
|
|
997
|
-
const r = Math.floor(
|
|
903
|
+
if (this.mode = e, e === "sab" && Re) {
|
|
904
|
+
const r = Math.floor(he * this.outputSampleRate * this.outputChannels / 1e3), s = Z.getStorageForCapacity(r, Float32Array), n = new Z(s, Float32Array);
|
|
998
905
|
n.flush(), this.sab = s, this.ring = n;
|
|
999
906
|
return;
|
|
1000
907
|
}
|
|
@@ -1004,11 +911,11 @@ class He {
|
|
|
1004
911
|
flushPendingPcm(e) {
|
|
1005
912
|
if (this.closed || this.mode !== "pcm" || this.pcmBatchOffset <= 0)
|
|
1006
913
|
return;
|
|
1007
|
-
const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels *
|
|
1008
|
-
if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >=
|
|
914
|
+
const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * J / 1e3));
|
|
915
|
+
if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >= Ce))
|
|
1009
916
|
return;
|
|
1010
|
-
const
|
|
1011
|
-
|
|
917
|
+
const a = new Float32Array(this.pcmBatchOffset);
|
|
918
|
+
a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = r, y({ type: "pcm", streamId: this.streamId, pcm: a }, [a.buffer]);
|
|
1012
919
|
}
|
|
1013
920
|
drainPcm() {
|
|
1014
921
|
this.flushPendingPcm(!0);
|
|
@@ -1017,20 +924,20 @@ class He {
|
|
|
1017
924
|
if (this.closed)
|
|
1018
925
|
return;
|
|
1019
926
|
if (this.mode === "sab" && this.ring) {
|
|
1020
|
-
const n = this.ring,
|
|
1021
|
-
let
|
|
1022
|
-
const _ = Math.floor(Math.max(0, n.capacity - 1) /
|
|
1023
|
-
|
|
1024
|
-
const E = Math.floor(n.availableWrite() /
|
|
927
|
+
const n = this.ring, a = this.outputChannels;
|
|
928
|
+
let i = e;
|
|
929
|
+
const _ = Math.floor(Math.max(0, n.capacity - 1) / a) * a;
|
|
930
|
+
i.length > _ && (i = i.subarray(i.length - _));
|
|
931
|
+
const E = Math.floor(n.availableWrite() / a) * a;
|
|
1025
932
|
if (E <= 0)
|
|
1026
933
|
return;
|
|
1027
|
-
|
|
934
|
+
i.length > E && (i = i.subarray(i.length - E)), n.push(i);
|
|
1028
935
|
return;
|
|
1029
936
|
}
|
|
1030
|
-
const r = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels *
|
|
937
|
+
const r = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * J / 1e3)), s = this.pcmBatchOffset + e.length;
|
|
1031
938
|
if (!this.pcmBatchBuffer || this.pcmBatchBuffer.length < s) {
|
|
1032
|
-
const n = Math.max(s, r * 2),
|
|
1033
|
-
this.pcmBatchBuffer && this.pcmBatchOffset > 0 &&
|
|
939
|
+
const n = Math.max(s, r * 2), a = new Float32Array(n);
|
|
940
|
+
this.pcmBatchBuffer && this.pcmBatchOffset > 0 && a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchBuffer = a;
|
|
1034
941
|
}
|
|
1035
942
|
this.pcmBatchBuffer.set(e, this.pcmBatchOffset), this.pcmBatchOffset += e.length, this.lastPcmFlushTimeMs === 0 && (this.lastPcmFlushTimeMs = performance.now()), this.flushPendingPcm(!1);
|
|
1036
943
|
}
|
|
@@ -1041,23 +948,23 @@ class He {
|
|
|
1041
948
|
this.closed || (this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = 0, this.ring?.flush());
|
|
1042
949
|
}
|
|
1043
950
|
}
|
|
1044
|
-
function
|
|
951
|
+
function ce(t) {
|
|
1045
952
|
switch (t) {
|
|
1046
|
-
case
|
|
953
|
+
case h.Opus:
|
|
1047
954
|
return "opus";
|
|
1048
|
-
case
|
|
955
|
+
case h.Mp3:
|
|
1049
956
|
return "mp3";
|
|
1050
957
|
default:
|
|
1051
958
|
return null;
|
|
1052
959
|
}
|
|
1053
960
|
}
|
|
1054
|
-
let
|
|
1055
|
-
function
|
|
961
|
+
let F = null;
|
|
962
|
+
function Ue(t) {
|
|
1056
963
|
const e = new DataView(t.buffer, t.byteOffset, t.byteLength), r = Math.floor(t.byteLength / 2);
|
|
1057
|
-
(!
|
|
964
|
+
(!F || F.length < r) && (F = new Float32Array(r));
|
|
1058
965
|
for (let s = 0; s < r; s++)
|
|
1059
|
-
|
|
1060
|
-
return
|
|
966
|
+
F[s] = e.getInt16(s * 2, !0) / 32768;
|
|
967
|
+
return F.subarray(0, r);
|
|
1061
968
|
}
|
|
1062
969
|
class j {
|
|
1063
970
|
inputSampleRate;
|
|
@@ -1086,53 +993,53 @@ class j {
|
|
|
1086
993
|
n.length > 0 && this.sink.writePcm(n);
|
|
1087
994
|
}
|
|
1088
995
|
convertAudioData(e) {
|
|
1089
|
-
const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format,
|
|
996
|
+
const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format, a = typeof n == "string" && n.includes("planar"), i = "f32-planar", _ = "f32", E = () => {
|
|
1090
997
|
const A = new Array(s);
|
|
1091
|
-
for (let
|
|
1092
|
-
const
|
|
1093
|
-
e.copyTo(
|
|
998
|
+
for (let T = 0; T < s; T++) {
|
|
999
|
+
const C = new Float32Array(r);
|
|
1000
|
+
e.copyTo(C, { planeIndex: T, format: i }), A[T] = C;
|
|
1094
1001
|
}
|
|
1095
|
-
return
|
|
1096
|
-
},
|
|
1002
|
+
return Be(A, r);
|
|
1003
|
+
}, I = () => {
|
|
1097
1004
|
const A = new Float32Array(r * s);
|
|
1098
1005
|
return e.copyTo(A, { planeIndex: 0, format: _ }), A;
|
|
1099
1006
|
};
|
|
1100
|
-
let
|
|
1101
|
-
if (
|
|
1007
|
+
let o;
|
|
1008
|
+
if (a)
|
|
1102
1009
|
try {
|
|
1103
|
-
|
|
1010
|
+
o = E();
|
|
1104
1011
|
} catch (A) {
|
|
1105
|
-
|
|
1012
|
+
z.debug(`Failed to read planar audio data, falling back to interleaved copy: ${A}`), o = I();
|
|
1106
1013
|
}
|
|
1107
1014
|
else
|
|
1108
|
-
|
|
1109
|
-
return
|
|
1015
|
+
o = I();
|
|
1016
|
+
return o;
|
|
1110
1017
|
}
|
|
1111
1018
|
convertPcmBuffer(e, r, s) {
|
|
1112
1019
|
if (e.length === 0)
|
|
1113
1020
|
return e;
|
|
1114
|
-
let n = e,
|
|
1021
|
+
let n = e, a = e.length, i = r;
|
|
1115
1022
|
if (s !== c) {
|
|
1116
|
-
const _ =
|
|
1117
|
-
|
|
1023
|
+
const _ = a / i, I = Math.max(1, Math.round(_ * c / s)) * i, o = this.getResampleBuffer(I);
|
|
1024
|
+
a = Ge(n, o, i, s, c), n = o;
|
|
1118
1025
|
}
|
|
1119
|
-
if (
|
|
1120
|
-
const E =
|
|
1121
|
-
|
|
1026
|
+
if (i !== S) {
|
|
1027
|
+
const E = a / i * S, I = this.getRemixBuffer(E);
|
|
1028
|
+
a = Ve(n.subarray(0, a), I, i, S), n = I, i = S;
|
|
1122
1029
|
}
|
|
1123
|
-
return n.subarray(0,
|
|
1030
|
+
return n.subarray(0, a);
|
|
1124
1031
|
}
|
|
1125
1032
|
}
|
|
1126
|
-
class
|
|
1033
|
+
class Le extends j {
|
|
1127
1034
|
feedChunk(e) {
|
|
1128
1035
|
e.isFirst && this.reset();
|
|
1129
|
-
const r =
|
|
1036
|
+
const r = Ue(e.data);
|
|
1130
1037
|
this.writeConvertedPcm(r, this.inputChannels, this.inputSampleRate), e.isLast && this.reset();
|
|
1131
1038
|
}
|
|
1132
1039
|
close() {
|
|
1133
1040
|
}
|
|
1134
1041
|
}
|
|
1135
|
-
class
|
|
1042
|
+
class me extends j {
|
|
1136
1043
|
decoder;
|
|
1137
1044
|
codec;
|
|
1138
1045
|
constructor(e) {
|
|
@@ -1142,7 +1049,7 @@ class pe extends j {
|
|
|
1142
1049
|
const s = this.convertAudioData(r);
|
|
1143
1050
|
this.writeConvertedPcm(s, r.numberOfChannels, r.sampleRate);
|
|
1144
1051
|
} catch (s) {
|
|
1145
|
-
|
|
1052
|
+
m(s);
|
|
1146
1053
|
} finally {
|
|
1147
1054
|
try {
|
|
1148
1055
|
r.close();
|
|
@@ -1151,7 +1058,7 @@ class pe extends j {
|
|
|
1151
1058
|
}
|
|
1152
1059
|
},
|
|
1153
1060
|
error: (r) => {
|
|
1154
|
-
|
|
1061
|
+
m(r);
|
|
1155
1062
|
}
|
|
1156
1063
|
}), this.decoder.configure({ codec: e.codec, numberOfChannels: e.inputChannels, sampleRate: e.inputSampleRate });
|
|
1157
1064
|
}
|
|
@@ -1169,7 +1076,7 @@ class pe extends j {
|
|
|
1169
1076
|
), e.isLast && this.decoder.flush().catch(() => {
|
|
1170
1077
|
});
|
|
1171
1078
|
} catch (r) {
|
|
1172
|
-
|
|
1079
|
+
m(r);
|
|
1173
1080
|
try {
|
|
1174
1081
|
this.reset();
|
|
1175
1082
|
} catch {
|
|
@@ -1181,7 +1088,7 @@ class pe extends j {
|
|
|
1181
1088
|
try {
|
|
1182
1089
|
this.decoder.reset(), this.decoder.configure({ codec: this.codec, numberOfChannels: this.inputChannels, sampleRate: this.inputSampleRate });
|
|
1183
1090
|
} catch (e) {
|
|
1184
|
-
|
|
1091
|
+
m(e);
|
|
1185
1092
|
}
|
|
1186
1093
|
}
|
|
1187
1094
|
close() {
|
|
@@ -1191,7 +1098,7 @@ class pe extends j {
|
|
|
1191
1098
|
}
|
|
1192
1099
|
}
|
|
1193
1100
|
}
|
|
1194
|
-
class
|
|
1101
|
+
class De extends j {
|
|
1195
1102
|
decoder = null;
|
|
1196
1103
|
isReady = !1;
|
|
1197
1104
|
decoderSampleRate = 48e3;
|
|
@@ -1199,8 +1106,8 @@ class Ke extends j {
|
|
|
1199
1106
|
async initialise(e, r) {
|
|
1200
1107
|
const { OpusDecoder: s, getOpusModule: n } = await import("./index-Ca9sTcGt.js");
|
|
1201
1108
|
await n();
|
|
1202
|
-
const
|
|
1203
|
-
this.decoderSampleRate =
|
|
1109
|
+
const i = [8e3, 12e3, 16e3, 24e3, 48e3].reduce((_, E) => Math.abs(E - r) < Math.abs(_ - r) ? E : _);
|
|
1110
|
+
this.decoderSampleRate = i, this.decoder = new s({ channels: e, sampleRate: this.decoderSampleRate }), await this.decoder.ready, this.isReady = !0, this.flushPendingChunks();
|
|
1204
1111
|
}
|
|
1205
1112
|
flushPendingChunks() {
|
|
1206
1113
|
if (!this.isReady || !this.decoder) {
|
|
@@ -1226,25 +1133,25 @@ class Ke extends j {
|
|
|
1226
1133
|
try {
|
|
1227
1134
|
if (e.data.byteLength === 0)
|
|
1228
1135
|
return;
|
|
1229
|
-
const s = this.decoder.decodeFrame(e.data), n = s.channelData,
|
|
1230
|
-
if (!
|
|
1136
|
+
const s = this.decoder.decodeFrame(e.data), n = s.channelData, a = s.samplesDecoded, i = n.length;
|
|
1137
|
+
if (!i || !a)
|
|
1231
1138
|
return;
|
|
1232
|
-
const _ =
|
|
1233
|
-
if (
|
|
1234
|
-
const
|
|
1235
|
-
for (let A = 0,
|
|
1236
|
-
E[
|
|
1237
|
-
} else if (
|
|
1238
|
-
E.set(n[0].subarray(0,
|
|
1139
|
+
const _ = a * i, E = this.getInterleavedBuffer(_);
|
|
1140
|
+
if (i === 2) {
|
|
1141
|
+
const I = n[0], o = n[1];
|
|
1142
|
+
for (let A = 0, T = 0; A < a; A++)
|
|
1143
|
+
E[T++] = I[A], E[T++] = o[A];
|
|
1144
|
+
} else if (i === 1)
|
|
1145
|
+
E.set(n[0].subarray(0, a));
|
|
1239
1146
|
else {
|
|
1240
|
-
let
|
|
1241
|
-
for (let
|
|
1242
|
-
for (let A = 0; A <
|
|
1243
|
-
E[
|
|
1147
|
+
let I = 0;
|
|
1148
|
+
for (let o = 0; o < a; o++)
|
|
1149
|
+
for (let A = 0; A < i; A++)
|
|
1150
|
+
E[I++] = n[A][o];
|
|
1244
1151
|
}
|
|
1245
|
-
this.writeConvertedPcm(E.subarray(0, _),
|
|
1152
|
+
this.writeConvertedPcm(E.subarray(0, _), i, this.decoderSampleRate), e.isLast && this.reset();
|
|
1246
1153
|
} catch (r) {
|
|
1247
|
-
|
|
1154
|
+
m(r), this.reset();
|
|
1248
1155
|
}
|
|
1249
1156
|
}
|
|
1250
1157
|
feedChunk(e) {
|
|
@@ -1262,21 +1169,21 @@ class Ke extends j {
|
|
|
1262
1169
|
this.decoder = null, this.pendingChunks.length = 0;
|
|
1263
1170
|
}
|
|
1264
1171
|
}
|
|
1265
|
-
const
|
|
1266
|
-
async function
|
|
1172
|
+
const N = /* @__PURE__ */ new Map();
|
|
1173
|
+
async function Pe(t) {
|
|
1267
1174
|
if (t.closed || t.decoder)
|
|
1268
1175
|
return;
|
|
1269
|
-
if (t.codec ===
|
|
1270
|
-
t.decoder = new
|
|
1176
|
+
if (t.codec === h.RawPcm16) {
|
|
1177
|
+
t.decoder = new Le({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
|
|
1271
1178
|
return;
|
|
1272
1179
|
}
|
|
1273
|
-
if (t.codec !==
|
|
1274
|
-
throw new Error(`Unsupported audio codec: ${
|
|
1275
|
-
const e =
|
|
1276
|
-
if (
|
|
1180
|
+
if (t.codec !== h.Opus && t.codec !== h.Mp3)
|
|
1181
|
+
throw new Error(`Unsupported audio codec: ${h[t.codec] ?? t.codec}`);
|
|
1182
|
+
const e = ce(t.codec);
|
|
1183
|
+
if (ot && typeof AudioDecoder < "u" && e !== null)
|
|
1277
1184
|
try {
|
|
1278
1185
|
if ((await AudioDecoder.isConfigSupported({ codec: e, numberOfChannels: t.inputChannels, sampleRate: t.inputSampleRate })).supported) {
|
|
1279
|
-
const n = new
|
|
1186
|
+
const n = new me({
|
|
1280
1187
|
codec: e,
|
|
1281
1188
|
inputChannels: t.inputChannels,
|
|
1282
1189
|
inputSampleRate: t.inputSampleRate,
|
|
@@ -1290,10 +1197,10 @@ async function ze(t) {
|
|
|
1290
1197
|
return;
|
|
1291
1198
|
}
|
|
1292
1199
|
} catch (s) {
|
|
1293
|
-
|
|
1200
|
+
z.warn(`WebCodecs AudioDecoder failed, falling back to WASM: ${s instanceof Error ? s.message : String(s)}`);
|
|
1294
1201
|
}
|
|
1295
|
-
if (t.codec ===
|
|
1296
|
-
const s = new
|
|
1202
|
+
if (t.codec === h.Opus) {
|
|
1203
|
+
const s = new De({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
|
|
1297
1204
|
if (await s.initialise(t.inputChannels, t.inputSampleRate), t.closed) {
|
|
1298
1205
|
s.close();
|
|
1299
1206
|
return;
|
|
@@ -1301,9 +1208,9 @@ async function ze(t) {
|
|
|
1301
1208
|
t.decoder = s;
|
|
1302
1209
|
return;
|
|
1303
1210
|
}
|
|
1304
|
-
throw new Error(`No available decoder for codec: ${
|
|
1211
|
+
throw new Error(`No available decoder for codec: ${h[t.codec] ?? t.codec}`);
|
|
1305
1212
|
}
|
|
1306
|
-
function
|
|
1213
|
+
function Oe(t) {
|
|
1307
1214
|
if (t.closed) {
|
|
1308
1215
|
t.pendingFrames.splice(0);
|
|
1309
1216
|
try {
|
|
@@ -1317,30 +1224,30 @@ function Xe(t) {
|
|
|
1317
1224
|
return;
|
|
1318
1225
|
const e = t.pendingFrames.splice(0);
|
|
1319
1226
|
for (const r of e)
|
|
1320
|
-
|
|
1227
|
+
lt(t, r);
|
|
1321
1228
|
}
|
|
1322
|
-
function
|
|
1229
|
+
function lt(t, e) {
|
|
1323
1230
|
if (t.closed || !t.decoder)
|
|
1324
1231
|
return;
|
|
1325
1232
|
const r = e.Epoch, s = Number(e.TimeStampInInterleavedSamples), n = e.FrameSizeInInterleavedSamples;
|
|
1326
1233
|
if (t.currentEpoch !== r && (t.currentEpoch = r, t.epochSet = !1, t.lastArrivalTimeMs = 0, t.jitterMs = 0, t.sink.flush(), t.decoder.reset()), !t.epochSet) {
|
|
1327
1234
|
t.epochSet = !0;
|
|
1328
|
-
const
|
|
1329
|
-
t.expectedIntervalMs = n * 1e3 /
|
|
1235
|
+
const T = t.inputSampleRate * t.inputChannels;
|
|
1236
|
+
t.expectedIntervalMs = n * 1e3 / T;
|
|
1330
1237
|
}
|
|
1331
|
-
const
|
|
1238
|
+
const a = performance.now();
|
|
1332
1239
|
if (t.lastArrivalTimeMs > 0) {
|
|
1333
|
-
const
|
|
1334
|
-
t.jitterMs = t.jitterMs + (
|
|
1240
|
+
const T = a - t.lastArrivalTimeMs, C = Math.abs(T - t.expectedIntervalMs);
|
|
1241
|
+
t.jitterMs = t.jitterMs + (C - t.jitterMs) / Ne;
|
|
1335
1242
|
}
|
|
1336
|
-
t.lastArrivalTimeMs =
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1243
|
+
t.lastArrivalTimeMs = a;
|
|
1244
|
+
const i = t.inputSampleRate * t.inputChannels, _ = c * S, E = Math.round(s * _ / i), I = Math.round(n * _ / i), o = Math.round(s * 1e6 / i), A = Math.round(n * 1e6 / i);
|
|
1245
|
+
y({
|
|
1339
1246
|
type: "frame",
|
|
1340
1247
|
streamId: t.streamId,
|
|
1341
1248
|
epoch: r,
|
|
1342
1249
|
timestampInterleavedSamples: E,
|
|
1343
|
-
frameSizeInterleavedSamples:
|
|
1250
|
+
frameSizeInterleavedSamples: I,
|
|
1344
1251
|
isFirst: e.IsFirst,
|
|
1345
1252
|
isLast: e.IsLast,
|
|
1346
1253
|
jitterMs: t.jitterMs
|
|
@@ -1348,12 +1255,12 @@ function Tt(t, e) {
|
|
|
1348
1255
|
data: e.Samples,
|
|
1349
1256
|
isFirst: e.IsFirst,
|
|
1350
1257
|
isLast: e.IsLast,
|
|
1351
|
-
timestampUs:
|
|
1258
|
+
timestampUs: o,
|
|
1352
1259
|
durationUs: A
|
|
1353
1260
|
});
|
|
1354
1261
|
}
|
|
1355
|
-
async function
|
|
1356
|
-
const e =
|
|
1262
|
+
async function ye(t) {
|
|
1263
|
+
const e = $(t), r = await ee(t), s = N.get(e);
|
|
1357
1264
|
if (s) {
|
|
1358
1265
|
s.closed = !0, s.pendingFrames.splice(0);
|
|
1359
1266
|
try {
|
|
@@ -1364,9 +1271,9 @@ async function $e(t) {
|
|
|
1364
1271
|
s.sink.drainPcm(), s.sink.close();
|
|
1365
1272
|
} catch {
|
|
1366
1273
|
}
|
|
1367
|
-
|
|
1274
|
+
N.delete(e);
|
|
1368
1275
|
}
|
|
1369
|
-
const n = new
|
|
1276
|
+
const n = new Se(e), a = {
|
|
1370
1277
|
streamId: e,
|
|
1371
1278
|
codec: r.Codec,
|
|
1372
1279
|
inputSampleRate: r.SampleRate,
|
|
@@ -1380,27 +1287,24 @@ async function $e(t) {
|
|
|
1380
1287
|
closed: !1,
|
|
1381
1288
|
lastArrivalTimeMs: 0,
|
|
1382
1289
|
jitterMs: 0,
|
|
1383
|
-
expectedIntervalMs: 20
|
|
1384
|
-
shapeSets: r.ShapeSets
|
|
1290
|
+
expectedIntervalMs: 20
|
|
1385
1291
|
};
|
|
1386
|
-
|
|
1292
|
+
N.set(e, a), y({
|
|
1387
1293
|
type: "streamBegin",
|
|
1388
1294
|
streamId: e,
|
|
1389
|
-
sharedArrayBuffer: n.getSharedArrayBuffer()
|
|
1390
|
-
shapeSets: r.ShapeSets
|
|
1295
|
+
sharedArrayBuffer: n.getSharedArrayBuffer()
|
|
1391
1296
|
});
|
|
1392
1297
|
}
|
|
1393
|
-
function
|
|
1394
|
-
for (const t of
|
|
1395
|
-
|
|
1298
|
+
function we() {
|
|
1299
|
+
for (const t of N.values())
|
|
1300
|
+
y({
|
|
1396
1301
|
type: "streamBegin",
|
|
1397
1302
|
streamId: t.streamId,
|
|
1398
|
-
sharedArrayBuffer: t.sink.getSharedArrayBuffer()
|
|
1399
|
-
shapeSets: t.shapeSets
|
|
1303
|
+
sharedArrayBuffer: t.sink.getSharedArrayBuffer()
|
|
1400
1304
|
});
|
|
1401
1305
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const e =
|
|
1306
|
+
function ge(t) {
|
|
1307
|
+
const e = $(t), r = N.get(e);
|
|
1404
1308
|
if (r) {
|
|
1405
1309
|
r.closed = !0, r.pendingFrames.splice(0);
|
|
1406
1310
|
try {
|
|
@@ -1411,76 +1315,55 @@ function Qe(t) {
|
|
|
1411
1315
|
r.decoder?.close();
|
|
1412
1316
|
} catch {
|
|
1413
1317
|
}
|
|
1414
|
-
r.decoder = null,
|
|
1318
|
+
r.decoder = null, N.delete(e), y({ type: "streamEnd", streamId: e });
|
|
1415
1319
|
}
|
|
1416
1320
|
}
|
|
1417
|
-
async function
|
|
1418
|
-
const e =
|
|
1321
|
+
async function Fe(t) {
|
|
1322
|
+
const e = $(t), r = N.get(e);
|
|
1419
1323
|
if (!r || r.closed)
|
|
1420
1324
|
return;
|
|
1421
|
-
const s = await
|
|
1422
|
-
if (!
|
|
1325
|
+
const s = await Yt(t);
|
|
1326
|
+
if (!At) {
|
|
1423
1327
|
if (!r.decoder) {
|
|
1424
|
-
if (r.pendingFrames.length >=
|
|
1425
|
-
const n = r.pendingFrames.length -
|
|
1426
|
-
r.pendingFrames.splice(0, n),
|
|
1328
|
+
if (r.pendingFrames.length >= q) {
|
|
1329
|
+
const n = r.pendingFrames.length - q + 1;
|
|
1330
|
+
r.pendingFrames.splice(0, n), z.warn(`Dropped ${n} frames waiting for decoder, streamId=${e.substring(0, 8)}`);
|
|
1427
1331
|
}
|
|
1428
|
-
r.pendingFrames.push(s), r.initTask || (r.initTask =
|
|
1429
|
-
r.closed ||
|
|
1332
|
+
r.pendingFrames.push(s), r.initTask || (r.initTask = Pe(r).then(() => Oe(r)).catch((n) => {
|
|
1333
|
+
r.closed || m(n, e);
|
|
1430
1334
|
}));
|
|
1431
1335
|
return;
|
|
1432
1336
|
}
|
|
1433
|
-
|
|
1337
|
+
lt(r, s);
|
|
1434
1338
|
}
|
|
1435
1339
|
}
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
m({
|
|
1441
|
-
type: "shapeFrame",
|
|
1442
|
-
streamId: e,
|
|
1443
|
-
epoch: s.Epoch,
|
|
1444
|
-
sequence: s.Sequence,
|
|
1445
|
-
timestampInterleavedSamples: Math.round(
|
|
1446
|
-
Number(s.TimeStampInInterleavedSamples) * i / n
|
|
1447
|
-
),
|
|
1448
|
-
frameSizeInterleavedSamples: Math.round(
|
|
1449
|
-
s.FrameSizeInInterleavedSamples * i / n
|
|
1450
|
-
),
|
|
1451
|
-
shapeSetValues: s.ShapeSetValues
|
|
1452
|
-
});
|
|
1453
|
-
}
|
|
1454
|
-
function Je(t) {
|
|
1455
|
-
switch (St(t)) {
|
|
1456
|
-
case g.AUDIO_STREAM_BEGIN:
|
|
1457
|
-
$e(t);
|
|
1458
|
-
return;
|
|
1459
|
-
case g.AUDIO_STREAM_END:
|
|
1460
|
-
Qe(t);
|
|
1340
|
+
function Me(t) {
|
|
1341
|
+
switch (Nt(t)) {
|
|
1342
|
+
case V.AUDIO_STREAM_BEGIN:
|
|
1343
|
+
ye(t);
|
|
1461
1344
|
return;
|
|
1462
|
-
case
|
|
1463
|
-
|
|
1345
|
+
case V.AUDIO_STREAM_END:
|
|
1346
|
+
ge(t);
|
|
1464
1347
|
return;
|
|
1465
|
-
case
|
|
1466
|
-
|
|
1348
|
+
case V.AUDIO_FRAME2:
|
|
1349
|
+
Fe(t);
|
|
1467
1350
|
return;
|
|
1468
1351
|
default:
|
|
1469
1352
|
return;
|
|
1470
1353
|
}
|
|
1471
1354
|
}
|
|
1472
|
-
function
|
|
1473
|
-
if (
|
|
1355
|
+
function Tt() {
|
|
1356
|
+
if (D) {
|
|
1474
1357
|
try {
|
|
1475
|
-
|
|
1358
|
+
D.close();
|
|
1476
1359
|
} catch {
|
|
1477
1360
|
}
|
|
1478
|
-
|
|
1361
|
+
D = null;
|
|
1479
1362
|
}
|
|
1480
1363
|
}
|
|
1481
|
-
function
|
|
1482
|
-
|
|
1483
|
-
for (const t of
|
|
1364
|
+
function de() {
|
|
1365
|
+
Tt();
|
|
1366
|
+
for (const t of N.values()) {
|
|
1484
1367
|
try {
|
|
1485
1368
|
t.sink.drainPcm(), t.sink.close();
|
|
1486
1369
|
} catch {
|
|
@@ -1490,101 +1373,101 @@ function tr() {
|
|
|
1490
1373
|
} catch {
|
|
1491
1374
|
}
|
|
1492
1375
|
}
|
|
1493
|
-
|
|
1376
|
+
N.clear();
|
|
1494
1377
|
}
|
|
1495
1378
|
self.addEventListener("message", (t) => {
|
|
1496
1379
|
const e = t.data;
|
|
1497
1380
|
if (e.type === "configure") {
|
|
1498
|
-
v = e.transport,
|
|
1381
|
+
v = e.transport, ot = e.preferWebCodecs ?? !0, At = e.webRtcEnabled ?? !1, c = Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 ? e.outputSampleRate : Et, S = Number.isFinite(e.outputChannels) && e.outputChannels > 0 ? e.outputChannels : It;
|
|
1499
1382
|
return;
|
|
1500
1383
|
}
|
|
1501
1384
|
if (e.type === "attachProtocolPort") {
|
|
1502
|
-
|
|
1385
|
+
Tt(), D = e.port, D.addEventListener("message", (r) => {
|
|
1503
1386
|
const s = r.data;
|
|
1504
|
-
s?.type === "protocol" && s.message instanceof ArrayBuffer &&
|
|
1505
|
-
}),
|
|
1387
|
+
s?.type === "protocol" && s.message instanceof ArrayBuffer && Me(new Uint8Array(s.message));
|
|
1388
|
+
}), D.start?.();
|
|
1506
1389
|
return;
|
|
1507
1390
|
}
|
|
1508
1391
|
if (e.type === "rebind") {
|
|
1509
|
-
v = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (c = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (
|
|
1510
|
-
for (const r of
|
|
1511
|
-
r.sink.setOutputFormat(c,
|
|
1512
|
-
|
|
1392
|
+
v = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (c = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (S = e.outputChannels);
|
|
1393
|
+
for (const r of N.values())
|
|
1394
|
+
r.sink.setOutputFormat(c, S), r.sink.rebind(v);
|
|
1395
|
+
we();
|
|
1513
1396
|
return;
|
|
1514
1397
|
}
|
|
1515
|
-
e.type === "dispose" &&
|
|
1398
|
+
e.type === "dispose" && de();
|
|
1516
1399
|
});
|
|
1517
1400
|
let U = null;
|
|
1518
|
-
function
|
|
1401
|
+
function Be(t, e) {
|
|
1519
1402
|
const r = t.length;
|
|
1520
1403
|
if (r === 1)
|
|
1521
1404
|
return t[0];
|
|
1522
1405
|
const s = e * r;
|
|
1523
1406
|
if ((!U || U.length < s) && (U = new Float32Array(s)), r === 2) {
|
|
1524
|
-
const n = t[0],
|
|
1525
|
-
for (let
|
|
1526
|
-
U[_++] = n[
|
|
1407
|
+
const n = t[0], a = t[1];
|
|
1408
|
+
for (let i = 0, _ = 0; i < e; i++)
|
|
1409
|
+
U[_++] = n[i], U[_++] = a[i];
|
|
1527
1410
|
} else {
|
|
1528
1411
|
let n = 0;
|
|
1529
|
-
for (let
|
|
1530
|
-
for (let
|
|
1531
|
-
U[n++] = t[
|
|
1412
|
+
for (let a = 0; a < e; a++)
|
|
1413
|
+
for (let i = 0; i < r; i++)
|
|
1414
|
+
U[n++] = t[i][a];
|
|
1532
1415
|
}
|
|
1533
1416
|
return U.subarray(0, s);
|
|
1534
1417
|
}
|
|
1535
|
-
const
|
|
1536
|
-
function
|
|
1418
|
+
const p = 3;
|
|
1419
|
+
function tt(t) {
|
|
1537
1420
|
if (t === 0)
|
|
1538
1421
|
return 1;
|
|
1539
1422
|
const e = Math.PI * t;
|
|
1540
1423
|
return Math.sin(e) / e;
|
|
1541
1424
|
}
|
|
1542
|
-
function
|
|
1543
|
-
return t === 0 ? 1 : Math.abs(t) >= e ? 0 :
|
|
1425
|
+
function be(t, e) {
|
|
1426
|
+
return t === 0 ? 1 : Math.abs(t) >= e ? 0 : tt(t) * tt(t / e);
|
|
1544
1427
|
}
|
|
1545
|
-
function
|
|
1428
|
+
function Ge(t, e, r, s, n) {
|
|
1546
1429
|
if (s === n)
|
|
1547
1430
|
return e.set(t), t.length;
|
|
1548
|
-
const
|
|
1549
|
-
for (let
|
|
1550
|
-
for (let A = 0; A <
|
|
1551
|
-
const
|
|
1552
|
-
let
|
|
1553
|
-
for (let
|
|
1554
|
-
const
|
|
1555
|
-
if (
|
|
1431
|
+
const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), _ = s / n, E = _ > 1 ? _ : 1, I = Math.ceil(p * E);
|
|
1432
|
+
for (let o = 0; o < r; o++)
|
|
1433
|
+
for (let A = 0; A < i; A++) {
|
|
1434
|
+
const T = A * _, C = Math.floor(T);
|
|
1435
|
+
let w = 0, L = 0;
|
|
1436
|
+
for (let k = -I + 1; k <= I; k++) {
|
|
1437
|
+
const B = C + k;
|
|
1438
|
+
if (B < 0 || B >= a)
|
|
1556
1439
|
continue;
|
|
1557
|
-
const
|
|
1440
|
+
const ut = (T - B) / E, Y = be(ut, p);
|
|
1558
1441
|
if (Y !== 0) {
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1442
|
+
const ft = t[B * r + o] ?? 0;
|
|
1443
|
+
w += ft * Y, L += Y;
|
|
1561
1444
|
}
|
|
1562
1445
|
}
|
|
1563
|
-
e[A * r +
|
|
1446
|
+
e[A * r + o] = L > 0 ? w / L : 0;
|
|
1564
1447
|
}
|
|
1565
|
-
return
|
|
1448
|
+
return i * r;
|
|
1566
1449
|
}
|
|
1567
|
-
function
|
|
1450
|
+
function Ve(t, e, r, s) {
|
|
1568
1451
|
const n = t.length / r;
|
|
1569
1452
|
if (r === s)
|
|
1570
1453
|
return e.set(t), t.length;
|
|
1571
1454
|
if (r === 1 && s === 2) {
|
|
1572
|
-
for (let
|
|
1573
|
-
const _ = t[
|
|
1574
|
-
e[
|
|
1455
|
+
for (let i = 0; i < n; i++) {
|
|
1456
|
+
const _ = t[i] ?? 0;
|
|
1457
|
+
e[i * 2] = _, e[i * 2 + 1] = _;
|
|
1575
1458
|
}
|
|
1576
1459
|
return n * 2;
|
|
1577
1460
|
}
|
|
1578
1461
|
if (r === 2 && s === 1) {
|
|
1579
|
-
for (let
|
|
1580
|
-
const _ = t[
|
|
1581
|
-
e[
|
|
1462
|
+
for (let i = 0; i < n; i++) {
|
|
1463
|
+
const _ = t[i * 2] ?? 0, E = t[i * 2 + 1] ?? 0;
|
|
1464
|
+
e[i] = (_ + E) * 0.5;
|
|
1582
1465
|
}
|
|
1583
1466
|
return n;
|
|
1584
1467
|
}
|
|
1585
|
-
const
|
|
1586
|
-
for (let
|
|
1587
|
-
for (let _ = 0; _ <
|
|
1588
|
-
e[
|
|
1468
|
+
const a = Math.min(r, s);
|
|
1469
|
+
for (let i = 0; i < n; i++)
|
|
1470
|
+
for (let _ = 0; _ < a; _++)
|
|
1471
|
+
e[i * s + _] = t[i * r + _] ?? 0;
|
|
1589
1472
|
return n * s;
|
|
1590
1473
|
}
|