@ikonai/sdk 1.0.4 → 1.0.5
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-CGBVb9zd.js → audio-playback-worker-DPybcm1k.js} +235 -213
- package/assets/{protocol-worker-BnPqA34K.js → protocol-worker-DIKCgk1A.js} +69 -73
- package/assets/{video-capture-worker-y4Nlx7f9.js → video-capture-worker-DP3lFDjq.js} +62 -62
- package/assets/{video-playback-worker-Dylqg54c.js → video-playback-worker-qauTQ7Et.js} +274 -252
- package/index.js +824 -802
- package/package.json +1 -1
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
const ht = {
|
|
2
|
+
Compressed: 8
|
|
3
|
+
};
|
|
4
|
+
function ft(t) {
|
|
2
5
|
if (t.length < 8)
|
|
3
6
|
throw new Error("Protocol message too short");
|
|
4
7
|
return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
|
|
5
8
|
}
|
|
6
9
|
function q(t) {
|
|
7
|
-
const e =
|
|
10
|
+
const e = M(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
8
11
|
if (e.length < 27)
|
|
9
12
|
throw new Error("Protocol payload too short");
|
|
10
|
-
const s = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), i = r.getUint32(12, !0), o = r.getUint32(16, !0), _ = r.getUint32(20, !0),
|
|
13
|
+
const s = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), i = r.getUint32(12, !0), o = r.getUint32(16, !0), _ = r.getUint32(20, !0), E = r.getUint8(24), l = r.getUint8(25), I = r.getUint8(26);
|
|
11
14
|
if (27 + _ * 4 > e.length)
|
|
12
15
|
throw new Error("Protocol header exceeds payload length");
|
|
13
16
|
const N = [];
|
|
14
17
|
let w = 27;
|
|
15
|
-
for (let
|
|
18
|
+
for (let U = 0; U < _; U++)
|
|
16
19
|
N.push(r.getUint32(w, !0)), w += 4;
|
|
17
20
|
return {
|
|
18
21
|
length: s,
|
|
@@ -21,45 +24,64 @@ function q(t) {
|
|
|
21
24
|
trackId: i,
|
|
22
25
|
sequenceId: o,
|
|
23
26
|
targetIds: N,
|
|
24
|
-
payloadVersion:
|
|
27
|
+
payloadVersion: E,
|
|
25
28
|
payloadType: l,
|
|
26
|
-
flags:
|
|
29
|
+
flags: I
|
|
27
30
|
};
|
|
28
31
|
}
|
|
29
|
-
function tt(t, e, r) {
|
|
30
|
-
const s =
|
|
32
|
+
async function tt(t, e, r) {
|
|
33
|
+
const s = M(t), n = q(s);
|
|
31
34
|
if (e !== void 0 && n.opcode !== e)
|
|
32
35
|
throw new Error(`Unexpected opcode ${n.opcode}`);
|
|
33
36
|
if (n.payloadType !== 8)
|
|
34
37
|
throw new Error(`Unexpected payload type ${n.payloadType}`);
|
|
35
38
|
const a = 27 + n.targetIds.length * 4;
|
|
36
|
-
|
|
39
|
+
let i = s.subarray(a, n.length);
|
|
40
|
+
return (n.flags & ht.Compressed) !== 0 && (i = await At(i)), i;
|
|
41
|
+
}
|
|
42
|
+
async function At(t) {
|
|
43
|
+
if (typeof DecompressionStream > "u")
|
|
44
|
+
throw new Error("DecompressionStream not supported");
|
|
45
|
+
const e = new DecompressionStream("gzip"), r = e.writable.getWriter(), s = new Uint8Array(t);
|
|
46
|
+
r.write(s), r.close();
|
|
47
|
+
const n = e.readable.getReader(), a = [];
|
|
48
|
+
let i = 0;
|
|
49
|
+
for (; ; ) {
|
|
50
|
+
const { done: E, value: l } = await n.read();
|
|
51
|
+
if (E) break;
|
|
52
|
+
a.push(l), i += l.length;
|
|
53
|
+
}
|
|
54
|
+
const o = new Uint8Array(i);
|
|
55
|
+
let _ = 0;
|
|
56
|
+
for (let E = 0; E < a.length; E++)
|
|
57
|
+
o.set(a[E], _), _ += a[E].length;
|
|
58
|
+
return o;
|
|
37
59
|
}
|
|
38
60
|
var D = /* @__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))(D || {});
|
|
39
|
-
const
|
|
61
|
+
const ct = 161, Tt = 162;
|
|
40
62
|
new TextEncoder();
|
|
41
|
-
const
|
|
42
|
-
class
|
|
63
|
+
const Nt = new TextDecoder("utf-8", { fatal: !0 });
|
|
64
|
+
class F {
|
|
43
65
|
constructor(e, r, s) {
|
|
44
66
|
this.buffer = e, this.version = r, this.offset = s, this.end = e.length - 1;
|
|
45
67
|
}
|
|
46
68
|
offset;
|
|
47
69
|
end;
|
|
48
70
|
static create(e) {
|
|
49
|
-
const r =
|
|
71
|
+
const r = M(e);
|
|
50
72
|
if (r.length < 2)
|
|
51
73
|
throw new Error("Teleport payload too short");
|
|
52
|
-
if (r[0] !==
|
|
74
|
+
if (r[0] !== ct || r[r.length - 1] !== Tt)
|
|
53
75
|
throw new Error("Teleport object missing markers");
|
|
54
76
|
const s = { offset: 1 }, n = A(r, s, "InvalidLength");
|
|
55
|
-
return new
|
|
77
|
+
return new F(r, n, s.offset);
|
|
56
78
|
}
|
|
57
79
|
next() {
|
|
58
80
|
if (this.offset >= this.end)
|
|
59
81
|
return null;
|
|
60
82
|
if (this.offset + 5 > this.buffer.length)
|
|
61
83
|
throw new Error("Teleport object truncated");
|
|
62
|
-
const e =
|
|
84
|
+
const e = mt(this.buffer, this.offset);
|
|
63
85
|
this.offset += 4;
|
|
64
86
|
const r = this.buffer[this.offset++], s = r >> 4 & 15;
|
|
65
87
|
if ((r & 15) !== 0)
|
|
@@ -72,7 +94,7 @@ class M {
|
|
|
72
94
|
const i = { offset: this.offset }, o = A(this.buffer, i, "InvalidLength");
|
|
73
95
|
f(this.buffer, i.offset, o), a = this.buffer.subarray(i.offset, i.offset + o), this.offset = i.offset + o;
|
|
74
96
|
}
|
|
75
|
-
return new
|
|
97
|
+
return new St(e, s, a);
|
|
76
98
|
}
|
|
77
99
|
}
|
|
78
100
|
class S {
|
|
@@ -137,19 +159,19 @@ class S {
|
|
|
137
159
|
return this.ensureType(
|
|
138
160
|
12
|
|
139
161
|
/* String */
|
|
140
|
-
),
|
|
162
|
+
), Nt.decode(this.payload);
|
|
141
163
|
}
|
|
142
164
|
asGuid() {
|
|
143
165
|
return this.ensureType(
|
|
144
166
|
14
|
|
145
167
|
/* Guid */
|
|
146
|
-
),
|
|
168
|
+
), u.fromBytes(this.payload);
|
|
147
169
|
}
|
|
148
170
|
asObject() {
|
|
149
171
|
return this.ensureType(
|
|
150
172
|
11
|
|
151
173
|
/* Object */
|
|
152
|
-
),
|
|
174
|
+
), F.create(this.payload);
|
|
153
175
|
}
|
|
154
176
|
asArray() {
|
|
155
177
|
return this.ensureType(
|
|
@@ -168,7 +190,7 @@ class S {
|
|
|
168
190
|
throw new Error(`Teleport value has type ${D[this.type]}, expected ${D[e]}`);
|
|
169
191
|
}
|
|
170
192
|
}
|
|
171
|
-
class
|
|
193
|
+
class St extends S {
|
|
172
194
|
constructor(e, r, s) {
|
|
173
195
|
super(r, s), this.fieldId = e;
|
|
174
196
|
}
|
|
@@ -192,7 +214,7 @@ class x {
|
|
|
192
214
|
this.count = A(e, s, "ArrayMalformed"), this.offset = s.offset;
|
|
193
215
|
}
|
|
194
216
|
static create(e) {
|
|
195
|
-
return new x(
|
|
217
|
+
return new x(M(e));
|
|
196
218
|
}
|
|
197
219
|
next() {
|
|
198
220
|
if (this.index >= this.count) {
|
|
@@ -266,7 +288,7 @@ class H {
|
|
|
266
288
|
this.count = A(e, r, "DictMalformed"), this.offset = r.offset;
|
|
267
289
|
}
|
|
268
290
|
static create(e) {
|
|
269
|
-
return new H(
|
|
291
|
+
return new H(M(e));
|
|
270
292
|
}
|
|
271
293
|
next() {
|
|
272
294
|
if (this.index >= this.count) {
|
|
@@ -275,7 +297,7 @@ class H {
|
|
|
275
297
|
return null;
|
|
276
298
|
}
|
|
277
299
|
const e = this.readKey(), r = this.readValue();
|
|
278
|
-
return this.index++, new
|
|
300
|
+
return this.index++, new Ct(e, r);
|
|
279
301
|
}
|
|
280
302
|
readKey() {
|
|
281
303
|
const e = d(this.keyType);
|
|
@@ -334,12 +356,12 @@ class H {
|
|
|
334
356
|
}
|
|
335
357
|
}
|
|
336
358
|
}
|
|
337
|
-
class
|
|
359
|
+
class Ct {
|
|
338
360
|
constructor(e, r) {
|
|
339
361
|
this.key = e, this.value = r;
|
|
340
362
|
}
|
|
341
363
|
}
|
|
342
|
-
class
|
|
364
|
+
class u {
|
|
343
365
|
constructor(e) {
|
|
344
366
|
this.bytes = e;
|
|
345
367
|
}
|
|
@@ -349,19 +371,19 @@ class I {
|
|
|
349
371
|
const r = e.replace(/-/g, "");
|
|
350
372
|
if (r.length !== 32)
|
|
351
373
|
throw new Error("Guid string must be 32 hex characters");
|
|
352
|
-
const s = new Uint8Array(16), n =
|
|
353
|
-
|
|
374
|
+
const s = new Uint8Array(16), n = u.parseHexSlice(r, 0, 8), a = u.parseHexSlice(r, 8, 4), i = u.parseHexSlice(r, 12, 4);
|
|
375
|
+
u.writeUInt32LE(s, 0, n), u.writeUInt16LE(s, 4, a), u.writeUInt16LE(s, 6, i);
|
|
354
376
|
for (let o = 0; o < 8; o++)
|
|
355
|
-
s[8 + o] =
|
|
356
|
-
return new
|
|
377
|
+
s[8 + o] = u.parseHexSlice(r, 16 + o * 2, 2);
|
|
378
|
+
return new u(s);
|
|
357
379
|
}
|
|
358
380
|
static fromBytes(e) {
|
|
359
381
|
if (e.length !== 16)
|
|
360
382
|
throw new Error("Guid byte array must be 16 bytes");
|
|
361
|
-
return new
|
|
383
|
+
return new u(Uint8Array.from(e));
|
|
362
384
|
}
|
|
363
385
|
static createZero() {
|
|
364
|
-
return new
|
|
386
|
+
return new u(new Uint8Array(16));
|
|
365
387
|
}
|
|
366
388
|
static createRandom() {
|
|
367
389
|
const e = new Uint8Array(16), r = globalThis.crypto;
|
|
@@ -370,16 +392,16 @@ class I {
|
|
|
370
392
|
else
|
|
371
393
|
for (let s = 0; s < e.length; s++)
|
|
372
394
|
e[s] = Math.floor(Math.random() * 256);
|
|
373
|
-
return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new
|
|
395
|
+
return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new u(e);
|
|
374
396
|
}
|
|
375
397
|
toString() {
|
|
376
398
|
const e = this.bytes;
|
|
377
399
|
return [
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
400
|
+
u.toHex(u.readUInt32LE(e, 0), 8),
|
|
401
|
+
u.toHex(u.readUInt16LE(e, 4), 4),
|
|
402
|
+
u.toHex(u.readUInt16LE(e, 6), 4),
|
|
403
|
+
X(e.subarray(8, 10)),
|
|
404
|
+
X(e.subarray(10, 16))
|
|
383
405
|
].join("-");
|
|
384
406
|
}
|
|
385
407
|
asBytes() {
|
|
@@ -416,7 +438,7 @@ function A(t, e, r) {
|
|
|
416
438
|
for (; e.offset < t.length; ) {
|
|
417
439
|
const i = t[e.offset++];
|
|
418
440
|
if (a++, s |= (i & 127) << n, (i & 128) === 0) {
|
|
419
|
-
if (a !==
|
|
441
|
+
if (a !== Rt(s))
|
|
420
442
|
throw new Error("Teleport VarUInt is not canonical");
|
|
421
443
|
return s >>> 0;
|
|
422
444
|
}
|
|
@@ -425,7 +447,7 @@ function A(t, e, r) {
|
|
|
425
447
|
}
|
|
426
448
|
throw new Error(r);
|
|
427
449
|
}
|
|
428
|
-
function
|
|
450
|
+
function Rt(t) {
|
|
429
451
|
return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
|
|
430
452
|
}
|
|
431
453
|
function d(t) {
|
|
@@ -456,7 +478,7 @@ function f(t, e, r) {
|
|
|
456
478
|
if (e < 0 || r < 0 || e + r > t.length)
|
|
457
479
|
throw new Error("Teleport payload exceeds bounds");
|
|
458
480
|
}
|
|
459
|
-
function
|
|
481
|
+
function mt(t, e) {
|
|
460
482
|
return (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0;
|
|
461
483
|
}
|
|
462
484
|
function Y(t, e) {
|
|
@@ -510,234 +532,234 @@ function p(t, e, r, s) {
|
|
|
510
532
|
throw new Error(`Unsupported Teleport type ${D[t]}`);
|
|
511
533
|
}
|
|
512
534
|
}
|
|
513
|
-
function
|
|
535
|
+
function X(t) {
|
|
514
536
|
return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
515
537
|
}
|
|
516
|
-
function
|
|
538
|
+
function M(t) {
|
|
517
539
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
518
540
|
}
|
|
519
|
-
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 || {}), 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.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_DEVTOOLS_CONSOLE_OUTPUT = 524297] = "ANALYTICS_DEVTOOLS_CONSOLE_OUTPUT", 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.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))(G || {});
|
|
520
|
-
const
|
|
521
|
-
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.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.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))(G || {});
|
|
542
|
+
const Ut = 4194309, Lt = 205938238, yt = 717315017, Dt = 1594075008, dt = 2026534360, Pt = 3409001585, wt = 3466650495, Ot = 4007456593, gt = 4017217601, Ft = 4065417427, Mt = 4086360332;
|
|
543
|
+
function Bt(t) {
|
|
522
544
|
const e = {};
|
|
523
545
|
return rt(e), e;
|
|
524
546
|
}
|
|
525
547
|
function rt(t) {
|
|
526
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.ShapeSetValues = void 0, t;
|
|
527
549
|
}
|
|
528
|
-
function
|
|
529
|
-
const r =
|
|
530
|
-
return
|
|
550
|
+
function bt(t, e) {
|
|
551
|
+
const r = F.create(t);
|
|
552
|
+
return Gt(r, e);
|
|
531
553
|
}
|
|
532
|
-
function
|
|
533
|
-
const r = e ??
|
|
534
|
-
return rt(r),
|
|
554
|
+
function Gt(t, e) {
|
|
555
|
+
const r = e ?? Bt();
|
|
556
|
+
return rt(r), Vt(t, r), r;
|
|
535
557
|
}
|
|
536
|
-
function
|
|
558
|
+
function Vt(t, e) {
|
|
537
559
|
let r;
|
|
538
560
|
for (; (r = t.next()) !== null; )
|
|
539
561
|
switch (r.fieldId) {
|
|
540
|
-
case
|
|
562
|
+
case Lt: {
|
|
541
563
|
if (r.isNull) throw new Error();
|
|
542
564
|
e.AverageVolume = r.asFloat32();
|
|
543
565
|
break;
|
|
544
566
|
}
|
|
545
|
-
case
|
|
567
|
+
case yt: {
|
|
546
568
|
if (r.isNull) {
|
|
547
569
|
e.ShapeSetValues = void 0;
|
|
548
570
|
break;
|
|
549
571
|
}
|
|
550
|
-
e.ShapeSetValues =
|
|
572
|
+
e.ShapeSetValues = kt(r.asArray());
|
|
551
573
|
break;
|
|
552
574
|
}
|
|
553
|
-
case
|
|
575
|
+
case Dt: {
|
|
554
576
|
if (r.isNull) throw new Error();
|
|
555
577
|
e.IsFirst = r.asBool();
|
|
556
578
|
break;
|
|
557
579
|
}
|
|
558
|
-
case
|
|
580
|
+
case dt: {
|
|
559
581
|
if (r.isNull) throw new Error();
|
|
560
582
|
e.TimeStampInInterleavedSamples = r.asUInt64();
|
|
561
583
|
break;
|
|
562
584
|
}
|
|
563
|
-
case
|
|
585
|
+
case Pt: {
|
|
564
586
|
if (r.isNull) throw new Error();
|
|
565
587
|
e.Samples = r.asBinary();
|
|
566
588
|
break;
|
|
567
589
|
}
|
|
568
|
-
case
|
|
590
|
+
case wt: {
|
|
569
591
|
if (r.isNull) throw new Error();
|
|
570
592
|
e.AudioEventEstimatedDuration = r.asFloat32();
|
|
571
593
|
break;
|
|
572
594
|
}
|
|
573
|
-
case
|
|
595
|
+
case Ot: {
|
|
574
596
|
if (r.isNull) throw new Error();
|
|
575
597
|
e.FrameSizeInInterleavedSamples = r.asUInt32();
|
|
576
598
|
break;
|
|
577
599
|
}
|
|
578
|
-
case
|
|
600
|
+
case gt: {
|
|
579
601
|
if (r.isNull) throw new Error();
|
|
580
602
|
e.IsLast = r.asBool();
|
|
581
603
|
break;
|
|
582
604
|
}
|
|
583
|
-
case
|
|
605
|
+
case Ft: {
|
|
584
606
|
if (r.isNull) throw new Error();
|
|
585
607
|
e.Sequence = r.asUInt32();
|
|
586
608
|
break;
|
|
587
609
|
}
|
|
588
|
-
case
|
|
610
|
+
case Mt: {
|
|
589
611
|
if (r.isNull) throw new Error();
|
|
590
612
|
e.Epoch = r.asUInt32();
|
|
591
613
|
break;
|
|
592
614
|
}
|
|
593
615
|
}
|
|
594
616
|
}
|
|
595
|
-
function
|
|
596
|
-
const r = tt(t,
|
|
597
|
-
return
|
|
617
|
+
async function vt(t, e) {
|
|
618
|
+
const r = await tt(t, Ut);
|
|
619
|
+
return bt(r, e);
|
|
598
620
|
}
|
|
599
|
-
function
|
|
621
|
+
function kt(t) {
|
|
600
622
|
const e = [];
|
|
601
623
|
let r;
|
|
602
624
|
for (; (r = t.next()) !== null; )
|
|
603
|
-
e.push(
|
|
625
|
+
e.push(Yt(r.asObject()));
|
|
604
626
|
return e;
|
|
605
627
|
}
|
|
606
|
-
const
|
|
607
|
-
function
|
|
628
|
+
const pt = 1154362099, xt = 3974819915;
|
|
629
|
+
function Ht(t) {
|
|
608
630
|
const e = {};
|
|
609
631
|
return st(e), e;
|
|
610
632
|
}
|
|
611
633
|
function st(t) {
|
|
612
634
|
return t.SetId = 0, t.Values = [], t;
|
|
613
635
|
}
|
|
614
|
-
function
|
|
615
|
-
const r = e ??
|
|
616
|
-
return st(r),
|
|
636
|
+
function Yt(t, e) {
|
|
637
|
+
const r = e ?? Ht();
|
|
638
|
+
return st(r), Kt(t, r), r;
|
|
617
639
|
}
|
|
618
|
-
function
|
|
640
|
+
function Kt(t, e) {
|
|
619
641
|
let r;
|
|
620
642
|
for (; (r = t.next()) !== null; )
|
|
621
643
|
switch (r.fieldId) {
|
|
622
|
-
case
|
|
644
|
+
case pt: {
|
|
623
645
|
if (r.isNull) throw new Error();
|
|
624
646
|
e.SetId = r.asUInt32();
|
|
625
647
|
break;
|
|
626
648
|
}
|
|
627
|
-
case
|
|
649
|
+
case xt: {
|
|
628
650
|
if (r.isNull) throw new Error();
|
|
629
|
-
e.Values =
|
|
651
|
+
e.Values = Wt(r.asArray());
|
|
630
652
|
break;
|
|
631
653
|
}
|
|
632
654
|
}
|
|
633
655
|
}
|
|
634
|
-
function
|
|
656
|
+
function Wt(t) {
|
|
635
657
|
const e = [];
|
|
636
658
|
let r;
|
|
637
659
|
for (; (r = t.next()) !== null; )
|
|
638
660
|
e.push(r.asFloat32());
|
|
639
661
|
return e;
|
|
640
662
|
}
|
|
641
|
-
const
|
|
642
|
-
function
|
|
663
|
+
const zt = 4194305, Xt = 265814330, jt = 1368629611, $t = 2431514951, Qt = 2914494629, Jt = 3284746250, Zt = 4101844078;
|
|
664
|
+
function qt(t) {
|
|
643
665
|
const e = {};
|
|
644
666
|
return nt(e), e;
|
|
645
667
|
}
|
|
646
668
|
function nt(t) {
|
|
647
|
-
return t.Description = "", t.Codec =
|
|
669
|
+
return t.Description = "", t.Codec = c.Unknown, t.SampleRate = 0, t.Channels = 0, t.BitDepth = 0, t.ShapeSets = void 0, t;
|
|
648
670
|
}
|
|
649
|
-
function
|
|
650
|
-
const r =
|
|
651
|
-
return
|
|
671
|
+
function te(t, e) {
|
|
672
|
+
const r = F.create(t);
|
|
673
|
+
return ee(r, e);
|
|
652
674
|
}
|
|
653
|
-
function
|
|
654
|
-
const r = e ??
|
|
655
|
-
return nt(r),
|
|
675
|
+
function ee(t, e) {
|
|
676
|
+
const r = e ?? qt();
|
|
677
|
+
return nt(r), re(t, r), r;
|
|
656
678
|
}
|
|
657
|
-
function
|
|
679
|
+
function re(t, e) {
|
|
658
680
|
let r;
|
|
659
681
|
for (; (r = t.next()) !== null; )
|
|
660
682
|
switch (r.fieldId) {
|
|
661
|
-
case
|
|
683
|
+
case Xt: {
|
|
662
684
|
if (r.isNull) {
|
|
663
685
|
e.ShapeSets = void 0;
|
|
664
686
|
break;
|
|
665
687
|
}
|
|
666
|
-
e.ShapeSets =
|
|
688
|
+
e.ShapeSets = ne(r.asArray());
|
|
667
689
|
break;
|
|
668
690
|
}
|
|
669
|
-
case
|
|
691
|
+
case jt: {
|
|
670
692
|
if (r.isNull) throw new Error();
|
|
671
693
|
e.Description = r.asString();
|
|
672
694
|
break;
|
|
673
695
|
}
|
|
674
|
-
case
|
|
696
|
+
case $t: {
|
|
675
697
|
if (r.isNull) throw new Error();
|
|
676
698
|
e.Channels = r.asInt32();
|
|
677
699
|
break;
|
|
678
700
|
}
|
|
679
|
-
case
|
|
701
|
+
case Qt: {
|
|
680
702
|
if (r.isNull) throw new Error();
|
|
681
703
|
e.BitDepth = r.asInt32();
|
|
682
704
|
break;
|
|
683
705
|
}
|
|
684
|
-
case
|
|
706
|
+
case Jt: {
|
|
685
707
|
if (r.isNull) throw new Error();
|
|
686
708
|
e.Codec = r.asInt32();
|
|
687
709
|
break;
|
|
688
710
|
}
|
|
689
|
-
case
|
|
711
|
+
case Zt: {
|
|
690
712
|
if (r.isNull) throw new Error();
|
|
691
713
|
e.SampleRate = r.asInt32();
|
|
692
714
|
break;
|
|
693
715
|
}
|
|
694
716
|
}
|
|
695
717
|
}
|
|
696
|
-
function
|
|
697
|
-
const r = tt(t,
|
|
698
|
-
return
|
|
718
|
+
async function se(t, e) {
|
|
719
|
+
const r = await tt(t, zt);
|
|
720
|
+
return te(r, e);
|
|
699
721
|
}
|
|
700
|
-
function
|
|
722
|
+
function ne(t) {
|
|
701
723
|
const e = [];
|
|
702
724
|
let r;
|
|
703
725
|
for (; (r = t.next()) !== null; )
|
|
704
|
-
e.push(
|
|
726
|
+
e.push(Ee(r.asObject()));
|
|
705
727
|
return e;
|
|
706
728
|
}
|
|
707
|
-
const
|
|
708
|
-
function
|
|
729
|
+
const ie = 1107713536, ae = 1154362099, oe = 1185721362;
|
|
730
|
+
function _e(t) {
|
|
709
731
|
const e = {};
|
|
710
732
|
return it(e), e;
|
|
711
733
|
}
|
|
712
734
|
function it(t) {
|
|
713
735
|
return t.SetId = 0, t.Name = "", t.ShapeNames = [], t;
|
|
714
736
|
}
|
|
715
|
-
function
|
|
716
|
-
const r = e ??
|
|
717
|
-
return it(r),
|
|
737
|
+
function Ee(t, e) {
|
|
738
|
+
const r = e ?? _e();
|
|
739
|
+
return it(r), le(t, r), r;
|
|
718
740
|
}
|
|
719
|
-
function
|
|
741
|
+
function le(t, e) {
|
|
720
742
|
let r;
|
|
721
743
|
for (; (r = t.next()) !== null; )
|
|
722
744
|
switch (r.fieldId) {
|
|
723
|
-
case
|
|
745
|
+
case ie: {
|
|
724
746
|
if (r.isNull) throw new Error();
|
|
725
747
|
e.Name = r.asString();
|
|
726
748
|
break;
|
|
727
749
|
}
|
|
728
|
-
case
|
|
750
|
+
case ae: {
|
|
729
751
|
if (r.isNull) throw new Error();
|
|
730
752
|
e.SetId = r.asUInt32();
|
|
731
753
|
break;
|
|
732
754
|
}
|
|
733
|
-
case
|
|
755
|
+
case oe: {
|
|
734
756
|
if (r.isNull) throw new Error();
|
|
735
|
-
e.ShapeNames =
|
|
757
|
+
e.ShapeNames = Ie(r.asArray());
|
|
736
758
|
break;
|
|
737
759
|
}
|
|
738
760
|
}
|
|
739
761
|
}
|
|
740
|
-
function
|
|
762
|
+
function Ie(t) {
|
|
741
763
|
const e = [];
|
|
742
764
|
let r;
|
|
743
765
|
for (; (r = t.next()) !== null; )
|
|
@@ -798,9 +820,9 @@ class j {
|
|
|
798
820
|
return s = (s + r) % this.capacity, Atomics.store(this.readWrite, 0, s), r;
|
|
799
821
|
}
|
|
800
822
|
}
|
|
801
|
-
const
|
|
802
|
-
function
|
|
803
|
-
if (typeof SharedArrayBuffer > "u" || typeof Atomics > "u" ||
|
|
823
|
+
const ue = globalThis;
|
|
824
|
+
function he() {
|
|
825
|
+
if (typeof SharedArrayBuffer > "u" || typeof Atomics > "u" || ue.crossOriginIsolated === !1)
|
|
804
826
|
return !1;
|
|
805
827
|
try {
|
|
806
828
|
new SharedArrayBuffer(1);
|
|
@@ -809,13 +831,13 @@ function Ie() {
|
|
|
809
831
|
}
|
|
810
832
|
return !0;
|
|
811
833
|
}
|
|
812
|
-
let
|
|
813
|
-
function
|
|
834
|
+
let fe = 1;
|
|
835
|
+
function Ae(t, e) {
|
|
814
836
|
return `[${t}] ${e}`;
|
|
815
837
|
}
|
|
816
838
|
function b(t, e, r, s) {
|
|
817
|
-
if ((/* @__PURE__ */ new Date()).toISOString(),
|
|
818
|
-
const n =
|
|
839
|
+
if ((/* @__PURE__ */ new Date()).toISOString(), fe <= t) {
|
|
840
|
+
const n = Ae(e, r);
|
|
819
841
|
switch (t) {
|
|
820
842
|
case 0:
|
|
821
843
|
console.debug(n, ...s);
|
|
@@ -832,7 +854,7 @@ function b(t, e, r, s) {
|
|
|
832
854
|
}
|
|
833
855
|
}
|
|
834
856
|
}
|
|
835
|
-
function
|
|
857
|
+
function ce(t) {
|
|
836
858
|
return {
|
|
837
859
|
debug(e, ...r) {
|
|
838
860
|
b(0, t, e, r);
|
|
@@ -848,9 +870,9 @@ function fe(t) {
|
|
|
848
870
|
}
|
|
849
871
|
};
|
|
850
872
|
}
|
|
851
|
-
const at = 48e3, ot = 2,
|
|
873
|
+
const at = 48e3, ot = 2, Te = 1500, Ne = 10, $ = 80, Se = 50, Q = 64, Ce = ce("AudioPlaybackWorker"), P = (t, e) => {
|
|
852
874
|
self.postMessage(t, e ?? []);
|
|
853
|
-
},
|
|
875
|
+
}, Re = he();
|
|
854
876
|
let V = "pcm", _t = !0, R = at, C = ot, y = null;
|
|
855
877
|
function L(t, e) {
|
|
856
878
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
@@ -860,7 +882,7 @@ function W(t) {
|
|
|
860
882
|
const e = q(t);
|
|
861
883
|
return `${e.senderId}_${e.trackId}`;
|
|
862
884
|
}
|
|
863
|
-
class
|
|
885
|
+
class me {
|
|
864
886
|
mode;
|
|
865
887
|
ring = null;
|
|
866
888
|
sab = void 0;
|
|
@@ -883,8 +905,8 @@ class Ce {
|
|
|
883
905
|
}
|
|
884
906
|
rebind(e) {
|
|
885
907
|
if (!this.closed) {
|
|
886
|
-
if (this.mode = e, e === "sab" &&
|
|
887
|
-
const r = Math.floor(
|
|
908
|
+
if (this.mode = e, e === "sab" && Re) {
|
|
909
|
+
const r = Math.floor(Te * this.outputSampleRate * this.outputChannels / 1e3), s = j.getStorageForCapacity(r, Float32Array), n = new j(s, Float32Array);
|
|
888
910
|
n.flush(), this.sab = s, this.ring = n;
|
|
889
911
|
return;
|
|
890
912
|
}
|
|
@@ -895,7 +917,7 @@ class Ce {
|
|
|
895
917
|
if (this.closed || this.mode !== "pcm" || this.pcmBatchOffset <= 0)
|
|
896
918
|
return;
|
|
897
919
|
const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * $ / 1e3));
|
|
898
|
-
if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >=
|
|
920
|
+
if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >= Se))
|
|
899
921
|
return;
|
|
900
922
|
const a = new Float32Array(this.pcmBatchOffset);
|
|
901
923
|
a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = r, P({ type: "pcm", streamId: this.streamId, pcm: a }, [a.buffer]);
|
|
@@ -931,25 +953,25 @@ class Ce {
|
|
|
931
953
|
this.closed || (this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = 0, this.ring?.flush());
|
|
932
954
|
}
|
|
933
955
|
}
|
|
934
|
-
function
|
|
956
|
+
function Ue(t) {
|
|
935
957
|
switch (t) {
|
|
936
|
-
case
|
|
958
|
+
case c.Opus:
|
|
937
959
|
return "opus";
|
|
938
|
-
case
|
|
960
|
+
case c.Mp3:
|
|
939
961
|
return "mp3";
|
|
940
962
|
default:
|
|
941
963
|
return null;
|
|
942
964
|
}
|
|
943
965
|
}
|
|
944
966
|
let g = null;
|
|
945
|
-
function
|
|
967
|
+
function Le(t) {
|
|
946
968
|
const e = new DataView(t.buffer, t.byteOffset, t.byteLength), r = Math.floor(t.byteLength / 2);
|
|
947
969
|
(!g || g.length < r) && (g = new Float32Array(r));
|
|
948
970
|
for (let s = 0; s < r; s++)
|
|
949
971
|
g[s] = e.getInt16(s * 2, !0) / 32768;
|
|
950
972
|
return g.subarray(0, r);
|
|
951
973
|
}
|
|
952
|
-
class
|
|
974
|
+
class z {
|
|
953
975
|
inputSampleRate;
|
|
954
976
|
inputChannels;
|
|
955
977
|
sink;
|
|
@@ -977,25 +999,25 @@ class X {
|
|
|
977
999
|
}
|
|
978
1000
|
convertAudioData(e) {
|
|
979
1001
|
const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format, a = typeof n == "string" && n.includes("planar"), i = "f32-planar", o = "f32", _ = () => {
|
|
980
|
-
const
|
|
1002
|
+
const I = new Array(s);
|
|
981
1003
|
for (let h = 0; h < s; h++) {
|
|
982
1004
|
const N = new Float32Array(r);
|
|
983
|
-
e.copyTo(N, { planeIndex: h, format: i }),
|
|
1005
|
+
e.copyTo(N, { planeIndex: h, format: i }), I[h] = N;
|
|
984
1006
|
}
|
|
985
|
-
return
|
|
986
|
-
},
|
|
987
|
-
const
|
|
988
|
-
return e.copyTo(
|
|
1007
|
+
return Ge(I, r);
|
|
1008
|
+
}, E = () => {
|
|
1009
|
+
const I = new Float32Array(r * s);
|
|
1010
|
+
return e.copyTo(I, { planeIndex: 0, format: o }), I;
|
|
989
1011
|
};
|
|
990
1012
|
let l;
|
|
991
1013
|
if (a)
|
|
992
1014
|
try {
|
|
993
1015
|
l = _();
|
|
994
|
-
} catch (
|
|
995
|
-
|
|
1016
|
+
} catch (I) {
|
|
1017
|
+
Ce.debug(`Failed to read planar audio data, falling back to interleaved copy: ${I}`), l = E();
|
|
996
1018
|
}
|
|
997
1019
|
else
|
|
998
|
-
l =
|
|
1020
|
+
l = E();
|
|
999
1021
|
return l;
|
|
1000
1022
|
}
|
|
1001
1023
|
convertPcmBuffer(e, r, s) {
|
|
@@ -1003,26 +1025,26 @@ class X {
|
|
|
1003
1025
|
return e;
|
|
1004
1026
|
let n = e, a = e.length, i = r;
|
|
1005
1027
|
if (s !== R) {
|
|
1006
|
-
const o = a / i,
|
|
1007
|
-
a =
|
|
1028
|
+
const o = a / i, E = Math.max(1, Math.round(o * R / s)) * i, l = this.getResampleBuffer(E);
|
|
1029
|
+
a = ve(n, l, i, s, R), n = l;
|
|
1008
1030
|
}
|
|
1009
1031
|
if (i !== C) {
|
|
1010
|
-
const _ = a / i * C,
|
|
1011
|
-
a =
|
|
1032
|
+
const _ = a / i * C, E = this.getRemixBuffer(_);
|
|
1033
|
+
a = ke(n.subarray(0, a), E, i, C), n = E, i = C;
|
|
1012
1034
|
}
|
|
1013
1035
|
return n.subarray(0, a);
|
|
1014
1036
|
}
|
|
1015
1037
|
}
|
|
1016
|
-
class
|
|
1038
|
+
class ye extends z {
|
|
1017
1039
|
feedChunk(e) {
|
|
1018
1040
|
e.isFirst && this.reset();
|
|
1019
|
-
const r =
|
|
1041
|
+
const r = Le(e.data);
|
|
1020
1042
|
this.writeConvertedPcm(r, this.inputChannels, this.inputSampleRate), e.isLast && this.reset();
|
|
1021
1043
|
}
|
|
1022
1044
|
close() {
|
|
1023
1045
|
}
|
|
1024
1046
|
}
|
|
1025
|
-
class
|
|
1047
|
+
class De extends z {
|
|
1026
1048
|
decoder;
|
|
1027
1049
|
codec;
|
|
1028
1050
|
constructor(e) {
|
|
@@ -1081,7 +1103,7 @@ class Le extends X {
|
|
|
1081
1103
|
}
|
|
1082
1104
|
}
|
|
1083
1105
|
}
|
|
1084
|
-
class
|
|
1106
|
+
class de extends z {
|
|
1085
1107
|
decoder = null;
|
|
1086
1108
|
isReady = !1;
|
|
1087
1109
|
decoderSampleRate = 48e3;
|
|
@@ -1121,16 +1143,16 @@ class ye extends X {
|
|
|
1121
1143
|
return;
|
|
1122
1144
|
const o = a * i, _ = this.getInterleavedBuffer(o);
|
|
1123
1145
|
if (i === 2) {
|
|
1124
|
-
const
|
|
1125
|
-
for (let
|
|
1126
|
-
_[h++] =
|
|
1146
|
+
const E = n[0], l = n[1];
|
|
1147
|
+
for (let I = 0, h = 0; I < a; I++)
|
|
1148
|
+
_[h++] = E[I], _[h++] = l[I];
|
|
1127
1149
|
} else if (i === 1)
|
|
1128
1150
|
_.set(n[0].subarray(0, a));
|
|
1129
1151
|
else {
|
|
1130
|
-
let
|
|
1152
|
+
let E = 0;
|
|
1131
1153
|
for (let l = 0; l < a; l++)
|
|
1132
|
-
for (let
|
|
1133
|
-
_[
|
|
1154
|
+
for (let I = 0; I < i; I++)
|
|
1155
|
+
_[E++] = n[I][l];
|
|
1134
1156
|
}
|
|
1135
1157
|
this.writeConvertedPcm(_.subarray(0, o), i, this.decoderSampleRate), e.isLast && this.reset();
|
|
1136
1158
|
} catch (r) {
|
|
@@ -1152,21 +1174,21 @@ class ye extends X {
|
|
|
1152
1174
|
this.decoder = null, this.pendingChunks.length = 0;
|
|
1153
1175
|
}
|
|
1154
1176
|
}
|
|
1155
|
-
const
|
|
1156
|
-
async function
|
|
1177
|
+
const T = /* @__PURE__ */ new Map();
|
|
1178
|
+
async function Pe(t) {
|
|
1157
1179
|
if (t.closed || t.decoder)
|
|
1158
1180
|
return;
|
|
1159
|
-
if (t.codec ===
|
|
1160
|
-
t.decoder = new
|
|
1181
|
+
if (t.codec === c.RawPcm16) {
|
|
1182
|
+
t.decoder = new ye({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
|
|
1161
1183
|
return;
|
|
1162
1184
|
}
|
|
1163
|
-
if (t.codec !==
|
|
1164
|
-
throw new Error(`Unsupported audio codec: ${
|
|
1165
|
-
const e =
|
|
1185
|
+
if (t.codec !== c.Opus && t.codec !== c.Mp3)
|
|
1186
|
+
throw new Error(`Unsupported audio codec: ${c[t.codec] ?? t.codec}`);
|
|
1187
|
+
const e = Ue(t.codec);
|
|
1166
1188
|
if (_t && typeof AudioDecoder < "u" && e !== null)
|
|
1167
1189
|
try {
|
|
1168
1190
|
if ((await AudioDecoder.isConfigSupported({ codec: e, numberOfChannels: t.inputChannels, sampleRate: t.inputSampleRate })).supported) {
|
|
1169
|
-
const n = new
|
|
1191
|
+
const n = new De({
|
|
1170
1192
|
codec: e,
|
|
1171
1193
|
inputChannels: t.inputChannels,
|
|
1172
1194
|
inputSampleRate: t.inputSampleRate,
|
|
@@ -1181,8 +1203,8 @@ async function De(t) {
|
|
|
1181
1203
|
}
|
|
1182
1204
|
} catch {
|
|
1183
1205
|
}
|
|
1184
|
-
if (t.codec ===
|
|
1185
|
-
const s = new
|
|
1206
|
+
if (t.codec === c.Opus) {
|
|
1207
|
+
const s = new de({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
|
|
1186
1208
|
if (await s.initialise(t.inputChannels, t.inputSampleRate), t.closed) {
|
|
1187
1209
|
s.close();
|
|
1188
1210
|
return;
|
|
@@ -1190,9 +1212,9 @@ async function De(t) {
|
|
|
1190
1212
|
t.decoder = s;
|
|
1191
1213
|
return;
|
|
1192
1214
|
}
|
|
1193
|
-
throw new Error(`No available decoder for codec: ${
|
|
1215
|
+
throw new Error(`No available decoder for codec: ${c[t.codec] ?? t.codec}`);
|
|
1194
1216
|
}
|
|
1195
|
-
function
|
|
1217
|
+
function we(t) {
|
|
1196
1218
|
if (t.closed) {
|
|
1197
1219
|
t.pendingFrames.splice(0);
|
|
1198
1220
|
try {
|
|
@@ -1220,16 +1242,16 @@ function Et(t, e) {
|
|
|
1220
1242
|
const a = performance.now();
|
|
1221
1243
|
if (t.lastArrivalTimeMs > 0) {
|
|
1222
1244
|
const h = a - t.lastArrivalTimeMs, N = Math.abs(h - t.expectedIntervalMs);
|
|
1223
|
-
t.jitterMs = t.jitterMs + (N - t.jitterMs) /
|
|
1245
|
+
t.jitterMs = t.jitterMs + (N - t.jitterMs) / Ne;
|
|
1224
1246
|
}
|
|
1225
1247
|
t.lastArrivalTimeMs = a;
|
|
1226
|
-
const i = t.inputSampleRate * t.inputChannels, o = R * C, _ = Math.round(s * o / i),
|
|
1248
|
+
const i = t.inputSampleRate * t.inputChannels, o = R * C, _ = Math.round(s * o / i), E = Math.round(n * o / i), l = Math.round(s * 1e6 / i), I = Math.round(n * 1e6 / i);
|
|
1227
1249
|
P({
|
|
1228
1250
|
type: "frame",
|
|
1229
1251
|
streamId: t.streamId,
|
|
1230
1252
|
epoch: r,
|
|
1231
1253
|
timestampInterleavedSamples: _,
|
|
1232
|
-
frameSizeInterleavedSamples:
|
|
1254
|
+
frameSizeInterleavedSamples: E,
|
|
1233
1255
|
isFirst: e.IsFirst,
|
|
1234
1256
|
isLast: e.IsLast,
|
|
1235
1257
|
jitterMs: t.jitterMs,
|
|
@@ -1239,11 +1261,11 @@ function Et(t, e) {
|
|
|
1239
1261
|
isFirst: e.IsFirst,
|
|
1240
1262
|
isLast: e.IsLast,
|
|
1241
1263
|
timestampUs: l,
|
|
1242
|
-
durationUs:
|
|
1264
|
+
durationUs: I
|
|
1243
1265
|
});
|
|
1244
1266
|
}
|
|
1245
|
-
function
|
|
1246
|
-
const e = W(t), r =
|
|
1267
|
+
async function Oe(t) {
|
|
1268
|
+
const e = W(t), r = await se(t), s = T.get(e);
|
|
1247
1269
|
if (s) {
|
|
1248
1270
|
s.closed = !0, s.pendingFrames.splice(0);
|
|
1249
1271
|
try {
|
|
@@ -1254,9 +1276,9 @@ function Pe(t) {
|
|
|
1254
1276
|
s.sink.drainPcm(), s.sink.close();
|
|
1255
1277
|
} catch {
|
|
1256
1278
|
}
|
|
1257
|
-
|
|
1279
|
+
T.delete(e);
|
|
1258
1280
|
}
|
|
1259
|
-
const n = new
|
|
1281
|
+
const n = new me(e), a = {
|
|
1260
1282
|
streamId: e,
|
|
1261
1283
|
codec: r.Codec,
|
|
1262
1284
|
inputSampleRate: r.SampleRate,
|
|
@@ -1273,15 +1295,15 @@ function Pe(t) {
|
|
|
1273
1295
|
expectedIntervalMs: 20,
|
|
1274
1296
|
shapeSets: r.ShapeSets
|
|
1275
1297
|
};
|
|
1276
|
-
|
|
1298
|
+
T.set(e, a), P({
|
|
1277
1299
|
type: "streamBegin",
|
|
1278
1300
|
streamId: e,
|
|
1279
1301
|
sharedArrayBuffer: n.getSharedArrayBuffer(),
|
|
1280
1302
|
shapeSets: r.ShapeSets
|
|
1281
1303
|
});
|
|
1282
1304
|
}
|
|
1283
|
-
function
|
|
1284
|
-
for (const t of
|
|
1305
|
+
function ge() {
|
|
1306
|
+
for (const t of T.values())
|
|
1285
1307
|
P({
|
|
1286
1308
|
type: "streamBegin",
|
|
1287
1309
|
streamId: t.streamId,
|
|
@@ -1289,8 +1311,8 @@ function we() {
|
|
|
1289
1311
|
shapeSets: t.shapeSets
|
|
1290
1312
|
});
|
|
1291
1313
|
}
|
|
1292
|
-
function
|
|
1293
|
-
const e = W(t), r =
|
|
1314
|
+
function Fe(t) {
|
|
1315
|
+
const e = W(t), r = T.get(e);
|
|
1294
1316
|
if (r) {
|
|
1295
1317
|
r.closed = !0, r.pendingFrames.splice(0);
|
|
1296
1318
|
try {
|
|
@@ -1301,32 +1323,32 @@ function Oe(t) {
|
|
|
1301
1323
|
r.decoder?.close();
|
|
1302
1324
|
} catch {
|
|
1303
1325
|
}
|
|
1304
|
-
r.decoder = null,
|
|
1326
|
+
r.decoder = null, T.delete(e), P({ type: "streamEnd", streamId: e });
|
|
1305
1327
|
}
|
|
1306
1328
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const e = W(t), r =
|
|
1329
|
+
async function Me(t) {
|
|
1330
|
+
const e = W(t), r = T.get(e);
|
|
1309
1331
|
if (!r || r.closed)
|
|
1310
1332
|
return;
|
|
1311
|
-
const s =
|
|
1333
|
+
const s = await vt(t);
|
|
1312
1334
|
if (!r.decoder) {
|
|
1313
|
-
r.pendingFrames.length >= Q && r.pendingFrames.splice(0, r.pendingFrames.length - Q + 1), r.pendingFrames.push(s), r.initTask || (r.initTask =
|
|
1335
|
+
r.pendingFrames.length >= Q && r.pendingFrames.splice(0, r.pendingFrames.length - Q + 1), r.pendingFrames.push(s), r.initTask || (r.initTask = Pe(r).then(() => we(r)).catch((n) => {
|
|
1314
1336
|
r.closed || L(n, e);
|
|
1315
1337
|
}));
|
|
1316
1338
|
return;
|
|
1317
1339
|
}
|
|
1318
1340
|
Et(r, s);
|
|
1319
1341
|
}
|
|
1320
|
-
function
|
|
1321
|
-
switch (
|
|
1342
|
+
function Be(t) {
|
|
1343
|
+
switch (ft(t)) {
|
|
1322
1344
|
case G.AUDIO_STREAM_BEGIN:
|
|
1323
|
-
|
|
1345
|
+
Oe(t);
|
|
1324
1346
|
return;
|
|
1325
1347
|
case G.AUDIO_STREAM_END:
|
|
1326
|
-
|
|
1348
|
+
Fe(t);
|
|
1327
1349
|
return;
|
|
1328
1350
|
case G.AUDIO_FRAME2:
|
|
1329
|
-
|
|
1351
|
+
Me(t);
|
|
1330
1352
|
return;
|
|
1331
1353
|
default:
|
|
1332
1354
|
return;
|
|
@@ -1341,9 +1363,9 @@ function lt() {
|
|
|
1341
1363
|
y = null;
|
|
1342
1364
|
}
|
|
1343
1365
|
}
|
|
1344
|
-
function
|
|
1366
|
+
function be() {
|
|
1345
1367
|
lt();
|
|
1346
|
-
for (const t of
|
|
1368
|
+
for (const t of T.values()) {
|
|
1347
1369
|
try {
|
|
1348
1370
|
t.sink.drainPcm(), t.sink.close();
|
|
1349
1371
|
} catch {
|
|
@@ -1353,7 +1375,7 @@ function Fe() {
|
|
|
1353
1375
|
} catch {
|
|
1354
1376
|
}
|
|
1355
1377
|
}
|
|
1356
|
-
|
|
1378
|
+
T.clear();
|
|
1357
1379
|
}
|
|
1358
1380
|
self.addEventListener("message", (t) => {
|
|
1359
1381
|
const e = t.data;
|
|
@@ -1364,36 +1386,36 @@ self.addEventListener("message", (t) => {
|
|
|
1364
1386
|
if (e.type === "attachProtocolPort") {
|
|
1365
1387
|
lt(), y = e.port, y.addEventListener("message", (r) => {
|
|
1366
1388
|
const s = r.data;
|
|
1367
|
-
s?.type === "protocol" && s.message instanceof ArrayBuffer &&
|
|
1389
|
+
s?.type === "protocol" && s.message instanceof ArrayBuffer && Be(new Uint8Array(s.message));
|
|
1368
1390
|
}), y.start?.();
|
|
1369
1391
|
return;
|
|
1370
1392
|
}
|
|
1371
1393
|
if (e.type === "rebind") {
|
|
1372
1394
|
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 && (C = e.outputChannels);
|
|
1373
|
-
for (const r of
|
|
1395
|
+
for (const r of T.values())
|
|
1374
1396
|
r.sink.setOutputFormat(R, C), r.sink.rebind(V);
|
|
1375
|
-
|
|
1397
|
+
ge();
|
|
1376
1398
|
return;
|
|
1377
1399
|
}
|
|
1378
|
-
e.type === "dispose" &&
|
|
1400
|
+
e.type === "dispose" && be();
|
|
1379
1401
|
});
|
|
1380
|
-
let
|
|
1381
|
-
function
|
|
1402
|
+
let m = null;
|
|
1403
|
+
function Ge(t, e) {
|
|
1382
1404
|
const r = t.length;
|
|
1383
1405
|
if (r === 1)
|
|
1384
1406
|
return t[0];
|
|
1385
1407
|
const s = e * r;
|
|
1386
|
-
if ((!
|
|
1408
|
+
if ((!m || m.length < s) && (m = new Float32Array(s)), r === 2) {
|
|
1387
1409
|
const n = t[0], a = t[1];
|
|
1388
1410
|
for (let i = 0, o = 0; i < e; i++)
|
|
1389
|
-
|
|
1411
|
+
m[o++] = n[i], m[o++] = a[i];
|
|
1390
1412
|
} else {
|
|
1391
1413
|
let n = 0;
|
|
1392
1414
|
for (let a = 0; a < e; a++)
|
|
1393
1415
|
for (let i = 0; i < r; i++)
|
|
1394
|
-
|
|
1416
|
+
m[n++] = t[i][a];
|
|
1395
1417
|
}
|
|
1396
|
-
return
|
|
1418
|
+
return m.subarray(0, s);
|
|
1397
1419
|
}
|
|
1398
1420
|
const J = 3;
|
|
1399
1421
|
function Z(t) {
|
|
@@ -1402,32 +1424,32 @@ function Z(t) {
|
|
|
1402
1424
|
const e = Math.PI * t;
|
|
1403
1425
|
return Math.sin(e) / e;
|
|
1404
1426
|
}
|
|
1405
|
-
function
|
|
1427
|
+
function Ve(t, e) {
|
|
1406
1428
|
return t === 0 ? 1 : Math.abs(t) >= e ? 0 : Z(t) * Z(t / e);
|
|
1407
1429
|
}
|
|
1408
|
-
function
|
|
1430
|
+
function ve(t, e, r, s, n) {
|
|
1409
1431
|
if (s === n)
|
|
1410
1432
|
return e.set(t), t.length;
|
|
1411
|
-
const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), o = s / n, _ = o > 1 ? o : 1,
|
|
1433
|
+
const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), o = s / n, _ = o > 1 ? o : 1, E = Math.ceil(J * _);
|
|
1412
1434
|
for (let l = 0; l < r; l++)
|
|
1413
|
-
for (let
|
|
1414
|
-
const h =
|
|
1415
|
-
let w = 0,
|
|
1416
|
-
for (let v = -
|
|
1435
|
+
for (let I = 0; I < i; I++) {
|
|
1436
|
+
const h = I * o, N = Math.floor(h);
|
|
1437
|
+
let w = 0, U = 0;
|
|
1438
|
+
for (let v = -E + 1; v <= E; v++) {
|
|
1417
1439
|
const B = N + v;
|
|
1418
1440
|
if (B < 0 || B >= a)
|
|
1419
1441
|
continue;
|
|
1420
|
-
const It = (h - B) / _, k =
|
|
1442
|
+
const It = (h - B) / _, k = Ve(It, J);
|
|
1421
1443
|
if (k !== 0) {
|
|
1422
1444
|
const ut = t[B * r + l] ?? 0;
|
|
1423
|
-
w += ut * k,
|
|
1445
|
+
w += ut * k, U += k;
|
|
1424
1446
|
}
|
|
1425
1447
|
}
|
|
1426
|
-
e[
|
|
1448
|
+
e[I * r + l] = U > 0 ? w / U : 0;
|
|
1427
1449
|
}
|
|
1428
1450
|
return i * r;
|
|
1429
1451
|
}
|
|
1430
|
-
function
|
|
1452
|
+
function ke(t, e, r, s) {
|
|
1431
1453
|
const n = t.length / r;
|
|
1432
1454
|
if (r === s)
|
|
1433
1455
|
return e.set(t), t.length;
|