@ikonai/sdk 1.0.41 → 1.0.42
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-capture-worker-DuKZS6HJ.js → audio-capture-worker-Dmgg-yWd.js} +151 -165
- package/assets/{audio-playback-worker-BkM1Wq_F.js → audio-playback-worker-MsPNs6k4.js} +449 -384
- package/assets/{protocol-worker-BVD4poVW.js → protocol-worker-4bSKGT40.js} +202 -193
- package/assets/{video-capture-worker-CpzIHq4o.js → video-capture-worker-Bitll1TI.js} +161 -161
- package/assets/{video-playback-worker-Djop0qmb.js → video-playback-worker-BQSKswID.js} +247 -245
- package/channel/channel-manager.d.ts +2 -2
- package/client/ikon-client-config.d.ts +1 -1
- package/client/ikon-client.d.ts +2 -0
- package/index.js +2382 -2213
- package/media/ikon-audio-playback.d.ts +4 -0
- package/package.json +1 -1
- package/utils/query-params.d.ts +3 -0
- package/webrtc/webrtc-signaling.d.ts +7 -6
- package/worker/audio-playback-worker.d.ts +10 -2
- package/worker/video-playback-worker.d.ts +1 -0
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Nt = {
|
|
2
2
|
Compressed: 8
|
|
3
3
|
};
|
|
4
|
-
function
|
|
4
|
+
function St(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 rt(t) {
|
|
10
|
+
const e = B(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), i = r.getUint32(8, !0), a = r.getUint32(12, !0), _ = r.getUint32(16, !0), E = r.getUint32(20, !0), o = r.getUint8(24), I = r.getUint8(25), l = 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
|
|
18
|
-
for (let
|
|
19
|
-
|
|
16
|
+
const S = [];
|
|
17
|
+
let w = 27;
|
|
18
|
+
for (let L = 0; L < E; L++)
|
|
19
|
+
S.push(r.getUint32(w, !0)), w += 4;
|
|
20
20
|
return {
|
|
21
21
|
length: s,
|
|
22
22
|
opcode: n,
|
|
23
|
-
senderId:
|
|
24
|
-
trackId:
|
|
23
|
+
senderId: i,
|
|
24
|
+
trackId: a,
|
|
25
25
|
sequenceId: _,
|
|
26
|
-
targetIds:
|
|
26
|
+
targetIds: S,
|
|
27
27
|
payloadVersion: o,
|
|
28
28
|
payloadType: I,
|
|
29
29
|
flags: l
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
33
|
-
const s =
|
|
32
|
+
async function Y(t, e, r) {
|
|
33
|
+
const s = B(t), n = rt(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 i = 27 + n.targetIds.length * 4;
|
|
39
|
+
let a = s.subarray(i, n.length);
|
|
40
|
+
return (n.flags & Nt.Compressed) !== 0 && (a = await Ct(a)), a;
|
|
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(), i = [];
|
|
48
|
+
let a = 0;
|
|
49
49
|
for (; ; ) {
|
|
50
50
|
const { done: o, value: I } = await n.read();
|
|
51
51
|
if (o) break;
|
|
52
|
-
|
|
52
|
+
i.push(I), a += I.length;
|
|
53
53
|
}
|
|
54
|
-
const _ = new Uint8Array(
|
|
54
|
+
const _ = new Uint8Array(a);
|
|
55
55
|
let E = 0;
|
|
56
|
-
for (let o = 0; o <
|
|
57
|
-
_.set(
|
|
56
|
+
for (let o = 0; o < i.length; o++)
|
|
57
|
+
_.set(i[o], E), E += i[o].length;
|
|
58
58
|
return _;
|
|
59
59
|
}
|
|
60
60
|
var y = /* @__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))(y || {});
|
|
61
|
-
const
|
|
61
|
+
const Rt = 161, Ut = 162;
|
|
62
62
|
new TextEncoder();
|
|
63
|
-
const
|
|
64
|
-
class
|
|
63
|
+
const mt = new TextDecoder("utf-8", { fatal: !0 });
|
|
64
|
+
class d {
|
|
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 = B(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] !== Ut)
|
|
75
75
|
throw new Error("Teleport object missing markers");
|
|
76
76
|
const s = { offset: 1 }, n = f(r, s, "InvalidLength");
|
|
77
|
-
return new
|
|
77
|
+
return new d(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 = yt(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 i;
|
|
91
91
|
if (n >= 0)
|
|
92
|
-
h(this.buffer, this.offset, n),
|
|
92
|
+
h(this.buffer, this.offset, n), i = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
|
|
93
93
|
else {
|
|
94
|
-
const
|
|
95
|
-
h(this.buffer,
|
|
94
|
+
const a = { offset: this.offset }, _ = f(this.buffer, a, "InvalidLength");
|
|
95
|
+
h(this.buffer, a.offset, _), i = this.buffer.subarray(a.offset, a.offset + _), this.offset = a.offset + _;
|
|
96
96
|
}
|
|
97
|
-
return new
|
|
97
|
+
return new Lt(e, s, i);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
class
|
|
100
|
+
class C {
|
|
101
101
|
constructor(e, r) {
|
|
102
102
|
this.type = e, this.payload = r;
|
|
103
103
|
}
|
|
@@ -159,7 +159,7 @@ class S {
|
|
|
159
159
|
return this.ensureType(
|
|
160
160
|
12
|
|
161
161
|
/* String */
|
|
162
|
-
),
|
|
162
|
+
), mt.decode(this.payload);
|
|
163
163
|
}
|
|
164
164
|
asGuid() {
|
|
165
165
|
return this.ensureType(
|
|
@@ -171,26 +171,26 @@ class S {
|
|
|
171
171
|
return this.ensureType(
|
|
172
172
|
11
|
|
173
173
|
/* Object */
|
|
174
|
-
),
|
|
174
|
+
), d.create(this.payload);
|
|
175
175
|
}
|
|
176
176
|
asArray() {
|
|
177
177
|
return this.ensureType(
|
|
178
178
|
9
|
|
179
179
|
/* Array */
|
|
180
|
-
),
|
|
180
|
+
), W.create(this.payload);
|
|
181
181
|
}
|
|
182
182
|
asDictionary() {
|
|
183
183
|
return this.ensureType(
|
|
184
184
|
10
|
|
185
185
|
/* Dict */
|
|
186
|
-
),
|
|
186
|
+
), K.create(this.payload);
|
|
187
187
|
}
|
|
188
188
|
ensureType(e) {
|
|
189
189
|
if (this.type !== e)
|
|
190
190
|
throw new Error(`Teleport value has type ${y[this.type]}, expected ${y[e]}`);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
class
|
|
193
|
+
class Lt extends C {
|
|
194
194
|
constructor(e, r, s) {
|
|
195
195
|
super(r, s), this.fieldId = e;
|
|
196
196
|
}
|
|
@@ -198,7 +198,7 @@ class Ut extends S {
|
|
|
198
198
|
return this.type === 1;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
class
|
|
201
|
+
class W {
|
|
202
202
|
payload;
|
|
203
203
|
elementType;
|
|
204
204
|
count;
|
|
@@ -214,7 +214,7 @@ class H {
|
|
|
214
214
|
this.count = f(e, s, "ArrayMalformed"), this.offset = s.offset;
|
|
215
215
|
}
|
|
216
216
|
static create(e) {
|
|
217
|
-
return new
|
|
217
|
+
return new W(B(e));
|
|
218
218
|
}
|
|
219
219
|
next() {
|
|
220
220
|
if (this.index >= this.count) {
|
|
@@ -235,43 +235,43 @@ class H {
|
|
|
235
235
|
case 4:
|
|
236
236
|
case 6:
|
|
237
237
|
case 14: {
|
|
238
|
-
const e =
|
|
238
|
+
const e = O(this.elementType);
|
|
239
239
|
h(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 F(this.elementType, r);
|
|
242
242
|
}
|
|
243
243
|
case 12:
|
|
244
244
|
case 13: {
|
|
245
245
|
const e = { offset: this.offset }, r = f(this.payload, e, "ArrayMalformed");
|
|
246
246
|
h(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 F(this.elementType, s);
|
|
249
249
|
}
|
|
250
250
|
case 11: {
|
|
251
251
|
const e = { offset: this.offset }, r = f(this.payload, e, "ArrayMalformed");
|
|
252
252
|
h(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 F(11, s);
|
|
255
255
|
}
|
|
256
256
|
case 9: {
|
|
257
|
-
const e =
|
|
258
|
-
return this.offset += e, new
|
|
257
|
+
const e = z(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
258
|
+
return this.offset += e, new F(9, r);
|
|
259
259
|
}
|
|
260
260
|
case 10: {
|
|
261
|
-
const e =
|
|
262
|
-
return this.offset += e, new
|
|
261
|
+
const e = X(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
262
|
+
return this.offset += e, new F(10, r);
|
|
263
263
|
}
|
|
264
264
|
default:
|
|
265
265
|
throw new Error(`Unsupported array element type ${y[this.elementType]}`);
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
class
|
|
269
|
+
class F extends C {
|
|
270
270
|
constructor(e, r) {
|
|
271
271
|
super(e, r);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
class
|
|
274
|
+
class K {
|
|
275
275
|
payload;
|
|
276
276
|
keyType;
|
|
277
277
|
valueType;
|
|
@@ -288,7 +288,7 @@ class W {
|
|
|
288
288
|
this.count = f(e, r, "DictMalformed"), this.offset = r.offset;
|
|
289
289
|
}
|
|
290
290
|
static create(e) {
|
|
291
|
-
return new
|
|
291
|
+
return new K(B(e));
|
|
292
292
|
}
|
|
293
293
|
next() {
|
|
294
294
|
if (this.index >= this.count) {
|
|
@@ -297,20 +297,20 @@ class W {
|
|
|
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 Dt(e, r);
|
|
301
301
|
}
|
|
302
302
|
readKey() {
|
|
303
|
-
const e =
|
|
303
|
+
const e = O(this.keyType);
|
|
304
304
|
if (e >= 0) {
|
|
305
305
|
h(this.payload, this.offset, e);
|
|
306
306
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
307
|
-
return this.offset += e, new
|
|
307
|
+
return this.offset += e, new C(this.keyType, r);
|
|
308
308
|
}
|
|
309
309
|
if (this.keyType === 12 || this.keyType === 13) {
|
|
310
310
|
const r = { offset: this.offset }, s = f(this.payload, r, "DictMalformed");
|
|
311
311
|
h(this.payload, r.offset, s);
|
|
312
312
|
const n = this.payload.subarray(r.offset, r.offset + s);
|
|
313
|
-
return this.offset = r.offset + s, new
|
|
313
|
+
return this.offset = r.offset + s, new C(this.keyType, n);
|
|
314
314
|
}
|
|
315
315
|
throw new Error("Unsupported dictionary key type");
|
|
316
316
|
}
|
|
@@ -321,21 +321,21 @@ class W {
|
|
|
321
321
|
const e = { offset: this.offset }, r = f(this.payload, e, "DictMalformed");
|
|
322
322
|
h(this.payload, e.offset, r);
|
|
323
323
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
324
|
-
return this.offset = e.offset + r, new
|
|
324
|
+
return this.offset = e.offset + r, new C(this.valueType, s);
|
|
325
325
|
}
|
|
326
326
|
case 11: {
|
|
327
327
|
const e = { offset: this.offset }, r = f(this.payload, e, "DictMalformed");
|
|
328
328
|
h(this.payload, e.offset, r);
|
|
329
329
|
const s = this.payload.subarray(e.offset, e.offset + r);
|
|
330
|
-
return this.offset = e.offset + r, new
|
|
330
|
+
return this.offset = e.offset + r, new C(11, s);
|
|
331
331
|
}
|
|
332
332
|
case 9: {
|
|
333
|
-
const e =
|
|
334
|
-
return this.offset += e, new
|
|
333
|
+
const e = z(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
334
|
+
return this.offset += e, new C(9, r);
|
|
335
335
|
}
|
|
336
336
|
case 10: {
|
|
337
|
-
const e =
|
|
338
|
-
return this.offset += e, new
|
|
337
|
+
const e = X(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
|
|
338
|
+
return this.offset += e, new C(10, r);
|
|
339
339
|
}
|
|
340
340
|
case 3:
|
|
341
341
|
case 5:
|
|
@@ -346,17 +346,17 @@ class W {
|
|
|
346
346
|
case 6:
|
|
347
347
|
case 14:
|
|
348
348
|
case 1: {
|
|
349
|
-
const e =
|
|
349
|
+
const e = O(this.valueType);
|
|
350
350
|
h(this.payload, this.offset, e);
|
|
351
351
|
const r = this.payload.subarray(this.offset, this.offset + e);
|
|
352
|
-
return this.offset += e, new
|
|
352
|
+
return this.offset += e, new C(this.valueType, r);
|
|
353
353
|
}
|
|
354
354
|
default:
|
|
355
355
|
throw new Error(`Unsupported dictionary value type ${y[this.valueType]}`);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
class
|
|
359
|
+
class Dt {
|
|
360
360
|
constructor(e, r) {
|
|
361
361
|
this.key = e, this.value = r;
|
|
362
362
|
}
|
|
@@ -371,8 +371,8 @@ class A {
|
|
|
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 = A.parseHexSlice(r, 0, 8),
|
|
375
|
-
A.writeUInt32LE(s, 0, n), A.writeUInt16LE(s, 4,
|
|
374
|
+
const s = new Uint8Array(16), n = A.parseHexSlice(r, 0, 8), i = A.parseHexSlice(r, 8, 4), a = A.parseHexSlice(r, 12, 4);
|
|
375
|
+
A.writeUInt32LE(s, 0, n), A.writeUInt16LE(s, 4, i), A.writeUInt16LE(s, 6, a);
|
|
376
376
|
for (let _ = 0; _ < 8; _++)
|
|
377
377
|
s[8 + _] = A.parseHexSlice(r, 16 + _ * 2, 2);
|
|
378
378
|
return new A(s);
|
|
@@ -400,18 +400,18 @@ class A {
|
|
|
400
400
|
A.toHex(A.readUInt32LE(e, 0), 8),
|
|
401
401
|
A.toHex(A.readUInt16LE(e, 4), 4),
|
|
402
402
|
A.toHex(A.readUInt16LE(e, 6), 4),
|
|
403
|
-
|
|
404
|
-
|
|
403
|
+
Q(e.subarray(8, 10)),
|
|
404
|
+
Q(e.subarray(10, 16))
|
|
405
405
|
].join("-");
|
|
406
406
|
}
|
|
407
407
|
asBytes() {
|
|
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), i = Number.parseInt(n, 16);
|
|
412
|
+
if (Number.isNaN(i))
|
|
413
413
|
throw new Error("Guid string contains invalid characters");
|
|
414
|
-
return
|
|
414
|
+
return i >>> 0;
|
|
415
415
|
}
|
|
416
416
|
static writeUInt32LE(e, r, s) {
|
|
417
417
|
const n = s >>> 0;
|
|
@@ -434,11 +434,11 @@ class A {
|
|
|
434
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, i = 0;
|
|
438
438
|
for (; e.offset < t.length; ) {
|
|
439
|
-
const
|
|
440
|
-
if (
|
|
441
|
-
if (
|
|
439
|
+
const a = t[e.offset++];
|
|
440
|
+
if (i++, s |= (a & 127) << n, (a & 128) === 0) {
|
|
441
|
+
if (i !== Pt(s))
|
|
442
442
|
throw new Error("Teleport VarUInt is not canonical");
|
|
443
443
|
return s >>> 0;
|
|
444
444
|
}
|
|
@@ -447,10 +447,10 @@ function f(t, e, r) {
|
|
|
447
447
|
}
|
|
448
448
|
throw new Error(r);
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Pt(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:
|
|
@@ -478,136 +478,128 @@ function h(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 yt(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 z(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 =
|
|
490
|
+
const n = { offset: e + 1 }, i = f(t, n, "ArrayMalformed"), a = O(s);
|
|
491
|
+
if (a >= 0) {
|
|
492
|
+
const E = a * i;
|
|
493
493
|
return h(t, n.offset, E), n.offset + E - e;
|
|
494
494
|
}
|
|
495
495
|
let _ = n.offset;
|
|
496
|
-
for (let E = 0; E <
|
|
496
|
+
for (let E = 0; E < i; E++)
|
|
497
497
|
_ = x(s, t, _, "ArrayMalformed");
|
|
498
498
|
return _ - e;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function X(t, e) {
|
|
501
501
|
if (e + 2 > t.length)
|
|
502
502
|
throw new Error("Dictionary payload too short");
|
|
503
503
|
const r = t[e] >> 4 & 15, s = t[e + 1] >> 4 & 15;
|
|
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
|
|
507
|
+
const n = { offset: e + 2 }, i = f(t, n, "DictMalformed");
|
|
508
|
+
let a = n.offset;
|
|
509
|
+
for (let _ = 0; _ < i; _++)
|
|
510
|
+
a = x(r, t, a, "DictMalformed"), a = x(s, t, a, "DictMalformed");
|
|
511
|
+
return a - e;
|
|
512
512
|
}
|
|
513
513
|
function x(t, e, r, s) {
|
|
514
|
-
const n =
|
|
514
|
+
const n = O(t);
|
|
515
515
|
if (n >= 0)
|
|
516
516
|
return h(e, r, n), r + n;
|
|
517
517
|
switch (t) {
|
|
518
518
|
case 12:
|
|
519
519
|
case 13: {
|
|
520
|
-
const
|
|
521
|
-
return h(e,
|
|
520
|
+
const i = { offset: r }, a = f(e, i, s);
|
|
521
|
+
return h(e, i.offset, a), i.offset + a;
|
|
522
522
|
}
|
|
523
523
|
case 11: {
|
|
524
|
-
const
|
|
525
|
-
return h(e,
|
|
524
|
+
const i = { offset: r }, a = f(e, i, s);
|
|
525
|
+
return h(e, i.offset, a), i.offset + a;
|
|
526
526
|
}
|
|
527
527
|
case 9:
|
|
528
|
-
return r +
|
|
528
|
+
return r + z(e, r);
|
|
529
529
|
case 10:
|
|
530
|
-
return r +
|
|
530
|
+
return r + X(e, r);
|
|
531
531
|
default:
|
|
532
532
|
throw new Error(`Unsupported Teleport type ${y[t]}`);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
function
|
|
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 B(t) {
|
|
539
539
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
540
540
|
}
|
|
541
|
-
var T = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(T || {}), 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_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.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.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_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", 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.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.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.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(V || {});
|
|
542
|
-
const
|
|
543
|
-
function
|
|
541
|
+
var c = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(c || {}), 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_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_RELAY_AGENT_HELLO = 65576] = "CORE_RELAY_AGENT_HELLO", t[t.CORE_RELAY_HELLO = 65577] = "CORE_RELAY_HELLO", 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.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.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.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.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(g || {});
|
|
542
|
+
const Ot = 4194309, dt = 205938238, wt = 1594075008, Ft = 2026534360, Mt = 3409001585, gt = 3466650495, Bt = 4007456593, bt = 4017217601, Gt = 4065417427, Vt = 4086360332;
|
|
543
|
+
function vt(t) {
|
|
544
544
|
const e = {};
|
|
545
545
|
return nt(e), e;
|
|
546
546
|
}
|
|
547
547
|
function nt(t) {
|
|
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
|
-
}
|
|
550
|
-
function vt(t, e) {
|
|
551
|
-
const r = F.create(t);
|
|
552
|
-
return kt(r, e);
|
|
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;
|
|
553
549
|
}
|
|
554
550
|
function kt(t, e) {
|
|
555
|
-
const r =
|
|
556
|
-
return
|
|
551
|
+
const r = d.create(t);
|
|
552
|
+
return pt(r, e);
|
|
557
553
|
}
|
|
558
554
|
function pt(t, e) {
|
|
555
|
+
const r = e ?? vt();
|
|
556
|
+
return nt(r), Ht(t, r), r;
|
|
557
|
+
}
|
|
558
|
+
function Ht(t, e) {
|
|
559
559
|
let r;
|
|
560
560
|
for (; (r = t.next()) !== null; )
|
|
561
561
|
switch (r.fieldId) {
|
|
562
|
-
case
|
|
562
|
+
case dt: {
|
|
563
563
|
if (r.isNull) throw new Error();
|
|
564
564
|
e.AverageVolume = r.asFloat32();
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
|
-
case
|
|
568
|
-
if (r.isNull) {
|
|
569
|
-
e.ShapeSetValues = void 0;
|
|
570
|
-
break;
|
|
571
|
-
}
|
|
572
|
-
e.ShapeSetValues = Ht(r.asArray());
|
|
573
|
-
break;
|
|
574
|
-
}
|
|
575
|
-
case Ot: {
|
|
567
|
+
case wt: {
|
|
576
568
|
if (r.isNull) throw new Error();
|
|
577
569
|
e.IsFirst = r.asBool();
|
|
578
570
|
break;
|
|
579
571
|
}
|
|
580
|
-
case
|
|
572
|
+
case Ft: {
|
|
581
573
|
if (r.isNull) throw new Error();
|
|
582
574
|
e.TimeStampInInterleavedSamples = r.asUInt64();
|
|
583
575
|
break;
|
|
584
576
|
}
|
|
585
|
-
case
|
|
577
|
+
case Mt: {
|
|
586
578
|
if (r.isNull) throw new Error();
|
|
587
579
|
e.Samples = r.asBinary();
|
|
588
580
|
break;
|
|
589
581
|
}
|
|
590
|
-
case
|
|
582
|
+
case gt: {
|
|
591
583
|
if (r.isNull) throw new Error();
|
|
592
584
|
e.AudioEventEstimatedDuration = r.asFloat32();
|
|
593
585
|
break;
|
|
594
586
|
}
|
|
595
|
-
case
|
|
587
|
+
case Bt: {
|
|
596
588
|
if (r.isNull) throw new Error();
|
|
597
589
|
e.FrameSizeInInterleavedSamples = r.asUInt32();
|
|
598
590
|
break;
|
|
599
591
|
}
|
|
600
|
-
case
|
|
592
|
+
case bt: {
|
|
601
593
|
if (r.isNull) throw new Error();
|
|
602
594
|
e.IsLast = r.asBool();
|
|
603
595
|
break;
|
|
604
596
|
}
|
|
605
|
-
case
|
|
597
|
+
case Gt: {
|
|
606
598
|
if (r.isNull) throw new Error();
|
|
607
599
|
e.Sequence = r.asUInt32();
|
|
608
600
|
break;
|
|
609
601
|
}
|
|
610
|
-
case
|
|
602
|
+
case Vt: {
|
|
611
603
|
if (r.isNull) throw new Error();
|
|
612
604
|
e.Epoch = r.asUInt32();
|
|
613
605
|
break;
|
|
@@ -615,168 +607,219 @@ function pt(t, e) {
|
|
|
615
607
|
}
|
|
616
608
|
}
|
|
617
609
|
async function xt(t, e) {
|
|
618
|
-
const r = await
|
|
619
|
-
return
|
|
610
|
+
const r = await Y(t, Ot);
|
|
611
|
+
return kt(r, e);
|
|
612
|
+
}
|
|
613
|
+
const Yt = 4194310, Wt = 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 = d.create(t);
|
|
623
|
+
return qt(r, e);
|
|
624
|
+
}
|
|
625
|
+
function qt(t, e) {
|
|
626
|
+
const r = e ?? jt();
|
|
627
|
+
return at(r), Zt(t, r), r;
|
|
628
|
+
}
|
|
629
|
+
function Zt(t, e) {
|
|
630
|
+
let r;
|
|
631
|
+
for (; (r = t.next()) !== null; )
|
|
632
|
+
switch (r.fieldId) {
|
|
633
|
+
case Wt: {
|
|
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: {
|
|
649
|
+
if (r.isNull) throw new Error();
|
|
650
|
+
e.Sequence = r.asUInt32();
|
|
651
|
+
break;
|
|
652
|
+
}
|
|
653
|
+
case $t: {
|
|
654
|
+
if (r.isNull) throw new Error();
|
|
655
|
+
e.Epoch = r.asUInt32();
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
async function Jt(t, e) {
|
|
661
|
+
const r = await Y(t, Yt);
|
|
662
|
+
return Qt(r, e);
|
|
620
663
|
}
|
|
621
|
-
function
|
|
664
|
+
function te(t) {
|
|
622
665
|
const e = [];
|
|
623
666
|
let r;
|
|
624
667
|
for (; (r = t.next()) !== null; )
|
|
625
|
-
e.push(
|
|
668
|
+
e.push(ne(r.asObject()));
|
|
626
669
|
return e;
|
|
627
670
|
}
|
|
628
|
-
const
|
|
629
|
-
function
|
|
671
|
+
const ee = 1154362099, re = 3974819915;
|
|
672
|
+
function se(t) {
|
|
630
673
|
const e = {};
|
|
631
674
|
return it(e), e;
|
|
632
675
|
}
|
|
633
676
|
function it(t) {
|
|
634
677
|
return t.SetId = 0, t.Values = [], t;
|
|
635
678
|
}
|
|
636
|
-
function
|
|
637
|
-
const r = e ??
|
|
638
|
-
return it(r),
|
|
679
|
+
function ne(t, e) {
|
|
680
|
+
const r = e ?? se();
|
|
681
|
+
return it(r), ae(t, r), r;
|
|
639
682
|
}
|
|
640
|
-
function
|
|
683
|
+
function ae(t, e) {
|
|
641
684
|
let r;
|
|
642
685
|
for (; (r = t.next()) !== null; )
|
|
643
686
|
switch (r.fieldId) {
|
|
644
|
-
case
|
|
687
|
+
case ee: {
|
|
645
688
|
if (r.isNull) throw new Error();
|
|
646
689
|
e.SetId = r.asUInt32();
|
|
647
690
|
break;
|
|
648
691
|
}
|
|
649
|
-
case
|
|
692
|
+
case re: {
|
|
650
693
|
if (r.isNull) throw new Error();
|
|
651
|
-
e.Values =
|
|
694
|
+
e.Values = ie(r.asArray());
|
|
652
695
|
break;
|
|
653
696
|
}
|
|
654
697
|
}
|
|
655
698
|
}
|
|
656
|
-
function
|
|
699
|
+
function ie(t) {
|
|
657
700
|
const e = [];
|
|
658
701
|
let r;
|
|
659
702
|
for (; (r = t.next()) !== null; )
|
|
660
703
|
e.push(r.asFloat32());
|
|
661
704
|
return e;
|
|
662
705
|
}
|
|
663
|
-
const
|
|
664
|
-
function
|
|
706
|
+
const _e = 4194305, Ee = 161083277, oe = 265814330, Ie = 1368629611, le = 2431514951, Ae = 2745379226, ue = 3282782683, he = 3284746250, fe = 4101844078;
|
|
707
|
+
function Te(t) {
|
|
665
708
|
const e = {};
|
|
666
|
-
return
|
|
709
|
+
return _t(e), e;
|
|
667
710
|
}
|
|
668
|
-
function
|
|
669
|
-
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec =
|
|
711
|
+
function _t(t) {
|
|
712
|
+
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = c.Unknown, t.CodecDetails = "", t.SampleRate = 0, t.Channels = 0, t.ShapeSets = void 0, t;
|
|
670
713
|
}
|
|
671
|
-
function
|
|
672
|
-
const r =
|
|
673
|
-
return
|
|
714
|
+
function ce(t, e) {
|
|
715
|
+
const r = d.create(t);
|
|
716
|
+
return Ne(r, e);
|
|
674
717
|
}
|
|
675
|
-
function
|
|
676
|
-
const r = e ??
|
|
677
|
-
return
|
|
718
|
+
function Ne(t, e) {
|
|
719
|
+
const r = e ?? Te();
|
|
720
|
+
return _t(r), Se(t, r), r;
|
|
678
721
|
}
|
|
679
|
-
function
|
|
722
|
+
function Se(t, e) {
|
|
680
723
|
let r;
|
|
681
724
|
for (; (r = t.next()) !== null; )
|
|
682
725
|
switch (r.fieldId) {
|
|
683
|
-
case
|
|
726
|
+
case Ee: {
|
|
684
727
|
if (r.isNull) throw new Error();
|
|
685
728
|
e.StreamId = r.asString();
|
|
686
729
|
break;
|
|
687
730
|
}
|
|
688
|
-
case
|
|
731
|
+
case oe: {
|
|
689
732
|
if (r.isNull) {
|
|
690
733
|
e.ShapeSets = void 0;
|
|
691
734
|
break;
|
|
692
735
|
}
|
|
693
|
-
e.ShapeSets =
|
|
736
|
+
e.ShapeSets = Re(r.asArray());
|
|
694
737
|
break;
|
|
695
738
|
}
|
|
696
|
-
case
|
|
739
|
+
case Ie: {
|
|
697
740
|
if (r.isNull) throw new Error();
|
|
698
741
|
e.Description = r.asString();
|
|
699
742
|
break;
|
|
700
743
|
}
|
|
701
|
-
case
|
|
744
|
+
case le: {
|
|
702
745
|
if (r.isNull) throw new Error();
|
|
703
746
|
e.Channels = r.asInt32();
|
|
704
747
|
break;
|
|
705
748
|
}
|
|
706
|
-
case
|
|
749
|
+
case Ae: {
|
|
707
750
|
if (r.isNull) throw new Error();
|
|
708
751
|
e.CodecDetails = r.asString();
|
|
709
752
|
break;
|
|
710
753
|
}
|
|
711
|
-
case
|
|
754
|
+
case ue: {
|
|
712
755
|
if (r.isNull) throw new Error();
|
|
713
756
|
e.SourceType = r.asString();
|
|
714
757
|
break;
|
|
715
758
|
}
|
|
716
|
-
case
|
|
759
|
+
case he: {
|
|
717
760
|
if (r.isNull) throw new Error();
|
|
718
761
|
e.Codec = r.asInt32();
|
|
719
762
|
break;
|
|
720
763
|
}
|
|
721
|
-
case
|
|
764
|
+
case fe: {
|
|
722
765
|
if (r.isNull) throw new Error();
|
|
723
766
|
e.SampleRate = r.asInt32();
|
|
724
767
|
break;
|
|
725
768
|
}
|
|
726
769
|
}
|
|
727
770
|
}
|
|
728
|
-
async function
|
|
729
|
-
const r = await
|
|
730
|
-
return
|
|
771
|
+
async function Ce(t, e) {
|
|
772
|
+
const r = await Y(t, _e);
|
|
773
|
+
return ce(r, e);
|
|
731
774
|
}
|
|
732
|
-
function
|
|
775
|
+
function Re(t) {
|
|
733
776
|
const e = [];
|
|
734
777
|
let r;
|
|
735
778
|
for (; (r = t.next()) !== null; )
|
|
736
|
-
e.push(
|
|
779
|
+
e.push(Pe(r.asObject()));
|
|
737
780
|
return e;
|
|
738
781
|
}
|
|
739
|
-
const
|
|
740
|
-
function
|
|
782
|
+
const Ue = 1107713536, me = 1154362099, Le = 1185721362;
|
|
783
|
+
function De(t) {
|
|
741
784
|
const e = {};
|
|
742
|
-
return
|
|
785
|
+
return Et(e), e;
|
|
743
786
|
}
|
|
744
|
-
function
|
|
787
|
+
function Et(t) {
|
|
745
788
|
return t.SetId = 0, t.Name = "", t.ShapeNames = [], t;
|
|
746
789
|
}
|
|
747
|
-
function
|
|
748
|
-
const r = e ??
|
|
749
|
-
return
|
|
790
|
+
function Pe(t, e) {
|
|
791
|
+
const r = e ?? De();
|
|
792
|
+
return Et(r), ye(t, r), r;
|
|
750
793
|
}
|
|
751
|
-
function
|
|
794
|
+
function ye(t, e) {
|
|
752
795
|
let r;
|
|
753
796
|
for (; (r = t.next()) !== null; )
|
|
754
797
|
switch (r.fieldId) {
|
|
755
|
-
case
|
|
798
|
+
case Ue: {
|
|
756
799
|
if (r.isNull) throw new Error();
|
|
757
800
|
e.Name = r.asString();
|
|
758
801
|
break;
|
|
759
802
|
}
|
|
760
|
-
case
|
|
803
|
+
case me: {
|
|
761
804
|
if (r.isNull) throw new Error();
|
|
762
805
|
e.SetId = r.asUInt32();
|
|
763
806
|
break;
|
|
764
807
|
}
|
|
765
|
-
case
|
|
808
|
+
case Le: {
|
|
766
809
|
if (r.isNull) throw new Error();
|
|
767
|
-
e.ShapeNames =
|
|
810
|
+
e.ShapeNames = Oe(r.asArray());
|
|
768
811
|
break;
|
|
769
812
|
}
|
|
770
813
|
}
|
|
771
814
|
}
|
|
772
|
-
function
|
|
815
|
+
function Oe(t) {
|
|
773
816
|
const e = [];
|
|
774
817
|
let r;
|
|
775
818
|
for (; (r = t.next()) !== null; )
|
|
776
819
|
e.push(r.asString());
|
|
777
820
|
return e;
|
|
778
821
|
}
|
|
779
|
-
class
|
|
822
|
+
class q {
|
|
780
823
|
static getStorageForCapacity(e, r) {
|
|
781
824
|
const s = Int32Array.BYTES_PER_ELEMENT * 2, n = r.BYTES_PER_ELEMENT * e;
|
|
782
825
|
return new SharedArrayBuffer(s + n);
|
|
@@ -809,8 +852,8 @@ class Q {
|
|
|
809
852
|
let s = Atomics.load(this.readWrite, 1);
|
|
810
853
|
const n = Math.min(r, this.capacity - s);
|
|
811
854
|
this.storage.set(e.subarray(0, n), s);
|
|
812
|
-
const
|
|
813
|
-
return
|
|
855
|
+
const i = r - n;
|
|
856
|
+
return i > 0 && this.storage.set(e.subarray(n, n + i), 0), s = (s + r) % this.capacity, Atomics.store(this.readWrite, 1, s), Atomics.notify(this.readWrite, 1), r;
|
|
814
857
|
}
|
|
815
858
|
pop(e) {
|
|
816
859
|
const r = Math.min(this.availableRead(), e.length);
|
|
@@ -819,8 +862,8 @@ class Q {
|
|
|
819
862
|
let s = Atomics.load(this.readWrite, 0);
|
|
820
863
|
const n = Math.min(r, this.capacity - s);
|
|
821
864
|
e.set(this.storage.subarray(s, s + n), 0);
|
|
822
|
-
const
|
|
823
|
-
return
|
|
865
|
+
const i = r - n;
|
|
866
|
+
return i > 0 && e.set(this.storage.subarray(0, i), n), s = (s + r) % this.capacity, Atomics.store(this.readWrite, 0, s), r;
|
|
824
867
|
}
|
|
825
868
|
skip(e) {
|
|
826
869
|
const r = Math.min(this.availableRead(), e);
|
|
@@ -830,36 +873,36 @@ class Q {
|
|
|
830
873
|
return s = (s + r) % this.capacity, Atomics.store(this.readWrite, 0, s), r;
|
|
831
874
|
}
|
|
832
875
|
}
|
|
833
|
-
let
|
|
834
|
-
const
|
|
876
|
+
let de = 1;
|
|
877
|
+
const we = /* @__PURE__ */ new Map(), Fe = {
|
|
835
878
|
0: "DEBUG",
|
|
836
879
|
1: "INFO",
|
|
837
880
|
2: "WARN",
|
|
838
881
|
3: "ERROR",
|
|
839
882
|
4: "NONE"
|
|
840
883
|
};
|
|
841
|
-
function
|
|
884
|
+
function Me(t, e) {
|
|
842
885
|
return `[${t}] ${e}`;
|
|
843
886
|
}
|
|
844
|
-
function
|
|
845
|
-
const n = (/* @__PURE__ */ new Date()).toISOString(),
|
|
887
|
+
function G(t, e, r, s) {
|
|
888
|
+
const n = (/* @__PURE__ */ new Date()).toISOString(), i = Fe[t], a = {
|
|
846
889
|
timestamp: n,
|
|
847
890
|
level: t,
|
|
848
|
-
levelName:
|
|
891
|
+
levelName: i,
|
|
849
892
|
component: e,
|
|
850
893
|
message: r,
|
|
851
894
|
args: s
|
|
852
895
|
};
|
|
853
|
-
for (const [_, E] of
|
|
896
|
+
for (const [_, E] of we) {
|
|
854
897
|
const o = E?.minLevel ?? 2;
|
|
855
898
|
if (t >= o)
|
|
856
899
|
try {
|
|
857
|
-
_(
|
|
900
|
+
_(a);
|
|
858
901
|
} catch {
|
|
859
902
|
}
|
|
860
903
|
}
|
|
861
|
-
if (
|
|
862
|
-
const _ =
|
|
904
|
+
if (de <= t) {
|
|
905
|
+
const _ = Me(e, r);
|
|
863
906
|
switch (t) {
|
|
864
907
|
case 0:
|
|
865
908
|
console.debug(_, ...s);
|
|
@@ -876,50 +919,50 @@ function b(t, e, r, s) {
|
|
|
876
919
|
}
|
|
877
920
|
}
|
|
878
921
|
}
|
|
879
|
-
function
|
|
922
|
+
function ot(t) {
|
|
880
923
|
return {
|
|
881
924
|
debug(e, ...r) {
|
|
882
|
-
|
|
925
|
+
G(0, t, e, r);
|
|
883
926
|
},
|
|
884
927
|
info(e, ...r) {
|
|
885
|
-
|
|
928
|
+
G(1, t, e, r);
|
|
886
929
|
},
|
|
887
930
|
warn(e, ...r) {
|
|
888
|
-
|
|
931
|
+
G(2, t, e, r);
|
|
889
932
|
},
|
|
890
933
|
error(e, ...r) {
|
|
891
|
-
|
|
934
|
+
G(3, t, e, r);
|
|
892
935
|
}
|
|
893
936
|
};
|
|
894
937
|
}
|
|
895
|
-
const
|
|
896
|
-
function
|
|
938
|
+
const V = ot("Capabilities"), ge = globalThis;
|
|
939
|
+
function Be() {
|
|
897
940
|
if (typeof SharedArrayBuffer > "u")
|
|
898
|
-
return
|
|
941
|
+
return V.debug("SharedArrayBuffer not supported: SharedArrayBuffer is undefined"), !1;
|
|
899
942
|
if (typeof Atomics > "u")
|
|
900
|
-
return
|
|
901
|
-
if (
|
|
902
|
-
return
|
|
943
|
+
return V.debug("SharedArrayBuffer not supported: Atomics is undefined"), !1;
|
|
944
|
+
if (ge.crossOriginIsolated === !1)
|
|
945
|
+
return V.debug("SharedArrayBuffer not supported: crossOriginIsolated is false (missing COOP/COEP headers)"), !1;
|
|
903
946
|
try {
|
|
904
947
|
new SharedArrayBuffer(1);
|
|
905
948
|
} catch (t) {
|
|
906
|
-
return
|
|
949
|
+
return V.debug(`SharedArrayBuffer not supported: construction failed - ${t instanceof Error ? t.message : String(t)}`), !1;
|
|
907
950
|
}
|
|
908
951
|
return !0;
|
|
909
952
|
}
|
|
910
|
-
const
|
|
953
|
+
const It = 48e3, lt = 2, be = 1500, Ge = 10, Z = 80, Ve = 50, J = 64, $ = ot("AudioPlaybackWorker"), m = (t, e) => {
|
|
911
954
|
self.postMessage(t, e ?? []);
|
|
912
|
-
},
|
|
913
|
-
let v = "pcm",
|
|
914
|
-
function
|
|
955
|
+
}, ve = Be();
|
|
956
|
+
let v = "pcm", At = !0, ut = !1, R = It, N = lt, P = null;
|
|
957
|
+
function D(t, e) {
|
|
915
958
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
916
|
-
|
|
959
|
+
m({ type: "error", error: { name: r.name, message: r.message, stack: r.stack }, streamId: e });
|
|
917
960
|
}
|
|
918
|
-
function
|
|
919
|
-
const e =
|
|
961
|
+
function k(t) {
|
|
962
|
+
const e = rt(t);
|
|
920
963
|
return `${e.senderId}_${e.trackId}`;
|
|
921
964
|
}
|
|
922
|
-
class
|
|
965
|
+
class ke {
|
|
923
966
|
mode;
|
|
924
967
|
ring = null;
|
|
925
968
|
sab = void 0;
|
|
@@ -932,7 +975,7 @@ class Pe {
|
|
|
932
975
|
pcmBatchOffset = 0;
|
|
933
976
|
lastPcmFlushTimeMs = 0;
|
|
934
977
|
constructor(e) {
|
|
935
|
-
this.streamId = e, this.mode = "pcm", this.outputSampleRate = R, this.outputChannels =
|
|
978
|
+
this.streamId = e, this.mode = "pcm", this.outputSampleRate = R, this.outputChannels = N, this.rebind(v);
|
|
936
979
|
}
|
|
937
980
|
close() {
|
|
938
981
|
this.closed = !0, this.pcmBatchBuffer = null, this.pcmBatchOffset = 0, this.ring = null, this.sab = void 0;
|
|
@@ -942,8 +985,8 @@ class Pe {
|
|
|
942
985
|
}
|
|
943
986
|
rebind(e) {
|
|
944
987
|
if (!this.closed) {
|
|
945
|
-
if (this.mode = e, e === "sab" &&
|
|
946
|
-
const r = Math.floor(
|
|
988
|
+
if (this.mode = e, e === "sab" && ve) {
|
|
989
|
+
const r = Math.floor(be * this.outputSampleRate * this.outputChannels / 1e3), s = q.getStorageForCapacity(r, Float32Array), n = new q(s, Float32Array);
|
|
947
990
|
n.flush(), this.sab = s, this.ring = n;
|
|
948
991
|
return;
|
|
949
992
|
}
|
|
@@ -953,11 +996,11 @@ class Pe {
|
|
|
953
996
|
flushPendingPcm(e) {
|
|
954
997
|
if (this.closed || this.mode !== "pcm" || this.pcmBatchOffset <= 0)
|
|
955
998
|
return;
|
|
956
|
-
const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels *
|
|
957
|
-
if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >=
|
|
999
|
+
const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * Z / 1e3));
|
|
1000
|
+
if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >= Ve))
|
|
958
1001
|
return;
|
|
959
|
-
const
|
|
960
|
-
|
|
1002
|
+
const i = new Float32Array(this.pcmBatchOffset);
|
|
1003
|
+
i.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = r, m({ type: "pcm", streamId: this.streamId, pcm: i }, [i.buffer]);
|
|
961
1004
|
}
|
|
962
1005
|
drainPcm() {
|
|
963
1006
|
this.flushPendingPcm(!0);
|
|
@@ -966,20 +1009,20 @@ class Pe {
|
|
|
966
1009
|
if (this.closed)
|
|
967
1010
|
return;
|
|
968
1011
|
if (this.mode === "sab" && this.ring) {
|
|
969
|
-
const n = this.ring,
|
|
970
|
-
let
|
|
971
|
-
const _ = Math.floor(Math.max(0, n.capacity - 1) /
|
|
972
|
-
|
|
973
|
-
const E = Math.floor(n.availableWrite() /
|
|
1012
|
+
const n = this.ring, i = this.outputChannels;
|
|
1013
|
+
let a = e;
|
|
1014
|
+
const _ = Math.floor(Math.max(0, n.capacity - 1) / i) * i;
|
|
1015
|
+
a.length > _ && (a = a.subarray(a.length - _));
|
|
1016
|
+
const E = Math.floor(n.availableWrite() / i) * i;
|
|
974
1017
|
if (E <= 0)
|
|
975
1018
|
return;
|
|
976
|
-
|
|
1019
|
+
a.length > E && (a = a.subarray(a.length - E)), n.push(a);
|
|
977
1020
|
return;
|
|
978
1021
|
}
|
|
979
|
-
const r = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels *
|
|
1022
|
+
const r = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * Z / 1e3)), s = this.pcmBatchOffset + e.length;
|
|
980
1023
|
if (!this.pcmBatchBuffer || this.pcmBatchBuffer.length < s) {
|
|
981
|
-
const n = Math.max(s, r * 2),
|
|
982
|
-
this.pcmBatchBuffer && this.pcmBatchOffset > 0 &&
|
|
1024
|
+
const n = Math.max(s, r * 2), i = new Float32Array(n);
|
|
1025
|
+
this.pcmBatchBuffer && this.pcmBatchOffset > 0 && i.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchBuffer = i;
|
|
983
1026
|
}
|
|
984
1027
|
this.pcmBatchBuffer.set(e, this.pcmBatchOffset), this.pcmBatchOffset += e.length, this.lastPcmFlushTimeMs === 0 && (this.lastPcmFlushTimeMs = performance.now()), this.flushPendingPcm(!1);
|
|
985
1028
|
}
|
|
@@ -990,25 +1033,25 @@ class Pe {
|
|
|
990
1033
|
this.closed || (this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = 0, this.ring?.flush());
|
|
991
1034
|
}
|
|
992
1035
|
}
|
|
993
|
-
function
|
|
1036
|
+
function pe(t) {
|
|
994
1037
|
switch (t) {
|
|
995
|
-
case
|
|
1038
|
+
case c.Opus:
|
|
996
1039
|
return "opus";
|
|
997
|
-
case
|
|
1040
|
+
case c.Mp3:
|
|
998
1041
|
return "mp3";
|
|
999
1042
|
default:
|
|
1000
1043
|
return null;
|
|
1001
1044
|
}
|
|
1002
1045
|
}
|
|
1003
|
-
let
|
|
1004
|
-
function
|
|
1046
|
+
let M = null;
|
|
1047
|
+
function He(t) {
|
|
1005
1048
|
const e = new DataView(t.buffer, t.byteOffset, t.byteLength), r = Math.floor(t.byteLength / 2);
|
|
1006
|
-
(!
|
|
1049
|
+
(!M || M.length < r) && (M = new Float32Array(r));
|
|
1007
1050
|
for (let s = 0; s < r; s++)
|
|
1008
|
-
|
|
1009
|
-
return
|
|
1051
|
+
M[s] = e.getInt16(s * 2, !0) / 32768;
|
|
1052
|
+
return M.subarray(0, r);
|
|
1010
1053
|
}
|
|
1011
|
-
class
|
|
1054
|
+
class j {
|
|
1012
1055
|
inputSampleRate;
|
|
1013
1056
|
inputChannels;
|
|
1014
1057
|
sink;
|
|
@@ -1035,23 +1078,23 @@ class $ {
|
|
|
1035
1078
|
n.length > 0 && this.sink.writePcm(n);
|
|
1036
1079
|
}
|
|
1037
1080
|
convertAudioData(e) {
|
|
1038
|
-
const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format,
|
|
1081
|
+
const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format, i = typeof n == "string" && n.includes("planar"), a = "f32-planar", _ = "f32", E = () => {
|
|
1039
1082
|
const l = new Array(s);
|
|
1040
1083
|
for (let u = 0; u < s; u++) {
|
|
1041
|
-
const
|
|
1042
|
-
e.copyTo(
|
|
1084
|
+
const S = new Float32Array(r);
|
|
1085
|
+
e.copyTo(S, { planeIndex: u, format: a }), l[u] = S;
|
|
1043
1086
|
}
|
|
1044
|
-
return
|
|
1087
|
+
return tr(l, r);
|
|
1045
1088
|
}, o = () => {
|
|
1046
1089
|
const l = new Float32Array(r * s);
|
|
1047
1090
|
return e.copyTo(l, { planeIndex: 0, format: _ }), l;
|
|
1048
1091
|
};
|
|
1049
1092
|
let I;
|
|
1050
|
-
if (
|
|
1093
|
+
if (i)
|
|
1051
1094
|
try {
|
|
1052
1095
|
I = E();
|
|
1053
1096
|
} catch (l) {
|
|
1054
|
-
|
|
1097
|
+
$.debug(`Failed to read planar audio data, falling back to interleaved copy: ${l}`), I = o();
|
|
1055
1098
|
}
|
|
1056
1099
|
else
|
|
1057
1100
|
I = o();
|
|
@@ -1060,28 +1103,28 @@ class $ {
|
|
|
1060
1103
|
convertPcmBuffer(e, r, s) {
|
|
1061
1104
|
if (e.length === 0)
|
|
1062
1105
|
return e;
|
|
1063
|
-
let n = e,
|
|
1106
|
+
let n = e, i = e.length, a = r;
|
|
1064
1107
|
if (s !== R) {
|
|
1065
|
-
const _ =
|
|
1066
|
-
|
|
1108
|
+
const _ = i / a, o = Math.max(1, Math.round(_ * R / s)) * a, I = this.getResampleBuffer(o);
|
|
1109
|
+
i = rr(n, I, a, s, R), n = I;
|
|
1067
1110
|
}
|
|
1068
|
-
if (
|
|
1069
|
-
const E =
|
|
1070
|
-
|
|
1111
|
+
if (a !== N) {
|
|
1112
|
+
const E = i / a * N, o = this.getRemixBuffer(E);
|
|
1113
|
+
i = sr(n.subarray(0, i), o, a, N), n = o, a = N;
|
|
1071
1114
|
}
|
|
1072
|
-
return n.subarray(0,
|
|
1115
|
+
return n.subarray(0, i);
|
|
1073
1116
|
}
|
|
1074
1117
|
}
|
|
1075
|
-
class
|
|
1118
|
+
class xe extends j {
|
|
1076
1119
|
feedChunk(e) {
|
|
1077
1120
|
e.isFirst && this.reset();
|
|
1078
|
-
const r =
|
|
1121
|
+
const r = He(e.data);
|
|
1079
1122
|
this.writeConvertedPcm(r, this.inputChannels, this.inputSampleRate), e.isLast && this.reset();
|
|
1080
1123
|
}
|
|
1081
1124
|
close() {
|
|
1082
1125
|
}
|
|
1083
1126
|
}
|
|
1084
|
-
class
|
|
1127
|
+
class Ye extends j {
|
|
1085
1128
|
decoder;
|
|
1086
1129
|
codec;
|
|
1087
1130
|
constructor(e) {
|
|
@@ -1091,7 +1134,7 @@ class ge extends $ {
|
|
|
1091
1134
|
const s = this.convertAudioData(r);
|
|
1092
1135
|
this.writeConvertedPcm(s, r.numberOfChannels, r.sampleRate);
|
|
1093
1136
|
} catch (s) {
|
|
1094
|
-
|
|
1137
|
+
D(s);
|
|
1095
1138
|
} finally {
|
|
1096
1139
|
try {
|
|
1097
1140
|
r.close();
|
|
@@ -1100,7 +1143,7 @@ class ge extends $ {
|
|
|
1100
1143
|
}
|
|
1101
1144
|
},
|
|
1102
1145
|
error: (r) => {
|
|
1103
|
-
|
|
1146
|
+
D(r);
|
|
1104
1147
|
}
|
|
1105
1148
|
}), this.decoder.configure({ codec: e.codec, numberOfChannels: e.inputChannels, sampleRate: e.inputSampleRate });
|
|
1106
1149
|
}
|
|
@@ -1118,7 +1161,7 @@ class ge extends $ {
|
|
|
1118
1161
|
), e.isLast && this.decoder.flush().catch(() => {
|
|
1119
1162
|
});
|
|
1120
1163
|
} catch (r) {
|
|
1121
|
-
|
|
1164
|
+
D(r);
|
|
1122
1165
|
try {
|
|
1123
1166
|
this.reset();
|
|
1124
1167
|
} catch {
|
|
@@ -1130,7 +1173,7 @@ class ge extends $ {
|
|
|
1130
1173
|
try {
|
|
1131
1174
|
this.decoder.reset(), this.decoder.configure({ codec: this.codec, numberOfChannels: this.inputChannels, sampleRate: this.inputSampleRate });
|
|
1132
1175
|
} catch (e) {
|
|
1133
|
-
|
|
1176
|
+
D(e);
|
|
1134
1177
|
}
|
|
1135
1178
|
}
|
|
1136
1179
|
close() {
|
|
@@ -1140,7 +1183,7 @@ class ge extends $ {
|
|
|
1140
1183
|
}
|
|
1141
1184
|
}
|
|
1142
1185
|
}
|
|
1143
|
-
class
|
|
1186
|
+
class We extends j {
|
|
1144
1187
|
decoder = null;
|
|
1145
1188
|
isReady = !1;
|
|
1146
1189
|
decoderSampleRate = 48e3;
|
|
@@ -1148,8 +1191,8 @@ class Fe extends $ {
|
|
|
1148
1191
|
async initialise(e, r) {
|
|
1149
1192
|
const { OpusDecoder: s, getOpusModule: n } = await import("./index-Cns_7uAI.js");
|
|
1150
1193
|
await n();
|
|
1151
|
-
const
|
|
1152
|
-
this.decoderSampleRate =
|
|
1194
|
+
const a = [8e3, 12e3, 16e3, 24e3, 48e3].reduce((_, E) => Math.abs(E - r) < Math.abs(_ - r) ? E : _);
|
|
1195
|
+
this.decoderSampleRate = a, this.decoder = new s({ channels: e, sampleRate: this.decoderSampleRate }), await this.decoder.ready, this.isReady = !0, this.flushPendingChunks();
|
|
1153
1196
|
}
|
|
1154
1197
|
flushPendingChunks() {
|
|
1155
1198
|
if (!this.isReady || !this.decoder) {
|
|
@@ -1175,25 +1218,25 @@ class Fe extends $ {
|
|
|
1175
1218
|
try {
|
|
1176
1219
|
if (e.data.byteLength === 0)
|
|
1177
1220
|
return;
|
|
1178
|
-
const s = this.decoder.decodeFrame(e.data), n = s.channelData,
|
|
1179
|
-
if (!
|
|
1221
|
+
const s = this.decoder.decodeFrame(e.data), n = s.channelData, i = s.samplesDecoded, a = n.length;
|
|
1222
|
+
if (!a || !i)
|
|
1180
1223
|
return;
|
|
1181
|
-
const _ =
|
|
1182
|
-
if (
|
|
1224
|
+
const _ = i * a, E = this.getInterleavedBuffer(_);
|
|
1225
|
+
if (a === 2) {
|
|
1183
1226
|
const o = n[0], I = n[1];
|
|
1184
|
-
for (let l = 0, u = 0; l <
|
|
1227
|
+
for (let l = 0, u = 0; l < i; l++)
|
|
1185
1228
|
E[u++] = o[l], E[u++] = I[l];
|
|
1186
|
-
} else if (
|
|
1187
|
-
E.set(n[0].subarray(0,
|
|
1229
|
+
} else if (a === 1)
|
|
1230
|
+
E.set(n[0].subarray(0, i));
|
|
1188
1231
|
else {
|
|
1189
1232
|
let o = 0;
|
|
1190
|
-
for (let I = 0; I <
|
|
1191
|
-
for (let l = 0; l <
|
|
1233
|
+
for (let I = 0; I < i; I++)
|
|
1234
|
+
for (let l = 0; l < a; l++)
|
|
1192
1235
|
E[o++] = n[l][I];
|
|
1193
1236
|
}
|
|
1194
|
-
this.writeConvertedPcm(E.subarray(0, _),
|
|
1237
|
+
this.writeConvertedPcm(E.subarray(0, _), a, this.decoderSampleRate), e.isLast && this.reset();
|
|
1195
1238
|
} catch (r) {
|
|
1196
|
-
|
|
1239
|
+
D(r), this.reset();
|
|
1197
1240
|
}
|
|
1198
1241
|
}
|
|
1199
1242
|
feedChunk(e) {
|
|
@@ -1211,21 +1254,21 @@ class Fe extends $ {
|
|
|
1211
1254
|
this.decoder = null, this.pendingChunks.length = 0;
|
|
1212
1255
|
}
|
|
1213
1256
|
}
|
|
1214
|
-
const
|
|
1215
|
-
async function
|
|
1257
|
+
const T = /* @__PURE__ */ new Map();
|
|
1258
|
+
async function Ke(t) {
|
|
1216
1259
|
if (t.closed || t.decoder)
|
|
1217
1260
|
return;
|
|
1218
|
-
if (t.codec ===
|
|
1219
|
-
t.decoder = new
|
|
1261
|
+
if (t.codec === c.RawPcm16) {
|
|
1262
|
+
t.decoder = new xe({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
|
|
1220
1263
|
return;
|
|
1221
1264
|
}
|
|
1222
|
-
if (t.codec !==
|
|
1223
|
-
throw new Error(`Unsupported audio codec: ${
|
|
1224
|
-
const e =
|
|
1225
|
-
if (
|
|
1265
|
+
if (t.codec !== c.Opus && t.codec !== c.Mp3)
|
|
1266
|
+
throw new Error(`Unsupported audio codec: ${c[t.codec] ?? t.codec}`);
|
|
1267
|
+
const e = pe(t.codec);
|
|
1268
|
+
if (At && typeof AudioDecoder < "u" && e !== null)
|
|
1226
1269
|
try {
|
|
1227
1270
|
if ((await AudioDecoder.isConfigSupported({ codec: e, numberOfChannels: t.inputChannels, sampleRate: t.inputSampleRate })).supported) {
|
|
1228
|
-
const n = new
|
|
1271
|
+
const n = new Ye({
|
|
1229
1272
|
codec: e,
|
|
1230
1273
|
inputChannels: t.inputChannels,
|
|
1231
1274
|
inputSampleRate: t.inputSampleRate,
|
|
@@ -1239,10 +1282,10 @@ async function Me(t) {
|
|
|
1239
1282
|
return;
|
|
1240
1283
|
}
|
|
1241
1284
|
} catch (s) {
|
|
1242
|
-
|
|
1285
|
+
$.warn(`WebCodecs AudioDecoder failed, falling back to WASM: ${s instanceof Error ? s.message : String(s)}`);
|
|
1243
1286
|
}
|
|
1244
|
-
if (t.codec ===
|
|
1245
|
-
const s = new
|
|
1287
|
+
if (t.codec === c.Opus) {
|
|
1288
|
+
const s = new We({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
|
|
1246
1289
|
if (await s.initialise(t.inputChannels, t.inputSampleRate), t.closed) {
|
|
1247
1290
|
s.close();
|
|
1248
1291
|
return;
|
|
@@ -1250,9 +1293,9 @@ async function Me(t) {
|
|
|
1250
1293
|
t.decoder = s;
|
|
1251
1294
|
return;
|
|
1252
1295
|
}
|
|
1253
|
-
throw new Error(`No available decoder for codec: ${
|
|
1296
|
+
throw new Error(`No available decoder for codec: ${c[t.codec] ?? t.codec}`);
|
|
1254
1297
|
}
|
|
1255
|
-
function
|
|
1298
|
+
function ze(t) {
|
|
1256
1299
|
if (t.closed) {
|
|
1257
1300
|
t.pendingFrames.splice(0);
|
|
1258
1301
|
try {
|
|
@@ -1266,9 +1309,9 @@ function Be(t) {
|
|
|
1266
1309
|
return;
|
|
1267
1310
|
const e = t.pendingFrames.splice(0);
|
|
1268
1311
|
for (const r of e)
|
|
1269
|
-
|
|
1312
|
+
ht(t, r);
|
|
1270
1313
|
}
|
|
1271
|
-
function
|
|
1314
|
+
function ht(t, e) {
|
|
1272
1315
|
if (t.closed || !t.decoder)
|
|
1273
1316
|
return;
|
|
1274
1317
|
const r = e.Epoch, s = Number(e.TimeStampInInterleavedSamples), n = e.FrameSizeInInterleavedSamples;
|
|
@@ -1277,14 +1320,14 @@ function At(t, e) {
|
|
|
1277
1320
|
const u = t.inputSampleRate * t.inputChannels;
|
|
1278
1321
|
t.expectedIntervalMs = n * 1e3 / u;
|
|
1279
1322
|
}
|
|
1280
|
-
const
|
|
1323
|
+
const i = performance.now();
|
|
1281
1324
|
if (t.lastArrivalTimeMs > 0) {
|
|
1282
|
-
const u =
|
|
1283
|
-
t.jitterMs = t.jitterMs + (
|
|
1325
|
+
const u = i - t.lastArrivalTimeMs, S = Math.abs(u - t.expectedIntervalMs);
|
|
1326
|
+
t.jitterMs = t.jitterMs + (S - t.jitterMs) / Ge;
|
|
1284
1327
|
}
|
|
1285
|
-
t.lastArrivalTimeMs =
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1328
|
+
t.lastArrivalTimeMs = i;
|
|
1329
|
+
const a = t.inputSampleRate * t.inputChannels, _ = R * N, E = Math.round(s * _ / a), o = Math.round(n * _ / a), I = Math.round(s * 1e6 / a), l = Math.round(n * 1e6 / a);
|
|
1330
|
+
m({
|
|
1288
1331
|
type: "frame",
|
|
1289
1332
|
streamId: t.streamId,
|
|
1290
1333
|
epoch: r,
|
|
@@ -1292,8 +1335,7 @@ function At(t, e) {
|
|
|
1292
1335
|
frameSizeInterleavedSamples: o,
|
|
1293
1336
|
isFirst: e.IsFirst,
|
|
1294
1337
|
isLast: e.IsLast,
|
|
1295
|
-
jitterMs: t.jitterMs
|
|
1296
|
-
shapeSetValues: e.ShapeSetValues
|
|
1338
|
+
jitterMs: t.jitterMs
|
|
1297
1339
|
}), t.decoder.feedChunk({
|
|
1298
1340
|
data: e.Samples,
|
|
1299
1341
|
isFirst: e.IsFirst,
|
|
@@ -1302,8 +1344,8 @@ function At(t, e) {
|
|
|
1302
1344
|
durationUs: l
|
|
1303
1345
|
});
|
|
1304
1346
|
}
|
|
1305
|
-
async function
|
|
1306
|
-
const e =
|
|
1347
|
+
async function Xe(t) {
|
|
1348
|
+
const e = k(t), r = await Ce(t), s = T.get(e);
|
|
1307
1349
|
if (s) {
|
|
1308
1350
|
s.closed = !0, s.pendingFrames.splice(0);
|
|
1309
1351
|
try {
|
|
@@ -1314,9 +1356,9 @@ async function be(t) {
|
|
|
1314
1356
|
s.sink.drainPcm(), s.sink.close();
|
|
1315
1357
|
} catch {
|
|
1316
1358
|
}
|
|
1317
|
-
|
|
1359
|
+
T.delete(e);
|
|
1318
1360
|
}
|
|
1319
|
-
const n = new
|
|
1361
|
+
const n = new ke(e), i = {
|
|
1320
1362
|
streamId: e,
|
|
1321
1363
|
codec: r.Codec,
|
|
1322
1364
|
inputSampleRate: r.SampleRate,
|
|
@@ -1333,24 +1375,24 @@ async function be(t) {
|
|
|
1333
1375
|
expectedIntervalMs: 20,
|
|
1334
1376
|
shapeSets: r.ShapeSets
|
|
1335
1377
|
};
|
|
1336
|
-
|
|
1378
|
+
T.set(e, i), m({
|
|
1337
1379
|
type: "streamBegin",
|
|
1338
1380
|
streamId: e,
|
|
1339
1381
|
sharedArrayBuffer: n.getSharedArrayBuffer(),
|
|
1340
1382
|
shapeSets: r.ShapeSets
|
|
1341
1383
|
});
|
|
1342
1384
|
}
|
|
1343
|
-
function
|
|
1344
|
-
for (const t of
|
|
1345
|
-
|
|
1385
|
+
function $e() {
|
|
1386
|
+
for (const t of T.values())
|
|
1387
|
+
m({
|
|
1346
1388
|
type: "streamBegin",
|
|
1347
1389
|
streamId: t.streamId,
|
|
1348
1390
|
sharedArrayBuffer: t.sink.getSharedArrayBuffer(),
|
|
1349
1391
|
shapeSets: t.shapeSets
|
|
1350
1392
|
});
|
|
1351
1393
|
}
|
|
1352
|
-
function
|
|
1353
|
-
const e =
|
|
1394
|
+
function je(t) {
|
|
1395
|
+
const e = k(t), r = T.get(e);
|
|
1354
1396
|
if (r) {
|
|
1355
1397
|
r.closed = !0, r.pendingFrames.splice(0);
|
|
1356
1398
|
try {
|
|
@@ -1361,53 +1403,76 @@ function Ve(t) {
|
|
|
1361
1403
|
r.decoder?.close();
|
|
1362
1404
|
} catch {
|
|
1363
1405
|
}
|
|
1364
|
-
r.decoder = null,
|
|
1406
|
+
r.decoder = null, T.delete(e), m({ type: "streamEnd", streamId: e });
|
|
1365
1407
|
}
|
|
1366
1408
|
}
|
|
1367
|
-
async function
|
|
1368
|
-
const e =
|
|
1409
|
+
async function Qe(t) {
|
|
1410
|
+
const e = k(t), r = T.get(e);
|
|
1369
1411
|
if (!r || r.closed)
|
|
1370
1412
|
return;
|
|
1371
1413
|
const s = await xt(t);
|
|
1372
|
-
if (!
|
|
1373
|
-
if (r.
|
|
1374
|
-
|
|
1375
|
-
|
|
1414
|
+
if (!ut) {
|
|
1415
|
+
if (!r.decoder) {
|
|
1416
|
+
if (r.pendingFrames.length >= J) {
|
|
1417
|
+
const n = r.pendingFrames.length - J + 1;
|
|
1418
|
+
r.pendingFrames.splice(0, n), $.warn(`Dropped ${n} frames waiting for decoder, streamId=${e.substring(0, 8)}`);
|
|
1419
|
+
}
|
|
1420
|
+
r.pendingFrames.push(s), r.initTask || (r.initTask = Ke(r).then(() => ze(r)).catch((n) => {
|
|
1421
|
+
r.closed || D(n, e);
|
|
1422
|
+
}));
|
|
1423
|
+
return;
|
|
1376
1424
|
}
|
|
1377
|
-
r
|
|
1378
|
-
r.closed || L(n, e);
|
|
1379
|
-
}));
|
|
1380
|
-
return;
|
|
1425
|
+
ht(r, s);
|
|
1381
1426
|
}
|
|
1382
|
-
At(r, s);
|
|
1383
1427
|
}
|
|
1384
|
-
function
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1428
|
+
async function qe(t) {
|
|
1429
|
+
const e = k(t), r = T.get(e);
|
|
1430
|
+
if (!r || r.closed) return;
|
|
1431
|
+
const s = await Jt(t), n = r.inputSampleRate * r.inputChannels, i = R * N;
|
|
1432
|
+
m({
|
|
1433
|
+
type: "shapeFrame",
|
|
1434
|
+
streamId: e,
|
|
1435
|
+
epoch: s.Epoch,
|
|
1436
|
+
sequence: s.Sequence,
|
|
1437
|
+
timestampInterleavedSamples: Math.round(
|
|
1438
|
+
Number(s.TimeStampInInterleavedSamples) * i / n
|
|
1439
|
+
),
|
|
1440
|
+
frameSizeInterleavedSamples: Math.round(
|
|
1441
|
+
s.FrameSizeInInterleavedSamples * i / n
|
|
1442
|
+
),
|
|
1443
|
+
shapeSetValues: s.ShapeSetValues
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
function Ze(t) {
|
|
1447
|
+
switch (St(t)) {
|
|
1448
|
+
case g.AUDIO_STREAM_BEGIN:
|
|
1449
|
+
Xe(t);
|
|
1450
|
+
return;
|
|
1451
|
+
case g.AUDIO_STREAM_END:
|
|
1452
|
+
je(t);
|
|
1388
1453
|
return;
|
|
1389
|
-
case
|
|
1390
|
-
|
|
1454
|
+
case g.AUDIO_FRAME2:
|
|
1455
|
+
Qe(t);
|
|
1391
1456
|
return;
|
|
1392
|
-
case
|
|
1393
|
-
|
|
1457
|
+
case g.AUDIO_SHAPE_FRAME:
|
|
1458
|
+
qe(t);
|
|
1394
1459
|
return;
|
|
1395
1460
|
default:
|
|
1396
1461
|
return;
|
|
1397
1462
|
}
|
|
1398
1463
|
}
|
|
1399
|
-
function
|
|
1400
|
-
if (
|
|
1464
|
+
function ft() {
|
|
1465
|
+
if (P) {
|
|
1401
1466
|
try {
|
|
1402
|
-
|
|
1467
|
+
P.close();
|
|
1403
1468
|
} catch {
|
|
1404
1469
|
}
|
|
1405
|
-
|
|
1470
|
+
P = null;
|
|
1406
1471
|
}
|
|
1407
1472
|
}
|
|
1408
|
-
function
|
|
1409
|
-
|
|
1410
|
-
for (const t of
|
|
1473
|
+
function Je() {
|
|
1474
|
+
ft();
|
|
1475
|
+
for (const t of T.values()) {
|
|
1411
1476
|
try {
|
|
1412
1477
|
t.sink.drainPcm(), t.sink.close();
|
|
1413
1478
|
} catch {
|
|
@@ -1417,101 +1482,101 @@ function pe() {
|
|
|
1417
1482
|
} catch {
|
|
1418
1483
|
}
|
|
1419
1484
|
}
|
|
1420
|
-
|
|
1485
|
+
T.clear();
|
|
1421
1486
|
}
|
|
1422
1487
|
self.addEventListener("message", (t) => {
|
|
1423
1488
|
const e = t.data;
|
|
1424
1489
|
if (e.type === "configure") {
|
|
1425
|
-
v = e.transport,
|
|
1490
|
+
v = e.transport, At = e.preferWebCodecs ?? !0, ut = e.webRtcEnabled ?? !1, R = Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 ? e.outputSampleRate : It, N = Number.isFinite(e.outputChannels) && e.outputChannels > 0 ? e.outputChannels : lt;
|
|
1426
1491
|
return;
|
|
1427
1492
|
}
|
|
1428
1493
|
if (e.type === "attachProtocolPort") {
|
|
1429
|
-
|
|
1494
|
+
ft(), P = e.port, P.addEventListener("message", (r) => {
|
|
1430
1495
|
const s = r.data;
|
|
1431
|
-
s?.type === "protocol" && s.message instanceof ArrayBuffer &&
|
|
1432
|
-
}),
|
|
1496
|
+
s?.type === "protocol" && s.message instanceof ArrayBuffer && Ze(new Uint8Array(s.message));
|
|
1497
|
+
}), P.start?.();
|
|
1433
1498
|
return;
|
|
1434
1499
|
}
|
|
1435
1500
|
if (e.type === "rebind") {
|
|
1436
|
-
v = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (R = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (
|
|
1437
|
-
for (const r of
|
|
1438
|
-
r.sink.setOutputFormat(R,
|
|
1439
|
-
|
|
1501
|
+
v = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (R = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (N = e.outputChannels);
|
|
1502
|
+
for (const r of T.values())
|
|
1503
|
+
r.sink.setOutputFormat(R, N), r.sink.rebind(v);
|
|
1504
|
+
$e();
|
|
1440
1505
|
return;
|
|
1441
1506
|
}
|
|
1442
|
-
e.type === "dispose" &&
|
|
1507
|
+
e.type === "dispose" && Je();
|
|
1443
1508
|
});
|
|
1444
1509
|
let U = null;
|
|
1445
|
-
function
|
|
1510
|
+
function tr(t, e) {
|
|
1446
1511
|
const r = t.length;
|
|
1447
1512
|
if (r === 1)
|
|
1448
1513
|
return t[0];
|
|
1449
1514
|
const s = e * r;
|
|
1450
1515
|
if ((!U || U.length < s) && (U = new Float32Array(s)), r === 2) {
|
|
1451
|
-
const n = t[0],
|
|
1452
|
-
for (let
|
|
1453
|
-
U[_++] = n[
|
|
1516
|
+
const n = t[0], i = t[1];
|
|
1517
|
+
for (let a = 0, _ = 0; a < e; a++)
|
|
1518
|
+
U[_++] = n[a], U[_++] = i[a];
|
|
1454
1519
|
} else {
|
|
1455
1520
|
let n = 0;
|
|
1456
|
-
for (let
|
|
1457
|
-
for (let
|
|
1458
|
-
U[n++] = t[
|
|
1521
|
+
for (let i = 0; i < e; i++)
|
|
1522
|
+
for (let a = 0; a < r; a++)
|
|
1523
|
+
U[n++] = t[a][i];
|
|
1459
1524
|
}
|
|
1460
1525
|
return U.subarray(0, s);
|
|
1461
1526
|
}
|
|
1462
|
-
const
|
|
1463
|
-
function
|
|
1527
|
+
const tt = 3;
|
|
1528
|
+
function et(t) {
|
|
1464
1529
|
if (t === 0)
|
|
1465
1530
|
return 1;
|
|
1466
1531
|
const e = Math.PI * t;
|
|
1467
1532
|
return Math.sin(e) / e;
|
|
1468
1533
|
}
|
|
1469
|
-
function
|
|
1470
|
-
return t === 0 ? 1 : Math.abs(t) >= e ? 0 :
|
|
1534
|
+
function er(t, e) {
|
|
1535
|
+
return t === 0 ? 1 : Math.abs(t) >= e ? 0 : et(t) * et(t / e);
|
|
1471
1536
|
}
|
|
1472
|
-
function
|
|
1537
|
+
function rr(t, e, r, s, n) {
|
|
1473
1538
|
if (s === n)
|
|
1474
1539
|
return e.set(t), t.length;
|
|
1475
|
-
const
|
|
1540
|
+
const i = t.length / r, a = Math.max(1, Math.round(i * n / s)), _ = s / n, E = _ > 1 ? _ : 1, o = Math.ceil(tt * E);
|
|
1476
1541
|
for (let I = 0; I < r; I++)
|
|
1477
|
-
for (let l = 0; l <
|
|
1478
|
-
const u = l * _,
|
|
1479
|
-
let
|
|
1480
|
-
for (let
|
|
1481
|
-
const
|
|
1482
|
-
if (
|
|
1542
|
+
for (let l = 0; l < a; l++) {
|
|
1543
|
+
const u = l * _, S = Math.floor(u);
|
|
1544
|
+
let w = 0, L = 0;
|
|
1545
|
+
for (let p = -o + 1; p <= o; p++) {
|
|
1546
|
+
const b = S + p;
|
|
1547
|
+
if (b < 0 || b >= i)
|
|
1483
1548
|
continue;
|
|
1484
|
-
const
|
|
1485
|
-
if (
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1549
|
+
const Tt = (u - b) / E, H = er(Tt, tt);
|
|
1550
|
+
if (H !== 0) {
|
|
1551
|
+
const ct = t[b * r + I] ?? 0;
|
|
1552
|
+
w += ct * H, L += H;
|
|
1488
1553
|
}
|
|
1489
1554
|
}
|
|
1490
|
-
e[l * r + I] =
|
|
1555
|
+
e[l * r + I] = L > 0 ? w / L : 0;
|
|
1491
1556
|
}
|
|
1492
|
-
return
|
|
1557
|
+
return a * r;
|
|
1493
1558
|
}
|
|
1494
|
-
function
|
|
1559
|
+
function sr(t, e, r, s) {
|
|
1495
1560
|
const n = t.length / r;
|
|
1496
1561
|
if (r === s)
|
|
1497
1562
|
return e.set(t), t.length;
|
|
1498
1563
|
if (r === 1 && s === 2) {
|
|
1499
|
-
for (let
|
|
1500
|
-
const _ = t[
|
|
1501
|
-
e[
|
|
1564
|
+
for (let a = 0; a < n; a++) {
|
|
1565
|
+
const _ = t[a] ?? 0;
|
|
1566
|
+
e[a * 2] = _, e[a * 2 + 1] = _;
|
|
1502
1567
|
}
|
|
1503
1568
|
return n * 2;
|
|
1504
1569
|
}
|
|
1505
1570
|
if (r === 2 && s === 1) {
|
|
1506
|
-
for (let
|
|
1507
|
-
const _ = t[
|
|
1508
|
-
e[
|
|
1571
|
+
for (let a = 0; a < n; a++) {
|
|
1572
|
+
const _ = t[a * 2] ?? 0, E = t[a * 2 + 1] ?? 0;
|
|
1573
|
+
e[a] = (_ + E) * 0.5;
|
|
1509
1574
|
}
|
|
1510
1575
|
return n;
|
|
1511
1576
|
}
|
|
1512
|
-
const
|
|
1513
|
-
for (let
|
|
1514
|
-
for (let _ = 0; _ <
|
|
1515
|
-
e[
|
|
1577
|
+
const i = Math.min(r, s);
|
|
1578
|
+
for (let a = 0; a < n; a++)
|
|
1579
|
+
for (let _ = 0; _ < i; _++)
|
|
1580
|
+
e[a * s + _] = t[a * r + _] ?? 0;
|
|
1516
1581
|
return n * s;
|
|
1517
1582
|
}
|