@ikonai/sdk-ui 1.0.79 → 1.0.80

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.
@@ -1,45 +1,45 @@
1
- const ht = {
1
+ const Tt = {
2
2
  Compressed: 8
3
3
  };
4
- function Nt(t) {
4
+ function ct(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
9
  function et(t) {
10
- const e = d(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
10
+ const e = M(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), a = r.getUint32(8, !0), i = r.getUint32(12, !0), _ = r.getUint32(16, !0), E = r.getUint32(20, !0), I = r.getUint8(24), A = r.getUint8(25), o = r.getUint8(26);
14
- if (27 + E * 4 > e.length)
13
+ const s = r.getUint32(0, !0), n = r.getUint32(4, !0), a = r.getUint32(8, !0), i = r.getUint32(12, !0), E = r.getUint32(16, !0), _ = r.getUint32(20, !0), o = r.getUint8(24), l = r.getUint8(25), A = r.getUint8(26);
14
+ if (27 + _ * 4 > e.length)
15
15
  throw new Error("Protocol header exceeds payload length");
16
- const C = [];
17
- let w = 27;
18
- for (let L = 0; L < E; L++)
19
- C.push(r.getUint32(w, !0)), w += 4;
16
+ const R = [];
17
+ let P = 27;
18
+ for (let L = 0; L < _; L++)
19
+ R.push(r.getUint32(P, !0)), P += 4;
20
20
  return {
21
21
  length: s,
22
22
  opcode: n,
23
23
  senderId: a,
24
24
  trackId: i,
25
- sequenceId: _,
26
- targetIds: C,
27
- payloadVersion: I,
28
- payloadType: A,
29
- flags: o
25
+ sequenceId: E,
26
+ targetIds: R,
27
+ payloadVersion: o,
28
+ payloadType: l,
29
+ flags: A
30
30
  };
31
31
  }
32
32
  async function rt(t, e, r) {
33
- const s = d(t), n = et(s);
33
+ const s = M(t), n = et(s);
34
34
  if (e !== void 0 && n.opcode !== e)
35
35
  throw new Error(`Unexpected opcode ${n.opcode}`);
36
36
  if (n.payloadType !== 8)
37
37
  throw new Error(`Unexpected payload type ${n.payloadType}`);
38
38
  const a = 27 + n.targetIds.length * 4;
39
39
  let i = s.subarray(a, n.length);
40
- return (n.flags & ht.Compressed) !== 0 && (i = await Ct(i)), i;
40
+ return (n.flags & Tt.Compressed) !== 0 && (i = await Rt(i)), i;
41
41
  }
42
- async function Ct(t) {
42
+ async function Rt(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);
@@ -47,34 +47,34 @@ async function Ct(t) {
47
47
  const n = e.readable.getReader(), a = [];
48
48
  let i = 0;
49
49
  for (; ; ) {
50
- const { done: I, value: A } = await n.read();
51
- if (I) break;
52
- a.push(A), i += A.length;
53
- }
54
- const _ = new Uint8Array(i);
55
- let E = 0;
56
- for (let I = 0; I < a.length; I++)
57
- _.set(a[I], E), E += a[I].length;
58
- return _;
59
- }
60
- var P = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(P || {});
61
- const Rt = 161, St = 162;
50
+ const { done: o, value: l } = await n.read();
51
+ if (o) break;
52
+ a.push(l), i += l.length;
53
+ }
54
+ const E = new Uint8Array(i);
55
+ let _ = 0;
56
+ for (let o = 0; o < a.length; o++)
57
+ E.set(a[o], _), _ += a[o].length;
58
+ return E;
59
+ }
60
+ var O = /* @__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))(O || {});
61
+ const Ct = 161, Nt = 162;
62
62
  new TextEncoder();
63
- const ct = new TextDecoder("utf-8", { fatal: !0 });
64
- class M {
63
+ const St = new TextDecoder("utf-8", { fatal: !0 });
64
+ class F {
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 = d(e);
71
+ const r = M(e);
72
72
  if (r.length < 2)
73
73
  throw new Error("Teleport payload too short");
74
- if (r[0] !== Rt || r[r.length - 1] !== St)
74
+ if (r[0] !== Ct || r[r.length - 1] !== Nt)
75
75
  throw new Error("Teleport object missing markers");
76
- const s = { offset: 1 }, n = f(r, s, "InvalidLength");
77
- return new M(r, n, s.offset);
76
+ const s = { offset: 1 }, n = I(r, s, "InvalidLength");
77
+ return new F(r, n, s.offset);
78
78
  }
79
79
  next() {
80
80
  if (this.offset >= this.end)
@@ -86,18 +86,18 @@ class M {
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 = O(s);
89
+ const n = y(s);
90
90
  let a;
91
91
  if (n >= 0)
92
- u(this.buffer, this.offset, n), a = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
92
+ h(this.buffer, this.offset, n), a = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
93
93
  else {
94
- const i = { offset: this.offset }, _ = f(this.buffer, i, "InvalidLength");
95
- u(this.buffer, i.offset, _), a = this.buffer.subarray(i.offset, i.offset + _), this.offset = i.offset + _;
94
+ const i = { offset: this.offset }, E = I(this.buffer, i, "InvalidLength");
95
+ h(this.buffer, i.offset, E), a = this.buffer.subarray(i.offset, i.offset + E), this.offset = i.offset + E;
96
96
  }
97
- return new Ut(e, s, a);
97
+ return new mt(e, s, a);
98
98
  }
99
99
  }
100
- class R {
100
+ class C {
101
101
  constructor(e, r) {
102
102
  this.type = e, this.payload = r;
103
103
  }
@@ -159,19 +159,19 @@ class R {
159
159
  return this.ensureType(
160
160
  12
161
161
  /* String */
162
- ), ct.decode(this.payload);
162
+ ), St.decode(this.payload);
163
163
  }
164
164
  asGuid() {
165
165
  return this.ensureType(
166
166
  14
167
167
  /* Guid */
168
- ), l.fromBytes(this.payload);
168
+ ), u.fromBytes(this.payload);
169
169
  }
170
170
  asObject() {
171
171
  return this.ensureType(
172
172
  11
173
173
  /* Object */
174
- ), M.create(this.payload);
174
+ ), F.create(this.payload);
175
175
  }
176
176
  asArray() {
177
177
  return this.ensureType(
@@ -183,14 +183,14 @@ class R {
183
183
  return this.ensureType(
184
184
  10
185
185
  /* Dict */
186
- ), W.create(this.payload);
186
+ ), H.create(this.payload);
187
187
  }
188
188
  ensureType(e) {
189
189
  if (this.type !== e)
190
- throw new Error(`Teleport value has type ${P[this.type]}, expected ${P[e]}`);
190
+ throw new Error(`Teleport value has type ${O[this.type]}, expected ${O[e]}`);
191
191
  }
192
192
  }
193
- class Ut extends R {
193
+ class mt extends C {
194
194
  constructor(e, r, s) {
195
195
  super(r, s), this.fieldId = e;
196
196
  }
@@ -211,10 +211,10 @@ class x {
211
211
  if (this.elementType = r >> 4 & 15, (r & 15) !== 0)
212
212
  throw new Error("Array flags must be zero");
213
213
  const s = { offset: 1 };
214
- this.count = f(e, s, "ArrayMalformed"), this.offset = s.offset;
214
+ this.count = I(e, s, "ArrayMalformed"), this.offset = s.offset;
215
215
  }
216
216
  static create(e) {
217
- return new x(d(e));
217
+ return new x(M(e));
218
218
  }
219
219
  next() {
220
220
  if (this.index >= this.count) {
@@ -235,43 +235,43 @@ class x {
235
235
  case 4:
236
236
  case 6:
237
237
  case 14: {
238
- const e = O(this.elementType);
239
- u(this.payload, this.offset, e);
238
+ const e = y(this.elementType);
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 g(this.elementType, r);
241
+ return this.offset += e, new w(this.elementType, r);
242
242
  }
243
243
  case 12:
244
244
  case 13: {
245
- const e = { offset: this.offset }, r = f(this.payload, e, "ArrayMalformed");
246
- u(this.payload, e.offset, r);
245
+ const e = { offset: this.offset }, r = I(this.payload, e, "ArrayMalformed");
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 g(this.elementType, s);
248
+ return this.offset = e.offset + r, new w(this.elementType, s);
249
249
  }
250
250
  case 11: {
251
- const e = { offset: this.offset }, r = f(this.payload, e, "ArrayMalformed");
252
- u(this.payload, e.offset, r);
251
+ const e = { offset: this.offset }, r = I(this.payload, e, "ArrayMalformed");
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 g(11, s);
254
+ return this.offset = e.offset + r, new w(11, s);
255
255
  }
256
256
  case 9: {
257
- const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
258
- return this.offset += e, new g(9, r);
257
+ const e = W(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
258
+ return this.offset += e, new w(9, r);
259
259
  }
260
260
  case 10: {
261
- const e = X(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
262
- return this.offset += e, new g(10, r);
261
+ const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
262
+ return this.offset += e, new w(10, r);
263
263
  }
264
264
  default:
265
- throw new Error(`Unsupported array element type ${P[this.elementType]}`);
265
+ throw new Error(`Unsupported array element type ${O[this.elementType]}`);
266
266
  }
267
267
  }
268
268
  }
269
- class g extends R {
269
+ class w extends C {
270
270
  constructor(e, r) {
271
271
  super(e, r);
272
272
  }
273
273
  }
274
- class W {
274
+ class H {
275
275
  payload;
276
276
  keyType;
277
277
  valueType;
@@ -285,10 +285,10 @@ class W {
285
285
  throw new Error("Dictionary key/value flags must be zero");
286
286
  st(this.keyType);
287
287
  const r = { offset: 2 };
288
- this.count = f(e, r, "DictMalformed"), this.offset = r.offset;
288
+ this.count = I(e, r, "DictMalformed"), this.offset = r.offset;
289
289
  }
290
290
  static create(e) {
291
- return new W(d(e));
291
+ return new H(M(e));
292
292
  }
293
293
  next() {
294
294
  if (this.index >= this.count) {
@@ -300,17 +300,17 @@ class W {
300
300
  return this.index++, new Lt(e, r);
301
301
  }
302
302
  readKey() {
303
- const e = O(this.keyType);
303
+ const e = y(this.keyType);
304
304
  if (e >= 0) {
305
- u(this.payload, this.offset, e);
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 R(this.keyType, r);
307
+ return this.offset += e, new C(this.keyType, r);
308
308
  }
309
309
  if (this.keyType === 12 || this.keyType === 13) {
310
- const r = { offset: this.offset }, s = f(this.payload, r, "DictMalformed");
311
- u(this.payload, r.offset, s);
310
+ const r = { offset: this.offset }, s = I(this.payload, r, "DictMalformed");
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 R(this.keyType, n);
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
  }
@@ -318,24 +318,24 @@ class W {
318
318
  switch (this.valueType) {
319
319
  case 12:
320
320
  case 13: {
321
- const e = { offset: this.offset }, r = f(this.payload, e, "DictMalformed");
322
- u(this.payload, e.offset, r);
321
+ const e = { offset: this.offset }, r = I(this.payload, e, "DictMalformed");
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 R(this.valueType, s);
324
+ return this.offset = e.offset + r, new C(this.valueType, s);
325
325
  }
326
326
  case 11: {
327
- const e = { offset: this.offset }, r = f(this.payload, e, "DictMalformed");
328
- u(this.payload, e.offset, r);
327
+ const e = { offset: this.offset }, r = I(this.payload, e, "DictMalformed");
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 R(11, s);
330
+ return this.offset = e.offset + r, new C(11, s);
331
331
  }
332
332
  case 9: {
333
- const e = K(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
334
- return this.offset += e, new R(9, r);
333
+ const e = W(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 = X(this.payload, this.offset), r = this.payload.subarray(this.offset, this.offset + e);
338
- return this.offset += e, new R(10, r);
337
+ const e = K(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,13 +346,13 @@ class W {
346
346
  case 6:
347
347
  case 14:
348
348
  case 1: {
349
- const e = O(this.valueType);
350
- u(this.payload, this.offset, e);
349
+ const e = y(this.valueType);
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 R(this.valueType, r);
352
+ return this.offset += e, new C(this.valueType, r);
353
353
  }
354
354
  default:
355
- throw new Error(`Unsupported dictionary value type ${P[this.valueType]}`);
355
+ throw new Error(`Unsupported dictionary value type ${O[this.valueType]}`);
356
356
  }
357
357
  }
358
358
  }
@@ -361,7 +361,7 @@ class Lt {
361
361
  this.key = e, this.value = r;
362
362
  }
363
363
  }
364
- class l {
364
+ class u {
365
365
  constructor(e) {
366
366
  this.bytes = e;
367
367
  }
@@ -371,19 +371,19 @@ class l {
371
371
  const r = e.replace(/-/g, "");
372
372
  if (r.length !== 32)
373
373
  throw new Error("Guid string must be 32 hex characters");
374
- const s = new Uint8Array(16), n = l.parseHexSlice(r, 0, 8), a = l.parseHexSlice(r, 8, 4), i = l.parseHexSlice(r, 12, 4);
375
- l.writeUInt32LE(s, 0, n), l.writeUInt16LE(s, 4, a), l.writeUInt16LE(s, 6, i);
376
- for (let _ = 0; _ < 8; _++)
377
- s[8 + _] = l.parseHexSlice(r, 16 + _ * 2, 2);
378
- return new l(s);
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);
376
+ for (let E = 0; E < 8; E++)
377
+ s[8 + E] = u.parseHexSlice(r, 16 + E * 2, 2);
378
+ return new u(s);
379
379
  }
380
380
  static fromBytes(e) {
381
381
  if (e.length !== 16)
382
382
  throw new Error("Guid byte array must be 16 bytes");
383
- return new l(Uint8Array.from(e));
383
+ return new u(Uint8Array.from(e));
384
384
  }
385
385
  static createZero() {
386
- return new l(new Uint8Array(16));
386
+ return new u(new Uint8Array(16));
387
387
  }
388
388
  static createRandom() {
389
389
  const e = new Uint8Array(16), r = globalThis.crypto;
@@ -392,16 +392,16 @@ class l {
392
392
  else
393
393
  for (let s = 0; s < e.length; s++)
394
394
  e[s] = Math.floor(Math.random() * 256);
395
- return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new l(e);
395
+ return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, new u(e);
396
396
  }
397
397
  toString() {
398
398
  const e = this.bytes;
399
399
  return [
400
- l.toHex(l.readUInt32LE(e, 0), 8),
401
- l.toHex(l.readUInt16LE(e, 4), 4),
402
- l.toHex(l.readUInt16LE(e, 6), 4),
403
- Q(e.subarray(8, 10)),
404
- Q(e.subarray(10, 16))
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
+ j(e.subarray(8, 10)),
404
+ j(e.subarray(10, 16))
405
405
  ].join("-");
406
406
  }
407
407
  asBytes() {
@@ -431,14 +431,14 @@ class l {
431
431
  return (e >>> 0).toString(16).padStart(r, "0");
432
432
  }
433
433
  }
434
- function f(t, e, r) {
434
+ function I(t, e, r) {
435
435
  if (e.offset >= t.length)
436
436
  throw new Error(r);
437
437
  let s = 0, n = 0, a = 0;
438
438
  for (; e.offset < t.length; ) {
439
439
  const i = t[e.offset++];
440
440
  if (a++, s |= (i & 127) << n, (i & 128) === 0) {
441
- if (a !== mt(s))
441
+ if (a !== Ut(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 mt(t) {
450
+ function Ut(t) {
451
451
  return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
452
452
  }
453
- function O(t) {
453
+ function y(t) {
454
454
  switch (t) {
455
455
  case 3:
456
456
  case 5:
@@ -474,72 +474,72 @@ function st(t) {
474
474
  if (t === 9 || t === 11 || t === 10 || t === 1)
475
475
  throw new Error("Dictionary keys must be primitive Teleport types");
476
476
  }
477
- function u(t, e, r) {
477
+ 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
481
  function Dt(t, e) {
482
482
  return (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0;
483
483
  }
484
- function K(t, e) {
484
+ function W(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 }, a = f(t, n, "ArrayMalformed"), i = O(s);
490
+ const n = { offset: e + 1 }, a = I(t, n, "ArrayMalformed"), i = y(s);
491
491
  if (i >= 0) {
492
- const E = i * a;
493
- return u(t, n.offset, E), n.offset + E - e;
492
+ const _ = i * a;
493
+ return h(t, n.offset, _), n.offset + _ - e;
494
494
  }
495
- let _ = n.offset;
496
- for (let E = 0; E < a; E++)
497
- _ = H(s, t, _, "ArrayMalformed");
498
- return _ - e;
495
+ let E = n.offset;
496
+ for (let _ = 0; _ < a; _++)
497
+ E = Y(s, t, E, "ArrayMalformed");
498
+ return E - e;
499
499
  }
500
- function X(t, e) {
500
+ function K(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 }, a = f(t, n, "DictMalformed");
507
+ const n = { offset: e + 2 }, a = I(t, n, "DictMalformed");
508
508
  let i = n.offset;
509
- for (let _ = 0; _ < a; _++)
510
- i = H(r, t, i, "DictMalformed"), i = H(s, t, i, "DictMalformed");
509
+ for (let E = 0; E < a; E++)
510
+ i = Y(r, t, i, "DictMalformed"), i = Y(s, t, i, "DictMalformed");
511
511
  return i - e;
512
512
  }
513
- function H(t, e, r, s) {
514
- const n = O(t);
513
+ function Y(t, e, r, s) {
514
+ const n = y(t);
515
515
  if (n >= 0)
516
- return u(e, r, n), r + n;
516
+ return h(e, r, n), r + n;
517
517
  switch (t) {
518
518
  case 12:
519
519
  case 13: {
520
- const a = { offset: r }, i = f(e, a, s);
521
- return u(e, a.offset, i), a.offset + i;
520
+ const a = { offset: r }, i = I(e, a, s);
521
+ return h(e, a.offset, i), a.offset + i;
522
522
  }
523
523
  case 11: {
524
- const a = { offset: r }, i = f(e, a, s);
525
- return u(e, a.offset, i), a.offset + i;
524
+ const a = { offset: r }, i = I(e, a, s);
525
+ return h(e, a.offset, i), a.offset + i;
526
526
  }
527
527
  case 9:
528
- return r + K(e, r);
528
+ return r + W(e, r);
529
529
  case 10:
530
- return r + X(e, r);
530
+ return r + K(e, r);
531
531
  default:
532
- throw new Error(`Unsupported Teleport type ${P[t]}`);
532
+ throw new Error(`Unsupported Teleport type ${O[t]}`);
533
533
  }
534
534
  }
535
- function Q(t) {
535
+ function j(t) {
536
536
  return Array.from(t).map((e) => e.toString(16).padStart(2, "0")).join("");
537
537
  }
538
- function d(t) {
538
+ function M(t) {
539
539
  return t instanceof Uint8Array ? t : new Uint8Array(t);
540
540
  }
541
- var h = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(h || {}), V = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.CORE_UPDATE_CLIENT_CONTEXT = 65558] = "CORE_UPDATE_CLIENT_CONTEXT", t[t.CORE_BACKGROUND_WORK_ACTIVE = 65559] = "CORE_BACKGROUND_WORK_ACTIVE", t[t.CORE_RESET_IDLE = 65560] = "CORE_RESET_IDLE", t[t.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", t[t.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", t[t.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_WEBRTC_ICE_SERVERS_REQUEST = 65573] = "CORE_WEBRTC_ICE_SERVERS_REQUEST", t[t.CORE_WEBRTC_ICE_SERVERS_RESPONSE = 65574] = "CORE_WEBRTC_ICE_SERVERS_RESPONSE", t[t.CORE_WEBRTC_CLOSE = 65575] = "CORE_WEBRTC_CLOSE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", t[t.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", t[t.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", t[t.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", t[t.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", t[t.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", t[t.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", t[t.ACTION_RESULT = 1048654] = "ACTION_RESULT", t[t.UI_RESYNC_REQUEST = 1048655] = "UI_RESYNC_REQUEST", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(V || {});
542
- const Pt = 4194309, Ot = 205938238, yt = 1594075008, wt = 2026534360, gt = 3409001585, Ft = 3466650495, Mt = 4007456593, dt = 4017217601, Bt = 4065417427, bt = 4086360332;
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_RESET_IDLE = 65560] = "CORE_RESET_IDLE", t[t.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", t[t.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", t[t.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_WEBRTC_ICE_SERVERS_REQUEST = 65573] = "CORE_WEBRTC_ICE_SERVERS_REQUEST", t[t.CORE_WEBRTC_ICE_SERVERS_RESPONSE = 65574] = "CORE_WEBRTC_ICE_SERVERS_RESPONSE", t[t.CORE_WEBRTC_CLOSE = 65575] = "CORE_WEBRTC_CLOSE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", t[t.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", t[t.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", t[t.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", t[t.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", t[t.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_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_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", t[t.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", t[t.ACTION_RESULT = 1048654] = "ACTION_RESULT", t[t.UI_RESYNC_REQUEST = 1048655] = "UI_RESYNC_REQUEST", 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_STYLES = 2097188] = "UI_STYLES", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(V || {});
542
+ const Ot = 4194309, yt = 205938238, dt = 1594075008, Pt = 2026534360, wt = 3409001585, gt = 3466650495, Ft = 4007456593, Mt = 4017217601, bt = 4065417427, Bt = 4086360332;
543
543
  function Gt(t) {
544
544
  const e = {};
545
545
  return nt(e), e;
@@ -548,7 +548,7 @@ function nt(t) {
548
548
  return t.Samples = new Uint8Array(0), t.Epoch = 0, t.Sequence = 0, t.FrameSizeInInterleavedSamples = 0, t.TimeStampInInterleavedSamples = 0n, t.IsFirst = !1, t.IsLast = !1, t.AverageVolume = 0, t.AudioEventEstimatedDuration = 0, t;
549
549
  }
550
550
  function Vt(t, e) {
551
- const r = M.create(t);
551
+ const r = F.create(t);
552
552
  return vt(r, e);
553
553
  }
554
554
  function vt(t, e) {
@@ -559,71 +559,71 @@ function kt(t, e) {
559
559
  let r;
560
560
  for (; (r = t.next()) !== null; )
561
561
  switch (r.fieldId) {
562
- case Ot: {
562
+ case yt: {
563
563
  if (r.isNull) throw new Error();
564
564
  e.AverageVolume = r.asFloat32();
565
565
  break;
566
566
  }
567
- case yt: {
567
+ case dt: {
568
568
  if (r.isNull) throw new Error();
569
569
  e.IsFirst = r.asBool();
570
570
  break;
571
571
  }
572
- case wt: {
572
+ case Pt: {
573
573
  if (r.isNull) throw new Error();
574
574
  e.TimeStampInInterleavedSamples = r.asUInt64();
575
575
  break;
576
576
  }
577
- case gt: {
577
+ case wt: {
578
578
  if (r.isNull) throw new Error();
579
579
  e.Samples = r.asBinary();
580
580
  break;
581
581
  }
582
- case Ft: {
582
+ case gt: {
583
583
  if (r.isNull) throw new Error();
584
584
  e.AudioEventEstimatedDuration = r.asFloat32();
585
585
  break;
586
586
  }
587
- case Mt: {
587
+ case Ft: {
588
588
  if (r.isNull) throw new Error();
589
589
  e.FrameSizeInInterleavedSamples = r.asUInt32();
590
590
  break;
591
591
  }
592
- case dt: {
592
+ case Mt: {
593
593
  if (r.isNull) throw new Error();
594
594
  e.IsLast = r.asBool();
595
595
  break;
596
596
  }
597
- case Bt: {
597
+ case bt: {
598
598
  if (r.isNull) throw new Error();
599
599
  e.Sequence = r.asUInt32();
600
600
  break;
601
601
  }
602
- case bt: {
602
+ case Bt: {
603
603
  if (r.isNull) throw new Error();
604
604
  e.Epoch = r.asUInt32();
605
605
  break;
606
606
  }
607
607
  }
608
608
  }
609
- async function Yt(t, e) {
610
- const r = await rt(t, Pt);
609
+ async function pt(t, e) {
610
+ const r = await rt(t, Ot);
611
611
  return Vt(r, e);
612
612
  }
613
- const Ht = 4194305, xt = 161083277, Wt = 265814330, Kt = 1368629611, Xt = 2431514951, zt = 2514959030, $t = 2745379226, jt = 3282782683, Qt = 3284746250, Zt = 4101844078;
614
- function Jt(t) {
613
+ const Yt = 4194305, xt = 161083277, Ht = 265814330, Wt = 1368629611, Kt = 2431514951, zt = 2514959030, Xt = 2745379226, $t = 3282782683, jt = 3284746250, Qt = 4101844078;
614
+ function Zt(t) {
615
615
  const e = {};
616
616
  return it(e), e;
617
617
  }
618
618
  function it(t) {
619
- return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = h.Unknown, t.CodecDetails = "", t.SampleRate = 0, t.Channels = 0, t.ShapeSets = void 0, t.CorrelationId = void 0, t;
619
+ return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = T.Unknown, t.CodecDetails = "", t.SampleRate = 0, t.Channels = 0, t.ShapeSets = void 0, t.CorrelationId = void 0, t;
620
620
  }
621
- function qt(t, e) {
622
- const r = M.create(t);
623
- return pt(r, e);
621
+ function Jt(t, e) {
622
+ const r = F.create(t);
623
+ return qt(r, e);
624
624
  }
625
- function pt(t, e) {
626
- const r = e ?? Jt();
625
+ function qt(t, e) {
626
+ const r = e ?? Zt();
627
627
  return it(r), te(t, r), r;
628
628
  }
629
629
  function te(t, e) {
@@ -635,7 +635,7 @@ function te(t, e) {
635
635
  e.StreamId = r.asString();
636
636
  break;
637
637
  }
638
- case Wt: {
638
+ case Ht: {
639
639
  if (r.isNull) {
640
640
  e.ShapeSets = void 0;
641
641
  break;
@@ -643,12 +643,12 @@ function te(t, e) {
643
643
  e.ShapeSets = re(r.asArray());
644
644
  break;
645
645
  }
646
- case Kt: {
646
+ case Wt: {
647
647
  if (r.isNull) throw new Error();
648
648
  e.Description = r.asString();
649
649
  break;
650
650
  }
651
- case Xt: {
651
+ case Kt: {
652
652
  if (r.isNull) throw new Error();
653
653
  e.Channels = r.asInt32();
654
654
  break;
@@ -661,22 +661,22 @@ function te(t, e) {
661
661
  e.CorrelationId = r.asString();
662
662
  break;
663
663
  }
664
- case $t: {
664
+ case Xt: {
665
665
  if (r.isNull) throw new Error();
666
666
  e.CodecDetails = r.asString();
667
667
  break;
668
668
  }
669
- case jt: {
669
+ case $t: {
670
670
  if (r.isNull) throw new Error();
671
671
  e.SourceType = r.asString();
672
672
  break;
673
673
  }
674
- case Qt: {
674
+ case jt: {
675
675
  if (r.isNull) throw new Error();
676
676
  e.Codec = r.asInt32();
677
677
  break;
678
678
  }
679
- case Zt: {
679
+ case Qt: {
680
680
  if (r.isNull) throw new Error();
681
681
  e.SampleRate = r.asInt32();
682
682
  break;
@@ -684,14 +684,14 @@ function te(t, e) {
684
684
  }
685
685
  }
686
686
  async function ee(t, e) {
687
- const r = await rt(t, Ht);
688
- return qt(r, e);
687
+ const r = await rt(t, Yt);
688
+ return Jt(r, e);
689
689
  }
690
690
  function re(t) {
691
691
  const e = [];
692
692
  let r;
693
693
  for (; (r = t.next()) !== null; )
694
- e.push(_e(r.asObject()));
694
+ e.push(Ee(r.asObject()));
695
695
  return e;
696
696
  }
697
697
  const se = 1107713536, ne = 1154362099, ie = 1185721362;
@@ -702,11 +702,11 @@ function ae(t) {
702
702
  function at(t) {
703
703
  return t.SetId = 0, t.Name = "", t.ShapeNames = [], t;
704
704
  }
705
- function _e(t, e) {
705
+ function Ee(t, e) {
706
706
  const r = e ?? ae();
707
- return at(r), Ee(t, r), r;
707
+ return at(r), _e(t, r), r;
708
708
  }
709
- function Ee(t, e) {
709
+ function _e(t, e) {
710
710
  let r;
711
711
  for (; (r = t.next()) !== null; )
712
712
  switch (r.fieldId) {
@@ -722,19 +722,19 @@ function Ee(t, e) {
722
722
  }
723
723
  case ie: {
724
724
  if (r.isNull) throw new Error();
725
- e.ShapeNames = Ie(r.asArray());
725
+ e.ShapeNames = oe(r.asArray());
726
726
  break;
727
727
  }
728
728
  }
729
729
  }
730
- function Ie(t) {
730
+ function oe(t) {
731
731
  const e = [];
732
732
  let r;
733
733
  for (; (r = t.next()) !== null; )
734
734
  e.push(r.asString());
735
735
  return e;
736
736
  }
737
- class Z {
737
+ class Q {
738
738
  static getStorageForCapacity(e, r) {
739
739
  const s = Int32Array.BYTES_PER_ELEMENT * 2, n = r.BYTES_PER_ELEMENT * e;
740
740
  return new SharedArrayBuffer(s + n);
@@ -788,19 +788,19 @@ class Z {
788
788
  return s = (s + r) % this.capacity, Atomics.store(this.readWrite, 0, s), r;
789
789
  }
790
790
  }
791
- let Ae = 1;
792
- const oe = /* @__PURE__ */ new Map(), le = {
791
+ let le = 1;
792
+ const Ae = /* @__PURE__ */ new Map(), ue = {
793
793
  0: "DEBUG",
794
794
  1: "INFO",
795
795
  2: "WARN",
796
796
  3: "ERROR",
797
797
  4: "NONE"
798
798
  };
799
- function Te(t, e) {
799
+ function fe(t, e) {
800
800
  return `[${t}] ${e}`;
801
801
  }
802
- function b(t, e, r, s) {
803
- const n = (/* @__PURE__ */ new Date()).toISOString(), a = le[t], i = {
802
+ function B(t, e, r, s) {
803
+ const n = (/* @__PURE__ */ new Date()).toISOString(), a = ue[t], i = {
804
804
  timestamp: n,
805
805
  level: t,
806
806
  levelName: a,
@@ -808,55 +808,55 @@ function b(t, e, r, s) {
808
808
  message: r,
809
809
  args: s
810
810
  };
811
- for (const [_, E] of oe) {
812
- const I = E?.minLevel ?? 2;
813
- if (t >= I)
811
+ for (const [E, _] of Ae) {
812
+ const o = _?.minLevel ?? 2;
813
+ if (t >= o)
814
814
  try {
815
- _(i);
815
+ E(i);
816
816
  } catch {
817
817
  }
818
818
  }
819
- if (Ae <= t) {
820
- const _ = Te(e, r);
819
+ if (le <= t) {
820
+ const E = fe(e, r);
821
821
  switch (t) {
822
822
  case 0:
823
- console.debug(_, ...s);
823
+ console.debug(E, ...s);
824
824
  break;
825
825
  case 1:
826
- console.info(_, ...s);
826
+ console.info(E, ...s);
827
827
  break;
828
828
  case 2:
829
- console.warn(_, ...s);
829
+ console.warn(E, ...s);
830
830
  break;
831
831
  case 3:
832
- console.error(_, ...s);
832
+ console.error(E, ...s);
833
833
  break;
834
834
  }
835
835
  }
836
836
  }
837
- function _t(t) {
837
+ function Et(t) {
838
838
  return {
839
839
  debug(e, ...r) {
840
- b(0, t, e, r);
840
+ B(0, t, e, r);
841
841
  },
842
842
  info(e, ...r) {
843
- b(1, t, e, r);
843
+ B(1, t, e, r);
844
844
  },
845
845
  warn(e, ...r) {
846
- b(2, t, e, r);
846
+ B(2, t, e, r);
847
847
  },
848
848
  error(e, ...r) {
849
- b(3, t, e, r);
849
+ B(3, t, e, r);
850
850
  }
851
851
  };
852
852
  }
853
- const G = _t("Capabilities"), ue = globalThis;
854
- function fe() {
853
+ const G = Et("Capabilities"), he = globalThis;
854
+ function Ie() {
855
855
  if (typeof SharedArrayBuffer > "u")
856
856
  return G.debug("SharedArrayBuffer not supported: SharedArrayBuffer is undefined"), !1;
857
857
  if (typeof Atomics > "u")
858
858
  return G.debug("SharedArrayBuffer not supported: Atomics is undefined"), !1;
859
- if (ue.crossOriginIsolated === !1)
859
+ if (he.crossOriginIsolated === !1)
860
860
  return G.debug("SharedArrayBuffer not supported: crossOriginIsolated is false (missing COOP/COEP headers)"), !1;
861
861
  try {
862
862
  new SharedArrayBuffer(1);
@@ -865,19 +865,19 @@ function fe() {
865
865
  }
866
866
  return !0;
867
867
  }
868
- const Et = 48e3, It = 2, he = 1500, Ne = 10, J = 80, Ce = 50, q = 64, z = _t("AudioPlaybackWorker"), y = (t, e) => {
868
+ const _t = 48e3, ot = 2, Te = 1500, ce = 10, Z = 80, Re = 50, J = 64, z = Et("AudioPlaybackWorker"), d = (t, e) => {
869
869
  self.postMessage(t, e ?? []);
870
- }, Re = fe();
871
- let v = "pcm", At = !0, ot = !1, c = Et, S = It, D = null;
872
- function m(t, e) {
870
+ }, Ce = Ie();
871
+ let v = "pcm", lt = !0, At = !1, N = _t, S = ot, D = null;
872
+ function U(t, e) {
873
873
  const r = t instanceof Error ? t : new Error(String(t));
874
- y({ type: "error", error: { name: r.name, message: r.message, stack: r.stack }, streamId: e });
874
+ d({ type: "error", error: { name: r.name, message: r.message, stack: r.stack }, streamId: e });
875
875
  }
876
- function $(t) {
876
+ function X(t) {
877
877
  const e = et(t);
878
878
  return `${e.senderId}_${e.trackId}`;
879
879
  }
880
- class Se {
880
+ class Ne {
881
881
  mode;
882
882
  ring = null;
883
883
  sab = void 0;
@@ -890,7 +890,7 @@ class Se {
890
890
  pcmBatchOffset = 0;
891
891
  lastPcmFlushTimeMs = 0;
892
892
  constructor(e) {
893
- this.streamId = e, this.mode = "pcm", this.outputSampleRate = c, this.outputChannels = S, this.rebind(v);
893
+ this.streamId = e, this.mode = "pcm", this.outputSampleRate = N, this.outputChannels = S, this.rebind(v);
894
894
  }
895
895
  close() {
896
896
  this.closed = !0, this.pcmBatchBuffer = null, this.pcmBatchOffset = 0, this.ring = null, this.sab = void 0;
@@ -900,8 +900,8 @@ class Se {
900
900
  }
901
901
  rebind(e) {
902
902
  if (!this.closed) {
903
- if (this.mode = e, e === "sab" && Re) {
904
- const r = Math.floor(he * this.outputSampleRate * this.outputChannels / 1e3), s = Z.getStorageForCapacity(r, Float32Array), n = new Z(s, Float32Array);
903
+ if (this.mode = e, e === "sab" && Ce) {
904
+ const r = Math.floor(Te * this.outputSampleRate * this.outputChannels / 1e3), s = Q.getStorageForCapacity(r, Float32Array), n = new Q(s, Float32Array);
905
905
  n.flush(), this.sab = s, this.ring = n;
906
906
  return;
907
907
  }
@@ -911,11 +911,11 @@ class Se {
911
911
  flushPendingPcm(e) {
912
912
  if (this.closed || this.mode !== "pcm" || this.pcmBatchOffset <= 0)
913
913
  return;
914
- const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * J / 1e3));
915
- if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >= Ce))
914
+ const r = performance.now(), s = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * Z / 1e3));
915
+ if (!(e || this.pcmBatchOffset >= s || this.lastPcmFlushTimeMs > 0 && r - this.lastPcmFlushTimeMs >= Re))
916
916
  return;
917
917
  const a = new Float32Array(this.pcmBatchOffset);
918
- a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = r, y({ type: "pcm", streamId: this.streamId, pcm: a }, [a.buffer]);
918
+ a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = r, d({ type: "pcm", streamId: this.streamId, pcm: a }, [a.buffer]);
919
919
  }
920
920
  drainPcm() {
921
921
  this.flushPendingPcm(!0);
@@ -926,15 +926,15 @@ class Se {
926
926
  if (this.mode === "sab" && this.ring) {
927
927
  const n = this.ring, a = this.outputChannels;
928
928
  let i = e;
929
- const _ = Math.floor(Math.max(0, n.capacity - 1) / a) * a;
930
- i.length > _ && (i = i.subarray(i.length - _));
931
- const E = Math.floor(n.availableWrite() / a) * a;
932
- if (E <= 0)
929
+ const E = Math.floor(Math.max(0, n.capacity - 1) / a) * a;
930
+ i.length > E && (i = i.subarray(i.length - E));
931
+ const _ = Math.floor(n.availableWrite() / a) * a;
932
+ if (_ <= 0)
933
933
  return;
934
- i.length > E && (i = i.subarray(i.length - E)), n.push(i);
934
+ i.length > _ && (i = i.subarray(i.length - _)), n.push(i);
935
935
  return;
936
936
  }
937
- const r = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * J / 1e3)), s = this.pcmBatchOffset + e.length;
937
+ const r = Math.max(1, Math.round(this.outputSampleRate * this.outputChannels * Z / 1e3)), s = this.pcmBatchOffset + e.length;
938
938
  if (!this.pcmBatchBuffer || this.pcmBatchBuffer.length < s) {
939
939
  const n = Math.max(s, r * 2), a = new Float32Array(n);
940
940
  this.pcmBatchBuffer && this.pcmBatchOffset > 0 && a.set(this.pcmBatchBuffer.subarray(0, this.pcmBatchOffset)), this.pcmBatchBuffer = a;
@@ -948,25 +948,25 @@ class Se {
948
948
  this.closed || (this.pcmBatchOffset = 0, this.lastPcmFlushTimeMs = 0, this.ring?.flush());
949
949
  }
950
950
  }
951
- function ce(t) {
951
+ function Se(t) {
952
952
  switch (t) {
953
- case h.Opus:
953
+ case T.Opus:
954
954
  return "opus";
955
- case h.Mp3:
955
+ case T.Mp3:
956
956
  return "mp3";
957
957
  default:
958
958
  return null;
959
959
  }
960
960
  }
961
- let F = null;
962
- function Ue(t) {
961
+ let g = null;
962
+ function me(t) {
963
963
  const e = new DataView(t.buffer, t.byteOffset, t.byteLength), r = Math.floor(t.byteLength / 2);
964
- (!F || F.length < r) && (F = new Float32Array(r));
964
+ (!g || g.length < r) && (g = new Float32Array(r));
965
965
  for (let s = 0; s < r; s++)
966
- F[s] = e.getInt16(s * 2, !0) / 32768;
967
- return F.subarray(0, r);
966
+ g[s] = e.getInt16(s * 2, !0) / 32768;
967
+ return g.subarray(0, r);
968
968
  }
969
- class j {
969
+ class $ {
970
970
  inputSampleRate;
971
971
  inputChannels;
972
972
  sink;
@@ -993,53 +993,54 @@ class j {
993
993
  n.length > 0 && this.sink.writePcm(n);
994
994
  }
995
995
  convertAudioData(e) {
996
- const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format, a = typeof n == "string" && n.includes("planar"), i = "f32-planar", _ = "f32", E = () => {
997
- const o = new Array(s);
998
- for (let T = 0; T < s; T++) {
999
- const C = new Float32Array(r);
1000
- e.copyTo(C, { planeIndex: T, format: i }), o[T] = C;
996
+ const r = e.numberOfFrames, s = e.numberOfChannels, n = e.format, a = typeof n == "string" && n.includes("planar"), i = "f32-planar", E = "f32", _ = () => {
997
+ const A = new Array(s);
998
+ for (let f = 0; f < s; f++) {
999
+ const R = new Float32Array(r);
1000
+ e.copyTo(R, { planeIndex: f, format: i }), A[f] = R;
1001
1001
  }
1002
- return Be(o, r);
1003
- }, I = () => {
1004
- const o = new Float32Array(r * s);
1005
- return e.copyTo(o, { planeIndex: 0, format: _ }), o;
1002
+ return be(A, r);
1003
+ }, o = () => {
1004
+ const A = new Float32Array(r * s);
1005
+ return e.copyTo(A, { planeIndex: 0, format: E }), A;
1006
1006
  };
1007
- let A;
1007
+ let l;
1008
1008
  if (a)
1009
1009
  try {
1010
- A = E();
1011
- } catch (o) {
1012
- z.debug(`Failed to read planar audio data, falling back to interleaved copy: ${o}`), A = I();
1010
+ l = _();
1011
+ } catch (A) {
1012
+ z.debug(`Failed to read planar audio data, falling back to interleaved copy: ${A}`), l = o();
1013
1013
  }
1014
1014
  else
1015
- A = I();
1016
- return A;
1015
+ l = o();
1016
+ return l;
1017
1017
  }
1018
1018
  convertPcmBuffer(e, r, s) {
1019
1019
  if (e.length === 0)
1020
1020
  return e;
1021
- let n = e, a = e.length, i = r;
1022
- if (s !== c) {
1023
- const _ = a / i, I = Math.max(1, Math.round(_ * c / s)) * i, A = this.getResampleBuffer(I);
1024
- a = Ge(n, A, i, s, c), n = A;
1021
+ let n = e, a = e.length;
1022
+ const i = r;
1023
+ if (s !== N) {
1024
+ const E = a / i, o = Math.max(1, Math.round(E * N / s)) * i, l = this.getResampleBuffer(o);
1025
+ a = Ge(n, l, i, s, N), n = l;
1025
1026
  }
1026
1027
  if (i !== S) {
1027
- const E = a / i * S, I = this.getRemixBuffer(E);
1028
- a = Ve(n.subarray(0, a), I, i, S), n = I, i = S;
1028
+ const _ = a / i * S, o = this.getRemixBuffer(_);
1029
+ a = Ve(n.subarray(0, a), o, i, S), n = o;
1029
1030
  }
1030
1031
  return n.subarray(0, a);
1031
1032
  }
1032
1033
  }
1033
- class Le extends j {
1034
+ class Le extends $ {
1034
1035
  feedChunk(e) {
1035
1036
  e.isFirst && this.reset();
1036
- const r = Ue(e.data);
1037
+ const r = me(e.data);
1037
1038
  this.writeConvertedPcm(r, this.inputChannels, this.inputSampleRate), e.isLast && this.reset();
1038
1039
  }
1039
1040
  close() {
1040
1041
  }
1041
1042
  }
1042
- class me extends j {
1043
+ class Ue extends $ {
1043
1044
  decoder;
1044
1045
  codec;
1045
1046
  constructor(e) {
@@ -1049,7 +1050,7 @@ class me extends j {
1049
1050
  const s = this.convertAudioData(r);
1050
1051
  this.writeConvertedPcm(s, r.numberOfChannels, r.sampleRate);
1051
1052
  } catch (s) {
1052
- m(s);
1053
+ U(s);
1053
1054
  } finally {
1054
1055
  try {
1055
1056
  r.close();
@@ -1058,7 +1059,7 @@ class me extends j {
1058
1059
  }
1059
1060
  },
1060
1061
  error: (r) => {
1061
- m(r);
1062
+ U(r);
1062
1063
  }
1063
1064
  }), this.decoder.configure({ codec: e.codec, numberOfChannels: e.inputChannels, sampleRate: e.inputSampleRate });
1064
1065
  }
@@ -1076,7 +1077,7 @@ class me extends j {
1076
1077
  ), e.isLast && this.decoder.flush().catch(() => {
1077
1078
  });
1078
1079
  } catch (r) {
1079
- m(r);
1080
+ U(r);
1080
1081
  try {
1081
1082
  this.reset();
1082
1083
  } catch {
@@ -1088,7 +1089,7 @@ class me extends j {
1088
1089
  try {
1089
1090
  this.decoder.reset(), this.decoder.configure({ codec: this.codec, numberOfChannels: this.inputChannels, sampleRate: this.inputSampleRate });
1090
1091
  } catch (e) {
1091
- m(e);
1092
+ U(e);
1092
1093
  }
1093
1094
  }
1094
1095
  close() {
@@ -1098,7 +1099,7 @@ class me extends j {
1098
1099
  }
1099
1100
  }
1100
1101
  }
1101
- class De extends j {
1102
+ class De extends $ {
1102
1103
  decoder = null;
1103
1104
  isReady = !1;
1104
1105
  decoderSampleRate = 48e3;
@@ -1106,7 +1107,7 @@ class De extends j {
1106
1107
  async initialise(e, r) {
1107
1108
  const { OpusDecoder: s, getOpusModule: n } = await import("./index-Ca9sTcGt.js");
1108
1109
  await n();
1109
- const i = [8e3, 12e3, 16e3, 24e3, 48e3].reduce((_, E) => Math.abs(E - r) < Math.abs(_ - r) ? E : _);
1110
+ const i = [8e3, 12e3, 16e3, 24e3, 48e3].reduce((E, _) => Math.abs(_ - r) < Math.abs(E - r) ? _ : E);
1110
1111
  this.decoderSampleRate = i, this.decoder = new s({ channels: e, sampleRate: this.decoderSampleRate }), await this.decoder.ready, this.isReady = !0, this.flushPendingChunks();
1111
1112
  }
1112
1113
  flushPendingChunks() {
@@ -1136,22 +1137,22 @@ class De extends j {
1136
1137
  const s = this.decoder.decodeFrame(e.data), n = s.channelData, a = s.samplesDecoded, i = n.length;
1137
1138
  if (!i || !a)
1138
1139
  return;
1139
- const _ = a * i, E = this.getInterleavedBuffer(_);
1140
+ const E = a * i, _ = this.getInterleavedBuffer(E);
1140
1141
  if (i === 2) {
1141
- const I = n[0], A = n[1];
1142
- for (let o = 0, T = 0; o < a; o++)
1143
- E[T++] = I[o], E[T++] = A[o];
1142
+ const o = n[0], l = n[1];
1143
+ for (let A = 0, f = 0; A < a; A++)
1144
+ _[f++] = o[A], _[f++] = l[A];
1144
1145
  } else if (i === 1)
1145
- E.set(n[0].subarray(0, a));
1146
+ _.set(n[0].subarray(0, a));
1146
1147
  else {
1147
- let I = 0;
1148
- for (let A = 0; A < a; A++)
1149
- for (let o = 0; o < i; o++)
1150
- E[I++] = n[o][A];
1148
+ let o = 0;
1149
+ for (let l = 0; l < a; l++)
1150
+ for (let A = 0; A < i; A++)
1151
+ _[o++] = n[A][l];
1151
1152
  }
1152
- this.writeConvertedPcm(E.subarray(0, _), i, this.decoderSampleRate), e.isLast && this.reset();
1153
+ this.writeConvertedPcm(_.subarray(0, E), i, this.decoderSampleRate), e.isLast && this.reset();
1153
1154
  } catch (r) {
1154
- m(r), this.reset();
1155
+ U(r), this.reset();
1155
1156
  }
1156
1157
  }
1157
1158
  feedChunk(e) {
@@ -1169,21 +1170,21 @@ class De extends j {
1169
1170
  this.decoder = null, this.pendingChunks.length = 0;
1170
1171
  }
1171
1172
  }
1172
- const N = /* @__PURE__ */ new Map();
1173
- async function Pe(t) {
1173
+ const c = /* @__PURE__ */ new Map();
1174
+ async function Oe(t) {
1174
1175
  if (t.closed || t.decoder)
1175
1176
  return;
1176
- if (t.codec === h.RawPcm16) {
1177
+ if (t.codec === T.RawPcm16) {
1177
1178
  t.decoder = new Le({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
1178
1179
  return;
1179
1180
  }
1180
- if (t.codec !== h.Opus && t.codec !== h.Mp3)
1181
- throw new Error(`Unsupported audio codec: ${h[t.codec] ?? t.codec}`);
1182
- const e = ce(t.codec);
1183
- if (At && typeof AudioDecoder < "u" && e !== null)
1181
+ if (t.codec !== T.Opus && t.codec !== T.Mp3)
1182
+ throw new Error(`Unsupported audio codec: ${T[t.codec] ?? t.codec}`);
1183
+ const e = Se(t.codec);
1184
+ if (lt && typeof AudioDecoder < "u" && e !== null)
1184
1185
  try {
1185
1186
  if ((await AudioDecoder.isConfigSupported({ codec: e, numberOfChannels: t.inputChannels, sampleRate: t.inputSampleRate })).supported) {
1186
- const n = new me({
1187
+ const n = new Ue({
1187
1188
  codec: e,
1188
1189
  inputChannels: t.inputChannels,
1189
1190
  inputSampleRate: t.inputSampleRate,
@@ -1199,7 +1200,7 @@ async function Pe(t) {
1199
1200
  } catch (s) {
1200
1201
  z.warn(`WebCodecs AudioDecoder failed, falling back to WASM: ${s instanceof Error ? s.message : String(s)}`);
1201
1202
  }
1202
- if (t.codec === h.Opus) {
1203
+ if (t.codec === T.Opus) {
1203
1204
  const s = new De({ inputChannels: t.inputChannels, inputSampleRate: t.inputSampleRate, sink: t.sink });
1204
1205
  if (await s.initialise(t.inputChannels, t.inputSampleRate), t.closed) {
1205
1206
  s.close();
@@ -1208,9 +1209,9 @@ async function Pe(t) {
1208
1209
  t.decoder = s;
1209
1210
  return;
1210
1211
  }
1211
- throw new Error(`No available decoder for codec: ${h[t.codec] ?? t.codec}`);
1212
+ throw new Error(`No available decoder for codec: ${T[t.codec] ?? t.codec}`);
1212
1213
  }
1213
- function Oe(t) {
1214
+ function ye(t) {
1214
1215
  if (t.closed) {
1215
1216
  t.pendingFrames.splice(0);
1216
1217
  try {
@@ -1224,30 +1225,30 @@ function Oe(t) {
1224
1225
  return;
1225
1226
  const e = t.pendingFrames.splice(0);
1226
1227
  for (const r of e)
1227
- lt(t, r);
1228
+ ut(t, r);
1228
1229
  }
1229
- function lt(t, e) {
1230
+ function ut(t, e) {
1230
1231
  if (t.closed || !t.decoder)
1231
1232
  return;
1232
1233
  const r = e.Epoch, s = Number(e.TimeStampInInterleavedSamples), n = e.FrameSizeInInterleavedSamples;
1233
1234
  if (t.currentEpoch !== r && (t.currentEpoch = r, t.epochSet = !1, t.lastArrivalTimeMs = 0, t.jitterMs = 0, t.sink.flush(), t.decoder.reset()), !t.epochSet) {
1234
1235
  t.epochSet = !0;
1235
- const T = t.inputSampleRate * t.inputChannels;
1236
- t.expectedIntervalMs = n * 1e3 / T;
1236
+ const f = t.inputSampleRate * t.inputChannels;
1237
+ t.expectedIntervalMs = n * 1e3 / f;
1237
1238
  }
1238
1239
  const a = performance.now();
1239
1240
  if (t.lastArrivalTimeMs > 0) {
1240
- const T = a - t.lastArrivalTimeMs, C = Math.abs(T - t.expectedIntervalMs);
1241
- t.jitterMs = t.jitterMs + (C - t.jitterMs) / Ne;
1241
+ const f = a - t.lastArrivalTimeMs, R = Math.abs(f - t.expectedIntervalMs);
1242
+ t.jitterMs = t.jitterMs + (R - t.jitterMs) / ce;
1242
1243
  }
1243
1244
  t.lastArrivalTimeMs = a;
1244
- const i = t.inputSampleRate * t.inputChannels, _ = c * S, E = Math.round(s * _ / i), I = Math.round(n * _ / i), A = Math.round(s * 1e6 / i), o = Math.round(n * 1e6 / i);
1245
- y({
1245
+ const i = t.inputSampleRate * t.inputChannels, E = N * S, _ = Math.round(s * E / i), o = Math.round(n * E / i), l = Math.round(s * 1e6 / i), A = Math.round(n * 1e6 / i);
1246
+ d({
1246
1247
  type: "frame",
1247
1248
  streamId: t.streamId,
1248
1249
  epoch: r,
1249
- timestampInterleavedSamples: E,
1250
- frameSizeInterleavedSamples: I,
1250
+ timestampInterleavedSamples: _,
1251
+ frameSizeInterleavedSamples: o,
1251
1252
  isFirst: e.IsFirst,
1252
1253
  isLast: e.IsLast,
1253
1254
  jitterMs: t.jitterMs
@@ -1255,12 +1256,12 @@ function lt(t, e) {
1255
1256
  data: e.Samples,
1256
1257
  isFirst: e.IsFirst,
1257
1258
  isLast: e.IsLast,
1258
- timestampUs: A,
1259
- durationUs: o
1259
+ timestampUs: l,
1260
+ durationUs: A
1260
1261
  });
1261
1262
  }
1262
- async function ye(t) {
1263
- const e = $(t), r = await ee(t), s = N.get(e);
1263
+ async function de(t) {
1264
+ const e = X(t), r = await ee(t), s = c.get(e);
1264
1265
  if (s) {
1265
1266
  s.closed = !0, s.pendingFrames.splice(0);
1266
1267
  try {
@@ -1271,9 +1272,9 @@ async function ye(t) {
1271
1272
  s.sink.drainPcm(), s.sink.close();
1272
1273
  } catch {
1273
1274
  }
1274
- N.delete(e);
1275
+ c.delete(e);
1275
1276
  }
1276
- const n = new Se(e), a = {
1277
+ const n = new Ne(e), a = {
1277
1278
  streamId: e,
1278
1279
  codec: r.Codec,
1279
1280
  inputSampleRate: r.SampleRate,
@@ -1289,22 +1290,22 @@ async function ye(t) {
1289
1290
  jitterMs: 0,
1290
1291
  expectedIntervalMs: 20
1291
1292
  };
1292
- N.set(e, a), y({
1293
+ c.set(e, a), d({
1293
1294
  type: "streamBegin",
1294
1295
  streamId: e,
1295
1296
  sharedArrayBuffer: n.getSharedArrayBuffer()
1296
1297
  });
1297
1298
  }
1298
- function we() {
1299
- for (const t of N.values())
1300
- y({
1299
+ function Pe() {
1300
+ for (const t of c.values())
1301
+ d({
1301
1302
  type: "streamBegin",
1302
1303
  streamId: t.streamId,
1303
1304
  sharedArrayBuffer: t.sink.getSharedArrayBuffer()
1304
1305
  });
1305
1306
  }
1306
- function ge(t) {
1307
- const e = $(t), r = N.get(e);
1307
+ function we(t) {
1308
+ const e = X(t), r = c.get(e);
1308
1309
  if (r) {
1309
1310
  r.closed = !0, r.pendingFrames.splice(0);
1310
1311
  try {
@@ -1315,44 +1316,44 @@ function ge(t) {
1315
1316
  r.decoder?.close();
1316
1317
  } catch {
1317
1318
  }
1318
- r.decoder = null, N.delete(e), y({ type: "streamEnd", streamId: e });
1319
+ r.decoder = null, c.delete(e), d({ type: "streamEnd", streamId: e });
1319
1320
  }
1320
1321
  }
1321
- async function Fe(t) {
1322
- const e = $(t), r = N.get(e);
1322
+ async function ge(t) {
1323
+ const e = X(t), r = c.get(e);
1323
1324
  if (!r || r.closed)
1324
1325
  return;
1325
- const s = await Yt(t);
1326
- if (!ot) {
1326
+ const s = await pt(t);
1327
+ if (!At) {
1327
1328
  if (!r.decoder) {
1328
- if (r.pendingFrames.length >= q) {
1329
- const n = r.pendingFrames.length - q + 1;
1329
+ if (r.pendingFrames.length >= J) {
1330
+ const n = r.pendingFrames.length - J + 1;
1330
1331
  r.pendingFrames.splice(0, n), z.warn(`Dropped ${n} frames waiting for decoder, streamId=${e.substring(0, 8)}`);
1331
1332
  }
1332
- r.pendingFrames.push(s), r.initTask || (r.initTask = Pe(r).then(() => Oe(r)).catch((n) => {
1333
- r.closed || m(n, e);
1333
+ r.pendingFrames.push(s), r.initTask || (r.initTask = Oe(r).then(() => ye(r)).catch((n) => {
1334
+ r.closed || U(n, e);
1334
1335
  }));
1335
1336
  return;
1336
1337
  }
1337
- lt(r, s);
1338
+ ut(r, s);
1338
1339
  }
1339
1340
  }
1340
- function Me(t) {
1341
- switch (Nt(t)) {
1341
+ function Fe(t) {
1342
+ switch (ct(t)) {
1342
1343
  case V.AUDIO_STREAM_BEGIN:
1343
- ye(t);
1344
+ de(t);
1344
1345
  return;
1345
1346
  case V.AUDIO_STREAM_END:
1346
- ge(t);
1347
+ we(t);
1347
1348
  return;
1348
1349
  case V.AUDIO_FRAME2:
1349
- Fe(t);
1350
+ ge(t);
1350
1351
  return;
1351
1352
  default:
1352
1353
  return;
1353
1354
  }
1354
1355
  }
1355
- function Tt() {
1356
+ function ft() {
1356
1357
  if (D) {
1357
1358
  try {
1358
1359
  D.close();
@@ -1361,9 +1362,9 @@ function Tt() {
1361
1362
  D = null;
1362
1363
  }
1363
1364
  }
1364
- function de() {
1365
- Tt();
1366
- for (const t of N.values()) {
1365
+ function Me() {
1366
+ ft();
1367
+ for (const t of c.values()) {
1367
1368
  try {
1368
1369
  t.sink.drainPcm(), t.sink.close();
1369
1370
  } catch {
@@ -1373,77 +1374,77 @@ function de() {
1373
1374
  } catch {
1374
1375
  }
1375
1376
  }
1376
- N.clear();
1377
+ c.clear();
1377
1378
  }
1378
1379
  self.addEventListener("message", (t) => {
1379
1380
  const e = t.data;
1380
1381
  if (e.type === "configure") {
1381
- v = e.transport, At = e.preferWebCodecs ?? !0, ot = e.webRtcEnabled ?? !1, c = Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 ? e.outputSampleRate : Et, S = Number.isFinite(e.outputChannels) && e.outputChannels > 0 ? e.outputChannels : It;
1382
+ v = e.transport, lt = e.preferWebCodecs ?? !0, At = e.webRtcEnabled ?? !1, N = Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 ? e.outputSampleRate : _t, S = Number.isFinite(e.outputChannels) && e.outputChannels > 0 ? e.outputChannels : ot;
1382
1383
  return;
1383
1384
  }
1384
1385
  if (e.type === "attachProtocolPort") {
1385
- Tt(), D = e.port, D.addEventListener("message", (r) => {
1386
+ ft(), D = e.port, D.addEventListener("message", (r) => {
1386
1387
  const s = r.data;
1387
- s?.type === "protocol" && s.message instanceof ArrayBuffer && Me(new Uint8Array(s.message));
1388
+ s?.type === "protocol" && s.message instanceof ArrayBuffer && Fe(new Uint8Array(s.message));
1388
1389
  }), D.start?.();
1389
1390
  return;
1390
1391
  }
1391
1392
  if (e.type === "rebind") {
1392
- v = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (c = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (S = e.outputChannels);
1393
- for (const r of N.values())
1394
- r.sink.setOutputFormat(c, S), r.sink.rebind(v);
1395
- we();
1393
+ v = e.transport, typeof e.outputSampleRate == "number" && Number.isFinite(e.outputSampleRate) && e.outputSampleRate > 0 && (N = e.outputSampleRate), typeof e.outputChannels == "number" && Number.isFinite(e.outputChannels) && e.outputChannels > 0 && (S = e.outputChannels);
1394
+ for (const r of c.values())
1395
+ r.sink.setOutputFormat(N, S), r.sink.rebind(v);
1396
+ Pe();
1396
1397
  return;
1397
1398
  }
1398
- e.type === "dispose" && de();
1399
+ e.type === "dispose" && Me();
1399
1400
  });
1400
- let U = null;
1401
- function Be(t, e) {
1401
+ let m = null;
1402
+ function be(t, e) {
1402
1403
  const r = t.length;
1403
1404
  if (r === 1)
1404
1405
  return t[0];
1405
1406
  const s = e * r;
1406
- if ((!U || U.length < s) && (U = new Float32Array(s)), r === 2) {
1407
+ if ((!m || m.length < s) && (m = new Float32Array(s)), r === 2) {
1407
1408
  const n = t[0], a = t[1];
1408
- for (let i = 0, _ = 0; i < e; i++)
1409
- U[_++] = n[i], U[_++] = a[i];
1409
+ for (let i = 0, E = 0; i < e; i++)
1410
+ m[E++] = n[i], m[E++] = a[i];
1410
1411
  } else {
1411
1412
  let n = 0;
1412
1413
  for (let a = 0; a < e; a++)
1413
1414
  for (let i = 0; i < r; i++)
1414
- U[n++] = t[i][a];
1415
+ m[n++] = t[i][a];
1415
1416
  }
1416
- return U.subarray(0, s);
1417
+ return m.subarray(0, s);
1417
1418
  }
1418
- const p = 3;
1419
+ const q = 3;
1419
1420
  function tt(t) {
1420
1421
  if (t === 0)
1421
1422
  return 1;
1422
1423
  const e = Math.PI * t;
1423
1424
  return Math.sin(e) / e;
1424
1425
  }
1425
- function be(t, e) {
1426
+ function Be(t, e) {
1426
1427
  return t === 0 ? 1 : Math.abs(t) >= e ? 0 : tt(t) * tt(t / e);
1427
1428
  }
1428
1429
  function Ge(t, e, r, s, n) {
1429
1430
  if (s === n)
1430
1431
  return e.set(t), t.length;
1431
- const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), _ = s / n, E = _ > 1 ? _ : 1, I = Math.ceil(p * E);
1432
- for (let A = 0; A < r; A++)
1433
- for (let o = 0; o < i; o++) {
1434
- const T = o * _, C = Math.floor(T);
1435
- let w = 0, L = 0;
1436
- for (let k = -I + 1; k <= I; k++) {
1437
- const B = C + k;
1438
- if (B < 0 || B >= a)
1432
+ const a = t.length / r, i = Math.max(1, Math.round(a * n / s)), E = s / n, _ = E > 1 ? E : 1, o = Math.ceil(q * _);
1433
+ for (let l = 0; l < r; l++)
1434
+ for (let A = 0; A < i; A++) {
1435
+ const f = A * E, R = Math.floor(f);
1436
+ let P = 0, L = 0;
1437
+ for (let k = -o + 1; k <= o; k++) {
1438
+ const b = R + k;
1439
+ if (b < 0 || b >= a)
1439
1440
  continue;
1440
- const ut = (T - B) / E, Y = be(ut, p);
1441
- if (Y !== 0) {
1442
- const ft = t[B * r + A] ?? 0;
1443
- w += ft * Y, L += Y;
1441
+ const ht = (f - b) / _, p = Be(ht, q);
1442
+ if (p !== 0) {
1443
+ const It = t[b * r + l] ?? 0;
1444
+ P += It * p, L += p;
1444
1445
  }
1445
1446
  }
1446
- e[o * r + A] = L > 0 ? w / L : 0;
1447
+ e[A * r + l] = L > 0 ? P / L : 0;
1447
1448
  }
1448
1449
  return i * r;
1449
1450
  }
@@ -1453,21 +1454,21 @@ function Ve(t, e, r, s) {
1453
1454
  return e.set(t), t.length;
1454
1455
  if (r === 1 && s === 2) {
1455
1456
  for (let i = 0; i < n; i++) {
1456
- const _ = t[i] ?? 0;
1457
- e[i * 2] = _, e[i * 2 + 1] = _;
1457
+ const E = t[i] ?? 0;
1458
+ e[i * 2] = E, e[i * 2 + 1] = E;
1458
1459
  }
1459
1460
  return n * 2;
1460
1461
  }
1461
1462
  if (r === 2 && s === 1) {
1462
1463
  for (let i = 0; i < n; i++) {
1463
- const _ = t[i * 2] ?? 0, E = t[i * 2 + 1] ?? 0;
1464
- e[i] = (_ + E) * 0.5;
1464
+ const E = t[i * 2] ?? 0, _ = t[i * 2 + 1] ?? 0;
1465
+ e[i] = (E + _) * 0.5;
1465
1466
  }
1466
1467
  return n;
1467
1468
  }
1468
1469
  const a = Math.min(r, s);
1469
1470
  for (let i = 0; i < n; i++)
1470
- for (let _ = 0; _ < a; _++)
1471
- e[i * s + _] = t[i * r + _] ?? 0;
1471
+ for (let E = 0; E < a; E++)
1472
+ e[i * s + E] = t[i * r + E] ?? 0;
1472
1473
  return n * s;
1473
1474
  }