@origonai/web-sdk 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- class Jn {
1
+ class ts {
2
2
  constructor() {
3
3
  this.callbacks = {};
4
4
  }
@@ -51,47 +51,47 @@ class h extends Error {
51
51
  return new h({ kind: "session", message: t });
52
52
  }
53
53
  }
54
- function sn(e) {
54
+ function rn(e) {
55
55
  return typeof e == "object" && e !== null && "error" in e && typeof e.error == "object" && e.error !== null && "message" in e.error;
56
56
  }
57
- const k = 8, rn = 1048576, L = {
57
+ const k = 8, an = 1048576, L = {
58
58
  REQUEST: 1,
59
59
  DATA: 2,
60
60
  ERROR: 3,
61
61
  CANCEL: 4
62
- }, an = 0;
62
+ }, on = 0;
63
63
  class b extends Error {
64
64
  constructor(t) {
65
65
  super(t), this.name = "OrpcCodecError";
66
66
  }
67
67
  }
68
- class on extends b {
68
+ class cn extends b {
69
69
  constructor(t) {
70
- super(`frame payload too large: ${t} > ${rn}`), this.name = "OrpcFrameTooLargeError", this.declaredLength = t;
70
+ super(`frame payload too large: ${t} > ${an}`), this.name = "OrpcFrameTooLargeError", this.declaredLength = t;
71
71
  }
72
72
  }
73
- const we = new TextEncoder(), cn = new TextDecoder("utf-8", { fatal: !0 });
74
- function es(e, t, n, s) {
73
+ const we = new TextEncoder(), un = new TextDecoder("utf-8", { fatal: !0 });
74
+ function ns(e, t, n, s) {
75
75
  const r = we.encode(e), i = Object.entries(n).map(
76
76
  ([d, f]) => [we.encode(d), we.encode(f)]
77
77
  );
78
78
  let a = 2 + r.length + 8 + 1 + 2 + s.length;
79
79
  for (const [d, f] of i) a += 2 + d.length + 2 + f.length;
80
- const o = Ve(L.REQUEST, a), l = new DataView(o.buffer);
80
+ const o = Pe(L.REQUEST, a), l = new DataView(o.buffer);
81
81
  let u = k;
82
- l.setUint16(u, r.length), u += 2, o.set(r, u), u += r.length, l.setBigUint64(u, BigInt(t)), u += 8, o[u++] = an, l.setUint16(u, i.length), u += 2;
82
+ l.setUint16(u, r.length), u += 2, o.set(r, u), u += r.length, l.setBigUint64(u, BigInt(t)), u += 8, o[u++] = on, l.setUint16(u, i.length), u += 2;
83
83
  for (const [d, f] of i)
84
84
  l.setUint16(u, d.length), u += 2, o.set(d, u), u += d.length, l.setUint16(u, f.length), u += 2, o.set(f, u), u += f.length;
85
85
  return o.set(s, u), o;
86
86
  }
87
- function ts(e) {
88
- const t = Ve(L.DATA, e.length);
87
+ function ss(e) {
88
+ const t = Pe(L.DATA, e.length);
89
89
  return t.set(e, k), t;
90
90
  }
91
- function un() {
92
- return Ve(L.CANCEL, 0);
91
+ function ln() {
92
+ return Pe(L.CANCEL, 0);
93
93
  }
94
- function ns(e) {
94
+ function rs(e) {
95
95
  if (e.length < k)
96
96
  throw new b(`frame shorter than header: ${e.length} < ${k}`);
97
97
  const t = e[0];
@@ -100,15 +100,15 @@ function ns(e) {
100
100
  const n = new DataView(e.buffer, e.byteOffset, k), s = n.getUint16(2);
101
101
  if (s !== 0) throw new b(`non-zero reserved field: ${s}`);
102
102
  const r = n.getUint32(4);
103
- if (r > rn) throw new on(r);
103
+ if (r > an) throw new cn(r);
104
104
  if (t === L.CANCEL && r !== 0)
105
105
  throw new b(`CANCEL payload must be empty: ${r}`);
106
106
  return { frameType: t, payloadLen: r };
107
107
  }
108
- function ss(e, t) {
108
+ function is(e, t) {
109
109
  switch (e) {
110
110
  case L.REQUEST: {
111
- const { path: n, body: s } = rs(t);
111
+ const { path: n, body: s } = as(t);
112
112
  return { type: "response", path: n, body: s };
113
113
  }
114
114
  case L.DATA:
@@ -119,7 +119,7 @@ function ss(e, t) {
119
119
  const n = new DataView(t.buffer, t.byteOffset, t.byteLength);
120
120
  let s;
121
121
  try {
122
- s = cn.decode(t.subarray(4));
122
+ s = un.decode(t.subarray(4));
123
123
  } catch {
124
124
  throw new b("ERROR reason is not valid UTF-8");
125
125
  }
@@ -131,13 +131,13 @@ function ss(e, t) {
131
131
  throw new b(`unexpected frame type 0x${e.toString(16)}`);
132
132
  }
133
133
  }
134
- function Ve(e, t) {
134
+ function Pe(e, t) {
135
135
  if (!Number.isSafeInteger(t) || t < 0 || t > 4294967295)
136
136
  throw new b(`payload length is outside u32: ${t}`);
137
137
  const n = new Uint8Array(k + t), s = new DataView(n.buffer);
138
138
  return n[0] = e, n[1] = 0, s.setUint16(2, 0), s.setUint32(4, t), n;
139
139
  }
140
- function rs(e) {
140
+ function as(e) {
141
141
  const t = new DataView(e.buffer, e.byteOffset, e.byteLength);
142
142
  let n = 0;
143
143
  if (e.length < 2) throw new b("REQUEST payload too short for path_len");
@@ -148,11 +148,11 @@ function rs(e) {
148
148
  const r = e.subarray(n, n + s);
149
149
  for (const l of r)
150
150
  if (!(l >= 65 && l <= 90 || l >= 97 && l <= 122 || l >= 48 && l <= 57 || l === 46 || l === 95 || l === 47)) throw new b("REQUEST path contains an invalid byte");
151
- const i = cn.decode(r);
151
+ const i = un.decode(r);
152
152
  if (n += s, n + 11 > e.length) throw new b("REQUEST payload missing fixed tail");
153
153
  n += 8;
154
154
  const a = e[n++];
155
- if (a !== an)
155
+ if (a !== on)
156
156
  throw new b(`unsupported response encoding: ${a}`);
157
157
  const o = t.getUint16(n);
158
158
  n += 2;
@@ -187,7 +187,7 @@ function ue(e, t) {
187
187
  async function ot(e) {
188
188
  return await e.transport.ready, e.transport.createBidirectionalStream();
189
189
  }
190
- async function is(e, t) {
190
+ async function os(e, t) {
191
191
  let n = at(e), s, r = !1;
192
192
  try {
193
193
  s = await ot(n);
@@ -220,12 +220,12 @@ class ut {
220
220
  throw new b(
221
221
  `response FIN truncated frame header: have ${this.available}, need ${k}`
222
222
  );
223
- const t = ns(this.peek(k)), n = k + t.payloadLen;
223
+ const t = rs(this.peek(k)), n = k + t.payloadLen;
224
224
  if (await this.ensure(n), this.available < n)
225
225
  throw new b(
226
226
  `response FIN truncated frame payload: have ${this.available - k}, need ${t.payloadLen}`
227
227
  );
228
- return this.take(k), ss(t.frameType, this.take(t.payloadLen));
228
+ return this.take(k), is(t.frameType, this.take(t.payloadLen));
229
229
  }
230
230
  async cancel(t) {
231
231
  await this.reader.cancel(t);
@@ -277,47 +277,47 @@ const Q = {
277
277
  STALE: 4098,
278
278
  /** session logged out / user deleted / banned → logout */
279
279
  REVOKED: 4099
280
- }, B = {
280
+ }, Y = {
281
281
  INVALID_ARGUMENT: 2,
282
282
  CANCELLED: 4,
283
283
  /** Streaming DATA exceeds the ingress cap. */
284
284
  MESSAGE_TOO_LARGE: 12
285
- }, as = "DATA frame too large";
286
- class T extends Error {
285
+ }, cs = "DATA frame too large";
286
+ class S extends Error {
287
287
  constructor(t, n) {
288
288
  super(`orpc error 0x${t.toString(16)}${n ? `: ${n}` : ""}`), this.name = "OrpcError", this.code = t, this.reason = n;
289
289
  }
290
290
  }
291
- function os(e) {
291
+ function us(e) {
292
292
  if (typeof e != "object" && typeof e != "function" || e === null) return !1;
293
293
  const t = e;
294
294
  return t.source === "stream" && Number.isInteger(t.streamErrorCode) && t.streamErrorCode >= 0 && t.streamErrorCode <= 255;
295
295
  }
296
- function cs(e) {
297
- if (!os(e))
296
+ function ls(e) {
297
+ if (!us(e))
298
298
  return e instanceof Error || typeof e == "object" && e !== null && "message" in e ? e : new Error(String(e));
299
- const t = e.streamErrorCode === B.MESSAGE_TOO_LARGE ? as : `WebTransport stream aborted with code 0x${e.streamErrorCode.toString(16)}`;
300
- return new T(e.streamErrorCode, t);
299
+ const t = e.streamErrorCode === Y.MESSAGE_TOO_LARGE ? cs : `WebTransport stream aborted with code 0x${e.streamErrorCode.toString(16)}`;
300
+ return new S(e.streamErrorCode, t);
301
301
  }
302
- function ln(e, t = "orpc stream cancelled") {
302
+ function dn(e, t = "orpc stream cancelled") {
303
303
  if (typeof WebTransportError < "u")
304
304
  return new WebTransportError(t, { source: "stream", streamErrorCode: e });
305
305
  const n = new Error(t);
306
306
  return n.name = "WebTransportError", n.source = "stream", n.streamErrorCode = e, n;
307
307
  }
308
- const us = {
308
+ const ds = {
309
309
  event() {
310
310
  }
311
- }, ls = [];
312
- function ds() {
313
- return ls.slice();
311
+ }, hs = [];
312
+ function fs() {
313
+ return hs.slice();
314
314
  }
315
- typeof window < "u" && (window.__orpcDebug = ds);
316
- function hs(e, t, n = {}) {
317
- const s = n.logger ?? us, r = n.transport ?? is, i = { ...n.metadata };
315
+ typeof window < "u" && (window.__orpcDebug = fs);
316
+ function ms(e, t, n = {}) {
317
+ const s = n.logger ?? ds, r = n.transport ?? os, i = { ...n.metadata };
318
318
  delete i.authorization;
319
319
  async function a(d, f) {
320
- const p = t.getToken(), m = p ? { ...i, authorization: `Bearer ${p}` } : { ...i }, g = es(d, 0, m, f);
320
+ const p = t.getToken(), m = p ? { ...i, authorization: `Bearer ${p}` } : { ...i }, g = ns(d, 0, m, f);
321
321
  s.event({ kind: "request", path: d, reqBytes: g.length });
322
322
  const E = await r(e, g);
323
323
  return E.reconnected && s.event({ kind: "transport", path: d, event: "reconnect" }), E;
@@ -325,44 +325,44 @@ function hs(e, t, n = {}) {
325
325
  async function o(d, f, p) {
326
326
  const m = Ie(), g = await a(d, f), E = new ut(g.reader), x = g.writer.close().then(
327
327
  () => null,
328
- (v) => V(g, v)
328
+ (v) => P(g, v)
329
329
  );
330
- let N;
330
+ let T;
331
331
  try {
332
- N = await E.readFrame();
332
+ T = await E.readFrame();
333
333
  } catch (v) {
334
- throw await O(g, E, v), V(g, v);
334
+ throw await O(g, E, v), P(g, v);
335
335
  }
336
- if (N === null) throw new b("response FIN before unary reply");
337
- if (N.type === "data" || N.type === "cancel")
336
+ if (T === null) throw new b("response FIN before unary reply");
337
+ if (T.type === "data" || T.type === "cancel")
338
338
  throw await O(
339
339
  g,
340
340
  E,
341
- new b(`unexpected ${N.type} frame`)
342
- ), new b(`unexpected ${N.type} frame before unary reply`);
341
+ new b(`unexpected ${T.type} frame`)
342
+ ), new b(`unexpected ${T.type} frame before unary reply`);
343
343
  let rt;
344
344
  try {
345
345
  rt = await E.readFrame();
346
346
  } catch (v) {
347
- throw await O(g, E, v), V(g, v);
347
+ throw await O(g, E, v), P(g, v);
348
348
  }
349
349
  if (rt !== null) {
350
350
  const v = new b("trailing frame after unary terminal");
351
351
  throw await O(g, E, v), v;
352
352
  }
353
- if (N.type === "error")
353
+ if (T.type === "error")
354
354
  return s.event({
355
355
  kind: "error",
356
356
  path: d,
357
- code: N.code,
358
- reason: N.reason,
357
+ code: T.code,
358
+ reason: T.reason,
359
359
  ms: Ie() - m
360
- }), u(N.code, N.reason, d, f, p);
361
- if (N.path !== d)
362
- throw new b(`response path mismatch: expected ${d}, got ${N.path}`);
360
+ }), u(T.code, T.reason, d, f, p);
361
+ if (T.path !== d)
362
+ throw new b(`response path mismatch: expected ${d}, got ${T.path}`);
363
363
  const it = await x;
364
364
  if (it) throw it;
365
- return s.event({ kind: "response", path: d, respBytes: N.body.length, ms: Ie() - m }), N.body;
365
+ return s.event({ kind: "response", path: d, respBytes: T.body.length, ms: Ie() - m }), T.body;
366
366
  }
367
367
  async function l(d, f) {
368
368
  const p = await a(d, f), m = new ut(p.reader);
@@ -370,14 +370,14 @@ function hs(e, t, n = {}) {
370
370
  try {
371
371
  g = await m.readFrame();
372
372
  } catch (E) {
373
- throw await O(p, m, E), V(p, E);
373
+ throw await O(p, m, E), P(p, E);
374
374
  }
375
375
  if (g === null) {
376
376
  const E = new b("response FIN before streaming REQUEST echo");
377
377
  throw await O(p, m, E), E;
378
378
  }
379
379
  if (g.type === "error")
380
- throw await dn(p), new T(g.code, g.reason);
380
+ throw await hn(p), new S(g.code, g.reason);
381
381
  if (g.type !== "response") {
382
382
  const E = new b(
383
383
  `unexpected ${g.type} frame before streaming REQUEST echo`
@@ -390,21 +390,21 @@ function hs(e, t, n = {}) {
390
390
  );
391
391
  throw await O(p, m, E), E;
392
392
  }
393
- return new fs(g.body, p, m);
393
+ return new ps(g.body, p, m);
394
394
  }
395
395
  async function u(d, f, p, m, g) {
396
396
  switch (d) {
397
397
  case Q.INVALID:
398
398
  case Q.EXPIRED:
399
399
  if (g)
400
- throw t.logout(), new T(d, f);
400
+ throw t.logout(), new S(d, f);
401
401
  return await t.refresh(), o(p, m, !0);
402
402
  case Q.STALE:
403
- throw await t.refresh(), typeof window < "u" && window.location.reload(), new T(d, f);
403
+ throw await t.refresh(), typeof window < "u" && window.location.reload(), new S(d, f);
404
404
  case Q.REVOKED:
405
- throw t.logout(), new T(d, f);
405
+ throw t.logout(), new S(d, f);
406
406
  default:
407
- throw new T(d, f);
407
+ throw new S(d, f);
408
408
  }
409
409
  }
410
410
  return {
@@ -412,16 +412,16 @@ function hs(e, t, n = {}) {
412
412
  stream: l
413
413
  };
414
414
  }
415
- class fs {
415
+ class ps {
416
416
  constructor(t, n, s) {
417
417
  this.channel = n, this.frames = s, this.terminal = "open", this.terminalError = null, this.upload = "open", this.uploadError = null, this.finishPromise = null, this.cancelPromise = null, this.nextTail = Promise.resolve(), this.initial = t;
418
418
  }
419
419
  async send(t) {
420
420
  this.assertWritable();
421
421
  try {
422
- await this.channel.writer.write(ts(t));
422
+ await this.channel.writer.write(ss(t));
423
423
  } catch (n) {
424
- throw this.upload = "stopped", this.uploadError = V(this.channel, n), this.uploadError;
424
+ throw this.upload = "stopped", this.uploadError = P(this.channel, n), this.uploadError;
425
425
  }
426
426
  }
427
427
  async finish() {
@@ -429,23 +429,23 @@ class fs {
429
429
  if (this.finishPromise) return this.finishPromise;
430
430
  if (!(this.terminal === "cancelled" || this.terminal === "error")) {
431
431
  if (this.upload === "stopped")
432
- throw this.uploadError ?? new T(B.CANCELLED, "upload stopped");
432
+ throw this.uploadError ?? new S(Y.CANCELLED, "upload stopped");
433
433
  return this.upload = "closing", this.finishPromise = this.channel.writer.close().then(
434
434
  () => {
435
435
  this.upload = "closed";
436
436
  },
437
437
  (t) => {
438
- throw this.upload = "stopped", this.uploadError = V(this.channel, t), this.uploadError;
438
+ throw this.upload = "stopped", this.uploadError = P(this.channel, t), this.uploadError;
439
439
  }
440
440
  ), this.finishPromise;
441
441
  }
442
442
  }
443
443
  }
444
- async cancel(t = B.CANCELLED) {
445
- if (ms(t), this.cancelPromise) return this.cancelPromise;
444
+ async cancel(t = Y.CANCELLED) {
445
+ if (bs(t), this.cancelPromise) return this.cancelPromise;
446
446
  if (this.terminal !== "open") return;
447
- this.terminal = "cancelled", this.terminalError = new T(t, "stream cancelled");
448
- const n = ln(t);
447
+ this.terminal = "cancelled", this.terminalError = new S(t, "stream cancelled");
448
+ const n = dn(t);
449
449
  return this.cancelPromise = Promise.allSettled([
450
450
  this.cancelUpload(),
451
451
  this.frames.cancel(n).catch((s) => this.channel.sessionFailed?.(s))
@@ -475,7 +475,7 @@ class fs {
475
475
  t = await this.frames.readFrame();
476
476
  } catch (s) {
477
477
  if (this.terminalError) throw this.terminalError;
478
- const r = V(this.channel, s);
478
+ const r = P(this.channel, s);
479
479
  throw this.terminal = "error", this.terminalError = r, s instanceof b && await O(this.channel, this.frames, s), r;
480
480
  }
481
481
  if (this.terminalError) throw this.terminalError;
@@ -483,13 +483,13 @@ class fs {
483
483
  return this.terminal = "clean", { done: !0, value: void 0 };
484
484
  if (t.type === "data") return { done: !1, value: t.body };
485
485
  if (t.type === "error")
486
- throw this.terminal = "error", this.terminalError = new T(t.code, t.reason), dn(this.channel), this.terminalError;
486
+ throw this.terminal = "error", this.terminalError = new S(t.code, t.reason), hn(this.channel), this.terminalError;
487
487
  const n = new b(`unexpected ${t.type} frame after streaming REQUEST echo`);
488
488
  throw this.terminal = "error", this.terminalError = n, await O(this.channel, this.frames, n), n;
489
489
  }
490
490
  assertWritable() {
491
491
  if (this.terminalError) throw this.terminalError;
492
- if (this.terminal !== "open") throw new T(B.CANCELLED, "stream is terminal");
492
+ if (this.terminal !== "open") throw new S(Y.CANCELLED, "stream is terminal");
493
493
  if (this.upload !== "open")
494
494
  throw this.uploadError ?? new b("stream upload is already finished");
495
495
  }
@@ -501,7 +501,7 @@ class fs {
501
501
  if (this.upload === "open") {
502
502
  this.upload = "closing";
503
503
  try {
504
- await this.channel.writer.write(un()), await this.channel.writer.close(), this.upload = "closed";
504
+ await this.channel.writer.write(ln()), await this.channel.writer.close(), this.upload = "closed";
505
505
  } catch (t) {
506
506
  this.upload = "stopped", this.channel.sessionFailed?.(t);
507
507
  }
@@ -510,11 +510,11 @@ class fs {
510
510
  }
511
511
  async function O(e, t, n) {
512
512
  if (!(n instanceof b)) return;
513
- const s = n instanceof on ? B.MESSAGE_TOO_LARGE : B.INVALID_ARGUMENT, r = ln(s, n.message);
513
+ const s = n instanceof cn ? Y.MESSAGE_TOO_LARGE : Y.INVALID_ARGUMENT, r = dn(s, n.message);
514
514
  await Promise.allSettled([
515
515
  (async () => {
516
516
  try {
517
- await e.writer.write(un()), await e.writer.close();
517
+ await e.writer.write(ln()), await e.writer.close();
518
518
  } catch (i) {
519
519
  e.sessionFailed?.(i);
520
520
  }
@@ -522,17 +522,17 @@ async function O(e, t, n) {
522
522
  t.cancel(r).catch((i) => e.sessionFailed?.(i))
523
523
  ]);
524
524
  }
525
- async function dn(e) {
525
+ async function hn(e) {
526
526
  try {
527
527
  await e.writer.close();
528
528
  } catch (t) {
529
529
  e.sessionFailed?.(t);
530
530
  }
531
531
  }
532
- function V(e, t) {
533
- return e.sessionFailed?.(t), cs(t);
532
+ function P(e, t) {
533
+ return e.sessionFailed?.(t), ls(t);
534
534
  }
535
- function ms(e) {
535
+ function bs(e) {
536
536
  if (!Number.isInteger(e) || e < 0 || e > 255)
537
537
  throw new RangeError(`WebTransport stream error code must be an integer in 0..255: ${e}`);
538
538
  }
@@ -542,7 +542,7 @@ function Ie() {
542
542
  function W(e) {
543
543
  return new Promise((t) => setTimeout(t, e));
544
544
  }
545
- function hn() {
545
+ function fn() {
546
546
  const e = Date.now(), t = new Uint8Array(16);
547
547
  crypto.getRandomValues(t), t[0] = e >> 40 & 255, t[1] = e >> 32 & 255, t[2] = e >> 24 & 255, t[3] = e >> 16 & 255, t[4] = e >> 8 & 255, t[5] = e & 255, t[6] = t[6] & 15 | 112, t[8] = t[8] & 63 | 128;
548
548
  const n = [...t].map((s) => s.toString(16).padStart(2, "0")).join("");
@@ -551,14 +551,14 @@ function hn() {
551
551
  20
552
552
  )}-${n.slice(20)}`;
553
553
  }
554
- function Fe(e, t) {
554
+ function Ve(e, t) {
555
555
  return e !== null && typeof e == "object" && "$typeName" in e && typeof e.$typeName == "string" ? t === void 0 ? !0 : t.typeName === e.$typeName : !1;
556
556
  }
557
557
  var c;
558
558
  (function(e) {
559
559
  e[e.DOUBLE = 1] = "DOUBLE", e[e.FLOAT = 2] = "FLOAT", e[e.INT64 = 3] = "INT64", e[e.UINT64 = 4] = "UINT64", e[e.INT32 = 5] = "INT32", e[e.FIXED64 = 6] = "FIXED64", e[e.FIXED32 = 7] = "FIXED32", e[e.BOOL = 8] = "BOOL", e[e.STRING = 9] = "STRING", e[e.BYTES = 12] = "BYTES", e[e.UINT32 = 13] = "UINT32", e[e.SFIXED32 = 15] = "SFIXED32", e[e.SFIXED64 = 16] = "SFIXED64", e[e.SINT32 = 17] = "SINT32", e[e.SINT64 = 18] = "SINT64";
560
560
  })(c || (c = {}));
561
- function ps() {
561
+ function gs() {
562
562
  let e = 0, t = 0;
563
563
  for (let s = 0; s < 28; s += 7) {
564
564
  let r = this.buf[this.pos++];
@@ -601,30 +601,30 @@ function lt(e) {
601
601
  const l = Number(e.slice(a, o));
602
602
  r *= n, s = s * n + l, s >= ae && (r = r + (s / ae | 0), s = s % ae);
603
603
  }
604
- return i(-24, -18), i(-18, -12), i(-12, -6), i(-6), t ? mn(s, r) : Ge(s, r);
604
+ return i(-24, -18), i(-18, -12), i(-12, -6), i(-6), t ? pn(s, r) : Ge(s, r);
605
605
  }
606
- function bs(e, t) {
606
+ function Es(e, t) {
607
607
  let n = Ge(e, t);
608
608
  const s = n.hi & 2147483648;
609
- s && (n = mn(n.lo, n.hi));
610
- const r = fn(n.lo, n.hi);
609
+ s && (n = pn(n.lo, n.hi));
610
+ const r = mn(n.lo, n.hi);
611
611
  return s ? "-" + r : r;
612
612
  }
613
- function fn(e, t) {
614
- if ({ lo: e, hi: t } = gs(e, t), t <= 2097151)
613
+ function mn(e, t) {
614
+ if ({ lo: e, hi: t } = ys(e, t), t <= 2097151)
615
615
  return String(ae * t + e);
616
616
  const n = e & 16777215, s = (e >>> 24 | t << 8) & 16777215, r = t >> 16 & 65535;
617
617
  let i = n + s * 6777216 + r * 6710656, a = s + r * 8147497, o = r * 2;
618
618
  const l = 1e7;
619
619
  return i >= l && (a += Math.floor(i / l), i %= l), a >= l && (o += Math.floor(a / l), a %= l), o.toString() + dt(a) + dt(i);
620
620
  }
621
- function gs(e, t) {
621
+ function ys(e, t) {
622
622
  return { lo: e >>> 0, hi: t >>> 0 };
623
623
  }
624
624
  function Ge(e, t) {
625
625
  return { lo: e | 0, hi: t | 0 };
626
626
  }
627
- function mn(e, t) {
627
+ function pn(e, t) {
628
628
  return t = ~t, e ? e = ~e + 1 : t += 1, Ge(e, t);
629
629
  }
630
630
  const dt = (e) => {
@@ -642,7 +642,7 @@ function Ce(e, t) {
642
642
  t.push(1);
643
643
  }
644
644
  }
645
- function Es() {
645
+ function ws() {
646
646
  let e = this.buf[this.pos++], t = e & 127;
647
647
  if ((e & 128) == 0)
648
648
  return this.assertBounds(), t;
@@ -659,8 +659,8 @@ function Es() {
659
659
  throw new Error("invalid varint");
660
660
  return this.assertBounds(), t >>> 0;
661
661
  }
662
- const w = /* @__PURE__ */ ys();
663
- function ys() {
662
+ const w = /* @__PURE__ */ Is();
663
+ function Is() {
664
664
  const e = new DataView(new ArrayBuffer(8));
665
665
  if (typeof BigInt == "function" && typeof e.getBigInt64 == "function" && typeof e.getBigUint64 == "function" && typeof e.setBigInt64 == "function" && typeof e.setBigUint64 == "function" && (!!globalThis.Deno || !!globalThis.Bun || typeof process != "object" || typeof process.env != "object" || process.env.BUF_BIGINT_DISABLE !== "1")) {
666
666
  const n = BigInt("-9223372036854775808"), s = BigInt("9223372036854775807"), r = BigInt("0"), i = BigInt("18446744073709551615");
@@ -715,10 +715,10 @@ function ys() {
715
715
  return typeof n != "string" && (n = n.toString()), ft(n), lt(n);
716
716
  },
717
717
  dec(n, s) {
718
- return bs(n, s);
718
+ return Es(n, s);
719
719
  },
720
720
  uDec(n, s) {
721
- return fn(n, s);
721
+ return mn(n, s);
722
722
  }
723
723
  };
724
724
  }
@@ -751,7 +751,7 @@ function q(e, t) {
751
751
  return 0;
752
752
  }
753
753
  }
754
- function ws(e, t) {
754
+ function Ns(e, t) {
755
755
  switch (e) {
756
756
  case c.BOOL:
757
757
  return t === !1;
@@ -766,16 +766,16 @@ function ws(e, t) {
766
766
  return t == 0;
767
767
  }
768
768
  }
769
- const pn = 2, M = Symbol.for("reflect unsafe local");
770
- function bn(e, t) {
769
+ const bn = 2, M = Symbol.for("reflect unsafe local");
770
+ function gn(e, t) {
771
771
  const n = e[t.localName].case;
772
772
  return n === void 0 ? n : t.fields.find((s) => s.localName === n);
773
773
  }
774
- function Is(e, t) {
774
+ function Ts(e, t) {
775
775
  const n = t.localName;
776
776
  if (t.oneof)
777
777
  return e[t.oneof.localName].case === n;
778
- if (t.presence != pn)
778
+ if (t.presence != bn)
779
779
  return e[n] !== void 0 && Object.prototype.hasOwnProperty.call(e, n);
780
780
  switch (t.fieldKind) {
781
781
  case "list":
@@ -783,7 +783,7 @@ function Is(e, t) {
783
783
  case "map":
784
784
  return Object.keys(e[n]).length > 0;
785
785
  case "scalar":
786
- return !ws(t.scalar, e[n]);
786
+ return !Ns(t.scalar, e[n]);
787
787
  case "enum":
788
788
  return e[n] !== t.enum.values[0].number;
789
789
  }
@@ -792,25 +792,25 @@ function Is(e, t) {
792
792
  function H(e, t) {
793
793
  return Object.prototype.hasOwnProperty.call(e, t) && e[t] !== void 0;
794
794
  }
795
- function gn(e, t) {
795
+ function En(e, t) {
796
796
  if (t.oneof) {
797
797
  const n = e[t.oneof.localName];
798
798
  return n.case === t.localName ? n.value : void 0;
799
799
  }
800
800
  return e[t.localName];
801
801
  }
802
- function En(e, t, n) {
802
+ function yn(e, t, n) {
803
803
  t.oneof ? e[t.oneof.localName] = {
804
804
  case: t.localName,
805
805
  value: n
806
806
  } : e[t.localName] = n;
807
807
  }
808
- function Ns(e, t) {
808
+ function Ss(e, t) {
809
809
  const n = t.localName;
810
810
  if (t.oneof) {
811
811
  const s = t.oneof.localName;
812
812
  e[s].case === n && (e[s] = { case: void 0 });
813
- } else if (t.presence != pn)
813
+ } else if (t.presence != bn)
814
814
  delete e[n];
815
815
  else
816
816
  switch (t.fieldKind) {
@@ -828,12 +828,12 @@ function Ns(e, t) {
828
828
  break;
829
829
  }
830
830
  }
831
- function P(e) {
831
+ function F(e) {
832
832
  return e !== null && typeof e == "object" && !Array.isArray(e);
833
833
  }
834
834
  function Be(e, t) {
835
835
  var n, s, r, i;
836
- if (P(e) && M in e && "add" in e && "field" in e && typeof e.field == "function") {
836
+ if (F(e) && M in e && "add" in e && "field" in e && typeof e.field == "function") {
837
837
  if (t !== void 0) {
838
838
  const a = t, o = e.field();
839
839
  return a.listKind == o.listKind && a.scalar === o.scalar && ((n = a.message) === null || n === void 0 ? void 0 : n.typeName) === ((s = o.message) === null || s === void 0 ? void 0 : s.typeName) && ((r = a.enum) === null || r === void 0 ? void 0 : r.typeName) === ((i = o.enum) === null || i === void 0 ? void 0 : i.typeName);
@@ -844,7 +844,7 @@ function Be(e, t) {
844
844
  }
845
845
  function Ye(e, t) {
846
846
  var n, s, r, i;
847
- if (P(e) && M in e && "has" in e && "field" in e && typeof e.field == "function") {
847
+ if (F(e) && M in e && "has" in e && "field" in e && typeof e.field == "function") {
848
848
  if (t !== void 0) {
849
849
  const a = t, o = e.field();
850
850
  return a.mapKey === o.mapKey && a.mapKind == o.mapKind && a.scalar === o.scalar && ((n = a.message) === null || n === void 0 ? void 0 : n.typeName) === ((s = o.message) === null || s === void 0 ? void 0 : s.typeName) && ((r = a.enum) === null || r === void 0 ? void 0 : r.typeName) === ((i = o.enum) === null || i === void 0 ? void 0 : i.typeName);
@@ -854,16 +854,16 @@ function Ye(e, t) {
854
854
  return !1;
855
855
  }
856
856
  function $e(e, t) {
857
- return P(e) && M in e && "desc" in e && P(e.desc) && e.desc.kind === "message" && (t === void 0 || e.desc.typeName == t.typeName);
857
+ return F(e) && M in e && "desc" in e && F(e.desc) && e.desc.kind === "message" && (t === void 0 || e.desc.typeName == t.typeName);
858
858
  }
859
- function Ts(e) {
860
- return wn(e.$typeName);
859
+ function ks(e) {
860
+ return In(e.$typeName);
861
861
  }
862
- function yn(e) {
862
+ function wn(e) {
863
863
  const t = e.fields[0];
864
- return wn(e.typeName) && t !== void 0 && t.fieldKind == "scalar" && t.name == "value" && t.number == 1;
864
+ return In(e.typeName) && t !== void 0 && t.fieldKind == "scalar" && t.name == "value" && t.number == 1;
865
865
  }
866
- function wn(e) {
866
+ function In(e) {
867
867
  return e.startsWith("google.protobuf.") && [
868
868
  "DoubleValue",
869
869
  "FloatValue",
@@ -876,24 +876,24 @@ function wn(e) {
876
876
  "BytesValue"
877
877
  ].includes(e.substring(16));
878
878
  }
879
- const Ss = 999, ks = 998, oe = 2;
879
+ const As = 999, Rs = 998, oe = 2;
880
880
  function C(e, t) {
881
- if (Fe(t, e))
881
+ if (Ve(t, e))
882
882
  return t;
883
- const n = Os(e);
884
- return t !== void 0 && As(e, n, t), n;
883
+ const n = Ds(e);
884
+ return t !== void 0 && _s(e, n, t), n;
885
885
  }
886
- function As(e, t, n) {
886
+ function _s(e, t, n) {
887
887
  for (const s of e.members) {
888
888
  let r = n[s.localName];
889
889
  if (r == null)
890
890
  continue;
891
891
  let i;
892
892
  if (s.kind == "oneof") {
893
- const a = bn(n, s);
893
+ const a = gn(n, s);
894
894
  if (!a)
895
895
  continue;
896
- i = a, r = gn(n, a);
896
+ i = a, r = En(n, a);
897
897
  } else
898
898
  i = s;
899
899
  switch (i.fieldKind) {
@@ -901,24 +901,24 @@ function As(e, t, n) {
901
901
  r = Xe(i, r);
902
902
  break;
903
903
  case "scalar":
904
- r = In(i, r);
904
+ r = Nn(i, r);
905
905
  break;
906
906
  case "list":
907
- r = _s(i, r);
907
+ r = Os(i, r);
908
908
  break;
909
909
  case "map":
910
- r = Rs(i, r);
910
+ r = vs(i, r);
911
911
  break;
912
912
  }
913
- En(t, i, r);
913
+ yn(t, i, r);
914
914
  }
915
915
  return t;
916
916
  }
917
- function In(e, t) {
917
+ function Nn(e, t) {
918
918
  return e.scalar == c.BYTES ? Ke(t) : t;
919
919
  }
920
- function Rs(e, t) {
921
- if (P(t)) {
920
+ function vs(e, t) {
921
+ if (F(t)) {
922
922
  if (e.scalar == c.BYTES)
923
923
  return mt(t, Ke);
924
924
  if (e.mapKind == "message")
@@ -926,7 +926,7 @@ function Rs(e, t) {
926
926
  }
927
927
  return t;
928
928
  }
929
- function _s(e, t) {
929
+ function Os(e, t) {
930
930
  if (Array.isArray(t)) {
931
931
  if (e.scalar == c.BYTES)
932
932
  return t.map(Ke);
@@ -936,12 +936,12 @@ function _s(e, t) {
936
936
  return t;
937
937
  }
938
938
  function Xe(e, t) {
939
- if (e.fieldKind == "message" && !e.oneof && yn(e.message))
940
- return In(e.message.fields[0], t);
941
- if (P(t)) {
939
+ if (e.fieldKind == "message" && !e.oneof && wn(e.message))
940
+ return Nn(e.message.fields[0], t);
941
+ if (F(t)) {
942
942
  if (e.message.typeName == "google.protobuf.Struct" && e.parent.typeName !== "google.protobuf.Value")
943
943
  return t;
944
- if (!Fe(t, e.message))
944
+ if (!Ve(t, e.message))
945
945
  return C(e.message, t);
946
946
  }
947
947
  return t;
@@ -955,10 +955,10 @@ function mt(e, t) {
955
955
  n[s[0]] = t(s[1]);
956
956
  return n;
957
957
  }
958
- const vs = Symbol(), pt = /* @__PURE__ */ new WeakMap();
959
- function Os(e) {
958
+ const Cs = Symbol(), pt = /* @__PURE__ */ new WeakMap();
959
+ function Ds(e) {
960
960
  let t;
961
- if (Cs(e)) {
961
+ if (Us(e)) {
962
962
  const n = pt.get(e);
963
963
  let s, r;
964
964
  if (n)
@@ -981,11 +981,11 @@ function Os(e) {
981
981
  }
982
982
  return t;
983
983
  }
984
- function Cs(e) {
984
+ function Us(e) {
985
985
  switch (e.file.edition) {
986
- case Ss:
986
+ case As:
987
987
  return !1;
988
- case ks:
988
+ case Rs:
989
989
  return !0;
990
990
  default:
991
991
  return e.fields.some((t) => t.presence != oe && t.fieldKind != "message" && !t.oneof);
@@ -999,11 +999,11 @@ function Te(e) {
999
999
  if (e.fieldKind == "map")
1000
1000
  return {};
1001
1001
  if (e.fieldKind == "message")
1002
- return vs;
1002
+ return Cs;
1003
1003
  const t = e.getDefaultValue();
1004
1004
  return t !== void 0 ? e.fieldKind == "scalar" && e.longAsString ? t.toString() : t : e.fieldKind == "scalar" ? q(e.scalar, e.longAsString) : e.enum.values[0].number;
1005
1005
  }
1006
- class Y extends Error {
1006
+ class $ extends Error {
1007
1007
  constructor(t, n, s = "FieldValueInvalidError") {
1008
1008
  super(n), this.name = s, this.field = () => t;
1009
1009
  }
@@ -1035,8 +1035,8 @@ var I;
1035
1035
  (function(e) {
1036
1036
  e[e.Varint = 0] = "Varint", e[e.Bit64 = 1] = "Bit64", e[e.LengthDelimited = 2] = "LengthDelimited", e[e.StartGroup = 3] = "StartGroup", e[e.EndGroup = 4] = "EndGroup", e[e.Bit32 = 5] = "Bit32";
1037
1037
  })(I || (I = {}));
1038
- const Nn = 34028234663852886e22, Tn = -34028234663852886e22, Sn = 4294967295, kn = 2147483647, An = -2147483648;
1039
- class Ds {
1038
+ const Tn = 34028234663852886e22, Sn = -34028234663852886e22, kn = 4294967295, An = 2147483647, Rn = -2147483648;
1039
+ class Ls {
1040
1040
  constructor(t = We().encodeUtf8) {
1041
1041
  this.encodeUtf8 = t, this.stack = [], this.chunks = [], this.buf = [];
1042
1042
  }
@@ -1125,7 +1125,7 @@ class Ds {
1125
1125
  * Write a `float` value, 32-bit floating point number.
1126
1126
  */
1127
1127
  float(t) {
1128
- Ls(t);
1128
+ xs(t);
1129
1129
  let n = new Uint8Array(4);
1130
1130
  return new DataView(n.buffer).setFloat32(0, t, !0), this.raw(n);
1131
1131
  }
@@ -1194,9 +1194,9 @@ class Ds {
1194
1194
  return Ne(n.lo, n.hi, this.buf), this;
1195
1195
  }
1196
1196
  }
1197
- class Us {
1197
+ class Ms {
1198
1198
  constructor(t, n = We().decodeUtf8) {
1199
- this.decodeUtf8 = n, this.varint64 = ps, this.uint32 = Es, this.buf = t, this.len = t.length, this.pos = 0, this.view = new DataView(t.buffer, t.byteOffset, t.byteLength);
1199
+ this.decodeUtf8 = n, this.varint64 = gs, this.uint32 = ws, this.buf = t, this.len = t.length, this.pos = 0, this.view = new DataView(t.buffer, t.byteOffset, t.byteLength);
1200
1200
  }
1201
1201
  /**
1202
1202
  * Reads a tag - field number and wire type. Tags are uint32 varints; values
@@ -1356,7 +1356,7 @@ function ke(e) {
1356
1356
  e = Number(e);
1357
1357
  else if (typeof e != "number")
1358
1358
  throw new Error("invalid int32: " + typeof e);
1359
- if (!Number.isInteger(e) || e > kn || e < An)
1359
+ if (!Number.isInteger(e) || e > An || e < Rn)
1360
1360
  throw new Error("invalid int32: " + e);
1361
1361
  }
1362
1362
  function bt(e) {
@@ -1364,48 +1364,48 @@ function bt(e) {
1364
1364
  e = Number(e);
1365
1365
  else if (typeof e != "number")
1366
1366
  throw new Error("invalid uint32: " + typeof e);
1367
- if (!Number.isInteger(e) || e > Sn || e < 0)
1367
+ if (!Number.isInteger(e) || e > kn || e < 0)
1368
1368
  throw new Error("invalid uint32: " + e);
1369
1369
  }
1370
- function Ls(e) {
1370
+ function xs(e) {
1371
1371
  if (typeof e == "string") {
1372
1372
  const t = e;
1373
1373
  if (e = Number(e), Number.isNaN(e) && t !== "NaN")
1374
1374
  throw new Error("invalid float32: " + t);
1375
1375
  } else if (typeof e != "number")
1376
1376
  throw new Error("invalid float32: " + typeof e);
1377
- if (Number.isFinite(e) && (e > Nn || e < Tn))
1377
+ if (Number.isFinite(e) && (e > Tn || e < Sn))
1378
1378
  throw new Error("invalid float32: " + e);
1379
1379
  }
1380
- function Ms(e, t) {
1380
+ function Fs(e, t) {
1381
1381
  const n = e.fieldKind == "list" ? Be(t, e) : e.fieldKind == "map" ? Ye(t, e) : je(e, t);
1382
1382
  if (n === !0)
1383
1383
  return;
1384
1384
  let s;
1385
1385
  switch (e.fieldKind) {
1386
1386
  case "list":
1387
- s = `expected ${_n(e)}, got ${de(t)}`;
1387
+ s = `expected ${vn(e)}, got ${de(t)}`;
1388
1388
  break;
1389
1389
  case "map":
1390
- s = `expected ${vn(e)}, got ${de(t)}`;
1390
+ s = `expected ${On(e)}, got ${de(t)}`;
1391
1391
  break;
1392
1392
  default:
1393
1393
  s = le(e, t, n);
1394
1394
  }
1395
- return new Y(e, s);
1395
+ return new $(e, s);
1396
1396
  }
1397
1397
  function gt(e, t, n) {
1398
1398
  const s = je(e, n);
1399
1399
  if (s !== !0)
1400
- return new Y(e, `list item #${t + 1}: ${le(e, n, s)}`);
1400
+ return new $(e, `list item #${t + 1}: ${le(e, n, s)}`);
1401
1401
  }
1402
- function xs(e, t, n) {
1402
+ function Ps(e, t, n) {
1403
1403
  const s = De(t, e.mapKey);
1404
1404
  if (s !== !0)
1405
- return new Y(e, `invalid map key: ${le({ scalar: e.mapKey }, t, s)}`);
1405
+ return new $(e, `invalid map key: ${le({ scalar: e.mapKey }, t, s)}`);
1406
1406
  const r = je(e, n);
1407
1407
  if (r !== !0)
1408
- return new Y(e, `map entry ${de(t)}: ${le(e, n, r)}`);
1408
+ return new $(e, `map entry ${de(t)}: ${le(e, n, r)}`);
1409
1409
  }
1410
1410
  function je(e, t) {
1411
1411
  return e.scalar !== void 0 ? De(t, e.scalar) : e.enum !== void 0 ? e.enum.open ? De(t, c.INT32) : e.enum.values.some((n) => n.number === t) : $e(t, e.message);
@@ -1415,14 +1415,14 @@ function De(e, t) {
1415
1415
  case c.DOUBLE:
1416
1416
  return typeof e == "number";
1417
1417
  case c.FLOAT:
1418
- return typeof e != "number" ? !1 : Number.isNaN(e) || !Number.isFinite(e) ? !0 : e > Nn || e < Tn ? `${e.toFixed()} out of range` : !0;
1418
+ return typeof e != "number" ? !1 : Number.isNaN(e) || !Number.isFinite(e) ? !0 : e > Tn || e < Sn ? `${e.toFixed()} out of range` : !0;
1419
1419
  case c.INT32:
1420
1420
  case c.SFIXED32:
1421
1421
  case c.SINT32:
1422
- return typeof e != "number" || !Number.isInteger(e) ? !1 : e > kn || e < An ? `${e.toFixed()} out of range` : !0;
1422
+ return typeof e != "number" || !Number.isInteger(e) ? !1 : e > An || e < Rn ? `${e.toFixed()} out of range` : !0;
1423
1423
  case c.FIXED32:
1424
1424
  case c.UINT32:
1425
- return typeof e != "number" || !Number.isInteger(e) ? !1 : e > Sn || e < 0 ? `${e.toFixed()} out of range` : !0;
1425
+ return typeof e != "number" || !Number.isInteger(e) ? !1 : e > kn || e < 0 ? `${e.toFixed()} out of range` : !0;
1426
1426
  case c.BOOL:
1427
1427
  return typeof e == "boolean";
1428
1428
  case c.STRING:
@@ -1451,12 +1451,12 @@ function De(e, t) {
1451
1451
  }
1452
1452
  }
1453
1453
  function le(e, t, n) {
1454
- return n = typeof n == "string" ? `: ${n}` : `, got ${de(t)}`, e.scalar !== void 0 ? `expected ${Ps(e.scalar)}` + n : e.enum !== void 0 ? `expected ${e.enum.toString()}` + n : `expected ${Rn(e.message)}` + n;
1454
+ return n = typeof n == "string" ? `: ${n}` : `, got ${de(t)}`, e.scalar !== void 0 ? `expected ${Vs(e.scalar)}` + n : e.enum !== void 0 ? `expected ${e.enum.toString()}` + n : `expected ${_n(e.message)}` + n;
1455
1455
  }
1456
1456
  function de(e) {
1457
1457
  switch (typeof e) {
1458
1458
  case "object":
1459
- return e === null ? "null" : e instanceof Uint8Array ? `Uint8Array(${e.length})` : Array.isArray(e) ? `Array(${e.length})` : Be(e) ? _n(e.field()) : Ye(e) ? vn(e.field()) : $e(e) ? Rn(e.desc) : Fe(e) ? `message ${e.$typeName}` : "object";
1459
+ return e === null ? "null" : e instanceof Uint8Array ? `Uint8Array(${e.length})` : Array.isArray(e) ? `Array(${e.length})` : Be(e) ? vn(e.field()) : Ye(e) ? On(e.field()) : $e(e) ? _n(e.desc) : Ve(e) ? `message ${e.$typeName}` : "object";
1460
1460
  case "string":
1461
1461
  return e.length > 30 ? "string" : `"${e.split('"').join('\\"')}"`;
1462
1462
  case "boolean":
@@ -1469,10 +1469,10 @@ function de(e) {
1469
1469
  return typeof e;
1470
1470
  }
1471
1471
  }
1472
- function Rn(e) {
1472
+ function _n(e) {
1473
1473
  return `ReflectMessage (${e.typeName})`;
1474
1474
  }
1475
- function _n(e) {
1475
+ function vn(e) {
1476
1476
  switch (e.listKind) {
1477
1477
  case "message":
1478
1478
  return `ReflectList (${e.message.toString()})`;
@@ -1482,7 +1482,7 @@ function _n(e) {
1482
1482
  return `ReflectList (${c[e.scalar]})`;
1483
1483
  }
1484
1484
  }
1485
- function vn(e) {
1485
+ function On(e) {
1486
1486
  switch (e.mapKind) {
1487
1487
  case "message":
1488
1488
  return `ReflectMap (${c[e.mapKey]}, ${e.message.toString()})`;
@@ -1492,7 +1492,7 @@ function vn(e) {
1492
1492
  return `ReflectMap (${c[e.mapKey]}, ${c[e.scalar]})`;
1493
1493
  }
1494
1494
  }
1495
- function Ps(e) {
1495
+ function Vs(e) {
1496
1496
  switch (e) {
1497
1497
  case c.STRING:
1498
1498
  return "string";
@@ -1520,12 +1520,12 @@ function Ps(e) {
1520
1520
  return "number (int32)";
1521
1521
  }
1522
1522
  }
1523
- const Vs = 0;
1523
+ const Gs = 0;
1524
1524
  function ge(e, t, n = !0) {
1525
- return new On(e, t, n);
1525
+ return new Cn(e, t, n);
1526
1526
  }
1527
1527
  const Et = /* @__PURE__ */ new WeakMap();
1528
- class On {
1528
+ class Cn {
1529
1529
  get sortedFields() {
1530
1530
  const t = Et.get(this.desc);
1531
1531
  if (t)
@@ -1540,31 +1540,31 @@ class On {
1540
1540
  return this._fieldsByNumber || (this._fieldsByNumber = new Map(this.desc.fields.map((n) => [n.number, n]))), this._fieldsByNumber.get(t);
1541
1541
  }
1542
1542
  oneofCase(t) {
1543
- return K(this.message, t), bn(this.message, t);
1543
+ return K(this.message, t), gn(this.message, t);
1544
1544
  }
1545
1545
  isSet(t) {
1546
- return K(this.message, t), Is(this.message, t);
1546
+ return K(this.message, t), Ts(this.message, t);
1547
1547
  }
1548
1548
  clear(t) {
1549
- K(this.message, t), Ns(this.message, t);
1549
+ K(this.message, t), Ss(this.message, t);
1550
1550
  }
1551
1551
  get(t) {
1552
1552
  K(this.message, t);
1553
- const n = gn(this.message, t);
1553
+ const n = En(this.message, t);
1554
1554
  switch (t.fieldKind) {
1555
1555
  case "list":
1556
1556
  let s = this.lists.get(t);
1557
1557
  return (!s || s[M] !== n) && this.lists.set(
1558
1558
  t,
1559
1559
  // biome-ignore lint/suspicious/noAssignInExpressions: no
1560
- s = new Fs(t, n, this.check)
1560
+ s = new Bs(t, n, this.check)
1561
1561
  ), s;
1562
1562
  case "map":
1563
1563
  let r = this.maps.get(t);
1564
1564
  return (!r || r[M] !== n) && this.maps.set(
1565
1565
  t,
1566
1566
  // biome-ignore lint/suspicious/noAssignInExpressions: no
1567
- r = new Gs(t, n, this.check)
1567
+ r = new Ys(t, n, this.check)
1568
1568
  ), r;
1569
1569
  case "message":
1570
1570
  return He(t, n, this.check);
@@ -1576,12 +1576,12 @@ class On {
1576
1576
  }
1577
1577
  set(t, n) {
1578
1578
  if (K(this.message, t), this.check) {
1579
- const r = Ms(t, n);
1579
+ const r = Fs(t, n);
1580
1580
  if (r)
1581
1581
  throw r;
1582
1582
  }
1583
1583
  let s;
1584
- t.fieldKind == "message" ? s = qe(t, n) : Ye(n) || Be(n) ? s = n[M] : s = ze(t, n), En(this.message, t, s);
1584
+ t.fieldKind == "message" ? s = qe(t, n) : Ye(n) || Be(n) ? s = n[M] : s = ze(t, n), yn(this.message, t, s);
1585
1585
  }
1586
1586
  getUnknown() {
1587
1587
  return this.message.$unknown;
@@ -1592,9 +1592,9 @@ class On {
1592
1592
  }
1593
1593
  function K(e, t) {
1594
1594
  if (t.parent.typeName !== e.$typeName)
1595
- throw new Y(t, `cannot use ${t.toString()} with message ${e.$typeName}`, "ForeignFieldError");
1595
+ throw new $(t, `cannot use ${t.toString()} with message ${e.$typeName}`, "ForeignFieldError");
1596
1596
  }
1597
- class Fs {
1597
+ class Bs {
1598
1598
  field() {
1599
1599
  return this._field;
1600
1600
  }
@@ -1610,7 +1610,7 @@ class Fs {
1610
1610
  }
1611
1611
  set(t, n) {
1612
1612
  if (t < 0 || t >= this._arr.length)
1613
- throw new Y(this._field, `list item #${t + 1}: out of range`);
1613
+ throw new $(this._field, `list item #${t + 1}: out of range`);
1614
1614
  if (this.check) {
1615
1615
  const s = gt(this._field, t, n);
1616
1616
  if (s)
@@ -1644,7 +1644,7 @@ class Fs {
1644
1644
  yield [t, Ae(this._field, this._arr[t], this.check)];
1645
1645
  }
1646
1646
  }
1647
- class Gs {
1647
+ class Ys {
1648
1648
  constructor(t, n, s = !0) {
1649
1649
  this.obj = this[M] = n ?? {}, this.check = s, this._field = t;
1650
1650
  }
@@ -1653,11 +1653,11 @@ class Gs {
1653
1653
  }
1654
1654
  set(t, n) {
1655
1655
  if (this.check) {
1656
- const s = xs(this._field, t, n);
1656
+ const s = Ps(this._field, t, n);
1657
1657
  if (s)
1658
1658
  throw s;
1659
1659
  }
1660
- return this.obj[J(t)] = Bs(this._field, n), this;
1660
+ return this.obj[J(t)] = $s(this._field, n), this;
1661
1661
  }
1662
1662
  delete(t) {
1663
1663
  const n = J(t), s = Object.prototype.hasOwnProperty.call(this.obj, n);
@@ -1701,13 +1701,13 @@ class Gs {
1701
1701
  }
1702
1702
  }
1703
1703
  function qe(e, t) {
1704
- return $e(t) ? Ts(t.message) && !e.oneof && e.fieldKind == "message" ? t.message.value : t.desc.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" ? Dn(t.message) : t.message : t;
1704
+ return $e(t) ? ks(t.message) && !e.oneof && e.fieldKind == "message" ? t.message.value : t.desc.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" ? Un(t.message) : t.message : t;
1705
1705
  }
1706
1706
  function He(e, t, n) {
1707
- return t !== void 0 && (yn(e.message) && !e.oneof && e.fieldKind == "message" ? t = {
1707
+ return t !== void 0 && (wn(e.message) && !e.oneof && e.fieldKind == "message" ? t = {
1708
1708
  $typeName: e.message.typeName,
1709
1709
  value: Ze(e.message.fields[0], t)
1710
- } : e.message.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" && P(t) && (t = Cn(t))), new On(e.message, t, n);
1710
+ } : e.message.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" && F(t) && (t = Dn(t))), new Cn(e.message, t, n);
1711
1711
  }
1712
1712
  function yt(e, t) {
1713
1713
  return e.listKind == "message" ? qe(e, t) : ze(e, t);
@@ -1715,7 +1715,7 @@ function yt(e, t) {
1715
1715
  function Ae(e, t, n) {
1716
1716
  return e.listKind == "message" ? He(e, t, n) : Ze(e, t);
1717
1717
  }
1718
- function Bs(e, t) {
1718
+ function $s(e, t) {
1719
1719
  return e.mapKind == "message" ? qe(e, t) : ze(e, t);
1720
1720
  }
1721
1721
  function Re(e, t, n) {
@@ -1790,28 +1790,28 @@ function ze(e, t) {
1790
1790
  }
1791
1791
  return t;
1792
1792
  }
1793
- function Cn(e) {
1793
+ function Dn(e) {
1794
1794
  const t = {
1795
1795
  $typeName: "google.protobuf.Struct",
1796
1796
  fields: {}
1797
1797
  };
1798
- if (P(e))
1798
+ if (F(e))
1799
1799
  for (const [n, s] of Object.entries(e))
1800
- t.fields[n] = Ln(s);
1800
+ t.fields[n] = Mn(s);
1801
1801
  return t;
1802
1802
  }
1803
- function Dn(e) {
1803
+ function Un(e) {
1804
1804
  const t = {};
1805
1805
  for (const [n, s] of Object.entries(e.fields))
1806
- t[n] = Un(s);
1806
+ t[n] = Ln(s);
1807
1807
  return t;
1808
1808
  }
1809
- function Un(e) {
1809
+ function Ln(e) {
1810
1810
  switch (e.kind.case) {
1811
1811
  case "structValue":
1812
- return Dn(e.kind.value);
1812
+ return Un(e.kind.value);
1813
1813
  case "listValue":
1814
- return e.kind.value.values.map(Un);
1814
+ return e.kind.value.values.map(Ln);
1815
1815
  case "nullValue":
1816
1816
  case void 0:
1817
1817
  return null;
@@ -1819,7 +1819,7 @@ function Un(e) {
1819
1819
  return e.kind.value;
1820
1820
  }
1821
1821
  }
1822
- function Ln(e) {
1822
+ function Mn(e) {
1823
1823
  const t = {
1824
1824
  $typeName: "google.protobuf.Value",
1825
1825
  kind: { case: void 0 }
@@ -1836,7 +1836,7 @@ function Ln(e) {
1836
1836
  break;
1837
1837
  case "object":
1838
1838
  if (e === null)
1839
- t.kind = { case: "nullValue", value: Vs };
1839
+ t.kind = { case: "nullValue", value: Gs };
1840
1840
  else if (Array.isArray(e)) {
1841
1841
  const n = {
1842
1842
  $typeName: "google.protobuf.ListValue",
@@ -1844,7 +1844,7 @@ function Ln(e) {
1844
1844
  };
1845
1845
  if (Array.isArray(e))
1846
1846
  for (const s of e)
1847
- n.values.push(Ln(s));
1847
+ n.values.push(Mn(s));
1848
1848
  t.kind = {
1849
1849
  case: "listValue",
1850
1850
  value: n
@@ -1852,14 +1852,14 @@ function Ln(e) {
1852
1852
  } else
1853
1853
  t.kind = {
1854
1854
  case: "structValue",
1855
- value: Cn(e)
1855
+ value: Dn(e)
1856
1856
  };
1857
1857
  break;
1858
1858
  }
1859
1859
  return t;
1860
1860
  }
1861
- function Ys(e) {
1862
- const t = Xs();
1861
+ function Xs(e) {
1862
+ const t = Ws();
1863
1863
  let n = e.length * 3 / 4;
1864
1864
  e[e.length - 2] == "=" ? n -= 2 : e[e.length - 1] == "=" && (n -= 1);
1865
1865
  let s = new Uint8Array(n), r = 0, i = 0, a, o = 0;
@@ -1899,19 +1899,19 @@ function Ys(e) {
1899
1899
  throw Error("invalid base64 string");
1900
1900
  return s.subarray(0, r);
1901
1901
  }
1902
- let ee, G;
1903
- function $s(e) {
1902
+ let ee, B;
1903
+ function Ks(e) {
1904
1904
  return ee || (ee = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), ee.slice(0, -2).concat("-", "_")), ee;
1905
1905
  }
1906
- function Xs() {
1907
- if (!G) {
1908
- G = [];
1909
- const e = $s();
1906
+ function Ws() {
1907
+ if (!B) {
1908
+ B = [];
1909
+ const e = Ks();
1910
1910
  for (let t = 0; t < e.length; t++)
1911
- G[e[t].charCodeAt(0)] = t;
1912
- G[45] = e.indexOf("+"), G[95] = e.indexOf("/");
1911
+ B[e[t].charCodeAt(0)] = t;
1912
+ B[45] = e.indexOf("+"), B[95] = e.indexOf("/");
1913
1913
  }
1914
- return G;
1914
+ return B;
1915
1915
  }
1916
1916
  function he(e) {
1917
1917
  let t = !1;
@@ -1941,7 +1941,7 @@ function he(e) {
1941
1941
  }
1942
1942
  return n.join("");
1943
1943
  }
1944
- const Ks = /* @__PURE__ */ new Set([
1944
+ const js = /* @__PURE__ */ new Set([
1945
1945
  // names reserved by JavaScript
1946
1946
  "constructor",
1947
1947
  "toString",
@@ -1949,25 +1949,25 @@ const Ks = /* @__PURE__ */ new Set([
1949
1949
  "valueOf"
1950
1950
  ]);
1951
1951
  function Z(e) {
1952
- return Ks.has(e) ? e + "$" : e;
1952
+ return js.has(e) ? e + "$" : e;
1953
1953
  }
1954
1954
  function Qe(e) {
1955
1955
  for (const t of e.field)
1956
1956
  H(t, "jsonName") || (t.jsonName = he(t.name));
1957
1957
  e.nestedType.forEach(Qe);
1958
1958
  }
1959
- function Ws(e, t) {
1959
+ function qs(e, t) {
1960
1960
  const n = e.values.find((s) => s.name === t);
1961
1961
  if (!n)
1962
1962
  throw new Error(`cannot parse ${e} default value: ${t}`);
1963
1963
  return n.number;
1964
1964
  }
1965
- function js(e, t) {
1965
+ function Hs(e, t) {
1966
1966
  switch (e) {
1967
1967
  case c.STRING:
1968
1968
  return t;
1969
1969
  case c.BYTES: {
1970
- const n = qs(t);
1970
+ const n = Zs(t);
1971
1971
  if (n === !1)
1972
1972
  throw new Error(`cannot parse ${c[e]} default value: ${t}`);
1973
1973
  return n;
@@ -2001,7 +2001,7 @@ function js(e, t) {
2001
2001
  return parseInt(t, 10);
2002
2002
  }
2003
2003
  }
2004
- function qs(e) {
2004
+ function Zs(e) {
2005
2005
  const t = [], n = {
2006
2006
  tail: e,
2007
2007
  c: "",
@@ -2109,8 +2109,8 @@ function* Ue(e) {
2109
2109
  break;
2110
2110
  }
2111
2111
  }
2112
- function Mn(...e) {
2113
- const t = Hs();
2112
+ function xn(...e) {
2113
+ const t = zs();
2114
2114
  if (!e.length)
2115
2115
  return t;
2116
2116
  if ("$typeName" in e[0] && e[0].$typeName == "google.protobuf.FileDescriptorSet") {
@@ -2140,7 +2140,7 @@ function Mn(...e) {
2140
2140
  t.addFile(s);
2141
2141
  return t;
2142
2142
  }
2143
- function Hs() {
2143
+ function zs() {
2144
2144
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
2145
2145
  return {
2146
2146
  kind: "registry",
@@ -2199,7 +2199,7 @@ function Hs() {
2199
2199
  }
2200
2200
  };
2201
2201
  }
2202
- const Zs = 998, zs = 999, Qs = 9999, Js = 9, z = 10, j = 11, er = 12, It = 14, Je = 3, tr = 2, Nt = 1, nr = 0, _e = 1, Tt = 2, sr = 3, rr = 1, ir = 2, ar = 1, or = 2, cr = 1001, xn = {
2202
+ const Qs = 998, Js = 999, er = 9999, tr = 9, z = 10, j = 11, nr = 12, It = 14, Je = 3, sr = 2, Nt = 1, rr = 0, _e = 1, Tt = 2, ir = 3, ar = 1, or = 2, cr = 1, ur = 2, lr = 1001, Fn = {
2203
2203
  // EDITION_PROTO2
2204
2204
  998: {
2205
2205
  fieldPresence: 1,
@@ -2283,9 +2283,9 @@ function St(e, t) {
2283
2283
  kind: "file",
2284
2284
  proto: e,
2285
2285
  deprecated: (s = (n = e.options) === null || n === void 0 ? void 0 : n.deprecated) !== null && s !== void 0 ? s : !1,
2286
- edition: hr(e),
2286
+ edition: mr(e),
2287
2287
  name: e.name.replace(/\.proto$/, ""),
2288
- dependencies: fr(e, t),
2288
+ dependencies: pr(e, t),
2289
2289
  enums: [],
2290
2290
  messages: [],
2291
2291
  extensions: [],
@@ -2307,7 +2307,7 @@ function St(e, t) {
2307
2307
  for (const o of e.messageType)
2308
2308
  Vn(o, r, void 0, t, a);
2309
2309
  for (const o of e.service)
2310
- ur(o, r, t);
2310
+ dr(o, r, t);
2311
2311
  Le(r, t);
2312
2312
  for (const o of i.values())
2313
2313
  Me(o, t, a);
@@ -2334,9 +2334,9 @@ function Le(e, t) {
2334
2334
  }
2335
2335
  }
2336
2336
  function Me(e, t, n) {
2337
- const s = e.proto.oneofDecl.map((i) => dr(i, e)), r = /* @__PURE__ */ new Set();
2337
+ const s = e.proto.oneofDecl.map((i) => fr(i, e)), r = /* @__PURE__ */ new Set();
2338
2338
  for (const i of e.proto.field) {
2339
- const a = br(i, s), o = xe(i, e, t, a, n);
2339
+ const a = Er(i, s), o = xe(i, e, t, a, n);
2340
2340
  e.fields.push(o), e.field[o.localName] = o, a === void 0 ? e.members.push(o) : (a.fields.push(o), r.has(a) || (r.add(a), e.members.push(a)));
2341
2341
  }
2342
2342
  for (const i of s.filter((a) => r.has(a)))
@@ -2346,7 +2346,7 @@ function Me(e, t, n) {
2346
2346
  }
2347
2347
  function Pn(e, t, n, s) {
2348
2348
  var r, i, a, o, l;
2349
- const u = mr(e.name, e.value), d = {
2349
+ const u = br(e.name, e.value), d = {
2350
2350
  kind: "enum",
2351
2351
  proto: e,
2352
2352
  deprecated: (i = (r = e.options) === null || r === void 0 ? void 0 : r.deprecated) !== null && i !== void 0 ? i : !1,
@@ -2362,7 +2362,7 @@ function Pn(e, t, n, s) {
2362
2362
  return `enum ${this.typeName}`;
2363
2363
  }
2364
2364
  };
2365
- d.open = wr(d), s.add(d);
2365
+ d.open = Nr(d), s.add(d);
2366
2366
  for (const f of e.value) {
2367
2367
  const p = f.name;
2368
2368
  d.values.push(
@@ -2410,7 +2410,7 @@ function Vn(e, t, n, s, r) {
2410
2410
  for (const d of e.nestedType)
2411
2411
  Vn(d, t, u, s, r);
2412
2412
  }
2413
- function ur(e, t, n) {
2413
+ function dr(e, t, n) {
2414
2414
  var s, r;
2415
2415
  const i = {
2416
2416
  kind: "service",
@@ -2427,11 +2427,11 @@ function ur(e, t, n) {
2427
2427
  };
2428
2428
  t.services.push(i), n.add(i);
2429
2429
  for (const a of e.method) {
2430
- const o = lr(a, i, n);
2430
+ const o = hr(a, i, n);
2431
2431
  i.methods.push(o), i.method[o.localName] = o;
2432
2432
  }
2433
2433
  }
2434
- function lr(e, t, n) {
2434
+ function hr(e, t, n) {
2435
2435
  var s, r, i, a;
2436
2436
  let o;
2437
2437
  e.clientStreaming && e.serverStreaming ? o = "bidi_streaming" : e.clientStreaming ? o = "client_streaming" : e.serverStreaming ? o = "server_streaming" : o = "unary";
@@ -2448,13 +2448,13 @@ function lr(e, t, n) {
2448
2448
  methodKind: o,
2449
2449
  input: l,
2450
2450
  output: u,
2451
- idempotency: (a = (i = e.options) === null || i === void 0 ? void 0 : i.idempotencyLevel) !== null && a !== void 0 ? a : nr,
2451
+ idempotency: (a = (i = e.options) === null || i === void 0 ? void 0 : i.idempotencyLevel) !== null && a !== void 0 ? a : rr,
2452
2452
  toString() {
2453
2453
  return `rpc ${t.typeName}.${d}`;
2454
2454
  }
2455
2455
  };
2456
2456
  }
2457
- function dr(e, t) {
2457
+ function fr(e, t) {
2458
2458
  return {
2459
2459
  kind: "oneof",
2460
2460
  proto: e,
@@ -2479,8 +2479,8 @@ function xe(e, t, n, s, r) {
2479
2479
  scalar: void 0,
2480
2480
  message: void 0,
2481
2481
  enum: void 0,
2482
- presence: gr(e, s, l, t),
2483
- utf8Validation: Ir(e, t),
2482
+ presence: yr(e, s, l, t),
2483
+ utf8Validation: Tr(e, t),
2484
2484
  listKind: void 0,
2485
2485
  mapKind: void 0,
2486
2486
  mapKey: void 0,
@@ -2503,7 +2503,7 @@ function xe(e, t, n, s, r) {
2503
2503
  const m = f == j ? r?.get(D(e.typeName)) : void 0;
2504
2504
  if (m) {
2505
2505
  u.fieldKind = "map";
2506
- const { key: g, value: E } = yr(m);
2506
+ const { key: g, value: E } = Ir(m);
2507
2507
  return u.mapKey = g.scalar, u.mapKind = E.fieldKind, u.message = E.message, u.delimitedEncoding = !1, u.enum = E.enum, u.scalar = E.scalar, u;
2508
2508
  }
2509
2509
  switch (u.fieldKind = "list", f) {
@@ -2518,7 +2518,7 @@ function xe(e, t, n, s, r) {
2518
2518
  u.listKind = "scalar", u.scalar = f, u.longAsString = p == Nt;
2519
2519
  break;
2520
2520
  }
2521
- return u.packed = Er(e, t), u;
2521
+ return u.packed = wr(e, t), u;
2522
2522
  }
2523
2523
  switch (f) {
2524
2524
  case j:
@@ -2528,34 +2528,34 @@ function xe(e, t, n, s, r) {
2528
2528
  break;
2529
2529
  case It: {
2530
2530
  const m = n.getEnum(D(e.typeName));
2531
- A(m !== void 0, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), u.fieldKind = "enum", u.enum = n.getEnum(D(e.typeName)), u.getDefaultValue = () => H(e, "defaultValue") ? Ws(m, e.defaultValue) : void 0;
2531
+ A(m !== void 0, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), u.fieldKind = "enum", u.enum = n.getEnum(D(e.typeName)), u.getDefaultValue = () => H(e, "defaultValue") ? qs(m, e.defaultValue) : void 0;
2532
2532
  break;
2533
2533
  }
2534
2534
  default: {
2535
- u.fieldKind = "scalar", u.scalar = f, u.longAsString = p == Nt, u.getDefaultValue = () => H(e, "defaultValue") ? js(f, e.defaultValue) : void 0;
2535
+ u.fieldKind = "scalar", u.scalar = f, u.longAsString = p == Nt, u.getDefaultValue = () => H(e, "defaultValue") ? Hs(f, e.defaultValue) : void 0;
2536
2536
  break;
2537
2537
  }
2538
2538
  }
2539
2539
  return u;
2540
2540
  }
2541
- function hr(e) {
2541
+ function mr(e) {
2542
2542
  switch (e.syntax) {
2543
2543
  case "":
2544
2544
  case "proto2":
2545
- return Zs;
2545
+ return Qs;
2546
2546
  case "proto3":
2547
- return zs;
2547
+ return Js;
2548
2548
  case "editions":
2549
- if (e.edition === Qs)
2550
- return cr;
2551
- if (e.edition in xn)
2549
+ if (e.edition === er)
2550
+ return lr;
2551
+ if (e.edition in Fn)
2552
2552
  return e.edition;
2553
2553
  throw new Error(`${e.name}: unsupported edition`);
2554
2554
  default:
2555
2555
  throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`);
2556
2556
  }
2557
2557
  }
2558
- function fr(e, t) {
2558
+ function pr(e, t) {
2559
2559
  return e.dependency.map((n) => {
2560
2560
  const s = t.getFile(n);
2561
2561
  if (!s)
@@ -2563,8 +2563,8 @@ function fr(e, t) {
2563
2563
  return s;
2564
2564
  });
2565
2565
  }
2566
- function mr(e, t) {
2567
- const n = pr(e) + "_";
2566
+ function br(e, t) {
2567
+ const n = gr(e) + "_";
2568
2568
  for (const s of t) {
2569
2569
  if (!s.name.toLowerCase().startsWith(n))
2570
2570
  return;
@@ -2574,7 +2574,7 @@ function mr(e, t) {
2574
2574
  }
2575
2575
  return n;
2576
2576
  }
2577
- function pr(e) {
2577
+ function gr(e) {
2578
2578
  return (e.substring(0, 1) + e.substring(1).replace(/[A-Z]/g, (t) => "_" + t)).toLowerCase();
2579
2579
  }
2580
2580
  function Ee(e, t, n) {
@@ -2584,62 +2584,62 @@ function Ee(e, t, n) {
2584
2584
  function D(e) {
2585
2585
  return e.startsWith(".") ? e.substring(1) : e;
2586
2586
  }
2587
- function br(e, t) {
2587
+ function Er(e, t) {
2588
2588
  if (!H(e, "oneofIndex") || e.proto3Optional)
2589
2589
  return;
2590
2590
  const n = t[e.oneofIndex];
2591
2591
  return A(n, `invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`), n;
2592
2592
  }
2593
- function gr(e, t, n, s) {
2594
- if (e.label == tr)
2595
- return sr;
2593
+ function yr(e, t, n, s) {
2594
+ if (e.label == sr)
2595
+ return ir;
2596
2596
  if (e.label == Je)
2597
2597
  return Tt;
2598
2598
  if (t || e.proto3Optional || n)
2599
2599
  return _e;
2600
- const r = F("fieldPresence", { proto: e, parent: s });
2600
+ const r = V("fieldPresence", { proto: e, parent: s });
2601
2601
  return r == Tt && (e.type == j || e.type == z) ? _e : r;
2602
2602
  }
2603
- function Er(e, t) {
2603
+ function wr(e, t) {
2604
2604
  if (e.label != Je)
2605
2605
  return !1;
2606
2606
  switch (e.type) {
2607
- case Js:
2608
- case er:
2607
+ case tr:
2608
+ case nr:
2609
2609
  case z:
2610
2610
  case j:
2611
2611
  return !1;
2612
2612
  }
2613
2613
  const n = e.options;
2614
- return n && H(n, "packed") ? n.packed : rr == F("repeatedFieldEncoding", {
2614
+ return n && H(n, "packed") ? n.packed : ar == V("repeatedFieldEncoding", {
2615
2615
  proto: e,
2616
2616
  parent: t
2617
2617
  });
2618
2618
  }
2619
- function yr(e) {
2619
+ function Ir(e) {
2620
2620
  const t = e.fields.find((s) => s.number === 1), n = e.fields.find((s) => s.number === 2);
2621
2621
  return A(t && t.fieldKind == "scalar" && t.scalar != c.BYTES && t.scalar != c.FLOAT && t.scalar != c.DOUBLE && n && n.fieldKind != "list" && n.fieldKind != "map"), { key: t, value: n };
2622
2622
  }
2623
- function wr(e) {
2623
+ function Nr(e) {
2624
2624
  var t;
2625
- return ar == F("enumType", {
2625
+ return cr == V("enumType", {
2626
2626
  proto: e.proto,
2627
2627
  parent: (t = e.parent) !== null && t !== void 0 ? t : e.file
2628
2628
  });
2629
2629
  }
2630
2630
  function kt(e, t) {
2631
- return e.type == z ? !0 : ir == F("messageEncoding", {
2631
+ return e.type == z ? !0 : or == V("messageEncoding", {
2632
2632
  proto: e,
2633
2633
  parent: t
2634
2634
  });
2635
2635
  }
2636
- function Ir(e, t) {
2637
- return or == F("utf8Validation", {
2636
+ function Tr(e, t) {
2637
+ return ur == V("utf8Validation", {
2638
2638
  proto: e,
2639
2639
  parent: t
2640
2640
  });
2641
2641
  }
2642
- function F(e, t) {
2642
+ function V(e, t) {
2643
2643
  var n, s;
2644
2644
  const r = (n = t.proto.options) === null || n === void 0 ? void 0 : n.features;
2645
2645
  if (r) {
@@ -2649,47 +2649,47 @@ function F(e, t) {
2649
2649
  }
2650
2650
  if ("kind" in t) {
2651
2651
  if (t.kind == "message")
2652
- return F(e, (s = t.parent) !== null && s !== void 0 ? s : t.file);
2653
- const i = xn[t.edition];
2652
+ return V(e, (s = t.parent) !== null && s !== void 0 ? s : t.file);
2653
+ const i = Fn[t.edition];
2654
2654
  if (!i)
2655
2655
  throw new Error(`feature default for edition ${t.edition} not found`);
2656
2656
  return i[e];
2657
2657
  }
2658
- return F(e, t.parent);
2658
+ return V(e, t.parent);
2659
2659
  }
2660
2660
  function A(e, t) {
2661
2661
  if (!e)
2662
2662
  throw new Error(t);
2663
2663
  }
2664
- function Nr(e) {
2665
- const t = Tr(e);
2666
- return t.messageType.forEach(Qe), Mn(t, () => {
2664
+ function Sr(e) {
2665
+ const t = kr(e);
2666
+ return t.messageType.forEach(Qe), xn(t, () => {
2667
2667
  }).getFile(t.name);
2668
2668
  }
2669
- function Tr(e) {
2669
+ function kr(e) {
2670
2670
  return Object.assign(/* @__PURE__ */ Object.create({
2671
2671
  syntax: "",
2672
2672
  edition: 0
2673
- }), Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], service: [], extension: [] }, e), { messageType: e.messageType.map(Fn), enumType: e.enumType.map(Gn) }));
2673
+ }), Object.assign(Object.assign({ $typeName: "google.protobuf.FileDescriptorProto", dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], service: [], extension: [] }, e), { messageType: e.messageType.map(Gn), enumType: e.enumType.map(Bn) }));
2674
2674
  }
2675
- function Fn(e) {
2675
+ function Gn(e) {
2676
2676
  var t, n, s, r, i, a, o, l;
2677
2677
  return Object.assign(/* @__PURE__ */ Object.create({
2678
2678
  visibility: 0
2679
2679
  }), {
2680
2680
  $typeName: "google.protobuf.DescriptorProto",
2681
2681
  name: e.name,
2682
- field: (n = (t = e.field) === null || t === void 0 ? void 0 : t.map(Sr)) !== null && n !== void 0 ? n : [],
2682
+ field: (n = (t = e.field) === null || t === void 0 ? void 0 : t.map(Ar)) !== null && n !== void 0 ? n : [],
2683
2683
  extension: [],
2684
- nestedType: (r = (s = e.nestedType) === null || s === void 0 ? void 0 : s.map(Fn)) !== null && r !== void 0 ? r : [],
2685
- enumType: (a = (i = e.enumType) === null || i === void 0 ? void 0 : i.map(Gn)) !== null && a !== void 0 ? a : [],
2684
+ nestedType: (r = (s = e.nestedType) === null || s === void 0 ? void 0 : s.map(Gn)) !== null && r !== void 0 ? r : [],
2685
+ enumType: (a = (i = e.enumType) === null || i === void 0 ? void 0 : i.map(Bn)) !== null && a !== void 0 ? a : [],
2686
2686
  extensionRange: (l = (o = e.extensionRange) === null || o === void 0 ? void 0 : o.map((d) => Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, d))) !== null && l !== void 0 ? l : [],
2687
2687
  oneofDecl: [],
2688
2688
  reservedRange: [],
2689
2689
  reservedName: []
2690
2690
  });
2691
2691
  }
2692
- function Sr(e) {
2692
+ function Ar(e) {
2693
2693
  return Object.assign(/* @__PURE__ */ Object.create({
2694
2694
  label: 1,
2695
2695
  typeName: "",
@@ -2698,9 +2698,9 @@ function Sr(e) {
2698
2698
  oneofIndex: 0,
2699
2699
  jsonName: "",
2700
2700
  proto3Optional: !1
2701
- }), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, e), { options: e.options ? kr(e.options) : void 0 }));
2701
+ }), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, e), { options: e.options ? Rr(e.options) : void 0 }));
2702
2702
  }
2703
- function kr(e) {
2703
+ function Rr(e) {
2704
2704
  var t, n, s;
2705
2705
  return Object.assign(/* @__PURE__ */ Object.create({
2706
2706
  ctype: 0,
@@ -2714,7 +2714,7 @@ function kr(e) {
2714
2714
  retention: 0
2715
2715
  }), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, e), { targets: (t = e.targets) !== null && t !== void 0 ? t : [], editionDefaults: (s = (n = e.editionDefaults) === null || n === void 0 ? void 0 : n.map((i) => Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, i))) !== null && s !== void 0 ? s : [], uninterpretedOption: [] }));
2716
2716
  }
2717
- function Gn(e) {
2717
+ function Bn(e) {
2718
2718
  return Object.assign(/* @__PURE__ */ Object.create({
2719
2719
  visibility: 0
2720
2720
  }), {
@@ -2728,7 +2728,7 @@ function Gn(e) {
2728
2728
  function R(e, t, ...n) {
2729
2729
  return n.reduce((s, r) => s.nestedMessages[r], e.messages[t]);
2730
2730
  }
2731
- const Ar = /* @__PURE__ */ Nr({ name: "google/protobuf/descriptor.proto", package: "google.protobuf", messageType: [{ name: "FileDescriptorSet", field: [{ name: "file", number: 1, type: 11, label: 3, typeName: ".google.protobuf.FileDescriptorProto" }], extensionRange: [{ start: 536e6, end: 536000001 }] }, { name: "FileDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "package", number: 2, type: 9, label: 1 }, { name: "dependency", number: 3, type: 9, label: 3 }, { name: "public_dependency", number: 10, type: 5, label: 3 }, { name: "weak_dependency", number: 11, type: 5, label: 3 }, { name: "option_dependency", number: 15, type: 9, label: 3 }, { name: "message_type", number: 4, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto" }, { name: "enum_type", number: 5, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto" }, { name: "service", number: 6, type: 11, label: 3, typeName: ".google.protobuf.ServiceDescriptorProto" }, { name: "extension", number: 7, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "options", number: 8, type: 11, label: 1, typeName: ".google.protobuf.FileOptions" }, { name: "source_code_info", number: 9, type: 11, label: 1, typeName: ".google.protobuf.SourceCodeInfo" }, { name: "syntax", number: 12, type: 9, label: 1 }, { name: "edition", number: 14, type: 14, label: 1, typeName: ".google.protobuf.Edition" }] }, { name: "DescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "field", number: 2, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "extension", number: 6, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "nested_type", number: 3, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto" }, { name: "enum_type", number: 4, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto" }, { name: "extension_range", number: 5, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto.ExtensionRange" }, { name: "oneof_decl", number: 8, type: 11, label: 3, typeName: ".google.protobuf.OneofDescriptorProto" }, { name: "options", number: 7, type: 11, label: 1, typeName: ".google.protobuf.MessageOptions" }, { name: "reserved_range", number: 9, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto.ReservedRange" }, { name: "reserved_name", number: 10, type: 9, label: 3 }, { name: "visibility", number: 11, type: 14, label: 1, typeName: ".google.protobuf.SymbolVisibility" }], nestedType: [{ name: "ExtensionRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.ExtensionRangeOptions" }] }, { name: "ReservedRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }] }] }, { name: "ExtensionRangeOptions", field: [{ name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }, { name: "declaration", number: 2, type: 11, label: 3, typeName: ".google.protobuf.ExtensionRangeOptions.Declaration", options: { retention: 2 } }, { name: "features", number: 50, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "verification", number: 3, type: 14, label: 1, typeName: ".google.protobuf.ExtensionRangeOptions.VerificationState", defaultValue: "UNVERIFIED", options: { retention: 2 } }], nestedType: [{ name: "Declaration", field: [{ name: "number", number: 1, type: 5, label: 1 }, { name: "full_name", number: 2, type: 9, label: 1 }, { name: "type", number: 3, type: 9, label: 1 }, { name: "reserved", number: 5, type: 8, label: 1 }, { name: "repeated", number: 6, type: 8, label: 1 }] }], enumType: [{ name: "VerificationState", value: [{ name: "DECLARATION", number: 0 }, { name: "UNVERIFIED", number: 1 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "FieldDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "number", number: 3, type: 5, label: 1 }, { name: "label", number: 4, type: 14, label: 1, typeName: ".google.protobuf.FieldDescriptorProto.Label" }, { name: "type", number: 5, type: 14, label: 1, typeName: ".google.protobuf.FieldDescriptorProto.Type" }, { name: "type_name", number: 6, type: 9, label: 1 }, { name: "extendee", number: 2, type: 9, label: 1 }, { name: "default_value", number: 7, type: 9, label: 1 }, { name: "oneof_index", number: 9, type: 5, label: 1 }, { name: "json_name", number: 10, type: 9, label: 1 }, { name: "options", number: 8, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions" }, { name: "proto3_optional", number: 17, type: 8, label: 1 }], enumType: [{ name: "Type", value: [{ name: "TYPE_DOUBLE", number: 1 }, { name: "TYPE_FLOAT", number: 2 }, { name: "TYPE_INT64", number: 3 }, { name: "TYPE_UINT64", number: 4 }, { name: "TYPE_INT32", number: 5 }, { name: "TYPE_FIXED64", number: 6 }, { name: "TYPE_FIXED32", number: 7 }, { name: "TYPE_BOOL", number: 8 }, { name: "TYPE_STRING", number: 9 }, { name: "TYPE_GROUP", number: 10 }, { name: "TYPE_MESSAGE", number: 11 }, { name: "TYPE_BYTES", number: 12 }, { name: "TYPE_UINT32", number: 13 }, { name: "TYPE_ENUM", number: 14 }, { name: "TYPE_SFIXED32", number: 15 }, { name: "TYPE_SFIXED64", number: 16 }, { name: "TYPE_SINT32", number: 17 }, { name: "TYPE_SINT64", number: 18 }] }, { name: "Label", value: [{ name: "LABEL_OPTIONAL", number: 1 }, { name: "LABEL_REPEATED", number: 3 }, { name: "LABEL_REQUIRED", number: 2 }] }] }, { name: "OneofDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "options", number: 2, type: 11, label: 1, typeName: ".google.protobuf.OneofOptions" }] }, { name: "EnumDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "value", number: 2, type: 11, label: 3, typeName: ".google.protobuf.EnumValueDescriptorProto" }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.EnumOptions" }, { name: "reserved_range", number: 4, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto.EnumReservedRange" }, { name: "reserved_name", number: 5, type: 9, label: 3 }, { name: "visibility", number: 6, type: 14, label: 1, typeName: ".google.protobuf.SymbolVisibility" }], nestedType: [{ name: "EnumReservedRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }] }] }, { name: "EnumValueDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "number", number: 2, type: 5, label: 1 }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.EnumValueOptions" }] }, { name: "ServiceDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "method", number: 2, type: 11, label: 3, typeName: ".google.protobuf.MethodDescriptorProto" }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.ServiceOptions" }] }, { name: "MethodDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "input_type", number: 2, type: 9, label: 1 }, { name: "output_type", number: 3, type: 9, label: 1 }, { name: "options", number: 4, type: 11, label: 1, typeName: ".google.protobuf.MethodOptions" }, { name: "client_streaming", number: 5, type: 8, label: 1, defaultValue: "false" }, { name: "server_streaming", number: 6, type: 8, label: 1, defaultValue: "false" }] }, { name: "FileOptions", field: [{ name: "java_package", number: 1, type: 9, label: 1 }, { name: "java_outer_classname", number: 8, type: 9, label: 1 }, { name: "java_multiple_files", number: 10, type: 8, label: 1, defaultValue: "false", options: {} }, { name: "java_generate_equals_and_hash", number: 20, type: 8, label: 1, options: { deprecated: !0 } }, { name: "java_string_check_utf8", number: 27, type: 8, label: 1, defaultValue: "false" }, { name: "optimize_for", number: 9, type: 14, label: 1, typeName: ".google.protobuf.FileOptions.OptimizeMode", defaultValue: "SPEED" }, { name: "go_package", number: 11, type: 9, label: 1 }, { name: "cc_generic_services", number: 16, type: 8, label: 1, defaultValue: "false" }, { name: "java_generic_services", number: 17, type: 8, label: 1, defaultValue: "false" }, { name: "py_generic_services", number: 18, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 23, type: 8, label: 1, defaultValue: "false" }, { name: "cc_enable_arenas", number: 31, type: 8, label: 1, defaultValue: "true" }, { name: "objc_class_prefix", number: 36, type: 9, label: 1 }, { name: "csharp_namespace", number: 37, type: 9, label: 1 }, { name: "swift_prefix", number: 39, type: 9, label: 1 }, { name: "php_class_prefix", number: 40, type: 9, label: 1 }, { name: "php_namespace", number: 41, type: 9, label: 1 }, { name: "php_metadata_namespace", number: 44, type: 9, label: 1 }, { name: "ruby_package", number: 45, type: 9, label: 1 }, { name: "features", number: 50, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], enumType: [{ name: "OptimizeMode", value: [{ name: "SPEED", number: 1 }, { name: "CODE_SIZE", number: 2 }, { name: "LITE_RUNTIME", number: 3 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "MessageOptions", field: [{ name: "message_set_wire_format", number: 1, type: 8, label: 1, defaultValue: "false" }, { name: "no_standard_descriptor_accessor", number: 2, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "map_entry", number: 7, type: 8, label: 1 }, { name: "deprecated_legacy_json_field_conflicts", number: 11, type: 8, label: 1, options: { deprecated: !0 } }, { name: "features", number: 12, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "FieldOptions", field: [{ name: "ctype", number: 1, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.CType", defaultValue: "STRING" }, { name: "packed", number: 2, type: 8, label: 1 }, { name: "jstype", number: 6, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.JSType", defaultValue: "JS_NORMAL" }, { name: "lazy", number: 5, type: 8, label: 1, defaultValue: "false" }, { name: "unverified_lazy", number: 15, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "weak", number: 10, type: 8, label: 1, defaultValue: "false", options: { deprecated: !0 } }, { name: "debug_redact", number: 16, type: 8, label: 1, defaultValue: "false" }, { name: "retention", number: 17, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.OptionRetention" }, { name: "targets", number: 19, type: 14, label: 3, typeName: ".google.protobuf.FieldOptions.OptionTargetType" }, { name: "edition_defaults", number: 20, type: 11, label: 3, typeName: ".google.protobuf.FieldOptions.EditionDefault" }, { name: "features", number: 21, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "feature_support", number: 22, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions.FeatureSupport" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], nestedType: [{ name: "EditionDefault", field: [{ name: "edition", number: 3, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "value", number: 2, type: 9, label: 1 }] }, { name: "FeatureSupport", field: [{ name: "edition_introduced", number: 1, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "edition_deprecated", number: 2, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "deprecation_warning", number: 3, type: 9, label: 1 }, { name: "edition_removed", number: 4, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "removal_error", number: 5, type: 9, label: 1 }] }], enumType: [{ name: "CType", value: [{ name: "STRING", number: 0 }, { name: "CORD", number: 1 }, { name: "STRING_PIECE", number: 2 }] }, { name: "JSType", value: [{ name: "JS_NORMAL", number: 0 }, { name: "JS_STRING", number: 1 }, { name: "JS_NUMBER", number: 2 }] }, { name: "OptionRetention", value: [{ name: "RETENTION_UNKNOWN", number: 0 }, { name: "RETENTION_RUNTIME", number: 1 }, { name: "RETENTION_SOURCE", number: 2 }] }, { name: "OptionTargetType", value: [{ name: "TARGET_TYPE_UNKNOWN", number: 0 }, { name: "TARGET_TYPE_FILE", number: 1 }, { name: "TARGET_TYPE_EXTENSION_RANGE", number: 2 }, { name: "TARGET_TYPE_MESSAGE", number: 3 }, { name: "TARGET_TYPE_FIELD", number: 4 }, { name: "TARGET_TYPE_ONEOF", number: 5 }, { name: "TARGET_TYPE_ENUM", number: 6 }, { name: "TARGET_TYPE_ENUM_ENTRY", number: 7 }, { name: "TARGET_TYPE_SERVICE", number: 8 }, { name: "TARGET_TYPE_METHOD", number: 9 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "OneofOptions", field: [{ name: "features", number: 1, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "EnumOptions", field: [{ name: "allow_alias", number: 2, type: 8, label: 1 }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated_legacy_json_field_conflicts", number: 6, type: 8, label: 1, options: { deprecated: !0 } }, { name: "features", number: 7, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "EnumValueOptions", field: [{ name: "deprecated", number: 1, type: 8, label: 1, defaultValue: "false" }, { name: "features", number: 2, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "debug_redact", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "feature_support", number: 4, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions.FeatureSupport" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "ServiceOptions", field: [{ name: "features", number: 34, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "deprecated", number: 33, type: 8, label: 1, defaultValue: "false" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "MethodOptions", field: [{ name: "deprecated", number: 33, type: 8, label: 1, defaultValue: "false" }, { name: "idempotency_level", number: 34, type: 14, label: 1, typeName: ".google.protobuf.MethodOptions.IdempotencyLevel", defaultValue: "IDEMPOTENCY_UNKNOWN" }, { name: "features", number: 35, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], enumType: [{ name: "IdempotencyLevel", value: [{ name: "IDEMPOTENCY_UNKNOWN", number: 0 }, { name: "NO_SIDE_EFFECTS", number: 1 }, { name: "IDEMPOTENT", number: 2 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "UninterpretedOption", field: [{ name: "name", number: 2, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption.NamePart" }, { name: "identifier_value", number: 3, type: 9, label: 1 }, { name: "positive_int_value", number: 4, type: 4, label: 1 }, { name: "negative_int_value", number: 5, type: 3, label: 1 }, { name: "double_value", number: 6, type: 1, label: 1 }, { name: "string_value", number: 7, type: 12, label: 1 }, { name: "aggregate_value", number: 8, type: 9, label: 1 }], nestedType: [{ name: "NamePart", field: [{ name: "name_part", number: 1, type: 9, label: 2 }, { name: "is_extension", number: 2, type: 8, label: 2 }] }] }, { name: "FeatureSet", field: [{ name: "field_presence", number: 1, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.FieldPresence", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "EXPLICIT", edition: 900 }, { value: "IMPLICIT", edition: 999 }, { value: "EXPLICIT", edition: 1e3 }] } }, { name: "enum_type", number: 2, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.EnumType", options: { retention: 1, targets: [6, 1], editionDefaults: [{ value: "CLOSED", edition: 900 }, { value: "OPEN", edition: 999 }] } }, { name: "repeated_field_encoding", number: 3, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.RepeatedFieldEncoding", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "EXPANDED", edition: 900 }, { value: "PACKED", edition: 999 }] } }, { name: "utf8_validation", number: 4, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.Utf8Validation", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "NONE", edition: 900 }, { value: "VERIFY", edition: 999 }] } }, { name: "message_encoding", number: 5, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.MessageEncoding", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "LENGTH_PREFIXED", edition: 900 }] } }, { name: "json_format", number: 6, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.JsonFormat", options: { retention: 1, targets: [3, 6, 1], editionDefaults: [{ value: "LEGACY_BEST_EFFORT", edition: 900 }, { value: "ALLOW", edition: 999 }] } }, { name: "enforce_naming_style", number: 7, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.EnforceNamingStyle", options: { retention: 2, targets: [1, 2, 3, 4, 5, 6, 7, 8, 9], editionDefaults: [{ value: "STYLE_LEGACY", edition: 900 }, { value: "STYLE2024", edition: 1001 }] } }, { name: "default_symbol_visibility", number: 8, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility", options: { retention: 2, targets: [1], editionDefaults: [{ value: "EXPORT_ALL", edition: 900 }, { value: "EXPORT_TOP_LEVEL", edition: 1001 }] } }], nestedType: [{ name: "VisibilityFeature", enumType: [{ name: "DefaultSymbolVisibility", value: [{ name: "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", number: 0 }, { name: "EXPORT_ALL", number: 1 }, { name: "EXPORT_TOP_LEVEL", number: 2 }, { name: "LOCAL_ALL", number: 3 }, { name: "STRICT", number: 4 }] }] }], enumType: [{ name: "FieldPresence", value: [{ name: "FIELD_PRESENCE_UNKNOWN", number: 0 }, { name: "EXPLICIT", number: 1 }, { name: "IMPLICIT", number: 2 }, { name: "LEGACY_REQUIRED", number: 3 }] }, { name: "EnumType", value: [{ name: "ENUM_TYPE_UNKNOWN", number: 0 }, { name: "OPEN", number: 1 }, { name: "CLOSED", number: 2 }] }, { name: "RepeatedFieldEncoding", value: [{ name: "REPEATED_FIELD_ENCODING_UNKNOWN", number: 0 }, { name: "PACKED", number: 1 }, { name: "EXPANDED", number: 2 }] }, { name: "Utf8Validation", value: [{ name: "UTF8_VALIDATION_UNKNOWN", number: 0 }, { name: "VERIFY", number: 2 }, { name: "NONE", number: 3 }] }, { name: "MessageEncoding", value: [{ name: "MESSAGE_ENCODING_UNKNOWN", number: 0 }, { name: "LENGTH_PREFIXED", number: 1 }, { name: "DELIMITED", number: 2 }] }, { name: "JsonFormat", value: [{ name: "JSON_FORMAT_UNKNOWN", number: 0 }, { name: "ALLOW", number: 1 }, { name: "LEGACY_BEST_EFFORT", number: 2 }] }, { name: "EnforceNamingStyle", value: [{ name: "ENFORCE_NAMING_STYLE_UNKNOWN", number: 0 }, { name: "STYLE2024", number: 1 }, { name: "STYLE_LEGACY", number: 2 }] }], extensionRange: [{ start: 1e3, end: 9995 }, { start: 9995, end: 1e4 }, { start: 1e4, end: 10001 }] }, { name: "FeatureSetDefaults", field: [{ name: "defaults", number: 1, type: 11, label: 3, typeName: ".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" }, { name: "minimum_edition", number: 4, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "maximum_edition", number: 5, type: 14, label: 1, typeName: ".google.protobuf.Edition" }], nestedType: [{ name: "FeatureSetEditionDefault", field: [{ name: "edition", number: 3, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "overridable_features", number: 4, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "fixed_features", number: 5, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }] }] }, { name: "SourceCodeInfo", field: [{ name: "location", number: 1, type: 11, label: 3, typeName: ".google.protobuf.SourceCodeInfo.Location" }], nestedType: [{ name: "Location", field: [{ name: "path", number: 1, type: 5, label: 3, options: { packed: !0 } }, { name: "span", number: 2, type: 5, label: 3, options: { packed: !0 } }, { name: "leading_comments", number: 3, type: 9, label: 1 }, { name: "trailing_comments", number: 4, type: 9, label: 1 }, { name: "leading_detached_comments", number: 6, type: 9, label: 3 }] }], extensionRange: [{ start: 536e6, end: 536000001 }] }, { name: "GeneratedCodeInfo", field: [{ name: "annotation", number: 1, type: 11, label: 3, typeName: ".google.protobuf.GeneratedCodeInfo.Annotation" }], nestedType: [{ name: "Annotation", field: [{ name: "path", number: 1, type: 5, label: 3, options: { packed: !0 } }, { name: "source_file", number: 2, type: 9, label: 1 }, { name: "begin", number: 3, type: 5, label: 1 }, { name: "end", number: 4, type: 5, label: 1 }, { name: "semantic", number: 5, type: 14, label: 1, typeName: ".google.protobuf.GeneratedCodeInfo.Annotation.Semantic" }], enumType: [{ name: "Semantic", value: [{ name: "NONE", number: 0 }, { name: "SET", number: 1 }, { name: "ALIAS", number: 2 }] }] }] }], enumType: [{ name: "Edition", value: [{ name: "EDITION_UNKNOWN", number: 0 }, { name: "EDITION_LEGACY", number: 900 }, { name: "EDITION_PROTO2", number: 998 }, { name: "EDITION_PROTO3", number: 999 }, { name: "EDITION_2023", number: 1e3 }, { name: "EDITION_2024", number: 1001 }, { name: "EDITION_UNSTABLE", number: 9999 }, { name: "EDITION_1_TEST_ONLY", number: 1 }, { name: "EDITION_2_TEST_ONLY", number: 2 }, { name: "EDITION_99997_TEST_ONLY", number: 99997 }, { name: "EDITION_99998_TEST_ONLY", number: 99998 }, { name: "EDITION_99999_TEST_ONLY", number: 99999 }, { name: "EDITION_MAX", number: 2147483647 }] }, { name: "SymbolVisibility", value: [{ name: "VISIBILITY_UNSET", number: 0 }, { name: "VISIBILITY_LOCAL", number: 1 }, { name: "VISIBILITY_EXPORT", number: 2 }] }] }), Rr = /* @__PURE__ */ R(Ar, 1);
2731
+ const _r = /* @__PURE__ */ Sr({ name: "google/protobuf/descriptor.proto", package: "google.protobuf", messageType: [{ name: "FileDescriptorSet", field: [{ name: "file", number: 1, type: 11, label: 3, typeName: ".google.protobuf.FileDescriptorProto" }], extensionRange: [{ start: 536e6, end: 536000001 }] }, { name: "FileDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "package", number: 2, type: 9, label: 1 }, { name: "dependency", number: 3, type: 9, label: 3 }, { name: "public_dependency", number: 10, type: 5, label: 3 }, { name: "weak_dependency", number: 11, type: 5, label: 3 }, { name: "option_dependency", number: 15, type: 9, label: 3 }, { name: "message_type", number: 4, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto" }, { name: "enum_type", number: 5, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto" }, { name: "service", number: 6, type: 11, label: 3, typeName: ".google.protobuf.ServiceDescriptorProto" }, { name: "extension", number: 7, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "options", number: 8, type: 11, label: 1, typeName: ".google.protobuf.FileOptions" }, { name: "source_code_info", number: 9, type: 11, label: 1, typeName: ".google.protobuf.SourceCodeInfo" }, { name: "syntax", number: 12, type: 9, label: 1 }, { name: "edition", number: 14, type: 14, label: 1, typeName: ".google.protobuf.Edition" }] }, { name: "DescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "field", number: 2, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "extension", number: 6, type: 11, label: 3, typeName: ".google.protobuf.FieldDescriptorProto" }, { name: "nested_type", number: 3, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto" }, { name: "enum_type", number: 4, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto" }, { name: "extension_range", number: 5, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto.ExtensionRange" }, { name: "oneof_decl", number: 8, type: 11, label: 3, typeName: ".google.protobuf.OneofDescriptorProto" }, { name: "options", number: 7, type: 11, label: 1, typeName: ".google.protobuf.MessageOptions" }, { name: "reserved_range", number: 9, type: 11, label: 3, typeName: ".google.protobuf.DescriptorProto.ReservedRange" }, { name: "reserved_name", number: 10, type: 9, label: 3 }, { name: "visibility", number: 11, type: 14, label: 1, typeName: ".google.protobuf.SymbolVisibility" }], nestedType: [{ name: "ExtensionRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.ExtensionRangeOptions" }] }, { name: "ReservedRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }] }] }, { name: "ExtensionRangeOptions", field: [{ name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }, { name: "declaration", number: 2, type: 11, label: 3, typeName: ".google.protobuf.ExtensionRangeOptions.Declaration", options: { retention: 2 } }, { name: "features", number: 50, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "verification", number: 3, type: 14, label: 1, typeName: ".google.protobuf.ExtensionRangeOptions.VerificationState", defaultValue: "UNVERIFIED", options: { retention: 2 } }], nestedType: [{ name: "Declaration", field: [{ name: "number", number: 1, type: 5, label: 1 }, { name: "full_name", number: 2, type: 9, label: 1 }, { name: "type", number: 3, type: 9, label: 1 }, { name: "reserved", number: 5, type: 8, label: 1 }, { name: "repeated", number: 6, type: 8, label: 1 }] }], enumType: [{ name: "VerificationState", value: [{ name: "DECLARATION", number: 0 }, { name: "UNVERIFIED", number: 1 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "FieldDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "number", number: 3, type: 5, label: 1 }, { name: "label", number: 4, type: 14, label: 1, typeName: ".google.protobuf.FieldDescriptorProto.Label" }, { name: "type", number: 5, type: 14, label: 1, typeName: ".google.protobuf.FieldDescriptorProto.Type" }, { name: "type_name", number: 6, type: 9, label: 1 }, { name: "extendee", number: 2, type: 9, label: 1 }, { name: "default_value", number: 7, type: 9, label: 1 }, { name: "oneof_index", number: 9, type: 5, label: 1 }, { name: "json_name", number: 10, type: 9, label: 1 }, { name: "options", number: 8, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions" }, { name: "proto3_optional", number: 17, type: 8, label: 1 }], enumType: [{ name: "Type", value: [{ name: "TYPE_DOUBLE", number: 1 }, { name: "TYPE_FLOAT", number: 2 }, { name: "TYPE_INT64", number: 3 }, { name: "TYPE_UINT64", number: 4 }, { name: "TYPE_INT32", number: 5 }, { name: "TYPE_FIXED64", number: 6 }, { name: "TYPE_FIXED32", number: 7 }, { name: "TYPE_BOOL", number: 8 }, { name: "TYPE_STRING", number: 9 }, { name: "TYPE_GROUP", number: 10 }, { name: "TYPE_MESSAGE", number: 11 }, { name: "TYPE_BYTES", number: 12 }, { name: "TYPE_UINT32", number: 13 }, { name: "TYPE_ENUM", number: 14 }, { name: "TYPE_SFIXED32", number: 15 }, { name: "TYPE_SFIXED64", number: 16 }, { name: "TYPE_SINT32", number: 17 }, { name: "TYPE_SINT64", number: 18 }] }, { name: "Label", value: [{ name: "LABEL_OPTIONAL", number: 1 }, { name: "LABEL_REPEATED", number: 3 }, { name: "LABEL_REQUIRED", number: 2 }] }] }, { name: "OneofDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "options", number: 2, type: 11, label: 1, typeName: ".google.protobuf.OneofOptions" }] }, { name: "EnumDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "value", number: 2, type: 11, label: 3, typeName: ".google.protobuf.EnumValueDescriptorProto" }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.EnumOptions" }, { name: "reserved_range", number: 4, type: 11, label: 3, typeName: ".google.protobuf.EnumDescriptorProto.EnumReservedRange" }, { name: "reserved_name", number: 5, type: 9, label: 3 }, { name: "visibility", number: 6, type: 14, label: 1, typeName: ".google.protobuf.SymbolVisibility" }], nestedType: [{ name: "EnumReservedRange", field: [{ name: "start", number: 1, type: 5, label: 1 }, { name: "end", number: 2, type: 5, label: 1 }] }] }, { name: "EnumValueDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "number", number: 2, type: 5, label: 1 }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.EnumValueOptions" }] }, { name: "ServiceDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "method", number: 2, type: 11, label: 3, typeName: ".google.protobuf.MethodDescriptorProto" }, { name: "options", number: 3, type: 11, label: 1, typeName: ".google.protobuf.ServiceOptions" }] }, { name: "MethodDescriptorProto", field: [{ name: "name", number: 1, type: 9, label: 1 }, { name: "input_type", number: 2, type: 9, label: 1 }, { name: "output_type", number: 3, type: 9, label: 1 }, { name: "options", number: 4, type: 11, label: 1, typeName: ".google.protobuf.MethodOptions" }, { name: "client_streaming", number: 5, type: 8, label: 1, defaultValue: "false" }, { name: "server_streaming", number: 6, type: 8, label: 1, defaultValue: "false" }] }, { name: "FileOptions", field: [{ name: "java_package", number: 1, type: 9, label: 1 }, { name: "java_outer_classname", number: 8, type: 9, label: 1 }, { name: "java_multiple_files", number: 10, type: 8, label: 1, defaultValue: "false", options: {} }, { name: "java_generate_equals_and_hash", number: 20, type: 8, label: 1, options: { deprecated: !0 } }, { name: "java_string_check_utf8", number: 27, type: 8, label: 1, defaultValue: "false" }, { name: "optimize_for", number: 9, type: 14, label: 1, typeName: ".google.protobuf.FileOptions.OptimizeMode", defaultValue: "SPEED" }, { name: "go_package", number: 11, type: 9, label: 1 }, { name: "cc_generic_services", number: 16, type: 8, label: 1, defaultValue: "false" }, { name: "java_generic_services", number: 17, type: 8, label: 1, defaultValue: "false" }, { name: "py_generic_services", number: 18, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 23, type: 8, label: 1, defaultValue: "false" }, { name: "cc_enable_arenas", number: 31, type: 8, label: 1, defaultValue: "true" }, { name: "objc_class_prefix", number: 36, type: 9, label: 1 }, { name: "csharp_namespace", number: 37, type: 9, label: 1 }, { name: "swift_prefix", number: 39, type: 9, label: 1 }, { name: "php_class_prefix", number: 40, type: 9, label: 1 }, { name: "php_namespace", number: 41, type: 9, label: 1 }, { name: "php_metadata_namespace", number: 44, type: 9, label: 1 }, { name: "ruby_package", number: 45, type: 9, label: 1 }, { name: "features", number: 50, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], enumType: [{ name: "OptimizeMode", value: [{ name: "SPEED", number: 1 }, { name: "CODE_SIZE", number: 2 }, { name: "LITE_RUNTIME", number: 3 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "MessageOptions", field: [{ name: "message_set_wire_format", number: 1, type: 8, label: 1, defaultValue: "false" }, { name: "no_standard_descriptor_accessor", number: 2, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "map_entry", number: 7, type: 8, label: 1 }, { name: "deprecated_legacy_json_field_conflicts", number: 11, type: 8, label: 1, options: { deprecated: !0 } }, { name: "features", number: 12, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "FieldOptions", field: [{ name: "ctype", number: 1, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.CType", defaultValue: "STRING" }, { name: "packed", number: 2, type: 8, label: 1 }, { name: "jstype", number: 6, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.JSType", defaultValue: "JS_NORMAL" }, { name: "lazy", number: 5, type: 8, label: 1, defaultValue: "false" }, { name: "unverified_lazy", number: 15, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "weak", number: 10, type: 8, label: 1, defaultValue: "false", options: { deprecated: !0 } }, { name: "debug_redact", number: 16, type: 8, label: 1, defaultValue: "false" }, { name: "retention", number: 17, type: 14, label: 1, typeName: ".google.protobuf.FieldOptions.OptionRetention" }, { name: "targets", number: 19, type: 14, label: 3, typeName: ".google.protobuf.FieldOptions.OptionTargetType" }, { name: "edition_defaults", number: 20, type: 11, label: 3, typeName: ".google.protobuf.FieldOptions.EditionDefault" }, { name: "features", number: 21, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "feature_support", number: 22, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions.FeatureSupport" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], nestedType: [{ name: "EditionDefault", field: [{ name: "edition", number: 3, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "value", number: 2, type: 9, label: 1 }] }, { name: "FeatureSupport", field: [{ name: "edition_introduced", number: 1, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "edition_deprecated", number: 2, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "deprecation_warning", number: 3, type: 9, label: 1 }, { name: "edition_removed", number: 4, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "removal_error", number: 5, type: 9, label: 1 }] }], enumType: [{ name: "CType", value: [{ name: "STRING", number: 0 }, { name: "CORD", number: 1 }, { name: "STRING_PIECE", number: 2 }] }, { name: "JSType", value: [{ name: "JS_NORMAL", number: 0 }, { name: "JS_STRING", number: 1 }, { name: "JS_NUMBER", number: 2 }] }, { name: "OptionRetention", value: [{ name: "RETENTION_UNKNOWN", number: 0 }, { name: "RETENTION_RUNTIME", number: 1 }, { name: "RETENTION_SOURCE", number: 2 }] }, { name: "OptionTargetType", value: [{ name: "TARGET_TYPE_UNKNOWN", number: 0 }, { name: "TARGET_TYPE_FILE", number: 1 }, { name: "TARGET_TYPE_EXTENSION_RANGE", number: 2 }, { name: "TARGET_TYPE_MESSAGE", number: 3 }, { name: "TARGET_TYPE_FIELD", number: 4 }, { name: "TARGET_TYPE_ONEOF", number: 5 }, { name: "TARGET_TYPE_ENUM", number: 6 }, { name: "TARGET_TYPE_ENUM_ENTRY", number: 7 }, { name: "TARGET_TYPE_SERVICE", number: 8 }, { name: "TARGET_TYPE_METHOD", number: 9 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "OneofOptions", field: [{ name: "features", number: 1, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "EnumOptions", field: [{ name: "allow_alias", number: 2, type: 8, label: 1 }, { name: "deprecated", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "deprecated_legacy_json_field_conflicts", number: 6, type: 8, label: 1, options: { deprecated: !0 } }, { name: "features", number: 7, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "EnumValueOptions", field: [{ name: "deprecated", number: 1, type: 8, label: 1, defaultValue: "false" }, { name: "features", number: 2, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "debug_redact", number: 3, type: 8, label: 1, defaultValue: "false" }, { name: "feature_support", number: 4, type: 11, label: 1, typeName: ".google.protobuf.FieldOptions.FeatureSupport" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "ServiceOptions", field: [{ name: "features", number: 34, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "deprecated", number: 33, type: 8, label: 1, defaultValue: "false" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "MethodOptions", field: [{ name: "deprecated", number: 33, type: 8, label: 1, defaultValue: "false" }, { name: "idempotency_level", number: 34, type: 14, label: 1, typeName: ".google.protobuf.MethodOptions.IdempotencyLevel", defaultValue: "IDEMPOTENCY_UNKNOWN" }, { name: "features", number: 35, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "uninterpreted_option", number: 999, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption" }], enumType: [{ name: "IdempotencyLevel", value: [{ name: "IDEMPOTENCY_UNKNOWN", number: 0 }, { name: "NO_SIDE_EFFECTS", number: 1 }, { name: "IDEMPOTENT", number: 2 }] }], extensionRange: [{ start: 1e3, end: 536870912 }] }, { name: "UninterpretedOption", field: [{ name: "name", number: 2, type: 11, label: 3, typeName: ".google.protobuf.UninterpretedOption.NamePart" }, { name: "identifier_value", number: 3, type: 9, label: 1 }, { name: "positive_int_value", number: 4, type: 4, label: 1 }, { name: "negative_int_value", number: 5, type: 3, label: 1 }, { name: "double_value", number: 6, type: 1, label: 1 }, { name: "string_value", number: 7, type: 12, label: 1 }, { name: "aggregate_value", number: 8, type: 9, label: 1 }], nestedType: [{ name: "NamePart", field: [{ name: "name_part", number: 1, type: 9, label: 2 }, { name: "is_extension", number: 2, type: 8, label: 2 }] }] }, { name: "FeatureSet", field: [{ name: "field_presence", number: 1, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.FieldPresence", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "EXPLICIT", edition: 900 }, { value: "IMPLICIT", edition: 999 }, { value: "EXPLICIT", edition: 1e3 }] } }, { name: "enum_type", number: 2, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.EnumType", options: { retention: 1, targets: [6, 1], editionDefaults: [{ value: "CLOSED", edition: 900 }, { value: "OPEN", edition: 999 }] } }, { name: "repeated_field_encoding", number: 3, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.RepeatedFieldEncoding", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "EXPANDED", edition: 900 }, { value: "PACKED", edition: 999 }] } }, { name: "utf8_validation", number: 4, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.Utf8Validation", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "NONE", edition: 900 }, { value: "VERIFY", edition: 999 }] } }, { name: "message_encoding", number: 5, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.MessageEncoding", options: { retention: 1, targets: [4, 1], editionDefaults: [{ value: "LENGTH_PREFIXED", edition: 900 }] } }, { name: "json_format", number: 6, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.JsonFormat", options: { retention: 1, targets: [3, 6, 1], editionDefaults: [{ value: "LEGACY_BEST_EFFORT", edition: 900 }, { value: "ALLOW", edition: 999 }] } }, { name: "enforce_naming_style", number: 7, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.EnforceNamingStyle", options: { retention: 2, targets: [1, 2, 3, 4, 5, 6, 7, 8, 9], editionDefaults: [{ value: "STYLE_LEGACY", edition: 900 }, { value: "STYLE2024", edition: 1001 }] } }, { name: "default_symbol_visibility", number: 8, type: 14, label: 1, typeName: ".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility", options: { retention: 2, targets: [1], editionDefaults: [{ value: "EXPORT_ALL", edition: 900 }, { value: "EXPORT_TOP_LEVEL", edition: 1001 }] } }], nestedType: [{ name: "VisibilityFeature", enumType: [{ name: "DefaultSymbolVisibility", value: [{ name: "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", number: 0 }, { name: "EXPORT_ALL", number: 1 }, { name: "EXPORT_TOP_LEVEL", number: 2 }, { name: "LOCAL_ALL", number: 3 }, { name: "STRICT", number: 4 }] }] }], enumType: [{ name: "FieldPresence", value: [{ name: "FIELD_PRESENCE_UNKNOWN", number: 0 }, { name: "EXPLICIT", number: 1 }, { name: "IMPLICIT", number: 2 }, { name: "LEGACY_REQUIRED", number: 3 }] }, { name: "EnumType", value: [{ name: "ENUM_TYPE_UNKNOWN", number: 0 }, { name: "OPEN", number: 1 }, { name: "CLOSED", number: 2 }] }, { name: "RepeatedFieldEncoding", value: [{ name: "REPEATED_FIELD_ENCODING_UNKNOWN", number: 0 }, { name: "PACKED", number: 1 }, { name: "EXPANDED", number: 2 }] }, { name: "Utf8Validation", value: [{ name: "UTF8_VALIDATION_UNKNOWN", number: 0 }, { name: "VERIFY", number: 2 }, { name: "NONE", number: 3 }] }, { name: "MessageEncoding", value: [{ name: "MESSAGE_ENCODING_UNKNOWN", number: 0 }, { name: "LENGTH_PREFIXED", number: 1 }, { name: "DELIMITED", number: 2 }] }, { name: "JsonFormat", value: [{ name: "JSON_FORMAT_UNKNOWN", number: 0 }, { name: "ALLOW", number: 1 }, { name: "LEGACY_BEST_EFFORT", number: 2 }] }, { name: "EnforceNamingStyle", value: [{ name: "ENFORCE_NAMING_STYLE_UNKNOWN", number: 0 }, { name: "STYLE2024", number: 1 }, { name: "STYLE_LEGACY", number: 2 }] }], extensionRange: [{ start: 1e3, end: 9995 }, { start: 9995, end: 1e4 }, { start: 1e4, end: 10001 }] }, { name: "FeatureSetDefaults", field: [{ name: "defaults", number: 1, type: 11, label: 3, typeName: ".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" }, { name: "minimum_edition", number: 4, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "maximum_edition", number: 5, type: 14, label: 1, typeName: ".google.protobuf.Edition" }], nestedType: [{ name: "FeatureSetEditionDefault", field: [{ name: "edition", number: 3, type: 14, label: 1, typeName: ".google.protobuf.Edition" }, { name: "overridable_features", number: 4, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }, { name: "fixed_features", number: 5, type: 11, label: 1, typeName: ".google.protobuf.FeatureSet" }] }] }, { name: "SourceCodeInfo", field: [{ name: "location", number: 1, type: 11, label: 3, typeName: ".google.protobuf.SourceCodeInfo.Location" }], nestedType: [{ name: "Location", field: [{ name: "path", number: 1, type: 5, label: 3, options: { packed: !0 } }, { name: "span", number: 2, type: 5, label: 3, options: { packed: !0 } }, { name: "leading_comments", number: 3, type: 9, label: 1 }, { name: "trailing_comments", number: 4, type: 9, label: 1 }, { name: "leading_detached_comments", number: 6, type: 9, label: 3 }] }], extensionRange: [{ start: 536e6, end: 536000001 }] }, { name: "GeneratedCodeInfo", field: [{ name: "annotation", number: 1, type: 11, label: 3, typeName: ".google.protobuf.GeneratedCodeInfo.Annotation" }], nestedType: [{ name: "Annotation", field: [{ name: "path", number: 1, type: 5, label: 3, options: { packed: !0 } }, { name: "source_file", number: 2, type: 9, label: 1 }, { name: "begin", number: 3, type: 5, label: 1 }, { name: "end", number: 4, type: 5, label: 1 }, { name: "semantic", number: 5, type: 14, label: 1, typeName: ".google.protobuf.GeneratedCodeInfo.Annotation.Semantic" }], enumType: [{ name: "Semantic", value: [{ name: "NONE", number: 0 }, { name: "SET", number: 1 }, { name: "ALIAS", number: 2 }] }] }] }], enumType: [{ name: "Edition", value: [{ name: "EDITION_UNKNOWN", number: 0 }, { name: "EDITION_LEGACY", number: 900 }, { name: "EDITION_PROTO2", number: 998 }, { name: "EDITION_PROTO3", number: 999 }, { name: "EDITION_2023", number: 1e3 }, { name: "EDITION_2024", number: 1001 }, { name: "EDITION_UNSTABLE", number: 9999 }, { name: "EDITION_1_TEST_ONLY", number: 1 }, { name: "EDITION_2_TEST_ONLY", number: 2 }, { name: "EDITION_99997_TEST_ONLY", number: 99997 }, { name: "EDITION_99998_TEST_ONLY", number: 99998 }, { name: "EDITION_99999_TEST_ONLY", number: 99999 }, { name: "EDITION_MAX", number: 2147483647 }] }, { name: "SymbolVisibility", value: [{ name: "VISIBILITY_UNSET", number: 0 }, { name: "VISIBILITY_LOCAL", number: 1 }, { name: "VISIBILITY_EXPORT", number: 2 }] }] }), vr = /* @__PURE__ */ R(_r, 1);
2732
2732
  var At;
2733
2733
  (function(e) {
2734
2734
  e[e.DECLARATION = 0] = "DECLARATION", e[e.UNVERIFIED = 1] = "UNVERIFIED";
@@ -2773,18 +2773,18 @@ var xt;
2773
2773
  (function(e) {
2774
2774
  e[e.FIELD_PRESENCE_UNKNOWN = 0] = "FIELD_PRESENCE_UNKNOWN", e[e.EXPLICIT = 1] = "EXPLICIT", e[e.IMPLICIT = 2] = "IMPLICIT", e[e.LEGACY_REQUIRED = 3] = "LEGACY_REQUIRED";
2775
2775
  })(xt || (xt = {}));
2776
- var Pt;
2776
+ var Ft;
2777
2777
  (function(e) {
2778
2778
  e[e.ENUM_TYPE_UNKNOWN = 0] = "ENUM_TYPE_UNKNOWN", e[e.OPEN = 1] = "OPEN", e[e.CLOSED = 2] = "CLOSED";
2779
- })(Pt || (Pt = {}));
2780
- var Vt;
2779
+ })(Ft || (Ft = {}));
2780
+ var Pt;
2781
2781
  (function(e) {
2782
2782
  e[e.REPEATED_FIELD_ENCODING_UNKNOWN = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN", e[e.PACKED = 1] = "PACKED", e[e.EXPANDED = 2] = "EXPANDED";
2783
- })(Vt || (Vt = {}));
2784
- var Ft;
2783
+ })(Pt || (Pt = {}));
2784
+ var Vt;
2785
2785
  (function(e) {
2786
2786
  e[e.UTF8_VALIDATION_UNKNOWN = 0] = "UTF8_VALIDATION_UNKNOWN", e[e.VERIFY = 2] = "VERIFY", e[e.NONE = 3] = "NONE";
2787
- })(Ft || (Ft = {}));
2787
+ })(Vt || (Vt = {}));
2788
2788
  var Gt;
2789
2789
  (function(e) {
2790
2790
  e[e.MESSAGE_ENCODING_UNKNOWN = 0] = "MESSAGE_ENCODING_UNKNOWN", e[e.LENGTH_PREFIXED = 1] = "LENGTH_PREFIXED", e[e.DELIMITED = 2] = "DELIMITED";
@@ -2809,14 +2809,14 @@ var Kt;
2809
2809
  (function(e) {
2810
2810
  e[e.VISIBILITY_UNSET = 0] = "VISIBILITY_UNSET", e[e.VISIBILITY_LOCAL = 1] = "VISIBILITY_LOCAL", e[e.VISIBILITY_EXPORT = 2] = "VISIBILITY_EXPORT";
2811
2811
  })(Kt || (Kt = {}));
2812
- function _r(e) {
2812
+ function Or(e) {
2813
2813
  return Object.assign(Object.assign({ readUnknownFields: !0, recursionLimit: 100 }, e), { depth: 0 });
2814
2814
  }
2815
2815
  function fe(e, t, n) {
2816
2816
  const s = ge(e, void 0, !1);
2817
- return Bn(s, new Us(t), _r(n), !1, t.byteLength), s.message;
2817
+ return Yn(s, new Ms(t), Or(n), !1, t.byteLength), s.message;
2818
2818
  }
2819
- function Bn(e, t, n, s, r) {
2819
+ function Yn(e, t, n, s, r) {
2820
2820
  var i;
2821
2821
  if (++n.depth > n.recursionLimit)
2822
2822
  throw new Error(`cannot decode ${e.desc} from binary: maximum recursion depth of ${n.recursionLimit} reached`);
@@ -2830,20 +2830,20 @@ function Bn(e, t, n, s, r) {
2830
2830
  n.readUnknownFields && u.push({ no: o, wireType: l, data: p });
2831
2831
  continue;
2832
2832
  }
2833
- vr(e, t, d, l, n);
2833
+ Cr(e, t, d, l, n);
2834
2834
  }
2835
2835
  if (s && (l != I.EndGroup || o !== r))
2836
2836
  throw new Error("invalid end group tag");
2837
2837
  u.length > 0 && e.setUnknown(u), n.depth--;
2838
2838
  }
2839
- function vr(e, t, n, s, r) {
2839
+ function Cr(e, t, n, s, r) {
2840
2840
  var i;
2841
2841
  switch (n.fieldKind) {
2842
2842
  case "scalar":
2843
- e.set(n, $(t, n.scalar, n.utf8Validation));
2843
+ e.set(n, X(t, n.scalar, n.utf8Validation));
2844
2844
  break;
2845
2845
  case "enum":
2846
- const a = $(t, c.INT32);
2846
+ const a = X(t, c.INT32);
2847
2847
  if (n.enum.open)
2848
2848
  e.set(n, a);
2849
2849
  else if (n.enum.values.some((l) => l.number === a))
@@ -2863,14 +2863,14 @@ function vr(e, t, n, s, r) {
2863
2863
  e.set(n, et(t, r, n, e.get(n)));
2864
2864
  break;
2865
2865
  case "list":
2866
- Cr(t, s, e.get(n), r);
2866
+ Ur(t, s, e.get(n), r);
2867
2867
  break;
2868
2868
  case "map":
2869
- Or(t, e.get(n), r);
2869
+ Dr(t, e.get(n), r);
2870
2870
  break;
2871
2871
  }
2872
2872
  }
2873
- function Or(e, t, n) {
2873
+ function Dr(e, t, n) {
2874
2874
  const s = t.field();
2875
2875
  let r, i;
2876
2876
  const a = e.uint32(), o = e.pos + a;
@@ -2878,12 +2878,12 @@ function Or(e, t, n) {
2878
2878
  const [l] = e.tag();
2879
2879
  switch (l) {
2880
2880
  case 1:
2881
- r = $(e, s.mapKey, s.utf8Validation);
2881
+ r = X(e, s.mapKey, s.utf8Validation);
2882
2882
  break;
2883
2883
  case 2:
2884
2884
  switch (s.mapKind) {
2885
2885
  case "scalar":
2886
- i = $(e, s.scalar, s.utf8Validation);
2886
+ i = X(e, s.scalar, s.utf8Validation);
2887
2887
  break;
2888
2888
  case "enum":
2889
2889
  i = e.int32();
@@ -2909,7 +2909,7 @@ function Or(e, t, n) {
2909
2909
  }
2910
2910
  t.set(r, i);
2911
2911
  }
2912
- function Cr(e, t, n, s) {
2912
+ function Ur(e, t, n, s) {
2913
2913
  var r;
2914
2914
  const i = n.field();
2915
2915
  if (i.listKind === "message") {
@@ -2918,18 +2918,18 @@ function Cr(e, t, n, s) {
2918
2918
  }
2919
2919
  const a = (r = i.scalar) !== null && r !== void 0 ? r : c.INT32;
2920
2920
  if (!(t == I.LengthDelimited && a != c.STRING && a != c.BYTES)) {
2921
- n.add($(e, a, i.utf8Validation));
2921
+ n.add(X(e, a, i.utf8Validation));
2922
2922
  return;
2923
2923
  }
2924
2924
  const l = e.uint32() + e.pos;
2925
2925
  for (; e.pos < l; )
2926
- n.add($(e, a, i.utf8Validation));
2926
+ n.add(X(e, a, i.utf8Validation));
2927
2927
  }
2928
2928
  function et(e, t, n, s) {
2929
2929
  const r = n.delimitedEncoding, i = s ?? ge(n.message, void 0, !1);
2930
- return Bn(i, e, t, r, r ? n.number : e.uint32()), i;
2930
+ return Yn(i, e, t, r, r ? n.number : e.uint32()), i;
2931
2931
  }
2932
- function $(e, t, n = !1) {
2932
+ function X(e, t, n = !1) {
2933
2933
  switch (t) {
2934
2934
  case c.STRING:
2935
2935
  return e.string(n);
@@ -2963,37 +2963,37 @@ function $(e, t, n = !1) {
2963
2963
  return e.sint32();
2964
2964
  }
2965
2965
  }
2966
- function Dr(e, t) {
2966
+ function Lr(e, t) {
2967
2967
  var n;
2968
- const s = fe(Rr, Ys(e));
2969
- return s.messageType.forEach(Qe), s.dependency = (n = void 0) !== null && n !== void 0 ? n : [], Mn(s, (i) => {
2968
+ const s = fe(vr, Xs(e));
2969
+ return s.messageType.forEach(Qe), s.dependency = (n = void 0) !== null && n !== void 0 ? n : [], xn(s, (i) => {
2970
2970
  }).getFile(s.name);
2971
2971
  }
2972
- const Ur = 3, Wt = {
2972
+ const Mr = 3, Wt = {
2973
2973
  writeUnknownFields: !0
2974
2974
  };
2975
- function Lr(e) {
2975
+ function xr(e) {
2976
2976
  return e ? Object.assign(Object.assign({}, Wt), e) : Wt;
2977
2977
  }
2978
2978
  function te(e, t, n) {
2979
- return me(new Ds(), Lr(n), ge(e, t)).finish();
2979
+ return me(new Ls(), xr(n), ge(e, t)).finish();
2980
2980
  }
2981
2981
  function me(e, t, n) {
2982
2982
  var s;
2983
2983
  for (const r of n.sortedFields) {
2984
2984
  if (!n.isSet(r)) {
2985
- if (r.presence == Ur)
2985
+ if (r.presence == Mr)
2986
2986
  throw new Error(`cannot encode ${r} to binary: required field not set`);
2987
2987
  continue;
2988
2988
  }
2989
- Mr(e, t, n, r);
2989
+ Fr(e, t, n, r);
2990
2990
  }
2991
2991
  if (t.writeUnknownFields)
2992
2992
  for (const { no: r, wireType: i, data: a } of (s = n.getUnknown()) !== null && s !== void 0 ? s : [])
2993
2993
  e.tag(r, i).raw(a);
2994
2994
  return e;
2995
2995
  }
2996
- function Mr(e, t, n, s) {
2996
+ function Fr(e, t, n, s) {
2997
2997
  var r;
2998
2998
  switch (s.fieldKind) {
2999
2999
  case "scalar":
@@ -3001,28 +3001,28 @@ function Mr(e, t, n, s) {
3001
3001
  pe(e, n.desc.typeName, s.name, (r = s.scalar) !== null && r !== void 0 ? r : c.INT32, s.number, n.get(s));
3002
3002
  break;
3003
3003
  case "list":
3004
- xr(e, t, s, n.get(s));
3004
+ Pr(e, t, s, n.get(s));
3005
3005
  break;
3006
3006
  case "message":
3007
- Yn(e, t, s, n.get(s));
3007
+ $n(e, t, s, n.get(s));
3008
3008
  break;
3009
3009
  case "map":
3010
3010
  for (const [i, a] of n.get(s))
3011
- Pr(e, t, s, i, a);
3011
+ Vr(e, t, s, i, a);
3012
3012
  break;
3013
3013
  }
3014
3014
  }
3015
3015
  function pe(e, t, n, s, r, i) {
3016
- $n(e.tag(r, Vr(s)), t, n, s, i);
3016
+ Xn(e.tag(r, Gr(s)), t, n, s, i);
3017
3017
  }
3018
- function Yn(e, t, n, s) {
3018
+ function $n(e, t, n, s) {
3019
3019
  n.delimitedEncoding ? me(e.tag(n.number, I.StartGroup), t, s).tag(n.number, I.EndGroup) : me(e.tag(n.number, I.LengthDelimited).fork(), t, s).join();
3020
3020
  }
3021
- function xr(e, t, n, s) {
3021
+ function Pr(e, t, n, s) {
3022
3022
  var r;
3023
3023
  if (n.listKind == "message") {
3024
3024
  for (const a of s)
3025
- Yn(e, t, n, a);
3025
+ $n(e, t, n, a);
3026
3026
  return;
3027
3027
  }
3028
3028
  const i = (r = n.scalar) !== null && r !== void 0 ? r : c.INT32;
@@ -3031,14 +3031,14 @@ function xr(e, t, n, s) {
3031
3031
  return;
3032
3032
  e.tag(n.number, I.LengthDelimited).fork();
3033
3033
  for (const a of s)
3034
- $n(e, n.parent.typeName, n.name, i, a);
3034
+ Xn(e, n.parent.typeName, n.name, i, a);
3035
3035
  e.join();
3036
3036
  return;
3037
3037
  }
3038
3038
  for (const a of s)
3039
3039
  pe(e, n.parent.typeName, n.name, i, n.number, a);
3040
3040
  }
3041
- function Pr(e, t, n, s, r) {
3041
+ function Vr(e, t, n, s, r) {
3042
3042
  var i;
3043
3043
  switch (e.tag(n.number, I.LengthDelimited).fork(), pe(e, n.parent.typeName, n.name, n.mapKey, 1, s), n.mapKind) {
3044
3044
  case "scalar":
@@ -3051,7 +3051,7 @@ function Pr(e, t, n, s, r) {
3051
3051
  }
3052
3052
  e.join();
3053
3053
  }
3054
- function $n(e, t, n, s, r) {
3054
+ function Xn(e, t, n, s, r) {
3055
3055
  try {
3056
3056
  switch (s) {
3057
3057
  case c.STRING:
@@ -3104,7 +3104,7 @@ function $n(e, t, n, s, r) {
3104
3104
  throw i instanceof Error ? new Error(`cannot encode field ${t}.${n} to binary: ${i.message}`) : i;
3105
3105
  }
3106
3106
  }
3107
- function Vr(e) {
3107
+ function Gr(e) {
3108
3108
  switch (e) {
3109
3109
  case c.BYTES:
3110
3110
  case c.STRING:
@@ -3121,12 +3121,12 @@ function Vr(e) {
3121
3121
  return I.Varint;
3122
3122
  }
3123
3123
  }
3124
- function Fr(e, t, ...n) {
3124
+ function Br(e, t, ...n) {
3125
3125
  if (n.length > 0)
3126
3126
  throw new Error();
3127
3127
  return e.services[t];
3128
3128
  }
3129
- const _ = /* @__PURE__ */ Dr("CgpjaGF0LnByb3RvEgdjaGF0LnYxIkkKCkF0dGFjaG1lbnQSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRIUCgxjb250ZW50X3R5cGUYAyABKAkSCwoDdXJsGAQgASgJIkEKBkJ1dHRvbhINCgVsYWJlbBgBIAEoCRINCgV2YWx1ZRgCIAEoCRIZCgtidXR0b25fdHlwZRgDIAEoCVIEdHlwZSJ/CgRDYXJkEg0KBXRpdGxlGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEicKBWltYWdlGAMgASgLMhMuY2hhdC52MS5BdHRhY2htZW50SACIAQESIAoHYnV0dG9ucxgEIAMoCzIPLmNoYXQudjEuQnV0dG9uQggKBl9pbWFnZSIjCg9NZXNzYWdlTWV0YWRhdGESEAoIYXVkaWVuY2UYASABKAkiIgoOVHlwaW5nTWV0YWRhdGESEAoIYXVkaWVuY2UYASABKAki7QIKB01lc3NhZ2USCgoCaWQYASABKAkSDAoEcm9sZRgCIAEoCRIRCgR0ZXh0GAMgASgJSACIAQESEQoEaHRtbBgEIAEoCUgBiAEBEigKC2F0dGFjaG1lbnRzGAUgAygLMhMuY2hhdC52MS5BdHRhY2htZW50EiAKB2J1dHRvbnMYBiADKAsyDy5jaGF0LnYxLkJ1dHRvbhIeCgdnYWxsZXJ5GAcgAygLMg0uY2hhdC52MS5DYXJkEhEKCXRpbWVzdGFtcBgIIAEoCRIYCgd1c2VyX2lkGAkgASgJUgd1c2VyX2lkEhwKCXVzZXJfbmFtZRgKIAEoCVIJdXNlcl9uYW1lEg0KBXN0YXRlGAsgASgJEhMKBmFjdGlvbhgMIAEoCUgCiAEBEioKCG1ldGFkYXRhGA0gASgLMhguY2hhdC52MS5NZXNzYWdlTWV0YWRhdGFCBwoFX3RleHRCBwoFX2h0bWxCCQoHX2FjdGlvbiKRAQoLVHlwaW5nRXZlbnQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSDQoFc3RhdGUYAiABKAkSDAoEcm9sZRgDIAEoCRIPCgd1c2VyX2lkGAQgASgJEhEKCXVzZXJfbmFtZRgFIAEoCRIpCghtZXRhZGF0YRgGIAEoCzIXLmNoYXQudjEuVHlwaW5nTWV0YWRhdGEiXQoRUGFydGljaXBhbnRKb2luZWQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSDAoEcm9sZRgCIAEoCRIPCgd1c2VyX2lkGAMgASgJEhEKCXVzZXJfbmFtZRgEIAEoCSJJCg9QYXJ0aWNpcGFudExlZnQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSEwoGcmVhc29uGAIgASgJSACIAQFCCQoHX3JlYXNvbiJjCgNBY3cSDwoHZW5hYmxlZBgBIAEoCBIQCghkdXJhdGlvbhgCIAEoAxIPCgdlbmZvcmNlGAMgASgIEhIKCnN0YXJ0ZWRfYXQYBCABKAkSFAoMZGlzcG9zaXRpb25zGAUgAygJIkYKDFNlc3Npb25FbmRlZBIOCgZyZWFzb24YASABKAkSHgoDYWN3GAIgASgLMgwuY2hhdC52MS5BY3dIAIgBAUIGCgRfYWN3IhwKCUhlYXJ0YmVhdBIPCgd1bml4X21zGAEgASgDIqkCCglDaGF0RXZlbnQSIwoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZUgAEiYKBnR5cGluZxgCIAEoCzIULmNoYXQudjEuVHlwaW5nRXZlbnRIABI4ChJwYXJ0aWNpcGFudF9qb2luZWQYAyABKAsyGi5jaGF0LnYxLlBhcnRpY2lwYW50Sm9pbmVkSAASNAoQcGFydGljaXBhbnRfbGVmdBgEIAEoCzIYLmNoYXQudjEuUGFydGljaXBhbnRMZWZ0SAASLgoNc2Vzc2lvbl9lbmRlZBgFIAEoCzIVLmNoYXQudjEuU2Vzc2lvbkVuZGVkSAASJwoJaGVhcnRiZWF0GAYgASgLMhIuY2hhdC52MS5IZWFydGJlYXRIAEIGCgRraW5kIg8KDUF0dGFjaFJlcXVlc3QiNgoOQXR0YWNoUmVzcG9uc2USFgoOcGFydGljaXBhbnRfaWQYASABKAkSDAoEcm9sZRgCIAEoCSKFAgoOTWVzc2FnZVJlcXVlc3QSGQoRY2xpZW50X21lc3NhZ2VfaWQYASABKAkSEQoEdGV4dBgCIAEoCUgAiAEBEigKC2F0dGFjaG1lbnRzGAMgAygLMhMuY2hhdC52MS5BdHRhY2htZW50EhIKBXZhbHVlGAQgASgJSAGIAQESGgoNZ2FsbGVyeV9sYWJlbBgFIAEoCUgCiAEBEhEKBGh0bWwYBiABKAlIA4gBARIqCghtZXRhZGF0YRgHIAEoCzIYLmNoYXQudjEuTWVzc2FnZU1ldGFkYXRhQgcKBV90ZXh0QggKBl92YWx1ZUIQCg5fZ2FsbGVyeV9sYWJlbEIHCgVfaHRtbCI0Cg9NZXNzYWdlUmVzcG9uc2USIQoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZSJJCg1UeXBpbmdSZXF1ZXN0Eg0KBXN0YXRlGAEgASgJEikKCG1ldGFkYXRhGAIgASgLMhcuY2hhdC52MS5UeXBpbmdNZXRhZGF0YSIQCg5UeXBpbmdSZXNwb25zZSIOCgxMZWF2ZVJlcXVlc3QiDwoNTGVhdmVSZXNwb25zZTLyAQoHU2Vzc2lvbhI2CgZBdHRhY2gSFi5jaGF0LnYxLkF0dGFjaFJlcXVlc3QaEi5jaGF0LnYxLkNoYXRFdmVudDABEjwKB01lc3NhZ2USFy5jaGF0LnYxLk1lc3NhZ2VSZXF1ZXN0GhguY2hhdC52MS5NZXNzYWdlUmVzcG9uc2USOQoGVHlwaW5nEhYuY2hhdC52MS5UeXBpbmdSZXF1ZXN0GhcuY2hhdC52MS5UeXBpbmdSZXNwb25zZRI2CgVMZWF2ZRIVLmNoYXQudjEuTGVhdmVSZXF1ZXN0GhYuY2hhdC52MS5MZWF2ZVJlc3BvbnNlYgZwcm90bzM"), Gr = /* @__PURE__ */ R(_, 0), Br = /* @__PURE__ */ R(_, 3), Yr = /* @__PURE__ */ R(_, 4), $r = /* @__PURE__ */ R(_, 12), jt = /* @__PURE__ */ R(_, 13), Xr = /* @__PURE__ */ R(_, 14), qt = /* @__PURE__ */ R(_, 15), Kr = /* @__PURE__ */ R(_, 16), Ht = /* @__PURE__ */ R(_, 17), Zt = /* @__PURE__ */ R(_, 19), ne = /* @__PURE__ */ Fr(_, 0);
3129
+ const _ = /* @__PURE__ */ Lr("CgpjaGF0LnByb3RvEgdjaGF0LnYxIkkKCkF0dGFjaG1lbnQSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRIUCgxjb250ZW50X3R5cGUYAyABKAkSCwoDdXJsGAQgASgJIkEKBkJ1dHRvbhINCgVsYWJlbBgBIAEoCRINCgV2YWx1ZRgCIAEoCRIZCgtidXR0b25fdHlwZRgDIAEoCVIEdHlwZSJ/CgRDYXJkEg0KBXRpdGxlGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEicKBWltYWdlGAMgASgLMhMuY2hhdC52MS5BdHRhY2htZW50SACIAQESIAoHYnV0dG9ucxgEIAMoCzIPLmNoYXQudjEuQnV0dG9uQggKBl9pbWFnZSIjCg9NZXNzYWdlTWV0YWRhdGESEAoIYXVkaWVuY2UYASABKAkiIgoOVHlwaW5nTWV0YWRhdGESEAoIYXVkaWVuY2UYASABKAki7QIKB01lc3NhZ2USCgoCaWQYASABKAkSDAoEcm9sZRgCIAEoCRIRCgR0ZXh0GAMgASgJSACIAQESEQoEaHRtbBgEIAEoCUgBiAEBEigKC2F0dGFjaG1lbnRzGAUgAygLMhMuY2hhdC52MS5BdHRhY2htZW50EiAKB2J1dHRvbnMYBiADKAsyDy5jaGF0LnYxLkJ1dHRvbhIeCgdnYWxsZXJ5GAcgAygLMg0uY2hhdC52MS5DYXJkEhEKCXRpbWVzdGFtcBgIIAEoCRIYCgd1c2VyX2lkGAkgASgJUgd1c2VyX2lkEhwKCXVzZXJfbmFtZRgKIAEoCVIJdXNlcl9uYW1lEg0KBXN0YXRlGAsgASgJEhMKBmFjdGlvbhgMIAEoCUgCiAEBEioKCG1ldGFkYXRhGA0gASgLMhguY2hhdC52MS5NZXNzYWdlTWV0YWRhdGFCBwoFX3RleHRCBwoFX2h0bWxCCQoHX2FjdGlvbiKRAQoLVHlwaW5nRXZlbnQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSDQoFc3RhdGUYAiABKAkSDAoEcm9sZRgDIAEoCRIPCgd1c2VyX2lkGAQgASgJEhEKCXVzZXJfbmFtZRgFIAEoCRIpCghtZXRhZGF0YRgGIAEoCzIXLmNoYXQudjEuVHlwaW5nTWV0YWRhdGEiXQoRUGFydGljaXBhbnRKb2luZWQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSDAoEcm9sZRgCIAEoCRIPCgd1c2VyX2lkGAMgASgJEhEKCXVzZXJfbmFtZRgEIAEoCSJJCg9QYXJ0aWNpcGFudExlZnQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSEwoGcmVhc29uGAIgASgJSACIAQFCCQoHX3JlYXNvbiJjCgNBY3cSDwoHZW5hYmxlZBgBIAEoCBIQCghkdXJhdGlvbhgCIAEoAxIPCgdlbmZvcmNlGAMgASgIEhIKCnN0YXJ0ZWRfYXQYBCABKAkSFAoMZGlzcG9zaXRpb25zGAUgAygJIkYKDFNlc3Npb25FbmRlZBIOCgZyZWFzb24YASABKAkSHgoDYWN3GAIgASgLMgwuY2hhdC52MS5BY3dIAIgBAUIGCgRfYWN3IhwKCUhlYXJ0YmVhdBIPCgd1bml4X21zGAEgASgDIqkCCglDaGF0RXZlbnQSIwoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZUgAEiYKBnR5cGluZxgCIAEoCzIULmNoYXQudjEuVHlwaW5nRXZlbnRIABI4ChJwYXJ0aWNpcGFudF9qb2luZWQYAyABKAsyGi5jaGF0LnYxLlBhcnRpY2lwYW50Sm9pbmVkSAASNAoQcGFydGljaXBhbnRfbGVmdBgEIAEoCzIYLmNoYXQudjEuUGFydGljaXBhbnRMZWZ0SAASLgoNc2Vzc2lvbl9lbmRlZBgFIAEoCzIVLmNoYXQudjEuU2Vzc2lvbkVuZGVkSAASJwoJaGVhcnRiZWF0GAYgASgLMhIuY2hhdC52MS5IZWFydGJlYXRIAEIGCgRraW5kIg8KDUF0dGFjaFJlcXVlc3QiNgoOQXR0YWNoUmVzcG9uc2USFgoOcGFydGljaXBhbnRfaWQYASABKAkSDAoEcm9sZRgCIAEoCSKFAgoOTWVzc2FnZVJlcXVlc3QSGQoRY2xpZW50X21lc3NhZ2VfaWQYASABKAkSEQoEdGV4dBgCIAEoCUgAiAEBEigKC2F0dGFjaG1lbnRzGAMgAygLMhMuY2hhdC52MS5BdHRhY2htZW50EhIKBXZhbHVlGAQgASgJSAGIAQESGgoNZ2FsbGVyeV9sYWJlbBgFIAEoCUgCiAEBEhEKBGh0bWwYBiABKAlIA4gBARIqCghtZXRhZGF0YRgHIAEoCzIYLmNoYXQudjEuTWVzc2FnZU1ldGFkYXRhQgcKBV90ZXh0QggKBl92YWx1ZUIQCg5fZ2FsbGVyeV9sYWJlbEIHCgVfaHRtbCI0Cg9NZXNzYWdlUmVzcG9uc2USIQoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZSJJCg1UeXBpbmdSZXF1ZXN0Eg0KBXN0YXRlGAEgASgJEikKCG1ldGFkYXRhGAIgASgLMhcuY2hhdC52MS5UeXBpbmdNZXRhZGF0YSIQCg5UeXBpbmdSZXNwb25zZSIOCgxMZWF2ZVJlcXVlc3QiDwoNTGVhdmVSZXNwb25zZTLyAQoHU2Vzc2lvbhI2CgZBdHRhY2gSFi5jaGF0LnYxLkF0dGFjaFJlcXVlc3QaEi5jaGF0LnYxLkNoYXRFdmVudDABEjwKB01lc3NhZ2USFy5jaGF0LnYxLk1lc3NhZ2VSZXF1ZXN0GhguY2hhdC52MS5NZXNzYWdlUmVzcG9uc2USOQoGVHlwaW5nEhYuY2hhdC52MS5UeXBpbmdSZXF1ZXN0GhcuY2hhdC52MS5UeXBpbmdSZXNwb25zZRI2CgVMZWF2ZRIVLmNoYXQudjEuTGVhdmVSZXF1ZXN0GhYuY2hhdC52MS5MZWF2ZVJlc3BvbnNlYgZwcm90bzM"), Yr = /* @__PURE__ */ R(_, 0), $r = /* @__PURE__ */ R(_, 3), Xr = /* @__PURE__ */ R(_, 4), Kr = /* @__PURE__ */ R(_, 12), jt = /* @__PURE__ */ R(_, 13), Wr = /* @__PURE__ */ R(_, 14), qt = /* @__PURE__ */ R(_, 15), jr = /* @__PURE__ */ R(_, 16), Ht = /* @__PURE__ */ R(_, 17), Zt = /* @__PURE__ */ R(_, 19), ne = /* @__PURE__ */ Br(_, 0);
3130
3130
  function tt(e, t) {
3131
3131
  if (e == null) return;
3132
3132
  if (typeof e != "object" || Array.isArray(e))
@@ -3136,7 +3136,7 @@ function tt(e, t) {
3136
3136
  if (n === "internal" || n === "all") return { audience: n };
3137
3137
  throw h.session(`${t} carried invalid metadata.audience`);
3138
3138
  }
3139
- const Wr = "x-origon-client-id", jr = "stream_overflow", U = {
3139
+ const qr = "x-origon-client-id", Hr = "stream_overflow", U = {
3140
3140
  /** session_not_found — terminal */
3141
3141
  NOT_FOUND: 1,
3142
3142
  /** bad request (e.g. missing client id at gw) — terminal */
@@ -3180,11 +3180,11 @@ function zt(e) {
3180
3180
  `chat session url carries no client id (want /chat/api/<id>/live, got "${t.pathname}")`
3181
3181
  );
3182
3182
  }
3183
- function qr(e) {
3184
- const t = fe($r, e);
3183
+ function Zr(e) {
3184
+ const t = fe(Kr, e);
3185
3185
  switch (t.kind.case) {
3186
3186
  case "message":
3187
- return { kind: "message", message: Xn(t.kind.value) };
3187
+ return { kind: "message", message: Kn(t.kind.value) };
3188
3188
  case "typing": {
3189
3189
  const n = t.kind.value;
3190
3190
  if (n.state !== "on" && n.state !== "off")
@@ -3197,19 +3197,19 @@ function qr(e) {
3197
3197
  userId: n.userId,
3198
3198
  userName: n.userName,
3199
3199
  state: n.state,
3200
- metadata: Qr(n.metadata?.audience)
3200
+ metadata: ei(n.metadata?.audience)
3201
3201
  }
3202
3202
  };
3203
3203
  }
3204
3204
  case "sessionEnded": {
3205
3205
  const n = t.kind.value.reason;
3206
- return { kind: "ended", reason: n, replay: n === jr };
3206
+ return { kind: "ended", reason: n, replay: n === Hr };
3207
3207
  }
3208
3208
  default:
3209
3209
  return { kind: "ignore" };
3210
3210
  }
3211
3211
  }
3212
- function Xn(e) {
3212
+ function Kn(e) {
3213
3213
  const t = e.role === "ai" || e.role === "user" || e.role === "system" ? e.role : "external", n = tt(e.metadata, "chat message");
3214
3214
  return {
3215
3215
  role: t,
@@ -3229,18 +3229,18 @@ function Xn(e) {
3229
3229
  ...e.userId !== "" ? { userId: e.userId } : {},
3230
3230
  ...e.userName !== "" ? { userName: e.userName } : {},
3231
3231
  ...e.action !== void 0 ? { action: e.action } : {},
3232
- ...e.buttons.length > 0 ? { buttons: e.buttons.map(Kn) } : {},
3233
- ...e.gallery.length > 0 ? { gallery: e.gallery.map(Hr) } : {}
3232
+ ...e.buttons.length > 0 ? { buttons: e.buttons.map(Wn) } : {},
3233
+ ...e.gallery.length > 0 ? { gallery: e.gallery.map(zr) } : {}
3234
3234
  };
3235
3235
  }
3236
- function Kn(e) {
3236
+ function Wn(e) {
3237
3237
  return { label: e.label, value: e.value, type: e.buttonType };
3238
3238
  }
3239
- function Hr(e) {
3239
+ function zr(e) {
3240
3240
  return {
3241
3241
  title: e.title,
3242
3242
  description: e.description,
3243
- buttons: e.buttons.map(Kn),
3243
+ buttons: e.buttons.map(Wn),
3244
3244
  ...e.image !== void 0 ? {
3245
3245
  image: {
3246
3246
  id: e.image.id,
@@ -3251,7 +3251,7 @@ function Hr(e) {
3251
3251
  } : {}
3252
3252
  };
3253
3253
  }
3254
- class Zr {
3254
+ class Qr {
3255
3255
  constructor(t, n) {
3256
3256
  this.url = t.url, this.token = t.token, this.clientId = zt(t.url), this.opts = n, this.client = this.createClient();
3257
3257
  }
@@ -3275,8 +3275,8 @@ class Zr {
3275
3275
  logout: () => {
3276
3276
  }
3277
3277
  };
3278
- return hs(this.url, t, {
3279
- metadata: { [Wr]: this.clientId },
3278
+ return ms(this.url, t, {
3279
+ metadata: { [qr]: this.clientId },
3280
3280
  ...this.opts.transport !== void 0 ? { transport: this.opts.transport } : {},
3281
3281
  ...this.opts.logger !== void 0 ? { logger: this.opts.logger } : {}
3282
3282
  });
@@ -3286,7 +3286,7 @@ class Zr {
3286
3286
  const t = te(jt, C(jt)), n = await this.client.stream(re(ne.method.attach), t);
3287
3287
  let s;
3288
3288
  try {
3289
- s = fe(Xr, n.initial);
3289
+ s = fe(Wr, n.initial);
3290
3290
  } catch (r) {
3291
3291
  throw n.cancel(), r;
3292
3292
  }
@@ -3300,7 +3300,7 @@ class Zr {
3300
3300
  const n = C(qt, {
3301
3301
  clientMessageId: t.clientMessageId,
3302
3302
  attachments: (t.attachments ?? []).map(
3303
- (i) => C(Gr, {
3303
+ (i) => C(Yr, {
3304
3304
  id: i.id,
3305
3305
  name: i.name,
3306
3306
  contentType: i.contentType,
@@ -3312,20 +3312,20 @@ class Zr {
3312
3312
  ...t.html !== void 0 ? { html: t.html } : {},
3313
3313
  ...t.value !== void 0 ? { value: t.value } : {},
3314
3314
  ...t.galleryLabel !== void 0 ? { galleryLabel: t.galleryLabel } : {},
3315
- ...t.metadata?.audience !== void 0 ? { metadata: C(Br, t.metadata) } : {}
3315
+ ...t.metadata?.audience !== void 0 ? { metadata: C($r, t.metadata) } : {}
3316
3316
  }), s = await this.client.call(
3317
3317
  re(ne.method.message),
3318
3318
  te(qt, n)
3319
- ), r = fe(Kr, s);
3319
+ ), r = fe(jr, s);
3320
3320
  if (r.message === void 0)
3321
3321
  throw h.session("chat message response carried no message");
3322
- return Xn(r.message);
3322
+ return Kn(r.message);
3323
3323
  }
3324
3324
  /** Typing — on/off indicator. Unary; the response is empty. */
3325
3325
  async typing(t, n) {
3326
3326
  const s = C(Ht, {
3327
3327
  state: t,
3328
- ...n?.audience !== void 0 ? { metadata: C(Yr, n) } : {}
3328
+ ...n?.audience !== void 0 ? { metadata: C(Xr, n) } : {}
3329
3329
  });
3330
3330
  await this.client.call(
3331
3331
  re(ne.method.typing),
@@ -3340,20 +3340,20 @@ class Zr {
3340
3340
  );
3341
3341
  }
3342
3342
  }
3343
- function zr(e, t) {
3343
+ function Jr(e, t) {
3344
3344
  if (e === "internal" || e === "all") return e;
3345
3345
  throw h.session(`${t} carried invalid or missing metadata.audience`);
3346
3346
  }
3347
- function Qr(e) {
3348
- return { audience: zr(e, "chat typing event") };
3347
+ function ei(e) {
3348
+ return { audience: Jr(e, "chat typing event") };
3349
3349
  }
3350
3350
  function re(e) {
3351
3351
  return `${e.parent.typeName}/${e.name}`;
3352
3352
  }
3353
- const Jr = 3e3, ei = 6e3, ti = 3, ni = 500, si = 2e3;
3354
- class ri {
3353
+ const ti = 3e3, ni = 6e3, si = 3, ri = 500, ii = 2e3;
3354
+ class ai {
3355
3355
  constructor(t, n) {
3356
- this.stream = null, this.terminalFired = !1, this.reattaching = !1, this.provisionedRecoveryPromise = null, this.recoveryGeneration = 0, this.knownMessageIds = /* @__PURE__ */ new Set(), this.outboundOffTimer = null, this.outboundTypingMetadata = null, this.inboundTyping = /* @__PURE__ */ new Map(), this.sessionId = t.sessionId, this.lane = new Zr(
3356
+ this.stream = null, this.terminalFired = !1, this.reattaching = !1, this.provisionedRecoveryPromise = null, this.recoveryGeneration = 0, this.knownMessageIds = /* @__PURE__ */ new Set(), this.outboundOffTimer = null, this.outboundTypingMetadata = null, this.inboundTyping = /* @__PURE__ */ new Map(), this.sessionId = t.sessionId, this.lane = new Qr(
3357
3357
  { url: t.url.replace(/\/$/, ""), token: t.token },
3358
3358
  { remint: () => this.remint() }
3359
3359
  ), this.sessionHttp = n.sessionHttp, this.provisionedRecovery = n.provisionedRecovery, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
@@ -3374,12 +3374,12 @@ class ri {
3374
3374
  if (s)
3375
3375
  throw this.fireTerminal(s), n;
3376
3376
  if (await this.beginProvisionedRecovery(
3377
- n instanceof T && se(n.code) === "remint" ? "unauthenticated" : "transportError"
3377
+ n instanceof S && se(n.code) === "remint" ? "unauthenticated" : "transportError"
3378
3378
  )) return;
3379
3379
  throw n;
3380
3380
  }
3381
3381
  throw this.fireTerminal(
3382
- n instanceof T ? { kind: "serverClosed", code: n.code, reason: n.reason } : { kind: "networkLoss" }
3382
+ n instanceof S ? { kind: "serverClosed", code: n.code, reason: n.reason } : { kind: "networkLoss" }
3383
3383
  ), n;
3384
3384
  }
3385
3385
  if (this.terminalFired)
@@ -3389,7 +3389,7 @@ class ri {
3389
3389
  // ── Outbound API ─────────────────────────────────────────────────────
3390
3390
  async sendMessage(t) {
3391
3391
  this.cancelOutboundDebounce({ flushOff: !0 });
3392
- const n = hn(), s = tt(t.metadata, "chat message request"), r = {
3392
+ const n = fn(), s = tt(t.metadata, "chat message request"), r = {
3393
3393
  role: t.role ?? "external",
3394
3394
  id: "",
3395
3395
  localId: n,
@@ -3442,7 +3442,7 @@ class ri {
3442
3442
  this.outboundOffTimer = null;
3443
3443
  const n = this.outboundTypingMetadata;
3444
3444
  this.outboundTypingMetadata = null, this.sendTyping("off", n ?? void 0);
3445
- }, Jr);
3445
+ }, ti);
3446
3446
  }
3447
3447
  stopTyping() {
3448
3448
  this.cancelOutboundDebounce({ flushOff: !0 });
@@ -3453,7 +3453,7 @@ class ri {
3453
3453
  this.fireTerminal({ kind: "localClose" }), n && await Promise.race([
3454
3454
  this.lane.leave().catch((s) => {
3455
3455
  }),
3456
- W(si)
3456
+ W(ii)
3457
3457
  ]);
3458
3458
  }
3459
3459
  /**
@@ -3481,7 +3481,7 @@ class ri {
3481
3481
  if (this.terminalFired || this.stream !== t) continue;
3482
3482
  let r;
3483
3483
  try {
3484
- r = qr(s);
3484
+ r = Zr(s);
3485
3485
  } catch {
3486
3486
  this.fireTerminal({ kind: "protocolViolation" });
3487
3487
  return;
@@ -3579,13 +3579,13 @@ class ri {
3579
3579
  const l = this.provisionedTerminalFromRefusal(o);
3580
3580
  if (l)
3581
3581
  return this.fireTerminal(l), null;
3582
- o instanceof T && se(o.code) === "remint" && (s = "unauthenticated");
3582
+ o instanceof S && se(o.code) === "remint" && (s = "unauthenticated");
3583
3583
  }
3584
3584
  }
3585
3585
  return this.fireTerminal({ kind: "replayLost" }), null;
3586
3586
  }
3587
3587
  provisionedTerminalFromRefusal(t) {
3588
- if (!(t instanceof T)) return null;
3588
+ if (!(t instanceof S)) return null;
3589
3589
  switch (t.code) {
3590
3590
  case U.NOT_FOUND:
3591
3591
  return { kind: "sessionEnded" };
@@ -3634,8 +3634,8 @@ class ri {
3634
3634
  this.reattaching = !0;
3635
3635
  try {
3636
3636
  let t = !1;
3637
- for (let n = 0; n < ti; n++) {
3638
- if (await W(ni * 2 ** n), this.terminalFired) return;
3637
+ for (let n = 0; n < si; n++) {
3638
+ if (await W(ri * 2 ** n), this.terminalFired) return;
3639
3639
  try {
3640
3640
  const { stream: s } = await this.lane.attach();
3641
3641
  if (this.terminalFired) {
@@ -3645,7 +3645,7 @@ class ri {
3645
3645
  this.stream = s, this.pump(s), await this.replayHistory();
3646
3646
  return;
3647
3647
  } catch (s) {
3648
- if (s instanceof T) {
3648
+ if (s instanceof S) {
3649
3649
  const r = se(s.code);
3650
3650
  if (r === "remint" && !t) {
3651
3651
  t = !0;
@@ -3726,7 +3726,7 @@ class ri {
3726
3726
  ...t,
3727
3727
  state: "off"
3728
3728
  });
3729
- }, ei);
3729
+ }, ni);
3730
3730
  this.inboundTyping.set(t.participantId, { timer: n, update: t });
3731
3731
  }
3732
3732
  clearInboundWatchdog(t) {
@@ -3767,7 +3767,7 @@ class ri {
3767
3767
  this.stream = null, n && n.cancel(), this.clearAllInboundWatchdogs({ notify: this.provisionedRecovery !== void 0 }), this.outboundOffTimer && (clearTimeout(this.outboundOffTimer), this.outboundOffTimer = null), this.outboundTypingMetadata = null, this.onTerminal(t, this.sessionId);
3768
3768
  }
3769
3769
  }
3770
- class ii {
3770
+ class oi {
3771
3771
  constructor(t) {
3772
3772
  this.endpoint = t.endpoint.replace(/\/$/, ""), this.defaultHeaders = {}, t.token && (this.defaultHeaders.Authorization = `Bearer ${t.token}`);
3773
3773
  }
@@ -3848,7 +3848,7 @@ async function Qt(e) {
3848
3848
  } catch (s) {
3849
3849
  throw h.other(`decode response: ${s.message}`);
3850
3850
  }
3851
- if (sn(n))
3851
+ if (rn(n))
3852
3852
  throw h.http(e.status, n.error.code, n.error.message);
3853
3853
  return n;
3854
3854
  }
@@ -3860,7 +3860,7 @@ function nt(e, t) {
3860
3860
  return h.http(e, "", `HTTP ${e}`);
3861
3861
  try {
3862
3862
  const n = JSON.parse(t);
3863
- if (sn(n))
3863
+ if (rn(n))
3864
3864
  return h.http(e, n.error.code, n.error.message);
3865
3865
  } catch {
3866
3866
  }
@@ -3869,7 +3869,7 @@ function nt(e, t) {
3869
3869
  function ve(e, t) {
3870
3870
  return t ? `${e}?userId=${encodeURIComponent(t)}` : e;
3871
3871
  }
3872
- class ai {
3872
+ class ci {
3873
3873
  constructor(t, n) {
3874
3874
  this.http = t, this.userId = n;
3875
3875
  }
@@ -3888,17 +3888,17 @@ class ai {
3888
3888
  /** `GET /sessions` — list prior sessions (matches `client-sdk/session`). */
3889
3889
  async listSessions() {
3890
3890
  const t = await this.http.getJson(ve("/sessions", this.userId));
3891
- return oi(t);
3891
+ return ui(t);
3892
3892
  }
3893
3893
  /** `GET /session/{id}` — fetch transcript + control (matches `client-sdk/session`). */
3894
3894
  async getSession(t) {
3895
3895
  const n = await this.http.getJson(
3896
3896
  ve(`/session/${encodeURIComponent(t)}`, this.userId)
3897
3897
  );
3898
- return ci(n);
3898
+ return li(n);
3899
3899
  }
3900
3900
  }
3901
- function oi(e) {
3901
+ function ui(e) {
3902
3902
  if (!Array.isArray(e))
3903
3903
  throw h.other("decode sessions: expected an array");
3904
3904
  return e.forEach((t, n) => {
@@ -3910,11 +3910,11 @@ function oi(e) {
3910
3910
  const s = t;
3911
3911
  return s.lastMessage === void 0 || s.lastMessage === null ? s : {
3912
3912
  ...s,
3913
- lastMessage: Wn(s.lastMessage, `decode sessions[${n}].lastMessage`)
3913
+ lastMessage: jn(s.lastMessage, `decode sessions[${n}].lastMessage`)
3914
3914
  };
3915
3915
  });
3916
3916
  }
3917
- function ci(e) {
3917
+ function li(e) {
3918
3918
  if (typeof e != "object" || e === null || Array.isArray(e))
3919
3919
  throw h.other("decode session: expected an object");
3920
3920
  const t = e.history;
@@ -3923,11 +3923,11 @@ function ci(e) {
3923
3923
  return {
3924
3924
  ...e,
3925
3925
  history: t.map(
3926
- (n, s) => Wn(n, `decode session.history[${s}]`)
3926
+ (n, s) => jn(n, `decode session.history[${s}]`)
3927
3927
  )
3928
3928
  };
3929
3929
  }
3930
- function Wn(e, t) {
3930
+ function jn(e, t) {
3931
3931
  if (typeof e != "object" || e === null || Array.isArray(e))
3932
3932
  throw h.other(`${t}: expected an object`);
3933
3933
  const n = e, s = tt(
@@ -3940,7 +3940,7 @@ function Wn(e, t) {
3940
3940
  }
3941
3941
  return { ...n, metadata: s };
3942
3942
  }
3943
- function ui(e, t, n, s) {
3943
+ function di(e, t, n, s) {
3944
3944
  return new Promise((r, i) => {
3945
3945
  const a = new XMLHttpRequest();
3946
3946
  a.open("POST", e, !0), s && a.setRequestHeader("Authorization", `Bearer ${s}`);
@@ -3957,11 +3957,11 @@ function ui(e, t, n, s) {
3957
3957
  }), a.onload = () => {
3958
3958
  const d = a.status, f = a.responseText ?? "";
3959
3959
  if (d < 200 || d >= 300) {
3960
- i(nt(d, hi(f, s)));
3960
+ i(nt(d, mi(f, s)));
3961
3961
  return;
3962
3962
  }
3963
3963
  try {
3964
- const p = li(JSON.parse(f));
3964
+ const p = hi(JSON.parse(f));
3965
3965
  if (n.onProgress && t.size > 0) {
3966
3966
  const m = {
3967
3967
  bytesUploaded: t.size,
@@ -3988,8 +3988,8 @@ function ui(e, t, n, s) {
3988
3988
  a.send(o);
3989
3989
  });
3990
3990
  }
3991
- function li(e) {
3992
- if (!di(e)) throw h.other("decode response: attachment must be an object");
3991
+ function hi(e) {
3992
+ if (!fi(e)) throw h.other("decode response: attachment must be an object");
3993
3993
  const { id: t, name: n, contentType: s, url: r } = e;
3994
3994
  if (typeof t != "string" || typeof n != "string" || typeof s != "string")
3995
3995
  throw h.other("decode response: attachment id, name, and contentType must be strings");
@@ -3997,17 +3997,17 @@ function li(e) {
3997
3997
  throw h.other("decode response: attachment url must be a string when present");
3998
3998
  return { id: t, name: n, contentType: s, ...r !== void 0 ? { url: r } : {} };
3999
3999
  }
4000
- function di(e) {
4000
+ function fi(e) {
4001
4001
  return typeof e == "object" && e !== null && !Array.isArray(e);
4002
4002
  }
4003
- function hi(e, t) {
4003
+ function mi(e, t) {
4004
4004
  return t ? e.split(t).join("[REDACTED]") : e;
4005
4005
  }
4006
- function fi(e, t) {
4006
+ function pi(e, t) {
4007
4007
  if (e.size === 0)
4008
4008
  return { ok: !1, error: h.attachment("EMPTY_FILE", `Empty file: ${e.name}`) };
4009
4009
  if (!t) return { ok: !0 };
4010
- const n = mi(e.type);
4010
+ const n = bi(e.type);
4011
4011
  if (!n)
4012
4012
  return {
4013
4013
  ok: !1,
@@ -4031,31 +4031,31 @@ function fi(e, t) {
4031
4031
  )
4032
4032
  } : { ok: !0 };
4033
4033
  }
4034
- function mi(e) {
4034
+ function bi(e) {
4035
4035
  return e ? e.startsWith("image/") ? "images" : e.startsWith("video/") ? "videos" : e.startsWith("audio/") ? "audio" : e.startsWith("application/") || e.startsWith("text/") || e === "application/pdf" ? "documents" : null : null;
4036
4036
  }
4037
4037
  const Jt = "origonWebSdkUserId";
4038
- function pi() {
4038
+ function gi() {
4039
4039
  const e = localStorage.getItem(Jt);
4040
4040
  if (e) return e;
4041
- const t = hn();
4041
+ const t = fn();
4042
4042
  return localStorage.setItem(Jt, t), t;
4043
4043
  }
4044
- const bi = (1n << 62n) - 1n;
4044
+ const Ei = (1n << 62n) - 1n;
4045
4045
  class y extends Error {
4046
4046
  constructor(t) {
4047
4047
  super(t), this.name = "CodecError";
4048
4048
  }
4049
4049
  }
4050
- function gi(e) {
4050
+ function yi(e) {
4051
4051
  if (e < 0n) throw new y(`negative varint: ${e}`);
4052
4052
  if (e <= 63n) return 1;
4053
4053
  if (e <= 16383n) return 2;
4054
4054
  if (e <= 1073741823n) return 4;
4055
- if (e <= bi) return 8;
4055
+ if (e <= Ei) return 8;
4056
4056
  throw new y(`varint overflow: ${e}`);
4057
4057
  }
4058
- class X {
4058
+ class G {
4059
4059
  constructor() {
4060
4060
  this.chunks = [], this.len = 0;
4061
4061
  }
@@ -4077,7 +4077,7 @@ class X {
4077
4077
  this.chunks.push(t), this.len += t.length;
4078
4078
  }
4079
4079
  putVarint(t) {
4080
- const n = typeof t == "number" ? BigInt(t) : t, s = gi(n);
4080
+ const n = typeof t == "number" ? BigInt(t) : t, s = yi(n);
4081
4081
  switch (s) {
4082
4082
  case 1:
4083
4083
  this.putU8(Number(n));
@@ -4197,7 +4197,7 @@ class ye {
4197
4197
  return new TextDecoder("utf-8", { fatal: !0 }).decode(this.getLengthPrefixedBytes());
4198
4198
  }
4199
4199
  }
4200
- function Ei(e) {
4200
+ function wi(e) {
4201
4201
  try {
4202
4202
  const t = new ye(e);
4203
4203
  t.getVarint();
@@ -4207,16 +4207,16 @@ function Ei(e) {
4207
4207
  return null;
4208
4208
  }
4209
4209
  }
4210
- const yi = 1, jn = 2, wi = 4, Ii = 8, Ni = 32;
4211
- function Ti(e) {
4212
- const t = new X(), n = e.endOfGroup ? jn : 0;
4210
+ const Ii = 1, qn = 2, Ni = 4, Ti = 8, Si = 32;
4211
+ function ki(e) {
4212
+ const t = new G(), n = e.endOfGroup ? qn : 0;
4213
4213
  return t.putVarint(n), t.putVarint(e.trackAlias), t.putVarint(e.groupId), t.putVarint(e.objectId), t.putU8(e.publisherPriority & 255), t.putBytes(e.payload), t.toUint8Array();
4214
4214
  }
4215
- function Si(e) {
4215
+ function Ai(e) {
4216
4216
  const t = new ye(e), n = Number(t.getVarint());
4217
4217
  if (!(n >= 0 && n <= 15 || n >= 32 && n <= 47))
4218
4218
  throw new y(`invalid ObjectDatagram type byte 0x${n.toString(16)}`);
4219
- const s = (n & yi) !== 0, r = (n & jn) !== 0, i = (n & wi) !== 0, a = (n & Ii) !== 0, o = (n & Ni) !== 0;
4219
+ const s = (n & Ii) !== 0, r = (n & qn) !== 0, i = (n & Ni) !== 0, a = (n & Ti) !== 0, o = (n & Si) !== 0;
4220
4220
  if (o && r)
4221
4221
  throw new y("status datagram cannot also be end-of-group");
4222
4222
  const l = t.getVarint(), u = t.getVarint(), d = i ? 1n : t.getVarint(), f = a ? 0 : t.getU8();
@@ -4252,11 +4252,11 @@ function en(e, t) {
4252
4252
  const n = new Uint8Array(t.length + 1);
4253
4253
  return n[0] = e, n.set(t, 1), n;
4254
4254
  }
4255
- function ki(e) {
4255
+ function Ri(e) {
4256
4256
  if (e.length === 0) throw new y("empty datagram envelope");
4257
4257
  return { cls: e[0], body: e.subarray(1) };
4258
4258
  }
4259
- const Pe = 64 * 1024, S = {
4259
+ const Fe = 64 * 1024, N = {
4260
4260
  CONNECT: 0x40n,
4261
4261
  CONNECT_OK: 0x41n,
4262
4262
  NEGOTIATE_MEDIA: 0x42n,
@@ -4269,45 +4269,54 @@ const Pe = 64 * 1024, S = {
4269
4269
  // 0x4A-0x4B = Hangup / HangupOk — removed upstream
4270
4270
  RESUME: 0x4cn,
4271
4271
  RESUME_OK: 0x4dn,
4272
- // 0x4E-0x4F = SendDtmf — intentionally not implemented
4272
+ // 0x4E-0x4F = abandoned draft SendDtmf ids; reserved
4273
4273
  // 0x50 = EndpointHeld — intentionally not implemented
4274
4274
  ENDPOINT_MUTED: 0x51n,
4275
4275
  ENDPOINT_HANGUP: 0x52n,
4276
4276
  PEER_STATE_CHANGED: 0x53n,
4277
- // 0x54 = DtmfReceived — not implemented; uni-stream payload anyway
4278
- MOQ_ERROR: 0x55n
4279
- };
4280
- function Ai(e) {
4281
- const t = new X(), { msgType: n, payload: s } = _i(e);
4282
- if (s.length > Pe)
4283
- throw new y(`control frame payload ${s.length} > ${Pe}`);
4277
+ // 0x54 = retired legacy DTMF server push; permanently reserved
4278
+ MOQ_ERROR: 0x55n,
4279
+ // 0x56-0x57 = feedback verbs moved to datagrams; reserved
4280
+ SEND_DTMF: 0x58n,
4281
+ SEND_DTMF_OK: 0x59n
4282
+ }, _i = "0123456789*#ABCD";
4283
+ function Hn(e) {
4284
+ return e.length === 1 && _i.includes(e);
4285
+ }
4286
+ function vi(e) {
4287
+ const t = new G(), { msgType: n, payload: s } = Ci(e);
4288
+ if (s.length > Fe)
4289
+ throw new y(`control frame payload ${s.length} > ${Fe}`);
4284
4290
  return t.putVarint(n), t.putVarint(s.length), t.putBytes(s), t.toUint8Array();
4285
4291
  }
4286
- function Ri(e) {
4287
- const t = Ei(e);
4292
+ function Oi(e) {
4293
+ const t = wi(e);
4288
4294
  if (t === null || t > e.length) return null;
4289
4295
  const n = new ye(e), s = n.getVarint(), r = Number(n.getVarint());
4290
- if (r > Pe)
4296
+ if (r > Fe)
4291
4297
  throw new y(`oversized payload ${r}`);
4292
4298
  const i = n.getBytes(r);
4293
- return { msg: vi(s, i), consumed: t };
4299
+ return { msg: Di(s, i), consumed: t };
4294
4300
  }
4295
- function _i(e) {
4301
+ function Ci(e) {
4296
4302
  switch (e.type) {
4297
4303
  case "connect":
4298
- return { msgType: S.CONNECT, payload: Xi(e.data) };
4304
+ return { msgType: N.CONNECT, payload: ji(e.data) };
4299
4305
  case "negotiateMedia":
4300
- return { msgType: S.NEGOTIATE_MEDIA, payload: Ki(e.data) };
4306
+ return { msgType: N.NEGOTIATE_MEDIA, payload: qi(e.data) };
4301
4307
  case "mute":
4302
- return { msgType: S.MUTE, payload: Wi(e.data) };
4308
+ return { msgType: N.MUTE, payload: Hi(e.data) };
4303
4309
  case "resume":
4304
- return { msgType: S.RESUME, payload: ji(e.data) };
4310
+ return { msgType: N.RESUME, payload: Zi(e.data) };
4311
+ case "sendDtmf":
4312
+ return { msgType: N.SEND_DTMF, payload: zi(e.data) };
4305
4313
  // The remaining variants are server-emitted; we never encode them
4306
4314
  // outbound. Including the cases keeps the union exhaustive.
4307
4315
  case "connectOk":
4308
4316
  case "negotiateMediaOk":
4309
4317
  case "muteOk":
4310
4318
  case "resumeOk":
4319
+ case "sendDtmfOk":
4311
4320
  case "peerAttached":
4312
4321
  case "peerDetached":
4313
4322
  case "endpointMuted":
@@ -4317,39 +4326,42 @@ function _i(e) {
4317
4326
  throw new y(`refusing to encode server-emitted variant '${e.type}'`);
4318
4327
  }
4319
4328
  }
4320
- function vi(e, t) {
4329
+ function Di(e, t) {
4321
4330
  const n = new ye(t);
4322
4331
  let s;
4323
4332
  switch (e) {
4324
- case S.CONNECT_OK:
4325
- s = { type: "connectOk", data: qi(n) };
4333
+ case N.CONNECT_OK:
4334
+ s = { type: "connectOk", data: Qi(n) };
4335
+ break;
4336
+ case N.NEGOTIATE_MEDIA_OK:
4337
+ s = { type: "negotiateMediaOk", data: Ji(n) };
4326
4338
  break;
4327
- case S.NEGOTIATE_MEDIA_OK:
4328
- s = { type: "negotiateMediaOk", data: Hi(n) };
4339
+ case N.MUTE_OK:
4340
+ s = { type: "muteOk", data: tn(n) };
4329
4341
  break;
4330
- case S.MUTE_OK:
4331
- s = { type: "muteOk", data: Zi(n) };
4342
+ case N.RESUME_OK:
4343
+ s = { type: "resumeOk", data: ea(n) };
4332
4344
  break;
4333
- case S.RESUME_OK:
4334
- s = { type: "resumeOk", data: zi(n) };
4345
+ case N.SEND_DTMF_OK:
4346
+ s = { type: "sendDtmfOk", data: tn(n) };
4335
4347
  break;
4336
- case S.PEER_ATTACHED:
4337
- s = { type: "peerAttached", data: Qi(n) };
4348
+ case N.PEER_ATTACHED:
4349
+ s = { type: "peerAttached", data: ta(n) };
4338
4350
  break;
4339
- case S.PEER_DETACHED:
4340
- s = { type: "peerDetached", data: Ji(n) };
4351
+ case N.PEER_DETACHED:
4352
+ s = { type: "peerDetached", data: na(n) };
4341
4353
  break;
4342
- case S.ENDPOINT_MUTED:
4343
- s = { type: "endpointMuted", data: ea(n) };
4354
+ case N.ENDPOINT_MUTED:
4355
+ s = { type: "endpointMuted", data: sa(n) };
4344
4356
  break;
4345
- case S.ENDPOINT_HANGUP:
4346
- s = { type: "endpointHangup", data: ta(n) };
4357
+ case N.ENDPOINT_HANGUP:
4358
+ s = { type: "endpointHangup", data: ra(n) };
4347
4359
  break;
4348
- case S.PEER_STATE_CHANGED:
4349
- s = { type: "peerStateChanged", data: na(n) };
4360
+ case N.PEER_STATE_CHANGED:
4361
+ s = { type: "peerStateChanged", data: ia(n) };
4350
4362
  break;
4351
- case S.MOQ_ERROR:
4352
- s = { type: "moqError", data: sa(n) };
4363
+ case N.MOQ_ERROR:
4364
+ s = { type: "moqError", data: aa(n) };
4353
4365
  break;
4354
4366
  default:
4355
4367
  throw new y(`unknown control message type 0x${e.toString(16)}`);
@@ -4360,17 +4372,17 @@ function vi(e, t) {
4360
4372
  );
4361
4373
  return s;
4362
4374
  }
4363
- function Oi(e) {
4375
+ function Ui(e) {
4364
4376
  switch (e) {
4365
4377
  case "audio":
4366
4378
  return 1n;
4367
4379
  }
4368
4380
  }
4369
- function Ci(e) {
4381
+ function Li(e) {
4370
4382
  if (e === 1n) return "audio";
4371
4383
  throw new y(`unknown EncodingClass id ${e}`);
4372
4384
  }
4373
- function Di(e) {
4385
+ function Mi(e) {
4374
4386
  switch (e) {
4375
4387
  case "primary":
4376
4388
  return 1n;
@@ -4378,12 +4390,12 @@ function Di(e) {
4378
4390
  return 2n;
4379
4391
  }
4380
4392
  }
4381
- function Ui(e) {
4393
+ function xi(e) {
4382
4394
  if (e === 1n) return "primary";
4383
4395
  if (e === 2n) return "captions";
4384
4396
  throw new y(`unknown TrackPurpose id ${e}`);
4385
4397
  }
4386
- function Li(e) {
4398
+ function Fi(e) {
4387
4399
  switch (e) {
4388
4400
  case "opus":
4389
4401
  return 1n;
@@ -4399,7 +4411,7 @@ function st(e) {
4399
4411
  if (e === 3n) return "pcma";
4400
4412
  throw new y(`unknown AudioCodec id ${e}`);
4401
4413
  }
4402
- function Mi(e) {
4414
+ function Pi(e) {
4403
4415
  switch (e) {
4404
4416
  case "none":
4405
4417
  return 0n;
@@ -4411,48 +4423,48 @@ function Mi(e) {
4411
4423
  return 3n;
4412
4424
  }
4413
4425
  }
4414
- function qn(e) {
4426
+ function Zn(e) {
4415
4427
  if (e === 0n) return "none";
4416
4428
  if (e === 1n) return "uplink";
4417
4429
  if (e === 2n) return "downlink";
4418
4430
  if (e === 3n) return "both";
4419
4431
  throw new y(`unknown MuteScope id ${e}`);
4420
4432
  }
4421
- function xi(e) {
4433
+ function Vi(e) {
4422
4434
  if (e === 1n) return "normal";
4423
4435
  if (e === 2n) return "userCancel";
4424
4436
  if (e === 3n) return "error";
4425
4437
  throw new y(`unknown HangupReason id ${e}`);
4426
4438
  }
4427
- function Hn(e) {
4439
+ function zn(e) {
4428
4440
  if (e === 1n) return "client";
4429
4441
  if (e === 2n) return "controller";
4430
4442
  if (e === 3n) return "engine";
4431
4443
  if (e === 4n) return "networkLost";
4432
4444
  throw new y(`unknown Origin id ${e}`);
4433
4445
  }
4434
- function Pi(e) {
4446
+ function Gi(e) {
4435
4447
  if (e === 1n) return "active";
4436
4448
  if (e === 2n) return "held";
4437
4449
  if (e === 3n) return "muted";
4438
4450
  if (e === 4n) return "hangup";
4439
4451
  throw new y(`unknown PeerState id ${e}`);
4440
4452
  }
4441
- function Vi(e) {
4453
+ function Bi(e) {
4442
4454
  if (e === 1n) return "codecMismatch";
4443
4455
  if (e === 2n) return "unsupportedClass";
4444
4456
  if (e === 3n) return "capacityExceeded";
4445
4457
  throw new y(`unknown TrackRejectionReason id ${e}`);
4446
4458
  }
4447
- function Fi(e, t) {
4448
- t.putVarint(Oi(e.class)), t.putVarint(Di(e.purpose)), t.putVarint(e.codecs.length);
4449
- for (const n of e.codecs) t.putVarint(Li(n));
4459
+ function Yi(e, t) {
4460
+ t.putVarint(Ui(e.class)), t.putVarint(Mi(e.purpose)), t.putVarint(e.codecs.length);
4461
+ for (const n of e.codecs) t.putVarint(Fi(n));
4450
4462
  }
4451
- function Zn(e, t) {
4463
+ function Qn(e, t) {
4452
4464
  t.putVarint(e.length);
4453
- for (const n of e) Fi(n, t);
4465
+ for (const n of e) Yi(n, t);
4454
4466
  }
4455
- function Gi(e) {
4467
+ function $i(e) {
4456
4468
  return {
4457
4469
  offerIndex: Number(e.getVarint()),
4458
4470
  alias: e.getVarint(),
@@ -4460,116 +4472,122 @@ function Gi(e) {
4460
4472
  frameSizeMs: Number(e.getVarint())
4461
4473
  };
4462
4474
  }
4463
- function zn(e) {
4475
+ function Jn(e) {
4464
4476
  const t = Number(e.getVarint()), n = [];
4465
- for (let s = 0; s < t; s++) n.push(Gi(e));
4477
+ for (let s = 0; s < t; s++) n.push($i(e));
4466
4478
  return n;
4467
4479
  }
4468
- function Bi(e) {
4480
+ function Xi(e) {
4469
4481
  return {
4470
4482
  offerIndex: Number(e.getVarint()),
4471
- reason: Vi(e.getVarint())
4483
+ reason: Bi(e.getVarint())
4472
4484
  };
4473
4485
  }
4474
- function Qn(e) {
4486
+ function es(e) {
4475
4487
  const t = Number(e.getVarint()), n = [];
4476
- for (let s = 0; s < t; s++) n.push(Bi(e));
4488
+ for (let s = 0; s < t; s++) n.push(Xi(e));
4477
4489
  return n;
4478
4490
  }
4479
- function Yi(e) {
4491
+ function Ki(e) {
4480
4492
  return {
4481
4493
  peerEndpointId: e.getString(),
4482
4494
  alias: e.getVarint(),
4483
4495
  codec: st(e.getVarint())
4484
4496
  };
4485
4497
  }
4486
- function $i(e) {
4487
- const t = e.getVarint(), n = qn(e.getVarint()), s = e.getVarint() !== 0n, r = Number(e.getVarint()), i = [];
4488
- for (let a = 0; a < r; a++) i.push(Yi(e));
4498
+ function Wi(e) {
4499
+ const t = e.getVarint(), n = Zn(e.getVarint()), s = e.getVarint() !== 0n, r = Number(e.getVarint()), i = [];
4500
+ for (let a = 0; a < r; a++) i.push(Ki(e));
4489
4501
  return { sessionSeq: t, mute: n, held: s, peers: i };
4490
4502
  }
4491
- function Xi(e) {
4492
- const t = new X();
4493
- return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putString(e.sdkName), t.putString(e.sdkVersion), Zn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
4503
+ function ji(e) {
4504
+ const t = new G();
4505
+ return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putString(e.sdkName), t.putString(e.sdkVersion), Qn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
4494
4506
  }
4495
- function Ki(e) {
4496
- const t = new X();
4497
- return t.putVarint(e.requestId), Zn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
4507
+ function qi(e) {
4508
+ const t = new G();
4509
+ return t.putVarint(e.requestId), Qn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
4498
4510
  }
4499
- function Wi(e) {
4500
- const t = new X();
4501
- return t.putVarint(e.requestId), t.putVarint(Mi(e.scope)), t.toUint8Array();
4511
+ function Hi(e) {
4512
+ const t = new G();
4513
+ return t.putVarint(e.requestId), t.putVarint(Pi(e.scope)), t.toUint8Array();
4502
4514
  }
4503
- function ji(e) {
4504
- const t = new X();
4515
+ function Zi(e) {
4516
+ const t = new G();
4505
4517
  return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putVarint(e.lastEventSeq), t.toUint8Array();
4506
4518
  }
4507
- function qi(e) {
4519
+ function zi(e) {
4520
+ if (!Hn(e.digit))
4521
+ throw new y("invalid DTMF symbol");
4522
+ const t = new G();
4523
+ return t.putVarint(e.requestId), t.putU8(e.digit.charCodeAt(0)), t.toUint8Array();
4524
+ }
4525
+ function Qi(e) {
4508
4526
  return {
4509
4527
  requestId: e.getVarint(),
4510
4528
  serverEpochUnix: e.getVarint(),
4511
4529
  canonicalPcmRate: Number(e.getVarint()),
4512
- bindings: zn(e),
4513
- rejected: Qn(e)
4530
+ bindings: Jn(e),
4531
+ rejected: es(e)
4514
4532
  };
4515
4533
  }
4516
- function Hi(e) {
4534
+ function Ji(e) {
4517
4535
  return {
4518
4536
  requestId: e.getVarint(),
4519
- bindings: zn(e),
4520
- rejected: Qn(e)
4537
+ bindings: Jn(e),
4538
+ rejected: es(e)
4521
4539
  };
4522
4540
  }
4523
- function Zi(e) {
4541
+ function tn(e) {
4524
4542
  return { requestId: e.getVarint() };
4525
4543
  }
4526
- function zi(e) {
4544
+ function ea(e) {
4527
4545
  return {
4528
4546
  requestId: e.getVarint(),
4529
- state: $i(e)
4547
+ state: Wi(e)
4530
4548
  };
4531
4549
  }
4532
- function Qi(e) {
4550
+ function ta(e) {
4533
4551
  return {
4534
4552
  requestId: e.getVarint(),
4535
4553
  peerEndpointId: e.getString(),
4536
4554
  alias: e.getVarint(),
4537
- class: Ci(e.getVarint()),
4538
- purpose: Ui(e.getVarint()),
4555
+ class: Li(e.getVarint()),
4556
+ purpose: xi(e.getVarint()),
4539
4557
  codec: st(e.getVarint()),
4540
4558
  frameSizeMs: Number(e.getVarint())
4541
4559
  };
4542
4560
  }
4543
- function Ji(e) {
4561
+ function na(e) {
4544
4562
  return {
4545
4563
  requestId: e.getVarint(),
4546
4564
  peerEndpointId: e.getString()
4547
4565
  };
4548
4566
  }
4549
- function ea(e) {
4567
+ function sa(e) {
4550
4568
  return {
4551
4569
  requestId: e.getVarint(),
4552
4570
  endpointId: e.getString(),
4553
- scope: qn(e.getVarint()),
4554
- origin: Hn(e.getVarint())
4571
+ scope: Zn(e.getVarint()),
4572
+ origin: zn(e.getVarint())
4555
4573
  };
4556
4574
  }
4557
- function ta(e) {
4575
+ function ra(e) {
4558
4576
  return {
4559
4577
  requestId: e.getVarint(),
4560
4578
  endpointId: e.getString(),
4561
- reason: xi(e.getVarint()),
4562
- origin: Hn(e.getVarint())
4579
+ reason: Vi(e.getVarint()),
4580
+ origin: zn(e.getVarint())
4563
4581
  };
4564
4582
  }
4565
- function na(e) {
4583
+ function ia(e) {
4566
4584
  return {
4567
4585
  requestId: e.getVarint(),
4568
4586
  peerEndpointId: e.getString(),
4569
- state: Pi(e.getVarint())
4587
+ state: Gi(e.getVarint())
4570
4588
  };
4571
4589
  }
4572
- function sa(e) {
4590
+ function aa(e) {
4573
4591
  const t = e.getVarint();
4574
4592
  let n;
4575
4593
  if (t === 0n)
@@ -4579,9 +4597,9 @@ function sa(e) {
4579
4597
  else
4580
4598
  throw new y(`MoqError.request_id present tag ${t} not in {0,1}`);
4581
4599
  const s = e.getVarint(), r = e.getString();
4582
- return { requestId: n, code: ra(s), rawCode: s, detail: r };
4600
+ return { requestId: n, code: oa(s), rawCode: s, detail: r };
4583
4601
  }
4584
- function ra(e) {
4602
+ function oa(e) {
4585
4603
  switch (e) {
4586
4604
  case 0x1001n:
4587
4605
  return "endpointNotProvisioned";
@@ -4609,7 +4627,7 @@ function ra(e) {
4609
4627
  return null;
4610
4628
  }
4611
4629
  }
4612
- const ia = /* @__PURE__ */ new Set([
4630
+ const ca = /* @__PURE__ */ new Set([
4613
4631
  "sessionEnded",
4614
4632
  "tokenInvalid",
4615
4633
  "tokenExpired",
@@ -4647,7 +4665,7 @@ class be {
4647
4665
  }
4648
4666
  /** Encode + write one control frame. Honours WT backpressure. */
4649
4667
  async sendControl(t) {
4650
- const n = Ai(t);
4668
+ const n = vi(t);
4651
4669
  await this.controlWriter.ready, await this.controlWriter.write(n);
4652
4670
  }
4653
4671
  /**
@@ -4659,7 +4677,7 @@ class be {
4659
4677
  let t = new Uint8Array(0);
4660
4678
  for (; ; ) {
4661
4679
  for (; ; ) {
4662
- const i = Ri(t);
4680
+ const i = Oi(t);
4663
4681
  if (!i) break;
4664
4682
  yield i.msg, t = t.subarray(i.consumed);
4665
4683
  }
@@ -4734,8 +4752,8 @@ class be {
4734
4752
  }
4735
4753
  }
4736
4754
  }
4737
- const aa = 2e3;
4738
- class oa {
4755
+ const ua = 2e3;
4756
+ class la {
4739
4757
  constructor(t) {
4740
4758
  this.ctx = null, this.node = null, this.micStream = null, this.micSource = null, this.silenceSource = null, this.micDiagAnalyser = null, this.micDiagTimer = null, this.outboundCallback = null, this.downlinkFeedbackCallback = null, this.captureGeneration = 0, this.outboundCaptureGeneration = null, this.outputGateEpoch = 0, this.captureCommandId = 0, this.captureAcks = /* @__PURE__ */ new Map(), this.options = {
4741
4759
  wasmUrl: t.wasmUrl,
@@ -4945,7 +4963,7 @@ class oa {
4945
4963
  const n = ++this.captureCommandId, s = new Promise((r, i) => {
4946
4964
  const a = setTimeout(() => {
4947
4965
  this.captureAcks.get(n)?.expected === t && (this.captureAcks.delete(n), i(new Error(`${t} acknowledgement timed out`)));
4948
- }, aa);
4966
+ }, ua);
4949
4967
  this.captureAcks.set(n, { expected: t, resolve: r, reject: i, timeout: a });
4950
4968
  });
4951
4969
  return { commandId: n, ack: s };
@@ -4972,16 +4990,16 @@ class oa {
4972
4990
  }
4973
4991
  }
4974
4992
  }
4975
- const tn = [100, 250, 500, 1e3], ca = 1e4, ua = 50;
4976
- function nn(e, t) {
4993
+ const nn = [100, 250, 500, 1e3], da = 1e4, ha = 50;
4994
+ function sn(e, t) {
4977
4995
  return new URL(t, e.endsWith("/") ? e : `${e}/`).href;
4978
4996
  }
4979
- const la = new URL("./audio/wasm-gen/origon_web_audio_bg.wasm?no-inline", import.meta.url).href, da = new URL("./audio/audio-processor.js?no-inline", import.meta.url).href;
4980
- class ha {
4997
+ const fa = new URL("./audio/wasm-gen/origon_web_audio_bg.wasm?no-inline", import.meta.url).href, ma = new URL("./audio/audio-processor.js?no-inline", import.meta.url).href;
4998
+ class pa {
4981
4999
  constructor(t, n) {
4982
- this.transport = null, this.requestIdCtr = 1n, this.uplinkAlias = null, this.peerAliasByEndpoint = /* @__PURE__ */ new Map(), this.pendingRequests = /* @__PURE__ */ new Map(), this.closedTransports = /* @__PURE__ */ new WeakSet(), this.lastEventSeq = 0n, this.terminalReason = null, this.statsSubscriberCount = 0, this.latestStats = null, this.statsSubscribers = /* @__PURE__ */ new Set(), this.currentMuteScope = "none", this.startGeneration = 0, this.captureTransition = Promise.resolve(), this.captureGeneration = 0, this.localCaptureEnabled = !1, this.desiredCoach = !1, this.diagTx = 0, this.diagRx = 0, this.diagLastStatsLog = 0, this.sessionId = t.sessionId, this.url = `${t.url.replace(/\/$/, "")}/web`, this.callToken = t.token, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
4983
- const s = n.assetBaseUrl ? nn(n.assetBaseUrl, "audio/wasm-gen/origon_web_audio_bg.wasm") : la, r = n.assetBaseUrl ? nn(n.assetBaseUrl, "audio/audio-processor.js") : da;
4984
- this.host = new oa({
5000
+ this.transport = null, this.requestIdCtr = 1n, this.uplinkAlias = null, this.peerAliasByEndpoint = /* @__PURE__ */ new Map(), this.pendingRequests = /* @__PURE__ */ new Map(), this.closedTransports = /* @__PURE__ */ new WeakSet(), this.lastEventSeq = 0n, this.terminalReason = null, this.controlReady = !1, this.statsSubscriberCount = 0, this.latestStats = null, this.statsSubscribers = /* @__PURE__ */ new Set(), this.currentMuteScope = "none", this.startGeneration = 0, this.captureTransition = Promise.resolve(), this.captureGeneration = 0, this.localCaptureEnabled = !1, this.desiredCoach = !1, this.diagTx = 0, this.diagRx = 0, this.diagLastStatsLog = 0, this.sessionId = t.sessionId, this.url = `${t.url.replace(/\/$/, "")}/web`, this.callToken = t.token, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
5001
+ const s = n.assetBaseUrl ? sn(n.assetBaseUrl, "audio/wasm-gen/origon_web_audio_bg.wasm") : fa, r = n.assetBaseUrl ? sn(n.assetBaseUrl, "audio/audio-processor.js") : ma;
5002
+ this.host = new la({
4985
5003
  wasmUrl: s,
4986
5004
  processorUrl: r,
4987
5005
  onStats: (i) => this.handleHostStats(i),
@@ -5017,7 +5035,7 @@ class ha {
5017
5035
  }
5018
5036
  /** Graceful local close. */
5019
5037
  async disconnect() {
5020
- this.startGeneration += 1, this.captureGeneration += 1, this.host.closeCapture(), this.localCaptureEnabled = !1, this.desiredCoach = !1, this.terminalReason === null && (this.terminalReason = { kind: "localClose" }), this.rejectPendingRequests(new Error("voice session disconnected")), this.transport?.close({ closeCode: 0, reason: "" }), await this.host.dispose();
5038
+ this.startGeneration += 1, this.captureGeneration += 1, this.controlReady = !1, this.host.closeCapture(), this.localCaptureEnabled = !1, this.desiredCoach = !1, this.terminalReason === null && (this.terminalReason = { kind: "localClose" }), this.rejectPendingRequests(new Error("voice session disconnected")), this.transport?.close({ closeCode: 0, reason: "" }), await this.host.dispose();
5021
5039
  }
5022
5040
  /**
5023
5041
  * Re-tag this session's id in place. The media transport is keyed by
@@ -5037,6 +5055,19 @@ class ha {
5037
5055
  throw new Error(`expected MuteOk, got ${s.type}`);
5038
5056
  this.currentMuteScope = t;
5039
5057
  }
5058
+ /** Send one DTMF symbol to the active CX flow. Never queued across Resume. */
5059
+ async sendDtmf(t) {
5060
+ if (!Hn(t))
5061
+ throw new Error("invalid DTMF digit");
5062
+ if (!this.controlReady)
5063
+ throw new Error("DTMF is unavailable while voice transport is not connected");
5064
+ const n = this.nextRequestId(), s = await this.sendRequest(n, {
5065
+ type: "sendDtmf",
5066
+ data: { requestId: n, digit: t }
5067
+ });
5068
+ if (s.type !== "sendDtmfOk")
5069
+ throw new Error(`expected SendDtmfOk, got ${s.type}`);
5070
+ }
5040
5071
  /** Listen → Coach: acquire/enable locally while muted, then unmute. */
5041
5072
  enableCapture() {
5042
5073
  const t = ++this.captureGeneration;
@@ -5116,7 +5147,7 @@ class ha {
5116
5147
  const a = i.data, o = a.bindings[0];
5117
5148
  if (!o)
5118
5149
  throw new Error("ConnectOk has no track bindings");
5119
- this.uplinkAlias = o.alias, this.host.setServerEpochUnix(a.serverEpochUnix), t ? (this.desiredCoach = !1, await this.setMute("uplink")) : (this.desiredCoach = !0, await this.host.enableCapture(o.alias), this.localCaptureEnabled = !0, await this.host.openCapture()), this.assertStartActive(n), this.dispatcher.fire("onConnected", this.sessionId, "voice"), this.watchTransportClosed();
5150
+ this.uplinkAlias = o.alias, this.host.setServerEpochUnix(a.serverEpochUnix), t ? (this.desiredCoach = !1, await this.setMute("uplink")) : (this.desiredCoach = !0, await this.host.enableCapture(o.alias), this.localCaptureEnabled = !0, await this.host.openCapture()), this.assertStartActive(n), this.controlReady = !0, this.dispatcher.fire("onConnected", this.sessionId, "voice"), this.watchTransportClosed();
5120
5151
  }
5121
5152
  startReadLoops() {
5122
5153
  this.controlReadLoop(), this.datagramReadLoop();
@@ -5137,7 +5168,7 @@ class ha {
5137
5168
  for await (const n of t.readDatagrams()) {
5138
5169
  let s;
5139
5170
  try {
5140
- const r = ki(n);
5171
+ const r = Ri(n);
5141
5172
  if (r.cls === ie.AudioFeedback) {
5142
5173
  this.host.pushUplinkFeedback(r.body);
5143
5174
  continue;
@@ -5149,7 +5180,7 @@ class ha {
5149
5180
  continue;
5150
5181
  }
5151
5182
  try {
5152
- const r = Si(s);
5183
+ const r = Ai(s);
5153
5184
  this.diagRx += 1, this.diagRx === 1 || this.diagRx % 100;
5154
5185
  } catch {
5155
5186
  }
@@ -5160,7 +5191,7 @@ class ha {
5160
5191
  }
5161
5192
  dispatchInbound(t, n) {
5162
5193
  if (n === this.transport) {
5163
- if (t.type === "connectOk" || t.type === "muteOk" || t.type === "resumeOk" || t.type === "negotiateMediaOk") {
5194
+ if (t.type === "connectOk" || t.type === "muteOk" || t.type === "resumeOk" || t.type === "sendDtmfOk" || t.type === "negotiateMediaOk") {
5164
5195
  const s = t.data.requestId, r = this.pendingRequests.get(s);
5165
5196
  if (r) {
5166
5197
  this.pendingRequests.delete(s), r.resolve(t);
@@ -5170,7 +5201,7 @@ class ha {
5170
5201
  }
5171
5202
  if ("requestId" in t.data) {
5172
5203
  const s = t.data.requestId;
5173
- s !== null && s !== 0n && (this.lastEventSeq = fa(this.lastEventSeq, s));
5204
+ s !== null && s !== 0n && (this.lastEventSeq = ba(this.lastEventSeq, s));
5174
5205
  }
5175
5206
  switch (t.type) {
5176
5207
  case "peerAttached": {
@@ -5203,10 +5234,10 @@ class ha {
5203
5234
  }
5204
5235
  case "moqError": {
5205
5236
  const s = t.data.code;
5206
- if (s === null || ia.has(s)) {
5237
+ if (s === null || ca.has(s)) {
5207
5238
  const i = s ?? "unknown";
5208
5239
  this.enterTerminalState(
5209
- s === null ? { kind: "protocolViolation" } : ma(s),
5240
+ s === null ? { kind: "protocolViolation" } : ga(s),
5210
5241
  new Error(`terminal MoqError ${i}`),
5211
5242
  `terminal MoqError ${i}`
5212
5243
  );
@@ -5214,7 +5245,9 @@ class ha {
5214
5245
  const r = t.data.requestId;
5215
5246
  if (r !== null) {
5216
5247
  const i = this.pendingRequests.get(r);
5217
- i && (this.pendingRequests.delete(r), i.reject(new Error(`MoqError ${s ?? "unknown"}: ${t.data.detail}`)));
5248
+ i && (this.pendingRequests.delete(r), i.reject(new Error(
5249
+ i.requestType === "sendDtmf" ? `DTMF request failed: MoqError ${s ?? "unknown"}` : `MoqError ${s ?? "unknown"}: ${t.data.detail}`
5250
+ )));
5218
5251
  } else
5219
5252
  this.dispatcher.fire(
5220
5253
  "onCallError",
@@ -5236,17 +5269,17 @@ class ha {
5236
5269
  await t.closed;
5237
5270
  } catch {
5238
5271
  }
5239
- if (this.rejectPendingRequestsForTransport(
5272
+ if (this.controlReady = !1, this.rejectPendingRequestsForTransport(
5240
5273
  t,
5241
5274
  new Error("voice transport closed before control acknowledgement")
5242
- ), this.closedTransports.add(t), this.host.cancelCaptureTransition(!1), this.localCaptureEnabled || (this.captureGeneration += 1, this.host.cancelCaptureTransition(!0)), await W(ua), this.terminalReason) {
5275
+ ), this.closedTransports.add(t), this.host.cancelCaptureTransition(!1), this.localCaptureEnabled || (this.captureGeneration += 1, this.host.cancelCaptureTransition(!0)), await W(ha), this.terminalReason) {
5243
5276
  this.host.dispose().catch(() => {
5244
5277
  }), this.onTerminal(this.terminalReason, this.sessionId);
5245
5278
  return;
5246
5279
  }
5247
5280
  this.transport === t && (this.transport = null);
5248
- for (let r = 1; r <= tn.length && this.isStartActive(n); r++) {
5249
- const i = tn[r - 1];
5281
+ for (let r = 1; r <= nn.length && this.isStartActive(n); r++) {
5282
+ const i = nn[r - 1];
5250
5283
  this.dispatcher.fire("onReconnecting", this.sessionId, "voice", {
5251
5284
  attempt: r,
5252
5285
  reason: { kind: "networkLoss" }
@@ -5278,7 +5311,7 @@ class ha {
5278
5311
  });
5279
5312
  if (r.type !== "resumeOk")
5280
5313
  throw new Error(`expected ResumeOk, got ${r.type}`);
5281
- this.assertStartActive(t), this.restoreFromSnapshot(r.data.state), await this.reopenCaptureAfterResume();
5314
+ this.assertStartActive(t), this.restoreFromSnapshot(r.data.state), await this.reopenCaptureAfterResume(), this.assertStartActive(t), this.controlReady = !0;
5282
5315
  }
5283
5316
  restoreFromSnapshot(t) {
5284
5317
  const n = new Set(t.peers.map((s) => s.peerEndpointId));
@@ -5327,7 +5360,7 @@ class ha {
5327
5360
  this.pendingRequests.delete(n), s.reject(t);
5328
5361
  }
5329
5362
  enterTerminalState(t, n, s) {
5330
- this.terminalReason = t, this.startGeneration += 1, this.captureGeneration += 1, this.host.cancelCaptureTransition(!0), this.localCaptureEnabled = !1, this.desiredCoach = !1, this.rejectPendingRequests(n), this.transport?.close({ closeCode: 0, reason: s });
5363
+ this.terminalReason = t, this.controlReady = !1, this.startGeneration += 1, this.captureGeneration += 1, this.host.cancelCaptureTransition(!0), this.localCaptureEnabled = !1, this.desiredCoach = !1, this.rejectPendingRequests(n), this.transport?.close({ closeCode: 0, reason: s });
5331
5364
  }
5332
5365
  rejectPendingRequestsForTransport(t, n) {
5333
5366
  for (const [s, r] of this.pendingRequests)
@@ -5350,9 +5383,10 @@ class ha {
5350
5383
  }
5351
5384
  const a = setTimeout(() => {
5352
5385
  this.pendingRequests.delete(t) && r(new Error(`request ${t} timed out`));
5353
- }, ca);
5386
+ }, da);
5354
5387
  this.pendingRequests.set(t, {
5355
5388
  transport: i,
5389
+ requestType: n.type,
5356
5390
  resolve: (o) => {
5357
5391
  clearTimeout(a), s(o);
5358
5392
  },
@@ -5375,7 +5409,7 @@ class ha {
5375
5409
  /** Outbound datagram payload — for tests / external pumps. */
5376
5410
  encodeAudioObject(t) {
5377
5411
  if (this.uplinkAlias === null) throw new Error("uplink alias not negotiated");
5378
- return Ti({
5412
+ return ki({
5379
5413
  trackAlias: this.uplinkAlias,
5380
5414
  groupId: t.groupId,
5381
5415
  objectId: t.objectId,
@@ -5388,10 +5422,10 @@ class ha {
5388
5422
  return this.currentMuteScope;
5389
5423
  }
5390
5424
  }
5391
- function fa(e, t) {
5425
+ function ba(e, t) {
5392
5426
  return e > t ? e : t;
5393
5427
  }
5394
- function ma(e) {
5428
+ function ga(e) {
5395
5429
  switch (e) {
5396
5430
  case "sessionEnded":
5397
5431
  return { kind: "sessionEnded" };
@@ -5417,20 +5451,20 @@ function ma(e) {
5417
5451
  return { kind: "replayLost" };
5418
5452
  }
5419
5453
  }
5420
- class pa {
5454
+ class Ea {
5421
5455
  constructor() {
5422
- this.config = null, this.http = null, this.sessionHttp = null, this.dispatcher = new Jn(), this.sessions = /* @__PURE__ */ new Map(), this.pendingUploads = /* @__PURE__ */ new Map();
5456
+ this.config = null, this.http = null, this.sessionHttp = null, this.dispatcher = new ts(), this.sessions = /* @__PURE__ */ new Map(), this.pendingUploads = /* @__PURE__ */ new Map();
5423
5457
  }
5424
5458
  // ── Lifecycle ────────────────────────────────────────────────────────
5425
5459
  initialize(t) {
5426
5460
  if (!t.endpoint) throw h.missingField("endpoint");
5427
- const n = t.attachmentBaseUrl === void 0 ? void 0 : Ea(t.endpoint, t.attachmentBaseUrl);
5461
+ const n = t.attachmentBaseUrl === void 0 ? void 0 : Ia(t.endpoint, t.attachmentBaseUrl);
5428
5462
  if (n !== void 0 && !t.token)
5429
5463
  throw h.missingField("token");
5430
- this.attributes = t.attributes ? { ...t.attributes } : void 0, this.assetBaseUrl = t.assetBaseUrl, this.attachmentBaseUrl = n, this.attachmentBearer = n === void 0 ? void 0 : t.token, this.userId = t.userId ?? pi(), this.http = new ii({
5464
+ this.attributes = t.attributes ? { ...t.attributes } : void 0, this.assetBaseUrl = t.assetBaseUrl, this.attachmentBaseUrl = n, this.attachmentBearer = n === void 0 ? void 0 : t.token, this.userId = t.userId ?? gi(), this.http = new oi({
5431
5465
  endpoint: t.endpoint,
5432
5466
  ...t.token ? { token: t.token } : {}
5433
- }), this.sessionHttp = new ai(this.http, this.userId);
5467
+ }), this.sessionHttp = new ci(this.http, this.userId);
5434
5468
  }
5435
5469
  async authenticate() {
5436
5470
  const n = await this.requireSessionHttp().postConfig();
@@ -5466,7 +5500,7 @@ class pa {
5466
5500
  const n = this.requireSessionHttp();
5467
5501
  if (t.sessionId && this.sessions.has(t.sessionId))
5468
5502
  throw h.other(`session already active: ${t.sessionId}`);
5469
- const s = ba(this.attributes, t.data), r = { channel: t.channel };
5503
+ const s = ya(this.attributes, t.data), r = { channel: t.channel };
5470
5504
  t.sessionId && (r.sessionId = t.sessionId), s && (r.data = s);
5471
5505
  const i = await n.startSession(r);
5472
5506
  return t.channel, await this.attachSession(i, t.channel), { sessionId: i.sessionId };
@@ -5486,7 +5520,7 @@ class pa {
5486
5520
  throw h.other('chat join options require channel "chat"');
5487
5521
  if (t.channel === "chat" && t.voice !== void 0)
5488
5522
  throw h.other('voice join options require channel "voice"');
5489
- const n = t.channel === "chat" ? ga(t.chat?.recovery) : void 0, s = {
5523
+ const n = t.channel === "chat" ? wa(t.chat?.recovery) : void 0, s = {
5490
5524
  sessionId: t.sessionId,
5491
5525
  url: t.url,
5492
5526
  token: t.token
@@ -5510,7 +5544,7 @@ class pa {
5510
5544
  */
5511
5545
  async attachSession(t, n, s = !1, r) {
5512
5546
  if (n === "voice") {
5513
- const a = new ha(t, {
5547
+ const a = new pa(t, {
5514
5548
  dispatcher: this.dispatcher,
5515
5549
  // `sessionId` is the session's *current* id (post-`rename()`), not the
5516
5550
  // one captured at construction — so a migrated session tears down its
@@ -5539,7 +5573,7 @@ class pa {
5539
5573
  }
5540
5574
  return;
5541
5575
  }
5542
- const i = new ri(t, {
5576
+ const i = new ai(t, {
5543
5577
  sessionHttp: this.requireSessionHttp(),
5544
5578
  provisionedRecovery: r,
5545
5579
  dispatcher: this.dispatcher,
@@ -5593,6 +5627,10 @@ class pa {
5593
5627
  setMute(t, n) {
5594
5628
  return this.requireVoiceSession(t).setMute(n);
5595
5629
  }
5630
+ /** Send one DTMF symbol to the active CX flow for a voice session. */
5631
+ sendDtmf(t, n) {
5632
+ return this.requireVoiceSession(t).sendDtmf(n);
5633
+ }
5596
5634
  /** Enable microphone coaching on a receive-only voice join. */
5597
5635
  enableCapture(t) {
5598
5636
  return this.requireVoiceSession(t).enableCapture();
@@ -5625,13 +5663,13 @@ class pa {
5625
5663
  * defers the whole decision to the server).
5626
5664
  */
5627
5665
  async uploadAttachment(t, n) {
5628
- const s = this.requireHttp(), r = this.config?.attachmentPolicy, i = fi(t, r);
5666
+ const s = this.requireHttp(), r = this.config?.attachmentPolicy, i = pi(t, r);
5629
5667
  if (!i.ok) throw i.error;
5630
5668
  const a = new AbortController();
5631
5669
  this.pendingUploads.set(n.uploadId, a);
5632
5670
  try {
5633
- const o = wa(a.signal, n.signal), l = this.attachmentBaseUrl ?? s.buildAbsoluteUrl("/attachment");
5634
- return await ui(
5671
+ const o = Ta(a.signal, n.signal), l = this.attachmentBaseUrl ?? s.buildAbsoluteUrl("/attachment");
5672
+ return await di(
5635
5673
  `${l}/upload`,
5636
5674
  t,
5637
5675
  { ...n, signal: o },
@@ -5685,14 +5723,14 @@ class pa {
5685
5723
  }
5686
5724
  }
5687
5725
  let Oe = null;
5688
- function Ia() {
5689
- return Oe || (Oe = new pa()), Oe;
5726
+ function Sa() {
5727
+ return Oe || (Oe = new Ea()), Oe;
5690
5728
  }
5691
- function ba(e, t) {
5729
+ function ya(e, t) {
5692
5730
  if (!(!e && !t))
5693
5731
  return e ? t ? { ...t, attributes: { ...e, ...t.attributes } } : { attributes: e } : t;
5694
5732
  }
5695
- function ga(e) {
5733
+ function wa(e) {
5696
5734
  if (e !== void 0) {
5697
5735
  if (e.replay !== "server")
5698
5736
  throw h.other('provisioned chat recovery requires replay "server"');
@@ -5703,18 +5741,18 @@ function ga(e) {
5703
5741
  return { ...e, delaysMs: [...e.delaysMs] };
5704
5742
  }
5705
5743
  }
5706
- function Ea(e, t) {
5744
+ function Ia(e, t) {
5707
5745
  let n, s;
5708
5746
  try {
5709
5747
  n = new URL(e), s = new URL(t, n);
5710
5748
  } catch {
5711
5749
  throw h.other("invalid attachmentBaseUrl");
5712
5750
  }
5713
- if (t.trim() === "" || t.trim() !== t || !t.startsWith("/") && !/^https?:\/\//.test(t) || ya(t) || s.protocol !== "https:" && s.protocol !== "http:" || s.origin !== n.origin || s.username !== "" || s.password !== "" || s.search !== "" || s.hash !== "" || s.pathname === "/")
5751
+ if (t.trim() === "" || t.trim() !== t || !t.startsWith("/") && !/^https?:\/\//.test(t) || Na(t) || s.protocol !== "https:" && s.protocol !== "http:" || s.origin !== n.origin || s.username !== "" || s.password !== "" || s.search !== "" || s.hash !== "" || s.pathname === "/")
5714
5752
  throw h.other("attachmentBaseUrl must be an HTTP(S) path on the endpoint origin");
5715
5753
  return s.toString().replace(/\/$/, "");
5716
5754
  }
5717
- function ya(e) {
5755
+ function Na(e) {
5718
5756
  let t = e;
5719
5757
  for (let r = e.length + 1; r > 0; r -= 1) {
5720
5758
  if (t.includes("\\")) return !0;
@@ -5749,12 +5787,12 @@ function ya(e) {
5749
5787
  }
5750
5788
  return !0;
5751
5789
  }
5752
- function wa(e, t) {
5790
+ function Ta(e, t) {
5753
5791
  if (!t) return e;
5754
5792
  const n = new AbortController(), s = () => n.abort();
5755
5793
  return e.aborted || t.aborted ? (n.abort(), n.signal) : (e.addEventListener("abort", s, { once: !0 }), t.addEventListener("abort", s, { once: !0 }), n.signal);
5756
5794
  }
5757
- const Na = {
5795
+ const ka = {
5758
5796
  AI: "ai",
5759
5797
  EXTERNAL: "external",
5760
5798
  USER: "user",
@@ -5762,9 +5800,9 @@ const Na = {
5762
5800
  };
5763
5801
  export {
5764
5802
  h as ClientError,
5765
- Na as MESSAGE_ROLES,
5766
- T as OrpcError,
5767
- pa as SessionManager,
5768
- Ia as getSessionManager
5803
+ ka as MESSAGE_ROLES,
5804
+ S as OrpcError,
5805
+ Ea as SessionManager,
5806
+ Sa as getSessionManager
5769
5807
  };
5770
5808
  //# sourceMappingURL=origon-web-sdk.js.map