@ikonai/sdk-ui 1.0.66 → 1.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/ui-worker-B0-YcaZ_.js +2806 -0
- package/ikon-ui-core.d.ts +21 -0
- package/index.d.ts +2 -1
- package/index.js +1570 -1367
- package/last-snapshot-cache.d.ts +57 -0
- package/package.json +1 -1
- package/assets/ui-worker-BjXx6Rl0.js +0 -2801
|
@@ -1,2801 +0,0 @@
|
|
|
1
|
-
const te = {
|
|
2
|
-
Compressed: 8
|
|
3
|
-
};
|
|
4
|
-
function ee(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 Z(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 L = [];
|
|
17
|
-
let d = 27;
|
|
18
|
-
for (let W = 0; W < _; W++)
|
|
19
|
-
L.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: L,
|
|
27
|
-
payloadVersion: I,
|
|
28
|
-
payloadType: E,
|
|
29
|
-
flags: l
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
async function p(t, r, e) {
|
|
33
|
-
const s = K(t), n = Z(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 & te.Compressed) !== 0 && (o = await re(o)), o;
|
|
41
|
-
}
|
|
42
|
-
async function re(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 se = 161, ne = 162;
|
|
62
|
-
new TextEncoder();
|
|
63
|
-
const ie = 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] !== se || e[e.length - 1] !== ne)
|
|
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 = _e(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 oe(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
|
-
), ie.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
|
-
), tt.create(this.payload);
|
|
181
|
-
}
|
|
182
|
-
asDictionary() {
|
|
183
|
-
return this.ensureType(
|
|
184
|
-
10
|
|
185
|
-
/* Dict */
|
|
186
|
-
), et.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 oe 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 tt {
|
|
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 tt(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 = rt(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 = st(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 et {
|
|
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
|
-
Et(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 et(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 ae(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 = rt(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 = st(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 ae {
|
|
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
|
-
it(r.subarray(8, 10)),
|
|
404
|
-
it(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 !== Ee(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 Ee(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 Et(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 _e(t, r) {
|
|
482
|
-
return (t[r] | t[r + 1] << 8 | t[r + 2] << 16 | t[r + 3] << 24) >>> 0;
|
|
483
|
-
}
|
|
484
|
-
function rt(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 = Q(s, t, a, "ArrayMalformed");
|
|
498
|
-
return a - r;
|
|
499
|
-
}
|
|
500
|
-
function st(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
|
-
Et(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 = Q(e, t, o, "DictMalformed"), o = Q(s, t, o, "DictMalformed");
|
|
511
|
-
return o - r;
|
|
512
|
-
}
|
|
513
|
-
function Q(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 + rt(r, e);
|
|
529
|
-
case 10:
|
|
530
|
-
return e + st(r, e);
|
|
531
|
-
default:
|
|
532
|
-
throw new Error(`Unsupported Teleport type ${F[t]}`);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
function it(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 _t = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Opus = 1] = "Opus", t[t.Mp3 = 2] = "Mp3", t[t.RawPcm16 = 3] = "RawPcm16", t))(_t || {}), It = /* @__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))(It || {}), lt = /* @__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[t.Native = 32] = "Native", t))(lt || {}), ct = /* @__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))(ct || {}), ft = /* @__PURE__ */ ((t) => (t[t.Face = 0] = "Face", t[t.Hands = 1] = "Hands", t[t.Pose = 2] = "Pose", t[t.All = 3] = "All", t))(ft || {}), ut = /* @__PURE__ */ ((t) => (t[t.Css = 0] = "Css", t[t.Flutter = 1] = "Flutter", t))(ut || {}), Tt = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Machine = 1] = "Machine", t[t.Human = 2] = "Human", t))(Tt || {}), ht = /* @__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))(ht || {}), At = /* @__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))(At || {}), Nt = /* @__PURE__ */ ((t) => (t[t.Local = 0] = "Local", t[t.Cloud = 1] = "Cloud", t))(Nt || {}), St = /* @__PURE__ */ ((t) => (t[t.Bundle = 0] = "Bundle", t[t.GitSource = 1] = "GitSource", t))(St || {}), 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_RESET_IDLE = 65560] = "CORE_RESET_IDLE", t[t.CORE_CLIENT_DISCONNECTING = 65561] = "CORE_CLIENT_DISCONNECTING", t[t.CORE_ON_APP_READY = 65562] = "CORE_ON_APP_READY", t[t.CORE_ON_FRONTEND_RELOADED = 65563] = "CORE_ON_FRONTEND_RELOADED", t[t.CORE_WEBRTC_OFFER = 65566] = "CORE_WEBRTC_OFFER", t[t.CORE_WEBRTC_ANSWER = 65567] = "CORE_WEBRTC_ANSWER", t[t.CORE_WEBRTC_ICE_CANDIDATE = 65568] = "CORE_WEBRTC_ICE_CANDIDATE", t[t.CORE_WEBRTC_READY = 65569] = "CORE_WEBRTC_READY", t[t.CORE_WEBRTC_AUDIO_SEGMENT = 65570] = "CORE_WEBRTC_AUDIO_SEGMENT", t[t.CORE_WEBRTC_TRACK_MAP = 65571] = "CORE_WEBRTC_TRACK_MAP", t[t.CORE_WEBRTC_VIDEO_CAPTURE = 65572] = "CORE_WEBRTC_VIDEO_CAPTURE", t[t.CORE_RELAY_AGENT_AUTH = 65576] = "CORE_RELAY_AGENT_AUTH", t[t.CORE_RELAY_AGENT_AUTH_RESULT = 65577] = "CORE_RELAY_AGENT_AUTH_RESULT", t[t.CORE_RELAY_HEARTBEAT = 65578] = "CORE_RELAY_HEARTBEAT", t[t.CORE_RELAY_TCP_CONNECTION_OPENED = 65579] = "CORE_RELAY_TCP_CONNECTION_OPENED", t[t.CORE_RELAY_TCP_CONNECTION_CLOSED = 65580] = "CORE_RELAY_TCP_CONNECTION_CLOSED", t[t.CORE_RELAY_TCP_DATA = 65581] = "CORE_RELAY_TCP_DATA", t[t.CORE_RELAY_UDP_DATA = 65582] = "CORE_RELAY_UDP_DATA", t[t.CORE_RELAY_ADD_TUNNEL = 65583] = "CORE_RELAY_ADD_TUNNEL", t[t.CORE_RELAY_TUNNEL_ADDED = 65584] = "CORE_RELAY_TUNNEL_ADDED", t[t.CORE_RELAY_REMOVE_TUNNEL = 65585] = "CORE_RELAY_REMOVE_TUNNEL", t[t.CORE_IKON_SERVER_ENDPOINT_HOST_INFO = 65586] = "CORE_IKON_SERVER_ENDPOINT_HOST_INFO", t[t.CORE_CLIENT_INITIALIZATION = 65587] = "CORE_CLIENT_INITIALIZATION", t[t.CORE_CLIENT_LIFECYCLE_BATCH = 65588] = "CORE_CLIENT_LIFECYCLE_BATCH", t[t.CORE_APP_CONFIG = 65589] = "CORE_APP_CONFIG", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_IKON_RELAY_SERVER_STATS = 524297] = "ANALYTICS_IKON_RELAY_SERVER_STATS", t[t.ANALYTICS_IKON_TURN_SERVER_STATS = 524298] = "ANALYTICS_IKON_TURN_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.ACTION_URL_CHANGED = 1048642] = "ACTION_URL_CHANGED", t[t.ACTION_FILE_UPLOAD_PRE_START2 = 1048643] = "ACTION_FILE_UPLOAD_PRE_START2", t[t.ACTION_FILE_UPLOAD_PRE_START_RESPONSE2 = 1048644] = "ACTION_FILE_UPLOAD_PRE_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_START2 = 1048645] = "ACTION_FILE_UPLOAD_START2", t[t.ACTION_FILE_UPLOAD_START_RESPONSE2 = 1048646] = "ACTION_FILE_UPLOAD_START_RESPONSE2", t[t.ACTION_FILE_UPLOAD_DATA2 = 1048647] = "ACTION_FILE_UPLOAD_DATA2", t[t.ACTION_FILE_UPLOAD_ACK2 = 1048648] = "ACTION_FILE_UPLOAD_ACK2", t[t.ACTION_FILE_UPLOAD_END2 = 1048649] = "ACTION_FILE_UPLOAD_END2", t[t.ACTION_FILE_UPLOAD_COMPLETE2 = 1048650] = "ACTION_FILE_UPLOAD_COMPLETE2", t[t.ACTION_FUNCTION_ENUMERATION_ITEM_BATCH = 1048651] = "ACTION_FUNCTION_ENUMERATION_ITEM_BATCH", t[t.ACTION_CALL_ACK = 1048652] = "ACTION_CALL_ACK", t[t.ACTION_TRIGGER_CRON = 1048653] = "ACTION_TRIGGER_CRON", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.AUDIO_SHAPE_FRAME = 4194310] = "AUDIO_SHAPE_FRAME", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.GROUP_APP_LOCAL = 1073741824] = "GROUP_APP_LOCAL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(m || {});
|
|
542
|
-
const Ie = 161083277, le = 265814330, ce = 1368629611, fe = 2431514951, ue = 2514959030, Te = 2745379226, he = 3282782683, Ae = 3284746250, Ne = 4101844078;
|
|
543
|
-
function Ct(t) {
|
|
544
|
-
const r = {};
|
|
545
|
-
return Dt(r), r;
|
|
546
|
-
}
|
|
547
|
-
function Dt(t) {
|
|
548
|
-
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = _t.Unknown, t.CodecDetails = "", t.SampleRate = 0, t.Channels = 0, t.ShapeSets = void 0, t.CorrelationId = void 0, t;
|
|
549
|
-
}
|
|
550
|
-
function Se(t, r) {
|
|
551
|
-
const e = r ?? Ct();
|
|
552
|
-
return Dt(e), Ce(t, e), e;
|
|
553
|
-
}
|
|
554
|
-
function Ce(t, r) {
|
|
555
|
-
let e;
|
|
556
|
-
for (; (e = t.next()) !== null; )
|
|
557
|
-
switch (e.fieldId) {
|
|
558
|
-
case Ie: {
|
|
559
|
-
if (e.isNull) throw new Error();
|
|
560
|
-
r.StreamId = e.asString();
|
|
561
|
-
break;
|
|
562
|
-
}
|
|
563
|
-
case le: {
|
|
564
|
-
if (e.isNull) {
|
|
565
|
-
r.ShapeSets = void 0;
|
|
566
|
-
break;
|
|
567
|
-
}
|
|
568
|
-
r.ShapeSets = De(e.asArray());
|
|
569
|
-
break;
|
|
570
|
-
}
|
|
571
|
-
case ce: {
|
|
572
|
-
if (e.isNull) throw new Error();
|
|
573
|
-
r.Description = e.asString();
|
|
574
|
-
break;
|
|
575
|
-
}
|
|
576
|
-
case fe: {
|
|
577
|
-
if (e.isNull) throw new Error();
|
|
578
|
-
r.Channels = e.asInt32();
|
|
579
|
-
break;
|
|
580
|
-
}
|
|
581
|
-
case ue: {
|
|
582
|
-
if (e.isNull) {
|
|
583
|
-
r.CorrelationId = void 0;
|
|
584
|
-
break;
|
|
585
|
-
}
|
|
586
|
-
r.CorrelationId = e.asString();
|
|
587
|
-
break;
|
|
588
|
-
}
|
|
589
|
-
case Te: {
|
|
590
|
-
if (e.isNull) throw new Error();
|
|
591
|
-
r.CodecDetails = e.asString();
|
|
592
|
-
break;
|
|
593
|
-
}
|
|
594
|
-
case he: {
|
|
595
|
-
if (e.isNull) throw new Error();
|
|
596
|
-
r.SourceType = e.asString();
|
|
597
|
-
break;
|
|
598
|
-
}
|
|
599
|
-
case Ae: {
|
|
600
|
-
if (e.isNull) throw new Error();
|
|
601
|
-
r.Codec = e.asInt32();
|
|
602
|
-
break;
|
|
603
|
-
}
|
|
604
|
-
case Ne: {
|
|
605
|
-
if (e.isNull) throw new Error();
|
|
606
|
-
r.SampleRate = e.asInt32();
|
|
607
|
-
break;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
function De(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, we = 1185721362;
|
|
619
|
-
function Le(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 ?? Le();
|
|
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 we: {
|
|
645
|
-
if (e.isNull) throw new Error();
|
|
646
|
-
r.ShapeNames = Oe(e.asArray());
|
|
647
|
-
break;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
function Oe(t) {
|
|
652
|
-
const r = [];
|
|
653
|
-
let e;
|
|
654
|
-
for (; (e = t.next()) !== null; )
|
|
655
|
-
r.push(e.asString());
|
|
656
|
-
return r;
|
|
657
|
-
}
|
|
658
|
-
const me = 76337612, Pe = 185396121, ge = 250031587, Fe = 388632637, be = 417197284, Me = 425972532, ve = 469070965, ke = 470595159, Ge = 594855258, Be = 617065367, Ve = 661691032, xe = 781727218, He = 834078886, Ye = 1043273762, pe = 1236999138, Ke = 1286979607, $e = 1368629611, Xe = 1437068682, je = 1715899485, We = 1942830531, ze = 1999510636, Je = 2033288346, Qe = 2079864626, qe = 2142346422, Ze = 2228539873, tr = 2232517119, er = 2598291686, rr = 2719718823, sr = 2810953526, nr = 2840065720, ir = 2885165957, or = 3542818975, ar = 3586157513, Er = 3717933110, _r = 4062655306;
|
|
659
|
-
function Ir(t) {
|
|
660
|
-
const r = {};
|
|
661
|
-
return dt(r), r;
|
|
662
|
-
}
|
|
663
|
-
function dt(t) {
|
|
664
|
-
return t.ContextType = lt.Unknown, t.UserType = Tt.Unknown, t.PayloadType = ct.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 = It.Unknown, t.UniqueSessionId = "", t.Parameters = /* @__PURE__ */ Object.create(null), t.SdkType = At.Unknown, t.SdkCapability = 0, t.ViewportWidth = 0, t.ViewportHeight = 0, t.Theme = "", t.Timezone = "", t.IsTouchDevice = !1, t.InitialPath = "", t.StyleFormat = ut.Css, t.SupportsCompression = !0, t.IsSoftDisconnected = !1, t.SoftDisconnectAt = 0n, t;
|
|
665
|
-
}
|
|
666
|
-
function lr(t, r) {
|
|
667
|
-
const e = r ?? Ir();
|
|
668
|
-
return dt(e), cr(t, e), e;
|
|
669
|
-
}
|
|
670
|
-
function cr(t, r) {
|
|
671
|
-
let e;
|
|
672
|
-
for (; (e = t.next()) !== null; )
|
|
673
|
-
switch (e.fieldId) {
|
|
674
|
-
case me: {
|
|
675
|
-
if (e.isNull) throw new Error();
|
|
676
|
-
r.DeviceId = e.asString();
|
|
677
|
-
break;
|
|
678
|
-
}
|
|
679
|
-
case Pe: {
|
|
680
|
-
if (e.isNull) throw new Error();
|
|
681
|
-
r.InstallId = e.asString();
|
|
682
|
-
break;
|
|
683
|
-
}
|
|
684
|
-
case ge: {
|
|
685
|
-
if (e.isNull) throw new Error();
|
|
686
|
-
r.Theme = e.asString();
|
|
687
|
-
break;
|
|
688
|
-
}
|
|
689
|
-
case Fe: {
|
|
690
|
-
if (e.isNull) throw new Error();
|
|
691
|
-
r.UserAgent = e.asString();
|
|
692
|
-
break;
|
|
693
|
-
}
|
|
694
|
-
case be: {
|
|
695
|
-
if (e.isNull) throw new Error();
|
|
696
|
-
r.ContextType = e.asInt32();
|
|
697
|
-
break;
|
|
698
|
-
}
|
|
699
|
-
case Me: {
|
|
700
|
-
if (e.isNull) throw new Error();
|
|
701
|
-
r.SoftDisconnectAt = e.asUInt64();
|
|
702
|
-
break;
|
|
703
|
-
}
|
|
704
|
-
case ve: {
|
|
705
|
-
if (e.isNull) throw new Error();
|
|
706
|
-
r.HasInput = e.asBool();
|
|
707
|
-
break;
|
|
708
|
-
}
|
|
709
|
-
case ke: {
|
|
710
|
-
if (e.isNull) throw new Error();
|
|
711
|
-
r.UserType = e.asInt32();
|
|
712
|
-
break;
|
|
713
|
-
}
|
|
714
|
-
case Ge: {
|
|
715
|
-
if (e.isNull) throw new Error();
|
|
716
|
-
r.InitialPath = e.asString();
|
|
717
|
-
break;
|
|
718
|
-
}
|
|
719
|
-
case Be: {
|
|
720
|
-
if (e.isNull) throw new Error();
|
|
721
|
-
r.IsSoftDisconnected = e.asBool();
|
|
722
|
-
break;
|
|
723
|
-
}
|
|
724
|
-
case Ve: {
|
|
725
|
-
if (e.isNull) throw new Error();
|
|
726
|
-
r.SupportsCompression = e.asBool();
|
|
727
|
-
break;
|
|
728
|
-
}
|
|
729
|
-
case xe: {
|
|
730
|
-
if (e.isNull) throw new Error();
|
|
731
|
-
r.UserId = e.asString();
|
|
732
|
-
break;
|
|
733
|
-
}
|
|
734
|
-
case He: {
|
|
735
|
-
if (e.isNull) throw new Error();
|
|
736
|
-
r.ProductId = e.asString();
|
|
737
|
-
break;
|
|
738
|
-
}
|
|
739
|
-
case Ye: {
|
|
740
|
-
if (e.isNull) throw new Error();
|
|
741
|
-
r.AuthSessionId = e.asString();
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
case pe: {
|
|
745
|
-
if (e.isNull) throw new Error();
|
|
746
|
-
r.ReceiveAllMessages = e.asBool();
|
|
747
|
-
break;
|
|
748
|
-
}
|
|
749
|
-
case Ke: {
|
|
750
|
-
if (e.isNull) throw new Error();
|
|
751
|
-
r.ViewportHeight = e.asInt32();
|
|
752
|
-
break;
|
|
753
|
-
}
|
|
754
|
-
case $e: {
|
|
755
|
-
if (e.isNull) throw new Error();
|
|
756
|
-
r.Description = e.asString();
|
|
757
|
-
break;
|
|
758
|
-
}
|
|
759
|
-
case Xe: {
|
|
760
|
-
if (e.isNull) throw new Error();
|
|
761
|
-
r.SdkCapability = e.asInt32();
|
|
762
|
-
break;
|
|
763
|
-
}
|
|
764
|
-
case je: {
|
|
765
|
-
if (e.isNull) throw new Error();
|
|
766
|
-
r.Locale = e.asString();
|
|
767
|
-
break;
|
|
768
|
-
}
|
|
769
|
-
case We: {
|
|
770
|
-
if (e.isNull) throw new Error();
|
|
771
|
-
r.SdkType = e.asInt32();
|
|
772
|
-
break;
|
|
773
|
-
}
|
|
774
|
-
case ze: {
|
|
775
|
-
if (e.isNull) throw new Error();
|
|
776
|
-
r.SessionId = e.asInt32();
|
|
777
|
-
break;
|
|
778
|
-
}
|
|
779
|
-
case Je: {
|
|
780
|
-
if (e.isNull) throw new Error();
|
|
781
|
-
r.ViewportWidth = e.asInt32();
|
|
782
|
-
break;
|
|
783
|
-
}
|
|
784
|
-
case Qe: {
|
|
785
|
-
if (e.isNull) throw new Error();
|
|
786
|
-
r.PreciseJoinedAt = e.asUInt64();
|
|
787
|
-
break;
|
|
788
|
-
}
|
|
789
|
-
case qe: {
|
|
790
|
-
if (e.isNull) throw new Error();
|
|
791
|
-
r.PayloadType = e.asInt32();
|
|
792
|
-
break;
|
|
793
|
-
}
|
|
794
|
-
case Ze: {
|
|
795
|
-
if (e.isNull) throw new Error();
|
|
796
|
-
r.StyleFormat = e.asInt32();
|
|
797
|
-
break;
|
|
798
|
-
}
|
|
799
|
-
case tr: {
|
|
800
|
-
if (e.isNull) throw new Error();
|
|
801
|
-
r.IsTouchDevice = e.asBool();
|
|
802
|
-
break;
|
|
803
|
-
}
|
|
804
|
-
case er: {
|
|
805
|
-
if (e.isNull) throw new Error();
|
|
806
|
-
r.VersionId = e.asString();
|
|
807
|
-
break;
|
|
808
|
-
}
|
|
809
|
-
case rr: {
|
|
810
|
-
if (e.isNull) throw new Error();
|
|
811
|
-
r.UniqueSessionId = e.asString();
|
|
812
|
-
break;
|
|
813
|
-
}
|
|
814
|
-
case sr: {
|
|
815
|
-
if (e.isNull) throw new Error();
|
|
816
|
-
r.ClientType = e.asInt32();
|
|
817
|
-
break;
|
|
818
|
-
}
|
|
819
|
-
case nr: {
|
|
820
|
-
if (e.isNull) throw new Error();
|
|
821
|
-
r.IsReady = e.asBool();
|
|
822
|
-
break;
|
|
823
|
-
}
|
|
824
|
-
case ir: {
|
|
825
|
-
if (e.isNull) throw new Error();
|
|
826
|
-
r.Parameters = fr(e.asDictionary());
|
|
827
|
-
break;
|
|
828
|
-
}
|
|
829
|
-
case or: {
|
|
830
|
-
if (e.isNull) throw new Error();
|
|
831
|
-
r.Timezone = e.asString();
|
|
832
|
-
break;
|
|
833
|
-
}
|
|
834
|
-
case ar: {
|
|
835
|
-
if (e.isNull) throw new Error();
|
|
836
|
-
r.IsInternal = e.asBool();
|
|
837
|
-
break;
|
|
838
|
-
}
|
|
839
|
-
case Er: {
|
|
840
|
-
if (e.isNull) throw new Error();
|
|
841
|
-
r.ChannelLocale = e.asString();
|
|
842
|
-
break;
|
|
843
|
-
}
|
|
844
|
-
case _r: {
|
|
845
|
-
if (e.isNull) throw new Error();
|
|
846
|
-
r.EmbeddedSpaceId = e.asString();
|
|
847
|
-
break;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
function fr(t) {
|
|
852
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
853
|
-
let e;
|
|
854
|
-
for (; (e = t.next()) !== null; ) {
|
|
855
|
-
const s = e.key.asString();
|
|
856
|
-
r[s] = e.value.asString();
|
|
857
|
-
}
|
|
858
|
-
return r;
|
|
859
|
-
}
|
|
860
|
-
const ur = 703025676, Tr = 814454131, hr = 972460562, Ar = 976255570, Nr = 1368629611, Sr = 1479280922, Cr = 1533537016, Dr = 1909301063, Rr = 2274386296, dr = 2603556958, wr = 2885165957, Lr = 3568439632;
|
|
861
|
-
function yr(t) {
|
|
862
|
-
const r = {};
|
|
863
|
-
return wt(r), r;
|
|
864
|
-
}
|
|
865
|
-
function wt(t) {
|
|
866
|
-
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;
|
|
867
|
-
}
|
|
868
|
-
function Ur(t, r) {
|
|
869
|
-
const e = r ?? yr();
|
|
870
|
-
return wt(e), Or(t, e), e;
|
|
871
|
-
}
|
|
872
|
-
function Or(t, r) {
|
|
873
|
-
let e;
|
|
874
|
-
for (; (e = t.next()) !== null; )
|
|
875
|
-
switch (e.fieldId) {
|
|
876
|
-
case ur: {
|
|
877
|
-
if (e.isNull) throw new Error();
|
|
878
|
-
r.ResultTypeName = e.asString();
|
|
879
|
-
break;
|
|
880
|
-
}
|
|
881
|
-
case Tr: {
|
|
882
|
-
if (e.isNull) throw new Error();
|
|
883
|
-
r.FunctionName = e.asString();
|
|
884
|
-
break;
|
|
885
|
-
}
|
|
886
|
-
case hr: {
|
|
887
|
-
if (e.isNull) throw new Error();
|
|
888
|
-
r.EnumerableItemTypeName = e.asString();
|
|
889
|
-
break;
|
|
890
|
-
}
|
|
891
|
-
case Ar: {
|
|
892
|
-
if (e.isNull) throw new Error();
|
|
893
|
-
r.FunctionId = e.asGuid();
|
|
894
|
-
break;
|
|
895
|
-
}
|
|
896
|
-
case Nr: {
|
|
897
|
-
if (e.isNull) throw new Error();
|
|
898
|
-
r.Description = e.asString();
|
|
899
|
-
break;
|
|
900
|
-
}
|
|
901
|
-
case Sr: {
|
|
902
|
-
if (e.isNull) throw new Error();
|
|
903
|
-
r.IsCancellable = e.asBool();
|
|
904
|
-
break;
|
|
905
|
-
}
|
|
906
|
-
case Cr: {
|
|
907
|
-
if (e.isNull) throw new Error();
|
|
908
|
-
r.RequiresInstance = e.asBool();
|
|
909
|
-
break;
|
|
910
|
-
}
|
|
911
|
-
case Dr: {
|
|
912
|
-
if (e.isNull) throw new Error();
|
|
913
|
-
r.Versions = mr(e.asArray());
|
|
914
|
-
break;
|
|
915
|
-
}
|
|
916
|
-
case Rr: {
|
|
917
|
-
if (e.isNull) throw new Error();
|
|
918
|
-
r.LlmInlineResult = e.asBool();
|
|
919
|
-
break;
|
|
920
|
-
}
|
|
921
|
-
case dr: {
|
|
922
|
-
if (e.isNull) throw new Error();
|
|
923
|
-
r.IsEnumerable = e.asBool();
|
|
924
|
-
break;
|
|
925
|
-
}
|
|
926
|
-
case wr: {
|
|
927
|
-
if (e.isNull) throw new Error();
|
|
928
|
-
r.Parameters = Pr(e.asArray());
|
|
929
|
-
break;
|
|
930
|
-
}
|
|
931
|
-
case Lr: {
|
|
932
|
-
if (e.isNull) throw new Error();
|
|
933
|
-
r.LlmCallOnlyOnce = e.asBool();
|
|
934
|
-
break;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
function mr(t) {
|
|
939
|
-
const r = [];
|
|
940
|
-
let e;
|
|
941
|
-
for (; (e = t.next()) !== null; )
|
|
942
|
-
r.push(e.asString());
|
|
943
|
-
return r;
|
|
944
|
-
}
|
|
945
|
-
function Pr(t) {
|
|
946
|
-
const r = [];
|
|
947
|
-
let e;
|
|
948
|
-
for (; (e = t.next()) !== null; )
|
|
949
|
-
r.push(Hr(e.asObject()));
|
|
950
|
-
return r;
|
|
951
|
-
}
|
|
952
|
-
const gr = 607861992, Fr = 894485888, br = 972460562, Mr = 1368629611, vr = 1883521406, kr = 2603556958, Gr = 3609695522, Br = 4075263697, Vr = 4257460908;
|
|
953
|
-
function xr(t) {
|
|
954
|
-
const r = {};
|
|
955
|
-
return Lt(r), r;
|
|
956
|
-
}
|
|
957
|
-
function Lt(t) {
|
|
958
|
-
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;
|
|
959
|
-
}
|
|
960
|
-
function Hr(t, r) {
|
|
961
|
-
const e = r ?? xr();
|
|
962
|
-
return Lt(e), Yr(t, e), e;
|
|
963
|
-
}
|
|
964
|
-
function Yr(t, r) {
|
|
965
|
-
let e;
|
|
966
|
-
for (; (e = t.next()) !== null; )
|
|
967
|
-
switch (e.fieldId) {
|
|
968
|
-
case gr: {
|
|
969
|
-
if (e.isNull) throw new Error();
|
|
970
|
-
r.HasDefaultValue = e.asBool();
|
|
971
|
-
break;
|
|
972
|
-
}
|
|
973
|
-
case Fr: {
|
|
974
|
-
if (e.isNull) throw new Error();
|
|
975
|
-
r.DefaultValueJson = e.asString();
|
|
976
|
-
break;
|
|
977
|
-
}
|
|
978
|
-
case br: {
|
|
979
|
-
if (e.isNull) throw new Error();
|
|
980
|
-
r.EnumerableItemTypeName = e.asString();
|
|
981
|
-
break;
|
|
982
|
-
}
|
|
983
|
-
case Mr: {
|
|
984
|
-
if (e.isNull) throw new Error();
|
|
985
|
-
r.Description = e.asString();
|
|
986
|
-
break;
|
|
987
|
-
}
|
|
988
|
-
case vr: {
|
|
989
|
-
if (e.isNull) throw new Error();
|
|
990
|
-
r.DefaultValueData = e.asBinary();
|
|
991
|
-
break;
|
|
992
|
-
}
|
|
993
|
-
case kr: {
|
|
994
|
-
if (e.isNull) throw new Error();
|
|
995
|
-
r.IsEnumerable = e.asBool();
|
|
996
|
-
break;
|
|
997
|
-
}
|
|
998
|
-
case Gr: {
|
|
999
|
-
if (e.isNull) throw new Error();
|
|
1000
|
-
r.TypeName = e.asString();
|
|
1001
|
-
break;
|
|
1002
|
-
}
|
|
1003
|
-
case Br: {
|
|
1004
|
-
if (e.isNull) throw new Error();
|
|
1005
|
-
r.ParameterName = e.asString();
|
|
1006
|
-
break;
|
|
1007
|
-
}
|
|
1008
|
-
case Vr: {
|
|
1009
|
-
if (e.isNull) throw new Error();
|
|
1010
|
-
r.ParameterIndex = e.asInt32();
|
|
1011
|
-
break;
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
const pr = 3167053791, Kr = 3342364356, $r = 3612929027;
|
|
1016
|
-
function yt(t) {
|
|
1017
|
-
const r = {};
|
|
1018
|
-
return Ut(r), r;
|
|
1019
|
-
}
|
|
1020
|
-
function Ut(t) {
|
|
1021
|
-
return t.Category = "", t.Type = ft.Face, t.FaceBlendshapes = [], t;
|
|
1022
|
-
}
|
|
1023
|
-
function Xr(t, r) {
|
|
1024
|
-
const e = r ?? yt();
|
|
1025
|
-
return Ut(e), jr(t, e), e;
|
|
1026
|
-
}
|
|
1027
|
-
function jr(t, r) {
|
|
1028
|
-
let e;
|
|
1029
|
-
for (; (e = t.next()) !== null; )
|
|
1030
|
-
switch (e.fieldId) {
|
|
1031
|
-
case pr: {
|
|
1032
|
-
if (e.isNull) throw new Error();
|
|
1033
|
-
r.Type = e.asInt32();
|
|
1034
|
-
break;
|
|
1035
|
-
}
|
|
1036
|
-
case Kr: {
|
|
1037
|
-
if (e.isNull) throw new Error();
|
|
1038
|
-
r.FaceBlendshapes = Wr(e.asArray());
|
|
1039
|
-
break;
|
|
1040
|
-
}
|
|
1041
|
-
case $r: {
|
|
1042
|
-
if (e.isNull) throw new Error();
|
|
1043
|
-
r.Category = e.asString();
|
|
1044
|
-
break;
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
function Wr(t) {
|
|
1049
|
-
const r = [];
|
|
1050
|
-
let e;
|
|
1051
|
-
for (; (e = t.next()) !== null; )
|
|
1052
|
-
r.push(e.asString());
|
|
1053
|
-
return r;
|
|
1054
|
-
}
|
|
1055
|
-
const zr = 1405462580, Jr = 2968276160;
|
|
1056
|
-
function Qr(t) {
|
|
1057
|
-
const r = {};
|
|
1058
|
-
return Ot(r), r;
|
|
1059
|
-
}
|
|
1060
|
-
function Ot(t) {
|
|
1061
|
-
return t.MimeType = "", t.Value = new Uint8Array(0), t;
|
|
1062
|
-
}
|
|
1063
|
-
function qr(t, r) {
|
|
1064
|
-
const e = r ?? Qr();
|
|
1065
|
-
return Ot(e), Zr(t, e), e;
|
|
1066
|
-
}
|
|
1067
|
-
function Zr(t, r) {
|
|
1068
|
-
let e;
|
|
1069
|
-
for (; (e = t.next()) !== null; )
|
|
1070
|
-
switch (e.fieldId) {
|
|
1071
|
-
case zr: {
|
|
1072
|
-
if (e.isNull) throw new Error();
|
|
1073
|
-
r.Value = e.asBinary();
|
|
1074
|
-
break;
|
|
1075
|
-
}
|
|
1076
|
-
case Jr: {
|
|
1077
|
-
if (e.isNull) throw new Error();
|
|
1078
|
-
r.MimeType = e.asString();
|
|
1079
|
-
break;
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
const ts = 3612929027;
|
|
1084
|
-
function mt(t) {
|
|
1085
|
-
const r = {};
|
|
1086
|
-
return Pt(r), r;
|
|
1087
|
-
}
|
|
1088
|
-
function Pt(t) {
|
|
1089
|
-
return t.Category = "", t;
|
|
1090
|
-
}
|
|
1091
|
-
function es(t, r) {
|
|
1092
|
-
const e = r ?? mt();
|
|
1093
|
-
return Pt(e), rs(t, e), e;
|
|
1094
|
-
}
|
|
1095
|
-
function rs(t, r) {
|
|
1096
|
-
let e;
|
|
1097
|
-
for (; (e = t.next()) !== null; )
|
|
1098
|
-
switch (e.fieldId) {
|
|
1099
|
-
case ts: {
|
|
1100
|
-
if (e.isNull) throw new Error();
|
|
1101
|
-
r.Category = e.asString();
|
|
1102
|
-
break;
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
const ss = 2097188, ns = 979822885, is = 2374537704;
|
|
1107
|
-
function os(t) {
|
|
1108
|
-
const r = {};
|
|
1109
|
-
return gt(r), r;
|
|
1110
|
-
}
|
|
1111
|
-
function gt(t) {
|
|
1112
|
-
return t.StyleId = "", t.Style = /* @__PURE__ */ Object.create(null), t;
|
|
1113
|
-
}
|
|
1114
|
-
function as(t, r) {
|
|
1115
|
-
const e = O.create(t);
|
|
1116
|
-
return Es(e, r);
|
|
1117
|
-
}
|
|
1118
|
-
function Es(t, r) {
|
|
1119
|
-
const e = r ?? os();
|
|
1120
|
-
return gt(e), _s(t, e), e;
|
|
1121
|
-
}
|
|
1122
|
-
function _s(t, r) {
|
|
1123
|
-
let e;
|
|
1124
|
-
for (; (e = t.next()) !== null; )
|
|
1125
|
-
switch (e.fieldId) {
|
|
1126
|
-
case ns: {
|
|
1127
|
-
if (e.isNull) throw new Error();
|
|
1128
|
-
r.StyleId = e.asString();
|
|
1129
|
-
break;
|
|
1130
|
-
}
|
|
1131
|
-
case is: {
|
|
1132
|
-
if (e.isNull) throw new Error();
|
|
1133
|
-
r.Style = ls(e.asDictionary());
|
|
1134
|
-
break;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
async function Is(t, r) {
|
|
1139
|
-
const e = await p(t, ss);
|
|
1140
|
-
return as(e, r);
|
|
1141
|
-
}
|
|
1142
|
-
function ls(t) {
|
|
1143
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1144
|
-
let e;
|
|
1145
|
-
for (; (e = t.next()) !== null; ) {
|
|
1146
|
-
const s = e.key.asString();
|
|
1147
|
-
r[s] = e.value.asString();
|
|
1148
|
-
}
|
|
1149
|
-
return r;
|
|
1150
|
-
}
|
|
1151
|
-
const cs = 2097192, fs = 2136687806;
|
|
1152
|
-
function us(t) {
|
|
1153
|
-
const r = {};
|
|
1154
|
-
return Ft(r), r;
|
|
1155
|
-
}
|
|
1156
|
-
function Ft(t) {
|
|
1157
|
-
return t.Styles = [], t;
|
|
1158
|
-
}
|
|
1159
|
-
function Ts(t, r) {
|
|
1160
|
-
const e = O.create(t);
|
|
1161
|
-
return hs(e, r);
|
|
1162
|
-
}
|
|
1163
|
-
function hs(t, r) {
|
|
1164
|
-
const e = r ?? us();
|
|
1165
|
-
return Ft(e), As(t, e), e;
|
|
1166
|
-
}
|
|
1167
|
-
function As(t, r) {
|
|
1168
|
-
let e;
|
|
1169
|
-
for (; (e = t.next()) !== null; )
|
|
1170
|
-
switch (e.fieldId) {
|
|
1171
|
-
case fs: {
|
|
1172
|
-
if (e.isNull) throw new Error();
|
|
1173
|
-
r.Styles = Ss(e.asArray());
|
|
1174
|
-
break;
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
async function Ns(t, r) {
|
|
1179
|
-
const e = await p(t, cs);
|
|
1180
|
-
return Ts(e, r);
|
|
1181
|
-
}
|
|
1182
|
-
function Ss(t) {
|
|
1183
|
-
const r = [];
|
|
1184
|
-
let e;
|
|
1185
|
-
for (; (e = t.next()) !== null; )
|
|
1186
|
-
r.push(ds(e.asObject()));
|
|
1187
|
-
return r;
|
|
1188
|
-
}
|
|
1189
|
-
const Cs = 979822885, Ds = 2374537704;
|
|
1190
|
-
function Rs(t) {
|
|
1191
|
-
const r = {};
|
|
1192
|
-
return bt(r), r;
|
|
1193
|
-
}
|
|
1194
|
-
function bt(t) {
|
|
1195
|
-
return t.StyleId = "", t.Style = /* @__PURE__ */ Object.create(null), t;
|
|
1196
|
-
}
|
|
1197
|
-
function ds(t, r) {
|
|
1198
|
-
const e = r ?? Rs();
|
|
1199
|
-
return bt(e), ws(t, e), e;
|
|
1200
|
-
}
|
|
1201
|
-
function ws(t, r) {
|
|
1202
|
-
let e;
|
|
1203
|
-
for (; (e = t.next()) !== null; )
|
|
1204
|
-
switch (e.fieldId) {
|
|
1205
|
-
case Cs: {
|
|
1206
|
-
if (e.isNull) throw new Error();
|
|
1207
|
-
r.StyleId = e.asString();
|
|
1208
|
-
break;
|
|
1209
|
-
}
|
|
1210
|
-
case Ds: {
|
|
1211
|
-
if (e.isNull) throw new Error();
|
|
1212
|
-
r.Style = Ls(e.asDictionary());
|
|
1213
|
-
break;
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
function Ls(t) {
|
|
1218
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1219
|
-
let e;
|
|
1220
|
-
for (; (e = t.next()) !== null; ) {
|
|
1221
|
-
const s = e.key.asString();
|
|
1222
|
-
r[s] = e.value.asString();
|
|
1223
|
-
}
|
|
1224
|
-
return r;
|
|
1225
|
-
}
|
|
1226
|
-
const ys = 2097193, Us = 1415642792;
|
|
1227
|
-
function Os(t) {
|
|
1228
|
-
const r = {};
|
|
1229
|
-
return Mt(r), r;
|
|
1230
|
-
}
|
|
1231
|
-
function Mt(t) {
|
|
1232
|
-
return t.StyleIds = [], t;
|
|
1233
|
-
}
|
|
1234
|
-
function ms(t, r) {
|
|
1235
|
-
const e = O.create(t);
|
|
1236
|
-
return Ps(e, r);
|
|
1237
|
-
}
|
|
1238
|
-
function Ps(t, r) {
|
|
1239
|
-
const e = r ?? Os();
|
|
1240
|
-
return Mt(e), gs(t, e), e;
|
|
1241
|
-
}
|
|
1242
|
-
function gs(t, r) {
|
|
1243
|
-
let e;
|
|
1244
|
-
for (; (e = t.next()) !== null; )
|
|
1245
|
-
switch (e.fieldId) {
|
|
1246
|
-
case Us: {
|
|
1247
|
-
if (e.isNull) throw new Error();
|
|
1248
|
-
r.StyleIds = bs(e.asArray());
|
|
1249
|
-
break;
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
async function Fs(t, r) {
|
|
1254
|
-
const e = await p(t, ys);
|
|
1255
|
-
return ms(e, r);
|
|
1256
|
-
}
|
|
1257
|
-
function bs(t) {
|
|
1258
|
-
const r = [];
|
|
1259
|
-
let e;
|
|
1260
|
-
for (; (e = t.next()) !== null; )
|
|
1261
|
-
r.push(e.asString());
|
|
1262
|
-
return r;
|
|
1263
|
-
}
|
|
1264
|
-
const Ms = 2097190, vs = 425183262, ks = 653781469;
|
|
1265
|
-
function Gs(t) {
|
|
1266
|
-
const r = {};
|
|
1267
|
-
return vt(r), r;
|
|
1268
|
-
}
|
|
1269
|
-
function vt(t) {
|
|
1270
|
-
return t.Json = "", t.Payloads = /* @__PURE__ */ Object.create(null), t;
|
|
1271
|
-
}
|
|
1272
|
-
function Bs(t, r) {
|
|
1273
|
-
const e = O.create(t);
|
|
1274
|
-
return Vs(e, r);
|
|
1275
|
-
}
|
|
1276
|
-
function Vs(t, r) {
|
|
1277
|
-
const e = r ?? Gs();
|
|
1278
|
-
return vt(e), xs(t, e), e;
|
|
1279
|
-
}
|
|
1280
|
-
function xs(t, r) {
|
|
1281
|
-
let e;
|
|
1282
|
-
for (; (e = t.next()) !== null; )
|
|
1283
|
-
switch (e.fieldId) {
|
|
1284
|
-
case vs: {
|
|
1285
|
-
if (e.isNull) throw new Error();
|
|
1286
|
-
r.Json = e.asString();
|
|
1287
|
-
break;
|
|
1288
|
-
}
|
|
1289
|
-
case ks: {
|
|
1290
|
-
if (e.isNull) throw new Error();
|
|
1291
|
-
r.Payloads = Ys(e.asDictionary());
|
|
1292
|
-
break;
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
async function Hs(t, r) {
|
|
1297
|
-
const e = await p(t, Ms);
|
|
1298
|
-
return Bs(e, r);
|
|
1299
|
-
}
|
|
1300
|
-
function Ys(t) {
|
|
1301
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1302
|
-
let e;
|
|
1303
|
-
for (; (e = t.next()) !== null; ) {
|
|
1304
|
-
const s = e.key.asString();
|
|
1305
|
-
r[s] = qr(e.value.asObject());
|
|
1306
|
-
}
|
|
1307
|
-
return r;
|
|
1308
|
-
}
|
|
1309
|
-
const ps = 161083277, Ks = 164808083, $s = 1368629611, Xs = 2514959030, js = 2745379226, Ws = 2950031986, zs = 3282782683, Js = 3284746250, Qs = 4065070594;
|
|
1310
|
-
function kt(t) {
|
|
1311
|
-
const r = {};
|
|
1312
|
-
return Gt(r), r;
|
|
1313
|
-
}
|
|
1314
|
-
function Gt(t) {
|
|
1315
|
-
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = ht.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t.CorrelationId = void 0, t;
|
|
1316
|
-
}
|
|
1317
|
-
function qs(t, r) {
|
|
1318
|
-
const e = r ?? kt();
|
|
1319
|
-
return Gt(e), Zs(t, e), e;
|
|
1320
|
-
}
|
|
1321
|
-
function Zs(t, r) {
|
|
1322
|
-
let e;
|
|
1323
|
-
for (; (e = t.next()) !== null; )
|
|
1324
|
-
switch (e.fieldId) {
|
|
1325
|
-
case ps: {
|
|
1326
|
-
if (e.isNull) throw new Error();
|
|
1327
|
-
r.StreamId = e.asString();
|
|
1328
|
-
break;
|
|
1329
|
-
}
|
|
1330
|
-
case Ks: {
|
|
1331
|
-
if (e.isNull) throw new Error();
|
|
1332
|
-
r.Framerate = e.asFloat64();
|
|
1333
|
-
break;
|
|
1334
|
-
}
|
|
1335
|
-
case $s: {
|
|
1336
|
-
if (e.isNull) throw new Error();
|
|
1337
|
-
r.Description = e.asString();
|
|
1338
|
-
break;
|
|
1339
|
-
}
|
|
1340
|
-
case Xs: {
|
|
1341
|
-
if (e.isNull) {
|
|
1342
|
-
r.CorrelationId = void 0;
|
|
1343
|
-
break;
|
|
1344
|
-
}
|
|
1345
|
-
r.CorrelationId = e.asString();
|
|
1346
|
-
break;
|
|
1347
|
-
}
|
|
1348
|
-
case js: {
|
|
1349
|
-
if (e.isNull) throw new Error();
|
|
1350
|
-
r.CodecDetails = e.asString();
|
|
1351
|
-
break;
|
|
1352
|
-
}
|
|
1353
|
-
case Ws: {
|
|
1354
|
-
if (e.isNull) throw new Error();
|
|
1355
|
-
r.Height = e.asInt32();
|
|
1356
|
-
break;
|
|
1357
|
-
}
|
|
1358
|
-
case zs: {
|
|
1359
|
-
if (e.isNull) throw new Error();
|
|
1360
|
-
r.SourceType = e.asString();
|
|
1361
|
-
break;
|
|
1362
|
-
}
|
|
1363
|
-
case Js: {
|
|
1364
|
-
if (e.isNull) throw new Error();
|
|
1365
|
-
r.Codec = e.asInt32();
|
|
1366
|
-
break;
|
|
1367
|
-
}
|
|
1368
|
-
case Qs: {
|
|
1369
|
-
if (e.isNull) throw new Error();
|
|
1370
|
-
r.Width = e.asInt32();
|
|
1371
|
-
break;
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
const tn = 65539, en = 693643444, rn = 976837618, sn = 1144553441, nn = 1497620243, on = 1559330978, an = 1976546434, En = 2271236852, _n = 2277643855, In = 2469008121, ln = 3042922213, cn = 3064612128, fn = 3219210453, un = 3504054055, Tn = 3678477544, hn = 3696445035, An = 3707543140, Nn = 3712281496, Sn = 3895362455, Cn = 3897397815, Dn = 3914217035, Rn = 4225107827;
|
|
1376
|
-
function dn(t) {
|
|
1377
|
-
const r = {};
|
|
1378
|
-
return Bt(r), r;
|
|
1379
|
-
}
|
|
1380
|
-
function Bt(t) {
|
|
1381
|
-
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 = Nt.Local, t.AppSourceType = St.Bundle, t.PublicAccess = !1, t.DebugMode = !1, t;
|
|
1382
|
-
}
|
|
1383
|
-
function wn(t, r) {
|
|
1384
|
-
const e = O.create(t);
|
|
1385
|
-
return Ln(e, r);
|
|
1386
|
-
}
|
|
1387
|
-
function Ln(t, r) {
|
|
1388
|
-
const e = r ?? dn();
|
|
1389
|
-
return Bt(e), yn(t, e), e;
|
|
1390
|
-
}
|
|
1391
|
-
function yn(t, r) {
|
|
1392
|
-
let e;
|
|
1393
|
-
for (; (e = t.next()) !== null; )
|
|
1394
|
-
switch (e.fieldId) {
|
|
1395
|
-
case en: {
|
|
1396
|
-
if (e.isNull) throw new Error();
|
|
1397
|
-
r.FirstUserId = e.asString();
|
|
1398
|
-
break;
|
|
1399
|
-
}
|
|
1400
|
-
case rn: {
|
|
1401
|
-
if (e.isNull) throw new Error();
|
|
1402
|
-
r.SessionHash = e.asString();
|
|
1403
|
-
break;
|
|
1404
|
-
}
|
|
1405
|
-
case sn: {
|
|
1406
|
-
if (e.isNull) throw new Error();
|
|
1407
|
-
r.Clients = On(e.asDictionary());
|
|
1408
|
-
break;
|
|
1409
|
-
}
|
|
1410
|
-
case nn: {
|
|
1411
|
-
if (e.isNull) throw new Error();
|
|
1412
|
-
r.TrackingStreams = mn(e.asDictionary());
|
|
1413
|
-
break;
|
|
1414
|
-
}
|
|
1415
|
-
case on: {
|
|
1416
|
-
if (e.isNull) throw new Error();
|
|
1417
|
-
r.ChannelId = e.asString();
|
|
1418
|
-
break;
|
|
1419
|
-
}
|
|
1420
|
-
case an: {
|
|
1421
|
-
if (e.isNull) throw new Error();
|
|
1422
|
-
r.AppSourceType = e.asInt32();
|
|
1423
|
-
break;
|
|
1424
|
-
}
|
|
1425
|
-
case En: {
|
|
1426
|
-
if (e.isNull) throw new Error();
|
|
1427
|
-
r.SessionChannelUrl = e.asString();
|
|
1428
|
-
break;
|
|
1429
|
-
}
|
|
1430
|
-
case _n: {
|
|
1431
|
-
if (e.isNull) throw new Error();
|
|
1432
|
-
r.ChannelUrl = e.asString();
|
|
1433
|
-
break;
|
|
1434
|
-
}
|
|
1435
|
-
case In: {
|
|
1436
|
-
if (e.isNull) throw new Error();
|
|
1437
|
-
r.ChannelName = e.asString();
|
|
1438
|
-
break;
|
|
1439
|
-
}
|
|
1440
|
-
case ln: {
|
|
1441
|
-
if (e.isNull) throw new Error();
|
|
1442
|
-
r.PublicAccess = e.asBool();
|
|
1443
|
-
break;
|
|
1444
|
-
}
|
|
1445
|
-
case cn: {
|
|
1446
|
-
if (e.isNull) throw new Error();
|
|
1447
|
-
r.ServerRunType = e.asInt32();
|
|
1448
|
-
break;
|
|
1449
|
-
}
|
|
1450
|
-
case fn: {
|
|
1451
|
-
if (e.isNull) throw new Error();
|
|
1452
|
-
r.OrganisationName = e.asString();
|
|
1453
|
-
break;
|
|
1454
|
-
}
|
|
1455
|
-
case un: {
|
|
1456
|
-
if (e.isNull) throw new Error();
|
|
1457
|
-
r.DebugMode = e.asBool();
|
|
1458
|
-
break;
|
|
1459
|
-
}
|
|
1460
|
-
case Tn: {
|
|
1461
|
-
if (e.isNull) throw new Error();
|
|
1462
|
-
r.Functions = Pn(e.asDictionary());
|
|
1463
|
-
break;
|
|
1464
|
-
}
|
|
1465
|
-
case hn: {
|
|
1466
|
-
if (e.isNull) throw new Error();
|
|
1467
|
-
r.UIStreams = gn(e.asDictionary());
|
|
1468
|
-
break;
|
|
1469
|
-
}
|
|
1470
|
-
case An: {
|
|
1471
|
-
if (e.isNull) throw new Error();
|
|
1472
|
-
r.SpaceId = e.asString();
|
|
1473
|
-
break;
|
|
1474
|
-
}
|
|
1475
|
-
case Nn: {
|
|
1476
|
-
if (e.isNull) throw new Error();
|
|
1477
|
-
r.PrimaryUserId = e.asString();
|
|
1478
|
-
break;
|
|
1479
|
-
}
|
|
1480
|
-
case Sn: {
|
|
1481
|
-
if (e.isNull) throw new Error();
|
|
1482
|
-
r.AudioStreams = Fn(e.asDictionary());
|
|
1483
|
-
break;
|
|
1484
|
-
}
|
|
1485
|
-
case Cn: {
|
|
1486
|
-
if (e.isNull) throw new Error();
|
|
1487
|
-
r.VideoStreams = bn(e.asDictionary());
|
|
1488
|
-
break;
|
|
1489
|
-
}
|
|
1490
|
-
case Dn: {
|
|
1491
|
-
if (e.isNull) throw new Error();
|
|
1492
|
-
r.ServerSessionId = e.asString();
|
|
1493
|
-
break;
|
|
1494
|
-
}
|
|
1495
|
-
case Rn: {
|
|
1496
|
-
if (e.isNull) throw new Error();
|
|
1497
|
-
r.SpaceName = e.asString();
|
|
1498
|
-
break;
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
async function Un(t, r) {
|
|
1503
|
-
const e = await p(t, tn);
|
|
1504
|
-
return wn(e, r);
|
|
1505
|
-
}
|
|
1506
|
-
function On(t) {
|
|
1507
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1508
|
-
let e;
|
|
1509
|
-
for (; (e = t.next()) !== null; ) {
|
|
1510
|
-
const s = e.key.asInt32();
|
|
1511
|
-
r[s] = lr(e.value.asObject());
|
|
1512
|
-
}
|
|
1513
|
-
return r;
|
|
1514
|
-
}
|
|
1515
|
-
function mn(t) {
|
|
1516
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1517
|
-
let e;
|
|
1518
|
-
for (; (e = t.next()) !== null; ) {
|
|
1519
|
-
const s = e.key.asString();
|
|
1520
|
-
r[s] = ai(e.value.asObject());
|
|
1521
|
-
}
|
|
1522
|
-
return r;
|
|
1523
|
-
}
|
|
1524
|
-
function Pn(t) {
|
|
1525
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1526
|
-
let e;
|
|
1527
|
-
for (; (e = t.next()) !== null; ) {
|
|
1528
|
-
const s = e.key.asInt32();
|
|
1529
|
-
r[s] = Mn(e.value.asArray());
|
|
1530
|
-
}
|
|
1531
|
-
return r;
|
|
1532
|
-
}
|
|
1533
|
-
function gn(t) {
|
|
1534
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1535
|
-
let e;
|
|
1536
|
-
for (; (e = t.next()) !== null; ) {
|
|
1537
|
-
const s = e.key.asString();
|
|
1538
|
-
r[s] = xn(e.value.asObject());
|
|
1539
|
-
}
|
|
1540
|
-
return r;
|
|
1541
|
-
}
|
|
1542
|
-
function Fn(t) {
|
|
1543
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1544
|
-
let e;
|
|
1545
|
-
for (; (e = t.next()) !== null; ) {
|
|
1546
|
-
const s = e.key.asString();
|
|
1547
|
-
r[s] = jn(e.value.asObject());
|
|
1548
|
-
}
|
|
1549
|
-
return r;
|
|
1550
|
-
}
|
|
1551
|
-
function bn(t) {
|
|
1552
|
-
const r = /* @__PURE__ */ Object.create(null);
|
|
1553
|
-
let e;
|
|
1554
|
-
for (; (e = t.next()) !== null; ) {
|
|
1555
|
-
const s = e.key.asString();
|
|
1556
|
-
r[s] = ti(e.value.asObject());
|
|
1557
|
-
}
|
|
1558
|
-
return r;
|
|
1559
|
-
}
|
|
1560
|
-
function Mn(t) {
|
|
1561
|
-
const r = [];
|
|
1562
|
-
let e;
|
|
1563
|
-
for (; (e = t.next()) !== null; )
|
|
1564
|
-
r.push(Ur(e.asObject()));
|
|
1565
|
-
return r;
|
|
1566
|
-
}
|
|
1567
|
-
const vn = 161083277, kn = 325678206, Gn = 3469892363, Bn = 3645544153;
|
|
1568
|
-
function Vn(t) {
|
|
1569
|
-
const r = {};
|
|
1570
|
-
return Vt(r), r;
|
|
1571
|
-
}
|
|
1572
|
-
function Vt(t) {
|
|
1573
|
-
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = mt(), t;
|
|
1574
|
-
}
|
|
1575
|
-
function xn(t, r) {
|
|
1576
|
-
const e = r ?? Vn();
|
|
1577
|
-
return Vt(e), Hn(t, e), e;
|
|
1578
|
-
}
|
|
1579
|
-
function Hn(t, r) {
|
|
1580
|
-
let e;
|
|
1581
|
-
for (; (e = t.next()) !== null; )
|
|
1582
|
-
switch (e.fieldId) {
|
|
1583
|
-
case vn: {
|
|
1584
|
-
if (e.isNull) throw new Error();
|
|
1585
|
-
r.StreamId = e.asString();
|
|
1586
|
-
break;
|
|
1587
|
-
}
|
|
1588
|
-
case kn: {
|
|
1589
|
-
if (e.isNull) throw new Error();
|
|
1590
|
-
r.ClientSessionId = e.asInt32();
|
|
1591
|
-
break;
|
|
1592
|
-
}
|
|
1593
|
-
case Gn: {
|
|
1594
|
-
if (e.isNull) throw new Error();
|
|
1595
|
-
r.TrackId = e.asInt32();
|
|
1596
|
-
break;
|
|
1597
|
-
}
|
|
1598
|
-
case Bn: {
|
|
1599
|
-
if (e.isNull) throw new Error();
|
|
1600
|
-
r.Info = es(e.asObject());
|
|
1601
|
-
break;
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1604
|
-
}
|
|
1605
|
-
const Yn = 161083277, pn = 325678206, Kn = 3469892363, $n = 3645544153;
|
|
1606
|
-
function Xn(t) {
|
|
1607
|
-
const r = {};
|
|
1608
|
-
return xt(r), r;
|
|
1609
|
-
}
|
|
1610
|
-
function xt(t) {
|
|
1611
|
-
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = Ct(), t;
|
|
1612
|
-
}
|
|
1613
|
-
function jn(t, r) {
|
|
1614
|
-
const e = r ?? Xn();
|
|
1615
|
-
return xt(e), Wn(t, e), e;
|
|
1616
|
-
}
|
|
1617
|
-
function Wn(t, r) {
|
|
1618
|
-
let e;
|
|
1619
|
-
for (; (e = t.next()) !== null; )
|
|
1620
|
-
switch (e.fieldId) {
|
|
1621
|
-
case Yn: {
|
|
1622
|
-
if (e.isNull) throw new Error();
|
|
1623
|
-
r.StreamId = e.asString();
|
|
1624
|
-
break;
|
|
1625
|
-
}
|
|
1626
|
-
case pn: {
|
|
1627
|
-
if (e.isNull) throw new Error();
|
|
1628
|
-
r.ClientSessionId = e.asInt32();
|
|
1629
|
-
break;
|
|
1630
|
-
}
|
|
1631
|
-
case Kn: {
|
|
1632
|
-
if (e.isNull) throw new Error();
|
|
1633
|
-
r.TrackId = e.asInt32();
|
|
1634
|
-
break;
|
|
1635
|
-
}
|
|
1636
|
-
case $n: {
|
|
1637
|
-
if (e.isNull) throw new Error();
|
|
1638
|
-
r.Info = Se(e.asObject());
|
|
1639
|
-
break;
|
|
1640
|
-
}
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
const zn = 161083277, Jn = 325678206, Qn = 3469892363, qn = 3645544153;
|
|
1644
|
-
function Zn(t) {
|
|
1645
|
-
const r = {};
|
|
1646
|
-
return Ht(r), r;
|
|
1647
|
-
}
|
|
1648
|
-
function Ht(t) {
|
|
1649
|
-
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = kt(), t;
|
|
1650
|
-
}
|
|
1651
|
-
function ti(t, r) {
|
|
1652
|
-
const e = r ?? Zn();
|
|
1653
|
-
return Ht(e), ei(t, e), e;
|
|
1654
|
-
}
|
|
1655
|
-
function ei(t, r) {
|
|
1656
|
-
let e;
|
|
1657
|
-
for (; (e = t.next()) !== null; )
|
|
1658
|
-
switch (e.fieldId) {
|
|
1659
|
-
case zn: {
|
|
1660
|
-
if (e.isNull) throw new Error();
|
|
1661
|
-
r.StreamId = e.asString();
|
|
1662
|
-
break;
|
|
1663
|
-
}
|
|
1664
|
-
case Jn: {
|
|
1665
|
-
if (e.isNull) throw new Error();
|
|
1666
|
-
r.ClientSessionId = e.asInt32();
|
|
1667
|
-
break;
|
|
1668
|
-
}
|
|
1669
|
-
case Qn: {
|
|
1670
|
-
if (e.isNull) throw new Error();
|
|
1671
|
-
r.TrackId = e.asInt32();
|
|
1672
|
-
break;
|
|
1673
|
-
}
|
|
1674
|
-
case qn: {
|
|
1675
|
-
if (e.isNull) throw new Error();
|
|
1676
|
-
r.Info = qs(e.asObject());
|
|
1677
|
-
break;
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
const ri = 161083277, si = 325678206, ni = 3469892363, ii = 3645544153;
|
|
1682
|
-
function oi(t) {
|
|
1683
|
-
const r = {};
|
|
1684
|
-
return Yt(r), r;
|
|
1685
|
-
}
|
|
1686
|
-
function Yt(t) {
|
|
1687
|
-
return t.StreamId = "", t.ClientSessionId = 0, t.TrackId = 0, t.Info = yt(), t;
|
|
1688
|
-
}
|
|
1689
|
-
function ai(t, r) {
|
|
1690
|
-
const e = r ?? oi();
|
|
1691
|
-
return Yt(e), Ei(t, e), e;
|
|
1692
|
-
}
|
|
1693
|
-
function Ei(t, r) {
|
|
1694
|
-
let e;
|
|
1695
|
-
for (; (e = t.next()) !== null; )
|
|
1696
|
-
switch (e.fieldId) {
|
|
1697
|
-
case ri: {
|
|
1698
|
-
if (e.isNull) throw new Error();
|
|
1699
|
-
r.StreamId = e.asString();
|
|
1700
|
-
break;
|
|
1701
|
-
}
|
|
1702
|
-
case si: {
|
|
1703
|
-
if (e.isNull) throw new Error();
|
|
1704
|
-
r.ClientSessionId = e.asInt32();
|
|
1705
|
-
break;
|
|
1706
|
-
}
|
|
1707
|
-
case ni: {
|
|
1708
|
-
if (e.isNull) throw new Error();
|
|
1709
|
-
r.TrackId = e.asInt32();
|
|
1710
|
-
break;
|
|
1711
|
-
}
|
|
1712
|
-
case ii: {
|
|
1713
|
-
if (e.isNull) throw new Error();
|
|
1714
|
-
r.Info = Xr(e.asObject());
|
|
1715
|
-
break;
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
function D(t) {
|
|
1720
|
-
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1721
|
-
}
|
|
1722
|
-
function pt(t) {
|
|
1723
|
-
const r = {}, e = Object.keys(t);
|
|
1724
|
-
for (let s = 0; s < e.length; s++) {
|
|
1725
|
-
const n = e[s];
|
|
1726
|
-
r[n] = t[n];
|
|
1727
|
-
}
|
|
1728
|
-
return r;
|
|
1729
|
-
}
|
|
1730
|
-
function Kt(t, r, e, s) {
|
|
1731
|
-
if (!(t === void 0 && s)) {
|
|
1732
|
-
if (Array.isArray(t)) {
|
|
1733
|
-
const n = [];
|
|
1734
|
-
for (let i = 0; i < t.length; i++) {
|
|
1735
|
-
const o = t[i];
|
|
1736
|
-
if (typeof o != "string")
|
|
1737
|
-
throw new Error(`Invalid styleIds entry at ${r}.styleIds[${i}] for element ${e}`);
|
|
1738
|
-
const a = o.trim();
|
|
1739
|
-
a.length !== 0 && n.push(a);
|
|
1740
|
-
}
|
|
1741
|
-
return n;
|
|
1742
|
-
}
|
|
1743
|
-
if (t != null)
|
|
1744
|
-
throw new Error(`Invalid styleIds for element ${e}`);
|
|
1745
|
-
return [];
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
function nt(t, r) {
|
|
1749
|
-
if (!t || typeof t != "object")
|
|
1750
|
-
throw new Error(`Invalid UI node at ${r}`);
|
|
1751
|
-
const e = t.Id, s = t.Type, n = t.Props, i = t.Children, o = t.StyleIds;
|
|
1752
|
-
if (typeof e != "string")
|
|
1753
|
-
throw new Error(`Invalid or missing node id at ${r}`);
|
|
1754
|
-
if (typeof s != "string")
|
|
1755
|
-
throw new Error(`Invalid or missing node type for ${e}`);
|
|
1756
|
-
let a = {};
|
|
1757
|
-
if (n != null) {
|
|
1758
|
-
if (!D(n))
|
|
1759
|
-
throw new Error(`Invalid props for node ${e}`);
|
|
1760
|
-
a = pt(n);
|
|
1761
|
-
}
|
|
1762
|
-
let _ = [];
|
|
1763
|
-
Array.isArray(i) && (_ = i.map(
|
|
1764
|
-
(l, c) => nt(l ?? {}, `${r}.children[${c}]`)
|
|
1765
|
-
));
|
|
1766
|
-
const I = Kt(o, r, e, !1), E = typeof t.SourceMarker == "string" ? t.SourceMarker : void 0;
|
|
1767
|
-
return {
|
|
1768
|
-
id: e,
|
|
1769
|
-
type: s,
|
|
1770
|
-
props: a,
|
|
1771
|
-
children: _,
|
|
1772
|
-
styleIds: I ?? [],
|
|
1773
|
-
...E ? { sourceMarker: E } : {}
|
|
1774
|
-
};
|
|
1775
|
-
}
|
|
1776
|
-
function _i(t, r) {
|
|
1777
|
-
if (!D(t))
|
|
1778
|
-
throw new Error(`Invalid text delta at ${r}`);
|
|
1779
|
-
const e = t.NodeId, s = t.PropertyName, n = t.Start, i = t.End, o = t.InsertedText;
|
|
1780
|
-
if (typeof e != "string" || e.length === 0)
|
|
1781
|
-
throw new Error(`Invalid text delta node id at ${r}`);
|
|
1782
|
-
if (typeof s != "string" || s.length === 0)
|
|
1783
|
-
throw new Error(`Invalid text delta property name at ${r}`);
|
|
1784
|
-
if (typeof n != "number" || !Number.isFinite(n))
|
|
1785
|
-
throw new Error(`Invalid text delta start at ${r}`);
|
|
1786
|
-
if (typeof o != "string")
|
|
1787
|
-
throw new Error(`Invalid text delta inserted text at ${r}`);
|
|
1788
|
-
let a;
|
|
1789
|
-
if (typeof i == "number") {
|
|
1790
|
-
if (!Number.isFinite(i))
|
|
1791
|
-
throw new Error(`Invalid text delta end at ${r}`);
|
|
1792
|
-
a = i;
|
|
1793
|
-
} else if (i != null)
|
|
1794
|
-
throw new Error(`Invalid text delta end at ${r}`);
|
|
1795
|
-
return {
|
|
1796
|
-
nodeId: e,
|
|
1797
|
-
propertyName: s,
|
|
1798
|
-
start: n,
|
|
1799
|
-
end: a,
|
|
1800
|
-
insertedText: o
|
|
1801
|
-
};
|
|
1802
|
-
}
|
|
1803
|
-
function Ii(t, r) {
|
|
1804
|
-
if (!D(t))
|
|
1805
|
-
throw new Error(`Invalid child insert at ${r}`);
|
|
1806
|
-
const e = t.Index, s = t.Node;
|
|
1807
|
-
if (typeof e != "number" || !Number.isFinite(e))
|
|
1808
|
-
throw new Error(`Invalid child insert index at ${r}`);
|
|
1809
|
-
if (!D(s))
|
|
1810
|
-
throw new Error(`Invalid child insert node at ${r}`);
|
|
1811
|
-
return {
|
|
1812
|
-
index: e,
|
|
1813
|
-
node: nt(s, `${r}.node`)
|
|
1814
|
-
};
|
|
1815
|
-
}
|
|
1816
|
-
function li(t, r) {
|
|
1817
|
-
if (!D(t))
|
|
1818
|
-
throw new Error(`Invalid child move at ${r}`);
|
|
1819
|
-
const e = t.NodeId, s = t.FromIndex, n = t.ToIndex;
|
|
1820
|
-
if (typeof e != "string" || e.length === 0)
|
|
1821
|
-
throw new Error(`Invalid child move nodeId at ${r}`);
|
|
1822
|
-
if (typeof s != "number" || !Number.isFinite(s))
|
|
1823
|
-
throw new Error(`Invalid child move fromIndex at ${r}`);
|
|
1824
|
-
if (typeof n != "number" || !Number.isFinite(n))
|
|
1825
|
-
throw new Error(`Invalid child move toIndex at ${r}`);
|
|
1826
|
-
return {
|
|
1827
|
-
nodeId: e,
|
|
1828
|
-
fromIndex: s,
|
|
1829
|
-
toIndex: n
|
|
1830
|
-
};
|
|
1831
|
-
}
|
|
1832
|
-
function ci(t, r) {
|
|
1833
|
-
if (!D(t))
|
|
1834
|
-
throw new Error(`Invalid child remove at ${r}`);
|
|
1835
|
-
const e = t.NodeId, s = t.Index;
|
|
1836
|
-
if (typeof e != "string" || e.length === 0)
|
|
1837
|
-
throw new Error(`Invalid child remove nodeId at ${r}`);
|
|
1838
|
-
if (typeof s != "number" || !Number.isFinite(s))
|
|
1839
|
-
throw new Error(`Invalid child remove index at ${r}`);
|
|
1840
|
-
return {
|
|
1841
|
-
nodeId: e,
|
|
1842
|
-
index: s
|
|
1843
|
-
};
|
|
1844
|
-
}
|
|
1845
|
-
function fi(t, r) {
|
|
1846
|
-
if (!D(t))
|
|
1847
|
-
throw new Error(`Invalid node change at ${r}`);
|
|
1848
|
-
const e = t.nodeId;
|
|
1849
|
-
if (typeof e != "string" || e.length === 0)
|
|
1850
|
-
throw new Error(`Invalid node change nodeId at ${r}`);
|
|
1851
|
-
const s = Array.isArray(t.inserts) ? t.inserts.map(
|
|
1852
|
-
(E, l) => Ii(E ?? {}, `${r}.inserts[${l}]`)
|
|
1853
|
-
) : void 0, n = Array.isArray(t.moves) ? t.moves.map(
|
|
1854
|
-
(E, l) => li(E ?? {}, `${r}.moves[${l}]`)
|
|
1855
|
-
) : void 0, i = Array.isArray(t.removals) ? t.removals.map(
|
|
1856
|
-
(E, l) => ci(E ?? {}, `${r}.removals[${l}]`)
|
|
1857
|
-
) : void 0;
|
|
1858
|
-
let o;
|
|
1859
|
-
if (D(t.changedProps)) {
|
|
1860
|
-
o = /* @__PURE__ */ new Map();
|
|
1861
|
-
for (const [E, l] of Object.entries(t.changedProps)) {
|
|
1862
|
-
if (!D(l))
|
|
1863
|
-
continue;
|
|
1864
|
-
const c = l.New;
|
|
1865
|
-
c === void 0 ? o.set(E, void 0) : D(c) ? o.set(E, pt(c)) : o.set(E, c);
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
const a = Array.isArray(t.textUpdates) ? t.textUpdates.map(
|
|
1869
|
-
(E, l) => _i(E ?? {}, `${r}.textUpdates[${l}]`)
|
|
1870
|
-
) : void 0, _ = t.styleIds, I = _ !== void 0 ? Kt(_, r, e, !0) : void 0;
|
|
1871
|
-
return {
|
|
1872
|
-
nodeId: e,
|
|
1873
|
-
...s && s.length > 0 ? { inserts: s } : {},
|
|
1874
|
-
...n && n.length > 0 ? { moves: n } : {},
|
|
1875
|
-
...i && i.length > 0 ? { removals: i } : {},
|
|
1876
|
-
...o && o.size > 0 ? { changedProps: o } : {},
|
|
1877
|
-
...a && a.length > 0 ? { textUpdates: a } : {},
|
|
1878
|
-
...I !== void 0 ? { styleIds: I } : {}
|
|
1879
|
-
};
|
|
1880
|
-
}
|
|
1881
|
-
function ui(t) {
|
|
1882
|
-
const r = /* @__PURE__ */ new Map();
|
|
1883
|
-
for (const [e, s] of Object.entries(t))
|
|
1884
|
-
r.set(e, s);
|
|
1885
|
-
return r;
|
|
1886
|
-
}
|
|
1887
|
-
function Ti(t, r, e) {
|
|
1888
|
-
if (!t || typeof t != "object")
|
|
1889
|
-
throw new R("UI update graph is missing");
|
|
1890
|
-
const s = nt(t, "graph");
|
|
1891
|
-
if (s.type !== "root")
|
|
1892
|
-
throw new R('UI update root element must have type "root"');
|
|
1893
|
-
const n = Ai(s.props, r);
|
|
1894
|
-
return {
|
|
1895
|
-
type: "full",
|
|
1896
|
-
version: e,
|
|
1897
|
-
root: s,
|
|
1898
|
-
metadata: n
|
|
1899
|
-
};
|
|
1900
|
-
}
|
|
1901
|
-
function hi(t, r, e) {
|
|
1902
|
-
if (!Array.isArray(t))
|
|
1903
|
-
throw new R("UI diff changes must be an array");
|
|
1904
|
-
if (!D(r))
|
|
1905
|
-
throw new R("UI diff metadata must be an object");
|
|
1906
|
-
const s = r.viewId;
|
|
1907
|
-
if (typeof s != "string" || s.length === 0)
|
|
1908
|
-
throw new R("UI diff metadata is missing viewId");
|
|
1909
|
-
const n = t.map(
|
|
1910
|
-
(a, _) => fi(a ?? {}, `changes[${_}]`)
|
|
1911
|
-
), i = typeof r.isUpdate == "boolean" ? r.isUpdate : void 0, o = {
|
|
1912
|
-
viewId: s,
|
|
1913
|
-
...i !== void 0 ? { isUpdate: i } : {}
|
|
1914
|
-
};
|
|
1915
|
-
return {
|
|
1916
|
-
type: "diff",
|
|
1917
|
-
version: e,
|
|
1918
|
-
changes: n,
|
|
1919
|
-
metadata: o
|
|
1920
|
-
};
|
|
1921
|
-
}
|
|
1922
|
-
function Ai(t, r) {
|
|
1923
|
-
const e = t.viewId;
|
|
1924
|
-
if (typeof e != "string" || e.length === 0)
|
|
1925
|
-
throw new R("UI update root is missing viewId");
|
|
1926
|
-
let s = e, n = typeof t.isUpdate == "boolean" ? t.isUpdate : void 0;
|
|
1927
|
-
return D(r) && (typeof r.viewId == "string" && r.viewId.length > 0 && (s = r.viewId), typeof r.isUpdate == "boolean" && (n = r.isUpdate)), {
|
|
1928
|
-
viewId: s,
|
|
1929
|
-
...n !== void 0 ? { isUpdate: n } : {}
|
|
1930
|
-
};
|
|
1931
|
-
}
|
|
1932
|
-
class R extends Error {
|
|
1933
|
-
constructor(r, e) {
|
|
1934
|
-
super(r), this.causeError = e, this.name = "UiUpdateParseError", e instanceof Error && (this.stack = e.stack);
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
function Ni(t) {
|
|
1938
|
-
let r;
|
|
1939
|
-
try {
|
|
1940
|
-
r = JSON.parse(t.Json);
|
|
1941
|
-
} catch (o) {
|
|
1942
|
-
throw new R("Failed to parse UIUpdate.Json payload", o);
|
|
1943
|
-
}
|
|
1944
|
-
if (!r || typeof r != "object")
|
|
1945
|
-
throw new R("UI update snapshot must be an object");
|
|
1946
|
-
const { type: e, version: s } = r;
|
|
1947
|
-
if (e !== "full" && e !== "diff")
|
|
1948
|
-
throw new R(`Unknown UI update type: ${String(e)}`);
|
|
1949
|
-
if (typeof s != "number")
|
|
1950
|
-
throw new R("UI update version must be a number");
|
|
1951
|
-
const n = e === "full" ? Ti(r.graph, r.metadata, s) : hi(r.changes, r.metadata, s), i = t.Payloads ? ui(t.Payloads) : /* @__PURE__ */ new Map();
|
|
1952
|
-
return {
|
|
1953
|
-
snapshot: n,
|
|
1954
|
-
payloads: i
|
|
1955
|
-
};
|
|
1956
|
-
}
|
|
1957
|
-
let Si = 1;
|
|
1958
|
-
const Ci = /* @__PURE__ */ new Map(), Di = {
|
|
1959
|
-
0: "DEBUG",
|
|
1960
|
-
1: "INFO",
|
|
1961
|
-
2: "WARN",
|
|
1962
|
-
3: "ERROR",
|
|
1963
|
-
4: "NONE"
|
|
1964
|
-
};
|
|
1965
|
-
function Ri(t, r) {
|
|
1966
|
-
return `[${t}] ${r}`;
|
|
1967
|
-
}
|
|
1968
|
-
function $(t, r, e, s) {
|
|
1969
|
-
const n = (/* @__PURE__ */ new Date()).toISOString(), i = Di[t], o = {
|
|
1970
|
-
timestamp: n,
|
|
1971
|
-
level: t,
|
|
1972
|
-
levelName: i,
|
|
1973
|
-
component: r,
|
|
1974
|
-
message: e,
|
|
1975
|
-
args: s
|
|
1976
|
-
};
|
|
1977
|
-
for (const [a, _] of Ci) {
|
|
1978
|
-
const I = _?.minLevel ?? 2;
|
|
1979
|
-
if (t >= I)
|
|
1980
|
-
try {
|
|
1981
|
-
a(o);
|
|
1982
|
-
} catch {
|
|
1983
|
-
}
|
|
1984
|
-
}
|
|
1985
|
-
if (Si <= t) {
|
|
1986
|
-
const a = Ri(r, e);
|
|
1987
|
-
switch (t) {
|
|
1988
|
-
case 0:
|
|
1989
|
-
console.debug(a, ...s);
|
|
1990
|
-
break;
|
|
1991
|
-
case 1:
|
|
1992
|
-
console.info(a, ...s);
|
|
1993
|
-
break;
|
|
1994
|
-
case 2:
|
|
1995
|
-
console.warn(a, ...s);
|
|
1996
|
-
break;
|
|
1997
|
-
case 3:
|
|
1998
|
-
console.error(a, ...s);
|
|
1999
|
-
break;
|
|
2000
|
-
}
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
function di(t) {
|
|
2004
|
-
return {
|
|
2005
|
-
debug(r, ...e) {
|
|
2006
|
-
$(0, t, r, e);
|
|
2007
|
-
},
|
|
2008
|
-
info(r, ...e) {
|
|
2009
|
-
$(1, t, r, e);
|
|
2010
|
-
},
|
|
2011
|
-
warn(r, ...e) {
|
|
2012
|
-
$(2, t, r, e);
|
|
2013
|
-
},
|
|
2014
|
-
error(r, ...e) {
|
|
2015
|
-
$(3, t, r, e);
|
|
2016
|
-
}
|
|
2017
|
-
};
|
|
2018
|
-
}
|
|
2019
|
-
class wi {
|
|
2020
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2021
|
-
cache = /* @__PURE__ */ new Map();
|
|
2022
|
-
/**
|
|
2023
|
-
* Get a cached void handler (no payload) for a node/action combination.
|
|
2024
|
-
* Creates and caches the handler if it doesn't exist.
|
|
2025
|
-
*/
|
|
2026
|
-
getHandler(r, e, s) {
|
|
2027
|
-
const n = `${r}:${e}`;
|
|
2028
|
-
let i = this.cache.get(n);
|
|
2029
|
-
return i || (i = () => s(e), this.cache.set(n, i)), i;
|
|
2030
|
-
}
|
|
2031
|
-
/**
|
|
2032
|
-
* Get a cached handler that accepts a payload.
|
|
2033
|
-
* Creates and caches the handler if it doesn't exist.
|
|
2034
|
-
*/
|
|
2035
|
-
getHandlerWithPayload(r, e, s) {
|
|
2036
|
-
const n = `${r}:${e}:payload`;
|
|
2037
|
-
let i = this.cache.get(n);
|
|
2038
|
-
return i || (i = (o) => s(e, o), this.cache.set(n, i)), i;
|
|
2039
|
-
}
|
|
2040
|
-
/**
|
|
2041
|
-
* Get a cached handler for boolean payloads.
|
|
2042
|
-
*/
|
|
2043
|
-
getBooleanHandler(r, e, s) {
|
|
2044
|
-
return this.getHandlerWithPayload(r, e, s);
|
|
2045
|
-
}
|
|
2046
|
-
/**
|
|
2047
|
-
* Get a cached handler for string payloads.
|
|
2048
|
-
*/
|
|
2049
|
-
getStringHandler(r, e, s) {
|
|
2050
|
-
return this.getHandlerWithPayload(r, e, s);
|
|
2051
|
-
}
|
|
2052
|
-
/**
|
|
2053
|
-
* Get a cached handler for number payloads.
|
|
2054
|
-
*/
|
|
2055
|
-
getNumberHandler(r, e, s) {
|
|
2056
|
-
return this.getHandlerWithPayload(r, e, s);
|
|
2057
|
-
}
|
|
2058
|
-
/**
|
|
2059
|
-
* Get a cached handler for number array payloads.
|
|
2060
|
-
*/
|
|
2061
|
-
getNumberArrayHandler(r, e, s) {
|
|
2062
|
-
return this.getHandlerWithPayload(r, e, s);
|
|
2063
|
-
}
|
|
2064
|
-
/**
|
|
2065
|
-
* Get a cached handler for nullable boolean payloads.
|
|
2066
|
-
*/
|
|
2067
|
-
getNullableBooleanHandler(r, e, s) {
|
|
2068
|
-
const n = `${r}:${e}:nullable-bool`;
|
|
2069
|
-
let i = this.cache.get(n);
|
|
2070
|
-
return i || (i = (o) => s(e, o ?? null), this.cache.set(n, i)), i;
|
|
2071
|
-
}
|
|
2072
|
-
/**
|
|
2073
|
-
* Invalidate all cached handlers for a specific node.
|
|
2074
|
-
* Call this when a node is removed from the tree.
|
|
2075
|
-
*/
|
|
2076
|
-
invalidateNode(r) {
|
|
2077
|
-
const e = `${r}:`;
|
|
2078
|
-
for (const s of this.cache.keys())
|
|
2079
|
-
s.startsWith(e) && this.cache.delete(s);
|
|
2080
|
-
}
|
|
2081
|
-
/**
|
|
2082
|
-
* Invalidate a specific handler.
|
|
2083
|
-
*/
|
|
2084
|
-
invalidateHandler(r, e) {
|
|
2085
|
-
this.cache.delete(`${r}:${e}`), this.cache.delete(`${r}:${e}:payload`), this.cache.delete(`${r}:${e}:nullable-bool`);
|
|
2086
|
-
}
|
|
2087
|
-
/**
|
|
2088
|
-
* Clear all cached handlers.
|
|
2089
|
-
*/
|
|
2090
|
-
clear() {
|
|
2091
|
-
this.cache.clear();
|
|
2092
|
-
}
|
|
2093
|
-
/**
|
|
2094
|
-
* Get the number of cached handlers (for debugging/testing).
|
|
2095
|
-
*/
|
|
2096
|
-
get size() {
|
|
2097
|
-
return this.cache.size;
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
const Li = di("UiStreamStore");
|
|
2101
|
-
class yi {
|
|
2102
|
-
views = /* @__PURE__ */ new Map();
|
|
2103
|
-
listeners = /* @__PURE__ */ new Set();
|
|
2104
|
-
payloads = /* @__PURE__ */ new Map();
|
|
2105
|
-
snapshotMode = !1;
|
|
2106
|
-
snapshot = {
|
|
2107
|
-
views: /* @__PURE__ */ new Map(),
|
|
2108
|
-
payloads: /* @__PURE__ */ new Map(),
|
|
2109
|
-
version: -1
|
|
2110
|
-
};
|
|
2111
|
-
rootViewId;
|
|
2112
|
-
// Per-node subscriptions for granular updates
|
|
2113
|
-
nodeListeners = /* @__PURE__ */ new Map();
|
|
2114
|
-
changedNodeIds = /* @__PURE__ */ new Set();
|
|
2115
|
-
nodeVersions = /* @__PURE__ */ new Map();
|
|
2116
|
-
structureChanged = !1;
|
|
2117
|
-
// Dirty flags for lazy snapshot rebuilding - start true to ensure first snapshot builds correctly
|
|
2118
|
-
viewsDirty = !0;
|
|
2119
|
-
payloadsDirty = !0;
|
|
2120
|
-
// Handler cache for stable event handlers
|
|
2121
|
-
handlerCache = new wi();
|
|
2122
|
-
apply(r) {
|
|
2123
|
-
if (this.snapshotMode) {
|
|
2124
|
-
if (r.snapshot.type !== "full")
|
|
2125
|
-
return !1;
|
|
2126
|
-
this.snapshotMode = !1, this.views.clear(), this.payloads.clear(), this.rootViewId = void 0, this.viewsDirty = !0, this.payloadsDirty = !0, this.snapshot = {
|
|
2127
|
-
views: /* @__PURE__ */ new Map(),
|
|
2128
|
-
payloads: /* @__PURE__ */ new Map(),
|
|
2129
|
-
version: -1
|
|
2130
|
-
};
|
|
2131
|
-
}
|
|
2132
|
-
const { snapshot: e, payloads: s } = r, { metadata: n } = e, { viewId: i } = n;
|
|
2133
|
-
let o = this.views.get(i);
|
|
2134
|
-
o || (o = {
|
|
2135
|
-
version: 0
|
|
2136
|
-
}, this.views.set(i, o));
|
|
2137
|
-
const a = e.type === "diff" && n.isUpdate === !0;
|
|
2138
|
-
if (e.version < o.version || e.version === o.version && !a)
|
|
2139
|
-
return !1;
|
|
2140
|
-
let _ = !1;
|
|
2141
|
-
this.rootViewId || (this.rootViewId = i, _ = !0, this.structureChanged = !0);
|
|
2142
|
-
const I = o.root;
|
|
2143
|
-
if (e.type === "full")
|
|
2144
|
-
o.root = e.root, o.version = e.version, _ = !0, this.viewsDirty = !0, this.structureChanged = !0, e.root && B(e.root, this.changedNodeIds);
|
|
2145
|
-
else {
|
|
2146
|
-
if (!I)
|
|
2147
|
-
return !1;
|
|
2148
|
-
const E = Oi(I, e.changes);
|
|
2149
|
-
E !== I ? (o.root = E, _ = !0, this.viewsDirty = !0, J(I, E, this.changedNodeIds)) : o.root = E, o.version = e.version;
|
|
2150
|
-
}
|
|
2151
|
-
for (const [E, l] of s)
|
|
2152
|
-
this.payloads.get(E) !== l && (this.payloads.set(E, l), _ = !0, this.payloadsDirty = !0);
|
|
2153
|
-
return _ ? (this.commitSnapshot(), this.notify(), !0) : (o.version = e.version, !1);
|
|
2154
|
-
}
|
|
2155
|
-
// Ignore further diffs (keeping the current tree visible) until the next full snapshot arrives,
|
|
2156
|
-
// which then replaces the tree wholesale. Used on soft reconnect: the cached tree may be missing
|
|
2157
|
-
// diffs lost while the transport was down, so incoming diffs can no longer be trusted — but the
|
|
2158
|
-
// tree stays on screen (no blank) until the server's resync full snapshot lands.
|
|
2159
|
-
enterSnapshotMode() {
|
|
2160
|
-
this.snapshotMode = !0;
|
|
2161
|
-
}
|
|
2162
|
-
replaceFromWire(r) {
|
|
2163
|
-
const e = {
|
|
2164
|
-
rootViewId: r.rootViewId,
|
|
2165
|
-
views: new Map(r.views),
|
|
2166
|
-
payloads: new Map(r.payloads),
|
|
2167
|
-
version: r.version
|
|
2168
|
-
};
|
|
2169
|
-
return this.replaceSnapshot(e);
|
|
2170
|
-
}
|
|
2171
|
-
patchFromOp(r) {
|
|
2172
|
-
this.snapshotMode = !0;
|
|
2173
|
-
const e = r.expectedBaseVersion;
|
|
2174
|
-
if (e !== void 0 && this.snapshot.version !== e)
|
|
2175
|
-
return !1;
|
|
2176
|
-
let s = !1, n = null, i = null;
|
|
2177
|
-
const o = () => (n || (n = new Map(this.snapshot.views)), n), a = () => (i || (i = new Map(this.snapshot.payloads)), i);
|
|
2178
|
-
if (r.deleteViews && r.deleteViews.length > 0)
|
|
2179
|
-
for (const E of r.deleteViews)
|
|
2180
|
-
o().delete(E) && (s = !0, this.structureChanged = !0);
|
|
2181
|
-
if (r.upsertViews && r.upsertViews.length > 0)
|
|
2182
|
-
for (const [E, l] of r.upsertViews) {
|
|
2183
|
-
const c = o(), L = c.get(E);
|
|
2184
|
-
L !== l && (c.set(E, l), s = !0, L ? J(L, l, this.changedNodeIds) : (B(l, this.changedNodeIds), this.structureChanged = !0));
|
|
2185
|
-
}
|
|
2186
|
-
if (r.deletePayloads && r.deletePayloads.length > 0)
|
|
2187
|
-
for (const E of r.deletePayloads)
|
|
2188
|
-
a().delete(E) && (s = !0);
|
|
2189
|
-
if (r.upsertPayloads && r.upsertPayloads.length > 0)
|
|
2190
|
-
for (const [E, l] of r.upsertPayloads) {
|
|
2191
|
-
const c = a();
|
|
2192
|
-
c.get(E) !== l && (c.set(E, l), s = !0);
|
|
2193
|
-
}
|
|
2194
|
-
const _ = r.rootViewId ?? this.snapshot.rootViewId;
|
|
2195
|
-
_ !== this.snapshot.rootViewId && (s = !0, this.structureChanged = !0);
|
|
2196
|
-
const I = r.nextVersion;
|
|
2197
|
-
if (I !== this.snapshot.version && (s = !0), !s)
|
|
2198
|
-
return this.snapshot = { ...this.snapshot, version: I }, !1;
|
|
2199
|
-
for (const E of this.changedNodeIds)
|
|
2200
|
-
this.nodeVersions.set(E, (this.nodeVersions.get(E) ?? 0) + 1);
|
|
2201
|
-
return this.snapshot = {
|
|
2202
|
-
rootViewId: _,
|
|
2203
|
-
views: n ?? new Map(this.snapshot.views),
|
|
2204
|
-
payloads: i ?? new Map(this.snapshot.payloads),
|
|
2205
|
-
version: I
|
|
2206
|
-
}, this.notify(), !0;
|
|
2207
|
-
}
|
|
2208
|
-
replaceSnapshot(r) {
|
|
2209
|
-
this.snapshotMode = !0;
|
|
2210
|
-
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;
|
|
2211
|
-
(e.rootViewId !== r.rootViewId || e.views.size !== r.views.size) && (this.structureChanged = !0);
|
|
2212
|
-
for (const [n, i] of r.views) {
|
|
2213
|
-
const o = e.views.get(n);
|
|
2214
|
-
o ? J(o, i, this.changedNodeIds) : (B(i, this.changedNodeIds), this.structureChanged = !0);
|
|
2215
|
-
}
|
|
2216
|
-
for (const n of this.changedNodeIds)
|
|
2217
|
-
this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
|
|
2218
|
-
return this.snapshot = r, s && this.notify(), s;
|
|
2219
|
-
}
|
|
2220
|
-
clear() {
|
|
2221
|
-
(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 = {
|
|
2222
|
-
views: /* @__PURE__ */ new Map(),
|
|
2223
|
-
payloads: /* @__PURE__ */ new Map(),
|
|
2224
|
-
version: -1
|
|
2225
|
-
}, this.structureChanged = !0, this.notify());
|
|
2226
|
-
}
|
|
2227
|
-
getSnapshot() {
|
|
2228
|
-
return this.snapshot;
|
|
2229
|
-
}
|
|
2230
|
-
subscribe(r) {
|
|
2231
|
-
return this.listeners.add(r), () => {
|
|
2232
|
-
this.listeners.delete(r);
|
|
2233
|
-
};
|
|
2234
|
-
}
|
|
2235
|
-
subscribeNode(r, e) {
|
|
2236
|
-
let s = this.nodeListeners.get(r);
|
|
2237
|
-
return s || (s = /* @__PURE__ */ new Set(), this.nodeListeners.set(r, s)), s.add(e), () => {
|
|
2238
|
-
s && (s.delete(e), s.size === 0 && this.nodeListeners.delete(r));
|
|
2239
|
-
};
|
|
2240
|
-
}
|
|
2241
|
-
getNode(r) {
|
|
2242
|
-
const e = this.snapshot.views.get(r);
|
|
2243
|
-
if (e)
|
|
2244
|
-
return e;
|
|
2245
|
-
for (const s of this.snapshot.views.values()) {
|
|
2246
|
-
const n = jt(s, r);
|
|
2247
|
-
if (n)
|
|
2248
|
-
return n;
|
|
2249
|
-
}
|
|
2250
|
-
}
|
|
2251
|
-
getNodeVersion(r) {
|
|
2252
|
-
return this.nodeVersions.get(r) ?? 0;
|
|
2253
|
-
}
|
|
2254
|
-
notifyNodes() {
|
|
2255
|
-
if (this.changedNodeIds.size === 0 || this.nodeListeners.size === 0) {
|
|
2256
|
-
this.changedNodeIds.clear();
|
|
2257
|
-
return;
|
|
2258
|
-
}
|
|
2259
|
-
for (const r of this.changedNodeIds) {
|
|
2260
|
-
const e = this.nodeListeners.get(r);
|
|
2261
|
-
if (e)
|
|
2262
|
-
for (const s of e)
|
|
2263
|
-
s();
|
|
2264
|
-
}
|
|
2265
|
-
this.changedNodeIds.clear();
|
|
2266
|
-
}
|
|
2267
|
-
commitSnapshot() {
|
|
2268
|
-
let r, e;
|
|
2269
|
-
if (this.viewsDirty) {
|
|
2270
|
-
const n = /* @__PURE__ */ new Map();
|
|
2271
|
-
for (const [i, o] of this.views)
|
|
2272
|
-
o.root && n.set(i, o.root);
|
|
2273
|
-
r = n, this.viewsDirty = !1;
|
|
2274
|
-
} else
|
|
2275
|
-
r = this.snapshot.views;
|
|
2276
|
-
this.payloadsDirty ? (e = new Map(this.payloads), this.payloadsDirty = !1) : e = this.snapshot.payloads;
|
|
2277
|
-
let s = this.rootViewId && this.views.has(this.rootViewId) ? this.views.get(this.rootViewId)?.version : void 0;
|
|
2278
|
-
if (s === void 0)
|
|
2279
|
-
for (const n of this.views.values())
|
|
2280
|
-
s = s === void 0 ? n.version : Math.max(s, n.version);
|
|
2281
|
-
this.snapshot = {
|
|
2282
|
-
rootViewId: this.rootViewId,
|
|
2283
|
-
views: r,
|
|
2284
|
-
payloads: e,
|
|
2285
|
-
version: s
|
|
2286
|
-
};
|
|
2287
|
-
for (const n of this.changedNodeIds)
|
|
2288
|
-
this.nodeVersions.set(n, (this.nodeVersions.get(n) ?? 0) + 1);
|
|
2289
|
-
}
|
|
2290
|
-
notify() {
|
|
2291
|
-
if (this.notifyNodes(), this.structureChanged) {
|
|
2292
|
-
this.structureChanged = !1;
|
|
2293
|
-
for (const r of this.listeners)
|
|
2294
|
-
r();
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
class Ui {
|
|
2299
|
-
streams = /* @__PURE__ */ new Map();
|
|
2300
|
-
listeners = /* @__PURE__ */ new Set();
|
|
2301
|
-
apply(r, e) {
|
|
2302
|
-
const n = this.getOrCreateStreamEntry(r).store.apply(e);
|
|
2303
|
-
return n && this.notify(r), n;
|
|
2304
|
-
}
|
|
2305
|
-
applyStoreOp(r) {
|
|
2306
|
-
if (r.type === "ReplaceStreamSnapshot") {
|
|
2307
|
-
const e = this.getOrCreateStreamEntry(r.snapshot.streamId), s = e.category !== r.snapshot.category;
|
|
2308
|
-
return e.category = r.snapshot.category, e.store.replaceFromWire(r.snapshot) || s ? (this.notify(r.snapshot.streamId), !0) : !1;
|
|
2309
|
-
}
|
|
2310
|
-
if (r.type === "PatchStreamSnapshot") {
|
|
2311
|
-
const e = this.getOrCreateStreamEntry(r.streamId), s = r.category !== void 0 && e.category !== r.category;
|
|
2312
|
-
return r.category !== void 0 && (e.category = r.category), e.store.patchFromOp(r) || s ? (this.notify(r.streamId), !0) : !1;
|
|
2313
|
-
}
|
|
2314
|
-
if (r.type === "ClearStream") {
|
|
2315
|
-
const e = this.streams.get(r.streamId);
|
|
2316
|
-
return e ? (e.store.clear(), this.notify(r.streamId), !0) : !1;
|
|
2317
|
-
}
|
|
2318
|
-
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;
|
|
2319
|
-
}
|
|
2320
|
-
applyStoreOps(r) {
|
|
2321
|
-
for (const e of r)
|
|
2322
|
-
this.applyStoreOp(e);
|
|
2323
|
-
}
|
|
2324
|
-
clear(r) {
|
|
2325
|
-
const e = this.streams.get(r);
|
|
2326
|
-
e && (e.store.clear(), this.notify(r));
|
|
2327
|
-
}
|
|
2328
|
-
remove(r) {
|
|
2329
|
-
this.streams.delete(r) && this.notify(r);
|
|
2330
|
-
}
|
|
2331
|
-
// Puts every existing stream into snapshot mode (see UiStreamStore.enterSnapshotMode) so each one
|
|
2332
|
-
// keeps its current tree visible and ignores diffs until the server's next full snapshot resyncs it.
|
|
2333
|
-
enterSnapshotModeAll() {
|
|
2334
|
-
for (const r of this.streams.values())
|
|
2335
|
-
r.store.enterSnapshotMode();
|
|
2336
|
-
}
|
|
2337
|
-
setCategory(r, e) {
|
|
2338
|
-
const s = this.getOrCreateStreamEntry(r);
|
|
2339
|
-
s.category !== e && (s.category = e, this.notify(r));
|
|
2340
|
-
}
|
|
2341
|
-
getSnapshot(r) {
|
|
2342
|
-
const e = this.streams.get(r);
|
|
2343
|
-
return e ? {
|
|
2344
|
-
...e.store.getSnapshot(),
|
|
2345
|
-
streamId: r,
|
|
2346
|
-
category: e.category
|
|
2347
|
-
} : void 0;
|
|
2348
|
-
}
|
|
2349
|
-
getSnapshots() {
|
|
2350
|
-
const r = [];
|
|
2351
|
-
for (const [e, s] of this.streams) {
|
|
2352
|
-
const n = s.store.getSnapshot();
|
|
2353
|
-
r.push({
|
|
2354
|
-
...n,
|
|
2355
|
-
streamId: e,
|
|
2356
|
-
category: s.category
|
|
2357
|
-
});
|
|
2358
|
-
}
|
|
2359
|
-
return r;
|
|
2360
|
-
}
|
|
2361
|
-
subscribe(r) {
|
|
2362
|
-
return this.listeners.add(r), () => {
|
|
2363
|
-
this.listeners.delete(r);
|
|
2364
|
-
};
|
|
2365
|
-
}
|
|
2366
|
-
getOrCreateStreamEntry(r) {
|
|
2367
|
-
let e = this.streams.get(r);
|
|
2368
|
-
return e || (e = { store: new yi() }, this.streams.set(r, e)), e;
|
|
2369
|
-
}
|
|
2370
|
-
notify(r) {
|
|
2371
|
-
for (const e of this.listeners)
|
|
2372
|
-
e(r);
|
|
2373
|
-
}
|
|
2374
|
-
}
|
|
2375
|
-
function Oi(t, r, e) {
|
|
2376
|
-
if (r.length === 0)
|
|
2377
|
-
return t;
|
|
2378
|
-
const s = /* @__PURE__ */ new Map();
|
|
2379
|
-
for (const n of r)
|
|
2380
|
-
s.set(n.nodeId, n);
|
|
2381
|
-
return $t(t, s);
|
|
2382
|
-
}
|
|
2383
|
-
function $t(t, r, e) {
|
|
2384
|
-
const s = r.get(t.id);
|
|
2385
|
-
let n = t, i = !1;
|
|
2386
|
-
if (s?.textUpdates && s.textUpdates.length > 0) {
|
|
2387
|
-
const f = Fi(t, s.textUpdates);
|
|
2388
|
-
n = f.node, i = f.changed;
|
|
2389
|
-
}
|
|
2390
|
-
let o = !1, a = n.props;
|
|
2391
|
-
if (s?.changedProps && s.changedProps.size > 0)
|
|
2392
|
-
for (const [f, A] of s.changedProps.entries()) {
|
|
2393
|
-
const u = a[f];
|
|
2394
|
-
if (A === void 0)
|
|
2395
|
-
(u !== void 0 || f in a) && (o || (a = G(a), o = !0), delete a[f]);
|
|
2396
|
-
else if (q(A)) {
|
|
2397
|
-
const h = G(A);
|
|
2398
|
-
M(h, u) || (o || (a = G(a), o = !0), a[f] = h);
|
|
2399
|
-
} else
|
|
2400
|
-
M(A, u) || (o || (a = G(a), o = !0), a[f] = A);
|
|
2401
|
-
}
|
|
2402
|
-
let _ = !1, I = n.styleIds;
|
|
2403
|
-
s?.styleIds !== void 0 && (Wt(n.styleIds, s.styleIds) || (I = s.styleIds, _ = !0));
|
|
2404
|
-
const E = n.children ?? [];
|
|
2405
|
-
let l = E, c = !1;
|
|
2406
|
-
if (s?.removals && s.removals.length > 0 || s?.moves && s.moves.length > 0 || s?.inserts && s.inserts.length > 0) {
|
|
2407
|
-
const f = l.slice();
|
|
2408
|
-
if (s?.removals && s.removals.length > 0) {
|
|
2409
|
-
const A = [...s.removals].sort((u, h) => h.index - u.index);
|
|
2410
|
-
for (const u of A)
|
|
2411
|
-
if (u.index >= 0 && u.index < f.length && f[u.index].id === u.nodeId)
|
|
2412
|
-
f.splice(u.index, 1);
|
|
2413
|
-
else {
|
|
2414
|
-
const h = f.findIndex((C) => C.id === u.nodeId);
|
|
2415
|
-
h >= 0 && f.splice(h, 1);
|
|
2416
|
-
}
|
|
2417
|
-
c = !0;
|
|
2418
|
-
}
|
|
2419
|
-
if (s?.moves && s.moves.length > 0) {
|
|
2420
|
-
const A = [...s.moves].sort((h, C) => h.toIndex - C.toIndex), u = /* @__PURE__ */ new Map();
|
|
2421
|
-
for (const h of A) {
|
|
2422
|
-
const C = f.findIndex((z) => z.id === h.nodeId);
|
|
2423
|
-
C >= 0 && (u.set(h.nodeId, f[C]), f.splice(C, 1));
|
|
2424
|
-
}
|
|
2425
|
-
for (const h of A) {
|
|
2426
|
-
const C = u.get(h.nodeId);
|
|
2427
|
-
if (C) {
|
|
2428
|
-
const z = Math.min(h.toIndex, f.length);
|
|
2429
|
-
f.splice(z, 0, C);
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
c = !0;
|
|
2433
|
-
}
|
|
2434
|
-
if (s?.inserts && s.inserts.length > 0) {
|
|
2435
|
-
const A = [...s.inserts].sort((u, h) => u.index - h.index);
|
|
2436
|
-
for (const u of A) {
|
|
2437
|
-
f.some((C) => C.id === u.node.id) && Li.warn(`Duplicate node id '${u.node.id}' (type '${u.node.type}') inserted next to an existing sibling — UI tree diverged from the server`);
|
|
2438
|
-
const h = Math.min(u.index, f.length);
|
|
2439
|
-
f.splice(h, 0, u.node);
|
|
2440
|
-
}
|
|
2441
|
-
c = !0;
|
|
2442
|
-
}
|
|
2443
|
-
l = f;
|
|
2444
|
-
}
|
|
2445
|
-
let d;
|
|
2446
|
-
for (let f = 0; f < l.length; f++) {
|
|
2447
|
-
const A = l[f], u = $t(A, r);
|
|
2448
|
-
u !== A && (d || (d = l.slice()), d[f] = u);
|
|
2449
|
-
}
|
|
2450
|
-
return d && (l = d, c = !0), i || o || _ || c ? !o && !c && !_ ? n : {
|
|
2451
|
-
id: t.id,
|
|
2452
|
-
type: t.type,
|
|
2453
|
-
props: o ? a : n.props,
|
|
2454
|
-
children: c ? l : E,
|
|
2455
|
-
styleIds: _ ? I : n.styleIds,
|
|
2456
|
-
...t.sourceMarker ? { sourceMarker: t.sourceMarker } : {}
|
|
2457
|
-
} : t;
|
|
2458
|
-
}
|
|
2459
|
-
function B(t, r) {
|
|
2460
|
-
if (r.add(t.id), t.children)
|
|
2461
|
-
for (const e of t.children)
|
|
2462
|
-
B(e, r);
|
|
2463
|
-
}
|
|
2464
|
-
const X = [];
|
|
2465
|
-
function mi(t) {
|
|
2466
|
-
for (; X.length <= t; )
|
|
2467
|
-
X.push(/* @__PURE__ */ new Map());
|
|
2468
|
-
return X[t].clear(), X[t];
|
|
2469
|
-
}
|
|
2470
|
-
function J(t, r, e) {
|
|
2471
|
-
Xt(t, r, e, 0);
|
|
2472
|
-
}
|
|
2473
|
-
function Xt(t, r, e, s) {
|
|
2474
|
-
if (t === r)
|
|
2475
|
-
return;
|
|
2476
|
-
(t.type !== r.type || !Pi(t.props, r.props) || !Wt(t.styleIds, r.styleIds)) && e.add(r.id);
|
|
2477
|
-
const i = t.children ?? [], o = r.children ?? [];
|
|
2478
|
-
if (i !== o) {
|
|
2479
|
-
const a = mi(s);
|
|
2480
|
-
for (const I of i)
|
|
2481
|
-
a.set(I.id, I);
|
|
2482
|
-
let _ = !1;
|
|
2483
|
-
for (let I = 0; I < o.length; I++) {
|
|
2484
|
-
const E = o[I], l = a.get(E.id);
|
|
2485
|
-
l ? (Xt(l, E, e, s + 1), !_ && I < i.length && i[I].id !== E.id && (_ = !0)) : (B(E, e), _ = !0);
|
|
2486
|
-
}
|
|
2487
|
-
(i.length !== o.length || _) && e.add(r.id);
|
|
2488
|
-
}
|
|
2489
|
-
}
|
|
2490
|
-
function Pi(t, r) {
|
|
2491
|
-
return M(t, r);
|
|
2492
|
-
}
|
|
2493
|
-
function jt(t, r) {
|
|
2494
|
-
if (t.id === r)
|
|
2495
|
-
return t;
|
|
2496
|
-
if (t.children)
|
|
2497
|
-
for (const e of t.children) {
|
|
2498
|
-
const s = jt(e, r);
|
|
2499
|
-
if (s)
|
|
2500
|
-
return s;
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
function Wt(t, r) {
|
|
2504
|
-
return M(t, r);
|
|
2505
|
-
}
|
|
2506
|
-
function gi(t, r) {
|
|
2507
|
-
if (r.length === 0)
|
|
2508
|
-
return t;
|
|
2509
|
-
const e = [...r].sort((i, o) => i.start - o.start);
|
|
2510
|
-
let s = t, n = 0;
|
|
2511
|
-
for (const i of e) {
|
|
2512
|
-
const o = ot(i.start + n, 0, s.length);
|
|
2513
|
-
if (i.end == null) {
|
|
2514
|
-
const E = s.slice(o), l = bi(E, i.insertedText);
|
|
2515
|
-
s = s.slice(0, o) + i.insertedText + E.slice(l), n += i.insertedText.length - l;
|
|
2516
|
-
continue;
|
|
2517
|
-
}
|
|
2518
|
-
const a = i.end + n, _ = ot(a, o, s.length), I = _ - o;
|
|
2519
|
-
s = s.slice(0, o) + i.insertedText + s.slice(_), n += i.insertedText.length - I;
|
|
2520
|
-
}
|
|
2521
|
-
return s;
|
|
2522
|
-
}
|
|
2523
|
-
function Fi(t, r, e) {
|
|
2524
|
-
if (r.length === 0)
|
|
2525
|
-
return { node: t, changed: !1 };
|
|
2526
|
-
const s = /* @__PURE__ */ new Map();
|
|
2527
|
-
for (const n of r) {
|
|
2528
|
-
const i = s.get(n.nodeId);
|
|
2529
|
-
i ? i.push(n) : s.set(n.nodeId, [n]);
|
|
2530
|
-
}
|
|
2531
|
-
return zt(t, s);
|
|
2532
|
-
}
|
|
2533
|
-
function zt(t, r, e) {
|
|
2534
|
-
const s = r.get(t.id) ?? [];
|
|
2535
|
-
let n = !1, i = t.props;
|
|
2536
|
-
if (s.length > 0) {
|
|
2537
|
-
const I = /* @__PURE__ */ new Map();
|
|
2538
|
-
for (const E of s) {
|
|
2539
|
-
const l = I.get(E.propertyName);
|
|
2540
|
-
l ? l.push(E) : I.set(E.propertyName, [E]);
|
|
2541
|
-
}
|
|
2542
|
-
for (const [E, l] of I.entries()) {
|
|
2543
|
-
const c = i[E], d = gi(typeof c == "string" ? c : "", l);
|
|
2544
|
-
n || (i = G(i), n = !0), i[E] = d;
|
|
2545
|
-
}
|
|
2546
|
-
}
|
|
2547
|
-
let o = !1;
|
|
2548
|
-
const a = t.children ?? [];
|
|
2549
|
-
let _ = a;
|
|
2550
|
-
if (a.length > 0) {
|
|
2551
|
-
let I;
|
|
2552
|
-
for (let E = 0; E < a.length; E++) {
|
|
2553
|
-
const l = a[E], c = zt(l, r);
|
|
2554
|
-
c.changed && (I || (I = [...a]), I[E] = c.node);
|
|
2555
|
-
}
|
|
2556
|
-
I && (_ = I, o = !0);
|
|
2557
|
-
}
|
|
2558
|
-
return !n && !o ? { node: t, changed: !1 } : {
|
|
2559
|
-
node: {
|
|
2560
|
-
id: t.id,
|
|
2561
|
-
type: t.type,
|
|
2562
|
-
props: n ? i : t.props,
|
|
2563
|
-
children: o ? _ : a,
|
|
2564
|
-
styleIds: t.styleIds,
|
|
2565
|
-
...t.sourceMarker ? { sourceMarker: t.sourceMarker } : {}
|
|
2566
|
-
},
|
|
2567
|
-
changed: !0
|
|
2568
|
-
};
|
|
2569
|
-
}
|
|
2570
|
-
function ot(t, r, e) {
|
|
2571
|
-
return Math.max(r, Math.min(e, t));
|
|
2572
|
-
}
|
|
2573
|
-
function bi(t, r) {
|
|
2574
|
-
const e = Math.min(t.length, r.length);
|
|
2575
|
-
let s = 0;
|
|
2576
|
-
for (; s < e && t.charCodeAt(s) === r.charCodeAt(s); )
|
|
2577
|
-
s++;
|
|
2578
|
-
return s;
|
|
2579
|
-
}
|
|
2580
|
-
function G(t) {
|
|
2581
|
-
const r = {}, e = Object.keys(t);
|
|
2582
|
-
for (let s = 0; s < e.length; s++) {
|
|
2583
|
-
const n = e[s];
|
|
2584
|
-
r[n] = t[n];
|
|
2585
|
-
}
|
|
2586
|
-
return r;
|
|
2587
|
-
}
|
|
2588
|
-
function q(t) {
|
|
2589
|
-
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2590
|
-
}
|
|
2591
|
-
function M(t, r) {
|
|
2592
|
-
if (Object.is(t, r))
|
|
2593
|
-
return !0;
|
|
2594
|
-
if (Array.isArray(t) && Array.isArray(r)) {
|
|
2595
|
-
if (t.length !== r.length)
|
|
2596
|
-
return !1;
|
|
2597
|
-
for (let e = 0; e < t.length; e++)
|
|
2598
|
-
if (!M(t[e], r[e]))
|
|
2599
|
-
return !1;
|
|
2600
|
-
return !0;
|
|
2601
|
-
}
|
|
2602
|
-
if (q(t) && q(r)) {
|
|
2603
|
-
const e = Object.keys(t), s = Object.keys(r);
|
|
2604
|
-
if (e.length !== s.length)
|
|
2605
|
-
return !1;
|
|
2606
|
-
for (const n of e)
|
|
2607
|
-
if (!M(t[n], r[n]))
|
|
2608
|
-
return !1;
|
|
2609
|
-
return !0;
|
|
2610
|
-
}
|
|
2611
|
-
return !1;
|
|
2612
|
-
}
|
|
2613
|
-
const Mi = 16, vi = 50, w = new Ui(), v = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map();
|
|
2614
|
-
let Jt = Mi, Qt = vi, V = [], x = null, H = null, U = 0, j = 0;
|
|
2615
|
-
const g = /* @__PURE__ */ new Map();
|
|
2616
|
-
function ki() {
|
|
2617
|
-
return typeof performance < "u" ? performance.now() : Date.now();
|
|
2618
|
-
}
|
|
2619
|
-
function Gi() {
|
|
2620
|
-
try {
|
|
2621
|
-
return crypto.randomUUID();
|
|
2622
|
-
} catch {
|
|
2623
|
-
return `${Date.now()}_${Math.random().toString(16).slice(2)}`;
|
|
2624
|
-
}
|
|
2625
|
-
}
|
|
2626
|
-
function Bi(t) {
|
|
2627
|
-
const r = [];
|
|
2628
|
-
for (const s of t.views)
|
|
2629
|
-
r.push(s);
|
|
2630
|
-
const e = [];
|
|
2631
|
-
for (const s of t.payloads)
|
|
2632
|
-
e.push(s);
|
|
2633
|
-
return {
|
|
2634
|
-
streamId: t.streamId,
|
|
2635
|
-
category: t.category,
|
|
2636
|
-
version: t.version ?? -1,
|
|
2637
|
-
rootViewId: t.rootViewId,
|
|
2638
|
-
views: r,
|
|
2639
|
-
payloads: e
|
|
2640
|
-
};
|
|
2641
|
-
}
|
|
2642
|
-
function Vi(t, r, e) {
|
|
2643
|
-
if (!e || e.version === -1)
|
|
2644
|
-
return { type: "ReplaceStreamSnapshot", snapshot: Bi(r) };
|
|
2645
|
-
let s, n;
|
|
2646
|
-
for (const [a, _] of r.views)
|
|
2647
|
-
e.views.get(a) !== _ && (s ??= []).push([a, _]);
|
|
2648
|
-
for (const a of e.views.keys())
|
|
2649
|
-
r.views.has(a) || (n ??= []).push(a);
|
|
2650
|
-
let i, o;
|
|
2651
|
-
for (const [a, _] of r.payloads)
|
|
2652
|
-
e.payloads.get(a) !== _ && (i ??= []).push([a, _]);
|
|
2653
|
-
for (const a of e.payloads.keys())
|
|
2654
|
-
r.payloads.has(a) || (o ??= []).push(a);
|
|
2655
|
-
return {
|
|
2656
|
-
type: "PatchStreamSnapshot",
|
|
2657
|
-
streamId: t,
|
|
2658
|
-
category: r.category,
|
|
2659
|
-
nextVersion: r.version ?? -1,
|
|
2660
|
-
expectedBaseVersion: e.version ?? -1,
|
|
2661
|
-
rootViewId: r.rootViewId,
|
|
2662
|
-
upsertViews: s,
|
|
2663
|
-
deleteViews: n,
|
|
2664
|
-
upsertPayloads: i,
|
|
2665
|
-
deletePayloads: o
|
|
2666
|
-
};
|
|
2667
|
-
}
|
|
2668
|
-
function qt() {
|
|
2669
|
-
x || (x = setTimeout(at, Jt)), H || (H = setTimeout(at, Qt));
|
|
2670
|
-
}
|
|
2671
|
-
function P(t) {
|
|
2672
|
-
V.push(t), qt();
|
|
2673
|
-
}
|
|
2674
|
-
function at() {
|
|
2675
|
-
if (x && (clearTimeout(x), x = null), H && (clearTimeout(H), H = null), V.length === 0 && g.size === 0) {
|
|
2676
|
-
U = 0, j = 0;
|
|
2677
|
-
return;
|
|
2678
|
-
}
|
|
2679
|
-
const t = [];
|
|
2680
|
-
for (const [e, s] of g)
|
|
2681
|
-
t.push({ trackId: e, version: s.version, senderId: s.senderId });
|
|
2682
|
-
const r = {
|
|
2683
|
-
batchId: Gi(),
|
|
2684
|
-
createdAtMs: ki(),
|
|
2685
|
-
ops: V,
|
|
2686
|
-
...t.length > 0 ? { acks: t } : {},
|
|
2687
|
-
stats: { uiMessagesConsumed: U, bytesConsumed: j }
|
|
2688
|
-
};
|
|
2689
|
-
V = [], U = 0, j = 0, g.clear(), self.postMessage(r);
|
|
2690
|
-
}
|
|
2691
|
-
function Zt(t) {
|
|
2692
|
-
return `${t.senderId}_${t.trackId}`;
|
|
2693
|
-
}
|
|
2694
|
-
async function xi(t) {
|
|
2695
|
-
const r = await Un(t), e = /* @__PURE__ */ new Set();
|
|
2696
|
-
for (const s of Object.values(r.UIStreams ?? {})) {
|
|
2697
|
-
const n = s.StreamId;
|
|
2698
|
-
e.add(n);
|
|
2699
|
-
const i = s.Info?.Category;
|
|
2700
|
-
w.getSnapshot(n)?.category !== i && (w.setCategory(n, i), P({ type: "SetStreamCategory", streamId: n, category: i }));
|
|
2701
|
-
}
|
|
2702
|
-
for (const s of w.getSnapshots())
|
|
2703
|
-
e.has(s.streamId) || (w.remove(s.streamId), Y.delete(s.streamId), P({ type: "RemoveStream", streamId: s.streamId }));
|
|
2704
|
-
}
|
|
2705
|
-
async function Hi(t) {
|
|
2706
|
-
const r = Z(t), e = Zt(r), s = await Hs(t), n = Ni(s), i = g.get(r.trackId);
|
|
2707
|
-
if ((i === void 0 || n.snapshot.version > i.version) && (g.set(r.trackId, { version: n.snapshot.version, senderId: r.senderId }), qt()), !w.apply(e, n))
|
|
2708
|
-
return;
|
|
2709
|
-
const a = w.getSnapshot(e);
|
|
2710
|
-
if (!a)
|
|
2711
|
-
return;
|
|
2712
|
-
const _ = Y.get(e);
|
|
2713
|
-
Y.set(e, a), P(Vi(e, a, _));
|
|
2714
|
-
}
|
|
2715
|
-
async function Yi(t) {
|
|
2716
|
-
const r = await Is(t);
|
|
2717
|
-
if (!r.StyleId)
|
|
2718
|
-
return;
|
|
2719
|
-
const e = {
|
|
2720
|
-
styleId: r.StyleId,
|
|
2721
|
-
css: r.Style?.css,
|
|
2722
|
-
common: r.Style?.common
|
|
2723
|
-
}, s = v.get(e.styleId);
|
|
2724
|
-
s && s.css === e.css && s.common === e.common || (v.set(e.styleId, e), P({ type: "UpsertUiStyle", style: e }));
|
|
2725
|
-
}
|
|
2726
|
-
async function pi(t) {
|
|
2727
|
-
const r = await Ns(t);
|
|
2728
|
-
if (r.Styles)
|
|
2729
|
-
for (const e of r.Styles) {
|
|
2730
|
-
if (!e.StyleId)
|
|
2731
|
-
continue;
|
|
2732
|
-
const s = {
|
|
2733
|
-
styleId: e.StyleId,
|
|
2734
|
-
css: e.Style?.css,
|
|
2735
|
-
common: e.Style?.common
|
|
2736
|
-
}, n = v.get(s.styleId);
|
|
2737
|
-
n && n.css === s.css && n.common === s.common || (v.set(s.styleId, s), P({ type: "UpsertUiStyle", style: s }));
|
|
2738
|
-
}
|
|
2739
|
-
}
|
|
2740
|
-
function Ki(t) {
|
|
2741
|
-
const r = Z(t), e = Zt(r);
|
|
2742
|
-
w.clear(e), Y.delete(e), P({ type: "ClearStream", streamId: e });
|
|
2743
|
-
}
|
|
2744
|
-
async function $i(t) {
|
|
2745
|
-
const r = await Fs(t);
|
|
2746
|
-
if (!(!r.StyleIds || r.StyleIds.length === 0))
|
|
2747
|
-
for (const e of r.StyleIds)
|
|
2748
|
-
v.delete(e) && P({ type: "RemoveUiStyle", styleId: e });
|
|
2749
|
-
}
|
|
2750
|
-
async function Xi(t) {
|
|
2751
|
-
const r = new Uint8Array(t);
|
|
2752
|
-
j += r.byteLength;
|
|
2753
|
-
const e = r;
|
|
2754
|
-
switch (ee(e)) {
|
|
2755
|
-
case m.CORE_GLOBAL_STATE:
|
|
2756
|
-
await xi(e), U++;
|
|
2757
|
-
return;
|
|
2758
|
-
case m.UI_UPDATE:
|
|
2759
|
-
try {
|
|
2760
|
-
await Hi(e);
|
|
2761
|
-
} catch (n) {
|
|
2762
|
-
return n instanceof R, void 0;
|
|
2763
|
-
} finally {
|
|
2764
|
-
U++;
|
|
2765
|
-
}
|
|
2766
|
-
return;
|
|
2767
|
-
case m.UI_STYLES:
|
|
2768
|
-
await Yi(e), U++;
|
|
2769
|
-
return;
|
|
2770
|
-
case m.UI_STYLES_BATCH:
|
|
2771
|
-
await pi(e), U++;
|
|
2772
|
-
return;
|
|
2773
|
-
case m.UI_STYLES_DELETE:
|
|
2774
|
-
await $i(e), U++;
|
|
2775
|
-
return;
|
|
2776
|
-
case m.ACTION_UI_CLEAR_STREAM:
|
|
2777
|
-
Ki(e), U++;
|
|
2778
|
-
return;
|
|
2779
|
-
default:
|
|
2780
|
-
return;
|
|
2781
|
-
}
|
|
2782
|
-
}
|
|
2783
|
-
self.addEventListener("message", (t) => {
|
|
2784
|
-
const r = t.data;
|
|
2785
|
-
if (r.type === "configure") {
|
|
2786
|
-
typeof r.flushIntervalMs == "number" && Number.isFinite(r.flushIntervalMs) && r.flushIntervalMs >= 0 && (Jt = r.flushIntervalMs), typeof r.maxLatencyMs == "number" && Number.isFinite(r.maxLatencyMs) && r.maxLatencyMs >= 0 && (Qt = r.maxLatencyMs);
|
|
2787
|
-
return;
|
|
2788
|
-
}
|
|
2789
|
-
if (r.type === "clear") {
|
|
2790
|
-
V = [], Y.clear(), g.clear(), v.clear();
|
|
2791
|
-
for (const e of w.getSnapshots())
|
|
2792
|
-
w.remove(e.streamId);
|
|
2793
|
-
return;
|
|
2794
|
-
}
|
|
2795
|
-
if (r.type === "snapshotMode") {
|
|
2796
|
-
w.enterSnapshotModeAll();
|
|
2797
|
-
return;
|
|
2798
|
-
}
|
|
2799
|
-
r.type === "protocol" && Xi(r.message).catch(() => {
|
|
2800
|
-
});
|
|
2801
|
-
});
|