@ikonai/sdk-ui 1.0.58 → 1.0.60

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,2700 +0,0 @@
1
- const Zt = {
2
- Compressed: 8
3
- };
4
- function te(t) {
5
- if (t.length < 8)
6
- throw new Error("Protocol message too short");
7
- return (t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24) >>> 0;
8
- }
9
- function q(t) {
10
- const r = K(t), e = new DataView(r.buffer, r.byteOffset, r.byteLength);
11
- if (r.length < 27)
12
- throw new Error("Protocol payload too short");
13
- const s = e.getUint32(0, !0), n = e.getUint32(4, !0), i = e.getUint32(8, !0), o = e.getUint32(12, !0), a = e.getUint32(16, !0), _ = e.getUint32(20, !0), I = e.getUint8(24), E = e.getUint8(25), l = e.getUint8(26);
14
- if (27 + _ * 4 > r.length)
15
- throw new Error("Protocol header exceeds payload length");
16
- const w = [];
17
- let D = 27;
18
- for (let j = 0; j < _; j++)
19
- w.push(e.getUint32(D, !0)), D += 4;
20
- return {
21
- length: s,
22
- opcode: n,
23
- senderId: i,
24
- trackId: o,
25
- sequenceId: a,
26
- targetIds: w,
27
- payloadVersion: I,
28
- payloadType: E,
29
- flags: l
30
- };
31
- }
32
- async function p(t, r, e) {
33
- const s = K(t), n = q(s);
34
- if (r !== void 0 && n.opcode !== r)
35
- throw new Error(`Unexpected opcode ${n.opcode}`);
36
- if (n.payloadType !== 8)
37
- throw new Error(`Unexpected payload type ${n.payloadType}`);
38
- const i = 27 + n.targetIds.length * 4;
39
- let o = s.subarray(i, n.length);
40
- return (n.flags & Zt.Compressed) !== 0 && (o = await ee(o)), o;
41
- }
42
- async function ee(t) {
43
- if (typeof DecompressionStream > "u")
44
- throw new Error("DecompressionStream not supported");
45
- const r = new DecompressionStream("gzip"), e = r.writable.getWriter(), s = new Uint8Array(t);
46
- e.write(s), e.close();
47
- const n = r.readable.getReader(), i = [];
48
- let o = 0;
49
- for (; ; ) {
50
- const { done: I, value: E } = await n.read();
51
- if (I) break;
52
- i.push(E), o += E.length;
53
- }
54
- const a = new Uint8Array(o);
55
- let _ = 0;
56
- for (let I = 0; I < i.length; I++)
57
- a.set(i[I], _), _ += i[I].length;
58
- return a;
59
- }
60
- var F = /* @__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))(F || {});
61
- const re = 161, se = 162;
62
- new TextEncoder();
63
- const ne = new TextDecoder("utf-8", { fatal: !0 });
64
- class O {
65
- constructor(r, e, s) {
66
- this.buffer = r, this.version = e, this.offset = s, this.end = r.length - 1;
67
- }
68
- offset;
69
- end;
70
- static create(r) {
71
- const e = K(r);
72
- if (e.length < 2)
73
- throw new Error("Teleport payload too short");
74
- if (e[0] !== re || e[e.length - 1] !== se)
75
- throw new Error("Teleport object missing markers");
76
- const s = { offset: 1 }, n = S(e, s, "InvalidLength");
77
- return new O(e, n, s.offset);
78
- }
79
- next() {
80
- if (this.offset >= this.end)
81
- return null;
82
- if (this.offset + 5 > this.buffer.length)
83
- throw new Error("Teleport object truncated");
84
- const r = Ee(this.buffer, this.offset);
85
- this.offset += 4;
86
- const e = this.buffer[this.offset++], s = e >> 4 & 15;
87
- if ((e & 15) !== 0)
88
- throw new Error("Teleport field flags must be zero");
89
- const n = b(s);
90
- let i;
91
- if (n >= 0)
92
- N(this.buffer, this.offset, n), i = this.buffer.subarray(this.offset, this.offset + n), this.offset += n;
93
- else {
94
- const o = { offset: this.offset }, a = S(this.buffer, o, "InvalidLength");
95
- N(this.buffer, o.offset, a), i = this.buffer.subarray(o.offset, o.offset + a), this.offset = o.offset + a;
96
- }
97
- return new ie(r, s, i);
98
- }
99
- }
100
- class y {
101
- constructor(r, e) {
102
- this.type = r, this.payload = e;
103
- }
104
- asInt32() {
105
- return this.ensureType(
106
- 3
107
- /* Int32 */
108
- ), new DataView(this.payload.buffer, this.payload.byteOffset, 4).getInt32(0, !0);
109
- }
110
- asUInt32() {
111
- return this.ensureType(
112
- 5
113
- /* UInt32 */
114
- ), new DataView(this.payload.buffer, this.payload.byteOffset, 4).getUint32(0, !0);
115
- }
116
- asInt64() {
117
- return this.ensureType(
118
- 4
119
- /* Int64 */
120
- ), new DataView(this.payload.buffer, this.payload.byteOffset, 8).getBigInt64(0, !0);
121
- }
122
- asUInt64() {
123
- return this.ensureType(
124
- 6
125
- /* UInt64 */
126
- ), new DataView(this.payload.buffer, this.payload.byteOffset, 8).getBigUint64(0, !0);
127
- }
128
- asFloat32() {
129
- return this.ensureType(
130
- 7
131
- /* Float32 */
132
- ), new DataView(this.payload.buffer, this.payload.byteOffset, 4).getFloat32(0, !0);
133
- }
134
- asFloat64() {
135
- return this.ensureType(
136
- 8
137
- /* Float64 */
138
- ), new DataView(this.payload.buffer, this.payload.byteOffset, 8).getFloat64(0, !0);
139
- }
140
- asBool() {
141
- return this.ensureType(
142
- 2
143
- /* Bool */
144
- ), this.payload.length > 0 && this.payload[0] !== 0;
145
- }
146
- asBinary() {
147
- return this.ensureType(
148
- 13
149
- /* Binary */
150
- ), this.payload;
151
- }
152
- asUtf8() {
153
- return this.ensureType(
154
- 12
155
- /* String */
156
- ), this.payload;
157
- }
158
- asString() {
159
- return this.ensureType(
160
- 12
161
- /* String */
162
- ), ne.decode(this.payload);
163
- }
164
- asGuid() {
165
- return this.ensureType(
166
- 14
167
- /* Guid */
168
- ), T.fromBytes(this.payload);
169
- }
170
- asObject() {
171
- return this.ensureType(
172
- 11
173
- /* Object */
174
- ), O.create(this.payload);
175
- }
176
- asArray() {
177
- return this.ensureType(
178
- 9
179
- /* Array */
180
- ), Z.create(this.payload);
181
- }
182
- asDictionary() {
183
- return this.ensureType(
184
- 10
185
- /* Dict */
186
- ), tt.create(this.payload);
187
- }
188
- ensureType(r) {
189
- if (this.type !== r)
190
- throw new Error(`Teleport value has type ${F[this.type]}, expected ${F[r]}`);
191
- }
192
- }
193
- class ie extends y {
194
- constructor(r, e, s) {
195
- super(e, s), this.fieldId = r;
196
- }
197
- get isNull() {
198
- return this.type === 1;
199
- }
200
- }
201
- class Z {
202
- payload;
203
- elementType;
204
- count;
205
- offset;
206
- index = 0;
207
- constructor(r) {
208
- if (this.payload = r, r.length === 0)
209
- throw new Error("Array payload too short");
210
- const e = r[0];
211
- if (this.elementType = e >> 4 & 15, (e & 15) !== 0)
212
- throw new Error("Array flags must be zero");
213
- const s = { offset: 1 };
214
- this.count = S(r, s, "ArrayMalformed"), this.offset = s.offset;
215
- }
216
- static create(r) {
217
- return new Z(K(r));
218
- }
219
- next() {
220
- if (this.index >= this.count) {
221
- if (this.offset !== this.payload.length)
222
- throw new Error("Array payload contains trailing data");
223
- return null;
224
- }
225
- const r = this.readValue();
226
- return this.index++, r;
227
- }
228
- readValue() {
229
- switch (this.elementType) {
230
- case 3:
231
- case 5:
232
- case 7:
233
- case 8:
234
- case 2:
235
- case 4:
236
- case 6:
237
- case 14: {
238
- const r = b(this.elementType);
239
- N(this.payload, this.offset, r);
240
- const e = this.payload.subarray(this.offset, this.offset + r);
241
- return this.offset += r, new k(this.elementType, e);
242
- }
243
- case 12:
244
- case 13: {
245
- const r = { offset: this.offset }, e = S(this.payload, r, "ArrayMalformed");
246
- N(this.payload, r.offset, e);
247
- const s = this.payload.subarray(r.offset, r.offset + e);
248
- return this.offset = r.offset + e, new k(this.elementType, s);
249
- }
250
- case 11: {
251
- const r = { offset: this.offset }, e = S(this.payload, r, "ArrayMalformed");
252
- N(this.payload, r.offset, e);
253
- const s = this.payload.subarray(r.offset, r.offset + e);
254
- return this.offset = r.offset + e, new k(11, s);
255
- }
256
- case 9: {
257
- const r = et(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
258
- return this.offset += r, new k(9, e);
259
- }
260
- case 10: {
261
- const r = rt(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
262
- return this.offset += r, new k(10, e);
263
- }
264
- default:
265
- throw new Error(`Unsupported array element type ${F[this.elementType]}`);
266
- }
267
- }
268
- }
269
- class k extends y {
270
- constructor(r, e) {
271
- super(r, e);
272
- }
273
- }
274
- class tt {
275
- payload;
276
- keyType;
277
- valueType;
278
- count;
279
- offset;
280
- index = 0;
281
- constructor(r) {
282
- if (this.payload = r, r.length < 2)
283
- throw new Error("Dictionary payload too short");
284
- if (this.keyType = r[0] >> 4 & 15, this.valueType = r[1] >> 4 & 15, (r[0] & 15) !== 0 || (r[1] & 15) !== 0)
285
- throw new Error("Dictionary key/value flags must be zero");
286
- at(this.keyType);
287
- const e = { offset: 2 };
288
- this.count = S(r, e, "DictMalformed"), this.offset = e.offset;
289
- }
290
- static create(r) {
291
- return new tt(K(r));
292
- }
293
- next() {
294
- if (this.index >= this.count) {
295
- if (this.offset !== this.payload.length)
296
- throw new Error("Dictionary payload contains trailing data");
297
- return null;
298
- }
299
- const r = this.readKey(), e = this.readValue();
300
- return this.index++, new oe(r, e);
301
- }
302
- readKey() {
303
- const r = b(this.keyType);
304
- if (r >= 0) {
305
- N(this.payload, this.offset, r);
306
- const e = this.payload.subarray(this.offset, this.offset + r);
307
- return this.offset += r, new y(this.keyType, e);
308
- }
309
- if (this.keyType === 12 || this.keyType === 13) {
310
- const e = { offset: this.offset }, s = S(this.payload, e, "DictMalformed");
311
- N(this.payload, e.offset, s);
312
- const n = this.payload.subarray(e.offset, e.offset + s);
313
- return this.offset = e.offset + s, new y(this.keyType, n);
314
- }
315
- throw new Error("Unsupported dictionary key type");
316
- }
317
- readValue() {
318
- switch (this.valueType) {
319
- case 12:
320
- case 13: {
321
- const r = { offset: this.offset }, e = S(this.payload, r, "DictMalformed");
322
- N(this.payload, r.offset, e);
323
- const s = this.payload.subarray(r.offset, r.offset + e);
324
- return this.offset = r.offset + e, new y(this.valueType, s);
325
- }
326
- case 11: {
327
- const r = { offset: this.offset }, e = S(this.payload, r, "DictMalformed");
328
- N(this.payload, r.offset, e);
329
- const s = this.payload.subarray(r.offset, r.offset + e);
330
- return this.offset = r.offset + e, new y(11, s);
331
- }
332
- case 9: {
333
- const r = et(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
334
- return this.offset += r, new y(9, e);
335
- }
336
- case 10: {
337
- const r = rt(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
338
- return this.offset += r, new y(10, e);
339
- }
340
- case 3:
341
- case 5:
342
- case 7:
343
- case 8:
344
- case 2:
345
- case 4:
346
- case 6:
347
- case 14:
348
- case 1: {
349
- const r = b(this.valueType);
350
- N(this.payload, this.offset, r);
351
- const e = this.payload.subarray(this.offset, this.offset + r);
352
- return this.offset += r, new y(this.valueType, e);
353
- }
354
- default:
355
- throw new Error(`Unsupported dictionary value type ${F[this.valueType]}`);
356
- }
357
- }
358
- }
359
- class oe {
360
- constructor(r, e) {
361
- this.key = r, this.value = e;
362
- }
363
- }
364
- class T {
365
- constructor(r) {
366
- this.bytes = r;
367
- }
368
- static fromString(r) {
369
- if (!r)
370
- throw new Error("Guid string is empty");
371
- const e = r.replace(/-/g, "");
372
- if (e.length !== 32)
373
- throw new Error("Guid string must be 32 hex characters");
374
- const s = new Uint8Array(16), n = T.parseHexSlice(e, 0, 8), i = T.parseHexSlice(e, 8, 4), o = T.parseHexSlice(e, 12, 4);
375
- T.writeUInt32LE(s, 0, n), T.writeUInt16LE(s, 4, i), T.writeUInt16LE(s, 6, o);
376
- for (let a = 0; a < 8; a++)
377
- s[8 + a] = T.parseHexSlice(e, 16 + a * 2, 2);
378
- return new T(s);
379
- }
380
- static fromBytes(r) {
381
- if (r.length !== 16)
382
- throw new Error("Guid byte array must be 16 bytes");
383
- return new T(Uint8Array.from(r));
384
- }
385
- static createZero() {
386
- return new T(new Uint8Array(16));
387
- }
388
- static createRandom() {
389
- const r = new Uint8Array(16), e = globalThis.crypto;
390
- if (e?.getRandomValues)
391
- e.getRandomValues(r);
392
- else
393
- for (let s = 0; s < r.length; s++)
394
- r[s] = Math.floor(Math.random() * 256);
395
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, new T(r);
396
- }
397
- toString() {
398
- const r = this.bytes;
399
- return [
400
- T.toHex(T.readUInt32LE(r, 0), 8),
401
- T.toHex(T.readUInt16LE(r, 4), 4),
402
- T.toHex(T.readUInt16LE(r, 6), 4),
403
- nt(r.subarray(8, 10)),
404
- nt(r.subarray(10, 16))
405
- ].join("-");
406
- }
407
- asBytes() {
408
- return this.bytes.slice();
409
- }
410
- static parseHexSlice(r, e, s) {
411
- const n = r.substr(e, s), i = Number.parseInt(n, 16);
412
- if (Number.isNaN(i))
413
- throw new Error("Guid string contains invalid characters");
414
- return i >>> 0;
415
- }
416
- static writeUInt32LE(r, e, s) {
417
- const n = s >>> 0;
418
- r[e] = n & 255, r[e + 1] = n >>> 8 & 255, r[e + 2] = n >>> 16 & 255, r[e + 3] = n >>> 24 & 255;
419
- }
420
- static writeUInt16LE(r, e, s) {
421
- const n = s & 65535;
422
- r[e] = n & 255, r[e + 1] = n >>> 8 & 255;
423
- }
424
- static readUInt32LE(r, e) {
425
- return (r[e] | r[e + 1] << 8 | r[e + 2] << 16 | r[e + 3] << 24) >>> 0;
426
- }
427
- static readUInt16LE(r, e) {
428
- return (r[e] | r[e + 1] << 8) & 65535;
429
- }
430
- static toHex(r, e) {
431
- return (r >>> 0).toString(16).padStart(e, "0");
432
- }
433
- }
434
- function S(t, r, e) {
435
- if (r.offset >= t.length)
436
- throw new Error(e);
437
- let s = 0, n = 0, i = 0;
438
- for (; r.offset < t.length; ) {
439
- const o = t[r.offset++];
440
- if (i++, s |= (o & 127) << n, (o & 128) === 0) {
441
- if (i !== ae(s))
442
- throw new Error("Teleport VarUInt is not canonical");
443
- return s >>> 0;
444
- }
445
- if (n += 7, n >= 35)
446
- throw new Error("Teleport VarUInt exceeds 32-bit range");
447
- }
448
- throw new Error(e);
449
- }
450
- function ae(t) {
451
- return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
452
- }
453
- function b(t) {
454
- switch (t) {
455
- case 3:
456
- case 5:
457
- case 7:
458
- return 4;
459
- case 4:
460
- case 6:
461
- case 8:
462
- return 8;
463
- case 14:
464
- return 16;
465
- case 2:
466
- return 1;
467
- case 1:
468
- return 0;
469
- default:
470
- return -1;
471
- }
472
- }
473
- function at(t) {
474
- if (t === 9 || t === 11 || t === 10 || t === 1)
475
- throw new Error("Dictionary keys must be primitive Teleport types");
476
- }
477
- function N(t, r, e) {
478
- if (r < 0 || e < 0 || r + e > t.length)
479
- throw new Error("Teleport payload exceeds bounds");
480
- }
481
- function Ee(t, r) {
482
- return (t[r] | t[r + 1] << 8 | t[r + 2] << 16 | t[r + 3] << 24) >>> 0;
483
- }
484
- function et(t, r) {
485
- if (r >= t.length)
486
- throw new Error("Array payload exceeds bounds");
487
- const e = t[r], s = e >> 4 & 15;
488
- if ((e & 15) !== 0)
489
- throw new Error("Array flags must be zero");
490
- const n = { offset: r + 1 }, i = S(t, n, "ArrayMalformed"), o = b(s);
491
- if (o >= 0) {
492
- const _ = o * i;
493
- return N(t, n.offset, _), n.offset + _ - r;
494
- }
495
- let a = n.offset;
496
- for (let _ = 0; _ < i; _++)
497
- a = J(s, t, a, "ArrayMalformed");
498
- return a - r;
499
- }
500
- function rt(t, r) {
501
- if (r + 2 > t.length)
502
- throw new Error("Dictionary payload too short");
503
- const e = t[r] >> 4 & 15, s = t[r + 1] >> 4 & 15;
504
- if ((t[r] & 15) !== 0 || (t[r + 1] & 15) !== 0)
505
- throw new Error("Dictionary key/value flags must be zero");
506
- at(e);
507
- const n = { offset: r + 2 }, i = S(t, n, "DictMalformed");
508
- let o = n.offset;
509
- for (let a = 0; a < i; a++)
510
- o = J(e, t, o, "DictMalformed"), o = J(s, t, o, "DictMalformed");
511
- return o - r;
512
- }
513
- function J(t, r, e, s) {
514
- const n = b(t);
515
- if (n >= 0)
516
- return N(r, e, n), e + n;
517
- switch (t) {
518
- case 12:
519
- case 13: {
520
- const i = { offset: e }, o = S(r, i, s);
521
- return N(r, i.offset, o), i.offset + o;
522
- }
523
- case 11: {
524
- const i = { offset: e }, o = S(r, i, s);
525
- return N(r, i.offset, o), i.offset + o;
526
- }
527
- case 9:
528
- return e + et(r, e);
529
- case 10:
530
- return e + rt(r, e);
531
- default:
532
- throw new Error(`Unsupported Teleport type ${F[t]}`);
533
- }
534
- }
535
- function nt(t) {
536
- return Array.from(t).map((r) => r.toString(16).padStart(2, "0")).join("");
537
- }
538
- function K(t) {
539
- return t instanceof Uint8Array ? t : new Uint8Array(t);
540
- }
541
- var Et = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(Et || {}), _t = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MobileWeb = 1] = "MobileWeb", t[t.MobileApp = 2] = "MobileApp", t[t.DesktopWeb = 3] = "DesktopWeb", t[t.DesktopApp = 4] = "DesktopApp", t))(_t || {}), It = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Backend = 2] = "Backend", t[t.Server = 4] = "Server", t[t.Plugin = 8] = "Plugin", t[t.Browser = 16] = "Browser", t))(It || {}), lt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.MessagePack = 1] = "MessagePack", t[t.MemoryPack = 2] = "MemoryPack", t[t.Json = 4] = "Json", t[t.Teleport = 8] = "Teleport", t[t.All = 15] = "All", t))(lt || {}), ct = /* @__PURE__ */ ((t) => (t[t.Face = 0] = "Face", t[t.Hands = 1] = "Hands", t[t.Pose = 2] = "Pose", t[t.All = 3] = "All", t))(ct || {}), ft = /* @__PURE__ */ ((t) => (t[t.Css = 0] = "Css", t[t.Flutter = 1] = "Flutter", t))(ft || {}), ut = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Machine = 1] = "Machine", t[t.Human = 2] = "Human", t))(ut || {}), Tt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(Tt || {}), ht = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.DotNet = 1] = "DotNet", t[t.TypeScript = 2] = "TypeScript", t[t.Cpp = 3] = "Cpp", t[t.Dart = 4] = "Dart", t[t.Rust = 5] = "Rust", t))(ht || {}), At = /* @__PURE__ */ ((t) => (t[t.Local = 0] = "Local", t[t.Cloud = 1] = "Cloud", t))(At || {}), Nt = /* @__PURE__ */ ((t) => (t[t.Bundle = 0] = "Bundle", t[t.GitSource = 1] = "GitSource", t))(Nt || {}), m = /* @__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_ON_CLIENT_LEFT_AFTER_GRACE_PERIOD = 65560] = "CORE_ON_CLIENT_LEFT_AFTER_GRACE_PERIOD", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", t[t.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", t[t.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.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))(m || {});
542
- const _e = 161083277, Ie = 265814330, le = 1368629611, ce = 2431514951, fe = 2514959030, ue = 2745379226, Te = 3282782683, he = 3284746250, Ae = 4101844078;
543
- function St(t) {
544
- const r = {};
545
- return Ct(r), r;
546
- }
547
- function Ct(t) {
548
- return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = Et.Unknown, t.CodecDetails = "", t.SampleRate = 0, t.Channels = 0, t.ShapeSets = void 0, t.CorrelationId = void 0, t;
549
- }
550
- function Ne(t, r) {
551
- const e = r ?? St();
552
- return Ct(e), Se(t, e), e;
553
- }
554
- function Se(t, r) {
555
- let e;
556
- for (; (e = t.next()) !== null; )
557
- switch (e.fieldId) {
558
- case _e: {
559
- if (e.isNull) throw new Error();
560
- r.StreamId = e.asString();
561
- break;
562
- }
563
- case Ie: {
564
- if (e.isNull) {
565
- r.ShapeSets = void 0;
566
- break;
567
- }
568
- r.ShapeSets = Ce(e.asArray());
569
- break;
570
- }
571
- case le: {
572
- if (e.isNull) throw new Error();
573
- r.Description = e.asString();
574
- break;
575
- }
576
- case ce: {
577
- if (e.isNull) throw new Error();
578
- r.Channels = e.asInt32();
579
- break;
580
- }
581
- case fe: {
582
- if (e.isNull) {
583
- r.CorrelationId = void 0;
584
- break;
585
- }
586
- r.CorrelationId = e.asString();
587
- break;
588
- }
589
- case ue: {
590
- if (e.isNull) throw new Error();
591
- r.CodecDetails = e.asString();
592
- break;
593
- }
594
- case Te: {
595
- if (e.isNull) throw new Error();
596
- r.SourceType = e.asString();
597
- break;
598
- }
599
- case he: {
600
- if (e.isNull) throw new Error();
601
- r.Codec = e.asInt32();
602
- break;
603
- }
604
- case Ae: {
605
- if (e.isNull) throw new Error();
606
- r.SampleRate = e.asInt32();
607
- break;
608
- }
609
- }
610
- }
611
- function Ce(t) {
612
- const r = [];
613
- let e;
614
- for (; (e = t.next()) !== null; )
615
- r.push(ye(e.asObject()));
616
- return r;
617
- }
618
- const Re = 1107713536, De = 1154362099, de = 1185721362;
619
- function we(t) {
620
- const r = {};
621
- return Rt(r), r;
622
- }
623
- function Rt(t) {
624
- return t.SetId = 0, t.Name = "", t.ShapeNames = [], t;
625
- }
626
- function ye(t, r) {
627
- const e = r ?? we();
628
- return Rt(e), Ue(t, e), e;
629
- }
630
- function Ue(t, r) {
631
- let e;
632
- for (; (e = t.next()) !== null; )
633
- switch (e.fieldId) {
634
- case Re: {
635
- if (e.isNull) throw new Error();
636
- r.Name = e.asString();
637
- break;
638
- }
639
- case De: {
640
- if (e.isNull) throw new Error();
641
- r.SetId = e.asUInt32();
642
- break;
643
- }
644
- case de: {
645
- if (e.isNull) throw new Error();
646
- r.ShapeNames = Le(e.asArray());
647
- break;
648
- }
649
- }
650
- }
651
- function Le(t) {
652
- const r = [];
653
- let e;
654
- for (; (e = t.next()) !== null; )
655
- r.push(e.asString());
656
- return r;
657
- }
658
- const Oe = 76337612, me = 185396121, Pe = 250031587, ge = 388632637, Fe = 417197284, be = 469070965, Me = 470595159, ve = 594855258, ke = 781727218, Ge = 834078886, Be = 1043273762, Ve = 1236999138, xe = 1286979607, He = 1368629611, Ye = 1715899485, pe = 1942830531, Ke = 1999510636, $e = 2033288346, Xe = 2079864626, je = 2142346422, We = 2228539873, ze = 2232517119, Je = 2598291686, Qe = 2719718823, qe = 2810953526, Ze = 2840065720, tr = 2885165957, er = 3542818975, rr = 3586157513, sr = 3717933110, nr = 4062655306;
659
- function ir(t) {
660
- const r = {};
661
- return Dt(r), r;
662
- }
663
- function Dt(t) {
664
- return t.ContextType = It.Unknown, t.UserType = ut.Unknown, t.PayloadType = lt.Unknown, t.Description = "", t.UserId = "", t.DeviceId = "", t.ProductId = "", t.VersionId = "", t.InstallId = "", t.Locale = "", t.SessionId = -1, t.IsInternal = !1, t.IsReady = !1, t.HasInput = !1, t.ChannelLocale = "", t.EmbeddedSpaceId = "", t.AuthSessionId = "", t.ReceiveAllMessages = !1, t.PreciseJoinedAt = 0n, t.UserAgent = "", t.ClientType = _t.Unknown, t.UniqueSessionId = "", t.Parameters = /* @__PURE__ */ Object.create(null), t.SdkType = ht.Unknown, t.ViewportWidth = 0, t.ViewportHeight = 0, t.Theme = "", t.Timezone = "", t.IsTouchDevice = !1, t.InitialPath = "", t.StyleFormat = ft.Css, t;
665
- }
666
- function or(t, r) {
667
- const e = r ?? ir();
668
- return Dt(e), ar(t, e), e;
669
- }
670
- function ar(t, r) {
671
- let e;
672
- for (; (e = t.next()) !== null; )
673
- switch (e.fieldId) {
674
- case Oe: {
675
- if (e.isNull) throw new Error();
676
- r.DeviceId = e.asString();
677
- break;
678
- }
679
- case me: {
680
- if (e.isNull) throw new Error();
681
- r.InstallId = e.asString();
682
- break;
683
- }
684
- case Pe: {
685
- if (e.isNull) throw new Error();
686
- r.Theme = e.asString();
687
- break;
688
- }
689
- case ge: {
690
- if (e.isNull) throw new Error();
691
- r.UserAgent = e.asString();
692
- break;
693
- }
694
- case Fe: {
695
- if (e.isNull) throw new Error();
696
- r.ContextType = e.asInt32();
697
- break;
698
- }
699
- case be: {
700
- if (e.isNull) throw new Error();
701
- r.HasInput = e.asBool();
702
- break;
703
- }
704
- case Me: {
705
- if (e.isNull) throw new Error();
706
- r.UserType = e.asInt32();
707
- break;
708
- }
709
- case ve: {
710
- if (e.isNull) throw new Error();
711
- r.InitialPath = e.asString();
712
- break;
713
- }
714
- case ke: {
715
- if (e.isNull) throw new Error();
716
- r.UserId = e.asString();
717
- break;
718
- }
719
- case Ge: {
720
- if (e.isNull) throw new Error();
721
- r.ProductId = e.asString();
722
- break;
723
- }
724
- case Be: {
725
- if (e.isNull) throw new Error();
726
- r.AuthSessionId = e.asString();
727
- break;
728
- }
729
- case Ve: {
730
- if (e.isNull) throw new Error();
731
- r.ReceiveAllMessages = e.asBool();
732
- break;
733
- }
734
- case xe: {
735
- if (e.isNull) throw new Error();
736
- r.ViewportHeight = e.asInt32();
737
- break;
738
- }
739
- case He: {
740
- if (e.isNull) throw new Error();
741
- r.Description = e.asString();
742
- break;
743
- }
744
- case Ye: {
745
- if (e.isNull) throw new Error();
746
- r.Locale = e.asString();
747
- break;
748
- }
749
- case pe: {
750
- if (e.isNull) throw new Error();
751
- r.SdkType = e.asInt32();
752
- break;
753
- }
754
- case Ke: {
755
- if (e.isNull) throw new Error();
756
- r.SessionId = e.asInt32();
757
- break;
758
- }
759
- case $e: {
760
- if (e.isNull) throw new Error();
761
- r.ViewportWidth = e.asInt32();
762
- break;
763
- }
764
- case Xe: {
765
- if (e.isNull) throw new Error();
766
- r.PreciseJoinedAt = e.asUInt64();
767
- break;
768
- }
769
- case je: {
770
- if (e.isNull) throw new Error();
771
- r.PayloadType = e.asInt32();
772
- break;
773
- }
774
- case We: {
775
- if (e.isNull) throw new Error();
776
- r.StyleFormat = e.asInt32();
777
- break;
778
- }
779
- case ze: {
780
- if (e.isNull) throw new Error();
781
- r.IsTouchDevice = e.asBool();
782
- break;
783
- }
784
- case Je: {
785
- if (e.isNull) throw new Error();
786
- r.VersionId = e.asString();
787
- break;
788
- }
789
- case Qe: {
790
- if (e.isNull) throw new Error();
791
- r.UniqueSessionId = e.asString();
792
- break;
793
- }
794
- case qe: {
795
- if (e.isNull) throw new Error();
796
- r.ClientType = e.asInt32();
797
- break;
798
- }
799
- case Ze: {
800
- if (e.isNull) throw new Error();
801
- r.IsReady = e.asBool();
802
- break;
803
- }
804
- case tr: {
805
- if (e.isNull) throw new Error();
806
- r.Parameters = Er(e.asDictionary());
807
- break;
808
- }
809
- case er: {
810
- if (e.isNull) throw new Error();
811
- r.Timezone = e.asString();
812
- break;
813
- }
814
- case rr: {
815
- if (e.isNull) throw new Error();
816
- r.IsInternal = e.asBool();
817
- break;
818
- }
819
- case sr: {
820
- if (e.isNull) throw new Error();
821
- r.ChannelLocale = e.asString();
822
- break;
823
- }
824
- case nr: {
825
- if (e.isNull) throw new Error();
826
- r.EmbeddedSpaceId = e.asString();
827
- break;
828
- }
829
- }
830
- }
831
- function Er(t) {
832
- const r = /* @__PURE__ */ Object.create(null);
833
- let e;
834
- for (; (e = t.next()) !== null; ) {
835
- const s = e.key.asString();
836
- r[s] = e.value.asString();
837
- }
838
- return r;
839
- }
840
- const _r = 703025676, Ir = 814454131, lr = 972460562, cr = 976255570, fr = 1368629611, ur = 1479280922, Tr = 1533537016, hr = 1909301063, Ar = 2274386296, Nr = 2603556958, Sr = 2885165957, Cr = 3568439632;
841
- function Rr(t) {
842
- const r = {};
843
- return dt(r), r;
844
- }
845
- function dt(t) {
846
- return t.FunctionId = T.fromBytes(new Uint8Array(16)), t.FunctionName = "", t.Parameters = [], t.ResultTypeName = "", t.IsEnumerable = !1, t.EnumerableItemTypeName = "", t.IsCancellable = !1, t.Description = "", t.LlmInlineResult = !1, t.LlmCallOnlyOnce = !1, t.RequiresInstance = !1, t.Versions = [], t;
847
- }
848
- function Dr(t, r) {
849
- const e = r ?? Rr();
850
- return dt(e), dr(t, e), e;
851
- }
852
- function dr(t, r) {
853
- let e;
854
- for (; (e = t.next()) !== null; )
855
- switch (e.fieldId) {
856
- case _r: {
857
- if (e.isNull) throw new Error();
858
- r.ResultTypeName = e.asString();
859
- break;
860
- }
861
- case Ir: {
862
- if (e.isNull) throw new Error();
863
- r.FunctionName = e.asString();
864
- break;
865
- }
866
- case lr: {
867
- if (e.isNull) throw new Error();
868
- r.EnumerableItemTypeName = e.asString();
869
- break;
870
- }
871
- case cr: {
872
- if (e.isNull) throw new Error();
873
- r.FunctionId = e.asGuid();
874
- break;
875
- }
876
- case fr: {
877
- if (e.isNull) throw new Error();
878
- r.Description = e.asString();
879
- break;
880
- }
881
- case ur: {
882
- if (e.isNull) throw new Error();
883
- r.IsCancellable = e.asBool();
884
- break;
885
- }
886
- case Tr: {
887
- if (e.isNull) throw new Error();
888
- r.RequiresInstance = e.asBool();
889
- break;
890
- }
891
- case hr: {
892
- if (e.isNull) throw new Error();
893
- r.Versions = wr(e.asArray());
894
- break;
895
- }
896
- case Ar: {
897
- if (e.isNull) throw new Error();
898
- r.LlmInlineResult = e.asBool();
899
- break;
900
- }
901
- case Nr: {
902
- if (e.isNull) throw new Error();
903
- r.IsEnumerable = e.asBool();
904
- break;
905
- }
906
- case Sr: {
907
- if (e.isNull) throw new Error();
908
- r.Parameters = yr(e.asArray());
909
- break;
910
- }
911
- case Cr: {
912
- if (e.isNull) throw new Error();
913
- r.LlmCallOnlyOnce = e.asBool();
914
- break;
915
- }
916
- }
917
- }
918
- function wr(t) {
919
- const r = [];
920
- let e;
921
- for (; (e = t.next()) !== null; )
922
- r.push(e.asString());
923
- return r;
924
- }
925
- function yr(t) {
926
- const r = [];
927
- let e;
928
- for (; (e = t.next()) !== null; )
929
- r.push(kr(e.asObject()));
930
- return r;
931
- }
932
- const Ur = 607861992, Lr = 894485888, Or = 972460562, mr = 1368629611, Pr = 1883521406, gr = 2603556958, Fr = 3609695522, br = 4075263697, Mr = 4257460908;
933
- function vr(t) {
934
- const r = {};
935
- return wt(r), r;
936
- }
937
- function wt(t) {
938
- return t.ParameterIndex = 0, t.ParameterName = "", t.TypeName = "", t.HasDefaultValue = !1, t.DefaultValueJson = "", t.DefaultValueData = new Uint8Array(0), t.IsEnumerable = !1, t.EnumerableItemTypeName = "", t.Description = "", t;
939
- }
940
- function kr(t, r) {
941
- const e = r ?? vr();
942
- return wt(e), Gr(t, e), e;
943
- }
944
- function Gr(t, r) {
945
- let e;
946
- for (; (e = t.next()) !== null; )
947
- switch (e.fieldId) {
948
- case Ur: {
949
- if (e.isNull) throw new Error();
950
- r.HasDefaultValue = e.asBool();
951
- break;
952
- }
953
- case Lr: {
954
- if (e.isNull) throw new Error();
955
- r.DefaultValueJson = e.asString();
956
- break;
957
- }
958
- case Or: {
959
- if (e.isNull) throw new Error();
960
- r.EnumerableItemTypeName = e.asString();
961
- break;
962
- }
963
- case mr: {
964
- if (e.isNull) throw new Error();
965
- r.Description = e.asString();
966
- break;
967
- }
968
- case Pr: {
969
- if (e.isNull) throw new Error();
970
- r.DefaultValueData = e.asBinary();
971
- break;
972
- }
973
- case gr: {
974
- if (e.isNull) throw new Error();
975
- r.IsEnumerable = e.asBool();
976
- break;
977
- }
978
- case Fr: {
979
- if (e.isNull) throw new Error();
980
- r.TypeName = e.asString();
981
- break;
982
- }
983
- case br: {
984
- if (e.isNull) throw new Error();
985
- r.ParameterName = e.asString();
986
- break;
987
- }
988
- case Mr: {
989
- if (e.isNull) throw new Error();
990
- r.ParameterIndex = e.asInt32();
991
- break;
992
- }
993
- }
994
- }
995
- const Br = 3167053791, Vr = 3342364356, xr = 3612929027;
996
- function yt(t) {
997
- const r = {};
998
- return Ut(r), r;
999
- }
1000
- function Ut(t) {
1001
- return t.Category = "", t.Type = ct.Face, t.FaceBlendshapes = [], t;
1002
- }
1003
- function Hr(t, r) {
1004
- const e = r ?? yt();
1005
- return Ut(e), Yr(t, e), e;
1006
- }
1007
- function Yr(t, r) {
1008
- let e;
1009
- for (; (e = t.next()) !== null; )
1010
- switch (e.fieldId) {
1011
- case Br: {
1012
- if (e.isNull) throw new Error();
1013
- r.Type = e.asInt32();
1014
- break;
1015
- }
1016
- case Vr: {
1017
- if (e.isNull) throw new Error();
1018
- r.FaceBlendshapes = pr(e.asArray());
1019
- break;
1020
- }
1021
- case xr: {
1022
- if (e.isNull) throw new Error();
1023
- r.Category = e.asString();
1024
- break;
1025
- }
1026
- }
1027
- }
1028
- function pr(t) {
1029
- const r = [];
1030
- let e;
1031
- for (; (e = t.next()) !== null; )
1032
- r.push(e.asString());
1033
- return r;
1034
- }
1035
- const Kr = 1405462580, $r = 2968276160;
1036
- function Xr(t) {
1037
- const r = {};
1038
- return Lt(r), r;
1039
- }
1040
- function Lt(t) {
1041
- return t.MimeType = "", t.Value = new Uint8Array(0), t;
1042
- }
1043
- function jr(t, r) {
1044
- const e = r ?? Xr();
1045
- return Lt(e), Wr(t, e), e;
1046
- }
1047
- function Wr(t, r) {
1048
- let e;
1049
- for (; (e = t.next()) !== null; )
1050
- switch (e.fieldId) {
1051
- case Kr: {
1052
- if (e.isNull) throw new Error();
1053
- r.Value = e.asBinary();
1054
- break;
1055
- }
1056
- case $r: {
1057
- if (e.isNull) throw new Error();
1058
- r.MimeType = e.asString();
1059
- break;
1060
- }
1061
- }
1062
- }
1063
- const zr = 3612929027;
1064
- function Ot(t) {
1065
- const r = {};
1066
- return mt(r), r;
1067
- }
1068
- function mt(t) {
1069
- return t.Category = "", t;
1070
- }
1071
- function Jr(t, r) {
1072
- const e = r ?? Ot();
1073
- return mt(e), Qr(t, e), e;
1074
- }
1075
- function Qr(t, r) {
1076
- let e;
1077
- for (; (e = t.next()) !== null; )
1078
- switch (e.fieldId) {
1079
- case zr: {
1080
- if (e.isNull) throw new Error();
1081
- r.Category = e.asString();
1082
- break;
1083
- }
1084
- }
1085
- }
1086
- const qr = 2097188, Zr = 979822885, ts = 2374537704;
1087
- function es(t) {
1088
- const r = {};
1089
- return Pt(r), r;
1090
- }
1091
- function Pt(t) {
1092
- return t.StyleId = "", t.Style = /* @__PURE__ */ Object.create(null), t;
1093
- }
1094
- function rs(t, r) {
1095
- const e = O.create(t);
1096
- return ss(e, r);
1097
- }
1098
- function ss(t, r) {
1099
- const e = r ?? es();
1100
- return Pt(e), ns(t, e), e;
1101
- }
1102
- function ns(t, r) {
1103
- let e;
1104
- for (; (e = t.next()) !== null; )
1105
- switch (e.fieldId) {
1106
- case Zr: {
1107
- if (e.isNull) throw new Error();
1108
- r.StyleId = e.asString();
1109
- break;
1110
- }
1111
- case ts: {
1112
- if (e.isNull) throw new Error();
1113
- r.Style = os(e.asDictionary());
1114
- break;
1115
- }
1116
- }
1117
- }
1118
- async function is(t, r) {
1119
- const e = await p(t, qr);
1120
- return rs(e, r);
1121
- }
1122
- function os(t) {
1123
- const r = /* @__PURE__ */ Object.create(null);
1124
- let e;
1125
- for (; (e = t.next()) !== null; ) {
1126
- const s = e.key.asString();
1127
- r[s] = e.value.asString();
1128
- }
1129
- return r;
1130
- }
1131
- const as = 2097192, Es = 2136687806;
1132
- function _s(t) {
1133
- const r = {};
1134
- return gt(r), r;
1135
- }
1136
- function gt(t) {
1137
- return t.Styles = [], t;
1138
- }
1139
- function Is(t, r) {
1140
- const e = O.create(t);
1141
- return ls(e, r);
1142
- }
1143
- function ls(t, r) {
1144
- const e = r ?? _s();
1145
- return gt(e), cs(t, e), e;
1146
- }
1147
- function cs(t, r) {
1148
- let e;
1149
- for (; (e = t.next()) !== null; )
1150
- switch (e.fieldId) {
1151
- case Es: {
1152
- if (e.isNull) throw new Error();
1153
- r.Styles = us(e.asArray());
1154
- break;
1155
- }
1156
- }
1157
- }
1158
- async function fs(t, r) {
1159
- const e = await p(t, as);
1160
- return Is(e, r);
1161
- }
1162
- function us(t) {
1163
- const r = [];
1164
- let e;
1165
- for (; (e = t.next()) !== null; )
1166
- r.push(Ns(e.asObject()));
1167
- return r;
1168
- }
1169
- const Ts = 979822885, hs = 2374537704;
1170
- function As(t) {
1171
- const r = {};
1172
- return Ft(r), r;
1173
- }
1174
- function Ft(t) {
1175
- return t.StyleId = "", t.Style = /* @__PURE__ */ Object.create(null), t;
1176
- }
1177
- function Ns(t, r) {
1178
- const e = r ?? As();
1179
- return Ft(e), Ss(t, e), e;
1180
- }
1181
- function Ss(t, r) {
1182
- let e;
1183
- for (; (e = t.next()) !== null; )
1184
- switch (e.fieldId) {
1185
- case Ts: {
1186
- if (e.isNull) throw new Error();
1187
- r.StyleId = e.asString();
1188
- break;
1189
- }
1190
- case hs: {
1191
- if (e.isNull) throw new Error();
1192
- r.Style = Cs(e.asDictionary());
1193
- break;
1194
- }
1195
- }
1196
- }
1197
- function Cs(t) {
1198
- const r = /* @__PURE__ */ Object.create(null);
1199
- let e;
1200
- for (; (e = t.next()) !== null; ) {
1201
- const s = e.key.asString();
1202
- r[s] = e.value.asString();
1203
- }
1204
- return r;
1205
- }
1206
- const Rs = 2097193, Ds = 1415642792;
1207
- function ds(t) {
1208
- const r = {};
1209
- return bt(r), r;
1210
- }
1211
- function bt(t) {
1212
- return t.StyleIds = [], t;
1213
- }
1214
- function ws(t, r) {
1215
- const e = O.create(t);
1216
- return ys(e, r);
1217
- }
1218
- function ys(t, r) {
1219
- const e = r ?? ds();
1220
- return bt(e), Us(t, e), e;
1221
- }
1222
- function Us(t, r) {
1223
- let e;
1224
- for (; (e = t.next()) !== null; )
1225
- switch (e.fieldId) {
1226
- case Ds: {
1227
- if (e.isNull) throw new Error();
1228
- r.StyleIds = Os(e.asArray());
1229
- break;
1230
- }
1231
- }
1232
- }
1233
- async function Ls(t, r) {
1234
- const e = await p(t, Rs);
1235
- return ws(e, r);
1236
- }
1237
- function Os(t) {
1238
- const r = [];
1239
- let e;
1240
- for (; (e = t.next()) !== null; )
1241
- r.push(e.asString());
1242
- return r;
1243
- }
1244
- const ms = 2097190, Ps = 425183262, gs = 653781469;
1245
- function Fs(t) {
1246
- const r = {};
1247
- return Mt(r), r;
1248
- }
1249
- function Mt(t) {
1250
- return t.Json = "", t.Payloads = /* @__PURE__ */ Object.create(null), t;
1251
- }
1252
- function bs(t, r) {
1253
- const e = O.create(t);
1254
- return Ms(e, r);
1255
- }
1256
- function Ms(t, r) {
1257
- const e = r ?? Fs();
1258
- return Mt(e), vs(t, e), e;
1259
- }
1260
- function vs(t, r) {
1261
- let e;
1262
- for (; (e = t.next()) !== null; )
1263
- switch (e.fieldId) {
1264
- case Ps: {
1265
- if (e.isNull) throw new Error();
1266
- r.Json = e.asString();
1267
- break;
1268
- }
1269
- case gs: {
1270
- if (e.isNull) throw new Error();
1271
- r.Payloads = Gs(e.asDictionary());
1272
- break;
1273
- }
1274
- }
1275
- }
1276
- async function ks(t, r) {
1277
- const e = await p(t, ms);
1278
- return bs(e, r);
1279
- }
1280
- function Gs(t) {
1281
- const r = /* @__PURE__ */ Object.create(null);
1282
- let e;
1283
- for (; (e = t.next()) !== null; ) {
1284
- const s = e.key.asString();
1285
- r[s] = jr(e.value.asObject());
1286
- }
1287
- return r;
1288
- }
1289
- const Bs = 161083277, Vs = 164808083, xs = 1368629611, Hs = 2514959030, Ys = 2745379226, ps = 2950031986, Ks = 3282782683, $s = 3284746250, Xs = 4065070594;
1290
- function vt(t) {
1291
- const r = {};
1292
- return kt(r), r;
1293
- }
1294
- function kt(t) {
1295
- return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = Tt.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t.CorrelationId = void 0, t;
1296
- }
1297
- function js(t, r) {
1298
- const e = r ?? vt();
1299
- return kt(e), Ws(t, e), e;
1300
- }
1301
- function Ws(t, r) {
1302
- let e;
1303
- for (; (e = t.next()) !== null; )
1304
- switch (e.fieldId) {
1305
- case Bs: {
1306
- if (e.isNull) throw new Error();
1307
- r.StreamId = e.asString();
1308
- break;
1309
- }
1310
- case Vs: {
1311
- if (e.isNull) throw new Error();
1312
- r.Framerate = e.asFloat64();
1313
- break;
1314
- }
1315
- case xs: {
1316
- if (e.isNull) throw new Error();
1317
- r.Description = e.asString();
1318
- break;
1319
- }
1320
- case Hs: {
1321
- if (e.isNull) {
1322
- r.CorrelationId = void 0;
1323
- break;
1324
- }
1325
- r.CorrelationId = e.asString();
1326
- break;
1327
- }
1328
- case Ys: {
1329
- if (e.isNull) throw new Error();
1330
- r.CodecDetails = e.asString();
1331
- break;
1332
- }
1333
- case ps: {
1334
- if (e.isNull) throw new Error();
1335
- r.Height = e.asInt32();
1336
- break;
1337
- }
1338
- case Ks: {
1339
- if (e.isNull) throw new Error();
1340
- r.SourceType = e.asString();
1341
- break;
1342
- }
1343
- case $s: {
1344
- if (e.isNull) throw new Error();
1345
- r.Codec = e.asInt32();
1346
- break;
1347
- }
1348
- case Xs: {
1349
- if (e.isNull) throw new Error();
1350
- r.Width = e.asInt32();
1351
- break;
1352
- }
1353
- }
1354
- }
1355
- const zs = 65539, Js = 693643444, Qs = 976837618, qs = 1144553441, Zs = 1497620243, tn = 1559330978, en = 1976546434, rn = 2271236852, sn = 2277643855, nn = 2469008121, on = 3042922213, an = 3064612128, En = 3219210453, _n = 3504054055, In = 3678477544, ln = 3696445035, cn = 3707543140, fn = 3712281496, un = 3895362455, Tn = 3897397815, hn = 3914217035, An = 4225107827;
1356
- function Nn(t) {
1357
- const r = {};
1358
- return Gt(r), r;
1359
- }
1360
- function Gt(t) {
1361
- return t.Clients = /* @__PURE__ */ Object.create(null), t.Functions = /* @__PURE__ */ Object.create(null), t.UIStreams = /* @__PURE__ */ Object.create(null), t.AudioStreams = /* @__PURE__ */ Object.create(null), t.VideoStreams = /* @__PURE__ */ Object.create(null), t.TrackingStreams = /* @__PURE__ */ Object.create(null), t.SpaceId = "", t.ChannelId = "", t.ServerSessionId = "", t.SessionHash = "", t.ChannelUrl = "", t.SessionChannelUrl = "", t.FirstUserId = "", t.PrimaryUserId = "", t.OrganisationName = "", t.SpaceName = "", t.ChannelName = "", t.ServerRunType = At.Local, t.AppSourceType = Nt.Bundle, t.PublicAccess = !1, t.DebugMode = !1, t;
1362
- }
1363
- function Sn(t, r) {
1364
- const e = O.create(t);
1365
- return Cn(e, r);
1366
- }
1367
- function Cn(t, r) {
1368
- const e = r ?? Nn();
1369
- return Gt(e), Rn(t, e), e;
1370
- }
1371
- function Rn(t, r) {
1372
- let e;
1373
- for (; (e = t.next()) !== null; )
1374
- switch (e.fieldId) {
1375
- case Js: {
1376
- if (e.isNull) throw new Error();
1377
- r.FirstUserId = e.asString();
1378
- break;
1379
- }
1380
- case Qs: {
1381
- if (e.isNull) throw new Error();
1382
- r.SessionHash = e.asString();
1383
- break;
1384
- }
1385
- case qs: {
1386
- if (e.isNull) throw new Error();
1387
- r.Clients = dn(e.asDictionary());
1388
- break;
1389
- }
1390
- case Zs: {
1391
- if (e.isNull) throw new Error();
1392
- r.TrackingStreams = wn(e.asDictionary());
1393
- break;
1394
- }
1395
- case tn: {
1396
- if (e.isNull) throw new Error();
1397
- r.ChannelId = e.asString();
1398
- break;
1399
- }
1400
- case en: {
1401
- if (e.isNull) throw new Error();
1402
- r.AppSourceType = e.asInt32();
1403
- break;
1404
- }
1405
- case rn: {
1406
- if (e.isNull) throw new Error();
1407
- r.SessionChannelUrl = e.asString();
1408
- break;
1409
- }
1410
- case sn: {
1411
- if (e.isNull) throw new Error();
1412
- r.ChannelUrl = e.asString();
1413
- break;
1414
- }
1415
- case nn: {
1416
- if (e.isNull) throw new Error();
1417
- r.ChannelName = e.asString();
1418
- break;
1419
- }
1420
- case on: {
1421
- if (e.isNull) throw new Error();
1422
- r.PublicAccess = e.asBool();
1423
- break;
1424
- }
1425
- case an: {
1426
- if (e.isNull) throw new Error();
1427
- r.ServerRunType = e.asInt32();
1428
- break;
1429
- }
1430
- case En: {
1431
- if (e.isNull) throw new Error();
1432
- r.OrganisationName = e.asString();
1433
- break;
1434
- }
1435
- case _n: {
1436
- if (e.isNull) throw new Error();
1437
- r.DebugMode = e.asBool();
1438
- break;
1439
- }
1440
- case In: {
1441
- if (e.isNull) throw new Error();
1442
- r.Functions = yn(e.asDictionary());
1443
- break;
1444
- }
1445
- case ln: {
1446
- if (e.isNull) throw new Error();
1447
- r.UIStreams = Un(e.asDictionary());
1448
- break;
1449
- }
1450
- case cn: {
1451
- if (e.isNull) throw new Error();
1452
- r.SpaceId = e.asString();
1453
- break;
1454
- }
1455
- case fn: {
1456
- if (e.isNull) throw new Error();
1457
- r.PrimaryUserId = e.asString();
1458
- break;
1459
- }
1460
- case un: {
1461
- if (e.isNull) throw new Error();
1462
- r.AudioStreams = Ln(e.asDictionary());
1463
- break;
1464
- }
1465
- case Tn: {
1466
- if (e.isNull) throw new Error();
1467
- r.VideoStreams = On(e.asDictionary());
1468
- break;
1469
- }
1470
- case hn: {
1471
- if (e.isNull) throw new Error();
1472
- r.ServerSessionId = e.asString();
1473
- break;
1474
- }
1475
- case An: {
1476
- if (e.isNull) throw new Error();
1477
- r.SpaceName = e.asString();
1478
- break;
1479
- }
1480
- }
1481
- }
1482
- async function Dn(t, r) {
1483
- const e = await p(t, zs);
1484
- return Sn(e, r);
1485
- }
1486
- function dn(t) {
1487
- const r = /* @__PURE__ */ Object.create(null);
1488
- let e;
1489
- for (; (e = t.next()) !== null; ) {
1490
- const s = e.key.asInt32();
1491
- r[s] = or(e.value.asObject());
1492
- }
1493
- return r;
1494
- }
1495
- function wn(t) {
1496
- const r = /* @__PURE__ */ Object.create(null);
1497
- let e;
1498
- for (; (e = t.next()) !== null; ) {
1499
- const s = e.key.asString();
1500
- r[s] = ri(e.value.asObject());
1501
- }
1502
- return r;
1503
- }
1504
- function yn(t) {
1505
- const r = /* @__PURE__ */ Object.create(null);
1506
- let e;
1507
- for (; (e = t.next()) !== null; ) {
1508
- const s = e.key.asInt32();
1509
- r[s] = mn(e.value.asArray());
1510
- }
1511
- return r;
1512
- }
1513
- function Un(t) {
1514
- const r = /* @__PURE__ */ Object.create(null);
1515
- let e;
1516
- for (; (e = t.next()) !== null; ) {
1517
- const s = e.key.asString();
1518
- r[s] = vn(e.value.asObject());
1519
- }
1520
- return r;
1521
- }
1522
- function Ln(t) {
1523
- const r = /* @__PURE__ */ Object.create(null);
1524
- let e;
1525
- for (; (e = t.next()) !== null; ) {
1526
- const s = e.key.asString();
1527
- r[s] = Yn(e.value.asObject());
1528
- }
1529
- return r;
1530
- }
1531
- function On(t) {
1532
- const r = /* @__PURE__ */ Object.create(null);
1533
- let e;
1534
- for (; (e = t.next()) !== null; ) {
1535
- const s = e.key.asString();
1536
- r[s] = zn(e.value.asObject());
1537
- }
1538
- return r;
1539
- }
1540
- function mn(t) {
1541
- const r = [];
1542
- let e;
1543
- for (; (e = t.next()) !== null; )
1544
- r.push(Dr(e.asObject()));
1545
- return r;
1546
- }
1547
- const Pn = 161083277, gn = 325678206, Fn = 3469892363, bn = 3645544153;
1548
- function Mn(t) {
1549
- const r = {};
1550
- return Bt(r), r;
1551
- }
1552
- function Bt(t) {
1553
- return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = Ot(), t;
1554
- }
1555
- function vn(t, r) {
1556
- const e = r ?? Mn();
1557
- return Bt(e), kn(t, e), e;
1558
- }
1559
- function kn(t, r) {
1560
- let e;
1561
- for (; (e = t.next()) !== null; )
1562
- switch (e.fieldId) {
1563
- case Pn: {
1564
- if (e.isNull) throw new Error();
1565
- r.StreamId = e.asString();
1566
- break;
1567
- }
1568
- case gn: {
1569
- if (e.isNull) throw new Error();
1570
- r.ClientSessionId = e.asInt32();
1571
- break;
1572
- }
1573
- case Fn: {
1574
- if (e.isNull) throw new Error();
1575
- r.TrackId = e.asInt32();
1576
- break;
1577
- }
1578
- case bn: {
1579
- if (e.isNull) throw new Error();
1580
- r.Info = Jr(e.asObject());
1581
- break;
1582
- }
1583
- }
1584
- }
1585
- const Gn = 161083277, Bn = 325678206, Vn = 3469892363, xn = 3645544153;
1586
- function Hn(t) {
1587
- const r = {};
1588
- return Vt(r), r;
1589
- }
1590
- function Vt(t) {
1591
- return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = St(), t;
1592
- }
1593
- function Yn(t, r) {
1594
- const e = r ?? Hn();
1595
- return Vt(e), pn(t, e), e;
1596
- }
1597
- function pn(t, r) {
1598
- let e;
1599
- for (; (e = t.next()) !== null; )
1600
- switch (e.fieldId) {
1601
- case Gn: {
1602
- if (e.isNull) throw new Error();
1603
- r.StreamId = e.asString();
1604
- break;
1605
- }
1606
- case Bn: {
1607
- if (e.isNull) throw new Error();
1608
- r.ClientSessionId = e.asInt32();
1609
- break;
1610
- }
1611
- case Vn: {
1612
- if (e.isNull) throw new Error();
1613
- r.TrackId = e.asInt32();
1614
- break;
1615
- }
1616
- case xn: {
1617
- if (e.isNull) throw new Error();
1618
- r.Info = Ne(e.asObject());
1619
- break;
1620
- }
1621
- }
1622
- }
1623
- const Kn = 161083277, $n = 325678206, Xn = 3469892363, jn = 3645544153;
1624
- function Wn(t) {
1625
- const r = {};
1626
- return xt(r), r;
1627
- }
1628
- function xt(t) {
1629
- return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = vt(), t;
1630
- }
1631
- function zn(t, r) {
1632
- const e = r ?? Wn();
1633
- return xt(e), Jn(t, e), e;
1634
- }
1635
- function Jn(t, r) {
1636
- let e;
1637
- for (; (e = t.next()) !== null; )
1638
- switch (e.fieldId) {
1639
- case Kn: {
1640
- if (e.isNull) throw new Error();
1641
- r.StreamId = e.asString();
1642
- break;
1643
- }
1644
- case $n: {
1645
- if (e.isNull) throw new Error();
1646
- r.ClientSessionId = e.asInt32();
1647
- break;
1648
- }
1649
- case Xn: {
1650
- if (e.isNull) throw new Error();
1651
- r.TrackId = e.asInt32();
1652
- break;
1653
- }
1654
- case jn: {
1655
- if (e.isNull) throw new Error();
1656
- r.Info = js(e.asObject());
1657
- break;
1658
- }
1659
- }
1660
- }
1661
- const Qn = 161083277, qn = 325678206, Zn = 3469892363, ti = 3645544153;
1662
- function ei(t) {
1663
- const r = {};
1664
- return Ht(r), r;
1665
- }
1666
- function Ht(t) {
1667
- return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = yt(), t;
1668
- }
1669
- function ri(t, r) {
1670
- const e = r ?? ei();
1671
- return Ht(e), si(t, e), e;
1672
- }
1673
- function si(t, r) {
1674
- let e;
1675
- for (; (e = t.next()) !== null; )
1676
- switch (e.fieldId) {
1677
- case Qn: {
1678
- if (e.isNull) throw new Error();
1679
- r.StreamId = e.asString();
1680
- break;
1681
- }
1682
- case qn: {
1683
- if (e.isNull) throw new Error();
1684
- r.ClientSessionId = e.asInt32();
1685
- break;
1686
- }
1687
- case Zn: {
1688
- if (e.isNull) throw new Error();
1689
- r.TrackId = e.asInt32();
1690
- break;
1691
- }
1692
- case ti: {
1693
- if (e.isNull) throw new Error();
1694
- r.Info = Hr(e.asObject());
1695
- break;
1696
- }
1697
- }
1698
- }
1699
- function C(t) {
1700
- return typeof t == "object" && t !== null && !Array.isArray(t);
1701
- }
1702
- function Yt(t) {
1703
- const r = {}, e = Object.keys(t);
1704
- for (let s = 0; s < e.length; s++) {
1705
- const n = e[s];
1706
- r[n] = t[n];
1707
- }
1708
- return r;
1709
- }
1710
- function pt(t, r, e, s) {
1711
- if (!(t === void 0 && s)) {
1712
- if (Array.isArray(t)) {
1713
- const n = [];
1714
- for (let i = 0; i < t.length; i++) {
1715
- const o = t[i];
1716
- if (typeof o != "string")
1717
- throw new Error(`Invalid styleIds entry at ${r}.styleIds[${i}] for element ${e}`);
1718
- const a = o.trim();
1719
- a.length !== 0 && n.push(a);
1720
- }
1721
- return n;
1722
- }
1723
- if (t != null)
1724
- throw new Error(`Invalid styleIds for element ${e}`);
1725
- return [];
1726
- }
1727
- }
1728
- function st(t, r) {
1729
- if (!t || typeof t != "object")
1730
- throw new Error(`Invalid UI node at ${r}`);
1731
- const e = t.Id, s = t.Type, n = t.Props, i = t.Children, o = t.StyleIds;
1732
- if (typeof e != "string")
1733
- throw new Error(`Invalid or missing node id at ${r}`);
1734
- if (typeof s != "string")
1735
- throw new Error(`Invalid or missing node type for ${e}`);
1736
- let a = {};
1737
- if (n != null) {
1738
- if (!C(n))
1739
- throw new Error(`Invalid props for node ${e}`);
1740
- a = Yt(n);
1741
- }
1742
- let _ = [];
1743
- Array.isArray(i) && (_ = i.map(
1744
- (l, c) => st(l ?? {}, `${r}.children[${c}]`)
1745
- ));
1746
- const I = pt(o, r, e, !1), E = typeof t.SourceMarker == "string" ? t.SourceMarker : void 0;
1747
- return {
1748
- id: e,
1749
- type: s,
1750
- props: a,
1751
- children: _,
1752
- styleIds: I ?? [],
1753
- ...E ? { sourceMarker: E } : {}
1754
- };
1755
- }
1756
- function ni(t, r) {
1757
- if (!C(t))
1758
- throw new Error(`Invalid text delta at ${r}`);
1759
- const e = t.NodeId, s = t.PropertyName, n = t.Start, i = t.End, o = t.InsertedText;
1760
- if (typeof e != "string" || e.length === 0)
1761
- throw new Error(`Invalid text delta node id at ${r}`);
1762
- if (typeof s != "string" || s.length === 0)
1763
- throw new Error(`Invalid text delta property name at ${r}`);
1764
- if (typeof n != "number" || !Number.isFinite(n))
1765
- throw new Error(`Invalid text delta start at ${r}`);
1766
- if (typeof o != "string")
1767
- throw new Error(`Invalid text delta inserted text at ${r}`);
1768
- let a;
1769
- if (typeof i == "number") {
1770
- if (!Number.isFinite(i))
1771
- throw new Error(`Invalid text delta end at ${r}`);
1772
- a = i;
1773
- } else if (i != null)
1774
- throw new Error(`Invalid text delta end at ${r}`);
1775
- return {
1776
- nodeId: e,
1777
- propertyName: s,
1778
- start: n,
1779
- end: a,
1780
- insertedText: o
1781
- };
1782
- }
1783
- function ii(t, r) {
1784
- if (!C(t))
1785
- throw new Error(`Invalid child insert at ${r}`);
1786
- const e = t.Index, s = t.Node;
1787
- if (typeof e != "number" || !Number.isFinite(e))
1788
- throw new Error(`Invalid child insert index at ${r}`);
1789
- if (!C(s))
1790
- throw new Error(`Invalid child insert node at ${r}`);
1791
- return {
1792
- index: e,
1793
- node: st(s, `${r}.node`)
1794
- };
1795
- }
1796
- function oi(t, r) {
1797
- if (!C(t))
1798
- throw new Error(`Invalid child move at ${r}`);
1799
- const e = t.NodeId, s = t.FromIndex, n = t.ToIndex;
1800
- if (typeof e != "string" || e.length === 0)
1801
- throw new Error(`Invalid child move nodeId at ${r}`);
1802
- if (typeof s != "number" || !Number.isFinite(s))
1803
- throw new Error(`Invalid child move fromIndex at ${r}`);
1804
- if (typeof n != "number" || !Number.isFinite(n))
1805
- throw new Error(`Invalid child move toIndex at ${r}`);
1806
- return {
1807
- nodeId: e,
1808
- fromIndex: s,
1809
- toIndex: n
1810
- };
1811
- }
1812
- function ai(t, r) {
1813
- if (!C(t))
1814
- throw new Error(`Invalid child remove at ${r}`);
1815
- const e = t.NodeId, s = t.Index;
1816
- if (typeof e != "string" || e.length === 0)
1817
- throw new Error(`Invalid child remove nodeId at ${r}`);
1818
- if (typeof s != "number" || !Number.isFinite(s))
1819
- throw new Error(`Invalid child remove index at ${r}`);
1820
- return {
1821
- nodeId: e,
1822
- index: s
1823
- };
1824
- }
1825
- function Ei(t, r) {
1826
- if (!C(t))
1827
- throw new Error(`Invalid node change at ${r}`);
1828
- const e = t.nodeId;
1829
- if (typeof e != "string" || e.length === 0)
1830
- throw new Error(`Invalid node change nodeId at ${r}`);
1831
- const s = Array.isArray(t.inserts) ? t.inserts.map(
1832
- (E, l) => ii(E ?? {}, `${r}.inserts[${l}]`)
1833
- ) : void 0, n = Array.isArray(t.moves) ? t.moves.map(
1834
- (E, l) => oi(E ?? {}, `${r}.moves[${l}]`)
1835
- ) : void 0, i = Array.isArray(t.removals) ? t.removals.map(
1836
- (E, l) => ai(E ?? {}, `${r}.removals[${l}]`)
1837
- ) : void 0;
1838
- let o;
1839
- if (C(t.changedProps)) {
1840
- o = /* @__PURE__ */ new Map();
1841
- for (const [E, l] of Object.entries(t.changedProps)) {
1842
- if (!C(l))
1843
- continue;
1844
- const c = l.New;
1845
- c === void 0 ? o.set(E, void 0) : C(c) ? o.set(E, Yt(c)) : o.set(E, c);
1846
- }
1847
- }
1848
- const a = Array.isArray(t.textUpdates) ? t.textUpdates.map(
1849
- (E, l) => ni(E ?? {}, `${r}.textUpdates[${l}]`)
1850
- ) : void 0, _ = t.styleIds, I = _ !== void 0 ? pt(_, r, e, !0) : void 0;
1851
- return {
1852
- nodeId: e,
1853
- ...s && s.length > 0 ? { inserts: s } : {},
1854
- ...n && n.length > 0 ? { moves: n } : {},
1855
- ...i && i.length > 0 ? { removals: i } : {},
1856
- ...o && o.size > 0 ? { changedProps: o } : {},
1857
- ...a && a.length > 0 ? { textUpdates: a } : {},
1858
- ...I !== void 0 ? { styleIds: I } : {}
1859
- };
1860
- }
1861
- function _i(t) {
1862
- const r = /* @__PURE__ */ new Map();
1863
- for (const [e, s] of Object.entries(t))
1864
- r.set(e, s);
1865
- return r;
1866
- }
1867
- function Ii(t, r, e) {
1868
- if (!t || typeof t != "object")
1869
- throw new R("UI update graph is missing");
1870
- const s = st(t, "graph");
1871
- if (s.type !== "root")
1872
- throw new R('UI update root element must have type "root"');
1873
- const n = ci(s.props, r);
1874
- return {
1875
- type: "full",
1876
- version: e,
1877
- root: s,
1878
- metadata: n
1879
- };
1880
- }
1881
- function li(t, r, e) {
1882
- if (!Array.isArray(t))
1883
- throw new R("UI diff changes must be an array");
1884
- if (!C(r))
1885
- throw new R("UI diff metadata must be an object");
1886
- const s = r.viewId;
1887
- if (typeof s != "string" || s.length === 0)
1888
- throw new R("UI diff metadata is missing viewId");
1889
- const n = t.map(
1890
- (a, _) => Ei(a ?? {}, `changes[${_}]`)
1891
- ), i = typeof r.isUpdate == "boolean" ? r.isUpdate : void 0, o = {
1892
- viewId: s,
1893
- ...i !== void 0 ? { isUpdate: i } : {}
1894
- };
1895
- return {
1896
- type: "diff",
1897
- version: e,
1898
- changes: n,
1899
- metadata: o
1900
- };
1901
- }
1902
- function ci(t, r) {
1903
- const e = t.viewId;
1904
- if (typeof e != "string" || e.length === 0)
1905
- throw new R("UI update root is missing viewId");
1906
- let s = e, n = typeof t.isUpdate == "boolean" ? t.isUpdate : void 0;
1907
- return C(r) && (typeof r.viewId == "string" && r.viewId.length > 0 && (s = r.viewId), typeof r.isUpdate == "boolean" && (n = r.isUpdate)), {
1908
- viewId: s,
1909
- ...n !== void 0 ? { isUpdate: n } : {}
1910
- };
1911
- }
1912
- class R extends Error {
1913
- constructor(r, e) {
1914
- super(r), this.causeError = e, this.name = "UiUpdateParseError", e instanceof Error && (this.stack = e.stack);
1915
- }
1916
- }
1917
- function fi(t) {
1918
- let r;
1919
- try {
1920
- r = JSON.parse(t.Json);
1921
- } catch (o) {
1922
- throw new R("Failed to parse UIUpdate.Json payload", o);
1923
- }
1924
- if (!r || typeof r != "object")
1925
- throw new R("UI update snapshot must be an object");
1926
- const { type: e, version: s } = r;
1927
- if (e !== "full" && e !== "diff")
1928
- throw new R(`Unknown UI update type: ${String(e)}`);
1929
- if (typeof s != "number")
1930
- throw new R("UI update version must be a number");
1931
- const n = e === "full" ? Ii(r.graph, r.metadata, s) : li(r.changes, r.metadata, s), i = t.Payloads ? _i(t.Payloads) : /* @__PURE__ */ new Map();
1932
- return {
1933
- snapshot: n,
1934
- payloads: i
1935
- };
1936
- }
1937
- class ui {
1938
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1939
- cache = /* @__PURE__ */ new Map();
1940
- /**
1941
- * Get a cached void handler (no payload) for a node/action combination.
1942
- * Creates and caches the handler if it doesn't exist.
1943
- */
1944
- getHandler(r, e, s) {
1945
- const n = `${r}:${e}`;
1946
- let i = this.cache.get(n);
1947
- return i || (i = () => s(e), this.cache.set(n, i)), i;
1948
- }
1949
- /**
1950
- * Get a cached handler that accepts a payload.
1951
- * Creates and caches the handler if it doesn't exist.
1952
- */
1953
- getHandlerWithPayload(r, e, s) {
1954
- const n = `${r}:${e}:payload`;
1955
- let i = this.cache.get(n);
1956
- return i || (i = (o) => s(e, o), this.cache.set(n, i)), i;
1957
- }
1958
- /**
1959
- * Get a cached handler for boolean payloads.
1960
- */
1961
- getBooleanHandler(r, e, s) {
1962
- return this.getHandlerWithPayload(r, e, s);
1963
- }
1964
- /**
1965
- * Get a cached handler for string payloads.
1966
- */
1967
- getStringHandler(r, e, s) {
1968
- return this.getHandlerWithPayload(r, e, s);
1969
- }
1970
- /**
1971
- * Get a cached handler for number payloads.
1972
- */
1973
- getNumberHandler(r, e, s) {
1974
- return this.getHandlerWithPayload(r, e, s);
1975
- }
1976
- /**
1977
- * Get a cached handler for number array payloads.
1978
- */
1979
- getNumberArrayHandler(r, e, s) {
1980
- return this.getHandlerWithPayload(r, e, s);
1981
- }
1982
- /**
1983
- * Get a cached handler for nullable boolean payloads.
1984
- */
1985
- getNullableBooleanHandler(r, e, s) {
1986
- const n = `${r}:${e}:nullable-bool`;
1987
- let i = this.cache.get(n);
1988
- return i || (i = (o) => s(e, o ?? null), this.cache.set(n, i)), i;
1989
- }
1990
- /**
1991
- * Invalidate all cached handlers for a specific node.
1992
- * Call this when a node is removed from the tree.
1993
- */
1994
- invalidateNode(r) {
1995
- const e = `${r}:`;
1996
- for (const s of this.cache.keys())
1997
- s.startsWith(e) && this.cache.delete(s);
1998
- }
1999
- /**
2000
- * Invalidate a specific handler.
2001
- */
2002
- invalidateHandler(r, e) {
2003
- this.cache.delete(`${r}:${e}`), this.cache.delete(`${r}:${e}:payload`), this.cache.delete(`${r}:${e}:nullable-bool`);
2004
- }
2005
- /**
2006
- * Clear all cached handlers.
2007
- */
2008
- clear() {
2009
- this.cache.clear();
2010
- }
2011
- /**
2012
- * Get the number of cached handlers (for debugging/testing).
2013
- */
2014
- get size() {
2015
- return this.cache.size;
2016
- }
2017
- }
2018
- class Ti {
2019
- views = /* @__PURE__ */ new Map();
2020
- listeners = /* @__PURE__ */ new Set();
2021
- payloads = /* @__PURE__ */ new Map();
2022
- snapshotMode = !1;
2023
- snapshot = {
2024
- views: /* @__PURE__ */ new Map(),
2025
- payloads: /* @__PURE__ */ new Map(),
2026
- version: -1
2027
- };
2028
- rootViewId;
2029
- // Per-node subscriptions for granular updates
2030
- nodeListeners = /* @__PURE__ */ new Map();
2031
- changedNodeIds = /* @__PURE__ */ new Set();
2032
- nodeVersions = /* @__PURE__ */ new Map();
2033
- structureChanged = !1;
2034
- // Dirty flags for lazy snapshot rebuilding - start true to ensure first snapshot builds correctly
2035
- viewsDirty = !0;
2036
- payloadsDirty = !0;
2037
- // Handler cache for stable event handlers
2038
- handlerCache = new ui();
2039
- apply(r) {
2040
- if (this.snapshotMode) {
2041
- if (r.snapshot.type !== "full")
2042
- return !1;
2043
- this.snapshotMode = !1, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.payloadsDirty = !0, this.snapshot = {
2044
- views: /* @__PURE__ */ new Map(),
2045
- payloads: /* @__PURE__ */ new Map(),
2046
- version: -1
2047
- };
2048
- }
2049
- const { snapshot: e, payloads: s } = r, { metadata: n } = e, { viewId: i } = n;
2050
- let o = this.views.get(i);
2051
- o || (o = {
2052
- version: 0
2053
- }, this.views.set(i, o));
2054
- const a = e.type === "diff" && n.isUpdate === !0;
2055
- if (e.version < o.version || e.version === o.version && !a)
2056
- return !1;
2057
- let _ = !1;
2058
- this.rootViewId || (this.rootViewId = i, _ = !0, this.structureChanged = !0);
2059
- const I = o.root;
2060
- if (e.type === "full")
2061
- o.root = e.root, o.version = e.version, _ = !0, this.viewsDirty = !0, this.structureChanged = !0, e.root && B(e.root, this.changedNodeIds);
2062
- else {
2063
- if (!I)
2064
- return !1;
2065
- const E = Ai(I, e.changes);
2066
- E !== I ? (o.root = E, _ = !0, this.viewsDirty = !0, z(I, E, this.changedNodeIds)) : o.root = E, o.version = e.version;
2067
- }
2068
- for (const [E, l] of s)
2069
- this.payloads.get(E) !== l && (this.payloads.set(E, l), _ = !0, this.payloadsDirty = !0);
2070
- return _ ? (this.commitSnapshot(), this.notify(), !0) : (o.version = e.version, !1);
2071
- }
2072
- replaceFromWire(r) {
2073
- const e = {
2074
- rootViewId: r.rootViewId,
2075
- views: new Map(r.views),
2076
- payloads: new Map(r.payloads),
2077
- version: r.version
2078
- };
2079
- return this.replaceSnapshot(e);
2080
- }
2081
- patchFromOp(r) {
2082
- this.snapshotMode = !0;
2083
- const e = r.expectedBaseVersion;
2084
- if (e !== void 0 && this.snapshot.version !== e)
2085
- return !1;
2086
- let s = !1, n = null, i = null;
2087
- const o = () => (n || (n = new Map(this.snapshot.views)), n), a = () => (i || (i = new Map(this.snapshot.payloads)), i);
2088
- if (r.deleteViews && r.deleteViews.length > 0)
2089
- for (const E of r.deleteViews)
2090
- o().delete(E) && (s = !0, this.structureChanged = !0);
2091
- if (r.upsertViews && r.upsertViews.length > 0)
2092
- for (const [E, l] of r.upsertViews) {
2093
- const c = o(), w = c.get(E);
2094
- w !== l && (c.set(E, l), s = !0, w ? z(w, l, this.changedNodeIds) : (B(l, this.changedNodeIds), this.structureChanged = !0));
2095
- }
2096
- if (r.deletePayloads && r.deletePayloads.length > 0)
2097
- for (const E of r.deletePayloads)
2098
- a().delete(E) && (s = !0);
2099
- if (r.upsertPayloads && r.upsertPayloads.length > 0)
2100
- for (const [E, l] of r.upsertPayloads) {
2101
- const c = a();
2102
- c.get(E) !== l && (c.set(E, l), s = !0);
2103
- }
2104
- const _ = r.rootViewId ?? this.snapshot.rootViewId;
2105
- _ !== this.snapshot.rootViewId && (s = !0, this.structureChanged = !0);
2106
- const I = r.nextVersion;
2107
- if (I !== this.snapshot.version && (s = !0), !s)
2108
- return this.snapshot = { ...this.snapshot, version: I }, !1;
2109
- for (const E of this.changedNodeIds)
2110
- this.nodeVersions.set(E, (this.nodeVersions.get(E) ?? 0) + 1);
2111
- return this.snapshot = {
2112
- rootViewId: _,
2113
- views: n ?? new Map(this.snapshot.views),
2114
- payloads: i ?? new Map(this.snapshot.payloads),
2115
- version: I
2116
- }, this.notify(), !0;
2117
- }
2118
- replaceSnapshot(r) {
2119
- this.snapshotMode = !0;
2120
- const e = this.snapshot, s = e.version !== r.version || e.rootViewId !== r.rootViewId || e.views.size !== r.views.size || e.payloads.size !== r.payloads.size;
2121
- (e.rootViewId !== r.rootViewId || e.views.size !== r.views.size) && (this.structureChanged = !0);
2122
- for (const [n, i] of r.views) {
2123
- const o = e.views.get(n);
2124
- o ? z(o, i, this.changedNodeIds) : (B(i, this.changedNodeIds), this.structureChanged = !0);
2125
- }
2126
- for (const n of this.changedNodeIds)
2127
- this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
2128
- return this.snapshot = r, s && this.notify(), s;
2129
- }
2130
- clear() {
2131
- (this.snapshot.rootViewId === void 0 || this.snapshot.rootViewId.length === 0) && this.snapshot.views.size === 0 && this.snapshot.payloads.size === 0 || (this.snapshotMode = !0, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.payloadsDirty = !0, this.snapshot = {
2132
- views: /* @__PURE__ */ new Map(),
2133
- payloads: /* @__PURE__ */ new Map(),
2134
- version: -1
2135
- }, this.structureChanged = !0, this.notify());
2136
- }
2137
- getSnapshot() {
2138
- return this.snapshot;
2139
- }
2140
- subscribe(r) {
2141
- return this.listeners.add(r), () => {
2142
- this.listeners.delete(r);
2143
- };
2144
- }
2145
- subscribeNode(r, e) {
2146
- let s = this.nodeListeners.get(r);
2147
- return s || (s = /* @__PURE__ */ new Set(), this.nodeListeners.set(r, s)), s.add(e), () => {
2148
- s && (s.delete(e), s.size === 0 && this.nodeListeners.delete(r));
2149
- };
2150
- }
2151
- getNode(r) {
2152
- const e = this.snapshot.views.get(r);
2153
- if (e)
2154
- return e;
2155
- for (const s of this.snapshot.views.values()) {
2156
- const n = Xt(s, r);
2157
- if (n)
2158
- return n;
2159
- }
2160
- }
2161
- getNodeVersion(r) {
2162
- return this.nodeVersions.get(r) ?? 0;
2163
- }
2164
- notifyNodes() {
2165
- if (this.changedNodeIds.size === 0 || this.nodeListeners.size === 0) {
2166
- this.changedNodeIds.clear();
2167
- return;
2168
- }
2169
- for (const r of this.changedNodeIds) {
2170
- const e = this.nodeListeners.get(r);
2171
- if (e)
2172
- for (const s of e)
2173
- s();
2174
- }
2175
- this.changedNodeIds.clear();
2176
- }
2177
- commitSnapshot() {
2178
- let r, e;
2179
- if (this.viewsDirty) {
2180
- const n = /* @__PURE__ */ new Map();
2181
- for (const [i, o] of this.views)
2182
- o.root && n.set(i, o.root);
2183
- r = n, this.viewsDirty = !1;
2184
- } else
2185
- r = this.snapshot.views;
2186
- this.payloadsDirty ? (e = new Map(this.payloads), this.payloadsDirty = !1) : e = this.snapshot.payloads;
2187
- let s = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
2188
- if (s === void 0)
2189
- for (const n of this.views.values())
2190
- s = s === void 0 ? n.version : Math.max(s, n.version);
2191
- this.snapshot = {
2192
- rootViewId: this.rootViewId,
2193
- views: r,
2194
- payloads: e,
2195
- version: s
2196
- };
2197
- for (const n of this.changedNodeIds)
2198
- this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
2199
- }
2200
- notify() {
2201
- if (this.notifyNodes(), this.structureChanged) {
2202
- this.structureChanged = !1;
2203
- for (const r of this.listeners)
2204
- r();
2205
- }
2206
- }
2207
- }
2208
- class hi {
2209
- streams = /* @__PURE__ */ new Map();
2210
- listeners = /* @__PURE__ */ new Set();
2211
- apply(r, e) {
2212
- const n = this.getOrCreateStreamEntry(r).store.apply(e);
2213
- return n && this.notify(r), n;
2214
- }
2215
- applyStoreOp(r) {
2216
- if (r.type === "ReplaceStreamSnapshot") {
2217
- const e = this.getOrCreateStreamEntry(r.snapshot.streamId), s = e.category !== r.snapshot.category;
2218
- return e.category = r.snapshot.category, e.store.replaceFromWire(r.snapshot) || s ? (this.notify(r.snapshot.streamId), !0) : !1;
2219
- }
2220
- if (r.type === "PatchStreamSnapshot") {
2221
- const e = this.getOrCreateStreamEntry(r.streamId), s = r.category !== void 0 && e.category !== r.category;
2222
- return r.category !== void 0 && (e.category = r.category), e.store.patchFromOp(r) || s ? (this.notify(r.streamId), !0) : !1;
2223
- }
2224
- if (r.type === "ClearStream") {
2225
- const e = this.streams.get(r.streamId);
2226
- return e ? (e.store.clear(), this.notify(r.streamId), !0) : !1;
2227
- }
2228
- return r.type === "RemoveStream" ? this.streams.delete(r.streamId) ? (this.notify(r.streamId), !0) : !1 : r.type === "SetStreamCategory" ? (this.setCategory(r.streamId, r.category), !0) : !1;
2229
- }
2230
- applyStoreOps(r) {
2231
- for (const e of r)
2232
- this.applyStoreOp(e);
2233
- }
2234
- clear(r) {
2235
- const e = this.streams.get(r);
2236
- e && (e.store.clear(), this.notify(r));
2237
- }
2238
- remove(r) {
2239
- this.streams.delete(r) && this.notify(r);
2240
- }
2241
- setCategory(r, e) {
2242
- const s = this.getOrCreateStreamEntry(r);
2243
- s.category !== e && (s.category = e, this.notify(r));
2244
- }
2245
- getSnapshot(r) {
2246
- const e = this.streams.get(r);
2247
- return e ? {
2248
- ...e.store.getSnapshot(),
2249
- streamId: r,
2250
- category: e.category
2251
- } : void 0;
2252
- }
2253
- getSnapshots() {
2254
- const r = [];
2255
- for (const [e, s] of this.streams) {
2256
- const n = s.store.getSnapshot();
2257
- r.push({
2258
- ...n,
2259
- streamId: e,
2260
- category: s.category
2261
- });
2262
- }
2263
- return r;
2264
- }
2265
- subscribe(r) {
2266
- return this.listeners.add(r), () => {
2267
- this.listeners.delete(r);
2268
- };
2269
- }
2270
- getOrCreateStreamEntry(r) {
2271
- let e = this.streams.get(r);
2272
- return e || (e = { store: new Ti() }, this.streams.set(r, e)), e;
2273
- }
2274
- notify(r) {
2275
- for (const e of this.listeners)
2276
- e(r);
2277
- }
2278
- }
2279
- function Ai(t, r, e) {
2280
- if (r.length === 0)
2281
- return t;
2282
- const s = /* @__PURE__ */ new Map();
2283
- for (const n of r)
2284
- s.set(n.nodeId, n);
2285
- return Kt(t, s);
2286
- }
2287
- function Kt(t, r, e) {
2288
- const s = r.get(t.id);
2289
- let n = t, i = !1;
2290
- if (s?.textUpdates && s.textUpdates.length > 0) {
2291
- const f = Ri(t, s.textUpdates);
2292
- n = f.node, i = f.changed;
2293
- }
2294
- let o = !1, a = n.props;
2295
- if (s?.changedProps && s.changedProps.size > 0)
2296
- for (const [f, A] of s.changedProps.entries()) {
2297
- const u = a[f];
2298
- if (A === void 0)
2299
- (u !== void 0 || f in a) && (o || (a = G(a), o = !0), delete a[f]);
2300
- else if (Q(A)) {
2301
- const h = G(A);
2302
- M(h, u) || (o || (a = G(a), o = !0), a[f] = h);
2303
- } else
2304
- M(A, u) || (o || (a = G(a), o = !0), a[f] = A);
2305
- }
2306
- let _ = !1, I = n.styleIds;
2307
- s?.styleIds !== void 0 && (jt(n.styleIds, s.styleIds) || (I = s.styleIds, _ = !0));
2308
- const E = n.children ?? [];
2309
- let l = E, c = !1;
2310
- if (s?.removals && s.removals.length > 0 || s?.moves && s.moves.length > 0 || s?.inserts && s.inserts.length > 0) {
2311
- const f = l.slice();
2312
- if (s?.removals && s.removals.length > 0) {
2313
- const A = [...s.removals].sort((u, h) => h.index - u.index);
2314
- for (const u of A)
2315
- if (u.index >= 0 && u.index < f.length && f[u.index].id === u.nodeId)
2316
- f.splice(u.index, 1);
2317
- else {
2318
- const h = f.findIndex((d) => d.id === u.nodeId);
2319
- h >= 0 && f.splice(h, 1);
2320
- }
2321
- c = !0;
2322
- }
2323
- if (s?.moves && s.moves.length > 0) {
2324
- const A = [...s.moves].sort((h, d) => h.toIndex - d.toIndex), u = /* @__PURE__ */ new Map();
2325
- for (const h of A) {
2326
- const d = f.findIndex((W) => W.id === h.nodeId);
2327
- d >= 0 && (u.set(h.nodeId, f[d]), f.splice(d, 1));
2328
- }
2329
- for (const h of A) {
2330
- const d = u.get(h.nodeId);
2331
- if (d) {
2332
- const W = Math.min(h.toIndex, f.length);
2333
- f.splice(W, 0, d);
2334
- }
2335
- }
2336
- c = !0;
2337
- }
2338
- if (s?.inserts && s.inserts.length > 0) {
2339
- const A = [...s.inserts].sort((u, h) => u.index - h.index);
2340
- for (const u of A) {
2341
- const h = Math.min(u.index, f.length);
2342
- f.splice(h, 0, u.node);
2343
- }
2344
- c = !0;
2345
- }
2346
- l = f;
2347
- }
2348
- let D;
2349
- for (let f = 0; f < l.length; f++) {
2350
- const A = l[f], u = Kt(A, r);
2351
- u !== A && (D || (D = l.slice()), D[f] = u);
2352
- }
2353
- return D && (l = D, c = !0), i || o || _ || c ? !o && !c && !_ ? n : {
2354
- id: t.id,
2355
- type: t.type,
2356
- props: o ? a : n.props,
2357
- children: c ? l : E,
2358
- styleIds: _ ? I : n.styleIds,
2359
- ...t.sourceMarker ? { sourceMarker: t.sourceMarker } : {}
2360
- } : t;
2361
- }
2362
- function B(t, r) {
2363
- if (r.add(t.id), t.children)
2364
- for (const e of t.children)
2365
- B(e, r);
2366
- }
2367
- const $ = [];
2368
- function Ni(t) {
2369
- for (; $.length <= t; )
2370
- $.push(/* @__PURE__ */ new Map());
2371
- return $[t].clear(), $[t];
2372
- }
2373
- function z(t, r, e) {
2374
- $t(t, r, e, 0);
2375
- }
2376
- function $t(t, r, e, s) {
2377
- if (t === r)
2378
- return;
2379
- (t.type !== r.type || !Si(t.props, r.props) || !jt(t.styleIds, r.styleIds)) && e.add(r.id);
2380
- const i = t.children ?? [], o = r.children ?? [];
2381
- if (i !== o) {
2382
- const a = Ni(s);
2383
- for (const I of i)
2384
- a.set(I.id, I);
2385
- let _ = !1;
2386
- for (let I = 0; I < o.length; I++) {
2387
- const E = o[I], l = a.get(E.id);
2388
- l ? ($t(l, E, e, s + 1), !_ && I < i.length && i[I].id !== E.id && (_ = !0)) : (B(E, e), _ = !0);
2389
- }
2390
- (i.length !== o.length || _) && e.add(r.id);
2391
- }
2392
- }
2393
- function Si(t, r) {
2394
- return M(t, r);
2395
- }
2396
- function Xt(t, r) {
2397
- if (t.id === r)
2398
- return t;
2399
- if (t.children)
2400
- for (const e of t.children) {
2401
- const s = Xt(e, r);
2402
- if (s)
2403
- return s;
2404
- }
2405
- }
2406
- function jt(t, r) {
2407
- return M(t, r);
2408
- }
2409
- function Ci(t, r) {
2410
- if (r.length === 0)
2411
- return t;
2412
- const e = [...r].sort((i, o) => i.start - o.start);
2413
- let s = t, n = 0;
2414
- for (const i of e) {
2415
- const o = it(i.start + n, 0, s.length);
2416
- if (i.end == null) {
2417
- const E = s.slice(o), l = Di(E, i.insertedText);
2418
- s = s.slice(0, o) + i.insertedText + E.slice(l), n += i.insertedText.length - l;
2419
- continue;
2420
- }
2421
- const a = i.end + n, _ = it(a, o, s.length), I = _ - o;
2422
- s = s.slice(0, o) + i.insertedText + s.slice(_), n += i.insertedText.length - I;
2423
- }
2424
- return s;
2425
- }
2426
- function Ri(t, r, e) {
2427
- if (r.length === 0)
2428
- return { node: t, changed: !1 };
2429
- const s = /* @__PURE__ */ new Map();
2430
- for (const n of r) {
2431
- const i = s.get(n.nodeId);
2432
- i ? i.push(n) : s.set(n.nodeId, [n]);
2433
- }
2434
- return Wt(t, s);
2435
- }
2436
- function Wt(t, r, e) {
2437
- const s = r.get(t.id) ?? [];
2438
- let n = !1, i = t.props;
2439
- if (s.length > 0) {
2440
- const I = /* @__PURE__ */ new Map();
2441
- for (const E of s) {
2442
- const l = I.get(E.propertyName);
2443
- l ? l.push(E) : I.set(E.propertyName, [E]);
2444
- }
2445
- for (const [E, l] of I.entries()) {
2446
- const c = i[E], D = Ci(typeof c == "string" ? c : "", l);
2447
- n || (i = G(i), n = !0), i[E] = D;
2448
- }
2449
- }
2450
- let o = !1;
2451
- const a = t.children ?? [];
2452
- let _ = a;
2453
- if (a.length > 0) {
2454
- let I;
2455
- for (let E = 0; E < a.length; E++) {
2456
- const l = a[E], c = Wt(l, r);
2457
- c.changed && (I || (I = [...a]), I[E] = c.node);
2458
- }
2459
- I && (_ = I, o = !0);
2460
- }
2461
- return !n && !o ? { node: t, changed: !1 } : {
2462
- node: {
2463
- id: t.id,
2464
- type: t.type,
2465
- props: n ? i : t.props,
2466
- children: o ? _ : a,
2467
- styleIds: t.styleIds,
2468
- ...t.sourceMarker ? { sourceMarker: t.sourceMarker } : {}
2469
- },
2470
- changed: !0
2471
- };
2472
- }
2473
- function it(t, r, e) {
2474
- return Math.max(r, Math.min(e, t));
2475
- }
2476
- function Di(t, r) {
2477
- const e = Math.min(t.length, r.length);
2478
- let s = 0;
2479
- for (; s < e && t.charCodeAt(s) === r.charCodeAt(s); )
2480
- s++;
2481
- return s;
2482
- }
2483
- function G(t) {
2484
- const r = {}, e = Object.keys(t);
2485
- for (let s = 0; s < e.length; s++) {
2486
- const n = e[s];
2487
- r[n] = t[n];
2488
- }
2489
- return r;
2490
- }
2491
- function Q(t) {
2492
- return typeof t == "object" && t !== null && !Array.isArray(t);
2493
- }
2494
- function M(t, r) {
2495
- if (Object.is(t, r))
2496
- return !0;
2497
- if (Array.isArray(t) && Array.isArray(r)) {
2498
- if (t.length !== r.length)
2499
- return !1;
2500
- for (let e = 0; e < t.length; e++)
2501
- if (!M(t[e], r[e]))
2502
- return !1;
2503
- return !0;
2504
- }
2505
- if (Q(t) && Q(r)) {
2506
- const e = Object.keys(t), s = Object.keys(r);
2507
- if (e.length !== s.length)
2508
- return !1;
2509
- for (const n of e)
2510
- if (!M(t[n], r[n]))
2511
- return !1;
2512
- return !0;
2513
- }
2514
- return !1;
2515
- }
2516
- const di = 16, wi = 50, L = new hi(), v = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map();
2517
- let zt = di, Jt = wi, V = [], x = null, H = null, U = 0, X = 0;
2518
- const g = /* @__PURE__ */ new Map();
2519
- function yi() {
2520
- return typeof performance < "u" ? performance.now() : Date.now();
2521
- }
2522
- function Ui() {
2523
- try {
2524
- return crypto.randomUUID();
2525
- } catch {
2526
- return `${Date.now()}_${Math.random().toString(16).slice(2)}`;
2527
- }
2528
- }
2529
- function Li(t) {
2530
- const r = [];
2531
- for (const s of t.views)
2532
- r.push(s);
2533
- const e = [];
2534
- for (const s of t.payloads)
2535
- e.push(s);
2536
- return {
2537
- streamId: t.streamId,
2538
- category: t.category,
2539
- version: t.version ?? -1,
2540
- rootViewId: t.rootViewId,
2541
- views: r,
2542
- payloads: e
2543
- };
2544
- }
2545
- function Oi(t, r, e) {
2546
- if (!e || e.version === -1)
2547
- return { type: "ReplaceStreamSnapshot", snapshot: Li(r) };
2548
- let s, n;
2549
- for (const [a, _] of r.views)
2550
- e.views.get(a) !== _ && (s ??= []).push([a, _]);
2551
- for (const a of e.views.keys())
2552
- r.views.has(a) || (n ??= []).push(a);
2553
- let i, o;
2554
- for (const [a, _] of r.payloads)
2555
- e.payloads.get(a) !== _ && (i ??= []).push([a, _]);
2556
- for (const a of e.payloads.keys())
2557
- r.payloads.has(a) || (o ??= []).push(a);
2558
- return {
2559
- type: "PatchStreamSnapshot",
2560
- streamId: t,
2561
- category: r.category,
2562
- nextVersion: r.version ?? -1,
2563
- expectedBaseVersion: e.version ?? -1,
2564
- rootViewId: r.rootViewId,
2565
- upsertViews: s,
2566
- deleteViews: n,
2567
- upsertPayloads: i,
2568
- deletePayloads: o
2569
- };
2570
- }
2571
- function Qt() {
2572
- x || (x = setTimeout(ot, zt)), H || (H = setTimeout(ot, Jt));
2573
- }
2574
- function P(t) {
2575
- V.push(t), Qt();
2576
- }
2577
- function ot() {
2578
- if (x && (clearTimeout(x), x = null), H && (clearTimeout(H), H = null), V.length === 0 && g.size === 0) {
2579
- U = 0, X = 0;
2580
- return;
2581
- }
2582
- const t = [];
2583
- for (const [e, s] of g)
2584
- t.push({ trackId: e, version: s.version, senderId: s.senderId });
2585
- const r = {
2586
- batchId: Ui(),
2587
- createdAtMs: yi(),
2588
- ops: V,
2589
- ...t.length > 0 ? { acks: t } : {},
2590
- stats: { uiMessagesConsumed: U, bytesConsumed: X }
2591
- };
2592
- V = [], U = 0, X = 0, g.clear(), self.postMessage(r);
2593
- }
2594
- function qt(t) {
2595
- return `${t.senderId}_${t.trackId}`;
2596
- }
2597
- async function mi(t) {
2598
- const r = await Dn(t), e = /* @__PURE__ */ new Set();
2599
- for (const s of Object.values(r.UIStreams ?? {})) {
2600
- const n = s.StreamId;
2601
- e.add(n);
2602
- const i = s.Info?.Category;
2603
- L.getSnapshot(n)?.category !== i && (L.setCategory(n, i), P({ type: "SetStreamCategory", streamId: n, category: i }));
2604
- }
2605
- for (const s of L.getSnapshots())
2606
- e.has(s.streamId) || (L.remove(s.streamId), Y.delete(s.streamId), P({ type: "RemoveStream", streamId: s.streamId }));
2607
- }
2608
- async function Pi(t) {
2609
- const r = q(t), e = qt(r), s = await ks(t), n = fi(s), i = g.get(r.trackId);
2610
- if ((i === void 0 || n.snapshot.version > i.version) && (g.set(r.trackId, { version: n.snapshot.version, senderId: r.senderId }), Qt()), !L.apply(e, n))
2611
- return;
2612
- const a = L.getSnapshot(e);
2613
- if (!a)
2614
- return;
2615
- const _ = Y.get(e);
2616
- Y.set(e, a), P(Oi(e, a, _));
2617
- }
2618
- async function gi(t) {
2619
- const r = await is(t);
2620
- if (!r.StyleId)
2621
- return;
2622
- const e = {
2623
- styleId: r.StyleId,
2624
- css: r.Style?.css,
2625
- common: r.Style?.common
2626
- }, s = v.get(e.styleId);
2627
- s && s.css === e.css && s.common === e.common || (v.set(e.styleId, e), P({ type: "UpsertUiStyle", style: e }));
2628
- }
2629
- async function Fi(t) {
2630
- const r = await fs(t);
2631
- if (r.Styles)
2632
- for (const e of r.Styles) {
2633
- if (!e.StyleId)
2634
- continue;
2635
- const s = {
2636
- styleId: e.StyleId,
2637
- css: e.Style?.css,
2638
- common: e.Style?.common
2639
- }, n = v.get(s.styleId);
2640
- n && n.css === s.css && n.common === s.common || (v.set(s.styleId, s), P({ type: "UpsertUiStyle", style: s }));
2641
- }
2642
- }
2643
- function bi(t) {
2644
- const r = q(t), e = qt(r);
2645
- L.clear(e), Y.delete(e), P({ type: "ClearStream", streamId: e });
2646
- }
2647
- async function Mi(t) {
2648
- const r = await Ls(t);
2649
- if (!(!r.StyleIds || r.StyleIds.length === 0))
2650
- for (const e of r.StyleIds)
2651
- v.delete(e) && P({ type: "RemoveUiStyle", styleId: e });
2652
- }
2653
- async function vi(t) {
2654
- const r = new Uint8Array(t);
2655
- X += r.byteLength;
2656
- const e = r;
2657
- switch (te(e)) {
2658
- case m.CORE_GLOBAL_STATE:
2659
- await mi(e), U++;
2660
- return;
2661
- case m.UI_UPDATE:
2662
- try {
2663
- await Pi(e);
2664
- } catch (n) {
2665
- return n instanceof R, void 0;
2666
- } finally {
2667
- U++;
2668
- }
2669
- return;
2670
- case m.UI_STYLES:
2671
- await gi(e), U++;
2672
- return;
2673
- case m.UI_STYLES_BATCH:
2674
- await Fi(e), U++;
2675
- return;
2676
- case m.UI_STYLES_DELETE:
2677
- await Mi(e), U++;
2678
- return;
2679
- case m.ACTION_UI_CLEAR_STREAM:
2680
- bi(e), U++;
2681
- return;
2682
- default:
2683
- return;
2684
- }
2685
- }
2686
- self.addEventListener("message", (t) => {
2687
- const r = t.data;
2688
- if (r.type === "configure") {
2689
- typeof r.flushIntervalMs == "number" && Number.isFinite(r.flushIntervalMs) && r.flushIntervalMs >= 0 && (zt = r.flushIntervalMs), typeof r.maxLatencyMs == "number" && Number.isFinite(r.maxLatencyMs) && r.maxLatencyMs >= 0 && (Jt = r.maxLatencyMs);
2690
- return;
2691
- }
2692
- if (r.type === "clear") {
2693
- V = [], Y.clear(), g.clear(), v.clear();
2694
- for (const e of L.getSnapshots())
2695
- L.remove(e.streamId);
2696
- return;
2697
- }
2698
- r.type === "protocol" && vi(r.message).catch(() => {
2699
- });
2700
- });