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