@nil-/xit 0.2.3 → 0.2.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.
@@ -0,0 +1,2536 @@
1
+ var ne = Object.defineProperty;
2
+ var kt = (s) => {
3
+ throw TypeError(s);
4
+ };
5
+ var ae = (s, t, e) => t in s ? ne(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
6
+ var n = (s, t, e) => ae(s, typeof t != "symbol" ? t + "" : t, e), It = (s, t, e) => t.has(s) || kt("Cannot " + e);
7
+ var u = (s, t, e) => (It(s, t, "read from private field"), e ? e.call(s) : t.get(s)), W = (s, t, e) => t.has(s) ? kt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), w = (s, t, e, i) => (It(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e), wt = (s, t, e) => (It(s, t, "access private method"), e);
8
+ import { w as et, g as At } from "./svelte/store.js";
9
+ const mt = 2500;
10
+ var _t, Ft, v, rt, ot, lt, x, g;
11
+ class ft {
12
+ constructor(t) {
13
+ W(this, _t);
14
+ W(this, v);
15
+ // 0 idle, 1 has connected, 2 keep reconnecting, 3 stopped
16
+ W(this, rt);
17
+ W(this, ot);
18
+ W(this, lt);
19
+ W(this, x);
20
+ W(this, g);
21
+ w(this, x, t), w(this, v, 0), w(this, rt, null), w(this, ot, null), w(this, lt, null), w(this, g, null);
22
+ }
23
+ on_message(t) {
24
+ w(this, lt, t);
25
+ }
26
+ on_connect(t) {
27
+ w(this, rt, t);
28
+ }
29
+ on_disconnect(t) {
30
+ w(this, ot, t);
31
+ }
32
+ // non-blocking (run is blocking in c++)
33
+ // calling it again should not do anything
34
+ start() {
35
+ u(this, g) == null && u(this, v) !== 1 && u(this, v) !== 3 && (w(this, g, new WebSocket(`ws://${u(this, x)}`)), u(this, g).binaryType = "arraybuffer", u(this, g).onopen = () => {
36
+ u(this, v) == 3 ? this.stop() : (w(this, v, 1), u(this, rt) && u(this, rt).call(this, u(this, x)));
37
+ }, u(this, g).onclose = () => {
38
+ u(this, v) === 1 && (u(this, ot) && u(this, ot).call(this, u(this, x)), w(this, v, 2), wt(this, _t, Ft).call(this));
39
+ }, u(this, g).onerror = () => {
40
+ u(this, v) !== 1 && u(this, v) !== 3 ? (w(this, v, 2), wt(this, _t, Ft).call(this)) : u(this, v) === 3 && this.stop();
41
+ }, u(this, g).onmessage = (t) => {
42
+ u(this, lt) && u(this, lt).call(this, u(this, x), new Uint8Array(t.data));
43
+ });
44
+ }
45
+ stop() {
46
+ w(this, v, 3), u(this, g) != null && u(this, g).readyState !== WebSocket.CONNECTING && (u(this, g).close(), w(this, g, null));
47
+ }
48
+ restart() {
49
+ w(this, v, 0);
50
+ }
51
+ publish(t) {
52
+ u(this, g) != null && u(this, v) == 1 && u(this, g).send(t);
53
+ }
54
+ send(t, e) {
55
+ t === u(this, x) && this.publish(e);
56
+ }
57
+ }
58
+ _t = new WeakSet(), Ft = function() {
59
+ u(this, g) != null && (u(this, g).close(), w(this, g, null)), setTimeout(() => this.start(), 1e3);
60
+ }, v = new WeakMap(), rt = new WeakMap(), ot = new WeakMap(), lt = new WeakMap(), x = new WeakMap(), g = new WeakMap();
61
+ const ht = (s) => {
62
+ const t = new Uint8Array(4);
63
+ return new DataView(t.buffer).setUint32(0, s, !1), t;
64
+ }, dt = (s) => {
65
+ const t = new Uint8Array(s.reduce((i, a) => i + a.length, 0));
66
+ let e = 0;
67
+ for (const i of s)
68
+ t.set(i, e), e += i.length;
69
+ return t;
70
+ }, re = async (s) => new Promise((t, e) => {
71
+ const i = new ft(s), a = setTimeout(() => {
72
+ i.stop(), e("connection failed... stopping");
73
+ }, mt);
74
+ i.on_connect(() => {
75
+ clearTimeout(a), i.stop(), t();
76
+ }), i.start();
77
+ }), jt = async (s, t, e, i) => new Promise((a, r) => {
78
+ const o = new ft(s), h = setTimeout(() => {
79
+ o.stop(), r("timed out, cancelled");
80
+ }, mt), c = dt([ht(t), e]);
81
+ o.on_connect(() => o.publish(c)), o.on_message((d, b) => {
82
+ const F = new DataView(b.buffer).getUint32(0, !1), O = b.slice(4), V = i(F, O);
83
+ V != null && (clearTimeout(h), o.stop(), a(V));
84
+ }), o.start();
85
+ }), St = (s, t, e) => {
86
+ const i = new ft(s), a = setTimeout(() => {
87
+ i.stop();
88
+ }, mt);
89
+ i.on_connect(() => {
90
+ clearTimeout(a);
91
+ const r = dt([ht(t), e]);
92
+ i.publish(r), i.stop();
93
+ }), i.start();
94
+ };
95
+ function oe(s) {
96
+ return new Worker(
97
+ "/assets/bundler.js",
98
+ {
99
+ name: s == null ? void 0 : s.name
100
+ }
101
+ );
102
+ }
103
+ const vt = 2, L = 4, E = 4, f = 4, H = new Int32Array(2), yt = new Float32Array(H.buffer), Nt = new Float64Array(H.buffer), bt = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
104
+ var Vt;
105
+ (function(s) {
106
+ s[s.UTF8_BYTES = 1] = "UTF8_BYTES", s[s.UTF16_STRING = 2] = "UTF16_STRING";
107
+ })(Vt || (Vt = {}));
108
+ class P {
109
+ /**
110
+ * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
111
+ */
112
+ constructor(t) {
113
+ this.bytes_ = t, this.position_ = 0, this.text_decoder_ = new TextDecoder();
114
+ }
115
+ /**
116
+ * Create and allocate a new ByteBuffer with a given size.
117
+ */
118
+ static allocate(t) {
119
+ return new P(new Uint8Array(t));
120
+ }
121
+ clear() {
122
+ this.position_ = 0;
123
+ }
124
+ /**
125
+ * Get the underlying `Uint8Array`.
126
+ */
127
+ bytes() {
128
+ return this.bytes_;
129
+ }
130
+ /**
131
+ * Get the buffer's position.
132
+ */
133
+ position() {
134
+ return this.position_;
135
+ }
136
+ /**
137
+ * Set the buffer's position.
138
+ */
139
+ setPosition(t) {
140
+ this.position_ = t;
141
+ }
142
+ /**
143
+ * Get the buffer's capacity.
144
+ */
145
+ capacity() {
146
+ return this.bytes_.length;
147
+ }
148
+ readInt8(t) {
149
+ return this.readUint8(t) << 24 >> 24;
150
+ }
151
+ readUint8(t) {
152
+ return this.bytes_[t];
153
+ }
154
+ readInt16(t) {
155
+ return this.readUint16(t) << 16 >> 16;
156
+ }
157
+ readUint16(t) {
158
+ return this.bytes_[t] | this.bytes_[t + 1] << 8;
159
+ }
160
+ readInt32(t) {
161
+ return this.bytes_[t] | this.bytes_[t + 1] << 8 | this.bytes_[t + 2] << 16 | this.bytes_[t + 3] << 24;
162
+ }
163
+ readUint32(t) {
164
+ return this.readInt32(t) >>> 0;
165
+ }
166
+ readInt64(t) {
167
+ return BigInt.asIntN(64, BigInt(this.readUint32(t)) + (BigInt(this.readUint32(t + 4)) << BigInt(32)));
168
+ }
169
+ readUint64(t) {
170
+ return BigInt.asUintN(64, BigInt(this.readUint32(t)) + (BigInt(this.readUint32(t + 4)) << BigInt(32)));
171
+ }
172
+ readFloat32(t) {
173
+ return H[0] = this.readInt32(t), yt[0];
174
+ }
175
+ readFloat64(t) {
176
+ return H[bt ? 0 : 1] = this.readInt32(t), H[bt ? 1 : 0] = this.readInt32(t + 4), Nt[0];
177
+ }
178
+ writeInt8(t, e) {
179
+ this.bytes_[t] = e;
180
+ }
181
+ writeUint8(t, e) {
182
+ this.bytes_[t] = e;
183
+ }
184
+ writeInt16(t, e) {
185
+ this.bytes_[t] = e, this.bytes_[t + 1] = e >> 8;
186
+ }
187
+ writeUint16(t, e) {
188
+ this.bytes_[t] = e, this.bytes_[t + 1] = e >> 8;
189
+ }
190
+ writeInt32(t, e) {
191
+ this.bytes_[t] = e, this.bytes_[t + 1] = e >> 8, this.bytes_[t + 2] = e >> 16, this.bytes_[t + 3] = e >> 24;
192
+ }
193
+ writeUint32(t, e) {
194
+ this.bytes_[t] = e, this.bytes_[t + 1] = e >> 8, this.bytes_[t + 2] = e >> 16, this.bytes_[t + 3] = e >> 24;
195
+ }
196
+ writeInt64(t, e) {
197
+ this.writeInt32(t, Number(BigInt.asIntN(32, e))), this.writeInt32(t + 4, Number(BigInt.asIntN(32, e >> BigInt(32))));
198
+ }
199
+ writeUint64(t, e) {
200
+ this.writeUint32(t, Number(BigInt.asUintN(32, e))), this.writeUint32(t + 4, Number(BigInt.asUintN(32, e >> BigInt(32))));
201
+ }
202
+ writeFloat32(t, e) {
203
+ yt[0] = e, this.writeInt32(t, H[0]);
204
+ }
205
+ writeFloat64(t, e) {
206
+ Nt[0] = e, this.writeInt32(t, H[bt ? 0 : 1]), this.writeInt32(t + 4, H[bt ? 1 : 0]);
207
+ }
208
+ /**
209
+ * Return the file identifier. Behavior is undefined for FlatBuffers whose
210
+ * schema does not include a file_identifier (likely points at padding or the
211
+ * start of a the root vtable).
212
+ */
213
+ getBufferIdentifier() {
214
+ if (this.bytes_.length < this.position_ + L + E)
215
+ throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");
216
+ let t = "";
217
+ for (let e = 0; e < E; e++)
218
+ t += String.fromCharCode(this.readInt8(this.position_ + L + e));
219
+ return t;
220
+ }
221
+ /**
222
+ * Look up a field in the vtable, return an offset into the object, or 0 if the
223
+ * field is not present.
224
+ */
225
+ __offset(t, e) {
226
+ const i = t - this.readInt32(t);
227
+ return e < this.readInt16(i) ? this.readInt16(i + e) : 0;
228
+ }
229
+ /**
230
+ * Initialize any Table-derived type to point to the union at the given offset.
231
+ */
232
+ __union(t, e) {
233
+ return t.bb_pos = e + this.readInt32(e), t.bb = this, t;
234
+ }
235
+ /**
236
+ * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
237
+ * This allocates a new string and converts to wide chars upon each access.
238
+ *
239
+ * To avoid the conversion to string, pass Encoding.UTF8_BYTES as the
240
+ * "optionalEncoding" argument. This is useful for avoiding conversion when
241
+ * the data will just be packaged back up in another FlatBuffer later on.
242
+ *
243
+ * @param offset
244
+ * @param opt_encoding Defaults to UTF16_STRING
245
+ */
246
+ __string(t, e) {
247
+ t += this.readInt32(t);
248
+ const i = this.readInt32(t);
249
+ t += L;
250
+ const a = this.bytes_.subarray(t, t + i);
251
+ return e === Vt.UTF8_BYTES ? a : this.text_decoder_.decode(a);
252
+ }
253
+ /**
254
+ * Handle unions that can contain string as its member, if a Table-derived type then initialize it,
255
+ * if a string then return a new one
256
+ *
257
+ * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
258
+ * makes the behaviour of __union_with_string different compared to __union
259
+ */
260
+ __union_with_string(t, e) {
261
+ return typeof t == "string" ? this.__string(e) : this.__union(t, e);
262
+ }
263
+ /**
264
+ * Retrieve the relative offset stored at "offset"
265
+ */
266
+ __indirect(t) {
267
+ return t + this.readInt32(t);
268
+ }
269
+ /**
270
+ * Get the start of data of a vector whose offset is stored at "offset" in this object.
271
+ */
272
+ __vector(t) {
273
+ return t + this.readInt32(t) + L;
274
+ }
275
+ /**
276
+ * Get the length of a vector whose offset is stored at "offset" in this object.
277
+ */
278
+ __vector_len(t) {
279
+ return this.readInt32(t + this.readInt32(t));
280
+ }
281
+ __has_identifier(t) {
282
+ if (t.length != E)
283
+ throw new Error("FlatBuffers: file identifier must be length " + E);
284
+ for (let e = 0; e < E; e++)
285
+ if (t.charCodeAt(e) != this.readInt8(this.position() + L + e))
286
+ return !1;
287
+ return !0;
288
+ }
289
+ /**
290
+ * A helper function for generating list for obj api
291
+ */
292
+ createScalarList(t, e) {
293
+ const i = [];
294
+ for (let a = 0; a < e; ++a) {
295
+ const r = t(a);
296
+ r !== null && i.push(r);
297
+ }
298
+ return i;
299
+ }
300
+ /**
301
+ * A helper function for generating list for obj api
302
+ * @param listAccessor function that accepts an index and return data at that index
303
+ * @param listLength listLength
304
+ * @param res result list
305
+ */
306
+ createObjList(t, e) {
307
+ const i = [];
308
+ for (let a = 0; a < e; ++a) {
309
+ const r = t(a);
310
+ r !== null && i.push(r.unpack());
311
+ }
312
+ return i;
313
+ }
314
+ }
315
+ class k {
316
+ /**
317
+ * Create a FlatBufferBuilder.
318
+ */
319
+ constructor(t) {
320
+ this.minalign = 1, this.vtable = null, this.vtable_in_use = 0, this.isNested = !1, this.object_start = 0, this.vtables = [], this.vector_num_elems = 0, this.force_defaults = !1, this.string_maps = null, this.text_encoder = new TextEncoder();
321
+ let e;
322
+ t ? e = t : e = 1024, this.bb = P.allocate(e), this.space = e;
323
+ }
324
+ clear() {
325
+ this.bb.clear(), this.space = this.bb.capacity(), this.minalign = 1, this.vtable = null, this.vtable_in_use = 0, this.isNested = !1, this.object_start = 0, this.vtables = [], this.vector_num_elems = 0, this.force_defaults = !1, this.string_maps = null;
326
+ }
327
+ /**
328
+ * In order to save space, fields that are set to their default value
329
+ * don't get serialized into the buffer. Forcing defaults provides a
330
+ * way to manually disable this optimization.
331
+ *
332
+ * @param forceDefaults true always serializes default values
333
+ */
334
+ forceDefaults(t) {
335
+ this.force_defaults = t;
336
+ }
337
+ /**
338
+ * Get the ByteBuffer representing the FlatBuffer. Only call this after you've
339
+ * called finish(). The actual data starts at the ByteBuffer's current position,
340
+ * not necessarily at 0.
341
+ */
342
+ dataBuffer() {
343
+ return this.bb;
344
+ }
345
+ /**
346
+ * Get the bytes representing the FlatBuffer. Only call this after you've
347
+ * called finish().
348
+ */
349
+ asUint8Array() {
350
+ return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
351
+ }
352
+ /**
353
+ * Prepare to write an element of `size` after `additional_bytes` have been
354
+ * written, e.g. if you write a string, you need to align such the int length
355
+ * field is aligned to 4 bytes, and the string data follows it directly. If all
356
+ * you need to do is alignment, `additional_bytes` will be 0.
357
+ *
358
+ * @param size This is the of the new element to write
359
+ * @param additional_bytes The padding size
360
+ */
361
+ prep(t, e) {
362
+ t > this.minalign && (this.minalign = t);
363
+ const i = ~(this.bb.capacity() - this.space + e) + 1 & t - 1;
364
+ for (; this.space < i + t + e; ) {
365
+ const a = this.bb.capacity();
366
+ this.bb = k.growByteBuffer(this.bb), this.space += this.bb.capacity() - a;
367
+ }
368
+ this.pad(i);
369
+ }
370
+ pad(t) {
371
+ for (let e = 0; e < t; e++)
372
+ this.bb.writeInt8(--this.space, 0);
373
+ }
374
+ writeInt8(t) {
375
+ this.bb.writeInt8(this.space -= 1, t);
376
+ }
377
+ writeInt16(t) {
378
+ this.bb.writeInt16(this.space -= 2, t);
379
+ }
380
+ writeInt32(t) {
381
+ this.bb.writeInt32(this.space -= 4, t);
382
+ }
383
+ writeInt64(t) {
384
+ this.bb.writeInt64(this.space -= 8, t);
385
+ }
386
+ writeFloat32(t) {
387
+ this.bb.writeFloat32(this.space -= 4, t);
388
+ }
389
+ writeFloat64(t) {
390
+ this.bb.writeFloat64(this.space -= 8, t);
391
+ }
392
+ /**
393
+ * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
394
+ * @param value The `int8` to add the buffer.
395
+ */
396
+ addInt8(t) {
397
+ this.prep(1, 0), this.writeInt8(t);
398
+ }
399
+ /**
400
+ * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
401
+ * @param value The `int16` to add the buffer.
402
+ */
403
+ addInt16(t) {
404
+ this.prep(2, 0), this.writeInt16(t);
405
+ }
406
+ /**
407
+ * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
408
+ * @param value The `int32` to add the buffer.
409
+ */
410
+ addInt32(t) {
411
+ this.prep(4, 0), this.writeInt32(t);
412
+ }
413
+ /**
414
+ * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
415
+ * @param value The `int64` to add the buffer.
416
+ */
417
+ addInt64(t) {
418
+ this.prep(8, 0), this.writeInt64(t);
419
+ }
420
+ /**
421
+ * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
422
+ * @param value The `float32` to add the buffer.
423
+ */
424
+ addFloat32(t) {
425
+ this.prep(4, 0), this.writeFloat32(t);
426
+ }
427
+ /**
428
+ * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
429
+ * @param value The `float64` to add the buffer.
430
+ */
431
+ addFloat64(t) {
432
+ this.prep(8, 0), this.writeFloat64(t);
433
+ }
434
+ addFieldInt8(t, e, i) {
435
+ (this.force_defaults || e != i) && (this.addInt8(e), this.slot(t));
436
+ }
437
+ addFieldInt16(t, e, i) {
438
+ (this.force_defaults || e != i) && (this.addInt16(e), this.slot(t));
439
+ }
440
+ addFieldInt32(t, e, i) {
441
+ (this.force_defaults || e != i) && (this.addInt32(e), this.slot(t));
442
+ }
443
+ addFieldInt64(t, e, i) {
444
+ (this.force_defaults || e !== i) && (this.addInt64(e), this.slot(t));
445
+ }
446
+ addFieldFloat32(t, e, i) {
447
+ (this.force_defaults || e != i) && (this.addFloat32(e), this.slot(t));
448
+ }
449
+ addFieldFloat64(t, e, i) {
450
+ (this.force_defaults || e != i) && (this.addFloat64(e), this.slot(t));
451
+ }
452
+ addFieldOffset(t, e, i) {
453
+ (this.force_defaults || e != i) && (this.addOffset(e), this.slot(t));
454
+ }
455
+ /**
456
+ * Structs are stored inline, so nothing additional is being added. `d` is always 0.
457
+ */
458
+ addFieldStruct(t, e, i) {
459
+ e != i && (this.nested(e), this.slot(t));
460
+ }
461
+ /**
462
+ * Structures are always stored inline, they need to be created right
463
+ * where they're used. You'll get this assertion failure if you
464
+ * created it elsewhere.
465
+ */
466
+ nested(t) {
467
+ if (t != this.offset())
468
+ throw new TypeError("FlatBuffers: struct must be serialized inline.");
469
+ }
470
+ /**
471
+ * Should not be creating any other object, string or vector
472
+ * while an object is being constructed
473
+ */
474
+ notNested() {
475
+ if (this.isNested)
476
+ throw new TypeError("FlatBuffers: object serialization must not be nested.");
477
+ }
478
+ /**
479
+ * Set the current vtable at `voffset` to the current location in the buffer.
480
+ */
481
+ slot(t) {
482
+ this.vtable !== null && (this.vtable[t] = this.offset());
483
+ }
484
+ /**
485
+ * @returns Offset relative to the end of the buffer.
486
+ */
487
+ offset() {
488
+ return this.bb.capacity() - this.space;
489
+ }
490
+ /**
491
+ * Doubles the size of the backing ByteBuffer and copies the old data towards
492
+ * the end of the new buffer (since we build the buffer backwards).
493
+ *
494
+ * @param bb The current buffer with the existing data
495
+ * @returns A new byte buffer with the old data copied
496
+ * to it. The data is located at the end of the buffer.
497
+ *
498
+ * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
499
+ * it a uint8Array we need to suppress the type check:
500
+ * @suppress {checkTypes}
501
+ */
502
+ static growByteBuffer(t) {
503
+ const e = t.capacity();
504
+ if (e & 3221225472)
505
+ throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");
506
+ const i = e << 1, a = P.allocate(i);
507
+ return a.setPosition(i - e), a.bytes().set(t.bytes(), i - e), a;
508
+ }
509
+ /**
510
+ * Adds on offset, relative to where it will be written.
511
+ *
512
+ * @param offset The offset to add.
513
+ */
514
+ addOffset(t) {
515
+ this.prep(L, 0), this.writeInt32(this.offset() - t + L);
516
+ }
517
+ /**
518
+ * Start encoding a new object in the buffer. Users will not usually need to
519
+ * call this directly. The FlatBuffers compiler will generate helper methods
520
+ * that call this method internally.
521
+ */
522
+ startObject(t) {
523
+ this.notNested(), this.vtable == null && (this.vtable = []), this.vtable_in_use = t;
524
+ for (let e = 0; e < t; e++)
525
+ this.vtable[e] = 0;
526
+ this.isNested = !0, this.object_start = this.offset();
527
+ }
528
+ /**
529
+ * Finish off writing the object that is under construction.
530
+ *
531
+ * @returns The offset to the object inside `dataBuffer`
532
+ */
533
+ endObject() {
534
+ if (this.vtable == null || !this.isNested)
535
+ throw new Error("FlatBuffers: endObject called without startObject");
536
+ this.addInt32(0);
537
+ const t = this.offset();
538
+ let e = this.vtable_in_use - 1;
539
+ for (; e >= 0 && this.vtable[e] == 0; e--)
540
+ ;
541
+ const i = e + 1;
542
+ for (; e >= 0; e--)
543
+ this.addInt16(this.vtable[e] != 0 ? t - this.vtable[e] : 0);
544
+ const a = 2;
545
+ this.addInt16(t - this.object_start);
546
+ const r = (i + a) * vt;
547
+ this.addInt16(r);
548
+ let o = 0;
549
+ const h = this.space;
550
+ t: for (e = 0; e < this.vtables.length; e++) {
551
+ const c = this.bb.capacity() - this.vtables[e];
552
+ if (r == this.bb.readInt16(c)) {
553
+ for (let d = vt; d < r; d += vt)
554
+ if (this.bb.readInt16(h + d) != this.bb.readInt16(c + d))
555
+ continue t;
556
+ o = this.vtables[e];
557
+ break;
558
+ }
559
+ }
560
+ return o ? (this.space = this.bb.capacity() - t, this.bb.writeInt32(this.space, o - t)) : (this.vtables.push(this.offset()), this.bb.writeInt32(this.bb.capacity() - t, this.offset() - t)), this.isNested = !1, t;
561
+ }
562
+ /**
563
+ * Finalize a buffer, poiting to the given `root_table`.
564
+ */
565
+ finish(t, e, i) {
566
+ const a = i ? f : 0;
567
+ if (e) {
568
+ const r = e;
569
+ if (this.prep(this.minalign, L + E + a), r.length != E)
570
+ throw new TypeError("FlatBuffers: file identifier must be length " + E);
571
+ for (let o = E - 1; o >= 0; o--)
572
+ this.writeInt8(r.charCodeAt(o));
573
+ }
574
+ this.prep(this.minalign, L + a), this.addOffset(t), a && this.addInt32(this.bb.capacity() - this.space), this.bb.setPosition(this.space);
575
+ }
576
+ /**
577
+ * Finalize a size prefixed buffer, pointing to the given `root_table`.
578
+ */
579
+ finishSizePrefixed(t, e) {
580
+ this.finish(t, e, !0);
581
+ }
582
+ /**
583
+ * This checks a required field has been set in a given table that has
584
+ * just been constructed.
585
+ */
586
+ requiredField(t, e) {
587
+ const i = this.bb.capacity() - t, a = i - this.bb.readInt32(i);
588
+ if (!(e < this.bb.readInt16(a) && this.bb.readInt16(a + e) != 0))
589
+ throw new TypeError("FlatBuffers: field " + e + " must be set");
590
+ }
591
+ /**
592
+ * Start a new array/vector of objects. Users usually will not call
593
+ * this directly. The FlatBuffers compiler will create a start/end
594
+ * method for vector types in generated code.
595
+ *
596
+ * @param elem_size The size of each element in the array
597
+ * @param num_elems The number of elements in the array
598
+ * @param alignment The alignment of the array
599
+ */
600
+ startVector(t, e, i) {
601
+ this.notNested(), this.vector_num_elems = e, this.prep(L, t * e), this.prep(i, t * e);
602
+ }
603
+ /**
604
+ * Finish off the creation of an array and all its elements. The array must be
605
+ * created with `startVector`.
606
+ *
607
+ * @returns The offset at which the newly created array
608
+ * starts.
609
+ */
610
+ endVector() {
611
+ return this.writeInt32(this.vector_num_elems), this.offset();
612
+ }
613
+ /**
614
+ * Encode the string `s` in the buffer using UTF-8. If the string passed has
615
+ * already been seen, we return the offset of the already written string
616
+ *
617
+ * @param s The string to encode
618
+ * @return The offset in the buffer where the encoded string starts
619
+ */
620
+ createSharedString(t) {
621
+ if (!t)
622
+ return 0;
623
+ if (this.string_maps || (this.string_maps = /* @__PURE__ */ new Map()), this.string_maps.has(t))
624
+ return this.string_maps.get(t);
625
+ const e = this.createString(t);
626
+ return this.string_maps.set(t, e), e;
627
+ }
628
+ /**
629
+ * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
630
+ * instead of a string, it is assumed to contain valid UTF-8 encoded data.
631
+ *
632
+ * @param s The string to encode
633
+ * @return The offset in the buffer where the encoded string starts
634
+ */
635
+ createString(t) {
636
+ if (t == null)
637
+ return 0;
638
+ let e;
639
+ return t instanceof Uint8Array ? e = t : e = this.text_encoder.encode(t), this.addInt8(0), this.startVector(1, e.length, 1), this.bb.setPosition(this.space -= e.length), this.bb.bytes().set(e, this.space), this.endVector();
640
+ }
641
+ /**
642
+ * Create a byte vector.
643
+ *
644
+ * @param v The bytes to add
645
+ * @returns The offset in the buffer where the byte vector starts
646
+ */
647
+ createByteVector(t) {
648
+ return t == null ? 0 : (this.startVector(1, t.length, 1), this.bb.setPosition(this.space -= t.length), this.bb.bytes().set(t, this.space), this.endVector());
649
+ }
650
+ /**
651
+ * A helper function to pack an object
652
+ *
653
+ * @returns offset of obj
654
+ */
655
+ createObjectOffset(t) {
656
+ return t === null ? 0 : typeof t == "string" ? this.createString(t) : t.pack(this);
657
+ }
658
+ /**
659
+ * A helper function to pack a list of object
660
+ *
661
+ * @returns list of offsets of each non null object
662
+ */
663
+ createObjectOffsetList(t) {
664
+ const e = [];
665
+ for (let i = 0; i < t.length; ++i) {
666
+ const a = t[i];
667
+ if (a !== null)
668
+ e.push(this.createObjectOffset(a));
669
+ else
670
+ throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.");
671
+ }
672
+ return e;
673
+ }
674
+ createStructOffsetList(t, e) {
675
+ return e(this, t.length), this.createObjectOffsetList(t.slice().reverse()), this.endVector();
676
+ }
677
+ }
678
+ class A {
679
+ constructor() {
680
+ n(this, "bb", null);
681
+ n(this, "bb_pos", 0);
682
+ }
683
+ __init(t, e) {
684
+ return this.bb_pos = t, this.bb = e, this;
685
+ }
686
+ static getRootAsFileInfo(t, e) {
687
+ return (e || new A()).__init(t.readInt32(t.position()) + t.position(), t);
688
+ }
689
+ static getSizePrefixedRootAsFileInfo(t, e) {
690
+ return t.setPosition(t.position() + f), (e || new A()).__init(t.readInt32(t.position()) + t.position(), t);
691
+ }
692
+ target(t) {
693
+ const e = this.bb.__offset(this.bb_pos, 4);
694
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
695
+ }
696
+ metadata(t) {
697
+ const e = this.bb.__offset(this.bb_pos, 6);
698
+ return e ? this.bb.readUint8(this.bb.__vector(this.bb_pos + e) + t) : 0;
699
+ }
700
+ metadataLength() {
701
+ const t = this.bb.__offset(this.bb_pos, 6);
702
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
703
+ }
704
+ metadataArray() {
705
+ const t = this.bb.__offset(this.bb_pos, 6);
706
+ return t ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
707
+ }
708
+ static startFileInfo(t) {
709
+ t.startObject(2);
710
+ }
711
+ static addTarget(t, e) {
712
+ t.addFieldOffset(0, e, 0);
713
+ }
714
+ static addMetadata(t, e) {
715
+ t.addFieldOffset(1, e, 0);
716
+ }
717
+ static createMetadataVector(t, e) {
718
+ t.startVector(1, e.length, 1);
719
+ for (let i = e.length - 1; i >= 0; i--)
720
+ t.addInt8(e[i]);
721
+ return t.endVector();
722
+ }
723
+ static startMetadataVector(t, e) {
724
+ t.startVector(1, e, 1);
725
+ }
726
+ static endFileInfo(t) {
727
+ const e = t.endObject();
728
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
729
+ }
730
+ static createFileInfo(t, e, i) {
731
+ return A.startFileInfo(t), A.addTarget(t, e), A.addMetadata(t, i), A.endFileInfo(t);
732
+ }
733
+ unpack() {
734
+ return new Bt(this.target(), this.bb.createScalarList(this.metadata.bind(this), this.metadataLength()));
735
+ }
736
+ unpackTo(t) {
737
+ t.target = this.target(), t.metadata = this.bb.createScalarList(this.metadata.bind(this), this.metadataLength());
738
+ }
739
+ }
740
+ class Bt {
741
+ constructor(t = null, e = []) {
742
+ n(this, "target");
743
+ n(this, "metadata");
744
+ this.target = t, this.metadata = e;
745
+ }
746
+ pack(t) {
747
+ const e = this.target !== null ? t.createString(this.target) : 0, i = A.createMetadataVector(t, this.metadata);
748
+ return A.createFileInfo(t, e, i);
749
+ }
750
+ }
751
+ class N {
752
+ constructor() {
753
+ n(this, "bb", null);
754
+ n(this, "bb_pos", 0);
755
+ }
756
+ __init(t, e) {
757
+ return this.bb_pos = t, this.bb = e, this;
758
+ }
759
+ static getRootAsFrameCache(t, e) {
760
+ return (e || new N()).__init(t.readInt32(t.position()) + t.position(), t);
761
+ }
762
+ static getSizePrefixedRootAsFrameCache(t, e) {
763
+ return t.setPosition(t.position() + f), (e || new N()).__init(t.readInt32(t.position()) + t.position(), t);
764
+ }
765
+ id(t) {
766
+ const e = this.bb.__offset(this.bb_pos, 4);
767
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
768
+ }
769
+ content(t) {
770
+ const e = this.bb.__offset(this.bb_pos, 6);
771
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
772
+ }
773
+ files(t, e) {
774
+ const i = this.bb.__offset(this.bb_pos, 8);
775
+ return i ? (e || new A()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + t * 4), this.bb) : null;
776
+ }
777
+ filesLength() {
778
+ const t = this.bb.__offset(this.bb_pos, 8);
779
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
780
+ }
781
+ static startFrameCache(t) {
782
+ t.startObject(3);
783
+ }
784
+ static addId(t, e) {
785
+ t.addFieldOffset(0, e, 0);
786
+ }
787
+ static addContent(t, e) {
788
+ t.addFieldOffset(1, e, 0);
789
+ }
790
+ static addFiles(t, e) {
791
+ t.addFieldOffset(2, e, 0);
792
+ }
793
+ static createFilesVector(t, e) {
794
+ t.startVector(4, e.length, 4);
795
+ for (let i = e.length - 1; i >= 0; i--)
796
+ t.addOffset(e[i]);
797
+ return t.endVector();
798
+ }
799
+ static startFilesVector(t, e) {
800
+ t.startVector(4, e, 4);
801
+ }
802
+ static endFrameCache(t) {
803
+ const e = t.endObject();
804
+ return t.requiredField(e, 4), t.requiredField(e, 6), t.requiredField(e, 8), e;
805
+ }
806
+ static createFrameCache(t, e, i, a) {
807
+ return N.startFrameCache(t), N.addId(t, e), N.addContent(t, i), N.addFiles(t, a), N.endFrameCache(t);
808
+ }
809
+ unpack() {
810
+ return new Ct(this.id(), this.content(), this.bb.createObjList(this.files.bind(this), this.filesLength()));
811
+ }
812
+ unpackTo(t) {
813
+ t.id = this.id(), t.content = this.content(), t.files = this.bb.createObjList(this.files.bind(this), this.filesLength());
814
+ }
815
+ }
816
+ class Ct {
817
+ constructor(t = null, e = null, i = []) {
818
+ n(this, "id");
819
+ n(this, "content");
820
+ n(this, "files");
821
+ this.id = t, this.content = e, this.files = i;
822
+ }
823
+ pack(t) {
824
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.content !== null ? t.createString(this.content) : 0, a = N.createFilesVector(t, t.createObjectOffsetList(this.files));
825
+ return N.createFrameCache(t, e, i, a);
826
+ }
827
+ }
828
+ var _;
829
+ (function(s) {
830
+ s[s.Client_Unique_FrameInfo_Request = 0] = "Client_Unique_FrameInfo_Request", s[s.Client_Tagged_FrameInfo_Request = 1] = "Client_Tagged_FrameInfo_Request", s[s.Server_Unique_FrameInfo_File_Response = 2] = "Server_Unique_FrameInfo_File_Response", s[s.Server_Tagged_FrameInfo_File_Response = 3] = "Server_Tagged_FrameInfo_File_Response", s[s.Server_Unique_FrameInfo_Content_Response = 4] = "Server_Unique_FrameInfo_Content_Response", s[s.Server_Tagged_FrameInfo_Content_Response = 5] = "Server_Tagged_FrameInfo_Content_Response", s[s.Client_File_Request = 6] = "Client_File_Request", s[s.Server_File_Response = 7] = "Server_File_Response", s[s.Client_Unique_FrameCache = 8] = "Client_Unique_FrameCache", s[s.Client_Tagged_FrameCache = 9] = "Client_Tagged_FrameCache", s[s.Client_Unique_Frame_Loaded = 10] = "Client_Unique_Frame_Loaded", s[s.Client_Tagged_Frame_Loaded = 11] = "Client_Tagged_Frame_Loaded", s[s.Client_Unique_Frame_Subscribe = 12] = "Client_Unique_Frame_Subscribe", s[s.Client_Tagged_Frame_Subscribe = 13] = "Client_Tagged_Frame_Subscribe", s[s.Client_Unique_Frame_Unsubscribe = 14] = "Client_Unique_Frame_Unsubscribe", s[s.Client_Tagged_Frame_Unsubscribe = 15] = "Client_Tagged_Frame_Unsubscribe", s[s.Client_Unique_Value_Request = 16] = "Client_Unique_Value_Request", s[s.Client_Tagged_Value_Request = 17] = "Client_Tagged_Value_Request", s[s.Server_Unique_Value_Response = 18] = "Server_Unique_Value_Response", s[s.Server_Tagged_Value_Response = 19] = "Server_Tagged_Value_Response", s[s.Unique_Value_Update = 20] = "Unique_Value_Update", s[s.Tagged_Value_Update = 21] = "Tagged_Value_Update", s[s.Client_Unique_Signal_Request = 22] = "Client_Unique_Signal_Request", s[s.Client_Tagged_Signal_Request = 23] = "Client_Tagged_Signal_Request", s[s.Server_Unique_Signal_Response = 24] = "Server_Unique_Signal_Response", s[s.Server_Tagged_Signal_Response = 25] = "Server_Tagged_Signal_Response", s[s.Client_Unique_Signal_Notify = 26] = "Client_Unique_Signal_Notify", s[s.Client_Tagged_Signal_Notify = 27] = "Client_Tagged_Signal_Notify";
831
+ })(_ || (_ = {}));
832
+ var q;
833
+ (function(s) {
834
+ s[s.None = 0] = "None", s[s.Boolean = 1] = "Boolean", s[s.Number = 2] = "Number", s[s.Double = 3] = "Double", s[s.String = 4] = "String", s[s.Buffer = 5] = "Buffer";
835
+ })(q || (q = {}));
836
+ class j {
837
+ constructor() {
838
+ n(this, "bb", null);
839
+ n(this, "bb_pos", 0);
840
+ }
841
+ __init(t, e) {
842
+ return this.bb_pos = t, this.bb = e, this;
843
+ }
844
+ static getRootAsSignal(t, e) {
845
+ return (e || new j()).__init(t.readInt32(t.position()) + t.position(), t);
846
+ }
847
+ static getSizePrefixedRootAsSignal(t, e) {
848
+ return t.setPosition(t.position() + f), (e || new j()).__init(t.readInt32(t.position()) + t.position(), t);
849
+ }
850
+ id(t) {
851
+ const e = this.bb.__offset(this.bb_pos, 4);
852
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
853
+ }
854
+ type() {
855
+ const t = this.bb.__offset(this.bb_pos, 6);
856
+ return t ? this.bb.readInt32(this.bb_pos + t) : q.None;
857
+ }
858
+ static startSignal(t) {
859
+ t.startObject(2);
860
+ }
861
+ static addId(t, e) {
862
+ t.addFieldOffset(0, e, 0);
863
+ }
864
+ static addType(t, e) {
865
+ t.addFieldInt32(1, e, q.None);
866
+ }
867
+ static endSignal(t) {
868
+ const e = t.endObject();
869
+ return t.requiredField(e, 4), e;
870
+ }
871
+ static createSignal(t, e, i) {
872
+ return j.startSignal(t), j.addId(t, e), j.addType(t, i), j.endSignal(t);
873
+ }
874
+ unpack() {
875
+ return new le(this.id(), this.type());
876
+ }
877
+ unpackTo(t) {
878
+ t.id = this.id(), t.type = this.type();
879
+ }
880
+ }
881
+ class le {
882
+ constructor(t = null, e = q.None) {
883
+ n(this, "id");
884
+ n(this, "type");
885
+ this.id = t, this.type = e;
886
+ }
887
+ pack(t) {
888
+ const e = this.id !== null ? t.createString(this.id) : 0;
889
+ return j.createSignal(t, e, this.type);
890
+ }
891
+ }
892
+ class Y {
893
+ constructor() {
894
+ n(this, "bb", null);
895
+ n(this, "bb_pos", 0);
896
+ }
897
+ __init(t, e) {
898
+ return this.bb_pos = t, this.bb = e, this;
899
+ }
900
+ static getRootAsTaggedFrameLoaded(t, e) {
901
+ return (e || new Y()).__init(t.readInt32(t.position()) + t.position(), t);
902
+ }
903
+ static getSizePrefixedRootAsTaggedFrameLoaded(t, e) {
904
+ return t.setPosition(t.position() + f), (e || new Y()).__init(t.readInt32(t.position()) + t.position(), t);
905
+ }
906
+ id(t) {
907
+ const e = this.bb.__offset(this.bb_pos, 4);
908
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
909
+ }
910
+ tag(t) {
911
+ const e = this.bb.__offset(this.bb_pos, 6);
912
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
913
+ }
914
+ static startTaggedFrameLoaded(t) {
915
+ t.startObject(2);
916
+ }
917
+ static addId(t, e) {
918
+ t.addFieldOffset(0, e, 0);
919
+ }
920
+ static addTag(t, e) {
921
+ t.addFieldOffset(1, e, 0);
922
+ }
923
+ static endTaggedFrameLoaded(t) {
924
+ const e = t.endObject();
925
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
926
+ }
927
+ static createTaggedFrameLoaded(t, e, i) {
928
+ return Y.startTaggedFrameLoaded(t), Y.addId(t, e), Y.addTag(t, i), Y.endTaggedFrameLoaded(t);
929
+ }
930
+ unpack() {
931
+ return new Ot(this.id(), this.tag());
932
+ }
933
+ unpackTo(t) {
934
+ t.id = this.id(), t.tag = this.tag();
935
+ }
936
+ }
937
+ class Ot {
938
+ constructor(t = null, e = null) {
939
+ n(this, "id");
940
+ n(this, "tag");
941
+ this.id = t, this.tag = e;
942
+ }
943
+ pack(t) {
944
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0;
945
+ return Y.createTaggedFrameLoaded(t, e, i);
946
+ }
947
+ }
948
+ class Z {
949
+ constructor() {
950
+ n(this, "bb", null);
951
+ n(this, "bb_pos", 0);
952
+ }
953
+ __init(t, e) {
954
+ return this.bb_pos = t, this.bb = e, this;
955
+ }
956
+ static getRootAsTaggedFrameSubscribe(t, e) {
957
+ return (e || new Z()).__init(t.readInt32(t.position()) + t.position(), t);
958
+ }
959
+ static getSizePrefixedRootAsTaggedFrameSubscribe(t, e) {
960
+ return t.setPosition(t.position() + f), (e || new Z()).__init(t.readInt32(t.position()) + t.position(), t);
961
+ }
962
+ id(t) {
963
+ const e = this.bb.__offset(this.bb_pos, 4);
964
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
965
+ }
966
+ tag(t) {
967
+ const e = this.bb.__offset(this.bb_pos, 6);
968
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
969
+ }
970
+ static startTaggedFrameSubscribe(t) {
971
+ t.startObject(2);
972
+ }
973
+ static addId(t, e) {
974
+ t.addFieldOffset(0, e, 0);
975
+ }
976
+ static addTag(t, e) {
977
+ t.addFieldOffset(1, e, 0);
978
+ }
979
+ static endTaggedFrameSubscribe(t) {
980
+ const e = t.endObject();
981
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
982
+ }
983
+ static createTaggedFrameSubscribe(t, e, i) {
984
+ return Z.startTaggedFrameSubscribe(t), Z.addId(t, e), Z.addTag(t, i), Z.endTaggedFrameSubscribe(t);
985
+ }
986
+ unpack() {
987
+ return new qt(this.id(), this.tag());
988
+ }
989
+ unpackTo(t) {
990
+ t.id = this.id(), t.tag = this.tag();
991
+ }
992
+ }
993
+ class qt {
994
+ constructor(t = null, e = null) {
995
+ n(this, "id");
996
+ n(this, "tag");
997
+ this.id = t, this.tag = e;
998
+ }
999
+ pack(t) {
1000
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0;
1001
+ return Z.createTaggedFrameSubscribe(t, e, i);
1002
+ }
1003
+ }
1004
+ class J {
1005
+ constructor() {
1006
+ n(this, "bb", null);
1007
+ n(this, "bb_pos", 0);
1008
+ }
1009
+ __init(t, e) {
1010
+ return this.bb_pos = t, this.bb = e, this;
1011
+ }
1012
+ static getRootAsValueBoolean(t, e) {
1013
+ return (e || new J()).__init(t.readInt32(t.position()) + t.position(), t);
1014
+ }
1015
+ static getSizePrefixedRootAsValueBoolean(t, e) {
1016
+ return t.setPosition(t.position() + f), (e || new J()).__init(t.readInt32(t.position()) + t.position(), t);
1017
+ }
1018
+ value() {
1019
+ const t = this.bb.__offset(this.bb_pos, 4);
1020
+ return t ? !!this.bb.readInt8(this.bb_pos + t) : !1;
1021
+ }
1022
+ static startValueBoolean(t) {
1023
+ t.startObject(1);
1024
+ }
1025
+ static addValue(t, e) {
1026
+ t.addFieldInt8(0, +e, 0);
1027
+ }
1028
+ static endValueBoolean(t) {
1029
+ return t.endObject();
1030
+ }
1031
+ static createValueBoolean(t, e) {
1032
+ return J.startValueBoolean(t), J.addValue(t, e), J.endValueBoolean(t);
1033
+ }
1034
+ unpack() {
1035
+ return new Lt(this.value());
1036
+ }
1037
+ unpackTo(t) {
1038
+ t.value = this.value();
1039
+ }
1040
+ }
1041
+ class Lt {
1042
+ constructor(t = !1) {
1043
+ n(this, "value");
1044
+ this.value = t;
1045
+ }
1046
+ pack(t) {
1047
+ return J.createValueBoolean(t, this.value);
1048
+ }
1049
+ }
1050
+ class z {
1051
+ constructor() {
1052
+ n(this, "bb", null);
1053
+ n(this, "bb_pos", 0);
1054
+ }
1055
+ __init(t, e) {
1056
+ return this.bb_pos = t, this.bb = e, this;
1057
+ }
1058
+ static getRootAsValueBuffer(t, e) {
1059
+ return (e || new z()).__init(t.readInt32(t.position()) + t.position(), t);
1060
+ }
1061
+ static getSizePrefixedRootAsValueBuffer(t, e) {
1062
+ return t.setPosition(t.position() + f), (e || new z()).__init(t.readInt32(t.position()) + t.position(), t);
1063
+ }
1064
+ value(t) {
1065
+ const e = this.bb.__offset(this.bb_pos, 4);
1066
+ return e ? this.bb.readUint8(this.bb.__vector(this.bb_pos + e) + t) : 0;
1067
+ }
1068
+ valueLength() {
1069
+ const t = this.bb.__offset(this.bb_pos, 4);
1070
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
1071
+ }
1072
+ valueArray() {
1073
+ const t = this.bb.__offset(this.bb_pos, 4);
1074
+ return t ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
1075
+ }
1076
+ static startValueBuffer(t) {
1077
+ t.startObject(1);
1078
+ }
1079
+ static addValue(t, e) {
1080
+ t.addFieldOffset(0, e, 0);
1081
+ }
1082
+ static createValueVector(t, e) {
1083
+ t.startVector(1, e.length, 1);
1084
+ for (let i = e.length - 1; i >= 0; i--)
1085
+ t.addInt8(e[i]);
1086
+ return t.endVector();
1087
+ }
1088
+ static startValueVector(t, e) {
1089
+ t.startVector(1, e, 1);
1090
+ }
1091
+ static endValueBuffer(t) {
1092
+ return t.endObject();
1093
+ }
1094
+ static createValueBuffer(t, e) {
1095
+ return z.startValueBuffer(t), z.addValue(t, e), z.endValueBuffer(t);
1096
+ }
1097
+ unpack() {
1098
+ return new Pt(this.bb.createScalarList(this.value.bind(this), this.valueLength()));
1099
+ }
1100
+ unpackTo(t) {
1101
+ t.value = this.bb.createScalarList(this.value.bind(this), this.valueLength());
1102
+ }
1103
+ }
1104
+ class Pt {
1105
+ constructor(t = []) {
1106
+ n(this, "value");
1107
+ this.value = t;
1108
+ }
1109
+ pack(t) {
1110
+ const e = z.createValueVector(t, this.value);
1111
+ return z.createValueBuffer(t, e);
1112
+ }
1113
+ }
1114
+ class K {
1115
+ constructor() {
1116
+ n(this, "bb", null);
1117
+ n(this, "bb_pos", 0);
1118
+ }
1119
+ __init(t, e) {
1120
+ return this.bb_pos = t, this.bb = e, this;
1121
+ }
1122
+ static getRootAsValueDouble(t, e) {
1123
+ return (e || new K()).__init(t.readInt32(t.position()) + t.position(), t);
1124
+ }
1125
+ static getSizePrefixedRootAsValueDouble(t, e) {
1126
+ return t.setPosition(t.position() + f), (e || new K()).__init(t.readInt32(t.position()) + t.position(), t);
1127
+ }
1128
+ value() {
1129
+ const t = this.bb.__offset(this.bb_pos, 4);
1130
+ return t ? this.bb.readFloat64(this.bb_pos + t) : 0;
1131
+ }
1132
+ static startValueDouble(t) {
1133
+ t.startObject(1);
1134
+ }
1135
+ static addValue(t, e) {
1136
+ t.addFieldFloat64(0, e, 0);
1137
+ }
1138
+ static endValueDouble(t) {
1139
+ return t.endObject();
1140
+ }
1141
+ static createValueDouble(t, e) {
1142
+ return K.startValueDouble(t), K.addValue(t, e), K.endValueDouble(t);
1143
+ }
1144
+ unpack() {
1145
+ return new xt(this.value());
1146
+ }
1147
+ unpackTo(t) {
1148
+ t.value = this.value();
1149
+ }
1150
+ }
1151
+ class xt {
1152
+ constructor(t = 0) {
1153
+ n(this, "value");
1154
+ this.value = t;
1155
+ }
1156
+ pack(t) {
1157
+ return K.createValueDouble(t, this.value);
1158
+ }
1159
+ }
1160
+ class Q {
1161
+ constructor() {
1162
+ n(this, "bb", null);
1163
+ n(this, "bb_pos", 0);
1164
+ }
1165
+ __init(t, e) {
1166
+ return this.bb_pos = t, this.bb = e, this;
1167
+ }
1168
+ static getRootAsValueNumber(t, e) {
1169
+ return (e || new Q()).__init(t.readInt32(t.position()) + t.position(), t);
1170
+ }
1171
+ static getSizePrefixedRootAsValueNumber(t, e) {
1172
+ return t.setPosition(t.position() + f), (e || new Q()).__init(t.readInt32(t.position()) + t.position(), t);
1173
+ }
1174
+ value() {
1175
+ const t = this.bb.__offset(this.bb_pos, 4);
1176
+ return t ? this.bb.readInt64(this.bb_pos + t) : BigInt("0");
1177
+ }
1178
+ static startValueNumber(t) {
1179
+ t.startObject(1);
1180
+ }
1181
+ static addValue(t, e) {
1182
+ t.addFieldInt64(0, e, BigInt("0"));
1183
+ }
1184
+ static endValueNumber(t) {
1185
+ return t.endObject();
1186
+ }
1187
+ static createValueNumber(t, e) {
1188
+ return Q.startValueNumber(t), Q.addValue(t, e), Q.endValueNumber(t);
1189
+ }
1190
+ unpack() {
1191
+ return new Et(this.value());
1192
+ }
1193
+ unpackTo(t) {
1194
+ t.value = this.value();
1195
+ }
1196
+ }
1197
+ class Et {
1198
+ constructor(t = BigInt("0")) {
1199
+ n(this, "value");
1200
+ this.value = t;
1201
+ }
1202
+ pack(t) {
1203
+ return Q.createValueNumber(t, this.value);
1204
+ }
1205
+ }
1206
+ class M {
1207
+ constructor() {
1208
+ n(this, "bb", null);
1209
+ n(this, "bb_pos", 0);
1210
+ }
1211
+ __init(t, e) {
1212
+ return this.bb_pos = t, this.bb = e, this;
1213
+ }
1214
+ static getRootAsValueString(t, e) {
1215
+ return (e || new M()).__init(t.readInt32(t.position()) + t.position(), t);
1216
+ }
1217
+ static getSizePrefixedRootAsValueString(t, e) {
1218
+ return t.setPosition(t.position() + f), (e || new M()).__init(t.readInt32(t.position()) + t.position(), t);
1219
+ }
1220
+ value(t) {
1221
+ const e = this.bb.__offset(this.bb_pos, 4);
1222
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1223
+ }
1224
+ static startValueString(t) {
1225
+ t.startObject(1);
1226
+ }
1227
+ static addValue(t, e) {
1228
+ t.addFieldOffset(0, e, 0);
1229
+ }
1230
+ static endValueString(t) {
1231
+ return t.endObject();
1232
+ }
1233
+ static createValueString(t, e) {
1234
+ return M.startValueString(t), M.addValue(t, e), M.endValueString(t);
1235
+ }
1236
+ unpack() {
1237
+ return new zt(this.value());
1238
+ }
1239
+ unpackTo(t) {
1240
+ t.value = this.value();
1241
+ }
1242
+ }
1243
+ class zt {
1244
+ constructor(t = null) {
1245
+ n(this, "value");
1246
+ this.value = t;
1247
+ }
1248
+ pack(t) {
1249
+ const e = this.value !== null ? t.createString(this.value) : 0;
1250
+ return M.createValueString(t, e);
1251
+ }
1252
+ }
1253
+ var l;
1254
+ (function(s) {
1255
+ s[s.NONE = 0] = "NONE", s[s.ValueBoolean = 1] = "ValueBoolean", s[s.ValueNumber = 2] = "ValueNumber", s[s.ValueDouble = 3] = "ValueDouble", s[s.ValueString = 4] = "ValueString", s[s.ValueBuffer = 5] = "ValueBuffer";
1256
+ })(l || (l = {}));
1257
+ function ut(s, t) {
1258
+ switch (l[s]) {
1259
+ case "NONE":
1260
+ return null;
1261
+ case "ValueBoolean":
1262
+ return t(new J());
1263
+ case "ValueNumber":
1264
+ return t(new Q());
1265
+ case "ValueDouble":
1266
+ return t(new K());
1267
+ case "ValueString":
1268
+ return t(new M());
1269
+ case "ValueBuffer":
1270
+ return t(new z());
1271
+ default:
1272
+ return null;
1273
+ }
1274
+ }
1275
+ class U {
1276
+ constructor() {
1277
+ n(this, "bb", null);
1278
+ n(this, "bb_pos", 0);
1279
+ }
1280
+ __init(t, e) {
1281
+ return this.bb_pos = t, this.bb = e, this;
1282
+ }
1283
+ static getRootAsTaggedSignalNotify(t, e) {
1284
+ return (e || new U()).__init(t.readInt32(t.position()) + t.position(), t);
1285
+ }
1286
+ static getSizePrefixedRootAsTaggedSignalNotify(t, e) {
1287
+ return t.setPosition(t.position() + f), (e || new U()).__init(t.readInt32(t.position()) + t.position(), t);
1288
+ }
1289
+ frameId(t) {
1290
+ const e = this.bb.__offset(this.bb_pos, 4);
1291
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1292
+ }
1293
+ tag(t) {
1294
+ const e = this.bb.__offset(this.bb_pos, 6);
1295
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1296
+ }
1297
+ signalId(t) {
1298
+ const e = this.bb.__offset(this.bb_pos, 8);
1299
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1300
+ }
1301
+ valueType() {
1302
+ const t = this.bb.__offset(this.bb_pos, 10);
1303
+ return t ? this.bb.readUint8(this.bb_pos + t) : l.NONE;
1304
+ }
1305
+ value(t) {
1306
+ const e = this.bb.__offset(this.bb_pos, 12);
1307
+ return e ? this.bb.__union(t, this.bb_pos + e) : null;
1308
+ }
1309
+ static startTaggedSignalNotify(t) {
1310
+ t.startObject(5);
1311
+ }
1312
+ static addFrameId(t, e) {
1313
+ t.addFieldOffset(0, e, 0);
1314
+ }
1315
+ static addTag(t, e) {
1316
+ t.addFieldOffset(1, e, 0);
1317
+ }
1318
+ static addSignalId(t, e) {
1319
+ t.addFieldOffset(2, e, 0);
1320
+ }
1321
+ static addValueType(t, e) {
1322
+ t.addFieldInt8(3, e, l.NONE);
1323
+ }
1324
+ static addValue(t, e) {
1325
+ t.addFieldOffset(4, e, 0);
1326
+ }
1327
+ static endTaggedSignalNotify(t) {
1328
+ const e = t.endObject();
1329
+ return t.requiredField(e, 4), t.requiredField(e, 6), t.requiredField(e, 8), e;
1330
+ }
1331
+ static createTaggedSignalNotify(t, e, i, a, r, o) {
1332
+ return U.startTaggedSignalNotify(t), U.addFrameId(t, e), U.addTag(t, i), U.addSignalId(t, a), U.addValueType(t, r), U.addValue(t, o), U.endTaggedSignalNotify(t);
1333
+ }
1334
+ unpack() {
1335
+ return new Dt(this.frameId(), this.tag(), this.signalId(), this.valueType(), (() => {
1336
+ const t = ut(this.valueType(), this.value.bind(this));
1337
+ return t === null ? null : t.unpack();
1338
+ })());
1339
+ }
1340
+ unpackTo(t) {
1341
+ t.frameId = this.frameId(), t.tag = this.tag(), t.signalId = this.signalId(), t.valueType = this.valueType(), t.value = (() => {
1342
+ const e = ut(this.valueType(), this.value.bind(this));
1343
+ return e === null ? null : e.unpack();
1344
+ })();
1345
+ }
1346
+ }
1347
+ class Dt {
1348
+ constructor(t = null, e = null, i = null, a = l.NONE, r = null) {
1349
+ n(this, "frameId");
1350
+ n(this, "tag");
1351
+ n(this, "signalId");
1352
+ n(this, "valueType");
1353
+ n(this, "value");
1354
+ this.frameId = t, this.tag = e, this.signalId = i, this.valueType = a, this.value = r;
1355
+ }
1356
+ pack(t) {
1357
+ const e = this.frameId !== null ? t.createString(this.frameId) : 0, i = this.tag !== null ? t.createString(this.tag) : 0, a = this.signalId !== null ? t.createString(this.signalId) : 0, r = t.createObjectOffset(this.value);
1358
+ return U.createTaggedSignalNotify(t, e, i, a, this.valueType, r);
1359
+ }
1360
+ }
1361
+ class X {
1362
+ constructor() {
1363
+ n(this, "bb", null);
1364
+ n(this, "bb_pos", 0);
1365
+ }
1366
+ __init(t, e) {
1367
+ return this.bb_pos = t, this.bb = e, this;
1368
+ }
1369
+ static getRootAsTaggedSignalRequest(t, e) {
1370
+ return (e || new X()).__init(t.readInt32(t.position()) + t.position(), t);
1371
+ }
1372
+ static getSizePrefixedRootAsTaggedSignalRequest(t, e) {
1373
+ return t.setPosition(t.position() + f), (e || new X()).__init(t.readInt32(t.position()) + t.position(), t);
1374
+ }
1375
+ id(t) {
1376
+ const e = this.bb.__offset(this.bb_pos, 4);
1377
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1378
+ }
1379
+ tag(t) {
1380
+ const e = this.bb.__offset(this.bb_pos, 6);
1381
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1382
+ }
1383
+ static startTaggedSignalRequest(t) {
1384
+ t.startObject(2);
1385
+ }
1386
+ static addId(t, e) {
1387
+ t.addFieldOffset(0, e, 0);
1388
+ }
1389
+ static addTag(t, e) {
1390
+ t.addFieldOffset(1, e, 0);
1391
+ }
1392
+ static endTaggedSignalRequest(t) {
1393
+ const e = t.endObject();
1394
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
1395
+ }
1396
+ static createTaggedSignalRequest(t, e, i) {
1397
+ return X.startTaggedSignalRequest(t), X.addId(t, e), X.addTag(t, i), X.endTaggedSignalRequest(t);
1398
+ }
1399
+ unpack() {
1400
+ return new Gt(this.id(), this.tag());
1401
+ }
1402
+ unpackTo(t) {
1403
+ t.id = this.id(), t.tag = this.tag();
1404
+ }
1405
+ }
1406
+ class Gt {
1407
+ constructor(t = null, e = null) {
1408
+ n(this, "id");
1409
+ n(this, "tag");
1410
+ this.id = t, this.tag = e;
1411
+ }
1412
+ pack(t) {
1413
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0;
1414
+ return X.createTaggedSignalRequest(t, e, i);
1415
+ }
1416
+ }
1417
+ class T {
1418
+ constructor() {
1419
+ n(this, "bb", null);
1420
+ n(this, "bb_pos", 0);
1421
+ }
1422
+ __init(t, e) {
1423
+ return this.bb_pos = t, this.bb = e, this;
1424
+ }
1425
+ static getRootAsTaggedSignalResponse(t, e) {
1426
+ return (e || new T()).__init(t.readInt32(t.position()) + t.position(), t);
1427
+ }
1428
+ static getSizePrefixedRootAsTaggedSignalResponse(t, e) {
1429
+ return t.setPosition(t.position() + f), (e || new T()).__init(t.readInt32(t.position()) + t.position(), t);
1430
+ }
1431
+ id(t) {
1432
+ const e = this.bb.__offset(this.bb_pos, 4);
1433
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1434
+ }
1435
+ tag(t) {
1436
+ const e = this.bb.__offset(this.bb_pos, 6);
1437
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1438
+ }
1439
+ signals(t, e) {
1440
+ const i = this.bb.__offset(this.bb_pos, 8);
1441
+ return i ? (e || new j()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + t * 4), this.bb) : null;
1442
+ }
1443
+ signalsLength() {
1444
+ const t = this.bb.__offset(this.bb_pos, 8);
1445
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
1446
+ }
1447
+ static startTaggedSignalResponse(t) {
1448
+ t.startObject(3);
1449
+ }
1450
+ static addId(t, e) {
1451
+ t.addFieldOffset(0, e, 0);
1452
+ }
1453
+ static addTag(t, e) {
1454
+ t.addFieldOffset(1, e, 0);
1455
+ }
1456
+ static addSignals(t, e) {
1457
+ t.addFieldOffset(2, e, 0);
1458
+ }
1459
+ static createSignalsVector(t, e) {
1460
+ t.startVector(4, e.length, 4);
1461
+ for (let i = e.length - 1; i >= 0; i--)
1462
+ t.addOffset(e[i]);
1463
+ return t.endVector();
1464
+ }
1465
+ static startSignalsVector(t, e) {
1466
+ t.startVector(4, e, 4);
1467
+ }
1468
+ static endTaggedSignalResponse(t) {
1469
+ const e = t.endObject();
1470
+ return t.requiredField(e, 4), t.requiredField(e, 6), t.requiredField(e, 8), e;
1471
+ }
1472
+ static createTaggedSignalResponse(t, e, i, a) {
1473
+ return T.startTaggedSignalResponse(t), T.addId(t, e), T.addTag(t, i), T.addSignals(t, a), T.endTaggedSignalResponse(t);
1474
+ }
1475
+ unpack() {
1476
+ return new ce(this.id(), this.tag(), this.bb.createObjList(this.signals.bind(this), this.signalsLength()));
1477
+ }
1478
+ unpackTo(t) {
1479
+ t.id = this.id(), t.tag = this.tag(), t.signals = this.bb.createObjList(this.signals.bind(this), this.signalsLength());
1480
+ }
1481
+ }
1482
+ class ce {
1483
+ constructor(t = null, e = null, i = []) {
1484
+ n(this, "id");
1485
+ n(this, "tag");
1486
+ n(this, "signals");
1487
+ this.id = t, this.tag = e, this.signals = i;
1488
+ }
1489
+ pack(t) {
1490
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0, a = T.createSignalsVector(t, t.createObjectOffsetList(this.signals));
1491
+ return T.createTaggedSignalResponse(t, e, i, a);
1492
+ }
1493
+ }
1494
+ class $ {
1495
+ constructor() {
1496
+ n(this, "bb", null);
1497
+ n(this, "bb_pos", 0);
1498
+ }
1499
+ __init(t, e) {
1500
+ return this.bb_pos = t, this.bb = e, this;
1501
+ }
1502
+ static getRootAsTaggedValueRequest(t, e) {
1503
+ return (e || new $()).__init(t.readInt32(t.position()) + t.position(), t);
1504
+ }
1505
+ static getSizePrefixedRootAsTaggedValueRequest(t, e) {
1506
+ return t.setPosition(t.position() + f), (e || new $()).__init(t.readInt32(t.position()) + t.position(), t);
1507
+ }
1508
+ id(t) {
1509
+ const e = this.bb.__offset(this.bb_pos, 4);
1510
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1511
+ }
1512
+ tag(t) {
1513
+ const e = this.bb.__offset(this.bb_pos, 6);
1514
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1515
+ }
1516
+ static startTaggedValueRequest(t) {
1517
+ t.startObject(2);
1518
+ }
1519
+ static addId(t, e) {
1520
+ t.addFieldOffset(0, e, 0);
1521
+ }
1522
+ static addTag(t, e) {
1523
+ t.addFieldOffset(1, e, 0);
1524
+ }
1525
+ static endTaggedValueRequest(t) {
1526
+ const e = t.endObject();
1527
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
1528
+ }
1529
+ static createTaggedValueRequest(t, e, i) {
1530
+ return $.startTaggedValueRequest(t), $.addId(t, e), $.addTag(t, i), $.endTaggedValueRequest(t);
1531
+ }
1532
+ unpack() {
1533
+ return new Wt(this.id(), this.tag());
1534
+ }
1535
+ unpackTo(t) {
1536
+ t.id = this.id(), t.tag = this.tag();
1537
+ }
1538
+ }
1539
+ class Wt {
1540
+ constructor(t = null, e = null) {
1541
+ n(this, "id");
1542
+ n(this, "tag");
1543
+ this.id = t, this.tag = e;
1544
+ }
1545
+ pack(t) {
1546
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0;
1547
+ return $.createTaggedValueRequest(t, e, i);
1548
+ }
1549
+ }
1550
+ class S {
1551
+ constructor() {
1552
+ n(this, "bb", null);
1553
+ n(this, "bb_pos", 0);
1554
+ }
1555
+ __init(t, e) {
1556
+ return this.bb_pos = t, this.bb = e, this;
1557
+ }
1558
+ static getRootAsValue(t, e) {
1559
+ return (e || new S()).__init(t.readInt32(t.position()) + t.position(), t);
1560
+ }
1561
+ static getSizePrefixedRootAsValue(t, e) {
1562
+ return t.setPosition(t.position() + f), (e || new S()).__init(t.readInt32(t.position()) + t.position(), t);
1563
+ }
1564
+ id(t) {
1565
+ const e = this.bb.__offset(this.bb_pos, 4);
1566
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1567
+ }
1568
+ valueType() {
1569
+ const t = this.bb.__offset(this.bb_pos, 6);
1570
+ return t ? this.bb.readUint8(this.bb_pos + t) : l.NONE;
1571
+ }
1572
+ value(t) {
1573
+ const e = this.bb.__offset(this.bb_pos, 8);
1574
+ return e ? this.bb.__union(t, this.bb_pos + e) : null;
1575
+ }
1576
+ static startValue(t) {
1577
+ t.startObject(3);
1578
+ }
1579
+ static addId(t, e) {
1580
+ t.addFieldOffset(0, e, 0);
1581
+ }
1582
+ static addValueType(t, e) {
1583
+ t.addFieldInt8(1, e, l.NONE);
1584
+ }
1585
+ static addValue(t, e) {
1586
+ t.addFieldOffset(2, e, 0);
1587
+ }
1588
+ static endValue(t) {
1589
+ const e = t.endObject();
1590
+ return t.requiredField(e, 4), t.requiredField(e, 8), e;
1591
+ }
1592
+ static createValue(t, e, i, a) {
1593
+ return S.startValue(t), S.addId(t, e), S.addValueType(t, i), S.addValue(t, a), S.endValue(t);
1594
+ }
1595
+ unpack() {
1596
+ return new Ht(this.id(), this.valueType(), (() => {
1597
+ const t = ut(this.valueType(), this.value.bind(this));
1598
+ return t === null ? null : t.unpack();
1599
+ })());
1600
+ }
1601
+ unpackTo(t) {
1602
+ t.id = this.id(), t.valueType = this.valueType(), t.value = (() => {
1603
+ const e = ut(this.valueType(), this.value.bind(this));
1604
+ return e === null ? null : e.unpack();
1605
+ })();
1606
+ }
1607
+ }
1608
+ class Ht {
1609
+ constructor(t = null, e = l.NONE, i = null) {
1610
+ n(this, "id");
1611
+ n(this, "valueType");
1612
+ n(this, "value");
1613
+ this.id = t, this.valueType = e, this.value = i;
1614
+ }
1615
+ pack(t) {
1616
+ const e = this.id !== null ? t.createString(this.id) : 0, i = t.createObjectOffset(this.value);
1617
+ return S.createValue(t, e, this.valueType, i);
1618
+ }
1619
+ }
1620
+ class R {
1621
+ constructor() {
1622
+ n(this, "bb", null);
1623
+ n(this, "bb_pos", 0);
1624
+ }
1625
+ __init(t, e) {
1626
+ return this.bb_pos = t, this.bb = e, this;
1627
+ }
1628
+ static getRootAsTaggedValueResponse(t, e) {
1629
+ return (e || new R()).__init(t.readInt32(t.position()) + t.position(), t);
1630
+ }
1631
+ static getSizePrefixedRootAsTaggedValueResponse(t, e) {
1632
+ return t.setPosition(t.position() + f), (e || new R()).__init(t.readInt32(t.position()) + t.position(), t);
1633
+ }
1634
+ id(t) {
1635
+ const e = this.bb.__offset(this.bb_pos, 4);
1636
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1637
+ }
1638
+ tag(t) {
1639
+ const e = this.bb.__offset(this.bb_pos, 6);
1640
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1641
+ }
1642
+ values(t, e) {
1643
+ const i = this.bb.__offset(this.bb_pos, 8);
1644
+ return i ? (e || new S()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + t * 4), this.bb) : null;
1645
+ }
1646
+ valuesLength() {
1647
+ const t = this.bb.__offset(this.bb_pos, 8);
1648
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
1649
+ }
1650
+ static startTaggedValueResponse(t) {
1651
+ t.startObject(3);
1652
+ }
1653
+ static addId(t, e) {
1654
+ t.addFieldOffset(0, e, 0);
1655
+ }
1656
+ static addTag(t, e) {
1657
+ t.addFieldOffset(1, e, 0);
1658
+ }
1659
+ static addValues(t, e) {
1660
+ t.addFieldOffset(2, e, 0);
1661
+ }
1662
+ static createValuesVector(t, e) {
1663
+ t.startVector(4, e.length, 4);
1664
+ for (let i = e.length - 1; i >= 0; i--)
1665
+ t.addOffset(e[i]);
1666
+ return t.endVector();
1667
+ }
1668
+ static startValuesVector(t, e) {
1669
+ t.startVector(4, e, 4);
1670
+ }
1671
+ static endTaggedValueResponse(t) {
1672
+ const e = t.endObject();
1673
+ return t.requiredField(e, 4), t.requiredField(e, 6), t.requiredField(e, 8), e;
1674
+ }
1675
+ static createTaggedValueResponse(t, e, i, a) {
1676
+ return R.startTaggedValueResponse(t), R.addId(t, e), R.addTag(t, i), R.addValues(t, a), R.endTaggedValueResponse(t);
1677
+ }
1678
+ unpack() {
1679
+ return new ue(this.id(), this.tag(), this.bb.createObjList(this.values.bind(this), this.valuesLength()));
1680
+ }
1681
+ unpackTo(t) {
1682
+ t.id = this.id(), t.tag = this.tag(), t.values = this.bb.createObjList(this.values.bind(this), this.valuesLength());
1683
+ }
1684
+ }
1685
+ class ue {
1686
+ constructor(t = null, e = null, i = []) {
1687
+ n(this, "id");
1688
+ n(this, "tag");
1689
+ n(this, "values");
1690
+ this.id = t, this.tag = e, this.values = i;
1691
+ }
1692
+ pack(t) {
1693
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0, a = R.createValuesVector(t, t.createObjectOffsetList(this.values));
1694
+ return R.createTaggedValueResponse(t, e, i, a);
1695
+ }
1696
+ }
1697
+ class D {
1698
+ constructor() {
1699
+ n(this, "bb", null);
1700
+ n(this, "bb_pos", 0);
1701
+ }
1702
+ __init(t, e) {
1703
+ return this.bb_pos = t, this.bb = e, this;
1704
+ }
1705
+ static getRootAsTaggedValueUpdate(t, e) {
1706
+ return (e || new D()).__init(t.readInt32(t.position()) + t.position(), t);
1707
+ }
1708
+ static getSizePrefixedRootAsTaggedValueUpdate(t, e) {
1709
+ return t.setPosition(t.position() + f), (e || new D()).__init(t.readInt32(t.position()) + t.position(), t);
1710
+ }
1711
+ id(t) {
1712
+ const e = this.bb.__offset(this.bb_pos, 4);
1713
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1714
+ }
1715
+ tag(t) {
1716
+ const e = this.bb.__offset(this.bb_pos, 6);
1717
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1718
+ }
1719
+ value(t) {
1720
+ const e = this.bb.__offset(this.bb_pos, 8);
1721
+ return e ? (t || new S()).__init(this.bb.__indirect(this.bb_pos + e), this.bb) : null;
1722
+ }
1723
+ static startTaggedValueUpdate(t) {
1724
+ t.startObject(3);
1725
+ }
1726
+ static addId(t, e) {
1727
+ t.addFieldOffset(0, e, 0);
1728
+ }
1729
+ static addTag(t, e) {
1730
+ t.addFieldOffset(1, e, 0);
1731
+ }
1732
+ static addValue(t, e) {
1733
+ t.addFieldOffset(2, e, 0);
1734
+ }
1735
+ static endTaggedValueUpdate(t) {
1736
+ const e = t.endObject();
1737
+ return t.requiredField(e, 4), t.requiredField(e, 6), t.requiredField(e, 8), e;
1738
+ }
1739
+ unpack() {
1740
+ return new Yt(this.id(), this.tag(), this.value() !== null ? this.value().unpack() : null);
1741
+ }
1742
+ unpackTo(t) {
1743
+ t.id = this.id(), t.tag = this.tag(), t.value = this.value() !== null ? this.value().unpack() : null;
1744
+ }
1745
+ }
1746
+ class Yt {
1747
+ constructor(t = null, e = null, i = null) {
1748
+ n(this, "id");
1749
+ n(this, "tag");
1750
+ n(this, "value");
1751
+ this.id = t, this.tag = e, this.value = i;
1752
+ }
1753
+ pack(t) {
1754
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.tag !== null ? t.createString(this.tag) : 0, a = this.value !== null ? this.value.pack(t) : 0;
1755
+ return D.startTaggedValueUpdate(t), D.addId(t, e), D.addTag(t, i), D.addValue(t, a), D.endTaggedValueUpdate(t);
1756
+ }
1757
+ }
1758
+ class st {
1759
+ constructor() {
1760
+ n(this, "bb", null);
1761
+ n(this, "bb_pos", 0);
1762
+ }
1763
+ __init(t, e) {
1764
+ return this.bb_pos = t, this.bb = e, this;
1765
+ }
1766
+ static getRootAsUniqueFrameLoaded(t, e) {
1767
+ return (e || new st()).__init(t.readInt32(t.position()) + t.position(), t);
1768
+ }
1769
+ static getSizePrefixedRootAsUniqueFrameLoaded(t, e) {
1770
+ return t.setPosition(t.position() + f), (e || new st()).__init(t.readInt32(t.position()) + t.position(), t);
1771
+ }
1772
+ id(t) {
1773
+ const e = this.bb.__offset(this.bb_pos, 4);
1774
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1775
+ }
1776
+ static startUniqueFrameLoaded(t) {
1777
+ t.startObject(1);
1778
+ }
1779
+ static addId(t, e) {
1780
+ t.addFieldOffset(0, e, 0);
1781
+ }
1782
+ static endUniqueFrameLoaded(t) {
1783
+ const e = t.endObject();
1784
+ return t.requiredField(e, 4), e;
1785
+ }
1786
+ static createUniqueFrameLoaded(t, e) {
1787
+ return st.startUniqueFrameLoaded(t), st.addId(t, e), st.endUniqueFrameLoaded(t);
1788
+ }
1789
+ unpack() {
1790
+ return new Ut(this.id());
1791
+ }
1792
+ unpackTo(t) {
1793
+ t.id = this.id();
1794
+ }
1795
+ }
1796
+ class Ut {
1797
+ constructor(t = null) {
1798
+ n(this, "id");
1799
+ this.id = t;
1800
+ }
1801
+ pack(t) {
1802
+ const e = this.id !== null ? t.createString(this.id) : 0;
1803
+ return st.createUniqueFrameLoaded(t, e);
1804
+ }
1805
+ }
1806
+ class it {
1807
+ constructor() {
1808
+ n(this, "bb", null);
1809
+ n(this, "bb_pos", 0);
1810
+ }
1811
+ __init(t, e) {
1812
+ return this.bb_pos = t, this.bb = e, this;
1813
+ }
1814
+ static getRootAsUniqueFrameSubscribe(t, e) {
1815
+ return (e || new it()).__init(t.readInt32(t.position()) + t.position(), t);
1816
+ }
1817
+ static getSizePrefixedRootAsUniqueFrameSubscribe(t, e) {
1818
+ return t.setPosition(t.position() + f), (e || new it()).__init(t.readInt32(t.position()) + t.position(), t);
1819
+ }
1820
+ id(t) {
1821
+ const e = this.bb.__offset(this.bb_pos, 4);
1822
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1823
+ }
1824
+ static startUniqueFrameSubscribe(t) {
1825
+ t.startObject(1);
1826
+ }
1827
+ static addId(t, e) {
1828
+ t.addFieldOffset(0, e, 0);
1829
+ }
1830
+ static endUniqueFrameSubscribe(t) {
1831
+ const e = t.endObject();
1832
+ return t.requiredField(e, 4), e;
1833
+ }
1834
+ static createUniqueFrameSubscribe(t, e) {
1835
+ return it.startUniqueFrameSubscribe(t), it.addId(t, e), it.endUniqueFrameSubscribe(t);
1836
+ }
1837
+ unpack() {
1838
+ return new Tt(this.id());
1839
+ }
1840
+ unpackTo(t) {
1841
+ t.id = this.id();
1842
+ }
1843
+ }
1844
+ class Tt {
1845
+ constructor(t = null) {
1846
+ n(this, "id");
1847
+ this.id = t;
1848
+ }
1849
+ pack(t) {
1850
+ const e = this.id !== null ? t.createString(this.id) : 0;
1851
+ return it.createUniqueFrameSubscribe(t, e);
1852
+ }
1853
+ }
1854
+ class y {
1855
+ constructor() {
1856
+ n(this, "bb", null);
1857
+ n(this, "bb_pos", 0);
1858
+ }
1859
+ __init(t, e) {
1860
+ return this.bb_pos = t, this.bb = e, this;
1861
+ }
1862
+ static getRootAsUniqueSignalNotify(t, e) {
1863
+ return (e || new y()).__init(t.readInt32(t.position()) + t.position(), t);
1864
+ }
1865
+ static getSizePrefixedRootAsUniqueSignalNotify(t, e) {
1866
+ return t.setPosition(t.position() + f), (e || new y()).__init(t.readInt32(t.position()) + t.position(), t);
1867
+ }
1868
+ frameId(t) {
1869
+ const e = this.bb.__offset(this.bb_pos, 4);
1870
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1871
+ }
1872
+ signalId(t) {
1873
+ const e = this.bb.__offset(this.bb_pos, 6);
1874
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1875
+ }
1876
+ valueType() {
1877
+ const t = this.bb.__offset(this.bb_pos, 8);
1878
+ return t ? this.bb.readUint8(this.bb_pos + t) : l.NONE;
1879
+ }
1880
+ value(t) {
1881
+ const e = this.bb.__offset(this.bb_pos, 10);
1882
+ return e ? this.bb.__union(t, this.bb_pos + e) : null;
1883
+ }
1884
+ static startUniqueSignalNotify(t) {
1885
+ t.startObject(4);
1886
+ }
1887
+ static addFrameId(t, e) {
1888
+ t.addFieldOffset(0, e, 0);
1889
+ }
1890
+ static addSignalId(t, e) {
1891
+ t.addFieldOffset(1, e, 0);
1892
+ }
1893
+ static addValueType(t, e) {
1894
+ t.addFieldInt8(2, e, l.NONE);
1895
+ }
1896
+ static addValue(t, e) {
1897
+ t.addFieldOffset(3, e, 0);
1898
+ }
1899
+ static endUniqueSignalNotify(t) {
1900
+ const e = t.endObject();
1901
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
1902
+ }
1903
+ static createUniqueSignalNotify(t, e, i, a, r) {
1904
+ return y.startUniqueSignalNotify(t), y.addFrameId(t, e), y.addSignalId(t, i), y.addValueType(t, a), y.addValue(t, r), y.endUniqueSignalNotify(t);
1905
+ }
1906
+ unpack() {
1907
+ return new Zt(this.frameId(), this.signalId(), this.valueType(), (() => {
1908
+ const t = ut(this.valueType(), this.value.bind(this));
1909
+ return t === null ? null : t.unpack();
1910
+ })());
1911
+ }
1912
+ unpackTo(t) {
1913
+ t.frameId = this.frameId(), t.signalId = this.signalId(), t.valueType = this.valueType(), t.value = (() => {
1914
+ const e = ut(this.valueType(), this.value.bind(this));
1915
+ return e === null ? null : e.unpack();
1916
+ })();
1917
+ }
1918
+ }
1919
+ class Zt {
1920
+ constructor(t = null, e = null, i = l.NONE, a = null) {
1921
+ n(this, "frameId");
1922
+ n(this, "signalId");
1923
+ n(this, "valueType");
1924
+ n(this, "value");
1925
+ this.frameId = t, this.signalId = e, this.valueType = i, this.value = a;
1926
+ }
1927
+ pack(t) {
1928
+ const e = this.frameId !== null ? t.createString(this.frameId) : 0, i = this.signalId !== null ? t.createString(this.signalId) : 0, a = t.createObjectOffset(this.value);
1929
+ return y.createUniqueSignalNotify(t, e, i, this.valueType, a);
1930
+ }
1931
+ }
1932
+ class nt {
1933
+ constructor() {
1934
+ n(this, "bb", null);
1935
+ n(this, "bb_pos", 0);
1936
+ }
1937
+ __init(t, e) {
1938
+ return this.bb_pos = t, this.bb = e, this;
1939
+ }
1940
+ static getRootAsUniqueSignalRequest(t, e) {
1941
+ return (e || new nt()).__init(t.readInt32(t.position()) + t.position(), t);
1942
+ }
1943
+ static getSizePrefixedRootAsUniqueSignalRequest(t, e) {
1944
+ return t.setPosition(t.position() + f), (e || new nt()).__init(t.readInt32(t.position()) + t.position(), t);
1945
+ }
1946
+ id(t) {
1947
+ const e = this.bb.__offset(this.bb_pos, 4);
1948
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1949
+ }
1950
+ static startUniqueSignalRequest(t) {
1951
+ t.startObject(1);
1952
+ }
1953
+ static addId(t, e) {
1954
+ t.addFieldOffset(0, e, 0);
1955
+ }
1956
+ static endUniqueSignalRequest(t) {
1957
+ const e = t.endObject();
1958
+ return t.requiredField(e, 4), e;
1959
+ }
1960
+ static createUniqueSignalRequest(t, e) {
1961
+ return nt.startUniqueSignalRequest(t), nt.addId(t, e), nt.endUniqueSignalRequest(t);
1962
+ }
1963
+ unpack() {
1964
+ return new Xt(this.id());
1965
+ }
1966
+ unpackTo(t) {
1967
+ t.id = this.id();
1968
+ }
1969
+ }
1970
+ class Xt {
1971
+ constructor(t = null) {
1972
+ n(this, "id");
1973
+ this.id = t;
1974
+ }
1975
+ pack(t) {
1976
+ const e = this.id !== null ? t.createString(this.id) : 0;
1977
+ return nt.createUniqueSignalRequest(t, e);
1978
+ }
1979
+ }
1980
+ class B {
1981
+ constructor() {
1982
+ n(this, "bb", null);
1983
+ n(this, "bb_pos", 0);
1984
+ }
1985
+ __init(t, e) {
1986
+ return this.bb_pos = t, this.bb = e, this;
1987
+ }
1988
+ static getRootAsUniqueSignalResponse(t, e) {
1989
+ return (e || new B()).__init(t.readInt32(t.position()) + t.position(), t);
1990
+ }
1991
+ static getSizePrefixedRootAsUniqueSignalResponse(t, e) {
1992
+ return t.setPosition(t.position() + f), (e || new B()).__init(t.readInt32(t.position()) + t.position(), t);
1993
+ }
1994
+ id(t) {
1995
+ const e = this.bb.__offset(this.bb_pos, 4);
1996
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
1997
+ }
1998
+ signals(t, e) {
1999
+ const i = this.bb.__offset(this.bb_pos, 6);
2000
+ return i ? (e || new j()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + t * 4), this.bb) : null;
2001
+ }
2002
+ signalsLength() {
2003
+ const t = this.bb.__offset(this.bb_pos, 6);
2004
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
2005
+ }
2006
+ static startUniqueSignalResponse(t) {
2007
+ t.startObject(2);
2008
+ }
2009
+ static addId(t, e) {
2010
+ t.addFieldOffset(0, e, 0);
2011
+ }
2012
+ static addSignals(t, e) {
2013
+ t.addFieldOffset(1, e, 0);
2014
+ }
2015
+ static createSignalsVector(t, e) {
2016
+ t.startVector(4, e.length, 4);
2017
+ for (let i = e.length - 1; i >= 0; i--)
2018
+ t.addOffset(e[i]);
2019
+ return t.endVector();
2020
+ }
2021
+ static startSignalsVector(t, e) {
2022
+ t.startVector(4, e, 4);
2023
+ }
2024
+ static endUniqueSignalResponse(t) {
2025
+ const e = t.endObject();
2026
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
2027
+ }
2028
+ static createUniqueSignalResponse(t, e, i) {
2029
+ return B.startUniqueSignalResponse(t), B.addId(t, e), B.addSignals(t, i), B.endUniqueSignalResponse(t);
2030
+ }
2031
+ unpack() {
2032
+ return new he(this.id(), this.bb.createObjList(this.signals.bind(this), this.signalsLength()));
2033
+ }
2034
+ unpackTo(t) {
2035
+ t.id = this.id(), t.signals = this.bb.createObjList(this.signals.bind(this), this.signalsLength());
2036
+ }
2037
+ }
2038
+ class he {
2039
+ constructor(t = null, e = []) {
2040
+ n(this, "id");
2041
+ n(this, "signals");
2042
+ this.id = t, this.signals = e;
2043
+ }
2044
+ pack(t) {
2045
+ const e = this.id !== null ? t.createString(this.id) : 0, i = B.createSignalsVector(t, t.createObjectOffsetList(this.signals));
2046
+ return B.createUniqueSignalResponse(t, e, i);
2047
+ }
2048
+ }
2049
+ class at {
2050
+ constructor() {
2051
+ n(this, "bb", null);
2052
+ n(this, "bb_pos", 0);
2053
+ }
2054
+ __init(t, e) {
2055
+ return this.bb_pos = t, this.bb = e, this;
2056
+ }
2057
+ static getRootAsUniqueValueRequest(t, e) {
2058
+ return (e || new at()).__init(t.readInt32(t.position()) + t.position(), t);
2059
+ }
2060
+ static getSizePrefixedRootAsUniqueValueRequest(t, e) {
2061
+ return t.setPosition(t.position() + f), (e || new at()).__init(t.readInt32(t.position()) + t.position(), t);
2062
+ }
2063
+ id(t) {
2064
+ const e = this.bb.__offset(this.bb_pos, 4);
2065
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
2066
+ }
2067
+ static startUniqueValueRequest(t) {
2068
+ t.startObject(1);
2069
+ }
2070
+ static addId(t, e) {
2071
+ t.addFieldOffset(0, e, 0);
2072
+ }
2073
+ static endUniqueValueRequest(t) {
2074
+ const e = t.endObject();
2075
+ return t.requiredField(e, 4), e;
2076
+ }
2077
+ static createUniqueValueRequest(t, e) {
2078
+ return at.startUniqueValueRequest(t), at.addId(t, e), at.endUniqueValueRequest(t);
2079
+ }
2080
+ unpack() {
2081
+ return new $t(this.id());
2082
+ }
2083
+ unpackTo(t) {
2084
+ t.id = this.id();
2085
+ }
2086
+ }
2087
+ class $t {
2088
+ constructor(t = null) {
2089
+ n(this, "id");
2090
+ this.id = t;
2091
+ }
2092
+ pack(t) {
2093
+ const e = this.id !== null ? t.createString(this.id) : 0;
2094
+ return at.createUniqueValueRequest(t, e);
2095
+ }
2096
+ }
2097
+ class C {
2098
+ constructor() {
2099
+ n(this, "bb", null);
2100
+ n(this, "bb_pos", 0);
2101
+ }
2102
+ __init(t, e) {
2103
+ return this.bb_pos = t, this.bb = e, this;
2104
+ }
2105
+ static getRootAsUniqueValueResponse(t, e) {
2106
+ return (e || new C()).__init(t.readInt32(t.position()) + t.position(), t);
2107
+ }
2108
+ static getSizePrefixedRootAsUniqueValueResponse(t, e) {
2109
+ return t.setPosition(t.position() + f), (e || new C()).__init(t.readInt32(t.position()) + t.position(), t);
2110
+ }
2111
+ id(t) {
2112
+ const e = this.bb.__offset(this.bb_pos, 4);
2113
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
2114
+ }
2115
+ values(t, e) {
2116
+ const i = this.bb.__offset(this.bb_pos, 6);
2117
+ return i ? (e || new S()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + i) + t * 4), this.bb) : null;
2118
+ }
2119
+ valuesLength() {
2120
+ const t = this.bb.__offset(this.bb_pos, 6);
2121
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
2122
+ }
2123
+ static startUniqueValueResponse(t) {
2124
+ t.startObject(2);
2125
+ }
2126
+ static addId(t, e) {
2127
+ t.addFieldOffset(0, e, 0);
2128
+ }
2129
+ static addValues(t, e) {
2130
+ t.addFieldOffset(1, e, 0);
2131
+ }
2132
+ static createValuesVector(t, e) {
2133
+ t.startVector(4, e.length, 4);
2134
+ for (let i = e.length - 1; i >= 0; i--)
2135
+ t.addOffset(e[i]);
2136
+ return t.endVector();
2137
+ }
2138
+ static startValuesVector(t, e) {
2139
+ t.startVector(4, e, 4);
2140
+ }
2141
+ static endUniqueValueResponse(t) {
2142
+ const e = t.endObject();
2143
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
2144
+ }
2145
+ static createUniqueValueResponse(t, e, i) {
2146
+ return C.startUniqueValueResponse(t), C.addId(t, e), C.addValues(t, i), C.endUniqueValueResponse(t);
2147
+ }
2148
+ unpack() {
2149
+ return new de(this.id(), this.bb.createObjList(this.values.bind(this), this.valuesLength()));
2150
+ }
2151
+ unpackTo(t) {
2152
+ t.id = this.id(), t.values = this.bb.createObjList(this.values.bind(this), this.valuesLength());
2153
+ }
2154
+ }
2155
+ class de {
2156
+ constructor(t = null, e = []) {
2157
+ n(this, "id");
2158
+ n(this, "values");
2159
+ this.id = t, this.values = e;
2160
+ }
2161
+ pack(t) {
2162
+ const e = this.id !== null ? t.createString(this.id) : 0, i = C.createValuesVector(t, t.createObjectOffsetList(this.values));
2163
+ return C.createUniqueValueResponse(t, e, i);
2164
+ }
2165
+ }
2166
+ class tt {
2167
+ constructor() {
2168
+ n(this, "bb", null);
2169
+ n(this, "bb_pos", 0);
2170
+ }
2171
+ __init(t, e) {
2172
+ return this.bb_pos = t, this.bb = e, this;
2173
+ }
2174
+ static getRootAsUniqueValueUpdate(t, e) {
2175
+ return (e || new tt()).__init(t.readInt32(t.position()) + t.position(), t);
2176
+ }
2177
+ static getSizePrefixedRootAsUniqueValueUpdate(t, e) {
2178
+ return t.setPosition(t.position() + f), (e || new tt()).__init(t.readInt32(t.position()) + t.position(), t);
2179
+ }
2180
+ id(t) {
2181
+ const e = this.bb.__offset(this.bb_pos, 4);
2182
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
2183
+ }
2184
+ value(t) {
2185
+ const e = this.bb.__offset(this.bb_pos, 6);
2186
+ return e ? (t || new S()).__init(this.bb.__indirect(this.bb_pos + e), this.bb) : null;
2187
+ }
2188
+ static startUniqueValueUpdate(t) {
2189
+ t.startObject(2);
2190
+ }
2191
+ static addId(t, e) {
2192
+ t.addFieldOffset(0, e, 0);
2193
+ }
2194
+ static addValue(t, e) {
2195
+ t.addFieldOffset(1, e, 0);
2196
+ }
2197
+ static endUniqueValueUpdate(t) {
2198
+ const e = t.endObject();
2199
+ return t.requiredField(e, 4), t.requiredField(e, 6), e;
2200
+ }
2201
+ unpack() {
2202
+ return new Jt(this.id(), this.value() !== null ? this.value().unpack() : null);
2203
+ }
2204
+ unpackTo(t) {
2205
+ t.id = this.id(), t.value = this.value() !== null ? this.value().unpack() : null;
2206
+ }
2207
+ }
2208
+ class Jt {
2209
+ constructor(t = null, e = null) {
2210
+ n(this, "id");
2211
+ n(this, "value");
2212
+ this.id = t, this.value = e;
2213
+ }
2214
+ pack(t) {
2215
+ const e = this.id !== null ? t.createString(this.id) : 0, i = this.value !== null ? this.value.pack(t) : 0;
2216
+ return tt.startUniqueValueUpdate(t), tt.addId(t, e), tt.addValue(t, i), tt.endUniqueValueUpdate(t);
2217
+ }
2218
+ }
2219
+ const _e = async (s) => new Promise((t, e) => {
2220
+ const i = new oe();
2221
+ i.postMessage({
2222
+ type: "init",
2223
+ host: s.host,
2224
+ id: s.id,
2225
+ cdn_url: s.cdn_url,
2226
+ tag: s.tag
2227
+ }), i.addEventListener("message", async (a) => {
2228
+ if (a.data.ok) {
2229
+ if (a.data.files) {
2230
+ const r = new k(), o = new Ct(
2231
+ s.id,
2232
+ a.data.code,
2233
+ a.data.files.map(
2234
+ (h) => new Bt(h.target, h.metadata)
2235
+ )
2236
+ );
2237
+ r.finish(o.pack(r)), St(
2238
+ s.host,
2239
+ s.tag != null ? _.Client_Tagged_FrameCache : _.Client_Unique_FrameCache,
2240
+ r.asUint8Array()
2241
+ );
2242
+ }
2243
+ t(await import(
2244
+ /* @vite-ignore */
2245
+ a.data.code
2246
+ ));
2247
+ } else
2248
+ e(a.data.err);
2249
+ i.terminate();
2250
+ });
2251
+ }), ct = (s) => {
2252
+ }, fe = (s, t) => {
2253
+ if (s == l.ValueBoolean)
2254
+ return t;
2255
+ if (s == l.ValueNumber)
2256
+ return Number(t);
2257
+ if (s == l.ValueDouble || s == l.ValueString)
2258
+ return t;
2259
+ if (s == l.ValueBuffer)
2260
+ return new Uint8Array(t);
2261
+ }, Kt = (s, t) => {
2262
+ if (s == l.ValueBoolean)
2263
+ return new Lt(t);
2264
+ if (s == l.ValueNumber)
2265
+ return new Et(BigInt(t));
2266
+ if (s == l.ValueDouble)
2267
+ return new xt(t);
2268
+ if (s == l.ValueString)
2269
+ return new zt(t);
2270
+ if (s == l.ValueBuffer)
2271
+ return new Pt(Array.from(t));
2272
+ }, Qt = async ({
2273
+ id: s,
2274
+ tag: t,
2275
+ host: e,
2276
+ service: i
2277
+ }) => {
2278
+ const a = await jt(
2279
+ e,
2280
+ t != null ? _.Client_Tagged_Value_Request : _.Client_Unique_Value_Request,
2281
+ (() => {
2282
+ const c = new k(), d = t != null ? new Wt(s, t) : new $t(s);
2283
+ return c.finish(d.pack(c)), c.asUint8Array();
2284
+ })(),
2285
+ t != null ? (c, d) => {
2286
+ if (c === _.Server_Tagged_Value_Response) {
2287
+ const b = R.getRootAsTaggedValueResponse(
2288
+ new P(d)
2289
+ );
2290
+ if (b.id() === s && t === b.tag())
2291
+ return b;
2292
+ }
2293
+ } : (c, d) => {
2294
+ if (c === _.Server_Unique_Value_Response) {
2295
+ const b = C.getRootAsUniqueValueResponse(
2296
+ new P(d)
2297
+ );
2298
+ if (b.id() === s)
2299
+ return b;
2300
+ }
2301
+ }
2302
+ ), r = {
2303
+ [l.ValueBoolean]: /* @__PURE__ */ new Map(),
2304
+ [l.ValueNumber]: /* @__PURE__ */ new Map(),
2305
+ [l.ValueDouble]: /* @__PURE__ */ new Map(),
2306
+ [l.ValueString]: /* @__PURE__ */ new Map(),
2307
+ [l.ValueBuffer]: /* @__PURE__ */ new Map()
2308
+ };
2309
+ let o = !1;
2310
+ const h = a.valuesLength();
2311
+ for (let c = 0; c < h; ++c) {
2312
+ const d = a.values(c), b = d.id(), F = d.valueType(), O = et(fe(F, d.unpack().value.value));
2313
+ O.subscribe((V) => {
2314
+ if (V == null || o)
2315
+ return;
2316
+ const m = new k(), p = t != null ? new Yt(s, t) : new Jt(s);
2317
+ p.value = new Ht(
2318
+ b,
2319
+ F,
2320
+ Kt(F, V)
2321
+ ), m.finish(p.pack(m));
2322
+ const I = t != null ? _.Tagged_Value_Update : _.Unique_Value_Update;
2323
+ i.publish(dt([ht(I), m.asUint8Array()]));
2324
+ }), F !== l.NONE && r[F].set(b, O);
2325
+ }
2326
+ return i.on_message((c, d) => {
2327
+ var V;
2328
+ const b = new DataView(d.buffer).getUint32(0, !1), F = d.slice(4), O = t != null ? _.Tagged_Value_Update : _.Unique_Value_Update;
2329
+ if (b === O) {
2330
+ const m = t !== null ? D.getRootAsTaggedValueUpdate(new P(F)) : tt.getRootAsUniqueValueUpdate(new P(F));
2331
+ if (m.id() === s && (t == null || t === m.tag())) {
2332
+ o = !0;
2333
+ const p = m.value().valueType();
2334
+ if (p !== l.NONE) {
2335
+ const I = (V = r[p]) == null ? void 0 : V.get(m.value().id());
2336
+ if (p === l.ValueBuffer) {
2337
+ const G = new Uint8Array(
2338
+ m.unpack().value.value.value
2339
+ ), Rt = At(I);
2340
+ let gt = !0;
2341
+ if (G.length != Rt.length)
2342
+ gt = !1;
2343
+ else {
2344
+ const ie = G.length;
2345
+ for (let pt = 0; pt < ie; pt++)
2346
+ if (G[pt] !== Rt[pt]) {
2347
+ gt = !1;
2348
+ break;
2349
+ }
2350
+ }
2351
+ gt || I == null || I.set(G);
2352
+ } else p === l.ValueNumber ? I == null || I.set(new Number(m.unpack().value.value.value)) : I == null || I.set(m.unpack().value.value.value);
2353
+ }
2354
+ o = !1;
2355
+ }
2356
+ }
2357
+ }), r;
2358
+ }, Mt = async ({
2359
+ id: s,
2360
+ tag: t,
2361
+ host: e,
2362
+ service: i
2363
+ }) => {
2364
+ const a = await jt(
2365
+ e,
2366
+ t != null ? _.Client_Tagged_Signal_Request : _.Client_Unique_Signal_Request,
2367
+ (() => {
2368
+ const h = new k(), c = t != null ? new Gt(s, t) : new Xt(s);
2369
+ return h.finish(c.pack(h)), h.asUint8Array();
2370
+ })(),
2371
+ (h, c) => {
2372
+ if (t != null) {
2373
+ if (h === _.Server_Tagged_Signal_Response)
2374
+ return T.getRootAsTaggedSignalResponse(new P(c));
2375
+ } else if (h === _.Server_Unique_Signal_Response)
2376
+ return B.getRootAsUniqueSignalResponse(new P(c));
2377
+ }
2378
+ ), r = [
2379
+ /* @__PURE__ */ new Map(),
2380
+ /* @__PURE__ */ new Map(),
2381
+ /* @__PURE__ */ new Map(),
2382
+ /* @__PURE__ */ new Map(),
2383
+ /* @__PURE__ */ new Map(),
2384
+ /* @__PURE__ */ new Map()
2385
+ ], o = a.signalsLength();
2386
+ for (let h = 0; h < o; ++h) {
2387
+ const c = a.signals(h), { id: d, type: b } = { id: c.id(), type: c.type() };
2388
+ r[b].set(d, (F) => {
2389
+ const O = new k(), V = b, m = Kt(V, F), p = t != null ? new Dt(s, t, d, V, m) : new Zt(s, d, V, m);
2390
+ O.finish(p.pack(O));
2391
+ const I = t != null ? _.Client_Tagged_Signal_Notify : _.Client_Unique_Signal_Notify;
2392
+ i.publish(dt([ht(I), O.asUint8Array()]));
2393
+ });
2394
+ }
2395
+ return r;
2396
+ }, te = (s) => ({
2397
+ boolean: (t, e) => s[l.ValueBoolean].get(t) ?? et(e),
2398
+ double: (t, e) => s[l.ValueDouble].get(t) ?? et(e),
2399
+ string: (t, e) => s[l.ValueString].get(t) ?? et(e),
2400
+ number: (t, e) => s[l.ValueNumber].get(t) ?? et(e),
2401
+ buffer: (t, e) => s[l.ValueBuffer].get(t) ?? et(e),
2402
+ json: (t, e, i) => {
2403
+ const a = s[l.ValueBuffer].get(t);
2404
+ if (a != null) {
2405
+ let r = At(a), o = i.decode(r);
2406
+ return {
2407
+ set: (h) => {
2408
+ o = h, r = i.encode(o), a.set(r);
2409
+ },
2410
+ subscribe: (h) => a.subscribe((c) => {
2411
+ c !== r && (r = c, o = i.decode(r)), h(o);
2412
+ }),
2413
+ update: (h) => {
2414
+ a.update((c) => (o = h(o), r = i.encode(o), r));
2415
+ }
2416
+ };
2417
+ }
2418
+ return et(e);
2419
+ }
2420
+ }), ee = (s) => ({
2421
+ none: (t) => s[q.None].get(t) ?? (() => {
2422
+ }),
2423
+ boolean: (t) => s[q.Boolean].get(t) ?? ct,
2424
+ double: (t) => s[q.Double].get(t) ?? ct,
2425
+ number: (t) => s[q.Number].get(t) ?? ct,
2426
+ string: (t) => s[q.String].get(t) ?? ct,
2427
+ buffer: (t) => s[q.Buffer].get(t) ?? ct,
2428
+ json: (t, e) => {
2429
+ const i = s[q.Buffer].get(t);
2430
+ return i != null ? (a) => i(e(a)) : ct;
2431
+ }
2432
+ }), pe = async (s, t, e, i, a, r) => {
2433
+ await re(s);
2434
+ const o = new ft(s), [h, c, { nil_xit_fn: d }] = await Promise.all([
2435
+ Qt({ id: t, tag: e, host: s, service: o }),
2436
+ Mt({ id: t, tag: e, host: s, service: o }),
2437
+ _e({ host: s, cdn_url: i, id: t, tag: e })
2438
+ ]), b = {
2439
+ svelte: () => import("./svelte/index.js").then((p) => p.bX),
2440
+ "svelte/store": () => import("./svelte/store.js").then((p) => p.i),
2441
+ "svelte/animate": () => import("./svelte/animate.js"),
2442
+ "svelte/easing": () => import("./svelte/easing.js"),
2443
+ "svelte/events": () => import("./svelte/events.js"),
2444
+ "svelte/motion": () => import("./svelte/motion.js").then((p) => p.i),
2445
+ "svelte/transition": () => import("./svelte/transition.js"),
2446
+ // @ts-ignore
2447
+ "svelte/internal/disclose-version": () => import("./svelte/internal/disclose-version.js"),
2448
+ // @ts-ignore
2449
+ "svelte/internal/client": () => import("./svelte/internal/client.js")
2450
+ }, F = (p) => p in b ? b[p]() : import(
2451
+ /* @vite-ignore */
2452
+ p
2453
+ ), { action: O } = await d(F);
2454
+ o.on_connect(() => {
2455
+ const p = new k(), I = e != null ? new qt(t, e) : new Tt(t);
2456
+ p.finish(I.pack(p));
2457
+ const G = e != null ? _.Client_Tagged_Frame_Subscribe : _.Client_Unique_Frame_Subscribe;
2458
+ o.publish(dt([ht(G), p.asUint8Array()]));
2459
+ }), o.start();
2460
+ const V = new k(), m = e != null ? new Ot(t, e) : new Ut(t);
2461
+ return V.finish(m.pack(V)), St(
2462
+ s,
2463
+ e != null ? _.Client_Tagged_Frame_Loaded : _.Client_Unique_Frame_Loaded,
2464
+ V.asUint8Array()
2465
+ ), (p) => {
2466
+ const I = /* @__PURE__ */ new Map();
2467
+ I.set("nil.xit", {
2468
+ values: te(h),
2469
+ signals: ee(c),
2470
+ frame_ui: a,
2471
+ frame: r,
2472
+ resub: () => o.start(),
2473
+ unsub: () => o.stop(),
2474
+ id: t,
2475
+ tag: e
2476
+ });
2477
+ const { destroy: G } = O(p, I);
2478
+ return {
2479
+ destroy: () => {
2480
+ o.stop(), G();
2481
+ }
2482
+ };
2483
+ };
2484
+ }, be = async ({
2485
+ host: s,
2486
+ frame: t,
2487
+ tag: e
2488
+ }) => {
2489
+ const i = new ft(s), [a, r] = await Promise.all([
2490
+ Qt({ id: t, tag: e ?? null, host: s, service: i }),
2491
+ Mt({ id: t, tag: e ?? null, host: s, service: i })
2492
+ ]);
2493
+ i.on_connect(() => {
2494
+ const d = new k(), b = e != null ? new qt(t, e) : new Tt(t);
2495
+ d.finish(b.pack(d));
2496
+ const F = e != null ? _.Client_Tagged_Frame_Subscribe : _.Client_Unique_Frame_Subscribe;
2497
+ i.publish(dt([ht(F), d.asUint8Array()]));
2498
+ }), i.start();
2499
+ const o = new k(), h = e != null ? new Ot(t, e) : new Ut(t);
2500
+ o.finish(h.pack(o));
2501
+ const c = e != null ? _.Client_Tagged_Frame_Loaded : _.Client_Unique_Frame_Loaded;
2502
+ return St(s, c, o.asUint8Array()), {
2503
+ values: te(a),
2504
+ signals: ee(r),
2505
+ resub: () => i.start(),
2506
+ unsub: () => i.stop()
2507
+ };
2508
+ }, se = async ({
2509
+ host: s,
2510
+ cdn_url: t,
2511
+ frame: e,
2512
+ tag: i
2513
+ }) => {
2514
+ const a = async (r, o) => {
2515
+ const h = await se({
2516
+ host: s,
2517
+ cdn_url: t,
2518
+ frame: r,
2519
+ tag: o
2520
+ });
2521
+ return (c) => h(c);
2522
+ };
2523
+ return pe(
2524
+ s,
2525
+ e,
2526
+ i ?? null,
2527
+ t,
2528
+ async (r, o) => a(r, o),
2529
+ async (r, o) => be({ host: s, frame: r, tag: o })
2530
+ );
2531
+ }, we = async (s, t) => (await se(t))(s);
2532
+ export {
2533
+ we as create_component,
2534
+ be as create_frame,
2535
+ se as create_frame_ui
2536
+ };